| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668 |
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- /*!
- * devextreme-angular
- * Version: 19.1.16
- * Build date: Tue Oct 18 2022
- *
- * Copyright (c) 2012 - 2022 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
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var platform_browser_1 = require("@angular/platform-browser");
- var platform_browser_2 = require("@angular/platform-browser");
- var core_1 = require("@angular/core");
- var menu_1 = require("devextreme/ui/menu");
- var component_1 = require("../core/component");
- var template_host_1 = require("../core/template-host");
- var integration_1 = require("../core/integration");
- var template_1 = require("../core/template");
- var nested_option_1 = require("../core/nested-option");
- var watcher_helper_1 = require("../core/watcher-helper");
- var iterable_differ_helper_1 = require("../core/iterable-differ-helper");
- var animation_1 = require("./nested/animation");
- var hide_1 = require("./nested/hide");
- var show_1 = require("./nested/show");
- var item_dxi_1 = require("./nested/item-dxi");
- var show_first_submenu_mode_1 = require("./nested/show-first-submenu-mode");
- var delay_1 = require("./nested/delay");
- var show_submenu_mode_1 = require("./nested/show-submenu-mode");
- var item_dxi_2 = require("./nested/item-dxi");
- /**
- * The Menu widget is a panel with clickable items. A click on an item opens a drop-down menu, which can contain several submenus.
- */
- var DxMenuComponent = (function (_super) {
- __extends(DxMenuComponent, _super);
- function DxMenuComponent(elementRef, ngZone, templateHost, _watcherHelper, _idh, optionHost, transferState, platformId) {
- var _this = _super.call(this, elementRef, ngZone, templateHost, _watcherHelper, transferState, platformId) || this;
- _this._watcherHelper = _watcherHelper;
- _this._idh = _idh;
- _this._createEventEmitters([
- { subscribe: 'contentReady', emit: 'onContentReady' },
- { subscribe: 'disposing', emit: 'onDisposing' },
- { subscribe: 'initialized', emit: 'onInitialized' },
- { subscribe: 'itemClick', emit: 'onItemClick' },
- { subscribe: 'itemContextMenu', emit: 'onItemContextMenu' },
- { subscribe: 'itemRendered', emit: 'onItemRendered' },
- { subscribe: 'optionChanged', emit: 'onOptionChanged' },
- { subscribe: 'selectionChanged', emit: 'onSelectionChanged' },
- { subscribe: 'submenuHidden', emit: 'onSubmenuHidden' },
- { subscribe: 'submenuHiding', emit: 'onSubmenuHiding' },
- { subscribe: 'submenuShowing', emit: 'onSubmenuShowing' },
- { subscribe: 'submenuShown', emit: 'onSubmenuShown' },
- { emit: 'accessKeyChange' },
- { emit: 'activeStateEnabledChange' },
- { emit: 'adaptivityEnabledChange' },
- { emit: 'animationChange' },
- { emit: 'cssClassChange' },
- { emit: 'dataSourceChange' },
- { emit: 'disabledChange' },
- { emit: 'disabledExprChange' },
- { emit: 'displayExprChange' },
- { emit: 'elementAttrChange' },
- { emit: 'focusStateEnabledChange' },
- { emit: 'heightChange' },
- { emit: 'hideSubmenuOnMouseLeaveChange' },
- { emit: 'hintChange' },
- { emit: 'hoverStateEnabledChange' },
- { emit: 'itemsChange' },
- { emit: 'itemsExprChange' },
- { emit: 'itemTemplateChange' },
- { emit: 'orientationChange' },
- { emit: 'rtlEnabledChange' },
- { emit: 'selectByClickChange' },
- { emit: 'selectedExprChange' },
- { emit: 'selectedItemChange' },
- { emit: 'selectionModeChange' },
- { emit: 'showFirstSubmenuModeChange' },
- { emit: 'showSubmenuModeChange' },
- { emit: 'submenuDirectionChange' },
- { emit: 'tabIndexChange' },
- { emit: 'visibleChange' },
- { emit: 'widthChange' }
- ]);
- _this._idh.setHost(_this);
- optionHost.setHost(_this);
- return _this;
- }
- Object.defineProperty(DxMenuComponent.prototype, "accessKey", {
- get: /**
- * Specifies the shortcut key that sets focus on the widget.
- */
- function () {
- return this._getOption('accessKey');
- },
- set: function (value) {
- this._setOption('accessKey', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "activeStateEnabled", {
- get: /**
- * A Boolean value specifying whether or not the widget changes its state when interacting with a user.
- */
- function () {
- return this._getOption('activeStateEnabled');
- },
- set: function (value) {
- this._setOption('activeStateEnabled', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "adaptivityEnabled", {
- get: /**
- * Specifies whether adaptive widget rendering is enabled on small screens. Applies only if the orientation is "horizontal".
- */
- function () {
- return this._getOption('adaptivityEnabled');
- },
- set: function (value) {
- this._setOption('adaptivityEnabled', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "animation", {
- get: /**
- * Configures widget visibility animations. This object contains two fields: show and hide.
- */
- function () {
- return this._getOption('animation');
- },
- set: function (value) {
- this._setOption('animation', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "cssClass", {
- get: /**
- * Specifies the name of the CSS class to be applied to the root menu level and all submenus.
- */
- function () {
- return this._getOption('cssClass');
- },
- set: function (value) {
- this._setOption('cssClass', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "dataSource", {
- get: /**
- * Binds the widget to data.
- */
- function () {
- return this._getOption('dataSource');
- },
- set: function (value) {
- this._setOption('dataSource', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "disabled", {
- get: /**
- * Specifies whether the widget responds to user interaction.
- */
- function () {
- return this._getOption('disabled');
- },
- set: function (value) {
- this._setOption('disabled', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "disabledExpr", {
- get: /**
- * Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled.
- */
- function () {
- return this._getOption('disabledExpr');
- },
- set: function (value) {
- this._setOption('disabledExpr', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "displayExpr", {
- get: /**
- * Specifies the data field whose values should be displayed.
- */
- function () {
- return this._getOption('displayExpr');
- },
- set: function (value) {
- this._setOption('displayExpr', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "elementAttr", {
- get: /**
- * Specifies the attributes to be attached to the widget's root element.
- */
- function () {
- return this._getOption('elementAttr');
- },
- set: function (value) {
- this._setOption('elementAttr', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "focusStateEnabled", {
- get: /**
- * Specifies whether the widget can be focused using keyboard navigation.
- */
- function () {
- return this._getOption('focusStateEnabled');
- },
- set: function (value) {
- this._setOption('focusStateEnabled', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "height", {
- get: /**
- * Specifies the widget's height.
- */
- function () {
- return this._getOption('height');
- },
- set: function (value) {
- this._setOption('height', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "hideSubmenuOnMouseLeave", {
- get: /**
- * Specifies whether or not the submenu is hidden when the mouse pointer leaves it.
- */
- function () {
- return this._getOption('hideSubmenuOnMouseLeave');
- },
- set: function (value) {
- this._setOption('hideSubmenuOnMouseLeave', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "hint", {
- get: /**
- * Specifies text for a hint that appears when a user pauses on the widget.
- */
- function () {
- return this._getOption('hint');
- },
- set: function (value) {
- this._setOption('hint', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "hoverStateEnabled", {
- get: /**
- * Specifies whether the widget changes its state when a user pauses on it.
- */
- function () {
- return this._getOption('hoverStateEnabled');
- },
- set: function (value) {
- this._setOption('hoverStateEnabled', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "items", {
- get: /**
- * Holds an array of menu items.
- */
- function () {
- return this._getOption('items');
- },
- set: function (value) {
- this._setOption('items', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "itemsExpr", {
- get: /**
- * Specifies which data field contains nested items.
- */
- function () {
- return this._getOption('itemsExpr');
- },
- set: function (value) {
- this._setOption('itemsExpr', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "itemTemplate", {
- get: /**
- * Specifies a custom template for items.
- */
- function () {
- return this._getOption('itemTemplate');
- },
- set: function (value) {
- this._setOption('itemTemplate', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "orientation", {
- get: /**
- * Specifies whether the menu has horizontal or vertical orientation.
- */
- function () {
- return this._getOption('orientation');
- },
- set: function (value) {
- this._setOption('orientation', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "rtlEnabled", {
- get: /**
- * Switches the widget to a right-to-left representation.
- */
- function () {
- return this._getOption('rtlEnabled');
- },
- set: function (value) {
- this._setOption('rtlEnabled', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "selectByClick", {
- get: /**
- * Specifies whether or not an item becomes selected if a user clicks it.
- */
- function () {
- return this._getOption('selectByClick');
- },
- set: function (value) {
- this._setOption('selectByClick', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "selectedExpr", {
- get: /**
- * Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected.
- */
- function () {
- return this._getOption('selectedExpr');
- },
- set: function (value) {
- this._setOption('selectedExpr', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "selectedItem", {
- get: /**
- * The selected item object.
- */
- function () {
- return this._getOption('selectedItem');
- },
- set: function (value) {
- this._setOption('selectedItem', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "selectionMode", {
- get: /**
- * Specifies the selection mode supported by the menu.
- */
- function () {
- return this._getOption('selectionMode');
- },
- set: function (value) {
- this._setOption('selectionMode', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "showFirstSubmenuMode", {
- get: /**
- * Specifies options for showing and hiding the first level submenu.
- */
- function () {
- return this._getOption('showFirstSubmenuMode');
- },
- set: function (value) {
- this._setOption('showFirstSubmenuMode', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "showSubmenuMode", {
- get: /**
- * Specifies options of submenu showing and hiding.
- */
- function () {
- return this._getOption('showSubmenuMode');
- },
- set: function (value) {
- this._setOption('showSubmenuMode', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "submenuDirection", {
- get: /**
- * Specifies the direction at which the submenus are displayed.
- */
- function () {
- return this._getOption('submenuDirection');
- },
- set: function (value) {
- this._setOption('submenuDirection', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "tabIndex", {
- get: /**
- * Specifies the number of the element when the Tab key is used for navigating.
- */
- function () {
- return this._getOption('tabIndex');
- },
- set: function (value) {
- this._setOption('tabIndex', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "visible", {
- get: /**
- * Specifies whether the widget is visible.
- */
- function () {
- return this._getOption('visible');
- },
- set: function (value) {
- this._setOption('visible', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "width", {
- get: /**
- * Specifies the widget's width.
- */
- function () {
- return this._getOption('width');
- },
- set: function (value) {
- this._setOption('width', value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(DxMenuComponent.prototype, "itemsChildren", {
- get: function () {
- return this._getOption('items');
- },
- set: function (value) {
- this.setChildren('items', value);
- },
- enumerable: true,
- configurable: true
- });
- DxMenuComponent.prototype._createInstance = function (element, options) {
- return new menu_1.default(element, options);
- };
- DxMenuComponent.prototype.ngOnDestroy = function () {
- this._destroyWidget();
- };
- DxMenuComponent.prototype.ngOnChanges = function (changes) {
- _super.prototype.ngOnChanges.call(this, changes);
- this.setupChanges('dataSource', changes);
- this.setupChanges('items', changes);
- };
- DxMenuComponent.prototype.setupChanges = function (prop, changes) {
- if (!(prop in this._optionsToUpdate)) {
- this._idh.setup(prop, changes);
- }
- };
- DxMenuComponent.prototype.ngDoCheck = function () {
- this._idh.doCheck('dataSource');
- this._idh.doCheck('items');
- this._watcherHelper.checkWatchers();
- _super.prototype.ngDoCheck.call(this);
- _super.prototype.clearChangedOptions.call(this);
- };
- DxMenuComponent.prototype._setOption = function (name, value) {
- var isSetup = this._idh.setupSingle(name, value);
- var isChanged = this._idh.getChanges(name, value) !== null;
- if (isSetup || isChanged) {
- _super.prototype._setOption.call(this, name, value);
- }
- };
- DxMenuComponent.decorators = [
- { type: core_1.Component, args: [{
- selector: 'dx-menu',
- template: '',
- providers: [
- template_host_1.DxTemplateHost,
- watcher_helper_1.WatcherHelper,
- nested_option_1.NestedOptionHost,
- iterable_differ_helper_1.IterableDifferHelper
- ]
- },] },
- ];
- /** @nocollapse */
- DxMenuComponent.ctorParameters = function () { return [
- { type: core_1.ElementRef, },
- { type: core_1.NgZone, },
- { type: template_host_1.DxTemplateHost, },
- { type: watcher_helper_1.WatcherHelper, },
- { type: iterable_differ_helper_1.IterableDifferHelper, },
- { type: nested_option_1.NestedOptionHost, },
- { type: platform_browser_2.TransferState, },
- { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.PLATFORM_ID,] },] },
- ]; };
- DxMenuComponent.propDecorators = {
- "accessKey": [{ type: core_1.Input },],
- "activeStateEnabled": [{ type: core_1.Input },],
- "adaptivityEnabled": [{ type: core_1.Input },],
- "animation": [{ type: core_1.Input },],
- "cssClass": [{ type: core_1.Input },],
- "dataSource": [{ type: core_1.Input },],
- "disabled": [{ type: core_1.Input },],
- "disabledExpr": [{ type: core_1.Input },],
- "displayExpr": [{ type: core_1.Input },],
- "elementAttr": [{ type: core_1.Input },],
- "focusStateEnabled": [{ type: core_1.Input },],
- "height": [{ type: core_1.Input },],
- "hideSubmenuOnMouseLeave": [{ type: core_1.Input },],
- "hint": [{ type: core_1.Input },],
- "hoverStateEnabled": [{ type: core_1.Input },],
- "items": [{ type: core_1.Input },],
- "itemsExpr": [{ type: core_1.Input },],
- "itemTemplate": [{ type: core_1.Input },],
- "orientation": [{ type: core_1.Input },],
- "rtlEnabled": [{ type: core_1.Input },],
- "selectByClick": [{ type: core_1.Input },],
- "selectedExpr": [{ type: core_1.Input },],
- "selectedItem": [{ type: core_1.Input },],
- "selectionMode": [{ type: core_1.Input },],
- "showFirstSubmenuMode": [{ type: core_1.Input },],
- "showSubmenuMode": [{ type: core_1.Input },],
- "submenuDirection": [{ type: core_1.Input },],
- "tabIndex": [{ type: core_1.Input },],
- "visible": [{ type: core_1.Input },],
- "width": [{ type: core_1.Input },],
- "onContentReady": [{ type: core_1.Output },],
- "onDisposing": [{ type: core_1.Output },],
- "onInitialized": [{ type: core_1.Output },],
- "onItemClick": [{ type: core_1.Output },],
- "onItemContextMenu": [{ type: core_1.Output },],
- "onItemRendered": [{ type: core_1.Output },],
- "onOptionChanged": [{ type: core_1.Output },],
- "onSelectionChanged": [{ type: core_1.Output },],
- "onSubmenuHidden": [{ type: core_1.Output },],
- "onSubmenuHiding": [{ type: core_1.Output },],
- "onSubmenuShowing": [{ type: core_1.Output },],
- "onSubmenuShown": [{ type: core_1.Output },],
- "accessKeyChange": [{ type: core_1.Output },],
- "activeStateEnabledChange": [{ type: core_1.Output },],
- "adaptivityEnabledChange": [{ type: core_1.Output },],
- "animationChange": [{ type: core_1.Output },],
- "cssClassChange": [{ type: core_1.Output },],
- "dataSourceChange": [{ type: core_1.Output },],
- "disabledChange": [{ type: core_1.Output },],
- "disabledExprChange": [{ type: core_1.Output },],
- "displayExprChange": [{ type: core_1.Output },],
- "elementAttrChange": [{ type: core_1.Output },],
- "focusStateEnabledChange": [{ type: core_1.Output },],
- "heightChange": [{ type: core_1.Output },],
- "hideSubmenuOnMouseLeaveChange": [{ type: core_1.Output },],
- "hintChange": [{ type: core_1.Output },],
- "hoverStateEnabledChange": [{ type: core_1.Output },],
- "itemsChange": [{ type: core_1.Output },],
- "itemsExprChange": [{ type: core_1.Output },],
- "itemTemplateChange": [{ type: core_1.Output },],
- "orientationChange": [{ type: core_1.Output },],
- "rtlEnabledChange": [{ type: core_1.Output },],
- "selectByClickChange": [{ type: core_1.Output },],
- "selectedExprChange": [{ type: core_1.Output },],
- "selectedItemChange": [{ type: core_1.Output },],
- "selectionModeChange": [{ type: core_1.Output },],
- "showFirstSubmenuModeChange": [{ type: core_1.Output },],
- "showSubmenuModeChange": [{ type: core_1.Output },],
- "submenuDirectionChange": [{ type: core_1.Output },],
- "tabIndexChange": [{ type: core_1.Output },],
- "visibleChange": [{ type: core_1.Output },],
- "widthChange": [{ type: core_1.Output },],
- "itemsChildren": [{ type: core_1.ContentChildren, args: [item_dxi_2.DxiItemComponent,] },],
- };
- return DxMenuComponent;
- }(component_1.DxComponent));
- exports.DxMenuComponent = DxMenuComponent;
- var DxMenuModule = (function () {
- function DxMenuModule() {
- }
- DxMenuModule.decorators = [
- { type: core_1.NgModule, args: [{
- imports: [
- animation_1.DxoAnimationModule,
- hide_1.DxoHideModule,
- show_1.DxoShowModule,
- item_dxi_1.DxiItemModule,
- show_first_submenu_mode_1.DxoShowFirstSubmenuModeModule,
- delay_1.DxoDelayModule,
- show_submenu_mode_1.DxoShowSubmenuModeModule,
- integration_1.DxIntegrationModule,
- template_1.DxTemplateModule,
- platform_browser_1.BrowserTransferStateModule
- ],
- declarations: [
- DxMenuComponent
- ],
- exports: [
- DxMenuComponent,
- animation_1.DxoAnimationModule,
- hide_1.DxoHideModule,
- show_1.DxoShowModule,
- item_dxi_1.DxiItemModule,
- show_first_submenu_mode_1.DxoShowFirstSubmenuModeModule,
- delay_1.DxoDelayModule,
- show_submenu_mode_1.DxoShowSubmenuModeModule,
- template_1.DxTemplateModule
- ]
- },] },
- ];
- return DxMenuModule;
- }());
- exports.DxMenuModule = DxMenuModule;
- //# sourceMappingURL=menu.js.map
|