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