@progress/kendo-react-common 9.0.0-develop.2 → 9.0.0-develop.3

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.
@@ -14,18 +14,7 @@ import { DropsContext as Pe, DragsContext as Ie, DropContext as Me, DragContext
14
14
  import { useIsomorphicLayoutEffect as Ae } from "./use-isomorphic-layout-effect.mjs";
15
15
  const je = 2e3;
16
16
  function _e(l, ge, ve = {}) {
17
- const {
18
- onPress: B = i,
19
- onRelease: H = i,
20
- onDragStart: W = i,
21
- onDrag: _ = i,
22
- onDragEnd: q = i
23
- } = ge, {
24
- hint: a = null,
25
- mouseOnly: E = !1,
26
- autoScroll: o = !0,
27
- scrollContainer: u = null
28
- } = ve, [f, pe] = t.useState(!1), [C, be] = t.useState(!1), [k] = Ce(Me), [y, g] = Ce(Te), [z] = t.useContext(Pe), [F, G, N] = t.useContext(Ie), v = t.useRef({ x: 0, y: 0 }), D = t.useRef(), S = t.useRef(!1), $ = t.useRef(), m = t.useRef(null), L = t.useRef(!1), J = t.useRef({ x: 0, y: 0 }), K = t.useRef({ x: 0, y: 0 }), p = t.useRef({ x: 0, y: 0 }), Q = t.useRef({ x: 0, y: 0 }), X = t.useRef({ x: 0, y: 0 }), Y = t.useRef({ x: 0, y: 0 }), Ee = !!(typeof window != "undefined" && window.PointerEvent), Z = !E && Ee, c = t.useCallback(
17
+ const { onPress: B = i, onRelease: H = i, onDragStart: W = i, onDrag: _ = i, onDragEnd: q = i } = ge, { hint: a = null, mouseOnly: E = !1, autoScroll: o = !0, scrollContainer: u = null } = ve, [f, pe] = t.useState(!1), [C, be] = t.useState(!1), [k] = Ce(Me), [y, g] = Ce(Te), [z] = t.useContext(Pe), [F, G, N] = t.useContext(Ie), v = t.useRef({ x: 0, y: 0 }), D = t.useRef(), S = t.useRef(!1), $ = t.useRef(), m = t.useRef(null), L = t.useRef(!1), J = t.useRef({ x: 0, y: 0 }), K = t.useRef({ x: 0, y: 0 }), p = t.useRef({ x: 0, y: 0 }), Q = t.useRef({ x: 0, y: 0 }), X = t.useRef({ x: 0, y: 0 }), Y = t.useRef({ x: 0, y: 0 }), Ee = !!(typeof window != "undefined" && window.PointerEvent), Z = !E && Ee, c = t.useCallback(
29
18
  () => l.current && l.current.element ? l.current.element : l.current,
30
19
  [l]
31
20
  ), ke = t.useCallback(
@@ -48,19 +37,13 @@ function _e(l, ge, ve = {}) {
48
37
  onRelease: De,
49
38
  data: l.current
50
39
  }));
51
- const b = t.useCallback(
52
- () => {
53
- const e = c();
54
- return e && e.ownerDocument || document;
55
- },
56
- [c]
57
- ), d = t.useCallback(
58
- () => {
59
- const e = b();
60
- return e && e.defaultView || window;
61
- },
62
- [b]
63
- ), ne = t.useCallback(
40
+ const b = t.useCallback(() => {
41
+ const e = c();
42
+ return e && e.ownerDocument || document;
43
+ }, [c]), d = t.useCallback(() => {
44
+ const e = b();
45
+ return e && e.defaultView || window;
46
+ }, [b]), ne = t.useCallback(
64
47
  () => ({
65
48
  drag: y ? y.current : null,
66
49
  drop: k ? k.current : null,
@@ -81,52 +64,25 @@ function _e(l, ge, ve = {}) {
81
64
  isScrolling: C
82
65
  }),
83
66
  [y, k, F, z, f, o, te, C]
84
- ), re = t.useCallback(
85
- (e) => {
86
- pe(e);
87
- },
88
- []
89
- ), oe = t.useCallback(
90
- (e) => {
91
- be(e);
92
- },
93
- []
94
- ), se = t.useCallback(
95
- (e) => {
96
- v.current = e;
97
- },
98
- []
99
- ), le = t.useCallback(
100
- (e) => {
101
- J.current = e;
102
- },
103
- []
104
- ), ce = t.useCallback(
105
- (e) => {
106
- p.current = e;
107
- },
108
- []
109
- ), ae = t.useCallback(
110
- (e) => {
111
- K.current = e;
112
- },
113
- []
114
- ), ue = t.useCallback(
115
- (e) => {
116
- Q.current = e;
117
- },
118
- []
119
- ), ie = t.useCallback(
120
- (e) => {
121
- X.current = e;
122
- },
123
- []
124
- ), fe = t.useCallback(
125
- (e) => {
126
- Y.current = e;
127
- },
128
- []
129
- ), ye = t.useCallback(
67
+ ), re = t.useCallback((e) => {
68
+ pe(e);
69
+ }, []), oe = t.useCallback((e) => {
70
+ be(e);
71
+ }, []), se = t.useCallback((e) => {
72
+ v.current = e;
73
+ }, []), le = t.useCallback((e) => {
74
+ J.current = e;
75
+ }, []), ce = t.useCallback((e) => {
76
+ p.current = e;
77
+ }, []), ae = t.useCallback((e) => {
78
+ K.current = e;
79
+ }, []), ue = t.useCallback((e) => {
80
+ Q.current = e;
81
+ }, []), ie = t.useCallback((e) => {
82
+ X.current = e;
83
+ }, []), fe = t.useCallback((e) => {
84
+ Y.current = e;
85
+ }, []), ye = t.useCallback(
130
86
  (e) => {
131
87
  B(e);
132
88
  },
@@ -247,23 +203,17 @@ function _e(l, ge, ve = {}) {
247
203
  n(e);
248
204
  },
249
205
  [n]
250
- ), de = t.useCallback(
251
- () => {
252
- const e = c();
253
- if (e) {
254
- const r = e.style.touchAction;
255
- return e.style.touchAction = "none", () => {
256
- e.style.touchAction = r;
257
- };
258
- }
259
- },
260
- [c]
261
- ), me = t.useCallback(
262
- () => (G(h), () => {
263
- N(h);
264
- }),
265
- [N, G]
266
- ), Re = () => {
206
+ ), de = t.useCallback(() => {
207
+ const e = c();
208
+ if (e) {
209
+ const r = e.style.touchAction;
210
+ return e.style.touchAction = "none", () => {
211
+ e.style.touchAction = r;
212
+ };
213
+ }
214
+ }, [c]), me = t.useCallback(() => (G(h), () => {
215
+ N(h);
216
+ }), [N, G]), Re = () => {
267
217
  const e = d(), r = c(), s = b();
268
218
  return Z ? (r && (m.current = he(r), m.current && m.current.addEventListener("scroll", V, { passive: !0 }), r.addEventListener("pointerdown", O, { passive: !0 })), f && (s.addEventListener("pointermove", R), s.addEventListener("pointerup", x, !0), s.addEventListener("contextmenu", T), s.addEventListener("pointercancel", w, { passive: !0 }))) : (e.addEventListener("touchmove", i, { capture: !1, passive: !1 }), r && (r.addEventListener("mousedown", P, { passive: !0 }), E || (r.addEventListener("touchstart", A, { passive: !0 }), f && (r.addEventListener("touchmove", j, { passive: !0 }), r.addEventListener("touchend", U, { passive: !0 })))), f && (s.addEventListener("mousemove", I, { passive: !0 }), s.addEventListener("mouseup", M, { passive: !0 }))), () => {
269
219
  m.current && m.current.removeEventListener("scroll", V), r && (r.removeEventListener("pointerdown", O), r.removeEventListener("mousedown", P), r.removeEventListener("touchstart", A), r.removeEventListener("touchmove", j), r.removeEventListener("touchend", U)), s.removeEventListener("pointermove", R), s.removeEventListener("pointerup", x, !0), s.removeEventListener("contextmenu", T), s.removeEventListener("pointercancel", w), s.removeEventListener("mousemove", I), s.removeEventListener("mouseup", M), e.removeEventListener("touchmove", i), e.clearTimeout($.current);
@@ -272,7 +222,9 @@ function _e(l, ge, ve = {}) {
272
222
  t.useEffect(() => {
273
223
  const e = d();
274
224
  if (C) {
275
- const r = ee() || he(document.elementFromPoint(p.current.x, p.current.y));
225
+ const r = ee() || he(
226
+ document.elementFromPoint(p.current.x, p.current.y)
227
+ );
276
228
  e.clearInterval(D.current), D.current = e.setInterval(() => {
277
229
  xe(r, { x: v.current.x, y: v.current.y });
278
230
  }, 50);
@@ -17,12 +17,7 @@ function y(e, m = {
17
17
  onDragLeave: n,
18
18
  onDrop: n
19
19
  }) {
20
- const {
21
- onDragEnter: s = n,
22
- onDragOver: c = n,
23
- onDragLeave: l = n,
24
- onDrop: u = n
25
- } = m, [, o] = k(E), [, D, g] = t.useContext(v), i = t.useCallback(
20
+ const { onDragEnter: s = n, onDragOver: c = n, onDragLeave: l = n, onDrop: u = n } = m, [, o] = k(E), [, D, g] = t.useContext(v), i = t.useCallback(
26
21
  () => e.current && e.current.element ? e.current.element : e.current,
27
22
  [e]
28
23
  ), a = t.useRef(null);
@@ -54,12 +49,9 @@ function y(e, m = {
54
49
  o(null, { target: e.current, event: r }), u(r);
55
50
  },
56
51
  [o, e, u]
57
- ), p = t.useCallback(
58
- () => (D(a), () => {
59
- g(a);
60
- }),
61
- [g, D]
62
- );
52
+ ), p = t.useCallback(() => (D(a), () => {
53
+ g(a);
54
+ }), [g, D]);
63
55
  L(p, [p]);
64
56
  }
65
57
  export {
@@ -9,12 +9,9 @@
9
9
  import * as a from "react";
10
10
  const d = (n, o) => {
11
11
  const [e, l] = a.useContext(n), [c, u] = a.useState(o);
12
- return [
13
- e !== void 0 ? e : c,
14
- (...t) => {
15
- e !== void 0 ? l(...t) : u(t[0]);
16
- }
17
- ];
12
+ return [e !== void 0 ? e : c, (...t) => {
13
+ e !== void 0 ? l(...t) : u(t[0]);
14
+ }];
18
15
  };
19
16
  export {
20
17
  d as useInheritedState
package/hooks/useRtl.mjs CHANGED
@@ -9,15 +9,12 @@
9
9
  import * as i from "react";
10
10
  function u(t, n, o) {
11
11
  const [e, c] = i.useState(n);
12
- return i.useEffect(
13
- () => {
14
- if (!e && window && t.current) {
15
- const r = window.getComputedStyle(t.current).direction;
16
- r && c(r);
17
- }
18
- },
19
- o
20
- ), e;
12
+ return i.useEffect(() => {
13
+ if (!e && window && t.current) {
14
+ const r = window.getComputedStyle(t.current).direction;
15
+ r && c(r);
16
+ }
17
+ }, o), e;
21
18
  }
22
19
  export {
23
20
  u as useRtl
package/icons/Icon.mjs CHANGED
@@ -13,27 +13,11 @@ import { SIZE_CLASSES as v } from "./constants.mjs";
13
13
  import { toIconClass as N } from "./utils.mjs";
14
14
  import { useMouse as b } from "../hooks/useMouse.mjs";
15
15
  const u = e.forwardRef((a, d) => {
16
- const {
17
- className: n,
18
- name: s,
19
- themeColor: t,
20
- size: i,
21
- flip: m,
22
- style: h,
23
- id: g,
24
- tabIndex: x,
25
- ...y
26
- } = a, l = e.useRef(null), c = e.useRef(null);
16
+ const { className: n, name: s, themeColor: t, size: i, flip: m, style: h, id: g, tabIndex: x, ...y } = a, l = e.useRef(null), c = e.useRef(null);
27
17
  e.useImperativeHandle(l, () => ({
28
18
  element: c.current
29
19
  })), e.useImperativeHandle(d, () => l.current);
30
- const f = e.useMemo(
31
- () => i || p.size,
32
- [i]
33
- ), r = e.useMemo(
34
- () => m || p.flip,
35
- [m]
36
- ), z = e.useMemo(
20
+ const f = e.useMemo(() => i || p.size, [i]), r = e.useMemo(() => m || p.flip, [m]), z = e.useMemo(
37
21
  () => k(
38
22
  "k-icon",
39
23
  "k-font-icon",
@@ -10,14 +10,16 @@ import * as t from "react";
10
10
  import { Icon as g } from "./Icon.mjs";
11
11
  import { SvgIcon as I } from "./SvgIcon.mjs";
12
12
  import { IconsContext as l } from "./IconsContext.mjs";
13
- const v = t.forwardRef((o, c) => {
14
- var r, i;
15
- const { type: m, icons: e } = t.useContext(l), { icon: s, ...f } = o;
16
- let n = m === "svg" ? ((r = o.icon) == null ? void 0 : r.name) || o.name : o.name || ((i = o.icon) == null ? void 0 : i.name);
17
- n = n && e && e[n] && typeof e[n] == "string" ? e[n] : n;
18
- const a = n && e && e[n] && typeof e[n] != "string" ? e[n] : s;
19
- return m === "svg" && a ? /* @__PURE__ */ t.createElement(I, { ...o, icon: a, ref: c }) : /* @__PURE__ */ t.createElement(g, { ...f, name: n, ref: c });
20
- });
13
+ const v = t.forwardRef(
14
+ (o, c) => {
15
+ var r, i;
16
+ const { type: m, icons: e } = t.useContext(l), { icon: s, ...f } = o;
17
+ let n = m === "svg" ? ((r = o.icon) == null ? void 0 : r.name) || o.name : o.name || ((i = o.icon) == null ? void 0 : i.name);
18
+ n = n && e && e[n] && typeof e[n] == "string" ? e[n] : n;
19
+ const a = n && e && e[n] && typeof e[n] != "string" ? e[n] : s;
20
+ return m === "svg" && a ? /* @__PURE__ */ t.createElement(I, { ...o, icon: a, ref: c }) : /* @__PURE__ */ t.createElement(g, { ...f, name: n, ref: c });
21
+ }
22
+ );
21
23
  v.displayName = "KendoIconWrap";
22
24
  export {
23
25
  v as IconWrap
package/icons/SvgIcon.mjs CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  "use client";
9
9
  import * as t from "react";
10
- import s from "prop-types";
10
+ import n from "prop-types";
11
11
  import { classNames as w } from "../classNames.mjs";
12
12
  import { uSvgIcon as x } from "../unstyled/icons.mjs";
13
13
  import { useUnstyled as R } from "../unstyled/main.mjs";
@@ -21,7 +21,7 @@ const y = t.forwardRef((e, b) => {
21
21
  id: p,
22
22
  tabIndex: I,
23
23
  size: h,
24
- style: l,
24
+ style: s,
25
25
  svgStyle: M,
26
26
  themeColor: r,
27
27
  viewBox: m,
@@ -35,41 +35,32 @@ const y = t.forwardRef((e, b) => {
35
35
  element: d.current
36
36
  })
37
37
  );
38
- const g = t.useMemo(
39
- () => o ? o.name : n.icon,
40
- [o]
41
- ), v = t.useMemo(
42
- () => h || n.size,
43
- [h]
44
- ), i = t.useMemo(
45
- () => c || n.flip,
46
- [c]
47
- ), C = t.useMemo(
48
- () => m || n.viewBox,
49
- [m]
50
- ), P = t.useMemo(
51
- () => w(x.wrapper({
52
- c: u,
53
- iconNameProp: g,
54
- themeColor: r,
55
- flipH: i === "horizontal" || i === "both",
56
- flipV: i === "vertical" || i === "both",
57
- size: v
58
- }), a),
38
+ const g = t.useMemo(() => o ? o.name : l.icon, [o]), v = t.useMemo(() => h || l.size, [h]), i = t.useMemo(() => c || l.flip, [c]), C = t.useMemo(() => m || l.viewBox, [m]), P = t.useMemo(
39
+ () => w(
40
+ x.wrapper({
41
+ c: u,
42
+ iconNameProp: g,
43
+ themeColor: r,
44
+ flipH: i === "horizontal" || i === "both",
45
+ flipV: i === "vertical" || i === "both",
46
+ size: v
47
+ }),
48
+ a
49
+ ),
59
50
  [g, r, v, i, a]
60
- ), H = t.useMemo(
61
- () => e.width && e.height ? { width: e.width, height: e.height, ...l } : e.width ? { width: e.width, height: e.width, ...l } : e.height ? { width: e.height, height: e.height, ...l } : { ...l },
62
- [e.width, e.height, l]
63
- );
51
+ ), H = t.useMemo(() => e.width && e.height ? { width: e.width, height: e.height, ...s } : e.width ? { width: e.width, height: e.width, ...s } : e.height ? { width: e.height, height: e.height, ...s } : { ...s }, [e.width, e.height, s]);
64
52
  return /* @__PURE__ */ t.createElement(
65
53
  "span",
66
54
  {
67
- className: w(x.svg({
68
- c: u,
69
- themeColor: r,
70
- flipH: i === "horizontal" || i === "both",
71
- flipV: i === "vertical" || i === "both"
72
- }), P),
55
+ className: w(
56
+ x.svg({
57
+ c: u,
58
+ themeColor: r,
59
+ flipH: i === "horizontal" || i === "both",
60
+ flipV: i === "vertical" || i === "both"
61
+ }),
62
+ P
63
+ ),
73
64
  style: H,
74
65
  ref: d,
75
66
  onClick: S,
@@ -94,11 +85,11 @@ const y = t.forwardRef((e, b) => {
94
85
  );
95
86
  });
96
87
  y.propTypes = {
97
- style: s.object,
98
- classNames: s.string,
99
- children: s.any,
100
- icon: s.object,
101
- themeColor: s.oneOf([
88
+ style: n.object,
89
+ classNames: n.string,
90
+ children: n.any,
91
+ icon: n.object,
92
+ themeColor: n.oneOf([
102
93
  "inherit",
103
94
  "primary",
104
95
  "secondary",
@@ -111,10 +102,10 @@ y.propTypes = {
111
102
  "light",
112
103
  "inverse"
113
104
  ]),
114
- size: s.oneOf(["default", "xsmall", "small", "medium", "large", "xlarge", "xxlarge", "xxxlarge"]),
115
- flip: s.oneOf(["default", "horizontal", "vertical", "both"])
105
+ size: n.oneOf(["default", "xsmall", "small", "medium", "large", "xlarge", "xxlarge", "xxxlarge"]),
106
+ flip: n.oneOf(["default", "horizontal", "vertical", "both"])
116
107
  };
117
- const n = {
108
+ const l = {
118
109
  size: "default",
119
110
  flip: "default",
120
111
  icon: "",
package/index.d.mts CHANGED
@@ -2388,9 +2388,9 @@ export declare interface KendoTheme {
2388
2388
 
2389
2389
  /** @hidden */
2390
2390
  export declare interface KendoThemeMaps {
2391
- sizeMap: Record<Exclude<any, null>, String>;
2392
- roundedMap: Record<Exclude<any, null>, String>;
2393
- orientationMap: Record<Exclude<any, null>, String>;
2391
+ sizeMap: Record<Exclude<any, null>, string>;
2392
+ roundedMap: Record<Exclude<any, null>, string>;
2393
+ orientationMap: Record<Exclude<any, null>, string>;
2394
2394
  }
2395
2395
 
2396
2396
  /** @hidden */
@@ -3860,11 +3860,11 @@ export declare const WatermarkOverlay: () => JSX_2.Element;
3860
3860
  * @hidden
3861
3861
  */
3862
3862
  export declare interface WidgetClassStructure {
3863
- [key: string]: ((props: {
3863
+ [key: string]: (props: {
3864
3864
  [key: string]: any;
3865
3865
  }) => {
3866
3866
  [key: string]: boolean;
3867
- } | string);
3867
+ } | string;
3868
3868
  }
3869
3869
 
3870
3870
  /** @hidden */
package/index.d.ts CHANGED
@@ -2388,9 +2388,9 @@ export declare interface KendoTheme {
2388
2388
 
2389
2389
  /** @hidden */
2390
2390
  export declare interface KendoThemeMaps {
2391
- sizeMap: Record<Exclude<any, null>, String>;
2392
- roundedMap: Record<Exclude<any, null>, String>;
2393
- orientationMap: Record<Exclude<any, null>, String>;
2391
+ sizeMap: Record<Exclude<any, null>, string>;
2392
+ roundedMap: Record<Exclude<any, null>, string>;
2393
+ orientationMap: Record<Exclude<any, null>, string>;
2394
2394
  }
2395
2395
 
2396
2396
  /** @hidden */
@@ -3860,11 +3860,11 @@ export declare const WatermarkOverlay: () => JSX_2.Element;
3860
3860
  * @hidden
3861
3861
  */
3862
3862
  export declare interface WidgetClassStructure {
3863
- [key: string]: ((props: {
3863
+ [key: string]: (props: {
3864
3864
  [key: string]: any;
3865
3865
  }) => {
3866
3866
  [key: string]: boolean;
3867
- } | string);
3867
+ } | string;
3868
3868
  }
3869
3869
 
3870
3870
  /** @hidden */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-common",
3
- "version": "9.0.0-develop.2",
3
+ "version": "9.0.0-develop.3",
4
4
  "description": "React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
package/trappedFocus.mjs CHANGED
@@ -45,18 +45,12 @@ const c = (s, f = u) => s.querySelectorAll(f.join(",")), l = (s, f = u) => {
45
45
  e(f, o);
46
46
  }, 1)) : s.keyCode === r.esc ? (i = !1, f.focus()) : n(s, f, o), t && t(i);
47
47
  }, g = (s, f) => {
48
- const t = c(
49
- s,
50
- f
51
- );
48
+ const t = c(s, f);
52
49
  t && t.forEach((o) => {
53
50
  o.tabIndex = 0;
54
51
  });
55
52
  }, y = (s, f) => {
56
- const t = c(
57
- s,
58
- f
59
- );
53
+ const t = c(s, f);
60
54
  t && t.forEach((o) => {
61
55
  o.tabIndex = -1;
62
56
  });
@@ -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 u="",l="0",r="_";function I(t,e,s){if(E(t))return e[Number(t)];{const n=e[Number(c(t))],o=n&&n[s]||[];return o.length?I(g(t),o,s):void 0}}function c(t){return a(t)?t:t.split(r)[0]}function g(t){if(a(t))return t;{const e=t.indexOf(r);return t.substring(e+1)}}function d(t){return S("0",t)}function S(t,e){return t=t.toString(),e?e+r+t:t}function b(t){const e=t.lastIndexOf(r);return e<0?u:t.substring(0,e)}function a(t){return t===u||t.indexOf(r)<0}function E(t){return t!==u&&t.indexOf(r)<0}function P(t){return t.split(r)}function f(t){const e=t.lastIndexOf(r);return e<0?t:t.substring(e+1)}function R(t){return f(t)===l}function h(t,e){const s=e;t="r"+r+t,e="r"+r+e;const n=b(t)+r;if(e.startsWith(n)){const o=e.substring(n.length);if(o){const i=c(o);if(Number(f(t))<Number(i)){const O=n+(Number(i)-1).toString()+o.substring(i.length);return g(O)}}}return s}exports.EMPTY_ID=u;exports.SEPARATOR=r;exports.ZERO_LEVEL_ZERO_NODE_ID=l;exports.createId=S;exports.getAllShortIds=P;exports.getDecrementedItemIdAfterRemoval=h;exports.getDirectParentId=b;exports.getFirstChildId=d;exports.getIdWithoutRootParentId=g;exports.getItemById=I;exports.getRootParentId=c;exports.getShortId=f;exports.isIdEmptyOrZeroLevel=a;exports.isIdZeroLevel=E;exports.isItemFirstFromSiblings=R;
8
+ "use client";"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(c(t))],o=n&&n[s]||[];return o.length?I(g(t),o,s):void 0}function c(t){return a(t)?t:t.split(e)[0]}function g(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=c(o);if(Number(f(t))<Number(i)){const O=n+(Number(i)-1).toString()+o.substring(i.length);return g(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=g;exports.getItemById=I;exports.getRootParentId=c;exports.getShortId=f;exports.isIdEmptyOrZeroLevel=a;exports.isIdZeroLevel=E;exports.isItemFirstFromSiblings=R;
@@ -6,14 +6,12 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- const c = "", b = "0", r = "_";
10
- function S(t, n, o) {
9
+ const c = "", l = "0", r = "_";
10
+ function S(t, n, s) {
11
11
  if (x(t))
12
12
  return n[Number(t)];
13
- {
14
- const e = n[Number(f(t))], s = e && e[o] || [];
15
- return s.length ? S(i(t), s, o) : void 0;
16
- }
13
+ const e = n[Number(f(t))], o = e && e[s] || [];
14
+ return o.length ? S(i(t), o, s) : void 0;
17
15
  }
18
16
  function f(t) {
19
17
  return a(t) ? t : t.split(r)[0];
@@ -21,10 +19,8 @@ function f(t) {
21
19
  function i(t) {
22
20
  if (a(t))
23
21
  return t;
24
- {
25
- const n = t.indexOf(r);
26
- return t.substring(n + 1);
27
- }
22
+ const n = t.indexOf(r);
23
+ return t.substring(n + 1);
28
24
  }
29
25
  function E(t) {
30
26
  return O("0", t);
@@ -50,28 +46,28 @@ function g(t) {
50
46
  return n < 0 ? t : t.substring(n + 1);
51
47
  }
52
48
  function p(t) {
53
- return g(t) === b;
49
+ return g(t) === l;
54
50
  }
55
51
  function N(t, n) {
56
- const o = n;
52
+ const s = n;
57
53
  t = "r" + r + t, n = "r" + r + n;
58
54
  const e = h(t) + r;
59
55
  if (n.startsWith(e)) {
60
- const s = n.substring(e.length);
61
- if (s) {
62
- const u = f(s);
56
+ const o = n.substring(e.length);
57
+ if (o) {
58
+ const u = f(o);
63
59
  if (Number(g(t)) < Number(u)) {
64
- const l = e + (Number(u) - 1).toString() + s.substring(u.length);
65
- return i(l);
60
+ const b = e + (Number(u) - 1).toString() + o.substring(u.length);
61
+ return i(b);
66
62
  }
67
63
  }
68
64
  }
69
- return o;
65
+ return s;
70
66
  }
71
67
  export {
72
68
  c as EMPTY_ID,
73
69
  r as SEPARATOR,
74
- b as ZERO_LEVEL_ZERO_NODE_ID,
70
+ l as ZERO_LEVEL_ZERO_NODE_ID,
75
71
  O as createId,
76
72
  P as getAllShortIds,
77
73
  N as getDecrementedItemIdAfterRemoval,