Module: UI::CommandInputBehavior
- Included in:
- CommandInput, CommandInputComponent
- Defined in:
- app/behaviors/ui/command_input_behavior.rb
Overview
InputBehavior
Shared behavior for CommandInput component.
Instance Method Summary collapse
- #command_input_classes ⇒ Object
- #command_input_data_attributes ⇒ Object
- #command_input_html_attributes ⇒ Object
- #command_input_wrapper_classes ⇒ Object
Instance Method Details
#command_input_classes ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/behaviors/ui/command_input_behavior.rb', line 28 def command_input_classes classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ command_input_base_classes, classes_value ].compact.join(" ")) end |
#command_input_data_attributes ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/behaviors/ui/command_input_behavior.rb', line 36 def command_input_data_attributes { slot: "command-input", ui__command_target: "input", action: "input->ui--command#filter keydown->ui--command#handleKeydown" } end |
#command_input_html_attributes ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/behaviors/ui/command_input_behavior.rb', line 13 def command_input_html_attributes { class: command_input_classes, data: command_input_data_attributes, type: "text", placeholder: @placeholder || "Type a command or search...", autocomplete: "off", autocorrect: "off", spellcheck: "false", role: "combobox", "aria-expanded": "true", "aria-autocomplete": "list" } end |
#command_input_wrapper_classes ⇒ Object
9 10 11 |
# File 'app/behaviors/ui/command_input_behavior.rb', line 9 def command_input_wrapper_classes "flex items-center border-b px-3" end |