@progress/kendo-vue-layout 2.5.1 → 2.5.2-dev.202110121006

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 (80) hide show
  1. package/dist/cdn/js/kendo-vue-layout.js +1 -1
  2. package/dist/es/main.d.ts +5 -0
  3. package/dist/es/main.js +5 -0
  4. package/dist/es/menu/BaseMenuItemInternalProps.d.ts +20 -0
  5. package/dist/es/menu/BaseMenuItemInternalProps.js +0 -0
  6. package/dist/es/menu/MenuProps.d.ts +51 -0
  7. package/dist/es/menu/MenuProps.js +1 -0
  8. package/dist/es/menu/components/Menu.d.ts +68 -0
  9. package/dist/es/menu/components/Menu.js +300 -0
  10. package/dist/es/menu/components/MenuItemArrow.d.ts +65 -0
  11. package/dist/es/menu/components/MenuItemArrow.js +59 -0
  12. package/dist/es/menu/components/MenuItemInternal.d.ts +48 -0
  13. package/dist/es/menu/components/MenuItemInternal.js +417 -0
  14. package/dist/es/menu/components/MenuItemInternalsList.d.ts +44 -0
  15. package/dist/es/menu/components/MenuItemInternalsList.js +131 -0
  16. package/dist/es/menu/components/MenuItemLink.d.ts +49 -0
  17. package/dist/es/menu/components/MenuItemLink.js +57 -0
  18. package/dist/es/menu/consts.d.ts +54 -0
  19. package/dist/es/menu/consts.js +70 -0
  20. package/dist/es/menu/events.d.ts +14 -0
  21. package/dist/es/menu/events.js +1 -0
  22. package/dist/es/menu/models/BaseMenuItem.d.ts +45 -0
  23. package/dist/es/menu/models/BaseMenuItem.js +1 -0
  24. package/dist/es/menu/models/MenuItemModel.d.ts +19 -0
  25. package/dist/es/menu/models/MenuItemModel.js +0 -0
  26. package/dist/es/menu/utils/DirectionHolder.d.ts +11 -0
  27. package/dist/es/menu/utils/DirectionHolder.js +24 -0
  28. package/dist/es/menu/utils/MouseOverHandler.d.ts +17 -0
  29. package/dist/es/menu/utils/MouseOverHandler.js +64 -0
  30. package/dist/es/menu/utils/getNewItemIdUponKeyboardNavigation.d.ts +7 -0
  31. package/dist/es/menu/utils/getNewItemIdUponKeyboardNavigation.js +202 -0
  32. package/dist/es/menu/utils/hoverDelay.d.ts +9 -0
  33. package/dist/es/menu/utils/hoverDelay.js +17 -0
  34. package/dist/es/menu/utils/itemsIdsUtils.d.ts +64 -0
  35. package/dist/es/menu/utils/itemsIdsUtils.js +119 -0
  36. package/dist/es/menu/utils/misc.d.ts +16 -0
  37. package/dist/es/menu/utils/misc.js +42 -0
  38. package/dist/es/menu/utils/prepareInputItemsForInternalWork.d.ts +5 -0
  39. package/dist/es/menu/utils/prepareInputItemsForInternalWork.js +79 -0
  40. package/dist/es/package-metadata.js +1 -1
  41. package/dist/npm/main.d.ts +5 -0
  42. package/dist/npm/main.js +5 -0
  43. package/dist/npm/menu/BaseMenuItemInternalProps.d.ts +20 -0
  44. package/dist/npm/menu/BaseMenuItemInternalProps.js +2 -0
  45. package/dist/npm/menu/MenuProps.d.ts +51 -0
  46. package/dist/npm/menu/MenuProps.js +5 -0
  47. package/dist/npm/menu/components/Menu.d.ts +68 -0
  48. package/dist/npm/menu/components/Menu.js +318 -0
  49. package/dist/npm/menu/components/MenuItemArrow.d.ts +65 -0
  50. package/dist/npm/menu/components/MenuItemArrow.js +69 -0
  51. package/dist/npm/menu/components/MenuItemInternal.d.ts +48 -0
  52. package/dist/npm/menu/components/MenuItemInternal.js +433 -0
  53. package/dist/npm/menu/components/MenuItemInternalsList.d.ts +44 -0
  54. package/dist/npm/menu/components/MenuItemInternalsList.js +142 -0
  55. package/dist/npm/menu/components/MenuItemLink.d.ts +49 -0
  56. package/dist/npm/menu/components/MenuItemLink.js +67 -0
  57. package/dist/npm/menu/consts.d.ts +54 -0
  58. package/dist/npm/menu/consts.js +73 -0
  59. package/dist/npm/menu/events.d.ts +14 -0
  60. package/dist/npm/menu/events.js +3 -0
  61. package/dist/npm/menu/models/BaseMenuItem.d.ts +45 -0
  62. package/dist/npm/menu/models/BaseMenuItem.js +3 -0
  63. package/dist/npm/menu/models/MenuItemModel.d.ts +19 -0
  64. package/dist/npm/menu/models/MenuItemModel.js +2 -0
  65. package/dist/npm/menu/utils/DirectionHolder.d.ts +11 -0
  66. package/dist/npm/menu/utils/DirectionHolder.js +27 -0
  67. package/dist/npm/menu/utils/MouseOverHandler.d.ts +17 -0
  68. package/dist/npm/menu/utils/MouseOverHandler.js +67 -0
  69. package/dist/npm/menu/utils/getNewItemIdUponKeyboardNavigation.d.ts +7 -0
  70. package/dist/npm/menu/utils/getNewItemIdUponKeyboardNavigation.js +206 -0
  71. package/dist/npm/menu/utils/hoverDelay.d.ts +9 -0
  72. package/dist/npm/menu/utils/hoverDelay.js +22 -0
  73. package/dist/npm/menu/utils/itemsIdsUtils.d.ts +64 -0
  74. package/dist/npm/menu/utils/itemsIdsUtils.js +135 -0
  75. package/dist/npm/menu/utils/misc.d.ts +16 -0
  76. package/dist/npm/menu/utils/misc.js +49 -0
  77. package/dist/npm/menu/utils/prepareInputItemsForInternalWork.d.ts +5 -0
  78. package/dist/npm/menu/utils/prepareInputItemsForInternalWork.js +83 -0
  79. package/dist/npm/package-metadata.js +1 -1
  80. package/package.json +9 -9
@@ -0,0 +1,417 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ var ref = allVue.ref;
6
+ import { classNames, guid } from '@progress/kendo-vue-common';
7
+ import { Popup } from '@progress/kendo-vue-popup';
8
+ import { shouldOpenItem, isFirstItemFromSiblings } from '../utils/itemsIdsUtils';
9
+ import { getPopupSettings, convertBoolDirectionToString, getDOMElementId } from '../utils/misc';
10
+ import { MenuItemLink } from './MenuItemLink';
11
+ import { MenuItemInternalsList } from './MenuItemInternalsList';
12
+ import { MenuItemArrow } from './MenuItemArrow'; // tslint:enable:max-line-length
13
+
14
+ var MenuItemInternal = {
15
+ name: 'KendoMenuItemInternal',
16
+ props: {
17
+ item: Object,
18
+ focusedItemId: String,
19
+ lastItemIdToBeOpened: String,
20
+ tabbableItemId: String,
21
+ itemRender: [String, Object, Function],
22
+ linkRender: [String, Object, Function],
23
+ isMenuVertical: Boolean,
24
+ isDirectionRightToLeft: Boolean,
25
+ menuGuid: String
26
+ },
27
+ created: function created() {
28
+ this.itemElement = null;
29
+ this.isFirstRender = true;
30
+ this._anchor = guid();
31
+ },
32
+ data: function data() {
33
+ return {
34
+ opened: false
35
+ };
36
+ },
37
+ mounted: function mounted() {
38
+ this.itemElement = this.$refs[this._anchor];
39
+ var focusedItemId = this.$props.focusedItemId;
40
+ var currentItemId = this.$props.item.id; // If the menu item component has been just mounted due to
41
+ // keyboard navigation and it is the selected one.
42
+
43
+ if (focusedItemId && focusedItemId === currentItemId) {
44
+ this.itemElement.focus();
45
+ }
46
+
47
+ this.isFirstRender = false;
48
+ },
49
+ updated: function updated() {
50
+ var focusedItemId = this.$props.focusedItemId;
51
+ var currentItemId = this.$props.item.id;
52
+
53
+ if (focusedItemId) {// If the item has been navigated to via the keyboard navigation
54
+ // (Clicking and focusing an item also come here).
55
+ // if (prevProps.focusedItemId !== focusedItemId
56
+ // && focusedItemId === currentItemId
57
+ // // https://github.com/telerik/kendo-react/issues/216 :
58
+ // // No need to focus the wrapping menu item DOM element
59
+ // // when a child DOM element was clicked.
60
+ // && !this.itemElement.contains(document.activeElement)) {
61
+ // this.itemElement.focus();
62
+ // }
63
+ } else if (document.activeElement === this.itemElement) {
64
+ this.itemElement.blur();
65
+ }
66
+ },
67
+ computed: {
68
+ currnetItemRender: function currnetItemRender() {
69
+ return this.$props.item.render || this.$props.itemRender;
70
+ },
71
+ currentLinkRender: function currentLinkRender() {
72
+ return this.$props.item.linkRender || this.$props.linkRender;
73
+ },
74
+ contentRender: function contentRender() {
75
+ return this.$props.item.contentParentItemId ? this.$props.item.contentRender : null;
76
+ },
77
+ currentOpened: function currentOpened() {
78
+ var props = this.$props;
79
+ return props.item.items.length > 0 && shouldOpenItem(props.item.id, props.lastItemIdToBeOpened) && // HACK: Wait for the second render because otherwise the scenario of
80
+ // popup inside popup throws an error (for example, hover of item with id '0_0').
81
+ !this.isFirstRender;
82
+ },
83
+ popupClassName: function popupClassName() {
84
+ return classNames({
85
+ 'k-menu-popup': true,
86
+ 'k-rtl': this.$props.isDirectionRightToLeft
87
+ });
88
+ }
89
+ },
90
+ // @ts-ignore
91
+ setup: !gh ? undefined : function () {
92
+ var v3 = !!gh;
93
+ var kendoAnchorRef = ref(null);
94
+ return {
95
+ v3: v3,
96
+ kendoAnchorRef: kendoAnchorRef
97
+ };
98
+ },
99
+ render: function render(createElement) {
100
+ var _this = this;
101
+
102
+ var h = gh || createElement;
103
+ var item = this.$props.item;
104
+ var itemId = item.id;
105
+
106
+ var renderContent = function renderContent() {
107
+ var parentItemId = this.$props.item.contentParentItemId;
108
+ return h("div", {
109
+ "class": "k-content",
110
+ role: "presentation",
111
+ attrs: this.v3 ? undefined : {
112
+ role: "presentation"
113
+ }
114
+ }, [h(this.contentRender, {
115
+ item: this.handleOriginalItemNeeded(parentItemId),
116
+ attrs: this.v3 ? undefined : {
117
+ item: this.handleOriginalItemNeeded(parentItemId),
118
+ itemId: parentItemId
119
+ },
120
+ itemId: parentItemId
121
+ })]);
122
+ };
123
+
124
+ var renderMenuIconIfApplicable = function renderMenuIconIfApplicable() {
125
+ return this.$props.item.icon ? h("span", {
126
+ "class": "k-icon k-i-" + this.$props.item.icon,
127
+ role: "presentation",
128
+ attrs: this.v3 ? undefined : {
129
+ role: "presentation"
130
+ },
131
+ key: "0"
132
+ }) : null;
133
+ };
134
+
135
+ var renderArrowIfApplicable = function renderArrowIfApplicable() {
136
+ return this.$props.item.items.length > 0 ? // @ts-ignore
137
+ h(MenuItemArrow, {
138
+ itemId: this.$props.item.id,
139
+ attrs: this.v3 ? undefined : {
140
+ itemId: this.$props.item.id,
141
+ verticalMenu: this.$props.isMenuVertical,
142
+ dir: convertBoolDirectionToString(this.$props.isDirectionRightToLeft)
143
+ },
144
+ verticalMenu: this.$props.isMenuVertical,
145
+ dir: convertBoolDirectionToString(this.$props.isDirectionRightToLeft),
146
+ key: "2"
147
+ }) : null;
148
+ };
149
+
150
+ var renderMenuItemLink = function renderMenuItemLink() {
151
+ var _this2 = this;
152
+
153
+ if (this.currentLinkRender) {
154
+ return h(this.currentLinkRender, {
155
+ item: this.$props.onOriginalItemNeeded(item.id),
156
+ attrs: this.v3 ? undefined : {
157
+ item: this.$props.onOriginalItemNeeded(item.id),
158
+ itemId: item.id,
159
+ opened: this.currentOpened,
160
+ dir: convertBoolDirectionToString(this.$props.isDirectionRightToLeft)
161
+ },
162
+ itemId: item.id,
163
+ opened: this.currentOpened,
164
+ dir: convertBoolDirectionToString(this.$props.isDirectionRightToLeft)
165
+ });
166
+ } else {
167
+ var textOrItemRender = this.currnetItemRender ? h(this.currnetItemRender, {
168
+ item: this.$props.onOriginalItemNeeded(item.id),
169
+ attrs: this.v3 ? undefined : {
170
+ item: this.$props.onOriginalItemNeeded(item.id),
171
+ itemId: item.id
172
+ },
173
+ itemId: item.id,
174
+ key: "1"
175
+ }) : item.text;
176
+ return (// @ts-ignore function children
177
+ h(MenuItemLink, {
178
+ url: item.url,
179
+ attrs: this.v3 ? undefined : {
180
+ url: item.url,
181
+ opened: this.currentOpened
182
+ },
183
+ opened: this.currentOpened
184
+ }, this.v3 ? function () {
185
+ return [[renderMenuIconIfApplicable.call(_this2), textOrItemRender, renderArrowIfApplicable.call(_this2)]];
186
+ } : [[renderMenuIconIfApplicable.call(_this2), textOrItemRender, renderArrowIfApplicable.call(_this2)]])
187
+ );
188
+ }
189
+ };
190
+
191
+ var renderPopupIfOpened = function renderPopupIfOpened() {
192
+ var _this3 = this;
193
+
194
+ var _a = getPopupSettings(itemId, this.$props.isMenuVertical, this.$props.isDirectionRightToLeft),
195
+ anchorAlign = _a.anchorAlign,
196
+ popupAlign = _a.popupAlign,
197
+ collision = _a.collision;
198
+
199
+ return (// @ts-ignore function children
200
+ h(Popup, {
201
+ anchor: this._anchor,
202
+ attrs: this.v3 ? undefined : {
203
+ anchor: this._anchor,
204
+ show: this.currentOpened,
205
+ popupClass: this.popupClassName,
206
+ anchorAlign: anchorAlign,
207
+ popupAlign: popupAlign,
208
+ collision: collision,
209
+ animate: false
210
+ },
211
+ show: this.currentOpened,
212
+ popupClass: this.popupClassName,
213
+ anchorAlign: anchorAlign,
214
+ popupAlign: popupAlign,
215
+ collision: collision,
216
+ animate: false,
217
+ key: "1"
218
+ }, this.v3 ? function () {
219
+ return [// @ts-ignore
220
+ h(MenuItemInternalsList, {
221
+ parentItemId: itemId,
222
+ attrs: _this3.v3 ? undefined : {
223
+ parentItemId: itemId,
224
+ items: _this3.$props.item.items,
225
+ menuGuid: _this3.$props.menuGuid,
226
+ focusedItemId: _this3.$props.focusedItemId,
227
+ lastItemIdToBeOpened: _this3.$props.lastItemIdToBeOpened,
228
+ tabbableItemId: _this3.$props.tabbableItemId,
229
+ itemRender: _this3.$props.itemRender,
230
+ linkRender: _this3.$props.linkRender,
231
+ isMenuVertical: _this3.$props.isMenuVertical,
232
+ isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft
233
+ },
234
+ items: _this3.$props.item.items,
235
+ menuGuid: _this3.$props.menuGuid,
236
+ focusedItemId: _this3.$props.focusedItemId,
237
+ lastItemIdToBeOpened: _this3.$props.lastItemIdToBeOpened,
238
+ tabbableItemId: _this3.$props.tabbableItemId,
239
+ itemRender: _this3.$props.itemRender,
240
+ linkRender: _this3.$props.linkRender,
241
+ isMenuVertical: _this3.$props.isMenuVertical,
242
+ isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft,
243
+ "class": "k-group k-menu-group k-reset",
244
+ onMouseover: _this3.handleItemMouseOver,
245
+ on: _this3.v3 ? undefined : {
246
+ "mouseover": _this3.handleItemMouseOver,
247
+ "mouseleave": _this3.handleItemMouseLeave,
248
+ "mousedown": _this3.handleItemMouseDown,
249
+ "blur": _this3.handleItemMouseBlur,
250
+ "focus": _this3.handleItemMouseFocus,
251
+ "click": _this3.handleItemMouseClick,
252
+ "originalitemneeded": _this3.handleOriginalItemNeeded
253
+ },
254
+ onMouseleave: _this3.handleItemMouseLeave,
255
+ onMousedown: _this3.handleItemMouseDown,
256
+ onBlur: _this3.handleItemMouseBlur,
257
+ onFocus: _this3.handleItemMouseFocus,
258
+ onClick: _this3.handleItemMouseClick,
259
+ onOriginalitemneeded: _this3.handleOriginalItemNeeded
260
+ })];
261
+ } : [h(MenuItemInternalsList, {
262
+ parentItemId: itemId,
263
+ attrs: _this3.v3 ? undefined : {
264
+ parentItemId: itemId,
265
+ items: _this3.$props.item.items,
266
+ menuGuid: _this3.$props.menuGuid,
267
+ focusedItemId: _this3.$props.focusedItemId,
268
+ lastItemIdToBeOpened: _this3.$props.lastItemIdToBeOpened,
269
+ tabbableItemId: _this3.$props.tabbableItemId,
270
+ itemRender: _this3.$props.itemRender,
271
+ linkRender: _this3.$props.linkRender,
272
+ isMenuVertical: _this3.$props.isMenuVertical,
273
+ isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft
274
+ },
275
+ items: _this3.$props.item.items,
276
+ menuGuid: _this3.$props.menuGuid,
277
+ focusedItemId: _this3.$props.focusedItemId,
278
+ lastItemIdToBeOpened: _this3.$props.lastItemIdToBeOpened,
279
+ tabbableItemId: _this3.$props.tabbableItemId,
280
+ itemRender: _this3.$props.itemRender,
281
+ linkRender: _this3.$props.linkRender,
282
+ isMenuVertical: _this3.$props.isMenuVertical,
283
+ isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft,
284
+ "class": "k-group k-menu-group k-reset",
285
+ onMouseover: _this3.handleItemMouseOver,
286
+ on: _this3.v3 ? undefined : {
287
+ "mouseover": _this3.handleItemMouseOver,
288
+ "mouseleave": _this3.handleItemMouseLeave,
289
+ "mousedown": _this3.handleItemMouseDown,
290
+ "blur": _this3.handleItemMouseBlur,
291
+ "focus": _this3.handleItemMouseFocus,
292
+ "click": _this3.handleItemMouseClick,
293
+ "originalitemneeded": _this3.handleOriginalItemNeeded
294
+ },
295
+ onMouseleave: _this3.handleItemMouseLeave,
296
+ onMousedown: _this3.handleItemMouseDown,
297
+ onBlur: _this3.handleItemMouseBlur,
298
+ onFocus: _this3.handleItemMouseFocus,
299
+ onClick: _this3.handleItemMouseClick,
300
+ onOriginalitemneeded: _this3.handleOriginalItemNeeded
301
+ })])
302
+ );
303
+ };
304
+
305
+ return h("li", {
306
+ "class": this.menuItemClassName,
307
+ style: item.cssStyle,
308
+ tabIndex: itemId === this.$props.tabbableItemId ? 0 : -1,
309
+ attrs: this.v3 ? undefined : {
310
+ tabIndex: itemId === this.$props.tabbableItemId ? 0 : -1,
311
+ role: "menuitem",
312
+ "aria-disabled": item.disabled ? true : undefined,
313
+ "aria-haspopup": item.items.length > 0 ? true : undefined,
314
+ "aria-expanded": item.items.length > 0 ? this.currentOpened : undefined,
315
+ "aria-label": item.text,
316
+ "aria-owns": this.currentOpened ? getDOMElementId(this.$props.menuGuid, itemId) : undefined
317
+ },
318
+ onMouseover: this.onMouseOver,
319
+ on: this.v3 ? undefined : {
320
+ "mouseover": this.onMouseOver,
321
+ "mouseleave": this.onMouseLeave,
322
+ "mousedown": function mousedown(event) {
323
+ return _this.handleMouseDown(event);
324
+ },
325
+ "focusout": function focusout() {
326
+ return _this.handleBlur(itemId);
327
+ },
328
+ "focusin": function focusin() {
329
+ return _this.handleFocus(itemId);
330
+ },
331
+ "click": function click(event) {
332
+ return _this.handleClick(event, itemId);
333
+ }
334
+ },
335
+ onMouseleave: this.onMouseLeave,
336
+ onMousedown: function mousedown(event) {
337
+ return _this.handleMouseDown(event);
338
+ },
339
+ onFocusout: function focusout() {
340
+ return _this.handleBlur(itemId);
341
+ },
342
+ onFocusin: function focusin() {
343
+ return _this.handleFocus(itemId);
344
+ },
345
+ onClick: function click(event) {
346
+ return _this.handleClick(event, itemId);
347
+ },
348
+ role: "menuitem",
349
+ "aria-disabled": item.disabled ? true : undefined,
350
+ "aria-haspopup": item.items.length > 0 ? true : undefined,
351
+ "aria-expanded": item.items.length > 0 ? this.currentOpened : undefined,
352
+ "aria-label": item.text,
353
+ "aria-owns": this.currentOpened ? getDOMElementId(this.$props.menuGuid, itemId) : undefined,
354
+ ref: this.v3 ? function (el) {
355
+ _this.kendoAnchorRef = el;
356
+ } : this._anchor,
357
+ key: "0"
358
+ }, [this.contentRender ? renderContent.call(this) : renderMenuItemLink.call(this), renderPopupIfOpened.call(this)]);
359
+ },
360
+ methods: {
361
+ handleItemMouseOver: function handleItemMouseOver(event) {
362
+ this.$emit('mouseover', event);
363
+ },
364
+ handleItemMouseLeave: function handleItemMouseLeave(event) {
365
+ this.$emit('mouseleave', event);
366
+ },
367
+ handleItemMouseDown: function handleItemMouseDown(event) {
368
+ this.$emit('mousedown', event);
369
+ },
370
+ handleItemMouseBlur: function handleItemMouseBlur(event) {
371
+ this.$emit('blur', event);
372
+ },
373
+ handleItemMouseFocus: function handleItemMouseFocus(event) {
374
+ this.$emit('focus', event);
375
+ },
376
+ handleItemMouseClick: function handleItemMouseClick(event) {
377
+ this.$emit('click', event);
378
+ },
379
+ handleClick: function handleClick(event, itemId) {
380
+ this.$emit('click', event, itemId);
381
+ },
382
+ handleBlur: function handleBlur(itemId) {
383
+ this.$emit('blur', itemId);
384
+ },
385
+ handleFocus: function handleFocus(itemId) {
386
+ this.$emit('focus', itemId);
387
+ },
388
+ handleMouseDown: function handleMouseDown(event) {
389
+ this.$emit('mousedown', event);
390
+ },
391
+ handleOriginalItemNeeded: function handleOriginalItemNeeded(event) {
392
+ this.$emit('originalitemneeded', event);
393
+ },
394
+ onMouseOver: function onMouseOver(event) {
395
+ this.$emit('mouseover', this.$props.item.id);
396
+ event.stopPropagation();
397
+ },
398
+ onMouseLeave: function onMouseLeave(event) {
399
+ this.$emit('mouseleave', this.$props.item.id);
400
+ event.stopPropagation();
401
+ },
402
+ menuItemClassName: function menuItemClassName() {
403
+ var _a;
404
+
405
+ var item = this.$props.item;
406
+ return _a = {
407
+ 'k-item': true,
408
+ 'k-menu-item': true,
409
+ 'k-first': isFirstItemFromSiblings(item.id),
410
+ 'k-last': item.isLastFromSiblings,
411
+ 'k-state-disabled': item.disabled
412
+ }, _a[item.cssClass ? item.cssClass : ''] = item.cssClass, _a;
413
+ }
414
+ }
415
+ };
416
+ var MenuItemInternalVue3 = MenuItemInternal;
417
+ export { MenuItemInternal, MenuItemInternalVue3 };
@@ -0,0 +1,44 @@
1
+ import { DefineComponent } from '../../additionalTypes';
2
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ import { MenuItemInternalModel } from './../models/MenuItemModel';
8
+ import { BaseMenuItemInternalProps } from './../BaseMenuItemInternalProps';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export interface MenuItemInternalsListProps extends BaseMenuItemInternalProps {
13
+ items: MenuItemInternalModel[];
14
+ parentItemId?: string;
15
+ }
16
+ /**
17
+ * @hidden
18
+ */
19
+ export interface MenuItemInternalsListState {
20
+ }
21
+ /**
22
+ * @hidden
23
+ */
24
+ export interface MenuItemInternalsListComputed {
25
+ }
26
+ /**
27
+ * @hidden
28
+ */
29
+ export interface MenuItemInternalsListMethods {
30
+ [key: string]: any;
31
+ }
32
+ /**
33
+ * @hidden
34
+ */
35
+ export interface MenuItemInternalsListData {
36
+ }
37
+ /**
38
+ * @hidden
39
+ */
40
+ export interface MenuItemInternalsListAll extends Vue, MenuItemInternalsListMethods, MenuItemInternalsListData, MenuItemInternalsListComputed, MenuItemInternalsListState {
41
+ }
42
+ declare let MenuItemInternalsList: ComponentOptions<MenuItemInternalsListAll, DefaultData<MenuItemInternalsListData>, DefaultMethods<MenuItemInternalsListAll>, MenuItemInternalsListComputed, RecordPropsDefinition<MenuItemInternalsListProps>>;
43
+ declare const MenuItemInternalsListVue3: DefineComponent<MenuItemInternalsListProps, any, MenuItemInternalsListData, MenuItemInternalsListComputed, MenuItemInternalsListMethods, {}, {}, {}, string, MenuItemInternalsListProps, MenuItemInternalsListProps, {}>;
44
+ export { MenuItemInternalsList, MenuItemInternalsListVue3 };
@@ -0,0 +1,131 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ import { MenuItemInternal } from './MenuItemInternal';
6
+ import { getDOMElementId } from './../utils/misc'; // tslint:enable:max-line-length
7
+
8
+ var MenuItemInternalsList = {
9
+ name: 'KendoMenuItemInternalsList',
10
+ props: {
11
+ items: Array,
12
+ parentItemId: String,
13
+ focusedItemId: String,
14
+ lastItemIdToBeOpened: String,
15
+ tabbableItemId: String,
16
+ itemRender: [String, Object, Function],
17
+ linkRender: [String, Object, Function],
18
+ isMenuVertical: Boolean,
19
+ isDirectionRightToLeft: Boolean,
20
+ menuGuid: String
21
+ },
22
+ // @ts-ignore
23
+ setup: !gh ? undefined : function () {
24
+ var v3 = !!gh;
25
+ return {
26
+ v3: v3
27
+ };
28
+ },
29
+ render: function render(createElement) {
30
+ var h = gh || createElement;
31
+ var parentItemId = this.$props.parentItemId;
32
+
33
+ var renderChildItems = function renderChildItems() {
34
+ return this.$props.items.length > 0 ? this.$props.items.map(function (item, index) {
35
+ return (// @ts-ignore
36
+ h(MenuItemInternal, {
37
+ item: item,
38
+ attrs: this.v3 ? undefined : {
39
+ item: item,
40
+ isMenuVertical: this.$props.isMenuVertical,
41
+ isDirectionRightToLeft: this.$props.isDirectionRightToLeft,
42
+ focusedItemId: this.$props.focusedItemId,
43
+ lastItemIdToBeOpened: this.$props.lastItemIdToBeOpened,
44
+ tabbableItemId: this.$props.tabbableItemId,
45
+ itemRender: this.$props.itemRender,
46
+ linkRender: this.$props.linkRender,
47
+ menuGuid: this.$props.menuGuid
48
+ },
49
+ isMenuVertical: this.$props.isMenuVertical,
50
+ isDirectionRightToLeft: this.$props.isDirectionRightToLeft,
51
+ focusedItemId: this.$props.focusedItemId,
52
+ lastItemIdToBeOpened: this.$props.lastItemIdToBeOpened,
53
+ tabbableItemId: this.$props.tabbableItemId,
54
+ itemRender: this.$props.itemRender,
55
+ linkRender: this.$props.linkRender,
56
+ menuGuid: this.$props.menuGuid,
57
+ onMouseover: this.handleItemMouseOver,
58
+ on: this.v3 ? undefined : {
59
+ "mouseover": this.handleItemMouseOver,
60
+ "mouseleave": this.handleItemMouseLeave,
61
+ "mousedown": this.handleItemMouseDown,
62
+ "blur": this.handleItemMouseBlur,
63
+ "focus": this.handleItemMouseFocus,
64
+ "click": this.handleItemMouseClick,
65
+ "originalitemneeded": this.handleOriginalItemNeeded
66
+ },
67
+ onMouseleave: this.handleItemMouseLeave,
68
+ onMousedown: this.handleItemMouseDown,
69
+ onBlur: this.handleItemMouseBlur,
70
+ onFocus: this.handleItemMouseFocus,
71
+ onClick: this.handleItemMouseClick,
72
+ onOriginalitemneeded: this.handleOriginalItemNeeded,
73
+ key: index
74
+ })
75
+ );
76
+ }, this) : null;
77
+ };
78
+
79
+ return h("ul", {
80
+ role: parentItemId !== undefined ? 'menu' : 'menubar',
81
+ attrs: this.v3 ? undefined : {
82
+ role: parentItemId !== undefined ? 'menu' : 'menubar',
83
+ id: parentItemId !== undefined ? getDOMElementId(this.$props.menuGuid, parentItemId) : undefined
84
+ },
85
+ id: parentItemId !== undefined ? getDOMElementId(this.$props.menuGuid, parentItemId) : undefined,
86
+ onMouseover: this.onMouseOver,
87
+ on: this.v3 ? undefined : {
88
+ "mouseover": this.onMouseOver,
89
+ "mouseleave": this.onMouseLeave
90
+ },
91
+ onMouseleave: this.onMouseLeave
92
+ }, [renderChildItems.call(this)]);
93
+ },
94
+ methods: {
95
+ handleOriginalItemNeeded: function handleOriginalItemNeeded(event) {
96
+ this.$emit('originalitemneeded', event);
97
+ },
98
+ handleItemMouseOver: function handleItemMouseOver(event) {
99
+ this.$emit('mouseover', event);
100
+ },
101
+ handleItemMouseLeave: function handleItemMouseLeave(event) {
102
+ this.$emit('mouseleave', event);
103
+ },
104
+ handleItemMouseDown: function handleItemMouseDown(event) {
105
+ this.$emit('mousedown', event);
106
+ },
107
+ handleItemMouseBlur: function handleItemMouseBlur(event) {
108
+ this.$emit('blur', event);
109
+ },
110
+ handleItemMouseFocus: function handleItemMouseFocus(event) {
111
+ this.$emit('focus', event);
112
+ },
113
+ handleItemMouseClick: function handleItemMouseClick(event, itemId) {
114
+ this.$emit('click', event, itemId);
115
+ },
116
+ onMouseOver: function onMouseOver(event) {
117
+ if (this.$props.parentItemId !== undefined) {
118
+ this.$emit('mouseover', this.$props.parentItemId);
119
+ event.stopPropagation();
120
+ }
121
+ },
122
+ onMouseLeave: function onMouseLeave(event) {
123
+ if (this.$props.parentItemId !== undefined) {
124
+ this.$emit('mouseleave', this.$props.parentItemId);
125
+ event.stopPropagation();
126
+ }
127
+ }
128
+ }
129
+ };
130
+ var MenuItemInternalsListVue3 = MenuItemInternalsList;
131
+ export { MenuItemInternalsList, MenuItemInternalsListVue3 };
@@ -0,0 +1,49 @@
1
+ import { DefineComponent } from '../../additionalTypes';
2
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ /**
8
+ * The properties of the Kendo UI for Vue MenuItemLink component.
9
+ */
10
+ export interface MenuItemLinkProps {
11
+ /**
12
+ * Specifies whether the MenuItemLink component is opened.
13
+ */
14
+ opened: boolean;
15
+ /**
16
+ * Sets the URL of the MenuItemLink component.
17
+ */
18
+ url?: string;
19
+ }
20
+ /**
21
+ * @hidden
22
+ */
23
+ export interface MenuItemLinkState {
24
+ }
25
+ /**
26
+ * @hidden
27
+ */
28
+ export interface MenuItemLinkComputed {
29
+ menuItemClassName: object;
30
+ }
31
+ /**
32
+ * @hidden
33
+ */
34
+ export interface MenuItemLinkMethods {
35
+ [key: string]: any;
36
+ }
37
+ /**
38
+ * @hidden
39
+ */
40
+ export interface MenuItemLinkData {
41
+ }
42
+ /**
43
+ * @hidden
44
+ */
45
+ export interface MenuItemLinkAll extends Vue, MenuItemLinkMethods, MenuItemLinkData, MenuItemLinkComputed, MenuItemLinkState {
46
+ }
47
+ declare let MenuItemLink: ComponentOptions<MenuItemLinkAll, DefaultData<MenuItemLinkData>, DefaultMethods<MenuItemLinkAll>, MenuItemLinkComputed, RecordPropsDefinition<MenuItemLinkProps>>;
48
+ declare const MenuItemLinkVue3: DefineComponent<MenuItemLinkProps, any, MenuItemLinkData, MenuItemLinkComputed, MenuItemLinkMethods, {}, {}, {}, string, MenuItemLinkProps, MenuItemLinkProps, {}>;
49
+ export { MenuItemLink, MenuItemLinkVue3 };
@@ -0,0 +1,57 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ import { getDefaultSlots } from '@progress/kendo-vue-common'; // tslint:enable:max-line-length
6
+
7
+ var MenuItemLink = {
8
+ name: 'KendoMenuItemLink',
9
+ props: {
10
+ opened: Boolean,
11
+ url: String
12
+ },
13
+ computed: {
14
+ menuItemClassName: function menuItemClassName() {
15
+ return {
16
+ 'k-link': true,
17
+ 'k-menu-link': true,
18
+ 'k-state-active': this.$props.opened
19
+ };
20
+ }
21
+ },
22
+ // @ts-ignore
23
+ setup: !gh ? undefined : function () {
24
+ var v3 = !!gh;
25
+ return {
26
+ v3: v3
27
+ };
28
+ },
29
+ render: function render(createElement) {
30
+ var h = gh || createElement;
31
+ var defaultSlot = getDefaultSlots(this);
32
+
33
+ if (this.$props.url) {
34
+ return h("a", {
35
+ "class": this.getMenuItemClassName(),
36
+ role: "presentation",
37
+ attrs: this.v3 ? undefined : {
38
+ role: "presentation",
39
+ href: this.props.url,
40
+ tabIndex: -1
41
+ },
42
+ href: this.props.url,
43
+ tabIndex: -1
44
+ }, [this.props.children]);
45
+ } else {
46
+ return h("span", {
47
+ "class": this.menuItemClassName,
48
+ role: "presentation",
49
+ attrs: this.v3 ? undefined : {
50
+ role: "presentation"
51
+ }
52
+ }, [defaultSlot]);
53
+ }
54
+ }
55
+ };
56
+ var MenuItemLinkVue3 = MenuItemLink;
57
+ export { MenuItemLink, MenuItemLinkVue3 };