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