Class: PhlexKit::CommandEmpty

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

Overview

"No results" row — revealed by the controller only when a filter matches nothing. Server-rendered with pk-hidden so an inline palette doesn't flash "No results" under its items before Stimulus connects, and doesn't show it permanently with JS disabled. See command.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ CommandEmpty

Returns a new instance of CommandEmpty.



7
8
9
# File 'app/components/phlex_kit/command/command_empty.rb', line 7

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

Instance Method Details

#view_templateObject



11
12
13
14
15
16
17
# File 'app/components/phlex_kit/command/command_empty.rb', line 11

def view_template(&)
  div(**mix({
    class: "pk-command-empty pk-hidden",
    role: "presentation",
    data: { phlex_kit__command_target: "empty" }
  }, @attrs), &)
end