@progress/kendo-react-dropdowns 14.4.1-develop.9 → 14.4.1

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