Class: Arara::StepperComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::StepperComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/stepper_component.rb
Instance Attribute Summary collapse
-
#alternative_label ⇒ Object
readonly
Returns the value of attribute alternative_label.
-
#orientation ⇒ Object
readonly
Returns the value of attribute orientation.
Instance Method Summary collapse
- #default_html_class ⇒ Object
-
#initialize(orientation: "horizontal", alternative_label: false, **kw) ⇒ StepperComponent
constructor
A new instance of StepperComponent.
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_label ⇒ Object (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 |
#orientation ⇒ Object (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_class ⇒ Object
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 |