Module: UI::CommandDialogBehavior
- Included in:
- CommandDialog, CommandDialogComponent
- Defined in:
- app/behaviors/ui/command_dialog_behavior.rb
Instance Method Summary collapse
- #command_dialog_base_classes ⇒ Object
- #command_dialog_classes ⇒ Object
- #command_dialog_content_classes ⇒ Object
- #command_dialog_html_attributes ⇒ Object
- #shortcut_action ⇒ Object
Instance Method Details
#command_dialog_base_classes ⇒ Object
20 21 22 |
# File 'app/behaviors/ui/command_dialog_behavior.rb', line 20 def command_dialog_base_classes "" end |
#command_dialog_classes ⇒ Object
24 25 26 |
# File 'app/behaviors/ui/command_dialog_behavior.rb', line 24 def command_dialog_classes UI::TailwindMerge.merge([command_dialog_base_classes, @classes].compact.join(" ")) end |
#command_dialog_content_classes ⇒ Object
43 44 45 |
# File 'app/behaviors/ui/command_dialog_behavior.rb', line 43 def command_dialog_content_classes "overflow-hidden p-0" end |
#command_dialog_html_attributes ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/behaviors/ui/command_dialog_behavior.rb', line 28 def command_dialog_html_attributes { data: { controller: "ui--command-dialog", ui__command_dialog_shortcut_value: @shortcut, action: "keydown.#{shortcut_action}@document->ui--command-dialog#toggle" } } end |
#shortcut_action ⇒ Object
38 39 40 41 |
# File 'app/behaviors/ui/command_dialog_behavior.rb', line 38 def shortcut_action # Convert "meta+j" to Stimulus format "meta+j" @shortcut.downcase end |