impact-nova 1.7.21 → 1.7.22
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,37 +1,37 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useSensors as W, useSensor as
|
|
3
|
-
import { arrayMove as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
if (f.startsWith(
|
|
7
|
-
const c = f.slice(
|
|
8
|
-
if (
|
|
1
|
+
import { useCallback as h } from "react";
|
|
2
|
+
import { useSensors as W, useSensor as A, MouseSensor as X, TouchSensor as j, closestCorners as q } from "@dnd-kit/core";
|
|
3
|
+
import { arrayMove as w } from "@dnd-kit/sortable";
|
|
4
|
+
const B = "droppable-", O = /* @__PURE__ */ new Set(["root-frozen", "root-scrollable"]);
|
|
5
|
+
function Y(f) {
|
|
6
|
+
if (f.startsWith(B)) {
|
|
7
|
+
const c = f.slice(B.length);
|
|
8
|
+
if (O.has(c)) return c;
|
|
9
9
|
}
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
const c = q(f),
|
|
14
|
-
(s) => !
|
|
12
|
+
const K = (f) => {
|
|
13
|
+
const c = q(f), a = c.filter(
|
|
14
|
+
(s) => !O.has(s.id)
|
|
15
15
|
);
|
|
16
|
-
return
|
|
16
|
+
return a.length > 0 ? a : c;
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
for (const
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
const s =
|
|
18
|
+
function F(f, c) {
|
|
19
|
+
for (const a of f) {
|
|
20
|
+
if (a.id === c) return a;
|
|
21
|
+
if (a.children) {
|
|
22
|
+
const s = F(a.children, c);
|
|
23
23
|
if (s) return s;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const Q = ({
|
|
28
28
|
items: f,
|
|
29
29
|
onDragEnd: c
|
|
30
30
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
), s =
|
|
31
|
+
const a = W(
|
|
32
|
+
A(X),
|
|
33
|
+
A(j)
|
|
34
|
+
), s = h(
|
|
35
35
|
(t, r, o = 0) => {
|
|
36
36
|
for (const n of t) {
|
|
37
37
|
if (n.id === r) return o;
|
|
@@ -43,19 +43,19 @@ const U = ({
|
|
|
43
43
|
return null;
|
|
44
44
|
},
|
|
45
45
|
[]
|
|
46
|
-
),
|
|
46
|
+
), S = h(
|
|
47
47
|
(t, r, o = null) => {
|
|
48
48
|
for (const n of t) {
|
|
49
49
|
if (n.id === r) return o;
|
|
50
50
|
if (n.children) {
|
|
51
|
-
const e =
|
|
51
|
+
const e = S(n.children, r, n.id);
|
|
52
52
|
if (e !== null) return e;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
return null;
|
|
56
56
|
},
|
|
57
57
|
[]
|
|
58
|
-
),
|
|
58
|
+
), M = h(
|
|
59
59
|
(t, r, o) => t.map((n) => {
|
|
60
60
|
if (n.children && n.children.length > 0) {
|
|
61
61
|
const e = n.children.findIndex(
|
|
@@ -64,7 +64,7 @@ const U = ({
|
|
|
64
64
|
(l) => l.id === o
|
|
65
65
|
);
|
|
66
66
|
if (e !== -1 && i !== -1) {
|
|
67
|
-
const l =
|
|
67
|
+
const l = w(n.children, e, i);
|
|
68
68
|
return {
|
|
69
69
|
...n,
|
|
70
70
|
children: l
|
|
@@ -72,15 +72,15 @@ const U = ({
|
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
74
74
|
...n,
|
|
75
|
-
children:
|
|
75
|
+
children: M(n.children, r, o)
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
return n;
|
|
79
79
|
}),
|
|
80
80
|
[]
|
|
81
|
-
),
|
|
81
|
+
), _ = h(
|
|
82
82
|
(t, r, o) => {
|
|
83
|
-
const n =
|
|
83
|
+
const n = S(t, o);
|
|
84
84
|
if (!n) return null;
|
|
85
85
|
const e = t.findIndex(
|
|
86
86
|
(l) => l.id === n
|
|
@@ -88,7 +88,7 @@ const U = ({
|
|
|
88
88
|
(l) => l.id === r
|
|
89
89
|
);
|
|
90
90
|
if (e !== -1 && i !== -1) {
|
|
91
|
-
const l =
|
|
91
|
+
const l = w(
|
|
92
92
|
t,
|
|
93
93
|
i,
|
|
94
94
|
e
|
|
@@ -97,122 +97,120 @@ const U = ({
|
|
|
97
97
|
}
|
|
98
98
|
return null;
|
|
99
99
|
},
|
|
100
|
-
[
|
|
101
|
-
),
|
|
100
|
+
[S, c]
|
|
101
|
+
), g = h(
|
|
102
102
|
(t, r, o) => {
|
|
103
103
|
const n = t.findIndex((i) => i.id === r), e = t.findIndex((i) => i.id === o);
|
|
104
104
|
if (n !== -1 && e !== -1) {
|
|
105
|
-
const i =
|
|
105
|
+
const i = w(t, n, e);
|
|
106
106
|
return c?.(r, o), i;
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
109
|
},
|
|
110
110
|
[c]
|
|
111
|
-
),
|
|
111
|
+
), p = h(
|
|
112
112
|
(t, r, o) => {
|
|
113
|
-
const n =
|
|
113
|
+
const n = M(t, r, o);
|
|
114
114
|
return c?.(r, o), n;
|
|
115
115
|
},
|
|
116
|
-
[
|
|
117
|
-
),
|
|
116
|
+
[M, c]
|
|
117
|
+
), y = h(
|
|
118
118
|
(t, r, o, n = !1) => {
|
|
119
|
-
const e =
|
|
120
|
-
if (!e
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
129
|
-
if (u.id === i) {
|
|
130
|
-
const d = u.children ? [...u.children] : [], C = d.findIndex(
|
|
131
|
-
(S) => S.id === o
|
|
132
|
-
);
|
|
133
|
-
if (C !== -1) {
|
|
134
|
-
const S = n ? C + 1 : C;
|
|
135
|
-
d.splice(S, 0, l);
|
|
136
|
-
} else
|
|
137
|
-
d.push(l);
|
|
138
|
-
return {
|
|
139
|
-
...u,
|
|
140
|
-
children: d
|
|
141
|
-
};
|
|
119
|
+
const e = F(t, r);
|
|
120
|
+
if (!e) return null;
|
|
121
|
+
const i = (C) => C.filter((u) => u.id !== r).map(
|
|
122
|
+
(u) => u.children ? { ...u, children: i(u.children) } : u
|
|
123
|
+
), l = (C) => {
|
|
124
|
+
const u = C.findIndex((d) => d.id === o);
|
|
125
|
+
if (u !== -1) {
|
|
126
|
+
const d = [...C], T = n ? u + 1 : u;
|
|
127
|
+
return d.splice(T, 0, e), { nodes: d, inserted: !0 };
|
|
142
128
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
129
|
+
let P = !1;
|
|
130
|
+
return { nodes: C.map((d) => {
|
|
131
|
+
if (P || !d.children) return d;
|
|
132
|
+
const T = l(d.children);
|
|
133
|
+
return T.inserted ? (P = !0, { ...d, children: T.nodes }) : d;
|
|
134
|
+
}), inserted: P };
|
|
135
|
+
}, L = i(t), { nodes: x, inserted: R } = l(L);
|
|
136
|
+
return R ? (c?.(r, o), x) : null;
|
|
146
137
|
},
|
|
147
|
-
[
|
|
148
|
-
),
|
|
138
|
+
[c]
|
|
139
|
+
), b = h(
|
|
149
140
|
(t, r, o) => {
|
|
150
|
-
const n =
|
|
141
|
+
const n = F(t, r);
|
|
151
142
|
if (!n) return t;
|
|
152
143
|
const e = t.map((i) => {
|
|
153
|
-
let l = i.children ? i.children.filter((
|
|
144
|
+
let l = i.children ? i.children.filter((L) => L.id !== r) : [];
|
|
154
145
|
return i.id === o && (l = [n, ...l]), { ...i, children: l };
|
|
155
146
|
});
|
|
156
147
|
return c?.(r, o), e;
|
|
157
148
|
},
|
|
158
149
|
[c]
|
|
159
|
-
), k =
|
|
150
|
+
), k = h(
|
|
160
151
|
(t, r) => {
|
|
161
152
|
const { active: o, over: n } = t;
|
|
162
153
|
!n || o.id === n.id || r((e) => {
|
|
163
|
-
const i = o.id, l = n.id,
|
|
164
|
-
if (
|
|
165
|
-
return
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
154
|
+
const i = o.id, l = n.id, L = Y(l);
|
|
155
|
+
if (L)
|
|
156
|
+
return console.log("[NL-drop] route=section", { activeId: i, sectionId: L }), b(e, i, L);
|
|
157
|
+
const x = s(e, i), R = s(e, l), C = S(e, i), u = S(e, l);
|
|
158
|
+
if (console.log("[NL-drop] event", {
|
|
159
|
+
activeId: i,
|
|
160
|
+
overId: l,
|
|
161
|
+
activeLevel: x,
|
|
162
|
+
overLevel: R,
|
|
163
|
+
activeParentId: C,
|
|
164
|
+
overParentId: u
|
|
165
|
+
}), O.has(l) && x !== null && x > 0)
|
|
166
|
+
return b(e, i, l);
|
|
167
|
+
if (x === 0 && R !== null && R > 0)
|
|
168
|
+
return _(
|
|
171
169
|
e,
|
|
172
170
|
i,
|
|
173
171
|
l
|
|
174
172
|
) || e;
|
|
175
|
-
if (
|
|
173
|
+
if (x === null || R === null)
|
|
176
174
|
return e;
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
let
|
|
180
|
-
if (
|
|
181
|
-
const H =
|
|
182
|
-
|
|
175
|
+
if (x > 0 && R > 0 && C !== u) {
|
|
176
|
+
const P = o.rect.current.translated, N = n.rect;
|
|
177
|
+
let d = !1;
|
|
178
|
+
if (P && N) {
|
|
179
|
+
const H = P.top + P.height / 2, V = N.top + N.height / 2;
|
|
180
|
+
d = H > V;
|
|
183
181
|
}
|
|
184
|
-
return
|
|
182
|
+
return y(e, i, l, d) || e;
|
|
185
183
|
}
|
|
186
|
-
return
|
|
184
|
+
return x === 0 ? g(e, i, l) || e : p(e, i, l);
|
|
187
185
|
});
|
|
188
186
|
},
|
|
189
187
|
[
|
|
190
188
|
s,
|
|
191
|
-
|
|
192
|
-
N,
|
|
189
|
+
S,
|
|
193
190
|
_,
|
|
191
|
+
g,
|
|
192
|
+
p,
|
|
194
193
|
y,
|
|
195
|
-
|
|
196
|
-
O
|
|
194
|
+
b
|
|
197
195
|
]
|
|
198
|
-
), z =
|
|
196
|
+
), z = h(
|
|
199
197
|
(t, r) => {
|
|
200
198
|
if (!t || !r || t === r)
|
|
201
199
|
return !1;
|
|
202
200
|
const o = t ? s(f, t) : null, n = r ? s(f, r) : null;
|
|
203
|
-
return
|
|
201
|
+
return Y(r) !== null || O.has(r) ? !0 : o === null || n === null ? !1 : o === 0 && n > 0 || o === n || o > 0 && n > 0;
|
|
204
202
|
},
|
|
205
203
|
[f, s]
|
|
206
204
|
);
|
|
207
205
|
return {
|
|
208
|
-
sensors:
|
|
206
|
+
sensors: a,
|
|
209
207
|
handleDragEnd: k,
|
|
210
208
|
isValidDrop: z,
|
|
211
209
|
findItemLevel: s,
|
|
212
|
-
findParentId:
|
|
210
|
+
findParentId: S
|
|
213
211
|
};
|
|
214
212
|
};
|
|
215
213
|
export {
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
K as customCollisionDetection,
|
|
215
|
+
Q as useNestedListDragDrop
|
|
218
216
|
};
|
|
@@ -1,191 +1,205 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import re, { useMemo as
|
|
1
|
+
import { jsx as v, jsxs as se } from "react/jsx-runtime";
|
|
2
|
+
import re, { useMemo as w, useCallback as A } from "react";
|
|
3
3
|
import { SortableItem as He } from "./components/SortableItem.js";
|
|
4
|
-
import { SelectionMode as
|
|
5
|
-
import { useNestedListDragDrop as
|
|
6
|
-
import { useNestedListSelectAll as
|
|
7
|
-
import { useNestedListState as
|
|
8
|
-
import { useNestedListHandlers as
|
|
4
|
+
import { SelectionMode as V } from "../types/nested-list.types.js";
|
|
5
|
+
import { useNestedListDragDrop as Je } from "./hooks/useNestedListDragDrop.js";
|
|
6
|
+
import { useNestedListSelectAll as We } from "./hooks/useNestedListSelectAll.js";
|
|
7
|
+
import { useNestedListState as je } from "./hooks/useNestedListState.js";
|
|
8
|
+
import { useNestedListHandlers as Fe } from "./hooks/useNestedListHandlers.js";
|
|
9
9
|
import { NestedListHeader as qe } from "./components/NestedListHeader.js";
|
|
10
10
|
import { NestedListCategoryFilters as Ke } from "./components/NestedListCategoryFilters.js";
|
|
11
11
|
import { NestedListContent as Qe } from "./components/NestedListContent.js";
|
|
12
12
|
import { NestedListApplyDiscardButtons as Xe } from "./components/NestedListApplyDiscardButtons.js";
|
|
13
13
|
import { cn as Ye } from "../../../lib/utils.js";
|
|
14
14
|
import { useImpactNovaI18n as Ze } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
15
|
-
const ne = (d,
|
|
16
|
-
if (!
|
|
17
|
-
const
|
|
18
|
-
return d.forEach((
|
|
19
|
-
const l =
|
|
20
|
-
(l || f && f.length > 0) &&
|
|
21
|
-
...
|
|
22
|
-
children: f ||
|
|
15
|
+
const ne = (d, r) => {
|
|
16
|
+
if (!r || typeof r != "string") return d;
|
|
17
|
+
const o = r.toLowerCase(), c = [];
|
|
18
|
+
return d.forEach((n) => {
|
|
19
|
+
const l = n.label.toLowerCase().includes(o), f = n.children ? ne(n.children, r) : void 0;
|
|
20
|
+
(l || f && f.length > 0) && c.push({
|
|
21
|
+
...n,
|
|
22
|
+
children: f || n.children
|
|
23
23
|
});
|
|
24
|
-
}),
|
|
25
|
-
}, le = (d) => d.map((
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
24
|
+
}), c;
|
|
25
|
+
}, le = (d) => d.map((r) => {
|
|
26
|
+
if (r.children && r.children.length > 0) {
|
|
27
|
+
const o = le(r.children), c = o.every((n) => n.checked);
|
|
28
28
|
return {
|
|
29
|
-
...
|
|
30
|
-
checked:
|
|
31
|
-
children:
|
|
29
|
+
...r,
|
|
30
|
+
checked: c,
|
|
31
|
+
children: o
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return
|
|
35
|
-
}), $e = (d,
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const f =
|
|
39
|
-
f &&
|
|
34
|
+
return r;
|
|
35
|
+
}), $e = (d, r) => {
|
|
36
|
+
const o = /* @__PURE__ */ new Set(), c = (n) => {
|
|
37
|
+
n.forEach((l) => {
|
|
38
|
+
const f = r ? r(l) : l.category;
|
|
39
|
+
f && o.add(f), l.children && c(l.children);
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
-
return
|
|
43
|
-
},
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
return d.forEach((
|
|
47
|
-
const l =
|
|
48
|
-
(f || m && m.length > 0) &&
|
|
49
|
-
...
|
|
42
|
+
return c(d), Array.from(o).sort();
|
|
43
|
+
}, oe = (d, r, o) => {
|
|
44
|
+
if (r.size === 0) return d;
|
|
45
|
+
const c = [];
|
|
46
|
+
return d.forEach((n) => {
|
|
47
|
+
const l = o ? o(n) : n.category, f = l && r.has(l), m = n.children ? oe(n.children, r, o) : void 0;
|
|
48
|
+
(f || m && m.length > 0) && c.push({
|
|
49
|
+
...n,
|
|
50
50
|
children: m
|
|
51
51
|
});
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
54
|
-
const
|
|
52
|
+
}), c;
|
|
53
|
+
}, ce = (d, r, o, c = 0) => {
|
|
54
|
+
const n = [];
|
|
55
55
|
return d.forEach((l) => {
|
|
56
|
-
|
|
57
|
-
...
|
|
56
|
+
n.push({ item: l, level: c }), !r[l.id] && l.children && l.children.length > 0 && l.id !== o && n.push(
|
|
57
|
+
...ce(l.children, r, o, c + 1)
|
|
58
58
|
);
|
|
59
|
-
}),
|
|
59
|
+
}), n;
|
|
60
60
|
}, ut = ({
|
|
61
61
|
items: d,
|
|
62
|
-
onChange:
|
|
63
|
-
onSubmit:
|
|
64
|
-
onCancel:
|
|
65
|
-
onItemToggle:
|
|
62
|
+
onChange: r,
|
|
63
|
+
onSubmit: o,
|
|
64
|
+
onCancel: c,
|
|
65
|
+
onItemToggle: n,
|
|
66
66
|
onDragEnd: l,
|
|
67
67
|
enableSearch: f = !0,
|
|
68
68
|
enableDragDrop: m = !0,
|
|
69
69
|
enableSelectAll: de = !0,
|
|
70
70
|
enableGroupBy: L = !1,
|
|
71
|
-
getCategory:
|
|
71
|
+
getCategory: S,
|
|
72
72
|
searchPlaceholder: ie,
|
|
73
73
|
className: ae = "",
|
|
74
74
|
groupLabel: he,
|
|
75
75
|
enableApplyDiscard: p = !1,
|
|
76
|
-
enableCollapse:
|
|
76
|
+
enableCollapse: j = !0,
|
|
77
77
|
enableGlobalCollapse: ue = !0,
|
|
78
78
|
submitButtonLabel: fe,
|
|
79
79
|
cancelButtonLabel: pe,
|
|
80
|
-
selectionMode:
|
|
80
|
+
selectionMode: C = V.CASCADE_DOWN
|
|
81
81
|
}) => {
|
|
82
|
-
const { t:
|
|
83
|
-
items:
|
|
82
|
+
const { t: D } = Ze(), me = ie ?? D("nestedList.searchPlaceholder"), Ne = fe ?? D("nestedList.apply"), Se = pe ?? D("nestedList.reset"), {
|
|
83
|
+
items: i,
|
|
84
84
|
setItems: I,
|
|
85
|
-
savedItems:
|
|
86
|
-
setSavedItems:
|
|
85
|
+
savedItems: T,
|
|
86
|
+
setSavedItems: F,
|
|
87
87
|
isUserChangeRef: P,
|
|
88
88
|
searchText: x,
|
|
89
|
-
setSearchText:
|
|
90
|
-
collapsedItems:
|
|
89
|
+
setSearchText: Ce,
|
|
90
|
+
collapsedItems: O,
|
|
91
91
|
setCollapsedItems: Ie,
|
|
92
|
-
isListCollapsed:
|
|
93
|
-
setIsListCollapsed:
|
|
94
|
-
activeId:
|
|
95
|
-
setActiveId:
|
|
96
|
-
setOverId:
|
|
97
|
-
selectedCategories:
|
|
98
|
-
setSelectedCategories:
|
|
92
|
+
isListCollapsed: b,
|
|
93
|
+
setIsListCollapsed: ge,
|
|
94
|
+
activeId: g,
|
|
95
|
+
setActiveId: y,
|
|
96
|
+
setOverId: U,
|
|
97
|
+
selectedCategories: z,
|
|
98
|
+
setSelectedCategories: ve,
|
|
99
99
|
itemsToBlink: q,
|
|
100
|
-
setItemsToBlink:
|
|
100
|
+
setItemsToBlink: _,
|
|
101
101
|
// Normalized state helpers (for optimized operations)
|
|
102
102
|
isNormalized: Le,
|
|
103
103
|
normalizedState: ke,
|
|
104
104
|
batchUpdateItems: Ee
|
|
105
|
-
} =
|
|
105
|
+
} = je({
|
|
106
106
|
initialItems: d,
|
|
107
107
|
enableApplyDiscard: p,
|
|
108
108
|
// Enable normalized state for large datasets (can be made configurable via props)
|
|
109
109
|
enableNormalizedState: d.length > 1e3
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
});
|
|
111
|
+
if (typeof window < "u") {
|
|
112
|
+
const e = i.map((t) => ({
|
|
113
|
+
id: t.id,
|
|
114
|
+
childIds: t.children?.map((s) => ({
|
|
115
|
+
id: s.id,
|
|
116
|
+
childIds: s.children?.map((a) => a.id)
|
|
117
|
+
}))
|
|
118
|
+
}));
|
|
119
|
+
console.log(
|
|
120
|
+
"[NL-internal] items state (post-render-time-block)",
|
|
121
|
+
JSON.stringify(e)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
const [B, K] = re.useState(0), [R, we] = re.useState(0), {
|
|
125
|
+
sensors: Ae,
|
|
126
|
+
handleDragEnd: De,
|
|
113
127
|
isValidDrop: Q
|
|
114
|
-
} =
|
|
115
|
-
items:
|
|
128
|
+
} = Je({
|
|
129
|
+
items: i,
|
|
116
130
|
onDragEnd: l
|
|
117
|
-
}),
|
|
118
|
-
() => L ? $e(
|
|
119
|
-
[
|
|
120
|
-
),
|
|
121
|
-
let e =
|
|
122
|
-
return L &&
|
|
123
|
-
}, [
|
|
124
|
-
() =>
|
|
125
|
-
[
|
|
126
|
-
), { allChecked: k, someChecked: xe } =
|
|
127
|
-
let e = !0,
|
|
128
|
-
const
|
|
129
|
-
for (const
|
|
130
|
-
if (
|
|
131
|
+
}), Te = w(
|
|
132
|
+
() => L ? $e(i, S) : [],
|
|
133
|
+
[i, L, S]
|
|
134
|
+
), N = w(() => {
|
|
135
|
+
let e = i;
|
|
136
|
+
return L && z.size > 0 && (e = oe(e, z, S)), x && (e = ne(e, x)), e;
|
|
137
|
+
}, [i, x, L, z, S]), Pe = w(
|
|
138
|
+
() => ce(N, O, g),
|
|
139
|
+
[N, O, g]
|
|
140
|
+
), { allChecked: k, someChecked: xe } = w(() => {
|
|
141
|
+
let e = !0, t = !1;
|
|
142
|
+
const s = (a) => {
|
|
143
|
+
for (const u of a)
|
|
144
|
+
if (u.children && u.children.length > 0 ? s(u.children) : u.checked ? t = !0 : e = !1, t && !e) return;
|
|
131
145
|
};
|
|
132
|
-
return
|
|
133
|
-
}, [
|
|
134
|
-
for (const
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
146
|
+
return s(N), { allChecked: e && t, someChecked: t };
|
|
147
|
+
}, [N]), Oe = xe && !k, H = (e, t) => {
|
|
148
|
+
for (const s of e) {
|
|
149
|
+
if (s.id === t) return s;
|
|
150
|
+
if (s.children) {
|
|
151
|
+
const a = H(s.children, t);
|
|
152
|
+
if (a) return a;
|
|
139
153
|
}
|
|
140
154
|
}
|
|
141
155
|
return null;
|
|
142
|
-
},
|
|
143
|
-
(e,
|
|
144
|
-
if (
|
|
156
|
+
}, be = A(
|
|
157
|
+
(e, t) => {
|
|
158
|
+
if (C === V.INDEPENDENT)
|
|
145
159
|
return e;
|
|
146
|
-
const
|
|
147
|
-
(E) =>
|
|
148
|
-
) : !1,
|
|
149
|
-
if (
|
|
150
|
-
return
|
|
151
|
-
if (
|
|
152
|
-
const E =
|
|
153
|
-
let
|
|
154
|
-
return
|
|
155
|
-
...
|
|
156
|
-
checked:
|
|
160
|
+
const s = (u, h) => u.id === h ? !0 : u.children ? u.children.some(
|
|
161
|
+
(E) => s(E, h)
|
|
162
|
+
) : !1, a = (u) => u.map((h) => {
|
|
163
|
+
if (h.id === t)
|
|
164
|
+
return h;
|
|
165
|
+
if (h.children && s(h, t)) {
|
|
166
|
+
const E = a(h.children);
|
|
167
|
+
let J;
|
|
168
|
+
return C === V.CASCADE_UP_DOWN ? J = E.some((W) => W.checked) : J = E.every((W) => W.checked), {
|
|
169
|
+
...h,
|
|
170
|
+
checked: J,
|
|
157
171
|
children: E
|
|
158
172
|
};
|
|
159
173
|
}
|
|
160
|
-
return
|
|
174
|
+
return h;
|
|
161
175
|
});
|
|
162
|
-
return
|
|
176
|
+
return a(e);
|
|
163
177
|
},
|
|
164
|
-
[
|
|
178
|
+
[C]
|
|
165
179
|
), X = (e) => {
|
|
166
|
-
const
|
|
167
|
-
return e.forEach((
|
|
168
|
-
|
|
169
|
-
}),
|
|
180
|
+
const t = [];
|
|
181
|
+
return e.forEach((s) => {
|
|
182
|
+
s.children && s.children.length > 0 && (t.push(s.id), t.push(...X(s.children)));
|
|
183
|
+
}), t;
|
|
170
184
|
}, {
|
|
171
185
|
handleToggle: Y,
|
|
172
186
|
handleToggleCollapse: Z,
|
|
173
|
-
handleCollapseAll:
|
|
174
|
-
handleToggleCategory:
|
|
175
|
-
} =
|
|
187
|
+
handleCollapseAll: ze,
|
|
188
|
+
handleToggleCategory: Be
|
|
189
|
+
} = Fe({
|
|
176
190
|
setItems: I,
|
|
177
191
|
findItemById: H,
|
|
178
|
-
updateParentsUpward:
|
|
192
|
+
updateParentsUpward: be,
|
|
179
193
|
onChange: (e) => {
|
|
180
|
-
K((
|
|
194
|
+
K((t) => t + 1), r(e);
|
|
181
195
|
},
|
|
182
|
-
onItemToggle:
|
|
183
|
-
getCategory:
|
|
196
|
+
onItemToggle: n,
|
|
197
|
+
getCategory: S,
|
|
184
198
|
setCollapsedItems: Ie,
|
|
185
|
-
setIsListCollapsed:
|
|
186
|
-
setSelectedCategories:
|
|
199
|
+
setIsListCollapsed: ge,
|
|
200
|
+
setSelectedCategories: ve,
|
|
187
201
|
isUserChangeRef: P,
|
|
188
|
-
selectionMode:
|
|
202
|
+
selectionMode: C,
|
|
189
203
|
// Pass normalized state helpers for optimized operations
|
|
190
204
|
isNormalized: Le,
|
|
191
205
|
normalizedState: ke,
|
|
@@ -195,158 +209,158 @@ const ne = (d, t) => {
|
|
|
195
209
|
findItemsNotSelected: M,
|
|
196
210
|
collectVisibleItemsForCallback: G,
|
|
197
211
|
updateVisibleItems: ee
|
|
198
|
-
} =
|
|
212
|
+
} = We({
|
|
199
213
|
findItemById: H,
|
|
200
|
-
getCategory:
|
|
201
|
-
}),
|
|
214
|
+
getCategory: S
|
|
215
|
+
}), Re = A(() => {
|
|
202
216
|
P.current = !0, I((e) => {
|
|
203
|
-
const
|
|
204
|
-
|
|
217
|
+
const t = $(N), s = M(
|
|
218
|
+
N,
|
|
205
219
|
e,
|
|
206
|
-
|
|
220
|
+
t
|
|
207
221
|
);
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
|
|
222
|
+
if (s.size > 0) {
|
|
223
|
+
const h = new Set(s);
|
|
224
|
+
_(h), setTimeout(() => _(/* @__PURE__ */ new Set()), 600);
|
|
211
225
|
}
|
|
212
|
-
const
|
|
226
|
+
const a = ee(
|
|
213
227
|
e,
|
|
214
|
-
|
|
228
|
+
t,
|
|
215
229
|
!k
|
|
216
|
-
),
|
|
217
|
-
if (
|
|
218
|
-
const
|
|
230
|
+
), u = C === V.INDEPENDENT ? a : le(a);
|
|
231
|
+
if (r(u), n) {
|
|
232
|
+
const h = G(
|
|
219
233
|
e,
|
|
220
|
-
|
|
234
|
+
t,
|
|
221
235
|
!k
|
|
222
236
|
);
|
|
223
|
-
|
|
237
|
+
n(h);
|
|
224
238
|
}
|
|
225
|
-
return
|
|
239
|
+
return u;
|
|
226
240
|
});
|
|
227
241
|
}, [
|
|
228
242
|
k,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
243
|
+
r,
|
|
244
|
+
n,
|
|
245
|
+
N,
|
|
232
246
|
$,
|
|
233
247
|
M,
|
|
234
248
|
G,
|
|
235
249
|
ee,
|
|
236
250
|
P,
|
|
237
251
|
I,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
]),
|
|
241
|
-
(e,
|
|
242
|
-
const
|
|
243
|
-
return /* @__PURE__ */
|
|
252
|
+
_,
|
|
253
|
+
C
|
|
254
|
+
]), Ve = A(
|
|
255
|
+
(e, t) => {
|
|
256
|
+
const s = g ? Q(g, e.id) : !1, a = q.has(e.id);
|
|
257
|
+
return /* @__PURE__ */ v(
|
|
244
258
|
He,
|
|
245
259
|
{
|
|
246
260
|
item: e,
|
|
247
|
-
level:
|
|
248
|
-
isCollapsed:
|
|
261
|
+
level: t,
|
|
262
|
+
isCollapsed: O[e.id] || !1,
|
|
249
263
|
onToggle: Y,
|
|
250
264
|
onToggleCollapse: Z,
|
|
251
|
-
isAnyDragging:
|
|
252
|
-
isValidDrop:
|
|
265
|
+
isAnyDragging: g !== null,
|
|
266
|
+
isValidDrop: s,
|
|
253
267
|
enableDragDrop: m,
|
|
254
|
-
enableCollapse:
|
|
255
|
-
shouldBlink:
|
|
268
|
+
enableCollapse: j,
|
|
269
|
+
shouldBlink: a
|
|
256
270
|
},
|
|
257
271
|
e.id
|
|
258
272
|
);
|
|
259
273
|
},
|
|
260
274
|
[
|
|
261
|
-
|
|
275
|
+
O,
|
|
262
276
|
Y,
|
|
263
277
|
Z,
|
|
264
|
-
|
|
278
|
+
g,
|
|
265
279
|
Q,
|
|
266
280
|
m,
|
|
267
281
|
q,
|
|
268
|
-
|
|
282
|
+
j
|
|
269
283
|
]
|
|
270
|
-
),
|
|
271
|
-
p && (
|
|
272
|
-
}, [p,
|
|
273
|
-
p && (I(
|
|
274
|
-
}, [p,
|
|
284
|
+
), ye = X(i).length > 0, te = w(() => p ? i.length > 1e3 ? B !== R : JSON.stringify(i) !== JSON.stringify(T) : !1, [p, i, T, B, R]), Ue = A(() => {
|
|
285
|
+
p && (F(i), we(B), o?.(i));
|
|
286
|
+
}, [p, i, o, F, B]), _e = A(() => {
|
|
287
|
+
p && (I(T), K(R), c?.());
|
|
288
|
+
}, [p, T, c, I, R]);
|
|
275
289
|
return /* @__PURE__ */ se(
|
|
276
290
|
"div",
|
|
277
291
|
{
|
|
278
292
|
className: Ye("flex flex-col", ae),
|
|
279
293
|
"data-component": "nested-list",
|
|
280
294
|
"data-has-changes": te ? "" : void 0,
|
|
281
|
-
"data-list-collapsed":
|
|
295
|
+
"data-list-collapsed": b ? "" : void 0,
|
|
282
296
|
children: [
|
|
283
297
|
/* @__PURE__ */ se("div", { className: "flex-shrink-0", children: [
|
|
284
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ v(
|
|
285
299
|
qe,
|
|
286
300
|
{
|
|
287
|
-
hasItemsWithChildren:
|
|
288
|
-
isListCollapsed:
|
|
289
|
-
onCollapseAll:
|
|
301
|
+
hasItemsWithChildren: ye,
|
|
302
|
+
isListCollapsed: b,
|
|
303
|
+
onCollapseAll: ze,
|
|
290
304
|
enableSearch: f,
|
|
291
305
|
enableSelectAll: de,
|
|
292
306
|
groupLabel: he,
|
|
293
307
|
allChecked: k,
|
|
294
|
-
isIndeterminate:
|
|
295
|
-
onSelectAll:
|
|
308
|
+
isIndeterminate: Oe,
|
|
309
|
+
onSelectAll: Re,
|
|
296
310
|
searchText: x,
|
|
297
311
|
onSearchChange: (e) => {
|
|
298
|
-
|
|
312
|
+
Ce(e.target.value);
|
|
299
313
|
},
|
|
300
314
|
searchPlaceholder: me,
|
|
301
|
-
selectAllLabel:
|
|
315
|
+
selectAllLabel: D("nestedList.selectAll"),
|
|
302
316
|
enableCollapse: ue
|
|
303
317
|
}
|
|
304
318
|
),
|
|
305
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ v(
|
|
306
320
|
Ke,
|
|
307
321
|
{
|
|
308
|
-
isListCollapsed:
|
|
322
|
+
isListCollapsed: b,
|
|
309
323
|
enableGroupBy: L,
|
|
310
|
-
categories:
|
|
311
|
-
selectedCategories:
|
|
312
|
-
onToggleCategory:
|
|
324
|
+
categories: Te,
|
|
325
|
+
selectedCategories: z,
|
|
326
|
+
onToggleCategory: Be
|
|
313
327
|
}
|
|
314
328
|
)
|
|
315
329
|
] }),
|
|
316
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ v("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ v(
|
|
317
331
|
Qe,
|
|
318
332
|
{
|
|
319
|
-
isListCollapsed:
|
|
333
|
+
isListCollapsed: b,
|
|
320
334
|
enableDragDrop: m,
|
|
321
|
-
sensors:
|
|
335
|
+
sensors: Ae,
|
|
322
336
|
items: Pe,
|
|
323
|
-
renderItem:
|
|
337
|
+
renderItem: Ve,
|
|
324
338
|
onDragStart: (e) => {
|
|
325
|
-
|
|
339
|
+
y(e.active.id);
|
|
326
340
|
},
|
|
327
341
|
onDragOver: (e) => {
|
|
328
|
-
|
|
342
|
+
U(e.over?.id);
|
|
329
343
|
},
|
|
330
344
|
onDragEnd: (e) => {
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
I(
|
|
345
|
+
y(null), U(null), P.current = !0, De(e, (t) => {
|
|
346
|
+
const s = t(i);
|
|
347
|
+
I(s), r(s);
|
|
334
348
|
});
|
|
335
349
|
},
|
|
336
350
|
onDragCancel: () => {
|
|
337
|
-
|
|
351
|
+
y(null), U(null);
|
|
338
352
|
}
|
|
339
353
|
}
|
|
340
354
|
) }),
|
|
341
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ v(
|
|
342
356
|
Xe,
|
|
343
357
|
{
|
|
344
358
|
enableApplyDiscard: p,
|
|
345
359
|
hasChanges: te,
|
|
346
|
-
onDiscard:
|
|
347
|
-
onApply:
|
|
348
|
-
cancelButtonLabel:
|
|
349
|
-
submitButtonLabel:
|
|
360
|
+
onDiscard: _e,
|
|
361
|
+
onApply: Ue,
|
|
362
|
+
cancelButtonLabel: Se,
|
|
363
|
+
submitButtonLabel: Ne
|
|
350
364
|
}
|
|
351
365
|
)
|
|
352
366
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-nova",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.22",
|
|
4
4
|
"description": "Enterprise-grade React design system built with React 19, Vite, Tailwind CSS, and Radix UI. Built-in internationalization (i18n) and comprehensive UI component library for scalable, accessible, and performant applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|