@progress/kendo-react-dropdowns 8.3.0-develop.6 → 8.3.0-develop.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +30 -30
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +55 -55
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +1 -1
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +1 -1
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +11 -11
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-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);const g=e=>{const{children:t,width:s,dir:i,itemsCount:a,popupSettings:n}=e;return u.createElement(o.Popup,{style:{width:s,direction:i},contentKey:a&&a.join(),...n},t)},m=u.forwardRef(((e,t)=>{const s=u.useRef(null),{renderListFilterWrapper:a=!1,renderPrefixSeparator:o=!1,...r}=e,d=i.useUnstyled(),p=d&&d.uDropDownsBase;u.useImperativeHandle(t,(()=>s.current));const h=u.createElement(l.TextBox,{...r,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:p})),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(u.Fragment,null,u.createElement(l.InputPrefix,null,u.createElement(i.IconWrap,{name:"search",icon:n.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:p}))})),o&&u.createElement(l.InputSeparator,null))});return a?u.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:p}))}," ",h," "):h}));m.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"]),renderListFilterWrapper:s.bool,renderPrefixSeparator:s.bool},m.displayName="KendoReactListFilter";const v=m,f=e=>{const{group:t,groupMode:s,render:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase,l=u.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:o}))},"classic"===s?t:u.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:o}))},t));return void 0!==a?a.call(void 0,l,e):l},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)},C=(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)},x=(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},k=(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=>w(e,t,s)));-1!==i&&e.splice(i,1)}))},w=(e,t,s)=>e===t||b(e)===b(t)&&I(e,s)===I(t,s),E=(e,t,s)=>{if(t){const i=k(e,t,s,!0);return-1!==i?e[i]:e[x(e,t,s)]}return e[0]},D=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},F=(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(!w(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),K=e=>{const{data:t=[],groupField:s}=e;return s?t.filter((e=>s&&void 0!==e[s])):t},N=e=>e.preventDefault(),M=e=>{const{selected:t,defaultItem:s,textField:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase;return u.createElement("div",{onClick:e.onClick,onMouseDown:N,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionlabel({c:o,selected:t}))},I(s,a)||"")},T=e=>{const{selected:t,group:s,dataItem:a,virtual:n,groupMode:o,disabled:l,id:r,focused:d,render:p}=e,h=i.useUnstyled(),c=h&&h.uDropDownsBase,g=u.createElement("li",{id:r,role:"option","aria-selected":t,"aria-disabled":!!l||void 0,className:i.classNames(i.uDropDownsBase.li({c:c,selected:t,focused:d,first:!!s&&"classic"===o,disabled:l})),onClick:t=>e.onClick(e.index,t),style:{position:n?"relative":"unset"}},u.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:c}))},I(a,e.textField).toString()),void 0!==s&&"classic"===o?u.createElement("div",{className:i.classNames(i.uDropDownsBase.itemGroupLabel({c:c}))},s):null);return void 0!==p?p.call(void 0,g,e):g},P=e=>{const{group:t,virtual:s,render:a,isMultiColumn:n=!1,id:o}=e,l=i.useUnstyled(),r=l&&l.uDropDownsBase,d=u.createElement("li",{id:o,role:"group",className:i.classNames(i.uDropDownsBase.groupLi({c:r,isMultiColumn:n})),style:n?{boxSizing:"inherit"}:{position:s?"relative":"unset"}},u.createElement("span",{className:a?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:r,isMultiColumn:n}))},t));return void 0!==a?a.call(void 0,d,e):d},O="dropdowns.nodata",_="dropdowns.clear",R="dropdowns.comboArrowBtnAriaLabelExpand",B="dropdowns.comboArrowBtnAriaLabelCollapse",L="dropdowns.dropDownListArrowBtnAriaLabel",z="dropdowns.apply",H="dropdowns.cancel",V={[_]:"clear",[O]:"NO DATA FOUND.",[R]:"expand combobox",[B]:"collapse combobox",[L]:"select",[z]:"Apply",[H]:"Cancel"},q=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,{id:n,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:p,listRef:h,wrapperRef:c,listClassName:g,ariaSetSize:m}=e,v=(()=>{const{textField:t,valueField:s,groupField:i,groupMode:a,isMultiColumn:n,optionsGuid:o,skip:l=0,virtual:r,focusedIndex:d,hasDuplicates:p,highlightSelected:h=!0,value:c,data:g,itemRender:m,groupHeaderItemRender:v}=e,f=Array.isArray(c);let b=0;return g.map(((y,C)=>{const x=l+C,k=l+C+b,S=p?!!c&&d===C:!y.disabled&&(h&&(!f&&w(y,c,s)||f&&-1!==c.findIndex((e=>w(e,y,s)))));let E,D,F;return C>0&&void 0!==i&&(D=I(y,i),F=I(g[C-1],i),D&&F&&D!==F&&(E=D)),void 0!==E&&"modern"===a&&(b+=1),[void 0!==E&&"modern"===a&&u.createElement(P,{id:`option-${o}-${k}`,virtual:r,key:x+"-group-item",group:E,isMultiColumn:n,render:v}),u.createElement(T,{id:`option-${o}-${void 0!==E&&"modern"===a?k+1:k}`,virtual:r,dataItem:y,groupMode:a,selected:S,focused:d===C,index:x,key:x,onClick:e.onClick,textField:t,group:E,render:m,disabled:y.disabled})]}))})();return v.length?u.createElement("div",{className:l,style:d,ref:c,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},u.createElement("ul",{id:n,role:"listbox","aria-hidden":!o||void 0,"aria-setsize":m,className:g||i.classNames(i.uDropDownsBase.ul({c:a})),ref:h,style:p},v),e.scroller&&u.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:a}))},e.scroller)):(()=>{const s=e.noDataRender,n=u.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:a}))},u.createElement("div",null,t.toLanguageString(O,V[O])));return s?s.call(void 0,n):n})()},A="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);let W=class{constructor(){this.table=null,this.total=0,this.enabled=!1,this.skip=0,this.pageSize=0,this.PageChange=null,this.scrollElement=null,this.listTransform="",this.itemHeight=0,this.containerHeight=0,this.reactVersion=Number.parseFloat(u.version),this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.listTranslate=0,this.list=null,this.container=null,this.calcScrollElementHeight=()=>{var e;this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight;const s=this.itemHeight*this.total-((null==(e=this.list)?void 0:e.offsetHeight)||0);this.containerHeight=A?Math.min(17895697,s):s;const i=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==i+"px",t&&(this.scrollElement.style.height=i+"px")),this.scrollSyncing=!1,t},this.scrollerRef=e=>{this.container=e,e&&(e.setAttribute("unselectable","on"),window.setTimeout(this.calcScrollElementHeight.bind(this),0))},this.getRowHeightService=i.memoizeOne(((e,t)=>new i.RowHeightService(t,e,0))),this.firstLoaded=this.pageSize,this.lastLoaded=this.skip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}translateTo(e,t){this.listTranslate=e,this.enabled&&this.list&&(A||this.reactVersion<=17||t?this.list.style.transform="translateY("+e+"px)":this.listTransform="translateY("+e+"px)")}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)}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0,!0))}scrollToEnd(){if(this.container&&this.list){this.calcScrollElementHeight();const{scrollHeight:e,offsetHeight:t}=this.container;this.container.scrollTop=e,this.translateTo(e-t,!0)}}scrollHandler(e){if(!this.enabled||!this.container||!this.list)return;if(this.scrollSyncing)return void(this.scrollSyncing=!1);this.rowHeightService=this.getRowHeightService(this.itemHeight,this.total);const t=this.container.scrollTop,s=this.lastScrollTop>=t,i=!s,a=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let n=this.rowHeightService.index(t),o=this.rowHeightService.offset(n);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=n+this.pageSize-this.total;t>0&&(n-=t,o=this.rowHeightService.offset(n)),this.firstLoaded=n,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&n-1<=this.firstLoaded){const t=a===this.itemHeight;if(0===this.skip&&t)this.lastScrollTop=0,this.firstLoaded=0,this.lastLoaded=this.pageSize,this.container.scrollTop=0,this.translateTo(0,!0);else{const t=Math.floor(.3*this.pageSize);this.firstLoaded=Math.max(n-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}},U=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 $=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new W,this.navigation=new U,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(0===e.skip)s.reset();else{let i=s.translate;0===i&&(s.calcScrollElementHeight(),i=s.itemHeight*e.skip,s.translateTo(i,!0)),t<0&&i>0&&(i+=s.itemHeight*(e.pageSize/4)),s.container&&(s.container.scrollTop=i),this.scrollToItem(t,!0)}},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}didUpdate(){this.vs.listTransform&&this.vs.list&&(this.vs.list.style.transform=this.vs.listTransform,this.vs.listTransform="")}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),0===e&&t&&0===this.vs.skip)this.vs.reset();else if(i&&e>=0){const s=this.vs,a=s.container||i.parentNode,n=void 0!==t?t:s.enabled;C(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&&w(e,i[0],a)?this.triggerOnPageChange(t,n.skip-1,n.pageSize):!o&&n.skip+n.pageSize<n.total&&w(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)}getAdaptiveAnimation(){const e=this.getPopupSettings();return void 0===e.animate||e.animate}getGroupedDataModernMode(e,t){const 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}};$.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},$.propTypes={...$.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},$.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let G=$;const j={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"},Y=500,J=768,Q=class e extends u.Component{constructor(e){super(e),this.state={},this._element=null,this.base=new G(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({preventScroll:!0})},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i,defaultItem:a}=this.props,n=K(this.props),o=s?s.skip:0,l=-1===e&&void 0!==a?a:n[e-o],r=!w(l,this.value,i);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,size:a,groupField:n,groupStickyHeaderItemRender:o,list:l,unstyled:r}=this.props,d=K(this.props),p=this.base,h=p.getPopupSettings(),c=void 0!==this.props.opened?this.props.opened:this.state.opened,m=void 0!==h.width?h.width:p.popupWidth,v=r&&r.uDropDownList,b={dir:void 0!==s?s:p.dirCalculated,width:m,popupSettings:{...h,popupClass:i.classNames(h.popupClass,i.uDropDownList.listContainer({c:v})),anchor:h.anchor||this.element,show:c,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[d.length]};let{group:y}=this.state;return void 0===y&&void 0!==n&&(y=I(d[0],n)),u.createElement(g,{...b},this.renderListFilter(),e&&u.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:v}))},e),u.createElement("div",{className:i.classNames(i.uDropDownList.list({c:v,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!l&&y&&0!==d.length&&u.createElement(f,{group:y,groupMode:"modern",render:o}),this.renderList()),t&&u.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:v}))},t))},this.renderList=()=>{const{textField:e,dataItemKey:t,virtual:s={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:n,itemRender:o,unstyled:l}=this.props,r=K(this.props),d=l&&l.uDropDownList,p=this.base.vs,h=s.skip,c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=this.base.getPopupSettings(),m=`translateY(${p.translate}px)`;return u.createElement(q,{id:this._listboxId,show:c,data:r.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:t,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>p.list=this.base.list=e,wrapperStyle:{maxHeight:g.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:d})),listStyle:p.enabled?{transform:m}:void 0,key:"listkey",skip:h,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:a,noDataRender:n,onScroll:this.onScroll,wrapperRef:p.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:s.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=K(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(v,{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,renderListFilterWrapper:!0})},this.renderDefaultItem=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=this.props;return void 0!==t&&u.createElement(M,{defaultItem:t,textField:e,selected:w(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{dataItemKey:t}=this.props,s=K(this.props);let i=s.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,s.findIndex((e=>w(e,this.value,t))));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:m}=this.props;for(;u<r;u++)if(p=I(i[u].item,g),h=o&&y(p,n,m),c=y(p,a,m),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{filterable:t,disabled:s,defaultItem:a,leftRightKeysNavigation:n=!0,virtual:o={skip:0,total:0,pageSize:0},dataItemKey:l,groupField:r="",textField:d,skipDisabledItems:p=!0}=this.props,h=K(this.props),c=this.value,u=h.findIndex((e=>w(e,c,l))),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=e.keyCode,v=m===i.Keys.home||m===i.Keys.end,f=m===i.Keys.up||m===i.Keys.down,b=!g&&(e.altKey&&m===i.Keys.down||m===i.Keys.enter||m===i.Keys.space),y=g&&(e.altKey&&m===i.Keys.up||m===i.Keys.esc),C=n&&(m===i.Keys.left||m===i.Keys.right),x=f||C&&!t||v,k=this.base.initState();if(k.syntheticEvent=e,!s){if(v&&this.base.vs.enabled)m===i.Keys.home?0!==o.skip?(this.base.triggerOnPageChange(k,0,o.pageSize),this._navigated=!0):this.triggerOnChange(h[0],k):o.skip<o.total-o.pageSize?(this.base.triggerOnPageChange(k,o.total-o.pageSize,o.pageSize),this._navigated=!0):this.triggerOnChange(h[h.length-1],k);else if(g&&m===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(g&&m===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if(g&&m===i.Keys.enter){const t=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(h,t)?(this.triggerOnChange(null,k),this.applyState(k)):this.handleItemSelect(t,k),this.base.togglePopup(k),e.preventDefault()}else if(b||y)y&&this.resetValueIfDisabledItem(),this.base.togglePopup(k),e.preventDefault();else if(x){if(this._lastKeypressIsFilter=!1,""!==r&&d)if(!p&&g)this.onNavigate(k,m);else{let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(u+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===u&&a)e=-1;else if(-1===u)t=h,e=h.findIndex((e=>!e.disabled&&e[d]));else{t=h.slice(0,u);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-u;this.onNavigate(k,m,t)}else void 0===e&&h.findIndex((e=>e[d]===c[d]))===h.length-1&&this.onNavigate(k,m)}else if(!p&&g||v)this.onNavigate(k,m);else if(d){let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(u+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===u&&a)e=-1;else if(-1===u)t=h,e=h.find((e=>!e.disabled&&e[d]));else{t=h.slice(0,u);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-u;this.onNavigate(k,m,t)}else void 0===e&&h.findIndex((e=>e[d]===c[d]))===h.length-1&&this.onNavigate(k,m)}else this.onNavigate(k,m);e.preventDefault()}this.applyState(k)}},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(j)}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{dataItemKey:e}=this.props,t=K(this.props),s=this.value;return t.findIndex((t=>w(t,s,e)))}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,l=K(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.didUpdate(),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=>w(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=!w(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,this.base.vs.enabled):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(L,V[L]),{style:t,className:s,label:o,dir:l,virtual:p,size:h,rounded:c,fillMode:g,adaptive:m,unstyled:v}=this.props,{windowWidth:f=0}=this.state,b=void 0!==this.props.opened?this.props.opened:this.state.opened,y=this.value,C=I(y,this.props.textField),x=!this.validityStyles||this.validity.valid,k=this.base,S=k.vs,E=f<=J&&m,D=v&&v.uDropDownList;S.enabled=void 0!==p,void 0!==p&&(k.vs.skip=p.skip,k.vs.total=p.total,k.vs.pageSize=p.pageSize);const{dataItemKey:F,disabled:N,tabIndex:M,loading:T,iconClassName:P,svgIcon:O,valueRender:_}=this.props,R=K(this.props),{focused:B}=this.state,z=R.findIndex((e=>w(e,y,F))),H=u.createElement("span",{id:this._inputId,className:i.classNames(i.uDropDownList.input({c:D}))},C&&u.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:D}))},C)),q=void 0!==_?_.call(void 0,H,y):H,A=u.createElement(u.Fragment,null,u.createElement("span",{ref:this.componentRef,className:i.classNames(i.uDropDownList.wrapper({c:D,size:h,rounded:c,fillMode:g,focused:B,disabled:N,invalid:!x,loading:T,required:this.required}),s),style:o?{...t,width:void 0}:t,dir:l,onMouseDown:b?e=>{"INPUT"!==e.target.nodeName&&(this.focusElement(this.base.wrapper),e.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:i.getTabIndex(M,N),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:N?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":N||void 0,"aria-haspopup":"listbox","aria-expanded":b||!1,"aria-owns":this._listboxId,"aria-activedescendant":b?"option-"+this._guid+"-"+(z+(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,"aria-controls":this._listboxId,id:this.props.id,title:this.props.title},q,T&&u.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:D})),name:"loading"}),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":e,"aria-hidden":!0,size:h,fillMode:g,iconClass:P,className:i.classNames(i.uDropDownList.iconButton({c:D})),rounded:null,themeColor:"base",icon:P?void 0:"caret-alt-down",svgIcon:O||n.caretAltDownIcon,onMouseDown:e=>this.state.focused&&e.preventDefault()}),this.dummySelect(y),!E&&this.renderListContainer()),E&&this.renderAdaptiveListContainer());return o?u.createElement(a.FloatingLabel,{label:o,editorValue:C,editorValid:x,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:A}):A}onNavigate(e,t,s){const{defaultItem:i,dataItemKey:a,virtual:n={skip:0,total:0,pageSize:0}}=this.props,o=K(this.props),l=this.base.vs,r=this.value,d=o.findIndex((e=>w(e,r,a))),p=this.base.navigation.navigate({current:n.skip+d,max:(l.enabled?n.total:o.length)-1,min:void 0!==i?-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,unstyled:c}=this.props,g=K(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,v=c&&c.uDropDownList,b=c&&c.uDropDownList,y={navigatable:!1,navigatableElements:[],expand:m,animation:!0,onClose:e=>this.handleWrapperClick(e),animationStyles:e<=Y?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:v,isFullScreen:e<=Y}))};let{group:C}=this.state;return void 0===C&&void 0!==l&&(C=I(g[0],l)),u.createElement(p.ActionSheet,{...y},u.createElement(p.ActionSheetHeader,{className:i.classNames(i.uDropDownsActionSheet.header({c:b}))},u.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:b}))},u.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:b}))},u.createElement("div",null,o)),u.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:b}))},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:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:b}))},this.renderListFilter())),u.createElement(p.ActionSheetContent,{className:i.classNames(i.uDropDownsActionSheet.content({c:b}))},t&&u.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:v}))},t),u.createElement("div",{className:i.classNames(i.uDropDownList.list({c:v,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!h&&C&&0!==g.length&&u.createElement(f,{group:C,groupMode:"modern",render:r}),this.renderList()),s&&u.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:v}))},s)))}getFocusedIndex(){const e=this.value,{textField:t,dataItemKey:s,virtual:i={skip:0},focusedItemIndex:a=x,filterable:n,skipDisabledItems:o=!0}=this.props,l=K(this.props),r=this.props.filter?this.props.filter:this.state.text;return o&&t&&!r&&!e?l.findIndex((e=>!e.disabled&&e[t])):b(e)&&void 0===r||n&&""===r?l.findIndex((t=>w(t,e,s))):r?this._lastKeypressIsFilter?a(l,r,t):l.findIndex((t=>w(t,e,s))):0===i.skip?0:-1}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),30)}triggerOnChange(e,t){w(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 e=K(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,renderListFilterWrapper:s.bool,...G.propTypes},Q.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...G.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};let X=Q;const Z=i.createPropsContext(),ee=i.withIdHOC(i.withPropsContext(Z,i.withUnstyledHOC(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,tabIndex:a,accessKey:n}=this.props,o={tabIndex:a,accessKey:n},l=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",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-label":this.props.ariaLabel,"aria-required":this.props.ariaRequired,"aria-controls":this.props.ariaControls,...o});return i?i.call(void 0,l):l}};const se=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,o=t.toLanguageString(_,V[_]);return u.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:a})),role:"button",onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},u.createElement(i.IconWrap,{name:"x",icon:n.xIcon}))},ie=i.useCustomComponent,{sizeMap:ae,roundedMap:ne}=i.kendoThemeMaps,oe=class e extends u.Component{constructor(e){super(e),this.state={},this.base=new G(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.focus=()=>{this._input&&this._input.focus()},this.checkForDuplicatePlainTextRecords=()=>{const e=void 0!==this.props.textField,t=void 0!==this.props.dataItemKey;if(this.props.data&&this.props.data.length>0&&!e&&!t){const e=this.props.data;this.duplicates=(e=>{const t=e.filter(((t,s)=>e.some(((e,i)=>e===t&&i!==s))));return Array.from(new Set(t))})(e),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i}=this.props,a=K(this.props)[e-(s?s.skip:0)],n=this.hasDuplicates||!w(a,this.value,i);this.triggerOnChange(a,t),void 0!==this.state.text&&(t.data.text=void 0),n&&this.base.triggerPageChangeCornerItems(a,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{skipDisabledItems:t,textField:s}=this.props,i=K(this.props),a=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(s,i,a),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&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.closeOpenedApplyStateNonMobileMode=(e,t)=>{t&&!this.mobileMode&&this.base.togglePopup(e)},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(v,{value:s,ref:e=>this._adaptiveFilterInput=e&&e.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:"large",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 a=K(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.navigationIndex=e,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}=this.props,i=K(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{skipDisabledItems:t,textField:s,dataItemKey:a,groupField:n}=this.props,o=K(this.props),l=this.value,r=Math.max(0,o.findIndex((e=>w(e,l,a)))),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(),""!==n&&s)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=0;if(d===i.Keys.down||d===i.Keys.right){const t=o.slice(r+1<o.length?r+1:r).find((e=>!e.disabled&&e[s]));e=t&&o.findIndex((e=>e[s]===t[s]))}else if(d===i.Keys.up||d===i.Keys.left){let t;if(0===r)t=o,e=o.findIndex((e=>!e.disabled&&e[s]));else{t=o.slice(0,r);let i=t.pop();for(;i&&i.disabled;)i=t.pop();e=i&&o.findIndex((e=>e[s]===i[s]))}}if(void 0!==e){const t=e-r;this.onNavigate(h,d,t)}else void 0===e&&o.findIndex((e=>e[s]===l[s]))===o.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=o.slice(r+1).find((e=>!e.disabled));else if(d===i.Keys.up||d===i.Keys.left){const t=o.slice(0,r);for(e=t.pop();e&&e.disabled;)e=t.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,m=!g&&this.getCurrentValueDisabledStatus(s,o,u);p?d===i.Keys.pageUp?(e.preventDefault(),this.base.scrollPopupByPageSize(-1)):d===i.Keys.pageDown?(e.preventDefault(),this.base.scrollPopupByPageSize(1)):e.altKey&&d===i.Keys.up?c():d===i.Keys.enter?(e.preventDefault(),(s&&!g&&e.currentTarget.value?o[u][s]:void 0)?!t&&s&&m?this.clearValueOnEnterOrEsc(e):m||this.applyValueOnEnter(e.currentTarget.value,h):this.applyValueOnEnter(e.currentTarget.value,h)):d===i.Keys.esc&&(!t&&s&&m&&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(j)}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{dataItemKey:e}=this.props,t=K(this.props),s=this.value;return t.findIndex((t=>w(t,s,e)))}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,l=K(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;e.data!==l&&this.checkForDuplicatePlainTextRecords();const h=!p&&d,c=this.value;if(this._valueOnDidUpdate=c,this.base.didUpdate(),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=this.hasDuplicates?this.navigationIndex||0:l.findIndex((e=>w(e,c,i)));"modern"===this.props.groupMode&&o&&c&&(u=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(c[o]));const g=!w(r,c,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)):(this.hasDuplicates||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),this.checkForDuplicatePlainTextRecords()}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const t=r.provideLocalizationService(this).toLanguageString(R,V[R]),s=r.provideLocalizationService(this).toLanguageString(B,V[B]),{dir:o,disabled:l,clearButton:p=e.defaultProps.clearButton,label:h,textField:c,adaptive:g,className:m,style:v,loading:f,iconClassName:y,virtual:C,size:x,rounded:k,fillMode:S,opened:w=this.state.opened,placeholder:E,svgIcon:D}=this.props,F=!this.validityStyles||this.validity.valid,K=void 0!==this.props.filter?this.props.filter:this.state.text,N=I(this.value,c),M=b(K)?K:N,T=p&&(!!M||b(this.value)),P=this.base.vs,O=this.props.id||this._inputId,_=this.mobileMode;P.enabled=void 0!==C,void 0!==C&&(P.skip=C.skip,P.total=C.total,P.pageSize=C.pageSize);const[L,z]=ie(this.props.prefix||u.Fragment),[H,q]=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[x]||x}`]:x,[`k-rounded-${ne[k]||k}`]:k,[`k-input-${S}`]:S,"k-invalid":!F,"k-loading":f,"k-required":this.required,"k-disabled":l},m),ref:this.componentRef,style:h?{...v,width:void 0}:v,dir:o},this.props.prefix&&u.createElement(L,{...z}),this.renderSearchBar(M||"",O,E),T&&!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(H,{...q}),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":w?s:t,icon:y?void 0:"caret-alt-down",svgIcon:D||n.caretAltDownIcon,iconClass:y,size:x,fillMode:S,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!_&&this.renderListContainer()),_&&this.renderAdaptiveListContainer());return h?u.createElement(a.FloatingLabel,{label:h,editorId:O,editorValue:M,editorValid:F,editorDisabled:l,style:{width:v?v.width:void 0},children:A}):A}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,a=K(this.props),n=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const p=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(p),-1===l||b(d))if(""===n)this.handleItemSelect(0,e);else{const n=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:n,max:(r.enabled?r.total:a.length)-1,min:0,skipItems:s||void 0}),void 0!==o&&this.handleItemSelect(o,e)}else this.handleItemSelect(l,e);this.navigationIndex=o}getCurrentValueDisabledStatus(e,t,s){return e&&t&&t[s]&&t[s].disabled}applyValueOnEnter(e,t){const{textField:s,allowCustom:i}=this.props,a=K(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s)===e?this.index:k(a,e,s),l=-1!==o;let r;if(this._suggested="",l)r=a[o];else{if(!i)return this.selectFocusedItem(e,t);r=void 0!==s?{[s]: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{textField:s,allowCustom:i}=this.props,a=K(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s);if(this._suggested="",e===o||""===e&&!b(o))return this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t);const l=k(a,e,s,!0);let r=null;-1!==l?r=a[l]:i&&(r=e?s?{[s]:e}:e:null),this.triggerOnChange(r,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:a={skip:0},focusedItemIndex:n=x}=this.props,o=K(this.props),l=a.skip,r=""===e&&0===l?0:n(o,e,i);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,groupField:o,groupMode:l,list:r,virtual:h,adaptiveTitle:c,groupStickyHeaderItemRender:g}=this.props,m=K(this.props),v=void 0!==this.props.opened?this.props.opened:this.state.opened,b=this.base.getAdaptiveAnimation();let{group:y}=this.state;void 0===y&&void 0!==o&&(y=I(m[0],o));const C={navigatable:!1,navigatableElements:[],expand:v,animation:b,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=Y?{top:0,width:"100%",height:"100%"}:void 0,className:e<=Y?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom k-actionsheet"};return u.createElement(p.ActionSheet,{...C},u.createElement(p.ActionSheetHeader,null,u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",{className:"k-text-center"},c),u.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",themeColor:"base",size:"large",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":!r,"k-list-lg":!0,"k-virtual-list":h,"k-data-table":r,[`k-table-${ae[a]||a}`]:r&&a})},t&&u.createElement("div",{className:"k-table-header"},t),!r&&y&&0!==m.length&&u.createElement(f,{group:y,groupMode:l,render:g}),this.renderList(),s&&u.createElement("div",{className:"k-list-footer"},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,groupField:n,groupMode:o,size:l,list:r,virtual:d,groupStickyHeaderItemRender:p}=this.props,h=K(this.props),c=void 0!==this.props.opened?this.props.opened:this.state.opened,m=e.getPopupSettings(),v=void 0!==m.width?m.width:e.popupWidth;let{group:b}=this.state;return void 0===b&&void 0!==n&&(b=I(h[0],n)),u.createElement(g,{width:v,popupSettings:{...m,anchor:m.anchor||this.element,show:c,popupClass:i.classNames(m.popupClass,"k-list-container","k-combobox-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[h.length]},u.createElement("div",{className:i.classNames({"k-list":!r,[`k-list-${ae[l]||l}`]:!r&&l,"k-virtual-list":d,"k-data-table":r,[`k-table-${ae[l]||l}`]:r&&l})},s&&u.createElement("div",{className:"k-table-header"},s),!r&&b&&0!==h.length&&u.createElement(f,{group:b,groupMode:o,render:p}),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,virtual:l={skip:0,total:void 0}}=this.props,r=K(this.props),d=e.getPopupSettings(),p=e.vs,h=l.skip,c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=`translateY(${p.translate}px)`,m=c?this.getFocusedIndex(this.hasDuplicates):void 0,v=void 0!==this.props.filter?this.props.filter:this.state.text,f=I(this.value,t),y=b(v)&&v!==f?null:this.value,C=this.props.list||q;return u.createElement(C,{id:e.listBoxId,virtual:!!l,show:c,data:r,focusedIndex:m,value:y,textField:t,valueField:s,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,hasDuplicates:this.hasDuplicates,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":!l}),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:l.total})}renderSearchBar(e,t,s){const{tabIndex:i,disabled:a,title:n,ariaLabelledBy:o,ariaDescribedBy:l,dataItemKey:r,virtual:d={skip:0},accessKey:p}=this.props,h=K(this.props),c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=this.value,m=Math.max(0,h.findIndex((e=>w(e,g,r))));this._suggested&&!w(this._valueOnDidUpdate,g,r)&&(this._suggested="");const v={accessKey:p};return u.createElement(te,{id:t,readOnly:c&&this.mobileMode,placeholder:s,tabIndex:i,title:n,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:c,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${m+d.skip}`,role:"combobox",ariaLabelledBy:o,ariaLabel:this.props.ariaLabel,ariaDescribedBy:l,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,...v})}clearValue(){const e=this.base.initState();this._suggested="",this.navigationIndex=void 0,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;!this.hasDuplicates&&(!b(s)&&!b(e)||w(s,e,this.props.dataItemKey))||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}getFocusedIndex(e){const t=this.value,{textField:s,dataItemKey:i,virtual:a={skip:0},focusedItemIndex:n=x,skipDisabledItems:o}=this.props,l=K(this.props),r=this.props.filter?this.props.filter:this.state.text;return e&&void 0!==this.navigationIndex?this.navigationIndex:b(t)&&void 0===r?l.findIndex((e=>w(e,t,i))):r?n(l,r,s):o&&s&&!r&&0===a.skip?l.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[x(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={...G.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,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},oe.defaultProps={...G.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 G(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 s=K(this.props),i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=K(this.props)[e];w(this.state.focusedItem,i,s)||(t.data.focusedItem=i)},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 i=K(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{skipDisabledItems:t,groupField:s,textField:a}=this.props,n=K(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=n[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)c(),this.base.scrollPopupByPageSize(-1);else if(p&&r===i.Keys.pageDown)c(),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(""!==s&&a)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=n.slice(o+1).find((e=>!e.disabled&&e[a]));e=t&&n.findIndex((e=>e[a]===t[a]))}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=n,e=n.findIndex((e=>!e.disabled&&e[a]));else{t=n.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&n.findIndex((e=>e[a]===s[a]))}}if(void 0!==e){const t=e-o;this.onNavigate(h,r,t)}else void 0===e&&n.findIndex((e=>e[a]))===n.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=n.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const t=n.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.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===t&&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(j)}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=""}=this.props,a=K(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){const 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,m=this.value,v=!1!==this.props.clearButton&&!l&&!!m,f=this.props.id||this._inputId,b=this.state.focused;"string"==typeof r&&(this._suggested=r);const[y,C]=ie(this.props.prefix||u.Fragment),[x,k]=ie(this.props.suffix||u.Fragment),I=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-focus":b&&!t,"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(y,{...C}),this.renderSearchBar(m||"",f),l&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&u.createElement(se,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&u.createElement(x,{...k}),this.renderListContainer());return s?u.createElement(a.FloatingLabel,{label:s,editorId:f,editorValue:m,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:I}):I}onNavigate(e,t,s){const i=this.value,{textField:a,focusedItemIndex:n}=this.props,o=K(this.props),l=void 0!==this.state.focusedItem?o.findIndex((e=>w(e,this.state.focusedItem,a))):n?n(o,i,a):o.indexOf(E(o,i,a)),r=this.base.navigation.navigate({keyCode:t,current:l,max:o.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,{textField:n}=this.props,o=K(this.props),l=o[this.focusedIndex()];if(this._suggested="",a&&s===i.Keys.enter&&l&&!l.disabled){const s=I(o[this.focusedIndex(e)],n);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,size:n,groupField:o,list:l,groupStickyHeaderItemRender:r}=this.props,d=K(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:m}=this.state;return void 0===m&&void 0!==o&&(m=I(d[0],o)),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:[d.length]},s&&u.createElement("div",{className:"k-list-header"},s),u.createElement("div",{className:i.classNames("k-list",{[`k-list-${pe[n]||n}`]:n})},!l&&m&&0!==d.length&&u.createElement(f,{group:m,groupMode:"modern",render:r}),this.renderList()),a&&u.createElement("div",{className:"k-list-footer"},a))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:a,groupHeaderItemRender:n}=this.props,o=K(this.props),l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return u.createElement(q,{id:e.listBoxId,show:r,data:o.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:a,groupHeaderItemRender:n,noDataRender:i,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{textField:t}=this.props,s=K(this.props),i=s[x(s,e,t)];if(i){const s=I(i,t);e.toLowerCase()!==s.toLowerCase()&&(this._suggested=s.substring(e.length))}}}focusedIndex(e){const{textField:t,focusedItemIndex:s,skipDisabledItems:i}=this.props,a=K(this.props),n=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return a.findIndex((e=>w(e,this.state.focusedItem,t)));if(s)return s(a,n,t);{const e=a.indexOf(E(a,n,t));return i&&t&&-1===e?a.findIndex((e=>!e.disabled&&e[t])):Math.max(0,e)}}};ce.displayName="AutoComplete",ce.propTypes={...G.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={...G.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ue=ce;const ge=i.createPropsContext(),me=i.withIdHOC(i.withPropsContext(ge,ue));me.displayName="KendoReactAutoComplete";const ve=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:ve,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 Ce=e=>{const{footer:t,children:s,windowWidth:a=0,navigatable:o,navigatableElements:l,expand:r,animation:h,onClose:c,adaptiveTitle:g,mobileFilter:m}=e,v={navigatable:o||!1,navigatableElements:l||[],expand:r,animation:!1!==h,onClose:c,animationStyles:a<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames("k-actionsheet","k-adaptive-actionsheet",a<=500?"k-actionsheet-fullscreen":"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",{className:"k-text-center"},g),u.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),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:c}))),m&&u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),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:xe,roundedMap:ke}=i.kendoThemeMaps,Ie=e=>e.preventDefault(),Se=e=>2===e,we=class e extends u.Component{constructor(e){super(e),this.state={activedescendant:ye.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new G(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{dataItemKey:s,virtual:i}=this.props,a=K(this.props),n=a[e-(i?i.skip:0)],o=this.value.findIndex((e=>w(e,n,s)));this._lastSelectedOrDeslectedItemIndex=a.findIndex((e=>w(e,n,s)));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{allowCustom:s,virtual:i}=this.props,a=K(this.props),n=i?i.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=s&&o,d=a[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{textField:t,groupField:s}=this.props,a=K(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)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(n===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if((e.ctrlKey||e.metaKey)&&"KeyA"===e.code){const e=(this.state.value&&this.state.value.length)===a.length?[]:a;this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=a.slice(this.getFocusedState().focusedIndex);this.itemFocus(a.length-1,p),this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=a.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 t=this.getLastSelectedOrDeselectedIndex(1,d);null===t?e=0!==d?a.slice(d-1,d):[a[d]]:t===d?e=[a[t-1]]:d>=0&&(e=t>d?a.slice(d-1,t):a.slice(t-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 t=this.getLastSelectedOrDeselectedIndex(0,d);null===t?e=d!==a.length-1?a.slice(d,d+1):[a[d]]:t===d?e=a.slice(d,d+2):d>=0&&(e=t>d?a.slice(d+1,t+1):a.slice(t,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(""!==s&&t)if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=0;if(n===i.Keys.down||n===i.Keys.right){const s=a.slice(d+1).find((e=>!e.disabled&&e[t]));e=s&&a.findIndex((e=>e[t]===s[t]))}else if(n===i.Keys.up||n===i.Keys.left){let s;if(-1===d)s=a,e=a.findIndex((e=>!e.disabled&&e[t]));else{s=a.slice(0,d);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&a.findIndex((e=>e[t]===i[t]))}}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=a.slice(d+1).find((e=>!e.disabled));else if(n===i.Keys.up||n===i.Keys.left){const t=a.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.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():n===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:a,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=K(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-${xe[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!==l&&(g=I(d[0],l)),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":xe[a]||a}`]:a,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&u.createElement(f,{group:g,groupMode:"modern",render:o}),this.renderList()),t&&u.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=K(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(v,{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(H,V[H]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(z,V[z]),onApply:this.closePopup}};return u.createElement(Ce,{...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{textField:e,listNoDataRender:t,itemRender:s,groupHeaderItemRender:i,dataItemKey:a,virtual:n={skip:0,total:void 0}}=this.props,o=K(this.props),l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),p=`translateY(${l.translate}px)`;return u.createElement(q,{id:this.base.listBoxId,show:this.opened,data:o.slice(),focusedIndex:r-n.skip,value:this.value,textField:e,valueField:a,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:n.skip,onClick:this.handleItemClick,itemRender:s,groupHeaderItemRender:i,noDataRender:t,onMouseDown:Ie,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=K(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(j)}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,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=""}=this.props,n=K(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,h=this.base.getPopupSettings();if(this.base.didUpdate(),!h.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}=this.props,n=K(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:m}=this.props,{text:v,focused:f,focusedTag:b,currentValue:y}=this.state,C=this.base.vs,x=this.props.id||this._inputId;C.enabled=void 0!==d,void 0!==d&&(C.skip=d.skip,C.total=d.total,C.pageSize=d.pageSize);const k=this.mobileMode&&this.opened?y:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const S=!this.validityStyles||this.validity.valid,w=!!(void 0!==m?m:v)||k&&k.length>0,[E,K]=ie(this.props.prefix||u.Fragment),[N,M]=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-${xe[p]||p}`]:p,[`k-rounded-${ke[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:D},this.props.prefix&&u.createElement(E,{...K}),u.createElement("div",{className:i.classNames("k-input-values")},u.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${xe[p]||p}`]:p}),role:"listbox",id:"tagslist-"+this.base.guid},k&&k.length>0&&u.createElement(be,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:k,guid:this.base.guid,focused:b?k.find((e=>F(e,b,r))):void 0,size:p})),this.renderSearchBar(x)),g&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&u.createElement(N,{...M}),w&&u.createElement(se,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?u.createElement(a.FloatingLabel,{label:s,editorId:x,editorValue:v||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,ariaLabelledBy:l,ariaLabel:r}=this.props,d=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:p}=this.getFocusedState(),h=0!==this.value.length||d?void 0:n,c=i&&i.length>0?void 0:n,g=t===ye.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${p}`,m={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return u.createElement(te,{id:e,size:Math.max((h||"").length,d.length,1),placeholder:this.mobileMode&&this.opened?c:h,value:d,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:a,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:g,ariaDescribedBy:`tagslist-${this.base.guid}${o?" "+o:""}`,ariaLabelledBy:l,ariaRequired:this.required,ariaLabel:r,...m})}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=>F(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{virtual:s}=this.props,i=K(this.props),{focusedIndex:a}=t||this.getFocusedState();void 0!==i[a-(s?s.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,dataItemKey:i,virtual:a,textField:n,focusedItemIndex:o=x,skipDisabledItems:l}=this.props,r=K(this.props),d=a&&a.skip||0;let p;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const h=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=o(r,t,n),{focusedItem:r[p],focusedIndex:p+d,focusedType:1};if(h.length){const e=h[h.length-1];return p=r.findIndex((t=>w(t,e,i))),void 0!==r[p]?{focusedIndex:p+d,focusedItem:r[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&n&&!t&&0===d){const e=r.findIndex((e=>!e.disabled&&e[n]));return{focusedIndex:e,focusedItem:r[e-d],focusedType:1}}return 0===d?{focusedItem:r[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(const 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}};we.displayName="MultiSelect",we.propTypes={...G.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},we.defaultProps={...G.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let Ee=we;const De=i.createPropsContext(),Fe=i.withIdHOC(i.withPropsContext(De,Ee));Fe.displayName="KendoReactMultiSelect";const Ke=e=>u.createElement(q,{...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}}),Ne=i.createPropsContext(),Me=u.forwardRef(((e,t)=>{const s=i.usePropsContext(Ne,e),a=u.useRef(null),n=u.useRef(null),o=i.getScrollbarWidth(),{columns:l=Pe.columns,popupSettings:r=Pe.popupSettings,size:d=Pe.size,rounded:p=Pe.rounded,fillMode:h=Pe.fillMode,className:c,prefix:g,suffix:m,onOpen:v,onClose:f,onFocus:b,onBlur:y,onChange:C,onFilterChange:x,onPageChange:k,...S}=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 w=u.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,D]=u.useState(w),[F,K]=u.useState(!0),[N]=g?ie(s.prefix||u.Fragment):[],[M]=m?ie(s.suffix||u.Fragment):[],T=u.useMemo((()=>{const e=u.createElement("th",{className:"k-table-th",colSpan:l.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,l.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"},l.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,l,E,F]),P=u.useMemo((()=>`calc(${l.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Pe.width))).filter(Boolean).join(" + ")} + ${o}px + 4px)`),[l,o]),O=s.virtual?s.virtual.skip:0,_=u.useCallback(((e,t)=>{const a=l.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,r,d,p=s.data||[];const h=t.index-O;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(p[h]),r=d(p[h-1]),o&&r&&o!==r&&(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}),[l,s.groupField,s.itemRender,s.data,O]),R=u.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:a.current})}),[]),B=u.useCallback((e=>(s.virtual||D(w),R(v,e))),[R,v,s.virtual,w]),L=u.useCallback((e=>R(f,e)),[f]),z=u.useCallback((e=>R(b,e)),[b]),H=u.useCallback((e=>R(y,e)),[y]),V=u.useCallback((e=>R(C,e)),[C]),q=u.useCallback((e=>R(k,e)),[k]),A=u.useCallback((e=>(D(w),R(x,{...e,mobileMode:e.target.mobileMode}))),[x]),W=u.useCallback((e=>{D(e.group)}),[]);u.useEffect((()=>{i.setScrollbarWidth()})),u.useEffect((()=>{const e=s.data;D(w),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const U=u.useCallback((e=>u.createElement(Ke,{...e})),[]);return u.createElement(de,{...S,list:U,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||P,className:r.className},ref:n,header:T,itemRender:_,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:p,fillMode:h,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:B,onClose:L,onFocus:z,onBlur:H,onChange:V,onFilterChange:A,onPageChange:q,onGroupScroll:W,className:i.classNames("k-dropdowngrid",c),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,footer:s.footer,footerClassName:"k-table-footer",prefix:N,suffix:M})})),Te={...le.propTypes,columns:s.any.isRequired},Pe={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Oe(e){return"string"==typeof e?Number(e.replace("px","")):e||void 0}function _e(e,t,s,i){const a=Oe(t.popupSettings.width),n=(void 0!==s.width&&Oe(s.width))!==a,o=void 0!==i.width,l=n?s.width:o?i.width:a,r=Oe(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,l));return n||o?l:r&&a&&r>a?r:a}Me.displayName="KendoMultiColumnComboBox",Me.propTypes=Te;const Re=e=>u.createElement("div",{className:"k-nodata"},u.createElement("div",null,e.children)),{sizeMap:Be,roundedMap:Le}=i.kendoThemeMaps,ze=e=>u.createElement("span",{className:"k-input-value-text"},e.children),He=e=>e.split("_").map((e=>parseInt(e,10))),Ve={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},qe=i.createPropsContext(),Ae=u.forwardRef(((e,t)=>{i.validatePackage(j);const s=i.usePropsContext(qe,e),l={...Ve,...s},c=i.useId(),g=l.id||c,{data:m,dataItemKey:f,popupSettings:y={},style:C,opened:x,disabled:k,onOpen:S=i.noop,onClose:E=i.noop,placeholder:D,label:F,name:K,selectField:N,subItemsField:M,validationMessage:T,valid:P,required:R,validityStyles:B}=l,L=i.getTabIndex(l.tabIndex,k),z=u.useRef(null),H=u.useRef(null),q=u.useRef(null),A=u.useRef(null),W=u.useRef(null),U=u.useRef(null),$=u.useRef(!1),[G,Y]=u.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==G?G: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:P,required:R},Z),se=u.useCallback((()=>H.current&&H.current.focus()),[]);u.useImperativeHandle(z,(()=>({props:l,element:H.current,focus:se}))),u.useImperativeHandle(t,(()=>z.current));const ie=i.useRtl(H,l.dir),ae={width:_e(H,Ve,{...Ve.popupSettings,...y},C),...void 0!==ie?{direction:ie}:{}},[ne,oe]=u.useState(!1),le=void 0!==x?x:ne,[re,de]=u.useState(!1),[pe,he]=u.useState(),ce=!!(pe&&pe<=J&&l.adaptive),[ue,ge]=u.useState(""),me=u.useCallback((()=>{W.current&&W.current.setCustomValidity&&W.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);u.useEffect(me),u.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Oe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const ve=u.useCallback((e=>{if(!le){if(S){const t={...e};S.call(void 0,t)}void 0===x&&oe(!0)}}),[le,x,S]),fe=u.useCallback((e=>{if(le){if(E){const t={...e};E.call(void 0,t)}void 0===x&&(oe(!1),ce&&setTimeout((()=>{var e;Ie(null==(e=A.current)?void 0:e.element)}),300))}}),[le,x,E,ce]),be=u.useCallback((e=>{if(!e.isDefaultPrevented()&&z.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};(le?fe:ve)(t)}}),[le,x,S,E]),ye=u.useCallback((e=>{$.current=!0,e(),window.setTimeout((()=>$.current=!1),0)}),[]),xe=u.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=U.current&&U.current.element;if(!z.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.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(),ve(l)):le||a===i.Keys.esc&&Me(e)}),[le,x,S,E]),ke=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(H.current)}:()=>{Ie(U.current&&U.current.element)}))}),[]),Ie=u.useCallback((e=>{e&&ye((()=>e.focus()))}),[]),Se=u.useCallback((()=>{var e;re||!le||x?s.filterable?Ie(null==(e=q.current)?void 0:e.element):Ie(U.current&&U.current.element):fe({target:z.current})}),[E,s.filterable,re,x,le]),we=u.useCallback((()=>{re&&Ie(H.current)}),[re]),Ee=u.useCallback((e=>{if(!re&&!$.current&&(de(!0),s.onFocus&&z.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),De=u.useCallback((e=>{if(re&&!$.current&&z.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ce||fe(t)}}),[re,s.onBlur,le,x,E]),Fe=u.useCallback((()=>{re&&ye(i.noop),ce&&setTimeout((()=>{var e;Ie(null==(e=A.current)?void 0:e.element)}),300)}),[re,ce]),Ke=u.useCallback(((e,t,i)=>{if(s.onChange){const a={value:t,level:i?He(i):[],...e};s.onChange.call(void 0,a)}Q||Y(t)}),[s.onChange,Q]),Ne=u.useCallback((e=>{if(w(e.item,X,f)||!z.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:a}=e,n={syntheticEvent:a,nativeEvent:i,target:z.current};Ke(n,t,s),fe(n)}),[Q,X,s.onChange,f,le,x,E]),Me=u.useCallback((e=>{if(!z.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};Ke(t,null),fe(t),e.preventDefault()}),[Q,s.onChange,le,x,E]),Te=u.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&z.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:He(i),item:t,nativeEvent:a,syntheticEvent:n,target:z.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Pe=u.useCallback((e=>{if(s.onFilterChange&&z.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:z.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Oe=u.useCallback((e=>{for(const t of e)he(t.target.clientWidth)}),[]),Ae=u.useMemo((()=>Q||!Z?m:i.mapTree(m,M,(e=>i.extendDataItem(e,M,{[N]:w(e,X,f)})))),[m,X,Q,Z,N,M]),We=l.listNoData||Re,Ue=l.valueHolder||ze,$e=r.useLocalization(),Ge=!B||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-${Be[je]||je}`]:je,[`k-rounded-${Le[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:L,accessKey:l.accessKey,id:g,style:F?{...C,width:void 0}:C,dir:ie,ref:H,onKeyDown:k?void 0:xe,onMouseDown:Fe,onClick:k?void 0:be,onFocus:Ee,onBlur:De,role:"combobox","aria-haspopup":"tree","aria-expanded":le,"aria-disabled":k,"aria-label":F,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-required":R},u.createElement("span",{className:"k-input-inner"},(ee||D)&&u.createElement(Ue,{item:X},ee||D)),l.loading&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!k&&u.createElement("span",{onClick:Me,className:"k-clear-value",title:$e.toLanguageString(_,V[_]),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:K,ref:W,tabIndex:-1,"aria-hidden":!0,title:F,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 k-list-container"),style:ae,anchor:y.anchor||H.current,show:le,onOpen:Se,onClose:we},l.filterable&&u.createElement(v,{value:void 0===l.filter?ue:l.filter,ref:q,onChange:Pe,onKeyDown:ke,size:je,rounded:Ye,fillMode:Je,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),m.length>0?u.createElement(h.TreeView,{style:{height:y.height},ref:U,tabIndex:L,data:Ae,focusIdField:f,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:Te,size:je,item:l.item,dir:ie,animate:y.animate}):u.createElement(We,null,$e.toLanguageString(O,V[O])))),ce&&(()=>{const e=l.filterable?u.createElement(v,{value:void 0===l.filter?ue:l.filter,ref:A,onChange:Pe,onKeyDown:ke,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>fe(e),windowWidth:pe,mobileFilter:e};return u.createElement(Ce,{...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"},m.length>0?u.createElement(h.TreeView,{ref:U,tabIndex:L,data:Ae,focusIdField:f,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:Te,size:je,item:l.item,dir:ie,animate:y.animate}):u.createElement(We,null,$e.toLanguageString(O,V[O]))))))})());return F?u.createElement(a.FloatingLabel,{label:F,editorValue:ee,editorPlaceholder:D,editorValid:Ge,editorDisabled:k,editorId:g,style:{width:C?C.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};Ae.displayName="KendoReactDropDownTree",Ae.propTypes=We;const{sizeMap:Ue,roundedMap:$e}=i.kendoThemeMaps,Ge=e=>e.split("_").map((e=>parseInt(e,10))),je={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Ye=i.createPropsContext(),Je=u.forwardRef(((e,t)=>{const s=i.usePropsContext(Ye,e);i.validatePackage(j);const n=i.useId(),l=s.id||n,{data:d=[],dataItemKey:c,style:g={},placeholder:m,label:f,name:b,validationMessage:y,valid:C,tags:x,value:k,opened:S,disabled:E,popupSettings:D=je.popupSettings,checkField:K=je.checkField,checkIndeterminateField:N=je.checkIndeterminateField,subItemsField:M=je.subItemsField,size:T=je.size,rounded:P=je.rounded,fillMode:_=je.fillMode,required:R=je.required,validityStyles:B=je.validityStyles,onOpen:L=i.noop,onClose:q=i.noop}=s,A=i.getTabIndex(s.tabIndex,E),W=u.useRef(null),U=u.useRef(null),$=u.useRef(null),G=u.useRef(null),Y=u.useRef(null),Q=u.useRef(null),X=u.useRef(!1),Z=u.useRef([]),ee=u.useRef(null),[te,ie]=u.useState(),[ae,ne]=u.useState(!1),[oe,le]=u.useState(!1),[re,de]=u.useState(),[pe,he]=u.useState([]),[ce,ue]=u.useState(""),ge=!!(re&&re<=J&&s.adaptive),me=void 0!==S?S:ae,ve=!(!Array.isArray(k)||!k.length),fe=((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:y,valid:C,required:R},ve),ye=i.useRtl(U,s.dir),xe={width:_e(U,je,D,g),...void 0!==ye?{direction:ye}:{}},ke=u.useCallback((()=>U.current&&U.current.focus()),[]);Z.current=void 0===x?(k||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...x],u.useImperativeHandle(W,(()=>({props:s,element:U.current,focus:ke}))),u.useImperativeHandle(t,(()=>W.current));const Ie=u.useCallback((()=>{Y.current&&Y.current.setCustomValidity&&Y.current.setCustomValidity(fe.valid?"":void 0===y?"Please select a value from the list!":y)}),[y,fe]);u.useEffect(Ie),u.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Je.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}}),[]),u.useEffect((()=>{ee.current&&me&&ee.current.setPosition(ee.current._popup)}),[k,me]);const Se=u.useCallback(((e,t,i)=>{if(s.onChange){const a={items:t,operation:i,...e};s.onChange.call(void 0,a)}}),[s.onChange]),we=u.useCallback((e=>{if(w(e.item,k,c)||!W.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,a={syntheticEvent:i,nativeEvent:s,target:W.current};Se(a,[t],"toggle")}),[k,c,Se]),Ee=u.useCallback((e=>{if(!me){if(L){const t={...e};L.call(void 0,t)}void 0===S&&(ne(!0),he(k||[]),ge&&setTimeout((()=>{var e;Ke(null==(e=G.current)?void 0:e.element)}),300))}}),[me,S,L,ge,G]),De=u.useCallback((e=>{if(me){if(q){const t={...e};q.call(void 0,t)}void 0===S&&ne(!1)}}),[me,S,q]),Fe=u.useCallback((e=>{X.current=!0,e(),window.setTimeout((()=>X.current=!1),0)}),[]),Ke=u.useCallback((e=>{e&&Fe((()=>e.focus()))}),[Fe]),Ne=u.useCallback((()=>{var e;!oe&&me?De({target:W.current}):s.filterable?Ke(null==(e=$.current)?void 0:e.element):Ke(Q.current&&Q.current.element)}),[oe,me,Ke,De,s.filterable]),Me=u.useCallback((()=>{oe&&Ke(U.current)}),[oe,Ke]),Te=u.useCallback((e=>{if(!oe&&!X.current&&(le(!0),s.onFocus&&W.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onFocus.call(void 0,t)}}),[oe,s.onFocus]),Pe=u.useCallback((e=>{if(oe&&!X.current&&W.current){le(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ge||De(t)}}),[oe,s.onBlur,me,S,q]),Oe=u.useCallback((()=>{oe&&Fe(i.noop)}),[oe,Fe]),Be=u.useCallback((e=>{if(!e.isDefaultPrevented()&&W.current){le(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};me||Ee(t)}}),[me,Ee]),Le=u.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=Q.current&&Q.current.element;if(!W.current||e.isDefaultPrevented()&&(null==(t=$.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(k&&k.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete)){const e=Z.current;let t,s=te?e.findIndex((e=>F(e,te,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&&Se(l,e[s].data,"delete"),t!==te&&ie(t)}if(me)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),De(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=$.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 Fe((()=>{var e;Ke(null==(e=$.current)?void 0:e.element)}))}Fe(i.noop)}else a===i.Keys.down&&Fe((()=>{var e;Ke((null==(e=$.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down&&(e.preventDefault(),Ee(l))}),[me,De,Ke,Fe,Ee,te,c,k,Se]),ze=u.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Fe(t===i.Keys.up?()=>{Ke(U.current)}:()=>{Ke(Q.current&&Q.current.element)}))}),[Ke,Fe]),He=u.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};Se(t,[],"clear"),De(t),e.preventDefault()}),[Se,De]),Ve=u.useCallback(((e,t)=>{var s;De({target:W.current}),oe||Ke(null==(s=$.current)?void 0:s.element),Se({syntheticEvent:t,nativeEvent:t.nativeEvent,target:W.current},e,"delete")}),[Se,De,Ke,oe]),qe=u.useCallback((e=>{if(s.onExpandChange&&W.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:Ge(i),item:t,nativeEvent:a,syntheticEvent:n,target:W.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Ae=u.useCallback((e=>{if(s.onFilterChange&&W.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:W.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ue(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),We=u.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onCancel&&s.onCancel.call(void 0,t),De(t),e.preventDefault()}),[s.onCancel,De]),Je=u.useCallback((e=>{for(let t of e)de(t.target.clientWidth)}),[]),Qe=s.listNoData||Re,Xe=r.useLocalization(),Ze=!B||fe.valid,et=ge&&me?pe:Z.current,tt=u.createElement(u.Fragment,null,u.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${Ue[T]||T}`]:T,[`k-rounded-${$e[P]||P}`]:P,[`k-input-${_}`]:_,"k-focus":oe&&!E,"k-invalid":!Ze,"k-disabled":E,"k-loading":s.loading,"k-required":R}),tabIndex:A,accessKey:s.accessKey,id:l,style:f?{...g,width:void 0}:g,dir:ye,ref:U,onKeyDown:E?void 0:Le,onMouseDown:Oe,onFocus:Te,onBlur:Pe,role:"combobox","aria-haspopup":"tree","aria-expanded":me,"aria-disabled":E,"aria-label":f,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy?s.ariaDescribedBy:"tagslist-"+l,"aria-required":s.required,onClick:E?void 0:Be},u.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ue[T]||T}`]:T})},et.length>0&&u.createElement(be,{tag:s.tag,onTagDelete:Ve,data:et,guid:l,focused:te?Z.current.find((e=>F(e,te,c))):void 0,size:T})),u.createElement("span",{className:"k-input-inner"},0===et.length&&u.createElement("span",{className:"k-input-value-text"},m)),s.loading&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ve&&!E&&et.length>0&&u.createElement(se,{onClick:He}),u.createElement("select",{name:b,ref:Y,tabIndex:-1,"aria-hidden":!0,title:f,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},u.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,k):k})),!ge&&u.createElement(o.Popup,{...D,popupClass:i.classNames(D.popupClass,"k-multiselecttree-popup"),className:i.classNames(D.className,{"k-rtl":"rtl"===ye}),style:xe,anchor:D.anchor||U.current,show:me,onOpen:Ne,onClose:Me,ref:ee},s.filterable&&u.createElement(v,{value:void 0===s.filter?ce:s.filter,ref:$,onChange:Ae,onKeyDown:ze,tabIndex:A,size:T,rounded:P,fillMode:_,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),d.length>0?u.createElement(h.TreeView,{style:{height:D.height},ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:qe,checkboxes:!0,size:T,item:s.item,dir:ye}):u.createElement(Qe,null,Xe.toLanguageString(O,V[O])))),ge&&(()=>{const e=s.filterable?u.createElement(v,{value:void 0===s.filter?ce:s.filter,ref:G,onChange:Ae,onKeyDown:ze,size:T,rounded:P,fillMode:_}):null,t={adaptiveTitle:s.adaptiveTitle,expand:me,onClose:e=>s.onCancel?We(e):He(e),windowWidth:re,mobileFilter:e,footer:{cancelText:Xe.toLanguageString(H,V[H]),onCancel:e=>s.onCancel?We(e):He(e),applyText:Xe.toLanguageString(z,V[z]),onApply:e=>De(e)}};return u.createElement(Ce,{...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:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:qe,checkboxes:!0,size:T,item:s.item,dir:ye}):u.createElement(Qe,null,Xe.toLanguageString(O,V[O]))))))})());return f?u.createElement(a.FloatingLabel,{label:f,editorValue:ve,editorPlaceholder:m,editorValid:Ze,editorDisabled:E,editorId:l,style:{width:g?g.width:void 0},children:tt,dir:ye}):tt})),Qe={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};Je.displayName="KendoReactMultiSelectTree",Je.propTypes=Qe;const Xe=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=me,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=Ae,e.DropDownTreePropsContext=qe,e.List=q,e.ListContainer=g,e.ListFilter=v,e.ListItem=T,e.MultiColumnComboBox=Me,e.MultiColumnComboBoxPropsContext=Ne,e.MultiSelect=Fe,e.MultiSelectPropsContext=De,e.MultiSelectTree=Je,e.MultiSelectTreePropsContext=Ye,e.MultiSelectWithoutContext=Ee,e.SearchBar=te,e.TagList=be,e.dropdownsMessages=V,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=Xe(n,r);if("clear"===l)return[];if("delete"===l){const e=Xe(s,r);return n.filter((t=>!e[r(t)]))}const p=s[0],h=r(p),c=i.getter(o),u=[...e],g=[];let m,v=[];for(;u.length;){const e=u.pop();if(h===r(e)){v=g.map((e=>e.item)),m=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(m)||[]];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(m),y.push(...b.filter((e=>!d[r(e)])));const e=v.filter((e=>!d[r(e)])),t=Xe(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(m),t=Xe(b,r),s=Xe(v,r);y.push(...n.filter((i=>{const a=r(i);return!t[a]&&e!==a&&!s[a]})))}return y},e.getValueMap=Xe,e.nodata=O,e.scrollToItem=C}));
|
|
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);const g=e=>{const{children:t,width:s,dir:i,itemsCount:a,popupSettings:n}=e;return u.createElement(o.Popup,{style:{width:s,direction:i},contentKey:a&&a.join(),...n},t)},m=u.forwardRef(((e,t)=>{const s=u.useRef(null),{renderListFilterWrapper:a=!1,renderPrefixSeparator:o=!1,...r}=e,d=i.useUnstyled(),p=d&&d.uDropDownsBase;u.useImperativeHandle(t,(()=>s.current));const h=u.createElement(l.TextBox,{...r,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:p})),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(u.Fragment,null,u.createElement(l.InputPrefix,null,u.createElement(i.IconWrap,{name:"search",icon:n.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:p}))})),o&&u.createElement(l.InputSeparator,null))});return a?u.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:p}))}," ",h," "):h}));m.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"]),renderListFilterWrapper:s.bool,renderPrefixSeparator:s.bool},m.displayName="KendoReactListFilter";const v=m,f=e=>{const{group:t,groupMode:s,render:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase,l=u.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:o}))},"classic"===s?t:u.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:o}))},t));return void 0!==a?a.call(void 0,l,e):l},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)},C=(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)},x=(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},k=(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=>w(e,t,s)));-1!==i&&e.splice(i,1)}))},w=(e,t,s)=>e===t||b(e)===b(t)&&I(e,s)===I(t,s),E=(e,t,s)=>{if(t){const i=k(e,t,s,!0);return-1!==i?e[i]:e[x(e,t,s)]}return e[0]},D=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},F=(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(!w(e[i],t[i],s))return!1;return!0})(e.data,t.data,s)),K=e=>{const{data:t=[],groupField:s}=e;return s?t.filter((e=>s&&void 0!==e[s])):t},N=e=>e.preventDefault(),M=e=>{const{selected:t,defaultItem:s,textField:a}=e,n=i.useUnstyled(),o=n&&n.uDropDownsBase;return u.createElement("div",{onClick:e.onClick,onMouseDown:N,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionlabel({c:o,selected:t}))},I(s,a)||"")},T=e=>{const{selected:t,group:s,dataItem:a,virtual:n,groupMode:o,disabled:l,id:r,focused:d,render:p}=e,h=i.useUnstyled(),c=h&&h.uDropDownsBase,g=u.createElement("li",{id:r,role:"option","aria-selected":t,"aria-disabled":!!l||void 0,className:i.classNames(i.uDropDownsBase.li({c:c,selected:t,focused:d,first:!!s&&"classic"===o,disabled:l})),onClick:t=>e.onClick(e.index,t),style:{position:n?"relative":"unset"}},u.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:c}))},I(a,e.textField).toString()),void 0!==s&&"classic"===o?u.createElement("div",{className:i.classNames(i.uDropDownsBase.itemGroupLabel({c:c}))},s):null);return void 0!==p?p.call(void 0,g,e):g},P=e=>{const{group:t,virtual:s,render:a,isMultiColumn:n=!1,id:o}=e,l=i.useUnstyled(),r=l&&l.uDropDownsBase,d=u.createElement("li",{id:o,role:"group",className:i.classNames(i.uDropDownsBase.groupLi({c:r,isMultiColumn:n})),style:n?{boxSizing:"inherit"}:{position:s?"relative":"unset"}},u.createElement("span",{className:a?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:r,isMultiColumn:n}))},t));return void 0!==a?a.call(void 0,d,e):d},O="dropdowns.nodata",_="dropdowns.clear",R="dropdowns.comboArrowBtnAriaLabelExpand",B="dropdowns.comboArrowBtnAriaLabelCollapse",L="dropdowns.dropDownListArrowBtnAriaLabel",z="dropdowns.apply",H="dropdowns.cancel",V={[_]:"clear",[O]:"NO DATA FOUND.",[R]:"expand combobox",[B]:"collapse combobox",[L]:"select",[z]:"Apply",[H]:"Cancel"},q=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,{id:n,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:p,listRef:h,wrapperRef:c,listClassName:g,ariaSetSize:m}=e,v=(()=>{const{textField:t,valueField:s,groupField:i,groupMode:a,isMultiColumn:n,optionsGuid:o,skip:l=0,virtual:r,focusedIndex:d,hasDuplicates:p,highlightSelected:h=!0,value:c,data:g,itemRender:m,groupHeaderItemRender:v}=e,f=Array.isArray(c);let b=0;return g.map(((y,C)=>{const x=l+C,k=l+C+b,S=p?!!c&&d===C:!y.disabled&&(h&&(!f&&w(y,c,s)||f&&-1!==c.findIndex((e=>w(e,y,s)))));let E,D,F;return C>0&&void 0!==i&&(D=I(y,i),F=I(g[C-1],i),D&&F&&D!==F&&(E=D)),void 0!==E&&"modern"===a&&(b+=1),[void 0!==E&&"modern"===a&&u.createElement(P,{id:`option-${o}-${k}`,virtual:r,key:x+"-group-item",group:E,isMultiColumn:n,render:v}),u.createElement(T,{id:`option-${o}-${void 0!==E&&"modern"===a?k+1:k}`,virtual:r,dataItem:y,groupMode:a,selected:S,focused:d===C,index:x,key:x,onClick:e.onClick,textField:t,group:E,render:m,disabled:y.disabled})]}))})();return v.length?u.createElement("div",{className:l,style:d,ref:c,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},u.createElement("ul",{id:n,role:"listbox","aria-hidden":!o||void 0,"aria-setsize":m,className:g||i.classNames(i.uDropDownsBase.ul({c:a})),ref:h,style:p},v),e.scroller&&u.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:a}))},e.scroller)):(()=>{const s=e.noDataRender,n=u.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:a}))},u.createElement("div",null,t.toLanguageString(O,V[O])));return s?s.call(void 0,n):n})()},A="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);let W=class{constructor(){this.table=null,this.total=0,this.enabled=!1,this.skip=0,this.pageSize=0,this.PageChange=null,this.scrollElement=null,this.listTransform="",this.itemHeight=0,this.containerHeight=0,this.reactVersion=Number.parseFloat(u.version),this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.listTranslate=0,this.list=null,this.container=null,this.calcScrollElementHeight=()=>{var e;this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight;const s=this.itemHeight*this.total-((null==(e=this.list)?void 0:e.offsetHeight)||0);this.containerHeight=A?Math.min(17895697,s):s;const i=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==i+"px",t&&(this.scrollElement.style.height=i+"px")),this.scrollSyncing=!1,t},this.scrollerRef=e=>{this.container=e,e&&(e.setAttribute("unselectable","on"),window.setTimeout(this.calcScrollElementHeight.bind(this),0))},this.getRowHeightService=i.memoizeOne(((e,t)=>new i.RowHeightService(t,e,0))),this.firstLoaded=this.pageSize,this.lastLoaded=this.skip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}translateTo(e,t){this.listTranslate=e,this.enabled&&this.list&&(A||this.reactVersion<=17||t?this.list.style.transform="translateY("+e+"px)":this.listTransform="translateY("+e+"px)")}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)}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0,!0))}scrollToEnd(){if(this.container&&this.list){this.calcScrollElementHeight();const{scrollHeight:e,offsetHeight:t}=this.container;this.container.scrollTop=e,this.translateTo(e-t,!0)}}scrollHandler(e){if(!this.enabled||!this.container||!this.list)return;if(this.scrollSyncing)return void(this.scrollSyncing=!1);this.rowHeightService=this.getRowHeightService(this.itemHeight,this.total);const t=this.container.scrollTop,s=this.lastScrollTop>=t,i=!s,a=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let n=this.rowHeightService.index(t),o=this.rowHeightService.offset(n);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=n+this.pageSize-this.total;t>0&&(n-=t,o=this.rowHeightService.offset(n)),this.firstLoaded=n,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&n-1<=this.firstLoaded){const t=a===this.itemHeight;if(0===this.skip&&t)this.lastScrollTop=0,this.firstLoaded=0,this.lastLoaded=this.pageSize,this.container.scrollTop=0,this.translateTo(0,!0);else{const t=Math.floor(.3*this.pageSize);this.firstLoaded=Math.max(n-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}},U=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 $=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new W,this.navigation=new U,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(0===e.skip)s.reset();else{let i=s.translate;0===i&&(s.calcScrollElementHeight(),i=s.itemHeight*e.skip,s.translateTo(i,!0)),t<0&&i>0&&(i+=s.itemHeight*(e.pageSize/4)),s.container&&(s.container.scrollTop=i),this.scrollToItem(t,!0)}},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}didUpdate(){this.vs.listTransform&&this.vs.list&&(this.vs.list.style.transform=this.vs.listTransform,this.vs.listTransform="")}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),0===e&&t&&0===this.vs.skip)this.vs.reset();else if(i&&e>=0){const s=this.vs,a=s.container||i.parentNode,n=void 0!==t?t:s.enabled;C(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&&w(e,i[0],a)?this.triggerOnPageChange(t,n.skip-1,n.pageSize):!o&&n.skip+n.pageSize<n.total&&w(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)}getAdaptiveAnimation(){const e=this.getPopupSettings();return void 0===e.animate||e.animate}getGroupedDataModernMode(e,t){const 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}};$.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},$.propTypes={...$.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},$.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let G=$;const j={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"},Y=500,J=768,Q=class e extends u.Component{constructor(e){super(e),this.state={},this._element=null,this.base=new G(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({preventScroll:!0})},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i,defaultItem:a}=this.props,n=K(this.props),o=s?s.skip:0,l=-1===e&&void 0!==a?a:n[e-o],r=!w(l,this.value,i);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,size:a,groupField:n,groupStickyHeaderItemRender:o,list:l,unstyled:r}=this.props,d=K(this.props),p=this.base,h=p.getPopupSettings(),c=void 0!==this.props.opened?this.props.opened:this.state.opened,m=void 0!==h.width?h.width:p.popupWidth,v=r&&r.uDropDownList,b={dir:void 0!==s?s:p.dirCalculated,width:m,popupSettings:{...h,popupClass:i.classNames(h.popupClass,i.uDropDownList.listContainer({c:v})),anchor:h.anchor||this.element,show:c,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[d.length]};let{group:y}=this.state;return void 0===y&&void 0!==n&&(y=I(d[0],n)),u.createElement(g,{...b},this.renderListFilter(),e&&u.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:v}))},e),u.createElement("div",{className:i.classNames(i.uDropDownList.list({c:v,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!l&&y&&0!==d.length&&u.createElement(f,{group:y,groupMode:"modern",render:o}),this.renderList()),t&&u.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:v}))},t))},this.renderList=()=>{const{textField:e,dataItemKey:t,virtual:s={skip:0,total:void 0},groupHeaderItemRender:a,listNoDataRender:n,itemRender:o,unstyled:l}=this.props,r=K(this.props),d=l&&l.uDropDownList,p=this.base.vs,h=s.skip,c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=this.base.getPopupSettings(),m=`translateY(${p.translate}px)`;return u.createElement(q,{id:this._listboxId,show:c,data:r.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:t,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>p.list=this.base.list=e,wrapperStyle:{maxHeight:g.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:d})),listStyle:p.enabled?{transform:m}:void 0,key:"listkey",skip:h,onClick:this.handleItemClick,itemRender:o,groupHeaderItemRender:a,noDataRender:n,onScroll:this.onScroll,wrapperRef:p.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:s.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=K(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(v,{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,renderListFilterWrapper:!0})},this.renderDefaultItem=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=this.props;return void 0!==t&&u.createElement(M,{defaultItem:t,textField:e,selected:w(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{dataItemKey:t}=this.props,s=K(this.props);let i=s.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,s.findIndex((e=>w(e,this.value,t))));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:m}=this.props;for(;u<r;u++)if(p=I(i[u].item,g),h=o&&y(p,n,m),c=y(p,a,m),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{filterable:t,disabled:s,defaultItem:a,leftRightKeysNavigation:n=!0,virtual:o={skip:0,total:0,pageSize:0},dataItemKey:l,groupField:r="",textField:d,skipDisabledItems:p=!0}=this.props,h=K(this.props),c=this.value,u=h.findIndex((e=>w(e,c,l))),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=e.keyCode,v=m===i.Keys.home||m===i.Keys.end,f=m===i.Keys.up||m===i.Keys.down,b=!g&&(e.altKey&&m===i.Keys.down||m===i.Keys.enter||m===i.Keys.space),y=g&&(e.altKey&&m===i.Keys.up||m===i.Keys.esc),C=n&&(m===i.Keys.left||m===i.Keys.right),x=f||C&&!t||v,k=this.base.initState();if(k.syntheticEvent=e,!s){if(v&&this.base.vs.enabled)m===i.Keys.home?0!==o.skip?(this.base.triggerOnPageChange(k,0,o.pageSize),this._navigated=!0):this.triggerOnChange(h[0],k):o.skip<o.total-o.pageSize?(this.base.triggerOnPageChange(k,o.total-o.pageSize,o.pageSize),this._navigated=!0):this.triggerOnChange(h[h.length-1],k);else if(g&&m===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(g&&m===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if(g&&m===i.Keys.enter){const t=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(h,t)?(this.triggerOnChange(null,k),this.applyState(k)):this.handleItemSelect(t,k),this.base.togglePopup(k),e.preventDefault()}else if(b||y)y&&this.resetValueIfDisabledItem(),this.base.togglePopup(k),e.preventDefault();else if(x){if(this._lastKeypressIsFilter=!1,""!==r&&d)if(!p&&g)this.onNavigate(k,m);else{let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(u+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===u&&a)e=-1;else if(-1===u)t=h,e=h.findIndex((e=>!e.disabled&&e[d]));else{t=h.slice(0,u);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-u;this.onNavigate(k,m,t)}else void 0===e&&h.findIndex((e=>e[d]===c[d]))===h.length-1&&this.onNavigate(k,m)}else if(!p&&g||v)this.onNavigate(k,m);else if(d){let e;if(m===i.Keys.down||m===i.Keys.right){const t=h.slice(u+1).find((e=>!e.disabled&&e[d]));e=t&&h.findIndex((e=>e[d]===t[d]))}else if(m===i.Keys.up||m===i.Keys.left){let t;if(0===u&&a)e=-1;else if(-1===u)t=h,e=h.find((e=>!e.disabled&&e[d]));else{t=h.slice(0,u);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&h.findIndex((e=>e[d]===s[d]))}}if(void 0!==e){const t=e-u;this.onNavigate(k,m,t)}else void 0===e&&h.findIndex((e=>e[d]===c[d]))===h.length-1&&this.onNavigate(k,m)}else this.onNavigate(k,m);e.preventDefault()}this.applyState(k)}},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(j)}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{dataItemKey:e}=this.props,t=K(this.props),s=this.value;return t.findIndex((t=>w(t,s,e)))}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,l=K(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.didUpdate(),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=>w(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=!w(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,this.base.vs.enabled):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(L,V[L]),{style:t,className:s,label:o,dir:l,virtual:p,size:h,rounded:c,fillMode:g,adaptive:m,unstyled:v}=this.props,{windowWidth:f=0}=this.state,b=void 0!==this.props.opened?this.props.opened:this.state.opened,y=this.value,C=I(y,this.props.textField),x=!this.validityStyles||this.validity.valid,k=this.base,S=k.vs,E=f<=J&&m,D=v&&v.uDropDownList;S.enabled=void 0!==p,void 0!==p&&(k.vs.skip=p.skip,k.vs.total=p.total,k.vs.pageSize=p.pageSize);const{dataItemKey:F,disabled:N,tabIndex:M,loading:T,iconClassName:P,svgIcon:O,valueRender:_}=this.props,R=K(this.props),{focused:B}=this.state,z=R.findIndex((e=>w(e,y,F))),H=u.createElement("span",{id:this._inputId,className:i.classNames(i.uDropDownList.input({c:D}))},C&&u.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:D}))},C)),q=void 0!==_?_.call(void 0,H,y):H,A=u.createElement(u.Fragment,null,u.createElement("span",{ref:this.componentRef,className:i.classNames(i.uDropDownList.wrapper({c:D,size:h,rounded:c,fillMode:g,focused:B,disabled:N,invalid:!x,loading:T,required:this.required}),s),style:o?{...t,width:void 0}:t,dir:l,onMouseDown:b?e=>{"INPUT"!==e.target.nodeName&&(this.focusElement(this.base.wrapper),e.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:i.getTabIndex(M,N),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:N?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":N||void 0,"aria-haspopup":"listbox","aria-expanded":b||!1,"aria-owns":this._listboxId,"aria-activedescendant":b?"option-"+this._guid+"-"+(z+(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,"aria-controls":this._listboxId,id:this.props.id,title:this.props.title},q,T&&u.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:D})),name:"loading"}),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":e,"aria-hidden":!0,size:h,fillMode:g,iconClass:P,className:i.classNames(i.uDropDownList.iconButton({c:D})),rounded:null,themeColor:"base",icon:P?void 0:"caret-alt-down",svgIcon:O||n.caretAltDownIcon,onMouseDown:e=>this.state.focused&&e.preventDefault()}),this.dummySelect(y),!E&&this.renderListContainer()),E&&this.renderAdaptiveListContainer());return o?u.createElement(a.FloatingLabel,{label:o,editorValue:C,editorValid:x,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:A}):A}onNavigate(e,t,s){const{defaultItem:i,dataItemKey:a,virtual:n={skip:0,total:0,pageSize:0}}=this.props,o=K(this.props),l=this.base.vs,r=this.value,d=o.findIndex((e=>w(e,r,a))),p=this.base.navigation.navigate({current:n.skip+d,max:(l.enabled?n.total:o.length)-1,min:void 0!==i?-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,unstyled:c}=this.props,g=K(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,v=c&&c.uDropDownList,b=c&&c.uDropDownList,y={navigatable:!1,navigatableElements:[],expand:m,animation:!0,onClose:e=>this.handleWrapperClick(e),animationStyles:e<=Y?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:v,isFullScreen:e<=Y}))};let{group:C}=this.state;return void 0===C&&void 0!==l&&(C=I(g[0],l)),u.createElement(p.ActionSheet,{...y},u.createElement(p.ActionSheetHeader,{className:i.classNames(i.uDropDownsActionSheet.header({c:b}))},u.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:b}))},u.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:b}))},u.createElement("div",null,o)),u.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:b}))},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:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:b}))},this.renderListFilter())),u.createElement(p.ActionSheetContent,{overflowHidden:!0},t&&u.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:v}))},t),u.createElement("div",{className:i.classNames(i.uDropDownList.list({c:v,size:a,virtual:this.base.vs.enabled}))},this.renderDefaultItem(),!h&&C&&0!==g.length&&u.createElement(f,{group:C,groupMode:"modern",render:r}),this.renderList()),s&&u.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:v}))},s)))}getFocusedIndex(){const e=this.value,{textField:t,dataItemKey:s,virtual:i={skip:0},focusedItemIndex:a=x,filterable:n,skipDisabledItems:o=!0}=this.props,l=K(this.props),r=this.props.filter?this.props.filter:this.state.text;return o&&t&&!r&&!e?l.findIndex((e=>!e.disabled&&e[t])):b(e)&&void 0===r||n&&""===r?l.findIndex((t=>w(t,e,s))):r?this._lastKeypressIsFilter?a(l,r,t):l.findIndex((t=>w(t,e,s))):0===i.skip?0:-1}focusElement(e){this._skipFocusEvent=!0,e.focus(),window.setTimeout((()=>this._skipFocusEvent=!1),30)}triggerOnChange(e,t){w(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 e=K(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,renderListFilterWrapper:s.bool,...G.propTypes},Q.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...G.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};let X=Q;const Z=i.createPropsContext(),ee=i.withIdHOC(i.withPropsContext(Z,i.withUnstyledHOC(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,tabIndex:a,accessKey:n}=this.props,o={tabIndex:a,accessKey:n},l=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",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-label":this.props.ariaLabel,"aria-required":this.props.ariaRequired,"aria-controls":this.props.ariaControls,...o});return i?i.call(void 0,l):l}};const se=e=>{const t=r.useLocalization(),s=i.useUnstyled(),a=s&&s.uDropDownsBase,o=t.toLanguageString(_,V[_]);return u.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:a})),role:"button",onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},u.createElement(i.IconWrap,{name:"x",icon:n.xIcon}))},ie=i.useCustomComponent,{sizeMap:ae,roundedMap:ne}=i.kendoThemeMaps,oe=class e extends u.Component{constructor(e){super(e),this.state={},this.base=new G(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.duplicates=[],this.hasDuplicates=!1,this.focus=()=>{this._input&&this._input.focus()},this.checkForDuplicatePlainTextRecords=()=>{const e=void 0!==this.props.textField,t=void 0!==this.props.dataItemKey;if(this.props.data&&this.props.data.length>0&&!e&&!t){const e=this.props.data;this.duplicates=(e=>{const t=e.filter(((t,s)=>e.some(((e,i)=>e===t&&i!==s))));return Array.from(new Set(t))})(e),this.hasDuplicates=this.duplicates.length>0}},this.handleItemSelect=(e,t)=>{const{virtual:s,dataItemKey:i}=this.props,a=K(this.props)[e-(s?s.skip:0)],n=this.hasDuplicates||!w(a,this.value,i);this.triggerOnChange(a,t),void 0!==this.state.text&&(t.data.text=void 0),n&&this.base.triggerPageChangeCornerItems(a,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{skipDisabledItems:t,textField:s}=this.props,i=K(this.props),a=this.getFocusedIndex(),n=this.getCurrentValueDisabledStatus(s,i,a),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&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.closeOpenedApplyStateNonMobileMode=(e,t)=>{t&&!this.mobileMode&&this.base.togglePopup(e)},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(v,{value:s,ref:e=>this._adaptiveFilterInput=e&&e.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:"large",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 a=K(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.navigationIndex=e,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}=this.props,i=K(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{skipDisabledItems:t,textField:s,dataItemKey:a,groupField:n}=this.props,o=K(this.props),l=this.value,r=Math.max(0,o.findIndex((e=>w(e,l,a)))),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(),""!==n&&s)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,d);else{let e=0;if(d===i.Keys.down||d===i.Keys.right){const t=o.slice(r+1<o.length?r+1:r).find((e=>!e.disabled&&e[s]));e=t&&o.findIndex((e=>e[s]===t[s]))}else if(d===i.Keys.up||d===i.Keys.left){let t;if(0===r)t=o,e=o.findIndex((e=>!e.disabled&&e[s]));else{t=o.slice(0,r);let i=t.pop();for(;i&&i.disabled;)i=t.pop();e=i&&o.findIndex((e=>e[s]===i[s]))}}if(void 0!==e){const t=e-r;this.onNavigate(h,d,t)}else void 0===e&&o.findIndex((e=>e[s]===l[s]))===o.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=o.slice(r+1).find((e=>!e.disabled));else if(d===i.Keys.up||d===i.Keys.left){const t=o.slice(0,r);for(e=t.pop();e&&e.disabled;)e=t.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,m=!g&&this.getCurrentValueDisabledStatus(s,o,u);p?d===i.Keys.pageUp?(e.preventDefault(),this.base.scrollPopupByPageSize(-1)):d===i.Keys.pageDown?(e.preventDefault(),this.base.scrollPopupByPageSize(1)):e.altKey&&d===i.Keys.up?c():d===i.Keys.enter?(e.preventDefault(),(s&&!g&&e.currentTarget.value?o[u][s]:void 0)?!t&&s&&m?this.clearValueOnEnterOrEsc(e):m||this.applyValueOnEnter(e.currentTarget.value,h):this.applyValueOnEnter(e.currentTarget.value,h)):d===i.Keys.esc&&(!t&&s&&m&&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(j)}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{dataItemKey:e}=this.props,t=K(this.props),s=this.value;return t.findIndex((t=>w(t,s,e)))}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,l=K(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;e.data!==l&&this.checkForDuplicatePlainTextRecords();const h=!p&&d,c=this.value;if(this._valueOnDidUpdate=c,this.base.didUpdate(),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=this.hasDuplicates?this.navigationIndex||0:l.findIndex((e=>w(e,c,i)));"modern"===this.props.groupMode&&o&&c&&(u=null==(s=this.base.getGroupedDataModernMode(l,n))?void 0:s.map((e=>e[o])).indexOf(c[o]));const g=!w(r,c,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)):(this.hasDuplicates||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),this.checkForDuplicatePlainTextRecords()}componentWillUnmount(){var e;null!=(e=this.document)&&e.body&&this.observerResize&&this.observerResize.disconnect()}render(){const t=r.provideLocalizationService(this).toLanguageString(R,V[R]),s=r.provideLocalizationService(this).toLanguageString(B,V[B]),{dir:o,disabled:l,clearButton:p=e.defaultProps.clearButton,label:h,textField:c,adaptive:g,className:m,style:v,loading:f,iconClassName:y,virtual:C,size:x,rounded:k,fillMode:S,opened:w=this.state.opened,placeholder:E,svgIcon:D}=this.props,F=!this.validityStyles||this.validity.valid,K=void 0!==this.props.filter?this.props.filter:this.state.text,N=I(this.value,c),M=b(K)?K:N,T=p&&(!!M||b(this.value)),P=this.base.vs,O=this.props.id||this._inputId,_=this.mobileMode;P.enabled=void 0!==C,void 0!==C&&(P.skip=C.skip,P.total=C.total,P.pageSize=C.pageSize);const[L,z]=ie(this.props.prefix||u.Fragment),[H,q]=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[x]||x}`]:x,[`k-rounded-${ne[k]||k}`]:k,[`k-input-${S}`]:S,"k-invalid":!F,"k-loading":f,"k-required":this.required,"k-disabled":l},m),ref:this.componentRef,style:h?{...v,width:void 0}:v,dir:o},this.props.prefix&&u.createElement(L,{...z}),this.renderSearchBar(M||"",O,E),T&&!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(H,{...q}),u.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":w?s:t,icon:y?void 0:"caret-alt-down",svgIcon:D||n.caretAltDownIcon,iconClass:y,size:x,fillMode:S,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!_&&this.renderListContainer()),_&&this.renderAdaptiveListContainer());return h?u.createElement(a.FloatingLabel,{label:h,editorId:O,editorValue:M,editorValid:F,editorDisabled:l,style:{width:v?v.width:void 0},children:A}):A}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,a=K(this.props),n=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const p=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(p),-1===l||b(d))if(""===n)this.handleItemSelect(0,e);else{const n=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:n,max:(r.enabled?r.total:a.length)-1,min:0,skipItems:s||void 0}),void 0!==o&&this.handleItemSelect(o,e)}else this.handleItemSelect(l,e);this.navigationIndex=o}getCurrentValueDisabledStatus(e,t,s){return e&&t&&t[s]&&t[s].disabled}applyValueOnEnter(e,t){const{textField:s,allowCustom:i}=this.props,a=K(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s)===e?this.index:k(a,e,s),l=-1!==o;let r;if(this._suggested="",l)r=a[o];else{if(!i)return this.selectFocusedItem(e,t);r=void 0!==s?{[s]: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{textField:s,allowCustom:i}=this.props,a=K(this.props),n=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s);if(this._suggested="",e===o||""===e&&!b(o))return this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t);const l=k(a,e,s,!0);let r=null;-1!==l?r=a[l]:i&&(r=e?s?{[s]:e}:e:null),this.triggerOnChange(r,t),void 0!==this.state.text&&(t.data.text=void 0,this.base.filterChanged("",t)),this.closeOpenedApplyStateNonMobileMode(t,n),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:a={skip:0},focusedItemIndex:n=x}=this.props,o=K(this.props),l=a.skip,r=""===e&&0===l?0:n(o,e,i);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,groupField:o,groupMode:l,list:r,virtual:h,adaptiveTitle:c,groupStickyHeaderItemRender:g}=this.props,m=K(this.props),v=void 0!==this.props.opened?this.props.opened:this.state.opened,b=this.base.getAdaptiveAnimation();let{group:y}=this.state;void 0===y&&void 0!==o&&(y=I(m[0],o));const C={navigatable:!1,navigatableElements:[],expand:v,animation:b,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=Y?{top:0,width:"100%",height:"100%"}:void 0,className:e<=Y?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom k-actionsheet"};return u.createElement(p.ActionSheet,{...C},u.createElement(p.ActionSheetHeader,null,u.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},u.createElement("div",{className:"k-actionsheet-title"},u.createElement("div",{className:"k-text-center"},c),u.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),u.createElement("div",{className:"k-actionsheet-actions"},u.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",themeColor:"base",size:"large",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,{overflowHidden:!0},u.createElement("div",{className:"k-list-container"},u.createElement("div",{className:i.classNames({"k-list":!r,"k-list-lg":!0,"k-virtual-list":h,"k-data-table":r,[`k-table-${ae[a]||a}`]:r&&a})},t&&u.createElement("div",{className:"k-table-header"},t),!r&&y&&0!==m.length&&u.createElement(f,{group:y,groupMode:l,render:g}),this.renderList(),s&&u.createElement("div",{className:"k-list-footer"},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:a,groupField:n,groupMode:o,size:l,list:r,virtual:d,groupStickyHeaderItemRender:p}=this.props,h=K(this.props),c=void 0!==this.props.opened?this.props.opened:this.state.opened,m=e.getPopupSettings(),v=void 0!==m.width?m.width:e.popupWidth;let{group:b}=this.state;return void 0===b&&void 0!==n&&(b=I(h[0],n)),u.createElement(g,{width:v,popupSettings:{...m,anchor:m.anchor||this.element,show:c,popupClass:i.classNames(m.popupClass,"k-list-container","k-combobox-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[h.length]},u.createElement("div",{className:i.classNames({"k-list":!r,[`k-list-${ae[l]||l}`]:!r&&l,"k-virtual-list":d,"k-data-table":r,[`k-table-${ae[l]||l}`]:r&&l})},s&&u.createElement("div",{className:"k-table-header"},s),!r&&b&&0!==h.length&&u.createElement(f,{group:b,groupMode:o,render:p}),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,virtual:l={skip:0,total:void 0}}=this.props,r=K(this.props),d=e.getPopupSettings(),p=e.vs,h=l.skip,c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=`translateY(${p.translate}px)`,m=c?this.getFocusedIndex(this.hasDuplicates):void 0,v=void 0!==this.props.filter?this.props.filter:this.state.text,f=I(this.value,t),y=b(v)&&v!==f?null:this.value,C=this.props.list||q;return u.createElement(C,{id:e.listBoxId,virtual:!!l,show:c,data:r,focusedIndex:m,value:y,textField:t,valueField:s,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:e.guid,hasDuplicates:this.hasDuplicates,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":!l}),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:l.total})}renderSearchBar(e,t,s){const{tabIndex:i,disabled:a,title:n,ariaLabelledBy:o,ariaDescribedBy:l,dataItemKey:r,virtual:d={skip:0},accessKey:p}=this.props,h=K(this.props),c=void 0!==this.props.opened?this.props.opened:this.state.opened,g=this.value,m=Math.max(0,h.findIndex((e=>w(e,g,r))));this._suggested&&!w(this._valueOnDidUpdate,g,r)&&(this._suggested="");const v={accessKey:p};return u.createElement(te,{id:t,readOnly:c&&this.mobileMode,placeholder:s,tabIndex:i,title:n,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:c,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${m+d.skip}`,role:"combobox",ariaLabelledBy:o,ariaLabel:this.props.ariaLabel,ariaDescribedBy:l,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,...v})}clearValue(){const e=this.base.initState();this._suggested="",this.navigationIndex=void 0,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;!this.hasDuplicates&&(!b(s)&&!b(e)||w(s,e,this.props.dataItemKey))||(void 0===this.props.value&&(t.data.value=e),this._valueDuringOnChange=e,t.events.push({type:"onChange"}))}getFocusedIndex(e){const t=this.value,{textField:s,dataItemKey:i,virtual:a={skip:0},focusedItemIndex:n=x,skipDisabledItems:o}=this.props,l=K(this.props),r=this.props.filter?this.props.filter:this.state.text;return e&&void 0!==this.navigationIndex?this.navigationIndex:b(t)&&void 0===r?l.findIndex((e=>w(e,t,i))):r?n(l,r,s):o&&s&&!r&&0===a.skip?l.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[x(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={...G.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,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},oe.defaultProps={...G.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 G(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 s=K(this.props),i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=K(this.props)[e];w(this.state.focusedItem,i,s)||(t.data.focusedItem=i)},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 i=K(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{skipDisabledItems:t,groupField:s,textField:a}=this.props,n=K(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=n[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)c(),this.base.scrollPopupByPageSize(-1);else if(p&&r===i.Keys.pageDown)c(),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(""!==s&&a)if(!this.props.skipDisabledItems&&p)this.onNavigate(h,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=n.slice(o+1).find((e=>!e.disabled&&e[a]));e=t&&n.findIndex((e=>e[a]===t[a]))}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=n,e=n.findIndex((e=>!e.disabled&&e[a]));else{t=n.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&n.findIndex((e=>e[a]===s[a]))}}if(void 0!==e){const t=e-o;this.onNavigate(h,r,t)}else void 0===e&&n.findIndex((e=>e[a]))===n.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=n.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const t=n.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.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===t&&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(j)}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=""}=this.props,a=K(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){const 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,m=this.value,v=!1!==this.props.clearButton&&!l&&!!m,f=this.props.id||this._inputId,b=this.state.focused;"string"==typeof r&&(this._suggested=r);const[y,C]=ie(this.props.prefix||u.Fragment),[x,k]=ie(this.props.suffix||u.Fragment),I=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-focus":b&&!t,"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(y,{...C}),this.renderSearchBar(m||"",f),l&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&u.createElement(se,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&u.createElement(x,{...k}),this.renderListContainer());return s?u.createElement(a.FloatingLabel,{label:s,editorId:f,editorValue:m,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:I}):I}onNavigate(e,t,s){const i=this.value,{textField:a,focusedItemIndex:n}=this.props,o=K(this.props),l=void 0!==this.state.focusedItem?o.findIndex((e=>w(e,this.state.focusedItem,a))):n?n(o,i,a):o.indexOf(E(o,i,a)),r=this.base.navigation.navigate({keyCode:t,current:l,max:o.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,{textField:n}=this.props,o=K(this.props),l=o[this.focusedIndex()];if(this._suggested="",a&&s===i.Keys.enter&&l&&!l.disabled){const s=I(o[this.focusedIndex(e)],n);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,size:n,groupField:o,list:l,groupStickyHeaderItemRender:r}=this.props,d=K(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:m}=this.state;return void 0===m&&void 0!==o&&(m=I(d[0],o)),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:[d.length]},s&&u.createElement("div",{className:"k-list-header"},s),u.createElement("div",{className:i.classNames("k-list",{[`k-list-${pe[n]||n}`]:n})},!l&&m&&0!==d.length&&u.createElement(f,{group:m,groupMode:"modern",render:r}),this.renderList()),a&&u.createElement("div",{className:"k-list-footer"},a))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:a,groupHeaderItemRender:n}=this.props,o=K(this.props),l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return u.createElement(q,{id:e.listBoxId,show:r,data:o.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:a,groupHeaderItemRender:n,noDataRender:i,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{textField:t}=this.props,s=K(this.props),i=s[x(s,e,t)];if(i){const s=I(i,t);e.toLowerCase()!==s.toLowerCase()&&(this._suggested=s.substring(e.length))}}}focusedIndex(e){const{textField:t,focusedItemIndex:s,skipDisabledItems:i}=this.props,a=K(this.props),n=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return a.findIndex((e=>w(e,this.state.focusedItem,t)));if(s)return s(a,n,t);{const e=a.indexOf(E(a,n,t));return i&&t&&-1===e?a.findIndex((e=>!e.disabled&&e[t])):Math.max(0,e)}}};ce.displayName="AutoComplete",ce.propTypes={...G.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={...G.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ue=ce;const ge=i.createPropsContext(),me=i.withIdHOC(i.withPropsContext(ge,ue));me.displayName="KendoReactAutoComplete";const ve=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:ve,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 Ce=e=>{const{footer:t,children:s,windowWidth:a=0,navigatable:o,navigatableElements:l,expand:r,animation:h,onClose:c,adaptiveTitle:g,mobileFilter:m}=e,v={navigatable:o||!1,navigatableElements:l||[],expand:r,animation:!1!==h,onClose:c,animationStyles:a<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames("k-actionsheet","k-adaptive-actionsheet",a<=500?"k-actionsheet-fullscreen":"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",{className:"k-text-center"},g),u.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),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:c}))),m&&u.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),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:xe,roundedMap:ke}=i.kendoThemeMaps,Ie=e=>e.preventDefault(),Se=e=>2===e,we=class e extends u.Component{constructor(e){super(e),this.state={activedescendant:ye.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new G(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{dataItemKey:s,virtual:i}=this.props,a=K(this.props),n=a[e-(i?i.skip:0)],o=this.value.findIndex((e=>w(e,n,s)));this._lastSelectedOrDeslectedItemIndex=a.findIndex((e=>w(e,n,s)));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{allowCustom:s,virtual:i}=this.props,a=K(this.props),n=i?i.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=s&&o,d=a[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{textField:t,groupField:s}=this.props,a=K(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)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(n===i.Keys.pageDown)e.preventDefault(),this.base.scrollPopupByPageSize(1);else if((e.ctrlKey||e.metaKey)&&"KeyA"===e.code){const e=(this.state.value&&this.state.value.length)===a.length?[]:a;this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=a.slice(this.getFocusedState().focusedIndex);this.itemFocus(a.length-1,p),this.updateStateOnKeyboardNavigation(e,p)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=a.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 t=this.getLastSelectedOrDeselectedIndex(1,d);null===t?e=0!==d?a.slice(d-1,d):[a[d]]:t===d?e=[a[t-1]]:d>=0&&(e=t>d?a.slice(d-1,t):a.slice(t-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 t=this.getLastSelectedOrDeselectedIndex(0,d);null===t?e=d!==a.length-1?a.slice(d,d+1):[a[d]]:t===d?e=a.slice(d,d+2):d>=0&&(e=t>d?a.slice(d+1,t+1):a.slice(t,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(""!==s&&t)if(!this.props.skipDisabledItems&&l)this.onNavigate(p,n);else{let e=0;if(n===i.Keys.down||n===i.Keys.right){const s=a.slice(d+1).find((e=>!e.disabled&&e[t]));e=s&&a.findIndex((e=>e[t]===s[t]))}else if(n===i.Keys.up||n===i.Keys.left){let s;if(-1===d)s=a,e=a.findIndex((e=>!e.disabled&&e[t]));else{s=a.slice(0,d);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&a.findIndex((e=>e[t]===i[t]))}}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=a.slice(d+1).find((e=>!e.disabled));else if(n===i.Keys.up||n===i.Keys.left){const t=a.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.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():n===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:a,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=K(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-${xe[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!==l&&(g=I(d[0],l)),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":xe[a]||a}`]:a,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&u.createElement(f,{group:g,groupMode:"modern",render:o}),this.renderList()),t&&u.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=K(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(v,{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(H,V[H]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(z,V[z]),onApply:this.closePopup}};return u.createElement(Ce,{...o},u.createElement(p.ActionSheetContent,{overflowHidden:!0},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{textField:e,listNoDataRender:t,itemRender:s,groupHeaderItemRender:i,dataItemKey:a,virtual:n={skip:0,total:void 0}}=this.props,o=K(this.props),l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),p=`translateY(${l.translate}px)`;return u.createElement(q,{id:this.base.listBoxId,show:this.opened,data:o.slice(),focusedIndex:r-n.skip,value:this.value,textField:e,valueField:a,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:n.skip,onClick:this.handleItemClick,itemRender:s,groupHeaderItemRender:i,noDataRender:t,onMouseDown:Ie,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let a=K(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(j)}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,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=""}=this.props,n=K(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,h=this.base.getPopupSettings();if(this.base.didUpdate(),!h.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}=this.props,n=K(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:m}=this.props,{text:v,focused:f,focusedTag:b,currentValue:y}=this.state,C=this.base.vs,x=this.props.id||this._inputId;C.enabled=void 0!==d,void 0!==d&&(C.skip=d.skip,C.total=d.total,C.pageSize=d.pageSize);const k=this.mobileMode&&this.opened?y:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const S=!this.validityStyles||this.validity.valid,w=!!(void 0!==m?m:v)||k&&k.length>0,[E,K]=ie(this.props.prefix||u.Fragment),[N,M]=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-${xe[p]||p}`]:p,[`k-rounded-${ke[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:D},this.props.prefix&&u.createElement(E,{...K}),u.createElement("div",{className:i.classNames("k-input-values")},u.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${xe[p]||p}`]:p}),role:"listbox",id:"tagslist-"+this.base.guid},k&&k.length>0&&u.createElement(be,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:k,guid:this.base.guid,focused:b?k.find((e=>F(e,b,r))):void 0,size:p})),this.renderSearchBar(x)),g&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&u.createElement(N,{...M}),w&&u.createElement(se,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?u.createElement(a.FloatingLabel,{label:s,editorId:x,editorValue:v||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,ariaLabelledBy:l,ariaLabel:r}=this.props,d=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:p}=this.getFocusedState(),h=0!==this.value.length||d?void 0:n,c=i&&i.length>0?void 0:n,g=t===ye.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${p}`,m={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return u.createElement(te,{id:e,size:Math.max((h||"").length,d.length,1),placeholder:this.mobileMode&&this.opened?c:h,value:d,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:a,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:g,ariaDescribedBy:`tagslist-${this.base.guid}${o?" "+o:""}`,ariaLabelledBy:l,ariaRequired:this.required,ariaLabel:r,...m})}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=>F(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{virtual:s}=this.props,i=K(this.props),{focusedIndex:a}=t||this.getFocusedState();void 0!==i[a-(s?s.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,dataItemKey:i,virtual:a,textField:n,focusedItemIndex:o=x,skipDisabledItems:l}=this.props,r=K(this.props),d=a&&a.skip||0;let p;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const h=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=o(r,t,n),{focusedItem:r[p],focusedIndex:p+d,focusedType:1};if(h.length){const e=h[h.length-1];return p=r.findIndex((t=>w(t,e,i))),void 0!==r[p]?{focusedIndex:p+d,focusedItem:r[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&n&&!t&&0===d){const e=r.findIndex((e=>!e.disabled&&e[n]));return{focusedIndex:e,focusedItem:r[e-d],focusedType:1}}return 0===d?{focusedItem:r[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(const 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}};we.displayName="MultiSelect",we.propTypes={...G.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},we.defaultProps={...G.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let Ee=we;const De=i.createPropsContext(),Fe=i.withIdHOC(i.withPropsContext(De,Ee));Fe.displayName="KendoReactMultiSelect";const Ke=e=>u.createElement(q,{...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}}),Ne=i.createPropsContext(),Me=u.forwardRef(((e,t)=>{const s=i.usePropsContext(Ne,e),a=u.useRef(null),n=u.useRef(null),o=i.getScrollbarWidth(),{columns:l=Pe.columns,popupSettings:r=Pe.popupSettings,size:d=Pe.size,rounded:p=Pe.rounded,fillMode:h=Pe.fillMode,className:c,prefix:g,suffix:m,onOpen:v,onClose:f,onFocus:b,onBlur:y,onChange:C,onFilterChange:x,onPageChange:k,...S}=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 w=u.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,D]=u.useState(w),[F,K]=u.useState(!0),[N]=g?ie(s.prefix||u.Fragment):[],[M]=m?ie(s.suffix||u.Fragment):[],T=u.useMemo((()=>{const e=u.createElement("th",{className:"k-table-th",colSpan:l.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,l.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"},l.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,l,E,F]),P=u.useMemo((()=>`calc(${l.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Pe.width))).filter(Boolean).join(" + ")} + ${o}px + 4px)`),[l,o]),O=s.virtual?s.virtual.skip:0,_=u.useCallback(((e,t)=>{const a=l.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,r,d,p=s.data||[];const h=t.index-O;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(p[h]),r=d(p[h-1]),o&&r&&o!==r&&(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}),[l,s.groupField,s.itemRender,s.data,O]),R=u.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:a.current})}),[]),B=u.useCallback((e=>(s.virtual||D(w),R(v,e))),[R,v,s.virtual,w]),L=u.useCallback((e=>R(f,e)),[f]),z=u.useCallback((e=>R(b,e)),[b]),H=u.useCallback((e=>R(y,e)),[y]),V=u.useCallback((e=>R(C,e)),[C]),q=u.useCallback((e=>R(k,e)),[k]),A=u.useCallback((e=>(D(w),R(x,{...e,mobileMode:e.target.mobileMode}))),[x]),W=u.useCallback((e=>{D(e.group)}),[]);u.useEffect((()=>{i.setScrollbarWidth()})),u.useEffect((()=>{const e=s.data;D(w),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const U=u.useCallback((e=>u.createElement(Ke,{...e})),[]);return u.createElement(de,{...S,list:U,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||P,className:r.className},ref:n,header:T,itemRender:_,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:p,fillMode:h,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:B,onClose:L,onFocus:z,onBlur:H,onChange:V,onFilterChange:A,onPageChange:q,onGroupScroll:W,className:i.classNames("k-dropdowngrid",c),required:s.required,adaptive:s.adaptive,adaptiveFilter:s.adaptiveFilter,adaptiveTitle:s.adaptiveTitle,footer:s.footer,footerClassName:"k-table-footer",prefix:N,suffix:M})})),Te={...le.propTypes,columns:s.any.isRequired},Pe={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Oe(e){return"string"==typeof e?Number(e.replace("px","")):e||void 0}function _e(e,t,s,i){const a=Oe(t.popupSettings.width),n=(void 0!==s.width&&Oe(s.width))!==a,o=void 0!==i.width,l=n?s.width:o?i.width:a,r=Oe(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,l));return n||o?l:r&&a&&r>a?r:a}Me.displayName="KendoMultiColumnComboBox",Me.propTypes=Te;const Re=e=>u.createElement("div",{className:"k-nodata"},u.createElement("div",null,e.children)),{sizeMap:Be,roundedMap:Le}=i.kendoThemeMaps,ze=e=>u.createElement("span",{className:"k-input-value-text"},e.children),He=e=>e.split("_").map((e=>parseInt(e,10))),Ve={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},qe=i.createPropsContext(),Ae=u.forwardRef(((e,t)=>{i.validatePackage(j);const s=i.usePropsContext(qe,e),l={...Ve,...s},c=i.useId(),g=l.id||c,{data:m,dataItemKey:f,popupSettings:y={},style:C,opened:x,disabled:k,onOpen:S=i.noop,onClose:E=i.noop,placeholder:D,label:F,name:K,selectField:N,subItemsField:M,validationMessage:T,valid:P,required:R,validityStyles:B}=l,L=i.getTabIndex(l.tabIndex,k),z=u.useRef(null),H=u.useRef(null),q=u.useRef(null),A=u.useRef(null),W=u.useRef(null),U=u.useRef(null),$=u.useRef(!1),[G,Y]=u.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==G?G: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:P,required:R},Z),se=u.useCallback((()=>H.current&&H.current.focus()),[]);u.useImperativeHandle(z,(()=>({props:l,element:H.current,focus:se}))),u.useImperativeHandle(t,(()=>z.current));const ie=i.useRtl(H,l.dir),ae={width:_e(H,Ve,{...Ve.popupSettings,...y},C),...void 0!==ie?{direction:ie}:{}},[ne,oe]=u.useState(!1),le=void 0!==x?x:ne,[re,de]=u.useState(!1),[pe,he]=u.useState(),ce=!!(pe&&pe<=J&&l.adaptive),[ue,ge]=u.useState(""),me=u.useCallback((()=>{W.current&&W.current.setCustomValidity&&W.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);u.useEffect(me),u.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Oe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const ve=u.useCallback((e=>{if(!le){if(S){const t={...e};S.call(void 0,t)}void 0===x&&oe(!0)}}),[le,x,S]),fe=u.useCallback((e=>{if(le){if(E){const t={...e};E.call(void 0,t)}void 0===x&&(oe(!1),ce&&setTimeout((()=>{var e;Ie(null==(e=A.current)?void 0:e.element)}),300))}}),[le,x,E,ce]),be=u.useCallback((e=>{if(!e.isDefaultPrevented()&&z.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};(le?fe:ve)(t)}}),[le,x,S,E]),ye=u.useCallback((e=>{$.current=!0,e(),window.setTimeout((()=>$.current=!1),0)}),[]),xe=u.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=U.current&&U.current.element;if(!z.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.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(),ve(l)):le||a===i.Keys.esc&&Me(e)}),[le,x,S,E]),ke=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(H.current)}:()=>{Ie(U.current&&U.current.element)}))}),[]),Ie=u.useCallback((e=>{e&&ye((()=>e.focus()))}),[]),Se=u.useCallback((()=>{var e;re||!le||x?s.filterable?Ie(null==(e=q.current)?void 0:e.element):Ie(U.current&&U.current.element):fe({target:z.current})}),[E,s.filterable,re,x,le]),we=u.useCallback((()=>{re&&Ie(H.current)}),[re]),Ee=u.useCallback((e=>{if(!re&&!$.current&&(de(!0),s.onFocus&&z.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),De=u.useCallback((e=>{if(re&&!$.current&&z.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ce||fe(t)}}),[re,s.onBlur,le,x,E]),Fe=u.useCallback((()=>{re&&ye(i.noop),ce&&setTimeout((()=>{var e;Ie(null==(e=A.current)?void 0:e.element)}),300)}),[re,ce]),Ke=u.useCallback(((e,t,i)=>{if(s.onChange){const a={value:t,level:i?He(i):[],...e};s.onChange.call(void 0,a)}Q||Y(t)}),[s.onChange,Q]),Ne=u.useCallback((e=>{if(w(e.item,X,f)||!z.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:a}=e,n={syntheticEvent:a,nativeEvent:i,target:z.current};Ke(n,t,s),fe(n)}),[Q,X,s.onChange,f,le,x,E]),Me=u.useCallback((e=>{if(!z.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:z.current};Ke(t,null),fe(t),e.preventDefault()}),[Q,s.onChange,le,x,E]),Te=u.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&z.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:He(i),item:t,nativeEvent:a,syntheticEvent:n,target:z.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Pe=u.useCallback((e=>{if(s.onFilterChange&&z.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:z.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Oe=u.useCallback((e=>{for(const t of e)he(t.target.clientWidth)}),[]),Ae=u.useMemo((()=>Q||!Z?m:i.mapTree(m,M,(e=>i.extendDataItem(e,M,{[N]:w(e,X,f)})))),[m,X,Q,Z,N,M]),We=l.listNoData||Re,Ue=l.valueHolder||ze,$e=r.useLocalization(),Ge=!B||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-${Be[je]||je}`]:je,[`k-rounded-${Le[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:L,accessKey:l.accessKey,id:g,style:F?{...C,width:void 0}:C,dir:ie,ref:H,onKeyDown:k?void 0:xe,onMouseDown:Fe,onClick:k?void 0:be,onFocus:Ee,onBlur:De,role:"combobox","aria-haspopup":"tree","aria-expanded":le,"aria-disabled":k,"aria-label":F,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-required":R},u.createElement("span",{className:"k-input-inner"},(ee||D)&&u.createElement(Ue,{item:X},ee||D)),l.loading&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!k&&u.createElement("span",{onClick:Me,className:"k-clear-value",title:$e.toLanguageString(_,V[_]),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:K,ref:W,tabIndex:-1,"aria-hidden":!0,title:F,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 k-list-container"),style:ae,anchor:y.anchor||H.current,show:le,onOpen:Se,onClose:we},l.filterable&&u.createElement(v,{value:void 0===l.filter?ue:l.filter,ref:q,onChange:Pe,onKeyDown:ke,size:je,rounded:Ye,fillMode:Je,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),m.length>0?u.createElement(h.TreeView,{style:{height:y.height},ref:U,tabIndex:L,data:Ae,focusIdField:f,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:Te,size:je,item:l.item,dir:ie,animate:y.animate}):u.createElement(We,null,$e.toLanguageString(O,V[O])))),ce&&(()=>{const e=l.filterable?u.createElement(v,{value:void 0===l.filter?ue:l.filter,ref:A,onChange:Pe,onKeyDown:ke,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>fe(e),windowWidth:pe,mobileFilter:e};return u.createElement(Ce,{...t},u.createElement(p.ActionSheetContent,{overflowHidden:!0},u.createElement("div",{className:"k-list-container"},u.createElement("div",{className:"k-list k-list-lg"},m.length>0?u.createElement(h.TreeView,{ref:U,tabIndex:L,data:Ae,focusIdField:f,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:Te,size:je,item:l.item,dir:ie,animate:y.animate}):u.createElement(We,null,$e.toLanguageString(O,V[O]))))))})());return F?u.createElement(a.FloatingLabel,{label:F,editorValue:ee,editorPlaceholder:D,editorValid:Ge,editorDisabled:k,editorId:g,style:{width:C?C.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};Ae.displayName="KendoReactDropDownTree",Ae.propTypes=We;const{sizeMap:Ue,roundedMap:$e}=i.kendoThemeMaps,Ge=e=>e.split("_").map((e=>parseInt(e,10))),je={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Ye=i.createPropsContext(),Je=u.forwardRef(((e,t)=>{const s=i.usePropsContext(Ye,e);i.validatePackage(j);const n=i.useId(),l=s.id||n,{data:d=[],dataItemKey:c,style:g={},placeholder:m,label:f,name:b,validationMessage:y,valid:C,tags:x,value:k,opened:S,disabled:E,popupSettings:D=je.popupSettings,checkField:K=je.checkField,checkIndeterminateField:N=je.checkIndeterminateField,subItemsField:M=je.subItemsField,size:T=je.size,rounded:P=je.rounded,fillMode:_=je.fillMode,required:R=je.required,validityStyles:B=je.validityStyles,onOpen:L=i.noop,onClose:q=i.noop}=s,A=i.getTabIndex(s.tabIndex,E),W=u.useRef(null),U=u.useRef(null),$=u.useRef(null),G=u.useRef(null),Y=u.useRef(null),Q=u.useRef(null),X=u.useRef(!1),Z=u.useRef([]),ee=u.useRef(null),[te,ie]=u.useState(),[ae,ne]=u.useState(!1),[oe,le]=u.useState(!1),[re,de]=u.useState(),[pe,he]=u.useState([]),[ce,ue]=u.useState(""),ge=!!(re&&re<=J&&s.adaptive),me=void 0!==S?S:ae,ve=!(!Array.isArray(k)||!k.length),fe=((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:y,valid:C,required:R},ve),ye=i.useRtl(U,s.dir),xe={width:_e(U,je,D,g),...void 0!==ye?{direction:ye}:{}},ke=u.useCallback((()=>U.current&&U.current.focus()),[]);Z.current=void 0===x?(k||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...x],u.useImperativeHandle(W,(()=>({props:s,element:U.current,focus:ke}))),u.useImperativeHandle(t,(()=>W.current));const Ie=u.useCallback((()=>{Y.current&&Y.current.setCustomValidity&&Y.current.setCustomValidity(fe.valid?"":void 0===y?"Please select a value from the list!":y)}),[y,fe]);u.useEffect(Ie),u.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Je.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}}),[]),u.useEffect((()=>{ee.current&&me&&ee.current.setPosition(ee.current._popup)}),[k,me]);const Se=u.useCallback(((e,t,i)=>{if(s.onChange){const a={items:t,operation:i,...e};s.onChange.call(void 0,a)}}),[s.onChange]),we=u.useCallback((e=>{if(w(e.item,k,c)||!W.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,a={syntheticEvent:i,nativeEvent:s,target:W.current};Se(a,[t],"toggle")}),[k,c,Se]),Ee=u.useCallback((e=>{if(!me){if(L){const t={...e};L.call(void 0,t)}void 0===S&&(ne(!0),he(k||[]),ge&&setTimeout((()=>{var e;Ke(null==(e=G.current)?void 0:e.element)}),300))}}),[me,S,L,ge,G]),De=u.useCallback((e=>{if(me){if(q){const t={...e};q.call(void 0,t)}void 0===S&&ne(!1)}}),[me,S,q]),Fe=u.useCallback((e=>{X.current=!0,e(),window.setTimeout((()=>X.current=!1),0)}),[]),Ke=u.useCallback((e=>{e&&Fe((()=>e.focus()))}),[Fe]),Ne=u.useCallback((()=>{var e;!oe&&me?De({target:W.current}):s.filterable?Ke(null==(e=$.current)?void 0:e.element):Ke(Q.current&&Q.current.element)}),[oe,me,Ke,De,s.filterable]),Me=u.useCallback((()=>{oe&&Ke(U.current)}),[oe,Ke]),Te=u.useCallback((e=>{if(!oe&&!X.current&&(le(!0),s.onFocus&&W.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onFocus.call(void 0,t)}}),[oe,s.onFocus]),Pe=u.useCallback((e=>{if(oe&&!X.current&&W.current){le(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ge||De(t)}}),[oe,s.onBlur,me,S,q]),Oe=u.useCallback((()=>{oe&&Fe(i.noop)}),[oe,Fe]),Be=u.useCallback((e=>{if(!e.isDefaultPrevented()&&W.current){le(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};me||Ee(t)}}),[me,Ee]),Le=u.useCallback((e=>{var t,s;const{keyCode:a,altKey:n}=e,o=Q.current&&Q.current.element;if(!W.current||e.isDefaultPrevented()&&(null==(t=$.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};if(k&&k.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete)){const e=Z.current;let t,s=te?e.findIndex((e=>F(e,te,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&&Se(l,e[s].data,"delete"),t!==te&&ie(t)}if(me)if(a===i.Keys.esc||n&&a===i.Keys.up)e.preventDefault(),De(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=$.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 Fe((()=>{var e;Ke(null==(e=$.current)?void 0:e.element)}))}Fe(i.noop)}else a===i.Keys.down&&Fe((()=>{var e;Ke((null==(e=$.current)?void 0:e.element)||o)}));else n&&a===i.Keys.down&&(e.preventDefault(),Ee(l))}),[me,De,Ke,Fe,Ee,te,c,k,Se]),ze=u.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),Fe(t===i.Keys.up?()=>{Ke(U.current)}:()=>{Ke(Q.current&&Q.current.element)}))}),[Ke,Fe]),He=u.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};Se(t,[],"clear"),De(t),e.preventDefault()}),[Se,De]),Ve=u.useCallback(((e,t)=>{var s;De({target:W.current}),oe||Ke(null==(s=$.current)?void 0:s.element),Se({syntheticEvent:t,nativeEvent:t.nativeEvent,target:W.current},e,"delete")}),[Se,De,Ke,oe]),qe=u.useCallback((e=>{if(s.onExpandChange&&W.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:a,syntheticEvent:n}=e,o={level:Ge(i),item:t,nativeEvent:a,syntheticEvent:n,target:W.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Ae=u.useCallback((e=>{if(s.onFilterChange&&W.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:W.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ue(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),We=u.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};s.onCancel&&s.onCancel.call(void 0,t),De(t),e.preventDefault()}),[s.onCancel,De]),Je=u.useCallback((e=>{for(let t of e)de(t.target.clientWidth)}),[]),Qe=s.listNoData||Re,Xe=r.useLocalization(),Ze=!B||fe.valid,et=ge&&me?pe:Z.current,tt=u.createElement(u.Fragment,null,u.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${Ue[T]||T}`]:T,[`k-rounded-${$e[P]||P}`]:P,[`k-input-${_}`]:_,"k-focus":oe&&!E,"k-invalid":!Ze,"k-disabled":E,"k-loading":s.loading,"k-required":R}),tabIndex:A,accessKey:s.accessKey,id:l,style:f?{...g,width:void 0}:g,dir:ye,ref:U,onKeyDown:E?void 0:Le,onMouseDown:Oe,onFocus:Te,onBlur:Pe,role:"combobox","aria-haspopup":"tree","aria-expanded":me,"aria-disabled":E,"aria-label":f,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy?s.ariaDescribedBy:"tagslist-"+l,"aria-required":s.required,onClick:E?void 0:Be},u.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ue[T]||T}`]:T})},et.length>0&&u.createElement(be,{tag:s.tag,onTagDelete:Ve,data:et,guid:l,focused:te?Z.current.find((e=>F(e,te,c))):void 0,size:T})),u.createElement("span",{className:"k-input-inner"},0===et.length&&u.createElement("span",{className:"k-input-value-text"},m)),s.loading&&u.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ve&&!E&&et.length>0&&u.createElement(se,{onClick:He}),u.createElement("select",{name:b,ref:Y,tabIndex:-1,"aria-hidden":!0,title:f,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},u.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,k):k})),!ge&&u.createElement(o.Popup,{...D,popupClass:i.classNames(D.popupClass,"k-multiselecttree-popup"),className:i.classNames(D.className,{"k-rtl":"rtl"===ye}),style:xe,anchor:D.anchor||U.current,show:me,onOpen:Ne,onClose:Me,ref:ee},s.filterable&&u.createElement(v,{value:void 0===s.filter?ce:s.filter,ref:$,onChange:Ae,onKeyDown:ze,tabIndex:A,size:T,rounded:P,fillMode:_,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),d.length>0?u.createElement(h.TreeView,{style:{height:D.height},ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:qe,checkboxes:!0,size:T,item:s.item,dir:ye}):u.createElement(Qe,null,Xe.toLanguageString(O,V[O])))),ge&&(()=>{const e=s.filterable?u.createElement(v,{value:void 0===s.filter?ce:s.filter,ref:G,onChange:Ae,onKeyDown:ze,size:T,rounded:P,fillMode:_}):null,t={adaptiveTitle:s.adaptiveTitle,expand:me,onClose:e=>s.onCancel?We(e):He(e),windowWidth:re,mobileFilter:e,footer:{cancelText:Xe.toLanguageString(H,V[H]),onCancel:e=>s.onCancel?We(e):He(e),applyText:Xe.toLanguageString(z,V[z]),onApply:e=>De(e)}};return u.createElement(Ce,{...t},u.createElement(p.ActionSheetContent,{overflowHidden:!0},u.createElement("div",{className:"k-list-container"},u.createElement("div",{className:"k-list k-list-lg"},d.length>0?u.createElement(h.TreeView,{ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:we,onCheckChange:we,onExpandChange:qe,checkboxes:!0,size:T,item:s.item,dir:ye}):u.createElement(Qe,null,Xe.toLanguageString(O,V[O]))))))})());return f?u.createElement(a.FloatingLabel,{label:f,editorValue:ve,editorPlaceholder:m,editorValid:Ze,editorDisabled:E,editorId:l,style:{width:g?g.width:void 0},children:tt,dir:ye}):tt})),Qe={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};Je.displayName="KendoReactMultiSelectTree",Je.propTypes=Qe;const Xe=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=me,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=Ae,e.DropDownTreePropsContext=qe,e.List=q,e.ListContainer=g,e.ListFilter=v,e.ListItem=T,e.MultiColumnComboBox=Me,e.MultiColumnComboBoxPropsContext=Ne,e.MultiSelect=Fe,e.MultiSelectPropsContext=De,e.MultiSelectTree=Je,e.MultiSelectTreePropsContext=Ye,e.MultiSelectWithoutContext=Ee,e.SearchBar=te,e.TagList=be,e.dropdownsMessages=V,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=Xe(n,r);if("clear"===l)return[];if("delete"===l){const e=Xe(s,r);return n.filter((t=>!e[r(t)]))}const p=s[0],h=r(p),c=i.getter(o),u=[...e],g=[];let m,v=[];for(;u.length;){const e=u.pop();if(h===r(e)){v=g.map((e=>e.item)),m=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(m)||[]];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(m),y.push(...b.filter((e=>!d[r(e)])));const e=v.filter((e=>!d[r(e)])),t=Xe(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(m),t=Xe(b,r),s=Xe(v,r);y.push(...n.filter((i=>{const a=r(i);return!t[a]&&e!==a&&!s[a]})))}return y},e.getValueMap=Xe,e.nodata=O,e.scrollToItem=C}));
|