@progress/kendo-vue-buttons 7.1.0-develop.6 → 7.1.0-develop.7

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.
@@ -6,10 +6,10 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { defineComponent as w, createVNode as o, ref as g } from "vue";
9
- import { templateRendering as S, getListeners as M, getTabIndex as A, Icon as $, classNames as h, setRef as k, Keys as n, canUseDOM as F, kendoThemeMaps as I, getRef as x, validatePackage as R, guid as f } from "@progress/kendo-vue-common";
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
10
  import { FloatingActionButtonItem as E } from "./FloatingActionButtonItem.mjs";
11
11
  import { packageMetadata as B } from "../package-metadata.mjs";
12
- import { getPopupAlign as N, getAnchorAlign as P, position as y, getTextDirectionClass as K } from "./utils.mjs";
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({
15
15
  name: "KendoVueFloatingActionButton",
@@ -54,35 +54,15 @@ const G = /* @__PURE__ */ w({
54
54
  return {};
55
55
  }
56
56
  },
57
- shape: {
58
- type: String,
59
- default: function() {
60
- return "rectangle";
61
- }
62
- },
63
- rounded: {
64
- type: String,
65
- default: "full"
66
- },
57
+ rounded: String,
67
58
  fillMode: {
68
59
  type: String,
69
- default: "solid",
70
60
  validator: function(e) {
71
- return [null, "flat", "link", "outline", "solid"].includes(e);
72
- }
73
- },
74
- size: {
75
- type: String,
76
- default: function() {
77
- return "medium";
61
+ return ["flat", "link", "outline", "solid"].includes(e);
78
62
  }
79
63
  },
80
- themeColor: {
81
- type: String,
82
- default: function() {
83
- return "primary";
84
- }
85
- }
64
+ size: String,
65
+ themeColor: String
86
66
  },
87
67
  emits: {
88
68
  click: (e) => !0,
@@ -105,31 +85,28 @@ const G = /* @__PURE__ */ w({
105
85
  };
106
86
  },
107
87
  created() {
108
- R(B), this.element = void 0, this._anchor = f(), this.listId = f(), this.buttonId = f();
88
+ R(B), this.element = void 0, this._anchor = c(), this.listId = c(), this.buttonId = c();
109
89
  },
110
90
  mounted() {
111
- 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 && y(this.$el, this.$props.align, this.$props.alignOffset, this.isRtl);
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);
112
92
  },
113
93
  updated() {
114
- y(this.$el, this.$props.align, this.$props.alignOffset, this.isRtl), this.currentFocused && this.element && this.element.focus();
94
+ O(this.$el, this.$props.align, this.$props.alignOffset, this.isRtl), this.currentFocused && this.element && this.element.focus();
115
95
  },
116
96
  computed: {
117
97
  buttonClassNames() {
118
98
  const {
119
99
  size: e,
120
- icon: t,
121
- shape: s,
122
- themeColor: i,
123
- fillMode: r,
124
- rounded: a
100
+ themeColor: t,
101
+ fillMode: i,
102
+ rounded: s
125
103
  } = this.$props;
126
104
  return {
127
105
  "k-fab": !0,
128
- [`k-fab-${s || "rectangle"}`]: s !== null,
129
106
  [`k-fab-${I.sizeMap[e] || e}`]: e,
130
- [`k-rounded-${I.roundedMap[a] || a}`]: a,
131
- [`k-fab-${r}`]: r,
132
- [`k-fab-${r}-${i}`]: r && i,
107
+ [`k-rounded-${I.roundedMap[s] || s}`]: s,
108
+ [`k-fab-${i}`]: i,
109
+ [`k-fab-${t}`]: t,
133
110
  "k-disabled": this.$props.disabled,
134
111
  "k-focus": this.currentFocused,
135
112
  [`k-${this.$props.align.vertical}-${this.$props.align.horizontal}`]: !0
@@ -139,7 +116,7 @@ const G = /* @__PURE__ */ w({
139
116
  return this.$props.opened === void 0 ? this.currentOpened : this.$props.opened;
140
117
  },
141
118
  rootClassNames() {
142
- return h({
119
+ return p({
143
120
  "k-pos-absolute": this.$props.positionMode === "absolute",
144
121
  "k-pos-fixed": this.$props.positionMode === "fixed"
145
122
  });
@@ -190,7 +167,7 @@ const G = /* @__PURE__ */ w({
190
167
  F && document.activeElement === this.element && e.preventDefault();
191
168
  },
192
169
  handleKeyDown(e) {
193
- const t = this.focusedIndex, s = this.$props.items ? this.$props.items.length - 1 : -1, i = this.$props.align.vertical === "bottom";
170
+ const t = this.focusedIndex, i = this.$props.items ? this.$props.items.length - 1 : -1, s = this.$props.align.vertical === "bottom";
194
171
  switch (e.keyCode) {
195
172
  case n.enter:
196
173
  case n.space:
@@ -203,15 +180,15 @@ const G = /* @__PURE__ */ w({
203
180
  e.preventDefault(), this.focusedIndex = 0;
204
181
  break;
205
182
  case n.end:
206
- e.preventDefault(), this.focusedIndex = s;
183
+ e.preventDefault(), this.focusedIndex = i;
207
184
  break;
208
185
  case n.down:
209
186
  case n.right:
210
- e.preventDefault(), t < s && !i && (this.focusedIndex = t + 1), t > 0 && i && (this.focusedIndex = t - 1);
187
+ e.preventDefault(), t < i && !s && (this.focusedIndex = t + 1), t > 0 && s && (this.focusedIndex = t - 1);
211
188
  break;
212
189
  case n.up:
213
190
  case n.left:
214
- e.preventDefault(), t > 0 && !i && (this.focusedIndex = t - 1), t < s && i && (this.focusedIndex = t + 1);
191
+ e.preventDefault(), t > 0 && !s && (this.focusedIndex = t - 1), t < i && s && (this.focusedIndex = t + 1);
215
192
  break;
216
193
  }
217
194
  this.$emit("keydown", e, void 0);
@@ -228,48 +205,48 @@ const G = /* @__PURE__ */ w({
228
205
  const {
229
206
  align: e,
230
207
  disabled: t,
231
- icon: s,
232
- svgIcon: i,
233
- iconClass: r,
234
- id: a,
235
- items: d,
236
- text: l,
237
- tabIndex: O,
238
- accessKey: v,
239
- popupSettings: p
240
- } = this.$props, C = S.call(this, this.$props.item, M.call(this)), D = function() {
241
- return d && d.map(function(u, c) {
208
+ icon: i,
209
+ svgIcon: s,
210
+ iconClass: h,
211
+ id: f,
212
+ items: r,
213
+ text: a,
214
+ tabIndex: v,
215
+ accessKey: C,
216
+ popupSettings: l
217
+ } = this.$props, y = M.call(this, this.$props.item, S.call(this)), D = function() {
218
+ return r && r.map(function(d, u) {
242
219
  return o(E, {
243
- key: c,
244
- index: c,
245
- id: `${this.listId}-${c}`,
246
- disabled: t || u.disabled,
247
- focused: this.focusedIndex === c,
248
- dataItem: u,
249
- item: C,
250
- class: h(u.className, K(this.currentDir || "ltr", e.horizontal)),
220
+ key: u,
221
+ index: u,
222
+ id: `${this.listId}-${u}`,
223
+ disabled: t || d.disabled,
224
+ focused: this.focusedIndex === u,
225
+ dataItem: d,
226
+ item: y,
227
+ class: p(d.className, K(this.currentDir || "ltr", e.horizontal)),
251
228
  onClick: this.handleItemClick,
252
229
  onDown: this.handleItemDown
253
230
  }, null);
254
231
  }, this);
255
- }, m = s && !l, b = (this.element ? this.element.offsetWidth : 0) / 2 - 32 / 2;
232
+ }, m = i && !a, b = (this.element ? this.element.offsetWidth : 0) / 2 - 32 / 2;
256
233
  return o("div", {
257
234
  class: this.rootClassNames
258
235
  }, [o("button", {
259
- ref: (u) => {
260
- this.kendoAnchorRef = u;
236
+ ref: (d) => {
237
+ this.kendoAnchorRef = d;
261
238
  },
262
- id: a || this.buttonId,
263
- role: d ? "menubutton" : "button",
239
+ id: f || this.buttonId,
240
+ role: r ? "menubutton" : "button",
264
241
  type: "button",
265
242
  "aria-disabled": t,
266
- "aria-expanded": d ? this.computedOpened : void 0,
267
- "aria-haspopup": !!d,
268
- "aria-label": `${l || ""} floatingactionbutton`,
269
- "aria-owns": d ? this.listId : void 0,
270
- "aria-activedescendant": this.focusedIndex >= 0 && d ? `${this.listId}-${this.focusedIndex}` : void 0,
271
- tabindex: A(O, t),
272
- accesskey: v,
243
+ "aria-expanded": r ? this.computedOpened : void 0,
244
+ "aria-haspopup": !!r,
245
+ "aria-label": `${a || ""} floatingactionbutton`,
246
+ "aria-owns": r ? this.listId : void 0,
247
+ "aria-activedescendant": this.focusedIndex >= 0 && r ? `${this.listId}-${this.focusedIndex}` : void 0,
248
+ tabindex: A(v, t),
249
+ accesskey: C,
273
250
  dir: this.currentDir,
274
251
  disabled: t,
275
252
  class: this.buttonClassNames,
@@ -279,22 +256,22 @@ const G = /* @__PURE__ */ w({
279
256
  onFocusin: this.handleFocus,
280
257
  onBlur: this.handleBlur,
281
258
  onKeydown: this.handleKeyDown
282
- }, [s || i ? o($, {
283
- name: s,
284
- icon: i,
259
+ }, [i || s ? o($, {
260
+ name: i,
261
+ icon: s,
285
262
  class: "k-fab-icon"
286
- }, null) : r ? o($, {
287
- class: r
288
- }, null) : null, l && o("span", {
263
+ }, null) : h ? o($, {
264
+ class: h
265
+ }, null) : null, a && o("span", {
289
266
  class: "k-fab-text"
290
- }, [l])]), o(j, {
267
+ }, [a])]), o(j, {
291
268
  ref: k(this, "popup"),
292
269
  show: this.computedOpened,
293
270
  anchor: this._anchor,
294
- animate: p.animate,
295
- popupClass: h("k-popup-transparent k-fab-popup", p.popupClass),
296
- anchorAlign: p.anchorAlign || P(e, this.isRtl),
297
- popupAlign: p.popupAlign || N(e, this.isRtl),
271
+ animate: l.animate,
272
+ popupClass: p("k-popup-transparent k-fab-popup", l.popupClass),
273
+ anchorAlign: l.anchorAlign || P(e, this.isRtl),
274
+ popupAlign: l.popupAlign || N(e, this.isRtl),
298
275
  style: {
299
276
  boxShadow: "none"
300
277
  }
@@ -302,9 +279,9 @@ const G = /* @__PURE__ */ w({
302
279
  default: () => [o("ul", {
303
280
  ref: k(this, "list"),
304
281
  role: "menu",
305
- "aria-labelledby": a,
282
+ "aria-labelledby": f,
306
283
  id: this.listId,
307
- class: h("k-fab-items", {
284
+ class: p("k-fab-items", {
308
285
  "k-fab-items-bottom": e.vertical !== "bottom",
309
286
  "k-fab-items-top": e.vertical === "bottom"
310
287
  }),
@@ -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"),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"),p=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:{type:String,default:"medium"},shape:{type:String,default:"rectangle",validator:function(e){return[null,"rectangle","square"].includes(e)}},rounded:{type:String,default:"medium"},fillMode:{type:String,default:"solid",validator:function(e){return[null,"flat","link","outline","solid"].includes(e)}},themeColor:{type:String,default:"base",validator:function(e){return[null,"base","dark","error","info","inverse","inverse","light","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:a}=this.$props,c=s.getDefaultSlots(this);this.buttonsData=this.$props.items;const l=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},h=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||p.getAnchorAlign(e),popupAlign:o.popupAlign||p.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},[l.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,shape:this.$props.shape,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,onClick:this.onClickMainButton,onMousedown:this.mouseDown,disabled:a||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":a,"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,c]}),h.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;
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"),a=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","dark","error","info","inverse","light","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,c=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||a.getAnchorAlign(e),popupAlign:o.popupAlign||a.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,c]}),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;
@@ -6,12 +6,12 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { defineComponent as $, createVNode as o, ref as k } from "vue";
9
- import { Button as y } from "../Button.mjs";
10
- import { canUseDOM as C, Keys as s, getDefaultSlots as I, guid as a, validatePackage as D, classNames as O, kendoThemeMaps as x, templateRendering as c, getListeners as l } from "@progress/kendo-vue-common";
9
+ import { Button as C } from "../Button.mjs";
10
+ import { canUseDOM as y, Keys as s, getDefaultSlots as I, guid as a, validatePackage as D, classNames as O, kendoThemeMaps as x, templateRendering as c, getListeners as h } from "@progress/kendo-vue-common";
11
11
  import w from "./utils/navigation.mjs";
12
12
  import { ButtonItem as S } from "./ButtonItem.mjs";
13
- import { Popup as v } from "@progress/kendo-vue-popup";
14
- import { getPopupAlign as B, getAnchorAlign as E } from "./utils/popup.mjs";
13
+ import { Popup as B } from "@progress/kendo-vue-popup";
14
+ import { getPopupAlign as v, getAnchorAlign as E } from "./utils/popup.mjs";
15
15
  import { packageMetadata as K } from "../package-metadata.mjs";
16
16
  const U = /* @__PURE__ */ $({
17
17
  name: "KendoDropDownButton",
@@ -42,33 +42,18 @@ const U = /* @__PURE__ */ $({
42
42
  popupSettings: Object,
43
43
  itemRender: [String, Object, Function],
44
44
  item: Function,
45
- size: {
46
- type: String,
47
- default: "medium"
48
- },
49
- shape: {
50
- type: String,
51
- default: "rectangle",
52
- validator: function(e) {
53
- return [null, "rectangle", "square"].includes(e);
54
- }
55
- },
56
- rounded: {
57
- type: String,
58
- default: "medium"
59
- },
45
+ size: String,
46
+ rounded: String,
60
47
  fillMode: {
61
48
  type: String,
62
- default: "solid",
63
49
  validator: function(e) {
64
- return [null, "flat", "link", "outline", "solid"].includes(e);
50
+ return ["flat", "link", "outline", "solid"].includes(e);
65
51
  }
66
52
  },
67
53
  themeColor: {
68
54
  type: String,
69
- default: "base",
70
55
  validator: function(e) {
71
- return [null, "base", "dark", "error", "info", "inverse", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(e);
56
+ return ["base", "dark", "error", "info", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(e);
72
57
  }
73
58
  },
74
59
  opened: {
@@ -114,7 +99,7 @@ const U = /* @__PURE__ */ $({
114
99
  const e = this.isRtl(), t = e ? "rtl" : void 0, {
115
100
  tabIndex: i,
116
101
  disabled: p
117
- } = this.$props, h = I(this);
102
+ } = this.$props, l = I(this);
118
103
  this.buttonsData = this.$props.items;
119
104
  const f = function() {
120
105
  const {
@@ -122,23 +107,23 @@ const U = /* @__PURE__ */ $({
122
107
  itemRender: r,
123
108
  textField: g
124
109
  } = this.$props;
125
- return this.buttonsData.length > 0 ? this.buttonsData.map(function(u, d) {
126
- const b = typeof u != "string" ? {
127
- ...u,
128
- render: c.call(this, u.render, l.call(this))
129
- } : u;
110
+ return this.buttonsData.length > 0 ? this.buttonsData.map(function(d, u) {
111
+ const b = typeof d != "string" ? {
112
+ ...d,
113
+ render: c.call(this, d.render, h.call(this))
114
+ } : d;
130
115
  return o(S, {
131
116
  class: "k-menu-item",
132
117
  dataItem: b,
133
118
  textField: g,
134
- focused: this.focusedIndex === d,
119
+ focused: this.focusedIndex === u,
135
120
  onClick: this.onItemClick,
136
121
  onDown: this.onItemDown,
137
- render: c.call(this, r, l.call(this)),
122
+ render: c.call(this, r, h.call(this)),
138
123
  item: n,
139
- index: d,
140
- key: d,
141
- id: `${this.guid}-${d}`
124
+ index: u,
125
+ key: u,
126
+ id: `${this.guid}-${u}`
142
127
  }, null);
143
128
  }, this) : null;
144
129
  }, m = function() {
@@ -146,13 +131,13 @@ const U = /* @__PURE__ */ $({
146
131
  popupSettings: n = {},
147
132
  size: r
148
133
  } = this.$props;
149
- return o(v, {
134
+ return o(B, {
150
135
  anchor: this._anchor,
151
136
  show: this.computedOpened,
152
137
  animate: n.animate,
153
138
  popupClass: O("k-menu-popup", n.popupClass),
154
139
  anchorAlign: n.anchorAlign || E(e),
155
- popupAlign: n.popupAlign || B(e),
140
+ popupAlign: n.popupAlign || v(e),
156
141
  style: e ? {
157
142
  direction: "rtl"
158
143
  } : void 0
@@ -170,9 +155,8 @@ const U = /* @__PURE__ */ $({
170
155
  onFocusin: this.onFocus,
171
156
  onFocusout: this.onBlur,
172
157
  dir: t
173
- }, [o(y, {
158
+ }, [o(C, {
174
159
  size: this.$props.size,
175
- shape: this.$props.shape,
176
160
  rounded: this.$props.rounded,
177
161
  fillMode: this.$props.fillMode,
178
162
  themeColor: this.$props.themeColor,
@@ -196,7 +180,7 @@ const U = /* @__PURE__ */ $({
196
180
  "aria-controls": this.guid,
197
181
  "aria-activedescendant": this.focusedIndex !== void 0 && this.focusedIndex >= 0 ? `${this.guid}-${this.focusedIndex}` : void 0
198
182
  }, {
199
- default: () => [this.$props.text, h]
183
+ default: () => [this.$props.text, l]
200
184
  }), m.call(this)]);
201
185
  },
202
186
  methods: {
@@ -226,7 +210,7 @@ const U = /* @__PURE__ */ $({
226
210
  createBlurTimeout(e) {
227
211
  const t = this;
228
212
  this._blurTimeout = setTimeout(() => {
229
- C && document.activeElement !== t.$el && (t.focused = !1, t.focusedIndex = -1, t.$emit("blur", {
213
+ y && document.activeElement !== t.$el && (t.focused = !1, t.focusedIndex = -1, t.$emit("blur", {
230
214
  event: e
231
215
  }), t.computedOpened && (t.currentOpened = !1, t.dispatchPopupEvent(e, !1)));
232
216
  }, 200);
@@ -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"),c=require("../Button.js"),i=require("@progress/kendo-vue-common"),b=require("./ButtonItem.js"),y=require("./utils/navigation.js"),k=require("@progress/kendo-vue-popup"),p=require("./utils/popup.js"),$=require("@progress/kendo-svg-icons"),C=require("../package-metadata.js"),I=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:{type:String,default:"medium"},rounded:{type:String,default:"medium"},fillMode:{type:String,default:"solid",validator:function(e){return[null,"flat","link","outline","solid"].includes(e)}},themeColor:{type:String,default:"base",validator:function(e){return[null,"base","dark","error","info","inverse","inverse","light","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(C.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,l=i.getDefaultSlots(this),h=function(){const{item:n,itemRender:u,textField:m}=this.$props;return this.buttonsData.length>0?this.buttonsData.map(function(d,a){const g=typeof d!="string"?{...d,render:i.templateRendering.call(this,d.render,i.getListeners.call(this))}:d;return o.createVNode(b.ButtonItem,{class:"k-menu-item",role:"menuitem",dataItem:g,textField:m,focused:this.focusedIndex===a,onClick:this.onItemClick,onDown:this.onItemDown,render:i.templateRendering.call(this,u,i.getListeners.call(this)),item:n,key:a,index:a,id:`${this.guid}-${a}`},null)},this):null},f=function(){const{popupSettings:n={},size:u}=this.$props;return o.createVNode(k.Popup,{anchor:this._anchor,show:this.computedOpened,animate:n.animate,popupClass:i.classNames("k-menu-popup",n.popupClass),anchorAlign:n.anchorAlign||p.getAnchorAlign(e),popupAlign:n.popupAlign||p.getPopupAlign(e),style:e?{direction:"rtl"}:void 0},{default:()=>[o.createVNode("ul",{class:`k-group k-menu-group k-reset k-menu-group-${i.kendoThemeMaps.sizeMap[u]||u}`,role:"menu",id:this.guid,"aria-labelledby":this._anchor},[h.call(this)])]})};return o.createVNode("div",{class:this.wrapperClass,onKeydown:this.onKeyDown,onFocusin:this.onFocus,onFocusout:this.onBlur,dir:t},[o.createVNode(c.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,"aria-haspopup":"menu","aria-expanded":this.computedOpened,"aria-label":this.$props.ariaLabel||`${this.$props.text||""} splitbutton`,"aria-controls":this.guid,"aria-activedescendant":this.focusedIndex!==void 0&&this.focusedIndex>=0?`${this.guid}-${this.focusedIndex}`:void 0},{default:()=>[this.$props.text,l]}),o.createVNode(c.Button,{svgIcon:$.caretAltDownIcon,size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,icon:"caret-alt-down",disabled:r||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMousedown:this.onDownSplitPart,onPointerdown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"},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=y(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=I;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),a=require("../Button.js"),i=require("@progress/kendo-vue-common"),b=require("./ButtonItem.js"),y=require("./utils/navigation.js"),k=require("@progress/kendo-vue-popup"),p=require("./utils/popup.js"),$=require("@progress/kendo-svg-icons"),C=require("../package-metadata.js"),I=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","dark","error","info","inverse","light","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(C.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,l=i.getDefaultSlots(this),h=function(){const{item:n,itemRender:u,textField:m}=this.$props;return this.buttonsData.length>0?this.buttonsData.map(function(d,c){const g=typeof d!="string"?{...d,render:i.templateRendering.call(this,d.render,i.getListeners.call(this))}:d;return o.createVNode(b.ButtonItem,{class:"k-menu-item",role:"menuitem",dataItem:g,textField:m,focused:this.focusedIndex===c,onClick:this.onItemClick,onDown:this.onItemDown,render:i.templateRendering.call(this,u,i.getListeners.call(this)),item:n,key:c,index:c,id:`${this.guid}-${c}`},null)},this):null},f=function(){const{popupSettings:n={},size:u}=this.$props;return o.createVNode(k.Popup,{anchor:this._anchor,show:this.computedOpened,animate:n.animate,popupClass:i.classNames("k-menu-popup",n.popupClass),anchorAlign:n.anchorAlign||p.getAnchorAlign(e),popupAlign:n.popupAlign||p.getPopupAlign(e),style:e?{direction:"rtl"}:void 0},{default:()=>[o.createVNode("ul",{class:`k-group k-menu-group k-reset k-menu-group-${i.kendoThemeMaps.sizeMap[u]||u}`,role:"menu",id:this.guid,"aria-labelledby":this._anchor},[h.call(this)])]})};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,"aria-haspopup":"menu","aria-expanded":this.computedOpened,"aria-label":this.$props.ariaLabel||`${this.$props.text||""} splitbutton`,"aria-controls":this.guid,"aria-activedescendant":this.focusedIndex!==void 0&&this.focusedIndex>=0?`${this.guid}-${this.focusedIndex}`:void 0},{default:()=>[this.$props.text,l]}),o.createVNode(a.Button,{svgIcon:$.caretAltDownIcon,size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,icon:"caret-alt-down",disabled:r||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMousedown:this.onDownSplitPart,onPointerdown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"},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=y(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=I;
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { defineComponent as C, createVNode as o, ref as k } from "vue";
9
9
  import { Button as a } from "../Button.mjs";
10
- import { canUseDOM as y, Keys as s, getDefaultSlots as I, guid as l, validatePackage as O, classNames as S, kendoThemeMaps as x, templateRendering as c, getListeners as h } from "@progress/kendo-vue-common";
10
+ import { canUseDOM as y, Keys as s, getDefaultSlots as I, guid as c, validatePackage as O, classNames as S, kendoThemeMaps as x, templateRendering as l, getListeners as h } from "@progress/kendo-vue-common";
11
11
  import { ButtonItem as D } from "./ButtonItem.mjs";
12
12
  import w from "./utils/navigation.mjs";
13
13
  import { Popup as v } from "@progress/kendo-vue-popup";
@@ -39,26 +39,18 @@ const N = /* @__PURE__ */ C({
39
39
  disabled: Boolean,
40
40
  icon: String,
41
41
  svgIcon: Object,
42
- size: {
43
- type: String,
44
- default: "medium"
45
- },
46
- rounded: {
47
- type: String,
48
- default: "medium"
49
- },
42
+ size: String,
43
+ rounded: String,
50
44
  fillMode: {
51
45
  type: String,
52
- default: "solid",
53
46
  validator: function(e) {
54
- return [null, "flat", "link", "outline", "solid"].includes(e);
47
+ return ["flat", "link", "outline", "solid"].includes(e);
55
48
  }
56
49
  },
57
50
  themeColor: {
58
51
  type: String,
59
- default: "base",
60
52
  validator: function(e) {
61
- return [null, "base", "dark", "error", "info", "inverse", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(e);
53
+ return ["base", "dark", "error", "info", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(e);
62
54
  }
63
55
  },
64
56
  opened: {
@@ -82,7 +74,7 @@ const N = /* @__PURE__ */ C({
82
74
  };
83
75
  },
84
76
  created() {
85
- this._blurTimeout = null, this._anchor = l(), this.mainButton = null, this.guid = l(), this.buttonsData = [], O(K);
77
+ this._blurTimeout = null, this._anchor = c(), this.mainButton = null, this.guid = c(), this.buttonsData = [], O(K);
86
78
  },
87
79
  mounted() {
88
80
  this.mainButton = this.$refs[this._anchor], (this.$props.dir === void 0 && this.isRtl() || this.computedOpened) && this.$forceUpdate();
@@ -121,7 +113,7 @@ const N = /* @__PURE__ */ C({
121
113
  return this.buttonsData.length > 0 ? this.buttonsData.map(function(u, p) {
122
114
  const $ = typeof u != "string" ? {
123
115
  ...u,
124
- render: c.call(this, u.render, h.call(this))
116
+ render: l.call(this, u.render, h.call(this))
125
117
  } : u;
126
118
  return o(D, {
127
119
  class: "k-menu-item",
@@ -131,7 +123,7 @@ const N = /* @__PURE__ */ C({
131
123
  focused: this.focusedIndex === p,
132
124
  onClick: this.onItemClick,
133
125
  onDown: this.onItemDown,
134
- render: c.call(this, d, h.call(this)),
126
+ render: l.call(this, d, h.call(this)),
135
127
  item: n,
136
128
  key: p,
137
129
  index: p,
@@ -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"),x=require("@progress/kendo-webspeech-common"),k=require("../Button.js"),m=require("@progress/kendo-svg-icons");function T(e){return new x.KendoSpeechRecognition(e)}let d=function(e){return e.WebSpeech="WebSpeech",e.None="None",e}({});const E=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:d.WebSpeech},onStart:{type:Function},onResult:{type:Function},onEnd:{type:Function},onError:{type:Function},svgIcon:{type:Object,default:m.microphoneOutlineIcon},iconSize:{type:String,default:"medium"},disabled:{type:Boolean,default:void 0},size:{type:String,default:"medium"},rounded:{type:String,default:"medium"},fillMode:{type:String,default:"solid"},themeColor:{type:String,default:"base"},title:{type:String,default:"Speech to Text Button"},ariaLabel:{type:String,default:"Start speech recognition"}},setup(e,{emit:u,expose:f}){const o=i.ref(null),n=i.ref(!1),S=()=>{var t;return(t=o.value)==null?void 0:t.isActive()},a=()=>e.integrationMode!==d.None,s=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,l=()=>{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)},g=()=>{var t;n.value&&a&&((t=o.value)==null||t.abort(),n.value=!1)},v=()=>{s&&(n.value?p():c())},c=async()=>{n.value||e.onStart&&(await e.onStart(),l())},R=t=>{const b=t.results,B=b.length-1,w=b[B],M=Array.from(w).map(I=>({transcript:I.transcript,confidence:I.confidence}));u("result",{isFinal:w.isFinal,alternatives:M})},p=async()=>{n.value&&e.onEnd&&(await e.onEnd(),r())},A=t=>{u("error",t)},y=()=>{var t;s&&e.integrationMode===d.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:c,result:R,end:p,error:A}}))};return i.watch(()=>({lang:e.lang,continuous:e.continuous,interimResults:e.interimResults,integrationMode:e.integrationMode,maxAlternatives:e.maxAlternatives}),()=>{y()},{deep:!0}),i.onMounted(()=>{y()}),i.onUnmounted(()=>{var t;(t=o.value)!=null&&t.isInActiveState&&r()}),f({start:l,stop:r,abort:g,isActive:S}),{clickHandler:v,isInActiveState:n}},render(){const{ariaLabel:e,svgIcon:u,fillMode:f,rounded:o,size:n,disabled:S,themeColor:a,iconSize:h,title:s}=this.$props,{className:l,style:r,id:g}=this.$attrs,v=i.computed(()=>["k-speech-to-text-button",l,{"k-listening":this.isInActiveState}]),c=i.computed(()=>this.isInActiveState?m.stopSmIcon:u||m.microphoneOutlineIcon);return i.createVNode(k.Button,{id:g,style:r,class:v.value,onClick:this.clickHandler,svgIcon:c.value,iconSize:h,fillMode:f,rounded:o,size:n,themeColor:a,"aria-label":e,disabled:S,title:s},null)}});exports.SpeechToTextButton=E;exports.SpeechToTextButtonMode=d;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),x=require("@progress/kendo-webspeech-common"),k=require("../Button.js"),h=require("@progress/kendo-svg-icons");function T(e){return new x.KendoSpeechRecognition(e)}let d=function(e){return e.WebSpeech="WebSpeech",e.None="None",e}({});const E=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:d.WebSpeech},onStart:{type:Function},onResult:{type:Function},onEnd:{type:Function},onError:{type:Function},svgIcon:{type:Object,default:h.microphoneOutlineIcon},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:s,expose:f}){const o=i.ref(null),n=i.ref(!1),S=()=>{var t;return(t=o.value)==null?void 0:t.isActive()},a=()=>e.integrationMode!==d.None,c=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,l=()=>{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)},g=()=>{var t;n.value&&a&&((t=o.value)==null||t.abort(),n.value=!1)},v=()=>{c&&(n.value?p():u())},u=async()=>{n.value||e.onStart&&(await e.onStart(),l())},R=t=>{const b=t.results,B=b.length-1,w=b[B],M=Array.from(w).map(I=>({transcript:I.transcript,confidence:I.confidence}));s("result",{isFinal:w.isFinal,alternatives:M})},p=async()=>{n.value&&e.onEnd&&(await e.onEnd(),r())},A=t=>{s("error",t)},y=()=>{var t;c&&e.integrationMode===d.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:u,result:R,end:p,error:A}}))};return i.watch(()=>({lang:e.lang,continuous:e.continuous,interimResults:e.interimResults,integrationMode:e.integrationMode,maxAlternatives:e.maxAlternatives}),()=>{y()},{deep:!0}),i.onMounted(()=>{y()}),i.onUnmounted(()=>{var t;(t=o.value)!=null&&t.isInActiveState&&r()}),f({start:l,stop:r,abort:g,isActive:S}),{clickHandler:v,isInActiveState:n}},render(){const{ariaLabel:e,svgIcon:s,fillMode:f,rounded:o,size:n,disabled:S,themeColor:a,iconSize:m,title:c}=this.$props,{className:l,style:r,id:g}=this.$attrs,v=i.computed(()=>["k-speech-to-text-button",l,{"k-listening":this.isInActiveState}]),u=i.computed(()=>this.isInActiveState?h.stopSmIcon:s||h.microphoneOutlineIcon);return i.createVNode(k.Button,{id:g,style:r,class:v.value,onClick:this.clickHandler,svgIcon:u.value,iconSize:m,fillMode:f,rounded:o,size:n,themeColor:a,"aria-label":e,disabled:S,title:c},null)}});exports.SpeechToTextButton=E;exports.SpeechToTextButtonMode=d;