Class: Daisy::DataDisplay::TextRotateComponent::ItemComponent
- Inherits:
-
LocoMotion::BasicComponent
- Object
- LocoMotion::BaseComponent
- LocoMotion::BasicComponent
- Daisy::DataDisplay::TextRotateComponent::ItemComponent
- Defined in:
- app/components/daisy/data_display/text_rotate_component.rb
Overview
Renders an individual text item within the rotation. Supports optional links (via LocoMotion::Concerns::LinkableComponent) and icons (via LocoMotion::Concerns::IconableComponent).
Instance Method Summary collapse
-
#before_render ⇒ Object
Runs item-specific setup before rendering.
-
#call ⇒ Object
Renders the item, including optional left/right icons around the content.
-
#initialize(**kws, &block) ⇒ ItemComponent
constructor
Creates a new Text Rotate item.
Methods included from LocoMotion::Concerns::IconableComponent
#has_icons?, #left_icon_html, #render_left_icon, #render_right_icon, #right_icon_html
Methods inherited from LocoMotion::BasicComponent
Constructor Details
#initialize(**kws, &block) ⇒ ItemComponent
Creates a new Text Rotate item.
137 138 139 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 137 def initialize(**kws, &block) super end |
Instance Method Details
#before_render ⇒ Object
Runs item-specific setup before rendering. Runs before super so that
LinkableComponent can override the tag name to <a> when an href is set.
145 146 147 148 149 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 145 def before_render setup_component super end |
#call ⇒ Object
Renders the item, including optional left/right icons around the content.
154 155 156 157 158 159 160 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 154 def call part(:component) do concat(render_left_icon) concat(content) concat(render_right_icon) end end |