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