@progress/kendo-react-dropdowns 11.4.0-develop.5 → 11.4.0-develop.7
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.
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +52 -52
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +109 -109
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +175 -175
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +224 -224
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +95 -95
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +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 et=require("react"),a=require("prop-types"),i=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"),Z=require("../common/utils.js"),rt=require("../DropDownTree/useDropdownWidth.js"),it=require("../DropDownTree/ListNoData.js"),P=require("../messages/index.js"),st=require("@progress/kendo-react-labels"),ot=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(v){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(v){for(const t in v)if(t!=="default"){const w=Object.getOwnPropertyDescriptor(v,t);Object.defineProperty(h,t,w.get?w:{enumerable:!0,get:()=>v[t]})}}return h.default=v,Object.freeze(h)}const n=dt(et),pt="Please select a value from the list!",{sizeMap:Ke,roundedMap:ft}=i.kendoThemeMaps,gt=v=>v.split("_").map(h=>parseInt(h,10)),mt=(v,h)=>{const{validationMessage:t,valid:w,required:ee}=v;return{customError:t!==void 0,valid:!!(w!==void 0?w:!ee||h),valueMissing:!h}},k={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Re=i.createPropsContext(),ce=n.forwardRef((v,h)=>{const t=i.usePropsContext(Re,v),w=!i.validatePackage(at.packageMetadata,{component:"MultiSelectTree"}),ee=i.useId(),N=t.id||ee,{data:B=[],dataItemKey:I,style:L={},placeholder:te,label:V,name:De,validationMessage:z,valid:Me,tags:ue,value:g,opened:T,disabled:F,popupSettings:q=k.popupSettings,checkField:de=k.checkField,checkIndeterminateField:pe=k.checkIndeterminateField,subItemsField:fe=k.subItemsField,size:C=k.size,rounded:W=k.rounded,fillMode:A=k.fillMode,required:ge=k.required,validityStyles:qe=k.validityStyles,onOpen:ne=i.noop,onClose:j=i.noop}=t,_=i.getTabIndex(t.tabIndex,F),s=n.useRef(null),E=n.useRef(null),K=n.useRef(null),ae=n.useRef(null),$=n.useRef(null),x=n.useRef(null),H=n.useRef(!1),G=n.useRef([]),U=n.useRef(null),[O,Oe]=n.useState(),[Pe,me]=n.useState(!1),[d,re]=n.useState(!1),[ie,Ne]=n.useState(),[Le,Ve]=n.useState([]),[ve,We]=n.useState(""),l=T!==void 0?T:Pe,se=!!(Array.isArray(g)&&g.length),oe=mt({validationMessage:z,valid:Me,required:ge},se),R=i.useRtl(E,t.dir),Be={width:rt.useDropdownWidth(E,k,q,L),...R!==void 0?{direction:R}:{}},ze=n.useCallback(()=>E.current&&E.current.focus(),[]),he=i.useAdaptiveModeContext(),D=!!(ie&&he&&ie<=he.medium&&t.adaptive);G.current=ue===void 0?(g||[]).map(e=>({text:Z.getItemValue(e,t.textField),data:[e]})):[...ue],n.useImperativeHandle(s,()=>({props:t,element:E.current,focus:ze})),n.useImperativeHandle(h,()=>s.current);const Ae=n.useCallback(()=>{$.current&&$.current.setCustomValidity&&$.current.setCustomValidity(oe.valid?"":z===void 0?pt:z)},[z,oe]);n.useEffect(Ae),n.useEffect(()=>{const e=i.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ye.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}},[]),n.useEffect(()=>{U.current&&l&&U.current.setPosition(U.current.element)},[g,l]);const S=n.useCallback((e,r,o)=>{if(t.onChange){const b={items:r,operation:o,...e};t.onChange.call(void 0,b)}},[t.onChange]),J=n.useCallback(e=>{if(Z.areSame(e.item,g,I)||!s.current)return;const{item:r,nativeEvent:o,syntheticEvent:b}=e,M={syntheticEvent:b,nativeEvent:o,target:s.current};S(M,[r],"toggle")},[g,I,S]),Q=n.useCallback(e=>{if(!l){if(ne){const r={...e};ne.call(void 0,r)}T===void 0&&(me(!0),Ve(g||[]),D&&setTimeout(()=>{var r;u((r=ae.current)==null?void 0:r.element)},300))}},[l,T,ne,D,ae]),m=n.useCallback(e=>{if(l){if(j){const r={...e};j.call(void 0,r)}T===void 0&&me(!1)}},[l,T,j]),y=n.useCallback(e=>{H.current=!0,e(),window.setTimeout(()=>H.current=!1,0)},[]),u=n.useCallback(e=>{e&&y(()=>e.focus())},[y]),je=n.useCallback(()=>{var e;!d&&l?m({target:s.current}):t.filterable?u((e=K.current)==null?void 0:e.element):u(x.current&&x.current.element)},[d,l,u,m,t.filterable]),_e=n.useCallback(()=>{d&&u(E.current)},[d,u]),$e=n.useCallback(e=>{if(!d&&!H.current&&(re(!0),t.onFocus&&s.current)){const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};t.onFocus.call(void 0,r)}},[d,t.onFocus]),He=n.useCallback(e=>{if(d&&!H.current&&s.current){re(!1);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};if(t.onBlur){const o={...r};t.onBlur.call(void 0,o)}D||m(r)}},[d,t.onBlur,l,T,j]),Ge=n.useCallback(()=>{d&&y(i.noop)},[d,y]),ye=n.useCallback(e=>{if(!e.isDefaultPrevented()&&s.current){re(!0);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};l||Q(r)}},[l,Q]),Ue=n.useCallback(e=>{var Y,we;const{keyCode:r,altKey:o}=e,b=x.current&&x.current.element;if(!s.current||e.isDefaultPrevented()&&((Y=K.current)==null?void 0:Y.element)===e.target)return;const M={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.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=O?c.findIndex(Ze=>Z.matchTags(Ze,O,I)):-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&&S(M,c[p].data,"delete"),f!==O&&Oe(f)}if(l)if(r===i.Keys.esc||o&&r===i.Keys.up)e.preventDefault(),m(M);else if(b&&b.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&&((we=K.current)!=null&&we.element)){const c=Array.from(b.querySelectorAll(".k-treeview-item")),p=[...c].reverse().find(f=>!!(f&&f.querySelector(".k-focus")));if(p&&c.indexOf(p)===0)return y(()=>{var f;u((f=K.current)==null?void 0:f.element)})}y(i.noop)}else r===i.Keys.down&&y(()=>{var c;u(((c=K.current)==null?void 0:c.element)||b)});else o&&r===i.Keys.down&&(e.preventDefault(),Q(M))},[l,m,u,y,Q,O,I,g,S]),be=n.useCallback(e=>{const{keyCode:r,altKey:o}=e;o||r!==i.Keys.up&&r!==i.Keys.down||(e.preventDefault(),y(r===i.Keys.up?()=>{u(E.current)}:()=>{u(x.current&&x.current.element)}))},[u,y]),Je=n.useCallback(e=>{if(!s.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};S(r,[],"clear"),m(r),e.preventDefault()},[S,m]),Qe=n.useCallback((e,r)=>{var o;m({target:s.current}),d||u((o=K.current)==null?void 0:o.element),S({syntheticEvent:r,nativeEvent:r.nativeEvent,target:s.current},e,"delete")},[S,m,u,d]),ke=n.useCallback(e=>{if(t.onExpandChange&&s.current){const{item:r,itemHierarchicalIndex:o,nativeEvent:b,syntheticEvent:M}=e,Y={level:gt(o),item:r,nativeEvent:b,syntheticEvent:M,target:s.current};t.onExpandChange.call(void 0,Y)}},[t.onExpandChange]),Ce=n.useCallback(e=>{if(t.onFilterChange&&s.current){const o={filter:{field:t.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:s.current};t.onFilterChange.call(void 0,o),t.filter===void 0&&We(e.target.value)}},[t.onFilterChange,t.filter,t.textField]);n.useCallback(e=>{if(!s.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};t.onCancel&&t.onCancel.call(void 0,r),m(r),e.preventDefault()},[t.onCancel,m]);const Xe=()=>{const e=t.filterable?n.createElement(Te,{value:t.filter===void 0?ve:t.filter,ref:ae,onChange:Ce,onKeyDown:be,size:"large",rounded:W,fillMode:A,placeholder:te}):null,r={title:t.adaptiveTitle||t.label,subTitle:t.adaptiveSubtitle,expand:l,onClose:o=>m(o),windowWidth:ie,mobileFilter:e};return n.createElement(ct.AdaptiveMode,{...r},n.createElement(ut.ActionSheetContent,null,B.length>0?n.createElement(Ie.TreeView,{ref:x,tabIndex:_,data:B,focusIdField:I,textField:t.textField,checkField:de,checkIndeterminateField:pe,expandField:t.expandField,childrenField:fe,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:"large",item:t.item,dir:R}):n.createElement(Ee,null,Fe.toLanguageString(P.nodata,P.messages[P.nodata]))))},Ye=n.useCallback(e=>{for(const r of e)Ne(r.target.clientWidth)},[]),Ee=t.listNoData||it.ListNoData,Fe=nt.useLocalization(),xe=!qe||oe.valid,X=D&&l?Le:G.current,Se=n.createElement(n.Fragment,null,n.createElement("span",{className:i.classNames("k-multiselecttree k-input",t.className,{[`k-input-${Ke[C]||C}`]:C,[`k-rounded-${ft[W]||W}`]:W,[`k-input-${A}`]:A,"k-focus":d&&!F,"k-invalid":!xe,"k-disabled":F,"k-loading":t.loading,"k-required":ge}),tabIndex:_,accessKey:t.accessKey,id:N,style:V?{...L,width:void 0}:L,dir:R,ref:E,onKeyDown:F?void 0:Ue,onMouseDown:Ge,onFocus:e=>{D?ye(e):$e(e)},onBlur:He,role:"combobox","aria-haspopup":"tree","aria-expanded":l,"aria-disabled":F,"aria-label":V,"aria-labelledby":t.ariaLabelledBy,"aria-describedby":t.ariaDescribedBy?t.ariaDescribedBy:"tagslist-"+N,"aria-required":t.required,onClick:F?void 0:ye},n.createElement("div",{id:"tagslist-"+N,className:i.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ke[C]||C}`]:C})},X.length>0&&n.createElement(ot,{tag:t.tag,onTagDelete:Qe,data:X,guid:N,focused:O?G.current.find(e=>Z.matchTags(e,O,I)):void 0,size:C})),n.createElement("span",{className:"k-input-inner"},X.length===0&&n.createElement("span",{className:"k-input-value-text"},te)),t.loading&&n.createElement(i.IconWrap,{className:"k-input-loading-icon",name:"loading"}),se&&!F&&X.length>0&&n.createElement(lt,{onClick:Je}),n.createElement("select",{name:De,ref:$,tabIndex:-1,"aria-hidden":!0,title:V,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},n.createElement("option",{value:t.valueMap?t.valueMap.call(void 0,g):g})),!D&&n.createElement(tt.Popup,{...q,popupClass:i.classNames(q.popupClass,"k-multiselecttree-popup"),className:i.classNames(q.className,{"k-rtl":R==="rtl"}),style:Be,anchor:q.anchor||E.current,show:l,onOpen:je,onClose:_e,ref:U},t.filterable&&n.createElement(Te,{value:t.filter===void 0?ve:t.filter,ref:K,onChange:Ce,onKeyDown:be,tabIndex:_,size:C,rounded:W,fillMode:A,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),B.length>0?n.createElement(Ie.TreeView,{style:{height:q.height},ref:x,tabIndex:_,data:B,focusIdField:I,textField:t.textField,checkField:de,checkIndeterminateField:pe,expandField:t.expandField,childrenField:fe,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:C,item:t.item,dir:R}):n.createElement(Ee,null,Fe.toLanguageString(P.nodata,P.messages[P.nodata])),w&&n.createElement(i.WatermarkOverlay,null))),D&&Xe());return V?n.createElement(st.FloatingLabel,{label:V,editorValue:se,editorPlaceholder:te,editorValid:xe,editorDisabled:F,editorId:N,style:{width:L?L.width:void 0},children:Se,dir:R}):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,adaptiveSubtitle:a.string,adaptive:a.bool};ce.displayName="KendoReactMultiSelectTree";ce.propTypes=vt;exports.MultiSelectTree=ce;exports.MultiSelectTreePropsContext=Re;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nt=require("react"),a=require("prop-types"),s=require("@progress/kendo-react-common"),at=require("@progress/kendo-react-popup"),rt=require("@progress/kendo-react-intl"),Ie=require("@progress/kendo-react-treeview"),Te=require("../package-metadata.js"),Z=require("../common/utils.js"),st=require("../DropDownTree/useDropdownWidth.js"),it=require("../DropDownTree/ListNoData.js"),P=require("../messages/index.js"),ot=require("@progress/kendo-react-labels"),lt=require("../MultiSelect/TagList.js"),ct=require("../common/ClearButton.js"),Ke=require("../common/ListFilter.js"),ut=require("../common/AdaptiveMode.js"),dt=require("@progress/kendo-react-layout");function pt(v){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(v){for(const t in v)if(t!=="default"){const w=Object.getOwnPropertyDescriptor(v,t);Object.defineProperty(h,t,w.get?w:{enumerable:!0,get:()=>v[t]})}}return h.default=v,Object.freeze(h)}const n=pt(nt),ft="Please select a value from the list!",{sizeMap:Me,roundedMap:gt}=s.kendoThemeMaps,mt=v=>v.split("_").map(h=>parseInt(h,10)),vt=(v,h)=>{const{validationMessage:t,valid:w,required:ee}=v;return{customError:t!==void 0,valid:!!(w!==void 0?w:!ee||h),valueMissing:!h}},k={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},Re=s.createPropsContext(),ce=n.forwardRef((v,h)=>{const t=s.usePropsContext(Re,v),w=!s.validatePackage(Te.packageMetadata,{component:"MultiSelectTree"}),ee=s.getLicenseMessage(Te.packageMetadata),De=s.useId(),N=t.id||De,{data:B=[],dataItemKey:I,style:L={},placeholder:te,label:V,name:qe,validationMessage:z,valid:Oe,tags:ue,value:g,opened:T,disabled:F,popupSettings:q=k.popupSettings,checkField:de=k.checkField,checkIndeterminateField:pe=k.checkIndeterminateField,subItemsField:fe=k.subItemsField,size:C=k.size,rounded:W=k.rounded,fillMode:A=k.fillMode,required:ge=k.required,validityStyles:Pe=k.validityStyles,onOpen:ne=s.noop,onClose:j=s.noop}=t,_=s.getTabIndex(t.tabIndex,F),i=n.useRef(null),E=n.useRef(null),K=n.useRef(null),ae=n.useRef(null),$=n.useRef(null),x=n.useRef(null),H=n.useRef(!1),G=n.useRef([]),U=n.useRef(null),[O,Ne]=n.useState(),[Le,me]=n.useState(!1),[d,re]=n.useState(!1),[se,Ve]=n.useState(),[We,Be]=n.useState([]),[ve,ze]=n.useState(""),l=T!==void 0?T:Le,ie=!!(Array.isArray(g)&&g.length),oe=vt({validationMessage:z,valid:Oe,required:ge},ie),M=s.useRtl(E,t.dir),Ae={width:st.useDropdownWidth(E,k,q,L),...M!==void 0?{direction:M}:{}},je=n.useCallback(()=>E.current&&E.current.focus(),[]),he=s.useAdaptiveModeContext(),R=!!(se&&he&&se<=he.medium&&t.adaptive);G.current=ue===void 0?(g||[]).map(e=>({text:Z.getItemValue(e,t.textField),data:[e]})):[...ue],n.useImperativeHandle(i,()=>({props:t,element:E.current,focus:je})),n.useImperativeHandle(h,()=>i.current);const _e=n.useCallback(()=>{$.current&&$.current.setCustomValidity&&$.current.setCustomValidity(oe.valid?"":z===void 0?ft:z)},[z,oe]);n.useEffect(_e),n.useEffect(()=>{const e=s.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(et.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{e&&e.disconnect()}},[]),n.useEffect(()=>{U.current&&l&&U.current.setPosition(U.current.element)},[g,l]);const S=n.useCallback((e,r,o)=>{if(t.onChange){const b={items:r,operation:o,...e};t.onChange.call(void 0,b)}},[t.onChange]),J=n.useCallback(e=>{if(Z.areSame(e.item,g,I)||!i.current)return;const{item:r,nativeEvent:o,syntheticEvent:b}=e,D={syntheticEvent:b,nativeEvent:o,target:i.current};S(D,[r],"toggle")},[g,I,S]),Q=n.useCallback(e=>{if(!l){if(ne){const r={...e};ne.call(void 0,r)}T===void 0&&(me(!0),Be(g||[]),R&&setTimeout(()=>{var r;u((r=ae.current)==null?void 0:r.element)},300))}},[l,T,ne,R,ae]),m=n.useCallback(e=>{if(l){if(j){const r={...e};j.call(void 0,r)}T===void 0&&me(!1)}},[l,T,j]),y=n.useCallback(e=>{H.current=!0,e(),window.setTimeout(()=>H.current=!1,0)},[]),u=n.useCallback(e=>{e&&y(()=>e.focus())},[y]),$e=n.useCallback(()=>{var e;!d&&l?m({target:i.current}):t.filterable?u((e=K.current)==null?void 0:e.element):u(x.current&&x.current.element)},[d,l,u,m,t.filterable]),He=n.useCallback(()=>{d&&u(E.current)},[d,u]),Ge=n.useCallback(e=>{if(!d&&!H.current&&(re(!0),t.onFocus&&i.current)){const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};t.onFocus.call(void 0,r)}},[d,t.onFocus]),Ue=n.useCallback(e=>{if(d&&!H.current&&i.current){re(!1);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};if(t.onBlur){const o={...r};t.onBlur.call(void 0,o)}R||m(r)}},[d,t.onBlur,l,T,j]),Je=n.useCallback(()=>{d&&y(s.noop)},[d,y]),ye=n.useCallback(e=>{if(!e.isDefaultPrevented()&&i.current){re(!0);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};l||Q(r)}},[l,Q]),Qe=n.useCallback(e=>{var Y,we;const{keyCode:r,altKey:o}=e,b=x.current&&x.current.element;if(!i.current||e.isDefaultPrevented()&&((Y=K.current)==null?void 0:Y.element)===e.target)return;const D={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};if(g&&g.length>0&&(r===s.Keys.left||r===s.Keys.right||r===s.Keys.home||r===s.Keys.end||r===s.Keys.delete)){const c=G.current;let p=O?c.findIndex(tt=>Z.matchTags(tt,O,I)):-1,f;const le=p!==-1;r===s.Keys.left?(le?p=Math.max(0,p-1):p=c.length-1,f=c[p]):r===s.Keys.right?p===c.length-1?f=void 0:le&&(p=Math.min(c.length-1,p+1),f=c[p]):r===s.Keys.home?f=c[0]:r===s.Keys.end?f=c[c.length-1]:r===s.Keys.delete&&le&&S(D,c[p].data,"delete"),f!==O&&Ne(f)}if(l)if(r===s.Keys.esc||o&&r===s.Keys.up)e.preventDefault(),m(D);else if(b&&b.querySelector(".k-focus")&&(r===s.Keys.up||r===s.Keys.down||r===s.Keys.left||r===s.Keys.right||r===s.Keys.home||r===s.Keys.end)){if(r===s.Keys.up&&((we=K.current)!=null&&we.element)){const c=Array.from(b.querySelectorAll(".k-treeview-item")),p=[...c].reverse().find(f=>!!(f&&f.querySelector(".k-focus")));if(p&&c.indexOf(p)===0)return y(()=>{var f;u((f=K.current)==null?void 0:f.element)})}y(s.noop)}else r===s.Keys.down&&y(()=>{var c;u(((c=K.current)==null?void 0:c.element)||b)});else o&&r===s.Keys.down&&(e.preventDefault(),Q(D))},[l,m,u,y,Q,O,I,g,S]),be=n.useCallback(e=>{const{keyCode:r,altKey:o}=e;o||r!==s.Keys.up&&r!==s.Keys.down||(e.preventDefault(),y(r===s.Keys.up?()=>{u(E.current)}:()=>{u(x.current&&x.current.element)}))},[u,y]),Xe=n.useCallback(e=>{if(!i.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};S(r,[],"clear"),m(r),e.preventDefault()},[S,m]),Ye=n.useCallback((e,r)=>{var o;m({target:i.current}),d||u((o=K.current)==null?void 0:o.element),S({syntheticEvent:r,nativeEvent:r.nativeEvent,target:i.current},e,"delete")},[S,m,u,d]),ke=n.useCallback(e=>{if(t.onExpandChange&&i.current){const{item:r,itemHierarchicalIndex:o,nativeEvent:b,syntheticEvent:D}=e,Y={level:mt(o),item:r,nativeEvent:b,syntheticEvent:D,target:i.current};t.onExpandChange.call(void 0,Y)}},[t.onExpandChange]),Ce=n.useCallback(e=>{if(t.onFilterChange&&i.current){const o={filter:{field:t.textField,operator:"contains",value:e.target.value},syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,target:i.current};t.onFilterChange.call(void 0,o),t.filter===void 0&&ze(e.target.value)}},[t.onFilterChange,t.filter,t.textField]);n.useCallback(e=>{if(!i.current)return;const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:i.current};t.onCancel&&t.onCancel.call(void 0,r),m(r),e.preventDefault()},[t.onCancel,m]);const Ze=()=>{const e=t.filterable?n.createElement(Ke,{value:t.filter===void 0?ve:t.filter,ref:ae,onChange:Ce,onKeyDown:be,size:"large",rounded:W,fillMode:A,placeholder:te}):null,r={title:t.adaptiveTitle||t.label,subTitle:t.adaptiveSubtitle,expand:l,onClose:o=>m(o),windowWidth:se,mobileFilter:e};return n.createElement(ut.AdaptiveMode,{...r},n.createElement(dt.ActionSheetContent,null,B.length>0?n.createElement(Ie.TreeView,{ref:x,tabIndex:_,data:B,focusIdField:I,textField:t.textField,checkField:de,checkIndeterminateField:pe,expandField:t.expandField,childrenField:fe,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:"large",item:t.item,dir:M}):n.createElement(Ee,null,Fe.toLanguageString(P.nodata,P.messages[P.nodata]))))},et=n.useCallback(e=>{for(const r of e)Ve(r.target.clientWidth)},[]),Ee=t.listNoData||it.ListNoData,Fe=rt.useLocalization(),xe=!Pe||oe.valid,X=R&&l?We:G.current,Se=n.createElement(n.Fragment,null,n.createElement("span",{className:s.classNames("k-multiselecttree k-input",t.className,{[`k-input-${Me[C]||C}`]:C,[`k-rounded-${gt[W]||W}`]:W,[`k-input-${A}`]:A,"k-focus":d&&!F,"k-invalid":!xe,"k-disabled":F,"k-loading":t.loading,"k-required":ge}),tabIndex:_,accessKey:t.accessKey,id:N,style:V?{...L,width:void 0}:L,dir:M,ref:E,onKeyDown:F?void 0:Qe,onMouseDown:Je,onFocus:e=>{R?ye(e):Ge(e)},onBlur:Ue,role:"combobox","aria-haspopup":"tree","aria-expanded":l,"aria-disabled":F,"aria-label":V,"aria-labelledby":t.ariaLabelledBy,"aria-describedby":t.ariaDescribedBy?t.ariaDescribedBy:"tagslist-"+N,"aria-required":t.required,onClick:F?void 0:ye},n.createElement("div",{id:"tagslist-"+N,className:s.classNames("k-input-values k-chip-list",{[`k-chip-list-${Me[C]||C}`]:C})},X.length>0&&n.createElement(lt,{tag:t.tag,onTagDelete:Ye,data:X,guid:N,focused:O?G.current.find(e=>Z.matchTags(e,O,I)):void 0,size:C})),n.createElement("span",{className:"k-input-inner"},X.length===0&&n.createElement("span",{className:"k-input-value-text"},te)),t.loading&&n.createElement(s.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ie&&!F&&X.length>0&&n.createElement(ct,{onClick:Xe}),n.createElement("select",{name:qe,ref:$,tabIndex:-1,"aria-hidden":!0,title:V,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},n.createElement("option",{value:t.valueMap?t.valueMap.call(void 0,g):g})),!R&&n.createElement(at.Popup,{...q,popupClass:s.classNames(q.popupClass,"k-multiselecttree-popup"),className:s.classNames(q.className,{"k-rtl":M==="rtl"}),style:Ae,anchor:q.anchor||E.current,show:l,onOpen:$e,onClose:He,ref:U},t.filterable&&n.createElement(Ke,{value:t.filter===void 0?ve:t.filter,ref:K,onChange:Ce,onKeyDown:be,tabIndex:_,size:C,rounded:W,fillMode:A,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),B.length>0?n.createElement(Ie.TreeView,{style:{height:q.height},ref:x,tabIndex:_,data:B,focusIdField:I,textField:t.textField,checkField:de,checkIndeterminateField:pe,expandField:t.expandField,childrenField:fe,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:C,item:t.item,dir:M}):n.createElement(Ee,null,Fe.toLanguageString(P.nodata,P.messages[P.nodata])),w&&n.createElement(s.WatermarkOverlay,{message:ee}))),R&&Ze());return V?n.createElement(ot.FloatingLabel,{label:V,editorValue:ie,editorPlaceholder:te,editorValid:xe,editorDisabled:F,editorId:N,style:{width:L?L.width:void 0},children:Se,dir:M}):Se}),ht={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,adaptiveSubtitle:a.string,adaptive:a.bool};ce.displayName="KendoReactMultiSelectTree";ce.propTypes=ht;exports.MultiSelectTree=ce;exports.MultiSelectTreePropsContext=Re;
|
|
@@ -7,27 +7,27 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import { createPropsContext as
|
|
11
|
-
import { Popup as
|
|
12
|
-
import { useLocalization as
|
|
10
|
+
import { createPropsContext as it, usePropsContext as rt, validatePackage as ot, getLicenseMessage as lt, useId as st, getTabIndex as ct, useRtl as ut, useAdaptiveModeContext as dt, canUseDOM as pt, noop as Y, Keys as r, classNames as Z, IconWrap as ft, WatermarkOverlay as mt, kendoThemeMaps as gt } from "@progress/kendo-react-common";
|
|
11
|
+
import { Popup as vt } from "@progress/kendo-react-popup";
|
|
12
|
+
import { useLocalization as ht } from "@progress/kendo-react-intl";
|
|
13
13
|
import { TreeView as Ie } from "@progress/kendo-react-treeview";
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
import { getItemValue as
|
|
16
|
-
import { useDropdownWidth as
|
|
17
|
-
import { ListNoData as
|
|
18
|
-
import { nodata as ee, messages as
|
|
19
|
-
import { FloatingLabel as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
14
|
+
import { packageMetadata as Te } from "../package-metadata.mjs";
|
|
15
|
+
import { getItemValue as bt, areSame as yt, matchTags as De } from "../common/utils.mjs";
|
|
16
|
+
import { useDropdownWidth as Ct } from "../DropDownTree/useDropdownWidth.mjs";
|
|
17
|
+
import { ListNoData as Et } from "../DropDownTree/ListNoData.mjs";
|
|
18
|
+
import { nodata as ee, messages as Me } from "../messages/index.mjs";
|
|
19
|
+
import { FloatingLabel as kt } from "@progress/kendo-react-labels";
|
|
20
|
+
import Ft from "../MultiSelect/TagList.mjs";
|
|
21
|
+
import xt from "../common/ClearButton.mjs";
|
|
22
22
|
import Re from "../common/ListFilter.mjs";
|
|
23
|
-
import { AdaptiveMode as
|
|
24
|
-
import { ActionSheetContent as
|
|
25
|
-
const
|
|
23
|
+
import { AdaptiveMode as St } from "../common/AdaptiveMode.mjs";
|
|
24
|
+
import { ActionSheetContent as wt } from "@progress/kendo-react-layout";
|
|
25
|
+
const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt } = gt, Dt = (N) => N.split("_").map((M) => parseInt(M, 10)), Mt = (N, M) => {
|
|
26
26
|
const { validationMessage: a, valid: V, required: te } = N;
|
|
27
27
|
return {
|
|
28
28
|
customError: a !== void 0,
|
|
29
|
-
valid: !!(V !== void 0 ? V : !te ||
|
|
30
|
-
valueMissing: !
|
|
29
|
+
valid: !!(V !== void 0 ? V : !te || M),
|
|
30
|
+
valueMissing: !M
|
|
31
31
|
};
|
|
32
32
|
}, b = {
|
|
33
33
|
checkField: "checkField",
|
|
@@ -43,51 +43,51 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
43
43
|
fillMode: "solid",
|
|
44
44
|
required: !1,
|
|
45
45
|
validityStyles: !0
|
|
46
|
-
},
|
|
47
|
-
(N,
|
|
48
|
-
const a =
|
|
46
|
+
}, Rt = it(), Ne = t.forwardRef(
|
|
47
|
+
(N, M) => {
|
|
48
|
+
const a = rt(Rt, N), V = !ot(Te, { component: "MultiSelectTree" }), te = lt(Te), Oe = st(), O = a.id || Oe, {
|
|
49
49
|
data: W = [],
|
|
50
50
|
dataItemKey: x,
|
|
51
|
-
style:
|
|
51
|
+
style: L = {},
|
|
52
52
|
placeholder: ne,
|
|
53
|
-
label:
|
|
54
|
-
name:
|
|
53
|
+
label: B,
|
|
54
|
+
name: Le,
|
|
55
55
|
validationMessage: q,
|
|
56
|
-
valid:
|
|
56
|
+
valid: Be,
|
|
57
57
|
tags: ue,
|
|
58
58
|
value: m,
|
|
59
59
|
opened: S,
|
|
60
60
|
disabled: E,
|
|
61
|
-
popupSettings:
|
|
61
|
+
popupSettings: R = b.popupSettings,
|
|
62
62
|
checkField: de = b.checkField,
|
|
63
63
|
checkIndeterminateField: pe = b.checkIndeterminateField,
|
|
64
64
|
subItemsField: fe = b.subItemsField,
|
|
65
65
|
size: y = b.size,
|
|
66
|
-
rounded:
|
|
66
|
+
rounded: K = b.rounded,
|
|
67
67
|
fillMode: z = b.fillMode,
|
|
68
68
|
required: me = b.required,
|
|
69
|
-
validityStyles:
|
|
69
|
+
validityStyles: Ke = b.validityStyles,
|
|
70
70
|
onOpen: ae = Y,
|
|
71
71
|
onClose: A = Y
|
|
72
|
-
} = a, $ =
|
|
73
|
-
width:
|
|
72
|
+
} = a, $ = ct(a.tabIndex, E), o = t.useRef(null), C = t.useRef(null), w = t.useRef(null), ie = t.useRef(null), H = t.useRef(null), k = t.useRef(null), G = t.useRef(!1), _ = t.useRef([]), j = t.useRef(null), [P, Ve] = t.useState(), [We, ge] = t.useState(!1), [d, re] = t.useState(!1), [oe, qe] = t.useState(), [ze, Ae] = t.useState([]), [ve, $e] = t.useState(""), s = S !== void 0 ? S : We, le = !!(Array.isArray(m) && m.length), se = Mt({ validationMessage: q, valid: Be, required: me }, le), I = ut(C, a.dir), He = {
|
|
73
|
+
width: Ct(C, b, R, L),
|
|
74
74
|
...I !== void 0 ? { direction: I } : {}
|
|
75
|
-
},
|
|
76
|
-
_.current = ue === void 0 ? (m || []).map((e) => ({ text:
|
|
75
|
+
}, Ge = t.useCallback(() => C.current && C.current.focus(), []), he = dt(), T = !!(oe && he && oe <= he.medium && a.adaptive);
|
|
76
|
+
_.current = ue === void 0 ? (m || []).map((e) => ({ text: bt(e, a.textField), data: [e] })) : [...ue], t.useImperativeHandle(o, () => ({
|
|
77
77
|
props: a,
|
|
78
78
|
element: C.current,
|
|
79
|
-
focus:
|
|
79
|
+
focus: Ge
|
|
80
80
|
})), t.useImperativeHandle(
|
|
81
|
-
|
|
81
|
+
M,
|
|
82
82
|
() => o.current
|
|
83
83
|
);
|
|
84
|
-
const
|
|
84
|
+
const _e = t.useCallback(() => {
|
|
85
85
|
H.current && H.current.setCustomValidity && H.current.setCustomValidity(
|
|
86
|
-
se.valid ? "" : q === void 0 ?
|
|
86
|
+
se.valid ? "" : q === void 0 ? It : q
|
|
87
87
|
);
|
|
88
88
|
}, [q, se]);
|
|
89
|
-
t.useEffect(
|
|
90
|
-
const e =
|
|
89
|
+
t.useEffect(_e), t.useEffect(() => {
|
|
90
|
+
const e = pt && window.ResizeObserver && new window.ResizeObserver(nt.bind(void 0));
|
|
91
91
|
return document != null && document.body && e && e.observe(document.body), () => {
|
|
92
92
|
e && e.disconnect();
|
|
93
93
|
};
|
|
@@ -108,7 +108,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
108
108
|
[a.onChange]
|
|
109
109
|
), U = t.useCallback(
|
|
110
110
|
(e) => {
|
|
111
|
-
if (
|
|
111
|
+
if (yt(e.item, m, x) || !o.current)
|
|
112
112
|
return;
|
|
113
113
|
const { item: i, nativeEvent: l, syntheticEvent: h } = e, D = {
|
|
114
114
|
syntheticEvent: h,
|
|
@@ -125,7 +125,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
125
125
|
const i = { ...e };
|
|
126
126
|
ae.call(void 0, i);
|
|
127
127
|
}
|
|
128
|
-
S === void 0 && (ge(!0),
|
|
128
|
+
S === void 0 && (ge(!0), Ae(m || []), T && setTimeout(() => {
|
|
129
129
|
var i;
|
|
130
130
|
u((i = ie.current) == null ? void 0 : i.element);
|
|
131
131
|
}, 300));
|
|
@@ -150,12 +150,12 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
150
150
|
e && v(() => e.focus());
|
|
151
151
|
},
|
|
152
152
|
[v]
|
|
153
|
-
),
|
|
153
|
+
), je = t.useCallback(() => {
|
|
154
154
|
var e;
|
|
155
155
|
!d && s ? g({ target: o.current }) : a.filterable ? u((e = w.current) == null ? void 0 : e.element) : u(k.current && k.current.element);
|
|
156
|
-
}, [d, s, u, g, a.filterable]),
|
|
156
|
+
}, [d, s, u, g, a.filterable]), Ue = t.useCallback(() => {
|
|
157
157
|
d && u(C.current);
|
|
158
|
-
}, [d, u]),
|
|
158
|
+
}, [d, u]), Je = t.useCallback(
|
|
159
159
|
(e) => {
|
|
160
160
|
if (!d && !G.current && (re(!0), a.onFocus && o.current)) {
|
|
161
161
|
const i = {
|
|
@@ -167,7 +167,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
[d, a.onFocus]
|
|
170
|
-
),
|
|
170
|
+
), Qe = t.useCallback(
|
|
171
171
|
(e) => {
|
|
172
172
|
if (d && !G.current && o.current) {
|
|
173
173
|
re(!1);
|
|
@@ -184,7 +184,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
186
|
[d, a.onBlur, s, S, A]
|
|
187
|
-
),
|
|
187
|
+
), Xe = t.useCallback(() => {
|
|
188
188
|
d && v(Y);
|
|
189
189
|
}, [d, v]), be = t.useCallback(
|
|
190
190
|
(e) => {
|
|
@@ -199,7 +199,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
201
|
[s, J]
|
|
202
|
-
),
|
|
202
|
+
), Ye = t.useCallback(
|
|
203
203
|
(e) => {
|
|
204
204
|
var X, we;
|
|
205
205
|
const { keyCode: i, altKey: l } = e, h = k.current && k.current.element;
|
|
@@ -212,9 +212,9 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
212
212
|
};
|
|
213
213
|
if (m && m.length > 0 && (i === r.left || i === r.right || i === r.home || i === r.end || i === r.delete)) {
|
|
214
214
|
const c = _.current;
|
|
215
|
-
let p = P ? c.findIndex((
|
|
215
|
+
let p = P ? c.findIndex((at) => De(at, P, x)) : -1, f;
|
|
216
216
|
const ce = p !== -1;
|
|
217
|
-
i === r.left ? (ce ? p = Math.max(0, p - 1) : p = c.length - 1, f = c[p]) : i === r.right ? p === c.length - 1 ? f = void 0 : ce && (p = Math.min(c.length - 1, p + 1), f = c[p]) : i === r.home ? f = c[0] : i === r.end ? f = c[c.length - 1] : i === r.delete && ce && F(D, c[p].data, "delete"), f !== P &&
|
|
217
|
+
i === r.left ? (ce ? p = Math.max(0, p - 1) : p = c.length - 1, f = c[p]) : i === r.right ? p === c.length - 1 ? f = void 0 : ce && (p = Math.min(c.length - 1, p + 1), f = c[p]) : i === r.home ? f = c[0] : i === r.end ? f = c[c.length - 1] : i === r.delete && ce && F(D, c[p].data, "delete"), f !== P && Ve(f);
|
|
218
218
|
}
|
|
219
219
|
if (s)
|
|
220
220
|
if (i === r.esc || l && i === r.up)
|
|
@@ -249,7 +249,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
249
249
|
));
|
|
250
250
|
},
|
|
251
251
|
[u, v]
|
|
252
|
-
),
|
|
252
|
+
), Ze = t.useCallback(
|
|
253
253
|
(e) => {
|
|
254
254
|
if (!o.current)
|
|
255
255
|
return;
|
|
@@ -261,7 +261,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
261
261
|
F(i, [], "clear"), g(i), e.preventDefault();
|
|
262
262
|
},
|
|
263
263
|
[F, g]
|
|
264
|
-
),
|
|
264
|
+
), et = t.useCallback(
|
|
265
265
|
(e, i) => {
|
|
266
266
|
var l;
|
|
267
267
|
g({ target: o.current }), d || u((l = w.current) == null ? void 0 : l.element), F(
|
|
@@ -279,7 +279,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
279
279
|
(e) => {
|
|
280
280
|
if (a.onExpandChange && o.current) {
|
|
281
281
|
const { item: i, itemHierarchicalIndex: l, nativeEvent: h, syntheticEvent: D } = e, X = {
|
|
282
|
-
level:
|
|
282
|
+
level: Dt(l),
|
|
283
283
|
item: i,
|
|
284
284
|
nativeEvent: h,
|
|
285
285
|
syntheticEvent: D,
|
|
@@ -302,7 +302,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
302
302
|
nativeEvent: e.nativeEvent,
|
|
303
303
|
target: o.current
|
|
304
304
|
};
|
|
305
|
-
a.onFilterChange.call(void 0, l), a.filter === void 0 &&
|
|
305
|
+
a.onFilterChange.call(void 0, l), a.filter === void 0 && $e(e.target.value);
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
[a.onFilterChange, a.filter, a.textField]
|
|
@@ -320,7 +320,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
320
320
|
},
|
|
321
321
|
[a.onCancel, g]
|
|
322
322
|
);
|
|
323
|
-
const
|
|
323
|
+
const tt = () => {
|
|
324
324
|
const e = a.filterable ? /* @__PURE__ */ t.createElement(
|
|
325
325
|
Re,
|
|
326
326
|
{
|
|
@@ -329,7 +329,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
329
329
|
onChange: Ee,
|
|
330
330
|
onKeyDown: ye,
|
|
331
331
|
size: "large",
|
|
332
|
-
rounded:
|
|
332
|
+
rounded: K,
|
|
333
333
|
fillMode: z,
|
|
334
334
|
placeholder: ne
|
|
335
335
|
}
|
|
@@ -341,7 +341,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
341
341
|
windowWidth: oe,
|
|
342
342
|
mobileFilter: e
|
|
343
343
|
};
|
|
344
|
-
return /* @__PURE__ */ t.createElement(
|
|
344
|
+
return /* @__PURE__ */ t.createElement(St, { ...i }, /* @__PURE__ */ t.createElement(wt, null, W.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
345
345
|
Ie,
|
|
346
346
|
{
|
|
347
347
|
ref: k,
|
|
@@ -362,16 +362,16 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
362
362
|
item: a.item,
|
|
363
363
|
dir: I
|
|
364
364
|
}
|
|
365
|
-
) : /* @__PURE__ */ t.createElement(ke, null, Fe.toLanguageString(ee,
|
|
366
|
-
},
|
|
365
|
+
) : /* @__PURE__ */ t.createElement(ke, null, Fe.toLanguageString(ee, Me[ee]))));
|
|
366
|
+
}, nt = t.useCallback((e) => {
|
|
367
367
|
for (const i of e)
|
|
368
|
-
|
|
369
|
-
}, []), ke = a.listNoData ||
|
|
368
|
+
qe(i.target.clientWidth);
|
|
369
|
+
}, []), ke = a.listNoData || Et, Fe = ht(), xe = !Ke || se.valid, Q = T && s ? ze : _.current, Se = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
370
370
|
"span",
|
|
371
371
|
{
|
|
372
372
|
className: Z("k-multiselecttree k-input", a.className, {
|
|
373
|
-
[`k-input-${
|
|
374
|
-
[`k-rounded-${
|
|
373
|
+
[`k-input-${Pe[y] || y}`]: y,
|
|
374
|
+
[`k-rounded-${Tt[K] || K}`]: K,
|
|
375
375
|
[`k-input-${z}`]: z,
|
|
376
376
|
"k-focus": d && !E,
|
|
377
377
|
"k-invalid": !xe,
|
|
@@ -382,20 +382,20 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
382
382
|
tabIndex: $,
|
|
383
383
|
accessKey: a.accessKey,
|
|
384
384
|
id: O,
|
|
385
|
-
style:
|
|
385
|
+
style: B ? { ...L, width: void 0 } : L,
|
|
386
386
|
dir: I,
|
|
387
387
|
ref: C,
|
|
388
|
-
onKeyDown: E ? void 0 :
|
|
389
|
-
onMouseDown:
|
|
388
|
+
onKeyDown: E ? void 0 : Ye,
|
|
389
|
+
onMouseDown: Xe,
|
|
390
390
|
onFocus: (e) => {
|
|
391
|
-
T ? be(e) :
|
|
391
|
+
T ? be(e) : Je(e);
|
|
392
392
|
},
|
|
393
|
-
onBlur:
|
|
393
|
+
onBlur: Qe,
|
|
394
394
|
role: "combobox",
|
|
395
395
|
"aria-haspopup": "tree",
|
|
396
396
|
"aria-expanded": s,
|
|
397
397
|
"aria-disabled": E,
|
|
398
|
-
"aria-label":
|
|
398
|
+
"aria-label": B,
|
|
399
399
|
"aria-labelledby": a.ariaLabelledBy,
|
|
400
400
|
"aria-describedby": a.ariaDescribedBy ? a.ariaDescribedBy : "tagslist-" + O,
|
|
401
401
|
"aria-required": a.required,
|
|
@@ -406,49 +406,49 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
406
406
|
{
|
|
407
407
|
id: "tagslist-" + O,
|
|
408
408
|
className: Z("k-input-values k-chip-list", {
|
|
409
|
-
[`k-chip-list-${
|
|
409
|
+
[`k-chip-list-${Pe[y] || y}`]: y
|
|
410
410
|
})
|
|
411
411
|
},
|
|
412
412
|
Q.length > 0 && /* @__PURE__ */ t.createElement(
|
|
413
|
-
|
|
413
|
+
Ft,
|
|
414
414
|
{
|
|
415
415
|
tag: a.tag,
|
|
416
|
-
onTagDelete:
|
|
416
|
+
onTagDelete: et,
|
|
417
417
|
data: Q,
|
|
418
418
|
guid: O,
|
|
419
419
|
focused: P ? _.current.find(
|
|
420
|
-
(e) =>
|
|
420
|
+
(e) => De(e, P, x)
|
|
421
421
|
) : void 0,
|
|
422
422
|
size: y
|
|
423
423
|
}
|
|
424
424
|
)
|
|
425
425
|
),
|
|
426
426
|
/* @__PURE__ */ t.createElement("span", { className: "k-input-inner" }, Q.length === 0 && /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, ne)),
|
|
427
|
-
a.loading && /* @__PURE__ */ t.createElement(
|
|
428
|
-
le && !E && Q.length > 0 && /* @__PURE__ */ t.createElement(
|
|
427
|
+
a.loading && /* @__PURE__ */ t.createElement(ft, { className: "k-input-loading-icon", name: "loading" }),
|
|
428
|
+
le && !E && Q.length > 0 && /* @__PURE__ */ t.createElement(xt, { onClick: Ze }),
|
|
429
429
|
/* @__PURE__ */ t.createElement(
|
|
430
430
|
"select",
|
|
431
431
|
{
|
|
432
|
-
name:
|
|
432
|
+
name: Le,
|
|
433
433
|
ref: H,
|
|
434
434
|
tabIndex: -1,
|
|
435
435
|
"aria-hidden": !0,
|
|
436
|
-
title:
|
|
436
|
+
title: B,
|
|
437
437
|
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
|
|
438
438
|
},
|
|
439
439
|
/* @__PURE__ */ t.createElement("option", { value: a.valueMap ? a.valueMap.call(void 0, m) : m })
|
|
440
440
|
),
|
|
441
441
|
!T && /* @__PURE__ */ t.createElement(
|
|
442
|
-
|
|
442
|
+
vt,
|
|
443
443
|
{
|
|
444
|
-
...
|
|
445
|
-
popupClass: Z(
|
|
446
|
-
className: Z(
|
|
447
|
-
style:
|
|
448
|
-
anchor:
|
|
444
|
+
...R,
|
|
445
|
+
popupClass: Z(R.popupClass, "k-multiselecttree-popup"),
|
|
446
|
+
className: Z(R.className, { "k-rtl": I === "rtl" }),
|
|
447
|
+
style: He,
|
|
448
|
+
anchor: R.anchor || C.current,
|
|
449
449
|
show: s,
|
|
450
|
-
onOpen:
|
|
451
|
-
onClose:
|
|
450
|
+
onOpen: je,
|
|
451
|
+
onClose: Ue,
|
|
452
452
|
ref: j
|
|
453
453
|
},
|
|
454
454
|
a.filterable && /* @__PURE__ */ t.createElement(
|
|
@@ -460,7 +460,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
460
460
|
onKeyDown: ye,
|
|
461
461
|
tabIndex: $,
|
|
462
462
|
size: y,
|
|
463
|
-
rounded:
|
|
463
|
+
rounded: K,
|
|
464
464
|
fillMode: z,
|
|
465
465
|
renderListFilterWrapper: !0,
|
|
466
466
|
renderPrefixSeparator: !0
|
|
@@ -469,7 +469,7 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
469
469
|
W.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
470
470
|
Ie,
|
|
471
471
|
{
|
|
472
|
-
style: { height:
|
|
472
|
+
style: { height: R.height },
|
|
473
473
|
ref: k,
|
|
474
474
|
tabIndex: $,
|
|
475
475
|
data: W,
|
|
@@ -488,26 +488,26 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
488
488
|
item: a.item,
|
|
489
489
|
dir: I
|
|
490
490
|
}
|
|
491
|
-
) : /* @__PURE__ */ t.createElement(ke, null, Fe.toLanguageString(ee,
|
|
492
|
-
V && /* @__PURE__ */ t.createElement(
|
|
491
|
+
) : /* @__PURE__ */ t.createElement(ke, null, Fe.toLanguageString(ee, Me[ee])),
|
|
492
|
+
V && /* @__PURE__ */ t.createElement(mt, { message: te })
|
|
493
493
|
)
|
|
494
|
-
), T &&
|
|
495
|
-
return
|
|
496
|
-
|
|
494
|
+
), T && tt());
|
|
495
|
+
return B ? /* @__PURE__ */ t.createElement(
|
|
496
|
+
kt,
|
|
497
497
|
{
|
|
498
|
-
label:
|
|
498
|
+
label: B,
|
|
499
499
|
editorValue: le,
|
|
500
500
|
editorPlaceholder: ne,
|
|
501
501
|
editorValid: xe,
|
|
502
502
|
editorDisabled: E,
|
|
503
503
|
editorId: O,
|
|
504
|
-
style: { width:
|
|
504
|
+
style: { width: L ? L.width : void 0 },
|
|
505
505
|
children: Se,
|
|
506
506
|
dir: I
|
|
507
507
|
}
|
|
508
508
|
) : Se;
|
|
509
509
|
}
|
|
510
|
-
),
|
|
510
|
+
), Pt = {
|
|
511
511
|
opened: n.bool,
|
|
512
512
|
disabled: n.bool,
|
|
513
513
|
dir: n.string,
|
|
@@ -571,9 +571,9 @@ const St = "Please select a value from the list!", { sizeMap: Me, roundedMap: wt
|
|
|
571
571
|
adaptiveSubtitle: n.string,
|
|
572
572
|
adaptive: n.bool
|
|
573
573
|
};
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
Ne.displayName = "KendoReactMultiSelectTree";
|
|
575
|
+
Ne.propTypes = Pt;
|
|
576
576
|
export {
|
|
577
|
-
|
|
578
|
-
|
|
577
|
+
Ne as MultiSelectTree,
|
|
578
|
+
Rt as MultiSelectTreePropsContext
|
|
579
579
|
};
|