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