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

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.
@@ -18,6 +18,7 @@ var __assign = this && this.__assign || function () {
18
18
  import * as Vue from 'vue';
19
19
  var allVue = Vue;
20
20
  var gh = allVue.h;
21
+ import { templateRendering, getListeners } from '@progress/kendo-vue-common';
21
22
  import { Keys, guid, validatePackage } from '@progress/kendo-vue-common';
22
23
  import { getDirectParentId, isIdEmptyOrZeroLevel, EMPTY_ID, ZERO_LEVEL_ZERO_ITEM_ID, getRootParentId, getItemById } from '../utils/itemsIdsUtils';
23
24
  import { prepareInputItemsForInternalWork } from '../utils/prepareInputItemsForInternalWork';
@@ -26,8 +27,7 @@ import { getHoverOpenDelay, getHoverCloseDelay } from '../utils/hoverDelay';
26
27
  import { MenuItemInternalsList } from './MenuItemInternalsList';
27
28
  import { DirectionHolder } from '../utils/DirectionHolder';
28
29
  import { MouseOverHandler } from '../utils/MouseOverHandler';
29
- import { packageMetadata } from '../../package-metadata';
30
- var initialItemsIds = {}; // tslint:enable:max-line-length
30
+ import { packageMetadata } from '../../package-metadata'; // tslint:enable:max-line-length
31
31
 
32
32
  var Menu = {
33
33
  name: 'KendoMenu',
@@ -111,10 +111,6 @@ var Menu = {
111
111
 
112
112
  var lastItemIdToBeOpened = this.hoveredItemId ? this.hoveredItemId : this.focusedItemId ? getDirectParentId(this.focusedItemId) : EMPTY_ID;
113
113
  return h("div", {
114
- onKeydown: this.onKeyDown,
115
- on: this.v3 ? undefined : {
116
- "keydown": this.onKeyDown
117
- },
118
114
  "class": this.getMenuWrapperClassName(),
119
115
  ref: function ref(el) {
120
116
  return _this.menuWrapperEl = el;
@@ -131,9 +127,10 @@ var Menu = {
131
127
  focusedItemId: this.focusedItemId,
132
128
  lastItemIdToBeOpened: lastItemIdToBeOpened,
133
129
  tabbableItemId: this.tabbableItemId,
134
- itemRender: this.$props.itemRender,
135
- linkRender: this.$props.linkRender,
136
- menuGuid: this.guid
130
+ itemRender: templateRendering.call(this, this.$props.itemRender, getListeners.call(this)),
131
+ linkRender: templateRendering.call(this, this.$props.linkRender, getListeners.call(this)),
132
+ menuGuid: this.guid,
133
+ originalItemNeeded: this.getInputItem
137
134
  },
138
135
  items: this.currentItems,
139
136
  isMenuVertical: this.$props.vertical,
@@ -141,31 +138,34 @@ var Menu = {
141
138
  focusedItemId: this.focusedItemId,
142
139
  lastItemIdToBeOpened: lastItemIdToBeOpened,
143
140
  tabbableItemId: this.tabbableItemId,
144
- itemRender: this.$props.itemRender,
145
- linkRender: this.$props.linkRender,
141
+ itemRender: templateRendering.call(this, this.$props.itemRender, getListeners.call(this)),
142
+ linkRender: templateRendering.call(this, this.$props.linkRender, getListeners.call(this)),
146
143
  menuGuid: this.guid,
147
144
  onMouseleave: this.onItemMouseLeave,
148
145
  on: this.v3 ? undefined : {
149
146
  "mouseleave": this.onItemMouseLeave,
150
147
  "mouseover": this.onItemMouseOver,
151
148
  "mousedown": this.onItemMouseDown,
149
+ "keydown": this.onKeyDown,
152
150
  "focus": this.onItemFocus,
153
151
  "click": this.onItemClick,
154
- "blur": this.onItemBlur,
155
- "originalitemneeded": this.getInputItem
152
+ "blur": this.onItemBlur
156
153
  },
157
154
  onMouseover: this.onItemMouseOver,
158
155
  onMousedown: this.onItemMouseDown,
156
+ onKeydown: this.onKeyDown,
159
157
  onFocus: this.onItemFocus,
160
158
  onClick: this.onItemClick,
161
159
  onBlur: this.onItemBlur,
162
- onOriginalitemneeded: this.getInputItem
160
+ originalItemNeeded: this.getInputItem
163
161
  })]);
164
162
  },
165
163
  methods: {
166
164
  reset: function reset() {
167
165
  this.clearItemHoverAndLeaveRequestsIfApplicable();
168
- this.setState(initialItemsIds);
166
+ this.focusedItemId = EMPTY_ID;
167
+ this.hoveredItemId = EMPTY_ID;
168
+ this.tabbableItemId = ZERO_LEVEL_ZERO_ITEM_ID;
169
169
  },
170
170
  onKeyDown: function onKeyDown(event) {
171
171
  // The focusedItemId may be empty when contentRender is used.
@@ -245,6 +245,7 @@ var Menu = {
245
245
  var tabbableItemId = focusedItemId === EMPTY_ID ? this.tabbableItemId : getRootParentId(focusedItemId);
246
246
  var hoveredItemId = focusedItemId === EMPTY_ID || isIdEmptyOrZeroLevel(this.hoveredItemId) && isIdEmptyOrZeroLevel(focusedItemId) ? this.hoveredItemId : EMPTY_ID;
247
247
  this.hoveredItemId = hoveredItemId;
248
+ this.focusedItemId = focusedItemId;
248
249
  this.tabbableItemId = tabbableItemId;
249
250
  },
250
251
  setHoveredItemId: function setHoveredItemId(hoveredItemId) {
@@ -279,7 +280,7 @@ var Menu = {
279
280
  return this.$props.dir !== undefined ? this.$props.dir === 'rtl' : this.menuWrapperEl && getComputedStyle(this.menuWrapperEl).direction === 'rtl';
280
281
  },
281
282
  prepareItems: function prepareItems() {
282
- var _a = prepareInputItemsForInternalWork(this.$props.items),
283
+ var _a = prepareInputItemsForInternalWork.call(this, this.$props.items),
283
284
  items = _a.items,
284
285
  inputItems = _a.inputItems;
285
286
 
@@ -18,6 +18,7 @@ export interface MenuItemInternalProps extends BaseMenuItemInternalProps {
18
18
  export interface MenuItemInternalState {
19
19
  itemElement: any;
20
20
  isFirstRender: boolean;
21
+ prevFocusedItemId?: string;
21
22
  kendoAnchorRef: any;
22
23
  _anchor: string;
23
24
  }
@@ -25,6 +26,12 @@ export interface MenuItemInternalState {
25
26
  * @hidden
26
27
  */
27
28
  export interface MenuItemInternalComputed {
29
+ currentItemRender: any;
30
+ currentLinkRender: any;
31
+ contentRender: any;
32
+ currentOpened: boolean;
33
+ popupClassName: string;
34
+ menuItemClassName: object;
28
35
  }
29
36
  /**
30
37
  * @hidden
@@ -3,7 +3,7 @@ import * as Vue from 'vue';
3
3
  var allVue = Vue;
4
4
  var gh = allVue.h;
5
5
  var ref = allVue.ref;
6
- import { classNames, guid } from '@progress/kendo-vue-common';
6
+ import { classNames, guid, getTemplate } from '@progress/kendo-vue-common';
7
7
  import { Popup } from '@progress/kendo-vue-popup';
8
8
  import { shouldOpenItem, isFirstItemFromSiblings } from '../utils/itemsIdsUtils';
9
9
  import { getPopupSettings, convertBoolDirectionToString, getDOMElementId } from '../utils/misc';
@@ -13,6 +13,16 @@ import { MenuItemArrow } from './MenuItemArrow'; // tslint:enable:max-line-lengt
13
13
 
14
14
  var MenuItemInternal = {
15
15
  name: 'KendoMenuItemInternal',
16
+ // @ts-ignore
17
+ emits: {
18
+ 'keydown': null,
19
+ 'mouseover': null,
20
+ 'mouseleave': null,
21
+ 'blur': null,
22
+ 'focus': null,
23
+ 'click': null,
24
+ 'mousedown': null
25
+ },
16
26
  props: {
17
27
  item: Object,
18
28
  focusedItemId: String,
@@ -22,10 +32,12 @@ var MenuItemInternal = {
22
32
  linkRender: [String, Object, Function],
23
33
  isMenuVertical: Boolean,
24
34
  isDirectionRightToLeft: Boolean,
25
- menuGuid: String
35
+ menuGuid: String,
36
+ originalItemNeeded: Function
26
37
  },
27
38
  created: function created() {
28
39
  this.itemElement = null;
40
+ this.prevFocusedItemId = this.$props.focusedItemId;
29
41
  this.isFirstRender = true;
30
42
  this._anchor = guid();
31
43
  },
@@ -35,7 +47,7 @@ var MenuItemInternal = {
35
47
  };
36
48
  },
37
49
  mounted: function mounted() {
38
- this.itemElement = this.$refs[this._anchor];
50
+ this.itemElement = this.v3 ? this.kendoAnchorRef : this.$refs[this._anchor];
39
51
  var focusedItemId = this.$props.focusedItemId;
40
52
  var currentItemId = this.$props.item.id; // If the menu item component has been just mounted due to
41
53
  // keyboard navigation and it is the selected one.
@@ -46,26 +58,29 @@ var MenuItemInternal = {
46
58
 
47
59
  this.isFirstRender = false;
48
60
  },
61
+ watch: {
62
+ focusedItemId: function focusedItemId(_, oldValue) {
63
+ this.prevFocusedItemId = oldValue;
64
+ }
65
+ },
49
66
  updated: function updated() {
50
67
  var focusedItemId = this.$props.focusedItemId;
51
68
  var currentItemId = this.$props.item.id;
52
69
 
53
- if (focusedItemId) {// If the item has been navigated to via the keyboard navigation
70
+ if (focusedItemId) {
71
+ // If the item has been navigated to via the keyboard navigation
54
72
  // (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
- // }
73
+ if (this.prevFocusedItemId !== focusedItemId && focusedItemId === currentItemId // No need to focus the wrapping menu item DOM element
74
+ // when a child DOM element was clicked.
75
+ && !this.itemElement.contains(document.activeElement)) {
76
+ this.itemElement.focus();
77
+ }
63
78
  } else if (document.activeElement === this.itemElement) {
64
79
  this.itemElement.blur();
65
80
  }
66
81
  },
67
82
  computed: {
68
- currnetItemRender: function currnetItemRender() {
83
+ currentItemRender: function currentItemRender() {
69
84
  return this.$props.item.render || this.$props.itemRender;
70
85
  },
71
86
  currentLinkRender: function currentLinkRender() {
@@ -85,6 +100,18 @@ var MenuItemInternal = {
85
100
  'k-menu-popup': true,
86
101
  'k-rtl': this.$props.isDirectionRightToLeft
87
102
  });
103
+ },
104
+ menuItemClassName: function menuItemClassName() {
105
+ var _a;
106
+
107
+ var item = this.$props.item;
108
+ return _a = {
109
+ 'k-item': true,
110
+ 'k-menu-item': true,
111
+ 'k-first': isFirstItemFromSiblings(item.id),
112
+ 'k-last': item.isLastFromSiblings,
113
+ 'k-state-disabled': item.disabled
114
+ }, _a[item.cssClass ? item.cssClass : ''] = item.cssClass, _a;
88
115
  }
89
116
  },
90
117
  // @ts-ignore
@@ -105,20 +132,25 @@ var MenuItemInternal = {
105
132
 
106
133
  var renderContent = function renderContent() {
107
134
  var parentItemId = this.$props.item.contentParentItemId;
135
+
136
+ var contentRender = function contentRender(args) {
137
+ return getTemplate.call(this, {
138
+ h: h,
139
+ template: this.contentRender,
140
+ additionalProps: args
141
+ });
142
+ };
143
+
108
144
  return h("div", {
109
145
  "class": "k-content",
110
146
  role: "presentation",
111
147
  attrs: this.v3 ? undefined : {
112
148
  role: "presentation"
113
149
  }
114
- }, [h(this.contentRender, {
150
+ }, [contentRender.call(this, {
115
151
  item: this.handleOriginalItemNeeded(parentItemId),
116
- attrs: this.v3 ? undefined : {
117
- item: this.handleOriginalItemNeeded(parentItemId),
118
- itemId: parentItemId
119
- },
120
152
  itemId: parentItemId
121
- })]);
153
+ }), h(this.contentRender)]);
122
154
  };
123
155
 
124
156
  var renderMenuIconIfApplicable = function renderMenuIconIfApplicable() {
@@ -150,42 +182,39 @@ var MenuItemInternal = {
150
182
  var renderMenuItemLink = function renderMenuItemLink() {
151
183
  var _this2 = this;
152
184
 
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
- },
185
+ var defaultItemRender = item.text;
186
+ var textOrItemRender = getTemplate.call(this, {
187
+ h: h,
188
+ template: this.currentItemRender,
189
+ defaultRendering: defaultItemRender,
190
+ additionalProps: {
191
+ item: this.$props.originalItemNeeded(item.id),
192
+ itemId: item.id,
193
+ key: '1'
194
+ }
195
+ });
196
+ var defaultLink = // @ts-ignore function children
197
+ h(MenuItemLink, {
198
+ url: item.url,
199
+ attrs: this.v3 ? undefined : {
200
+ url: item.url,
201
+ opened: this.currentOpened
202
+ },
203
+ opened: this.currentOpened
204
+ }, this.v3 ? function () {
205
+ return [[renderMenuIconIfApplicable.call(_this2), textOrItemRender, renderArrowIfApplicable.call(_this2)]];
206
+ } : [[renderMenuIconIfApplicable.call(_this2), textOrItemRender, renderArrowIfApplicable.call(_this2)]]);
207
+ return getTemplate.call(this, {
208
+ h: h,
209
+ template: this.currentLinkRender,
210
+ defaultRendering: defaultLink,
211
+ additionalProps: {
212
+ item: this.$props.originalItemNeeded(item.id),
162
213
  itemId: item.id,
163
214
  opened: this.currentOpened,
164
215
  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
- }
216
+ }
217
+ });
189
218
  };
190
219
 
191
220
  var renderPopupIfOpened = function renderPopupIfOpened() {
@@ -229,7 +258,8 @@ var MenuItemInternal = {
229
258
  itemRender: _this3.$props.itemRender,
230
259
  linkRender: _this3.$props.linkRender,
231
260
  isMenuVertical: _this3.$props.isMenuVertical,
232
- isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft
261
+ isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft,
262
+ originalItemNeeded: _this3.handleOriginalItemNeeded
233
263
  },
234
264
  items: _this3.$props.item.items,
235
265
  menuGuid: _this3.$props.menuGuid,
@@ -245,18 +275,19 @@ var MenuItemInternal = {
245
275
  on: _this3.v3 ? undefined : {
246
276
  "mouseover": _this3.handleItemMouseOver,
247
277
  "mouseleave": _this3.handleItemMouseLeave,
248
- "mousedown": _this3.handleItemMouseDown,
278
+ "mousedown": _this3.handleMouseDown,
249
279
  "blur": _this3.handleItemMouseBlur,
250
280
  "focus": _this3.handleItemMouseFocus,
251
- "click": _this3.handleItemMouseClick,
252
- "originalitemneeded": _this3.handleOriginalItemNeeded
281
+ "click": _this3.handleClick,
282
+ "keydown": _this3.handleKeyDown
253
283
  },
254
284
  onMouseleave: _this3.handleItemMouseLeave,
255
- onMousedown: _this3.handleItemMouseDown,
285
+ onMousedown: _this3.handleMouseDown,
256
286
  onBlur: _this3.handleItemMouseBlur,
257
287
  onFocus: _this3.handleItemMouseFocus,
258
- onClick: _this3.handleItemMouseClick,
259
- onOriginalitemneeded: _this3.handleOriginalItemNeeded
288
+ onClick: _this3.handleClick,
289
+ onKeydown: _this3.handleKeyDown,
290
+ originalItemNeeded: _this3.handleOriginalItemNeeded
260
291
  })];
261
292
  } : [h(MenuItemInternalsList, {
262
293
  parentItemId: itemId,
@@ -270,7 +301,8 @@ var MenuItemInternal = {
270
301
  itemRender: _this3.$props.itemRender,
271
302
  linkRender: _this3.$props.linkRender,
272
303
  isMenuVertical: _this3.$props.isMenuVertical,
273
- isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft
304
+ isDirectionRightToLeft: _this3.$props.isDirectionRightToLeft,
305
+ originalItemNeeded: _this3.handleOriginalItemNeeded
274
306
  },
275
307
  items: _this3.$props.item.items,
276
308
  menuGuid: _this3.$props.menuGuid,
@@ -286,18 +318,19 @@ var MenuItemInternal = {
286
318
  on: _this3.v3 ? undefined : {
287
319
  "mouseover": _this3.handleItemMouseOver,
288
320
  "mouseleave": _this3.handleItemMouseLeave,
289
- "mousedown": _this3.handleItemMouseDown,
321
+ "mousedown": _this3.handleMouseDown,
290
322
  "blur": _this3.handleItemMouseBlur,
291
323
  "focus": _this3.handleItemMouseFocus,
292
- "click": _this3.handleItemMouseClick,
293
- "originalitemneeded": _this3.handleOriginalItemNeeded
324
+ "click": _this3.handleClick,
325
+ "keydown": _this3.handleKeyDown
294
326
  },
295
327
  onMouseleave: _this3.handleItemMouseLeave,
296
- onMousedown: _this3.handleItemMouseDown,
328
+ onMousedown: _this3.handleMouseDown,
297
329
  onBlur: _this3.handleItemMouseBlur,
298
330
  onFocus: _this3.handleItemMouseFocus,
299
- onClick: _this3.handleItemMouseClick,
300
- onOriginalitemneeded: _this3.handleOriginalItemNeeded
331
+ onClick: _this3.handleClick,
332
+ onKeydown: _this3.handleKeyDown,
333
+ originalItemNeeded: _this3.handleOriginalItemNeeded
301
334
  })])
302
335
  );
303
336
  };
@@ -330,7 +363,8 @@ var MenuItemInternal = {
330
363
  },
331
364
  "click": function click(event) {
332
365
  return _this.handleClick(event, itemId);
333
- }
366
+ },
367
+ "keydown": this.handleKeyDown
334
368
  },
335
369
  onMouseleave: this.onMouseLeave,
336
370
  onMousedown: function mousedown(event) {
@@ -345,6 +379,7 @@ var MenuItemInternal = {
345
379
  onClick: function click(event) {
346
380
  return _this.handleClick(event, itemId);
347
381
  },
382
+ onKeydown: this.handleKeyDown,
348
383
  role: "menuitem",
349
384
  "aria-disabled": item.disabled ? true : undefined,
350
385
  "aria-haspopup": item.items.length > 0 ? true : undefined,
@@ -358,24 +393,21 @@ var MenuItemInternal = {
358
393
  }, [this.contentRender ? renderContent.call(this) : renderMenuItemLink.call(this), renderPopupIfOpened.call(this)]);
359
394
  },
360
395
  methods: {
396
+ handleKeyDown: function handleKeyDown(event) {
397
+ this.$emit('keydown', event);
398
+ },
361
399
  handleItemMouseOver: function handleItemMouseOver(event) {
362
400
  this.$emit('mouseover', event);
363
401
  },
364
402
  handleItemMouseLeave: function handleItemMouseLeave(event) {
365
403
  this.$emit('mouseleave', event);
366
404
  },
367
- handleItemMouseDown: function handleItemMouseDown(event) {
368
- this.$emit('mousedown', event);
369
- },
370
405
  handleItemMouseBlur: function handleItemMouseBlur(event) {
371
406
  this.$emit('blur', event);
372
407
  },
373
408
  handleItemMouseFocus: function handleItemMouseFocus(event) {
374
409
  this.$emit('focus', event);
375
410
  },
376
- handleItemMouseClick: function handleItemMouseClick(event) {
377
- this.$emit('click', event);
378
- },
379
411
  handleClick: function handleClick(event, itemId) {
380
412
  this.$emit('click', event, itemId);
381
413
  },
@@ -389,7 +421,7 @@ var MenuItemInternal = {
389
421
  this.$emit('mousedown', event);
390
422
  },
391
423
  handleOriginalItemNeeded: function handleOriginalItemNeeded(event) {
392
- this.$emit('originalitemneeded', event);
424
+ this.$props.originalItemNeeded(event);
393
425
  },
394
426
  onMouseOver: function onMouseOver(event) {
395
427
  this.$emit('mouseover', this.$props.item.id);
@@ -398,18 +430,6 @@ var MenuItemInternal = {
398
430
  onMouseLeave: function onMouseLeave(event) {
399
431
  this.$emit('mouseleave', this.$props.item.id);
400
432
  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
433
  }
414
434
  }
415
435
  };
@@ -7,6 +7,16 @@ import { getDOMElementId } from './../utils/misc'; // tslint:enable:max-line-len
7
7
 
8
8
  var MenuItemInternalsList = {
9
9
  name: 'KendoMenuItemInternalsList',
10
+ // @ts-ignore
11
+ emits: {
12
+ 'keydown': null,
13
+ 'mouseover': null,
14
+ 'mouseleave': null,
15
+ 'blur': null,
16
+ 'focus': null,
17
+ 'click': null,
18
+ 'mousedown': null
19
+ },
10
20
  props: {
11
21
  items: Array,
12
22
  parentItemId: String,
@@ -17,7 +27,8 @@ var MenuItemInternalsList = {
17
27
  linkRender: [String, Object, Function],
18
28
  isMenuVertical: Boolean,
19
29
  isDirectionRightToLeft: Boolean,
20
- menuGuid: String
30
+ menuGuid: String,
31
+ originalItemNeeded: Function
21
32
  },
22
33
  // @ts-ignore
23
34
  setup: !gh ? undefined : function () {
@@ -44,7 +55,8 @@ var MenuItemInternalsList = {
44
55
  tabbableItemId: this.$props.tabbableItemId,
45
56
  itemRender: this.$props.itemRender,
46
57
  linkRender: this.$props.linkRender,
47
- menuGuid: this.$props.menuGuid
58
+ menuGuid: this.$props.menuGuid,
59
+ originalItemNeeded: this.handleOriginalItemNeeded
48
60
  },
49
61
  isMenuVertical: this.$props.isMenuVertical,
50
62
  isDirectionRightToLeft: this.$props.isDirectionRightToLeft,
@@ -59,17 +71,18 @@ var MenuItemInternalsList = {
59
71
  "mouseover": this.handleItemMouseOver,
60
72
  "mouseleave": this.handleItemMouseLeave,
61
73
  "mousedown": this.handleItemMouseDown,
74
+ "keydown": this.handleKeyDown,
62
75
  "blur": this.handleItemMouseBlur,
63
76
  "focus": this.handleItemMouseFocus,
64
- "click": this.handleItemMouseClick,
65
- "originalitemneeded": this.handleOriginalItemNeeded
77
+ "click": this.handleItemMouseClick
66
78
  },
67
79
  onMouseleave: this.handleItemMouseLeave,
68
80
  onMousedown: this.handleItemMouseDown,
81
+ onKeydown: this.handleKeyDown,
69
82
  onBlur: this.handleItemMouseBlur,
70
83
  onFocus: this.handleItemMouseFocus,
71
84
  onClick: this.handleItemMouseClick,
72
- onOriginalitemneeded: this.handleOriginalItemNeeded,
85
+ originalItemNeeded: this.handleOriginalItemNeeded,
73
86
  key: index
74
87
  })
75
88
  );
@@ -92,8 +105,11 @@ var MenuItemInternalsList = {
92
105
  }, [renderChildItems.call(this)]);
93
106
  },
94
107
  methods: {
108
+ handleKeyDown: function handleKeyDown(event) {
109
+ this.$emit('keydown', event);
110
+ },
95
111
  handleOriginalItemNeeded: function handleOriginalItemNeeded(event) {
96
- this.$emit('originalitemneeded', event);
112
+ this.$props.originalItemNeeded(event);
97
113
  },
98
114
  handleItemMouseOver: function handleItemMouseOver(event) {
99
115
  this.$emit('mouseover', event);
@@ -2,4 +2,4 @@ import { MenuItemModel } from '../models/MenuItemModel';
2
2
  /**
3
3
  * @hidden
4
4
  */
5
- export declare function prepareInputItemsForInternalWork(models?: MenuItemModel[]): any;
5
+ export declare function prepareInputItemsForInternalWork(this: any, models?: MenuItemModel[]): any;
@@ -1,3 +1,4 @@
1
+ import { templateRendering, getListeners } from '@progress/kendo-vue-common';
1
2
  import { createId, ZERO_LEVEL_ZERO_ITEM_ID } from './itemsIdsUtils';
2
3
  /**
3
4
  * @hidden
@@ -5,7 +6,7 @@ import { createId, ZERO_LEVEL_ZERO_ITEM_ID } from './itemsIdsUtils';
5
6
  export function prepareInputItemsForInternalWork(models) {
6
7
  if (models && models.length > 0) {
7
8
  return {
8
- items: convertInputModelsToInternalOnesHelper(models),
9
+ items: convertInputModelsToInternalOnesHelper.call(this, models),
9
10
  inputItems: models
10
11
  };
11
12
  }
@@ -35,13 +36,13 @@ function copyInputItemWithoutChildren(inputModel) {
35
36
  result.cssStyle = cssStyle;
36
37
  }
37
38
  if (render !== undefined) {
38
- result.render = render;
39
+ result.render = templateRendering.call(this, render, getListeners.call(this));
39
40
  }
40
41
  if (linkRender !== undefined) {
41
- result.linkRender = linkRender;
42
+ result.linkRender = templateRendering.call(this, linkRender, getListeners.call(this));
42
43
  }
43
44
  if (contentRender !== undefined) {
44
- result.contentRender = contentRender;
45
+ result.contentRender = templateRendering.call(this, contentRender, getListeners.call(this));
45
46
  }
46
47
  if (data !== undefined) {
47
48
  result.data = data;
@@ -52,7 +53,7 @@ function convertInputModelsToInternalOnesHelper(inputModels, parentId) {
52
53
  var result = [];
53
54
  for (var index = 0; index < inputModels.length; index++) {
54
55
  var inputModel = inputModels[index];
55
- var internalModel = copyInputItemWithoutChildren(inputModel);
56
+ var internalModel = copyInputItemWithoutChildren.call(this, inputModel);
56
57
  internalModel.id = createId(index.toString(), parentId);
57
58
  internalModel.isLastFromSiblings = index === inputModels.length - 1;
58
59
  internalModel.items = copyOrCreateModelChildren(inputModel, internalModel);
@@ -71,7 +72,7 @@ function copyOrCreateModelChildren(inputModel, internalModel) {
71
72
  }];
72
73
  }
73
74
  else if (inputModel.items) {
74
- return convertInputModelsToInternalOnesHelper(inputModel.items, internalModel.id);
75
+ return convertInputModelsToInternalOnesHelper.call(this, inputModel.items, internalModel.id);
75
76
  }
76
77
  else {
77
78
  return [];
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-vue-layout',
6
6
  productName: 'Kendo UI for Vue',
7
7
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
- publishDate: 1634033037,
8
+ publishDate: 1634279685,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
11
  };
@@ -16,5 +16,5 @@ export interface BaseMenuItemInternalProps {
16
16
  onFocus?: any;
17
17
  onClick?: any;
18
18
  onBlur?: any;
19
- onOriginalItemNeeded?: any;
19
+ originalItemNeeded?: any;
20
20
  }