CngxContextMenuTriggerCore
projects/common/interactive/menu/context-menu-trigger-core.ts
Import#
import { CngxContextMenuTriggerCore } from '@cngx/common/interactive'
Description#
Shared context-menu trigger core. Owns the contextmenu / Shift+F10
handling, the transient pointer-anchor lifecycle, the dismiss binding,
announcer calls, and focus save/restore. Consumed by both
CngxContextMenuTrigger (directive) and CngxContextMenuFor (organism
trigger) so the two share one implementation without inheritance.
Index#
Instance Properties#
CngxMenuFocusStackThe core's submenu focus-stack model. Exposed for host-side wiring the
pure factory cannot install itself - the DI hosts pass it to
connectSubmenuHoverToFocusStack (an effect, so it needs their
injection context) to route submenu hover intent through the stack.
Methods#
handleContextMenu(event: MouseEvent)contextmenu host handler - consults resolveOpen before opening.
MouseEventhandleKeydown(event: KeyboardEvent)Keydown host handler - Shift+F10 opens at the host centre.
KeyboardEventRelinquish an open WITHOUT restoring focus: detach the dismiss binding,
clear the submenu stack, and discard the saved pre-open focus. For the
shared-panel handoff - when a sibling trigger claims the still-visible
panel, the losing core must stand down silently; a syncOpenState(false)
would yank focus out of the menu the new owner just opened.