Module: UI::ItemGroupBehavior
- Included in:
- ItemGroup, ItemGroupComponent
- Defined in:
- app/behaviors/ui/item_group_behavior.rb
Overview
ItemGroupBehavior
Shared behavior for Item group container across ERB, ViewComponent, and Phlex implementations. This module provides consistent HTML attribute generation and styling.
Instance Method Summary collapse
-
#item_group_classes ⇒ Object
Returns combined CSS classes.
-
#item_group_html_attributes ⇒ Object
Returns HTML attributes for the item group element.
Instance Method Details
#item_group_classes ⇒ Object
Returns combined CSS classes
17 18 19 20 21 22 23 24 |
# File 'app/behaviors/ui/item_group_behavior.rb', line 17 def item_group_classes classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ item_group_base_classes, classes_value ].compact.join(" ")) end |
#item_group_html_attributes ⇒ Object
Returns HTML attributes for the item group element
9 10 11 12 13 14 |
# File 'app/behaviors/ui/item_group_behavior.rb', line 9 def item_group_html_attributes attributes_value = respond_to?(:attributes, true) ? attributes : @attributes { class: item_group_classes }.merge(attributes_value || {}) end |