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.72 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"});const u="",l="0",e="_";function I(t,r,s){if(E(t))return r[Number(t)];const n=r[Number(g(t))],o=n&&n[s]||[];return o.length?I(c(t),o,s):void 0}function g(t){return a(t)?t:t.split(e)[0]}function c(t){if(a(t))return t;const r=t.indexOf(e);return t.substring(r+1)}function d(t){return S("0",t)}function S(t,r){return t=t.toString(),r?r+e+t:t}function b(t){const r=t.lastIndexOf(e);return r<0?u:t.substring(0,r)}function a(t){return t===u||t.indexOf(e)<0}function E(t){return t!==u&&t.indexOf(e)<0}function P(t){return t.split(e)}function f(t){const r=t.lastIndexOf(e);return r<0?t:t.substring(r+1)}function R(t){return f(t)===l}function h(t,r){const s=r;t="r"+e+t,r="r"+e+r;const n=b(t)+e;if(r.startsWith(n)){const o=r.substring(n.length);if(o){const i=g(o);if(Number(f(t))<Number(i)){const O=n+(Number(i)-1).toString()+o.substring(i.length);return c(O)}}}return s}exports.EMPTY_ID=u;exports.SEPARATOR=e;exports.ZERO_LEVEL_ZERO_NODE_ID=l;exports.createId=S;exports.getAllShortIds=P;exports.getDecrementedItemIdAfterRemoval=h;exports.getDirectParentId=b;exports.getFirstChildId=d;exports.getIdWithoutRootParentId=c;exports.getItemById=I;exports.getRootParentId=g;exports.getShortId=f;exports.isIdEmptyOrZeroLevel=a;exports.isIdZeroLevel=E;exports.isItemFirstFromSiblings=R;