@progress/kendo-react-dropdowns 16.2.0-develop.1 → 16.2.0-develop.10

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 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;
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 s=en(Wt),tn="Please select a value from the list!",pe=s.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:fe=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(),me=o.useId(t.id),ge=()=>{var e;if(o.canUseDOM)return((e=P.current)==null?void 0:e.ownerDocument)||window.document},at=()=>{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},st=()=>{const{dataItemKey:e}=t,n=d.getFilteredData(t),a=L();return n.findIndex(l=>d.areSame(l,a,e))},ne=()=>t.required!==void 0?t.required:M.required,ve=()=>{const e=t.validationMessage!==void 0,n=L(),a=!ne()||n!==null&&n!==""&&n!==void 0,l=t.valid!==void 0?t.valid:a;return{customError:e,valid:l,valueMissing:n===null}},it=()=>t.validityStyles!==void 0?t.validityStyles:M.validityStyles,re=e=>{oe.current=!0,e.focus(),window.setTimeout(()=>oe.current=!1,30)},ye=()=>{Y.current&&re(Y.current),t.adaptive&&setTimeout(()=>{Y.current&&re(Y.current)},300)},lt=s.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 a=L();d.areSame(a,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:a,dataItemKey:l,defaultItem:c}=t,p=d.getFilteredData(t),g=a?a.skip:0,y=L(),u=e===-1&&c!==void 0?c:p[e-g],m=!d.areSame(u,y,l);A(u,n),m&&((f=r==null?void 0:r.current)==null||f.triggerPageChangeCornerItems(u,n))},V=(e,n,a)=>{var b,I;const{defaultItem:l,dataItemKey:c,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,c)),f=(I=r==null?void 0:r.current)==null?void 0:I.navigation.navigate({current:p.skip+m,max:(u!=null&&u.enabled?p.total:y.length)-1,min:l!==void 0?-1:0,keyCode:n,skipItems:a||void 0});f!==void 0&&$(f,e),K(e)},dt=e=>{P.current=e,r.current.wrapper=e},ct=e=>{const n=t.defaultItem!==void 0&&d.areSame(e,t.defaultItem,t.dataItemKey);let a=e;return n?a="":t.valueMap&&(a=t.valueMap(e)),s.createElement("select",{name:t.name,required:ne()&&t.valid!==!0,ref:l=>{Se.current=l},tabIndex:-1,"aria-hidden":!0,title:t.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},s.createElement("option",{value:a}))},De=()=>{const{textField:e,dataItemKey:n,virtual:a={skip:0},focusedItemIndex:l=d.itemIndexStartsWith,filterable:c,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||c&&u===""?y.findIndex(m=>d.areSame(m,g,n)):u?xe.current?l(y,u,e):y.findIndex(m=>d.areSame(m,g,n)):a.skip===0?0:-1},Me=(e,n)=>n!==void 0&&n!==-1&&e&&e.length>0&&e[n].disabled,Ie=()=>{const e=d.getFilteredData(t),n=r.current.initState(),a=De();Me(e,a)&&(A(null,n),K(n))},he=e=>{if(e.isPropagationStopped())return;const n=r.current.initState();n.syntheticEvent=e,v.focused||(n.data.focused=!0),Ie(),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:a,defaultItem:l,leftRightKeysNavigation:c=!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(),I=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),de=c&&(i===o.Keys.left||i===o.Keys.right),ce=k||de&&!n||F,x=r.current.initState();if(x.syntheticEvent=e,!a){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&&Ie(),r.current.togglePopup(x),e.preventDefault();else if(ce){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(I+1).find(h=>!h.disabled);w=D&&f.indexOf(D)}else if(i===o.Keys.up||i===o.Keys.left){let D;if(I===0&&l)w=-1;else if(I===-1)D=f,w=f.findIndex(h=>!h.disabled);else{D=f.slice(0,I);let h=D.pop();for(;h&&h.disabled;)h=D.pop();w=h&&f.indexOf(h)}}if(w!==void 0){const D=w-I;V(x,i,D)}else w===void 0&&I===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(I+1).find(h=>!h.disabled);w=D&&f.indexOf(D)}else if(i===o.Keys.up||i===o.Keys.left){let D;if(I===0&&l)w=-1;else if(I===-1)D=f,w=f.findIndex(h=>!h.disabled);else{D=f.slice(0,I);let h=D.pop();for(;h&&h.disabled;)h=D.pop();w=h&&f.indexOf(h)}}if(w!==void 0){const D=w-I;V(x,i,D)}else w===void 0&&I===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&&s.createElement(jt,{value:n,ref:a=>{Y.current=a&&a.element},onChange:ut,onKeyDown:Oe,size:e?"large":z,rounded:Pe,fillMode:fe,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:a}=t,l=L();return n!==void 0&&s.createElement($t,{defaultItem:n,textField:e,selected:d.areSame(l,n,a),key:"defaultitemkey",onClick:pt})},mt=(e,n)=>{var a;(a=r==null?void 0:r.current)==null||a.handleItemClick(e,n),B.current=void 0},gt=e=>{const{vs:n,list:a}=r.current;n.scrollHandler(e);const{groupField:l}=t;let c=d.getFilteredData(t);if(!(!l||!c.length)&&l){const p=Ae.current=Ae.current||(n.enabled?n.itemHeight:a?a.children[0].offsetHeight:0),y=e.target.scrollTop-n.skip*p;c=r.current.getGroupedDataModernMode(c,l);let u=c[0][l];for(let m=1;m<c.length&&!(p*m>y);m++)c[m]&&c[m][l]&&(u=c[m][l]);u!==v.group&&Q({group:u})}},qe=()=>{var i;const{textField:e,dataItemKey:n,virtual:a={skip:0,total:void 0},groupHeaderItemRender:l,listNoDataRender:c,itemRender:p}=t,g=d.getFilteredData(t),y=E&&E.uDropDownList,u=r.current.vs,m=a.skip,f=t.opened!==void 0?t.opened:v.opened,b=r.current.getPopupSettings(),I=`translateY(${u.translate}px)`,S=L();return s.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:I}:void 0,key:"listkey",skip:m,onClick:mt,itemRender:p,groupHeaderItemRender:l,noDataRender:c,onScroll:gt,wrapperRef:u.scrollerRef,scroller:(i=r==null?void 0:r.current)==null?void 0:i.renderScrollElement(),ariaSetSize:a.total})},vt=()=>{const{groupField:e}=t,n=d.getFilteredData(t),a=t.opened!==void 0?t.opened:v.opened,l=E&&E.uDropDownList,c={title:t.adaptiveTitle||t.label,subTitle:t.adaptiveSubtitle,expand:a,onClose:g=>he(g),windowWidth:Ce,mobileFilter:Te(!0)};let{group:p}=v;return p===void 0&&e!==void 0&&(p=d.getItemValue(n[0],e)),s.createElement(Zt.AdaptiveMode,{...c},s.createElement(Xt.ActionSheetContent,null,s.createElement("div",{className:o.classNames(o.uDropDownList.listContainer({c:l,popup:!1}))},ht())))},yt=()=>{v.focused&&window.setTimeout(()=>{v.focused&&r.current.wrapper&&re(r.current.wrapper)})},Dt=e=>{"onMouseDownOutside"in(t.popupSettings||{})&&t.popupSettings.onMouseDownOutside.call(void 0,e)},It=()=>{const{header:e,footer:n,dir:a,groupField:l,groupStickyHeaderItemRender:c,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,I={dir:a!==void 0?a: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&&l!==void 0&&(S=d.getItemValue(g[0],l)),s.createElement(Gt,{...I},Te(!1),e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:b}))},e),s.createElement("div",{className:o.classNames(o.uDropDownList.list({c:b,size:z,virtual:r.current.vs.enabled}))},ft(),!p&&S&&g.length!==0&&s.createElement(Ze,{group:S,render:c}),qe()),n&&s.createElement("div",{className:o.classNames(o.uDropDownList.listFooter({c:b}))},n),q&&s.createElement(o.WatermarkOverlay,{message:te}))},ht=()=>{const{header:e,footer:n,groupStickyHeaderItemRender:a,groupField:l,list:c}=t,p=d.getFilteredData(t),g=E&&E.uDropDownList;let{group:y}=v;return y===void 0&&l!==void 0&&(y=d.getItemValue(p[0],l)),s.createElement(s.Fragment,null,e&&s.createElement("div",{className:o.classNames(o.uDropDownList.listHeader({c:g}))},e),s.createElement("div",{className:o.classNames("k-list",{[`k-list-${W?"lg":o.sizeMap[z]||z}`]:W||z})},!c&&y&&p.length!==0&&s.createElement(Ze,{group:y,render:a}),qe()),n&&s.createElement("div",{className:"k-list-footer"},n))},wt=e=>{const{dataItemKey:n}=t,a=d.getFilteredData(t),l=L();let c=a.map((k,U)=>({item:k,itemIndex:U}));const p=_.current.word,g=_.current.last,y=d.sameCharsOnly(p,g);let u=c.length,m=Math.max(0,a.findIndex(k=>d.areSame(k,l,n))),f;t.defaultItem&&(f={item:t.defaultItem,itemIndex:-1},u+=1,m+=1),m+=y?1:0,c=d.shuffleData(c,m,f);let b,I,S,i=0;const{textField:F}=t;for(;i<u;){if(b=d.getItemValue(c[i].item,F),I=y&&d.matchText(b,g,j),S=d.matchText(b,p,j),I||S){i=c[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=>{oe.current||r.current.handleFocus(e)},bt=e=>{if(oe.current||!v.focused)return;const n=t.opened!==void 0?t.opened:v.opened,a=r.current.initState();a.syntheticEvent=e,a.data.focused=!1,a.events.push({type:"onBlur"}),n&&Ie(),n&&!W&&r.current.togglePopup(a),K(a)},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=s.useRef(null),P=s.useRef(null),Se=s.useRef(null),Y=s.useRef(null);s.useImperativeHandle(we,()=>({get element(){return P.current},get index(){return st()},get name(){return t.name},get validity(){return ve()},get value(){return L()},get focused(){return v.focused},get opened(){return v.opened},focus:at,props:t,togglePopup:Lt})),s.useImperativeHandle(G,()=>we.current),o.useWebMcpRegister("dropdownlist",we,t,t.webMcp);const ze=s.useRef(null),_=s.useRef({word:"",last:""}),oe=s.useRef(!1),B=s.useRef(null),R=s.useRef(!1),xe=s.useRef(!1),H=s.useRef({}),be=s.useRef({}),r=s.useRef(new tt({props:t,setState:()=>{},state:{},forceUpdate:()=>{},element:null,value:null,handleItemSelect:()=>{}})),Ae=s.useRef(0),J=s.useRef(null),[v,kt]=s.useState({}),[Ce,Kt]=s.useState(),[,Ve]=s.useReducer(e=>e,!0),[Le,Et]=s.useState(),ke=Qt.useLocalization(),Be=t.name||t.id,Ft=s.useCallback(e=>{if(e==null||!r.current)return;const n=d.getFilteredData(t),{textField:a}=t,l=String(e),c=d.getItemIndexByText(n,l,a,!1,j),p=c!==-1?n[c]: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})};s.useEffect(()=>{r.current.updateComponentArgs({props:t,setState:Q,state:v,forceUpdate:Ve,element:P.current,handleItemSelect:$,value:L()})},[Q,v,Ve,$,L]),s.useEffect(()=>{var f,b,I,S,i,F,k,U,ee,de,ce,x,w;const{dataItemKey:e,virtual:n,groupField:a="",textField:l}=t,c=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(h=>h!==D?D:h)}if(m!=null&&m.animate||u&&ye(),n&&n.total!==p)(I=r==null?void 0:r.current)==null||I.vs.calcScrollElementHeight(),(S=r==null?void 0:r.current)==null||S.vs.reset();else{const D=L(),h=H.current.value!==void 0?H.current.value:be.current.value;let ue=c.findIndex(Fe=>d.areSame(Fe,D,e));a!==""&&D&&l&&(ue=(F=(i=r==null?void 0:r.current)==null?void 0:i.getGroupedDataModernMode(c,a))==null?void 0:F.map(Fe=>Fe[l]).indexOf(D[l]));const Ht=!d.areSame(h,D,e);u&&n?(k=r==null?void 0:r.current)==null||k.scrollToVirtualItem(n,ue):u&&!n?(ye(),c&&c.length!==0&&((U=r==null?void 0:r.current)==null||U.resetGroupStickyHeader(c[0][a],{setState:Q,group:v.group,state:v})),(ee=r==null?void 0:r.current)==null||ee.scrollToItem(ue)):g&&y&&D&&Ht&&!R.current?(ce=r==null?void 0:r.current)==null||ce.scrollToItem(ue,(de=r==null?void 0:r.current)==null?void 0:de.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()}),s.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=ge())!=null&&n.body&&J.current&&J.current.observe(ge().body),()=>{var a;(a=ge())!=null&&a.body&&J.current&&J.current.disconnect()}},[]);const Re=me+"-accessibility-id",He=me+"-listbox-id",We=me+"-guid",Pt=ke.toLanguageString(N.dropDownListArrowBtnAriaLabel,N.messages[N.dropDownListArrowBtnAriaLabel]),{style:ae,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,ie=L(),Ee=d.getItemValue(ie,t.textField),je=!it()||ve().valid,le=r.current,qt=le.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&&(le.vs.skip=O.skip,le.vs.total=O.total,le.vs.pageSize=O.pageSize);const zt=d.getFilteredData(t),{focused:At}=v,Ye=zt.findIndex(e=>d.areSame(e,ie,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=s.createElement("span",{id:Re,className:o.classNames(o.uDropDownList.inputInner({c:Z}))},Ee&&s.createElement("span",{className:o.classNames(o.uDropDownList.inputText({c:Z}))},Ee)),Rt=Ge!==void 0?Ge.call(void 0,Je,ie):Je,Qe=s.createElement(s.Fragment,null,s.createElement("span",{ref:dt,className:o.classNames(o.uDropDownList.wrapper({c:Z,size:z,rounded:Pe,fillMode:fe,focused:At,disabled:se,invalid:!je,loading:_e,required:ne()}),Nt),style:Ke?{...ae,width:void 0}:ae,dir:Mt,onMouseDown:X?e=>{e.target.nodeName!=="INPUT"&&(re(r.current.wrapper),e.preventDefault())}:void 0,onFocus:W?e=>he(e):xt,onBlur:bt,tabIndex:o.getTabIndex(ot,se),accessKey:t.accessKey,onKeyDown:Oe,onKeyPress:Ct,onClick:se?void 0:he,role:"combobox","aria-required":ne()||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&&s.createElement(o.IconWrap,{className:o.classNames(o.uDropDownList.loadingIcon({c:Z})),name:"loading"}),s.createElement(Jt.Button,{tabIndex:-1,type:"button","aria-label":Pt,size:z,fillMode:fe,className:o.classNames(o.uDropDownList.inputButton({c:Z})),iconClass:Ue,svgIcon:Ue?void 0:Tt||Ut.chevronDownIcon,onMouseDown:e=>v.focused&&e.preventDefault()}),ct(ie),!W&&It()),W&&vt());return Ke?s.createElement(_t.FloatingLabel,{label:Ke,editorValue:Ee,editorValid:je,editorDisabled:t.disabled,style:{width:ae?ae.width:void 0},children:Qe}):Qe});pe.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};pe.displayName="KendoReactDropDownList";const nt=o.createPropsContext();pe.displayName="KendoReactDropDownList";exports.DropDownList=pe;exports.DropDownListPropsContext=nt;exports.dropDownListDefaultProps=M;