@progress/kendo-react-dropdowns 15.1.0-develop.1 → 15.1.0-develop.3

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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $t=require("react"),L=require("prop-types"),o=require("@progress/kendo-react-common"),Rt=require("@progress/kendo-react-labels"),Yt=require("@progress/kendo-svg-icons"),Jt=require("../common/ListContainer.js"),Qt=require("../common/ListFilter.js"),ot=require("../common/GroupStickyHeader.js"),Xt=require("../common/ListDefaultItem.js"),Zt=require("../common/List.js"),at=require("../common/DropDownBase.js"),d=require("../common/utils.js"),st=require("../package-metadata.js"),en=require("@progress/kendo-react-buttons"),tn=require("@progress/kendo-react-intl"),M=require("../messages/index.js"),nn=require("@progress/kendo-react-layout"),rn=require("../common/AdaptiveMode.js");function on(q){const J=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(q){for(const z in q)if(z!=="default"){const ae=Object.getOwnPropertyDescriptor(q,z);Object.defineProperty(J,z,ae.get?ae:{enumerable:!0,get:()=>q[z]})}}return J.default=q,Object.freeze(J)}const a=on($t),sn="Please select a value from the list!",ve=a.forwardRef((q,J)=>{var nt;let z=!1;const ae=o.getLicenseMessage(st.packageMetadata),n=o.usePropsContext(it,q),{delay:lt=O.delay,tabIndex:dt=O.tabIndex,ignoreCase:Q=O.ignoreCase,size:A=O.size,rounded:Te=O.rounded,fillMode:ye=O.fillMode}=n;if(n.filterable||n.virtual){const e=[];n.filterable&&e.push("filterable"),n.virtual&&e.push("virtualization"),z=!o.validatePackage(st.packageMetadata,{component:"DropDownList",features:e})}const F=o.useUnstyled(),De=o.useId(n.id),he=()=>{var e;if(o.canUseDOM)return((e=N.current)==null?void 0:e.ownerDocument)||window.document},ct=()=>{var e,r;(e=t==null?void 0:t.current)!=null&&e.wrapper&&((r=t==null?void 0:t.current)==null||r.wrapper.focus({preventScroll:!0}))},k=()=>{let e;return H.current!==void 0&&H.current!==null?e=H.current:n.value!==void 0?e=n.value:v.value!==void 0&&v.value!==null?e=v.value:n.defaultValue!==void 0&&n.defaultValue!==null&&(e=n.defaultValue),!d.isPresent(e)&&n.defaultItem!==void 0&&n.defaultItem!==null&&(e=n.defaultItem),e},ut=()=>{const{dataItemKey:e}=n,r=d.getFilteredData(n),s=k();return r.findIndex(c=>d.areSame(c,s,e))},Ie=()=>n.required!==void 0?n.required:O.required,we=()=>{const e=n.validationMessage!==void 0,r=k(),s=!Ie()||r!==null&&r!==""&&r!==void 0,c=n.valid!==void 0?n.valid:s;return{customError:e,valid:c,valueMissing:r===null}},pt=()=>n.validityStyles!==void 0?n.validityStyles:O.validityStyles,ie=e=>{le.current=!0,e.focus(),window.setTimeout(()=>le.current=!1,30)},Se=()=>{Z.current&&ie(Z.current),n.adaptive&&setTimeout(()=>{Z.current&&ie(Z.current)},300)},mt=a.useCallback(e=>{for(const r of e)Mt(r.target.clientWidth)},[]),qe=()=>{var e;(e=be.current)!=null&&e.setCustomValidity&&be.current.setCustomValidity(we().valid?"":n.validationMessage||sn)},V=(e,r)=>{const s=k();d.areSame(s,e,n.dataItemKey)||(n.value===void 0&&(r.data.value=e),t.current.updateComponentArgs({value:e}),H.current=e,r.events.push({type:"onChange"}))},K=e=>{var r;(r=t==null?void 0:t.current)==null||r.applyState(e),H.current=void 0},X=(e,r)=>{var m;const{virtual:s,dataItemKey:c,defaultItem:l}=n,p=d.getFilteredData(n),f=s?s.skip:0,y=k(),u=e===-1&&l!==void 0?l:p[e-f],g=!d.areSame(u,y,c);V(u,r),g&&((m=t==null?void 0:t.current)==null||m.triggerPageChangeCornerItems(u,r))},B=(e,r,s)=>{var C,D;const{defaultItem:c,dataItemKey:l,virtual:p={skip:0,total:0,pageSize:0}}=n,f=k(),y=d.getFilteredData(n),u=(C=t==null?void 0:t.current)==null?void 0:C.vs,g=y.findIndex(h=>d.areSame(h,f,l)),m=(D=t==null?void 0:t.current)==null?void 0:D.navigation.navigate({current:p.skip+g,max:(u!=null&&u.enabled?p.total:y.length)-1,min:c!==void 0?-1:0,keyCode:r,skipItems:s||void 0});m!==void 0&&X(m,e),K(e)},gt=e=>{N.current=e,t.current.wrapper=e},ft=e=>a.createElement("select",{name:n.name,ref:r=>{be.current=r},tabIndex:-1,"aria-hidden":!0,title:n.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:n.valueMap?n.valueMap.call(void 0,e):e})),xe=()=>{const{textField:e,dataItemKey:r,virtual:s={skip:0},focusedItemIndex:c=d.itemIndexStartsWith,filterable:l,skipDisabledItems:p=!0}=n,f=k(),y=d.getFilteredData(n),u=n.filter?n.filter:v.text;return p&&e&&!u&&!f?y.findIndex(g=>!g.disabled):d.isPresent(f)&&u===void 0||l&&u===""?y.findIndex(g=>d.areSame(g,f,r)):u?Ke.current?c(y,u,e):y.findIndex(g=>d.areSame(g,f,r)):s.skip===0?0:-1},ze=(e,r)=>r!==void 0&&r!==-1&&e&&e.length>0&&e[r].disabled,Ce=()=>{const e=d.getFilteredData(n),r=t.current.initState(),s=xe();ze(e,s)&&(V(null,r),K(r))},Le=e=>{if(e.isPropagationStopped())return;const r=t.current.initState();r.syntheticEvent=e,v.focused||(r.data.focused=!0),Ce(),t.current.togglePopup(r),K(r)},Ae=e=>{var se,E,G,j,fe,Y,rt;e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:r,disabled:s,defaultItem:c,leftRightKeysNavigation:l=!0,virtual:p={skip:0,total:0,pageSize:0},dataItemKey:f,groupField:y="",textField:u,skipDisabledItems:g=!0}=n,m=d.getFilteredData(n),C=k(),D=m.findIndex(w=>d.areSame(w,C,f)),h=n.opened!==void 0?n.opened:v.opened,i=e.keyCode,P=i===o.Keys.home||i===o.Keys.end,b=i===o.Keys.up||i===o.Keys.down,R=!h&&(e.altKey&&i===o.Keys.down||i===o.Keys.enter||i===o.Keys.space),oe=h&&(e.altKey&&i===o.Keys.up||i===o.Keys.esc),me=l&&(i===o.Keys.left||i===o.Keys.right),ge=b||me&&!r||P,I=t.current.initState();if(I.syntheticEvent=e,!s){if(P&&((se=t==null?void 0:t.current)!=null&&se.vs.enabled))i===o.Keys.home?p.skip!==0?((E=t==null?void 0:t.current)==null||E.triggerOnPageChange(I,0,p.pageSize),W.current=!0):V(m[0],I):p.skip<p.total-p.pageSize?((G=t==null?void 0:t.current)==null||G.triggerOnPageChange(I,p.total-p.pageSize,p.pageSize),W.current=!0):V(m[m.length-1],I);else if(h&&i===o.Keys.pageUp)e.preventDefault(),(j=t==null?void 0:t.current)==null||j.scrollPopupByPageSize(-1);else if(h&&i===o.Keys.pageDown)e.preventDefault(),(fe=t==null?void 0:t.current)==null||fe.scrollPopupByPageSize(1);else if(h&&i===o.Keys.enter){const w=xe();ze(m,w)?(V(null,I),K(I)):X(w,I),(Y=t==null?void 0:t.current)==null||Y.togglePopup(I),e.preventDefault()}else if(R||oe)oe&&Ce(),(rt=t==null?void 0:t.current)==null||rt.togglePopup(I),e.preventDefault();else if(ge){if(Ke.current=!1,y!==""&&u)if(!g&&h)B(I,i);else{let w;if(i===o.Keys.down||i===o.Keys.right){const S=m.slice(D+1).find(x=>!x.disabled);w=S&&m.indexOf(S)}else if(i===o.Keys.up||i===o.Keys.left){let S;if(D===0&&c)w=-1;else if(D===-1)S=m,w=m.findIndex(x=>!x.disabled);else{S=m.slice(0,D);let x=S.pop();for(;x&&x.disabled;)x=S.pop();w=x&&m.indexOf(x)}}if(w!==void 0){const S=w-D;B(I,i,S)}else w===void 0&&D===m.length-1&&B(I,i)}else if(!g&&h||P)B(I,i);else if(u){let w;if(i===o.Keys.down||i===o.Keys.right){const S=m.slice(D+1).find(x=>!x.disabled);w=S&&m.indexOf(S)}else if(i===o.Keys.up||i===o.Keys.left){let S;if(D===0&&c)w=-1;else if(D===-1)S=m,w=m.findIndex(x=>!x.disabled);else{S=m.slice(0,D);let x=S.pop();for(;x&&x.disabled;)x=S.pop();w=x&&m.indexOf(x)}}if(w!==void 0){const S=w-D;B(I,i,S)}else w===void 0&&D===m.length-1&&B(I,i)}else B(I,i);e.preventDefault()}K(I)}},vt=e=>{const r=t.current.initState();r.syntheticEvent=e.syntheticEvent,n.filter===void 0&&(r.data.text=e.target.value),t.current.filterChanged(e.target.value,r),Ke.current=!0,K(r),te({group:void 0,text:String(e.target.value)})},Ve=e=>{const r=n.filter!==void 0?n.filter:v.text;return n.filterable&&a.createElement(Qt,{value:r,ref:s=>{Z.current=s&&s.element},onChange:vt,onKeyDown:Ae,size:e?"large":A,rounded:Te,fillMode:ye,renderListFilterWrapper:!0,placeholder:Ne.toLanguageString(M.dropDownListAdaptiveFilterPlaceholder,M.messages[M.dropDownListAdaptiveFilterPlaceholder])})},yt=e=>{var s;const r=t.current.initState();r.syntheticEvent=e,(s=t==null?void 0:t.current)==null||s.togglePopup(r),V(n.defaultItem,r),K(r)},Dt=()=>{const{textField:e,defaultItem:r,dataItemKey:s}=n,c=k();return r!==void 0&&a.createElement(Xt,{defaultItem:r,textField:e,selected:d.areSame(c,r,s),key:"defaultitemkey",onClick:yt})},ht=(e,r)=>{var s;(s=t==null?void 0:t.current)==null||s.handleItemClick(e,r),H.current=void 0},It=e=>{const{vs:r,list:s}=t.current;r.scrollHandler(e);const{groupField:c}=n;let l=d.getFilteredData(n);if(!(!c||!l.length)&&c){const p=We.current=We.current||(r.enabled?r.itemHeight:s?s.children[0].offsetHeight:0),y=e.target.scrollTop-r.skip*p;l=t.current.getGroupedDataModernMode(l,c);let u=l[0][c];for(let g=1;g<l.length&&!(p*g>y);g++)l[g]&&l[g][c]&&(u=l[g][c]);u!==v.group&&te({group:u})}},Be=()=>{var i;const{textField:e,dataItemKey:r,virtual:s={skip:0,total:void 0},groupHeaderItemRender:c,listNoDataRender:l,itemRender:p}=n,f=d.getFilteredData(n),y=F&&F.uDropDownList,u=t.current.vs,g=s.skip,m=n.opened!==void 0?n.opened:v.opened,C=t.current.getPopupSettings(),D=`translateY(${u.translate}px)`,h=k();return a.createElement(Zt,{id:je,show:m,data:f.slice(),focusedIndex:xe(),value:h,textField:e,valueField:r,optionsGuid:$e,groupField:n.groupField,ariaLabel:Ne.toLanguageString(M.listAriaLabel,M.messages[M.listAriaLabel]),listRef:P=>{u.list=t.current.list=P},wrapperStyle:{maxHeight:U?void 0:C.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:y})),listStyle:u.enabled?{transform:D}:void 0,key:"listkey",skip:g,onClick:ht,itemRender:p,groupHeaderItemRender:c,noDataRender:l,onScroll:It,wrapperRef:u.scrollerRef,scroller:(i=t==null?void 0:t.current)==null?void 0:i.renderScrollElement(),ariaSetSize:s.total})},wt=()=>{const{groupField:e}=n,r=d.getFilteredData(n),s=n.opened!==void 0?n.opened:v.opened,c=F&&F.uDropDownList,l={title:n.adaptiveTitle||n.label,subTitle:n.adaptiveSubtitle,expand:s,onClose:f=>Le(f),windowWidth:Fe,mobileFilter:Ve(!0)};let{group:p}=v;return p===void 0&&e!==void 0&&(p=d.getItemValue(r[0],e)),a.createElement(rn.AdaptiveMode,{...l},a.createElement(nn.ActionSheetContent,null,a.createElement("div",{className:o.classNames(o.uDropDownList.listContainer({c,popup:!1}))},Lt())))},St=()=>{v.focused&&window.setTimeout(()=>{v.focused&&t.current.wrapper&&ie(t.current.wrapper)})},xt=e=>{"onMouseDownOutside"in(n.popupSettings||{})&&n.popupSettings.onMouseDownOutside.call(void 0,e)},Ct=()=>{const{header:e,footer:r,dir:s,groupField:c,groupStickyHeaderItemRender:l,list:p}=n,f=d.getFilteredData(n),y=t.current,u=y.getPopupSettings(),g=n.opened!==void 0?n.opened:v.opened,m=u.width!==void 0?u.width:Pe!=null?Pe:y.popupWidth,C=F&&F.uDropDownList,D={dir:s!==void 0?s:y.dirCalculated,width:m,popupSettings:{...u,popupClass:o.classNames(u.popupClass,o.uDropDownList.listContainer({c:C,popup:!0})),anchor:u.anchor||N.current,show:g,onOpen:Se,onClose:St,onMouseDownOutside:xt},itemsCount:[f.length]};let{group:h}=v;return h===void 0&&c!==void 0&&(h=d.getItemValue(f[0],c)),a.createElement(Jt,{...D},Ve(!1),e&&a.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:C}))},e),a.createElement("div",{className:o.classNames(o.uDropDownList.list({c:C,size:A,virtual:t.current.vs.enabled}))},Dt(),!p&&h&&f.length!==0&&a.createElement(ot,{group:h,render:l}),Be()),r&&a.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:C}))},r),z&&a.createElement(o.WatermarkOverlay,{message:ae}))},Lt=()=>{const{header:e,footer:r,groupStickyHeaderItemRender:s,groupField:c,list:l}=n,p=d.getFilteredData(n),f=F&&F.uDropDownList;let{group:y}=v;return y===void 0&&c!==void 0&&(y=d.getItemValue(p[0],c)),a.createElement(a.Fragment,null,e&&a.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:f}))},e),a.createElement("div",{className:o.classNames("k-list",{[`k-list-${U?"lg":o.sizeMap[A]||A}`]:U||A})},!l&&y&&p.length!==0&&a.createElement(ot,{group:y,render:s}),Be()),r&&a.createElement("div",{className:"k-list-footer"},r))},kt=e=>{const{dataItemKey:r}=n,s=d.getFilteredData(n),c=k();let l=s.map((b,R)=>({item:b,itemIndex:R}));const p=$.current.word,f=$.current.last,y=d.sameCharsOnly(p,f);let u=l.length,g=Math.max(0,s.findIndex(b=>d.areSame(b,c,r))),m;n.defaultItem&&(m={item:n.defaultItem,itemIndex:-1},u+=1,g+=1),g+=y?1:0,l=d.shuffleData(l,g,m);let C,D,h,i=0;const{textField:P}=n;for(;i<u;){if(C=d.getItemValue(l[i].item,P),D=y&&d.matchText(C,f,Q),h=d.matchText(C,p,Q),D||h){i=l[i].itemIndex;break}i++}if(i!==u){const b=t.current.initState();b.syntheticEvent=e,X(i,b),K(b),H.current=void 0}},bt=e=>{clearTimeout(He.current),n.filterable||(He.current=window.setTimeout(()=>$.current.word="",lt),kt(e))},Kt=e=>{le.current||t.current.handleFocus(e)},Et=e=>{if(le.current||!v.focused)return;const r=n.opened!==void 0?n.opened:v.opened,s=t.current.initState();s.syntheticEvent=e,s.data.focused=!1,s.events.push({type:"onBlur"}),r&&Ce(),r&&!U&&t.current.togglePopup(s),K(s)},Ft=e=>{if(n.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let r=String.fromCharCode(e.charCode||e.keyCode);Q&&(r=r.toLowerCase()),r===" "&&e.preventDefault(),$.current={word:$.current.word+r,last:$.current.last+r},bt(e)},Pt=()=>{const e=t.current.initState();e.data.opened=v.opened,t.current.togglePopup(e),K(e)},ke=a.useRef(null),N=a.useRef(null),be=a.useRef(null),Z=a.useRef(null);a.useImperativeHandle(ke,()=>({get element(){return N.current},get index(){return ut()},get name(){return n.name},get validity(){return we()},get value(){return k()},get focused(){return v.focused},get opened(){return v.opened},focus:ct,props:n,togglePopup:Pt})),a.useImperativeHandle(J,()=>ke.current),o.useWebMcpRegister("dropdownlist",ke,n,n.webMcp);const He=a.useRef(null),$=a.useRef({word:"",last:""}),le=a.useRef(!1),H=a.useRef(null),W=a.useRef(!1),Ke=a.useRef(!1),_=a.useRef({}),Ee=a.useRef({}),t=a.useRef(new at({props:n,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),We=a.useRef(0),ee=a.useRef(null),[v,Nt]=a.useState({}),[Fe,Mt]=a.useState(),[,_e]=a.useReducer(e=>e,!0),[Pe,Ot]=a.useState(),Ne=tn.useLocalization(),Ue=n.name||n.id,Tt=a.useCallback(e=>{if(e==null||!t.current)return;const r=d.getFilteredData(n),{textField:s}=n,c=String(e),l=d.getItemIndexByText(r,c,s,!1,Q),p=l!==-1?r[l]:void 0;if(p!==void 0){const f=t.current.initState();f.syntheticEvent={target:N.current},V(p,f),K(f)}},[n,Q]);o.useKendoPaste(N,{fieldName:Ue,onValueChange:Tt,enabled:!!Ue});const te=e=>{Nt({...v,...e})};a.useEffect(()=>{t.current.updateComponentArgs({props:n,setState:te,state:v,forceUpdate:_e,element:N.current,handleItemSelect:X,value:k()})},[te,v,_e,X,k]),a.useEffect(()=>{var m,C,D,h,i,P,b,R,oe,me,ge,I,se;const{dataItemKey:e,virtual:r,groupField:s="",textField:c}=n,l=d.getFilteredData(n),p=_.current.virtual?_.current.virtual.total:0,f=n.opened!==void 0?n.opened:v.opened,y=_.current.opened!==void 0?_.current.opened:Ee.current.opened,u=!y&&f;(m=t==null?void 0:t.current)==null||m.didUpdate();const g=(C=t==null?void 0:t.current)==null?void 0:C.getPopupSettings();if(f&&(g==null?void 0:g.width)===void 0&&N.current){const E=N.current.offsetWidth;Ot(G=>G!==E?E:G)}if(g!=null&&g.animate||u&&Se(),r&&r.total!==p)(D=t==null?void 0:t.current)==null||D.vs.calcScrollElementHeight(),(h=t==null?void 0:t.current)==null||h.vs.reset();else{const E=k(),G=_.current.value!==void 0?_.current.value:Ee.current.value;let j=l.findIndex(Y=>d.areSame(Y,E,e));s!==""&&E&&c&&(j=(P=(i=t==null?void 0:t.current)==null?void 0:i.getGroupedDataModernMode(l,s))==null?void 0:P.map(Y=>Y[c]).indexOf(E[c]));const fe=!d.areSame(G,E,e);u&&r?(b=t==null?void 0:t.current)==null||b.scrollToVirtualItem(r,j):u&&!r?(Se(),l&&l.length!==0&&((R=t==null?void 0:t.current)==null||R.resetGroupStickyHeader(l[0][s],{setState:te,group:v.group,state:v})),(oe=t==null?void 0:t.current)==null||oe.scrollToItem(j)):f&&y&&E&&fe&&!W.current?(ge=t==null?void 0:t.current)==null||ge.scrollToItem(j,(me=t==null?void 0:t.current)==null?void 0:me.vs.enabled):f&&y&&W.current&&(W.current&&r&&r.skip===0?(I=t==null?void 0:t.current)==null||I.vs.reset():W.current&&r&&r.skip===r.total-r.pageSize&&((se=t==null?void 0:t.current)==null||se.vs.scrollToEnd()))}W.current=!1,Ee.current=v,_.current=n,qe()}),a.useEffect(()=>{var e,r;return ee.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(mt.bind(void 0)),(e=t==null?void 0:t.current)==null||e.didMount(),qe(),(r=he())!=null&&r.body&&ee.current&&ee.current.observe(he().body),()=>{var s;(s=he())!=null&&s.body&&ee.current&&ee.current.disconnect()}},[]);const Ge=De+"-accessibility-id",je=De+"-listbox-id",$e=De+"-guid",qt=Ne.toLanguageString(M.dropDownListArrowBtnAriaLabel,M.messages[M.dropDownListArrowBtnAriaLabel]),{style:de,className:zt,label:Me,dir:At,virtual:T,adaptive:an,dataItemKey:Vt,disabled:ce,loading:Re,iconClassName:Ye,svgIcon:Bt,valueRender:Je}=n,ne=n.opened!==void 0?n.opened:v.opened,ue=k(),Oe=d.getItemValue(ue,n.textField),Qe=!pt()||we().valid,pe=t.current,Ht=pe.vs,re=F&&F.uDropDownList;Ht.enabled=T!==void 0;const Xe=o.useAdaptiveModeContext(),U=!!(Fe&&Xe&&Fe<=Xe.medium&&n.adaptive);T!==void 0&&(pe.vs.skip=T.skip,pe.vs.total=T.total,pe.vs.pageSize=T.pageSize);const Wt=d.getFilteredData(n),{focused:_t}=v,Ze=Wt.findIndex(e=>d.areSame(e,ue,Vt)),Ut=(nt=T==null?void 0:T.skip)!=null?nt:0,Gt=ne&&Ze>=0?`k-${$e}-item-${Ze+Ut+1}`:void 0,et=a.createElement("span",{id:Ge,className:o.classNames(o.uDropDownList.inputInner({c:re}))},Oe&&a.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:re}))},Oe)),jt=Je!==void 0?Je.call(void 0,et,ue):et,tt=a.createElement(a.Fragment,null,a.createElement("span",{ref:gt,className:o.classNames(o.uDropDownList.wrapper({c:re,size:A,rounded:Te,fillMode:ye,focused:_t,disabled:ce,invalid:!Qe,loading:Re,required:Ie()}),zt),style:Me?{...de,width:void 0}:de,dir:At,onMouseDown:ne?e=>{e.target.nodeName!=="INPUT"&&(ie(t.current.wrapper),e.preventDefault())}:void 0,onFocus:U?e=>Le(e):Kt,onBlur:Et,tabIndex:o.getTabIndex(dt,ce),accessKey:n.accessKey,onKeyDown:Ae,onKeyPress:Ft,onClick:ce?void 0:Le,role:"combobox","aria-required":Ie()||void 0,"aria-disabled":ce||void 0,"aria-haspopup":"listbox","aria-expanded":ne||!1,"aria-activedescendant":Gt,"aria-label":n.ariaLabel||n.label,"aria-labelledby":n.ariaLabelledBy,"aria-describedby":n.ariaDescribedBy||(ne?Ge:void 0),"aria-controls":ne?je:void 0,id:n.id,title:n.title},jt,Re&&a.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:re})),name:"loading"}),a.createElement(en.Button,{tabIndex:-1,type:"button","aria-label":qt,size:A,fillMode:ye,className:o.classNames(o.uDropDownList.inputButton({c:re})),iconClass:Ye,svgIcon:Ye?void 0:Bt||Yt.chevronDownIcon,onMouseDown:e=>v.focused&&e.preventDefault()}),ft(ue),!U&&Ct()),U&&wt());return Me?a.createElement(Rt.FloatingLabel,{label:Me,editorValue:Oe,editorValid:Qe,editorDisabled:n.disabled,style:{width:de?de.width:void 0},children:tt}):tt});ve.propTypes={delay:L.number,ignoreCase:L.bool,iconClassName:L.string,svgIcon:o.svgIconPropType,defaultItem:L.any,valueRender:L.func,valueMap:L.func,validationMessage:L.string,required:L.bool,id:L.string,ariaLabelledBy:L.string,ariaDescribedBy:L.string,ariaLabel:L.string,leftRightKeysNavigation:L.bool,title:L.string,groupField:L.string,list:L.any,skipDisabledItems:L.bool};const O={delay:500,tabIndex:0,ignoreCase:!0,...at.defaultProps,required:!1,size:void 0,rounded:void 0,fillMode:void 0};ve.displayName="KendoReactDropDownList";const it=o.createPropsContext();ve.displayName="KendoReactDropDownList";exports.DropDownList=ve;exports.DropDownListPropsContext=it;exports.dropDownListDefaultProps=O;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wt=require("react"),C=require("prop-types"),o=require("@progress/kendo-react-common"),_t=require("@progress/kendo-react-labels"),Ut=require("@progress/kendo-svg-icons"),Gt=require("../common/ListContainer.js"),jt=require("../common/ListFilter.js"),Ze=require("../common/GroupStickyHeader.js"),$t=require("../common/ListDefaultItem.js"),Yt=require("../common/List.js"),tt=require("../common/DropDownBase.js"),d=require("../common/utils.js"),et=require("../package-metadata.js"),Jt=require("@progress/kendo-react-buttons"),Qt=require("@progress/kendo-react-intl"),N=require("../messages/index.js"),Xt=require("@progress/kendo-react-layout"),Zt=require("../common/AdaptiveMode.js");function en(T){const G=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(T){for(const q in T)if(q!=="default"){const te=Object.getOwnPropertyDescriptor(T,q);Object.defineProperty(G,q,te.get?te:{enumerable:!0,get:()=>T[q]})}}return G.default=T,Object.freeze(G)}const a=en(Wt),tn="Please select a value from the list!",ue=a.forwardRef((T,G)=>{var Xe;let q=!1;const te=o.getLicenseMessage(et.packageMetadata),t=o.usePropsContext(nt,T),{delay:rt=M.delay,tabIndex:ot=M.tabIndex,ignoreCase:j=M.ignoreCase,size:z=M.size,rounded:Pe=M.rounded,fillMode:pe=M.fillMode}=t;if(t.filterable||t.virtual){const e=[];t.filterable&&e.push("filterable"),t.virtual&&e.push("virtualization"),q=!o.validatePackage(et.packageMetadata,{component:"DropDownList",features:e})}const E=o.useUnstyled(),fe=o.useId(t.id),me=()=>{var e;if(o.canUseDOM)return((e=P.current)==null?void 0:e.ownerDocument)||window.document},st=()=>{var e,n;(e=r==null?void 0:r.current)!=null&&e.wrapper&&((n=r==null?void 0:r.current)==null||n.wrapper.focus({preventScroll:!0}))},L=()=>{let e;return B.current!==void 0&&B.current!==null?e=B.current:t.value!==void 0?e=t.value:v.value!==void 0&&v.value!==null?e=v.value:t.defaultValue!==void 0&&t.defaultValue!==null&&(e=t.defaultValue),!d.isPresent(e)&&t.defaultItem!==void 0&&t.defaultItem!==null&&(e=t.defaultItem),e},at=()=>{const{dataItemKey:e}=t,n=d.getFilteredData(t),s=L();return n.findIndex(c=>d.areSame(c,s,e))},ge=()=>t.required!==void 0?t.required:M.required,ve=()=>{const e=t.validationMessage!==void 0,n=L(),s=!ge()||n!==null&&n!==""&&n!==void 0,c=t.valid!==void 0?t.valid:s;return{customError:e,valid:c,valueMissing:n===null}},it=()=>t.validityStyles!==void 0?t.validityStyles:M.validityStyles,ne=e=>{re.current=!0,e.focus(),window.setTimeout(()=>re.current=!1,30)},ye=()=>{Y.current&&ne(Y.current),t.adaptive&&setTimeout(()=>{Y.current&&ne(Y.current)},300)},lt=a.useCallback(e=>{for(const n of e)Kt(n.target.clientWidth)},[]),Ne=()=>{var e;(e=Se.current)!=null&&e.setCustomValidity&&Se.current.setCustomValidity(ve().valid?"":t.validationMessage||tn)},A=(e,n)=>{const s=L();d.areSame(s,e,t.dataItemKey)||(t.value===void 0&&(n.data.value=e),r.current.updateComponentArgs({value:e}),B.current=e,n.events.push({type:"onChange"}))},K=e=>{var n;(n=r==null?void 0:r.current)==null||n.applyState(e),B.current=void 0},$=(e,n)=>{var f;const{virtual:s,dataItemKey:c,defaultItem:l}=t,p=d.getFilteredData(t),g=s?s.skip:0,y=L(),u=e===-1&&l!==void 0?l:p[e-g],m=!d.areSame(u,y,c);A(u,n),m&&((f=r==null?void 0:r.current)==null||f.triggerPageChangeCornerItems(u,n))},V=(e,n,s)=>{var b,h;const{defaultItem:c,dataItemKey:l,virtual:p={skip:0,total:0,pageSize:0}}=t,g=L(),y=d.getFilteredData(t),u=(b=r==null?void 0:r.current)==null?void 0:b.vs,m=y.findIndex(S=>d.areSame(S,g,l)),f=(h=r==null?void 0:r.current)==null?void 0:h.navigation.navigate({current:p.skip+m,max:(u!=null&&u.enabled?p.total:y.length)-1,min:c!==void 0?-1:0,keyCode:n,skipItems:s||void 0});f!==void 0&&$(f,e),K(e)},dt=e=>{P.current=e,r.current.wrapper=e},ct=e=>a.createElement("select",{name:t.name,ref:n=>{Se.current=n},tabIndex:-1,"aria-hidden":!0,title:t.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:t.valueMap?t.valueMap.call(void 0,e):e})),De=()=>{const{textField:e,dataItemKey:n,virtual:s={skip:0},focusedItemIndex:c=d.itemIndexStartsWith,filterable:l,skipDisabledItems:p=!0}=t,g=L(),y=d.getFilteredData(t),u=t.filter?t.filter:v.text;return p&&e&&!u&&!g?y.findIndex(m=>!m.disabled):d.isPresent(g)&&u===void 0||l&&u===""?y.findIndex(m=>d.areSame(m,g,n)):u?xe.current?c(y,u,e):y.findIndex(m=>d.areSame(m,g,n)):s.skip===0?0:-1},Me=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,he=()=>{const e=d.getFilteredData(t),n=r.current.initState(),s=De();Me(e,s)&&(A(null,n),K(n))},Ie=e=>{if(e.isPropagationStopped())return;const n=r.current.initState();n.syntheticEvent=e,v.focused||(n.data.focused=!0),he(),r.current.togglePopup(n),K(n)},Oe=e=>{e&&e.target instanceof Element&&e.target.nodeName==="INPUT"&&e.stopPropagation&&e.stopPropagation();const{filterable:n,disabled:s,defaultItem:c,leftRightKeysNavigation:l=!0,virtual:p={skip:0,total:0,pageSize:0},dataItemKey:g,groupField:y="",textField:u,skipDisabledItems:m=!0}=t,f=d.getFilteredData(t),b=L(),h=f.findIndex(w=>d.areSame(w,b,g)),S=t.opened!==void 0?t.opened:v.opened,i=e.keyCode,F=i===o.Keys.home||i===o.Keys.end,k=i===o.Keys.up||i===o.Keys.down,U=!S&&(e.altKey&&i===o.Keys.down||i===o.Keys.enter||i===o.Keys.space),ee=S&&(e.altKey&&i===o.Keys.up||i===o.Keys.esc),le=l&&(i===o.Keys.left||i===o.Keys.right),de=k||le&&!n||F,x=r.current.initState();if(x.syntheticEvent=e,!s){if(F&&r.current.vs.enabled)i===o.Keys.home?p.skip!==0?(r.current.triggerOnPageChange(x,0,p.pageSize),R.current=!0):A(f[0],x):p.skip<p.total-p.pageSize?(r.current.triggerOnPageChange(x,p.total-p.pageSize,p.pageSize),R.current=!0):A(f[f.length-1],x);else if(S&&i===o.Keys.pageUp)e.preventDefault(),r.current.scrollPopupByPageSize(-1);else if(S&&i===o.Keys.pageDown)e.preventDefault(),r.current.scrollPopupByPageSize(1);else if(S&&i===o.Keys.enter){const w=De();Me(f,w)?(A(null,x),K(x)):$(w,x),r.current.togglePopup(x),e.preventDefault()}else if(U||ee)ee&&he(),r.current.togglePopup(x),e.preventDefault();else if(de){if(xe.current=!1,y!==""&&u)if(!m&&S)V(x,i);else{let w;if(i===o.Keys.down||i===o.Keys.right){const D=f.slice(h+1).find(I=>!I.disabled);w=D&&f.indexOf(D)}else if(i===o.Keys.up||i===o.Keys.left){let D;if(h===0&&c)w=-1;else if(h===-1)D=f,w=f.findIndex(I=>!I.disabled);else{D=f.slice(0,h);let I=D.pop();for(;I&&I.disabled;)I=D.pop();w=I&&f.indexOf(I)}}if(w!==void 0){const D=w-h;V(x,i,D)}else w===void 0&&h===f.length-1&&V(x,i)}else if(!m&&S||F)V(x,i);else if(u){let w;if(i===o.Keys.down||i===o.Keys.right){const D=f.slice(h+1).find(I=>!I.disabled);w=D&&f.indexOf(D)}else if(i===o.Keys.up||i===o.Keys.left){let D;if(h===0&&c)w=-1;else if(h===-1)D=f,w=f.findIndex(I=>!I.disabled);else{D=f.slice(0,h);let I=D.pop();for(;I&&I.disabled;)I=D.pop();w=I&&f.indexOf(I)}}if(w!==void 0){const D=w-h;V(x,i,D)}else w===void 0&&h===f.length-1&&V(x,i)}else V(x,i);e.preventDefault()}K(x)}},ut=e=>{const n=r.current.initState();n.syntheticEvent=e.syntheticEvent,t.filter===void 0&&(n.data.text=e.target.value),r.current.filterChanged(e.target.value,n),xe.current=!0,K(n),Q({group:void 0,text:String(e.target.value)})},Te=e=>{const n=t.filter!==void 0?t.filter:v.text;return t.filterable&&a.createElement(jt,{value:n,ref:s=>{Y.current=s&&s.element},onChange:ut,onKeyDown:Oe,size:e?"large":z,rounded:Pe,fillMode:pe,renderListFilterWrapper:!0,placeholder:ke.toLanguageString(N.dropDownListAdaptiveFilterPlaceholder,N.messages[N.dropDownListAdaptiveFilterPlaceholder])})},pt=e=>{const n=r.current.initState();n.syntheticEvent=e,r.current.togglePopup(n),A(t.defaultItem,n),K(n)},ft=()=>{const{textField:e,defaultItem:n,dataItemKey:s}=t,c=L();return n!==void 0&&a.createElement($t,{defaultItem:n,textField:e,selected:d.areSame(c,n,s),key:"defaultitemkey",onClick:pt})},mt=(e,n)=>{var s;(s=r==null?void 0:r.current)==null||s.handleItemClick(e,n),B.current=void 0},gt=e=>{const{vs:n,list:s}=r.current;n.scrollHandler(e);const{groupField:c}=t;let l=d.getFilteredData(t);if(!(!c||!l.length)&&c){const p=Ae.current=Ae.current||(n.enabled?n.itemHeight:s?s.children[0].offsetHeight:0),y=e.target.scrollTop-n.skip*p;l=r.current.getGroupedDataModernMode(l,c);let u=l[0][c];for(let m=1;m<l.length&&!(p*m>y);m++)l[m]&&l[m][c]&&(u=l[m][c]);u!==v.group&&Q({group:u})}},qe=()=>{var i;const{textField:e,dataItemKey:n,virtual:s={skip:0,total:void 0},groupHeaderItemRender:c,listNoDataRender:l,itemRender:p}=t,g=d.getFilteredData(t),y=E&&E.uDropDownList,u=r.current.vs,m=s.skip,f=t.opened!==void 0?t.opened:v.opened,b=r.current.getPopupSettings(),h=`translateY(${u.translate}px)`,S=L();return a.createElement(Yt,{id:He,show:f,data:g.slice(),focusedIndex:De(),value:S,textField:e,valueField:n,optionsGuid:We,groupField:t.groupField,ariaLabel:ke.toLanguageString(N.listAriaLabel,N.messages[N.listAriaLabel]),listRef:F=>{u.list=r.current.list=F},wrapperStyle:{maxHeight:W?void 0:b.height},wrapperCssClass:o.classNames(o.uDropDownList.listContent({c:y})),listStyle:u.enabled?{transform:h}:void 0,key:"listkey",skip:m,onClick:mt,itemRender:p,groupHeaderItemRender:c,noDataRender:l,onScroll:gt,wrapperRef:u.scrollerRef,scroller:(i=r==null?void 0:r.current)==null?void 0:i.renderScrollElement(),ariaSetSize:s.total})},vt=()=>{const{groupField:e}=t,n=d.getFilteredData(t),s=t.opened!==void 0?t.opened:v.opened,c=E&&E.uDropDownList,l={title:t.adaptiveTitle||t.label,subTitle:t.adaptiveSubtitle,expand:s,onClose:g=>Ie(g),windowWidth:Ce,mobileFilter:Te(!0)};let{group:p}=v;return p===void 0&&e!==void 0&&(p=d.getItemValue(n[0],e)),a.createElement(Zt.AdaptiveMode,{...l},a.createElement(Xt.ActionSheetContent,null,a.createElement("div",{className:o.classNames(o.uDropDownList.listContainer({c,popup:!1}))},It())))},yt=()=>{v.focused&&window.setTimeout(()=>{v.focused&&r.current.wrapper&&ne(r.current.wrapper)})},Dt=e=>{"onMouseDownOutside"in(t.popupSettings||{})&&t.popupSettings.onMouseDownOutside.call(void 0,e)},ht=()=>{const{header:e,footer:n,dir:s,groupField:c,groupStickyHeaderItemRender:l,list:p}=t,g=d.getFilteredData(t),y=r.current,u=y.getPopupSettings(),m=t.opened!==void 0?t.opened:v.opened,f=u.width!==void 0?u.width:Le!=null?Le:y.popupWidth,b=E&&E.uDropDownList,h={dir:s!==void 0?s:y.dirCalculated,width:f,popupSettings:{...u,popupClass:o.classNames(u.popupClass,o.uDropDownList.listContainer({c:b,popup:!0})),anchor:u.anchor||P.current,show:m,onOpen:ye,onClose:yt,onMouseDownOutside:Dt},itemsCount:[g.length]};let{group:S}=v;return S===void 0&&c!==void 0&&(S=d.getItemValue(g[0],c)),a.createElement(Gt,{...h},Te(!1),e&&a.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:b}))},e),a.createElement("div",{className:o.classNames(o.uDropDownList.list({c:b,size:z,virtual:r.current.vs.enabled}))},ft(),!p&&S&&g.length!==0&&a.createElement(Ze,{group:S,render:l}),qe()),n&&a.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:b}))},n),q&&a.createElement(o.WatermarkOverlay,{message:te}))},It=()=>{const{header:e,footer:n,groupStickyHeaderItemRender:s,groupField:c,list:l}=t,p=d.getFilteredData(t),g=E&&E.uDropDownList;let{group:y}=v;return y===void 0&&c!==void 0&&(y=d.getItemValue(p[0],c)),a.createElement(a.Fragment,null,e&&a.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},e),a.createElement("div",{className:o.classNames("k-list",{[`k-list-${W?"lg":o.sizeMap[z]||z}`]:W||z})},!l&&y&&p.length!==0&&a.createElement(Ze,{group:y,render:s}),qe()),n&&a.createElement("div",{className:"k-list-footer"},n))},wt=e=>{const{dataItemKey:n}=t,s=d.getFilteredData(t),c=L();let l=s.map((k,U)=>({item:k,itemIndex:U}));const p=_.current.word,g=_.current.last,y=d.sameCharsOnly(p,g);let u=l.length,m=Math.max(0,s.findIndex(k=>d.areSame(k,c,n))),f;t.defaultItem&&(f={item:t.defaultItem,itemIndex:-1},u+=1,m+=1),m+=y?1:0,l=d.shuffleData(l,m,f);let b,h,S,i=0;const{textField:F}=t;for(;i<u;){if(b=d.getItemValue(l[i].item,F),h=y&&d.matchText(b,g,j),S=d.matchText(b,p,j),h||S){i=l[i].itemIndex;break}i++}if(i!==u){const k=r.current.initState();k.syntheticEvent=e,$(i,k),K(k),B.current=void 0}},St=e=>{clearTimeout(ze.current),t.filterable||(ze.current=window.setTimeout(()=>_.current.word="",rt),wt(e))},xt=e=>{re.current||r.current.handleFocus(e)},bt=e=>{if(re.current||!v.focused)return;const n=t.opened!==void 0?t.opened:v.opened,s=r.current.initState();s.syntheticEvent=e,s.data.focused=!1,s.events.push({type:"onBlur"}),n&&he(),n&&!W&&r.current.togglePopup(s),K(s)},Ct=e=>{if(t.filterable||e.which===0||e.keyCode===o.Keys.enter)return;let n=String.fromCharCode(e.charCode||e.keyCode);j&&(n=n.toLowerCase()),n===" "&&e.preventDefault(),_.current={word:_.current.word+n,last:_.current.last+n},St(e)},Lt=()=>{const e=r.current.initState();e.data.opened=v.opened,r.current.togglePopup(e),K(e)},we=a.useRef(null),P=a.useRef(null),Se=a.useRef(null),Y=a.useRef(null);a.useImperativeHandle(we,()=>({get element(){return P.current},get index(){return at()},get name(){return t.name},get validity(){return ve()},get value(){return L()},get focused(){return v.focused},get opened(){return v.opened},focus:st,props:t,togglePopup:Lt})),a.useImperativeHandle(G,()=>we.current),o.useWebMcpRegister("dropdownlist",we,t,t.webMcp);const ze=a.useRef(null),_=a.useRef({word:"",last:""}),re=a.useRef(!1),B=a.useRef(null),R=a.useRef(!1),xe=a.useRef(!1),H=a.useRef({}),be=a.useRef({}),r=a.useRef(new tt({props:t,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Ae=a.useRef(0),J=a.useRef(null),[v,kt]=a.useState({}),[Ce,Kt]=a.useState(),[,Ve]=a.useReducer(e=>e,!0),[Le,Et]=a.useState(),ke=Qt.useLocalization(),Be=t.name||t.id,Ft=a.useCallback(e=>{if(e==null||!r.current)return;const n=d.getFilteredData(t),{textField:s}=t,c=String(e),l=d.getItemIndexByText(n,c,s,!1,j),p=l!==-1?n[l]:void 0;if(p!==void 0){const g=r.current.initState();g.syntheticEvent={target:P.current},A(p,g),K(g)}},[t,j]);o.useKendoPaste(P,{fieldName:Be,onValueChange:Ft,enabled:!!Be});const Q=e=>{kt({...v,...e})};a.useEffect(()=>{r.current.updateComponentArgs({props:t,setState:Q,state:v,forceUpdate:Ve,element:P.current,handleItemSelect:$,value:L()})},[Q,v,Ve,$,L]),a.useEffect(()=>{var f,b,h,S,i,F,k,U,ee,le,de,x,w;const{dataItemKey:e,virtual:n,groupField:s="",textField:c}=t,l=d.getFilteredData(t),p=H.current.virtual?H.current.virtual.total:0,g=t.opened!==void 0?t.opened:v.opened,y=H.current.opened!==void 0?H.current.opened:be.current.opened,u=!y&&g;(f=r==null?void 0:r.current)==null||f.didUpdate();const m=(b=r==null?void 0:r.current)==null?void 0:b.getPopupSettings();if(g&&(m==null?void 0:m.width)===void 0&&P.current){const D=P.current.offsetWidth;Et(I=>I!==D?D:I)}if(m!=null&&m.animate||u&&ye(),n&&n.total!==p)(h=r==null?void 0:r.current)==null||h.vs.calcScrollElementHeight(),(S=r==null?void 0:r.current)==null||S.vs.reset();else{const D=L(),I=H.current.value!==void 0?H.current.value:be.current.value;let ce=l.findIndex(Fe=>d.areSame(Fe,D,e));s!==""&&D&&c&&(ce=(F=(i=r==null?void 0:r.current)==null?void 0:i.getGroupedDataModernMode(l,s))==null?void 0:F.map(Fe=>Fe[c]).indexOf(D[c]));const Ht=!d.areSame(I,D,e);u&&n?(k=r==null?void 0:r.current)==null||k.scrollToVirtualItem(n,ce):u&&!n?(ye(),l&&l.length!==0&&((U=r==null?void 0:r.current)==null||U.resetGroupStickyHeader(l[0][s],{setState:Q,group:v.group,state:v})),(ee=r==null?void 0:r.current)==null||ee.scrollToItem(ce)):g&&y&&D&&Ht&&!R.current?(de=r==null?void 0:r.current)==null||de.scrollToItem(ce,(le=r==null?void 0:r.current)==null?void 0:le.vs.enabled):g&&y&&R.current&&(R.current&&n&&n.skip===0?(x=r==null?void 0:r.current)==null||x.vs.reset():R.current&&n&&n.skip===n.total-n.pageSize&&((w=r==null?void 0:r.current)==null||w.vs.scrollToEnd()))}R.current=!1,be.current=v,H.current=t,Ne()}),a.useEffect(()=>{var e,n;return J.current=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(lt.bind(void 0)),(e=r==null?void 0:r.current)==null||e.didMount(),Ne(),(n=me())!=null&&n.body&&J.current&&J.current.observe(me().body),()=>{var s;(s=me())!=null&&s.body&&J.current&&J.current.disconnect()}},[]);const Re=fe+"-accessibility-id",He=fe+"-listbox-id",We=fe+"-guid",Pt=ke.toLanguageString(N.dropDownListArrowBtnAriaLabel,N.messages[N.dropDownListArrowBtnAriaLabel]),{style:oe,className:Nt,label:Ke,dir:Mt,virtual:O,adaptive:nn,dataItemKey:Ot,disabled:se,loading:_e,iconClassName:Ue,svgIcon:Tt,valueRender:Ge}=t,X=t.opened!==void 0?t.opened:v.opened,ae=L(),Ee=d.getItemValue(ae,t.textField),je=!it()||ve().valid,ie=r.current,qt=ie.vs,Z=E&&E.uDropDownList;qt.enabled=O!==void 0;const $e=o.useAdaptiveModeContext(),W=!!(Ce&&$e&&Ce<=$e.medium&&t.adaptive);O!==void 0&&(ie.vs.skip=O.skip,ie.vs.total=O.total,ie.vs.pageSize=O.pageSize);const zt=d.getFilteredData(t),{focused:At}=v,Ye=zt.findIndex(e=>d.areSame(e,ae,Ot)),Vt=(Xe=O==null?void 0:O.skip)!=null?Xe:0,Bt=X&&Ye>=0?`k-${We}-item-${Ye+Vt+1}`:void 0,Je=a.createElement("span",{id:Re,className:o.classNames(o.uDropDownList.inputInner({c:Z}))},Ee&&a.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:Z}))},Ee)),Rt=Ge!==void 0?Ge.call(void 0,Je,ae):Je,Qe=a.createElement(a.Fragment,null,a.createElement("span",{ref:dt,className:o.classNames(o.uDropDownList.wrapper({c:Z,size:z,rounded:Pe,fillMode:pe,focused:At,disabled:se,invalid:!je,loading:_e,required:ge()}),Nt),style:Ke?{...oe,width:void 0}:oe,dir:Mt,onMouseDown:X?e=>{e.target.nodeName!=="INPUT"&&(ne(r.current.wrapper),e.preventDefault())}:void 0,onFocus:W?e=>Ie(e):xt,onBlur:bt,tabIndex:o.getTabIndex(ot,se),accessKey:t.accessKey,onKeyDown:Oe,onKeyPress:Ct,onClick:se?void 0:Ie,role:"combobox","aria-required":ge()||void 0,"aria-disabled":se||void 0,"aria-haspopup":"listbox","aria-expanded":X||!1,"aria-activedescendant":Bt,"aria-label":t.ariaLabel||t.label,"aria-labelledby":t.ariaLabelledBy,"aria-describedby":t.ariaDescribedBy||(X?Re:void 0),"aria-controls":X?He:void 0,id:t.id,title:t.title},Rt,_e&&a.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:Z})),name:"loading"}),a.createElement(Jt.Button,{tabIndex:-1,type:"button","aria-label":Pt,size:z,fillMode:pe,className:o.classNames(o.uDropDownList.inputButton({c:Z})),iconClass:Ue,svgIcon:Ue?void 0:Tt||Ut.chevronDownIcon,onMouseDown:e=>v.focused&&e.preventDefault()}),ct(ae),!W&&ht()),W&&vt());return Ke?a.createElement(_t.FloatingLabel,{label:Ke,editorValue:Ee,editorValid:je,editorDisabled:t.disabled,style:{width:oe?oe.width:void 0},children:Qe}):Qe});ue.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 M={delay:500,tabIndex:0,ignoreCase:!0,...tt.defaultProps,required:!1,size:void 0,rounded:void 0,fillMode:void 0};ue.displayName="KendoReactDropDownList";const nt=o.createPropsContext();ue.displayName="KendoReactDropDownList";exports.DropDownList=ue;exports.DropDownListPropsContext=nt;exports.dropDownListDefaultProps=M;