Class: PhlexKit::ContextMenuGroup

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

Overview

Grouping wrapper for related rows (with an optional leading ContextMenuLabel). Mirrors shadcn/ui's ContextMenuGroup. See context_menu.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ ContextMenuGroup

Returns a new instance of ContextMenuGroup.



5
# File 'app/components/phlex_kit/context_menu/context_menu_group.rb', line 5

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

Instance Method Details

#view_templateObject



6
7
8
9
10
11
# File 'app/components/phlex_kit/context_menu/context_menu_group.rb', line 6

def view_template(&)
  base = { class: "pk-context-menu-group" }
  # Default only when the caller didn't supply their own — `mix` fuses.
  base[:role] = "group" unless attr_set?(:role)
  div(**mix(base, @attrs), &)
end