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

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