@progress/kendo-vue-buttons 8.4.0-develop.2 → 8.4.0-develop.4
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 -8
- package/Button.js +1 -1
- package/Button.mjs +45 -45
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +32 -31
- package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +2 -8
- package/FloatingActionButton/models/theme-color.d.ts +3 -9
- package/ListButton/DropDownButton.d.ts +4 -4
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +10 -10
- package/ListButton/SplitButton.d.ts +4 -4
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +98 -101
- 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/tools/ToolbarScrollButton.js +1 -1
- package/toolbar/tools/ToolbarScrollButton.mjs +22 -24
|
@@ -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 o=require("vue"),a=require("../Button.js"),i=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),a=require("../Button.js"),i=require("@progress/kendo-vue-common"),y=require("./ButtonItem.js"),C=require("./utils/navigation.js"),$=require("@progress/kendo-vue-popup"),l=require("./utils/popup.js"),k=require("@progress/kendo-svg-icons"),O=require("../package-metadata.js"),S=o.defineComponent({name:"KendoSplitButton",emits:{focus:e=>!0,blur:e=>!0,buttonclick:e=>!0,itemclick:e=>!0,open:e=>!0,close:e=>!0},props:{accessKey:String,ariaLabel:String,text:String,items:{type:Array,default:function(){return[]}},textField:String,tabIndex:Number,disabled:Boolean,icon:String,svgIcon:Object,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},iconClass:String,imageUrl:String,popupSettings:Object,itemRender:[String,Function,Object],item:[String,Function,Object],className:String,buttonClass:String,dir:String},data(){return{focused:!1,focusedIndex:-1,currentOpened:!1}},created(){this._blurTimeout=null,this._anchor=i.guid(),this.mainButton=null,this.guid=i.guid(),this.buttonsData=[],i.validatePackage(O.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())},computed:{computedOpened(){return this.$props.opened===void 0?this.currentOpened:this.$props.opened},wrapperClass(){return{"k-split-button":!0,"k-button-group":!0,"k-focus":this.focused}}},setup(){return{kendoAnchorRef:o.ref(null)}},render(){this.buttonsData=this.$props.items;const e=this.isRtl(),t=e?"rtl":void 0,{tabIndex:s,disabled:r}=this.$props,c=i.getDefaultSlots(this),h=function(){const{item:n,itemRender:p,textField:g}=this.$props;return this.buttonsData.length>0?this.buttonsData.map(function(u,d){const b=typeof u!="string"?{...u,render:i.templateRendering.call(this,u.render,i.getListeners.call(this))}:u;return o.createVNode(y.ButtonItem,{role:"menuitem",dataItem:b,textField:g,focused:this.focusedIndex===d,onClick:this.onItemClick,onDown:this.onItemDown,render:i.templateRendering.call(this,p,i.getListeners.call(this)),item:n,key:d,index:d,id:`${this.guid}-${d}`},null)},this):null},f=function(){const{popupSettings:n={},size:p}=this.$props;return o.createVNode($.Popup,{anchor:this._anchor,show:this.computedOpened,animate:n.animate,popupClass:i.classNames("k-menu-popup",n.popupClass),anchorAlign:n.anchorAlign||l.getAnchorAlign(e),popupAlign:n.popupAlign||l.getPopupAlign(e),style:e?{direction:"rtl"}:void 0},{default:()=>[o.createVNode("ul",{class:"k-menu-group",role:"menu",id:this.guid},[h.call(this)])]})},m=this.$props.text||c?{default:()=>[this.$props.text,c]}:{};return o.createVNode("div",{class:this.wrapperClass,onKeydown:this.onKeyDown,onFocusin:this.onFocus,onFocusout:this.onBlur,dir:t},[o.createVNode(a.Button,{size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,onClick:n=>this.onItemClick(n,-1),disabled:r||void 0,tabIndex:s,accessKey:this.$props.accessKey,class:this.$props.buttonClass,icon:this.$props.icon,svgIcon:this.$props.svgIcon,iconClass:this.$props.iconClass,imageUrl:this.$props.imageUrl,dir:t,id:this._anchor,ref:this._anchor,type:"button","aria-disabled":r||void 0,"aria-label":this.$props.ariaLabel||(!this.$props.text&&!c&&(this.$props.svgIcon||this.$props.icon||this.$props.iconClass)?"Action":void 0)},m),o.createVNode(a.Button,{svgIcon:k.chevronDownIcon,size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,icon:"chevron-down",class:"k-split-button-arrow",disabled:r||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMousedown:this.onDownSplitPart,onPointerdown:this.onDownSplitPart,dir:t,"aria-label":"Toggle dropdown","aria-expanded":this.computedOpened,"aria-controls":this.computedOpened?this.guid:void 0},null),f.call(this)])},methods:{element(){return this.mainButton},onKeyDown(e){if(e.altKey){!this.computedOpened&&e.keyCode===i.Keys.down?(this.dispatchPopupEvent(e,!0),this.focusedIndex=0,this.currentOpened=!0):this.computedOpened&&e.keyCode===i.Keys.up&&(this.dispatchPopupEvent(e,!1),this.focusedIndex=-1,this.currentOpened=!1);return}let t;if(e.keyCode===i.Keys.enter||e.keyCode===i.Keys.space?(e.preventDefault(),this.dispatchClickEvent(e,this.focusedIndex),this.focusedIndex!==void 0&&this.focusedIndex>=0&&(t={focusedIndex:this.computedOpened?-1:0,currentOpened:!this.computedOpened},this.dispatchPopupEvent(e,t.currentOpened))):this.computedOpened&&e.keyCode===i.Keys.esc&&(t={focusedIndex:-1,currentOpened:!1},this.dispatchPopupEvent(e,t.currentOpened)),this.computedOpened){const s=C(this.focusedIndex,e.keyCode,e.altKey,this.buttonsData.length);s!==this.focusedIndex&&(t=t||{},t.focusedIndex=s);const r=e.keyCode===i.Keys.up||e.keyCode===i.Keys.down||e.keyCode===i.Keys.left||e.keyCode===i.Keys.right;!e.altKey&&r&&e.preventDefault()}t&&(this.focusedIndex=t.focusedIndex,this.focused=t.focused,t.currentOpened!==void 0&&(this.currentOpened=t.currentOpened))},onFocus(e){this.focused||(this.$emit("focus",{event:e}),this.focused=!0),this.focusedIndex=-1,clearTimeout(this._blurTimeout)},onItemClick(e,t){const s=this.computedOpened;s&&(this.focusedIndex=0,this.currentOpened=!1),this.dispatchClickEvent(e,t),s&&this.dispatchPopupEvent(e,!1)},onBlur(e){clearTimeout(this._blurTimeout),this.createBlurTimeout(e)},createBlurTimeout(e){const t=this;this._blurTimeout=setTimeout(()=>{i.canUseDOM&&document.activeElement!==t.mainButton&&(t.focused=!1,t.focusedIndex=-1,t.$emit("blur",{event:e}),t.computedOpened&&(t.currentOpened=!1,t.dispatchPopupEvent(e,!1)))},200)},dispatchClickEvent(e,t){this.isItemDisabled(t)||(t===-1?this.$emit("buttonclick",{event:e}):this.$emit("itemclick",{event:e,component:this,item:this.buttonsData[t],itemIndex:t}))},onSplitPartClick(e){if(this.buttonsData.length){const t=!this.computedOpened;this.dispatchPopupEvent(e,t),this.focusedIndex=t?0:-1,this.currentOpened=t,this.focused=!0}},onDownSplitPart(e){e.preventDefault(),this.element()&&document.activeElement!==this.element()&&this.element().focus()},onItemDown(e){document.activeElement===this.element()&&e.preventDefault()},dispatchPopupEvent(e,t){const s={event:e};this.$emit(t?"open":"close",s)},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.SplitButton=S;
|
|
@@ -5,24 +5,24 @@
|
|
|
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 { Button as
|
|
10
|
-
import { canUseDOM as
|
|
11
|
-
import { ButtonItem as
|
|
8
|
+
import { defineComponent as k, createVNode as o, ref as y } from "vue";
|
|
9
|
+
import { Button as l } from "../Button.mjs";
|
|
10
|
+
import { canUseDOM as O, Keys as s, getDefaultSlots as I, guid as a, validatePackage as S, classNames as D, templateRendering as h, getListeners as f } from "@progress/kendo-vue-common";
|
|
11
|
+
import { ButtonItem as x } from "./ButtonItem.mjs";
|
|
12
12
|
import w from "./utils/navigation.mjs";
|
|
13
13
|
import { Popup as v } from "@progress/kendo-vue-popup";
|
|
14
14
|
import { getPopupAlign as P, getAnchorAlign as B } from "./utils/popup.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { chevronDownIcon as E } from "@progress/kendo-svg-icons";
|
|
16
16
|
import { packageMetadata as K } from "../package-metadata.mjs";
|
|
17
|
-
const
|
|
17
|
+
const L = /* @__PURE__ */ k({
|
|
18
18
|
name: "KendoSplitButton",
|
|
19
19
|
emits: {
|
|
20
|
-
focus: (
|
|
21
|
-
blur: (
|
|
22
|
-
buttonclick: (
|
|
23
|
-
itemclick: (
|
|
24
|
-
open: (
|
|
25
|
-
close: (
|
|
20
|
+
focus: (t) => !0,
|
|
21
|
+
blur: (t) => !0,
|
|
22
|
+
buttonclick: (t) => !0,
|
|
23
|
+
itemclick: (t) => !0,
|
|
24
|
+
open: (t) => !0,
|
|
25
|
+
close: (t) => !0
|
|
26
26
|
},
|
|
27
27
|
props: {
|
|
28
28
|
accessKey: String,
|
|
@@ -43,14 +43,14 @@ const N = /* @__PURE__ */ C({
|
|
|
43
43
|
rounded: String,
|
|
44
44
|
fillMode: {
|
|
45
45
|
type: String,
|
|
46
|
-
validator: function(
|
|
47
|
-
return ["flat", "link", "outline", "solid"].includes(
|
|
46
|
+
validator: function(t) {
|
|
47
|
+
return ["flat", "link", "outline", "solid"].includes(t);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
themeColor: {
|
|
51
51
|
type: String,
|
|
52
|
-
validator: function(
|
|
53
|
-
return ["base", "
|
|
52
|
+
validator: function(t) {
|
|
53
|
+
return ["base", "error", "info", "inverse", "primary", "secondary", "success", "tertiary", "warning"].includes(t);
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
opened: {
|
|
@@ -74,7 +74,7 @@ const N = /* @__PURE__ */ C({
|
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
created() {
|
|
77
|
-
this._blurTimeout = null, this._anchor =
|
|
77
|
+
this._blurTimeout = null, this._anchor = a(), this.mainButton = null, this.guid = a(), this.buttonsData = [], S(K);
|
|
78
78
|
},
|
|
79
79
|
mounted() {
|
|
80
80
|
this.mainButton = this.$refs[this._anchor], (this.$props.dir === void 0 && this.isRtl() || this.computedOpened) && this.$forceUpdate();
|
|
@@ -96,71 +96,71 @@ const N = /* @__PURE__ */ C({
|
|
|
96
96
|
},
|
|
97
97
|
setup() {
|
|
98
98
|
return {
|
|
99
|
-
kendoAnchorRef:
|
|
99
|
+
kendoAnchorRef: y(null)
|
|
100
100
|
};
|
|
101
101
|
},
|
|
102
102
|
render() {
|
|
103
103
|
this.buttonsData = this.$props.items;
|
|
104
|
-
const
|
|
104
|
+
const t = this.isRtl(), e = t ? "rtl" : void 0, {
|
|
105
105
|
tabIndex: i,
|
|
106
106
|
disabled: r
|
|
107
|
-
} = this.$props,
|
|
107
|
+
} = this.$props, p = I(this), m = function() {
|
|
108
108
|
const {
|
|
109
109
|
item: n,
|
|
110
|
-
itemRender:
|
|
111
|
-
textField:
|
|
110
|
+
itemRender: c,
|
|
111
|
+
textField: C
|
|
112
112
|
} = this.$props;
|
|
113
|
-
return this.buttonsData.length > 0 ? this.buttonsData.map(function(
|
|
114
|
-
const $ = typeof
|
|
115
|
-
...
|
|
116
|
-
render:
|
|
117
|
-
} :
|
|
118
|
-
return o(
|
|
119
|
-
class: "k-menu-item",
|
|
113
|
+
return this.buttonsData.length > 0 ? this.buttonsData.map(function(d, u) {
|
|
114
|
+
const $ = typeof d != "string" ? {
|
|
115
|
+
...d,
|
|
116
|
+
render: h.call(this, d.render, f.call(this))
|
|
117
|
+
} : d;
|
|
118
|
+
return o(x, {
|
|
120
119
|
role: "menuitem",
|
|
121
120
|
dataItem: $,
|
|
122
|
-
textField:
|
|
123
|
-
focused: this.focusedIndex ===
|
|
121
|
+
textField: C,
|
|
122
|
+
focused: this.focusedIndex === u,
|
|
124
123
|
onClick: this.onItemClick,
|
|
125
124
|
onDown: this.onItemDown,
|
|
126
|
-
render:
|
|
125
|
+
render: h.call(this, c, f.call(this)),
|
|
127
126
|
item: n,
|
|
128
|
-
key:
|
|
129
|
-
index:
|
|
130
|
-
id: `${this.guid}-${
|
|
127
|
+
key: u,
|
|
128
|
+
index: u,
|
|
129
|
+
id: `${this.guid}-${u}`
|
|
131
130
|
}, null);
|
|
132
131
|
}, this) : null;
|
|
133
132
|
}, g = function() {
|
|
134
133
|
const {
|
|
135
134
|
popupSettings: n = {},
|
|
136
|
-
size:
|
|
135
|
+
size: c
|
|
137
136
|
} = this.$props;
|
|
138
137
|
return o(v, {
|
|
139
138
|
anchor: this._anchor,
|
|
140
139
|
show: this.computedOpened,
|
|
141
140
|
animate: n.animate,
|
|
142
|
-
popupClass:
|
|
143
|
-
anchorAlign: n.anchorAlign || B(
|
|
144
|
-
popupAlign: n.popupAlign || P(
|
|
145
|
-
style:
|
|
141
|
+
popupClass: D("k-menu-popup", n.popupClass),
|
|
142
|
+
anchorAlign: n.anchorAlign || B(t),
|
|
143
|
+
popupAlign: n.popupAlign || P(t),
|
|
144
|
+
style: t ? {
|
|
146
145
|
direction: "rtl"
|
|
147
146
|
} : void 0
|
|
148
147
|
}, {
|
|
149
148
|
default: () => [o("ul", {
|
|
150
|
-
class:
|
|
149
|
+
class: "k-menu-group",
|
|
151
150
|
role: "menu",
|
|
152
|
-
id: this.guid
|
|
153
|
-
"aria-labelledby": this._anchor
|
|
151
|
+
id: this.guid
|
|
154
152
|
}, [m.call(this)])]
|
|
155
153
|
});
|
|
156
|
-
}
|
|
154
|
+
}, b = this.$props.text || p ? {
|
|
155
|
+
default: () => [this.$props.text, p]
|
|
156
|
+
} : {};
|
|
157
157
|
return o("div", {
|
|
158
158
|
class: this.wrapperClass,
|
|
159
159
|
onKeydown: this.onKeyDown,
|
|
160
160
|
onFocusin: this.onFocus,
|
|
161
161
|
onFocusout: this.onBlur,
|
|
162
|
-
dir:
|
|
163
|
-
}, [o(
|
|
162
|
+
dir: e
|
|
163
|
+
}, [o(l, {
|
|
164
164
|
size: this.$props.size,
|
|
165
165
|
rounded: this.$props.rounded,
|
|
166
166
|
fillMode: this.$props.fillMode,
|
|
@@ -174,108 +174,105 @@ const N = /* @__PURE__ */ C({
|
|
|
174
174
|
svgIcon: this.$props.svgIcon,
|
|
175
175
|
iconClass: this.$props.iconClass,
|
|
176
176
|
imageUrl: this.$props.imageUrl,
|
|
177
|
-
dir:
|
|
177
|
+
dir: e,
|
|
178
178
|
id: this._anchor,
|
|
179
179
|
ref: this._anchor,
|
|
180
180
|
type: "button",
|
|
181
|
-
"aria-disabled": r,
|
|
182
|
-
"aria-
|
|
183
|
-
|
|
184
|
-
"aria-label": this.$props.ariaLabel || `${this.$props.text || ""} splitbutton`,
|
|
185
|
-
"aria-controls": this.guid,
|
|
186
|
-
"aria-activedescendant": this.focusedIndex !== void 0 && this.focusedIndex >= 0 ? `${this.guid}-${this.focusedIndex}` : void 0
|
|
187
|
-
}, {
|
|
188
|
-
default: () => [this.$props.text, f]
|
|
189
|
-
}), o(a, {
|
|
181
|
+
"aria-disabled": r || void 0,
|
|
182
|
+
"aria-label": this.$props.ariaLabel || (!this.$props.text && !p && (this.$props.svgIcon || this.$props.icon || this.$props.iconClass) ? "Action" : void 0)
|
|
183
|
+
}, b), o(l, {
|
|
190
184
|
svgIcon: E,
|
|
191
185
|
size: this.$props.size,
|
|
192
186
|
rounded: this.$props.rounded,
|
|
193
187
|
fillMode: this.$props.fillMode,
|
|
194
188
|
themeColor: this.$props.themeColor,
|
|
195
|
-
icon: "
|
|
189
|
+
icon: "chevron-down",
|
|
190
|
+
class: "k-split-button-arrow",
|
|
196
191
|
disabled: r || void 0,
|
|
197
192
|
tabIndex: -1,
|
|
198
193
|
onClick: this.onSplitPartClick,
|
|
199
194
|
onMousedown: this.onDownSplitPart,
|
|
200
195
|
onPointerdown: this.onDownSplitPart,
|
|
201
|
-
dir:
|
|
202
|
-
"aria-label": "
|
|
196
|
+
dir: e,
|
|
197
|
+
"aria-label": "Toggle dropdown",
|
|
198
|
+
"aria-expanded": this.computedOpened,
|
|
199
|
+
"aria-controls": this.computedOpened ? this.guid : void 0
|
|
203
200
|
}, null), g.call(this)]);
|
|
204
201
|
},
|
|
205
202
|
methods: {
|
|
206
203
|
element() {
|
|
207
204
|
return this.mainButton;
|
|
208
205
|
},
|
|
209
|
-
onKeyDown(
|
|
210
|
-
if (
|
|
211
|
-
!this.computedOpened &&
|
|
206
|
+
onKeyDown(t) {
|
|
207
|
+
if (t.altKey) {
|
|
208
|
+
!this.computedOpened && t.keyCode === s.down ? (this.dispatchPopupEvent(t, !0), this.focusedIndex = 0, this.currentOpened = !0) : this.computedOpened && t.keyCode === s.up && (this.dispatchPopupEvent(t, !1), this.focusedIndex = -1, this.currentOpened = !1);
|
|
212
209
|
return;
|
|
213
210
|
}
|
|
214
|
-
let
|
|
215
|
-
if (
|
|
211
|
+
let e;
|
|
212
|
+
if (t.keyCode === s.enter || t.keyCode === s.space ? (t.preventDefault(), this.dispatchClickEvent(t, this.focusedIndex), this.focusedIndex !== void 0 && this.focusedIndex >= 0 && (e = {
|
|
216
213
|
focusedIndex: this.computedOpened ? -1 : 0,
|
|
217
214
|
currentOpened: !this.computedOpened
|
|
218
|
-
}, this.dispatchPopupEvent(
|
|
215
|
+
}, this.dispatchPopupEvent(t, e.currentOpened))) : this.computedOpened && t.keyCode === s.esc && (e = {
|
|
219
216
|
focusedIndex: -1,
|
|
220
217
|
currentOpened: !1
|
|
221
|
-
}, this.dispatchPopupEvent(
|
|
222
|
-
const i = w(this.focusedIndex,
|
|
223
|
-
i !== this.focusedIndex && (
|
|
224
|
-
const r =
|
|
225
|
-
!
|
|
218
|
+
}, this.dispatchPopupEvent(t, e.currentOpened)), this.computedOpened) {
|
|
219
|
+
const i = w(this.focusedIndex, t.keyCode, t.altKey, this.buttonsData.length);
|
|
220
|
+
i !== this.focusedIndex && (e = e || {}, e.focusedIndex = i);
|
|
221
|
+
const r = t.keyCode === s.up || t.keyCode === s.down || t.keyCode === s.left || t.keyCode === s.right;
|
|
222
|
+
!t.altKey && r && t.preventDefault();
|
|
226
223
|
}
|
|
227
|
-
|
|
224
|
+
e && (this.focusedIndex = e.focusedIndex, this.focused = e.focused, e.currentOpened !== void 0 && (this.currentOpened = e.currentOpened));
|
|
228
225
|
},
|
|
229
|
-
onFocus(
|
|
226
|
+
onFocus(t) {
|
|
230
227
|
this.focused || (this.$emit("focus", {
|
|
231
|
-
event:
|
|
228
|
+
event: t
|
|
232
229
|
}), this.focused = !0), this.focusedIndex = -1, clearTimeout(this._blurTimeout);
|
|
233
230
|
},
|
|
234
|
-
onItemClick(
|
|
231
|
+
onItemClick(t, e) {
|
|
235
232
|
const i = this.computedOpened;
|
|
236
|
-
i && (this.focusedIndex = 0, this.currentOpened = !1), this.dispatchClickEvent(
|
|
233
|
+
i && (this.focusedIndex = 0, this.currentOpened = !1), this.dispatchClickEvent(t, e), i && this.dispatchPopupEvent(t, !1);
|
|
237
234
|
},
|
|
238
|
-
onBlur(
|
|
239
|
-
clearTimeout(this._blurTimeout), this.createBlurTimeout(
|
|
235
|
+
onBlur(t) {
|
|
236
|
+
clearTimeout(this._blurTimeout), this.createBlurTimeout(t);
|
|
240
237
|
},
|
|
241
|
-
createBlurTimeout(
|
|
242
|
-
const
|
|
238
|
+
createBlurTimeout(t) {
|
|
239
|
+
const e = this;
|
|
243
240
|
this._blurTimeout = setTimeout(() => {
|
|
244
|
-
|
|
245
|
-
event:
|
|
246
|
-
}),
|
|
241
|
+
O && document.activeElement !== e.mainButton && (e.focused = !1, e.focusedIndex = -1, e.$emit("blur", {
|
|
242
|
+
event: t
|
|
243
|
+
}), e.computedOpened && (e.currentOpened = !1, e.dispatchPopupEvent(t, !1)));
|
|
247
244
|
}, 200);
|
|
248
245
|
},
|
|
249
|
-
dispatchClickEvent(
|
|
250
|
-
this.isItemDisabled(
|
|
251
|
-
event:
|
|
246
|
+
dispatchClickEvent(t, e) {
|
|
247
|
+
this.isItemDisabled(e) || (e === -1 ? this.$emit("buttonclick", {
|
|
248
|
+
event: t
|
|
252
249
|
}) : this.$emit("itemclick", {
|
|
253
|
-
event:
|
|
250
|
+
event: t,
|
|
254
251
|
component: this,
|
|
255
|
-
item: this.buttonsData[
|
|
256
|
-
itemIndex:
|
|
252
|
+
item: this.buttonsData[e],
|
|
253
|
+
itemIndex: e
|
|
257
254
|
}));
|
|
258
255
|
},
|
|
259
|
-
onSplitPartClick(
|
|
256
|
+
onSplitPartClick(t) {
|
|
260
257
|
if (this.buttonsData.length) {
|
|
261
|
-
const
|
|
262
|
-
this.dispatchPopupEvent(
|
|
258
|
+
const e = !this.computedOpened;
|
|
259
|
+
this.dispatchPopupEvent(t, e), this.focusedIndex = e ? 0 : -1, this.currentOpened = e, this.focused = !0;
|
|
263
260
|
}
|
|
264
261
|
},
|
|
265
|
-
onDownSplitPart(
|
|
266
|
-
|
|
262
|
+
onDownSplitPart(t) {
|
|
263
|
+
t.preventDefault(), this.element() && document.activeElement !== this.element() && this.element().focus();
|
|
267
264
|
},
|
|
268
|
-
onItemDown(
|
|
269
|
-
document.activeElement === this.element() &&
|
|
265
|
+
onItemDown(t) {
|
|
266
|
+
document.activeElement === this.element() && t.preventDefault();
|
|
270
267
|
},
|
|
271
|
-
dispatchPopupEvent(
|
|
268
|
+
dispatchPopupEvent(t, e) {
|
|
272
269
|
const i = {
|
|
273
|
-
event:
|
|
270
|
+
event: t
|
|
274
271
|
};
|
|
275
|
-
this.$emit(
|
|
272
|
+
this.$emit(e ? "open" : "close", i);
|
|
276
273
|
},
|
|
277
|
-
isItemDisabled(
|
|
278
|
-
return this.buttonsData[
|
|
274
|
+
isItemDisabled(t) {
|
|
275
|
+
return this.buttonsData[t] ? this.buttonsData[t].disabled : this.$props.disabled;
|
|
279
276
|
},
|
|
280
277
|
isRtl() {
|
|
281
278
|
return this.$props.dir !== void 0 ? this.$props.dir === "rtl" : !!this.$el && getComputedStyle(this.$el).direction === "rtl";
|
|
@@ -283,5 +280,5 @@ const N = /* @__PURE__ */ C({
|
|
|
283
280
|
}
|
|
284
281
|
});
|
|
285
282
|
export {
|
|
286
|
-
|
|
283
|
+
L as SplitButton
|
|
287
284
|
};
|
|
@@ -83,13 +83,14 @@ export interface DropDownButtonProps {
|
|
|
83
83
|
* Configures the `size` of the Button.
|
|
84
84
|
*
|
|
85
85
|
* The available options are:
|
|
86
|
+
* - xs
|
|
86
87
|
* - small
|
|
87
88
|
* - medium
|
|
88
89
|
* - large
|
|
89
90
|
*
|
|
90
91
|
* @default `undefined`
|
|
91
92
|
*/
|
|
92
|
-
size?: 'small' | 'medium' | 'large';
|
|
93
|
+
size?: 'xs' | 'small' | 'medium' | 'large';
|
|
93
94
|
/**
|
|
94
95
|
* Configures the `roundness` of the Button.
|
|
95
96
|
*
|
|
@@ -127,13 +128,12 @@ export interface DropDownButtonProps {
|
|
|
127
128
|
* - info
|
|
128
129
|
* - success
|
|
129
130
|
* - warning
|
|
130
|
-
* -
|
|
131
|
-
* - light
|
|
131
|
+
* - error
|
|
132
132
|
* - inverse
|
|
133
133
|
*
|
|
134
134
|
* @default `undefined`
|
|
135
135
|
*/
|
|
136
|
-
themeColor?: 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | '
|
|
136
|
+
themeColor?: 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'inverse';
|
|
137
137
|
/**
|
|
138
138
|
* Fires when the component is focused ([see example]({% slug events_dropdownbutton %})).
|
|
139
139
|
*/
|
|
@@ -233,13 +233,14 @@ export interface SplitButtonProps {
|
|
|
233
233
|
* Configures the `size` of the Button.
|
|
234
234
|
*
|
|
235
235
|
* The available options are:
|
|
236
|
+
* - xs
|
|
236
237
|
* - small
|
|
237
238
|
* - medium
|
|
238
239
|
* - large
|
|
239
240
|
*
|
|
240
241
|
* @default `undefined`
|
|
241
242
|
*/
|
|
242
|
-
size?: 'small' | 'medium' | 'large';
|
|
243
|
+
size?: 'xs' | 'small' | 'medium' | 'large';
|
|
243
244
|
/**
|
|
244
245
|
* Configures the `roundness` of the Button.
|
|
245
246
|
*
|
|
@@ -277,13 +278,12 @@ export interface SplitButtonProps {
|
|
|
277
278
|
* - info
|
|
278
279
|
* - success
|
|
279
280
|
* - warning
|
|
280
|
-
* -
|
|
281
|
-
* - light
|
|
281
|
+
* - error
|
|
282
282
|
* - inverse
|
|
283
283
|
*
|
|
284
284
|
* @default `undefined`
|
|
285
285
|
*/
|
|
286
|
-
themeColor?: 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | '
|
|
286
|
+
themeColor?: 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'inverse';
|
|
287
287
|
/**
|
|
288
288
|
* Fires when the main button is clicked ([see example]({% slug events_splitbutton %})).
|
|
289
289
|
*/
|
|
@@ -19,7 +19,7 @@ declare const SegmentedControl: import('vue').DefineComponent<import('vue').Extr
|
|
|
19
19
|
type: PropType<SegmentedItemProps[]>;
|
|
20
20
|
default: () => any[];
|
|
21
21
|
};
|
|
22
|
-
size: PropType<"small" | "medium" | "large">;
|
|
22
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
23
23
|
layoutMode: {
|
|
24
24
|
type: PropType<"stretch" | "compact">;
|
|
25
25
|
default: string;
|
|
@@ -49,7 +49,7 @@ declare const SegmentedControl: import('vue').DefineComponent<import('vue').Extr
|
|
|
49
49
|
type: PropType<SegmentedItemProps[]>;
|
|
50
50
|
default: () => any[];
|
|
51
51
|
};
|
|
52
|
-
size: PropType<"small" | "medium" | "large">;
|
|
52
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
53
53
|
layoutMode: {
|
|
54
54
|
type: PropType<"stretch" | "compact">;
|
|
55
55
|
default: string;
|
|
@@ -25,14 +25,14 @@ declare const SmartPasteButton: import('vue').DefineComponent<import('vue').Extr
|
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
27
|
size: {
|
|
28
|
-
type: PropType<"small" | "medium" | "large">;
|
|
28
|
+
type: PropType<"small" | "medium" | "xs" | "large">;
|
|
29
29
|
default: string;
|
|
30
30
|
};
|
|
31
31
|
svgIcon: {
|
|
32
32
|
type: PropType<import('@progress/kendo-vue-common').SVGIcon>;
|
|
33
33
|
default: () => import('@progress/kendo-svg-icons').SVGIcon;
|
|
34
34
|
};
|
|
35
|
-
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
35
|
+
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
36
36
|
formFields: PropType<SmartPasteFormField[]>;
|
|
37
37
|
togglable: {
|
|
38
38
|
type: PropType<boolean>;
|
|
@@ -81,14 +81,14 @@ declare const SmartPasteButton: import('vue').DefineComponent<import('vue').Extr
|
|
|
81
81
|
default: string;
|
|
82
82
|
};
|
|
83
83
|
size: {
|
|
84
|
-
type: PropType<"small" | "medium" | "large">;
|
|
84
|
+
type: PropType<"small" | "medium" | "xs" | "large">;
|
|
85
85
|
default: string;
|
|
86
86
|
};
|
|
87
87
|
svgIcon: {
|
|
88
88
|
type: PropType<import('@progress/kendo-vue-common').SVGIcon>;
|
|
89
89
|
default: () => import('@progress/kendo-svg-icons').SVGIcon;
|
|
90
90
|
};
|
|
91
|
-
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
91
|
+
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
92
92
|
formFields: PropType<SmartPasteFormField[]>;
|
|
93
93
|
togglable: {
|
|
94
94
|
type: PropType<boolean>;
|
|
@@ -118,11 +118,11 @@ declare const SmartPasteButton: import('vue').DefineComponent<import('vue').Extr
|
|
|
118
118
|
onClick?: (event: SmartPasteClickEvent) => any;
|
|
119
119
|
}>, {
|
|
120
120
|
type: string;
|
|
121
|
-
size: "small" | "medium" | "large";
|
|
121
|
+
size: "small" | "medium" | "xs" | "large";
|
|
122
|
+
fillMode: "flat" | "link" | "solid" | "outline";
|
|
122
123
|
rounded: "small" | "medium" | "large" | "full" | "none";
|
|
123
124
|
selected: boolean;
|
|
124
125
|
disabled: boolean;
|
|
125
|
-
fillMode: "flat" | "link" | "solid" | "outline";
|
|
126
126
|
togglable: boolean;
|
|
127
127
|
svgIcon: import('@progress/kendo-vue-common').SVGIcon;
|
|
128
128
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -157,10 +157,10 @@ declare const SpeechToTextButton: import('vue').DefineComponent<import('vue').Ex
|
|
|
157
157
|
type: PropType<boolean>;
|
|
158
158
|
default: any;
|
|
159
159
|
};
|
|
160
|
-
size: PropType<"small" | "medium" | "large">;
|
|
160
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
161
161
|
rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
162
162
|
fillMode: PropType<"flat" | "link" | "solid" | "outline">;
|
|
163
|
-
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
163
|
+
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
164
164
|
title: {
|
|
165
165
|
type: PropType<string>;
|
|
166
166
|
default: string;
|
|
@@ -216,10 +216,10 @@ declare const SpeechToTextButton: import('vue').DefineComponent<import('vue').Ex
|
|
|
216
216
|
type: PropType<boolean>;
|
|
217
217
|
default: any;
|
|
218
218
|
};
|
|
219
|
-
size: PropType<"small" | "medium" | "large">;
|
|
219
|
+
size: PropType<"small" | "medium" | "xs" | "large">;
|
|
220
220
|
rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
|
|
221
221
|
fillMode: PropType<"flat" | "link" | "solid" | "outline">;
|
|
222
|
-
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "
|
|
222
|
+
themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
|
|
223
223
|
title: {
|
|
224
224
|
type: PropType<string>;
|
|
225
225
|
default: string;
|
|
@@ -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"),E=require("@progress/kendo-webspeech-common"),k=require("../Button.js"),m=require("@progress/kendo-svg-icons");function T(e){return new E.KendoSpeechRecognition(e)}let f=(function(e){return e.WebSpeech="WebSpeech",e.None="None",e})({});const z=i.defineComponent({name:"KendoSpeechToTextButton",props:{lang:{type:String,default:"en-US"},continuous:{type:Boolean,default:!1},interimResults:{type:Boolean,default:!1},maxAlternatives:{type:Number,default:1},integrationMode:{type:String,default:f.WebSpeech},onStart:{type:Function},onResult:{type:Function},onEnd:{type:Function},onError:{type:Function},svgIcon:{type:Object,default:m.
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),E=require("@progress/kendo-webspeech-common"),k=require("../Button.js"),m=require("@progress/kendo-svg-icons");function T(e){return new E.KendoSpeechRecognition(e)}let f=(function(e){return e.WebSpeech="WebSpeech",e.None="None",e})({});const z=i.defineComponent({name:"KendoSpeechToTextButton",props:{lang:{type:String,default:"en-US"},continuous:{type:Boolean,default:!1},interimResults:{type:Boolean,default:!1},maxAlternatives:{type:Number,default:1},integrationMode:{type:String,default:f.WebSpeech},onStart:{type:Function},onResult:{type:Function},onEnd:{type:Function},onError:{type:Function},svgIcon:{type:Object,default:m.microphoneIcon},iconSize:{type:String},disabled:{type:Boolean,default:void 0},size:String,rounded:String,fillMode:String,themeColor:String,title:{type:String,default:"Speech to Text Button"},ariaLabel:{type:String,default:"Start speech recognition"}},setup(e,{emit:c,expose:S}){const o=i.ref(null),n=i.ref(!1),g=()=>{var t;return(t=o.value)==null?void 0:t.isActive()},a=()=>e.integrationMode!==f.None,l=typeof window!="undefined"&&!("webkitSpeechRecognition"in window||"SpeechRecognition"in window)?(e.onError&&e.onError({errorMessage:"Speech Recognition API is not supported in this browser."}),!1):!0,u=()=>{var t;n.value||(a()&&((t=o.value)==null||t.start()),n.value=!0)},r=()=>{var t;n.value&&(a()&&((t=o.value)==null||t.stop()),n.value=!1)},v=()=>{var t;n.value&&a()&&((t=o.value)==null||t.abort(),n.value=!1)},h=()=>{l&&(n.value?b():d())},d=async()=>{n.value||(e.onStart&&await e.onStart(),u())},M=t=>{const s=t.results,B=s.length-1,R=s[B],x=Array.from(R).map(I=>({transcript:I.transcript,confidence:I.confidence})),w={isFinal:R.isFinal,alternatives:x};e.onResult&&e.onResult(w),c("result",w)},b=async()=>{n.value&&(e.onEnd&&await e.onEnd(),r())},A=t=>{n.value=!1;const s={errorMessage:t.error||t.errorMessage||"Unknown error"};e.onError&&e.onError(s),c("error",s)},p=()=>{var t;l&&e.integrationMode===f.WebSpeech&&((t=o.value)!=null&&t.isActive()&&r(),o.value=T({lang:e.lang,continuous:e.continuous,interimResults:e.interimResults,integrationMode:e.integrationMode,maxAlternatives:e.maxAlternatives,events:{start:d,result:M,end:b,error:A}}))};return i.watch(()=>({lang:e.lang,continuous:e.continuous,interimResults:e.interimResults,integrationMode:e.integrationMode,maxAlternatives:e.maxAlternatives}),()=>{p()},{deep:!0}),i.onMounted(()=>{p()}),i.onUnmounted(()=>{var t;(t=o.value)!=null&&t.isInActiveState&&r()}),S({start:u,stop:r,abort:v,isActive:g}),{clickHandler:h,isInActiveState:n}},render(){const{ariaLabel:e,svgIcon:c,fillMode:S,rounded:o,size:n,disabled:g,themeColor:a,iconSize:y,title:l}=this.$props,{className:u,style:r,id:v}=this.$attrs,h=i.computed(()=>["k-speech-to-text-button",u,{"k-listening":this.isInActiveState}]),d=i.computed(()=>this.isInActiveState?m.stopIcon:c||m.microphoneIcon);return i.createVNode(k.Button,{id:v,style:r,class:h.value,onClick:this.clickHandler,svgIcon:d.value,iconSize:y,fillMode:S,rounded:o,size:n,themeColor:a,"aria-label":e,disabled:g,title:l},null)}});exports.SpeechToTextButton=z;exports.SpeechToTextButtonMode=f;
|