Class: Arara::StepperComponent

Inherits:
ActionView::Component::Base
  • Object
show all
Includes:
BaseComponent
Defined in:
app/components/arara/stepper_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseComponent

#default_data_controller, #default_html_tag, #html_class, #html_content, #html_data, #html_options, #html_tag, included

Constructor Details

#initialize(orientation: "horizontal", alternative_label: false, **kw) ⇒ StepperComponent

Returns a new instance of StepperComponent.


7
8
9
10
11
# File 'app/components/arara/stepper_component.rb', line 7

def initialize(orientation: "horizontal", alternative_label: false, **kw)
  @orientation = orientation
  @alternative_label = alternative_label
  super(tag: "div", **kw)
end

Instance Attribute Details

#alternative_labelObject (readonly)

Returns the value of attribute alternative_label


3
4
5
# File 'app/components/arara/stepper_component.rb', line 3

def alternative_label
  @alternative_label
end

#orientationObject (readonly)

Returns the value of attribute orientation


3
4
5
# File 'app/components/arara/stepper_component.rb', line 3

def orientation
  @orientation
end

Instance Method Details

#default_html_classObject


13
14
15
16
17
18
19
# File 'app/components/arara/stepper_component.rb', line 13

def default_html_class
  classes = %w(MuiStepper-root)
  classes.push("MuiStepper-horizontal") if orientation == "horizontal"
  classes.push("MuiStepper-vertical") if orientation == "vertical"
  classes.push("MuiStepper-alternativeLabel") if alternative_label
  classes.join(" ")
end