@progress/kendo-react-dropdowns 7.2.4-develop.3 → 7.3.0-develop.1
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/AutoComplete/AutoComplete.js +8 -0
- package/AutoComplete/AutoComplete.mjs +458 -0
- package/ComboBox/ComboBox.js +8 -0
- package/ComboBox/ComboBox.mjs +618 -0
- package/DropDownList/DropDownList.js +8 -0
- package/DropDownList/DropDownList.mjs +630 -0
- package/DropDownTree/DropDownTree.js +8 -0
- package/DropDownTree/DropDownTree.mjs +550 -0
- package/DropDownTree/ListNoData.js +8 -0
- package/DropDownTree/ListNoData.mjs +13 -0
- package/DropDownTree/useDropdownWidth.js +8 -0
- package/DropDownTree/useDropdownWidth.mjs +25 -0
- package/MultiColumnComboBox/MultiColumnComboBox.js +8 -0
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +186 -0
- package/MultiSelect/MultiSelect.js +8 -0
- package/MultiSelect/MultiSelect.mjs +694 -0
- package/MultiSelect/TagList.js +8 -0
- package/MultiSelect/TagList.mjs +48 -0
- package/MultiSelectTree/MultiSelectTree.js +8 -0
- package/MultiSelectTree/MultiSelectTree.mjs +590 -0
- package/MultiSelectTree/utils.js +8 -0
- package/MultiSelectTree/utils.mjs +74 -0
- package/common/AdaptiveMode.js +8 -0
- package/common/AdaptiveMode.mjs +73 -0
- package/common/ClearButton.js +8 -0
- package/common/ClearButton.mjs +38 -0
- package/common/DropDownBase.js +8 -0
- package/common/DropDownBase.mjs +194 -0
- package/common/GroupStickyHeader.js +8 -0
- package/common/GroupStickyHeader.mjs +22 -0
- package/common/List.js +8 -0
- package/common/List.mjs +117 -0
- package/common/ListContainer.js +8 -0
- package/common/ListContainer.mjs +33 -0
- package/common/ListDefaultItem.js +8 -0
- package/common/ListDefaultItem.mjs +36 -0
- package/common/ListFilter.js +8 -0
- package/common/ListFilter.mjs +49 -0
- package/common/ListGroupItem.js +8 -0
- package/common/ListGroupItem.mjs +32 -0
- package/common/ListItem.js +8 -0
- package/common/ListItem.mjs +49 -0
- package/common/MultiColumnList.js +8 -0
- package/common/MultiColumnList.mjs +28 -0
- package/common/Navigation.js +8 -0
- package/common/Navigation.mjs +29 -0
- package/common/SearchBar.js +8 -0
- package/common/SearchBar.mjs +65 -0
- package/common/VirtualScroll.js +8 -0
- package/common/VirtualScroll.mjs +75 -0
- package/common/constants.js +8 -0
- package/common/constants.mjs +13 -0
- package/common/settings.js +8 -0
- package/common/settings.mjs +12 -0
- package/common/utils.js +8 -0
- package/common/utils.mjs +109 -0
- package/common/withCustomComponent.js +8 -0
- package/common/withCustomComponent.mjs +13 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +8 -5
- package/index.d.mts +4098 -5
- package/index.d.ts +4098 -31
- package/index.js +8 -5
- package/index.mjs +55 -4429
- package/messages/index.js +8 -0
- package/messages/index.mjs +27 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/AutoComplete/AutoComplete.d.ts +0 -236
- package/AutoComplete/AutoCompleteProps.d.ts +0 -254
- package/ComboBox/ComboBox.d.ts +0 -254
- package/ComboBox/ComboBoxProps.d.ts +0 -324
- package/DropDownList/DropDownList.d.ts +0 -264
- package/DropDownList/DropDownListProps.d.ts +0 -329
- package/DropDownTree/DropDownTree.d.ts +0 -74
- package/DropDownTree/DropDownTreeProps.d.ts +0 -297
- package/DropDownTree/ListNoData.d.ts +0 -10
- package/DropDownTree/useDropdownWidth.d.ts +0 -10
- package/MultiColumnComboBox/MultiColumnComboBox.d.ts +0 -300
- package/MultiSelect/MultiSelect.d.ts +0 -262
- package/MultiSelect/MultiSelectProps.d.ts +0 -325
- package/MultiSelect/TagList.d.ts +0 -42
- package/MultiSelectTree/MultiSelectTree.d.ts +0 -85
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -324
- package/MultiSelectTree/utils.d.ts +0 -21
- package/common/AdaptiveMode.d.ts +0 -25
- package/common/ClearButton.d.ts +0 -18
- package/common/DropDownBase.d.ts +0 -180
- package/common/GroupStickyHeader.d.ts +0 -28
- package/common/List.d.ts +0 -50
- package/common/ListContainer.d.ts +0 -22
- package/common/ListDefaultItem.d.ts +0 -20
- package/common/ListFilter.d.ts +0 -23
- package/common/ListGroupItem.d.ts +0 -37
- package/common/ListItem.d.ts +0 -65
- package/common/MultiColumnList.d.ts +0 -9
- package/common/Navigation.d.ts +0 -17
- package/common/SearchBar.d.ts +0 -47
- package/common/VirtualScroll.d.ts +0 -45
- package/common/constants.d.ts +0 -8
- package/common/events.d.ts +0 -76
- package/common/filterDescriptor.d.ts +0 -45
- package/common/settings.d.ts +0 -109
- package/common/utils.d.ts +0 -70
- package/common/withCustomComponent.d.ts +0 -11
- package/messages/index.d.ts +0 -44
- package/package-metadata.d.ts +0 -9
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function(M,Qe){typeof exports=="object"&&typeof module!="undefined"?Qe(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-labels"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-treeview")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-labels","@progress/kendo-svg-icons","@progress/kendo-react-popup","@progress/kendo-react-inputs","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-treeview"],Qe):(M=typeof globalThis!="undefined"?globalThis:M||self,Qe(M.KendoReactDropdowns={},M.React,M.PropTypes,M.KendoReactCommon,M.KendoReactLabels,M.KendoSvgIcons,M.KendoReactPopup,M.KendoReactInputs,M.KendoReactIntl,M.KendoReactButtons,M.KendoReactLayout,M.KendoReactTreeview))})(this,function(M,Qe,o,d,He,Ie,dt,Jt,xe,Ce,fe,ct){"use strict";"use client";function Is(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const a=Is(Qe);class Xe extends a.Component{render(){const{children:t,width:e,dir:s,itemsCount:n,popupSettings:l}=this.props;return a.createElement(dt.Popup,{style:{width:e,direction:s},contentKey:n&&n.join(),...l},t)}}const Ft=a.forwardRef((i,t)=>{const e=a.useRef(null);return a.useImperativeHandle(t,()=>e.current),a.createElement("div",{className:"k-list-filter"},a.createElement(Jt.TextBox,{...i,ref:e,value:i.value||"",onChange:i.onChange,onKeyDown:i.onKeyDown,tabIndex:i.tabIndex,onClick:s=>s.stopPropagation(),size:i.size,fillMode:i.fillMode,rounded:i.rounded,prefix:()=>a.createElement(Jt.InputPrefix,null,a.createElement(d.IconWrap,{name:"search",icon:Ie.searchIcon}))}))});Ft.propTypes={value:o.oneOfType([o.string,o.number,o.array]),tabIndex:o.number,onChange:o.func,onKeyDown:o.func,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"])},Ft.displayName="KendoReactListFilter";const Me=Ft;class Ae extends a.Component{render(){const{group:t,groupMode:e,render:s}=this.props,n=a.createElement("div",{className:"k-list-group-sticky-header"},e==="classic"?t:a.createElement("div",{className:"k-list-header-text"},t));return s!==void 0?s.call(void 0,n,this.props):n}}const Y=i=>i!=null,xs=(i,t)=>{for(let e=0;e<i.length;e++)if(i.charAt(e)!==t)return!1;return!0},ys=(i,t,e)=>{let s=i;return e&&(s=[e].concat(s)),s.slice(t).concat(s.slice(0,t))},Qt=(i,t,e)=>{if(!Y(i))return!1;let s=String(i);return e&&(s=s.toLowerCase()),s.indexOf(t)===0},Xt=(i,t,e,s,n)=>{const l=i.offsetHeight,h=t.children.item(e),u=h.offsetTop+(n?s-i.scrollTop:0),c=h.offsetHeight;if(n){let r=0;u+c>l?r=u+c-l:u<0&&(r=u),r!==0?i.scrollTop+=r:i.scrollTop===0&&s!==0&&(i.scrollTop=s)}else u+c>l+i.scrollTop?i.scrollTop=u+c-l:u<i.scrollTop&&(i.scrollTop-=i.scrollTop-u)},_e=(i,t,e)=>{let s=-1;if(t){t=t.toLowerCase();for(let n=0;n<i.length;n++){const l=(z(i[n],e)||"")+"";if(l&&l.toLowerCase().startsWith(t)){s=n;break}}}return s},Kt=(i,t,e,s=!1)=>{const n=l=>s?l:l.toLowerCase();return i.findIndex(l=>e?n(z(l,e))===n(t):n(t)===n(l.toString()))},z=(i,t)=>{if(t&&Y(i)){const e=t.split(".");let s=i;return e.forEach(n=>{s=s?s[n]:void 0}),s}return i},Ss=(i,t,e)=>{if(!i)return;const s=i.findIndex(n=>z(n,t)===e);return i[s]},ws=(i=[],t=[],e)=>{if(i===t)return!0;if(i.length!==t.length)return!1;for(let s=0;s<i.length;s++)if(!L(i[s],t[s],e))return!1;return!0},ut=(i,t,e)=>{t.forEach(s=>{const n=i.findIndex(l=>L(l,s,e));n!==-1&&i.splice(n,1)})},L=(i,t,e)=>i===t||Y(i)===Y(t)&&z(i,e)===z(t,e),Zt=(i,t,e)=>{if(t){const s=Kt(i,t,e,!0);return s!==-1?i[s]:i[_e(i,t,e)]}return i[0]},Es=(i,t=[],e)=>{let s="";if(i){const n=t[_e(t,i,e)];if(n){const l=z(n,e);i.toLowerCase()!==l.toLowerCase()&&(s=l.substring(i.length))}}return s},Cs=i=>{i.target.nodeName!=="INPUT"&&i.preventDefault()},ht=(i,t,e)=>!!i!=!!t||i.text!==t.text?!1:i===t||ws(i.data,t.data,e),ks=i=>i.preventDefault();class Ds extends a.Component{render(){const{selected:t,defaultItem:e,textField:s}=this.props;return a.createElement("div",{onClick:this.props.onClick,onMouseDown:ks,style:{position:"unset"},className:d.classNames("k-list-optionlabel",{"k-selected":t})},z(e,s)||"")}}class Pt extends a.Component{constructor(){super(...arguments),this.handleClick=t=>this.props.onClick(this.props.index,t)}render(){const{selected:t,group:e,dataItem:s,virtual:n,groupMode:l,disabled:h,render:u}=this.props,c=a.createElement("li",{id:this.props.id,role:"option","aria-selected":t,"aria-disabled":h?!0:void 0,className:d.classNames("k-list-item",{"k-selected":t,"k-focus":this.props.focused,"k-first":!!e&&l==="classic","k-disabled":h}),onClick:this.handleClick,style:{position:n?"relative":"unset"}},a.createElement("span",{className:"k-list-item-text"},z(s,this.props.textField).toString()),e!==void 0&&l==="classic"?a.createElement("div",{className:"k-list-item-group-label"},e):null);return u!==void 0?u.call(void 0,c,this.props):c}}class Fs extends a.Component{render(){const{group:t,virtual:e,render:s,isMultiColumn:n=!1}=this.props,l=a.createElement("li",{id:this.props.id,role:"group",className:n?"k-table-group-row":"k-list-group-item",style:n?{boxSizing:"inherit"}:{position:e?"relative":"unset"}},a.createElement("span",{className:s?void 0:n?"k-table-th":"k-list-item-text"},t));return s!==void 0?s.call(void 0,l,this.props):l}}const ge="dropdowns.nodata",Ze="dropdowns.clear",Mt="dropdowns.comboArrowBtnAriaLabelExpand",Nt="dropdowns.comboArrowBtnAriaLabelCollapse",Ot="dropdowns.dropDownListArrowBtnAriaLabel",Pe="dropdowns.apply",Re="dropdowns.cancel",ne={[Ze]:"clear",[ge]:"NO DATA FOUND.",[Mt]:"expand combobox",[Nt]:"collapse combobox",[Ot]:"select",[Pe]:"Apply",[Re]:"Cancel"};class Ve extends a.Component{renderItems(){const{textField:t,valueField:e,groupField:s,groupMode:n,isMultiColumn:l,optionsGuid:h,skip:u=0,virtual:c,focusedIndex:r,highlightSelected:p=!0,value:f,data:g,itemRender:v,groupHeaderItemRender:m}=this.props,b=Array.isArray(f);let C=0;return g.map((w,D)=>{const _=u+D,O=u+D+C,B=w.disabled?!1:p&&(!b&&L(w,f,e)||b&&f.findIndex(k=>L(k,w,e))!==-1);let E,F,S;return D>0&&s!==void 0&&(F=z(w,s),S=z(g[D-1],s),F&&S&&F!==S&&(E=F)),E!==void 0&&n==="modern"&&(C+=1),[E!==void 0&&n==="modern"&&a.createElement(Fs,{id:`option-${h}-${O}`,virtual:c,key:_+"-group-item",group:E,isMultiColumn:l,render:m}),a.createElement(Pt,{id:`option-${h}-${E!==void 0&&n==="modern"?O+1:O}`,virtual:c,dataItem:w,groupMode:n,selected:B,focused:r===D,index:_,key:_,onClick:this.props.onClick,textField:t,group:E,render:v,disabled:w.disabled})]})}renderNoValueElement(t){const e=this.props.noDataRender,s=a.createElement("div",{className:"k-nodata"},a.createElement("div",null,t.toLanguageString(ge,ne[ge])));return e?e.call(void 0,s):s}render(){const t=xe.provideLocalizationService(this),{id:e,show:s,wrapperCssClass:n,wrapperStyle:l,listStyle:h,listRef:u,wrapperRef:c,listClassName:r="k-list-ul",ariaSetSize:p}=this.props,f=this.renderItems();return f.length?a.createElement("div",{className:n,style:l,ref:c,onMouseDown:this.props.onMouseDown,onBlur:this.props.onBlur,onScroll:this.props.onScroll,unselectable:"on"},a.createElement("ul",{id:e,role:"listbox","aria-hidden":s?void 0:!0,"aria-setsize":p,className:r,ref:u,style:h},f),this.props.scroller&&a.createElement("div",{className:"k-height-container"},this.props.scroller)):this.renderNoValueElement(t)}}xe.registerForLocalization(Ve);const Ks=1533915;class Ms{constructor(){this.container=null,this.scrollElement=null,this.list=null,this.containerHeight=0,this.skip=0,this.total=0,this.enabled=!1,this.pageSize=0,this.itemHeight=0,this.PageChange=null,this.prevScrollPos=0,this.listTranslate=0,this.scrollSyncing=!1,this.scrollerRef=t=>{const e=this;e.container=t,t&&(t.setAttribute("unselectable","on"),window.setTimeout(e.calcScrollElementHeight.bind(e),0))},this.calcScrollElementHeight=()=>{this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight,this.containerHeight=Math.min(Ks,this.itemHeight*this.total);const e=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==e+"px",t&&(this.scrollElement.style.height=e+"px")),this.scrollSyncing=!1,t},this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}changePage(t,e){const s=Math.min(Math.max(0,t),this.total-this.pageSize);s!==this.skip&&this.PageChange&&this.PageChange({skip:s,take:this.pageSize},e)}translateTo(t){this.listTranslate=t,this.list&&(this.list.style.transform="translateY("+t+"px)")}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0))}scrollToEnd(){this.container&&this.list&&(this.calcScrollElementHeight(),this.container.scrollTop=this.container.scrollHeight-this.container.offsetHeight,this.translateTo(this.container.scrollHeight))}localScrollUp(t){const e=this.itemHeight,s=this.container.scrollTop;let n=this.listTranslate,l,h=s-n;if(!(h>e)){for(l=0;l<this.skip&&!(n+e+h<=s);l++)n-=e;if(n=this.validateTranslate(n),this.skip-l<=0&&n>=s){this.translateTo(0),this.changePage(0,t),this.container.scrollTop=0;return}n!==this.listTranslate&&(this.translateTo(n),this.changePage(this.skip-l,t))}}localScrollDown(t){const e=this.itemHeight;let s=this.container.scrollTop,n=this.listTranslate;const l=this.list.children.length;let h;for(h=0;h<l&&!(n+e>=s);h++)n+=e;n=this.validateTranslate(n),h>=l&&this.skip+h>=this.total?(this.translateTo(n),this.changePage(this.total-1,t)):n!==this.listTranslate&&(this.translateTo(n),this.changePage(this.skip+h,t))}scrollNonStrict(t){const e=this.total*this.prevScrollPos/this.containerHeight,s=Math.min(Math.floor(e),this.total-1);let n=this.containerHeight*e/this.total;n=this.validateTranslate(n),this.translateTo(n),this.changePage(s,t)}scrollHandler(t){const e=this.container?this.container.scrollTop:0,s=this.prevScrollPos;this.prevScrollPos=e,!(!this.enabled||!this.list||!this.container||this.scrollSyncing)&&(e-s<=0&&e>this.listTranslate-this.list.scrollHeight/10?this.localScrollUp(t):e-s>0&&e<this.listTranslate+this.list.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t))}validateTranslate(t){return t=Math.max(0,t),t=Math.min(this.containerHeight,t),t}}class Ns{navigate(t){const e=t.keyCode;if(e===d.Keys.up||e===d.Keys.left)return this.next({current:t.current,min:t.min,max:t.max,step:t.skipItems?t.skipItems:-1});if(e===d.Keys.down||e===d.Keys.right)return this.next({current:t.current,min:t.min,max:t.max,step:t.skipItems?t.skipItems:1});if(e===d.Keys.home)return 0;if(e===d.Keys.end)return t.max}next(t){return Y(t.current)?Math.min(t.max,Math.max(t.current+t.step,t.min)):t.min}}const _t=class{constructor(i){this.wrapper=null,this.list=null,this.vs=new Ms,this.navigation=new Ns,this.handleItemClick=(t,e)=>{const s=this.initState();s.syntheticEvent=e,e.stopPropagation(),this.component.handleItemSelect(t,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=t=>{if(!this.component.state.focused){const e=this.initState();e.data.focused=!0,e.events.push({type:"onFocus"}),e.syntheticEvent=t,this.applyState(e)}},this.filterChanged=(t,e)=>{const{textField:s,filterable:n}=this.component.props;n&&e.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:t}})},this.togglePopup=t=>{const e=this.component.props,s=e.opened!==void 0?e.opened:this.component.state.opened;e.opened===void 0&&(t.data.opened=!s),s?t.events.push({type:"onClose"}):(t.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(t,e)=>{const s=this.initState();s.syntheticEvent=e,this.triggerOnPageChange(s,t.skip,t.take),this.applyState(s)},this.scrollToVirtualItem=(t,e)=>{const s=this.vs;if(s.enabled=!1,t.skip===0)s.reset();else if(t.skip+t.pageSize===t.total)s.scrollToEnd();else{let n=s.translate;n===0&&(s.calcScrollElementHeight(),n=s.itemHeight*t.skip,s.translateTo(n-s.itemHeight)),s.container&&(s.container.scrollTop=n),this.scrollToItem(e,!0)}window.setTimeout(()=>s.enabled=!0,10)},this.scrollPopupByPageSize=t=>{var h,u,c,r,p,f;const e=this.vs,s=(u=(h=this.list)==null?void 0:h.parentElement)==null?void 0:u.scrollTop,n=e.enabled&&e.itemHeight?e.itemHeight:this.list?this.list.children[0].offsetHeight:0,l=(r=(c=this.list)==null?void 0:c.parentElement)==null?void 0:r.offsetHeight;s!==void 0&&l!==void 0&&((f=(p=this.list)==null?void 0:p.parentElement)==null||f.scroll({top:s+t*Math.floor(l/n)*n}))},this.renderScrollElement=()=>{const t=this.vs;return t.enabled&&a.createElement("div",{ref:e=>t.scrollElement=e,key:"scrollElementKey"})},this.resetGroupStickyHeader=(t,e)=>{t!==e.state.group&&e.setState({...e.state,group:t})},this.listBoxId=i.props.id+"list",this.guid=i.props.id,this.component=i,this.vs.PageChange=this.pageChange}didMount(){const i=this.component.props,t=i.popupSettings||{},e=i.style||{},s=t.width;let n=i.opened===!0;s===void 0&&this.calculatePopupWidth(),i.dir===void 0&&e.direction===void 0&&(this.calculateDir(),n=!0),n&&this.component.forceUpdate()}calculateDir(){const i=this.component.element;i&&i.ownerDocument&&i.ownerDocument.defaultView&&(this.dirCalculated=i.ownerDocument.defaultView.getComputedStyle(i).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(i,t,e){const s=this.list||this.vs.list;if(!s&&!e&&setTimeout(()=>{this.scrollToItem(i,t,!0)},10),s&&i>=0){const n=this.vs,l=n.container||s.parentNode,h=t!==void 0?t:n.enabled;Xt(l,s,i,n.translate,h)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(i){Object.keys(i.data).length>0&&this.component.setState(i.data);const t={syntheticEvent:i.syntheticEvent,nativeEvent:i.syntheticEvent?i.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};i.events.forEach(e=>{const s=e.type;delete e.type;const n=s&&this.component.props[s];n&&n.call(void 0,{...t,...e})})}triggerOnPageChange(i,t,e){const s=this.component.props.virtual;if(s){const n=Math.min(Math.max(0,t),Math.max(0,s.total-e));n!==s.skip&&i.events.push({type:"onPageChange",page:{skip:n,take:e}})}}triggerPageChangeCornerItems(i,t){const e=this.component.props,{data:s=[],dataItemKey:n,virtual:l}=e,h=e.opened!==void 0?e.opened:this.component.state.opened;i&&l&&this.vs.enabled&&(l.skip>0&&L(i,s[0],n)?this.triggerOnPageChange(t,l.skip-1,l.pageSize):!h&&l.skip+l.pageSize<l.total&&L(i,s[s.length-1],n)&&this.triggerOnPageChange(t,l.skip+1,l.pageSize))}getPopupSettings(){return Object.assign({},_t.defaultProps.popupSettings,this.component.props.popupSettings)}getGroupedDataModernMode(i,t){let e=[];return i.forEach((s,n)=>{i[n-1]&&s[t]!==i[n-1][t]&&e.push({[t]:s[t]}),e.push(i[n])}),e}};let ae=_t;ae.basicPropTypes={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,textField:o.string,className:o.string,label:o.string,loading:o.bool,popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,itemRender:o.func,listNoDataRender:o.func,focusedItemIndex:o.func,header:o.node,footer:o.node},ae.propTypes={..._t.basicPropTypes,value:o.any,defaultValue:o.any,filterable:o.bool,filter:o.string,virtual:o.shape({pageSize:o.number.isRequired,skip:o.number.isRequired,total:o.number.isRequired}),onFilterChange:o.func,onPageChange:o.func},ae.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};const We={name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654528156,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},pt=500,ke=768,Os="Please select a value from the list!",{sizeMap:Vt,roundedMap:_s}=d.kendoThemeMaps,Bt=class extends a.Component{constructor(i){super(i),this.state={},this._element=null,this.base=new ae(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],virtual:n,dataItemKey:l,defaultItem:h}=this.props,u=n?n.skip:0,c=t===-1&&h!==void 0?h:s[t-u],r=!L(c,this.value,l);this.triggerOnChange(c,e),r&&this.base.triggerPageChangeCornerItems(c,e)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.dummySelect=t=>a.createElement("select",{name:this.props.name,ref:e=>{this._select=e},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,t):t})),this.renderListContainer=()=>{const{header:t,footer:e,dir:s,data:n=[],size:l,groupField:h,groupStickyHeaderItemRender:u,list:c}=this.props,r=this.base,p=r.getPopupSettings(),f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=p.width!==void 0?p.width:r.popupWidth,v={dir:s!==void 0?s:r.dirCalculated,width:g,popupSettings:{...p,popupClass:d.classNames(p.popupClass,"k-list-container","k-dropdownlist-popup"),anchor:p.anchor||this.element,show:f,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[n.length]};let{group:m}=this.state;return m===void 0&&h!==void 0&&(m=z(n[0],h)),a.createElement(Xe,{...v},this.renderListFilter(),t&&a.createElement("div",{className:"k-list-header"},t),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${Vt[l]||l}`]:l,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!c&&m&&n.length!==0&&a.createElement(Ae,{group:m,groupMode:"modern",render:u}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))},this.renderList=()=>{const{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0,total:void 0},groupHeaderItemRender:l,listNoDataRender:h,itemRender:u}=this.props,c=this.base.vs,r=n.skip,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.getPopupSettings(),g=`translateY(${c.translate}px)`;return a.createElement(Ve,{id:this._listboxId,show:p,data:t.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:s,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:v=>c.list=this.base.list=v,wrapperStyle:{maxHeight:f.height},wrapperCssClass:"k-list-content",listStyle:c.enabled?{transform:g}:void 0,key:"listkey",skip:r,onClick:this.handleItemClick,itemRender:u,groupHeaderItemRender:l,noDataRender:h,onScroll:this.onScroll,wrapperRef:c.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!(!n||!l.length)&&n){const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;l=this.base.getGroupedDataModernMode(l,n);let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&this.setState({group:r})}},this.renderListFilter=()=>{const t=this.props.filter!==void 0?this.props.filter:this.state.text;return this.props.filterable&&a.createElement(Me,{value:t,ref:e=>this._filterInput=e&&e.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.renderDefaultItem=()=>{const{textField:t,defaultItem:e,dataItemKey:s}=this.props;return e!==void 0&&a.createElement(Ds,{defaultItem:e,textField:t,selected:L(this.value,e,s),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=t=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout(()=>this.searchState.word="",this.props.delay),this.selectNext(t))},this.selectNext=t=>{const{data:e=[],dataItemKey:s}=this.props;let n=e.map((w,D)=>({item:w,itemIndex:D}));const l=this.searchState.word,h=this.searchState.last,u=xs(l,h);let c=n.length,r=Math.max(0,e.findIndex(w=>L(w,this.value,s))),p;this.props.defaultItem&&(p={item:this.props.defaultItem,itemIndex:-1},c+=1,r+=1),r+=u?1:0,n=ys(n,r,p);let f,g,v,m=0;const{textField:b,ignoreCase:C}=this.props;for(;m<c;m++)if(f=z(n[m].item,b),g=u&&Qt(f,h,C),v=Qt(f,l,C),g||v){m=n[m].itemIndex;break}if(m!==c){const w=this.base.initState();w.syntheticEvent=t,this.handleItemSelect(m,w),this.applyState(w),this._valueDuringOnChange=void 0}},this.handleKeyDown=t=>{t&&t.target instanceof Element&&t.target.nodeName==="INPUT"&&t.stopPropagation&&t.stopPropagation();const{data:e=[],filterable:s,disabled:n,defaultItem:l,leftRightKeysNavigation:h=!0,virtual:u={skip:0,total:0,pageSize:0},dataItemKey:c,groupField:r="",textField:p,skipDisabledItems:f=!0}=this.props,g=this.value,v=e.findIndex(F=>L(F,g,c)),m=this.props.opened!==void 0?this.props.opened:this.state.opened,b=t.keyCode,C=b===d.Keys.home||b===d.Keys.end,w=b===d.Keys.up||b===d.Keys.down,D=!m&&(t.altKey&&b===d.Keys.down||b===d.Keys.enter||b===d.Keys.space),_=m&&(t.altKey&&b===d.Keys.up||b===d.Keys.esc),O=h&&(b===d.Keys.left||b===d.Keys.right),B=w||O&&!s||C,E=this.base.initState();if(E.syntheticEvent=t,!n){if(C&&this.base.vs.enabled)b===d.Keys.home?u.skip!==0?(this.base.triggerOnPageChange(E,0,u.pageSize),this._navigated=!0):this.triggerOnChange(e[0],E):u.skip<u.total-u.pageSize?(this.base.triggerOnPageChange(E,u.total-u.pageSize,u.pageSize),this._navigated=!0):this.triggerOnChange(e[e.length-1],E);else if(m&&b===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(m&&b===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(m&&b===d.Keys.enter){const F=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(e,F)?(this.triggerOnChange(null,E),this.applyState(E)):this.handleItemSelect(F,E),this.base.togglePopup(E),t.preventDefault()}else if(D||_)_&&this.resetValueIfDisabledItem(),this.base.togglePopup(E),t.preventDefault();else if(B){if(this._lastKeypressIsFilter=!1,r!==""&&p)if(!f&&m)this.onNavigate(E,b);else{let F;if(b===d.Keys.down||b===d.Keys.right){const S=e.slice(v+1).find(k=>!k.disabled&&k[p]);F=S&&e.findIndex(k=>k[p]===S[p])}else if(b===d.Keys.up||b===d.Keys.left){let S;if(v===0&&l)F=-1;else if(v===-1)S=e,F=e.findIndex(k=>!k.disabled&&k[p]);else{S=e.slice(0,v);let k=S.pop();for(;k&&k.disabled;)k=S.pop();F=k&&e.findIndex(N=>N[p]===k[p])}}if(F!==void 0){const S=F-v;this.onNavigate(E,b,S)}else F===void 0&&e.findIndex(S=>S[p]===g[p])===e.length-1&&this.onNavigate(E,b)}else if(!f&&m||C)this.onNavigate(E,b);else if(p){let F;if(b===d.Keys.down||b===d.Keys.right){const S=e.slice(v+1).find(k=>!k.disabled&&k[p]);F=S&&e.findIndex(k=>k[p]===S[p])}else if(b===d.Keys.up||b===d.Keys.left){let S;if(v===0&&l)F=-1;else if(v===-1)S=e,F=e.find(k=>!k.disabled&&k[p]);else{S=e.slice(0,v);let k=S.pop();for(;k&&k.disabled;)k=S.pop();F=k&&e.findIndex(N=>N[p]===k[p])}}if(F!==void 0){const S=F-v;this.onNavigate(E,b,S)}else F===void 0&&e.findIndex(S=>S[p]===g[p])===e.length-1&&this.onNavigate(E,b)}else this.onNavigate(E,b);t.preventDefault()}this.applyState(E)}},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.handleFocus=t=>{this._skipFocusEvent||this.base.handleFocus(t)},this.handleBlur=t=>{if(this._skipFocusEvent||!this.state.focused)return;const e=this.props.opened!==void 0?this.props.opened:this.state.opened,{adaptive:s}=this.props,{windowWidth:n=0}=this.state,l=n<=ke&&s,h=this.base.initState();h.syntheticEvent=t,h.data.focused=!1,h.events.push({type:"onBlur"}),e&&this.resetValueIfDisabledItem(),e&&!l&&this.base.togglePopup(h),this.applyState(h)},this.handleDefaultItemClick=t=>{const e=this.base.initState();e.syntheticEvent=t,this.base.togglePopup(e),this.triggerOnChange(this.props.defaultItem,e),this.applyState(e)},this.handleWrapperClick=t=>{if(t.isPropagationStopped())return;const e=this.base.initState();e.syntheticEvent=t,this.state.focused||(e.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(e),this.applyState(e)},this.handleKeyPress=t=>{if(this.props.filterable||t.which===0||t.keyCode===d.Keys.enter)return;let e=String.fromCharCode(t.charCode||t.keyCode);this.props.ignoreCase&&(e=e.toLowerCase()),e===" "&&t.preventDefault(),this.searchState={word:this.searchState.word+e,last:this.searchState.last+e},this.search(t)},this.handleListFilterChange=t=>{const e=this.base.initState();e.syntheticEvent=t.syntheticEvent,this.props.filter===void 0&&(e.data.text=t.target.value),this.base.filterChanged(t.target.value,e),this._lastKeypressIsFilter=!0,this.applyState(e),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout(()=>{this._filterInput&&this.focusElement(this._filterInput)},300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)})},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||Os)},d.validatePackage(We)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let i;return this._valueDuringOnChange!==void 0?i=this._valueDuringOnChange:this.props.value!==void 0?i=this.props.value:this.state.value!==void 0?i=this.state.value:this.props.defaultValue!==void 0&&(i=this.props.defaultValue),!Y(i)&&this.props.defaultItem!==void 0&&(i=this.props.defaultItem),i}get index(){const{data:i=[],dataItemKey:t}=this.props,e=this.value;return i.findIndex(s=>L(s,e,t))}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Bt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Bt.defaultProps.required}componentDidUpdate(i,t){var f;const{dataItemKey:e,virtual:s,groupField:n="",textField:l}=this.props,{data:h=[]}=this.props,u=i.virtual?i.virtual.total:0,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=i.opened!==void 0?i.opened:t.opened,p=!r&&c;if(this.base.getPopupSettings().animate||p&&this.onPopupOpened(),s&&s.total!==u)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const g=this.value,v=i.value!==void 0?i.value:t.value;let m=h.findIndex(C=>L(C,g,e));n!==""&&g&&l&&(m=(f=this.base.getGroupedDataModernMode(h,n))==null?void 0:f.map(C=>C[l]).indexOf(g[l]));const b=!L(v,g,e);p&&s?this.base.scrollToVirtualItem(s,m):p&&!s?(this.onPopupOpened(),h&&h.length!==0&&this.base.resetGroupStickyHeader(h[0][n],this),this.base.scrollToItem(m)):c&&r&&g&&b&&!this._navigated?this.base.scrollToItem(m):c&&r&&this._navigated&&(this._navigated&&s&&s.skip===0?this.base.vs.reset():this._navigated&&s&&s.skip===s.total-s.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=xe.provideLocalizationService(this).toLanguageString(Ot,ne[Ot]),{style:t,className:e,label:s,dir:n,virtual:l,size:h,rounded:u,fillMode:c,adaptive:r}=this.props,{windowWidth:p=0}=this.state,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=this.value,v=z(g,this.props.textField),m=!this.validityStyles||this.validity.valid,b=this.base,C=b.vs,w=p<=ke&&r;C.enabled=l!==void 0,l!==void 0&&(b.vs.skip=l.skip,b.vs.total=l.total,b.vs.pageSize=l.pageSize);const{dataItemKey:D,data:_=[],disabled:O,tabIndex:B,loading:E,iconClassName:F,svgIcon:S,valueRender:k}=this.props,{focused:N}=this.state,$=_.findIndex(H=>L(H,g,D)),J=a.createElement("span",{id:this._inputId,className:"k-input-inner"},a.createElement("span",{className:"k-input-value-text"},v)),Q=k!==void 0?k.call(void 0,J,g):J,R=a.createElement(a.Fragment,null,a.createElement("span",{ref:this.componentRef,className:d.classNames("k-dropdownlist k-picker",e,{[`k-picker-${Vt[h]||h}`]:h,[`k-rounded-${_s[u]||u}`]:u,[`k-picker-${c}`]:c,"k-focus":N,"k-disabled":O,"k-invalid":!m,"k-loading":E,"k-required":this.required}),style:s?{...t,width:void 0}:t,dir:n,onMouseDown:f?H=>{H.target.nodeName!=="INPUT"&&(this.focusElement(this.base.wrapper),H.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:d.getTabIndex(B,O),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:O?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":O||void 0,"aria-haspopup":"listbox","aria-expanded":f||!1,"aria-owns":this._listboxId,"aria-activedescendant":f?"option-"+this._guid+"-"+($+(l?l.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,id:this.props.id,title:this.props.title},Q,E&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":i,"aria-hidden":!0,size:h,fillMode:c,iconClass:F,className:"k-input-button",rounded:null,themeColor:"base",icon:F?void 0:"caret-alt-down",svgIcon:S||Ie.caretAltDownIcon,onMouseDown:H=>this.state.focused&&H.preventDefault()}),this.dummySelect(g),!w&&this.renderListContainer()),w&&this.renderAdaptiveListContainer());return s?a.createElement(He.FloatingLabel,{label:s,editorValue:v,editorValid:m,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:R}):R}onNavigate(i,t,e){const{data:s=[],defaultItem:n,dataItemKey:l,virtual:h={skip:0,total:0,pageSize:0}}=this.props,u=this.base.vs,c=this.value,r=s.findIndex(f=>L(f,c,l)),p=this.base.navigation.navigate({current:h.skip+r,max:(u.enabled?h.total:s.length)-1,min:n!==void 0?-1:0,keyCode:t,skipItems:e||void 0});p!==void 0&&this.handleItemSelect(p,i),this.applyState(i)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:t,footer:e,size:s,adaptiveTitle:n,groupField:l,groupStickyHeaderItemRender:h,list:u,data:c=[]}=this.props,r=this.props.opened!==void 0?this.props.opened:this.state.opened,p={navigatable:!1,navigatableElements:[],expand:r,animation:!0,onClose:g=>this.handleWrapperClick(g),animationStyles:i<=pt?{top:0,width:"100%",height:"100%"}:void 0,className:i<=pt?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};let{group:f}=this.state;return f===void 0&&l!==void 0&&(f=z(c[0],l)),a.createElement(fe.ActionSheet,{...p},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,n)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:Ie.xIcon}))),a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderListFilter())),a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},t&&a.createElement("div",{className:"k-list-header"},t),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${Vt[s]||s}`]:s,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!u&&f&&c.length!==0&&a.createElement(Ae,{group:f,groupMode:"modern",render:h}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e)))}getFocusedIndex(){const i=this.value,{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0},focusedItemIndex:l=_e,filterable:h,skipDisabledItems:u=!0}=this.props,c=this.props.filter?this.props.filter:this.state.text;return u&&e&&!c&&!i?t.findIndex(r=>!r.disabled&&r[e]):Y(i)&&c===void 0||h&&c===""?t.findIndex(r=>L(r,i,s)):c?this._lastKeypressIsFilter?l(t,c,e):t.findIndex(r=>L(r,i,s)):n.skip===0?0:-1}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,30)}triggerOnChange(i,t){L(this.value,i,this.props.dataItemKey)||(this.props.value===void 0&&(t.data.value=i),this._valueDuringOnChange=i,t.events.push({type:"onChange"}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}resetValueIfDisabledItem(){const{data:i=[]}=this.props,t=this.base.initState(),e=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(i,e)&&(this.triggerOnChange(null,t),this.applyState(t))}haveFocusedItemAndDataNotEmpty(i,t){return t!==void 0&&t!==-1&&i&&i.length>0&&i[t].disabled}};let qe=Bt;qe.displayName="DropDownList",qe.propTypes={delay:o.number,ignoreCase:o.bool,iconClassName:o.string,svgIcon:d.svgIconPropType,defaultItem:o.any,valueRender:o.func,valueMap:o.func,validationMessage:o.string,required:o.bool,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,ariaLabel:o.string,leftRightKeysNavigation:o.bool,title:o.string,groupField:o.string,list:o.any,skipDisabledItems:o.bool,...ae.propTypes},qe.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...ae.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};const Rt=d.createPropsContext(),es=d.withIdHOC(d.withPropsContext(Rt,qe));es.displayName="KendoReactDropDownList";class ft extends a.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:n,suggestedText:l,focused:h}=this.props,u=this.input,c=e!==n||l!==s,r=c&&e.startsWith(n)&&!(s&&l&&s.endsWith(l)),p=d.getActiveElement(document);h&&u&&p!==u&&u.focus(),l&&c&&!r&&u&&u.setSelectionRange(n.length-l.length,n.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:n}=this.props,l=a.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:h=>this._input=h,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":e||void 0,disabled:e||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":t,"aria-owns":this.props.owns,"aria-activedescendant":t?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-required":this.props.ariaRequired});return n?n.call(void 0,l):l}}class et extends a.Component{constructor(){super(...arguments),this.onMouseDown=t=>t.preventDefault()}render(){const t=xe.provideLocalizationService(this).toLanguageString(Ze,ne[Ze]);return a.createElement("span",{className:"k-clear-value",role:"button",onClick:this.props.onClick,onMouseDown:this.onMouseDown,tabIndex:-1,title:t,key:"clearbutton"},a.createElement(d.IconWrap,{name:"x",icon:Ie.xIcon}))}}xe.registerForLocalization(et);const Ne=d.useCustomComponent,Vs="Please enter a valid value!",{sizeMap:gt,roundedMap:Bs}=d.kendoThemeMaps,vt=class extends a.Component{constructor(i){super(i),this.state={},this.base=new ae(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],virtual:n,dataItemKey:l}=this.props,h=n?n.skip:0,u=s[t-h],c=!L(u,this.value,l);this.triggerOnChange(u,e),this.state.text!==void 0&&(e.data.text=void 0),c&&this.base.triggerPageChangeCornerItems(u,e)},this.onPopupOpened=()=>{setTimeout(()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)},300)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.toggleBtnClick=t=>{const{data:e=[],skipDisabledItems:s,textField:n}=this.props,l=this.getFocusedIndex(),h=this.getCurrentValueDisabledStatus(n,e,l),u=this.props.opened!==void 0?this.props.opened:this.state.opened,c=this.base.initState();if(c.syntheticEvent=t,!s&&n&&h&&this.clearValueOnToggleBtnClick(t),this.base.togglePopup(c),!u&&this.mobileMode){const r=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(r,c)}this.applyState(c)},this.renderMobileListFilter=()=>{const t=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text,e=z(this.value,this.props.textField),s=Y(t)?t:e;return a.createElement(Me,{value:s,ref:n=>this._adaptiveFilterInput=n&&n.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=t=>{const e=this.base.initState();e.syntheticEvent=t.syntheticEvent,e.data.text=t.target.value,this.base.filterChanged(t.target.value,e),this.applyState(e)},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!n||!l.length)return;const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;this.props.groupMode==="modern"&&(l=this.base.getGroupedDataModernMode(l,n));let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&(this.setState({group:r}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:r}))},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.handleBlur=t=>{if(this.state.focused&&!this._skipBlur){const e=this.base.initState(),{textField:s,data:n=[]}=this.props,l=this.getFocusedIndex(),u=!(l===-1)&&this.getCurrentValueDisabledStatus(s,n,l);e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,s&&u&&this.clearValueOnBlur(t),this.applyValueOnRejectSuggestions(t.currentTarget.value,e)}},this.onInputClick=t=>{const e=this.props.opened!==void 0?this.props.opened:this.state.opened,s=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;if(!e&&this.mobileMode){const n=this.base.initState();n.syntheticEvent=t,this.base.togglePopup(n),this.base.filterChanged(s,n),this.applyState(n)}},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,textField:n,dataItemKey:l,groupField:h}=this.props,u=this.value,c=Math.max(0,e.findIndex(C=>L(C,u,l))),r=t.keyCode,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.initState();if(f.syntheticEvent=t,!t.altKey&&(r===d.Keys.up||r===d.Keys.down)){if(t.preventDefault(),h!==""&&n)if(!this.props.skipDisabledItems&&p)this.onNavigate(f,r);else{let C=0;if(r===d.Keys.down||r===d.Keys.right){const w=e.slice(c+1<e.length?c+1:c).find(D=>!D.disabled&&D[n]);C=w&&e.findIndex(D=>D[n]===w[n])}else if(r===d.Keys.up||r===d.Keys.left){let w;if(c===0)w=e,C=e.findIndex(D=>!D.disabled&&D[n]);else{w=e.slice(0,c);let D=w.pop();for(;D&&D.disabled;)D=w.pop();C=D&&e.findIndex(_=>_[n]===D[n])}}if(C!==void 0){const w=C-c;this.onNavigate(f,r,w)}else C===void 0&&e.findIndex(w=>w[n]===u[n])===e.length-1&&this.onNavigate(f,r)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(f,r);else{let C=null;if(r===d.Keys.down||r===d.Keys.right)C=e.slice(c+1).find(w=>!w.disabled);else if(r===d.Keys.up||r===d.Keys.left){const w=e.slice(0,c);for(C=w.pop();C&&C.disabled;)C=w.pop()}if(C){const w=C.id-c-1;this.onNavigate(f,r,w)}else this.onNavigate(f,r)}this.applyState(f)}const g=()=>{t.preventDefault(),this.base.togglePopup(f),this.applyState(f)},v=this.getFocusedIndex(),m=v===-1,b=!m&&this.getCurrentValueDisabledStatus(n,e,v);p?r===d.Keys.pageUp?this.base.scrollPopupByPageSize(-1):r===d.Keys.pageDown?this.base.scrollPopupByPageSize(1):t.altKey&&r===d.Keys.up?g():r===d.Keys.enter?(t.preventDefault(),(n&&!m&&t.currentTarget.value?e[v][n]:void 0)?!s&&n&&b?this.clearValueOnEnterOrEsc(t):b||this.applyValueOnEnter(t.currentTarget.value,f):this.applyValueOnEnter(t.currentTarget.value,f)):r===d.Keys.esc&&(!s&&n&&b&&this.clearValueOnEnterOrEsc(t),this.applyValueOnRejectSuggestions(t.currentTarget.value,f)):!p&&r===d.Keys.esc?this.clearValueOnEnterOrEsc(t):t.altKey&&r===d.Keys.down&&g()},this.inputOnChange=t=>{const e=this.base.initState();e.syntheticEvent=t;const s=this.props.opened!==void 0?this.props.opened:this.state.opened,n=t.currentTarget,l=n.value;if(this.props.suggest){const h=n.selectionEnd===l.length;let u=this.props.filter!==void 0?this.props.filter:this.state.text;Y(u)||(u=z(this.value,this.props.textField)||"");const c=u&&u===l,r=u&&u.length>l.length;c||r||!h?this._suggested="":this.suggestValue(l)}this.props.filter===void 0&&(e.data.text=l),this.state.focusedItem!==void 0&&(e.data.focusedItem=void 0),s||this.base.togglePopup(e),this.base.filterChanged(l,e),this.applyState(e),this.setState({group:void 0})},this.clearButtonClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnBlur=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||Vs)},d.validatePackage(We)}get _inputId(){return this.props.id}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ke&&this.props.adaptive)}get value(){if(this._valueDuringOnChange!==void 0)return this._valueDuringOnChange;if(this.props.value!==void 0)return this.props.value;if(this.state.value!==void 0)return this.state.value;if(this.props.defaultValue!==void 0)return this.props.defaultValue}get index(){const{data:i=[],dataItemKey:t}=this.props,e=this.value;return i.findIndex(s=>L(s,e,t))}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:vt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:vt.defaultProps.required}componentDidUpdate(i,t){var g;const{dataItemKey:e,virtual:s,groupField:n="",data:l=[],textField:h}=this.props,u=i.virtual?i.virtual.total:0,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=i.opened!==void 0?i.opened:t.opened,p=!r&&c,f=this.value;if(this._valueOnDidUpdate=f,s&&s.total!==u)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const v=i.value!==void 0?i.value:t.value;let m=l.findIndex(C=>L(C,f,e));this.props.groupMode==="modern"&&h&&f&&(m=(g=this.base.getGroupedDataModernMode(l,n))==null?void 0:g.map(C=>C[h]).indexOf(f[h]));const b=!L(v,f,e);p&&s?this.base.scrollToVirtualItem(s,m):p&&!s?(this.onPopupOpened(),l&&l.length!==0&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(m)):c&&r&&f&&b&&this.base.scrollToItem(m)}p&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=xe.provideLocalizationService(this).toLanguageString(Mt,ne[Mt]),t=xe.provideLocalizationService(this).toLanguageString(Nt,ne[Nt]),{dir:e,disabled:s,clearButton:n=vt.defaultProps.clearButton,label:l,textField:h,adaptive:u,className:c,style:r,loading:p,iconClassName:f,virtual:g,size:v,rounded:m,fillMode:b,opened:C=this.state.opened,placeholder:w,svgIcon:D}=this.props,{windowWidth:_=0}=this.state,O=!this.validityStyles||this.validity.valid,B=this.props.filter!==void 0?this.props.filter:this.state.text,E=z(this.value,h),F=Y(B)?B:E,S=n&&(!!F||Y(this.value)),N=this.base.vs,$=this.props.id||this._inputId,J=_<=ke&&u;N.enabled=g!==void 0,g!==void 0&&(N.skip=g.skip,N.total=g.total,N.pageSize=g.pageSize);const[Q,R]=Ne(this.props.prefix||a.Fragment),[H,ye]=Ne(this.props.suffix||a.Fragment),P=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-combobox k-input",{[`k-input-${gt[v]||v}`]:v,[`k-rounded-${Bs[m]||m}`]:m,[`k-input-${b}`]:b,"k-invalid":!O,"k-loading":p,"k-required":this.required,"k-disabled":s},c),ref:this.componentRef,style:l?{...r,width:void 0}:r,dir:e},this.props.prefix&&a.createElement(Q,{...R}),this.renderSearchBar(F||"",$,w),S&&!p&&a.createElement(et,{onClick:this.clearButtonClick,key:"clearbutton"}),p&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading",key:"loading"}),this.props.suffix&&a.createElement(H,{...ye}),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":C?t:i,icon:f?void 0:"caret-alt-down",svgIcon:D||Ie.caretAltDownIcon,iconClass:f,size:v,fillMode:b,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:Z=>Z.preventDefault()}),!J&&this.renderListContainer()),J&&this.renderAdaptiveListContainer());return l?a.createElement(He.FloatingLabel,{label:l,editorId:$,editorValue:F,editorValid:O,editorDisabled:s,style:{width:r?r.width:void 0},children:P}):P}onNavigate(i,t,e){const{data:s=[],virtual:n={skip:0}}=this.props,l=this.props.filter?this.props.filter:this.state.text,h=this.getFocusedIndex(),u=this.base.vs,c=this.value;if(this._suggested="",h!==-1&&!Y(c))this.handleItemSelect(h,i);else if(l==="")this.handleItemSelect(0,i);else{const r=n.skip+h,p=this.base.navigation.navigate({keyCode:t,current:r,max:(u.enabled?u.total:s.length)-1,min:0,skipItems:e||void 0});p!==void 0&&this.handleItemSelect(p,i)}}getCurrentValueDisabledStatus(i,t,e){return i&&t&&t[e]&&t[e].disabled}applyValueOnEnter(i,t){const{data:e=[],textField:s,allowCustom:n}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,u=z(this.value,s)===i?this.index:Kt(e,i,s),c=u!==-1;let r;if(this._suggested="",c)r=e[u];else if(n)r=s!==void 0?{[s]:i}:i;else return this.selectFocusedItem(i,t);this.triggerOnChange(r,t),l&&this.base.togglePopup(t),this.props.filter===void 0&&this.state.text!==void 0&&(t.data.text=void 0),this.applyState(t)}applyValueOnRejectSuggestions(i,t){const{data:e=[],textField:s,allowCustom:n}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,h=z(this.value,s),u=this.state.windowWidth&&this.state.windowWidth<=ke;if(this._suggested="",i===h||i===""&&!Y(h))return l&&!u&&this.base.togglePopup(t),this.applyState(t);const c=Kt(e,i,s,!0),r=c!==-1;let p=null;r?p=e[c]:n&&(p=i?s?{[s]:i}:i:null),this.triggerOnChange(p,t),this.state.text!==void 0&&(t.data.text=void 0,this.base.filterChanged("",t)),l&&!u&&this.base.togglePopup(t),this.applyState(t)}selectFocusedItem(i,t){const e=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:s=[],textField:n,virtual:l={skip:0},focusedItemIndex:h=_e}=this.props,u=l.skip,c=i===""&&u===0?0:h(s,i,n);return c!==-1?this.handleItemSelect(c+u,t):(this.triggerOnChange(null,t),this.state.text!==void 0&&(t.data.text=void 0)),e&&this.base.togglePopup(t),this.applyState(t)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:t,footer:e,size:s,data:n=[],groupField:l,groupMode:h,list:u,virtual:c,adaptiveTitle:r,groupStickyHeaderItemRender:p}=this.props,f=this.props.opened!==void 0?this.props.opened:this.state.opened;let{group:g}=this.state;g===void 0&&l!==void 0&&(g=z(n[0],l));const v={navigatable:!1,navigatableElements:[],expand:f,animation:!0,onClose:m=>this.toggleBtnClick(m),animationStyles:i<=pt?{top:0,width:"100%",height:"100%"}:void 0,className:i<=pt?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return a.createElement(fe.ActionSheet,{...v},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,r)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.toggleBtnClick,icon:"x",svgIcon:Ie.xIcon}))),a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderMobileListFilter())),a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:d.classNames({"k-list":!u,"k-list-lg":!0,"k-virtual-list":c,"k-data-table":u,[`k-table-${gt[s]||s}`]:u&&s})},t&&a.createElement("div",{className:"k-table-header"},t),!u&&g&&n.length!==0&&a.createElement(Ae,{group:g,groupMode:h,render:p}),this.renderList(),e&&a.createElement("div",{className:"k-list-footer"},e)))))}renderListContainer(){const i=this.base,{dir:t,header:e,footer:s,data:n=[],groupField:l,groupMode:h,size:u,list:c,virtual:r,groupStickyHeaderItemRender:p}=this.props,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=i.getPopupSettings(),v=g.width!==void 0?g.width:i.popupWidth;let{group:m}=this.state;return m===void 0&&l!==void 0&&(m=z(n[0],l)),a.createElement(Xe,{width:v,popupSettings:{...g,anchor:g.anchor||this.element,show:f,popupClass:d.classNames(g.popupClass,"k-list-container","k-combobox-popup")},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},a.createElement("div",{className:d.classNames({"k-list":!c,[`k-list-${gt[u]||u}`]:!c&&u,"k-virtual-list":r,"k-data-table":c,[`k-table-${gt[u]||u}`]:c&&u})},e&&a.createElement("div",{className:"k-table-header"},e),!c&&m&&n.length!==0&&a.createElement(Ae,{group:m,groupMode:h,render:p}),this.renderList(),s&&a.createElement("div",{className:d.classNames({"k-list-footer":!this.props.footerClassName},this.props.footerClassName)},s)))}renderList(){const i=this.base,{textField:t,dataItemKey:e,listNoDataRender:s,itemRender:n,groupHeaderItemRender:l,data:h=[],virtual:u={skip:0,total:void 0}}=this.props,c=i.getPopupSettings(),r=i.vs,p=u.skip,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=`translateY(${r.translate}px)`,v=f?this.getFocusedIndex():void 0,m=this.props.filter!==void 0?this.props.filter:this.state.text,b=z(this.value,t),C=Y(m)&&m!==b?null:this.value,w=this.props.list||Ve;return a.createElement(w,{id:i.listBoxId,virtual:!!u,show:f,data:h,focusedIndex:v,value:C,textField:t,valueField:e,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:i.guid,listRef:D=>{r.list=this.base.list=D,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>ke?{maxHeight:c.height}:{},wrapperCssClass:d.classNames("k-list-content",{"k-list-scroller":!u}),listStyle:r.enabled?{transform:g}:void 0,key:"listkey",skip:p,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:l,noDataRender:s,onMouseDown:D=>D.preventDefault(),onScroll:this.onScroll,wrapperRef:r.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:u.total})}renderSearchBar(i,t,e){const{tabIndex:s,disabled:n,data:l=[],dataItemKey:h,virtual:u={skip:0}}=this.props,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.value,p=Math.max(0,l.findIndex(f=>L(f,r,h)));return this._suggested&&!L(this._valueOnDidUpdate,r,h)&&(this._suggested=""),a.createElement(ft,{id:t,readOnly:c&&this.mobileMode,placeholder:e,tabIndex:s,title:this.props.title,accessKey:this.props.accessKey,value:i+this._suggested,suggestedText:this._suggested,ref:f=>this._input=f&&f.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:n,expanded:c,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${p+u.skip}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}clearValue(){const i=this.base.initState();this._suggested="",this.base.filterChanged("",i),this.props.filter===void 0&&this.state.text!==void 0&&(i.data.text=void 0),this.triggerOnChange(null,i);const t=this.props.opened!==void 0?this.props.opened:this.state.opened,e=this.mobileMode;t&&!e&&this.base.togglePopup(i),this.applyState(i)}triggerOnChange(i,t){const e=this.value;!Y(e)&&!Y(i)||L(e,i,this.props.dataItemKey)||(this.props.value===void 0&&(t.data.value=i),this._valueDuringOnChange=i,t.events.push({type:"onChange"}))}getFocusedIndex(){const i=this.value,{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0},focusedItemIndex:l=_e,skipDisabledItems:h}=this.props,u=this.props.filter?this.props.filter:this.state.text;return Y(i)&&u===void 0?t.findIndex(c=>L(c,i,s)):u?l(t,u,e):h&&e&&!u&&n.skip===0?t.findIndex(c=>!c.disabled&&c[e]):n.skip===0?0:-1}suggestValue(i){const{data:t,textField:e}=this.props;this._suggested=Es(i,t,e)}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};let $e=vt;$e.displayName="ComboBox",$e.propTypes={...ae.propTypes,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),dataItemKey:o.string,groupField:o.string,groupMode:o.oneOf([void 0,"classic","modern"]),isMultiColumn:o.bool,suggest:o.bool,placeholder:o.string,title:o.string,allowCustom:o.bool,clearButton:o.bool,iconClassName:o.string,svgIcon:d.svgIconPropType,validationMessage:o.string,required:o.bool,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,list:o.any,valueRender:o.func,skipDisabledItems:o.bool},$e.defaultProps={...ae.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};const ts=d.createPropsContext(),Lt=d.withIdHOC(d.withPropsContext(ts,$e));Lt.displayName="KendoReactComboBox";const Ls="Please enter a valid value!",{sizeMap:ss,roundedMap:zs}=d.kendoThemeMaps,zt=class extends a.Component{constructor(i){super(i),this.state={},this.base=new ae(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[]}=this.props,n=z(s[t],this.props.textField);this.triggerOnChange(n,e)},this.itemFocus=(t,e)=>{const{data:s=[],textField:n}=this.props,l=s[t];L(this.state.focusedItem,l,n)||(e.data.focusedItem=l)},this.togglePopup=t=>{this.base.togglePopup(t)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||Ls)},this.onScroll=t=>{this._isScrolling=!0;const{list:e}=this.base,{groupField:s}=this.props;let{data:n=[]}=this.props;if(!s||!n.length)return;const l=this.itemHeight||(e?e.children[0].offsetHeight:0),u=t.target.scrollTop;s&&(n=this.base.getGroupedDataModernMode(n,s));let c=n[0][s];for(let r=1;r<n.length&&!(l*r>u);r++)n[r]&&n[r][s]&&(c=n[r][s]);c!==this.state.group&&this.setState({group:c})},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.onChangeHandler=t=>{const s=this.base.initState(),n=t.currentTarget,l=n.value,h=n.selectionEnd===l.length;s.syntheticEvent=t;const u=this._suggested,c=this.value,r=c&&c.substring(0,c.length-u.length),p=r&&r===l,f=r&&r.length>l.length,{suggest:g}=this.props,v=this.props.opened!==void 0?this.props.opened:this.state.opened;if(g!==void 0&&g!==!1){p||f||!h?this._suggested="":this.suggestValue(l);const m=l+this._suggested,b={userInput:l,value:this._suggested};this.triggerOnChange(m,s,{suggestion:b})}else this._suggested="",this.triggerOnChange(l,s);(!v&&l||v&&!l)&&this.togglePopup(s),s.data.focusedItem=void 0,this.applyState(s),this.setState({group:void 0})},this.clearButtonClick=t=>{const s=this.base.initState(),n=this.props.opened!==void 0?this.props.opened:this.state.opened;s.syntheticEvent=t;const l="";this._suggested="",this.triggerOnChange(l,s),this.state.focusedItem!==void 0&&(s.data.focusedItem=void 0),n&&this.togglePopup(s),this.applyState(s)},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,groupField:n,textField:l}=this.props;this._isScrolling&&(this._isScrolling=!1);const h=this.focusedIndex(),u=e[h],c=t.keyCode,r=t.altKey,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.initState();f.syntheticEvent=t;const g=()=>{p&&t.preventDefault()};if(r&&c===d.Keys.down)this.setState({opened:!0});else if(r&&c===d.Keys.up)this.setState({opened:!1});else if(p&&c===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(p&&c===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(p&&(c===d.Keys.enter||c===d.Keys.esc))g(),s===!1&&u&&u.disabled?(p&&this.togglePopup(f),this.applyState(f)):this.applyInputValue(t.currentTarget.value,f,t.keyCode);else if(!p&&c===d.Keys.esc){const v="";this._suggested="",this.triggerOnChange(v,f),this.state.focusedItem!==void 0&&(f.data.focusedItem=void 0),this.applyState(f)}else if(c===d.Keys.up||c===d.Keys.down){if(n!==""&&l)if(!this.props.skipDisabledItems&&p)this.onNavigate(f,c);else{let v=0;if(c===d.Keys.down||c===d.Keys.right){const m=e.slice(h+1).find(b=>!b.disabled&&b[l]);v=m&&e.findIndex(b=>b[l]===m[l])}else if(c===d.Keys.up||c===d.Keys.left){let m;if(h===-1)m=e,v=e.findIndex(b=>!b.disabled&&b[l]);else{m=e.slice(0,h);let b=m.pop();for(;b&&b.disabled;)b=m.pop();v=b&&e.findIndex(C=>C[l]===b[l])}}if(v!==void 0){const m=v-h;this.onNavigate(f,c,m)}else v===void 0&&e.findIndex(m=>m[l])===e.length-1&&this.onNavigate(f,c)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(f,c);else{let v=null;if(c===d.Keys.down||c===d.Keys.right)v=e.slice(h+1).find(m=>!m.disabled);else if(c===d.Keys.up||c===d.Keys.left){const m=e.slice(0,h);for(v=m.pop();v&&v.disabled;)v=m.pop()}if(v){const m=v.id-h-1;this.onNavigate(f,c,m)}else this.onNavigate(f,c)}this.applyState(f),g()}},this.handleBlur=t=>{if(this.state.focused){const e=this.base.initState();e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,this.applyInputValue(t.currentTarget.value,e)}},d.validatePackage(We)}get _inputId(){return this.props.id+"-accessibility-id"}get element(){return this._element}get value(){return this._valueDuringOnChange!==void 0?this._valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!=="",e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:zt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:zt.defaultProps.required}componentDidUpdate(i,t){var g;const{groupField:e="",data:s=[]}=this.props,{data:n=[]}=i,l=this.focusedIndex(),h=s[l],u=n!==s,c=h!==void 0&&t.focusedItem!==h,r=this.props.opened!==void 0?this.props.opened:this.state.opened,p=i.opened!==void 0?i.opened:t.opened,f=!p&&r;if(e==="")(r&&(c||u)||f)&&this.base.scrollToItem(l);else if(!this._isScrolling){let v=(g=this.base.getGroupedDataModernMode(s,e))==null?void 0:g.indexOf(h);f&&(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][e],this),this.base.scrollToItem(v)),r&&p&&c&&this.base.scrollToItem(v)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:i,disabled:t,label:e,className:s,style:n,loading:l,suggest:h,size:u,rounded:c,fillMode:r}=this.props,p=!this.validityStyles||this.validity.valid,f=this.base,g=this.value,v=this.props.clearButton!==!1&&!l&&!!g,m=this.props.id||this._inputId;typeof h=="string"&&(this._suggested=h);const[b,C]=Ne(this.props.prefix||a.Fragment),[w,D]=Ne(this.props.suffix||a.Fragment),_=a.createElement("span",{className:d.classNames("k-autocomplete k-input",s,{[`k-input-${ss[u]||u}`]:u,[`k-rounded-${zs[c]||c}`]:c,[`k-input-${r}`]:r,"k-invalid":!p,"k-loading":l,"k-required":this.required,"k-disabled":t}),ref:O=>{this._element=O,f.wrapper=O},style:e?{...n,width:void 0}:n,dir:i},this.props.prefix&&a.createElement(b,{...C}),this.renderSearchBar(g||"",m),l&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&a.createElement(et,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&a.createElement(w,{...D}),this.renderListContainer());return e?a.createElement(He.FloatingLabel,{label:e,editorId:m,editorValue:g,editorValid:p,editorDisabled:t,style:{width:n?n.width:void 0},children:_}):_}onNavigate(i,t,e){const s=this.value,{data:n=[],textField:l,focusedItemIndex:h}=this.props,u=this.state.focusedItem!==void 0?n.findIndex(r=>L(r,this.state.focusedItem,l)):h?h(n,s,l):n.indexOf(Zt(n,s,l)),c=this.base.navigation.navigate({keyCode:t,current:u,max:n.length-1,min:0,skipItems:e||void 0});c!==void 0&&this.itemFocus(c,i),this.applyState(i)}applyInputValue(i,t,e){const s=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:n=[],textField:l}=this.props,h=this.focusedIndex(),u=n[h];if(this._suggested="",s&&e===d.Keys.enter&&u&&!u.disabled){const c=z(n[this.focusedIndex(i)],l);this.triggerOnChange(c,t)}s&&this.togglePopup(t),this.applyState(t)}renderSearchBar(i,t){const e=this.base,{placeholder:s,tabIndex:n,disabled:l,readonly:h}=this.props,{focused:u}=this.state,c=this.props.opened!==void 0?this.props.opened:this.state.opened;return a.createElement(ft,{id:t,placeholder:s,tabIndex:n,accessKey:this.props.accessKey,value:i,suggestedText:this._suggested,focused:u,name:this.props.name,ref:r=>this._input=r&&r.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:e.handleFocus,onBlur:this.handleBlur,disabled:l,readOnly:h,expanded:c,owns:e.listBoxId,activedescendant:"option-"+e.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const i=this.base,{dir:t,header:e,footer:s,data:n=[],size:l,groupField:h,list:u,groupStickyHeaderItemRender:c}=this.props,r=i.getPopupSettings(),p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=r.width!==void 0?r.width:i.popupWidth;let{group:g}=this.state;return g===void 0&&h!==void 0&&(g=z(n[0],h)),a.createElement(Xe,{width:f,popupSettings:{...r,anchor:r.anchor||this.element,show:p,popupClass:d.classNames(r.popupClass,"k-list-container","k-autocomplete-popup")},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},e&&a.createElement("div",{className:"k-list-header"},e),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${ss[l]||l}`]:l})},!u&&g&&n.length!==0&&a.createElement(Ae,{group:g,groupMode:"modern",render:c}),this.renderList()),s&&a.createElement("div",{className:"k-list-footer"},s))}renderList(){const i=this.base,t=i.getPopupSettings(),{textField:e,data:s=[],listNoDataRender:n,itemRender:l,groupHeaderItemRender:h}=this.props,u=this.value,c=this.props.opened!==void 0?this.props.opened:this.state.opened;return a.createElement(Ve,{id:i.listBoxId,show:c,data:s.slice(),focusedIndex:this.focusedIndex(),value:u,textField:e,valueField:e,highlightSelected:!1,optionsGuid:i.guid,groupField:this.props.groupField,groupMode:"modern",listRef:r=>i.list=r,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:l,groupHeaderItemRender:h,noDataRender:n,onMouseDown:r=>r.preventDefault(),onScroll:this.onScroll})}triggerOnChange(i,t,e){this.value===i&&!e||(t.data.value=i,this._valueDuringOnChange=i,t.events.push({type:"onChange",...e||{}}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}suggestValue(i){if(this._suggested="",i){const{data:t=[],textField:e}=this.props,s=t[_e(t,i,e)];if(s){const n=z(s,e);i.toLowerCase()!==n.toLowerCase()&&(this._suggested=n.substring(i.length))}}}focusedIndex(i){const{data:t=[],textField:e,focusedItemIndex:s,skipDisabledItems:n}=this.props,l=i!==void 0?i:this.value;if(this.state.focusedItem!==void 0)return t.findIndex(h=>L(h,this.state.focusedItem,e));if(s)return s(t,l,e);{const h=t.indexOf(Zt(t,l,e));return n&&e&&h===-1?t.findIndex(u=>!u.disabled&&u[e]):Math.max(0,h)}}};let tt=zt;tt.displayName="AutoComplete",tt.propTypes={...ae.basicPropTypes,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),groupField:o.string,suggest:o.oneOfType([o.bool,o.string]),placeholder:o.string,value:o.string,defaultValue:o.string,validationMessage:o.string,required:o.bool,readonly:o.bool,clearButton:o.bool,valueRender:o.func,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,list:o.any,skipDisabledItems:o.bool},tt.defaultProps={...ae.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};const is=d.createPropsContext(),ns=d.withIdHOC(d.withPropsContext(is,tt));ns.displayName="KendoReactAutoComplete";const Hs=i=>i.syntheticEvent.preventDefault(),As=i=>i.syntheticEvent.stopPropagation();class Ht extends a.Component{render(){const{data:t,guid:e,focused:s,tagRender:n,tag:l,onTagDelete:h,size:u}=this.props;return a.createElement(a.Fragment,null,t.map((c,r)=>{const p=l?a.createElement(l,{key:c.text+r,tagData:c,guid:e,focusedTag:s,onTagDelete:h}):a.createElement(Ce.Chip,{id:`tag-${e}-${c.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":t.length,key:c.text+r,text:c.text,removable:!0,onRemove:f=>h.call(void 0,c.data,f.syntheticEvent),onMouseDown:Hs,onClick:As,className:c===s?"k-focus":void 0,size:u});return n?n(c,p):p}),this.props.children)}}var st=(i=>(i[i.PopupList=0]="PopupList",i[i.TagsList=1]="TagsList",i))(st||{});const as=500,At=i=>{const{footer:t,children:e,windowWidth:s=0,navigatable:n,navigatableElements:l,expand:h,animation:u,onClose:c,adaptiveTitle:r,mobileFilter:p}=i,f={navigatable:n||!1,navigatableElements:l||[],expand:h,animation:u!==!1,onClose:c,animationStyles:s<=as?{top:0,width:"100%",height:"100%"}:void 0,className:s<=as?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return a.createElement(fe.ActionSheet,{...f},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,r)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:Ie.xIcon,onClick:c}))),p&&a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},p)),e,t&&a.createElement(fe.ActionSheetFooter,{className:"k-actions k-actions-stretched"},a.createElement(Ce.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),a.createElement(Ce.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:mt,roundedMap:Ws}=d.kendoThemeMaps,qs="Please enter a valid value!",ls=i=>i.preventDefault(),os=i=>i===2,Wt=class extends a.Component{constructor(i){super(i),this.state={activedescendant:st.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new ae(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],dataItemKey:n,virtual:l}=this.props,h=l?l.skip:0,u=s[t-h],c=this.value.findIndex(f=>L(f,u,n));this._lastSelectedOrDeslectedItemIndex=s.findIndex(f=>L(f,u,n));let r=[];c!==-1?(r=this.value,r.splice(c,1)):r=[...this.value,u],(this.props.filter!==void 0?this.props.filter:this.state.text)&&!this.mobileMode&&(this.state.text&&(e.data.text=""),this.base.filterChanged("",e)),this._adaptiveInput&&this._adaptiveInput.blur(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.triggerOnChange(r,e),this.base.triggerPageChangeCornerItems(u,e)},this.onTagDelete=(t,e)=>{const s=this.base.initState();s.syntheticEvent=e,this.opened&&this.base.togglePopup(s),!this.state.focused&&!this.mobileMode&&(s.data.focused=!0,this.focus());const n=this.value;ut(n,t,this.props.dataItemKey),this.triggerOnChange(n,s),this.applyState(s)},this.itemFocus=(t,e)=>{const{data:s=[],allowCustom:n,virtual:l}=this.props,h=l?l.skip:0,u=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedIndex:c}=this.getFocusedState(),r=n&&u,p=s[t-h];p&&c!==t?this.state.focusedIndex!==t&&(e.data.focusedIndex=t,e.data.activedescendant=st.PopupList):r&&t===-1&&this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(p,e)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.searchbarRef=t=>{const e=this._input=t&&t.input;e&&this.state.focused&&window.setTimeout(()=>e.focus(),0)},this.onChangeHandler=t=>{const e=this.base.initState(),s=t.target.value;e.syntheticEvent=t,this.props.filter===void 0&&(e.data.text=s),e.data.focusedIndex=void 0,this.opened||(this.base.togglePopup(e),this.setState({currentValue:this.value})),this.base.filterChanged(s,e),this.applyState(e),this.setState({group:void 0})},this.clearButtonClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.value.length>0&&this.triggerOnChange([],e),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e);const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this._lastSelectedOrDeslectedItemIndex=null,this.applyState(e)},this.onInputKeyDown=t=>{const{data:e=[],textField:s,groupField:n}=this.props,l=t.keyCode,h=this.props.filter!==void 0?this.props.filter:this.state.text,u=this.props.opened!==void 0?this.props.opened:this.state.opened,{focusedItem:c,focusedIndex:r}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=t,!h&&this.value.length>0&&(l===d.Keys.left||l===d.Keys.right||l===d.Keys.home||l===d.Keys.end||l===d.Keys.delete||l===d.Keys.backspace)&&!t.shiftKey)return this.onTagsNavigate(t,p);const f=()=>{t.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(l===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(l===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if((t.ctrlKey||t.metaKey)&&t.code==="KeyA"){const v=(this.state.value&&this.state.value.length)===e.length?[]:e;this.updateStateOnKeyboardNavigation(v,p)}else if((t.ctrlKey||t.metaKey)&&t.shiftKey&&t.keyCode===d.Keys.end){const g=e.slice(this.getFocusedState().focusedIndex);this.itemFocus(e.length-1,p),this.updateStateOnKeyboardNavigation(g,p)}else if((t.ctrlKey||t.metaKey)&&t.shiftKey&&t.keyCode===d.Keys.home){const g=e.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,p),this.updateStateOnKeyboardNavigation(g,p)}else if(t.shiftKey&&t.keyCode===d.Keys.up){let g;const v=this.getLastSelectedOrDeselectedIndex(1,r);v===null?g=r!==0?e.slice(r-1,r):[e[r]]:v===r?g=[e[v-1]]:r>=0&&(g=v>r?e.slice(r-1,v):e.slice(v-1,r)),g&&g.length>0&&(r>=1&&this.itemFocus(r-1,p),this.updateStateOnKeyboardNavigation(g,p))}else if(t.shiftKey&&t.keyCode===d.Keys.down){let g;const v=this.getLastSelectedOrDeselectedIndex(0,r);v===null?g=r!==e.length-1?e.slice(r,r+1):[e[r]]:v===r?g=e.slice(r,r+2):r>=0&&(g=v>r?e.slice(r+1,v+1):e.slice(v,r+2)),g&&g.length>=1&&(this.itemFocus(r+1,p),this.updateStateOnKeyboardNavigation(g,p))}else if(t.altKey&&l===d.Keys.up)f();else if(l===d.Keys.up||l===d.Keys.down){if(n!==""&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,l);else{let g=0;if(l===d.Keys.down||l===d.Keys.right){const v=e.slice(r+1).find(m=>!m.disabled&&m[s]);g=v&&e.findIndex(m=>m[s]===v[s])}else if(l===d.Keys.up||l===d.Keys.left){let v;if(r===-1)v=e,g=e.findIndex(m=>!m.disabled&&m[s]);else{v=e.slice(0,r);let m=v.pop();for(;m&&m.disabled;)m=v.pop();g=m&&e.findIndex(b=>b[s]===m[s])}}if(g){const v=g-r;this.onNavigate(p,l,v)}else g!==void 0&&this.onNavigate(p,l)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,l);else{let g=null;if(l===d.Keys.down||l===d.Keys.right)g=e.slice(r+1).find(v=>!v.disabled);else if(l===d.Keys.up||l===d.Keys.left){const v=e.slice(0,r);for(g=v.pop();g&&g.disabled;)g=v.pop()}if(g){const v=g.id-r-1;this.onNavigate(p,l,v)}else this.onNavigate(p,l)}this.applyState(p),t.preventDefault()}else l===d.Keys.enter?(t.preventDefault(),this.props.allowCustom&&h&&c===null?this.customItemSelect(t):c&&c.disabled?f():this.selectFocusedItem(t)):l===d.Keys.esc&&f();else t.altKey&&l===d.Keys.down&&f()},this.listContainerContent=()=>{const{header:t,footer:e,allowCustom:s,size:n,data:l=[],groupStickyHeaderItemRender:h,groupField:u,list:c}=this.props,r=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),f=s&&r&&a.createElement("div",{className:d.classNames("k-list",{[`k-list-${mt[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:ls},a.createElement("div",{className:d.classNames("k-list-item k-custom-item",{"k-focus":os(p)}),style:{fontStyle:"italic"}},r,a.createElement(d.IconWrap,{name:"plus",icon:Ie.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return g===void 0&&u!==void 0&&(g=z(l[0],u)),a.createElement(a.Fragment,null,t&&a.createElement("div",{className:"k-list-header"},t),f,a.createElement("div",{className:d.classNames("k-list",{[`k-list-${this.mobileMode?"lg":mt[n]||n}`]:n,"k-virtual-list":this.base.vs.enabled})},!c&&g&&l.length!==0&&a.createElement(Ae,{group:g,groupMode:"modern",render:h}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))},this.renderListContainer=()=>{const t=this.base,{dir:e,data:s=[]}=this.props,n=this.base.getPopupSettings(),l=n.width!==void 0?n.width:t.popupWidth,h={dir:e!==void 0?e:t.dirCalculated,width:l,popupSettings:{...n,popupClass:d.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),anchor:n.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return a.createElement(Xe,{...h},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:t,filterable:e,filter:s}=this.props,{windowWidth:n=0}=this.state,l=s!==void 0?s:this.state.text;this.localization=xe.provideLocalizationService(this);const h=e?a.createElement(Me,{value:l,ref:c=>this._adaptiveInput=c&&c.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}):null,u={adaptiveTitle:t,expand:this.opened,onClose:c=>this.onCancel(c),windowWidth:n,mobileFilter:h,footer:{cancelText:this.localization.toLanguageString(Re,ne[Re]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(Pe,ne[Pe]),onApply:this.closePopup}};return a.createElement(At,{...u},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.closePopup=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e),e.events.push({type:"onClose"});const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this.applyState(e)},this.onCancel=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e),e.events.push({type:"onCancel"});const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this.applyState(e)},this.renderList=()=>{const{data:t=[],textField:e,listNoDataRender:s,itemRender:n,groupHeaderItemRender:l,dataItemKey:h,virtual:u={skip:0,total:void 0}}=this.props,c=this.base.vs,{focusedIndex:r}=this.getFocusedState(),p=this.base.getPopupSettings(),f=`translateY(${c.translate}px)`;return a.createElement(Ve,{id:this.base.listBoxId,show:this.opened,data:t.slice(),focusedIndex:r-u.skip,value:this.value,textField:e,valueField:h,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:g=>{c.list=this.base.list=g},wrapperStyle:this.mobileMode?{}:{maxHeight:p.height},wrapperCssClass:"k-list-content",listStyle:c.enabled?{transform:f}:void 0,key:"listKey",skip:u.skip,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:l,noDataRender:s,onMouseDown:ls,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:c.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:u.total})},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!(!n||!l.length)&&n){const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;l=this.base.getGroupedDataModernMode(l,n);let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&this.setState({group:r})}},this.customItemSelect=t=>{const e=this.props.filter!==void 0?this.props.filter:this.state.text,{textField:s}=this.props;if(!e)return;const n=this.base.initState();n.syntheticEvent=t;const l=s?{[s]:e}:e;this.state.text!==void 0&&(n.data.text=""),n.data.focusedIndex=void 0,this.base.filterChanged("",n);const h=[...this.value,l];this.triggerOnChange(h,n),this.base.togglePopup(n),this.applyState(n)},this.handleWrapperClick=t=>{const e=this._input;!this.opened&&e&&this.focusElement(e);const s=this.base.initState();s.syntheticEvent=t,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&(this.setState({currentValue:this.tagsToRender}),this.mobileMode&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300)),this.base.togglePopup(s),this.applyState(s)},this.handleItemClick=(t,e)=>{const s=this.base.initState();s.syntheticEvent=e,this.handleItemSelect(t,s),this.props.autoClose&&!this.mobileMode&&this.base.togglePopup(s),e.stopPropagation(),this.applyState(s)},this.handleBlur=t=>{if(!this.state.focused||this._skipFocusEvent)return;const e=this.base.initState(),{allowCustom:s,filterable:n}=this.props;e.syntheticEvent=t,e.data.focused=!1,e.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(e.data.opened=!1),e.events.push({type:"onClose"})),!s&&!n&&this.state.text&&(e.data.text=""),this.applyState(e)},this.handleFocus=t=>{this._skipFocusEvent||this.base.handleFocus(t)},this.onPopupOpened=()=>{this._input&&this.state.focused&&!this.mobileMode&&this.focusElement(this._input)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.focusElement(this._input)},0)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||qs)},d.validatePackage(We)}get _inputId(){return this.props.id}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get opened(){return!!(this.props.opened!==void 0?this.props.opened:this.state.opened)}get tagsToRender(){const{tags:i,textField:t}=this.props;let e=[];return i===void 0?this.value.forEach(s=>{e.push({text:z(s,t),data:[s]})}):e.push(...i),e}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ke&&this.props.adaptive)}get value(){const i=[];return this._valueItemsDuringOnChange?i.push(...this._valueItemsDuringOnChange):this.props.value?i.push(...this.props.value):this.state.value?i.push(...this.state.value):this.props.defaultValue&&i.push(...this.props.defaultValue),i}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value.length>0&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get required(){return this.props.required!==void 0?this.props.required:Wt.defaultProps.required}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Wt.defaultProps.validityStyles}componentDidUpdate(i,t){var f;const{virtual:e,groupField:s="",data:n=[]}=this.props,l=e?e.skip:0,h=i.virtual?i.virtual.total:0,u=i.opened!==void 0?i.opened:t.opened,c=!u&&this.opened,r=u&&!this.opened;if(!this.base.getPopupSettings().animate&&r&&this.onPopupClosed(),e&&e.total!==h)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:g,focusedIndex:v}=this.getFocusedState();s!==""&&(v=(f=this.base.getGroupedDataModernMode(n,s))==null?void 0:f.indexOf(g)),c&&e?this.base.scrollToVirtualItem(e,v-l):c&&!e?(n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][s],this),this.base.scrollToItem(v)):this.opened&&u&&g&&this.scrollToFocused&&this.base.scrollToItem(v-l)}this.scrollToFocused=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}onNavigate(i,t,e){const{allowCustom:s,data:n=[]}=this.props,l=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedType:h,focusedIndex:u}=this.getFocusedState(),c=s&&l,r=os(h),p=this.base,f=p.vs;if(this.opened&&t===d.Keys.up&&r)this.state.focusedIndex!==void 0&&(i.data.focusedIndex=void 0);else{const g=p.navigation.navigate({keyCode:t,current:u,max:(f.enabled?f.total:n.length)-1,min:c?-1:0,skipItems:e||void 0});g!==void 0&&(this.itemFocus(g,i),this.scrollToFocused=!0)}this.applyState(i)}render(){const{style:i,className:t,label:e,dir:s,disabled:n,textField:l,dataItemKey:h,virtual:u,size:c,rounded:r,fillMode:p,loading:f,filter:g}=this.props,{text:v,focused:m,focusedTag:b,currentValue:C}=this.state,w=this.base.vs,D=this.props.id||this._inputId;w.enabled=u!==void 0,u!==void 0&&(w.skip=u.skip,w.total=u.total,w.pageSize=u.pageSize);const _=this.mobileMode&&this.opened?C:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const O=!this.validityStyles||this.validity.valid,B=!!(g!==void 0?g:v)||_&&_.length>0,[E,F]=Ne(this.props.prefix||a.Fragment),[S,k]=Ne(this.props.suffix||a.Fragment),N=a.createElement(a.Fragment,null,a.createElement("div",{ref:this.componentRef,className:d.classNames("k-multiselect k-input",t,{[`k-input-${mt[c]||c}`]:c,[`k-rounded-${Ws[r]||r}`]:r,[`k-input-${p}`]:p,"k-focus":m&&!n,"k-invalid":!O,"k-disabled":n,"k-loading":f,"k-required":this.required}),style:e?{...i,width:void 0}:i,dir:s,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:Cs},this.props.prefix&&a.createElement(E,{...F}),a.createElement("div",{className:d.classNames("k-input-values")},a.createElement("div",{className:d.classNames("k-chip-list",{[`k-chip-list-${mt[c]||c}`]:c}),role:"listbox",id:"tagslist-"+this.base.guid},_&&_.length>0&&a.createElement(Ht,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:_,guid:this.base.guid,focused:b?_.find($=>ht($,b,h)):void 0,size:c})),this.renderSearchBar(D)),f&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&a.createElement(S,{...k}),B&&a.createElement(et,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return e?a.createElement(He.FloatingLabel,{label:e,editorId:D,editorValue:v||z(this.value[0],l),editorValid:O,editorDisabled:n,style:{width:i?i.width:void 0},children:N}):N}renderSearchBar(i){const{activedescendant:t,focusedTag:e,currentValue:s}=this.state,{disabled:n,placeholder:l,ariaDescribedBy:h}=this.props,u=!this.mobileMode&&(this.props.filter!==void 0?this.props.filter:this.state.text)||"",{focusedIndex:c}=this.getFocusedState(),r=this.value.length===0&&!u?l:void 0,p=s&&s.length>0?void 0:l,f=t===st.TagsList&&e!==void 0?`tag-${this.base.guid}-${e.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${c}`;return a.createElement(ft,{id:i,size:Math.max((r||"").length,u.length,1),tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,placeholder:this.mobileMode&&this.opened?p:r,value:u,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:f,ariaDescribedBy:`tagslist-${this.base.guid}${h?" "+h:""}`,ariaLabelledBy:this.props.ariaLabelledBy,ariaRequired:this.required})}onTagsNavigate(i,t){const e=i.keyCode,{focusedTag:s}=this.state,n=this._tags,l=this.props.dataItemKey;let h=s?n.findIndex(r=>ht(r,s,l)):-1,u;const c=h!==-1;if(e===d.Keys.left)c?h=Math.max(0,h-1):h=n.length-1,u=n[h];else if(e===d.Keys.right)h===n.length-1?u=void 0:c&&(h=Math.min(n.length-1,h+1),u=n[h]);else if(e===d.Keys.home&&!i.shiftKey)u=n[0];else if(e===d.Keys.end&&!i.shiftKey)u=n[n.length-1];else if(e===d.Keys.delete){if(c){const r=this.value;ut(r,n[h].data,l),this.triggerOnChange(r,t)}}else if(e===d.Keys.backspace){const r=this.value;if(c)ut(r,n[h].data,l),this.triggerOnChange(r,t);else if(!c&&n.length){const p=n.pop();ut(r,p.data,l),this.triggerOnChange(r,t)}}u!==s&&(t.data.focusedTag=u,t.data.activedescendant=st.TagsList),this.applyState(t)}triggerOnChange(i,t){this.props.value===void 0&&(t.data.value=[...i]),this._valueItemsDuringOnChange=[],this.setItems(i,this._valueItemsDuringOnChange),t.events.push({type:"onChange"})}selectFocusedItem(i,t){const{data:e=[],virtual:s}=this.props,{focusedIndex:n}=t||this.getFocusedState(),l=s?s.skip:0;e[n-l]!==void 0&&this.handleItemClick(n,i)}setItems(i,t){t.length=0,t.push(...i)}getFocusedState(){const{focusedIndex:i}=this.state,t=this.props.filter!==void 0?this.props.filter:this.state.text,{allowCustom:e,data:s=[],dataItemKey:n,virtual:l,textField:h,focusedItemIndex:u=_e,skipDisabledItems:c}=this.props,r=l&&l.skip||0;let p;if(i!==void 0)return{focusedIndex:i,focusedItem:s[i-r],focusedType:1};const f=this.value;if(e&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=u(s,t,h),{focusedItem:s[p],focusedIndex:p+r,focusedType:1};if(f.length){const g=f[f.length-1];return p=s.findIndex(v=>L(v,g,n)),s[p]!==void 0?{focusedIndex:p+r,focusedItem:s[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}else if(c&&h&&!t&&r===0){const g=s.findIndex(v=>!v.disabled&&v[h]);return{focusedIndex:g,focusedItem:s[g-r],focusedType:1}}return r===0?{focusedItem:s[0],focusedIndex:0,focusedType:1}:{focusedType:0,focusedIndex:-1}}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(i){this.base.applyState(i),this._valueItemsDuringOnChange=null}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}updateStateOnKeyboardNavigation(i,t){this.setState({value:i}),this.triggerOnChange(i,t),this.applyState(t)}getLastSelectedOrDeselectedIndex(i,t){return this._lastSelectedOrDeslectedItemIndex===null&&(this._lastSelectedOrDeslectedItemIndex=t),this._lastSelectedOrDeslectedItemIndex!==null?this._lastSelectedOrDeslectedItemIndex+i:null}};let it=Wt;it.displayName="MultiSelect",it.propTypes={...ae.propTypes,autoClose:o.bool,value:o.arrayOf(o.any),defaultValue:o.arrayOf(o.any),dataItemKey:o.string,placeholder:o.string,tags:o.arrayOf(o.shape({text:o.string,data:o.arrayOf(o.any)})),tagRender:o.func,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,groupField:o.string,list:o.any,adaptive:o.bool,adaptiveTitle:o.string,onCancel:o.func,skipDisabledItems:o.bool},it.defaultProps={...ae.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};const rs=d.createPropsContext(),ds=d.withIdHOC(d.withPropsContext(rs,it));ds.displayName="KendoReactMultiSelect";const $s=i=>a.createElement(Ve,{...i,wrapperCssClass:"k-table-body k-table-scroller",listClassName:d.classNames("k-table k-table-list",{"k-virtual-table":i.virtual!==void 0}),listStyle:{...i.listStyle}}),Ts=(i,t)=>i?typeof i=="number"?i+"px":i:t,cs=d.createPropsContext(),bt=a.forwardRef((i,t)=>{const e=d.usePropsContext(cs,i),s=a.useRef(null),n=a.useRef(null),l=d.getScrollbarWidth(),{columns:h=Te.columns,popupSettings:u=Te.popupSettings,className:c,size:r,prefix:p=void 0,suffix:f=void 0,onOpen:g,onClose:v,onFocus:m,onBlur:b,onChange:C,onFilterChange:w,onPageChange:D,..._}=e;a.useImperativeHandle(s,()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:e})),a.useImperativeHandle(t,()=>s.current);const O=a.useMemo(()=>{if(e.groupField!==void 0&&e.data)return z(e.data[0],e.groupField)},[e.data,e.groupField]),[B,E]=a.useState(O),[F,S]=a.useState(!0),[k]=p?Ne(e.prefix||a.Fragment):[],[N]=f?Ne(e.suffix||a.Fragment):[],$=a.useMemo(()=>{const V=a.createElement("th",{className:"k-table-th",colSpan:h.length},B);return a.createElement(a.Fragment,null,e.header,a.createElement("div",{className:"k-table-header-wrap"},a.createElement("table",{className:"k-table",role:"presentation"},a.createElement("colgroup",null,h.map((T,me)=>a.createElement("col",{key:T.uniqueKey?T.uniqueKey:me,style:{width:T.width?T.width:Te.width}}))),a.createElement("thead",{className:"k-table-thead"},a.createElement("tr",{className:"k-table-row"},h.map((T,me)=>a.createElement("th",{className:"k-table-th",key:T.uniqueKey?T.uniqueKey:me},T.header||" "))),B&&F&&a.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,V,{}):V)))))},[e.header,h,B,F]),J=a.useMemo(()=>`calc(${h.map(V=>Ts(V.width,Te.width)).filter(Boolean).join(" + ")} + ${l}px + 4px)`,[h,l]),Q=e.virtual?e.virtual.skip:0,R=a.useCallback((V,T)=>{const me=h.map((ee,xt)=>a.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:ee.width?ee.width:Te.width},key:ee.uniqueKey?ee.uniqueKey:xt},ee.field?String(d.getter(ee.field)(T.dataItem)):""));let W,X,De,re,G=e.data||[];const de=T.index-Q;e.groupField!==void 0&&(re=d.getter(e.groupField),X=re(G[de]),De=re(G[de-1]),X&&De&&X!==De&&(W=X)),W&&e.groupMode==="classic"&&me.push(a.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},a.createElement("span",null,W)));const Fe=a.cloneElement(V,{...V.props,className:d.classNames("k-table-row",{"k-table-alt-row":T.index%2!==0,"k-focus":T.focused,"k-selected":T.selected,"k-first":!!W,"k-disabled":T.dataItem.disabled})},me);return e.itemRender?e.itemRender.call(void 0,Fe,T):Fe},[h,e.groupField,e.itemRender,e.data,Q]),H=a.useCallback((V,T)=>{V&&V.call(void 0,{...T,target:s.current})},[]),ye=a.useCallback(V=>(e.virtual||E(O),H(g,V)),[H,g,e.virtual,O]),P=a.useCallback(V=>H(v,V),[v]),Z=a.useCallback(V=>H(m,V),[m]),oe=a.useCallback(V=>H(b,V),[b]),Ue=a.useCallback(V=>H(C,V),[C]),Le=a.useCallback(V=>H(D,V),[D]),je=a.useCallback(V=>(E(O),H(w,{...V,mobileMode:V.target.mobileMode})),[w]),q=a.useCallback(V=>{E(V.group)},[]);a.useEffect(()=>{d.setScrollbarWidth()}),a.useEffect(()=>{const V=e.data;E(O),V&&V.length!==0?S(!0):S(!1)},[e.data]);const Ye=a.useCallback(V=>a.createElement($s,{...V}),[]);return a.createElement(dt.PopupPropsContext.Provider,{value:V=>({...V,popupClass:`k-dropdowngrid-popup ${u.popupClass}`})},a.createElement(Lt,{..._,list:Ye,popupSettings:{...u,width:u.width||J,className:u.className},ref:n,header:$,itemRender:R,groupHeaderItemRender:e.groupHeaderItemRender,size:e.size,rounded:e.rounded,fillMode:e.fillMode,groupMode:e.groupMode,groupField:e.groupField,isMultiColumn:!0,onOpen:ye,onClose:P,onFocus:Z,onBlur:oe,onChange:Ue,onFilterChange:je,onPageChange:Le,onGroupScroll:q,className:d.classNames("k-dropdowngrid",c),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,footer:e.footer,footerClassName:"k-table-footer",prefix:k,suffix:N}))}),Gs={...$e.propTypes,columns:o.any.isRequired},Te={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};bt.displayName="KendoMultiColumnComboBox",bt.propTypes=Gs,bt.defaultProps=Te;function Us(i,t,e){const[s,n]=a.useState(t);return a.useEffect(()=>{s!==void 0&&i.current&&n(i.current.offsetWidth)},e),s}function us(i,t,e,s){const n=e.width!==void 0&&e.width!==t.popupSettings.width,l=s.width!==void 0,h=n?e.width:l?s.width:t.popupSettings.width,u=Us(i,h);return n||l?h:u&&u>t.popupSettings.width?u:t.popupSettings.width}const hs=i=>a.createElement("div",{className:"k-nodata"},a.createElement("div",null,i.children)),{sizeMap:js,roundedMap:Ys}=d.kendoThemeMaps,Js="Please select a value from the list!",Qs=i=>a.createElement("span",{className:"k-input-value-text"},i.children),ps=i=>i.split("_").map(t=>parseInt(t,10)),Xs=(i,t)=>{const{validationMessage:e,valid:s,required:n}=i;return{customError:e!==void 0,valid:!!(s!==void 0?s:!n||t),valueMissing:!t}},fs={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},gs=d.createPropsContext(),qt=a.forwardRef((i,t)=>{d.validatePackage(We);const e=d.usePropsContext(gs,i),s={...fs,...e},n=d.useId(),l=s.id||n,{data:h,dataItemKey:u,popupSettings:c={},style:r,opened:p,disabled:f,onOpen:g=d.noop,onClose:v=d.noop,placeholder:m,label:b,name:C,selectField:w,subItemsField:D,validationMessage:_,valid:O,required:B,validityStyles:E}=s,F=d.getTabIndex(s.tabIndex,f),S=a.useRef(null),k=a.useRef(null),N=a.useRef(null),$=a.useRef(null),J=a.useRef(null),Q=a.useRef(null),R=a.useRef(!1),[H,ye]=a.useState(void 0),P=s.value!==void 0,Z=P?s.value:H!==void 0?H:s.defaultValue,oe=Y(Z),Ue=oe?z(Z,s.textField):"",Le=Xs({validationMessage:_,valid:O,required:B},oe),je=a.useCallback(()=>k.current&&k.current.focus(),[]);a.useImperativeHandle(S,()=>({props:s,element:k.current,focus:je})),a.useImperativeHandle(t,()=>S.current);const q=d.useRtl(k,s.dir),V={width:us(k,fs,c,r),...q!==void 0?{direction:q}:{}},[T,me]=a.useState(!1),W=p!==void 0?p:T,[X,De]=a.useState(!1),[re,G]=a.useState(),de=!!(re&&re<=ke&&s.adaptive),[Fe,ee]=a.useState(""),xt=a.useCallback(()=>{J.current&&J.current.setCustomValidity&&J.current.setCustomValidity(Le.valid?"":_===void 0?Js:_)},[_,Le]);a.useEffect(xt),a.useEffect(()=>{const x=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(jt.bind(void 0));return document!=null&&document.body&&x&&x.observe(document.body),()=>{document!=null&&document.body&&x&&x.disconnect()}},[]);const yt=a.useCallback(x=>{if(!W){if(g){const K={...x};g.call(void 0,K)}p===void 0&&me(!0)}},[W,p,g]),Ke=a.useCallback(x=>{if(W){if(v){const K={...x};v.call(void 0,K)}p===void 0&&(me(!1),de&&setTimeout(()=>{var K;U((K=$.current)==null?void 0:K.element)},300))}},[W,p,v,de]),$t=a.useCallback(x=>{if(!x.isDefaultPrevented()&&S.current){De(!0);const K={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};(W?Ke:yt)(K)}},[W,p,g,v]),le=a.useCallback(x=>{R.current=!0,x(),window.setTimeout(()=>R.current=!1,0)},[]),Je=a.useCallback(x=>{var y,A;const{keyCode:K,altKey:j}=x,ue=Q.current&&Q.current.element;if(!S.current||x.isDefaultPrevented()&&((y=N.current)==null?void 0:y.element)===x.target)return;const I={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};if(W)if(K===d.Keys.esc||j&&K===d.Keys.up)x.preventDefault(),Ke(I);else if(ue&&ue.querySelector(".k-focus")&&(K===d.Keys.up||K===d.Keys.down||K===d.Keys.left||K===d.Keys.right||K===d.Keys.home||K===d.Keys.end)){if(K===d.Keys.up&&((A=N.current)!=null&&A.element)){const se=Array.from(ue.querySelectorAll(".k-treeview-item")),we=[...se].reverse().find(Ee=>!!(Ee&&Ee.querySelector(".k-focus")));if(we&&se.indexOf(we)===0)return le(()=>{var Ee;U((Ee=N.current)==null?void 0:Ee.element)})}le(d.noop)}else K===d.Keys.down&&le(()=>{var se;U(((se=N.current)==null?void 0:se.element)||ue)});else j&&K===d.Keys.down?(x.preventDefault(),yt(I)):W||K===d.Keys.esc&&Et(x)},[W,p,g,v]),ze=a.useCallback(x=>{const{keyCode:K,altKey:j}=x;j||K!==d.Keys.up&&K!==d.Keys.down||(x.preventDefault(),le(K===d.Keys.up?()=>{U(k.current)}:()=>{U(Q.current&&Q.current.element)}))},[]),U=a.useCallback(x=>{x&&le(()=>x.focus())},[]),ve=a.useCallback(()=>{var x;!X&&W&&!p?Ke({target:S.current}):e.filterable?U((x=N.current)==null?void 0:x.element):U(Q.current&&Q.current.element)},[v,e.filterable,X,p,W]),te=a.useCallback(()=>{X&&U(k.current)},[X]),Tt=a.useCallback(x=>{if(!X&&!R.current&&(De(!0),e.onFocus&&S.current)){const K={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};e.onFocus.call(void 0,K)}},[X,e.onFocus]),Gt=a.useCallback(x=>{if(X&&!R.current&&S.current){De(!1);const K={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};if(e.onBlur){const j={...K};e.onBlur.call(void 0,j)}de||Ke(K)}},[X,e.onBlur,W,p,v]),Ut=a.useCallback(()=>{X&&le(d.noop),de&&setTimeout(()=>{var x;U((x=$.current)==null?void 0:x.element)},300)},[X,de]),St=a.useCallback((x,K,j)=>{if(e.onChange){const ue={value:K,level:j?ps(j):[],...x};e.onChange.call(void 0,ue)}P||ye(K)},[e.onChange,P]),wt=a.useCallback(x=>{if(L(x.item,Z,u)||!S.current)return;const{item:K,itemHierarchicalIndex:j,nativeEvent:ue,syntheticEvent:I}=x,y={syntheticEvent:I,nativeEvent:ue,target:S.current};St(y,K,j),Ke(y)},[P,Z,e.onChange,u,W,p,v]),Et=a.useCallback(x=>{if(!S.current)return;const K={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};St(K,null),Ke(K),x.preventDefault()},[P,e.onChange,W,p,v]),Ct=a.useCallback(x=>{if(x.syntheticEvent.stopPropagation(),e.onExpandChange&&S.current){const{item:K,itemHierarchicalIndex:j,nativeEvent:ue,syntheticEvent:I}=x,y={level:ps(j),item:K,nativeEvent:ue,syntheticEvent:I,target:S.current};e.onExpandChange.call(void 0,y)}},[e.onExpandChange]),nt=a.useCallback(x=>{if(e.onFilterChange&&S.current){const j={filter:{field:e.textField,operator:"contains",value:x.target.value},syntheticEvent:x.syntheticEvent,nativeEvent:x.nativeEvent,target:S.current};e.onFilterChange.call(void 0,j),e.filter===void 0&&ee(x.target.value)}},[e.onFilterChange,e.filter,e.textField]),at=()=>{const x=s.filterable?a.createElement(Me,{value:s.filter===void 0?Fe:s.filter,ref:$,onChange:nt,onKeyDown:ze,size:be,rounded:Se,fillMode:Oe}):null,K={adaptiveTitle:s.adaptiveTitle,expand:W,onClose:j=>Ke(j),windowWidth:re,mobileFilter:x};return a.createElement(At,{...K},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:"k-list k-list-lg"},h.length>0?a.createElement(ct.TreeView,{ref:Q,tabIndex:F,data:lt,focusIdField:u,textField:s.textField,selectField:w,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:wt,onExpandChange:Ct,size:be,item:s.item,dir:q}):a.createElement(ot,null,rt.toLanguageString(ge,ne[ge]))))))},jt=a.useCallback(x=>{for(let K of x)G(K.target.clientWidth)},[]),lt=a.useMemo(()=>P||!oe?h:d.mapTree(h,D,x=>d.extendDataItem(x,D,{[w]:L(x,Z,u)})),[h,Z,P,oe,w,D]),ot=s.listNoData||hs,kt=s.valueHolder||Qs,rt=xe.useLocalization(),Dt=!E||Le.valid,{size:be,rounded:Se,fillMode:Oe}=s,ce=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-dropdowntree k-picker",s.className,{[`k-picker-${js[be]||be}`]:be,[`k-rounded-${Ys[Se]||Se}`]:Se,[`k-picker-${Oe}`]:Oe,"k-focus":X,"k-invalid":!Dt,"k-loading":s.loading,"k-required":B,"k-disabled":s.disabled}),tabIndex:F,accessKey:s.accessKey,id:l,style:b?{...r,width:void 0}:r,dir:q,ref:k,onKeyDown:f?void 0:Je,onMouseDown:Ut,onClick:f?void 0:$t,onFocus:Tt,onBlur:Gt,role:"combobox","aria-haspopup":"tree","aria-expanded":W,"aria-disabled":f,"aria-label":b,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy,"aria-required":B},a.createElement("span",{className:"k-input-inner"},a.createElement(kt,{item:Z},Ue||m)),s.loading&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),oe&&!f&&a.createElement("span",{onClick:Et,className:"k-clear-value",title:rt.toLanguageString(Ze,ne[Ze]),role:"button",tabIndex:-1,onMouseDown:x=>x.preventDefault()},a.createElement(d.IconWrap,{name:"x",icon:Ie.xIcon})),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:be,fillMode:Oe,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:Ie.caretAltDownIcon}),a.createElement("select",{name:C,ref:J,tabIndex:-1,"aria-hidden":!0,title:b,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,Z):Z})),!de&&a.createElement(dt.Popup,{...c,className:d.classNames(c.className,{"k-rtl":q==="rtl"}),popupClass:d.classNames(c.popupClass,"k-dropdowntree-popup"),style:V,anchor:c.anchor||k.current,show:W,onOpen:ve,onClose:te},s.filterable&&a.createElement(Me,{value:s.filter===void 0?Fe:s.filter,ref:N,onChange:nt,onKeyDown:ze,size:be,rounded:Se,fillMode:Oe}),h.length>0?a.createElement(ct.TreeView,{style:{height:c.height},ref:Q,tabIndex:F,data:lt,focusIdField:u,textField:s.textField,selectField:w,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:wt,onExpandChange:Ct,size:be,item:s.item,dir:q}):a.createElement(ot,null,rt.toLanguageString(ge,ne[ge])))),de&&at());return b?a.createElement(He.FloatingLabel,{label:b,editorValue:Ue,editorPlaceholder:m,editorValid:Dt,editorDisabled:f,editorId:l,style:{width:r?r.width:void 0},children:ce,dir:q}):ce}),Zs={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,value:o.any,valueMap:o.func,placeholder:o.string,dataItemKey:o.string.isRequired,textField:o.string.isRequired,selectField:o.string,expandField:o.string,subItemsField:o.string,className:o.string,style:o.object,label:o.string,validationMessage:o.string,validityStyles:o.bool,valid:o.bool,required:o.bool,name:o.string,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,filterable:o.bool,filter:o.string,loading:o.bool,popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,onFilterChange:o.func,onExpandChange:o.func,item:o.func,valueHolder:o.func,listNoData:o.func,adaptiveTitle:o.string,adaptive:o.bool};qt.displayName="KendoReactDropDownTree",qt.propTypes=Zs;const Ps="Please select a value from the list!",{sizeMap:vs,roundedMap:Rs}=d.kendoThemeMaps,ei=i=>i.split("_").map(t=>parseInt(t,10)),ti=(i,t)=>{const{validationMessage:e,valid:s,required:n}=i;return{customError:e!==void 0,valid:!!(s!==void 0?s:!n||t),valueMissing:!t}},Be={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},ms=d.createPropsContext(),It=a.forwardRef((i,t)=>{const e=d.usePropsContext(ms,i);d.validatePackage(We);const s=d.useId(),n=e.id||s,{data:l=[],dataItemKey:h,popupSettings:u={},style:c={},opened:r,disabled:p,onOpen:f=d.noop,onClose:g=d.noop,placeholder:v,label:m,name:b,checkField:C=Be.checkField,checkIndeterminateField:w=Be.checkIndeterminateField,subItemsField:D=Be.subItemsField,validationMessage:_,valid:O,tags:B,value:E,required:F=Be.required,validityStyles:S=Be.validityStyles}=e,k=d.getTabIndex(e.tabIndex,p),N=a.useRef(null),$=a.useRef(null),J=a.useRef(null),Q=a.useRef(null),R=a.useRef(null),H=a.useRef(null),ye=a.useRef(!1),P=a.useRef([]),Z=a.useRef(null),[oe,Ue]=a.useState(),[Le,je]=a.useState(!1),[q,Ye]=a.useState(!1),[V,T]=a.useState(),[me,W]=a.useState([]),[X,De]=a.useState(""),re=!!(V&&V<=ke&&e.adaptive),G=r!==void 0?r:Le,de=!!(Array.isArray(E)&&E.length),Fe=ti({validationMessage:_,valid:O,required:F},de),ee=d.useRtl($,e.dir),yt={width:us($,Be,u,c),...ee!==void 0?{direction:ee}:{}},Ke=a.useCallback(()=>$.current&&$.current.focus(),[]);P.current=B===void 0?(E||[]).map(I=>({text:z(I,e.textField),data:[I]})):[...B],a.useImperativeHandle(N,()=>({props:e,element:$.current,focus:Ke})),a.useImperativeHandle(t,()=>N.current);const $t=a.useCallback(()=>{R.current&&R.current.setCustomValidity&&R.current.setCustomValidity(Fe.valid?"":_===void 0?Ps:_)},[_,Fe]);a.useEffect($t),a.useEffect(()=>{const I=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Dt.bind(void 0));return document!=null&&document.body&&I&&I.observe(document.body),()=>{I&&I.disconnect()}},[]),a.useEffect(()=>{Z.current&&G&&Z.current.setPosition(Z.current._popup)},[E,G]);const le=a.useCallback((I,y,A)=>{if(e.onChange){const se={items:y,operation:A,...I};e.onChange.call(void 0,se)}},[e.onChange]),Je=a.useCallback(I=>{if(L(I.item,E,h)||!N.current)return;const{item:y,nativeEvent:A,syntheticEvent:se}=I,we={syntheticEvent:se,nativeEvent:A,target:N.current};le(we,[y],"toggle")},[E,h,le]),ze=a.useCallback(I=>{if(!G){if(f){const y={...I};f.call(void 0,y)}r===void 0&&(je(!0),W(E||[]),re&&setTimeout(()=>{var y;te((y=Q.current)==null?void 0:y.element)},300))}},[G,r,f,re,Q]),U=a.useCallback(I=>{if(G){if(g){const y={...I};g.call(void 0,y)}r===void 0&&je(!1)}},[G,r,g]),ve=a.useCallback(I=>{ye.current=!0,I(),window.setTimeout(()=>ye.current=!1,0)},[]),te=a.useCallback(I=>{I&&ve(()=>I.focus())},[ve]),Tt=a.useCallback(()=>{var I;!q&&G?U({target:N.current}):e.filterable?te((I=J.current)==null?void 0:I.element):te(H.current&&H.current.element)},[q,G,te,U,e.filterable]),Gt=a.useCallback(()=>{q&&te($.current)},[q,te]),Ut=a.useCallback(I=>{if(!q&&!ye.current&&(Ye(!0),e.onFocus&&N.current)){const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};e.onFocus.call(void 0,y)}},[q,e.onFocus]),St=a.useCallback(I=>{if(q&&!ye.current&&N.current){Ye(!1);const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};if(e.onBlur){const A={...y};e.onBlur.call(void 0,A)}re||U(y)}},[q,e.onBlur,G,r,g]),wt=a.useCallback(()=>{q&&ve(d.noop)},[q,ve]),Et=a.useCallback(I=>{if(!I.isDefaultPrevented()&&N.current){Ye(!0);const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};G||ze(y)}},[G,ze]),Ct=a.useCallback(I=>{var Ee,bs;const{keyCode:y,altKey:A}=I,se=H.current&&H.current.element;if(!N.current||I.isDefaultPrevented()&&((Ee=J.current)==null?void 0:Ee.element)===I.target)return;const we={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};if(E&&E.length>0&&(y===d.Keys.left||y===d.Keys.right||y===d.Keys.home||y===d.Keys.end||y===d.Keys.delete)){const ie=P.current;let he=oe?ie.findIndex(ni=>ht(ni,oe,h)):-1,pe;const Yt=he!==-1;y===d.Keys.left?(Yt?he=Math.max(0,he-1):he=ie.length-1,pe=ie[he]):y===d.Keys.right?he===ie.length-1?pe=void 0:Yt&&(he=Math.min(ie.length-1,he+1),pe=ie[he]):y===d.Keys.home?pe=ie[0]:y===d.Keys.end?pe=ie[ie.length-1]:y===d.Keys.delete&&Yt&&le(we,ie[he].data,"delete"),pe!==oe&&Ue(pe)}if(G)if(y===d.Keys.esc||A&&y===d.Keys.up)I.preventDefault(),U(we);else if(se&&se.querySelector(".k-focus")&&(y===d.Keys.up||y===d.Keys.down||y===d.Keys.left||y===d.Keys.right||y===d.Keys.home||y===d.Keys.end)){if(y===d.Keys.up&&((bs=J.current)!=null&&bs.element)){const ie=Array.from(se.querySelectorAll(".k-treeview-item")),he=[...ie].reverse().find(pe=>!!(pe&&pe.querySelector(".k-focus")));if(he&&ie.indexOf(he)===0)return ve(()=>{var pe;te((pe=J.current)==null?void 0:pe.element)})}ve(d.noop)}else y===d.Keys.down&&ve(()=>{var ie;te(((ie=J.current)==null?void 0:ie.element)||se)});else A&&y===d.Keys.down&&(I.preventDefault(),ze(we))},[G,U,te,ve,ze,oe,h,E,le]),nt=a.useCallback(I=>{const{keyCode:y,altKey:A}=I;A||y!==d.Keys.up&&y!==d.Keys.down||(I.preventDefault(),ve(y===d.Keys.up?()=>{te($.current)}:()=>{te(H.current&&H.current.element)}))},[te,ve]),at=a.useCallback(I=>{if(!N.current)return;const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};le(y,[],"clear"),U(y),I.preventDefault()},[le,U]),jt=a.useCallback((I,y)=>{var A;U({target:N.current}),q||te((A=J.current)==null?void 0:A.element),le({syntheticEvent:y,nativeEvent:y.nativeEvent,target:N.current},I,"delete")},[le,U,te,q]),lt=a.useCallback(I=>{if(e.onExpandChange&&N.current){const{item:y,itemHierarchicalIndex:A,nativeEvent:se,syntheticEvent:we}=I,Ee={level:ei(A),item:y,nativeEvent:se,syntheticEvent:we,target:N.current};e.onExpandChange.call(void 0,Ee)}},[e.onExpandChange]),ot=a.useCallback(I=>{if(e.onFilterChange&&N.current){const A={filter:{field:e.textField,operator:"contains",value:I.target.value},syntheticEvent:I.syntheticEvent,nativeEvent:I.nativeEvent,target:N.current};e.onFilterChange.call(void 0,A),e.filter===void 0&&De(I.target.value)}},[e.onFilterChange,e.filter,e.textField]),kt=a.useCallback(I=>{if(!N.current)return;const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};e.onCancel&&e.onCancel.call(void 0,y),U(y),I.preventDefault()},[e.onCancel,U]),rt=()=>{const I=e.filterable?a.createElement(Me,{value:e.filter===void 0?X:e.filter,ref:Q,onChange:ot,onKeyDown:nt,size:ce,rounded:x,fillMode:K}):null,y={adaptiveTitle:e.adaptiveTitle,expand:G,onClose:A=>e.onCancel?kt(A):at(A),windowWidth:V,mobileFilter:I,footer:{cancelText:Se.toLanguageString(Re,ne[Re]),onCancel:A=>e.onCancel?kt(A):at(A),applyText:Se.toLanguageString(Pe,ne[Pe]),onApply:A=>U(A)}};return a.createElement(At,{...y},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:"k-list k-list-lg"},l.length>0?a.createElement(ct.TreeView,{ref:H,tabIndex:k,data:l,focusIdField:h,textField:e.textField,checkField:C,checkIndeterminateField:w,expandField:e.expandField,childrenField:D,expandIcons:!0,onItemClick:Je,onCheckChange:Je,onExpandChange:lt,checkboxes:!0,size:ce,item:e.item,dir:ee}):a.createElement(be,null,Se.toLanguageString(ge,ne[ge]))))))},Dt=a.useCallback(I=>{for(let y of I)T(y.target.clientWidth)},[]),be=e.listNoData||hs,Se=xe.useLocalization(),Oe=!S||Fe.valid,{size:ce,rounded:x,fillMode:K}=e,j=re&&G?me:P.current,ue=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-multiselecttree k-input",e.className,{[`k-input-${vs[ce]||ce}`]:ce,[`k-rounded-${Rs[x]||x}`]:x,[`k-input-${K}`]:K,"k-focus":q&&!p,"k-invalid":!Oe,"k-disabled":p,"k-loading":e.loading,"k-required":F}),tabIndex:k,accessKey:e.accessKey,id:n,style:m?{...c,width:void 0}:c,dir:ee,ref:$,onKeyDown:p?void 0:Ct,onMouseDown:wt,onFocus:Ut,onBlur:St,role:"combobox","aria-haspopup":"tree","aria-expanded":G,"aria-disabled":p,"aria-label":m,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy?e.ariaDescribedBy:"tagslist-"+n,"aria-required":e.required,onClick:p?void 0:Et},a.createElement("div",{id:"tagslist-"+n,className:d.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${vs[ce]||ce}`]:ce})},j.length>0&&a.createElement(Ht,{tag:e.tag,onTagDelete:jt,data:j,guid:n,focused:oe?P.current.find(I=>ht(I,oe,h)):void 0,size:ce})),a.createElement("span",{className:"k-input-inner"},j.length===0&&a.createElement("span",{className:"k-input-value-text"},v)),e.loading&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),de&&!p&&j.length>0&&a.createElement(et,{onClick:at}),a.createElement("select",{name:b,ref:R,tabIndex:-1,"aria-hidden":!0,title:m,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:e.valueMap?e.valueMap.call(void 0,E):E})),!re&&a.createElement(dt.Popup,{...u,popupClass:d.classNames(u.popupClass,"k-multiselecttree-popup"),className:d.classNames(u.className,{"k-rtl":ee==="rtl"}),style:yt,anchor:u.anchor||$.current,show:G,onOpen:Tt,onClose:Gt,ref:Z},e.filterable&&a.createElement(Me,{value:e.filter===void 0?X:e.filter,ref:J,onChange:ot,onKeyDown:nt,tabIndex:k,size:ce,rounded:x,fillMode:K}),l.length>0?a.createElement(ct.TreeView,{style:{height:u.height},ref:H,tabIndex:k,data:l,focusIdField:h,textField:e.textField,checkField:C,checkIndeterminateField:w,expandField:e.expandField,childrenField:D,expandIcons:!0,onItemClick:Je,onCheckChange:Je,onExpandChange:lt,checkboxes:!0,size:ce,item:e.item,dir:ee}):a.createElement(be,null,Se.toLanguageString(ge,ne[ge])))),re&&rt());return m?a.createElement(He.FloatingLabel,{label:m,editorValue:de,editorPlaceholder:v,editorValid:Oe,editorDisabled:p,editorId:n,style:{width:c?c.width:void 0},children:ue,dir:ee}):ue}),si={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,value:o.any,valueMap:o.func,placeholder:o.string,dataItemKey:o.string.isRequired,textField:o.string.isRequired,checkField:o.string,checkIndeterminateField:o.string,expandField:o.string,subItemsField:o.string,className:o.string,style:o.object,label:o.string,validationMessage:o.string,validityStyles:o.bool,valid:o.bool,required:o.bool,name:o.string,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,filterable:o.bool,filter:o.string,loading:o.bool,tags:o.arrayOf(o.shape({text:o.string,data:o.arrayOf(o.any)})),popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,onFilterChange:o.func,onExpandChange:o.func,onCancel:o.func,item:o.func,listNoData:o.func,adaptiveTitle:o.string,adaptive:o.bool};It.displayName="KendoReactMultiSelectTree",It.defaultProps=Be,It.propTypes=si;const Ge=(i,t)=>{const e={};return i&&i.length&&i.forEach(s=>{e[t(s)]=!0}),e},ii=(i,t)=>{const{items:e,dataItemKey:s,value:n,subItemsField:l="items",operation:h}=t,u=d.getter(s),c=Ge(n,u);if(h==="clear")return[];if(h==="delete"){const O=Ge(e,u);return n.filter(B=>!O[u(B)])}const r=e[0],p=u(r),f=d.getter(l),g=[...i],v=[];let m=[],b;for(;g.length;){const O=g.pop();if(p===u(O)){m=v.map(B=>B.item),b=O;break}else{v&&v.length&&v[v.length-1].parentPosition===g.length&&v.pop();const B=f(O);B&&B.length&&(v.push({item:O,parentPosition:g.length}),g.push(...B))}}const C=[...f(b)||[]];let w=[];for(;C.length;){const O=C.pop();w.push(O);const B=f(O);B&&B.length&&C.push(...B)}const D=!c[p],_=[];if(D){_.push(...n),_.push(b),_.push(...w.filter(E=>!c[u(E)]));const O=m.filter(E=>!c[u(E)]),B=Ge(_,u);for(let E=O.length-1;E>-1;E--){const F=O[E],S=f(F);if(S.filter(N=>B[u(N)]).length<S.length)break;_.push(F),B[u(F)]=!0}}else{const O=u(b),B=Ge(w,u),E=Ge(m,u);_.push(...n.filter(F=>{const S=u(F);return!B[S]&&O!==S&&!E[S]}))}return _};M.AutoComplete=ns,M.AutoCompletePropsContext=is,M.AutoCompleteWithoutContext=tt,M.ComboBox=Lt,M.ComboBoxPropsContext=ts,M.ComboBoxWithoutContext=$e,M.DropDownList=es,M.DropDownListClassComponent=qe,M.DropDownListPropsContext=Rt,M.DropDownListWithoutContext=qe,M.DropDownTree=qt,M.DropDownTreePropsContext=gs,M.List=Ve,M.ListContainer=Xe,M.ListFilter=Me,M.ListItem=Pt,M.MultiColumnComboBox=bt,M.MultiColumnComboBoxPropsContext=cs,M.MultiSelect=ds,M.MultiSelectPropsContext=rs,M.MultiSelectTree=It,M.MultiSelectTreePropsContext=ms,M.MultiSelectWithoutContext=it,M.SearchBar=ft,M.TagList=Ht,M.dropdownsMessages=ne,M.findByFieldValue=Ss,M.getItemValue=z,M.getMultiSelectTreeValue=ii,M.getValueMap=Ge,M.nodata=ge,M.scrollToItem=Xt,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
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-labels"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-treeview")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-labels","@progress/kendo-svg-icons","@progress/kendo-react-popup","@progress/kendo-react-inputs","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-treeview"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDropdowns={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactLabels,e.KendoSvgIcons,e.KendoReactPopup,e.KendoReactInputs,e.KendoReactIntl,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactTreeview)}(this,(function(e,t,s,i,a,n,o,l,r,d,p,h){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var u=c(t);let g=class extends u.Component{render(){const{children:e,width:t,dir:s,itemsCount:i,popupSettings:a}=this.props;return u.createElement(o.Popup,{style:{width:t,direction:s},contentKey:i&&i.join(),...a},e)}};const v=u.forwardRef(((e,t)=>{const s=u.useRef(null);return u.useImperativeHandle(t,(()=>s.current)),u.createElement("div",{className:"k-list-filter"},u.createElement(l.TextBox,{...e,ref:s,value:e.value||"",onChange:e.onChange,onKeyDown:e.onKeyDown,tabIndex:e.tabIndex,onClick:e=>e.stopPropagation(),size:e.size,fillMode:e.fillMode,rounded:e.rounded,prefix:()=>u.createElement(l.InputPrefix,null,u.createElement(i.IconWrap,{name:"search",icon:n.searchIcon}))}))}));v.propTypes={value:s.oneOfType([s.string,s.number,s.array]),tabIndex:s.number,onChange:s.func,onKeyDown:s.func,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"])},v.displayName="KendoReactListFilter";const m=v;let f=class extends u.Component{render(){const{group:e,groupMode:t,render:s}=this.props,i=u.createElement("div",{className:"k-list-group-sticky-header"},"classic"===t?e:u.createElement("div",{className:"k-list-header-text"},e));return void 0!==s?s.call(void 0,i,this.props):i}};const b=e=>null!=e,y=(e,t,s)=>{if(!b(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},k=(e,t,s,i,a)=>{const n=e.offsetHeight,o=t.children.item(s),l=o.offsetTop+(a?i-e.scrollTop:0),r=o.offsetHeight;if(a){let t=0;l+r>n?t=l+r-n:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>n+e.scrollTop?e.scrollTop=l+r-n:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},C=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let a=0;a<e.length;a++){const n=(I(e[a],s)||"")+"";if(n&&n.toLowerCase().startsWith(t)){i=a;break}}}return i},x=(e,t,s,i=!1)=>{const a=e=>i?e:e.toLowerCase();return e.findIndex((e=>s?a(I(e,s))===a(t):a(t)===a(e.toString())))},I=(e,t)=>{if(t&&b(e)){const s=t.split(".");let i=e;return s.forEach((e=>{i=i?i[e]:void 0})),i}return e},S=(e,t,s)=>{t.forEach((t=>{const i=e.findIndex((e=>E(e,t,s)));-1!==i&&e.splice(i,1)}))},E=(e,t,s)=>e===t||b(e)===b(t)&&I(e,s)===I(t,s),w=(e,t,s)=>{if(t){const i=x(e,t,s,!0);return-1!==i?e[i]:e[C(e,t,s)]}return e[0]},F=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},K=(e,t,s)=>!!e==!!t&&e.text===t.text&&(e===t||((e=[],t=[],s)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!E(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),D=e=>e.preventDefault();class M extends u.Component{render(){const{selected:e,defaultItem:t,textField:s}=this.props;return u.createElement("div",{onClick:this.props.onClick,onMouseDown:D,style:{position:"unset"},className:i.classNames("k-list-optionlabel",{"k-selected":e})},I(t,s)||"")}}class N extends u.Component{constructor(){super(...arguments),this.handleClick=e=>this.props.onClick(this.props.index,e)}render(){const{selected:e,group:t,dataItem:s,virtual:a,groupMode:n,disabled:o,render:l}=this.props,r=u.createElement("li",{id:this.props.id,role:"option","aria-selected":e,"aria-disabled":!!o||void 0,className:i.classNames("k-list-item",{"k-selected":e,"k-focus":this.props.focused,"k-first":!!t&&"classic"===n,"k-disabled":o}),onClick:this.handleClick,style:{position:a?"relative":"unset"}},u.createElement("span",{className:"k-list-item-text"},I(s,this.props.textField).toString()),void 0!==t&&"classic"===n?u.createElement("div",{className:"k-list-item-group-label"},t):null);return void 0!==l?l.call(void 0,r,this.props):r}}let T=class extends u.Component{render(){const{group:e,virtual:t,render:s,isMultiColumn:i=!1}=this.props,a=u.createElement("li",{id:this.props.id,role:"group",className:i?"k-table-group-row":"k-list-group-item",style:i?{boxSizing:"inherit"}:{position:t?"relative":"unset"}},u.createElement("span",{className:s?void 0:i?"k-table-th":"k-list-item-text"},e));return void 0!==s?s.call(void 0,a,this.props):a}};const P="dropdowns.nodata",O="dropdowns.clear",_="dropdowns.comboArrowBtnAriaLabelExpand",R="dropdowns.comboArrowBtnAriaLabelCollapse",z="dropdowns.dropDownListArrowBtnAriaLabel",B="dropdowns.apply",L="dropdowns.cancel",H={[O]:"clear",[P]:"NO DATA FOUND.",[_]:"expand combobox",[R]:"collapse combobox",[z]:"select",[B]:"Apply",[L]:"Cancel"};let V=class extends u.Component{renderItems(){const{textField:e,valueField:t,groupField:s,groupMode:i,isMultiColumn:a,optionsGuid:n,skip:o=0,virtual:l,focusedIndex:r,highlightSelected:d=!0,value:p,data:h,itemRender:c,groupHeaderItemRender:g}=this.props,v=Array.isArray(p);let m=0;return h.map(((f,b)=>{const y=o+b,k=o+b+m,C=!f.disabled&&(d&&(!v&&E(f,p,t)||v&&-1!==p.findIndex((e=>E(e,f,t)))));let x,S,w;return b>0&&void 0!==s&&(S=I(f,s),w=I(h[b-1],s),S&&w&&S!==w&&(x=S)),void 0!==x&&"modern"===i&&(m+=1),[void 0!==x&&"modern"===i&&u.createElement(T,{id:`option-${n}-${k}`,virtual:l,key:y+"-group-item",group:x,isMultiColumn:a,render:g}),u.createElement(N,{id:`option-${n}-${void 0!==x&&"modern"===i?k+1:k}`,virtual:l,dataItem:f,groupMode:i,selected:C,focused:r===b,index:y,key:y,onClick:this.props.onClick,textField:e,group:x,render:c,disabled:f.disabled})]}))}renderNoValueElement(e){const t=this.props.noDataRender,s=u.createElement("div",{className:"k-nodata"},u.createElement("div",null,e.toLanguageString(P,H[P])));return t?t.call(void 0,s):s}render(){const e=r.provideLocalizationService(this),{id:t,show:s,wrapperCssClass:i,wrapperStyle:a,listStyle:n,listRef:o,wrapperRef:l,listClassName:d="k-list-ul",ariaSetSize:p}=this.props,h=this.renderItems();return h.length?u.createElement("div",{className:i,style:a,ref:l,onMouseDown:this.props.onMouseDown,onBlur:this.props.onBlur,onScroll:this.props.onScroll,unselectable:"on"},u.createElement("ul",{id:t,role:"listbox","aria-hidden":!s||void 0,"aria-setsize":p,className:d,ref:o,style:n},h),this.props.scroller&&u.createElement("div",{className:"k-height-container"},this.props.scroller)):this.renderNoValueElement(e)}};r.registerForLocalization(V);class q{constructor(){this.container=null,this.scrollElement=null,this.list=null,this.containerHeight=0,this.skip=0,this.total=0,this.enabled=!1,this.pageSize=0,this.itemHeight=0,this.PageChange=null,this.prevScrollPos=0,this.listTranslate=0,this.scrollSyncing=!1,this.scrollerRef=e=>{const t=this;t.container=e,e&&(e.setAttribute("unselectable","on"),window.setTimeout(t.calcScrollElementHeight.bind(t),0))},this.calcScrollElementHeight=()=>{this.scrollSyncing=!0;let e=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight,this.containerHeight=Math.min(1533915,this.itemHeight*this.total);const t=this.containerHeight;return this.scrollElement&&(e=this.scrollElement.style.height!==t+"px",e&&(this.scrollElement.style.height=t+"px")),this.scrollSyncing=!1,e},this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}changePage(e,t){const s=Math.min(Math.max(0,e),this.total-this.pageSize);s!==this.skip&&this.PageChange&&this.PageChange({skip:s,take:this.pageSize},t)}translateTo(e){this.listTranslate=e,this.list&&(this.list.style.transform="translateY("+e+"px)")}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0))}scrollToEnd(){this.container&&this.list&&(this.calcScrollElementHeight(),this.container.scrollTop=this.container.scrollHeight-this.container.offsetHeight,this.translateTo(this.container.scrollHeight))}localScrollUp(e){const t=this.itemHeight,s=this.container.scrollTop;let i,a=this.listTranslate,n=s-a;if(!(n>t)){for(i=0;i<this.skip&&!(a+t+n<=s);i++)a-=t;if(a=this.validateTranslate(a),this.skip-i<=0&&a>=s)return this.translateTo(0),this.changePage(0,e),void(this.container.scrollTop=0);a!==this.listTranslate&&(this.translateTo(a),this.changePage(this.skip-i,e))}}localScrollDown(e){const t=this.itemHeight;let s=this.container.scrollTop,i=this.listTranslate;const a=this.list.children.length;let n;for(n=0;n<a&&!(i+t>=s);n++)i+=t;i=this.validateTranslate(i),n>=a&&this.skip+n>=this.total?(this.translateTo(i),this.changePage(this.total-1,e)):i!==this.listTranslate&&(this.translateTo(i),this.changePage(this.skip+n,e))}scrollNonStrict(e){const t=this.total*this.prevScrollPos/this.containerHeight,s=Math.min(Math.floor(t),this.total-1);let i=this.containerHeight*t/this.total;i=this.validateTranslate(i),this.translateTo(i),this.changePage(s,e)}scrollHandler(e){const t=this.container?this.container.scrollTop:0,s=this.prevScrollPos;this.prevScrollPos=t,this.enabled&&this.list&&this.container&&!this.scrollSyncing&&(t-s<=0&&t>this.listTranslate-this.list.scrollHeight/10?this.localScrollUp(e):t-s>0&&t<this.listTranslate+2*this.list.scrollHeight/3?this.localScrollDown(e):this.scrollNonStrict(e))}validateTranslate(e){return e=Math.max(0,e),e=Math.min(this.containerHeight,e)}}let W=class{navigate(e){const t=e.keyCode;return t===i.Keys.up||t===i.Keys.left?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:-1}):t===i.Keys.down||t===i.Keys.right?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:1}):t===i.Keys.home?0:t===i.Keys.end?e.max:void 0}next(e){return b(e.current)?Math.min(e.max,Math.max(e.current+e.step,e.min)):e.min}};const A=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new q,this.navigation=new W,this.handleItemClick=(e,t)=>{const s=this.initState();s.syntheticEvent=t,t.stopPropagation(),this.component.handleItemSelect(e,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=e=>{if(!this.component.state.focused){const t=this.initState();t.data.focused=!0,t.events.push({type:"onFocus"}),t.syntheticEvent=e,this.applyState(t)}},this.filterChanged=(e,t)=>{const{textField:s,filterable:i}=this.component.props;i&&t.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:e}})},this.togglePopup=e=>{const t=this.component.props,s=void 0!==t.opened?t.opened:this.component.state.opened;void 0===t.opened&&(e.data.opened=!s),s?e.events.push({type:"onClose"}):(e.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(e,t)=>{const s=this.initState();s.syntheticEvent=t,this.triggerOnPageChange(s,e.skip,e.take),this.applyState(s)},this.scrollToVirtualItem=(e,t)=>{const s=this.vs;if(s.enabled=!1,0===e.skip)s.reset();else if(e.skip+e.pageSize===e.total)s.scrollToEnd();else{let i=s.translate;0===i&&(s.calcScrollElementHeight(),i=s.itemHeight*e.skip,s.translateTo(i-s.itemHeight)),s.container&&(s.container.scrollTop=i),this.scrollToItem(t,!0)}window.setTimeout((()=>s.enabled=!0),10)},this.scrollPopupByPageSize=e=>{var t,s,i,a,n,o;const l=this.vs,r=null==(s=null==(t=this.list)?void 0:t.parentElement)?void 0:s.scrollTop,d=l.enabled&&l.itemHeight?l.itemHeight:this.list?this.list.children[0].offsetHeight:0,p=null==(a=null==(i=this.list)?void 0:i.parentElement)?void 0:a.offsetHeight;void 0!==r&&void 0!==p&&(null==(o=null==(n=this.list)?void 0:n.parentElement)||o.scroll({top:r+e*Math.floor(p/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&u.createElement("div",{ref:t=>e.scrollElement=t,key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({...t.state,group:e})},this.listBoxId=e.props.id+"list",this.guid=e.props.id,this.component=e,this.vs.PageChange=this.pageChange}didMount(){const e=this.component.props,t=e.popupSettings||{},s=e.style||{},i=t.width;let a=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),a=!0),a&&this.component.forceUpdate()}calculateDir(){const e=this.component.element;e&&e.ownerDocument&&e.ownerDocument.defaultView&&(this.dirCalculated=e.ownerDocument.defaultView.getComputedStyle(e).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(e,t,s){const i=this.list||this.vs.list;if(!i&&!s&&setTimeout((()=>{this.scrollToItem(e,t,!0)}),10),i&&e>=0){const s=this.vs,a=s.container||i.parentNode,n=void 0!==t?t:s.enabled;k(a,i,e,s.translate,n)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(e){Object.keys(e.data).length>0&&this.component.setState(e.data);const t={syntheticEvent:e.syntheticEvent,nativeEvent:e.syntheticEvent?e.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};e.events.forEach((e=>{const s=e.type;delete e.type;const i=s&&this.component.props[s];i&&i.call(void 0,{...t,...e})}))}triggerOnPageChange(e,t,s){const i=this.component.props.virtual;if(i){const a=Math.min(Math.max(0,t),Math.max(0,i.total-s));a!==i.skip&&e.events.push({type:"onPageChange",page:{skip:a,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:a,virtual:n}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&n&&this.vs.enabled&&(n.skip>0&&E(e,i[0],a)?this.triggerOnPageChange(t,n.skip-1,n.pageSize):!o&&n.skip+n.pageSize<n.total&&E(e,i[i.length-1],a)&&this.triggerOnPageChange(t,n.skip+1,n.pageSize))}getPopupSettings(){return Object.assign({},e.defaultProps.popupSettings,this.component.props.popupSettings)}getGroupedDataModernMode(e,t){let s=[];return e.forEach(((i,a)=>{e[a-1]&&i[t]!==e[a-1][t]&&s.push({[t]:i[t]}),s.push(e[a])})),s}};A.basicPropTypes={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,textField:s.string,className:s.string,label:s.string,loading:s.bool,popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,itemRender:s.func,listNoDataRender:s.func,focusedItemIndex:s.func,header:s.node,footer:s.node},A.propTypes={...A.basicPropTypes,value:s.any,defaultValue:s.any,filterable:s.bool,filter:s.string,virtual:s.shape({pageSize:s.number.isRequired,skip:s.number.isRequired,total:s.number.isRequired}),onFilterChange:s.func,onPageChange:s.func},A.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let $=A;const U={name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654528156,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},G=500,j=768,{sizeMap:Y,roundedMap:J}=i.kendoThemeMaps,Q=class e extends u.Component{constructor(e){super(e),this.state={},this._element=null,this.base=new $(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus()},this.handleItemSelect=(e,t)=>{const{data:s=[],virtual:i,dataItemKey:a,defaultItem:n}=this.props,o=i?i.skip:0,l=-1===e&&void 0!==n?n:s[e-o],r=!E(l,this.value,a);this.triggerOnChange(l,t),r&&this.base.triggerPageChangeCornerItems(l,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.dummySelect=e=>u.createElement("select",{name:this.props.name,ref:e=>{this._select=e},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},u.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,e):e})),this.renderListContainer=()=>{const{header:e,footer:t,dir:s,data:a=[],size:n,groupField:o,groupStickyHeaderItemRender:l,list:r}=this.props,d=this.base,p=d.getPopupSettings(),h=void 0!==this.props.opened?this.props.opened:this.state.opened,c=void 0!==p.width?p.width:d.popupWidth,v={dir:void 0!==s?s:d.dirCalculated,width:c,popupSettings:{...p,popupClass:i.classNames(p.popupClass,"k-list-container","k-dropdownlist-popup"),anchor:p.anchor||this.element,show:h,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[a.length]};let{group:m}=this.state;return void 0===m&&void 0!==o&&(m=I(a[0],o)),u.createElement(g,{...v},this.renderListFilter(),e&&u.createElement("div",{className:"k-list-header"},e),u.createElement("div",{className:i.classNames("k-list",{[`k-list-${Y[n]||n}`]:n,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!r&&m&&0!==a.length&&u.createElement(f,{group:m,groupMode:"modern",render:l}),this.renderList()),t&&u.createElement("div",{className:"k-list-footer"},t))},this.renderList=()=>{const{data:e=[],textField:t,dataItemKey:s,virtual:i={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:n,itemRender:o}=this.props,l=this.base.vs,r=i.skip,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.getPopupSettings(),h=`translateY(${l.translate}px)`;return u.createElement(V,{id:this._listboxId,show:d,data:e.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:t,valueField:s,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>l.list=this.base.list=e,wrapperStyle:{maxHeight:p.height},wrapperCssClass:"k-list-content",listStyle:l.enabled?{transform:h}:void 0,key:"listkey",skip:r,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:a,noDataRender:n,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:i.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let{data:a=[]}=this.props;if(i&&a.length&&i){const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;a=this.base.getGroupedDataModernMode(a,i);let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&this.setState({group:l})}},this.renderListFilter=()=>{const e=void 0!==this.props.filter?this.props.filter:this.state.text;return this.props.filterable&&u.createElement(m,{value:e,ref:e=>this._filterInput=e&&e.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.renderDefaultItem=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=this.props;return void 0!==t&&u.createElement(M,{defaultItem:t,textField:e,selected:E(this.value,t,s),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=e=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout((()=>this.searchState.word=""),this.props.delay),this.selectNext(e))},this.selectNext=e=>{const{data:t=[],dataItemKey:s}=this.props;let i=t.map(((e,t)=>({item:e,itemIndex:t})));const a=this.searchState.word,n=this.searchState.last,o=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(a,n);let l,r=i.length,d=Math.max(0,t.findIndex((e=>E(e,this.value,s))));this.props.defaultItem&&(l={item:this.props.defaultItem,itemIndex:-1},r+=1,d+=1),d+=o?1:0,i=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(i,d,l);let p,h,c,u=0;const{textField:g,ignoreCase:v}=this.props;for(;u<r;u++)if(p=I(i[u].item,g),h=o&&y(p,n,v),c=y(p,a,v),h||c){u=i[u].itemIndex;break}if(u!==r){const t=this.base.initState();t.syntheticEvent=e,this.handleItemSelect(u,t),this.applyState(t),this._valueDuringOnChange=void 0}},this.handleKeyDown=e=>{e&&e.target instanceof Element&&"INPUT"===e.target.nodeName&&e.stopPropagation&&e.stopPropagation();const{data:t=[],filterable:s,disabled:a,defaultItem:n,leftRightKeysNavigation:o=!0,virtual:l={skip:0,total:0,pageSize:0},dataItemKey:r,groupField:d="",textField:p,skipDisabledItems:h=!0}=this.props,c=this.value,u=t.findIndex((e=>E(e,c,r))),g=void 0!==this.props.opened?this.props.opened:this.state.opened,v=e.keyCode,m=v===i.Keys.home||v===i.Keys.end,f=v===i.Keys.up||v===i.Keys.down,b=!g&&(e.altKey&&v===i.Keys.down||v===i.Keys.enter||v===i.Keys.space),y=g&&(e.altKey&&v===i.Keys.up||v===i.Keys.esc),k=o&&(v===i.Keys.left||v===i.Keys.right),C=f||k&&!s||m,x=this.base.initState();if(x.syntheticEvent=e,!a){if(m&&this.base.vs.enabled)v===i.Keys.home?0!==l.skip?(this.base.triggerOnPageChange(x,0,l.pageSize),this._navigated=!0):this.triggerOnChange(t[0],x):l.skip<l.total-l.pageSize?(this.base.triggerOnPageChange(x,l.total-l.pageSize,l.pageSize),this._navigated=!0):this.triggerOnChange(t[t.length-1],x);else if(g&&v===i.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(g&&v===i.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(g&&v===i.Keys.enter){const s=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(t,s)?(this.triggerOnChange(null,x),this.applyState(x)):this.handleItemSelect(s,x),this.base.togglePopup(x),e.preventDefault()}else if(b||y)y&&this.resetValueIfDisabledItem(),this.base.togglePopup(x),e.preventDefault();else if(C){if(this._lastKeypressIsFilter=!1,""!==d&&p)if(!h&&g)this.onNavigate(x,v);else{let e;if(v===i.Keys.down||v===i.Keys.right){const s=t.slice(u+1).find((e=>!e.disabled&&e[p]));e=s&&t.findIndex((e=>e[p]===s[p]))}else if(v===i.Keys.up||v===i.Keys.left){let s;if(0===u&&n)e=-1;else if(-1===u)s=t,e=t.findIndex((e=>!e.disabled&&e[p]));else{s=t.slice(0,u);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&t.findIndex((e=>e[p]===i[p]))}}if(void 0!==e){const t=e-u;this.onNavigate(x,v,t)}else void 0===e&&t.findIndex((e=>e[p]===c[p]))===t.length-1&&this.onNavigate(x,v)}else if(!h&&g||m)this.onNavigate(x,v);else if(p){let e;if(v===i.Keys.down||v===i.Keys.right){const s=t.slice(u+1).find((e=>!e.disabled&&e[p]));e=s&&t.findIndex((e=>e[p]===s[p]))}else if(v===i.Keys.up||v===i.Keys.left){let s;if(0===u&&n)e=-1;else if(-1===u)s=t,e=t.find((e=>!e.disabled&&e[p]));else{s=t.slice(0,u);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&t.findIndex((e=>e[p]===i[p]))}}if(void 0!==e){const t=e-u;this.onNavigate(x,v,t)}else void 0===e&&t.findIndex((e=>e[p]===c[p]))===t.length-1&&this.onNavigate(x,v)}else this.onNavigate(x,v);e.preventDefault()}this.applyState(x)}},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.handleBlur=e=>{if(this._skipFocusEvent||!this.state.focused)return;const t=void 0!==this.props.opened?this.props.opened:this.state.opened,{adaptive:s}=this.props,{windowWidth:i=0}=this.state,a=i<=j&&s,n=this.base.initState();n.syntheticEvent=e,n.data.focused=!1,n.events.push({type:"onBlur"}),t&&this.resetValueIfDisabledItem(),t&&!a&&this.base.togglePopup(n),this.applyState(n)},this.handleDefaultItemClick=e=>{const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.triggerOnChange(this.props.defaultItem,t),this.applyState(t)},this.handleWrapperClick=e=>{if(e.isPropagationStopped())return;const t=this.base.initState();t.syntheticEvent=e,this.state.focused||(t.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(t),this.applyState(t)},this.handleKeyPress=e=>{if(this.props.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);this.props.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),this.searchState={word:this.searchState.word+t,last:this.searchState.last+t},this.search(e)},this.handleListFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,void 0===this.props.filter&&(t.data.text=e.target.value),this.base.filterChanged(e.target.value,t),this._lastKeypressIsFilter=!0,this.applyState(t),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout((()=>{this._filterInput&&this.focusElement(this._filterInput)}),300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout((()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)}))},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please select a value from the list!")},i.validatePackage(U)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let e;return void 0!==this._valueDuringOnChange?e=this._valueDuringOnChange:void 0!==this.props.value?e=this.props.value:void 0!==this.state.value?e=this.state.value:void 0!==this.props.defaultValue&&(e=this.props.defaultValue),!b(e)&&void 0!==this.props.defaultItem&&(e=this.props.defaultItem),e}get index(){const{data:e=[],dataItemKey:t}=this.props,s=this.value;return e.findIndex((e=>E(e,s,t)))}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&""!==this.value&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{dataItemKey:i,virtual:a,groupField:n="",textField:o}=this.props,{data:l=[]}=this.props,r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,h=!p&&d;if(this.base.getPopupSettings().animate||h&&this.onPopupOpened(),a&&a.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=this.value,c=void 0!==e.value?e.value:t.value;let u=l.findIndex((e=>E(e,r,i)));""!==n&&r&&o&&(u=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(r[o]));const g=!E(c,r,i);h&&a?this.base.scrollToVirtualItem(a,u):h&&!a?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(u)):d&&p&&r&&g&&!this._navigated?this.base.scrollToItem(u):d&&p&&this._navigated&&(this._navigated&&a&&0===a.skip?this.base.vs.reset():this._navigated&&a&&a.skip===a.total-a.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const e=r.provideLocalizationService(this).toLanguageString(z,H[z]),{style:t,className:s,label:o,dir:l,virtual:p,size:h,rounded:c,fillMode:g,adaptive:v}=this.props,{windowWidth:m=0}=this.state,f=void 0!==this.props.opened?this.props.opened:this.state.opened,b=this.value,y=I(b,this.props.textField),k=!this.validityStyles||this.validity.valid,C=this.base,x=C.vs,S=m<=j&&v;x.enabled=void 0!==p,void 0!==p&&(C.vs.skip=p.skip,C.vs.total=p.total,C.vs.pageSize=p.pageSize);const{dataItemKey:w,data:F=[],disabled:K,tabIndex:D,loading:M,iconClassName:N,svgIcon:T,valueRender:P}=this.props,{focused:O}=this.state,_=F.findIndex((e=>E(e,b,w))),R=u.createElement("span",{id:this._inputId,className:"k-input-inner"},u.createElement("span",{className:"k-input-value-text"},y)),B=void 0!==P?P.call(void 0,R,b):R,L=u.createElement(u.Fragment,null,u.createElement("span",{ref:this.componentRef,className:i.classNames("k-dropdownlist k-picker",s,{[`k-picker-${Y[h]||h}`]:h,[`k-rounded-${J[c]||c}`]:c,[`k-picker-${g}`]:g,"k-focus":O,"k-disabled":K,"k-invalid":!k,"k-loading":M,"k-required":this.required}),style:o?{...t,width:void 0}:t,dir:l,onMouseDown:f?e=>{"INPUT"!==e.target.nodeName&&(this.focusElement(this.base.wrapper),e.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:i.getTabIndex(D,K),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:K?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":K||void 0,"aria-haspopup":"listbox","aria-expanded":f||!1,"aria-owns":this._listboxId,"aria-activedescendant":f?"option-"+this._guid+"-"+(_+(p?p.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,id:this.props.id,title:this.props.title},B,M&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":e,"aria-hidden":!0,size:h,fillMode:g,iconClass:N,className:"k-input-button",rounded:null,themeColor:"base",icon:N?void 0:"caret-alt-down",svgIcon:T||n.caretAltDownIcon,onMouseDown:e=>this.state.focused&&e.preventDefault()}),this.dummySelect(b),!S&&this.renderListContainer()),S&&this.renderAdaptiveListContainer());return o?u.createElement(a.FloatingLabel,{label:o,editorValue:y,editorValid:k,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:L}):L}onNavigate(e,t,s){const{data:i=[],defaultItem:a,dataItemKey:n,virtual:o={skip:0,total:0,pageSize:0}}=this.props,l=this.base.vs,r=this.value,d=i.findIndex((e=>E(e,r,n))),p=this.base.navigation.navigate({current:o.skip+d,max:(l.enabled?o.total:i.length)-1,min:void 0!==a?-1:0,keyCode:t,skipItems:s||void 0});void 0!==p&&this.handleItemSelect(p,e),this.applyState(e)}renderAdaptiveListContainer(){const{windowWidth:e=0}=this.state,{header:t,footer:s,size:a,adaptiveTitle:o,groupField:l,groupStickyHeaderItemRender:r,list:h,data:c=[]}=this.props,g={navigatable:!1,navigatableElements:[],expand:void 0!==this.props.opened?this.props.opened:this.state.opened,animation:!0,onClose:e=>this.handleWrapperClick(e),animationStyles:e<=G?{top:0,width:"100%",height:"100%"}:void 0,className:e<=G?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};let{group:v}=this.state;return void 0===v&&void 0!==l&&(v=I(c[0],l)),u.createElement(p.ActionSheet,{...g},u.createElement(p.ActionSheetHeader,{className:"k-text-center"},u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",null,o)),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:n.xIcon}))),u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderListFilter())),u.createElement(p.ActionSheetContent,{className:"!k-overflow-hidden"},t&&u.createElement("div",{className:"k-list-header"},t),u.createElement("div",{className:i.classNames("k-list",{[`k-list-${Y[a]||a}`]:a,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!h&&v&&0!==c.length&&u.createElement(f,{group:v,groupMode:"modern",render:r}),this.renderList()),s&&u.createElement("div",{className:"k-list-footer"},s)))}getFocusedIndex(){const e=this.value,{data:t=[],textField:s,dataItemKey:i,virtual:a={skip:0},focusedItemIndex:n=C,filterable:o,skipDisabledItems:l=!0}=this.props,r=this.props.filter?this.props.filter:this.state.text;return l&&s&&!r&&!e?t.findIndex((e=>!e.disabled&&e[s])):b(e)&&void 0===r||o&&""===r?t.findIndex((t=>E(t,e,i))):r?this._lastKeypressIsFilter?n(t,r,s):t.findIndex((t=>E(t,e,i))):0===a.skip?0:-1}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),30)}triggerOnChange(e,t){E(this.value,e,this.props.dataItemKey)||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}resetValueIfDisabledItem(){const{data:e=[]}=this.props,t=this.base.initState(),s=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(e,s)&&(this.triggerOnChange(null,t),this.applyState(t))}haveFocusedItemAndDataNotEmpty(e,t){return void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled}};Q.displayName="DropDownList",Q.propTypes={delay:s.number,ignoreCase:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,defaultItem:s.any,valueRender:s.func,valueMap:s.func,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,ariaLabel:s.string,leftRightKeysNavigation:s.bool,title:s.string,groupField:s.string,list:s.any,skipDisabledItems:s.bool,...$.propTypes},Q.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...$.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};let X=Q;const Z=i.createPropsContext(),ee=i.withIdHOC(i.withPropsContext(Z,X));ee.displayName="KendoReactDropDownList";let te=class extends u.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:a,suggestedText:n,focused:o}=this.props,l=this.input,r=t!==a||n!==s,d=r&&t.startsWith(a)&&!(s&&n&&s.endsWith(n)),p=i.getActiveElement(document);o&&l&&p!==l&&l.focus(),n&&r&&!d&&l&&l.setSelectionRange(a.length-n.length,a.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:i}=this.props,a=u.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:e=>this._input=e,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":t||void 0,disabled:t||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":e,"aria-owns":this.props.owns,"aria-activedescendant":e?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-required":this.props.ariaRequired});return i?i.call(void 0,a):a}},se=class extends u.Component{constructor(){super(...arguments),this.onMouseDown=e=>e.preventDefault()}render(){const e=r.provideLocalizationService(this).toLanguageString(O,H[O]);return u.createElement("span",{className:"k-clear-value",role:"button",onClick:this.props.onClick,onMouseDown:this.onMouseDown,tabIndex:-1,title:e,key:"clearbutton"},u.createElement(i.IconWrap,{name:"x",icon:n.xIcon}))}};r.registerForLocalization(se);const ie=i.useCustomComponent,{sizeMap:ae,roundedMap:ne}=i.kendoThemeMaps,oe=class e extends u.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{data:s=[],virtual:i,dataItemKey:a}=this.props,n=s[e-(i?i.skip:0)],o=!E(n,this.value,a);this.triggerOnChange(n,t),void 0!==this.state.text&&(t.data.text=void 0),o&&this.base.triggerPageChangeCornerItems(n,t)},this.onPopupOpened=()=>{setTimeout((()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)}),300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{data:t=[],skipDisabledItems:s,textField:i}=this.props,a=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(i,t,a),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!s&&i&&n&&this.clearValueOnToggleBtnClick(e),this.base.togglePopup(l),!o&&this.mobileMode){const e=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(e,l)}this.applyState(l)},this.renderMobileListFilter=()=>{const e=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text,t=I(this.value,this.props.textField),s=b(e)?e:t;return u.createElement(m,{value:s,ref:e=>this._adaptiveFilterInput=e&&e.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=e=>{const t=this.base.initState();t.syntheticEvent=e.syntheticEvent,t.data.text=e.target.value,this.base.filterChanged(e.target.value,t),this.applyState(t)},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let{data:a=[]}=this.props;if(!i||!a.length)return;const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;"modern"===this.props.groupMode&&(a=this.base.getGroupedDataModernMode(a,i));let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&(this.setState({group:l}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:l}))},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.handleBlur=e=>{if(this.state.focused&&!this._skipBlur){const t=this.base.initState(),{textField:s,data:i=[]}=this.props,a=this.getFocusedIndex(),n=!(-1===a)&&this.getCurrentValueDisabledStatus(s,i,a);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&n&&this.clearValueOnBlur(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,t)}},this.onInputClick=e=>{const t=void 0!==this.props.opened?this.props.opened:this.state.opened,s=void 0!==this.props.adaptiveFilter?this.props.adaptiveFilter:this.state.text||null;if(!t&&this.mobileMode){const t=this.base.initState();t.syntheticEvent=e,this.base.togglePopup(t),this.base.filterChanged(s,t),this.applyState(t)}},this.onInputKeyDown=e=>{const{data:t=[],skipDisabledItems:s,textField:a,dataItemKey:n,groupField:o}=this.props,l=this.value,r=Math.max(0,t.findIndex((e=>E(e,l,n)))),d=e.keyCode,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=this.base.initState();if(h.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==o&&a)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=0;if(d===i.Keys.down||d===i.Keys.right){const s=t.slice(r+1<t.length?r+1:r).find((e=>!e.disabled&&e[a]));e=s&&t.findIndex((e=>e[a]===s[a]))}else if(d===i.Keys.up||d===i.Keys.left){let s;if(0===r)s=t,e=t.findIndex((e=>!e.disabled&&e[a]));else{s=t.slice(0,r);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&t.findIndex((e=>e[a]===i[a]))}}if(void 0!==e){const t=e-r;this.onNavigate(h,d,t)}else void 0===e&&t.findIndex((e=>e[a]===l[a]))===t.length-1&&this.onNavigate(h,d)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=null;if(d===i.Keys.down||d===i.Keys.right)e=t.slice(r+1).find((e=>!e.disabled));else if(d===i.Keys.up||d===i.Keys.left){const s=t.slice(0,r);for(e=s.pop();e&&e.disabled;)e=s.pop()}if(e){const t=e.id-r-1;this.onNavigate(h,d,t)}else this.onNavigate(h,d)}this.applyState(h)}const c=()=>{e.preventDefault(),this.base.togglePopup(h),this.applyState(h)},u=this.getFocusedIndex(),g=-1===u,v=!g&&this.getCurrentValueDisabledStatus(a,t,u);p?d===i.Keys.pageUp?this.base.scrollPopupByPageSize(-1):d===i.Keys.pageDown?this.base.scrollPopupByPageSize(1):e.altKey&&d===i.Keys.up?c():d===i.Keys.enter?(e.preventDefault(),(a&&!g&&e.currentTarget.value?t[u][a]:void 0)?!s&&a&&v?this.clearValueOnEnterOrEsc(e):v||this.applyValueOnEnter(e.currentTarget.value,h):this.applyValueOnEnter(e.currentTarget.value,h)):d===i.Keys.esc&&(!s&&a&&v&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,h)):p||d!==i.Keys.esc?e.altKey&&d===i.Keys.down&&c():this.clearValueOnEnterOrEsc(e)},this.inputOnChange=e=>{const t=this.base.initState();t.syntheticEvent=e;const s=void 0!==this.props.opened?this.props.opened:this.state.opened,i=e.currentTarget,a=i.value;if(this.props.suggest){const e=i.selectionEnd===a.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;b(t)||(t=I(this.value,this.props.textField)||"");const s=t&&t===a,n=t&&t.length>a.length;s||n||!e?this._suggested="":this.suggestValue(a)}void 0===this.props.filter&&(t.data.text=a),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s||this.base.togglePopup(t),this.base.filterChanged(a,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnBlur=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=e=>{this.base.initState().syntheticEvent=e,e.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},i.validatePackage(U)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=j&&this.props.adaptive)}get value(){return void 0!==this._valueDuringOnChange?this._valueDuringOnChange:void 0!==this.props.value?this.props.value:void 0!==this.state.value?this.state.value:void 0!==this.props.defaultValue?this.props.defaultValue:void 0}get index(){const{data:e=[],dataItemKey:t}=this.props,s=this.value;return e.findIndex((e=>E(e,s,t)))}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&""!==this.value&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{dataItemKey:i,virtual:a,groupField:n="",data:o=[],textField:l}=this.props,r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,h=!p&&d,c=this.value;if(this._valueOnDidUpdate=c,a&&a.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=void 0!==e.value?e.value:t.value;let u=o.findIndex((e=>E(e,c,i)));"modern"===this.props.groupMode&&l&&c&&(u=null==(s=this.base.getGroupedDataModernMode(o,n))?void 0:s.map((e=>e[l])).indexOf(c[l]));const g=!E(r,c,i);h&&a?this.base.scrollToVirtualItem(a,u):h&&!a?(this.onPopupOpened(),o&&0!==o.length&&this.base.resetGroupStickyHeader(o[0][n],this),this.base.scrollToItem(u)):d&&p&&c&&g&&this.base.scrollToItem(u)}h&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const t=r.provideLocalizationService(this).toLanguageString(_,H[_]),s=r.provideLocalizationService(this).toLanguageString(R,H[R]),{dir:o,disabled:l,clearButton:p=e.defaultProps.clearButton,label:h,textField:c,adaptive:g,className:v,style:m,loading:f,iconClassName:y,virtual:k,size:C,rounded:x,fillMode:S,opened:E=this.state.opened,placeholder:w,svgIcon:F}=this.props,{windowWidth:K=0}=this.state,D=!this.validityStyles||this.validity.valid,M=void 0!==this.props.filter?this.props.filter:this.state.text,N=I(this.value,c),T=b(M)?M:N,P=p&&(!!T||b(this.value)),O=this.base.vs,z=this.props.id||this._inputId,B=K<=j&&g;O.enabled=void 0!==k,void 0!==k&&(O.skip=k.skip,O.total=k.total,O.pageSize=k.pageSize);const[L,V]=ie(this.props.prefix||u.Fragment),[q,W]=ie(this.props.suffix||u.Fragment),A=u.createElement(u.Fragment,null,u.createElement("span",{className:i.classNames("k-combobox k-input",{[`k-input-${ae[C]||C}`]:C,[`k-rounded-${ne[x]||x}`]:x,[`k-input-${S}`]:S,"k-invalid":!D,"k-loading":f,"k-required":this.required,"k-disabled":l},v),ref:this.componentRef,style:h?{...m,width:void 0}:m,dir:o},this.props.prefix&&u.createElement(L,{...V}),this.renderSearchBar(T||"",z,w),P&&!f&&u.createElement(se,{onClick:this.clearButtonClick,key:"clearbutton"}),f&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading",key:"loading"}),this.props.suffix&&u.createElement(q,{...W}),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":E?s:t,icon:y?void 0:"caret-alt-down",svgIcon:F||n.caretAltDownIcon,iconClass:y,size:C,fillMode:S,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!B&&this.renderListContainer()),B&&this.renderAdaptiveListContainer());return h?u.createElement(a.FloatingLabel,{label:h,editorId:z,editorValue:T,editorValid:D,editorDisabled:l,style:{width:m?m.width:void 0},children:A}):A}onNavigate(e,t,s){const{data:i=[],virtual:a={skip:0}}=this.props,n=this.props.filter?this.props.filter:this.state.text,o=this.getFocusedIndex(),l=this.base.vs,r=this.value;if(this._suggested="",-1===o||b(r))if(""===n)this.handleItemSelect(0,e);else{const n=a.skip+o,r=this.base.navigation.navigate({keyCode:t,current:n,max:(l.enabled?l.total:i.length)-1,min:0,skipItems:s||void 0});void 0!==r&&this.handleItemSelect(r,e)}else this.handleItemSelect(o,e)}getCurrentValueDisabledStatus(e,t,s){return e&&t&&t[s]&&t[s].disabled}applyValueOnEnter(e,t){const{data:s=[],textField:i,allowCustom:a}=this.props,n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,i)===e?this.index:x(s,e,i),l=-1!==o;let r;if(this._suggested="",l)r=s[o];else{if(!a)return this.selectFocusedItem(e,t);r=void 0!==i?{[i]:e}:e}this.triggerOnChange(r,t),n&&this.base.togglePopup(t),void 0===this.props.filter&&void 0!==this.state.text&&(t.data.text=void 0),this.applyState(t)}applyValueOnRejectSuggestions(e,t){const{data:s=[],textField:i,allowCustom:a}=this.props,n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,i),l=this.state.windowWidth&&this.state.windowWidth<=j;if(this._suggested="",e===o||""===e&&!b(o))return n&&!l&&this.base.togglePopup(t),this.applyState(t);const r=x(s,e,i,!0);let d=null;-1!==r?d=s[r]:a&&(d=e?i?{[i]:e}:e:null),this.triggerOnChange(d,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),n&&!l&&this.base.togglePopup(t),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{data:i=[],textField:a,virtual:n={skip:0},focusedItemIndex:o=C}=this.props,l=n.skip,r=""===e&&0===l?0:o(i,e,a);return-1!==r?this.handleItemSelect(r+l,t):(this.triggerOnChange(null,t),void 0!==this.state.text&&(t.data.text=void 0)),s&&this.base.togglePopup(t),this.applyState(t)}renderAdaptiveListContainer(){const{windowWidth:e=0}=this.state,{header:t,footer:s,size:a,data:o=[],groupField:l,groupMode:r,list:h,virtual:c,adaptiveTitle:g,groupStickyHeaderItemRender:v}=this.props,m=void 0!==this.props.opened?this.props.opened:this.state.opened;let{group:b}=this.state;void 0===b&&void 0!==l&&(b=I(o[0],l));const y={navigatable:!1,navigatableElements:[],expand:m,animation:!0,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=G?{top:0,width:"100%",height:"100%"}:void 0,className:e<=G?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return u.createElement(p.ActionSheet,{...y},u.createElement(p.ActionSheetHeader,{className:"k-text-center"},u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",null,g)),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.toggleBtnClick,icon:"x",svgIcon:n.xIcon}))),u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderMobileListFilter())),u.createElement(p.ActionSheetContent,{className:"!k-overflow-hidden"},u.createElement("div",{className:"k-list-container"},u.createElement("div",{className:i.classNames({"k-list":!h,"k-list-lg":!0,"k-virtual-list":c,"k-data-table":h,[`k-table-${ae[a]||a}`]:h&&a})},t&&u.createElement("div",{className:"k-table-header"},t),!h&&b&&0!==o.length&&u.createElement(f,{group:b,groupMode:r,render:v}),this.renderList(),s&&u.createElement("div",{className:"k-list-footer"},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,data:n=[],groupField:o,groupMode:l,size:r,list:d,virtual:p,groupStickyHeaderItemRender:h}=this.props,c=void 0!==this.props.opened?this.props.opened:this.state.opened,v=e.getPopupSettings(),m=void 0!==v.width?v.width:e.popupWidth;let{group:b}=this.state;return void 0===b&&void 0!==o&&(b=I(n[0],o)),u.createElement(g,{width:m,popupSettings:{...v,anchor:v.anchor||this.element,show:c,popupClass:i.classNames(v.popupClass,"k-list-container","k-combobox-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[n.length]},u.createElement("div",{className:i.classNames({"k-list":!d,[`k-list-${ae[r]||r}`]:!d&&r,"k-virtual-list":p,"k-data-table":d,[`k-table-${ae[r]||r}`]:d&&r})},s&&u.createElement("div",{className:"k-table-header"},s),!d&&b&&0!==n.length&&u.createElement(f,{group:b,groupMode:l,render:h}),this.renderList(),a&&u.createElement("div",{className:i.classNames({"k-list-footer":!this.props.footerClassName},this.props.footerClassName)},a)))}renderList(){const e=this.base,{textField:t,dataItemKey:s,listNoDataRender:a,itemRender:n,groupHeaderItemRender:o,data:l=[],virtual:r={skip:0,total:void 0}}=this.props,d=e.getPopupSettings(),p=e.vs,h=r.skip,c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=`translateY(${p.translate}px)`,v=c?this.getFocusedIndex():void 0,m=void 0!==this.props.filter?this.props.filter:this.state.text,f=I(this.value,t),y=b(m)&&m!==f?null:this.value,k=this.props.list||V;return u.createElement(k,{id:e.listBoxId,virtual:!!r,show:c,data:l,focusedIndex:v,value:y,textField:t,valueField:s,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,listRef:e=>{p.list=this.base.list=e,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>j?{maxHeight:d.height}:{},wrapperCssClass:i.classNames("k-list-content",{"k-list-scroller":!r}),listStyle:p.enabled?{transform:g}:void 0,key:"listkey",skip:h,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:o,noDataRender:a,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll,wrapperRef:p.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:r.total})}renderSearchBar(e,t,s){const{tabIndex:i,disabled:a,data:n=[],dataItemKey:o,virtual:l={skip:0}}=this.props,r=void 0!==this.props.opened?this.props.opened:this.state.opened,d=this.value,p=Math.max(0,n.findIndex((e=>E(e,d,o))));return this._suggested&&!E(this._valueOnDidUpdate,d,o)&&(this._suggested=""),u.createElement(te,{id:t,readOnly:r&&this.mobileMode,placeholder:s,tabIndex:i,title:this.props.title,accessKey:this.props.accessKey,value:e+this._suggested,suggestedText:this._suggested,ref:e=>this._input=e&&e.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:a,expanded:r,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${p+l.skip}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}clearValue(){const e=this.base.initState();this._suggested="",this.base.filterChanged("",e),void 0===this.props.filter&&void 0!==this.state.text&&(e.data.text=void 0),this.triggerOnChange(null,e);const t=void 0!==this.props.opened?this.props.opened:this.state.opened,s=this.mobileMode;t&&!s&&this.base.togglePopup(e),this.applyState(e)}triggerOnChange(e,t){const s=this.value;!b(s)&&!b(e)||E(s,e,this.props.dataItemKey)||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}getFocusedIndex(){const e=this.value,{data:t=[],textField:s,dataItemKey:i,virtual:a={skip:0},focusedItemIndex:n=C,skipDisabledItems:o}=this.props,l=this.props.filter?this.props.filter:this.state.text;return b(e)&&void 0===l?t.findIndex((t=>E(t,e,i))):l?n(t,l,s):o&&s&&!l&&0===a.skip?t.findIndex((e=>!e.disabled&&e[s])):0===a.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const a=t[C(t,e,s)];if(a){const t=I(a,s);e.toLowerCase()!==t.toLowerCase()&&(i=t.substring(e.length))}}return i})(e,t,s)}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}calculateMedia(e){for(const t of e)this.setState({windowWidth:t.target.clientWidth})}};oe.displayName="ComboBox",oe.propTypes={...$.propTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,groupMode:s.oneOf([void 0,"classic","modern"]),isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,clearButton:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},oe.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let le=oe;const re=i.createPropsContext(),de=i.withIdHOC(i.withPropsContext(re,le));de.displayName="KendoReactComboBox";const{sizeMap:pe,roundedMap:he}=i.kendoThemeMaps,ce=class e extends u.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{data:s=[]}=this.props,i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{data:s=[],textField:i}=this.props,a=s[e];E(this.state.focusedItem,a,i)||(t.data.focusedItem=a)},this.togglePopup=e=>{this.base.togglePopup(e)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},this.onScroll=e=>{this._isScrolling=!0;const{list:t}=this.base,{groupField:s}=this.props;let{data:i=[]}=this.props;if(!s||!i.length)return;const a=this.itemHeight||(t?t.children[0].offsetHeight:0),n=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(a*e>n);e++)i[e]&&i[e][s]&&(o=i[e][s]);o!==this.state.group&&this.setState({group:o})},this.handleItemClick=(e,t)=>{this.base.handleItemClick(e,t),this._valueDuringOnChange=void 0},this.onChangeHandler=e=>{const t=this.base.initState(),s=e.currentTarget,i=s.value,a=s.selectionEnd===i.length;t.syntheticEvent=e;const n=this._suggested,o=this.value,l=o&&o.substring(0,o.length-n.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:p}=this.props,h=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==p&&!1!==p){r||d||!a?this._suggested="":this.suggestValue(i);const e=i+this._suggested,s={userInput:i,value:this._suggested};this.triggerOnChange(e,t,{suggestion:s})}else this._suggested="",this.triggerOnChange(i,t);(!h&&i||h&&!i)&&this.togglePopup(t),t.data.focusedItem=void 0,this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState(),s=void 0!==this.props.opened?this.props.opened:this.state.opened;t.syntheticEvent=e;this._suggested="",this.triggerOnChange("",t),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s&&this.togglePopup(t),this.applyState(t)},this.onInputKeyDown=e=>{const{data:t=[],skipDisabledItems:s,groupField:a,textField:n}=this.props;this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=t[o],r=e.keyCode,d=e.altKey,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=this.base.initState();h.syntheticEvent=e;const c=()=>{p&&e.preventDefault()};if(d&&r===i.Keys.down)this.setState({opened:!0});else if(d&&r===i.Keys.up)this.setState({opened:!1});else if(p&&r===i.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(p&&r===i.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(!p||r!==i.Keys.enter&&r!==i.Keys.esc)if(p||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==a&&n)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const s=t.slice(o+1).find((e=>!e.disabled&&e[n]));e=s&&t.findIndex((e=>e[n]===s[n]))}else if(r===i.Keys.up||r===i.Keys.left){let s;if(-1===o)s=t,e=t.findIndex((e=>!e.disabled&&e[n]));else{s=t.slice(0,o);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&t.findIndex((e=>e[n]===i[n]))}}if(void 0!==e){const t=e-o;this.onNavigate(h,r,t)}else void 0===e&&t.findIndex((e=>e[n]))===t.length-1&&this.onNavigate(h,r)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=t.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const s=t.slice(0,o);for(e=s.pop();e&&e.disabled;)e=s.pop()}if(e){const t=e.id-o-1;this.onNavigate(h,r,t)}else this.onNavigate(h,r)}this.applyState(h),c()}}else{const e="";this._suggested="",this.triggerOnChange(e,h),void 0!==this.state.focusedItem&&(h.data.focusedItem=void 0),this.applyState(h)}else c(),!1===s&&l&&l.disabled?(p&&this.togglePopup(h),this.applyState(h)):this.applyInputValue(e.currentTarget.value,h,e.keyCode)},this.handleBlur=e=>{if(this.state.focused){const t=this.base.initState();t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,this.applyInputValue(e.currentTarget.value,t)}},i.validatePackage(U)}get _inputId(){return this.props.id+"-accessibility-id"}get element(){return this._element}get value(){return void 0!==this._valueDuringOnChange?this._valueDuringOnChange:void 0!==this.props.value?this.props.value:void 0!==this.state.value?this.state.value:void 0!==this.props.defaultValue?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||""!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}componentDidUpdate(e,t){var s;const{groupField:i="",data:a=[]}=this.props,{data:n=[]}=e,o=this.focusedIndex(),l=a[o],r=n!==a,d=void 0!==l&&t.focusedItem!==l,p=void 0!==this.props.opened?this.props.opened:this.state.opened,h=void 0!==e.opened?e.opened:t.opened,c=!h&&p;if(""===i)(p&&(d||r)||c)&&this.base.scrollToItem(o);else if(!this._isScrolling){let e=null==(s=this.base.getGroupedDataModernMode(a,i))?void 0:s.indexOf(l);c&&(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][i],this),this.base.scrollToItem(e)),p&&h&&d&&this.base.scrollToItem(e)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:e,disabled:t,label:s,className:n,style:o,loading:l,suggest:r,size:d,rounded:p,fillMode:h}=this.props,c=!this.validityStyles||this.validity.valid,g=this.base,v=this.value,m=!1!==this.props.clearButton&&!l&&!!v,f=this.props.id||this._inputId;"string"==typeof r&&(this._suggested=r);const[b,y]=ie(this.props.prefix||u.Fragment),[k,C]=ie(this.props.suffix||u.Fragment),x=u.createElement("span",{className:i.classNames("k-autocomplete k-input",n,{[`k-input-${pe[d]||d}`]:d,[`k-rounded-${he[p]||p}`]:p,[`k-input-${h}`]:h,"k-invalid":!c,"k-loading":l,"k-required":this.required,"k-disabled":t}),ref:e=>{this._element=e,g.wrapper=e},style:s?{...o,width:void 0}:o,dir:e},this.props.prefix&&u.createElement(b,{...y}),this.renderSearchBar(v||"",f),l&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),m&&!l&&u.createElement(se,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&u.createElement(k,{...C}),this.renderListContainer());return s?u.createElement(a.FloatingLabel,{label:s,editorId:f,editorValue:v,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:x}):x}onNavigate(e,t,s){const i=this.value,{data:a=[],textField:n,focusedItemIndex:o}=this.props,l=void 0!==this.state.focusedItem?a.findIndex((e=>E(e,this.state.focusedItem,n))):o?o(a,i,n):a.indexOf(w(a,i,n)),r=this.base.navigation.navigate({keyCode:t,current:l,max:a.length-1,min:0,skipItems:s||void 0});void 0!==r&&this.itemFocus(r,e),this.applyState(e)}applyInputValue(e,t,s){const a=void 0!==this.props.opened?this.props.opened:this.state.opened,{data:n=[],textField:o}=this.props,l=n[this.focusedIndex()];if(this._suggested="",a&&s===i.Keys.enter&&l&&!l.disabled){const s=I(n[this.focusedIndex(e)],o);this.triggerOnChange(s,t)}a&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:a,disabled:n,readonly:o}=this.props,{focused:l}=this.state,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return u.createElement(te,{id:t,placeholder:i,tabIndex:a,accessKey:this.props.accessKey,value:e,suggestedText:this._suggested,focused:l,name:this.props.name,ref:e=>this._input=e&&e.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:s.handleFocus,onBlur:this.handleBlur,disabled:n,readOnly:o,expanded:r,owns:s.listBoxId,activedescendant:"option-"+s.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,data:n=[],size:o,groupField:l,list:r,groupStickyHeaderItemRender:d}=this.props,p=e.getPopupSettings(),h=void 0!==this.props.opened?this.props.opened:this.state.opened,c=void 0!==p.width?p.width:e.popupWidth;let{group:v}=this.state;return void 0===v&&void 0!==l&&(v=I(n[0],l)),u.createElement(g,{width:c,popupSettings:{...p,anchor:p.anchor||this.element,show:h,popupClass:i.classNames(p.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[n.length]},s&&u.createElement("div",{className:"k-list-header"},s),u.createElement("div",{className:i.classNames("k-list",{[`k-list-${pe[o]||o}`]:o})},!r&&v&&0!==n.length&&u.createElement(f,{group:v,groupMode:"modern",render:d}),this.renderList()),a&&u.createElement("div",{className:"k-list-footer"},a))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,data:i=[],listNoDataRender:a,itemRender:n,groupHeaderItemRender:o}=this.props,l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return u.createElement(V,{id:e.listBoxId,show:r,data:i.slice(),focusedIndex:this.focusedIndex(),value:l,textField:s,valueField:s,highlightSelected:!1,optionsGuid:e.guid,groupField:this.props.groupField,groupMode:"modern",listRef:t=>e.list=t,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:o,noDataRender:a,onMouseDown:e=>e.preventDefault(),onScroll:this.onScroll})}triggerOnChange(e,t,s){this.value===e&&!s||(t.data.value=e,this._valueDuringOnChange=e,t.events.push({type:"onChange",...s||{}}))}applyState(e){this.base.applyState(e),this._valueDuringOnChange=void 0}suggestValue(e){if(this._suggested="",e){const{data:t=[],textField:s}=this.props,i=t[C(t,e,s)];if(i){const t=I(i,s);e.toLowerCase()!==t.toLowerCase()&&(this._suggested=t.substring(e.length))}}}focusedIndex(e){const{data:t=[],textField:s,focusedItemIndex:i,skipDisabledItems:a}=this.props,n=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return t.findIndex((e=>E(e,this.state.focusedItem,s)));if(i)return i(t,n,s);{const e=t.indexOf(w(t,n,s));return a&&s&&-1===e?t.findIndex((e=>!e.disabled&&e[s])):Math.max(0,e)}}};ce.displayName="AutoComplete",ce.propTypes={...$.basicPropTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),groupField:s.string,suggest:s.oneOfType([s.bool,s.string]),placeholder:s.string,value:s.string,defaultValue:s.string,validationMessage:s.string,required:s.bool,readonly:s.bool,clearButton:s.bool,valueRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,list:s.any,skipDisabledItems:s.bool},ce.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ue=ce;const ge=i.createPropsContext(),ve=i.withIdHOC(i.withPropsContext(ge,ue));ve.displayName="KendoReactAutoComplete";const me=e=>e.syntheticEvent.preventDefault(),fe=e=>e.syntheticEvent.stopPropagation();class be extends u.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:a,onTagDelete:n,size:o}=this.props;return u.createElement(u.Fragment,null,e.map(((l,r)=>{const p=a?u.createElement(a,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:n}):u.createElement(d.Chip,{id:`tag-${t}-${l.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":e.length,key:l.text+r,text:l.text,removable:!0,onRemove:e=>n.call(void 0,l.data,e.syntheticEvent),onMouseDown:me,onClick:fe,className:l===s?"k-focus":void 0,size:o});return i?i(l,p):p})),this.props.children)}}var ye=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(ye||{});const ke=e=>{const{footer:t,children:s,windowWidth:i=0,navigatable:a,navigatableElements:o,expand:l,animation:r,onClose:h,adaptiveTitle:c,mobileFilter:g}=e,v={navigatable:a||!1,navigatableElements:o||[],expand:l,animation:!1!==r,onClose:h,animationStyles:i<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i<=500?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return u.createElement(p.ActionSheet,{...v},u.createElement(p.ActionSheetHeader,{className:"k-text-center"},u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",null,c)),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:n.xIcon,onClick:h}))),g&&u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},g)),s,t&&u.createElement(p.ActionSheetFooter,{className:"k-actions k-actions-stretched"},u.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),u.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:Ce,roundedMap:xe}=i.kendoThemeMaps,Ie=e=>e.preventDefault(),Se=e=>2===e,Ee=class e extends u.Component{constructor(e){super(e),this.state={activedescendant:ye.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new $(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{data:s=[],dataItemKey:i,virtual:a}=this.props,n=s[e-(a?a.skip:0)],o=this.value.findIndex((e=>E(e,n,i)));this._lastSelectedOrDeslectedItemIndex=s.findIndex((e=>E(e,n,i)));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,n],(void 0!==this.props.filter?this.props.filter:this.state.text)&&!this.mobileMode&&(this.state.text&&(t.data.text=""),this.base.filterChanged("",t)),this._adaptiveInput&&this._adaptiveInput.blur(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.triggerOnChange(l,t),this.base.triggerPageChangeCornerItems(n,t)},this.onTagDelete=(e,t)=>{const s=this.base.initState();s.syntheticEvent=t,this.opened&&this.base.togglePopup(s),!this.state.focused&&!this.mobileMode&&(s.data.focused=!0,this.focus());const i=this.value;S(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{data:s=[],allowCustom:i,virtual:a}=this.props,n=a?a.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=i&&o,d=s[e-n];d&&l!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=ye.PopupList):r&&-1===e&&void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(d,t)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.searchbarRef=e=>{const t=this._input=e&&e.input;t&&this.state.focused&&window.setTimeout((()=>t.focus()),0)},this.onChangeHandler=e=>{const t=this.base.initState(),s=e.target.value;t.syntheticEvent=e,void 0===this.props.filter&&(t.data.text=s),t.data.focusedIndex=void 0,this.opened||(this.base.togglePopup(t),this.setState({currentValue:this.value})),this.base.filterChanged(s,t),this.applyState(t),this.setState({group:void 0})},this.clearButtonClick=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),this.value.length>0&&this.triggerOnChange([],t),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t);const s=void 0!==this.props.filter?this.props.filter:this.state.text;b(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this._lastSelectedOrDeslectedItemIndex=null,this.applyState(t)},this.onInputKeyDown=e=>{const{data:t=[],textField:s,groupField:a}=this.props,n=e.keyCode,o=void 0!==this.props.filter?this.props.filter:this.state.text,l=void 0!==this.props.opened?this.props.opened:this.state.opened,{focusedItem:r,focusedIndex:d}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=e,!o&&this.value.length>0&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete||n===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,p);const h=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(n===i.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(n===i.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if((e.ctrlKey||e.metaKey)&&"KeyA"===e.code){const e=(this.state.value&&this.state.value.length)===t.length?[]:t;this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=t.slice(this.getFocusedState().focusedIndex);this.itemFocus(t.length-1,p),this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=t.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,p),this.updateStateOnKeyboardNavigation(e,p)}else if(e.shiftKey&&e.keyCode===i.Keys.up){let e;const s=this.getLastSelectedOrDeselectedIndex(1,d);null===s?e=0!==d?t.slice(d-1,d):[t[d]]:s===d?e=[t[s-1]]:d>=0&&(e=s>d?t.slice(d-1,s):t.slice(s-1,d)),e&&e.length>0&&(d>=1&&this.itemFocus(d-1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const s=this.getLastSelectedOrDeselectedIndex(0,d);null===s?e=d!==t.length-1?t.slice(d,d+1):[t[d]]:s===d?e=t.slice(d,d+2):d>=0&&(e=s>d?t.slice(d+1,s+1):t.slice(s,d+2)),e&&e.length>=1&&(this.itemFocus(d+1,p),this.updateStateOnKeyboardNavigation(e,p))}else if(e.altKey&&n===i.Keys.up)h();else if(n===i.Keys.up||n===i.Keys.down){if(""!==a&&s)if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=0;if(n===i.Keys.down||n===i.Keys.right){const i=t.slice(d+1).find((e=>!e.disabled&&e[s]));e=i&&t.findIndex((e=>e[s]===i[s]))}else if(n===i.Keys.up||n===i.Keys.left){let i;if(-1===d)i=t,e=t.findIndex((e=>!e.disabled&&e[s]));else{i=t.slice(0,d);let a=i.pop();for(;a&&a.disabled;)a=i.pop();e=a&&t.findIndex((e=>e[s]===a[s]))}}if(e){const t=e-d;this.onNavigate(p,n,t)}else void 0!==e&&this.onNavigate(p,n)}else if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=null;if(n===i.Keys.down||n===i.Keys.right)e=t.slice(d+1).find((e=>!e.disabled));else if(n===i.Keys.up||n===i.Keys.left){const s=t.slice(0,d);for(e=s.pop();e&&e.disabled;)e=s.pop()}if(e){const t=e.id-d-1;this.onNavigate(p,n,t)}else this.onNavigate(p,n)}this.applyState(p),e.preventDefault()}else n===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&o&&null===r?this.customItemSelect(e):r&&r.disabled?h():this.selectFocusedItem(e)):n===i.Keys.esc&&h();else e.altKey&&n===i.Keys.down&&h()},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:a,data:o=[],groupStickyHeaderItemRender:l,groupField:r,list:d}=this.props,p=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:h}=this.getFocusedState(),c=s&&p&&u.createElement("div",{className:i.classNames("k-list",{[`k-list-${Ce[a]||a}`]:a}),key:"customitem",onClick:this.customItemSelect,onMouseDown:Ie},u.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":Se(h)}),style:{fontStyle:"italic"}},p,u.createElement(i.IconWrap,{name:"plus",icon:n.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==r&&(g=I(o[0],r)),u.createElement(u.Fragment,null,e&&u.createElement("div",{className:"k-list-header"},e),c,u.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":Ce[a]||a}`]:a,"k-virtual-list":this.base.vs.enabled})},!d&&g&&0!==o.length&&u.createElement(f,{group:g,groupMode:"modern",render:l}),this.renderList()),t&&u.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t,data:s=[]}=this.props,a=this.base.getPopupSettings(),n=void 0!==a.width?a.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:n,popupSettings:{...a,popupClass:i.classNames(a.popupClass,"k-list-container","k-multiselect-popup"),anchor:a.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return u.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,filterable:t,filter:s}=this.props,{windowWidth:i=0}=this.state,a=void 0!==s?s:this.state.text;this.localization=r.provideLocalizationService(this);const n=t?u.createElement(m,{value:a,ref:e=>this._adaptiveInput=e&&e.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}):null,o={adaptiveTitle:e,expand:this.opened,onClose:e=>this.onCancel(e),windowWidth:i,mobileFilter:n,footer:{cancelText:this.localization.toLanguageString(L,H[L]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(B,H[B]),onApply:this.closePopup}};return u.createElement(ke,{...o},u.createElement(p.ActionSheetContent,{className:"!k-overflow-hidden"},u.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.closePopup=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t),t.events.push({type:"onClose"});const s=void 0!==this.props.filter?this.props.filter:this.state.text;b(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.onCancel=e=>{const t=this.base.initState();t.syntheticEvent=e,e.stopPropagation(),void 0!==this.state.focusedIndex&&(t.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(t),t.events.push({type:"onCancel"});const s=void 0!==this.props.filter?this.props.filter:this.state.text;b(s)&&""!==s&&this.base.filterChanged("",t),this.state.text&&(t.data.text=""),this.applyState(t)},this.renderList=()=>{const{data:e=[],textField:t,listNoDataRender:s,itemRender:i,groupHeaderItemRender:a,dataItemKey:n,virtual:o={skip:0,total:void 0}}=this.props,l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),p=`translateY(${l.translate}px)`;return u.createElement(V,{id:this.base.listBoxId,show:this.opened,data:e.slice(),focusedIndex:r-o.skip,value:this.value,textField:t,valueField:n,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>{l.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:d.height},wrapperCssClass:"k-list-content",listStyle:l.enabled?{transform:p}:void 0,key:"listKey",skip:o.skip,onClick:this.handleItemClick,itemRender:i,groupHeaderItemRender:a,noDataRender:s,onMouseDown:Ie,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:o.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let{data:a=[]}=this.props;if(i&&a.length&&i){const n=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*n;a=this.base.getGroupedDataModernMode(a,i);let l=a[0][i];for(let e=1;e<a.length&&!(n*e>o);e++)a[e]&&a[e][i]&&(l=a[e][i]);l!==this.state.group&&this.setState({group:l})}},this.customItemSelect=e=>{const t=void 0!==this.props.filter?this.props.filter:this.state.text,{textField:s}=this.props;if(!t)return;const i=this.base.initState();i.syntheticEvent=e;const a=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const n=[...this.value,a];this.triggerOnChange(n,i),this.base.togglePopup(i),this.applyState(i)},this.handleWrapperClick=e=>{const t=this._input;!this.opened&&t&&this.focusElement(t);const s=this.base.initState();s.syntheticEvent=e,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&(this.setState({currentValue:this.tagsToRender}),this.mobileMode&&window.setTimeout((()=>this._adaptiveInput&&this._adaptiveInput.focus()),300)),this.base.togglePopup(s),this.applyState(s)},this.handleItemClick=(e,t)=>{const s=this.base.initState();s.syntheticEvent=t,this.handleItemSelect(e,s),this.props.autoClose&&!this.mobileMode&&this.base.togglePopup(s),t.stopPropagation(),this.applyState(s)},this.handleBlur=e=>{if(!this.state.focused||this._skipFocusEvent)return;const t=this.base.initState(),{allowCustom:s,filterable:i}=this.props;t.syntheticEvent=e,t.data.focused=!1,t.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(t.data.opened=!1),t.events.push({type:"onClose"})),!s&&!i&&this.state.text&&(t.data.text=""),this.applyState(t)},this.handleFocus=e=>{this._skipFocusEvent||this.base.handleFocus(e)},this.onPopupOpened=()=>{this._input&&this.state.focused&&!this.mobileMode&&this.focusElement(this._input)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout((()=>{this.state.focused&&this.focusElement(this._input)}),0)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||"Please enter a valid value!")},i.validatePackage(U)}get _inputId(){return this.props.id}get document(){if(i.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get opened(){return!!(void 0!==this.props.opened?this.props.opened:this.state.opened)}get tagsToRender(){const{tags:e,textField:t}=this.props;let s=[];return void 0===e?this.value.forEach((e=>{s.push({text:I(e,t),data:[e]})})):s.push(...e),s}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=j&&this.props.adaptive)}get value(){const e=[];return this._valueItemsDuringOnChange?e.push(...this._valueItemsDuringOnChange):this.props.value?e.push(...this.props.value):this.state.value?e.push(...this.state.value):this.props.defaultValue&&e.push(...this.props.defaultValue),e}get name(){return this.props.name}get validity(){const e=void 0!==this.props.validationMessage,t=!this.required||null!==this.value&&this.value.length>0&&void 0!==this.value;return{customError:e,valid:void 0!==this.props.valid?this.props.valid:t,valueMissing:null===this.value}}get required(){return void 0!==this.props.required?this.props.required:e.defaultProps.required}get validityStyles(){return void 0!==this.props.validityStyles?this.props.validityStyles:e.defaultProps.validityStyles}componentDidUpdate(e,t){var s;const{virtual:i,groupField:a="",data:n=[]}=this.props,o=i?i.skip:0,l=e.virtual?e.virtual.total:0,r=void 0!==e.opened?e.opened:t.opened,d=!r&&this.opened,p=r&&!this.opened;if(!this.base.getPopupSettings().animate&&p&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==a&&(t=null==(s=this.base.getGroupedDataModernMode(n,a))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][a],this),this.base.scrollToItem(t)):this.opened&&r&&e&&this.scrollToFocused&&this.base.scrollToItem(t-o)}this.scrollToFocused=!1,this.setValidity()}componentDidMount(){var e;this.observerResize=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}onNavigate(e,t,s){const{allowCustom:a,data:n=[]}=this.props,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=a&&o,p=Se(l),h=this.base,c=h.vs;if(this.opened&&t===i.Keys.up&&p)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=h.navigation.navigate({keyCode:t,current:r,max:(c.enabled?c.total:n.length)-1,min:d?-1:0,skipItems:s||void 0});void 0!==i&&(this.itemFocus(i,e),this.scrollToFocused=!0)}this.applyState(e)}render(){const{style:e,className:t,label:s,dir:n,disabled:o,textField:l,dataItemKey:r,virtual:d,size:p,rounded:h,fillMode:c,loading:g,filter:v}=this.props,{text:m,focused:f,focusedTag:b,currentValue:y}=this.state,k=this.base.vs,C=this.props.id||this._inputId;k.enabled=void 0!==d,void 0!==d&&(k.skip=d.skip,k.total=d.total,k.pageSize=d.pageSize);const x=this.mobileMode&&this.opened?y:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const S=!this.validityStyles||this.validity.valid,E=!!(void 0!==v?v:m)||x&&x.length>0,[w,D]=ie(this.props.prefix||u.Fragment),[M,N]=ie(this.props.suffix||u.Fragment),T=u.createElement(u.Fragment,null,u.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${Ce[p]||p}`]:p,[`k-rounded-${xe[h]||h}`]:h,[`k-input-${c}`]:c,"k-focus":f&&!o,"k-invalid":!S,"k-disabled":o,"k-loading":g,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:n,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:F},this.props.prefix&&u.createElement(w,{...D}),u.createElement("div",{className:i.classNames("k-input-values")},u.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${Ce[p]||p}`]:p}),role:"listbox",id:"tagslist-"+this.base.guid},x&&x.length>0&&u.createElement(be,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:x,guid:this.base.guid,focused:b?x.find((e=>K(e,b,r))):void 0,size:p})),this.renderSearchBar(C)),g&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&u.createElement(M,{...N}),E&&u.createElement(se,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?u.createElement(a.FloatingLabel,{label:s,editorId:C,editorValue:m||I(this.value[0],l),editorValid:S,editorDisabled:o,style:{width:e?e.width:void 0},children:T}):T}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:a,placeholder:n,ariaDescribedBy:o}=this.props,l=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:r}=this.getFocusedState(),d=0!==this.value.length||l?void 0:n,p=i&&i.length>0?void 0:n,h=t===ye.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${r}`;return u.createElement(te,{id:e,size:Math.max((d||"").length,l.length,1),tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,placeholder:this.mobileMode&&this.opened?p:d,value:l,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:a,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:h,ariaDescribedBy:`tagslist-${this.base.guid}${o?" "+o:""}`,ariaLabelledBy:this.props.ariaLabelledBy,ariaRequired:this.required})}onTagsNavigate(e,t){const s=e.keyCode,{focusedTag:a}=this.state,n=this._tags,o=this.props.dataItemKey;let l,r=a?n.findIndex((e=>K(e,a,o))):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):n.length-1,l=n[r];else if(s===i.Keys.right)r===n.length-1?l=void 0:d&&(r=Math.min(n.length-1,r+1),l=n[r]);else if(s!==i.Keys.home||e.shiftKey)if(s!==i.Keys.end||e.shiftKey){if(s===i.Keys.delete){if(d){const e=this.value;S(e,n[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)S(e,n[r].data,o),this.triggerOnChange(e,t);else if(!d&&n.length){const s=n.pop();S(e,s.data,o),this.triggerOnChange(e,t)}}}else l=n[n.length-1];else l=n[0];l!==a&&(t.data.focusedTag=l,t.data.activedescendant=ye.TagsList),this.applyState(t)}triggerOnChange(e,t){void 0===this.props.value&&(t.data.value=[...e]),this._valueItemsDuringOnChange=[],this.setItems(e,this._valueItemsDuringOnChange),t.events.push({type:"onChange"})}selectFocusedItem(e,t){const{data:s=[],virtual:i}=this.props,{focusedIndex:a}=t||this.getFocusedState();void 0!==s[a-(i?i.skip:0)]&&this.handleItemClick(a,e)}setItems(e,t){t.length=0,t.push(...e)}getFocusedState(){const{focusedIndex:e}=this.state,t=void 0!==this.props.filter?this.props.filter:this.state.text,{allowCustom:s,data:i=[],dataItemKey:a,virtual:n,textField:o,focusedItemIndex:l=C,skipDisabledItems:r}=this.props,d=n&&n.skip||0;let p;if(void 0!==e)return{focusedIndex:e,focusedItem:i[e-d],focusedType:1};const h=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=l(i,t,o),{focusedItem:i[p],focusedIndex:p+d,focusedType:1};if(h.length){const e=h[h.length-1];return p=i.findIndex((t=>E(t,e,a))),void 0!==i[p]?{focusedIndex:p+d,focusedItem:i[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(r&&o&&!t&&0===d){const e=i.findIndex((e=>!e.disabled&&e[o]));return{focusedIndex:e,focusedItem:i[e-d],focusedType:1}}return 0===d?{focusedItem:i[0],focusedIndex:0,focusedType:1}:{focusedType:0,focusedIndex:-1}}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),0)}applyState(e){this.base.applyState(e),this._valueItemsDuringOnChange=null}calculateMedia(e){for(let t of e)this.setState({windowWidth:t.target.clientWidth})}updateStateOnKeyboardNavigation(e,t){this.setState({value:e}),this.triggerOnChange(e,t),this.applyState(t)}getLastSelectedOrDeselectedIndex(e,t){return null===this._lastSelectedOrDeslectedItemIndex&&(this._lastSelectedOrDeslectedItemIndex=t),null!==this._lastSelectedOrDeslectedItemIndex?this._lastSelectedOrDeslectedItemIndex+e:null}};Ee.displayName="MultiSelect",Ee.propTypes={...$.propTypes,autoClose:s.bool,value:s.arrayOf(s.any),defaultValue:s.arrayOf(s.any),dataItemKey:s.string,placeholder:s.string,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),tagRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,groupField:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,onCancel:s.func,skipDisabledItems:s.bool},Ee.defaultProps={...$.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let we=Ee;const Fe=i.createPropsContext(),Ke=i.withIdHOC(i.withPropsContext(Fe,we));Ke.displayName="KendoReactMultiSelect";const De=e=>u.createElement(V,{...e,wrapperCssClass:"k-table-body k-table-scroller",listClassName:i.classNames("k-table k-table-list",{"k-virtual-table":void 0!==e.virtual}),listStyle:{...e.listStyle}}),Me=i.createPropsContext(),Ne=u.forwardRef(((e,t)=>{const s=i.usePropsContext(Me,e),a=u.useRef(null),n=u.useRef(null),l=i.getScrollbarWidth(),{columns:r=Pe.columns,popupSettings:d=Pe.popupSettings,className:p,size:h,prefix:c,suffix:g,onOpen:v,onClose:m,onFocus:f,onBlur:b,onChange:y,onFilterChange:k,onPageChange:C,...x}=s;u.useImperativeHandle(a,(()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:s}))),u.useImperativeHandle(t,(()=>a.current));const S=u.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,w]=u.useState(S),[F,K]=u.useState(!0),[D]=c?ie(s.prefix||u.Fragment):[],[M]=g?ie(s.suffix||u.Fragment):[],N=u.useMemo((()=>{const e=u.createElement("th",{className:"k-table-th",colSpan:r.length},E);return u.createElement(u.Fragment,null,s.header,u.createElement("div",{className:"k-table-header-wrap"},u.createElement("table",{className:"k-table",role:"presentation"},u.createElement("colgroup",null,r.map(((e,t)=>u.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Pe.width}})))),u.createElement("thead",{className:"k-table-thead"},u.createElement("tr",{className:"k-table-row"},r.map(((e,t)=>u.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" ")))),E&&F&&u.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))}),[s.header,r,E,F]),T=u.useMemo((()=>`calc(${r.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Pe.width))).filter(Boolean).join(" + ")} + ${l}px + 4px)`),[r,l]),P=s.virtual?s.virtual.skip:0,O=u.useCallback(((e,t)=>{const a=r.map(((e,a)=>u.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Pe.width},key:e.uniqueKey?e.uniqueKey:a},e.field?String(i.getter(e.field)(t.dataItem)):"")));let n,o,l,d,p=s.data||[];const h=t.index-P;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(p[h]),l=d(p[h-1]),o&&l&&o!==l&&(n=o)),n&&"classic"===s.groupMode&&a.push(u.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},u.createElement("span",null,n)));const c=u.cloneElement(e,{...e.props,className:i.classNames("k-table-row",{"k-table-alt-row":t.index%2!=0,"k-focus":t.focused,"k-selected":t.selected,"k-first":!!n,"k-disabled":t.dataItem.disabled})},a);return s.itemRender?s.itemRender.call(void 0,c,t):c}),[r,s.groupField,s.itemRender,s.data,P]),_=u.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:a.current})}),[]),R=u.useCallback((e=>(s.virtual||w(S),_(v,e))),[_,v,s.virtual,S]),z=u.useCallback((e=>_(m,e)),[m]),B=u.useCallback((e=>_(f,e)),[f]),L=u.useCallback((e=>_(b,e)),[b]),H=u.useCallback((e=>_(y,e)),[y]),V=u.useCallback((e=>_(C,e)),[C]),q=u.useCallback((e=>(w(S),_(k,{...e,mobileMode:e.target.mobileMode}))),[k]),W=u.useCallback((e=>{w(e.group)}),[]);u.useEffect((()=>{i.setScrollbarWidth()})),u.useEffect((()=>{const e=s.data;w(S),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const A=u.useCallback((e=>u.createElement(De,{...e})),[]);return u.createElement(o.PopupPropsContext.Provider,{value:e=>({...e,popupClass:`k-dropdowngrid-popup ${d.popupClass}`})},u.createElement(de,{...x,list:A,popupSettings:{...d,width:d.width||T,className:d.className},ref:n,header:N,itemRender:O,groupHeaderItemRender:s.groupHeaderItemRender,size:s.size,rounded:s.rounded,fillMode:s.fillMode,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:R,onClose:z,onFocus:B,onBlur:L,onChange:H,onFilterChange:q,onPageChange:V,onGroupScroll:W,className:i.classNames("k-dropdowngrid",p),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,footer:s.footer,footerClassName:"k-table-footer",prefix:D,suffix:M}))})),Te={...le.propTypes,columns:s.any.isRequired},Pe={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Oe(e,t,s,i){const a=void 0!==s.width&&s.width!==t.popupSettings.width,n=void 0!==i.width,o=a?s.width:n?i.width:t.popupSettings.width,l=function(e,t,s){const[i,a]=u.useState(t);return u.useEffect((()=>{void 0!==i&&e.current&&a(e.current.offsetWidth)}),s),i}(e,o);return a||n?o:l&&l>t.popupSettings.width?l:t.popupSettings.width}Ne.displayName="KendoMultiColumnComboBox",Ne.propTypes=Te,Ne.defaultProps=Pe;const _e=e=>u.createElement("div",{className:"k-nodata"},u.createElement("div",null,e.children)),{sizeMap:Re,roundedMap:ze}=i.kendoThemeMaps,Be=e=>u.createElement("span",{className:"k-input-value-text"},e.children),Le=e=>e.split("_").map((e=>parseInt(e,10))),He={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},Ve=i.createPropsContext(),qe=u.forwardRef(((e,t)=>{i.validatePackage(U);const s=i.usePropsContext(Ve,e),l={...He,...s},c=i.useId(),g=l.id||c,{data:v,dataItemKey:f,popupSettings:y={},style:k,opened:C,disabled:x,onOpen:S=i.noop,onClose:w=i.noop,placeholder:F,label:K,name:D,selectField:M,subItemsField:N,validationMessage:T,valid:_,required:R,validityStyles:z}=l,B=i.getTabIndex(l.tabIndex,x),L=u.useRef(null),V=u.useRef(null),q=u.useRef(null),W=u.useRef(null),A=u.useRef(null),$=u.useRef(null),G=u.useRef(!1),[Y,J]=u.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==Y?Y:l.defaultValue,Z=b(X),ee=Z?I(X,l.textField):"",te=((e,t)=>{const{validationMessage:s,valid:i,required:a}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!a||t),valueMissing:!t}})({validationMessage:T,valid:_,required:R},Z),se=u.useCallback((()=>V.current&&V.current.focus()),[]);u.useImperativeHandle(L,(()=>({props:l,element:V.current,focus:se}))),u.useImperativeHandle(t,(()=>L.current));const ie=i.useRtl(V,l.dir),ae={width:Oe(V,He,y,k),...void 0!==ie?{direction:ie}:{}},[ne,oe]=u.useState(!1),le=void 0!==C?C:ne,[re,de]=u.useState(!1),[pe,he]=u.useState(),ce=!!(pe&&pe<=j&&l.adaptive),[ue,ge]=u.useState(""),ve=u.useCallback((()=>{A.current&&A.current.setCustomValidity&&A.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);u.useEffect(ve),u.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const me=u.useCallback((e=>{if(!le){if(S){const t={...e};S.call(void 0,t)}void 0===C&&oe(!0)}}),[le,C,S]),fe=u.useCallback((e=>{if(le){if(w){const t={...e};w.call(void 0,t)}void 0===C&&(oe(!1),ce&&setTimeout((()=>{var e;Ie(null==(e=W.current)?void 0:e.element)}),300))}}),[le,C,w,ce]),be=u.useCallback((e=>{if(!e.isDefaultPrevented()&&L.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:L.current};(le?fe:me)(t)}}),[le,C,S,w]),ye=u.useCallback((e=>{G.current=!0,e(),window.setTimeout((()=>G.current=!1),0)}),[]),Ce=u.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=$.current&&$.current.element;if(!L.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:L.current};if(le)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),fe(l);else if(o&&o.querySelector(".k-focus")&&(a===i.Keys.up||a===i.Keys.down||a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end)){if(a===i.Keys.up&&null!=(s=q.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find((e=>!(!e||!e.querySelector(".k-focus"))));if(t&&0===e.indexOf(t))return ye((()=>{var e;Ie(null==(e=q.current)?void 0:e.element)}))}ye(i.noop)}else a===i.Keys.down&&ye((()=>{var e;Ie((null==(e=q.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down?(e.preventDefault(),me(l)):le||a===i.Keys.esc&&Ne(e)}),[le,C,S,w]),xe=u.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),ye(t===i.Keys.up?()=>{Ie(V.current)}:()=>{Ie($.current&&$.current.element)}))}),[]),Ie=u.useCallback((e=>{e&&ye((()=>e.focus()))}),[]),Se=u.useCallback((()=>{var e;re||!le||C?s.filterable?Ie(null==(e=q.current)?void 0:e.element):Ie($.current&&$.current.element):fe({target:L.current})}),[w,s.filterable,re,C,le]),Ee=u.useCallback((()=>{re&&Ie(V.current)}),[re]),we=u.useCallback((e=>{if(!re&&!G.current&&(de(!0),s.onFocus&&L.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:L.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),Fe=u.useCallback((e=>{if(re&&!G.current&&L.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:L.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ce||fe(t)}}),[re,s.onBlur,le,C,w]),Ke=u.useCallback((()=>{re&&ye(i.noop),ce&&setTimeout((()=>{var e;Ie(null==(e=W.current)?void 0:e.element)}),300)}),[re,ce]),De=u.useCallback(((e,t,i)=>{if(s.onChange){const a={value:t,level:i?Le(i):[],...e};s.onChange.call(void 0,a)}Q||J(t)}),[s.onChange,Q]),Me=u.useCallback((e=>{if(E(e.item,X,f)||!L.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:a}=e,n={syntheticEvent:a,nativeEvent:i,target:L.current};De(n,t,s),fe(n)}),[Q,X,s.onChange,f,le,C,w]),Ne=u.useCallback((e=>{if(!L.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:L.current};De(t,null),fe(t),e.preventDefault()}),[Q,s.onChange,le,C,w]),Te=u.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&L.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:Le(i),item:t,nativeEvent:a,syntheticEvent:n,target:L.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Pe=u.useCallback((e=>{if(s.onFilterChange&&L.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:L.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),qe=u.useCallback((e=>{for(let t of e)he(t.target.clientWidth)}),[]),We=u.useMemo((()=>Q||!Z?v:i.mapTree(v,N,(e=>i.extendDataItem(e,N,{[M]:E(e,X,f)})))),[v,X,Q,Z,M,N]),Ae=l.listNoData||_e,$e=l.valueHolder||Be,Ue=r.useLocalization(),Ge=!z||te.valid,{size:je,rounded:Ye,fillMode:Je}=l,Qe=u.createElement(u.Fragment,null,u.createElement("span",{className:i.classNames("k-dropdowntree k-picker",l.className,{[`k-picker-${Re[je]||je}`]:je,[`k-rounded-${ze[Ye]||Ye}`]:Ye,[`k-picker-${Je}`]:Je,"k-focus":re,"k-invalid":!Ge,"k-loading":l.loading,"k-required":R,"k-disabled":l.disabled}),tabIndex:B,accessKey:l.accessKey,id:g,style:K?{...k,width:void 0}:k,dir:ie,ref:V,onKeyDown:x?void 0:Ce,onMouseDown:Ke,onClick:x?void 0:be,onFocus:we,onBlur:Fe,role:"combobox","aria-haspopup":"tree","aria-expanded":le,"aria-disabled":x,"aria-label":K,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-required":R},u.createElement("span",{className:"k-input-inner"},u.createElement($e,{item:X},ee||F)),l.loading&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!x&&u.createElement("span",{onClick:Ne,className:"k-clear-value",title:Ue.toLanguageString(O,H[O]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},u.createElement(i.IconWrap,{name:"x",icon:n.xIcon})),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:je,fillMode:Je,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:n.caretAltDownIcon}),u.createElement("select",{name:D,ref:A,tabIndex:-1,"aria-hidden":!0,title:K,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},u.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,X):X})),!ce&&u.createElement(o.Popup,{...y,className:i.classNames(y.className,{"k-rtl":"rtl"===ie}),popupClass:i.classNames(y.popupClass,"k-dropdowntree-popup"),style:ae,anchor:y.anchor||V.current,show:le,onOpen:Se,onClose:Ee},l.filterable&&u.createElement(m,{value:void 0===l.filter?ue:l.filter,ref:q,onChange:Pe,onKeyDown:xe,size:je,rounded:Ye,fillMode:Je}),v.length>0?u.createElement(h.TreeView,{style:{height:y.height},ref:$,tabIndex:B,data:We,focusIdField:f,textField:l.textField,selectField:M,expandField:l.expandField,childrenField:N,expandIcons:!0,onItemClick:Me,onExpandChange:Te,size:je,item:l.item,dir:ie}):u.createElement(Ae,null,Ue.toLanguageString(P,H[P])))),ce&&(()=>{const e=l.filterable?u.createElement(m,{value:void 0===l.filter?ue:l.filter,ref:W,onChange:Pe,onKeyDown:xe,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>fe(e),windowWidth:pe,mobileFilter:e};return u.createElement(ke,{...t},u.createElement(p.ActionSheetContent,{className:"!k-overflow-hidden"},u.createElement("div",{className:"k-list-container"},u.createElement("div",{className:"k-list k-list-lg"},v.length>0?u.createElement(h.TreeView,{ref:$,tabIndex:B,data:We,focusIdField:f,textField:l.textField,selectField:M,expandField:l.expandField,childrenField:N,expandIcons:!0,onItemClick:Me,onExpandChange:Te,size:je,item:l.item,dir:ie}):u.createElement(Ae,null,Ue.toLanguageString(P,H[P]))))))})());return K?u.createElement(a.FloatingLabel,{label:K,editorValue:ee,editorPlaceholder:F,editorValid:Ge,editorDisabled:x,editorId:g,style:{width:k?k.width:void 0},children:Qe,dir:ie}):Qe})),We={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,value:s.any,valueMap:s.func,placeholder:s.string,dataItemKey:s.string.isRequired,textField:s.string.isRequired,selectField:s.string,expandField:s.string,subItemsField:s.string,className:s.string,style:s.object,label:s.string,validationMessage:s.string,validityStyles:s.bool,valid:s.bool,required:s.bool,name:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,filterable:s.bool,filter:s.string,loading:s.bool,popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onFilterChange:s.func,onExpandChange:s.func,item:s.func,valueHolder:s.func,listNoData:s.func,adaptiveTitle:s.string,adaptive:s.bool};qe.displayName="KendoReactDropDownTree",qe.propTypes=We;const{sizeMap:Ae,roundedMap:$e}=i.kendoThemeMaps,Ue=e=>e.split("_").map((e=>parseInt(e,10))),Ge={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},je=i.createPropsContext(),Ye=u.forwardRef(((e,t)=>{const s=i.usePropsContext(je,e);i.validatePackage(U);const n=i.useId(),l=s.id||n,{data:d=[],dataItemKey:c,popupSettings:g={},style:v={},opened:f,disabled:b,onOpen:y=i.noop,onClose:k=i.noop,placeholder:C,label:x,name:S,checkField:w=Ge.checkField,checkIndeterminateField:F=Ge.checkIndeterminateField,subItemsField:D=Ge.subItemsField,validationMessage:M,valid:N,tags:T,value:O,required:_=Ge.required,validityStyles:R=Ge.validityStyles}=s,z=i.getTabIndex(s.tabIndex,b),V=u.useRef(null),q=u.useRef(null),W=u.useRef(null),A=u.useRef(null),$=u.useRef(null),G=u.useRef(null),Y=u.useRef(!1),J=u.useRef([]),Q=u.useRef(null),[X,Z]=u.useState(),[ee,te]=u.useState(!1),[ie,ae]=u.useState(!1),[ne,oe]=u.useState(),[le,re]=u.useState([]),[de,pe]=u.useState(""),he=!!(ne&&ne<=j&&s.adaptive),ce=void 0!==f?f:ee,ue=!(!Array.isArray(O)||!O.length),ge=((e,t)=>{const{validationMessage:s,valid:i,required:a}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!a||t),valueMissing:!t}})({validationMessage:M,valid:N,required:_},ue),ve=i.useRtl(q,s.dir),me={width:Oe(q,Ge,g,v),...void 0!==ve?{direction:ve}:{}},fe=u.useCallback((()=>q.current&&q.current.focus()),[]);J.current=void 0===T?(O||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...T],u.useImperativeHandle(V,(()=>({props:s,element:q.current,focus:fe}))),u.useImperativeHandle(t,(()=>V.current));const ye=u.useCallback((()=>{$.current&&$.current.setCustomValidity&&$.current.setCustomValidity(ge.valid?"":void 0===M?"Please select a value from the list!":M)}),[M,ge]);u.useEffect(ye),u.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}}),[]),u.useEffect((()=>{Q.current&&ce&&Q.current.setPosition(Q.current._popup)}),[O,ce]);const Ce=u.useCallback(((e,t,i)=>{if(s.onChange){const a={items:t,operation:i,...e};s.onChange.call(void 0,a)}}),[s.onChange]),xe=u.useCallback((e=>{if(E(e.item,O,c)||!V.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,a={syntheticEvent:i,nativeEvent:s,target:V.current};Ce(a,[t],"toggle")}),[O,c,Ce]),Ie=u.useCallback((e=>{if(!ce){if(y){const t={...e};y.call(void 0,t)}void 0===f&&(te(!0),re(O||[]),he&&setTimeout((()=>{var e;we(null==(e=A.current)?void 0:e.element)}),300))}}),[ce,f,y,he,A]),Se=u.useCallback((e=>{if(ce){if(k){const t={...e};k.call(void 0,t)}void 0===f&&te(!1)}}),[ce,f,k]),Ee=u.useCallback((e=>{Y.current=!0,e(),window.setTimeout((()=>Y.current=!1),0)}),[]),we=u.useCallback((e=>{e&&Ee((()=>e.focus()))}),[Ee]),Fe=u.useCallback((()=>{var e;!ie&&ce?Se({target:V.current}):s.filterable?we(null==(e=W.current)?void 0:e.element):we(G.current&&G.current.element)}),[ie,ce,we,Se,s.filterable]),Ke=u.useCallback((()=>{ie&&we(q.current)}),[ie,we]),De=u.useCallback((e=>{if(!ie&&!Y.current&&(ae(!0),s.onFocus&&V.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:V.current};s.onFocus.call(void 0,t)}}),[ie,s.onFocus]),Me=u.useCallback((e=>{if(ie&&!Y.current&&V.current){ae(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:V.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}he||Se(t)}}),[ie,s.onBlur,ce,f,k]),Ne=u.useCallback((()=>{ie&&Ee(i.noop)}),[ie,Ee]),Te=u.useCallback((e=>{if(!e.isDefaultPrevented()&&V.current){ae(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:V.current};ce||Ie(t)}}),[ce,Ie]),Pe=u.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=G.current&&G.current.element;if(!V.current||e.isDefaultPrevented()&&(null==(t=W.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:V.current};if(O&&O.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete)){const e=J.current;let t,s=X?e.findIndex((e=>K(e,X,c))):-1;const n=-1!==s;a===i.Keys.left?(s=n?Math.max(0,s-1):e.length-1,t=e[s]):a===i.Keys.right?s===e.length-1?t=void 0:n&&(s=Math.min(e.length-1,s+1),t=e[s]):a===i.Keys.home?t=e[0]:a===i.Keys.end?t=e[e.length-1]:a===i.Keys.delete&&n&&Ce(l,e[s].data,"delete"),t!==X&&Z(t)}if(ce)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),Se(l);else if(o&&o.querySelector(".k-focus")&&(a===i.Keys.up||a===i.Keys.down||a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end)){if(a===i.Keys.up&&null!=(s=W.current)&&s.element){const e=Array.from(o.querySelectorAll(".k-treeview-item")),t=[...e].reverse().find((e=>!(!e||!e.querySelector(".k-focus"))));if(t&&0===e.indexOf(t))return Ee((()=>{var e;we(null==(e=W.current)?void 0:e.element)}))}Ee(i.noop)}else a===i.Keys.down&&Ee((()=>{var e;we((null==(e=W.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down&&(e.preventDefault(),Ie(l))}),[ce,Se,we,Ee,Ie,X,c,O,Ce]),Re=u.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Ee(t===i.Keys.up?()=>{we(q.current)}:()=>{we(G.current&&G.current.element)}))}),[we,Ee]),ze=u.useCallback((e=>{if(!V.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:V.current};Ce(t,[],"clear"),Se(t),e.preventDefault()}),[Ce,Se]),Be=u.useCallback(((e,t)=>{var s;Se({target:V.current}),ie||we(null==(s=W.current)?void 0:s.element),Ce({syntheticEvent:t,nativeEvent:t.nativeEvent,target:V.current},e,"delete")}),[Ce,Se,we,ie]),Le=u.useCallback((e=>{if(s.onExpandChange&&V.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:Ue(i),item:t,nativeEvent:a,syntheticEvent:n,target:V.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),He=u.useCallback((e=>{if(s.onFilterChange&&V.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:V.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&pe(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Ve=u.useCallback((e=>{if(!V.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:V.current};s.onCancel&&s.onCancel.call(void 0,t),Se(t),e.preventDefault()}),[s.onCancel,Se]),qe=u.useCallback((e=>{for(let t of e)oe(t.target.clientWidth)}),[]),We=s.listNoData||_e,Ye=r.useLocalization(),Je=!R||ge.valid,{size:Qe,rounded:Xe,fillMode:Ze}=s,et=he&&ce?le:J.current,tt=u.createElement(u.Fragment,null,u.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${Ae[Qe]||Qe}`]:Qe,[`k-rounded-${$e[Xe]||Xe}`]:Xe,[`k-input-${Ze}`]:Ze,"k-focus":ie&&!b,"k-invalid":!Je,"k-disabled":b,"k-loading":s.loading,"k-required":_}),tabIndex:z,accessKey:s.accessKey,id:l,style:x?{...v,width:void 0}:v,dir:ve,ref:q,onKeyDown:b?void 0:Pe,onMouseDown:Ne,onFocus:De,onBlur:Me,role:"combobox","aria-haspopup":"tree","aria-expanded":ce,"aria-disabled":b,"aria-label":x,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy?s.ariaDescribedBy:"tagslist-"+l,"aria-required":s.required,onClick:b?void 0:Te},u.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${Ae[Qe]||Qe}`]:Qe})},et.length>0&&u.createElement(be,{tag:s.tag,onTagDelete:Be,data:et,guid:l,focused:X?J.current.find((e=>K(e,X,c))):void 0,size:Qe})),u.createElement("span",{className:"k-input-inner"},0===et.length&&u.createElement("span",{className:"k-input-value-text"},C)),s.loading&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ue&&!b&&et.length>0&&u.createElement(se,{onClick:ze}),u.createElement("select",{name:S,ref:$,tabIndex:-1,"aria-hidden":!0,title:x,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},u.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,O):O})),!he&&u.createElement(o.Popup,{...g,popupClass:i.classNames(g.popupClass,"k-multiselecttree-popup"),className:i.classNames(g.className,{"k-rtl":"rtl"===ve}),style:me,anchor:g.anchor||q.current,show:ce,onOpen:Fe,onClose:Ke,ref:Q},s.filterable&&u.createElement(m,{value:void 0===s.filter?de:s.filter,ref:W,onChange:He,onKeyDown:Re,tabIndex:z,size:Qe,rounded:Xe,fillMode:Ze}),d.length>0?u.createElement(h.TreeView,{style:{height:g.height},ref:G,tabIndex:z,data:d,focusIdField:c,textField:s.textField,checkField:w,checkIndeterminateField:F,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:xe,onCheckChange:xe,onExpandChange:Le,checkboxes:!0,size:Qe,item:s.item,dir:ve}):u.createElement(We,null,Ye.toLanguageString(P,H[P])))),he&&(()=>{const e=s.filterable?u.createElement(m,{value:void 0===s.filter?de:s.filter,ref:A,onChange:He,onKeyDown:Re,size:Qe,rounded:Xe,fillMode:Ze}):null,t={adaptiveTitle:s.adaptiveTitle,expand:ce,onClose:e=>s.onCancel?Ve(e):ze(e),windowWidth:ne,mobileFilter:e,footer:{cancelText:Ye.toLanguageString(L,H[L]),onCancel:e=>s.onCancel?Ve(e):ze(e),applyText:Ye.toLanguageString(B,H[B]),onApply:e=>Se(e)}};return u.createElement(ke,{...t},u.createElement(p.ActionSheetContent,{className:"!k-overflow-hidden"},u.createElement("div",{className:"k-list-container"},u.createElement("div",{className:"k-list k-list-lg"},d.length>0?u.createElement(h.TreeView,{ref:G,tabIndex:z,data:d,focusIdField:c,textField:s.textField,checkField:w,checkIndeterminateField:F,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:xe,onCheckChange:xe,onExpandChange:Le,checkboxes:!0,size:Qe,item:s.item,dir:ve}):u.createElement(We,null,Ye.toLanguageString(P,H[P]))))))})());return x?u.createElement(a.FloatingLabel,{label:x,editorValue:ue,editorPlaceholder:C,editorValid:Je,editorDisabled:b,editorId:l,style:{width:v?v.width:void 0},children:tt,dir:ve}):tt})),Je={opened:s.bool,disabled:s.bool,dir:s.string,tabIndex:s.number,accessKey:s.string,data:s.array,value:s.any,valueMap:s.func,placeholder:s.string,dataItemKey:s.string.isRequired,textField:s.string.isRequired,checkField:s.string,checkIndeterminateField:s.string,expandField:s.string,subItemsField:s.string,className:s.string,style:s.object,label:s.string,validationMessage:s.string,validityStyles:s.bool,valid:s.bool,required:s.bool,name:s.string,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,filterable:s.bool,filter:s.string,loading:s.bool,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),popupSettings:s.shape({animate:s.oneOfType([s.bool,s.shape({openDuration:s.number,closeDuration:s.number})]),popupClass:s.string,className:s.string,appendTo:s.any,width:s.oneOfType([s.string,s.number]),height:s.oneOfType([s.string,s.number])}),onOpen:s.func,onClose:s.func,onFocus:s.func,onBlur:s.func,onChange:s.func,onFilterChange:s.func,onExpandChange:s.func,onCancel:s.func,item:s.func,listNoData:s.func,adaptiveTitle:s.string,adaptive:s.bool};Ye.displayName="KendoReactMultiSelectTree",Ye.defaultProps=Ge,Ye.propTypes=Je;const Qe=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=ve,e.AutoCompletePropsContext=ge,e.AutoCompleteWithoutContext=ue,e.ComboBox=de,e.ComboBoxPropsContext=re,e.ComboBoxWithoutContext=le,e.DropDownList=ee,e.DropDownListClassComponent=X,e.DropDownListPropsContext=Z,e.DropDownListWithoutContext=X,e.DropDownTree=qe,e.DropDownTreePropsContext=Ve,e.List=V,e.ListContainer=g,e.ListFilter=m,e.ListItem=N,e.MultiColumnComboBox=Ne,e.MultiColumnComboBoxPropsContext=Me,e.MultiSelect=Ke,e.MultiSelectPropsContext=Fe,e.MultiSelectTree=Ye,e.MultiSelectTreePropsContext=je,e.MultiSelectWithoutContext=we,e.SearchBar=te,e.TagList=be,e.dropdownsMessages=H,e.findByFieldValue=(e,t,s)=>{if(!e)return;const i=e.findIndex((e=>I(e,t)===s));return e[i]},e.getItemValue=I,e.getMultiSelectTreeValue=(e,t)=>{const{items:s,dataItemKey:a,value:n,subItemsField:o="items",operation:l}=t,r=i.getter(a),d=Qe(n,r);if("clear"===l)return[];if("delete"===l){const e=Qe(s,r);return n.filter((t=>!e[r(t)]))}const p=s[0],h=r(p),c=i.getter(o),u=[...e],g=[];let v,m=[];for(;u.length;){const e=u.pop();if(h===r(e)){m=g.map((e=>e.item)),v=e;break}{g&&g.length&&g[g.length-1].parentPosition===u.length&&g.pop();const t=c(e);t&&t.length&&(g.push({item:e,parentPosition:u.length}),u.push(...t))}}const f=[...c(v)||[]];let b=[];for(;f.length;){const e=f.pop();b.push(e);const t=c(e);t&&t.length&&f.push(...t)}const y=[];if(!d[h]){y.push(...n),y.push(v),y.push(...b.filter((e=>!d[r(e)])));const e=m.filter((e=>!d[r(e)])),t=Qe(y,r);for(let s=e.length-1;s>-1;s--){const i=e[s],a=c(i);if(a.filter((e=>t[r(e)])).length<a.length)break;y.push(i),t[r(i)]=!0}}else{const e=r(v),t=Qe(b,r),s=Qe(m,r);y.push(...n.filter((i=>{const a=r(i);return!t[a]&&e!==a&&!s[a]})))}return y},e.getValueMap=Qe,e.nodata=P,e.scrollToItem=k}));
|