Class: PhlexKit::ContextMenuSub

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

Overview

Nested submenu wrapper: SubTrigger row + SubContent panel, revealed on hover/focus with pure CSS (no extra controller). Mirrors shadcn/ui's ContextMenuSub. See context_menu.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ ContextMenuSub

Returns a new instance of ContextMenuSub.



6
# File 'app/components/phlex_kit/context_menu/context_menu_sub.rb', line 6

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

Instance Method Details

#view_templateObject



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

def view_template(&)
  # syncSub mirrors the CSS-driven reveal state onto the sub trigger's
  # aria-expanded (same wiring as DropdownMenuSub / MenubarSub).
  div(**mix({ class: "pk-context-menu-sub", data: { action: "mouseenter->phlex-kit--context-menu#syncSub mouseleave->phlex-kit--context-menu#syncSub focusin->phlex-kit--context-menu#syncSub focusout->phlex-kit--context-menu#syncSub" } }, @attrs), &)
end