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