@progress/kendo-react-dropdowns 10.1.0 → 10.2.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +1 -1
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +1 -1
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +1 -1
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +1 -1
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +1 -1
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +10 -10
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +1 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -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 tt=require("react"),a=require("prop-types"),o=require("@progress/kendo-react-common"),nt=require("@progress/kendo-react-popup"),at=require("@progress/kendo-react-intl"),Ie=require("@progress/kendo-react-treeview"),rt=require("../package-metadata.js"),ee=require("../common/utils.js"),ot=require("../DropDownTree/useDropdownWidth.js"),it=require("../DropDownTree/ListNoData.js"),v=require("../messages/index.js"),st=require("@progress/kendo-react-labels"),lt=require("../MultiSelect/TagList.js"),ct=require("../common/ClearButton.js"),Me=require("../common/ListFilter.js"),ut=require("../common/AdaptiveMode.js"),dt=require("@progress/kendo-react-layout");function pt(h){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const n in h)if(n!=="default"){const T=Object.getOwnPropertyDescriptor(h,n);Object.defineProperty(b,n,T.get?T:{enumerable:!0,get:()=>h[n]})}}return b.default=h,Object.freeze(b)}const t=pt(tt),ft="Please select a value from the list!",{sizeMap:Ke,roundedMap:gt}=o.kendoThemeMaps,mt=h=>h.split("_").map(b=>parseInt(b,10)),vt=(h,b)=>{const{validationMessage:n,valid:T,required:te}=h;return{customError:n!==void 0,valid:!!(T!==void 0?T:!te||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},Re=o.createPropsContext(),ue=t.forwardRef((h,b)=>{const n=o.usePropsContext(Re,h),T=!o.validatePackage(rt.packageMetadata,{component:"MultiSelectTree"}),te=o.useId(),P=n.id||te,{data:W=[],dataItemKey:I,style:L={},placeholder:de,label:A,name:De,validationMessage:B,valid:qe,tags:pe,value:g,opened:M,disabled:x,popupSettings:q=E.popupSettings,checkField:fe=E.checkField,checkIndeterminateField:ge=E.checkIndeterminateField,subItemsField:me=E.subItemsField,size:y=E.size,rounded:V=E.rounded,fillMode:z=E.fillMode,required:ve=E.required,validityStyles:Ne=E.validityStyles,onOpen:ne=o.noop,onClose:j=o.noop}=n,_=o.getTabIndex(n.tabIndex,x),s=t.useRef(null),F=t.useRef(null),K=t.useRef(null),ae=t.useRef(null),H=t.useRef(null),S=t.useRef(null),$=t.useRef(!1),G=t.useRef([]),U=t.useRef(null),[N,Oe]=t.useState(),[Pe,he]=t.useState(!1),[d,re]=t.useState(!1),[oe,Le]=t.useState(),[Ae,Ve]=t.useState([]),[ye,We]=t.useState(""),l=M!==void 0?M:Pe,ie=!!(Array.isArray(g)&&g.length),se=vt({validationMessage:B,valid:qe,required:ve},ie),R=o.useRtl(F,n.dir),Be={width:ot.useDropdownWidth(F,E,q,L),...R!==void 0?{direction:R}:{}},ze=t.useCallback(()=>F.current&&F.current.focus(),[]),be=o.useAdaptiveModeContext(),O=!!(oe&&be&&oe<=be.medium&&n.adaptive);G.current=pe===void 0?(g||[]).map(e=>({text:ee.getItemValue(e,n.textField),data:[e]})):[...pe],t.useImperativeHandle(s,()=>({props:n,element:F.current,focus:ze})),t.useImperativeHandle(b,()=>s.current);const je=t.useCallback(()=>{H.current&&H.current.setCustomValidity&&H.current.setCustomValidity(se.valid?"":B===void 0?ft:B)},[B,se]);t.useEffect(je),t.useEffect(()=>{const e=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ze.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,I)||!s.current)return;const{item:r,nativeEvent:i,syntheticEvent:k}=e,D={syntheticEvent:k,nativeEvent:i,target:s.current};w(D,[r],"toggle")},[g,I,w]),Q=t.useCallback(e=>{if(!l){if(ne){const r={...e};ne.call(void 0,r)}M===void 0&&(he(!0),Ve(g||[]),O&&setTimeout(()=>{var r;u((r=ae.current)==null?void 0:r.element)},300))}},[l,M,ne,O,ae]),m=t.useCallback(e=>{if(l){if(j){const r={...e};j.call(void 0,r)}M===void 0&&he(!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]),_e=t.useCallback(()=>{var e;!d&&l?m({target:s.current}):n.filterable?u((e=K.current)==null?void 0:e.element):u(S.current&&S.current.element)},[d,l,u,m,n.filterable]),He=t.useCallback(()=>{d&&u(F.current)},[d,u]),$e=t.useCallback(e=>{if(!d&&!$.current&&(re(!0),n.onFocus&&s.current)){const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};n.onFocus.call(void 0,r)}},[d,n.onFocus]),Ge=t.useCallback(e=>{if(d&&!$.current&&s.current){re(!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]),Ue=t.useCallback(()=>{d&&C(o.noop)},[d,C]),Je=t.useCallback(e=>{if(!e.isDefaultPrevented()&&s.current){re(!0);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};l||Q(r)}},[l,Q]),Qe=t.useCallback(e=>{var Z,Te;const{keyCode:r,altKey:i}=e,k=S.current&&S.current.element;if(!s.current||e.isDefaultPrevented()&&((Z=K.current)==null?void 0:Z.element)===e.target)return;const D={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=N?c.findIndex(et=>ee.matchTags(et,N,I)):-1,f;const ce=p!==-1;r===o.Keys.left?(ce?p=Math.max(0,p-1):p=c.length-1,f=c[p]):r===o.Keys.right?p===c.length-1?f=void 0:ce&&(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&&ce&&w(D,c[p].data,"delete"),f!==N&&Oe(f)}if(l)if(r===o.Keys.esc||i&&r===o.Keys.up)e.preventDefault(),m(D);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&&((Te=K.current)!=null&&Te.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=K.current)==null?void 0:f.element)})}C(o.noop)}else r===o.Keys.down&&C(()=>{var c;u(((c=K.current)==null?void 0:c.element)||k)});else i&&r===o.Keys.down&&(e.preventDefault(),Q(D))},[l,m,u,C,Q,N,I,g,w]),Ce=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]),le=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]),Xe=t.useCallback((e,r)=>{var i;m({target:s.current}),d||u((i=K.current)==null?void 0:i.element),w({syntheticEvent:r,nativeEvent:r.nativeEvent,target:s.current},e,"delete")},[w,m,u,d]),ke=t.useCallback(e=>{if(n.onExpandChange&&s.current){const{item:r,itemHierarchicalIndex:i,nativeEvent:k,syntheticEvent:D}=e,Z={level:mt(i),item:r,nativeEvent:k,syntheticEvent:D,target:s.current};n.onExpandChange.call(void 0,Z)}},[n.onExpandChange]),Ee=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&&We(e.target.value)}},[n.onFilterChange,n.filter,n.textField]),Fe=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]),Ye=()=>{const e=n.filterable?t.createElement(Me,{value:n.filter===void 0?ye:n.filter,ref:ae,onChange:Ee,onKeyDown:Ce,size:y,rounded:V,fillMode:z}):null,r={title:n.adaptiveTitle,expand:l,onClose:i=>n.onCancel?Fe(i):le(i),windowWidth:oe,mobileFilter:e,footer:{cancelText:X.toLanguageString(v.adaptiveModeFooterCancel,v.messages[v.adaptiveModeFooterCancel]),onCancel:i=>n.onCancel?Fe(i):le(i),applyText:X.toLanguageString(v.adaptiveModeFooterApply,v.messages[v.adaptiveModeFooterApply]),onApply:i=>m(i)}};return t.createElement(ut.AdaptiveMode,{...r},t.createElement(dt.ActionSheetContent,{overflowHidden:!0},t.createElement("div",{className:"k-list-container"},t.createElement("div",{className:"k-list k-list-lg"},W.length>0?t.createElement(Ie.TreeView,{ref:S,tabIndex:_,data:W,focusIdField:I,textField:n.textField,checkField:fe,checkIndeterminateField:ge,expandField:n.expandField,childrenField:me,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:y,item:n.item,dir:R}):t.createElement(xe,null,X.toLanguageString(v.nodata,v.messages[v.nodata]))))))},Ze=t.useCallback(e=>{for(const r of e)Le(r.target.clientWidth)},[]),xe=n.listNoData||it.ListNoData,X=at.useLocalization(),Se=!Ne||se.valid,Y=O&&l?Ae:G.current,we=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-${gt[V]||V}`]:V,[`k-input-${z}`]:z,"k-focus":d&&!x,"k-invalid":!Se,"k-disabled":x,"k-loading":n.loading,"k-required":ve}),tabIndex:_,accessKey:n.accessKey,id:P,style:A?{...L,width:void 0}:L,dir:R,ref:F,onKeyDown:x?void 0:Qe,onMouseDown:Ue,onFocus:$e,onBlur:Ge,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-"+P,"aria-required":n.required,onClick:x?void 0:Je},t.createElement("div",{id:"tagslist-"+P,className:o.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ke[y]||y}`]:y})},Y.length>0&&t.createElement(lt,{tag:n.tag,onTagDelete:Xe,data:Y,guid:P,focused:N?G.current.find(e=>ee.matchTags(e,N,I)):void 0,size:y})),t.createElement("span",{className:"k-input-inner"},Y.length===0&&t.createElement("span",{className:"k-input-value-text"},de)),n.loading&&t.createElement(o.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ie&&!x&&Y.length>0&&t.createElement(ct,{onClick:le}),t.createElement("select",{name:De,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(nt.Popup,{...q,popupClass:o.classNames(q.popupClass,"k-multiselecttree-popup"),className:o.classNames(q.className,{"k-rtl":R==="rtl"}),style:Be,anchor:q.anchor||F.current,show:l,onOpen:_e,onClose:He,ref:U},n.filterable&&t.createElement(Me,{value:n.filter===void 0?ye:n.filter,ref:K,onChange:Ee,onKeyDown:Ce,tabIndex:_,size:y,rounded:V,fillMode:z,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),W.length>0?t.createElement(Ie.TreeView,{style:{height:q.height},ref:S,tabIndex:_,data:W,focusIdField:I,textField:n.textField,checkField:fe,checkIndeterminateField:ge,expandField:n.expandField,childrenField:me,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:y,item:n.item,dir:R}):t.createElement(xe,null,X.toLanguageString(v.nodata,v.messages[v.nodata])),T&&t.createElement(o.WatermarkOverlay,null))),O&&Ye());return A?t.createElement(st.FloatingLabel,{label:A,editorValue:ie,editorPlaceholder:de,editorValid:Se,editorDisabled:x,editorId:P,style:{width:L?L.width:void 0},children:we,dir:R}):we}),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,adaptive:a.bool};ue.displayName="KendoReactMultiSelectTree";ue.propTypes=ht;exports.MultiSelectTree=ue;exports.MultiSelectTreePropsContext=Re;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("react"),a=require("prop-types"),o=require("@progress/kendo-react-common"),nt=require("@progress/kendo-react-popup"),at=require("@progress/kendo-react-intl"),Ie=require("@progress/kendo-react-treeview"),rt=require("../package-metadata.js"),ee=require("../common/utils.js"),ot=require("../DropDownTree/useDropdownWidth.js"),it=require("../DropDownTree/ListNoData.js"),v=require("../messages/index.js"),st=require("@progress/kendo-react-labels"),lt=require("../MultiSelect/TagList.js"),ct=require("../common/ClearButton.js"),Me=require("../common/ListFilter.js"),ut=require("../common/AdaptiveMode.js"),dt=require("@progress/kendo-react-layout");function pt(h){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const n in h)if(n!=="default"){const T=Object.getOwnPropertyDescriptor(h,n);Object.defineProperty(b,n,T.get?T:{enumerable:!0,get:()=>h[n]})}}return b.default=h,Object.freeze(b)}const t=pt(tt),ft="Please select a value from the list!",{sizeMap:Ke,roundedMap:gt}=o.kendoThemeMaps,mt=h=>h.split("_").map(b=>parseInt(b,10)),vt=(h,b)=>{const{validationMessage:n,valid:T,required:te}=h;return{customError:n!==void 0,valid:!!(T!==void 0?T:!te||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},Re=o.createPropsContext(),ue=t.forwardRef((h,b)=>{const n=o.usePropsContext(Re,h),T=!o.validatePackage(rt.packageMetadata,{component:"MultiSelectTree"}),te=o.useId(),P=n.id||te,{data:W=[],dataItemKey:I,style:L={},placeholder:de,label:A,name:De,validationMessage:B,valid:qe,tags:pe,value:g,opened:M,disabled:x,popupSettings:q=E.popupSettings,checkField:fe=E.checkField,checkIndeterminateField:ge=E.checkIndeterminateField,subItemsField:me=E.subItemsField,size:y=E.size,rounded:V=E.rounded,fillMode:z=E.fillMode,required:ve=E.required,validityStyles:Ne=E.validityStyles,onOpen:ne=o.noop,onClose:j=o.noop}=n,_=o.getTabIndex(n.tabIndex,x),s=t.useRef(null),F=t.useRef(null),K=t.useRef(null),ae=t.useRef(null),$=t.useRef(null),S=t.useRef(null),H=t.useRef(!1),G=t.useRef([]),U=t.useRef(null),[N,Oe]=t.useState(),[Pe,he]=t.useState(!1),[d,re]=t.useState(!1),[oe,Le]=t.useState(),[Ae,Ve]=t.useState([]),[ye,We]=t.useState(""),l=M!==void 0?M:Pe,ie=!!(Array.isArray(g)&&g.length),se=vt({validationMessage:B,valid:qe,required:ve},ie),R=o.useRtl(F,n.dir),Be={width:ot.useDropdownWidth(F,E,q,L),...R!==void 0?{direction:R}:{}},ze=t.useCallback(()=>F.current&&F.current.focus(),[]),be=o.useAdaptiveModeContext(),O=!!(oe&&be&&oe<=be.medium&&n.adaptive);G.current=pe===void 0?(g||[]).map(e=>({text:ee.getItemValue(e,n.textField),data:[e]})):[...pe],t.useImperativeHandle(s,()=>({props:n,element:F.current,focus:ze})),t.useImperativeHandle(b,()=>s.current);const je=t.useCallback(()=>{$.current&&$.current.setCustomValidity&&$.current.setCustomValidity(se.valid?"":B===void 0?ft:B)},[B,se]);t.useEffect(je),t.useEffect(()=>{const e=o.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Ze.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,I)||!s.current)return;const{item:r,nativeEvent:i,syntheticEvent:k}=e,D={syntheticEvent:k,nativeEvent:i,target:s.current};w(D,[r],"toggle")},[g,I,w]),Q=t.useCallback(e=>{if(!l){if(ne){const r={...e};ne.call(void 0,r)}M===void 0&&(he(!0),Ve(g||[]),O&&setTimeout(()=>{var r;u((r=ae.current)==null?void 0:r.element)},300))}},[l,M,ne,O,ae]),m=t.useCallback(e=>{if(l){if(j){const r={...e};j.call(void 0,r)}M===void 0&&he(!1)}},[l,M,j]),C=t.useCallback(e=>{H.current=!0,e(),window.setTimeout(()=>H.current=!1,0)},[]),u=t.useCallback(e=>{e&&C(()=>e.focus())},[C]),_e=t.useCallback(()=>{var e;!d&&l?m({target:s.current}):n.filterable?u((e=K.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&&!H.current&&(re(!0),n.onFocus&&s.current)){const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};n.onFocus.call(void 0,r)}},[d,n.onFocus]),Ge=t.useCallback(e=>{if(d&&!H.current&&s.current){re(!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]),Ue=t.useCallback(()=>{d&&C(o.noop)},[d,C]),Je=t.useCallback(e=>{if(!e.isDefaultPrevented()&&s.current){re(!0);const r={syntheticEvent:e,nativeEvent:e.nativeEvent,target:s.current};l||Q(r)}},[l,Q]),Qe=t.useCallback(e=>{var Z,Te;const{keyCode:r,altKey:i}=e,k=S.current&&S.current.element;if(!s.current||e.isDefaultPrevented()&&((Z=K.current)==null?void 0:Z.element)===e.target)return;const D={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=N?c.findIndex(et=>ee.matchTags(et,N,I)):-1,f;const ce=p!==-1;r===o.Keys.left?(ce?p=Math.max(0,p-1):p=c.length-1,f=c[p]):r===o.Keys.right?p===c.length-1?f=void 0:ce&&(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&&ce&&w(D,c[p].data,"delete"),f!==N&&Oe(f)}if(l)if(r===o.Keys.esc||i&&r===o.Keys.up)e.preventDefault(),m(D);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&&((Te=K.current)!=null&&Te.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=K.current)==null?void 0:f.element)})}C(o.noop)}else r===o.Keys.down&&C(()=>{var c;u(((c=K.current)==null?void 0:c.element)||k)});else i&&r===o.Keys.down&&(e.preventDefault(),Q(D))},[l,m,u,C,Q,N,I,g,w]),Ce=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]),le=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]),Xe=t.useCallback((e,r)=>{var i;m({target:s.current}),d||u((i=K.current)==null?void 0:i.element),w({syntheticEvent:r,nativeEvent:r.nativeEvent,target:s.current},e,"delete")},[w,m,u,d]),ke=t.useCallback(e=>{if(n.onExpandChange&&s.current){const{item:r,itemHierarchicalIndex:i,nativeEvent:k,syntheticEvent:D}=e,Z={level:mt(i),item:r,nativeEvent:k,syntheticEvent:D,target:s.current};n.onExpandChange.call(void 0,Z)}},[n.onExpandChange]),Ee=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&&We(e.target.value)}},[n.onFilterChange,n.filter,n.textField]),Fe=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]),Ye=()=>{const e=n.filterable?t.createElement(Me,{value:n.filter===void 0?ye:n.filter,ref:ae,onChange:Ee,onKeyDown:Ce,size:y,rounded:V,fillMode:z}):null,r={title:n.adaptiveTitle,expand:l,onClose:i=>n.onCancel?Fe(i):le(i),windowWidth:oe,mobileFilter:e,footer:{cancelText:X.toLanguageString(v.adaptiveModeFooterCancel,v.messages[v.adaptiveModeFooterCancel]),onCancel:i=>n.onCancel?Fe(i):le(i),applyText:X.toLanguageString(v.adaptiveModeFooterApply,v.messages[v.adaptiveModeFooterApply]),onApply:i=>m(i)}};return t.createElement(ut.AdaptiveMode,{...r},t.createElement(dt.ActionSheetContent,null,t.createElement("div",{className:"k-list-container"},t.createElement("div",{className:"k-list k-list-lg"},W.length>0?t.createElement(Ie.TreeView,{ref:S,tabIndex:_,data:W,focusIdField:I,textField:n.textField,checkField:fe,checkIndeterminateField:ge,expandField:n.expandField,childrenField:me,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:y,item:n.item,dir:R}):t.createElement(xe,null,X.toLanguageString(v.nodata,v.messages[v.nodata]))))))},Ze=t.useCallback(e=>{for(const r of e)Le(r.target.clientWidth)},[]),xe=n.listNoData||it.ListNoData,X=at.useLocalization(),Se=!Ne||se.valid,Y=O&&l?Ae:G.current,we=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-${gt[V]||V}`]:V,[`k-input-${z}`]:z,"k-focus":d&&!x,"k-invalid":!Se,"k-disabled":x,"k-loading":n.loading,"k-required":ve}),tabIndex:_,accessKey:n.accessKey,id:P,style:A?{...L,width:void 0}:L,dir:R,ref:F,onKeyDown:x?void 0:Qe,onMouseDown:Ue,onFocus:He,onBlur:Ge,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-"+P,"aria-required":n.required,onClick:x?void 0:Je},t.createElement("div",{id:"tagslist-"+P,className:o.classNames("k-input-values k-chip-list",{[`k-chip-list-${Ke[y]||y}`]:y})},Y.length>0&&t.createElement(lt,{tag:n.tag,onTagDelete:Xe,data:Y,guid:P,focused:N?G.current.find(e=>ee.matchTags(e,N,I)):void 0,size:y})),t.createElement("span",{className:"k-input-inner"},Y.length===0&&t.createElement("span",{className:"k-input-value-text"},de)),n.loading&&t.createElement(o.IconWrap,{className:"k-input-loading-icon",name:"loading"}),ie&&!x&&Y.length>0&&t.createElement(ct,{onClick:le}),t.createElement("select",{name:De,ref:$,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(nt.Popup,{...q,popupClass:o.classNames(q.popupClass,"k-multiselecttree-popup"),className:o.classNames(q.className,{"k-rtl":R==="rtl"}),style:Be,anchor:q.anchor||F.current,show:l,onOpen:_e,onClose:$e,ref:U},n.filterable&&t.createElement(Me,{value:n.filter===void 0?ye:n.filter,ref:K,onChange:Ee,onKeyDown:Ce,tabIndex:_,size:y,rounded:V,fillMode:z,renderListFilterWrapper:!0,renderPrefixSeparator:!0}),W.length>0?t.createElement(Ie.TreeView,{style:{height:q.height},ref:S,tabIndex:_,data:W,focusIdField:I,textField:n.textField,checkField:fe,checkIndeterminateField:ge,expandField:n.expandField,childrenField:me,expandIcons:!0,onItemClick:J,onCheckChange:J,onExpandChange:ke,checkboxes:!0,size:y,item:n.item,dir:R}):t.createElement(xe,null,X.toLanguageString(v.nodata,v.messages[v.nodata])),T&&t.createElement(o.WatermarkOverlay,null))),O&&Ye());return A?t.createElement(st.FloatingLabel,{label:A,editorValue:ie,editorPlaceholder:de,editorValid:Se,editorDisabled:x,editorId:P,style:{width:L?L.width:void 0},children:we,dir:R}):we}),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,adaptive:a.bool};ue.displayName="KendoReactMultiSelectTree";ue.propTypes=ht;exports.MultiSelectTree=ue;exports.MultiSelectTreePropsContext=Re;
|
|
@@ -69,7 +69,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
69
69
|
validityStyles: Ve = y.validityStyles,
|
|
70
70
|
onOpen: re = Z,
|
|
71
71
|
onClose: z = Z
|
|
72
|
-
} = a,
|
|
72
|
+
} = a, $ = ct(a.tabIndex, k), l = t.useRef(null), C = t.useRef(null), w = t.useRef(null), ie = t.useRef(null), H = t.useRef(null), E = t.useRef(null), G = t.useRef(!1), _ = t.useRef([]), j = t.useRef(null), [R, We] = t.useState(), [qe, be] = t.useState(!1), [d, oe] = t.useState(!1), [le, Ae] = t.useState(), [ze, $e] = t.useState([]), [ye, He] = t.useState(""), s = S !== void 0 ? S : qe, se = !!(Array.isArray(m) && m.length), ce = Rt({ validationMessage: q, valid: Ke, required: he }, se), I = ut(C, a.dir), Ge = {
|
|
73
73
|
width: kt(C, y, M, L),
|
|
74
74
|
...I !== void 0 ? { direction: I } : {}
|
|
75
75
|
}, _e = t.useCallback(() => C.current && C.current.focus(), []), Ce = dt(), N = !!(le && Ce && le <= Ce.medium && a.adaptive);
|
|
@@ -82,7 +82,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
82
82
|
() => l.current
|
|
83
83
|
);
|
|
84
84
|
const je = t.useCallback(() => {
|
|
85
|
-
|
|
85
|
+
H.current && H.current.setCustomValidity && H.current.setCustomValidity(
|
|
86
86
|
ce.valid ? "" : q === void 0 ? Tt : q
|
|
87
87
|
);
|
|
88
88
|
}, [q, ce]);
|
|
@@ -125,7 +125,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
125
125
|
const r = { ...e };
|
|
126
126
|
re.call(void 0, r);
|
|
127
127
|
}
|
|
128
|
-
S === void 0 && (be(!0),
|
|
128
|
+
S === void 0 && (be(!0), $e(m || []), N && setTimeout(() => {
|
|
129
129
|
var r;
|
|
130
130
|
u((r = ie.current) == null ? void 0 : r.element);
|
|
131
131
|
}, 300));
|
|
@@ -302,7 +302,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
302
302
|
nativeEvent: e.nativeEvent,
|
|
303
303
|
target: l.current
|
|
304
304
|
};
|
|
305
|
-
a.onFilterChange.call(void 0, i), a.filter === void 0 &&
|
|
305
|
+
a.onFilterChange.call(void 0, i), a.filter === void 0 && He(e.target.value);
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
[a.onFilterChange, a.filter, a.textField]
|
|
@@ -349,11 +349,11 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
349
349
|
onApply: (i) => g(i)
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
return /* @__PURE__ */ t.createElement(wt, { ...r }, /* @__PURE__ */ t.createElement(It,
|
|
352
|
+
return /* @__PURE__ */ t.createElement(wt, { ...r }, /* @__PURE__ */ t.createElement(It, null, /* @__PURE__ */ t.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ t.createElement("div", { className: "k-list k-list-lg" }, W.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
353
353
|
De,
|
|
354
354
|
{
|
|
355
355
|
ref: E,
|
|
356
|
-
tabIndex:
|
|
356
|
+
tabIndex: $,
|
|
357
357
|
data: W,
|
|
358
358
|
focusIdField: x,
|
|
359
359
|
textField: a.textField,
|
|
@@ -387,7 +387,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
387
387
|
"k-loading": a.loading,
|
|
388
388
|
"k-required": he
|
|
389
389
|
}),
|
|
390
|
-
tabIndex:
|
|
390
|
+
tabIndex: $,
|
|
391
391
|
accessKey: a.accessKey,
|
|
392
392
|
id: O,
|
|
393
393
|
style: B ? { ...L, width: void 0 } : L,
|
|
@@ -436,7 +436,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
436
436
|
"select",
|
|
437
437
|
{
|
|
438
438
|
name: Be,
|
|
439
|
-
ref:
|
|
439
|
+
ref: H,
|
|
440
440
|
tabIndex: -1,
|
|
441
441
|
"aria-hidden": !0,
|
|
442
442
|
title: B,
|
|
@@ -464,7 +464,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
464
464
|
ref: w,
|
|
465
465
|
onChange: Fe,
|
|
466
466
|
onKeyDown: ke,
|
|
467
|
-
tabIndex:
|
|
467
|
+
tabIndex: $,
|
|
468
468
|
size: v,
|
|
469
469
|
rounded: K,
|
|
470
470
|
fillMode: A,
|
|
@@ -477,7 +477,7 @@ const Tt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Dt
|
|
|
477
477
|
{
|
|
478
478
|
style: { height: M.height },
|
|
479
479
|
ref: E,
|
|
480
|
-
tabIndex:
|
|
480
|
+
tabIndex: $,
|
|
481
481
|
data: W,
|
|
482
482
|
focusIdField: x,
|
|
483
483
|
textField: a.textField,
|
package/common/AdaptiveMode.js
CHANGED
|
@@ -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 v=require("react"),r=require("@progress/kendo-react-layout"),y=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),x=require("@progress/kendo-react-common");function h(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const n=h(v),k=t=>{const{footer:e,windowWidth:a=0,mobileFilter:o,children:s,navigatable:d,navigatableElements:u,expand:b,animation:p,title:m,subTitle:f,onClose:c}=t,l=x.useAdaptiveModeContext(),g={navigatable:d||!1,navigatableElements:u||[],expand:b,animation:p!==!1,
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),r=require("@progress/kendo-react-layout"),y=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),x=require("@progress/kendo-react-common");function h(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const n=h(v),k=t=>{const{footer:e,windowWidth:a=0,mobileFilter:o,children:s,navigatable:d,navigatableElements:u,expand:b,animation:p,title:m,subTitle:f,onClose:c}=t,l=x.useAdaptiveModeContext(),g={navigatable:d||!1,navigatableElements:u||[],expand:b,animation:p!==!1,suffixActions:n.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:y.xIcon,onClick:c}),filter:o,onClose:c,animationStyles:l&&a<=l.small?{top:0,width:"100%",height:"100%"}:void 0,title:m,subTitle:f,className:"k-adaptive-actionsheet",position:l&&a<=l.small?"fullscreen":void 0};return n.createElement(r.ActionSheet,{...g},s,e&&n.createElement(r.ActionSheetFooter,{className:"k-actions k-actions-stretched"},n.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),n.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=k;
|