Class: PhlexKit::CommandGroup
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::CommandGroup
- Defined in:
- app/components/phlex_kit/command/command_group.rb
Overview
Titled group of CommandItems. Hidden by the controller when filtering leaves it empty. The heading keeps ruby_ui's [group-heading] attribute (styled via the attribute selector in command.css). See command.rb.
Instance Method Summary collapse
-
#initialize(title: nil, **attrs) ⇒ CommandGroup
constructor
A new instance of CommandGroup.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(title: nil, **attrs) ⇒ CommandGroup
Returns a new instance of CommandGroup.
6 7 8 9 |
# File 'app/components/phlex_kit/command/command_group.rb', line 6 def initialize(title: nil, **attrs) @title = title @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/phlex_kit/command/command_group.rb', line 11 def view_template(&block) div(**mix({ class: "pk-command-group", role: "presentation", data: { value: @title, phlex_kit__command_target: "group" } }, @attrs)) do render_header if @title render_items(&block) end end |