@progress/kendo-react-buttons 11.4.0-develop.5 → 11.4.0-develop.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +56 -56
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +20 -20
- package/SpeechToTextButton/SpeechToTextButton.js +1 -1
- package/SpeechToTextButton/SpeechToTextButton.mjs +79 -79
- package/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +6 -6
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),i=require("prop-types"),M=require("../Button.js"),e=require("@progress/kendo-react-common"),R=require("./utils/navigation.js"),A=require("./DropDownButtonItem.js"),T=require("./ButtonItem.js"),q=require("@progress/kendo-react-popup"),m=require("./utils/popup.js"),f=require("../package-metadata.js");function L(d){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const t in d)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(d,t);Object.defineProperty(o,t,s.get?s:{enumerable:!0,get:()=>d[t]})}}return o.default=d,Object.freeze(o)}const u=L(N),j=12e3,z=2e3,l=class l extends u.Component{constructor(o){super(o),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!1,this.showLicenseWatermark=!1,this.buttonsData=[],this.onKeyDown=t=>{const{focusedIndex:s}=this.state;if(t.altKey){!this.opened&&t.keyCode===e.Keys.down?(t.preventDefault(),this.setOpen(!0,t),this.setState({focusedIndex:0})):this.opened&&t.keyCode===e.Keys.up&&(t.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,t));return}const n={...this.state};if(t.keyCode===e.Keys.enter||t.keyCode===e.Keys.space){t.preventDefault(),s>=0&&this.dispatchClickEvent(t,s);const a=!this.opened;this.setState({focused:!0,focusedIndex:a?0:-1}),this.setOpen(a,t);return}if(this.opened&&t.keyCode===e.Keys.esc){this.setState({focusedIndex:-1}),this.setOpen(!1,t);return}if(this.opened){const a=R.navigate(s,t.keyCode,t.altKey,this.buttonsData.length);n.focusedIndex=a;const p=t.keyCode===e.Keys.up||t.keyCode===e.Keys.down||t.keyCode===e.Keys.left||t.keyCode===e.Keys.right;!t.altKey&&(p||t.keyCode===e.Keys.home||t.keyCode===e.Keys.end)&&t.preventDefault()}this.setState(n)},this.switchFocus=t=>{this.skipFocus=!0,t(),window.setTimeout(()=>this.skipFocus=!1,0)},this.handleFocus=t=>{this.skipFocus||(this.setState({focused:!0,focusedIndex:this.opened?0:-1}),e.dispatchEvent(this.props.onFocus,t,this,void 0))},this.handleButtonBlur=t=>{this.opened||(this.setState({focused:!1}),e.dispatchEvent(this.props.onBlur,t,this,void 0))},this.handleMenuBlur=t=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),e.dispatchEvent(this.props.onBlur,t,this,void 0),setTimeout(()=>{this.setOpen(!1,t)},0))},this.setOpen=(t,s)=>{this.opened!==t&&(this.openedDuringOnChange=t,this.setState({opened:t}),s?this.dispatchPopupEvent(s,t):this.openedDuringOnChange=void 0)},this.onItemClick=(t,s)=>{this.setState({focusedIndex:-1}),this.dispatchClickEvent(t,s),this.setOpen(!1,t)},this.onItemDown=t=>{e.getActiveElement(document)===this.list&&t.preventDefault()},this.mouseDown=t=>{t.preventDefault();const s=e.getActiveElement(document);this.element&&s!==this.element&&s!==this.list&&this.element.focus()},this.onPopupClose=t=>{var n;const s=e.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||(n=this.list)!=null&&n.contains(s))&&this.switchFocus(()=>{this.element&&this.element.focus({preventScroll:!0})}),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,t)},this.listRef=t=>{this.list=t,t&&this.state.focused&&this.switchFocus(()=>{t.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)})},this.onClickMainButton=t=>{if(!this.buttonsData.length)return;const s=!this.opened;this.setState({focused:!0,focusedIndex:s?0:-1}),this.setOpen(s,t)},this.dispatchPopupEvent=(t,s)=>{e.dispatchEvent(s?this.props.onOpen:this.props.onClose,t,this,void 0),this.openedDuringOnChange=void 0},this.showLicenseWatermark=!e.validatePackage(f.packageMetadata,{component:"DropDownButton"}),this.licenseMessage=e.getLicenseMessage(f.packageMetadata)}get guid(){return this.props.id+"-accessibility-id"}get opened(){return this.openedDuringOnChange!==void 0?this.openedDuringOnChange:this.props.opened===void 0?this.state.opened:this.props.opened}render(){const o=this.isRtl(),t=this.props.unstyled&&this.props.unstyled.uDropDownButton,s=o?"rtl":void 0,{id:n,style:a,tabIndex:p,disabled:r,size:y,rounded:C,fillMode:w,themeColor:k,ariaLabel:I,title:b,accessKey:B,icon:O,svgIcon:E,iconClass:v,buttonClass:S,className:x,imageUrl:P,startIcon:K,endIcon:F}=this.props;return this.buttonsData=this.props.items||u.Children.toArray(this.props.children).filter(c=>c&&c.type===A.DropDownButtonItem).map(c=>c.props),u.createElement(u.Fragment,null,u.createElement(M.Button,{id:n,size:y,style:a,rounded:C,fillMode:w,themeColor:k,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":r?"true":void 0,tabIndex:p,accessKey:B,icon:O,svgIcon:E,iconClass:v,className:e.classNames(S,x,e.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:r})),imageUrl:P,dir:s,ref:c=>{this.mainButton=(c==null?void 0:c.element)||null},type:"button","aria-expanded":this.opened?"true":"false","aria-label":I,"aria-controls":this.opened?this.guid:void 0,title:b,startIcon:K,endIcon:F},this.props.text),this.showLicenseWatermark&&u.createElement(e.WatermarkOverlay,{message:this.licenseMessage}),this.renderPopup(o))}componentDidMount(){(this.props.dir===void 0&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(o,t){this.isItemDisabled(t)||e.dispatchEvent(this.props.onItemClick,o,this,{item:this.buttonsData[t],itemIndex:t})}renderPopup(o){const{popupSettings:t={},_zIndex:s,unstyled:n}=this.props,a=s?s+z:j,p=n&&n.uDropDownButton,{focusedIndex:r}=this.state;return u.createElement(e.ZIndexContext.Provider,{value:a},u.createElement(q.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:e.classNames(e.uDropDownButton.popup({c:p}),t.popupClass),anchorAlign:t.anchorAlign||m.getAnchorAlign(o),popupAlign:t.popupAlign||m.getPopupAlign(o),style:o?{direction:"rtl"}:void 0,onClose:this.onPopupClose},u.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":r>=0?`${this.guid}-${r}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:e.classNames(e.uDropDownButton.ul({c:p,size:this.props.size}))},this.renderChildItems())))}renderChildItems(){const{item:o,itemRender:t,textField:s,unstyled:n}=this.props,a=n&&n.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map((p,r)=>u.createElement(T.ButtonItem,{className:e.classNames(e.uDropDownButton.item({c:a}),p.className,{"k-first":r===0},{"k-last":r===this.buttonsData.length-1}),dataItem:p,textField:s,focused:this.state.focusedIndex===r,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:o,index:r,key:r,id:`${this.guid}-${r}`})):null}isItemDisabled(o){return this.buttonsData[o]?this.buttonsData[o].disabled:this.props.disabled}isRtl(){return this.props.dir!==void 0?this.props.dir==="rtl":!!this.mainButton&&getComputedStyle(this.mainButton).direction==="rtl"}};l.propTypes={accessKey:i.string,ariaLabel:i.string,title:i.string,onFocus:i.func,onBlur:i.func,onItemClick:i.func,onOpen:i.func,onClose:i.func,items:i.arrayOf(i.any),textField:i.string,tabIndex:i.number,disabled:i.bool,icon:i.string,svgIcon:e.svgIconPropType,iconClass:i.string,imageUrl:i.string,popupSettings:i.object,itemRender:i.func,item:i.func,className:i.string,buttonClass:i.string,dir:i.string},l.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let h=l;const g=e.createPropsContext(),D=e.withIdHOC(e.withPropsContext(g,e.withUnstyledHOC(e.withZIndexContext(h))));D.displayName="KendoReactDropDownButton";exports.DropDownButton=D;exports.DropDownButtonPropsContext=g;exports.DropDownButtonWithoutContext=h;
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as p from "react";
|
|
9
9
|
import s from "prop-types";
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Keys as r, dispatchEvent as l, getActiveElement as f, validatePackage as
|
|
12
|
-
import { navigate as
|
|
13
|
-
import { DropDownButtonItem as
|
|
14
|
-
import { ButtonItem as
|
|
15
|
-
import { Popup as
|
|
16
|
-
import { getAnchorAlign as
|
|
17
|
-
import { packageMetadata as
|
|
18
|
-
const
|
|
10
|
+
import { Button as K } from "../Button.mjs";
|
|
11
|
+
import { Keys as r, dispatchEvent as l, getActiveElement as f, validatePackage as M, getLicenseMessage as A, svgIconPropType as R, classNames as u, uDropDownButton as c, WatermarkOverlay as T, ZIndexContext as L, createPropsContext as z, withIdHOC as U, withPropsContext as Z, withUnstyledHOC as $, withZIndexContext as W } from "@progress/kendo-react-common";
|
|
12
|
+
import { navigate as _ } from "./utils/navigation.mjs";
|
|
13
|
+
import { DropDownButtonItem as H } from "./DropDownButtonItem.mjs";
|
|
14
|
+
import { ButtonItem as X } from "./ButtonItem.mjs";
|
|
15
|
+
import { Popup as j } from "@progress/kendo-react-popup";
|
|
16
|
+
import { getAnchorAlign as q, getPopupAlign as G } from "./utils/popup.mjs";
|
|
17
|
+
import { packageMetadata as C } from "../package-metadata.mjs";
|
|
18
|
+
const J = 12e3, Q = 2e3, m = class m extends p.Component {
|
|
19
19
|
constructor(i) {
|
|
20
20
|
super(i), this.state = {
|
|
21
21
|
opened: !1,
|
|
@@ -42,7 +42,7 @@ const G = 12e3, J = 2e3, m = class m extends p.Component {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
if (this.opened) {
|
|
45
|
-
const a =
|
|
45
|
+
const a = _(e, t.keyCode, t.altKey, this.buttonsData.length);
|
|
46
46
|
o.focusedIndex = a;
|
|
47
47
|
const h = t.keyCode === r.up || t.keyCode === r.down || t.keyCode === r.left || t.keyCode === r.right;
|
|
48
48
|
!t.altKey && (h || t.keyCode === r.home || t.keyCode === r.end) && t.preventDefault();
|
|
@@ -88,7 +88,7 @@ const G = 12e3, J = 2e3, m = class m extends p.Component {
|
|
|
88
88
|
}), this.setOpen(e, t);
|
|
89
89
|
}, this.dispatchPopupEvent = (t, e) => {
|
|
90
90
|
l(e ? this.props.onOpen : this.props.onClose, t, this, void 0), this.openedDuringOnChange = void 0;
|
|
91
|
-
}, this.showLicenseWatermark = !
|
|
91
|
+
}, this.showLicenseWatermark = !M(C, { component: "DropDownButton" }), this.licenseMessage = A(C);
|
|
92
92
|
}
|
|
93
93
|
get guid() {
|
|
94
94
|
return this.props.id + "-accessibility-id";
|
|
@@ -105,31 +105,31 @@ const G = 12e3, J = 2e3, m = class m extends p.Component {
|
|
|
105
105
|
style: a,
|
|
106
106
|
tabIndex: h,
|
|
107
107
|
disabled: n,
|
|
108
|
-
size:
|
|
109
|
-
rounded:
|
|
110
|
-
fillMode:
|
|
111
|
-
themeColor:
|
|
112
|
-
ariaLabel:
|
|
108
|
+
size: D,
|
|
109
|
+
rounded: y,
|
|
110
|
+
fillMode: I,
|
|
111
|
+
themeColor: k,
|
|
112
|
+
ariaLabel: w,
|
|
113
113
|
title: b,
|
|
114
|
-
accessKey:
|
|
115
|
-
icon:
|
|
116
|
-
svgIcon:
|
|
117
|
-
iconClass:
|
|
118
|
-
buttonClass:
|
|
119
|
-
className:
|
|
120
|
-
imageUrl:
|
|
121
|
-
startIcon:
|
|
122
|
-
endIcon:
|
|
114
|
+
accessKey: B,
|
|
115
|
+
icon: O,
|
|
116
|
+
svgIcon: x,
|
|
117
|
+
iconClass: E,
|
|
118
|
+
buttonClass: S,
|
|
119
|
+
className: P,
|
|
120
|
+
imageUrl: F,
|
|
121
|
+
startIcon: v,
|
|
122
|
+
endIcon: N
|
|
123
123
|
} = this.props;
|
|
124
|
-
return this.buttonsData = this.props.items || p.Children.toArray(this.props.children).filter((d) => d && d.type ===
|
|
125
|
-
|
|
124
|
+
return this.buttonsData = this.props.items || p.Children.toArray(this.props.children).filter((d) => d && d.type === H).map((d) => d.props), /* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement(
|
|
125
|
+
K,
|
|
126
126
|
{
|
|
127
127
|
id: o,
|
|
128
|
-
size:
|
|
128
|
+
size: D,
|
|
129
129
|
style: a,
|
|
130
|
-
rounded:
|
|
131
|
-
fillMode:
|
|
132
|
-
themeColor:
|
|
130
|
+
rounded: y,
|
|
131
|
+
fillMode: I,
|
|
132
|
+
themeColor: k,
|
|
133
133
|
onClick: this.onClickMainButton,
|
|
134
134
|
onMouseDown: this.mouseDown,
|
|
135
135
|
onKeyDown: this.onKeyDown,
|
|
@@ -137,34 +137,34 @@ const G = 12e3, J = 2e3, m = class m extends p.Component {
|
|
|
137
137
|
onBlur: this.handleButtonBlur,
|
|
138
138
|
"aria-disabled": n ? "true" : void 0,
|
|
139
139
|
tabIndex: h,
|
|
140
|
-
accessKey:
|
|
141
|
-
icon:
|
|
142
|
-
svgIcon:
|
|
143
|
-
iconClass:
|
|
140
|
+
accessKey: B,
|
|
141
|
+
icon: O,
|
|
142
|
+
svgIcon: x,
|
|
143
|
+
iconClass: E,
|
|
144
144
|
className: u(
|
|
145
|
-
E,
|
|
146
145
|
S,
|
|
146
|
+
P,
|
|
147
147
|
c.wrapper({
|
|
148
148
|
c: t,
|
|
149
149
|
focused: this.state.focused,
|
|
150
150
|
disabled: n
|
|
151
151
|
})
|
|
152
152
|
),
|
|
153
|
-
imageUrl:
|
|
153
|
+
imageUrl: F,
|
|
154
154
|
dir: e,
|
|
155
155
|
ref: (d) => {
|
|
156
|
-
this.mainButton = d
|
|
156
|
+
this.mainButton = (d == null ? void 0 : d.element) || null;
|
|
157
157
|
},
|
|
158
158
|
type: "button",
|
|
159
159
|
"aria-expanded": this.opened ? "true" : "false",
|
|
160
|
-
"aria-label":
|
|
160
|
+
"aria-label": w,
|
|
161
161
|
"aria-controls": this.opened ? this.guid : void 0,
|
|
162
162
|
title: b,
|
|
163
|
-
startIcon:
|
|
164
|
-
endIcon:
|
|
163
|
+
startIcon: v,
|
|
164
|
+
endIcon: N
|
|
165
165
|
},
|
|
166
166
|
this.props.text
|
|
167
|
-
), this.showLicenseWatermark && /* @__PURE__ */ p.createElement(
|
|
167
|
+
), this.showLicenseWatermark && /* @__PURE__ */ p.createElement(T, { message: this.licenseMessage }), this.renderPopup(i));
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* @hidden
|
|
@@ -185,16 +185,16 @@ const G = 12e3, J = 2e3, m = class m extends p.Component {
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
renderPopup(i) {
|
|
188
|
-
const { popupSettings: t = {}, _zIndex: e, unstyled: o } = this.props, a = e ? e +
|
|
189
|
-
return /* @__PURE__ */ p.createElement(
|
|
190
|
-
|
|
188
|
+
const { popupSettings: t = {}, _zIndex: e, unstyled: o } = this.props, a = e ? e + Q : J, h = o && o.uDropDownButton, { focusedIndex: n } = this.state;
|
|
189
|
+
return /* @__PURE__ */ p.createElement(L.Provider, { value: a }, /* @__PURE__ */ p.createElement(
|
|
190
|
+
j,
|
|
191
191
|
{
|
|
192
192
|
anchor: this.mainButton,
|
|
193
193
|
show: this.opened,
|
|
194
194
|
animate: t.animate,
|
|
195
195
|
popupClass: u(c.popup({ c: h }), t.popupClass),
|
|
196
|
-
anchorAlign: t.anchorAlign ||
|
|
197
|
-
popupAlign: t.popupAlign ||
|
|
196
|
+
anchorAlign: t.anchorAlign || q(i),
|
|
197
|
+
popupAlign: t.popupAlign || G(i),
|
|
198
198
|
style: i ? { direction: "rtl" } : void 0,
|
|
199
199
|
onClose: this.onPopupClose
|
|
200
200
|
},
|
|
@@ -222,7 +222,7 @@ const G = 12e3, J = 2e3, m = class m extends p.Component {
|
|
|
222
222
|
renderChildItems() {
|
|
223
223
|
const { item: i, itemRender: t, textField: e, unstyled: o } = this.props, a = o && o.uDropDownButton;
|
|
224
224
|
return this.buttonsData.length > 0 ? this.buttonsData.map((h, n) => /* @__PURE__ */ p.createElement(
|
|
225
|
-
|
|
225
|
+
X,
|
|
226
226
|
{
|
|
227
227
|
className: u(
|
|
228
228
|
c.item({
|
|
@@ -266,7 +266,7 @@ m.propTypes = {
|
|
|
266
266
|
tabIndex: s.number,
|
|
267
267
|
disabled: s.bool,
|
|
268
268
|
icon: s.string,
|
|
269
|
-
svgIcon:
|
|
269
|
+
svgIcon: R,
|
|
270
270
|
iconClass: s.string,
|
|
271
271
|
imageUrl: s.string,
|
|
272
272
|
popupSettings: s.object,
|
|
@@ -282,15 +282,15 @@ m.propTypes = {
|
|
|
282
282
|
themeColor: "base"
|
|
283
283
|
};
|
|
284
284
|
let g = m;
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
285
|
+
const V = z(), Y = U(
|
|
286
|
+
Z(
|
|
287
|
+
V,
|
|
288
|
+
$(W(g))
|
|
289
289
|
)
|
|
290
290
|
);
|
|
291
|
-
|
|
291
|
+
Y.displayName = "KendoReactDropDownButton";
|
|
292
292
|
export {
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
Y as DropDownButton,
|
|
294
|
+
V as DropDownButtonPropsContext,
|
|
295
295
|
g as DropDownButtonWithoutContext
|
|
296
296
|
};
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),i=require("prop-types"),c=require("../Button.js"),s=require("@progress/kendo-react-common"),C=require("./ButtonItem.js"),b=require("./SplitButtonItem.js"),k=require("./utils/navigation.js"),y=require("@progress/kendo-react-popup"),m=require("./utils/popup.js"),f=require("../package-metadata.js"),D=require("@progress/kendo-svg-icons");function I(h){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(o,t,e.get?e:{enumerable:!0,get:()=>h[t]})}}return o.default=h,Object.freeze(o)}const a=I(g),d=class d extends a.Component{constructor(o){super(o),this.state={focused:!1,focusedIndex:-1,opened:!1},this.wrapper=null,this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.showLicenseWatermark=!1,this.onKeyDown=t=>{const{focusedIndex:e}=this.state;if(t.altKey){!this.opened&&t.keyCode===s.Keys.down?(t.preventDefault(),this.setState({focusedIndex:0}),this.setOpen(!0,t)):this.opened&&t.keyCode===s.Keys.up&&(t.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,t));return}let n;if(t.keyCode===s.Keys.enter||t.keyCode===s.Keys.space){if(t.preventDefault(),this.dispatchClickEvent(t,e),e>=0){n={focusedIndex:this.opened?-1:0};const r=!this.opened;this.setOpen(r,t)}}else if(this.opened&&t.keyCode===s.Keys.esc){this.setState({focusedIndex:-1}),this.setOpen(!1,t);return}if(this.opened){const r=k.navigate(e,t.keyCode,t.altKey,this.buttonsData.length);r!==e&&(n=n||{},n.focusedIndex=r);const l=t.keyCode===s.Keys.up||t.keyCode===s.Keys.down||t.keyCode===s.Keys.left||t.keyCode===s.Keys.right;!t.altKey&&(l||t.keyCode===s.Keys.home||t.keyCode===s.Keys.end)&&t.preventDefault()}n&&this.setState(n)},this.switchFocus=t=>{this.skipFocus=!0,t(),window.setTimeout(()=>this.skipFocus=!1,0)},this.onFocus=t=>{this.skipFocus||(s.dispatchEvent(this.props.onFocus,t,this,void 0),this.setState({focused:!0}))},this.setOpen=(t,e)=>{this.opened!==t&&(this.openedDuringOnChange=t,this.setState({opened:t}),e?this.dispatchPopupEvent(e,t):this.openedDuringOnChange=void 0)},this.onItemClick=(t,e)=>{this.opened&&this.setState({focusedIndex:0}),this.dispatchClickEvent(t,e),this.setOpen(!1,t)},this.onBlur=t=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),s.dispatchEvent(this.props.onBlur,t,this,void 0),setTimeout(()=>{this.setOpen(!1,t)},0))},this.onPopupClose=t=>{var n;const e=s.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(e===this.list||(n=this.list)!=null&&n.contains(e))&&this.switchFocus(()=>{this.element&&this.element.focus({preventScroll:!0})}),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,t)},this.listRef=t=>{this.list=t,t&&this.state.focused&&this.switchFocus(()=>{t.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)})},this.onSplitPartClick=t=>{if(this.buttonsData.length){const e=!this.opened;this.setState({focusedIndex:e?0:-1,focused:!0}),this.setOpen(e,t)}},this.onDownSplitPart=t=>{t.preventDefault();const e=s.getActiveElement(document);this.element&&e!==this.element&&e!==this.list&&this.element.focus()},this.onItemDown=t=>{s.getActiveElement(document)===this.list&&t.preventDefault()},this.dispatchPopupEvent=(t,e)=>{s.dispatchEvent(e?this.props.onOpen:this.props.onClose,t,this,void 0),this.openedDuringOnChange=void 0},this.showLicenseWatermark=!s.validatePackage(f.packageMetadata,{component:"SplitButton"}),this.licenseMessage=s.getLicenseMessage(f.packageMetadata)}get guid(){return this.props.id?this.props.id+"-accessibility-id":this.props.id}get opened(){return this.openedDuringOnChange!==void 0?this.openedDuringOnChange:this.props.opened===void 0?this.state.opened:this.props.opened}render(){this.buttonsData=this.props.items||a.Children.toArray(this.props.children).filter(p=>p&&p.type===b.SplitButtonItem).map(p=>p.props);const o=this.isRtl(),t=o?"rtl":void 0,{id:e,style:n,tabIndex:r,disabled:l}=this.props;return a.createElement(a.Fragment,null,a.createElement("div",{id:e,style:n,className:s.classNames("k-split-button","k-button-group",{"k-focus":this.state.focused},`k-rounded-${s.kendoThemeMaps.roundedMap[this.props.rounded||"medium"]}`,this.props.className),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,dir:t,ref:p=>{this.wrapper=p}},a.createElement(c.Button,{ref:p=>{this.mainButton=p&&p.element},type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,onClick:p=>this.onItemClick(p,-1),disabled:l||void 0,tabIndex:r,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,startIcon:this.props.startIcon,endIcon:this.props.endIcon,imageUrl:this.props.imageUrl,dir:t,"aria-disabled":l,"aria-haspopup":!0,"aria-expanded":this.opened||void 0,"aria-label":this.props.ariaLabel,"aria-controls":this.opened?this.guid:void 0,id:"button-"+this.guid,title:this.props.title},this.props.text),a.createElement(c.Button,{type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,icon:"caret-alt-down",svgIcon:D.caretAltDownIcon,className:"k-split-button-arrow",disabled:l||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMouseDown:this.onDownSplitPart,onPointerDown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"}),this.renderPopup(o)),this.showLicenseWatermark&&a.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}componentDidMount(){(this.props.dir===void 0&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(o,t){this.isItemDisabled(t)||(t===-1?s.dispatchEvent(this.props.onButtonClick,o,this,void 0):s.dispatchEvent(this.props.onItemClick,o,this,{item:this.buttonsData[t],itemIndex:t}))}renderPopup(o){const{popupSettings:t={}}=this.props,{focusedIndex:e}=this.state;return a.createElement(y.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:s.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||m.getAnchorAlign(o),popupAlign:t.popupAlign||m.getPopupAlign(o),style:o?{direction:"rtl"}:void 0,onClose:this.onPopupClose},a.createElement("ul",{role:"menu",id:this.guid,"aria-labelledby":"button-"+this.guid,tabIndex:-1,ref:this.listRef,"aria-activedescendant":e>=0?`${this.guid}-${e}`:void 0,className:s.classNames("k-menu-group",{[`k-menu-group-${s.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size})},this.renderChildItems()))}renderChildItems(){const{item:o,itemRender:t,textField:e}=this.props;return this.buttonsData.length>0?this.buttonsData.map((n,r)=>a.createElement(C.ButtonItem,{className:s.classNames("k-menu-item",{"k-first":r===0},{"k-last":r===this.buttonsData.length-1}),dataItem:n,textField:e,focused:this.state.focusedIndex===r,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:o,key:r,index:r,id:`${this.guid}-${r}`})):null}isItemDisabled(o){return this.buttonsData[o]?this.buttonsData[o].disabled:this.props.disabled}isRtl(){return this.props.dir!==void 0?this.props.dir==="rtl":!!this.wrapper&&getComputedStyle(this.wrapper).direction==="rtl"}};d.propTypes={accessKey:i.string,ariaLabel:i.string,title:i.string,onButtonClick:i.func,onFocus:i.func,onBlur:i.func,onItemClick:i.func,onOpen:i.func,onClose:i.func,text:i.string,items:i.arrayOf(i.any),textField:i.string,tabIndex:i.number,disabled:i.bool,icon:i.string,svgIcon:s.svgIconPropType,iconClass:i.string,imageUrl:i.string,popupSettings:i.object,itemRender:i.any,item:i.func,className:i.string,buttonClass:i.string,dir:i.string},d.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let u=d;exports.SplitButton=u;
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
import * as p from "react";
|
|
9
9
|
import s from "prop-types";
|
|
10
10
|
import { Button as m } from "../Button.mjs";
|
|
11
|
-
import { Keys as a, dispatchEvent as l, getActiveElement as c, validatePackage as
|
|
12
|
-
import { ButtonItem as
|
|
13
|
-
import { SplitButtonItem as
|
|
14
|
-
import { navigate as
|
|
15
|
-
import { Popup as
|
|
16
|
-
import { getAnchorAlign as
|
|
17
|
-
import { packageMetadata as
|
|
18
|
-
import { caretAltDownIcon as
|
|
11
|
+
import { Keys as a, dispatchEvent as l, getActiveElement as c, validatePackage as k, getLicenseMessage as b, svgIconPropType as y, classNames as d, kendoThemeMaps as f, WatermarkOverlay as D } from "@progress/kendo-react-common";
|
|
12
|
+
import { ButtonItem as I } from "./ButtonItem.mjs";
|
|
13
|
+
import { SplitButtonItem as w } from "./SplitButtonItem.mjs";
|
|
14
|
+
import { navigate as S } from "./utils/navigation.mjs";
|
|
15
|
+
import { Popup as v } from "@progress/kendo-react-popup";
|
|
16
|
+
import { getAnchorAlign as O, getPopupAlign as E } from "./utils/popup.mjs";
|
|
17
|
+
import { packageMetadata as g } from "../package-metadata.mjs";
|
|
18
|
+
import { caretAltDownIcon as P } from "@progress/kendo-svg-icons";
|
|
19
19
|
const u = class u extends p.Component {
|
|
20
20
|
constructor(i) {
|
|
21
21
|
super(i), this.state = {
|
|
@@ -42,7 +42,7 @@ const u = class u extends p.Component {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
if (this.opened) {
|
|
45
|
-
const n =
|
|
45
|
+
const n = S(e, t.keyCode, t.altKey, this.buttonsData.length);
|
|
46
46
|
n !== e && (o = o || {}, o.focusedIndex = n);
|
|
47
47
|
const h = t.keyCode === a.up || t.keyCode === a.down || t.keyCode === a.left || t.keyCode === a.right;
|
|
48
48
|
!t.altKey && (h || t.keyCode === a.home || t.keyCode === a.end) && t.preventDefault();
|
|
@@ -89,7 +89,7 @@ const u = class u extends p.Component {
|
|
|
89
89
|
c(document) === this.list && t.preventDefault();
|
|
90
90
|
}, this.dispatchPopupEvent = (t, e) => {
|
|
91
91
|
l(e ? this.props.onOpen : this.props.onClose, t, this, void 0), this.openedDuringOnChange = void 0;
|
|
92
|
-
}, this.showLicenseWatermark = !
|
|
92
|
+
}, this.showLicenseWatermark = !k(g, { component: "SplitButton" }), this.licenseMessage = b(g);
|
|
93
93
|
}
|
|
94
94
|
get guid() {
|
|
95
95
|
return this.props.id ? this.props.id + "-accessibility-id" : this.props.id;
|
|
@@ -101,7 +101,7 @@ const u = class u extends p.Component {
|
|
|
101
101
|
* @hidden
|
|
102
102
|
*/
|
|
103
103
|
render() {
|
|
104
|
-
this.buttonsData = this.props.items || p.Children.toArray(this.props.children).filter((r) => r && r.type ===
|
|
104
|
+
this.buttonsData = this.props.items || p.Children.toArray(this.props.children).filter((r) => r && r.type === w).map((r) => r.props);
|
|
105
105
|
const i = this.isRtl(), t = i ? "rtl" : void 0, { id: e, style: o, tabIndex: n, disabled: h } = this.props;
|
|
106
106
|
return /* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement(
|
|
107
107
|
"div",
|
|
@@ -167,7 +167,7 @@ const u = class u extends p.Component {
|
|
|
167
167
|
fillMode: this.props.fillMode,
|
|
168
168
|
themeColor: this.props.themeColor,
|
|
169
169
|
icon: "caret-alt-down",
|
|
170
|
-
svgIcon:
|
|
170
|
+
svgIcon: P,
|
|
171
171
|
className: "k-split-button-arrow",
|
|
172
172
|
disabled: h || void 0,
|
|
173
173
|
tabIndex: -1,
|
|
@@ -179,7 +179,7 @@ const u = class u extends p.Component {
|
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
181
|
this.renderPopup(i)
|
|
182
|
-
), this.showLicenseWatermark && /* @__PURE__ */ p.createElement(
|
|
182
|
+
), this.showLicenseWatermark && /* @__PURE__ */ p.createElement(D, { message: this.licenseMessage }));
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
185
|
* @hidden
|
|
@@ -202,14 +202,14 @@ const u = class u extends p.Component {
|
|
|
202
202
|
renderPopup(i) {
|
|
203
203
|
const { popupSettings: t = {} } = this.props, { focusedIndex: e } = this.state;
|
|
204
204
|
return /* @__PURE__ */ p.createElement(
|
|
205
|
-
|
|
205
|
+
v,
|
|
206
206
|
{
|
|
207
207
|
anchor: this.wrapper,
|
|
208
208
|
show: this.opened,
|
|
209
209
|
animate: t.animate,
|
|
210
210
|
popupClass: d("k-menu-popup", t.popupClass),
|
|
211
|
-
anchorAlign: t.anchorAlign ||
|
|
212
|
-
popupAlign: t.popupAlign ||
|
|
211
|
+
anchorAlign: t.anchorAlign || O(i),
|
|
212
|
+
popupAlign: t.popupAlign || E(i),
|
|
213
213
|
style: i ? { direction: "rtl" } : void 0,
|
|
214
214
|
onClose: this.onPopupClose
|
|
215
215
|
},
|
|
@@ -233,7 +233,7 @@ const u = class u extends p.Component {
|
|
|
233
233
|
renderChildItems() {
|
|
234
234
|
const { item: i, itemRender: t, textField: e } = this.props;
|
|
235
235
|
return this.buttonsData.length > 0 ? this.buttonsData.map((o, n) => /* @__PURE__ */ p.createElement(
|
|
236
|
-
|
|
236
|
+
I,
|
|
237
237
|
{
|
|
238
238
|
className: d(
|
|
239
239
|
"k-menu-item",
|
|
@@ -276,7 +276,7 @@ u.propTypes = {
|
|
|
276
276
|
tabIndex: s.number,
|
|
277
277
|
disabled: s.bool,
|
|
278
278
|
icon: s.string,
|
|
279
|
-
svgIcon:
|
|
279
|
+
svgIcon: y,
|
|
280
280
|
iconClass: s.string,
|
|
281
281
|
imageUrl: s.string,
|
|
282
282
|
popupSettings: s.object,
|
|
@@ -291,7 +291,7 @@ u.propTypes = {
|
|
|
291
291
|
fillMode: "solid",
|
|
292
292
|
themeColor: "base"
|
|
293
293
|
};
|
|
294
|
-
let
|
|
294
|
+
let C = u;
|
|
295
295
|
export {
|
|
296
|
-
|
|
296
|
+
C as SplitButton
|
|
297
297
|
};
|
|
@@ -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 e=require("react")
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),ee=require("@progress/kendo-webspeech-common"),te=require("../Button.js"),u=require("@progress/kendo-react-common"),M=require("@progress/kendo-svg-icons"),a=require("../messages/index.js"),ne=require("@progress/kendo-react-intl"),I=require("../package-metadata.js"),y=e.forwardRef((c,A)=>{const q=!u.validatePackage(I.packageMetadata,{component:"SpeechToTextButton"}),B=u.getLicenseMessage(I.packageMetadata),h=ne.useLocalization(),{fillMode:E="solid",rounded:L="medium",size:z="medium",themeColor:H="base",ariaLabel:d,svgIcon:S,disabled:N,iconSize:O="medium",title:f,className:F,id:P,style:W,lang:k="en-US",continuous:v=!1,interimResults:b=!1,maxAlternatives:T=1,integrationMode:K="webSpeech",onStart:g,onResult:i,onEnd:m,onError:s,...U}=c,o=e.useRef(null),n=e.useRef(!1),[r,l]=e.useState(!1),j=e.useCallback(async()=>{n.current=!0,l(!0),g&&await g()},[g]),D=e.useCallback(async()=>{n.current=!1,l(!1),m&&await m()},[m]),G=e.useCallback(t=>{const w=t.results,C=w[w.length-1],$=Array.from(C).map(x=>({transcript:x.transcript,confidence:x.confidence}));i==null||i({isFinal:C.isFinal,alternatives:$})},[i]),J=e.useCallback(t=>{l(!1),n.current=!1,s==null||s({errorMessage:t.error})},[s]),Q=()=>{var t;if(typeof window!="undefined"&&!("webkitSpeechRecognition"in window||"SpeechRecognition"in window)){s&&s({errorMessage:"Speech Recognition API is not supported in this browser."});return}(t=o.current)!=null&&t.isActive()&&o.current.stop(),o.current=new ee.KendoSpeechRecognition({lang:k,continuous:v,interimResults:b,maxAlternatives:T,events:{start:j,end:D,result:G,error:J}})},R=e.useCallback(()=>{var t;n.current||(t=o.current)==null||t.start()},[]),p=e.useCallback(()=>{var t;n.current&&((t=o.current)==null||t.stop())},[]),V=e.useCallback(()=>{var t;n.current&&((t=o.current)==null||t.abort(),n.current=!1,l(!1))},[]),X=()=>n.current;e.useImperativeHandle(A,()=>({start:R,stop:p,abort:V,isActive:X})),e.useEffect(()=>(Q(),()=>{n.current&&p()}),[k,v,b,T,K]);const Y=()=>{r?p():R()},Z=c.icon!==void 0||c.iconClass!==void 0||c.imageUrl!==void 0,_=e.useMemo(()=>r?M.stopSmIcon:S||M.microphoneOutlineIcon,[r,S]);return e.createElement(e.Fragment,null,e.createElement(te.Button,{id:P,className:u.classNames({"k-speech-to-text-button":!0,"k-listening":r},F),style:W,svgIcon:Z?void 0:_,iconSize:O,fillMode:E,rounded:L,size:z,themeColor:H,"aria-label":d!=null?d:h.toLanguageString(a.speechToTextAriaLabel,a.messages[a.speechToTextAriaLabel]),"aria-pressed":r,disabled:N,title:f!=null?f:h.toLanguageString(a.speechToTextTitle,a.messages[a.speechToTextTitle]),onClick:Y,...U},c.children),q&&e.createElement(u.WatermarkOverlay,{message:B}))});y.displayName="KendoSpeechToTextButton";exports.SpeechToTextButton=y;
|
|
@@ -6,128 +6,128 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import e from "react";
|
|
9
|
-
import { KendoSpeechRecognition as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { validatePackage as
|
|
12
|
-
import { stopSmIcon as
|
|
13
|
-
import { speechToTextAriaLabel as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
const
|
|
17
|
-
const
|
|
9
|
+
import { KendoSpeechRecognition as $ } from "@progress/kendo-webspeech-common";
|
|
10
|
+
import { Button as ee } from "../Button.mjs";
|
|
11
|
+
import { validatePackage as te, getLicenseMessage as ne, classNames as re, WatermarkOverlay as oe } from "@progress/kendo-react-common";
|
|
12
|
+
import { stopSmIcon as se, microphoneOutlineIcon as ae } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { speechToTextAriaLabel as T, messages as x, speechToTextTitle as A } from "../messages/index.mjs";
|
|
14
|
+
import { useLocalization as ie } from "@progress/kendo-react-intl";
|
|
15
|
+
import { packageMetadata as I } from "../package-metadata.mjs";
|
|
16
|
+
const ce = e.forwardRef((s, M) => {
|
|
17
|
+
const y = !te(I, { component: "SpeechToTextButton" }), E = ne(I), p = ie(), {
|
|
18
18
|
fillMode: z = "solid",
|
|
19
19
|
rounded: H = "medium",
|
|
20
|
-
size:
|
|
21
|
-
themeColor:
|
|
22
|
-
ariaLabel:
|
|
23
|
-
svgIcon:
|
|
20
|
+
size: L = "medium",
|
|
21
|
+
themeColor: B = "base",
|
|
22
|
+
ariaLabel: l,
|
|
23
|
+
svgIcon: g,
|
|
24
24
|
disabled: N,
|
|
25
25
|
iconSize: F = "medium",
|
|
26
|
-
title:
|
|
26
|
+
title: u,
|
|
27
27
|
className: O,
|
|
28
28
|
id: K,
|
|
29
29
|
style: P,
|
|
30
|
-
lang:
|
|
31
|
-
continuous:
|
|
32
|
-
interimResults:
|
|
33
|
-
maxAlternatives:
|
|
34
|
-
integrationMode:
|
|
30
|
+
lang: h = "en-US",
|
|
31
|
+
continuous: v = !1,
|
|
32
|
+
interimResults: S = !1,
|
|
33
|
+
maxAlternatives: b = 1,
|
|
34
|
+
integrationMode: U = "webSpeech",
|
|
35
35
|
onStart: m,
|
|
36
|
-
onResult:
|
|
37
|
-
onEnd:
|
|
36
|
+
onResult: i,
|
|
37
|
+
onEnd: f,
|
|
38
38
|
onError: r,
|
|
39
|
-
...
|
|
40
|
-
} =
|
|
41
|
-
n.current = !0,
|
|
42
|
-
}, [m]),
|
|
43
|
-
n.current = !1,
|
|
44
|
-
}, [
|
|
39
|
+
...W
|
|
40
|
+
} = s, o = e.useRef(null), n = e.useRef(!1), [a, c] = e.useState(!1), _ = e.useCallback(async () => {
|
|
41
|
+
n.current = !0, c(!0), m && await m();
|
|
42
|
+
}, [m]), j = e.useCallback(async () => {
|
|
43
|
+
n.current = !1, c(!1), f && await f();
|
|
44
|
+
}, [f]), q = e.useCallback(
|
|
45
45
|
(t) => {
|
|
46
|
-
const
|
|
47
|
-
transcript:
|
|
48
|
-
confidence:
|
|
46
|
+
const w = t.results, R = w[w.length - 1], Z = Array.from(R).map((C) => ({
|
|
47
|
+
transcript: C.transcript,
|
|
48
|
+
confidence: C.confidence
|
|
49
49
|
}));
|
|
50
|
-
|
|
51
|
-
isFinal:
|
|
52
|
-
alternatives:
|
|
50
|
+
i == null || i({
|
|
51
|
+
isFinal: R.isFinal,
|
|
52
|
+
alternatives: Z
|
|
53
53
|
});
|
|
54
54
|
},
|
|
55
|
-
[
|
|
56
|
-
),
|
|
55
|
+
[i]
|
|
56
|
+
), D = e.useCallback(
|
|
57
57
|
(t) => {
|
|
58
|
-
|
|
58
|
+
c(!1), n.current = !1, r == null || r({
|
|
59
59
|
errorMessage: t.error
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
[r]
|
|
63
|
-
),
|
|
63
|
+
), G = () => {
|
|
64
64
|
var t;
|
|
65
65
|
if (typeof window != "undefined" && !("webkitSpeechRecognition" in window || "SpeechRecognition" in window)) {
|
|
66
66
|
r && r({ errorMessage: "Speech Recognition API is not supported in this browser." });
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
(t = o.current) != null && t.isActive() && o.current.stop(), o.current = new
|
|
70
|
-
lang:
|
|
71
|
-
continuous:
|
|
72
|
-
interimResults:
|
|
73
|
-
maxAlternatives:
|
|
69
|
+
(t = o.current) != null && t.isActive() && o.current.stop(), o.current = new $({
|
|
70
|
+
lang: h,
|
|
71
|
+
continuous: v,
|
|
72
|
+
interimResults: S,
|
|
73
|
+
maxAlternatives: b,
|
|
74
74
|
events: {
|
|
75
|
-
start:
|
|
76
|
-
end:
|
|
77
|
-
result:
|
|
78
|
-
error:
|
|
75
|
+
start: _,
|
|
76
|
+
end: j,
|
|
77
|
+
result: q,
|
|
78
|
+
error: D
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
},
|
|
81
|
+
}, k = e.useCallback(() => {
|
|
82
82
|
var t;
|
|
83
|
-
|
|
84
|
-
}, [
|
|
83
|
+
n.current || (t = o.current) == null || t.start();
|
|
84
|
+
}, []), d = e.useCallback(() => {
|
|
85
85
|
var t;
|
|
86
|
-
n.current &&
|
|
87
|
-
}, [
|
|
86
|
+
n.current && ((t = o.current) == null || t.stop());
|
|
87
|
+
}, []), J = e.useCallback(() => {
|
|
88
88
|
var t;
|
|
89
|
-
n.current &&
|
|
90
|
-
}, [
|
|
91
|
-
e.useImperativeHandle(
|
|
92
|
-
start:
|
|
93
|
-
stop:
|
|
94
|
-
abort:
|
|
95
|
-
isActive:
|
|
96
|
-
})), e.useEffect(() => (
|
|
97
|
-
n.current &&
|
|
98
|
-
}), [v, S, b,
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
},
|
|
89
|
+
n.current && ((t = o.current) == null || t.abort(), n.current = !1, c(!1));
|
|
90
|
+
}, []), Q = () => n.current;
|
|
91
|
+
e.useImperativeHandle(M, () => ({
|
|
92
|
+
start: k,
|
|
93
|
+
stop: d,
|
|
94
|
+
abort: J,
|
|
95
|
+
isActive: Q
|
|
96
|
+
})), e.useEffect(() => (G(), () => {
|
|
97
|
+
n.current && d();
|
|
98
|
+
}), [h, v, S, b, U]);
|
|
99
|
+
const V = () => {
|
|
100
|
+
a ? d() : k();
|
|
101
|
+
}, X = s.icon !== void 0 || s.iconClass !== void 0 || s.imageUrl !== void 0, Y = e.useMemo(() => a ? se : g || ae, [a, g]);
|
|
102
102
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
103
|
-
|
|
103
|
+
ee,
|
|
104
104
|
{
|
|
105
105
|
id: K,
|
|
106
|
-
className:
|
|
106
|
+
className: re(
|
|
107
107
|
{
|
|
108
108
|
"k-speech-to-text-button": !0,
|
|
109
|
-
"k-listening":
|
|
109
|
+
"k-listening": a
|
|
110
110
|
},
|
|
111
111
|
O
|
|
112
112
|
),
|
|
113
113
|
style: P,
|
|
114
|
-
svgIcon:
|
|
114
|
+
svgIcon: X ? void 0 : Y,
|
|
115
115
|
iconSize: F,
|
|
116
116
|
fillMode: z,
|
|
117
117
|
rounded: H,
|
|
118
|
-
size:
|
|
119
|
-
themeColor:
|
|
120
|
-
"aria-label":
|
|
121
|
-
"aria-pressed":
|
|
118
|
+
size: L,
|
|
119
|
+
themeColor: B,
|
|
120
|
+
"aria-label": l != null ? l : p.toLanguageString(T, x[T]),
|
|
121
|
+
"aria-pressed": a,
|
|
122
122
|
disabled: N,
|
|
123
|
-
title:
|
|
124
|
-
onClick:
|
|
125
|
-
...
|
|
123
|
+
title: u != null ? u : p.toLanguageString(A, x[A]),
|
|
124
|
+
onClick: V,
|
|
125
|
+
...W
|
|
126
126
|
},
|
|
127
|
-
|
|
128
|
-
),
|
|
127
|
+
s.children
|
|
128
|
+
), y && /* @__PURE__ */ e.createElement(oe, { message: E }));
|
|
129
129
|
});
|
|
130
|
-
|
|
130
|
+
ce.displayName = "KendoSpeechToTextButton";
|
|
131
131
|
export {
|
|
132
|
-
|
|
132
|
+
ce as SpeechToTextButton
|
|
133
133
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-intl"),require("@progress/kendo-webspeech-common")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-svg-icons","@progress/kendo-react-intl","@progress/kendo-webspeech-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactButtons={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactPopup,e.KendoSvgIcons,e.KendoReactIntl,e.KendoWebspeechCommon)}(this,(function(e,t,s,n,o,r,a,i){"use strict";function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var c=l(t);const d=c.forwardRef(((e,t)=>{const{children:s,togglable:o,dir:r,disabled:a,selected:i,icon:l,iconClass:d,svgIcon:p,imageUrl:m,imageAlt:h,className:f,startIcon:v,endIcon:b,onClick:g,size:y=u.size,rounded:k=u.rounded,fillMode:C=u.fillMode,themeColor:I=u.themeColor,ariaPressed:x,iconSize:w,...E}=e,D=c.useRef(void 0),N=c.useRef(null),[S,B]=c.useState(!0===o&&!0===i),K=void 0!==p||void 0!==l||void 0!==d||void 0!==m,R=void 0!==s,O=n.useUnstyled(),z=e.unstyled||O,M=z&&z.uButton;c.useImperativeHandle(t,(()=>({element:N.current,selected:void 0!==D.current?D.current:S}))),c.useMemo((()=>{o&&void 0!==i&&i!==S&&B(i)}),[o,i]),c.useEffect((()=>{D.current=void 0}),[S]);const F=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:r,buttonClasses:a,iconSize:i}){return e?c.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:a})),alt:r,src:e}):t||o?c.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:a})),name:t,icon:o,size:i}):s?c.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:a}),s)}):null}({name:l,svgIcon:p,iconClass:d,imageUrl:m,imageAlt:h,buttonClasses:M,iconSize:w}),P=e=>c.cloneElement(e,{className:n.classNames(n.uButton.icon({c:M}),e.props.className)}),T=c.useMemo((()=>o?S:x||void 0),[]);return c.createElement("button",{ref:N,"aria-pressed":T,...E,dir:r,disabled:a,onClick:e=>{o&&void 0===i&&(D.current=!S,B(!S)),g&&g.call(void 0,e)},className:n.classNames(n.uButton.wrapper({c:M,isRtl:"rtl"===r,selected:S,disabled:a,size:y,fillMode:C,rounded:k,themeColor:I,iconButton:!R&&K}),f)},v&&P(v),F,s&&c.createElement("span",{className:n.classNames(n.uButton.text({c:M}))},s),b&&P(b))})),u={togglable:!1,size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};d.displayName="KendoReactButton",d.propTypes={children:s.node,selected:s.bool,togglable:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,imageAlt:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"flat","link","outline","solid","clear"]),themeColor:s.oneOf([null,"base","primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"])};const p=e=>{const{children:t,className:s,dir:o,disabled:r,width:a}=e,i=n.useUnstyled(),l=e.unstyled||i,d=l&&l.uButtonGroup,u=(e,t)=>{const s={...a?{width:a}:{},...e.props.style||{}},n=r||e.props.disabled,o={...e.props,...t?{className:t}:{},...Object.keys(s).length?{style:s}:{},...void 0!==n?{disabled:n}:{}};return c.Children.count(e.props.children)>0?c.cloneElement(e,o,e.props.children):c.cloneElement(e,o)},p=c.useRef(null),m=(e=>{const t=c.Children.count(e),s=void 0!==o?"rtl"===o:p.current&&"rtl"===getComputedStyle(p.current).direction||!1;return c.Children.map(e,((e,o)=>{if(c.isValidElement(e)){const r=o===t-1,a=s,i=n.classNames(e.props.className,n.uButtonGroup.position({c:d,start:a?r:0===o,end:a?0===o:r}));return u(e,i)}return e}))})(t),h=n.classNames(n.uButtonGroup.wrapper({c:d,stretched:!!a,disabled:r}),s),f={className:h,style:{width:`${a}`},dir:o,role:"group","aria-disabled":r};return c.createElement("div",{ref:p,...f,className:h},m)};p.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};const m=e=>{const t=n.useUnstyled(),s=e.unstyled||t,o=s&&s.uDropDownButton,r=c.useCallback((t=>{e.onClick(t,e.index)}),[e]),a=e.dataItem.render||e.item||(void 0===e.item?e.render:null),i=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,l=c.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:o,focused:e.focused}),e.className),tabIndex:-1,onClick:r,onMouseDown:e.onDown,onPointerDown:e.onDown,role:"menuitem","aria-disabled":e.dataItem.disabled||void 0},c.createElement("span",{tabIndex:-1,className:n.classNames(n.uDropDownButton.link({c:o,selected:e.dataItem.selected,disabled:e.dataItem.disabled})),key:"icon"},a?c.createElement(a,{item:e.dataItem,itemIndex:e.index}):c.createElement(c.Fragment,null,(e.dataItem.icon||e.dataItem.iconClass||e.dataItem.svgIcon)&&c.createElement(n.IconWrap,{className:e.dataItem.iconClass,name:e.dataItem.icon,icon:e.dataItem.svgIcon}),e.dataItem.imageUrl&&c.createElement("img",{role:"presentation",alt:"",src:e.dataItem.imageUrl,className:"k-icon"}),i&&c.createElement("span",{className:"k-menu-link-text"},i))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,l,e):l};m.displayName="KendoReactButtonItem";const h=class extends c.Component{render(){return null}};h.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,disabled:s.bool,render:s.any};let f=h;const v=(e,t,s,o)=>{if(s)return e;const r=Math.min(o-1,Math.max(0,e));switch(t){case n.Keys.enter:case n.Keys.space:case n.Keys.esc:return-1;case n.Keys.up:case n.Keys.left:return r-1<0?o-1:r-1;case n.Keys.down:case n.Keys.right:return r+1>=o?0:r+1;case n.Keys.home:return 0;case n.Keys.end:return o-1;default:return e}};function b(e){const t={horizontal:"left",vertical:"bottom"};return e&&(t.horizontal="right"),t}function g(e){const t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const y={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"11.4.0-develop.5",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},k=class extends c.Component{constructor(e){super(e),this.state={focused:!1,focusedIndex:-1,opened:!1},this.wrapper=null,this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.showLicenseWatermark=!1,this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setState({focusedIndex:0}),this.setOpen(!0,e)));let s;if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){if(e.preventDefault(),this.dispatchClickEvent(e,t),t>=0){s={focusedIndex:this.opened?-1:0};const t=!this.opened;this.setOpen(t,e)}}else if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=v(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const r=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(r||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}s&&this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.onFocus=e=>{this.skipFocus||(n.dispatchEvent(this.props.onFocus,e,this,void 0),this.setState({focused:!0}))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.opened&&this.setState({focusedIndex:0}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onSplitPartClick=e=>{if(this.buttonsData.length){const t=!this.opened;this.setState({focusedIndex:t?0:-1,focused:!0}),this.setOpen(t,e)}},this.onDownSplitPart=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},this.showLicenseWatermark=!n.validatePackage(y,{component:"SplitButton"})}get guid(){return this.props.id?this.props.id+"-accessibility-id":this.props.id}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){this.buttonsData=this.props.items||c.Children.toArray(this.props.children).filter((e=>e&&e.type===f)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:a,disabled:i}=this.props;return c.createElement(c.Fragment,null,c.createElement("div",{id:s,style:o,className:n.classNames("k-split-button","k-button-group",{"k-focus":this.state.focused},`k-rounded-${n.kendoThemeMaps.roundedMap[this.props.rounded||"medium"]}`,this.props.className),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,dir:t,ref:e=>{this.wrapper=e}},c.createElement(d,{ref:e=>{this.mainButton=e&&e.element},type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,onClick:e=>this.onItemClick(e,-1),disabled:i||void 0,tabIndex:a,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,startIcon:this.props.startIcon,endIcon:this.props.endIcon,imageUrl:this.props.imageUrl,dir:t,"aria-disabled":i,"aria-haspopup":!0,"aria-expanded":this.opened||void 0,"aria-label":this.props.ariaLabel,"aria-controls":this.opened?this.guid:void 0,id:"button-"+this.guid,title:this.props.title},this.props.text),c.createElement(d,{type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,className:"k-split-button-arrow",disabled:i||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMouseDown:this.onDownSplitPart,onPointerDown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"}),this.renderPopup(e)),this.showLicenseWatermark&&c.createElement(n.WatermarkOverlay,null))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||(-1===t?n.dispatchEvent(this.props.onButtonClick,e,this,void 0):n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t}))}renderPopup(e){const{popupSettings:t={}}=this.props,{focusedIndex:s}=this.state;return c.createElement(o.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:n.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||b(e),popupAlign:t.popupAlign||g(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},c.createElement("ul",{role:"menu",id:this.guid,"aria-labelledby":"button-"+this.guid,tabIndex:-1,ref:this.listRef,"aria-activedescendant":s>=0?`${this.guid}-${s}`:void 0,className:n.classNames("k-menu-group",{[`k-menu-group-${n.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size})},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props;return this.buttonsData.length>0?this.buttonsData.map(((o,r)=>c.createElement(m,{className:n.classNames("k-menu-item",{"k-first":0===r},{"k-last":r===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===r,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,key:r,index:r,id:`${this.guid}-${r}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};k.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onButtonClick:s.func,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,text:s.string,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.any,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},k.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let C=k;const I=class extends c.Component{render(){return null}};I.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let x=I;const w=class extends c.Component{constructor(e){super(e),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!1,this.showLicenseWatermark=!1,this.buttonsData=[],this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setOpen(!0,e),this.setState({focusedIndex:0})));const s={...this.state};if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){e.preventDefault(),t>=0&&this.dispatchClickEvent(e,t);const s=!this.opened;return this.setState({focused:!0,focusedIndex:s?0:-1}),void this.setOpen(s,e)}if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=v(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const r=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(r||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.handleFocus=e=>{this.skipFocus||(this.setState({focused:!0,focusedIndex:this.opened?0:-1}),n.dispatchEvent(this.props.onFocus,e,this,void 0))},this.handleButtonBlur=e=>{this.opened||(this.setState({focused:!1}),n.dispatchEvent(this.props.onBlur,e,this,void 0))},this.handleMenuBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.setState({focusedIndex:-1}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.mouseDown=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onClickMainButton=e=>{if(!this.buttonsData.length)return;const t=!this.opened;this.setState({focused:!0,focusedIndex:t?0:-1}),this.setOpen(t,e)},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},this.showLicenseWatermark=!n.validatePackage(y,{component:"DropDownButton"})}get guid(){return this.props.id+"-accessibility-id"}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){const e=this.isRtl(),t=this.props.unstyled&&this.props.unstyled.uDropDownButton,s=e?"rtl":void 0,{id:o,style:r,tabIndex:a,disabled:i,size:l,rounded:u,fillMode:p,themeColor:m,ariaLabel:h,title:f,accessKey:v,icon:b,svgIcon:g,iconClass:y,buttonClass:k,className:C,imageUrl:I,startIcon:w,endIcon:E}=this.props;return this.buttonsData=this.props.items||c.Children.toArray(this.props.children).filter((e=>e&&e.type===x)).map((e=>e.props)),c.createElement(c.Fragment,null,c.createElement(d,{id:o,size:l,style:r,rounded:u,fillMode:p,themeColor:m,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":i?"true":void 0,tabIndex:a,accessKey:v,icon:b,svgIcon:g,iconClass:y,className:n.classNames(k,C,n.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:i})),imageUrl:I,dir:s,ref:e=>{this.mainButton=e&&e.element},type:"button","aria-expanded":this.opened?"true":"false","aria-label":h,"aria-controls":this.opened?this.guid:void 0,title:f,startIcon:w,endIcon:E},this.props.text),this.showLicenseWatermark&&c.createElement(n.WatermarkOverlay,null),this.renderPopup(e))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t})}renderPopup(e){const{popupSettings:t={},_zIndex:s,unstyled:r}=this.props,a=s?s+2e3:12e3,i=r&&r.uDropDownButton,{focusedIndex:l}=this.state;return c.createElement(n.ZIndexContext.Provider,{value:a},c.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:i}),t.popupClass),anchorAlign:t.anchorAlign||b(e),popupAlign:t.popupAlign||g(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},c.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":l>=0?`${this.guid}-${l}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:i,size:this.props.size}))},this.renderChildItems())))}renderChildItems(){const{item:e,itemRender:t,textField:s,unstyled:o}=this.props,r=o&&o.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map(((o,a)=>c.createElement(m,{className:n.classNames(n.uDropDownButton.item({c:r}),o.className,{"k-first":0===a},{"k-last":a===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===a,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:a,key:a,id:`${this.guid}-${a}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.mainButton&&"rtl"===getComputedStyle(this.mainButton).direction}};w.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.func,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},w.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let E=w;const D=n.createPropsContext(),N=n.withIdHOC(n.withPropsContext(D,n.withUnstyledHOC(n.withZIndexContext(E))));N.displayName="KendoReactDropDownButton";const S=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",B=["button"+S,".k-button-group > button"+S,".k-colorpicker",".k-dropdownlist"],K=e=>c.createElement("div",{ref:e._ref,className:n.classNames("k-toolbar-separator k-separator",e.className)}),R="prevArrow.title",O="nextArrow.title",z="moreButtonTitle.title",M={[R]:"Previous scroll button",[O]:"Next scroll button",[z]:"More button"},F=e=>{const t=a.useLocalization(),{disabled:s,type:o,scrollContentRef:i,buttonScrollSpeed:l,prevButton:d,nextButton:u}=e,p="prev"===o?d||"span":u||"span";return c.createElement(p,{className:n.classNames("k-button","k-button-md","k-button-solid","k-button-solid-base","k-rounded-md","k-icon-button",`k-toolbar-${o}`,{"k-disabled":s}),title:`${"prev"===o?t.toLanguageString(R,M[R]):t.toLanguageString(O,M[O])}`,"aria-hidden":!0,tabIndex:s?-1:void 0,onClick:e=>{i&&i.current&&l&&i.current.scrollBy({left:"next"===o?l:-l,behavior:"smooth"})}},c.createElement(n.SvgIcon,{icon:"prev"===o?r.caretAltLeftIcon:r.caretAltRightIcon,className:"k-button-icon"}))},P=e=>{const{scrollButtons:t,scrollButtonsPosition:s,isOverflowing:n,scrollContentRef:o,buttonScrollSpeed:r,dir:a,isScrollStartPosition:i,isScrollEndPosition:l,prevButton:d,nextButton:u,children:p}=e,m=(e,t)=>c.createElement(F,{type:e,disabled:t,scrollContentRef:o,buttonScrollSpeed:r,prevButton:d,nextButton:u}),h="visible"===t||"auto"===t&&n;return c.createElement(c.Fragment,null,h&&"split"===s&&c.createElement(c.Fragment,null,m("rtl"!==a?"prev":"next",i),c.createElement(K,{className:"k-toolbar-button-separator"})),h&&"start"===s&&c.createElement(c.Fragment,null,m("rtl"!==a?"prev":"next",i),m("rtl"!==a?"next":"prev",l),c.createElement(K,{className:"k-toolbar-button-separator"})),c.createElement("span",{className:"k-toolbar-items k-toolbar-items-scroll",ref:o},p),h&&"split"===s&&c.createElement(c.Fragment,null,c.createElement(K,{className:"k-toolbar-button-separator"}),m("rtl"!==a?"next":"prev",l)),h&&"end"===s&&c.createElement(c.Fragment,null,c.createElement(K,{className:"k-toolbar-button-separator"}),m("rtl"!==a?"prev":"next",i),m("rtl"!==a?"next":"prev",l)))},T=e=>{var t;const{toolbarRef:s,children:i,fillMode:l,size:u}=e,[p,m]=c.useState(!1),h=c.useRef(c.Children.toArray(i).filter((e=>c.isValidElement(e))).map(((e,t)=>c.cloneElement(e,{key:e.key||t})))),f=c.useRef([]),v=c.useRef(0),b=c.useRef(null),g=c.useRef(null),y=a.useLocalization(),[k,C]=c.useReducer((e=>e+1),0),I=()=>{if(!s.current)return;let e=0;const t=s.current.clientWidth,n=parseInt(window.getComputedStyle(s.current).gap||"0",10),o=Array.from(s.current.children).reduce(((e,t,s)=>e+=Math.ceil(t.clientWidth)),0),r=Array.from(s.current.children).length;if(e=o+r*n+2*n,e>t){const e=[...h.current],s=e.pop();v.current=t,h.current=e,s&&(f.current=[s,...f.current])}else if(t>v.current+n*r){const e=[...f.current],s=e.shift();f.current=e,s&&(h.current=[...h.current,s]),v.current=t}C()};c.useEffect((()=>{I();const e=new ResizeObserver(I),t=s.current;return t&&e.observe(t),()=>{t&&e.unobserve(t)}}),[]);return c.createElement(c.Fragment,null,h.current.length>0&&h.current,f.current.length>0&&c.createElement(c.Fragment,null,c.createElement(K,{_ref:g,className:"k-toolbar-button-separator"}),c.createElement(d,{ref:b,className:"k-toolbar-overflow-button",fillMode:"flat",svgIcon:r.moreHorizontalIcon,title:y.toLanguageString(z,M[z]),onClick:()=>{m(!p)}}),c.createElement(o.Popup,{anchor:s.current,show:p,popupClass:"k-toolbar-popup",style:{width:null==(t=s.current)?void 0:t.offsetWidth}},c.createElement("span",{className:`k-toolbar-items-list k-toolbar-items-list-${n.kendoThemeMaps.sizeMap[u]} k-toolbar-items-list-${l}`},f.current.length>0&&f.current))))},A=c.forwardRef(((e,t)=>{const{children:s,className:o,id:r,ariaLabel:a,keyboardNavigation:i,role:l,onResize:d,style:u,tabIndex:p=L.tabIndex,size:m=L.size,fillMode:h=L.fillMode,overflow:f,scrollButtons:v=L.scrollButtons,scrollButtonsPosition:b=L.scrollButtonsPosition,buttonScrollSpeed:g=L.buttonScrollSpeed,prevButton:y,nextButton:k,_ariaControls:C}=e,I=c.useRef(!1),x=c.useRef(null),w=c.useRef(null),E=c.useRef(0),D=c.useRef(0),N=c.useRef([]),S=c.useRef({element:null,props:e}),[K,R]=c.useState(!1),[O,z]=c.useState(!0),[M,F]=c.useState(!1),A=n.useDir(x,e.dir),$=c.useMemo((()=>e.buttons||B),[e.buttons]),W=c.useMemo((()=>$.map((e=>e+":focus")).join(",")),[$]),U=()=>{const e=x.current&&x.current.querySelector(W);return Math.max(0,N.current.findIndex((t=>t===e)))};c.useImperativeHandle(S,(()=>({element:x.current,props:e}))),c.useImperativeHandle(t,(()=>S.current)),c.useEffect((()=>(window.addEventListener("resize",q),x.current&&(D.current=x.current.offsetWidth,E.current=x.current.offsetHeight,!1!==i&&(N.current=Array.from(x.current.querySelectorAll($.join(","))),H(0))),()=>{window.removeEventListener("resize",q),N.current.length=0})),[]),c.useEffect((()=>{if(I.current){if(!x.current||!1===i)return;N.current=Array.from(x.current.querySelectorAll($.join(","))),H(U()),V()}else I.current=!0}));const H=e=>{N.current.forEach(((t,s)=>{t.tabIndex=s===e?p:-1}))},j=(e,t)=>{const s=N.current[t];if(s){s.tabIndex=p,s.focus();const t=N.current[e];t&&(t.tabIndex=-1)}},q=e=>{if(!x.current)return;const t=x.current.offsetWidth,s=x.current.offsetHeight;if(D.current!==t||E.current!==s){D.current=t,E.current=s;const n={offsetWidth:D.current,offsetHeight:E.current};d&&d.call(void 0,{target:S.current,...n,nativeEvent:e})}V()},V=c.useCallback((()=>{const e=w.current;e&&R(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)}),[]),G=c.useCallback((()=>{const e=w.current;if(e){const t=0===e.scrollLeft,s="rtl"!==A?e.scrollLeft+e.clientWidth===e.scrollWidth:e.clientWidth-e.scrollLeft===e.scrollWidth;t&&z(!0),s&&F(!0),!t&&!s&&(z(!1),F(!1))}}),[A]);return c.useEffect((()=>{const e=w.current;if(e)return e.addEventListener("scroll",G),()=>{e.removeEventListener("scroll",G)}}),[G]),c.createElement("div",{id:r,"aria-label":a,"aria-controls":C,className:n.classNames("k-toolbar",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[m]||m}`]:m,[`k-toolbar-${h}`]:h,"k-toolbar-scrollable":"scroll"===f,"k-toolbar-scrollable-overlay":"scroll"===f&&("hidden"===v||void 0===v),"k-toolbar-scrollable-start":"scroll"===f&&"hidden"===v&&O,"k-toolbar-scrollable-end":"scroll"===f&&"hidden"===v&&M,"k-toolbar-section":e.overflow&&"section"===f},o),style:u,role:void 0!==l?l||void 0:"toolbar",dir:A,ref:x,onKeyDown:!1!==i?e=>{const t=e.keyCode===n.Keys.left||e.keyCode===n.Keys.right||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end,s=U();!t||e.defaultPrevented||-1===N.current.findIndex((t=>t===e.target))||(e.keyCode===n.Keys.left?j(s,0===s?N.current.length-1:s-1):j(s,s===N.current.length-1?0:s+1),e.keyCode===n.Keys.home&&j(s,0),e.keyCode===n.Keys.end&&j(s,N.current.length-1))}:void 0},"scroll"===f&&c.createElement(P,{scrollButtons:v,scrollButtonsPosition:b,prevButton:y,nextButton:k,isOverflowing:K,scrollContentRef:w,buttonScrollSpeed:g,dir:A,isScrollStartPosition:O,isScrollEndPosition:M,children:s}),"section"===f&&c.createElement(T,{toolbarRef:x,fillMode:h,size:m},s),("none"===f||void 0===f)&&s)})),L={tabIndex:0,size:"medium",fillMode:"solid",scrollButtons:"auto",scrollButtonsPosition:"split",buttonScrollSpeed:100};A.displayName="KendoReactToolbar",A.propTypes={tabIndex:s.number,dir:s.string,keyboardNavigation:s.bool,style:s.object,className:s.string,role:s.string,onResize:s.func,buttons:s.arrayOf(s.string.isRequired),size:s.oneOf([null,"small","medium","large"]),fillMode:s.oneOf([null,"solid","flat","outline"]),overflow:s.oneOf(["none","section","scroll"]),scrollButtons:s.oneOf(["hidden","visible","auto"]),scrollButtonsPosition:s.oneOf(["start","end","split"]),buttonScrollSpeed:s.number};const $=c.forwardRef(((e,t)=>{const{id:s,className:o,style:r,children:a}=e,i=c.useRef(null);return c.useImperativeHandle(t,(()=>({element:i.current}))),c.createElement("div",{id:s,className:n.classNames("k-toolbar-item",o),style:r,ref:i},a)}));$.displayName="KendoReactToolbarItem",$.propTypes={className:s.string};const W=c.forwardRef(((e,t)=>{const s=c.useRef(null),o=c.useRef(null);c.useImperativeHandle(o,(()=>({element:s.current}))),c.useImperativeHandle(t,(()=>({element:s.current})));const r=c.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return c.createElement("span",{ref:s,className:r})}));W.displayName="KendoReactToolbarSpacer",W.propTypes={className:s.string};const U=t.createContext([null,e=>{}]),H=t.createContext([null,e=>{}]),j=t.createContext([null,e=>{}]);var q=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(q||{});var V=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(V||{});var G=(e=>(e.toggle="toggle",e.remove="remove",e))(G||{});const Z=c.forwardRef(((e,t)=>{const s=c.useRef(null),o=c.useRef(null),{disabled:a=J.disabled,fillMode:i=J.fillMode,themeColor:l=J.themeColor,size:d=J.size,rounded:u=J.rounded,dir:p=J.dir,removeIcon:m=J.removeIcon,removeSvgIcon:h=J.removeSvgIcon,removable:f=J.removable}=e,v=n.useDir(o,p);c.useImperativeHandle(s,(()=>({element:o.current,props:e}))),c.useImperativeHandle(t,(()=>s.current));const[b,g]=c.useContext(U),[y,k]=c.useContext(H),[,C]=c.useContext(j),I=c.useMemo((()=>e.selected||(Array.isArray(b)?b.some((t=>t===e.value)):b===e.value)),[e.selected,e.value,b]),x=c.useMemo((()=>y===e.value),[e.value,y]);c.useEffect((()=>{x&&o.current&&o.current.focus()}),[x]);const w=c.useCallback((t=>{g({type:G.toggle,payload:e.value,event:t})}),[g,e.value]),E=c.useCallback((t=>{f&&(C({type:V.remove,payload:e.value,event:t}),k({type:q.reset,payload:e.value,event:t}),g({type:G.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,f,C,k,g]),D=c.useCallback((t=>{switch(t.keyCode){case n.Keys.left:k({type:q.prev,payload:e.value,event:t});break;case n.Keys.right:k({type:q.next,payload:e.value,event:t});break;case n.Keys.enter:g({type:G.toggle,payload:e.value,event:t});break;case n.Keys.delete:E(t)}e.onKeyDown&&e.onKeyDown.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onKeyDown,e.value,k,g,E]),N=c.useCallback((t=>{k({payload:e.value,type:q.current,event:t}),e.onFocus&&e.onFocus.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onFocus,e.value,k]),S=c.useCallback((t=>{e.onBlur&&e.onBlur.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onBlur]),B=n.useMouse(e,s,{onClick:w});return c.createElement("div",{...B,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:v,tabIndex:n.getTabIndex(e.tabIndex,a,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===v,"k-disabled":a,"k-selected":I,"k-focus":x,[`k-chip-${n.kendoThemeMaps.sizeMap[d]||d}`]:d,[`k-rounded-${n.kendoThemeMaps.roundedMap[u]||u}`]:u,[`k-chip-${i}`]:i,[`k-chip-${i}-${l}`]:!(!i||!l)},e.className),"aria-pressed":e.role?void 0:I,"aria-disabled":a,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":f?"Enter Delete":void 0,onFocus:N,onBlur:S,onKeyDown:D},I&&(e.selectedIcon||e.selectedSvgIcon)&&c.createElement(n.IconWrap,{className:"k-chip-icon",name:e.selectedIcon?n.toIconName(e.selectedIcon):void 0,icon:e.selectedSvgIcon,size:"small"}),(e.icon||e.svgIcon)&&c.createElement(n.IconWrap,{className:"k-chip-icon",name:e.icon?n.toIconName(e.icon):void 0,icon:e.svgIcon,size:"small"}),e.avatar&&c.createElement("div",{className:`k-chip-avatar k-avatar k-rounded-${e.avatar.rounded} k-avatar-md k-avatar-solid k-avatar-solid-primary`,style:e.avatar.style},c.createElement("span",{className:"k-avatar-image"},c.createElement("img",{src:e.avatar.image,alt:e.avatar.imageAlt}))),c.createElement("span",{className:"k-chip-content"},void 0!==e.children?e.children:e.text&&c.createElement("span",{"aria-label":e.ariaLabel||e.text,className:"k-chip-label"},e.text)),f&&c.createElement("span",{className:"k-chip-actions"},c.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:E},c.createElement(n.IconWrap,{name:m?n.toIconName(m):void 0,icon:h||r.xCircleIcon,size:"small"}))))})),_={id:s.string,text:s.string,value:s.any,dir:s.oneOf(["ltr","rtl"]),removable:s.bool,removeIcon:s.string,removeIconSvg:n.svgIconPropType,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,selectedIcon:s.string,selectedIconSvg:n.svgIconPropType,onRemove:s.func,dataItem:s.any,selected:s.bool,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"outline","solid"]),themeColor:s.oneOf([null,"base","info","success","warning","error"])},J={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:r.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};Z.displayName="KendoReactChip",Z.propTypes=_;const Q=(e,t,s)=>{"multiple"===t.selection?Array.isArray(e)||(e=e?[e]:null):"single"===t.selection&&Array.isArray(e)&&(e=e?e.join(""):null);const[n,o]=c.useState(e);return[n,e=>{const r=((e,t)=>{switch(t.selection){case"single":switch(t.type){case"toggle":if(!Array.isArray(e)||null===e)return t.payload===e?null:t.payload;throw new Error("State cannot be an array in single selection");case"remove":return t.payload===e?null:e;default:return e}case"multiple":switch(t.type){case"toggle":if(Array.isArray(e))return e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload];if(null===e)return[t.payload];throw new Error("State cannot be non-array in multiple selection");case"remove":return Array.isArray(e)?e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload]:e;default:return e}case"none":return null;default:return e}})(t.state||n,{...e,...t});s&&s(r,e.event),"none"!==t.selection&&o(r)}]},X=c.forwardRef(((e,t)=>{const s=c.useRef(null),o=c.useRef(null),{id:r,style:a,tabIndex:i,className:l,ariaDescribedBy:d,ariaLabelledBy:u,ariaLabel:p,value:m,defaultData:h=ee.defaultData,chip:f=ee.chip,disabled:v=ee.disabled,size:b=ee.size,defaultValue:g=ee.defaultValue,selection:y=ee.selection,valueField:k=ee.valueField,textField:C=ee.textField,dir:I=ee.dir,onChange:x,onDataChange:w}=e,E=n.useDir(o,I),D=c.useMemo((()=>f||Z),[f,Z]);c.useImperativeHandle(s,(()=>({element:o.current,props:e}))),c.useImperativeHandle(t,(()=>s.current));const N=c.useCallback(((e,t)=>{x&&s.current&&x.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[x]),[S,B]=Q(m||g,{selection:y,state:m},N),K=c.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[R,O]=((e,t,s)=>{const[n,o]=c.useState(e);return[n,e=>{const r=((e,t)=>{switch(t.type){case"add":case"reorder":break;case"remove":return e.filter((e=>e[t.valueField]!==t.payload));default:return e}})(t.state||n,{...e,...t});s&&s(r,e.event),o(r)}]})(e.data||h,{state:e.data,valueField:k},K),z=c.useCallback(((e,t)=>(e.push(t[k]),e)),[k]),M=c.useMemo((()=>e.data||R),[e.data,R]),F=c.useMemo((()=>m||S),[m,S]),P=c.useMemo((()=>M.reduce(z,[])),[M,z]),T=c.useCallback((e=>n.getter(k)(e)),[k]),A=c.useCallback((e=>n.getter(C)(e)),[C]),[L,$]=(e=>{const[t,s]=c.useState(null);return[t,t=>{const n=((e,t)=>{const s=t.items.findIndex((t=>t===e));switch(t.type){case"next":return s===t.items.length-1?e:t.items[s+1];case"prev":return 0===s?e:t.items[s-1];case"current":return t.payload;case"reset":return null;default:return e}})(t.payload,{...t,...e});s(n)}]})({items:P}),W=n.useMouse(e,s);return c.createElement(U.Provider,{value:[F,B]},c.createElement(H.Provider,{value:[L,$]},c.createElement(j.Provider,{value:[M,O]},c.createElement("div",{ref:o,...W,role:v?void 0:"listbox",id:r,dir:E,style:a,tabIndex:n.getTabIndex(i,v,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===E,"k-disabled":v,[`k-chip-list-${n.kendoThemeMaps.sizeMap[b]||b}`]:b},l),"aria-label":p,"aria-labelledby":u,"aria-describedby":d,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===y},M.map(((e,t)=>c.createElement(D,{role:"option",dataItem:e,size:b,key:[T(e),t].join("-"),text:A(e),value:T(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),Y={id:s.string,className:s.string,tabIndex:s.number,data:s.any,defaultData:s.arrayOf(s.any),onDataChange:s.func,value:s.oneOfType([s.any,s.arrayOf(s.any)]),defaultValue:s.oneOfType([s.any,s.arrayOf(s.any)]),onChange:s.func,selection:s.oneOf(["single","none","multiple"]),textField:s.string,valueField:s.string,disabled:s.bool,dir:s.oneOf(["ltr","rtl"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"])},ee={chip:Z,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};X.displayName="KendoReactChipList",X.propTypes=Y;const te=c.forwardRef(((e,t)=>{const{className:s,disabled:o,text:r,icon:a,style:i,id:l,focused:d,tabIndex:u,index:p,dataItem:m,item:h,svgIcon:f,onDown:v,onClick:b,...g}=e,y=c.useRef(null),k=c.useCallback((()=>{y.current&&y.current.focus()}),[]),C=c.useCallback((()=>({element:y.current,focus:k})),[k]);c.useImperativeHandle(t,C);const I=c.useCallback((e=>{b&&void 0!==p&&!o&&b(e,p)}),[b,p]),x=c.useMemo((()=>n.classNames("k-fab-item",{"k-focus":d,"k-disabled":o},s)),[s,o,d]),w=h;return c.createElement("li",{ref:y,id:l,className:x,style:i,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${r||""} floatingactionbutton item`,onClick:I,onMouseDown:v,onPointerDown:v,...g},w?c.createElement(w,{itemIndex:p,item:m}):c.createElement(c.Fragment,null,r&&c.createElement("span",{className:"k-fab-item-text"},r),a||f?c.createElement(n.IconWrap,{className:"k-fab-item-icon",name:a,icon:f}):null))}));te.propTypes={className:s.string,style:s.object,children:s.any,disabled:s.bool,focused:s.bool,index:s.number,icon:s.string,svgIcon:n.svgIconPropType,text:s.string,tabIndex:s.number,customProp:s.any},te.displayName="KendoFloatingActionButtonItem";const se="16px",ne=e=>"number"==typeof e?e+"px":e,oe=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},re=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},ae=(e,t)=>({rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[e]["end"===t?"end":"start"]),ie=(e,t,s,n)=>{const o=t.horizontal,r=t.vertical;if(e.current){const a=s&&void 0!==s.x?ne(s.x):se,i=s&&void 0!==s.x?`calc(50% + ${ne(s.x)})`:"50%",l=s&&void 0!==s.y?ne(s.y):se,c=s&&void 0!==s.y?`calc(50% + ${ne(s.y)})`:"50%";e.current.style.setProperty(le(t,n),"center"===o?i:a),e.current.style.setProperty(ce(t),"middle"===r?c:l),n&&(("top"===r||"bottom"===r)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===r&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===r&&"start"===o&&e.current.style.setProperty("left","unset"))}},le=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},ce=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),de=c.forwardRef(((e,t)=>{const{align:s=ue.align,alignOffset:r,className:a,disabled:i,icon:l,svgIcon:d,iconClass:u,id:p,items:m,item:h,text:f,positionMode:v=ue.positionMode,size:b=ue.size,style:g,rounded:y=ue.rounded,themeColor:k=ue.themeColor,overlayStyle:C,tabIndex:I,accessKey:x,popupSettings:w={},modal:E,onClick:D,onItemClick:N,onFocus:S,onBlur:B,onKeyDown:K,onOpen:R,onClose:O,...z}=e,M=n.useZIndexContext(),F=M?M+2:100,P=c.useRef(null),T=c.useRef(null),A=c.useRef(null),L=c.useRef(null),$=c.useCallback((()=>{T.current&&T.current.focus()}),[]),W=c.useCallback((()=>({element:T.current,focus:$})),[$]);c.useImperativeHandle(P,W),c.useImperativeHandle(t,(()=>P.current));const[U,H]=c.useState(!1),[j,q]=c.useState(!1),[V,G]=c.useState(-1),Z=n.useId()+"-button-id",_=n.useDir(T,e.dir),J="rtl"===_,Q=n.useId()+"-list-id";c.useEffect((()=>{ie(T,s,r,J)}),[T,s,r,J]),c.useEffect((()=>{j&&T&&T.current&&T.current.focus()}),[j,T]);const X=c.useCallback(((e,t)=>{m&&n.dispatchEvent(t?R:O,e,W(),void 0)}),[R,O,m]),Y=c.useCallback((e=>{!e.target||i||(!m&&D?n.dispatchEvent(D,e,W(),void 0):(H(!U),q(!0),G(U?-1:0),X(e,!U)))}),[H,q,G,D,X,U,m,i]),ee=c.useCallback((e=>{q(!0),G(U?0:-1),S&&n.dispatchEvent(S,e,W(),void 0)}),[S,q,G]),se=c.useCallback((e=>{q(!1),H(!1),G(-1),n.dispatchEvent(B,e,W(),void 0),U&&X(e,!1)}),[B,q,H,G,X]),ne=c.useCallback((e=>{e.preventDefault()}),[]),le=c.useCallback(((e,t)=>{m&&(m[t].disabled||n.dispatchEvent(N,e,W(),{itemProps:m[t],itemIndex:t}))}),[N]),ce=c.useCallback(((e,t)=>{!e.target||!m||(G(t),H(!1),le(e,t),X(e,!1))}),[G,H,le,X]),de=c.useCallback((e=>{n.getActiveElement(document)===T.current&&e.preventDefault()}),[T]),pe=c.useCallback((e=>{const t=V,s=m?m.length:-1;if(e.altKey)return!U&&e.keyCode===n.Keys.down&&(e.preventDefault(),H(!0),G(0)),void(U&&e.keyCode===n.Keys.up&&(e.preventDefault(),H(!1),G(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&le(e,t),m||Y(e),e.preventDefault(),H(!U),G(U?-1:0);break;case n.Keys.esc:e.preventDefault(),H(!1),G(-1);break;case n.Keys.home:e.preventDefault(),G(0);break;case n.Keys.end:e.preventDefault(),G(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),G(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),G(t-1<0?s-1:t-1)}n.dispatchEvent(K,e,W(),void 0)}),[K,V,G,J,H]),me=c.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===b,"k-fab-md":"medium"===b,"k-fab-lg":"large"===b,"k-disabled":i,"k-pos-absolute":"absolute"===v,"k-pos-fixed":"fixed"===v,"k-focus":j,[`k-rounded-${n.kendoThemeMaps.roundedMap[y]||y}`]:y,[`k-fab-solid-${k}`]:k},`k-${s.vertical}-${s.horizontal}`,a)),[k,b,y,i,v,s,j,a]),he=m&&m.map(((e,t)=>c.createElement(te,{...e,key:t,index:t,id:`${Q}-${t}`,disabled:i||e.disabled,focused:V===t,dataItem:e,item:h,className:n.classNames(e.className,ae(_||"ltr",s.horizontal)),onClick:ce,onDown:de}))),fe=!(!l&&!d||f),ve=(T.current?T.current.offsetWidth:0)/2-16;let be;return be=l||d?c.createElement(n.IconWrap,{className:"k-fab-icon",name:l,icon:d}):u?c.createElement("span",{role:"presentation",className:u}):null,c.createElement(n.ZIndexContext.Provider,{value:F},c.createElement(c.Fragment,null,c.createElement("button",{ref:T,id:p||Z,role:"button",type:"button","aria-disabled":i,"aria-expanded":m?U:void 0,"aria-haspopup":!!m,"aria-label":`${f||""} floatingactionbutton`,"aria-owns":m?Q:void 0,"aria-activedescendant":V>=0&&m?`${Q}-${V}`:void 0,tabIndex:n.getTabIndex(I,i),accessKey:x,dir:_,disabled:i,className:me,style:g,onClick:Y,onMouseDown:ne,onFocus:ee,onBlur:se,onKeyDown:pe,...z},be,f&&c.createElement("span",{className:"k-fab-text"},f)),E&&U&&c.createElement("div",{className:"k-overlay",style:{zIndex:F,...C}}),c.createElement(o.Popup,{ref:L,anchor:T.current,show:U,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||oe(s,J),popupAlign:w.popupAlign||re(s,J),style:{boxShadow:"none"}},c.createElement("ul",{ref:A,role:"menu","aria-labelledby":p,id:Q,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:fe?ve:void 0,paddingRight:fe?ve:void 0}},he))))}));de.propTypes={className:s.string,style:s.object,id:s.string,dir:s.string,tabIndex:s.number,accessKey:s.string,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,text:s.string,alignOffset:s.shape({x:s.oneOfType([s.number,s.string]).isRequired,y:s.oneOfType([s.number,s.string]).isRequired}),align:s.shape({vertical:s.oneOf(["top","middle","bottom"]).isRequired,horizontal:s.oneOf(["start","center","end"]).isRequired}),positionMode:s.oneOf(["absolute","fixed"]),size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),themeColor:s.oneOf([null,"primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"]),modal:s.bool,overlayStyle:s.object};const ue={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};de.displayName="KendoFloatingActionButton";const pe="speechToTextButton.ariaLabel",me="speechToTextButton.title",he={[pe]:"Start speech recognition",[me]:"Speech to Text Button"},fe=t.forwardRef(((e,s)=>{const o=!n.validatePackage(y,{component:"SpeechToTextButton"}),l=a.useLocalization(),{fillMode:c="solid",rounded:u="medium",size:p="medium",themeColor:m="base",ariaLabel:h,svgIcon:f,disabled:v,iconSize:b="medium",title:g,className:k,id:C,style:I,lang:x="en-US",continuous:w=!1,interimResults:E=!1,maxAlternatives:D=1,integrationMode:N="webSpeech",onStart:S,onResult:B,onEnd:K,onError:R,...O}=e,z=t.useRef(null),M=t.useRef(!1),[F,P]=t.useState(!1),T="none"!==N,A=t.useCallback((async()=>{M.current=!0,P(!0),S&&await S()}),[S]),L=t.useCallback((async()=>{M.current=!1,P(!1),K&&await K()}),[K]),$=t.useCallback((e=>{const t=e.results,s=t[t.length-1],n=Array.from(s).map((e=>({transcript:e.transcript,confidence:e.confidence})));null==B||B({isFinal:s.isFinal,alternatives:n})}),[B]),W=t.useCallback((e=>{P(!1),M.current=!1,null==R||R({errorMessage:e.error})}),[R]),U=t.useCallback((()=>{var e;!M.current&&T&&(null==(e=z.current)||e.start())}),[T]),H=t.useCallback((()=>{var e;M.current&&T&&(null==(e=z.current)||e.stop())}),[T]),j=t.useCallback((()=>{var e;M.current&&T&&(null==(e=z.current)||e.abort(),M.current=!1,P(!1))}),[T]),q=()=>M.current;t.useImperativeHandle(s,(()=>({start:U,stop:H,abort:j,isActive:q}))),t.useEffect((()=>((()=>{var e;"undefined"==typeof window||"webkitSpeechRecognition"in window||"SpeechRecognition"in window?(null!=(e=z.current)&&e.isActive()&&z.current.stop(),z.current=new i.KendoSpeechRecognition({lang:x,continuous:w,interimResults:E,maxAlternatives:D,events:{start:A,end:L,result:$,error:W}})):R&&R({errorMessage:"Speech Recognition API is not supported in this browser."})})(),()=>{M.current&&H()})),[x,w,E,D,N]);const V=void 0!==e.icon||void 0!==e.iconClass||void 0!==e.imageUrl,G=t.useMemo((()=>F?r.stopSmIcon:f||r.microphoneOutlineIcon),[F,f]);return t.createElement(t.Fragment,null,t.createElement(d,{id:C,className:n.classNames({"k-speech-to-text-button":!0,"k-listening":F},k),style:I,svgIcon:V?void 0:G,iconSize:b,fillMode:c,rounded:u,size:p,themeColor:m,"aria-label":null!=h?h:l.toLanguageString(pe,he[pe]),"aria-pressed":F,disabled:v,title:null!=g?g:l.toLanguageString(me,he[me]),onClick:()=>{F?H():U()},...O},e.children),o&&t.createElement(n.WatermarkOverlay,null))}));fe.displayName="KendoSpeechToTextButton";const ve=n.withIdHOC(N);ve.displayName="KendoReactDropDownButton";const be=n.withIdHOC(C);be.displayName="KendoReactSplitButton",e.Button=d,e.ButtonGroup=p,e.Chip=Z,e.ChipList=X,e.DropDownButton=ve,e.DropDownButtonClassComponent=N,e.DropDownButtonItem=x,e.FloatingActionButton=de,e.FloatingActionButtonItem=te,e.SpeechToTextButton=fe,e.SplitButton=be,e.SplitButtonClassComponent=C,e.SplitButtonItem=f,e.Toolbar=A,e.ToolbarItem=$,e.ToolbarSeparator=K,e.ToolbarSpacer=W,e.toolbarButtons=B}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-intl"),require("@progress/kendo-webspeech-common")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-svg-icons","@progress/kendo-react-intl","@progress/kendo-webspeech-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactButtons={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactPopup,e.KendoSvgIcons,e.KendoReactIntl,e.KendoWebspeechCommon)}(this,(function(e,t,s,n,o,r,a,i){"use strict";function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var c=l(t);const d=c.forwardRef(((e,t)=>{const{children:s,togglable:o,dir:r,disabled:a,selected:i,icon:l,iconClass:d,svgIcon:p,imageUrl:m,imageAlt:h,className:f,startIcon:v,endIcon:b,onClick:g,size:y=u.size,rounded:k=u.rounded,fillMode:C=u.fillMode,themeColor:I=u.themeColor,ariaPressed:x,iconSize:w,...E}=e,D=c.useRef(void 0),N=c.useRef(null),[S,B]=c.useState(!0===o&&!0===i),K=void 0!==p||void 0!==l||void 0!==d||void 0!==m,R=void 0!==s,O=n.useUnstyled(),M=e.unstyled||O,z=M&&M.uButton;c.useImperativeHandle(t,(()=>({element:N.current,selected:void 0!==D.current?D.current:S}))),c.useMemo((()=>{o&&void 0!==i&&i!==S&&B(i)}),[o,i]),c.useEffect((()=>{D.current=void 0}),[S]);const F=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:r,buttonClasses:a,iconSize:i}){return e?c.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:a})),alt:r,src:e}):t||o?c.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:a})),name:t,icon:o,size:i}):s?c.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:a}),s)}):null}({name:l,svgIcon:p,iconClass:d,imageUrl:m,imageAlt:h,buttonClasses:z,iconSize:w}),P=e=>c.cloneElement(e,{className:n.classNames(n.uButton.icon({c:z}),e.props.className)}),T=c.useMemo((()=>o?S:x||void 0),[]);return c.createElement("button",{ref:N,"aria-pressed":T,...E,dir:r,disabled:a,onClick:e=>{o&&void 0===i&&(D.current=!S,B(!S)),g&&g.call(void 0,e)},className:n.classNames(n.uButton.wrapper({c:z,isRtl:"rtl"===r,selected:S,disabled:a,size:y,fillMode:C,rounded:k,themeColor:I,iconButton:!R&&K}),f)},v&&P(v),F,s&&c.createElement("span",{className:n.classNames(n.uButton.text({c:z}))},s),b&&P(b))})),u={togglable:!1,size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};d.displayName="KendoReactButton",d.propTypes={children:s.node,selected:s.bool,togglable:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,imageAlt:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"flat","link","outline","solid","clear"]),themeColor:s.oneOf([null,"base","primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"])};const p=e=>{const{children:t,className:s,dir:o,disabled:r,width:a}=e,i=n.useUnstyled(),l=e.unstyled||i,d=l&&l.uButtonGroup,u=(e,t)=>{const s={...a?{width:a}:{},...e.props.style||{}},n=r||e.props.disabled,o={...e.props,...t?{className:t}:{},...Object.keys(s).length?{style:s}:{},...void 0!==n?{disabled:n}:{}};return c.Children.count(e.props.children)>0?c.cloneElement(e,o,e.props.children):c.cloneElement(e,o)},p=c.useRef(null),m=(e=>{const t=c.Children.count(e),s=void 0!==o?"rtl"===o:p.current&&"rtl"===getComputedStyle(p.current).direction||!1;return c.Children.map(e,((e,o)=>{if(c.isValidElement(e)){const r=o===t-1,a=s,i=n.classNames(e.props.className,n.uButtonGroup.position({c:d,start:a?r:0===o,end:a?0===o:r}));return u(e,i)}return e}))})(t),h=n.classNames(n.uButtonGroup.wrapper({c:d,stretched:!!a,disabled:r}),s),f={className:h,style:{width:`${a}`},dir:o,role:"group","aria-disabled":r};return c.createElement("div",{ref:p,...f,className:h},m)};p.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};const m=e=>{const t=n.useUnstyled(),s=e.unstyled||t,o=s&&s.uDropDownButton,r=c.useCallback((t=>{e.onClick(t,e.index)}),[e]),a=e.dataItem.render||e.item||(void 0===e.item?e.render:null),i=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,l=c.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:o,focused:e.focused}),e.className),tabIndex:-1,onClick:r,onMouseDown:e.onDown,onPointerDown:e.onDown,role:"menuitem","aria-disabled":e.dataItem.disabled||void 0},c.createElement("span",{tabIndex:-1,className:n.classNames(n.uDropDownButton.link({c:o,selected:e.dataItem.selected,disabled:e.dataItem.disabled})),key:"icon"},a?c.createElement(a,{item:e.dataItem,itemIndex:e.index}):c.createElement(c.Fragment,null,(e.dataItem.icon||e.dataItem.iconClass||e.dataItem.svgIcon)&&c.createElement(n.IconWrap,{className:e.dataItem.iconClass,name:e.dataItem.icon,icon:e.dataItem.svgIcon}),e.dataItem.imageUrl&&c.createElement("img",{role:"presentation",alt:"",src:e.dataItem.imageUrl,className:"k-icon"}),i&&c.createElement("span",{className:"k-menu-link-text"},i))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,l,e):l};m.displayName="KendoReactButtonItem";const h=class extends c.Component{render(){return null}};h.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,disabled:s.bool,render:s.any};let f=h;const v=(e,t,s,o)=>{if(s)return e;const r=Math.min(o-1,Math.max(0,e));switch(t){case n.Keys.enter:case n.Keys.space:case n.Keys.esc:return-1;case n.Keys.up:case n.Keys.left:return r-1<0?o-1:r-1;case n.Keys.down:case n.Keys.right:return r+1>=o?0:r+1;case n.Keys.home:return 0;case n.Keys.end:return o-1;default:return e}};function b(e){const t={horizontal:"left",vertical:"bottom"};return e&&(t.horizontal="right"),t}function g(e){const t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const y={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"11.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},k=class extends c.Component{constructor(e){super(e),this.state={focused:!1,focusedIndex:-1,opened:!1},this.wrapper=null,this.mainButton=null,this.list=null,this.skipFocus=!1,this.buttonsData=[],this.showLicenseWatermark=!1,this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setState({focusedIndex:0}),this.setOpen(!0,e)));let s;if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){if(e.preventDefault(),this.dispatchClickEvent(e,t),t>=0){s={focusedIndex:this.opened?-1:0};const t=!this.opened;this.setOpen(t,e)}}else if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=v(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const r=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(r||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}s&&this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.onFocus=e=>{this.skipFocus||(n.dispatchEvent(this.props.onFocus,e,this,void 0),this.setState({focused:!0}))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.opened&&this.setState({focusedIndex:0}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onSplitPartClick=e=>{if(this.buttonsData.length){const t=!this.opened;this.setState({focusedIndex:t?0:-1,focused:!0}),this.setOpen(t,e)}},this.onDownSplitPart=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},this.showLicenseWatermark=!n.validatePackage(y,{component:"SplitButton"}),this.licenseMessage=n.getLicenseMessage(y)}get guid(){return this.props.id?this.props.id+"-accessibility-id":this.props.id}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){this.buttonsData=this.props.items||c.Children.toArray(this.props.children).filter((e=>e&&e.type===f)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:a,disabled:i}=this.props;return c.createElement(c.Fragment,null,c.createElement("div",{id:s,style:o,className:n.classNames("k-split-button","k-button-group",{"k-focus":this.state.focused},`k-rounded-${n.kendoThemeMaps.roundedMap[this.props.rounded||"medium"]}`,this.props.className),onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,dir:t,ref:e=>{this.wrapper=e}},c.createElement(d,{ref:e=>{this.mainButton=e&&e.element},type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,onClick:e=>this.onItemClick(e,-1),disabled:i||void 0,tabIndex:a,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,startIcon:this.props.startIcon,endIcon:this.props.endIcon,imageUrl:this.props.imageUrl,dir:t,"aria-disabled":i,"aria-haspopup":!0,"aria-expanded":this.opened||void 0,"aria-label":this.props.ariaLabel,"aria-controls":this.opened?this.guid:void 0,id:"button-"+this.guid,title:this.props.title},this.props.text),c.createElement(d,{type:"button",size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode,themeColor:this.props.themeColor,icon:"caret-alt-down",svgIcon:r.caretAltDownIcon,className:"k-split-button-arrow",disabled:i||void 0,tabIndex:-1,onClick:this.onSplitPartClick,onMouseDown:this.onDownSplitPart,onPointerDown:this.onDownSplitPart,dir:t,"aria-label":"menu toggling button"}),this.renderPopup(e)),this.showLicenseWatermark&&c.createElement(n.WatermarkOverlay,{message:this.licenseMessage}))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||(-1===t?n.dispatchEvent(this.props.onButtonClick,e,this,void 0):n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t}))}renderPopup(e){const{popupSettings:t={}}=this.props,{focusedIndex:s}=this.state;return c.createElement(o.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:n.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||b(e),popupAlign:t.popupAlign||g(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},c.createElement("ul",{role:"menu",id:this.guid,"aria-labelledby":"button-"+this.guid,tabIndex:-1,ref:this.listRef,"aria-activedescendant":s>=0?`${this.guid}-${s}`:void 0,className:n.classNames("k-menu-group",{[`k-menu-group-${n.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size})},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props;return this.buttonsData.length>0?this.buttonsData.map(((o,r)=>c.createElement(m,{className:n.classNames("k-menu-item",{"k-first":0===r},{"k-last":r===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===r,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,key:r,index:r,id:`${this.guid}-${r}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};k.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onButtonClick:s.func,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,text:s.string,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.any,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},k.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let C=k;const I=class extends c.Component{render(){return null}};I.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let x=I;const w=class extends c.Component{constructor(e){super(e),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!1,this.showLicenseWatermark=!1,this.buttonsData=[],this.onKeyDown=e=>{const{focusedIndex:t}=this.state;if(e.altKey)return void(this.opened||e.keyCode!==n.Keys.down?this.opened&&e.keyCode===n.Keys.up&&(e.preventDefault(),this.setState({focusedIndex:-1}),this.setOpen(!1,e)):(e.preventDefault(),this.setOpen(!0,e),this.setState({focusedIndex:0})));const s={...this.state};if(e.keyCode===n.Keys.enter||e.keyCode===n.Keys.space){e.preventDefault(),t>=0&&this.dispatchClickEvent(e,t);const s=!this.opened;return this.setState({focused:!0,focusedIndex:s?0:-1}),void this.setOpen(s,e)}if(this.opened&&e.keyCode===n.Keys.esc)return this.setState({focusedIndex:-1}),void this.setOpen(!1,e);if(this.opened){const o=v(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const r=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(r||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end)&&e.preventDefault()}this.setState(s)},this.switchFocus=e=>{this.skipFocus=!0,e(),window.setTimeout((()=>this.skipFocus=!1),0)},this.handleFocus=e=>{this.skipFocus||(this.setState({focused:!0,focusedIndex:this.opened?0:-1}),n.dispatchEvent(this.props.onFocus,e,this,void 0))},this.handleButtonBlur=e=>{this.opened||(this.setState({focused:!1}),n.dispatchEvent(this.props.onBlur,e,this,void 0))},this.handleMenuBlur=e=>{this.skipFocus||(this.setState({focused:!1,focusedIndex:-1}),n.dispatchEvent(this.props.onBlur,e,this,void 0),setTimeout((()=>{this.setOpen(!1,e)}),0))},this.setOpen=(e,t)=>{this.opened!==e&&(this.openedDuringOnChange=e,this.setState({opened:e}),t?this.dispatchPopupEvent(t,e):this.openedDuringOnChange=void 0)},this.onItemClick=(e,t)=>{this.setState({focusedIndex:-1}),this.dispatchClickEvent(e,t),this.setOpen(!1,e)},this.onItemDown=e=>{n.getActiveElement(document)===this.list&&e.preventDefault()},this.mouseDown=e=>{e.preventDefault();const t=n.getActiveElement(document);this.element&&t!==this.element&&t!==this.list&&this.element.focus()},this.onPopupClose=e=>{var t;const s=n.getActiveElement(document);this.element&&this.element.removeAttribute("tabindex"),(s===this.list||null!=(t=this.list)&&t.contains(s))&&this.switchFocus((()=>{this.element&&this.element.focus({preventScroll:!0})})),this.props.popupSettings&&this.props.popupSettings.onClose&&this.props.popupSettings.onClose.call(void 0,e)},this.listRef=e=>{this.list=e,e&&this.state.focused&&this.switchFocus((()=>{e.focus({preventScroll:!0}),this.element&&(this.element.tabIndex=-1)}))},this.onClickMainButton=e=>{if(!this.buttonsData.length)return;const t=!this.opened;this.setState({focused:!0,focusedIndex:t?0:-1}),this.setOpen(t,e)},this.dispatchPopupEvent=(e,t)=>{n.dispatchEvent(t?this.props.onOpen:this.props.onClose,e,this,void 0),this.openedDuringOnChange=void 0},this.showLicenseWatermark=!n.validatePackage(y,{component:"DropDownButton"}),this.licenseMessage=n.getLicenseMessage(y)}get guid(){return this.props.id+"-accessibility-id"}get opened(){return void 0!==this.openedDuringOnChange?this.openedDuringOnChange:void 0===this.props.opened?this.state.opened:this.props.opened}render(){const e=this.isRtl(),t=this.props.unstyled&&this.props.unstyled.uDropDownButton,s=e?"rtl":void 0,{id:o,style:r,tabIndex:a,disabled:i,size:l,rounded:u,fillMode:p,themeColor:m,ariaLabel:h,title:f,accessKey:v,icon:b,svgIcon:g,iconClass:y,buttonClass:k,className:C,imageUrl:I,startIcon:w,endIcon:E}=this.props;return this.buttonsData=this.props.items||c.Children.toArray(this.props.children).filter((e=>e&&e.type===x)).map((e=>e.props)),c.createElement(c.Fragment,null,c.createElement(d,{id:o,size:l,style:r,rounded:u,fillMode:p,themeColor:m,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":i?"true":void 0,tabIndex:a,accessKey:v,icon:b,svgIcon:g,iconClass:y,className:n.classNames(k,C,n.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:i})),imageUrl:I,dir:s,ref:e=>{this.mainButton=(null==e?void 0:e.element)||null},type:"button","aria-expanded":this.opened?"true":"false","aria-label":h,"aria-controls":this.opened?this.guid:void 0,title:f,startIcon:w,endIcon:E},this.props.text),this.showLicenseWatermark&&c.createElement(n.WatermarkOverlay,{message:this.licenseMessage}),this.renderPopup(e))}componentDidMount(){(void 0===this.props.dir&&this.isRtl()||this.opened)&&this.forceUpdate()}get element(){return this.mainButton}dispatchClickEvent(e,t){this.isItemDisabled(t)||n.dispatchEvent(this.props.onItemClick,e,this,{item:this.buttonsData[t],itemIndex:t})}renderPopup(e){const{popupSettings:t={},_zIndex:s,unstyled:r}=this.props,a=s?s+2e3:12e3,i=r&&r.uDropDownButton,{focusedIndex:l}=this.state;return c.createElement(n.ZIndexContext.Provider,{value:a},c.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:i}),t.popupClass),anchorAlign:t.anchorAlign||b(e),popupAlign:t.popupAlign||g(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},c.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":l>=0?`${this.guid}-${l}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:i,size:this.props.size}))},this.renderChildItems())))}renderChildItems(){const{item:e,itemRender:t,textField:s,unstyled:o}=this.props,r=o&&o.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map(((o,a)=>c.createElement(m,{className:n.classNames(n.uDropDownButton.item({c:r}),o.className,{"k-first":0===a},{"k-last":a===this.buttonsData.length-1}),dataItem:o,textField:s,focused:this.state.focusedIndex===a,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:a,key:a,id:`${this.guid}-${a}`}))):null}isItemDisabled(e){return this.buttonsData[e]?this.buttonsData[e].disabled:this.props.disabled}isRtl(){return void 0!==this.props.dir?"rtl"===this.props.dir:!!this.mainButton&&"rtl"===getComputedStyle(this.mainButton).direction}};w.propTypes={accessKey:s.string,ariaLabel:s.string,title:s.string,onFocus:s.func,onBlur:s.func,onItemClick:s.func,onOpen:s.func,onClose:s.func,items:s.arrayOf(s.any),textField:s.string,tabIndex:s.number,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,imageUrl:s.string,popupSettings:s.object,itemRender:s.func,item:s.func,className:s.string,buttonClass:s.string,dir:s.string},w.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let E=w;const D=n.createPropsContext(),N=n.withIdHOC(n.withPropsContext(D,n.withUnstyledHOC(n.withZIndexContext(E))));N.displayName="KendoReactDropDownButton";const S=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",B=["button"+S,".k-button-group > button"+S,".k-colorpicker",".k-dropdownlist"],K=e=>c.createElement("div",{ref:e._ref,className:n.classNames("k-toolbar-separator k-separator",e.className)}),R="prevArrow.title",O="nextArrow.title",M="moreButtonTitle.title",z={[R]:"Previous scroll button",[O]:"Next scroll button",[M]:"More button"},F=e=>{const t=a.useLocalization(),{disabled:s,type:o,scrollContentRef:i,buttonScrollSpeed:l,prevButton:d,nextButton:u}=e,p="prev"===o?d||"span":u||"span";return c.createElement(p,{className:n.classNames("k-button","k-button-md","k-button-solid","k-button-solid-base","k-rounded-md","k-icon-button",`k-toolbar-${o}`,{"k-disabled":s}),title:`${"prev"===o?t.toLanguageString(R,z[R]):t.toLanguageString(O,z[O])}`,"aria-hidden":!0,tabIndex:s?-1:void 0,onClick:e=>{i&&i.current&&l&&i.current.scrollBy({left:"next"===o?l:-l,behavior:"smooth"})}},c.createElement(n.SvgIcon,{icon:"prev"===o?r.caretAltLeftIcon:r.caretAltRightIcon,className:"k-button-icon"}))},P=e=>{const{scrollButtons:t,scrollButtonsPosition:s,isOverflowing:n,scrollContentRef:o,buttonScrollSpeed:r,dir:a,isScrollStartPosition:i,isScrollEndPosition:l,prevButton:d,nextButton:u,children:p}=e,m=(e,t)=>c.createElement(F,{type:e,disabled:t,scrollContentRef:o,buttonScrollSpeed:r,prevButton:d,nextButton:u}),h="visible"===t||"auto"===t&&n;return c.createElement(c.Fragment,null,h&&"split"===s&&c.createElement(c.Fragment,null,m("rtl"!==a?"prev":"next",i),c.createElement(K,{className:"k-toolbar-button-separator"})),h&&"start"===s&&c.createElement(c.Fragment,null,m("rtl"!==a?"prev":"next",i),m("rtl"!==a?"next":"prev",l),c.createElement(K,{className:"k-toolbar-button-separator"})),c.createElement("span",{className:"k-toolbar-items k-toolbar-items-scroll",ref:o},p),h&&"split"===s&&c.createElement(c.Fragment,null,c.createElement(K,{className:"k-toolbar-button-separator"}),m("rtl"!==a?"next":"prev",l)),h&&"end"===s&&c.createElement(c.Fragment,null,c.createElement(K,{className:"k-toolbar-button-separator"}),m("rtl"!==a?"prev":"next",i),m("rtl"!==a?"next":"prev",l)))},T=e=>{var t;const{toolbarRef:s,children:i,fillMode:l,size:u}=e,[p,m]=c.useState(!1),h=c.useRef(c.Children.toArray(i).filter((e=>c.isValidElement(e))).map(((e,t)=>c.cloneElement(e,{key:e.key||t})))),f=c.useRef([]),v=c.useRef(0),b=c.useRef(null),g=c.useRef(null),y=a.useLocalization(),[k,C]=c.useReducer((e=>e+1),0),I=()=>{if(!s.current)return;let e=0;const t=s.current.clientWidth,n=parseInt(window.getComputedStyle(s.current).gap||"0",10),o=Array.from(s.current.children).reduce(((e,t,s)=>e+=Math.ceil(t.clientWidth)),0),r=Array.from(s.current.children).length;if(e=o+r*n+2*n,e>t){const e=[...h.current],s=e.pop();v.current=t,h.current=e,s&&(f.current=[s,...f.current])}else if(t>v.current+n*r){const e=[...f.current],s=e.shift();f.current=e,s&&(h.current=[...h.current,s]),v.current=t}C()};c.useEffect((()=>{I();const e=new ResizeObserver(I),t=s.current;return t&&e.observe(t),()=>{t&&e.unobserve(t)}}),[]);return c.createElement(c.Fragment,null,h.current.length>0&&h.current,f.current.length>0&&c.createElement(c.Fragment,null,c.createElement(K,{_ref:g,className:"k-toolbar-button-separator"}),c.createElement(d,{ref:b,className:"k-toolbar-overflow-button",fillMode:"flat",svgIcon:r.moreHorizontalIcon,title:y.toLanguageString(M,z[M]),onClick:()=>{m(!p)}}),c.createElement(o.Popup,{anchor:s.current,show:p,popupClass:"k-toolbar-popup",style:{width:null==(t=s.current)?void 0:t.offsetWidth}},c.createElement("span",{className:`k-toolbar-items-list k-toolbar-items-list-${n.kendoThemeMaps.sizeMap[u]} k-toolbar-items-list-${l}`},f.current.length>0&&f.current))))},A=c.forwardRef(((e,t)=>{const{children:s,className:o,id:r,ariaLabel:a,keyboardNavigation:i,role:l,onResize:d,style:u,tabIndex:p=L.tabIndex,size:m=L.size,fillMode:h=L.fillMode,overflow:f,scrollButtons:v=L.scrollButtons,scrollButtonsPosition:b=L.scrollButtonsPosition,buttonScrollSpeed:g=L.buttonScrollSpeed,prevButton:y,nextButton:k,_ariaControls:C}=e,I=c.useRef(!1),x=c.useRef(null),w=c.useRef(null),E=c.useRef(0),D=c.useRef(0),N=c.useRef([]),S=c.useRef({element:null,props:e}),[K,R]=c.useState(!1),[O,M]=c.useState(!0),[z,F]=c.useState(!1),A=n.useDir(x,e.dir),$=c.useMemo((()=>e.buttons||B),[e.buttons]),W=c.useMemo((()=>$.map((e=>e+":focus")).join(",")),[$]),U=()=>{const e=x.current&&x.current.querySelector(W);return Math.max(0,N.current.findIndex((t=>t===e)))};c.useImperativeHandle(S,(()=>({element:x.current,props:e}))),c.useImperativeHandle(t,(()=>S.current)),c.useEffect((()=>(window.addEventListener("resize",q),x.current&&(D.current=x.current.offsetWidth,E.current=x.current.offsetHeight,!1!==i&&(N.current=Array.from(x.current.querySelectorAll($.join(","))),H(0))),()=>{window.removeEventListener("resize",q),N.current.length=0})),[]),c.useEffect((()=>{if(I.current){if(!x.current||!1===i)return;N.current=Array.from(x.current.querySelectorAll($.join(","))),H(U()),V()}else I.current=!0}));const H=e=>{N.current.forEach(((t,s)=>{t.tabIndex=s===e?p:-1}))},j=(e,t)=>{const s=N.current[t];if(s){s.tabIndex=p,s.focus();const t=N.current[e];t&&(t.tabIndex=-1)}},q=e=>{if(!x.current)return;const t=x.current.offsetWidth,s=x.current.offsetHeight;if(D.current!==t||E.current!==s){D.current=t,E.current=s;const n={offsetWidth:D.current,offsetHeight:E.current};d&&d.call(void 0,{target:S.current,...n,nativeEvent:e})}V()},V=c.useCallback((()=>{const e=w.current;e&&R(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)}),[]),G=c.useCallback((()=>{const e=w.current;if(e){const t=0===e.scrollLeft,s="rtl"!==A?e.scrollLeft+e.clientWidth===e.scrollWidth:e.clientWidth-e.scrollLeft===e.scrollWidth;t&&M(!0),s&&F(!0),!t&&!s&&(M(!1),F(!1))}}),[A]);return c.useEffect((()=>{const e=w.current;if(e)return e.addEventListener("scroll",G),()=>{e.removeEventListener("scroll",G)}}),[G]),c.createElement("div",{id:r,"aria-label":a,"aria-controls":C,className:n.classNames("k-toolbar",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[m]||m}`]:m,[`k-toolbar-${h}`]:h,"k-toolbar-scrollable":"scroll"===f,"k-toolbar-scrollable-overlay":"scroll"===f&&("hidden"===v||void 0===v),"k-toolbar-scrollable-start":"scroll"===f&&"hidden"===v&&O,"k-toolbar-scrollable-end":"scroll"===f&&"hidden"===v&&z,"k-toolbar-section":e.overflow&&"section"===f},o),style:u,role:void 0!==l?l||void 0:"toolbar",dir:A,ref:x,onKeyDown:!1!==i?e=>{const t=e.keyCode===n.Keys.left||e.keyCode===n.Keys.right||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end,s=U();!t||e.defaultPrevented||-1===N.current.findIndex((t=>t===e.target))||(e.keyCode===n.Keys.left?j(s,0===s?N.current.length-1:s-1):j(s,s===N.current.length-1?0:s+1),e.keyCode===n.Keys.home&&j(s,0),e.keyCode===n.Keys.end&&j(s,N.current.length-1))}:void 0},"scroll"===f&&c.createElement(P,{scrollButtons:v,scrollButtonsPosition:b,prevButton:y,nextButton:k,isOverflowing:K,scrollContentRef:w,buttonScrollSpeed:g,dir:A,isScrollStartPosition:O,isScrollEndPosition:z,children:s}),"section"===f&&c.createElement(T,{toolbarRef:x,fillMode:h,size:m},s),("none"===f||void 0===f)&&s)})),L={tabIndex:0,size:"medium",fillMode:"solid",scrollButtons:"auto",scrollButtonsPosition:"split",buttonScrollSpeed:100};A.displayName="KendoReactToolbar",A.propTypes={tabIndex:s.number,dir:s.string,keyboardNavigation:s.bool,style:s.object,className:s.string,role:s.string,onResize:s.func,buttons:s.arrayOf(s.string.isRequired),size:s.oneOf([null,"small","medium","large"]),fillMode:s.oneOf([null,"solid","flat","outline"]),overflow:s.oneOf(["none","section","scroll"]),scrollButtons:s.oneOf(["hidden","visible","auto"]),scrollButtonsPosition:s.oneOf(["start","end","split"]),buttonScrollSpeed:s.number};const $=c.forwardRef(((e,t)=>{const{id:s,className:o,style:r,children:a}=e,i=c.useRef(null);return c.useImperativeHandle(t,(()=>({element:i.current}))),c.createElement("div",{id:s,className:n.classNames("k-toolbar-item",o),style:r,ref:i},a)}));$.displayName="KendoReactToolbarItem",$.propTypes={className:s.string};const W=c.forwardRef(((e,t)=>{const s=c.useRef(null),o=c.useRef(null);c.useImperativeHandle(o,(()=>({element:s.current}))),c.useImperativeHandle(t,(()=>({element:s.current})));const r=c.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return c.createElement("span",{ref:s,className:r})}));W.displayName="KendoReactToolbarSpacer",W.propTypes={className:s.string};const U=t.createContext([null,e=>{}]),H=t.createContext([null,e=>{}]),j=t.createContext([null,e=>{}]);var q=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(q||{});var V=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(V||{});var G=(e=>(e.toggle="toggle",e.remove="remove",e))(G||{});const Z=c.forwardRef(((e,t)=>{const s=c.useRef(null),o=c.useRef(null),{disabled:a=J.disabled,fillMode:i=J.fillMode,themeColor:l=J.themeColor,size:d=J.size,rounded:u=J.rounded,dir:p=J.dir,removeIcon:m=J.removeIcon,removeSvgIcon:h=J.removeSvgIcon,removable:f=J.removable}=e,v=n.useDir(o,p);c.useImperativeHandle(s,(()=>({element:o.current,props:e}))),c.useImperativeHandle(t,(()=>s.current));const[b,g]=c.useContext(U),[y,k]=c.useContext(H),[,C]=c.useContext(j),I=c.useMemo((()=>e.selected||(Array.isArray(b)?b.some((t=>t===e.value)):b===e.value)),[e.selected,e.value,b]),x=c.useMemo((()=>y===e.value),[e.value,y]);c.useEffect((()=>{x&&o.current&&o.current.focus()}),[x]);const w=c.useCallback((t=>{g({type:G.toggle,payload:e.value,event:t})}),[g,e.value]),E=c.useCallback((t=>{f&&(C({type:V.remove,payload:e.value,event:t}),k({type:q.reset,payload:e.value,event:t}),g({type:G.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,f,C,k,g]),D=c.useCallback((t=>{switch(t.keyCode){case n.Keys.left:k({type:q.prev,payload:e.value,event:t});break;case n.Keys.right:k({type:q.next,payload:e.value,event:t});break;case n.Keys.enter:g({type:G.toggle,payload:e.value,event:t});break;case n.Keys.delete:E(t)}e.onKeyDown&&e.onKeyDown.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onKeyDown,e.value,k,g,E]),N=c.useCallback((t=>{k({payload:e.value,type:q.current,event:t}),e.onFocus&&e.onFocus.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onFocus,e.value,k]),S=c.useCallback((t=>{e.onBlur&&e.onBlur.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onBlur]),B=n.useMouse(e,s,{onClick:w});return c.createElement("div",{...B,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:v,tabIndex:n.getTabIndex(e.tabIndex,a,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===v,"k-disabled":a,"k-selected":I,"k-focus":x,[`k-chip-${n.kendoThemeMaps.sizeMap[d]||d}`]:d,[`k-rounded-${n.kendoThemeMaps.roundedMap[u]||u}`]:u,[`k-chip-${i}`]:i,[`k-chip-${i}-${l}`]:!(!i||!l)},e.className),"aria-pressed":e.role?void 0:I,"aria-disabled":a,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":f?"Enter Delete":void 0,onFocus:N,onBlur:S,onKeyDown:D},I&&(e.selectedIcon||e.selectedSvgIcon)&&c.createElement(n.IconWrap,{className:"k-chip-icon",name:e.selectedIcon?n.toIconName(e.selectedIcon):void 0,icon:e.selectedSvgIcon,size:"small"}),(e.icon||e.svgIcon)&&c.createElement(n.IconWrap,{className:"k-chip-icon",name:e.icon?n.toIconName(e.icon):void 0,icon:e.svgIcon,size:"small"}),e.avatar&&c.createElement("div",{className:`k-chip-avatar k-avatar k-rounded-${e.avatar.rounded} k-avatar-md k-avatar-solid k-avatar-solid-primary`,style:e.avatar.style},c.createElement("span",{className:"k-avatar-image"},c.createElement("img",{src:e.avatar.image,alt:e.avatar.imageAlt}))),c.createElement("span",{className:"k-chip-content"},void 0!==e.children?e.children:e.text&&c.createElement("span",{"aria-label":e.ariaLabel||e.text,className:"k-chip-label"},e.text)),f&&c.createElement("span",{className:"k-chip-actions"},c.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:E},c.createElement(n.IconWrap,{name:m?n.toIconName(m):void 0,icon:h||r.xCircleIcon,size:"small"}))))})),_={id:s.string,text:s.string,value:s.any,dir:s.oneOf(["ltr","rtl"]),removable:s.bool,removeIcon:s.string,removeIconSvg:n.svgIconPropType,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,selectedIcon:s.string,selectedIconSvg:n.svgIconPropType,onRemove:s.func,dataItem:s.any,selected:s.bool,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"outline","solid"]),themeColor:s.oneOf([null,"base","info","success","warning","error"])},J={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:r.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};Z.displayName="KendoReactChip",Z.propTypes=_;const Q=(e,t,s)=>{"multiple"===t.selection?Array.isArray(e)||(e=e?[e]:null):"single"===t.selection&&Array.isArray(e)&&(e=e?e.join(""):null);const[n,o]=c.useState(e);return[n,e=>{const r=((e,t)=>{switch(t.selection){case"single":switch(t.type){case"toggle":if(!Array.isArray(e)||null===e)return t.payload===e?null:t.payload;throw new Error("State cannot be an array in single selection");case"remove":return t.payload===e?null:e;default:return e}case"multiple":switch(t.type){case"toggle":if(Array.isArray(e))return e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload];if(null===e)return[t.payload];throw new Error("State cannot be non-array in multiple selection");case"remove":return Array.isArray(e)?e.some((e=>e===t.payload))?e.filter((e=>e!==t.payload)):[...e,t.payload]:e;default:return e}case"none":return null;default:return e}})(t.state||n,{...e,...t});s&&s(r,e.event),"none"!==t.selection&&o(r)}]},X=c.forwardRef(((e,t)=>{const s=c.useRef(null),o=c.useRef(null),{id:r,style:a,tabIndex:i,className:l,ariaDescribedBy:d,ariaLabelledBy:u,ariaLabel:p,value:m,defaultData:h=ee.defaultData,chip:f=ee.chip,disabled:v=ee.disabled,size:b=ee.size,defaultValue:g=ee.defaultValue,selection:y=ee.selection,valueField:k=ee.valueField,textField:C=ee.textField,dir:I=ee.dir,onChange:x,onDataChange:w}=e,E=n.useDir(o,I),D=c.useMemo((()=>f||Z),[f,Z]);c.useImperativeHandle(s,(()=>({element:o.current,props:e}))),c.useImperativeHandle(t,(()=>s.current));const N=c.useCallback(((e,t)=>{x&&s.current&&x.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[x]),[S,B]=Q(m||g,{selection:y,state:m},N),K=c.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[R,O]=((e,t,s)=>{const[n,o]=c.useState(e);return[n,e=>{const r=((e,t)=>{switch(t.type){case"add":case"reorder":break;case"remove":return e.filter((e=>e[t.valueField]!==t.payload));default:return e}})(t.state||n,{...e,...t});s&&s(r,e.event),o(r)}]})(e.data||h,{state:e.data,valueField:k},K),M=c.useCallback(((e,t)=>(e.push(t[k]),e)),[k]),z=c.useMemo((()=>e.data||R),[e.data,R]),F=c.useMemo((()=>m||S),[m,S]),P=c.useMemo((()=>z.reduce(M,[])),[z,M]),T=c.useCallback((e=>n.getter(k)(e)),[k]),A=c.useCallback((e=>n.getter(C)(e)),[C]),[L,$]=(e=>{const[t,s]=c.useState(null);return[t,t=>{const n=((e,t)=>{const s=t.items.findIndex((t=>t===e));switch(t.type){case"next":return s===t.items.length-1?e:t.items[s+1];case"prev":return 0===s?e:t.items[s-1];case"current":return t.payload;case"reset":return null;default:return e}})(t.payload,{...t,...e});s(n)}]})({items:P}),W=n.useMouse(e,s);return c.createElement(U.Provider,{value:[F,B]},c.createElement(H.Provider,{value:[L,$]},c.createElement(j.Provider,{value:[z,O]},c.createElement("div",{ref:o,...W,role:v?void 0:"listbox",id:r,dir:E,style:a,tabIndex:n.getTabIndex(i,v,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===E,"k-disabled":v,[`k-chip-list-${n.kendoThemeMaps.sizeMap[b]||b}`]:b},l),"aria-label":p,"aria-labelledby":u,"aria-describedby":d,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===y},z.map(((e,t)=>c.createElement(D,{role:"option",dataItem:e,size:b,key:[T(e),t].join("-"),text:A(e),value:T(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),Y={id:s.string,className:s.string,tabIndex:s.number,data:s.any,defaultData:s.arrayOf(s.any),onDataChange:s.func,value:s.oneOfType([s.any,s.arrayOf(s.any)]),defaultValue:s.oneOfType([s.any,s.arrayOf(s.any)]),onChange:s.func,selection:s.oneOf(["single","none","multiple"]),textField:s.string,valueField:s.string,disabled:s.bool,dir:s.oneOf(["ltr","rtl"]),ariaLabelledBy:s.string,ariaDescribedBy:s.string,size:s.oneOf([null,"small","medium","large"])},ee={chip:Z,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};X.displayName="KendoReactChipList",X.propTypes=Y;const te=c.forwardRef(((e,t)=>{const{className:s,disabled:o,text:r,icon:a,style:i,id:l,focused:d,tabIndex:u,index:p,dataItem:m,item:h,svgIcon:f,onDown:v,onClick:b,...g}=e,y=c.useRef(null),k=c.useCallback((()=>{y.current&&y.current.focus()}),[]),C=c.useCallback((()=>({element:y.current,focus:k})),[k]);c.useImperativeHandle(t,C);const I=c.useCallback((e=>{b&&void 0!==p&&!o&&b(e,p)}),[b,p]),x=c.useMemo((()=>n.classNames("k-fab-item",{"k-focus":d,"k-disabled":o},s)),[s,o,d]),w=h;return c.createElement("li",{ref:y,id:l,className:x,style:i,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${r||""} floatingactionbutton item`,onClick:I,onMouseDown:v,onPointerDown:v,...g},w?c.createElement(w,{itemIndex:p,item:m}):c.createElement(c.Fragment,null,r&&c.createElement("span",{className:"k-fab-item-text"},r),a||f?c.createElement(n.IconWrap,{className:"k-fab-item-icon",name:a,icon:f}):null))}));te.propTypes={className:s.string,style:s.object,children:s.any,disabled:s.bool,focused:s.bool,index:s.number,icon:s.string,svgIcon:n.svgIconPropType,text:s.string,tabIndex:s.number,customProp:s.any},te.displayName="KendoFloatingActionButtonItem";const se="16px",ne=e=>"number"==typeof e?e+"px":e,oe=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},re=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},ae=(e,t)=>({rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[e]["end"===t?"end":"start"]),ie=(e,t,s,n)=>{const o=t.horizontal,r=t.vertical;if(e.current){const a=s&&void 0!==s.x?ne(s.x):se,i=s&&void 0!==s.x?`calc(50% + ${ne(s.x)})`:"50%",l=s&&void 0!==s.y?ne(s.y):se,c=s&&void 0!==s.y?`calc(50% + ${ne(s.y)})`:"50%";e.current.style.setProperty(le(t,n),"center"===o?i:a),e.current.style.setProperty(ce(t),"middle"===r?c:l),n&&(("top"===r||"bottom"===r)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===r&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===r&&"start"===o&&e.current.style.setProperty("left","unset"))}},le=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},ce=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),de=c.forwardRef(((e,t)=>{const{align:s=ue.align,alignOffset:r,className:a,disabled:i,icon:l,svgIcon:d,iconClass:u,id:p,items:m,item:h,text:f,positionMode:v=ue.positionMode,size:b=ue.size,style:g,rounded:y=ue.rounded,themeColor:k=ue.themeColor,overlayStyle:C,tabIndex:I,accessKey:x,popupSettings:w={},modal:E,onClick:D,onItemClick:N,onFocus:S,onBlur:B,onKeyDown:K,onOpen:R,onClose:O,...M}=e,z=n.useZIndexContext(),F=z?z+2:100,P=c.useRef(null),T=c.useRef(null),A=c.useRef(null),L=c.useRef(null),$=c.useCallback((()=>{T.current&&T.current.focus()}),[]),W=c.useCallback((()=>({element:T.current,focus:$})),[$]);c.useImperativeHandle(P,W),c.useImperativeHandle(t,(()=>P.current));const[U,H]=c.useState(!1),[j,q]=c.useState(!1),[V,G]=c.useState(-1),Z=n.useId()+"-button-id",_=n.useDir(T,e.dir),J="rtl"===_,Q=n.useId()+"-list-id";c.useEffect((()=>{ie(T,s,r,J)}),[T,s,r,J]),c.useEffect((()=>{j&&T&&T.current&&T.current.focus()}),[j,T]);const X=c.useCallback(((e,t)=>{m&&n.dispatchEvent(t?R:O,e,W(),void 0)}),[R,O,m]),Y=c.useCallback((e=>{!e.target||i||(!m&&D?n.dispatchEvent(D,e,W(),void 0):(H(!U),q(!0),G(U?-1:0),X(e,!U)))}),[H,q,G,D,X,U,m,i]),ee=c.useCallback((e=>{q(!0),G(U?0:-1),S&&n.dispatchEvent(S,e,W(),void 0)}),[S,q,G]),se=c.useCallback((e=>{q(!1),H(!1),G(-1),n.dispatchEvent(B,e,W(),void 0),U&&X(e,!1)}),[B,q,H,G,X]),ne=c.useCallback((e=>{e.preventDefault()}),[]),le=c.useCallback(((e,t)=>{m&&(m[t].disabled||n.dispatchEvent(N,e,W(),{itemProps:m[t],itemIndex:t}))}),[N]),ce=c.useCallback(((e,t)=>{!e.target||!m||(G(t),H(!1),le(e,t),X(e,!1))}),[G,H,le,X]),de=c.useCallback((e=>{n.getActiveElement(document)===T.current&&e.preventDefault()}),[T]),pe=c.useCallback((e=>{const t=V,s=m?m.length:-1;if(e.altKey)return!U&&e.keyCode===n.Keys.down&&(e.preventDefault(),H(!0),G(0)),void(U&&e.keyCode===n.Keys.up&&(e.preventDefault(),H(!1),G(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&le(e,t),m||Y(e),e.preventDefault(),H(!U),G(U?-1:0);break;case n.Keys.esc:e.preventDefault(),H(!1),G(-1);break;case n.Keys.home:e.preventDefault(),G(0);break;case n.Keys.end:e.preventDefault(),G(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),G(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),G(t-1<0?s-1:t-1)}n.dispatchEvent(K,e,W(),void 0)}),[K,V,G,J,H]),me=c.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===b,"k-fab-md":"medium"===b,"k-fab-lg":"large"===b,"k-disabled":i,"k-pos-absolute":"absolute"===v,"k-pos-fixed":"fixed"===v,"k-focus":j,[`k-rounded-${n.kendoThemeMaps.roundedMap[y]||y}`]:y,[`k-fab-solid-${k}`]:k},`k-${s.vertical}-${s.horizontal}`,a)),[k,b,y,i,v,s,j,a]),he=m&&m.map(((e,t)=>c.createElement(te,{...e,key:t,index:t,id:`${Q}-${t}`,disabled:i||e.disabled,focused:V===t,dataItem:e,item:h,className:n.classNames(e.className,ae(_||"ltr",s.horizontal)),onClick:ce,onDown:de}))),fe=!(!l&&!d||f),ve=(T.current?T.current.offsetWidth:0)/2-16;let be;return be=l||d?c.createElement(n.IconWrap,{className:"k-fab-icon",name:l,icon:d}):u?c.createElement("span",{role:"presentation",className:u}):null,c.createElement(n.ZIndexContext.Provider,{value:F},c.createElement(c.Fragment,null,c.createElement("button",{ref:T,id:p||Z,role:"button",type:"button","aria-disabled":i,"aria-expanded":m?U:void 0,"aria-haspopup":!!m,"aria-label":`${f||""} floatingactionbutton`,"aria-owns":m?Q:void 0,"aria-activedescendant":V>=0&&m?`${Q}-${V}`:void 0,tabIndex:n.getTabIndex(I,i),accessKey:x,dir:_,disabled:i,className:me,style:g,onClick:Y,onMouseDown:ne,onFocus:ee,onBlur:se,onKeyDown:pe,...M},be,f&&c.createElement("span",{className:"k-fab-text"},f)),E&&U&&c.createElement("div",{className:"k-overlay",style:{zIndex:F,...C}}),c.createElement(o.Popup,{ref:L,anchor:T.current,show:U,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||oe(s,J),popupAlign:w.popupAlign||re(s,J),style:{boxShadow:"none"}},c.createElement("ul",{ref:A,role:"menu","aria-labelledby":p,id:Q,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:fe?ve:void 0,paddingRight:fe?ve:void 0}},he))))}));de.propTypes={className:s.string,style:s.object,id:s.string,dir:s.string,tabIndex:s.number,accessKey:s.string,disabled:s.bool,icon:s.string,svgIcon:n.svgIconPropType,iconClass:s.string,text:s.string,alignOffset:s.shape({x:s.oneOfType([s.number,s.string]).isRequired,y:s.oneOfType([s.number,s.string]).isRequired}),align:s.shape({vertical:s.oneOf(["top","middle","bottom"]).isRequired,horizontal:s.oneOf(["start","center","end"]).isRequired}),positionMode:s.oneOf(["absolute","fixed"]),size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),themeColor:s.oneOf([null,"primary","secondary","tertiary","info","success","warning","error","dark","light","inverse"]),modal:s.bool,overlayStyle:s.object};const ue={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};de.displayName="KendoFloatingActionButton";const pe="speechToTextButton.ariaLabel",me="speechToTextButton.title",he={[pe]:"Start speech recognition",[me]:"Speech to Text Button"},fe=t.forwardRef(((e,s)=>{const o=!n.validatePackage(y,{component:"SpeechToTextButton"}),l=n.getLicenseMessage(y),c=a.useLocalization(),{fillMode:u="solid",rounded:p="medium",size:m="medium",themeColor:h="base",ariaLabel:f,svgIcon:v,disabled:b,iconSize:g="medium",title:k,className:C,id:I,style:x,lang:w="en-US",continuous:E=!1,interimResults:D=!1,maxAlternatives:N=1,integrationMode:S="webSpeech",onStart:B,onResult:K,onEnd:R,onError:O,...M}=e,z=t.useRef(null),F=t.useRef(!1),[P,T]=t.useState(!1),A=t.useCallback((async()=>{F.current=!0,T(!0),B&&await B()}),[B]),L=t.useCallback((async()=>{F.current=!1,T(!1),R&&await R()}),[R]),$=t.useCallback((e=>{const t=e.results,s=t[t.length-1],n=Array.from(s).map((e=>({transcript:e.transcript,confidence:e.confidence})));null==K||K({isFinal:s.isFinal,alternatives:n})}),[K]),W=t.useCallback((e=>{T(!1),F.current=!1,null==O||O({errorMessage:e.error})}),[O]),U=t.useCallback((()=>{var e;F.current||null==(e=z.current)||e.start()}),[]),H=t.useCallback((()=>{var e;F.current&&(null==(e=z.current)||e.stop())}),[]),j=t.useCallback((()=>{var e;F.current&&(null==(e=z.current)||e.abort(),F.current=!1,T(!1))}),[]),q=()=>F.current;t.useImperativeHandle(s,(()=>({start:U,stop:H,abort:j,isActive:q}))),t.useEffect((()=>((()=>{var e;"undefined"==typeof window||"webkitSpeechRecognition"in window||"SpeechRecognition"in window?(null!=(e=z.current)&&e.isActive()&&z.current.stop(),z.current=new i.KendoSpeechRecognition({lang:w,continuous:E,interimResults:D,maxAlternatives:N,events:{start:A,end:L,result:$,error:W}})):O&&O({errorMessage:"Speech Recognition API is not supported in this browser."})})(),()=>{F.current&&H()})),[w,E,D,N,S]);const V=void 0!==e.icon||void 0!==e.iconClass||void 0!==e.imageUrl,G=t.useMemo((()=>P?r.stopSmIcon:v||r.microphoneOutlineIcon),[P,v]);return t.createElement(t.Fragment,null,t.createElement(d,{id:I,className:n.classNames({"k-speech-to-text-button":!0,"k-listening":P},C),style:x,svgIcon:V?void 0:G,iconSize:g,fillMode:u,rounded:p,size:m,themeColor:h,"aria-label":null!=f?f:c.toLanguageString(pe,he[pe]),"aria-pressed":P,disabled:b,title:null!=k?k:c.toLanguageString(me,he[me]),onClick:()=>{P?H():U()},...M},e.children),o&&t.createElement(n.WatermarkOverlay,{message:l}))}));fe.displayName="KendoSpeechToTextButton";const ve=n.withIdHOC(N);ve.displayName="KendoReactDropDownButton";const be=n.withIdHOC(C);be.displayName="KendoReactSplitButton",e.Button=d,e.ButtonGroup=p,e.Chip=Z,e.ChipList=X,e.DropDownButton=ve,e.DropDownButtonClassComponent=N,e.DropDownButtonItem=x,e.FloatingActionButton=de,e.FloatingActionButtonItem=te,e.SpeechToTextButton=fe,e.SplitButton=be,e.SplitButtonClassComponent=C,e.SplitButtonItem=f,e.Toolbar=A,e.ToolbarItem=$,e.ToolbarSeparator=K,e.ToolbarSpacer=W,e.toolbarButtons=B}));
|
package/index.d.mts
CHANGED
|
@@ -1371,6 +1371,7 @@ declare class DropDownButtonWithoutContext extends React_2.Component<DropDownBut
|
|
|
1371
1371
|
private skipFocus;
|
|
1372
1372
|
private get guid();
|
|
1373
1373
|
private readonly showLicenseWatermark;
|
|
1374
|
+
private readonly licenseMessage?;
|
|
1374
1375
|
private buttonsData;
|
|
1375
1376
|
private openedDuringOnChange?;
|
|
1376
1377
|
private get opened();
|
|
@@ -2275,6 +2276,7 @@ export declare class SplitButtonClassComponent extends React_2.Component<SplitBu
|
|
|
2275
2276
|
private buttonsData;
|
|
2276
2277
|
private openedDuringOnChange?;
|
|
2277
2278
|
private readonly showLicenseWatermark;
|
|
2279
|
+
private readonly licenseMessage?;
|
|
2278
2280
|
constructor(props: SplitButtonProps);
|
|
2279
2281
|
private get opened();
|
|
2280
2282
|
/**
|
package/index.d.ts
CHANGED
|
@@ -1371,6 +1371,7 @@ declare class DropDownButtonWithoutContext extends React_2.Component<DropDownBut
|
|
|
1371
1371
|
private skipFocus;
|
|
1372
1372
|
private get guid();
|
|
1373
1373
|
private readonly showLicenseWatermark;
|
|
1374
|
+
private readonly licenseMessage?;
|
|
1374
1375
|
private buttonsData;
|
|
1375
1376
|
private openedDuringOnChange?;
|
|
1376
1377
|
private get opened();
|
|
@@ -2275,6 +2276,7 @@ export declare class SplitButtonClassComponent extends React_2.Component<SplitBu
|
|
|
2275
2276
|
private buttonsData;
|
|
2276
2277
|
private openedDuringOnChange?;
|
|
2277
2278
|
private readonly showLicenseWatermark;
|
|
2279
|
+
private readonly licenseMessage?;
|
|
2278
2280
|
constructor(props: SplitButtonProps);
|
|
2279
2281
|
private get opened();
|
|
2280
2282
|
/**
|
package/package-metadata.js
CHANGED
|
@@ -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 e={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1754568903,version:"11.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "11.4.0-develop.
|
|
13
|
+
publishDate: 1754568903,
|
|
14
|
+
version: "11.4.0-develop.7",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-buttons",
|
|
3
|
-
"version": "11.4.0-develop.
|
|
3
|
+
"version": "11.4.0-develop.7",
|
|
4
4
|
"description": "All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@progress/kendo-licensing": "^1.
|
|
28
|
+
"@progress/kendo-licensing": "^1.7.0",
|
|
29
29
|
"@progress/kendo-webspeech-common": "^1.0.0",
|
|
30
|
-
"@progress/kendo-react-common": "11.4.0-develop.
|
|
31
|
-
"@progress/kendo-react-intl": "11.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-popup": "11.4.0-develop.
|
|
30
|
+
"@progress/kendo-react-common": "11.4.0-develop.7",
|
|
31
|
+
"@progress/kendo-react-intl": "11.4.0-develop.7",
|
|
32
|
+
"@progress/kendo-react-popup": "11.4.0-develop.7",
|
|
33
33
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
34
34
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
35
35
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"package": {
|
|
65
65
|
"productName": "KendoReact",
|
|
66
66
|
"productCode": "KENDOUIREACT",
|
|
67
|
-
"publishDate":
|
|
67
|
+
"publishDate": 1754568903,
|
|
68
68
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
69
69
|
}
|
|
70
70
|
},
|