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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +16 -18
  5. package/FloatingActionButton/FloatingActionButton.d.ts +3 -5
  6. package/FloatingActionButton/FloatingActionButton.js +1 -1
  7. package/FloatingActionButton/FloatingActionButton.mjs +60 -56
  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,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;
@@ -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;