@progress/kendo-vue-buttons 8.4.0-develop.3 → 8.4.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/Button.d.ts +8 -9
- package/Chip/Chip.d.ts +0 -6
- package/Chip/Chip.js +1 -1
- package/Chip/Chip.mjs +63 -68
- package/FloatingActionButton/FloatingActionButton.d.ts +3 -5
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +45 -41
- package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +2 -8
- package/FloatingActionButton/models/theme-color.d.ts +3 -9
- package/ListButton/ButtonItem.d.ts +0 -6
- package/ListButton/ButtonItem.js +1 -1
- package/ListButton/ButtonItem.mjs +9 -14
- package/ListButton/DropDownButton.d.ts +8 -5
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +105 -101
- package/ListButton/SplitButton.d.ts +4 -4
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +47 -49
- package/ListButton/models/ListButtonProps.d.ts +8 -8
- package/SegmentedControl/SegmentedControl.d.ts +2 -2
- package/SegmentedControl/interfaces/SegmentedControlTypes.d.ts +1 -0
- package/SmartPasteButton/SmartPasteButton.d.ts +6 -6
- package/SpeechToText/SpeechToTextButton.d.ts +4 -4
- package/SpeechToText/SpeechToTextButton.js +1 -1
- package/SpeechToText/SpeechToTextButton.mjs +16 -16
- 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 +11 -6
- package/toolbar/Toolbar.d.ts +2 -2
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +2 -2
- package/ListButton/messages/index.d.ts +0 -17
|
@@ -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 M, getListeners as S, getTabIndex as A, Icon as $, classNames as p, setRef as k, Keys as n, canUseDOM as F, kendoThemeMaps as I, getRef as x, validatePackage as R, guid as c } from "@progress/kendo-vue-common";
|
|
10
|
+
import { FloatingActionButtonItem as B } from "./FloatingActionButtonItem.mjs";
|
|
11
|
+
import { packageMetadata as E } 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,7 +44,9 @@ const G = /* @__PURE__ */ w({
|
|
|
44
44
|
},
|
|
45
45
|
positionMode: {
|
|
46
46
|
type: String,
|
|
47
|
-
default:
|
|
47
|
+
default: function() {
|
|
48
|
+
return "fixed";
|
|
49
|
+
}
|
|
48
50
|
},
|
|
49
51
|
popupSettings: {
|
|
50
52
|
type: Object,
|
|
@@ -83,7 +85,7 @@ const G = /* @__PURE__ */ w({
|
|
|
83
85
|
};
|
|
84
86
|
},
|
|
85
87
|
created() {
|
|
86
|
-
R(
|
|
88
|
+
R(E), this.element = void 0, this._anchor = c(), this.listId = c(), this.buttonId = c();
|
|
87
89
|
},
|
|
88
90
|
mounted() {
|
|
89
91
|
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);
|
|
@@ -97,8 +99,7 @@ const G = /* @__PURE__ */ w({
|
|
|
97
99
|
size: e,
|
|
98
100
|
themeColor: t,
|
|
99
101
|
fillMode: i,
|
|
100
|
-
rounded: s
|
|
101
|
-
positionMode: d
|
|
102
|
+
rounded: s
|
|
102
103
|
} = this.$props;
|
|
103
104
|
return {
|
|
104
105
|
"k-fab": !0,
|
|
@@ -108,15 +109,17 @@ const G = /* @__PURE__ */ w({
|
|
|
108
109
|
[`k-fab-${t}`]: t,
|
|
109
110
|
"k-disabled": this.$props.disabled,
|
|
110
111
|
"k-focus": this.currentFocused,
|
|
111
|
-
|
|
112
|
-
"k-pos-fixed": d === "fixed",
|
|
113
|
-
[`k-${this.$props.align.vertical}-${this.$props.align.horizontal}`]: !!d
|
|
112
|
+
[`k-${this.$props.align.vertical}-${this.$props.align.horizontal}`]: !0
|
|
114
113
|
};
|
|
115
114
|
},
|
|
116
115
|
computedOpened() {
|
|
117
116
|
return this.$props.opened === void 0 ? this.currentOpened : this.$props.opened;
|
|
118
117
|
},
|
|
119
118
|
rootClassNames() {
|
|
119
|
+
return p({
|
|
120
|
+
"k-pos-absolute": this.$props.positionMode === "absolute",
|
|
121
|
+
"k-pos-fixed": this.$props.positionMode === "fixed"
|
|
122
|
+
});
|
|
120
123
|
}
|
|
121
124
|
},
|
|
122
125
|
methods: {
|
|
@@ -132,7 +135,7 @@ const G = /* @__PURE__ */ w({
|
|
|
132
135
|
this.$emit("click", e, void 0);
|
|
133
136
|
else {
|
|
134
137
|
const t = !this.computedOpened;
|
|
135
|
-
this.currentOpened = t, this.currentFocused = !0, this.focusedIndex = t ? 0 : -1, this.dispatchPopupEvent(e,
|
|
138
|
+
this.currentOpened = t, this.currentFocused = !0, this.focusedIndex = t ? 0 : -1, this.dispatchPopupEvent(e, t);
|
|
136
139
|
}
|
|
137
140
|
},
|
|
138
141
|
handleFocus(e) {
|
|
@@ -141,9 +144,10 @@ const G = /* @__PURE__ */ w({
|
|
|
141
144
|
});
|
|
142
145
|
},
|
|
143
146
|
handleBlur(e) {
|
|
147
|
+
const t = this.computedOpened;
|
|
144
148
|
this.currentFocused = !1, this.currentOpened = !1, this.focusedIndex = -1, this.$emit("blur", {
|
|
145
149
|
event: e
|
|
146
|
-
}),
|
|
150
|
+
}), t && this.dispatchPopupEvent(e, !1);
|
|
147
151
|
},
|
|
148
152
|
handleMouseDown(e) {
|
|
149
153
|
e.preventDefault(), this.$emit("mousedown", e);
|
|
@@ -204,45 +208,45 @@ const G = /* @__PURE__ */ w({
|
|
|
204
208
|
disabled: t,
|
|
205
209
|
icon: i,
|
|
206
210
|
svgIcon: s,
|
|
207
|
-
iconClass:
|
|
211
|
+
iconClass: h,
|
|
208
212
|
id: f,
|
|
209
213
|
items: r,
|
|
210
|
-
text:
|
|
214
|
+
text: a,
|
|
211
215
|
tabIndex: v,
|
|
212
216
|
accessKey: C,
|
|
213
217
|
popupSettings: l
|
|
214
|
-
} = this.$props, y =
|
|
215
|
-
return r && r.map(function(
|
|
216
|
-
return o(
|
|
217
|
-
key:
|
|
218
|
-
index:
|
|
219
|
-
id: `${this.listId}-${
|
|
220
|
-
disabled: t ||
|
|
221
|
-
focused: this.focusedIndex ===
|
|
222
|
-
dataItem:
|
|
218
|
+
} = this.$props, y = M.call(this, this.$props.item, S.call(this)), D = function() {
|
|
219
|
+
return r && r.map(function(d, u) {
|
|
220
|
+
return o(B, {
|
|
221
|
+
key: u,
|
|
222
|
+
index: u,
|
|
223
|
+
id: `${this.listId}-${u}`,
|
|
224
|
+
disabled: t || d.disabled,
|
|
225
|
+
focused: this.focusedIndex === u,
|
|
226
|
+
dataItem: d,
|
|
223
227
|
item: y,
|
|
224
|
-
class:
|
|
228
|
+
class: p(d.className, K(this.currentDir || "ltr", e.horizontal)),
|
|
225
229
|
onClick: this.handleItemClick,
|
|
226
230
|
onDown: this.handleItemDown
|
|
227
231
|
}, null);
|
|
228
232
|
}, this);
|
|
229
|
-
}, m = i && !
|
|
233
|
+
}, m = i && !a, b = (this.element ? this.element.offsetWidth : 0) / 2 - 32 / 2;
|
|
230
234
|
return o("div", {
|
|
231
235
|
class: this.rootClassNames
|
|
232
236
|
}, [o("button", {
|
|
233
|
-
ref: (
|
|
234
|
-
this.kendoAnchorRef =
|
|
237
|
+
ref: (d) => {
|
|
238
|
+
this.kendoAnchorRef = d;
|
|
235
239
|
},
|
|
236
240
|
id: f || this.buttonId,
|
|
237
|
-
role: r ? "menubutton" :
|
|
241
|
+
role: r ? "menubutton" : "button",
|
|
238
242
|
type: "button",
|
|
239
|
-
"aria-disabled": t
|
|
243
|
+
"aria-disabled": t,
|
|
240
244
|
"aria-expanded": r ? this.computedOpened : void 0,
|
|
241
|
-
"aria-haspopup": r
|
|
242
|
-
"aria-label":
|
|
245
|
+
"aria-haspopup": r,
|
|
246
|
+
"aria-label": `${a || ""} floatingactionbutton`,
|
|
243
247
|
"aria-owns": r ? this.listId : void 0,
|
|
244
248
|
"aria-activedescendant": this.focusedIndex >= 0 && r ? `${this.listId}-${this.focusedIndex}` : void 0,
|
|
245
|
-
tabindex:
|
|
249
|
+
tabindex: A(v, t),
|
|
246
250
|
accesskey: C,
|
|
247
251
|
dir: this.currentDir,
|
|
248
252
|
disabled: t,
|
|
@@ -253,20 +257,20 @@ const G = /* @__PURE__ */ w({
|
|
|
253
257
|
onFocusin: this.handleFocus,
|
|
254
258
|
onBlur: this.handleBlur,
|
|
255
259
|
onKeydown: this.handleKeyDown
|
|
256
|
-
}, [i || s ? o(
|
|
260
|
+
}, [i || s ? o($, {
|
|
257
261
|
name: i,
|
|
258
262
|
icon: s,
|
|
259
263
|
class: "k-fab-icon"
|
|
260
|
-
}, null) :
|
|
261
|
-
class:
|
|
262
|
-
}, null) : null,
|
|
264
|
+
}, null) : h ? o($, {
|
|
265
|
+
class: h
|
|
266
|
+
}, null) : null, a && o("span", {
|
|
263
267
|
class: "k-fab-text"
|
|
264
|
-
}, [
|
|
265
|
-
ref:
|
|
268
|
+
}, [a])]), o(j, {
|
|
269
|
+
ref: k(this, "popup"),
|
|
266
270
|
show: this.computedOpened,
|
|
267
271
|
anchor: this._anchor,
|
|
268
272
|
animate: l.animate,
|
|
269
|
-
popupClass:
|
|
273
|
+
popupClass: p("k-popup-transparent k-fab-popup", l.popupClass),
|
|
270
274
|
anchorAlign: l.anchorAlign || P(e, this.isRtl),
|
|
271
275
|
popupAlign: l.popupAlign || N(e, this.isRtl),
|
|
272
276
|
style: {
|
|
@@ -274,11 +278,11 @@ const G = /* @__PURE__ */ w({
|
|
|
274
278
|
}
|
|
275
279
|
}, {
|
|
276
280
|
default: () => [o("ul", {
|
|
277
|
-
ref:
|
|
281
|
+
ref: k(this, "list"),
|
|
278
282
|
role: "menu",
|
|
279
283
|
"aria-labelledby": f,
|
|
280
284
|
id: this.listId,
|
|
281
|
-
class:
|
|
285
|
+
class: p("k-fab-items", {
|
|
282
286
|
"k-fab-items-bottom": e.vertical !== "bottom",
|
|
283
287
|
"k-fab-items-top": e.vertical === "bottom"
|
|
284
288
|
}),
|
|
@@ -154,16 +154,10 @@ export interface FloatingActionButtonProps extends Omit<any, 'onBlur' | 'onFocus
|
|
|
154
154
|
* [see example]({% slug appearance_floatingactionbutton %}).
|
|
155
155
|
*
|
|
156
156
|
* The possible values are:
|
|
157
|
-
|
|
157
|
+
* * `base` (Default)—Applies base coloring.
|
|
158
|
+
* * `primary`—Applies coloring based on the primary theme color.
|
|
158
159
|
* * `secondary`—Applies coloring based on the secondary theme color.
|
|
159
160
|
* * `tertiary`— Applies coloring based on the tertiary theme color.
|
|
160
|
-
* * `info`—Applies coloring based on the info theme color.
|
|
161
|
-
* * `success`— Applies coloring based on the success theme color.
|
|
162
|
-
* * `warning`— Applies coloring based on the warning theme color.
|
|
163
|
-
* * `error`— Applies coloring based on the error theme color.
|
|
164
|
-
* * `dark`— Applies coloring based on the dark theme color.
|
|
165
|
-
* * `light`— Applies coloring based on the light theme color.
|
|
166
|
-
* * `inverse`— Applies coloring based on the inverse theme color.
|
|
167
161
|
*
|
|
168
162
|
*/
|
|
169
163
|
themeColor?: FloatingActionButtonThemeColor;
|
|
@@ -9,16 +9,10 @@
|
|
|
9
9
|
* Specifies the theme color of the Floating Action Button..
|
|
10
10
|
*
|
|
11
11
|
* The possible values are:
|
|
12
|
-
* * `
|
|
12
|
+
* * `base` (Default)—Applies base coloring.
|
|
13
|
+
* * `primary`—Applies coloring based on the primary theme color.
|
|
13
14
|
* * `secondary`—Applies coloring based on the secondary theme color.
|
|
14
15
|
* * `tertiary`— Applies coloring based on the tertiary theme color.
|
|
15
|
-
* * `info`—Applies coloring based on the info theme color.
|
|
16
|
-
* * `success`— Applies coloring based on the success theme color.
|
|
17
|
-
* * `warning`— Applies coloring based on the warning theme color.
|
|
18
|
-
* * `error`— Applies coloring based on the error theme color.
|
|
19
|
-
* * `dark`— Applies coloring based on the dark theme color.
|
|
20
|
-
* * `light`— Applies coloring based on the light theme color.
|
|
21
|
-
* * `inverse`— Applies coloring based on the inverse theme color.
|
|
22
16
|
*
|
|
23
17
|
*/
|
|
24
|
-
export type FloatingActionButtonThemeColor = '
|
|
18
|
+
export type FloatingActionButtonThemeColor = 'base' | 'primary' | 'secondary' | 'tertiary';
|
|
@@ -19,8 +19,6 @@ export interface ButtonItemProps {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
textField?: string;
|
|
21
21
|
role?: string;
|
|
22
|
-
first?: boolean;
|
|
23
|
-
last?: boolean;
|
|
24
22
|
}
|
|
25
23
|
/**
|
|
26
24
|
* @hidden
|
|
@@ -34,8 +32,6 @@ declare const ButtonItem: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
34
32
|
id: PropType<string>;
|
|
35
33
|
textField: PropType<string>;
|
|
36
34
|
role: PropType<string>;
|
|
37
|
-
first: PropType<boolean>;
|
|
38
|
-
last: PropType<boolean>;
|
|
39
35
|
}>, {}, {}, {
|
|
40
36
|
wrapperClass(): object;
|
|
41
37
|
innerClass(): object;
|
|
@@ -54,8 +50,6 @@ declare const ButtonItem: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
54
50
|
id: PropType<string>;
|
|
55
51
|
textField: PropType<string>;
|
|
56
52
|
role: PropType<string>;
|
|
57
|
-
first: PropType<boolean>;
|
|
58
|
-
last: PropType<boolean>;
|
|
59
53
|
}>> & Readonly<{
|
|
60
54
|
onClick?: (event: any, index: number) => any;
|
|
61
55
|
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"),l=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},computed:{wrapperClass(){return{"k-item":!0,"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,d=function(){const{textField:i,index:a}=this.$props,s=e.text!==void 0?e.text:i?e[i]:e,c=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),s&&t.createVNode("span",{class:"k-menu-link-text"},[s])]);return o.getTemplate.call(this,{h:t.h,template:this.$props.dataItem.render||r,defaultRendering:c,additionalProps:{item:e,itemIndex:a,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},[d.call(this)])}});exports.ButtonItem=l;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
8
|
+
import { defineComponent as a, createVNode as t, h as c } from "vue";
|
|
9
9
|
import { Icon as m, getTemplate as p } from "@progress/kendo-vue-common";
|
|
10
|
-
const
|
|
10
|
+
const x = /* @__PURE__ */ a({
|
|
11
11
|
name: "KendoButtonItem",
|
|
12
12
|
emits: {
|
|
13
13
|
click: (e, n) => !0,
|
|
@@ -21,17 +21,12 @@ const f = /* @__PURE__ */ d({
|
|
|
21
21
|
dataItem: [String, Object],
|
|
22
22
|
id: String,
|
|
23
23
|
textField: String,
|
|
24
|
-
role: String
|
|
25
|
-
first: Boolean,
|
|
26
|
-
last: Boolean
|
|
24
|
+
role: String
|
|
27
25
|
},
|
|
28
26
|
computed: {
|
|
29
27
|
wrapperClass() {
|
|
30
28
|
return {
|
|
31
29
|
"k-item": !0,
|
|
32
|
-
"k-menu-item": !0,
|
|
33
|
-
"k-first": this.$props.first,
|
|
34
|
-
"k-last": this.$props.last,
|
|
35
30
|
"k-focus": this.$props.focused
|
|
36
31
|
};
|
|
37
32
|
},
|
|
@@ -61,9 +56,9 @@ const f = /* @__PURE__ */ d({
|
|
|
61
56
|
render: o
|
|
62
57
|
} = this.$props, r = function() {
|
|
63
58
|
const {
|
|
64
|
-
textField:
|
|
59
|
+
textField: i,
|
|
65
60
|
index: l
|
|
66
|
-
} = this.$props,
|
|
61
|
+
} = this.$props, s = e.text !== void 0 ? e.text : i ? e[i] : e, d = t("span", {
|
|
67
62
|
tabindex: -1,
|
|
68
63
|
class: this.innerClass,
|
|
69
64
|
key: "icon"
|
|
@@ -80,13 +75,13 @@ const f = /* @__PURE__ */ d({
|
|
|
80
75
|
src: e.imageUrl,
|
|
81
76
|
role: "presentation",
|
|
82
77
|
key: "image"
|
|
83
|
-
}, null),
|
|
78
|
+
}, null), s && t("span", {
|
|
84
79
|
class: "k-menu-link-text"
|
|
85
|
-
}, [
|
|
80
|
+
}, [s])]);
|
|
86
81
|
return p.call(this, {
|
|
87
82
|
h: c,
|
|
88
83
|
template: this.$props.dataItem.render || o,
|
|
89
|
-
defaultRendering:
|
|
84
|
+
defaultRendering: d,
|
|
90
85
|
additionalProps: {
|
|
91
86
|
item: e,
|
|
92
87
|
itemIndex: l,
|
|
@@ -107,5 +102,5 @@ const f = /* @__PURE__ */ d({
|
|
|
107
102
|
}
|
|
108
103
|
});
|
|
109
104
|
export {
|
|
110
|
-
|
|
105
|
+
x as ButtonItem
|
|
111
106
|
};
|
|
@@ -73,14 +73,14 @@ declare const DropDownButton: import('vue').DefineComponent<import('vue').Extrac
|
|
|
73
73
|
popupSettings: PropType<import('..').ButtonsPopupSettings>;
|
|
74
74
|
itemRender: PropType<any>;
|
|
75
75
|
item: PropType<any>;
|
|
76
|
-
size: PropType<"small" | "medium" | "large">;
|
|
76
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
77
77
|
rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
78
78
|
fillMode: {
|
|
79
79
|
type: PropType<"flat" | "link" | "solid" | "outline">;
|
|
80
80
|
validator: (value: string) => boolean;
|
|
81
81
|
};
|
|
82
82
|
themeColor: {
|
|
83
|
-
type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
83
|
+
type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
84
84
|
validator: (value: string) => boolean;
|
|
85
85
|
};
|
|
86
86
|
opened: {
|
|
@@ -97,7 +97,10 @@ declare const DropDownButton: import('vue').DefineComponent<import('vue').Extrac
|
|
|
97
97
|
focusedIndex: number;
|
|
98
98
|
}, {
|
|
99
99
|
computedOpened(): boolean;
|
|
100
|
-
wrapperClass():
|
|
100
|
+
wrapperClass(): {
|
|
101
|
+
'k-dropdown-button': boolean;
|
|
102
|
+
'k-focus': any;
|
|
103
|
+
};
|
|
101
104
|
}, {
|
|
102
105
|
element(): HTMLButtonElement | null;
|
|
103
106
|
onKeyDown(event: any): void;
|
|
@@ -136,14 +139,14 @@ declare const DropDownButton: import('vue').DefineComponent<import('vue').Extrac
|
|
|
136
139
|
popupSettings: PropType<import('..').ButtonsPopupSettings>;
|
|
137
140
|
itemRender: PropType<any>;
|
|
138
141
|
item: PropType<any>;
|
|
139
|
-
size: PropType<"small" | "medium" | "large">;
|
|
142
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
140
143
|
rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
141
144
|
fillMode: {
|
|
142
145
|
type: PropType<"flat" | "link" | "solid" | "outline">;
|
|
143
146
|
validator: (value: string) => boolean;
|
|
144
147
|
};
|
|
145
148
|
themeColor: {
|
|
146
|
-
type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
149
|
+
type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
147
150
|
validator: (value: string) => boolean;
|
|
148
151
|
};
|
|
149
152
|
opened: {
|
|
@@ -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("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../Button.js"),s=require("@progress/kendo-vue-common"),y=require("./utils/navigation.js"),b=require("./ButtonItem.js"),k=require("@progress/kendo-vue-popup"),c=require("./utils/popup.js"),$=require("../package-metadata.js"),C=i.defineComponent({name:"KendoDropDownButton",emits:{focus:e=>!0,blur:e=>!0,itemclick:e=>!0,open:e=>!0,close:e=>!0},props:{accessKey:String,items:{type:Array,default:function(){return[]}},ariaLabel:String,text:String,textField:String,tabIndex:Number,disabled:Boolean,icon:String,svgIcon:Object,iconClass:String,imageUrl:String,popupSettings:Object,itemRender:[String,Object,Function],item:Function,size:String,rounded:String,fillMode:{type:String,validator:function(e){return["flat","link","outline","solid"].includes(e)}},themeColor:{type:String,validator:function(e){return["base","error","info","inverse","primary","secondary","success","tertiary","warning"].includes(e)}},opened:{type:Boolean,default:void 0},buttonClass:String,dir:String},created(){this._blurTimeout=null,this._anchor=s.guid(),this.wrapper=null,this.mainButton=null,this.guid=s.guid(),this.buttonsData=[],s.validatePackage($.packageMetadata)},mounted(){this.mainButton=this.$refs[this._anchor],(this.$props.dir===void 0&&this.isRtl()||this.computedOpened)&&this.$forceUpdate()},updated(){this.focused&&this.element()&&(this.mainButton=this.$refs[this._anchor],this.mainButton.focus())},data(){return{currentOpened:!1,focused:!1,focusedIndex:-1}},computed:{computedOpened(){return this.$props.opened===void 0?this.currentOpened:this.$props.opened},wrapperClass(){return{"k-dropdown-button":!0,"k-focus":this.focused}}},setup(){return{kendoAnchorRef:i.ref(null)}},render(){const e=this.isRtl(),t=e?"rtl":void 0,{tabIndex:n,disabled:p}=this.$props,a=s.getDefaultSlots(this);this.buttonsData=this.$props.items;const h=function(){const{item:o,itemRender:r,textField:f}=this.$props;return this.buttonsData.length>0?this.buttonsData.map(function(u,d){const m=typeof u!="string"?{...u,render:s.templateRendering.call(this,u.render,s.getListeners.call(this))}:u;return i.createVNode(b.ButtonItem,{class:"k-menu-item",dataItem:m,textField:f,focused:this.focusedIndex===d,onClick:this.onItemClick,onDown:this.onItemDown,render:s.templateRendering.call(this,r,s.getListeners.call(this)),item:o,index:d,key:d,id:`${this.guid}-${d}`},null)},this):null},l=function(){const{popupSettings:o={},size:r}=this.$props;return i.createVNode(k.Popup,{anchor:this._anchor,show:this.computedOpened,animate:o.animate,popupClass:s.classNames("k-menu-popup",o.popupClass),anchorAlign:o.anchorAlign||c.getAnchorAlign(e),popupAlign:o.popupAlign||c.getPopupAlign(e),style:e?{direction:"rtl"}:void 0},{default:()=>[i.createVNode("ul",{class:`k-group k-menu-group k-reset k-menu-group-${s.kendoThemeMaps.sizeMap[r]||r}`,role:"menu",id:this.guid},[h.call(this)])]})};return i.createVNode("div",{class:this.wrapperClass,onKeydown:this.onKeyDown,onFocusin:this.onFocus,onFocusout:this.onBlur,dir:t},[i.createVNode(g.Button,{size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,onClick:this.onClickMainButton,onMousedown:this.mouseDown,disabled:p||void 0,tabIndex:n,accessKey:this.$props.accessKey,icon:this.$props.icon,svgIcon:this.$props.svgIcon,iconClass:this.$props.iconClass,class:this.$props.buttonClass,imageUrl:this.$props.imageUrl,dir:t,ref:this._anchor,type:"button","aria-disabled":p,"aria-haspopup":"menu","aria-expanded":this.computedOpened,"aria-label":this.$props.ariaLabel||`${this.$props.text||""} dropdownbutton`,"aria-controls":this.guid,"aria-activedescendant":this.focusedIndex!==void 0&&this.focusedIndex>=0?`${this.guid}-${this.focusedIndex}`:void 0},{default:()=>[this.$props.text,a]}),l.call(this)])},methods:{element(){return this.mainButton},onKeyDown(e){if(e.altKey){!this.computedOpened&&e.keyCode===s.Keys.down?(this.dispatchPopupEvent(e,!0),this.focusedIndex=0,this.currentOpened=!0):this.computedOpened&&e.keyCode===s.Keys.up&&(this.dispatchPopupEvent(e,!1),this.focusedIndex=-1,this.currentOpened=!1);return}if(e.keyCode===s.Keys.enter||e.keyCode===s.Keys.space?(this.focusedIndex!==void 0&&this.focusedIndex>=0&&this.dispatchClickEvent(e,this.focusedIndex),e.preventDefault(),this.focusedIndex=this.computedOpened?-1:0,this.currentOpened=!this.computedOpened,this.dispatchPopupEvent(e,this.currentOpened)):this.computedOpened&&e.keyCode===s.Keys.esc&&(this.focusedIndex=-1,this.currentOpened=!1,this.dispatchPopupEvent(e,this.currentOpened)),this.computedOpened){const t=y(this.focusedIndex,e.keyCode,e.altKey,this.buttonsData.length);this.focusedIndex=t;const n=e.keyCode===s.Keys.up||e.keyCode===s.Keys.down||e.keyCode===s.Keys.left||e.keyCode===s.Keys.right;!e.altKey&&n&&e.preventDefault()}},onFocus(e){this.focused||(this.focused=!0,this.$emit("focus",{event:e})),this.focusedIndex=this.computedOpened?0:-1,clearTimeout(this._blurTimeout)},onBlur(e){clearTimeout(this._blurTimeout),this.createBlurTimeout(e)},createBlurTimeout(e){const t=this;this._blurTimeout=setTimeout(()=>{s.canUseDOM&&document.activeElement!==t.$el&&(t.focused=!1,t.focusedIndex=-1,t.$emit("blur",{event:e}),t.computedOpened&&(t.currentOpened=!1,t.dispatchPopupEvent(e,!1)))},200)},onItemClick(e,t){this.focusedIndex=-1,this.currentOpened=!1,this.dispatchClickEvent(e,t),this.dispatchPopupEvent(e,!1)},onItemDown(e){document.activeElement===this.element()&&e.preventDefault()},mouseDown(e){e.preventDefault()},dispatchClickEvent(e,t){this.isItemDisabled(t)||this.$emit("itemclick",{event:e,item:this.buttonsData[t],itemIndex:t})},onClickMainButton(e){if(!this.buttonsData.length)return;const t=!this.computedOpened;this.currentOpened=t,this.focused=!0,this.focusedIndex=t?0:-1,this.dispatchPopupEvent(e,t)},dispatchPopupEvent(e,t){const n={event:e};this.$emit(t?"open":"close",n)},isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.$props.disabled},isRtl(){return this.$props.dir!==void 0?this.$props.dir==="rtl":!!this.$el&&getComputedStyle(this.$el).direction==="rtl"}}});exports.DropDownButton=C;
|