@jackbo_vip/admin-kit 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin-kit.css +1 -0
- package/dist/index.cjs +3 -137
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.mjs +11186 -12
- package/dist/index.mjs.map +1 -0
- package/dist/sortable.complete.esm-Dw-DntUp.cjs +3 -0
- package/dist/sortable.complete.esm-Dw-DntUp.cjs.map +1 -0
- package/dist/sortable.complete.esm-dE2RjKaB.js +1624 -0
- package/dist/sortable.complete.esm-dE2RjKaB.js.map +1 -0
- package/package.json +23 -10
- package/dist/index.d.cts +0 -12
- package/dist/index.d.mts +0 -12
|
@@ -0,0 +1,1624 @@
|
|
|
1
|
+
function _e(o, t) {
|
|
2
|
+
var e = Object.keys(o);
|
|
3
|
+
if (Object.getOwnPropertySymbols) {
|
|
4
|
+
var n = Object.getOwnPropertySymbols(o);
|
|
5
|
+
t && (n = n.filter(function(i) {
|
|
6
|
+
return Object.getOwnPropertyDescriptor(o, i).enumerable;
|
|
7
|
+
})), e.push.apply(e, n);
|
|
8
|
+
}
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
function Q(o) {
|
|
12
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
13
|
+
var e = arguments[t] != null ? arguments[t] : {};
|
|
14
|
+
t % 2 ? _e(Object(e), !0).forEach(function(n) {
|
|
15
|
+
Ve(o, n, e[n]);
|
|
16
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(e)) : _e(Object(e)).forEach(function(n) {
|
|
17
|
+
Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(e, n));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return o;
|
|
21
|
+
}
|
|
22
|
+
function zt(o) {
|
|
23
|
+
"@babel/helpers - typeof";
|
|
24
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? zt = function(t) {
|
|
25
|
+
return typeof t;
|
|
26
|
+
} : zt = function(t) {
|
|
27
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
28
|
+
}, zt(o);
|
|
29
|
+
}
|
|
30
|
+
function Ve(o, t, e) {
|
|
31
|
+
return t in o ? Object.defineProperty(o, t, {
|
|
32
|
+
value: e,
|
|
33
|
+
enumerable: !0,
|
|
34
|
+
configurable: !0,
|
|
35
|
+
writable: !0
|
|
36
|
+
}) : o[t] = e, o;
|
|
37
|
+
}
|
|
38
|
+
function $() {
|
|
39
|
+
return $ = Object.assign || function(o) {
|
|
40
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
41
|
+
var e = arguments[t];
|
|
42
|
+
for (var n in e)
|
|
43
|
+
Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);
|
|
44
|
+
}
|
|
45
|
+
return o;
|
|
46
|
+
}, $.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
function Ze(o, t) {
|
|
49
|
+
if (o == null) return {};
|
|
50
|
+
var e = {}, n = Object.keys(o), i, r;
|
|
51
|
+
for (r = 0; r < n.length; r++)
|
|
52
|
+
i = n[r], !(t.indexOf(i) >= 0) && (e[i] = o[i]);
|
|
53
|
+
return e;
|
|
54
|
+
}
|
|
55
|
+
function Qe(o, t) {
|
|
56
|
+
if (o == null) return {};
|
|
57
|
+
var e = Ze(o, t), n, i;
|
|
58
|
+
if (Object.getOwnPropertySymbols) {
|
|
59
|
+
var r = Object.getOwnPropertySymbols(o);
|
|
60
|
+
for (i = 0; i < r.length; i++)
|
|
61
|
+
n = r[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (e[n] = o[n]);
|
|
62
|
+
}
|
|
63
|
+
return e;
|
|
64
|
+
}
|
|
65
|
+
function Je(o) {
|
|
66
|
+
return tn(o) || en(o) || nn(o) || on();
|
|
67
|
+
}
|
|
68
|
+
function tn(o) {
|
|
69
|
+
if (Array.isArray(o)) return he(o);
|
|
70
|
+
}
|
|
71
|
+
function en(o) {
|
|
72
|
+
if (typeof Symbol < "u" && o[Symbol.iterator] != null || o["@@iterator"] != null) return Array.from(o);
|
|
73
|
+
}
|
|
74
|
+
function nn(o, t) {
|
|
75
|
+
if (o) {
|
|
76
|
+
if (typeof o == "string") return he(o, t);
|
|
77
|
+
var e = Object.prototype.toString.call(o).slice(8, -1);
|
|
78
|
+
if (e === "Object" && o.constructor && (e = o.constructor.name), e === "Map" || e === "Set") return Array.from(o);
|
|
79
|
+
if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return he(o, t);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function he(o, t) {
|
|
83
|
+
(t == null || t > o.length) && (t = o.length);
|
|
84
|
+
for (var e = 0, n = new Array(t); e < t; e++) n[e] = o[e];
|
|
85
|
+
return n;
|
|
86
|
+
}
|
|
87
|
+
function on() {
|
|
88
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
89
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
90
|
+
}
|
|
91
|
+
var rn = "1.15.6";
|
|
92
|
+
function et(o) {
|
|
93
|
+
if (typeof window < "u" && window.navigator)
|
|
94
|
+
return !!/* @__PURE__ */ navigator.userAgent.match(o);
|
|
95
|
+
}
|
|
96
|
+
var nt = et(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Xt = et(/Edge/i), Ce = et(/firefox/i), Pt = et(/safari/i) && !et(/chrome/i) && !et(/android/i), be = et(/iP(ad|od|hone)/i), Re = et(/chrome/i) && et(/android/i), ke = {
|
|
97
|
+
capture: !1,
|
|
98
|
+
passive: !1
|
|
99
|
+
};
|
|
100
|
+
function y(o, t, e) {
|
|
101
|
+
o.addEventListener(t, e, !nt && ke);
|
|
102
|
+
}
|
|
103
|
+
function b(o, t, e) {
|
|
104
|
+
o.removeEventListener(t, e, !nt && ke);
|
|
105
|
+
}
|
|
106
|
+
function Zt(o, t) {
|
|
107
|
+
if (t) {
|
|
108
|
+
if (t[0] === ">" && (t = t.substring(1)), o)
|
|
109
|
+
try {
|
|
110
|
+
if (o.matches)
|
|
111
|
+
return o.matches(t);
|
|
112
|
+
if (o.msMatchesSelector)
|
|
113
|
+
return o.msMatchesSelector(t);
|
|
114
|
+
if (o.webkitMatchesSelector)
|
|
115
|
+
return o.webkitMatchesSelector(t);
|
|
116
|
+
} catch {
|
|
117
|
+
return !1;
|
|
118
|
+
}
|
|
119
|
+
return !1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function Xe(o) {
|
|
123
|
+
return o.host && o !== document && o.host.nodeType ? o.host : o.parentNode;
|
|
124
|
+
}
|
|
125
|
+
function G(o, t, e, n) {
|
|
126
|
+
if (o) {
|
|
127
|
+
e = e || document;
|
|
128
|
+
do {
|
|
129
|
+
if (t != null && (t[0] === ">" ? o.parentNode === e && Zt(o, t) : Zt(o, t)) || n && o === e)
|
|
130
|
+
return o;
|
|
131
|
+
if (o === e) break;
|
|
132
|
+
} while (o = Xe(o));
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
var Oe = /\s+/g;
|
|
137
|
+
function I(o, t, e) {
|
|
138
|
+
if (o && t)
|
|
139
|
+
if (o.classList)
|
|
140
|
+
o.classList[e ? "add" : "remove"](t);
|
|
141
|
+
else {
|
|
142
|
+
var n = (" " + o.className + " ").replace(Oe, " ").replace(" " + t + " ", " ");
|
|
143
|
+
o.className = (n + (e ? " " + t : "")).replace(Oe, " ");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function h(o, t, e) {
|
|
147
|
+
var n = o && o.style;
|
|
148
|
+
if (n) {
|
|
149
|
+
if (e === void 0)
|
|
150
|
+
return document.defaultView && document.defaultView.getComputedStyle ? e = document.defaultView.getComputedStyle(o, "") : o.currentStyle && (e = o.currentStyle), t === void 0 ? e : e[t];
|
|
151
|
+
!(t in n) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), n[t] = e + (typeof e == "string" ? "" : "px");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function ht(o, t) {
|
|
155
|
+
var e = "";
|
|
156
|
+
if (typeof o == "string")
|
|
157
|
+
e = o;
|
|
158
|
+
else
|
|
159
|
+
do {
|
|
160
|
+
var n = h(o, "transform");
|
|
161
|
+
n && n !== "none" && (e = n + " " + e);
|
|
162
|
+
} while (!t && (o = o.parentNode));
|
|
163
|
+
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
164
|
+
return i && new i(e);
|
|
165
|
+
}
|
|
166
|
+
function Ye(o, t, e) {
|
|
167
|
+
if (o) {
|
|
168
|
+
var n = o.getElementsByTagName(t), i = 0, r = n.length;
|
|
169
|
+
if (e)
|
|
170
|
+
for (; i < r; i++)
|
|
171
|
+
e(n[i], i);
|
|
172
|
+
return n;
|
|
173
|
+
}
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
function Z() {
|
|
177
|
+
var o = document.scrollingElement;
|
|
178
|
+
return o || document.documentElement;
|
|
179
|
+
}
|
|
180
|
+
function O(o, t, e, n, i) {
|
|
181
|
+
if (!(!o.getBoundingClientRect && o !== window)) {
|
|
182
|
+
var r, a, l, s, u, d, c;
|
|
183
|
+
if (o !== window && o.parentNode && o !== Z() ? (r = o.getBoundingClientRect(), a = r.top, l = r.left, s = r.bottom, u = r.right, d = r.height, c = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, c = window.innerWidth), (t || e) && o !== window && (i = i || o.parentNode, !nt))
|
|
184
|
+
do
|
|
185
|
+
if (i && i.getBoundingClientRect && (h(i, "transform") !== "none" || e && h(i, "position") !== "static")) {
|
|
186
|
+
var p = i.getBoundingClientRect();
|
|
187
|
+
a -= p.top + parseInt(h(i, "border-top-width")), l -= p.left + parseInt(h(i, "border-left-width")), s = a + r.height, u = l + r.width;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
while (i = i.parentNode);
|
|
191
|
+
if (n && o !== window) {
|
|
192
|
+
var D = ht(i || o), w = D && D.a, S = D && D.d;
|
|
193
|
+
D && (a /= S, l /= w, c /= w, d /= S, s = a + d, u = l + c);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
top: a,
|
|
197
|
+
left: l,
|
|
198
|
+
bottom: s,
|
|
199
|
+
right: u,
|
|
200
|
+
width: c,
|
|
201
|
+
height: d
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function Te(o, t, e) {
|
|
206
|
+
for (var n = lt(o, !0), i = O(o)[t]; n; ) {
|
|
207
|
+
var r = O(n)[e], a = void 0;
|
|
208
|
+
if (a = i >= r, !a) return n;
|
|
209
|
+
if (n === Z()) break;
|
|
210
|
+
n = lt(n, !1);
|
|
211
|
+
}
|
|
212
|
+
return !1;
|
|
213
|
+
}
|
|
214
|
+
function yt(o, t, e, n) {
|
|
215
|
+
for (var i = 0, r = 0, a = o.children; r < a.length; ) {
|
|
216
|
+
if (a[r].style.display !== "none" && a[r] !== g.ghost && (n || a[r] !== g.dragged) && G(a[r], e.draggable, o, !1)) {
|
|
217
|
+
if (i === t)
|
|
218
|
+
return a[r];
|
|
219
|
+
i++;
|
|
220
|
+
}
|
|
221
|
+
r++;
|
|
222
|
+
}
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
function ye(o, t) {
|
|
226
|
+
for (var e = o.lastElementChild; e && (e === g.ghost || h(e, "display") === "none" || t && !Zt(e, t)); )
|
|
227
|
+
e = e.previousElementSibling;
|
|
228
|
+
return e || null;
|
|
229
|
+
}
|
|
230
|
+
function x(o, t) {
|
|
231
|
+
var e = 0;
|
|
232
|
+
if (!o || !o.parentNode)
|
|
233
|
+
return -1;
|
|
234
|
+
for (; o = o.previousElementSibling; )
|
|
235
|
+
o.nodeName.toUpperCase() !== "TEMPLATE" && o !== g.clone && (!t || Zt(o, t)) && e++;
|
|
236
|
+
return e;
|
|
237
|
+
}
|
|
238
|
+
function Ae(o) {
|
|
239
|
+
var t = 0, e = 0, n = Z();
|
|
240
|
+
if (o)
|
|
241
|
+
do {
|
|
242
|
+
var i = ht(o), r = i.a, a = i.d;
|
|
243
|
+
t += o.scrollLeft * r, e += o.scrollTop * a;
|
|
244
|
+
} while (o !== n && (o = o.parentNode));
|
|
245
|
+
return [t, e];
|
|
246
|
+
}
|
|
247
|
+
function an(o, t) {
|
|
248
|
+
for (var e in o)
|
|
249
|
+
if (o.hasOwnProperty(e)) {
|
|
250
|
+
for (var n in t)
|
|
251
|
+
if (t.hasOwnProperty(n) && t[n] === o[e][n]) return Number(e);
|
|
252
|
+
}
|
|
253
|
+
return -1;
|
|
254
|
+
}
|
|
255
|
+
function lt(o, t) {
|
|
256
|
+
if (!o || !o.getBoundingClientRect) return Z();
|
|
257
|
+
var e = o, n = !1;
|
|
258
|
+
do
|
|
259
|
+
if (e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight) {
|
|
260
|
+
var i = h(e);
|
|
261
|
+
if (e.clientWidth < e.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || e.clientHeight < e.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
262
|
+
if (!e.getBoundingClientRect || e === document.body) return Z();
|
|
263
|
+
if (n || t) return e;
|
|
264
|
+
n = !0;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
while (e = e.parentNode);
|
|
268
|
+
return Z();
|
|
269
|
+
}
|
|
270
|
+
function ln(o, t) {
|
|
271
|
+
if (o && t)
|
|
272
|
+
for (var e in t)
|
|
273
|
+
t.hasOwnProperty(e) && (o[e] = t[e]);
|
|
274
|
+
return o;
|
|
275
|
+
}
|
|
276
|
+
function oe(o, t) {
|
|
277
|
+
return Math.round(o.top) === Math.round(t.top) && Math.round(o.left) === Math.round(t.left) && Math.round(o.height) === Math.round(t.height) && Math.round(o.width) === Math.round(t.width);
|
|
278
|
+
}
|
|
279
|
+
var Mt;
|
|
280
|
+
function Be(o, t) {
|
|
281
|
+
return function() {
|
|
282
|
+
if (!Mt) {
|
|
283
|
+
var e = arguments, n = this;
|
|
284
|
+
e.length === 1 ? o.call(n, e[0]) : o.apply(n, e), Mt = setTimeout(function() {
|
|
285
|
+
Mt = void 0;
|
|
286
|
+
}, t);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function sn() {
|
|
291
|
+
clearTimeout(Mt), Mt = void 0;
|
|
292
|
+
}
|
|
293
|
+
function He(o, t, e) {
|
|
294
|
+
o.scrollLeft += t, o.scrollTop += e;
|
|
295
|
+
}
|
|
296
|
+
function we(o) {
|
|
297
|
+
var t = window.Polymer, e = window.jQuery || window.Zepto;
|
|
298
|
+
return t && t.dom ? t.dom(o).cloneNode(!0) : e ? e(o).clone(!0)[0] : o.cloneNode(!0);
|
|
299
|
+
}
|
|
300
|
+
function Ie(o, t) {
|
|
301
|
+
h(o, "position", "absolute"), h(o, "top", t.top), h(o, "left", t.left), h(o, "width", t.width), h(o, "height", t.height);
|
|
302
|
+
}
|
|
303
|
+
function ie(o) {
|
|
304
|
+
h(o, "position", ""), h(o, "top", ""), h(o, "left", ""), h(o, "width", ""), h(o, "height", "");
|
|
305
|
+
}
|
|
306
|
+
function Ge(o, t, e) {
|
|
307
|
+
var n = {};
|
|
308
|
+
return Array.from(o.children).forEach(function(i) {
|
|
309
|
+
var r, a, l, s;
|
|
310
|
+
if (!(!G(i, t.draggable, o, !1) || i.animated || i === e)) {
|
|
311
|
+
var u = O(i);
|
|
312
|
+
n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, u.left), n.top = Math.min((a = n.top) !== null && a !== void 0 ? a : 1 / 0, u.top), n.right = Math.max((l = n.right) !== null && l !== void 0 ? l : -1 / 0, u.right), n.bottom = Math.max((s = n.bottom) !== null && s !== void 0 ? s : -1 / 0, u.bottom);
|
|
313
|
+
}
|
|
314
|
+
}), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
|
|
315
|
+
}
|
|
316
|
+
var R = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
317
|
+
function un() {
|
|
318
|
+
var o = [], t;
|
|
319
|
+
return {
|
|
320
|
+
captureAnimationState: function() {
|
|
321
|
+
if (o = [], !!this.options.animation) {
|
|
322
|
+
var n = [].slice.call(this.el.children);
|
|
323
|
+
n.forEach(function(i) {
|
|
324
|
+
if (!(h(i, "display") === "none" || i === g.ghost)) {
|
|
325
|
+
o.push({
|
|
326
|
+
target: i,
|
|
327
|
+
rect: O(i)
|
|
328
|
+
});
|
|
329
|
+
var r = Q({}, o[o.length - 1].rect);
|
|
330
|
+
if (i.thisAnimationDuration) {
|
|
331
|
+
var a = ht(i, !0);
|
|
332
|
+
a && (r.top -= a.f, r.left -= a.e);
|
|
333
|
+
}
|
|
334
|
+
i.fromRect = r;
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
addAnimationState: function(n) {
|
|
340
|
+
o.push(n);
|
|
341
|
+
},
|
|
342
|
+
removeAnimationState: function(n) {
|
|
343
|
+
o.splice(an(o, {
|
|
344
|
+
target: n
|
|
345
|
+
}), 1);
|
|
346
|
+
},
|
|
347
|
+
animateAll: function(n) {
|
|
348
|
+
var i = this;
|
|
349
|
+
if (!this.options.animation) {
|
|
350
|
+
clearTimeout(t), typeof n == "function" && n();
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
var r = !1, a = 0;
|
|
354
|
+
o.forEach(function(l) {
|
|
355
|
+
var s = 0, u = l.target, d = u.fromRect, c = O(u), p = u.prevFromRect, D = u.prevToRect, w = l.rect, S = ht(u, !0);
|
|
356
|
+
S && (c.top -= S.f, c.left -= S.e), u.toRect = c, u.thisAnimationDuration && oe(p, c) && !oe(d, c) && // Make sure animatingRect is on line between toRect & fromRect
|
|
357
|
+
(w.top - c.top) / (w.left - c.left) === (d.top - c.top) / (d.left - c.left) && (s = cn(w, p, D, i.options)), oe(c, d) || (u.prevFromRect = d, u.prevToRect = c, s || (s = i.options.animation), i.animate(u, w, c, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
|
|
358
|
+
u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
|
|
359
|
+
}, s), u.thisAnimationDuration = s);
|
|
360
|
+
}), clearTimeout(t), r ? t = setTimeout(function() {
|
|
361
|
+
typeof n == "function" && n();
|
|
362
|
+
}, a) : typeof n == "function" && n(), o = [];
|
|
363
|
+
},
|
|
364
|
+
animate: function(n, i, r, a) {
|
|
365
|
+
if (a) {
|
|
366
|
+
h(n, "transition", ""), h(n, "transform", "");
|
|
367
|
+
var l = ht(this.el), s = l && l.a, u = l && l.d, d = (i.left - r.left) / (s || 1), c = (i.top - r.top) / (u || 1);
|
|
368
|
+
n.animatingX = !!d, n.animatingY = !!c, h(n, "transform", "translate3d(" + d + "px," + c + "px,0)"), this.forRepaintDummy = fn(n), h(n, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), h(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
|
|
369
|
+
h(n, "transition", ""), h(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
|
|
370
|
+
}, a);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function fn(o) {
|
|
376
|
+
return o.offsetWidth;
|
|
377
|
+
}
|
|
378
|
+
function cn(o, t, e, n) {
|
|
379
|
+
return Math.sqrt(Math.pow(t.top - o.top, 2) + Math.pow(t.left - o.left, 2)) / Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) * n.animation;
|
|
380
|
+
}
|
|
381
|
+
var pt = [], re = {
|
|
382
|
+
initializeByDefault: !0
|
|
383
|
+
}, Yt = {
|
|
384
|
+
mount: function(t) {
|
|
385
|
+
for (var e in re)
|
|
386
|
+
re.hasOwnProperty(e) && !(e in t) && (t[e] = re[e]);
|
|
387
|
+
pt.forEach(function(n) {
|
|
388
|
+
if (n.pluginName === t.pluginName)
|
|
389
|
+
throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
|
|
390
|
+
}), pt.push(t);
|
|
391
|
+
},
|
|
392
|
+
pluginEvent: function(t, e, n) {
|
|
393
|
+
var i = this;
|
|
394
|
+
this.eventCanceled = !1, n.cancel = function() {
|
|
395
|
+
i.eventCanceled = !0;
|
|
396
|
+
};
|
|
397
|
+
var r = t + "Global";
|
|
398
|
+
pt.forEach(function(a) {
|
|
399
|
+
e[a.pluginName] && (e[a.pluginName][r] && e[a.pluginName][r](Q({
|
|
400
|
+
sortable: e
|
|
401
|
+
}, n)), e.options[a.pluginName] && e[a.pluginName][t] && e[a.pluginName][t](Q({
|
|
402
|
+
sortable: e
|
|
403
|
+
}, n)));
|
|
404
|
+
});
|
|
405
|
+
},
|
|
406
|
+
initializePlugins: function(t, e, n, i) {
|
|
407
|
+
pt.forEach(function(l) {
|
|
408
|
+
var s = l.pluginName;
|
|
409
|
+
if (!(!t.options[s] && !l.initializeByDefault)) {
|
|
410
|
+
var u = new l(t, e, t.options);
|
|
411
|
+
u.sortable = t, u.options = t.options, t[s] = u, $(n, u.defaults);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
for (var r in t.options)
|
|
415
|
+
if (t.options.hasOwnProperty(r)) {
|
|
416
|
+
var a = this.modifyOption(t, r, t.options[r]);
|
|
417
|
+
typeof a < "u" && (t.options[r] = a);
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
getEventProperties: function(t, e) {
|
|
421
|
+
var n = {};
|
|
422
|
+
return pt.forEach(function(i) {
|
|
423
|
+
typeof i.eventProperties == "function" && $(n, i.eventProperties.call(e[i.pluginName], t));
|
|
424
|
+
}), n;
|
|
425
|
+
},
|
|
426
|
+
modifyOption: function(t, e, n) {
|
|
427
|
+
var i;
|
|
428
|
+
return pt.forEach(function(r) {
|
|
429
|
+
t[r.pluginName] && r.optionListeners && typeof r.optionListeners[e] == "function" && (i = r.optionListeners[e].call(t[r.pluginName], n));
|
|
430
|
+
}), i;
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
function At(o) {
|
|
434
|
+
var t = o.sortable, e = o.rootEl, n = o.name, i = o.targetEl, r = o.cloneEl, a = o.toEl, l = o.fromEl, s = o.oldIndex, u = o.newIndex, d = o.oldDraggableIndex, c = o.newDraggableIndex, p = o.originalEvent, D = o.putSortable, w = o.extraEventProperties;
|
|
435
|
+
if (t = t || e && e[R], !!t) {
|
|
436
|
+
var S, X = t.options, j = "on" + n.charAt(0).toUpperCase() + n.substr(1);
|
|
437
|
+
window.CustomEvent && !nt && !Xt ? S = new CustomEvent(n, {
|
|
438
|
+
bubbles: !0,
|
|
439
|
+
cancelable: !0
|
|
440
|
+
}) : (S = document.createEvent("Event"), S.initEvent(n, !0, !0)), S.to = a || e, S.from = l || e, S.item = i || e, S.clone = r, S.oldIndex = s, S.newIndex = u, S.oldDraggableIndex = d, S.newDraggableIndex = c, S.originalEvent = p, S.pullMode = D ? D.lastPutMode : void 0;
|
|
441
|
+
var E = Q(Q({}, w), Yt.getEventProperties(n, t));
|
|
442
|
+
for (var _ in E)
|
|
443
|
+
S[_] = E[_];
|
|
444
|
+
e && e.dispatchEvent(S), X[j] && X[j].call(t, S);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
var dn = ["evt"], B = function(t, e) {
|
|
448
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = Qe(n, dn);
|
|
449
|
+
Yt.pluginEvent.bind(g)(t, e, Q({
|
|
450
|
+
dragEl: f,
|
|
451
|
+
parentEl: N,
|
|
452
|
+
ghostEl: v,
|
|
453
|
+
rootEl: T,
|
|
454
|
+
nextEl: dt,
|
|
455
|
+
lastDownEl: Ut,
|
|
456
|
+
cloneEl: A,
|
|
457
|
+
cloneHidden: at,
|
|
458
|
+
dragStarted: It,
|
|
459
|
+
putSortable: F,
|
|
460
|
+
activeSortable: g.active,
|
|
461
|
+
originalEvent: i,
|
|
462
|
+
oldIndex: bt,
|
|
463
|
+
oldDraggableIndex: Ft,
|
|
464
|
+
newIndex: L,
|
|
465
|
+
newDraggableIndex: rt,
|
|
466
|
+
hideGhostForTarget: je,
|
|
467
|
+
unhideGhostForTarget: ze,
|
|
468
|
+
cloneNowHidden: function() {
|
|
469
|
+
at = !0;
|
|
470
|
+
},
|
|
471
|
+
cloneNowShown: function() {
|
|
472
|
+
at = !1;
|
|
473
|
+
},
|
|
474
|
+
dispatchSortableEvent: function(l) {
|
|
475
|
+
Y({
|
|
476
|
+
sortable: e,
|
|
477
|
+
name: l,
|
|
478
|
+
originalEvent: i
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}, r));
|
|
482
|
+
};
|
|
483
|
+
function Y(o) {
|
|
484
|
+
At(Q({
|
|
485
|
+
putSortable: F,
|
|
486
|
+
cloneEl: A,
|
|
487
|
+
targetEl: f,
|
|
488
|
+
rootEl: T,
|
|
489
|
+
oldIndex: bt,
|
|
490
|
+
oldDraggableIndex: Ft,
|
|
491
|
+
newIndex: L,
|
|
492
|
+
newDraggableIndex: rt
|
|
493
|
+
}, o));
|
|
494
|
+
}
|
|
495
|
+
var f, N, v, T, dt, Ut, A, at, bt, L, Ft, rt, Ht, F, vt = !1, Qt = !1, Jt = [], ft, q, ae, le, Ne, xe, It, gt, Rt, kt = !1, Gt = !1, $t, k, se = [], pe = !1, te = [], ne = typeof document < "u", Wt = be, Pe = Xt || nt ? "cssFloat" : "float", hn = ne && !Re && !be && "draggable" in document.createElement("div"), We = (function() {
|
|
496
|
+
if (ne) {
|
|
497
|
+
if (nt)
|
|
498
|
+
return !1;
|
|
499
|
+
var o = document.createElement("x");
|
|
500
|
+
return o.style.cssText = "pointer-events:auto", o.style.pointerEvents === "auto";
|
|
501
|
+
}
|
|
502
|
+
})(), Ke = function(t, e) {
|
|
503
|
+
var n = h(t), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = yt(t, 0, e), a = yt(t, 1, e), l = r && h(r), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + O(r).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + O(a).width;
|
|
504
|
+
if (n.display === "flex")
|
|
505
|
+
return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
506
|
+
if (n.display === "grid")
|
|
507
|
+
return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
508
|
+
if (r && l.float && l.float !== "none") {
|
|
509
|
+
var c = l.float === "left" ? "left" : "right";
|
|
510
|
+
return a && (s.clear === "both" || s.clear === c) ? "vertical" : "horizontal";
|
|
511
|
+
}
|
|
512
|
+
return r && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= i && n[Pe] === "none" || a && n[Pe] === "none" && u + d > i) ? "vertical" : "horizontal";
|
|
513
|
+
}, pn = function(t, e, n) {
|
|
514
|
+
var i = n ? t.left : t.top, r = n ? t.right : t.bottom, a = n ? t.width : t.height, l = n ? e.left : e.top, s = n ? e.right : e.bottom, u = n ? e.width : e.height;
|
|
515
|
+
return i === l || r === s || i + a / 2 === l + u / 2;
|
|
516
|
+
}, gn = function(t, e) {
|
|
517
|
+
var n;
|
|
518
|
+
return Jt.some(function(i) {
|
|
519
|
+
var r = i[R].options.emptyInsertThreshold;
|
|
520
|
+
if (!(!r || ye(i))) {
|
|
521
|
+
var a = O(i), l = t >= a.left - r && t <= a.right + r, s = e >= a.top - r && e <= a.bottom + r;
|
|
522
|
+
if (l && s)
|
|
523
|
+
return n = i;
|
|
524
|
+
}
|
|
525
|
+
}), n;
|
|
526
|
+
}, Le = function(t) {
|
|
527
|
+
function e(r, a) {
|
|
528
|
+
return function(l, s, u, d) {
|
|
529
|
+
var c = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
|
|
530
|
+
if (r == null && (a || c))
|
|
531
|
+
return !0;
|
|
532
|
+
if (r == null || r === !1)
|
|
533
|
+
return !1;
|
|
534
|
+
if (a && r === "clone")
|
|
535
|
+
return r;
|
|
536
|
+
if (typeof r == "function")
|
|
537
|
+
return e(r(l, s, u, d), a)(l, s, u, d);
|
|
538
|
+
var p = (a ? l : s).options.group.name;
|
|
539
|
+
return r === !0 || typeof r == "string" && r === p || r.join && r.indexOf(p) > -1;
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
var n = {}, i = t.group;
|
|
543
|
+
(!i || zt(i) != "object") && (i = {
|
|
544
|
+
name: i
|
|
545
|
+
}), n.name = i.name, n.checkPull = e(i.pull, !0), n.checkPut = e(i.put), n.revertClone = i.revertClone, t.group = n;
|
|
546
|
+
}, je = function() {
|
|
547
|
+
!We && v && h(v, "display", "none");
|
|
548
|
+
}, ze = function() {
|
|
549
|
+
!We && v && h(v, "display", "");
|
|
550
|
+
};
|
|
551
|
+
ne && !Re && document.addEventListener("click", function(o) {
|
|
552
|
+
if (Qt)
|
|
553
|
+
return o.preventDefault(), o.stopPropagation && o.stopPropagation(), o.stopImmediatePropagation && o.stopImmediatePropagation(), Qt = !1, !1;
|
|
554
|
+
}, !0);
|
|
555
|
+
var ct = function(t) {
|
|
556
|
+
if (f) {
|
|
557
|
+
t = t.touches ? t.touches[0] : t;
|
|
558
|
+
var e = gn(t.clientX, t.clientY);
|
|
559
|
+
if (e) {
|
|
560
|
+
var n = {};
|
|
561
|
+
for (var i in t)
|
|
562
|
+
t.hasOwnProperty(i) && (n[i] = t[i]);
|
|
563
|
+
n.target = n.rootEl = e, n.preventDefault = void 0, n.stopPropagation = void 0, e[R]._onDragOver(n);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}, mn = function(t) {
|
|
567
|
+
f && f.parentNode[R]._isOutsideThisEl(t.target);
|
|
568
|
+
};
|
|
569
|
+
function g(o, t) {
|
|
570
|
+
if (!(o && o.nodeType && o.nodeType === 1))
|
|
571
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));
|
|
572
|
+
this.el = o, this.options = t = $({}, t), o[R] = this;
|
|
573
|
+
var e = {
|
|
574
|
+
group: null,
|
|
575
|
+
sort: !0,
|
|
576
|
+
disabled: !1,
|
|
577
|
+
store: null,
|
|
578
|
+
handle: null,
|
|
579
|
+
draggable: /^[uo]l$/i.test(o.nodeName) ? ">li" : ">*",
|
|
580
|
+
swapThreshold: 1,
|
|
581
|
+
// percentage; 0 <= x <= 1
|
|
582
|
+
invertSwap: !1,
|
|
583
|
+
// invert always
|
|
584
|
+
invertedSwapThreshold: null,
|
|
585
|
+
// will be set to same as swapThreshold if default
|
|
586
|
+
removeCloneOnHide: !0,
|
|
587
|
+
direction: function() {
|
|
588
|
+
return Ke(o, this.options);
|
|
589
|
+
},
|
|
590
|
+
ghostClass: "sortable-ghost",
|
|
591
|
+
chosenClass: "sortable-chosen",
|
|
592
|
+
dragClass: "sortable-drag",
|
|
593
|
+
ignore: "a, img",
|
|
594
|
+
filter: null,
|
|
595
|
+
preventOnFilter: !0,
|
|
596
|
+
animation: 0,
|
|
597
|
+
easing: null,
|
|
598
|
+
setData: function(a, l) {
|
|
599
|
+
a.setData("Text", l.textContent);
|
|
600
|
+
},
|
|
601
|
+
dropBubble: !1,
|
|
602
|
+
dragoverBubble: !1,
|
|
603
|
+
dataIdAttr: "data-id",
|
|
604
|
+
delay: 0,
|
|
605
|
+
delayOnTouchOnly: !1,
|
|
606
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
607
|
+
forceFallback: !1,
|
|
608
|
+
fallbackClass: "sortable-fallback",
|
|
609
|
+
fallbackOnBody: !1,
|
|
610
|
+
fallbackTolerance: 0,
|
|
611
|
+
fallbackOffset: {
|
|
612
|
+
x: 0,
|
|
613
|
+
y: 0
|
|
614
|
+
},
|
|
615
|
+
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
616
|
+
supportPointer: g.supportPointer !== !1 && "PointerEvent" in window && (!Pt || be),
|
|
617
|
+
emptyInsertThreshold: 5
|
|
618
|
+
};
|
|
619
|
+
Yt.initializePlugins(this, o, e);
|
|
620
|
+
for (var n in e)
|
|
621
|
+
!(n in t) && (t[n] = e[n]);
|
|
622
|
+
Le(t);
|
|
623
|
+
for (var i in this)
|
|
624
|
+
i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
625
|
+
this.nativeDraggable = t.forceFallback ? !1 : hn, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? y(o, "pointerdown", this._onTapStart) : (y(o, "mousedown", this._onTapStart), y(o, "touchstart", this._onTapStart)), this.nativeDraggable && (y(o, "dragover", this), y(o, "dragenter", this)), Jt.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), $(this, un());
|
|
626
|
+
}
|
|
627
|
+
g.prototype = /** @lends Sortable.prototype */
|
|
628
|
+
{
|
|
629
|
+
constructor: g,
|
|
630
|
+
_isOutsideThisEl: function(t) {
|
|
631
|
+
!this.el.contains(t) && t !== this.el && (gt = null);
|
|
632
|
+
},
|
|
633
|
+
_getDirection: function(t, e) {
|
|
634
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, t, e, f) : this.options.direction;
|
|
635
|
+
},
|
|
636
|
+
_onTapStart: function(t) {
|
|
637
|
+
if (t.cancelable) {
|
|
638
|
+
var e = this, n = this.el, i = this.options, r = i.preventOnFilter, a = t.type, l = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, s = (l || t).target, u = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || s, d = i.filter;
|
|
639
|
+
if (_n(n), !f && !(/mousedown|pointerdown/.test(a) && t.button !== 0 || i.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Pt && s && s.tagName.toUpperCase() === "SELECT") && (s = G(s, i.draggable, n, !1), !(s && s.animated) && Ut !== s)) {
|
|
640
|
+
if (bt = x(s), Ft = x(s, i.draggable), typeof d == "function") {
|
|
641
|
+
if (d.call(this, t, s, this)) {
|
|
642
|
+
Y({
|
|
643
|
+
sortable: e,
|
|
644
|
+
rootEl: u,
|
|
645
|
+
name: "filter",
|
|
646
|
+
targetEl: s,
|
|
647
|
+
toEl: n,
|
|
648
|
+
fromEl: n
|
|
649
|
+
}), B("filter", e, {
|
|
650
|
+
evt: t
|
|
651
|
+
}), r && t.preventDefault();
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
} else if (d && (d = d.split(",").some(function(c) {
|
|
655
|
+
if (c = G(u, c.trim(), n, !1), c)
|
|
656
|
+
return Y({
|
|
657
|
+
sortable: e,
|
|
658
|
+
rootEl: c,
|
|
659
|
+
name: "filter",
|
|
660
|
+
targetEl: s,
|
|
661
|
+
fromEl: n,
|
|
662
|
+
toEl: n
|
|
663
|
+
}), B("filter", e, {
|
|
664
|
+
evt: t
|
|
665
|
+
}), !0;
|
|
666
|
+
}), d)) {
|
|
667
|
+
r && t.preventDefault();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
i.handle && !G(u, i.handle, n, !1) || this._prepareDragStart(t, l, s);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
_prepareDragStart: function(t, e, n) {
|
|
675
|
+
var i = this, r = i.el, a = i.options, l = r.ownerDocument, s;
|
|
676
|
+
if (n && !f && n.parentNode === r) {
|
|
677
|
+
var u = O(n);
|
|
678
|
+
if (T = r, f = n, N = f.parentNode, dt = f.nextSibling, Ut = n, Ht = a.group, g.dragged = f, ft = {
|
|
679
|
+
target: f,
|
|
680
|
+
clientX: (e || t).clientX,
|
|
681
|
+
clientY: (e || t).clientY
|
|
682
|
+
}, Ne = ft.clientX - u.left, xe = ft.clientY - u.top, this._lastX = (e || t).clientX, this._lastY = (e || t).clientY, f.style["will-change"] = "all", s = function() {
|
|
683
|
+
if (B("delayEnded", i, {
|
|
684
|
+
evt: t
|
|
685
|
+
}), g.eventCanceled) {
|
|
686
|
+
i._onDrop();
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
i._disableDelayedDragEvents(), !Ce && i.nativeDraggable && (f.draggable = !0), i._triggerDragStart(t, e), Y({
|
|
690
|
+
sortable: i,
|
|
691
|
+
name: "choose",
|
|
692
|
+
originalEvent: t
|
|
693
|
+
}), I(f, a.chosenClass, !0);
|
|
694
|
+
}, a.ignore.split(",").forEach(function(d) {
|
|
695
|
+
Ye(f, d.trim(), ue);
|
|
696
|
+
}), y(l, "dragover", ct), y(l, "mousemove", ct), y(l, "touchmove", ct), a.supportPointer ? (y(l, "pointerup", i._onDrop), !this.nativeDraggable && y(l, "pointercancel", i._onDrop)) : (y(l, "mouseup", i._onDrop), y(l, "touchend", i._onDrop), y(l, "touchcancel", i._onDrop)), Ce && this.nativeDraggable && (this.options.touchStartThreshold = 4, f.draggable = !0), B("delayStart", this, {
|
|
697
|
+
evt: t
|
|
698
|
+
}), a.delay && (!a.delayOnTouchOnly || e) && (!this.nativeDraggable || !(Xt || nt))) {
|
|
699
|
+
if (g.eventCanceled) {
|
|
700
|
+
this._onDrop();
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
a.supportPointer ? (y(l, "pointerup", i._disableDelayedDrag), y(l, "pointercancel", i._disableDelayedDrag)) : (y(l, "mouseup", i._disableDelayedDrag), y(l, "touchend", i._disableDelayedDrag), y(l, "touchcancel", i._disableDelayedDrag)), y(l, "mousemove", i._delayedDragTouchMoveHandler), y(l, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && y(l, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(s, a.delay);
|
|
704
|
+
} else
|
|
705
|
+
s();
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
_delayedDragTouchMoveHandler: function(t) {
|
|
709
|
+
var e = t.touches ? t.touches[0] : t;
|
|
710
|
+
Math.max(Math.abs(e.clientX - this._lastX), Math.abs(e.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
711
|
+
},
|
|
712
|
+
_disableDelayedDrag: function() {
|
|
713
|
+
f && ue(f), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
714
|
+
},
|
|
715
|
+
_disableDelayedDragEvents: function() {
|
|
716
|
+
var t = this.el.ownerDocument;
|
|
717
|
+
b(t, "mouseup", this._disableDelayedDrag), b(t, "touchend", this._disableDelayedDrag), b(t, "touchcancel", this._disableDelayedDrag), b(t, "pointerup", this._disableDelayedDrag), b(t, "pointercancel", this._disableDelayedDrag), b(t, "mousemove", this._delayedDragTouchMoveHandler), b(t, "touchmove", this._delayedDragTouchMoveHandler), b(t, "pointermove", this._delayedDragTouchMoveHandler);
|
|
718
|
+
},
|
|
719
|
+
_triggerDragStart: function(t, e) {
|
|
720
|
+
e = e || t.pointerType == "touch" && t, !this.nativeDraggable || e ? this.options.supportPointer ? y(document, "pointermove", this._onTouchMove) : e ? y(document, "touchmove", this._onTouchMove) : y(document, "mousemove", this._onTouchMove) : (y(f, "dragend", this), y(T, "dragstart", this._onDragStart));
|
|
721
|
+
try {
|
|
722
|
+
document.selection ? qt(function() {
|
|
723
|
+
document.selection.empty();
|
|
724
|
+
}) : window.getSelection().removeAllRanges();
|
|
725
|
+
} catch {
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
_dragStarted: function(t, e) {
|
|
729
|
+
if (vt = !1, T && f) {
|
|
730
|
+
B("dragStarted", this, {
|
|
731
|
+
evt: e
|
|
732
|
+
}), this.nativeDraggable && y(document, "dragover", mn);
|
|
733
|
+
var n = this.options;
|
|
734
|
+
!t && I(f, n.dragClass, !1), I(f, n.ghostClass, !0), g.active = this, t && this._appendGhost(), Y({
|
|
735
|
+
sortable: this,
|
|
736
|
+
name: "start",
|
|
737
|
+
originalEvent: e
|
|
738
|
+
});
|
|
739
|
+
} else
|
|
740
|
+
this._nulling();
|
|
741
|
+
},
|
|
742
|
+
_emulateDragOver: function() {
|
|
743
|
+
if (q) {
|
|
744
|
+
this._lastX = q.clientX, this._lastY = q.clientY, je();
|
|
745
|
+
for (var t = document.elementFromPoint(q.clientX, q.clientY), e = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(q.clientX, q.clientY), t !== e); )
|
|
746
|
+
e = t;
|
|
747
|
+
if (f.parentNode[R]._isOutsideThisEl(t), e)
|
|
748
|
+
do {
|
|
749
|
+
if (e[R]) {
|
|
750
|
+
var n = void 0;
|
|
751
|
+
if (n = e[R]._onDragOver({
|
|
752
|
+
clientX: q.clientX,
|
|
753
|
+
clientY: q.clientY,
|
|
754
|
+
target: t,
|
|
755
|
+
rootEl: e
|
|
756
|
+
}), n && !this.options.dragoverBubble)
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
t = e;
|
|
760
|
+
} while (e = Xe(e));
|
|
761
|
+
ze();
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
_onTouchMove: function(t) {
|
|
765
|
+
if (ft) {
|
|
766
|
+
var e = this.options, n = e.fallbackTolerance, i = e.fallbackOffset, r = t.touches ? t.touches[0] : t, a = v && ht(v, !0), l = v && a && a.a, s = v && a && a.d, u = Wt && k && Ae(k), d = (r.clientX - ft.clientX + i.x) / (l || 1) + (u ? u[0] - se[0] : 0) / (l || 1), c = (r.clientY - ft.clientY + i.y) / (s || 1) + (u ? u[1] - se[1] : 0) / (s || 1);
|
|
767
|
+
if (!g.active && !vt) {
|
|
768
|
+
if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
|
|
769
|
+
return;
|
|
770
|
+
this._onDragStart(t, !0);
|
|
771
|
+
}
|
|
772
|
+
if (v) {
|
|
773
|
+
a ? (a.e += d - (ae || 0), a.f += c - (le || 0)) : a = {
|
|
774
|
+
a: 1,
|
|
775
|
+
b: 0,
|
|
776
|
+
c: 0,
|
|
777
|
+
d: 1,
|
|
778
|
+
e: d,
|
|
779
|
+
f: c
|
|
780
|
+
};
|
|
781
|
+
var p = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
|
|
782
|
+
h(v, "webkitTransform", p), h(v, "mozTransform", p), h(v, "msTransform", p), h(v, "transform", p), ae = d, le = c, q = r;
|
|
783
|
+
}
|
|
784
|
+
t.cancelable && t.preventDefault();
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
_appendGhost: function() {
|
|
788
|
+
if (!v) {
|
|
789
|
+
var t = this.options.fallbackOnBody ? document.body : T, e = O(f, !0, Wt, !0, t), n = this.options;
|
|
790
|
+
if (Wt) {
|
|
791
|
+
for (k = t; h(k, "position") === "static" && h(k, "transform") === "none" && k !== document; )
|
|
792
|
+
k = k.parentNode;
|
|
793
|
+
k !== document.body && k !== document.documentElement ? (k === document && (k = Z()), e.top += k.scrollTop, e.left += k.scrollLeft) : k = Z(), se = Ae(k);
|
|
794
|
+
}
|
|
795
|
+
v = f.cloneNode(!0), I(v, n.ghostClass, !1), I(v, n.fallbackClass, !0), I(v, n.dragClass, !0), h(v, "transition", ""), h(v, "transform", ""), h(v, "box-sizing", "border-box"), h(v, "margin", 0), h(v, "top", e.top), h(v, "left", e.left), h(v, "width", e.width), h(v, "height", e.height), h(v, "opacity", "0.8"), h(v, "position", Wt ? "absolute" : "fixed"), h(v, "zIndex", "100000"), h(v, "pointerEvents", "none"), g.ghost = v, t.appendChild(v), h(v, "transform-origin", Ne / parseInt(v.style.width) * 100 + "% " + xe / parseInt(v.style.height) * 100 + "%");
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
_onDragStart: function(t, e) {
|
|
799
|
+
var n = this, i = t.dataTransfer, r = n.options;
|
|
800
|
+
if (B("dragStart", this, {
|
|
801
|
+
evt: t
|
|
802
|
+
}), g.eventCanceled) {
|
|
803
|
+
this._onDrop();
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
B("setupClone", this), g.eventCanceled || (A = we(f), A.removeAttribute("id"), A.draggable = !1, A.style["will-change"] = "", this._hideClone(), I(A, this.options.chosenClass, !1), g.clone = A), n.cloneId = qt(function() {
|
|
807
|
+
B("clone", n), !g.eventCanceled && (n.options.removeCloneOnHide || T.insertBefore(A, f), n._hideClone(), Y({
|
|
808
|
+
sortable: n,
|
|
809
|
+
name: "clone"
|
|
810
|
+
}));
|
|
811
|
+
}), !e && I(f, r.dragClass, !0), e ? (Qt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (b(document, "mouseup", n._onDrop), b(document, "touchend", n._onDrop), b(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, f)), y(document, "drop", n), h(f, "transform", "translateZ(0)")), vt = !0, n._dragStartId = qt(n._dragStarted.bind(n, e, t)), y(document, "selectstart", n), It = !0, window.getSelection().removeAllRanges(), Pt && h(document.body, "user-select", "none");
|
|
812
|
+
},
|
|
813
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
814
|
+
_onDragOver: function(t) {
|
|
815
|
+
var e = this.el, n = t.target, i, r, a, l = this.options, s = l.group, u = g.active, d = Ht === s, c = l.sort, p = F || u, D, w = this, S = !1;
|
|
816
|
+
if (pe) return;
|
|
817
|
+
function X(_t, $e) {
|
|
818
|
+
B(_t, w, Q({
|
|
819
|
+
evt: t,
|
|
820
|
+
isOwner: d,
|
|
821
|
+
axis: D ? "vertical" : "horizontal",
|
|
822
|
+
revert: a,
|
|
823
|
+
dragRect: i,
|
|
824
|
+
targetRect: r,
|
|
825
|
+
canSort: c,
|
|
826
|
+
fromSortable: p,
|
|
827
|
+
target: n,
|
|
828
|
+
completed: E,
|
|
829
|
+
onMove: function(Se, qe) {
|
|
830
|
+
return Kt(T, e, f, i, Se, O(Se), t, qe);
|
|
831
|
+
},
|
|
832
|
+
changed: _
|
|
833
|
+
}, $e));
|
|
834
|
+
}
|
|
835
|
+
function j() {
|
|
836
|
+
X("dragOverAnimationCapture"), w.captureAnimationState(), w !== p && p.captureAnimationState();
|
|
837
|
+
}
|
|
838
|
+
function E(_t) {
|
|
839
|
+
return X("dragOverCompleted", {
|
|
840
|
+
insertion: _t
|
|
841
|
+
}), _t && (d ? u._hideClone() : u._showClone(w), w !== p && (I(f, F ? F.options.ghostClass : u.options.ghostClass, !1), I(f, l.ghostClass, !0)), F !== w && w !== g.active ? F = w : w === g.active && F && (F = null), p === w && (w._ignoreWhileAnimating = n), w.animateAll(function() {
|
|
842
|
+
X("dragOverAnimationComplete"), w._ignoreWhileAnimating = null;
|
|
843
|
+
}), w !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (n === f && !f.animated || n === e && !n.animated) && (gt = null), !l.dragoverBubble && !t.rootEl && n !== document && (f.parentNode[R]._isOutsideThisEl(t.target), !_t && ct(t)), !l.dragoverBubble && t.stopPropagation && t.stopPropagation(), S = !0;
|
|
844
|
+
}
|
|
845
|
+
function _() {
|
|
846
|
+
L = x(f), rt = x(f, l.draggable), Y({
|
|
847
|
+
sortable: w,
|
|
848
|
+
name: "change",
|
|
849
|
+
toEl: e,
|
|
850
|
+
newIndex: L,
|
|
851
|
+
newDraggableIndex: rt,
|
|
852
|
+
originalEvent: t
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), n = G(n, l.draggable, e, !0), X("dragOver"), g.eventCanceled) return S;
|
|
856
|
+
if (f.contains(t.target) || n.animated && n.animatingX && n.animatingY || w._ignoreWhileAnimating === n)
|
|
857
|
+
return E(!1);
|
|
858
|
+
if (Qt = !1, u && !l.disabled && (d ? c || (a = N !== T) : F === this || (this.lastPutMode = Ht.checkPull(this, u, f, t)) && s.checkPut(this, u, f, t))) {
|
|
859
|
+
if (D = this._getDirection(t, n) === "vertical", i = O(f), X("dragOverValid"), g.eventCanceled) return S;
|
|
860
|
+
if (a)
|
|
861
|
+
return N = T, j(), this._hideClone(), X("revert"), g.eventCanceled || (dt ? T.insertBefore(f, dt) : T.appendChild(f)), E(!0);
|
|
862
|
+
var M = ye(e, l.draggable);
|
|
863
|
+
if (!M || wn(t, D, this) && !M.animated) {
|
|
864
|
+
if (M === f)
|
|
865
|
+
return E(!1);
|
|
866
|
+
if (M && e === t.target && (n = M), n && (r = O(n)), Kt(T, e, f, i, n, r, t, !!n) !== !1)
|
|
867
|
+
return j(), M && M.nextSibling ? e.insertBefore(f, M.nextSibling) : e.appendChild(f), N = e, _(), E(!0);
|
|
868
|
+
} else if (M && yn(t, D, this)) {
|
|
869
|
+
var J = yt(e, 0, l, !0);
|
|
870
|
+
if (J === f)
|
|
871
|
+
return E(!1);
|
|
872
|
+
if (n = J, r = O(n), Kt(T, e, f, i, n, r, t, !1) !== !1)
|
|
873
|
+
return j(), e.insertBefore(f, J), N = e, _(), E(!0);
|
|
874
|
+
} else if (n.parentNode === e) {
|
|
875
|
+
r = O(n);
|
|
876
|
+
var z = 0, st, wt = f.parentNode !== e, W = !pn(f.animated && f.toRect || i, n.animated && n.toRect || r, D), Et = D ? "top" : "left", ot = Te(n, "top", "top") || Te(f, "top", "top"), Dt = ot ? ot.scrollTop : void 0;
|
|
877
|
+
gt !== n && (st = r[Et], kt = !1, Gt = !W && l.invertSwap || wt), z = En(t, n, r, D, W ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Gt, gt === n);
|
|
878
|
+
var tt;
|
|
879
|
+
if (z !== 0) {
|
|
880
|
+
var ut = x(f);
|
|
881
|
+
do
|
|
882
|
+
ut -= z, tt = N.children[ut];
|
|
883
|
+
while (tt && (h(tt, "display") === "none" || tt === v));
|
|
884
|
+
}
|
|
885
|
+
if (z === 0 || tt === n)
|
|
886
|
+
return E(!1);
|
|
887
|
+
gt = n, Rt = z;
|
|
888
|
+
var St = n.nextElementSibling, it = !1;
|
|
889
|
+
it = z === 1;
|
|
890
|
+
var Bt = Kt(T, e, f, i, n, r, t, it);
|
|
891
|
+
if (Bt !== !1)
|
|
892
|
+
return (Bt === 1 || Bt === -1) && (it = Bt === 1), pe = !0, setTimeout(bn, 30), j(), it && !St ? e.appendChild(f) : n.parentNode.insertBefore(f, it ? St : n), ot && He(ot, 0, Dt - ot.scrollTop), N = f.parentNode, st !== void 0 && !Gt && ($t = Math.abs(st - O(n)[Et])), _(), E(!0);
|
|
893
|
+
}
|
|
894
|
+
if (e.contains(f))
|
|
895
|
+
return E(!1);
|
|
896
|
+
}
|
|
897
|
+
return !1;
|
|
898
|
+
},
|
|
899
|
+
_ignoreWhileAnimating: null,
|
|
900
|
+
_offMoveEvents: function() {
|
|
901
|
+
b(document, "mousemove", this._onTouchMove), b(document, "touchmove", this._onTouchMove), b(document, "pointermove", this._onTouchMove), b(document, "dragover", ct), b(document, "mousemove", ct), b(document, "touchmove", ct);
|
|
902
|
+
},
|
|
903
|
+
_offUpEvents: function() {
|
|
904
|
+
var t = this.el.ownerDocument;
|
|
905
|
+
b(t, "mouseup", this._onDrop), b(t, "touchend", this._onDrop), b(t, "pointerup", this._onDrop), b(t, "pointercancel", this._onDrop), b(t, "touchcancel", this._onDrop), b(document, "selectstart", this);
|
|
906
|
+
},
|
|
907
|
+
_onDrop: function(t) {
|
|
908
|
+
var e = this.el, n = this.options;
|
|
909
|
+
if (L = x(f), rt = x(f, n.draggable), B("drop", this, {
|
|
910
|
+
evt: t
|
|
911
|
+
}), N = f && f.parentNode, L = x(f), rt = x(f, n.draggable), g.eventCanceled) {
|
|
912
|
+
this._nulling();
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
vt = !1, Gt = !1, kt = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), ge(this.cloneId), ge(this._dragStartId), this.nativeDraggable && (b(document, "drop", this), b(e, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Pt && h(document.body, "user-select", ""), h(f, "transform", ""), t && (It && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), v && v.parentNode && v.parentNode.removeChild(v), (T === N || F && F.lastPutMode !== "clone") && A && A.parentNode && A.parentNode.removeChild(A), f && (this.nativeDraggable && b(f, "dragend", this), ue(f), f.style["will-change"] = "", It && !vt && I(f, F ? F.options.ghostClass : this.options.ghostClass, !1), I(f, this.options.chosenClass, !1), Y({
|
|
916
|
+
sortable: this,
|
|
917
|
+
name: "unchoose",
|
|
918
|
+
toEl: N,
|
|
919
|
+
newIndex: null,
|
|
920
|
+
newDraggableIndex: null,
|
|
921
|
+
originalEvent: t
|
|
922
|
+
}), T !== N ? (L >= 0 && (Y({
|
|
923
|
+
rootEl: N,
|
|
924
|
+
name: "add",
|
|
925
|
+
toEl: N,
|
|
926
|
+
fromEl: T,
|
|
927
|
+
originalEvent: t
|
|
928
|
+
}), Y({
|
|
929
|
+
sortable: this,
|
|
930
|
+
name: "remove",
|
|
931
|
+
toEl: N,
|
|
932
|
+
originalEvent: t
|
|
933
|
+
}), Y({
|
|
934
|
+
rootEl: N,
|
|
935
|
+
name: "sort",
|
|
936
|
+
toEl: N,
|
|
937
|
+
fromEl: T,
|
|
938
|
+
originalEvent: t
|
|
939
|
+
}), Y({
|
|
940
|
+
sortable: this,
|
|
941
|
+
name: "sort",
|
|
942
|
+
toEl: N,
|
|
943
|
+
originalEvent: t
|
|
944
|
+
})), F && F.save()) : L !== bt && L >= 0 && (Y({
|
|
945
|
+
sortable: this,
|
|
946
|
+
name: "update",
|
|
947
|
+
toEl: N,
|
|
948
|
+
originalEvent: t
|
|
949
|
+
}), Y({
|
|
950
|
+
sortable: this,
|
|
951
|
+
name: "sort",
|
|
952
|
+
toEl: N,
|
|
953
|
+
originalEvent: t
|
|
954
|
+
})), g.active && ((L == null || L === -1) && (L = bt, rt = Ft), Y({
|
|
955
|
+
sortable: this,
|
|
956
|
+
name: "end",
|
|
957
|
+
toEl: N,
|
|
958
|
+
originalEvent: t
|
|
959
|
+
}), this.save()))), this._nulling();
|
|
960
|
+
},
|
|
961
|
+
_nulling: function() {
|
|
962
|
+
B("nulling", this), T = f = N = v = dt = A = Ut = at = ft = q = It = L = rt = bt = Ft = gt = Rt = F = Ht = g.dragged = g.ghost = g.clone = g.active = null, te.forEach(function(t) {
|
|
963
|
+
t.checked = !0;
|
|
964
|
+
}), te.length = ae = le = 0;
|
|
965
|
+
},
|
|
966
|
+
handleEvent: function(t) {
|
|
967
|
+
switch (t.type) {
|
|
968
|
+
case "drop":
|
|
969
|
+
case "dragend":
|
|
970
|
+
this._onDrop(t);
|
|
971
|
+
break;
|
|
972
|
+
case "dragenter":
|
|
973
|
+
case "dragover":
|
|
974
|
+
f && (this._onDragOver(t), vn(t));
|
|
975
|
+
break;
|
|
976
|
+
case "selectstart":
|
|
977
|
+
t.preventDefault();
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
/**
|
|
982
|
+
* Serializes the item into an array of string.
|
|
983
|
+
* @returns {String[]}
|
|
984
|
+
*/
|
|
985
|
+
toArray: function() {
|
|
986
|
+
for (var t = [], e, n = this.el.children, i = 0, r = n.length, a = this.options; i < r; i++)
|
|
987
|
+
e = n[i], G(e, a.draggable, this.el, !1) && t.push(e.getAttribute(a.dataIdAttr) || Sn(e));
|
|
988
|
+
return t;
|
|
989
|
+
},
|
|
990
|
+
/**
|
|
991
|
+
* Sorts the elements according to the array.
|
|
992
|
+
* @param {String[]} order order of the items
|
|
993
|
+
*/
|
|
994
|
+
sort: function(t, e) {
|
|
995
|
+
var n = {}, i = this.el;
|
|
996
|
+
this.toArray().forEach(function(r, a) {
|
|
997
|
+
var l = i.children[a];
|
|
998
|
+
G(l, this.options.draggable, i, !1) && (n[r] = l);
|
|
999
|
+
}, this), e && this.captureAnimationState(), t.forEach(function(r) {
|
|
1000
|
+
n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
|
|
1001
|
+
}), e && this.animateAll();
|
|
1002
|
+
},
|
|
1003
|
+
/**
|
|
1004
|
+
* Save the current sorting
|
|
1005
|
+
*/
|
|
1006
|
+
save: function() {
|
|
1007
|
+
var t = this.options.store;
|
|
1008
|
+
t && t.set && t.set(this);
|
|
1009
|
+
},
|
|
1010
|
+
/**
|
|
1011
|
+
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
|
1012
|
+
* @param {HTMLElement} el
|
|
1013
|
+
* @param {String} [selector] default: `options.draggable`
|
|
1014
|
+
* @returns {HTMLElement|null}
|
|
1015
|
+
*/
|
|
1016
|
+
closest: function(t, e) {
|
|
1017
|
+
return G(t, e || this.options.draggable, this.el, !1);
|
|
1018
|
+
},
|
|
1019
|
+
/**
|
|
1020
|
+
* Set/get option
|
|
1021
|
+
* @param {string} name
|
|
1022
|
+
* @param {*} [value]
|
|
1023
|
+
* @returns {*}
|
|
1024
|
+
*/
|
|
1025
|
+
option: function(t, e) {
|
|
1026
|
+
var n = this.options;
|
|
1027
|
+
if (e === void 0)
|
|
1028
|
+
return n[t];
|
|
1029
|
+
var i = Yt.modifyOption(this, t, e);
|
|
1030
|
+
typeof i < "u" ? n[t] = i : n[t] = e, t === "group" && Le(n);
|
|
1031
|
+
},
|
|
1032
|
+
/**
|
|
1033
|
+
* Destroy
|
|
1034
|
+
*/
|
|
1035
|
+
destroy: function() {
|
|
1036
|
+
B("destroy", this);
|
|
1037
|
+
var t = this.el;
|
|
1038
|
+
t[R] = null, b(t, "mousedown", this._onTapStart), b(t, "touchstart", this._onTapStart), b(t, "pointerdown", this._onTapStart), this.nativeDraggable && (b(t, "dragover", this), b(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(e) {
|
|
1039
|
+
e.removeAttribute("draggable");
|
|
1040
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), Jt.splice(Jt.indexOf(this.el), 1), this.el = t = null;
|
|
1041
|
+
},
|
|
1042
|
+
_hideClone: function() {
|
|
1043
|
+
if (!at) {
|
|
1044
|
+
if (B("hideClone", this), g.eventCanceled) return;
|
|
1045
|
+
h(A, "display", "none"), this.options.removeCloneOnHide && A.parentNode && A.parentNode.removeChild(A), at = !0;
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
_showClone: function(t) {
|
|
1049
|
+
if (t.lastPutMode !== "clone") {
|
|
1050
|
+
this._hideClone();
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
if (at) {
|
|
1054
|
+
if (B("showClone", this), g.eventCanceled) return;
|
|
1055
|
+
f.parentNode == T && !this.options.group.revertClone ? T.insertBefore(A, f) : dt ? T.insertBefore(A, dt) : T.appendChild(A), this.options.group.revertClone && this.animate(f, A), h(A, "display", ""), at = !1;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
function vn(o) {
|
|
1060
|
+
o.dataTransfer && (o.dataTransfer.dropEffect = "move"), o.cancelable && o.preventDefault();
|
|
1061
|
+
}
|
|
1062
|
+
function Kt(o, t, e, n, i, r, a, l) {
|
|
1063
|
+
var s, u = o[R], d = u.options.onMove, c;
|
|
1064
|
+
return window.CustomEvent && !nt && !Xt ? s = new CustomEvent("move", {
|
|
1065
|
+
bubbles: !0,
|
|
1066
|
+
cancelable: !0
|
|
1067
|
+
}) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = t, s.from = o, s.dragged = e, s.draggedRect = n, s.related = i || t, s.relatedRect = r || O(t), s.willInsertAfter = l, s.originalEvent = a, o.dispatchEvent(s), d && (c = d.call(u, s, a)), c;
|
|
1068
|
+
}
|
|
1069
|
+
function ue(o) {
|
|
1070
|
+
o.draggable = !1;
|
|
1071
|
+
}
|
|
1072
|
+
function bn() {
|
|
1073
|
+
pe = !1;
|
|
1074
|
+
}
|
|
1075
|
+
function yn(o, t, e) {
|
|
1076
|
+
var n = O(yt(e.el, 0, e.options, !0)), i = Ge(e.el, e.options, v), r = 10;
|
|
1077
|
+
return t ? o.clientX < i.left - r || o.clientY < n.top && o.clientX < n.right : o.clientY < i.top - r || o.clientY < n.bottom && o.clientX < n.left;
|
|
1078
|
+
}
|
|
1079
|
+
function wn(o, t, e) {
|
|
1080
|
+
var n = O(ye(e.el, e.options.draggable)), i = Ge(e.el, e.options, v), r = 10;
|
|
1081
|
+
return t ? o.clientX > i.right + r || o.clientY > n.bottom && o.clientX > n.left : o.clientY > i.bottom + r || o.clientX > n.right && o.clientY > n.top;
|
|
1082
|
+
}
|
|
1083
|
+
function En(o, t, e, n, i, r, a, l) {
|
|
1084
|
+
var s = n ? o.clientY : o.clientX, u = n ? e.height : e.width, d = n ? e.top : e.left, c = n ? e.bottom : e.right, p = !1;
|
|
1085
|
+
if (!a) {
|
|
1086
|
+
if (l && $t < u * i) {
|
|
1087
|
+
if (!kt && (Rt === 1 ? s > d + u * r / 2 : s < c - u * r / 2) && (kt = !0), kt)
|
|
1088
|
+
p = !0;
|
|
1089
|
+
else if (Rt === 1 ? s < d + $t : s > c - $t)
|
|
1090
|
+
return -Rt;
|
|
1091
|
+
} else if (s > d + u * (1 - i) / 2 && s < c - u * (1 - i) / 2)
|
|
1092
|
+
return Dn(t);
|
|
1093
|
+
}
|
|
1094
|
+
return p = p || a, p && (s < d + u * r / 2 || s > c - u * r / 2) ? s > d + u / 2 ? 1 : -1 : 0;
|
|
1095
|
+
}
|
|
1096
|
+
function Dn(o) {
|
|
1097
|
+
return x(f) < x(o) ? 1 : -1;
|
|
1098
|
+
}
|
|
1099
|
+
function Sn(o) {
|
|
1100
|
+
for (var t = o.tagName + o.className + o.src + o.href + o.textContent, e = t.length, n = 0; e--; )
|
|
1101
|
+
n += t.charCodeAt(e);
|
|
1102
|
+
return n.toString(36);
|
|
1103
|
+
}
|
|
1104
|
+
function _n(o) {
|
|
1105
|
+
te.length = 0;
|
|
1106
|
+
for (var t = o.getElementsByTagName("input"), e = t.length; e--; ) {
|
|
1107
|
+
var n = t[e];
|
|
1108
|
+
n.checked && te.push(n);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
function qt(o) {
|
|
1112
|
+
return setTimeout(o, 0);
|
|
1113
|
+
}
|
|
1114
|
+
function ge(o) {
|
|
1115
|
+
return clearTimeout(o);
|
|
1116
|
+
}
|
|
1117
|
+
ne && y(document, "touchmove", function(o) {
|
|
1118
|
+
(g.active || vt) && o.cancelable && o.preventDefault();
|
|
1119
|
+
});
|
|
1120
|
+
g.utils = {
|
|
1121
|
+
on: y,
|
|
1122
|
+
off: b,
|
|
1123
|
+
css: h,
|
|
1124
|
+
find: Ye,
|
|
1125
|
+
is: function(t, e) {
|
|
1126
|
+
return !!G(t, e, t, !1);
|
|
1127
|
+
},
|
|
1128
|
+
extend: ln,
|
|
1129
|
+
throttle: Be,
|
|
1130
|
+
closest: G,
|
|
1131
|
+
toggleClass: I,
|
|
1132
|
+
clone: we,
|
|
1133
|
+
index: x,
|
|
1134
|
+
nextTick: qt,
|
|
1135
|
+
cancelNextTick: ge,
|
|
1136
|
+
detectDirection: Ke,
|
|
1137
|
+
getChild: yt,
|
|
1138
|
+
expando: R
|
|
1139
|
+
};
|
|
1140
|
+
g.get = function(o) {
|
|
1141
|
+
return o[R];
|
|
1142
|
+
};
|
|
1143
|
+
g.mount = function() {
|
|
1144
|
+
for (var o = arguments.length, t = new Array(o), e = 0; e < o; e++)
|
|
1145
|
+
t[e] = arguments[e];
|
|
1146
|
+
t[0].constructor === Array && (t = t[0]), t.forEach(function(n) {
|
|
1147
|
+
if (!n.prototype || !n.prototype.constructor)
|
|
1148
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
|
|
1149
|
+
n.utils && (g.utils = Q(Q({}, g.utils), n.utils)), Yt.mount(n);
|
|
1150
|
+
});
|
|
1151
|
+
};
|
|
1152
|
+
g.create = function(o, t) {
|
|
1153
|
+
return new g(o, t);
|
|
1154
|
+
};
|
|
1155
|
+
g.version = rn;
|
|
1156
|
+
var P = [], Nt, me, ve = !1, fe, ce, ee, xt;
|
|
1157
|
+
function Cn() {
|
|
1158
|
+
function o() {
|
|
1159
|
+
this.defaults = {
|
|
1160
|
+
scroll: !0,
|
|
1161
|
+
forceAutoScrollFallback: !1,
|
|
1162
|
+
scrollSensitivity: 30,
|
|
1163
|
+
scrollSpeed: 10,
|
|
1164
|
+
bubbleScroll: !0
|
|
1165
|
+
};
|
|
1166
|
+
for (var t in this)
|
|
1167
|
+
t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
|
|
1168
|
+
}
|
|
1169
|
+
return o.prototype = {
|
|
1170
|
+
dragStarted: function(e) {
|
|
1171
|
+
var n = e.originalEvent;
|
|
1172
|
+
this.sortable.nativeDraggable ? y(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? y(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? y(document, "touchmove", this._handleFallbackAutoScroll) : y(document, "mousemove", this._handleFallbackAutoScroll);
|
|
1173
|
+
},
|
|
1174
|
+
dragOverCompleted: function(e) {
|
|
1175
|
+
var n = e.originalEvent;
|
|
1176
|
+
!this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
|
|
1177
|
+
},
|
|
1178
|
+
drop: function() {
|
|
1179
|
+
this.sortable.nativeDraggable ? b(document, "dragover", this._handleAutoScroll) : (b(document, "pointermove", this._handleFallbackAutoScroll), b(document, "touchmove", this._handleFallbackAutoScroll), b(document, "mousemove", this._handleFallbackAutoScroll)), Me(), Vt(), sn();
|
|
1180
|
+
},
|
|
1181
|
+
nulling: function() {
|
|
1182
|
+
ee = me = Nt = ve = xt = fe = ce = null, P.length = 0;
|
|
1183
|
+
},
|
|
1184
|
+
_handleFallbackAutoScroll: function(e) {
|
|
1185
|
+
this._handleAutoScroll(e, !0);
|
|
1186
|
+
},
|
|
1187
|
+
_handleAutoScroll: function(e, n) {
|
|
1188
|
+
var i = this, r = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, l = document.elementFromPoint(r, a);
|
|
1189
|
+
if (ee = e, n || this.options.forceAutoScrollFallback || Xt || nt || Pt) {
|
|
1190
|
+
de(e, this.options, l, n);
|
|
1191
|
+
var s = lt(l, !0);
|
|
1192
|
+
ve && (!xt || r !== fe || a !== ce) && (xt && Me(), xt = setInterval(function() {
|
|
1193
|
+
var u = lt(document.elementFromPoint(r, a), !0);
|
|
1194
|
+
u !== s && (s = u, Vt()), de(e, i.options, u, n);
|
|
1195
|
+
}, 10), fe = r, ce = a);
|
|
1196
|
+
} else {
|
|
1197
|
+
if (!this.options.bubbleScroll || lt(l, !0) === Z()) {
|
|
1198
|
+
Vt();
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1201
|
+
de(e, this.options, lt(l, !1), !1);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}, $(o, {
|
|
1205
|
+
pluginName: "scroll",
|
|
1206
|
+
initializeByDefault: !0
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
function Vt() {
|
|
1210
|
+
P.forEach(function(o) {
|
|
1211
|
+
clearInterval(o.pid);
|
|
1212
|
+
}), P = [];
|
|
1213
|
+
}
|
|
1214
|
+
function Me() {
|
|
1215
|
+
clearInterval(xt);
|
|
1216
|
+
}
|
|
1217
|
+
var de = Be(function(o, t, e, n) {
|
|
1218
|
+
if (t.scroll) {
|
|
1219
|
+
var i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, a = t.scrollSensitivity, l = t.scrollSpeed, s = Z(), u = !1, d;
|
|
1220
|
+
me !== e && (me = e, Vt(), Nt = t.scroll, d = t.scrollFn, Nt === !0 && (Nt = lt(e, !0)));
|
|
1221
|
+
var c = 0, p = Nt;
|
|
1222
|
+
do {
|
|
1223
|
+
var D = p, w = O(D), S = w.top, X = w.bottom, j = w.left, E = w.right, _ = w.width, M = w.height, J = void 0, z = void 0, st = D.scrollWidth, wt = D.scrollHeight, W = h(D), Et = D.scrollLeft, ot = D.scrollTop;
|
|
1224
|
+
D === s ? (J = _ < st && (W.overflowX === "auto" || W.overflowX === "scroll" || W.overflowX === "visible"), z = M < wt && (W.overflowY === "auto" || W.overflowY === "scroll" || W.overflowY === "visible")) : (J = _ < st && (W.overflowX === "auto" || W.overflowX === "scroll"), z = M < wt && (W.overflowY === "auto" || W.overflowY === "scroll"));
|
|
1225
|
+
var Dt = J && (Math.abs(E - i) <= a && Et + _ < st) - (Math.abs(j - i) <= a && !!Et), tt = z && (Math.abs(X - r) <= a && ot + M < wt) - (Math.abs(S - r) <= a && !!ot);
|
|
1226
|
+
if (!P[c])
|
|
1227
|
+
for (var ut = 0; ut <= c; ut++)
|
|
1228
|
+
P[ut] || (P[ut] = {});
|
|
1229
|
+
(P[c].vx != Dt || P[c].vy != tt || P[c].el !== D) && (P[c].el = D, P[c].vx = Dt, P[c].vy = tt, clearInterval(P[c].pid), (Dt != 0 || tt != 0) && (u = !0, P[c].pid = setInterval((function() {
|
|
1230
|
+
n && this.layer === 0 && g.active._onTouchMove(ee);
|
|
1231
|
+
var St = P[this.layer].vy ? P[this.layer].vy * l : 0, it = P[this.layer].vx ? P[this.layer].vx * l : 0;
|
|
1232
|
+
typeof d == "function" && d.call(g.dragged.parentNode[R], it, St, o, ee, P[this.layer].el) !== "continue" || He(P[this.layer].el, it, St);
|
|
1233
|
+
}).bind({
|
|
1234
|
+
layer: c
|
|
1235
|
+
}), 24))), c++;
|
|
1236
|
+
} while (t.bubbleScroll && p !== s && (p = lt(p, !1)));
|
|
1237
|
+
ve = u;
|
|
1238
|
+
}
|
|
1239
|
+
}, 30), Ue = function(t) {
|
|
1240
|
+
var e = t.originalEvent, n = t.putSortable, i = t.dragEl, r = t.activeSortable, a = t.dispatchSortableEvent, l = t.hideGhostForTarget, s = t.unhideGhostForTarget;
|
|
1241
|
+
if (e) {
|
|
1242
|
+
var u = n || r;
|
|
1243
|
+
l();
|
|
1244
|
+
var d = e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e, c = document.elementFromPoint(d.clientX, d.clientY);
|
|
1245
|
+
s(), u && !u.el.contains(c) && (a("spill"), this.onSpill({
|
|
1246
|
+
dragEl: i,
|
|
1247
|
+
putSortable: n
|
|
1248
|
+
}));
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
function Ee() {
|
|
1252
|
+
}
|
|
1253
|
+
Ee.prototype = {
|
|
1254
|
+
startIndex: null,
|
|
1255
|
+
dragStart: function(t) {
|
|
1256
|
+
var e = t.oldDraggableIndex;
|
|
1257
|
+
this.startIndex = e;
|
|
1258
|
+
},
|
|
1259
|
+
onSpill: function(t) {
|
|
1260
|
+
var e = t.dragEl, n = t.putSortable;
|
|
1261
|
+
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
1262
|
+
var i = yt(this.sortable.el, this.startIndex, this.options);
|
|
1263
|
+
i ? this.sortable.el.insertBefore(e, i) : this.sortable.el.appendChild(e), this.sortable.animateAll(), n && n.animateAll();
|
|
1264
|
+
},
|
|
1265
|
+
drop: Ue
|
|
1266
|
+
};
|
|
1267
|
+
$(Ee, {
|
|
1268
|
+
pluginName: "revertOnSpill"
|
|
1269
|
+
});
|
|
1270
|
+
function De() {
|
|
1271
|
+
}
|
|
1272
|
+
De.prototype = {
|
|
1273
|
+
onSpill: function(t) {
|
|
1274
|
+
var e = t.dragEl, n = t.putSortable, i = n || this.sortable;
|
|
1275
|
+
i.captureAnimationState(), e.parentNode && e.parentNode.removeChild(e), i.animateAll();
|
|
1276
|
+
},
|
|
1277
|
+
drop: Ue
|
|
1278
|
+
};
|
|
1279
|
+
$(De, {
|
|
1280
|
+
pluginName: "removeOnSpill"
|
|
1281
|
+
});
|
|
1282
|
+
var U;
|
|
1283
|
+
function On() {
|
|
1284
|
+
function o() {
|
|
1285
|
+
this.defaults = {
|
|
1286
|
+
swapClass: "sortable-swap-highlight"
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
return o.prototype = {
|
|
1290
|
+
dragStart: function(e) {
|
|
1291
|
+
var n = e.dragEl;
|
|
1292
|
+
U = n;
|
|
1293
|
+
},
|
|
1294
|
+
dragOverValid: function(e) {
|
|
1295
|
+
var n = e.completed, i = e.target, r = e.onMove, a = e.activeSortable, l = e.changed, s = e.cancel;
|
|
1296
|
+
if (a.options.swap) {
|
|
1297
|
+
var u = this.sortable.el, d = this.options;
|
|
1298
|
+
if (i && i !== u) {
|
|
1299
|
+
var c = U;
|
|
1300
|
+
r(i) !== !1 ? (I(i, d.swapClass, !0), U = i) : U = null, c && c !== U && I(c, d.swapClass, !1);
|
|
1301
|
+
}
|
|
1302
|
+
l(), n(!0), s();
|
|
1303
|
+
}
|
|
1304
|
+
},
|
|
1305
|
+
drop: function(e) {
|
|
1306
|
+
var n = e.activeSortable, i = e.putSortable, r = e.dragEl, a = i || this.sortable, l = this.options;
|
|
1307
|
+
U && I(U, l.swapClass, !1), U && (l.swap || i && i.options.swap) && r !== U && (a.captureAnimationState(), a !== n && n.captureAnimationState(), Tn(r, U), a.animateAll(), a !== n && n.animateAll());
|
|
1308
|
+
},
|
|
1309
|
+
nulling: function() {
|
|
1310
|
+
U = null;
|
|
1311
|
+
}
|
|
1312
|
+
}, $(o, {
|
|
1313
|
+
pluginName: "swap",
|
|
1314
|
+
eventProperties: function() {
|
|
1315
|
+
return {
|
|
1316
|
+
swapItem: U
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
function Tn(o, t) {
|
|
1322
|
+
var e = o.parentNode, n = t.parentNode, i, r;
|
|
1323
|
+
!e || !n || e.isEqualNode(t) || n.isEqualNode(o) || (i = x(o), r = x(t), e.isEqualNode(n) && i < r && r++, e.insertBefore(t, e.children[i]), n.insertBefore(o, n.children[r]));
|
|
1324
|
+
}
|
|
1325
|
+
var m = [], K = [], Ct, V, Ot = !1, H = !1, mt = !1, C, Tt, Lt;
|
|
1326
|
+
function An() {
|
|
1327
|
+
function o(t) {
|
|
1328
|
+
for (var e in this)
|
|
1329
|
+
e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
|
|
1330
|
+
t.options.avoidImplicitDeselect || (t.options.supportPointer ? y(document, "pointerup", this._deselectMultiDrag) : (y(document, "mouseup", this._deselectMultiDrag), y(document, "touchend", this._deselectMultiDrag))), y(document, "keydown", this._checkKeyDown), y(document, "keyup", this._checkKeyUp), this.defaults = {
|
|
1331
|
+
selectedClass: "sortable-selected",
|
|
1332
|
+
multiDragKey: null,
|
|
1333
|
+
avoidImplicitDeselect: !1,
|
|
1334
|
+
setData: function(i, r) {
|
|
1335
|
+
var a = "";
|
|
1336
|
+
m.length && V === t ? m.forEach(function(l, s) {
|
|
1337
|
+
a += (s ? ", " : "") + l.textContent;
|
|
1338
|
+
}) : a = r.textContent, i.setData("Text", a);
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
return o.prototype = {
|
|
1343
|
+
multiDragKeyDown: !1,
|
|
1344
|
+
isMultiDrag: !1,
|
|
1345
|
+
delayStartGlobal: function(e) {
|
|
1346
|
+
var n = e.dragEl;
|
|
1347
|
+
C = n;
|
|
1348
|
+
},
|
|
1349
|
+
delayEnded: function() {
|
|
1350
|
+
this.isMultiDrag = ~m.indexOf(C);
|
|
1351
|
+
},
|
|
1352
|
+
setupClone: function(e) {
|
|
1353
|
+
var n = e.sortable, i = e.cancel;
|
|
1354
|
+
if (this.isMultiDrag) {
|
|
1355
|
+
for (var r = 0; r < m.length; r++)
|
|
1356
|
+
K.push(we(m[r])), K[r].sortableIndex = m[r].sortableIndex, K[r].draggable = !1, K[r].style["will-change"] = "", I(K[r], this.options.selectedClass, !1), m[r] === C && I(K[r], this.options.chosenClass, !1);
|
|
1357
|
+
n._hideClone(), i();
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
clone: function(e) {
|
|
1361
|
+
var n = e.sortable, i = e.rootEl, r = e.dispatchSortableEvent, a = e.cancel;
|
|
1362
|
+
this.isMultiDrag && (this.options.removeCloneOnHide || m.length && V === n && (Fe(!0, i), r("clone"), a()));
|
|
1363
|
+
},
|
|
1364
|
+
showClone: function(e) {
|
|
1365
|
+
var n = e.cloneNowShown, i = e.rootEl, r = e.cancel;
|
|
1366
|
+
this.isMultiDrag && (Fe(!1, i), K.forEach(function(a) {
|
|
1367
|
+
h(a, "display", "");
|
|
1368
|
+
}), n(), Lt = !1, r());
|
|
1369
|
+
},
|
|
1370
|
+
hideClone: function(e) {
|
|
1371
|
+
var n = this;
|
|
1372
|
+
e.sortable;
|
|
1373
|
+
var i = e.cloneNowHidden, r = e.cancel;
|
|
1374
|
+
this.isMultiDrag && (K.forEach(function(a) {
|
|
1375
|
+
h(a, "display", "none"), n.options.removeCloneOnHide && a.parentNode && a.parentNode.removeChild(a);
|
|
1376
|
+
}), i(), Lt = !0, r());
|
|
1377
|
+
},
|
|
1378
|
+
dragStartGlobal: function(e) {
|
|
1379
|
+
e.sortable, !this.isMultiDrag && V && V.multiDrag._deselectMultiDrag(), m.forEach(function(n) {
|
|
1380
|
+
n.sortableIndex = x(n);
|
|
1381
|
+
}), m = m.sort(function(n, i) {
|
|
1382
|
+
return n.sortableIndex - i.sortableIndex;
|
|
1383
|
+
}), mt = !0;
|
|
1384
|
+
},
|
|
1385
|
+
dragStarted: function(e) {
|
|
1386
|
+
var n = this, i = e.sortable;
|
|
1387
|
+
if (this.isMultiDrag) {
|
|
1388
|
+
if (this.options.sort && (i.captureAnimationState(), this.options.animation)) {
|
|
1389
|
+
m.forEach(function(a) {
|
|
1390
|
+
a !== C && h(a, "position", "absolute");
|
|
1391
|
+
});
|
|
1392
|
+
var r = O(C, !1, !0, !0);
|
|
1393
|
+
m.forEach(function(a) {
|
|
1394
|
+
a !== C && Ie(a, r);
|
|
1395
|
+
}), H = !0, Ot = !0;
|
|
1396
|
+
}
|
|
1397
|
+
i.animateAll(function() {
|
|
1398
|
+
H = !1, Ot = !1, n.options.animation && m.forEach(function(a) {
|
|
1399
|
+
ie(a);
|
|
1400
|
+
}), n.options.sort && jt();
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
dragOver: function(e) {
|
|
1405
|
+
var n = e.target, i = e.completed, r = e.cancel;
|
|
1406
|
+
H && ~m.indexOf(n) && (i(!1), r());
|
|
1407
|
+
},
|
|
1408
|
+
revert: function(e) {
|
|
1409
|
+
var n = e.fromSortable, i = e.rootEl, r = e.sortable, a = e.dragRect;
|
|
1410
|
+
m.length > 1 && (m.forEach(function(l) {
|
|
1411
|
+
r.addAnimationState({
|
|
1412
|
+
target: l,
|
|
1413
|
+
rect: H ? O(l) : a
|
|
1414
|
+
}), ie(l), l.fromRect = a, n.removeAnimationState(l);
|
|
1415
|
+
}), H = !1, In(!this.options.removeCloneOnHide, i));
|
|
1416
|
+
},
|
|
1417
|
+
dragOverCompleted: function(e) {
|
|
1418
|
+
var n = e.sortable, i = e.isOwner, r = e.insertion, a = e.activeSortable, l = e.parentEl, s = e.putSortable, u = this.options;
|
|
1419
|
+
if (r) {
|
|
1420
|
+
if (i && a._hideClone(), Ot = !1, u.animation && m.length > 1 && (H || !i && !a.options.sort && !s)) {
|
|
1421
|
+
var d = O(C, !1, !0, !0);
|
|
1422
|
+
m.forEach(function(p) {
|
|
1423
|
+
p !== C && (Ie(p, d), l.appendChild(p));
|
|
1424
|
+
}), H = !0;
|
|
1425
|
+
}
|
|
1426
|
+
if (!i)
|
|
1427
|
+
if (H || jt(), m.length > 1) {
|
|
1428
|
+
var c = Lt;
|
|
1429
|
+
a._showClone(n), a.options.animation && !Lt && c && K.forEach(function(p) {
|
|
1430
|
+
a.addAnimationState({
|
|
1431
|
+
target: p,
|
|
1432
|
+
rect: Tt
|
|
1433
|
+
}), p.fromRect = Tt, p.thisAnimationDuration = null;
|
|
1434
|
+
});
|
|
1435
|
+
} else
|
|
1436
|
+
a._showClone(n);
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
dragOverAnimationCapture: function(e) {
|
|
1440
|
+
var n = e.dragRect, i = e.isOwner, r = e.activeSortable;
|
|
1441
|
+
if (m.forEach(function(l) {
|
|
1442
|
+
l.thisAnimationDuration = null;
|
|
1443
|
+
}), r.options.animation && !i && r.multiDrag.isMultiDrag) {
|
|
1444
|
+
Tt = $({}, n);
|
|
1445
|
+
var a = ht(C, !0);
|
|
1446
|
+
Tt.top -= a.f, Tt.left -= a.e;
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
dragOverAnimationComplete: function() {
|
|
1450
|
+
H && (H = !1, jt());
|
|
1451
|
+
},
|
|
1452
|
+
drop: function(e) {
|
|
1453
|
+
var n = e.originalEvent, i = e.rootEl, r = e.parentEl, a = e.sortable, l = e.dispatchSortableEvent, s = e.oldIndex, u = e.putSortable, d = u || this.sortable;
|
|
1454
|
+
if (n) {
|
|
1455
|
+
var c = this.options, p = r.children;
|
|
1456
|
+
if (!mt)
|
|
1457
|
+
if (c.multiDragKey && !this.multiDragKeyDown && this._deselectMultiDrag(), I(C, c.selectedClass, !~m.indexOf(C)), ~m.indexOf(C))
|
|
1458
|
+
m.splice(m.indexOf(C), 1), Ct = null, At({
|
|
1459
|
+
sortable: a,
|
|
1460
|
+
rootEl: i,
|
|
1461
|
+
name: "deselect",
|
|
1462
|
+
targetEl: C,
|
|
1463
|
+
originalEvent: n
|
|
1464
|
+
});
|
|
1465
|
+
else {
|
|
1466
|
+
if (m.push(C), At({
|
|
1467
|
+
sortable: a,
|
|
1468
|
+
rootEl: i,
|
|
1469
|
+
name: "select",
|
|
1470
|
+
targetEl: C,
|
|
1471
|
+
originalEvent: n
|
|
1472
|
+
}), n.shiftKey && Ct && a.el.contains(Ct)) {
|
|
1473
|
+
var D = x(Ct), w = x(C);
|
|
1474
|
+
~D && ~w && D !== w && (function() {
|
|
1475
|
+
var E, _;
|
|
1476
|
+
w > D ? (_ = D, E = w) : (_ = w, E = D + 1);
|
|
1477
|
+
for (var M = c.filter; _ < E; _++)
|
|
1478
|
+
if (!~m.indexOf(p[_]) && G(p[_], c.draggable, r, !1)) {
|
|
1479
|
+
var J = M && (typeof M == "function" ? M.call(a, n, p[_], a) : M.split(",").some(function(z) {
|
|
1480
|
+
return G(p[_], z.trim(), r, !1);
|
|
1481
|
+
}));
|
|
1482
|
+
J || (I(p[_], c.selectedClass, !0), m.push(p[_]), At({
|
|
1483
|
+
sortable: a,
|
|
1484
|
+
rootEl: i,
|
|
1485
|
+
name: "select",
|
|
1486
|
+
targetEl: p[_],
|
|
1487
|
+
originalEvent: n
|
|
1488
|
+
}));
|
|
1489
|
+
}
|
|
1490
|
+
})();
|
|
1491
|
+
} else
|
|
1492
|
+
Ct = C;
|
|
1493
|
+
V = d;
|
|
1494
|
+
}
|
|
1495
|
+
if (mt && this.isMultiDrag) {
|
|
1496
|
+
if (H = !1, (r[R].options.sort || r !== i) && m.length > 1) {
|
|
1497
|
+
var S = O(C), X = x(C, ":not(." + this.options.selectedClass + ")");
|
|
1498
|
+
if (!Ot && c.animation && (C.thisAnimationDuration = null), d.captureAnimationState(), !Ot && (c.animation && (C.fromRect = S, m.forEach(function(E) {
|
|
1499
|
+
if (E.thisAnimationDuration = null, E !== C) {
|
|
1500
|
+
var _ = H ? O(E) : S;
|
|
1501
|
+
E.fromRect = _, d.addAnimationState({
|
|
1502
|
+
target: E,
|
|
1503
|
+
rect: _
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
})), jt(), m.forEach(function(E) {
|
|
1507
|
+
p[X] ? r.insertBefore(E, p[X]) : r.appendChild(E), X++;
|
|
1508
|
+
}), s === x(C))) {
|
|
1509
|
+
var j = !1;
|
|
1510
|
+
m.forEach(function(E) {
|
|
1511
|
+
if (E.sortableIndex !== x(E)) {
|
|
1512
|
+
j = !0;
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
}), j && (l("update"), l("sort"));
|
|
1516
|
+
}
|
|
1517
|
+
m.forEach(function(E) {
|
|
1518
|
+
ie(E);
|
|
1519
|
+
}), d.animateAll();
|
|
1520
|
+
}
|
|
1521
|
+
V = d;
|
|
1522
|
+
}
|
|
1523
|
+
(i === r || u && u.lastPutMode !== "clone") && K.forEach(function(E) {
|
|
1524
|
+
E.parentNode && E.parentNode.removeChild(E);
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
},
|
|
1528
|
+
nullingGlobal: function() {
|
|
1529
|
+
this.isMultiDrag = mt = !1, K.length = 0;
|
|
1530
|
+
},
|
|
1531
|
+
destroyGlobal: function() {
|
|
1532
|
+
this._deselectMultiDrag(), b(document, "pointerup", this._deselectMultiDrag), b(document, "mouseup", this._deselectMultiDrag), b(document, "touchend", this._deselectMultiDrag), b(document, "keydown", this._checkKeyDown), b(document, "keyup", this._checkKeyUp);
|
|
1533
|
+
},
|
|
1534
|
+
_deselectMultiDrag: function(e) {
|
|
1535
|
+
if (!(typeof mt < "u" && mt) && V === this.sortable && !(e && G(e.target, this.options.draggable, this.sortable.el, !1)) && !(e && e.button !== 0))
|
|
1536
|
+
for (; m.length; ) {
|
|
1537
|
+
var n = m[0];
|
|
1538
|
+
I(n, this.options.selectedClass, !1), m.shift(), At({
|
|
1539
|
+
sortable: this.sortable,
|
|
1540
|
+
rootEl: this.sortable.el,
|
|
1541
|
+
name: "deselect",
|
|
1542
|
+
targetEl: n,
|
|
1543
|
+
originalEvent: e
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
},
|
|
1547
|
+
_checkKeyDown: function(e) {
|
|
1548
|
+
e.key === this.options.multiDragKey && (this.multiDragKeyDown = !0);
|
|
1549
|
+
},
|
|
1550
|
+
_checkKeyUp: function(e) {
|
|
1551
|
+
e.key === this.options.multiDragKey && (this.multiDragKeyDown = !1);
|
|
1552
|
+
}
|
|
1553
|
+
}, $(o, {
|
|
1554
|
+
// Static methods & properties
|
|
1555
|
+
pluginName: "multiDrag",
|
|
1556
|
+
utils: {
|
|
1557
|
+
/**
|
|
1558
|
+
* Selects the provided multi-drag item
|
|
1559
|
+
* @param {HTMLElement} el The element to be selected
|
|
1560
|
+
*/
|
|
1561
|
+
select: function(e) {
|
|
1562
|
+
var n = e.parentNode[R];
|
|
1563
|
+
!n || !n.options.multiDrag || ~m.indexOf(e) || (V && V !== n && (V.multiDrag._deselectMultiDrag(), V = n), I(e, n.options.selectedClass, !0), m.push(e));
|
|
1564
|
+
},
|
|
1565
|
+
/**
|
|
1566
|
+
* Deselects the provided multi-drag item
|
|
1567
|
+
* @param {HTMLElement} el The element to be deselected
|
|
1568
|
+
*/
|
|
1569
|
+
deselect: function(e) {
|
|
1570
|
+
var n = e.parentNode[R], i = m.indexOf(e);
|
|
1571
|
+
!n || !n.options.multiDrag || !~i || (I(e, n.options.selectedClass, !1), m.splice(i, 1));
|
|
1572
|
+
}
|
|
1573
|
+
},
|
|
1574
|
+
eventProperties: function() {
|
|
1575
|
+
var e = this, n = [], i = [];
|
|
1576
|
+
return m.forEach(function(r) {
|
|
1577
|
+
n.push({
|
|
1578
|
+
multiDragElement: r,
|
|
1579
|
+
index: r.sortableIndex
|
|
1580
|
+
});
|
|
1581
|
+
var a;
|
|
1582
|
+
H && r !== C ? a = -1 : H ? a = x(r, ":not(." + e.options.selectedClass + ")") : a = x(r), i.push({
|
|
1583
|
+
multiDragElement: r,
|
|
1584
|
+
index: a
|
|
1585
|
+
});
|
|
1586
|
+
}), {
|
|
1587
|
+
items: Je(m),
|
|
1588
|
+
clones: [].concat(K),
|
|
1589
|
+
oldIndicies: n,
|
|
1590
|
+
newIndicies: i
|
|
1591
|
+
};
|
|
1592
|
+
},
|
|
1593
|
+
optionListeners: {
|
|
1594
|
+
multiDragKey: function(e) {
|
|
1595
|
+
return e = e.toLowerCase(), e === "ctrl" ? e = "Control" : e.length > 1 && (e = e.charAt(0).toUpperCase() + e.substr(1)), e;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
function In(o, t) {
|
|
1601
|
+
m.forEach(function(e, n) {
|
|
1602
|
+
var i = t.children[e.sortableIndex + (o ? Number(n) : 0)];
|
|
1603
|
+
i ? t.insertBefore(e, i) : t.appendChild(e);
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
function Fe(o, t) {
|
|
1607
|
+
K.forEach(function(e, n) {
|
|
1608
|
+
var i = t.children[e.sortableIndex + (o ? Number(n) : 0)];
|
|
1609
|
+
i ? t.insertBefore(e, i) : t.appendChild(e);
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
function jt() {
|
|
1613
|
+
m.forEach(function(o) {
|
|
1614
|
+
o !== C && o.parentNode && o.parentNode.removeChild(o);
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
g.mount(new Cn());
|
|
1618
|
+
g.mount(De, Ee);
|
|
1619
|
+
g.mount(new On());
|
|
1620
|
+
g.mount(new An());
|
|
1621
|
+
export {
|
|
1622
|
+
g as default
|
|
1623
|
+
};
|
|
1624
|
+
//# sourceMappingURL=sortable.complete.esm-dE2RjKaB.js.map
|