@progress/kendo-vue-buttons 9.3.0-develop.3 → 9.3.0-develop.5
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/Chip/Chip.d.ts +6 -0
- package/Chip/Chip.js +1 -1
- package/Chip/Chip.mjs +68 -63
- package/FloatingActionButton/FloatingActionButton.d.ts +6 -4
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +41 -45
- package/ListButton/ButtonItem.d.ts +6 -0
- package/ListButton/ButtonItem.js +1 -1
- package/ListButton/ButtonItem.mjs +14 -9
- package/ListButton/DropDownButton.d.ts +1 -4
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +102 -106
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +49 -47
- package/ListButton/messages/index.d.ts +17 -0
- package/dist/cdn/js/kendo-vue-buttons.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
- package/toolbar/Toolbar.d.ts +2 -2
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +2 -2
package/Chip/Chip.d.ts
CHANGED
|
@@ -171,6 +171,10 @@ export interface ChipProps {
|
|
|
171
171
|
* For example these elements could contain error or hint message.
|
|
172
172
|
*/
|
|
173
173
|
ariaDescribedBy?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Identifies the accessible name for the Chip component.
|
|
176
|
+
*/
|
|
177
|
+
ariaLabel?: string;
|
|
174
178
|
/**
|
|
175
179
|
* @hidden
|
|
176
180
|
*/
|
|
@@ -252,6 +256,7 @@ declare const Chip: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
252
256
|
default: string;
|
|
253
257
|
};
|
|
254
258
|
tabIndex: PropType<number>;
|
|
259
|
+
ariaLabel: PropType<string>;
|
|
255
260
|
onMousedown: PropType<(event: any) => void>;
|
|
256
261
|
}>, {
|
|
257
262
|
chipRef: import('vue').Ref<any, any>;
|
|
@@ -330,6 +335,7 @@ declare const Chip: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
330
335
|
default: string;
|
|
331
336
|
};
|
|
332
337
|
tabIndex: PropType<number>;
|
|
338
|
+
ariaLabel: PropType<string>;
|
|
333
339
|
onMousedown: PropType<(event: any) => void>;
|
|
334
340
|
}>> & Readonly<{
|
|
335
341
|
onClick?: (event: ChipMouseEvent) => any;
|
package/Chip/Chip.js
CHANGED
|
@@ -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 a=require("vue"),t=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),t=require("@progress/kendo-vue-common"),m=require("@progress/kendo-svg-icons"),o=require("./focus-reducer.js"),$=require("./data-reducer.js"),l=require("./selection-reducer.js"),S=require("../package-metadata.js"),b=a.defineComponent({name:"KendoVueChip",props:{id:String,text:String,avatar:{type:[String,Function,Object],default:function(){}},value:[String,Object],dir:{type:String,default:function(){return"ltr"}},removable:{type:Boolean,default:!1},removeIcon:{type:String,default:function(){return"x-circle"}},removeSvgIcon:{type:Object,default:function(){return m.xCircleIcon}},disabled:{type:Boolean,default:!1},icon:String,svgIcon:Object,selectedIcon:{type:String,default:function(){return"check"}},selectedSvgIcon:{type:Object,default:function(){return m.checkIcon}},size:String,rounded:String,fillMode:{type:String,validator:function(e){return["flat","outline","solid"].includes(e)}},themeColor:{type:String,validator:function(e){return["base","error","info","success","warning"].includes(e)}},dataItem:Object,selected:Boolean,ariaDescribedBy:String,role:{type:String,default:"button"},tabIndex:Number,ariaLabel:String,onMousedown:Function},emits:{click:e=>!0,keydown:e=>!0,blur:e=>!0,focus:e=>!0,remove:e=>!0},inject:{kendoSelection:{default:{value:null}},kendoFocused:{default:{value:null}},kendoDataItems:{default:null},handleDispatchDataItems:{default:t.noop},handleDispatchSelection:{default:t.noop},handleDispatchFocus:{default:t.noop}},created(){this.currentDir=void 0,t.validatePackage(S.packageMetadata)},mounted(){this.chip=t.getRef(this,"chip"),this.currentDir=this.$props.dir!==void 0?this.$props.dir==="rtl":this.$el&&getComputedStyle(this.$el).direction==="rtl"||!1},updated(){this.kendoFocused.value===this.$props.value&&this.$el&&this.$el.focus()},computed:{currentSelected(){return this.$props.selected||(Array.isArray(this.kendoSelection.value)?this.kendoSelection.value.some(e=>e===this.$props.value):this.kendoSelection.value===this.$props.value)},chipLabelClass(){return{"k-chip-label":!0}}},methods:{computedFocused(){return this.kendoFocused.value===this.$props.value},handleMouseDown(e){this.$emit("mousedown",e)},handleClick(e){this.handleDispatchSelection&&this.handleDispatchSelection({type:l.SELECTION_ACTION.toggle,payload:this.$props.value,event:e}),this.$emit("click",{target:this.target,event:e})},handleRemove(e){e.stopPropagation(),this.$props.removable&&(this.handleDispatchFocus&&(this.handleDispatchDataItems({type:$.DATA_ACTION.remove,payload:this.$props.value,event:e}),this.handleDispatchFocus({type:o.FOCUS_ACTION.reset,payload:this.$props.value,event:e}),this.handleDispatchSelection({type:l.SELECTION_ACTION.remove,payload:this.$props.value,event:e})),this.$emit("remove",{target:this.target,event:e}))},handleKeyDown(e){switch(e.keyCode){case t.Keys.left:this.handleDispatchFocus&&this.handleDispatchFocus({type:o.FOCUS_ACTION.prev,payload:this.$props.value,event:e});break;case t.Keys.right:this.handleDispatchFocus&&this.handleDispatchFocus({type:o.FOCUS_ACTION.next,payload:this.$props.value,event:e});break;case t.Keys.enter:this.handleDispatchFocus&&this.handleDispatchSelection({type:l.SELECTION_ACTION.toggle,payload:this.$props.value,event:e});break;case t.Keys.delete:this.handleRemove(e);break}this.$emit("keydown",{target:this.target,event:e})},handleFocus(e){this.handleDispatchFocus&&this.handleDispatchFocus({payload:this.$props.value,type:o.FOCUS_ACTION.current,event:e}),this.$emit("focus",{target:this.target,event:e})},handleBlur(e){this.$emit("blur",{target:this.target,event:e})}},setup(){return{chipRef:a.ref(null)}},render(){const{size:e,rounded:n,themeColor:c,fillMode:r,look:s,avatar:i,icon:d,svgIcon:h,selectedIcon:u,selectedSvgIcon:p,removeIcon:f,removeSvgIcon:v}=this.$props,g=t.templateRendering.call(this,i,t.getListeners.call(this)),k=i?a.createVNode("div",{class:`k-chip-avatar k-avatar k-rounded-${i.rounded||"medium"} k-avatar-${t.kendoThemeMaps.sizeMap[e]||e} k-avatar-solid k-avatar-solid-primary`,style:i.style},[a.createVNode("span",{class:"k-avatar-image"},[a.createVNode("img",{src:i.imageUrl,alt:i.imageAlt},null)])]):null,y=t.getTemplate.call(this,{h:a.h,template:g});return a.createVNode("div",{role:this.$props.role,id:this.$props.value,ref:t.setRef(this,"chip"),dir:this.currentDir,tabindex:t.getTabIndex(this.$props.tabIndex,this.$props.disabled,void 0),class:t.classNames("k-chip",{"k-rtl":this.currentDir==="rtl","k-disabled":this.$props.disabled,"k-selected":this.currentSelected,"k-focus":this.computedFocused(),[`k-chip-${t.kendoThemeMaps.sizeMap[e]||e}`]:e,[`k-rounded-${t.kendoThemeMaps.roundedMap[n]||n}`]:n,[`k-chip-${r}`]:r,[`k-chip-${c}`]:c,"k-chip-outline":s==="outline"||s==="outlined","k-chip-solid":s==="solid"||s==="filled"||r==="solid"}),"aria-pressed":this.$props.role==="button"?this.currentSelected:void 0,"aria-selected":this.$props.role==="option"?this.currentSelected:void 0,"aria-disabled":this.$props.disabled||void 0,"aria-label":this.$props.ariaLabel,"aria-describedby":this.$props.ariaDescribedBy,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleClick,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown},[this.currentSelected&&(u||p)&&a.createVNode(t.Icon,{name:t.getIconName(u),icon:p,size:"small"},null),(d||h)&&a.createVNode(t.Icon,{name:t.getIconName(d),icon:h,size:"small",class:"k-chip-icon"},null),i?i.imageUrl?k:y:null,a.createVNode("span",{class:"k-chip-content"},[this.$props.text&&a.createVNode("span",{class:this.chipLabelClass},[this.$props.text])]),this.$props.removable&&a.createVNode("span",{class:"k-chip-actions"},[a.createVNode("span",{class:"k-chip-action k-chip-remove-action"},[a.createVNode(t.Icon,{name:t.getIconName(f),icon:v,size:"small",onClick:this.handleRemove},null)])])])}});exports.Chip=b;
|
package/Chip/Chip.mjs
CHANGED
|
@@ -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 { noop as
|
|
10
|
-
import { checkIcon as
|
|
11
|
-
import { FOCUS_ACTION as
|
|
12
|
-
import { DATA_ACTION as
|
|
13
|
-
import { SELECTION_ACTION as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
const
|
|
8
|
+
import { defineComponent as D, createVNode as t, h as I, ref as F } from "vue";
|
|
9
|
+
import { noop as r, templateRendering as C, getListeners as w, kendoThemeMaps as c, getTemplate as x, classNames as M, getTabIndex as O, setRef as R, Icon as d, getIconName as h, Keys as s, getRef as T, validatePackage as A } from "@progress/kendo-vue-common";
|
|
10
|
+
import { checkIcon as B, xCircleIcon as N } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { FOCUS_ACTION as o } from "./focus-reducer.mjs";
|
|
12
|
+
import { DATA_ACTION as j } from "./data-reducer.mjs";
|
|
13
|
+
import { SELECTION_ACTION as p } from "./selection-reducer.mjs";
|
|
14
|
+
import { packageMetadata as z } from "../package-metadata.mjs";
|
|
15
|
+
const q = /* @__PURE__ */ D({
|
|
16
16
|
name: "KendoVueChip",
|
|
17
17
|
props: {
|
|
18
18
|
id: String,
|
|
@@ -42,7 +42,7 @@ const V = /* @__PURE__ */ S({
|
|
|
42
42
|
removeSvgIcon: {
|
|
43
43
|
type: Object,
|
|
44
44
|
default: function() {
|
|
45
|
-
return
|
|
45
|
+
return N;
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
disabled: {
|
|
@@ -60,7 +60,7 @@ const V = /* @__PURE__ */ S({
|
|
|
60
60
|
selectedSvgIcon: {
|
|
61
61
|
type: Object,
|
|
62
62
|
default: function() {
|
|
63
|
-
return
|
|
63
|
+
return B;
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
size: String,
|
|
@@ -85,6 +85,7 @@ const V = /* @__PURE__ */ S({
|
|
|
85
85
|
default: "button"
|
|
86
86
|
},
|
|
87
87
|
tabIndex: Number,
|
|
88
|
+
ariaLabel: String,
|
|
88
89
|
onMousedown: Function
|
|
89
90
|
},
|
|
90
91
|
emits: {
|
|
@@ -109,20 +110,20 @@ const V = /* @__PURE__ */ S({
|
|
|
109
110
|
default: null
|
|
110
111
|
},
|
|
111
112
|
handleDispatchDataItems: {
|
|
112
|
-
default:
|
|
113
|
+
default: r
|
|
113
114
|
},
|
|
114
115
|
handleDispatchSelection: {
|
|
115
|
-
default:
|
|
116
|
+
default: r
|
|
116
117
|
},
|
|
117
118
|
handleDispatchFocus: {
|
|
118
|
-
default:
|
|
119
|
+
default: r
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
122
|
created() {
|
|
122
|
-
this.currentDir = void 0,
|
|
123
|
+
this.currentDir = void 0, A(z);
|
|
123
124
|
},
|
|
124
125
|
mounted() {
|
|
125
|
-
this.chip =
|
|
126
|
+
this.chip = T(this, "chip"), this.currentDir = this.$props.dir !== void 0 ? this.$props.dir === "rtl" : this.$el && getComputedStyle(this.$el).direction === "rtl" || !1;
|
|
126
127
|
},
|
|
127
128
|
updated() {
|
|
128
129
|
this.kendoFocused.value === this.$props.value && this.$el && this.$el.focus();
|
|
@@ -146,7 +147,7 @@ const V = /* @__PURE__ */ S({
|
|
|
146
147
|
},
|
|
147
148
|
handleClick(e) {
|
|
148
149
|
this.handleDispatchSelection && this.handleDispatchSelection({
|
|
149
|
-
type:
|
|
150
|
+
type: p.toggle,
|
|
150
151
|
payload: this.$props.value,
|
|
151
152
|
event: e
|
|
152
153
|
}), this.$emit("click", {
|
|
@@ -156,15 +157,15 @@ const V = /* @__PURE__ */ S({
|
|
|
156
157
|
},
|
|
157
158
|
handleRemove(e) {
|
|
158
159
|
e.stopPropagation(), this.$props.removable && (this.handleDispatchFocus && (this.handleDispatchDataItems({
|
|
159
|
-
type:
|
|
160
|
+
type: j.remove,
|
|
160
161
|
payload: this.$props.value,
|
|
161
162
|
event: e
|
|
162
163
|
}), this.handleDispatchFocus({
|
|
163
|
-
type:
|
|
164
|
+
type: o.reset,
|
|
164
165
|
payload: this.$props.value,
|
|
165
166
|
event: e
|
|
166
167
|
}), this.handleDispatchSelection({
|
|
167
|
-
type:
|
|
168
|
+
type: p.remove,
|
|
168
169
|
payload: this.$props.value,
|
|
169
170
|
event: e
|
|
170
171
|
})), this.$emit("remove", {
|
|
@@ -174,28 +175,28 @@ const V = /* @__PURE__ */ S({
|
|
|
174
175
|
},
|
|
175
176
|
handleKeyDown(e) {
|
|
176
177
|
switch (e.keyCode) {
|
|
177
|
-
case
|
|
178
|
+
case s.left:
|
|
178
179
|
this.handleDispatchFocus && this.handleDispatchFocus({
|
|
179
|
-
type:
|
|
180
|
+
type: o.prev,
|
|
180
181
|
payload: this.$props.value,
|
|
181
182
|
event: e
|
|
182
183
|
});
|
|
183
184
|
break;
|
|
184
|
-
case
|
|
185
|
+
case s.right:
|
|
185
186
|
this.handleDispatchFocus && this.handleDispatchFocus({
|
|
186
|
-
type:
|
|
187
|
+
type: o.next,
|
|
187
188
|
payload: this.$props.value,
|
|
188
189
|
event: e
|
|
189
190
|
});
|
|
190
191
|
break;
|
|
191
|
-
case
|
|
192
|
+
case s.enter:
|
|
192
193
|
this.handleDispatchFocus && this.handleDispatchSelection({
|
|
193
|
-
type:
|
|
194
|
+
type: p.toggle,
|
|
194
195
|
payload: this.$props.value,
|
|
195
196
|
event: e
|
|
196
197
|
});
|
|
197
198
|
break;
|
|
198
|
-
case
|
|
199
|
+
case s.delete:
|
|
199
200
|
this.handleRemove(e);
|
|
200
201
|
break;
|
|
201
202
|
}
|
|
@@ -207,7 +208,7 @@ const V = /* @__PURE__ */ S({
|
|
|
207
208
|
handleFocus(e) {
|
|
208
209
|
this.handleDispatchFocus && this.handleDispatchFocus({
|
|
209
210
|
payload: this.$props.value,
|
|
210
|
-
type:
|
|
211
|
+
type: o.current,
|
|
211
212
|
event: e
|
|
212
213
|
}), this.$emit("focus", {
|
|
213
214
|
target: this.target,
|
|
@@ -223,84 +224,88 @@ const V = /* @__PURE__ */ S({
|
|
|
223
224
|
},
|
|
224
225
|
setup() {
|
|
225
226
|
return {
|
|
226
|
-
chipRef:
|
|
227
|
+
chipRef: F(null)
|
|
227
228
|
};
|
|
228
229
|
},
|
|
229
230
|
render() {
|
|
230
231
|
const {
|
|
231
232
|
size: e,
|
|
232
|
-
rounded:
|
|
233
|
-
themeColor:
|
|
234
|
-
fillMode:
|
|
233
|
+
rounded: l,
|
|
234
|
+
themeColor: u,
|
|
235
|
+
fillMode: n,
|
|
236
|
+
look: a,
|
|
235
237
|
avatar: i,
|
|
236
|
-
icon:
|
|
237
|
-
svgIcon:
|
|
238
|
-
selectedIcon:
|
|
239
|
-
selectedSvgIcon:
|
|
240
|
-
removeIcon:
|
|
241
|
-
removeSvgIcon:
|
|
242
|
-
} = this.$props,
|
|
243
|
-
class: `k-chip-avatar k-avatar k-rounded-${i.rounded || "medium"} k-avatar-${
|
|
238
|
+
icon: m,
|
|
239
|
+
svgIcon: f,
|
|
240
|
+
selectedIcon: v,
|
|
241
|
+
selectedSvgIcon: g,
|
|
242
|
+
removeIcon: k,
|
|
243
|
+
removeSvgIcon: $
|
|
244
|
+
} = this.$props, y = C.call(this, i, w.call(this)), b = i ? t("div", {
|
|
245
|
+
class: `k-chip-avatar k-avatar k-rounded-${i.rounded || "medium"} k-avatar-${c.sizeMap[e] || e} k-avatar-solid k-avatar-solid-primary`,
|
|
244
246
|
style: i.style
|
|
245
247
|
}, [t("span", {
|
|
246
248
|
class: "k-avatar-image"
|
|
247
249
|
}, [t("img", {
|
|
248
250
|
src: i.imageUrl,
|
|
249
251
|
alt: i.imageAlt
|
|
250
|
-
}, null)])]) : null,
|
|
251
|
-
h:
|
|
252
|
-
template:
|
|
252
|
+
}, null)])]) : null, S = x.call(this, {
|
|
253
|
+
h: I,
|
|
254
|
+
template: y
|
|
253
255
|
});
|
|
254
256
|
return t("div", {
|
|
255
257
|
role: this.$props.role,
|
|
256
258
|
id: this.$props.value,
|
|
257
|
-
ref:
|
|
259
|
+
ref: R(this, "chip"),
|
|
258
260
|
dir: this.currentDir,
|
|
259
|
-
tabindex:
|
|
260
|
-
class:
|
|
261
|
+
tabindex: O(this.$props.tabIndex, this.$props.disabled, void 0),
|
|
262
|
+
class: M("k-chip", {
|
|
261
263
|
"k-rtl": this.currentDir === "rtl",
|
|
262
264
|
"k-disabled": this.$props.disabled,
|
|
263
265
|
"k-selected": this.currentSelected,
|
|
264
266
|
"k-focus": this.computedFocused(),
|
|
265
|
-
[`k-chip-${
|
|
266
|
-
[`k-rounded-${
|
|
267
|
-
[`k-chip-${
|
|
268
|
-
[`k-chip-${
|
|
267
|
+
[`k-chip-${c.sizeMap[e] || e}`]: e,
|
|
268
|
+
[`k-rounded-${c.roundedMap[l] || l}`]: l,
|
|
269
|
+
[`k-chip-${n}`]: n,
|
|
270
|
+
[`k-chip-${u}`]: u,
|
|
271
|
+
"k-chip-outline": a === "outline" || a === "outlined",
|
|
272
|
+
"k-chip-solid": a === "solid" || a === "filled" || n === "solid"
|
|
269
273
|
}),
|
|
270
274
|
"aria-pressed": this.$props.role === "button" ? this.currentSelected : void 0,
|
|
271
275
|
"aria-selected": this.$props.role === "option" ? this.currentSelected : void 0,
|
|
272
|
-
"aria-disabled": this.$props.disabled,
|
|
276
|
+
"aria-disabled": this.$props.disabled || void 0,
|
|
277
|
+
"aria-label": this.$props.ariaLabel,
|
|
273
278
|
"aria-describedby": this.$props.ariaDescribedBy,
|
|
274
279
|
onFocus: this.handleFocus,
|
|
275
280
|
onBlur: this.handleBlur,
|
|
276
281
|
onClick: this.handleClick,
|
|
277
282
|
onKeydown: this.handleKeyDown,
|
|
278
283
|
onMousedown: this.handleMouseDown
|
|
279
|
-
}, [this.currentSelected && (
|
|
280
|
-
name:
|
|
281
|
-
icon:
|
|
284
|
+
}, [this.currentSelected && (v || g) && t(d, {
|
|
285
|
+
name: h(v),
|
|
286
|
+
icon: g,
|
|
282
287
|
size: "small"
|
|
283
|
-
}, null), (
|
|
284
|
-
name:
|
|
285
|
-
icon:
|
|
286
|
-
size: "small"
|
|
287
|
-
|
|
288
|
+
}, null), (m || f) && t(d, {
|
|
289
|
+
name: h(m),
|
|
290
|
+
icon: f,
|
|
291
|
+
size: "small",
|
|
292
|
+
class: "k-chip-icon"
|
|
293
|
+
}, null), i ? i.imageUrl ? b : S : null, t("span", {
|
|
288
294
|
class: "k-chip-content"
|
|
289
295
|
}, [this.$props.text && t("span", {
|
|
290
|
-
"aria-label": this.$props.text,
|
|
291
296
|
class: this.chipLabelClass
|
|
292
297
|
}, [this.$props.text])]), this.$props.removable && t("span", {
|
|
293
298
|
class: "k-chip-actions"
|
|
294
299
|
}, [t("span", {
|
|
295
300
|
class: "k-chip-action k-chip-remove-action"
|
|
296
|
-
}, [t(
|
|
297
|
-
name:
|
|
298
|
-
icon:
|
|
301
|
+
}, [t(d, {
|
|
302
|
+
name: h(k),
|
|
303
|
+
icon: $,
|
|
299
304
|
size: "small",
|
|
300
305
|
onClick: this.handleRemove
|
|
301
306
|
}, null)])])]);
|
|
302
307
|
}
|
|
303
308
|
});
|
|
304
309
|
export {
|
|
305
|
-
|
|
310
|
+
q as Chip
|
|
306
311
|
};
|
|
@@ -40,7 +40,7 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
40
40
|
};
|
|
41
41
|
positionMode: {
|
|
42
42
|
type: PropType<FloatingActionButtonPositionMode>;
|
|
43
|
-
default:
|
|
43
|
+
default: any;
|
|
44
44
|
};
|
|
45
45
|
popupSettings: {
|
|
46
46
|
type: PropType<import('..').FloatingActionButtonPopupSettings>;
|
|
@@ -68,9 +68,11 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
68
68
|
'k-fab': boolean;
|
|
69
69
|
'k-disabled': any;
|
|
70
70
|
'k-focus': any;
|
|
71
|
+
'k-pos-absolute': boolean;
|
|
72
|
+
'k-pos-fixed': boolean;
|
|
71
73
|
};
|
|
72
74
|
computedOpened(): any;
|
|
73
|
-
rootClassNames():
|
|
75
|
+
rootClassNames(): any;
|
|
74
76
|
}, {
|
|
75
77
|
dispatchPopupEvent(dispatchedEvent: any, isOpen?: boolean): void;
|
|
76
78
|
handleClick(event: any): void;
|
|
@@ -118,7 +120,7 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
118
120
|
};
|
|
119
121
|
positionMode: {
|
|
120
122
|
type: PropType<FloatingActionButtonPositionMode>;
|
|
121
|
-
default:
|
|
123
|
+
default: any;
|
|
122
124
|
};
|
|
123
125
|
popupSettings: {
|
|
124
126
|
type: PropType<import('..').FloatingActionButtonPopupSettings>;
|
|
@@ -143,9 +145,9 @@ declare const FloatingActionButton: import('vue').DefineComponent<import('vue').
|
|
|
143
145
|
onItemclick?: (event: FloatingActionButtonItemEvent) => any;
|
|
144
146
|
}>, {
|
|
145
147
|
disabled: boolean;
|
|
148
|
+
positionMode: FloatingActionButtonPositionMode;
|
|
146
149
|
opened: boolean;
|
|
147
150
|
align: FloatingActionButtonAlign;
|
|
148
|
-
positionMode: FloatingActionButtonPositionMode;
|
|
149
151
|
popupSettings: import('..').FloatingActionButtonPopupSettings;
|
|
150
152
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
151
153
|
export { FloatingActionButton };
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),s=require("@progress/kendo-vue-common"),I=require("./FloatingActionButtonItem.js"),y=require("../package-metadata.js"),u=require("./utils.js"),x=require("@progress/kendo-vue-popup"),v=o.defineComponent({name:"KendoVueFloatingActionButton",props:{id:String,dir:String,tabIndex:Number,accessKey:String,disabled:{type:Boolean,default:!1},icon:String,svgIcon:Object,iconClass:String,items:[Object,Array],item:[String,Function,Object],text:String,alignOffset:Object,opened:{type:Boolean,default:void 0},align:{type:Object,default:function(){return{vertical:"bottom",horizontal:"end"}}},positionMode:{type:String,default:void 0},popupSettings:{type:Object,default:function(){return{}}},rounded:String,fillMode:{type:String,validator:function(e){return["flat","link","outline","solid"].includes(e)}},size:String,themeColor:String},emits:{click:e=>!0,mousedown:e=>!0,mouseup:e=>!0,open:e=>!0,close:e=>!0,itemclick:e=>!0,focus:e=>!0,blur:e=>!0,keydown:e=>!0},data(){return{currentOpened:!1,currentFocused:!1,focusedIndex:-1,currentDir:"ltr",isRtl:!1}},created(){s.validatePackage(y.packageMetadata),this.element=void 0,this._anchor=s.guid(),this.listId=s.guid(),this.buttonId=s.guid()},mounted(){this.element=this.kendoAnchorRef,this.list=s.getRef(this,"list"),this.popup=s.getRef(this,"popup"),this.currentDir=this.$props.dir!==void 0?this.$props.dir:this.$el&&getComputedStyle(this.$el).direction==="rtl"||!1,this.isRtl=this.currentDir==="rtl",this.opened!==void 0&&u.position(this.$el,this.$props.align,this.$props.alignOffset,this.isRtl)},updated(){u.position(this.$el,this.$props.align,this.$props.alignOffset,this.isRtl),this.currentFocused&&this.element&&this.element.focus()},computed:{buttonClassNames(){const{size:e,themeColor:t,fillMode:n,rounded:i,positionMode:d}=this.$props;return{"k-fab":!0,[`k-fab-${s.kendoThemeMaps.sizeMap[e]||e}`]:e,[`k-rounded-${s.kendoThemeMaps.roundedMap[i]||i}`]:i,[`k-fab-${n}`]:n,[`k-fab-${t}`]:t,"k-disabled":this.$props.disabled,"k-focus":this.currentFocused,"k-pos-absolute":d==="absolute","k-pos-fixed":d==="fixed",[`k-${this.$props.align.vertical}-${this.$props.align.horizontal}`]:!!d}},computedOpened(){return this.$props.opened===void 0?this.currentOpened:this.$props.opened},rootClassNames(){}},methods:{dispatchPopupEvent(e,t){this.$props.items&&this.$emit(t?"open":"close",{event:e,isOpened:!t})},handleClick(e){if(!(!e.target||this.$props.disabled))if(!this.$props.items)this.$emit("click",e,void 0);else{const t=!this.computedOpened;this.currentOpened=t,this.currentFocused=!0,this.focusedIndex=t?0:-1,this.dispatchPopupEvent(e,!this.computedOpened)}},handleFocus(e){this.currentFocused=!0,this.focusedIndex=this.computedOpened?0:-1,this.$emit("focus",{event:e})},handleBlur(e){this.currentFocused=!1,this.currentOpened=!1,this.focusedIndex=-1,this.$emit("blur",{event:e}),this.computedOpened&&this.dispatchPopupEvent(e,!1)},handleMouseDown(e){e.preventDefault(),this.$emit("mousedown",e)},handleMouseUp(e){this.$emit("mouseup",e)},dispatchItemClickEvent(e,t){this.$props.items&&(this.$props.items[t].disabled||this.$emit("itemclick",e,{itemProps:this.$props.items[t],itemIndex:t}))},handleItemClick(e,t){!e.target||!this.$props.items||(this.focusedIndex=t,this.currentOpened=!1,this.dispatchItemClickEvent(e,t),this.dispatchPopupEvent(e,!1))},handleItemDown(e){s.canUseDOM&&document.activeElement===this.element&&e.preventDefault()},handleKeyDown(e){const t=this.focusedIndex,n=this.$props.items?this.$props.items.length-1:-1,i=this.$props.align.vertical==="bottom";switch(e.keyCode){case s.Keys.enter:case s.Keys.space:t>=0&&this.dispatchItemClickEvent(e,t),e.preventDefault(),this.currentOpened=!this.currentOpened,this.focusedIndex=this.currentOpened?-1:0;break;case s.Keys.esc:e.preventDefault(),this.currentOpened=!1,this.focusedIndex=-1;break;case s.Keys.home:e.preventDefault(),this.focusedIndex=0;break;case s.Keys.end:e.preventDefault(),this.focusedIndex=n;break;case s.Keys.down:case s.Keys.right:e.preventDefault(),t<n&&!i&&(this.focusedIndex=t+1),t>0&&i&&(this.focusedIndex=t-1);break;case s.Keys.up:case s.Keys.left:e.preventDefault(),t>0&&!i&&(this.focusedIndex=t-1),t<n&&i&&(this.focusedIndex=t+1);break}this.$emit("keydown",e,void 0)}},setup(){const e=o.ref(null),t=o.ref(null);return{chipRef:e,kendoAnchorRef:t}},render(){const{align:e,disabled:t,icon:n,svgIcon:i,iconClass:d,id:h,items:r,text:c,tabIndex:g,accessKey:b,popupSettings:l}=this.$props,k=s.templateRendering.call(this,this.$props.item,s.getListeners.call(this)),$=function(){return r&&r.map(function(a,p){return o.createVNode(I.FloatingActionButtonItem,{key:p,index:p,id:`${this.listId}-${p}`,disabled:t||a.disabled,focused:this.focusedIndex===p,dataItem:a,item:k,class:s.classNames(a.className,u.getTextDirectionClass(this.currentDir||"ltr",e.horizontal)),onClick:this.handleItemClick,onDown:this.handleItemDown},null)},this)},f=n&&!c,m=(this.element?this.element.offsetWidth:0)/2-32/2;return o.createVNode("div",{class:this.rootClassNames},[o.createVNode("button",{ref:a=>{this.kendoAnchorRef=a},id:h||this.buttonId,role:r?"menubutton":void 0,type:"button","aria-disabled":t||void 0,"aria-expanded":r?this.computedOpened:void 0,"aria-haspopup":r?!0:void 0,"aria-label":!c&&(n||i||d)?"Action":void 0,"aria-owns":r?this.listId:void 0,"aria-activedescendant":this.focusedIndex>=0&&r?`${this.listId}-${this.focusedIndex}`:void 0,tabindex:s.getTabIndex(g,t),accesskey:b,dir:this.currentDir,disabled:t,class:this.buttonClassNames,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseup:this.handleMouseUp,onFocusin:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown},[n||i?o.createVNode(s.Icon,{name:n,icon:i,class:"k-fab-icon"},null):d?o.createVNode(s.Icon,{class:d},null):null,c&&o.createVNode("span",{class:"k-fab-text"},[c])]),o.createVNode(x.Popup,{ref:s.setRef(this,"popup"),show:this.computedOpened,anchor:this._anchor,animate:l.animate,popupClass:s.classNames("k-popup-transparent k-fab-popup",l.popupClass),anchorAlign:l.anchorAlign||u.getAnchorAlign(e,this.isRtl),popupAlign:l.popupAlign||u.getPopupAlign(e,this.isRtl),style:{boxShadow:"none"}},{default:()=>[o.createVNode("ul",{ref:s.setRef(this,"list"),role:"menu","aria-labelledby":h,id:this.listId,class:s.classNames("k-fab-items",{"k-fab-items-bottom":e.vertical!=="bottom","k-fab-items-top":e.vertical==="bottom"}),style:{paddingLeft:f?m+"px":void 0,paddingRight:f?m+"px":void 0}},[$.call(this)])]})])}});exports.FloatingActionButton=v;
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as w, createVNode as o, ref as g } from "vue";
|
|
9
|
-
import { templateRendering as
|
|
10
|
-
import { FloatingActionButtonItem as
|
|
11
|
-
import { packageMetadata as
|
|
9
|
+
import { templateRendering as A, getListeners as S, getTabIndex as M, Icon as k, classNames as c, setRef as $, Keys as n, canUseDOM as F, kendoThemeMaps as I, getRef as x, validatePackage as R, guid as h } from "@progress/kendo-vue-common";
|
|
10
|
+
import { FloatingActionButtonItem as E } from "./FloatingActionButtonItem.mjs";
|
|
11
|
+
import { packageMetadata as B } from "../package-metadata.mjs";
|
|
12
12
|
import { getPopupAlign as N, getAnchorAlign as P, position as O, getTextDirectionClass as K } from "./utils.mjs";
|
|
13
13
|
import { Popup as j } from "@progress/kendo-vue-popup";
|
|
14
14
|
const G = /* @__PURE__ */ w({
|
|
@@ -44,9 +44,7 @@ const G = /* @__PURE__ */ w({
|
|
|
44
44
|
},
|
|
45
45
|
positionMode: {
|
|
46
46
|
type: String,
|
|
47
|
-
default:
|
|
48
|
-
return "fixed";
|
|
49
|
-
}
|
|
47
|
+
default: void 0
|
|
50
48
|
},
|
|
51
49
|
popupSettings: {
|
|
52
50
|
type: Object,
|
|
@@ -85,7 +83,7 @@ const G = /* @__PURE__ */ w({
|
|
|
85
83
|
};
|
|
86
84
|
},
|
|
87
85
|
created() {
|
|
88
|
-
R(
|
|
86
|
+
R(B), this.element = void 0, this._anchor = h(), this.listId = h(), this.buttonId = h();
|
|
89
87
|
},
|
|
90
88
|
mounted() {
|
|
91
89
|
this.element = this.kendoAnchorRef, this.list = x(this, "list"), this.popup = x(this, "popup"), this.currentDir = this.$props.dir !== void 0 ? this.$props.dir : this.$el && getComputedStyle(this.$el).direction === "rtl" || !1, this.isRtl = this.currentDir === "rtl", this.opened !== void 0 && O(this.$el, this.$props.align, this.$props.alignOffset, this.isRtl);
|
|
@@ -99,7 +97,8 @@ const G = /* @__PURE__ */ w({
|
|
|
99
97
|
size: e,
|
|
100
98
|
themeColor: t,
|
|
101
99
|
fillMode: i,
|
|
102
|
-
rounded: s
|
|
100
|
+
rounded: s,
|
|
101
|
+
positionMode: d
|
|
103
102
|
} = this.$props;
|
|
104
103
|
return {
|
|
105
104
|
"k-fab": !0,
|
|
@@ -109,17 +108,15 @@ const G = /* @__PURE__ */ w({
|
|
|
109
108
|
[`k-fab-${t}`]: t,
|
|
110
109
|
"k-disabled": this.$props.disabled,
|
|
111
110
|
"k-focus": this.currentFocused,
|
|
112
|
-
|
|
111
|
+
"k-pos-absolute": d === "absolute",
|
|
112
|
+
"k-pos-fixed": d === "fixed",
|
|
113
|
+
[`k-${this.$props.align.vertical}-${this.$props.align.horizontal}`]: !!d
|
|
113
114
|
};
|
|
114
115
|
},
|
|
115
116
|
computedOpened() {
|
|
116
117
|
return this.$props.opened === void 0 ? this.currentOpened : this.$props.opened;
|
|
117
118
|
},
|
|
118
119
|
rootClassNames() {
|
|
119
|
-
return p({
|
|
120
|
-
"k-pos-absolute": this.$props.positionMode === "absolute",
|
|
121
|
-
"k-pos-fixed": this.$props.positionMode === "fixed"
|
|
122
|
-
});
|
|
123
120
|
}
|
|
124
121
|
},
|
|
125
122
|
methods: {
|
|
@@ -135,7 +132,7 @@ const G = /* @__PURE__ */ w({
|
|
|
135
132
|
this.$emit("click", e, void 0);
|
|
136
133
|
else {
|
|
137
134
|
const t = !this.computedOpened;
|
|
138
|
-
this.currentOpened = t, this.currentFocused = !0, this.focusedIndex = t ? 0 : -1, this.dispatchPopupEvent(e,
|
|
135
|
+
this.currentOpened = t, this.currentFocused = !0, this.focusedIndex = t ? 0 : -1, this.dispatchPopupEvent(e, !this.computedOpened);
|
|
139
136
|
}
|
|
140
137
|
},
|
|
141
138
|
handleFocus(e) {
|
|
@@ -144,10 +141,9 @@ const G = /* @__PURE__ */ w({
|
|
|
144
141
|
});
|
|
145
142
|
},
|
|
146
143
|
handleBlur(e) {
|
|
147
|
-
const t = this.computedOpened;
|
|
148
144
|
this.currentFocused = !1, this.currentOpened = !1, this.focusedIndex = -1, this.$emit("blur", {
|
|
149
145
|
event: e
|
|
150
|
-
}),
|
|
146
|
+
}), this.computedOpened && this.dispatchPopupEvent(e, !1);
|
|
151
147
|
},
|
|
152
148
|
handleMouseDown(e) {
|
|
153
149
|
e.preventDefault(), this.$emit("mousedown", e);
|
|
@@ -208,45 +204,45 @@ const G = /* @__PURE__ */ w({
|
|
|
208
204
|
disabled: t,
|
|
209
205
|
icon: i,
|
|
210
206
|
svgIcon: s,
|
|
211
|
-
iconClass:
|
|
207
|
+
iconClass: d,
|
|
212
208
|
id: f,
|
|
213
209
|
items: r,
|
|
214
|
-
text:
|
|
210
|
+
text: u,
|
|
215
211
|
tabIndex: v,
|
|
216
212
|
accessKey: C,
|
|
217
213
|
popupSettings: l
|
|
218
|
-
} = this.$props, y =
|
|
219
|
-
return r && r.map(function(
|
|
220
|
-
return o(
|
|
221
|
-
key:
|
|
222
|
-
index:
|
|
223
|
-
id: `${this.listId}-${
|
|
224
|
-
disabled: t ||
|
|
225
|
-
focused: this.focusedIndex ===
|
|
226
|
-
dataItem:
|
|
214
|
+
} = this.$props, y = A.call(this, this.$props.item, S.call(this)), D = function() {
|
|
215
|
+
return r && r.map(function(a, p) {
|
|
216
|
+
return o(E, {
|
|
217
|
+
key: p,
|
|
218
|
+
index: p,
|
|
219
|
+
id: `${this.listId}-${p}`,
|
|
220
|
+
disabled: t || a.disabled,
|
|
221
|
+
focused: this.focusedIndex === p,
|
|
222
|
+
dataItem: a,
|
|
227
223
|
item: y,
|
|
228
|
-
class:
|
|
224
|
+
class: c(a.className, K(this.currentDir || "ltr", e.horizontal)),
|
|
229
225
|
onClick: this.handleItemClick,
|
|
230
226
|
onDown: this.handleItemDown
|
|
231
227
|
}, null);
|
|
232
228
|
}, this);
|
|
233
|
-
}, m = i && !
|
|
229
|
+
}, m = i && !u, b = (this.element ? this.element.offsetWidth : 0) / 2 - 32 / 2;
|
|
234
230
|
return o("div", {
|
|
235
231
|
class: this.rootClassNames
|
|
236
232
|
}, [o("button", {
|
|
237
|
-
ref: (
|
|
238
|
-
this.kendoAnchorRef =
|
|
233
|
+
ref: (a) => {
|
|
234
|
+
this.kendoAnchorRef = a;
|
|
239
235
|
},
|
|
240
236
|
id: f || this.buttonId,
|
|
241
|
-
role: r ? "menubutton" :
|
|
237
|
+
role: r ? "menubutton" : void 0,
|
|
242
238
|
type: "button",
|
|
243
|
-
"aria-disabled": t,
|
|
239
|
+
"aria-disabled": t || void 0,
|
|
244
240
|
"aria-expanded": r ? this.computedOpened : void 0,
|
|
245
|
-
"aria-haspopup": r,
|
|
246
|
-
"aria-label":
|
|
241
|
+
"aria-haspopup": r ? !0 : void 0,
|
|
242
|
+
"aria-label": !u && (i || s || d) ? "Action" : void 0,
|
|
247
243
|
"aria-owns": r ? this.listId : void 0,
|
|
248
244
|
"aria-activedescendant": this.focusedIndex >= 0 && r ? `${this.listId}-${this.focusedIndex}` : void 0,
|
|
249
|
-
tabindex:
|
|
245
|
+
tabindex: M(v, t),
|
|
250
246
|
accesskey: C,
|
|
251
247
|
dir: this.currentDir,
|
|
252
248
|
disabled: t,
|
|
@@ -257,20 +253,20 @@ const G = /* @__PURE__ */ w({
|
|
|
257
253
|
onFocusin: this.handleFocus,
|
|
258
254
|
onBlur: this.handleBlur,
|
|
259
255
|
onKeydown: this.handleKeyDown
|
|
260
|
-
}, [i || s ? o(
|
|
256
|
+
}, [i || s ? o(k, {
|
|
261
257
|
name: i,
|
|
262
258
|
icon: s,
|
|
263
259
|
class: "k-fab-icon"
|
|
264
|
-
}, null) :
|
|
265
|
-
class:
|
|
266
|
-
}, null) : null,
|
|
260
|
+
}, null) : d ? o(k, {
|
|
261
|
+
class: d
|
|
262
|
+
}, null) : null, u && o("span", {
|
|
267
263
|
class: "k-fab-text"
|
|
268
|
-
}, [
|
|
269
|
-
ref:
|
|
264
|
+
}, [u])]), o(j, {
|
|
265
|
+
ref: $(this, "popup"),
|
|
270
266
|
show: this.computedOpened,
|
|
271
267
|
anchor: this._anchor,
|
|
272
268
|
animate: l.animate,
|
|
273
|
-
popupClass:
|
|
269
|
+
popupClass: c("k-popup-transparent k-fab-popup", l.popupClass),
|
|
274
270
|
anchorAlign: l.anchorAlign || P(e, this.isRtl),
|
|
275
271
|
popupAlign: l.popupAlign || N(e, this.isRtl),
|
|
276
272
|
style: {
|
|
@@ -278,11 +274,11 @@ const G = /* @__PURE__ */ w({
|
|
|
278
274
|
}
|
|
279
275
|
}, {
|
|
280
276
|
default: () => [o("ul", {
|
|
281
|
-
ref:
|
|
277
|
+
ref: $(this, "list"),
|
|
282
278
|
role: "menu",
|
|
283
279
|
"aria-labelledby": f,
|
|
284
280
|
id: this.listId,
|
|
285
|
-
class:
|
|
281
|
+
class: c("k-fab-items", {
|
|
286
282
|
"k-fab-items-bottom": e.vertical !== "bottom",
|
|
287
283
|
"k-fab-items-top": e.vertical === "bottom"
|
|
288
284
|
}),
|
|
@@ -19,6 +19,8 @@ export interface ButtonItemProps {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
textField?: string;
|
|
21
21
|
role?: string;
|
|
22
|
+
first?: boolean;
|
|
23
|
+
last?: boolean;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* @hidden
|
|
@@ -32,6 +34,8 @@ declare const ButtonItem: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
32
34
|
id: PropType<string>;
|
|
33
35
|
textField: PropType<string>;
|
|
34
36
|
role: PropType<string>;
|
|
37
|
+
first: PropType<boolean>;
|
|
38
|
+
last: PropType<boolean>;
|
|
35
39
|
}>, {}, {}, {
|
|
36
40
|
wrapperClass(): object;
|
|
37
41
|
innerClass(): object;
|
|
@@ -50,6 +54,8 @@ declare const ButtonItem: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
50
54
|
id: PropType<string>;
|
|
51
55
|
textField: PropType<string>;
|
|
52
56
|
role: PropType<string>;
|
|
57
|
+
first: PropType<boolean>;
|
|
58
|
+
last: PropType<boolean>;
|
|
53
59
|
}>> & Readonly<{
|
|
54
60
|
onClick?: (event: any, index: number) => any;
|
|
55
61
|
onDown?: (event: any, index: number) => any;
|
package/ListButton/ButtonItem.js
CHANGED
|
@@ -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 t=require("vue"),o=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("@progress/kendo-vue-common"),c=t.defineComponent({name:"KendoButtonItem",emits:{click:(e,n)=>!0,down:(e,n)=>!0},props:{focused:Boolean,index:Number,item:Object,render:[String,Object,Function],dataItem:[String,Object],id:String,textField:String,role:String,first:Boolean,last:Boolean},computed:{wrapperClass(){return{"k-item":!0,"k-menu-item":!0,"k-first":this.$props.first,"k-last":this.$props.last,"k-focus":this.$props.focused}},innerClass(){const{dataItem:e}=this.$props;return{"k-link k-menu-link":!0,"k-selected":e.selected,"k-disabled":e.disabled}}},methods:{onClick(e){this.$emit("click",e,this.$props.index)},onDown(e){this.$emit("down",e,this.$props.index)}},render(){const{dataItem:e,id:n,render:r}=this.$props,a=function(){const{textField:s,index:l}=this.$props,i=e.text!==void 0?e.text:s?e[s]:e,d=t.createVNode("span",{tabindex:-1,class:this.innerClass,key:"icon"},[e.icon||e.svgIcon?t.createVNode(o.Icon,{name:e.icon,icon:e.svgIcon,class:e.iconClass},null):e.iconClass&&t.createVNode("span",{class:e.iconClass,role:"presentation"},null),e.imageUrl&&t.createVNode("img",{class:"k-icon",alt:"",src:e.imageUrl,role:"presentation",key:"image"},null),i&&t.createVNode("span",{class:"k-menu-link-text"},[i])]);return o.getTemplate.call(this,{h:t.h,template:this.$props.dataItem.render||r,defaultRendering:d,additionalProps:{item:e,itemIndex:l,innerClass:this.innerClass,focused:this.focused}})};return t.createVNode("li",{id:n,class:this.wrapperClass,onClick:this.onClick,onMousedown:this.onDown,onPointerdown:this.onDown,role:"menuitem","aria-disabled":e.disabled||void 0},[a.call(this)])}});exports.ButtonItem=c;
|