/** * DevExtreme (ui/context_menu.d.ts) * Version: 21.1.7 * Build date: Thu Aug 07 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { PositionConfig, } from '../animation/position'; import { UserDefinedElement, } from '../core/element'; import { DxPromise, } from '../core/utils/deferred'; import DataSource, { Options as DataSourceOptions, } from '../data/data_source'; import Store from '../data/abstract_store'; import { DxEvent, Cancelable, EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, ItemInfo, } from '../events/index'; import dxMenuBase, { dxMenuBaseOptions, } from './context_menu/ui.menu_base'; import { dxMenuBaseItem, } from './menu'; import { SelectionChangedInfo, } from './collection/ui.collection_widget.base'; /** @public */ export type ContentReadyEvent = EventInfo; /** @public */ export type DisposingEvent = EventInfo; /** @public */ export type HiddenEvent = EventInfo; /** @public */ export type HidingEvent = Cancelable & EventInfo; /** @public */ export type InitializedEvent = InitializedEventInfo; /** @public */ export type ItemClickEvent = NativeEventInfo & ItemInfo; /** @public */ export type ItemContextMenuEvent = NativeEventInfo & ItemInfo; /** @public */ export type ItemRenderedEvent = EventInfo & ItemInfo; /** @public */ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; /** @public */ export type PositioningEvent = NativeEventInfo & { readonly position: PositionConfig; }; /** @public */ export type SelectionChangedEvent = EventInfo & SelectionChangedInfo; /** @public */ export type ShowingEvent = Cancelable & EventInfo; /** @public */ export type ShownEvent = EventInfo; /** * @deprecated use Properties instead * @namespace DevExpress.ui */ export interface dxContextMenuOptions extends dxMenuBaseOptions { /** * @docid * @default true * @type_function_param1 event:event * @public */ closeOnOutsideClick?: boolean | ((event: DxEvent) => boolean); /** * @docid * @type string | Array | Store | DataSource | DataSourceOptions * @default null * @public */ dataSource?: string | Array | Store | DataSource | DataSourceOptions; /** * @docid * @type Array * @public */ items?: Array; /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxContextMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onHidden?: ((e: HiddenEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 cancel:boolean * @type_function_param1_field1 component:dxContextMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onHiding?: ((e: HidingEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 event:event * @type_function_param1_field5 position:positionConfig * @type_function_param1_field1 component:dxContextMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onPositioning?: ((e: PositioningEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 cancel:boolean * @type_function_param1_field1 component:dxContextMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onShowing?: ((e: ShowingEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxContextMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onShown?: ((e: ShownEvent) => void); /** * @docid * @default { my: 'top left', at: 'top left' } * @ref * @public * @type positionConfig */ position?: PositionConfig; /** * @docid * @default "dxcontextmenu" * @public */ showEvent?: { /** * @docid * @default undefined */ delay?: number; /** * @docid * @default undefined */ name?: string; } | string; /** * @docid * @type Enums.ContextMenuSubmenuDirection * @default "auto" * @public */ submenuDirection?: 'auto' | 'left' | 'right'; /** * @docid * @default undefined * @public */ target?: string | UserDefinedElement; /** * @docid * @default false * @fires dxContextMenuOptions.onShowing * @fires dxContextMenuOptions.onHiding * @public */ visible?: boolean; } /** * @docid * @inherits dxMenuBase * @namespace DevExpress.ui * @public */ export default class dxContextMenu extends dxMenuBase { constructor(element: UserDefinedElement, options?: dxContextMenuOptions) /** * @docid * @publicName hide() * @return Promise * @public */ hide(): DxPromise; /** * @docid * @publicName show() * @return Promise * @public */ show(): DxPromise; /** * @docid * @publicName toggle(showing) * @return Promise * @public */ toggle(showing: boolean): DxPromise; } /** * @public * @namespace DevExpress.ui.dxContextMenu */ export type Item = dxContextMenuItem; /** * @deprecated Use Item instead * @namespace DevExpress.ui */ export interface dxContextMenuItem extends dxMenuBaseItem { /** * @docid * @public * @type Array */ items?: Array; } /** @public */ export type Properties = dxContextMenuOptions; /** @deprecated use Properties instead */ export type Options = dxContextMenuOptions; /** @deprecated use Properties instead */ export type IOptions = dxContextMenuOptions;