@progress/kendo-react-buttons 9.2.0-develop.7 → 9.2.0-develop.8
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/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/index.d.mts +17 -5
- package/index.d.ts +17 -5
- package/package-metadata.mjs +1 -1
- package/package.json +3 -3
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +67 -57
|
@@ -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
|
-
!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")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactButtons={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactPopup,e.KendoSvgIcons)}(this,(function(e,t,s,n,o,a){"use strict";function i(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 r=i(t);const l={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};const d=r.forwardRef(((e,t)=>{n.validatePackage(l);const{children:s,togglable:o,dir:a,disabled:i,selected:d,icon:u,iconClass:p,svgIcon:m,imageUrl:h,imageAlt:f,className:v,startIcon:y,endIcon:g,onClick:b,size:k=c.size,rounded:C=c.rounded,fillMode:I=c.fillMode,themeColor:x=c.themeColor,...D}=e,w=r.useRef(),E=r.useRef(null),[N,K]=r.useState(!0===o&&!0===d),B=void 0!==m||void 0!==u||void 0!==p||void 0!==h,O=void 0!==s,S=n.useUnstyled(),R=e.unstyled||S,z=R&&R.uButton;r.useImperativeHandle(t,(()=>({element:E.current,selected:void 0!==w.current?w.current:N}))),r.useMemo((()=>{o&&void 0!==d&&d!==N&&K(d)}),[o,d]),r.useEffect((()=>{w.current=void 0}),[N]);const M=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:a,buttonClasses:i}){return e?r.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:i})),alt:a,src:e}):t||o?r.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:i})),name:t,icon:o}):s?r.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:i}),s)}):null}({name:u,svgIcon:m,iconClass:p,imageUrl:h,imageAlt:f,buttonClasses:z}),F=e=>r.cloneElement(e,{className:n.classNames(n.uButton.icon({c:z}))});return r.createElement("button",{ref:E,"aria-pressed":o?N:void 0,...D,dir:a,disabled:i,onClick:e=>{o&&void 0===d&&(w.current=!N,K(!N)),b&&b.call(void 0,e)},className:n.classNames(n.uButton.wrapper({c:z,isRtl:"rtl"===a,selected:N,disabled:i,size:k,fillMode:I,rounded:C,themeColor:x,iconButton:!O&&B}),v)},y&&F(y),M,s&&r.createElement("span",{className:n.classNames(n.uButton.text({c:z}))},s),g&&F(g))})),c={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 u=e=>{n.validatePackage(l);const{children:t,className:s,dir:o,disabled:a,width:i}=e,d=n.useUnstyled(),c=e.unstyled||d,u=c&&c.uButtonGroup,p=(e,t)=>{const s={...i?{width:i}:{},...e.props.style||{}},n=a||e.props.disabled,o={...e.props,...t?{className:t}:{},...Object.keys(s).length?{style:s}:{},...void 0!==n?{disabled:n}:{}};return r.Children.count(e.props.children)>0?r.cloneElement(e,o,e.props.children):r.cloneElement(e,o)},m=r.useRef(null),h=(e=>{const t=r.Children.count(e),s=void 0!==o?"rtl"===o:m.current&&"rtl"===getComputedStyle(m.current).direction||!1;return r.Children.map(e,((e,o)=>{if(r.isValidElement(e)){const a=o===t-1,i=s,r=n.classNames(e.props.className,n.uButtonGroup.position({c:u,start:i?a:0===o,end:i?0===o:a}));return p(e,r)}return e}))})(t),f=n.classNames(n.uButtonGroup.wrapper({c:u,stretched:!!i,disabled:a}),s),v={className:f,style:{width:`${i}`},dir:o,role:"group","aria-disabled":a};return r.createElement("div",{ref:m,...v,className:f},h)};u.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};const p=e=>{const t=n.useUnstyled(),s=e.unstyled||t,o=s&&s.uDropDownButton,a=r.useCallback((t=>{e.onClick(t,e.index)}),[e]),i=e.dataItem.render||e.item||(void 0===e.item?e.render:null),l=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,d=r.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:o,focused:e.focused}),e.className),tabIndex:-1,onClick:a,onMouseDown:e.onDown,onPointerDown:e.onDown,role:"menuitem","aria-disabled":e.dataItem.disabled||void 0},r.createElement("span",{tabIndex:-1,className:n.classNames(n.uDropDownButton.link({c:o,selected:e.dataItem.selected,disabled:e.dataItem.disabled})),key:"icon"},i?r.createElement(i,{item:e.dataItem,itemIndex:e.index}):r.createElement(r.Fragment,null,(e.dataItem.icon||e.dataItem.iconClass||e.dataItem.svgIcon)&&r.createElement(n.IconWrap,{className:e.dataItem.iconClass,name:e.dataItem.icon,icon:e.dataItem.svgIcon}),e.dataItem.imageUrl&&r.createElement("img",{role:"presentation",alt:"",src:e.dataItem.imageUrl,className:"k-icon"}),l&&r.createElement("span",{className:"k-menu-link-text"},l))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,d,e):d};p.displayName="KendoReactButtonItem";const m=class extends r.Component{render(){return null}};m.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,disabled:s.bool,render:s.any};let h=m;const f=(e,t,s,o)=>{if(s)return e;const a=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 a-1<0?o-1:a-1;case n.Keys.down:case n.Keys.right:return a+1>=o?0:a+1;case n.Keys.home:return 0;case n.Keys.end:return o-1;default:return e}};function v(e){const t={horizontal:"left",vertical:"bottom"};return e&&(t.horizontal="right"),t}function y(e){const t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const g=class extends r.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.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=f(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const a=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(a||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},n.validatePackage(l)}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||r.Children.toArray(this.props.children).filter((e=>e&&e.type===h)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:i,disabled:l}=this.props;return r.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},r.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:l||void 0,tabIndex:i,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,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),r.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:a.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(e))}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 r.createElement(o.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:n.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||y(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.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,a)=>r.createElement(p,{className:n.classNames("k-menu-item",{"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,key:a,index: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.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};g.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},g.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let b=g;const k=class extends r.Component{render(){return null}};k.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let C=k;const I=class extends r.Component{constructor(e){super(e),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!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=f(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const a=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(a||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},n.validatePackage(l)}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.context&&this.context.uDropDownButton,s=e?"rtl":void 0,{id:o,style:a,tabIndex:i,disabled:l,size:c,rounded:u,fillMode:p,themeColor:m,ariaLabel:h,title:f,accessKey:v,icon:y,svgIcon:g,iconClass:b,buttonClass:k,className:I,imageUrl:x,startIcon:D,endIcon:w}=this.props;return this.buttonsData=this.props.items||r.Children.toArray(this.props.children).filter((e=>e&&e.type===C)).map((e=>e.props)),r.createElement(r.Fragment,null,r.createElement(d,{id:o,size:c,style:a,rounded:u,fillMode:p,themeColor:m,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":l?"true":void 0,tabIndex:i,accessKey:v,icon:y,svgIcon:g,iconClass:b,className:n.classNames(k,I,n.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:l})),imageUrl:x,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:D,endIcon:w},this.props.text),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={},id:s}=this.props,a=this.context&&this.context.uDropDownButton,{focusedIndex:i}=this.state;return r.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:a}),t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||y(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":i>=0?`${this.guid}-${i}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:a,size:this.props.size}))},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props,o=this.context&&this.context.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map(((a,i)=>r.createElement(p,{className:n.classNames(n.uDropDownButton.item({c:o}),a.className,{"k-first":0===i},{"k-last":i===this.buttonsData.length-1}),dataItem:a,textField:s,focused:this.state.focusedIndex===i,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:i,key:i,id:`${this.guid}-${i}`}))):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}};I.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},I.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let x=I;x.contextType=n.UnstyledContext;const D=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",w=["button"+D,".k-button-group > button"+D,".k-colorpicker",".k-dropdownlist"],E=r.forwardRef(((e,t)=>{n.validatePackage(l);const{children:s,className:o,id:a,ariaLabel:i,keyboardNavigation:d,role:c,onResize:u,dir:p,style:m,tabIndex:h=N.tabIndex,size:f=N.size}=e,v=r.useRef(!1),y=r.useRef(null),g=r.useRef(0),b=r.useRef(0),k=r.useRef([]),C=r.useMemo((()=>e.buttons||w),[e.buttons]),I=r.useMemo((()=>C.map((e=>e+":focus")).join(",")),[C]),x=()=>{const e=y.current&&y.current.querySelector(I);return Math.max(0,k.current.findIndex((t=>t===e)))},D=r.useRef({element:null,props:e});r.useImperativeHandle(D,(()=>({element:y.current,props:e}))),r.useImperativeHandle(t,(()=>D.current)),r.useEffect((()=>(window.addEventListener("resize",B),y.current&&(b.current=y.current.offsetWidth,g.current=y.current.offsetHeight,!1!==d&&(k.current=Array.from(y.current.querySelectorAll(C.join(","))),E(0))),()=>{window.removeEventListener("resize",B),k.current.length=0})),[]),r.useEffect((()=>{if(v.current){if(!y.current||!1===d)return;k.current=Array.from(y.current.querySelectorAll(C.join(","))),E(x())}else v.current=!0}));const E=e=>{k.current.forEach(((t,s)=>{t.tabIndex=s===e?h:-1}))},K=(e,t)=>{const s=k.current[t];if(s){s.tabIndex=h,s.focus();const t=k.current[e];t&&(t.tabIndex=-1)}},B=e=>{if(!y.current)return;const t=y.current.offsetWidth,s=y.current.offsetHeight;if(b.current!==t||g.current!==s){b.current=t,g.current=s;const n={offsetWidth:b.current,offsetHeight:g.current};u&&u.call(void 0,{target:D.current,...n,nativeEvent:e})}};return r.createElement("div",{id:a,"aria-label":i,className:n.classNames("k-toolbar k-toolbar-solid",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[f]||f}`]:f},o),style:m,role:void 0!==c?c||void 0:"toolbar",dir:p,ref:y,onKeyDown:!1!==d?e=>{const t=e.keyCode===n.Keys.left||e.keyCode===n.Keys.right||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end,s=x();!t||e.defaultPrevented||-1===k.current.findIndex((t=>t===e.target))||(e.keyCode===n.Keys.left?K(s,0===s?k.current.length-1:s-1):K(s,s===k.current.length-1?0:s+1),e.keyCode===n.Keys.home&&K(s,0),e.keyCode===n.Keys.end&&K(s,k.current.length-1))}:void 0},s)})),N={tabIndex:0,size:"medium"};E.displayName="KendoReactToolbar",E.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"])};const K=r.forwardRef(((e,t)=>{const{id:s,className:o,style:a,children:i}=e,l=r.useRef(null);return r.useImperativeHandle(t,(()=>({element:l.current}))),r.createElement("div",{id:s,className:n.classNames("k-toolbar-item",o),style:a,ref:l},i)}));K.displayName="KendoReactToolbarItem",K.propTypes={className:s.string};const B=r.forwardRef(((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,(()=>({element:s.current}))),r.useImperativeHandle(t,(()=>({element:s.current})));const a=r.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return r.createElement("span",{ref:s,className:a})}));B.displayName="KendoReactToolbarSpacer",B.propTypes={className:s.string};const O=t.createContext([null,e=>{}]),S=t.createContext([null,e=>{}]),R=t.createContext([null,e=>{}]);var z=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(z||{});var M=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(M||{});var F=(e=>(e.toggle="toggle",e.remove="remove",e))(F||{});const P=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{disabled:i=A.disabled,fillMode:d=A.fillMode,themeColor:c=A.themeColor,size:u=A.size,rounded:p=A.rounded,dir:m=A.dir,removeIcon:h=A.removeIcon,removeSvgIcon:f=A.removeSvgIcon,removable:v=A.removable}=e,y=n.useDir(o,m);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const[g,b]=r.useContext(O),[k,C]=r.useContext(S),[,I]=r.useContext(R),x=r.useMemo((()=>e.selected||(Array.isArray(g)?g.some((t=>t===e.value)):g===e.value)),[e.selected,e.value,g]),D=r.useMemo((()=>k===e.value),[e.value,k]);r.useEffect((()=>{D&&o.current&&o.current.focus()}),[D]);const w=r.useCallback((t=>{b({type:F.toggle,payload:e.value,event:t})}),[b,e.value]),E=r.useCallback((t=>{v&&(I({type:M.remove,payload:e.value,event:t}),C({type:z.reset,payload:e.value,event:t}),b({type:F.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,v,I,C,b]),N=r.useCallback((t=>{switch(t.keyCode){case n.Keys.left:C({type:z.prev,payload:e.value,event:t});break;case n.Keys.right:C({type:z.next,payload:e.value,event:t});break;case n.Keys.enter:b({type:F.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,C,b,E]),K=r.useCallback((t=>{C({payload:e.value,type:z.current,event:t}),e.onFocus&&e.onFocus.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onFocus,e.value,C]),B=r.useCallback((t=>{e.onBlur&&e.onBlur.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onBlur]),P=n.useMouse(e,s,{onClick:w});return r.createElement("div",{...P,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:y,tabIndex:n.getTabIndex(e.tabIndex,i,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===y,"k-disabled":i,"k-selected":x,"k-focus":D,[`k-chip-${n.kendoThemeMaps.sizeMap[u]||u}`]:u,[`k-rounded-${n.kendoThemeMaps.roundedMap[p]||p}`]:p,[`k-chip-${d}`]:d,[`k-chip-${d}-${c}`]:!(!d||!c)},e.className),"aria-pressed":e.role?void 0:x,"aria-disabled":i,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":v?"Enter Delete":void 0,onFocus:K,onBlur:B,onKeyDown:N},x&&(e.selectedIcon||e.selectedSvgIcon)&&r.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)&&r.createElement(n.IconWrap,{className:"k-chip-icon",name:e.icon?n.toIconName(e.icon):void 0,icon:e.svgIcon,size:"small"}),e.avatar&&r.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},r.createElement("span",{className:"k-avatar-image"},r.createElement("img",{src:e.avatar.image,alt:e.avatar.imageAlt}))),r.createElement("span",{className:"k-chip-content"},void 0!==e.children?e.children:e.text&&r.createElement("span",{"aria-label":e.ariaLabel||e.text,className:"k-chip-label"},e.text)),v&&r.createElement("span",{className:"k-chip-actions"},r.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:E},r.createElement(n.IconWrap,{name:h?n.toIconName(h):void 0,icon:f||a.xCircleIcon,size:"small"}))))})),T={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"])},A={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:a.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};P.displayName="KendoReactChip",P.propTypes=T;const $=(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]=r.useState(e);return[n,e=>{const a=((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(a,e.event),"none"!==t.selection&&o(a)}]},U=(e,t,s)=>{const[n,o]=r.useState(e);return[n,e=>{const a=((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(a,e.event),o(a)}]},j=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{id:a,style:i,tabIndex:d,className:c,ariaDescribedBy:u,ariaLabelledBy:p,ariaLabel:m,value:h,defaultData:f=L.defaultData,chip:v=L.chip,disabled:y=L.disabled,size:g=L.size,defaultValue:b=L.defaultValue,selection:k=L.selection,valueField:C=L.valueField,textField:I=L.textField,dir:x=L.dir,onChange:D,onDataChange:w}=e,E=n.useDir(o,x),N=r.useMemo((()=>v||P),[v,P]);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const K=r.useCallback(((e,t)=>{D&&s.current&&D.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[D]),[B,z]=$(h||b,{selection:k,state:h},K),M=r.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[F,T]=U(e.data||f,{state:e.data,valueField:C},M),A=r.useCallback(((e,t)=>(e.push(t[C]),e)),[C]),j=r.useMemo((()=>e.data||F),[e.data,F]),H=r.useMemo((()=>h||B),[h,B]),q=r.useMemo((()=>j.reduce(A,[])),[j,A]),W=r.useCallback((e=>n.getter(C)(e)),[C]),V=r.useCallback((e=>n.getter(I)(e)),[I]),[G,Z]=(e=>{const[t,s]=r.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:q}),J=n.useMouse(e,s);return r.createElement(O.Provider,{value:[H,z]},r.createElement(S.Provider,{value:[G,Z]},r.createElement(R.Provider,{value:[j,T]},r.createElement("div",{ref:o,...J,role:y?void 0:"listbox",id:a,dir:E,style:i,tabIndex:n.getTabIndex(d,y,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===E,"k-disabled":y,[`k-chip-list-${n.kendoThemeMaps.sizeMap[g]||g}`]:g},c),"aria-label":m,"aria-labelledby":p,"aria-describedby":u,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===k},j.map(((e,t)=>r.createElement(N,{role:"option",dataItem:e,size:g,key:[W(e),t].join("-"),text:V(e),value:W(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),H={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"])},L={chip:P,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};j.displayName="KendoReactChipList",j.propTypes=H;const q=r.forwardRef(((e,t)=>{const{className:s,disabled:o,text:a,icon:i,style:l,id:d,focused:c,tabIndex:u,index:p,dataItem:m,item:h,svgIcon:f,onDown:v,onClick:y,...g}=e,b=r.useRef(null),k=r.useCallback((()=>{b.current&&b.current.focus()}),[]),C=r.useCallback((()=>({element:b.current,focus:k})),[k]);r.useImperativeHandle(t,C);const I=r.useCallback((e=>{y&&void 0!==p&&!o&&y(e,p)}),[y,p]),x=r.useMemo((()=>n.classNames("k-fab-item",{"k-focus":c,"k-disabled":o},s)),[s,o,c]),D=h;return r.createElement("li",{ref:b,id:d,className:x,style:l,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${a||""} floatingactionbutton item`,onClick:I,onMouseDown:v,onPointerDown:v,...g},D?r.createElement(D,{itemIndex:p,item:m}):r.createElement(r.Fragment,null,a&&r.createElement("span",{className:"k-fab-item-text"},a),i||f?r.createElement(n.IconWrap,{className:"k-fab-item-icon",name:i,icon:f}):null))}));q.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},q.displayName="KendoFloatingActionButtonItem";const W="16px",V=e=>"number"==typeof e?e+"px":e,G=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},Z=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},J=(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"]),Q=(e,t,s,n)=>{const o=t.horizontal,a=t.vertical;if(e.current){const i=s&&void 0!==s.x?V(s.x):W,r=s&&void 0!==s.x?`calc(50% + ${V(s.x)})`:"50%",l=s&&void 0!==s.y?V(s.y):W,d=s&&void 0!==s.y?`calc(50% + ${V(s.y)})`:"50%";e.current.style.setProperty(X(t,n),"center"===o?r:i),e.current.style.setProperty(Y(t),"middle"===a?d:l),n&&(("top"===a||"bottom"===a)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===a&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===a&&"start"===o&&e.current.style.setProperty("left","unset"))}},X=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},Y=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),_=r.forwardRef(((e,t)=>{n.validatePackage(l);const{align:s=ee.align,alignOffset:a,className:i,disabled:d,icon:c,svgIcon:u,iconClass:p,id:m,items:h,item:f,text:v,positionMode:y=ee.positionMode,size:g=ee.size,style:b,rounded:k=ee.rounded,themeColor:C=ee.themeColor,overlayStyle:I,tabIndex:x,accessKey:D,popupSettings:w={},modal:E,onClick:N,onItemClick:K,onFocus:B,onBlur:O,onKeyDown:S,onOpen:R,onClose:z,...M}=e,F=n.useZIndexContext(),P=F?F+2:100,T=r.useRef(null),A=r.useRef(null),$=r.useRef(null),U=r.useRef(null),j=r.useCallback((()=>{A.current&&A.current.focus()}),[]),H=r.useCallback((()=>({element:A.current,focus:j})),[j]);r.useImperativeHandle(T,H),r.useImperativeHandle(t,(()=>T.current));const[L,W]=r.useState(!1),[V,X]=r.useState(!1),[Y,_]=r.useState(-1),te=n.useId()+"-button-id",se=n.useDir(A,e.dir),ne="rtl"===se,oe=n.useId()+"-list-id";r.useEffect((()=>{Q(A,s,a,ne)}),[A,s,a,ne]),r.useEffect((()=>{V&&A&&A.current&&A.current.focus()}),[V,A]);const ae=r.useCallback(((e,t)=>{h&&n.dispatchEvent(t?R:z,e,H(),void 0)}),[R,z,h]),ie=r.useCallback((e=>{!e.target||d||(!h&&N?n.dispatchEvent(N,e,H(),void 0):(W(!L),X(!0),_(L?-1:0),ae(e,!L)))}),[W,X,_,N,ae,L,h,d]),re=r.useCallback((e=>{X(!0),_(L?0:-1),B&&n.dispatchEvent(B,e,H(),void 0)}),[B,X,_]),le=r.useCallback((e=>{X(!1),W(!1),_(-1),n.dispatchEvent(O,e,H(),void 0),L&&ae(e,!1)}),[O,X,W,_,ae]),de=r.useCallback((e=>{e.preventDefault()}),[]),ce=r.useCallback(((e,t)=>{h&&(h[t].disabled||n.dispatchEvent(K,e,H(),{itemProps:h[t],itemIndex:t}))}),[K]),ue=r.useCallback(((e,t)=>{!e.target||!h||(_(t),W(!1),ce(e,t),ae(e,!1))}),[_,W,ce,ae]),pe=r.useCallback((e=>{n.getActiveElement(document)===A.current&&e.preventDefault()}),[A]),me=r.useCallback((e=>{const t=Y,s=h?h.length:-1;if(e.altKey)return!L&&e.keyCode===n.Keys.down&&(e.preventDefault(),W(!0),_(0)),void(L&&e.keyCode===n.Keys.up&&(e.preventDefault(),W(!1),_(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&ce(e,t),h||ie(e),e.preventDefault(),W(!L),_(L?-1:0);break;case n.Keys.esc:e.preventDefault(),W(!1),_(-1);break;case n.Keys.home:e.preventDefault(),_(0);break;case n.Keys.end:e.preventDefault(),_(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),_(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),_(t-1<0?s-1:t-1)}n.dispatchEvent(S,e,H(),void 0)}),[S,Y,_,ne,W]),he=r.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===g,"k-fab-md":"medium"===g,"k-fab-lg":"large"===g,"k-disabled":d,"k-pos-absolute":"absolute"===y,"k-pos-fixed":"fixed"===y,"k-focus":V,[`k-rounded-${n.kendoThemeMaps.roundedMap[k]||k}`]:k,[`k-fab-solid-${C}`]:C},`k-${s.vertical}-${s.horizontal}`,i)),[C,g,k,d,y,s,V,i]),fe=h&&h.map(((e,t)=>r.createElement(q,{...e,key:t,index:t,id:`${oe}-${t}`,disabled:d||e.disabled,focused:Y===t,dataItem:e,item:f,className:n.classNames(e.className,J(se||"ltr",s.horizontal)),onClick:ue,onDown:pe}))),ve=!(!c&&!u||v),ye=(A.current?A.current.offsetWidth:0)/2-16;return r.createElement(n.ZIndexContext.Provider,{value:P},r.createElement(r.Fragment,null,r.createElement("button",{ref:A,id:m||te,role:"button",type:"button","aria-disabled":d,"aria-expanded":h?L:void 0,"aria-haspopup":!!h,"aria-label":`${v||""} floatingactionbutton`,"aria-owns":h?oe:void 0,"aria-activedescendant":Y>=0&&h?`${oe}-${Y}`:void 0,tabIndex:n.getTabIndex(x,d),accessKey:D,dir:se,disabled:d,className:he,style:b,onClick:ie,onMouseDown:de,onFocus:re,onBlur:le,onKeyDown:me,...M},c||u?r.createElement(n.IconWrap,{className:"k-fab-icon",name:c,icon:u}):p?r.createElement("span",{role:"presentation",className:p}):null,v&&r.createElement("span",{className:"k-fab-text"},v)),E&&L&&r.createElement("div",{className:"k-overlay",style:{zIndex:P,...I}}),r.createElement(o.Popup,{ref:U,anchor:A.current,show:L,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||G(s,ne),popupAlign:w.popupAlign||Z(s,ne),style:{boxShadow:"none"}},r.createElement("ul",{ref:$,role:"menu","aria-labelledby":m,id:oe,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:ve?ye:void 0,paddingRight:ve?ye:void 0}},fe))))}));_.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 ee={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};_.displayName="KendoFloatingActionButton";const te=n.withIdHOC(x);te.displayName="KendoReactDropDownButton";const se=n.withIdHOC(b);se.displayName="KendoReactSplitButton",e.Button=d,e.ButtonGroup=u,e.Chip=P,e.ChipList=j,e.DropDownButton=te,e.DropDownButtonClassComponent=x,e.DropDownButtonItem=C,e.FloatingActionButton=_,e.FloatingActionButtonItem=q,e.SplitButton=se,e.SplitButtonClassComponent=b,e.SplitButtonItem=h,e.Toolbar=E,e.ToolbarItem=K,e.ToolbarSeparator=e=>r.createElement("div",{className:n.classNames("k-separator",e.className)}),e.ToolbarSpacer=B,e.toolbarButtons=w}));
|
|
8
|
+
!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")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactButtons={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactPopup,e.KendoSvgIcons)}(this,(function(e,t,s,n,o,a){"use strict";function i(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 r=i(t);const l={name:"@progress/kendo-react-buttons",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};const d=r.forwardRef(((e,t)=>{n.validatePackage(l);const{children:s,togglable:o,dir:a,disabled:i,selected:d,icon:u,iconClass:p,svgIcon:m,imageUrl:h,imageAlt:f,className:v,startIcon:y,endIcon:g,onClick:b,size:k=c.size,rounded:C=c.rounded,fillMode:I=c.fillMode,themeColor:x=c.themeColor,...D}=e,w=r.useRef(),E=r.useRef(null),[N,K]=r.useState(!0===o&&!0===d),B=void 0!==m||void 0!==u||void 0!==p||void 0!==h,O=void 0!==s,S=n.useUnstyled(),R=e.unstyled||S,M=R&&R.uButton;r.useImperativeHandle(t,(()=>({element:E.current,selected:void 0!==w.current?w.current:N}))),r.useMemo((()=>{o&&void 0!==d&&d!==N&&K(d)}),[o,d]),r.useEffect((()=>{w.current=void 0}),[N]);const z=function({imageUrl:e,name:t,iconClass:s,svgIcon:o,imageAlt:a,buttonClasses:i}){return e?r.createElement("img",{role:"presentation",className:n.classNames(n.uButton.icon({c:i})),alt:a,src:e}):t||o?r.createElement(n.IconWrap,{className:n.classNames(n.uButton.icon({c:i})),name:t,icon:o}):s?r.createElement("span",{role:"presentation",className:n.classNames(n.uButton.icon({c:i}),s)}):null}({name:u,svgIcon:m,iconClass:p,imageUrl:h,imageAlt:f,buttonClasses:M}),F=e=>r.cloneElement(e,{className:n.classNames(n.uButton.icon({c:M}))});return r.createElement("button",{ref:E,"aria-pressed":o?N:void 0,...D,dir:a,disabled:i,onClick:e=>{o&&void 0===d&&(w.current=!N,K(!N)),b&&b.call(void 0,e)},className:n.classNames(n.uButton.wrapper({c:M,isRtl:"rtl"===a,selected:N,disabled:i,size:k,fillMode:I,rounded:C,themeColor:x,iconButton:!O&&B}),v)},y&&F(y),z,s&&r.createElement("span",{className:n.classNames(n.uButton.text({c:M}))},s),g&&F(g))})),c={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 u=e=>{n.validatePackage(l);const{children:t,className:s,dir:o,disabled:a,width:i}=e,d=n.useUnstyled(),c=e.unstyled||d,u=c&&c.uButtonGroup,p=(e,t)=>{const s={...i?{width:i}:{},...e.props.style||{}},n=a||e.props.disabled,o={...e.props,...t?{className:t}:{},...Object.keys(s).length?{style:s}:{},...void 0!==n?{disabled:n}:{}};return r.Children.count(e.props.children)>0?r.cloneElement(e,o,e.props.children):r.cloneElement(e,o)},m=r.useRef(null),h=(e=>{const t=r.Children.count(e),s=void 0!==o?"rtl"===o:m.current&&"rtl"===getComputedStyle(m.current).direction||!1;return r.Children.map(e,((e,o)=>{if(r.isValidElement(e)){const a=o===t-1,i=s,r=n.classNames(e.props.className,n.uButtonGroup.position({c:u,start:i?a:0===o,end:i?0===o:a}));return p(e,r)}return e}))})(t),f=n.classNames(n.uButtonGroup.wrapper({c:u,stretched:!!i,disabled:a}),s),v={className:f,style:{width:`${i}`},dir:o,role:"group","aria-disabled":a};return r.createElement("div",{ref:m,...v,className:f},h)};u.propTypes={children:s.oneOfType([s.arrayOf(s.element),s.element]),className:s.string,disabled:s.bool,width:s.string,dir:s.string};const p=e=>{const t=n.useUnstyled(),s=e.unstyled||t,o=s&&s.uDropDownButton,a=r.useCallback((t=>{e.onClick(t,e.index)}),[e]),i=e.dataItem.render||e.item||(void 0===e.item?e.render:null),l=void 0!==e.dataItem.text?e.dataItem.text:e.textField?e.dataItem[e.textField]:e.dataItem,d=r.createElement("li",{id:e.id,className:n.classNames(n.uDropDownButton.li({c:o,focused:e.focused}),e.className),tabIndex:-1,onClick:a,onMouseDown:e.onDown,onPointerDown:e.onDown,role:"menuitem","aria-disabled":e.dataItem.disabled||void 0},r.createElement("span",{tabIndex:-1,className:n.classNames(n.uDropDownButton.link({c:o,selected:e.dataItem.selected,disabled:e.dataItem.disabled})),key:"icon"},i?r.createElement(i,{item:e.dataItem,itemIndex:e.index}):r.createElement(r.Fragment,null,(e.dataItem.icon||e.dataItem.iconClass||e.dataItem.svgIcon)&&r.createElement(n.IconWrap,{className:e.dataItem.iconClass,name:e.dataItem.icon,icon:e.dataItem.svgIcon}),e.dataItem.imageUrl&&r.createElement("img",{role:"presentation",alt:"",src:e.dataItem.imageUrl,className:"k-icon"}),l&&r.createElement("span",{className:"k-menu-link-text"},l))));return void 0!==e.item&&void 0!==e.render?e.render.call(void 0,d,e):d};p.displayName="KendoReactButtonItem";const m=class extends r.Component{render(){return null}};m.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,disabled:s.bool,render:s.any};let h=m;const f=(e,t,s,o)=>{if(s)return e;const a=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 a-1<0?o-1:a-1;case n.Keys.down:case n.Keys.right:return a+1>=o?0:a+1;case n.Keys.home:return 0;case n.Keys.end:return o-1;default:return e}};function v(e){const t={horizontal:"left",vertical:"bottom"};return e&&(t.horizontal="right"),t}function y(e){const t={horizontal:"left",vertical:"top"};return e&&(t.horizontal="right"),t}const g=class extends r.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.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=f(t,e.keyCode,e.altKey,this.buttonsData.length);o!==t&&(s=s||{},s.focusedIndex=o);const a=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(a||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},n.validatePackage(l)}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||r.Children.toArray(this.props.children).filter((e=>e&&e.type===h)).map((e=>e.props));const e=this.isRtl(),t=e?"rtl":void 0,{id:s,style:o,tabIndex:i,disabled:l}=this.props;return r.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},r.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:l||void 0,tabIndex:i,accessKey:this.props.accessKey,className:this.props.buttonClass,icon:this.props.icon,svgIcon:this.props.svgIcon,iconClass:this.props.iconClass,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),r.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:a.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(e))}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 r.createElement(o.Popup,{anchor:this.wrapper,show:this.opened,animate:t.animate,popupClass:n.classNames("k-menu-popup",t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||y(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.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,a)=>r.createElement(p,{className:n.classNames("k-menu-item",{"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,key:a,index: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.wrapper&&"rtl"===getComputedStyle(this.wrapper).direction}};g.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},g.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let b=g;const k=class extends r.Component{render(){return null}};k.propTypes={text:s.string,icon:s.string,iconClass:s.string,imageUrl:s.string,selected:s.bool,disabled:s.bool,render:s.any};let C=k;const I=class extends r.Component{constructor(e){super(e),this.state={opened:!1,focused:!1,focusedIndex:-1},this.mainButton=null,this.list=null,this.skipFocus=!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=f(t,e.keyCode,e.altKey,this.buttonsData.length);s.focusedIndex=o;const a=e.keyCode===n.Keys.up||e.keyCode===n.Keys.down||e.keyCode===n.Keys.left||e.keyCode===n.Keys.right;!e.altKey&&(a||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},n.validatePackage(l)}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.context&&this.context.uDropDownButton,s=e?"rtl":void 0,{id:o,style:a,tabIndex:i,disabled:l,size:c,rounded:u,fillMode:p,themeColor:m,ariaLabel:h,title:f,accessKey:v,icon:y,svgIcon:g,iconClass:b,buttonClass:k,className:I,imageUrl:x,startIcon:D,endIcon:w}=this.props;return this.buttonsData=this.props.items||r.Children.toArray(this.props.children).filter((e=>e&&e.type===C)).map((e=>e.props)),r.createElement(r.Fragment,null,r.createElement(d,{id:o,size:c,style:a,rounded:u,fillMode:p,themeColor:m,onClick:this.onClickMainButton,onMouseDown:this.mouseDown,onKeyDown:this.onKeyDown,onFocus:this.handleFocus,onBlur:this.handleButtonBlur,"aria-disabled":l?"true":void 0,tabIndex:i,accessKey:v,icon:y,svgIcon:g,iconClass:b,className:n.classNames(k,I,n.uDropDownButton.wrapper({c:t,focused:this.state.focused,disabled:l})),imageUrl:x,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:D,endIcon:w},this.props.text),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={},id:s}=this.props,a=this.context&&this.context.uDropDownButton,{focusedIndex:i}=this.state;return r.createElement(o.Popup,{anchor:this.mainButton,show:this.opened,animate:t.animate,popupClass:n.classNames(n.uDropDownButton.popup({c:a}),t.popupClass),anchorAlign:t.anchorAlign||v(e),popupAlign:t.popupAlign||y(e),style:e?{direction:"rtl"}:void 0,onClose:this.onPopupClose},r.createElement("ul",{role:"list",id:this.guid,tabIndex:-1,"aria-activedescendant":i>=0?`${this.guid}-${i}`:void 0,ref:this.listRef,onKeyDown:this.onKeyDown,onBlur:this.handleMenuBlur,className:n.classNames(n.uDropDownButton.ul({c:a,size:this.props.size}))},this.renderChildItems()))}renderChildItems(){const{item:e,itemRender:t,textField:s}=this.props,o=this.context&&this.context.uDropDownButton;return this.buttonsData.length>0?this.buttonsData.map(((a,i)=>r.createElement(p,{className:n.classNames(n.uDropDownButton.item({c:o}),a.className,{"k-first":0===i},{"k-last":i===this.buttonsData.length-1}),dataItem:a,textField:s,focused:this.state.focusedIndex===i,onClick:this.onItemClick,onDown:this.onItemDown,render:t,item:e,index:i,key:i,id:`${this.guid}-${i}`}))):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}};I.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},I.defaultProps={size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};let x=I;x.contextType=n.UnstyledContext;const D=":not(.k-dropdownlist button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",w=["button"+D,".k-button-group > button"+D,".k-colorpicker",".k-dropdownlist"],E=r.forwardRef(((e,t)=>{n.validatePackage(l);const{children:s,className:o,id:a,ariaLabel:i,keyboardNavigation:d,role:c,onResize:u,dir:p,style:m,tabIndex:h=N.tabIndex,size:f=N.size,fillMode:v=N.fillMode}=e,y=r.useRef(!1),g=r.useRef(null),b=r.useRef(0),k=r.useRef(0),C=r.useRef([]),I=r.useMemo((()=>e.buttons||w),[e.buttons]),x=r.useMemo((()=>I.map((e=>e+":focus")).join(",")),[I]),D=()=>{const e=g.current&&g.current.querySelector(x);return Math.max(0,C.current.findIndex((t=>t===e)))},E=r.useRef({element:null,props:e});r.useImperativeHandle(E,(()=>({element:g.current,props:e}))),r.useImperativeHandle(t,(()=>E.current)),r.useEffect((()=>(window.addEventListener("resize",O),g.current&&(k.current=g.current.offsetWidth,b.current=g.current.offsetHeight,!1!==d&&(C.current=Array.from(g.current.querySelectorAll(I.join(","))),K(0))),()=>{window.removeEventListener("resize",O),C.current.length=0})),[]),r.useEffect((()=>{if(y.current){if(!g.current||!1===d)return;C.current=Array.from(g.current.querySelectorAll(I.join(","))),K(D())}else y.current=!0}));const K=e=>{C.current.forEach(((t,s)=>{t.tabIndex=s===e?h:-1}))},B=(e,t)=>{const s=C.current[t];if(s){s.tabIndex=h,s.focus();const t=C.current[e];t&&(t.tabIndex=-1)}},O=e=>{if(!g.current)return;const t=g.current.offsetWidth,s=g.current.offsetHeight;if(k.current!==t||b.current!==s){k.current=t,b.current=s;const n={offsetWidth:k.current,offsetHeight:b.current};u&&u.call(void 0,{target:E.current,...n,nativeEvent:e})}};return r.createElement("div",{id:a,"aria-label":i,className:n.classNames("k-toolbar",{[`k-toolbar-${n.kendoThemeMaps.sizeMap[f]||f}`]:f,[`k-toolbar-${v}`]:v},o),style:m,role:void 0!==c?c||void 0:"toolbar",dir:p,ref:g,onKeyDown:!1!==d?e=>{const t=e.keyCode===n.Keys.left||e.keyCode===n.Keys.right||e.keyCode===n.Keys.home||e.keyCode===n.Keys.end,s=D();!t||e.defaultPrevented||-1===C.current.findIndex((t=>t===e.target))||(e.keyCode===n.Keys.left?B(s,0===s?C.current.length-1:s-1):B(s,s===C.current.length-1?0:s+1),e.keyCode===n.Keys.home&&B(s,0),e.keyCode===n.Keys.end&&B(s,C.current.length-1))}:void 0},s)})),N={tabIndex:0,size:"medium",fillMode:"solid"};E.displayName="KendoReactToolbar",E.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"])};const K=r.forwardRef(((e,t)=>{const{id:s,className:o,style:a,children:i}=e,l=r.useRef(null);return r.useImperativeHandle(t,(()=>({element:l.current}))),r.createElement("div",{id:s,className:n.classNames("k-toolbar-item",o),style:a,ref:l},i)}));K.displayName="KendoReactToolbarItem",K.propTypes={className:s.string};const B=r.forwardRef(((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,(()=>({element:s.current}))),r.useImperativeHandle(t,(()=>({element:s.current})));const a=r.useMemo((()=>n.classNames("k-spacer",e.className)),[e.className]);return r.createElement("span",{ref:s,className:a})}));B.displayName="KendoReactToolbarSpacer",B.propTypes={className:s.string};const O=t.createContext([null,e=>{}]),S=t.createContext([null,e=>{}]),R=t.createContext([null,e=>{}]);var M=(e=>(e.next="next",e.prev="prev",e.current="current",e.reset="reset",e))(M||{});var z=(e=>(e.remove="remove",e.add="add",e.reorder="reorder",e))(z||{});var F=(e=>(e.toggle="toggle",e.remove="remove",e))(F||{});const P=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{disabled:i=A.disabled,fillMode:d=A.fillMode,themeColor:c=A.themeColor,size:u=A.size,rounded:p=A.rounded,dir:m=A.dir,removeIcon:h=A.removeIcon,removeSvgIcon:f=A.removeSvgIcon,removable:v=A.removable}=e,y=n.useDir(o,m);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const[g,b]=r.useContext(O),[k,C]=r.useContext(S),[,I]=r.useContext(R),x=r.useMemo((()=>e.selected||(Array.isArray(g)?g.some((t=>t===e.value)):g===e.value)),[e.selected,e.value,g]),D=r.useMemo((()=>k===e.value),[e.value,k]);r.useEffect((()=>{D&&o.current&&o.current.focus()}),[D]);const w=r.useCallback((t=>{b({type:F.toggle,payload:e.value,event:t})}),[b,e.value]),E=r.useCallback((t=>{v&&(I({type:z.remove,payload:e.value,event:t}),C({type:M.reset,payload:e.value,event:t}),b({type:F.remove,payload:e.value,event:t}),e.onRemove&&e.onRemove.call(void 0,{target:s.current,syntheticEvent:t}))}),[e.onRemove,e.value,v,I,C,b]),N=r.useCallback((t=>{switch(t.keyCode){case n.Keys.left:C({type:M.prev,payload:e.value,event:t});break;case n.Keys.right:C({type:M.next,payload:e.value,event:t});break;case n.Keys.enter:b({type:F.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,C,b,E]),K=r.useCallback((t=>{C({payload:e.value,type:M.current,event:t}),e.onFocus&&e.onFocus.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onFocus,e.value,C]),B=r.useCallback((t=>{e.onBlur&&e.onBlur.call(void 0,{target:s.current,syntheticEvent:t})}),[e.onBlur]),P=n.useMouse(e,s,{onClick:w});return r.createElement("div",{...P,role:e.role||"button",id:e.value,style:e.style,ref:o,dir:y,tabIndex:n.getTabIndex(e.tabIndex,i,void 0),className:n.classNames("k-chip",{"k-rtl":"rtl"===y,"k-disabled":i,"k-selected":x,"k-focus":D,[`k-chip-${n.kendoThemeMaps.sizeMap[u]||u}`]:u,[`k-rounded-${n.kendoThemeMaps.roundedMap[p]||p}`]:p,[`k-chip-${d}`]:d,[`k-chip-${d}-${c}`]:!(!d||!c)},e.className),"aria-pressed":e.role?void 0:x,"aria-disabled":i,"aria-describedby":e.ariaDescribedBy,"aria-keyshortcuts":v?"Enter Delete":void 0,onFocus:K,onBlur:B,onKeyDown:N},x&&(e.selectedIcon||e.selectedSvgIcon)&&r.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)&&r.createElement(n.IconWrap,{className:"k-chip-icon",name:e.icon?n.toIconName(e.icon):void 0,icon:e.svgIcon,size:"small"}),e.avatar&&r.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},r.createElement("span",{className:"k-avatar-image"},r.createElement("img",{src:e.avatar.image,alt:e.avatar.imageAlt}))),r.createElement("span",{className:"k-chip-content"},void 0!==e.children?e.children:e.text&&r.createElement("span",{"aria-label":e.ariaLabel||e.text,className:"k-chip-label"},e.text)),v&&r.createElement("span",{className:"k-chip-actions"},r.createElement("span",{className:n.classNames("k-chip-action","k-chip-remove-action"),onClick:E},r.createElement(n.IconWrap,{name:h?n.toIconName(h):void 0,icon:f||a.xCircleIcon,size:"small"}))))})),T={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"])},A={disabled:!1,removable:!1,removeIcon:"k-i-x-circle",removeSvgIcon:a.xCircleIcon,dir:"ltr",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base"};P.displayName="KendoReactChip",P.propTypes=T;const $=(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]=r.useState(e);return[n,e=>{const a=((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(a,e.event),"none"!==t.selection&&o(a)}]},U=(e,t,s)=>{const[n,o]=r.useState(e);return[n,e=>{const a=((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(a,e.event),o(a)}]},j=r.forwardRef(((e,t)=>{n.validatePackage(l);const s=r.useRef(null),o=r.useRef(null),{id:a,style:i,tabIndex:d,className:c,ariaDescribedBy:u,ariaLabelledBy:p,ariaLabel:m,value:h,defaultData:f=L.defaultData,chip:v=L.chip,disabled:y=L.disabled,size:g=L.size,defaultValue:b=L.defaultValue,selection:k=L.selection,valueField:C=L.valueField,textField:I=L.textField,dir:x=L.dir,onChange:D,onDataChange:w}=e,E=n.useDir(o,x),N=r.useMemo((()=>v||P),[v,P]);r.useImperativeHandle(s,(()=>({element:o.current,props:e}))),r.useImperativeHandle(t,(()=>s.current));const K=r.useCallback(((e,t)=>{D&&s.current&&D.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[D]),[B,M]=$(h||b,{selection:k,state:h},K),z=r.useCallback(((e,t)=>{w&&s.current&&w.call(void 0,{value:e,target:s.current,syntheticEvent:t})}),[w]),[F,T]=U(e.data||f,{state:e.data,valueField:C},z),A=r.useCallback(((e,t)=>(e.push(t[C]),e)),[C]),j=r.useMemo((()=>e.data||F),[e.data,F]),H=r.useMemo((()=>h||B),[h,B]),q=r.useMemo((()=>j.reduce(A,[])),[j,A]),W=r.useCallback((e=>n.getter(C)(e)),[C]),V=r.useCallback((e=>n.getter(I)(e)),[I]),[G,Z]=(e=>{const[t,s]=r.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:q}),J=n.useMouse(e,s);return r.createElement(O.Provider,{value:[H,M]},r.createElement(S.Provider,{value:[G,Z]},r.createElement(R.Provider,{value:[j,T]},r.createElement("div",{ref:o,...J,role:y?void 0:"listbox",id:a,dir:E,style:i,tabIndex:n.getTabIndex(d,y,void 0),className:n.classNames("k-chip-list",{"k-rtl":"rtl"===E,"k-disabled":y,[`k-chip-list-${n.kendoThemeMaps.sizeMap[g]||g}`]:g},c),"aria-label":m,"aria-labelledby":p,"aria-describedby":u,"aria-orientation":"horizontal","aria-multiselectable":"multiple"===k},j.map(((e,t)=>r.createElement(N,{role:"option",dataItem:e,size:g,key:[W(e),t].join("-"),text:V(e),value:W(e),ariaLabel:e.ariaLabel,svgIcon:e.svgIcon||void 0})))))))})),H={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"])},L={chip:P,size:"medium",disabled:!1,defaultValue:null,defaultData:[],dir:"ltr",selection:"none",textField:"text",valueField:"value",removable:"removable"};j.displayName="KendoReactChipList",j.propTypes=H;const q=r.forwardRef(((e,t)=>{const{className:s,disabled:o,text:a,icon:i,style:l,id:d,focused:c,tabIndex:u,index:p,dataItem:m,item:h,svgIcon:f,onDown:v,onClick:y,...g}=e,b=r.useRef(null),k=r.useCallback((()=>{b.current&&b.current.focus()}),[]),C=r.useCallback((()=>({element:b.current,focus:k})),[k]);r.useImperativeHandle(t,C);const I=r.useCallback((e=>{y&&void 0!==p&&!o&&y(e,p)}),[y,p]),x=r.useMemo((()=>n.classNames("k-fab-item",{"k-focus":c,"k-disabled":o},s)),[s,o,c]),D=h;return r.createElement("li",{ref:b,id:d,className:x,style:l,role:"menuitem",tabIndex:n.getTabIndex(u,o),"aria-disabled":o,"aria-label":`${a||""} floatingactionbutton item`,onClick:I,onMouseDown:v,onPointerDown:v,...g},D?r.createElement(D,{itemIndex:p,item:m}):r.createElement(r.Fragment,null,a&&r.createElement("span",{className:"k-fab-item-text"},a),i||f?r.createElement(n.IconWrap,{className:"k-fab-item-icon",name:i,icon:f}):null))}));q.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},q.displayName="KendoFloatingActionButtonItem";const W="16px",V=e=>"number"==typeof e?e+"px":e,G=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},Z=(e,t)=>{const s={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(s.horizontal=t?"left":"right"),s},J=(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"]),Q=(e,t,s,n)=>{const o=t.horizontal,a=t.vertical;if(e.current){const i=s&&void 0!==s.x?V(s.x):W,r=s&&void 0!==s.x?`calc(50% + ${V(s.x)})`:"50%",l=s&&void 0!==s.y?V(s.y):W,d=s&&void 0!==s.y?`calc(50% + ${V(s.y)})`:"50%";e.current.style.setProperty(X(t,n),"center"===o?r:i),e.current.style.setProperty(Y(t),"middle"===a?d:l),n&&(("top"===a||"bottom"===a)&&"start"===o&&e.current.style.setProperty("left","unset"),"middle"===a&&"end"===o&&e.current.style.setProperty("right","unset"),"middle"===a&&"start"===o&&e.current.style.setProperty("left","unset"))}},X=(e,t)=>{const{horizontal:s}=e;return{end:t?"left":"right",center:"left",start:t?"right":"left"}[s||"end"]},Y=e=>({top:"top",middle:"top",bottom:"bottom"}[e.vertical||"bottom"]),_=r.forwardRef(((e,t)=>{n.validatePackage(l);const{align:s=ee.align,alignOffset:a,className:i,disabled:d,icon:c,svgIcon:u,iconClass:p,id:m,items:h,item:f,text:v,positionMode:y=ee.positionMode,size:g=ee.size,style:b,rounded:k=ee.rounded,themeColor:C=ee.themeColor,overlayStyle:I,tabIndex:x,accessKey:D,popupSettings:w={},modal:E,onClick:N,onItemClick:K,onFocus:B,onBlur:O,onKeyDown:S,onOpen:R,onClose:M,...z}=e,F=n.useZIndexContext(),P=F?F+2:100,T=r.useRef(null),A=r.useRef(null),$=r.useRef(null),U=r.useRef(null),j=r.useCallback((()=>{A.current&&A.current.focus()}),[]),H=r.useCallback((()=>({element:A.current,focus:j})),[j]);r.useImperativeHandle(T,H),r.useImperativeHandle(t,(()=>T.current));const[L,W]=r.useState(!1),[V,X]=r.useState(!1),[Y,_]=r.useState(-1),te=n.useId()+"-button-id",se=n.useDir(A,e.dir),ne="rtl"===se,oe=n.useId()+"-list-id";r.useEffect((()=>{Q(A,s,a,ne)}),[A,s,a,ne]),r.useEffect((()=>{V&&A&&A.current&&A.current.focus()}),[V,A]);const ae=r.useCallback(((e,t)=>{h&&n.dispatchEvent(t?R:M,e,H(),void 0)}),[R,M,h]),ie=r.useCallback((e=>{!e.target||d||(!h&&N?n.dispatchEvent(N,e,H(),void 0):(W(!L),X(!0),_(L?-1:0),ae(e,!L)))}),[W,X,_,N,ae,L,h,d]),re=r.useCallback((e=>{X(!0),_(L?0:-1),B&&n.dispatchEvent(B,e,H(),void 0)}),[B,X,_]),le=r.useCallback((e=>{X(!1),W(!1),_(-1),n.dispatchEvent(O,e,H(),void 0),L&&ae(e,!1)}),[O,X,W,_,ae]),de=r.useCallback((e=>{e.preventDefault()}),[]),ce=r.useCallback(((e,t)=>{h&&(h[t].disabled||n.dispatchEvent(K,e,H(),{itemProps:h[t],itemIndex:t}))}),[K]),ue=r.useCallback(((e,t)=>{!e.target||!h||(_(t),W(!1),ce(e,t),ae(e,!1))}),[_,W,ce,ae]),pe=r.useCallback((e=>{n.getActiveElement(document)===A.current&&e.preventDefault()}),[A]),me=r.useCallback((e=>{const t=Y,s=h?h.length:-1;if(e.altKey)return!L&&e.keyCode===n.Keys.down&&(e.preventDefault(),W(!0),_(0)),void(L&&e.keyCode===n.Keys.up&&(e.preventDefault(),W(!1),_(-1)));switch(e.keyCode){case n.Keys.enter:case n.Keys.space:t>=0&&ce(e,t),h||ie(e),e.preventDefault(),W(!L),_(L?-1:0);break;case n.Keys.esc:e.preventDefault(),W(!1),_(-1);break;case n.Keys.home:e.preventDefault(),_(0);break;case n.Keys.end:e.preventDefault(),_(s-1);break;case n.Keys.down:case n.Keys.right:e.preventDefault(),_(t+1>=s?0:t+1);break;case n.Keys.up:case n.Keys.left:e.preventDefault(),_(t-1<0?s-1:t-1)}n.dispatchEvent(S,e,H(),void 0)}),[S,Y,_,ne,W]),he=r.useMemo((()=>n.classNames("k-fab k-fab-solid",{"k-fab-sm":"small"===g,"k-fab-md":"medium"===g,"k-fab-lg":"large"===g,"k-disabled":d,"k-pos-absolute":"absolute"===y,"k-pos-fixed":"fixed"===y,"k-focus":V,[`k-rounded-${n.kendoThemeMaps.roundedMap[k]||k}`]:k,[`k-fab-solid-${C}`]:C},`k-${s.vertical}-${s.horizontal}`,i)),[C,g,k,d,y,s,V,i]),fe=h&&h.map(((e,t)=>r.createElement(q,{...e,key:t,index:t,id:`${oe}-${t}`,disabled:d||e.disabled,focused:Y===t,dataItem:e,item:f,className:n.classNames(e.className,J(se||"ltr",s.horizontal)),onClick:ue,onDown:pe}))),ve=!(!c&&!u||v),ye=(A.current?A.current.offsetWidth:0)/2-16;return r.createElement(n.ZIndexContext.Provider,{value:P},r.createElement(r.Fragment,null,r.createElement("button",{ref:A,id:m||te,role:"button",type:"button","aria-disabled":d,"aria-expanded":h?L:void 0,"aria-haspopup":!!h,"aria-label":`${v||""} floatingactionbutton`,"aria-owns":h?oe:void 0,"aria-activedescendant":Y>=0&&h?`${oe}-${Y}`:void 0,tabIndex:n.getTabIndex(x,d),accessKey:D,dir:se,disabled:d,className:he,style:b,onClick:ie,onMouseDown:de,onFocus:re,onBlur:le,onKeyDown:me,...z},c||u?r.createElement(n.IconWrap,{className:"k-fab-icon",name:c,icon:u}):p?r.createElement("span",{role:"presentation",className:p}):null,v&&r.createElement("span",{className:"k-fab-text"},v)),E&&L&&r.createElement("div",{className:"k-overlay",style:{zIndex:P,...I}}),r.createElement(o.Popup,{ref:U,anchor:A.current,show:L,animate:w.animate,popupClass:n.classNames("k-popup-transparent k-fab-popup",w.popupClass),anchorAlign:w.anchorAlign||G(s,ne),popupAlign:w.popupAlign||Z(s,ne),style:{boxShadow:"none"}},r.createElement("ul",{ref:$,role:"menu","aria-labelledby":m,id:oe,className:n.classNames("k-fab-items",{"k-fab-items-bottom":"bottom"!==s.vertical,"k-fab-items-top":"bottom"===s.vertical}),style:{paddingLeft:ve?ye:void 0,paddingRight:ve?ye:void 0}},fe))))}));_.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 ee={align:{vertical:"bottom",horizontal:"end"},size:"medium",rounded:"full",themeColor:"primary",positionMode:"fixed"};_.displayName="KendoFloatingActionButton";const te=n.withIdHOC(x);te.displayName="KendoReactDropDownButton";const se=n.withIdHOC(b);se.displayName="KendoReactSplitButton",e.Button=d,e.ButtonGroup=u,e.Chip=P,e.ChipList=j,e.DropDownButton=te,e.DropDownButtonClassComponent=x,e.DropDownButtonItem=C,e.FloatingActionButton=_,e.FloatingActionButtonItem=q,e.SplitButton=se,e.SplitButtonClassComponent=b,e.SplitButtonItem=h,e.Toolbar=E,e.ToolbarItem=K,e.ToolbarSeparator=e=>r.createElement("div",{className:n.classNames("k-separator",e.className)}),e.ToolbarSpacer=B,e.toolbarButtons=w}));
|
package/index.d.mts
CHANGED
|
@@ -2033,7 +2033,7 @@ export declare interface ToolbarProps extends KendoReactComponentBaseProps {
|
|
|
2033
2033
|
*/
|
|
2034
2034
|
style?: React_2.CSSProperties;
|
|
2035
2035
|
/**
|
|
2036
|
-
* Represents the label of the Toolbar component.
|
|
2036
|
+
* Represents the `aria-label` HTML attribute of the Toolbar component.
|
|
2037
2037
|
*/
|
|
2038
2038
|
ariaLabel?: string;
|
|
2039
2039
|
/**
|
|
@@ -2065,14 +2065,26 @@ export declare interface ToolbarProps extends KendoReactComponentBaseProps {
|
|
|
2065
2065
|
* Configures the `size` of the Toolbar.
|
|
2066
2066
|
*
|
|
2067
2067
|
* The available options are:
|
|
2068
|
-
* - small
|
|
2069
|
-
* - medium
|
|
2070
|
-
* - large
|
|
2071
|
-
* - null
|
|
2068
|
+
* - `small`—Sets the padding of the component to 4px 4px.
|
|
2069
|
+
* - `medium`—Sets the padding of the component to 8px 8px.
|
|
2070
|
+
* - `large`—Sets the padding of the component to 10px 10px.
|
|
2071
|
+
* - `null`—This option removes the the built-in size styles of the Toolbar. Allows for custom `padding`.
|
|
2072
2072
|
*
|
|
2073
2073
|
* @default `medium`
|
|
2074
2074
|
*/
|
|
2075
2075
|
size?: null | 'small' | 'medium' | 'large';
|
|
2076
|
+
/**
|
|
2077
|
+
* Configures the `fillMode` of the Toolbar.
|
|
2078
|
+
*
|
|
2079
|
+
* The available options are:
|
|
2080
|
+
* - `solid`—Applies a `background` color and `solid borders`.
|
|
2081
|
+
* - `flat`—Sets a `transparent background` and `solid bottom border`.
|
|
2082
|
+
* - `outline`—Sets a `transparent background` and `solid borders`.
|
|
2083
|
+
* - `null`—This option removes the built-in fill mode styles of the Toolbar. Allows for custom `background` and `border` styles.
|
|
2084
|
+
*
|
|
2085
|
+
* @default `solid`
|
|
2086
|
+
*/
|
|
2087
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
2076
2088
|
/**
|
|
2077
2089
|
* @hidden
|
|
2078
2090
|
*/
|
package/index.d.ts
CHANGED
|
@@ -2033,7 +2033,7 @@ export declare interface ToolbarProps extends KendoReactComponentBaseProps {
|
|
|
2033
2033
|
*/
|
|
2034
2034
|
style?: React_2.CSSProperties;
|
|
2035
2035
|
/**
|
|
2036
|
-
* Represents the label of the Toolbar component.
|
|
2036
|
+
* Represents the `aria-label` HTML attribute of the Toolbar component.
|
|
2037
2037
|
*/
|
|
2038
2038
|
ariaLabel?: string;
|
|
2039
2039
|
/**
|
|
@@ -2065,14 +2065,26 @@ export declare interface ToolbarProps extends KendoReactComponentBaseProps {
|
|
|
2065
2065
|
* Configures the `size` of the Toolbar.
|
|
2066
2066
|
*
|
|
2067
2067
|
* The available options are:
|
|
2068
|
-
* - small
|
|
2069
|
-
* - medium
|
|
2070
|
-
* - large
|
|
2071
|
-
* - null
|
|
2068
|
+
* - `small`—Sets the padding of the component to 4px 4px.
|
|
2069
|
+
* - `medium`—Sets the padding of the component to 8px 8px.
|
|
2070
|
+
* - `large`—Sets the padding of the component to 10px 10px.
|
|
2071
|
+
* - `null`—This option removes the the built-in size styles of the Toolbar. Allows for custom `padding`.
|
|
2072
2072
|
*
|
|
2073
2073
|
* @default `medium`
|
|
2074
2074
|
*/
|
|
2075
2075
|
size?: null | 'small' | 'medium' | 'large';
|
|
2076
|
+
/**
|
|
2077
|
+
* Configures the `fillMode` of the Toolbar.
|
|
2078
|
+
*
|
|
2079
|
+
* The available options are:
|
|
2080
|
+
* - `solid`—Applies a `background` color and `solid borders`.
|
|
2081
|
+
* - `flat`—Sets a `transparent background` and `solid bottom border`.
|
|
2082
|
+
* - `outline`—Sets a `transparent background` and `solid borders`.
|
|
2083
|
+
* - `null`—This option removes the built-in fill mode styles of the Toolbar. Allows for custom `background` and `border` styles.
|
|
2084
|
+
*
|
|
2085
|
+
* @default `solid`
|
|
2086
|
+
*/
|
|
2087
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
2076
2088
|
/**
|
|
2077
2089
|
* @hidden
|
|
2078
2090
|
*/
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-buttons",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1736855760,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-buttons",
|
|
3
|
-
"version": "9.2.0-develop.
|
|
3
|
+
"version": "9.2.0-develop.8",
|
|
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",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-common": "9.2.0-develop.
|
|
27
|
-
"@progress/kendo-react-popup": "9.2.0-develop.
|
|
26
|
+
"@progress/kendo-react-common": "9.2.0-develop.8",
|
|
27
|
+
"@progress/kendo-react-popup": "9.2.0-develop.8",
|
|
28
28
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
29
29
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
30
30
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
package/toolbar/Toolbar.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react"),c=require("prop-types"),a=require("@progress/kendo-react-common"),P=require("../util.js"),W=require("../package-metadata.js");function A(o){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const i in o)if(i!=="default"){const d=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(f,i,d.get?d:{enumerable:!0,get:()=>o[i]})}}return f.default=o,Object.freeze(f)}const r=A(H),I=r.forwardRef((o,f)=>{a.validatePackage(W.packageMetadata);const{children:i,className:d,id:q,ariaLabel:S,keyboardNavigation:h,role:M,onResize:x,dir:T,style:C,tabIndex:z=p.tabIndex,size:k=p.size,fillMode:v=p.fillMode}=o,w=r.useRef(!1),n=r.useRef(null),b=r.useRef(0),y=r.useRef(0),s=r.useRef([]),m=r.useMemo(()=>o.buttons||P.toolbarButtons,[o.buttons]),N=r.useMemo(()=>m.map(e=>e+":focus").join(","),[m]),K=()=>{const e=n.current&&n.current.querySelector(N);return Math.max(0,s.current.findIndex(u=>u===e))},R=r.useRef({element:null,props:o});r.useImperativeHandle(R,()=>({element:n.current,props:o})),r.useImperativeHandle(f,()=>R.current),r.useEffect(()=>(window.addEventListener("resize",j),n.current&&(y.current=n.current.offsetWidth,b.current=n.current.offsetHeight,h!==!1&&(s.current=Array.from(n.current.querySelectorAll(m.join(","))),O(0))),()=>{window.removeEventListener("resize",j),s.current.length=0}),[]),r.useEffect(()=>{if(w.current){if(!n.current||h===!1)return;s.current=Array.from(n.current.querySelectorAll(m.join(","))),O(K())}else w.current=!0});const O=e=>{s.current.forEach((u,t)=>{u.tabIndex=t===e?z:-1})},E=e=>{const u=e.keyCode===a.Keys.left||e.keyCode===a.Keys.right||e.keyCode===a.Keys.home||e.keyCode===a.Keys.end,t=K();!u||e.defaultPrevented||s.current.findIndex(l=>l===e.target)===-1||(e.keyCode===a.Keys.left?g(t,t===0?s.current.length-1:t-1):g(t,t===s.current.length-1?0:t+1),e.keyCode===a.Keys.home&&g(t,0),e.keyCode===a.Keys.end&&g(t,s.current.length-1))},g=(e,u)=>{const t=s.current[u];if(t){t.tabIndex=z,t.focus();const l=s.current[e];l&&(l.tabIndex=-1)}},j=e=>{if(!n.current)return;const u=n.current.offsetWidth,t=n.current.offsetHeight;if(y.current!==u||b.current!==t){y.current=u,b.current=t;const l={offsetWidth:y.current,offsetHeight:b.current};x&&x.call(void 0,{target:R.current,...l,nativeEvent:e})}};return r.createElement("div",{id:q,"aria-label":S,className:a.classNames("k-toolbar",{[`k-toolbar-${a.kendoThemeMaps.sizeMap[k]||k}`]:k,[`k-toolbar-${v}`]:v},d),style:C,role:M!==void 0?M||void 0:"toolbar",dir:T,ref:n,onKeyDown:h!==!1?E:void 0},i)}),p={tabIndex:0,size:"medium",fillMode:"solid"};I.displayName="KendoReactToolbar";I.propTypes={tabIndex:c.number,dir:c.string,keyboardNavigation:c.bool,style:c.object,className:c.string,role:c.string,onResize:c.func,buttons:c.arrayOf(c.string.isRequired),size:c.oneOf([null,"small","medium","large"]),fillMode:c.oneOf([null,"solid","flat","outline"])};exports.Toolbar=I;
|
package/toolbar/Toolbar.mjs
CHANGED
|
@@ -7,110 +7,120 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
|
-
import
|
|
10
|
+
import s from "prop-types";
|
|
11
11
|
import { validatePackage as j, classNames as q, kendoThemeMaps as A, Keys as u } from "@progress/kendo-react-common";
|
|
12
12
|
import { toolbarButtons as B } from "../util.mjs";
|
|
13
|
-
import { packageMetadata as
|
|
14
|
-
const v = r.forwardRef((
|
|
15
|
-
j(
|
|
13
|
+
import { packageMetadata as P } from "../package-metadata.mjs";
|
|
14
|
+
const v = r.forwardRef((a, C) => {
|
|
15
|
+
j(P);
|
|
16
16
|
const {
|
|
17
17
|
children: E,
|
|
18
18
|
className: H,
|
|
19
|
-
id:
|
|
20
|
-
ariaLabel:
|
|
19
|
+
id: N,
|
|
20
|
+
ariaLabel: T,
|
|
21
21
|
keyboardNavigation: b,
|
|
22
|
-
role:
|
|
23
|
-
onResize:
|
|
24
|
-
dir:
|
|
25
|
-
style:
|
|
26
|
-
tabIndex:
|
|
27
|
-
size: y =
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
role: k,
|
|
23
|
+
onResize: x,
|
|
24
|
+
dir: W,
|
|
25
|
+
style: K,
|
|
26
|
+
tabIndex: I = h.tabIndex,
|
|
27
|
+
size: y = h.size,
|
|
28
|
+
fillMode: R = h.fillMode
|
|
29
|
+
} = a, p = r.useRef(!1), n = r.useRef(null), f = r.useRef(0), l = r.useRef(0), o = r.useRef([]), d = r.useMemo(() => a.buttons || B, [a.buttons]), O = r.useMemo(() => d.map((e) => e + ":focus").join(","), [d]), z = () => {
|
|
30
|
+
const e = n.current && n.current.querySelector(O);
|
|
30
31
|
return Math.max(
|
|
31
32
|
0,
|
|
32
|
-
o.current.findIndex((
|
|
33
|
+
o.current.findIndex((c) => c === e)
|
|
33
34
|
);
|
|
34
|
-
}, g = r.useRef({ element: null, props:
|
|
35
|
+
}, g = r.useRef({ element: null, props: a });
|
|
35
36
|
r.useImperativeHandle(
|
|
36
37
|
g,
|
|
37
38
|
() => ({
|
|
38
39
|
element: n.current,
|
|
39
|
-
props:
|
|
40
|
+
props: a
|
|
40
41
|
})
|
|
41
|
-
), r.useImperativeHandle(C, () => g.current), r.useEffect(() => (window.addEventListener("resize",
|
|
42
|
+
), r.useImperativeHandle(C, () => g.current), r.useEffect(() => (window.addEventListener("resize", w), n.current && (l.current = n.current.offsetWidth, f.current = n.current.offsetHeight, b !== !1 && (o.current = Array.from(
|
|
42
43
|
n.current.querySelectorAll(d.join(","))
|
|
43
|
-
),
|
|
44
|
-
window.removeEventListener("resize",
|
|
44
|
+
), M(0))), () => {
|
|
45
|
+
window.removeEventListener("resize", w), o.current.length = 0;
|
|
45
46
|
}), []), r.useEffect(() => {
|
|
46
|
-
if (
|
|
47
|
+
if (p.current) {
|
|
47
48
|
if (!n.current || b === !1)
|
|
48
49
|
return;
|
|
49
50
|
o.current = Array.from(
|
|
50
51
|
n.current.querySelectorAll(d.join(","))
|
|
51
|
-
),
|
|
52
|
+
), M(z());
|
|
52
53
|
} else
|
|
53
|
-
|
|
54
|
+
p.current = !0;
|
|
54
55
|
});
|
|
55
|
-
const
|
|
56
|
-
o.current.forEach((
|
|
57
|
-
|
|
56
|
+
const M = (e) => {
|
|
57
|
+
o.current.forEach((c, t) => {
|
|
58
|
+
c.tabIndex = t === e ? I : -1;
|
|
58
59
|
});
|
|
59
60
|
}, S = (e) => {
|
|
60
|
-
const
|
|
61
|
-
!
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const c = e.keyCode === u.left || e.keyCode === u.right || e.keyCode === u.home || e.keyCode === u.end, t = z();
|
|
62
|
+
!c || e.defaultPrevented || o.current.findIndex((i) => i === e.target) === -1 || (e.keyCode === u.left ? m(
|
|
63
|
+
t,
|
|
64
|
+
t === 0 ? o.current.length - 1 : t - 1
|
|
65
|
+
) : m(
|
|
66
|
+
t,
|
|
67
|
+
t === o.current.length - 1 ? 0 : t + 1
|
|
68
|
+
), e.keyCode === u.home && m(t, 0), e.keyCode === u.end && m(t, o.current.length - 1));
|
|
69
|
+
}, m = (e, c) => {
|
|
70
|
+
const t = o.current[c];
|
|
64
71
|
if (t) {
|
|
65
|
-
t.tabIndex =
|
|
66
|
-
const
|
|
67
|
-
|
|
72
|
+
t.tabIndex = I, t.focus();
|
|
73
|
+
const i = o.current[e];
|
|
74
|
+
i && (i.tabIndex = -1);
|
|
68
75
|
}
|
|
69
|
-
},
|
|
76
|
+
}, w = (e) => {
|
|
70
77
|
if (!n.current)
|
|
71
78
|
return;
|
|
72
|
-
const
|
|
73
|
-
if (l.current !==
|
|
74
|
-
l.current =
|
|
75
|
-
const
|
|
76
|
-
|
|
79
|
+
const c = n.current.offsetWidth, t = n.current.offsetHeight;
|
|
80
|
+
if (l.current !== c || f.current !== t) {
|
|
81
|
+
l.current = c, f.current = t;
|
|
82
|
+
const i = { offsetWidth: l.current, offsetHeight: f.current };
|
|
83
|
+
x && x.call(void 0, { target: g.current, ...i, nativeEvent: e });
|
|
77
84
|
}
|
|
78
85
|
};
|
|
79
86
|
return /* @__PURE__ */ r.createElement(
|
|
80
87
|
"div",
|
|
81
88
|
{
|
|
82
|
-
id:
|
|
83
|
-
"aria-label":
|
|
89
|
+
id: N,
|
|
90
|
+
"aria-label": T,
|
|
84
91
|
className: q(
|
|
85
|
-
"k-toolbar
|
|
92
|
+
"k-toolbar",
|
|
86
93
|
{
|
|
87
|
-
[`k-toolbar-${A.sizeMap[y] || y}`]: y
|
|
94
|
+
[`k-toolbar-${A.sizeMap[y] || y}`]: y,
|
|
95
|
+
[`k-toolbar-${R}`]: R
|
|
88
96
|
},
|
|
89
97
|
H
|
|
90
98
|
),
|
|
91
|
-
style:
|
|
92
|
-
role:
|
|
93
|
-
dir:
|
|
99
|
+
style: K,
|
|
100
|
+
role: k !== void 0 ? k || void 0 : "toolbar",
|
|
101
|
+
dir: W,
|
|
94
102
|
ref: n,
|
|
95
103
|
onKeyDown: b !== !1 ? S : void 0
|
|
96
104
|
},
|
|
97
105
|
E
|
|
98
106
|
);
|
|
99
|
-
}),
|
|
107
|
+
}), h = {
|
|
100
108
|
tabIndex: 0,
|
|
101
|
-
size: "medium"
|
|
109
|
+
size: "medium",
|
|
110
|
+
fillMode: "solid"
|
|
102
111
|
};
|
|
103
112
|
v.displayName = "KendoReactToolbar";
|
|
104
113
|
v.propTypes = {
|
|
105
|
-
tabIndex:
|
|
106
|
-
dir:
|
|
107
|
-
keyboardNavigation:
|
|
108
|
-
style:
|
|
109
|
-
className:
|
|
110
|
-
role:
|
|
111
|
-
onResize:
|
|
112
|
-
buttons:
|
|
113
|
-
size:
|
|
114
|
+
tabIndex: s.number,
|
|
115
|
+
dir: s.string,
|
|
116
|
+
keyboardNavigation: s.bool,
|
|
117
|
+
style: s.object,
|
|
118
|
+
className: s.string,
|
|
119
|
+
role: s.string,
|
|
120
|
+
onResize: s.func,
|
|
121
|
+
buttons: s.arrayOf(s.string.isRequired),
|
|
122
|
+
size: s.oneOf([null, "small", "medium", "large"]),
|
|
123
|
+
fillMode: s.oneOf([null, "solid", "flat", "outline"])
|
|
114
124
|
};
|
|
115
125
|
export {
|
|
116
126
|
v as Toolbar
|