Class: Arara::StepConnectorComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::StepConnectorComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/step_connector_component.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#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', active: false, alternative_label: false, **kw) ⇒ StepConnectorComponent
constructor
A new instance of StepConnectorComponent.
- #line_options ⇒ Object
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', active: false, alternative_label: false, **kw) ⇒ StepConnectorComponent
Returns a new instance of StepConnectorComponent.
5 6 7 8 9 10 11 |
# File 'app/components/arara/step_connector_component.rb', line 5 def initialize(orientation: 'horizontal', active: false, alternative_label: false, **kw) @orientation = orientation @active = active @alternative_label = alternative_label super(tag: 'div', **kw) end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
3 4 5 |
# File 'app/components/arara/step_connector_component.rb', line 3 def active @active end |
#alternative_label ⇒ Object (readonly)
Returns the value of attribute alternative_label.
3 4 5 |
# File 'app/components/arara/step_connector_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/step_connector_component.rb', line 3 def orientation @orientation end |
Instance Method Details
#default_html_class ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/components/arara/step_connector_component.rb', line 13 def default_html_class classes = %w(MuiStepConnector-root) classes.push("MuiStepConnector-horizontal") if orientation == "horizontal" classes.push("MuiStepConnector-vertical") if orientation == "vertical" classes.push("MuiStepConnector-active") if active classes.push("Mui-disabled") unless active classes.push("MuiStepConnector-alternativeLabel") if alternative_label classes.join(" ") end |
#line_options ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/components/arara/step_connector_component.rb', line 23 def classes = %w(MuiStepConnector-line) classes.push("MuiStepConnector-lineHorizontal") if orientation == "horizontal" classes.push("MuiStepConnector-lineVertical") if orientation == "vertical" { class: classes.join(" ") } end |