impact-nova 1.7.29 → 1.7.30

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.
@@ -1,87 +1,87 @@
1
- import { jsx as R } from "react/jsx-runtime";
2
- import { useState as N, useRef as I, useCallback as C, useEffect as A } from "react";
3
- import { useDataTable as Q } from "./data-table-context.js";
4
- import { NestedList as X } from "../nested-list/nested-list.js";
5
- import { SelectionMode as Y } from "../types/nested-list.types.js";
6
- import { mergePartialOrderedColumnState as Z } from "./data-table-column-state.js";
7
- import { useImpactNovaI18n as ee } from "../../../i18n/ImpactNovaI18nContext.js";
8
- const ue = ({
9
- enableApplyDiscard: T = !1,
10
- showSearch: F = !0,
11
- showSelectAll: q = !0,
12
- showCollapse: j = !0
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import { useState as N, useRef as C, useCallback as b, useEffect as F } from "react";
3
+ import { useDataTable as X } from "./data-table-context.js";
4
+ import { NestedList as Y } from "../nested-list/nested-list.js";
5
+ import { SelectionMode as Z } from "../types/nested-list.types.js";
6
+ import { mergePartialOrderedColumnState as ee } from "./data-table-column-state.js";
7
+ import { useImpactNovaI18n as te } from "../../../i18n/ImpactNovaI18nContext.js";
8
+ const de = ({
9
+ enableApplyDiscard: v = !1,
10
+ showSearch: q = !0,
11
+ showSelectAll: j = !0,
12
+ showCollapse: K = !0
13
13
  }) => {
14
- const { gridApi: l } = Q(), { t: p } = ee(), [K, w] = N([]), [V, W] = N(!1), f = I(!1), v = I(null), b = I(0), [z, O] = N(!1), B = I(/* @__PURE__ */ new Map()), g = C(() => {
14
+ const { gridApi: l } = X(), { t: p } = te(), [V, w] = N([]), [W, B] = N(!1), f = C(!1), T = C(null), y = C(0), z = C({}), [O, P] = N(!1), L = C(/* @__PURE__ */ new Map()), g = b(() => {
15
15
  if (!l || f.current) return;
16
- const o = l.getColumnState(), s = new Map(o.map((t) => [t.colId, t]));
17
- B.current = s;
18
- const c = l.getColumns() || [], i = new Map(c.map((t) => [t.getColId(), t])), r = [], e = [], k = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), H = (t, a) => {
19
- const n = t.getGroupId(), u = `${n}::${a === r ? "f" : "s"}`, d = k.get(u);
16
+ const r = l.getColumnState(), s = new Map(r.map((t) => [t.colId, t]));
17
+ L.current = s;
18
+ const c = l.getColumns() || [], i = new Map(c.map((t) => [t.getColId(), t])), n = [], e = [], k = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), J = (t, a) => {
19
+ const o = t.getGroupId(), u = `${o}::${a === n ? "f" : "s"}`, d = k.get(u);
20
20
  if (d && d.list === a && a[a.length - 1] === d.node)
21
21
  return d.node;
22
22
  const m = D.get(u) || 0;
23
23
  D.set(u, m + 1);
24
- const S = t.getColGroupDef(), h = a === r ? "f" : "s", x = {
25
- id: m === 0 ? `${n}__${h}` : `${n}__${h}__${m}`,
26
- label: S?.headerName || n,
24
+ const I = t.getColGroupDef(), h = a === n ? "f" : "s", R = {
25
+ id: m === 0 ? `${o}__${h}` : `${o}__${h}__${m}`,
26
+ label: I?.headerName || o,
27
27
  checked: !0,
28
28
  children: [],
29
29
  category: "group"
30
30
  };
31
- return a.push(x), k.set(u, { list: a, node: x }), x;
31
+ return a.push(R), k.set(u, { list: a, node: R }), R;
32
32
  };
33
- let E = 0, _ = 0, G = 0, $ = 0;
34
- o.forEach((t) => {
33
+ let E = 0, $ = 0, G = 0, A = 0;
34
+ r.forEach((t) => {
35
35
  const a = i.get(t.colId);
36
36
  if (!a) return;
37
- let n = l.getDisplayNameForColumn(a, "header");
38
- if (n === "") return;
39
- if (n == null) {
37
+ let o = l.getDisplayNameForColumn(a, "header");
38
+ if (o === "") return;
39
+ if (o == null) {
40
40
  const h = a.getColDef();
41
41
  if (h.headerName === "") return;
42
- n = h.headerName || h.field || t.colId;
42
+ o = h.headerName || h.field || t.colId;
43
43
  }
44
- if (!n || n.trim() === "")
44
+ if (!o || o.trim() === "")
45
45
  return;
46
46
  const u = !t.hide, d = {
47
47
  id: t.colId,
48
- label: n,
48
+ label: o,
49
49
  checked: u
50
50
  };
51
- t.pinned ? (E++, u && _++) : (G++, u && $++);
52
- const m = t.pinned ? r : e, S = a.getOriginalParent();
53
- S?.getColGroupDef()?.children ? H(S, m).children.push(d) : m.push(d);
51
+ t.pinned ? (E++, u && $++) : (G++, u && A++);
52
+ const m = t.pinned ? n : e, I = a.getOriginalParent();
53
+ I?.getColGroupDef()?.children ? J(I, m).children.push(d) : m.push(d);
54
54
  });
55
55
  const M = (t) => {
56
56
  let a = t.length > 0;
57
- for (const n of t)
58
- n.children && (n.checked = M(n.children)), n.checked || (a = !1);
57
+ for (const o of t)
58
+ o.children && (o.checked = M(o.children)), o.checked || (a = !1);
59
59
  return a;
60
60
  };
61
- M(r), M(e);
62
- const J = [
61
+ M(n), M(e);
62
+ const Q = [
63
63
  {
64
64
  id: "root-frozen",
65
65
  label: p("dataTable.frozenColumns"),
66
- checked: E > 0 && _ === E,
67
- children: r,
66
+ checked: E > 0 && $ === E,
67
+ children: n,
68
68
  category: "structure",
69
69
  isDragDisabled: !0
70
70
  },
71
71
  {
72
72
  id: "root-scrollable",
73
73
  label: p("dataTable.scrollableColumns"),
74
- checked: G > 0 && $ === G,
74
+ checked: G > 0 && A === G,
75
75
  children: e,
76
76
  category: "structure",
77
77
  isDragDisabled: !0
78
78
  }
79
79
  ];
80
- w(J), W(!0);
80
+ w(Q), B(!0);
81
81
  }, [l, p]);
82
- A(() => {
82
+ F(() => {
83
83
  if (!l) return;
84
- const o = setTimeout(() => g(), 0), s = [
84
+ const r = setTimeout(() => g(), 0), s = [
85
85
  "columnVisible",
86
86
  "columnPinned",
87
87
  "columnMoved",
@@ -99,23 +99,23 @@ const ue = ({
99
99
  const i = () => {
100
100
  c && clearTimeout(c), c = setTimeout(() => {
101
101
  c = null;
102
- const r = !f.current;
103
- f.current = !1, g(), r && O((e) => !e);
102
+ const n = !f.current;
103
+ f.current = !1, g(), n && P((e) => !e);
104
104
  }, 150);
105
105
  };
106
- return l.isDestroyed() || s.forEach((r) => l.addEventListener(r, i)), () => {
107
- clearTimeout(o), c && clearTimeout(c), l.isDestroyed() || s.forEach((r) => l.removeEventListener(r, i));
106
+ return l.isDestroyed() || s.forEach((n) => l.addEventListener(n, i)), () => {
107
+ clearTimeout(r), c && clearTimeout(c), l.isDestroyed() || s.forEach((n) => l.removeEventListener(n, i));
108
108
  };
109
- }, [l, g]), A(() => {
110
- if (b.current === 0) return;
111
- const o = requestAnimationFrame(() => {
112
- const s = v.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
113
- s && (s.scrollTop = b.current, b.current = 0);
109
+ }, [l, g]), F(() => {
110
+ if (y.current === 0) return;
111
+ const r = requestAnimationFrame(() => {
112
+ const s = T.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
113
+ s && (s.scrollTop = y.current, y.current = 0);
114
114
  });
115
- return () => cancelAnimationFrame(o);
116
- }, [z]);
117
- const P = C((o) => {
118
- const s = [], c = (i, r) => {
115
+ return () => cancelAnimationFrame(r);
116
+ }, [O]);
117
+ const _ = b((r) => {
118
+ const s = [], c = (i, n) => {
119
119
  i.forEach((e) => {
120
120
  if (e.id === "root-frozen") {
121
121
  e.children && c(e.children, "left");
@@ -125,57 +125,61 @@ const ue = ({
125
125
  e.children && c(e.children, null);
126
126
  return;
127
127
  }
128
- e.category === "group" || e.children && e.children.length > 0 ? e.children && c(e.children, r) : l?.getColumn(e.id) && s.push({
128
+ e.category === "group" || e.children && e.children.length > 0 ? e.children && c(e.children, n) : l?.getColumn(e.id) && s.push({
129
129
  colId: e.id,
130
- pinned: r,
130
+ pinned: n,
131
131
  hide: !e.checked
132
132
  });
133
133
  });
134
134
  };
135
- return c(o, null), s;
136
- }, [l]), y = C((o) => {
135
+ return c(r, null), s;
136
+ }, [l]), S = b((r) => {
137
137
  if (!l) return;
138
138
  f.current = !0;
139
- const s = P(o);
139
+ const s = _(r);
140
140
  if (s.length === 0) {
141
141
  setTimeout(() => {
142
142
  f.current = !1;
143
143
  }, 300);
144
144
  return;
145
145
  }
146
- const c = l.getColumnState(), i = Z(c, s);
146
+ const c = l.getColumnState(), i = ee(c, s);
147
147
  l.applyColumnState({
148
148
  state: i,
149
149
  applyOrder: !0
150
150
  }), setTimeout(() => {
151
151
  f.current = !1;
152
- const r = v.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
153
- r && (b.current = r.scrollTop), g(), O((e) => !e);
152
+ const n = T.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
153
+ n && (y.current = n.scrollTop), g(), P((e) => !e);
154
154
  }, 300);
155
- }, [l, P, g]), L = C((o) => {
156
- y(o);
157
- }, [y]), U = C((o) => {
158
- T || y(o), w(o);
159
- }, [T, y]);
160
- return V ? /* @__PURE__ */ R("div", { ref: v, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ R(
161
- X,
155
+ }, [l, _, g]), U = b((r) => {
156
+ S(r);
157
+ }, [S]), H = b((r) => {
158
+ v || S(r), w(r);
159
+ }, [v, S]);
160
+ return W ? /* @__PURE__ */ x("div", { ref: T, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ x(
161
+ Y,
162
162
  {
163
- items: K,
164
- onChange: U,
165
- onSubmit: L,
166
- enableApplyDiscard: T,
167
- enableSearch: F,
168
- enableSelectAll: q,
163
+ items: V,
164
+ onChange: H,
165
+ onSubmit: U,
166
+ enableApplyDiscard: v,
167
+ enableSearch: q,
168
+ enableSelectAll: j,
169
169
  enableDragDrop: !0,
170
170
  enableCollapse: !0,
171
- enableGlobalCollapse: j,
172
- selectionMode: Y.CASCADE_DOWN,
171
+ enableGlobalCollapse: K,
172
+ selectionMode: Z.CASCADE_DOWN,
173
173
  searchPlaceholder: p("dataTable.searchColumnsPlaceholder"),
174
- className: "h-full"
174
+ className: "h-full",
175
+ initialCollapsedItems: z.current,
176
+ onCollapseChange: (r) => {
177
+ z.current = r;
178
+ }
175
179
  },
176
- z ? "sync-a" : "sync-b"
177
- ) }) : /* @__PURE__ */ R("div", { className: "p-4 text-[13px] text-content-placeholder", children: p("dataTable.loadingColumns") });
180
+ O ? "sync-a" : "sync-b"
181
+ ) }) : /* @__PURE__ */ x("div", { className: "p-4 text-[13px] text-content-placeholder", children: p("dataTable.loadingColumns") });
178
182
  };
179
183
  export {
180
- ue as DataTableColumnList
184
+ de as DataTableColumnList
181
185
  };
@@ -15,8 +15,9 @@ export declare const customCollisionDetection: CollisionDetection;
15
15
  interface UseNestedListDragDropProps {
16
16
  items: NestedListItem[];
17
17
  onDragEnd?: (activeId: string, overId: string | null) => void;
18
+ collapsedItems?: Record<string, boolean>;
18
19
  }
19
- export declare const useNestedListDragDrop: ({ items, onDragEnd, }: UseNestedListDragDropProps) => {
20
+ export declare const useNestedListDragDrop: ({ items, onDragEnd, collapsedItems, }: UseNestedListDragDropProps) => {
20
21
  sensors: import('@dnd-kit/core').SensorDescriptor<import('@dnd-kit/core').SensorOptions>[];
21
22
  handleDragEnd: (event: DragEndEvent, setItems: (updater: (prevItems: NestedListItem[]) => NestedListItem[]) => void) => void;
22
23
  isValidDrop: (activeItemId: string | null, overItemId: string | null) => boolean;
@@ -1,239 +1,240 @@
1
- import { useCallback as S } from "react";
2
- import { useSensors as K, useSensor as H, MouseSensor as Q, TouchSensor as U, closestCenter as Z } from "@dnd-kit/core";
3
- import { arrayMove as _ } from "@dnd-kit/sortable";
4
- const V = "droppable-", b = /* @__PURE__ */ new Set(["root-frozen", "root-scrollable"]);
5
- function W(a) {
6
- if (a.startsWith(V)) {
7
- const s = a.slice(V.length);
8
- if (b.has(s)) return s;
1
+ import { useCallback as x } from "react";
2
+ import { useSensors as Q, useSensor as V, MouseSensor as U, TouchSensor as Z, closestCenter as $ } from "@dnd-kit/core";
3
+ import { arrayMove as w } from "@dnd-kit/sortable";
4
+ const W = "droppable-", y = /* @__PURE__ */ new Set(["root-frozen", "root-scrollable"]);
5
+ function X(a) {
6
+ if (a.startsWith(W)) {
7
+ const s = a.slice(W.length);
8
+ if (y.has(s)) return s;
9
9
  }
10
10
  return null;
11
11
  }
12
- const m = (a) => {
13
- const s = Z(a), f = s.filter(
14
- (h) => !b.has(h.id)
12
+ const I = (a) => {
13
+ const s = $(a), d = s.filter(
14
+ (R) => !y.has(R.id)
15
15
  );
16
- return f.length > 0 ? f : s;
16
+ return d.length > 0 ? d : s;
17
17
  };
18
- function F(a, s) {
19
- for (const f of a) {
20
- if (f.id === s) return f;
21
- if (f.children) {
22
- const h = F(f.children, s);
23
- if (h) return h;
18
+ function M(a, s) {
19
+ for (const d of a) {
20
+ if (d.id === s) return d;
21
+ if (d.children) {
22
+ const R = M(d.children, s);
23
+ if (R) return R;
24
24
  }
25
25
  }
26
26
  }
27
- function X(a, s) {
28
- for (const f of a) {
29
- if (f.id === s) return null;
30
- if (f.children && F(f.children, s))
31
- return f.id;
27
+ function j(a, s) {
28
+ for (const d of a) {
29
+ if (d.id === s) return null;
30
+ if (d.children && M(d.children, s))
31
+ return d.id;
32
32
  }
33
33
  return null;
34
34
  }
35
- const I = ({
35
+ const nn = ({
36
36
  items: a,
37
- onDragEnd: s
37
+ onDragEnd: s,
38
+ collapsedItems: d = {}
38
39
  }) => {
39
- const f = K(
40
- H(Q),
41
- H(U)
42
- ), h = S(
43
- (i, e, o = 0) => {
40
+ const R = Q(
41
+ V(U),
42
+ V(Z)
43
+ ), C = x(
44
+ (i, e, t = 0) => {
44
45
  for (const n of i) {
45
- if (n.id === e) return o;
46
+ if (n.id === e) return t;
46
47
  if (n.children) {
47
- const r = h(n.children, e, o + 1);
48
+ const r = C(n.children, e, t + 1);
48
49
  if (r !== null) return r;
49
50
  }
50
51
  }
51
52
  return null;
52
53
  },
53
54
  []
54
- ), R = S(
55
- (i, e, o = null) => {
55
+ ), T = x(
56
+ (i, e, t = null) => {
56
57
  for (const n of i) {
57
- if (n.id === e) return o;
58
+ if (n.id === e) return t;
58
59
  if (n.children) {
59
- const r = R(n.children, e, n.id);
60
+ const r = T(n.children, e, n.id);
60
61
  if (r !== null) return r;
61
62
  }
62
63
  }
63
64
  return null;
64
65
  },
65
66
  []
66
- ), y = S(
67
- (i, e, o) => i.map((n) => {
67
+ ), A = x(
68
+ (i, e, t) => i.map((n) => {
68
69
  if (n.children && n.children.length > 0) {
69
70
  const r = n.children.findIndex(
70
- (t) => t.id === e
71
+ (o) => o.id === e
71
72
  ), c = n.children.findIndex(
72
- (t) => t.id === o
73
+ (o) => o.id === t
73
74
  );
74
75
  if (r !== -1 && c !== -1) {
75
- const t = _(n.children, r, c);
76
+ const o = w(n.children, r, c);
76
77
  return {
77
78
  ...n,
78
- children: t
79
+ children: o
79
80
  };
80
81
  }
81
82
  return {
82
83
  ...n,
83
- children: y(n.children, e, o)
84
+ children: A(n.children, e, t)
84
85
  };
85
86
  }
86
87
  return n;
87
88
  }),
88
89
  []
89
- ), w = S(
90
- (i, e, o) => {
91
- const n = R(i, o);
90
+ ), B = x(
91
+ (i, e, t) => {
92
+ const n = T(i, t);
92
93
  if (!n) return null;
93
94
  const r = i.findIndex(
94
- (t) => t.id === n
95
+ (o) => o.id === n
95
96
  ), c = i.findIndex(
96
- (t) => t.id === e
97
+ (o) => o.id === e
97
98
  );
98
99
  if (r !== -1 && c !== -1) {
99
- const t = _(
100
+ const o = w(
100
101
  i,
101
102
  c,
102
103
  r
103
104
  );
104
- return s?.(e, n), t;
105
+ return s?.(e, n), o;
105
106
  }
106
107
  return null;
107
108
  },
108
- [R, s]
109
- ), B = S(
110
- (i, e, o) => {
111
- const n = i.findIndex((c) => c.id === e), r = i.findIndex((c) => c.id === o);
109
+ [T, s]
110
+ ), k = x(
111
+ (i, e, t) => {
112
+ const n = i.findIndex((c) => c.id === e), r = i.findIndex((c) => c.id === t);
112
113
  if (n !== -1 && r !== -1) {
113
- const c = _(i, n, r);
114
- return s?.(e, o), c;
114
+ const c = w(i, n, r);
115
+ return s?.(e, t), c;
115
116
  }
116
117
  return null;
117
118
  },
118
119
  [s]
119
- ), k = S(
120
- (i, e, o) => {
121
- const n = y(i, e, o);
122
- return s?.(e, o), n;
120
+ ), z = x(
121
+ (i, e, t) => {
122
+ const n = A(i, e, t);
123
+ return s?.(e, t), n;
123
124
  },
124
- [y, s]
125
- ), A = S(
126
- (i, e, o, n = !1) => {
127
- const r = F(i, e);
125
+ [A, s]
126
+ ), G = x(
127
+ (i, e, t, n = !1) => {
128
+ const r = M(i, e);
128
129
  if (!r) return null;
129
130
  const c = (u) => u.filter((l) => l.id !== e).map(
130
131
  (l) => l.children ? { ...l, children: c(l.children) } : l
131
- ).filter((l) => !(l.children && l.children.length === 0 && l.category === "group")), t = F(i, o), d = !r.children || r.children.length === 0, C = t?.children && t.children.length > 0, T = d && C, M = (u) => {
132
+ ).filter((l) => !(l.children && l.children.length === 0 && l.category === "group")), o = M(i, t), f = !r.children || r.children.length === 0, S = o?.children && o.children.length > 0, g = d[t] === !0, _ = f && S && !g, Y = (u) => {
132
133
  for (let l = 0; l < u.length; l++) {
133
- if (u[l].id === o)
134
- if (T) {
135
- const x = {
134
+ if (u[l].id === t)
135
+ if (_) {
136
+ const P = {
136
137
  ...u[l],
137
138
  children: [r, ...u[l].children || []]
138
- }, P = [...u];
139
- return P[l] = x, { nodes: P, inserted: !0 };
139
+ }, h = [...u];
140
+ return h[l] = P, { nodes: h, inserted: !0 };
140
141
  } else {
141
- const x = [...u], P = n ? l + 1 : l;
142
- return x.splice(P, 0, r), { nodes: x, inserted: !0 };
142
+ const P = [...u], h = n ? l + 1 : l;
143
+ return P.splice(h, 0, r), { nodes: P, inserted: !0 };
143
144
  }
144
145
  if (u[l].children) {
145
- const x = M(u[l].children);
146
- if (x.inserted) {
147
- const P = [...u];
148
- return P[l] = { ...u[l], children: x.nodes }, { nodes: P, inserted: !0 };
146
+ const P = Y(u[l].children);
147
+ if (P.inserted) {
148
+ const h = [...u];
149
+ return h[l] = { ...u[l], children: P.nodes }, { nodes: h, inserted: !0 };
149
150
  }
150
151
  }
151
152
  }
152
153
  return { nodes: u, inserted: !1 };
153
- }, N = c(i), { nodes: g, inserted: Y } = M(N);
154
- return Y ? (s?.(e, o), g) : null;
154
+ }, L = c(i), { nodes: b, inserted: O } = Y(L);
155
+ return O ? (s?.(e, t), b) : null;
155
156
  },
156
- [s]
157
- ), G = S(
158
- (i, e, o) => {
159
- const n = F(i, e);
157
+ [s, d]
158
+ ), N = x(
159
+ (i, e, t) => {
160
+ const n = M(i, e);
160
161
  if (!n) return i;
161
- const r = (t) => t.filter((d) => d.id !== e).map(
162
- (d) => d.children ? { ...d, children: r(d.children) } : d
163
- ), c = i.map((t) => {
164
- let d = t.children ? r(t.children) : [];
165
- return t.id === o && (d = [n, ...d]), { ...t, children: d };
162
+ const r = (o) => o.filter((f) => f.id !== e).map(
163
+ (f) => f.children ? { ...f, children: r(f.children) } : f
164
+ ), c = i.map((o) => {
165
+ let f = o.children ? r(o.children) : [];
166
+ return o.id === t && (f = [n, ...f]), { ...o, children: f };
166
167
  });
167
- return s?.(e, o), c;
168
+ return s?.(e, t), c;
168
169
  },
169
170
  [s]
170
- ), j = S(
171
+ ), q = x(
171
172
  (i, e) => {
172
- const { active: o, over: n } = i;
173
- !n || o.id === n.id || e((r) => {
174
- const c = o.id, t = n.id, d = W(t);
175
- if (d)
176
- return G(r, c, d);
177
- const C = h(r, c), T = h(r, t), M = R(r, c), N = R(r, t);
178
- if (b.has(t) && C !== null && C > 0)
179
- return G(r, c, t);
180
- if (C === 0 && T !== null && T > 0)
181
- return w(
173
+ const { active: t, over: n } = i;
174
+ !n || t.id === n.id || e((r) => {
175
+ const c = t.id, o = n.id, f = X(o);
176
+ if (f)
177
+ return N(r, c, f);
178
+ const S = C(r, c), g = C(r, o), _ = T(r, c), Y = T(r, o);
179
+ if (y.has(o) && S !== null && S > 0)
180
+ return N(r, c, o);
181
+ if (S === 0 && g !== null && g > 0)
182
+ return B(
182
183
  r,
183
184
  c,
184
- t
185
+ o
185
186
  ) || r;
186
- if (C === null || T === null)
187
+ if (S === null || g === null)
187
188
  return r;
188
- if (C > 0 && T > 0 && M !== N) {
189
- const g = X(r, c), Y = X(r, t);
190
- if (g && Y && g !== Y) {
191
- const L = o.rect.current.translated, O = n.rect;
192
- let z = !1;
193
- if (L && O) {
194
- const D = L.top + L.height / 2, J = O.top + O.height / 2;
195
- z = D > J;
189
+ if (S > 0 && g > 0 && _ !== Y) {
190
+ const L = j(r, c), b = j(r, o);
191
+ if (L && b && L !== b) {
192
+ const h = t.rect.current.translated, F = n.rect;
193
+ let H = !1;
194
+ if (h && F) {
195
+ const J = h.top + h.height / 2, K = F.top + F.height / 2;
196
+ H = J > K;
196
197
  }
197
- return A(r, c, t, z) || r;
198
+ return G(r, c, o, H) || r;
198
199
  }
199
- const u = o.rect.current.translated, l = n.rect;
200
- let x = !1;
201
- if (u && l) {
202
- const L = u.top + u.height / 2, O = l.top + l.height / 2;
203
- x = L > O;
200
+ const O = t.rect.current.translated, u = n.rect;
201
+ let l = !1;
202
+ if (O && u) {
203
+ const h = O.top + O.height / 2, F = u.top + u.height / 2;
204
+ l = h > F;
204
205
  }
205
- return A(r, c, t, x) || r;
206
+ return G(r, c, o, l) || r;
206
207
  }
207
- return C === 0 ? B(r, c, t) || r : k(r, c, t);
208
+ return S === 0 ? k(r, c, o) || r : z(r, c, o);
208
209
  });
209
210
  },
210
211
  [
211
- h,
212
- R,
213
- w,
212
+ C,
213
+ T,
214
214
  B,
215
215
  k,
216
- A,
217
- G
216
+ z,
217
+ G,
218
+ N
218
219
  ]
219
- ), q = S(
220
+ ), D = x(
220
221
  (i, e) => {
221
222
  if (!i || !e || i === e)
222
223
  return !1;
223
- const o = i ? h(a, i) : null, n = e ? h(a, e) : null;
224
- return W(e) !== null || b.has(e) ? !0 : o === null || n === null ? !1 : o === 0 && n > 0 || o === n || o > 0 && n > 0;
224
+ const t = i ? C(a, i) : null, n = e ? C(a, e) : null;
225
+ return X(e) !== null || y.has(e) ? !0 : t === null || n === null ? !1 : t === 0 && n > 0 || t === n || t > 0 && n > 0;
225
226
  },
226
- [a, h]
227
+ [a, C]
227
228
  );
228
229
  return {
229
- sensors: f,
230
- handleDragEnd: j,
231
- isValidDrop: q,
232
- findItemLevel: h,
233
- findParentId: R
230
+ sensors: R,
231
+ handleDragEnd: q,
232
+ isValidDrop: D,
233
+ findItemLevel: C,
234
+ findParentId: T
234
235
  };
235
236
  };
236
237
  export {
237
- m as customCollisionDetection,
238
- I as useNestedListDragDrop
238
+ I as customCollisionDetection,
239
+ nn as useNestedListDragDrop
239
240
  };