@progress/kendo-react-dropdowns 9.2.0-develop.4 → 9.2.0-develop.6

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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ze=require("react"),a=require("prop-types"),i=require("@progress/kendo-react-common"),et=require("@progress/kendo-react-popup"),tt=require("@progress/kendo-react-intl"),we=require("@progress/kendo-react-treeview"),nt=require("../package-metadata.js"),ee=require("../common/utils.js"),at=require("../DropDownTree/useDropdownWidth.js"),rt=require("../DropDownTree/ListNoData.js"),m=require("../messages/index.js"),it=require("@progress/kendo-react-labels"),st=require("../MultiSelect/TagList.js"),ot=require("../common/ClearButton.js"),Ie=require("../common/ListFilter.js"),lt=require("../common/AdaptiveMode.js"),ct=require("@progress/kendo-react-layout");function ut(h){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const n in h)if(n!=="default"){const I=Object.getOwnPropertyDescriptor(h,n);Object.defineProperty(b,n,I.get?I:{enumerable:!0,get:()=>h[n]})}}return b.default=h,Object.freeze(b)}const t=ut(Ze),dt="Please select a value from the list!",{sizeMap:Te,roundedMap:pt}=i.kendoThemeMaps,ft=h=>h.split("_").map(b=>parseInt(b,10)),gt=(h,b)=>{const{validationMessage:n,valid:I,required:T}=h;return{customError:n!==void 0,valid:!!(I!==void 0?I:!T||b),valueMissing:!b}},E={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Ke=i.createPropsContext(),ce=t.forwardRef((h,b)=>{const n=i.usePropsContext(Ke,h);i.validatePackage(nt.packageMetadata);const I=i.useId(),T=n.id||I,{data:B=[],dataItemKey:K,style:A={},placeholder:ue,label:L,name:Re,validationMessage:W,valid:Me,tags:de,value:g,opened:R,disabled:x,popupSettings:N=E.popupSettings,checkField:pe=E.checkField,checkIndeterminateField:fe=E.checkIndeterminateField,subItemsField:ge=E.subItemsField,size:y=E.size,rounded:V=E.rounded,fillMode:z=E.fillMode,required:ve=E.required,validityStyles:De=E.validityStyles,onOpen:te=i.noop,onClose:_=i.noop}=n,j=i.getTabIndex(n.tabIndex,x),o=t.useRef(null),F=t.useRef(null),M=t.useRef(null),ne=t.useRef(null),H=t.useRef(null),S=t.useRef(null),$=t.useRef(!1),G=t.useRef([]),U=t.useRef(null),[P,qe]=t.useState(),[Ne,me]=t.useState(!1),[d,ae]=t.useState(!1),[re,Pe]=t.useState(),[Oe,Ae]=t.useState([]),[he,Le]=t.useState(""),O=!!(re&&re<=i.ADAPTIVE_MEDIUM_BREAKPOINT&&n.adaptive),l=R!==void 0?R:Ne,ie=!!(Array.isArray(g)&&g.length),se=gt({validationMessage:W,valid:Me,required:ve},ie),D=i.useRtl(F,n.dir),Ve={width:at.useDropdownWidth(F,E,N,A),...D!==void 0?{direction:D}:{}},Be=t.useCallback(()=>F.current&&F.current.focus(),[]);G.current=de===void 0?(g||[]).map(e=>({text:ee.getItemValue(e,n.textField),data:[e]})):[...de],t.useImperativeHandle(o,()=>({props:n,element:F.current,focus:Be})),t.useImperativeHandle(b,()=>o.current);const We=t.useCallback(()=>{H.current&&H.current.setCustomValidity&&H.current.setCustomValidity(se.valid?"":W===void 0?dt:W)},[W,se]);t.useEffect(We),t.useEffect(()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Xe.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}},[]),t.useEffect(()=>{U.current&&l&&U.current.setPosition(U.current.element)},[g,l]);const w=t.useCallback((e,r,s)=>{if(n.onChange){const k={items:r,operation:s,...e};n.onChange.call(void 0,k)}},[n.onChange]),J=t.useCallback(e=>{if(ee.areSame(e.item,g,K)||!o.current)return;const{item:r,nativeEvent:s,syntheticEvent:k}=e,q={syntheticEvent:k,nativeEvent:s,target:o.current};w(q,[r],"toggle")},[g,K,w]),Q=t.useCallback(e=>{if(!l){if(te){const r={...e};te.call(void 0,r)}R===void 0&&(me(!0),Ae(g||[]),O&&setTimeout(()=>{var r;u((r=ne.current)==null?void 0:r.element)},300))}},[l,R,te,O,ne]),v=t.useCallback(e=>{if(l){if(_){const r={...e};_.call(void 0,r)}R===void 0&&me(!1)}},[l,R,_]),C=t.useCallback(e=>{$.current=!0,e(),window.setTimeout(()=>$.current=!1,0)},[]),u=t.useCallback(e=>{e&&C(()=>e.focus())},[C]),ze=t.useCallback(()=>{var e;!d&&l?v({target:o.current}):n.filterable?u((e=M.current)==null?void 0:e.element):u(S.current&&S.current.element)},[d,l,u,v,n.filterable]),_e=t.useCallback(()=>{d&&u(F.current)},[d,u]),je=t.useCallback(e=>{if(!d&&!$.current&&(ae(!0),n.onFocus&&o.current)){const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:o.current};n.onFocus.call(void 0,r)}},[d,n.onFocus]),He=t.useCallback(e=>{if(d&&!$.current&&o.current){ae(!1);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:o.current};if(n.onBlur){const s={...r};n.onBlur.call(void 0,s)}O||v(r)}},[d,n.onBlur,l,R,_]),$e=t.useCallback(()=>{d&&C(i.noop)},[d,C]),Ge=t.useCallback(e=>{if(!e.isDefaultPrevented()&&o.current){ae(!0);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:o.current};l||Q(r)}},[l,Q]),Ue=t.useCallback(e=>{var Z,Se;const{keyCode:r,altKey:s}=e,k=S.current&&S.current.element;if(!o.current||e.isDefaultPrevented()&&((Z=M.current)==null?void 0:Z.element)===e.target)return;const q={syntheticEvent:e,nativeEvent:e.nativeEvent,target:o.current};if(g&&g.length>0&&(r===i.Keys.left||r===i.Keys.right||r===i.Keys.home||r===i.Keys.end||r===i.Keys.delete)){const c=G.current;let p=P?c.findIndex(Ye=>ee.matchTags(Ye,P,K)):-1,f;const le=p!==-1;r===i.Keys.left?(le?p=Math.max(0,p-1):p=c.length-1,f=c[p]):r===i.Keys.right?p===c.length-1?f=void 0:le&&(p=Math.min(c.length-1,p+1),f=c[p]):r===i.Keys.home?f=c[0]:r===i.Keys.end?f=c[c.length-1]:r===i.Keys.delete&&le&&w(q,c[p].data,"delete"),f!==P&&qe(f)}if(l)if(r===i.Keys.esc||s&&r===i.Keys.up)e.preventDefault(),v(q);else if(k&&k.querySelector(".k-focus")&&(r===i.Keys.up||r===i.Keys.down||r===i.Keys.left||r===i.Keys.right||r===i.Keys.home||r===i.Keys.end)){if(r===i.Keys.up&&((Se=M.current)!=null&&Se.element)){const c=Array.from(k.querySelectorAll(".k-treeview-item")),p=[...c].reverse().find(f=>!!(f&&f.querySelector(".k-focus")));if(p&&c.indexOf(p)===0)return C(()=>{var f;u((f=M.current)==null?void 0:f.element)})}C(i.noop)}else r===i.Keys.down&&C(()=>{var c;u(((c=M.current)==null?void 0:c.element)||k)});else s&&r===i.Keys.down&&(e.preventDefault(),Q(q))},[l,v,u,C,Q,P,K,g,w]),ye=t.useCallback(e=>{const{keyCode:r,altKey:s}=e;s||r!==i.Keys.up&&r!==i.Keys.down||(e.preventDefault(),C(r===i.Keys.up?()=>{u(F.current)}:()=>{u(S.current&&S.current.element)}))},[u,C]),oe=t.useCallback(e=>{if(!o.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:o.current};w(r,[],"clear"),v(r),e.preventDefault()},[w,v]),Je=t.useCallback((e,r)=>{var s;v({target:o.current}),d||u((s=M.current)==null?void 0:s.element),w({syntheticEvent:r,nativeEvent:r.nativeEvent,target:o.current},e,"delete")},[w,v,u,d]),be=t.useCallback(e=>{if(n.onExpandChange&&o.current){const{item:r,itemHierarchicalIndex:s,nativeEvent:k,syntheticEvent:q}=e,Z={level:ft(s),item:r,nativeEvent:k,syntheticEvent:q,target:o.current};n.onExpandChange.call(void 0,Z)}},[n.onExpandChange]),Ce=t.useCallback(e=>{if(n.onFilterChange&&o.current){const s={filter:{field:n.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:o.current};n.onFilterChange.call(void 0,s),n.filter===void 0&&Le(e.target.value)}},[n.onFilterChange,n.filter,n.textField]),ke=t.useCallback(e=>{if(!o.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:o.current};n.onCancel&&n.onCancel.call(void 0,r),v(r),e.preventDefault()},[n.onCancel,v]),Qe=()=>{const e=n.filterable?t.createElement(Ie,{value:n.filter===void 0?he:n.filter,ref:ne,onChange:Ce,onKeyDown:ye,size:y,rounded:V,fillMode:z}):null,r={title:n.adaptiveTitle,expand:l,onClose:s=>n.onCancel?ke(s):oe(s),windowWidth:re,mobileFilter:e,footer:{cancelText:X.toLanguageString(m.adaptiveModeFooterCancel,m.messages[m.adaptiveModeFooterCancel]),onCancel:s=>n.onCancel?ke(s):oe(s),applyText:X.toLanguageString(m.adaptiveModeFooterApply,m.messages[m.adaptiveModeFooterApply]),onApply:s=>v(s)}};return t.createElement(lt.AdaptiveMode,{...r},t.createElement(ct.ActionSheetContent,{overflowHidden:!0},t.createElement("div",{className:"k-list-container"},t.createElement("div",{className:"k-list k-list-lg"},B.length>0?t.createElement(we.TreeView,{ref:S,tabIndex:j,data:B,focusIdField:K,textField:n.textField,checkField:pe,checkIndeterminateField:fe,expandField:n.expandField,childrenField:ge,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:be,checkboxes:!0,size:y,item:n.item,dir:D}):t.createElement(Ee,null,X.toLanguageString(m.nodata,m.messages[m.nodata]))))))},Xe=t.useCallback(e=>{for(const r of e)Pe(r.target.clientWidth)},[]),Ee=n.listNoData||rt.ListNoData,X=tt.useLocalization(),Fe=!De||se.valid,Y=O&&l?Oe:G.current,xe=t.createElement(t.Fragment,null,t.createElement("span",{className:i.classNames("k-multiselecttree k-input",n.className,{[`k-input-${Te[y]||y}`]:y,[`k-rounded-${pt[V]||V}`]:V,[`k-input-${z}`]:z,"k-focus":d&&!x,"k-invalid":!Fe,"k-disabled":x,"k-loading":n.loading,"k-required":ve}),tabIndex:j,accessKey:n.accessKey,id:T,style:L?{...A,width:void 0}:A,dir:D,ref:F,onKeyDown:x?void 0:Ue,onMouseDown:$e,onFocus:je,onBlur:He,role:"combobox","aria-haspopup":"tree","aria-expanded":l,"aria-disabled":x,"aria-label":L,"aria-labelledby":n.ariaLabelledBy,"aria-describedby":n.ariaDescribedBy?n.ariaDescribedBy:"tagslist-"+T,"aria-required":n.required,onClick:x?void 0:Ge},t.createElement("div",{id:"tagslist-"+T,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${Te[y]||y}`]:y})},Y.length>0&&t.createElement(st,{tag:n.tag,onTagDelete:Je,data:Y,guid:T,focused:P?G.current.find(e=>ee.matchTags(e,P,K)):void 0,size:y})),t.createElement("span",{className:"k-input-inner"},Y.length===0&&t.createElement("span",{className:"k-input-value-text"},ue)),n.loading&&t.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ie&&!x&&Y.length>0&&t.createElement(ot,{onClick:oe}),t.createElement("select",{name:Re,ref:H,tabIndex:-1,"aria-hidden":!0,title:L,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},t.createElement("option",{value:n.valueMap?n.valueMap.call(void 0,g):g})),!O&&t.createElement(et.Popup,{...N,popupClass:i.classNames(N.popupClass,"k-multiselecttree-popup"),className:i.classNames(N.className,{"k-rtl":D==="rtl"}),style:Ve,anchor:N.anchor||F.current,show:l,onOpen:ze,onClose:_e,ref:U},n.filterable&&t.createElement(Ie,{value:n.filter===void 0?he:n.filter,ref:M,onChange:Ce,onKeyDown:ye,tabIndex:j,size:y,rounded:V,fillMode:z,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),B.length>0?t.createElement(we.TreeView,{style:{height:N.height},ref:S,tabIndex:j,data:B,focusIdField:K,textField:n.textField,checkField:pe,checkIndeterminateField:fe,expandField:n.expandField,childrenField:ge,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:be,checkboxes:!0,size:y,item:n.item,dir:D}):t.createElement(Ee,null,X.toLanguageString(m.nodata,m.messages[m.nodata])))),O&&Qe());return L?t.createElement(it.FloatingLabel,{label:L,editorValue:ie,editorPlaceholder:ue,editorValid:Fe,editorDisabled:x,editorId:T,style:{width:A?A.width:void 0},children:xe,dir:D}):xe}),vt={opened:a.bool,disabled:a.bool,dir:a.string,tabIndex:a.number,accessKey:a.string,data:a.array,value:a.any,valueMap:a.func,placeholder:a.string,dataItemKey:a.string.isRequired,textField:a.string.isRequired,checkField:a.string,checkIndeterminateField:a.string,expandField:a.string,subItemsField:a.string,className:a.string,style:a.object,label:a.string,validationMessage:a.string,validityStyles:a.bool,valid:a.bool,required:a.bool,name:a.string,id:a.string,ariaLabelledBy:a.string,ariaDescribedBy:a.string,filterable:a.bool,filter:a.string,loading:a.bool,tags:a.arrayOf(a.shape({text:a.string,data:a.arrayOf(a.any)})),popupSettings:a.shape({animate:a.oneOfType([a.bool,a.shape({openDuration:a.number,closeDuration:a.number})]),popupClass:a.string,className:a.string,appendTo:a.any,width:a.oneOfType([a.string,a.number]),height:a.oneOfType([a.string,a.number])}),onOpen:a.func,onClose:a.func,onFocus:a.func,onBlur:a.func,onChange:a.func,onFilterChange:a.func,onExpandChange:a.func,onCancel:a.func,item:a.func,listNoData:a.func,adaptiveTitle:a.string,adaptive:a.bool};ce.displayName="KendoReactMultiSelectTree";ce.propTypes=vt;exports.MultiSelectTree=ce;exports.MultiSelectTreePropsContext=Ke;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("react"),a=require("prop-types"),o=require("@progress/kendo-react-common"),tt=require("@progress/kendo-react-popup"),nt=require("@progress/kendo-react-intl"),Ie=require("@progress/kendo-react-treeview"),at=require("../package-metadata.js"),ee=require("../common/utils.js"),rt=require("../DropDownTree/useDropdownWidth.js"),ot=require("../DropDownTree/ListNoData.js"),v=require("../messages/index.js"),it=require("@progress/kendo-react-labels"),st=require("../MultiSelect/TagList.js"),lt=require("../common/ClearButton.js"),Te=require("../common/ListFilter.js"),ct=require("../common/AdaptiveMode.js"),ut=require("@progress/kendo-react-layout");function dt(h){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const n in h)if(n!=="default"){const I=Object.getOwnPropertyDescriptor(h,n);Object.defineProperty(b,n,I.get?I:{enumerable:!0,get:()=>h[n]})}}return b.default=h,Object.freeze(b)}const t=dt(et),pt="Please select a value from the list!",{sizeMap:Ke,roundedMap:ft}=o.kendoThemeMaps,gt=h=>h.split("_").map(b=>parseInt(b,10)),mt=(h,b)=>{const{validationMessage:n,valid:I,required:T}=h;return{customError:n!==void 0,valid:!!(I!==void 0?I:!T||b),valueMissing:!b}},E={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Me=o.createPropsContext(),ce=t.forwardRef((h,b)=>{const n=o.usePropsContext(Me,h);o.validatePackage(at.packageMetadata);const I=o.useId(),T=n.id||I,{data:B=[],dataItemKey:K,style:L={},placeholder:ue,label:A,name:Re,validationMessage:W,valid:De,tags:de,value:g,opened:M,disabled:x,popupSettings:N=E.popupSettings,checkField:pe=E.checkField,checkIndeterminateField:fe=E.checkIndeterminateField,subItemsField:ge=E.subItemsField,size:y=E.size,rounded:V=E.rounded,fillMode:z=E.fillMode,required:me=E.required,validityStyles:qe=E.validityStyles,onOpen:te=o.noop,onClose:j=o.noop}=n,_=o.getTabIndex(n.tabIndex,x),s=t.useRef(null),F=t.useRef(null),R=t.useRef(null),ne=t.useRef(null),H=t.useRef(null),S=t.useRef(null),$=t.useRef(!1),G=t.useRef([]),U=t.useRef(null),[P,Ne]=t.useState(),[Pe,ve]=t.useState(!1),[d,ae]=t.useState(!1),[re,Oe]=t.useState(),[Le,Ae]=t.useState([]),[he,Ve]=t.useState(""),l=M!==void 0?M:Pe,oe=!!(Array.isArray(g)&&g.length),ie=mt({validationMessage:W,valid:De,required:me},oe),D=o.useRtl(F,n.dir),Be={width:rt.useDropdownWidth(F,E,N,L),...D!==void 0?{direction:D}:{}},We=t.useCallback(()=>F.current&&F.current.focus(),[]),ye=o.useAdaptiveModeContext(),O=!!(re&&ye&&re<=ye.medium&&n.adaptive);G.current=de===void 0?(g||[]).map(e=>({text:ee.getItemValue(e,n.textField),data:[e]})):[...de],t.useImperativeHandle(s,()=>({props:n,element:F.current,focus:We})),t.useImperativeHandle(b,()=>s.current);const ze=t.useCallback(()=>{H.current&&H.current.setCustomValidity&&H.current.setCustomValidity(ie.valid?"":W===void 0?pt:W)},[W,ie]);t.useEffect(ze),t.useEffect(()=>{const e=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ye.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}},[]),t.useEffect(()=>{U.current&&l&&U.current.setPosition(U.current.element)},[g,l]);const w=t.useCallback((e,r,i)=>{if(n.onChange){const k={items:r,operation:i,...e};n.onChange.call(void 0,k)}},[n.onChange]),J=t.useCallback(e=>{if(ee.areSame(e.item,g,K)||!s.current)return;const{item:r,nativeEvent:i,syntheticEvent:k}=e,q={syntheticEvent:k,nativeEvent:i,target:s.current};w(q,[r],"toggle")},[g,K,w]),Q=t.useCallback(e=>{if(!l){if(te){const r={...e};te.call(void 0,r)}M===void 0&&(ve(!0),Ae(g||[]),O&&setTimeout(()=>{var r;u((r=ne.current)==null?void 0:r.element)},300))}},[l,M,te,O,ne]),m=t.useCallback(e=>{if(l){if(j){const r={...e};j.call(void 0,r)}M===void 0&&ve(!1)}},[l,M,j]),C=t.useCallback(e=>{$.current=!0,e(),window.setTimeout(()=>$.current=!1,0)},[]),u=t.useCallback(e=>{e&&C(()=>e.focus())},[C]),je=t.useCallback(()=>{var e;!d&&l?m({target:s.current}):n.filterable?u((e=R.current)==null?void 0:e.element):u(S.current&&S.current.element)},[d,l,u,m,n.filterable]),_e=t.useCallback(()=>{d&&u(F.current)},[d,u]),He=t.useCallback(e=>{if(!d&&!$.current&&(ae(!0),n.onFocus&&s.current)){const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};n.onFocus.call(void 0,r)}},[d,n.onFocus]),$e=t.useCallback(e=>{if(d&&!$.current&&s.current){ae(!1);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};if(n.onBlur){const i={...r};n.onBlur.call(void 0,i)}O||m(r)}},[d,n.onBlur,l,M,j]),Ge=t.useCallback(()=>{d&&C(o.noop)},[d,C]),Ue=t.useCallback(e=>{if(!e.isDefaultPrevented()&&s.current){ae(!0);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};l||Q(r)}},[l,Q]),Je=t.useCallback(e=>{var Z,we;const{keyCode:r,altKey:i}=e,k=S.current&&S.current.element;if(!s.current||e.isDefaultPrevented()&&((Z=R.current)==null?void 0:Z.element)===e.target)return;const q={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};if(g&&g.length>0&&(r===o.Keys.left||r===o.Keys.right||r===o.Keys.home||r===o.Keys.end||r===o.Keys.delete)){const c=G.current;let p=P?c.findIndex(Ze=>ee.matchTags(Ze,P,K)):-1,f;const le=p!==-1;r===o.Keys.left?(le?p=Math.max(0,p-1):p=c.length-1,f=c[p]):r===o.Keys.right?p===c.length-1?f=void 0:le&&(p=Math.min(c.length-1,p+1),f=c[p]):r===o.Keys.home?f=c[0]:r===o.Keys.end?f=c[c.length-1]:r===o.Keys.delete&&le&&w(q,c[p].data,"delete"),f!==P&&Ne(f)}if(l)if(r===o.Keys.esc||i&&r===o.Keys.up)e.preventDefault(),m(q);else if(k&&k.querySelector(".k-focus")&&(r===o.Keys.up||r===o.Keys.down||r===o.Keys.left||r===o.Keys.right||r===o.Keys.home||r===o.Keys.end)){if(r===o.Keys.up&&((we=R.current)!=null&&we.element)){const c=Array.from(k.querySelectorAll(".k-treeview-item")),p=[...c].reverse().find(f=>!!(f&&f.querySelector(".k-focus")));if(p&&c.indexOf(p)===0)return C(()=>{var f;u((f=R.current)==null?void 0:f.element)})}C(o.noop)}else r===o.Keys.down&&C(()=>{var c;u(((c=R.current)==null?void 0:c.element)||k)});else i&&r===o.Keys.down&&(e.preventDefault(),Q(q))},[l,m,u,C,Q,P,K,g,w]),be=t.useCallback(e=>{const{keyCode:r,altKey:i}=e;i||r!==o.Keys.up&&r!==o.Keys.down||(e.preventDefault(),C(r===o.Keys.up?()=>{u(F.current)}:()=>{u(S.current&&S.current.element)}))},[u,C]),se=t.useCallback(e=>{if(!s.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};w(r,[],"clear"),m(r),e.preventDefault()},[w,m]),Qe=t.useCallback((e,r)=>{var i;m({target:s.current}),d||u((i=R.current)==null?void 0:i.element),w({syntheticEvent:r,nativeEvent:r.nativeEvent,target:s.current},e,"delete")},[w,m,u,d]),Ce=t.useCallback(e=>{if(n.onExpandChange&&s.current){const{item:r,itemHierarchicalIndex:i,nativeEvent:k,syntheticEvent:q}=e,Z={level:gt(i),item:r,nativeEvent:k,syntheticEvent:q,target:s.current};n.onExpandChange.call(void 0,Z)}},[n.onExpandChange]),ke=t.useCallback(e=>{if(n.onFilterChange&&s.current){const i={filter:{field:n.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:s.current};n.onFilterChange.call(void 0,i),n.filter===void 0&&Ve(e.target.value)}},[n.onFilterChange,n.filter,n.textField]),Ee=t.useCallback(e=>{if(!s.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};n.onCancel&&n.onCancel.call(void 0,r),m(r),e.preventDefault()},[n.onCancel,m]),Xe=()=>{const e=n.filterable?t.createElement(Te,{value:n.filter===void 0?he:n.filter,ref:ne,onChange:ke,onKeyDown:be,size:y,rounded:V,fillMode:z}):null,r={title:n.adaptiveTitle,expand:l,onClose:i=>n.onCancel?Ee(i):se(i),windowWidth:re,mobileFilter:e,footer:{cancelText:X.toLanguageString(v.adaptiveModeFooterCancel,v.messages[v.adaptiveModeFooterCancel]),onCancel:i=>n.onCancel?Ee(i):se(i),applyText:X.toLanguageString(v.adaptiveModeFooterApply,v.messages[v.adaptiveModeFooterApply]),onApply:i=>m(i)}};return t.createElement(ct.AdaptiveMode,{...r},t.createElement(ut.ActionSheetContent,{overflowHidden:!0},t.createElement("div",{className:"k-list-container"},t.createElement("div",{className:"k-list k-list-lg"},B.length>0?t.createElement(Ie.TreeView,{ref:S,tabIndex:_,data:B,focusIdField:K,textField:n.textField,checkField:pe,checkIndeterminateField:fe,expandField:n.expandField,childrenField:ge,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:Ce,checkboxes:!0,size:y,item:n.item,dir:D}):t.createElement(Fe,null,X.toLanguageString(v.nodata,v.messages[v.nodata]))))))},Ye=t.useCallback(e=>{for(const r of e)Oe(r.target.clientWidth)},[]),Fe=n.listNoData||ot.ListNoData,X=nt.useLocalization(),xe=!qe||ie.valid,Y=O&&l?Le:G.current,Se=t.createElement(t.Fragment,null,t.createElement("span",{className:o.classNames("k-multiselecttree k-input",n.className,{[`k-input-${Ke[y]||y}`]:y,[`k-rounded-${ft[V]||V}`]:V,[`k-input-${z}`]:z,"k-focus":d&&!x,"k-invalid":!xe,"k-disabled":x,"k-loading":n.loading,"k-required":me}),tabIndex:_,accessKey:n.accessKey,id:T,style:A?{...L,width:void 0}:L,dir:D,ref:F,onKeyDown:x?void 0:Je,onMouseDown:Ge,onFocus:He,onBlur:$e,role:"combobox","aria-haspopup":"tree","aria-expanded":l,"aria-disabled":x,"aria-label":A,"aria-labelledby":n.ariaLabelledBy,"aria-describedby":n.ariaDescribedBy?n.ariaDescribedBy:"tagslist-"+T,"aria-required":n.required,onClick:x?void 0:Ue},t.createElement("div",{id:"tagslist-"+T,className:o.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ke[y]||y}`]:y})},Y.length>0&&t.createElement(st,{tag:n.tag,onTagDelete:Qe,data:Y,guid:T,focused:P?G.current.find(e=>ee.matchTags(e,P,K)):void 0,size:y})),t.createElement("span",{className:"k-input-inner"},Y.length===0&&t.createElement("span",{className:"k-input-value-text"},ue)),n.loading&&t.createElement(o.IconWrap,{className:"k-input-loading-icon",name:"loading"}),oe&&!x&&Y.length>0&&t.createElement(lt,{onClick:se}),t.createElement("select",{name:Re,ref:H,tabIndex:-1,"aria-hidden":!0,title:A,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},t.createElement("option",{value:n.valueMap?n.valueMap.call(void 0,g):g})),!O&&t.createElement(tt.Popup,{...N,popupClass:o.classNames(N.popupClass,"k-multiselecttree-popup"),className:o.classNames(N.className,{"k-rtl":D==="rtl"}),style:Be,anchor:N.anchor||F.current,show:l,onOpen:je,onClose:_e,ref:U},n.filterable&&t.createElement(Te,{value:n.filter===void 0?he:n.filter,ref:R,onChange:ke,onKeyDown:be,tabIndex:_,size:y,rounded:V,fillMode:z,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),B.length>0?t.createElement(Ie.TreeView,{style:{height:N.height},ref:S,tabIndex:_,data:B,focusIdField:K,textField:n.textField,checkField:pe,checkIndeterminateField:fe,expandField:n.expandField,childrenField:ge,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:Ce,checkboxes:!0,size:y,item:n.item,dir:D}):t.createElement(Fe,null,X.toLanguageString(v.nodata,v.messages[v.nodata])))),O&&Xe());return A?t.createElement(it.FloatingLabel,{label:A,editorValue:oe,editorPlaceholder:ue,editorValid:xe,editorDisabled:x,editorId:T,style:{width:L?L.width:void 0},children:Se,dir:D}):Se}),vt={opened:a.bool,disabled:a.bool,dir:a.string,tabIndex:a.number,accessKey:a.string,data:a.array,value:a.any,valueMap:a.func,placeholder:a.string,dataItemKey:a.string.isRequired,textField:a.string.isRequired,checkField:a.string,checkIndeterminateField:a.string,expandField:a.string,subItemsField:a.string,className:a.string,style:a.object,label:a.string,validationMessage:a.string,validityStyles:a.bool,valid:a.bool,required:a.bool,name:a.string,id:a.string,ariaLabelledBy:a.string,ariaDescribedBy:a.string,filterable:a.bool,filter:a.string,loading:a.bool,tags:a.arrayOf(a.shape({text:a.string,data:a.arrayOf(a.any)})),popupSettings:a.shape({animate:a.oneOfType([a.bool,a.shape({openDuration:a.number,closeDuration:a.number})]),popupClass:a.string,className:a.string,appendTo:a.any,width:a.oneOfType([a.string,a.number]),height:a.oneOfType([a.string,a.number])}),onOpen:a.func,onClose:a.func,onFocus:a.func,onBlur:a.func,onChange:a.func,onFilterChange:a.func,onExpandChange:a.func,onCancel:a.func,item:a.func,listNoData:a.func,adaptiveTitle:a.string,adaptive:a.bool};ce.displayName="KendoReactMultiSelectTree";ce.propTypes=vt;exports.MultiSelectTree=ce;exports.MultiSelectTreePropsContext=Me;