@progress/kendo-angular-menu 3.0.6 → 4.0.0-next.202203230842
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/kendo-angular-menu.umd.js +5 -0
- package/{dist/es2015/constants.d.ts → constants.d.ts} +0 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-event.d.ts +0 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-items.service.d.ts +3 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-popup-event.d.ts +0 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-select-event.d.ts +0 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-target-container.directive.d.ts +3 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-target.directive.d.ts +3 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-target.service.d.ts +3 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu-template.directive.d.ts +3 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu.component.d.ts +4 -1
- package/{dist/es2015/context-menu → context-menu}/context-menu.module.d.ts +11 -0
- package/{dist/es2015/context-menu → context-menu}/context-menu.service.d.ts +3 -0
- package/{dist/es2015/data-binding → data-binding}/binding-directive-base.d.ts +3 -0
- package/{dist/es2015/data-binding → data-binding}/flat-binding.directive.d.ts +3 -0
- package/{dist/es2015/data-binding → data-binding}/hierachy-binding.directive.d.ts +3 -0
- package/{dist/es2015/data-binding → data-binding}/utils.d.ts +0 -0
- package/{dist/es2015/dom-queries.d.ts → dom-queries.d.ts} +0 -0
- package/{dist/es2015 → esm2015}/constants.js +0 -0
- package/{dist/es2015 → esm2015}/context-menu/context-menu-event.js +0 -0
- package/esm2015/context-menu/context-menu-items.service.js +25 -0
- package/{dist/es2015 → esm2015}/context-menu/context-menu-popup-event.js +0 -0
- package/{dist/es2015 → esm2015}/context-menu/context-menu-select-event.js +0 -0
- package/esm2015/context-menu/context-menu-target-container.directive.js +32 -0
- package/esm2015/context-menu/context-menu-target.directive.js +46 -0
- package/{dist/es2015 → esm2015}/context-menu/context-menu-target.service.js +8 -10
- package/esm2015/context-menu/context-menu-template.directive.js +32 -0
- package/{dist/es2015 → esm2015}/context-menu/context-menu.component.js +107 -113
- package/{dist/es2015 → esm2015}/context-menu/context-menu.module.js +20 -11
- package/{dist/es2015 → esm2015}/context-menu/context-menu.service.js +8 -10
- package/{dist/es2015 → esm2015}/data-binding/binding-directive-base.js +11 -0
- package/esm2015/data-binding/flat-binding.directive.js +82 -0
- package/esm2015/data-binding/hierachy-binding.directive.js +71 -0
- package/{dist/es2015 → esm2015}/data-binding/utils.js +0 -1
- package/{dist/es2015 → esm2015}/dom-queries.js +0 -3
- package/{dist/es/constants.js → esm2015/kendo-angular-menu.js} +2 -2
- package/{dist/es → esm2015}/main.js +3 -2
- package/{dist/es → esm2015}/menu-animation.interface.js +1 -0
- package/esm2015/menu-base.js +69 -0
- package/{dist/es2015 → esm2015}/menu-event.js +0 -0
- package/{dist/es2015 → esm2015}/menu-item.component.js +41 -60
- package/{dist/es → esm2015}/menu-item.interface.js +1 -0
- package/{dist/es2015 → esm2015}/menu-select-event.js +0 -0
- package/{dist/es2015 → esm2015}/menu.component.js +76 -63
- package/{dist/es2015 → esm2015}/menu.module.js +32 -13
- package/{dist/es2015 → esm2015}/menus.module.js +12 -9
- package/{dist/es2015 → esm2015}/open-on-click-settings.js +0 -1
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/preventable-event.js +0 -0
- package/esm2015/rendering/arrow.directive.js +62 -0
- package/esm2015/rendering/link.directive.js +54 -0
- package/esm2015/rendering/list.component.js +546 -0
- package/{dist/es2015 → esm2015}/rendering/popup-settings.js +0 -0
- package/{dist/es2015 → esm2015}/services/actions.service.js +21 -14
- package/{dist/es2015 → esm2015}/services/hover.service.js +10 -10
- package/{dist/es2015 → esm2015}/services/items.service.js +8 -13
- package/{dist/es2015 → esm2015}/services/navigation.service.js +12 -15
- package/{dist/es2015 → esm2015}/templates/item-content-template.directive.js +14 -12
- package/{dist/es2015 → esm2015}/templates/item-link-template.directive.js +14 -12
- package/{dist/es2015 → esm2015}/templates/item-template.directive.js +14 -12
- package/{dist/es2015 → esm2015}/utils.js +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-menu.js} +1112 -1113
- package/kendo-angular-menu.d.ts +9 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +3 -2
- package/{dist/es2015/menu-animation.interface.d.ts → menu-animation.interface.d.ts} +0 -0
- package/{dist/es2015/menu-base.d.ts → menu-base.d.ts} +4 -1
- package/{dist/es2015/menu-event.d.ts → menu-event.d.ts} +0 -0
- package/{dist/es2015/menu-item.component.d.ts → menu-item.component.d.ts} +7 -4
- package/{dist/es2015/menu-item.interface.d.ts → menu-item.interface.d.ts} +0 -0
- package/{dist/es2015/menu-select-event.d.ts → menu-select-event.d.ts} +0 -0
- package/{dist/es2015/menu.component.d.ts → menu.component.d.ts} +7 -4
- package/menu.module.d.ts +54 -0
- package/{dist/es2015/menus.module.d.ts → menus.module.d.ts} +6 -0
- package/{dist/es2015/open-on-click-settings.d.ts → open-on-click-settings.d.ts} +0 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +31 -106
- package/{dist/es2015/preventable-event.d.ts → preventable-event.d.ts} +0 -0
- package/{dist/es2015/rendering → rendering}/arrow.directive.d.ts +6 -3
- package/{dist/es2015/rendering → rendering}/link.directive.d.ts +4 -1
- package/rendering/list.component.d.ts +104 -0
- package/{dist/es2015/rendering → rendering}/popup-settings.d.ts +0 -0
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/services → services}/actions.service.d.ts +24 -1
- package/{dist/es2015/services → services}/hover.service.d.ts +7 -2
- package/{dist/es2015/services → services}/items.service.d.ts +4 -1
- package/{dist/es2015/services → services}/navigation.service.d.ts +6 -3
- package/{dist/es2015/templates → templates}/item-content-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/item-link-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/item-template.directive.d.ts +3 -0
- package/{dist/es2015/utils.d.ts → utils.d.ts} +1 -1
- package/dist/cdn/js/kendo-angular-menu.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/context-menu/context-menu-event.js +0 -13
- package/dist/es/context-menu/context-menu-items.service.js +0 -26
- package/dist/es/context-menu/context-menu-popup-event.js +0 -17
- package/dist/es/context-menu/context-menu-select-event.js +0 -17
- package/dist/es/context-menu/context-menu-target-container.directive.js +0 -31
- package/dist/es/context-menu/context-menu-target.directive.js +0 -48
- package/dist/es/context-menu/context-menu-target.service.js +0 -29
- package/dist/es/context-menu/context-menu-template.directive.js +0 -31
- package/dist/es/context-menu/context-menu.component.js +0 -456
- package/dist/es/context-menu/context-menu.module.js +0 -64
- package/dist/es/context-menu/context-menu.service.js +0 -30
- package/dist/es/data-binding/binding-directive-base.js +0 -32
- package/dist/es/data-binding/flat-binding.directive.js +0 -104
- package/dist/es/data-binding/hierachy-binding.directive.js +0 -94
- package/dist/es/data-binding/utils.js +0 -32
- package/dist/es/dom-queries.js +0 -107
- package/dist/es/index.js +0 -21
- package/dist/es/menu-base.js +0 -79
- package/dist/es/menu-event.js +0 -17
- package/dist/es/menu-item.component.js +0 -165
- package/dist/es/menu-select-event.js +0 -17
- package/dist/es/menu.component.js +0 -256
- package/dist/es/menu.module.js +0 -79
- package/dist/es/menus.module.js +0 -41
- package/dist/es/open-on-click-settings.js +0 -13
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/preventable-event.js +0 -36
- package/dist/es/rendering/arrow.directive.js +0 -81
- package/dist/es/rendering/item.component.js +0 -337
- package/dist/es/rendering/link.directive.js +0 -62
- package/dist/es/rendering/list.component.js +0 -219
- package/dist/es/rendering/popup-settings.js +0 -66
- package/dist/es/services/actions.service.js +0 -178
- package/dist/es/services/hover.service.js +0 -136
- package/dist/es/services/items.service.js +0 -140
- package/dist/es/services/navigation.service.js +0 -274
- package/dist/es/templates/item-content-template.directive.js +0 -50
- package/dist/es/templates/item-link-template.directive.js +0 -52
- package/dist/es/templates/item-template.directive.js +0 -51
- package/dist/es/utils.js +0 -18
- package/dist/es2015/context-menu/context-menu-items.service.js +0 -25
- package/dist/es2015/context-menu/context-menu-target-container.directive.js +0 -30
- package/dist/es2015/context-menu/context-menu-target.directive.js +0 -47
- package/dist/es2015/context-menu/context-menu-template.directive.js +0 -30
- package/dist/es2015/data-binding/flat-binding.directive.js +0 -101
- package/dist/es2015/data-binding/hierachy-binding.directive.js +0 -90
- package/dist/es2015/index.d.ts +0 -21
- package/dist/es2015/index.js +0 -21
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/main.js +0 -26
- package/dist/es2015/menu-animation.interface.js +0 -4
- package/dist/es2015/menu-base.js +0 -73
- package/dist/es2015/menu-item.interface.js +0 -4
- package/dist/es2015/menu.module.d.ts +0 -38
- package/dist/es2015/rendering/arrow.directive.js +0 -68
- package/dist/es2015/rendering/item.component.d.ts +0 -64
- package/dist/es2015/rendering/item.component.js +0 -327
- package/dist/es2015/rendering/link.directive.js +0 -57
- package/dist/es2015/rendering/list.component.d.ts +0 -41
- package/dist/es2015/rendering/list.component.js +0 -233
- package/dist/fesm5/index.js +0 -3222
- package/dist/npm/constants.js +0 -10
- package/dist/npm/context-menu/context-menu-event.js +0 -15
- package/dist/npm/context-menu/context-menu-items.service.js +0 -28
- package/dist/npm/context-menu/context-menu-popup-event.js +0 -19
- package/dist/npm/context-menu/context-menu-select-event.js +0 -19
- package/dist/npm/context-menu/context-menu-target-container.directive.js +0 -33
- package/dist/npm/context-menu/context-menu-target.directive.js +0 -50
- package/dist/npm/context-menu/context-menu-target.service.js +0 -31
- package/dist/npm/context-menu/context-menu-template.directive.js +0 -33
- package/dist/npm/context-menu/context-menu.component.js +0 -459
- package/dist/npm/context-menu/context-menu.module.js +0 -66
- package/dist/npm/context-menu/context-menu.service.js +0 -32
- package/dist/npm/data-binding/binding-directive-base.js +0 -34
- package/dist/npm/data-binding/flat-binding.directive.js +0 -106
- package/dist/npm/data-binding/hierachy-binding.directive.js +0 -96
- package/dist/npm/data-binding/utils.js +0 -34
- package/dist/npm/dom-queries.js +0 -110
- package/dist/npm/index.js +0 -37
- package/dist/npm/main.js +0 -50
- package/dist/npm/menu-animation.interface.js +0 -6
- package/dist/npm/menu-base.js +0 -81
- package/dist/npm/menu-event.js +0 -19
- package/dist/npm/menu-item.component.js +0 -167
- package/dist/npm/menu-item.interface.js +0 -6
- package/dist/npm/menu-select-event.js +0 -19
- package/dist/npm/menu.component.js +0 -258
- package/dist/npm/menu.module.js +0 -81
- package/dist/npm/menus.module.js +0 -43
- package/dist/npm/open-on-click-settings.js +0 -15
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/preventable-event.js +0 -38
- package/dist/npm/rendering/arrow.directive.js +0 -83
- package/dist/npm/rendering/item.component.js +0 -339
- package/dist/npm/rendering/link.directive.js +0 -64
- package/dist/npm/rendering/list.component.js +0 -221
- package/dist/npm/rendering/popup-settings.js +0 -68
- package/dist/npm/services/actions.service.js +0 -180
- package/dist/npm/services/hover.service.js +0 -138
- package/dist/npm/services/items.service.js +0 -143
- package/dist/npm/services/navigation.service.js +0 -276
- package/dist/npm/templates/item-content-template.directive.js +0 -52
- package/dist/npm/templates/item-link-template.directive.js +0 -54
- package/dist/npm/templates/item-template.directive.js +0 -53
- package/dist/npm/utils.js +0 -20
- package/dist/systemjs/kendo-angular-menu.js +0 -5
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import
|
|
6
|
-
import { Injectable, NgZone,
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Injectable, NgZone, Directive, Optional, Component, Input, ContentChildren, EventEmitter, ElementRef, ViewChild, HostBinding, forwardRef, Output, isDevMode, NgModule, ContentChild } from '@angular/core';
|
|
7
|
+
import * as i3 from '@progress/kendo-angular-l10n';
|
|
7
8
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
9
|
-
import { hasObservers, isDocumentAvailable, Keys } from '@progress/kendo-angular-common';
|
|
10
|
+
import { PreventableEvent as PreventableEvent$1, hasObservers, isDocumentAvailable, Keys } from '@progress/kendo-angular-common';
|
|
11
|
+
import * as i6 from '@progress/kendo-angular-popup';
|
|
10
12
|
import { PopupService, POPUP_CONTAINER, PopupModule } from '@progress/kendo-angular-popup';
|
|
13
|
+
import * as i5 from '@angular/common';
|
|
11
14
|
import { CommonModule } from '@angular/common';
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -17,7 +20,7 @@ const packageMetadata = {
|
|
|
17
20
|
name: '@progress/kendo-angular-menu',
|
|
18
21
|
productName: 'Kendo UI for Angular',
|
|
19
22
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
20
|
-
publishDate:
|
|
23
|
+
publishDate: 1648024704,
|
|
21
24
|
version: '',
|
|
22
25
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
23
26
|
};
|
|
@@ -45,10 +48,7 @@ const next = (idx, items, dir) => {
|
|
|
45
48
|
/**
|
|
46
49
|
* @hidden
|
|
47
50
|
*/
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
51
|
+
class ItemsService {
|
|
52
52
|
constructor() {
|
|
53
53
|
this.items = {};
|
|
54
54
|
this.lists = [];
|
|
@@ -143,53 +143,28 @@ let ItemsService = class ItemsService {
|
|
|
143
143
|
parentIndex(index) {
|
|
144
144
|
return index.replace(PARENT_REGEX, '');
|
|
145
145
|
}
|
|
146
|
-
}
|
|
147
|
-
ItemsService =
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
}
|
|
147
|
+
ItemsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
148
|
+
ItemsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemsService });
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemsService, decorators: [{
|
|
150
|
+
type: Injectable
|
|
151
|
+
}] });
|
|
150
152
|
|
|
153
|
+
const canPerformAction = (item, action) => !((action === 'open' && item.opened) || (action === 'close' && !item.opened));
|
|
151
154
|
/**
|
|
155
|
+
* Used to remove cyclic dependency error. Dublicates MenuEvent
|
|
152
156
|
* @hidden
|
|
153
157
|
*/
|
|
154
|
-
class PreventableEvent {
|
|
155
|
-
/**
|
|
156
|
-
* @hidden
|
|
157
|
-
*/
|
|
158
|
+
class MenuStateEvent extends PreventableEvent$1 {
|
|
158
159
|
constructor(args) {
|
|
159
|
-
|
|
160
|
+
super();
|
|
160
161
|
Object.assign(this, args);
|
|
161
162
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Prevents the default action for a specified event.
|
|
164
|
-
* In this way, the source component suppresses
|
|
165
|
-
* the built-in behavior that follows the event.
|
|
166
|
-
*/
|
|
167
|
-
preventDefault() {
|
|
168
|
-
this.prevented = true;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Returns `true` if the event was prevented
|
|
172
|
-
* by any of its subscribers.
|
|
173
|
-
*
|
|
174
|
-
* @returns `true` if the default action was prevented.
|
|
175
|
-
* Otherwise, returns `false`.
|
|
176
|
-
*/
|
|
177
|
-
isDefaultPrevented() {
|
|
178
|
-
return this.prevented;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Arguments for the `open` and `close` events of the Menu.
|
|
184
|
-
*/
|
|
185
|
-
class MenuEvent extends PreventableEvent {
|
|
186
163
|
}
|
|
187
|
-
|
|
188
|
-
const canPerformAction = (item, action) => !((action === 'open' && item.opened) || (action === 'close' && !item.opened));
|
|
189
164
|
/**
|
|
190
165
|
* @hidden
|
|
191
166
|
*/
|
|
192
|
-
|
|
167
|
+
class ActionsService {
|
|
193
168
|
constructor(ngZone, items) {
|
|
194
169
|
this.ngZone = ngZone;
|
|
195
170
|
this.items = items;
|
|
@@ -258,7 +233,7 @@ let ActionsService = class ActionsService {
|
|
|
258
233
|
}
|
|
259
234
|
emit(name, item, domEvent) {
|
|
260
235
|
const owner = this.owner;
|
|
261
|
-
const eventArgs = new
|
|
236
|
+
const eventArgs = new MenuStateEvent({
|
|
262
237
|
sender: owner,
|
|
263
238
|
item: item.item,
|
|
264
239
|
index: item.index,
|
|
@@ -337,11 +312,12 @@ let ActionsService = class ActionsService {
|
|
|
337
312
|
this.close(items[idx]);
|
|
338
313
|
}
|
|
339
314
|
}
|
|
340
|
-
}
|
|
341
|
-
ActionsService =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
315
|
+
}
|
|
316
|
+
ActionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsService, deps: [{ token: i0.NgZone }, { token: ItemsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
317
|
+
ActionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsService });
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ActionsService, decorators: [{
|
|
319
|
+
type: Injectable
|
|
320
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: ItemsService }]; } });
|
|
345
321
|
|
|
346
322
|
const DEFAULT_ACTIVE = '0';
|
|
347
323
|
const NO_SPACE_REGEX = /\S/;
|
|
@@ -367,7 +343,7 @@ const resolvedPromise = Promise.resolve(null);
|
|
|
367
343
|
/**
|
|
368
344
|
* @hidden
|
|
369
345
|
*/
|
|
370
|
-
|
|
346
|
+
class NavigationService {
|
|
371
347
|
constructor(items, actions, localization, ngZone) {
|
|
372
348
|
this.items = items;
|
|
373
349
|
this.actions = actions;
|
|
@@ -584,20 +560,18 @@ let NavigationService = class NavigationService {
|
|
|
584
560
|
}
|
|
585
561
|
}
|
|
586
562
|
}
|
|
587
|
-
}
|
|
588
|
-
NavigationService =
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
LocalizationService,
|
|
593
|
-
NgZone])
|
|
594
|
-
], NavigationService);
|
|
563
|
+
}
|
|
564
|
+
NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, deps: [{ token: ItemsService }, { token: ActionsService }, { token: i3.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
565
|
+
NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService });
|
|
566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, decorators: [{
|
|
567
|
+
type: Injectable
|
|
568
|
+
}], ctorParameters: function () { return [{ type: ItemsService }, { type: ActionsService }, { type: i3.LocalizationService }, { type: i0.NgZone }]; } });
|
|
595
569
|
|
|
596
570
|
const DISABLE_OPEN_ON_OVER_DELAY = 500;
|
|
597
571
|
/**
|
|
598
572
|
* @hidden
|
|
599
573
|
*/
|
|
600
|
-
|
|
574
|
+
class HoverService {
|
|
601
575
|
constructor(actions, items) {
|
|
602
576
|
this.actions = actions;
|
|
603
577
|
this.items = items;
|
|
@@ -701,13 +675,13 @@ let HoverService = class HoverService {
|
|
|
701
675
|
}
|
|
702
676
|
}
|
|
703
677
|
}
|
|
704
|
-
}
|
|
705
|
-
HoverService =
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
678
|
+
}
|
|
679
|
+
HoverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HoverService, deps: [{ token: ActionsService }, { token: ItemsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
680
|
+
HoverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HoverService });
|
|
681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HoverService, decorators: [{
|
|
682
|
+
type: Injectable
|
|
683
|
+
}], ctorParameters: function () { return [{ type: ActionsService }, { type: ItemsService }]; } });
|
|
709
684
|
|
|
710
|
-
/* tslint:disable:max-line-length */
|
|
711
685
|
/**
|
|
712
686
|
* @hidden
|
|
713
687
|
*/
|
|
@@ -820,30 +794,6 @@ const findInContainer = (element, selector, container) => {
|
|
|
820
794
|
return match;
|
|
821
795
|
};
|
|
822
796
|
|
|
823
|
-
/**
|
|
824
|
-
* @hidden
|
|
825
|
-
*/
|
|
826
|
-
let ContextMenuService = class ContextMenuService {
|
|
827
|
-
/**
|
|
828
|
-
* @hidden
|
|
829
|
-
*/
|
|
830
|
-
constructor() {
|
|
831
|
-
this.keydown = new EventEmitter();
|
|
832
|
-
}
|
|
833
|
-
emit(name, args) {
|
|
834
|
-
this.owner.emitMenuEvent(name, args);
|
|
835
|
-
}
|
|
836
|
-
hasObservers(name) {
|
|
837
|
-
return this.owner && hasObservers(this.owner[name]);
|
|
838
|
-
}
|
|
839
|
-
leaveMenu(e) {
|
|
840
|
-
return this.items ? !inMenu(e.target, this.items) : true;
|
|
841
|
-
}
|
|
842
|
-
};
|
|
843
|
-
ContextMenuService = __decorate([
|
|
844
|
-
Injectable()
|
|
845
|
-
], ContextMenuService);
|
|
846
|
-
|
|
847
797
|
/**
|
|
848
798
|
* Represents a template for the Menu items ([see example]({% slug templates_menu %})). To define a template
|
|
849
799
|
* for an item, nest an `<ng-template>` tag with the `kendoMenuItemTemplate` directive inside a `<kendo-menu-item>`
|
|
@@ -875,18 +825,21 @@ ContextMenuService = __decorate([
|
|
|
875
825
|
* }
|
|
876
826
|
* ```
|
|
877
827
|
*/
|
|
878
|
-
|
|
828
|
+
class ItemTemplateDirective {
|
|
879
829
|
constructor(templateRef) {
|
|
880
830
|
this.templateRef = templateRef;
|
|
881
831
|
}
|
|
882
|
-
}
|
|
883
|
-
ItemTemplateDirective =
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
]
|
|
832
|
+
}
|
|
833
|
+
ItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
834
|
+
ItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemTemplateDirective, selector: "[kendoMenuItemTemplate]", ngImport: i0 });
|
|
835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, decorators: [{
|
|
836
|
+
type: Directive,
|
|
837
|
+
args: [{
|
|
838
|
+
selector: '[kendoMenuItemTemplate]'
|
|
839
|
+
}]
|
|
840
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
841
|
+
type: Optional
|
|
842
|
+
}] }]; } });
|
|
890
843
|
|
|
891
844
|
/**
|
|
892
845
|
* Represents a template for the links of the Menu items ([see example]({% slug templates_menu %})). To define a template
|
|
@@ -920,18 +873,21 @@ ItemTemplateDirective = __decorate([
|
|
|
920
873
|
* }
|
|
921
874
|
* ```
|
|
922
875
|
*/
|
|
923
|
-
|
|
876
|
+
class ItemLinkTemplateDirective {
|
|
924
877
|
constructor(templateRef) {
|
|
925
878
|
this.templateRef = templateRef;
|
|
926
879
|
}
|
|
927
|
-
}
|
|
928
|
-
ItemLinkTemplateDirective =
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
]
|
|
880
|
+
}
|
|
881
|
+
ItemLinkTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemLinkTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
882
|
+
ItemLinkTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemLinkTemplateDirective, selector: "[kendoMenuItemLinkTemplate]", ngImport: i0 });
|
|
883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemLinkTemplateDirective, decorators: [{
|
|
884
|
+
type: Directive,
|
|
885
|
+
args: [{
|
|
886
|
+
selector: '[kendoMenuItemLinkTemplate]'
|
|
887
|
+
}]
|
|
888
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
889
|
+
type: Optional
|
|
890
|
+
}] }]; } });
|
|
935
891
|
|
|
936
892
|
/**
|
|
937
893
|
* Represents a template for the content of the Menu items ([see example]({% slug templates_menu %})). To define the template,
|
|
@@ -963,20 +919,22 @@ ItemLinkTemplateDirective = __decorate([
|
|
|
963
919
|
* }
|
|
964
920
|
* ```
|
|
965
921
|
*/
|
|
966
|
-
|
|
922
|
+
class ItemContentTemplateDirective {
|
|
967
923
|
constructor(templateRef) {
|
|
968
924
|
this.templateRef = templateRef;
|
|
969
925
|
}
|
|
970
|
-
}
|
|
971
|
-
ItemContentTemplateDirective =
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
]
|
|
926
|
+
}
|
|
927
|
+
ItemContentTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
928
|
+
ItemContentTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemContentTemplateDirective, selector: "[kendoMenuItemContentTemplate]", ngImport: i0 });
|
|
929
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemContentTemplateDirective, decorators: [{
|
|
930
|
+
type: Directive,
|
|
931
|
+
args: [{
|
|
932
|
+
selector: '[kendoMenuItemContentTemplate]'
|
|
933
|
+
}]
|
|
934
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
935
|
+
type: Optional
|
|
936
|
+
}] }]; } });
|
|
978
937
|
|
|
979
|
-
var MenuItemComponent_1;
|
|
980
938
|
/**
|
|
981
939
|
* A component that can be used to specify the Menu items
|
|
982
940
|
* ([more information and examples]({% slug items_menu %})).
|
|
@@ -1022,7 +980,7 @@ var MenuItemComponent_1;
|
|
|
1022
980
|
* }
|
|
1023
981
|
* ```
|
|
1024
982
|
*/
|
|
1025
|
-
|
|
983
|
+
class MenuItemComponent {
|
|
1026
984
|
/**
|
|
1027
985
|
* @hidden
|
|
1028
986
|
*/
|
|
@@ -1055,61 +1013,44 @@ let MenuItemComponent = MenuItemComponent_1 = class MenuItemComponent {
|
|
|
1055
1013
|
return this.children.toArray().filter(c => c !== this);
|
|
1056
1014
|
}
|
|
1057
1015
|
}
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
]
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
],
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
ContentChildren(ItemLinkTemplateDirective),
|
|
1097
|
-
__metadata("design:type", QueryList)
|
|
1098
|
-
], MenuItemComponent.prototype, "itemLinkTemplate", void 0);
|
|
1099
|
-
__decorate([
|
|
1100
|
-
ContentChildren(ItemContentTemplateDirective),
|
|
1101
|
-
__metadata("design:type", QueryList)
|
|
1102
|
-
], MenuItemComponent.prototype, "itemContentTemplate", void 0);
|
|
1103
|
-
__decorate([
|
|
1104
|
-
ContentChildren(MenuItemComponent_1),
|
|
1105
|
-
__metadata("design:type", QueryList)
|
|
1106
|
-
], MenuItemComponent.prototype, "children", void 0);
|
|
1107
|
-
MenuItemComponent = MenuItemComponent_1 = __decorate([
|
|
1108
|
-
Component({
|
|
1109
|
-
selector: 'kendo-menu-item',
|
|
1110
|
-
template: ``
|
|
1111
|
-
})
|
|
1112
|
-
], MenuItemComponent);
|
|
1016
|
+
}
|
|
1017
|
+
MenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1018
|
+
MenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MenuItemComponent, selector: "kendo-menu-item", inputs: { text: "text", url: "url", disabled: "disabled", cssClass: "cssClass", cssStyle: "cssStyle", icon: "icon", data: "data", separator: "separator" }, queries: [{ propertyName: "itemTemplate", predicate: ItemTemplateDirective }, { propertyName: "itemLinkTemplate", predicate: ItemLinkTemplateDirective }, { propertyName: "itemContentTemplate", predicate: ItemContentTemplateDirective }, { propertyName: "children", predicate: MenuItemComponent }], ngImport: i0, template: ``, isInline: true });
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
1020
|
+
type: Component,
|
|
1021
|
+
args: [{
|
|
1022
|
+
selector: 'kendo-menu-item',
|
|
1023
|
+
template: ``
|
|
1024
|
+
}]
|
|
1025
|
+
}], propDecorators: { text: [{
|
|
1026
|
+
type: Input
|
|
1027
|
+
}], url: [{
|
|
1028
|
+
type: Input
|
|
1029
|
+
}], disabled: [{
|
|
1030
|
+
type: Input
|
|
1031
|
+
}], cssClass: [{
|
|
1032
|
+
type: Input
|
|
1033
|
+
}], cssStyle: [{
|
|
1034
|
+
type: Input
|
|
1035
|
+
}], icon: [{
|
|
1036
|
+
type: Input
|
|
1037
|
+
}], data: [{
|
|
1038
|
+
type: Input
|
|
1039
|
+
}], separator: [{
|
|
1040
|
+
type: Input
|
|
1041
|
+
}], itemTemplate: [{
|
|
1042
|
+
type: ContentChildren,
|
|
1043
|
+
args: [ItemTemplateDirective]
|
|
1044
|
+
}], itemLinkTemplate: [{
|
|
1045
|
+
type: ContentChildren,
|
|
1046
|
+
args: [ItemLinkTemplateDirective]
|
|
1047
|
+
}], itemContentTemplate: [{
|
|
1048
|
+
type: ContentChildren,
|
|
1049
|
+
args: [ItemContentTemplateDirective]
|
|
1050
|
+
}], children: [{
|
|
1051
|
+
type: ContentChildren,
|
|
1052
|
+
args: [MenuItemComponent]
|
|
1053
|
+
}] } });
|
|
1113
1054
|
|
|
1114
1055
|
/**
|
|
1115
1056
|
* @hidden
|
|
@@ -1143,289 +1084,160 @@ class MenuBase {
|
|
|
1143
1084
|
return this.items || (this.children ? this.children.toArray() : []);
|
|
1144
1085
|
}
|
|
1145
1086
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
]
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
]
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
]
|
|
1174
|
-
__decorate([
|
|
1175
|
-
ContentChildren(MenuItemComponent),
|
|
1176
|
-
__metadata("design:type", QueryList)
|
|
1177
|
-
], MenuBase.prototype, "children", void 0);
|
|
1087
|
+
MenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1088
|
+
MenuBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MenuBase, selector: "kendo-menu-base", inputs: { items: "items", vertical: "vertical", openOnClick: "openOnClick", hoverDelay: "hoverDelay", animate: "animate" }, queries: [{ propertyName: "itemTemplate", predicate: ItemTemplateDirective }, { propertyName: "itemLinkTemplate", predicate: ItemLinkTemplateDirective }, { propertyName: "children", predicate: MenuItemComponent }], ngImport: i0, template: ``, isInline: true });
|
|
1089
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuBase, decorators: [{
|
|
1090
|
+
type: Component,
|
|
1091
|
+
args: [{
|
|
1092
|
+
selector: 'kendo-menu-base',
|
|
1093
|
+
template: ``
|
|
1094
|
+
}]
|
|
1095
|
+
}], propDecorators: { items: [{
|
|
1096
|
+
type: Input
|
|
1097
|
+
}], vertical: [{
|
|
1098
|
+
type: Input
|
|
1099
|
+
}], openOnClick: [{
|
|
1100
|
+
type: Input
|
|
1101
|
+
}], hoverDelay: [{
|
|
1102
|
+
type: Input
|
|
1103
|
+
}], animate: [{
|
|
1104
|
+
type: Input
|
|
1105
|
+
}], itemTemplate: [{
|
|
1106
|
+
type: ContentChildren,
|
|
1107
|
+
args: [ItemTemplateDirective]
|
|
1108
|
+
}], itemLinkTemplate: [{
|
|
1109
|
+
type: ContentChildren,
|
|
1110
|
+
args: [ItemLinkTemplateDirective]
|
|
1111
|
+
}], children: [{
|
|
1112
|
+
type: ContentChildren,
|
|
1113
|
+
args: [MenuItemComponent]
|
|
1114
|
+
}] } });
|
|
1178
1115
|
|
|
1179
|
-
var MenuComponent_1;
|
|
1180
1116
|
/**
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
* @example
|
|
1184
|
-
* ```ts
|
|
1185
|
-
* _@Component({
|
|
1186
|
-
* selector: 'my-app',
|
|
1187
|
-
* template: `
|
|
1188
|
-
* <kendo-menu [items]="items">
|
|
1189
|
-
* </kendo-menu>
|
|
1190
|
-
* `
|
|
1191
|
-
* })
|
|
1192
|
-
* class AppComponent {
|
|
1193
|
-
* public items: any[] = [{ text: 'item1', items: [{ text: 'item1.1' }] }, { text: 'item2', disabled: true }];
|
|
1194
|
-
* }
|
|
1195
|
-
* ```
|
|
1117
|
+
* @hidden
|
|
1196
1118
|
*/
|
|
1197
|
-
|
|
1198
|
-
constructor(
|
|
1199
|
-
|
|
1119
|
+
class ContextMenuService {
|
|
1120
|
+
constructor() {
|
|
1121
|
+
this.keydown = new EventEmitter();
|
|
1122
|
+
}
|
|
1123
|
+
emit(name, args) {
|
|
1124
|
+
this.owner.emitMenuEvent(name, args);
|
|
1125
|
+
}
|
|
1126
|
+
hasObservers(name) {
|
|
1127
|
+
return this.owner && hasObservers(this.owner[name]);
|
|
1128
|
+
}
|
|
1129
|
+
leaveMenu(e) {
|
|
1130
|
+
return this.items ? !inMenu(e.target, this.items) : true;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
ContextMenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1134
|
+
ContextMenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuService });
|
|
1135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuService, decorators: [{
|
|
1136
|
+
type: Injectable
|
|
1137
|
+
}] });
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* @hidden
|
|
1141
|
+
*/
|
|
1142
|
+
const defined = (value) => typeof value !== 'undefined';
|
|
1143
|
+
/**
|
|
1144
|
+
* @hidden
|
|
1145
|
+
*/
|
|
1146
|
+
const bodyFactory = () => {
|
|
1147
|
+
if (isDocumentAvailable()) {
|
|
1148
|
+
return new ElementRef(document.body);
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
const POPUP_ALIGN = {
|
|
1153
|
+
vertical: 'top',
|
|
1154
|
+
horizontal: 'left'
|
|
1155
|
+
};
|
|
1156
|
+
const POPUP_ALIGN_RTL = {
|
|
1157
|
+
vertical: 'top',
|
|
1158
|
+
horizontal: 'right'
|
|
1159
|
+
};
|
|
1160
|
+
const VERTICAL_COLLISION = {
|
|
1161
|
+
vertical: 'flip',
|
|
1162
|
+
horizontal: 'fit'
|
|
1163
|
+
};
|
|
1164
|
+
const HORIZONTAL_COLLISION = {
|
|
1165
|
+
vertical: 'fit',
|
|
1166
|
+
horizontal: 'flip'
|
|
1167
|
+
};
|
|
1168
|
+
/**
|
|
1169
|
+
* @hidden
|
|
1170
|
+
*/
|
|
1171
|
+
const POPUP_SETTINGS_RTL = {
|
|
1172
|
+
vertical: {
|
|
1173
|
+
anchor: {
|
|
1174
|
+
vertical: 'bottom',
|
|
1175
|
+
horizontal: 'right'
|
|
1176
|
+
},
|
|
1177
|
+
popup: POPUP_ALIGN_RTL,
|
|
1178
|
+
collision: VERTICAL_COLLISION,
|
|
1179
|
+
animate: 'down'
|
|
1180
|
+
},
|
|
1181
|
+
horizontal: {
|
|
1182
|
+
anchor: {
|
|
1183
|
+
vertical: 'top',
|
|
1184
|
+
horizontal: 'left'
|
|
1185
|
+
},
|
|
1186
|
+
popup: POPUP_ALIGN_RTL,
|
|
1187
|
+
collision: HORIZONTAL_COLLISION,
|
|
1188
|
+
animate: 'left'
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
/**
|
|
1192
|
+
* @hidden
|
|
1193
|
+
*/
|
|
1194
|
+
const POPUP_SETTINGS = {
|
|
1195
|
+
vertical: {
|
|
1196
|
+
anchor: {
|
|
1197
|
+
vertical: 'bottom',
|
|
1198
|
+
horizontal: 'left'
|
|
1199
|
+
},
|
|
1200
|
+
popup: POPUP_ALIGN,
|
|
1201
|
+
collision: VERTICAL_COLLISION,
|
|
1202
|
+
animate: 'down'
|
|
1203
|
+
},
|
|
1204
|
+
horizontal: {
|
|
1205
|
+
anchor: {
|
|
1206
|
+
vertical: 'top',
|
|
1207
|
+
horizontal: 'right'
|
|
1208
|
+
},
|
|
1209
|
+
popup: POPUP_ALIGN,
|
|
1210
|
+
collision: HORIZONTAL_COLLISION,
|
|
1211
|
+
animate: 'right'
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
1216
|
+
/**
|
|
1217
|
+
* @hidden
|
|
1218
|
+
*/
|
|
1219
|
+
class ListComponent {
|
|
1220
|
+
constructor(itemsService, hover, actions, navigation, renderer, ngZone, element) {
|
|
1200
1221
|
this.itemsService = itemsService;
|
|
1201
1222
|
this.hover = hover;
|
|
1202
1223
|
this.actions = actions;
|
|
1203
1224
|
this.navigation = navigation;
|
|
1204
|
-
this.localization = localization;
|
|
1205
|
-
this.ngZone = ngZone;
|
|
1206
1225
|
this.renderer = renderer;
|
|
1207
|
-
this.
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
*/
|
|
1211
|
-
this.select = new EventEmitter();
|
|
1212
|
-
/**
|
|
1213
|
-
* Fires when a Menu item is opened.
|
|
1214
|
-
*/
|
|
1215
|
-
this.open = new EventEmitter();
|
|
1216
|
-
/**
|
|
1217
|
-
* Fires when a Menu item is closed.
|
|
1218
|
-
*/
|
|
1219
|
-
this.close = new EventEmitter();
|
|
1220
|
-
validatePackage(packageMetadata);
|
|
1221
|
-
this.actions.owner = this;
|
|
1222
|
-
if (contextService) {
|
|
1223
|
-
contextService.items = this.itemsService;
|
|
1224
|
-
this.contextKeyDownSubscription = contextService.keydown.subscribe(this.contextKeyDown.bind(this));
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
/**
|
|
1228
|
-
* @hidden
|
|
1229
|
-
*/
|
|
1230
|
-
get ariaOrientation() {
|
|
1231
|
-
if (this.vertical) {
|
|
1232
|
-
return 'vertical';
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
/**
|
|
1236
|
-
* @hidden
|
|
1237
|
-
*/
|
|
1238
|
-
get contextMenuClass() {
|
|
1239
|
-
return Boolean(this.contextService);
|
|
1226
|
+
this.ngZone = ngZone;
|
|
1227
|
+
this.element = element;
|
|
1228
|
+
this.animate = true;
|
|
1240
1229
|
}
|
|
1241
|
-
|
|
1242
|
-
return this.
|
|
1230
|
+
hierarchyIndex(index) {
|
|
1231
|
+
return this.itemsService.itemIndex(this.index, index);
|
|
1243
1232
|
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1233
|
+
ngOnInit() {
|
|
1234
|
+
this.itemsService.addList(this);
|
|
1235
|
+
this.initDomEvents();
|
|
1246
1236
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
* @param indices - One or more values which represent the hierarchical indices of the items that will be opened or closed.
|
|
1252
|
-
*/
|
|
1253
|
-
toggle(open, ...indices) {
|
|
1254
|
-
for (let idx = 0; idx < indices.length; idx++) {
|
|
1255
|
-
const item = this.itemsService.get(indices[idx]);
|
|
1256
|
-
if (item && !item.disabled) {
|
|
1257
|
-
if (open) {
|
|
1258
|
-
item.open();
|
|
1259
|
-
}
|
|
1260
|
-
else {
|
|
1261
|
-
item.close();
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
/**
|
|
1267
|
-
* @hidden
|
|
1268
|
-
*/
|
|
1269
|
-
focus(index) {
|
|
1270
|
-
this.navigation.focusIndex(index);
|
|
1271
|
-
}
|
|
1272
|
-
ngOnChanges(changes) {
|
|
1273
|
-
this.navigation.vertical = this.vertical;
|
|
1274
|
-
this.hover.delay = this.hoverDelay;
|
|
1275
|
-
if (changes.openOnClick) {
|
|
1276
|
-
const openOnClick = this.openOnClick = normalize(this.openOnClick);
|
|
1277
|
-
this.hover.openOnOver = !openOnClick;
|
|
1278
|
-
if (openOnClick && openOnClick.toggle === 'click') {
|
|
1279
|
-
this.attachCloseClick();
|
|
1280
|
-
}
|
|
1281
|
-
else {
|
|
1282
|
-
this.unsubscribeClick();
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
ngAfterViewChecked() {
|
|
1287
|
-
this.navigation.updateActive();
|
|
1288
|
-
}
|
|
1289
|
-
ngOnDestroy() {
|
|
1290
|
-
this.unsubscribeClick();
|
|
1291
|
-
if (this.contextService) {
|
|
1292
|
-
this.contextService.items = null;
|
|
1293
|
-
this.contextKeyDownSubscription.unsubscribe();
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
attachCloseClick() {
|
|
1297
|
-
if (!this.closeClickSubscription && isDocumentAvailable()) {
|
|
1298
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1299
|
-
this.closeClickSubscription = this.renderer.listen('document', 'click', (e) => {
|
|
1300
|
-
if (!inMenu(e.target, this.itemsService)) {
|
|
1301
|
-
this.hover.openOnOver = false;
|
|
1302
|
-
this.actions.closeAll();
|
|
1303
|
-
this.actions.execute();
|
|
1304
|
-
}
|
|
1305
|
-
});
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
unsubscribeClick() {
|
|
1310
|
-
if (this.closeClickSubscription) {
|
|
1311
|
-
this.closeClickSubscription();
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
contextKeyDown(e) {
|
|
1315
|
-
if (!this.itemsService.hasItems) {
|
|
1316
|
-
return;
|
|
1317
|
-
}
|
|
1318
|
-
const keyCode = e.keyCode;
|
|
1319
|
-
const rtl = this.localization.rtl;
|
|
1320
|
-
const first = keyCode === Keys.ArrowDown || keyCode === Keys.ArrowRight;
|
|
1321
|
-
const last = keyCode === Keys.ArrowUp || keyCode === Keys.ArrowLeft;
|
|
1322
|
-
let index;
|
|
1323
|
-
if ((first && !rtl) || (last && rtl)) {
|
|
1324
|
-
index = 'first';
|
|
1325
|
-
}
|
|
1326
|
-
else if ((first && rtl) || (last && !rtl)) {
|
|
1327
|
-
index = 'last';
|
|
1328
|
-
}
|
|
1329
|
-
if (index) {
|
|
1330
|
-
e.preventDefault();
|
|
1331
|
-
this.focus(index);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
};
|
|
1335
|
-
__decorate([
|
|
1336
|
-
Input(),
|
|
1337
|
-
__metadata("design:type", TemplateRef)
|
|
1338
|
-
], MenuComponent.prototype, "menuItemTemplate", void 0);
|
|
1339
|
-
__decorate([
|
|
1340
|
-
Input(),
|
|
1341
|
-
__metadata("design:type", TemplateRef)
|
|
1342
|
-
], MenuComponent.prototype, "menuItemLinkTemplate", void 0);
|
|
1343
|
-
__decorate([
|
|
1344
|
-
Output(),
|
|
1345
|
-
__metadata("design:type", EventEmitter)
|
|
1346
|
-
], MenuComponent.prototype, "select", void 0);
|
|
1347
|
-
__decorate([
|
|
1348
|
-
Output(),
|
|
1349
|
-
__metadata("design:type", EventEmitter)
|
|
1350
|
-
], MenuComponent.prototype, "open", void 0);
|
|
1351
|
-
__decorate([
|
|
1352
|
-
Output(),
|
|
1353
|
-
__metadata("design:type", EventEmitter)
|
|
1354
|
-
], MenuComponent.prototype, "close", void 0);
|
|
1355
|
-
__decorate([
|
|
1356
|
-
HostBinding('class.k-rtl'),
|
|
1357
|
-
__metadata("design:type", Boolean),
|
|
1358
|
-
__metadata("design:paramtypes", [])
|
|
1359
|
-
], MenuComponent.prototype, "direction", null);
|
|
1360
|
-
MenuComponent = MenuComponent_1 = __decorate([
|
|
1361
|
-
Component({
|
|
1362
|
-
exportAs: 'kendoMenu',
|
|
1363
|
-
providers: [
|
|
1364
|
-
ItemsService,
|
|
1365
|
-
ActionsService,
|
|
1366
|
-
NavigationService,
|
|
1367
|
-
HoverService,
|
|
1368
|
-
LocalizationService,
|
|
1369
|
-
{
|
|
1370
|
-
provide: L10N_PREFIX,
|
|
1371
|
-
useValue: 'kendo.menu'
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
provide: MenuBase,
|
|
1375
|
-
useExisting: forwardRef(() => MenuComponent_1)
|
|
1376
|
-
}
|
|
1377
|
-
],
|
|
1378
|
-
selector: 'kendo-menu',
|
|
1379
|
-
template: `
|
|
1380
|
-
<ul role="menubar"
|
|
1381
|
-
[attr.aria-orientation]="ariaOrientation"
|
|
1382
|
-
kendoMenuList [items]="rootItems" [level]="0" class="k-widget k-reset k-header k-menu"
|
|
1383
|
-
[vertical]="vertical" [rtl]="rtl" [animate]="animate" [openOnClick]="openOnClick"
|
|
1384
|
-
[itemTemplate]="itemTemplate.first?.templateRef || menuItemTemplate"
|
|
1385
|
-
[itemLinkTemplate]="itemLinkTemplate.first?.templateRef || menuItemLinkTemplate"
|
|
1386
|
-
[class.k-menu-horizontal]="!vertical"
|
|
1387
|
-
[class.k-menu-vertical]="vertical"
|
|
1388
|
-
[class.k-context-menu]="contextMenuClass">
|
|
1389
|
-
</ul>
|
|
1390
|
-
`
|
|
1391
|
-
}),
|
|
1392
|
-
__param(7, Optional()),
|
|
1393
|
-
__metadata("design:paramtypes", [ItemsService,
|
|
1394
|
-
HoverService,
|
|
1395
|
-
ActionsService,
|
|
1396
|
-
NavigationService,
|
|
1397
|
-
LocalizationService,
|
|
1398
|
-
NgZone,
|
|
1399
|
-
Renderer2,
|
|
1400
|
-
ContextMenuService])
|
|
1401
|
-
], MenuComponent);
|
|
1402
|
-
|
|
1403
|
-
/* tslint:disable:component-selector */
|
|
1404
|
-
/**
|
|
1405
|
-
* @hidden
|
|
1406
|
-
*/
|
|
1407
|
-
let ListComponent = class ListComponent {
|
|
1408
|
-
constructor(itemsService, hover, actions, navigation, renderer, ngZone, element) {
|
|
1409
|
-
this.itemsService = itemsService;
|
|
1410
|
-
this.hover = hover;
|
|
1411
|
-
this.actions = actions;
|
|
1412
|
-
this.navigation = navigation;
|
|
1413
|
-
this.renderer = renderer;
|
|
1414
|
-
this.ngZone = ngZone;
|
|
1415
|
-
this.element = element;
|
|
1416
|
-
this.animate = true;
|
|
1417
|
-
}
|
|
1418
|
-
hierarchyIndex(index) {
|
|
1419
|
-
return this.itemsService.itemIndex(this.index, index);
|
|
1420
|
-
}
|
|
1421
|
-
ngOnInit() {
|
|
1422
|
-
this.itemsService.addList(this);
|
|
1423
|
-
this.initDomEvents();
|
|
1424
|
-
}
|
|
1425
|
-
ngOnDestroy() {
|
|
1426
|
-
this.itemsService.removeList(this);
|
|
1427
|
-
if (this.domSubscriptions) {
|
|
1428
|
-
this.domSubscriptions();
|
|
1237
|
+
ngOnDestroy() {
|
|
1238
|
+
this.itemsService.removeList(this);
|
|
1239
|
+
if (this.domSubscriptions) {
|
|
1240
|
+
this.domSubscriptions();
|
|
1429
1241
|
}
|
|
1430
1242
|
}
|
|
1431
1243
|
initDomEvents() {
|
|
@@ -1553,47 +1365,14 @@ let ListComponent = class ListComponent {
|
|
|
1553
1365
|
}
|
|
1554
1366
|
this.actions.execute();
|
|
1555
1367
|
}
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
], ListComponent.prototype, "level", void 0);
|
|
1565
|
-
__decorate([
|
|
1566
|
-
Input(),
|
|
1567
|
-
__metadata("design:type", String)
|
|
1568
|
-
], ListComponent.prototype, "index", void 0);
|
|
1569
|
-
__decorate([
|
|
1570
|
-
Input(),
|
|
1571
|
-
__metadata("design:type", Object)
|
|
1572
|
-
], ListComponent.prototype, "animate", void 0);
|
|
1573
|
-
__decorate([
|
|
1574
|
-
Input(),
|
|
1575
|
-
__metadata("design:type", Boolean)
|
|
1576
|
-
], ListComponent.prototype, "vertical", void 0);
|
|
1577
|
-
__decorate([
|
|
1578
|
-
Input(),
|
|
1579
|
-
__metadata("design:type", Boolean)
|
|
1580
|
-
], ListComponent.prototype, "rtl", void 0);
|
|
1581
|
-
__decorate([
|
|
1582
|
-
Input(),
|
|
1583
|
-
__metadata("design:type", Object)
|
|
1584
|
-
], ListComponent.prototype, "openOnClick", void 0);
|
|
1585
|
-
__decorate([
|
|
1586
|
-
Input(),
|
|
1587
|
-
__metadata("design:type", TemplateRef)
|
|
1588
|
-
], ListComponent.prototype, "itemTemplate", void 0);
|
|
1589
|
-
__decorate([
|
|
1590
|
-
Input(),
|
|
1591
|
-
__metadata("design:type", TemplateRef)
|
|
1592
|
-
], ListComponent.prototype, "itemLinkTemplate", void 0);
|
|
1593
|
-
ListComponent = __decorate([
|
|
1594
|
-
Component({
|
|
1595
|
-
selector: '[kendoMenuList]',
|
|
1596
|
-
template: `
|
|
1368
|
+
}
|
|
1369
|
+
ListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListComponent, deps: [{ token: ItemsService }, { token: HoverService }, { token: ActionsService }, { token: NavigationService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1370
|
+
ListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListComponent, selector: "[kendoMenuList]", inputs: { items: "items", level: "level", index: "index", animate: "animate", vertical: "vertical", rtl: "rtl", openOnClick: "openOnClick", itemTemplate: "itemTemplate", itemLinkTemplate: "itemLinkTemplate" }, ngImport: i0, template: "\n <ng-container *ngFor=\"let item of items; let idx = index\">\n <li *ngIf=\"!item.separator\" kendoMenuItem\n [item]=\"item\" [level]=\"level\" [vertical]=\"vertical\" [animate]=\"animate\" [rtl]=\"rtl\"\n [itemTemplate]=\"itemTemplate\" [itemLinkTemplate]=\"itemLinkTemplate\" [openOnClick]=\"openOnClick\"\n [index]=\"hierarchyIndex(idx)\" [siblingIndex]=\"idx\" [attr.data-kendo-menu-index]=\"hierarchyIndex(idx)\"\n [ngClass]=\"item.cssClass\" [ngStyle]=\"item.cssStyle\"\n role=\"menuitem\"\n class=\"k-item k-menu-item\"\n [class.k-first]=\"idx === 0\" [class.k-last]=\"idx === items.length - 1\"\n [class.k-state-disabled]=\"item.disabled\"></li>\n <li *ngIf=\"item.separator\" class=\"k-separator k-item\"\n role=\"separator\" [ngClass]=\"item.cssClass\" [ngStyle]=\"item.cssStyle\">\n \n </li>\n </ng-container>\n ", isInline: true, components: [{ type: i0.forwardRef(function () { return ItemComponent; }), selector: "[kendoMenuItem]", inputs: ["item", "level", "index", "siblingIndex", "animate", "vertical", "rtl", "openOnClick", "itemTemplate", "itemLinkTemplate"] }], directives: [{ type: i0.forwardRef(function () { return i5.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i0.forwardRef(function () { return i5.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i0.forwardRef(function () { return i5.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i0.forwardRef(function () { return i5.NgStyle; }), selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListComponent, decorators: [{
|
|
1372
|
+
type: Component,
|
|
1373
|
+
args: [{
|
|
1374
|
+
selector: '[kendoMenuList]',
|
|
1375
|
+
template: `
|
|
1597
1376
|
<ng-container *ngFor="let item of items; let idx = index">
|
|
1598
1377
|
<li *ngIf="!item.separator" kendoMenuItem
|
|
1599
1378
|
[item]="item" [level]="level" [vertical]="vertical" [animate]="animate" [rtl]="rtl"
|
|
@@ -1610,98 +1389,30 @@ ListComponent = __decorate([
|
|
|
1610
1389
|
</li>
|
|
1611
1390
|
</ng-container>
|
|
1612
1391
|
`
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
horizontal: 'fit'
|
|
1634
|
-
};
|
|
1635
|
-
const HORIZONTAL_COLLISION = {
|
|
1636
|
-
vertical: 'fit',
|
|
1637
|
-
horizontal: 'flip'
|
|
1638
|
-
};
|
|
1639
|
-
/**
|
|
1640
|
-
* @hidden
|
|
1641
|
-
*/
|
|
1642
|
-
const POPUP_SETTINGS_RTL = {
|
|
1643
|
-
vertical: {
|
|
1644
|
-
anchor: {
|
|
1645
|
-
vertical: 'bottom',
|
|
1646
|
-
horizontal: 'right'
|
|
1647
|
-
},
|
|
1648
|
-
popup: POPUP_ALIGN_RTL,
|
|
1649
|
-
collision: VERTICAL_COLLISION,
|
|
1650
|
-
animate: 'down'
|
|
1651
|
-
},
|
|
1652
|
-
horizontal: {
|
|
1653
|
-
anchor: {
|
|
1654
|
-
vertical: 'top',
|
|
1655
|
-
horizontal: 'left'
|
|
1656
|
-
},
|
|
1657
|
-
popup: POPUP_ALIGN_RTL,
|
|
1658
|
-
collision: HORIZONTAL_COLLISION,
|
|
1659
|
-
animate: 'left'
|
|
1660
|
-
}
|
|
1661
|
-
};
|
|
1662
|
-
/**
|
|
1663
|
-
* @hidden
|
|
1664
|
-
*/
|
|
1665
|
-
const POPUP_SETTINGS = {
|
|
1666
|
-
vertical: {
|
|
1667
|
-
anchor: {
|
|
1668
|
-
vertical: 'bottom',
|
|
1669
|
-
horizontal: 'left'
|
|
1670
|
-
},
|
|
1671
|
-
popup: POPUP_ALIGN,
|
|
1672
|
-
collision: VERTICAL_COLLISION,
|
|
1673
|
-
animate: 'down'
|
|
1674
|
-
},
|
|
1675
|
-
horizontal: {
|
|
1676
|
-
anchor: {
|
|
1677
|
-
vertical: 'top',
|
|
1678
|
-
horizontal: 'right'
|
|
1679
|
-
},
|
|
1680
|
-
popup: POPUP_ALIGN,
|
|
1681
|
-
collision: HORIZONTAL_COLLISION,
|
|
1682
|
-
animate: 'right'
|
|
1683
|
-
}
|
|
1684
|
-
};
|
|
1685
|
-
|
|
1392
|
+
}]
|
|
1393
|
+
}], ctorParameters: function () { return [{ type: ItemsService }, { type: HoverService }, { type: ActionsService }, { type: NavigationService }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { items: [{
|
|
1394
|
+
type: Input
|
|
1395
|
+
}], level: [{
|
|
1396
|
+
type: Input
|
|
1397
|
+
}], index: [{
|
|
1398
|
+
type: Input
|
|
1399
|
+
}], animate: [{
|
|
1400
|
+
type: Input
|
|
1401
|
+
}], vertical: [{
|
|
1402
|
+
type: Input
|
|
1403
|
+
}], rtl: [{
|
|
1404
|
+
type: Input
|
|
1405
|
+
}], openOnClick: [{
|
|
1406
|
+
type: Input
|
|
1407
|
+
}], itemTemplate: [{
|
|
1408
|
+
type: Input
|
|
1409
|
+
}], itemLinkTemplate: [{
|
|
1410
|
+
type: Input
|
|
1411
|
+
}] } });
|
|
1686
1412
|
/**
|
|
1687
1413
|
* @hidden
|
|
1688
1414
|
*/
|
|
1689
|
-
|
|
1690
|
-
/**
|
|
1691
|
-
* @hidden
|
|
1692
|
-
*/
|
|
1693
|
-
const bodyFactory = () => {
|
|
1694
|
-
if (isDocumentAvailable()) {
|
|
1695
|
-
return new ElementRef(document.body);
|
|
1696
|
-
}
|
|
1697
|
-
};
|
|
1698
|
-
|
|
1699
|
-
const ɵ0$3 = bodyFactory;
|
|
1700
|
-
/* tslint:disable:component-selector */
|
|
1701
|
-
/**
|
|
1702
|
-
* @hidden
|
|
1703
|
-
*/
|
|
1704
|
-
let ItemComponent = class ItemComponent {
|
|
1415
|
+
class ItemComponent {
|
|
1705
1416
|
constructor(itemsService, navigation, changeDetector, renderer, popupService, element) {
|
|
1706
1417
|
this.itemsService = itemsService;
|
|
1707
1418
|
this.navigation = navigation;
|
|
@@ -1810,212 +1521,462 @@ let ItemComponent = class ItemComponent {
|
|
|
1810
1521
|
if (isActive) {
|
|
1811
1522
|
this.setAttribute('tabindex', '0');
|
|
1812
1523
|
}
|
|
1813
|
-
else {
|
|
1814
|
-
this.setAttribute('tabindex', '-1');
|
|
1524
|
+
else {
|
|
1525
|
+
this.setAttribute('tabindex', '-1');
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
open() {
|
|
1529
|
+
if (!this.destroyed && this.hasContent && !this.opened) {
|
|
1530
|
+
const popupSettings = this.popupSettings;
|
|
1531
|
+
const animate = this.animate ? Object.assign({}, this.animate, {
|
|
1532
|
+
direction: popupSettings.animate
|
|
1533
|
+
}) : false;
|
|
1534
|
+
this.opened = true;
|
|
1535
|
+
this.popupRef = this.popupService.open({
|
|
1536
|
+
popupAlign: popupSettings.popup,
|
|
1537
|
+
anchorAlign: popupSettings.anchor,
|
|
1538
|
+
collision: popupSettings.collision,
|
|
1539
|
+
anchor: this.element,
|
|
1540
|
+
positionMode: 'absolute',
|
|
1541
|
+
content: this.popupTemplate,
|
|
1542
|
+
popupClass: {
|
|
1543
|
+
'k-rtl': this.rtl,
|
|
1544
|
+
'k-menu-popup': true
|
|
1545
|
+
},
|
|
1546
|
+
animate: animate
|
|
1547
|
+
});
|
|
1548
|
+
this.setAttribute('aria-expanded', 'true');
|
|
1549
|
+
this.setAttribute('aria-owns', this.childId);
|
|
1550
|
+
this.changeDetector.detectChanges();
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
close() {
|
|
1554
|
+
if (!this.destroyed && this.opened) {
|
|
1555
|
+
this.opened = false;
|
|
1556
|
+
if (this.popupRef) {
|
|
1557
|
+
this.popupRef.close();
|
|
1558
|
+
this.popupRef = null;
|
|
1559
|
+
}
|
|
1560
|
+
this.changeDetector.detectChanges();
|
|
1561
|
+
this.setAttribute('aria-expanded', 'false');
|
|
1562
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-owns');
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
navigate() {
|
|
1566
|
+
let link;
|
|
1567
|
+
if (this.linkTemplate) {
|
|
1568
|
+
link = this.element.nativeElement.querySelector('a.k-menu-link');
|
|
1569
|
+
}
|
|
1570
|
+
else if (this.hasLink) {
|
|
1571
|
+
link = this.link.nativeElement;
|
|
1572
|
+
}
|
|
1573
|
+
if (link) {
|
|
1574
|
+
this.navigating = true;
|
|
1575
|
+
link.click();
|
|
1576
|
+
this.navigating = false;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
setAttribute(name, value) {
|
|
1580
|
+
this.renderer.setAttribute(this.element.nativeElement, name, value);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
ItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemComponent, deps: [{ token: ItemsService }, { token: NavigationService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i6.PopupService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1584
|
+
ItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ItemComponent, selector: "[kendoMenuItem]", inputs: { item: "item", level: "level", index: "index", siblingIndex: "siblingIndex", animate: "animate", vertical: "vertical", rtl: "rtl", openOnClick: "openOnClick", itemTemplate: "itemTemplate", itemLinkTemplate: "itemLinkTemplate" }, host: { properties: { "attr.aria-disabled": "this.disabled", "attr.aria-haspopup": "this.hasPopup", "attr.aria-expanded": "this.expanded", "attr.aria-label": "this.label", "attr.tabindex": "this.activeId" } }, providers: [PopupService, {
|
|
1585
|
+
provide: POPUP_CONTAINER,
|
|
1586
|
+
useFactory: bodyFactory
|
|
1587
|
+
}], viewQueries: [{ propertyName: "link", first: true, predicate: ["link"], descendants: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }], ngImport: i0, template: `
|
|
1588
|
+
<span *ngIf="!hasLink && !item.content && !linkTemplate" class="k-link k-menu-link" #link
|
|
1589
|
+
[class.k-state-active]="opened" role="presentation">
|
|
1590
|
+
<ng-template [ngTemplateOutlet]="itemcontent">
|
|
1591
|
+
</ng-template>
|
|
1592
|
+
</span>
|
|
1593
|
+
<a *ngIf="item.url && !linkTemplate" class="k-link k-menu-link" #link [attr.href]="item.url"
|
|
1594
|
+
[class.k-state-active]="opened" tabindex="-1" role="presentation">
|
|
1595
|
+
<ng-template [ngTemplateOutlet]="itemcontent">
|
|
1596
|
+
</ng-template>
|
|
1597
|
+
</a>
|
|
1598
|
+
<ng-template *ngIf="linkTemplate && !item.content" [ngTemplateOutlet]="linkTemplate"
|
|
1599
|
+
[ngTemplateOutletContext]="{ item: item, index: index }">
|
|
1600
|
+
</ng-template>
|
|
1601
|
+
|
|
1602
|
+
<div class="k-content" *ngIf="item.content" role="presentation">
|
|
1603
|
+
<ng-template [ngTemplateOutlet]="item.content" [ngTemplateOutletContext]="{ item: item.owner, index: item.ownerIndex }">
|
|
1604
|
+
</ng-template>
|
|
1605
|
+
</div>
|
|
1606
|
+
|
|
1607
|
+
<ng-template #popupTemplate>
|
|
1608
|
+
<ul kendoMenuList
|
|
1609
|
+
[attr.id]="childId"
|
|
1610
|
+
[animate]="animate"
|
|
1611
|
+
[rtl]="rtl"
|
|
1612
|
+
[vertical]="vertical"
|
|
1613
|
+
[openOnClick]="openOnClick"
|
|
1614
|
+
[items]="children"
|
|
1615
|
+
[level]="level + 1"
|
|
1616
|
+
[index]="index"
|
|
1617
|
+
[itemTemplate]="itemTemplate"
|
|
1618
|
+
[itemLinkTemplate]="itemLinkTemplate"
|
|
1619
|
+
role="menu"
|
|
1620
|
+
class="k-group k-menu-group k-reset">
|
|
1621
|
+
</ul>
|
|
1622
|
+
</ng-template>
|
|
1623
|
+
|
|
1624
|
+
<ng-template #itemcontent>
|
|
1625
|
+
<span *ngIf="item.icon" class="k-icon" [ngClass]="iconClass" role="presentation"></span>
|
|
1626
|
+
<ng-container *ngIf="!template">
|
|
1627
|
+
<span class="k-menu-link-text">{{ item.text }}</span>
|
|
1628
|
+
</ng-container>
|
|
1629
|
+
<ng-template *ngIf="template" [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item, index: index }">
|
|
1630
|
+
</ng-template>
|
|
1631
|
+
<span class="k-icon k-menu-expand-arrow" *ngIf="hasContent"
|
|
1632
|
+
role="presentation"
|
|
1633
|
+
[class.k-i-arrow-60-down]="!horizontal"
|
|
1634
|
+
[class.k-i-arrow-60-right]="horizontal && !rtl"
|
|
1635
|
+
[class.k-i-arrow-60-left]="horizontal && rtl">
|
|
1636
|
+
</span>
|
|
1637
|
+
</ng-template>
|
|
1638
|
+
`, isInline: true, components: [{ type: ListComponent, selector: "[kendoMenuList]", inputs: ["items", "level", "index", "animate", "vertical", "rtl", "openOnClick", "itemTemplate", "itemLinkTemplate"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1639
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemComponent, decorators: [{
|
|
1640
|
+
type: Component,
|
|
1641
|
+
args: [{
|
|
1642
|
+
providers: [PopupService, {
|
|
1643
|
+
provide: POPUP_CONTAINER,
|
|
1644
|
+
useFactory: bodyFactory
|
|
1645
|
+
}],
|
|
1646
|
+
selector: '[kendoMenuItem]',
|
|
1647
|
+
template: `
|
|
1648
|
+
<span *ngIf="!hasLink && !item.content && !linkTemplate" class="k-link k-menu-link" #link
|
|
1649
|
+
[class.k-state-active]="opened" role="presentation">
|
|
1650
|
+
<ng-template [ngTemplateOutlet]="itemcontent">
|
|
1651
|
+
</ng-template>
|
|
1652
|
+
</span>
|
|
1653
|
+
<a *ngIf="item.url && !linkTemplate" class="k-link k-menu-link" #link [attr.href]="item.url"
|
|
1654
|
+
[class.k-state-active]="opened" tabindex="-1" role="presentation">
|
|
1655
|
+
<ng-template [ngTemplateOutlet]="itemcontent">
|
|
1656
|
+
</ng-template>
|
|
1657
|
+
</a>
|
|
1658
|
+
<ng-template *ngIf="linkTemplate && !item.content" [ngTemplateOutlet]="linkTemplate"
|
|
1659
|
+
[ngTemplateOutletContext]="{ item: item, index: index }">
|
|
1660
|
+
</ng-template>
|
|
1661
|
+
|
|
1662
|
+
<div class="k-content" *ngIf="item.content" role="presentation">
|
|
1663
|
+
<ng-template [ngTemplateOutlet]="item.content" [ngTemplateOutletContext]="{ item: item.owner, index: item.ownerIndex }">
|
|
1664
|
+
</ng-template>
|
|
1665
|
+
</div>
|
|
1666
|
+
|
|
1667
|
+
<ng-template #popupTemplate>
|
|
1668
|
+
<ul kendoMenuList
|
|
1669
|
+
[attr.id]="childId"
|
|
1670
|
+
[animate]="animate"
|
|
1671
|
+
[rtl]="rtl"
|
|
1672
|
+
[vertical]="vertical"
|
|
1673
|
+
[openOnClick]="openOnClick"
|
|
1674
|
+
[items]="children"
|
|
1675
|
+
[level]="level + 1"
|
|
1676
|
+
[index]="index"
|
|
1677
|
+
[itemTemplate]="itemTemplate"
|
|
1678
|
+
[itemLinkTemplate]="itemLinkTemplate"
|
|
1679
|
+
role="menu"
|
|
1680
|
+
class="k-group k-menu-group k-reset">
|
|
1681
|
+
</ul>
|
|
1682
|
+
</ng-template>
|
|
1683
|
+
|
|
1684
|
+
<ng-template #itemcontent>
|
|
1685
|
+
<span *ngIf="item.icon" class="k-icon" [ngClass]="iconClass" role="presentation"></span>
|
|
1686
|
+
<ng-container *ngIf="!template">
|
|
1687
|
+
<span class="k-menu-link-text">{{ item.text }}</span>
|
|
1688
|
+
</ng-container>
|
|
1689
|
+
<ng-template *ngIf="template" [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item, index: index }">
|
|
1690
|
+
</ng-template>
|
|
1691
|
+
<span class="k-icon k-menu-expand-arrow" *ngIf="hasContent"
|
|
1692
|
+
role="presentation"
|
|
1693
|
+
[class.k-i-arrow-60-down]="!horizontal"
|
|
1694
|
+
[class.k-i-arrow-60-right]="horizontal && !rtl"
|
|
1695
|
+
[class.k-i-arrow-60-left]="horizontal && rtl">
|
|
1696
|
+
</span>
|
|
1697
|
+
</ng-template>
|
|
1698
|
+
`
|
|
1699
|
+
}]
|
|
1700
|
+
}], ctorParameters: function () { return [{ type: ItemsService }, { type: NavigationService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i6.PopupService }, { type: i0.ElementRef }]; }, propDecorators: { item: [{
|
|
1701
|
+
type: Input
|
|
1702
|
+
}], level: [{
|
|
1703
|
+
type: Input
|
|
1704
|
+
}], index: [{
|
|
1705
|
+
type: Input
|
|
1706
|
+
}], siblingIndex: [{
|
|
1707
|
+
type: Input
|
|
1708
|
+
}], animate: [{
|
|
1709
|
+
type: Input
|
|
1710
|
+
}], vertical: [{
|
|
1711
|
+
type: Input
|
|
1712
|
+
}], rtl: [{
|
|
1713
|
+
type: Input
|
|
1714
|
+
}], openOnClick: [{
|
|
1715
|
+
type: Input
|
|
1716
|
+
}], itemTemplate: [{
|
|
1717
|
+
type: Input
|
|
1718
|
+
}], itemLinkTemplate: [{
|
|
1719
|
+
type: Input
|
|
1720
|
+
}], link: [{
|
|
1721
|
+
type: ViewChild,
|
|
1722
|
+
args: ['link', { static: false }]
|
|
1723
|
+
}], popupTemplate: [{
|
|
1724
|
+
type: ViewChild,
|
|
1725
|
+
args: ['popupTemplate', { static: true }]
|
|
1726
|
+
}], disabled: [{
|
|
1727
|
+
type: HostBinding,
|
|
1728
|
+
args: ['attr.aria-disabled']
|
|
1729
|
+
}], hasPopup: [{
|
|
1730
|
+
type: HostBinding,
|
|
1731
|
+
args: ['attr.aria-haspopup']
|
|
1732
|
+
}], expanded: [{
|
|
1733
|
+
type: HostBinding,
|
|
1734
|
+
args: ['attr.aria-expanded']
|
|
1735
|
+
}], label: [{
|
|
1736
|
+
type: HostBinding,
|
|
1737
|
+
args: ['attr.aria-label']
|
|
1738
|
+
}], activeId: [{
|
|
1739
|
+
type: HostBinding,
|
|
1740
|
+
args: ['attr.tabindex']
|
|
1741
|
+
}] } });
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* Represents the [Kendo UI Menu component for Angular]({% slug overview_menu %}).
|
|
1745
|
+
*
|
|
1746
|
+
* @example
|
|
1747
|
+
* ```ts
|
|
1748
|
+
* _@Component({
|
|
1749
|
+
* selector: 'my-app',
|
|
1750
|
+
* template: `
|
|
1751
|
+
* <kendo-menu [items]="items">
|
|
1752
|
+
* </kendo-menu>
|
|
1753
|
+
* `
|
|
1754
|
+
* })
|
|
1755
|
+
* class AppComponent {
|
|
1756
|
+
* public items: any[] = [{ text: 'item1', items: [{ text: 'item1.1' }] }, { text: 'item2', disabled: true }];
|
|
1757
|
+
* }
|
|
1758
|
+
* ```
|
|
1759
|
+
*/
|
|
1760
|
+
class MenuComponent extends MenuBase {
|
|
1761
|
+
constructor(itemsService, hover, actions, navigation, localization, ngZone, renderer, contextService) {
|
|
1762
|
+
super();
|
|
1763
|
+
this.itemsService = itemsService;
|
|
1764
|
+
this.hover = hover;
|
|
1765
|
+
this.actions = actions;
|
|
1766
|
+
this.navigation = navigation;
|
|
1767
|
+
this.localization = localization;
|
|
1768
|
+
this.ngZone = ngZone;
|
|
1769
|
+
this.renderer = renderer;
|
|
1770
|
+
this.contextService = contextService;
|
|
1771
|
+
/**
|
|
1772
|
+
* Fires when a Menu item is selected ([see example]({% slug routing_menu %})).
|
|
1773
|
+
*/
|
|
1774
|
+
this.select = new EventEmitter();
|
|
1775
|
+
/**
|
|
1776
|
+
* Fires when a Menu item is opened.
|
|
1777
|
+
*/
|
|
1778
|
+
this.open = new EventEmitter();
|
|
1779
|
+
/**
|
|
1780
|
+
* Fires when a Menu item is closed.
|
|
1781
|
+
*/
|
|
1782
|
+
this.close = new EventEmitter();
|
|
1783
|
+
validatePackage(packageMetadata);
|
|
1784
|
+
this.actions.owner = this;
|
|
1785
|
+
if (contextService) {
|
|
1786
|
+
contextService.items = this.itemsService;
|
|
1787
|
+
this.contextKeyDownSubscription = contextService.keydown.subscribe(this.contextKeyDown.bind(this));
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* @hidden
|
|
1792
|
+
*/
|
|
1793
|
+
get ariaOrientation() {
|
|
1794
|
+
if (this.vertical) {
|
|
1795
|
+
return 'vertical';
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* @hidden
|
|
1800
|
+
*/
|
|
1801
|
+
get contextMenuClass() {
|
|
1802
|
+
return Boolean(this.contextService);
|
|
1803
|
+
}
|
|
1804
|
+
get direction() {
|
|
1805
|
+
return this.rtl;
|
|
1806
|
+
}
|
|
1807
|
+
get rtl() {
|
|
1808
|
+
return this.localization.rtl;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Opens or closes the specified Menu items.
|
|
1812
|
+
*
|
|
1813
|
+
* @param open - A Boolean value which indicates if the items will be opened or closed.
|
|
1814
|
+
* @param indices - One or more values which represent the hierarchical indices of the items that will be opened or closed.
|
|
1815
|
+
*/
|
|
1816
|
+
toggle(open, ...indices) {
|
|
1817
|
+
for (let idx = 0; idx < indices.length; idx++) {
|
|
1818
|
+
const item = this.itemsService.get(indices[idx]);
|
|
1819
|
+
if (item && !item.disabled) {
|
|
1820
|
+
if (open) {
|
|
1821
|
+
item.open();
|
|
1822
|
+
}
|
|
1823
|
+
else {
|
|
1824
|
+
item.close();
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* @hidden
|
|
1831
|
+
*/
|
|
1832
|
+
focus(index) {
|
|
1833
|
+
this.navigation.focusIndex(index);
|
|
1834
|
+
}
|
|
1835
|
+
ngOnChanges(changes) {
|
|
1836
|
+
this.navigation.vertical = this.vertical;
|
|
1837
|
+
this.hover.delay = this.hoverDelay;
|
|
1838
|
+
if (changes.openOnClick) {
|
|
1839
|
+
const openOnClick = this.openOnClick = normalize(this.openOnClick);
|
|
1840
|
+
this.hover.openOnOver = !openOnClick;
|
|
1841
|
+
if (openOnClick && openOnClick.toggle === 'click') {
|
|
1842
|
+
this.attachCloseClick();
|
|
1843
|
+
}
|
|
1844
|
+
else {
|
|
1845
|
+
this.unsubscribeClick();
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
ngAfterViewChecked() {
|
|
1850
|
+
this.navigation.updateActive();
|
|
1851
|
+
}
|
|
1852
|
+
ngOnDestroy() {
|
|
1853
|
+
this.unsubscribeClick();
|
|
1854
|
+
if (this.contextService) {
|
|
1855
|
+
this.contextService.items = null;
|
|
1856
|
+
this.contextKeyDownSubscription.unsubscribe();
|
|
1815
1857
|
}
|
|
1816
1858
|
}
|
|
1817
|
-
|
|
1818
|
-
if (!this.
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
collision: popupSettings.collision,
|
|
1828
|
-
anchor: this.element,
|
|
1829
|
-
positionMode: 'absolute',
|
|
1830
|
-
content: this.popupTemplate,
|
|
1831
|
-
popupClass: {
|
|
1832
|
-
'k-rtl': this.rtl,
|
|
1833
|
-
'k-menu-popup': true
|
|
1834
|
-
},
|
|
1835
|
-
animate: animate
|
|
1859
|
+
attachCloseClick() {
|
|
1860
|
+
if (!this.closeClickSubscription && isDocumentAvailable()) {
|
|
1861
|
+
this.ngZone.runOutsideAngular(() => {
|
|
1862
|
+
this.closeClickSubscription = this.renderer.listen('document', 'click', (e) => {
|
|
1863
|
+
if (!inMenu(e.target, this.itemsService)) {
|
|
1864
|
+
this.hover.openOnOver = false;
|
|
1865
|
+
this.actions.closeAll();
|
|
1866
|
+
this.actions.execute();
|
|
1867
|
+
}
|
|
1868
|
+
});
|
|
1836
1869
|
});
|
|
1837
|
-
this.setAttribute('aria-expanded', 'true');
|
|
1838
|
-
this.setAttribute('aria-owns', this.childId);
|
|
1839
|
-
this.changeDetector.detectChanges();
|
|
1840
1870
|
}
|
|
1841
1871
|
}
|
|
1842
|
-
|
|
1843
|
-
if (
|
|
1844
|
-
this.
|
|
1845
|
-
if (this.popupRef) {
|
|
1846
|
-
this.popupRef.close();
|
|
1847
|
-
this.popupRef = null;
|
|
1848
|
-
}
|
|
1849
|
-
this.changeDetector.detectChanges();
|
|
1850
|
-
this.setAttribute('aria-expanded', 'false');
|
|
1851
|
-
this.renderer.removeAttribute(this.element.nativeElement, 'aria-owns');
|
|
1872
|
+
unsubscribeClick() {
|
|
1873
|
+
if (this.closeClickSubscription) {
|
|
1874
|
+
this.closeClickSubscription();
|
|
1852
1875
|
}
|
|
1853
1876
|
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
link = this.element.nativeElement.querySelector('a.k-menu-link');
|
|
1877
|
+
contextKeyDown(e) {
|
|
1878
|
+
if (!this.itemsService.hasItems) {
|
|
1879
|
+
return;
|
|
1858
1880
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1881
|
+
const keyCode = e.keyCode;
|
|
1882
|
+
const rtl = this.localization.rtl;
|
|
1883
|
+
const first = keyCode === Keys.ArrowDown || keyCode === Keys.ArrowRight;
|
|
1884
|
+
const last = keyCode === Keys.ArrowUp || keyCode === Keys.ArrowLeft;
|
|
1885
|
+
let index;
|
|
1886
|
+
if ((first && !rtl) || (last && rtl)) {
|
|
1887
|
+
index = 'first';
|
|
1861
1888
|
}
|
|
1862
|
-
if (
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1889
|
+
else if ((first && rtl) || (last && !rtl)) {
|
|
1890
|
+
index = 'last';
|
|
1891
|
+
}
|
|
1892
|
+
if (index) {
|
|
1893
|
+
e.preventDefault();
|
|
1894
|
+
this.focus(index);
|
|
1866
1895
|
}
|
|
1867
1896
|
}
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
Input(),
|
|
1874
|
-
__metadata("design:type", Object)
|
|
1875
|
-
], ItemComponent.prototype, "item", void 0);
|
|
1876
|
-
__decorate([
|
|
1877
|
-
Input(),
|
|
1878
|
-
__metadata("design:type", Number)
|
|
1879
|
-
], ItemComponent.prototype, "level", void 0);
|
|
1880
|
-
__decorate([
|
|
1881
|
-
Input(),
|
|
1882
|
-
__metadata("design:type", String),
|
|
1883
|
-
__metadata("design:paramtypes", [String])
|
|
1884
|
-
], ItemComponent.prototype, "index", null);
|
|
1885
|
-
__decorate([
|
|
1886
|
-
Input(),
|
|
1887
|
-
__metadata("design:type", Number)
|
|
1888
|
-
], ItemComponent.prototype, "siblingIndex", void 0);
|
|
1889
|
-
__decorate([
|
|
1890
|
-
Input(),
|
|
1891
|
-
__metadata("design:type", Object)
|
|
1892
|
-
], ItemComponent.prototype, "animate", void 0);
|
|
1893
|
-
__decorate([
|
|
1894
|
-
Input(),
|
|
1895
|
-
__metadata("design:type", Boolean)
|
|
1896
|
-
], ItemComponent.prototype, "vertical", void 0);
|
|
1897
|
-
__decorate([
|
|
1898
|
-
Input(),
|
|
1899
|
-
__metadata("design:type", Boolean)
|
|
1900
|
-
], ItemComponent.prototype, "rtl", void 0);
|
|
1901
|
-
__decorate([
|
|
1902
|
-
Input(),
|
|
1903
|
-
__metadata("design:type", Boolean)
|
|
1904
|
-
], ItemComponent.prototype, "openOnClick", void 0);
|
|
1905
|
-
__decorate([
|
|
1906
|
-
Input(),
|
|
1907
|
-
__metadata("design:type", TemplateRef)
|
|
1908
|
-
], ItemComponent.prototype, "itemTemplate", void 0);
|
|
1909
|
-
__decorate([
|
|
1910
|
-
Input(),
|
|
1911
|
-
__metadata("design:type", TemplateRef)
|
|
1912
|
-
], ItemComponent.prototype, "itemLinkTemplate", void 0);
|
|
1913
|
-
__decorate([
|
|
1914
|
-
ViewChild('link', { static: false }),
|
|
1915
|
-
__metadata("design:type", ElementRef)
|
|
1916
|
-
], ItemComponent.prototype, "link", void 0);
|
|
1917
|
-
__decorate([
|
|
1918
|
-
ViewChild('popupTemplate', { static: true }),
|
|
1919
|
-
__metadata("design:type", TemplateRef)
|
|
1920
|
-
], ItemComponent.prototype, "popupTemplate", void 0);
|
|
1921
|
-
__decorate([
|
|
1922
|
-
HostBinding('attr.aria-disabled'),
|
|
1923
|
-
__metadata("design:type", Boolean),
|
|
1924
|
-
__metadata("design:paramtypes", [])
|
|
1925
|
-
], ItemComponent.prototype, "disabled", null);
|
|
1926
|
-
__decorate([
|
|
1927
|
-
HostBinding('attr.aria-haspopup'),
|
|
1928
|
-
__metadata("design:type", Boolean),
|
|
1929
|
-
__metadata("design:paramtypes", [])
|
|
1930
|
-
], ItemComponent.prototype, "hasPopup", null);
|
|
1931
|
-
__decorate([
|
|
1932
|
-
HostBinding('attr.aria-expanded'),
|
|
1933
|
-
__metadata("design:type", Boolean),
|
|
1934
|
-
__metadata("design:paramtypes", [])
|
|
1935
|
-
], ItemComponent.prototype, "expanded", null);
|
|
1936
|
-
__decorate([
|
|
1937
|
-
HostBinding('attr.aria-label'),
|
|
1938
|
-
__metadata("design:type", Boolean),
|
|
1939
|
-
__metadata("design:paramtypes", [])
|
|
1940
|
-
], ItemComponent.prototype, "label", null);
|
|
1941
|
-
__decorate([
|
|
1942
|
-
HostBinding('attr.tabindex'),
|
|
1943
|
-
__metadata("design:type", String),
|
|
1944
|
-
__metadata("design:paramtypes", [])
|
|
1945
|
-
], ItemComponent.prototype, "activeId", null);
|
|
1946
|
-
ItemComponent = __decorate([
|
|
1947
|
-
Component({
|
|
1948
|
-
providers: [PopupService, {
|
|
1949
|
-
provide: POPUP_CONTAINER,
|
|
1950
|
-
useFactory: ɵ0$3
|
|
1951
|
-
}],
|
|
1952
|
-
selector: '[kendoMenuItem]',
|
|
1953
|
-
template: `
|
|
1954
|
-
<span *ngIf="!hasLink && !item.content && !linkTemplate" class="k-link k-menu-link" #link
|
|
1955
|
-
[class.k-state-active]="opened" role="presentation">
|
|
1956
|
-
<ng-template [ngTemplateOutlet]="itemcontent">
|
|
1957
|
-
</ng-template>
|
|
1958
|
-
</span>
|
|
1959
|
-
<a *ngIf="item.url && !linkTemplate" class="k-link k-menu-link" #link [attr.href]="item.url"
|
|
1960
|
-
[class.k-state-active]="opened" tabindex="-1" role="presentation">
|
|
1961
|
-
<ng-template [ngTemplateOutlet]="itemcontent">
|
|
1962
|
-
</ng-template>
|
|
1963
|
-
</a>
|
|
1964
|
-
<ng-template *ngIf="linkTemplate && !item.content" [ngTemplateOutlet]="linkTemplate"
|
|
1965
|
-
[ngTemplateOutletContext]="{ item: item, index: index }">
|
|
1966
|
-
</ng-template>
|
|
1967
|
-
|
|
1968
|
-
<div class="k-content" *ngIf="item.content" role="presentation">
|
|
1969
|
-
<ng-template [ngTemplateOutlet]="item.content" [ngTemplateOutletContext]="{ item: item.owner, index: item.ownerIndex }">
|
|
1970
|
-
</ng-template>
|
|
1971
|
-
</div>
|
|
1972
|
-
|
|
1973
|
-
<ng-template #popupTemplate>
|
|
1974
|
-
<ul kendoMenuList
|
|
1975
|
-
[attr.id]="childId"
|
|
1976
|
-
[animate]="animate"
|
|
1977
|
-
[rtl]="rtl"
|
|
1978
|
-
[vertical]="vertical"
|
|
1979
|
-
[openOnClick]="openOnClick"
|
|
1980
|
-
[items]="children"
|
|
1981
|
-
[level]="level + 1"
|
|
1982
|
-
[index]="index"
|
|
1983
|
-
[itemTemplate]="itemTemplate"
|
|
1984
|
-
[itemLinkTemplate]="itemLinkTemplate"
|
|
1985
|
-
role="menu"
|
|
1986
|
-
class="k-group k-menu-group k-reset">
|
|
1987
|
-
</ul>
|
|
1988
|
-
</ng-template>
|
|
1989
|
-
|
|
1990
|
-
<ng-template #itemcontent>
|
|
1991
|
-
<span *ngIf="item.icon" class="k-icon" [ngClass]="iconClass" role="presentation"></span>
|
|
1992
|
-
<ng-container *ngIf="!template">
|
|
1993
|
-
<span class="k-menu-link-text">{{ item.text }}</span>
|
|
1994
|
-
</ng-container>
|
|
1995
|
-
<ng-template *ngIf="template" [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item, index: index }">
|
|
1996
|
-
</ng-template>
|
|
1997
|
-
<span class="k-icon k-menu-expand-arrow" *ngIf="hasContent"
|
|
1998
|
-
role="presentation"
|
|
1999
|
-
[class.k-i-arrow-60-down]="!horizontal"
|
|
2000
|
-
[class.k-i-arrow-60-right]="horizontal && !rtl"
|
|
2001
|
-
[class.k-i-arrow-60-left]="horizontal && rtl">
|
|
2002
|
-
</span>
|
|
2003
|
-
</ng-template>
|
|
2004
|
-
`
|
|
2005
|
-
}),
|
|
2006
|
-
__metadata("design:paramtypes", [ItemsService,
|
|
1897
|
+
}
|
|
1898
|
+
MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuComponent, deps: [{ token: ItemsService }, { token: HoverService }, { token: ActionsService }, { token: NavigationService }, { token: i3.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: ContextMenuService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1899
|
+
MenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MenuComponent, selector: "kendo-menu", inputs: { menuItemTemplate: "menuItemTemplate", menuItemLinkTemplate: "menuItemLinkTemplate" }, outputs: { select: "select", open: "open", close: "close" }, host: { properties: { "class.k-rtl": "this.direction" } }, providers: [
|
|
1900
|
+
ItemsService,
|
|
1901
|
+
ActionsService,
|
|
2007
1902
|
NavigationService,
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
1903
|
+
HoverService,
|
|
1904
|
+
LocalizationService,
|
|
1905
|
+
{
|
|
1906
|
+
provide: L10N_PREFIX,
|
|
1907
|
+
useValue: 'kendo.menu'
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
provide: MenuBase,
|
|
1911
|
+
useExisting: forwardRef(() => MenuComponent)
|
|
1912
|
+
}
|
|
1913
|
+
], exportAs: ["kendoMenu"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
1914
|
+
<ul role="menubar"
|
|
1915
|
+
[attr.aria-orientation]="ariaOrientation"
|
|
1916
|
+
kendoMenuList [items]="rootItems" [level]="0" class="k-widget k-reset k-header k-menu"
|
|
1917
|
+
[vertical]="vertical" [rtl]="rtl" [animate]="animate" [openOnClick]="openOnClick"
|
|
1918
|
+
[itemTemplate]="itemTemplate.first?.templateRef || menuItemTemplate"
|
|
1919
|
+
[itemLinkTemplate]="itemLinkTemplate.first?.templateRef || menuItemLinkTemplate"
|
|
1920
|
+
[class.k-menu-horizontal]="!vertical"
|
|
1921
|
+
[class.k-menu-vertical]="vertical"
|
|
1922
|
+
[class.k-context-menu]="contextMenuClass">
|
|
1923
|
+
</ul>
|
|
1924
|
+
`, isInline: true, components: [{ type: ListComponent, selector: "[kendoMenuList]", inputs: ["items", "level", "index", "animate", "vertical", "rtl", "openOnClick", "itemTemplate", "itemLinkTemplate"] }] });
|
|
1925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuComponent, decorators: [{
|
|
1926
|
+
type: Component,
|
|
1927
|
+
args: [{
|
|
1928
|
+
exportAs: 'kendoMenu',
|
|
1929
|
+
providers: [
|
|
1930
|
+
ItemsService,
|
|
1931
|
+
ActionsService,
|
|
1932
|
+
NavigationService,
|
|
1933
|
+
HoverService,
|
|
1934
|
+
LocalizationService,
|
|
1935
|
+
{
|
|
1936
|
+
provide: L10N_PREFIX,
|
|
1937
|
+
useValue: 'kendo.menu'
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
provide: MenuBase,
|
|
1941
|
+
useExisting: forwardRef(() => MenuComponent)
|
|
1942
|
+
}
|
|
1943
|
+
],
|
|
1944
|
+
selector: 'kendo-menu',
|
|
1945
|
+
template: `
|
|
1946
|
+
<ul role="menubar"
|
|
1947
|
+
[attr.aria-orientation]="ariaOrientation"
|
|
1948
|
+
kendoMenuList [items]="rootItems" [level]="0" class="k-widget k-reset k-header k-menu"
|
|
1949
|
+
[vertical]="vertical" [rtl]="rtl" [animate]="animate" [openOnClick]="openOnClick"
|
|
1950
|
+
[itemTemplate]="itemTemplate.first?.templateRef || menuItemTemplate"
|
|
1951
|
+
[itemLinkTemplate]="itemLinkTemplate.first?.templateRef || menuItemLinkTemplate"
|
|
1952
|
+
[class.k-menu-horizontal]="!vertical"
|
|
1953
|
+
[class.k-menu-vertical]="vertical"
|
|
1954
|
+
[class.k-context-menu]="contextMenuClass">
|
|
1955
|
+
</ul>
|
|
1956
|
+
`
|
|
1957
|
+
}]
|
|
1958
|
+
}], ctorParameters: function () { return [{ type: ItemsService }, { type: HoverService }, { type: ActionsService }, { type: NavigationService }, { type: i3.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: ContextMenuService, decorators: [{
|
|
1959
|
+
type: Optional
|
|
1960
|
+
}] }]; }, propDecorators: { menuItemTemplate: [{
|
|
1961
|
+
type: Input
|
|
1962
|
+
}], menuItemLinkTemplate: [{
|
|
1963
|
+
type: Input
|
|
1964
|
+
}], select: [{
|
|
1965
|
+
type: Output
|
|
1966
|
+
}], open: [{
|
|
1967
|
+
type: Output
|
|
1968
|
+
}], close: [{
|
|
1969
|
+
type: Output
|
|
1970
|
+
}], direction: [{
|
|
1971
|
+
type: HostBinding,
|
|
1972
|
+
args: ['class.k-rtl']
|
|
1973
|
+
}] } });
|
|
2013
1974
|
|
|
2014
1975
|
/**
|
|
2015
1976
|
* Represents a directive that can be used in the [`linkTemplate`]({% slug api_menu_itemlinktemplatedirective %})
|
|
2016
1977
|
* of the items to apply the default styling and behavior.
|
|
2017
1978
|
*/
|
|
2018
|
-
|
|
1979
|
+
class LinkDirective {
|
|
2019
1980
|
constructor(itemsService) {
|
|
2020
1981
|
this.itemsService = itemsService;
|
|
2021
1982
|
this.hostClasses = true;
|
|
@@ -2031,41 +1992,39 @@ let LinkDirective = class LinkDirective {
|
|
|
2031
1992
|
}
|
|
2032
1993
|
this.item = this.itemsService.get(this.index) || {};
|
|
2033
1994
|
}
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
],
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
__metadata("design:paramtypes", [ItemsService])
|
|
2062
|
-
], LinkDirective);
|
|
1995
|
+
}
|
|
1996
|
+
LinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LinkDirective, deps: [{ token: ItemsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1997
|
+
LinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: LinkDirective, selector: "[kendoMenuItemLink]", inputs: { index: ["kendoMenuItemLink", "index"] }, host: { properties: { "class.k-link": "this.hostClasses", "class.k-menu-link": "this.hostClasses", "attr.role": "this.role", "attr.tabindex": "this.tabindex", "class.k-state-active": "this.activeClass" } }, ngImport: i0 });
|
|
1998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LinkDirective, decorators: [{
|
|
1999
|
+
type: Directive,
|
|
2000
|
+
args: [{
|
|
2001
|
+
selector: '[kendoMenuItemLink]'
|
|
2002
|
+
}]
|
|
2003
|
+
}], ctorParameters: function () { return [{ type: ItemsService }]; }, propDecorators: { index: [{
|
|
2004
|
+
type: Input,
|
|
2005
|
+
args: ['kendoMenuItemLink']
|
|
2006
|
+
}], hostClasses: [{
|
|
2007
|
+
type: HostBinding,
|
|
2008
|
+
args: ['class.k-link']
|
|
2009
|
+
}, {
|
|
2010
|
+
type: HostBinding,
|
|
2011
|
+
args: ['class.k-menu-link']
|
|
2012
|
+
}], role: [{
|
|
2013
|
+
type: HostBinding,
|
|
2014
|
+
args: ['attr.role']
|
|
2015
|
+
}], tabindex: [{
|
|
2016
|
+
type: HostBinding,
|
|
2017
|
+
args: ['attr.tabindex']
|
|
2018
|
+
}], activeClass: [{
|
|
2019
|
+
type: HostBinding,
|
|
2020
|
+
args: ['class.k-state-active']
|
|
2021
|
+
}] } });
|
|
2063
2022
|
|
|
2064
2023
|
/**
|
|
2065
2024
|
* Represents a directive that can be used in the [`linkTemplate`]({% slug api_menu_itemlinktemplatedirective %})
|
|
2066
2025
|
* of the items to render the default expand arrow.
|
|
2067
2026
|
*/
|
|
2068
|
-
|
|
2027
|
+
class ExpandArrowDirective {
|
|
2069
2028
|
constructor(itemsService) {
|
|
2070
2029
|
this.itemsService = itemsService;
|
|
2071
2030
|
this.hostClasses = true;
|
|
@@ -2086,41 +2045,73 @@ let ExpandArrowDirective = class ExpandArrowDirective {
|
|
|
2086
2045
|
}
|
|
2087
2046
|
this.item = this.itemsService.get(this.index) || {};
|
|
2088
2047
|
}
|
|
2089
|
-
}
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
],
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2048
|
+
}
|
|
2049
|
+
ExpandArrowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ExpandArrowDirective, deps: [{ token: ItemsService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2050
|
+
ExpandArrowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ExpandArrowDirective, selector: "[kendoMenuExpandArrow]", inputs: { index: ["kendoMenuExpandArrow", "index"] }, host: { properties: { "class.k-icon": "this.hostClasses", "class.k-menu-expand-arrow": "this.hostClasses", "attr.role": "this.role", "class.k-i-arrow-60-down": "this.arrowDown", "class.k-i-arrow-60-right": "this.arrowRight", "class.k-i-arrow-60-left": "this.arrowLeft" } }, ngImport: i0 });
|
|
2051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ExpandArrowDirective, decorators: [{
|
|
2052
|
+
type: Directive,
|
|
2053
|
+
args: [{
|
|
2054
|
+
selector: '[kendoMenuExpandArrow]'
|
|
2055
|
+
}]
|
|
2056
|
+
}], ctorParameters: function () { return [{ type: ItemsService }]; }, propDecorators: { index: [{
|
|
2057
|
+
type: Input,
|
|
2058
|
+
args: ['kendoMenuExpandArrow']
|
|
2059
|
+
}], hostClasses: [{
|
|
2060
|
+
type: HostBinding,
|
|
2061
|
+
args: ['class.k-icon']
|
|
2062
|
+
}, {
|
|
2063
|
+
type: HostBinding,
|
|
2064
|
+
args: ['class.k-menu-expand-arrow']
|
|
2065
|
+
}], role: [{
|
|
2066
|
+
type: HostBinding,
|
|
2067
|
+
args: ['attr.role']
|
|
2068
|
+
}], arrowDown: [{
|
|
2069
|
+
type: HostBinding,
|
|
2070
|
+
args: ['class.k-i-arrow-60-down']
|
|
2071
|
+
}], arrowRight: [{
|
|
2072
|
+
type: HostBinding,
|
|
2073
|
+
args: ['class.k-i-arrow-60-right']
|
|
2074
|
+
}], arrowLeft: [{
|
|
2075
|
+
type: HostBinding,
|
|
2076
|
+
args: ['class.k-i-arrow-60-left']
|
|
2077
|
+
}] } });
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* @hidden
|
|
2081
|
+
*/
|
|
2082
|
+
class PreventableEvent {
|
|
2083
|
+
/**
|
|
2084
|
+
* @hidden
|
|
2085
|
+
*/
|
|
2086
|
+
constructor(args) {
|
|
2087
|
+
this.prevented = false;
|
|
2088
|
+
Object.assign(this, args);
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Prevents the default action for a specified event.
|
|
2092
|
+
* In this way, the source component suppresses
|
|
2093
|
+
* the built-in behavior that follows the event.
|
|
2094
|
+
*/
|
|
2095
|
+
preventDefault() {
|
|
2096
|
+
this.prevented = true;
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Returns `true` if the event was prevented
|
|
2100
|
+
* by any of its subscribers.
|
|
2101
|
+
*
|
|
2102
|
+
* @returns `true` if the default action was prevented.
|
|
2103
|
+
* Otherwise, returns `false`.
|
|
2104
|
+
*/
|
|
2105
|
+
isDefaultPrevented() {
|
|
2106
|
+
return this.prevented;
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Arguments for the `open` and `close` events of the Menu.
|
|
2112
|
+
*/
|
|
2113
|
+
class MenuEvent extends PreventableEvent {
|
|
2114
|
+
}
|
|
2124
2115
|
|
|
2125
2116
|
/**
|
|
2126
2117
|
* Arguments for the `select` event of the Menu.
|
|
@@ -2154,10 +2145,17 @@ class BindingDirectiveBase {
|
|
|
2154
2145
|
this.menu.items = this.data ? this.mapItems(this.data) : [];
|
|
2155
2146
|
}
|
|
2156
2147
|
}
|
|
2148
|
+
BindingDirectiveBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BindingDirectiveBase, deps: [{ token: MenuBase }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2149
|
+
BindingDirectiveBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: BindingDirectiveBase, selector: "kendoBindingBase", usesOnChanges: true, ngImport: i0 });
|
|
2150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BindingDirectiveBase, decorators: [{
|
|
2151
|
+
type: Directive,
|
|
2152
|
+
args: [{
|
|
2153
|
+
selector: 'kendoBindingBase'
|
|
2154
|
+
}]
|
|
2155
|
+
}], ctorParameters: function () { return [{ type: MenuBase }]; } });
|
|
2157
2156
|
|
|
2158
2157
|
const FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
|
|
2159
2158
|
const getterCache = {};
|
|
2160
|
-
// tslint:disable-next-line:no-string-literal
|
|
2161
2159
|
getterCache['undefined'] = (obj) => obj;
|
|
2162
2160
|
/**
|
|
2163
2161
|
* @hidden
|
|
@@ -2185,11 +2183,10 @@ const getter = (field) => {
|
|
|
2185
2183
|
const last = (arr) => arr[arr.length - 1];
|
|
2186
2184
|
|
|
2187
2185
|
const getField = (field, level) => Array.isArray(field) ? field[level] || last(field) : field;
|
|
2188
|
-
/* tslint:disable:no-input-rename */
|
|
2189
2186
|
/**
|
|
2190
2187
|
* A directive that converts the provided hierarchical data to [MenuItems]({% slug api_menu_menuitem %}) and binds them to the Menu.
|
|
2191
2188
|
*/
|
|
2192
|
-
|
|
2189
|
+
class HierarchyBindingDirective extends BindingDirectiveBase {
|
|
2193
2190
|
constructor(menu) {
|
|
2194
2191
|
super(menu);
|
|
2195
2192
|
}
|
|
@@ -2218,56 +2215,40 @@ let HierarchyBindingDirective = class HierarchyBindingDirective extends BindingD
|
|
|
2218
2215
|
return item[field];
|
|
2219
2216
|
}
|
|
2220
2217
|
}
|
|
2221
|
-
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
]
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
],
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
],
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
],
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
],
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
]
|
|
2250
|
-
__decorate([
|
|
2251
|
-
Input(),
|
|
2252
|
-
__metadata("design:type", Object)
|
|
2253
|
-
], HierarchyBindingDirective.prototype, "separatorField", void 0);
|
|
2254
|
-
__decorate([
|
|
2255
|
-
Input(),
|
|
2256
|
-
__metadata("design:type", Object)
|
|
2257
|
-
], HierarchyBindingDirective.prototype, "childrenField", void 0);
|
|
2258
|
-
HierarchyBindingDirective = __decorate([
|
|
2259
|
-
Directive({
|
|
2260
|
-
exportAs: 'kendoMenuHierarchyBinding',
|
|
2261
|
-
selector: '[kendoMenuHierarchyBinding]'
|
|
2262
|
-
}),
|
|
2263
|
-
__metadata("design:paramtypes", [MenuBase])
|
|
2264
|
-
], HierarchyBindingDirective);
|
|
2218
|
+
}
|
|
2219
|
+
HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: MenuBase }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2220
|
+
HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: HierarchyBindingDirective, selector: "[kendoMenuHierarchyBinding]", inputs: { data: ["kendoMenuHierarchyBinding", "data"], textField: "textField", urlField: "urlField", iconField: "iconField", disabledField: "disabledField", cssClassField: "cssClassField", cssStyleField: "cssStyleField", separatorField: "separatorField", childrenField: "childrenField" }, exportAs: ["kendoMenuHierarchyBinding"], usesInheritance: true, ngImport: i0 });
|
|
2221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
|
|
2222
|
+
type: Directive,
|
|
2223
|
+
args: [{
|
|
2224
|
+
exportAs: 'kendoMenuHierarchyBinding',
|
|
2225
|
+
selector: '[kendoMenuHierarchyBinding]'
|
|
2226
|
+
}]
|
|
2227
|
+
}], ctorParameters: function () { return [{ type: MenuBase }]; }, propDecorators: { data: [{
|
|
2228
|
+
type: Input,
|
|
2229
|
+
args: ["kendoMenuHierarchyBinding"]
|
|
2230
|
+
}], textField: [{
|
|
2231
|
+
type: Input
|
|
2232
|
+
}], urlField: [{
|
|
2233
|
+
type: Input
|
|
2234
|
+
}], iconField: [{
|
|
2235
|
+
type: Input
|
|
2236
|
+
}], disabledField: [{
|
|
2237
|
+
type: Input
|
|
2238
|
+
}], cssClassField: [{
|
|
2239
|
+
type: Input
|
|
2240
|
+
}], cssStyleField: [{
|
|
2241
|
+
type: Input
|
|
2242
|
+
}], separatorField: [{
|
|
2243
|
+
type: Input
|
|
2244
|
+
}], childrenField: [{
|
|
2245
|
+
type: Input
|
|
2246
|
+
}] } });
|
|
2265
2247
|
|
|
2266
|
-
/* tslint:disable:no-input-rename */
|
|
2267
2248
|
/**
|
|
2268
2249
|
* A directive that converts the provided flat data to [MenuItems]({% slug api_menu_menuitem %}) and binds them to the Menu.
|
|
2269
2250
|
*/
|
|
2270
|
-
|
|
2251
|
+
class FlatBindingDirective extends BindingDirectiveBase {
|
|
2271
2252
|
constructor(menu) {
|
|
2272
2253
|
super(menu);
|
|
2273
2254
|
}
|
|
@@ -2306,54 +2287,37 @@ let FlatBindingDirective = class FlatBindingDirective extends BindingDirectiveBa
|
|
|
2306
2287
|
}
|
|
2307
2288
|
return result;
|
|
2308
2289
|
}
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
]
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
],
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
],
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
],
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
],
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
],
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
__metadata("design:type", String)
|
|
2341
|
-
], FlatBindingDirective.prototype, "separatorField", void 0);
|
|
2342
|
-
__decorate([
|
|
2343
|
-
Input(),
|
|
2344
|
-
__metadata("design:type", String)
|
|
2345
|
-
], FlatBindingDirective.prototype, "idField", void 0);
|
|
2346
|
-
__decorate([
|
|
2347
|
-
Input(),
|
|
2348
|
-
__metadata("design:type", String)
|
|
2349
|
-
], FlatBindingDirective.prototype, "parentIdField", void 0);
|
|
2350
|
-
FlatBindingDirective = __decorate([
|
|
2351
|
-
Directive({
|
|
2352
|
-
exportAs: 'kendoMenuFlatBinding',
|
|
2353
|
-
selector: '[kendoMenuFlatBinding]'
|
|
2354
|
-
}),
|
|
2355
|
-
__metadata("design:paramtypes", [MenuBase])
|
|
2356
|
-
], FlatBindingDirective);
|
|
2290
|
+
}
|
|
2291
|
+
FlatBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FlatBindingDirective, deps: [{ token: MenuBase }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2292
|
+
FlatBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FlatBindingDirective, selector: "[kendoMenuFlatBinding]", inputs: { data: ["kendoMenuFlatBinding", "data"], textField: "textField", urlField: "urlField", iconField: "iconField", disabledField: "disabledField", cssClassField: "cssClassField", cssStyleField: "cssStyleField", separatorField: "separatorField", idField: "idField", parentIdField: "parentIdField" }, exportAs: ["kendoMenuFlatBinding"], usesInheritance: true, ngImport: i0 });
|
|
2293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FlatBindingDirective, decorators: [{
|
|
2294
|
+
type: Directive,
|
|
2295
|
+
args: [{
|
|
2296
|
+
exportAs: 'kendoMenuFlatBinding',
|
|
2297
|
+
selector: '[kendoMenuFlatBinding]'
|
|
2298
|
+
}]
|
|
2299
|
+
}], ctorParameters: function () { return [{ type: MenuBase }]; }, propDecorators: { data: [{
|
|
2300
|
+
type: Input,
|
|
2301
|
+
args: ["kendoMenuFlatBinding"]
|
|
2302
|
+
}], textField: [{
|
|
2303
|
+
type: Input
|
|
2304
|
+
}], urlField: [{
|
|
2305
|
+
type: Input
|
|
2306
|
+
}], iconField: [{
|
|
2307
|
+
type: Input
|
|
2308
|
+
}], disabledField: [{
|
|
2309
|
+
type: Input
|
|
2310
|
+
}], cssClassField: [{
|
|
2311
|
+
type: Input
|
|
2312
|
+
}], cssStyleField: [{
|
|
2313
|
+
type: Input
|
|
2314
|
+
}], separatorField: [{
|
|
2315
|
+
type: Input
|
|
2316
|
+
}], idField: [{
|
|
2317
|
+
type: Input
|
|
2318
|
+
}], parentIdField: [{
|
|
2319
|
+
type: Input
|
|
2320
|
+
}] } });
|
|
2357
2321
|
|
|
2358
2322
|
const COMPONENT_EXPORTS = [
|
|
2359
2323
|
MenuComponent,
|
|
@@ -2366,7 +2330,7 @@ const COMPONENT_EXPORTS = [
|
|
|
2366
2330
|
LinkDirective,
|
|
2367
2331
|
ExpandArrowDirective
|
|
2368
2332
|
];
|
|
2369
|
-
const COMPONENT_DIRECTIVES = [
|
|
2333
|
+
const COMPONENT_DIRECTIVES$1 = [
|
|
2370
2334
|
...COMPONENT_EXPORTS,
|
|
2371
2335
|
ListComponent,
|
|
2372
2336
|
ItemComponent
|
|
@@ -2403,15 +2367,36 @@ const COMPONENT_DIRECTIVES = [
|
|
|
2403
2367
|
*
|
|
2404
2368
|
* ```
|
|
2405
2369
|
*/
|
|
2406
|
-
|
|
2407
|
-
}
|
|
2408
|
-
MenuModule =
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2370
|
+
class MenuModule {
|
|
2371
|
+
}
|
|
2372
|
+
MenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2373
|
+
MenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuModule, declarations: [MenuComponent,
|
|
2374
|
+
MenuItemComponent,
|
|
2375
|
+
ItemTemplateDirective,
|
|
2376
|
+
ItemLinkTemplateDirective,
|
|
2377
|
+
ItemContentTemplateDirective,
|
|
2378
|
+
HierarchyBindingDirective,
|
|
2379
|
+
FlatBindingDirective,
|
|
2380
|
+
LinkDirective,
|
|
2381
|
+
ExpandArrowDirective, ListComponent,
|
|
2382
|
+
ItemComponent], imports: [PopupModule, CommonModule], exports: [MenuComponent,
|
|
2383
|
+
MenuItemComponent,
|
|
2384
|
+
ItemTemplateDirective,
|
|
2385
|
+
ItemLinkTemplateDirective,
|
|
2386
|
+
ItemContentTemplateDirective,
|
|
2387
|
+
HierarchyBindingDirective,
|
|
2388
|
+
FlatBindingDirective,
|
|
2389
|
+
LinkDirective,
|
|
2390
|
+
ExpandArrowDirective] });
|
|
2391
|
+
MenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuModule, imports: [[PopupModule, CommonModule]] });
|
|
2392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenuModule, decorators: [{
|
|
2393
|
+
type: NgModule,
|
|
2394
|
+
args: [{
|
|
2395
|
+
declarations: [COMPONENT_DIRECTIVES$1],
|
|
2396
|
+
exports: [COMPONENT_EXPORTS],
|
|
2397
|
+
imports: [PopupModule, CommonModule]
|
|
2398
|
+
}]
|
|
2399
|
+
}] });
|
|
2415
2400
|
|
|
2416
2401
|
/**
|
|
2417
2402
|
* Arguments for the `open` and `close` events of the ContextMenu.
|
|
@@ -2442,23 +2427,26 @@ class ContextMenuPopupEvent extends PreventableEvent {
|
|
|
2442
2427
|
* {% embed_file shared/main.ts %}
|
|
2443
2428
|
* {% endmeta %}
|
|
2444
2429
|
*/
|
|
2445
|
-
|
|
2430
|
+
class ContextMenuTemplateDirective {
|
|
2446
2431
|
constructor(templateRef) {
|
|
2447
2432
|
this.templateRef = templateRef;
|
|
2448
2433
|
}
|
|
2449
|
-
}
|
|
2450
|
-
ContextMenuTemplateDirective =
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
]
|
|
2434
|
+
}
|
|
2435
|
+
ContextMenuTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2436
|
+
ContextMenuTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ContextMenuTemplateDirective, selector: "[kendoContextMenuTemplate]", ngImport: i0 });
|
|
2437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTemplateDirective, decorators: [{
|
|
2438
|
+
type: Directive,
|
|
2439
|
+
args: [{
|
|
2440
|
+
selector: '[kendoContextMenuTemplate]'
|
|
2441
|
+
}]
|
|
2442
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
2443
|
+
type: Optional
|
|
2444
|
+
}] }]; } });
|
|
2457
2445
|
|
|
2458
2446
|
/**
|
|
2459
2447
|
* @hidden
|
|
2460
2448
|
*/
|
|
2461
|
-
|
|
2449
|
+
class ContextMenuItemsService {
|
|
2462
2450
|
constructor(contextService) {
|
|
2463
2451
|
this.contextService = contextService;
|
|
2464
2452
|
}
|
|
@@ -2467,19 +2455,17 @@ let ContextMenuItemsService = class ContextMenuItemsService {
|
|
|
2467
2455
|
return this.contextService.items.get(index);
|
|
2468
2456
|
}
|
|
2469
2457
|
}
|
|
2470
|
-
}
|
|
2471
|
-
ContextMenuItemsService =
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2458
|
+
}
|
|
2459
|
+
ContextMenuItemsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuItemsService, deps: [{ token: ContextMenuService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2460
|
+
ContextMenuItemsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuItemsService });
|
|
2461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuItemsService, decorators: [{
|
|
2462
|
+
type: Injectable
|
|
2463
|
+
}], ctorParameters: function () { return [{ type: ContextMenuService }]; } });
|
|
2475
2464
|
|
|
2476
2465
|
/**
|
|
2477
2466
|
* @hidden
|
|
2478
2467
|
*/
|
|
2479
|
-
|
|
2480
|
-
/**
|
|
2481
|
-
* @hidden
|
|
2482
|
-
*/
|
|
2468
|
+
class ContextMenuTargetService {
|
|
2483
2469
|
constructor() {
|
|
2484
2470
|
this.targets = [];
|
|
2485
2471
|
}
|
|
@@ -2493,15 +2479,17 @@ let ContextMenuTargetService = class ContextMenuTargetService {
|
|
|
2493
2479
|
find(targetElement) {
|
|
2494
2480
|
return this.targets.find(target => target.element === targetElement);
|
|
2495
2481
|
}
|
|
2496
|
-
}
|
|
2497
|
-
ContextMenuTargetService =
|
|
2498
|
-
|
|
2499
|
-
|
|
2482
|
+
}
|
|
2483
|
+
ContextMenuTargetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2484
|
+
ContextMenuTargetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetService });
|
|
2485
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetService, decorators: [{
|
|
2486
|
+
type: Injectable
|
|
2487
|
+
}] });
|
|
2500
2488
|
|
|
2501
2489
|
/**
|
|
2502
2490
|
* Specifies a container for the [targets]({% slug api_menu_contextmenutargetdirective %}) of the ContextMenu.
|
|
2503
2491
|
*/
|
|
2504
|
-
|
|
2492
|
+
class ContextMenuTargetContainerDirective {
|
|
2505
2493
|
/**
|
|
2506
2494
|
* @hidden
|
|
2507
2495
|
*/
|
|
@@ -2511,15 +2499,17 @@ let ContextMenuTargetContainerDirective = class ContextMenuTargetContainerDirect
|
|
|
2511
2499
|
this.element = elementRef.nativeElement;
|
|
2512
2500
|
}
|
|
2513
2501
|
}
|
|
2514
|
-
}
|
|
2515
|
-
ContextMenuTargetContainerDirective =
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
]
|
|
2502
|
+
}
|
|
2503
|
+
ContextMenuTargetContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetContainerDirective, deps: [{ token: i0.ElementRef }, { token: ContextMenuTargetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2504
|
+
ContextMenuTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ContextMenuTargetContainerDirective, selector: "[kendoContextMenuTargetContainer]", providers: [ContextMenuTargetService], exportAs: ["kendoContextMenuTargetContainer"], ngImport: i0 });
|
|
2505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetContainerDirective, decorators: [{
|
|
2506
|
+
type: Directive,
|
|
2507
|
+
args: [{
|
|
2508
|
+
selector: '[kendoContextMenuTargetContainer]',
|
|
2509
|
+
exportAs: 'kendoContextMenuTargetContainer',
|
|
2510
|
+
providers: [ContextMenuTargetService]
|
|
2511
|
+
}]
|
|
2512
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ContextMenuTargetService }]; } });
|
|
2523
2513
|
|
|
2524
2514
|
/**
|
|
2525
2515
|
* @hidden
|
|
@@ -2529,7 +2519,7 @@ const TARGET_CLASS = 'k-contextmenu-target';
|
|
|
2529
2519
|
* Specifies a [target]({% slug api_menu_contextmenutargetdirective %}) for the ContextMenu
|
|
2530
2520
|
* ([see example]({% slug target_contextmenu %}#toc-directives)).
|
|
2531
2521
|
*/
|
|
2532
|
-
|
|
2522
|
+
class ContextMenuTargetDirective {
|
|
2533
2523
|
constructor(elementRef, targetService) {
|
|
2534
2524
|
this.targetService = targetService;
|
|
2535
2525
|
/**
|
|
@@ -2544,30 +2534,28 @@ let ContextMenuTargetDirective = class ContextMenuTargetDirective {
|
|
|
2544
2534
|
ngOnDestroy() {
|
|
2545
2535
|
this.targetService.remove(this);
|
|
2546
2536
|
}
|
|
2547
|
-
}
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
]
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
]
|
|
2537
|
+
}
|
|
2538
|
+
ContextMenuTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetDirective, deps: [{ token: i0.ElementRef }, { token: ContextMenuTargetService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2539
|
+
ContextMenuTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ContextMenuTargetDirective, selector: "[kendoContextMenuTarget]", inputs: { data: ["kendoContextMenuTarget", "data"] }, host: { properties: { "class.k-contextmenu-target": "this.hostClass" } }, exportAs: ["kendoContextMenuTarget"], ngImport: i0 });
|
|
2540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuTargetDirective, decorators: [{
|
|
2541
|
+
type: Directive,
|
|
2542
|
+
args: [{
|
|
2543
|
+
selector: '[kendoContextMenuTarget]',
|
|
2544
|
+
exportAs: 'kendoContextMenuTarget'
|
|
2545
|
+
}]
|
|
2546
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ContextMenuTargetService }]; }, propDecorators: { data: [{
|
|
2547
|
+
type: Input,
|
|
2548
|
+
args: ['kendoContextMenuTarget']
|
|
2549
|
+
}], hostClass: [{
|
|
2550
|
+
type: HostBinding,
|
|
2551
|
+
args: [`class.${TARGET_CLASS}`]
|
|
2552
|
+
}] } });
|
|
2563
2553
|
|
|
2564
|
-
var ContextMenuComponent_1;
|
|
2565
2554
|
const CONTEXT_MENU = 'contextmenu';
|
|
2566
2555
|
const DEFAULT_ANCHOR_ALIGN = { horizontal: 'left', vertical: 'bottom' };
|
|
2567
2556
|
const DEFAULT_POPUP_ALIGN = { horizontal: 'left', vertical: 'top' };
|
|
2568
2557
|
const DEFAULT_COLLISION = { horizontal: 'fit', vertical: 'flip' };
|
|
2569
2558
|
const preventDefault = e => e.preventDefault();
|
|
2570
|
-
const ɵ1$2 = bodyFactory;
|
|
2571
2559
|
/**
|
|
2572
2560
|
* Represents the [Kendo UI ContextMenu component for Angular]({% slug overview_contextmenu %}).
|
|
2573
2561
|
*
|
|
@@ -2587,7 +2575,7 @@ const ɵ1$2 = bodyFactory;
|
|
|
2587
2575
|
* }
|
|
2588
2576
|
* ```
|
|
2589
2577
|
*/
|
|
2590
|
-
|
|
2578
|
+
class ContextMenuComponent extends MenuBase {
|
|
2591
2579
|
constructor(popupService, service, ngZone, renderer) {
|
|
2592
2580
|
super();
|
|
2593
2581
|
this.popupService = popupService;
|
|
@@ -2874,105 +2862,67 @@ let ContextMenuComponent = ContextMenuComponent_1 = class ContextMenuComponent e
|
|
|
2874
2862
|
get currentTargetElement() {
|
|
2875
2863
|
return this.directiveTarget && this.currentTarget ? this.currentTarget.element : this.currentTarget;
|
|
2876
2864
|
}
|
|
2877
|
-
}
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
]
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
]
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
__decorate([
|
|
2939
|
-
Output(),
|
|
2940
|
-
__metadata("design:type", EventEmitter)
|
|
2941
|
-
], ContextMenuComponent.prototype, "close", void 0);
|
|
2942
|
-
__decorate([
|
|
2943
|
-
ContentChild(ContextMenuTemplateDirective, { static: false }),
|
|
2944
|
-
__metadata("design:type", ContextMenuTemplateDirective)
|
|
2945
|
-
], ContextMenuComponent.prototype, "contentTemplate", void 0);
|
|
2946
|
-
__decorate([
|
|
2947
|
-
ViewChild('default', { static: false }),
|
|
2948
|
-
__metadata("design:type", TemplateRef)
|
|
2949
|
-
], ContextMenuComponent.prototype, "defaultContentTemplate", void 0);
|
|
2950
|
-
ContextMenuComponent = ContextMenuComponent_1 = __decorate([
|
|
2951
|
-
Component({
|
|
2952
|
-
exportAs: 'kendoContextMenu',
|
|
2953
|
-
providers: [
|
|
2954
|
-
ContextMenuService,
|
|
2955
|
-
LocalizationService,
|
|
2956
|
-
{
|
|
2957
|
-
provide: L10N_PREFIX,
|
|
2958
|
-
useValue: 'kendo.contextmenu'
|
|
2959
|
-
},
|
|
2960
|
-
{
|
|
2961
|
-
provide: ItemsService,
|
|
2962
|
-
useClass: ContextMenuItemsService
|
|
2963
|
-
},
|
|
2964
|
-
{
|
|
2965
|
-
provide: MenuBase,
|
|
2966
|
-
useExisting: forwardRef(() => ContextMenuComponent_1)
|
|
2967
|
-
},
|
|
2968
|
-
PopupService,
|
|
2969
|
-
{
|
|
2970
|
-
provide: POPUP_CONTAINER,
|
|
2971
|
-
useFactory: ɵ1$2
|
|
2972
|
-
}
|
|
2973
|
-
],
|
|
2974
|
-
selector: 'kendo-contextmenu',
|
|
2975
|
-
template: `
|
|
2865
|
+
}
|
|
2866
|
+
ContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuComponent, deps: [{ token: i6.PopupService }, { token: ContextMenuService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
2867
|
+
ContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContextMenuComponent, selector: "kendo-contextmenu", inputs: { showOn: "showOn", target: "target", filter: "filter", alignToAnchor: "alignToAnchor", vertical: "vertical", popupAnimate: "popupAnimate", popupAlign: "popupAlign", anchorAlign: "anchorAlign", collision: "collision", appendTo: "appendTo", ariaLabel: "ariaLabel" }, outputs: { popupOpen: "popupOpen", popupClose: "popupClose", select: "select", open: "open", close: "close" }, providers: [
|
|
2868
|
+
ContextMenuService,
|
|
2869
|
+
LocalizationService,
|
|
2870
|
+
{
|
|
2871
|
+
provide: L10N_PREFIX,
|
|
2872
|
+
useValue: 'kendo.contextmenu'
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
provide: ItemsService,
|
|
2876
|
+
useClass: ContextMenuItemsService
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
provide: MenuBase,
|
|
2880
|
+
useExisting: forwardRef(() => ContextMenuComponent)
|
|
2881
|
+
},
|
|
2882
|
+
PopupService,
|
|
2883
|
+
{
|
|
2884
|
+
provide: POPUP_CONTAINER,
|
|
2885
|
+
useFactory: bodyFactory
|
|
2886
|
+
}
|
|
2887
|
+
], queries: [{ propertyName: "contentTemplate", first: true, predicate: ContextMenuTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "defaultContentTemplate", first: true, predicate: ["default"], descendants: true }], exportAs: ["kendoContextMenu"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
2888
|
+
<ng-template #default>
|
|
2889
|
+
<kendo-menu [items]="rootItems"
|
|
2890
|
+
[vertical]="vertical"
|
|
2891
|
+
[openOnClick]="openOnClick"
|
|
2892
|
+
[hoverDelay]="hoverDelay"
|
|
2893
|
+
[animate]="animate"
|
|
2894
|
+
[menuItemTemplate]="itemTemplate.first?.templateRef"
|
|
2895
|
+
[menuItemLinkTemplate]="itemLinkTemplate.first?.templateRef"
|
|
2896
|
+
></kendo-menu>
|
|
2897
|
+
</ng-template>
|
|
2898
|
+
`, isInline: true, components: [{ type: MenuComponent, selector: "kendo-menu", inputs: ["menuItemTemplate", "menuItemLinkTemplate"], outputs: ["select", "open", "close"], exportAs: ["kendoMenu"] }] });
|
|
2899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuComponent, decorators: [{
|
|
2900
|
+
type: Component,
|
|
2901
|
+
args: [{
|
|
2902
|
+
exportAs: 'kendoContextMenu',
|
|
2903
|
+
providers: [
|
|
2904
|
+
ContextMenuService,
|
|
2905
|
+
LocalizationService,
|
|
2906
|
+
{
|
|
2907
|
+
provide: L10N_PREFIX,
|
|
2908
|
+
useValue: 'kendo.contextmenu'
|
|
2909
|
+
},
|
|
2910
|
+
{
|
|
2911
|
+
provide: ItemsService,
|
|
2912
|
+
useClass: ContextMenuItemsService
|
|
2913
|
+
},
|
|
2914
|
+
{
|
|
2915
|
+
provide: MenuBase,
|
|
2916
|
+
useExisting: forwardRef(() => ContextMenuComponent)
|
|
2917
|
+
},
|
|
2918
|
+
PopupService,
|
|
2919
|
+
{
|
|
2920
|
+
provide: POPUP_CONTAINER,
|
|
2921
|
+
useFactory: bodyFactory
|
|
2922
|
+
}
|
|
2923
|
+
],
|
|
2924
|
+
selector: 'kendo-contextmenu',
|
|
2925
|
+
template: `
|
|
2976
2926
|
<ng-template #default>
|
|
2977
2927
|
<kendo-menu [items]="rootItems"
|
|
2978
2928
|
[vertical]="vertical"
|
|
@@ -2984,14 +2934,48 @@ ContextMenuComponent = ContextMenuComponent_1 = __decorate([
|
|
|
2984
2934
|
></kendo-menu>
|
|
2985
2935
|
</ng-template>
|
|
2986
2936
|
`
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
],
|
|
2937
|
+
}]
|
|
2938
|
+
}], ctorParameters: function () { return [{ type: i6.PopupService }, { type: ContextMenuService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; }, propDecorators: { showOn: [{
|
|
2939
|
+
type: Input
|
|
2940
|
+
}], target: [{
|
|
2941
|
+
type: Input
|
|
2942
|
+
}], filter: [{
|
|
2943
|
+
type: Input
|
|
2944
|
+
}], alignToAnchor: [{
|
|
2945
|
+
type: Input
|
|
2946
|
+
}], vertical: [{
|
|
2947
|
+
type: Input
|
|
2948
|
+
}], popupAnimate: [{
|
|
2949
|
+
type: Input
|
|
2950
|
+
}], popupAlign: [{
|
|
2951
|
+
type: Input
|
|
2952
|
+
}], anchorAlign: [{
|
|
2953
|
+
type: Input
|
|
2954
|
+
}], collision: [{
|
|
2955
|
+
type: Input
|
|
2956
|
+
}], appendTo: [{
|
|
2957
|
+
type: Input
|
|
2958
|
+
}], ariaLabel: [{
|
|
2959
|
+
type: Input
|
|
2960
|
+
}], popupOpen: [{
|
|
2961
|
+
type: Output
|
|
2962
|
+
}], popupClose: [{
|
|
2963
|
+
type: Output
|
|
2964
|
+
}], select: [{
|
|
2965
|
+
type: Output
|
|
2966
|
+
}], open: [{
|
|
2967
|
+
type: Output
|
|
2968
|
+
}], close: [{
|
|
2969
|
+
type: Output
|
|
2970
|
+
}], contentTemplate: [{
|
|
2971
|
+
type: ContentChild,
|
|
2972
|
+
args: [ContextMenuTemplateDirective, { static: false }]
|
|
2973
|
+
}], defaultContentTemplate: [{
|
|
2974
|
+
type: ViewChild,
|
|
2975
|
+
args: ['default', { static: false }]
|
|
2976
|
+
}] } });
|
|
2993
2977
|
|
|
2994
|
-
const COMPONENT_DIRECTIVES
|
|
2978
|
+
const COMPONENT_DIRECTIVES = [
|
|
2995
2979
|
ContextMenuComponent,
|
|
2996
2980
|
ContextMenuTemplateDirective,
|
|
2997
2981
|
ContextMenuTargetDirective,
|
|
@@ -3029,15 +3013,25 @@ const COMPONENT_DIRECTIVES$1 = [
|
|
|
3029
3013
|
*
|
|
3030
3014
|
* ```
|
|
3031
3015
|
*/
|
|
3032
|
-
|
|
3033
|
-
}
|
|
3034
|
-
ContextMenuModule =
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
imports: [PopupModule, CommonModule, MenuModule]
|
|
3039
|
-
|
|
3040
|
-
|
|
3016
|
+
class ContextMenuModule {
|
|
3017
|
+
}
|
|
3018
|
+
ContextMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3019
|
+
ContextMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuModule, declarations: [ContextMenuComponent,
|
|
3020
|
+
ContextMenuTemplateDirective,
|
|
3021
|
+
ContextMenuTargetDirective,
|
|
3022
|
+
ContextMenuTargetContainerDirective], imports: [PopupModule, CommonModule, MenuModule], exports: [ContextMenuComponent,
|
|
3023
|
+
ContextMenuTemplateDirective,
|
|
3024
|
+
ContextMenuTargetDirective,
|
|
3025
|
+
ContextMenuTargetContainerDirective, MenuModule] });
|
|
3026
|
+
ContextMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuModule, imports: [[PopupModule, CommonModule, MenuModule], MenuModule] });
|
|
3027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContextMenuModule, decorators: [{
|
|
3028
|
+
type: NgModule,
|
|
3029
|
+
args: [{
|
|
3030
|
+
declarations: [COMPONENT_DIRECTIVES],
|
|
3031
|
+
exports: [COMPONENT_DIRECTIVES, MenuModule],
|
|
3032
|
+
imports: [PopupModule, CommonModule, MenuModule]
|
|
3033
|
+
}]
|
|
3034
|
+
}] });
|
|
3041
3035
|
|
|
3042
3036
|
/**
|
|
3043
3037
|
* A [module]({{ site.data.urls.angular['ngmoduleapi'] }}) that includes the Menu and ContextMenu components and directives.
|
|
@@ -3061,16 +3055,21 @@ ContextMenuModule = __decorate([
|
|
|
3061
3055
|
* }
|
|
3062
3056
|
* ```
|
|
3063
3057
|
*/
|
|
3064
|
-
|
|
3065
|
-
}
|
|
3066
|
-
MenusModule =
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3058
|
+
class MenusModule {
|
|
3059
|
+
}
|
|
3060
|
+
MenusModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3061
|
+
MenusModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenusModule, exports: [MenuModule, ContextMenuModule] });
|
|
3062
|
+
MenusModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenusModule, imports: [MenuModule, ContextMenuModule] });
|
|
3063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MenusModule, decorators: [{
|
|
3064
|
+
type: NgModule,
|
|
3065
|
+
args: [{
|
|
3066
|
+
exports: [MenuModule, ContextMenuModule]
|
|
3067
|
+
}]
|
|
3068
|
+
}] });
|
|
3071
3069
|
|
|
3072
3070
|
/**
|
|
3073
3071
|
* Generated bundle index. Do not edit.
|
|
3074
3072
|
*/
|
|
3075
3073
|
|
|
3076
|
-
export {
|
|
3074
|
+
export { ContextMenuComponent, ContextMenuEvent, ContextMenuModule, ContextMenuPopupEvent, ContextMenuSelectEvent, ContextMenuService, ContextMenuTargetContainerDirective, ContextMenuTargetDirective, ContextMenuTemplateDirective, ExpandArrowDirective, FlatBindingDirective, HierarchyBindingDirective, ItemComponent, ItemContentTemplateDirective, ItemLinkTemplateDirective, ItemTemplateDirective, LinkDirective, ListComponent, MenuComponent, MenuEvent, MenuItemComponent, MenuModule, MenuSelectEvent, MenusModule };
|
|
3075
|
+
|