@progress/kendo-react-dropdowns 9.1.0-develop.3 → 9.1.0-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Bt=require("react"),C=require("prop-types"),o=require("@progress/kendo-react-common"),_t=require("@progress/kendo-react-labels"),et=require("@progress/kendo-svg-icons"),Ht=require("../common/ListContainer.js"),Wt=require("../common/ListFilter.js"),tt=require("../common/GroupStickyHeader.js"),Ut=require("../common/ListDefaultItem.js"),Gt=require("../common/List.js"),rt=require("../common/DropDownBase.js"),p=require("../common/utils.js"),jt=require("../package-metadata.js"),nt=require("@progress/kendo-react-buttons"),Yt=require("@progress/kendo-react-intl"),Ke=require("../messages/index.js"),pe=require("../common/constants.js"),Me=require("@progress/kendo-react-layout");function $t(h){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const k in h)if(k!=="default"){const B=Object.getOwnPropertyDescriptor(h,k);Object.defineProperty(Y,k,B.get?B:{enumerable:!0,get:()=>h[k]})}}return Y.default=h,Object.freeze(Y)}const s=$t(Bt),Jt="Please select a value from the list!",me=s.forwardRef((h,Y)=>{o.validatePackage(jt.packageMetadata);const k=o.useUnstyled(),B=o.useId(h.id),r=o.usePropsContext(ot,h),{delay:at=P.delay,tabIndex:st=P.tabIndex,ignoreCase:ge=P.ignoreCase,size:$=P.size,rounded:be=P.rounded,fillMode:fe=P.fillMode,groupMode:Qt=P.groupMode}=r,ve=()=>{if(o.canUseDOM)return H.current&&H.current.ownerDocument||window.document},it=()=>{var e,n;(e=t==null?void 0:t.current)!=null&&e.wrapper&&((n=t==null?void 0:t.current)==null||n.wrapper.focus({preventScroll:!0}))},N=()=>{let e;return T.current!==void 0&&T.current!==null?e=T.current:r.value!==void 0?e=r.value:f.value!==void 0&&f.value!==null?e=f.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!p.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},lt=()=>{const{dataItemKey:e}=r,n=p.getFilteredData(h),i=N();return n.findIndex(u=>p.areSame(u,i,e))},De=()=>r.required!==void 0?r.required:P.required,we=()=>{const e=r.validationMessage!==void 0,n=N(),i=!De()||n!==null&&n!==""&&n!==void 0,u=r.valid!==void 0?r.valid:i;return{customError:e,valid:u,valueMissing:n===null}},ct=()=>r.validityStyles!==void 0?r.validityStyles:P.validityStyles,ee=e=>{ne.current=!0,e.focus(),window.setTimeout(()=>ne.current=!1,30)},Ie=()=>{Q.current&&ee(Q.current),r.adaptive&&setTimeout(()=>{Q.current&&ee(Q.current)},300)},dt=e=>{for(const n of e)n.target.clientWidth!==re.current.windowWidth&&U({windowWidth:n.target.clientWidth})},Pe=()=>{te.current&&te.current.setCustomValidity&&te.current.setCustomValidity(we().valid?"":r.validationMessage||Jt)},_=(e,n)=>{const i=N();p.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),T.current=e,n.events.push({type:"onChange"}))},M=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),T.current=void 0},J=(e,n)=>{var c;const{virtual:i,dataItemKey:u,defaultItem:d}=r,m=p.getFilteredData(h),I=i?i.skip:0,v=N(),a=e===-1&&d!==void 0?d:m[e-I],g=!p.areSame(a,v,u);_(a,n),g&&((c=t==null?void 0:t.current)==null||c.triggerPageChangeCornerItems(a,n))},O=(e,n,i)=>{var x,D;const{defaultItem:u,dataItemKey:d,virtual:m={skip:0,total:0,pageSize:0}}=r,I=N(),v=p.getFilteredData(h),a=(x=t==null?void 0:t.current)==null?void 0:x.vs,g=v.findIndex(y=>p.areSame(y,I,d)),c=(D=t==null?void 0:t.current)==null?void 0:D.navigation.navigate({current:m.skip+g,max:(a!=null&&a.enabled?m.total:v.length)-1,min:u!==void 0?-1:0,keyCode:n,skipItems:i||void 0});c!==void 0&&J(c,e),M(e)},ut=e=>{H.current=e,t.current.wrapper=e},pt=e=>s.createElement("select",{name:r.name,ref:n=>{te.current=n},tabIndex:-1,"aria-hidden":!0,title:r.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},s.createElement("option",{value:r.valueMap?r.valueMap.call(void 0,e):e})),ye=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:u=p.itemIndexStartsWith,filterable:d,skipDisabledItems:m=!0}=r,I=N(),v=p.getFilteredData(h),a=r.filter?r.filter:f.text;return m&&e&&!a&&!I?v.findIndex(g=>!g.disabled&&g[e]):p.isPresent(I)&&a===void 0||d&&a===""?v.findIndex(g=>p.areSame(g,I,n)):a?xe.current?u(v,a,e):v.findIndex(g=>p.areSame(g,I,n)):i.skip===0?0:-1},Fe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=p.getFilteredData(h),n=t.current.initState(),i=ye();Fe(e,i)&&(_(null,n),M(n))},Se=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,f.focused||(n.data.focused=!0),he(),t.current.togglePopup(n),M(n)},Oe=e=>{var F,de,z,ue,j,Ze,Re;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:u,leftRightKeysNavigation:d=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:I,groupField:v="",textField:a,skipDisabledItems:g=!0}=r,c=p.getFilteredData(h),x=N(),D=c.findIndex(L=>p.areSame(L,x,I)),y=r.opened!==void 0?r.opened:f.opened,l=e.keyCode,b=l===o.Keys.home||l===o.Keys.end,K=l===o.Keys.up||l===o.Keys.down,G=!y&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),R=y&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=d&&(l===o.Keys.left||l===o.Keys.right),ce=K||le&&!n||b,E=t.current.initState();if(E.syntheticEvent=e,!i){if(b&&((F=t==null?void 0:t.current)!=null&&F.vs.enabled))l===o.Keys.home?m.skip!==0?((de=t==null?void 0:t.current)==null||de.triggerOnPageChange(E,0,m.pageSize),A.current=!0):_(c[0],E):m.skip<m.total-m.pageSize?((z=t==null?void 0:t.current)==null||z.triggerOnPageChange(E,m.total-m.pageSize,m.pageSize),A.current=!0):_(c[c.length-1],E);else if(y&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(y&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(y&&l===o.Keys.enter){const L=ye();Fe(c,L)?(_(null,E),M(E)):J(L,E),(Ze=t==null?void 0:t.current)==null||Ze.togglePopup(E),e.preventDefault()}else if(G||R)R&&he(),(Re=t==null?void 0:t.current)==null||Re.togglePopup(E),e.preventDefault();else if(ce){if(xe.current=!1,v!==""&&a)if(!g&&y)O(E,l);else{let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.findIndex(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else if(!g&&y||b)O(E,l);else if(a){let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.find(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else O(E,l);e.preventDefault()}M(E)}},mt=e=>{const n=t.current.initState();n.syntheticEvent=e.syntheticEvent,r.filter===void 0&&(n.data.text=e.target.value),t.current.filterChanged(e.target.value,n),xe.current=!0,M(n),U({group:void 0,text:String(e.target.value)})},Te=()=>{const e=r.filter!==void 0?r.filter:f.text;return r.filterable&&s.createElement(Wt,{value:e,ref:n=>Q.current=n&&n.element,onChange:mt,onKeyDown:Oe,size:$,rounded:be,fillMode:fe,renderListFilterWrapper:!0})},gt=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),_(r.defaultItem,n),M(n)},Ae=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,u=N();return n!==void 0&&s.createElement(Ut,{defaultItem:n,textField:e,selected:p.areSame(u,n,i),key:"defaultitemkey",onClick:gt})},ft=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),T.current=void 0},vt=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:u}=r;let d=p.getFilteredData(h);if(!(!u||!d.length)&&u){const m=Be.current=Be.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*m;d=t.current.getGroupedDataModernMode(d,u);let a=d[0][u];for(let g=1;g<d.length&&!(m*g>v);g++)d[g]&&d[g][u]&&(a=d[g][u]);a!==f.group&&U({group:a})}},qe=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:u,listNoDataRender:d,itemRender:m}=r,I=p.getFilteredData(h),v=k&&k.uDropDownList,a=t.current.vs,g=i.skip,c=r.opened!==void 0?r.opened:f.opened,x=t.current.getPopupSettings(),D=`translateY(${a.translate}px)`,y=N();return s.createElement(Gt,{id:Ee,show:c,data:I.slice(),focusedIndex:ye(),value:y,textField:e,valueField:n,optionsGuid:We,groupField:r.groupField,groupMode:"modern",listRef:b=>a.list=t.current.list=b,wrapperStyle:{maxHeight:x.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:D}:void 0,key:"listkey",skip:g,onClick:ft,itemRender:m,groupHeaderItemRender:u,noDataRender:d,onScroll:vt,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},Dt=()=>{var y;const{windowWidth:e=0}=f,{header:n,footer:i,adaptiveTitle:u,groupField:d,groupStickyHeaderItemRender:m,list:I}=r,v=p.getFilteredData(h),a=r.opened!==void 0?r.opened:f.opened,g=k&&k.uDropDownList,c=k&&k.uDropDownsActionSheet,x={navigatable:!1,navigatableElements:[],expand:a,animation:!0,onClose:l=>Se(l),animationStyles:e<=pe.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:o.classNames(o.uDropDownsActionSheet.wrapper({c,isFullScreen:e<=pe.MOBILE_SMALL_DEVISE}))};let{group:D}=f;return D===void 0&&d!==void 0&&(D=p.getItemValue(v[0],d)),s.createElement(Me.ActionSheet,{...x},s.createElement(Me.ActionSheetHeader,{className:o.classNames(o.uDropDownsActionSheet.header({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBar({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.title({c}))},s.createElement("div",null,u)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c}))},s.createElement(nt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Se,icon:"x",svgIcon:et.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c}))},Te())),s.createElement(Me.ActionSheetContent,{overflowHidden:!0},n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},n),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:g,size:$,virtual:(y=t==null?void 0:t.current)==null?void 0:y.vs.enabled}))},Ae(),!I&&D&&v.length!==0&&s.createElement(tt,{group:D,groupMode:"modern",render:m}),qe()),i&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:g}))},i)))},wt=()=>{f.focused&&window.setTimeout(()=>{f.focused&&t.current.wrapper&&ee(t.current.wrapper)})},It=e=>{var n;(n=r.popupSettings)!=null&&n.onMouseDownOutside&&r.popupSettings.onMouseDownOutside.call(void 0,e)},yt=()=>{const{header:e,footer:n,dir:i,groupField:u,groupStickyHeaderItemRender:d,list:m}=r,I=p.getFilteredData(h),v=t.current,a=v.getPopupSettings(),g=r.opened!==void 0?r.opened:f.opened,c=a.width!==void 0?a.width:v.popupWidth,x=k&&k.uDropDownList,D={dir:i!==void 0?i:v.dirCalculated,width:c,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:x})),anchor:a.anchor||H.current,show:g,onOpen:Ie,onClose:wt,onMouseDownOutside:It},itemsCount:[I.length]};let{group:y}=f;return y===void 0&&u!==void 0&&(y=p.getItemValue(I[0],u)),s.createElement(Ht,{...D},Te(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:x}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:x,size:$,virtual:t.current.vs.enabled}))},Ae(),!m&&y&&I.length!==0&&s.createElement(tt,{group:y,groupMode:"modern",render:d}),qe()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:x}))},n))},ht=e=>{const{dataItemKey:n}=r,i=p.getFilteredData(h),u=N();let d=i.map((K,G)=>({item:K,itemIndex:G}));const m=W.current.word,I=W.current.last,v=p.sameCharsOnly(m,I);let a=d.length,g=Math.max(0,i.findIndex(K=>p.areSame(K,u,n))),c;r.defaultItem&&(c={item:r.defaultItem,itemIndex:-1},a+=1,g+=1),g+=v?1:0,d=p.shuffleData(d,g,c);let x,D,y,l=0;const{textField:b}=r;for(;l<a;l++)if(x=p.getItemValue(d[l].item,b),D=v&&p.matchText(x,I,ge),y=p.matchText(x,m,ge),D||y){l=d[l].itemIndex;break}if(l!==a){const K=t.current.initState();K.syntheticEvent=e,J(l,K),M(K),T.current=void 0}},St=e=>{clearTimeout(ze.current),r.filterable||(ze.current=window.setTimeout(()=>W.current.word="",at),ht(e))},xt=e=>{ne.current||t.current.handleFocus(e)},Et=e=>{if(ne.current||!f.focused)return;const n=r.opened!==void 0?r.opened:f.opened,{adaptive:i}=r,{windowWidth:u=0}=f,d=u<=pe.MOBILE_MEDIUM_DEVISE&&i,m=t.current.initState();m.syntheticEvent=e,m.data.focused=!1,m.events.push({type:"onBlur"}),n&&he(),n&&!d&&t.current.togglePopup(m),M(m)},Lt=e=>{if(r.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let n=String.fromCharCode(e.charCode||e.keyCode);ge&&(n=n.toLowerCase()),n===" "&&e.preventDefault(),W.current={word:W.current.word+n,last:W.current.last+n},St(e)},Ct=()=>{const e=t.current.initState();e.data.opened=f.opened,t.current.togglePopup(e),M(e)},Ve=s.useRef(null),H=s.useRef(null),te=s.useRef(),Q=s.useRef(null);s.useImperativeHandle(Ve,()=>({get element(){return H.current},get index(){return lt()},get name(){return r.name},get validity(){return we()},get value(){return N()},focus:it,props:r,togglePopup:Ct})),s.useImperativeHandle(Y,()=>Ve.current);const ze=s.useRef(null),W=s.useRef({word:"",last:""}),ne=s.useRef(!1),T=s.useRef(null),A=s.useRef(!1),xe=s.useRef(!1),q=s.useRef({}),re=s.useRef({}),t=s.useRef(new rt({props:h,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Be=s.useRef(0),X=s.useRef(null),[f,kt]=s.useState({}),[,_e]=s.useReducer(e=>e,!0),Nt=Yt.useLocalization(),U=e=>{kt({...f,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:h,setState:U,state:f,forceUpdate:_e,element:H.current,handleItemSelect:J,value:N()})},[U,f,_e,J,N]),s.useEffect(()=>{var g,c,x,D,y,l,b,K,G,R,le,ce,E;const{dataItemKey:e,virtual:n,groupField:i="",textField:u}=r,d=p.getFilteredData(h),m=q.current.virtual?q.current.virtual.total:0,I=r.opened!==void 0?r.opened:f.opened,v=q.current.opened!==void 0?q.current.opened:re.current.opened,a=!v&&I;if((g=t==null?void 0:t.current)==null||g.didUpdate(),(c=t==null?void 0:t.current)!=null&&c.getPopupSettings().animate||a&&Ie(),n&&n.total!==m)(x=t==null?void 0:t.current)==null||x.vs.calcScrollElementHeight(),(D=t==null?void 0:t.current)==null||D.vs.reset();else{const F=N(),de=q.current.value!==void 0?q.current.value:re.current.value;let z=d.findIndex(j=>p.areSame(j,F,e));i!==""&&F&&u&&(z=(l=(y=t==null?void 0:t.current)==null?void 0:y.getGroupedDataModernMode(d,i))==null?void 0:l.map(j=>j[u]).indexOf(F[u]));const ue=!p.areSame(de,F,e);a&&n?(b=t==null?void 0:t.current)==null||b.scrollToVirtualItem(n,z):a&&!n?(Ie(),d&&d.length!==0&&((K=t==null?void 0:t.current)==null||K.resetGroupStickyHeader(d[0][i],{setState:U,group:f.group,state:f})),(G=t==null?void 0:t.current)==null||G.scrollToItem(z)):I&&v&&F&&ue&&!A.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(z,(R=t==null?void 0:t.current)==null?void 0:R.vs.enabled):I&&v&&A.current&&(A.current&&n&&n.skip===0?(ce=t==null?void 0:t.current)==null||ce.vs.reset():A.current&&n&&n.skip===n.total-n.pageSize&&((E=t==null?void 0:t.current)==null||E.vs.scrollToEnd()))}A.current=!1,re.current=f,q.current=r,Pe()}),s.useEffect(()=>{var e,n;return X.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(i=>dt(i)),(e=t==null?void 0:t.current)==null||e.didMount(),Pe(),(n=ve())!=null&&n.body&&X.current&&X.current.observe(ve().body),()=>{var i;(i=ve())!=null&&i.body&&X.current&&X.current.disconnect()}},[]);const He=B+"-accessibility-id",Ee=B+"-listbox-id",We=B+"-guid",Kt=Nt.toLanguageString(Ke.dropDownListArrowBtnAriaLabel,Ke.messages[Ke.dropDownListArrowBtnAriaLabel]),{style:oe,className:Mt,label:Le,dir:bt,virtual:V,adaptive:Pt,dataItemKey:Ft,disabled:ae,loading:Ue,iconClassName:Ge,svgIcon:je,valueRender:Ye}=r,{windowWidth:Ot=0}=f,Ce=r.opened!==void 0?r.opened:f.opened,se=N(),ke=p.getItemValue(se,r.textField),$e=!ct()||we().valid,ie=t.current,Tt=ie.vs,Je=Ot<=pe.MOBILE_MEDIUM_DEVISE&&Pt,Z=k&&k.uDropDownList;Tt.enabled=V!==void 0,V!==void 0&&(ie.vs.skip=V.skip,ie.vs.total=V.total,ie.vs.pageSize=V.pageSize);const At=p.getFilteredData(h),{focused:qt}=f,Vt=At.findIndex(e=>p.areSame(e,se,Ft)),Qe=s.createElement("span",{id:He,className:o.classNames(o.uDropDownList.inputInner({c:Z}))},ke&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:Z}))},ke)),zt=Ye!==void 0?Ye.call(void 0,Qe,se):Qe,Xe=s.createElement(s.Fragment,null,s.createElement("span",{ref:ut,className:o.classNames(o.uDropDownList.wrapper({c:Z,size:$,rounded:be,fillMode:fe,focused:qt,disabled:ae,invalid:!$e,loading:Ue,required:De()}),Mt),style:Le?{...oe,width:void 0}:oe,dir:bt,onMouseDown:Ce?e=>{e.target.nodeName!=="INPUT"&&(ee(t.current.wrapper),e.preventDefault())}:void 0,onFocus:xt,onBlur:Et,tabIndex:o.getTabIndex(st,ae),accessKey:r.accessKey,onKeyDown:Oe,onKeyPress:Lt,onClick:ae?void 0:Se,role:"combobox","aria-required":De(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ce||!1,"aria-owns":Ee,"aria-activedescendant":Ce?"option-"+We+"-"+(Vt+(V?V.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||He,"aria-controls":Ee,id:r.id,title:r.title},zt,Ue&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:Z})),name:"loading"}),s.createElement(nt.Button,{tabIndex:-1,type:"button","aria-label":Kt,size:$,fillMode:fe,iconClass:Ge,className:o.classNames(o.uDropDownList.inputButton({c:Z})),rounded:null,themeColor:"base",icon:Ge?void 0:"caret-alt-down",svgIcon:je||et.caretAltDownIcon,onMouseDown:e=>f.focused&&e.preventDefault()}),pt(se),!Je&&yt()),Je&&Dt());return Le?s.createElement(_t.FloatingLabel,{label:Le,editorValue:ke,editorValid:$e,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Xe}):Xe});me.propTypes={delay:C.number,ignoreCase:C.bool,iconClassName:C.string,svgIcon:o.svgIconPropType,defaultItem:C.any,valueRender:C.func,valueMap:C.func,validationMessage:C.string,required:C.bool,id:C.string,ariaLabelledBy:C.string,ariaDescribedBy:C.string,ariaLabel:C.string,leftRightKeysNavigation:C.bool,title:C.string,groupField:C.string,list:C.any,skipDisabledItems:C.bool};const P={delay:500,tabIndex:0,ignoreCase:!0,...rt.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};me.displayName="KendoReactDropDownList";const ot=o.createPropsContext();me.displayName="KendoReactDropDownList";exports.DropDownList=me;exports.DropDownListPropsContext=ot;exports.dropDownListDefaultProps=P;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Bt=require("react"),C=require("prop-types"),o=require("@progress/kendo-react-common"),_t=require("@progress/kendo-react-labels"),et=require("@progress/kendo-svg-icons"),Ht=require("../common/ListContainer.js"),Wt=require("../common/ListFilter.js"),tt=require("../common/GroupStickyHeader.js"),Ut=require("../common/ListDefaultItem.js"),Gt=require("../common/List.js"),rt=require("../common/DropDownBase.js"),p=require("../common/utils.js"),jt=require("../package-metadata.js"),nt=require("@progress/kendo-react-buttons"),Yt=require("@progress/kendo-react-intl"),Ke=require("../messages/index.js"),pe=require("../common/constants.js"),Me=require("@progress/kendo-react-layout");function $t(h){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const k in h)if(k!=="default"){const B=Object.getOwnPropertyDescriptor(h,k);Object.defineProperty(Y,k,B.get?B:{enumerable:!0,get:()=>h[k]})}}return Y.default=h,Object.freeze(Y)}const s=$t(Bt),Jt="Please select a value from the list!",me=s.forwardRef((h,Y)=>{o.validatePackage(jt.packageMetadata);const k=o.useUnstyled(),B=o.useId(h.id),r=o.usePropsContext(ot,h),{delay:at=P.delay,tabIndex:st=P.tabIndex,ignoreCase:ge=P.ignoreCase,size:$=P.size,rounded:be=P.rounded,fillMode:fe=P.fillMode,groupMode:Qt=P.groupMode}=r,ve=()=>{if(o.canUseDOM)return H.current&&H.current.ownerDocument||window.document},it=()=>{var e,n;(e=t==null?void 0:t.current)!=null&&e.wrapper&&((n=t==null?void 0:t.current)==null||n.wrapper.focus({preventScroll:!0}))},N=()=>{let e;return T.current!==void 0&&T.current!==null?e=T.current:r.value!==void 0?e=r.value:f.value!==void 0&&f.value!==null?e=f.value:r.defaultValue!==void 0&&r.defaultValue!==null&&(e=r.defaultValue),!p.isPresent(e)&&r.defaultItem!==void 0&&r.defaultItem!==null&&(e=r.defaultItem),e},lt=()=>{const{dataItemKey:e}=r,n=p.getFilteredData(h),i=N();return n.findIndex(u=>p.areSame(u,i,e))},De=()=>r.required!==void 0?r.required:P.required,we=()=>{const e=r.validationMessage!==void 0,n=N(),i=!De()||n!==null&&n!==""&&n!==void 0,u=r.valid!==void 0?r.valid:i;return{customError:e,valid:u,valueMissing:n===null}},ct=()=>r.validityStyles!==void 0?r.validityStyles:P.validityStyles,ee=e=>{ne.current=!0,e.focus(),window.setTimeout(()=>ne.current=!1,30)},Ie=()=>{Q.current&&ee(Q.current),r.adaptive&&setTimeout(()=>{Q.current&&ee(Q.current)},300)},dt=e=>{for(const n of e)n.target.clientWidth!==re.current.windowWidth&&U({windowWidth:n.target.clientWidth})},Pe=()=>{te.current&&te.current.setCustomValidity&&te.current.setCustomValidity(we().valid?"":r.validationMessage||Jt)},_=(e,n)=>{const i=N();p.areSame(i,e,r.dataItemKey)||(r.value===void 0&&(n.data.value=e),t.current.updateComponentArgs({value:e}),T.current=e,n.events.push({type:"onChange"}))},M=e=>{var n;(n=t==null?void 0:t.current)==null||n.applyState(e),T.current=void 0},J=(e,n)=>{var c;const{virtual:i,dataItemKey:u,defaultItem:d}=r,m=p.getFilteredData(h),I=i?i.skip:0,v=N(),a=e===-1&&d!==void 0?d:m[e-I],g=!p.areSame(a,v,u);_(a,n),g&&((c=t==null?void 0:t.current)==null||c.triggerPageChangeCornerItems(a,n))},O=(e,n,i)=>{var x,D;const{defaultItem:u,dataItemKey:d,virtual:m={skip:0,total:0,pageSize:0}}=r,I=N(),v=p.getFilteredData(h),a=(x=t==null?void 0:t.current)==null?void 0:x.vs,g=v.findIndex(y=>p.areSame(y,I,d)),c=(D=t==null?void 0:t.current)==null?void 0:D.navigation.navigate({current:m.skip+g,max:(a!=null&&a.enabled?m.total:v.length)-1,min:u!==void 0?-1:0,keyCode:n,skipItems:i||void 0});c!==void 0&&J(c,e),M(e)},ut=e=>{H.current=e,t.current.wrapper=e},pt=e=>s.createElement("select",{name:r.name,ref:n=>{te.current=n},tabIndex:-1,"aria-hidden":!0,title:r.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},s.createElement("option",{value:r.valueMap?r.valueMap.call(void 0,e):e})),ye=()=>{const{textField:e,dataItemKey:n,virtual:i={skip:0},focusedItemIndex:u=p.itemIndexStartsWith,filterable:d,skipDisabledItems:m=!0}=r,I=N(),v=p.getFilteredData(h),a=r.filter?r.filter:f.text;return m&&e&&!a&&!I?v.findIndex(g=>!g.disabled&&g[e]):p.isPresent(I)&&a===void 0||d&&a===""?v.findIndex(g=>p.areSame(g,I,n)):a?xe.current?u(v,a,e):v.findIndex(g=>p.areSame(g,I,n)):i.skip===0?0:-1},Fe=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=p.getFilteredData(h),n=t.current.initState(),i=ye();Fe(e,i)&&(_(null,n),M(n))},Se=e=>{if(e.isPropagationStopped())return;const n=t.current.initState();n.syntheticEvent=e,f.focused||(n.data.focused=!0),he(),t.current.togglePopup(n),M(n)},Oe=e=>{var F,de,z,ue,j,Ze,Re;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:i,defaultItem:u,leftRightKeysNavigation:d=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:I,groupField:v="",textField:a,skipDisabledItems:g=!0}=r,c=p.getFilteredData(h),x=N(),D=c.findIndex(L=>p.areSame(L,x,I)),y=r.opened!==void 0?r.opened:f.opened,l=e.keyCode,b=l===o.Keys.home||l===o.Keys.end,K=l===o.Keys.up||l===o.Keys.down,G=!y&&(e.altKey&&l===o.Keys.down||l===o.Keys.enter||l===o.Keys.space),R=y&&(e.altKey&&l===o.Keys.up||l===o.Keys.esc),le=d&&(l===o.Keys.left||l===o.Keys.right),ce=K||le&&!n||b,E=t.current.initState();if(E.syntheticEvent=e,!i){if(b&&((F=t==null?void 0:t.current)!=null&&F.vs.enabled))l===o.Keys.home?m.skip!==0?((de=t==null?void 0:t.current)==null||de.triggerOnPageChange(E,0,m.pageSize),A.current=!0):_(c[0],E):m.skip<m.total-m.pageSize?((z=t==null?void 0:t.current)==null||z.triggerOnPageChange(E,m.total-m.pageSize,m.pageSize),A.current=!0):_(c[c.length-1],E);else if(y&&l===o.Keys.pageUp)e.preventDefault(),(ue=t==null?void 0:t.current)==null||ue.scrollPopupByPageSize(-1);else if(y&&l===o.Keys.pageDown)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(1);else if(y&&l===o.Keys.enter){const L=ye();Fe(c,L)?(_(null,E),M(E)):J(L,E),(Ze=t==null?void 0:t.current)==null||Ze.togglePopup(E),e.preventDefault()}else if(G||R)R&&he(),(Re=t==null?void 0:t.current)==null||Re.togglePopup(E),e.preventDefault();else if(ce){if(xe.current=!1,v!==""&&a)if(!g&&y)O(E,l);else{let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.findIndex(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else if(!g&&y||b)O(E,l);else if(a){let L;if(l===o.Keys.down||l===o.Keys.right){const S=c.slice(D+1).find(w=>!w.disabled&&w[a]);L=S&&c.findIndex(w=>w[a]===S[a])}else if(l===o.Keys.up||l===o.Keys.left){let S;if(D===0&&u)L=-1;else if(D===-1)S=c,L=c.find(w=>!w.disabled&&w[a]);else{S=c.slice(0,D);let w=S.pop();for(;w&&w.disabled;)w=S.pop();L=w&&c.findIndex(Ne=>Ne[a]===w[a])}}if(L!==void 0){const S=L-D;O(E,l,S)}else L===void 0&&c.findIndex(S=>S[a]===x[a])===c.length-1&&O(E,l)}else O(E,l);e.preventDefault()}M(E)}},mt=e=>{const n=t.current.initState();n.syntheticEvent=e.syntheticEvent,r.filter===void 0&&(n.data.text=e.target.value),t.current.filterChanged(e.target.value,n),xe.current=!0,M(n),U({group:void 0,text:String(e.target.value)})},Te=()=>{const e=r.filter!==void 0?r.filter:f.text;return r.filterable&&s.createElement(Wt,{value:e,ref:n=>Q.current=n&&n.element,onChange:mt,onKeyDown:Oe,size:$,rounded:be,fillMode:fe,renderListFilterWrapper:!0})},gt=e=>{var i;const n=t.current.initState();n.syntheticEvent=e,(i=t==null?void 0:t.current)==null||i.togglePopup(n),_(r.defaultItem,n),M(n)},Ae=()=>{const{textField:e,defaultItem:n,dataItemKey:i}=r,u=N();return n!==void 0&&s.createElement(Ut,{defaultItem:n,textField:e,selected:p.areSame(u,n,i),key:"defaultitemkey",onClick:gt})},ft=(e,n)=>{var i;(i=t==null?void 0:t.current)==null||i.handleItemClick(e,n),T.current=void 0},vt=e=>{const{vs:n,list:i}=t.current;n.scrollHandler(e);const{groupField:u}=r;let d=p.getFilteredData(h);if(!(!u||!d.length)&&u){const m=Be.current=Be.current||(n.enabled?n.itemHeight:i?i.children[0].offsetHeight:0),v=e.target.scrollTop-n.skip*m;d=t.current.getGroupedDataModernMode(d,u);let a=d[0][u];for(let g=1;g<d.length&&!(m*g>v);g++)d[g]&&d[g][u]&&(a=d[g][u]);a!==f.group&&U({group:a})}},qe=()=>{var l;const{textField:e,dataItemKey:n,virtual:i={skip:0,total:void 0},groupHeaderItemRender:u,listNoDataRender:d,itemRender:m}=r,I=p.getFilteredData(h),v=k&&k.uDropDownList,a=t.current.vs,g=i.skip,c=r.opened!==void 0?r.opened:f.opened,x=t.current.getPopupSettings(),D=`translateY(${a.translate}px)`,y=N();return s.createElement(Gt,{id:Ee,show:c,data:I.slice(),focusedIndex:ye(),value:y,textField:e,valueField:n,optionsGuid:We,groupField:r.groupField,groupMode:"modern",listRef:b=>a.list=t.current.list=b,wrapperStyle:{maxHeight:x.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:v})),listStyle:a.enabled?{transform:D}:void 0,key:"listkey",skip:g,onClick:ft,itemRender:m,groupHeaderItemRender:u,noDataRender:d,onScroll:vt,wrapperRef:a.scrollerRef,scroller:(l=t==null?void 0:t.current)==null?void 0:l.renderScrollElement(),ariaSetSize:i.total})},Dt=()=>{var y;const{windowWidth:e=0}=f,{header:n,footer:i,adaptiveTitle:u,groupField:d,groupStickyHeaderItemRender:m,list:I}=r,v=p.getFilteredData(h),a=r.opened!==void 0?r.opened:f.opened,g=k&&k.uDropDownList,c=k&&k.uDropDownsActionSheet,x={navigatable:!1,navigatableElements:[],expand:a,animation:!0,onClose:l=>Se(l),animationStyles:e<=pe.MOBILE_SMALL_DEVISE?{top:0,width:"100%",height:"100%"}:void 0,className:o.classNames(o.uDropDownsActionSheet.wrapper({c,isFullScreen:e<=pe.MOBILE_SMALL_DEVISE}))};let{group:D}=f;return D===void 0&&d!==void 0&&(D=p.getItemValue(v[0],d)),s.createElement(Me.ActionSheet,{...x},s.createElement(Me.ActionSheetHeader,{className:o.classNames(o.uDropDownsActionSheet.header({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBar({c}))},s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.title({c}))},s.createElement("div",null,u)),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.actions({c}))},s.createElement(nt.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Se,icon:"x",svgIcon:et.xIcon}))),s.createElement("div",{className:o.classNames(o.uDropDownsActionSheet.titleBarGroup({c}))},Te())),s.createElement(Me.ActionSheetContent,{overflowHidden:!0},n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},n),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:g,size:$,virtual:(y=t==null?void 0:t.current)==null?void 0:y.vs.enabled}))},Ae(),!I&&D&&v.length!==0&&s.createElement(tt,{group:D,groupMode:"modern",render:m}),qe()),i&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:g}))},i)))},wt=()=>{f.focused&&window.setTimeout(()=>{f.focused&&t.current.wrapper&&ee(t.current.wrapper)})},It=e=>{var n;(n=r.popupSettings)!=null&&n.onMouseDownOutside&&r.popupSettings.onMouseDownOutside.call(void 0,e)},yt=()=>{const{header:e,footer:n,dir:i,groupField:u,groupStickyHeaderItemRender:d,list:m}=r,I=p.getFilteredData(h),v=t.current,a=v.getPopupSettings(),g=r.opened!==void 0?r.opened:f.opened,c=a.width!==void 0?a.width:v.popupWidth,x=k&&k.uDropDownList,D={dir:i!==void 0?i:v.dirCalculated,width:c,popupSettings:{...a,popupClass:o.classNames(a.popupClass,o.uDropDownList.listContainer({c:x})),anchor:a.anchor||H.current,show:g,onOpen:Ie,onClose:wt,onMouseDownOutside:It},itemsCount:[I.length]};let{group:y}=f;return y===void 0&&u!==void 0&&(y=p.getItemValue(I[0],u)),s.createElement(Ht,{...D},Te(),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:x}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:x,size:$,virtual:t.current.vs.enabled}))},Ae(),!m&&y&&I.length!==0&&s.createElement(tt,{group:y,groupMode:"modern",render:d}),qe()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:x}))},n))},ht=e=>{const{dataItemKey:n}=r,i=p.getFilteredData(h),u=N();let d=i.map((K,G)=>({item:K,itemIndex:G}));const m=W.current.word,I=W.current.last,v=p.sameCharsOnly(m,I);let a=d.length,g=Math.max(0,i.findIndex(K=>p.areSame(K,u,n))),c;r.defaultItem&&(c={item:r.defaultItem,itemIndex:-1},a+=1,g+=1),g+=v?1:0,d=p.shuffleData(d,g,c);let x,D,y,l=0;const{textField:b}=r;for(;l<a;l++)if(x=p.getItemValue(d[l].item,b),D=v&&p.matchText(x,I,ge),y=p.matchText(x,m,ge),D||y){l=d[l].itemIndex;break}if(l!==a){const K=t.current.initState();K.syntheticEvent=e,J(l,K),M(K),T.current=void 0}},St=e=>{clearTimeout(ze.current),r.filterable||(ze.current=window.setTimeout(()=>W.current.word="",at),ht(e))},xt=e=>{ne.current||t.current.handleFocus(e)},Et=e=>{if(ne.current||!f.focused)return;const n=r.opened!==void 0?r.opened:f.opened,{adaptive:i}=r,{windowWidth:u=0}=f,d=u<=pe.MOBILE_MEDIUM_DEVISE&&i,m=t.current.initState();m.syntheticEvent=e,m.data.focused=!1,m.events.push({type:"onBlur"}),n&&he(),n&&!d&&t.current.togglePopup(m),M(m)},Lt=e=>{if(r.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let n=String.fromCharCode(e.charCode||e.keyCode);ge&&(n=n.toLowerCase()),n===" "&&e.preventDefault(),W.current={word:W.current.word+n,last:W.current.last+n},St(e)},Ct=()=>{const e=t.current.initState();e.data.opened=f.opened,t.current.togglePopup(e),M(e)},Ve=s.useRef(null),H=s.useRef(null),te=s.useRef(),Q=s.useRef(null);s.useImperativeHandle(Ve,()=>({get element(){return H.current},get index(){return lt()},get name(){return r.name},get validity(){return we()},get value(){return N()},get focused(){return f.focused},get opened(){return f.opened},focus:it,props:r,togglePopup:Ct})),s.useImperativeHandle(Y,()=>Ve.current);const ze=s.useRef(null),W=s.useRef({word:"",last:""}),ne=s.useRef(!1),T=s.useRef(null),A=s.useRef(!1),xe=s.useRef(!1),q=s.useRef({}),re=s.useRef({}),t=s.useRef(new rt({props:h,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Be=s.useRef(0),X=s.useRef(null),[f,kt]=s.useState({}),[,_e]=s.useReducer(e=>e,!0),Nt=Yt.useLocalization(),U=e=>{kt({...f,...e})};s.useEffect(()=>{t.current.updateComponentArgs({props:h,setState:U,state:f,forceUpdate:_e,element:H.current,handleItemSelect:J,value:N()})},[U,f,_e,J,N]),s.useEffect(()=>{var g,c,x,D,y,l,b,K,G,R,le,ce,E;const{dataItemKey:e,virtual:n,groupField:i="",textField:u}=r,d=p.getFilteredData(h),m=q.current.virtual?q.current.virtual.total:0,I=r.opened!==void 0?r.opened:f.opened,v=q.current.opened!==void 0?q.current.opened:re.current.opened,a=!v&&I;if((g=t==null?void 0:t.current)==null||g.didUpdate(),(c=t==null?void 0:t.current)!=null&&c.getPopupSettings().animate||a&&Ie(),n&&n.total!==m)(x=t==null?void 0:t.current)==null||x.vs.calcScrollElementHeight(),(D=t==null?void 0:t.current)==null||D.vs.reset();else{const F=N(),de=q.current.value!==void 0?q.current.value:re.current.value;let z=d.findIndex(j=>p.areSame(j,F,e));i!==""&&F&&u&&(z=(l=(y=t==null?void 0:t.current)==null?void 0:y.getGroupedDataModernMode(d,i))==null?void 0:l.map(j=>j[u]).indexOf(F[u]));const ue=!p.areSame(de,F,e);a&&n?(b=t==null?void 0:t.current)==null||b.scrollToVirtualItem(n,z):a&&!n?(Ie(),d&&d.length!==0&&((K=t==null?void 0:t.current)==null||K.resetGroupStickyHeader(d[0][i],{setState:U,group:f.group,state:f})),(G=t==null?void 0:t.current)==null||G.scrollToItem(z)):I&&v&&F&&ue&&!A.current?(le=t==null?void 0:t.current)==null||le.scrollToItem(z,(R=t==null?void 0:t.current)==null?void 0:R.vs.enabled):I&&v&&A.current&&(A.current&&n&&n.skip===0?(ce=t==null?void 0:t.current)==null||ce.vs.reset():A.current&&n&&n.skip===n.total-n.pageSize&&((E=t==null?void 0:t.current)==null||E.vs.scrollToEnd()))}A.current=!1,re.current=f,q.current=r,Pe()}),s.useEffect(()=>{var e,n;return X.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(i=>dt(i)),(e=t==null?void 0:t.current)==null||e.didMount(),Pe(),(n=ve())!=null&&n.body&&X.current&&X.current.observe(ve().body),()=>{var i;(i=ve())!=null&&i.body&&X.current&&X.current.disconnect()}},[]);const He=B+"-accessibility-id",Ee=B+"-listbox-id",We=B+"-guid",Kt=Nt.toLanguageString(Ke.dropDownListArrowBtnAriaLabel,Ke.messages[Ke.dropDownListArrowBtnAriaLabel]),{style:oe,className:Mt,label:Le,dir:bt,virtual:V,adaptive:Pt,dataItemKey:Ft,disabled:ae,loading:Ue,iconClassName:Ge,svgIcon:je,valueRender:Ye}=r,{windowWidth:Ot=0}=f,Ce=r.opened!==void 0?r.opened:f.opened,se=N(),ke=p.getItemValue(se,r.textField),$e=!ct()||we().valid,ie=t.current,Tt=ie.vs,Je=Ot<=pe.MOBILE_MEDIUM_DEVISE&&Pt,Z=k&&k.uDropDownList;Tt.enabled=V!==void 0,V!==void 0&&(ie.vs.skip=V.skip,ie.vs.total=V.total,ie.vs.pageSize=V.pageSize);const At=p.getFilteredData(h),{focused:qt}=f,Vt=At.findIndex(e=>p.areSame(e,se,Ft)),Qe=s.createElement("span",{id:He,className:o.classNames(o.uDropDownList.inputInner({c:Z}))},ke&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:Z}))},ke)),zt=Ye!==void 0?Ye.call(void 0,Qe,se):Qe,Xe=s.createElement(s.Fragment,null,s.createElement("span",{ref:ut,className:o.classNames(o.uDropDownList.wrapper({c:Z,size:$,rounded:be,fillMode:fe,focused:qt,disabled:ae,invalid:!$e,loading:Ue,required:De()}),Mt),style:Le?{...oe,width:void 0}:oe,dir:bt,onMouseDown:Ce?e=>{e.target.nodeName!=="INPUT"&&(ee(t.current.wrapper),e.preventDefault())}:void 0,onFocus:xt,onBlur:Et,tabIndex:o.getTabIndex(st,ae),accessKey:r.accessKey,onKeyDown:Oe,onKeyPress:Lt,onClick:ae?void 0:Se,role:"combobox","aria-required":De(),"aria-disabled":ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ce||!1,"aria-owns":Ee,"aria-activedescendant":Ce?"option-"+We+"-"+(Vt+(V?V.skip:0)):void 0,"aria-label":r.ariaLabel||r.label,"aria-labelledby":r.ariaLabelledBy,"aria-describedby":r.ariaDescribedBy||He,"aria-controls":Ee,id:r.id,title:r.title},zt,Ue&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:Z})),name:"loading"}),s.createElement(nt.Button,{tabIndex:-1,type:"button","aria-label":Kt,size:$,fillMode:fe,iconClass:Ge,className:o.classNames(o.uDropDownList.inputButton({c:Z})),rounded:null,themeColor:"base",icon:Ge?void 0:"caret-alt-down",svgIcon:je||et.caretAltDownIcon,onMouseDown:e=>f.focused&&e.preventDefault()}),pt(se),!Je&&yt()),Je&&Dt());return Le?s.createElement(_t.FloatingLabel,{label:Le,editorValue:ke,editorValid:$e,editorDisabled:r.disabled,style:{width:oe?oe.width:void 0},children:Xe}):Xe});me.propTypes={delay:C.number,ignoreCase:C.bool,iconClassName:C.string,svgIcon:o.svgIconPropType,defaultItem:C.any,valueRender:C.func,valueMap:C.func,validationMessage:C.string,required:C.bool,id:C.string,ariaLabelledBy:C.string,ariaDescribedBy:C.string,ariaLabel:C.string,leftRightKeysNavigation:C.bool,title:C.string,groupField:C.string,list:C.any,skipDisabledItems:C.bool};const P={delay:500,tabIndex:0,ignoreCase:!0,...rt.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};me.displayName="KendoReactDropDownList";const ot=o.createPropsContext();me.displayName="KendoReactDropDownList";exports.DropDownList=me;exports.DropDownListPropsContext=ot;exports.dropDownListDefaultProps=P;
|
|
@@ -15,14 +15,14 @@ import rn from "../common/ListContainer.mjs";
|
|
|
15
15
|
import on from "../common/ListFilter.mjs";
|
|
16
16
|
import nt from "../common/GroupStickyHeader.mjs";
|
|
17
17
|
import an from "../common/ListDefaultItem.mjs";
|
|
18
|
-
import
|
|
18
|
+
import sn from "../common/List.mjs";
|
|
19
19
|
import dt from "../common/DropDownBase.mjs";
|
|
20
|
-
import { getFilteredData as P, areSame as N, getItemValue as fe, isPresent as rt, itemIndexStartsWith as
|
|
20
|
+
import { getFilteredData as P, areSame as N, getItemValue as fe, isPresent as rt, itemIndexStartsWith as ln, sameCharsOnly as dn, shuffleData as cn, matchText as ot } from "../common/utils.mjs";
|
|
21
21
|
import { packageMetadata as un } from "../package-metadata.mjs";
|
|
22
22
|
import { Button as it } from "@progress/kendo-react-buttons";
|
|
23
23
|
import { useLocalization as pn } from "@progress/kendo-react-intl";
|
|
24
24
|
import { dropDownListArrowBtnAriaLabel as at, messages as mn } from "../messages/index.mjs";
|
|
25
|
-
import { MOBILE_SMALL_DEVISE as
|
|
25
|
+
import { MOBILE_SMALL_DEVISE as st, MOBILE_MEDIUM_DEVISE as lt } from "../common/constants.mjs";
|
|
26
26
|
import { ActionSheet as fn, ActionSheetHeader as gn, ActionSheetContent as vn } from "@progress/kendo-react-layout";
|
|
27
27
|
const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) => {
|
|
28
28
|
Yt(un);
|
|
@@ -73,19 +73,19 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
73
73
|
var n;
|
|
74
74
|
(n = t == null ? void 0 : t.current) == null || n.applyState(e), V.current = void 0;
|
|
75
75
|
}, X = (e, n) => {
|
|
76
|
-
var
|
|
76
|
+
var l;
|
|
77
77
|
const { virtual: a, dataItemKey: c, defaultItem: d } = r, u = P(E), I = a ? a.skip : 0, f = L(), o = e === -1 && d !== void 0 ? d : u[e - I], p = !N(o, f, c);
|
|
78
|
-
U(o, n), p && ((
|
|
78
|
+
U(o, n), p && ((l = t == null ? void 0 : t.current) == null || l.triggerPageChangeCornerItems(o, n));
|
|
79
79
|
}, A = (e, n, a) => {
|
|
80
80
|
var S, g;
|
|
81
|
-
const { defaultItem: c, dataItemKey: d, virtual: u = { skip: 0, total: 0, pageSize: 0 } } = r, I = L(), f = P(E), o = (S = t == null ? void 0 : t.current) == null ? void 0 : S.vs, p = f.findIndex((h) => N(h, I, d)),
|
|
81
|
+
const { defaultItem: c, dataItemKey: d, virtual: u = { skip: 0, total: 0, pageSize: 0 } } = r, I = L(), f = P(E), o = (S = t == null ? void 0 : t.current) == null ? void 0 : S.vs, p = f.findIndex((h) => N(h, I, d)), l = (g = t == null ? void 0 : t.current) == null ? void 0 : g.navigation.navigate({
|
|
82
82
|
current: u.skip + p,
|
|
83
83
|
max: (o != null && o.enabled ? u.total : f.length) - 1,
|
|
84
84
|
min: c !== void 0 ? -1 : 0,
|
|
85
85
|
keyCode: n,
|
|
86
86
|
skipItems: a || void 0
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
l !== void 0 && X(l, e), K(e);
|
|
89
89
|
}, It = (e) => {
|
|
90
90
|
q.current = e, t.current.wrapper = e;
|
|
91
91
|
}, ht = (e) => /* @__PURE__ */ i.createElement(
|
|
@@ -106,7 +106,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
106
106
|
textField: e,
|
|
107
107
|
dataItemKey: n,
|
|
108
108
|
virtual: a = { skip: 0 },
|
|
109
|
-
focusedItemIndex: c =
|
|
109
|
+
focusedItemIndex: c = ln,
|
|
110
110
|
filterable: d,
|
|
111
111
|
skipDisabledItems: u = !0
|
|
112
112
|
} = r, I = L(), f = P(E), o = r.filter ? r.filter : m.text;
|
|
@@ -132,80 +132,80 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
132
132
|
groupField: f = "",
|
|
133
133
|
textField: o,
|
|
134
134
|
skipDisabledItems: p = !0
|
|
135
|
-
} = r,
|
|
135
|
+
} = r, l = P(E), S = L(), g = l.findIndex((x) => N(x, S, I)), h = r.opened !== void 0 ? r.opened : m.opened, s = e.keyCode, T = s === w.home || s === w.end, b = s === w.up || s === w.down, $ = !h && (e.altKey && s === w.down || s === w.enter || s === w.space), te = h && (e.altKey && s === w.up || s === w.esc), ce = d && (s === w.left || s === w.right), ue = b || ce && !n || T, D = t.current.initState();
|
|
136
136
|
if (D.syntheticEvent = e, !a) {
|
|
137
137
|
if (T && ((z = t == null ? void 0 : t.current) != null && z.vs.enabled))
|
|
138
|
-
|
|
138
|
+
s === w.home ? u.skip !== 0 ? ((pe = t == null ? void 0 : t.current) == null || pe.triggerOnPageChange(D, 0, u.pageSize), H.current = !0) : U(l[0], D) : u.skip < u.total - u.pageSize ? ((W = t == null ? void 0 : t.current) == null || W.triggerOnPageChange(
|
|
139
139
|
D,
|
|
140
140
|
u.total - u.pageSize,
|
|
141
141
|
u.pageSize
|
|
142
|
-
), H.current = !0) : U(
|
|
143
|
-
else if (h &&
|
|
142
|
+
), H.current = !0) : U(l[l.length - 1], D);
|
|
143
|
+
else if (h && s === w.pageUp)
|
|
144
144
|
e.preventDefault(), (me = t == null ? void 0 : t.current) == null || me.scrollPopupByPageSize(-1);
|
|
145
|
-
else if (h &&
|
|
145
|
+
else if (h && s === w.pageDown)
|
|
146
146
|
e.preventDefault(), (j = t == null ? void 0 : t.current) == null || j.scrollPopupByPageSize(1);
|
|
147
|
-
else if (h &&
|
|
147
|
+
else if (h && s === w.enter) {
|
|
148
148
|
const x = De();
|
|
149
|
-
Te(
|
|
149
|
+
Te(l, x) ? (U(null, D), K(D)) : X(x, D), (Re = t == null ? void 0 : t.current) == null || Re.togglePopup(D), e.preventDefault();
|
|
150
150
|
} else if ($ || te)
|
|
151
151
|
te && xe(), (et = t == null ? void 0 : t.current) == null || et.togglePopup(D), e.preventDefault();
|
|
152
152
|
else if (ue) {
|
|
153
153
|
if (Ee.current = !1, f !== "" && o)
|
|
154
154
|
if (!p && h)
|
|
155
|
-
A(D,
|
|
155
|
+
A(D, s);
|
|
156
156
|
else {
|
|
157
157
|
let x;
|
|
158
|
-
if (
|
|
159
|
-
const y =
|
|
160
|
-
x = y &&
|
|
161
|
-
} else if (
|
|
158
|
+
if (s === w.down || s === w.right) {
|
|
159
|
+
const y = l.slice(g + 1).find((v) => !v.disabled && v[o]);
|
|
160
|
+
x = y && l.findIndex((v) => v[o] === y[o]);
|
|
161
|
+
} else if (s === w.up || s === w.left) {
|
|
162
162
|
let y;
|
|
163
163
|
if (g === 0 && c)
|
|
164
164
|
x = -1;
|
|
165
165
|
else if (g === -1)
|
|
166
|
-
y =
|
|
166
|
+
y = l, x = l.findIndex((v) => !v.disabled && v[o]);
|
|
167
167
|
else {
|
|
168
|
-
y =
|
|
168
|
+
y = l.slice(0, g);
|
|
169
169
|
let v = y.pop();
|
|
170
170
|
for (; v && v.disabled; )
|
|
171
171
|
v = y.pop();
|
|
172
|
-
x = v &&
|
|
172
|
+
x = v && l.findIndex((be) => be[o] === v[o]);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
if (x !== void 0) {
|
|
176
176
|
const y = x - g;
|
|
177
|
-
A(D,
|
|
177
|
+
A(D, s, y);
|
|
178
178
|
} else
|
|
179
|
-
x === void 0 &&
|
|
179
|
+
x === void 0 && l.findIndex((y) => y[o] === S[o]) === l.length - 1 && A(D, s);
|
|
180
180
|
}
|
|
181
181
|
else if (!p && h || T)
|
|
182
|
-
A(D,
|
|
182
|
+
A(D, s);
|
|
183
183
|
else if (o) {
|
|
184
184
|
let x;
|
|
185
|
-
if (
|
|
186
|
-
const y =
|
|
187
|
-
x = y &&
|
|
188
|
-
} else if (
|
|
185
|
+
if (s === w.down || s === w.right) {
|
|
186
|
+
const y = l.slice(g + 1).find((v) => !v.disabled && v[o]);
|
|
187
|
+
x = y && l.findIndex((v) => v[o] === y[o]);
|
|
188
|
+
} else if (s === w.up || s === w.left) {
|
|
189
189
|
let y;
|
|
190
190
|
if (g === 0 && c)
|
|
191
191
|
x = -1;
|
|
192
192
|
else if (g === -1)
|
|
193
|
-
y =
|
|
193
|
+
y = l, x = l.find((v) => !v.disabled && v[o]);
|
|
194
194
|
else {
|
|
195
|
-
y =
|
|
195
|
+
y = l.slice(0, g);
|
|
196
196
|
let v = y.pop();
|
|
197
197
|
for (; v && v.disabled; )
|
|
198
198
|
v = y.pop();
|
|
199
|
-
x = v &&
|
|
199
|
+
x = v && l.findIndex((be) => be[o] === v[o]);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
if (x !== void 0) {
|
|
203
203
|
const y = x - g;
|
|
204
|
-
A(D,
|
|
204
|
+
A(D, s, y);
|
|
205
205
|
} else
|
|
206
|
-
x === void 0 &&
|
|
206
|
+
x === void 0 && l.findIndex((y) => y[o] === S[o]) === l.length - 1 && A(D, s);
|
|
207
207
|
} else
|
|
208
|
-
A(D,
|
|
208
|
+
A(D, s);
|
|
209
209
|
e.preventDefault();
|
|
210
210
|
}
|
|
211
211
|
K(D);
|
|
@@ -261,7 +261,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
261
261
|
o !== m.group && Y({ group: o });
|
|
262
262
|
}
|
|
263
263
|
}, Ve = () => {
|
|
264
|
-
var
|
|
264
|
+
var s;
|
|
265
265
|
const {
|
|
266
266
|
textField: e,
|
|
267
267
|
dataItemKey: n,
|
|
@@ -269,12 +269,12 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
269
269
|
groupHeaderItemRender: c,
|
|
270
270
|
listNoDataRender: d,
|
|
271
271
|
itemRender: u
|
|
272
|
-
} = r, I = P(E), f = F && F.uDropDownList, o = t.current.vs, p = a.skip,
|
|
272
|
+
} = r, I = P(E), f = F && F.uDropDownList, o = t.current.vs, p = a.skip, l = r.opened !== void 0 ? r.opened : m.opened, S = t.current.getPopupSettings(), g = `translateY(${o.translate}px)`, h = L();
|
|
273
273
|
return /* @__PURE__ */ i.createElement(
|
|
274
|
-
|
|
274
|
+
sn,
|
|
275
275
|
{
|
|
276
276
|
id: ke,
|
|
277
|
-
show:
|
|
277
|
+
show: l,
|
|
278
278
|
data: I.slice(),
|
|
279
279
|
focusedIndex: De(),
|
|
280
280
|
value: h,
|
|
@@ -295,28 +295,28 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
295
295
|
noDataRender: d,
|
|
296
296
|
onScroll: Dt,
|
|
297
297
|
wrapperRef: o.scrollerRef,
|
|
298
|
-
scroller: (
|
|
298
|
+
scroller: (s = t == null ? void 0 : t.current) == null ? void 0 : s.renderScrollElement(),
|
|
299
299
|
ariaSetSize: a.total
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}, xt = () => {
|
|
303
303
|
var h;
|
|
304
|
-
const { windowWidth: e = 0 } = m, { header: n, footer: a, adaptiveTitle: c, groupField: d, groupStickyHeaderItemRender: u, list: I } = r, f = P(E), o = r.opened !== void 0 ? r.opened : m.opened, p = F && F.uDropDownList,
|
|
304
|
+
const { windowWidth: e = 0 } = m, { header: n, footer: a, adaptiveTitle: c, groupField: d, groupStickyHeaderItemRender: u, list: I } = r, f = P(E), o = r.opened !== void 0 ? r.opened : m.opened, p = F && F.uDropDownList, l = F && F.uDropDownsActionSheet, S = {
|
|
305
305
|
navigatable: !1,
|
|
306
306
|
navigatableElements: [],
|
|
307
307
|
expand: o,
|
|
308
308
|
animation: !0,
|
|
309
|
-
onClose: (
|
|
310
|
-
animationStyles: e <=
|
|
309
|
+
onClose: (s) => Ce(s),
|
|
310
|
+
animationStyles: e <= st ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
311
311
|
className: C(
|
|
312
312
|
J.wrapper({
|
|
313
|
-
c:
|
|
314
|
-
isFullScreen: e <=
|
|
313
|
+
c: l,
|
|
314
|
+
isFullScreen: e <= st
|
|
315
315
|
})
|
|
316
316
|
)
|
|
317
317
|
};
|
|
318
318
|
let { group: g } = m;
|
|
319
|
-
return g === void 0 && d !== void 0 && (g = fe(f[0], d)), /* @__PURE__ */ i.createElement(fn, { ...S }, /* @__PURE__ */ i.createElement(gn, { className: C(J.header({ c:
|
|
319
|
+
return g === void 0 && d !== void 0 && (g = fe(f[0], d)), /* @__PURE__ */ i.createElement(fn, { ...S }, /* @__PURE__ */ i.createElement(gn, { className: C(J.header({ c: l })) }, /* @__PURE__ */ i.createElement("div", { className: C(J.titleBar({ c: l })) }, /* @__PURE__ */ i.createElement("div", { className: C(J.title({ c: l })) }, /* @__PURE__ */ i.createElement("div", null, c)), /* @__PURE__ */ i.createElement("div", { className: C(J.actions({ c: l })) }, /* @__PURE__ */ i.createElement(
|
|
320
320
|
it,
|
|
321
321
|
{
|
|
322
322
|
tabIndex: 0,
|
|
@@ -328,7 +328,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
328
328
|
icon: "x",
|
|
329
329
|
svgIcon: nn
|
|
330
330
|
}
|
|
331
|
-
))), /* @__PURE__ */ i.createElement("div", { className: C(J.titleBarGroup({ c:
|
|
331
|
+
))), /* @__PURE__ */ i.createElement("div", { className: C(J.titleBarGroup({ c: l })) }, ze())), /* @__PURE__ */ i.createElement(vn, { overflowHidden: !0 }, n && /* @__PURE__ */ i.createElement("div", { className: C(M.listHeader({ c: p })) }, n), /* @__PURE__ */ i.createElement(
|
|
332
332
|
"div",
|
|
333
333
|
{
|
|
334
334
|
className: C(
|
|
@@ -358,9 +358,9 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
358
358
|
var n;
|
|
359
359
|
(n = r.popupSettings) != null && n.onMouseDownOutside && r.popupSettings.onMouseDownOutside.call(void 0, e);
|
|
360
360
|
}, kt = () => {
|
|
361
|
-
const { header: e, footer: n, dir: a, groupField: c, groupStickyHeaderItemRender: d, list: u } = r, I = P(E), f = t.current, o = f.getPopupSettings(), p = r.opened !== void 0 ? r.opened : m.opened,
|
|
361
|
+
const { header: e, footer: n, dir: a, groupField: c, groupStickyHeaderItemRender: d, list: u } = r, I = P(E), f = t.current, o = f.getPopupSettings(), p = r.opened !== void 0 ? r.opened : m.opened, l = o.width !== void 0 ? o.width : f.popupWidth, S = F && F.uDropDownList, g = {
|
|
362
362
|
dir: a !== void 0 ? a : f.dirCalculated,
|
|
363
|
-
width:
|
|
363
|
+
width: l,
|
|
364
364
|
popupSettings: {
|
|
365
365
|
...o,
|
|
366
366
|
popupClass: C(
|
|
@@ -400,18 +400,18 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
400
400
|
let o = d.length, p = Math.max(
|
|
401
401
|
0,
|
|
402
402
|
a.findIndex((b) => N(b, c, n))
|
|
403
|
-
),
|
|
404
|
-
r.defaultItem && (
|
|
405
|
-
let S, g, h,
|
|
403
|
+
), l;
|
|
404
|
+
r.defaultItem && (l = { item: r.defaultItem, itemIndex: -1 }, o += 1, p += 1), p += f ? 1 : 0, d = cn(d, p, l);
|
|
405
|
+
let S, g, h, s = 0;
|
|
406
406
|
const { textField: T } = r;
|
|
407
|
-
for (;
|
|
408
|
-
if (S = fe(d[
|
|
409
|
-
|
|
407
|
+
for (; s < o; s++)
|
|
408
|
+
if (S = fe(d[s].item, T), g = f && ot(S, I, ve), h = ot(S, u, ve), g || h) {
|
|
409
|
+
s = d[s].itemIndex;
|
|
410
410
|
break;
|
|
411
411
|
}
|
|
412
|
-
if (
|
|
412
|
+
if (s !== o) {
|
|
413
413
|
const b = t.current.initState();
|
|
414
|
-
b.syntheticEvent = e, X(
|
|
414
|
+
b.syntheticEvent = e, X(s, b), K(b), V.current = void 0;
|
|
415
415
|
}
|
|
416
416
|
}, Mt = (e) => {
|
|
417
417
|
clearTimeout(Be.current), r.filterable || (Be.current = window.setTimeout(() => G.current.word = "", ut), Lt(e));
|
|
@@ -420,7 +420,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
420
420
|
}, bt = (e) => {
|
|
421
421
|
if (oe.current || !m.focused)
|
|
422
422
|
return;
|
|
423
|
-
const n = r.opened !== void 0 ? r.opened : m.opened, { adaptive: a } = r, { windowWidth: c = 0 } = m, d = c <=
|
|
423
|
+
const n = r.opened !== void 0 ? r.opened : m.opened, { adaptive: a } = r, { windowWidth: c = 0 } = m, d = c <= lt && a, u = t.current.initState();
|
|
424
424
|
u.syntheticEvent = e, u.data.focused = !1, u.events.push({ type: "onBlur" }), n && xe(), n && !d && t.current.togglePopup(u), K(u);
|
|
425
425
|
}, Nt = (e) => {
|
|
426
426
|
if (r.filterable || e.which === 0 || e.keyCode === w.enter)
|
|
@@ -452,6 +452,12 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
452
452
|
get value() {
|
|
453
453
|
return L();
|
|
454
454
|
},
|
|
455
|
+
get focused() {
|
|
456
|
+
return m.focused;
|
|
457
|
+
},
|
|
458
|
+
get opened() {
|
|
459
|
+
return m.opened;
|
|
460
|
+
},
|
|
455
461
|
focus: mt,
|
|
456
462
|
props: r,
|
|
457
463
|
togglePopup: Ft
|
|
@@ -487,14 +493,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
487
493
|
value: L()
|
|
488
494
|
});
|
|
489
495
|
}, [Y, m, We, X, L]), i.useEffect(() => {
|
|
490
|
-
var p,
|
|
496
|
+
var p, l, S, g, h, s, T, b, $, te, ce, ue, D;
|
|
491
497
|
const { dataItemKey: e, virtual: n, groupField: a = "", textField: c } = r, d = P(E), u = B.current.virtual ? B.current.virtual.total : 0, I = r.opened !== void 0 ? r.opened : m.opened, f = B.current.opened !== void 0 ? B.current.opened : ie.current.opened, o = !f && I;
|
|
492
|
-
if ((p = t == null ? void 0 : t.current) == null || p.didUpdate(), (
|
|
498
|
+
if ((p = t == null ? void 0 : t.current) == null || p.didUpdate(), (l = t == null ? void 0 : t.current) != null && l.getPopupSettings().animate || o && Se(), n && n.total !== u)
|
|
493
499
|
(S = t == null ? void 0 : t.current) == null || S.vs.calcScrollElementHeight(), (g = t == null ? void 0 : t.current) == null || g.vs.reset();
|
|
494
500
|
else {
|
|
495
501
|
const z = L(), pe = B.current.value !== void 0 ? B.current.value : ie.current.value;
|
|
496
502
|
let W = d.findIndex((j) => N(j, z, e));
|
|
497
|
-
a !== "" && z && c && (W = (
|
|
503
|
+
a !== "" && z && c && (W = (s = (h = t == null ? void 0 : t.current) == null ? void 0 : h.getGroupedDataModernMode(d, a)) == null ? void 0 : s.map((j) => j[c]).indexOf(z[c]));
|
|
498
504
|
const me = !N(pe, z, e);
|
|
499
505
|
o && n ? (T = t == null ? void 0 : t.current) == null || T.scrollToVirtualItem(n, W) : o && !n ? (Se(), d && d.length !== 0 && ((b = t == null ? void 0 : t.current) == null || b.resetGroupStickyHeader(d[0][a], {
|
|
500
506
|
setState: Y,
|
|
@@ -521,14 +527,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
521
527
|
virtual: _,
|
|
522
528
|
adaptive: Vt,
|
|
523
529
|
dataItemKey: Ht,
|
|
524
|
-
disabled:
|
|
530
|
+
disabled: se,
|
|
525
531
|
loading: Ge,
|
|
526
532
|
iconClassName: Ye,
|
|
527
533
|
svgIcon: $e,
|
|
528
534
|
valueRender: je
|
|
529
|
-
} = r, { windowWidth: Bt = 0 } = m, Me = r.opened !== void 0 ? r.opened : m.opened,
|
|
535
|
+
} = r, { windowWidth: Bt = 0 } = m, Me = r.opened !== void 0 ? r.opened : m.opened, le = L(), Pe = fe(le, r.textField), Je = !gt() || ye().valid, de = t.current, _t = de.vs, Qe = Bt <= lt && Vt, ee = F && F.uDropDownList;
|
|
530
536
|
_t.enabled = _ !== void 0, _ !== void 0 && (de.vs.skip = _.skip, de.vs.total = _.total, de.vs.pageSize = _.pageSize);
|
|
531
|
-
const Wt = P(E), { focused: Ut } = m, qt = Wt.findIndex((e) => N(e,
|
|
537
|
+
const Wt = P(E), { focused: Ut } = m, qt = Wt.findIndex((e) => N(e, le, Ht)), Xe = /* @__PURE__ */ i.createElement("span", { id: Ue, className: C(M.inputInner({ c: ee })) }, Pe && /* @__PURE__ */ i.createElement("span", { className: C(M.inputText({ c: ee })) }, Pe)), Gt = je !== void 0 ? je.call(void 0, Xe, le) : Xe, Ze = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
|
|
532
538
|
"span",
|
|
533
539
|
{
|
|
534
540
|
ref: It,
|
|
@@ -539,7 +545,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
539
545
|
rounded: Fe,
|
|
540
546
|
fillMode: Ie,
|
|
541
547
|
focused: Ut,
|
|
542
|
-
disabled:
|
|
548
|
+
disabled: se,
|
|
543
549
|
invalid: !Je,
|
|
544
550
|
loading: Ge,
|
|
545
551
|
required: we()
|
|
@@ -553,14 +559,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
553
559
|
} : void 0,
|
|
554
560
|
onFocus: Pt,
|
|
555
561
|
onBlur: bt,
|
|
556
|
-
tabIndex: Qt(pt,
|
|
562
|
+
tabIndex: Qt(pt, se),
|
|
557
563
|
accessKey: r.accessKey,
|
|
558
564
|
onKeyDown: Oe,
|
|
559
565
|
onKeyPress: Nt,
|
|
560
|
-
onClick:
|
|
566
|
+
onClick: se ? void 0 : Ce,
|
|
561
567
|
role: "combobox",
|
|
562
568
|
"aria-required": we(),
|
|
563
|
-
"aria-disabled":
|
|
569
|
+
"aria-disabled": se || void 0,
|
|
564
570
|
"aria-haspopup": "listbox",
|
|
565
571
|
"aria-expanded": Me || !1,
|
|
566
572
|
"aria-owns": ke,
|
|
@@ -591,7 +597,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
591
597
|
onMouseDown: (e) => m.focused && e.preventDefault()
|
|
592
598
|
}
|
|
593
599
|
),
|
|
594
|
-
ht(
|
|
600
|
+
ht(le),
|
|
595
601
|
!Qe && kt()
|
|
596
602
|
), Qe && xt());
|
|
597
603
|
return Le ? /* @__PURE__ */ i.createElement(
|
|
@@ -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,n,a,o,l,r,d,u,p){"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 h=c(t);const g=e=>{const{children:t,width:s,dir:i,itemsCount:n,popupSettings:a}=e;return h.createElement(o.Popup,{style:{width:s,direction:i},contentKey:n&&n.join(),...a},t)},m=h.forwardRef(((e,t)=>{const s=h.useRef(null),{renderListFilterWrapper:n=!1,renderPrefixSeparator:o=!1,...r}=e,d=i.useUnstyled(),u=d&&d.uDropDownsBase;h.useImperativeHandle(t,(()=>s.current));const p=h.createElement(l.TextBox,{...r,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:u})),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:()=>h.createElement(h.Fragment,null,h.createElement(l.InputPrefix,null,h.createElement(i.IconWrap,{name:"search",icon:a.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:u}))})),o&&h.createElement(l.InputSeparator,null))});return n?h.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:u}))}," ",p," "):p}));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=e=>{const{group:t,groupMode:s,render:n}=e,a=i.useUnstyled(),o=a&&a.uDropDownsBase,l=h.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:o}))},"classic"===s?t:h.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:o}))},t));return void 0!==n?n.call(void 0,l,e):l},f=e=>null!=e,y=(e,t,s)=>{if(!f(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},b=(e,t,s,i,n)=>{const a=e.offsetHeight,o=t.children.item(s),l=o.offsetTop+(n?i-e.scrollTop:0),r=o.offsetHeight;if(n){let t=0;l+r>a?t=l+r-a:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>a+e.scrollTop?e.scrollTop=l+r-a:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},x=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let n=0;n<e.length;n++){const a=(I(e[n],s)||"")+"";if(a&&a.toLowerCase().startsWith(t)){i=n;break}}}return i},C=(e,t,s,i=!1)=>{const n=e=>i?e:e.toLowerCase();return e.findIndex((e=>s?n(I(e,s))===n(t):n(t)===n(e.toString())))},I=(e,t)=>{if(t&&f(e)){const s=t.split(".");let i=e;return s.forEach((e=>{i=i?i[e]:void 0})),i}return e},k=(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||f(e)===f(t)&&I(e,s)===I(t,s),S=(e,t,s)=>{if(t){const i=C(e,t,s,!0);return-1!==i?e[i]:e[x(e,t,s)]}return e[0]},E=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},D=(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)),F=e=>{const{data:t=[],groupField:s}=e;return s?t.filter((e=>s&&void 0!==e[s])):t},K=e=>e.preventDefault(),N=e=>{const{selected:t,defaultItem:s,textField:n}=e,a=i.useUnstyled(),o=a&&a.uDropDownsBase;return h.createElement("div",{onClick:e.onClick,onMouseDown:K,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionLabel({c:o,selected:t}))},I(s,n)||"")},M=e=>{const{selected:t,group:s,dataItem:n,virtual:a,groupMode:o,disabled:l,id:r,focused:d,render:u}=e,p=i.useUnstyled(),c=p&&p.uDropDownsBase,g=h.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:a?"relative":"unset"}},h.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:c}))},I(n,e.textField).toString()),void 0!==s&&"classic"===o?h.createElement("div",{className:i.classNames(i.uDropDownsBase.itemGroupLabel({c:c}))},s):null);return void 0!==u?u.call(void 0,g,e):g},T=e=>{const{group:t,virtual:s,render:n,isMultiColumn:a=!1,id:o}=e,l=i.useUnstyled(),r=l&&l.uDropDownsBase,d=h.createElement("li",{id:o,role:"group",className:i.classNames(i.uDropDownsBase.groupLi({c:r,isMultiColumn:a})),style:a?{boxSizing:"inherit",position:s?"relative":"unset"}:{position:s?"relative":"unset"}},h.createElement("span",{className:n?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:r,isMultiColumn:a}))},t));return void 0!==n?n.call(void 0,d,e):d},P="dropdowns.nodata",B="dropdowns.clear",R="dropdowns.comboArrowBtnAriaLabelExpand",O="dropdowns.comboArrowBtnAriaLabelCollapse",L="dropdowns.dropDownListArrowBtnAriaLabel",z="dropdowns.apply",H="dropdowns.cancel",_={[B]:"clear",[P]:"NO DATA FOUND.",[R]:"expand combobox",[O]:"collapse combobox",[L]:"select",[z]:"Apply",[H]:"Cancel"},V=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,{id:a,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:u,listRef:p,wrapperRef:c,listClassName:g,ariaSetSize:m}=e,v=(()=>{const{textField:t,valueField:s,groupField:i,groupMode:n,isMultiColumn:a,optionsGuid:o,skip:l=0,virtual:r,focusedIndex:d,hasDuplicates:u,highlightSelected:p=!0,value:c,data:g,itemRender:m,groupHeaderItemRender:v}=e,f=Array.isArray(c);let y=0;return g.map(((b,x)=>{const C=l+x,k=l+x+y,S=u?!!c&&d===x:!b.disabled&&(p&&(!f&&w(b,c,s)||f&&-1!==c.findIndex((e=>w(e,b,s)))));let E,D,F;x>0&&void 0!==i&&(D=I(b,i),F=I(g[x-1],i),D&&F&&D!==F&&(E=D));const K=void 0!==E&&"modern"===n;return K?y+=1:y=0,[K&&h.createElement(T,{id:`option-${o}-${k}`,virtual:r,key:C+"-group-item",group:E,isMultiColumn:a,render:v}),h.createElement(M,{id:`option-${o}-${K?k+1:k}`,virtual:r,dataItem:b,groupMode:n,selected:S,focused:d===x,index:C,key:C,onClick:e.onClick,textField:t,group:E,render:m,disabled:b.disabled})]}))})();return v.length?h.createElement("div",{className:l,style:d,ref:c,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},h.createElement("ul",{id:a,role:"listbox","aria-hidden":!o||void 0,"aria-setsize":m,className:g||i.classNames(i.uDropDownsBase.ul({c:n})),ref:p,style:u},v),e.scroller&&h.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:n}))},e.scroller)):(()=>{const s=e.noDataRender,a=h.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:n}))},h.createElement("div",null,t.toLanguageString(P,_[P])));return s?s.call(void 0,a):a})()},q="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);let A=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(h.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=q?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&&(q||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,n=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let a=this.rowHeightService.index(t),o=this.rowHeightService.offset(a);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=a+this.pageSize-this.total;t>0&&(a-=t,o=this.rowHeightService.offset(a)),this.firstLoaded=a,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&a-1<=this.firstLoaded){const t=n===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(a-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}},W=class{navigate(e){const t=e.keyCode;return t===i.Keys.up||t===i.Keys.left?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:-1}):t===i.Keys.down||t===i.Keys.right?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:1}):t===i.Keys.home?0:t===i.Keys.end?e.max:void 0}next(e){return f(e.current)?Math.min(e.max,Math.max(e.current+e.step,e.min)):e.min}};const U=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new A,this.navigation=new W,this.handleItemClick=(e,t)=>{const s=this.initState();s.syntheticEvent=t,t.stopPropagation(),this.component.handleItemSelect(e,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=e=>{if(!this.component.state.focused){const t=this.initState();t.data.focused=!0,t.events.push({type:"onFocus"}),t.syntheticEvent=e,this.applyState(t)}},this.filterChanged=(e,t)=>{const{textField:s,filterable:i}=this.component.props;i&&t.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:e}})},this.togglePopup=e=>{const t=this.component.props,s=void 0!==t.opened?t.opened:this.component.state.opened;void 0===t.opened&&(e.data.opened=!s),s?e.events.push({type:"onClose"}):(e.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(e,t)=>{const s=this.initState();s.syntheticEvent=t,this.triggerOnPageChange(s,e.skip,e.take),this.applyState(s)},this.scrollToVirtualItem=(e,t)=>{const s=this.vs;if(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,n,a,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,u=null==(n=null==(i=this.list)?void 0:i.parentElement)?void 0:n.offsetHeight;void 0!==r&&void 0!==u&&(null==(o=null==(a=this.list)?void 0:a.parentElement)||o.scroll({top:r+e*Math.floor(u/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&h.createElement("div",{ref:t=>e.scrollElement=t,key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({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 n=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),n=!0),n&&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,n=s.container||i.parentNode,a=void 0!==t?t:s.enabled;b(n,i,e,s.translate,a)}}updateComponentArgs(e){for(let t in e)Object.hasOwnProperty.call(e,t)&&(this.component[t]=e[t])}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 n=Math.min(Math.max(0,t),Math.max(0,i.total-s));n!==i.skip&&e.events.push({type:"onPageChange",page:{skip:n,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:n,virtual:a}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&a&&this.vs.enabled&&(a.skip>0&&w(e,i[0],n)?this.triggerOnPageChange(t,a.skip-1,a.pageSize):!o&&a.skip+a.pageSize<a.total&&w(e,i[i.length-1],n)&&this.triggerOnPageChange(t,a.skip+1,a.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,n)=>{e[n-1]&&i[t]!==e[n-1][t]&&s.push({[t]:i[t]}),s.push(e[n])})),s}};U.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},U.propTypes={...U.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},U.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let $=U;const G={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"},j=500,Y=768,J=h.forwardRef(((e,t)=>{i.validatePackage(G);const s=i.useUnstyled(),o=i.useId(e.id),l=i.usePropsContext(X,e),{delay:p=Q.delay,tabIndex:c=Q.tabIndex,ignoreCase:b=Q.ignoreCase,size:C=Q.size,rounded:k=Q.rounded,fillMode:S=Q.fillMode,groupMode:E=Q.groupMode}=l,D=()=>{if(i.canUseDOM)return he.current&&he.current.ownerDocument||window.document},K=()=>{var e,t;null!=(e=null==we?void 0:we.current)&&e.wrapper&&(null==(t=null==we?void 0:we.current)||t.wrapper.focus({preventScroll:!0}))},M=()=>{let e;return void 0!==be.current&&null!==be.current?e=be.current:void 0!==l.value?e=l.value:void 0!==De.value&&null!==De.value?e=De.value:void 0!==l.defaultValue&&null!==l.defaultValue&&(e=l.defaultValue),!f(e)&&void 0!==l.defaultItem&&null!==l.defaultItem&&(e=l.defaultItem),e},T=()=>void 0!==l.required?l.required:Q.required,P=()=>{const e=void 0!==l.validationMessage,t=M(),s=!T()||null!==t&&""!==t&&void 0!==t;return{customError:e,valid:void 0!==l.valid?l.valid:s,valueMissing:null===t}},B=e=>{ye.current=!0,e.focus(),window.setTimeout((()=>ye.current=!1),30)},R=()=>{me.current&&B(me.current),l.adaptive&&setTimeout((()=>{me.current&&B(me.current)}),300)},O=()=>{ge.current&&ge.current.setCustomValidity&&ge.current.setCustomValidity(P().valid?"":l.validationMessage||"Please select a value from the list!")},z=(e,t)=>{const s=M();w(s,e,l.dataItemKey)||(void 0===l.value&&(t.data.value=e),we.current.updateComponentArgs({value:e}),be.current=e,t.events.push({type:"onChange"}))},H=e=>{var t;null==(t=null==we?void 0:we.current)||t.applyState(e),be.current=void 0},q=(t,s)=>{var i;const{virtual:n,dataItemKey:a,defaultItem:o}=l,r=F(e),d=n?n.skip:0,u=M(),p=-1===t&&void 0!==o?o:r[t-d],c=!w(p,u,a);z(p,s),c&&(null==(i=null==we?void 0:we.current)||i.triggerPageChangeCornerItems(p,s))},A=(t,s,i)=>{var n,a;const{defaultItem:o,dataItemKey:r,virtual:d={skip:0,total:0,pageSize:0}}=l,u=M(),p=F(e),c=null==(n=null==we?void 0:we.current)?void 0:n.vs,h=p.findIndex((e=>w(e,u,r))),g=null==(a=null==we?void 0:we.current)?void 0:a.navigation.navigate({current:d.skip+h,max:(null!=c&&c.enabled?d.total:p.length)-1,min:void 0!==o?-1:0,keyCode:s,skipItems:i||void 0});void 0!==g&&q(g,t),H(t)},W=()=>{const{textField:t,dataItemKey:s,virtual:i={skip:0},focusedItemIndex:n=x,filterable:a,skipDisabledItems:o=!0}=l,r=M(),d=F(e),u=l.filter?l.filter:De.text;return o&&t&&!u&&!r?d.findIndex((e=>!e.disabled&&e[t])):f(r)&&void 0===u||a&&""===u?d.findIndex((e=>w(e,r,s))):u?Ce.current?n(d,u,t):d.findIndex((e=>w(e,r,s))):0===i.skip?0:-1},U=(e,t)=>void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled,J=()=>{const t=F(e),s=we.current.initState(),i=W();U(t,i)&&(z(null,s),H(s))},Z=e=>{if(e.isPropagationStopped())return;const t=we.current.initState();t.syntheticEvent=e,De.focused||(t.data.focused=!0),J(),we.current.togglePopup(t),H(t)},ee=t=>{var s,n,a,o,r,d,u;t&&t.target instanceof Element&&"INPUT"===t.target.nodeName&&t.stopPropagation&&t.stopPropagation();const{filterable:p,disabled:c,defaultItem:h,leftRightKeysNavigation:g=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:v,groupField:f="",textField:y,skipDisabledItems:b=!0}=l,x=F(e),C=M(),I=x.findIndex((e=>w(e,C,v))),k=void 0!==l.opened?l.opened:De.opened,S=t.keyCode,E=S===i.Keys.home||S===i.Keys.end,D=S===i.Keys.up||S===i.Keys.down,K=!k&&(t.altKey&&S===i.Keys.down||S===i.Keys.enter||S===i.Keys.space),N=k&&(t.altKey&&S===i.Keys.up||S===i.Keys.esc),T=g&&(S===i.Keys.left||S===i.Keys.right),P=D||T&&!p||E,B=we.current.initState();if(B.syntheticEvent=t,!c){if(E&&null!=(s=null==we?void 0:we.current)&&s.vs.enabled)S===i.Keys.home?0!==m.skip?(null==(n=null==we?void 0:we.current)||n.triggerOnPageChange(B,0,m.pageSize),xe.current=!0):z(x[0],B):m.skip<m.total-m.pageSize?(null==(a=null==we?void 0:we.current)||a.triggerOnPageChange(B,m.total-m.pageSize,m.pageSize),xe.current=!0):z(x[x.length-1],B);else if(k&&S===i.Keys.pageUp)t.preventDefault(),null==(o=null==we?void 0:we.current)||o.scrollPopupByPageSize(-1);else if(k&&S===i.Keys.pageDown)t.preventDefault(),null==(r=null==we?void 0:we.current)||r.scrollPopupByPageSize(1);else if(k&&S===i.Keys.enter){const e=W();U(x,e)?(z(null,B),H(B)):q(e,B),null==(d=null==we?void 0:we.current)||d.togglePopup(B),t.preventDefault()}else if(K||N)N&&J(),null==(u=null==we?void 0:we.current)||u.togglePopup(B),t.preventDefault();else if(P){if(Ce.current=!1,""!==f&&y)if(!b&&k)A(B,S);else{let e;if(S===i.Keys.down||S===i.Keys.right){const t=x.slice(I+1).find((e=>!e.disabled&&e[y]));e=t&&x.findIndex((e=>e[y]===t[y]))}else if(S===i.Keys.up||S===i.Keys.left){let t;if(0===I&&h)e=-1;else if(-1===I)t=x,e=x.findIndex((e=>!e.disabled&&e[y]));else{t=x.slice(0,I);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&x.findIndex((e=>e[y]===s[y]))}}if(void 0!==e){A(B,S,e-I)}else void 0===e&&x.findIndex((e=>e[y]===C[y]))===x.length-1&&A(B,S)}else if(!b&&k||E)A(B,S);else if(y){let e;if(S===i.Keys.down||S===i.Keys.right){const t=x.slice(I+1).find((e=>!e.disabled&&e[y]));e=t&&x.findIndex((e=>e[y]===t[y]))}else if(S===i.Keys.up||S===i.Keys.left){let t;if(0===I&&h)e=-1;else if(-1===I)t=x,e=x.find((e=>!e.disabled&&e[y]));else{t=x.slice(0,I);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&x.findIndex((e=>e[y]===s[y]))}}if(void 0!==e){A(B,S,e-I)}else void 0===e&&x.findIndex((e=>e[y]===C[y]))===x.length-1&&A(B,S)}else A(B,S);t.preventDefault()}H(B)}},te=e=>{const t=we.current.initState();t.syntheticEvent=e.syntheticEvent,void 0===l.filter&&(t.data.text=e.target.value),we.current.filterChanged(e.target.value,t),Ce.current=!0,H(t),Me({group:void 0,text:String(e.target.value)})},se=()=>{const e=void 0!==l.filter?l.filter:De.text;return l.filterable&&h.createElement(m,{value:e,ref:e=>me.current=e&&e.element,onChange:te,onKeyDown:ee,size:C,rounded:k,fillMode:S,renderListFilterWrapper:!0})},ie=e=>{var t;const s=we.current.initState();s.syntheticEvent=e,null==(t=null==we?void 0:we.current)||t.togglePopup(s),z(l.defaultItem,s),H(s)},ne=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=l,i=M();return void 0!==t&&h.createElement(N,{defaultItem:t,textField:e,selected:w(i,t,s),key:"defaultitemkey",onClick:ie})},ae=(e,t)=>{var s;null==(s=null==we?void 0:we.current)||s.handleItemClick(e,t),be.current=void 0},oe=t=>{const{vs:s,list:i}=we.current;s.scrollHandler(t);const{groupField:n}=l;let a=F(e);if(n&&a.length&&n){const e=Se.current=Se.current||(s.enabled?s.itemHeight:i?i.children[0].offsetHeight:0),o=t.target.scrollTop-s.skip*e;a=we.current.getGroupedDataModernMode(a,n);let l=a[0][n];for(let t=1;t<a.length&&!(e*t>o);t++)a[t]&&a[t][n]&&(l=a[t][n]);l!==De.group&&Me({group:l})}},le=()=>{var t;const{textField:n,dataItemKey:a,virtual:o={skip:0,total:void 0},groupHeaderItemRender:r,listNoDataRender:d,itemRender:u}=l,p=F(e),c=s&&s.uDropDownList,g=we.current.vs,m=o.skip,v=void 0!==l.opened?l.opened:De.opened,f=we.current.getPopupSettings(),y=`translateY(${g.translate}px)`,b=M();return h.createElement(V,{id:Pe,show:v,data:p.slice(),focusedIndex:W(),value:b,textField:n,valueField:a,optionsGuid:Be,groupField:l.groupField,groupMode:"modern",listRef:e=>g.list=we.current.list=e,wrapperStyle:{maxHeight:f.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:c})),listStyle:g.enabled?{transform:y}:void 0,key:"listkey",skip:m,onClick:ae,itemRender:u,groupHeaderItemRender:r,noDataRender:d,onScroll:oe,wrapperRef:g.scrollerRef,scroller:null==(t=null==we?void 0:we.current)?void 0:t.renderScrollElement(),ariaSetSize:o.total})},re=()=>{De.focused&&window.setTimeout((()=>{De.focused&&we.current.wrapper&&B(we.current.wrapper)}))},de=e=>{var t;null!=(t=l.popupSettings)&&t.onMouseDownOutside&&l.popupSettings.onMouseDownOutside.call(void 0,e)},ue=t=>{clearTimeout(ve.current),l.filterable||(ve.current=window.setTimeout((()=>fe.current.word=""),p),(t=>{const{dataItemKey:s}=l,i=F(e),n=M();let a=i.map(((e,t)=>({item:e,itemIndex:t})));const o=fe.current.word,r=fe.current.last,d=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(o,r);let u,p=a.length,c=Math.max(0,i.findIndex((e=>w(e,n,s))));l.defaultItem&&(u={item:l.defaultItem,itemIndex:-1},p+=1,c+=1),c+=d?1:0,a=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(a,c,u);let h,g,m,v=0;const{textField:f}=l;for(;v<p;v++)if(h=I(a[v].item,f),g=d&&y(h,r,b),m=y(h,o,b),g||m){v=a[v].itemIndex;break}if(v!==p){const e=we.current.initState();e.syntheticEvent=t,q(v,e),H(e),be.current=void 0}})(t))},pe=()=>{const e=we.current.initState();e.data.opened=De.opened,we.current.togglePopup(e),H(e)},ce=h.useRef(null),he=h.useRef(null),ge=h.useRef(),me=h.useRef(null);h.useImperativeHandle(ce,(()=>({get element(){return he.current},get index(){return(()=>{const{dataItemKey:t}=l,s=F(e),i=M();return s.findIndex((e=>w(e,i,t)))})()},get name(){return l.name},get validity(){return P()},get value(){return M()},focus:K,props:l,togglePopup:pe}))),h.useImperativeHandle(t,(()=>ce.current));const ve=h.useRef(null),fe=h.useRef({word:"",last:""}),ye=h.useRef(!1),be=h.useRef(null),xe=h.useRef(!1),Ce=h.useRef(!1),Ie=h.useRef({}),ke=h.useRef({}),we=h.useRef(new $({props:e,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Se=h.useRef(0),Ee=h.useRef(null),[De,Fe]=h.useState({}),[,Ke]=h.useReducer((e=>e),!0),Ne=r.useLocalization(),Me=e=>{Fe({...De,...e})};h.useEffect((()=>{we.current.updateComponentArgs({props:e,setState:Me,state:De,forceUpdate:Ke,element:he.current,handleItemSelect:q,value:M()})}),[Me,De,Ke,q,M]),h.useEffect((()=>{var t,s,i,n,a,o,r,d,u,p,c,h,g;const{dataItemKey:m,virtual:v,groupField:f="",textField:y}=l,b=F(e),x=Ie.current.virtual?Ie.current.virtual.total:0,C=void 0!==l.opened?l.opened:De.opened,I=void 0!==Ie.current.opened?Ie.current.opened:ke.current.opened,k=!I&&C;if(null==(t=null==we?void 0:we.current)||t.didUpdate(),null!=(s=null==we?void 0:we.current)&&s.getPopupSettings().animate||k&&R(),v&&v.total!==x)null==(i=null==we?void 0:we.current)||i.vs.calcScrollElementHeight(),null==(n=null==we?void 0:we.current)||n.vs.reset();else{const e=M(),t=void 0!==Ie.current.value?Ie.current.value:ke.current.value;let s=b.findIndex((t=>w(t,e,m)));""!==f&&e&&y&&(s=null==(o=null==(a=null==we?void 0:we.current)?void 0:a.getGroupedDataModernMode(b,f))?void 0:o.map((e=>e[y])).indexOf(e[y]));const i=!w(t,e,m);k&&v?null==(r=null==we?void 0:we.current)||r.scrollToVirtualItem(v,s):k&&!v?(R(),b&&0!==b.length&&(null==(d=null==we?void 0:we.current)||d.resetGroupStickyHeader(b[0][f],{setState:Me,group:De.group,state:De})),null==(u=null==we?void 0:we.current)||u.scrollToItem(s)):C&&I&&e&&i&&!xe.current?null==(c=null==we?void 0:we.current)||c.scrollToItem(s,null==(p=null==we?void 0:we.current)?void 0:p.vs.enabled):C&&I&&xe.current&&(xe.current&&v&&0===v.skip?null==(h=null==we?void 0:we.current)||h.vs.reset():xe.current&&v&&v.skip===v.total-v.pageSize&&(null==(g=null==we?void 0:we.current)||g.vs.scrollToEnd()))}xe.current=!1,ke.current=De,Ie.current=l,O()})),h.useEffect((()=>{var e,t;return Ee.current=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver((e=>(e=>{for(const t of e)t.target.clientWidth!==ke.current.windowWidth&&Me({windowWidth:t.target.clientWidth})})(e))),null==(e=null==we?void 0:we.current)||e.didMount(),O(),null!=(t=D())&&t.body&&Ee.current&&Ee.current.observe(D().body),()=>{var e;null!=(e=D())&&e.body&&Ee.current&&Ee.current.disconnect()}}),[]);const Te=o+"-accessibility-id",Pe=o+"-listbox-id",Be=o+"-guid",Re=Ne.toLanguageString(L,_[L]),{style:Oe,className:Le,label:ze,dir:He,virtual:_e,adaptive:Ve,dataItemKey:qe,disabled:Ae,loading:We,iconClassName:Ue,svgIcon:$e,valueRender:Ge}=l,{windowWidth:je=0}=De,Ye=void 0!==l.opened?l.opened:De.opened,Je=M(),Qe=I(Je,l.textField),Xe=!(void 0!==l.validityStyles?l.validityStyles:Q.validityStyles)||P().valid,Ze=we.current,et=Ze.vs,tt=je<=Y&&Ve,st=s&&s.uDropDownList;et.enabled=void 0!==_e,void 0!==_e&&(Ze.vs.skip=_e.skip,Ze.vs.total=_e.total,Ze.vs.pageSize=_e.pageSize);const it=F(e),{focused:nt}=De,at=it.findIndex((e=>w(e,Je,qe))),ot=h.createElement("span",{id:Te,className:i.classNames(i.uDropDownList.inputInner({c:st}))},Qe&&h.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:st}))},Qe)),lt=void 0!==Ge?Ge.call(void 0,ot,Je):ot,rt=h.createElement(h.Fragment,null,h.createElement("span",{ref:e=>{he.current=e,we.current.wrapper=e},className:i.classNames(i.uDropDownList.wrapper({c:st,size:C,rounded:k,fillMode:S,focused:nt,disabled:Ae,invalid:!Xe,loading:We,required:T()}),Le),style:ze?{...Oe,width:void 0}:Oe,dir:He,onMouseDown:Ye?e=>{"INPUT"!==e.target.nodeName&&(B(we.current.wrapper),e.preventDefault())}:void 0,onFocus:e=>{ye.current||we.current.handleFocus(e)},onBlur:e=>{if(ye.current||!De.focused)return;const t=void 0!==l.opened?l.opened:De.opened,{adaptive:s}=l,{windowWidth:i=0}=De,n=i<=Y&&s,a=we.current.initState();a.syntheticEvent=e,a.data.focused=!1,a.events.push({type:"onBlur"}),t&&J(),t&&!n&&we.current.togglePopup(a),H(a)},tabIndex:i.getTabIndex(c,Ae),accessKey:l.accessKey,onKeyDown:ee,onKeyPress:e=>{if(l.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);b&&(t=t.toLowerCase())," "===t&&e.preventDefault(),fe.current={word:fe.current.word+t,last:fe.current.last+t},ue(e)},onClick:Ae?void 0:Z,role:"combobox","aria-required":T(),"aria-disabled":Ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ye||!1,"aria-owns":Pe,"aria-activedescendant":Ye?"option-"+Be+"-"+(at+(_e?_e.skip:0)):void 0,"aria-label":l.ariaLabel||l.label,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy||Te,"aria-controls":Pe,id:l.id,title:l.title},lt,We&&h.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:st})),name:"loading"}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":Re,size:C,fillMode:S,iconClass:Ue,className:i.classNames(i.uDropDownList.inputButton({c:st})),rounded:null,themeColor:"base",icon:Ue?void 0:"caret-alt-down",svgIcon:$e||a.caretAltDownIcon,onMouseDown:e=>De.focused&&e.preventDefault()}),(e=>h.createElement("select",{name:l.name,ref:e=>{ge.current=e},tabIndex:-1,"aria-hidden":!0,title:l.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,e):e})))(Je),!tt&&(()=>{const{header:t,footer:n,dir:a,groupField:o,groupStickyHeaderItemRender:r,list:d}=l,u=F(e),p=we.current,c=p.getPopupSettings(),m=void 0!==l.opened?l.opened:De.opened,f=void 0!==c.width?c.width:p.popupWidth,y=s&&s.uDropDownList,b={dir:void 0!==a?a:p.dirCalculated,width:f,popupSettings:{...c,popupClass:i.classNames(c.popupClass,i.uDropDownList.listContainer({c:y})),anchor:c.anchor||he.current,show:m,onOpen:R,onClose:re,onMouseDownOutside:de},itemsCount:[u.length]};let{group:x}=De;return void 0===x&&void 0!==o&&(x=I(u[0],o)),h.createElement(g,{...b},se(),t&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:y}))},t),h.createElement("div",{className:i.classNames(i.uDropDownList.list({c:y,size:C,virtual:we.current.vs.enabled}))},ne(),!d&&x&&0!==u.length&&h.createElement(v,{group:x,groupMode:"modern",render:r}),le()),n&&h.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:y}))},n))})()),tt&&(()=>{var t;const{windowWidth:n=0}=De,{header:o,footer:r,adaptiveTitle:p,groupField:c,groupStickyHeaderItemRender:g,list:m}=l,f=F(e),y=void 0!==l.opened?l.opened:De.opened,b=s&&s.uDropDownList,x=s&&s.uDropDownsActionSheet,k={navigatable:!1,navigatableElements:[],expand:y,animation:!0,onClose:e=>Z(e),animationStyles:n<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:x,isFullScreen:n<=j}))};let{group:w}=De;return void 0===w&&void 0!==c&&(w=I(f[0],c)),h.createElement(u.ActionSheet,{...k},h.createElement(u.ActionSheetHeader,{className:i.classNames(i.uDropDownsActionSheet.header({c:x}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:x}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:x}))},h.createElement("div",null,p)),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:x}))},h.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Z,icon:"x",svgIcon:a.xIcon}))),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:x}))},se())),h.createElement(u.ActionSheetContent,{overflowHidden:!0},o&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:b}))},o),h.createElement("div",{className:i.classNames(i.uDropDownList.list({c:b,size:C,virtual:null==(t=null==we?void 0:we.current)?void 0:t.vs.enabled}))},ne(),!m&&w&&0!==f.length&&h.createElement(v,{group:w,groupMode:"modern",render:g}),le()),r&&h.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:b}))},r)))})());return ze?h.createElement(n.FloatingLabel,{label:ze,editorValue:Qe,editorValid:Xe,editorDisabled:l.disabled,style:{width:Oe?Oe.width:void 0},children:rt}):rt}));J.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};const Q={delay:500,tabIndex:0,ignoreCase:!0,...$.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};J.displayName="KendoReactDropDownList";const X=i.createPropsContext();J.displayName="KendoReactDropDownList";let Z=class extends h.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:n,suggestedText:a,focused:o}=this.props,l=this.input,r=t!==n||a!==s,d=r&&t.startsWith(n)&&!(s&&a&&s.endsWith(a)),u=i.getActiveElement(document);o&&l&&u!==l&&l.focus(),a&&r&&!d&&l&&l.setSelectionRange(n.length-a.length,n.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:n,tabIndex:a,accessKey:o,unstyled:l}=this.props,r=l&&l.uDropDownsBase,d={tabIndex:a,accessKey:o},u=h.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:i.classNames(i.uDropDownsBase.inputInner({c:r})),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,...d});return n?n.call(void 0,u):u}};const ee=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,o=t.toLanguageString(B,_[B]);return h.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:n})),role:"button",onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon}))},te=i.useCustomComponent,se=class e extends h.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.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,n=F(this.props)[e-(s?s.skip:0)],a=this.hasDuplicates||!w(n,this.value,i);this.triggerOnChange(n,t),void 0!==this.state.text&&(t.data.text=void 0),a&&this.base.triggerPageChangeCornerItems(n,t)},this.onPopupOpened=()=>{setTimeout((()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)}),300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{skipDisabledItems:t,textField:s}=this.props,i=F(this.props),n=this.getFocusedIndex(),a=this.getCurrentValueDisabledStatus(s,i,n),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&a&&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=f(e)?e:t;return h.createElement(m,{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 n=F(this.props);if(!i||!n.length)return;const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;"modern"===this.props.groupMode&&(n=this.base.getGroupedDataModernMode(n,i));let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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=F(this.props),n=this.getFocusedIndex(),a=!(-1===n)&&this.getCurrentValueDisabledStatus(s,i,n);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&a&&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:n,groupField:a}=this.props,o=F(this.props),l=this.value,r=Math.max(0,o.findIndex((e=>w(e,l,n)))),d=e.keyCode,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();if(p.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==a&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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(p,d,t)}else void 0===e&&o.findIndex((e=>e[s]===l[s]))===o.length-1&&this.onNavigate(p,d)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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(p,d,t)}else this.onNavigate(p,d)}this.applyState(p)}const c=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)},h=this.getFocusedIndex(),g=-1===h,m=!g&&this.getCurrentValueDisabledStatus(s,o,h);u?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[h][s]:void 0)?!t&&s&&m?this.clearValueOnEnterOrEsc(e):m||this.applyValueOnEnter(e.currentTarget.value,p):this.applyValueOnEnter(e.currentTarget.value,p)):d===i.Keys.esc&&(!t&&s&&m&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,p)):u||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,n=i.value;if(this.props.suggest){const e=i.selectionEnd===n.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;f(t)||(t=I(this.value,this.props.textField)||"");const s=t&&t===n,a=t&&t.length>n.length;s||a||!e?this._suggested="":this.suggestValue(n)}void 0===this.props.filter&&(t.data.text=n),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s||this.base.togglePopup(t),this.base.filterChanged(n,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(G)}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<=Y&&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=F(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:n,groupField:a="",textField:o}=this.props,l=F(this.props),r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,u=void 0!==e.opened?e.opened:t.opened;e.data!==l&&this.checkForDuplicatePlainTextRecords();const p=!u&&d,c=this.value;if(this._valueOnDidUpdate=c,this.base.didUpdate(),n&&n.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=void 0!==e.value?e.value:t.value;let h=this.hasDuplicates?this.navigationIndex||0:l.findIndex((e=>w(e,c,i)));"modern"===this.props.groupMode&&o&&c&&(h=null==(s=this.base.getGroupedDataModernMode(l,a))?void 0:s.map((e=>e[o])).indexOf(c[o]));const g=!w(r,c,i);p&&n?this.base.scrollToVirtualItem(n,h):p&&!n?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][a],this),this.base.scrollToItem(h)):(this.hasDuplicates||d&&u&&c&&g)&&this.base.scrollToItem(h)}p&&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,_[R]),s=r.provideLocalizationService(this).toLanguageString(O,_[O]),{dir:o,disabled:l,clearButton:u=e.defaultProps.clearButton,label:p,textField:c,className:g,style:m,loading:v,iconClassName:y,virtual:b,size:x,rounded:C,fillMode:k,opened:w=this.state.opened,placeholder:S,svgIcon:E,unstyled: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=f(K)?K:N,T=u&&(!!M||f(this.value)),P=this.base.vs,B=this.props.id||this._inputId,L=this.mobileMode,z=D&&D.uComboBox;P.enabled=void 0!==b,void 0!==b&&(P.skip=b.skip,P.total=b.total,P.pageSize=b.pageSize);const[H,V]=te(this.props.prefix||h.Fragment),[q,A]=te(this.props.suffix||h.Fragment),W=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:z,size:x,rounded:C,fillMode:k,disabled:l,invalid:!F,loading:v,required:this.required}),g),ref:this.componentRef,style:p?{...m,width:void 0}:m,dir:o},this.props.prefix&&h.createElement(H,{...V}),this.renderSearchBar(M||"",B,S),T&&!v&&h.createElement(ee,{onClick:this.clearButtonClick,key:"clearbutton"}),v&&h.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:z})),name:"loading",key:"loading"}),this.props.suffix&&h.createElement(q,{...A}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":w?s:t,icon:y?void 0:"caret-alt-down",svgIcon:E||a.caretAltDownIcon,iconClass:y,size:x,fillMode:k,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:z})),onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!L&&this.renderListContainer()),L&&this.renderAdaptiveListContainer());return p?h.createElement(n.FloatingLabel,{label:p,editorId:B,editorValue:M,editorValid:F,editorDisabled:l,style:{width:m?m.width:void 0},children:W,unstyled:D}):W}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,n=F(this.props),a=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const u=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(u),-1===l||f(d))if(""===a)this.handleItemSelect(0,e);else{const a=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:a,max:(r.enabled?r.total:n.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,n=F(this.props),a=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s)===e?this.index:C(n,e,s),l=-1!==o;let r;if(this._suggested="",l)r=n[o];else{if(!i)return this.selectFocusedItem(e,t);r=void 0!==s?{[s]:e}:e}this.triggerOnChange(r,t),a&&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,n=F(this.props),a=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s);if(this._suggested="",e===o||""===e&&!f(o))return this.closeOpenedApplyStateNonMobileMode(t,a),this.applyState(t);const l=C(n,e,s,!0);let r=null;-1!==l?r=n[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,a),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:n={skip:0},focusedItemIndex:a=x}=this.props,o=F(this.props),l=n.skip,r=""===e&&0===l?0:a(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:n,groupField:o,groupMode:l,list:r,virtual:p,adaptiveTitle:c,groupStickyHeaderItemRender:g,unstyled:m}=this.props,f=F(this.props),y=void 0!==this.props.opened?this.props.opened:this.state.opened,b=this.base.getAdaptiveAnimation(),x=m&&m.uComboBox,C=m&&m.uDropDownsActionSheet;let{group:k}=this.state;void 0===k&&void 0!==o&&(k=I(f[0],o));const w={navigatable:!1,navigatableElements:[],expand:y,animation:b,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:C,isFullScreen:e<=j}))};return h.createElement(u.ActionSheet,{...w},h.createElement(u.ActionSheetHeader,null,h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:C}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:C}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:C}))},c),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:C}))})),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:C}))},h.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:a.xIcon}))),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:C}))},this.renderMobileListFilter())),h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:x}))},h.createElement("div",{className:i.classNames(i.uComboBox.list({c:x,list:r,size:"large",tableSize:n,virtual:p}))},t&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:x}))},t),!r&&k&&0!==f.length&&h.createElement(v,{group:k,groupMode:l,render:g}),this.renderList(),s&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:x}),this.props.footerClassName)},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:n,groupField:a,groupMode:o,size:l,list:r,virtual:d,groupStickyHeaderItemRender:u,unstyled:p}=this.props,c=F(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=e.getPopupSettings(),y=void 0!==f.width?f.width:e.popupWidth,b=p&&p.uComboBox;let{group:x}=this.state;return void 0===x&&void 0!==a&&(x=I(c[0],a)),h.createElement(g,{width:y,popupSettings:{...f,anchor:f.anchor||this.element,show:m,popupClass:i.classNames(f.popupClass,i.uComboBox.listContainer({c:b,popup:!0}))},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[c.length]},h.createElement("div",{className:i.classNames(i.uComboBox.list({c:b,list:r,size:l,tableSize:l,virtual:d}))},s&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:b}))},s),!r&&x&&0!==c.length&&h.createElement(v,{group:x,groupMode:o,render:u}),this.renderList(),n&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:b}),this.props.footerClassName)},n)))}renderList(){const e=this.base,{textField:t,dataItemKey:s,listNoDataRender:n,itemRender:a,groupHeaderItemRender:o,virtual:l={skip:0,total:void 0},unstyled:r}=this.props,d=F(this.props),u=e.getPopupSettings(),p=e.vs,c=l.skip,g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=`translateY(${p.translate}px)`,v=g?this.getFocusedIndex(this.hasDuplicates):void 0,y=void 0!==this.props.filter?this.props.filter:this.state.text,b=I(this.value,t),x=f(y)&&y!==b?null:this.value,C=this.props.list||V,k=r&&r.uComboBox;return h.createElement(C,{id:e.listBoxId,virtual:!!l,show:g,data:d,focusedIndex:v,value:x,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>Y?{maxHeight:u.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:k,virtual:l})),listStyle:p.enabled?{transform:m}:void 0,key:"listkey",skip:c,onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:o,noDataRender:n,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:n,title:a,ariaLabelledBy:o,ariaDescribedBy:l,dataItemKey:r,virtual:d={skip:0},accessKey:u,unstyled:p}=this.props,c=F(this.props),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=this.value,v=Math.max(0,c.findIndex((e=>w(e,m,r))));this._suggested&&!w(this._valueOnDidUpdate,m,r)&&(this._suggested="");const f={accessKey:u};return h.createElement(Z,{id:t,readOnly:g&&this.mobileMode,placeholder:s,tabIndex:i,title:a,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:n,expanded:g,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${v+d.skip}`,role:"combobox",ariaLabelledBy:o,ariaLabel:this.props.ariaLabel,ariaDescribedBy:l,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,unstyled:p,...f})}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&&(!f(s)&&!f(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:n={skip:0},focusedItemIndex:a=x,skipDisabledItems:o}=this.props,l=F(this.props),r=this.props.filter?this.props.filter:this.state.text;return e&&void 0!==this.navigationIndex?this.navigationIndex:f(t)&&void 0===r?l.findIndex((e=>w(e,t,i))):r?a(l,r,s):o&&s&&!r&&0===n.skip?l.findIndex((e=>!e.disabled&&e[s])):0===n.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const n=t[x(t,e,s)];if(n){const t=I(n,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})}};se.displayName="ComboBox",se.propTypes={...$.propTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,groupMode:s.oneOf([void 0,"classic","modern"]),isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,clearButton:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},se.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ie=se;const ne=i.createPropsContext(),ae=i.withIdHOC(i.withPropsContext(ne,i.withUnstyledHOC(ie)));ae.displayName="KendoReactComboBox";const{sizeMap:oe,roundedMap:le}=i.kendoThemeMaps,re=class e extends h.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const s=F(this.props),i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=F(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=F(this.props);if(!s||!i.length)return;const n=this.itemHeight||(t?t.children[0].offsetHeight:0),a=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(n*e>a);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,n=s.selectionEnd===i.length;t.syntheticEvent=e;const a=this._suggested,o=this.value,l=o&&o.substring(0,o.length-a.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:u}=this.props,p=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==u&&!1!==u){r||d||!n?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);(!p&&i||p&&!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:n}=this.props,a=F(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=a[o],r=e.keyCode,d=e.altKey,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();p.syntheticEvent=e;const c=()=>{u&&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(u&&r===i.Keys.pageUp)c(),this.base.scrollPopupByPageSize(-1);else if(u&&r===i.Keys.pageDown)c(),this.base.scrollPopupByPageSize(1);else if(!u||r!==i.Keys.enter&&r!==i.Keys.esc)if(u||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==s&&n)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=a.slice(o+1).find((e=>!e.disabled&&e[n]));e=t&&a.findIndex((e=>e[n]===t[n]))}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=a,e=a.findIndex((e=>!e.disabled&&e[n]));else{t=a.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&a.findIndex((e=>e[n]===s[n]))}}if(void 0!==e){const t=e-o;this.onNavigate(p,r,t)}else void 0===e&&a.findIndex((e=>e[n]))===a.length-1&&this.onNavigate(p,r)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=a.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const t=a.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-o-1;this.onNavigate(p,r,t)}else this.onNavigate(p,r)}this.applyState(p),c()}}else{const e="";this._suggested="",this.triggerOnChange(e,p),void 0!==this.state.focusedItem&&(p.data.focusedItem=void 0),this.applyState(p)}else c(),!1===t&&l&&l.disabled?(u&&this.togglePopup(p),this.applyState(p)):this.applyInputValue(e.currentTarget.value,p,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(G)}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,n=F(this.props),{data:a=[]}=e,o=this.focusedIndex(),l=n[o],r=a!==n,d=void 0!==l&&t.focusedItem!==l,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,c=!p&&u;if(""===i)(u&&(d||r)||c)&&this.base.scrollToItem(o);else if(!this._isScrolling){const e=null==(s=this.base.getGroupedDataModernMode(n,i))?void 0:s.indexOf(l);c&&(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][i],this),this.base.scrollToItem(e)),u&&p&&d&&this.base.scrollToItem(e)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:e,disabled:t,label:s,className:a,style:o,loading:l,suggest:r,size:d,rounded:u,fillMode:p}=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,y=this.state.focused;"string"==typeof r&&(this._suggested=r);const[b,x]=te(this.props.prefix||h.Fragment),[C,I]=te(this.props.suffix||h.Fragment),k=h.createElement("span",{className:i.classNames("k-autocomplete k-input",a,{[`k-input-${oe[d]||d}`]:d,[`k-rounded-${le[u]||u}`]:u,[`k-input-${p}`]:p,"k-invalid":!c,"k-focus":y&&!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&&h.createElement(b,{...x}),this.renderSearchBar(m||"",f),l&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&h.createElement(ee,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&h.createElement(C,{...I}),this.renderListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:f,editorValue:m,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:k}):k}onNavigate(e,t,s){const i=this.value,{textField:n,focusedItemIndex:a}=this.props,o=F(this.props),l=void 0!==this.state.focusedItem?o.findIndex((e=>w(e,this.state.focusedItem,n))):a?a(o,i,n):o.indexOf(S(o,i,n)),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 n=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:a}=this.props,o=F(this.props),l=o[this.focusedIndex()];if(this._suggested="",n&&s===i.Keys.enter&&l&&!l.disabled){const s=I(o[this.focusedIndex(e)],a);this.triggerOnChange(s,t)}n&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:n,disabled:a,readonly:o}=this.props,{focused:l}=this.state,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(Z,{id:t,placeholder:i,tabIndex:n,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:a,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:n,size:a,groupField:o,list:l,groupStickyHeaderItemRender:r}=this.props,d=F(this.props),u=e.getPopupSettings(),p=void 0!==this.props.opened?this.props.opened:this.state.opened,c=void 0!==u.width?u.width:e.popupWidth;let{group:m}=this.state;return void 0===m&&void 0!==o&&(m=I(d[0],o)),h.createElement(g,{width:c,popupSettings:{...u,anchor:u.anchor||this.element,show:p,popupClass:i.classNames(u.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[d.length]},s&&h.createElement("div",{className:"k-list-header"},s),h.createElement("div",{className:i.classNames("k-list",{[`k-list-${oe[a]||a}`]:a})},!l&&m&&0!==d.length&&h.createElement(v,{group:m,groupMode:"modern",render:r}),this.renderList()),n&&h.createElement("div",{className:"k-list-footer"},n))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:n,groupHeaderItemRender:a}=this.props,o=F(this.props),l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(V,{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:n,groupHeaderItemRender:a,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=F(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,n=F(this.props),a=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return n.findIndex((e=>w(e,this.state.focusedItem,t)));if(s)return s(n,a,t);const o=n.indexOf(S(n,a,t));return i&&t&&-1===o?n.findIndex((e=>!e.disabled&&e[t])):Math.max(0,o)}};re.displayName="AutoComplete",re.propTypes={...$.basicPropTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),groupField:s.string,suggest:s.oneOfType([s.bool,s.string]),placeholder:s.string,value:s.string,defaultValue:s.string,validationMessage:s.string,required:s.bool,readonly:s.bool,clearButton:s.bool,valueRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,list:s.any,skipDisabledItems:s.bool},re.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let de=re;const ue=i.createPropsContext(),pe=i.withIdHOC(i.withPropsContext(ue,de));pe.displayName="KendoReactAutoComplete";const ce=e=>e.syntheticEvent.preventDefault(),he=e=>e.syntheticEvent.stopPropagation();class ge extends h.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:n,onTagDelete:a,size:o}=this.props;return h.createElement(h.Fragment,null,e.map(((l,r)=>{const u=n?h.createElement(n,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:a}):h.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=>a.call(void 0,l.data,e.syntheticEvent),onMouseDown:ce,onClick:he,className:l===s?"k-focus":void 0,size:o});return i?i(l,u):u})),this.props.children)}}var me=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(me||{});const ve=e=>{const{footer:t,children:s,windowWidth:n=0,navigatable:o,navigatableElements:l,expand:r,animation:p,onClose:c,adaptiveTitle:g,mobileFilter:m}=e,v={navigatable:o||!1,navigatableElements:l||[],expand:r,animation:!1!==p,onClose:c,animationStyles:n<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames("k-actionsheet","k-adaptive-actionsheet",n<=500?"k-actionsheet-fullscreen":"k-actionsheet-bottom")};return h.createElement(u.ActionSheet,{...v},h.createElement(u.ActionSheetHeader,{className:"k-text-center"},h.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},h.createElement("div",{className:"k-actionsheet-title"},h.createElement("div",{className:"k-text-center"},g),h.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),h.createElement("div",{className:"k-actionsheet-actions"},h.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:a.xIcon,onClick:c}))),m&&h.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),s,t&&h.createElement(u.ActionSheetFooter,{className:"k-actions k-actions-stretched"},h.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),h.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:fe,roundedMap:ye}=i.kendoThemeMaps,be=e=>e.preventDefault(),xe=e=>2===e,Ce=class e extends h.Component{constructor(e){super(e),this.state={activedescendant:me.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new $(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{dataItemKey:s,virtual:i}=this.props,n=F(this.props),a=n[e-(i?i.skip:0)],o=this.value.findIndex((e=>w(e,a,s)));this._lastSelectedOrDeslectedItemIndex=n.findIndex((e=>w(e,a,s)));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,a],(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(a,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;k(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{allowCustom:s,virtual:i}=this.props,n=F(this.props),a=i?i.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=s&&o,d=n[e-a];d&&l!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=me.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;f(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,n=F(this.props),a=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(),u=this.base.initState();if(u.syntheticEvent=e,!o&&this.value.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete||a===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,u);const p=()=>{e.preventDefault(),this.base.togglePopup(u),this.applyState(u)};if(this.opened)if(a===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(a===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)===n.length?[]:n;this.updateStateOnKeyboardNavigation(e,u)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=n.slice(this.getFocusedState().focusedIndex);this.itemFocus(n.length-1,u),this.updateStateOnKeyboardNavigation(e,u)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=n.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,u),this.updateStateOnKeyboardNavigation(e,u)}else if(e.shiftKey&&e.keyCode===i.Keys.up){let e;const t=this.getLastSelectedOrDeselectedIndex(1,d);null===t?e=0!==d?n.slice(d-1,d):[n[d]]:t===d?e=[n[t-1]]:d>=0&&(e=t>d?n.slice(d-1,t):n.slice(t-1,d)),e&&e.length>0&&(d>=1&&this.itemFocus(d-1,u),this.updateStateOnKeyboardNavigation(e,u))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const t=this.getLastSelectedOrDeselectedIndex(0,d);null===t?e=d!==n.length-1?n.slice(d,d+1):[n[d]]:t===d?e=n.slice(d,d+2):d>=0&&(e=t>d?n.slice(d+1,t+1):n.slice(t,d+2)),e&&e.length>=1&&(this.itemFocus(d+1,u),this.updateStateOnKeyboardNavigation(e,u))}else if(e.altKey&&a===i.Keys.up)p();else if(a===i.Keys.up||a===i.Keys.down){if(""!==s&&t)if(!this.props.skipDisabledItems&&l)this.onNavigate(u,a);else{let e=0;if(a===i.Keys.down||a===i.Keys.right){const s=n.slice(d+1).find((e=>!e.disabled&&e[t]));e=s&&n.findIndex((e=>e[t]===s[t]))}else if(a===i.Keys.up||a===i.Keys.left){let s;if(-1===d)s=n,e=n.findIndex((e=>!e.disabled&&e[t]));else{s=n.slice(0,d);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&n.findIndex((e=>e[t]===i[t]))}}if(e){const t=e-d;this.onNavigate(u,a,t)}else void 0!==e&&this.onNavigate(u,a)}else if(!this.props.skipDisabledItems&&l)this.onNavigate(u,a);else{let e=null;if(a===i.Keys.down||a===i.Keys.right)e=n.slice(d+1).find((e=>!e.disabled));else if(a===i.Keys.up||a===i.Keys.left){const t=n.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-d-1;this.onNavigate(u,a,t)}else this.onNavigate(u,a)}this.applyState(u),e.preventDefault()}else a===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&o&&null===r?this.customItemSelect(e):r&&r.disabled?p():this.selectFocusedItem(e)):a===i.Keys.esc&&p();else e.altKey&&a===i.Keys.down?p():a===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:n,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=F(this.props),u=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),c=s&&u&&h.createElement("div",{className:i.classNames("k-list",{[`k-list-${fe[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:be},h.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":xe(p)}),style:{fontStyle:"italic"}},u,h.createElement(i.IconWrap,{name:"plus",icon:a.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==l&&(g=I(d[0],l)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:"k-list-header"},e),c,h.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":fe[n]||n}`]:n,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&h.createElement(v,{group:g,groupMode:"modern",render:o}),this.renderList()),t&&h.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=F(this.props),n=this.base.getPopupSettings(),a=void 0!==n.width?n.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:a,popupSettings:{...n,popupClass:i.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),anchor:n.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return h.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,filterable:t,filter:s}=this.props,{windowWidth:i=0}=this.state,n=void 0!==s?s:this.state.text;this.localization=r.provideLocalizationService(this);const a=t?h.createElement(m,{value:n,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:a,footer:{cancelText:this.localization.toLanguageString(H,_[H]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(z,_[z]),onApply:this.closePopup}};return h.createElement(ve,{...o},h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.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;f(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;f(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:n,virtual:a={skip:0,total:void 0}}=this.props,o=F(this.props),l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),u=`translateY(${l.translate}px)`;return h.createElement(V,{id:this.base.listBoxId,show:this.opened,data:o.slice(),focusedIndex:r-a.skip,value:this.value,textField:e,valueField:n,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>{l.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:d.height},wrapperCssClass:"k-list-content",listStyle:l.enabled?{transform:u}:void 0,key:"listKey",skip:a.skip,onClick:this.handleItemClick,itemRender:s,groupHeaderItemRender:i,noDataRender:t,onMouseDown:be,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:a.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let n=F(this.props);if(i&&n.length&&i){const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=this.base.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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 n=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const a=[...this.value,n];this.triggerOnChange(a,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(G)}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<=Y&&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:n=""}=this.props,a=F(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,u=r&&!this.opened,p=this.base.getPopupSettings();if(this.base.didUpdate(),!p.animate&&u&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==n&&(t=null==(s=this.base.getGroupedDataModernMode(a,n))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][n],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:n}=this.props,a=F(this.props),o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=n&&o,u=xe(l),p=this.base,c=p.vs;if(this.opened&&t===i.Keys.up&&u)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=p.navigation.navigate({keyCode:t,current:r,max:(c.enabled?c.total:a.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:a,disabled:o,textField:l,dataItemKey:r,virtual:d,size:u,rounded:p,fillMode:c,loading:g,filter:m}=this.props,{text:v,focused:f,focusedTag:y,currentValue:b}=this.state,x=this.base.vs,C=this.props.id||this._inputId;x.enabled=void 0!==d,void 0!==d&&(x.skip=d.skip,x.total=d.total,x.pageSize=d.pageSize);const k=this.mobileMode&&this.opened?b:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const w=!this.validityStyles||this.validity.valid,S=!!(void 0!==m?m:v)||k&&k.length>0,[F,K]=te(this.props.prefix||h.Fragment),[N,M]=te(this.props.suffix||h.Fragment),T=h.createElement(h.Fragment,null,h.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${fe[u]||u}`]:u,[`k-rounded-${ye[p]||p}`]:p,[`k-input-${c}`]:c,"k-focus":f&&!o,"k-invalid":!w,"k-disabled":o,"k-loading":g,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:a,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:E},this.props.prefix&&h.createElement(F,{...K}),h.createElement("div",{className:i.classNames("k-input-values")},h.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${fe[u]||u}`]:u}),role:"listbox",id:"tagslist-"+this.base.guid},k&&k.length>0&&h.createElement(ge,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:k,guid:this.base.guid,focused:y?k.find((e=>D(e,y,r))):void 0,size:u})),this.renderSearchBar(C)),g&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&h.createElement(N,{...M}),S&&h.createElement(ee,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:C,editorValue:v||I(this.value[0],l),editorValid:w,editorDisabled:o,style:{width:e?e.width:void 0},children:T}):T}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:n,placeholder:a,ariaDescribedBy:o,ariaLabelledBy:l,ariaLabel:r}=this.props,d=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:u}=this.getFocusedState(),p=0!==this.value.length||d?void 0:a,c=i&&i.length>0?void 0:a,g=t===me.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${u}`,m={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return h.createElement(Z,{id:e,size:Math.max((p||"").length,d.length,1),placeholder:this.mobileMode&&this.opened?c:p,value:d,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,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:n}=this.state,a=this._tags,o=this.props.dataItemKey;let l,r=n?a.findIndex((e=>D(e,n,o))):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):a.length-1,l=a[r];else if(s===i.Keys.right)r===a.length-1?l=void 0:d&&(r=Math.min(a.length-1,r+1),l=a[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;k(e,a[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)k(e,a[r].data,o),this.triggerOnChange(e,t);else if(!d&&a.length){const s=a.pop();k(e,s.data,o),this.triggerOnChange(e,t)}}}else l=a[a.length-1];else l=a[0];l!==n&&(t.data.focusedTag=l,t.data.activedescendant=me.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=F(this.props),{focusedIndex:n}=t||this.getFocusedState();void 0!==i[n-(s?s.skip:0)]&&this.handleItemClick(n,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:n,textField:a,focusedItemIndex:o=x,skipDisabledItems:l}=this.props,r=F(this.props),d=n&&n.skip||0;let u;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const p=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return u=o(r,t,a),{focusedItem:r[u],focusedIndex:u+d,focusedType:1};if(p.length){const e=p[p.length-1];return u=r.findIndex((t=>w(t,e,i))),void 0!==r[u]?{focusedIndex:u+d,focusedItem:r[u],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&a&&!t&&0===d){const e=r.findIndex((e=>!e.disabled&&e[a]));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}};Ce.displayName="MultiSelect",Ce.propTypes={...$.propTypes,autoClose:s.bool,value:s.arrayOf(s.any),defaultValue:s.arrayOf(s.any),dataItemKey:s.string,placeholder:s.string,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),tagRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,groupField:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,onCancel:s.func,skipDisabledItems:s.bool},Ce.defaultProps={...$.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let Ie=Ce;const ke=i.createPropsContext(),we=i.withIdHOC(i.withPropsContext(ke,Ie));we.displayName="KendoReactMultiSelect";const Se=e=>h.createElement(V,{...e,wrapperCssClass:"k-table-body k-table-scroller",listClassName:i.classNames("k-table k-table-list",{"k-virtual-table":void 0!==e.virtual}),listStyle:{...e.listStyle}}),Ee=i.createPropsContext(),De=h.forwardRef(((e,t)=>{const s=i.usePropsContext(Ee,e),n=h.useRef(null),a=h.useRef(null),o=i.getScrollbarWidth(),{columns:l=Ke.columns,popupSettings:r=Ke.popupSettings,size:d=Ke.size,rounded:u=Ke.rounded,fillMode:p=Ke.fillMode,className:c,prefix:g,suffix:m,onOpen:v,onClose:f,onFocus:y,onBlur:b,onChange:x,onFilterChange:C,onPageChange:k,...w}=s;h.useImperativeHandle(n,(()=>({element:a.current&&a.current.element,focus(){a.current&&a.current.focus()},get value(){return a.current&&a.current.value},get name(){return a.current&&a.current.name},props:s}))),h.useImperativeHandle(t,(()=>n.current));const S=h.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,D]=h.useState(S),[F,K]=h.useState(!0),[N]=g?te(s.prefix||h.Fragment):[],[M]=m?te(s.suffix||h.Fragment):[],T=h.useMemo((()=>{const e=h.createElement("th",{className:"k-table-th",colSpan:l.length},E);return h.createElement(h.Fragment,null,s.header,h.createElement("div",{className:"k-table-header-wrap"},h.createElement("table",{className:"k-table",role:"presentation"},h.createElement("colgroup",null,l.map(((e,t)=>h.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Ke.width}})))),h.createElement("thead",{className:"k-table-thead"},h.createElement("tr",{className:"k-table-row"},l.map(((e,t)=>h.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" ")))),E&&F&&h.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))}),[s.header,l,E,F]),P=h.useMemo((()=>`calc(${l.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Ke.width))).filter(Boolean).join(" + ")} + ${o}px + 4px)`),[l,o]),B=s.virtual?s.virtual.skip:0,R=h.useCallback(((e,t)=>{const n=l.map(((e,n)=>h.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Ke.width},key:e.uniqueKey?e.uniqueKey:n},e.field?String(i.getter(e.field)(t.dataItem)):"")));let a,o,r,d,u=s.data||[];const p=t.index-B;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(u[p]),r=d(u[p-1]),o&&r&&o!==r&&(a=o)),a&&"classic"===s.groupMode&&n.push(h.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},h.createElement("span",null,a)));const c=h.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":!!a,"k-disabled":t.dataItem.disabled})},n);return s.itemRender?s.itemRender.call(void 0,c,t):c}),[l,s.groupField,s.itemRender,s.data,B]),O=h.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:n.current})}),[]),L=h.useCallback((e=>(s.virtual||D(S),O(v,e))),[O,v,s.virtual,S]),z=h.useCallback((e=>O(f,e)),[f]),H=h.useCallback((e=>O(y,e)),[y]),_=h.useCallback((e=>O(b,e)),[b]),V=h.useCallback((e=>O(x,e)),[x]),q=h.useCallback((e=>O(k,e)),[k]),A=h.useCallback((e=>(D(S),O(C,{...e,mobileMode:e.target.mobileMode}))),[C]),W=h.useCallback((e=>{D(e.group)}),[]);h.useEffect((()=>{i.setScrollbarWidth()})),h.useEffect((()=>{const e=s.data;D(S),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const U=h.useCallback((e=>h.createElement(Se,{...e})),[]);return h.createElement(ae,{...w,list:U,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||P,className:r.className},ref:a,header:T,itemRender:R,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:u,fillMode:p,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:L,onClose:z,onFocus:H,onBlur:_,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})})),Fe={...ie.propTypes,columns:s.any.isRequired},Ke={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Ne(e){return"string"==typeof e?Number(e.replace("px","")):e||void 0}function Me(e,t,s,i){const n=Ne(t.popupSettings.width),a=(void 0!==s.width&&Ne(s.width))!==n,o=void 0!==i.width,l=a?s.width:o?i.width:n,r=Ne(function(e,t,s){const[i,n]=h.useState(t);return h.useEffect((()=>{void 0!==i&&e.current&&n(e.current.offsetWidth)}),s),i}(e,l));return a||o?l:r&&n&&r>n?r:n}De.displayName="KendoMultiColumnComboBox",De.propTypes=Fe;const Te=e=>h.createElement("div",{className:"k-nodata"},h.createElement("div",null,e.children)),{sizeMap:Pe,roundedMap:Be}=i.kendoThemeMaps,Re=e=>h.createElement("span",{className:"k-input-value-text"},e.children),Oe=e=>e.split("_").map((e=>parseInt(e,10))),Le={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},ze=i.createPropsContext(),He=h.forwardRef(((e,t)=>{i.validatePackage(G);const s=i.usePropsContext(ze,e),l={...Le,...s},c=i.useId(),g=l.id||c,{data:v,dataItemKey:y,popupSettings:b={},style:x,opened:C,disabled:k,onOpen:S=i.noop,onClose:E=i.noop,placeholder:D,label:F,name:K,selectField:N,subItemsField:M,validationMessage:T,valid:R,required:O,validityStyles:L}=l,z=i.getTabIndex(l.tabIndex,k),H=h.useRef(null),V=h.useRef(null),q=h.useRef(null),A=h.useRef(null),W=h.useRef(null),U=h.useRef(null),$=h.useRef(!1),[j,J]=h.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==j?j:l.defaultValue,Z=f(X),ee=Z?I(X,l.textField):"",te=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:T,valid:R,required:O},Z),se=h.useCallback((()=>V.current&&V.current.focus()),[]);h.useImperativeHandle(H,(()=>({props:l,element:V.current,focus:se}))),h.useImperativeHandle(t,(()=>H.current));const ie=i.useRtl(V,l.dir),ne={width:Me(V,Le,{...Le.popupSettings,...b},x),...void 0!==ie?{direction:ie}:{}},[ae,oe]=h.useState(!1),le=void 0!==C?C:ae,[re,de]=h.useState(!1),[ue,pe]=h.useState(),ce=!!(ue&&ue<=Y&&l.adaptive),[he,ge]=h.useState(""),me=h.useCallback((()=>{W.current&&W.current.setCustomValidity&&W.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);h.useEffect(me),h.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const fe=h.useCallback((e=>{if(!le){if(S){const t={...e};S.call(void 0,t)}void 0===C&&oe(!0)}}),[le,C,S]),ye=h.useCallback((e=>{if(le){if(E){const t={...e};E.call(void 0,t)}void 0===C&&(oe(!1),ce&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300))}}),[le,C,E,ce]),be=h.useCallback((e=>{if(!e.isDefaultPrevented()&&H.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};(le?ye:fe)(t)}}),[le,C,S,E]),xe=h.useCallback((e=>{$.current=!0,e(),window.setTimeout((()=>$.current=!1),0)}),[]),Ce=h.useCallback((e=>{var t,s;const{keyCode:n,altKey:a}=e,o=U.current&&U.current.element;if(!H.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};if(le)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),ye(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===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 xe((()=>{var e;ke(null==(e=q.current)?void 0:e.element)}))}xe(i.noop)}else n===i.Keys.down&&xe((()=>{var e;ke((null==(e=q.current)?void 0:e.element)||o)}));else a&&n===i.Keys.down?(e.preventDefault(),fe(l)):le||n===i.Keys.esc&&He(e)}),[le,C,S,E]),Ie=h.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),xe(t===i.Keys.up?()=>{ke(V.current)}:()=>{ke(U.current&&U.current.element)}))}),[]),ke=h.useCallback((e=>{e&&xe((()=>e.focus()))}),[]),we=h.useCallback((()=>{var e;re||!le||C?s.filterable?ke(null==(e=q.current)?void 0:e.element):ke(U.current&&U.current.element):ye({target:H.current})}),[E,s.filterable,re,C,le]),Se=h.useCallback((()=>{re&&ke(V.current)}),[re]),Ee=h.useCallback((e=>{if(!re&&!$.current&&(de(!0),s.onFocus&&H.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),De=h.useCallback((e=>{if(re&&!$.current&&H.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ce||ye(t)}}),[re,s.onBlur,le,C,E]),Fe=h.useCallback((()=>{re&&xe(i.noop),ce&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300)}),[re,ce]),Ke=h.useCallback(((e,t,i)=>{if(s.onChange){const n={value:t,level:i?Oe(i):[],...e};s.onChange.call(void 0,n)}Q||J(t)}),[s.onChange,Q]),Ne=h.useCallback((e=>{if(w(e.item,X,y)||!H.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,a={syntheticEvent:n,nativeEvent:i,target:H.current};Ke(a,t,s),ye(a)}),[Q,X,s.onChange,y,le,C,E]),He=h.useCallback((e=>{if(!H.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};Ke(t,null),ye(t),e.preventDefault()}),[Q,s.onChange,le,C,E]),_e=h.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&H.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:n,syntheticEvent:a}=e,o={level:Oe(i),item:t,nativeEvent:n,syntheticEvent:a,target:H.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Ve=h.useCallback((e=>{if(s.onFilterChange&&H.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:H.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),qe=h.useCallback((e=>{for(const t of e)pe(t.target.clientWidth)}),[]),Ae=h.useMemo((()=>Q||!Z?v:i.mapTree(v,M,(e=>i.extendDataItem(e,M,{[N]:w(e,X,y)})))),[v,X,Q,Z,N,M]),We=l.listNoData||Te,Ue=l.valueHolder||Re,$e=r.useLocalization(),Ge=!L||te.valid,{size:je,rounded:Ye,fillMode:Je}=l,Qe=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-dropdowntree k-picker",l.className,{[`k-picker-${Pe[je]||je}`]:je,[`k-rounded-${Be[Ye]||Ye}`]:Ye,[`k-picker-${Je}`]:Je,"k-focus":re,"k-invalid":!Ge,"k-loading":l.loading,"k-required":O,"k-disabled":l.disabled}),tabIndex:z,accessKey:l.accessKey,id:g,style:F?{...x,width:void 0}:x,dir:ie,ref:V,onKeyDown:k?void 0:Ce,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":O},h.createElement("span",{className:"k-input-inner"},(ee||D)&&h.createElement(Ue,{item:X},ee||D)),l.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!k&&h.createElement("span",{onClick:He,className:"k-clear-value",title:$e.toLanguageString(B,_[B]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon})),h.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:a.caretAltDownIcon}),h.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%"}},h.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,X):X})),!ce&&h.createElement(o.Popup,{...b,className:i.classNames(b.className,{"k-rtl":"rtl"===ie}),popupClass:i.classNames(b.popupClass,"k-dropdowntree-popup k-list-container"),style:ne,anchor:b.anchor||V.current,show:le,onOpen:we,onClose:Se},l.filterable&&h.createElement(m,{value:void 0===l.filter?he:l.filter,ref:q,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),v.length>0?h.createElement(p.TreeView,{style:{height:b.height},ref:U,tabIndex:z,data:Ae,focusIdField:y,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:_e,size:je,item:l.item,dir:ie,animate:b.animate}):h.createElement(We,null,$e.toLanguageString(P,_[P])))),ce&&(()=>{const e=l.filterable?h.createElement(m,{value:void 0===l.filter?he:l.filter,ref:A,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>ye(e),windowWidth:ue,mobileFilter:e};return h.createElement(ve,{...t},h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.createElement("div",{className:"k-list-container"},h.createElement("div",{className:"k-list k-list-lg"},v.length>0?h.createElement(p.TreeView,{ref:U,tabIndex:z,data:Ae,focusIdField:y,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:_e,size:je,item:l.item,dir:ie,animate:b.animate}):h.createElement(We,null,$e.toLanguageString(P,_[P]))))))})());return F?h.createElement(n.FloatingLabel,{label:F,editorValue:ee,editorPlaceholder:D,editorValid:Ge,editorDisabled:k,editorId:g,style:{width:x?x.width:void 0},children:Qe,dir:ie}):Qe})),_e={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};He.displayName="KendoReactDropDownTree",He.propTypes=_e;const{sizeMap:Ve,roundedMap:qe}=i.kendoThemeMaps,Ae=e=>e.split("_").map((e=>parseInt(e,10))),We={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Ue=i.createPropsContext(),$e=h.forwardRef(((e,t)=>{const s=i.usePropsContext(Ue,e);i.validatePackage(G);const a=i.useId(),l=s.id||a,{data:d=[],dataItemKey:c,style:g={},placeholder:v,label:f,name:y,validationMessage:b,valid:x,tags:C,value:k,opened:S,disabled:E,popupSettings:F=We.popupSettings,checkField:K=We.checkField,checkIndeterminateField:N=We.checkIndeterminateField,subItemsField:M=We.subItemsField,size:T=We.size,rounded:B=We.rounded,fillMode:R=We.fillMode,required:O=We.required,validityStyles:L=We.validityStyles,onOpen:V=i.noop,onClose:q=i.noop}=s,A=i.getTabIndex(s.tabIndex,E),W=h.useRef(null),U=h.useRef(null),$=h.useRef(null),j=h.useRef(null),J=h.useRef(null),Q=h.useRef(null),X=h.useRef(!1),Z=h.useRef([]),te=h.useRef(null),[se,ie]=h.useState(),[ne,ae]=h.useState(!1),[oe,le]=h.useState(!1),[re,de]=h.useState(),[ue,pe]=h.useState([]),[ce,he]=h.useState(""),me=!!(re&&re<=Y&&s.adaptive),fe=void 0!==S?S:ne,ye=!(!Array.isArray(k)||!k.length),be=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:b,valid:x,required:O},ye),xe=i.useRtl(U,s.dir),Ce={width:Me(U,We,F,g),...void 0!==xe?{direction:xe}:{}},Ie=h.useCallback((()=>U.current&&U.current.focus()),[]);Z.current=void 0===C?(k||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...C],h.useImperativeHandle(W,(()=>({props:s,element:U.current,focus:Ie}))),h.useImperativeHandle(t,(()=>W.current));const ke=h.useCallback((()=>{J.current&&J.current.setCustomValidity&&J.current.setCustomValidity(be.valid?"":void 0===b?"Please select a value from the list!":b)}),[b,be]);h.useEffect(ke),h.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()}}),[]),h.useEffect((()=>{te.current&&fe&&te.current.setPosition(te.current.element)}),[k,fe]);const we=h.useCallback(((e,t,i)=>{if(s.onChange){const n={items:t,operation:i,...e};s.onChange.call(void 0,n)}}),[s.onChange]),Se=h.useCallback((e=>{if(w(e.item,k,c)||!W.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,n={syntheticEvent:i,nativeEvent:s,target:W.current};we(n,[t],"toggle")}),[k,c,we]),Ee=h.useCallback((e=>{if(!fe){if(V){const t={...e};V.call(void 0,t)}void 0===S&&(ae(!0),pe(k||[]),me&&setTimeout((()=>{var e;Ke(null==(e=j.current)?void 0:e.element)}),300))}}),[fe,S,V,me,j]),De=h.useCallback((e=>{if(fe){if(q){const t={...e};q.call(void 0,t)}void 0===S&&ae(!1)}}),[fe,S,q]),Fe=h.useCallback((e=>{X.current=!0,e(),window.setTimeout((()=>X.current=!1),0)}),[]),Ke=h.useCallback((e=>{e&&Fe((()=>e.focus()))}),[Fe]),Ne=h.useCallback((()=>{var e;!oe&&fe?De({target:W.current}):s.filterable?Ke(null==(e=$.current)?void 0:e.element):Ke(Q.current&&Q.current.element)}),[oe,fe,Ke,De,s.filterable]),Pe=h.useCallback((()=>{oe&&Ke(U.current)}),[oe,Ke]),Be=h.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]),Re=h.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)}me||De(t)}}),[oe,s.onBlur,fe,S,q]),Oe=h.useCallback((()=>{oe&&Fe(i.noop)}),[oe,Fe]),Le=h.useCallback((e=>{if(!e.isDefaultPrevented()&&W.current){le(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};fe||Ee(t)}}),[fe,Ee]),ze=h.useCallback((e=>{var t,s;const{keyCode:n,altKey:a}=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&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete)){const e=Z.current;let t,s=se?e.findIndex((e=>D(e,se,c))):-1;const a=-1!==s;n===i.Keys.left?(s=a?Math.max(0,s-1):e.length-1,t=e[s]):n===i.Keys.right?s===e.length-1?t=void 0:a&&(s=Math.min(e.length-1,s+1),t=e[s]):n===i.Keys.home?t=e[0]:n===i.Keys.end?t=e[e.length-1]:n===i.Keys.delete&&a&&we(l,e[s].data,"delete"),t!==se&&ie(t)}if(fe)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),De(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===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 n===i.Keys.down&&Fe((()=>{var e;Ke((null==(e=$.current)?void 0:e.element)||o)}));else a&&n===i.Keys.down&&(e.preventDefault(),Ee(l))}),[fe,De,Ke,Fe,Ee,se,c,k,we]),He=h.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]),_e=h.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};we(t,[],"clear"),De(t),e.preventDefault()}),[we,De]),$e=h.useCallback(((e,t)=>{var s;De({target:W.current}),oe||Ke(null==(s=$.current)?void 0:s.element),we({syntheticEvent:t,nativeEvent:t.nativeEvent,target:W.current},e,"delete")}),[we,De,Ke,oe]),Ge=h.useCallback((e=>{if(s.onExpandChange&&W.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:n,syntheticEvent:a}=e,o={level:Ae(i),item:t,nativeEvent:n,syntheticEvent:a,target:W.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),je=h.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&&he(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Ye=h.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=h.useCallback((e=>{for(const t of e)de(t.target.clientWidth)}),[]),Qe=s.listNoData||Te,Xe=r.useLocalization(),Ze=!L||be.valid,et=me&&fe?ue:Z.current,tt=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${Ve[T]||T}`]:T,[`k-rounded-${qe[B]||B}`]:B,[`k-input-${R}`]:R,"k-focus":oe&&!E,"k-invalid":!Ze,"k-disabled":E,"k-loading":s.loading,"k-required":O}),tabIndex:A,accessKey:s.accessKey,id:l,style:f?{...g,width:void 0}:g,dir:xe,ref:U,onKeyDown:E?void 0:ze,onMouseDown:Oe,onFocus:Be,onBlur:Re,role:"combobox","aria-haspopup":"tree","aria-expanded":fe,"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:Le},h.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ve[T]||T}`]:T})},et.length>0&&h.createElement(ge,{tag:s.tag,onTagDelete:$e,data:et,guid:l,focused:se?Z.current.find((e=>D(e,se,c))):void 0,size:T})),h.createElement("span",{className:"k-input-inner"},0===et.length&&h.createElement("span",{className:"k-input-value-text"},v)),s.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ye&&!E&&et.length>0&&h.createElement(ee,{onClick:_e}),h.createElement("select",{name:y,ref:J,tabIndex:-1,"aria-hidden":!0,title:f,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,k):k})),!me&&h.createElement(o.Popup,{...F,popupClass:i.classNames(F.popupClass,"k-multiselecttree-popup"),className:i.classNames(F.className,{"k-rtl":"rtl"===xe}),style:Ce,anchor:F.anchor||U.current,show:fe,onOpen:Ne,onClose:Pe,ref:te},s.filterable&&h.createElement(m,{value:void 0===s.filter?ce:s.filter,ref:$,onChange:je,onKeyDown:He,tabIndex:A,size:T,rounded:B,fillMode:R,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),d.length>0?h.createElement(p.TreeView,{style:{height:F.height},ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:Se,onCheckChange:Se,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:xe}):h.createElement(Qe,null,Xe.toLanguageString(P,_[P])))),me&&(()=>{const e=s.filterable?h.createElement(m,{value:void 0===s.filter?ce:s.filter,ref:j,onChange:je,onKeyDown:He,size:T,rounded:B,fillMode:R}):null,t={adaptiveTitle:s.adaptiveTitle,expand:fe,onClose:e=>s.onCancel?Ye(e):_e(e),windowWidth:re,mobileFilter:e,footer:{cancelText:Xe.toLanguageString(H,_[H]),onCancel:e=>s.onCancel?Ye(e):_e(e),applyText:Xe.toLanguageString(z,_[z]),onApply:e=>De(e)}};return h.createElement(ve,{...t},h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.createElement("div",{className:"k-list-container"},h.createElement("div",{className:"k-list k-list-lg"},d.length>0?h.createElement(p.TreeView,{ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:Se,onCheckChange:Se,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:xe}):h.createElement(Qe,null,Xe.toLanguageString(P,_[P]))))))})());return f?h.createElement(n.FloatingLabel,{label:f,editorValue:ye,editorPlaceholder:v,editorValid:Ze,editorDisabled:E,editorId:l,style:{width:g?g.width:void 0},children:tt,dir:xe}):tt})),Ge={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};$e.displayName="KendoReactMultiSelectTree",$e.propTypes=Ge;const je=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=pe,e.AutoCompletePropsContext=ue,e.AutoCompleteWithoutContext=de,e.ComboBox=ae,e.ComboBoxPropsContext=ne,e.ComboBoxWithoutContext=ie,e.DropDownList=J,e.DropDownListPropsContext=X,e.DropDownTree=He,e.DropDownTreePropsContext=ze,e.List=V,e.ListContainer=g,e.ListFilter=m,e.ListItem=M,e.MultiColumnComboBox=De,e.MultiColumnComboBoxPropsContext=Ee,e.MultiSelect=we,e.MultiSelectPropsContext=ke,e.MultiSelectTree=$e,e.MultiSelectTreePropsContext=Ue,e.MultiSelectWithoutContext=Ie,e.SearchBar=Z,e.TagList=ge,e.dropDownListDefaultProps=Q,e.dropdownsMessages=_,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:n,value:a,subItemsField:o="items",operation:l}=t,r=i.getter(n),d=je(a,r);if("clear"===l)return[];if("delete"===l){const e=je(s,r);return a.filter((t=>!e[r(t)]))}const u=s[0],p=r(u),c=i.getter(o),h=[...e],g=[];let m,v=[];for(;h.length;){const e=h.pop();if(p===r(e)){v=g.map((e=>e.item)),m=e;break}{g&&g.length&&g[g.length-1].parentPosition===h.length&&g.pop();const t=c(e);t&&t.length&&(g.push({item:e,parentPosition:h.length}),h.push(...t))}}const f=[...c(m)||[]],y=[];for(;f.length;){const e=f.pop();y.push(e);const t=c(e);t&&t.length&&f.push(...t)}const b=[];if(!d[p]){b.push(...a),b.push(m),b.push(...y.filter((e=>!d[r(e)])));const e=v.filter((e=>!d[r(e)])),t=je(b,r);for(let s=e.length-1;s>-1;s--){const i=e[s],n=c(i);if(n.filter((e=>t[r(e)])).length<n.length)break;b.push(i),t[r(i)]=!0}}else{const e=r(m),t=je(y,r),s=je(v,r);b.push(...a.filter((i=>{const n=r(i);return!t[n]&&e!==n&&!s[n]})))}return b},e.getValueMap=je,e.nodata=P,e.scrollToItem=b}));
|
|
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,n,a,o,l,r,d,u,p){"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 h=c(t);const g=e=>{const{children:t,width:s,dir:i,itemsCount:n,popupSettings:a}=e;return h.createElement(o.Popup,{style:{width:s,direction:i},contentKey:n&&n.join(),...a},t)},m=h.forwardRef(((e,t)=>{const s=h.useRef(null),{renderListFilterWrapper:n=!1,renderPrefixSeparator:o=!1,...r}=e,d=i.useUnstyled(),u=d&&d.uDropDownsBase;h.useImperativeHandle(t,(()=>s.current));const p=h.createElement(l.TextBox,{...r,ref:s,className:i.classNames(i.uDropDownsBase.searchbox({c:u})),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:()=>h.createElement(h.Fragment,null,h.createElement(l.InputPrefix,null,h.createElement(i.IconWrap,{name:"search",icon:a.searchIcon,className:i.classNames(i.uDropDownsBase.inputIcon({c:u}))})),o&&h.createElement(l.InputSeparator,null))});return n?h.createElement("div",{className:i.classNames(i.uDropDownsBase.listFilter({c:u}))}," ",p," "):p}));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=e=>{const{group:t,groupMode:s,render:n}=e,a=i.useUnstyled(),o=a&&a.uDropDownsBase,l=h.createElement("div",{className:i.classNames(i.uDropDownsBase.groupStickyHeader({c:o}))},"classic"===s?t:h.createElement("div",{className:i.classNames(i.uDropDownsBase.listHeaderText({c:o}))},t));return void 0!==n?n.call(void 0,l,e):l},f=e=>null!=e,y=(e,t,s)=>{if(!f(e))return!1;let i=String(e);return s&&(i=i.toLowerCase()),0===i.indexOf(t)},b=(e,t,s,i,n)=>{const a=e.offsetHeight,o=t.children.item(s),l=o.offsetTop+(n?i-e.scrollTop:0),r=o.offsetHeight;if(n){let t=0;l+r>a?t=l+r-a:l<0&&(t=l),0!==t?e.scrollTop+=t:0===e.scrollTop&&0!==i&&(e.scrollTop=i)}else l+r>a+e.scrollTop?e.scrollTop=l+r-a:l<e.scrollTop&&(e.scrollTop-=e.scrollTop-l)},x=(e,t,s)=>{let i=-1;if(t){t=t.toLowerCase();for(let n=0;n<e.length;n++){const a=(I(e[n],s)||"")+"";if(a&&a.toLowerCase().startsWith(t)){i=n;break}}}return i},C=(e,t,s,i=!1)=>{const n=e=>i?e:e.toLowerCase();return e.findIndex((e=>s?n(I(e,s))===n(t):n(t)===n(e.toString())))},I=(e,t)=>{if(t&&f(e)){const s=t.split(".");let i=e;return s.forEach((e=>{i=i?i[e]:void 0})),i}return e},k=(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||f(e)===f(t)&&I(e,s)===I(t,s),S=(e,t,s)=>{if(t){const i=C(e,t,s,!0);return-1!==i?e[i]:e[x(e,t,s)]}return e[0]},E=e=>{"INPUT"!==e.target.nodeName&&e.preventDefault()},D=(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)),F=e=>{const{data:t=[],groupField:s}=e;return s?t.filter((e=>s&&void 0!==e[s])):t},K=e=>e.preventDefault(),N=e=>{const{selected:t,defaultItem:s,textField:n}=e,a=i.useUnstyled(),o=a&&a.uDropDownsBase;return h.createElement("div",{onClick:e.onClick,onMouseDown:K,style:{position:"unset"},className:i.classNames(i.uDropDownsBase.optionLabel({c:o,selected:t}))},I(s,n)||"")},M=e=>{const{selected:t,group:s,dataItem:n,virtual:a,groupMode:o,disabled:l,id:r,focused:d,render:u}=e,p=i.useUnstyled(),c=p&&p.uDropDownsBase,g=h.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:a?"relative":"unset"}},h.createElement("span",{className:i.classNames(i.uDropDownsBase.itemText({c:c}))},I(n,e.textField).toString()),void 0!==s&&"classic"===o?h.createElement("div",{className:i.classNames(i.uDropDownsBase.itemGroupLabel({c:c}))},s):null);return void 0!==u?u.call(void 0,g,e):g},T=e=>{const{group:t,virtual:s,render:n,isMultiColumn:a=!1,id:o}=e,l=i.useUnstyled(),r=l&&l.uDropDownsBase,d=h.createElement("li",{id:o,role:"group",className:i.classNames(i.uDropDownsBase.groupLi({c:r,isMultiColumn:a})),style:a?{boxSizing:"inherit",position:s?"relative":"unset"}:{position:s?"relative":"unset"}},h.createElement("span",{className:n?void 0:i.classNames(i.uDropDownsBase.groupItemText({c:r,isMultiColumn:a}))},t));return void 0!==n?n.call(void 0,d,e):d},P="dropdowns.nodata",B="dropdowns.clear",R="dropdowns.comboArrowBtnAriaLabelExpand",O="dropdowns.comboArrowBtnAriaLabelCollapse",L="dropdowns.dropDownListArrowBtnAriaLabel",z="dropdowns.apply",H="dropdowns.cancel",_={[B]:"clear",[P]:"NO DATA FOUND.",[R]:"expand combobox",[O]:"collapse combobox",[L]:"select",[z]:"Apply",[H]:"Cancel"},V=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,{id:a,show:o,wrapperCssClass:l,wrapperStyle:d,listStyle:u,listRef:p,wrapperRef:c,listClassName:g,ariaSetSize:m}=e,v=(()=>{const{textField:t,valueField:s,groupField:i,groupMode:n,isMultiColumn:a,optionsGuid:o,skip:l=0,virtual:r,focusedIndex:d,hasDuplicates:u,highlightSelected:p=!0,value:c,data:g,itemRender:m,groupHeaderItemRender:v}=e,f=Array.isArray(c);let y=0;return g.map(((b,x)=>{const C=l+x,k=l+x+y,S=u?!!c&&d===x:!b.disabled&&(p&&(!f&&w(b,c,s)||f&&-1!==c.findIndex((e=>w(e,b,s)))));let E,D,F;x>0&&void 0!==i&&(D=I(b,i),F=I(g[x-1],i),D&&F&&D!==F&&(E=D));const K=void 0!==E&&"modern"===n;return K?y+=1:y=0,[K&&h.createElement(T,{id:`option-${o}-${k}`,virtual:r,key:C+"-group-item",group:E,isMultiColumn:a,render:v}),h.createElement(M,{id:`option-${o}-${K?k+1:k}`,virtual:r,dataItem:b,groupMode:n,selected:S,focused:d===x,index:C,key:C,onClick:e.onClick,textField:t,group:E,render:m,disabled:b.disabled})]}))})();return v.length?h.createElement("div",{className:l,style:d,ref:c,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},h.createElement("ul",{id:a,role:"listbox","aria-hidden":!o||void 0,"aria-setsize":m,className:g||i.classNames(i.uDropDownsBase.ul({c:n})),ref:p,style:u},v),e.scroller&&h.createElement("div",{className:i.classNames(i.uDropDownsBase.heightContainer({c:n}))},e.scroller)):(()=>{const s=e.noDataRender,a=h.createElement("div",{className:i.classNames(i.uDropDownsBase.noData({c:n}))},h.createElement("div",null,t.toLanguageString(P,_[P])));return s?s.call(void 0,a):a})()},q="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);let A=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(h.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=q?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&&(q||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,n=Math.abs(t-this.lastScrollTop);this.lastScrollTop=t;let a=this.rowHeightService.index(t),o=this.rowHeightService.offset(a);const{offsetHeight:l}=this.container,r=this.rowHeightService.index(t+l);if(i&&r>=this.lastLoaded&&this.lastLoaded<this.total){const t=a+this.pageSize-this.total;t>0&&(a-=t,o=this.rowHeightService.offset(a)),this.firstLoaded=a,this.translateTo(o);const s=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(s,this.total),this.changePage(this.firstLoaded,e)}else if(s&&a-1<=this.firstLoaded){const t=n===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(a-t,0),this.translateTo(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,e)}}}},W=class{navigate(e){const t=e.keyCode;return t===i.Keys.up||t===i.Keys.left?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:-1}):t===i.Keys.down||t===i.Keys.right?this.next({current:e.current,min:e.min,max:e.max,step:e.skipItems?e.skipItems:1}):t===i.Keys.home?0:t===i.Keys.end?e.max:void 0}next(e){return f(e.current)?Math.min(e.max,Math.max(e.current+e.step,e.min)):e.min}};const U=class e{constructor(e){this.wrapper=null,this.list=null,this.vs=new A,this.navigation=new W,this.handleItemClick=(e,t)=>{const s=this.initState();s.syntheticEvent=t,t.stopPropagation(),this.component.handleItemSelect(e,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=e=>{if(!this.component.state.focused){const t=this.initState();t.data.focused=!0,t.events.push({type:"onFocus"}),t.syntheticEvent=e,this.applyState(t)}},this.filterChanged=(e,t)=>{const{textField:s,filterable:i}=this.component.props;i&&t.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:e}})},this.togglePopup=e=>{const t=this.component.props,s=void 0!==t.opened?t.opened:this.component.state.opened;void 0===t.opened&&(e.data.opened=!s),s?e.events.push({type:"onClose"}):(e.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(e,t)=>{const s=this.initState();s.syntheticEvent=t,this.triggerOnPageChange(s,e.skip,e.take),this.applyState(s)},this.scrollToVirtualItem=(e,t)=>{const s=this.vs;if(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,n,a,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,u=null==(n=null==(i=this.list)?void 0:i.parentElement)?void 0:n.offsetHeight;void 0!==r&&void 0!==u&&(null==(o=null==(a=this.list)?void 0:a.parentElement)||o.scroll({top:r+e*Math.floor(u/d)*d}))},this.renderScrollElement=()=>{const e=this.vs;return e.enabled&&h.createElement("div",{ref:t=>e.scrollElement=t,key:"scrollElementKey"})},this.resetGroupStickyHeader=(e,t)=>{e!==t.state.group&&t.setState({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 n=!0===e.opened;void 0===i&&this.calculatePopupWidth(),void 0===e.dir&&void 0===s.direction&&(this.calculateDir(),n=!0),n&&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,n=s.container||i.parentNode,a=void 0!==t?t:s.enabled;b(n,i,e,s.translate,a)}}updateComponentArgs(e){for(let t in e)Object.hasOwnProperty.call(e,t)&&(this.component[t]=e[t])}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 n=Math.min(Math.max(0,t),Math.max(0,i.total-s));n!==i.skip&&e.events.push({type:"onPageChange",page:{skip:n,take:s}})}}triggerPageChangeCornerItems(e,t){const s=this.component.props,{data:i=[],dataItemKey:n,virtual:a}=s,o=void 0!==s.opened?s.opened:this.component.state.opened;e&&a&&this.vs.enabled&&(a.skip>0&&w(e,i[0],n)?this.triggerOnPageChange(t,a.skip-1,a.pageSize):!o&&a.skip+a.pageSize<a.total&&w(e,i[i.length-1],n)&&this.triggerOnPageChange(t,a.skip+1,a.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,n)=>{e[n-1]&&i[t]!==e[n-1][t]&&s.push({[t]:i[t]}),s.push(e[n])})),s}};U.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},U.propTypes={...U.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},U.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};let $=U;const G={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"},j=500,Y=768,J=h.forwardRef(((e,t)=>{i.validatePackage(G);const s=i.useUnstyled(),o=i.useId(e.id),l=i.usePropsContext(X,e),{delay:p=Q.delay,tabIndex:c=Q.tabIndex,ignoreCase:b=Q.ignoreCase,size:C=Q.size,rounded:k=Q.rounded,fillMode:S=Q.fillMode,groupMode:E=Q.groupMode}=l,D=()=>{if(i.canUseDOM)return he.current&&he.current.ownerDocument||window.document},K=()=>{var e,t;null!=(e=null==we?void 0:we.current)&&e.wrapper&&(null==(t=null==we?void 0:we.current)||t.wrapper.focus({preventScroll:!0}))},M=()=>{let e;return void 0!==be.current&&null!==be.current?e=be.current:void 0!==l.value?e=l.value:void 0!==De.value&&null!==De.value?e=De.value:void 0!==l.defaultValue&&null!==l.defaultValue&&(e=l.defaultValue),!f(e)&&void 0!==l.defaultItem&&null!==l.defaultItem&&(e=l.defaultItem),e},T=()=>void 0!==l.required?l.required:Q.required,P=()=>{const e=void 0!==l.validationMessage,t=M(),s=!T()||null!==t&&""!==t&&void 0!==t;return{customError:e,valid:void 0!==l.valid?l.valid:s,valueMissing:null===t}},B=e=>{ye.current=!0,e.focus(),window.setTimeout((()=>ye.current=!1),30)},R=()=>{me.current&&B(me.current),l.adaptive&&setTimeout((()=>{me.current&&B(me.current)}),300)},O=()=>{ge.current&&ge.current.setCustomValidity&&ge.current.setCustomValidity(P().valid?"":l.validationMessage||"Please select a value from the list!")},z=(e,t)=>{const s=M();w(s,e,l.dataItemKey)||(void 0===l.value&&(t.data.value=e),we.current.updateComponentArgs({value:e}),be.current=e,t.events.push({type:"onChange"}))},H=e=>{var t;null==(t=null==we?void 0:we.current)||t.applyState(e),be.current=void 0},q=(t,s)=>{var i;const{virtual:n,dataItemKey:a,defaultItem:o}=l,r=F(e),d=n?n.skip:0,u=M(),p=-1===t&&void 0!==o?o:r[t-d],c=!w(p,u,a);z(p,s),c&&(null==(i=null==we?void 0:we.current)||i.triggerPageChangeCornerItems(p,s))},A=(t,s,i)=>{var n,a;const{defaultItem:o,dataItemKey:r,virtual:d={skip:0,total:0,pageSize:0}}=l,u=M(),p=F(e),c=null==(n=null==we?void 0:we.current)?void 0:n.vs,h=p.findIndex((e=>w(e,u,r))),g=null==(a=null==we?void 0:we.current)?void 0:a.navigation.navigate({current:d.skip+h,max:(null!=c&&c.enabled?d.total:p.length)-1,min:void 0!==o?-1:0,keyCode:s,skipItems:i||void 0});void 0!==g&&q(g,t),H(t)},W=()=>{const{textField:t,dataItemKey:s,virtual:i={skip:0},focusedItemIndex:n=x,filterable:a,skipDisabledItems:o=!0}=l,r=M(),d=F(e),u=l.filter?l.filter:De.text;return o&&t&&!u&&!r?d.findIndex((e=>!e.disabled&&e[t])):f(r)&&void 0===u||a&&""===u?d.findIndex((e=>w(e,r,s))):u?Ce.current?n(d,u,t):d.findIndex((e=>w(e,r,s))):0===i.skip?0:-1},U=(e,t)=>void 0!==t&&-1!==t&&e&&e.length>0&&e[t].disabled,J=()=>{const t=F(e),s=we.current.initState(),i=W();U(t,i)&&(z(null,s),H(s))},Z=e=>{if(e.isPropagationStopped())return;const t=we.current.initState();t.syntheticEvent=e,De.focused||(t.data.focused=!0),J(),we.current.togglePopup(t),H(t)},ee=t=>{var s,n,a,o,r,d,u;t&&t.target instanceof Element&&"INPUT"===t.target.nodeName&&t.stopPropagation&&t.stopPropagation();const{filterable:p,disabled:c,defaultItem:h,leftRightKeysNavigation:g=!0,virtual:m={skip:0,total:0,pageSize:0},dataItemKey:v,groupField:f="",textField:y,skipDisabledItems:b=!0}=l,x=F(e),C=M(),I=x.findIndex((e=>w(e,C,v))),k=void 0!==l.opened?l.opened:De.opened,S=t.keyCode,E=S===i.Keys.home||S===i.Keys.end,D=S===i.Keys.up||S===i.Keys.down,K=!k&&(t.altKey&&S===i.Keys.down||S===i.Keys.enter||S===i.Keys.space),N=k&&(t.altKey&&S===i.Keys.up||S===i.Keys.esc),T=g&&(S===i.Keys.left||S===i.Keys.right),P=D||T&&!p||E,B=we.current.initState();if(B.syntheticEvent=t,!c){if(E&&null!=(s=null==we?void 0:we.current)&&s.vs.enabled)S===i.Keys.home?0!==m.skip?(null==(n=null==we?void 0:we.current)||n.triggerOnPageChange(B,0,m.pageSize),xe.current=!0):z(x[0],B):m.skip<m.total-m.pageSize?(null==(a=null==we?void 0:we.current)||a.triggerOnPageChange(B,m.total-m.pageSize,m.pageSize),xe.current=!0):z(x[x.length-1],B);else if(k&&S===i.Keys.pageUp)t.preventDefault(),null==(o=null==we?void 0:we.current)||o.scrollPopupByPageSize(-1);else if(k&&S===i.Keys.pageDown)t.preventDefault(),null==(r=null==we?void 0:we.current)||r.scrollPopupByPageSize(1);else if(k&&S===i.Keys.enter){const e=W();U(x,e)?(z(null,B),H(B)):q(e,B),null==(d=null==we?void 0:we.current)||d.togglePopup(B),t.preventDefault()}else if(K||N)N&&J(),null==(u=null==we?void 0:we.current)||u.togglePopup(B),t.preventDefault();else if(P){if(Ce.current=!1,""!==f&&y)if(!b&&k)A(B,S);else{let e;if(S===i.Keys.down||S===i.Keys.right){const t=x.slice(I+1).find((e=>!e.disabled&&e[y]));e=t&&x.findIndex((e=>e[y]===t[y]))}else if(S===i.Keys.up||S===i.Keys.left){let t;if(0===I&&h)e=-1;else if(-1===I)t=x,e=x.findIndex((e=>!e.disabled&&e[y]));else{t=x.slice(0,I);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&x.findIndex((e=>e[y]===s[y]))}}if(void 0!==e){A(B,S,e-I)}else void 0===e&&x.findIndex((e=>e[y]===C[y]))===x.length-1&&A(B,S)}else if(!b&&k||E)A(B,S);else if(y){let e;if(S===i.Keys.down||S===i.Keys.right){const t=x.slice(I+1).find((e=>!e.disabled&&e[y]));e=t&&x.findIndex((e=>e[y]===t[y]))}else if(S===i.Keys.up||S===i.Keys.left){let t;if(0===I&&h)e=-1;else if(-1===I)t=x,e=x.find((e=>!e.disabled&&e[y]));else{t=x.slice(0,I);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&x.findIndex((e=>e[y]===s[y]))}}if(void 0!==e){A(B,S,e-I)}else void 0===e&&x.findIndex((e=>e[y]===C[y]))===x.length-1&&A(B,S)}else A(B,S);t.preventDefault()}H(B)}},te=e=>{const t=we.current.initState();t.syntheticEvent=e.syntheticEvent,void 0===l.filter&&(t.data.text=e.target.value),we.current.filterChanged(e.target.value,t),Ce.current=!0,H(t),Me({group:void 0,text:String(e.target.value)})},se=()=>{const e=void 0!==l.filter?l.filter:De.text;return l.filterable&&h.createElement(m,{value:e,ref:e=>me.current=e&&e.element,onChange:te,onKeyDown:ee,size:C,rounded:k,fillMode:S,renderListFilterWrapper:!0})},ie=e=>{var t;const s=we.current.initState();s.syntheticEvent=e,null==(t=null==we?void 0:we.current)||t.togglePopup(s),z(l.defaultItem,s),H(s)},ne=()=>{const{textField:e,defaultItem:t,dataItemKey:s}=l,i=M();return void 0!==t&&h.createElement(N,{defaultItem:t,textField:e,selected:w(i,t,s),key:"defaultitemkey",onClick:ie})},ae=(e,t)=>{var s;null==(s=null==we?void 0:we.current)||s.handleItemClick(e,t),be.current=void 0},oe=t=>{const{vs:s,list:i}=we.current;s.scrollHandler(t);const{groupField:n}=l;let a=F(e);if(n&&a.length&&n){const e=Se.current=Se.current||(s.enabled?s.itemHeight:i?i.children[0].offsetHeight:0),o=t.target.scrollTop-s.skip*e;a=we.current.getGroupedDataModernMode(a,n);let l=a[0][n];for(let t=1;t<a.length&&!(e*t>o);t++)a[t]&&a[t][n]&&(l=a[t][n]);l!==De.group&&Me({group:l})}},le=()=>{var t;const{textField:n,dataItemKey:a,virtual:o={skip:0,total:void 0},groupHeaderItemRender:r,listNoDataRender:d,itemRender:u}=l,p=F(e),c=s&&s.uDropDownList,g=we.current.vs,m=o.skip,v=void 0!==l.opened?l.opened:De.opened,f=we.current.getPopupSettings(),y=`translateY(${g.translate}px)`,b=M();return h.createElement(V,{id:Pe,show:v,data:p.slice(),focusedIndex:W(),value:b,textField:n,valueField:a,optionsGuid:Be,groupField:l.groupField,groupMode:"modern",listRef:e=>g.list=we.current.list=e,wrapperStyle:{maxHeight:f.height},wrapperCssClass:i.classNames(i.uDropDownList.listContent({c:c})),listStyle:g.enabled?{transform:y}:void 0,key:"listkey",skip:m,onClick:ae,itemRender:u,groupHeaderItemRender:r,noDataRender:d,onScroll:oe,wrapperRef:g.scrollerRef,scroller:null==(t=null==we?void 0:we.current)?void 0:t.renderScrollElement(),ariaSetSize:o.total})},re=()=>{De.focused&&window.setTimeout((()=>{De.focused&&we.current.wrapper&&B(we.current.wrapper)}))},de=e=>{var t;null!=(t=l.popupSettings)&&t.onMouseDownOutside&&l.popupSettings.onMouseDownOutside.call(void 0,e)},ue=t=>{clearTimeout(ve.current),l.filterable||(ve.current=window.setTimeout((()=>fe.current.word=""),p),(t=>{const{dataItemKey:s}=l,i=F(e),n=M();let a=i.map(((e,t)=>({item:e,itemIndex:t})));const o=fe.current.word,r=fe.current.last,d=((e,t)=>{for(let s=0;s<e.length;s++)if(e.charAt(s)!==t)return!1;return!0})(o,r);let u,p=a.length,c=Math.max(0,i.findIndex((e=>w(e,n,s))));l.defaultItem&&(u={item:l.defaultItem,itemIndex:-1},p+=1,c+=1),c+=d?1:0,a=((e,t,s)=>{let i=e;return s&&(i=[s].concat(i)),i.slice(t).concat(i.slice(0,t))})(a,c,u);let h,g,m,v=0;const{textField:f}=l;for(;v<p;v++)if(h=I(a[v].item,f),g=d&&y(h,r,b),m=y(h,o,b),g||m){v=a[v].itemIndex;break}if(v!==p){const e=we.current.initState();e.syntheticEvent=t,q(v,e),H(e),be.current=void 0}})(t))},pe=()=>{const e=we.current.initState();e.data.opened=De.opened,we.current.togglePopup(e),H(e)},ce=h.useRef(null),he=h.useRef(null),ge=h.useRef(),me=h.useRef(null);h.useImperativeHandle(ce,(()=>({get element(){return he.current},get index(){return(()=>{const{dataItemKey:t}=l,s=F(e),i=M();return s.findIndex((e=>w(e,i,t)))})()},get name(){return l.name},get validity(){return P()},get value(){return M()},get focused(){return De.focused},get opened(){return De.opened},focus:K,props:l,togglePopup:pe}))),h.useImperativeHandle(t,(()=>ce.current));const ve=h.useRef(null),fe=h.useRef({word:"",last:""}),ye=h.useRef(!1),be=h.useRef(null),xe=h.useRef(!1),Ce=h.useRef(!1),Ie=h.useRef({}),ke=h.useRef({}),we=h.useRef(new $({props:e,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Se=h.useRef(0),Ee=h.useRef(null),[De,Fe]=h.useState({}),[,Ke]=h.useReducer((e=>e),!0),Ne=r.useLocalization(),Me=e=>{Fe({...De,...e})};h.useEffect((()=>{we.current.updateComponentArgs({props:e,setState:Me,state:De,forceUpdate:Ke,element:he.current,handleItemSelect:q,value:M()})}),[Me,De,Ke,q,M]),h.useEffect((()=>{var t,s,i,n,a,o,r,d,u,p,c,h,g;const{dataItemKey:m,virtual:v,groupField:f="",textField:y}=l,b=F(e),x=Ie.current.virtual?Ie.current.virtual.total:0,C=void 0!==l.opened?l.opened:De.opened,I=void 0!==Ie.current.opened?Ie.current.opened:ke.current.opened,k=!I&&C;if(null==(t=null==we?void 0:we.current)||t.didUpdate(),null!=(s=null==we?void 0:we.current)&&s.getPopupSettings().animate||k&&R(),v&&v.total!==x)null==(i=null==we?void 0:we.current)||i.vs.calcScrollElementHeight(),null==(n=null==we?void 0:we.current)||n.vs.reset();else{const e=M(),t=void 0!==Ie.current.value?Ie.current.value:ke.current.value;let s=b.findIndex((t=>w(t,e,m)));""!==f&&e&&y&&(s=null==(o=null==(a=null==we?void 0:we.current)?void 0:a.getGroupedDataModernMode(b,f))?void 0:o.map((e=>e[y])).indexOf(e[y]));const i=!w(t,e,m);k&&v?null==(r=null==we?void 0:we.current)||r.scrollToVirtualItem(v,s):k&&!v?(R(),b&&0!==b.length&&(null==(d=null==we?void 0:we.current)||d.resetGroupStickyHeader(b[0][f],{setState:Me,group:De.group,state:De})),null==(u=null==we?void 0:we.current)||u.scrollToItem(s)):C&&I&&e&&i&&!xe.current?null==(c=null==we?void 0:we.current)||c.scrollToItem(s,null==(p=null==we?void 0:we.current)?void 0:p.vs.enabled):C&&I&&xe.current&&(xe.current&&v&&0===v.skip?null==(h=null==we?void 0:we.current)||h.vs.reset():xe.current&&v&&v.skip===v.total-v.pageSize&&(null==(g=null==we?void 0:we.current)||g.vs.scrollToEnd()))}xe.current=!1,ke.current=De,Ie.current=l,O()})),h.useEffect((()=>{var e,t;return Ee.current=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver((e=>(e=>{for(const t of e)t.target.clientWidth!==ke.current.windowWidth&&Me({windowWidth:t.target.clientWidth})})(e))),null==(e=null==we?void 0:we.current)||e.didMount(),O(),null!=(t=D())&&t.body&&Ee.current&&Ee.current.observe(D().body),()=>{var e;null!=(e=D())&&e.body&&Ee.current&&Ee.current.disconnect()}}),[]);const Te=o+"-accessibility-id",Pe=o+"-listbox-id",Be=o+"-guid",Re=Ne.toLanguageString(L,_[L]),{style:Oe,className:Le,label:ze,dir:He,virtual:_e,adaptive:Ve,dataItemKey:qe,disabled:Ae,loading:We,iconClassName:Ue,svgIcon:$e,valueRender:Ge}=l,{windowWidth:je=0}=De,Ye=void 0!==l.opened?l.opened:De.opened,Je=M(),Qe=I(Je,l.textField),Xe=!(void 0!==l.validityStyles?l.validityStyles:Q.validityStyles)||P().valid,Ze=we.current,et=Ze.vs,tt=je<=Y&&Ve,st=s&&s.uDropDownList;et.enabled=void 0!==_e,void 0!==_e&&(Ze.vs.skip=_e.skip,Ze.vs.total=_e.total,Ze.vs.pageSize=_e.pageSize);const it=F(e),{focused:nt}=De,at=it.findIndex((e=>w(e,Je,qe))),ot=h.createElement("span",{id:Te,className:i.classNames(i.uDropDownList.inputInner({c:st}))},Qe&&h.createElement("span",{className:i.classNames(i.uDropDownList.inputText({c:st}))},Qe)),lt=void 0!==Ge?Ge.call(void 0,ot,Je):ot,rt=h.createElement(h.Fragment,null,h.createElement("span",{ref:e=>{he.current=e,we.current.wrapper=e},className:i.classNames(i.uDropDownList.wrapper({c:st,size:C,rounded:k,fillMode:S,focused:nt,disabled:Ae,invalid:!Xe,loading:We,required:T()}),Le),style:ze?{...Oe,width:void 0}:Oe,dir:He,onMouseDown:Ye?e=>{"INPUT"!==e.target.nodeName&&(B(we.current.wrapper),e.preventDefault())}:void 0,onFocus:e=>{ye.current||we.current.handleFocus(e)},onBlur:e=>{if(ye.current||!De.focused)return;const t=void 0!==l.opened?l.opened:De.opened,{adaptive:s}=l,{windowWidth:i=0}=De,n=i<=Y&&s,a=we.current.initState();a.syntheticEvent=e,a.data.focused=!1,a.events.push({type:"onBlur"}),t&&J(),t&&!n&&we.current.togglePopup(a),H(a)},tabIndex:i.getTabIndex(c,Ae),accessKey:l.accessKey,onKeyDown:ee,onKeyPress:e=>{if(l.filterable||0===e.which||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);b&&(t=t.toLowerCase())," "===t&&e.preventDefault(),fe.current={word:fe.current.word+t,last:fe.current.last+t},ue(e)},onClick:Ae?void 0:Z,role:"combobox","aria-required":T(),"aria-disabled":Ae||void 0,"aria-haspopup":"listbox","aria-expanded":Ye||!1,"aria-owns":Pe,"aria-activedescendant":Ye?"option-"+Be+"-"+(at+(_e?_e.skip:0)):void 0,"aria-label":l.ariaLabel||l.label,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy||Te,"aria-controls":Pe,id:l.id,title:l.title},lt,We&&h.createElement(i.IconWrap,{className:i.classNames(i.uDropDownList.loadingIcon({c:st})),name:"loading"}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":Re,size:C,fillMode:S,iconClass:Ue,className:i.classNames(i.uDropDownList.inputButton({c:st})),rounded:null,themeColor:"base",icon:Ue?void 0:"caret-alt-down",svgIcon:$e||a.caretAltDownIcon,onMouseDown:e=>De.focused&&e.preventDefault()}),(e=>h.createElement("select",{name:l.name,ref:e=>{ge.current=e},tabIndex:-1,"aria-hidden":!0,title:l.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,e):e})))(Je),!tt&&(()=>{const{header:t,footer:n,dir:a,groupField:o,groupStickyHeaderItemRender:r,list:d}=l,u=F(e),p=we.current,c=p.getPopupSettings(),m=void 0!==l.opened?l.opened:De.opened,f=void 0!==c.width?c.width:p.popupWidth,y=s&&s.uDropDownList,b={dir:void 0!==a?a:p.dirCalculated,width:f,popupSettings:{...c,popupClass:i.classNames(c.popupClass,i.uDropDownList.listContainer({c:y})),anchor:c.anchor||he.current,show:m,onOpen:R,onClose:re,onMouseDownOutside:de},itemsCount:[u.length]};let{group:x}=De;return void 0===x&&void 0!==o&&(x=I(u[0],o)),h.createElement(g,{...b},se(),t&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:y}))},t),h.createElement("div",{className:i.classNames(i.uDropDownList.list({c:y,size:C,virtual:we.current.vs.enabled}))},ne(),!d&&x&&0!==u.length&&h.createElement(v,{group:x,groupMode:"modern",render:r}),le()),n&&h.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:y}))},n))})()),tt&&(()=>{var t;const{windowWidth:n=0}=De,{header:o,footer:r,adaptiveTitle:p,groupField:c,groupStickyHeaderItemRender:g,list:m}=l,f=F(e),y=void 0!==l.opened?l.opened:De.opened,b=s&&s.uDropDownList,x=s&&s.uDropDownsActionSheet,k={navigatable:!1,navigatableElements:[],expand:y,animation:!0,onClose:e=>Z(e),animationStyles:n<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:x,isFullScreen:n<=j}))};let{group:w}=De;return void 0===w&&void 0!==c&&(w=I(f[0],c)),h.createElement(u.ActionSheet,{...k},h.createElement(u.ActionSheetHeader,{className:i.classNames(i.uDropDownsActionSheet.header({c:x}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:x}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:x}))},h.createElement("div",null,p)),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:x}))},h.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:Z,icon:"x",svgIcon:a.xIcon}))),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:x}))},se())),h.createElement(u.ActionSheetContent,{overflowHidden:!0},o&&h.createElement("div",{className:i.classNames(i.uDropDownList.listHeader({c:b}))},o),h.createElement("div",{className:i.classNames(i.uDropDownList.list({c:b,size:C,virtual:null==(t=null==we?void 0:we.current)?void 0:t.vs.enabled}))},ne(),!m&&w&&0!==f.length&&h.createElement(v,{group:w,groupMode:"modern",render:g}),le()),r&&h.createElement("div",{className:i.classNames(i.uDropDownList.listFooter({c:b}))},r)))})());return ze?h.createElement(n.FloatingLabel,{label:ze,editorValue:Qe,editorValid:Xe,editorDisabled:l.disabled,style:{width:Oe?Oe.width:void 0},children:rt}):rt}));J.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};const Q={delay:500,tabIndex:0,ignoreCase:!0,...$.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};J.displayName="KendoReactDropDownList";const X=i.createPropsContext();J.displayName="KendoReactDropDownList";let Z=class extends h.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(e){const t=e.value,s=e.suggestedText,{value:n,suggestedText:a,focused:o}=this.props,l=this.input,r=t!==n||a!==s,d=r&&t.startsWith(n)&&!(s&&a&&s.endsWith(a)),u=i.getActiveElement(document);o&&l&&u!==l&&l.focus(),a&&r&&!d&&l&&l.setSelectionRange(n.length-a.length,n.length)}render(){const{expanded:e=!1,disabled:t,role:s="listbox",render:n,tabIndex:a,accessKey:o,unstyled:l}=this.props,r=l&&l.uDropDownsBase,d={tabIndex:a,accessKey:o},u=h.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:i.classNames(i.uDropDownsBase.inputInner({c:r})),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,...d});return n?n.call(void 0,u):u}};const ee=e=>{const t=r.useLocalization(),s=i.useUnstyled(),n=s&&s.uDropDownsBase,o=t.toLanguageString(B,_[B]);return h.createElement("span",{className:i.classNames(i.uDropDownsBase.clearButton({c:n})),role:"button",onClick:e.onClick,onMouseDown:e=>e.preventDefault(),tabIndex:-1,title:o,key:"clearbutton"},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon}))},te=i.useCustomComponent,se=class e extends h.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.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,n=F(this.props)[e-(s?s.skip:0)],a=this.hasDuplicates||!w(n,this.value,i);this.triggerOnChange(n,t),void 0!==this.state.text&&(t.data.text=void 0),a&&this.base.triggerPageChangeCornerItems(n,t)},this.onPopupOpened=()=>{setTimeout((()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)}),300)},this.componentRef=e=>{this._element=e,this.base.wrapper=e},this.toggleBtnClick=e=>{const{skipDisabledItems:t,textField:s}=this.props,i=F(this.props),n=this.getFocusedIndex(),a=this.getCurrentValueDisabledStatus(s,i,n),o=void 0!==this.props.opened?this.props.opened:this.state.opened,l=this.base.initState();if(l.syntheticEvent=e,!t&&s&&a&&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=f(e)?e:t;return h.createElement(m,{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 n=F(this.props);if(!i||!n.length)return;const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;"modern"===this.props.groupMode&&(n=this.base.getGroupedDataModernMode(n,i));let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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=F(this.props),n=this.getFocusedIndex(),a=!(-1===n)&&this.getCurrentValueDisabledStatus(s,i,n);t.data.focused=!1,t.events.push({type:"onBlur"}),t.syntheticEvent=e,s&&a&&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:n,groupField:a}=this.props,o=F(this.props),l=this.value,r=Math.max(0,o.findIndex((e=>w(e,l,n)))),d=e.keyCode,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();if(p.syntheticEvent=e,!e.altKey&&(d===i.Keys.up||d===i.Keys.down)){if(e.preventDefault(),""!==a&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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(p,d,t)}else void 0===e&&o.findIndex((e=>e[s]===l[s]))===o.length-1&&this.onNavigate(p,d)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,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(p,d,t)}else this.onNavigate(p,d)}this.applyState(p)}const c=()=>{e.preventDefault(),this.base.togglePopup(p),this.applyState(p)},h=this.getFocusedIndex(),g=-1===h,m=!g&&this.getCurrentValueDisabledStatus(s,o,h);u?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[h][s]:void 0)?!t&&s&&m?this.clearValueOnEnterOrEsc(e):m||this.applyValueOnEnter(e.currentTarget.value,p):this.applyValueOnEnter(e.currentTarget.value,p)):d===i.Keys.esc&&(!t&&s&&m&&this.clearValueOnEnterOrEsc(e),this.applyValueOnRejectSuggestions(e.currentTarget.value,p)):u||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,n=i.value;if(this.props.suggest){const e=i.selectionEnd===n.length;let t=void 0!==this.props.filter?this.props.filter:this.state.text;f(t)||(t=I(this.value,this.props.textField)||"");const s=t&&t===n,a=t&&t.length>n.length;s||a||!e?this._suggested="":this.suggestValue(n)}void 0===this.props.filter&&(t.data.text=n),void 0!==this.state.focusedItem&&(t.data.focusedItem=void 0),s||this.base.togglePopup(t),this.base.filterChanged(n,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(G)}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<=Y&&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=F(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:n,groupField:a="",textField:o}=this.props,l=F(this.props),r=e.virtual?e.virtual.total:0,d=void 0!==this.props.opened?this.props.opened:this.state.opened,u=void 0!==e.opened?e.opened:t.opened;e.data!==l&&this.checkForDuplicatePlainTextRecords();const p=!u&&d,c=this.value;if(this._valueOnDidUpdate=c,this.base.didUpdate(),n&&n.total!==r)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const r=void 0!==e.value?e.value:t.value;let h=this.hasDuplicates?this.navigationIndex||0:l.findIndex((e=>w(e,c,i)));"modern"===this.props.groupMode&&o&&c&&(h=null==(s=this.base.getGroupedDataModernMode(l,a))?void 0:s.map((e=>e[o])).indexOf(c[o]));const g=!w(r,c,i);p&&n?this.base.scrollToVirtualItem(n,h):p&&!n?(this.onPopupOpened(),l&&0!==l.length&&this.base.resetGroupStickyHeader(l[0][a],this),this.base.scrollToItem(h)):(this.hasDuplicates||d&&u&&c&&g)&&this.base.scrollToItem(h)}p&&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,_[R]),s=r.provideLocalizationService(this).toLanguageString(O,_[O]),{dir:o,disabled:l,clearButton:u=e.defaultProps.clearButton,label:p,textField:c,className:g,style:m,loading:v,iconClassName:y,virtual:b,size:x,rounded:C,fillMode:k,opened:w=this.state.opened,placeholder:S,svgIcon:E,unstyled: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=f(K)?K:N,T=u&&(!!M||f(this.value)),P=this.base.vs,B=this.props.id||this._inputId,L=this.mobileMode,z=D&&D.uComboBox;P.enabled=void 0!==b,void 0!==b&&(P.skip=b.skip,P.total=b.total,P.pageSize=b.pageSize);const[H,V]=te(this.props.prefix||h.Fragment),[q,A]=te(this.props.suffix||h.Fragment),W=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames(i.uComboBox.wrapper({c:z,size:x,rounded:C,fillMode:k,disabled:l,invalid:!F,loading:v,required:this.required}),g),ref:this.componentRef,style:p?{...m,width:void 0}:m,dir:o},this.props.prefix&&h.createElement(H,{...V}),this.renderSearchBar(M||"",B,S),T&&!v&&h.createElement(ee,{onClick:this.clearButtonClick,key:"clearbutton"}),v&&h.createElement(i.IconWrap,{className:i.classNames(i.uComboBox.loadingIcon({c:z})),name:"loading",key:"loading"}),this.props.suffix&&h.createElement(q,{...A}),h.createElement(d.Button,{tabIndex:-1,type:"button","aria-label":w?s:t,icon:y?void 0:"caret-alt-down",svgIcon:E||a.caretAltDownIcon,iconClass:y,size:x,fillMode:k,rounded:null,themeColor:"base",className:i.classNames(i.uComboBox.inputButton({c:z})),onClick:this.toggleBtnClick,onMouseDown:e=>e.preventDefault()}),!L&&this.renderListContainer()),L&&this.renderAdaptiveListContainer());return p?h.createElement(n.FloatingLabel,{label:p,editorId:B,editorValue:M,editorValid:F,editorDisabled:l,style:{width:m?m.width:void 0},children:W,unstyled:D}):W}onNavigate(e,t,s){const{virtual:i={skip:0}}=this.props,n=F(this.props),a=this.props.filter?this.props.filter:this.state.text;let o,l=-1;const r=this.base.vs,d=this.value;this._suggested="";const u=this.hasDuplicates&&-1!==this.duplicates.indexOf(d);if(l=this.getFocusedIndex(u),-1===l||f(d))if(""===a)this.handleItemSelect(0,e);else{const a=i.skip+l;o=this.base.navigation.navigate({keyCode:t,current:a,max:(r.enabled?r.total:n.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,n=F(this.props),a=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s)===e?this.index:C(n,e,s),l=-1!==o;let r;if(this._suggested="",l)r=n[o];else{if(!i)return this.selectFocusedItem(e,t);r=void 0!==s?{[s]:e}:e}this.triggerOnChange(r,t),a&&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,n=F(this.props),a=void 0!==this.props.opened?this.props.opened:this.state.opened,o=I(this.value,s);if(this._suggested="",e===o||""===e&&!f(o))return this.closeOpenedApplyStateNonMobileMode(t,a),this.applyState(t);const l=C(n,e,s,!0);let r=null;-1!==l?r=n[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,a),this.applyState(t)}selectFocusedItem(e,t){const s=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:i,virtual:n={skip:0},focusedItemIndex:a=x}=this.props,o=F(this.props),l=n.skip,r=""===e&&0===l?0:a(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:n,groupField:o,groupMode:l,list:r,virtual:p,adaptiveTitle:c,groupStickyHeaderItemRender:g,unstyled:m}=this.props,f=F(this.props),y=void 0!==this.props.opened?this.props.opened:this.state.opened,b=this.base.getAdaptiveAnimation(),x=m&&m.uComboBox,C=m&&m.uDropDownsActionSheet;let{group:k}=this.state;void 0===k&&void 0!==o&&(k=I(f[0],o));const w={navigatable:!1,navigatableElements:[],expand:y,animation:b,onClose:e=>this.toggleBtnClick(e),animationStyles:e<=j?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames(i.uDropDownsActionSheet.wrapper({c:C,isFullScreen:e<=j}))};return h.createElement(u.ActionSheet,{...w},h.createElement(u.ActionSheetHeader,null,h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBar({c:C}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.title({c:C}))},h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.header({c:C}))},c),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.subtitle({c:C}))})),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.actions({c:C}))},h.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:a.xIcon}))),h.createElement("div",{className:i.classNames(i.uDropDownsActionSheet.titleBarGroup({c:C}))},this.renderMobileListFilter())),h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.createElement("div",{className:i.classNames(i.uComboBox.listContainer({c:x}))},h.createElement("div",{className:i.classNames(i.uComboBox.list({c:x,list:r,size:"large",tableSize:n,virtual:p}))},t&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:x}))},t),!r&&k&&0!==f.length&&h.createElement(v,{group:k,groupMode:l,render:g}),this.renderList(),s&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:x}),this.props.footerClassName)},s)))))}renderListContainer(){const e=this.base,{dir:t,header:s,footer:n,groupField:a,groupMode:o,size:l,list:r,virtual:d,groupStickyHeaderItemRender:u,unstyled:p}=this.props,c=F(this.props),m=void 0!==this.props.opened?this.props.opened:this.state.opened,f=e.getPopupSettings(),y=void 0!==f.width?f.width:e.popupWidth,b=p&&p.uComboBox;let{group:x}=this.state;return void 0===x&&void 0!==a&&(x=I(c[0],a)),h.createElement(g,{width:y,popupSettings:{...f,anchor:f.anchor||this.element,show:m,popupClass:i.classNames(f.popupClass,i.uComboBox.listContainer({c:b,popup:!0}))},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[c.length]},h.createElement("div",{className:i.classNames(i.uComboBox.list({c:b,list:r,size:l,tableSize:l,virtual:d}))},s&&h.createElement("div",{className:i.classNames(i.uComboBox.listHeader({c:b}))},s),!r&&x&&0!==c.length&&h.createElement(v,{group:x,groupMode:o,render:u}),this.renderList(),n&&h.createElement("div",{className:i.classNames(i.uComboBox.listFooter({c:b}),this.props.footerClassName)},n)))}renderList(){const e=this.base,{textField:t,dataItemKey:s,listNoDataRender:n,itemRender:a,groupHeaderItemRender:o,virtual:l={skip:0,total:void 0},unstyled:r}=this.props,d=F(this.props),u=e.getPopupSettings(),p=e.vs,c=l.skip,g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=`translateY(${p.translate}px)`,v=g?this.getFocusedIndex(this.hasDuplicates):void 0,y=void 0!==this.props.filter?this.props.filter:this.state.text,b=I(this.value,t),x=f(y)&&y!==b?null:this.value,C=this.props.list||V,k=r&&r.uComboBox;return h.createElement(C,{id:e.listBoxId,virtual:!!l,show:g,data:d,focusedIndex:v,value:x,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>Y?{maxHeight:u.height}:{},wrapperCssClass:i.classNames(i.uComboBox.listContent({c:k,virtual:l})),listStyle:p.enabled?{transform:m}:void 0,key:"listkey",skip:c,onClick:this.handleItemClick,itemRender:a,groupHeaderItemRender:o,noDataRender:n,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:n,title:a,ariaLabelledBy:o,ariaDescribedBy:l,dataItemKey:r,virtual:d={skip:0},accessKey:u,unstyled:p}=this.props,c=F(this.props),g=void 0!==this.props.opened?this.props.opened:this.state.opened,m=this.value,v=Math.max(0,c.findIndex((e=>w(e,m,r))));this._suggested&&!w(this._valueOnDidUpdate,m,r)&&(this._suggested="");const f={accessKey:u};return h.createElement(Z,{id:t,readOnly:g&&this.mobileMode,placeholder:s,tabIndex:i,title:a,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:n,expanded:g,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${v+d.skip}`,role:"combobox",ariaLabelledBy:o,ariaLabel:this.props.ariaLabel,ariaDescribedBy:l,ariaRequired:this.required,render:this.props.valueRender,ariaControls:this.base.listBoxId,unstyled:p,...f})}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&&(!f(s)&&!f(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:n={skip:0},focusedItemIndex:a=x,skipDisabledItems:o}=this.props,l=F(this.props),r=this.props.filter?this.props.filter:this.state.text;return e&&void 0!==this.navigationIndex?this.navigationIndex:f(t)&&void 0===r?l.findIndex((e=>w(e,t,i))):r?a(l,r,s):o&&s&&!r&&0===n.skip?l.findIndex((e=>!e.disabled&&e[s])):0===n.skip?0:-1}suggestValue(e){const{data:t,textField:s}=this.props;this._suggested=((e,t=[],s)=>{let i="";if(e){const n=t[x(t,e,s)];if(n){const t=I(n,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})}};se.displayName="ComboBox",se.propTypes={...$.propTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),dataItemKey:s.string,groupField:s.string,groupMode:s.oneOf([void 0,"classic","modern"]),isMultiColumn:s.bool,suggest:s.bool,placeholder:s.string,title:s.string,allowCustom:s.bool,clearButton:s.bool,iconClassName:s.string,svgIcon:i.svgIconPropType,validationMessage:s.string,required:s.bool,id:s.string,ariaLabelledBy:s.string,ariaLabel:s.string,ariaDescribedBy:s.string,list:s.any,valueRender:s.func,skipDisabledItems:s.bool},se.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};let ie=se;const ne=i.createPropsContext(),ae=i.withIdHOC(i.withPropsContext(ne,i.withUnstyledHOC(ie)));ae.displayName="KendoReactComboBox";const{sizeMap:oe,roundedMap:le}=i.kendoThemeMaps,re=class e extends h.Component{constructor(e){super(e),this.state={},this.base=new $(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const s=F(this.props),i=I(s[e],this.props.textField);this.triggerOnChange(i,t)},this.itemFocus=(e,t)=>{const{textField:s}=this.props,i=F(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=F(this.props);if(!s||!i.length)return;const n=this.itemHeight||(t?t.children[0].offsetHeight:0),a=e.target.scrollTop;s&&(i=this.base.getGroupedDataModernMode(i,s));let o=i[0][s];for(let e=1;e<i.length&&!(n*e>a);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,n=s.selectionEnd===i.length;t.syntheticEvent=e;const a=this._suggested,o=this.value,l=o&&o.substring(0,o.length-a.length),r=l&&l===i,d=l&&l.length>i.length,{suggest:u}=this.props,p=void 0!==this.props.opened?this.props.opened:this.state.opened;if(void 0!==u&&!1!==u){r||d||!n?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);(!p&&i||p&&!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:n}=this.props,a=F(this.props);this._isScrolling&&(this._isScrolling=!1);const o=this.focusedIndex(),l=a[o],r=e.keyCode,d=e.altKey,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=this.base.initState();p.syntheticEvent=e;const c=()=>{u&&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(u&&r===i.Keys.pageUp)c(),this.base.scrollPopupByPageSize(-1);else if(u&&r===i.Keys.pageDown)c(),this.base.scrollPopupByPageSize(1);else if(!u||r!==i.Keys.enter&&r!==i.Keys.esc)if(u||r!==i.Keys.esc){if(r===i.Keys.up||r===i.Keys.down){if(""!==s&&n)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=0;if(r===i.Keys.down||r===i.Keys.right){const t=a.slice(o+1).find((e=>!e.disabled&&e[n]));e=t&&a.findIndex((e=>e[n]===t[n]))}else if(r===i.Keys.up||r===i.Keys.left){let t;if(-1===o)t=a,e=a.findIndex((e=>!e.disabled&&e[n]));else{t=a.slice(0,o);let s=t.pop();for(;s&&s.disabled;)s=t.pop();e=s&&a.findIndex((e=>e[n]===s[n]))}}if(void 0!==e){const t=e-o;this.onNavigate(p,r,t)}else void 0===e&&a.findIndex((e=>e[n]))===a.length-1&&this.onNavigate(p,r)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,r);else{let e=null;if(r===i.Keys.down||r===i.Keys.right)e=a.slice(o+1).find((e=>!e.disabled));else if(r===i.Keys.up||r===i.Keys.left){const t=a.slice(0,o);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-o-1;this.onNavigate(p,r,t)}else this.onNavigate(p,r)}this.applyState(p),c()}}else{const e="";this._suggested="",this.triggerOnChange(e,p),void 0!==this.state.focusedItem&&(p.data.focusedItem=void 0),this.applyState(p)}else c(),!1===t&&l&&l.disabled?(u&&this.togglePopup(p),this.applyState(p)):this.applyInputValue(e.currentTarget.value,p,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(G)}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,n=F(this.props),{data:a=[]}=e,o=this.focusedIndex(),l=n[o],r=a!==n,d=void 0!==l&&t.focusedItem!==l,u=void 0!==this.props.opened?this.props.opened:this.state.opened,p=void 0!==e.opened?e.opened:t.opened,c=!p&&u;if(""===i)(u&&(d||r)||c)&&this.base.scrollToItem(o);else if(!this._isScrolling){const e=null==(s=this.base.getGroupedDataModernMode(n,i))?void 0:s.indexOf(l);c&&(n&&0!==n.length&&this.base.resetGroupStickyHeader(n[0][i],this),this.base.scrollToItem(e)),u&&p&&d&&this.base.scrollToItem(e)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:e,disabled:t,label:s,className:a,style:o,loading:l,suggest:r,size:d,rounded:u,fillMode:p}=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,y=this.state.focused;"string"==typeof r&&(this._suggested=r);const[b,x]=te(this.props.prefix||h.Fragment),[C,I]=te(this.props.suffix||h.Fragment),k=h.createElement("span",{className:i.classNames("k-autocomplete k-input",a,{[`k-input-${oe[d]||d}`]:d,[`k-rounded-${le[u]||u}`]:u,[`k-input-${p}`]:p,"k-invalid":!c,"k-focus":y&&!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&&h.createElement(b,{...x}),this.renderSearchBar(m||"",f),l&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&h.createElement(ee,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&h.createElement(C,{...I}),this.renderListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:f,editorValue:m,editorValid:c,editorDisabled:t,style:{width:o?o.width:void 0},children:k}):k}onNavigate(e,t,s){const i=this.value,{textField:n,focusedItemIndex:a}=this.props,o=F(this.props),l=void 0!==this.state.focusedItem?o.findIndex((e=>w(e,this.state.focusedItem,n))):a?a(o,i,n):o.indexOf(S(o,i,n)),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 n=void 0!==this.props.opened?this.props.opened:this.state.opened,{textField:a}=this.props,o=F(this.props),l=o[this.focusedIndex()];if(this._suggested="",n&&s===i.Keys.enter&&l&&!l.disabled){const s=I(o[this.focusedIndex(e)],a);this.triggerOnChange(s,t)}n&&this.togglePopup(t),this.applyState(t)}renderSearchBar(e,t){const s=this.base,{placeholder:i,tabIndex:n,disabled:a,readonly:o}=this.props,{focused:l}=this.state,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(Z,{id:t,placeholder:i,tabIndex:n,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:a,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:n,size:a,groupField:o,list:l,groupStickyHeaderItemRender:r}=this.props,d=F(this.props),u=e.getPopupSettings(),p=void 0!==this.props.opened?this.props.opened:this.state.opened,c=void 0!==u.width?u.width:e.popupWidth;let{group:m}=this.state;return void 0===m&&void 0!==o&&(m=I(d[0],o)),h.createElement(g,{width:c,popupSettings:{...u,anchor:u.anchor||this.element,show:p,popupClass:i.classNames(u.popupClass,"k-list-container","k-autocomplete-popup")},dir:void 0!==t?t:this.base.dirCalculated,itemsCount:[d.length]},s&&h.createElement("div",{className:"k-list-header"},s),h.createElement("div",{className:i.classNames("k-list",{[`k-list-${oe[a]||a}`]:a})},!l&&m&&0!==d.length&&h.createElement(v,{group:m,groupMode:"modern",render:r}),this.renderList()),n&&h.createElement("div",{className:"k-list-footer"},n))}renderList(){const e=this.base,t=e.getPopupSettings(),{textField:s,listNoDataRender:i,itemRender:n,groupHeaderItemRender:a}=this.props,o=F(this.props),l=this.value,r=void 0!==this.props.opened?this.props.opened:this.state.opened;return h.createElement(V,{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:n,groupHeaderItemRender:a,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=F(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,n=F(this.props),a=void 0!==e?e:this.value;if(void 0!==this.state.focusedItem)return n.findIndex((e=>w(e,this.state.focusedItem,t)));if(s)return s(n,a,t);const o=n.indexOf(S(n,a,t));return i&&t&&-1===o?n.findIndex((e=>!e.disabled&&e[t])):Math.max(0,o)}};re.displayName="AutoComplete",re.propTypes={...$.basicPropTypes,size:s.oneOf([null,"small","medium","large"]),rounded:s.oneOf([null,"small","medium","large","full"]),fillMode:s.oneOf([null,"solid","flat","outline"]),groupField:s.string,suggest:s.oneOfType([s.bool,s.string]),placeholder:s.string,value:s.string,defaultValue:s.string,validationMessage:s.string,required:s.bool,readonly:s.bool,clearButton:s.bool,valueRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,list:s.any,skipDisabledItems:s.bool},re.defaultProps={...$.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let de=re;const ue=i.createPropsContext(),pe=i.withIdHOC(i.withPropsContext(ue,de));pe.displayName="KendoReactAutoComplete";const ce=e=>e.syntheticEvent.preventDefault(),he=e=>e.syntheticEvent.stopPropagation();class ge extends h.Component{render(){const{data:e,guid:t,focused:s,tagRender:i,tag:n,onTagDelete:a,size:o}=this.props;return h.createElement(h.Fragment,null,e.map(((l,r)=>{const u=n?h.createElement(n,{key:l.text+r,tagData:l,guid:t,focusedTag:s,onTagDelete:a}):h.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=>a.call(void 0,l.data,e.syntheticEvent),onMouseDown:ce,onClick:he,className:l===s?"k-focus":void 0,size:o});return i?i(l,u):u})),this.props.children)}}var me=(e=>(e[e.PopupList=0]="PopupList",e[e.TagsList=1]="TagsList",e))(me||{});const ve=e=>{const{footer:t,children:s,windowWidth:n=0,navigatable:o,navigatableElements:l,expand:r,animation:p,onClose:c,adaptiveTitle:g,mobileFilter:m}=e,v={navigatable:o||!1,navigatableElements:l||[],expand:r,animation:!1!==p,onClose:c,animationStyles:n<=500?{top:0,width:"100%",height:"100%"}:void 0,className:i.classNames("k-actionsheet","k-adaptive-actionsheet",n<=500?"k-actionsheet-fullscreen":"k-actionsheet-bottom")};return h.createElement(u.ActionSheet,{...v},h.createElement(u.ActionSheetHeader,{className:"k-text-center"},h.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},h.createElement("div",{className:"k-actionsheet-title"},h.createElement("div",{className:"k-text-center"},g),h.createElement("div",{className:"k-actionsheet-subtitle k-text-center"})),h.createElement("div",{className:"k-actionsheet-actions"},h.createElement(d.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:a.xIcon,onClick:c}))),m&&h.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),s,t&&h.createElement(u.ActionSheetFooter,{className:"k-actions k-actions-stretched"},h.createElement(d.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),h.createElement(d.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:fe,roundedMap:ye}=i.kendoThemeMaps,be=e=>e.preventDefault(),xe=e=>2===e,Ce=class e extends h.Component{constructor(e){super(e),this.state={activedescendant:me.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new $(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(e,t)=>{const{dataItemKey:s,virtual:i}=this.props,n=F(this.props),a=n[e-(i?i.skip:0)],o=this.value.findIndex((e=>w(e,a,s)));this._lastSelectedOrDeslectedItemIndex=n.findIndex((e=>w(e,a,s)));let l=[];-1!==o?(l=this.value,l.splice(o,1)):l=[...this.value,a],(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(a,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;k(i,e,this.props.dataItemKey),this.triggerOnChange(i,s),this.applyState(s)},this.itemFocus=(e,t)=>{const{allowCustom:s,virtual:i}=this.props,n=F(this.props),a=i?i.skip:0,o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedIndex:l}=this.getFocusedState(),r=s&&o,d=n[e-a];d&&l!==e?this.state.focusedIndex!==e&&(t.data.focusedIndex=e,t.data.activedescendant=me.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;f(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,n=F(this.props),a=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(),u=this.base.initState();if(u.syntheticEvent=e,!o&&this.value.length>0&&(a===i.Keys.left||a===i.Keys.right||a===i.Keys.home||a===i.Keys.end||a===i.Keys.delete||a===i.Keys.backspace)&&!e.shiftKey)return this.onTagsNavigate(e,u);const p=()=>{e.preventDefault(),this.base.togglePopup(u),this.applyState(u)};if(this.opened)if(a===i.Keys.pageUp)e.preventDefault(),this.base.scrollPopupByPageSize(-1);else if(a===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)===n.length?[]:n;this.updateStateOnKeyboardNavigation(e,u)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.end){const e=n.slice(this.getFocusedState().focusedIndex);this.itemFocus(n.length-1,u),this.updateStateOnKeyboardNavigation(e,u)}else if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===i.Keys.home){const e=n.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,u),this.updateStateOnKeyboardNavigation(e,u)}else if(e.shiftKey&&e.keyCode===i.Keys.up){let e;const t=this.getLastSelectedOrDeselectedIndex(1,d);null===t?e=0!==d?n.slice(d-1,d):[n[d]]:t===d?e=[n[t-1]]:d>=0&&(e=t>d?n.slice(d-1,t):n.slice(t-1,d)),e&&e.length>0&&(d>=1&&this.itemFocus(d-1,u),this.updateStateOnKeyboardNavigation(e,u))}else if(e.shiftKey&&e.keyCode===i.Keys.down){let e;const t=this.getLastSelectedOrDeselectedIndex(0,d);null===t?e=d!==n.length-1?n.slice(d,d+1):[n[d]]:t===d?e=n.slice(d,d+2):d>=0&&(e=t>d?n.slice(d+1,t+1):n.slice(t,d+2)),e&&e.length>=1&&(this.itemFocus(d+1,u),this.updateStateOnKeyboardNavigation(e,u))}else if(e.altKey&&a===i.Keys.up)p();else if(a===i.Keys.up||a===i.Keys.down){if(""!==s&&t)if(!this.props.skipDisabledItems&&l)this.onNavigate(u,a);else{let e=0;if(a===i.Keys.down||a===i.Keys.right){const s=n.slice(d+1).find((e=>!e.disabled&&e[t]));e=s&&n.findIndex((e=>e[t]===s[t]))}else if(a===i.Keys.up||a===i.Keys.left){let s;if(-1===d)s=n,e=n.findIndex((e=>!e.disabled&&e[t]));else{s=n.slice(0,d);let i=s.pop();for(;i&&i.disabled;)i=s.pop();e=i&&n.findIndex((e=>e[t]===i[t]))}}if(e){const t=e-d;this.onNavigate(u,a,t)}else void 0!==e&&this.onNavigate(u,a)}else if(!this.props.skipDisabledItems&&l)this.onNavigate(u,a);else{let e=null;if(a===i.Keys.down||a===i.Keys.right)e=n.slice(d+1).find((e=>!e.disabled));else if(a===i.Keys.up||a===i.Keys.left){const t=n.slice(0,d);for(e=t.pop();e&&e.disabled;)e=t.pop()}if(e){const t=e.id-d-1;this.onNavigate(u,a,t)}else this.onNavigate(u,a)}this.applyState(u),e.preventDefault()}else a===i.Keys.enter?(e.preventDefault(),this.props.allowCustom&&o&&null===r?this.customItemSelect(e):r&&r.disabled?p():this.selectFocusedItem(e)):a===i.Keys.esc&&p();else e.altKey&&a===i.Keys.down?p():a===i.Keys.esc&&this.clearButtonClick(e)},this.listContainerContent=()=>{const{header:e,footer:t,allowCustom:s,size:n,groupStickyHeaderItemRender:o,groupField:l,list:r}=this.props,d=F(this.props),u=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),c=s&&u&&h.createElement("div",{className:i.classNames("k-list",{[`k-list-${fe[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:be},h.createElement("div",{className:i.classNames("k-list-item k-custom-item",{"k-focus":xe(p)}),style:{fontStyle:"italic"}},u,h.createElement(i.IconWrap,{name:"plus",icon:a.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return void 0===g&&void 0!==l&&(g=I(d[0],l)),h.createElement(h.Fragment,null,e&&h.createElement("div",{className:"k-list-header"},e),c,h.createElement("div",{className:i.classNames("k-list",{[`k-list-${this.mobileMode?"lg":fe[n]||n}`]:n,"k-virtual-list":this.base.vs.enabled})},!r&&g&&0!==d.length&&h.createElement(v,{group:g,groupMode:"modern",render:o}),this.renderList()),t&&h.createElement("div",{className:"k-list-footer"},t))},this.renderListContainer=()=>{const e=this.base,{dir:t}=this.props,s=F(this.props),n=this.base.getPopupSettings(),a=void 0!==n.width?n.width:e.popupWidth,o={dir:void 0!==t?t:e.dirCalculated,width:a,popupSettings:{...n,popupClass:i.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),anchor:n.anchor||this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed},itemsCount:[s.length,this.value.length]};return h.createElement(g,{...o},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:e,filterable:t,filter:s}=this.props,{windowWidth:i=0}=this.state,n=void 0!==s?s:this.state.text;this.localization=r.provideLocalizationService(this);const a=t?h.createElement(m,{value:n,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:a,footer:{cancelText:this.localization.toLanguageString(H,_[H]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(z,_[z]),onApply:this.closePopup}};return h.createElement(ve,{...o},h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.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;f(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;f(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:n,virtual:a={skip:0,total:void 0}}=this.props,o=F(this.props),l=this.base.vs,{focusedIndex:r}=this.getFocusedState(),d=this.base.getPopupSettings(),u=`translateY(${l.translate}px)`;return h.createElement(V,{id:this.base.listBoxId,show:this.opened,data:o.slice(),focusedIndex:r-a.skip,value:this.value,textField:e,valueField:n,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:e=>{l.list=this.base.list=e},wrapperStyle:this.mobileMode?{}:{maxHeight:d.height},wrapperCssClass:"k-list-content",listStyle:l.enabled?{transform:u}:void 0,key:"listKey",skip:a.skip,onClick:this.handleItemClick,itemRender:s,groupHeaderItemRender:i,noDataRender:t,onMouseDown:be,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:l.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:a.total})},this.onScroll=e=>{const{vs:t,list:s}=this.base;t.scrollHandler(e);const{groupField:i}=this.props;let n=F(this.props);if(i&&n.length&&i){const a=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*a;n=this.base.getGroupedDataModernMode(n,i);let l=n[0][i];for(let e=1;e<n.length&&!(a*e>o);e++)n[e]&&n[e][i]&&(l=n[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 n=s?{[s]:t}:t;void 0!==this.state.text&&(i.data.text=""),i.data.focusedIndex=void 0,this.base.filterChanged("",i);const a=[...this.value,n];this.triggerOnChange(a,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(G)}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<=Y&&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:n=""}=this.props,a=F(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,u=r&&!this.opened,p=this.base.getPopupSettings();if(this.base.didUpdate(),!p.animate&&u&&this.onPopupClosed(),i&&i.total!==l)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:e,focusedIndex:t}=this.getFocusedState();""!==n&&(t=null==(s=this.base.getGroupedDataModernMode(a,n))?void 0:s.indexOf(e)),d&&i?this.base.scrollToVirtualItem(i,t-o):d&&!i?(a&&0!==a.length&&this.base.resetGroupStickyHeader(a[0][n],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:n}=this.props,a=F(this.props),o=void 0!==this.props.filter?this.props.filter:this.state.text,{focusedType:l,focusedIndex:r}=this.getFocusedState(),d=n&&o,u=xe(l),p=this.base,c=p.vs;if(this.opened&&t===i.Keys.up&&u)void 0!==this.state.focusedIndex&&(e.data.focusedIndex=void 0);else{const i=p.navigation.navigate({keyCode:t,current:r,max:(c.enabled?c.total:a.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:a,disabled:o,textField:l,dataItemKey:r,virtual:d,size:u,rounded:p,fillMode:c,loading:g,filter:m}=this.props,{text:v,focused:f,focusedTag:y,currentValue:b}=this.state,x=this.base.vs,C=this.props.id||this._inputId;x.enabled=void 0!==d,void 0!==d&&(x.skip=d.skip,x.total=d.total,x.pageSize=d.pageSize);const k=this.mobileMode&&this.opened?b:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const w=!this.validityStyles||this.validity.valid,S=!!(void 0!==m?m:v)||k&&k.length>0,[F,K]=te(this.props.prefix||h.Fragment),[N,M]=te(this.props.suffix||h.Fragment),T=h.createElement(h.Fragment,null,h.createElement("div",{ref:this.componentRef,className:i.classNames("k-multiselect k-input",t,{[`k-input-${fe[u]||u}`]:u,[`k-rounded-${ye[p]||p}`]:p,[`k-input-${c}`]:c,"k-focus":f&&!o,"k-invalid":!w,"k-disabled":o,"k-loading":g,"k-required":this.required}),style:s?{...e,width:void 0}:e,dir:a,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:E},this.props.prefix&&h.createElement(F,{...K}),h.createElement("div",{className:i.classNames("k-input-values")},h.createElement("div",{className:i.classNames("k-chip-list",{[`k-chip-list-${fe[u]||u}`]:u}),role:"listbox",id:"tagslist-"+this.base.guid},k&&k.length>0&&h.createElement(ge,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:k,guid:this.base.guid,focused:y?k.find((e=>D(e,y,r))):void 0,size:u})),this.renderSearchBar(C)),g&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&h.createElement(N,{...M}),S&&h.createElement(ee,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return s?h.createElement(n.FloatingLabel,{label:s,editorId:C,editorValue:v||I(this.value[0],l),editorValid:w,editorDisabled:o,style:{width:e?e.width:void 0},children:T}):T}renderSearchBar(e){const{activedescendant:t,focusedTag:s,currentValue:i}=this.state,{disabled:n,placeholder:a,ariaDescribedBy:o,ariaLabelledBy:l,ariaLabel:r}=this.props,d=!this.mobileMode&&(void 0!==this.props.filter?this.props.filter:this.state.text)||"",{focusedIndex:u}=this.getFocusedState(),p=0!==this.value.length||d?void 0:a,c=i&&i.length>0?void 0:a,g=t===me.TagsList&&void 0!==s?`tag-${this.base.guid}-${s.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${u}`,m={accessKey:this.props.accessKey,tabIndex:this.props.tabIndex};return h.createElement(Z,{id:e,size:Math.max((p||"").length,d.length,1),placeholder:this.mobileMode&&this.opened?c:p,value:d,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,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:n}=this.state,a=this._tags,o=this.props.dataItemKey;let l,r=n?a.findIndex((e=>D(e,n,o))):-1;const d=-1!==r;if(s===i.Keys.left)r=d?Math.max(0,r-1):a.length-1,l=a[r];else if(s===i.Keys.right)r===a.length-1?l=void 0:d&&(r=Math.min(a.length-1,r+1),l=a[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;k(e,a[r].data,o),this.triggerOnChange(e,t)}}else if(s===i.Keys.backspace){const e=this.value;if(d)k(e,a[r].data,o),this.triggerOnChange(e,t);else if(!d&&a.length){const s=a.pop();k(e,s.data,o),this.triggerOnChange(e,t)}}}else l=a[a.length-1];else l=a[0];l!==n&&(t.data.focusedTag=l,t.data.activedescendant=me.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=F(this.props),{focusedIndex:n}=t||this.getFocusedState();void 0!==i[n-(s?s.skip:0)]&&this.handleItemClick(n,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:n,textField:a,focusedItemIndex:o=x,skipDisabledItems:l}=this.props,r=F(this.props),d=n&&n.skip||0;let u;if(void 0!==e)return{focusedIndex:e,focusedItem:r[e-d],focusedType:1};const p=this.value;if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return u=o(r,t,a),{focusedItem:r[u],focusedIndex:u+d,focusedType:1};if(p.length){const e=p[p.length-1];return u=r.findIndex((t=>w(t,e,i))),void 0!==r[u]?{focusedIndex:u+d,focusedItem:r[u],focusedType:1}:{focusedType:0,focusedIndex:-1}}if(l&&a&&!t&&0===d){const e=r.findIndex((e=>!e.disabled&&e[a]));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}};Ce.displayName="MultiSelect",Ce.propTypes={...$.propTypes,autoClose:s.bool,value:s.arrayOf(s.any),defaultValue:s.arrayOf(s.any),dataItemKey:s.string,placeholder:s.string,tags:s.arrayOf(s.shape({text:s.string,data:s.arrayOf(s.any)})),tagRender:s.func,id:s.string,ariaLabelledBy:s.string,ariaDescribedBy:s.string,groupField:s.string,list:s.any,adaptive:s.bool,adaptiveTitle:s.string,onCancel:s.func,skipDisabledItems:s.bool},Ce.defaultProps={...$.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};let Ie=Ce;const ke=i.createPropsContext(),we=i.withIdHOC(i.withPropsContext(ke,Ie));we.displayName="KendoReactMultiSelect";const Se=e=>h.createElement(V,{...e,wrapperCssClass:"k-table-body k-table-scroller",listClassName:i.classNames("k-table k-table-list",{"k-virtual-table":void 0!==e.virtual}),listStyle:{...e.listStyle}}),Ee=i.createPropsContext(),De=h.forwardRef(((e,t)=>{const s=i.usePropsContext(Ee,e),n=h.useRef(null),a=h.useRef(null),o=i.getScrollbarWidth(),{columns:l=Ke.columns,popupSettings:r=Ke.popupSettings,size:d=Ke.size,rounded:u=Ke.rounded,fillMode:p=Ke.fillMode,className:c,prefix:g,suffix:m,onOpen:v,onClose:f,onFocus:y,onBlur:b,onChange:x,onFilterChange:C,onPageChange:k,...w}=s;h.useImperativeHandle(n,(()=>({element:a.current&&a.current.element,focus(){a.current&&a.current.focus()},get value(){return a.current&&a.current.value},get name(){return a.current&&a.current.name},props:s}))),h.useImperativeHandle(t,(()=>n.current));const S=h.useMemo((()=>{if(void 0!==s.groupField&&s.data)return I(s.data[0],s.groupField)}),[s.data,s.groupField]),[E,D]=h.useState(S),[F,K]=h.useState(!0),[N]=g?te(s.prefix||h.Fragment):[],[M]=m?te(s.suffix||h.Fragment):[],T=h.useMemo((()=>{const e=h.createElement("th",{className:"k-table-th",colSpan:l.length},E);return h.createElement(h.Fragment,null,s.header,h.createElement("div",{className:"k-table-header-wrap"},h.createElement("table",{className:"k-table",role:"presentation"},h.createElement("colgroup",null,l.map(((e,t)=>h.createElement("col",{key:e.uniqueKey?e.uniqueKey:t,style:{width:e.width?e.width:Ke.width}})))),h.createElement("thead",{className:"k-table-thead"},h.createElement("tr",{className:"k-table-row"},l.map(((e,t)=>h.createElement("th",{className:"k-table-th",key:e.uniqueKey?e.uniqueKey:t},e.header||" ")))),E&&F&&h.createElement("tr",{className:"k-table-group-row"},s.groupStickyHeaderItemRender?s.groupStickyHeaderItemRender.call(void 0,e,{}):e)))))}),[s.header,l,E,F]),P=h.useMemo((()=>`calc(${l.map((e=>((e,t)=>e?"number"==typeof e?e+"px":e:t)(e.width,Ke.width))).filter(Boolean).join(" + ")} + ${o}px + 4px)`),[l,o]),B=s.virtual?s.virtual.skip:0,R=h.useCallback(((e,t)=>{const n=l.map(((e,n)=>h.createElement("span",{className:s.itemRender?void 0:"k-table-td",style:s.itemRender?void 0:{width:e.width?e.width:Ke.width},key:e.uniqueKey?e.uniqueKey:n},e.field?String(i.getter(e.field)(t.dataItem)):"")));let a,o,r,d,u=s.data||[];const p=t.index-B;void 0!==s.groupField&&(d=i.getter(s.groupField),o=d(u[p]),r=d(u[p-1]),o&&r&&o!==r&&(a=o)),a&&"classic"===s.groupMode&&n.push(h.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},h.createElement("span",null,a)));const c=h.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":!!a,"k-disabled":t.dataItem.disabled})},n);return s.itemRender?s.itemRender.call(void 0,c,t):c}),[l,s.groupField,s.itemRender,s.data,B]),O=h.useCallback(((e,t)=>{e&&e.call(void 0,{...t,target:n.current})}),[]),L=h.useCallback((e=>(s.virtual||D(S),O(v,e))),[O,v,s.virtual,S]),z=h.useCallback((e=>O(f,e)),[f]),H=h.useCallback((e=>O(y,e)),[y]),_=h.useCallback((e=>O(b,e)),[b]),V=h.useCallback((e=>O(x,e)),[x]),q=h.useCallback((e=>O(k,e)),[k]),A=h.useCallback((e=>(D(S),O(C,{...e,mobileMode:e.target.mobileMode}))),[C]),W=h.useCallback((e=>{D(e.group)}),[]);h.useEffect((()=>{i.setScrollbarWidth()})),h.useEffect((()=>{const e=s.data;D(S),e&&0!==e.length?K(!0):K(!1)}),[s.data]);const U=h.useCallback((e=>h.createElement(Se,{...e})),[]);return h.createElement(ae,{...w,list:U,popupSettings:{...r,popupClass:i.classNames("k-dropdowngrid-popup",r.popupClass),width:r.width||P,className:r.className},ref:a,header:T,itemRender:R,groupHeaderItemRender:s.groupHeaderItemRender,size:d,rounded:u,fillMode:p,groupMode:s.groupMode,groupField:s.groupField,isMultiColumn:!0,onOpen:L,onClose:z,onFocus:H,onBlur:_,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})})),Fe={...ie.propTypes,columns:s.any.isRequired},Ke={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};function Ne(e){return"string"==typeof e?Number(e.replace("px","")):e||void 0}function Me(e,t,s,i){const n=Ne(t.popupSettings.width),a=(void 0!==s.width&&Ne(s.width))!==n,o=void 0!==i.width,l=a?s.width:o?i.width:n,r=Ne(function(e,t,s){const[i,n]=h.useState(t);return h.useEffect((()=>{void 0!==i&&e.current&&n(e.current.offsetWidth)}),s),i}(e,l));return a||o?l:r&&n&&r>n?r:n}De.displayName="KendoMultiColumnComboBox",De.propTypes=Fe;const Te=e=>h.createElement("div",{className:"k-nodata"},h.createElement("div",null,e.children)),{sizeMap:Pe,roundedMap:Be}=i.kendoThemeMaps,Re=e=>h.createElement("span",{className:"k-input-value-text"},e.children),Oe=e=>e.split("_").map((e=>parseInt(e,10))),Le={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},ze=i.createPropsContext(),He=h.forwardRef(((e,t)=>{i.validatePackage(G);const s=i.usePropsContext(ze,e),l={...Le,...s},c=i.useId(),g=l.id||c,{data:v,dataItemKey:y,popupSettings:b={},style:x,opened:C,disabled:k,onOpen:S=i.noop,onClose:E=i.noop,placeholder:D,label:F,name:K,selectField:N,subItemsField:M,validationMessage:T,valid:R,required:O,validityStyles:L}=l,z=i.getTabIndex(l.tabIndex,k),H=h.useRef(null),V=h.useRef(null),q=h.useRef(null),A=h.useRef(null),W=h.useRef(null),U=h.useRef(null),$=h.useRef(!1),[j,J]=h.useState(void 0),Q=void 0!==l.value,X=Q?l.value:void 0!==j?j:l.defaultValue,Z=f(X),ee=Z?I(X,l.textField):"",te=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:T,valid:R,required:O},Z),se=h.useCallback((()=>V.current&&V.current.focus()),[]);h.useImperativeHandle(H,(()=>({props:l,element:V.current,focus:se}))),h.useImperativeHandle(t,(()=>H.current));const ie=i.useRtl(V,l.dir),ne={width:Me(V,Le,{...Le.popupSettings,...b},x),...void 0!==ie?{direction:ie}:{}},[ae,oe]=h.useState(!1),le=void 0!==C?C:ae,[re,de]=h.useState(!1),[ue,pe]=h.useState(),ce=!!(ue&&ue<=Y&&l.adaptive),[he,ge]=h.useState(""),me=h.useCallback((()=>{W.current&&W.current.setCustomValidity&&W.current.setCustomValidity(te.valid?"":void 0===T?"Please select a value from the list!":T)}),[T,te]);h.useEffect(me),h.useEffect((()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(qe.bind(void 0));return null!=document&&document.body&&e&&e.observe(document.body),()=>{null!=document&&document.body&&e&&e.disconnect()}}),[]);const fe=h.useCallback((e=>{if(!le){if(S){const t={...e};S.call(void 0,t)}void 0===C&&oe(!0)}}),[le,C,S]),ye=h.useCallback((e=>{if(le){if(E){const t={...e};E.call(void 0,t)}void 0===C&&(oe(!1),ce&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300))}}),[le,C,E,ce]),be=h.useCallback((e=>{if(!e.isDefaultPrevented()&&H.current){de(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};(le?ye:fe)(t)}}),[le,C,S,E]),xe=h.useCallback((e=>{$.current=!0,e(),window.setTimeout((()=>$.current=!1),0)}),[]),Ce=h.useCallback((e=>{var t,s;const{keyCode:n,altKey:a}=e,o=U.current&&U.current.element;if(!H.current||e.isDefaultPrevented()&&(null==(t=q.current)?void 0:t.element)===e.target)return;const l={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};if(le)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),ye(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===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 xe((()=>{var e;ke(null==(e=q.current)?void 0:e.element)}))}xe(i.noop)}else n===i.Keys.down&&xe((()=>{var e;ke((null==(e=q.current)?void 0:e.element)||o)}));else a&&n===i.Keys.down?(e.preventDefault(),fe(l)):le||n===i.Keys.esc&&He(e)}),[le,C,S,E]),Ie=h.useCallback((e=>{const{keyCode:t,altKey:s}=e;s||t!==i.Keys.up&&t!==i.Keys.down||(e.preventDefault(),xe(t===i.Keys.up?()=>{ke(V.current)}:()=>{ke(U.current&&U.current.element)}))}),[]),ke=h.useCallback((e=>{e&&xe((()=>e.focus()))}),[]),we=h.useCallback((()=>{var e;re||!le||C?s.filterable?ke(null==(e=q.current)?void 0:e.element):ke(U.current&&U.current.element):ye({target:H.current})}),[E,s.filterable,re,C,le]),Se=h.useCallback((()=>{re&&ke(V.current)}),[re]),Ee=h.useCallback((e=>{if(!re&&!$.current&&(de(!0),s.onFocus&&H.current)){const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};s.onFocus.call(void 0,t)}}),[re,s.onFocus]),De=h.useCallback((e=>{if(re&&!$.current&&H.current){de(!1);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};if(s.onBlur){const e={...t};s.onBlur.call(void 0,e)}ce||ye(t)}}),[re,s.onBlur,le,C,E]),Fe=h.useCallback((()=>{re&&xe(i.noop),ce&&setTimeout((()=>{var e;ke(null==(e=A.current)?void 0:e.element)}),300)}),[re,ce]),Ke=h.useCallback(((e,t,i)=>{if(s.onChange){const n={value:t,level:i?Oe(i):[],...e};s.onChange.call(void 0,n)}Q||J(t)}),[s.onChange,Q]),Ne=h.useCallback((e=>{if(w(e.item,X,y)||!H.current)return;const{item:t,itemHierarchicalIndex:s,nativeEvent:i,syntheticEvent:n}=e,a={syntheticEvent:n,nativeEvent:i,target:H.current};Ke(a,t,s),ye(a)}),[Q,X,s.onChange,y,le,C,E]),He=h.useCallback((e=>{if(!H.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:H.current};Ke(t,null),ye(t),e.preventDefault()}),[Q,s.onChange,le,C,E]),_e=h.useCallback((e=>{if(e.syntheticEvent.stopPropagation(),s.onExpandChange&&H.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:n,syntheticEvent:a}=e,o={level:Oe(i),item:t,nativeEvent:n,syntheticEvent:a,target:H.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),Ve=h.useCallback((e=>{if(s.onFilterChange&&H.current){const t={filter:{field:s.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:H.current};s.onFilterChange.call(void 0,t),void 0===s.filter&&ge(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),qe=h.useCallback((e=>{for(const t of e)pe(t.target.clientWidth)}),[]),Ae=h.useMemo((()=>Q||!Z?v:i.mapTree(v,M,(e=>i.extendDataItem(e,M,{[N]:w(e,X,y)})))),[v,X,Q,Z,N,M]),We=l.listNoData||Te,Ue=l.valueHolder||Re,$e=r.useLocalization(),Ge=!L||te.valid,{size:je,rounded:Ye,fillMode:Je}=l,Qe=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-dropdowntree k-picker",l.className,{[`k-picker-${Pe[je]||je}`]:je,[`k-rounded-${Be[Ye]||Ye}`]:Ye,[`k-picker-${Je}`]:Je,"k-focus":re,"k-invalid":!Ge,"k-loading":l.loading,"k-required":O,"k-disabled":l.disabled}),tabIndex:z,accessKey:l.accessKey,id:g,style:F?{...x,width:void 0}:x,dir:ie,ref:V,onKeyDown:k?void 0:Ce,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":O},h.createElement("span",{className:"k-input-inner"},(ee||D)&&h.createElement(Ue,{item:X},ee||D)),l.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Z&&!k&&h.createElement("span",{onClick:He,className:"k-clear-value",title:$e.toLanguageString(B,_[B]),role:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault()},h.createElement(i.IconWrap,{name:"x",icon:a.xIcon})),h.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:a.caretAltDownIcon}),h.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%"}},h.createElement("option",{value:l.valueMap?l.valueMap.call(void 0,X):X})),!ce&&h.createElement(o.Popup,{...b,className:i.classNames(b.className,{"k-rtl":"rtl"===ie}),popupClass:i.classNames(b.popupClass,"k-dropdowntree-popup k-list-container"),style:ne,anchor:b.anchor||V.current,show:le,onOpen:we,onClose:Se},l.filterable&&h.createElement(m,{value:void 0===l.filter?he:l.filter,ref:q,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),v.length>0?h.createElement(p.TreeView,{style:{height:b.height},ref:U,tabIndex:z,data:Ae,focusIdField:y,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:_e,size:je,item:l.item,dir:ie,animate:b.animate}):h.createElement(We,null,$e.toLanguageString(P,_[P])))),ce&&(()=>{const e=l.filterable?h.createElement(m,{value:void 0===l.filter?he:l.filter,ref:A,onChange:Ve,onKeyDown:Ie,size:je,rounded:Ye,fillMode:Je}):null,t={adaptiveTitle:l.adaptiveTitle,expand:le,onClose:e=>ye(e),windowWidth:ue,mobileFilter:e};return h.createElement(ve,{...t},h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.createElement("div",{className:"k-list-container"},h.createElement("div",{className:"k-list k-list-lg"},v.length>0?h.createElement(p.TreeView,{ref:U,tabIndex:z,data:Ae,focusIdField:y,textField:l.textField,selectField:N,expandField:l.expandField,childrenField:M,expandIcons:!0,onItemClick:Ne,onExpandChange:_e,size:je,item:l.item,dir:ie,animate:b.animate}):h.createElement(We,null,$e.toLanguageString(P,_[P]))))))})());return F?h.createElement(n.FloatingLabel,{label:F,editorValue:ee,editorPlaceholder:D,editorValid:Ge,editorDisabled:k,editorId:g,style:{width:x?x.width:void 0},children:Qe,dir:ie}):Qe})),_e={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};He.displayName="KendoReactDropDownTree",He.propTypes=_e;const{sizeMap:Ve,roundedMap:qe}=i.kendoThemeMaps,Ae=e=>e.split("_").map((e=>parseInt(e,10))),We={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Ue=i.createPropsContext(),$e=h.forwardRef(((e,t)=>{const s=i.usePropsContext(Ue,e);i.validatePackage(G);const a=i.useId(),l=s.id||a,{data:d=[],dataItemKey:c,style:g={},placeholder:v,label:f,name:y,validationMessage:b,valid:x,tags:C,value:k,opened:S,disabled:E,popupSettings:F=We.popupSettings,checkField:K=We.checkField,checkIndeterminateField:N=We.checkIndeterminateField,subItemsField:M=We.subItemsField,size:T=We.size,rounded:B=We.rounded,fillMode:R=We.fillMode,required:O=We.required,validityStyles:L=We.validityStyles,onOpen:V=i.noop,onClose:q=i.noop}=s,A=i.getTabIndex(s.tabIndex,E),W=h.useRef(null),U=h.useRef(null),$=h.useRef(null),j=h.useRef(null),J=h.useRef(null),Q=h.useRef(null),X=h.useRef(!1),Z=h.useRef([]),te=h.useRef(null),[se,ie]=h.useState(),[ne,ae]=h.useState(!1),[oe,le]=h.useState(!1),[re,de]=h.useState(),[ue,pe]=h.useState([]),[ce,he]=h.useState(""),me=!!(re&&re<=Y&&s.adaptive),fe=void 0!==S?S:ne,ye=!(!Array.isArray(k)||!k.length),be=((e,t)=>{const{validationMessage:s,valid:i,required:n}=e;return{customError:void 0!==s,valid:!!(void 0!==i?i:!n||t),valueMissing:!t}})({validationMessage:b,valid:x,required:O},ye),xe=i.useRtl(U,s.dir),Ce={width:Me(U,We,F,g),...void 0!==xe?{direction:xe}:{}},Ie=h.useCallback((()=>U.current&&U.current.focus()),[]);Z.current=void 0===C?(k||[]).map((e=>({text:I(e,s.textField),data:[e]}))):[...C],h.useImperativeHandle(W,(()=>({props:s,element:U.current,focus:Ie}))),h.useImperativeHandle(t,(()=>W.current));const ke=h.useCallback((()=>{J.current&&J.current.setCustomValidity&&J.current.setCustomValidity(be.valid?"":void 0===b?"Please select a value from the list!":b)}),[b,be]);h.useEffect(ke),h.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()}}),[]),h.useEffect((()=>{te.current&&fe&&te.current.setPosition(te.current.element)}),[k,fe]);const we=h.useCallback(((e,t,i)=>{if(s.onChange){const n={items:t,operation:i,...e};s.onChange.call(void 0,n)}}),[s.onChange]),Se=h.useCallback((e=>{if(w(e.item,k,c)||!W.current)return;const{item:t,nativeEvent:s,syntheticEvent:i}=e,n={syntheticEvent:i,nativeEvent:s,target:W.current};we(n,[t],"toggle")}),[k,c,we]),Ee=h.useCallback((e=>{if(!fe){if(V){const t={...e};V.call(void 0,t)}void 0===S&&(ae(!0),pe(k||[]),me&&setTimeout((()=>{var e;Ke(null==(e=j.current)?void 0:e.element)}),300))}}),[fe,S,V,me,j]),De=h.useCallback((e=>{if(fe){if(q){const t={...e};q.call(void 0,t)}void 0===S&&ae(!1)}}),[fe,S,q]),Fe=h.useCallback((e=>{X.current=!0,e(),window.setTimeout((()=>X.current=!1),0)}),[]),Ke=h.useCallback((e=>{e&&Fe((()=>e.focus()))}),[Fe]),Ne=h.useCallback((()=>{var e;!oe&&fe?De({target:W.current}):s.filterable?Ke(null==(e=$.current)?void 0:e.element):Ke(Q.current&&Q.current.element)}),[oe,fe,Ke,De,s.filterable]),Pe=h.useCallback((()=>{oe&&Ke(U.current)}),[oe,Ke]),Be=h.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]),Re=h.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)}me||De(t)}}),[oe,s.onBlur,fe,S,q]),Oe=h.useCallback((()=>{oe&&Fe(i.noop)}),[oe,Fe]),Le=h.useCallback((e=>{if(!e.isDefaultPrevented()&&W.current){le(!0);const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};fe||Ee(t)}}),[fe,Ee]),ze=h.useCallback((e=>{var t,s;const{keyCode:n,altKey:a}=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&&(n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end||n===i.Keys.delete)){const e=Z.current;let t,s=se?e.findIndex((e=>D(e,se,c))):-1;const a=-1!==s;n===i.Keys.left?(s=a?Math.max(0,s-1):e.length-1,t=e[s]):n===i.Keys.right?s===e.length-1?t=void 0:a&&(s=Math.min(e.length-1,s+1),t=e[s]):n===i.Keys.home?t=e[0]:n===i.Keys.end?t=e[e.length-1]:n===i.Keys.delete&&a&&we(l,e[s].data,"delete"),t!==se&&ie(t)}if(fe)if(n===i.Keys.esc||a&&n===i.Keys.up)e.preventDefault(),De(l);else if(o&&o.querySelector(".k-focus")&&(n===i.Keys.up||n===i.Keys.down||n===i.Keys.left||n===i.Keys.right||n===i.Keys.home||n===i.Keys.end)){if(n===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 n===i.Keys.down&&Fe((()=>{var e;Ke((null==(e=$.current)?void 0:e.element)||o)}));else a&&n===i.Keys.down&&(e.preventDefault(),Ee(l))}),[fe,De,Ke,Fe,Ee,se,c,k,we]),He=h.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]),_e=h.useCallback((e=>{if(!W.current)return;const t={syntheticEvent:e,nativeEvent:e.nativeEvent,target:W.current};we(t,[],"clear"),De(t),e.preventDefault()}),[we,De]),$e=h.useCallback(((e,t)=>{var s;De({target:W.current}),oe||Ke(null==(s=$.current)?void 0:s.element),we({syntheticEvent:t,nativeEvent:t.nativeEvent,target:W.current},e,"delete")}),[we,De,Ke,oe]),Ge=h.useCallback((e=>{if(s.onExpandChange&&W.current){const{item:t,itemHierarchicalIndex:i,nativeEvent:n,syntheticEvent:a}=e,o={level:Ae(i),item:t,nativeEvent:n,syntheticEvent:a,target:W.current};s.onExpandChange.call(void 0,o)}}),[s.onExpandChange]),je=h.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&&he(e.target.value)}}),[s.onFilterChange,s.filter,s.textField]),Ye=h.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=h.useCallback((e=>{for(const t of e)de(t.target.clientWidth)}),[]),Qe=s.listNoData||Te,Xe=r.useLocalization(),Ze=!L||be.valid,et=me&&fe?ue:Z.current,tt=h.createElement(h.Fragment,null,h.createElement("span",{className:i.classNames("k-multiselecttree k-input",s.className,{[`k-input-${Ve[T]||T}`]:T,[`k-rounded-${qe[B]||B}`]:B,[`k-input-${R}`]:R,"k-focus":oe&&!E,"k-invalid":!Ze,"k-disabled":E,"k-loading":s.loading,"k-required":O}),tabIndex:A,accessKey:s.accessKey,id:l,style:f?{...g,width:void 0}:g,dir:xe,ref:U,onKeyDown:E?void 0:ze,onMouseDown:Oe,onFocus:Be,onBlur:Re,role:"combobox","aria-haspopup":"tree","aria-expanded":fe,"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:Le},h.createElement("div",{id:"tagslist-"+l,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ve[T]||T}`]:T})},et.length>0&&h.createElement(ge,{tag:s.tag,onTagDelete:$e,data:et,guid:l,focused:se?Z.current.find((e=>D(e,se,c))):void 0,size:T})),h.createElement("span",{className:"k-input-inner"},0===et.length&&h.createElement("span",{className:"k-input-value-text"},v)),s.loading&&h.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ye&&!E&&et.length>0&&h.createElement(ee,{onClick:_e}),h.createElement("select",{name:y,ref:J,tabIndex:-1,"aria-hidden":!0,title:f,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},h.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,k):k})),!me&&h.createElement(o.Popup,{...F,popupClass:i.classNames(F.popupClass,"k-multiselecttree-popup"),className:i.classNames(F.className,{"k-rtl":"rtl"===xe}),style:Ce,anchor:F.anchor||U.current,show:fe,onOpen:Ne,onClose:Pe,ref:te},s.filterable&&h.createElement(m,{value:void 0===s.filter?ce:s.filter,ref:$,onChange:je,onKeyDown:He,tabIndex:A,size:T,rounded:B,fillMode:R,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),d.length>0?h.createElement(p.TreeView,{style:{height:F.height},ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:Se,onCheckChange:Se,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:xe}):h.createElement(Qe,null,Xe.toLanguageString(P,_[P])))),me&&(()=>{const e=s.filterable?h.createElement(m,{value:void 0===s.filter?ce:s.filter,ref:j,onChange:je,onKeyDown:He,size:T,rounded:B,fillMode:R}):null,t={adaptiveTitle:s.adaptiveTitle,expand:fe,onClose:e=>s.onCancel?Ye(e):_e(e),windowWidth:re,mobileFilter:e,footer:{cancelText:Xe.toLanguageString(H,_[H]),onCancel:e=>s.onCancel?Ye(e):_e(e),applyText:Xe.toLanguageString(z,_[z]),onApply:e=>De(e)}};return h.createElement(ve,{...t},h.createElement(u.ActionSheetContent,{overflowHidden:!0},h.createElement("div",{className:"k-list-container"},h.createElement("div",{className:"k-list k-list-lg"},d.length>0?h.createElement(p.TreeView,{ref:Q,tabIndex:A,data:d,focusIdField:c,textField:s.textField,checkField:K,checkIndeterminateField:N,expandField:s.expandField,childrenField:M,expandIcons:!0,onItemClick:Se,onCheckChange:Se,onExpandChange:Ge,checkboxes:!0,size:T,item:s.item,dir:xe}):h.createElement(Qe,null,Xe.toLanguageString(P,_[P]))))))})());return f?h.createElement(n.FloatingLabel,{label:f,editorValue:ye,editorPlaceholder:v,editorValid:Ze,editorDisabled:E,editorId:l,style:{width:g?g.width:void 0},children:tt,dir:xe}):tt})),Ge={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};$e.displayName="KendoReactMultiSelectTree",$e.propTypes=Ge;const je=(e,t)=>{const s={};return e&&e.length&&e.forEach((e=>{s[t(e)]=!0})),s};e.AutoComplete=pe,e.AutoCompletePropsContext=ue,e.AutoCompleteWithoutContext=de,e.ComboBox=ae,e.ComboBoxPropsContext=ne,e.ComboBoxWithoutContext=ie,e.DropDownList=J,e.DropDownListPropsContext=X,e.DropDownTree=He,e.DropDownTreePropsContext=ze,e.List=V,e.ListContainer=g,e.ListFilter=m,e.ListItem=M,e.MultiColumnComboBox=De,e.MultiColumnComboBoxPropsContext=Ee,e.MultiSelect=we,e.MultiSelectPropsContext=ke,e.MultiSelectTree=$e,e.MultiSelectTreePropsContext=Ue,e.MultiSelectWithoutContext=Ie,e.SearchBar=Z,e.TagList=ge,e.dropDownListDefaultProps=Q,e.dropdownsMessages=_,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:n,value:a,subItemsField:o="items",operation:l}=t,r=i.getter(n),d=je(a,r);if("clear"===l)return[];if("delete"===l){const e=je(s,r);return a.filter((t=>!e[r(t)]))}const u=s[0],p=r(u),c=i.getter(o),h=[...e],g=[];let m,v=[];for(;h.length;){const e=h.pop();if(p===r(e)){v=g.map((e=>e.item)),m=e;break}{g&&g.length&&g[g.length-1].parentPosition===h.length&&g.pop();const t=c(e);t&&t.length&&(g.push({item:e,parentPosition:h.length}),h.push(...t))}}const f=[...c(m)||[]],y=[];for(;f.length;){const e=f.pop();y.push(e);const t=c(e);t&&t.length&&f.push(...t)}const b=[];if(!d[p]){b.push(...a),b.push(m),b.push(...y.filter((e=>!d[r(e)])));const e=v.filter((e=>!d[r(e)])),t=je(b,r);for(let s=e.length-1;s>-1;s--){const i=e[s],n=c(i);if(n.filter((e=>t[r(e)])).length<n.length)break;b.push(i),t[r(i)]=!0}}else{const e=r(m),t=je(y,r),s=je(v,r);b.push(...a.filter((i=>{const n=r(i);return!t[n]&&e!==n&&!s[n]})))}return b},e.getValueMap=je,e.nodata=P,e.scrollToItem=b}));
|
package/index.d.mts
CHANGED
|
@@ -1403,6 +1403,14 @@ export declare interface DropDownListHandle {
|
|
|
1403
1403
|
* The value of the DropDownList.
|
|
1404
1404
|
*/
|
|
1405
1405
|
value: any;
|
|
1406
|
+
/**
|
|
1407
|
+
* The focused state of the DropDownList.
|
|
1408
|
+
*/
|
|
1409
|
+
focused: boolean;
|
|
1410
|
+
/**
|
|
1411
|
+
* The opened state of the DropDownList.
|
|
1412
|
+
*/
|
|
1413
|
+
opened: boolean;
|
|
1406
1414
|
/**
|
|
1407
1415
|
* The props of the DropDownList component
|
|
1408
1416
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1403,6 +1403,14 @@ export declare interface DropDownListHandle {
|
|
|
1403
1403
|
* The value of the DropDownList.
|
|
1404
1404
|
*/
|
|
1405
1405
|
value: any;
|
|
1406
|
+
/**
|
|
1407
|
+
* The focused state of the DropDownList.
|
|
1408
|
+
*/
|
|
1409
|
+
focused: boolean;
|
|
1410
|
+
/**
|
|
1411
|
+
* The opened state of the DropDownList.
|
|
1412
|
+
*/
|
|
1413
|
+
opened: boolean;
|
|
1406
1414
|
/**
|
|
1407
1415
|
* The props of the DropDownList component
|
|
1408
1416
|
*/
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-dropdowns",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1732012099,
|
|
14
14
|
version: "",
|
|
15
15
|
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"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dropdowns",
|
|
3
|
-
"version": "9.1.0-develop.
|
|
3
|
+
"version": "9.1.0-develop.4",
|
|
4
4
|
"description": "React DropDowns offer an interface for users to select different items from a list and more. KendoReact Dropdowns package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
|
-
"@progress/kendo-react-buttons": "9.1.0-develop.
|
|
27
|
-
"@progress/kendo-react-common": "9.1.0-develop.
|
|
28
|
-
"@progress/kendo-react-inputs": "9.1.0-develop.
|
|
29
|
-
"@progress/kendo-react-intl": "9.1.0-develop.
|
|
30
|
-
"@progress/kendo-react-labels": "9.1.0-develop.
|
|
31
|
-
"@progress/kendo-react-layout": "9.1.0-develop.
|
|
32
|
-
"@progress/kendo-react-popup": "9.1.0-develop.
|
|
33
|
-
"@progress/kendo-react-treeview": "9.1.0-develop.
|
|
26
|
+
"@progress/kendo-react-buttons": "9.1.0-develop.4",
|
|
27
|
+
"@progress/kendo-react-common": "9.1.0-develop.4",
|
|
28
|
+
"@progress/kendo-react-inputs": "9.1.0-develop.4",
|
|
29
|
+
"@progress/kendo-react-intl": "9.1.0-develop.4",
|
|
30
|
+
"@progress/kendo-react-labels": "9.1.0-develop.4",
|
|
31
|
+
"@progress/kendo-react-layout": "9.1.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-popup": "9.1.0-develop.4",
|
|
33
|
+
"@progress/kendo-react-treeview": "9.1.0-develop.4",
|
|
34
34
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
35
35
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
36
36
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|