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