Skip to main content
cngx-src documentation

CngxContextMenuTriggerCoreDeps

Interface

projects/common/interactive/menu/context-menu-trigger-core.ts

Import#

import { CngxContextMenuTriggerCoreDeps } from '@cngx/common/interactive'

Description#

Dependencies for createContextMenuTriggerCore. The caller injects the DI-backed collaborators (dismiss factory, announcer, config) and passes them in, keeping the core a pure factory.

Index#

Instance Properties#

Readonly

Announcer for AT dismissal messages.

commitContext#function
ReadonlyOptional

Receives the resolved context on a successful open. No-op by default.

direction#Signal
Readonly

Document writing direction. Resolves the physical arrow to its inline-logical intent at the dispatch site, so under rtl physical ArrowLeft opens the submenu and physical ArrowRight pops it.

Readonly

Dismiss-handler factory (from CNGX_MENU_DISMISS_HANDLER_FACTORY).

document#Document
Readonly

Document used for the transient anchor and focus capture.

Readonly

Focus-stack factory (from CNGX_MENU_FOCUS_STACK_FACTORY).

hostElement#HTMLElement
Readonly

Trigger host element - anchor for Shift+F10 and the dismiss filter.

popover#function
Readonly

Popover panel opened at pointer coordinates.

resolveKeyboardOpen#function
ReadonlyOptional

Veto/datum seam for the keyboard open gesture (Shift+F10). Evaluated before preventDefault(), mirroring resolveOpen; the resolved context goes through commitContext exactly like a pointer open, so a keyboard open never serves a stale datum from an earlier right-click. Defaults to always-open with undefined context.

resolveOpen#function
ReadonlyOptional

Veto/datum seam. Evaluated as the FIRST thing in the contextmenu handler, BEFORE preventDefault(). { open: false } leaves the native menu untouched (no preventDefault, no anchor, no open). { open: true, context } prevents default, hands context to commitContext, then opens. Defaults to always-open with undefined context, so a consumer that omits it keeps the plain right-click-always-opens behaviour.