@progress/kendo-angular-menu 4.1.1 → 11.0.0-develop.80

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.
Files changed (96) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +3 -3
  3. package/constants.d.ts +1 -1
  4. package/context-menu/context-menu-event.d.ts +1 -1
  5. package/context-menu/context-menu-items.service.d.ts +1 -1
  6. package/context-menu/context-menu-popup-event.d.ts +1 -1
  7. package/context-menu/context-menu-select-event.d.ts +1 -1
  8. package/context-menu/context-menu-target-container.directive.d.ts +1 -1
  9. package/context-menu/context-menu-target.directive.d.ts +1 -1
  10. package/context-menu/context-menu-target.service.d.ts +1 -1
  11. package/context-menu/context-menu-template.directive.d.ts +1 -1
  12. package/context-menu/context-menu.component.d.ts +1 -1
  13. package/context-menu/context-menu.module.d.ts +1 -1
  14. package/context-menu/context-menu.service.d.ts +1 -1
  15. package/data-binding/binding-directive-base.d.ts +1 -1
  16. package/data-binding/flat-binding.directive.d.ts +1 -1
  17. package/data-binding/hierachy-binding.directive.d.ts +1 -1
  18. package/data-binding/utils.d.ts +1 -1
  19. package/dom-queries.d.ts +1 -1
  20. package/{esm2015/constants.js → esm2020/constants.mjs} +1 -1
  21. package/{esm2015/context-menu/context-menu-event.js → esm2020/context-menu/context-menu-event.mjs} +1 -1
  22. package/{esm2015/context-menu/context-menu-items.service.js → esm2020/context-menu/context-menu-items.service.mjs} +5 -4
  23. package/{esm2015/context-menu/context-menu-popup-event.js → esm2020/context-menu/context-menu-popup-event.mjs} +1 -1
  24. package/{esm2015/context-menu/context-menu-select-event.js → esm2020/context-menu/context-menu-select-event.mjs} +1 -1
  25. package/{esm2015/context-menu/context-menu-target-container.directive.js → esm2020/context-menu/context-menu-target-container.directive.mjs} +5 -5
  26. package/{esm2015/context-menu/context-menu-target.directive.js → esm2020/context-menu/context-menu-target.directive.mjs} +6 -5
  27. package/{esm2015/context-menu/context-menu-target.service.js → esm2020/context-menu/context-menu-target.service.mjs} +4 -4
  28. package/{esm2015/context-menu/context-menu-template.directive.js → esm2020/context-menu/context-menu-template.directive.mjs} +5 -5
  29. package/{esm2015/context-menu/context-menu.component.js → esm2020/context-menu/context-menu.component.mjs} +5 -5
  30. package/{esm2015/context-menu/context-menu.module.js → esm2020/context-menu/context-menu.module.mjs} +5 -5
  31. package/{esm2015/context-menu/context-menu.service.js → esm2020/context-menu/context-menu.service.mjs} +4 -4
  32. package/{esm2015/data-binding/binding-directive-base.js → esm2020/data-binding/binding-directive-base.mjs} +5 -4
  33. package/{esm2015/data-binding/flat-binding.directive.js → esm2020/data-binding/flat-binding.directive.mjs} +5 -4
  34. package/{esm2015/data-binding/hierachy-binding.directive.js → esm2020/data-binding/hierachy-binding.directive.mjs} +5 -4
  35. package/{esm2015/data-binding/utils.js → esm2020/data-binding/utils.mjs} +1 -1
  36. package/{esm2015/dom-queries.js → esm2020/dom-queries.mjs} +1 -1
  37. package/{esm2015/main.js → esm2020/index.mjs} +1 -1
  38. package/{esm2015/size.js → esm2020/menu-animation.interface.mjs} +1 -1
  39. package/{esm2015/menu-base.js → esm2020/menu-base.mjs} +5 -5
  40. package/{esm2015/menu-event.js → esm2020/menu-event.mjs} +1 -1
  41. package/{esm2015/menu-item.component.js → esm2020/menu-item.component.mjs} +5 -5
  42. package/{esm2015/menu-item.interface.js → esm2020/menu-item.interface.mjs} +1 -1
  43. package/{esm2015/menu-select-event.js → esm2020/menu-select-event.mjs} +1 -1
  44. package/{esm2015/menu.component.js → esm2020/menu.component.mjs} +6 -5
  45. package/{esm2015/menu.module.js → esm2020/menu.module.mjs} +5 -5
  46. package/{esm2015/menus.module.js → esm2020/menus.module.mjs} +5 -5
  47. package/{esm2015/open-on-click-settings.js → esm2020/open-on-click-settings.mjs} +1 -1
  48. package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
  49. package/{esm2015/preventable-event.js → esm2020/preventable-event.mjs} +1 -1
  50. package/{esm2015/kendo-angular-menu.js → esm2020/progress-kendo-angular-menu.mjs} +2 -2
  51. package/{esm2015/rendering/arrow.directive.js → esm2020/rendering/arrow.directive.mjs} +6 -5
  52. package/{esm2015/rendering/link.directive.js → esm2020/rendering/link.directive.mjs} +5 -4
  53. package/{esm2015/rendering/list.component.js → esm2020/rendering/list.component.mjs} +14 -9
  54. package/{esm2015/rendering/popup-settings.js → esm2020/rendering/popup-settings.mjs} +1 -1
  55. package/{esm2015/services/actions.service.js → esm2020/services/actions.service.mjs} +5 -4
  56. package/{esm2015/services/hover.service.js → esm2020/services/hover.service.mjs} +6 -4
  57. package/{esm2015/services/items.service.js → esm2020/services/items.service.mjs} +6 -6
  58. package/{esm2015/services/navigation.service.js → esm2020/services/navigation.service.mjs} +8 -5
  59. package/{esm2015/menu-animation.interface.js → esm2020/size.mjs} +1 -1
  60. package/{esm2015/templates/item-content-template.directive.js → esm2020/templates/item-content-template.directive.mjs} +5 -5
  61. package/{esm2015/templates/item-link-template.directive.js → esm2020/templates/item-link-template.directive.mjs} +5 -5
  62. package/{esm2015/templates/item-template.directive.js → esm2020/templates/item-template.directive.mjs} +5 -5
  63. package/{esm2015/utils.js → esm2020/utils.mjs} +1 -1
  64. package/fesm2015/progress-kendo-angular-menu.mjs +3135 -0
  65. package/{fesm2015/kendo-angular-menu.js → fesm2020/progress-kendo-angular-menu.mjs} +110 -110
  66. package/{main.d.ts → index.d.ts} +2 -1
  67. package/menu-animation.interface.d.ts +1 -1
  68. package/menu-base.d.ts +1 -1
  69. package/menu-event.d.ts +1 -1
  70. package/menu-item.component.d.ts +1 -1
  71. package/menu-item.interface.d.ts +1 -1
  72. package/menu-select-event.d.ts +1 -1
  73. package/menu.component.d.ts +1 -1
  74. package/menu.module.d.ts +1 -1
  75. package/menus.module.d.ts +1 -1
  76. package/open-on-click-settings.d.ts +1 -1
  77. package/package-metadata.d.ts +1 -1
  78. package/package.json +28 -54
  79. package/preventable-event.d.ts +1 -1
  80. package/{kendo-angular-menu.d.ts → progress-kendo-angular-menu.d.ts} +2 -2
  81. package/rendering/arrow.directive.d.ts +1 -1
  82. package/rendering/link.directive.d.ts +1 -1
  83. package/rendering/list.component.d.ts +1 -1
  84. package/rendering/popup-settings.d.ts +1 -1
  85. package/schematics/ngAdd/index.js +1 -5
  86. package/services/actions.service.d.ts +1 -1
  87. package/services/hover.service.d.ts +1 -1
  88. package/services/items.service.d.ts +1 -1
  89. package/services/navigation.service.d.ts +1 -1
  90. package/size.d.ts +1 -1
  91. package/templates/item-content-template.directive.d.ts +1 -1
  92. package/templates/item-link-template.directive.d.ts +1 -1
  93. package/templates/item-template.directive.d.ts +1 -1
  94. package/utils.d.ts +1 -1
  95. package/bundles/kendo-angular-menu.umd.js +0 -5
  96. package/schematics/ngAdd/index.js.map +0 -1
@@ -0,0 +1,3135 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2022 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as i0 from '@angular/core';
6
+ import { Injectable, NgZone, Directive, Optional, Component, Input, ContentChildren, ElementRef, EventEmitter, ViewChild, HostBinding, forwardRef, Output, isDevMode, NgModule, ContentChild } from '@angular/core';
7
+ import * as i3 from '@progress/kendo-angular-l10n';
8
+ import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
+ import { validatePackage } from '@progress/kendo-licensing';
10
+ import { PreventableEvent as PreventableEvent$1, hasObservers, isDocumentAvailable, Keys } from '@progress/kendo-angular-common';
11
+ import * as i6 from '@progress/kendo-angular-popup';
12
+ import { PopupService, POPUP_CONTAINER, PopupModule } from '@progress/kendo-angular-popup';
13
+ import * as i5 from '@angular/common';
14
+ import { CommonModule } from '@angular/common';
15
+
16
+ /**
17
+ * @hidden
18
+ */
19
+ const packageMetadata = {
20
+ name: '@progress/kendo-angular-menu',
21
+ productName: 'Kendo UI for Angular',
22
+ productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
23
+ publishDate: 1672394481,
24
+ version: '',
25
+ licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
26
+ };
27
+
28
+ const PARENT_REGEX = /_?\d+$/;
29
+ const SEPARATOR = '_';
30
+ let id = 0;
31
+ const itemIndexComparer = (a, b) => a.siblingIndex - b.siblingIndex;
32
+ const next = (idx, items, dir) => {
33
+ let current = items[idx + dir];
34
+ while (!current) {
35
+ if (idx < 0) {
36
+ idx = items.length - 1;
37
+ }
38
+ else if (idx >= items.length) {
39
+ idx = 0;
40
+ }
41
+ else {
42
+ idx += dir;
43
+ }
44
+ current = items[idx];
45
+ }
46
+ return current;
47
+ };
48
+ /**
49
+ * @hidden
50
+ */
51
+ class ItemsService {
52
+ constructor() {
53
+ this.items = {};
54
+ this.lists = [];
55
+ this.idPrefix = `k-menu${id++}`;
56
+ }
57
+ get hasItems() {
58
+ return Object.keys(this.items).length > 0;
59
+ }
60
+ childId(index) {
61
+ return `${this.idPrefix}-child${index}`;
62
+ }
63
+ itemIndex(parentIndex, index) {
64
+ return (parentIndex ? parentIndex + SEPARATOR : '') + index;
65
+ }
66
+ get(index) {
67
+ return this.items[index];
68
+ }
69
+ add(item) {
70
+ this.items[item.index] = item;
71
+ }
72
+ remove(item) {
73
+ if (this.items[item.index] === item) {
74
+ delete this.items[item.index];
75
+ }
76
+ }
77
+ addList(list) {
78
+ this.lists.push(list);
79
+ }
80
+ removeList(list) {
81
+ const index = this.lists.indexOf(list);
82
+ if (index >= 0) {
83
+ this.lists.splice(index, 1);
84
+ }
85
+ }
86
+ containsList(element) {
87
+ return Boolean(this.lists.find(list => list.element.nativeElement === element));
88
+ }
89
+ siblings(item) {
90
+ const parentIndex = this.parentIndex(item.index);
91
+ return this.filter((index) => this.parentIndex(index) === parentIndex);
92
+ }
93
+ otherSiblings(item) {
94
+ const parentIndex = this.parentIndex(item.index);
95
+ return this.filter((index) => this.parentIndex(index) === parentIndex && index !== item.index);
96
+ }
97
+ children(item) {
98
+ return this.filter((index) => this.parentIndex(index) === item.index);
99
+ }
100
+ parent(item) {
101
+ return this.items[this.parentIndex(item.index)];
102
+ }
103
+ root(item) {
104
+ return this.items[this.indices(item.index)[0]];
105
+ }
106
+ indices(index) {
107
+ return index.split(SEPARATOR);
108
+ }
109
+ filter(predicate) {
110
+ const result = [];
111
+ const items = this.items;
112
+ for (const index in items) {
113
+ if (predicate(index, items[index])) {
114
+ result.push(items[index]);
115
+ }
116
+ }
117
+ return result.sort(itemIndexComparer);
118
+ }
119
+ previous(item) {
120
+ const siblings = this.siblings(item);
121
+ const itemIndex = siblings.indexOf(item);
122
+ return next(itemIndex, siblings, -1);
123
+ }
124
+ next(item) {
125
+ const siblings = this.siblings(item);
126
+ const itemIndex = siblings.indexOf(item);
127
+ return next(itemIndex, siblings, 1);
128
+ }
129
+ hasParent(item, parent) {
130
+ return item.index.startsWith(parent.index);
131
+ }
132
+ areSiblings(item1, item2) {
133
+ return item1 !== item2 && this.parent(item1) === this.parent(item2);
134
+ }
135
+ forEach(callback) {
136
+ const items = this.items;
137
+ for (const index in items) {
138
+ if (items.hasOwnProperty(index)) {
139
+ callback(items[index]);
140
+ }
141
+ }
142
+ }
143
+ parentIndex(index) {
144
+ return index.replace(PARENT_REGEX, '');
145
+ }
146
+ }
147
+ ItemsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
148
+ ItemsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemsService });
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemsService, decorators: [{
150
+ type: Injectable
151
+ }] });
152
+
153
+ const canPerformAction = (item, action) => !((action === 'open' && item.opened) || (action === 'close' && !item.opened));
154
+ /**
155
+ * Used to remove cyclic dependency error. Dublicates MenuEvent
156
+ * @hidden
157
+ */
158
+ class MenuStateEvent extends PreventableEvent$1 {
159
+ constructor(args) {
160
+ super();
161
+ Object.assign(this, args);
162
+ }
163
+ }
164
+ /**
165
+ * @hidden
166
+ */
167
+ class ActionsService {
168
+ constructor(ngZone, items) {
169
+ this.ngZone = ngZone;
170
+ this.items = items;
171
+ this.actions = [];
172
+ }
173
+ open(item, finished) {
174
+ if (item.disabled) {
175
+ return;
176
+ }
177
+ if (item.hasContent && !item.opened) {
178
+ this.actions.push({
179
+ name: 'open',
180
+ requiresZone: item.hasContentTemplates(),
181
+ item,
182
+ finished
183
+ });
184
+ }
185
+ else if (finished) {
186
+ finished();
187
+ }
188
+ }
189
+ close(item) {
190
+ this.closeChildren(item);
191
+ this.closeItem(item);
192
+ }
193
+ closeItem(item) {
194
+ if (item.opened) {
195
+ this.actions.push({
196
+ name: 'close',
197
+ item
198
+ });
199
+ }
200
+ }
201
+ closeToRoot(item) {
202
+ this.closeChildren(item);
203
+ let current = item;
204
+ do {
205
+ this.closeItem(current);
206
+ current = this.items.parent(current);
207
+ } while (current);
208
+ }
209
+ closeOthers(item) {
210
+ this.closeChildren(item);
211
+ let current = item;
212
+ while (current) {
213
+ const siblings = this.items.otherSiblings(current);
214
+ this.closeItems(siblings);
215
+ current = this.items.parent(current);
216
+ }
217
+ }
218
+ closeAll() {
219
+ this.items.forEach((item) => {
220
+ if (item.opened && item.level === 0) {
221
+ this.close(item);
222
+ }
223
+ });
224
+ }
225
+ select(item, domEvent, prevented, finished) {
226
+ this.actions.push({
227
+ name: 'select',
228
+ item,
229
+ prevented,
230
+ finished,
231
+ domEvent
232
+ });
233
+ }
234
+ emit(name, item, domEvent) {
235
+ const owner = this.owner;
236
+ const eventArgs = new MenuStateEvent({
237
+ sender: owner,
238
+ item: item.item,
239
+ index: item.index,
240
+ originalEvent: domEvent,
241
+ hasContent: item.hasContent
242
+ });
243
+ owner[name].emit(eventArgs);
244
+ if (owner.contextService) {
245
+ owner.contextService.emit(name, eventArgs);
246
+ }
247
+ return eventArgs.isDefaultPrevented();
248
+ }
249
+ get hasPending() {
250
+ return this.actions.length > 0;
251
+ }
252
+ execute(toExecute) {
253
+ if (!this.hasPending && !toExecute) {
254
+ return;
255
+ }
256
+ const actions = toExecute || this.clear();
257
+ if (!NgZone.isInAngularZone() && this.requiresZone(actions)) {
258
+ this.ngZone.run(() => {
259
+ this.executeActions(actions);
260
+ });
261
+ }
262
+ else {
263
+ this.executeActions(actions);
264
+ }
265
+ }
266
+ clear() {
267
+ const actions = this.actions;
268
+ this.actions = [];
269
+ return actions;
270
+ }
271
+ executeActions(actions) {
272
+ for (let idx = 0; idx < actions.length; idx++) {
273
+ const { item, name, prevented, finished, domEvent } = actions[idx];
274
+ if (!canPerformAction(item, name)) {
275
+ continue;
276
+ }
277
+ if (!this.emit(name, item, domEvent)) {
278
+ if (item[name]) {
279
+ item[name]();
280
+ }
281
+ if (finished) {
282
+ finished();
283
+ }
284
+ }
285
+ else if (prevented) {
286
+ prevented();
287
+ }
288
+ }
289
+ }
290
+ requiresZone(toExecute) {
291
+ const actions = toExecute || this.actions;
292
+ const owner = this.owner;
293
+ const contextService = owner.contextService;
294
+ for (let idx = 0; idx < actions.length; idx++) {
295
+ const action = actions[idx];
296
+ const name = action.name;
297
+ if (action.requiresZone || (name && (hasObservers(owner[name]) || (contextService && contextService.hasObservers(name))))) {
298
+ return true;
299
+ }
300
+ }
301
+ return false;
302
+ }
303
+ closeChildren(item) {
304
+ if (!item.opened) {
305
+ return;
306
+ }
307
+ const children = this.items.children(item);
308
+ this.closeItems(children);
309
+ }
310
+ closeItems(items) {
311
+ for (let idx = 0; idx < items.length; idx++) {
312
+ this.close(items[idx]);
313
+ }
314
+ }
315
+ }
316
+ ActionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ActionsService, deps: [{ token: i0.NgZone }, { token: ItemsService }], target: i0.ɵɵFactoryTarget.Injectable });
317
+ ActionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ActionsService });
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ActionsService, decorators: [{
319
+ type: Injectable
320
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: ItemsService }]; } });
321
+
322
+ const DEFAULT_ACTIVE = '0';
323
+ const NO_SPACE_REGEX = /\S/;
324
+ const handlers = {};
325
+ handlers['37'] = 'left';
326
+ handlers['39'] = 'right';
327
+ handlers['38'] = 'up';
328
+ handlers['40'] = 'down';
329
+ handlers['36'] = 'home';
330
+ handlers['35'] = 'end';
331
+ handlers['32'] = 'enter';
332
+ handlers['13'] = 'enter';
333
+ handlers['27'] = 'esc';
334
+ handlers['9'] = 'tab';
335
+ const handlersRTL = Object.assign({}, handlers, {
336
+ '37': 'right',
337
+ '39': 'left'
338
+ });
339
+ function isPrintableCharacter(key) {
340
+ return key.length === 1 && NO_SPACE_REGEX.test(key);
341
+ }
342
+ const resolvedPromise = Promise.resolve(null);
343
+ /**
344
+ * @hidden
345
+ */
346
+ class NavigationService {
347
+ constructor(items, actions, localization, ngZone) {
348
+ this.items = items;
349
+ this.actions = actions;
350
+ this.localization = localization;
351
+ this.ngZone = ngZone;
352
+ this.vertical = false;
353
+ this.activeIndex = DEFAULT_ACTIVE;
354
+ }
355
+ get focusedItem() {
356
+ return this.items.get(this.focusedIdx);
357
+ }
358
+ get activeItem() {
359
+ return this.items.get(this.activeIndex);
360
+ }
361
+ get handlers() {
362
+ return this.localization.rtl ? handlersRTL : handlers;
363
+ }
364
+ focus(item) {
365
+ if (item.index === this.focusedIdx) {
366
+ return;
367
+ }
368
+ if (!this.activeItem || !this.items.hasParent(item, this.activeItem)) {
369
+ this.setActive(item);
370
+ }
371
+ this.setFocus(item);
372
+ }
373
+ setFocus(item) {
374
+ this.focusedIdx = item.index;
375
+ item.focus();
376
+ }
377
+ focusLeave() {
378
+ const focused = this.focusedItem;
379
+ if (focused) {
380
+ this.actions.closeToRoot(focused);
381
+ this.actions.execute();
382
+ }
383
+ this.focusedIdx = null;
384
+ }
385
+ updateActive() {
386
+ if (!this.activeItem && this.items.hasItems) {
387
+ const firstItem = this.items.get(DEFAULT_ACTIVE);
388
+ firstItem.toggleActive(true);
389
+ this.ngZone.runOutsideAngular(() => {
390
+ resolvedPromise.then(() => {
391
+ this.activeIndex = DEFAULT_ACTIVE;
392
+ });
393
+ });
394
+ }
395
+ }
396
+ keydown(e) {
397
+ const current = this.focusedItem || this.activeItem;
398
+ const handler = this.handlers[e.keyCode];
399
+ if (!current) {
400
+ return;
401
+ }
402
+ if (handler) {
403
+ if (handler !== 'tab') {
404
+ e.preventDefault();
405
+ }
406
+ this[handler](current, e);
407
+ }
408
+ else if (isPrintableCharacter(e.key)) {
409
+ this.search(current, e.key);
410
+ }
411
+ this.actions.execute();
412
+ }
413
+ focusIndex(index) {
414
+ if (!index && this.activeItem) {
415
+ this.setFocus(this.activeItem);
416
+ }
417
+ else if (index === 'first') {
418
+ this.focusFirst();
419
+ }
420
+ else if (index === 'last') {
421
+ this.focusLast();
422
+ }
423
+ else {
424
+ const item = this.items.get(index);
425
+ if (item) {
426
+ this.focus(item);
427
+ }
428
+ }
429
+ }
430
+ focusFirst() {
431
+ const items = this.items.siblings(this.items.get('0'));
432
+ this.focus(items[0]);
433
+ }
434
+ focusLast() {
435
+ const items = this.items.siblings(this.items.get('0'));
436
+ this.focus(items[items.length - 1]);
437
+ }
438
+ search(current, key) {
439
+ const siblings = this.items.siblings(current);
440
+ const startIndex = siblings.indexOf(current);
441
+ const items = siblings.slice(startIndex + 1).concat(siblings.slice(0, startIndex));
442
+ for (let idx = 0; idx < items.length; idx++) {
443
+ const sibling = items[idx];
444
+ const text = sibling.item.text || "";
445
+ if (text.toLowerCase().startsWith(key.toLowerCase())) {
446
+ this.focus(sibling);
447
+ break;
448
+ }
449
+ }
450
+ }
451
+ down(current) {
452
+ if (current.level === 0 && !this.vertical) {
453
+ if (current.hasContent) {
454
+ this.actions.open(current, this.focusChild(current, 0));
455
+ }
456
+ }
457
+ else {
458
+ this.focus(this.items.next(current));
459
+ }
460
+ }
461
+ up(current) {
462
+ if (current.level === 0 && !this.vertical) {
463
+ if (current.hasContent) {
464
+ this.actions.open(current, this.focusChild(current, current.children.length - 1));
465
+ }
466
+ }
467
+ else {
468
+ this.focus(this.items.previous(current));
469
+ }
470
+ }
471
+ left(current) {
472
+ if (this.vertical && current.level === 0 && current.disabled) {
473
+ return;
474
+ }
475
+ if (current.level > 1 || (this.vertical && current.level > 0)) {
476
+ const parent = this.items.parent(current);
477
+ this.focus(parent);
478
+ this.actions.close(parent);
479
+ }
480
+ else if (this.vertical && current.level === 0 && !current.disabled) {
481
+ if (current.hasContent) {
482
+ this.actions.open(current, this.focusChild(current, current.children.length - 1));
483
+ }
484
+ }
485
+ else {
486
+ this.focus(this.items.previous(this.activeItem));
487
+ }
488
+ }
489
+ right(current) {
490
+ if (this.vertical && current.level === 0 && current.disabled) {
491
+ return;
492
+ }
493
+ if (current.horizontal && !current.disabled) {
494
+ if (current.hasContent) {
495
+ this.actions.open(current, this.focusChild(current, 0));
496
+ }
497
+ else if (!this.vertical || current.level > 0) {
498
+ this.focus(this.items.next(this.activeItem));
499
+ }
500
+ }
501
+ else {
502
+ this.focus(this.items.next(this.activeItem));
503
+ }
504
+ }
505
+ home(current) {
506
+ const siblings = this.items.siblings(current);
507
+ this.focus(siblings[0]);
508
+ }
509
+ end(current) {
510
+ const siblings = this.items.siblings(current);
511
+ this.focus(siblings[siblings.length - 1]);
512
+ }
513
+ enter(current, domEvent) {
514
+ const actions = this.actions;
515
+ if (current.disabled) {
516
+ return;
517
+ }
518
+ if (current.hasContent) {
519
+ actions.select(current, domEvent);
520
+ actions.open(current, this.focusChild(current, 0));
521
+ }
522
+ else {
523
+ actions.select(current, domEvent, null, () => {
524
+ current.navigate();
525
+ });
526
+ this.focus(this.items.root(current));
527
+ actions.closeToRoot(current);
528
+ }
529
+ }
530
+ esc(current) {
531
+ if (current.level > 0) {
532
+ const parent = this.items.parent(current);
533
+ this.actions.close(parent);
534
+ this.focus(parent);
535
+ }
536
+ }
537
+ tab(current) {
538
+ if (current.level > 0) {
539
+ this.activeItem.focus();
540
+ }
541
+ }
542
+ focusChild(item, index) {
543
+ return () => {
544
+ const child = this.items.children(item)[index];
545
+ this.setFocus(child);
546
+ };
547
+ }
548
+ setActive(item) {
549
+ const focused = this.focusedItem;
550
+ const active = this.items.root(item);
551
+ if (this.activeItem) {
552
+ this.activeItem.toggleActive(false);
553
+ }
554
+ this.activeIndex = active.index;
555
+ active.toggleActive(true);
556
+ if (focused) {
557
+ this.actions.closeToRoot(focused);
558
+ if (focused.level > 0) {
559
+ this.actions.open(active);
560
+ }
561
+ }
562
+ }
563
+ }
564
+ NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", 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: "13.3.11", ngImport: i0, type: NavigationService });
566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NavigationService, decorators: [{
567
+ type: Injectable
568
+ }], ctorParameters: function () { return [{ type: ItemsService }, { type: ActionsService }, { type: i3.LocalizationService }, { type: i0.NgZone }]; } });
569
+
570
+ const DISABLE_OPEN_ON_OVER_DELAY = 500;
571
+ /**
572
+ * @hidden
573
+ */
574
+ class HoverService {
575
+ constructor(actions, items) {
576
+ this.actions = actions;
577
+ this.items = items;
578
+ this.delay = 100;
579
+ this._openOnOver = true;
580
+ this.scheduled = [];
581
+ }
582
+ get openOnOver() {
583
+ return this._openOnOver;
584
+ }
585
+ set openOnOver(value) {
586
+ this.cancelActions();
587
+ this._openOnOver = value;
588
+ }
589
+ get hovered() {
590
+ return this.items.get(this.hoveredIdx);
591
+ }
592
+ set hovered(item) {
593
+ this.hoveredIdx = item ? item.index : null;
594
+ }
595
+ ngOnDestroy() {
596
+ this.cancelActions();
597
+ }
598
+ over(item) {
599
+ this.cancelActions((action) => action.name === 'openOnOver');
600
+ if (!this.hovered || this.hovered !== item) {
601
+ this.actions.closeOthers(item);
602
+ this.hovered = item;
603
+ if ((item.level > 0 || this.openOnOver) && !item.disabled) {
604
+ this.actions.open(item);
605
+ this.cancelActions((action) => (action.name === 'close' && (item === action.item || this.items.hasParent(item, action.item))) ||
606
+ (action.name === 'open' && !this.items.hasParent(item, action.item)));
607
+ }
608
+ this.scheduleActions();
609
+ }
610
+ }
611
+ leave(disableOpenOnOver) {
612
+ const hovered = this.hovered;
613
+ if (hovered) {
614
+ this.actions.closeToRoot(hovered);
615
+ this.cancelActions(action => action.name === 'open');
616
+ this.scheduleActions();
617
+ }
618
+ if (disableOpenOnOver && this._openOnOver) {
619
+ this.scheduleDisableOpenOnOver();
620
+ }
621
+ this.hovered = null;
622
+ }
623
+ closeCurrent() {
624
+ const hovered = this.hovered;
625
+ if (hovered) {
626
+ this.actions.closeToRoot(hovered);
627
+ this.hovered = null;
628
+ }
629
+ }
630
+ scheduleActions() {
631
+ if (this.actions.hasPending) {
632
+ const item = {};
633
+ item.actions = this.actions.clear();
634
+ item.id = setTimeout(() => {
635
+ this.actions.execute(item.actions);
636
+ this.removeScheduled(item);
637
+ }, this.delay);
638
+ this.scheduled.push(item);
639
+ }
640
+ }
641
+ scheduleDisableOpenOnOver() {
642
+ const item = {
643
+ actions: [{ name: 'openOnOver' }]
644
+ };
645
+ item.id = setTimeout(() => {
646
+ this._openOnOver = false;
647
+ this.removeScheduled(item);
648
+ }, Math.max(this.delay, DISABLE_OPEN_ON_OVER_DELAY));
649
+ this.scheduled.push(item);
650
+ }
651
+ removeScheduled(item) {
652
+ const scheduled = this.scheduled;
653
+ for (let idx = 0; idx < scheduled.length; idx++) {
654
+ if (scheduled[idx] === item) {
655
+ scheduled.splice(idx, 1);
656
+ return;
657
+ }
658
+ }
659
+ }
660
+ cancelActions(predicate) {
661
+ const scheduled = this.scheduled;
662
+ for (let idx = scheduled.length - 1; idx >= 0; idx--) {
663
+ const item = scheduled[idx];
664
+ const actions = item.actions;
665
+ if (predicate) {
666
+ for (let actionIdx = actions.length - 1; actionIdx >= 0; actionIdx--) {
667
+ if (predicate(actions[actionIdx])) {
668
+ actions.splice(actionIdx, 1);
669
+ }
670
+ }
671
+ }
672
+ if (!predicate || actions.length === 0) {
673
+ clearTimeout(item.id);
674
+ scheduled.splice(idx, 1);
675
+ }
676
+ }
677
+ }
678
+ }
679
+ HoverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HoverService, deps: [{ token: ActionsService }, { token: ItemsService }], target: i0.ɵɵFactoryTarget.Injectable });
680
+ HoverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HoverService });
681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HoverService, decorators: [{
682
+ type: Injectable
683
+ }], ctorParameters: function () { return [{ type: ActionsService }, { type: ItemsService }]; } });
684
+
685
+ /**
686
+ * @hidden
687
+ */
688
+ const normalize = (settings) => settings && Object.assign({
689
+ toggle: 'select'
690
+ }, settings);
691
+
692
+ /**
693
+ * @hidden
694
+ */
695
+ const NODE_INDEX = 'data-kendo-menu-index';
696
+
697
+ const DEFAULT_ID = 'kendo-matches-container';
698
+ const focusableRegex = /^(?:a|input|select|option|textarea|button|object)$/i;
699
+ const matches = (element, selector) => (element.matches || element.msMatchesSelector).call(element, selector);
700
+ /**
701
+ * @hidden
702
+ */
703
+ const closest = (node, predicate) => {
704
+ while (node && !predicate(node)) {
705
+ node = node.parentNode;
706
+ }
707
+ return node;
708
+ };
709
+ /**
710
+ * @hidden
711
+ */
712
+ const closestInScope = (node, predicate, scope) => {
713
+ while (node && node !== scope && !predicate(node)) {
714
+ node = node.parentNode;
715
+ }
716
+ if (node !== scope) {
717
+ return node;
718
+ }
719
+ };
720
+ /**
721
+ * @hidden
722
+ */
723
+ const isFocusable = (element) => {
724
+ if (element.tagName) {
725
+ const tagName = element.tagName.toLowerCase();
726
+ const tabIndex = element.getAttribute('tabIndex');
727
+ const skipTab = tabIndex === '-1';
728
+ let focusable = tabIndex !== null && !skipTab;
729
+ if (focusableRegex.test(tagName)) {
730
+ focusable = !element.disabled && !skipTab;
731
+ }
732
+ return focusable;
733
+ }
734
+ return false;
735
+ };
736
+ const toClassList = (classNames) => String(classNames).trim().split(' ');
737
+ /**
738
+ * @hidden
739
+ */
740
+ const hasClass = (element, name) => {
741
+ return toClassList(element.className).indexOf(name) >= 0;
742
+ };
743
+ /**
744
+ * @hidden
745
+ */
746
+ const matchesClasses = (classes) => {
747
+ const list = toClassList(classes);
748
+ return (element) => {
749
+ const classList = toClassList(element.className);
750
+ return Boolean(list.find(name => classList.indexOf(name) >= 0));
751
+ };
752
+ };
753
+ /**
754
+ * @hidden
755
+ */
756
+ const nodeIndex = (node) => node.getAttribute(NODE_INDEX);
757
+ /**
758
+ * @hidden
759
+ */
760
+ const closestItem = (node, scope) => closestInScope(node, nodeIndex, scope);
761
+ /**
762
+ * @hidden
763
+ */
764
+ const closestList = (node) => {
765
+ let list = closest(node, matchesClasses('k-menu-popup k-menu k-menu-group'));
766
+ if (list && hasClass(list, 'k-menu-popup')) {
767
+ list = list.querySelector('.k-menu-group');
768
+ }
769
+ return list;
770
+ };
771
+ /**
772
+ * @hidden
773
+ */
774
+ const inMenu = (node, itemsService) => {
775
+ if (node === itemsService.lists[0].element.nativeElement) {
776
+ return false;
777
+ }
778
+ const list = closestList(node);
779
+ return list && itemsService.containsList(list);
780
+ };
781
+ /**
782
+ * @hidden
783
+ */
784
+ const findInContainer = (element, selector, container) => {
785
+ const id = container.getAttribute('id');
786
+ if (!id) {
787
+ container.setAttribute('id', DEFAULT_ID);
788
+ }
789
+ const contextSelector = `#${id || DEFAULT_ID} ${selector}`;
790
+ const match = closestInScope(element, node => matches(node, contextSelector), container);
791
+ if (!id) {
792
+ container.removeAttribute('id');
793
+ }
794
+ return match;
795
+ };
796
+
797
+ /**
798
+ * Represents a template for the Menu items ([see example]({% slug templates_menu %})). To define a template
799
+ * for an item, nest an `<ng-template>` tag with the `kendoMenuItemTemplate` directive inside a `<kendo-menu-item>`
800
+ * component. To define a template for all Menu items, nest the template inside the `<kendo-menu>` component.
801
+ *
802
+ * The available fields in the template context are:
803
+ * - `item`&mdash;The item data.
804
+ * - `index`&mdash;The item index.
805
+ *
806
+ * @example
807
+ * ```ts-preview
808
+ *
809
+ * _@Component({
810
+ * selector: 'my-app',
811
+ * template: `
812
+ * <kendo-menu>
813
+ * <kendo-menu-item text="item2">
814
+ * <ng-template kendoMenuItemTemplate let-item="item" let-index="index">
815
+ * <div style="padding: 10px;">
816
+ * My Template for: {{ item.text }} at index: {{ index }}
817
+ * </div>
818
+ * </ng-template>
819
+ * </kendo-menu-item>
820
+ * </kendo-menu>
821
+ * `
822
+ * })
823
+ *
824
+ * class AppComponent {
825
+ * }
826
+ * ```
827
+ */
828
+ class ItemTemplateDirective {
829
+ constructor(templateRef) {
830
+ this.templateRef = templateRef;
831
+ }
832
+ }
833
+ ItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
834
+ ItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ItemTemplateDirective, selector: "[kendoMenuItemTemplate]", ngImport: i0 });
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemTemplateDirective, decorators: [{
836
+ type: Directive,
837
+ args: [{
838
+ selector: '[kendoMenuItemTemplate]'
839
+ }]
840
+ }], ctorParameters: function () {
841
+ return [{ type: i0.TemplateRef, decorators: [{
842
+ type: Optional
843
+ }] }];
844
+ } });
845
+
846
+ /**
847
+ * Represents a template for the links of the Menu items ([see example]({% slug templates_menu %})). To define a template
848
+ * for an item, nest an `<ng-template>` tag with the `kendoMenuItemLinkTemplate` directive inside a `<kendo-menu-item>`
849
+ * component. To define a template for all Menu items, nest the template inside the `<kendo-menu>` component.
850
+ *
851
+ * The available fields in the template context are:
852
+ * - `item`&mdash;The item data.
853
+ * - `index`&mdash;The item index.
854
+ *
855
+ * @example
856
+ * ```ts-preview
857
+ *
858
+ * _@Component({
859
+ * selector: 'my-app',
860
+ * template: `
861
+ * <kendo-menu>
862
+ * <kendo-menu-item text="item2">
863
+ * <ng-template kendoMenuItemLinkTemplate let-item="item" let-index="index">
864
+ * <span [kendoMenuItemLink]="index">
865
+ * {{ item.text }}
866
+ * <span *ngIf="item.items && item.items.length" [kendoMenuExpandArrow]="index"></span>
867
+ * </span>
868
+ * </ng-template>
869
+ * </kendo-menu-item>
870
+ * </kendo-menu>
871
+ * `
872
+ * })
873
+ *
874
+ * class AppComponent {
875
+ * }
876
+ * ```
877
+ */
878
+ class ItemLinkTemplateDirective {
879
+ constructor(templateRef) {
880
+ this.templateRef = templateRef;
881
+ }
882
+ }
883
+ ItemLinkTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemLinkTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
884
+ ItemLinkTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ItemLinkTemplateDirective, selector: "[kendoMenuItemLinkTemplate]", ngImport: i0 });
885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemLinkTemplateDirective, decorators: [{
886
+ type: Directive,
887
+ args: [{
888
+ selector: '[kendoMenuItemLinkTemplate]'
889
+ }]
890
+ }], ctorParameters: function () {
891
+ return [{ type: i0.TemplateRef, decorators: [{
892
+ type: Optional
893
+ }] }];
894
+ } });
895
+
896
+ /**
897
+ * Represents a template for the content of the Menu items ([see example]({% slug templates_menu %})). To define the template,
898
+ * nest an `<ng-template>` tag with the `kendoMenuItemContentTemplate` directive inside a `<kendo-menu-item>` component.
899
+ *
900
+ * The available fields in the template context are:
901
+ * - `item`&mdash;The item data.
902
+ * - `index`&mdash;The item index.
903
+ *
904
+ * @example
905
+ * ```ts-preview
906
+ *
907
+ * _@Component({
908
+ * selector: 'my-app',
909
+ * template: `
910
+ * <kendo-menu>
911
+ * <kendo-menu-item text="item2">
912
+ * <ng-template kendoMenuItemContentTemplate let-item="item" let-index="index">
913
+ * <div style="padding: 10px;">
914
+ * My Content Template for: {{ item.text }} at index: {{ index }}
915
+ * </div>
916
+ * </ng-template>
917
+ * </kendo-menu-item>
918
+ * </kendo-menu>
919
+ * `
920
+ * })
921
+ *
922
+ * class AppComponent {
923
+ * }
924
+ * ```
925
+ */
926
+ class ItemContentTemplateDirective {
927
+ constructor(templateRef) {
928
+ this.templateRef = templateRef;
929
+ }
930
+ }
931
+ ItemContentTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
932
+ ItemContentTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ItemContentTemplateDirective, selector: "[kendoMenuItemContentTemplate]", ngImport: i0 });
933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemContentTemplateDirective, decorators: [{
934
+ type: Directive,
935
+ args: [{
936
+ selector: '[kendoMenuItemContentTemplate]'
937
+ }]
938
+ }], ctorParameters: function () {
939
+ return [{ type: i0.TemplateRef, decorators: [{
940
+ type: Optional
941
+ }] }];
942
+ } });
943
+
944
+ /**
945
+ * A component that can be used to specify the Menu items
946
+ * ([more information and examples]({% slug items_menu %})).
947
+ *
948
+ * @example
949
+ * ```ts-preview
950
+ *
951
+ * _@Component({
952
+ * selector: 'my-app',
953
+ * template: `
954
+ * <kendo-menu>
955
+ * <kendo-menu-item text="item1">
956
+ * <kendo-menu-item text="item1.1" url="https://example.com">
957
+ * </kendo-menu-item>
958
+ * <kendo-menu-item text="item1.2" [disabled]="true">
959
+ * </kendo-menu-item>
960
+ * </kendo-menu-item>
961
+ * <kendo-menu-item text="item2">
962
+ * <ng-template kendoMenuItemContentTemplate let-item="item">
963
+ * <div style="padding: 10px;">
964
+ * My Content Template: {{ item.text }}
965
+ * </div>
966
+ * </ng-template>
967
+ * <ng-template kendoMenuItemTemplate let-item="item">
968
+ * <div style="padding: 10px;">
969
+ * My Template: {{ item.text }}
970
+ * </div>
971
+ * </ng-template>
972
+ * </kendo-menu-item>
973
+ * <kendo-menu-item text="item3">
974
+ * <ng-template kendoMenuItemLinkTemplate let-item="item" let-index="index">
975
+ * <span [kendoMenuItemLink]="index">
976
+ * {{ item.text }}
977
+ * <span *ngIf="item.items && item.items.length" [kendoMenuExpandArrow]="index"></span>
978
+ * </span>
979
+ * </ng-template>
980
+ * </kendo-menu-item>
981
+ * </kendo-menu>
982
+ * `
983
+ * })
984
+ *
985
+ * class AppComponent {
986
+ * }
987
+ * ```
988
+ */
989
+ class MenuItemComponent {
990
+ /**
991
+ * @hidden
992
+ */
993
+ get template() {
994
+ if (this.itemTemplate && this.itemTemplate.length) {
995
+ return this.itemTemplate.first.templateRef;
996
+ }
997
+ }
998
+ /**
999
+ * @hidden
1000
+ */
1001
+ get linkTemplate() {
1002
+ if (this.itemLinkTemplate && this.itemLinkTemplate.length) {
1003
+ return this.itemLinkTemplate.first.templateRef;
1004
+ }
1005
+ }
1006
+ /**
1007
+ * @hidden
1008
+ */
1009
+ get contentTemplate() {
1010
+ if (this.itemContentTemplate && this.itemContentTemplate.length) {
1011
+ return this.itemContentTemplate.first.templateRef;
1012
+ }
1013
+ }
1014
+ /**
1015
+ * @hidden
1016
+ */
1017
+ get items() {
1018
+ if (this.children.length) {
1019
+ return this.children.toArray().filter(c => c !== this);
1020
+ }
1021
+ }
1022
+ }
1023
+ MenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1024
+ MenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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 });
1025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuItemComponent, decorators: [{
1026
+ type: Component,
1027
+ args: [{
1028
+ selector: 'kendo-menu-item',
1029
+ template: ``
1030
+ }]
1031
+ }], propDecorators: { text: [{
1032
+ type: Input
1033
+ }], url: [{
1034
+ type: Input
1035
+ }], disabled: [{
1036
+ type: Input
1037
+ }], cssClass: [{
1038
+ type: Input
1039
+ }], cssStyle: [{
1040
+ type: Input
1041
+ }], icon: [{
1042
+ type: Input
1043
+ }], data: [{
1044
+ type: Input
1045
+ }], separator: [{
1046
+ type: Input
1047
+ }], itemTemplate: [{
1048
+ type: ContentChildren,
1049
+ args: [ItemTemplateDirective]
1050
+ }], itemLinkTemplate: [{
1051
+ type: ContentChildren,
1052
+ args: [ItemLinkTemplateDirective]
1053
+ }], itemContentTemplate: [{
1054
+ type: ContentChildren,
1055
+ args: [ItemContentTemplateDirective]
1056
+ }], children: [{
1057
+ type: ContentChildren,
1058
+ args: [MenuItemComponent]
1059
+ }] } });
1060
+
1061
+ /**
1062
+ * @hidden
1063
+ */
1064
+ class MenuBase {
1065
+ constructor() {
1066
+ /**
1067
+ * Specifies if the Menu will be vertical ([see example]({% slug vertical_menu %})).
1068
+ */
1069
+ this.vertical = false;
1070
+ /**
1071
+ * Specifies that the root items can be opened only on click
1072
+ * ([see example]({% slug openclose_menu %}#toc-opening-on-click)).
1073
+ */
1074
+ this.openOnClick = false;
1075
+ /**
1076
+ * Specifies the delay in milliseconds before the Menu items are opened or closed on item hover
1077
+ * or leave ([see example]({% slug openclose_menu %}#toc-delay-on-hover)). Used to avoid the accidental
1078
+ * opening or closing of the items.
1079
+ */
1080
+ this.hoverDelay = 100;
1081
+ /**
1082
+ * Sets the Menu animation.
1083
+ */
1084
+ this.animate = true;
1085
+ /**
1086
+ * Sets the Menu size.
1087
+ *
1088
+ * The possible values are:
1089
+ * * `small`
1090
+ * * `medium` (default)
1091
+ * * `large`
1092
+ * * `none`
1093
+ *
1094
+ */
1095
+ this.size = 'medium';
1096
+ }
1097
+ /**
1098
+ * @hidden
1099
+ */
1100
+ get rootItems() {
1101
+ return this.items || (this.children ? this.children.toArray() : []);
1102
+ }
1103
+ }
1104
+ MenuBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1105
+ MenuBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MenuBase, selector: "kendo-menu-base", inputs: { items: "items", vertical: "vertical", openOnClick: "openOnClick", hoverDelay: "hoverDelay", animate: "animate", size: "size" }, queries: [{ propertyName: "itemTemplate", predicate: ItemTemplateDirective }, { propertyName: "itemLinkTemplate", predicate: ItemLinkTemplateDirective }, { propertyName: "children", predicate: MenuItemComponent }], ngImport: i0, template: ``, isInline: true });
1106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuBase, decorators: [{
1107
+ type: Component,
1108
+ args: [{
1109
+ selector: 'kendo-menu-base',
1110
+ template: ``
1111
+ }]
1112
+ }], propDecorators: { items: [{
1113
+ type: Input
1114
+ }], vertical: [{
1115
+ type: Input
1116
+ }], openOnClick: [{
1117
+ type: Input
1118
+ }], hoverDelay: [{
1119
+ type: Input
1120
+ }], animate: [{
1121
+ type: Input
1122
+ }], size: [{
1123
+ type: Input
1124
+ }], itemTemplate: [{
1125
+ type: ContentChildren,
1126
+ args: [ItemTemplateDirective]
1127
+ }], itemLinkTemplate: [{
1128
+ type: ContentChildren,
1129
+ args: [ItemLinkTemplateDirective]
1130
+ }], children: [{
1131
+ type: ContentChildren,
1132
+ args: [MenuItemComponent]
1133
+ }] } });
1134
+
1135
+ /**
1136
+ * @hidden
1137
+ */
1138
+ const defined = (value) => typeof value !== 'undefined';
1139
+ /**
1140
+ * @hidden
1141
+ */
1142
+ const bodyFactory = () => {
1143
+ if (isDocumentAvailable()) {
1144
+ return new ElementRef(document.body);
1145
+ }
1146
+ };
1147
+ /**
1148
+ * @hidden
1149
+ */
1150
+ const getSizeClass = (size) => {
1151
+ const SIZE_CLASSES = {
1152
+ 'small': 'k-menu-group-sm',
1153
+ 'medium': 'k-menu-group-md',
1154
+ 'large': 'k-menu-group-lg'
1155
+ };
1156
+ return SIZE_CLASSES[size];
1157
+ };
1158
+
1159
+ /**
1160
+ * @hidden
1161
+ */
1162
+ class ContextMenuService {
1163
+ constructor() {
1164
+ this.keydown = new EventEmitter();
1165
+ }
1166
+ emit(name, args) {
1167
+ this.owner.emitMenuEvent(name, args);
1168
+ }
1169
+ hasObservers(name) {
1170
+ return this.owner && hasObservers(this.owner[name]);
1171
+ }
1172
+ leaveMenu(e) {
1173
+ return this.items ? !inMenu(e.target, this.items) : true;
1174
+ }
1175
+ }
1176
+ ContextMenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1177
+ ContextMenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuService });
1178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuService, decorators: [{
1179
+ type: Injectable
1180
+ }] });
1181
+
1182
+ const POPUP_ALIGN = {
1183
+ vertical: 'top',
1184
+ horizontal: 'left'
1185
+ };
1186
+ const POPUP_ALIGN_RTL = {
1187
+ vertical: 'top',
1188
+ horizontal: 'right'
1189
+ };
1190
+ const VERTICAL_COLLISION = {
1191
+ vertical: 'flip',
1192
+ horizontal: 'fit'
1193
+ };
1194
+ const HORIZONTAL_COLLISION = {
1195
+ vertical: 'fit',
1196
+ horizontal: 'flip'
1197
+ };
1198
+ /**
1199
+ * @hidden
1200
+ */
1201
+ const POPUP_SETTINGS_RTL = {
1202
+ vertical: {
1203
+ anchor: {
1204
+ vertical: 'bottom',
1205
+ horizontal: 'right'
1206
+ },
1207
+ popup: POPUP_ALIGN_RTL,
1208
+ collision: VERTICAL_COLLISION,
1209
+ animate: 'down'
1210
+ },
1211
+ horizontal: {
1212
+ anchor: {
1213
+ vertical: 'top',
1214
+ horizontal: 'left'
1215
+ },
1216
+ popup: POPUP_ALIGN_RTL,
1217
+ collision: HORIZONTAL_COLLISION,
1218
+ animate: 'left'
1219
+ }
1220
+ };
1221
+ /**
1222
+ * @hidden
1223
+ */
1224
+ const POPUP_SETTINGS = {
1225
+ vertical: {
1226
+ anchor: {
1227
+ vertical: 'bottom',
1228
+ horizontal: 'left'
1229
+ },
1230
+ popup: POPUP_ALIGN,
1231
+ collision: VERTICAL_COLLISION,
1232
+ animate: 'down'
1233
+ },
1234
+ horizontal: {
1235
+ anchor: {
1236
+ vertical: 'top',
1237
+ horizontal: 'right'
1238
+ },
1239
+ popup: POPUP_ALIGN,
1240
+ collision: HORIZONTAL_COLLISION,
1241
+ animate: 'right'
1242
+ }
1243
+ };
1244
+
1245
+ /* eslint-disable @angular-eslint/component-selector */
1246
+ /**
1247
+ * @hidden
1248
+ */
1249
+ class ListComponent {
1250
+ constructor(itemsService, hover, actions, navigation, renderer, ngZone, element) {
1251
+ this.itemsService = itemsService;
1252
+ this.hover = hover;
1253
+ this.actions = actions;
1254
+ this.navigation = navigation;
1255
+ this.renderer = renderer;
1256
+ this.ngZone = ngZone;
1257
+ this.element = element;
1258
+ this.animate = true;
1259
+ this.size = 'medium';
1260
+ }
1261
+ hierarchyIndex(index) {
1262
+ return this.itemsService.itemIndex(this.index, index);
1263
+ }
1264
+ ngOnInit() {
1265
+ this.itemsService.addList(this);
1266
+ this.initDomEvents();
1267
+ }
1268
+ ngOnDestroy() {
1269
+ this.itemsService.removeList(this);
1270
+ if (this.domSubscriptions) {
1271
+ this.domSubscriptions();
1272
+ }
1273
+ }
1274
+ initDomEvents() {
1275
+ if (!isDocumentAvailable() || !this.element) {
1276
+ return;
1277
+ }
1278
+ this.ngZone.runOutsideAngular(() => {
1279
+ const element = this.element.nativeElement;
1280
+ const container = this.level > 0 ? closest(element, (node) => hasClass(node, 'k-popup')) : element;
1281
+ const overSubscription = this.renderer.listen(element, 'mouseover', (e) => {
1282
+ if (e.target === element && this.level === 0) {
1283
+ this.onLeave();
1284
+ }
1285
+ else {
1286
+ const item = this.nodeItem(e.target) || this.itemsService.get(this.index);
1287
+ if (item && !(this.openOnClick && this.openOnClick.toggle === 'click' && item.level === 0 && !item.hasContent)) {
1288
+ this.hover.over(item);
1289
+ }
1290
+ }
1291
+ });
1292
+ const leaveSubscription = this.renderer.listen(container, 'mouseleave', (e) => {
1293
+ if (this.leavesMenu(e)) {
1294
+ this.onLeave();
1295
+ }
1296
+ });
1297
+ const keydownSubscription = this.renderer.listen(element, 'keydown', (e) => {
1298
+ if (hasClass(e.target, 'k-menu-item')) {
1299
+ this.navigation.keydown(e);
1300
+ }
1301
+ });
1302
+ const blurSubscription = this.renderer.listen(element, 'focusout', (e) => {
1303
+ if (this.leavesMenu(e)) {
1304
+ this.navigation.focusLeave();
1305
+ }
1306
+ });
1307
+ /**
1308
+ * Handle focus/blur open/close for iOS devices since it behaves inconsistently with the rest
1309
+ * Refer to: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
1310
+ */
1311
+ const touchSubscription = this.renderer.listen(document, 'touchstart', (e) => {
1312
+ if (inMenu(e.target, this.itemsService)) {
1313
+ const item = this.nodeItem(e.target);
1314
+ // Needs to be called because the 'click' handler will be called only on secondary tap and the item will remain unfocused
1315
+ this.navigation.focus(item);
1316
+ // This is needed since the 'mouseover' event is not always dispatched
1317
+ if (!item.opened) {
1318
+ this.hover.over(item);
1319
+ }
1320
+ }
1321
+ else if (this.navigation.focusedIdx) {
1322
+ // If the touch is outside of the menu and the menu is not currently in focus
1323
+ const activeItem = this.itemsService.get(this.navigation.activeIndex);
1324
+ this.onLeave(); // needs to be called explicitly since mouseleave event is not triggered
1325
+ activeItem.blur(); // needs to be called explicitly otherwise the item remains focused => triggers focusout
1326
+ }
1327
+ });
1328
+ const clickSubscription = this.renderer.listen(element, 'click', this.clickHandler.bind(this));
1329
+ this.domSubscriptions = () => {
1330
+ overSubscription();
1331
+ leaveSubscription();
1332
+ keydownSubscription();
1333
+ blurSubscription();
1334
+ clickSubscription();
1335
+ touchSubscription();
1336
+ };
1337
+ });
1338
+ }
1339
+ leavesMenu(e) {
1340
+ if (!e.relatedTarget) {
1341
+ return true;
1342
+ }
1343
+ return !inMenu(e.relatedTarget, this.itemsService);
1344
+ }
1345
+ onLeave() {
1346
+ const openOnClick = this.openOnClick;
1347
+ if (!openOnClick || openOnClick.toggle !== 'click') {
1348
+ this.hover.leave(openOnClick && openOnClick.toggle === 'leave');
1349
+ }
1350
+ }
1351
+ nodeItem(target) {
1352
+ const node = closestItem(target, this.element.nativeElement);
1353
+ if (node) {
1354
+ const index = nodeIndex(node);
1355
+ return this.itemsService.get(index);
1356
+ }
1357
+ }
1358
+ clickHandler(e) {
1359
+ if (isFocusable(e.target) && !hasClass(e.target, 'k-menu-item')) {
1360
+ return;
1361
+ }
1362
+ const item = this.nodeItem(e.target);
1363
+ if (!item || item.isContent || item.navigating) {
1364
+ return;
1365
+ }
1366
+ if (item.disabled) {
1367
+ e.preventDefault();
1368
+ return;
1369
+ }
1370
+ this.actions.select(item, e, () => {
1371
+ e.preventDefault();
1372
+ });
1373
+ this.navigation.focus(item);
1374
+ if (item.level > 0 && !item.hasContent) {
1375
+ this.actions.closeToRoot(item);
1376
+ }
1377
+ if (this.openOnClick) {
1378
+ const hover = this.hover;
1379
+ if (item.opened) {
1380
+ if (item.level === 0) {
1381
+ hover.openOnOver = false;
1382
+ this.actions.close(item);
1383
+ }
1384
+ }
1385
+ else if (item.hasContent) {
1386
+ hover.openOnOver = true;
1387
+ this.actions.closeOthers(item);
1388
+ this.actions.open(item);
1389
+ }
1390
+ else {
1391
+ hover.openOnOver = false;
1392
+ if (item.level === 0 && this.openOnClick.toggle === 'click') {
1393
+ this.hover.closeCurrent();
1394
+ }
1395
+ }
1396
+ }
1397
+ this.actions.execute();
1398
+ }
1399
+ }
1400
+ ListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", 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 });
1401
+ ListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ListComponent, selector: "[kendoMenuList]", inputs: { items: "items", level: "level", index: "index", animate: "animate", size: "size", 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\" [size]=\"size\" [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-disabled]=\"item.disabled\"></li>\n <li *ngIf=\"item.separator\" class=\"k-separator k-item\"\n role=\"separator\" [ngClass]=\"item.cssClass\" [ngStyle]=\"item.cssStyle\">\n &nbsp;\n </li>\n </ng-container>\n ", isInline: true, components: [{ type: i0.forwardRef(function () { return ItemComponent; }), selector: "[kendoMenuItem]", inputs: ["item", "level", "index", "siblingIndex", "animate", "size", "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"] }] });
1402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListComponent, decorators: [{
1403
+ type: Component,
1404
+ args: [{
1405
+ selector: '[kendoMenuList]',
1406
+ template: `
1407
+ <ng-container *ngFor="let item of items; let idx = index">
1408
+ <li *ngIf="!item.separator" kendoMenuItem
1409
+ [item]="item" [level]="level" [size]="size" [vertical]="vertical" [animate]="animate" [rtl]="rtl"
1410
+ [itemTemplate]="itemTemplate" [itemLinkTemplate]="itemLinkTemplate" [openOnClick]="openOnClick"
1411
+ [index]="hierarchyIndex(idx)" [siblingIndex]="idx" [attr.${NODE_INDEX}]="hierarchyIndex(idx)"
1412
+ [ngClass]="item.cssClass" [ngStyle]="item.cssStyle"
1413
+ role="menuitem"
1414
+ class="k-item k-menu-item"
1415
+ [class.k-first]="idx === 0" [class.k-last]="idx === items.length - 1"
1416
+ [class.k-disabled]="item.disabled"></li>
1417
+ <li *ngIf="item.separator" class="k-separator k-item"
1418
+ role="separator" [ngClass]="item.cssClass" [ngStyle]="item.cssStyle">
1419
+ &nbsp;
1420
+ </li>
1421
+ </ng-container>
1422
+ `
1423
+ }]
1424
+ }], ctorParameters: function () { return [{ type: ItemsService }, { type: HoverService }, { type: ActionsService }, { type: NavigationService }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { items: [{
1425
+ type: Input
1426
+ }], level: [{
1427
+ type: Input
1428
+ }], index: [{
1429
+ type: Input
1430
+ }], animate: [{
1431
+ type: Input
1432
+ }], size: [{
1433
+ type: Input
1434
+ }], vertical: [{
1435
+ type: Input
1436
+ }], rtl: [{
1437
+ type: Input
1438
+ }], openOnClick: [{
1439
+ type: Input
1440
+ }], itemTemplate: [{
1441
+ type: Input
1442
+ }], itemLinkTemplate: [{
1443
+ type: Input
1444
+ }] } });
1445
+ /**
1446
+ * @hidden
1447
+ */
1448
+ class ItemComponent {
1449
+ constructor(itemsService, navigation, changeDetector, renderer, popupService, element, contextService) {
1450
+ this.itemsService = itemsService;
1451
+ this.navigation = navigation;
1452
+ this.changeDetector = changeDetector;
1453
+ this.renderer = renderer;
1454
+ this.popupService = popupService;
1455
+ this.element = element;
1456
+ this.contextService = contextService;
1457
+ this.animate = true;
1458
+ this.size = 'medium';
1459
+ this.openOnClick = false;
1460
+ this.opened = false;
1461
+ this.navigating = false;
1462
+ this.destroyed = false;
1463
+ }
1464
+ set index(index) {
1465
+ if (this._index && this._index !== index) {
1466
+ this.itemsService.remove(this);
1467
+ this._index = index;
1468
+ this.itemsService.add(this);
1469
+ }
1470
+ else {
1471
+ this._index = index;
1472
+ }
1473
+ this.childId = this.itemsService.childId(index);
1474
+ }
1475
+ get index() {
1476
+ return this._index;
1477
+ }
1478
+ get disabled() {
1479
+ return this.item.disabled;
1480
+ }
1481
+ get hasPopup() {
1482
+ return this.hasContent ? true : null;
1483
+ }
1484
+ get expanded() {
1485
+ return this.hasContent ? this.opened : null;
1486
+ }
1487
+ get label() {
1488
+ return this.item.text ? this.item.text : null;
1489
+ }
1490
+ get activeId() {
1491
+ return this.index === this.navigation.activeIndex ? '0' : '-1';
1492
+ }
1493
+ get popupSettings() {
1494
+ const settings = this.rtl ? POPUP_SETTINGS_RTL : POPUP_SETTINGS;
1495
+ return this.horizontal ? settings.horizontal : settings.vertical;
1496
+ }
1497
+ get horizontal() {
1498
+ return this.vertical || this.level > 0;
1499
+ }
1500
+ get hasLink() {
1501
+ return Boolean(this.item.url);
1502
+ }
1503
+ get linkTemplate() {
1504
+ return this.item.linkTemplate || this.itemLinkTemplate;
1505
+ }
1506
+ get hasContent() {
1507
+ const items = this.item.items;
1508
+ return items && items.length || this.item.contentTemplate;
1509
+ }
1510
+ get isContent() {
1511
+ return Boolean(this.item.content);
1512
+ }
1513
+ get iconClass() {
1514
+ return `k-i-${this.item.icon}`;
1515
+ }
1516
+ get isContextMenu() {
1517
+ return Boolean(this.contextService);
1518
+ }
1519
+ get menuListClasses() {
1520
+ const sizeClass = getSizeClass(this.size);
1521
+ return this.isContextMenu ? `k-context-menu k-menu-group ${sizeClass}` : `k-menu-group ${sizeClass}`;
1522
+ }
1523
+ get children() {
1524
+ const item = this.item;
1525
+ if (item.contentTemplate) {
1526
+ if (!this.contentItems) {
1527
+ this.contentItems = [{
1528
+ content: item.contentTemplate,
1529
+ owner: item,
1530
+ ownerIndex: this.index
1531
+ }];
1532
+ }
1533
+ return this.contentItems;
1534
+ }
1535
+ return item.items;
1536
+ }
1537
+ get template() {
1538
+ return this.item.template || this.itemTemplate;
1539
+ }
1540
+ hasContentTemplates() {
1541
+ const item = this.item;
1542
+ return this.itemTemplate || item.contentTemplate || this.itemLinkTemplate ||
1543
+ (item.items && item.items.find(current => current.template || current.linkTemplate));
1544
+ }
1545
+ ngOnInit() {
1546
+ this.itemsService.add(this);
1547
+ }
1548
+ ngOnDestroy() {
1549
+ this.itemsService.remove(this);
1550
+ this.destroyed = true;
1551
+ if (this.popupRef) {
1552
+ this.popupRef.close();
1553
+ this.popupRef = null;
1554
+ }
1555
+ }
1556
+ focus() {
1557
+ this.element.nativeElement.focus();
1558
+ }
1559
+ blur() {
1560
+ this.element.nativeElement.blur();
1561
+ }
1562
+ toggleActive(isActive) {
1563
+ if (isActive) {
1564
+ this.setAttribute('tabindex', '0');
1565
+ }
1566
+ else {
1567
+ this.setAttribute('tabindex', '-1');
1568
+ }
1569
+ }
1570
+ open() {
1571
+ if (!this.destroyed && this.hasContent && !this.opened) {
1572
+ const popupSettings = this.popupSettings;
1573
+ const animate = this.animate ? Object.assign({}, this.animate, {
1574
+ direction: popupSettings.animate
1575
+ }) : false;
1576
+ this.opened = true;
1577
+ this.popupRef = this.popupService.open({
1578
+ popupAlign: popupSettings.popup,
1579
+ anchorAlign: popupSettings.anchor,
1580
+ collision: popupSettings.collision,
1581
+ anchor: this.element,
1582
+ positionMode: 'absolute',
1583
+ content: this.popupTemplate,
1584
+ popupClass: {
1585
+ 'k-rtl': this.rtl,
1586
+ 'k-menu-popup': true
1587
+ },
1588
+ animate: animate
1589
+ });
1590
+ this.setAttribute('aria-expanded', 'true');
1591
+ this.setAttribute('aria-owns', this.childId);
1592
+ this.changeDetector.detectChanges();
1593
+ }
1594
+ }
1595
+ close() {
1596
+ if (!this.destroyed && this.opened) {
1597
+ this.opened = false;
1598
+ if (this.popupRef) {
1599
+ this.popupRef.close();
1600
+ this.popupRef = null;
1601
+ }
1602
+ this.changeDetector.detectChanges();
1603
+ this.setAttribute('aria-expanded', 'false');
1604
+ this.renderer.removeAttribute(this.element.nativeElement, 'aria-owns');
1605
+ }
1606
+ }
1607
+ navigate() {
1608
+ let link;
1609
+ if (this.linkTemplate) {
1610
+ link = this.element.nativeElement.querySelector('a.k-menu-link');
1611
+ }
1612
+ else if (this.hasLink) {
1613
+ link = this.link.nativeElement;
1614
+ }
1615
+ if (link) {
1616
+ this.navigating = true;
1617
+ link.click();
1618
+ this.navigating = false;
1619
+ }
1620
+ }
1621
+ setAttribute(name, value) {
1622
+ this.renderer.setAttribute(this.element.nativeElement, name, value);
1623
+ }
1624
+ }
1625
+ ItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemComponent, deps: [{ token: ItemsService }, { token: NavigationService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i6.PopupService }, { token: i0.ElementRef }, { token: ContextMenuService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1626
+ ItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ItemComponent, selector: "[kendoMenuItem]", inputs: { item: "item", level: "level", index: "index", siblingIndex: "siblingIndex", animate: "animate", size: "size", 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, {
1627
+ provide: POPUP_CONTAINER,
1628
+ useFactory: bodyFactory
1629
+ }], viewQueries: [{ propertyName: "link", first: true, predicate: ["link"], descendants: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }], ngImport: i0, template: `
1630
+ <span *ngIf="!hasLink && !item.content && !linkTemplate" class="k-link k-menu-link" #link
1631
+ [class.k-active]="opened" role="presentation">
1632
+ <ng-template [ngTemplateOutlet]="itemcontent">
1633
+ </ng-template>
1634
+ </span>
1635
+ <a *ngIf="item.url && !linkTemplate" class="k-link k-menu-link" #link [attr.href]="item.url"
1636
+ [class.k-active]="opened" tabindex="-1" role="presentation">
1637
+ <ng-template [ngTemplateOutlet]="itemcontent">
1638
+ </ng-template>
1639
+ </a>
1640
+ <ng-template *ngIf="linkTemplate && !item.content" [ngTemplateOutlet]="linkTemplate"
1641
+ [ngTemplateOutletContext]="{ item: item, index: index }">
1642
+ </ng-template>
1643
+
1644
+ <div class="k-content" *ngIf="item.content" role="presentation">
1645
+ <ng-template [ngTemplateOutlet]="item.content" [ngTemplateOutletContext]="{ item: item.owner, index: item.ownerIndex }">
1646
+ </ng-template>
1647
+ </div>
1648
+
1649
+ <ng-template #popupTemplate>
1650
+ <ul kendoMenuList
1651
+ [attr.id]="childId"
1652
+ [animate]="animate"
1653
+ [rtl]="rtl"
1654
+ [vertical]="vertical"
1655
+ [size]="size"
1656
+ [openOnClick]="openOnClick"
1657
+ [items]="children"
1658
+ [level]="level + 1"
1659
+ [index]="index"
1660
+ [itemTemplate]="itemTemplate"
1661
+ [itemLinkTemplate]="itemLinkTemplate"
1662
+ [ngClass]="menuListClasses"
1663
+ role="menu">
1664
+ </ul>
1665
+ </ng-template>
1666
+
1667
+ <ng-template #itemcontent>
1668
+ <span *ngIf="item.icon" class="k-icon" [ngClass]="iconClass" role="presentation"></span>
1669
+ <ng-container *ngIf="!template">
1670
+ <span class="k-menu-link-text">{{ item.text }}</span>
1671
+ </ng-container>
1672
+ <ng-template *ngIf="template" [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item, index: index }">
1673
+ </ng-template>
1674
+ <span *ngIf="hasContent" class="k-menu-expand-arrow" role="presentation">
1675
+ <span class="k-icon"
1676
+ [class.k-i-arrow-60-down]="!horizontal"
1677
+ [class.k-i-arrow-60-right]="horizontal && !rtl"
1678
+ [class.k-i-arrow-60-left]="horizontal && rtl"
1679
+ >
1680
+ </span>
1681
+ </span>
1682
+ </ng-template>
1683
+ `, isInline: true, components: [{ type: ListComponent, selector: "[kendoMenuList]", inputs: ["items", "level", "index", "animate", "size", "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"] }] });
1684
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemComponent, decorators: [{
1685
+ type: Component,
1686
+ args: [{
1687
+ providers: [PopupService, {
1688
+ provide: POPUP_CONTAINER,
1689
+ useFactory: bodyFactory
1690
+ }],
1691
+ selector: '[kendoMenuItem]',
1692
+ template: `
1693
+ <span *ngIf="!hasLink && !item.content && !linkTemplate" class="k-link k-menu-link" #link
1694
+ [class.k-active]="opened" role="presentation">
1695
+ <ng-template [ngTemplateOutlet]="itemcontent">
1696
+ </ng-template>
1697
+ </span>
1698
+ <a *ngIf="item.url && !linkTemplate" class="k-link k-menu-link" #link [attr.href]="item.url"
1699
+ [class.k-active]="opened" tabindex="-1" role="presentation">
1700
+ <ng-template [ngTemplateOutlet]="itemcontent">
1701
+ </ng-template>
1702
+ </a>
1703
+ <ng-template *ngIf="linkTemplate && !item.content" [ngTemplateOutlet]="linkTemplate"
1704
+ [ngTemplateOutletContext]="{ item: item, index: index }">
1705
+ </ng-template>
1706
+
1707
+ <div class="k-content" *ngIf="item.content" role="presentation">
1708
+ <ng-template [ngTemplateOutlet]="item.content" [ngTemplateOutletContext]="{ item: item.owner, index: item.ownerIndex }">
1709
+ </ng-template>
1710
+ </div>
1711
+
1712
+ <ng-template #popupTemplate>
1713
+ <ul kendoMenuList
1714
+ [attr.id]="childId"
1715
+ [animate]="animate"
1716
+ [rtl]="rtl"
1717
+ [vertical]="vertical"
1718
+ [size]="size"
1719
+ [openOnClick]="openOnClick"
1720
+ [items]="children"
1721
+ [level]="level + 1"
1722
+ [index]="index"
1723
+ [itemTemplate]="itemTemplate"
1724
+ [itemLinkTemplate]="itemLinkTemplate"
1725
+ [ngClass]="menuListClasses"
1726
+ role="menu">
1727
+ </ul>
1728
+ </ng-template>
1729
+
1730
+ <ng-template #itemcontent>
1731
+ <span *ngIf="item.icon" class="k-icon" [ngClass]="iconClass" role="presentation"></span>
1732
+ <ng-container *ngIf="!template">
1733
+ <span class="k-menu-link-text">{{ item.text }}</span>
1734
+ </ng-container>
1735
+ <ng-template *ngIf="template" [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{ item: item, index: index }">
1736
+ </ng-template>
1737
+ <span *ngIf="hasContent" class="k-menu-expand-arrow" role="presentation">
1738
+ <span class="k-icon"
1739
+ [class.k-i-arrow-60-down]="!horizontal"
1740
+ [class.k-i-arrow-60-right]="horizontal && !rtl"
1741
+ [class.k-i-arrow-60-left]="horizontal && rtl"
1742
+ >
1743
+ </span>
1744
+ </span>
1745
+ </ng-template>
1746
+ `
1747
+ }]
1748
+ }], ctorParameters: function () {
1749
+ return [{ type: ItemsService }, { type: NavigationService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i6.PopupService }, { type: i0.ElementRef }, { type: ContextMenuService, decorators: [{
1750
+ type: Optional
1751
+ }] }];
1752
+ }, propDecorators: { item: [{
1753
+ type: Input
1754
+ }], level: [{
1755
+ type: Input
1756
+ }], index: [{
1757
+ type: Input
1758
+ }], siblingIndex: [{
1759
+ type: Input
1760
+ }], animate: [{
1761
+ type: Input
1762
+ }], size: [{
1763
+ type: Input
1764
+ }], vertical: [{
1765
+ type: Input
1766
+ }], rtl: [{
1767
+ type: Input
1768
+ }], openOnClick: [{
1769
+ type: Input
1770
+ }], itemTemplate: [{
1771
+ type: Input
1772
+ }], itemLinkTemplate: [{
1773
+ type: Input
1774
+ }], link: [{
1775
+ type: ViewChild,
1776
+ args: ['link', { static: false }]
1777
+ }], popupTemplate: [{
1778
+ type: ViewChild,
1779
+ args: ['popupTemplate', { static: true }]
1780
+ }], disabled: [{
1781
+ type: HostBinding,
1782
+ args: ['attr.aria-disabled']
1783
+ }], hasPopup: [{
1784
+ type: HostBinding,
1785
+ args: ['attr.aria-haspopup']
1786
+ }], expanded: [{
1787
+ type: HostBinding,
1788
+ args: ['attr.aria-expanded']
1789
+ }], label: [{
1790
+ type: HostBinding,
1791
+ args: ['attr.aria-label']
1792
+ }], activeId: [{
1793
+ type: HostBinding,
1794
+ args: ['attr.tabindex']
1795
+ }] } });
1796
+
1797
+ /**
1798
+ * Represents the [Kendo UI Menu component for Angular]({% slug overview_menu %}).
1799
+ *
1800
+ * @example
1801
+ * ```ts
1802
+ * _@Component({
1803
+ * selector: 'my-app',
1804
+ * template: `
1805
+ * <kendo-menu [items]="items">
1806
+ * </kendo-menu>
1807
+ * `
1808
+ * })
1809
+ * class AppComponent {
1810
+ * public items: any[] = [{ text: 'item1', items: [{ text: 'item1.1' }] }, { text: 'item2', disabled: true }];
1811
+ * }
1812
+ * ```
1813
+ */
1814
+ class MenuComponent extends MenuBase {
1815
+ constructor(itemsService, hover, actions, navigation, localization, ngZone, renderer, contextService) {
1816
+ super();
1817
+ this.itemsService = itemsService;
1818
+ this.hover = hover;
1819
+ this.actions = actions;
1820
+ this.navigation = navigation;
1821
+ this.localization = localization;
1822
+ this.ngZone = ngZone;
1823
+ this.renderer = renderer;
1824
+ this.contextService = contextService;
1825
+ /**
1826
+ * Fires when a Menu item is selected ([see example]({% slug routing_menu %})).
1827
+ */
1828
+ this.select = new EventEmitter();
1829
+ /**
1830
+ * Fires when a Menu item is opened.
1831
+ */
1832
+ this.open = new EventEmitter();
1833
+ /**
1834
+ * Fires when a Menu item is closed.
1835
+ */
1836
+ this.close = new EventEmitter();
1837
+ validatePackage(packageMetadata);
1838
+ this.actions.owner = this;
1839
+ if (contextService) {
1840
+ contextService.items = this.itemsService;
1841
+ this.contextKeyDownSubscription = contextService.keydown.subscribe(this.contextKeyDown.bind(this));
1842
+ }
1843
+ }
1844
+ /**
1845
+ * @hidden
1846
+ */
1847
+ get ariaOrientation() {
1848
+ if (this.vertical) {
1849
+ return 'vertical';
1850
+ }
1851
+ }
1852
+ /**
1853
+ * @hidden
1854
+ */
1855
+ get isContextMenu() {
1856
+ return Boolean(this.contextService);
1857
+ }
1858
+ get direction() {
1859
+ return this.rtl;
1860
+ }
1861
+ get rtl() {
1862
+ return this.localization.rtl;
1863
+ }
1864
+ /**
1865
+ * @hidden
1866
+ */
1867
+ get menuClasses() {
1868
+ const sizeClass = getSizeClass(this.size);
1869
+ if (this.isContextMenu) {
1870
+ return `k-context-menu k-menu-group ${sizeClass}`;
1871
+ }
1872
+ return this.vertical ? 'k-widget k-reset k-header k-menu k-menu-vertical' : 'k-widget k-reset k-header k-menu k-menu-horizontal';
1873
+ }
1874
+ /**
1875
+ * Opens or closes the specified Menu items.
1876
+ *
1877
+ * @param open - A Boolean value which indicates if the items will be opened or closed.
1878
+ * @param indices - One or more values which represent the hierarchical indices of the items that will be opened or closed.
1879
+ */
1880
+ toggle(open, ...indices) {
1881
+ for (let idx = 0; idx < indices.length; idx++) {
1882
+ const item = this.itemsService.get(indices[idx]);
1883
+ if (item && !item.disabled) {
1884
+ if (open) {
1885
+ item.open();
1886
+ }
1887
+ else {
1888
+ item.close();
1889
+ }
1890
+ }
1891
+ }
1892
+ }
1893
+ /**
1894
+ * @hidden
1895
+ */
1896
+ focus(index) {
1897
+ this.navigation.focusIndex(index);
1898
+ }
1899
+ ngOnChanges(changes) {
1900
+ this.navigation.vertical = this.vertical;
1901
+ this.hover.delay = this.hoverDelay;
1902
+ if (changes.openOnClick) {
1903
+ const openOnClick = this.openOnClick = normalize(this.openOnClick);
1904
+ this.hover.openOnOver = !openOnClick;
1905
+ if (openOnClick && openOnClick.toggle === 'click') {
1906
+ this.attachCloseClick();
1907
+ }
1908
+ else {
1909
+ this.unsubscribeClick();
1910
+ }
1911
+ }
1912
+ }
1913
+ ngAfterViewChecked() {
1914
+ this.navigation.updateActive();
1915
+ }
1916
+ ngOnDestroy() {
1917
+ this.unsubscribeClick();
1918
+ if (this.contextService) {
1919
+ this.contextService.items = null;
1920
+ this.contextKeyDownSubscription.unsubscribe();
1921
+ }
1922
+ }
1923
+ attachCloseClick() {
1924
+ if (!this.closeClickSubscription && isDocumentAvailable()) {
1925
+ this.ngZone.runOutsideAngular(() => {
1926
+ this.closeClickSubscription = this.renderer.listen('document', 'click', (e) => {
1927
+ if (!inMenu(e.target, this.itemsService)) {
1928
+ this.hover.openOnOver = false;
1929
+ this.actions.closeAll();
1930
+ this.actions.execute();
1931
+ }
1932
+ });
1933
+ });
1934
+ }
1935
+ }
1936
+ unsubscribeClick() {
1937
+ if (this.closeClickSubscription) {
1938
+ this.closeClickSubscription();
1939
+ }
1940
+ }
1941
+ contextKeyDown(e) {
1942
+ if (!this.itemsService.hasItems) {
1943
+ return;
1944
+ }
1945
+ const keyCode = e.keyCode;
1946
+ const rtl = this.localization.rtl;
1947
+ const first = keyCode === Keys.ArrowDown || keyCode === Keys.ArrowRight;
1948
+ const last = keyCode === Keys.ArrowUp || keyCode === Keys.ArrowLeft;
1949
+ let index;
1950
+ if ((first && !rtl) || (last && rtl)) {
1951
+ index = 'first';
1952
+ }
1953
+ else if ((first && rtl) || (last && !rtl)) {
1954
+ index = 'last';
1955
+ }
1956
+ if (index) {
1957
+ e.preventDefault();
1958
+ this.focus(index);
1959
+ }
1960
+ }
1961
+ }
1962
+ MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", 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 });
1963
+ MenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: [
1964
+ ItemsService,
1965
+ ActionsService,
1966
+ NavigationService,
1967
+ HoverService,
1968
+ LocalizationService,
1969
+ {
1970
+ provide: L10N_PREFIX,
1971
+ useValue: 'kendo.menu'
1972
+ },
1973
+ {
1974
+ provide: MenuBase,
1975
+ useExisting: forwardRef(() => MenuComponent)
1976
+ }
1977
+ ], exportAs: ["kendoMenu"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
1978
+ <ul role="menubar"
1979
+ [attr.aria-orientation]="ariaOrientation"
1980
+ kendoMenuList [items]="rootItems" [level]="0"
1981
+ [size]="size" [vertical]="vertical" [rtl]="rtl" [animate]="animate" [openOnClick]="openOnClick"
1982
+ [itemTemplate]="itemTemplate.first?.templateRef || menuItemTemplate"
1983
+ [itemLinkTemplate]="itemLinkTemplate.first?.templateRef || menuItemLinkTemplate"
1984
+ [ngClass]="menuClasses">
1985
+ </ul>
1986
+ `, isInline: true, components: [{ type: ListComponent, selector: "[kendoMenuList]", inputs: ["items", "level", "index", "animate", "size", "vertical", "rtl", "openOnClick", "itemTemplate", "itemLinkTemplate"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuComponent, decorators: [{
1988
+ type: Component,
1989
+ args: [{
1990
+ exportAs: 'kendoMenu',
1991
+ providers: [
1992
+ ItemsService,
1993
+ ActionsService,
1994
+ NavigationService,
1995
+ HoverService,
1996
+ LocalizationService,
1997
+ {
1998
+ provide: L10N_PREFIX,
1999
+ useValue: 'kendo.menu'
2000
+ },
2001
+ {
2002
+ provide: MenuBase,
2003
+ useExisting: forwardRef(() => MenuComponent)
2004
+ }
2005
+ ],
2006
+ selector: 'kendo-menu',
2007
+ template: `
2008
+ <ul role="menubar"
2009
+ [attr.aria-orientation]="ariaOrientation"
2010
+ kendoMenuList [items]="rootItems" [level]="0"
2011
+ [size]="size" [vertical]="vertical" [rtl]="rtl" [animate]="animate" [openOnClick]="openOnClick"
2012
+ [itemTemplate]="itemTemplate.first?.templateRef || menuItemTemplate"
2013
+ [itemLinkTemplate]="itemLinkTemplate.first?.templateRef || menuItemLinkTemplate"
2014
+ [ngClass]="menuClasses">
2015
+ </ul>
2016
+ `
2017
+ }]
2018
+ }], ctorParameters: function () {
2019
+ return [{ type: ItemsService }, { type: HoverService }, { type: ActionsService }, { type: NavigationService }, { type: i3.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: ContextMenuService, decorators: [{
2020
+ type: Optional
2021
+ }] }];
2022
+ }, propDecorators: { menuItemTemplate: [{
2023
+ type: Input
2024
+ }], menuItemLinkTemplate: [{
2025
+ type: Input
2026
+ }], select: [{
2027
+ type: Output
2028
+ }], open: [{
2029
+ type: Output
2030
+ }], close: [{
2031
+ type: Output
2032
+ }], direction: [{
2033
+ type: HostBinding,
2034
+ args: ['class.k-rtl']
2035
+ }] } });
2036
+
2037
+ /**
2038
+ * Represents a directive that can be used in the [`linkTemplate`]({% slug api_menu_itemlinktemplatedirective %})
2039
+ * of the items to apply the default styling and behavior.
2040
+ */
2041
+ class LinkDirective {
2042
+ constructor(itemsService) {
2043
+ this.itemsService = itemsService;
2044
+ this.hostClasses = true;
2045
+ this.role = 'presentation';
2046
+ this.tabindex = '-1';
2047
+ }
2048
+ get activeClass() {
2049
+ return this.item.opened;
2050
+ }
2051
+ ngOnInit() {
2052
+ if (isDevMode() && !this.index) {
2053
+ throw new Error('The kendoMenuItemLink directive requires the item index to be set.');
2054
+ }
2055
+ this.item = this.itemsService.get(this.index) || {};
2056
+ }
2057
+ }
2058
+ LinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LinkDirective, deps: [{ token: ItemsService }], target: i0.ɵɵFactoryTarget.Directive });
2059
+ LinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", 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-active": "this.activeClass" } }, ngImport: i0 });
2060
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: LinkDirective, decorators: [{
2061
+ type: Directive,
2062
+ args: [{
2063
+ selector: '[kendoMenuItemLink]'
2064
+ }]
2065
+ }], ctorParameters: function () { return [{ type: ItemsService }]; }, propDecorators: { index: [{
2066
+ type: Input,
2067
+ args: ['kendoMenuItemLink']
2068
+ }], hostClasses: [{
2069
+ type: HostBinding,
2070
+ args: ['class.k-link']
2071
+ }, {
2072
+ type: HostBinding,
2073
+ args: ['class.k-menu-link']
2074
+ }], role: [{
2075
+ type: HostBinding,
2076
+ args: ['attr.role']
2077
+ }], tabindex: [{
2078
+ type: HostBinding,
2079
+ args: ['attr.tabindex']
2080
+ }], activeClass: [{
2081
+ type: HostBinding,
2082
+ args: ['class.k-active']
2083
+ }] } });
2084
+
2085
+ /**
2086
+ * Represents a directive that can be used in the [`linkTemplate`]({% slug api_menu_itemlinktemplatedirective %})
2087
+ * of the items to render the default expand arrow.
2088
+ */
2089
+ class ExpandArrowDirective {
2090
+ constructor(itemsService, element, renderer) {
2091
+ this.itemsService = itemsService;
2092
+ this.element = element;
2093
+ this.renderer = renderer;
2094
+ this.hostClasses = true;
2095
+ this.role = 'presentation';
2096
+ }
2097
+ ngOnInit() {
2098
+ if (isDevMode() && !this.index) {
2099
+ throw new Error('The kendoMenuExpandArrow directive requires the item index to be set.');
2100
+ }
2101
+ this.item = this.itemsService.get(this.index) || {};
2102
+ this.createIconElement();
2103
+ }
2104
+ createIconElement() {
2105
+ const iconClass = this.item.horizontal ?
2106
+ this.item.rtl ?
2107
+ 'k-i-arrow-60-left' :
2108
+ 'k-i-arrow-60-right' :
2109
+ 'k-i-arrow-60-down';
2110
+ const iconElement = this.renderer.createElement('span');
2111
+ this.renderer.addClass(iconElement, 'k-icon');
2112
+ this.renderer.addClass(iconElement, iconClass);
2113
+ this.renderer.appendChild(this.element.nativeElement, iconElement);
2114
+ }
2115
+ }
2116
+ ExpandArrowDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ExpandArrowDirective, deps: [{ token: ItemsService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
2117
+ ExpandArrowDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ExpandArrowDirective, selector: "[kendoMenuExpandArrow]", inputs: { index: ["kendoMenuExpandArrow", "index"] }, host: { properties: { "class.k-menu-expand-arrow": "this.hostClasses", "attr.role": "this.role" } }, ngImport: i0 });
2118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ExpandArrowDirective, decorators: [{
2119
+ type: Directive,
2120
+ args: [{
2121
+ selector: '[kendoMenuExpandArrow]'
2122
+ }]
2123
+ }], ctorParameters: function () { return [{ type: ItemsService }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { index: [{
2124
+ type: Input,
2125
+ args: ['kendoMenuExpandArrow']
2126
+ }], hostClasses: [{
2127
+ type: HostBinding,
2128
+ args: ['class.k-menu-expand-arrow']
2129
+ }], role: [{
2130
+ type: HostBinding,
2131
+ args: ['attr.role']
2132
+ }] } });
2133
+
2134
+ /**
2135
+ * @hidden
2136
+ */
2137
+ class PreventableEvent {
2138
+ /**
2139
+ * @hidden
2140
+ */
2141
+ constructor(args) {
2142
+ this.prevented = false;
2143
+ Object.assign(this, args);
2144
+ }
2145
+ /**
2146
+ * Prevents the default action for a specified event.
2147
+ * In this way, the source component suppresses
2148
+ * the built-in behavior that follows the event.
2149
+ */
2150
+ preventDefault() {
2151
+ this.prevented = true;
2152
+ }
2153
+ /**
2154
+ * Returns `true` if the event was prevented
2155
+ * by any of its subscribers.
2156
+ *
2157
+ * @returns `true` if the default action was prevented.
2158
+ * Otherwise, returns `false`.
2159
+ */
2160
+ isDefaultPrevented() {
2161
+ return this.prevented;
2162
+ }
2163
+ }
2164
+
2165
+ /**
2166
+ * Arguments for the `open` and `close` events of the Menu.
2167
+ */
2168
+ class MenuEvent extends PreventableEvent {
2169
+ }
2170
+
2171
+ /**
2172
+ * Arguments for the `select` event of the Menu.
2173
+ */
2174
+ class MenuSelectEvent extends MenuEvent {
2175
+ }
2176
+
2177
+ const ITEM_FIELDS = ['textField', 'urlField', 'iconField', 'disabledField', 'cssClassField', 'cssStyleField', 'separatorField'];
2178
+ /**
2179
+ * @hidden
2180
+ */
2181
+ class BindingDirectiveBase {
2182
+ constructor(menu) {
2183
+ this.menu = menu;
2184
+ }
2185
+ ngOnChanges() {
2186
+ this.rebind();
2187
+ }
2188
+ /**
2189
+ * Rebinds the Menu items.
2190
+ */
2191
+ rebind() {
2192
+ const fields = this.fields = [];
2193
+ for (let idx = 0; idx < ITEM_FIELDS.length; idx++) {
2194
+ const inputName = ITEM_FIELDS[idx];
2195
+ const inputValue = this[inputName];
2196
+ if (inputValue) {
2197
+ fields.push({ target: inputName.replace('Field', ''), source: inputValue });
2198
+ }
2199
+ }
2200
+ this.menu.items = this.data ? this.mapItems(this.data) : [];
2201
+ }
2202
+ }
2203
+ BindingDirectiveBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BindingDirectiveBase, deps: [{ token: MenuBase }], target: i0.ɵɵFactoryTarget.Directive });
2204
+ BindingDirectiveBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: BindingDirectiveBase, selector: "kendoBindingBase", usesOnChanges: true, ngImport: i0 });
2205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BindingDirectiveBase, decorators: [{
2206
+ type: Directive,
2207
+ args: [{
2208
+ // eslint-disable-next-line
2209
+ selector: 'kendoBindingBase'
2210
+ }]
2211
+ }], ctorParameters: function () { return [{ type: MenuBase }]; } });
2212
+
2213
+ const FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
2214
+ const getterCache = {};
2215
+ getterCache['undefined'] = (obj) => obj;
2216
+ /**
2217
+ * @hidden
2218
+ */
2219
+ const getter = (field) => {
2220
+ if (getterCache[field]) {
2221
+ return getterCache[field];
2222
+ }
2223
+ const fields = [];
2224
+ field.replace(FIELD_REGEX, (_match, index, indexAccessor, name) => {
2225
+ fields.push(index !== undefined ? index : (indexAccessor || name));
2226
+ });
2227
+ getterCache[field] = (obj) => {
2228
+ let result = obj;
2229
+ for (let idx = 0; idx < fields.length && result; idx++) {
2230
+ result = result[fields[idx]];
2231
+ }
2232
+ return result;
2233
+ };
2234
+ return getterCache[field];
2235
+ };
2236
+ /**
2237
+ * @hidden
2238
+ */
2239
+ const last = (arr) => arr[arr.length - 1];
2240
+
2241
+ const getField = (field, level) => Array.isArray(field) ? field[level] || last(field) : field;
2242
+ /**
2243
+ * A directive that converts the provided hierarchical data to [MenuItems]({% slug api_menu_menuitem %}) and binds them to the Menu.
2244
+ */
2245
+ class HierarchyBindingDirective extends BindingDirectiveBase {
2246
+ constructor(menu) {
2247
+ super(menu);
2248
+ }
2249
+ mapItems(items, level = 0) {
2250
+ return items.map((item) => {
2251
+ const menuItem = this.createItem(item, level);
2252
+ const children = this.getChildren(item, level);
2253
+ if (children) {
2254
+ menuItem.items = this.mapItems(children, level + 1);
2255
+ }
2256
+ return menuItem;
2257
+ });
2258
+ }
2259
+ createItem(item, level) {
2260
+ const result = { data: item };
2261
+ const fields = this.fields;
2262
+ for (let idx = 0; idx < fields.length; idx++) {
2263
+ const { target, source } = fields[idx];
2264
+ result[target] = getter(getField(source, level))(item);
2265
+ }
2266
+ return result;
2267
+ }
2268
+ getChildren(item, level) {
2269
+ if (this.childrenField) {
2270
+ const field = getField(this.childrenField, level);
2271
+ return item[field];
2272
+ }
2273
+ }
2274
+ }
2275
+ HierarchyBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HierarchyBindingDirective, deps: [{ token: MenuBase }], target: i0.ɵɵFactoryTarget.Directive });
2276
+ HierarchyBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", 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 });
2277
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HierarchyBindingDirective, decorators: [{
2278
+ type: Directive,
2279
+ args: [{
2280
+ exportAs: 'kendoMenuHierarchyBinding',
2281
+ selector: '[kendoMenuHierarchyBinding]'
2282
+ }]
2283
+ }], ctorParameters: function () { return [{ type: MenuBase }]; }, propDecorators: { data: [{
2284
+ type: Input,
2285
+ args: ["kendoMenuHierarchyBinding"]
2286
+ }], textField: [{
2287
+ type: Input
2288
+ }], urlField: [{
2289
+ type: Input
2290
+ }], iconField: [{
2291
+ type: Input
2292
+ }], disabledField: [{
2293
+ type: Input
2294
+ }], cssClassField: [{
2295
+ type: Input
2296
+ }], cssStyleField: [{
2297
+ type: Input
2298
+ }], separatorField: [{
2299
+ type: Input
2300
+ }], childrenField: [{
2301
+ type: Input
2302
+ }] } });
2303
+
2304
+ /**
2305
+ * A directive that converts the provided flat data to [MenuItems]({% slug api_menu_menuitem %}) and binds them to the Menu.
2306
+ */
2307
+ class FlatBindingDirective extends BindingDirectiveBase {
2308
+ constructor(menu) {
2309
+ super(menu);
2310
+ }
2311
+ mapItems(items) {
2312
+ if (!this.idField || !this.parentIdField) {
2313
+ return items.map(item => this.createItem(item));
2314
+ }
2315
+ const result = [];
2316
+ const map = {};
2317
+ for (let idx = 0; idx < items.length; idx++) {
2318
+ const item = items[idx];
2319
+ const menuItem = this.createItem(item);
2320
+ const id = getter(this.idField)(item);
2321
+ const parentId = getter(this.parentIdField)(item);
2322
+ if (parentId === null || parentId === undefined) {
2323
+ result.push(menuItem);
2324
+ }
2325
+ else {
2326
+ const parent = map[parentId] = map[parentId] || {};
2327
+ parent.items = parent.items || [];
2328
+ parent.items.push(menuItem);
2329
+ }
2330
+ if (map[id]) {
2331
+ menuItem.items = map[id].items;
2332
+ }
2333
+ map[id] = menuItem;
2334
+ }
2335
+ return result;
2336
+ }
2337
+ createItem(dataItem) {
2338
+ const result = { data: dataItem };
2339
+ const fields = this.fields;
2340
+ for (let idx = 0; idx < fields.length; idx++) {
2341
+ const { source, target } = fields[idx];
2342
+ result[target] = getter(source)(dataItem);
2343
+ }
2344
+ return result;
2345
+ }
2346
+ }
2347
+ FlatBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FlatBindingDirective, deps: [{ token: MenuBase }], target: i0.ɵɵFactoryTarget.Directive });
2348
+ FlatBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", 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 });
2349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FlatBindingDirective, decorators: [{
2350
+ type: Directive,
2351
+ args: [{
2352
+ exportAs: 'kendoMenuFlatBinding',
2353
+ selector: '[kendoMenuFlatBinding]'
2354
+ }]
2355
+ }], ctorParameters: function () { return [{ type: MenuBase }]; }, propDecorators: { data: [{
2356
+ type: Input,
2357
+ args: ["kendoMenuFlatBinding"]
2358
+ }], textField: [{
2359
+ type: Input
2360
+ }], urlField: [{
2361
+ type: Input
2362
+ }], iconField: [{
2363
+ type: Input
2364
+ }], disabledField: [{
2365
+ type: Input
2366
+ }], cssClassField: [{
2367
+ type: Input
2368
+ }], cssStyleField: [{
2369
+ type: Input
2370
+ }], separatorField: [{
2371
+ type: Input
2372
+ }], idField: [{
2373
+ type: Input
2374
+ }], parentIdField: [{
2375
+ type: Input
2376
+ }] } });
2377
+
2378
+ const COMPONENT_EXPORTS = [
2379
+ MenuComponent,
2380
+ MenuItemComponent,
2381
+ ItemTemplateDirective,
2382
+ ItemLinkTemplateDirective,
2383
+ ItemContentTemplateDirective,
2384
+ HierarchyBindingDirective,
2385
+ FlatBindingDirective,
2386
+ LinkDirective,
2387
+ ExpandArrowDirective
2388
+ ];
2389
+ const COMPONENT_DIRECTIVES$1 = [
2390
+ ...COMPONENT_EXPORTS,
2391
+ ListComponent,
2392
+ ItemComponent
2393
+ ];
2394
+ /**
2395
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
2396
+ * definition for the Menu component.
2397
+ *
2398
+ * @example
2399
+ *
2400
+ * ```ts-no-run
2401
+ * // Import the Menu module
2402
+ * import { MenuModule } from '@progress/kendo-angular-menu';
2403
+ *
2404
+ * // The browser platform with a compiler
2405
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2406
+ * import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
2407
+ *
2408
+ * import { NgModule } from '@angular/core';
2409
+ *
2410
+ * // Import the app component
2411
+ * import { AppComponent } from './app.component';
2412
+ *
2413
+ * // Define the app module
2414
+ * _@NgModule({
2415
+ * declarations: [AppComponent], // declare app component
2416
+ * imports: [BrowserModule, BrowserAnimationsModule, MenuModule], // import Menu module
2417
+ * bootstrap: [AppComponent]
2418
+ * })
2419
+ * export class AppModule {}
2420
+ *
2421
+ * // Compile and launch the module
2422
+ * platformBrowserDynamic().bootstrapModule(AppModule);
2423
+ *
2424
+ * ```
2425
+ */
2426
+ class MenuModule {
2427
+ }
2428
+ MenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2429
+ MenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuModule, declarations: [MenuComponent,
2430
+ MenuItemComponent,
2431
+ ItemTemplateDirective,
2432
+ ItemLinkTemplateDirective,
2433
+ ItemContentTemplateDirective,
2434
+ HierarchyBindingDirective,
2435
+ FlatBindingDirective,
2436
+ LinkDirective,
2437
+ ExpandArrowDirective, ListComponent,
2438
+ ItemComponent], imports: [PopupModule, CommonModule], exports: [MenuComponent,
2439
+ MenuItemComponent,
2440
+ ItemTemplateDirective,
2441
+ ItemLinkTemplateDirective,
2442
+ ItemContentTemplateDirective,
2443
+ HierarchyBindingDirective,
2444
+ FlatBindingDirective,
2445
+ LinkDirective,
2446
+ ExpandArrowDirective] });
2447
+ MenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuModule, imports: [[PopupModule, CommonModule]] });
2448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenuModule, decorators: [{
2449
+ type: NgModule,
2450
+ args: [{
2451
+ declarations: [COMPONENT_DIRECTIVES$1],
2452
+ exports: [COMPONENT_EXPORTS],
2453
+ imports: [PopupModule, CommonModule]
2454
+ }]
2455
+ }] });
2456
+
2457
+ /**
2458
+ * Arguments for the `open` and `close` events of the ContextMenu.
2459
+ */
2460
+ class ContextMenuEvent {
2461
+ }
2462
+
2463
+ /**
2464
+ * Arguments for the `select` event of the ContextMenu.
2465
+ */
2466
+ class ContextMenuSelectEvent extends ContextMenuEvent {
2467
+ }
2468
+
2469
+ /**
2470
+ * Arguments for the `popupOpen` and `popupClose` events of the ContextMenu.
2471
+ */
2472
+ class ContextMenuPopupEvent extends PreventableEvent {
2473
+ }
2474
+
2475
+ /**
2476
+ * Represents a template for the content of the ContextMenu. To define a template, nest an `<ng-template>`
2477
+ * tag with the `kendoContextMenuTemplate` directive inside a `<kendo-contextmenu>` component
2478
+ * ([more information and examples]({% slug templates_contextmenu %})).
2479
+ *
2480
+ * {% meta height:200 %}
2481
+ * {% embed_file context-menu/template/app.component.ts preview %}
2482
+ * {% embed_file shared/app.module.ts %}
2483
+ * {% embed_file shared/main.ts %}
2484
+ * {% endmeta %}
2485
+ */
2486
+ class ContextMenuTemplateDirective {
2487
+ constructor(templateRef) {
2488
+ this.templateRef = templateRef;
2489
+ }
2490
+ }
2491
+ ContextMenuTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
2492
+ ContextMenuTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ContextMenuTemplateDirective, selector: "[kendoContextMenuTemplate]", ngImport: i0 });
2493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTemplateDirective, decorators: [{
2494
+ type: Directive,
2495
+ args: [{
2496
+ selector: '[kendoContextMenuTemplate]'
2497
+ }]
2498
+ }], ctorParameters: function () {
2499
+ return [{ type: i0.TemplateRef, decorators: [{
2500
+ type: Optional
2501
+ }] }];
2502
+ } });
2503
+
2504
+ /**
2505
+ * @hidden
2506
+ */
2507
+ class ContextMenuItemsService {
2508
+ constructor(contextService) {
2509
+ this.contextService = contextService;
2510
+ }
2511
+ get(index) {
2512
+ if (this.contextService.items) {
2513
+ return this.contextService.items.get(index);
2514
+ }
2515
+ }
2516
+ }
2517
+ ContextMenuItemsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuItemsService, deps: [{ token: ContextMenuService }], target: i0.ɵɵFactoryTarget.Injectable });
2518
+ ContextMenuItemsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuItemsService });
2519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuItemsService, decorators: [{
2520
+ type: Injectable
2521
+ }], ctorParameters: function () { return [{ type: ContextMenuService }]; } });
2522
+
2523
+ /**
2524
+ * @hidden
2525
+ */
2526
+ class ContextMenuTargetService {
2527
+ constructor() {
2528
+ this.targets = [];
2529
+ }
2530
+ add(target) {
2531
+ this.targets.push(target);
2532
+ }
2533
+ remove(target) {
2534
+ const index = this.targets.indexOf(target);
2535
+ this.targets.splice(index, 1);
2536
+ }
2537
+ find(targetElement) {
2538
+ return this.targets.find(target => target.element === targetElement);
2539
+ }
2540
+ }
2541
+ ContextMenuTargetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2542
+ ContextMenuTargetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetService });
2543
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetService, decorators: [{
2544
+ type: Injectable
2545
+ }] });
2546
+
2547
+ /**
2548
+ * Specifies a container for the [targets]({% slug api_menu_contextmenutargetdirective %}) of the ContextMenu.
2549
+ */
2550
+ class ContextMenuTargetContainerDirective {
2551
+ /**
2552
+ * @hidden
2553
+ */
2554
+ constructor(elementRef, targetService) {
2555
+ this.targetService = targetService;
2556
+ if (elementRef) {
2557
+ this.element = elementRef.nativeElement;
2558
+ }
2559
+ }
2560
+ }
2561
+ ContextMenuTargetContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetContainerDirective, deps: [{ token: i0.ElementRef }, { token: ContextMenuTargetService }], target: i0.ɵɵFactoryTarget.Directive });
2562
+ ContextMenuTargetContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ContextMenuTargetContainerDirective, selector: "[kendoContextMenuTargetContainer]", providers: [ContextMenuTargetService], exportAs: ["kendoContextMenuTargetContainer"], ngImport: i0 });
2563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetContainerDirective, decorators: [{
2564
+ type: Directive,
2565
+ args: [{
2566
+ selector: '[kendoContextMenuTargetContainer]',
2567
+ exportAs: 'kendoContextMenuTargetContainer',
2568
+ providers: [ContextMenuTargetService]
2569
+ }]
2570
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ContextMenuTargetService }]; } });
2571
+
2572
+ /**
2573
+ * @hidden
2574
+ */
2575
+ const TARGET_CLASS = 'k-contextmenu-target';
2576
+ /**
2577
+ * Specifies a [target]({% slug api_menu_contextmenutargetdirective %}) for the ContextMenu
2578
+ * ([see example]({% slug target_contextmenu %}#toc-directives)).
2579
+ */
2580
+ class ContextMenuTargetDirective {
2581
+ constructor(elementRef, targetService) {
2582
+ this.targetService = targetService;
2583
+ /**
2584
+ * @hidden
2585
+ */
2586
+ this.hostClass = true;
2587
+ if (elementRef) {
2588
+ this.element = elementRef.nativeElement;
2589
+ }
2590
+ targetService.add(this);
2591
+ }
2592
+ ngOnDestroy() {
2593
+ this.targetService.remove(this);
2594
+ }
2595
+ }
2596
+ ContextMenuTargetDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetDirective, deps: [{ token: i0.ElementRef }, { token: ContextMenuTargetService }], target: i0.ɵɵFactoryTarget.Directive });
2597
+ ContextMenuTargetDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ContextMenuTargetDirective, selector: "[kendoContextMenuTarget]", inputs: { data: ["kendoContextMenuTarget", "data"] }, host: { properties: { "class.k-contextmenu-target": "this.hostClass" } }, exportAs: ["kendoContextMenuTarget"], ngImport: i0 });
2598
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuTargetDirective, decorators: [{
2599
+ type: Directive,
2600
+ args: [{
2601
+ selector: '[kendoContextMenuTarget]',
2602
+ exportAs: 'kendoContextMenuTarget'
2603
+ }]
2604
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ContextMenuTargetService }]; }, propDecorators: { data: [{
2605
+ type: Input,
2606
+ args: ['kendoContextMenuTarget']
2607
+ }], hostClass: [{
2608
+ type: HostBinding,
2609
+ args: [`class.${TARGET_CLASS}`]
2610
+ }] } });
2611
+
2612
+ const CONTEXT_MENU = 'contextmenu';
2613
+ const DEFAULT_ANCHOR_ALIGN = { horizontal: 'left', vertical: 'bottom' };
2614
+ const DEFAULT_POPUP_ALIGN = { horizontal: 'left', vertical: 'top' };
2615
+ const DEFAULT_COLLISION = { horizontal: 'fit', vertical: 'flip' };
2616
+ const preventDefault = e => e.preventDefault();
2617
+ /**
2618
+ * Represents the [Kendo UI ContextMenu component for Angular]({% slug overview_contextmenu %}).
2619
+ *
2620
+ * @example
2621
+ * ```ts
2622
+ * _@Component({
2623
+ * selector: 'my-app',
2624
+ * template: `
2625
+ * <div #target>
2626
+ * Right-click to open Context menu</p>
2627
+ * </div>
2628
+ * <kendo-contextmenu [target]="target" [items]="items"> </kendo-contextmenu>
2629
+ * `
2630
+ * })
2631
+ * class AppComponent {
2632
+ * public items: any[] = [{ text: 'item1', items: [{ text: 'item1.1' }] }, { text: 'item2', disabled: true }];
2633
+ * }
2634
+ * ```
2635
+ */
2636
+ class ContextMenuComponent extends MenuBase {
2637
+ constructor(popupService, service, ngZone, renderer) {
2638
+ super();
2639
+ this.popupService = popupService;
2640
+ this.service = service;
2641
+ this.ngZone = ngZone;
2642
+ this.renderer = renderer;
2643
+ /**
2644
+ * Specifies the event on which the ContextMenu will open ([see example]({% slug showon_contextmenu %})).
2645
+ * Accepts the name of a native DOM event. Defaults to `contextmenu` which opens the ContextMenu for the target element.
2646
+ */
2647
+ this.showOn = CONTEXT_MENU;
2648
+ /**
2649
+ * Indicates that the ContextMenu will be aligned to the target or to the `filter` element (if specified).
2650
+ */
2651
+ this.alignToAnchor = false;
2652
+ /**
2653
+ * Specifies if the Menu will be vertically rendered ([see example]({% slug orientation_contextmenu %})).
2654
+ * @default true
2655
+ */
2656
+ this.vertical = true;
2657
+ /**
2658
+ * Fires when the Menu is opened ([see example]({% slug target_contextmenu %}#toc-changing-items-for-specified-targets)).
2659
+ */
2660
+ this.popupOpen = new EventEmitter();
2661
+ /**
2662
+ * Fires when the Menu is closed.
2663
+ */
2664
+ this.popupClose = new EventEmitter();
2665
+ /**
2666
+ * Fires when a Menu item is selected.
2667
+ */
2668
+ this.select = new EventEmitter();
2669
+ /**
2670
+ * Fires when a Menu item is opened.
2671
+ */
2672
+ this.open = new EventEmitter();
2673
+ /**
2674
+ * Fires when a Menu item is closed.
2675
+ */
2676
+ this.close = new EventEmitter();
2677
+ this.service.owner = this;
2678
+ this.popupKeyDownHandler = this.popupKeyDownHandler.bind(this);
2679
+ }
2680
+ /**
2681
+ * Hides the ContextMenu.
2682
+ */
2683
+ hide() {
2684
+ this.removePopup();
2685
+ }
2686
+ /**
2687
+ * Shows the ContextMenu for the specified target.
2688
+ * @param target - The offset or the target element for which the ContextMenu will open.
2689
+ */
2690
+ show(target) {
2691
+ if (!target) {
2692
+ return;
2693
+ }
2694
+ const showTarget = target;
2695
+ this.removePopup();
2696
+ if (defined(showTarget.left) && defined(showTarget.top)) {
2697
+ this.createPopup({ offset: showTarget });
2698
+ }
2699
+ else {
2700
+ this.currentTarget = showTarget.nativeElement || showTarget;
2701
+ this.createPopup({ anchor: this.currentTarget });
2702
+ }
2703
+ }
2704
+ ngOnChanges(changes) {
2705
+ if (changes.target || changes.showOn) {
2706
+ this.bindShowHandler();
2707
+ }
2708
+ }
2709
+ ngOnInit() {
2710
+ this.ngZone.runOutsideAngular(() => {
2711
+ const closeClickSubscription = this.renderer.listen('document', 'mousedown', (e) => {
2712
+ if (this.popupRef && !closest(e.target, node => node === this.popupRef.popupElement) && this.service.leaveMenu(e)) {
2713
+ this.closePopup(e);
2714
+ }
2715
+ });
2716
+ const closeBlurSubscription = this.renderer.listen('window', 'blur', (e) => {
2717
+ if (this.popupRef) {
2718
+ this.closePopup(e);
2719
+ }
2720
+ });
2721
+ this.closeSubscription = () => {
2722
+ closeClickSubscription();
2723
+ closeBlurSubscription();
2724
+ };
2725
+ });
2726
+ }
2727
+ ngOnDestroy() {
2728
+ if (this.closeSubscription) {
2729
+ this.closeSubscription();
2730
+ this.closeSubscription = null;
2731
+ }
2732
+ this.unbindShowHandler();
2733
+ this.removePopup();
2734
+ }
2735
+ /**
2736
+ * @hidden
2737
+ */
2738
+ emitMenuEvent(name, args) {
2739
+ args.target = this.currentTarget;
2740
+ args.sender = this;
2741
+ this[name].emit(args);
2742
+ if (name === 'select' && !args.hasContent) {
2743
+ this.closeAndFocus(args.originalEvent);
2744
+ }
2745
+ }
2746
+ bindShowHandler() {
2747
+ this.unbindShowHandler();
2748
+ this.ngZone.runOutsideAngular(() => {
2749
+ const element = this.targetElement();
2750
+ if (!element) {
2751
+ return;
2752
+ }
2753
+ const eventName = this.showOn || CONTEXT_MENU;
2754
+ this.showSubscription = this.renderer.listen(element, this.showOn || CONTEXT_MENU, (e) => {
2755
+ this.showContextMenu(e, element);
2756
+ });
2757
+ if (eventName === CONTEXT_MENU) {
2758
+ this.keydownSubscription = this.renderer.listen(element, 'keydown', (e) => {
2759
+ if (e.shiftKey && e.keyCode === Keys.F10) {
2760
+ this.showContextMenu(e, element);
2761
+ }
2762
+ });
2763
+ }
2764
+ });
2765
+ }
2766
+ showContextMenu(e, element) {
2767
+ const filter = this.targetFilter();
2768
+ let currentTarget = element;
2769
+ if (filter) {
2770
+ currentTarget = findInContainer(e.target, filter, element);
2771
+ if (currentTarget && currentTarget !== e.target && isFocusable(e.target)) {
2772
+ return;
2773
+ }
2774
+ if (currentTarget && this.directiveTarget) {
2775
+ currentTarget = this.target.targetService.find(currentTarget);
2776
+ }
2777
+ }
2778
+ if (!currentTarget) {
2779
+ this.closePopup(e);
2780
+ return;
2781
+ }
2782
+ this.ngZone.run(() => {
2783
+ if (!this.closePopup(e)) {
2784
+ this.currentTarget = currentTarget;
2785
+ this.openPopup(e);
2786
+ }
2787
+ });
2788
+ }
2789
+ unbindShowHandler() {
2790
+ if (this.showSubscription) {
2791
+ this.showSubscription();
2792
+ this.showSubscription = null;
2793
+ }
2794
+ if (this.keydownSubscription) {
2795
+ this.keydownSubscription();
2796
+ this.keydownSubscription = null;
2797
+ }
2798
+ }
2799
+ targetElement() {
2800
+ if (!isDocumentAvailable()) {
2801
+ return;
2802
+ }
2803
+ this.directiveTarget = false;
2804
+ let target = this.target;
2805
+ if (typeof target === 'string') {
2806
+ target = document.querySelector(target); // maybe querySelectorAll?
2807
+ }
2808
+ else if (target && target.nativeElement) {
2809
+ target = target.nativeElement;
2810
+ }
2811
+ else if (target instanceof ContextMenuTargetContainerDirective) {
2812
+ target = target.element;
2813
+ this.directiveTarget = true;
2814
+ }
2815
+ return target;
2816
+ }
2817
+ targetFilter() {
2818
+ if (this.directiveTarget) {
2819
+ return `.${TARGET_CLASS}`;
2820
+ }
2821
+ return this.filter;
2822
+ }
2823
+ closePopup(e) {
2824
+ if (!this.popupRef) {
2825
+ return;
2826
+ }
2827
+ return this.popupAction('popupClose', e, () => {
2828
+ this.removePopup();
2829
+ });
2830
+ }
2831
+ removePopup() {
2832
+ if (this.popupRef) {
2833
+ this.popupRef.close();
2834
+ this.popupRef = null;
2835
+ this.currentTarget = null;
2836
+ }
2837
+ if (this.popupSubscriptions) {
2838
+ this.popupSubscriptions();
2839
+ this.popupSubscriptions = null;
2840
+ }
2841
+ }
2842
+ openPopup(e) {
2843
+ this.popupAction('popupOpen', e, () => {
2844
+ e.preventDefault();
2845
+ let anchor, offset;
2846
+ if (this.alignToAnchor || e.type === 'keydown') {
2847
+ anchor = this.currentTargetElement;
2848
+ }
2849
+ else {
2850
+ offset = { left: e.pageX, top: e.pageY };
2851
+ }
2852
+ this.createPopup({ anchor, offset });
2853
+ });
2854
+ }
2855
+ createPopup(options) {
2856
+ this.popupRef = this.popupService.open(Object.assign({
2857
+ animate: defined(this.popupAnimate) ? this.popupAnimate : true,
2858
+ appendTo: this.appendTo,
2859
+ collision: this.collision || DEFAULT_COLLISION,
2860
+ popupAlign: this.popupAlign || DEFAULT_POPUP_ALIGN,
2861
+ anchorAlign: this.anchorAlign || DEFAULT_ANCHOR_ALIGN,
2862
+ content: this.contentTemplate ? this.contentTemplate.templateRef : this.defaultContentTemplate,
2863
+ popupClass: 'k-menu-popup'
2864
+ }, options));
2865
+ const element = this.popupRef.popupElement;
2866
+ this.renderer.addClass(element, 'k-context-menu-popup');
2867
+ this.renderer.setAttribute(element, 'tabindex', '-1');
2868
+ this.renderer.setStyle(element, 'outline', '0'); //possibly move to styles
2869
+ if (this.ariaLabel) {
2870
+ this.renderer.setAttribute(element, 'aria-label', this.ariaLabel);
2871
+ }
2872
+ this.activeTarget = this.currentTargetElement === document.activeElement;
2873
+ this.ngZone.runOutsideAngular(() => {
2874
+ const unbindKeyDown = this.renderer.listen(element, 'keydown', this.popupKeyDownHandler);
2875
+ const unbindContextmenu = this.renderer.listen(element, 'contextmenu', preventDefault);
2876
+ this.popupSubscriptions = () => {
2877
+ unbindKeyDown();
2878
+ unbindContextmenu();
2879
+ };
2880
+ });
2881
+ element.focus();
2882
+ }
2883
+ closeAndFocus(e) {
2884
+ const currentTarget = this.currentTargetElement;
2885
+ if (!this.closePopup(e) && this.activeTarget) {
2886
+ currentTarget.focus();
2887
+ }
2888
+ }
2889
+ popupKeyDownHandler(e) {
2890
+ const element = this.popupRef.popupElement;
2891
+ if (e.keyCode === Keys.Escape && (hasClass(e.target, 'k-menu-item') || e.target === element)) {
2892
+ this.closeAndFocus(e);
2893
+ }
2894
+ else if (e.target === element) {
2895
+ this.service.keydown.emit(e);
2896
+ }
2897
+ }
2898
+ popupAction(name, originalEvent, callback) {
2899
+ const emitter = this[name];
2900
+ let prevented = false;
2901
+ if (hasObservers(emitter)) {
2902
+ this.ngZone.run(() => {
2903
+ const args = new ContextMenuPopupEvent({
2904
+ originalEvent: originalEvent,
2905
+ sender: this,
2906
+ target: this.currentTarget
2907
+ });
2908
+ emitter.emit(args);
2909
+ if (!args.isDefaultPrevented()) {
2910
+ callback();
2911
+ }
2912
+ prevented = args.isDefaultPrevented();
2913
+ });
2914
+ }
2915
+ else {
2916
+ callback();
2917
+ }
2918
+ return prevented;
2919
+ }
2920
+ get currentTargetElement() {
2921
+ return this.directiveTarget && this.currentTarget ? this.currentTarget.element : this.currentTarget;
2922
+ }
2923
+ }
2924
+ ContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuComponent, deps: [{ token: i6.PopupService }, { token: ContextMenuService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2925
+ ContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: [
2926
+ ContextMenuService,
2927
+ LocalizationService,
2928
+ {
2929
+ provide: L10N_PREFIX,
2930
+ useValue: 'kendo.contextmenu'
2931
+ },
2932
+ {
2933
+ provide: ItemsService,
2934
+ useClass: ContextMenuItemsService
2935
+ },
2936
+ {
2937
+ provide: MenuBase,
2938
+ useExisting: forwardRef(() => ContextMenuComponent)
2939
+ },
2940
+ PopupService,
2941
+ {
2942
+ provide: POPUP_CONTAINER,
2943
+ useFactory: bodyFactory
2944
+ }
2945
+ ], 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: `
2946
+ <ng-template #default>
2947
+ <kendo-menu [items]="rootItems"
2948
+ [size]="size"
2949
+ [vertical]="vertical"
2950
+ [openOnClick]="openOnClick"
2951
+ [hoverDelay]="hoverDelay"
2952
+ [animate]="animate"
2953
+ [menuItemTemplate]="itemTemplate.first?.templateRef"
2954
+ [menuItemLinkTemplate]="itemLinkTemplate.first?.templateRef"
2955
+ ></kendo-menu>
2956
+ </ng-template>
2957
+ `, isInline: true, components: [{ type: MenuComponent, selector: "kendo-menu", inputs: ["menuItemTemplate", "menuItemLinkTemplate"], outputs: ["select", "open", "close"], exportAs: ["kendoMenu"] }] });
2958
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuComponent, decorators: [{
2959
+ type: Component,
2960
+ args: [{
2961
+ exportAs: 'kendoContextMenu',
2962
+ providers: [
2963
+ ContextMenuService,
2964
+ LocalizationService,
2965
+ {
2966
+ provide: L10N_PREFIX,
2967
+ useValue: 'kendo.contextmenu'
2968
+ },
2969
+ {
2970
+ provide: ItemsService,
2971
+ useClass: ContextMenuItemsService
2972
+ },
2973
+ {
2974
+ provide: MenuBase,
2975
+ useExisting: forwardRef(() => ContextMenuComponent)
2976
+ },
2977
+ PopupService,
2978
+ {
2979
+ provide: POPUP_CONTAINER,
2980
+ useFactory: bodyFactory
2981
+ }
2982
+ ],
2983
+ selector: 'kendo-contextmenu',
2984
+ template: `
2985
+ <ng-template #default>
2986
+ <kendo-menu [items]="rootItems"
2987
+ [size]="size"
2988
+ [vertical]="vertical"
2989
+ [openOnClick]="openOnClick"
2990
+ [hoverDelay]="hoverDelay"
2991
+ [animate]="animate"
2992
+ [menuItemTemplate]="itemTemplate.first?.templateRef"
2993
+ [menuItemLinkTemplate]="itemLinkTemplate.first?.templateRef"
2994
+ ></kendo-menu>
2995
+ </ng-template>
2996
+ `
2997
+ }]
2998
+ }], ctorParameters: function () { return [{ type: i6.PopupService }, { type: ContextMenuService }, { type: i0.NgZone }, { type: i0.Renderer2 }]; }, propDecorators: { showOn: [{
2999
+ type: Input
3000
+ }], target: [{
3001
+ type: Input
3002
+ }], filter: [{
3003
+ type: Input
3004
+ }], alignToAnchor: [{
3005
+ type: Input
3006
+ }], vertical: [{
3007
+ type: Input
3008
+ }], popupAnimate: [{
3009
+ type: Input
3010
+ }], popupAlign: [{
3011
+ type: Input
3012
+ }], anchorAlign: [{
3013
+ type: Input
3014
+ }], collision: [{
3015
+ type: Input
3016
+ }], appendTo: [{
3017
+ type: Input
3018
+ }], ariaLabel: [{
3019
+ type: Input
3020
+ }], popupOpen: [{
3021
+ type: Output
3022
+ }], popupClose: [{
3023
+ type: Output
3024
+ }], select: [{
3025
+ type: Output
3026
+ }], open: [{
3027
+ type: Output
3028
+ }], close: [{
3029
+ type: Output
3030
+ }], contentTemplate: [{
3031
+ type: ContentChild,
3032
+ args: [ContextMenuTemplateDirective, { static: false }]
3033
+ }], defaultContentTemplate: [{
3034
+ type: ViewChild,
3035
+ args: ['default', { static: false }]
3036
+ }] } });
3037
+
3038
+ const COMPONENT_DIRECTIVES = [
3039
+ ContextMenuComponent,
3040
+ ContextMenuTemplateDirective,
3041
+ ContextMenuTargetDirective,
3042
+ ContextMenuTargetContainerDirective
3043
+ ];
3044
+ /**
3045
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
3046
+ * definition for the ContextMenu component.
3047
+ *
3048
+ * @example
3049
+ *
3050
+ * ```ts-no-run
3051
+ * // Import the ContextMenu module
3052
+ * import { ContextMenuModule } from '@progress/kendo-angular-menu';
3053
+ *
3054
+ * // The browser platform with a compiler
3055
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3056
+ * import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3057
+ *
3058
+ * import { NgModule } from '@angular/core';
3059
+ *
3060
+ * // Import the app component
3061
+ * import { AppComponent } from './app.component';
3062
+ *
3063
+ * // Define the app module
3064
+ * _@NgModule({
3065
+ * declarations: [AppComponent], // declare app component
3066
+ * imports: [BrowserModule, BrowserAnimationsModule, ContextMenuModule], // import ContextMenuModule module
3067
+ * bootstrap: [AppComponent]
3068
+ * })
3069
+ * export class AppModule {}
3070
+ *
3071
+ * // Compile and launch the module
3072
+ * platformBrowserDynamic().bootstrapModule(AppModule);
3073
+ *
3074
+ * ```
3075
+ */
3076
+ class ContextMenuModule {
3077
+ }
3078
+ ContextMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3079
+ ContextMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuModule, declarations: [ContextMenuComponent,
3080
+ ContextMenuTemplateDirective,
3081
+ ContextMenuTargetDirective,
3082
+ ContextMenuTargetContainerDirective], imports: [PopupModule, CommonModule, MenuModule], exports: [ContextMenuComponent,
3083
+ ContextMenuTemplateDirective,
3084
+ ContextMenuTargetDirective,
3085
+ ContextMenuTargetContainerDirective, MenuModule] });
3086
+ ContextMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuModule, imports: [[PopupModule, CommonModule, MenuModule], MenuModule] });
3087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ContextMenuModule, decorators: [{
3088
+ type: NgModule,
3089
+ args: [{
3090
+ declarations: [COMPONENT_DIRECTIVES],
3091
+ exports: [COMPONENT_DIRECTIVES, MenuModule],
3092
+ imports: [PopupModule, CommonModule, MenuModule]
3093
+ }]
3094
+ }] });
3095
+
3096
+ /**
3097
+ * A [module](link:site.data.urls.angular['ngmoduleapi']) that includes the Menu and ContextMenu components and directives.
3098
+ * Imports the MenusModule into your application [root module](link:site.data.urls.angular['ngmodules']#angular-modularity)
3099
+ * or any other sub-module that will use the Menu and ContextMenu components.
3100
+ *
3101
+ * @example
3102
+ * ```ts-no-run
3103
+ * import { NgModule } from '@angular/core';
3104
+ * import { BrowserModule } from '@angular/platform-browser';
3105
+ * import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3106
+ * import { MenusModule } from '@progress/kendo-angular-menu';
3107
+ * import { AppComponent } from './app.component';
3108
+ *
3109
+ * _@NgModule({
3110
+ * bootstrap: [AppComponent],
3111
+ * declarations: [AppComponent],
3112
+ * imports: [BrowserModule, BrowserAnimationsModule, MenusModule]
3113
+ * })
3114
+ * export class AppModule {
3115
+ * }
3116
+ * ```
3117
+ */
3118
+ class MenusModule {
3119
+ }
3120
+ MenusModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3121
+ MenusModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenusModule, exports: [MenuModule, ContextMenuModule] });
3122
+ MenusModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenusModule, imports: [MenuModule, ContextMenuModule] });
3123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MenusModule, decorators: [{
3124
+ type: NgModule,
3125
+ args: [{
3126
+ exports: [MenuModule, ContextMenuModule]
3127
+ }]
3128
+ }] });
3129
+
3130
+ /**
3131
+ * Generated bundle index. Do not edit.
3132
+ */
3133
+
3134
+ export { ContextMenuComponent, ContextMenuEvent, ContextMenuModule, ContextMenuPopupEvent, ContextMenuSelectEvent, ContextMenuService, ContextMenuTargetContainerDirective, ContextMenuTargetDirective, ContextMenuTemplateDirective, ExpandArrowDirective, FlatBindingDirective, HierarchyBindingDirective, ItemComponent, ItemContentTemplateDirective, ItemLinkTemplateDirective, ItemTemplateDirective, ItemsService, LinkDirective, ListComponent, MenuComponent, MenuEvent, MenuItemComponent, MenuModule, MenuSelectEvent, MenusModule };
3135
+