@progress/kendo-vue-buttons 8.4.0-develop.1 → 8.4.0-develop.3

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.
@@ -5,24 +5,24 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as C, createVNode as o, ref as k } from "vue";
8
+ import { defineComponent as y, createVNode as r, ref as O } from "vue";
9
9
  import { Button as a } from "../Button.mjs";
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
- import { ButtonItem as D } from "./ButtonItem.mjs";
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 { caretAltDownIcon as E } from "@progress/kendo-svg-icons";
16
- import { packageMetadata as K } from "../package-metadata.mjs";
17
- const N = /* @__PURE__ */ C({
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";
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({
18
18
  name: "KendoSplitButton",
19
19
  emits: {
20
- focus: (e) => !0,
21
- blur: (e) => !0,
22
- buttonclick: (e) => !0,
23
- itemclick: (e) => !0,
24
- open: (e) => !0,
25
- close: (e) => !0
20
+ focus: (t) => !0,
21
+ blur: (t) => !0,
22
+ buttonclick: (t) => !0,
23
+ itemclick: (t) => !0,
24
+ open: (t) => !0,
25
+ close: (t) => !0
26
26
  },
27
27
  props: {
28
28
  accessKey: String,
@@ -43,14 +43,14 @@ const N = /* @__PURE__ */ C({
43
43
  rounded: String,
44
44
  fillMode: {
45
45
  type: String,
46
- validator: function(e) {
47
- return ["flat", "link", "outline", "solid"].includes(e);
46
+ validator: function(t) {
47
+ return ["flat", "link", "outline", "solid"].includes(t);
48
48
  }
49
49
  },
50
50
  themeColor: {
51
51
  type: String,
52
- validator: function(e) {
53
- return ["base", "dark", "error", "info", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(e);
52
+ validator: function(t) {
53
+ return ["base", "dark", "error", "info", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning"].includes(t);
54
54
  }
55
55
  },
56
56
  opened: {
@@ -74,7 +74,7 @@ const N = /* @__PURE__ */ C({
74
74
  };
75
75
  },
76
76
  created() {
77
- this._blurTimeout = null, this._anchor = c(), this.mainButton = null, this.guid = c(), this.buttonsData = [], O(K);
77
+ this._blurTimeout = null, this._anchor = h(), this.mainButton = null, this.guid = h(), this.buttonsData = [], D(A);
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,77 +96,79 @@ const N = /* @__PURE__ */ C({
96
96
  },
97
97
  setup() {
98
98
  return {
99
- kendoAnchorRef: k(null)
99
+ kendoAnchorRef: O(null)
100
100
  };
101
101
  },
102
102
  render() {
103
103
  this.buttonsData = this.$props.items;
104
- const e = this.isRtl(), t = e ? "rtl" : void 0, {
104
+ const t = this.isRtl(), e = t ? "rtl" : void 0, {
105
105
  tabIndex: i,
106
- disabled: r
107
- } = this.$props, f = I(this), m = function() {
106
+ disabled: d
107
+ } = this.$props, p = S(this), g = function() {
108
108
  const {
109
109
  item: n,
110
- itemRender: d,
111
- textField: b
112
- } = this.$props;
113
- return this.buttonsData.length > 0 ? this.buttonsData.map(function(u, p) {
114
- const $ = typeof u != "string" ? {
110
+ itemRender: c,
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
115
  ...u,
116
- render: l.call(this, u.render, h.call(this))
116
+ render: f.call(this, u.render, m.call(this))
117
117
  } : u;
118
- return o(D, {
119
- class: "k-menu-item",
118
+ return r(x, {
120
119
  role: "menuitem",
121
- dataItem: $,
122
- textField: b,
123
- focused: this.focusedIndex === p,
120
+ dataItem: k,
121
+ textField: C,
122
+ focused: this.focusedIndex === o,
124
123
  onClick: this.onItemClick,
125
124
  onDown: this.onItemDown,
126
- render: l.call(this, d, h.call(this)),
125
+ render: f.call(this, c, m.call(this)),
127
126
  item: n,
128
- key: p,
129
- index: p,
130
- id: `${this.guid}-${p}`
127
+ key: o,
128
+ index: o,
129
+ id: `${this.guid}-${o}`,
130
+ first: o === 0,
131
+ last: o === l - 1
131
132
  }, null);
132
133
  }, this) : null;
133
- }, g = function() {
134
+ }, b = function() {
134
135
  const {
135
136
  popupSettings: n = {},
136
- size: d
137
+ size: c
137
138
  } = this.$props;
138
- return o(v, {
139
+ return r(P, {
139
140
  anchor: this._anchor,
140
141
  show: this.computedOpened,
141
142
  animate: n.animate,
142
- popupClass: S("k-menu-popup", n.popupClass),
143
- anchorAlign: n.anchorAlign || B(e),
144
- popupAlign: n.popupAlign || P(e),
145
- style: e ? {
143
+ popupClass: w("k-menu-popup", n.popupClass),
144
+ anchorAlign: n.anchorAlign || E(t),
145
+ popupAlign: n.popupAlign || B(t),
146
+ style: t ? {
146
147
  direction: "rtl"
147
148
  } : void 0
148
149
  }, {
149
- default: () => [o("ul", {
150
- class: `k-group k-menu-group k-reset k-menu-group-${x.sizeMap[d] || d}`,
150
+ default: () => [r("ul", {
151
+ class: "k-menu-group",
151
152
  role: "menu",
152
- id: this.guid,
153
- "aria-labelledby": this._anchor
154
- }, [m.call(this)])]
153
+ id: this.guid
154
+ }, [g.call(this)])]
155
155
  });
156
- };
157
- return o("div", {
156
+ }, $ = this.$props.text || p ? {
157
+ default: () => [this.$props.text, p]
158
+ } : {};
159
+ return r("div", {
158
160
  class: this.wrapperClass,
159
161
  onKeydown: this.onKeyDown,
160
162
  onFocusin: this.onFocus,
161
163
  onFocusout: this.onBlur,
162
- dir: t
163
- }, [o(a, {
164
+ dir: e
165
+ }, [r(a, {
164
166
  size: this.$props.size,
165
167
  rounded: this.$props.rounded,
166
168
  fillMode: this.$props.fillMode,
167
169
  themeColor: this.$props.themeColor,
168
170
  onClick: (n) => this.onItemClick(n, -1),
169
- disabled: r || void 0,
171
+ disabled: d || void 0,
170
172
  tabIndex: i,
171
173
  accessKey: this.$props.accessKey,
172
174
  class: this.$props.buttonClass,
@@ -174,108 +176,105 @@ const N = /* @__PURE__ */ C({
174
176
  svgIcon: this.$props.svgIcon,
175
177
  iconClass: this.$props.iconClass,
176
178
  imageUrl: this.$props.imageUrl,
177
- dir: t,
179
+ dir: e,
178
180
  id: this._anchor,
179
181
  ref: this._anchor,
180
182
  type: "button",
181
- "aria-disabled": r,
182
- "aria-haspopup": "menu",
183
- "aria-expanded": this.computedOpened,
184
- "aria-label": this.$props.ariaLabel || `${this.$props.text || ""} splitbutton`,
185
- "aria-controls": this.guid,
186
- "aria-activedescendant": this.focusedIndex !== void 0 && this.focusedIndex >= 0 ? `${this.guid}-${this.focusedIndex}` : void 0
187
- }, {
188
- default: () => [this.$props.text, f]
189
- }), o(a, {
190
- svgIcon: E,
183
+ "aria-disabled": d || void 0,
184
+ "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,
191
187
  size: this.$props.size,
192
188
  rounded: this.$props.rounded,
193
189
  fillMode: this.$props.fillMode,
194
190
  themeColor: this.$props.themeColor,
195
- icon: "caret-alt-down",
196
- disabled: r || void 0,
191
+ icon: "chevron-down",
192
+ class: "k-split-button-arrow",
193
+ disabled: d || void 0,
197
194
  tabIndex: -1,
198
195
  onClick: this.onSplitPartClick,
199
196
  onMousedown: this.onDownSplitPart,
200
197
  onPointerdown: this.onDownSplitPart,
201
- dir: t,
202
- "aria-label": "menu toggling button"
203
- }, null), g.call(this)]);
198
+ dir: e,
199
+ "aria-label": "Toggle dropdown",
200
+ "aria-expanded": this.computedOpened,
201
+ "aria-controls": this.computedOpened ? this.guid : void 0
202
+ }, null), b.call(this)]);
204
203
  },
205
204
  methods: {
206
205
  element() {
207
206
  return this.mainButton;
208
207
  },
209
- onKeyDown(e) {
210
- if (e.altKey) {
211
- !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);
208
+ onKeyDown(t) {
209
+ if (t.altKey) {
210
+ !this.computedOpened && t.keyCode === s.down ? (this.dispatchPopupEvent(t, !0), this.focusedIndex = 0, this.currentOpened = !0) : this.computedOpened && t.keyCode === s.up && (this.dispatchPopupEvent(t, !1), this.focusedIndex = -1, this.currentOpened = !1);
212
211
  return;
213
212
  }
214
- let t;
215
- if (e.keyCode === s.enter || e.keyCode === s.space ? (e.preventDefault(), this.dispatchClickEvent(e, this.focusedIndex), this.focusedIndex !== void 0 && this.focusedIndex >= 0 && (t = {
213
+ let e;
214
+ if (t.keyCode === s.enter || t.keyCode === s.space ? (t.preventDefault(), this.dispatchClickEvent(t, this.focusedIndex), this.focusedIndex !== void 0 && this.focusedIndex >= 0 && (e = {
216
215
  focusedIndex: this.computedOpened ? -1 : 0,
217
216
  currentOpened: !this.computedOpened
218
- }, this.dispatchPopupEvent(e, t.currentOpened))) : this.computedOpened && e.keyCode === s.esc && (t = {
217
+ }, this.dispatchPopupEvent(t, e.currentOpened))) : this.computedOpened && t.keyCode === s.esc && (e = {
219
218
  focusedIndex: -1,
220
219
  currentOpened: !1
221
- }, this.dispatchPopupEvent(e, t.currentOpened)), this.computedOpened) {
222
- const i = w(this.focusedIndex, e.keyCode, e.altKey, this.buttonsData.length);
223
- i !== this.focusedIndex && (t = t || {}, t.focusedIndex = i);
224
- const r = e.keyCode === s.up || e.keyCode === s.down || e.keyCode === s.left || e.keyCode === s.right;
225
- !e.altKey && r && e.preventDefault();
220
+ }, this.dispatchPopupEvent(t, e.currentOpened)), this.computedOpened) {
221
+ const i = v(this.focusedIndex, t.keyCode, t.altKey, this.buttonsData.length);
222
+ 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();
226
225
  }
227
- t && (this.focusedIndex = t.focusedIndex, this.focused = t.focused, t.currentOpened !== void 0 && (this.currentOpened = t.currentOpened));
226
+ e && (this.focusedIndex = e.focusedIndex, this.focused = e.focused, e.currentOpened !== void 0 && (this.currentOpened = e.currentOpened));
228
227
  },
229
- onFocus(e) {
228
+ onFocus(t) {
230
229
  this.focused || (this.$emit("focus", {
231
- event: e
230
+ event: t
232
231
  }), this.focused = !0), this.focusedIndex = -1, clearTimeout(this._blurTimeout);
233
232
  },
234
- onItemClick(e, t) {
233
+ onItemClick(t, e) {
235
234
  const i = this.computedOpened;
236
- i && (this.focusedIndex = 0, this.currentOpened = !1), this.dispatchClickEvent(e, t), i && this.dispatchPopupEvent(e, !1);
235
+ i && (this.focusedIndex = 0, this.currentOpened = !1), this.dispatchClickEvent(t, e), i && this.dispatchPopupEvent(t, !1);
237
236
  },
238
- onBlur(e) {
239
- clearTimeout(this._blurTimeout), this.createBlurTimeout(e);
237
+ onBlur(t) {
238
+ clearTimeout(this._blurTimeout), this.createBlurTimeout(t);
240
239
  },
241
- createBlurTimeout(e) {
242
- const t = this;
240
+ createBlurTimeout(t) {
241
+ const e = this;
243
242
  this._blurTimeout = setTimeout(() => {
244
- y && document.activeElement !== t.mainButton && (t.focused = !1, t.focusedIndex = -1, t.$emit("blur", {
245
- event: e
246
- }), t.computedOpened && (t.currentOpened = !1, t.dispatchPopupEvent(e, !1)));
243
+ I && document.activeElement !== e.mainButton && (e.focused = !1, e.focusedIndex = -1, e.$emit("blur", {
244
+ event: t
245
+ }), e.computedOpened && (e.currentOpened = !1, e.dispatchPopupEvent(t, !1)));
247
246
  }, 200);
248
247
  },
249
- dispatchClickEvent(e, t) {
250
- this.isItemDisabled(t) || (t === -1 ? this.$emit("buttonclick", {
251
- event: e
248
+ dispatchClickEvent(t, e) {
249
+ this.isItemDisabled(e) || (e === -1 ? this.$emit("buttonclick", {
250
+ event: t
252
251
  }) : this.$emit("itemclick", {
253
- event: e,
252
+ event: t,
254
253
  component: this,
255
- item: this.buttonsData[t],
256
- itemIndex: t
254
+ item: this.buttonsData[e],
255
+ itemIndex: e
257
256
  }));
258
257
  },
259
- onSplitPartClick(e) {
258
+ onSplitPartClick(t) {
260
259
  if (this.buttonsData.length) {
261
- const t = !this.computedOpened;
262
- this.dispatchPopupEvent(e, t), this.focusedIndex = t ? 0 : -1, this.currentOpened = t, this.focused = !0;
260
+ const e = !this.computedOpened;
261
+ this.dispatchPopupEvent(t, e), this.focusedIndex = e ? 0 : -1, this.currentOpened = e, this.focused = !0;
263
262
  }
264
263
  },
265
- onDownSplitPart(e) {
266
- e.preventDefault(), this.element() && document.activeElement !== this.element() && this.element().focus();
264
+ onDownSplitPart(t) {
265
+ t.preventDefault(), this.element() && document.activeElement !== this.element() && this.element().focus();
267
266
  },
268
- onItemDown(e) {
269
- document.activeElement === this.element() && e.preventDefault();
267
+ onItemDown(t) {
268
+ document.activeElement === this.element() && t.preventDefault();
270
269
  },
271
- dispatchPopupEvent(e, t) {
270
+ dispatchPopupEvent(t, e) {
272
271
  const i = {
273
- event: e
272
+ event: t
274
273
  };
275
- this.$emit(t ? "open" : "close", i);
274
+ this.$emit(e ? "open" : "close", i);
276
275
  },
277
- isItemDisabled(e) {
278
- return this.buttonsData[e] ? this.buttonsData[e].disabled : this.$props.disabled;
276
+ isItemDisabled(t) {
277
+ return this.buttonsData[t] ? this.buttonsData[t].disabled : this.$props.disabled;
279
278
  },
280
279
  isRtl() {
281
280
  return this.$props.dir !== void 0 ? this.$props.dir === "rtl" : !!this.$el && getComputedStyle(this.$el).direction === "rtl";
@@ -283,5 +282,5 @@ const N = /* @__PURE__ */ C({
283
282
  }
284
283
  });
285
284
  export {
286
- N as SplitButton
285
+ L as SplitButton
287
286
  };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * @hidden
10
+ */
11
+ export declare const splitButtonToggleDropdown = "splitButton.toggleDropdown";
12
+ /**
13
+ * @hidden
14
+ */
15
+ export declare const messages: {
16
+ "splitButton.toggleDropdown": string;
17
+ };
@@ -19,7 +19,7 @@ declare const SegmentedControl: import('vue').DefineComponent<import('vue').Extr
19
19
  type: PropType<SegmentedItemProps[]>;
20
20
  default: () => any[];
21
21
  };
22
- size: PropType<"small" | "medium" | "large">;
22
+ size: PropType<"small" | "medium" | "xsmall" | "large">;
23
23
  layoutMode: {
24
24
  type: PropType<"stretch" | "compact">;
25
25
  default: string;
@@ -49,7 +49,7 @@ declare const SegmentedControl: import('vue').DefineComponent<import('vue').Extr
49
49
  type: PropType<SegmentedItemProps[]>;
50
50
  default: () => any[];
51
51
  };
52
- size: PropType<"small" | "medium" | "large">;
52
+ size: PropType<"small" | "medium" | "xsmall" | "large">;
53
53
  layoutMode: {
54
54
  type: PropType<"stretch" | "compact">;
55
55
  default: string;
@@ -25,7 +25,7 @@ declare const SmartPasteButton: import('vue').DefineComponent<import('vue').Extr
25
25
  default: string;
26
26
  };
27
27
  size: {
28
- type: PropType<"small" | "medium" | "large">;
28
+ type: PropType<"small" | "medium" | "xsmall" | "large">;
29
29
  default: string;
30
30
  };
31
31
  svgIcon: {
@@ -81,7 +81,7 @@ declare const SmartPasteButton: import('vue').DefineComponent<import('vue').Extr
81
81
  default: string;
82
82
  };
83
83
  size: {
84
- type: PropType<"small" | "medium" | "large">;
84
+ type: PropType<"small" | "medium" | "xsmall" | "large">;
85
85
  default: string;
86
86
  };
87
87
  svgIcon: {
@@ -118,7 +118,7 @@ declare const SmartPasteButton: import('vue').DefineComponent<import('vue').Extr
118
118
  onClick?: (event: SmartPasteClickEvent) => any;
119
119
  }>, {
120
120
  type: string;
121
- size: "small" | "medium" | "large";
121
+ size: "small" | "medium" | "xsmall" | "large";
122
122
  rounded: "small" | "medium" | "large" | "full" | "none";
123
123
  selected: boolean;
124
124
  disabled: boolean;
@@ -157,7 +157,7 @@ declare const SpeechToTextButton: import('vue').DefineComponent<import('vue').Ex
157
157
  type: PropType<boolean>;
158
158
  default: any;
159
159
  };
160
- size: PropType<"small" | "medium" | "large">;
160
+ size: PropType<"small" | "medium" | "xsmall" | "large">;
161
161
  rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
162
162
  fillMode: PropType<"flat" | "link" | "solid" | "outline">;
163
163
  themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "dark" | "light" | "inverse">;
@@ -216,7 +216,7 @@ declare const SpeechToTextButton: import('vue').DefineComponent<import('vue').Ex
216
216
  type: PropType<boolean>;
217
217
  default: any;
218
218
  };
219
- size: PropType<"small" | "medium" | "large">;
219
+ size: PropType<"small" | "medium" | "xsmall" | "large">;
220
220
  rounded: PropType<"small" | "medium" | "large" | "full" | "none">;
221
221
  fillMode: PropType<"flat" | "link" | "solid" | "outline">;
222
222
  themeColor: PropType<"base" | "primary" | "secondary" | "tertiary" | "info" | "success" | "warning" | "dark" | "light" | "inverse">;