Class: Daisy::DataDisplay::DiffComponent::ItemComponent
- Inherits:
-
LocoMotion::BasicComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- LocoMotion::BasicComponent
- Daisy::DataDisplay::DiffComponent::ItemComponent
- Defined in:
- app/components/daisy/data_display/diff_component.rb
Overview
A component for rendering individual items within the diff comparison.
Constant Summary collapse
- ITEM_CLASSES =
Full class name strings are required here so Tailwind’s scanner can detect them. String interpolation or comments are skipped by the Ruby extractor in Tailwind v4+.
%w[diff-item-1 diff-item-2].freeze
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
rubocop:enable Naming/AccessorMethodName.
-
#set_index(index) ⇒ Object
rubocop:disable Naming/AccessorMethodName.
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
rubocop:enable Naming/AccessorMethodName
55 56 57 |
# File 'app/components/daisy/data_display/diff_component.rb', line 55 def before_render add_css(:component, ITEM_CLASSES[@index - 1]) end |
#set_index(index) ⇒ Object
rubocop:disable Naming/AccessorMethodName
50 51 52 |
# File 'app/components/daisy/data_display/diff_component.rb', line 50 def set_index(index) @index = index end |