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