Module: UI::InputGroupBehavior
- Included in:
- InputGroup, InputGroupComponent
- Defined in:
- app/helpers/ui/input_group_behavior.rb,
app/behaviors/ui/input_group_behavior.rb
Overview
UI::InputGroupBehavior
Shared behavior for InputGroup component across ERB, ViewComponent, and Phlex implementations. This module provides consistent styling and HTML attribute generation for input groups.
Instance Method Summary collapse
-
#input_group_classes ⇒ Object
Returns combined CSS classes for the input group.
-
#input_group_html_attributes ⇒ Object
Returns HTML attributes for the input group wrapper.
Instance Method Details
#input_group_classes ⇒ Object
Returns combined CSS classes for the input group
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/ui/input_group_behavior.rb', line 19 def input_group_classes classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ input_group_base_classes, input_group_height_classes, input_group_alignment_classes, input_group_focus_classes, input_group_error_classes, classes_value ].compact.join(" ")) end |
#input_group_html_attributes ⇒ Object
Returns HTML attributes for the input group wrapper
9 10 11 12 13 14 15 16 |
# File 'app/helpers/ui/input_group_behavior.rb', line 9 def input_group_html_attributes attributes_value = respond_to?(:attributes, true) ? attributes : @attributes { "data-slot": "input-group", role: "group", class: input_group_classes }.merge(attributes_value).compact end |