@wisemen/vue-core-custom-views 0.2.0 → 0.3.0
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/adapters/state/customViewSortStateAdapter.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +388 -367
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -68,8 +68,29 @@ function At(e) {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
//#endregion
|
|
71
|
-
//#region src/adapters/state/
|
|
71
|
+
//#region src/adapters/state/customViewSortStateAdapter.ts
|
|
72
72
|
function jt(e) {
|
|
73
|
+
return wt({
|
|
74
|
+
isDirty: (e, t) => {
|
|
75
|
+
let n = e ?? [];
|
|
76
|
+
return n.length === t.length ? n.some((e, n) => {
|
|
77
|
+
let r = t[n];
|
|
78
|
+
return r == null || e.key !== r.key || e.direction !== r.direction;
|
|
79
|
+
}) : !0;
|
|
80
|
+
},
|
|
81
|
+
apply: (t) => {
|
|
82
|
+
if (e.resetSort(), t !== null) for (let { direction: n, key: r } of t.toReversed()) e.toggleSort(r), n === "desc" && e.toggleSort(r);
|
|
83
|
+
},
|
|
84
|
+
deserialize: (e) => e,
|
|
85
|
+
getCurrentState: () => e.values.value,
|
|
86
|
+
getDefaultState: () => [],
|
|
87
|
+
key: "sort",
|
|
88
|
+
serialize: (e) => e
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/adapters/state/customViewTableColumnsStateAdapter.ts
|
|
93
|
+
function Mt(e) {
|
|
73
94
|
let t = e.customizedColumns.value.map((e) => e.key);
|
|
74
95
|
return wt({
|
|
75
96
|
isDirty: (e, n) => JSON.stringify(e ?? t) !== JSON.stringify(n),
|
|
@@ -85,7 +106,7 @@ function jt(e) {
|
|
|
85
106
|
}
|
|
86
107
|
//#endregion
|
|
87
108
|
//#region src/adapters/storage/customViewLocalStorageAdapter.ts
|
|
88
|
-
function
|
|
109
|
+
function Nt(e) {
|
|
89
110
|
let n = t(e, [], { deep: !0 });
|
|
90
111
|
return {
|
|
91
112
|
load: () => {
|
|
@@ -110,7 +131,7 @@ var k = {
|
|
|
110
131
|
PURPLE: "purple",
|
|
111
132
|
RED: "red",
|
|
112
133
|
YELLOW: "yellow"
|
|
113
|
-
},
|
|
134
|
+
}, Pt = new Map([
|
|
114
135
|
[k.DEFAULT, "var(--fg-secondary)"],
|
|
115
136
|
[k.PURPLE, "oklch(0.44 0.17 287)"],
|
|
116
137
|
[k.CYAN, "oklch(0.71 0.12 213)"],
|
|
@@ -119,12 +140,12 @@ var k = {
|
|
|
119
140
|
[k.PINK, "oklch(0.87 0.05 22)"],
|
|
120
141
|
[k.RED, "oklch(0.58 0.19 25)"]
|
|
121
142
|
]);
|
|
122
|
-
function
|
|
123
|
-
return
|
|
143
|
+
function Ft(e) {
|
|
144
|
+
return Pt.get(e) ?? "var(--fg-secondary)";
|
|
124
145
|
}
|
|
125
146
|
//#endregion
|
|
126
147
|
//#region src/components/CustomViewColorPicker.vue
|
|
127
|
-
var
|
|
148
|
+
var It = /* @__PURE__ */ l({
|
|
128
149
|
__name: "CustomViewColorPicker",
|
|
129
150
|
props: { field: {} },
|
|
130
151
|
setup(e) {
|
|
@@ -139,10 +160,10 @@ var Ft = /* @__PURE__ */ l({
|
|
|
139
160
|
"onUpdate:modelValue": l[0] ||= (t) => e.field.setValue(t)
|
|
140
161
|
}, {
|
|
141
162
|
default: D(() => [c(E(be), { class: "flex-wrap" }, {
|
|
142
|
-
default: D(() => [(b(!0), o(n, null, C(E(
|
|
163
|
+
default: D(() => [(b(!0), o(n, null, C(E(Pt), ([e]) => (b(), i(E(ce), { key: e }, {
|
|
143
164
|
default: D(() => [c(E(ft), {
|
|
144
165
|
value: e,
|
|
145
|
-
style: _({ backgroundColor: E(
|
|
166
|
+
style: _({ backgroundColor: E(Ft)(e) }),
|
|
146
167
|
class: "flex size-6.5 items-center justify-center rounded-md! ring-offset-1"
|
|
147
168
|
}, {
|
|
148
169
|
default: D(() => [c(E(dt), null, {
|
|
@@ -196,7 +217,7 @@ var Ft = /* @__PURE__ */ l({
|
|
|
196
217
|
UNLOCK: "unlock",
|
|
197
218
|
USER: "user",
|
|
198
219
|
ZAP: "zap"
|
|
199
|
-
},
|
|
220
|
+
}, Lt = new Map([
|
|
200
221
|
[A.LAYERS, Ke],
|
|
201
222
|
[A.ACTIVITY, Te],
|
|
202
223
|
[A.ALERT_TRIANGLE, Ee],
|
|
@@ -233,12 +254,12 @@ var Ft = /* @__PURE__ */ l({
|
|
|
233
254
|
[A.USER, lt],
|
|
234
255
|
[A.ZAP, ut]
|
|
235
256
|
]);
|
|
236
|
-
function
|
|
237
|
-
return
|
|
257
|
+
function Rt(e) {
|
|
258
|
+
return Lt.get(e) ?? Ke;
|
|
238
259
|
}
|
|
239
260
|
//#endregion
|
|
240
261
|
//#region src/components/CustomViewIconPicker.vue?vue&type=script&setup=true&lang.ts
|
|
241
|
-
var
|
|
262
|
+
var zt = { class: "p-sm" }, Bt = { class: "grid grid-cols-8 gap-xxs" }, Vt = ["onClick"], Ht = /* @__PURE__ */ l({
|
|
242
263
|
__name: "CustomViewIconPicker",
|
|
243
264
|
props: { field: {} },
|
|
244
265
|
setup(e) {
|
|
@@ -255,14 +276,14 @@ var Rt = { class: "p-sm" }, zt = { class: "grid grid-cols-8 gap-xxs" }, Bt = ["o
|
|
|
255
276
|
}, {
|
|
256
277
|
trigger: D(() => [c(E(ve), { label: E(r).t("component.custom_view_icon_picker.label") }, {
|
|
257
278
|
default: D(() => [c(E(_e), {
|
|
258
|
-
icon: E(
|
|
279
|
+
icon: E(Rt)(t.field.value.value),
|
|
259
280
|
"is-tooltip-disabled": !0,
|
|
260
281
|
label: E(r).t("component.custom_view_icon_picker.view_icon_label"),
|
|
261
282
|
variant: "secondary"
|
|
262
283
|
}, null, 8, ["icon", "label"])]),
|
|
263
284
|
_: 1
|
|
264
285
|
}, 8, ["label"])]),
|
|
265
|
-
content: D(() => [s("div",
|
|
286
|
+
content: D(() => [s("div", zt, [s("ul", Bt, [(b(!0), o(n, null, C(E(Lt), ([e, n]) => (b(), o("li", { key: e }, [c(E(ce), null, {
|
|
266
287
|
default: D(() => [s("button", {
|
|
267
288
|
class: g([{
|
|
268
289
|
"bg-tertiary": e === t.field.value.value,
|
|
@@ -270,13 +291,13 @@ var Rt = { class: "p-sm" }, zt = { class: "grid grid-cols-8 gap-xxs" }, Bt = ["o
|
|
|
270
291
|
}, "p-md"]),
|
|
271
292
|
type: "button",
|
|
272
293
|
onClick: (t) => l(e)
|
|
273
|
-
}, [(b(), i(w(n), { class: "size-4 text-tertiary" }))], 10,
|
|
294
|
+
}, [(b(), i(w(n), { class: "size-4 text-tertiary" }))], 10, Vt)]),
|
|
274
295
|
_: 2
|
|
275
296
|
}, 1024)]))), 128))])])]),
|
|
276
297
|
_: 1
|
|
277
298
|
}, 8, ["is-open"]));
|
|
278
299
|
}
|
|
279
|
-
}),
|
|
300
|
+
}), Ut = /* @__PURE__ */ l({
|
|
280
301
|
__name: "CustomViewCreateDialog",
|
|
281
302
|
emits: ["save"],
|
|
282
303
|
setup(e, { emit: t }) {
|
|
@@ -307,7 +328,7 @@ var Rt = { class: "p-sm" }, zt = { class: "grid grid-cols-8 gap-xxs" }, Bt = ["o
|
|
|
307
328
|
placeholder: E(r).t("component.custom_view_create_dialog.name_placeholder"),
|
|
308
329
|
label: E(r).t("component.custom_view_create_dialog.name_label")
|
|
309
330
|
}), null, 16, ["placeholder", "label"]), c(E(be), { gap: "2xl" }, {
|
|
310
|
-
default: D(() => [c(
|
|
331
|
+
default: D(() => [c(Ht, { field: E(s) }, null, 8, ["field"]), c(It, { field: E(l) }, null, 8, ["field"])]),
|
|
311
332
|
_: 1
|
|
312
333
|
})]),
|
|
313
334
|
_: 1
|
|
@@ -322,7 +343,7 @@ var Rt = { class: "p-sm" }, zt = { class: "grid grid-cols-8 gap-xxs" }, Bt = ["o
|
|
|
322
343
|
_: 1
|
|
323
344
|
}, 8, ["form"]));
|
|
324
345
|
}
|
|
325
|
-
}),
|
|
346
|
+
}), Wt = /* @__PURE__ */ l({
|
|
326
347
|
__name: "CustomViewUpdateDialog",
|
|
327
348
|
props: { view: {} },
|
|
328
349
|
emits: ["save"],
|
|
@@ -358,7 +379,7 @@ var Rt = { class: "p-sm" }, zt = { class: "grid grid-cols-8 gap-xxs" }, Bt = ["o
|
|
|
358
379
|
placeholder: E(o).t("component.custom_view_update_dialog.name_placeholder"),
|
|
359
380
|
label: E(o).t("component.custom_view_update_dialog.name_label")
|
|
360
381
|
}), null, 16, ["placeholder", "label"]), c(E(be), { gap: "2xl" }, {
|
|
361
|
-
default: D(() => [c(
|
|
382
|
+
default: D(() => [c(Ht, { field: E(l) }, null, 8, ["field"]), c(It, { field: E(u) }, null, 8, ["field"])]),
|
|
362
383
|
_: 1
|
|
363
384
|
})]),
|
|
364
385
|
_: 1
|
|
@@ -373,83 +394,83 @@ var Rt = { class: "p-sm" }, zt = { class: "grid grid-cols-8 gap-xxs" }, Bt = ["o
|
|
|
373
394
|
_: 1
|
|
374
395
|
}, 8, ["form"]));
|
|
375
396
|
}
|
|
376
|
-
}),
|
|
397
|
+
}), Gt = Object.defineProperty, Kt = Object.getOwnPropertySymbols, qt = Object.prototype.hasOwnProperty, Jt = Object.prototype.propertyIsEnumerable, Yt = (e, t, n) => t in e ? Gt(e, t, {
|
|
377
398
|
enumerable: !0,
|
|
378
399
|
configurable: !0,
|
|
379
400
|
writable: !0,
|
|
380
401
|
value: n
|
|
381
|
-
}) : e[t] = n,
|
|
382
|
-
for (var n in t ||= {})
|
|
383
|
-
if (
|
|
402
|
+
}) : e[t] = n, Xt = (e, t) => {
|
|
403
|
+
for (var n in t ||= {}) qt.call(t, n) && Yt(e, n, t[n]);
|
|
404
|
+
if (Kt) for (var n of Kt(t)) Jt.call(t, n) && Yt(e, n, t[n]);
|
|
384
405
|
return e;
|
|
385
|
-
},
|
|
406
|
+
}, Zt = (e, t) => {
|
|
386
407
|
var n = {};
|
|
387
|
-
for (var r in e)
|
|
388
|
-
if (e != null &&
|
|
408
|
+
for (var r in e) qt.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
409
|
+
if (e != null && Kt) for (var r of Kt(e)) t.indexOf(r) < 0 && Jt.call(e, r) && (n[r] = e[r]);
|
|
389
410
|
return n;
|
|
390
|
-
},
|
|
391
|
-
function Qt(e) {
|
|
392
|
-
console.warn(Zt + e);
|
|
393
|
-
}
|
|
411
|
+
}, Qt = "[vue-draggable-plus]: ";
|
|
394
412
|
function $t(e) {
|
|
395
|
-
console.
|
|
413
|
+
console.warn(Qt + e);
|
|
396
414
|
}
|
|
397
|
-
function en(e
|
|
415
|
+
function en(e) {
|
|
416
|
+
console.error(Qt + e);
|
|
417
|
+
}
|
|
418
|
+
function tn(e, t, n) {
|
|
398
419
|
return n >= 0 && n < e.length && e.splice(n, 0, e.splice(t, 1)[0]), e;
|
|
399
420
|
}
|
|
400
|
-
function
|
|
421
|
+
function nn(e) {
|
|
401
422
|
return e.replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
|
|
402
423
|
}
|
|
403
|
-
function
|
|
404
|
-
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[
|
|
424
|
+
function rn(e) {
|
|
425
|
+
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[nn(n)] = e[n]), t), {});
|
|
405
426
|
}
|
|
406
|
-
function
|
|
427
|
+
function an(e, t) {
|
|
407
428
|
return Array.isArray(e) && e.splice(t, 1), e;
|
|
408
429
|
}
|
|
409
|
-
function
|
|
430
|
+
function on(e, t, n) {
|
|
410
431
|
return Array.isArray(e) && e.splice(t, 0, n), e;
|
|
411
432
|
}
|
|
412
|
-
function
|
|
433
|
+
function sn(e) {
|
|
413
434
|
return e === void 0;
|
|
414
435
|
}
|
|
415
|
-
function
|
|
436
|
+
function cn(e) {
|
|
416
437
|
return typeof e == "string";
|
|
417
438
|
}
|
|
418
|
-
function
|
|
439
|
+
function ln(e, t, n) {
|
|
419
440
|
let r = e.children[n];
|
|
420
441
|
e.insertBefore(t, r);
|
|
421
442
|
}
|
|
422
|
-
function
|
|
443
|
+
function un(e) {
|
|
423
444
|
e.parentNode && e.parentNode.removeChild(e);
|
|
424
445
|
}
|
|
425
|
-
function
|
|
446
|
+
function dn(e, t = document) {
|
|
426
447
|
let n = null;
|
|
427
|
-
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n ||
|
|
448
|
+
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n || $t(`Element not found: ${e}`), n;
|
|
428
449
|
}
|
|
429
|
-
function
|
|
450
|
+
function fn(e, t, n = null) {
|
|
430
451
|
return function(...r) {
|
|
431
452
|
return e.apply(n, r), t.apply(n, r);
|
|
432
453
|
};
|
|
433
454
|
}
|
|
434
|
-
function
|
|
435
|
-
let n =
|
|
455
|
+
function pn(e, t) {
|
|
456
|
+
let n = Xt({}, e);
|
|
436
457
|
return Object.keys(t).forEach((r) => {
|
|
437
|
-
n[r] ? n[r] =
|
|
458
|
+
n[r] ? n[r] = fn(e[r], t[r]) : n[r] = t[r];
|
|
438
459
|
}), n;
|
|
439
460
|
}
|
|
440
|
-
function
|
|
461
|
+
function mn(e) {
|
|
441
462
|
return e instanceof HTMLElement;
|
|
442
463
|
}
|
|
443
|
-
function
|
|
464
|
+
function hn(e, t) {
|
|
444
465
|
Object.keys(e).forEach((n) => {
|
|
445
466
|
t(n, e[n]);
|
|
446
467
|
});
|
|
447
468
|
}
|
|
448
|
-
function
|
|
469
|
+
function gn(e) {
|
|
449
470
|
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
450
471
|
}
|
|
451
|
-
var
|
|
452
|
-
function
|
|
472
|
+
var _n = Object.assign;
|
|
473
|
+
function vn(e, t) {
|
|
453
474
|
var n = Object.keys(e);
|
|
454
475
|
if (Object.getOwnPropertySymbols) {
|
|
455
476
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -462,23 +483,23 @@ function _n(e, t) {
|
|
|
462
483
|
function j(e) {
|
|
463
484
|
for (var t = 1; t < arguments.length; t++) {
|
|
464
485
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
465
|
-
t % 2 ?
|
|
466
|
-
|
|
467
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
486
|
+
t % 2 ? vn(Object(n), !0).forEach(function(t) {
|
|
487
|
+
bn(e, t, n[t]);
|
|
488
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vn(Object(n)).forEach(function(t) {
|
|
468
489
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
469
490
|
});
|
|
470
491
|
}
|
|
471
492
|
return e;
|
|
472
493
|
}
|
|
473
|
-
function
|
|
494
|
+
function yn(e) {
|
|
474
495
|
"@babel/helpers - typeof";
|
|
475
|
-
return
|
|
496
|
+
return yn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
476
497
|
return typeof e;
|
|
477
498
|
} : function(e) {
|
|
478
499
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
479
|
-
},
|
|
500
|
+
}, yn(e);
|
|
480
501
|
}
|
|
481
|
-
function
|
|
502
|
+
function bn(e, t, n) {
|
|
482
503
|
return t in e ? Object.defineProperty(e, t, {
|
|
483
504
|
value: n,
|
|
484
505
|
enumerable: !0,
|
|
@@ -486,45 +507,45 @@ function yn(e, t, n) {
|
|
|
486
507
|
writable: !0
|
|
487
508
|
}) : e[t] = n, e;
|
|
488
509
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
510
|
+
function xn() {
|
|
511
|
+
return xn = Object.assign || function(e) {
|
|
491
512
|
for (var t = 1; t < arguments.length; t++) {
|
|
492
513
|
var n = arguments[t];
|
|
493
514
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
494
515
|
}
|
|
495
516
|
return e;
|
|
496
|
-
},
|
|
517
|
+
}, xn.apply(this, arguments);
|
|
497
518
|
}
|
|
498
|
-
function
|
|
519
|
+
function Sn(e, t) {
|
|
499
520
|
if (e == null) return {};
|
|
500
521
|
var n = {}, r = Object.keys(e), i, a;
|
|
501
522
|
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
502
523
|
return n;
|
|
503
524
|
}
|
|
504
|
-
function
|
|
525
|
+
function Cn(e, t) {
|
|
505
526
|
if (e == null) return {};
|
|
506
|
-
var n =
|
|
527
|
+
var n = Sn(e, t), r, i;
|
|
507
528
|
if (Object.getOwnPropertySymbols) {
|
|
508
529
|
var a = Object.getOwnPropertySymbols(e);
|
|
509
530
|
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
510
531
|
}
|
|
511
532
|
return n;
|
|
512
533
|
}
|
|
513
|
-
var
|
|
514
|
-
function
|
|
534
|
+
var wn = "1.15.2";
|
|
535
|
+
function Tn(e) {
|
|
515
536
|
if (typeof window < "u" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
516
537
|
}
|
|
517
|
-
var
|
|
538
|
+
var En = Tn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Dn = Tn(/Edge/i), On = Tn(/firefox/i), kn = Tn(/safari/i) && !Tn(/chrome/i) && !Tn(/android/i), An = Tn(/iP(ad|od|hone)/i), jn = Tn(/chrome/i) && Tn(/android/i), Mn = {
|
|
518
539
|
capture: !1,
|
|
519
540
|
passive: !1
|
|
520
541
|
};
|
|
521
542
|
function M(e, t, n) {
|
|
522
|
-
e.addEventListener(t, n, !
|
|
543
|
+
e.addEventListener(t, n, !En && Mn);
|
|
523
544
|
}
|
|
524
545
|
function N(e, t, n) {
|
|
525
|
-
e.removeEventListener(t, n, !
|
|
546
|
+
e.removeEventListener(t, n, !En && Mn);
|
|
526
547
|
}
|
|
527
|
-
function
|
|
548
|
+
function Nn(e, t) {
|
|
528
549
|
if (t) {
|
|
529
550
|
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
530
551
|
if (e.matches) return e.matches(t);
|
|
@@ -536,22 +557,22 @@ function Mn(e, t) {
|
|
|
536
557
|
return !1;
|
|
537
558
|
}
|
|
538
559
|
}
|
|
539
|
-
function
|
|
560
|
+
function Pn(e) {
|
|
540
561
|
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
541
562
|
}
|
|
542
563
|
function P(e, t, n, r) {
|
|
543
564
|
if (e) {
|
|
544
565
|
n ||= document;
|
|
545
566
|
do {
|
|
546
|
-
if (t != null && (t[0] === ">" ? e.parentNode === n &&
|
|
567
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && Nn(e, t) : Nn(e, t)) || r && e === n) return e;
|
|
547
568
|
if (e === n) break;
|
|
548
|
-
} while (e =
|
|
569
|
+
} while (e = Pn(e));
|
|
549
570
|
}
|
|
550
571
|
return null;
|
|
551
572
|
}
|
|
552
|
-
var
|
|
573
|
+
var Fn = /\s+/g;
|
|
553
574
|
function F(e, t, n) {
|
|
554
|
-
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(
|
|
575
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(Fn, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(Fn, " "));
|
|
555
576
|
}
|
|
556
577
|
function I(e, t, n) {
|
|
557
578
|
var r = e && e.style;
|
|
@@ -560,7 +581,7 @@ function I(e, t, n) {
|
|
|
560
581
|
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
561
582
|
}
|
|
562
583
|
}
|
|
563
|
-
function
|
|
584
|
+
function In(e, t) {
|
|
564
585
|
var n = "";
|
|
565
586
|
if (typeof e == "string") n = e;
|
|
566
587
|
else do {
|
|
@@ -570,7 +591,7 @@ function Fn(e, t) {
|
|
|
570
591
|
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
571
592
|
return i && new i(n);
|
|
572
593
|
}
|
|
573
|
-
function
|
|
594
|
+
function Ln(e, t, n) {
|
|
574
595
|
if (e) {
|
|
575
596
|
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
576
597
|
if (n) for (; i < a; i++) n(r[i], i);
|
|
@@ -584,7 +605,7 @@ function L() {
|
|
|
584
605
|
function R(e, t, n, r, i) {
|
|
585
606
|
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
586
607
|
var a, o, s, c, l, u, d;
|
|
587
|
-
if (e !== window && e.parentNode && e !== L() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !
|
|
608
|
+
if (e !== window && e.parentNode && e !== L() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !En)) do
|
|
588
609
|
if (i && i.getBoundingClientRect && (I(i, "transform") !== "none" || n && I(i, "position") !== "static")) {
|
|
589
610
|
var f = i.getBoundingClientRect();
|
|
590
611
|
o -= f.top + parseInt(I(i, "border-top-width")), s -= f.left + parseInt(I(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
@@ -592,7 +613,7 @@ function R(e, t, n, r, i) {
|
|
|
592
613
|
}
|
|
593
614
|
while (i = i.parentNode);
|
|
594
615
|
if (r && e !== window) {
|
|
595
|
-
var p =
|
|
616
|
+
var p = In(i || e), m = p && p.a, h = p && p.d;
|
|
596
617
|
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
597
618
|
}
|
|
598
619
|
return {
|
|
@@ -605,16 +626,16 @@ function R(e, t, n, r, i) {
|
|
|
605
626
|
};
|
|
606
627
|
}
|
|
607
628
|
}
|
|
608
|
-
function
|
|
609
|
-
for (var r =
|
|
629
|
+
function Rn(e, t, n) {
|
|
630
|
+
for (var r = Un(e, !0), i = R(e)[t]; r;) {
|
|
610
631
|
var a = R(r)[n], o = void 0;
|
|
611
632
|
if (o = i >= a, !o) return r;
|
|
612
633
|
if (r === L()) break;
|
|
613
|
-
r =
|
|
634
|
+
r = Un(r, !1);
|
|
614
635
|
}
|
|
615
636
|
return !1;
|
|
616
637
|
}
|
|
617
|
-
function
|
|
638
|
+
function zn(e, t, n, r) {
|
|
618
639
|
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
619
640
|
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && P(o[a], n.draggable, e, !1)) {
|
|
620
641
|
if (i === t) return o[a];
|
|
@@ -624,31 +645,31 @@ function Rn(e, t, n, r) {
|
|
|
624
645
|
}
|
|
625
646
|
return null;
|
|
626
647
|
}
|
|
627
|
-
function
|
|
628
|
-
for (var n = e.lastElementChild; n && (n === Q.ghost || I(n, "display") === "none" || t && !
|
|
648
|
+
function Bn(e, t) {
|
|
649
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || I(n, "display") === "none" || t && !Nn(n, t));) n = n.previousElementSibling;
|
|
629
650
|
return n || null;
|
|
630
651
|
}
|
|
631
652
|
function z(e, t) {
|
|
632
653
|
var n = 0;
|
|
633
654
|
if (!e || !e.parentNode) return -1;
|
|
634
|
-
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t ||
|
|
655
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || Nn(e, t)) && n++;
|
|
635
656
|
return n;
|
|
636
657
|
}
|
|
637
|
-
function
|
|
658
|
+
function Vn(e) {
|
|
638
659
|
var t = 0, n = 0, r = L();
|
|
639
660
|
if (e) do {
|
|
640
|
-
var i =
|
|
661
|
+
var i = In(e), a = i.a, o = i.d;
|
|
641
662
|
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
642
663
|
} while (e !== r && (e = e.parentNode));
|
|
643
664
|
return [t, n];
|
|
644
665
|
}
|
|
645
|
-
function
|
|
666
|
+
function Hn(e, t) {
|
|
646
667
|
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
647
668
|
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
648
669
|
}
|
|
649
670
|
return -1;
|
|
650
671
|
}
|
|
651
|
-
function
|
|
672
|
+
function Un(e, t) {
|
|
652
673
|
if (!e || !e.getBoundingClientRect) return L();
|
|
653
674
|
var n = e, r = !1;
|
|
654
675
|
do
|
|
@@ -663,35 +684,35 @@ function Hn(e, t) {
|
|
|
663
684
|
while (n = n.parentNode);
|
|
664
685
|
return L();
|
|
665
686
|
}
|
|
666
|
-
function
|
|
687
|
+
function Wn(e, t) {
|
|
667
688
|
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
668
689
|
return e;
|
|
669
690
|
}
|
|
670
|
-
function
|
|
691
|
+
function Gn(e, t) {
|
|
671
692
|
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
|
|
672
693
|
}
|
|
673
|
-
var
|
|
674
|
-
function
|
|
694
|
+
var Kn;
|
|
695
|
+
function qn(e, t) {
|
|
675
696
|
return function() {
|
|
676
|
-
if (!
|
|
697
|
+
if (!Kn) {
|
|
677
698
|
var n = arguments, r = this;
|
|
678
|
-
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n),
|
|
679
|
-
|
|
699
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), Kn = setTimeout(function() {
|
|
700
|
+
Kn = void 0;
|
|
680
701
|
}, t);
|
|
681
702
|
}
|
|
682
703
|
};
|
|
683
704
|
}
|
|
684
|
-
function
|
|
685
|
-
clearTimeout(
|
|
705
|
+
function Jn() {
|
|
706
|
+
clearTimeout(Kn), Kn = void 0;
|
|
686
707
|
}
|
|
687
|
-
function
|
|
708
|
+
function Yn(e, t, n) {
|
|
688
709
|
e.scrollLeft += t, e.scrollTop += n;
|
|
689
710
|
}
|
|
690
|
-
function
|
|
711
|
+
function Xn(e) {
|
|
691
712
|
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
692
713
|
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
693
714
|
}
|
|
694
|
-
function
|
|
715
|
+
function Zn(e, t, n) {
|
|
695
716
|
var r = {};
|
|
696
717
|
return Array.from(e.children).forEach(function(i) {
|
|
697
718
|
if (!(!P(i, t.draggable, e, !1) || i.animated || i === n)) {
|
|
@@ -701,7 +722,7 @@ function Xn(e, t, n) {
|
|
|
701
722
|
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
702
723
|
}
|
|
703
724
|
var B = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
704
|
-
function
|
|
725
|
+
function Qn() {
|
|
705
726
|
var e = [], t;
|
|
706
727
|
return {
|
|
707
728
|
captureAnimationState: function() {
|
|
@@ -713,7 +734,7 @@ function Zn() {
|
|
|
713
734
|
});
|
|
714
735
|
var n = j({}, e[e.length - 1].rect);
|
|
715
736
|
if (t.thisAnimationDuration) {
|
|
716
|
-
var r =
|
|
737
|
+
var r = In(t, !0);
|
|
717
738
|
r && (n.top -= r.f, n.left -= r.e);
|
|
718
739
|
}
|
|
719
740
|
t.fromRect = n;
|
|
@@ -724,7 +745,7 @@ function Zn() {
|
|
|
724
745
|
e.push(t);
|
|
725
746
|
},
|
|
726
747
|
removeAnimationState: function(t) {
|
|
727
|
-
e.splice(
|
|
748
|
+
e.splice(Hn(e, { target: t }), 1);
|
|
728
749
|
},
|
|
729
750
|
animateAll: function(n) {
|
|
730
751
|
var r = this;
|
|
@@ -734,8 +755,8 @@ function Zn() {
|
|
|
734
755
|
}
|
|
735
756
|
var i = !1, a = 0;
|
|
736
757
|
e.forEach(function(e) {
|
|
737
|
-
var t = 0, n = e.target, o = n.fromRect, s = R(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d =
|
|
738
|
-
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration &&
|
|
758
|
+
var t = 0, n = e.target, o = n.fromRect, s = R(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = In(n, !0);
|
|
759
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Gn(c, s) && !Gn(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = er(u, c, l, r.options)), Gn(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() {
|
|
739
760
|
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
740
761
|
}, t), n.thisAnimationDuration = t);
|
|
741
762
|
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
@@ -745,26 +766,26 @@ function Zn() {
|
|
|
745
766
|
animate: function(e, t, n, r) {
|
|
746
767
|
if (r) {
|
|
747
768
|
I(e, "transition", ""), I(e, "transform", "");
|
|
748
|
-
var i =
|
|
749
|
-
e.animatingX = !!s, e.animatingY = !!c, I(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy =
|
|
769
|
+
var i = In(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
770
|
+
e.animatingX = !!s, e.animatingY = !!c, I(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = $n(e), I(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), I(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
750
771
|
I(e, "transition", ""), I(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
751
772
|
}, r);
|
|
752
773
|
}
|
|
753
774
|
}
|
|
754
775
|
};
|
|
755
776
|
}
|
|
756
|
-
function
|
|
777
|
+
function $n(e) {
|
|
757
778
|
return e.offsetWidth;
|
|
758
779
|
}
|
|
759
|
-
function
|
|
780
|
+
function er(e, t, n, r) {
|
|
760
781
|
return Math.sqrt((t.top - e.top) ** 2 + (t.left - e.left) ** 2) / Math.sqrt((t.top - n.top) ** 2 + (t.left - n.left) ** 2) * r.animation;
|
|
761
782
|
}
|
|
762
|
-
var
|
|
783
|
+
var tr = [], nr = { initializeByDefault: !0 }, rr = {
|
|
763
784
|
mount: function(e) {
|
|
764
|
-
for (var t in
|
|
765
|
-
|
|
785
|
+
for (var t in nr) nr.hasOwnProperty(t) && !(t in e) && (e[t] = nr[t]);
|
|
786
|
+
tr.forEach(function(t) {
|
|
766
787
|
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
767
|
-
}),
|
|
788
|
+
}), tr.push(e);
|
|
768
789
|
},
|
|
769
790
|
pluginEvent: function(e, t, n) {
|
|
770
791
|
var r = this;
|
|
@@ -772,16 +793,16 @@ var er = [], tr = { initializeByDefault: !0 }, nr = {
|
|
|
772
793
|
r.eventCanceled = !0;
|
|
773
794
|
};
|
|
774
795
|
var i = e + "Global";
|
|
775
|
-
|
|
796
|
+
tr.forEach(function(r) {
|
|
776
797
|
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](j({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](j({ sortable: t }, n)));
|
|
777
798
|
});
|
|
778
799
|
},
|
|
779
800
|
initializePlugins: function(e, t, n, r) {
|
|
780
|
-
for (var i in
|
|
801
|
+
for (var i in tr.forEach(function(r) {
|
|
781
802
|
var i = r.pluginName;
|
|
782
803
|
if (!(!e.options[i] && !r.initializeByDefault)) {
|
|
783
804
|
var a = new r(e, t, e.options);
|
|
784
|
-
a.sortable = e, a.options = e.options, e[i] = a,
|
|
805
|
+
a.sortable = e, a.options = e.options, e[i] = a, xn(n, a.defaults);
|
|
785
806
|
}
|
|
786
807
|
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
787
808
|
var a = this.modifyOption(e, i, e.options[i]);
|
|
@@ -790,56 +811,56 @@ var er = [], tr = { initializeByDefault: !0 }, nr = {
|
|
|
790
811
|
},
|
|
791
812
|
getEventProperties: function(e, t) {
|
|
792
813
|
var n = {};
|
|
793
|
-
return
|
|
794
|
-
typeof r.eventProperties == "function" &&
|
|
814
|
+
return tr.forEach(function(r) {
|
|
815
|
+
typeof r.eventProperties == "function" && xn(n, r.eventProperties.call(t[r.pluginName], e));
|
|
795
816
|
}), n;
|
|
796
817
|
},
|
|
797
818
|
modifyOption: function(e, t, n) {
|
|
798
819
|
var r;
|
|
799
|
-
return
|
|
820
|
+
return tr.forEach(function(i) {
|
|
800
821
|
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
801
822
|
}), r;
|
|
802
823
|
}
|
|
803
824
|
};
|
|
804
|
-
function
|
|
825
|
+
function ir(e) {
|
|
805
826
|
var t = e.sortable, n = e.rootEl, r = e.name, i = e.targetEl, a = e.cloneEl, o = e.toEl, s = e.fromEl, c = e.oldIndex, l = e.newIndex, u = e.oldDraggableIndex, d = e.newDraggableIndex, f = e.originalEvent, p = e.putSortable, m = e.extraEventProperties;
|
|
806
827
|
if (t ||= n && n[B], t) {
|
|
807
828
|
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
808
|
-
window.CustomEvent && !
|
|
829
|
+
window.CustomEvent && !En && !Dn ? h = new CustomEvent(r, {
|
|
809
830
|
bubbles: !0,
|
|
810
831
|
cancelable: !0
|
|
811
832
|
}) : (h = document.createEvent("Event"), h.initEvent(r, !0, !0)), h.to = o || n, h.from = s || n, h.item = i || n, h.clone = a, h.oldIndex = c, h.newIndex = l, h.oldDraggableIndex = u, h.newDraggableIndex = d, h.originalEvent = f, h.pullMode = p ? p.lastPutMode : void 0;
|
|
812
|
-
var v = j(j({}, m),
|
|
833
|
+
var v = j(j({}, m), rr.getEventProperties(r, t));
|
|
813
834
|
for (var y in v) h[y] = v[y];
|
|
814
835
|
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
815
836
|
}
|
|
816
837
|
}
|
|
817
|
-
var
|
|
818
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i =
|
|
819
|
-
|
|
838
|
+
var ar = ["evt"], V = function(e, t) {
|
|
839
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = Cn(n, ar);
|
|
840
|
+
rr.pluginEvent.bind(Q)(e, t, j({
|
|
820
841
|
dragEl: U,
|
|
821
842
|
parentEl: W,
|
|
822
843
|
ghostEl: G,
|
|
823
844
|
rootEl: K,
|
|
824
|
-
nextEl:
|
|
825
|
-
lastDownEl:
|
|
845
|
+
nextEl: or,
|
|
846
|
+
lastDownEl: sr,
|
|
826
847
|
cloneEl: q,
|
|
827
|
-
cloneHidden:
|
|
828
|
-
dragStarted:
|
|
848
|
+
cloneHidden: cr,
|
|
849
|
+
dragStarted: xr,
|
|
829
850
|
putSortable: Y,
|
|
830
851
|
activeSortable: Q.active,
|
|
831
852
|
originalEvent: r,
|
|
832
|
-
oldIndex:
|
|
833
|
-
oldDraggableIndex:
|
|
853
|
+
oldIndex: lr,
|
|
854
|
+
oldDraggableIndex: ur,
|
|
834
855
|
newIndex: J,
|
|
835
|
-
newDraggableIndex:
|
|
836
|
-
hideGhostForTarget:
|
|
837
|
-
unhideGhostForTarget:
|
|
856
|
+
newDraggableIndex: dr,
|
|
857
|
+
hideGhostForTarget: zr,
|
|
858
|
+
unhideGhostForTarget: Br,
|
|
838
859
|
cloneNowHidden: function() {
|
|
839
|
-
|
|
860
|
+
cr = !0;
|
|
840
861
|
},
|
|
841
862
|
cloneNowShown: function() {
|
|
842
|
-
|
|
863
|
+
cr = !1;
|
|
843
864
|
},
|
|
844
865
|
dispatchSortableEvent: function(e) {
|
|
845
866
|
H({
|
|
@@ -851,45 +872,45 @@ var ir = ["evt"], V = function(e, t) {
|
|
|
851
872
|
}, i));
|
|
852
873
|
};
|
|
853
874
|
function H(e) {
|
|
854
|
-
|
|
875
|
+
ir(j({
|
|
855
876
|
putSortable: Y,
|
|
856
877
|
cloneEl: q,
|
|
857
878
|
targetEl: U,
|
|
858
879
|
rootEl: K,
|
|
859
|
-
oldIndex:
|
|
860
|
-
oldDraggableIndex:
|
|
880
|
+
oldIndex: lr,
|
|
881
|
+
oldDraggableIndex: ur,
|
|
861
882
|
newIndex: J,
|
|
862
|
-
newDraggableIndex:
|
|
883
|
+
newDraggableIndex: dr
|
|
863
884
|
}, e));
|
|
864
885
|
}
|
|
865
|
-
var U, W, G, K,
|
|
866
|
-
if (
|
|
867
|
-
if (
|
|
886
|
+
var U, W, G, K, or, sr, q, cr, lr, J, ur, dr, fr, Y, pr = !1, mr = !1, hr = [], gr, X, _r, vr, yr, br, xr, Sr, Cr, wr = !1, Tr = !1, Er, Z, Dr = [], Or = !1, kr = [], Ar = typeof document < "u", jr = An, Mr = Dn || En ? "cssFloat" : "float", Nr = Ar && !jn && !An && "draggable" in document.createElement("div"), Pr = function() {
|
|
887
|
+
if (Ar) {
|
|
888
|
+
if (En) return !1;
|
|
868
889
|
var e = document.createElement("x");
|
|
869
890
|
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
870
891
|
}
|
|
871
|
-
}(),
|
|
872
|
-
var n = I(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i =
|
|
892
|
+
}(), Fr = function(e, t) {
|
|
893
|
+
var n = I(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = zn(e, 0, t), a = zn(e, 1, t), o = i && I(i), s = a && I(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + R(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + R(a).width;
|
|
873
894
|
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
874
895
|
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
875
896
|
if (i && o.float && o.float !== "none") {
|
|
876
897
|
var u = o.float === "left" ? "left" : "right";
|
|
877
898
|
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
878
899
|
}
|
|
879
|
-
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[
|
|
880
|
-
},
|
|
900
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[Mr] === "none" || a && n[Mr] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
901
|
+
}, Ir = function(e, t, n) {
|
|
881
902
|
var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height;
|
|
882
903
|
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
883
|
-
},
|
|
904
|
+
}, Lr = function(e, t) {
|
|
884
905
|
var n;
|
|
885
|
-
return
|
|
906
|
+
return hr.some(function(r) {
|
|
886
907
|
var i = r[B].options.emptyInsertThreshold;
|
|
887
|
-
if (!(!i ||
|
|
908
|
+
if (!(!i || Bn(r))) {
|
|
888
909
|
var a = R(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
889
910
|
if (o && s) return n = r;
|
|
890
911
|
}
|
|
891
912
|
}), n;
|
|
892
|
-
},
|
|
913
|
+
}, Rr = function(e) {
|
|
893
914
|
function t(e, n) {
|
|
894
915
|
return function(r, i, a, o) {
|
|
895
916
|
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
@@ -902,31 +923,31 @@ var U, W, G, K, ar, or, q, sr, cr, J, lr, ur, dr, Y, fr = !1, pr = !1, mr = [],
|
|
|
902
923
|
};
|
|
903
924
|
}
|
|
904
925
|
var n = {}, r = e.group;
|
|
905
|
-
(!r ||
|
|
906
|
-
}, Rr = function() {
|
|
907
|
-
!Nr && G && I(G, "display", "none");
|
|
926
|
+
(!r || yn(r) != "object") && (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n;
|
|
908
927
|
}, zr = function() {
|
|
909
|
-
!
|
|
928
|
+
!Pr && G && I(G, "display", "none");
|
|
929
|
+
}, Br = function() {
|
|
930
|
+
!Pr && G && I(G, "display", "");
|
|
910
931
|
};
|
|
911
|
-
|
|
912
|
-
if (
|
|
932
|
+
Ar && !jn && document.addEventListener("click", function(e) {
|
|
933
|
+
if (mr) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), mr = !1, !1;
|
|
913
934
|
}, !0);
|
|
914
|
-
var
|
|
935
|
+
var Vr = function(e) {
|
|
915
936
|
if (U) {
|
|
916
937
|
e = e.touches ? e.touches[0] : e;
|
|
917
|
-
var t =
|
|
938
|
+
var t = Lr(e.clientX, e.clientY);
|
|
918
939
|
if (t) {
|
|
919
940
|
var n = {};
|
|
920
941
|
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
921
942
|
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[B]._onDragOver(n);
|
|
922
943
|
}
|
|
923
944
|
}
|
|
924
|
-
},
|
|
945
|
+
}, Hr = function(e) {
|
|
925
946
|
U && U.parentNode[B]._isOutsideThisEl(e.target);
|
|
926
947
|
};
|
|
927
948
|
function Q(e, t) {
|
|
928
949
|
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
929
|
-
this.el = e, this.options = t =
|
|
950
|
+
this.el = e, this.options = t = xn({}, t), e[B] = this;
|
|
930
951
|
var n = {
|
|
931
952
|
group: null,
|
|
932
953
|
sort: !0,
|
|
@@ -939,7 +960,7 @@ function Q(e, t) {
|
|
|
939
960
|
invertedSwapThreshold: null,
|
|
940
961
|
removeCloneOnHide: !0,
|
|
941
962
|
direction: function() {
|
|
942
|
-
return
|
|
963
|
+
return Fr(e, this.options);
|
|
943
964
|
},
|
|
944
965
|
ghostClass: "sortable-ghost",
|
|
945
966
|
chosenClass: "sortable-chosen",
|
|
@@ -966,17 +987,17 @@ function Q(e, t) {
|
|
|
966
987
|
x: 0,
|
|
967
988
|
y: 0
|
|
968
989
|
},
|
|
969
|
-
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !
|
|
990
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !kn,
|
|
970
991
|
emptyInsertThreshold: 5
|
|
971
992
|
};
|
|
972
|
-
for (var r in
|
|
973
|
-
for (var i in
|
|
974
|
-
this.nativeDraggable = t.forceFallback ? !1 :
|
|
993
|
+
for (var r in rr.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
994
|
+
for (var i in Rr(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
995
|
+
this.nativeDraggable = t.forceFallback ? !1 : Nr, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? M(e, "pointerdown", this._onTapStart) : (M(e, "mousedown", this._onTapStart), M(e, "touchstart", this._onTapStart)), this.nativeDraggable && (M(e, "dragover", this), M(e, "dragenter", this)), hr.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), xn(this, Qn());
|
|
975
996
|
}
|
|
976
997
|
Q.prototype = {
|
|
977
998
|
constructor: Q,
|
|
978
999
|
_isOutsideThisEl: function(e) {
|
|
979
|
-
!this.el.contains(e) && e !== this.el && (
|
|
1000
|
+
!this.el.contains(e) && e !== this.el && (Sr = null);
|
|
980
1001
|
},
|
|
981
1002
|
_getDirection: function(e, t) {
|
|
982
1003
|
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, U) : this.options.direction;
|
|
@@ -984,8 +1005,8 @@ Q.prototype = {
|
|
|
984
1005
|
_onTapStart: function(e) {
|
|
985
1006
|
if (e.cancelable) {
|
|
986
1007
|
var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
|
|
987
|
-
if (
|
|
988
|
-
if (
|
|
1008
|
+
if (Qr(n), !U && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && kn && s && s.tagName.toUpperCase() === "SELECT") && (s = P(s, r.draggable, n, !1), !(s && s.animated) && sr !== s)) {
|
|
1009
|
+
if (lr = z(s), ur = z(s, r.draggable), typeof l == "function") {
|
|
989
1010
|
if (l.call(this, e, s, this)) {
|
|
990
1011
|
H({
|
|
991
1012
|
sortable: t,
|
|
@@ -1018,23 +1039,23 @@ Q.prototype = {
|
|
|
1018
1039
|
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
1019
1040
|
if (n && !U && n.parentNode === i) {
|
|
1020
1041
|
var c = R(n);
|
|
1021
|
-
if (K = i, U = n, W = U.parentNode,
|
|
1042
|
+
if (K = i, U = n, W = U.parentNode, or = U.nextSibling, sr = n, fr = a.group, Q.dragged = U, gr = {
|
|
1022
1043
|
target: U,
|
|
1023
1044
|
clientX: (t || e).clientX,
|
|
1024
1045
|
clientY: (t || e).clientY
|
|
1025
|
-
},
|
|
1046
|
+
}, yr = gr.clientX - c.left, br = gr.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, U.style["will-change"] = "all", s = function() {
|
|
1026
1047
|
if (V("delayEnded", r, { evt: e }), Q.eventCanceled) {
|
|
1027
1048
|
r._onDrop();
|
|
1028
1049
|
return;
|
|
1029
1050
|
}
|
|
1030
|
-
r._disableDelayedDragEvents(), !
|
|
1051
|
+
r._disableDelayedDragEvents(), !On && r.nativeDraggable && (U.draggable = !0), r._triggerDragStart(e, t), H({
|
|
1031
1052
|
sortable: r,
|
|
1032
1053
|
name: "choose",
|
|
1033
1054
|
originalEvent: e
|
|
1034
1055
|
}), F(U, a.chosenClass, !0);
|
|
1035
1056
|
}, a.ignore.split(",").forEach(function(e) {
|
|
1036
|
-
|
|
1037
|
-
}), M(o, "dragover",
|
|
1057
|
+
Ln(U, e.trim(), Gr);
|
|
1058
|
+
}), M(o, "dragover", Vr), M(o, "mousemove", Vr), M(o, "touchmove", Vr), M(o, "mouseup", r._onDrop), M(o, "touchend", r._onDrop), M(o, "touchcancel", r._onDrop), On && this.nativeDraggable && (this.options.touchStartThreshold = 4, U.draggable = !0), V("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Dn || En))) {
|
|
1038
1059
|
if (Q.eventCanceled) {
|
|
1039
1060
|
this._onDrop();
|
|
1040
1061
|
return;
|
|
@@ -1048,7 +1069,7 @@ Q.prototype = {
|
|
|
1048
1069
|
Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
1049
1070
|
},
|
|
1050
1071
|
_disableDelayedDrag: function() {
|
|
1051
|
-
U &&
|
|
1072
|
+
U && Gr(U), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
1052
1073
|
},
|
|
1053
1074
|
_disableDelayedDragEvents: function() {
|
|
1054
1075
|
var e = this.el.ownerDocument;
|
|
@@ -1057,14 +1078,14 @@ Q.prototype = {
|
|
|
1057
1078
|
_triggerDragStart: function(e, t) {
|
|
1058
1079
|
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? M(document, "pointermove", this._onTouchMove) : t ? M(document, "touchmove", this._onTouchMove) : M(document, "mousemove", this._onTouchMove) : (M(U, "dragend", this), M(K, "dragstart", this._onDragStart));
|
|
1059
1080
|
try {
|
|
1060
|
-
document.selection ?
|
|
1081
|
+
document.selection ? $r(function() {
|
|
1061
1082
|
document.selection.empty();
|
|
1062
1083
|
}) : window.getSelection().removeAllRanges();
|
|
1063
1084
|
} catch {}
|
|
1064
1085
|
},
|
|
1065
1086
|
_dragStarted: function(e, t) {
|
|
1066
|
-
if (
|
|
1067
|
-
V("dragStarted", this, { evt: t }), this.nativeDraggable && M(document, "dragover",
|
|
1087
|
+
if (pr = !1, K && U) {
|
|
1088
|
+
V("dragStarted", this, { evt: t }), this.nativeDraggable && M(document, "dragover", Hr);
|
|
1068
1089
|
var n = this.options;
|
|
1069
1090
|
!e && F(U, n.dragClass, !1), F(U, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), H({
|
|
1070
1091
|
sortable: this,
|
|
@@ -1075,7 +1096,7 @@ Q.prototype = {
|
|
|
1075
1096
|
},
|
|
1076
1097
|
_emulateDragOver: function() {
|
|
1077
1098
|
if (X) {
|
|
1078
|
-
this._lastX = X.clientX, this._lastY = X.clientY,
|
|
1099
|
+
this._lastX = X.clientX, this._lastY = X.clientY, zr();
|
|
1079
1100
|
for (var e = document.elementFromPoint(X.clientX, X.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(X.clientX, X.clientY), e !== t);) t = e;
|
|
1080
1101
|
if (U.parentNode[B]._isOutsideThisEl(e), t) do {
|
|
1081
1102
|
if (t[B]) {
|
|
@@ -1089,18 +1110,18 @@ Q.prototype = {
|
|
|
1089
1110
|
}
|
|
1090
1111
|
e = t;
|
|
1091
1112
|
} while (t = t.parentNode);
|
|
1092
|
-
|
|
1113
|
+
Br();
|
|
1093
1114
|
}
|
|
1094
1115
|
},
|
|
1095
1116
|
_onTouchMove: function(e) {
|
|
1096
|
-
if (
|
|
1097
|
-
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = G &&
|
|
1098
|
-
if (!Q.active && !
|
|
1117
|
+
if (gr) {
|
|
1118
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = G && In(G, !0), o = G && a && a.a, s = G && a && a.d, c = jr && Z && Vn(Z), l = (i.clientX - gr.clientX + r.x) / (o || 1) + (c ? c[0] - Dr[0] : 0) / (o || 1), u = (i.clientY - gr.clientY + r.y) / (s || 1) + (c ? c[1] - Dr[1] : 0) / (s || 1);
|
|
1119
|
+
if (!Q.active && !pr) {
|
|
1099
1120
|
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
1100
1121
|
this._onDragStart(e, !0);
|
|
1101
1122
|
}
|
|
1102
1123
|
if (G) {
|
|
1103
|
-
a ? (a.e += l - (
|
|
1124
|
+
a ? (a.e += l - (_r || 0), a.f += u - (vr || 0)) : a = {
|
|
1104
1125
|
a: 1,
|
|
1105
1126
|
b: 0,
|
|
1106
1127
|
c: 0,
|
|
@@ -1109,19 +1130,19 @@ Q.prototype = {
|
|
|
1109
1130
|
f: u
|
|
1110
1131
|
};
|
|
1111
1132
|
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
1112
|
-
I(G, "webkitTransform", d), I(G, "mozTransform", d), I(G, "msTransform", d), I(G, "transform", d),
|
|
1133
|
+
I(G, "webkitTransform", d), I(G, "mozTransform", d), I(G, "msTransform", d), I(G, "transform", d), _r = l, vr = u, X = i;
|
|
1113
1134
|
}
|
|
1114
1135
|
e.cancelable && e.preventDefault();
|
|
1115
1136
|
}
|
|
1116
1137
|
},
|
|
1117
1138
|
_appendGhost: function() {
|
|
1118
1139
|
if (!G) {
|
|
1119
|
-
var e = this.options.fallbackOnBody ? document.body : K, t = R(U, !0,
|
|
1120
|
-
if (
|
|
1140
|
+
var e = this.options.fallbackOnBody ? document.body : K, t = R(U, !0, jr, !0, e), n = this.options;
|
|
1141
|
+
if (jr) {
|
|
1121
1142
|
for (Z = e; I(Z, "position") === "static" && I(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
1122
|
-
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = L()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = L(),
|
|
1143
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = L()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = L(), Dr = Vn(Z);
|
|
1123
1144
|
}
|
|
1124
|
-
G = U.cloneNode(!0), F(G, n.ghostClass, !1), F(G, n.fallbackClass, !0), F(G, n.dragClass, !0), I(G, "transition", ""), I(G, "transform", ""), I(G, "box-sizing", "border-box"), I(G, "margin", 0), I(G, "top", t.top), I(G, "left", t.left), I(G, "width", t.width), I(G, "height", t.height), I(G, "opacity", "0.8"), I(G, "position",
|
|
1145
|
+
G = U.cloneNode(!0), F(G, n.ghostClass, !1), F(G, n.fallbackClass, !0), F(G, n.dragClass, !0), I(G, "transition", ""), I(G, "transform", ""), I(G, "box-sizing", "border-box"), I(G, "margin", 0), I(G, "top", t.top), I(G, "left", t.left), I(G, "width", t.width), I(G, "height", t.height), I(G, "opacity", "0.8"), I(G, "position", jr ? "absolute" : "fixed"), I(G, "zIndex", "100000"), I(G, "pointerEvents", "none"), Q.ghost = G, e.appendChild(G), I(G, "transform-origin", yr / parseInt(G.style.width) * 100 + "% " + br / parseInt(G.style.height) * 100 + "%");
|
|
1125
1146
|
}
|
|
1126
1147
|
},
|
|
1127
1148
|
_onDragStart: function(e, t) {
|
|
@@ -1130,16 +1151,16 @@ Q.prototype = {
|
|
|
1130
1151
|
this._onDrop();
|
|
1131
1152
|
return;
|
|
1132
1153
|
}
|
|
1133
|
-
V("setupClone", this), Q.eventCanceled || (q =
|
|
1154
|
+
V("setupClone", this), Q.eventCanceled || (q = Xn(U), q.removeAttribute("id"), q.draggable = !1, q.style["will-change"] = "", this._hideClone(), F(q, this.options.chosenClass, !1), Q.clone = q), n.cloneId = $r(function() {
|
|
1134
1155
|
V("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || K.insertBefore(q, U), n._hideClone(), H({
|
|
1135
1156
|
sortable: n,
|
|
1136
1157
|
name: "clone"
|
|
1137
1158
|
}));
|
|
1138
|
-
}), !t && F(U, i.dragClass, !0), t ? (
|
|
1159
|
+
}), !t && F(U, i.dragClass, !0), t ? (mr = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (N(document, "mouseup", n._onDrop), N(document, "touchend", n._onDrop), N(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, U)), M(document, "drop", n), I(U, "transform", "translateZ(0)")), pr = !0, n._dragStartId = $r(n._dragStarted.bind(n, t, e)), M(document, "selectstart", n), xr = !0, kn && I(document.body, "user-select", "none");
|
|
1139
1160
|
},
|
|
1140
1161
|
_onDragOver: function(e) {
|
|
1141
|
-
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l =
|
|
1142
|
-
if (
|
|
1162
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = fr === s, u = o.sort, d = Y || c, f, p = this, m = !1;
|
|
1163
|
+
if (Or) return;
|
|
1143
1164
|
function h(o, s) {
|
|
1144
1165
|
V(o, p, j({
|
|
1145
1166
|
evt: e,
|
|
@@ -1153,7 +1174,7 @@ Q.prototype = {
|
|
|
1153
1174
|
target: n,
|
|
1154
1175
|
completed: _,
|
|
1155
1176
|
onMove: function(n, i) {
|
|
1156
|
-
return
|
|
1177
|
+
return Wr(K, t, U, r, n, R(n), e, i);
|
|
1157
1178
|
},
|
|
1158
1179
|
changed: v
|
|
1159
1180
|
}, s));
|
|
@@ -1164,35 +1185,35 @@ Q.prototype = {
|
|
|
1164
1185
|
function _(r) {
|
|
1165
1186
|
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (F(U, Y ? Y.options.ghostClass : c.options.ghostClass, !1), F(U, o.ghostClass, !0)), Y !== p && p !== Q.active ? Y = p : p === Q.active && Y && (Y = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
1166
1187
|
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
1167
|
-
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === U && !U.animated || n === t && !n.animated) && (
|
|
1188
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === U && !U.animated || n === t && !n.animated) && (Sr = null), !o.dragoverBubble && !e.rootEl && n !== document && (U.parentNode[B]._isOutsideThisEl(e.target), !r && Vr(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
1168
1189
|
}
|
|
1169
1190
|
function v() {
|
|
1170
|
-
J = z(U),
|
|
1191
|
+
J = z(U), dr = z(U, o.draggable), H({
|
|
1171
1192
|
sortable: p,
|
|
1172
1193
|
name: "change",
|
|
1173
1194
|
toEl: t,
|
|
1174
1195
|
newIndex: J,
|
|
1175
|
-
newDraggableIndex:
|
|
1196
|
+
newDraggableIndex: dr,
|
|
1176
1197
|
originalEvent: e
|
|
1177
1198
|
});
|
|
1178
1199
|
}
|
|
1179
1200
|
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = P(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
1180
1201
|
if (U.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
1181
|
-
if (
|
|
1202
|
+
if (mr = !1, c && !o.disabled && (l ? u || (a = W !== K) : Y === this || (this.lastPutMode = fr.checkPull(this, c, U, e)) && s.checkPut(this, c, U, e))) {
|
|
1182
1203
|
if (f = this._getDirection(e, n) === "vertical", r = R(U), h("dragOverValid"), Q.eventCanceled) return m;
|
|
1183
|
-
if (a) return W = K, g(), this._hideClone(), h("revert"), Q.eventCanceled || (
|
|
1184
|
-
var y =
|
|
1185
|
-
if (!y ||
|
|
1204
|
+
if (a) return W = K, g(), this._hideClone(), h("revert"), Q.eventCanceled || (or ? K.insertBefore(U, or) : K.appendChild(U)), _(!0);
|
|
1205
|
+
var y = Bn(t, o.draggable);
|
|
1206
|
+
if (!y || Jr(e, f, this) && !y.animated) {
|
|
1186
1207
|
if (y === U) return _(!1);
|
|
1187
|
-
if (y && t === e.target && (n = y), n && (i = R(n)),
|
|
1188
|
-
} else if (y &&
|
|
1189
|
-
var b =
|
|
1208
|
+
if (y && t === e.target && (n = y), n && (i = R(n)), Wr(K, t, U, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(U, y.nextSibling) : t.appendChild(U), W = t, v(), _(!0);
|
|
1209
|
+
} else if (y && qr(e, f, this)) {
|
|
1210
|
+
var b = zn(t, 0, o, !0);
|
|
1190
1211
|
if (b === U) return _(!1);
|
|
1191
|
-
if (n = b, i = R(n),
|
|
1212
|
+
if (n = b, i = R(n), Wr(K, t, U, r, n, i, e, !1) !== !1) return g(), t.insertBefore(U, b), W = t, v(), _(!0);
|
|
1192
1213
|
} else if (n.parentNode === t) {
|
|
1193
1214
|
i = R(n);
|
|
1194
|
-
var x = 0, ee, S = U.parentNode !== t, C = !
|
|
1195
|
-
|
|
1215
|
+
var x = 0, ee, S = U.parentNode !== t, C = !Ir(U.animated && U.toRect || r, n.animated && n.toRect || i, f), w = f ? "top" : "left", te = Rn(n, "top", "top") || Rn(U, "top", "top"), ne = te ? te.scrollTop : void 0;
|
|
1216
|
+
Sr !== n && (ee = i[w], wr = !1, Tr = !C && o.invertSwap || S), x = Yr(e, n, i, f, C ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Tr, Sr === n);
|
|
1196
1217
|
var T;
|
|
1197
1218
|
if (x !== 0) {
|
|
1198
1219
|
var E = z(U);
|
|
@@ -1201,11 +1222,11 @@ Q.prototype = {
|
|
|
1201
1222
|
while (T && (I(T, "display") === "none" || T === G));
|
|
1202
1223
|
}
|
|
1203
1224
|
if (x === 0 || T === n) return _(!1);
|
|
1204
|
-
|
|
1225
|
+
Sr = n, Cr = x;
|
|
1205
1226
|
var re = n.nextElementSibling, D = !1;
|
|
1206
1227
|
D = x === 1;
|
|
1207
|
-
var ie =
|
|
1208
|
-
if (ie !== !1) return (ie === 1 || ie === -1) && (D = ie === 1),
|
|
1228
|
+
var ie = Wr(K, t, U, r, n, i, e, D);
|
|
1229
|
+
if (ie !== !1) return (ie === 1 || ie === -1) && (D = ie === 1), Or = !0, setTimeout(Kr, 30), g(), D && !re ? t.appendChild(U) : n.parentNode.insertBefore(U, D ? re : n), te && Yn(te, 0, ne - te.scrollTop), W = U.parentNode, ee !== void 0 && !Tr && (Er = Math.abs(ee - R(n)[w])), v(), _(!0);
|
|
1209
1230
|
}
|
|
1210
1231
|
if (t.contains(U)) return _(!1);
|
|
1211
1232
|
}
|
|
@@ -1213,7 +1234,7 @@ Q.prototype = {
|
|
|
1213
1234
|
},
|
|
1214
1235
|
_ignoreWhileAnimating: null,
|
|
1215
1236
|
_offMoveEvents: function() {
|
|
1216
|
-
N(document, "mousemove", this._onTouchMove), N(document, "touchmove", this._onTouchMove), N(document, "pointermove", this._onTouchMove), N(document, "dragover",
|
|
1237
|
+
N(document, "mousemove", this._onTouchMove), N(document, "touchmove", this._onTouchMove), N(document, "pointermove", this._onTouchMove), N(document, "dragover", Vr), N(document, "mousemove", Vr), N(document, "touchmove", Vr);
|
|
1217
1238
|
},
|
|
1218
1239
|
_offUpEvents: function() {
|
|
1219
1240
|
var e = this.el.ownerDocument;
|
|
@@ -1221,18 +1242,18 @@ Q.prototype = {
|
|
|
1221
1242
|
},
|
|
1222
1243
|
_onDrop: function(e) {
|
|
1223
1244
|
var t = this.el, n = this.options;
|
|
1224
|
-
if (J = z(U),
|
|
1245
|
+
if (J = z(U), dr = z(U, n.draggable), V("drop", this, { evt: e }), W = U && U.parentNode, J = z(U), dr = z(U, n.draggable), Q.eventCanceled) {
|
|
1225
1246
|
this._nulling();
|
|
1226
1247
|
return;
|
|
1227
1248
|
}
|
|
1228
|
-
|
|
1249
|
+
pr = !1, Tr = !1, wr = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), ei(this.cloneId), ei(this._dragStartId), this.nativeDraggable && (N(document, "drop", this), N(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), kn && I(document.body, "user-select", ""), I(U, "transform", ""), e && (xr && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), G && G.parentNode && G.parentNode.removeChild(G), (K === W || Y && Y.lastPutMode !== "clone") && q && q.parentNode && q.parentNode.removeChild(q), U && (this.nativeDraggable && N(U, "dragend", this), Gr(U), U.style["will-change"] = "", xr && !pr && F(U, Y ? Y.options.ghostClass : this.options.ghostClass, !1), F(U, this.options.chosenClass, !1), H({
|
|
1229
1250
|
sortable: this,
|
|
1230
1251
|
name: "unchoose",
|
|
1231
1252
|
toEl: W,
|
|
1232
1253
|
newIndex: null,
|
|
1233
1254
|
newDraggableIndex: null,
|
|
1234
1255
|
originalEvent: e
|
|
1235
|
-
}), K === W ? J !==
|
|
1256
|
+
}), K === W ? J !== lr && J >= 0 && (H({
|
|
1236
1257
|
sortable: this,
|
|
1237
1258
|
name: "update",
|
|
1238
1259
|
toEl: W,
|
|
@@ -1264,7 +1285,7 @@ Q.prototype = {
|
|
|
1264
1285
|
name: "sort",
|
|
1265
1286
|
toEl: W,
|
|
1266
1287
|
originalEvent: e
|
|
1267
|
-
})), Y && Y.save()), Q.active && ((J == null || J === -1) && (J =
|
|
1288
|
+
})), Y && Y.save()), Q.active && ((J == null || J === -1) && (J = lr, dr = ur), H({
|
|
1268
1289
|
sortable: this,
|
|
1269
1290
|
name: "end",
|
|
1270
1291
|
toEl: W,
|
|
@@ -1272,9 +1293,9 @@ Q.prototype = {
|
|
|
1272
1293
|
}), this.save()))), this._nulling();
|
|
1273
1294
|
},
|
|
1274
1295
|
_nulling: function() {
|
|
1275
|
-
V("nulling", this), K = U = W = G =
|
|
1296
|
+
V("nulling", this), K = U = W = G = or = q = sr = cr = gr = X = xr = J = dr = lr = ur = Sr = Cr = Y = fr = Q.dragged = Q.ghost = Q.clone = Q.active = null, kr.forEach(function(e) {
|
|
1276
1297
|
e.checked = !0;
|
|
1277
|
-
}),
|
|
1298
|
+
}), kr.length = _r = vr = 0;
|
|
1278
1299
|
},
|
|
1279
1300
|
handleEvent: function(e) {
|
|
1280
1301
|
switch (e.type) {
|
|
@@ -1284,7 +1305,7 @@ Q.prototype = {
|
|
|
1284
1305
|
break;
|
|
1285
1306
|
case "dragenter":
|
|
1286
1307
|
case "dragover":
|
|
1287
|
-
U && (this._onDragOver(e),
|
|
1308
|
+
U && (this._onDragOver(e), Ur(e));
|
|
1288
1309
|
break;
|
|
1289
1310
|
case "selectstart":
|
|
1290
1311
|
e.preventDefault();
|
|
@@ -1292,7 +1313,7 @@ Q.prototype = {
|
|
|
1292
1313
|
}
|
|
1293
1314
|
},
|
|
1294
1315
|
toArray: function() {
|
|
1295
|
-
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], P(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) ||
|
|
1316
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], P(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || Zr(t));
|
|
1296
1317
|
return e;
|
|
1297
1318
|
},
|
|
1298
1319
|
sort: function(e, t) {
|
|
@@ -1314,20 +1335,20 @@ Q.prototype = {
|
|
|
1314
1335
|
option: function(e, t) {
|
|
1315
1336
|
var n = this.options;
|
|
1316
1337
|
if (t === void 0) return n[e];
|
|
1317
|
-
var r =
|
|
1318
|
-
r === void 0 ? n[e] = t : n[e] = r, e === "group" &&
|
|
1338
|
+
var r = rr.modifyOption(this, e, t);
|
|
1339
|
+
r === void 0 ? n[e] = t : n[e] = r, e === "group" && Rr(n);
|
|
1319
1340
|
},
|
|
1320
1341
|
destroy: function() {
|
|
1321
1342
|
V("destroy", this);
|
|
1322
1343
|
var e = this.el;
|
|
1323
1344
|
e[B] = null, N(e, "mousedown", this._onTapStart), N(e, "touchstart", this._onTapStart), N(e, "pointerdown", this._onTapStart), this.nativeDraggable && (N(e, "dragover", this), N(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
1324
1345
|
e.removeAttribute("draggable");
|
|
1325
|
-
}), this._onDrop(), this._disableDelayedDragEvents(),
|
|
1346
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), hr.splice(hr.indexOf(this.el), 1), this.el = e = null;
|
|
1326
1347
|
},
|
|
1327
1348
|
_hideClone: function() {
|
|
1328
|
-
if (!
|
|
1349
|
+
if (!cr) {
|
|
1329
1350
|
if (V("hideClone", this), Q.eventCanceled) return;
|
|
1330
|
-
I(q, "display", "none"), this.options.removeCloneOnHide && q.parentNode && q.parentNode.removeChild(q),
|
|
1351
|
+
I(q, "display", "none"), this.options.removeCloneOnHide && q.parentNode && q.parentNode.removeChild(q), cr = !0;
|
|
1331
1352
|
}
|
|
1332
1353
|
},
|
|
1333
1354
|
_showClone: function(e) {
|
|
@@ -1335,99 +1356,99 @@ Q.prototype = {
|
|
|
1335
1356
|
this._hideClone();
|
|
1336
1357
|
return;
|
|
1337
1358
|
}
|
|
1338
|
-
if (
|
|
1359
|
+
if (cr) {
|
|
1339
1360
|
if (V("showClone", this), Q.eventCanceled) return;
|
|
1340
|
-
U.parentNode == K && !this.options.group.revertClone ? K.insertBefore(q, U) :
|
|
1361
|
+
U.parentNode == K && !this.options.group.revertClone ? K.insertBefore(q, U) : or ? K.insertBefore(q, or) : K.appendChild(q), this.options.group.revertClone && this.animate(U, q), I(q, "display", ""), cr = !1;
|
|
1341
1362
|
}
|
|
1342
1363
|
}
|
|
1343
1364
|
};
|
|
1344
|
-
function
|
|
1365
|
+
function Ur(e) {
|
|
1345
1366
|
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
1346
1367
|
}
|
|
1347
|
-
function
|
|
1368
|
+
function Wr(e, t, n, r, i, a, o, s) {
|
|
1348
1369
|
var c, l = e[B], u = l.options.onMove, d;
|
|
1349
|
-
return window.CustomEvent && !
|
|
1370
|
+
return window.CustomEvent && !En && !Dn ? c = new CustomEvent("move", {
|
|
1350
1371
|
bubbles: !0,
|
|
1351
1372
|
cancelable: !0
|
|
1352
1373
|
}) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || R(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
1353
1374
|
}
|
|
1354
|
-
function
|
|
1375
|
+
function Gr(e) {
|
|
1355
1376
|
e.draggable = !1;
|
|
1356
1377
|
}
|
|
1357
|
-
function
|
|
1358
|
-
|
|
1378
|
+
function Kr() {
|
|
1379
|
+
Or = !1;
|
|
1359
1380
|
}
|
|
1360
|
-
function
|
|
1361
|
-
var r = R(
|
|
1381
|
+
function qr(e, t, n) {
|
|
1382
|
+
var r = R(zn(n.el, 0, n.options, !0)), i = Zn(n.el, n.options, G), a = 10;
|
|
1362
1383
|
return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left;
|
|
1363
1384
|
}
|
|
1364
|
-
function
|
|
1365
|
-
var r = R(
|
|
1385
|
+
function Jr(e, t, n) {
|
|
1386
|
+
var r = R(Bn(n.el, n.options.draggable)), i = Zn(n.el, n.options, G), a = 10;
|
|
1366
1387
|
return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top;
|
|
1367
1388
|
}
|
|
1368
|
-
function
|
|
1389
|
+
function Yr(e, t, n, r, i, a, o, s) {
|
|
1369
1390
|
var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1;
|
|
1370
1391
|
if (!o) {
|
|
1371
|
-
if (s &&
|
|
1372
|
-
if (!
|
|
1373
|
-
else if (
|
|
1374
|
-
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return
|
|
1392
|
+
if (s && Er < l * i) {
|
|
1393
|
+
if (!wr && (Cr === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (wr = !0), wr) f = !0;
|
|
1394
|
+
else if (Cr === 1 ? c < u + Er : c > d - Er) return -Cr;
|
|
1395
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return Xr(t);
|
|
1375
1396
|
}
|
|
1376
1397
|
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
1377
1398
|
}
|
|
1378
|
-
function
|
|
1399
|
+
function Xr(e) {
|
|
1379
1400
|
return z(U) < z(e) ? 1 : -1;
|
|
1380
1401
|
}
|
|
1381
|
-
function
|
|
1402
|
+
function Zr(e) {
|
|
1382
1403
|
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
1383
1404
|
return r.toString(36);
|
|
1384
1405
|
}
|
|
1385
|
-
function
|
|
1386
|
-
|
|
1406
|
+
function Qr(e) {
|
|
1407
|
+
kr.length = 0;
|
|
1387
1408
|
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
1388
1409
|
var r = t[n];
|
|
1389
|
-
r.checked &&
|
|
1410
|
+
r.checked && kr.push(r);
|
|
1390
1411
|
}
|
|
1391
1412
|
}
|
|
1392
|
-
function
|
|
1413
|
+
function $r(e) {
|
|
1393
1414
|
return setTimeout(e, 0);
|
|
1394
1415
|
}
|
|
1395
|
-
function
|
|
1416
|
+
function ei(e) {
|
|
1396
1417
|
return clearTimeout(e);
|
|
1397
1418
|
}
|
|
1398
|
-
|
|
1399
|
-
(Q.active ||
|
|
1419
|
+
Ar && M(document, "touchmove", function(e) {
|
|
1420
|
+
(Q.active || pr) && e.cancelable && e.preventDefault();
|
|
1400
1421
|
}), Q.utils = {
|
|
1401
1422
|
on: M,
|
|
1402
1423
|
off: N,
|
|
1403
1424
|
css: I,
|
|
1404
|
-
find:
|
|
1425
|
+
find: Ln,
|
|
1405
1426
|
is: function(e, t) {
|
|
1406
1427
|
return !!P(e, t, e, !1);
|
|
1407
1428
|
},
|
|
1408
|
-
extend:
|
|
1409
|
-
throttle:
|
|
1429
|
+
extend: Wn,
|
|
1430
|
+
throttle: qn,
|
|
1410
1431
|
closest: P,
|
|
1411
1432
|
toggleClass: F,
|
|
1412
|
-
clone:
|
|
1433
|
+
clone: Xn,
|
|
1413
1434
|
index: z,
|
|
1414
|
-
nextTick:
|
|
1415
|
-
cancelNextTick:
|
|
1416
|
-
detectDirection:
|
|
1417
|
-
getChild:
|
|
1435
|
+
nextTick: $r,
|
|
1436
|
+
cancelNextTick: ei,
|
|
1437
|
+
detectDirection: Fr,
|
|
1438
|
+
getChild: zn
|
|
1418
1439
|
}, Q.get = function(e) {
|
|
1419
1440
|
return e[B];
|
|
1420
1441
|
}, Q.mount = function() {
|
|
1421
1442
|
var e = [...arguments];
|
|
1422
1443
|
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
1423
1444
|
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
1424
|
-
e.utils && (Q.utils = j(j({}, Q.utils), e.utils)),
|
|
1445
|
+
e.utils && (Q.utils = j(j({}, Q.utils), e.utils)), rr.mount(e);
|
|
1425
1446
|
});
|
|
1426
1447
|
}, Q.create = function(e, t) {
|
|
1427
1448
|
return new Q(e, t);
|
|
1428
|
-
}, Q.version =
|
|
1429
|
-
var $ = [],
|
|
1430
|
-
function
|
|
1449
|
+
}, Q.version = wn;
|
|
1450
|
+
var $ = [], ti, ni, ri = !1, ii, ai, oi, si;
|
|
1451
|
+
function ci() {
|
|
1431
1452
|
function e() {
|
|
1432
1453
|
for (var e in this.defaults = {
|
|
1433
1454
|
scroll: !0,
|
|
@@ -1447,63 +1468,63 @@ function si() {
|
|
|
1447
1468
|
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
1448
1469
|
},
|
|
1449
1470
|
drop: function() {
|
|
1450
|
-
this.sortable.nativeDraggable ? N(document, "dragover", this._handleAutoScroll) : (N(document, "pointermove", this._handleFallbackAutoScroll), N(document, "touchmove", this._handleFallbackAutoScroll), N(document, "mousemove", this._handleFallbackAutoScroll)),
|
|
1471
|
+
this.sortable.nativeDraggable ? N(document, "dragover", this._handleAutoScroll) : (N(document, "pointermove", this._handleFallbackAutoScroll), N(document, "touchmove", this._handleFallbackAutoScroll), N(document, "mousemove", this._handleFallbackAutoScroll)), ui(), li(), Jn();
|
|
1451
1472
|
},
|
|
1452
1473
|
nulling: function() {
|
|
1453
|
-
|
|
1474
|
+
oi = ni = ti = ri = si = ii = ai = null, $.length = 0;
|
|
1454
1475
|
},
|
|
1455
1476
|
_handleFallbackAutoScroll: function(e) {
|
|
1456
1477
|
this._handleAutoScroll(e, !0);
|
|
1457
1478
|
},
|
|
1458
1479
|
_handleAutoScroll: function(e, t) {
|
|
1459
1480
|
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
1460
|
-
if (
|
|
1461
|
-
|
|
1462
|
-
var o =
|
|
1463
|
-
|
|
1464
|
-
var a =
|
|
1465
|
-
a !== o && (o = a,
|
|
1466
|
-
}, 10),
|
|
1481
|
+
if (oi = e, t || this.options.forceAutoScrollFallback || Dn || En || kn) {
|
|
1482
|
+
di(e, this.options, a, t);
|
|
1483
|
+
var o = Un(a, !0);
|
|
1484
|
+
ri && (!si || r !== ii || i !== ai) && (si && ui(), si = setInterval(function() {
|
|
1485
|
+
var a = Un(document.elementFromPoint(r, i), !0);
|
|
1486
|
+
a !== o && (o = a, li()), di(e, n.options, a, t);
|
|
1487
|
+
}, 10), ii = r, ai = i);
|
|
1467
1488
|
} else {
|
|
1468
|
-
if (!this.options.bubbleScroll ||
|
|
1469
|
-
|
|
1489
|
+
if (!this.options.bubbleScroll || Un(a, !0) === L()) {
|
|
1490
|
+
li();
|
|
1470
1491
|
return;
|
|
1471
1492
|
}
|
|
1472
|
-
|
|
1493
|
+
di(e, this.options, Un(a, !1), !1);
|
|
1473
1494
|
}
|
|
1474
1495
|
}
|
|
1475
|
-
},
|
|
1496
|
+
}, xn(e, {
|
|
1476
1497
|
pluginName: "scroll",
|
|
1477
1498
|
initializeByDefault: !0
|
|
1478
1499
|
});
|
|
1479
1500
|
}
|
|
1480
|
-
function
|
|
1501
|
+
function li() {
|
|
1481
1502
|
$.forEach(function(e) {
|
|
1482
1503
|
clearInterval(e.pid);
|
|
1483
1504
|
}), $ = [];
|
|
1484
1505
|
}
|
|
1485
|
-
function
|
|
1486
|
-
clearInterval(
|
|
1506
|
+
function ui() {
|
|
1507
|
+
clearInterval(si);
|
|
1487
1508
|
}
|
|
1488
|
-
var
|
|
1509
|
+
var di = qn(function(e, t, n, r) {
|
|
1489
1510
|
if (t.scroll) {
|
|
1490
1511
|
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = L(), l = !1, u;
|
|
1491
|
-
|
|
1492
|
-
var d = 0, f =
|
|
1512
|
+
ni !== n && (ni = n, li(), ti = t.scroll, u = t.scrollFn, ti === !0 && (ti = Un(n, !0)));
|
|
1513
|
+
var d = 0, f = ti;
|
|
1493
1514
|
do {
|
|
1494
1515
|
var p = f, m = R(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, ee = void 0, S = p.scrollWidth, C = p.scrollHeight, w = I(p), te = p.scrollLeft, ne = p.scrollTop;
|
|
1495
1516
|
p === c ? (x = y < S && (w.overflowX === "auto" || w.overflowX === "scroll" || w.overflowX === "visible"), ee = b < C && (w.overflowY === "auto" || w.overflowY === "scroll" || w.overflowY === "visible")) : (x = y < S && (w.overflowX === "auto" || w.overflowX === "scroll"), ee = b < C && (w.overflowY === "auto" || w.overflowY === "scroll"));
|
|
1496
1517
|
var T = x && (Math.abs(v - i) <= o && te + y < S) - (Math.abs(_ - i) <= o && !!te), E = ee && (Math.abs(g - a) <= o && ne + b < C) - (Math.abs(h - a) <= o && !!ne);
|
|
1497
1518
|
if (!$[d]) for (var re = 0; re <= d; re++) $[re] || ($[re] = {});
|
|
1498
1519
|
($[d].vx != T || $[d].vy != E || $[d].el !== p) && ($[d].el = p, $[d].vx = T, $[d].vy = E, clearInterval($[d].pid), (T != 0 || E != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
1499
|
-
r && this.layer === 0 && Q.active._onTouchMove(
|
|
1520
|
+
r && this.layer === 0 && Q.active._onTouchMove(oi);
|
|
1500
1521
|
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
1501
|
-
typeof u == "function" && u.call(Q.dragged.parentNode[B], n, t, e,
|
|
1522
|
+
typeof u == "function" && u.call(Q.dragged.parentNode[B], n, t, e, oi, $[this.layer].el) !== "continue" || Yn($[this.layer].el, n, t);
|
|
1502
1523
|
}.bind({ layer: d }), 24))), d++;
|
|
1503
|
-
} while (t.bubbleScroll && f !== c && (f =
|
|
1504
|
-
|
|
1524
|
+
} while (t.bubbleScroll && f !== c && (f = Un(f, !1)));
|
|
1525
|
+
ri = l;
|
|
1505
1526
|
}
|
|
1506
|
-
}, 30),
|
|
1527
|
+
}, 30), fi = function(e) {
|
|
1507
1528
|
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
1508
1529
|
if (t) {
|
|
1509
1530
|
var c = n || i;
|
|
@@ -1515,8 +1536,8 @@ var ui = Kn(function(e, t, n, r) {
|
|
|
1515
1536
|
}));
|
|
1516
1537
|
}
|
|
1517
1538
|
};
|
|
1518
|
-
function
|
|
1519
|
-
|
|
1539
|
+
function pi() {}
|
|
1540
|
+
pi.prototype = {
|
|
1520
1541
|
startIndex: null,
|
|
1521
1542
|
dragStart: function(e) {
|
|
1522
1543
|
var t = e.oldDraggableIndex;
|
|
@@ -1525,72 +1546,72 @@ fi.prototype = {
|
|
|
1525
1546
|
onSpill: function(e) {
|
|
1526
1547
|
var t = e.dragEl, n = e.putSortable;
|
|
1527
1548
|
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
1528
|
-
var r =
|
|
1549
|
+
var r = zn(this.sortable.el, this.startIndex, this.options);
|
|
1529
1550
|
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
1530
1551
|
},
|
|
1531
|
-
drop:
|
|
1532
|
-
},
|
|
1533
|
-
function
|
|
1534
|
-
|
|
1552
|
+
drop: fi
|
|
1553
|
+
}, xn(pi, { pluginName: "revertOnSpill" });
|
|
1554
|
+
function mi() {}
|
|
1555
|
+
mi.prototype = {
|
|
1535
1556
|
onSpill: function(e) {
|
|
1536
1557
|
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
1537
1558
|
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
1538
1559
|
},
|
|
1539
|
-
drop:
|
|
1540
|
-
},
|
|
1541
|
-
function
|
|
1560
|
+
drop: fi
|
|
1561
|
+
}, xn(mi, { pluginName: "removeOnSpill" }), Q.mount(new ci()), Q.mount(mi, pi);
|
|
1562
|
+
function hi(e) {
|
|
1542
1563
|
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
1543
1564
|
}
|
|
1544
|
-
function
|
|
1565
|
+
function gi(e) {
|
|
1545
1566
|
u() && y(e);
|
|
1546
1567
|
}
|
|
1547
|
-
function
|
|
1568
|
+
function _i(e) {
|
|
1548
1569
|
u() ? v(e) : h(e);
|
|
1549
1570
|
}
|
|
1550
|
-
var
|
|
1551
|
-
function
|
|
1552
|
-
|
|
1571
|
+
var vi = null, yi = null;
|
|
1572
|
+
function bi(e = null, t = null) {
|
|
1573
|
+
vi = e, yi = t;
|
|
1553
1574
|
}
|
|
1554
|
-
function
|
|
1575
|
+
function xi() {
|
|
1555
1576
|
return {
|
|
1556
|
-
data:
|
|
1557
|
-
clonedData:
|
|
1577
|
+
data: vi,
|
|
1578
|
+
clonedData: yi
|
|
1558
1579
|
};
|
|
1559
1580
|
}
|
|
1560
|
-
var
|
|
1561
|
-
function
|
|
1581
|
+
var Si = Symbol("cloneElement");
|
|
1582
|
+
function Ci(...e) {
|
|
1562
1583
|
let t = u()?.proxy, n = null, r = e[0], [, i, a] = e;
|
|
1563
1584
|
Array.isArray(E(i)) || (a = i, i = null);
|
|
1564
|
-
let o = null, { immediate: s = !0, clone: c =
|
|
1585
|
+
let o = null, { immediate: s = !0, clone: c = hi, forceFallback: l, fallbackOnBody: d, customUpdate: f } = E(a) ?? {};
|
|
1565
1586
|
function m(e) {
|
|
1566
1587
|
let { from: t, oldIndex: r, item: a } = e, o = Array.from(t.childNodes);
|
|
1567
1588
|
n = l && !d ? o.slice(0, -1) : o;
|
|
1568
1589
|
let s = E(E(i)?.[r]), u = c(s);
|
|
1569
|
-
|
|
1590
|
+
bi(s, u), a[Si] = u;
|
|
1570
1591
|
}
|
|
1571
1592
|
function g(e) {
|
|
1572
|
-
let t = e.item[
|
|
1573
|
-
if (!
|
|
1574
|
-
if (
|
|
1593
|
+
let t = e.item[Si];
|
|
1594
|
+
if (!sn(t)) {
|
|
1595
|
+
if (un(e.item), p(i)) {
|
|
1575
1596
|
let n = [...E(i)];
|
|
1576
|
-
i.value =
|
|
1597
|
+
i.value = on(n, e.newDraggableIndex, t);
|
|
1577
1598
|
return;
|
|
1578
1599
|
}
|
|
1579
|
-
|
|
1600
|
+
on(E(i), e.newDraggableIndex, t);
|
|
1580
1601
|
}
|
|
1581
1602
|
}
|
|
1582
1603
|
function _(e) {
|
|
1583
1604
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, pullMode: o, clone: s } = e;
|
|
1584
|
-
if (
|
|
1585
|
-
|
|
1605
|
+
if (ln(t, n, r), o === "clone") {
|
|
1606
|
+
un(s);
|
|
1586
1607
|
return;
|
|
1587
1608
|
}
|
|
1588
1609
|
if (p(i)) {
|
|
1589
1610
|
let e = [...E(i)];
|
|
1590
|
-
i.value =
|
|
1611
|
+
i.value = an(e, a);
|
|
1591
1612
|
return;
|
|
1592
1613
|
}
|
|
1593
|
-
|
|
1614
|
+
an(E(i), a);
|
|
1594
1615
|
}
|
|
1595
1616
|
function v(e) {
|
|
1596
1617
|
if (f) {
|
|
@@ -1598,12 +1619,12 @@ function Si(...e) {
|
|
|
1598
1619
|
return;
|
|
1599
1620
|
}
|
|
1600
1621
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, newDraggableIndex: o } = e;
|
|
1601
|
-
if (
|
|
1622
|
+
if (un(n), ln(t, n, r), p(i)) {
|
|
1602
1623
|
let e = [...E(i)];
|
|
1603
|
-
i.value =
|
|
1624
|
+
i.value = tn(e, a, o);
|
|
1604
1625
|
return;
|
|
1605
1626
|
}
|
|
1606
|
-
|
|
1627
|
+
tn(E(i), a, o);
|
|
1607
1628
|
}
|
|
1608
1629
|
function y(e) {
|
|
1609
1630
|
let { newIndex: t, oldIndex: r, from: i, to: a } = e, o = null, s = t === r && i === a;
|
|
@@ -1622,7 +1643,7 @@ function Si(...e) {
|
|
|
1622
1643
|
n = null;
|
|
1623
1644
|
}
|
|
1624
1645
|
h(() => {
|
|
1625
|
-
if (
|
|
1646
|
+
if (bi(), o) throw o;
|
|
1626
1647
|
});
|
|
1627
1648
|
}
|
|
1628
1649
|
let b = {
|
|
@@ -1634,19 +1655,19 @@ function Si(...e) {
|
|
|
1634
1655
|
};
|
|
1635
1656
|
function x(e) {
|
|
1636
1657
|
let n = E(r);
|
|
1637
|
-
return e ||=
|
|
1658
|
+
return e ||= cn(n) ? dn(n, t?.$el) : n, e && !mn(e) && (e = e.$el), e || en("Root element not found"), e;
|
|
1638
1659
|
}
|
|
1639
1660
|
function ee() {
|
|
1640
|
-
let e = E(a) ?? {}, { immediate: t, clone: n } = e, r =
|
|
1641
|
-
return
|
|
1642
|
-
|
|
1643
|
-
}),
|
|
1661
|
+
let e = E(a) ?? {}, { immediate: t, clone: n } = e, r = Zt(e, ["immediate", "clone"]);
|
|
1662
|
+
return hn(r, (e, t) => {
|
|
1663
|
+
gn(e) && (r[e] = (e, ...n) => (_n(e, xi()), t(e, ...n)));
|
|
1664
|
+
}), pn(i === null ? {} : b, r);
|
|
1644
1665
|
}
|
|
1645
1666
|
let S = (e) => {
|
|
1646
1667
|
e = x(e), o && C.destroy(), o = new Q(e, ee());
|
|
1647
1668
|
};
|
|
1648
1669
|
re(() => a, () => {
|
|
1649
|
-
o &&
|
|
1670
|
+
o && hn(ee(), (e, t) => {
|
|
1650
1671
|
o?.option(e, t);
|
|
1651
1672
|
});
|
|
1652
1673
|
}, { deep: !0 });
|
|
@@ -1659,15 +1680,15 @@ function Si(...e) {
|
|
|
1659
1680
|
toArray: () => o?.toArray(),
|
|
1660
1681
|
closest: (...e) => o?.closest(...e)
|
|
1661
1682
|
};
|
|
1662
|
-
return
|
|
1683
|
+
return _i(() => {
|
|
1663
1684
|
s && S();
|
|
1664
|
-
}),
|
|
1685
|
+
}), gi(C.destroy), Xt({
|
|
1665
1686
|
start: S,
|
|
1666
1687
|
pause: () => C?.option("disabled", !0),
|
|
1667
1688
|
resume: () => C?.option("disabled", !1)
|
|
1668
1689
|
}, C);
|
|
1669
1690
|
}
|
|
1670
|
-
var
|
|
1691
|
+
var wi = [
|
|
1671
1692
|
"update",
|
|
1672
1693
|
"start",
|
|
1673
1694
|
"add",
|
|
@@ -1680,7 +1701,7 @@ var Ci = [
|
|
|
1680
1701
|
"clone",
|
|
1681
1702
|
"move",
|
|
1682
1703
|
"change"
|
|
1683
|
-
],
|
|
1704
|
+
], Ti = l({
|
|
1684
1705
|
name: "VueDraggable",
|
|
1685
1706
|
model: {
|
|
1686
1707
|
prop: "modelValue",
|
|
@@ -1730,33 +1751,33 @@ var Ci = [
|
|
|
1730
1751
|
"tag",
|
|
1731
1752
|
"target",
|
|
1732
1753
|
"customUpdate",
|
|
1733
|
-
...
|
|
1754
|
+
...wi.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
|
|
1734
1755
|
],
|
|
1735
|
-
emits: ["update:modelValue", ...
|
|
1756
|
+
emits: ["update:modelValue", ...wi],
|
|
1736
1757
|
setup(e, { slots: t, emit: n, expose: i, attrs: a }) {
|
|
1737
|
-
let o =
|
|
1758
|
+
let o = wi.reduce((e, t) => {
|
|
1738
1759
|
let r = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
1739
1760
|
return e[r] = (...e) => n(t, ...e), e;
|
|
1740
1761
|
}, {}), s = r(() => {
|
|
1741
|
-
let t = T(e), { modelValue: n } = t, r =
|
|
1762
|
+
let t = T(e), { modelValue: n } = t, r = Zt(t, ["modelValue"]), i = Object.entries(r).reduce((e, [t, n]) => {
|
|
1742
1763
|
let r = E(n);
|
|
1743
1764
|
return r !== void 0 && (e[t] = r), e;
|
|
1744
1765
|
}, {});
|
|
1745
|
-
return
|
|
1766
|
+
return Xt(Xt({}, o), rn(Xt(Xt({}, a), i)));
|
|
1746
1767
|
}), c = r({
|
|
1747
1768
|
get: () => e.modelValue,
|
|
1748
1769
|
set: (e) => n("update:modelValue", e)
|
|
1749
|
-
}), l = S(), u = ee(
|
|
1770
|
+
}), l = S(), u = ee(Ci(e.target || l, c, s));
|
|
1750
1771
|
return i(u), () => d(e.tag || "div", { ref: l }, (t?.default)?.call(t, u));
|
|
1751
1772
|
}
|
|
1752
|
-
}),
|
|
1773
|
+
}), Ei = {
|
|
1753
1774
|
mounted: "mounted",
|
|
1754
1775
|
unmounted: "unmounted"
|
|
1755
1776
|
};
|
|
1756
|
-
|
|
1777
|
+
Ei.mounted, Ei.unmounted;
|
|
1757
1778
|
//#endregion
|
|
1758
1779
|
//#region src/composables/context.composable.ts
|
|
1759
|
-
function
|
|
1780
|
+
function Di(e) {
|
|
1760
1781
|
let t = Symbol(e);
|
|
1761
1782
|
function n(e) {
|
|
1762
1783
|
return x(t, e), e;
|
|
@@ -1770,11 +1791,11 @@ function Ei(e) {
|
|
|
1770
1791
|
}
|
|
1771
1792
|
//#endregion
|
|
1772
1793
|
//#region src/context/customViewManager.context.ts
|
|
1773
|
-
var [
|
|
1794
|
+
var [Oi, ki] = Di("customViewManagerContext");
|
|
1774
1795
|
//#endregion
|
|
1775
1796
|
//#region src/actions/customViewCreateView.action.ts
|
|
1776
|
-
function
|
|
1777
|
-
let e = O(), t = we().create(
|
|
1797
|
+
function Ai() {
|
|
1798
|
+
let e = O(), t = we().create(Ut), n = ki();
|
|
1778
1799
|
return vt({
|
|
1779
1800
|
id: "custom-view-save-to-new-view",
|
|
1780
1801
|
name: () => e.t("action.custom_view.create"),
|
|
@@ -1789,8 +1810,8 @@ function ki() {
|
|
|
1789
1810
|
}
|
|
1790
1811
|
//#endregion
|
|
1791
1812
|
//#region src/actions/customViewRevertToSavedView.action.ts
|
|
1792
|
-
function
|
|
1793
|
-
let e = O(), t =
|
|
1813
|
+
function ji() {
|
|
1814
|
+
let e = O(), t = ki();
|
|
1794
1815
|
return vt({
|
|
1795
1816
|
id: "custom-view-revert-to-saved-view",
|
|
1796
1817
|
isApplicable: () => t.isDirty.value,
|
|
@@ -1805,8 +1826,8 @@ function Ai() {
|
|
|
1805
1826
|
}
|
|
1806
1827
|
//#endregion
|
|
1807
1828
|
//#region src/actions/customViewSaveToCurrentView.action.ts
|
|
1808
|
-
function
|
|
1809
|
-
let e = O(), t =
|
|
1829
|
+
function Mi() {
|
|
1830
|
+
let e = O(), t = ki();
|
|
1810
1831
|
return vt({
|
|
1811
1832
|
id: "custom-view-save-to-current-view",
|
|
1812
1833
|
isApplicable: () => t.activeView.value.isEditable,
|
|
@@ -1820,8 +1841,8 @@ function ji() {
|
|
|
1820
1841
|
}
|
|
1821
1842
|
//#endregion
|
|
1822
1843
|
//#region src/actions/customViewDeleteView.action.ts
|
|
1823
|
-
function
|
|
1824
|
-
let e = O(), t = we().create(le), n =
|
|
1844
|
+
function Ni() {
|
|
1845
|
+
let e = O(), t = we().create(le), n = ki();
|
|
1825
1846
|
return vt({
|
|
1826
1847
|
id: "custom-view-delete-view",
|
|
1827
1848
|
isApplicable: (e) => {
|
|
@@ -1849,8 +1870,8 @@ function Mi() {
|
|
|
1849
1870
|
}
|
|
1850
1871
|
//#endregion
|
|
1851
1872
|
//#region src/actions/customViewEditView.action.ts
|
|
1852
|
-
function
|
|
1853
|
-
let e = O(), t = we().create(
|
|
1873
|
+
function Pi() {
|
|
1874
|
+
let e = O(), t = we().create(Wt), n = ki();
|
|
1854
1875
|
return vt({
|
|
1855
1876
|
id: "custom-view-edit-view",
|
|
1856
1877
|
isApplicable: (e) => {
|
|
@@ -1873,7 +1894,7 @@ function Ni() {
|
|
|
1873
1894
|
}
|
|
1874
1895
|
//#endregion
|
|
1875
1896
|
//#region src/components/views/CustomViewViewsItem.vue?vue&type=script&setup=true&lang.ts
|
|
1876
|
-
var
|
|
1897
|
+
var Fi = { class: "flex h-6 items-center overflow-hidden rounded-sm border border-secondary duration-100 hover:bg-secondary" }, Ii = { class: "text-xs text-primary" }, Li = /* @__PURE__ */ l({
|
|
1877
1898
|
__name: "CustomViewViewsItem",
|
|
1878
1899
|
props: {
|
|
1879
1900
|
isSelected: { type: Boolean },
|
|
@@ -1882,12 +1903,12 @@ var Pi = { class: "flex h-6 items-center overflow-hidden rounded-sm border borde
|
|
|
1882
1903
|
},
|
|
1883
1904
|
emits: ["select"],
|
|
1884
1905
|
setup(e, { emit: t }) {
|
|
1885
|
-
let n = e, r = t, o =
|
|
1906
|
+
let n = e, r = t, o = Pi(), l = Ni();
|
|
1886
1907
|
return (t, u) => (b(), i(E(oe), {
|
|
1887
1908
|
label: n.view.name,
|
|
1888
1909
|
"keyboard-shortcut": e.viewIndex < 9 ? { key: `${e.viewIndex + 1}` } : null
|
|
1889
1910
|
}, {
|
|
1890
|
-
default: D(() => [s("div",
|
|
1911
|
+
default: D(() => [s("div", Fi, [c(E(ie), {
|
|
1891
1912
|
"current-context-only": !0,
|
|
1892
1913
|
actions: [E(o), E(l)],
|
|
1893
1914
|
models: [{
|
|
@@ -1908,11 +1929,11 @@ var Pi = { class: "flex h-6 items-center overflow-hidden rounded-sm border borde
|
|
|
1908
1929
|
gap: "xs",
|
|
1909
1930
|
class: "px-sm"
|
|
1910
1931
|
}, {
|
|
1911
|
-
default: D(() => [n.view.icon === null ? a("", !0) : (b(), i(w(E(
|
|
1932
|
+
default: D(() => [n.view.icon === null ? a("", !0) : (b(), i(w(E(Rt)(n.view.icon)), {
|
|
1912
1933
|
key: 0,
|
|
1913
|
-
style: _({ color: E(
|
|
1934
|
+
style: _({ color: E(Ft)(n.view.color) }),
|
|
1914
1935
|
class: "size-3"
|
|
1915
|
-
}, null, 8, ["style"])), s("span",
|
|
1936
|
+
}, null, 8, ["style"])), s("span", Ii, ne(n.view.name), 1)]),
|
|
1916
1937
|
_: 1
|
|
1917
1938
|
})]),
|
|
1918
1939
|
_: 1
|
|
@@ -1924,10 +1945,10 @@ var Pi = { class: "flex h-6 items-center overflow-hidden rounded-sm border borde
|
|
|
1924
1945
|
_: 1
|
|
1925
1946
|
}, 8, ["label", "keyboard-shortcut"]));
|
|
1926
1947
|
}
|
|
1927
|
-
}),
|
|
1948
|
+
}), Ri = /* @__PURE__ */ l({
|
|
1928
1949
|
__name: "CustomViewViews",
|
|
1929
1950
|
setup(e) {
|
|
1930
|
-
let t = O(), r =
|
|
1951
|
+
let t = O(), r = ki(), s = Ai(), l = ji(), u = Mi(), d = S([...r.views.value]);
|
|
1931
1952
|
re(() => r.views.value, (e) => {
|
|
1932
1953
|
d.value = [...e];
|
|
1933
1954
|
});
|
|
@@ -1935,14 +1956,14 @@ var Pi = { class: "flex h-6 items-center overflow-hidden rounded-sm border borde
|
|
|
1935
1956
|
r.reorderViews(d.value);
|
|
1936
1957
|
}
|
|
1937
1958
|
return (e, p) => (b(), i(E(be), null, {
|
|
1938
|
-
default: D(() => [c(E(
|
|
1959
|
+
default: D(() => [c(E(Ti), {
|
|
1939
1960
|
modelValue: d.value,
|
|
1940
1961
|
"onUpdate:modelValue": p[0] ||= (e) => d.value = e,
|
|
1941
1962
|
animation: 150,
|
|
1942
1963
|
class: "flex flex-row items-center gap-1",
|
|
1943
1964
|
onEnd: f
|
|
1944
1965
|
}, {
|
|
1945
|
-
default: D(() => [(b(!0), o(n, null, C(d.value, (e, t) => (b(), i(
|
|
1966
|
+
default: D(() => [(b(!0), o(n, null, C(d.value, (e, t) => (b(), i(Li, {
|
|
1946
1967
|
key: e.id,
|
|
1947
1968
|
view: e,
|
|
1948
1969
|
"is-selected": e.id === E(r).activeView.value.id,
|
|
@@ -1982,7 +2003,7 @@ var Pi = { class: "flex h-6 items-center overflow-hidden rounded-sm border borde
|
|
|
1982
2003
|
});
|
|
1983
2004
|
//#endregion
|
|
1984
2005
|
//#region src/composables/customViewManager.composable.ts
|
|
1985
|
-
function
|
|
2006
|
+
function zi({ seedViews: e, state: t, storageAdapter: n }) {
|
|
1986
2007
|
let i = O(), a = St(), o = Ct(), s = te(g());
|
|
1987
2008
|
xt(s.value.length > 0, "At least 1 view is required");
|
|
1988
2009
|
let c = r(() => a.query.view ?? null), l = r(() => a.query["view-state"] ?? null), u = {
|
|
@@ -2108,7 +2129,7 @@ function Ri({ seedViews: e, state: t, storageAdapter: n }) {
|
|
|
2108
2129
|
updateViewMeta: x,
|
|
2109
2130
|
views: r(() => s.value)
|
|
2110
2131
|
};
|
|
2111
|
-
return
|
|
2132
|
+
return Oi(E), E;
|
|
2112
2133
|
}
|
|
2113
2134
|
//#endregion
|
|
2114
|
-
export { k as CUSTOM_VIEW_COLOR,
|
|
2135
|
+
export { k as CUSTOM_VIEW_COLOR, Pt as CUSTOM_VIEW_COLORS_MAP, A as CUSTOM_VIEW_ICON, Lt as CUSTOM_VIEW_ICONS_MAP, It as CustomViewColorPicker, Ut as CustomViewCreateDialog, Ht as CustomViewIconPicker, Ri as CustomViewList, Wt as CustomViewUpdateDialog, kt as createCustomViewFilterStateAdapter, Nt as createCustomViewLocalStorageAdapter, At as createCustomViewSearchStateAdapter, jt as createCustomViewSortStateAdapter, wt as createCustomViewStateAdapter, Mt as createCustomViewTableColumnsStateAdapter, Ft as getCustomViewColor, Rt as getCustomViewIconComponent, zi as useCustomViewManager, ki as useInjectCustomViewManagerContext, Oi as useProvideCustomViewManagerContext };
|