@platforma-sdk/ui-vue 1.37.4 → 1.37.10
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/.turbo/turbo-build.log +868 -868
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts +0 -6
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js +12 -14
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/data.d.ts +0 -1
- package/dist/components/PlMultiSequenceAlignment/data.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/data.js +115 -116
- package/dist/components/PlMultiSequenceAlignment/data.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/DataTable/BaseCellComponent.vue.js +2 -2
- package/dist/lib/ui/uikit/dist/components/DataTable/TdCell.vue.js +2 -2
- package/dist/lib/ui/uikit/dist/components/DataTable/composition/useResize.js +2 -2
- package/dist/lib/ui/uikit/dist/components/DataTable/composition/useTableColumns.js +6 -6
- package/dist/lib/ui/uikit/dist/components/DataTable/state.js +12 -12
- package/dist/lib/ui/uikit/dist/components/PlAutocomplete/PlAutocomplete.vue.js +12 -12
- package/dist/lib/ui/uikit/dist/components/PlBtnSplit/PlBtnSplit.vue.js +10 -10
- package/dist/lib/ui/uikit/dist/components/PlBtnSplit/PlBtnSplit.vue.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue.js +10 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue2.js +239 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue2.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementList.vue3.js +22 -0
- package/dist/{components → lib/ui/uikit/dist/components}/PlElementList/PlElementList.vue3.js.map +1 -1
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue.js +10 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue2.js +106 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue3.js +48 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/PlElementListItem.vue3.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/utils.js +17 -0
- package/dist/lib/ui/uikit/dist/components/PlElementList/utils.js.map +1 -0
- package/dist/lib/ui/uikit/dist/components/PlErrorBoundary/PlErrorBoundary.vue.js +5 -5
- package/dist/lib/ui/uikit/dist/components/PlFileDialog/PlFileDialog.vue.js +14 -14
- package/dist/lib/ui/uikit/dist/components/PlFileDialog/Remote.vue.js +8 -8
- package/dist/lib/ui/uikit/dist/components/PlFileDialog/utils.js +9 -9
- package/dist/lib/ui/uikit/dist/components/PlLogView/PlLogView.vue.js +9 -9
- package/dist/lib/ui/uikit/dist/composition/useFormState.js +5 -5
- package/dist/lib/ui/uikit/dist/composition/useQuery.js +12 -12
- package/dist/lib/ui/uikit/dist/composition/useWatchFetch.js +4 -4
- package/dist/lib/ui/uikit/dist/index.js +81 -78
- package/dist/lib/ui/uikit/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/lib/util/helpers/dist/index.js +156 -127
- package/dist/lib/ui/uikit/dist/lib/util/helpers/dist/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js +53 -43
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/core/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/integrations/useSortable.js +51 -0
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/integrations/useSortable.js.map +1 -0
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js +70 -62
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.13_typescript@5.6.3_/node_modules/@vueuse/shared/index.js.map +1 -1
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js +1262 -0
- package/dist/lib/ui/uikit/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js.map +1 -0
- package/dist/lib/ui/uikit/dist/utils/DropdownOverlay/DropdownOverlay.vue.js +2 -2
- package/dist/lib/util/helpers/dist/index.js +43 -85
- package/dist/lib/util/helpers/dist/index.js.map +1 -1
- package/dist/lib.d.ts +0 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +105 -105
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/core/index.js +30 -31
- package/dist/node_modules/.pnpm/@vueuse_core@13.3.0_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/core/index.js.map +1 -1
- package/dist/sdk/model/dist/index.js +39 -32
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue +0 -7
- package/src/components/PlMultiSequenceAlignment/data.ts +2 -6
- package/src/lib.ts +0 -2
- package/dist/components/PlElementList/PlElementList.vue.d.ts +0 -61
- package/dist/components/PlElementList/PlElementList.vue.d.ts.map +0 -1
- package/dist/components/PlElementList/PlElementList.vue.js +0 -10
- package/dist/components/PlElementList/PlElementList.vue2.js +0 -214
- package/dist/components/PlElementList/PlElementList.vue2.js.map +0 -1
- package/dist/components/PlElementList/PlElementList.vue3.js +0 -13
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts +0 -55
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts.map +0 -1
- package/dist/components/PlElementList/PlElementListItem.vue.js +0 -10
- package/dist/components/PlElementList/PlElementListItem.vue2.js +0 -103
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +0 -1
- package/dist/components/PlElementList/PlElementListItem.vue3.js +0 -37
- package/dist/components/PlElementList/PlElementListItem.vue3.js.map +0 -1
- package/dist/components/PlElementList/index.d.ts +0 -2
- package/dist/components/PlElementList/index.d.ts.map +0 -1
- package/dist/components/PlElementList/utils.d.ts +0 -3
- package/dist/components/PlElementList/utils.d.ts.map +0 -1
- package/dist/components/PlElementList/utils.js +0 -17
- package/dist/components/PlElementList/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/integrations/useSortable.js +0 -51
- package/dist/node_modules/.pnpm/@vueuse_integrations@13.3.0_axios@1.8.1_focus-trap@7.6.0_sortablejs@1.15.6_vue@3.5.13_typescript@5.5.4_/node_modules/@vueuse/integrations/useSortable.js.map +0 -1
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js +0 -1262
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js.map +0 -1
- package/src/components/PlElementList/PlElementList.vue +0 -287
- package/src/components/PlElementList/PlElementListItem.vue +0 -222
- package/src/components/PlElementList/README.md +0 -123
- package/src/components/PlElementList/index.ts +0 -1
- package/src/components/PlElementList/utils.ts +0 -17
- /package/dist/{components → lib/ui/uikit/dist/components}/PlElementList/PlElementList.vue.js.map +0 -0
- /package/dist/{components → lib/ui/uikit/dist/components}/PlElementList/PlElementListItem.vue.js.map +0 -0
|
@@ -0,0 +1,1262 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Sortable 1.15.6
|
|
3
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
4
|
+
* @author owenm <owen23355@gmail.com>
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
function lt(e, n) {
|
|
8
|
+
var t = Object.keys(e);
|
|
9
|
+
if (Object.getOwnPropertySymbols) {
|
|
10
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
11
|
+
n && (o = o.filter(function(r) {
|
|
12
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
13
|
+
})), t.push.apply(t, o);
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
}
|
|
17
|
+
function W(e) {
|
|
18
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
19
|
+
var t = arguments[n] != null ? arguments[n] : {};
|
|
20
|
+
n % 2 ? lt(Object(t), !0).forEach(function(o) {
|
|
21
|
+
It(e, o, t[o]);
|
|
22
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : lt(Object(t)).forEach(function(o) {
|
|
23
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return e;
|
|
27
|
+
}
|
|
28
|
+
function Ie(e) {
|
|
29
|
+
"@babel/helpers - typeof";
|
|
30
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ie = function(n) {
|
|
31
|
+
return typeof n;
|
|
32
|
+
} : Ie = function(n) {
|
|
33
|
+
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
34
|
+
}, Ie(e);
|
|
35
|
+
}
|
|
36
|
+
function It(e, n, t) {
|
|
37
|
+
return n in e ? Object.defineProperty(e, n, {
|
|
38
|
+
value: t,
|
|
39
|
+
enumerable: !0,
|
|
40
|
+
configurable: !0,
|
|
41
|
+
writable: !0
|
|
42
|
+
}) : e[n] = t, e;
|
|
43
|
+
}
|
|
44
|
+
function q() {
|
|
45
|
+
return q = Object.assign || function(e) {
|
|
46
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
47
|
+
var t = arguments[n];
|
|
48
|
+
for (var o in t)
|
|
49
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
50
|
+
}
|
|
51
|
+
return e;
|
|
52
|
+
}, q.apply(this, arguments);
|
|
53
|
+
}
|
|
54
|
+
function Mt(e, n) {
|
|
55
|
+
if (e == null) return {};
|
|
56
|
+
var t = {}, o = Object.keys(e), r, i;
|
|
57
|
+
for (i = 0; i < o.length; i++)
|
|
58
|
+
r = o[i], !(n.indexOf(r) >= 0) && (t[r] = e[r]);
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
function kt(e, n) {
|
|
62
|
+
if (e == null) return {};
|
|
63
|
+
var t = Mt(e, n), o, r;
|
|
64
|
+
if (Object.getOwnPropertySymbols) {
|
|
65
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
66
|
+
for (r = 0; r < i.length; r++)
|
|
67
|
+
o = i[r], !(n.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
|
|
68
|
+
}
|
|
69
|
+
return t;
|
|
70
|
+
}
|
|
71
|
+
var Xt = "1.15.6";
|
|
72
|
+
function V(e) {
|
|
73
|
+
if (typeof window < "u" && window.navigator)
|
|
74
|
+
return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
75
|
+
}
|
|
76
|
+
var Q = V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Te = V(/Edge/i), st = V(/firefox/i), we = V(/safari/i) && !V(/chrome/i) && !V(/android/i), nt = V(/iP(ad|od|hone)/i), vt = V(/chrome/i) && V(/android/i), mt = {
|
|
77
|
+
capture: !1,
|
|
78
|
+
passive: !1
|
|
79
|
+
};
|
|
80
|
+
function b(e, n, t) {
|
|
81
|
+
e.addEventListener(n, t, !Q && mt);
|
|
82
|
+
}
|
|
83
|
+
function m(e, n, t) {
|
|
84
|
+
e.removeEventListener(n, t, !Q && mt);
|
|
85
|
+
}
|
|
86
|
+
function Re(e, n) {
|
|
87
|
+
if (n) {
|
|
88
|
+
if (n[0] === ">" && (n = n.substring(1)), e)
|
|
89
|
+
try {
|
|
90
|
+
if (e.matches)
|
|
91
|
+
return e.matches(n);
|
|
92
|
+
if (e.msMatchesSelector)
|
|
93
|
+
return e.msMatchesSelector(n);
|
|
94
|
+
if (e.webkitMatchesSelector)
|
|
95
|
+
return e.webkitMatchesSelector(n);
|
|
96
|
+
} catch {
|
|
97
|
+
return !1;
|
|
98
|
+
}
|
|
99
|
+
return !1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function bt(e) {
|
|
103
|
+
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
104
|
+
}
|
|
105
|
+
function j(e, n, t, o) {
|
|
106
|
+
if (e) {
|
|
107
|
+
t = t || document;
|
|
108
|
+
do {
|
|
109
|
+
if (n != null && (n[0] === ">" ? e.parentNode === t && Re(e, n) : Re(e, n)) || o && e === t)
|
|
110
|
+
return e;
|
|
111
|
+
if (e === t) break;
|
|
112
|
+
} while (e = bt(e));
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
var ut = /\s+/g;
|
|
117
|
+
function X(e, n, t) {
|
|
118
|
+
if (e && n)
|
|
119
|
+
if (e.classList)
|
|
120
|
+
e.classList[t ? "add" : "remove"](n);
|
|
121
|
+
else {
|
|
122
|
+
var o = (" " + e.className + " ").replace(ut, " ").replace(" " + n + " ", " ");
|
|
123
|
+
e.className = (o + (t ? " " + n : "")).replace(ut, " ");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function h(e, n, t) {
|
|
127
|
+
var o = e && e.style;
|
|
128
|
+
if (o) {
|
|
129
|
+
if (t === void 0)
|
|
130
|
+
return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (t = e.currentStyle), n === void 0 ? t : t[n];
|
|
131
|
+
!(n in o) && n.indexOf("webkit") === -1 && (n = "-webkit-" + n), o[n] = t + (typeof t == "string" ? "" : "px");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function he(e, n) {
|
|
135
|
+
var t = "";
|
|
136
|
+
if (typeof e == "string")
|
|
137
|
+
t = e;
|
|
138
|
+
else
|
|
139
|
+
do {
|
|
140
|
+
var o = h(e, "transform");
|
|
141
|
+
o && o !== "none" && (t = o + " " + t);
|
|
142
|
+
} while (!n && (e = e.parentNode));
|
|
143
|
+
var r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
144
|
+
return r && new r(t);
|
|
145
|
+
}
|
|
146
|
+
function yt(e, n, t) {
|
|
147
|
+
if (e) {
|
|
148
|
+
var o = e.getElementsByTagName(n), r = 0, i = o.length;
|
|
149
|
+
if (t)
|
|
150
|
+
for (; r < i; r++)
|
|
151
|
+
t(o[r], r);
|
|
152
|
+
return o;
|
|
153
|
+
}
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
function L() {
|
|
157
|
+
var e = document.scrollingElement;
|
|
158
|
+
return e || document.documentElement;
|
|
159
|
+
}
|
|
160
|
+
function T(e, n, t, o, r) {
|
|
161
|
+
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
162
|
+
var i, a, u, l, c, d, f;
|
|
163
|
+
if (e !== window && e.parentNode && e !== L() ? (i = e.getBoundingClientRect(), a = i.top, u = i.left, l = i.bottom, c = i.right, d = i.height, f = i.width) : (a = 0, u = 0, l = window.innerHeight, c = window.innerWidth, d = window.innerHeight, f = window.innerWidth), (n || t) && e !== window && (r = r || e.parentNode, !Q))
|
|
164
|
+
do
|
|
165
|
+
if (r && r.getBoundingClientRect && (h(r, "transform") !== "none" || t && h(r, "position") !== "static")) {
|
|
166
|
+
var w = r.getBoundingClientRect();
|
|
167
|
+
a -= w.top + parseInt(h(r, "border-top-width")), u -= w.left + parseInt(h(r, "border-left-width")), l = a + i.height, c = u + i.width;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
while (r = r.parentNode);
|
|
171
|
+
if (o && e !== window) {
|
|
172
|
+
var v = he(r || e), C = v && v.a, y = v && v.d;
|
|
173
|
+
v && (a /= y, u /= C, f /= C, d /= y, l = a + d, c = u + f);
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
top: a,
|
|
177
|
+
left: u,
|
|
178
|
+
bottom: l,
|
|
179
|
+
right: c,
|
|
180
|
+
width: f,
|
|
181
|
+
height: d
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function ct(e, n, t) {
|
|
186
|
+
for (var o = $(e, !0), r = T(e)[n]; o; ) {
|
|
187
|
+
var i = T(o)[t], a = void 0;
|
|
188
|
+
if (a = r >= i, !a) return o;
|
|
189
|
+
if (o === L()) break;
|
|
190
|
+
o = $(o, !1);
|
|
191
|
+
}
|
|
192
|
+
return !1;
|
|
193
|
+
}
|
|
194
|
+
function pe(e, n, t, o) {
|
|
195
|
+
for (var r = 0, i = 0, a = e.children; i < a.length; ) {
|
|
196
|
+
if (a[i].style.display !== "none" && a[i] !== p.ghost && (o || a[i] !== p.dragged) && j(a[i], t.draggable, e, !1)) {
|
|
197
|
+
if (r === n)
|
|
198
|
+
return a[i];
|
|
199
|
+
r++;
|
|
200
|
+
}
|
|
201
|
+
i++;
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
function ot(e, n) {
|
|
206
|
+
for (var t = e.lastElementChild; t && (t === p.ghost || h(t, "display") === "none" || n && !Re(t, n)); )
|
|
207
|
+
t = t.previousElementSibling;
|
|
208
|
+
return t || null;
|
|
209
|
+
}
|
|
210
|
+
function R(e, n) {
|
|
211
|
+
var t = 0;
|
|
212
|
+
if (!e || !e.parentNode)
|
|
213
|
+
return -1;
|
|
214
|
+
for (; e = e.previousElementSibling; )
|
|
215
|
+
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== p.clone && (!n || Re(e, n)) && t++;
|
|
216
|
+
return t;
|
|
217
|
+
}
|
|
218
|
+
function dt(e) {
|
|
219
|
+
var n = 0, t = 0, o = L();
|
|
220
|
+
if (e)
|
|
221
|
+
do {
|
|
222
|
+
var r = he(e), i = r.a, a = r.d;
|
|
223
|
+
n += e.scrollLeft * i, t += e.scrollTop * a;
|
|
224
|
+
} while (e !== o && (e = e.parentNode));
|
|
225
|
+
return [n, t];
|
|
226
|
+
}
|
|
227
|
+
function Yt(e, n) {
|
|
228
|
+
for (var t in e)
|
|
229
|
+
if (e.hasOwnProperty(t)) {
|
|
230
|
+
for (var o in n)
|
|
231
|
+
if (n.hasOwnProperty(o) && n[o] === e[t][o]) return Number(t);
|
|
232
|
+
}
|
|
233
|
+
return -1;
|
|
234
|
+
}
|
|
235
|
+
function $(e, n) {
|
|
236
|
+
if (!e || !e.getBoundingClientRect) return L();
|
|
237
|
+
var t = e, o = !1;
|
|
238
|
+
do
|
|
239
|
+
if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
|
|
240
|
+
var r = h(t);
|
|
241
|
+
if (t.clientWidth < t.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
|
|
242
|
+
if (!t.getBoundingClientRect || t === document.body) return L();
|
|
243
|
+
if (o || n) return t;
|
|
244
|
+
o = !0;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
while (t = t.parentNode);
|
|
248
|
+
return L();
|
|
249
|
+
}
|
|
250
|
+
function Rt(e, n) {
|
|
251
|
+
if (e && n)
|
|
252
|
+
for (var t in n)
|
|
253
|
+
n.hasOwnProperty(t) && (e[t] = n[t]);
|
|
254
|
+
return e;
|
|
255
|
+
}
|
|
256
|
+
function Fe(e, n) {
|
|
257
|
+
return Math.round(e.top) === Math.round(n.top) && Math.round(e.left) === Math.round(n.left) && Math.round(e.height) === Math.round(n.height) && Math.round(e.width) === Math.round(n.width);
|
|
258
|
+
}
|
|
259
|
+
var De;
|
|
260
|
+
function wt(e, n) {
|
|
261
|
+
return function() {
|
|
262
|
+
if (!De) {
|
|
263
|
+
var t = arguments, o = this;
|
|
264
|
+
t.length === 1 ? e.call(o, t[0]) : e.apply(o, t), De = setTimeout(function() {
|
|
265
|
+
De = void 0;
|
|
266
|
+
}, n);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function Bt() {
|
|
271
|
+
clearTimeout(De), De = void 0;
|
|
272
|
+
}
|
|
273
|
+
function Dt(e, n, t) {
|
|
274
|
+
e.scrollLeft += n, e.scrollTop += t;
|
|
275
|
+
}
|
|
276
|
+
function Et(e) {
|
|
277
|
+
var n = window.Polymer, t = window.jQuery || window.Zepto;
|
|
278
|
+
return n && n.dom ? n.dom(e).cloneNode(!0) : t ? t(e).clone(!0)[0] : e.cloneNode(!0);
|
|
279
|
+
}
|
|
280
|
+
function _t(e, n, t) {
|
|
281
|
+
var o = {};
|
|
282
|
+
return Array.from(e.children).forEach(function(r) {
|
|
283
|
+
var i, a, u, l;
|
|
284
|
+
if (!(!j(r, n.draggable, e, !1) || r.animated || r === t)) {
|
|
285
|
+
var c = T(r);
|
|
286
|
+
o.left = Math.min((i = o.left) !== null && i !== void 0 ? i : 1 / 0, c.left), o.top = Math.min((a = o.top) !== null && a !== void 0 ? a : 1 / 0, c.top), o.right = Math.max((u = o.right) !== null && u !== void 0 ? u : -1 / 0, c.right), o.bottom = Math.max((l = o.bottom) !== null && l !== void 0 ? l : -1 / 0, c.bottom);
|
|
287
|
+
}
|
|
288
|
+
}), o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
|
|
289
|
+
}
|
|
290
|
+
var M = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
291
|
+
function jt() {
|
|
292
|
+
var e = [], n;
|
|
293
|
+
return {
|
|
294
|
+
captureAnimationState: function() {
|
|
295
|
+
if (e = [], !!this.options.animation) {
|
|
296
|
+
var t = [].slice.call(this.el.children);
|
|
297
|
+
t.forEach(function(o) {
|
|
298
|
+
if (!(h(o, "display") === "none" || o === p.ghost)) {
|
|
299
|
+
e.push({
|
|
300
|
+
target: o,
|
|
301
|
+
rect: T(o)
|
|
302
|
+
});
|
|
303
|
+
var r = W({}, e[e.length - 1].rect);
|
|
304
|
+
if (o.thisAnimationDuration) {
|
|
305
|
+
var i = he(o, !0);
|
|
306
|
+
i && (r.top -= i.f, r.left -= i.e);
|
|
307
|
+
}
|
|
308
|
+
o.fromRect = r;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
addAnimationState: function(t) {
|
|
314
|
+
e.push(t);
|
|
315
|
+
},
|
|
316
|
+
removeAnimationState: function(t) {
|
|
317
|
+
e.splice(Yt(e, {
|
|
318
|
+
target: t
|
|
319
|
+
}), 1);
|
|
320
|
+
},
|
|
321
|
+
animateAll: function(t) {
|
|
322
|
+
var o = this;
|
|
323
|
+
if (!this.options.animation) {
|
|
324
|
+
clearTimeout(n), typeof t == "function" && t();
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
var r = !1, i = 0;
|
|
328
|
+
e.forEach(function(a) {
|
|
329
|
+
var u = 0, l = a.target, c = l.fromRect, d = T(l), f = l.prevFromRect, w = l.prevToRect, v = a.rect, C = he(l, !0);
|
|
330
|
+
C && (d.top -= C.f, d.left -= C.e), l.toRect = d, l.thisAnimationDuration && Fe(f, d) && !Fe(c, d) && // Make sure animatingRect is on line between toRect & fromRect
|
|
331
|
+
(v.top - d.top) / (v.left - d.left) === (c.top - d.top) / (c.left - d.left) && (u = Lt(v, f, w, o.options)), Fe(d, c) || (l.prevFromRect = c, l.prevToRect = d, u || (u = o.options.animation), o.animate(l, v, d, u)), u && (r = !0, i = Math.max(i, u), clearTimeout(l.animationResetTimer), l.animationResetTimer = setTimeout(function() {
|
|
332
|
+
l.animationTime = 0, l.prevFromRect = null, l.fromRect = null, l.prevToRect = null, l.thisAnimationDuration = null;
|
|
333
|
+
}, u), l.thisAnimationDuration = u);
|
|
334
|
+
}), clearTimeout(n), r ? n = setTimeout(function() {
|
|
335
|
+
typeof t == "function" && t();
|
|
336
|
+
}, i) : typeof t == "function" && t(), e = [];
|
|
337
|
+
},
|
|
338
|
+
animate: function(t, o, r, i) {
|
|
339
|
+
if (i) {
|
|
340
|
+
h(t, "transition", ""), h(t, "transform", "");
|
|
341
|
+
var a = he(this.el), u = a && a.a, l = a && a.d, c = (o.left - r.left) / (u || 1), d = (o.top - r.top) / (l || 1);
|
|
342
|
+
t.animatingX = !!c, t.animatingY = !!d, h(t, "transform", "translate3d(" + c + "px," + d + "px,0)"), this.forRepaintDummy = Ht(t), h(t, "transition", "transform " + i + "ms" + (this.options.easing ? " " + this.options.easing : "")), h(t, "transform", "translate3d(0,0,0)"), typeof t.animated == "number" && clearTimeout(t.animated), t.animated = setTimeout(function() {
|
|
343
|
+
h(t, "transition", ""), h(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1;
|
|
344
|
+
}, i);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function Ht(e) {
|
|
350
|
+
return e.offsetWidth;
|
|
351
|
+
}
|
|
352
|
+
function Lt(e, n, t, o) {
|
|
353
|
+
return Math.sqrt(Math.pow(n.top - e.top, 2) + Math.pow(n.left - e.left, 2)) / Math.sqrt(Math.pow(n.top - t.top, 2) + Math.pow(n.left - t.left, 2)) * o.animation;
|
|
354
|
+
}
|
|
355
|
+
var ue = [], ze = {
|
|
356
|
+
initializeByDefault: !0
|
|
357
|
+
}, Ce = {
|
|
358
|
+
mount: function(e) {
|
|
359
|
+
for (var n in ze)
|
|
360
|
+
ze.hasOwnProperty(n) && !(n in e) && (e[n] = ze[n]);
|
|
361
|
+
ue.forEach(function(t) {
|
|
362
|
+
if (t.pluginName === e.pluginName)
|
|
363
|
+
throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
|
|
364
|
+
}), ue.push(e);
|
|
365
|
+
},
|
|
366
|
+
pluginEvent: function(e, n, t) {
|
|
367
|
+
var o = this;
|
|
368
|
+
this.eventCanceled = !1, t.cancel = function() {
|
|
369
|
+
o.eventCanceled = !0;
|
|
370
|
+
};
|
|
371
|
+
var r = e + "Global";
|
|
372
|
+
ue.forEach(function(i) {
|
|
373
|
+
n[i.pluginName] && (n[i.pluginName][r] && n[i.pluginName][r](W({
|
|
374
|
+
sortable: n
|
|
375
|
+
}, t)), n.options[i.pluginName] && n[i.pluginName][e] && n[i.pluginName][e](W({
|
|
376
|
+
sortable: n
|
|
377
|
+
}, t)));
|
|
378
|
+
});
|
|
379
|
+
},
|
|
380
|
+
initializePlugins: function(e, n, t, o) {
|
|
381
|
+
ue.forEach(function(a) {
|
|
382
|
+
var u = a.pluginName;
|
|
383
|
+
if (!(!e.options[u] && !a.initializeByDefault)) {
|
|
384
|
+
var l = new a(e, n, e.options);
|
|
385
|
+
l.sortable = e, l.options = e.options, e[u] = l, q(t, l.defaults);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
for (var r in e.options)
|
|
389
|
+
if (e.options.hasOwnProperty(r)) {
|
|
390
|
+
var i = this.modifyOption(e, r, e.options[r]);
|
|
391
|
+
typeof i < "u" && (e.options[r] = i);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
getEventProperties: function(e, n) {
|
|
395
|
+
var t = {};
|
|
396
|
+
return ue.forEach(function(o) {
|
|
397
|
+
typeof o.eventProperties == "function" && q(t, o.eventProperties.call(n[o.pluginName], e));
|
|
398
|
+
}), t;
|
|
399
|
+
},
|
|
400
|
+
modifyOption: function(e, n, t) {
|
|
401
|
+
var o;
|
|
402
|
+
return ue.forEach(function(r) {
|
|
403
|
+
e[r.pluginName] && r.optionListeners && typeof r.optionListeners[n] == "function" && (o = r.optionListeners[n].call(e[r.pluginName], t));
|
|
404
|
+
}), o;
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
function Wt(e) {
|
|
408
|
+
var n = e.sortable, t = e.rootEl, o = e.name, r = e.targetEl, i = e.cloneEl, a = e.toEl, u = e.fromEl, l = e.oldIndex, c = e.newIndex, d = e.oldDraggableIndex, f = e.newDraggableIndex, w = e.originalEvent, v = e.putSortable, C = e.extraEventProperties;
|
|
409
|
+
if (n = n || t && t[M], !!n) {
|
|
410
|
+
var y, F = n.options, P = "on" + o.charAt(0).toUpperCase() + o.substr(1);
|
|
411
|
+
window.CustomEvent && !Q && !Te ? y = new CustomEvent(o, {
|
|
412
|
+
bubbles: !0,
|
|
413
|
+
cancelable: !0
|
|
414
|
+
}) : (y = document.createEvent("Event"), y.initEvent(o, !0, !0)), y.to = a || t, y.from = u || t, y.item = r || t, y.clone = i, y.oldIndex = l, y.newIndex = c, y.oldDraggableIndex = d, y.newDraggableIndex = f, y.originalEvent = w, y.pullMode = v ? v.lastPutMode : void 0;
|
|
415
|
+
var z = W(W({}, C), Ce.getEventProperties(o, n));
|
|
416
|
+
for (var O in z)
|
|
417
|
+
y[O] = z[O];
|
|
418
|
+
t && t.dispatchEvent(y), F[P] && F[P].call(n, y);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
var Ft = ["evt"], I = function(e, n) {
|
|
422
|
+
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = t.evt, r = kt(t, Ft);
|
|
423
|
+
Ce.pluginEvent.bind(p)(e, n, W({
|
|
424
|
+
dragEl: s,
|
|
425
|
+
parentEl: _,
|
|
426
|
+
ghostEl: g,
|
|
427
|
+
rootEl: D,
|
|
428
|
+
nextEl: ae,
|
|
429
|
+
lastDownEl: Me,
|
|
430
|
+
cloneEl: E,
|
|
431
|
+
cloneHidden: K,
|
|
432
|
+
dragStarted: me,
|
|
433
|
+
putSortable: x,
|
|
434
|
+
activeSortable: p.active,
|
|
435
|
+
originalEvent: o,
|
|
436
|
+
oldIndex: fe,
|
|
437
|
+
oldDraggableIndex: Ee,
|
|
438
|
+
newIndex: Y,
|
|
439
|
+
newDraggableIndex: Z,
|
|
440
|
+
hideGhostForTarget: xt,
|
|
441
|
+
unhideGhostForTarget: Ot,
|
|
442
|
+
cloneNowHidden: function() {
|
|
443
|
+
K = !0;
|
|
444
|
+
},
|
|
445
|
+
cloneNowShown: function() {
|
|
446
|
+
K = !1;
|
|
447
|
+
},
|
|
448
|
+
dispatchSortableEvent: function(i) {
|
|
449
|
+
A({
|
|
450
|
+
sortable: n,
|
|
451
|
+
name: i,
|
|
452
|
+
originalEvent: o
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}, r));
|
|
456
|
+
};
|
|
457
|
+
function A(e) {
|
|
458
|
+
Wt(W({
|
|
459
|
+
putSortable: x,
|
|
460
|
+
cloneEl: E,
|
|
461
|
+
targetEl: s,
|
|
462
|
+
rootEl: D,
|
|
463
|
+
oldIndex: fe,
|
|
464
|
+
oldDraggableIndex: Ee,
|
|
465
|
+
newIndex: Y,
|
|
466
|
+
newDraggableIndex: Z
|
|
467
|
+
}, e));
|
|
468
|
+
}
|
|
469
|
+
var s, _, g, D, ae, Me, E, K, fe, Y, Ee, Z, Oe, x, de = !1, Be = !1, je = [], re, B, Ue, Ve, ft, ht, me, ce, _e, Se = !1, Ne = !1, ke, N, qe = [], Ke = !1, He = [], We = typeof document < "u", Pe = nt, pt = Te || Q ? "cssFloat" : "float", zt = We && !vt && !nt && "draggable" in document.createElement("div"), St = function() {
|
|
470
|
+
if (We) {
|
|
471
|
+
if (Q)
|
|
472
|
+
return !1;
|
|
473
|
+
var e = document.createElement("x");
|
|
474
|
+
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
475
|
+
}
|
|
476
|
+
}(), Tt = function(e, n) {
|
|
477
|
+
var t = h(e), o = parseInt(t.width) - parseInt(t.paddingLeft) - parseInt(t.paddingRight) - parseInt(t.borderLeftWidth) - parseInt(t.borderRightWidth), r = pe(e, 0, n), i = pe(e, 1, n), a = r && h(r), u = i && h(i), l = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + T(r).width, c = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + T(i).width;
|
|
478
|
+
if (t.display === "flex")
|
|
479
|
+
return t.flexDirection === "column" || t.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
480
|
+
if (t.display === "grid")
|
|
481
|
+
return t.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
482
|
+
if (r && a.float && a.float !== "none") {
|
|
483
|
+
var d = a.float === "left" ? "left" : "right";
|
|
484
|
+
return i && (u.clear === "both" || u.clear === d) ? "vertical" : "horizontal";
|
|
485
|
+
}
|
|
486
|
+
return r && (a.display === "block" || a.display === "flex" || a.display === "table" || a.display === "grid" || l >= o && t[pt] === "none" || i && t[pt] === "none" && l + c > o) ? "vertical" : "horizontal";
|
|
487
|
+
}, Ut = function(e, n, t) {
|
|
488
|
+
var o = t ? e.left : e.top, r = t ? e.right : e.bottom, i = t ? e.width : e.height, a = t ? n.left : n.top, u = t ? n.right : n.bottom, l = t ? n.width : n.height;
|
|
489
|
+
return o === a || r === u || o + i / 2 === a + l / 2;
|
|
490
|
+
}, Vt = function(e, n) {
|
|
491
|
+
var t;
|
|
492
|
+
return je.some(function(o) {
|
|
493
|
+
var r = o[M].options.emptyInsertThreshold;
|
|
494
|
+
if (!(!r || ot(o))) {
|
|
495
|
+
var i = T(o), a = e >= i.left - r && e <= i.right + r, u = n >= i.top - r && n <= i.bottom + r;
|
|
496
|
+
if (a && u)
|
|
497
|
+
return t = o;
|
|
498
|
+
}
|
|
499
|
+
}), t;
|
|
500
|
+
}, Ct = function(e) {
|
|
501
|
+
function n(r, i) {
|
|
502
|
+
return function(a, u, l, c) {
|
|
503
|
+
var d = a.options.group.name && u.options.group.name && a.options.group.name === u.options.group.name;
|
|
504
|
+
if (r == null && (i || d))
|
|
505
|
+
return !0;
|
|
506
|
+
if (r == null || r === !1)
|
|
507
|
+
return !1;
|
|
508
|
+
if (i && r === "clone")
|
|
509
|
+
return r;
|
|
510
|
+
if (typeof r == "function")
|
|
511
|
+
return n(r(a, u, l, c), i)(a, u, l, c);
|
|
512
|
+
var f = (i ? a : u).options.group.name;
|
|
513
|
+
return r === !0 || typeof r == "string" && r === f || r.join && r.indexOf(f) > -1;
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
var t = {}, o = e.group;
|
|
517
|
+
(!o || Ie(o) != "object") && (o = {
|
|
518
|
+
name: o
|
|
519
|
+
}), t.name = o.name, t.checkPull = n(o.pull, !0), t.checkPut = n(o.put), t.revertClone = o.revertClone, e.group = t;
|
|
520
|
+
}, xt = function() {
|
|
521
|
+
!St && g && h(g, "display", "none");
|
|
522
|
+
}, Ot = function() {
|
|
523
|
+
!St && g && h(g, "display", "");
|
|
524
|
+
};
|
|
525
|
+
We && !vt && document.addEventListener("click", function(e) {
|
|
526
|
+
if (Be)
|
|
527
|
+
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Be = !1, !1;
|
|
528
|
+
}, !0);
|
|
529
|
+
var ie = function(e) {
|
|
530
|
+
if (s) {
|
|
531
|
+
e = e.touches ? e.touches[0] : e;
|
|
532
|
+
var n = Vt(e.clientX, e.clientY);
|
|
533
|
+
if (n) {
|
|
534
|
+
var t = {};
|
|
535
|
+
for (var o in e)
|
|
536
|
+
e.hasOwnProperty(o) && (t[o] = e[o]);
|
|
537
|
+
t.target = t.rootEl = n, t.preventDefault = void 0, t.stopPropagation = void 0, n[M]._onDragOver(t);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}, qt = function(e) {
|
|
541
|
+
s && s.parentNode[M]._isOutsideThisEl(e.target);
|
|
542
|
+
};
|
|
543
|
+
function p(e, n) {
|
|
544
|
+
if (!(e && e.nodeType && e.nodeType === 1))
|
|
545
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
|
|
546
|
+
this.el = e, this.options = n = q({}, n), e[M] = this;
|
|
547
|
+
var t = {
|
|
548
|
+
group: null,
|
|
549
|
+
sort: !0,
|
|
550
|
+
disabled: !1,
|
|
551
|
+
store: null,
|
|
552
|
+
handle: null,
|
|
553
|
+
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
554
|
+
swapThreshold: 1,
|
|
555
|
+
// percentage; 0 <= x <= 1
|
|
556
|
+
invertSwap: !1,
|
|
557
|
+
// invert always
|
|
558
|
+
invertedSwapThreshold: null,
|
|
559
|
+
// will be set to same as swapThreshold if default
|
|
560
|
+
removeCloneOnHide: !0,
|
|
561
|
+
direction: function() {
|
|
562
|
+
return Tt(e, this.options);
|
|
563
|
+
},
|
|
564
|
+
ghostClass: "sortable-ghost",
|
|
565
|
+
chosenClass: "sortable-chosen",
|
|
566
|
+
dragClass: "sortable-drag",
|
|
567
|
+
ignore: "a, img",
|
|
568
|
+
filter: null,
|
|
569
|
+
preventOnFilter: !0,
|
|
570
|
+
animation: 0,
|
|
571
|
+
easing: null,
|
|
572
|
+
setData: function(i, a) {
|
|
573
|
+
i.setData("Text", a.textContent);
|
|
574
|
+
},
|
|
575
|
+
dropBubble: !1,
|
|
576
|
+
dragoverBubble: !1,
|
|
577
|
+
dataIdAttr: "data-id",
|
|
578
|
+
delay: 0,
|
|
579
|
+
delayOnTouchOnly: !1,
|
|
580
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
581
|
+
forceFallback: !1,
|
|
582
|
+
fallbackClass: "sortable-fallback",
|
|
583
|
+
fallbackOnBody: !1,
|
|
584
|
+
fallbackTolerance: 0,
|
|
585
|
+
fallbackOffset: {
|
|
586
|
+
x: 0,
|
|
587
|
+
y: 0
|
|
588
|
+
},
|
|
589
|
+
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
590
|
+
supportPointer: p.supportPointer !== !1 && "PointerEvent" in window && (!we || nt),
|
|
591
|
+
emptyInsertThreshold: 5
|
|
592
|
+
};
|
|
593
|
+
Ce.initializePlugins(this, e, t);
|
|
594
|
+
for (var o in t)
|
|
595
|
+
!(o in n) && (n[o] = t[o]);
|
|
596
|
+
Ct(n);
|
|
597
|
+
for (var r in this)
|
|
598
|
+
r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
|
|
599
|
+
this.nativeDraggable = n.forceFallback ? !1 : zt, this.nativeDraggable && (this.options.touchStartThreshold = 1), n.supportPointer ? b(e, "pointerdown", this._onTapStart) : (b(e, "mousedown", this._onTapStart), b(e, "touchstart", this._onTapStart)), this.nativeDraggable && (b(e, "dragover", this), b(e, "dragenter", this)), je.push(this.el), n.store && n.store.get && this.sort(n.store.get(this) || []), q(this, jt());
|
|
600
|
+
}
|
|
601
|
+
p.prototype = /** @lends Sortable.prototype */
|
|
602
|
+
{
|
|
603
|
+
constructor: p,
|
|
604
|
+
_isOutsideThisEl: function(e) {
|
|
605
|
+
!this.el.contains(e) && e !== this.el && (ce = null);
|
|
606
|
+
},
|
|
607
|
+
_getDirection: function(e, n) {
|
|
608
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, n, s) : this.options.direction;
|
|
609
|
+
},
|
|
610
|
+
_onTapStart: function(e) {
|
|
611
|
+
if (e.cancelable) {
|
|
612
|
+
var n = this, t = this.el, o = this.options, r = o.preventOnFilter, i = e.type, a = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, u = (a || e).target, l = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || u, c = o.filter;
|
|
613
|
+
if (tn(t), !s && !(/mousedown|pointerdown/.test(i) && e.button !== 0 || o.disabled) && !l.isContentEditable && !(!this.nativeDraggable && we && u && u.tagName.toUpperCase() === "SELECT") && (u = j(u, o.draggable, t, !1), !(u && u.animated) && Me !== u)) {
|
|
614
|
+
if (fe = R(u), Ee = R(u, o.draggable), typeof c == "function") {
|
|
615
|
+
if (c.call(this, e, u, this)) {
|
|
616
|
+
A({
|
|
617
|
+
sortable: n,
|
|
618
|
+
rootEl: l,
|
|
619
|
+
name: "filter",
|
|
620
|
+
targetEl: u,
|
|
621
|
+
toEl: t,
|
|
622
|
+
fromEl: t
|
|
623
|
+
}), I("filter", n, {
|
|
624
|
+
evt: e
|
|
625
|
+
}), r && e.preventDefault();
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
} else if (c && (c = c.split(",").some(function(d) {
|
|
629
|
+
if (d = j(l, d.trim(), t, !1), d)
|
|
630
|
+
return A({
|
|
631
|
+
sortable: n,
|
|
632
|
+
rootEl: d,
|
|
633
|
+
name: "filter",
|
|
634
|
+
targetEl: u,
|
|
635
|
+
fromEl: t,
|
|
636
|
+
toEl: t
|
|
637
|
+
}), I("filter", n, {
|
|
638
|
+
evt: e
|
|
639
|
+
}), !0;
|
|
640
|
+
}), c)) {
|
|
641
|
+
r && e.preventDefault();
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
o.handle && !j(l, o.handle, t, !1) || this._prepareDragStart(e, a, u);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
_prepareDragStart: function(e, n, t) {
|
|
649
|
+
var o = this, r = o.el, i = o.options, a = r.ownerDocument, u;
|
|
650
|
+
if (t && !s && t.parentNode === r) {
|
|
651
|
+
var l = T(t);
|
|
652
|
+
if (D = r, s = t, _ = s.parentNode, ae = s.nextSibling, Me = t, Oe = i.group, p.dragged = s, re = {
|
|
653
|
+
target: s,
|
|
654
|
+
clientX: (n || e).clientX,
|
|
655
|
+
clientY: (n || e).clientY
|
|
656
|
+
}, ft = re.clientX - l.left, ht = re.clientY - l.top, this._lastX = (n || e).clientX, this._lastY = (n || e).clientY, s.style["will-change"] = "all", u = function() {
|
|
657
|
+
if (I("delayEnded", o, {
|
|
658
|
+
evt: e
|
|
659
|
+
}), p.eventCanceled) {
|
|
660
|
+
o._onDrop();
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
o._disableDelayedDragEvents(), !st && o.nativeDraggable && (s.draggable = !0), o._triggerDragStart(e, n), A({
|
|
664
|
+
sortable: o,
|
|
665
|
+
name: "choose",
|
|
666
|
+
originalEvent: e
|
|
667
|
+
}), X(s, i.chosenClass, !0);
|
|
668
|
+
}, i.ignore.split(",").forEach(function(c) {
|
|
669
|
+
yt(s, c.trim(), Qe);
|
|
670
|
+
}), b(a, "dragover", ie), b(a, "mousemove", ie), b(a, "touchmove", ie), i.supportPointer ? (b(a, "pointerup", o._onDrop), !this.nativeDraggable && b(a, "pointercancel", o._onDrop)) : (b(a, "mouseup", o._onDrop), b(a, "touchend", o._onDrop), b(a, "touchcancel", o._onDrop)), st && this.nativeDraggable && (this.options.touchStartThreshold = 4, s.draggable = !0), I("delayStart", this, {
|
|
671
|
+
evt: e
|
|
672
|
+
}), i.delay && (!i.delayOnTouchOnly || n) && (!this.nativeDraggable || !(Te || Q))) {
|
|
673
|
+
if (p.eventCanceled) {
|
|
674
|
+
this._onDrop();
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
i.supportPointer ? (b(a, "pointerup", o._disableDelayedDrag), b(a, "pointercancel", o._disableDelayedDrag)) : (b(a, "mouseup", o._disableDelayedDrag), b(a, "touchend", o._disableDelayedDrag), b(a, "touchcancel", o._disableDelayedDrag)), b(a, "mousemove", o._delayedDragTouchMoveHandler), b(a, "touchmove", o._delayedDragTouchMoveHandler), i.supportPointer && b(a, "pointermove", o._delayedDragTouchMoveHandler), o._dragStartTimer = setTimeout(u, i.delay);
|
|
678
|
+
} else
|
|
679
|
+
u();
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
_delayedDragTouchMoveHandler: function(e) {
|
|
683
|
+
var n = e.touches ? e.touches[0] : e;
|
|
684
|
+
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();
|
|
685
|
+
},
|
|
686
|
+
_disableDelayedDrag: function() {
|
|
687
|
+
s && Qe(s), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
688
|
+
},
|
|
689
|
+
_disableDelayedDragEvents: function() {
|
|
690
|
+
var e = this.el.ownerDocument;
|
|
691
|
+
m(e, "mouseup", this._disableDelayedDrag), m(e, "touchend", this._disableDelayedDrag), m(e, "touchcancel", this._disableDelayedDrag), m(e, "pointerup", this._disableDelayedDrag), m(e, "pointercancel", this._disableDelayedDrag), m(e, "mousemove", this._delayedDragTouchMoveHandler), m(e, "touchmove", this._delayedDragTouchMoveHandler), m(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
692
|
+
},
|
|
693
|
+
_triggerDragStart: function(e, n) {
|
|
694
|
+
n = n || e.pointerType == "touch" && e, !this.nativeDraggable || n ? this.options.supportPointer ? b(document, "pointermove", this._onTouchMove) : n ? b(document, "touchmove", this._onTouchMove) : b(document, "mousemove", this._onTouchMove) : (b(s, "dragend", this), b(D, "dragstart", this._onDragStart));
|
|
695
|
+
try {
|
|
696
|
+
document.selection ? Xe(function() {
|
|
697
|
+
document.selection.empty();
|
|
698
|
+
}) : window.getSelection().removeAllRanges();
|
|
699
|
+
} catch {
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
_dragStarted: function(e, n) {
|
|
703
|
+
if (de = !1, D && s) {
|
|
704
|
+
I("dragStarted", this, {
|
|
705
|
+
evt: n
|
|
706
|
+
}), this.nativeDraggable && b(document, "dragover", qt);
|
|
707
|
+
var t = this.options;
|
|
708
|
+
!e && X(s, t.dragClass, !1), X(s, t.ghostClass, !0), p.active = this, e && this._appendGhost(), A({
|
|
709
|
+
sortable: this,
|
|
710
|
+
name: "start",
|
|
711
|
+
originalEvent: n
|
|
712
|
+
});
|
|
713
|
+
} else
|
|
714
|
+
this._nulling();
|
|
715
|
+
},
|
|
716
|
+
_emulateDragOver: function() {
|
|
717
|
+
if (B) {
|
|
718
|
+
this._lastX = B.clientX, this._lastY = B.clientY, xt();
|
|
719
|
+
for (var e = document.elementFromPoint(B.clientX, B.clientY), n = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(B.clientX, B.clientY), e !== n); )
|
|
720
|
+
n = e;
|
|
721
|
+
if (s.parentNode[M]._isOutsideThisEl(e), n)
|
|
722
|
+
do {
|
|
723
|
+
if (n[M]) {
|
|
724
|
+
var t = void 0;
|
|
725
|
+
if (t = n[M]._onDragOver({
|
|
726
|
+
clientX: B.clientX,
|
|
727
|
+
clientY: B.clientY,
|
|
728
|
+
target: e,
|
|
729
|
+
rootEl: n
|
|
730
|
+
}), t && !this.options.dragoverBubble)
|
|
731
|
+
break;
|
|
732
|
+
}
|
|
733
|
+
e = n;
|
|
734
|
+
} while (n = bt(n));
|
|
735
|
+
Ot();
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
_onTouchMove: function(e) {
|
|
739
|
+
if (re) {
|
|
740
|
+
var n = this.options, t = n.fallbackTolerance, o = n.fallbackOffset, r = e.touches ? e.touches[0] : e, i = g && he(g, !0), a = g && i && i.a, u = g && i && i.d, l = Pe && N && dt(N), c = (r.clientX - re.clientX + o.x) / (a || 1) + (l ? l[0] - qe[0] : 0) / (a || 1), d = (r.clientY - re.clientY + o.y) / (u || 1) + (l ? l[1] - qe[1] : 0) / (u || 1);
|
|
741
|
+
if (!p.active && !de) {
|
|
742
|
+
if (t && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < t)
|
|
743
|
+
return;
|
|
744
|
+
this._onDragStart(e, !0);
|
|
745
|
+
}
|
|
746
|
+
if (g) {
|
|
747
|
+
i ? (i.e += c - (Ue || 0), i.f += d - (Ve || 0)) : i = {
|
|
748
|
+
a: 1,
|
|
749
|
+
b: 0,
|
|
750
|
+
c: 0,
|
|
751
|
+
d: 1,
|
|
752
|
+
e: c,
|
|
753
|
+
f: d
|
|
754
|
+
};
|
|
755
|
+
var f = "matrix(".concat(i.a, ",").concat(i.b, ",").concat(i.c, ",").concat(i.d, ",").concat(i.e, ",").concat(i.f, ")");
|
|
756
|
+
h(g, "webkitTransform", f), h(g, "mozTransform", f), h(g, "msTransform", f), h(g, "transform", f), Ue = c, Ve = d, B = r;
|
|
757
|
+
}
|
|
758
|
+
e.cancelable && e.preventDefault();
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
_appendGhost: function() {
|
|
762
|
+
if (!g) {
|
|
763
|
+
var e = this.options.fallbackOnBody ? document.body : D, n = T(s, !0, Pe, !0, e), t = this.options;
|
|
764
|
+
if (Pe) {
|
|
765
|
+
for (N = e; h(N, "position") === "static" && h(N, "transform") === "none" && N !== document; )
|
|
766
|
+
N = N.parentNode;
|
|
767
|
+
N !== document.body && N !== document.documentElement ? (N === document && (N = L()), n.top += N.scrollTop, n.left += N.scrollLeft) : N = L(), qe = dt(N);
|
|
768
|
+
}
|
|
769
|
+
g = s.cloneNode(!0), X(g, t.ghostClass, !1), X(g, t.fallbackClass, !0), X(g, t.dragClass, !0), h(g, "transition", ""), h(g, "transform", ""), h(g, "box-sizing", "border-box"), h(g, "margin", 0), h(g, "top", n.top), h(g, "left", n.left), h(g, "width", n.width), h(g, "height", n.height), h(g, "opacity", "0.8"), h(g, "position", Pe ? "absolute" : "fixed"), h(g, "zIndex", "100000"), h(g, "pointerEvents", "none"), p.ghost = g, e.appendChild(g), h(g, "transform-origin", ft / parseInt(g.style.width) * 100 + "% " + ht / parseInt(g.style.height) * 100 + "%");
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
_onDragStart: function(e, n) {
|
|
773
|
+
var t = this, o = e.dataTransfer, r = t.options;
|
|
774
|
+
if (I("dragStart", this, {
|
|
775
|
+
evt: e
|
|
776
|
+
}), p.eventCanceled) {
|
|
777
|
+
this._onDrop();
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
I("setupClone", this), p.eventCanceled || (E = Et(s), E.removeAttribute("id"), E.draggable = !1, E.style["will-change"] = "", this._hideClone(), X(E, this.options.chosenClass, !1), p.clone = E), t.cloneId = Xe(function() {
|
|
781
|
+
I("clone", t), !p.eventCanceled && (t.options.removeCloneOnHide || D.insertBefore(E, s), t._hideClone(), A({
|
|
782
|
+
sortable: t,
|
|
783
|
+
name: "clone"
|
|
784
|
+
}));
|
|
785
|
+
}), !n && X(s, r.dragClass, !0), n ? (Be = !0, t._loopId = setInterval(t._emulateDragOver, 50)) : (m(document, "mouseup", t._onDrop), m(document, "touchend", t._onDrop), m(document, "touchcancel", t._onDrop), o && (o.effectAllowed = "move", r.setData && r.setData.call(t, o, s)), b(document, "drop", t), h(s, "transform", "translateZ(0)")), de = !0, t._dragStartId = Xe(t._dragStarted.bind(t, n, e)), b(document, "selectstart", t), me = !0, window.getSelection().removeAllRanges(), we && h(document.body, "user-select", "none");
|
|
786
|
+
},
|
|
787
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
788
|
+
_onDragOver: function(e) {
|
|
789
|
+
var n = this.el, t = e.target, o, r, i, a = this.options, u = a.group, l = p.active, c = Oe === u, d = a.sort, f = x || l, w, v = this, C = !1;
|
|
790
|
+
if (Ke) return;
|
|
791
|
+
function y(ve, Pt) {
|
|
792
|
+
I(ve, v, W({
|
|
793
|
+
evt: e,
|
|
794
|
+
isOwner: c,
|
|
795
|
+
axis: w ? "vertical" : "horizontal",
|
|
796
|
+
revert: i,
|
|
797
|
+
dragRect: o,
|
|
798
|
+
targetRect: r,
|
|
799
|
+
canSort: d,
|
|
800
|
+
fromSortable: f,
|
|
801
|
+
target: t,
|
|
802
|
+
completed: P,
|
|
803
|
+
onMove: function(at, At) {
|
|
804
|
+
return Ae(D, n, s, o, at, T(at), e, At);
|
|
805
|
+
},
|
|
806
|
+
changed: z
|
|
807
|
+
}, Pt));
|
|
808
|
+
}
|
|
809
|
+
function F() {
|
|
810
|
+
y("dragOverAnimationCapture"), v.captureAnimationState(), v !== f && f.captureAnimationState();
|
|
811
|
+
}
|
|
812
|
+
function P(ve) {
|
|
813
|
+
return y("dragOverCompleted", {
|
|
814
|
+
insertion: ve
|
|
815
|
+
}), ve && (c ? l._hideClone() : l._showClone(v), v !== f && (X(s, x ? x.options.ghostClass : l.options.ghostClass, !1), X(s, a.ghostClass, !0)), x !== v && v !== p.active ? x = v : v === p.active && x && (x = null), f === v && (v._ignoreWhileAnimating = t), v.animateAll(function() {
|
|
816
|
+
y("dragOverAnimationComplete"), v._ignoreWhileAnimating = null;
|
|
817
|
+
}), v !== f && (f.animateAll(), f._ignoreWhileAnimating = null)), (t === s && !s.animated || t === n && !t.animated) && (ce = null), !a.dragoverBubble && !e.rootEl && t !== document && (s.parentNode[M]._isOutsideThisEl(e.target), !ve && ie(e)), !a.dragoverBubble && e.stopPropagation && e.stopPropagation(), C = !0;
|
|
818
|
+
}
|
|
819
|
+
function z() {
|
|
820
|
+
Y = R(s), Z = R(s, a.draggable), A({
|
|
821
|
+
sortable: v,
|
|
822
|
+
name: "change",
|
|
823
|
+
toEl: n,
|
|
824
|
+
newIndex: Y,
|
|
825
|
+
newDraggableIndex: Z,
|
|
826
|
+
originalEvent: e
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), t = j(t, a.draggable, n, !0), y("dragOver"), p.eventCanceled) return C;
|
|
830
|
+
if (s.contains(e.target) || t.animated && t.animatingX && t.animatingY || v._ignoreWhileAnimating === t)
|
|
831
|
+
return P(!1);
|
|
832
|
+
if (Be = !1, l && !a.disabled && (c ? d || (i = _ !== D) : x === this || (this.lastPutMode = Oe.checkPull(this, l, s, e)) && u.checkPut(this, l, s, e))) {
|
|
833
|
+
if (w = this._getDirection(e, t) === "vertical", o = T(s), y("dragOverValid"), p.eventCanceled) return C;
|
|
834
|
+
if (i)
|
|
835
|
+
return _ = D, F(), this._hideClone(), y("revert"), p.eventCanceled || (ae ? D.insertBefore(s, ae) : D.appendChild(s)), P(!0);
|
|
836
|
+
var O = ot(n, a.draggable);
|
|
837
|
+
if (!O || Zt(e, w, this) && !O.animated) {
|
|
838
|
+
if (O === s)
|
|
839
|
+
return P(!1);
|
|
840
|
+
if (O && n === e.target && (t = O), t && (r = T(t)), Ae(D, n, s, o, t, r, e, !!t) !== !1)
|
|
841
|
+
return F(), O && O.nextSibling ? n.insertBefore(s, O.nextSibling) : n.appendChild(s), _ = n, z(), P(!0);
|
|
842
|
+
} else if (O && Gt(e, w, this)) {
|
|
843
|
+
var ee = pe(n, 0, a, !0);
|
|
844
|
+
if (ee === s)
|
|
845
|
+
return P(!1);
|
|
846
|
+
if (t = ee, r = T(t), Ae(D, n, s, o, t, r, e, !1) !== !1)
|
|
847
|
+
return F(), n.insertBefore(s, ee), _ = n, z(), P(!0);
|
|
848
|
+
} else if (t.parentNode === n) {
|
|
849
|
+
r = T(t);
|
|
850
|
+
var H = 0, te, ge = s.parentNode !== n, le = !Ut(s.animated && s.toRect || o, t.animated && t.toRect || r, w), k = w ? "top" : "left", J = ct(t, "top", "top") || ct(s, "top", "top"), xe = J ? J.scrollTop : void 0;
|
|
851
|
+
ce !== t && (te = r[k], Se = !1, Ne = !le && a.invertSwap || ge), H = Kt(e, t, r, w, le ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Ne, ce === t);
|
|
852
|
+
var U;
|
|
853
|
+
if (H !== 0) {
|
|
854
|
+
var se = R(s);
|
|
855
|
+
do
|
|
856
|
+
se -= H, U = _.children[se];
|
|
857
|
+
while (U && (h(U, "display") === "none" || U === g));
|
|
858
|
+
}
|
|
859
|
+
if (H === 0 || U === t)
|
|
860
|
+
return P(!1);
|
|
861
|
+
ce = t, _e = H;
|
|
862
|
+
var ne = t.nextElementSibling, G = !1;
|
|
863
|
+
G = H === 1;
|
|
864
|
+
var oe = Ae(D, n, s, o, t, r, e, G);
|
|
865
|
+
if (oe !== !1)
|
|
866
|
+
return (oe === 1 || oe === -1) && (G = oe === 1), Ke = !0, setTimeout(Jt, 30), F(), G && !ne ? n.appendChild(s) : t.parentNode.insertBefore(s, G ? ne : t), J && Dt(J, 0, xe - J.scrollTop), _ = s.parentNode, te !== void 0 && !Ne && (ke = Math.abs(te - T(t)[k])), z(), P(!0);
|
|
867
|
+
}
|
|
868
|
+
if (n.contains(s))
|
|
869
|
+
return P(!1);
|
|
870
|
+
}
|
|
871
|
+
return !1;
|
|
872
|
+
},
|
|
873
|
+
_ignoreWhileAnimating: null,
|
|
874
|
+
_offMoveEvents: function() {
|
|
875
|
+
m(document, "mousemove", this._onTouchMove), m(document, "touchmove", this._onTouchMove), m(document, "pointermove", this._onTouchMove), m(document, "dragover", ie), m(document, "mousemove", ie), m(document, "touchmove", ie);
|
|
876
|
+
},
|
|
877
|
+
_offUpEvents: function() {
|
|
878
|
+
var e = this.el.ownerDocument;
|
|
879
|
+
m(e, "mouseup", this._onDrop), m(e, "touchend", this._onDrop), m(e, "pointerup", this._onDrop), m(e, "pointercancel", this._onDrop), m(e, "touchcancel", this._onDrop), m(document, "selectstart", this);
|
|
880
|
+
},
|
|
881
|
+
_onDrop: function(e) {
|
|
882
|
+
var n = this.el, t = this.options;
|
|
883
|
+
if (Y = R(s), Z = R(s, t.draggable), I("drop", this, {
|
|
884
|
+
evt: e
|
|
885
|
+
}), _ = s && s.parentNode, Y = R(s), Z = R(s, t.draggable), p.eventCanceled) {
|
|
886
|
+
this._nulling();
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
de = !1, Ne = !1, Se = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), $e(this.cloneId), $e(this._dragStartId), this.nativeDraggable && (m(document, "drop", this), m(n, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), we && h(document.body, "user-select", ""), h(s, "transform", ""), e && (me && (e.cancelable && e.preventDefault(), !t.dropBubble && e.stopPropagation()), g && g.parentNode && g.parentNode.removeChild(g), (D === _ || x && x.lastPutMode !== "clone") && E && E.parentNode && E.parentNode.removeChild(E), s && (this.nativeDraggable && m(s, "dragend", this), Qe(s), s.style["will-change"] = "", me && !de && X(s, x ? x.options.ghostClass : this.options.ghostClass, !1), X(s, this.options.chosenClass, !1), A({
|
|
890
|
+
sortable: this,
|
|
891
|
+
name: "unchoose",
|
|
892
|
+
toEl: _,
|
|
893
|
+
newIndex: null,
|
|
894
|
+
newDraggableIndex: null,
|
|
895
|
+
originalEvent: e
|
|
896
|
+
}), D !== _ ? (Y >= 0 && (A({
|
|
897
|
+
rootEl: _,
|
|
898
|
+
name: "add",
|
|
899
|
+
toEl: _,
|
|
900
|
+
fromEl: D,
|
|
901
|
+
originalEvent: e
|
|
902
|
+
}), A({
|
|
903
|
+
sortable: this,
|
|
904
|
+
name: "remove",
|
|
905
|
+
toEl: _,
|
|
906
|
+
originalEvent: e
|
|
907
|
+
}), A({
|
|
908
|
+
rootEl: _,
|
|
909
|
+
name: "sort",
|
|
910
|
+
toEl: _,
|
|
911
|
+
fromEl: D,
|
|
912
|
+
originalEvent: e
|
|
913
|
+
}), A({
|
|
914
|
+
sortable: this,
|
|
915
|
+
name: "sort",
|
|
916
|
+
toEl: _,
|
|
917
|
+
originalEvent: e
|
|
918
|
+
})), x && x.save()) : Y !== fe && Y >= 0 && (A({
|
|
919
|
+
sortable: this,
|
|
920
|
+
name: "update",
|
|
921
|
+
toEl: _,
|
|
922
|
+
originalEvent: e
|
|
923
|
+
}), A({
|
|
924
|
+
sortable: this,
|
|
925
|
+
name: "sort",
|
|
926
|
+
toEl: _,
|
|
927
|
+
originalEvent: e
|
|
928
|
+
})), p.active && ((Y == null || Y === -1) && (Y = fe, Z = Ee), A({
|
|
929
|
+
sortable: this,
|
|
930
|
+
name: "end",
|
|
931
|
+
toEl: _,
|
|
932
|
+
originalEvent: e
|
|
933
|
+
}), this.save()))), this._nulling();
|
|
934
|
+
},
|
|
935
|
+
_nulling: function() {
|
|
936
|
+
I("nulling", this), D = s = _ = g = ae = E = Me = K = re = B = me = Y = Z = fe = Ee = ce = _e = x = Oe = p.dragged = p.ghost = p.clone = p.active = null, He.forEach(function(e) {
|
|
937
|
+
e.checked = !0;
|
|
938
|
+
}), He.length = Ue = Ve = 0;
|
|
939
|
+
},
|
|
940
|
+
handleEvent: function(e) {
|
|
941
|
+
switch (e.type) {
|
|
942
|
+
case "drop":
|
|
943
|
+
case "dragend":
|
|
944
|
+
this._onDrop(e);
|
|
945
|
+
break;
|
|
946
|
+
case "dragenter":
|
|
947
|
+
case "dragover":
|
|
948
|
+
s && (this._onDragOver(e), Qt(e));
|
|
949
|
+
break;
|
|
950
|
+
case "selectstart":
|
|
951
|
+
e.preventDefault();
|
|
952
|
+
break;
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
/**
|
|
956
|
+
* Serializes the item into an array of string.
|
|
957
|
+
* @returns {String[]}
|
|
958
|
+
*/
|
|
959
|
+
toArray: function() {
|
|
960
|
+
for (var e = [], n, t = this.el.children, o = 0, r = t.length, i = this.options; o < r; o++)
|
|
961
|
+
n = t[o], j(n, i.draggable, this.el, !1) && e.push(n.getAttribute(i.dataIdAttr) || en(n));
|
|
962
|
+
return e;
|
|
963
|
+
},
|
|
964
|
+
/**
|
|
965
|
+
* Sorts the elements according to the array.
|
|
966
|
+
* @param {String[]} order order of the items
|
|
967
|
+
*/
|
|
968
|
+
sort: function(e, n) {
|
|
969
|
+
var t = {}, o = this.el;
|
|
970
|
+
this.toArray().forEach(function(r, i) {
|
|
971
|
+
var a = o.children[i];
|
|
972
|
+
j(a, this.options.draggable, o, !1) && (t[r] = a);
|
|
973
|
+
}, this), n && this.captureAnimationState(), e.forEach(function(r) {
|
|
974
|
+
t[r] && (o.removeChild(t[r]), o.appendChild(t[r]));
|
|
975
|
+
}), n && this.animateAll();
|
|
976
|
+
},
|
|
977
|
+
/**
|
|
978
|
+
* Save the current sorting
|
|
979
|
+
*/
|
|
980
|
+
save: function() {
|
|
981
|
+
var e = this.options.store;
|
|
982
|
+
e && e.set && e.set(this);
|
|
983
|
+
},
|
|
984
|
+
/**
|
|
985
|
+
* 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.
|
|
986
|
+
* @param {HTMLElement} el
|
|
987
|
+
* @param {String} [selector] default: `options.draggable`
|
|
988
|
+
* @returns {HTMLElement|null}
|
|
989
|
+
*/
|
|
990
|
+
closest: function(e, n) {
|
|
991
|
+
return j(e, n || this.options.draggable, this.el, !1);
|
|
992
|
+
},
|
|
993
|
+
/**
|
|
994
|
+
* Set/get option
|
|
995
|
+
* @param {string} name
|
|
996
|
+
* @param {*} [value]
|
|
997
|
+
* @returns {*}
|
|
998
|
+
*/
|
|
999
|
+
option: function(e, n) {
|
|
1000
|
+
var t = this.options;
|
|
1001
|
+
if (n === void 0)
|
|
1002
|
+
return t[e];
|
|
1003
|
+
var o = Ce.modifyOption(this, e, n);
|
|
1004
|
+
typeof o < "u" ? t[e] = o : t[e] = n, e === "group" && Ct(t);
|
|
1005
|
+
},
|
|
1006
|
+
/**
|
|
1007
|
+
* Destroy
|
|
1008
|
+
*/
|
|
1009
|
+
destroy: function() {
|
|
1010
|
+
I("destroy", this);
|
|
1011
|
+
var e = this.el;
|
|
1012
|
+
e[M] = null, m(e, "mousedown", this._onTapStart), m(e, "touchstart", this._onTapStart), m(e, "pointerdown", this._onTapStart), this.nativeDraggable && (m(e, "dragover", this), m(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(n) {
|
|
1013
|
+
n.removeAttribute("draggable");
|
|
1014
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), je.splice(je.indexOf(this.el), 1), this.el = e = null;
|
|
1015
|
+
},
|
|
1016
|
+
_hideClone: function() {
|
|
1017
|
+
if (!K) {
|
|
1018
|
+
if (I("hideClone", this), p.eventCanceled) return;
|
|
1019
|
+
h(E, "display", "none"), this.options.removeCloneOnHide && E.parentNode && E.parentNode.removeChild(E), K = !0;
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
_showClone: function(e) {
|
|
1023
|
+
if (e.lastPutMode !== "clone") {
|
|
1024
|
+
this._hideClone();
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
if (K) {
|
|
1028
|
+
if (I("showClone", this), p.eventCanceled) return;
|
|
1029
|
+
s.parentNode == D && !this.options.group.revertClone ? D.insertBefore(E, s) : ae ? D.insertBefore(E, ae) : D.appendChild(E), this.options.group.revertClone && this.animate(s, E), h(E, "display", ""), K = !1;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
function Qt(e) {
|
|
1034
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
1035
|
+
}
|
|
1036
|
+
function Ae(e, n, t, o, r, i, a, u) {
|
|
1037
|
+
var l, c = e[M], d = c.options.onMove, f;
|
|
1038
|
+
return window.CustomEvent && !Q && !Te ? l = new CustomEvent("move", {
|
|
1039
|
+
bubbles: !0,
|
|
1040
|
+
cancelable: !0
|
|
1041
|
+
}) : (l = document.createEvent("Event"), l.initEvent("move", !0, !0)), l.to = n, l.from = e, l.dragged = t, l.draggedRect = o, l.related = r || n, l.relatedRect = i || T(n), l.willInsertAfter = u, l.originalEvent = a, e.dispatchEvent(l), d && (f = d.call(c, l, a)), f;
|
|
1042
|
+
}
|
|
1043
|
+
function Qe(e) {
|
|
1044
|
+
e.draggable = !1;
|
|
1045
|
+
}
|
|
1046
|
+
function Jt() {
|
|
1047
|
+
Ke = !1;
|
|
1048
|
+
}
|
|
1049
|
+
function Gt(e, n, t) {
|
|
1050
|
+
var o = T(pe(t.el, 0, t.options, !0)), r = _t(t.el, t.options, g), i = 10;
|
|
1051
|
+
return n ? e.clientX < r.left - i || e.clientY < o.top && e.clientX < o.right : e.clientY < r.top - i || e.clientY < o.bottom && e.clientX < o.left;
|
|
1052
|
+
}
|
|
1053
|
+
function Zt(e, n, t) {
|
|
1054
|
+
var o = T(ot(t.el, t.options.draggable)), r = _t(t.el, t.options, g), i = 10;
|
|
1055
|
+
return n ? e.clientX > r.right + i || e.clientY > o.bottom && e.clientX > o.left : e.clientY > r.bottom + i || e.clientX > o.right && e.clientY > o.top;
|
|
1056
|
+
}
|
|
1057
|
+
function Kt(e, n, t, o, r, i, a, u) {
|
|
1058
|
+
var l = o ? e.clientY : e.clientX, c = o ? t.height : t.width, d = o ? t.top : t.left, f = o ? t.bottom : t.right, w = !1;
|
|
1059
|
+
if (!a) {
|
|
1060
|
+
if (u && ke < c * r) {
|
|
1061
|
+
if (!Se && (_e === 1 ? l > d + c * i / 2 : l < f - c * i / 2) && (Se = !0), Se)
|
|
1062
|
+
w = !0;
|
|
1063
|
+
else if (_e === 1 ? l < d + ke : l > f - ke)
|
|
1064
|
+
return -_e;
|
|
1065
|
+
} else if (l > d + c * (1 - r) / 2 && l < f - c * (1 - r) / 2)
|
|
1066
|
+
return $t(n);
|
|
1067
|
+
}
|
|
1068
|
+
return w = w || a, w && (l < d + c * i / 2 || l > f - c * i / 2) ? l > d + c / 2 ? 1 : -1 : 0;
|
|
1069
|
+
}
|
|
1070
|
+
function $t(e) {
|
|
1071
|
+
return R(s) < R(e) ? 1 : -1;
|
|
1072
|
+
}
|
|
1073
|
+
function en(e) {
|
|
1074
|
+
for (var n = e.tagName + e.className + e.src + e.href + e.textContent, t = n.length, o = 0; t--; )
|
|
1075
|
+
o += n.charCodeAt(t);
|
|
1076
|
+
return o.toString(36);
|
|
1077
|
+
}
|
|
1078
|
+
function tn(e) {
|
|
1079
|
+
He.length = 0;
|
|
1080
|
+
for (var n = e.getElementsByTagName("input"), t = n.length; t--; ) {
|
|
1081
|
+
var o = n[t];
|
|
1082
|
+
o.checked && He.push(o);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
function Xe(e) {
|
|
1086
|
+
return setTimeout(e, 0);
|
|
1087
|
+
}
|
|
1088
|
+
function $e(e) {
|
|
1089
|
+
return clearTimeout(e);
|
|
1090
|
+
}
|
|
1091
|
+
We && b(document, "touchmove", function(e) {
|
|
1092
|
+
(p.active || de) && e.cancelable && e.preventDefault();
|
|
1093
|
+
});
|
|
1094
|
+
p.utils = {
|
|
1095
|
+
on: b,
|
|
1096
|
+
off: m,
|
|
1097
|
+
css: h,
|
|
1098
|
+
find: yt,
|
|
1099
|
+
is: function(e, n) {
|
|
1100
|
+
return !!j(e, n, e, !1);
|
|
1101
|
+
},
|
|
1102
|
+
extend: Rt,
|
|
1103
|
+
throttle: wt,
|
|
1104
|
+
closest: j,
|
|
1105
|
+
toggleClass: X,
|
|
1106
|
+
clone: Et,
|
|
1107
|
+
index: R,
|
|
1108
|
+
nextTick: Xe,
|
|
1109
|
+
cancelNextTick: $e,
|
|
1110
|
+
detectDirection: Tt,
|
|
1111
|
+
getChild: pe,
|
|
1112
|
+
expando: M
|
|
1113
|
+
};
|
|
1114
|
+
p.get = function(e) {
|
|
1115
|
+
return e[M];
|
|
1116
|
+
};
|
|
1117
|
+
p.mount = function() {
|
|
1118
|
+
for (var e = arguments.length, n = new Array(e), t = 0; t < e; t++)
|
|
1119
|
+
n[t] = arguments[t];
|
|
1120
|
+
n[0].constructor === Array && (n = n[0]), n.forEach(function(o) {
|
|
1121
|
+
if (!o.prototype || !o.prototype.constructor)
|
|
1122
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));
|
|
1123
|
+
o.utils && (p.utils = W(W({}, p.utils), o.utils)), Ce.mount(o);
|
|
1124
|
+
});
|
|
1125
|
+
};
|
|
1126
|
+
p.create = function(e, n) {
|
|
1127
|
+
return new p(e, n);
|
|
1128
|
+
};
|
|
1129
|
+
p.version = Xt;
|
|
1130
|
+
var S = [], be, et, tt = !1, Je, Ge, Le, ye;
|
|
1131
|
+
function nn() {
|
|
1132
|
+
function e() {
|
|
1133
|
+
this.defaults = {
|
|
1134
|
+
scroll: !0,
|
|
1135
|
+
forceAutoScrollFallback: !1,
|
|
1136
|
+
scrollSensitivity: 30,
|
|
1137
|
+
scrollSpeed: 10,
|
|
1138
|
+
bubbleScroll: !0
|
|
1139
|
+
};
|
|
1140
|
+
for (var n in this)
|
|
1141
|
+
n.charAt(0) === "_" && typeof this[n] == "function" && (this[n] = this[n].bind(this));
|
|
1142
|
+
}
|
|
1143
|
+
return e.prototype = {
|
|
1144
|
+
dragStarted: function(n) {
|
|
1145
|
+
var t = n.originalEvent;
|
|
1146
|
+
this.sortable.nativeDraggable ? b(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? b(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? b(document, "touchmove", this._handleFallbackAutoScroll) : b(document, "mousemove", this._handleFallbackAutoScroll);
|
|
1147
|
+
},
|
|
1148
|
+
dragOverCompleted: function(n) {
|
|
1149
|
+
var t = n.originalEvent;
|
|
1150
|
+
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
1151
|
+
},
|
|
1152
|
+
drop: function() {
|
|
1153
|
+
this.sortable.nativeDraggable ? m(document, "dragover", this._handleAutoScroll) : (m(document, "pointermove", this._handleFallbackAutoScroll), m(document, "touchmove", this._handleFallbackAutoScroll), m(document, "mousemove", this._handleFallbackAutoScroll)), gt(), Ye(), Bt();
|
|
1154
|
+
},
|
|
1155
|
+
nulling: function() {
|
|
1156
|
+
Le = et = be = tt = ye = Je = Ge = null, S.length = 0;
|
|
1157
|
+
},
|
|
1158
|
+
_handleFallbackAutoScroll: function(n) {
|
|
1159
|
+
this._handleAutoScroll(n, !0);
|
|
1160
|
+
},
|
|
1161
|
+
_handleAutoScroll: function(n, t) {
|
|
1162
|
+
var o = this, r = (n.touches ? n.touches[0] : n).clientX, i = (n.touches ? n.touches[0] : n).clientY, a = document.elementFromPoint(r, i);
|
|
1163
|
+
if (Le = n, t || this.options.forceAutoScrollFallback || Te || Q || we) {
|
|
1164
|
+
Ze(n, this.options, a, t);
|
|
1165
|
+
var u = $(a, !0);
|
|
1166
|
+
tt && (!ye || r !== Je || i !== Ge) && (ye && gt(), ye = setInterval(function() {
|
|
1167
|
+
var l = $(document.elementFromPoint(r, i), !0);
|
|
1168
|
+
l !== u && (u = l, Ye()), Ze(n, o.options, l, t);
|
|
1169
|
+
}, 10), Je = r, Ge = i);
|
|
1170
|
+
} else {
|
|
1171
|
+
if (!this.options.bubbleScroll || $(a, !0) === L()) {
|
|
1172
|
+
Ye();
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
Ze(n, this.options, $(a, !1), !1);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}, q(e, {
|
|
1179
|
+
pluginName: "scroll",
|
|
1180
|
+
initializeByDefault: !0
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
function Ye() {
|
|
1184
|
+
S.forEach(function(e) {
|
|
1185
|
+
clearInterval(e.pid);
|
|
1186
|
+
}), S = [];
|
|
1187
|
+
}
|
|
1188
|
+
function gt() {
|
|
1189
|
+
clearInterval(ye);
|
|
1190
|
+
}
|
|
1191
|
+
var Ze = wt(function(e, n, t, o) {
|
|
1192
|
+
if (n.scroll) {
|
|
1193
|
+
var r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = n.scrollSensitivity, u = n.scrollSpeed, l = L(), c = !1, d;
|
|
1194
|
+
et !== t && (et = t, Ye(), be = n.scroll, d = n.scrollFn, be === !0 && (be = $(t, !0)));
|
|
1195
|
+
var f = 0, w = be;
|
|
1196
|
+
do {
|
|
1197
|
+
var v = w, C = T(v), y = C.top, F = C.bottom, P = C.left, z = C.right, O = C.width, ee = C.height, H = void 0, te = void 0, ge = v.scrollWidth, le = v.scrollHeight, k = h(v), J = v.scrollLeft, xe = v.scrollTop;
|
|
1198
|
+
v === l ? (H = O < ge && (k.overflowX === "auto" || k.overflowX === "scroll" || k.overflowX === "visible"), te = ee < le && (k.overflowY === "auto" || k.overflowY === "scroll" || k.overflowY === "visible")) : (H = O < ge && (k.overflowX === "auto" || k.overflowX === "scroll"), te = ee < le && (k.overflowY === "auto" || k.overflowY === "scroll"));
|
|
1199
|
+
var U = H && (Math.abs(z - r) <= a && J + O < ge) - (Math.abs(P - r) <= a && !!J), se = te && (Math.abs(F - i) <= a && xe + ee < le) - (Math.abs(y - i) <= a && !!xe);
|
|
1200
|
+
if (!S[f])
|
|
1201
|
+
for (var ne = 0; ne <= f; ne++)
|
|
1202
|
+
S[ne] || (S[ne] = {});
|
|
1203
|
+
(S[f].vx != U || S[f].vy != se || S[f].el !== v) && (S[f].el = v, S[f].vx = U, S[f].vy = se, clearInterval(S[f].pid), (U != 0 || se != 0) && (c = !0, S[f].pid = setInterval((function() {
|
|
1204
|
+
o && this.layer === 0 && p.active._onTouchMove(Le);
|
|
1205
|
+
var G = S[this.layer].vy ? S[this.layer].vy * u : 0, oe = S[this.layer].vx ? S[this.layer].vx * u : 0;
|
|
1206
|
+
typeof d == "function" && d.call(p.dragged.parentNode[M], oe, G, e, Le, S[this.layer].el) !== "continue" || Dt(S[this.layer].el, oe, G);
|
|
1207
|
+
}).bind({
|
|
1208
|
+
layer: f
|
|
1209
|
+
}), 24))), f++;
|
|
1210
|
+
} while (n.bubbleScroll && w !== l && (w = $(w, !1)));
|
|
1211
|
+
tt = c;
|
|
1212
|
+
}
|
|
1213
|
+
}, 30), Nt = function(e) {
|
|
1214
|
+
var n = e.originalEvent, t = e.putSortable, o = e.dragEl, r = e.activeSortable, i = e.dispatchSortableEvent, a = e.hideGhostForTarget, u = e.unhideGhostForTarget;
|
|
1215
|
+
if (n) {
|
|
1216
|
+
var l = t || r;
|
|
1217
|
+
a();
|
|
1218
|
+
var c = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, d = document.elementFromPoint(c.clientX, c.clientY);
|
|
1219
|
+
u(), l && !l.el.contains(d) && (i("spill"), this.onSpill({
|
|
1220
|
+
dragEl: o,
|
|
1221
|
+
putSortable: t
|
|
1222
|
+
}));
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
function rt() {
|
|
1226
|
+
}
|
|
1227
|
+
rt.prototype = {
|
|
1228
|
+
startIndex: null,
|
|
1229
|
+
dragStart: function(e) {
|
|
1230
|
+
var n = e.oldDraggableIndex;
|
|
1231
|
+
this.startIndex = n;
|
|
1232
|
+
},
|
|
1233
|
+
onSpill: function(e) {
|
|
1234
|
+
var n = e.dragEl, t = e.putSortable;
|
|
1235
|
+
this.sortable.captureAnimationState(), t && t.captureAnimationState();
|
|
1236
|
+
var o = pe(this.sortable.el, this.startIndex, this.options);
|
|
1237
|
+
o ? this.sortable.el.insertBefore(n, o) : this.sortable.el.appendChild(n), this.sortable.animateAll(), t && t.animateAll();
|
|
1238
|
+
},
|
|
1239
|
+
drop: Nt
|
|
1240
|
+
};
|
|
1241
|
+
q(rt, {
|
|
1242
|
+
pluginName: "revertOnSpill"
|
|
1243
|
+
});
|
|
1244
|
+
function it() {
|
|
1245
|
+
}
|
|
1246
|
+
it.prototype = {
|
|
1247
|
+
onSpill: function(e) {
|
|
1248
|
+
var n = e.dragEl, t = e.putSortable, o = t || this.sortable;
|
|
1249
|
+
o.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), o.animateAll();
|
|
1250
|
+
},
|
|
1251
|
+
drop: Nt
|
|
1252
|
+
};
|
|
1253
|
+
q(it, {
|
|
1254
|
+
pluginName: "removeOnSpill"
|
|
1255
|
+
});
|
|
1256
|
+
p.mount(new nn());
|
|
1257
|
+
p.mount(it, rt);
|
|
1258
|
+
export {
|
|
1259
|
+
p as Sortable,
|
|
1260
|
+
p as default
|
|
1261
|
+
};
|
|
1262
|
+
//# sourceMappingURL=sortable.esm.js.map
|