Class: PhlexKit::Command

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/command/command.rb

Overview

Command palette, ported from ruby_ui's RubyUI::Command. The palette body: CommandInput + CommandList(CommandGroup > CommandItem) + CommandEmpty. Normally composed inside CommandDialog/CommandDialogContent, whose cloned wrapper carries the phlex-kit--command controller (matching ruby_ui); for an inline palette add data: { controller: "phlex-kit--command" } yourself. Upstream's fuse.js fuzzy search is replaced with a dependency-free substring match in the controller. Tailwind → vanilla .pk-command* (command.css).

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ Command

Returns a new instance of Command.



10
11
12
# File 'app/components/phlex_kit/command/command.rb', line 10

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



14
15
16
17
18
19
# File 'app/components/phlex_kit/command/command.rb', line 14

def view_template
  div(**mix({ class: "pk-command" }, @attrs)) do
    live_region
    yield
  end
end