Class: PhlexKit::Command
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Command
- 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
-
#initialize(**attrs) ⇒ Command
constructor
A new instance of Command.
- #view_template ⇒ Object
Methods inherited from BaseComponent
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_template ⇒ Object
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 |