UNPKG

devextreme-angular

Version:

Angular UI and visualization components based on DevExtreme widgets

547 lines (419 loc) 23.3 kB
/*! * devextreme-angular * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ import { TransferState, ElementRef, NgZone, OnDestroy, EventEmitter, OnChanges, DoCheck, SimpleChanges, QueryList } from '@angular/core'; import DataSource from 'devextreme/data/data_source'; import { AnimationConfig } from 'devextreme/common/core/animation'; import { dxMenuItem, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, SubmenuHiddenEvent, SubmenuHidingEvent, SubmenuShowingEvent, SubmenuShownEvent, SubmenuDirection } from 'devextreme/ui/menu'; import { DataSourceOptions } from 'devextreme/data/data_source'; import { Store } from 'devextreme/data/store'; import { Orientation, SingleOrNone, SubmenuShowMode } from 'devextreme/common'; import DxMenu from 'devextreme/ui/menu'; import { DxComponent, DxTemplateHost, NestedOptionHost, IterableDifferHelper, WatcherHelper } from 'devextreme-angular/core'; import { DxiItemComponent } from 'devextreme-angular/ui/nested'; import { DxiMenuItemComponent } from 'devextreme-angular/ui/menu/nested'; import type * as DxMenuTypes from "devextreme/ui/menu_types"; import * as i0 from "@angular/core"; import * as i1 from "devextreme-angular/ui/nested"; import * as i2 from "devextreme-angular/ui/menu/nested"; import * as i3 from "devextreme-angular/core"; export { ExplicitTypes } from 'devextreme/ui/menu'; /** * The Menu UI component is a panel with clickable items. A click on an item opens a drop-down menu, which can contain several submenus. */ export declare class DxMenuComponent<TKey = any> extends DxComponent implements OnDestroy, OnChanges, DoCheck { private _watcherHelper; private _idh; instance: DxMenu<TKey>; /** * Specifies the shortcut key that sets focus on the UI component. */ get accessKey(): string | undefined; set accessKey(value: string | undefined); /** * Specifies whether the UI component changes its visual state as a result of user interaction. */ get activeStateEnabled(): boolean; set activeStateEnabled(value: boolean); /** * Specifies whether adaptive rendering is enabled. This property is in effect only if the orientation is &apos;horizontal&apos;. */ get adaptivityEnabled(): boolean; set adaptivityEnabled(value: boolean); /** * Configures UI component visibility animations. This object contains two fields: show and hide. */ get animation(): { hide?: AnimationConfig; show?: AnimationConfig; }; set animation(value: { hide?: AnimationConfig; show?: AnimationConfig; }); /** * Specifies the name of the CSS class to be applied to the root menu level and all submenus. */ get cssClass(): string; set cssClass(value: string); /** * Binds the UI component to data. */ get dataSource(): Array<dxMenuItem> | DataSource | DataSourceOptions | null | Store | string; set dataSource(value: Array<dxMenuItem> | DataSource | DataSourceOptions | null | Store | string); /** * Specifies whether the UI component responds to user interaction. */ get disabled(): boolean; set disabled(value: boolean); /** * Specifies the name of the data source item field whose value defines whether or not the corresponding UI component item is disabled. */ get disabledExpr(): Function | string; set disabledExpr(value: Function | string); /** * Specifies the data field whose values should be displayed. */ get displayExpr(): ((item: any) => string) | string; set displayExpr(value: ((item: any) => string) | string); /** * Specifies the global attributes to be attached to the UI component&apos;s container element. */ get elementAttr(): Record<string, any>; set elementAttr(value: Record<string, any>); /** * Specifies whether the UI component can be focused using keyboard navigation. */ get focusStateEnabled(): boolean; set focusStateEnabled(value: boolean); /** * Specifies the UI component&apos;s height. */ get height(): (() => number | string) | number | string | undefined; set height(value: (() => number | string) | number | string | undefined); /** * Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ get hideSubmenuOnMouseLeave(): boolean; set hideSubmenuOnMouseLeave(value: boolean); /** * Specifies text for a hint that appears when a user pauses on the UI component. */ get hint(): string | undefined; set hint(value: string | undefined); /** * Specifies whether the UI component changes its state when a user pauses on it. */ get hoverStateEnabled(): boolean; set hoverStateEnabled(value: boolean); /** * Holds an array of menu items. */ get items(): Array<dxMenuItem>; set items(value: Array<dxMenuItem>); /** * Specifies which data field contains nested items. */ get itemsExpr(): Function | string; set itemsExpr(value: Function | string); /** * Specifies a custom template for items. */ get itemTemplate(): any; set itemTemplate(value: any); /** * Specifies whether the menu has horizontal or vertical orientation. */ get orientation(): Orientation; set orientation(value: Orientation); /** * Switches the UI component to a right-to-left representation. */ get rtlEnabled(): boolean; set rtlEnabled(value: boolean); /** * Specifies whether an item is selected if a user clicks it. */ get selectByClick(): boolean; set selectByClick(value: boolean); /** * Specifies the name of the data source item field whose value defines whether or not the corresponding UI component items is selected. */ get selectedExpr(): Function | string; set selectedExpr(value: Function | string); /** * The selected item object. */ get selectedItem(): any; set selectedItem(value: any); /** * Specifies the selection mode supported by the menu. */ get selectionMode(): SingleOrNone; set selectionMode(value: SingleOrNone); /** * Specifies properties for showing and hiding the first level submenu. */ get showFirstSubmenuMode(): SubmenuShowMode | { delay?: number | { hide?: number; show?: number; }; name?: SubmenuShowMode; }; set showFirstSubmenuMode(value: SubmenuShowMode | { delay?: number | { hide?: number; show?: number; }; name?: SubmenuShowMode; }); /** * Specifies properties of submenu showing and hiding. */ get showSubmenuMode(): SubmenuShowMode | { delay?: number | { hide?: number; show?: number; }; name?: SubmenuShowMode; }; set showSubmenuMode(value: SubmenuShowMode | { delay?: number | { hide?: number; show?: number; }; name?: SubmenuShowMode; }); /** * Specifies the direction at which the submenus are displayed. */ get submenuDirection(): SubmenuDirection; set submenuDirection(value: SubmenuDirection); /** * Specifies the number of the element when the Tab key is used for navigating. */ get tabIndex(): number; set tabIndex(value: number); /** * Specifies whether the UI component is visible. */ get visible(): boolean; set visible(value: boolean); /** * Specifies the UI component&apos;s width. */ get width(): (() => number | string) | number | string | undefined; set width(value: (() => number | string) | number | string | undefined); /** * A function that is executed when the UI component is rendered and each time the component is repainted. */ onContentReady: EventEmitter<ContentReadyEvent>; /** * A function that is executed before the UI component is disposed of. */ onDisposing: EventEmitter<DisposingEvent>; /** * A function used in JavaScript frameworks to save the UI component instance. */ onInitialized: EventEmitter<InitializedEvent>; /** * A function that is executed when a collection item is clicked or tapped. */ onItemClick: EventEmitter<ItemClickEvent>; /** * A function that is executed when a collection item is right-clicked or pressed. */ onItemContextMenu: EventEmitter<ItemContextMenuEvent>; /** * A function that is executed after a collection item is rendered. */ onItemRendered: EventEmitter<ItemRenderedEvent>; /** * A function that is executed after a UI component property is changed. */ onOptionChanged: EventEmitter<OptionChangedEvent>; /** * A function that is executed when a collection item is selected or selection is canceled. */ onSelectionChanged: EventEmitter<SelectionChangedEvent>; /** * A function that is executed after a submenu is hidden. */ onSubmenuHidden: EventEmitter<SubmenuHiddenEvent>; /** * A function that is executed before a submenu is hidden. */ onSubmenuHiding: EventEmitter<SubmenuHidingEvent>; /** * A function that is executed before a submenu is displayed. */ onSubmenuShowing: EventEmitter<SubmenuShowingEvent>; /** * A function that is executed after a submenu is displayed. */ onSubmenuShown: EventEmitter<SubmenuShownEvent>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ accessKeyChange: EventEmitter<string | undefined>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ activeStateEnabledChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ adaptivityEnabledChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ animationChange: EventEmitter<{ hide?: AnimationConfig; show?: AnimationConfig; }>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ cssClassChange: EventEmitter<string>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ dataSourceChange: EventEmitter<Array<dxMenuItem> | DataSource | DataSourceOptions | null | Store | string>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ disabledChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ disabledExprChange: EventEmitter<Function | string>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ displayExprChange: EventEmitter<((item: any) => string) | string>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ elementAttrChange: EventEmitter<Record<string, any>>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ focusStateEnabledChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ heightChange: EventEmitter<(() => number | string) | number | string | undefined>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ hideSubmenuOnMouseLeaveChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ hintChange: EventEmitter<string | undefined>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ hoverStateEnabledChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ itemsChange: EventEmitter<Array<dxMenuItem>>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ itemsExprChange: EventEmitter<Function | string>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ itemTemplateChange: EventEmitter<any>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ orientationChange: EventEmitter<Orientation>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ rtlEnabledChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ selectByClickChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ selectedExprChange: EventEmitter<Function | string>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ selectedItemChange: EventEmitter<any>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ selectionModeChange: EventEmitter<SingleOrNone>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ showFirstSubmenuModeChange: EventEmitter<SubmenuShowMode | { delay?: number | { hide?: number; show?: number; }; name?: SubmenuShowMode; }>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ showSubmenuModeChange: EventEmitter<SubmenuShowMode | { delay?: number | { hide?: number; show?: number; }; name?: SubmenuShowMode; }>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ submenuDirectionChange: EventEmitter<SubmenuDirection>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ tabIndexChange: EventEmitter<number>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ visibleChange: EventEmitter<boolean>; /** * This member supports the internal infrastructure and is not intended to be used directly from your code. */ widthChange: EventEmitter<(() => number | string) | number | string | undefined>; get itemsChildren(): QueryList<DxiMenuItemComponent>; set itemsChildren(value: QueryList<DxiMenuItemComponent>); get itemsLegacyChildren(): QueryList<DxiItemComponent>; set itemsLegacyChildren(value: QueryList<DxiItemComponent>); constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, _watcherHelper: WatcherHelper, _idh: IterableDifferHelper, optionHost: NestedOptionHost, transferState: TransferState, platformId: any); protected _createInstance(element: any, options: any): DxMenu<any>; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; setupChanges(prop: string, changes: SimpleChanges): void; ngDoCheck(): void; _setOption(name: string, value: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<DxMenuComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DxMenuComponent<any>, "dx-menu", never, { "accessKey": { "alias": "accessKey"; "required": false; }; "activeStateEnabled": { "alias": "activeStateEnabled"; "required": false; }; "adaptivityEnabled": { "alias": "adaptivityEnabled"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "cssClass": { "alias": "cssClass"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disabledExpr": { "alias": "disabledExpr"; "required": false; }; "displayExpr": { "alias": "displayExpr"; "required": false; }; "elementAttr": { "alias": "elementAttr"; "required": false; }; "focusStateEnabled": { "alias": "focusStateEnabled"; "required": false; }; "height": { "alias": "height"; "required": false; }; "hideSubmenuOnMouseLeave": { "alias": "hideSubmenuOnMouseLeave"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "hoverStateEnabled": { "alias": "hoverStateEnabled"; "required": false; }; "items": { "alias": "items"; "required": false; }; "itemsExpr": { "alias": "itemsExpr"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "rtlEnabled": { "alias": "rtlEnabled"; "required": false; }; "selectByClick": { "alias": "selectByClick"; "required": false; }; "selectedExpr": { "alias": "selectedExpr"; "required": false; }; "selectedItem": { "alias": "selectedItem"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "showFirstSubmenuMode": { "alias": "showFirstSubmenuMode"; "required": false; }; "showSubmenuMode": { "alias": "showSubmenuMode"; "required": false; }; "submenuDirection": { "alias": "submenuDirection"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "width": { "alias": "width"; "required": false; }; }, { "onContentReady": "onContentReady"; "onDisposing": "onDisposing"; "onInitialized": "onInitialized"; "onItemClick": "onItemClick"; "onItemContextMenu": "onItemContextMenu"; "onItemRendered": "onItemRendered"; "onOptionChanged": "onOptionChanged"; "onSelectionChanged": "onSelectionChanged"; "onSubmenuHidden": "onSubmenuHidden"; "onSubmenuHiding": "onSubmenuHiding"; "onSubmenuShowing": "onSubmenuShowing"; "onSubmenuShown": "onSubmenuShown"; "accessKeyChange": "accessKeyChange"; "activeStateEnabledChange": "activeStateEnabledChange"; "adaptivityEnabledChange": "adaptivityEnabledChange"; "animationChange": "animationChange"; "cssClassChange": "cssClassChange"; "dataSourceChange": "dataSourceChange"; "disabledChange": "disabledChange"; "disabledExprChange": "disabledExprChange"; "displayExprChange": "displayExprChange"; "elementAttrChange": "elementAttrChange"; "focusStateEnabledChange": "focusStateEnabledChange"; "heightChange": "heightChange"; "hideSubmenuOnMouseLeaveChange": "hideSubmenuOnMouseLeaveChange"; "hintChange": "hintChange"; "hoverStateEnabledChange": "hoverStateEnabledChange"; "itemsChange": "itemsChange"; "itemsExprChange": "itemsExprChange"; "itemTemplateChange": "itemTemplateChange"; "orientationChange": "orientationChange"; "rtlEnabledChange": "rtlEnabledChange"; "selectByClickChange": "selectByClickChange"; "selectedExprChange": "selectedExprChange"; "selectedItemChange": "selectedItemChange"; "selectionModeChange": "selectionModeChange"; "showFirstSubmenuModeChange": "showFirstSubmenuModeChange"; "showSubmenuModeChange": "showSubmenuModeChange"; "submenuDirectionChange": "submenuDirectionChange"; "tabIndexChange": "tabIndexChange"; "visibleChange": "visibleChange"; "widthChange": "widthChange"; }, ["itemsChildren", "itemsLegacyChildren"], never, false, never>; } export declare class DxMenuModule { static ɵfac: i0.ɵɵFactoryDeclaration<DxMenuModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<DxMenuModule, [typeof DxMenuComponent], [typeof i1.DxoAnimationModule, typeof i1.DxoHideModule, typeof i1.DxoFromModule, typeof i1.DxoPositionModule, typeof i1.DxoAtModule, typeof i1.DxoBoundaryOffsetModule, typeof i1.DxoCollisionModule, typeof i1.DxoMyModule, typeof i1.DxoOffsetModule, typeof i1.DxoToModule, typeof i1.DxoShowModule, typeof i1.DxiItemModule, typeof i1.DxoShowFirstSubmenuModeModule, typeof i1.DxoDelayModule, typeof i1.DxoShowSubmenuModeModule, typeof i2.DxoMenuAnimationModule, typeof i2.DxoMenuAtModule, typeof i2.DxoMenuBoundaryOffsetModule, typeof i2.DxoMenuCollisionModule, typeof i2.DxoMenuDelayModule, typeof i2.DxoMenuFromModule, typeof i2.DxoMenuHideModule, typeof i2.DxiMenuItemModule, typeof i2.DxoMenuMyModule, typeof i2.DxoMenuOffsetModule, typeof i2.DxoMenuPositionModule, typeof i2.DxoMenuShowModule, typeof i2.DxoMenuShowFirstSubmenuModeModule, typeof i2.DxoMenuShowSubmenuModeModule, typeof i2.DxoMenuToModule, typeof i3.DxIntegrationModule, typeof i3.DxTemplateModule], [typeof DxMenuComponent, typeof i1.DxoAnimationModule, typeof i1.DxoHideModule, typeof i1.DxoFromModule, typeof i1.DxoPositionModule, typeof i1.DxoAtModule, typeof i1.DxoBoundaryOffsetModule, typeof i1.DxoCollisionModule, typeof i1.DxoMyModule, typeof i1.DxoOffsetModule, typeof i1.DxoToModule, typeof i1.DxoShowModule, typeof i1.DxiItemModule, typeof i1.DxoShowFirstSubmenuModeModule, typeof i1.DxoDelayModule, typeof i1.DxoShowSubmenuModeModule, typeof i2.DxoMenuAnimationModule, typeof i2.DxoMenuAtModule, typeof i2.DxoMenuBoundaryOffsetModule, typeof i2.DxoMenuCollisionModule, typeof i2.DxoMenuDelayModule, typeof i2.DxoMenuFromModule, typeof i2.DxoMenuHideModule, typeof i2.DxiMenuItemModule, typeof i2.DxoMenuMyModule, typeof i2.DxoMenuOffsetModule, typeof i2.DxoMenuPositionModule, typeof i2.DxoMenuShowModule, typeof i2.DxoMenuShowFirstSubmenuModeModule, typeof i2.DxoMenuShowSubmenuModeModule, typeof i2.DxoMenuToModule, typeof i3.DxTemplateModule]>; static ɵinj: i0.ɵɵInjectorDeclaration<DxMenuModule>; } export { DxMenuTypes };