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