Module: UI::CommandShortcutBehavior

Included in:
CommandShortcut, CommandShortcutComponent
Defined in:
app/behaviors/ui/command_shortcut_behavior.rb

Overview

ShortcutBehavior

Shared behavior for CommandShortcut component.

Instance Method Summary collapse

Instance Method Details

#command_shortcut_classesObject



16
17
18
19
20
21
22
# File 'app/behaviors/ui/command_shortcut_behavior.rb', line 16

def command_shortcut_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  TailwindMerge::Merger.new.merge([
    command_shortcut_base_classes,
    classes_value
  ].compact.join(" "))
end

#command_shortcut_html_attributesObject



9
10
11
12
13
14
# File 'app/behaviors/ui/command_shortcut_behavior.rb', line 9

def command_shortcut_html_attributes
  {
    class: command_shortcut_classes,
    data: {slot: "command-shortcut"}
  }
end