@progress/kendo-angular-menu 3.0.6 → 4.0.0-next.202203230842

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/bundles/kendo-angular-menu.umd.js +5 -0
  2. package/{dist/es2015/constants.d.ts → constants.d.ts} +0 -0
  3. package/{dist/es2015/context-menu → context-menu}/context-menu-event.d.ts +0 -0
  4. package/{dist/es2015/context-menu → context-menu}/context-menu-items.service.d.ts +3 -0
  5. package/{dist/es2015/context-menu → context-menu}/context-menu-popup-event.d.ts +0 -0
  6. package/{dist/es2015/context-menu → context-menu}/context-menu-select-event.d.ts +0 -0
  7. package/{dist/es2015/context-menu → context-menu}/context-menu-target-container.directive.d.ts +3 -0
  8. package/{dist/es2015/context-menu → context-menu}/context-menu-target.directive.d.ts +3 -0
  9. package/{dist/es2015/context-menu → context-menu}/context-menu-target.service.d.ts +3 -0
  10. package/{dist/es2015/context-menu → context-menu}/context-menu-template.directive.d.ts +3 -0
  11. package/{dist/es2015/context-menu → context-menu}/context-menu.component.d.ts +4 -1
  12. package/{dist/es2015/context-menu → context-menu}/context-menu.module.d.ts +11 -0
  13. package/{dist/es2015/context-menu → context-menu}/context-menu.service.d.ts +3 -0
  14. package/{dist/es2015/data-binding → data-binding}/binding-directive-base.d.ts +3 -0
  15. package/{dist/es2015/data-binding → data-binding}/flat-binding.directive.d.ts +3 -0
  16. package/{dist/es2015/data-binding → data-binding}/hierachy-binding.directive.d.ts +3 -0
  17. package/{dist/es2015/data-binding → data-binding}/utils.d.ts +0 -0
  18. package/{dist/es2015/dom-queries.d.ts → dom-queries.d.ts} +0 -0
  19. package/{dist/es2015 → esm2015}/constants.js +0 -0
  20. package/{dist/es2015 → esm2015}/context-menu/context-menu-event.js +0 -0
  21. package/esm2015/context-menu/context-menu-items.service.js +25 -0
  22. package/{dist/es2015 → esm2015}/context-menu/context-menu-popup-event.js +0 -0
  23. package/{dist/es2015 → esm2015}/context-menu/context-menu-select-event.js +0 -0
  24. package/esm2015/context-menu/context-menu-target-container.directive.js +32 -0
  25. package/esm2015/context-menu/context-menu-target.directive.js +46 -0
  26. package/{dist/es2015 → esm2015}/context-menu/context-menu-target.service.js +8 -10
  27. package/esm2015/context-menu/context-menu-template.directive.js +32 -0
  28. package/{dist/es2015 → esm2015}/context-menu/context-menu.component.js +107 -113
  29. package/{dist/es2015 → esm2015}/context-menu/context-menu.module.js +20 -11
  30. package/{dist/es2015 → esm2015}/context-menu/context-menu.service.js +8 -10
  31. package/{dist/es2015 → esm2015}/data-binding/binding-directive-base.js +11 -0
  32. package/esm2015/data-binding/flat-binding.directive.js +82 -0
  33. package/esm2015/data-binding/hierachy-binding.directive.js +71 -0
  34. package/{dist/es2015 → esm2015}/data-binding/utils.js +0 -1
  35. package/{dist/es2015 → esm2015}/dom-queries.js +0 -3
  36. package/{dist/es/constants.js → esm2015/kendo-angular-menu.js} +2 -2
  37. package/{dist/es → esm2015}/main.js +3 -2
  38. package/{dist/es → esm2015}/menu-animation.interface.js +1 -0
  39. package/esm2015/menu-base.js +69 -0
  40. package/{dist/es2015 → esm2015}/menu-event.js +0 -0
  41. package/{dist/es2015 → esm2015}/menu-item.component.js +41 -60
  42. package/{dist/es → esm2015}/menu-item.interface.js +1 -0
  43. package/{dist/es2015 → esm2015}/menu-select-event.js +0 -0
  44. package/{dist/es2015 → esm2015}/menu.component.js +76 -63
  45. package/{dist/es2015 → esm2015}/menu.module.js +32 -13
  46. package/{dist/es2015 → esm2015}/menus.module.js +12 -9
  47. package/{dist/es2015 → esm2015}/open-on-click-settings.js +0 -1
  48. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  49. package/{dist/es2015 → esm2015}/preventable-event.js +0 -0
  50. package/esm2015/rendering/arrow.directive.js +62 -0
  51. package/esm2015/rendering/link.directive.js +54 -0
  52. package/esm2015/rendering/list.component.js +546 -0
  53. package/{dist/es2015 → esm2015}/rendering/popup-settings.js +0 -0
  54. package/{dist/es2015 → esm2015}/services/actions.service.js +21 -14
  55. package/{dist/es2015 → esm2015}/services/hover.service.js +10 -10
  56. package/{dist/es2015 → esm2015}/services/items.service.js +8 -13
  57. package/{dist/es2015 → esm2015}/services/navigation.service.js +12 -15
  58. package/{dist/es2015 → esm2015}/templates/item-content-template.directive.js +14 -12
  59. package/{dist/es2015 → esm2015}/templates/item-link-template.directive.js +14 -12
  60. package/{dist/es2015 → esm2015}/templates/item-template.directive.js +14 -12
  61. package/{dist/es2015 → esm2015}/utils.js +0 -0
  62. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-menu.js} +1112 -1113
  63. package/kendo-angular-menu.d.ts +9 -0
  64. package/{dist/es2015/main.d.ts → main.d.ts} +3 -2
  65. package/{dist/es2015/menu-animation.interface.d.ts → menu-animation.interface.d.ts} +0 -0
  66. package/{dist/es2015/menu-base.d.ts → menu-base.d.ts} +4 -1
  67. package/{dist/es2015/menu-event.d.ts → menu-event.d.ts} +0 -0
  68. package/{dist/es2015/menu-item.component.d.ts → menu-item.component.d.ts} +7 -4
  69. package/{dist/es2015/menu-item.interface.d.ts → menu-item.interface.d.ts} +0 -0
  70. package/{dist/es2015/menu-select-event.d.ts → menu-select-event.d.ts} +0 -0
  71. package/{dist/es2015/menu.component.d.ts → menu.component.d.ts} +7 -4
  72. package/menu.module.d.ts +54 -0
  73. package/{dist/es2015/menus.module.d.ts → menus.module.d.ts} +6 -0
  74. package/{dist/es2015/open-on-click-settings.d.ts → open-on-click-settings.d.ts} +0 -0
  75. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  76. package/package.json +31 -106
  77. package/{dist/es2015/preventable-event.d.ts → preventable-event.d.ts} +0 -0
  78. package/{dist/es2015/rendering → rendering}/arrow.directive.d.ts +6 -3
  79. package/{dist/es2015/rendering → rendering}/link.directive.d.ts +4 -1
  80. package/rendering/list.component.d.ts +104 -0
  81. package/{dist/es2015/rendering → rendering}/popup-settings.d.ts +0 -0
  82. package/schematics/ngAdd/index.js +5 -2
  83. package/schematics/ngAdd/index.js.map +1 -1
  84. package/{dist/es2015/services → services}/actions.service.d.ts +24 -1
  85. package/{dist/es2015/services → services}/hover.service.d.ts +7 -2
  86. package/{dist/es2015/services → services}/items.service.d.ts +4 -1
  87. package/{dist/es2015/services → services}/navigation.service.d.ts +6 -3
  88. package/{dist/es2015/templates → templates}/item-content-template.directive.d.ts +3 -0
  89. package/{dist/es2015/templates → templates}/item-link-template.directive.d.ts +3 -0
  90. package/{dist/es2015/templates → templates}/item-template.directive.d.ts +3 -0
  91. package/{dist/es2015/utils.d.ts → utils.d.ts} +1 -1
  92. package/dist/cdn/js/kendo-angular-menu.js +0 -20
  93. package/dist/cdn/main.js +0 -5
  94. package/dist/es/context-menu/context-menu-event.js +0 -13
  95. package/dist/es/context-menu/context-menu-items.service.js +0 -26
  96. package/dist/es/context-menu/context-menu-popup-event.js +0 -17
  97. package/dist/es/context-menu/context-menu-select-event.js +0 -17
  98. package/dist/es/context-menu/context-menu-target-container.directive.js +0 -31
  99. package/dist/es/context-menu/context-menu-target.directive.js +0 -48
  100. package/dist/es/context-menu/context-menu-target.service.js +0 -29
  101. package/dist/es/context-menu/context-menu-template.directive.js +0 -31
  102. package/dist/es/context-menu/context-menu.component.js +0 -456
  103. package/dist/es/context-menu/context-menu.module.js +0 -64
  104. package/dist/es/context-menu/context-menu.service.js +0 -30
  105. package/dist/es/data-binding/binding-directive-base.js +0 -32
  106. package/dist/es/data-binding/flat-binding.directive.js +0 -104
  107. package/dist/es/data-binding/hierachy-binding.directive.js +0 -94
  108. package/dist/es/data-binding/utils.js +0 -32
  109. package/dist/es/dom-queries.js +0 -107
  110. package/dist/es/index.js +0 -21
  111. package/dist/es/menu-base.js +0 -79
  112. package/dist/es/menu-event.js +0 -17
  113. package/dist/es/menu-item.component.js +0 -165
  114. package/dist/es/menu-select-event.js +0 -17
  115. package/dist/es/menu.component.js +0 -256
  116. package/dist/es/menu.module.js +0 -79
  117. package/dist/es/menus.module.js +0 -41
  118. package/dist/es/open-on-click-settings.js +0 -13
  119. package/dist/es/package-metadata.js +0 -15
  120. package/dist/es/preventable-event.js +0 -36
  121. package/dist/es/rendering/arrow.directive.js +0 -81
  122. package/dist/es/rendering/item.component.js +0 -337
  123. package/dist/es/rendering/link.directive.js +0 -62
  124. package/dist/es/rendering/list.component.js +0 -219
  125. package/dist/es/rendering/popup-settings.js +0 -66
  126. package/dist/es/services/actions.service.js +0 -178
  127. package/dist/es/services/hover.service.js +0 -136
  128. package/dist/es/services/items.service.js +0 -140
  129. package/dist/es/services/navigation.service.js +0 -274
  130. package/dist/es/templates/item-content-template.directive.js +0 -50
  131. package/dist/es/templates/item-link-template.directive.js +0 -52
  132. package/dist/es/templates/item-template.directive.js +0 -51
  133. package/dist/es/utils.js +0 -18
  134. package/dist/es2015/context-menu/context-menu-items.service.js +0 -25
  135. package/dist/es2015/context-menu/context-menu-target-container.directive.js +0 -30
  136. package/dist/es2015/context-menu/context-menu-target.directive.js +0 -47
  137. package/dist/es2015/context-menu/context-menu-template.directive.js +0 -30
  138. package/dist/es2015/data-binding/flat-binding.directive.js +0 -101
  139. package/dist/es2015/data-binding/hierachy-binding.directive.js +0 -90
  140. package/dist/es2015/index.d.ts +0 -21
  141. package/dist/es2015/index.js +0 -21
  142. package/dist/es2015/index.metadata.json +0 -1
  143. package/dist/es2015/main.js +0 -26
  144. package/dist/es2015/menu-animation.interface.js +0 -4
  145. package/dist/es2015/menu-base.js +0 -73
  146. package/dist/es2015/menu-item.interface.js +0 -4
  147. package/dist/es2015/menu.module.d.ts +0 -38
  148. package/dist/es2015/rendering/arrow.directive.js +0 -68
  149. package/dist/es2015/rendering/item.component.d.ts +0 -64
  150. package/dist/es2015/rendering/item.component.js +0 -327
  151. package/dist/es2015/rendering/link.directive.js +0 -57
  152. package/dist/es2015/rendering/list.component.d.ts +0 -41
  153. package/dist/es2015/rendering/list.component.js +0 -233
  154. package/dist/fesm5/index.js +0 -3222
  155. package/dist/npm/constants.js +0 -10
  156. package/dist/npm/context-menu/context-menu-event.js +0 -15
  157. package/dist/npm/context-menu/context-menu-items.service.js +0 -28
  158. package/dist/npm/context-menu/context-menu-popup-event.js +0 -19
  159. package/dist/npm/context-menu/context-menu-select-event.js +0 -19
  160. package/dist/npm/context-menu/context-menu-target-container.directive.js +0 -33
  161. package/dist/npm/context-menu/context-menu-target.directive.js +0 -50
  162. package/dist/npm/context-menu/context-menu-target.service.js +0 -31
  163. package/dist/npm/context-menu/context-menu-template.directive.js +0 -33
  164. package/dist/npm/context-menu/context-menu.component.js +0 -459
  165. package/dist/npm/context-menu/context-menu.module.js +0 -66
  166. package/dist/npm/context-menu/context-menu.service.js +0 -32
  167. package/dist/npm/data-binding/binding-directive-base.js +0 -34
  168. package/dist/npm/data-binding/flat-binding.directive.js +0 -106
  169. package/dist/npm/data-binding/hierachy-binding.directive.js +0 -96
  170. package/dist/npm/data-binding/utils.js +0 -34
  171. package/dist/npm/dom-queries.js +0 -110
  172. package/dist/npm/index.js +0 -37
  173. package/dist/npm/main.js +0 -50
  174. package/dist/npm/menu-animation.interface.js +0 -6
  175. package/dist/npm/menu-base.js +0 -81
  176. package/dist/npm/menu-event.js +0 -19
  177. package/dist/npm/menu-item.component.js +0 -167
  178. package/dist/npm/menu-item.interface.js +0 -6
  179. package/dist/npm/menu-select-event.js +0 -19
  180. package/dist/npm/menu.component.js +0 -258
  181. package/dist/npm/menu.module.js +0 -81
  182. package/dist/npm/menus.module.js +0 -43
  183. package/dist/npm/open-on-click-settings.js +0 -15
  184. package/dist/npm/package-metadata.js +0 -17
  185. package/dist/npm/preventable-event.js +0 -38
  186. package/dist/npm/rendering/arrow.directive.js +0 -83
  187. package/dist/npm/rendering/item.component.js +0 -339
  188. package/dist/npm/rendering/link.directive.js +0 -64
  189. package/dist/npm/rendering/list.component.js +0 -221
  190. package/dist/npm/rendering/popup-settings.js +0 -68
  191. package/dist/npm/services/actions.service.js +0 -180
  192. package/dist/npm/services/hover.service.js +0 -138
  193. package/dist/npm/services/items.service.js +0 -143
  194. package/dist/npm/services/navigation.service.js +0 -276
  195. package/dist/npm/templates/item-content-template.directive.js +0 -52
  196. package/dist/npm/templates/item-link-template.directive.js +0 -54
  197. package/dist/npm/templates/item-template.directive.js +0 -53
  198. package/dist/npm/utils.js +0 -20
  199. package/dist/systemjs/kendo-angular-menu.js +0 -5
@@ -1,337 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 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 tslib_1 from "tslib";
6
- import { Component, Input, ElementRef, Renderer2, ViewChild, ChangeDetectorRef, HostBinding, TemplateRef } from '@angular/core';
7
- import { ItemsService } from '../services/items.service';
8
- import { NavigationService } from '../services/navigation.service';
9
- import { POPUP_SETTINGS, POPUP_SETTINGS_RTL } from './popup-settings';
10
- import { PopupService, POPUP_CONTAINER } from '@progress/kendo-angular-popup';
11
- import { bodyFactory } from '../utils';
12
- var ɵ0 = bodyFactory;
13
- /* tslint:disable:component-selector */
14
- /**
15
- * @hidden
16
- */
17
- var ItemComponent = /** @class */ (function () {
18
- function ItemComponent(itemsService, navigation, changeDetector, renderer, popupService, element) {
19
- this.itemsService = itemsService;
20
- this.navigation = navigation;
21
- this.changeDetector = changeDetector;
22
- this.renderer = renderer;
23
- this.popupService = popupService;
24
- this.element = element;
25
- this.animate = true;
26
- this.openOnClick = false;
27
- this.opened = false;
28
- this.navigating = false;
29
- this.destroyed = false;
30
- }
31
- Object.defineProperty(ItemComponent.prototype, "index", {
32
- get: function () {
33
- return this._index;
34
- },
35
- set: function (index) {
36
- if (this._index && this._index !== index) {
37
- this.itemsService.remove(this);
38
- this._index = index;
39
- this.itemsService.add(this);
40
- }
41
- else {
42
- this._index = index;
43
- }
44
- this.childId = this.itemsService.childId(index);
45
- },
46
- enumerable: true,
47
- configurable: true
48
- });
49
- Object.defineProperty(ItemComponent.prototype, "disabled", {
50
- get: function () {
51
- return this.item.disabled;
52
- },
53
- enumerable: true,
54
- configurable: true
55
- });
56
- Object.defineProperty(ItemComponent.prototype, "hasPopup", {
57
- get: function () {
58
- return this.hasContent ? true : null;
59
- },
60
- enumerable: true,
61
- configurable: true
62
- });
63
- Object.defineProperty(ItemComponent.prototype, "expanded", {
64
- get: function () {
65
- return this.hasContent ? this.opened : null;
66
- },
67
- enumerable: true,
68
- configurable: true
69
- });
70
- Object.defineProperty(ItemComponent.prototype, "label", {
71
- get: function () {
72
- return this.item.text ? this.item.text : null;
73
- },
74
- enumerable: true,
75
- configurable: true
76
- });
77
- Object.defineProperty(ItemComponent.prototype, "activeId", {
78
- get: function () {
79
- return this.index === this.navigation.activeIndex ? '0' : '-1';
80
- },
81
- enumerable: true,
82
- configurable: true
83
- });
84
- Object.defineProperty(ItemComponent.prototype, "popupSettings", {
85
- get: function () {
86
- var settings = this.rtl ? POPUP_SETTINGS_RTL : POPUP_SETTINGS;
87
- return this.horizontal ? settings.horizontal : settings.vertical;
88
- },
89
- enumerable: true,
90
- configurable: true
91
- });
92
- Object.defineProperty(ItemComponent.prototype, "horizontal", {
93
- get: function () {
94
- return this.vertical || this.level > 0;
95
- },
96
- enumerable: true,
97
- configurable: true
98
- });
99
- Object.defineProperty(ItemComponent.prototype, "hasLink", {
100
- get: function () {
101
- return Boolean(this.item.url);
102
- },
103
- enumerable: true,
104
- configurable: true
105
- });
106
- Object.defineProperty(ItemComponent.prototype, "linkTemplate", {
107
- get: function () {
108
- return this.item.linkTemplate || this.itemLinkTemplate;
109
- },
110
- enumerable: true,
111
- configurable: true
112
- });
113
- Object.defineProperty(ItemComponent.prototype, "hasContent", {
114
- get: function () {
115
- var items = this.item.items;
116
- return items && items.length || this.item.contentTemplate;
117
- },
118
- enumerable: true,
119
- configurable: true
120
- });
121
- Object.defineProperty(ItemComponent.prototype, "isContent", {
122
- get: function () {
123
- return Boolean(this.item.content);
124
- },
125
- enumerable: true,
126
- configurable: true
127
- });
128
- Object.defineProperty(ItemComponent.prototype, "iconClass", {
129
- get: function () {
130
- return "k-i-" + this.item.icon;
131
- },
132
- enumerable: true,
133
- configurable: true
134
- });
135
- Object.defineProperty(ItemComponent.prototype, "children", {
136
- get: function () {
137
- var item = this.item;
138
- if (item.contentTemplate) {
139
- if (!this.contentItems) {
140
- this.contentItems = [{
141
- content: item.contentTemplate,
142
- owner: item,
143
- ownerIndex: this.index
144
- }];
145
- }
146
- return this.contentItems;
147
- }
148
- return item.items;
149
- },
150
- enumerable: true,
151
- configurable: true
152
- });
153
- Object.defineProperty(ItemComponent.prototype, "template", {
154
- get: function () {
155
- return this.item.template || this.itemTemplate;
156
- },
157
- enumerable: true,
158
- configurable: true
159
- });
160
- ItemComponent.prototype.hasContentTemplates = function () {
161
- var item = this.item;
162
- return this.itemTemplate || item.contentTemplate || this.itemLinkTemplate ||
163
- (item.items && item.items.find(function (current) { return current.template || current.linkTemplate; }));
164
- };
165
- ItemComponent.prototype.ngOnInit = function () {
166
- this.itemsService.add(this);
167
- };
168
- ItemComponent.prototype.ngOnDestroy = function () {
169
- this.itemsService.remove(this);
170
- this.destroyed = true;
171
- if (this.popupRef) {
172
- this.popupRef.close();
173
- this.popupRef = null;
174
- }
175
- };
176
- ItemComponent.prototype.focus = function () {
177
- this.element.nativeElement.focus();
178
- };
179
- ItemComponent.prototype.blur = function () {
180
- this.element.nativeElement.blur();
181
- };
182
- ItemComponent.prototype.toggleActive = function (isActive) {
183
- if (isActive) {
184
- this.setAttribute('tabindex', '0');
185
- }
186
- else {
187
- this.setAttribute('tabindex', '-1');
188
- }
189
- };
190
- ItemComponent.prototype.open = function () {
191
- if (!this.destroyed && this.hasContent && !this.opened) {
192
- var popupSettings = this.popupSettings;
193
- var animate = this.animate ? Object.assign({}, this.animate, {
194
- direction: popupSettings.animate
195
- }) : false;
196
- this.opened = true;
197
- this.popupRef = this.popupService.open({
198
- popupAlign: popupSettings.popup,
199
- anchorAlign: popupSettings.anchor,
200
- collision: popupSettings.collision,
201
- anchor: this.element,
202
- positionMode: 'absolute',
203
- content: this.popupTemplate,
204
- popupClass: {
205
- 'k-rtl': this.rtl,
206
- 'k-menu-popup': true
207
- },
208
- animate: animate
209
- });
210
- this.setAttribute('aria-expanded', 'true');
211
- this.setAttribute('aria-owns', this.childId);
212
- this.changeDetector.detectChanges();
213
- }
214
- };
215
- ItemComponent.prototype.close = function () {
216
- if (!this.destroyed && this.opened) {
217
- this.opened = false;
218
- if (this.popupRef) {
219
- this.popupRef.close();
220
- this.popupRef = null;
221
- }
222
- this.changeDetector.detectChanges();
223
- this.setAttribute('aria-expanded', 'false');
224
- this.renderer.removeAttribute(this.element.nativeElement, 'aria-owns');
225
- }
226
- };
227
- ItemComponent.prototype.navigate = function () {
228
- var link;
229
- if (this.linkTemplate) {
230
- link = this.element.nativeElement.querySelector('a.k-menu-link');
231
- }
232
- else if (this.hasLink) {
233
- link = this.link.nativeElement;
234
- }
235
- if (link) {
236
- this.navigating = true;
237
- link.click();
238
- this.navigating = false;
239
- }
240
- };
241
- ItemComponent.prototype.setAttribute = function (name, value) {
242
- this.renderer.setAttribute(this.element.nativeElement, name, value);
243
- };
244
- tslib_1.__decorate([
245
- Input(),
246
- tslib_1.__metadata("design:type", Object)
247
- ], ItemComponent.prototype, "item", void 0);
248
- tslib_1.__decorate([
249
- Input(),
250
- tslib_1.__metadata("design:type", Number)
251
- ], ItemComponent.prototype, "level", void 0);
252
- tslib_1.__decorate([
253
- Input(),
254
- tslib_1.__metadata("design:type", String),
255
- tslib_1.__metadata("design:paramtypes", [String])
256
- ], ItemComponent.prototype, "index", null);
257
- tslib_1.__decorate([
258
- Input(),
259
- tslib_1.__metadata("design:type", Number)
260
- ], ItemComponent.prototype, "siblingIndex", void 0);
261
- tslib_1.__decorate([
262
- Input(),
263
- tslib_1.__metadata("design:type", Object)
264
- ], ItemComponent.prototype, "animate", void 0);
265
- tslib_1.__decorate([
266
- Input(),
267
- tslib_1.__metadata("design:type", Boolean)
268
- ], ItemComponent.prototype, "vertical", void 0);
269
- tslib_1.__decorate([
270
- Input(),
271
- tslib_1.__metadata("design:type", Boolean)
272
- ], ItemComponent.prototype, "rtl", void 0);
273
- tslib_1.__decorate([
274
- Input(),
275
- tslib_1.__metadata("design:type", Boolean)
276
- ], ItemComponent.prototype, "openOnClick", void 0);
277
- tslib_1.__decorate([
278
- Input(),
279
- tslib_1.__metadata("design:type", TemplateRef)
280
- ], ItemComponent.prototype, "itemTemplate", void 0);
281
- tslib_1.__decorate([
282
- Input(),
283
- tslib_1.__metadata("design:type", TemplateRef)
284
- ], ItemComponent.prototype, "itemLinkTemplate", void 0);
285
- tslib_1.__decorate([
286
- ViewChild('link', { static: false }),
287
- tslib_1.__metadata("design:type", ElementRef)
288
- ], ItemComponent.prototype, "link", void 0);
289
- tslib_1.__decorate([
290
- ViewChild('popupTemplate', { static: true }),
291
- tslib_1.__metadata("design:type", TemplateRef)
292
- ], ItemComponent.prototype, "popupTemplate", void 0);
293
- tslib_1.__decorate([
294
- HostBinding('attr.aria-disabled'),
295
- tslib_1.__metadata("design:type", Boolean),
296
- tslib_1.__metadata("design:paramtypes", [])
297
- ], ItemComponent.prototype, "disabled", null);
298
- tslib_1.__decorate([
299
- HostBinding('attr.aria-haspopup'),
300
- tslib_1.__metadata("design:type", Boolean),
301
- tslib_1.__metadata("design:paramtypes", [])
302
- ], ItemComponent.prototype, "hasPopup", null);
303
- tslib_1.__decorate([
304
- HostBinding('attr.aria-expanded'),
305
- tslib_1.__metadata("design:type", Boolean),
306
- tslib_1.__metadata("design:paramtypes", [])
307
- ], ItemComponent.prototype, "expanded", null);
308
- tslib_1.__decorate([
309
- HostBinding('attr.aria-label'),
310
- tslib_1.__metadata("design:type", Boolean),
311
- tslib_1.__metadata("design:paramtypes", [])
312
- ], ItemComponent.prototype, "label", null);
313
- tslib_1.__decorate([
314
- HostBinding('attr.tabindex'),
315
- tslib_1.__metadata("design:type", String),
316
- tslib_1.__metadata("design:paramtypes", [])
317
- ], ItemComponent.prototype, "activeId", null);
318
- ItemComponent = tslib_1.__decorate([
319
- Component({
320
- providers: [PopupService, {
321
- provide: POPUP_CONTAINER,
322
- useFactory: ɵ0
323
- }],
324
- selector: '[kendoMenuItem]',
325
- template: "\n <span *ngIf=\"!hasLink && !item.content && !linkTemplate\" class=\"k-link k-menu-link\" #link\n [class.k-state-active]=\"opened\" role=\"presentation\">\n <ng-template [ngTemplateOutlet]=\"itemcontent\">\n </ng-template>\n </span>\n <a *ngIf=\"item.url && !linkTemplate\" class=\"k-link k-menu-link\" #link [attr.href]=\"item.url\"\n [class.k-state-active]=\"opened\" tabindex=\"-1\" role=\"presentation\">\n <ng-template [ngTemplateOutlet]=\"itemcontent\">\n </ng-template>\n </a>\n <ng-template *ngIf=\"linkTemplate && !item.content\" [ngTemplateOutlet]=\"linkTemplate\"\n [ngTemplateOutletContext]=\"{ item: item, index: index }\">\n </ng-template>\n\n <div class=\"k-content\" *ngIf=\"item.content\" role=\"presentation\">\n <ng-template [ngTemplateOutlet]=\"item.content\" [ngTemplateOutletContext]=\"{ item: item.owner, index: item.ownerIndex }\">\n </ng-template>\n </div>\n\n <ng-template #popupTemplate>\n <ul kendoMenuList\n [attr.id]=\"childId\"\n [animate]=\"animate\"\n [rtl]=\"rtl\"\n [vertical]=\"vertical\"\n [openOnClick]=\"openOnClick\"\n [items]=\"children\"\n [level]=\"level + 1\"\n [index]=\"index\"\n [itemTemplate]=\"itemTemplate\"\n [itemLinkTemplate]=\"itemLinkTemplate\"\n role=\"menu\"\n class=\"k-group k-menu-group k-reset\">\n </ul>\n </ng-template>\n\n <ng-template #itemcontent>\n <span *ngIf=\"item.icon\" class=\"k-icon\" [ngClass]=\"iconClass\" role=\"presentation\"></span>\n <ng-container *ngIf=\"!template\">\n <span class=\"k-menu-link-text\">{{ item.text }}</span>\n </ng-container>\n <ng-template *ngIf=\"template\" [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item, index: index }\">\n </ng-template>\n <span class=\"k-icon k-menu-expand-arrow\" *ngIf=\"hasContent\"\n role=\"presentation\"\n [class.k-i-arrow-60-down]=\"!horizontal\"\n [class.k-i-arrow-60-right]=\"horizontal && !rtl\"\n [class.k-i-arrow-60-left]=\"horizontal && rtl\">\n </span>\n </ng-template>\n "
326
- }),
327
- tslib_1.__metadata("design:paramtypes", [ItemsService,
328
- NavigationService,
329
- ChangeDetectorRef,
330
- Renderer2,
331
- PopupService,
332
- ElementRef])
333
- ], ItemComponent);
334
- return ItemComponent;
335
- }());
336
- export { ItemComponent };
337
- export { ɵ0 };
@@ -1,62 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 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 tslib_1 from "tslib";
6
- import { Directive, Input, HostBinding, isDevMode } from '@angular/core';
7
- import { ItemsService } from '../services/items.service';
8
- /**
9
- * Represents a directive that can be used in the [`linkTemplate`]({% slug api_menu_itemlinktemplatedirective %})
10
- * of the items to apply the default styling and behavior.
11
- */
12
- var LinkDirective = /** @class */ (function () {
13
- function LinkDirective(itemsService) {
14
- this.itemsService = itemsService;
15
- this.hostClasses = true;
16
- this.role = 'presentation';
17
- this.tabindex = '-1';
18
- }
19
- Object.defineProperty(LinkDirective.prototype, "activeClass", {
20
- get: function () {
21
- return this.item.opened;
22
- },
23
- enumerable: true,
24
- configurable: true
25
- });
26
- LinkDirective.prototype.ngOnInit = function () {
27
- if (isDevMode() && !this.index) {
28
- throw new Error('The kendoMenuItemLink directive requires the item index to be set.');
29
- }
30
- this.item = this.itemsService.get(this.index) || {};
31
- };
32
- tslib_1.__decorate([
33
- Input('kendoMenuItemLink'),
34
- tslib_1.__metadata("design:type", String)
35
- ], LinkDirective.prototype, "index", void 0);
36
- tslib_1.__decorate([
37
- HostBinding('class.k-link'),
38
- HostBinding('class.k-menu-link'),
39
- tslib_1.__metadata("design:type", Boolean)
40
- ], LinkDirective.prototype, "hostClasses", void 0);
41
- tslib_1.__decorate([
42
- HostBinding('attr.role'),
43
- tslib_1.__metadata("design:type", String)
44
- ], LinkDirective.prototype, "role", void 0);
45
- tslib_1.__decorate([
46
- HostBinding('attr.tabindex'),
47
- tslib_1.__metadata("design:type", String)
48
- ], LinkDirective.prototype, "tabindex", void 0);
49
- tslib_1.__decorate([
50
- HostBinding('class.k-state-active'),
51
- tslib_1.__metadata("design:type", Boolean),
52
- tslib_1.__metadata("design:paramtypes", [])
53
- ], LinkDirective.prototype, "activeClass", null);
54
- LinkDirective = tslib_1.__decorate([
55
- Directive({
56
- selector: '[kendoMenuItemLink]'
57
- }),
58
- tslib_1.__metadata("design:paramtypes", [ItemsService])
59
- ], LinkDirective);
60
- return LinkDirective;
61
- }());
62
- export { LinkDirective };
@@ -1,219 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 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 tslib_1 from "tslib";
6
- import { Component, Input, ElementRef, TemplateRef, Renderer2, NgZone } from '@angular/core';
7
- import { ItemsService } from '../services/items.service';
8
- import { ActionsService } from '../services/actions.service';
9
- import { NavigationService } from '../services/navigation.service';
10
- import { HoverService } from '../services/hover.service';
11
- import { NODE_INDEX } from '../constants';
12
- import { closestItem, closest, hasClass, isFocusable, nodeIndex, inMenu } from '../dom-queries';
13
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
14
- /* tslint:disable:component-selector */
15
- /**
16
- * @hidden
17
- */
18
- var ListComponent = /** @class */ (function () {
19
- function ListComponent(itemsService, hover, actions, navigation, renderer, ngZone, element) {
20
- this.itemsService = itemsService;
21
- this.hover = hover;
22
- this.actions = actions;
23
- this.navigation = navigation;
24
- this.renderer = renderer;
25
- this.ngZone = ngZone;
26
- this.element = element;
27
- this.animate = true;
28
- }
29
- ListComponent.prototype.hierarchyIndex = function (index) {
30
- return this.itemsService.itemIndex(this.index, index);
31
- };
32
- ListComponent.prototype.ngOnInit = function () {
33
- this.itemsService.addList(this);
34
- this.initDomEvents();
35
- };
36
- ListComponent.prototype.ngOnDestroy = function () {
37
- this.itemsService.removeList(this);
38
- if (this.domSubscriptions) {
39
- this.domSubscriptions();
40
- }
41
- };
42
- ListComponent.prototype.initDomEvents = function () {
43
- var _this = this;
44
- if (!isDocumentAvailable() || !this.element) {
45
- return;
46
- }
47
- this.ngZone.runOutsideAngular(function () {
48
- var element = _this.element.nativeElement;
49
- var container = _this.level > 0 ? closest(element, function (node) { return hasClass(node, 'k-popup'); }) : element;
50
- var overSubscription = _this.renderer.listen(element, 'mouseover', function (e) {
51
- if (e.target === element && _this.level === 0) {
52
- _this.onLeave();
53
- }
54
- else {
55
- var item = _this.nodeItem(e.target) || _this.itemsService.get(_this.index);
56
- if (item && !(_this.openOnClick && _this.openOnClick.toggle === 'click' && item.level === 0 && !item.hasContent)) {
57
- _this.hover.over(item);
58
- }
59
- }
60
- });
61
- var leaveSubscription = _this.renderer.listen(container, 'mouseleave', function (e) {
62
- if (_this.leavesMenu(e)) {
63
- _this.onLeave();
64
- }
65
- });
66
- var keydownSubscription = _this.renderer.listen(element, 'keydown', function (e) {
67
- if (hasClass(e.target, 'k-menu-item')) {
68
- _this.navigation.keydown(e);
69
- }
70
- });
71
- var blurSubscription = _this.renderer.listen(element, 'focusout', function (e) {
72
- if (_this.leavesMenu(e)) {
73
- _this.navigation.focusLeave();
74
- }
75
- });
76
- /**
77
- * Handle focus/blur open/close for iOS devices since it behaves inconsistently with the rest
78
- * Refer to: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
79
- */
80
- var touchSubscription = _this.renderer.listen(document, 'touchstart', function (e) {
81
- if (inMenu(e.target, _this.itemsService)) {
82
- var item = _this.nodeItem(e.target);
83
- // Needs to be called because the 'click' handler will be called only on secondary tap and the item will remain unfocused
84
- _this.navigation.focus(item);
85
- // This is needed since the 'mouseover' event is not always dispatched
86
- if (!item.opened) {
87
- _this.hover.over(item);
88
- }
89
- }
90
- else if (_this.navigation.focusedIdx) {
91
- // If the touch is outside of the menu and the menu is not currently in focus
92
- var activeItem = _this.itemsService.get(_this.navigation.activeIndex);
93
- _this.onLeave(); // needs to be called explicitly since mouseleave event is not triggered
94
- activeItem.blur(); // needs to be called explicitly otherwise the item remains focused => triggers focusout
95
- }
96
- });
97
- var clickSubscription = _this.renderer.listen(element, 'click', _this.clickHandler.bind(_this));
98
- _this.domSubscriptions = function () {
99
- overSubscription();
100
- leaveSubscription();
101
- keydownSubscription();
102
- blurSubscription();
103
- clickSubscription();
104
- touchSubscription();
105
- };
106
- });
107
- };
108
- ListComponent.prototype.leavesMenu = function (e) {
109
- if (!e.relatedTarget) {
110
- return true;
111
- }
112
- return !inMenu(e.relatedTarget, this.itemsService);
113
- };
114
- ListComponent.prototype.onLeave = function () {
115
- var openOnClick = this.openOnClick;
116
- if (!openOnClick || openOnClick.toggle !== 'click') {
117
- this.hover.leave(openOnClick && openOnClick.toggle === 'leave');
118
- }
119
- };
120
- ListComponent.prototype.nodeItem = function (target) {
121
- var node = closestItem(target, this.element.nativeElement);
122
- if (node) {
123
- var index = nodeIndex(node);
124
- return this.itemsService.get(index);
125
- }
126
- };
127
- ListComponent.prototype.clickHandler = function (e) {
128
- if (isFocusable(e.target) && !hasClass(e.target, 'k-menu-item')) {
129
- return;
130
- }
131
- var item = this.nodeItem(e.target);
132
- if (!item || item.isContent || item.navigating) {
133
- return;
134
- }
135
- if (item.disabled) {
136
- e.preventDefault();
137
- return;
138
- }
139
- this.actions.select(item, e, function () {
140
- e.preventDefault();
141
- });
142
- this.navigation.focus(item);
143
- if (item.level > 0 && !item.hasContent) {
144
- this.actions.closeToRoot(item);
145
- }
146
- if (this.openOnClick) {
147
- var hover = this.hover;
148
- if (item.opened) {
149
- if (item.level === 0) {
150
- hover.openOnOver = false;
151
- this.actions.close(item);
152
- }
153
- }
154
- else if (item.hasContent) {
155
- hover.openOnOver = true;
156
- this.actions.closeOthers(item);
157
- this.actions.open(item);
158
- }
159
- else {
160
- hover.openOnOver = false;
161
- if (item.level === 0 && this.openOnClick.toggle === 'click') {
162
- this.hover.closeCurrent();
163
- }
164
- }
165
- }
166
- this.actions.execute();
167
- };
168
- tslib_1.__decorate([
169
- Input(),
170
- tslib_1.__metadata("design:type", Array)
171
- ], ListComponent.prototype, "items", void 0);
172
- tslib_1.__decorate([
173
- Input(),
174
- tslib_1.__metadata("design:type", Number)
175
- ], ListComponent.prototype, "level", void 0);
176
- tslib_1.__decorate([
177
- Input(),
178
- tslib_1.__metadata("design:type", String)
179
- ], ListComponent.prototype, "index", void 0);
180
- tslib_1.__decorate([
181
- Input(),
182
- tslib_1.__metadata("design:type", Object)
183
- ], ListComponent.prototype, "animate", void 0);
184
- tslib_1.__decorate([
185
- Input(),
186
- tslib_1.__metadata("design:type", Boolean)
187
- ], ListComponent.prototype, "vertical", void 0);
188
- tslib_1.__decorate([
189
- Input(),
190
- tslib_1.__metadata("design:type", Boolean)
191
- ], ListComponent.prototype, "rtl", void 0);
192
- tslib_1.__decorate([
193
- Input(),
194
- tslib_1.__metadata("design:type", Object)
195
- ], ListComponent.prototype, "openOnClick", void 0);
196
- tslib_1.__decorate([
197
- Input(),
198
- tslib_1.__metadata("design:type", TemplateRef)
199
- ], ListComponent.prototype, "itemTemplate", void 0);
200
- tslib_1.__decorate([
201
- Input(),
202
- tslib_1.__metadata("design:type", TemplateRef)
203
- ], ListComponent.prototype, "itemLinkTemplate", void 0);
204
- ListComponent = tslib_1.__decorate([
205
- Component({
206
- selector: '[kendoMenuList]',
207
- template: "\n <ng-container *ngFor=\"let item of items; let idx = index\">\n <li *ngIf=\"!item.separator\" kendoMenuItem\n [item]=\"item\" [level]=\"level\" [vertical]=\"vertical\" [animate]=\"animate\" [rtl]=\"rtl\"\n [itemTemplate]=\"itemTemplate\" [itemLinkTemplate]=\"itemLinkTemplate\" [openOnClick]=\"openOnClick\"\n [index]=\"hierarchyIndex(idx)\" [siblingIndex]=\"idx\" [attr." + NODE_INDEX + "]=\"hierarchyIndex(idx)\"\n [ngClass]=\"item.cssClass\" [ngStyle]=\"item.cssStyle\"\n role=\"menuitem\"\n class=\"k-item k-menu-item\"\n [class.k-first]=\"idx === 0\" [class.k-last]=\"idx === items.length - 1\"\n [class.k-state-disabled]=\"item.disabled\"></li>\n <li *ngIf=\"item.separator\" class=\"k-separator k-item\"\n role=\"separator\" [ngClass]=\"item.cssClass\" [ngStyle]=\"item.cssStyle\">\n &nbsp;\n </li>\n </ng-container>\n "
208
- }),
209
- tslib_1.__metadata("design:paramtypes", [ItemsService,
210
- HoverService,
211
- ActionsService,
212
- NavigationService,
213
- Renderer2,
214
- NgZone,
215
- ElementRef])
216
- ], ListComponent);
217
- return ListComponent;
218
- }());
219
- export { ListComponent };
@@ -1,66 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- var POPUP_ALIGN = {
6
- vertical: 'top',
7
- horizontal: 'left'
8
- };
9
- var POPUP_ALIGN_RTL = {
10
- vertical: 'top',
11
- horizontal: 'right'
12
- };
13
- var VERTICAL_COLLISION = {
14
- vertical: 'flip',
15
- horizontal: 'fit'
16
- };
17
- var HORIZONTAL_COLLISION = {
18
- vertical: 'fit',
19
- horizontal: 'flip'
20
- };
21
- /**
22
- * @hidden
23
- */
24
- export var POPUP_SETTINGS_RTL = {
25
- vertical: {
26
- anchor: {
27
- vertical: 'bottom',
28
- horizontal: 'right'
29
- },
30
- popup: POPUP_ALIGN_RTL,
31
- collision: VERTICAL_COLLISION,
32
- animate: 'down'
33
- },
34
- horizontal: {
35
- anchor: {
36
- vertical: 'top',
37
- horizontal: 'left'
38
- },
39
- popup: POPUP_ALIGN_RTL,
40
- collision: HORIZONTAL_COLLISION,
41
- animate: 'left'
42
- }
43
- };
44
- /**
45
- * @hidden
46
- */
47
- export var POPUP_SETTINGS = {
48
- vertical: {
49
- anchor: {
50
- vertical: 'bottom',
51
- horizontal: 'left'
52
- },
53
- popup: POPUP_ALIGN,
54
- collision: VERTICAL_COLLISION,
55
- animate: 'down'
56
- },
57
- horizontal: {
58
- anchor: {
59
- vertical: 'top',
60
- horizontal: 'right'
61
- },
62
- popup: POPUP_ALIGN,
63
- collision: HORIZONTAL_COLLISION,
64
- animate: 'right'
65
- }
66
- };