@progress/kendo-react-dropdowns 11.0.0-develop.3 → 11.0.0-develop.5

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