impact-nova 1.7.29 → 1.7.31
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.
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +69 -67
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +2 -0
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +107 -71
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +277 -213
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.d.ts +11 -1
- package/dist/components/ui/ag-grid-react/headers/utils/date-utils.js +34 -20
- package/dist/components/ui/ag-grid-react/index.js +16 -15
- package/dist/components/ui/data-table/data-table-column-list.js +86 -82
- package/dist/components/ui/nested-list/components/SortableItem.d.ts +1 -0
- package/dist/components/ui/nested-list/components/SortableItem.js +37 -36
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +3 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +186 -172
- package/dist/components/ui/nested-list/hooks/useNestedListState.d.ts +2 -1
- package/dist/components/ui/nested-list/hooks/useNestedListState.js +67 -66
- package/dist/components/ui/nested-list/nested-list.js +249 -237
- package/dist/components/ui/types/ag-grid.types.d.ts +2 -0
- package/dist/components/ui/types/nested-list.types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,239 +1,253 @@
|
|
|
1
1
|
import { useCallback as S } from "react";
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { arrayMove as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
2
|
+
import { useSensors as Z, useSensor as V, MouseSensor as $, TouchSensor as E, closestCenter as p } 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(h) {
|
|
6
|
+
if (h.startsWith(W)) {
|
|
7
|
+
const u = h.slice(W.length);
|
|
8
|
+
if (y.has(u)) return u;
|
|
9
9
|
}
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
(
|
|
12
|
+
const nn = (h) => {
|
|
13
|
+
const u = p(h), d = u.filter(
|
|
14
|
+
(x) => !y.has(x.id)
|
|
15
15
|
);
|
|
16
|
-
return
|
|
16
|
+
return d.length > 0 ? d : u;
|
|
17
17
|
};
|
|
18
|
-
function F(
|
|
19
|
-
for (const
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
18
|
+
function F(h, u) {
|
|
19
|
+
for (const d of h) {
|
|
20
|
+
if (d.id === u) return d;
|
|
21
|
+
if (d.children) {
|
|
22
|
+
const x = F(d.children, u);
|
|
23
|
+
if (x) return x;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
for (const
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
27
|
+
function j(h, u) {
|
|
28
|
+
for (const d of h) {
|
|
29
|
+
if (d.id === u) return null;
|
|
30
|
+
if (d.children && F(d.children, u))
|
|
31
|
+
return d.id;
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
items:
|
|
37
|
-
onDragEnd:
|
|
35
|
+
const rn = ({
|
|
36
|
+
items: h,
|
|
37
|
+
onDragEnd: u,
|
|
38
|
+
collapsedItems: d = {},
|
|
39
|
+
canDrag: x
|
|
38
40
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
),
|
|
43
|
-
(
|
|
44
|
-
for (const
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
41
|
+
const q = Z(
|
|
42
|
+
V($),
|
|
43
|
+
V(E)
|
|
44
|
+
), C = S(
|
|
45
|
+
(t, e, o = 0) => {
|
|
46
|
+
for (const r of t) {
|
|
47
|
+
if (r.id === e) return o;
|
|
48
|
+
if (r.children) {
|
|
49
|
+
const n = C(r.children, e, o + 1);
|
|
50
|
+
if (n !== null) return n;
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
return null;
|
|
52
54
|
},
|
|
53
55
|
[]
|
|
54
|
-
),
|
|
55
|
-
(
|
|
56
|
-
for (const
|
|
57
|
-
if (
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
56
|
+
), T = S(
|
|
57
|
+
(t, e, o = null) => {
|
|
58
|
+
for (const r of t) {
|
|
59
|
+
if (r.id === e) return o;
|
|
60
|
+
if (r.children) {
|
|
61
|
+
const n = T(r.children, e, r.id);
|
|
62
|
+
if (n !== null) return n;
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
return null;
|
|
64
66
|
},
|
|
65
67
|
[]
|
|
66
|
-
),
|
|
67
|
-
(
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
(
|
|
71
|
-
),
|
|
72
|
-
(
|
|
68
|
+
), A = S(
|
|
69
|
+
(t, e, o) => t.map((r) => {
|
|
70
|
+
if (r.children && r.children.length > 0) {
|
|
71
|
+
const n = r.children.findIndex(
|
|
72
|
+
(i) => i.id === e
|
|
73
|
+
), l = r.children.findIndex(
|
|
74
|
+
(i) => i.id === o
|
|
73
75
|
);
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
+
if (n !== -1 && l !== -1) {
|
|
77
|
+
const i = w(r.children, n, l);
|
|
76
78
|
return {
|
|
77
|
-
...
|
|
78
|
-
children:
|
|
79
|
+
...r,
|
|
80
|
+
children: i
|
|
79
81
|
};
|
|
80
82
|
}
|
|
81
83
|
return {
|
|
82
|
-
...
|
|
83
|
-
children:
|
|
84
|
+
...r,
|
|
85
|
+
children: A(r.children, e, o)
|
|
84
86
|
};
|
|
85
87
|
}
|
|
86
|
-
return
|
|
88
|
+
return r;
|
|
87
89
|
}),
|
|
88
90
|
[]
|
|
89
|
-
),
|
|
90
|
-
(
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
93
|
-
const
|
|
94
|
-
(
|
|
95
|
-
),
|
|
96
|
-
(
|
|
91
|
+
), B = S(
|
|
92
|
+
(t, e, o) => {
|
|
93
|
+
const r = T(t, o);
|
|
94
|
+
if (!r) return null;
|
|
95
|
+
const n = t.findIndex(
|
|
96
|
+
(i) => i.id === r
|
|
97
|
+
), l = t.findIndex(
|
|
98
|
+
(i) => i.id === e
|
|
97
99
|
);
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
if (n !== -1 && l !== -1) {
|
|
101
|
+
const i = w(
|
|
102
|
+
t,
|
|
103
|
+
l,
|
|
104
|
+
n
|
|
103
105
|
);
|
|
104
|
-
return
|
|
106
|
+
return u?.(e, r), i;
|
|
105
107
|
}
|
|
106
108
|
return null;
|
|
107
109
|
},
|
|
108
|
-
[
|
|
109
|
-
),
|
|
110
|
-
(
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
return
|
|
110
|
+
[T, u]
|
|
111
|
+
), k = S(
|
|
112
|
+
(t, e, o) => {
|
|
113
|
+
const r = t.findIndex((l) => l.id === e), n = t.findIndex((l) => l.id === o);
|
|
114
|
+
if (r !== -1 && n !== -1) {
|
|
115
|
+
const l = w(t, r, n);
|
|
116
|
+
return u?.(e, o), l;
|
|
115
117
|
}
|
|
116
118
|
return null;
|
|
117
119
|
},
|
|
118
|
-
[
|
|
119
|
-
),
|
|
120
|
-
(
|
|
121
|
-
const
|
|
122
|
-
return
|
|
120
|
+
[u]
|
|
121
|
+
), z = S(
|
|
122
|
+
(t, e, o) => {
|
|
123
|
+
const r = A(t, e, o);
|
|
124
|
+
return u?.(e, o), r;
|
|
123
125
|
},
|
|
124
|
-
[
|
|
125
|
-
),
|
|
126
|
-
(
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
129
|
-
const
|
|
130
|
-
(
|
|
131
|
-
).filter((
|
|
132
|
-
for (let
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
...
|
|
137
|
-
children: [
|
|
138
|
-
},
|
|
139
|
-
return
|
|
126
|
+
[A, u]
|
|
127
|
+
), G = S(
|
|
128
|
+
(t, e, o, r = !1) => {
|
|
129
|
+
const n = F(t, e);
|
|
130
|
+
if (!n) return null;
|
|
131
|
+
const l = (s) => s.filter((c) => c.id !== e).map(
|
|
132
|
+
(c) => c.children ? { ...c, children: l(c.children) } : c
|
|
133
|
+
).filter((c) => !(c.children && c.children.length === 0 && c.category === "group")), i = F(t, o), f = !n.children || n.children.length === 0, R = i?.children && i.children.length > 0, M = d[o] === !0, _ = f && R && !M, g = (s) => {
|
|
134
|
+
for (let c = 0; c < s.length; c++) {
|
|
135
|
+
if (s[c].id === o)
|
|
136
|
+
if (_) {
|
|
137
|
+
const L = {
|
|
138
|
+
...s[c],
|
|
139
|
+
children: [n, ...s[c].children || []]
|
|
140
|
+
}, a = [...s];
|
|
141
|
+
return a[c] = L, { nodes: a, inserted: !0 };
|
|
140
142
|
} else {
|
|
141
|
-
const
|
|
142
|
-
return
|
|
143
|
+
const L = [...s], a = r ? c + 1 : c;
|
|
144
|
+
return L.splice(a, 0, n), { nodes: L, inserted: !0 };
|
|
143
145
|
}
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
return
|
|
146
|
+
if (s[c].children) {
|
|
147
|
+
const L = g(s[c].children);
|
|
148
|
+
if (L.inserted) {
|
|
149
|
+
const a = [...s];
|
|
150
|
+
return a[c] = { ...s[c], children: L.nodes }, { nodes: a, inserted: !0 };
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
|
-
return { nodes:
|
|
153
|
-
},
|
|
154
|
-
return Y ? (
|
|
154
|
+
return { nodes: s, inserted: !1 };
|
|
155
|
+
}, P = l(t), { nodes: O, inserted: Y } = g(P);
|
|
156
|
+
return Y ? (u?.(e, o), O) : null;
|
|
155
157
|
},
|
|
156
|
-
[
|
|
157
|
-
),
|
|
158
|
-
(
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
161
|
-
const
|
|
162
|
-
(
|
|
163
|
-
),
|
|
164
|
-
let
|
|
165
|
-
return
|
|
158
|
+
[u, d]
|
|
159
|
+
), N = S(
|
|
160
|
+
(t, e, o) => {
|
|
161
|
+
const r = F(t, e);
|
|
162
|
+
if (!r) return t;
|
|
163
|
+
const n = (i) => i.filter((f) => f.id !== e).map(
|
|
164
|
+
(f) => f.children ? { ...f, children: n(f.children) } : f
|
|
165
|
+
), l = t.map((i) => {
|
|
166
|
+
let f = i.children ? n(i.children) : [];
|
|
167
|
+
return i.id === o && (f = [r, ...f]), { ...i, children: f };
|
|
166
168
|
});
|
|
167
|
-
return
|
|
169
|
+
return u?.(e, o), l;
|
|
168
170
|
},
|
|
169
|
-
[
|
|
170
|
-
),
|
|
171
|
-
(
|
|
172
|
-
const { active: o, over:
|
|
173
|
-
!
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (
|
|
187
|
-
return
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
171
|
+
[u]
|
|
172
|
+
), J = S(
|
|
173
|
+
(t, e) => {
|
|
174
|
+
const { active: o, over: r } = t;
|
|
175
|
+
!r || o.id === r.id || e((n) => {
|
|
176
|
+
const l = o.id, i = r.id;
|
|
177
|
+
if (x) {
|
|
178
|
+
const P = F(n, l), O = C(n, l);
|
|
179
|
+
if (P && O !== null && !x(P, O))
|
|
180
|
+
return n;
|
|
181
|
+
}
|
|
182
|
+
const f = X(i);
|
|
183
|
+
if (f)
|
|
184
|
+
return N(n, l, f);
|
|
185
|
+
const R = C(n, l), M = C(n, i), _ = T(n, l), g = T(n, i);
|
|
186
|
+
if (y.has(i) && R !== null && R > 0)
|
|
187
|
+
return N(n, l, i);
|
|
188
|
+
if (R === 0 && M !== null && M > 0)
|
|
189
|
+
return B(
|
|
190
|
+
n,
|
|
191
|
+
l,
|
|
192
|
+
i
|
|
193
|
+
) || n;
|
|
194
|
+
if (R === null || M === null)
|
|
195
|
+
return n;
|
|
196
|
+
if (R > 0 && M > 0 && _ !== g) {
|
|
197
|
+
const P = j(n, l), O = j(n, i);
|
|
198
|
+
if (P && O && P !== O) {
|
|
199
|
+
const a = o.rect.current.translated, b = r.rect;
|
|
200
|
+
let H = !1;
|
|
201
|
+
if (a && b) {
|
|
202
|
+
const Q = a.top + a.height / 2, U = b.top + b.height / 2;
|
|
203
|
+
H = Q > U;
|
|
196
204
|
}
|
|
197
|
-
return
|
|
205
|
+
return G(n, l, i, H) || n;
|
|
198
206
|
}
|
|
199
|
-
const
|
|
200
|
-
let
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
|
|
207
|
+
const Y = o.rect.current.translated, s = r.rect;
|
|
208
|
+
let c = !1;
|
|
209
|
+
if (Y && s) {
|
|
210
|
+
const a = Y.top + Y.height / 2, b = s.top + s.height / 2;
|
|
211
|
+
c = a > b;
|
|
204
212
|
}
|
|
205
|
-
return
|
|
213
|
+
return G(n, l, i, c) || n;
|
|
206
214
|
}
|
|
207
|
-
return
|
|
215
|
+
return R === 0 ? k(n, l, i) || n : z(n, l, i);
|
|
208
216
|
});
|
|
209
217
|
},
|
|
210
218
|
[
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
w,
|
|
219
|
+
C,
|
|
220
|
+
T,
|
|
214
221
|
B,
|
|
215
222
|
k,
|
|
216
|
-
|
|
217
|
-
G
|
|
223
|
+
z,
|
|
224
|
+
G,
|
|
225
|
+
N,
|
|
226
|
+
x
|
|
218
227
|
]
|
|
219
|
-
),
|
|
220
|
-
(
|
|
221
|
-
if (!
|
|
228
|
+
), K = S(
|
|
229
|
+
(t, e) => {
|
|
230
|
+
if (!t || !e || t === e)
|
|
222
231
|
return !1;
|
|
223
|
-
|
|
224
|
-
|
|
232
|
+
if (x) {
|
|
233
|
+
const n = F(h, t), l = C(h, t);
|
|
234
|
+
if (n && l !== null && !x(n, l))
|
|
235
|
+
return !1;
|
|
236
|
+
}
|
|
237
|
+
const o = t ? C(h, t) : null, r = e ? C(h, e) : null;
|
|
238
|
+
return X(e) !== null || y.has(e) ? !0 : o === null || r === null ? !1 : o === 0 && r > 0 || o === r || o > 0 && r > 0;
|
|
225
239
|
},
|
|
226
|
-
[
|
|
240
|
+
[h, C, x]
|
|
227
241
|
);
|
|
228
242
|
return {
|
|
229
|
-
sensors:
|
|
230
|
-
handleDragEnd:
|
|
231
|
-
isValidDrop:
|
|
232
|
-
findItemLevel:
|
|
233
|
-
findParentId:
|
|
243
|
+
sensors: q,
|
|
244
|
+
handleDragEnd: J,
|
|
245
|
+
isValidDrop: K,
|
|
246
|
+
findItemLevel: C,
|
|
247
|
+
findParentId: T
|
|
234
248
|
};
|
|
235
249
|
};
|
|
236
250
|
export {
|
|
237
|
-
|
|
238
|
-
|
|
251
|
+
nn as customCollisionDetection,
|
|
252
|
+
rn as useNestedListDragDrop
|
|
239
253
|
};
|
|
@@ -9,6 +9,7 @@ interface UseNestedListStateProps {
|
|
|
9
9
|
initialItems: NestedListItem[];
|
|
10
10
|
enableApplyDiscard: boolean;
|
|
11
11
|
enableNormalizedState?: boolean;
|
|
12
|
+
initialCollapsedItems?: Record<string, boolean>;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Build normalized state from nested tree structure
|
|
@@ -35,7 +36,7 @@ declare function getAncestorIds(normalized: NormalizedItems, itemId: string): st
|
|
|
35
36
|
* Get all descendant IDs for an item (for cascade operations)
|
|
36
37
|
*/
|
|
37
38
|
declare function getDescendantIds(normalized: NormalizedItems, itemId: string): string[];
|
|
38
|
-
export declare const useNestedListState: ({ initialItems, enableApplyDiscard, enableNormalizedState, }: UseNestedListStateProps) => {
|
|
39
|
+
export declare const useNestedListState: ({ initialItems, enableApplyDiscard, enableNormalizedState, initialCollapsedItems, }: UseNestedListStateProps) => {
|
|
39
40
|
findItemByIdFast: (id: string) => NestedListItem | null;
|
|
40
41
|
updateItemFast: (itemId: string, updates: Partial<NestedListItem>) => void;
|
|
41
42
|
getAncestors: (itemId: string) => string[];
|