The HTML element that contains the context menu targets.
A CSS selector which activates the context menu.
An Array of entries to display in the menu
Optionaloptions: ContextMenuOptions = {}Additional options to configure the context menu.
The array of menu items to render.
A function to call when the context menu is closed.
A function to call when the context menu is opened.
The menu element.
The event name to listen for.
Check which direction the menu is expanded in.
Whether to position the context menu as a fixed element, or inject it into the target.
A CSS selector to identify context menu targets.
The parent HTML element to which the context menu is attached
StaticimplementationRetrieve the configured DragDrop implementation.
Local listeners which apply to each ContextMenu instance which is created.
The context menu element.
Closes the menu and removes it from the DOM.
Optionaloptions: { animate?: boolean; target?: HTMLElement } = {}Options to configure the closing behavior.
Optionalanimate?: booleanAnimate the context menu closing.
Optionaltarget?: HTMLElementThe target element to close on.
Render the Context Menu by iterating over the menuItems it contains. Check the visibility of each menu item, and only render ones which are allowed by the item's logical condition. Attach a click handler to each item which is rendered.
The target element to which the context menu is attached.
Optionaloptions: ContextMenuRenderOptions = {}A Promise that resolves when the open animation has completed.
Protected_animateProtectedAnimate the context menu's height when opening or closing.
Whether the menu is opening or closing.
A Promise that resolves when the animation completes.
Protected_closeProtectedClose the menu and remove it from the DOM.
Optionaloptions: { target?: HTMLElement } = {}Optionaltarget?: HTMLElementThe target element to close on.
Protected_injectProtectedInject the menu inside the target.
The menu element.
The context target.
Protected_onProtectedHandle context menu activation.
The triggering event.
Protected_onProtectedCalled after the context menu has finished rendering and animating open.
Optionaloptions: ContextMenuRenderOptions = {}Protected_preProtectedCalled before the context menu begins rendering.
The context target.
Optionaloptions: ContextMenuRenderOptions = {}Protected_setProtectedSet the context menu at a fixed position in the viewport.
The menu element.
The context target.
Optionaloptions: { event?: Event } = {}Optionalevent?: EventThe event that triggered the context menu opening.
Protected_setProtectedSet the position of the context menu, taking into consideration whether the menu should expand upward or downward
The context menu element.
The element that the context menu was spawned on.
Optionaloptions: { event?: Event } = {}Optionalevent?: EventThe event that triggered the context menu opening.
StaticcreateCreate a ContextMenu for this Application and dispatch hooks.
The Application this ContextMenu belongs to.
The Application's rendered HTML.
The target CSS selector which activates the menu.
The array of menu items being rendered.
Optionaloptions: { hookName?: string } = {}Additional options to configure context menu initialization.
OptionalhookName?: stringThe name of the hook to call.
StaticeventGlobal listeners which apply once only to the document.
Display a right-click activated Context Menu which provides a dropdown menu of options. A ContextMenu is constructed by designating a parent HTML container and a target selector. An Array of menuItems defines the entries of the menu which is displayed.