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