impact-nova 1.7.25 → 1.7.26
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/cell-renderers/editors/input-cell-editor.js +45 -36
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +0 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +92 -75
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +52 -41
- package/dist/components/ui/ag-grid-react/hooks/useStopEditingOnClickOutside.d.ts +5 -0
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/calendar.js +3 -2
- package/dist/components/ui/data-table/data-table-column-list.js +119 -108
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -0
- package/dist/components/ui/nested-list/components/NestedListContent.js +134 -63
- package/dist/components/ui/nested-list/components/SortableItem.js +65 -82
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +176 -153
- package/dist/components/ui/nested-list/nested-list.js +190 -203
- package/dist/components/ui/select/components/Submenu.js +7 -5
- package/dist/components/ui/select/select.js +390 -369
- package/dist/i18n/defaultMessages.d.ts +3 -0
- package/dist/i18n/defaultMessages.js +14 -11
- package/dist/i18n/locales/de.js +4 -1
- package/dist/i18n/locales/es.js +4 -1
- package/dist/i18n/locales/hi.js +4 -1
- package/dist/i18n/locales/kn.js +4 -1
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,95 +1,84 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useSortable as
|
|
4
|
-
import { useDroppable as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const t = !e.children || e.children.length === 0, {
|
|
2
|
+
import C, { useMemo as I } from "react";
|
|
3
|
+
import { useSortable as D } from "@dnd-kit/sortable";
|
|
4
|
+
import { useDroppable as L } from "@dnd-kit/core";
|
|
5
|
+
import { Checkbox as R } from "../../checkbox.js";
|
|
6
|
+
import { ChevronRight as S, Drag as w } from "../../../../icons/index.js";
|
|
7
|
+
import { cn as d } from "../../../../lib/utils.js";
|
|
8
|
+
import { useImpactNovaI18n as m } from "../../../../i18n/ImpactNovaI18nContext.js";
|
|
9
|
+
const z = (e, o) => {
|
|
10
|
+
const t = "flex items-center gap-1 py-[3px] px-2 rounded transition-colors duration-150";
|
|
11
|
+
return e ? d(t, "opacity-40 bg-canvas-muted") : o ? d(t, "bg-feedback-error-surface border border-destructive animate-pulse") : d(t, "hover:bg-canvas-muted");
|
|
12
|
+
}, H = ({ item: e, isAnyDragging: o }) => {
|
|
13
|
+
const { t } = m(), n = !e.children || e.children.length === 0, {
|
|
15
14
|
setNodeRef: c,
|
|
16
|
-
isOver:
|
|
17
|
-
} =
|
|
15
|
+
isOver: s
|
|
16
|
+
} = L({
|
|
18
17
|
id: `droppable-${e.id}`,
|
|
19
18
|
data: { sectionId: e.id },
|
|
20
|
-
disabled: !
|
|
19
|
+
disabled: !n
|
|
21
20
|
});
|
|
22
|
-
return /* @__PURE__ */ p("div", { ref:
|
|
21
|
+
return /* @__PURE__ */ p("div", { ref: n ? c : void 0, children: [
|
|
23
22
|
/* @__PURE__ */ p(
|
|
24
23
|
"div",
|
|
25
24
|
{
|
|
26
|
-
className:
|
|
25
|
+
className: d(
|
|
27
26
|
"flex items-center px-2 py-0 text-xs font-[500] leading-4 text-navigation-muted select-none",
|
|
28
27
|
e.id === "root-scrollable" ? "mt-2 pt-2 pb-1 border-t border-solid border-stroke-subtle" : "mt-1 pb-1",
|
|
29
|
-
|
|
28
|
+
s && o && n && "bg-canvas-tint rounded"
|
|
30
29
|
),
|
|
31
30
|
children: [
|
|
32
31
|
e.label,
|
|
33
|
-
|
|
32
|
+
s && o && n && /* @__PURE__ */ r("span", { className: "ml-2 text-brand text-[11px]", children: t("nestedList.dropHere") })
|
|
34
33
|
]
|
|
35
34
|
}
|
|
36
35
|
),
|
|
37
|
-
|
|
36
|
+
n && /* @__PURE__ */ r(
|
|
38
37
|
"div",
|
|
39
38
|
{
|
|
40
|
-
className:
|
|
39
|
+
className: d(
|
|
41
40
|
"mx-2 my-1 rounded border-2 border-dashed min-h-[36px] flex items-center justify-center text-[11px] transition-colors",
|
|
42
|
-
|
|
41
|
+
s && o ? "border-brand bg-canvas-tint text-brand" : "border-stroke-hairline text-content-empty"
|
|
43
42
|
),
|
|
44
|
-
children:
|
|
43
|
+
children: t(s && o ? "nestedList.releaseToDrop" : "nestedList.dragHere")
|
|
45
44
|
}
|
|
46
45
|
)
|
|
47
46
|
] });
|
|
48
|
-
},
|
|
47
|
+
}, P = ({
|
|
49
48
|
item: e,
|
|
50
49
|
level: o,
|
|
51
50
|
isCollapsed: t,
|
|
52
|
-
onToggle:
|
|
53
|
-
onToggleCollapse:
|
|
54
|
-
isAnyDragging:
|
|
55
|
-
isOver:
|
|
56
|
-
isValidDrop:
|
|
57
|
-
enableDragDrop:
|
|
58
|
-
enableCollapse:
|
|
59
|
-
shouldBlink:
|
|
51
|
+
onToggle: n,
|
|
52
|
+
onToggleCollapse: c,
|
|
53
|
+
isAnyDragging: s = !1,
|
|
54
|
+
isOver: _ = !1,
|
|
55
|
+
isValidDrop: $ = !1,
|
|
56
|
+
enableDragDrop: f = !0,
|
|
57
|
+
enableCollapse: b = !0,
|
|
58
|
+
shouldBlink: x = !1
|
|
60
59
|
}) => {
|
|
61
|
-
const { t:
|
|
62
|
-
attributes:
|
|
63
|
-
listeners:
|
|
64
|
-
setNodeRef:
|
|
65
|
-
|
|
66
|
-
transition
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
const { t: h } = m(), u = e.category === "structure", i = e.children && e.children.length > 0, v = I(() => !e.children || e.children.length === 0 || e.children.every((l) => l.checked) ? !1 : e.children.some((l) => l.checked), [e.children]), {
|
|
61
|
+
attributes: g,
|
|
62
|
+
listeners: k,
|
|
63
|
+
setNodeRef: N,
|
|
64
|
+
isDragging: y,
|
|
65
|
+
// transform and transition intentionally not applied — we use a custom
|
|
66
|
+
// FloatingClone and manual insertion line instead of dnd-kit's built-in animations.
|
|
67
|
+
transform: j,
|
|
68
|
+
transition: E
|
|
69
|
+
} = D({
|
|
70
70
|
id: e.id,
|
|
71
|
-
animateLayoutChanges: T,
|
|
72
71
|
data: {
|
|
73
72
|
level: o,
|
|
74
73
|
hasChildren: i,
|
|
75
74
|
isExpanded: !t
|
|
76
75
|
},
|
|
77
|
-
disabled:
|
|
76
|
+
disabled: u || e.disabled
|
|
78
77
|
});
|
|
79
|
-
|
|
80
|
-
return /* @__PURE__ */ r(q, { item: e, isAnyDragging: n });
|
|
81
|
-
const R = h !== void 0 ? h : w, D = {
|
|
82
|
-
transform: j.Transform.toString(I),
|
|
83
|
-
transition: S,
|
|
84
|
-
opacity: l ? 0.5 : 1,
|
|
85
|
-
zIndex: l ? 100 : "auto",
|
|
86
|
-
height: "auto"
|
|
87
|
-
};
|
|
88
|
-
return /* @__PURE__ */ r(
|
|
78
|
+
return u ? /* @__PURE__ */ r(H, { item: e, isAnyDragging: s }) : /* @__PURE__ */ r(
|
|
89
79
|
"div",
|
|
90
80
|
{
|
|
91
|
-
ref:
|
|
92
|
-
style: D,
|
|
81
|
+
ref: N,
|
|
93
82
|
className: "relative",
|
|
94
83
|
"data-item-id": e.id,
|
|
95
84
|
"data-level": o,
|
|
@@ -99,51 +88,45 @@ const _ = (e, o, t, c, a) => {
|
|
|
99
88
|
children: /* @__PURE__ */ p(
|
|
100
89
|
"div",
|
|
101
90
|
{
|
|
102
|
-
className:
|
|
103
|
-
l,
|
|
104
|
-
R,
|
|
105
|
-
n,
|
|
106
|
-
x,
|
|
107
|
-
g
|
|
108
|
-
),
|
|
91
|
+
className: z(y, x),
|
|
109
92
|
style: {
|
|
110
93
|
paddingLeft: `${8 + o * 20}px`
|
|
111
94
|
},
|
|
112
95
|
children: [
|
|
113
|
-
|
|
96
|
+
b && i && /* @__PURE__ */ r(
|
|
114
97
|
"button",
|
|
115
98
|
{
|
|
116
99
|
type: "button",
|
|
117
|
-
onClick: (
|
|
118
|
-
|
|
100
|
+
onClick: (a) => {
|
|
101
|
+
a.stopPropagation(), c(e.id);
|
|
119
102
|
},
|
|
120
|
-
onMouseDown: (
|
|
103
|
+
onMouseDown: (a) => a.stopPropagation(),
|
|
121
104
|
className: "p-1 hover:bg-muted rounded-full transition-colors flex items-center text-content-icon hover:text-brand",
|
|
122
|
-
"aria-label":
|
|
105
|
+
"aria-label": h(t ? "nestedList.expand" : "nestedList.collapse"),
|
|
123
106
|
children: /* @__PURE__ */ r(
|
|
124
|
-
|
|
107
|
+
S,
|
|
125
108
|
{
|
|
126
109
|
size: "16px",
|
|
127
|
-
className:
|
|
110
|
+
className: d("transition-transform", !t && "rotate-90")
|
|
128
111
|
}
|
|
129
112
|
)
|
|
130
113
|
}
|
|
131
114
|
),
|
|
132
|
-
(!
|
|
115
|
+
(!b || !i) && /* @__PURE__ */ r("div", { className: "w-6" }),
|
|
133
116
|
/* @__PURE__ */ r(
|
|
134
|
-
|
|
117
|
+
R,
|
|
135
118
|
{
|
|
136
119
|
id: `checkbox-${e.id}`,
|
|
137
|
-
checked:
|
|
138
|
-
onCheckedChange: () =>
|
|
120
|
+
checked: v ? "indeterminate" : e.checked,
|
|
121
|
+
onCheckedChange: () => n(e.id),
|
|
139
122
|
disabled: e.disabled
|
|
140
123
|
}
|
|
141
124
|
),
|
|
142
|
-
|
|
125
|
+
f && /* @__PURE__ */ r(
|
|
143
126
|
"div",
|
|
144
127
|
{
|
|
145
|
-
...
|
|
146
|
-
...
|
|
128
|
+
...g,
|
|
129
|
+
...k,
|
|
147
130
|
className: "cursor-grab active:cursor-grabbing p-0 hover:bg-muted rounded flex items-center",
|
|
148
131
|
style: {
|
|
149
132
|
pointerEvents: "auto",
|
|
@@ -151,10 +134,10 @@ const _ = (e, o, t, c, a) => {
|
|
|
151
134
|
zIndex: 30,
|
|
152
135
|
touchAction: "none"
|
|
153
136
|
},
|
|
154
|
-
onPointerDown: (
|
|
155
|
-
|
|
137
|
+
onPointerDown: (a) => {
|
|
138
|
+
a.stopPropagation();
|
|
156
139
|
},
|
|
157
|
-
children: /* @__PURE__ */ r(
|
|
140
|
+
children: /* @__PURE__ */ r(w, { size: "14px", className: "text-content-icon" })
|
|
158
141
|
}
|
|
159
142
|
),
|
|
160
143
|
/* @__PURE__ */ r(
|
|
@@ -170,7 +153,7 @@ const _ = (e, o, t, c, a) => {
|
|
|
170
153
|
)
|
|
171
154
|
}
|
|
172
155
|
);
|
|
173
|
-
},
|
|
156
|
+
}, K = C.memo(P);
|
|
174
157
|
export {
|
|
175
|
-
|
|
158
|
+
K as SortableItem
|
|
176
159
|
};
|
|
@@ -1,216 +1,239 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { arrayMove as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
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;
|
|
9
9
|
}
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
(
|
|
12
|
+
const m = (a) => {
|
|
13
|
+
const s = Z(a), f = s.filter(
|
|
14
|
+
(h) => !b.has(h.id)
|
|
15
15
|
);
|
|
16
|
-
return
|
|
16
|
+
return f.length > 0 ? f : s;
|
|
17
17
|
};
|
|
18
|
-
function F(
|
|
19
|
-
for (const
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
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;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const I = ({
|
|
36
|
+
items: a,
|
|
37
|
+
onDragEnd: s
|
|
30
38
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
),
|
|
35
|
-
(
|
|
36
|
-
for (const n of
|
|
37
|
-
if (n.id ===
|
|
39
|
+
const f = K(
|
|
40
|
+
H(Q),
|
|
41
|
+
H(U)
|
|
42
|
+
), h = S(
|
|
43
|
+
(i, e, o = 0) => {
|
|
44
|
+
for (const n of i) {
|
|
45
|
+
if (n.id === e) return o;
|
|
38
46
|
if (n.children) {
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
47
|
+
const r = h(n.children, e, o + 1);
|
|
48
|
+
if (r !== null) return r;
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
51
|
return null;
|
|
44
52
|
},
|
|
45
53
|
[]
|
|
46
|
-
),
|
|
47
|
-
(
|
|
48
|
-
for (const n of
|
|
49
|
-
if (n.id ===
|
|
54
|
+
), R = S(
|
|
55
|
+
(i, e, o = null) => {
|
|
56
|
+
for (const n of i) {
|
|
57
|
+
if (n.id === e) return o;
|
|
50
58
|
if (n.children) {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
59
|
+
const r = R(n.children, e, n.id);
|
|
60
|
+
if (r !== null) return r;
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
return null;
|
|
56
64
|
},
|
|
57
65
|
[]
|
|
58
|
-
),
|
|
59
|
-
(
|
|
66
|
+
), y = S(
|
|
67
|
+
(i, e, o) => i.map((n) => {
|
|
60
68
|
if (n.children && n.children.length > 0) {
|
|
61
|
-
const
|
|
62
|
-
(
|
|
63
|
-
),
|
|
64
|
-
(
|
|
69
|
+
const r = n.children.findIndex(
|
|
70
|
+
(t) => t.id === e
|
|
71
|
+
), c = n.children.findIndex(
|
|
72
|
+
(t) => t.id === o
|
|
65
73
|
);
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
74
|
+
if (r !== -1 && c !== -1) {
|
|
75
|
+
const t = _(n.children, r, c);
|
|
68
76
|
return {
|
|
69
77
|
...n,
|
|
70
|
-
children:
|
|
78
|
+
children: t
|
|
71
79
|
};
|
|
72
80
|
}
|
|
73
81
|
return {
|
|
74
82
|
...n,
|
|
75
|
-
children:
|
|
83
|
+
children: y(n.children, e, o)
|
|
76
84
|
};
|
|
77
85
|
}
|
|
78
86
|
return n;
|
|
79
87
|
}),
|
|
80
88
|
[]
|
|
81
|
-
),
|
|
82
|
-
(
|
|
83
|
-
const n =
|
|
89
|
+
), w = S(
|
|
90
|
+
(i, e, o) => {
|
|
91
|
+
const n = R(i, o);
|
|
84
92
|
if (!n) return null;
|
|
85
|
-
const
|
|
86
|
-
(
|
|
87
|
-
),
|
|
88
|
-
(
|
|
93
|
+
const r = i.findIndex(
|
|
94
|
+
(t) => t.id === n
|
|
95
|
+
), c = i.findIndex(
|
|
96
|
+
(t) => t.id === e
|
|
89
97
|
);
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
t,
|
|
98
|
+
if (r !== -1 && c !== -1) {
|
|
99
|
+
const t = _(
|
|
93
100
|
i,
|
|
94
|
-
|
|
101
|
+
c,
|
|
102
|
+
r
|
|
95
103
|
);
|
|
96
|
-
return
|
|
104
|
+
return s?.(e, n), t;
|
|
97
105
|
}
|
|
98
106
|
return null;
|
|
99
107
|
},
|
|
100
|
-
[
|
|
101
|
-
),
|
|
102
|
-
(
|
|
103
|
-
const n =
|
|
104
|
-
if (n !== -1 &&
|
|
105
|
-
const
|
|
106
|
-
return
|
|
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);
|
|
112
|
+
if (n !== -1 && r !== -1) {
|
|
113
|
+
const c = _(i, n, r);
|
|
114
|
+
return s?.(e, o), c;
|
|
107
115
|
}
|
|
108
116
|
return null;
|
|
109
117
|
},
|
|
110
|
-
[
|
|
111
|
-
),
|
|
112
|
-
(
|
|
113
|
-
const n =
|
|
114
|
-
return
|
|
118
|
+
[s]
|
|
119
|
+
), k = S(
|
|
120
|
+
(i, e, o) => {
|
|
121
|
+
const n = y(i, e, o);
|
|
122
|
+
return s?.(e, o), n;
|
|
115
123
|
},
|
|
116
|
-
[
|
|
117
|
-
),
|
|
118
|
-
(
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
121
|
-
const
|
|
122
|
-
(
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
[y, s]
|
|
125
|
+
), A = S(
|
|
126
|
+
(i, e, o, n = !1) => {
|
|
127
|
+
const r = F(i, e);
|
|
128
|
+
if (!r) return null;
|
|
129
|
+
const c = (u) => u.filter((l) => l.id !== e).map(
|
|
130
|
+
(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
|
+
for (let l = 0; l < u.length; l++) {
|
|
133
|
+
if (u[l].id === o)
|
|
134
|
+
if (T) {
|
|
135
|
+
const x = {
|
|
136
|
+
...u[l],
|
|
137
|
+
children: [r, ...u[l].children || []]
|
|
138
|
+
}, P = [...u];
|
|
139
|
+
return P[l] = x, { nodes: P, inserted: !0 };
|
|
140
|
+
} else {
|
|
141
|
+
const x = [...u], P = n ? l + 1 : l;
|
|
142
|
+
return x.splice(P, 0, r), { nodes: x, inserted: !0 };
|
|
143
|
+
}
|
|
144
|
+
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 };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
128
151
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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;
|
|
152
|
+
return { nodes: u, inserted: !1 };
|
|
153
|
+
}, N = c(i), { nodes: g, inserted: Y } = M(N);
|
|
154
|
+
return Y ? (s?.(e, o), g) : null;
|
|
137
155
|
},
|
|
138
|
-
[
|
|
139
|
-
),
|
|
140
|
-
(
|
|
141
|
-
const n = F(
|
|
142
|
-
if (!n) return
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
156
|
+
[s]
|
|
157
|
+
), G = S(
|
|
158
|
+
(i, e, o) => {
|
|
159
|
+
const n = F(i, e);
|
|
160
|
+
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 };
|
|
146
166
|
});
|
|
147
|
-
return
|
|
167
|
+
return s?.(e, o), c;
|
|
148
168
|
},
|
|
149
|
-
[
|
|
150
|
-
),
|
|
151
|
-
(
|
|
152
|
-
const { active: o, over: n } =
|
|
153
|
-
!n || o.id === n.id ||
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
169
|
+
[s]
|
|
170
|
+
), j = S(
|
|
171
|
+
(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(
|
|
182
|
+
r,
|
|
183
|
+
c,
|
|
184
|
+
t
|
|
185
|
+
) || r;
|
|
186
|
+
if (C === null || T === null)
|
|
187
|
+
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;
|
|
196
|
+
}
|
|
197
|
+
return A(r, c, t, z) || r;
|
|
198
|
+
}
|
|
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;
|
|
181
204
|
}
|
|
182
|
-
return
|
|
205
|
+
return A(r, c, t, x) || r;
|
|
183
206
|
}
|
|
184
|
-
return
|
|
207
|
+
return C === 0 ? B(r, c, t) || r : k(r, c, t);
|
|
185
208
|
});
|
|
186
209
|
},
|
|
187
210
|
[
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
211
|
+
h,
|
|
212
|
+
R,
|
|
213
|
+
w,
|
|
214
|
+
B,
|
|
215
|
+
k,
|
|
216
|
+
A,
|
|
217
|
+
G
|
|
195
218
|
]
|
|
196
|
-
),
|
|
197
|
-
(
|
|
198
|
-
if (!
|
|
219
|
+
), q = S(
|
|
220
|
+
(i, e) => {
|
|
221
|
+
if (!i || !e || i === e)
|
|
199
222
|
return !1;
|
|
200
|
-
const o =
|
|
201
|
-
return
|
|
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;
|
|
202
225
|
},
|
|
203
|
-
[
|
|
226
|
+
[a, h]
|
|
204
227
|
);
|
|
205
228
|
return {
|
|
206
|
-
sensors:
|
|
207
|
-
handleDragEnd:
|
|
208
|
-
isValidDrop:
|
|
209
|
-
findItemLevel:
|
|
210
|
-
findParentId:
|
|
229
|
+
sensors: f,
|
|
230
|
+
handleDragEnd: j,
|
|
231
|
+
isValidDrop: q,
|
|
232
|
+
findItemLevel: h,
|
|
233
|
+
findParentId: R
|
|
211
234
|
};
|
|
212
235
|
};
|
|
213
236
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
237
|
+
m as customCollisionDetection,
|
|
238
|
+
I as useNestedListDragDrop
|
|
216
239
|
};
|