@cling-se/widget 0.17.0 → 1.0.0-beta.2
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/AddClientCallout-e8d19R3f.js +101 -0
- package/dist/AnswerModal-BGvB8IVV.js +3291 -0
- package/dist/AttachmentItem-CkHbAm4l.js +171 -0
- package/dist/BaseUpload-BiJBcWRu.js +2472 -0
- package/dist/BlockMedia-CW5wgipC.js +103 -0
- package/dist/CCallout-Cy2eeIYd.js +104 -0
- package/dist/{CCurrencyDropdown-C2rXt2cJ.js → CCurrencyDropdown-DE_3CTjm.js} +91 -53
- package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
- package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
- package/dist/{CPhoneFormat-C8VPsiK6.js → CPhoneFormat-BS2nP9kc.js} +13 -21
- package/dist/CPhoneInput-Bf6329PO.js +207 -0
- package/dist/CPriceInput-d1yjuMQr.js +140 -0
- package/dist/CSelect-DgnT07Hk.js +98 -0
- package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
- package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
- package/dist/ClientModal-BzWQtWSZ.js +1181 -0
- package/dist/ColorPicker-BvoFN8nu.js +1408 -0
- package/dist/CompanyModal-Bp4V_az9.js +250 -0
- package/dist/ContentWrapper-CuH6xKmo.js +265 -0
- package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
- package/dist/DocAnswer-BcNA_KEg.js +33 -0
- package/dist/DocDetails-CStEwWnU.js +448 -0
- package/dist/DocForm-BOoILf5E.js +6748 -0
- package/dist/DocFormSend-CQIf-HJY.js +171 -0
- package/dist/DocLinks-BRX5QzNe.js +36 -0
- package/dist/DocModalBase-D72yWj-x.js +29 -0
- package/dist/DocPrint-BI1LXUPE.js +399 -0
- package/dist/DocReceipt-DaZ4V76p.js +341 -0
- package/dist/DocSendReminder-DKGZlo7s.js +181 -0
- package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
- package/dist/DocTimeline-DCwofzuk.js +537 -0
- package/dist/DocumentClient-vJdxCB53.js +90 -0
- package/dist/DocumentLayout-CKSi42ev.js +1368 -0
- package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
- package/dist/DocumentVoided-CRX2WxWO.js +33 -0
- package/dist/EmbedInput-B-oeC4Wy.js +157 -0
- package/dist/EmbedSettings-B9Yka2yB.js +103 -0
- package/dist/ErrorCallout-B_ygH33E.js +34 -0
- package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
- package/dist/Flag-BwTgCNHO.js +41 -0
- package/dist/HeaderSettings-DvC7nlyY.js +720 -0
- package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
- package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
- package/dist/Index-0_3ULrWX.js +126 -0
- package/dist/Index-4NPe0sfX.js +629 -0
- package/dist/Index-B1uA0FF6.js +4 -0
- package/dist/Index-BBkCYm2q.js +201 -0
- package/dist/{Index-LzN6dktq.js → Index-BBwvo7S9.js} +10 -18
- package/dist/Index-BEMlsYwJ.js +68 -0
- package/dist/Index-BRBhJ6kz.js +21 -0
- package/dist/{Index-BPUYpfLJ.js → Index-BTFmHjUt.js} +47 -60
- package/dist/Index-BcUNnxLC.js +1098 -0
- package/dist/Index-Bo6ExBUL.js +93 -0
- package/dist/Index-BvMPCgdH.js +102 -0
- package/dist/Index-Bx5TOI9k.js +74 -0
- package/dist/Index-C7GZS8EI.js +16 -0
- package/dist/Index-CNWhm07R.js +25 -0
- package/dist/{Index-BUK-1yVR.js → Index-CQpznMKV.js} +9 -17
- package/dist/Index-CRzsnIij.js +159 -0
- package/dist/Index-CeSG1C41.js +140 -0
- package/dist/Index-CjfjdZj5.js +52 -0
- package/dist/Index-CskKmZpd.js +363 -0
- package/dist/Index-D5qwbCo1.js +28 -0
- package/dist/Index-D8Ae1Txt.js +228 -0
- package/dist/Index-DE8aenDB.js +3452 -0
- package/dist/Index-DI5EB5Rt.js +39 -0
- package/dist/Index-DaV57YPP.js +163 -0
- package/dist/Index-DbwkmoyM.js +38 -0
- package/dist/Index-Df9skok6.js +70 -0
- package/dist/{Index-BHJGfHm9.js → Index-DfLLA0ij.js} +313 -206
- package/dist/Index-Dw1CO5F9.js +76 -0
- package/dist/Index-PZXyOoVb.js +87 -0
- package/dist/{Index-BioOegOO.js → Index-ZUnH-BHj.js} +10 -18
- package/dist/Index-cjKGSiDi.js +136 -0
- package/dist/Index-m-goRuKD.js +49 -0
- package/dist/Index-rGeWbLcB.js +47 -0
- package/dist/Index-vrljNp6G.js +28 -0
- package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
- package/dist/InputToggleRow-v6qAWPg6.js +99 -0
- package/dist/ManualPopover-BONBJIUA.js +57 -0
- package/dist/MediaWrapper-CXb2UGd9.js +18 -0
- package/dist/{NotBindingText-CM3FN0A6.js → NotBindingText-BqESO13N.js} +13 -17
- package/dist/PackageGroup-AIysVmyh.js +1058 -0
- package/dist/PdfTerms-BlhHdTu3.js +34 -0
- package/dist/PdfViewer-DwZ1rwlN.js +392 -0
- package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
- package/dist/PriceHeader-C4XhnoA3.js +488 -0
- package/dist/SearchApi-B7lXgUY6.js +137 -0
- package/dist/SendForm-BcD0xSvB.js +7031 -0
- package/dist/Setup-C2qaYDei.js +47 -0
- package/dist/{SmartList-DhhjSWLO.js → SmartList-DqG7Q5t7.js} +16 -24
- package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
- package/dist/{TermsSettings-BEQwmkFH.js → TermsSettings-BOCONyM4.js} +169 -56
- package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
- package/dist/ToggleBinding-7oq_oXPt.js +44 -0
- package/dist/UploadModal-C_X2NjVY.js +134 -0
- package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
- package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
- package/dist/VideoSelectModal-CW0OweCw.js +217 -0
- package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
- package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
- package/dist/{debounce-D0hKNU85.js → debounce-DNl99Gyo.js} +10 -10
- package/dist/dom-CkTGWrfu.js +69 -0
- package/dist/{focusDrawerMixin-C_aTLmK0.js → focusDrawerMixin-BwcErMDY.js} +1 -1
- package/dist/{formDrawerState-Da4mcbab.js → formDrawerState-DaurePnd.js} +2 -2
- package/dist/helpers-CPW--XIz.js +44 -0
- package/dist/index-BjiGCJPI.js +149 -0
- package/dist/index-CFNv6OvX.js +188 -0
- package/dist/index-Cx71On5Z.js +508 -0
- package/dist/index-DKMxIBz_.js +270 -0
- package/dist/index-DKf5SGLD.js +125 -0
- package/dist/index-E32WgUp9.js +3525 -0
- package/dist/index-kp-GC5I0.js +513 -0
- package/dist/index.es.js +2 -5
- package/dist/index.umd.js +285 -1485
- package/dist/{main-BgzLHIoo.js → main-Cb-nyil1.js} +41414 -42507
- package/dist/mapFormMixin-D3BihYWW.js +1544 -0
- package/dist/omit--YYr41Xp.js +31 -0
- package/dist/{publicSenderState-DB4BHByV.js → publicSenderState-CdRW_Wwp.js} +4 -4
- package/dist/splitpanes-D-ThFkeR.js +342 -0
- package/dist/style.css +1 -4
- package/dist/template-BvaNnq-g.js +1493 -0
- package/dist/{throttle-DT2UVOqm.js → throttle-D-bUGaVh.js} +2 -2
- package/dist/tippy.esm-BmKNqohP.js +1994 -0
- package/dist/useTermsModal-Dhf6_eYb.js +87 -0
- package/dist/{utils-nos8CB1L.js → utils-CBPcYdLv.js} +8 -11
- package/dist/validation-DOcUOoMe.js +40 -0
- package/package.json +18 -21
- package/dist/AddClientCallout-BJzBdba1.js +0 -48
- package/dist/AnswerModal-frHq1g4s.js +0 -3874
- package/dist/AttachmentItem-BaN0OrEV.js +0 -85
- package/dist/BaseDatePicker-B-AfdrSb.js +0 -3187
- package/dist/BaseUpload-CY3lTcte.js +0 -1977
- package/dist/BlockMedia-Bb5wQIDg.js +0 -76
- package/dist/CCallout-5quI6yyk.js +0 -58
- package/dist/CDropdownItem-CaoSQX6X.js +0 -640
- package/dist/CFormField-Dd2Y71JG.js +0 -240
- package/dist/CPhoneInput-BU1t6eo_.js +0 -138
- package/dist/CPriceInput-pv2aIVkH.js +0 -116
- package/dist/CSelect-CrM45B7V.js +0 -91
- package/dist/CSkeleton-BkvONMqL.js +0 -55
- package/dist/ClientAutocomplete-BRXIKQSk.js +0 -438
- package/dist/ClientModal-CvHAptV2.js +0 -666
- package/dist/ColorPicker-RgoXRrud.js +0 -2879
- package/dist/CompanyModal-OL4bD9Gk.js +0 -147
- package/dist/ContentWrapper-8HduCnR4.js +0 -190
- package/dist/CoverBlockSettings-DUv8AcdX.js +0 -659
- package/dist/DocAnswer-DiyFfpT2.js +0 -36
- package/dist/DocDetails-BxNRfBnK.js +0 -263
- package/dist/DocForm-MGp-o0pu.js +0 -5017
- package/dist/DocFormSend-q_QuVCqh.js +0 -146
- package/dist/DocLinks-DGDdp30U.js +0 -38
- package/dist/DocModalBase-qG4RqwBn.js +0 -28
- package/dist/DocPrint-Cln3kt0g.js +0 -240
- package/dist/DocReceipt-nbsJ-ukZ.js +0 -217
- package/dist/DocSendReminder-B3qdqduf.js +0 -140
- package/dist/DocTextEditor-CQDnjnRY.js +0 -17193
- package/dist/DocTimeline-CgKHoDcG.js +0 -485
- package/dist/DocumentClient-UZlnIlz5.js +0 -136
- package/dist/DocumentLayout-Dvr4zgyF.js +0 -4880
- package/dist/DocumentLogotype-mAVgMRHr.js +0 -92
- package/dist/DocumentVoided-BXYNrf_6.js +0 -25
- package/dist/EmbedInput-YRUrw3c6.js +0 -117
- package/dist/EmbedSettings-DvRreF7H.js +0 -74
- package/dist/ErrorCallout-DVknpLVY.js +0 -27
- package/dist/FilePreviewModal-DC56FaGy.js +0 -81
- package/dist/Flag-D5iZLESg.js +0 -46
- package/dist/HeaderSettings-DXZnZL7A.js +0 -440
- package/dist/ImageSelectModal-Bu4_xZga.js +0 -86
- package/dist/ImageUploadWrapper-CtZhkAm1.js +0 -1604
- package/dist/Index-B1dJO6Bk.js +0 -54
- package/dist/Index-B3pz1coY.js +0 -150
- package/dist/Index-BHgW8EHW.js +0 -2446
- package/dist/Index-BNucs2O-.js +0 -154
- package/dist/Index-BW-EtZ1z.js +0 -55
- package/dist/Index-BjKACpun.js +0 -66
- package/dist/Index-C94BL4uU.js +0 -294
- package/dist/Index-CB57haU8.js +0 -58
- package/dist/Index-CP17iXT6.js +0 -25
- package/dist/Index-CUSbvjoD.js +0 -62
- package/dist/Index-CVnD6jo5.js +0 -25
- package/dist/Index-Ci5zdPeT.js +0 -28
- package/dist/Index-CikqSMjb.js +0 -41
- package/dist/Index-CxO4tJ3U.js +0 -26
- package/dist/Index-D4J4BpHd.js +0 -230
- package/dist/Index-DAQQQlut.js +0 -754
- package/dist/Index-DNxSR72J.js +0 -73
- package/dist/Index-DPuKRwmu.js +0 -41
- package/dist/Index-DSy8QG8T.js +0 -32
- package/dist/Index-DX6_D-J-.js +0 -77
- package/dist/Index-Dk0KaIKg.js +0 -643
- package/dist/Index-Hkzoh9QR.js +0 -24
- package/dist/Index-KsHJxWAa.js +0 -94
- package/dist/Index-TtItTuv6.js +0 -33
- package/dist/Index-YAD39Qvg.js +0 -146
- package/dist/Index-eh909lAz.js +0 -107
- package/dist/Index-otowKI_C.js +0 -56
- package/dist/Index-t_oVV8Rc.js +0 -84
- package/dist/Index-vG96oEXZ.js +0 -144
- package/dist/InputToggleRow-CcqJDguN.js +0 -57
- package/dist/ManualPopover-BE2IN-XU.js +0 -60
- package/dist/MediaWrapper-lnGUFiyc.js +0 -23
- package/dist/PackageGroup-BsmxOMLW.js +0 -704
- package/dist/PdfTerms-BgYwZoAZ.js +0 -31
- package/dist/PdfViewer-C0lDpjte.js +0 -383
- package/dist/PlainHtml-5YwYVj1v.js +0 -27
- package/dist/PriceHeader-CxqhpGS-.js +0 -338
- package/dist/SearchApi-BndaIbri.js +0 -161
- package/dist/SendForm-D7U9fG-5.js +0 -1023
- package/dist/Setup-CmAK2_ZT.js +0 -50
- package/dist/ThemeColorRow-BlnhzebY.js +0 -69
- package/dist/ToggleBinding-t_58JFya.js +0 -42
- package/dist/UploadModal-T-WpYNsN.js +0 -95
- package/dist/VideoPlayerInput-DKHKjMgX.js +0 -97
- package/dist/VideoPlayerSettings-DDMlUvSt.js +0 -61
- package/dist/VideoSelectModal-B9bbP0dd.js +0 -104
- package/dist/answerDocumentMixin-DXI_E5Kx.js +0 -51
- package/dist/dom-CWsqMElk.js +0 -71
- package/dist/formValidationMixin-WZ2lGndu.js +0 -49
- package/dist/index-B2l57ilt.js +0 -102
- package/dist/index-COKDjmM2.js +0 -167
- package/dist/index-HtKGcIng.js +0 -2700
- package/dist/index-LQ7NztTt.js +0 -81
- package/dist/index-fx5gR8fM.js +0 -351
- package/dist/index-zXXJrTvv.js +0 -492
- package/dist/mapFormMixin-CQgSN7dv.js +0 -3028
- package/dist/omit-ScS7B6c5.js +0 -31
- package/dist/simplebar.min-B0cB_p8g.js +0 -71
- package/dist/splitpanes-BHUVsCZF.js +0 -382
- package/dist/tippy.esm-CR89mtdY.js +0 -1805
- package/dist/vuedraggable.umd-CkXXkt1b.js +0 -3161
- package/dist/vuex.esm-DKGl8mcw.js +0 -467
|
@@ -0,0 +1,1303 @@
|
|
|
1
|
+
import { aW as Pt, aX as xt, aY as Nt, aZ as Mt, L as Ft, a_ as at, Q as kt, h as Xt, i as Rt, $ as Yt, o as lt, c as Bt, w as Lt, d as Ht, k as Wt, F as Gt, n as zt, l as Vt, aq as jt, S as $t } from "./main-Cb-nyil1.js";
|
|
2
|
+
/**!
|
|
3
|
+
* Sortable 1.10.2
|
|
4
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
5
|
+
* @author owenm <owen23355@gmail.com>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
function Ae(n) {
|
|
9
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ae = function(e) {
|
|
10
|
+
return typeof e;
|
|
11
|
+
} : Ae = function(e) {
|
|
12
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
13
|
+
}, Ae(n);
|
|
14
|
+
}
|
|
15
|
+
function Ut(n, e, t) {
|
|
16
|
+
return e in n ? Object.defineProperty(n, e, {
|
|
17
|
+
value: t,
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
configurable: !0,
|
|
20
|
+
writable: !0
|
|
21
|
+
}) : n[e] = t, n;
|
|
22
|
+
}
|
|
23
|
+
function j() {
|
|
24
|
+
return j = Object.assign || function(n) {
|
|
25
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
26
|
+
var t = arguments[e];
|
|
27
|
+
for (var o in t)
|
|
28
|
+
Object.prototype.hasOwnProperty.call(t, o) && (n[o] = t[o]);
|
|
29
|
+
}
|
|
30
|
+
return n;
|
|
31
|
+
}, j.apply(this, arguments);
|
|
32
|
+
}
|
|
33
|
+
function ee(n) {
|
|
34
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
35
|
+
var t = arguments[e] != null ? arguments[e] : {}, o = Object.keys(t);
|
|
36
|
+
typeof Object.getOwnPropertySymbols == "function" && (o = o.concat(Object.getOwnPropertySymbols(t).filter(function(i) {
|
|
37
|
+
return Object.getOwnPropertyDescriptor(t, i).enumerable;
|
|
38
|
+
}))), o.forEach(function(i) {
|
|
39
|
+
Ut(n, i, t[i]);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return n;
|
|
43
|
+
}
|
|
44
|
+
function qt(n, e) {
|
|
45
|
+
if (n == null) return {};
|
|
46
|
+
var t = {}, o = Object.keys(n), i, r;
|
|
47
|
+
for (r = 0; r < o.length; r++)
|
|
48
|
+
i = o[r], !(e.indexOf(i) >= 0) && (t[i] = n[i]);
|
|
49
|
+
return t;
|
|
50
|
+
}
|
|
51
|
+
function Zt(n, e) {
|
|
52
|
+
if (n == null) return {};
|
|
53
|
+
var t = qt(n, e), o, i;
|
|
54
|
+
if (Object.getOwnPropertySymbols) {
|
|
55
|
+
var r = Object.getOwnPropertySymbols(n);
|
|
56
|
+
for (i = 0; i < r.length; i++)
|
|
57
|
+
o = r[i], !(e.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(n, o) && (t[o] = n[o]);
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
var Qt = "1.10.2";
|
|
62
|
+
function V(n) {
|
|
63
|
+
if (typeof window < "u" && window.navigator)
|
|
64
|
+
return !!/* @__PURE__ */ navigator.userAgent.match(n);
|
|
65
|
+
}
|
|
66
|
+
var $ = V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), _e = V(/Edge/i), st = V(/firefox/i), Qe = V(/safari/i) && !V(/chrome/i) && !V(/android/i), mt = V(/iP(ad|od|hone)/i), Kt = V(/chrome/i) && V(/android/i), vt = {
|
|
67
|
+
capture: !1,
|
|
68
|
+
passive: !1
|
|
69
|
+
};
|
|
70
|
+
function y(n, e, t) {
|
|
71
|
+
n.addEventListener(e, t, !$ && vt);
|
|
72
|
+
}
|
|
73
|
+
function b(n, e, t) {
|
|
74
|
+
n.removeEventListener(e, t, !$ && vt);
|
|
75
|
+
}
|
|
76
|
+
function Fe(n, e) {
|
|
77
|
+
if (e) {
|
|
78
|
+
if (e[0] === ">" && (e = e.substring(1)), n)
|
|
79
|
+
try {
|
|
80
|
+
if (n.matches)
|
|
81
|
+
return n.matches(e);
|
|
82
|
+
if (n.msMatchesSelector)
|
|
83
|
+
return n.msMatchesSelector(e);
|
|
84
|
+
if (n.webkitMatchesSelector)
|
|
85
|
+
return n.webkitMatchesSelector(e);
|
|
86
|
+
} catch {
|
|
87
|
+
return !1;
|
|
88
|
+
}
|
|
89
|
+
return !1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function Jt(n) {
|
|
93
|
+
return n.host && n !== document && n.host.nodeType ? n.host : n.parentNode;
|
|
94
|
+
}
|
|
95
|
+
function H(n, e, t, o) {
|
|
96
|
+
if (n) {
|
|
97
|
+
t = t || document;
|
|
98
|
+
do {
|
|
99
|
+
if (e != null && (e[0] === ">" ? n.parentNode === t && Fe(n, e) : Fe(n, e)) || o && n === t)
|
|
100
|
+
return n;
|
|
101
|
+
if (n === t) break;
|
|
102
|
+
} while (n = Jt(n));
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
var ut = /\s+/g;
|
|
107
|
+
function M(n, e, t) {
|
|
108
|
+
if (n && e)
|
|
109
|
+
if (n.classList)
|
|
110
|
+
n.classList[t ? "add" : "remove"](e);
|
|
111
|
+
else {
|
|
112
|
+
var o = (" " + n.className + " ").replace(ut, " ").replace(" " + e + " ", " ");
|
|
113
|
+
n.className = (o + (t ? " " + e : "")).replace(ut, " ");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function h(n, e, t) {
|
|
117
|
+
var o = n && n.style;
|
|
118
|
+
if (o) {
|
|
119
|
+
if (t === void 0)
|
|
120
|
+
return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(n, "") : n.currentStyle && (t = n.currentStyle), e === void 0 ? t : t[e];
|
|
121
|
+
!(e in o) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), o[e] = t + (typeof t == "string" ? "" : "px");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function ce(n, e) {
|
|
125
|
+
var t = "";
|
|
126
|
+
if (typeof n == "string")
|
|
127
|
+
t = n;
|
|
128
|
+
else
|
|
129
|
+
do {
|
|
130
|
+
var o = h(n, "transform");
|
|
131
|
+
o && o !== "none" && (t = o + " " + t);
|
|
132
|
+
} while (!e && (n = n.parentNode));
|
|
133
|
+
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
134
|
+
return i && new i(t);
|
|
135
|
+
}
|
|
136
|
+
function bt(n, e, t) {
|
|
137
|
+
if (n) {
|
|
138
|
+
var o = n.getElementsByTagName(e), i = 0, r = o.length;
|
|
139
|
+
if (t)
|
|
140
|
+
for (; i < r; i++)
|
|
141
|
+
t(o[i], i);
|
|
142
|
+
return o;
|
|
143
|
+
}
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
function W() {
|
|
147
|
+
var n = document.scrollingElement;
|
|
148
|
+
return n || document.documentElement;
|
|
149
|
+
}
|
|
150
|
+
function I(n, e, t, o, i) {
|
|
151
|
+
if (!(!n.getBoundingClientRect && n !== window)) {
|
|
152
|
+
var r, a, l, s, u, c, f;
|
|
153
|
+
if (n !== window && n !== W() ? (r = n.getBoundingClientRect(), a = r.top, l = r.left, s = r.bottom, u = r.right, c = r.height, f = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, c = window.innerHeight, f = window.innerWidth), (e || t) && n !== window && (i = i || n.parentNode, !$))
|
|
154
|
+
do
|
|
155
|
+
if (i && i.getBoundingClientRect && (h(i, "transform") !== "none" || t && h(i, "position") !== "static")) {
|
|
156
|
+
var m = i.getBoundingClientRect();
|
|
157
|
+
a -= m.top + parseInt(h(i, "border-top-width")), l -= m.left + parseInt(h(i, "border-left-width")), s = a + r.height, u = l + r.width;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
while (i = i.parentNode);
|
|
161
|
+
if (o && n !== window) {
|
|
162
|
+
var w = ce(i || n), v = w && w.a, E = w && w.d;
|
|
163
|
+
w && (a /= E, l /= v, f /= v, c /= E, s = a + c, u = l + f);
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
top: a,
|
|
167
|
+
left: l,
|
|
168
|
+
bottom: s,
|
|
169
|
+
right: u,
|
|
170
|
+
width: f,
|
|
171
|
+
height: c
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function dt(n, e, t) {
|
|
176
|
+
for (var o = J(n, !0), i = I(n)[e]; o; ) {
|
|
177
|
+
var r = I(o)[t], a = void 0;
|
|
178
|
+
if (a = i >= r, !a) return o;
|
|
179
|
+
if (o === W()) break;
|
|
180
|
+
o = J(o, !1);
|
|
181
|
+
}
|
|
182
|
+
return !1;
|
|
183
|
+
}
|
|
184
|
+
function ke(n, e, t) {
|
|
185
|
+
for (var o = 0, i = 0, r = n.children; i < r.length; ) {
|
|
186
|
+
if (r[i].style.display !== "none" && r[i] !== p.ghost && r[i] !== p.dragged && H(r[i], t.draggable, n, !1)) {
|
|
187
|
+
if (o === e)
|
|
188
|
+
return r[i];
|
|
189
|
+
o++;
|
|
190
|
+
}
|
|
191
|
+
i++;
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
function nt(n, e) {
|
|
196
|
+
for (var t = n.lastElementChild; t && (t === p.ghost || h(t, "display") === "none" || e && !Fe(t, e)); )
|
|
197
|
+
t = t.previousElementSibling;
|
|
198
|
+
return t || null;
|
|
199
|
+
}
|
|
200
|
+
function X(n, e) {
|
|
201
|
+
var t = 0;
|
|
202
|
+
if (!n || !n.parentNode)
|
|
203
|
+
return -1;
|
|
204
|
+
for (; n = n.previousElementSibling; )
|
|
205
|
+
n.nodeName.toUpperCase() !== "TEMPLATE" && n !== p.clone && (!e || Fe(n, e)) && t++;
|
|
206
|
+
return t;
|
|
207
|
+
}
|
|
208
|
+
function ft(n) {
|
|
209
|
+
var e = 0, t = 0, o = W();
|
|
210
|
+
if (n)
|
|
211
|
+
do {
|
|
212
|
+
var i = ce(n), r = i.a, a = i.d;
|
|
213
|
+
e += n.scrollLeft * r, t += n.scrollTop * a;
|
|
214
|
+
} while (n !== o && (n = n.parentNode));
|
|
215
|
+
return [e, t];
|
|
216
|
+
}
|
|
217
|
+
function en(n, e) {
|
|
218
|
+
for (var t in n)
|
|
219
|
+
if (n.hasOwnProperty(t)) {
|
|
220
|
+
for (var o in e)
|
|
221
|
+
if (e.hasOwnProperty(o) && e[o] === n[t][o]) return Number(t);
|
|
222
|
+
}
|
|
223
|
+
return -1;
|
|
224
|
+
}
|
|
225
|
+
function J(n, e) {
|
|
226
|
+
if (!n || !n.getBoundingClientRect) return W();
|
|
227
|
+
var t = n, o = !1;
|
|
228
|
+
do
|
|
229
|
+
if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
|
|
230
|
+
var i = h(t);
|
|
231
|
+
if (t.clientWidth < t.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
232
|
+
if (!t.getBoundingClientRect || t === document.body) return W();
|
|
233
|
+
if (o || e) return t;
|
|
234
|
+
o = !0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
while (t = t.parentNode);
|
|
238
|
+
return W();
|
|
239
|
+
}
|
|
240
|
+
function tn(n, e) {
|
|
241
|
+
if (n && e)
|
|
242
|
+
for (var t in e)
|
|
243
|
+
e.hasOwnProperty(t) && (n[t] = e[t]);
|
|
244
|
+
return n;
|
|
245
|
+
}
|
|
246
|
+
function He(n, e) {
|
|
247
|
+
return Math.round(n.top) === Math.round(e.top) && Math.round(n.left) === Math.round(e.left) && Math.round(n.height) === Math.round(e.height) && Math.round(n.width) === Math.round(e.width);
|
|
248
|
+
}
|
|
249
|
+
var ye;
|
|
250
|
+
function yt(n, e) {
|
|
251
|
+
return function() {
|
|
252
|
+
if (!ye) {
|
|
253
|
+
var t = arguments, o = this;
|
|
254
|
+
t.length === 1 ? n.call(o, t[0]) : n.apply(o, t), ye = setTimeout(function() {
|
|
255
|
+
ye = void 0;
|
|
256
|
+
}, e);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function nn() {
|
|
261
|
+
clearTimeout(ye), ye = void 0;
|
|
262
|
+
}
|
|
263
|
+
function Et(n, e, t) {
|
|
264
|
+
n.scrollLeft += e, n.scrollTop += t;
|
|
265
|
+
}
|
|
266
|
+
function wt(n) {
|
|
267
|
+
var e = window.Polymer, t = window.jQuery || window.Zepto;
|
|
268
|
+
return e && e.dom ? e.dom(n).cloneNode(!0) : t ? t(n).clone(!0)[0] : n.cloneNode(!0);
|
|
269
|
+
}
|
|
270
|
+
var k = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
271
|
+
function on() {
|
|
272
|
+
var n = [], e;
|
|
273
|
+
return {
|
|
274
|
+
captureAnimationState: function() {
|
|
275
|
+
if (n = [], !!this.options.animation) {
|
|
276
|
+
var o = [].slice.call(this.el.children);
|
|
277
|
+
o.forEach(function(i) {
|
|
278
|
+
if (!(h(i, "display") === "none" || i === p.ghost)) {
|
|
279
|
+
n.push({
|
|
280
|
+
target: i,
|
|
281
|
+
rect: I(i)
|
|
282
|
+
});
|
|
283
|
+
var r = ee({}, n[n.length - 1].rect);
|
|
284
|
+
if (i.thisAnimationDuration) {
|
|
285
|
+
var a = ce(i, !0);
|
|
286
|
+
a && (r.top -= a.f, r.left -= a.e);
|
|
287
|
+
}
|
|
288
|
+
i.fromRect = r;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
addAnimationState: function(o) {
|
|
294
|
+
n.push(o);
|
|
295
|
+
},
|
|
296
|
+
removeAnimationState: function(o) {
|
|
297
|
+
n.splice(en(n, {
|
|
298
|
+
target: o
|
|
299
|
+
}), 1);
|
|
300
|
+
},
|
|
301
|
+
animateAll: function(o) {
|
|
302
|
+
var i = this;
|
|
303
|
+
if (!this.options.animation) {
|
|
304
|
+
clearTimeout(e), typeof o == "function" && o();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
var r = !1, a = 0;
|
|
308
|
+
n.forEach(function(l) {
|
|
309
|
+
var s = 0, u = l.target, c = u.fromRect, f = I(u), m = u.prevFromRect, w = u.prevToRect, v = l.rect, E = ce(u, !0);
|
|
310
|
+
E && (f.top -= E.f, f.left -= E.e), u.toRect = f, u.thisAnimationDuration && He(m, f) && !He(c, f) && // Make sure animatingRect is on line between toRect & fromRect
|
|
311
|
+
(v.top - f.top) / (v.left - f.left) === (c.top - f.top) / (c.left - f.left) && (s = an(v, m, w, i.options)), He(f, c) || (u.prevFromRect = c, u.prevToRect = f, s || (s = i.options.animation), i.animate(u, v, f, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
|
|
312
|
+
u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
|
|
313
|
+
}, s), u.thisAnimationDuration = s);
|
|
314
|
+
}), clearTimeout(e), r ? e = setTimeout(function() {
|
|
315
|
+
typeof o == "function" && o();
|
|
316
|
+
}, a) : typeof o == "function" && o(), n = [];
|
|
317
|
+
},
|
|
318
|
+
animate: function(o, i, r, a) {
|
|
319
|
+
if (a) {
|
|
320
|
+
h(o, "transition", ""), h(o, "transform", "");
|
|
321
|
+
var l = ce(this.el), s = l && l.a, u = l && l.d, c = (i.left - r.left) / (s || 1), f = (i.top - r.top) / (u || 1);
|
|
322
|
+
o.animatingX = !!c, o.animatingY = !!f, h(o, "transform", "translate3d(" + c + "px," + f + "px,0)"), rn(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() {
|
|
323
|
+
h(o, "transition", ""), h(o, "transform", ""), o.animated = !1, o.animatingX = !1, o.animatingY = !1;
|
|
324
|
+
}, a);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function rn(n) {
|
|
330
|
+
return n.offsetWidth;
|
|
331
|
+
}
|
|
332
|
+
function an(n, e, t, o) {
|
|
333
|
+
return Math.sqrt(Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)) / Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) * o.animation;
|
|
334
|
+
}
|
|
335
|
+
var ge = [], We = {
|
|
336
|
+
initializeByDefault: !0
|
|
337
|
+
}, Se = {
|
|
338
|
+
mount: function(e) {
|
|
339
|
+
for (var t in We)
|
|
340
|
+
We.hasOwnProperty(t) && !(t in e) && (e[t] = We[t]);
|
|
341
|
+
ge.push(e);
|
|
342
|
+
},
|
|
343
|
+
pluginEvent: function(e, t, o) {
|
|
344
|
+
var i = this;
|
|
345
|
+
this.eventCanceled = !1, o.cancel = function() {
|
|
346
|
+
i.eventCanceled = !0;
|
|
347
|
+
};
|
|
348
|
+
var r = e + "Global";
|
|
349
|
+
ge.forEach(function(a) {
|
|
350
|
+
t[a.pluginName] && (t[a.pluginName][r] && t[a.pluginName][r](ee({
|
|
351
|
+
sortable: t
|
|
352
|
+
}, o)), t.options[a.pluginName] && t[a.pluginName][e] && t[a.pluginName][e](ee({
|
|
353
|
+
sortable: t
|
|
354
|
+
}, o)));
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
initializePlugins: function(e, t, o, i) {
|
|
358
|
+
ge.forEach(function(l) {
|
|
359
|
+
var s = l.pluginName;
|
|
360
|
+
if (!(!e.options[s] && !l.initializeByDefault)) {
|
|
361
|
+
var u = new l(e, t, e.options);
|
|
362
|
+
u.sortable = e, u.options = e.options, e[s] = u, j(o, u.defaults);
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
for (var r in e.options)
|
|
366
|
+
if (e.options.hasOwnProperty(r)) {
|
|
367
|
+
var a = this.modifyOption(e, r, e.options[r]);
|
|
368
|
+
typeof a < "u" && (e.options[r] = a);
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
getEventProperties: function(e, t) {
|
|
372
|
+
var o = {};
|
|
373
|
+
return ge.forEach(function(i) {
|
|
374
|
+
typeof i.eventProperties == "function" && j(o, i.eventProperties.call(t[i.pluginName], e));
|
|
375
|
+
}), o;
|
|
376
|
+
},
|
|
377
|
+
modifyOption: function(e, t, o) {
|
|
378
|
+
var i;
|
|
379
|
+
return ge.forEach(function(r) {
|
|
380
|
+
e[r.pluginName] && r.optionListeners && typeof r.optionListeners[t] == "function" && (i = r.optionListeners[t].call(e[r.pluginName], o));
|
|
381
|
+
}), i;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
function ln(n) {
|
|
385
|
+
var e = n.sortable, t = n.rootEl, o = n.name, i = n.targetEl, r = n.cloneEl, a = n.toEl, l = n.fromEl, s = n.oldIndex, u = n.newIndex, c = n.oldDraggableIndex, f = n.newDraggableIndex, m = n.originalEvent, w = n.putSortable, v = n.extraEventProperties;
|
|
386
|
+
if (e = e || t && t[k], !!e) {
|
|
387
|
+
var E, R = e.options, U = "on" + o.charAt(0).toUpperCase() + o.substr(1);
|
|
388
|
+
window.CustomEvent && !$ && !_e ? E = new CustomEvent(o, {
|
|
389
|
+
bubbles: !0,
|
|
390
|
+
cancelable: !0
|
|
391
|
+
}) : (E = document.createEvent("Event"), E.initEvent(o, !0, !0)), E.to = a || t, E.from = l || t, E.item = i || t, E.clone = r, E.oldIndex = s, E.newIndex = u, E.oldDraggableIndex = c, E.newDraggableIndex = f, E.originalEvent = m, E.pullMode = w ? w.lastPutMode : void 0;
|
|
392
|
+
var x = ee({}, v, Se.getEventProperties(o, e));
|
|
393
|
+
for (var B in x)
|
|
394
|
+
E[B] = x[B];
|
|
395
|
+
t && t.dispatchEvent(E), R[U] && R[U].call(e, E);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
var P = function(e, t) {
|
|
399
|
+
var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = o.evt, r = Zt(o, ["evt"]);
|
|
400
|
+
Se.pluginEvent.bind(p)(e, t, ee({
|
|
401
|
+
dragEl: d,
|
|
402
|
+
parentEl: S,
|
|
403
|
+
ghostEl: g,
|
|
404
|
+
rootEl: D,
|
|
405
|
+
nextEl: ae,
|
|
406
|
+
lastDownEl: Pe,
|
|
407
|
+
cloneEl: _,
|
|
408
|
+
cloneHidden: K,
|
|
409
|
+
dragStarted: me,
|
|
410
|
+
putSortable: C,
|
|
411
|
+
activeSortable: p.active,
|
|
412
|
+
originalEvent: i,
|
|
413
|
+
oldIndex: fe,
|
|
414
|
+
oldDraggableIndex: Ee,
|
|
415
|
+
newIndex: F,
|
|
416
|
+
newDraggableIndex: Q,
|
|
417
|
+
hideGhostForTarget: Tt,
|
|
418
|
+
unhideGhostForTarget: Ct,
|
|
419
|
+
cloneNowHidden: function() {
|
|
420
|
+
K = !0;
|
|
421
|
+
},
|
|
422
|
+
cloneNowShown: function() {
|
|
423
|
+
K = !1;
|
|
424
|
+
},
|
|
425
|
+
dispatchSortableEvent: function(l) {
|
|
426
|
+
A({
|
|
427
|
+
sortable: t,
|
|
428
|
+
name: l,
|
|
429
|
+
originalEvent: i
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}, r));
|
|
433
|
+
};
|
|
434
|
+
function A(n) {
|
|
435
|
+
ln(ee({
|
|
436
|
+
putSortable: C,
|
|
437
|
+
cloneEl: _,
|
|
438
|
+
targetEl: d,
|
|
439
|
+
rootEl: D,
|
|
440
|
+
oldIndex: fe,
|
|
441
|
+
oldDraggableIndex: Ee,
|
|
442
|
+
newIndex: F,
|
|
443
|
+
newDraggableIndex: Q
|
|
444
|
+
}, n));
|
|
445
|
+
}
|
|
446
|
+
var d, S, g, D, ae, Pe, _, K, fe, F, Ee, Q, Ce, C, de = !1, Xe = !1, Re = [], ie, Y, Ge, ze, ct, ht, me, ue, we, De = !1, Ie = !1, xe, O, Ve = [], Ke = !1, Ye = [], Le = typeof document < "u", Oe = mt, pt = _e || $ ? "cssFloat" : "float", sn = Le && !Kt && !mt && "draggable" in document.createElement("div"), Dt = function() {
|
|
447
|
+
if (Le) {
|
|
448
|
+
if ($)
|
|
449
|
+
return !1;
|
|
450
|
+
var n = document.createElement("x");
|
|
451
|
+
return n.style.cssText = "pointer-events:auto", n.style.pointerEvents === "auto";
|
|
452
|
+
}
|
|
453
|
+
}(), _t = function(e, t) {
|
|
454
|
+
var o = h(e), i = parseInt(o.width) - parseInt(o.paddingLeft) - parseInt(o.paddingRight) - parseInt(o.borderLeftWidth) - parseInt(o.borderRightWidth), r = ke(e, 0, t), a = ke(e, 1, t), l = r && h(r), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + I(r).width, c = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + I(a).width;
|
|
455
|
+
if (o.display === "flex")
|
|
456
|
+
return o.flexDirection === "column" || o.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
457
|
+
if (o.display === "grid")
|
|
458
|
+
return o.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
459
|
+
if (r && l.float && l.float !== "none") {
|
|
460
|
+
var f = l.float === "left" ? "left" : "right";
|
|
461
|
+
return a && (s.clear === "both" || s.clear === f) ? "vertical" : "horizontal";
|
|
462
|
+
}
|
|
463
|
+
return r && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= i && o[pt] === "none" || a && o[pt] === "none" && u + c > i) ? "vertical" : "horizontal";
|
|
464
|
+
}, un = function(e, t, o) {
|
|
465
|
+
var i = o ? e.left : e.top, r = o ? e.right : e.bottom, a = o ? e.width : e.height, l = o ? t.left : t.top, s = o ? t.right : t.bottom, u = o ? t.width : t.height;
|
|
466
|
+
return i === l || r === s || i + a / 2 === l + u / 2;
|
|
467
|
+
}, dn = function(e, t) {
|
|
468
|
+
var o;
|
|
469
|
+
return Re.some(function(i) {
|
|
470
|
+
if (!nt(i)) {
|
|
471
|
+
var r = I(i), a = i[k].options.emptyInsertThreshold, l = e >= r.left - a && e <= r.right + a, s = t >= r.top - a && t <= r.bottom + a;
|
|
472
|
+
if (a && l && s)
|
|
473
|
+
return o = i;
|
|
474
|
+
}
|
|
475
|
+
}), o;
|
|
476
|
+
}, St = function(e) {
|
|
477
|
+
function t(r, a) {
|
|
478
|
+
return function(l, s, u, c) {
|
|
479
|
+
var f = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
|
|
480
|
+
if (r == null && (a || f))
|
|
481
|
+
return !0;
|
|
482
|
+
if (r == null || r === !1)
|
|
483
|
+
return !1;
|
|
484
|
+
if (a && r === "clone")
|
|
485
|
+
return r;
|
|
486
|
+
if (typeof r == "function")
|
|
487
|
+
return t(r(l, s, u, c), a)(l, s, u, c);
|
|
488
|
+
var m = (a ? l : s).options.group.name;
|
|
489
|
+
return r === !0 || typeof r == "string" && r === m || r.join && r.indexOf(m) > -1;
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
var o = {}, i = e.group;
|
|
493
|
+
(!i || Ae(i) != "object") && (i = {
|
|
494
|
+
name: i
|
|
495
|
+
}), o.name = i.name, o.checkPull = t(i.pull, !0), o.checkPut = t(i.put), o.revertClone = i.revertClone, e.group = o;
|
|
496
|
+
}, Tt = function() {
|
|
497
|
+
!Dt && g && h(g, "display", "none");
|
|
498
|
+
}, Ct = function() {
|
|
499
|
+
!Dt && g && h(g, "display", "");
|
|
500
|
+
};
|
|
501
|
+
Le && document.addEventListener("click", function(n) {
|
|
502
|
+
if (Xe)
|
|
503
|
+
return n.preventDefault(), n.stopPropagation && n.stopPropagation(), n.stopImmediatePropagation && n.stopImmediatePropagation(), Xe = !1, !1;
|
|
504
|
+
}, !0);
|
|
505
|
+
var re = function(e) {
|
|
506
|
+
if (d) {
|
|
507
|
+
e = e.touches ? e.touches[0] : e;
|
|
508
|
+
var t = dn(e.clientX, e.clientY);
|
|
509
|
+
if (t) {
|
|
510
|
+
var o = {};
|
|
511
|
+
for (var i in e)
|
|
512
|
+
e.hasOwnProperty(i) && (o[i] = e[i]);
|
|
513
|
+
o.target = o.rootEl = t, o.preventDefault = void 0, o.stopPropagation = void 0, t[k]._onDragOver(o);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}, fn = function(e) {
|
|
517
|
+
d && d.parentNode[k]._isOutsideThisEl(e.target);
|
|
518
|
+
};
|
|
519
|
+
function p(n, e) {
|
|
520
|
+
if (!(n && n.nodeType && n.nodeType === 1))
|
|
521
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));
|
|
522
|
+
this.el = n, this.options = e = j({}, e), n[k] = this;
|
|
523
|
+
var t = {
|
|
524
|
+
group: null,
|
|
525
|
+
sort: !0,
|
|
526
|
+
disabled: !1,
|
|
527
|
+
store: null,
|
|
528
|
+
handle: null,
|
|
529
|
+
draggable: /^[uo]l$/i.test(n.nodeName) ? ">li" : ">*",
|
|
530
|
+
swapThreshold: 1,
|
|
531
|
+
// percentage; 0 <= x <= 1
|
|
532
|
+
invertSwap: !1,
|
|
533
|
+
// invert always
|
|
534
|
+
invertedSwapThreshold: null,
|
|
535
|
+
// will be set to same as swapThreshold if default
|
|
536
|
+
removeCloneOnHide: !0,
|
|
537
|
+
direction: function() {
|
|
538
|
+
return _t(n, this.options);
|
|
539
|
+
},
|
|
540
|
+
ghostClass: "sortable-ghost",
|
|
541
|
+
chosenClass: "sortable-chosen",
|
|
542
|
+
dragClass: "sortable-drag",
|
|
543
|
+
ignore: "a, img",
|
|
544
|
+
filter: null,
|
|
545
|
+
preventOnFilter: !0,
|
|
546
|
+
animation: 0,
|
|
547
|
+
easing: null,
|
|
548
|
+
setData: function(a, l) {
|
|
549
|
+
a.setData("Text", l.textContent);
|
|
550
|
+
},
|
|
551
|
+
dropBubble: !1,
|
|
552
|
+
dragoverBubble: !1,
|
|
553
|
+
dataIdAttr: "data-id",
|
|
554
|
+
delay: 0,
|
|
555
|
+
delayOnTouchOnly: !1,
|
|
556
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
557
|
+
forceFallback: !1,
|
|
558
|
+
fallbackClass: "sortable-fallback",
|
|
559
|
+
fallbackOnBody: !1,
|
|
560
|
+
fallbackTolerance: 0,
|
|
561
|
+
fallbackOffset: {
|
|
562
|
+
x: 0,
|
|
563
|
+
y: 0
|
|
564
|
+
},
|
|
565
|
+
supportPointer: p.supportPointer !== !1 && "PointerEvent" in window,
|
|
566
|
+
emptyInsertThreshold: 5
|
|
567
|
+
};
|
|
568
|
+
Se.initializePlugins(this, n, t);
|
|
569
|
+
for (var o in t)
|
|
570
|
+
!(o in e) && (e[o] = t[o]);
|
|
571
|
+
St(e);
|
|
572
|
+
for (var i in this)
|
|
573
|
+
i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
574
|
+
this.nativeDraggable = e.forceFallback ? !1 : sn, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? y(n, "pointerdown", this._onTapStart) : (y(n, "mousedown", this._onTapStart), y(n, "touchstart", this._onTapStart)), this.nativeDraggable && (y(n, "dragover", this), y(n, "dragenter", this)), Re.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), j(this, on());
|
|
575
|
+
}
|
|
576
|
+
p.prototype = /** @lends Sortable.prototype */
|
|
577
|
+
{
|
|
578
|
+
constructor: p,
|
|
579
|
+
_isOutsideThisEl: function(e) {
|
|
580
|
+
!this.el.contains(e) && e !== this.el && (ue = null);
|
|
581
|
+
},
|
|
582
|
+
_getDirection: function(e, t) {
|
|
583
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, d) : this.options.direction;
|
|
584
|
+
},
|
|
585
|
+
_onTapStart: function(e) {
|
|
586
|
+
if (e.cancelable) {
|
|
587
|
+
var t = 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, c = i.filter;
|
|
588
|
+
if (bn(o), !d && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || i.disabled) && !u.isContentEditable && (s = H(s, i.draggable, o, !1), !(s && s.animated) && Pe !== s)) {
|
|
589
|
+
if (fe = X(s), Ee = X(s, i.draggable), typeof c == "function") {
|
|
590
|
+
if (c.call(this, e, s, this)) {
|
|
591
|
+
A({
|
|
592
|
+
sortable: t,
|
|
593
|
+
rootEl: u,
|
|
594
|
+
name: "filter",
|
|
595
|
+
targetEl: s,
|
|
596
|
+
toEl: o,
|
|
597
|
+
fromEl: o
|
|
598
|
+
}), P("filter", t, {
|
|
599
|
+
evt: e
|
|
600
|
+
}), r && e.cancelable && e.preventDefault();
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
} else if (c && (c = c.split(",").some(function(f) {
|
|
604
|
+
if (f = H(u, f.trim(), o, !1), f)
|
|
605
|
+
return A({
|
|
606
|
+
sortable: t,
|
|
607
|
+
rootEl: f,
|
|
608
|
+
name: "filter",
|
|
609
|
+
targetEl: s,
|
|
610
|
+
fromEl: o,
|
|
611
|
+
toEl: o
|
|
612
|
+
}), P("filter", t, {
|
|
613
|
+
evt: e
|
|
614
|
+
}), !0;
|
|
615
|
+
}), c)) {
|
|
616
|
+
r && e.cancelable && e.preventDefault();
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
i.handle && !H(u, i.handle, o, !1) || this._prepareDragStart(e, l, s);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
_prepareDragStart: function(e, t, o) {
|
|
624
|
+
var i = this, r = i.el, a = i.options, l = r.ownerDocument, s;
|
|
625
|
+
if (o && !d && o.parentNode === r) {
|
|
626
|
+
var u = I(o);
|
|
627
|
+
if (D = r, d = o, S = d.parentNode, ae = d.nextSibling, Pe = o, Ce = a.group, p.dragged = d, ie = {
|
|
628
|
+
target: d,
|
|
629
|
+
clientX: (t || e).clientX,
|
|
630
|
+
clientY: (t || e).clientY
|
|
631
|
+
}, ct = ie.clientX - u.left, ht = ie.clientY - u.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, d.style["will-change"] = "all", s = function() {
|
|
632
|
+
if (P("delayEnded", i, {
|
|
633
|
+
evt: e
|
|
634
|
+
}), p.eventCanceled) {
|
|
635
|
+
i._onDrop();
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
i._disableDelayedDragEvents(), !st && i.nativeDraggable && (d.draggable = !0), i._triggerDragStart(e, t), A({
|
|
639
|
+
sortable: i,
|
|
640
|
+
name: "choose",
|
|
641
|
+
originalEvent: e
|
|
642
|
+
}), M(d, a.chosenClass, !0);
|
|
643
|
+
}, a.ignore.split(",").forEach(function(c) {
|
|
644
|
+
bt(d, c.trim(), $e);
|
|
645
|
+
}), y(l, "dragover", re), y(l, "mousemove", re), y(l, "touchmove", re), y(l, "mouseup", i._onDrop), y(l, "touchend", i._onDrop), y(l, "touchcancel", i._onDrop), st && this.nativeDraggable && (this.options.touchStartThreshold = 4, d.draggable = !0), P("delayStart", this, {
|
|
646
|
+
evt: e
|
|
647
|
+
}), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(_e || $))) {
|
|
648
|
+
if (p.eventCanceled) {
|
|
649
|
+
this._onDrop();
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
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);
|
|
653
|
+
} else
|
|
654
|
+
s();
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
_delayedDragTouchMoveHandler: function(e) {
|
|
658
|
+
var t = e.touches ? e.touches[0] : e;
|
|
659
|
+
Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
660
|
+
},
|
|
661
|
+
_disableDelayedDrag: function() {
|
|
662
|
+
d && $e(d), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
663
|
+
},
|
|
664
|
+
_disableDelayedDragEvents: function() {
|
|
665
|
+
var e = this.el.ownerDocument;
|
|
666
|
+
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);
|
|
667
|
+
},
|
|
668
|
+
_triggerDragStart: function(e, t) {
|
|
669
|
+
t = t || e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? y(document, "pointermove", this._onTouchMove) : t ? y(document, "touchmove", this._onTouchMove) : y(document, "mousemove", this._onTouchMove) : (y(d, "dragend", this), y(D, "dragstart", this._onDragStart));
|
|
670
|
+
try {
|
|
671
|
+
document.selection ? Ne(function() {
|
|
672
|
+
document.selection.empty();
|
|
673
|
+
}) : window.getSelection().removeAllRanges();
|
|
674
|
+
} catch {
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
_dragStarted: function(e, t) {
|
|
678
|
+
if (de = !1, D && d) {
|
|
679
|
+
P("dragStarted", this, {
|
|
680
|
+
evt: t
|
|
681
|
+
}), this.nativeDraggable && y(document, "dragover", fn);
|
|
682
|
+
var o = this.options;
|
|
683
|
+
!e && M(d, o.dragClass, !1), M(d, o.ghostClass, !0), p.active = this, e && this._appendGhost(), A({
|
|
684
|
+
sortable: this,
|
|
685
|
+
name: "start",
|
|
686
|
+
originalEvent: t
|
|
687
|
+
});
|
|
688
|
+
} else
|
|
689
|
+
this._nulling();
|
|
690
|
+
},
|
|
691
|
+
_emulateDragOver: function() {
|
|
692
|
+
if (Y) {
|
|
693
|
+
this._lastX = Y.clientX, this._lastY = Y.clientY, Tt();
|
|
694
|
+
for (var e = document.elementFromPoint(Y.clientX, Y.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Y.clientX, Y.clientY), e !== t); )
|
|
695
|
+
t = e;
|
|
696
|
+
if (d.parentNode[k]._isOutsideThisEl(e), t)
|
|
697
|
+
do {
|
|
698
|
+
if (t[k]) {
|
|
699
|
+
var o = void 0;
|
|
700
|
+
if (o = t[k]._onDragOver({
|
|
701
|
+
clientX: Y.clientX,
|
|
702
|
+
clientY: Y.clientY,
|
|
703
|
+
target: e,
|
|
704
|
+
rootEl: t
|
|
705
|
+
}), o && !this.options.dragoverBubble)
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
e = t;
|
|
709
|
+
} while (t = t.parentNode);
|
|
710
|
+
Ct();
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
_onTouchMove: function(e) {
|
|
714
|
+
if (ie) {
|
|
715
|
+
var t = this.options, o = t.fallbackTolerance, i = t.fallbackOffset, r = e.touches ? e.touches[0] : e, a = g && ce(g, !0), l = g && a && a.a, s = g && a && a.d, u = Oe && O && ft(O), c = (r.clientX - ie.clientX + i.x) / (l || 1) + (u ? u[0] - Ve[0] : 0) / (l || 1), f = (r.clientY - ie.clientY + i.y) / (s || 1) + (u ? u[1] - Ve[1] : 0) / (s || 1);
|
|
716
|
+
if (!p.active && !de) {
|
|
717
|
+
if (o && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < o)
|
|
718
|
+
return;
|
|
719
|
+
this._onDragStart(e, !0);
|
|
720
|
+
}
|
|
721
|
+
if (g) {
|
|
722
|
+
a ? (a.e += c - (Ge || 0), a.f += f - (ze || 0)) : a = {
|
|
723
|
+
a: 1,
|
|
724
|
+
b: 0,
|
|
725
|
+
c: 0,
|
|
726
|
+
d: 1,
|
|
727
|
+
e: c,
|
|
728
|
+
f
|
|
729
|
+
};
|
|
730
|
+
var m = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
|
|
731
|
+
h(g, "webkitTransform", m), h(g, "mozTransform", m), h(g, "msTransform", m), h(g, "transform", m), Ge = c, ze = f, Y = r;
|
|
732
|
+
}
|
|
733
|
+
e.cancelable && e.preventDefault();
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
_appendGhost: function() {
|
|
737
|
+
if (!g) {
|
|
738
|
+
var e = this.options.fallbackOnBody ? document.body : D, t = I(d, !0, Oe, !0, e), o = this.options;
|
|
739
|
+
if (Oe) {
|
|
740
|
+
for (O = e; h(O, "position") === "static" && h(O, "transform") === "none" && O !== document; )
|
|
741
|
+
O = O.parentNode;
|
|
742
|
+
O !== document.body && O !== document.documentElement ? (O === document && (O = W()), t.top += O.scrollTop, t.left += O.scrollLeft) : O = W(), Ve = ft(O);
|
|
743
|
+
}
|
|
744
|
+
g = d.cloneNode(!0), M(g, o.ghostClass, !1), M(g, o.fallbackClass, !0), M(g, o.dragClass, !0), h(g, "transition", ""), h(g, "transform", ""), h(g, "box-sizing", "border-box"), h(g, "margin", 0), h(g, "top", t.top), h(g, "left", t.left), h(g, "width", t.width), h(g, "height", t.height), h(g, "opacity", "0.8"), h(g, "position", Oe ? "absolute" : "fixed"), h(g, "zIndex", "100000"), h(g, "pointerEvents", "none"), p.ghost = g, e.appendChild(g), h(g, "transform-origin", ct / parseInt(g.style.width) * 100 + "% " + ht / parseInt(g.style.height) * 100 + "%");
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
_onDragStart: function(e, t) {
|
|
748
|
+
var o = this, i = e.dataTransfer, r = o.options;
|
|
749
|
+
if (P("dragStart", this, {
|
|
750
|
+
evt: e
|
|
751
|
+
}), p.eventCanceled) {
|
|
752
|
+
this._onDrop();
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
P("setupClone", this), p.eventCanceled || (_ = wt(d), _.draggable = !1, _.style["will-change"] = "", this._hideClone(), M(_, this.options.chosenClass, !1), p.clone = _), o.cloneId = Ne(function() {
|
|
756
|
+
P("clone", o), !p.eventCanceled && (o.options.removeCloneOnHide || D.insertBefore(_, d), o._hideClone(), A({
|
|
757
|
+
sortable: o,
|
|
758
|
+
name: "clone"
|
|
759
|
+
}));
|
|
760
|
+
}), !t && M(d, r.dragClass, !0), t ? (Xe = !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, d)), y(document, "drop", o), h(d, "transform", "translateZ(0)")), de = !0, o._dragStartId = Ne(o._dragStarted.bind(o, t, e)), y(document, "selectstart", o), me = !0, Qe && h(document.body, "user-select", "none");
|
|
761
|
+
},
|
|
762
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
763
|
+
_onDragOver: function(e) {
|
|
764
|
+
var t = this.el, o = e.target, i, r, a, l = this.options, s = l.group, u = p.active, c = Ce === s, f = l.sort, m = C || u, w, v = this, E = !1;
|
|
765
|
+
if (Ke) return;
|
|
766
|
+
function R(pe, Ot) {
|
|
767
|
+
P(pe, v, ee({
|
|
768
|
+
evt: e,
|
|
769
|
+
isOwner: c,
|
|
770
|
+
axis: w ? "vertical" : "horizontal",
|
|
771
|
+
revert: a,
|
|
772
|
+
dragRect: i,
|
|
773
|
+
targetRect: r,
|
|
774
|
+
canSort: f,
|
|
775
|
+
fromSortable: m,
|
|
776
|
+
target: o,
|
|
777
|
+
completed: x,
|
|
778
|
+
onMove: function(rt, At) {
|
|
779
|
+
return je(D, t, d, i, rt, I(rt), e, At);
|
|
780
|
+
},
|
|
781
|
+
changed: B
|
|
782
|
+
}, Ot));
|
|
783
|
+
}
|
|
784
|
+
function U() {
|
|
785
|
+
R("dragOverAnimationCapture"), v.captureAnimationState(), v !== m && m.captureAnimationState();
|
|
786
|
+
}
|
|
787
|
+
function x(pe) {
|
|
788
|
+
return R("dragOverCompleted", {
|
|
789
|
+
insertion: pe
|
|
790
|
+
}), pe && (c ? u._hideClone() : u._showClone(v), v !== m && (M(d, C ? C.options.ghostClass : u.options.ghostClass, !1), M(d, l.ghostClass, !0)), C !== v && v !== p.active ? C = v : v === p.active && C && (C = null), m === v && (v._ignoreWhileAnimating = o), v.animateAll(function() {
|
|
791
|
+
R("dragOverAnimationComplete"), v._ignoreWhileAnimating = null;
|
|
792
|
+
}), v !== m && (m.animateAll(), m._ignoreWhileAnimating = null)), (o === d && !d.animated || o === t && !o.animated) && (ue = null), !l.dragoverBubble && !e.rootEl && o !== document && (d.parentNode[k]._isOutsideThisEl(e.target), !pe && re(e)), !l.dragoverBubble && e.stopPropagation && e.stopPropagation(), E = !0;
|
|
793
|
+
}
|
|
794
|
+
function B() {
|
|
795
|
+
F = X(d), Q = X(d, l.draggable), A({
|
|
796
|
+
sortable: v,
|
|
797
|
+
name: "change",
|
|
798
|
+
toEl: t,
|
|
799
|
+
newIndex: F,
|
|
800
|
+
newDraggableIndex: Q,
|
|
801
|
+
originalEvent: e
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), o = H(o, l.draggable, t, !0), R("dragOver"), p.eventCanceled) return E;
|
|
805
|
+
if (d.contains(e.target) || o.animated && o.animatingX && o.animatingY || v._ignoreWhileAnimating === o)
|
|
806
|
+
return x(!1);
|
|
807
|
+
if (Xe = !1, u && !l.disabled && (c ? f || (a = !D.contains(d)) : C === this || (this.lastPutMode = Ce.checkPull(this, u, d, e)) && s.checkPut(this, u, d, e))) {
|
|
808
|
+
if (w = this._getDirection(e, o) === "vertical", i = I(d), R("dragOverValid"), p.eventCanceled) return E;
|
|
809
|
+
if (a)
|
|
810
|
+
return S = D, U(), this._hideClone(), R("revert"), p.eventCanceled || (ae ? D.insertBefore(d, ae) : D.appendChild(d)), x(!0);
|
|
811
|
+
var G = nt(t, l.draggable);
|
|
812
|
+
if (!G || pn(e, w, this) && !G.animated) {
|
|
813
|
+
if (G === d)
|
|
814
|
+
return x(!1);
|
|
815
|
+
if (G && t === e.target && (o = G), o && (r = I(o)), je(D, t, d, i, o, r, e, !!o) !== !1)
|
|
816
|
+
return U(), t.appendChild(d), S = t, B(), x(!0);
|
|
817
|
+
} else if (o.parentNode === t) {
|
|
818
|
+
r = I(o);
|
|
819
|
+
var L = 0, te, he = d.parentNode !== t, le = !un(d.animated && d.toRect || i, o.animated && o.toRect || r, w), N = w ? "top" : "left", q = dt(o, "top", "top") || dt(d, "top", "top"), Te = q ? q.scrollTop : void 0;
|
|
820
|
+
ue !== o && (te = r[N], De = !1, Ie = !le && l.invertSwap || he), L = gn(e, o, r, w, le ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Ie, ue === o);
|
|
821
|
+
var z;
|
|
822
|
+
if (L !== 0) {
|
|
823
|
+
var se = X(d);
|
|
824
|
+
do
|
|
825
|
+
se -= L, z = S.children[se];
|
|
826
|
+
while (z && (h(z, "display") === "none" || z === g));
|
|
827
|
+
}
|
|
828
|
+
if (L === 0 || z === o)
|
|
829
|
+
return x(!1);
|
|
830
|
+
ue = o, we = L;
|
|
831
|
+
var ne = o.nextElementSibling, Z = !1;
|
|
832
|
+
Z = L === 1;
|
|
833
|
+
var oe = je(D, t, d, i, o, r, e, Z);
|
|
834
|
+
if (oe !== !1)
|
|
835
|
+
return (oe === 1 || oe === -1) && (Z = oe === 1), Ke = !0, setTimeout(hn, 30), U(), Z && !ne ? t.appendChild(d) : o.parentNode.insertBefore(d, Z ? ne : o), q && Et(q, 0, Te - q.scrollTop), S = d.parentNode, te !== void 0 && !Ie && (xe = Math.abs(te - I(o)[N])), B(), x(!0);
|
|
836
|
+
}
|
|
837
|
+
if (t.contains(d))
|
|
838
|
+
return x(!1);
|
|
839
|
+
}
|
|
840
|
+
return !1;
|
|
841
|
+
},
|
|
842
|
+
_ignoreWhileAnimating: null,
|
|
843
|
+
_offMoveEvents: function() {
|
|
844
|
+
b(document, "mousemove", this._onTouchMove), b(document, "touchmove", this._onTouchMove), b(document, "pointermove", this._onTouchMove), b(document, "dragover", re), b(document, "mousemove", re), b(document, "touchmove", re);
|
|
845
|
+
},
|
|
846
|
+
_offUpEvents: function() {
|
|
847
|
+
var e = this.el.ownerDocument;
|
|
848
|
+
b(e, "mouseup", this._onDrop), b(e, "touchend", this._onDrop), b(e, "pointerup", this._onDrop), b(e, "touchcancel", this._onDrop), b(document, "selectstart", this);
|
|
849
|
+
},
|
|
850
|
+
_onDrop: function(e) {
|
|
851
|
+
var t = this.el, o = this.options;
|
|
852
|
+
if (F = X(d), Q = X(d, o.draggable), P("drop", this, {
|
|
853
|
+
evt: e
|
|
854
|
+
}), S = d && d.parentNode, F = X(d), Q = X(d, o.draggable), p.eventCanceled) {
|
|
855
|
+
this._nulling();
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
de = !1, Ie = !1, De = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Je(this.cloneId), Je(this._dragStartId), this.nativeDraggable && (b(document, "drop", this), b(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Qe && h(document.body, "user-select", ""), h(d, "transform", ""), e && (me && (e.cancelable && e.preventDefault(), !o.dropBubble && e.stopPropagation()), g && g.parentNode && g.parentNode.removeChild(g), (D === S || C && C.lastPutMode !== "clone") && _ && _.parentNode && _.parentNode.removeChild(_), d && (this.nativeDraggable && b(d, "dragend", this), $e(d), d.style["will-change"] = "", me && !de && M(d, C ? C.options.ghostClass : this.options.ghostClass, !1), M(d, this.options.chosenClass, !1), A({
|
|
859
|
+
sortable: this,
|
|
860
|
+
name: "unchoose",
|
|
861
|
+
toEl: S,
|
|
862
|
+
newIndex: null,
|
|
863
|
+
newDraggableIndex: null,
|
|
864
|
+
originalEvent: e
|
|
865
|
+
}), D !== S ? (F >= 0 && (A({
|
|
866
|
+
rootEl: S,
|
|
867
|
+
name: "add",
|
|
868
|
+
toEl: S,
|
|
869
|
+
fromEl: D,
|
|
870
|
+
originalEvent: e
|
|
871
|
+
}), A({
|
|
872
|
+
sortable: this,
|
|
873
|
+
name: "remove",
|
|
874
|
+
toEl: S,
|
|
875
|
+
originalEvent: e
|
|
876
|
+
}), A({
|
|
877
|
+
rootEl: S,
|
|
878
|
+
name: "sort",
|
|
879
|
+
toEl: S,
|
|
880
|
+
fromEl: D,
|
|
881
|
+
originalEvent: e
|
|
882
|
+
}), A({
|
|
883
|
+
sortable: this,
|
|
884
|
+
name: "sort",
|
|
885
|
+
toEl: S,
|
|
886
|
+
originalEvent: e
|
|
887
|
+
})), C && C.save()) : F !== fe && F >= 0 && (A({
|
|
888
|
+
sortable: this,
|
|
889
|
+
name: "update",
|
|
890
|
+
toEl: S,
|
|
891
|
+
originalEvent: e
|
|
892
|
+
}), A({
|
|
893
|
+
sortable: this,
|
|
894
|
+
name: "sort",
|
|
895
|
+
toEl: S,
|
|
896
|
+
originalEvent: e
|
|
897
|
+
})), p.active && ((F == null || F === -1) && (F = fe, Q = Ee), A({
|
|
898
|
+
sortable: this,
|
|
899
|
+
name: "end",
|
|
900
|
+
toEl: S,
|
|
901
|
+
originalEvent: e
|
|
902
|
+
}), this.save()))), this._nulling();
|
|
903
|
+
},
|
|
904
|
+
_nulling: function() {
|
|
905
|
+
P("nulling", this), D = d = S = g = ae = _ = Pe = K = ie = Y = me = F = Q = fe = Ee = ue = we = C = Ce = p.dragged = p.ghost = p.clone = p.active = null, Ye.forEach(function(e) {
|
|
906
|
+
e.checked = !0;
|
|
907
|
+
}), Ye.length = Ge = ze = 0;
|
|
908
|
+
},
|
|
909
|
+
handleEvent: function(e) {
|
|
910
|
+
switch (e.type) {
|
|
911
|
+
case "drop":
|
|
912
|
+
case "dragend":
|
|
913
|
+
this._onDrop(e);
|
|
914
|
+
break;
|
|
915
|
+
case "dragenter":
|
|
916
|
+
case "dragover":
|
|
917
|
+
d && (this._onDragOver(e), cn(e));
|
|
918
|
+
break;
|
|
919
|
+
case "selectstart":
|
|
920
|
+
e.preventDefault();
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
/**
|
|
925
|
+
* Serializes the item into an array of string.
|
|
926
|
+
* @returns {String[]}
|
|
927
|
+
*/
|
|
928
|
+
toArray: function() {
|
|
929
|
+
for (var e = [], t, o = this.el.children, i = 0, r = o.length, a = this.options; i < r; i++)
|
|
930
|
+
t = o[i], H(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || vn(t));
|
|
931
|
+
return e;
|
|
932
|
+
},
|
|
933
|
+
/**
|
|
934
|
+
* Sorts the elements according to the array.
|
|
935
|
+
* @param {String[]} order order of the items
|
|
936
|
+
*/
|
|
937
|
+
sort: function(e) {
|
|
938
|
+
var t = {}, o = this.el;
|
|
939
|
+
this.toArray().forEach(function(i, r) {
|
|
940
|
+
var a = o.children[r];
|
|
941
|
+
H(a, this.options.draggable, o, !1) && (t[i] = a);
|
|
942
|
+
}, this), e.forEach(function(i) {
|
|
943
|
+
t[i] && (o.removeChild(t[i]), o.appendChild(t[i]));
|
|
944
|
+
});
|
|
945
|
+
},
|
|
946
|
+
/**
|
|
947
|
+
* Save the current sorting
|
|
948
|
+
*/
|
|
949
|
+
save: function() {
|
|
950
|
+
var e = this.options.store;
|
|
951
|
+
e && e.set && e.set(this);
|
|
952
|
+
},
|
|
953
|
+
/**
|
|
954
|
+
* 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.
|
|
955
|
+
* @param {HTMLElement} el
|
|
956
|
+
* @param {String} [selector] default: `options.draggable`
|
|
957
|
+
* @returns {HTMLElement|null}
|
|
958
|
+
*/
|
|
959
|
+
closest: function(e, t) {
|
|
960
|
+
return H(e, t || this.options.draggable, this.el, !1);
|
|
961
|
+
},
|
|
962
|
+
/**
|
|
963
|
+
* Set/get option
|
|
964
|
+
* @param {string} name
|
|
965
|
+
* @param {*} [value]
|
|
966
|
+
* @returns {*}
|
|
967
|
+
*/
|
|
968
|
+
option: function(e, t) {
|
|
969
|
+
var o = this.options;
|
|
970
|
+
if (t === void 0)
|
|
971
|
+
return o[e];
|
|
972
|
+
var i = Se.modifyOption(this, e, t);
|
|
973
|
+
typeof i < "u" ? o[e] = i : o[e] = t, e === "group" && St(o);
|
|
974
|
+
},
|
|
975
|
+
/**
|
|
976
|
+
* Destroy
|
|
977
|
+
*/
|
|
978
|
+
destroy: function() {
|
|
979
|
+
P("destroy", this);
|
|
980
|
+
var e = this.el;
|
|
981
|
+
e[k] = 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(t) {
|
|
982
|
+
t.removeAttribute("draggable");
|
|
983
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), Re.splice(Re.indexOf(this.el), 1), this.el = e = null;
|
|
984
|
+
},
|
|
985
|
+
_hideClone: function() {
|
|
986
|
+
if (!K) {
|
|
987
|
+
if (P("hideClone", this), p.eventCanceled) return;
|
|
988
|
+
h(_, "display", "none"), this.options.removeCloneOnHide && _.parentNode && _.parentNode.removeChild(_), K = !0;
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
_showClone: function(e) {
|
|
992
|
+
if (e.lastPutMode !== "clone") {
|
|
993
|
+
this._hideClone();
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
if (K) {
|
|
997
|
+
if (P("showClone", this), p.eventCanceled) return;
|
|
998
|
+
D.contains(d) && !this.options.group.revertClone ? D.insertBefore(_, d) : ae ? D.insertBefore(_, ae) : D.appendChild(_), this.options.group.revertClone && this.animate(d, _), h(_, "display", ""), K = !1;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
function cn(n) {
|
|
1003
|
+
n.dataTransfer && (n.dataTransfer.dropEffect = "move"), n.cancelable && n.preventDefault();
|
|
1004
|
+
}
|
|
1005
|
+
function je(n, e, t, o, i, r, a, l) {
|
|
1006
|
+
var s, u = n[k], c = u.options.onMove, f;
|
|
1007
|
+
return window.CustomEvent && !$ && !_e ? s = new CustomEvent("move", {
|
|
1008
|
+
bubbles: !0,
|
|
1009
|
+
cancelable: !0
|
|
1010
|
+
}) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = e, s.from = n, s.dragged = t, s.draggedRect = o, s.related = i || e, s.relatedRect = r || I(e), s.willInsertAfter = l, s.originalEvent = a, n.dispatchEvent(s), c && (f = c.call(u, s, a)), f;
|
|
1011
|
+
}
|
|
1012
|
+
function $e(n) {
|
|
1013
|
+
n.draggable = !1;
|
|
1014
|
+
}
|
|
1015
|
+
function hn() {
|
|
1016
|
+
Ke = !1;
|
|
1017
|
+
}
|
|
1018
|
+
function pn(n, e, t) {
|
|
1019
|
+
var o = I(nt(t.el, t.options.draggable)), i = 10;
|
|
1020
|
+
return e ? n.clientX > o.right + i || n.clientX <= o.right && n.clientY > o.bottom && n.clientX >= o.left : n.clientX > o.right && n.clientY > o.top || n.clientX <= o.right && n.clientY > o.bottom + i;
|
|
1021
|
+
}
|
|
1022
|
+
function gn(n, e, t, o, i, r, a, l) {
|
|
1023
|
+
var s = o ? n.clientY : n.clientX, u = o ? t.height : t.width, c = o ? t.top : t.left, f = o ? t.bottom : t.right, m = !1;
|
|
1024
|
+
if (!a) {
|
|
1025
|
+
if (l && xe < u * i) {
|
|
1026
|
+
if (!De && (we === 1 ? s > c + u * r / 2 : s < f - u * r / 2) && (De = !0), De)
|
|
1027
|
+
m = !0;
|
|
1028
|
+
else if (we === 1 ? s < c + xe : s > f - xe)
|
|
1029
|
+
return -we;
|
|
1030
|
+
} else if (s > c + u * (1 - i) / 2 && s < f - u * (1 - i) / 2)
|
|
1031
|
+
return mn(e);
|
|
1032
|
+
}
|
|
1033
|
+
return m = m || a, m && (s < c + u * r / 2 || s > f - u * r / 2) ? s > c + u / 2 ? 1 : -1 : 0;
|
|
1034
|
+
}
|
|
1035
|
+
function mn(n) {
|
|
1036
|
+
return X(d) < X(n) ? 1 : -1;
|
|
1037
|
+
}
|
|
1038
|
+
function vn(n) {
|
|
1039
|
+
for (var e = n.tagName + n.className + n.src + n.href + n.textContent, t = e.length, o = 0; t--; )
|
|
1040
|
+
o += e.charCodeAt(t);
|
|
1041
|
+
return o.toString(36);
|
|
1042
|
+
}
|
|
1043
|
+
function bn(n) {
|
|
1044
|
+
Ye.length = 0;
|
|
1045
|
+
for (var e = n.getElementsByTagName("input"), t = e.length; t--; ) {
|
|
1046
|
+
var o = e[t];
|
|
1047
|
+
o.checked && Ye.push(o);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
function Ne(n) {
|
|
1051
|
+
return setTimeout(n, 0);
|
|
1052
|
+
}
|
|
1053
|
+
function Je(n) {
|
|
1054
|
+
return clearTimeout(n);
|
|
1055
|
+
}
|
|
1056
|
+
Le && y(document, "touchmove", function(n) {
|
|
1057
|
+
(p.active || de) && n.cancelable && n.preventDefault();
|
|
1058
|
+
});
|
|
1059
|
+
p.utils = {
|
|
1060
|
+
on: y,
|
|
1061
|
+
off: b,
|
|
1062
|
+
css: h,
|
|
1063
|
+
find: bt,
|
|
1064
|
+
is: function(e, t) {
|
|
1065
|
+
return !!H(e, t, e, !1);
|
|
1066
|
+
},
|
|
1067
|
+
extend: tn,
|
|
1068
|
+
throttle: yt,
|
|
1069
|
+
closest: H,
|
|
1070
|
+
toggleClass: M,
|
|
1071
|
+
clone: wt,
|
|
1072
|
+
index: X,
|
|
1073
|
+
nextTick: Ne,
|
|
1074
|
+
cancelNextTick: Je,
|
|
1075
|
+
detectDirection: _t,
|
|
1076
|
+
getChild: ke
|
|
1077
|
+
};
|
|
1078
|
+
p.get = function(n) {
|
|
1079
|
+
return n[k];
|
|
1080
|
+
};
|
|
1081
|
+
p.mount = function() {
|
|
1082
|
+
for (var n = arguments.length, e = new Array(n), t = 0; t < n; t++)
|
|
1083
|
+
e[t] = arguments[t];
|
|
1084
|
+
e[0].constructor === Array && (e = e[0]), e.forEach(function(o) {
|
|
1085
|
+
if (!o.prototype || !o.prototype.constructor)
|
|
1086
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));
|
|
1087
|
+
o.utils && (p.utils = ee({}, p.utils, o.utils)), Se.mount(o);
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
1090
|
+
p.create = function(n, e) {
|
|
1091
|
+
return new p(n, e);
|
|
1092
|
+
};
|
|
1093
|
+
p.version = Qt;
|
|
1094
|
+
var T = [], ve, et, tt = !1, Ue, qe, Be, be;
|
|
1095
|
+
function yn() {
|
|
1096
|
+
function n() {
|
|
1097
|
+
this.defaults = {
|
|
1098
|
+
scroll: !0,
|
|
1099
|
+
scrollSensitivity: 30,
|
|
1100
|
+
scrollSpeed: 10,
|
|
1101
|
+
bubbleScroll: !0
|
|
1102
|
+
};
|
|
1103
|
+
for (var e in this)
|
|
1104
|
+
e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
|
|
1105
|
+
}
|
|
1106
|
+
return n.prototype = {
|
|
1107
|
+
dragStarted: function(t) {
|
|
1108
|
+
var o = t.originalEvent;
|
|
1109
|
+
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);
|
|
1110
|
+
},
|
|
1111
|
+
dragOverCompleted: function(t) {
|
|
1112
|
+
var o = t.originalEvent;
|
|
1113
|
+
!this.options.dragOverBubble && !o.rootEl && this._handleAutoScroll(o);
|
|
1114
|
+
},
|
|
1115
|
+
drop: function() {
|
|
1116
|
+
this.sortable.nativeDraggable ? b(document, "dragover", this._handleAutoScroll) : (b(document, "pointermove", this._handleFallbackAutoScroll), b(document, "touchmove", this._handleFallbackAutoScroll), b(document, "mousemove", this._handleFallbackAutoScroll)), gt(), Me(), nn();
|
|
1117
|
+
},
|
|
1118
|
+
nulling: function() {
|
|
1119
|
+
Be = et = ve = tt = be = Ue = qe = null, T.length = 0;
|
|
1120
|
+
},
|
|
1121
|
+
_handleFallbackAutoScroll: function(t) {
|
|
1122
|
+
this._handleAutoScroll(t, !0);
|
|
1123
|
+
},
|
|
1124
|
+
_handleAutoScroll: function(t, o) {
|
|
1125
|
+
var i = this, r = (t.touches ? t.touches[0] : t).clientX, a = (t.touches ? t.touches[0] : t).clientY, l = document.elementFromPoint(r, a);
|
|
1126
|
+
if (Be = t, o || _e || $ || Qe) {
|
|
1127
|
+
Ze(t, this.options, l, o);
|
|
1128
|
+
var s = J(l, !0);
|
|
1129
|
+
tt && (!be || r !== Ue || a !== qe) && (be && gt(), be = setInterval(function() {
|
|
1130
|
+
var u = J(document.elementFromPoint(r, a), !0);
|
|
1131
|
+
u !== s && (s = u, Me()), Ze(t, i.options, u, o);
|
|
1132
|
+
}, 10), Ue = r, qe = a);
|
|
1133
|
+
} else {
|
|
1134
|
+
if (!this.options.bubbleScroll || J(l, !0) === W()) {
|
|
1135
|
+
Me();
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
Ze(t, this.options, J(l, !1), !1);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}, j(n, {
|
|
1142
|
+
pluginName: "scroll",
|
|
1143
|
+
initializeByDefault: !0
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
function Me() {
|
|
1147
|
+
T.forEach(function(n) {
|
|
1148
|
+
clearInterval(n.pid);
|
|
1149
|
+
}), T = [];
|
|
1150
|
+
}
|
|
1151
|
+
function gt() {
|
|
1152
|
+
clearInterval(be);
|
|
1153
|
+
}
|
|
1154
|
+
var Ze = yt(function(n, e, t, o) {
|
|
1155
|
+
if (e.scroll) {
|
|
1156
|
+
var i = (n.touches ? n.touches[0] : n).clientX, r = (n.touches ? n.touches[0] : n).clientY, a = e.scrollSensitivity, l = e.scrollSpeed, s = W(), u = !1, c;
|
|
1157
|
+
et !== t && (et = t, Me(), ve = e.scroll, c = e.scrollFn, ve === !0 && (ve = J(t, !0)));
|
|
1158
|
+
var f = 0, m = ve;
|
|
1159
|
+
do {
|
|
1160
|
+
var w = m, v = I(w), E = v.top, R = v.bottom, U = v.left, x = v.right, B = v.width, G = v.height, L = void 0, te = void 0, he = w.scrollWidth, le = w.scrollHeight, N = h(w), q = w.scrollLeft, Te = w.scrollTop;
|
|
1161
|
+
w === s ? (L = B < he && (N.overflowX === "auto" || N.overflowX === "scroll" || N.overflowX === "visible"), te = G < le && (N.overflowY === "auto" || N.overflowY === "scroll" || N.overflowY === "visible")) : (L = B < he && (N.overflowX === "auto" || N.overflowX === "scroll"), te = G < le && (N.overflowY === "auto" || N.overflowY === "scroll"));
|
|
1162
|
+
var z = L && (Math.abs(x - i) <= a && q + B < he) - (Math.abs(U - i) <= a && !!q), se = te && (Math.abs(R - r) <= a && Te + G < le) - (Math.abs(E - r) <= a && !!Te);
|
|
1163
|
+
if (!T[f])
|
|
1164
|
+
for (var ne = 0; ne <= f; ne++)
|
|
1165
|
+
T[ne] || (T[ne] = {});
|
|
1166
|
+
(T[f].vx != z || T[f].vy != se || T[f].el !== w) && (T[f].el = w, T[f].vx = z, T[f].vy = se, clearInterval(T[f].pid), (z != 0 || se != 0) && (u = !0, T[f].pid = setInterval((function() {
|
|
1167
|
+
o && this.layer === 0 && p.active._onTouchMove(Be);
|
|
1168
|
+
var Z = T[this.layer].vy ? T[this.layer].vy * l : 0, oe = T[this.layer].vx ? T[this.layer].vx * l : 0;
|
|
1169
|
+
typeof c == "function" && c.call(p.dragged.parentNode[k], oe, Z, n, Be, T[this.layer].el) !== "continue" || Et(T[this.layer].el, oe, Z);
|
|
1170
|
+
}).bind({
|
|
1171
|
+
layer: f
|
|
1172
|
+
}), 24))), f++;
|
|
1173
|
+
} while (e.bubbleScroll && m !== s && (m = J(m, !1)));
|
|
1174
|
+
tt = u;
|
|
1175
|
+
}
|
|
1176
|
+
}, 30), It = function(e) {
|
|
1177
|
+
var t = e.originalEvent, o = e.putSortable, i = e.dragEl, r = e.activeSortable, a = e.dispatchSortableEvent, l = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
1178
|
+
if (t) {
|
|
1179
|
+
var u = o || r;
|
|
1180
|
+
l();
|
|
1181
|
+
var c = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, f = document.elementFromPoint(c.clientX, c.clientY);
|
|
1182
|
+
s(), u && !u.el.contains(f) && (a("spill"), this.onSpill({
|
|
1183
|
+
dragEl: i,
|
|
1184
|
+
putSortable: o
|
|
1185
|
+
}));
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
function ot() {
|
|
1189
|
+
}
|
|
1190
|
+
ot.prototype = {
|
|
1191
|
+
startIndex: null,
|
|
1192
|
+
dragStart: function(e) {
|
|
1193
|
+
var t = e.oldDraggableIndex;
|
|
1194
|
+
this.startIndex = t;
|
|
1195
|
+
},
|
|
1196
|
+
onSpill: function(e) {
|
|
1197
|
+
var t = e.dragEl, o = e.putSortable;
|
|
1198
|
+
this.sortable.captureAnimationState(), o && o.captureAnimationState();
|
|
1199
|
+
var i = ke(this.sortable.el, this.startIndex, this.options);
|
|
1200
|
+
i ? this.sortable.el.insertBefore(t, i) : this.sortable.el.appendChild(t), this.sortable.animateAll(), o && o.animateAll();
|
|
1201
|
+
},
|
|
1202
|
+
drop: It
|
|
1203
|
+
};
|
|
1204
|
+
j(ot, {
|
|
1205
|
+
pluginName: "revertOnSpill"
|
|
1206
|
+
});
|
|
1207
|
+
function it() {
|
|
1208
|
+
}
|
|
1209
|
+
it.prototype = {
|
|
1210
|
+
onSpill: function(e) {
|
|
1211
|
+
var t = e.dragEl, o = e.putSortable, i = o || this.sortable;
|
|
1212
|
+
i.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), i.animateAll();
|
|
1213
|
+
},
|
|
1214
|
+
drop: It
|
|
1215
|
+
};
|
|
1216
|
+
j(it, {
|
|
1217
|
+
pluginName: "removeOnSpill"
|
|
1218
|
+
});
|
|
1219
|
+
p.mount(new yn());
|
|
1220
|
+
p.mount(it, ot);
|
|
1221
|
+
function En(n, e, t = {}) {
|
|
1222
|
+
let o;
|
|
1223
|
+
const { document: i = Mt, ...r } = t, a = {
|
|
1224
|
+
onUpdate: (c) => {
|
|
1225
|
+
wn(e, c.oldIndex, c.newIndex);
|
|
1226
|
+
}
|
|
1227
|
+
}, l = () => {
|
|
1228
|
+
const c = typeof n == "string" ? i == null ? void 0 : i.querySelector(n) : xt(n);
|
|
1229
|
+
!c || o !== void 0 || (o = new p(c, { ...a, ...r }));
|
|
1230
|
+
}, s = () => {
|
|
1231
|
+
o == null || o.destroy(), o = void 0;
|
|
1232
|
+
}, u = (c, f) => {
|
|
1233
|
+
if (f !== void 0)
|
|
1234
|
+
o == null || o.option(c, f);
|
|
1235
|
+
else
|
|
1236
|
+
return o == null ? void 0 : o.option(c);
|
|
1237
|
+
};
|
|
1238
|
+
return Pt(l), Nt(s), {
|
|
1239
|
+
stop: s,
|
|
1240
|
+
start: l,
|
|
1241
|
+
option: u
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
function wn(n, e, t) {
|
|
1245
|
+
const o = Ft(n), i = o ? [...at(n)] : at(n);
|
|
1246
|
+
if (t >= 0 && t < i.length) {
|
|
1247
|
+
const r = i.splice(e, 1)[0];
|
|
1248
|
+
kt(() => {
|
|
1249
|
+
i.splice(t, 0, r), o && (n.value = i);
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
function Dn(n, e, t) {
|
|
1254
|
+
const o = n.slice(), i = o.splice(e, 1)[0];
|
|
1255
|
+
return o.splice(t, 0, i), o;
|
|
1256
|
+
}
|
|
1257
|
+
const Tn = /* @__PURE__ */ Xt({
|
|
1258
|
+
__name: "Sortable",
|
|
1259
|
+
props: {
|
|
1260
|
+
tag: { default: "div" },
|
|
1261
|
+
itemKey: { default: "id" },
|
|
1262
|
+
modelValue: { default: null },
|
|
1263
|
+
list: { default: () => [] },
|
|
1264
|
+
options: { default: null },
|
|
1265
|
+
clone: { type: Function, default: (n) => n }
|
|
1266
|
+
},
|
|
1267
|
+
emits: ["update:modelValue"],
|
|
1268
|
+
setup(n, { emit: e }) {
|
|
1269
|
+
const t = e, o = Rt(() => n.modelValue || n.list), i = Yt("container");
|
|
1270
|
+
return En(i, o, {
|
|
1271
|
+
animation: 250,
|
|
1272
|
+
onChoose(r) {
|
|
1273
|
+
const { item: a } = r, l = r.oldIndex;
|
|
1274
|
+
a._data = n.clone(o.value[l]);
|
|
1275
|
+
},
|
|
1276
|
+
...n.modelValue && {
|
|
1277
|
+
onUpdate(r) {
|
|
1278
|
+
const { oldIndex: a, newIndex: l } = r, s = Dn(n.modelValue, a, l);
|
|
1279
|
+
t("update:modelValue", s);
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
...n.options
|
|
1283
|
+
}), (r, a) => (lt(), Bt(jt(r.tag), {
|
|
1284
|
+
ref_key: "container",
|
|
1285
|
+
ref: i,
|
|
1286
|
+
class: zt(r.$props.class),
|
|
1287
|
+
style: Vt(r.$props.style)
|
|
1288
|
+
}, {
|
|
1289
|
+
default: Lt(() => [
|
|
1290
|
+
(lt(!0), Ht(Gt, null, Wt(o.value, (l, s) => $t(r.$slots, "item", {
|
|
1291
|
+
key: l[r.itemKey] || s,
|
|
1292
|
+
item: l,
|
|
1293
|
+
index: s
|
|
1294
|
+
})), 128))
|
|
1295
|
+
]),
|
|
1296
|
+
_: 3
|
|
1297
|
+
}, 8, ["class", "style"]));
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
export {
|
|
1301
|
+
Tn as _,
|
|
1302
|
+
Dn as m
|
|
1303
|
+
};
|