@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.
Files changed (33) hide show
  1. package/Button.d.ts +8 -9
  2. package/Chip/Chip.d.ts +0 -6
  3. package/Chip/Chip.js +1 -1
  4. package/Chip/Chip.mjs +63 -68
  5. package/FloatingActionButton/FloatingActionButton.d.ts +3 -5
  6. package/FloatingActionButton/FloatingActionButton.js +1 -1
  7. package/FloatingActionButton/FloatingActionButton.mjs +45 -41
  8. package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +2 -8
  9. package/FloatingActionButton/models/theme-color.d.ts +3 -9
  10. package/ListButton/ButtonItem.d.ts +0 -6
  11. package/ListButton/ButtonItem.js +1 -1
  12. package/ListButton/ButtonItem.mjs +9 -14
  13. package/ListButton/DropDownButton.d.ts +8 -5
  14. package/ListButton/DropDownButton.js +1 -1
  15. package/ListButton/DropDownButton.mjs +105 -101
  16. package/ListButton/SplitButton.d.ts +4 -4
  17. package/ListButton/SplitButton.js +1 -1
  18. package/ListButton/SplitButton.mjs +47 -49
  19. package/ListButton/models/ListButtonProps.d.ts +8 -8
  20. package/SegmentedControl/SegmentedControl.d.ts +2 -2
  21. package/SegmentedControl/interfaces/SegmentedControlTypes.d.ts +1 -0
  22. package/SmartPasteButton/SmartPasteButton.d.ts +6 -6
  23. package/SpeechToText/SpeechToTextButton.d.ts +4 -4
  24. package/SpeechToText/SpeechToTextButton.js +1 -1
  25. package/SpeechToText/SpeechToTextButton.mjs +16 -16
  26. package/dist/cdn/js/kendo-vue-buttons.js +1 -1
  27. package/package-metadata.js +1 -1
  28. package/package-metadata.mjs +2 -2
  29. package/package.json +11 -6
  30. package/toolbar/Toolbar.d.ts +2 -2
  31. package/toolbar/Toolbar.js +1 -1
  32. package/toolbar/Toolbar.mjs +2 -2
  33. package/ListButton/messages/index.d.ts +0 -17
@@ -5,22 +5,22 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as I, createVNode as r, ref as k } from "vue";
9
- import { Button as O } from "../Button.mjs";
10
- import { canUseDOM as D, Keys as s, getDefaultSlots as x, classNames as h, guid as l, validatePackage as w, templateRendering as f, getListeners as m } from "@progress/kendo-vue-common";
11
- import S from "./utils/navigation.mjs";
12
- import { ButtonItem as v } from "./ButtonItem.mjs";
8
+ import { defineComponent as $, createVNode as o, ref as k } from "vue";
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
+ import w from "./utils/navigation.mjs";
12
+ import { ButtonItem as S } from "./ButtonItem.mjs";
13
13
  import { Popup as B } from "@progress/kendo-vue-popup";
14
- import { getPopupAlign as E, getAnchorAlign as K } from "./utils/popup.mjs";
15
- import { packageMetadata as P } from "../package-metadata.mjs";
16
- const j = /* @__PURE__ */ I({
14
+ import { getPopupAlign as v, getAnchorAlign as E } from "./utils/popup.mjs";
15
+ import { packageMetadata as K } from "../package-metadata.mjs";
16
+ const U = /* @__PURE__ */ $({
17
17
  name: "KendoDropDownButton",
18
18
  emits: {
19
- focus: (t) => !0,
20
- blur: (t) => !0,
21
- itemclick: (t) => !0,
22
- open: (t) => !0,
23
- close: (t) => !0
19
+ focus: (e) => !0,
20
+ blur: (e) => !0,
21
+ itemclick: (e) => !0,
22
+ open: (e) => !0,
23
+ close: (e) => !0
24
24
  },
25
25
  props: {
26
26
  accessKey: String,
@@ -46,14 +46,14 @@ const j = /* @__PURE__ */ I({
46
46
  rounded: String,
47
47
  fillMode: {
48
48
  type: String,
49
- validator: function(t) {
50
- return ["flat", "link", "outline", "solid"].includes(t);
49
+ validator: function(e) {
50
+ return ["flat", "link", "outline", "solid"].includes(e);
51
51
  }
52
52
  },
53
53
  themeColor: {
54
54
  type: String,
55
- validator: function(t) {
56
- return ["base", "dark", "error", "info", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(t);
55
+ validator: function(e) {
56
+ return ["base", "error", "info", "inverse", "primary", "secondary", "success", "tertiary", "warning"].includes(e);
57
57
  }
58
58
  },
59
59
  opened: {
@@ -64,7 +64,7 @@ const j = /* @__PURE__ */ I({
64
64
  dir: String
65
65
  },
66
66
  created() {
67
- this._blurTimeout = null, this._anchor = l(), this.wrapper = null, this.mainButton = null, this.guid = l(), this.buttonsData = [], w(P);
67
+ this._blurTimeout = null, this._anchor = a(), this.wrapper = null, this.mainButton = null, this.guid = a(), this.buttonsData = [], D(K);
68
68
  },
69
69
  mounted() {
70
70
  this.mainButton = this.$refs[this._anchor], (this.$props.dir === void 0 && this.isRtl() || this.computedOpened) && this.$forceUpdate();
@@ -84,6 +84,10 @@ const j = /* @__PURE__ */ I({
84
84
  return this.$props.opened === void 0 ? this.currentOpened : this.$props.opened;
85
85
  },
86
86
  wrapperClass() {
87
+ return {
88
+ "k-dropdown-button": !0,
89
+ "k-focus": this.focused
90
+ };
87
91
  }
88
92
  },
89
93
  setup() {
@@ -92,155 +96,155 @@ const j = /* @__PURE__ */ I({
92
96
  };
93
97
  },
94
98
  render() {
95
- const t = this.isRtl(), e = t ? "rtl" : void 0, {
99
+ const e = this.isRtl(), t = e ? "rtl" : void 0, {
96
100
  tabIndex: i,
97
- disabled: u
98
- } = this.$props, p = x(this);
101
+ disabled: p
102
+ } = this.$props, l = I(this);
99
103
  this.buttonsData = this.$props.items;
100
- const g = function() {
104
+ const f = function() {
101
105
  const {
102
106
  item: n,
103
- itemRender: c,
104
- textField: C
105
- } = this.$props, a = this.buttonsData.length;
106
- return a > 0 ? this.buttonsData.map(function(d, o) {
107
- const y = typeof d != "string" ? {
108
- ...d,
109
- render: f.call(this, d.render, m.call(this))
110
- } : d;
111
- return r(v, {
112
- dataItem: y,
113
- textField: C,
114
- focused: this.focusedIndex === o,
107
+ itemRender: r,
108
+ textField: g
109
+ } = this.$props;
110
+ return this.buttonsData.length > 0 ? this.buttonsData.map(function(u, d) {
111
+ const b = typeof u != "string" ? {
112
+ ...u,
113
+ render: c.call(this, u.render, h.call(this))
114
+ } : u;
115
+ return o(S, {
116
+ class: "k-menu-item",
117
+ dataItem: b,
118
+ textField: g,
119
+ focused: this.focusedIndex === d,
115
120
  onClick: this.onItemClick,
116
121
  onDown: this.onItemDown,
117
- render: f.call(this, c, m.call(this)),
122
+ render: c.call(this, r, h.call(this)),
118
123
  item: n,
119
- index: o,
120
- key: o,
121
- id: `${this.guid}-${o}`,
122
- first: o === 0,
123
- last: o === a - 1
124
+ index: d,
125
+ key: d,
126
+ id: `${this.guid}-${d}`
124
127
  }, null);
125
128
  }, this) : null;
126
- }, $ = function() {
129
+ }, m = function() {
127
130
  const {
128
131
  popupSettings: n = {},
129
- size: c
132
+ size: r
130
133
  } = this.$props;
131
- return r(B, {
134
+ return o(B, {
132
135
  anchor: this._anchor,
133
136
  show: this.computedOpened,
134
137
  animate: n.animate,
135
- popupClass: h("k-menu-popup", n.popupClass),
136
- anchorAlign: n.anchorAlign || K(t),
137
- popupAlign: n.popupAlign || E(t),
138
- style: t ? {
138
+ popupClass: O("k-menu-popup", n.popupClass),
139
+ anchorAlign: n.anchorAlign || E(e),
140
+ popupAlign: n.popupAlign || v(e),
141
+ style: e ? {
139
142
  direction: "rtl"
140
143
  } : void 0
141
144
  }, {
142
- default: () => [r("ul", {
143
- class: "k-menu-group",
145
+ default: () => [o("ul", {
146
+ class: `k-group k-menu-group k-reset k-menu-group-${x.sizeMap[r] || r}`,
144
147
  role: "menu",
145
148
  id: this.guid
146
- }, [g.call(this)])]
149
+ }, [f.call(this)])]
147
150
  });
148
- }, b = this.$props.text || p ? {
149
- default: () => [this.$props.text, p]
150
- } : {};
151
- return r("div", {
151
+ };
152
+ return o("div", {
152
153
  class: this.wrapperClass,
153
154
  onKeydown: this.onKeyDown,
154
155
  onFocusin: this.onFocus,
155
156
  onFocusout: this.onBlur,
156
- dir: e
157
- }, [r(O, {
157
+ dir: t
158
+ }, [o(C, {
158
159
  size: this.$props.size,
159
160
  rounded: this.$props.rounded,
160
161
  fillMode: this.$props.fillMode,
161
162
  themeColor: this.$props.themeColor,
162
163
  onClick: this.onClickMainButton,
163
164
  onMousedown: this.mouseDown,
164
- disabled: u || void 0,
165
+ disabled: p || void 0,
165
166
  tabIndex: i,
166
167
  accessKey: this.$props.accessKey,
167
168
  icon: this.$props.icon,
168
169
  svgIcon: this.$props.svgIcon,
169
170
  iconClass: this.$props.iconClass,
170
- class: h("k-menu-button", this.$props.buttonClass),
171
+ class: this.$props.buttonClass,
171
172
  imageUrl: this.$props.imageUrl,
172
- dir: e,
173
+ dir: t,
173
174
  ref: this._anchor,
174
175
  type: "button",
175
- "aria-disabled": u || void 0,
176
+ "aria-disabled": p,
177
+ "aria-haspopup": "menu",
176
178
  "aria-expanded": this.computedOpened,
177
- "aria-label": this.$props.ariaLabel || (this.$props.svgIcon || this.$props.icon || this.$props.iconClass ? "Menu" : void 0),
178
- "aria-controls": this.computedOpened ? this.guid : void 0,
179
- "aria-activedescendant": this.computedOpened && this.focusedIndex !== void 0 && this.focusedIndex >= 0 ? `${this.guid}-${this.focusedIndex}` : void 0
180
- }, b), $.call(this)]);
179
+ "aria-label": this.$props.ariaLabel || `${this.$props.text || ""} dropdownbutton`,
180
+ "aria-controls": this.guid,
181
+ "aria-activedescendant": this.focusedIndex !== void 0 && this.focusedIndex >= 0 ? `${this.guid}-${this.focusedIndex}` : void 0
182
+ }, {
183
+ default: () => [this.$props.text, l]
184
+ }), m.call(this)]);
181
185
  },
182
186
  methods: {
183
187
  element() {
184
188
  return this.mainButton;
185
189
  },
186
- onKeyDown(t) {
187
- if (t.altKey) {
188
- !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);
190
+ onKeyDown(e) {
191
+ if (e.altKey) {
192
+ !this.computedOpened && e.keyCode === s.down ? (this.dispatchPopupEvent(e, !0), this.focusedIndex = 0, this.currentOpened = !0) : this.computedOpened && e.keyCode === s.up && (this.dispatchPopupEvent(e, !1), this.focusedIndex = -1, this.currentOpened = !1);
189
193
  return;
190
194
  }
191
- if (t.keyCode === s.enter || t.keyCode === s.space ? (this.focusedIndex !== void 0 && this.focusedIndex >= 0 && this.dispatchClickEvent(t, this.focusedIndex), t.preventDefault(), this.focusedIndex = this.computedOpened ? -1 : 0, this.currentOpened = !this.computedOpened, this.dispatchPopupEvent(t, this.currentOpened)) : this.computedOpened && t.keyCode === s.esc && (this.focusedIndex = -1, this.currentOpened = !1, this.dispatchPopupEvent(t, this.currentOpened)), this.computedOpened) {
192
- const e = S(this.focusedIndex, t.keyCode, t.altKey, this.buttonsData.length);
193
- this.focusedIndex = e;
194
- const i = t.keyCode === s.up || t.keyCode === s.down || t.keyCode === s.left || t.keyCode === s.right;
195
- !t.altKey && i && t.preventDefault();
195
+ if (e.keyCode === s.enter || e.keyCode === s.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.esc && (this.focusedIndex = -1, this.currentOpened = !1, this.dispatchPopupEvent(e, this.currentOpened)), this.computedOpened) {
196
+ const t = w(this.focusedIndex, e.keyCode, e.altKey, this.buttonsData.length);
197
+ this.focusedIndex = t;
198
+ const i = e.keyCode === s.up || e.keyCode === s.down || e.keyCode === s.left || e.keyCode === s.right;
199
+ !e.altKey && i && e.preventDefault();
196
200
  }
197
201
  },
198
- onFocus(t) {
202
+ onFocus(e) {
199
203
  this.focused || (this.focused = !0, this.$emit("focus", {
200
- event: t
204
+ event: e
201
205
  })), this.focusedIndex = this.computedOpened ? 0 : -1, clearTimeout(this._blurTimeout);
202
206
  },
203
- onBlur(t) {
204
- clearTimeout(this._blurTimeout), this.createBlurTimeout(t);
207
+ onBlur(e) {
208
+ clearTimeout(this._blurTimeout), this.createBlurTimeout(e);
205
209
  },
206
- createBlurTimeout(t) {
207
- const e = this;
210
+ createBlurTimeout(e) {
211
+ const t = this;
208
212
  this._blurTimeout = setTimeout(() => {
209
- D && document.activeElement !== e.$el && (e.focused = !1, e.focusedIndex = -1, e.$emit("blur", {
210
- event: t
211
- }), e.computedOpened && (e.currentOpened = !1, e.dispatchPopupEvent(t, !1)));
213
+ y && document.activeElement !== t.$el && (t.focused = !1, t.focusedIndex = -1, t.$emit("blur", {
214
+ event: e
215
+ }), t.computedOpened && (t.currentOpened = !1, t.dispatchPopupEvent(e, !1)));
212
216
  }, 200);
213
217
  },
214
- onItemClick(t, e) {
215
- this.focusedIndex = -1, this.currentOpened = !1, this.dispatchClickEvent(t, e), this.dispatchPopupEvent(t, !1);
218
+ onItemClick(e, t) {
219
+ this.focusedIndex = -1, this.currentOpened = !1, this.dispatchClickEvent(e, t), this.dispatchPopupEvent(e, !1);
216
220
  },
217
- onItemDown(t) {
218
- document.activeElement === this.element() && t.preventDefault();
221
+ onItemDown(e) {
222
+ document.activeElement === this.element() && e.preventDefault();
219
223
  },
220
- mouseDown(t) {
221
- t.preventDefault();
224
+ mouseDown(e) {
225
+ e.preventDefault();
222
226
  },
223
- dispatchClickEvent(t, e) {
224
- this.isItemDisabled(e) || this.$emit("itemclick", {
225
- event: t,
226
- item: this.buttonsData[e],
227
- itemIndex: e
227
+ dispatchClickEvent(e, t) {
228
+ this.isItemDisabled(t) || this.$emit("itemclick", {
229
+ event: e,
230
+ item: this.buttonsData[t],
231
+ itemIndex: t
228
232
  });
229
233
  },
230
- onClickMainButton(t) {
234
+ onClickMainButton(e) {
231
235
  if (!this.buttonsData.length)
232
236
  return;
233
- const e = !this.computedOpened;
234
- this.currentOpened = e, this.focused = !0, this.focusedIndex = e ? 0 : -1, this.dispatchPopupEvent(t, e);
237
+ const t = !this.computedOpened;
238
+ this.currentOpened = t, this.focused = !0, this.focusedIndex = t ? 0 : -1, this.dispatchPopupEvent(e, t);
235
239
  },
236
- dispatchPopupEvent(t, e) {
240
+ dispatchPopupEvent(e, t) {
237
241
  const i = {
238
- event: t
242
+ event: e
239
243
  };
240
- this.$emit(e ? "open" : "close", i);
244
+ this.$emit(t ? "open" : "close", i);
241
245
  },
242
- isItemDisabled(t) {
243
- return this.buttonsData[t] ? this.buttonsData[t].disabled : this.$props.disabled;
246
+ isItemDisabled(e) {
247
+ return this.buttonsData[e] ? this.buttonsData[e].disabled : this.$props.disabled;
244
248
  },
245
249
  isRtl() {
246
250
  return this.$props.dir !== void 0 ? this.$props.dir === "rtl" : !!this.$el && getComputedStyle(this.$el).direction === "rtl";
@@ -248,5 +252,5 @@ const j = /* @__PURE__ */ I({
248
252
  }
249
253
  });
250
254
  export {
251
- j as DropDownButton
255
+ U as DropDownButton
252
256
  };
@@ -69,14 +69,14 @@ declare const SplitButton: import('vue').DefineComponent<import('vue').ExtractPr
69
69
  disabled: PropType<boolean>;
70
70
  icon: PropType<string>;
71
71
  svgIcon: PropType<import('@progress/kendo-vue-common').SVGIcon>;
72
- size: PropType<"small" | "medium" | "large">;
72
+ size: PropType<"small" | "medium" | "xs" | "large">;
73
73
  rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
74
74
  fillMode: {
75
75
  type: PropType<"flat" | "link" | "solid" | "outline">;
76
76
  validator: (value: string) => boolean;
77
77
  };
78
78
  themeColor: {
79
- type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "dark" | "light" | "inverse">;
79
+ type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
80
80
  validator: (value: string) => boolean;
81
81
  };
82
82
  opened: {
@@ -138,14 +138,14 @@ declare const SplitButton: import('vue').DefineComponent<import('vue').ExtractPr
138
138
  disabled: PropType<boolean>;
139
139
  icon: PropType<string>;
140
140
  svgIcon: PropType<import('@progress/kendo-vue-common').SVGIcon>;
141
- size: PropType<"small" | "medium" | "large">;
141
+ size: PropType<"small" | "medium" | "xs" | "large">;
142
142
  rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
143
143
  fillMode: {
144
144
  type: PropType<"flat" | "link" | "solid" | "outline">;
145
145
  validator: (value: string) => boolean;
146
146
  };
147
147
  themeColor: {
148
- type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "dark" | "light" | "inverse">;
148
+ type: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "error" | "inverse">;
149
149
  validator: (value: string) => boolean;
150
150
  };
151
151
  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 o=require("vue"),l=require("../Button.js"),s=require("@progress/kendo-vue-common"),C=require("./ButtonItem.js"),$=require("./utils/navigation.js"),k=require("@progress/kendo-vue-popup"),h=require("./utils/popup.js"),O=require("@progress/kendo-svg-icons"),S=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=s.guid(),this.mainButton=null,this.guid=s.guid(),this.buttonsData=[],s.validatePackage(S.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:i,disabled:u}=this.$props,c=s.getDefaultSlots(this),f=function(){const{item:n,itemRender:p,textField:b}=this.$props,a=this.buttonsData.length;return a>0?this.buttonsData.map(function(d,r){const y=typeof d!="string"?{...d,render:s.templateRendering.call(this,d.render,s.getListeners.call(this))}:d;return o.createVNode(C.ButtonItem,{role:"menuitem",dataItem:y,textField:b,focused:this.focusedIndex===r,onClick:this.onItemClick,onDown:this.onItemDown,render:s.templateRendering.call(this,p,s.getListeners.call(this)),item:n,key:r,index:r,id:`${this.guid}-${r}`,first:r===0,last:r===a-1},null)},this):null},m=function(){const{popupSettings:n={},size:p}=this.$props;return o.createVNode(k.Popup,{anchor:this._anchor,show:this.computedOpened,animate:n.animate,popupClass:s.classNames("k-menu-popup",n.popupClass),anchorAlign:n.anchorAlign||h.getAnchorAlign(e),popupAlign:n.popupAlign||h.getPopupAlign(e),style:e?{direction:"rtl"}:void 0},{default:()=>[o.createVNode("ul",{class:"k-menu-group",role:"menu",id:this.guid},[f.call(this)])]})},g=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(l.Button,{size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,themeColor:this.$props.themeColor,onClick:n=>this.onItemClick(n,-1),disabled:u||void 0,tabIndex:i,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":u||void 0,"aria-label":this.$props.ariaLabel||(!this.$props.text&&!c&&(this.$props.svgIcon||this.$props.icon||this.$props.iconClass)?"Action":void 0)},g),o.createVNode(l.Button,{svgIcon:O.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:u||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),m.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}let t;if(e.keyCode===s.Keys.enter||e.keyCode===s.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===s.Keys.esc&&(t={focusedIndex:-1,currentOpened:!1},this.dispatchPopupEvent(e,t.currentOpened)),this.computedOpened){const i=$(this.focusedIndex,e.keyCode,e.altKey,this.buttonsData.length);i!==this.focusedIndex&&(t=t||{},t.focusedIndex=i);const u=e.keyCode===s.Keys.up||e.keyCode===s.Keys.down||e.keyCode===s.Keys.left||e.keyCode===s.Keys.right;!e.altKey&&u&&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 i=this.computedOpened;i&&(this.focusedIndex=0,this.currentOpened=!1),this.dispatchClickEvent(e,t),i&&this.dispatchPopupEvent(e,!1)},onBlur(e){clearTimeout(this._blurTimeout),this.createBlurTimeout(e)},createBlurTimeout(e){const t=this;this._blurTimeout=setTimeout(()=>{s.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 i={event:e};this.$emit(t?"open":"close",i)},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"),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,16 +5,16 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as y, createVNode as r, ref as O } from "vue";
9
- import { Button as a } from "../Button.mjs";
10
- import { canUseDOM as I, Keys as s, getDefaultSlots as S, guid as h, validatePackage as D, classNames as w, templateRendering as f, getListeners as m } from "@progress/kendo-vue-common";
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
11
  import { ButtonItem as x } from "./ButtonItem.mjs";
12
- import v from "./utils/navigation.mjs";
13
- import { Popup as P } from "@progress/kendo-vue-popup";
14
- import { getPopupAlign as B, getAnchorAlign as E } from "./utils/popup.mjs";
15
- import { chevronDownIcon as K } from "@progress/kendo-svg-icons";
16
- import { packageMetadata as A } from "../package-metadata.mjs";
17
- const L = /* @__PURE__ */ y({
12
+ import w from "./utils/navigation.mjs";
13
+ import { Popup as v } from "@progress/kendo-vue-popup";
14
+ import { getPopupAlign as P, getAnchorAlign as B } from "./utils/popup.mjs";
15
+ import { chevronDownIcon as E } from "@progress/kendo-svg-icons";
16
+ import { packageMetadata as K } from "../package-metadata.mjs";
17
+ const L = /* @__PURE__ */ k({
18
18
  name: "KendoSplitButton",
19
19
  emits: {
20
20
  focus: (t) => !0,
@@ -50,7 +50,7 @@ const L = /* @__PURE__ */ y({
50
50
  themeColor: {
51
51
  type: String,
52
52
  validator: function(t) {
53
- return ["base", "dark", "error", "info", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(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 L = /* @__PURE__ */ y({
74
74
  };
75
75
  },
76
76
  created() {
77
- this._blurTimeout = null, this._anchor = h(), this.mainButton = null, this.guid = h(), this.buttonsData = [], D(A);
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,79 +96,77 @@ const L = /* @__PURE__ */ y({
96
96
  },
97
97
  setup() {
98
98
  return {
99
- kendoAnchorRef: O(null)
99
+ kendoAnchorRef: y(null)
100
100
  };
101
101
  },
102
102
  render() {
103
103
  this.buttonsData = this.$props.items;
104
104
  const t = this.isRtl(), e = t ? "rtl" : void 0, {
105
105
  tabIndex: i,
106
- disabled: d
107
- } = this.$props, p = S(this), g = function() {
106
+ disabled: r
107
+ } = this.$props, p = I(this), m = function() {
108
108
  const {
109
109
  item: n,
110
110
  itemRender: c,
111
111
  textField: C
112
- } = this.$props, l = this.buttonsData.length;
113
- return l > 0 ? this.buttonsData.map(function(u, o) {
114
- const k = typeof u != "string" ? {
115
- ...u,
116
- render: f.call(this, u.render, m.call(this))
117
- } : u;
118
- return r(x, {
112
+ } = this.$props;
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, {
119
119
  role: "menuitem",
120
- dataItem: k,
120
+ dataItem: $,
121
121
  textField: C,
122
- focused: this.focusedIndex === o,
122
+ focused: this.focusedIndex === u,
123
123
  onClick: this.onItemClick,
124
124
  onDown: this.onItemDown,
125
- render: f.call(this, c, m.call(this)),
125
+ render: h.call(this, c, f.call(this)),
126
126
  item: n,
127
- key: o,
128
- index: o,
129
- id: `${this.guid}-${o}`,
130
- first: o === 0,
131
- last: o === l - 1
127
+ key: u,
128
+ index: u,
129
+ id: `${this.guid}-${u}`
132
130
  }, null);
133
131
  }, this) : null;
134
- }, b = function() {
132
+ }, g = function() {
135
133
  const {
136
134
  popupSettings: n = {},
137
135
  size: c
138
136
  } = this.$props;
139
- return r(P, {
137
+ return o(v, {
140
138
  anchor: this._anchor,
141
139
  show: this.computedOpened,
142
140
  animate: n.animate,
143
- popupClass: w("k-menu-popup", n.popupClass),
144
- anchorAlign: n.anchorAlign || E(t),
145
- popupAlign: n.popupAlign || B(t),
141
+ popupClass: D("k-menu-popup", n.popupClass),
142
+ anchorAlign: n.anchorAlign || B(t),
143
+ popupAlign: n.popupAlign || P(t),
146
144
  style: t ? {
147
145
  direction: "rtl"
148
146
  } : void 0
149
147
  }, {
150
- default: () => [r("ul", {
148
+ default: () => [o("ul", {
151
149
  class: "k-menu-group",
152
150
  role: "menu",
153
151
  id: this.guid
154
- }, [g.call(this)])]
152
+ }, [m.call(this)])]
155
153
  });
156
- }, $ = this.$props.text || p ? {
154
+ }, b = this.$props.text || p ? {
157
155
  default: () => [this.$props.text, p]
158
156
  } : {};
159
- return r("div", {
157
+ return o("div", {
160
158
  class: this.wrapperClass,
161
159
  onKeydown: this.onKeyDown,
162
160
  onFocusin: this.onFocus,
163
161
  onFocusout: this.onBlur,
164
162
  dir: e
165
- }, [r(a, {
163
+ }, [o(l, {
166
164
  size: this.$props.size,
167
165
  rounded: this.$props.rounded,
168
166
  fillMode: this.$props.fillMode,
169
167
  themeColor: this.$props.themeColor,
170
168
  onClick: (n) => this.onItemClick(n, -1),
171
- disabled: d || void 0,
169
+ disabled: r || void 0,
172
170
  tabIndex: i,
173
171
  accessKey: this.$props.accessKey,
174
172
  class: this.$props.buttonClass,
@@ -180,17 +178,17 @@ const L = /* @__PURE__ */ y({
180
178
  id: this._anchor,
181
179
  ref: this._anchor,
182
180
  type: "button",
183
- "aria-disabled": d || void 0,
181
+ "aria-disabled": r || void 0,
184
182
  "aria-label": this.$props.ariaLabel || (!this.$props.text && !p && (this.$props.svgIcon || this.$props.icon || this.$props.iconClass) ? "Action" : void 0)
185
- }, $), r(a, {
186
- svgIcon: K,
183
+ }, b), o(l, {
184
+ svgIcon: E,
187
185
  size: this.$props.size,
188
186
  rounded: this.$props.rounded,
189
187
  fillMode: this.$props.fillMode,
190
188
  themeColor: this.$props.themeColor,
191
189
  icon: "chevron-down",
192
190
  class: "k-split-button-arrow",
193
- disabled: d || void 0,
191
+ disabled: r || void 0,
194
192
  tabIndex: -1,
195
193
  onClick: this.onSplitPartClick,
196
194
  onMousedown: this.onDownSplitPart,
@@ -199,7 +197,7 @@ const L = /* @__PURE__ */ y({
199
197
  "aria-label": "Toggle dropdown",
200
198
  "aria-expanded": this.computedOpened,
201
199
  "aria-controls": this.computedOpened ? this.guid : void 0
202
- }, null), b.call(this)]);
200
+ }, null), g.call(this)]);
203
201
  },
204
202
  methods: {
205
203
  element() {
@@ -218,10 +216,10 @@ const L = /* @__PURE__ */ y({
218
216
  focusedIndex: -1,
219
217
  currentOpened: !1
220
218
  }, this.dispatchPopupEvent(t, e.currentOpened)), this.computedOpened) {
221
- const i = v(this.focusedIndex, t.keyCode, t.altKey, this.buttonsData.length);
219
+ const i = w(this.focusedIndex, t.keyCode, t.altKey, this.buttonsData.length);
222
220
  i !== this.focusedIndex && (e = e || {}, e.focusedIndex = i);
223
- const d = t.keyCode === s.up || t.keyCode === s.down || t.keyCode === s.left || t.keyCode === s.right;
224
- !t.altKey && d && t.preventDefault();
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();
225
223
  }
226
224
  e && (this.focusedIndex = e.focusedIndex, this.focused = e.focused, e.currentOpened !== void 0 && (this.currentOpened = e.currentOpened));
227
225
  },
@@ -240,7 +238,7 @@ const L = /* @__PURE__ */ y({
240
238
  createBlurTimeout(t) {
241
239
  const e = this;
242
240
  this._blurTimeout = setTimeout(() => {
243
- I && document.activeElement !== e.mainButton && (e.focused = !1, e.focusedIndex = -1, e.$emit("blur", {
241
+ O && document.activeElement !== e.mainButton && (e.focused = !1, e.focusedIndex = -1, e.$emit("blur", {
244
242
  event: t
245
243
  }), e.computedOpened && (e.currentOpened = !1, e.dispatchPopupEvent(t, !1)));
246
244
  }, 200);