fluid-dnd 1.2.0-beta.0 → 1.2.1-beta.0
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/{HandlerPublisher-BrFNCUjc.js → HandlerPublisher-CIc7wXW-.js} +1 -1
- package/dist/{HandlerPublisher-DIbGFZTl.cjs → HandlerPublisher-DiGO5iOY.cjs} +1 -1
- package/dist/core/dragAndDrop.d.ts +1 -1
- package/dist/index/index.cjs +1 -1
- package/dist/index/index.mjs +1 -1
- package/dist/index-BDu6-Hq8.js +1283 -0
- package/dist/index-Tde6DOzb.cjs +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.mjs +12 -12
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.mjs +2 -2
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/index-_CLUJ2Ve.cjs +0 -1
- package/dist/index-ekBJgYrv.js +0 -1281
package/dist/index-ekBJgYrv.js
DELETED
@@ -1,1281 +0,0 @@
|
|
1
|
-
var Se = Object.defineProperty;
|
2
|
-
var De = (e, t, n) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
-
var k = (e, t, n) => De(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
-
const Q = "draggable", It = "droppable", Ot = "handler-class", Ht = "dragging", Yt = "dragging-handler-class", Wt = "dropping", se = "grabbing", ve = "grab", Zt = "disable-transition", et = (e, t) => e.classList.contains(t), bt = (e, t, n = !1) => {
|
5
|
-
e.classList.toggle(t, n);
|
6
|
-
}, nt = (e, t) => {
|
7
|
-
e.classList.add(t);
|
8
|
-
}, Ct = (e, t) => {
|
9
|
-
e.classList.remove(t);
|
10
|
-
}, be = (e, t) => yt(t).every(
|
11
|
-
(n) => et(e, n)
|
12
|
-
), gt = (e) => e ? `.${yt(e).join(".")}` : "", Te = (e, t) => {
|
13
|
-
if (!t)
|
14
|
-
return;
|
15
|
-
const n = yt(t);
|
16
|
-
e.classList.add(...n);
|
17
|
-
}, yt = (e) => e ? e.split(" ").filter((t) => t) : [], _ = "horizontal", U = "vertical", Ee = () => {
|
18
|
-
const { scrollX: e, scrollY: t } = window;
|
19
|
-
return { scrollX: e, scrollY: t };
|
20
|
-
}, qt = (e) => !e || e.trim().length == 0 || e == "normal" ? 0 : parseFloat(e), Ce = (e) => e ? parseInt(e) : -1, ye = (e) => {
|
21
|
-
const t = getComputedStyle(e), n = new DOMMatrixReadOnly(t.transform);
|
22
|
-
return {
|
23
|
-
x: n.m41,
|
24
|
-
y: n.m42
|
25
|
-
};
|
26
|
-
}, oe = (e, t) => e.x1 > t.x1 ? oe(t, e) : e.x2 < t.x1 ? 0 : e.x2 >= t.x2 ? e.x2 - e.x1 : e.x2 - t.x1, pt = (e, t) => !Ae(e, t), Ae = (e, t) => {
|
27
|
-
const n = Mt(e), s = Mt(t), o = Jt(n, s, U), r = Jt(n, s, _);
|
28
|
-
return o >= Math.min(n.height, s.height) / 2 && r >= Math.min(n.width, s.width) / 2;
|
29
|
-
}, Jt = (e, t, n) => {
|
30
|
-
const { before: s, distance: o } = w(n);
|
31
|
-
return oe(
|
32
|
-
{
|
33
|
-
x1: e[s],
|
34
|
-
x2: e[s] + e[o]
|
35
|
-
},
|
36
|
-
{
|
37
|
-
x1: t[s],
|
38
|
-
x2: t[s] + t[o]
|
39
|
-
}
|
40
|
-
);
|
41
|
-
}, L = (e, t) => e ? qt(getComputedStyle(e)[t]) : 0, Kt = (e) => {
|
42
|
-
const { scrollLeft: t, scrollTop: n } = e;
|
43
|
-
return { scrollLeft: t, scrollTop: n };
|
44
|
-
}, Mt = (e) => e.getBoundingClientRect(), w = (e) => {
|
45
|
-
const t = e == _;
|
46
|
-
return {
|
47
|
-
beforeMargin: t ? "marginLeft" : "marginTop",
|
48
|
-
afterMargin: t ? "marginRight" : "marginBottom",
|
49
|
-
borderBeforeWidth: t ? "borderLeftWidth" : "borderTopWidth",
|
50
|
-
before: t ? "left" : "top",
|
51
|
-
after: t ? "right" : "down",
|
52
|
-
gap: t ? "columnGap" : "rowGap",
|
53
|
-
distance: t ? "width" : "height",
|
54
|
-
axis: t ? "x" : "y",
|
55
|
-
offset: t ? "offsetX" : "offsetY",
|
56
|
-
scroll: t ? "scrollX" : "scrollY",
|
57
|
-
scrollElement: t ? "scrollLeft" : "scrollTop",
|
58
|
-
page: t ? "pageX" : "pageY",
|
59
|
-
inner: t ? "innerWidth" : "innerHeight",
|
60
|
-
offsetElement: t ? "offsetLeft" : "offsetTop",
|
61
|
-
scrollDistance: t ? "scrollWidth" : "scrollHeight",
|
62
|
-
clientDistance: t ? "clientWidth" : "clientHeight",
|
63
|
-
paddingBefore: t ? "paddingLeft" : "paddingTop",
|
64
|
-
getRect: Mt
|
65
|
-
};
|
66
|
-
}, Rt = (e, t) => xe(e, t), re = (e) => [...e.children].filter(
|
67
|
-
(n) => et(n, Q)
|
68
|
-
), xe = (e, t) => {
|
69
|
-
const n = [...t.children].filter(
|
70
|
-
(o) => et(o, Q) && !o.isEqualNode(e)
|
71
|
-
).toReversed(), s = [...t.children].findLastIndex(
|
72
|
-
(o) => o.isEqualNode(e)
|
73
|
-
);
|
74
|
-
return [
|
75
|
-
n,
|
76
|
-
s,
|
77
|
-
t
|
78
|
-
];
|
79
|
-
}, we = (e) => {
|
80
|
-
let t = e.parentElement;
|
81
|
-
for (; t; ) {
|
82
|
-
if (window.getComputedStyle(t).position === "fixed")
|
83
|
-
return t;
|
84
|
-
t = t.parentElement;
|
85
|
-
}
|
86
|
-
return null;
|
87
|
-
}, ie = (e, t) => {
|
88
|
-
const {
|
89
|
-
before: n,
|
90
|
-
borderBeforeWidth: s
|
91
|
-
} = w(t), o = we(e);
|
92
|
-
return o ? Mt(o)[n] + L(o, s) : 0;
|
93
|
-
}, Xt = (e) => window.TouchEvent && e instanceof TouchEvent, it = (e) => e instanceof HTMLElement, ce = (e) => e instanceof MouseEvent, Be = ["onmouseup", "onmousedown", "onmousemove"], Re = (e, t, n) => {
|
94
|
-
e && (e.style.height = `${t}px`, e.style.width = `${n}px`);
|
95
|
-
}, Tt = (e, t, n) => {
|
96
|
-
!e || !it(e) || (n == 0 && t == 0 ? e.style.transform = "" : e.style.transform = `translate(${n}px,${t}px)`);
|
97
|
-
}, Le = (e, t, n) => {
|
98
|
-
e[t] = (s) => {
|
99
|
-
if (s.defaultPrevented)
|
100
|
-
return;
|
101
|
-
const o = Vt(s);
|
102
|
-
n(o);
|
103
|
-
};
|
104
|
-
}, $t = (e, t, n) => {
|
105
|
-
n && (Oe(t) ? e[t] = n : Le(e, t, n));
|
106
|
-
}, Oe = (e) => Be.includes(e), Me = (e) => {
|
107
|
-
const { target: t } = e;
|
108
|
-
return {
|
109
|
-
clientX: 0,
|
110
|
-
clientY: 0,
|
111
|
-
pageX: 0,
|
112
|
-
pageY: 0,
|
113
|
-
screenX: 0,
|
114
|
-
screenY: 0,
|
115
|
-
target: t,
|
116
|
-
offsetX: 0,
|
117
|
-
offsetY: 0
|
118
|
-
};
|
119
|
-
}, Ne = (e, t) => {
|
120
|
-
const n = (s, o) => Pe(t, window, o, s);
|
121
|
-
if (ce(e)) {
|
122
|
-
const { offsetX: s, offsetY: o } = e;
|
123
|
-
return [s, o];
|
124
|
-
} else {
|
125
|
-
const s = e.target;
|
126
|
-
return [
|
127
|
-
n(s, _),
|
128
|
-
n(s, U)
|
129
|
-
];
|
130
|
-
}
|
131
|
-
}, Vt = (e) => {
|
132
|
-
const t = Fe(e);
|
133
|
-
if (!t)
|
134
|
-
return Me(e);
|
135
|
-
const [n, s] = Ne(e, t), { clientX: o, clientY: r, pageX: c, pageY: l, screenX: u, screenY: d, target: m } = t;
|
136
|
-
return {
|
137
|
-
clientX: o,
|
138
|
-
clientY: r,
|
139
|
-
pageX: c,
|
140
|
-
pageY: l,
|
141
|
-
screenX: u,
|
142
|
-
screenY: d,
|
143
|
-
target: m,
|
144
|
-
offsetX: n,
|
145
|
-
offsetY: s
|
146
|
-
};
|
147
|
-
}, Fe = (e) => {
|
148
|
-
if (Xt(e))
|
149
|
-
return e.touches[0] ?? e.changedTouches[0];
|
150
|
-
if (ce(e))
|
151
|
-
return e;
|
152
|
-
}, Pe = (e, t, n, s) => {
|
153
|
-
const { page: o, scroll: r, before: c, borderBeforeWidth: l, getRect: u } = w(n), d = u(s);
|
154
|
-
return e[o] - t[r] - d[c] - L(s, l);
|
155
|
-
}, Ft = (e, t, n = "ease-out", s = "transform") => {
|
156
|
-
it(e) && (e.style.transitionDuration = `${t}ms`, e.style.transitionTimingFunction = `${n}`, e.style.transitionProperty = `${s}`);
|
157
|
-
}, ae = (e, t, n) => {
|
158
|
-
!e || !it(e) || (e[t] = () => {
|
159
|
-
n();
|
160
|
-
});
|
161
|
-
}, $e = (e) => {
|
162
|
-
var t = e.querySelector("style");
|
163
|
-
if (!t) {
|
164
|
-
var n = document.createElement("style");
|
165
|
-
return e.appendChild(n), n;
|
166
|
-
}
|
167
|
-
return t;
|
168
|
-
}, Ge = (e, t) => {
|
169
|
-
const n = /\.-?[_a-zA-Z0-9-*\s<>():]+/g, [s] = t.match(n) || [];
|
170
|
-
for (const o of e.cssRules) {
|
171
|
-
const [r] = o.cssText.match(n) || [];
|
172
|
-
if (s === r)
|
173
|
-
return !0;
|
174
|
-
}
|
175
|
-
return !1;
|
176
|
-
}, Ie = (e, t) => {
|
177
|
-
t.forEach((n) => {
|
178
|
-
Ye(e, n);
|
179
|
-
});
|
180
|
-
}, Ye = (e, t) => {
|
181
|
-
var s;
|
182
|
-
var n = $e(e);
|
183
|
-
n.sheet && (Ge(n.sheet, t) || (s = n.sheet) == null || s.insertRule(t, n.sheet.cssRules.length));
|
184
|
-
}, le = (e, t = {}) => {
|
185
|
-
for (const n of Object.keys(t)) {
|
186
|
-
const s = t[n];
|
187
|
-
s != null && We(e, `--${n}`, s);
|
188
|
-
}
|
189
|
-
}, We = (e, t, n) => e && e.style.setProperty(t, n), ue = "startDrag", Nt = "drag", zt = "startDrop", Xe = "drop", at = "temp-child", fe = "cubic-bezier(0.2, 0, 0, 1)", Ve = (e) => e === Xe || e === zt, _t = (e) => !e || e.length == 0 ? 0 : qt(e.replace("px", "")), _e = (e, t) => {
|
190
|
-
const n = getComputedStyle(e)[t];
|
191
|
-
if (n.match("%")) {
|
192
|
-
const o = qt(n.replace("%", "")), { width: r } = e.getBoundingClientRect();
|
193
|
-
return r * (o / 100);
|
194
|
-
}
|
195
|
-
return _t(n);
|
196
|
-
}, jt = (e, t) => {
|
197
|
-
if (!(e instanceof Element))
|
198
|
-
return [
|
199
|
-
0,
|
200
|
-
!1
|
201
|
-
];
|
202
|
-
const n = _e(e, t), s = getComputedStyle(e).display, o = n > 0 || s === "flex";
|
203
|
-
return [n, o];
|
204
|
-
}, He = (e) => {
|
205
|
-
const { top: t, left: n } = getComputedStyle(e);
|
206
|
-
return [_t(t), _t(n)];
|
207
|
-
}, qe = (e, t) => {
|
208
|
-
const { gap: n } = w(t), [s, o] = jt(e, n);
|
209
|
-
return o ? s : 0;
|
210
|
-
};
|
211
|
-
function Et(e, t, n, s, o = e.previousElementSibling, r = e.nextElementSibling) {
|
212
|
-
let { height: c, width: l } = ze(
|
213
|
-
n,
|
214
|
-
e,
|
215
|
-
o,
|
216
|
-
r
|
217
|
-
);
|
218
|
-
return pt(e, s) && t == Nt && (c = 0, l = 0), { height: c, width: l };
|
219
|
-
}
|
220
|
-
const ze = (e, t, n, s) => {
|
221
|
-
const {
|
222
|
-
afterMargin: o,
|
223
|
-
beforeMargin: r,
|
224
|
-
distance: c,
|
225
|
-
gap: l,
|
226
|
-
getRect: u
|
227
|
-
} = w(e), d = L(t, o), m = L(t, r), v = L(s, r), [B, O] = jt(
|
228
|
-
t.parentElement,
|
229
|
-
l
|
230
|
-
), F = u(t)[c];
|
231
|
-
if (O)
|
232
|
-
return Qt(F, m, d, B, 0, e);
|
233
|
-
const [h, S, y] = je(
|
234
|
-
n,
|
235
|
-
v,
|
236
|
-
d,
|
237
|
-
m,
|
238
|
-
o
|
239
|
-
);
|
240
|
-
return Qt(F, S, h, 0, y, e);
|
241
|
-
}, je = (e, t, n, s, o) => {
|
242
|
-
const r = Math.max(t, n);
|
243
|
-
let c = s, l = t;
|
244
|
-
if (e) {
|
245
|
-
const u = L(
|
246
|
-
e,
|
247
|
-
o
|
248
|
-
);
|
249
|
-
c = Math.max(u, s), l = Math.max(l, u);
|
250
|
-
}
|
251
|
-
return [r, c, l];
|
252
|
-
}, Qt = (e, t, n, s, o, r) => ke(r, e + t + n + s - o), ke = (e, t) => e == _ ? { width: t, height: 0 } : { width: 0, height: t }, Ut = (e, t) => {
|
253
|
-
const {
|
254
|
-
borderBeforeWidth: n,
|
255
|
-
paddingBefore: s,
|
256
|
-
axis: o,
|
257
|
-
getRect: r
|
258
|
-
} = w(e), c = L(t, n), l = L(t, s), u = r(t)[o];
|
259
|
-
return c + l + u;
|
260
|
-
}, Ze = (e, t) => {
|
261
|
-
const [n, s] = He(t), o = Ut(U, e);
|
262
|
-
return [
|
263
|
-
Ut(_, e) - s,
|
264
|
-
o - n
|
265
|
-
];
|
266
|
-
};
|
267
|
-
function Je(e, t, n, s, o, r, c, l, u) {
|
268
|
-
let d = 0, m = 0;
|
269
|
-
const v = !!(n < 0 && u);
|
270
|
-
if (n === s && !v)
|
271
|
-
return te(
|
272
|
-
{ height: d, width: m },
|
273
|
-
e,
|
274
|
-
o,
|
275
|
-
c,
|
276
|
-
v
|
277
|
-
);
|
278
|
-
const [B, O, F, h] = Ue(t, n, s, u);
|
279
|
-
if (v) {
|
280
|
-
const [tt, ot] = Ze(l, u);
|
281
|
-
d += ot, m += tt;
|
282
|
-
}
|
283
|
-
const {
|
284
|
-
scrollElement: S,
|
285
|
-
beforeMargin: y,
|
286
|
-
afterMargin: R,
|
287
|
-
distance: I,
|
288
|
-
gap: Y
|
289
|
-
} = w(e), [W, P] = jt(l, Y), [
|
290
|
-
st,
|
291
|
-
H,
|
292
|
-
N
|
293
|
-
] = en(
|
294
|
-
y,
|
295
|
-
R,
|
296
|
-
B,
|
297
|
-
O == null ? void 0 : O.previousElementSibling,
|
298
|
-
h,
|
299
|
-
P,
|
300
|
-
v
|
301
|
-
), [Z, q, z] = tn(
|
302
|
-
y,
|
303
|
-
R,
|
304
|
-
I,
|
305
|
-
F,
|
306
|
-
W,
|
307
|
-
P
|
308
|
-
), X = Qe(
|
309
|
-
q,
|
310
|
-
Z,
|
311
|
-
z,
|
312
|
-
H,
|
313
|
-
st,
|
314
|
-
W
|
315
|
-
), j = v ? l[S] : Ke(S, l, r), $ = (h ? X - N : N - X) - j;
|
316
|
-
return e === U ? d += $ : e === _ && (m += $), te(
|
317
|
-
{ height: d, width: m },
|
318
|
-
e,
|
319
|
-
o,
|
320
|
-
c,
|
321
|
-
v
|
322
|
-
);
|
323
|
-
}
|
324
|
-
const Ke = (e, t, n) => {
|
325
|
-
const s = t[e], o = n[e];
|
326
|
-
return s - o;
|
327
|
-
}, Qe = (e, t, n, s, o, r) => {
|
328
|
-
const c = Math.max(t, o);
|
329
|
-
return Math.max(n, s) + e + c + r;
|
330
|
-
}, Ue = (e, t, n, s) => {
|
331
|
-
const o = t < n, [r, c] = [t, n].toSorted(
|
332
|
-
(m, v) => m - v
|
333
|
-
), l = e[t] ?? s, u = e[n];
|
334
|
-
let d = o ? e.slice(r + 1, c + 1) : e.slice(r, c);
|
335
|
-
return r < 0 && s && (d = e.slice(r + 1, c)), [
|
336
|
-
l,
|
337
|
-
u,
|
338
|
-
d,
|
339
|
-
o
|
340
|
-
];
|
341
|
-
}, tn = (e, t, n, s, o, r) => {
|
342
|
-
if (s.length == 0)
|
343
|
-
return [0, 0, 0];
|
344
|
-
const c = L(s[0], e);
|
345
|
-
let l = 0, u = -c;
|
346
|
-
for (const [d, m] of s.entries()) {
|
347
|
-
const v = m.getBoundingClientRect()[n], B = L(m, e);
|
348
|
-
r && (l += B), r && d > 0 ? l += o : l = Math.max(l, B), u += l + v, l = L(m, t);
|
349
|
-
}
|
350
|
-
return [c, u, l];
|
351
|
-
}, te = (e, t, n, s, o) => {
|
352
|
-
const { scroll: r, distance: c } = w(t), l = window[r], u = n[r], d = o ? 0 : u - 2 * l + s[r];
|
353
|
-
return e[c] += d, e;
|
354
|
-
}, en = (e, t, n, s, o, r, c) => {
|
355
|
-
const l = o ? n.previousElementSibling : s;
|
356
|
-
return nn(
|
357
|
-
e,
|
358
|
-
t,
|
359
|
-
l,
|
360
|
-
n,
|
361
|
-
r,
|
362
|
-
c
|
363
|
-
);
|
364
|
-
}, nn = (e, t, n, s, o, r) => {
|
365
|
-
if (o)
|
366
|
-
return [0, 0, 0];
|
367
|
-
const c = L(
|
368
|
-
r ? null : n,
|
369
|
-
t
|
370
|
-
), l = L(s, e);
|
371
|
-
let u = Math.max(c, l);
|
372
|
-
return [c, l, u];
|
373
|
-
}, kt = (e, t, n, s = () => !0) => {
|
374
|
-
const o = new MutationObserver((r) => {
|
375
|
-
if (r = r.filter(s), r.length > 0) {
|
376
|
-
const c = r[0];
|
377
|
-
e(o, c);
|
378
|
-
}
|
379
|
-
});
|
380
|
-
return o.observe(t, n), o;
|
381
|
-
}, sn = (e, t, n) => {
|
382
|
-
n != 0 && (t === "vertical" ? e.scrollBy(0, n) : e.scrollBy(n, 0));
|
383
|
-
}, on = (e, t, n) => {
|
384
|
-
const { scrollDistance: s, clientDistance: o, scrollElement: r } = w(e);
|
385
|
-
return n[r] / (t[s] - t[o]);
|
386
|
-
}, rn = "startDrag", de = "cubic-bezier(0.2, 0, 0, 1)", ge = 50, ee = (e) => it(e) ? e.classList.contains(at) : !1, cn = (e, t, n) => {
|
387
|
-
let s = Et(
|
388
|
-
t,
|
389
|
-
rn,
|
390
|
-
n,
|
391
|
-
e
|
392
|
-
);
|
393
|
-
const o = qe(e, n), { distance: r } = w(n);
|
394
|
-
s[r] -= o;
|
395
|
-
const [c, l] = an(n, t);
|
396
|
-
return s[l] = c, s;
|
397
|
-
}, an = (e, t) => {
|
398
|
-
const n = e == _ ? U : _, { distance: s, getRect: o } = w(n);
|
399
|
-
return [
|
400
|
-
o(t)[s],
|
401
|
-
s
|
402
|
-
];
|
403
|
-
}, ht = (e, t, n) => {
|
404
|
-
Re(e, t, n), e.style.minWidth = `${n}px`;
|
405
|
-
}, ln = (e, t, n) => (s) => {
|
406
|
-
t.contains(e) && (ht(e, n.height, n.width), s.disconnect());
|
407
|
-
}, un = (e, t) => {
|
408
|
-
if (!t)
|
409
|
-
return;
|
410
|
-
const { droppable: n, config: s, scroll: o } = e, { direction: r } = s, c = on(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: u, scrollElement: d } = w(r);
|
411
|
-
c && (n[d] = n[l] - n[u]);
|
412
|
-
}, pe = (e, t, n, s) => {
|
413
|
-
if (!n)
|
414
|
-
return;
|
415
|
-
const { droppable: o, config: r } = n, { direction: c, animationDuration: l } = r;
|
416
|
-
if (un(n, t), o.querySelector(`.${at}`) || !e)
|
417
|
-
return;
|
418
|
-
var u = e.tagName == "LI" ? "DIV" : e.tagName, d = document.createElement(u);
|
419
|
-
nt(d, at), ht(d, 0, 0);
|
420
|
-
const m = cn(o, e, c);
|
421
|
-
return Ft(
|
422
|
-
d,
|
423
|
-
l,
|
424
|
-
de,
|
425
|
-
"width, min-width, height"
|
426
|
-
), [d, m, o];
|
427
|
-
}, Gt = (e, t, n, s, o) => {
|
428
|
-
const r = pe(e, n, s);
|
429
|
-
if (!r)
|
430
|
-
return;
|
431
|
-
const [c, l, u] = r;
|
432
|
-
t.isSameNode(u) && ht(c, l.height, l.width), kt(
|
433
|
-
ln(c, u, l),
|
434
|
-
u,
|
435
|
-
{
|
436
|
-
childList: !0,
|
437
|
-
subtree: !0
|
438
|
-
}
|
439
|
-
), u.appendChild(c);
|
440
|
-
}, fn = (e, t, n) => {
|
441
|
-
const s = pe(e, t, n);
|
442
|
-
if (!s)
|
443
|
-
return;
|
444
|
-
const [o, r, c] = s;
|
445
|
-
c.appendChild(o), dn(o, r);
|
446
|
-
}, dn = (e, t) => requestAnimationFrame(() => {
|
447
|
-
ht(e, t.height, t.width), requestAnimationFrame(() => {
|
448
|
-
Ft(
|
449
|
-
e,
|
450
|
-
0,
|
451
|
-
de,
|
452
|
-
"width, min-width, height"
|
453
|
-
);
|
454
|
-
});
|
455
|
-
}), gn = (e, t, n, s, o = !0) => {
|
456
|
-
if (n) {
|
457
|
-
var r = document.querySelectorAll(
|
458
|
-
`${gt(n)} > .${at}`
|
459
|
-
);
|
460
|
-
r.forEach((c) => {
|
461
|
-
const l = c.parentElement;
|
462
|
-
if (l != null && l.isSameNode(t) || !o && (l != null && l.isSameNode(e)))
|
463
|
-
return;
|
464
|
-
ht(c, 0, 0), setTimeout(() => {
|
465
|
-
var d;
|
466
|
-
(d = c.parentNode) == null || d.removeChild(c);
|
467
|
-
}, s + ge);
|
468
|
-
});
|
469
|
-
}
|
470
|
-
}, vt = (e, t, n = !1) => {
|
471
|
-
var s = e.querySelectorAll(`.${at}`);
|
472
|
-
s.forEach((o) => {
|
473
|
-
const r = o;
|
474
|
-
n ? (ht(r, 0, 0), setTimeout(() => {
|
475
|
-
e.contains(r) && e.removeChild(r);
|
476
|
-
}, t + ge)) : e.removeChild(o);
|
477
|
-
});
|
478
|
-
}, pn = 50;
|
479
|
-
function hn(e, t, n, s, o, r) {
|
480
|
-
let c = t;
|
481
|
-
const {
|
482
|
-
direction: l,
|
483
|
-
handlerSelector: u,
|
484
|
-
onRemoveAtEvent: d,
|
485
|
-
animationDuration: m,
|
486
|
-
delayBeforeInsert: v,
|
487
|
-
draggingClass: B
|
488
|
-
} = e, O = (i, f, g, D, C) => {
|
489
|
-
if (!D)
|
490
|
-
return;
|
491
|
-
const { droppable: b, config: T } = D, A = Et(
|
492
|
-
i,
|
493
|
-
f,
|
494
|
-
T.direction,
|
495
|
-
b
|
496
|
-
);
|
497
|
-
Ve(f) ? P(
|
498
|
-
i,
|
499
|
-
f,
|
500
|
-
A,
|
501
|
-
g,
|
502
|
-
D,
|
503
|
-
C
|
504
|
-
) : y(
|
505
|
-
i,
|
506
|
-
f,
|
507
|
-
A,
|
508
|
-
D
|
509
|
-
);
|
510
|
-
}, F = (i, f, g, D, C) => {
|
511
|
-
const b = Et(
|
512
|
-
f,
|
513
|
-
"insert",
|
514
|
-
e.direction,
|
515
|
-
g
|
516
|
-
), { onInsertEvent: T } = e, A = re(g);
|
517
|
-
for (const [M, x] of A.entries())
|
518
|
-
et(x, Q) && M >= i && W(x, b);
|
519
|
-
C(), setTimeout(() => {
|
520
|
-
T(i, D), he(i, g, e), tt(f), V(f, n), vt(n, 0, !0);
|
521
|
-
}, v);
|
522
|
-
}, h = (i, f, g, D) => {
|
523
|
-
if (!g || !g.droppable || !g.config)
|
524
|
-
return;
|
525
|
-
const { droppable: C, config: b } = g;
|
526
|
-
let [T] = Rt(f, C);
|
527
|
-
T = [f, ...T].toReversed();
|
528
|
-
const A = Et(
|
529
|
-
f,
|
530
|
-
"remove",
|
531
|
-
b.direction,
|
532
|
-
C
|
533
|
-
);
|
534
|
-
for (const [M, x] of T.entries())
|
535
|
-
M >= i && (Y(x, A), setTimeout(() => {
|
536
|
-
D(x);
|
537
|
-
}, m));
|
538
|
-
}, S = (i) => {
|
539
|
-
vt(n, m, !0), setTimeout(() => {
|
540
|
-
tt(i), V(i, n);
|
541
|
-
}, m);
|
542
|
-
}, y = (i, f, g, D) => {
|
543
|
-
const { config: C, droppable: b } = D, [T] = Rt(i, b), A = pt(i, b);
|
544
|
-
T.length == 0 && I(
|
545
|
-
g,
|
546
|
-
1,
|
547
|
-
C.direction,
|
548
|
-
T
|
549
|
-
);
|
550
|
-
for (const [M, x] of T.entries()) {
|
551
|
-
if (!et(x, Q))
|
552
|
-
continue;
|
553
|
-
const G = R(
|
554
|
-
C.direction,
|
555
|
-
i,
|
556
|
-
x,
|
557
|
-
g
|
558
|
-
);
|
559
|
-
if (!A && G)
|
560
|
-
g = G;
|
561
|
-
else if (!A)
|
562
|
-
continue;
|
563
|
-
const J = T.length - M;
|
564
|
-
I(
|
565
|
-
g,
|
566
|
-
J,
|
567
|
-
C.direction,
|
568
|
-
T
|
569
|
-
), f === ue ? Y(x, g) : f === Nt && W(x, g);
|
570
|
-
}
|
571
|
-
}, R = (i, f, g, D) => {
|
572
|
-
const { before: C, distance: b, axis: T, getRect: A } = w(i), M = A(f), x = A(g), G = M[C], J = x[C], ft = x[b], mt = J + ft / 2, St = ye(g)[T], ct = mt - St;
|
573
|
-
return G > ct ? { height: 0, width: 0 } : D;
|
574
|
-
}, I = (i, f, g, D) => {
|
575
|
-
const C = D.filter(
|
576
|
-
(T) => et(T, Q)
|
577
|
-
).length, { distance: b } = w(g);
|
578
|
-
i[b] == 0 ? c = Math.max(c, f) : c = Math.min(c, f - 1), c = Math.min(c, C);
|
579
|
-
}, Y = (i, f) => {
|
580
|
-
const { width: g, height: D } = f;
|
581
|
-
Tt(i, D, g);
|
582
|
-
}, W = (i, f) => {
|
583
|
-
const { width: g, height: D } = f;
|
584
|
-
Tt(i, D, g), Ft(i, m, fe);
|
585
|
-
}, P = (i, f, g, D, C, b) => {
|
586
|
-
const { droppable: T, scroll: A, config: M } = C, [x, G] = Rt(
|
587
|
-
i,
|
588
|
-
T
|
589
|
-
), J = x.toReversed(), ft = G === -1 ? J.length : G;
|
590
|
-
J.splice(ft, 0, i);
|
591
|
-
const [mt, St, ct] = st(
|
592
|
-
i,
|
593
|
-
G,
|
594
|
-
J,
|
595
|
-
T
|
596
|
-
);
|
597
|
-
g = Et(
|
598
|
-
i,
|
599
|
-
f,
|
600
|
-
M.direction,
|
601
|
-
n,
|
602
|
-
mt,
|
603
|
-
St
|
604
|
-
);
|
605
|
-
const Pt = Ee(), At = Je(
|
606
|
-
M.direction,
|
607
|
-
J,
|
608
|
-
G,
|
609
|
-
ct,
|
610
|
-
Pt,
|
611
|
-
A,
|
612
|
-
D,
|
613
|
-
T,
|
614
|
-
i
|
615
|
-
);
|
616
|
-
x.length == 0 && H(
|
617
|
-
void 0,
|
618
|
-
g,
|
619
|
-
i,
|
620
|
-
At
|
621
|
-
);
|
622
|
-
for (const [xt, wt] of x.toReversed().entries()) {
|
623
|
-
let Bt = g;
|
624
|
-
ct - 1 >= xt && (Bt = { height: 0, width: 0 }), f === zt && !et(wt, at) && H(
|
625
|
-
wt,
|
626
|
-
Bt,
|
627
|
-
i,
|
628
|
-
At
|
629
|
-
);
|
630
|
-
}
|
631
|
-
N(
|
632
|
-
ct,
|
633
|
-
i,
|
634
|
-
M,
|
635
|
-
T,
|
636
|
-
b
|
637
|
-
);
|
638
|
-
}, st = (i, f, g, D) => {
|
639
|
-
const b = pt(i, D) ? f : c, T = () => f < b ? [b, b + 1] : f > b ? [b - 1, b] : [b - 1, b + 1], [A, M] = T(), x = g[A] ?? null, G = g[M] ?? null;
|
640
|
-
return [
|
641
|
-
x,
|
642
|
-
G,
|
643
|
-
b
|
644
|
-
];
|
645
|
-
}, H = (i, f, g, D) => {
|
646
|
-
Tt(i, f.height, f.width), Tt(
|
647
|
-
g,
|
648
|
-
D.height,
|
649
|
-
D.width
|
650
|
-
);
|
651
|
-
}, N = (i, f, g, D, C) => {
|
652
|
-
const { onInsertEvent: b, onDragEnd: T } = g;
|
653
|
-
nt(f, Wt), z(f, n, D, () => {
|
654
|
-
if (Ct(f, Wt), C != null) {
|
655
|
-
const A = d(C, !0);
|
656
|
-
A != null && (b(i, A, !0), T({ value: A, index: i })), q(f), Z();
|
657
|
-
}
|
658
|
-
});
|
659
|
-
}, Z = () => {
|
660
|
-
if (s) {
|
661
|
-
var i = document.querySelectorAll(
|
662
|
-
`${gt(s)} > .${Q}`
|
663
|
-
);
|
664
|
-
for (const f of i)
|
665
|
-
$(f);
|
666
|
-
}
|
667
|
-
}, q = (i) => {
|
668
|
-
setTimeout(() => {
|
669
|
-
Ct(i, B);
|
670
|
-
}, pn);
|
671
|
-
}, z = (i, f, g, D) => {
|
672
|
-
setTimeout(() => {
|
673
|
-
D && D(), X(f, g), j(g), tt(i), V(i, f), V(i, g);
|
674
|
-
}, m);
|
675
|
-
}, X = (i, f) => {
|
676
|
-
i.isSameNode(f) ? vt(i, m) : (vt(i, m, !0), vt(f, m));
|
677
|
-
}, j = (i) => {
|
678
|
-
if (n.isSameNode(i))
|
679
|
-
return;
|
680
|
-
var [f] = n.querySelectorAll(`.${at}`);
|
681
|
-
if (!f)
|
682
|
-
return;
|
683
|
-
const { distance: g } = w(l);
|
684
|
-
it(f) && (f.style[g] = "0px");
|
685
|
-
}, V = (i, f) => {
|
686
|
-
const [g] = Rt(i, f);
|
687
|
-
for (const D of [...g, i])
|
688
|
-
$(D);
|
689
|
-
}, $ = (i) => {
|
690
|
-
it(i) && (i.style.transition = "", i.style.transform = "");
|
691
|
-
}, tt = (i) => {
|
692
|
-
r(), ut(i, !1), i.style.transform = "", i.style.transition = "", i.style.top = "", i.style.left = "", le(i, {
|
693
|
-
fixedHeight: "",
|
694
|
-
fixedWidth: ""
|
695
|
-
});
|
696
|
-
}, ot = (i, f) => {
|
697
|
-
const g = f.querySelector(u);
|
698
|
-
bt(document.body, se, i), bt(g || f, Yt, i);
|
699
|
-
}, ut = (i, f) => {
|
700
|
-
bt(i, Ht, f), ot(f, i), o.toggleGrabClass(!f);
|
701
|
-
};
|
702
|
-
return [
|
703
|
-
O,
|
704
|
-
h,
|
705
|
-
F,
|
706
|
-
S,
|
707
|
-
ut
|
708
|
-
];
|
709
|
-
}
|
710
|
-
const he = (e, t, n) => {
|
711
|
-
const { insertingFromClass: s, animationDuration: o } = n, r = kt(() => {
|
712
|
-
const l = re(t)[e];
|
713
|
-
nt(l, s), nt(l, Zt), setTimeout(() => {
|
714
|
-
Ct(l, Zt), Ct(l, s), r.disconnect();
|
715
|
-
}, o);
|
716
|
-
}, t, {
|
717
|
-
childList: !0
|
718
|
-
});
|
719
|
-
}, Bn = (e, t, n, s) => {
|
720
|
-
if (!t)
|
721
|
-
return;
|
722
|
-
const { onInsertEvent: o, delayBeforeInsert: r } = e;
|
723
|
-
setTimeout(() => {
|
724
|
-
o(n, s), he(n, t, e);
|
725
|
-
}, r);
|
726
|
-
}, mn = (e, t) => {
|
727
|
-
const n = (l, u) => e.removeAtEvent(l, u), s = (l, u, d) => e.insertEvent(l, u, d), o = () => e.getLength(), r = (l) => e.getValue(l), c = (l) => l;
|
728
|
-
return {
|
729
|
-
direction: (t == null ? void 0 : t.direction) ?? U,
|
730
|
-
handlerSelector: (t == null ? void 0 : t.handlerSelector) ?? Q,
|
731
|
-
draggingClass: (t == null ? void 0 : t.draggingClass) ?? "dragging",
|
732
|
-
droppableClass: (t == null ? void 0 : t.droppableClass) ?? "droppable-hover",
|
733
|
-
isDraggable: (t == null ? void 0 : t.isDraggable) ?? (() => !0),
|
734
|
-
onDragStart: (t == null ? void 0 : t.onDragStart) ?? (() => {
|
735
|
-
}),
|
736
|
-
onDragEnd: (t == null ? void 0 : t.onDragEnd) ?? (() => {
|
737
|
-
}),
|
738
|
-
droppableGroup: t == null ? void 0 : t.droppableGroup,
|
739
|
-
onRemoveAtEvent: n,
|
740
|
-
onInsertEvent: s,
|
741
|
-
onGetLegth: o,
|
742
|
-
onGetValue: r,
|
743
|
-
animationDuration: (t == null ? void 0 : t.animationDuration) ?? 200,
|
744
|
-
removingClass: (t == null ? void 0 : t.removingClass) ?? "removing",
|
745
|
-
insertingFromClass: (t == null ? void 0 : t.insertingFromClass) ?? "from-inserting",
|
746
|
-
delayBeforeRemove: (t == null ? void 0 : t.delayBeforeRemove) ?? 200,
|
747
|
-
delayBeforeInsert: (t == null ? void 0 : t.delayBeforeInsert) ?? 200,
|
748
|
-
mapFrom: (t == null ? void 0 : t.mapFrom) ?? c
|
749
|
-
};
|
750
|
-
}, Sn = (e, t) => {
|
751
|
-
const { config: n, droppable: s } = e, { onInsertEvent: o, onDragEnd: r } = n;
|
752
|
-
return {
|
753
|
-
...n,
|
754
|
-
onDragEnd: (u) => {
|
755
|
-
const { index: d, value: m } = u;
|
756
|
-
r({ index: d, value: t(m, s) });
|
757
|
-
},
|
758
|
-
onInsertEvent: (u, d) => o(u, t(d, s), !0)
|
759
|
-
};
|
760
|
-
}, Dn = (e) => {
|
761
|
-
let t = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
|
762
|
-
const o = (u) => {
|
763
|
-
e.style.transform = `translate( ${u.x}px, ${u.y}px)`;
|
764
|
-
}, r = (u) => {
|
765
|
-
e.style.top = `${u.top}px`, e.style.left = `${u.left}px`;
|
766
|
-
};
|
767
|
-
return [
|
768
|
-
(u, d, m, v) => {
|
769
|
-
const B = (h) => {
|
770
|
-
const {
|
771
|
-
beforeMargin: S,
|
772
|
-
borderBeforeWidth: y,
|
773
|
-
before: R,
|
774
|
-
offset: I,
|
775
|
-
scroll: Y,
|
776
|
-
page: W,
|
777
|
-
inner: P,
|
778
|
-
distance: st,
|
779
|
-
axis: H,
|
780
|
-
getRect: N
|
781
|
-
} = w(h), Z = m[W], q = window[Y], z = window[P], X = N(u)[st], j = L(u, y), V = L(u, S), $ = Z - t[I], tt = ie(u, h);
|
782
|
-
if ($ >= q - X / 2 && $ <= q + z) {
|
783
|
-
const ut = $ - n[R] - j - V - q - tt;
|
784
|
-
return O(h), ut;
|
785
|
-
}
|
786
|
-
return s[H];
|
787
|
-
}, O = (h) => {
|
788
|
-
if (u && et(u, Ht) && h === v) {
|
789
|
-
const { before: S, distance: y, axis: R, getRect: I } = w(v), Y = I(u)[y], W = I(d), P = n[S] - W[S] + s[R], H = W[y] - Y, N = P / H, Z = Y / H, q = 0.1, z = 0.2, X = 0.8;
|
790
|
-
let j = 0;
|
791
|
-
const V = pt(u, d);
|
792
|
-
!V && N < z && N > -Z ? j = N / z - 1 : !V && N > X && N < 1 + Z && (j = 1 / (1 - X) * (N - X));
|
793
|
-
const $ = q * Y * j;
|
794
|
-
sn(d, v, $);
|
795
|
-
}
|
796
|
-
}, F = (h) => {
|
797
|
-
const { axis: S } = w(h);
|
798
|
-
s[S] = B(h), o(s);
|
799
|
-
};
|
800
|
-
F(_), F(U);
|
801
|
-
},
|
802
|
-
(u, d) => {
|
803
|
-
const [m, v, B, O] = Tn(
|
804
|
-
u,
|
805
|
-
d,
|
806
|
-
e
|
807
|
-
);
|
808
|
-
n = {
|
809
|
-
top: m,
|
810
|
-
left: v
|
811
|
-
}, r(n), t = { offsetX: B, offsetY: O };
|
812
|
-
}
|
813
|
-
];
|
814
|
-
}, Lt = (e, t, n) => {
|
815
|
-
const { borderBeforeWidth: s, before: o, getRect: r } = w(e);
|
816
|
-
return r(t)[o] - r(n)[o] - L(n, s);
|
817
|
-
}, vn = (e, t) => {
|
818
|
-
let { offsetX: n, offsetY: s, target: o } = e, r = bn(o, t);
|
819
|
-
const c = o;
|
820
|
-
return c && r && !c.isSameNode(r) && (n += Lt(_, c, r), s += Lt(U, c, r)), r && t != o && (n += Lt(_, r, t), s += Lt(U, r, t)), [n, s];
|
821
|
-
}, bn = (e, t) => {
|
822
|
-
const n = e == null ? void 0 : e.closest(`.${Ot}`);
|
823
|
-
return n && n.isSameNode(t) ? e : n;
|
824
|
-
}, ne = (e, t, n, s) => {
|
825
|
-
const { offset: o, beforeMargin: r, page: c, borderBeforeWidth: l, scroll: u } = w(e), d = ie(n, e);
|
826
|
-
return t[c] - s[o] - L(n, r) - L(n, l) - window[u] - d;
|
827
|
-
}, Tn = (e, t, n) => {
|
828
|
-
const [s, o] = vn(e, n);
|
829
|
-
return [
|
830
|
-
ne(U, e, t, {
|
831
|
-
offsetX: s,
|
832
|
-
offsetY: o
|
833
|
-
}),
|
834
|
-
ne(_, e, t, {
|
835
|
-
offsetX: s,
|
836
|
-
offsetY: o
|
837
|
-
}),
|
838
|
-
s,
|
839
|
-
o
|
840
|
-
];
|
841
|
-
}, K = class K {
|
842
|
-
static addConfig(t, n) {
|
843
|
-
const s = K.configs.filter(
|
844
|
-
(r) => !r.droppable.isSameNode(t)
|
845
|
-
), o = Kt(t);
|
846
|
-
s.push({
|
847
|
-
droppable: t,
|
848
|
-
config: n,
|
849
|
-
scroll: o
|
850
|
-
}), K.configs = s;
|
851
|
-
}
|
852
|
-
static updateScrolls(t, n) {
|
853
|
-
for (const s of K.configs) {
|
854
|
-
const { droppable: o } = s;
|
855
|
-
(n && be(o, n) || o.isSameNode(t)) && (s.scroll = Kt(o));
|
856
|
-
}
|
857
|
-
}
|
858
|
-
static getConfig(t) {
|
859
|
-
return K.configs.find(
|
860
|
-
({ droppable: s }) => s.isSameNode(t)
|
861
|
-
);
|
862
|
-
}
|
863
|
-
};
|
864
|
-
k(K, "configs", []), k(K, "removeObsoleteConfigs", () => {
|
865
|
-
const t = K.configs.filter(
|
866
|
-
({ droppable: n }) => document.contains(n)
|
867
|
-
);
|
868
|
-
K.configs = t;
|
869
|
-
});
|
870
|
-
let lt = K;
|
871
|
-
class En {
|
872
|
-
constructor(t, n, s, o, r, c) {
|
873
|
-
k(this, "initial");
|
874
|
-
k(this, "current");
|
875
|
-
k(this, "parent");
|
876
|
-
k(this, "draggableElement");
|
877
|
-
k(this, "groupClass");
|
878
|
-
k(this, "dragEvent");
|
879
|
-
k(this, "changeDroppable");
|
880
|
-
k(this, "mapFrom");
|
881
|
-
this.parent = s, this.draggableElement = t, this.groupClass = n, this.dragEvent = o, this.mapFrom = c, this.initial = s ? lt.getConfig(s) : void 0, this.changeDroppable = r;
|
882
|
-
}
|
883
|
-
getDraggableAncestor(t, n, s) {
|
884
|
-
return document.elementsFromPoint(t, n).filter((o) => !o.isSameNode(s));
|
885
|
-
}
|
886
|
-
getElementBelow(t, n, s = !0) {
|
887
|
-
const o = (c) => {
|
888
|
-
const [l] = c.getDraggableAncestor(
|
889
|
-
n.clientX,
|
890
|
-
n.clientY,
|
891
|
-
t
|
892
|
-
);
|
893
|
-
return l;
|
894
|
-
};
|
895
|
-
let r = null;
|
896
|
-
return s ? (t.hidden = !0, r = o(this), t.hidden = !1) : r = o(this), r;
|
897
|
-
}
|
898
|
-
getCurrent(t, n, s = !0) {
|
899
|
-
const o = this.getElementBelow(t, n, s);
|
900
|
-
return !this.groupClass || !o ? void 0 : o.closest(
|
901
|
-
gt(this.groupClass)
|
902
|
-
);
|
903
|
-
}
|
904
|
-
isOutsideOfAllDroppables(t) {
|
905
|
-
return (this.groupClass ? Array.from(
|
906
|
-
document.querySelectorAll(gt(this.groupClass))
|
907
|
-
) : [this.parent]).every(
|
908
|
-
(s) => pt(t, s)
|
909
|
-
);
|
910
|
-
}
|
911
|
-
isNotInsideAnotherDroppable(t, n) {
|
912
|
-
return !pt(t, n) || this.isOutsideOfAllDroppables(t);
|
913
|
-
}
|
914
|
-
onScrollEvent() {
|
915
|
-
this.dragEvent();
|
916
|
-
}
|
917
|
-
setOnScroll(t) {
|
918
|
-
ae(t, "onscroll", () => {
|
919
|
-
this.onScrollEvent();
|
920
|
-
});
|
921
|
-
}
|
922
|
-
getConfigFrom(t) {
|
923
|
-
const n = lt.getConfig(t);
|
924
|
-
if (n)
|
925
|
-
return t.isSameNode(this.parent) ? n : {
|
926
|
-
...n,
|
927
|
-
config: Sn(n, this.mapFrom)
|
928
|
-
};
|
929
|
-
}
|
930
|
-
getCurrentConfig(t) {
|
931
|
-
var o;
|
932
|
-
const n = this.draggableElement;
|
933
|
-
if (this.current && this.isNotInsideAnotherDroppable(
|
934
|
-
n,
|
935
|
-
(o = this.current) == null ? void 0 : o.droppable
|
936
|
-
))
|
937
|
-
return this.current;
|
938
|
-
const s = this.getCurrent(n, t);
|
939
|
-
return s ? (it(s) && !s.onscroll && this.setOnScroll(s), this.getConfigFrom(s)) : this.getConfigFrom(this.parent);
|
940
|
-
}
|
941
|
-
updateConfig(t) {
|
942
|
-
const n = this.current;
|
943
|
-
this.current = this.getCurrentConfig(t), this.changeDroppable(this.current, n);
|
944
|
-
}
|
945
|
-
isOutside(t, n = !0) {
|
946
|
-
const s = this.draggableElement;
|
947
|
-
return !this.getCurrent(s, t, n);
|
948
|
-
}
|
949
|
-
}
|
950
|
-
function Cn(e, t, n, s, o) {
|
951
|
-
const {
|
952
|
-
handlerSelector: r,
|
953
|
-
isDraggable: c,
|
954
|
-
droppableGroup: l,
|
955
|
-
animationDuration: u,
|
956
|
-
delayBeforeRemove: d,
|
957
|
-
draggingClass: m,
|
958
|
-
removingClass: v,
|
959
|
-
onRemoveAtEvent: B,
|
960
|
-
droppableClass: O,
|
961
|
-
onDragStart: F
|
962
|
-
} = n, h = yt(l).map((a) => `droppable-group-${a}`).join(" ");
|
963
|
-
let S = 0, y = {
|
964
|
-
scrollX: 0,
|
965
|
-
scrollY: 0
|
966
|
-
}, R = { pageX: 0, pageY: 0 }, I;
|
967
|
-
const [Y, W] = Dn(
|
968
|
-
e
|
969
|
-
), [
|
970
|
-
P,
|
971
|
-
st,
|
972
|
-
H,
|
973
|
-
N,
|
974
|
-
Z
|
975
|
-
] = hn(
|
976
|
-
n,
|
977
|
-
t,
|
978
|
-
s,
|
979
|
-
h,
|
980
|
-
o,
|
981
|
-
() => S = 0
|
982
|
-
/* NOT_DRAGGING */
|
983
|
-
), q = () => {
|
984
|
-
nt(e, Q);
|
985
|
-
}, z = (a) => {
|
986
|
-
nt(a, Ot), o.addSubscriber(a);
|
987
|
-
}, X = () => {
|
988
|
-
if (c(e)) {
|
989
|
-
const a = e.querySelector(r);
|
990
|
-
z(a || e);
|
991
|
-
}
|
992
|
-
}, j = () => {
|
993
|
-
X(), q();
|
994
|
-
}, V = (a) => {
|
995
|
-
const p = a == null ? void 0 : a.querySelector(`.${Ot}`), E = p == null ? void 0 : p.parentElement;
|
996
|
-
return p && E && et(E, It) && !E.isSameNode(s) ? null : p;
|
997
|
-
}, $ = (a) => {
|
998
|
-
const p = V(a) ?? a;
|
999
|
-
p && c(a) && ($t(
|
1000
|
-
p,
|
1001
|
-
"onmousedown",
|
1002
|
-
M("mousemove", "mouseup")
|
1003
|
-
), $t(
|
1004
|
-
p,
|
1005
|
-
"ontouchstart",
|
1006
|
-
M("touchmove", "touchend")
|
1007
|
-
), tt(p)), a != null && a.isSameNode(p) || $t(a, "onmousedown", x), nt(s, It);
|
1008
|
-
}, tt = (a) => {
|
1009
|
-
const p = a.querySelectorAll("img");
|
1010
|
-
Array.from(p).forEach((E) => {
|
1011
|
-
E.onmousedown = () => !1;
|
1012
|
-
});
|
1013
|
-
}, ot = () => {
|
1014
|
-
if (R.pageX == 0 && R.pageY == 0 || !i.current)
|
1015
|
-
return;
|
1016
|
-
const { droppable: a, config: p } = i.current;
|
1017
|
-
Y(e, a, R, p.direction), P(
|
1018
|
-
e,
|
1019
|
-
Nt,
|
1020
|
-
y,
|
1021
|
-
i.current
|
1022
|
-
);
|
1023
|
-
}, ut = (a, p) => {
|
1024
|
-
p && S == 2 && !(a != null && a.droppable.isSameNode(p.droppable)) && P(
|
1025
|
-
e,
|
1026
|
-
Nt,
|
1027
|
-
y,
|
1028
|
-
p
|
1029
|
-
);
|
1030
|
-
}, i = new En(
|
1031
|
-
e,
|
1032
|
-
h,
|
1033
|
-
s,
|
1034
|
-
ot,
|
1035
|
-
ut,
|
1036
|
-
n.mapFrom
|
1037
|
-
), f = (a) => {
|
1038
|
-
if (!i.current)
|
1039
|
-
return;
|
1040
|
-
const p = h ? Array.from(
|
1041
|
-
document.querySelectorAll(gt(h))
|
1042
|
-
) : [s];
|
1043
|
-
for (const E of p)
|
1044
|
-
E.classList.toggle(
|
1045
|
-
O,
|
1046
|
-
!a && E.isSameNode(i.current.droppable)
|
1047
|
-
);
|
1048
|
-
}, g = (a) => {
|
1049
|
-
i.updateConfig(a);
|
1050
|
-
const p = i.isOutside(a);
|
1051
|
-
f(p), S === 1 ? ft(a) : S === 2 && (D(p), St(a));
|
1052
|
-
}, D = (a = !0) => {
|
1053
|
-
if (!i.current)
|
1054
|
-
return;
|
1055
|
-
const { droppable: p } = i.current;
|
1056
|
-
gn(
|
1057
|
-
p,
|
1058
|
-
s,
|
1059
|
-
h,
|
1060
|
-
u,
|
1061
|
-
a
|
1062
|
-
), !a && Gt(
|
1063
|
-
e,
|
1064
|
-
s,
|
1065
|
-
S == 1,
|
1066
|
-
i.current
|
1067
|
-
);
|
1068
|
-
}, C = (a) => {
|
1069
|
-
if (Xt(a) && a.cancelable)
|
1070
|
-
a.preventDefault();
|
1071
|
-
else if (Xt(a))
|
1072
|
-
return;
|
1073
|
-
const p = Vt(a);
|
1074
|
-
g(p);
|
1075
|
-
}, b = (a, p) => {
|
1076
|
-
a == "touchmove" ? I = setTimeout(() => {
|
1077
|
-
p();
|
1078
|
-
}, 200) : p();
|
1079
|
-
}, T = (a, p) => {
|
1080
|
-
const { clientX: E, clientY: dt } = a, rt = document.elementFromPoint(E, dt), Dt = rt == null ? void 0 : rt.closest(`.${Q}`);
|
1081
|
-
return rt && p && Dt && !p.isSameNode(Dt);
|
1082
|
-
}, A = (a) => {
|
1083
|
-
const p = n.onGetValue(t);
|
1084
|
-
return { index: t, element: a, value: p };
|
1085
|
-
}, M = (a, p) => (E) => {
|
1086
|
-
if (T(E, e))
|
1087
|
-
return;
|
1088
|
-
lt.updateScrolls(s, h);
|
1089
|
-
const { scrollX: dt, scrollY: rt } = window;
|
1090
|
-
if (y = { scrollX: dt, scrollY: rt }, S === 0) {
|
1091
|
-
S = 1;
|
1092
|
-
const Dt = A(e);
|
1093
|
-
Dt && F(Dt), b(a, () => {
|
1094
|
-
a == "touchmove" && (i.updateConfig(E), f(i.isOutside(E)), ft(E)), document.addEventListener(a, C, {
|
1095
|
-
passive: !1
|
1096
|
-
});
|
1097
|
-
}), ct(s), document.addEventListener(p, G(a), {
|
1098
|
-
once: !0
|
1099
|
-
});
|
1100
|
-
}
|
1101
|
-
}, x = (a) => i.updateConfig(a), G = (a) => (p) => {
|
1102
|
-
f(!0);
|
1103
|
-
const E = Vt(p);
|
1104
|
-
clearTimeout(I), At(i.isOutside(E, !1)), document.removeEventListener(a, C), i.updateConfig(E);
|
1105
|
-
const dt = i.getCurrentConfig(E);
|
1106
|
-
if (dt) {
|
1107
|
-
const { droppable: rt } = dt;
|
1108
|
-
J(rt);
|
1109
|
-
}
|
1110
|
-
s.onscroll = null;
|
1111
|
-
}, J = (a) => {
|
1112
|
-
if (a.onscroll = null, !h)
|
1113
|
-
return;
|
1114
|
-
const p = Array.from(
|
1115
|
-
document.querySelectorAll(gt(h))
|
1116
|
-
);
|
1117
|
-
for (const E of p)
|
1118
|
-
it(E) && (E.onscroll = null);
|
1119
|
-
}, ft = (a) => {
|
1120
|
-
Gt(
|
1121
|
-
e,
|
1122
|
-
s,
|
1123
|
-
S == 1,
|
1124
|
-
i.current
|
1125
|
-
), mt(), P(
|
1126
|
-
e,
|
1127
|
-
ue,
|
1128
|
-
y,
|
1129
|
-
i.current
|
1130
|
-
), wt(e), W(a, e);
|
1131
|
-
}, mt = () => {
|
1132
|
-
S = 2;
|
1133
|
-
}, St = (a) => {
|
1134
|
-
const { pageX: p, pageY: E } = a;
|
1135
|
-
R = { pageX: p, pageY: E }, ot();
|
1136
|
-
}, ct = (a) => ae(a, "onscroll", Pt), Pt = () => ot(), At = (a) => {
|
1137
|
-
if (S !== 2) {
|
1138
|
-
S = 0;
|
1139
|
-
return;
|
1140
|
-
}
|
1141
|
-
S = 3, xt(e), P(
|
1142
|
-
e,
|
1143
|
-
zt,
|
1144
|
-
y,
|
1145
|
-
a ? i.initial : i.current,
|
1146
|
-
t
|
1147
|
-
);
|
1148
|
-
}, xt = (a) => {
|
1149
|
-
Ft(a, u, fe), Tt(a, 0, 0);
|
1150
|
-
}, wt = (a) => {
|
1151
|
-
const { height: p, width: E } = a.getBoundingClientRect();
|
1152
|
-
le(a, {
|
1153
|
-
fixedHeight: `${p}px`,
|
1154
|
-
fixedWidth: `${E}px`
|
1155
|
-
}), Z(a, !0), bt(a, m, !0), a.style.transition = "";
|
1156
|
-
}, Bt = (a) => {
|
1157
|
-
if (!i.initial)
|
1158
|
-
return;
|
1159
|
-
const p = i.initial;
|
1160
|
-
a == t && (nt(e, v), setTimeout(() => {
|
1161
|
-
B(t), Ct(e, v), Gt(
|
1162
|
-
e,
|
1163
|
-
s,
|
1164
|
-
S == 1,
|
1165
|
-
i.initial
|
1166
|
-
), st(
|
1167
|
-
a,
|
1168
|
-
e,
|
1169
|
-
p,
|
1170
|
-
(E) => {
|
1171
|
-
xt(E), N(e);
|
1172
|
-
}
|
1173
|
-
);
|
1174
|
-
}, d));
|
1175
|
-
}, me = (a, p) => {
|
1176
|
-
(a === t || a === n.onGetLegth() && t === a - 1) && H(
|
1177
|
-
a,
|
1178
|
-
e,
|
1179
|
-
s,
|
1180
|
-
p,
|
1181
|
-
() => {
|
1182
|
-
fn(
|
1183
|
-
e,
|
1184
|
-
S == 1,
|
1185
|
-
i.initial
|
1186
|
-
);
|
1187
|
-
}
|
1188
|
-
);
|
1189
|
-
};
|
1190
|
-
return j(), $(e), [Bt, me];
|
1191
|
-
}
|
1192
|
-
const yn = (e, t) => {
|
1193
|
-
e && Te(t, e);
|
1194
|
-
}, An = () => {
|
1195
|
-
Ie(document.body, [
|
1196
|
-
`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,
|
1197
|
-
`.${Ot}{pointer-events:auto!important;}`,
|
1198
|
-
`.${ve}{cursor:grab;}`,
|
1199
|
-
".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",
|
1200
|
-
".droppable{box-sizing:border-box!important;}",
|
1201
|
-
`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,
|
1202
|
-
`.${Yt}{pointer-events:none!important;}`,
|
1203
|
-
`.${Wt}{pointer-events:none!important;}`,
|
1204
|
-
`.${se}{cursor:grabbing;}`,
|
1205
|
-
".disable-transition{transition:none!important;}"
|
1206
|
-
]);
|
1207
|
-
};
|
1208
|
-
function xn(e, t, n, s = "index") {
|
1209
|
-
const o = s;
|
1210
|
-
let r = [], c = [];
|
1211
|
-
const { droppableGroup: l } = e;
|
1212
|
-
if (!n)
|
1213
|
-
return [
|
1214
|
-
r,
|
1215
|
-
c
|
1216
|
-
];
|
1217
|
-
const u = yt(l).map((d) => `droppable-group-${d}`).join(" ");
|
1218
|
-
An(), yn(u, n);
|
1219
|
-
for (const d of n.children) {
|
1220
|
-
const m = d.getAttribute(o), v = Ce(m), B = d;
|
1221
|
-
if (B && v >= 0) {
|
1222
|
-
const [O, F] = Cn(
|
1223
|
-
B,
|
1224
|
-
v,
|
1225
|
-
e,
|
1226
|
-
n,
|
1227
|
-
t
|
1228
|
-
);
|
1229
|
-
r.push(O), c.push(F);
|
1230
|
-
}
|
1231
|
-
}
|
1232
|
-
return [
|
1233
|
-
r,
|
1234
|
-
c
|
1235
|
-
];
|
1236
|
-
}
|
1237
|
-
function Rn(e, t, n, s = "index") {
|
1238
|
-
let o = [], r = [];
|
1239
|
-
const c = mn(e, n), l = (h) => {
|
1240
|
-
for (const S of o)
|
1241
|
-
S(h);
|
1242
|
-
}, u = (h, S) => {
|
1243
|
-
if (c.onGetLegth() === 0)
|
1244
|
-
e.insertToListEmpty(c, h, S);
|
1245
|
-
else
|
1246
|
-
for (const R of r)
|
1247
|
-
R(h, S);
|
1248
|
-
}, d = (h) => {
|
1249
|
-
const [S, y] = xn(c, t, h, s);
|
1250
|
-
o = S, r = y;
|
1251
|
-
}, m = (h) => {
|
1252
|
-
const S = h.addedNodes.values().filter((R) => !ee(R)).toArray(), y = h.removedNodes.values().filter((R) => !ee(R)).toArray();
|
1253
|
-
return S.length > 0 || y.length > 0;
|
1254
|
-
}, v = (h) => {
|
1255
|
-
kt(
|
1256
|
-
() => {
|
1257
|
-
d(h);
|
1258
|
-
},
|
1259
|
-
h,
|
1260
|
-
{ childList: !0 },
|
1261
|
-
m
|
1262
|
-
);
|
1263
|
-
}, B = (h) => {
|
1264
|
-
nt(h, It);
|
1265
|
-
}, O = (h) => {
|
1266
|
-
lt.addConfig(
|
1267
|
-
h,
|
1268
|
-
c
|
1269
|
-
);
|
1270
|
-
};
|
1271
|
-
return [l, u, (h) => {
|
1272
|
-
h && (B(h), O(h), v(h), d(h), lt.removeObsoleteConfigs());
|
1273
|
-
}];
|
1274
|
-
}
|
1275
|
-
export {
|
1276
|
-
ve as G,
|
1277
|
-
nt as a,
|
1278
|
-
Rn as d,
|
1279
|
-
Bn as i,
|
1280
|
-
bt as t
|
1281
|
-
};
|