@progress/kendo-react-listbox 9.4.0-develop.4 → 9.4.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,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-react-intl","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactListbox={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactButtons,e.KendoReactIntl,e.KendoSvgIcons)}(this,(function(e,t,a,o,n,r,s){"use strict";function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var i=l(t),c=(e=>(e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e))(c||{});const d={name:"@progress/kendo-react-listbox",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1737733472,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},m=i.forwardRef(((e,t)=>{o.validatePackage(d);const{id:a,style:n,data:r,textField:s,className:l,valueField:m,selectedField:f,onDrop:p,onKeyDown:v,onDragStart:b,onDragLeave:g,onDragOver:x,onItemClick:D,onItemSelect:h,onKeyboardNavigate:k,size:y=u.size,draggable:I=u.draggable,toolbarPosition:E=u.toolbarPosition}=e,w=i.useRef(null),T=i.useRef(null),N=i.useRef(null),B=i.useCallback((()=>({element:N.current,props:e})),[]);i.useImperativeHandle(T,B),i.useImperativeHandle(t,(()=>T.current));const O=a+"-accessibility-id",K=o.kendoThemeMaps.sizeMap[y]||y,A=i.useMemo((()=>new o.Navigation({root:w,selectors:[".k-list-item"],tabIndex:0,keyboardEvents:{keydown:{Space:(e,t,a)=>{const n=t.elements.indexOf(e);a.metaKey&&o.dispatchEvent(h,a,B(),{dataItem:r[n]}),o.dispatchEvent(h,a,B(),{dataItem:r[n]})},ArrowDown:(e,t,a)=>{if(a.metaKey&&a.shiftKey)o.dispatchEvent(k,a,B(),{actionName:"moveDown"});else if(a.metaKey&&!a.shiftKey)a.preventDefault(),t.focusNext(e);else if(!a.shiftKey||a.metaKey){a.preventDefault();const n=t.elements.indexOf(e),s=r[n+1];s&&(o.dispatchEvent(h,a,B(),{dataItem:s}),t.focusNext(e))}},ArrowUp:(e,t,a)=>{if(a.metaKey&&a.shiftKey)o.dispatchEvent(k,a,B(),{actionName:"moveUp"});else if(a.metaKey&&!a.shiftKey)a.preventDefault(),t.focusPrevious(e);else if(!a.shiftKey||a.metaKey){a.preventDefault();const n=t.elements.indexOf(e),s=r[n-1];s&&(o.dispatchEvent(h,a,B(),{dataItem:s}),t.focusPrevious(e))}},ArrowLeft:(e,t,a)=>{a.metaKey&&a.shiftKey?o.dispatchEvent(k,a,B(),{actionName:"transferAllFrom"}):a.metaKey&&o.dispatchEvent(k,a,B(),{actionName:"transferFrom"})},ArrowRight:(e,t,a)=>{a.metaKey&&a.shiftKey?o.dispatchEvent(k,a,B(),{actionName:"transferAllTo"}):a.metaKey&&o.dispatchEvent(k,a,B(),{actionName:"transferTo"})},Backspace:(e,t,a)=>{o.dispatchEvent(k,a,B(),{actionName:"remove"})}}}})),[r]),R=i.useCallback(A.triggerKeyboardEvent.bind(A),[r]);return i.useEffect((()=>(A.initializeRovingTab(),()=>A.removeFocusListener())),[r]),i.createElement("div",{id:a,ref:N,style:n,unselectable:"on",className:o.classNames(l,"k-listbox",{[`k-listbox-${K}`]:y},E===c.NONE||void 0===e.toolbar?`k-listbox-actions-${u.toolbarPosition}`:`k-listbox-actions-${E}`)},e.toolbar&&i.createElement(e.toolbar,null),i.createElement("div",{className:"k-list-scroller k-selectable","data-role":"selectable",ref:w,onDragOver:e=>e.preventDefault(),onDrop:t=>{t.target.classList.contains("k-list-content")&&(e.data.length>0?o.dispatchEvent(e.onDrop,t,B(),{dataItem:e.data[e.data.length-1]}):o.dispatchEvent(e.onDrop,t,B(),{dataItem:null}))},onDragLeave:e=>{g&&e.target.classList.contains("k-list-content")&&o.dispatchEvent(g,e,B(),void 0)},onKeyDown:R},i.createElement("div",{className:o.classNames("k-list",{[`k-list-${K}`]:y})},i.createElement("div",{className:"k-list-content"},i.createElement("ul",{className:"k-list-ul",role:"listbox","aria-label":"listbox-container",onKeyDown:e=>{v&&o.dispatchEvent(v,e,B(),void 0)}},r.map(((t,a)=>{const n=(e=>{if(f)return!!e[f]})(t),r={className:o.classNames("k-list-item",{"k-selected":n}),role:"option",key:a,id:O+a,"aria-selected":n,"data-uid":O+a,draggable:I,onDragStart:e=>{o.dispatchEvent(b,e,B(),{dataItem:t})},onDragOver:e=>{e.preventDefault(),o.dispatchEvent(x,e,B(),{dataItem:t})},onDrop:e=>{o.dispatchEvent(p,e,B(),{dataItem:t})},onClick:e=>{o.dispatchEvent(D,e,B(),{dataItem:t})}};return e.item?i.createElement(e.item,{selected:n,dataItem:t,...r,key:r.key},i.createElement("span",{className:"k-list-item-text"},t.name)):i.createElement("li",{...r,key:r.key},i.createElement("span",{className:"k-list-item-text"},(e=>s?e[s]:e.toString())(t)))})))))),i.createElement("select",{style:{display:"none"},multiple:!0,"data-role":"listbox"},r.map(((e,t)=>{const a=e[m||s];return i.createElement("option",{key:t,value:a},a)}))))})),u={toolbarPosition:c.RIGHT,draggable:!0,size:"medium"};m.propTypes={size:a.oneOf([null,"small","medium","large"]),toolbarPosition:a.oneOf(["none","top","bottom","left","right"]),textField:a.string.isRequired,valueField:a.string,selectedField:a.string,data:a.array.isRequired},m.displayName="ListBoxInner";const f={"listbox.moveUp":"Move Up","listbox.moveDown":"Move Down","listbox.transferTo":"Transfer To","listbox.transferFrom":"Transfer From","listbox.transferAllTo":"Transfer All To","listbox.transferAllFrom":"Transfer All From","listbox.remove":"Delete"},p=[{name:"moveUp",iconName:"caret-alt-up",svgIcon:s.caretAltUpIcon},{name:"moveDown",iconName:"caret-alt-down",svgIcon:s.caretAltDownIcon},{name:"transferTo",iconName:"caret-alt-right",svgIcon:s.caretAltRightIcon},{name:"transferFrom",iconName:"caret-alt-left",svgIcon:s.caretAltLeftIcon},{name:"transferAllTo",iconName:"caret-double-alt-right",svgIcon:s.caretDoubleAltRightIcon},{name:"transferAllFrom",iconName:"caret-double-alt-left",svgIcon:s.caretDoubleAltLeftIcon},{name:"remove",iconName:"x",svgIcon:s.xIcon}],v=i.forwardRef(((e,t)=>{const{tools:a,dir:l,onToolClick:c,size:d=b.size,data:m=b.data,dataConnected:u=b.dataConnected,selectedField:v=b.selectedField}=e,g=r.useLocalization(),x=i.useRef(null),D=i.useRef(null),h=i.useCallback((()=>({onToolClick:c,props:e,context:{},state:{},refs:{}})),[]);i.useImperativeHandle(D,h),i.useImperativeHandle(t,(()=>D.current));const k=(e,t,a)=>{a.preventDefault(),t.focusNext(e)},y=(e,t,a)=>{a.preventDefault(),t.focusPrevious(e)},I=i.useMemo((()=>new o.Navigation({root:x,selectors:[".k-button:not([disabled])"],tabIndex:0,keyboardEvents:{keydown:{ArrowDown:k,ArrowRight:k,ArrowUp:y,ArrowLeft:y,Enter:(e,t,a)=>{e.click(),t.focusElement(t.current,e)}}}})),[]),E=i.useCallback(I.triggerKeyboardEvent.bind(I),[]);i.useEffect((()=>(I.initializeRovingTab(),()=>I.removeFocusListener())),[]);const w=e=>{switch(e.name){case"caret-alt-right":return s.caretAltLeftIcon;case"caret-alt-left":return s.caretAltRightIcon;case"caret-double-alt-right":return s.caretDoubleAltLeftIcon;case"caret-double-alt-left":return s.caretDoubleAltRightIcon}return e},T=e=>{switch(e){case"caret-alt-right":return"caret-alt-left";case"caret-alt-left":return"caret-alt-right";case"caret-double-alt-right":return"caret-double-alt-left";case"caret-double-alt-left":return"caret-double-alt-right"}return e},N="rtl"===l;return i.createElement("div",{className:o.classNames("k-listbox-actions"),ref:x,onKeyDown:E},a&&a.map(((e,t)=>{const a=p.findIndex((t=>t.name===e)),r=p[a],s=(e=>{let t=!0;const a=v||"selected",o=m.length,n=u.length,r=m.findIndex((e=>!0===e[a]))>=0,s=u.findIndex((e=>!0===e[a]))>=0;switch(e){case"moveUp":t=r?!(m.length>0)||m[0].selected:!s||!(u.length>0)||u[0].selected;break;case"moveDown":t=r?!m[o-1]||m[o-1].selected:!s||!(u.length>0)||u[n-1].selected;break;case"transferTo":t=!(u&&r);break;case"transferFrom":t=!u||!(u&&s);break;case"transferAllTo":t=!(u&&m.length>0);break;case"transferAllFrom":t=!(u&&u.length>0);break;case"remove":t=!(r||s)}return t})(r.name),l=`listbox.${r.name}`,b=g.toLanguageString(l,f[l]);return i.createElement(n.Button,{size:d,key:t,disabled:s,"data-command":r.name,title:b,"aria-label":b,icon:N?T(r.iconName):r.iconName,svgIcon:N?w(r.svgIcon):r.svgIcon,onClick:e=>{e.preventDefault(),((e,t)=>{o.dispatchEvent(c,e,h(),{toolName:t})})(e,r.name)}})})))})),b={data:[],dataConnected:[],selectedField:"selected",size:"medium"};v.propTypes={data:a.array.isRequired,dataConnected:a.array.isRequired,tools:a.array,selectedField:a.string,dir:a.string,size:a.oneOf([null,"small","medium","large"])},v.displayName="ListBoxToolbarInner";const g=(e,t,a)=>{const o=a.splice(e,1)[0];return a.splice(t,0,o),a},x=o.withIdHOC(m);x.displayName="KendoReactListBox",e.ListBox=x,e.ListBoxToolbar=v,e.moveItem=g,e.processListBoxData=(e=[],t=[],a,o)=>{let n=[],r=[],s=[];const l={listBoxOneData:e,listBoxTwoData:t};switch(a){case"moveUp":n=[...e],n.forEach(((e,t)=>{e[o]&&(n=g(t,t-1,n))})),s=[...t],s.forEach(((e,t)=>{e[o]&&(s=g(t,t-1,s))})),l.listBoxOneData=n,l.listBoxTwoData=s;break;case"moveDown":n=e.reverse(),n.forEach(((e,t)=>{e[o]&&(n=g(t,t-1,n))})),s=t.reverse(),s.forEach(((e,t)=>{e[o]&&(s=g(t,t-1,s))})),l.listBoxOneData=[...n].reverse(),l.listBoxTwoData=[...s].reverse();break;case"transferTo":n=e.filter((e=>!e[o])),r=e.filter((e=>e[o])),s=t.concat(r),l.listBoxOneData=n,l.listBoxTwoData=s;break;case"transferFrom":s=t.filter((e=>!e[o])),r=t.filter((e=>e[o])),n=e.concat(r),l.listBoxOneData=n,l.listBoxTwoData=s;break;case"transferAllTo":l.listBoxOneData=[],l.listBoxTwoData=t.concat(e);break;case"transferAllFrom":l.listBoxOneData=t.concat(e),l.listBoxTwoData=[];break;case"remove":s=t.filter((e=>!e[o])),n=e.filter((e=>!e[o])),l.listBoxOneData=n,l.listBoxTwoData=s}return l},e.processListBoxDragAndDrop=(e=[],t=[],a,o,n)=>{const r=e.findIndex((e=>e[n]===a[n])),s=t.findIndex((e=>e[n]===a[n])),l=null!==o?e.findIndex((e=>e[n]===o[n])):-1,i=null!==o?t.findIndex((e=>e[n]===o[n])):-1,c=r>=0,d=s>=0,m=l>=0,u=i>=0,f=[...e],p=[...t];return c&&m?{listBoxOneData:g(r,l,e),listBoxTwoData:t}:d&&u?{listBoxOneData:e,listBoxTwoData:g(s,i,t)}:c&&(u||null===o)?(null===o?p.push(e[r]):p.splice(i+1,0,e[r]),f.splice(r,1),{listBoxOneData:f,listBoxTwoData:p}):d&&(m||null===o)?(null===o?f.push(t[s]):f.splice(l+1,0,t[s]),p.splice(s,1),{listBoxOneData:f,listBoxTwoData:p}):{listBoxOneData:e,listBoxTwoData:t}}}));
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
*-------------------------------------------------------------------------------------------
|
|
11
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
12
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
|
+
*-------------------------------------------------------------------------------------------
|
|
14
|
+
*/
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-react-intl","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactListbox={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactButtons,e.KendoReactIntl,e.KendoSvgIcons)}(this,(function(e,t,a,o,n,r,s){"use strict";function l(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var i=l(t),c=(e=>(e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e))(c||{});const d={name:"@progress/kendo-react-listbox",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607357111,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},m=i.forwardRef(((e,t)=>{o.validatePackage(d);const{id:a,style:n,data:r,textField:s,className:l,valueField:m,selectedField:f,onDrop:p,onKeyDown:v,onDragStart:b,onDragLeave:g,onDragOver:x,onItemClick:D,onItemSelect:h,onKeyboardNavigate:k,size:y=u.size,draggable:I=u.draggable,toolbarPosition:E=u.toolbarPosition}=e,w=i.useRef(null),T=i.useRef(null),N=i.useRef(null),B=i.useCallback((()=>({element:N.current,props:e})),[]);i.useImperativeHandle(T,B),i.useImperativeHandle(t,(()=>T.current));const O=a+"-accessibility-id",K=o.kendoThemeMaps.sizeMap[y]||y,A=i.useMemo((()=>new o.Navigation({root:w,selectors:[".k-list-item"],tabIndex:0,keyboardEvents:{keydown:{Space:(e,t,a)=>{const n=t.elements.indexOf(e);a.metaKey&&o.dispatchEvent(h,a,B(),{dataItem:r[n]}),o.dispatchEvent(h,a,B(),{dataItem:r[n]})},ArrowDown:(e,t,a)=>{if(a.metaKey&&a.shiftKey)o.dispatchEvent(k,a,B(),{actionName:"moveDown"});else if(a.metaKey&&!a.shiftKey)a.preventDefault(),t.focusNext(e);else if(!a.shiftKey||a.metaKey){a.preventDefault();const n=t.elements.indexOf(e),s=r[n+1];s&&(o.dispatchEvent(h,a,B(),{dataItem:s}),t.focusNext(e))}},ArrowUp:(e,t,a)=>{if(a.metaKey&&a.shiftKey)o.dispatchEvent(k,a,B(),{actionName:"moveUp"});else if(a.metaKey&&!a.shiftKey)a.preventDefault(),t.focusPrevious(e);else if(!a.shiftKey||a.metaKey){a.preventDefault();const n=t.elements.indexOf(e),s=r[n-1];s&&(o.dispatchEvent(h,a,B(),{dataItem:s}),t.focusPrevious(e))}},ArrowLeft:(e,t,a)=>{a.metaKey&&a.shiftKey?o.dispatchEvent(k,a,B(),{actionName:"transferAllFrom"}):a.metaKey&&o.dispatchEvent(k,a,B(),{actionName:"transferFrom"})},ArrowRight:(e,t,a)=>{a.metaKey&&a.shiftKey?o.dispatchEvent(k,a,B(),{actionName:"transferAllTo"}):a.metaKey&&o.dispatchEvent(k,a,B(),{actionName:"transferTo"})},Backspace:(e,t,a)=>{o.dispatchEvent(k,a,B(),{actionName:"remove"})}}}})),[r]),R=i.useCallback(A.triggerKeyboardEvent.bind(A),[r]);return i.useEffect((()=>(A.initializeRovingTab(),()=>A.removeFocusListener())),[r]),i.createElement("div",{id:a,ref:N,style:n,unselectable:"on",className:o.classNames(l,"k-listbox",{[`k-listbox-${K}`]:y},E===c.NONE||void 0===e.toolbar?`k-listbox-actions-${u.toolbarPosition}`:`k-listbox-actions-${E}`)},e.toolbar&&i.createElement(e.toolbar,null),i.createElement("div",{className:"k-list-scroller k-selectable","data-role":"selectable",ref:w,onDragOver:e=>e.preventDefault(),onDrop:t=>{t.target.classList.contains("k-list-content")&&(e.data.length>0?o.dispatchEvent(e.onDrop,t,B(),{dataItem:e.data[e.data.length-1]}):o.dispatchEvent(e.onDrop,t,B(),{dataItem:null}))},onDragLeave:e=>{g&&e.target.classList.contains("k-list-content")&&o.dispatchEvent(g,e,B(),void 0)},onKeyDown:R},i.createElement("div",{className:o.classNames("k-list",{[`k-list-${K}`]:y})},i.createElement("div",{className:"k-list-content"},i.createElement("ul",{className:"k-list-ul",role:"listbox","aria-label":"listbox-container",onKeyDown:e=>{v&&o.dispatchEvent(v,e,B(),void 0)}},r.map(((t,a)=>{const n=(e=>{if(f)return!!e[f]})(t),r={className:o.classNames("k-list-item",{"k-selected":n}),role:"option",key:a,id:O+a,"aria-selected":n,"data-uid":O+a,draggable:I,onDragStart:e=>{o.dispatchEvent(b,e,B(),{dataItem:t})},onDragOver:e=>{e.preventDefault(),o.dispatchEvent(x,e,B(),{dataItem:t})},onDrop:e=>{o.dispatchEvent(p,e,B(),{dataItem:t})},onClick:e=>{o.dispatchEvent(D,e,B(),{dataItem:t})}};return e.item?i.createElement(e.item,{selected:n,dataItem:t,...r,key:r.key},i.createElement("span",{className:"k-list-item-text"},t.name)):i.createElement("li",{...r,key:r.key},i.createElement("span",{className:"k-list-item-text"},(e=>s?e[s]:e.toString())(t)))})))))),i.createElement("select",{style:{display:"none"},multiple:!0,"data-role":"listbox"},r.map(((e,t)=>{const a=e[m||s];return i.createElement("option",{key:t,value:a},a)}))))})),u={toolbarPosition:c.RIGHT,draggable:!0,size:"medium"};m.propTypes={size:a.oneOf([null,"small","medium","large"]),toolbarPosition:a.oneOf(["none","top","bottom","left","right"]),textField:a.string.isRequired,valueField:a.string,selectedField:a.string,data:a.array.isRequired},m.displayName="ListBoxInner";const f={"listbox.moveUp":"Move Up","listbox.moveDown":"Move Down","listbox.transferTo":"Transfer To","listbox.transferFrom":"Transfer From","listbox.transferAllTo":"Transfer All To","listbox.transferAllFrom":"Transfer All From","listbox.remove":"Delete"},p=[{name:"moveUp",iconName:"caret-alt-up",svgIcon:s.caretAltUpIcon},{name:"moveDown",iconName:"caret-alt-down",svgIcon:s.caretAltDownIcon},{name:"transferTo",iconName:"caret-alt-right",svgIcon:s.caretAltRightIcon},{name:"transferFrom",iconName:"caret-alt-left",svgIcon:s.caretAltLeftIcon},{name:"transferAllTo",iconName:"caret-double-alt-right",svgIcon:s.caretDoubleAltRightIcon},{name:"transferAllFrom",iconName:"caret-double-alt-left",svgIcon:s.caretDoubleAltLeftIcon},{name:"remove",iconName:"x",svgIcon:s.xIcon}],v=i.forwardRef(((e,t)=>{const{tools:a,dir:l,onToolClick:c,size:d=b.size,data:m=b.data,dataConnected:u=b.dataConnected,selectedField:v=b.selectedField}=e,g=r.useLocalization(),x=i.useRef(null),D=i.useRef(null),h=i.useCallback((()=>({onToolClick:c,props:e,context:{},state:{},refs:{}})),[]);i.useImperativeHandle(D,h),i.useImperativeHandle(t,(()=>D.current));const k=(e,t,a)=>{a.preventDefault(),t.focusNext(e)},y=(e,t,a)=>{a.preventDefault(),t.focusPrevious(e)},I=i.useMemo((()=>new o.Navigation({root:x,selectors:[".k-button:not([disabled])"],tabIndex:0,keyboardEvents:{keydown:{ArrowDown:k,ArrowRight:k,ArrowUp:y,ArrowLeft:y,Enter:(e,t,a)=>{e.click(),t.focusElement(t.current,e)}}}})),[]),E=i.useCallback(I.triggerKeyboardEvent.bind(I),[]);i.useEffect((()=>(I.initializeRovingTab(),()=>I.removeFocusListener())),[]);const w=e=>{switch(e.name){case"caret-alt-right":return s.caretAltLeftIcon;case"caret-alt-left":return s.caretAltRightIcon;case"caret-double-alt-right":return s.caretDoubleAltLeftIcon;case"caret-double-alt-left":return s.caretDoubleAltRightIcon}return e},T=e=>{switch(e){case"caret-alt-right":return"caret-alt-left";case"caret-alt-left":return"caret-alt-right";case"caret-double-alt-right":return"caret-double-alt-left";case"caret-double-alt-left":return"caret-double-alt-right"}return e},N="rtl"===l;return i.createElement("div",{className:o.classNames("k-listbox-actions"),ref:x,onKeyDown:E},a&&a.map(((e,t)=>{const a=p.findIndex((t=>t.name===e)),r=p[a],s=(e=>{let t=!0;const a=v||"selected",o=m.length,n=u.length,r=m.findIndex((e=>!0===e[a]))>=0,s=u.findIndex((e=>!0===e[a]))>=0;switch(e){case"moveUp":t=r?!(m.length>0)||m[0].selected:!s||!(u.length>0)||u[0].selected;break;case"moveDown":t=r?!m[o-1]||m[o-1].selected:!s||!(u.length>0)||u[n-1].selected;break;case"transferTo":t=!(u&&r);break;case"transferFrom":t=!u||!(u&&s);break;case"transferAllTo":t=!(u&&m.length>0);break;case"transferAllFrom":t=!(u&&u.length>0);break;case"remove":t=!(r||s)}return t})(r.name),l=`listbox.${r.name}`,b=g.toLanguageString(l,f[l]);return i.createElement(n.Button,{size:d,key:t,disabled:s,"data-command":r.name,title:b,"aria-label":b,icon:N?T(r.iconName):r.iconName,svgIcon:N?w(r.svgIcon):r.svgIcon,onClick:e=>{e.preventDefault(),((e,t)=>{o.dispatchEvent(c,e,h(),{toolName:t})})(e,r.name)}})})))})),b={data:[],dataConnected:[],selectedField:"selected",size:"medium"};v.propTypes={data:a.array.isRequired,dataConnected:a.array.isRequired,tools:a.array,selectedField:a.string,dir:a.string,size:a.oneOf([null,"small","medium","large"])},v.displayName="ListBoxToolbarInner";const g=(e,t,a)=>{const o=a.splice(e,1)[0];return a.splice(t,0,o),a},x=o.withIdHOC(m);x.displayName="KendoReactListBox",e.ListBox=x,e.ListBoxToolbar=v,e.moveItem=g,e.processListBoxData=(e=[],t=[],a,o)=>{let n=[],r=[],s=[];const l={listBoxOneData:e,listBoxTwoData:t};switch(a){case"moveUp":n=[...e],n.forEach(((e,t)=>{e[o]&&(n=g(t,t-1,n))})),s=[...t],s.forEach(((e,t)=>{e[o]&&(s=g(t,t-1,s))})),l.listBoxOneData=n,l.listBoxTwoData=s;break;case"moveDown":n=e.reverse(),n.forEach(((e,t)=>{e[o]&&(n=g(t,t-1,n))})),s=t.reverse(),s.forEach(((e,t)=>{e[o]&&(s=g(t,t-1,s))})),l.listBoxOneData=[...n].reverse(),l.listBoxTwoData=[...s].reverse();break;case"transferTo":n=e.filter((e=>!e[o])),r=e.filter((e=>e[o])),s=t.concat(r),l.listBoxOneData=n,l.listBoxTwoData=s;break;case"transferFrom":s=t.filter((e=>!e[o])),r=t.filter((e=>e[o])),n=e.concat(r),l.listBoxOneData=n,l.listBoxTwoData=s;break;case"transferAllTo":l.listBoxOneData=[],l.listBoxTwoData=t.concat(e);break;case"transferAllFrom":l.listBoxOneData=t.concat(e),l.listBoxTwoData=[];break;case"remove":s=t.filter((e=>!e[o])),n=e.filter((e=>!e[o])),l.listBoxOneData=n,l.listBoxTwoData=s}return l},e.processListBoxDragAndDrop=(e=[],t=[],a,o,n)=>{const r=e.findIndex((e=>e[n]===a[n])),s=t.findIndex((e=>e[n]===a[n])),l=null!==o?e.findIndex((e=>e[n]===o[n])):-1,i=null!==o?t.findIndex((e=>e[n]===o[n])):-1,c=r>=0,d=s>=0,m=l>=0,u=i>=0,f=[...e],p=[...t];return c&&m?{listBoxOneData:g(r,l,e),listBoxTwoData:t}:d&&u?{listBoxOneData:e,listBoxTwoData:g(s,i,t)}:c&&(u||null===o)?(null===o?p.push(e[r]):p.splice(i+1,0,e[r]),f.splice(r,1),{listBoxOneData:f,listBoxTwoData:p}):d&&(m||null===o)?(null===o?f.push(t[s]):f.splice(l+1,0,t[s]),p.splice(s,1),{listBoxOneData:f,listBoxTwoData:p}):{listBoxOneData:e,listBoxTwoData:t}}}));
|
package/package-metadata.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-listbox",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-listbox",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1737926164,version:"9.4.0-develop.6",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -11,8 +11,8 @@ const e = {
|
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCode: "KENDOUIREACT",
|
|
13
13
|
productCodes: ["KENDOUIREACT"],
|
|
14
|
-
publishDate:
|
|
15
|
-
version: "9.4.0-develop.
|
|
14
|
+
publishDate: 1737926164,
|
|
15
|
+
version: "9.4.0-develop.6",
|
|
16
16
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
17
17
|
};
|
|
18
18
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-listbox",
|
|
3
|
-
"version": "9.4.0-develop.
|
|
3
|
+
"version": "9.4.0-develop.6",
|
|
4
4
|
"description": "React ListBox enables you to display a list of items and manage the data between multiple lists. KendoReact ListBox package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.3.4",
|
|
29
|
-
"@progress/kendo-react-buttons": "9.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "9.4.0-develop.
|
|
31
|
-
"@progress/kendo-react-intl": "9.4.0-develop.
|
|
29
|
+
"@progress/kendo-react-buttons": "9.4.0-develop.6",
|
|
30
|
+
"@progress/kendo-react-common": "9.4.0-develop.6",
|
|
31
|
+
"@progress/kendo-react-intl": "9.4.0-develop.6",
|
|
32
32
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
33
33
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
34
34
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"package": {
|
|
55
55
|
"productName": "KendoReact",
|
|
56
56
|
"productCode": "KENDOUIREACT",
|
|
57
|
-
"publishDate":
|
|
57
|
+
"publishDate": 1737926164,
|
|
58
58
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
59
59
|
}
|
|
60
60
|
},
|