UNPKG

@progress/kendo-react-common

Version:

React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package

9 lines (8 loc) 1.14 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(t,n,e){return e?{...t,[n]:e.length?[...e]:void 0}:t&&t[n]?[...t[n]]:[]}function f(t,n,e){if(t[n]){const o=g(t,n).map(r=>f(r,n,e));return e(g(t,n,o))}return e(t)}const i=(t,n,e)=>[...t.map(o=>f(o,n,e))],u=(t,n,e,o)=>{let r=t;const c=[];for(let h=0;h<n.length;h++)r=r[n[h]],r=Array.isArray(r)?r:r[e],c.push(r);const p=c.length>1?c[c.length-2]:t,a=n[n.length-1],s=o(p[a]);p.splice(a,1,s)},T=(t,n,e)=>Object.assign({},t,t[n]?{[n]:t[n].slice()}:{},e||{}),y=(t,n,e)=>{const o=[],r=[...n];if(r.length){let c=t[r.shift()||0];for(o.push(c);r.length&&e;)c=c[e][r.shift()||0],o.push(c)}return o};exports.extendDataItem=T;exports.getItemPath=y;exports.mapTree=i;exports.mapTreeItem=u;