@vue-dnd-kit/core 1.3.2 → 1.3.4
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,144 +1,144 @@
|
|
|
1
1
|
var me = Object.defineProperty;
|
|
2
2
|
var he = (n, e, t) => e in n ? me(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
5
|
-
import { createGlobalState as ge, useMagicKeys as
|
|
6
|
-
const
|
|
3
|
+
var k = (n, e, t) => he(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ref as V, computed as T, shallowRef as D, onMounted as Q, onUnmounted as pe, defineComponent as de, createElementBlock as q, createCommentVNode as Ee, unref as w, openBlock as H, normalizeStyle as re, Fragment as ae, renderList as ye, createBlock as G, resolveDynamicComponent as J, Transition as we, withCtx as xe, createVNode as Me, render as le, useId as Pe, onBeforeUnmount as fe } from "vue";
|
|
5
|
+
import { createGlobalState as ge, useMagicKeys as Le, useThrottleFn as Ae } from "@vueuse/core";
|
|
6
|
+
const M = class M {
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
k(M, "remove", (e, t) => {
|
|
9
9
|
if (!e || t === void 0) return;
|
|
10
10
|
const [r] = e.splice(t, 1);
|
|
11
11
|
return r;
|
|
12
|
-
}),
|
|
12
|
+
}), k(M, "insert", (e, t, r) => {
|
|
13
13
|
!e || t === void 0 || e.splice(t, 0, r);
|
|
14
|
-
}),
|
|
14
|
+
}), k(M, "move", (e, t, r, l) => {
|
|
15
15
|
if (!e || !r || t === void 0 || l === void 0)
|
|
16
16
|
return;
|
|
17
|
-
const s =
|
|
18
|
-
|
|
19
|
-
}),
|
|
17
|
+
const s = M.remove(e, t);
|
|
18
|
+
M.insert(r, l, s);
|
|
19
|
+
}), k(M, "swap", (e, t, r, l) => {
|
|
20
20
|
if (!e || !r || t === void 0 || l === void 0)
|
|
21
21
|
return;
|
|
22
22
|
const s = e[t], o = r[l];
|
|
23
23
|
e[t] = o, r[l] = s;
|
|
24
|
-
}),
|
|
24
|
+
}), k(M, "copy", (e, t, r, l) => {
|
|
25
25
|
if (!e || t === void 0 || !r || l === void 0)
|
|
26
26
|
return;
|
|
27
27
|
const s = e[t];
|
|
28
|
-
|
|
29
|
-
}),
|
|
30
|
-
var l, s, o, g, i, u,
|
|
28
|
+
M.insert(r, l, s);
|
|
29
|
+
}), k(M, "applyTransfer", (e) => {
|
|
30
|
+
var l, s, o, g, i, u, v;
|
|
31
31
|
const t = e.hovered.element.value, r = e.hovered.zone.value;
|
|
32
32
|
if (t) {
|
|
33
|
-
const
|
|
33
|
+
const d = (s = (l = e.elementsMap.value.get(t)) == null ? void 0 : l.data) == null ? void 0 : s.source, a = (g = (o = e.elementsMap.value.get(t)) == null ? void 0 : o.data) == null ? void 0 : g.index, c = e.draggingElements.value.values().next().value, f = (i = c == null ? void 0 : c.data) == null ? void 0 : i.index, m = f !== void 0 && a !== void 0 && f > a ? 1 : -1;
|
|
34
34
|
Array.from(
|
|
35
35
|
e.draggingElements.value.values()
|
|
36
36
|
).sort(
|
|
37
|
-
(
|
|
38
|
-
var
|
|
39
|
-
return m * ((((
|
|
37
|
+
(y, A) => {
|
|
38
|
+
var P, _;
|
|
39
|
+
return m * ((((P = y.data) == null ? void 0 : P.index) || 0) - (((_ = A.data) == null ? void 0 : _.index) || 0));
|
|
40
40
|
}
|
|
41
41
|
).forEach(
|
|
42
|
-
(
|
|
43
|
-
var
|
|
44
|
-
return
|
|
45
|
-
(
|
|
46
|
-
(
|
|
47
|
-
|
|
42
|
+
(y) => {
|
|
43
|
+
var A, P;
|
|
44
|
+
return M.move(
|
|
45
|
+
(A = y.data) == null ? void 0 : A.source,
|
|
46
|
+
(P = y.data) == null ? void 0 : P.index,
|
|
47
|
+
d,
|
|
48
48
|
a
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
} else if (r) {
|
|
53
|
-
const
|
|
53
|
+
const d = (v = (u = e.zonesMap.value.get(r)) == null ? void 0 : u.data) == null ? void 0 : v.source, a = d == null ? void 0 : d.length;
|
|
54
54
|
Array.from(
|
|
55
55
|
e.draggingElements.value.values()
|
|
56
56
|
).sort((f, m) => {
|
|
57
|
-
var
|
|
58
|
-
return (((
|
|
57
|
+
var E, y;
|
|
58
|
+
return (((E = m.data) == null ? void 0 : E.index) || 0) - (((y = f.data) == null ? void 0 : y.index) || 0);
|
|
59
59
|
}).forEach(
|
|
60
60
|
(f) => {
|
|
61
|
-
var m,
|
|
62
|
-
return
|
|
61
|
+
var m, E;
|
|
62
|
+
return M.move(
|
|
63
63
|
(m = f.data) == null ? void 0 : m.source,
|
|
64
|
-
(
|
|
65
|
-
|
|
64
|
+
(E = f.data) == null ? void 0 : E.index,
|
|
65
|
+
d,
|
|
66
66
|
a
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
71
|
+
}), k(M, "applyCopy", (e) => {
|
|
72
72
|
var l, s, o, g, i, u;
|
|
73
73
|
const t = e.hovered.element.value, r = e.hovered.zone.value;
|
|
74
74
|
if (t) {
|
|
75
|
-
const
|
|
75
|
+
const v = (s = (l = e.elementsMap.value.get(t)) == null ? void 0 : l.data) == null ? void 0 : s.source, d = (g = (o = e.elementsMap.value.get(t)) == null ? void 0 : o.data) == null ? void 0 : g.index;
|
|
76
76
|
Array.from(
|
|
77
77
|
e.draggingElements.value.values()
|
|
78
78
|
).sort((c, f) => {
|
|
79
|
-
var m,
|
|
80
|
-
return (((m = f.data) == null ? void 0 : m.index) || 0) - (((
|
|
79
|
+
var m, E;
|
|
80
|
+
return (((m = f.data) == null ? void 0 : m.index) || 0) - (((E = c.data) == null ? void 0 : E.index) || 0);
|
|
81
81
|
}).forEach(
|
|
82
82
|
(c) => {
|
|
83
83
|
var f, m;
|
|
84
|
-
return
|
|
84
|
+
return M.copy(
|
|
85
85
|
(f = c.data) == null ? void 0 : f.source,
|
|
86
86
|
(m = c.data) == null ? void 0 : m.index,
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
v,
|
|
88
|
+
d
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
} else if (r) {
|
|
93
|
-
const
|
|
93
|
+
const v = (u = (i = e.zonesMap.value.get(r)) == null ? void 0 : i.data) == null ? void 0 : u.source, d = v == null ? void 0 : v.length;
|
|
94
94
|
Array.from(
|
|
95
95
|
e.draggingElements.value.values()
|
|
96
96
|
).sort((c, f) => {
|
|
97
|
-
var m,
|
|
98
|
-
return (((m = f.data) == null ? void 0 : m.index) || 0) - (((
|
|
97
|
+
var m, E;
|
|
98
|
+
return (((m = f.data) == null ? void 0 : m.index) || 0) - (((E = c.data) == null ? void 0 : E.index) || 0);
|
|
99
99
|
}).forEach(
|
|
100
100
|
(c) => {
|
|
101
101
|
var f, m;
|
|
102
|
-
return
|
|
102
|
+
return M.copy(
|
|
103
103
|
(f = c.data) == null ? void 0 : f.source,
|
|
104
104
|
(m = c.data) == null ? void 0 : m.index,
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
v,
|
|
106
|
+
d
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
|
-
}),
|
|
112
|
-
var l, s, o, g, i, u,
|
|
111
|
+
}), k(M, "applySwap", (e) => {
|
|
112
|
+
var l, s, o, g, i, u, v, d;
|
|
113
113
|
const t = e.hovered.element.value, r = e.hovered.zone.value;
|
|
114
114
|
if (t && e.draggingElements.value.size === 1) {
|
|
115
115
|
const a = e.draggingElements.value.values().next().value;
|
|
116
|
-
|
|
116
|
+
M.swap(
|
|
117
117
|
(l = a == null ? void 0 : a.data) == null ? void 0 : l.source,
|
|
118
118
|
(s = a == null ? void 0 : a.data) == null ? void 0 : s.index,
|
|
119
119
|
(g = (o = e.elementsMap.value.get(t)) == null ? void 0 : o.data) == null ? void 0 : g.source,
|
|
120
120
|
(u = (i = e.elementsMap.value.get(t)) == null ? void 0 : i.data) == null ? void 0 : u.index
|
|
121
121
|
);
|
|
122
122
|
} else if (r) {
|
|
123
|
-
const a = (
|
|
123
|
+
const a = (d = (v = e.zonesMap.value.get(r)) == null ? void 0 : v.data) == null ? void 0 : d.source, c = a == null ? void 0 : a.length;
|
|
124
124
|
Array.from(
|
|
125
125
|
e.draggingElements.value.values()
|
|
126
|
-
).sort((m,
|
|
127
|
-
var
|
|
128
|
-
return (((
|
|
126
|
+
).sort((m, E) => {
|
|
127
|
+
var y, A;
|
|
128
|
+
return (((y = E.data) == null ? void 0 : y.index) || 0) - (((A = m.data) == null ? void 0 : A.index) || 0);
|
|
129
129
|
}).forEach(
|
|
130
130
|
(m) => {
|
|
131
|
-
var
|
|
132
|
-
return
|
|
133
|
-
(
|
|
134
|
-
(
|
|
131
|
+
var E, y;
|
|
132
|
+
return M.move(
|
|
133
|
+
(E = m.data) == null ? void 0 : E.source,
|
|
134
|
+
(y = m.data) == null ? void 0 : y.index,
|
|
135
135
|
a,
|
|
136
136
|
c
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
|
-
}),
|
|
141
|
+
}), k(M, "applyRemove", (e) => {
|
|
142
142
|
Array.from(
|
|
143
143
|
e.draggingElements.value.values()
|
|
144
144
|
).sort((r, l) => {
|
|
@@ -146,55 +146,62 @@ z(x, "remove", (e, t) => {
|
|
|
146
146
|
return (((s = l.data) == null ? void 0 : s.index) || 0) - (((o = r.data) == null ? void 0 : o.index) || 0);
|
|
147
147
|
}).forEach((r) => {
|
|
148
148
|
var l, s;
|
|
149
|
-
(l = r.data) != null && l.source && ((s = r.data) == null ? void 0 : s.index) !== void 0 &&
|
|
149
|
+
(l = r.data) != null && l.source && ((s = r.data) == null ? void 0 : s.index) !== void 0 && M.remove(r.data.source, r.data.index);
|
|
150
150
|
});
|
|
151
|
-
}),
|
|
152
|
-
var s, o, g, i, u,
|
|
151
|
+
}), k(M, "applyInsert", (e, t) => {
|
|
152
|
+
var s, o, g, i, u, v;
|
|
153
153
|
const r = e.hovered.element.value, l = e.hovered.zone.value;
|
|
154
154
|
if (r && t.length > 0) {
|
|
155
|
-
const
|
|
155
|
+
const d = (o = (s = e.elementsMap.value.get(r)) == null ? void 0 : s.data) == null ? void 0 : o.source, a = (i = (g = e.elementsMap.value.get(r)) == null ? void 0 : g.data) == null ? void 0 : i.index;
|
|
156
156
|
t.forEach((c) => {
|
|
157
|
-
|
|
157
|
+
M.insert(d, a, c);
|
|
158
158
|
});
|
|
159
159
|
} else if (l) {
|
|
160
|
-
const
|
|
160
|
+
const d = (v = (u = e.zonesMap.value.get(l)) == null ? void 0 : u.data) == null ? void 0 : v.source, a = d == null ? void 0 : d.length;
|
|
161
161
|
t.forEach((c) => {
|
|
162
|
-
|
|
162
|
+
M.insert(d, a, c);
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
|
-
let se =
|
|
167
|
-
const
|
|
168
|
-
const n =
|
|
166
|
+
let se = M;
|
|
167
|
+
const Z = ge(() => {
|
|
168
|
+
const n = V(
|
|
169
169
|
/* @__PURE__ */ new Map()
|
|
170
|
-
), e =
|
|
171
|
-
component:
|
|
172
|
-
ref:
|
|
173
|
-
options:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
170
|
+
), e = T(() => n.value.size > 0), t = {
|
|
171
|
+
component: V(null),
|
|
172
|
+
ref: D(null),
|
|
173
|
+
options: D(null),
|
|
174
|
+
animating: {
|
|
175
|
+
enter: D(!1),
|
|
176
|
+
leave: D(!1),
|
|
177
|
+
appear: D(!1)
|
|
178
|
+
}
|
|
179
|
+
}, r = V(/* @__PURE__ */ new Map()), l = V(/* @__PURE__ */ new Set()), s = V(/* @__PURE__ */ new Map()), o = V(/* @__PURE__ */ new Set()), g = V(/* @__PURE__ */ new Set()), i = typeof window < "u" && "IntersectionObserver" in window, u = i ? new IntersectionObserver((h) => {
|
|
180
|
+
h.forEach(
|
|
181
|
+
(p) => g.value[p.isIntersecting ? "add" : "delete"](
|
|
182
|
+
p.target
|
|
178
183
|
)
|
|
179
184
|
);
|
|
180
|
-
}),
|
|
181
|
-
|
|
182
|
-
(
|
|
185
|
+
}) : null, v = i ? new IntersectionObserver((h) => {
|
|
186
|
+
h.forEach(
|
|
187
|
+
(p) => o.value[p.isIntersecting ? "add" : "delete"](
|
|
188
|
+
p.target
|
|
189
|
+
)
|
|
183
190
|
);
|
|
184
|
-
}), d = (
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
start:
|
|
190
|
-
current:
|
|
191
|
+
}) : null, d = (h, p) => {
|
|
192
|
+
u && (h === "add" ? u.observe(p) : (u.unobserve(p), g.value.delete(p)));
|
|
193
|
+
}, a = (h, p) => {
|
|
194
|
+
v && (h === "add" ? v.observe(p) : (v.unobserve(p), o.value.delete(p)));
|
|
195
|
+
}, c = {
|
|
196
|
+
start: D(null),
|
|
197
|
+
current: D(null),
|
|
191
198
|
offset: {
|
|
192
|
-
percent:
|
|
193
|
-
pixel:
|
|
199
|
+
percent: D(null),
|
|
200
|
+
pixel: D(null)
|
|
194
201
|
}
|
|
195
|
-
}, { w:
|
|
196
|
-
zone:
|
|
197
|
-
element:
|
|
202
|
+
}, { w: f, s: m, a: E, d: y, ctrl: A, shift: P, alt: _, meta: B } = Le(), X = {
|
|
203
|
+
zone: D(null),
|
|
204
|
+
element: D(null)
|
|
198
205
|
};
|
|
199
206
|
return {
|
|
200
207
|
draggingElements: n,
|
|
@@ -205,23 +212,23 @@ const T = ge(() => {
|
|
|
205
212
|
zonesMap: s,
|
|
206
213
|
visibleZones: o,
|
|
207
214
|
visibleElements: g,
|
|
208
|
-
pointerPosition:
|
|
215
|
+
pointerPosition: c,
|
|
209
216
|
keyboard: {
|
|
210
|
-
w:
|
|
211
|
-
s:
|
|
212
|
-
a:
|
|
213
|
-
d:
|
|
214
|
-
ctrl:
|
|
215
|
-
shift:
|
|
216
|
-
alt:
|
|
217
|
-
meta:
|
|
217
|
+
w: f,
|
|
218
|
+
s: m,
|
|
219
|
+
a: E,
|
|
220
|
+
d: y,
|
|
221
|
+
ctrl: A,
|
|
222
|
+
shift: P,
|
|
223
|
+
alt: _,
|
|
224
|
+
meta: B
|
|
218
225
|
},
|
|
219
|
-
hovered:
|
|
226
|
+
hovered: X,
|
|
220
227
|
handleDragElementIntersection: d,
|
|
221
|
-
handleDropZoneIntersection:
|
|
228
|
+
handleDropZoneIntersection: a
|
|
222
229
|
};
|
|
223
|
-
}),
|
|
224
|
-
const e =
|
|
230
|
+
}), Ie = (n) => {
|
|
231
|
+
const e = V(null), { draggingElements: t, pointerPosition: r, isDragging: l, activeContainer: s } = Z();
|
|
225
232
|
return Q(() => {
|
|
226
233
|
s.ref = e, s.options.value = n ?? null;
|
|
227
234
|
}), pe(() => {
|
|
@@ -230,12 +237,13 @@ const T = ge(() => {
|
|
|
230
237
|
elementRef: e,
|
|
231
238
|
draggingElements: t,
|
|
232
239
|
pointerPosition: r,
|
|
233
|
-
isDragging: l
|
|
240
|
+
isDragging: l,
|
|
241
|
+
animating: s.animating
|
|
234
242
|
};
|
|
235
|
-
},
|
|
243
|
+
}, Se = ["innerHTML"], _e = /* @__PURE__ */ de({
|
|
236
244
|
__name: "DefaultOverlay",
|
|
237
245
|
setup(n) {
|
|
238
|
-
const { elementRef: e, pointerPosition: t, isDragging: r, draggingElements: l } =
|
|
246
|
+
const { elementRef: e, pointerPosition: t, isDragging: r, draggingElements: l } = Ie(), s = T(() => {
|
|
239
247
|
var o, g, i, u;
|
|
240
248
|
return {
|
|
241
249
|
transform: `translate3d(${(((o = t.current.value) == null ? void 0 : o.x) ?? 0) - (((g = t.offset.pixel.value) == null ? void 0 : g.x) ?? 0)}px, ${(((i = t.current.value) == null ? void 0 : i.y) ?? 0) - (((u = t.offset.pixel.value) == null ? void 0 : u.y) ?? 0)}px, 0)`,
|
|
@@ -246,14 +254,14 @@ const T = ge(() => {
|
|
|
246
254
|
transition: "0.3s cubic-bezier(0.165, 0.84, 0.44, 1)"
|
|
247
255
|
};
|
|
248
256
|
});
|
|
249
|
-
return (o, g) =>
|
|
257
|
+
return (o, g) => w(r) ? (H(), q("div", {
|
|
250
258
|
key: 0,
|
|
251
259
|
ref_key: "elementRef",
|
|
252
260
|
ref: e,
|
|
253
261
|
style: re(s.value)
|
|
254
262
|
}, [
|
|
255
|
-
(H(!0), q(ae, null, ye(
|
|
256
|
-
var
|
|
263
|
+
(H(!0), q(ae, null, ye(w(l), ([i, u]) => {
|
|
264
|
+
var v, d;
|
|
257
265
|
return H(), q(ae, {
|
|
258
266
|
key: u.id
|
|
259
267
|
}, [
|
|
@@ -267,10 +275,10 @@ const T = ge(() => {
|
|
|
267
275
|
key: 1,
|
|
268
276
|
innerHTML: u.initialHTML,
|
|
269
277
|
style: re({
|
|
270
|
-
width: `${(
|
|
271
|
-
height: `${(
|
|
278
|
+
width: `${(v = u.initialRect) == null ? void 0 : v.width}px`,
|
|
279
|
+
height: `${(d = u.initialRect) == null ? void 0 : d.height}px`
|
|
272
280
|
})
|
|
273
|
-
}, null, 12,
|
|
281
|
+
}, null, 12, Se))
|
|
274
282
|
], 64);
|
|
275
283
|
}), 128))
|
|
276
284
|
], 4)) : Ee("", !0);
|
|
@@ -278,35 +286,35 @@ const T = ge(() => {
|
|
|
278
286
|
}), oe = /* @__PURE__ */ de({
|
|
279
287
|
__name: "DragOverlay",
|
|
280
288
|
setup(n) {
|
|
281
|
-
const { activeContainer: e } =
|
|
282
|
-
() => e.component.value ??
|
|
289
|
+
const { activeContainer: e } = Z(), t = T(
|
|
290
|
+
() => e.component.value ?? _e
|
|
283
291
|
);
|
|
284
|
-
return (r, l) =>
|
|
292
|
+
return (r, l) => w(e).options.value ? (H(), G(we, {
|
|
285
293
|
key: 0,
|
|
286
|
-
name:
|
|
287
|
-
duration:
|
|
288
|
-
"enter-from-class":
|
|
289
|
-
"enter-to-class":
|
|
290
|
-
"enter-active-class":
|
|
291
|
-
"leave-from-class":
|
|
292
|
-
"leave-to-class":
|
|
293
|
-
"leave-active-class":
|
|
294
|
-
"appear-active-class":
|
|
295
|
-
"appear-from-class":
|
|
296
|
-
"appear-to-class":
|
|
297
|
-
mode:
|
|
298
|
-
type:
|
|
299
|
-
css:
|
|
294
|
+
name: w(e).options.value.name,
|
|
295
|
+
duration: w(e).options.value.duration,
|
|
296
|
+
"enter-from-class": w(e).options.value.enterFromClass,
|
|
297
|
+
"enter-to-class": w(e).options.value.enterToClass,
|
|
298
|
+
"enter-active-class": w(e).options.value.enterActiveClass,
|
|
299
|
+
"leave-from-class": w(e).options.value.leaveFromClass,
|
|
300
|
+
"leave-to-class": w(e).options.value.leaveToClass,
|
|
301
|
+
"leave-active-class": w(e).options.value.leaveActiveClass,
|
|
302
|
+
"appear-active-class": w(e).options.value.appearActiveClass,
|
|
303
|
+
"appear-from-class": w(e).options.value.appearFromClass,
|
|
304
|
+
"appear-to-class": w(e).options.value.appearToClass,
|
|
305
|
+
mode: w(e).options.value.mode,
|
|
306
|
+
type: w(e).options.value.type,
|
|
307
|
+
css: w(e).options.value.css,
|
|
300
308
|
appear: !0,
|
|
301
|
-
persisted:
|
|
302
|
-
onEnter:
|
|
303
|
-
onLeave:
|
|
304
|
-
onBeforeEnter:
|
|
305
|
-
onBeforeLeave:
|
|
306
|
-
onBeforeAppear:
|
|
307
|
-
onAfterEnter:
|
|
308
|
-
onAfterLeave:
|
|
309
|
-
onAfterAppear:
|
|
309
|
+
persisted: w(e).options.value.persisted,
|
|
310
|
+
onEnter: w(e).options.value.onEnter,
|
|
311
|
+
onLeave: w(e).options.value.onLeave,
|
|
312
|
+
onBeforeEnter: w(e).options.value.onBeforeEnter,
|
|
313
|
+
onBeforeLeave: w(e).options.value.onBeforeLeave,
|
|
314
|
+
onBeforeAppear: w(e).options.value.onBeforeAppear,
|
|
315
|
+
onAfterEnter: w(e).options.value.onAfterEnter,
|
|
316
|
+
onAfterLeave: w(e).options.value.onAfterLeave,
|
|
317
|
+
onAfterAppear: w(e).options.value.onAfterAppear
|
|
310
318
|
}, {
|
|
311
319
|
default: xe(() => [
|
|
312
320
|
(H(), G(J(t.value)))
|
|
@@ -328,7 +336,7 @@ const T = ge(() => {
|
|
|
328
336
|
container: o,
|
|
329
337
|
vnode: g
|
|
330
338
|
};
|
|
331
|
-
const i =
|
|
339
|
+
const i = Z();
|
|
332
340
|
n.__VUE_DND_KIT_STORE__ = i;
|
|
333
341
|
}
|
|
334
342
|
return l;
|
|
@@ -338,7 +346,7 @@ const T = ge(() => {
|
|
|
338
346
|
return n.__VUE_DND_KIT_OVERLAY__ && (le(null, n.__VUE_DND_KIT_OVERLAY__.container), delete n.__VUE_DND_KIT_OVERLAY__), t.call(this);
|
|
339
347
|
};
|
|
340
348
|
}
|
|
341
|
-
}, ie = (n, e) => n.x < e.x + e.width && n.x + n.width > e.x && n.y < e.y + e.height && n.y + n.height > e.y,
|
|
349
|
+
}, ie = (n, e) => n.x < e.x + e.width && n.x + n.width > e.x && n.y < e.y + e.height && n.y + n.height > e.y, R = (n) => {
|
|
342
350
|
if (!n)
|
|
343
351
|
return {
|
|
344
352
|
x: 0,
|
|
@@ -364,8 +372,8 @@ const T = ge(() => {
|
|
|
364
372
|
}, j = (n) => ({
|
|
365
373
|
x: n.x + n.width / 2,
|
|
366
374
|
y: n.y + n.height / 2
|
|
367
|
-
}),
|
|
368
|
-
const t =
|
|
375
|
+
}), Ce = (n, e) => {
|
|
376
|
+
const t = R(n);
|
|
369
377
|
return {
|
|
370
378
|
pixel: {
|
|
371
379
|
x: e.x - t.x,
|
|
@@ -392,7 +400,7 @@ const T = ge(() => {
|
|
|
392
400
|
n.preventDefault();
|
|
393
401
|
}, U = (n) => ({
|
|
394
402
|
items: Array.from(n.draggingElements.value.values())
|
|
395
|
-
}),
|
|
403
|
+
}), De = (n) => {
|
|
396
404
|
const {
|
|
397
405
|
elementsMap: e,
|
|
398
406
|
draggingElements: t,
|
|
@@ -401,14 +409,14 @@ const T = ge(() => {
|
|
|
401
409
|
isDragging: s,
|
|
402
410
|
visibleElements: o,
|
|
403
411
|
handleDragElementIntersection: g
|
|
404
|
-
} =
|
|
412
|
+
} = Z(), i = V(null), u = T(
|
|
405
413
|
() => o.value.has(i.value) && r.element.value === i.value
|
|
406
|
-
),
|
|
414
|
+
), v = D((n == null ? void 0 : n.id) || Pe()), d = T(() => !i.value || !e.value.has(i.value) ? !1 : t.value.has(i.value)), a = T(() => {
|
|
407
415
|
if (!i.value || !s.value || !o.value.has(i.value)) return !1;
|
|
408
416
|
const m = e.value.get(i.value);
|
|
409
417
|
return m != null && m.groups.length ? !Array.from(t.value.entries()).some(
|
|
410
|
-
([
|
|
411
|
-
(
|
|
418
|
+
([E, y]) => y.groups.length ? !y.groups.some(
|
|
419
|
+
(A) => m.groups.includes(A)
|
|
412
420
|
) : !1
|
|
413
421
|
) : !0;
|
|
414
422
|
});
|
|
@@ -423,35 +431,35 @@ const T = ge(() => {
|
|
|
423
431
|
defaultLayer: (n == null ? void 0 : n.layer) ?? null,
|
|
424
432
|
events: (n == null ? void 0 : n.events) ?? {},
|
|
425
433
|
data: (n == null ? void 0 : n.data) ?? null,
|
|
426
|
-
id:
|
|
434
|
+
id: v.value
|
|
427
435
|
}), g("add", i.value), i.value.addEventListener("dragstart", C), i.value.addEventListener("drag", C), i.value.setAttribute(ve, "true"), i.value.setAttribute("draggable", "false");
|
|
428
436
|
},
|
|
429
437
|
unregisterElement: () => {
|
|
430
438
|
i.value && (e.value.delete(i.value), l.value.delete(i.value), i.value.removeEventListener("dragstart", C), i.value.removeEventListener("drag", C), i.value.removeAttribute(ve), i.value.removeAttribute("draggable"));
|
|
431
439
|
},
|
|
432
|
-
isDragging:
|
|
440
|
+
isDragging: d,
|
|
433
441
|
isOvered: u,
|
|
434
442
|
isAllowed: a,
|
|
435
|
-
id:
|
|
443
|
+
id: v
|
|
436
444
|
};
|
|
437
|
-
},
|
|
438
|
-
var
|
|
439
|
-
const e =
|
|
445
|
+
}, b = (n, e) => n ? e.contains(n) : !1, ze = (n) => {
|
|
446
|
+
var v, d;
|
|
447
|
+
const e = R(n.activeContainer.ref.value), t = j(e), r = ((v = n.pointerPosition.current.value) == null ? void 0 : v.x) ?? 0, l = ((d = n.pointerPosition.current.value) == null ? void 0 : d.y) ?? 0, o = !(e && r >= e.x && r <= e.x + e.width && l >= e.y && l <= e.y + e.height), g = Array.from(n.draggingElements.value.keys()), i = Array.from(n.visibleElements.value.entries()).filter(([a, c]) => {
|
|
440
448
|
if (!a) return !1;
|
|
441
|
-
const f =
|
|
449
|
+
const f = R(a);
|
|
442
450
|
return f && e && ie(f, e);
|
|
443
451
|
}).map(([a, c]) => {
|
|
444
|
-
const f =
|
|
445
|
-
let
|
|
446
|
-
for (const [
|
|
447
|
-
|
|
452
|
+
const f = R(a), m = j(f), E = r >= f.x && r <= f.x + f.width && l >= f.y && l <= f.y + f.height, y = ce(f, e), A = ue(t, m);
|
|
453
|
+
let P = 0;
|
|
454
|
+
for (const [_, B] of n.visibleElements.value.entries())
|
|
455
|
+
_ !== a && _ && a && b(a, _) && P++;
|
|
448
456
|
return {
|
|
449
457
|
element: c,
|
|
450
458
|
node: a,
|
|
451
|
-
isPointerInElement:
|
|
452
|
-
overlapPercent:
|
|
453
|
-
depth:
|
|
454
|
-
centerDistance:
|
|
459
|
+
isPointerInElement: E,
|
|
460
|
+
overlapPercent: y,
|
|
461
|
+
depth: P,
|
|
462
|
+
centerDistance: A
|
|
455
463
|
};
|
|
456
464
|
}).sort((a, c) => {
|
|
457
465
|
if (!o) {
|
|
@@ -463,23 +471,23 @@ const T = ge(() => {
|
|
|
463
471
|
return Math.abs(a.overlapPercent - c.overlapPercent) <= 1 ? a.centerDistance - c.centerDistance : c.overlapPercent - a.overlapPercent;
|
|
464
472
|
}), u = Array.from(n.visibleZones.value.entries()).filter(([a, c]) => {
|
|
465
473
|
if (!a || g.some(
|
|
466
|
-
(m) => m &&
|
|
474
|
+
(m) => m && b(a, m)
|
|
467
475
|
))
|
|
468
476
|
return !1;
|
|
469
|
-
const f =
|
|
477
|
+
const f = R(a);
|
|
470
478
|
return f && e && ie(f, e);
|
|
471
479
|
}).map(([a, c]) => {
|
|
472
|
-
const f =
|
|
473
|
-
let
|
|
474
|
-
for (const [
|
|
475
|
-
|
|
480
|
+
const f = R(a), m = j(f), E = r >= f.x && r <= f.x + f.width && l >= f.y && l <= f.y + f.height, y = ce(f, e), A = ue(t, m);
|
|
481
|
+
let P = 0;
|
|
482
|
+
for (const [_, B] of n.visibleZones.value.entries())
|
|
483
|
+
_ !== a && _ && a && b(a, _) && P++;
|
|
476
484
|
return {
|
|
477
485
|
zone: c,
|
|
478
486
|
node: a,
|
|
479
|
-
isPointerInElement:
|
|
480
|
-
overlapPercent:
|
|
481
|
-
depth:
|
|
482
|
-
centerDistance:
|
|
487
|
+
isPointerInElement: E,
|
|
488
|
+
overlapPercent: y,
|
|
489
|
+
depth: P,
|
|
490
|
+
centerDistance: A
|
|
483
491
|
};
|
|
484
492
|
}).sort((a, c) => {
|
|
485
493
|
if (!o) {
|
|
@@ -494,21 +502,21 @@ const T = ge(() => {
|
|
|
494
502
|
...i.map((a) => a.node),
|
|
495
503
|
...u.map((a) => a.node)
|
|
496
504
|
];
|
|
497
|
-
},
|
|
498
|
-
const { pointerPosition: t, keyboard: r } =
|
|
505
|
+
}, ke = (n, e) => {
|
|
506
|
+
const { pointerPosition: t, keyboard: r } = Z(), l = (e == null ? void 0 : e.moveStep) || 10;
|
|
499
507
|
return {
|
|
500
508
|
onKeyboardStart: (i) => {
|
|
501
509
|
var a;
|
|
502
510
|
C(i);
|
|
503
|
-
const u =
|
|
511
|
+
const u = R(n.value);
|
|
504
512
|
(a = n.value) == null || a.blur();
|
|
505
|
-
const
|
|
513
|
+
const v = u.x + u.width / 2, d = u.y + u.height / 2;
|
|
506
514
|
t.start.value = {
|
|
507
|
-
x:
|
|
508
|
-
y:
|
|
515
|
+
x: v,
|
|
516
|
+
y: d
|
|
509
517
|
}, t.current.value = {
|
|
510
|
-
x:
|
|
511
|
-
y:
|
|
518
|
+
x: v,
|
|
519
|
+
y: d
|
|
512
520
|
}, t.offset.pixel.value = {
|
|
513
521
|
x: u.width / 2,
|
|
514
522
|
y: u.height / 2
|
|
@@ -520,25 +528,25 @@ const T = ge(() => {
|
|
|
520
528
|
onKeyboardMove: () => {
|
|
521
529
|
if (!t.current.value) return;
|
|
522
530
|
const i = t.current.value.x, u = t.current.value.y;
|
|
523
|
-
let
|
|
524
|
-
r.w.value && (
|
|
525
|
-
x:
|
|
526
|
-
y:
|
|
531
|
+
let v = i, d = u;
|
|
532
|
+
r.w.value && (d -= l), r.s.value && (d += l), r.a.value && (v -= l), r.d.value && (v += l), t.current.value = {
|
|
533
|
+
x: v,
|
|
534
|
+
y: d
|
|
527
535
|
};
|
|
528
536
|
},
|
|
529
537
|
onKeyboardEnd: () => {
|
|
530
538
|
t.current.value = null, t.start.value = null, t.offset.pixel.value = null, t.offset.percent.value = null;
|
|
531
539
|
}
|
|
532
540
|
};
|
|
533
|
-
},
|
|
534
|
-
const e =
|
|
541
|
+
}, be = (n) => {
|
|
542
|
+
const e = Z();
|
|
535
543
|
return {
|
|
536
544
|
onPointerStart: (s) => {
|
|
537
545
|
e.pointerPosition.start.value = { x: s.clientX, y: s.clientY }, e.pointerPosition.current.value = {
|
|
538
546
|
x: s.clientX,
|
|
539
547
|
y: s.clientY
|
|
540
548
|
};
|
|
541
|
-
const { pixel: o, percent: g } =
|
|
549
|
+
const { pixel: o, percent: g } = Ce(n.value, {
|
|
542
550
|
x: s.clientX,
|
|
543
551
|
y: s.clientY
|
|
544
552
|
});
|
|
@@ -554,133 +562,133 @@ const T = ge(() => {
|
|
|
554
562
|
e.pointerPosition.current.value = null, e.pointerPosition.start.value = null, e.pointerPosition.offset.pixel.value = null, e.pointerPosition.offset.percent.value = null;
|
|
555
563
|
}
|
|
556
564
|
};
|
|
557
|
-
},
|
|
558
|
-
var
|
|
559
|
-
const t =
|
|
565
|
+
}, Te = (n, e) => {
|
|
566
|
+
var B, X;
|
|
567
|
+
const t = Z(), { onPointerStart: r, onPointerMove: l, onPointerEnd: s } = be(n), { onKeyboardStart: o, onKeyboardMove: g, onKeyboardEnd: i } = ke(
|
|
560
568
|
n,
|
|
561
569
|
e == null ? void 0 : e.keyboard
|
|
562
570
|
);
|
|
563
571
|
let u = null;
|
|
564
|
-
const
|
|
565
|
-
var
|
|
572
|
+
const v = (h) => {
|
|
573
|
+
var z, I;
|
|
566
574
|
if (!h) return /* @__PURE__ */ new Map();
|
|
567
|
-
const
|
|
568
|
-
if (t.selectedElements.value.size > 0 &&
|
|
575
|
+
const p = t.selectedElements.value.has(h);
|
|
576
|
+
if (t.selectedElements.value.size > 0 && p) {
|
|
569
577
|
const S = /* @__PURE__ */ new Map();
|
|
570
578
|
return t.selectedElements.value.forEach((K) => {
|
|
571
|
-
var
|
|
572
|
-
const
|
|
573
|
-
|
|
574
|
-
...
|
|
575
|
-
initialHTML: ((
|
|
576
|
-
initialRect: (
|
|
579
|
+
var Y, F;
|
|
580
|
+
const O = t.elementsMap.value.get(K);
|
|
581
|
+
O && S.set(K, {
|
|
582
|
+
...O,
|
|
583
|
+
initialHTML: ((Y = O.node) == null ? void 0 : Y.outerHTML) ?? "",
|
|
584
|
+
initialRect: (F = O.node) == null ? void 0 : F.getBoundingClientRect()
|
|
577
585
|
});
|
|
578
586
|
}), S;
|
|
579
587
|
}
|
|
580
588
|
t.selectedElements.value.clear();
|
|
581
|
-
const
|
|
582
|
-
if (!
|
|
583
|
-
const
|
|
584
|
-
return
|
|
585
|
-
...
|
|
586
|
-
initialHTML: ((
|
|
587
|
-
initialRect: (
|
|
588
|
-
}),
|
|
589
|
-
},
|
|
589
|
+
const L = t.elementsMap.value.get(h);
|
|
590
|
+
if (!L) return /* @__PURE__ */ new Map();
|
|
591
|
+
const x = /* @__PURE__ */ new Map();
|
|
592
|
+
return x.set(h, {
|
|
593
|
+
...L,
|
|
594
|
+
initialHTML: ((z = L.node) == null ? void 0 : z.outerHTML) ?? "",
|
|
595
|
+
initialRect: (I = L.node) == null ? void 0 : I.getBoundingClientRect()
|
|
596
|
+
}), x;
|
|
597
|
+
}, d = (h) => {
|
|
590
598
|
if (!h)
|
|
591
599
|
return { element: null, zone: null };
|
|
592
|
-
const
|
|
593
|
-
if (!t.visibleZones.value.has(
|
|
594
|
-
const S = t.zonesMap.value.get(
|
|
595
|
-
return !(!S ||
|
|
596
|
-
(K) => K && (K === S.node ||
|
|
600
|
+
const p = Array.isArray(h) ? h : [h], L = Array.from(t.draggingElements.value.keys()), x = p.find((I) => {
|
|
601
|
+
if (!t.visibleZones.value.has(I)) return !1;
|
|
602
|
+
const S = t.zonesMap.value.get(I);
|
|
603
|
+
return !(!S || L.some(
|
|
604
|
+
(K) => K && (K === S.node || b(S.node, K))
|
|
597
605
|
) || S.groups.length && !!Array.from(
|
|
598
606
|
t.draggingElements.value.values()
|
|
599
|
-
).some((
|
|
607
|
+
).some((O) => O.groups.length ? !O.groups.some((Y) => S.groups.includes(Y)) : !1));
|
|
600
608
|
});
|
|
601
|
-
return
|
|
602
|
-
element:
|
|
603
|
-
(
|
|
604
|
-
(S) => S && (S ===
|
|
605
|
-
|
|
609
|
+
return x ? {
|
|
610
|
+
element: p.find(
|
|
611
|
+
(I) => t.visibleElements.value.has(I) && t.elementsMap.value.has(I) && !L.some(
|
|
612
|
+
(S) => S && (S === I || b(
|
|
613
|
+
I,
|
|
606
614
|
S
|
|
607
|
-
) ||
|
|
608
|
-
) && (
|
|
609
|
-
|
|
610
|
-
|
|
615
|
+
) || b(S, I))
|
|
616
|
+
) && (I === x || b(
|
|
617
|
+
I,
|
|
618
|
+
x
|
|
611
619
|
))
|
|
612
620
|
) || null,
|
|
613
|
-
zone:
|
|
621
|
+
zone: x
|
|
614
622
|
} : { element: null, zone: null };
|
|
615
|
-
}, a = ((
|
|
616
|
-
var
|
|
617
|
-
const
|
|
618
|
-
t.hovered.element.value =
|
|
619
|
-
}, f =
|
|
620
|
-
const h = a(t),
|
|
621
|
-
c(
|
|
622
|
-
}, ((
|
|
623
|
+
}, a = ((B = e == null ? void 0 : e.sensor) == null ? void 0 : B.setup) || ze, c = (h) => {
|
|
624
|
+
var I, S, K, O, Y, F, W, N, ee, te, $, ne;
|
|
625
|
+
const p = t.hovered.element.value, L = t.hovered.zone.value, x = h.element, z = h.zone;
|
|
626
|
+
t.hovered.element.value = x, t.hovered.zone.value = z, p !== x && (p && ((K = (S = (I = t.elementsMap.value.get(p)) == null ? void 0 : I.events) == null ? void 0 : S.onLeave) == null || K.call(S, t, U(t))), x && ((F = (Y = (O = t.elementsMap.value.get(x)) == null ? void 0 : O.events) == null ? void 0 : Y.onHover) == null || F.call(Y, t, U(t)))), L !== z && (L && ((ee = (N = (W = t.zonesMap.value.get(L)) == null ? void 0 : W.events) == null ? void 0 : N.onLeave) == null || ee.call(N, t, U(t))), z && ((ne = ($ = (te = t.zonesMap.value.get(z)) == null ? void 0 : te.events) == null ? void 0 : $.onHover) == null || ne.call($, t, U(t))));
|
|
627
|
+
}, f = Ae(() => {
|
|
628
|
+
const h = a(t), p = d(h);
|
|
629
|
+
c(p);
|
|
630
|
+
}, ((X = e == null ? void 0 : e.sensor) == null ? void 0 : X.throttle) ?? 0), m = () => {
|
|
623
631
|
f(), u = requestAnimationFrame(m);
|
|
624
|
-
},
|
|
632
|
+
}, E = () => m(), y = () => {
|
|
625
633
|
u !== null && (cancelAnimationFrame(u), u = null);
|
|
626
634
|
};
|
|
627
635
|
return {
|
|
628
636
|
activate: (h) => {
|
|
629
|
-
t.draggingElements.value =
|
|
630
|
-
(
|
|
631
|
-
var
|
|
632
|
-
return (
|
|
637
|
+
t.draggingElements.value = v(n.value), t.draggingElements.value.forEach(
|
|
638
|
+
(p) => {
|
|
639
|
+
var L, x;
|
|
640
|
+
return (x = (L = p.events).onStart) == null ? void 0 : x.call(L, t, U(t));
|
|
633
641
|
}
|
|
634
|
-
), h instanceof PointerEvent ? r(h) : o(h),
|
|
642
|
+
), h instanceof PointerEvent ? r(h) : o(h), E();
|
|
635
643
|
},
|
|
636
644
|
track: (h) => {
|
|
637
645
|
t.draggingElements.value.forEach(
|
|
638
|
-
(
|
|
639
|
-
var
|
|
640
|
-
return (
|
|
646
|
+
(p) => {
|
|
647
|
+
var L, x;
|
|
648
|
+
return (x = (L = p.events).onMove) == null ? void 0 : x.call(L, t, U(t));
|
|
641
649
|
}
|
|
642
650
|
), h instanceof KeyboardEvent ? g() : l(h);
|
|
643
651
|
},
|
|
644
652
|
deactivate: (h = !0) => {
|
|
645
|
-
var
|
|
653
|
+
var p, L;
|
|
646
654
|
if (s(), i(), h) {
|
|
647
655
|
if (t.hovered.zone.value) {
|
|
648
|
-
const
|
|
649
|
-
(
|
|
656
|
+
const x = t.zonesMap.value.get(t.hovered.zone.value);
|
|
657
|
+
(L = x == null ? void 0 : (p = x.events).onDrop) == null || L.call(p, t, U(t));
|
|
650
658
|
} else
|
|
651
659
|
t.draggingElements.value.forEach(
|
|
652
|
-
(
|
|
653
|
-
var
|
|
654
|
-
return (
|
|
660
|
+
(x) => {
|
|
661
|
+
var z, I;
|
|
662
|
+
return (I = (z = x.events).onEnd) == null ? void 0 : I.call(z, t, U(t));
|
|
655
663
|
}
|
|
656
664
|
);
|
|
657
665
|
t.selectedElements.value.clear();
|
|
658
666
|
}
|
|
659
|
-
t.draggingElements.value.clear(), t.hovered.zone.value = null, t.hovered.element.value = null,
|
|
667
|
+
t.draggingElements.value.clear(), t.hovered.zone.value = null, t.hovered.element.value = null, y();
|
|
660
668
|
}
|
|
661
669
|
};
|
|
662
|
-
},
|
|
670
|
+
}, Ze = ge(() => {
|
|
663
671
|
let n = "", e = "", t = "", r = null, l = null, s = null, o = null, g = null;
|
|
664
|
-
const { activeContainer: i } =
|
|
672
|
+
const { activeContainer: i } = Z(), u = () => {
|
|
665
673
|
const c = document.body;
|
|
666
674
|
n = c.style.userSelect, c.style.userSelect = "none", window.addEventListener("contextmenu", C), window.addEventListener("selectstart", C), window.addEventListener("touchstart", C), window.addEventListener("touchmove", C);
|
|
667
|
-
},
|
|
675
|
+
}, v = () => {
|
|
668
676
|
const c = document.body;
|
|
669
677
|
c.style.userSelect = n, c.style.touchAction = e, c.style.overscrollBehavior = t, window.removeEventListener("contextmenu", C), window.removeEventListener("selectstart", C), window.removeEventListener("touchstart", C), window.removeEventListener("touchmove", C);
|
|
670
|
-
},
|
|
678
|
+
}, d = () => {
|
|
671
679
|
r && (document.removeEventListener("pointermove", r), r = null), l && (document.removeEventListener("pointerup", l), l = null), s && (s = null), o && (document.removeEventListener("wheel", o), o = null), g && (document.removeEventListener("keydown", g), document.removeEventListener("keypress", g), document.removeEventListener("keyup", g), g = null);
|
|
672
680
|
};
|
|
673
681
|
return {
|
|
674
682
|
handleDragStart: (c, f, m) => {
|
|
675
|
-
|
|
676
|
-
const { activate:
|
|
683
|
+
d(), c.target.blur(), m != null && m.container && (i.component.value = m.container);
|
|
684
|
+
const { activate: E, track: y, deactivate: A } = Te(f, m);
|
|
677
685
|
l = () => {
|
|
678
|
-
i.component.value = null,
|
|
686
|
+
i.component.value = null, v(), A(!0), d();
|
|
679
687
|
}, s = () => {
|
|
680
|
-
i.component.value = null,
|
|
681
|
-
}, r = (
|
|
682
|
-
|
|
683
|
-
}, u(),
|
|
688
|
+
i.component.value = null, v(), A(!1), d();
|
|
689
|
+
}, r = (P) => y(P), o = (P) => y(P), g = (P) => {
|
|
690
|
+
P.type === "keyup" && (P.code === "Escape" && (s == null || s()), P.code === "Enter" && (l == null || l())), y(P);
|
|
691
|
+
}, u(), E(c), document.addEventListener("pointermove", r), document.addEventListener("pointerup", l), document.addEventListener("wheel", o), document.addEventListener("keydown", g), document.addEventListener("keypress", g), document.addEventListener("keyup", g);
|
|
684
692
|
}
|
|
685
693
|
};
|
|
686
694
|
}), He = (n) => {
|
|
@@ -692,28 +700,28 @@ const T = ge(() => {
|
|
|
692
700
|
isAllowed: s,
|
|
693
701
|
registerElement: o,
|
|
694
702
|
unregisterElement: g
|
|
695
|
-
} =
|
|
703
|
+
} = De(n), { pointerPosition: i } = Z(), { handleDragStart: u } = Ze(), v = (d) => u(d, t, n);
|
|
696
704
|
return Q(o), fe(g), {
|
|
697
705
|
pointerPosition: i,
|
|
698
706
|
elementRef: t,
|
|
699
707
|
isDragging: r,
|
|
700
708
|
isOvered: l,
|
|
701
709
|
isAllowed: s,
|
|
702
|
-
handleDragStart:
|
|
710
|
+
handleDragStart: v,
|
|
703
711
|
id: e
|
|
704
712
|
};
|
|
705
|
-
},
|
|
713
|
+
}, Ke = (n) => {
|
|
706
714
|
const {
|
|
707
715
|
zonesMap: e,
|
|
708
716
|
hovered: t,
|
|
709
717
|
draggingElements: r,
|
|
710
718
|
isDragging: l,
|
|
711
719
|
handleDropZoneIntersection: s
|
|
712
|
-
} =
|
|
720
|
+
} = Z(), o = V(null), g = T(() => t.zone.value === o.value), i = T(() => {
|
|
713
721
|
if (!o.value || !l.value) return !1;
|
|
714
|
-
const
|
|
715
|
-
return
|
|
716
|
-
(c) =>
|
|
722
|
+
const d = e.value.get(o.value);
|
|
723
|
+
return d != null && d.groups.length ? !Array.from(r.value.values()).some((a) => a.groups.length ? !a.groups.some(
|
|
724
|
+
(c) => d.groups.includes(c)
|
|
717
725
|
) : !1) : !0;
|
|
718
726
|
});
|
|
719
727
|
return { elementRef: o, registerZone: () => {
|
|
@@ -727,22 +735,22 @@ const T = ge(() => {
|
|
|
727
735
|
}, unregisterZone: () => {
|
|
728
736
|
o.value && (s("remove", o.value), e.value.delete(o.value));
|
|
729
737
|
}, isOvered: g, isAllowed: i };
|
|
730
|
-
},
|
|
731
|
-
const { elementRef: e, registerZone: t, unregisterZone: r, isOvered: l, isAllowed: s } =
|
|
738
|
+
}, Re = (n) => {
|
|
739
|
+
const { elementRef: e, registerZone: t, unregisterZone: r, isOvered: l, isAllowed: s } = Ke(n);
|
|
732
740
|
return Q(t), fe(r), { elementRef: e, isOvered: l, isAllowed: s };
|
|
733
|
-
},
|
|
734
|
-
const { selectedElements: e, elementsMap: t } =
|
|
741
|
+
}, Be = (n) => {
|
|
742
|
+
const { selectedElements: e, elementsMap: t } = Z(), r = T(
|
|
735
743
|
() => n.value ? e.value.has(n.value) : !1
|
|
736
|
-
), l =
|
|
744
|
+
), l = T(() => {
|
|
737
745
|
if (!n.value) return !1;
|
|
738
746
|
for (const u of e.value)
|
|
739
|
-
if (u &&
|
|
747
|
+
if (u && b(u, n.value))
|
|
740
748
|
return !0;
|
|
741
749
|
return !1;
|
|
742
|
-
}), s =
|
|
750
|
+
}), s = T(() => {
|
|
743
751
|
if (!n.value) return !1;
|
|
744
752
|
for (const u of e.value)
|
|
745
|
-
if (u &&
|
|
753
|
+
if (u && b(n.value, u))
|
|
746
754
|
return !0;
|
|
747
755
|
return !1;
|
|
748
756
|
}), o = () => {
|
|
@@ -750,11 +758,11 @@ const T = ge(() => {
|
|
|
750
758
|
}, g = () => {
|
|
751
759
|
if (!(!n.value || !t.value.get(n.value))) {
|
|
752
760
|
if (l.value)
|
|
753
|
-
for (const
|
|
754
|
-
|
|
761
|
+
for (const v of e.value)
|
|
762
|
+
v && b(v, n.value) && e.value.delete(v);
|
|
755
763
|
if (s.value)
|
|
756
|
-
for (const
|
|
757
|
-
|
|
764
|
+
for (const v of e.value)
|
|
765
|
+
v && b(n.value, v) && e.value.delete(v);
|
|
758
766
|
e.value.add(n.value);
|
|
759
767
|
}
|
|
760
768
|
};
|
|
@@ -771,11 +779,11 @@ const T = ge(() => {
|
|
|
771
779
|
export {
|
|
772
780
|
se as DnDOperations,
|
|
773
781
|
Ue as default,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
782
|
+
R as getBoundingBox,
|
|
783
|
+
Z as useDnDStore,
|
|
784
|
+
Ie as useDragContainer,
|
|
777
785
|
He as useDraggable,
|
|
778
|
-
|
|
779
|
-
|
|
786
|
+
Re as useDroppable,
|
|
787
|
+
Be as useSelection
|
|
780
788
|
};
|
|
781
789
|
//# sourceMappingURL=vue-dnd-kit-core.es.js.map
|