/** * DevExtreme (ui/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 { UserDefinedElement, DxElement, } from '../core/element'; import DataSource, { Options as DataSourceOptions, } from '../data/data_source'; import Store from '../data/abstract_store'; import { Cancelable, EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, ItemInfo, } from '../events/index'; import { CollectionWidgetItem, SelectionChangedInfo, } from './collection/ui.collection_widget.base'; import dxMenuBase, { dxMenuBaseOptions, } from './context_menu/ui.menu_base'; /** @public */ export type ContentReadyEvent = EventInfo; /** @public */ export type DisposingEvent = 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 SelectionChangedEvent = EventInfo & SelectionChangedInfo; /** @public */ export type SubmenuHiddenEvent = EventInfo & { readonly rootItem?: DxElement; }; /** @public */ export type SubmenuHidingEvent = Cancelable & EventInfo & { readonly rootItem?: DxElement; }; /** @public */ export type SubmenuShowingEvent = EventInfo & { readonly rootItem?: DxElement; }; /** @public */ export type SubmenuShownEvent = EventInfo & { readonly rootItem?: DxElement; }; /** * @deprecated use Properties instead * @namespace DevExpress.ui */ export interface dxMenuOptions extends dxMenuBaseOptions { /** * @docid * @default false * @public */ adaptivityEnabled?: boolean; /** * @docid * @type string | Array | Store | DataSource | DataSourceOptions * @default null * @public */ dataSource?: string | Array | Store | DataSource | DataSourceOptions; /** * @docid * @default false * @public */ hideSubmenuOnMouseLeave?: boolean; /** * @docid * @type Array * @public */ items?: Array; /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 rootItem:DxElement * @type_function_param1_field1 component:dxMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSubmenuHidden?: ((e: SubmenuHiddenEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 rootItem:DxElement * @type_function_param1_field5 cancel:boolean * @type_function_param1_field1 component:dxMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSubmenuHiding?: ((e: SubmenuHidingEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 rootItem:DxElement * @type_function_param1_field1 component:dxMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSubmenuShowing?: ((e: SubmenuShowingEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 rootItem:DxElement * @type_function_param1_field1 component:dxMenu * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSubmenuShown?: ((e: SubmenuShownEvent) => void); /** * @docid * @type Enums.Orientation * @default "horizontal" * @public */ orientation?: 'horizontal' | 'vertical'; /** * @docid * @type Object|Enums.ShowSubmenuMode * @default { name: "onClick", delay: { show: 50, hide: 300 } } * @public */ showFirstSubmenuMode?: { /** * @docid * @default { show: 50, hide: 300 } */ delay?: { /** * @docid * @default 300 */ hide?: number; /** * @docid * @default 50 */ show?: number; } | number; /** * @docid * @type Enums.ShowSubmenuMode * @default "onClick" */ name?: 'onClick' | 'onHover'; } | 'onClick' | 'onHover'; /** * @docid * @type Enums.SubmenuDirection * @default "auto" * @public */ submenuDirection?: 'auto' | 'leftOrTop' | 'rightOrBottom'; } /** * @docid * @inherits dxMenuBase * @namespace DevExpress.ui * @public */ export default class dxMenu extends dxMenuBase { constructor(element: UserDefinedElement, options?: dxMenuOptions) } /** * @docid * @inherits CollectionWidgetItem * @type object * @namespace DevExpress.ui */ export interface dxMenuBaseItem extends CollectionWidgetItem { /** * @docid * @public */ beginGroup?: boolean; /** * @docid * @default true * @public */ closeMenuOnClick?: boolean; /** * @docid * @default false * @public */ disabled?: boolean; /** * @docid * @public */ icon?: string; /** * @docid * @public */ items?: Array; /** * @docid * @default false * @public */ selectable?: boolean; /** * @docid * @default false * @public */ selected?: boolean; /** * @docid * @public */ text?: string; /** * @docid * @default true * @public */ visible?: boolean; } /** * @public * @namespace DevExpress.ui.dxMenu */ export type Item = dxMenuItem; /** * @deprecated Use Item instead * @namespace DevExpress.ui */ export interface dxMenuItem extends dxMenuBaseItem { /** * @docid * @public * @type Array */ items?: Array; } /** @public */ export type Properties = dxMenuOptions; /** @deprecated use Properties instead */ export type Options = dxMenuOptions; /** @deprecated use Properties instead */ export type IOptions = dxMenuOptions;