@progress/kendo-vue-layout 10.2.0-develop.5 → 10.2.0-develop.6
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.
- package/contextmenu/ContextMenu.d.ts +15 -1
- package/contextmenu/ContextMenu.js +1 -1
- package/contextmenu/ContextMenu.mjs +34 -27
- package/dist/cdn/js/kendo-vue-layout.js +1 -1
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/menu/BaseMenuItemInternalProps.d.ts +4 -0
- package/menu/MenuProps.d.ts +35 -0
- package/menu/components/Menu.d.ts +11 -3
- package/menu/components/Menu.js +1 -1
- package/menu/components/Menu.mjs +46 -34
- package/menu/components/MenuItemInternal.d.ts +20 -4
- package/menu/components/MenuItemInternal.js +1 -1
- package/menu/components/MenuItemInternal.mjs +156 -82
- package/menu/components/MenuItemLink.d.ts +8 -0
- package/menu/components/MenuItemLink.js +1 -1
- package/menu/components/MenuItemLink.mjs +13 -11
- package/menu/models/BaseMenuItem.d.ts +36 -0
- package/menu/models/MenuItemActionsRenderProps.d.ts +17 -0
- package/menu/models/MenuItemGroupHeaderRenderProps.d.ts +17 -0
- package/menu/utils/getNewItemIdUponKeyboardNavigation.js +1 -1
- package/menu/utils/getNewItemIdUponKeyboardNavigation.mjs +57 -62
- package/menu/utils/itemsIdsUtils.d.ts +0 -16
- package/menu/utils/itemsIdsUtils.js +1 -1
- package/menu/utils/itemsIdsUtils.mjs +23 -40
- package/menu/utils/misc.d.ts +8 -0
- package/menu/utils/misc.js +1 -1
- package/menu/utils/misc.mjs +23 -14
- package/menu/utils/navigableItems.d.ts +28 -0
- package/menu/utils/navigableItems.js +8 -0
- package/menu/utils/navigableItems.mjs +45 -0
- package/menu/utils/prepareInputItemsForInternalWork.js +1 -1
- package/menu/utils/prepareInputItemsForInternalWork.mjs +58 -46
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +7 -7
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import {
|
|
10
|
-
import { Popup as
|
|
11
|
-
import {
|
|
12
|
-
import { getDOMElementId as
|
|
13
|
-
import { MenuItemLink as
|
|
14
|
-
import { MenuItemArrow as
|
|
15
|
-
const
|
|
8
|
+
import { defineComponent as v, createVNode as n, h as d, Fragment as x, mergeProps as E } from "vue";
|
|
9
|
+
import { classNames as a, getTemplate as u, Icon as g, getIconName as k, setRef as G, kendoThemeMaps as K, getRef as V, guid as z } from "@progress/kendo-vue-common";
|
|
10
|
+
import { Popup as j } from "@progress/kendo-vue-popup";
|
|
11
|
+
import { isIdZeroLevel as R, shouldOpenItem as H } from "../utils/itemsIdsUtils.mjs";
|
|
12
|
+
import { getDOMPopupListId as O, getDOMElementId as _, convertBoolDirectionToString as b, getPopupSettings as Z, hasRenderableContent as q } from "../utils/misc.mjs";
|
|
13
|
+
import { MenuItemLink as J } from "./MenuItemLink.mjs";
|
|
14
|
+
import { MenuItemArrow as Q } from "./MenuItemArrow.mjs";
|
|
15
|
+
const U = /* @__PURE__ */ v({
|
|
16
16
|
name: "KendoMenuItemInternal",
|
|
17
17
|
emits: {
|
|
18
18
|
keydown: null,
|
|
@@ -30,13 +30,16 @@ const K = /* @__PURE__ */ c({
|
|
|
30
30
|
tabbableItemId: String,
|
|
31
31
|
itemRender: [String, Object, Function],
|
|
32
32
|
linkRender: [String, Object, Function],
|
|
33
|
+
actionsRender: [String, Object, Function],
|
|
33
34
|
isMenuVertical: Boolean,
|
|
34
35
|
isDirectionRightToLeft: Boolean,
|
|
36
|
+
size: String,
|
|
37
|
+
isContextMenu: Boolean,
|
|
35
38
|
menuGuid: String,
|
|
36
39
|
originalItemNeeded: Function
|
|
37
40
|
},
|
|
38
41
|
created() {
|
|
39
|
-
this.itemElement = null, this.prevFocusedItemId = this.$props.focusedItemId, this.isFirstRender = !0, this._anchor =
|
|
42
|
+
this.itemElement = null, this.prevFocusedItemId = this.$props.focusedItemId, this.isFirstRender = !0, this._anchor = z();
|
|
40
43
|
},
|
|
41
44
|
data() {
|
|
42
45
|
return {
|
|
@@ -44,7 +47,7 @@ const K = /* @__PURE__ */ c({
|
|
|
44
47
|
};
|
|
45
48
|
},
|
|
46
49
|
mounted() {
|
|
47
|
-
this.itemElement =
|
|
50
|
+
this.itemElement = V(this, "kendoAnchor");
|
|
48
51
|
const e = this.$props.focusedItemId, t = this.$props.item.id;
|
|
49
52
|
e && e === t && this.itemElement && this.itemElement.focus(), this.isFirstRender = !1;
|
|
50
53
|
},
|
|
@@ -67,12 +70,15 @@ const K = /* @__PURE__ */ c({
|
|
|
67
70
|
currentLinkRender() {
|
|
68
71
|
return this.$props.item.linkRender || this.$props.linkRender;
|
|
69
72
|
},
|
|
73
|
+
currentActionsRender() {
|
|
74
|
+
return this.$props.item.actionsRender || this.$props.actionsRender;
|
|
75
|
+
},
|
|
70
76
|
contentRender() {
|
|
71
77
|
return this.$props.item.contentParentItemId ? this.$props.item.contentRender : null;
|
|
72
78
|
},
|
|
73
79
|
currentOpened() {
|
|
74
80
|
const e = this.$props;
|
|
75
|
-
return this.hasItems &&
|
|
81
|
+
return this.hasItems && H(e.item.id, e.lastItemIdToBeOpened) && // HACK: Wait for the second render because otherwise the scenario of
|
|
76
82
|
// popup inside popup throws an error (for example, hover of item with id '0_0').
|
|
77
83
|
!this.isFirstRender;
|
|
78
84
|
},
|
|
@@ -81,20 +87,21 @@ const K = /* @__PURE__ */ c({
|
|
|
81
87
|
return e === t;
|
|
82
88
|
},
|
|
83
89
|
popupClassName() {
|
|
84
|
-
return
|
|
90
|
+
return a({
|
|
85
91
|
"k-menu-popup": !0,
|
|
86
92
|
"k-overflow-visible": !0,
|
|
87
93
|
"k-rtl": this.$props.isDirectionRightToLeft,
|
|
88
94
|
[this.item.popupClass]: this.item.popupClass
|
|
89
95
|
});
|
|
90
96
|
},
|
|
97
|
+
popupListClassName() {
|
|
98
|
+
return a("k-menu-group", this.$props.size && `k-menu-group-${K.sizeMap[this.$props.size]}`);
|
|
99
|
+
},
|
|
91
100
|
menuItemClassName() {
|
|
92
101
|
const e = this.$props.item;
|
|
93
102
|
return {
|
|
94
103
|
"k-item": !0,
|
|
95
104
|
"k-menu-item": !0,
|
|
96
|
-
"k-first": T(e.id),
|
|
97
|
-
"k-last": e.isLastFromSiblings,
|
|
98
105
|
"k-disabled": e.disabled,
|
|
99
106
|
[e.cssClass ? e.cssClass : ""]: e.cssClass
|
|
100
107
|
};
|
|
@@ -105,87 +112,150 @@ const K = /* @__PURE__ */ c({
|
|
|
105
112
|
icon: e,
|
|
106
113
|
svgIcon: t,
|
|
107
114
|
id: o,
|
|
108
|
-
contentParentItemId:
|
|
109
|
-
items:
|
|
110
|
-
text:
|
|
111
|
-
|
|
115
|
+
contentParentItemId: p,
|
|
116
|
+
items: X,
|
|
117
|
+
text: I,
|
|
118
|
+
description: f,
|
|
119
|
+
cssStyle: m,
|
|
112
120
|
disabled: $,
|
|
113
|
-
url:
|
|
114
|
-
separator:
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
url: w,
|
|
122
|
+
separator: C,
|
|
123
|
+
groupHeader: D,
|
|
124
|
+
cssClass: M
|
|
125
|
+
} = this.$props.item, s = o, h = _(this.$props.menuGuid, s);
|
|
126
|
+
if (C)
|
|
127
|
+
return n("li", {
|
|
128
|
+
id: h,
|
|
129
|
+
class: a("k-separator", "k-item", M),
|
|
130
|
+
style: m,
|
|
131
|
+
"aria-hidden": !0,
|
|
132
|
+
key: s
|
|
133
|
+
}, null);
|
|
134
|
+
if (D) {
|
|
135
|
+
if (!(!R(s) || !!this.$props.isContextMenu && !!this.$props.isMenuVertical))
|
|
136
|
+
return null;
|
|
137
|
+
const r = this.$props.item.groupHeaderRender, l = r ? u.call(this, {
|
|
138
|
+
h: d,
|
|
139
|
+
template: r,
|
|
140
|
+
additionalProps: {
|
|
141
|
+
item: this.$props.originalItemNeeded(s),
|
|
142
|
+
itemId: s
|
|
143
|
+
}
|
|
144
|
+
}) : n(x, null, [e || t ? n(g, {
|
|
145
|
+
class: "k-menu-link-icon",
|
|
146
|
+
name: k(e),
|
|
147
|
+
icon: t
|
|
148
|
+
}, null) : null, n("span", {
|
|
149
|
+
class: "k-menu-link-text"
|
|
150
|
+
}, [I])]);
|
|
151
|
+
return n("li", {
|
|
152
|
+
id: h,
|
|
153
|
+
class: a("k-menu-group-header", M),
|
|
154
|
+
style: m,
|
|
155
|
+
role: "presentation",
|
|
156
|
+
onMousedown: (P) => P.preventDefault(),
|
|
157
|
+
key: s
|
|
158
|
+
}, [l]);
|
|
159
|
+
}
|
|
160
|
+
const L = !!$ && (!R(s) || !!this.$props.isContextMenu), y = function() {
|
|
161
|
+
const i = p;
|
|
117
162
|
return n("div", {
|
|
118
163
|
class: "k-content",
|
|
119
164
|
role: "presentation"
|
|
120
|
-
}, [function(
|
|
121
|
-
return
|
|
122
|
-
h:
|
|
165
|
+
}, [function(l) {
|
|
166
|
+
return u.call(this, {
|
|
167
|
+
h: d,
|
|
123
168
|
template: this.contentRender,
|
|
124
|
-
additionalProps:
|
|
169
|
+
additionalProps: l
|
|
125
170
|
});
|
|
126
171
|
}.call(this, {
|
|
127
172
|
item: this.handleOriginalItemNeeded(i),
|
|
128
173
|
itemId: i
|
|
129
174
|
})]);
|
|
130
|
-
},
|
|
131
|
-
return e || t ? n(
|
|
132
|
-
|
|
175
|
+
}, F = function() {
|
|
176
|
+
return e || t ? n(g, {
|
|
177
|
+
class: "k-menu-link-icon",
|
|
178
|
+
name: k(e),
|
|
133
179
|
icon: t
|
|
134
180
|
}, null) : null;
|
|
135
|
-
},
|
|
136
|
-
return this.hasItems ? n(
|
|
181
|
+
}, B = function() {
|
|
182
|
+
return this.hasItems ? n(Q, {
|
|
137
183
|
itemId: o,
|
|
138
184
|
verticalMenu: this.$props.isMenuVertical,
|
|
139
|
-
dir:
|
|
185
|
+
dir: b(this.$props.isDirectionRightToLeft),
|
|
140
186
|
key: "2"
|
|
141
187
|
}, null) : null;
|
|
142
|
-
},
|
|
188
|
+
}, N = function() {
|
|
189
|
+
return f && !this.currentItemRender ? n("span", {
|
|
190
|
+
class: "k-menu-link-description",
|
|
191
|
+
key: "3"
|
|
192
|
+
}, [f]) : null;
|
|
193
|
+
}, c = this.$props.originalItemNeeded(o), S = function() {
|
|
194
|
+
const i = u.call(this, {
|
|
195
|
+
h: d,
|
|
196
|
+
template: this.currentActionsRender,
|
|
197
|
+
additionalProps: {
|
|
198
|
+
item: c,
|
|
199
|
+
itemId: o
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
return q(i) ? n("span", {
|
|
203
|
+
class: "k-menu-link-actions",
|
|
204
|
+
key: "4"
|
|
205
|
+
}, [i]) : null;
|
|
206
|
+
}, T = function() {
|
|
143
207
|
const i = n("span", {
|
|
144
208
|
class: "k-menu-link-text"
|
|
145
|
-
}, [
|
|
146
|
-
h:
|
|
209
|
+
}, [I]), r = u.call(this, {
|
|
210
|
+
h: d,
|
|
147
211
|
template: this.currentItemRender,
|
|
148
212
|
defaultRendering: i,
|
|
149
213
|
additionalProps: {
|
|
150
|
-
item:
|
|
214
|
+
item: c,
|
|
151
215
|
itemId: o,
|
|
152
216
|
key: "1"
|
|
153
217
|
}
|
|
154
|
-
}),
|
|
155
|
-
url:
|
|
218
|
+
}), l = n(J, {
|
|
219
|
+
url: w,
|
|
156
220
|
opened: this.currentOpened,
|
|
157
|
-
focused: this.currentFocused
|
|
221
|
+
focused: this.currentFocused,
|
|
222
|
+
disabled: L
|
|
158
223
|
}, {
|
|
159
|
-
default: () => [[
|
|
224
|
+
default: () => [[F.call(this), r, S.call(this), B.call(this), N.call(this)]]
|
|
160
225
|
});
|
|
161
|
-
return
|
|
162
|
-
h:
|
|
226
|
+
return u.call(this, {
|
|
227
|
+
h: d,
|
|
163
228
|
template: this.currentLinkRender,
|
|
164
|
-
defaultRendering:
|
|
229
|
+
defaultRendering: l,
|
|
165
230
|
additionalProps: {
|
|
166
|
-
item:
|
|
231
|
+
item: c,
|
|
167
232
|
itemId: o,
|
|
168
233
|
opened: this.currentOpened,
|
|
169
|
-
dir:
|
|
234
|
+
dir: b(this.$props.isDirectionRightToLeft)
|
|
170
235
|
}
|
|
171
236
|
});
|
|
172
|
-
},
|
|
237
|
+
}, A = function() {
|
|
173
238
|
const {
|
|
174
239
|
anchorAlign: i,
|
|
175
|
-
popupAlign:
|
|
176
|
-
collision:
|
|
177
|
-
} =
|
|
178
|
-
return n(
|
|
240
|
+
popupAlign: r,
|
|
241
|
+
collision: l
|
|
242
|
+
} = Z(s, this.$props.isMenuVertical, this.$props.isDirectionRightToLeft);
|
|
243
|
+
return n(j, E({
|
|
179
244
|
anchor: this._anchor,
|
|
180
245
|
show: this.currentOpened,
|
|
181
246
|
popupClass: this.popupClassName,
|
|
182
247
|
anchorAlign: i,
|
|
183
|
-
popupAlign:
|
|
184
|
-
collision:
|
|
185
|
-
animate: !1
|
|
186
|
-
|
|
248
|
+
popupAlign: r,
|
|
249
|
+
collision: l,
|
|
250
|
+
animate: !1
|
|
251
|
+
}, {
|
|
252
|
+
onMouseover: this.onMouseOver,
|
|
253
|
+
onMouseleave: this.onMouseLeave,
|
|
254
|
+
onMousedown: this.handlePopupMouseDown
|
|
187
255
|
}, {
|
|
188
|
-
|
|
256
|
+
key: "1"
|
|
257
|
+
}), {
|
|
258
|
+
default: () => [n(W, {
|
|
189
259
|
parentItemId: s,
|
|
190
260
|
items: this.$props.item.items,
|
|
191
261
|
menuGuid: this.$props.menuGuid,
|
|
@@ -194,9 +264,12 @@ const K = /* @__PURE__ */ c({
|
|
|
194
264
|
tabbableItemId: this.$props.tabbableItemId,
|
|
195
265
|
itemRender: this.$props.itemRender,
|
|
196
266
|
linkRender: this.$props.linkRender,
|
|
267
|
+
actionsRender: this.$props.actionsRender,
|
|
197
268
|
isMenuVertical: this.$props.isMenuVertical,
|
|
198
269
|
isDirectionRightToLeft: this.$props.isDirectionRightToLeft,
|
|
199
|
-
|
|
270
|
+
size: this.$props.size,
|
|
271
|
+
isContextMenu: this.$props.isContextMenu,
|
|
272
|
+
class: this.popupListClassName,
|
|
200
273
|
onMouseover: this.handleItemMouseOver,
|
|
201
274
|
onMouseleave: this.handleItemMouseLeave,
|
|
202
275
|
onMousedown: this.handleMouseDown,
|
|
@@ -207,14 +280,11 @@ const K = /* @__PURE__ */ c({
|
|
|
207
280
|
originalItemNeeded: this.handleOriginalItemNeeded
|
|
208
281
|
}, null)]
|
|
209
282
|
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
key: s
|
|
214
|
-
}, null);
|
|
215
|
-
return M ? w : n("li", {
|
|
283
|
+
};
|
|
284
|
+
return n("li", {
|
|
285
|
+
id: h,
|
|
216
286
|
class: this.menuItemClassName,
|
|
217
|
-
style:
|
|
287
|
+
style: m,
|
|
218
288
|
tabindex: s === this.$props.tabbableItemId ? 0 : -1,
|
|
219
289
|
onMouseover: this.onMouseOver,
|
|
220
290
|
onMouseleave: this.onMouseLeave,
|
|
@@ -225,13 +295,12 @@ const K = /* @__PURE__ */ c({
|
|
|
225
295
|
onKeydown: this.handleKeyDown,
|
|
226
296
|
role: "menuitem",
|
|
227
297
|
"aria-disabled": $ ? !0 : void 0,
|
|
228
|
-
"aria-haspopup": this.hasItems ?
|
|
298
|
+
"aria-haspopup": this.hasItems ? "menu" : void 0,
|
|
229
299
|
"aria-expanded": this.hasItems ? this.currentOpened : void 0,
|
|
230
|
-
"aria-
|
|
231
|
-
|
|
232
|
-
ref: F(this, "kendoAnchor"),
|
|
300
|
+
"aria-controls": this.currentOpened ? O(this.$props.menuGuid, s) : void 0,
|
|
301
|
+
ref: G(this, "kendoAnchor"),
|
|
233
302
|
key: "0"
|
|
234
|
-
}, [this.contentRender ?
|
|
303
|
+
}, [this.contentRender ? y.call(this) : T.call(this), A.call(this)]);
|
|
235
304
|
},
|
|
236
305
|
methods: {
|
|
237
306
|
handleKeyDown(e) {
|
|
@@ -269,9 +338,13 @@ const K = /* @__PURE__ */ c({
|
|
|
269
338
|
},
|
|
270
339
|
onMouseLeave(e) {
|
|
271
340
|
this.$emit("mouseleave", this.$props.item.id), e.stopPropagation();
|
|
341
|
+
},
|
|
342
|
+
// Keeps the focused item focused when the popup padding or a non-interactive entry is pressed.
|
|
343
|
+
handlePopupMouseDown(e) {
|
|
344
|
+
e.target.closest(".k-menu-item, .k-content") || e.preventDefault();
|
|
272
345
|
}
|
|
273
346
|
}
|
|
274
|
-
}),
|
|
347
|
+
}), W = /* @__PURE__ */ v({
|
|
275
348
|
name: "KendoMenuItemInternalsList",
|
|
276
349
|
emits: {
|
|
277
350
|
keydown: null,
|
|
@@ -293,23 +366,30 @@ const K = /* @__PURE__ */ c({
|
|
|
293
366
|
tabbableItemId: String,
|
|
294
367
|
itemRender: [String, Object, Function],
|
|
295
368
|
linkRender: [String, Object, Function],
|
|
369
|
+
actionsRender: [String, Object, Function],
|
|
296
370
|
isMenuVertical: Boolean,
|
|
297
371
|
isDirectionRightToLeft: Boolean,
|
|
372
|
+
size: String,
|
|
373
|
+
isContextMenu: Boolean,
|
|
374
|
+
role: String,
|
|
298
375
|
menuGuid: String,
|
|
299
376
|
originalItemNeeded: Function
|
|
300
377
|
},
|
|
301
378
|
render() {
|
|
302
379
|
const e = this.$props.parentItemId, t = function() {
|
|
303
|
-
return this.$props.items.length > 0 ? this.$props.items.map(function(o,
|
|
304
|
-
return n(
|
|
380
|
+
return this.$props.items.length > 0 ? this.$props.items.map(function(o, p) {
|
|
381
|
+
return n(U, {
|
|
305
382
|
item: o,
|
|
306
383
|
isMenuVertical: this.$props.isMenuVertical,
|
|
307
384
|
isDirectionRightToLeft: this.$props.isDirectionRightToLeft,
|
|
385
|
+
size: this.$props.size,
|
|
386
|
+
isContextMenu: this.$props.isContextMenu,
|
|
308
387
|
focusedItemId: this.$props.focusedItemId,
|
|
309
388
|
lastItemIdToBeOpened: this.$props.lastItemIdToBeOpened,
|
|
310
389
|
tabbableItemId: this.$props.tabbableItemId,
|
|
311
390
|
itemRender: this.$props.itemRender,
|
|
312
391
|
linkRender: this.$props.linkRender,
|
|
392
|
+
actionsRender: this.$props.actionsRender,
|
|
313
393
|
menuGuid: this.$props.menuGuid,
|
|
314
394
|
onMouseover: this.handleItemMouseOver,
|
|
315
395
|
onMouseleave: this.handleItemMouseLeave,
|
|
@@ -319,13 +399,13 @@ const K = /* @__PURE__ */ c({
|
|
|
319
399
|
onFocus: this.handleItemMouseFocus,
|
|
320
400
|
onClick: this.handleItemMouseClick,
|
|
321
401
|
originalItemNeeded: this.handleOriginalItemNeeded,
|
|
322
|
-
key:
|
|
402
|
+
key: p
|
|
323
403
|
}, null);
|
|
324
404
|
}, this) : null;
|
|
325
405
|
};
|
|
326
406
|
return n("ul", {
|
|
327
|
-
role: e !== void 0 ? "menu" : "menubar",
|
|
328
|
-
id: e !== void 0 ?
|
|
407
|
+
role: this.$props.role || (e !== void 0 ? "menu" : "menubar"),
|
|
408
|
+
id: e !== void 0 ? O(this.$props.menuGuid, e) : void 0
|
|
329
409
|
}, [t.call(this)]);
|
|
330
410
|
},
|
|
331
411
|
methods: {
|
|
@@ -352,16 +432,10 @@ const K = /* @__PURE__ */ c({
|
|
|
352
432
|
},
|
|
353
433
|
handleItemMouseClick(e, t) {
|
|
354
434
|
this.$emit("click", e, t);
|
|
355
|
-
},
|
|
356
|
-
onMouseOver(e) {
|
|
357
|
-
this.$props.parentItemId !== void 0 && (this.$emit("mouseover", this.$props.parentItemId), e.stopPropagation());
|
|
358
|
-
},
|
|
359
|
-
onMouseLeave(e) {
|
|
360
|
-
this.$props.parentItemId !== void 0 && (this.$emit("mouseleave", this.$props.parentItemId), e.stopPropagation());
|
|
361
435
|
}
|
|
362
436
|
}
|
|
363
437
|
});
|
|
364
438
|
export {
|
|
365
|
-
|
|
366
|
-
|
|
439
|
+
U as MenuItemInternal,
|
|
440
|
+
W as MenuItemInternalsList
|
|
367
441
|
};
|
|
@@ -21,6 +21,10 @@ export interface MenuItemLinkProps {
|
|
|
21
21
|
* Sets the URL of the MenuItemLink component.
|
|
22
22
|
*/
|
|
23
23
|
url?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Specifies whether the MenuItemLink component is disabled.
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* @hidden
|
|
@@ -35,18 +39,22 @@ declare const MenuItemLink: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
35
39
|
opened: BooleanConstructor;
|
|
36
40
|
focused: BooleanConstructor;
|
|
37
41
|
url: StringConstructor;
|
|
42
|
+
disabled: BooleanConstructor;
|
|
38
43
|
}>, {}, {}, {
|
|
39
44
|
menuItemClassName(): {
|
|
40
45
|
'k-link': boolean;
|
|
41
46
|
'k-menu-link': boolean;
|
|
42
47
|
'k-active': any;
|
|
43
48
|
'k-focus': any;
|
|
49
|
+
'k-disabled': any;
|
|
44
50
|
};
|
|
45
51
|
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
46
52
|
opened: BooleanConstructor;
|
|
47
53
|
focused: BooleanConstructor;
|
|
48
54
|
url: StringConstructor;
|
|
55
|
+
disabled: BooleanConstructor;
|
|
49
56
|
}>> & Readonly<{}>, {
|
|
57
|
+
disabled: boolean;
|
|
50
58
|
focused: boolean;
|
|
51
59
|
opened: boolean;
|
|
52
60
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("@progress/kendo-vue-common"),o=e.defineComponent({name:"KendoMenuItemLink",props:{opened:Boolean,focused:Boolean,url:String,disabled:Boolean},computed:{menuItemClassName(){return{"k-link":!0,"k-menu-link":!0,"k-active":this.$props.opened,"k-focus":this.$props.focused,"k-disabled":this.$props.disabled}}},render(){const t=s.getDefaultSlots(this);if(this.$props.url){const n=s.isSafeUrl(this.$props.url)?this.$props.url:void 0;return e.createVNode("a",{class:this.menuItemClassName,role:"presentation",href:n,tabindex:-1},[t])}else return e.createVNode("span",{class:this.menuItemClassName,role:"presentation"},[t])}});exports.MenuItemLink=o;
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { getDefaultSlots as
|
|
10
|
-
const
|
|
8
|
+
import { defineComponent as o, createVNode as s } from "vue";
|
|
9
|
+
import { getDefaultSlots as n, isSafeUrl as r } from "@progress/kendo-vue-common";
|
|
10
|
+
const a = /* @__PURE__ */ o({
|
|
11
11
|
name: "KendoMenuItemLink",
|
|
12
12
|
props: {
|
|
13
13
|
opened: Boolean,
|
|
14
14
|
focused: Boolean,
|
|
15
|
-
url: String
|
|
15
|
+
url: String,
|
|
16
|
+
disabled: Boolean
|
|
16
17
|
},
|
|
17
18
|
computed: {
|
|
18
19
|
menuItemClassName() {
|
|
@@ -20,27 +21,28 @@ const l = /* @__PURE__ */ n({
|
|
|
20
21
|
"k-link": !0,
|
|
21
22
|
"k-menu-link": !0,
|
|
22
23
|
"k-active": this.$props.opened,
|
|
23
|
-
"k-focus": this.$props.focused
|
|
24
|
+
"k-focus": this.$props.focused,
|
|
25
|
+
"k-disabled": this.$props.disabled
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
render() {
|
|
28
|
-
const e =
|
|
30
|
+
const e = n(this);
|
|
29
31
|
if (this.$props.url) {
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
+
const t = r(this.$props.url) ? this.$props.url : void 0;
|
|
33
|
+
return s("a", {
|
|
32
34
|
class: this.menuItemClassName,
|
|
33
35
|
role: "presentation",
|
|
34
|
-
href:
|
|
36
|
+
href: t,
|
|
35
37
|
tabindex: -1
|
|
36
38
|
}, [e]);
|
|
37
39
|
} else
|
|
38
|
-
return
|
|
40
|
+
return s("span", {
|
|
39
41
|
class: this.menuItemClassName,
|
|
40
42
|
role: "presentation"
|
|
41
43
|
}, [e]);
|
|
42
44
|
}
|
|
43
45
|
});
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
a as MenuItemLink
|
|
46
48
|
};
|
|
@@ -26,6 +26,16 @@ export interface BaseMenuItem {
|
|
|
26
26
|
* Specifies the name of the [SVGIcon]({% slug overview_svgicon %}) that will be rendered for the item).
|
|
27
27
|
*/
|
|
28
28
|
svgIcon?: SVGIcon;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies secondary text below the item text. It wraps without truncation, is independent of
|
|
31
|
+
* `actionsRender`, and is ignored for group headers and separators.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```vue
|
|
35
|
+
* <Menu :items="[{ text: 'Copy', description: 'Copy the selection' }]" />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
29
39
|
/**
|
|
30
40
|
* Specifies if the item is disabled ([see example]({% slug itemproperties_menu %}#toc-disabled-items)).
|
|
31
41
|
*/
|
|
@@ -62,4 +72,30 @@ export interface BaseMenuItem {
|
|
|
62
72
|
* Specifies if this is a separator item. If set to true only the `cssClass` and `cssStyle` props should be rendered along.
|
|
63
73
|
*/
|
|
64
74
|
separator?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Specifies a component, render function, or slot name for item-specific trailing actions before
|
|
77
|
+
* the expand arrow. Receives `{ item, itemId }` and overrides the Menu-level `actionsRender`.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```vue
|
|
81
|
+
* <Menu :items="[{ text: 'Copy', actionsRender: 'copyActions' }]">
|
|
82
|
+
* <template #copyActions><kbd>Ctrl+C</kbd></template>
|
|
83
|
+
* </Menu>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
actionsRender?: any;
|
|
87
|
+
/**
|
|
88
|
+
* Specifies whether this item is a non-interactive group header for following items.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```vue
|
|
92
|
+
* <Menu :items="[{ text: 'File', items: [{ text: 'Recent', groupHeader: true }, { text: 'Doc 1' }] }]" />
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
groupHeader?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Specifies a component, render function, or slot name for custom group-header content.
|
|
98
|
+
* Receives the original item and its `itemId`.
|
|
99
|
+
*/
|
|
100
|
+
groupHeaderRender?: any;
|
|
65
101
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { MenuItemModel } from './MenuItemModel';
|
|
9
|
+
/**
|
|
10
|
+
* The props supplied to a Vue Menu item actions template.
|
|
11
|
+
*/
|
|
12
|
+
export interface MenuItemActionsRenderProps {
|
|
13
|
+
/** The original item passed to the Menu. */
|
|
14
|
+
item: MenuItemModel;
|
|
15
|
+
/** The hierarchical, zero-based ID of the item. */
|
|
16
|
+
itemId: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { MenuItemModel } from './MenuItemModel';
|
|
9
|
+
/**
|
|
10
|
+
* The props supplied to a Vue Menu group-header template.
|
|
11
|
+
*/
|
|
12
|
+
export interface MenuItemGroupHeaderRenderProps {
|
|
13
|
+
/** The original item passed to the Menu. */
|
|
14
|
+
item: MenuItemModel;
|
|
15
|
+
/** The hierarchical, zero-based ID of the item. */
|
|
16
|
+
itemId: string;
|
|
17
|
+
}
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@progress/kendo-vue-common"),r=require("./itemsIdsUtils.js"),o=require("./navigableItems.js"),A=/\S/;function M(g,e,Z,y,u,f){const h=l();switch(Z){case i.Keys.left:return w();case i.Keys.right:return O();case i.Keys.up:return R();case i.Keys.down:return x();case i.Keys.enter:case i.Keys.space:return G();case i.Keys.home:return H();case i.Keys.end:return q();case i.Keys.esc:return B();default:return z()?D():e}function w(){return u?f?L():S():f?U():p()}function O(){return u?f?S():L():f?p():U()}function x(){return u?s():r.isIdZeroLevel(e)?d():s()}function R(){return u?v():r.isIdZeroLevel(e)?C():v()}function G(){return h.disabled?e:c()?o.getFirstNavigableChildId(e,h.items):r.getRootParentId(e)}function H(){var t,n;return(n=(t=b().find(o.isNavigableItem))==null?void 0:t.id)!=null?n:e}function q(){var t,n;return(n=(t=[...b()].reverse().find(o.isNavigableItem))==null?void 0:t.id)!=null?n:e}function B(){return r.isIdZeroLevel(e)?e:r.getDirectParentId(e)}function D(){const t=y.toLowerCase(),n=b().filter(o.isNavigableItem),a=n.findIndex(K=>K.id===e),P=a<0?-1:a,E=n.slice(P+1).concat(n.slice(0,P+1)).find(K=>(K.text||"").toLowerCase().startsWith(t));return E?E.id:e}function p(){return r.isIdZeroLevel(e)?v():r.isIdFirstLevel(e)?d(v(r.getRootParentId(e))):r.getDirectParentId(e)}function S(){return r.isIdZeroLevel(e)?C():r.getDirectParentId(e)}function U(){return r.isIdZeroLevel(e)?s():d(c()?e:s(r.getRootParentId(e)))}function L(){return d(r.isIdZeroLevel(e)||c()?e:s(r.getRootParentId(e)))}function d(t){return N(!0,t)}function C(t){return N(!1,t)}function z(){return y.length===1&&A.test(y)}function l(t,n){return t===void 0&&(t=e),n===void 0&&(n=g),r.getItemById(t,n)}function c(t){return l(t).items.length>0}function v(t){return F(!1,t)}function s(t){return F(!0,t)}function b(){return r.isIdZeroLevel(e)?g:l(r.getDirectParentId(e),g).items}function N(t,n){n===void 0&&(n=e);const a=l(n);return c(n)&&!a.disabled?t?o.getFirstNavigableChildId(n,a.items):o.getLastNavigableChildId(n,a.items):n}function F(t,n){n===void 0&&(n=e);const a=r.isIdZeroLevel(n)?g:l(r.getDirectParentId(n)).items;return o.getNavigableSiblingId(a,t,n)}}exports.getNewItemIdUponKeyboardNavigation=M;
|