Class: Daisy::DataDisplay::TextRotateComponent::ItemComponent
- Inherits:
-
LocoMotion::BasicComponent
- Object
- ViewComponent::Base
- 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).
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary
Attributes inherited from LocoMotion::BaseComponent
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.
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
Methods inherited from LocoMotion::BaseComponent
build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #initialize, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces
Methods included from LocoMotion::Concerns::InspectableComponent
Constructor Details
This class inherits a constructor from LocoMotion::BaseComponent
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.
69 70 71 72 73 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 69 def before_render setup_component super end |
#call ⇒ Object
Renders the item, including optional left/right icons around the content.
78 79 80 81 82 83 84 |
# File 'app/components/daisy/data_display/text_rotate_component.rb', line 78 def call part(:component) do concat(render_left_icon) concat(content) concat(render_right_icon) end end |