impact-nova 1.7.21 → 1.7.23
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.js +143 -112
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +93 -95
- package/dist/components/ui/nested-list/nested-list.js +204 -190
- package/dist/i18n/defaultMessages.d.ts +1 -0
- package/dist/i18n/defaultMessages.js +6 -5
- package/dist/i18n/locales/de.js +2 -1
- package/dist/i18n/locales/es.js +2 -1
- package/dist/i18n/locales/hi.js +2 -1
- package/dist/i18n/locales/kn.js +2 -1
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
};
|