Module: UI::InputBehavior
- Included in:
- Input, InputComponent
- Defined in:
- app/behaviors/ui/input_behavior.rb
Overview
UI::InputBehavior
Instance Method Summary collapse
-
#input_classes ⇒ Object
Returns combined CSS classes for the input.
-
#input_html_attributes ⇒ Object
Returns HTML attributes for the input element.
Instance Method Details
#input_classes ⇒ Object
Returns combined CSS classes for the input
35 36 37 38 39 40 41 42 43 44 |
# File 'app/behaviors/ui/input_behavior.rb', line 35 def input_classes classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ input_base_classes, input_focus_classes, input_validation_classes, classes_value ].compact.join(" ")) end |
#input_html_attributes ⇒ Object
Returns HTML attributes for the input element
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/behaviors/ui/input_behavior.rb', line 21 def input_html_attributes { type: @type, class: input_classes, placeholder: @placeholder, value: @value, name: @name, id: @id, readonly: @readonly, data: {slot: "input"} }.compact end |