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