@origen-ui/tabs 1.0.2 → 1.1.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/config-C6gh_5SI.cjs +1 -0
- package/dist/config-CxS92Qea.js +13 -0
- package/dist/index.cjs +1 -2
- package/dist/index.mjs +2057 -2236
- package/dist/locale.cjs +1 -1
- package/dist/locale.mjs +60 -62
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.mjs +3 -9
- package/dist/style.css +2 -1
- package/package.json +21 -20
- package/dist/config-BVOCsdxN.js +0 -16
- package/dist/config-DbOzZnZx.cjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,2247 +1,2068 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
function
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(o, n));
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
return e;
|
|
550
|
-
}
|
|
551
|
-
function ni(e, t) {
|
|
552
|
-
if (e == null) return {};
|
|
553
|
-
var o, n, i = oi(e, t);
|
|
554
|
-
if (Object.getOwnPropertySymbols) {
|
|
555
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
556
|
-
for (n = 0; n < r.length; n++) o = r[n], t.indexOf(o) === -1 && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
557
|
-
}
|
|
558
|
-
return i;
|
|
559
|
-
}
|
|
560
|
-
function oi(e, t) {
|
|
561
|
-
if (e == null) return {};
|
|
562
|
-
var o = {};
|
|
563
|
-
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
564
|
-
if (t.indexOf(n) !== -1) continue;
|
|
565
|
-
o[n] = e[n];
|
|
566
|
-
}
|
|
567
|
-
return o;
|
|
568
|
-
}
|
|
569
|
-
function ii(e, t) {
|
|
570
|
-
if (typeof e != "object" || !e) return e;
|
|
571
|
-
var o = e[Symbol.toPrimitive];
|
|
572
|
-
if (o !== void 0) {
|
|
573
|
-
var n = o.call(e, t);
|
|
574
|
-
if (typeof n != "object") return n;
|
|
575
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
576
|
-
}
|
|
577
|
-
return (t === "string" ? String : Number)(e);
|
|
578
|
-
}
|
|
579
|
-
function ri(e) {
|
|
580
|
-
var t = ii(e, "string");
|
|
581
|
-
return typeof t == "symbol" ? t : t + "";
|
|
582
|
-
}
|
|
583
|
-
function qt(e) {
|
|
584
|
-
"@babel/helpers - typeof";
|
|
585
|
-
return qt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
586
|
-
return typeof t;
|
|
587
|
-
} : function(t) {
|
|
588
|
-
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
589
|
-
}, qt(e);
|
|
590
|
-
}
|
|
591
|
-
var ai = "1.15.7";
|
|
592
|
-
function ye(e) {
|
|
593
|
-
if (typeof window < "u" && window.navigator)
|
|
594
|
-
return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
595
|
-
}
|
|
596
|
-
var Ee = ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), ut = ye(/Edge/i), gn = ye(/firefox/i), ot = ye(/safari/i) && !ye(/chrome/i) && !ye(/android/i), Qt = ye(/iP(ad|od|hone)/i), On = ye(/chrome/i) && ye(/android/i), Pn = {
|
|
597
|
-
capture: !1,
|
|
598
|
-
passive: !1
|
|
1
|
+
import { n as e, t } from "./config-CxS92Qea.js";
|
|
2
|
+
import { OG_TABS_LOCALE_EN_US as n, OG_TABS_LOCALE_ZH_CN as r, OG_TABS_LOCALE_ZH_TW as i } from "./locale.mjs";
|
|
3
|
+
import { Fragment as a, Teleport as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, guardReactiveProps as h, mergeProps as g, nextTick as _, normalizeClass as ee, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as te, shallowRef as E, toDisplayString as ne, unref as D, useId as re, useSlots as ie, useTemplateRef as ae, vModelText as oe, watch as se, withCtx as O, withDirectives as ce, withModifiers as le } from "vue";
|
|
4
|
+
import { Bottom as ue, CircleCheckFilled as de, CircleCloseFilled as fe, Close as pe, CollectionTag as me, MoreFilled as he, Refresh as ge, Search as _e, Top as ve, WarningFilled as ye } from "@element-plus/icons-vue";
|
|
5
|
+
import { mergeLocale as be } from "@origen-ui/shared";
|
|
6
|
+
import { ElEmpty as xe, ElIcon as Se, ElPopover as k, ElTabPane as Ce, ElTabs as we } from "element-plus";
|
|
7
|
+
//#region src/OgTabsContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var Te = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "og-tabs-context-menu__divider",
|
|
11
|
+
role: "separator"
|
|
12
|
+
}, Ee = ["disabled", "onClick"], De = /*@__PURE__*/ m({
|
|
13
|
+
__name: "OgTabsContextMenu",
|
|
14
|
+
props: {
|
|
15
|
+
visible: { type: Boolean },
|
|
16
|
+
x: {},
|
|
17
|
+
y: {},
|
|
18
|
+
items: {}
|
|
19
|
+
},
|
|
20
|
+
emits: [
|
|
21
|
+
"select",
|
|
22
|
+
"close",
|
|
23
|
+
"reposition"
|
|
24
|
+
],
|
|
25
|
+
setup(e, { emit: t }) {
|
|
26
|
+
let n = e, r = t, i = ae("menu");
|
|
27
|
+
function s() {
|
|
28
|
+
r("close");
|
|
29
|
+
}
|
|
30
|
+
function f() {
|
|
31
|
+
return [...i.value?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []];
|
|
32
|
+
}
|
|
33
|
+
function p() {
|
|
34
|
+
let e = i.value;
|
|
35
|
+
if (!e) return;
|
|
36
|
+
let t = e.getBoundingClientRect();
|
|
37
|
+
r("reposition", Math.max(4, Math.min(n.x, window.innerWidth - t.width - 4)), Math.max(4, Math.min(n.y, window.innerHeight - t.height - 4))), f()[0]?.focus();
|
|
38
|
+
}
|
|
39
|
+
function m(e) {
|
|
40
|
+
i.value?.contains(e.target) || s();
|
|
41
|
+
}
|
|
42
|
+
function h(e) {
|
|
43
|
+
let t = f(), n = t.indexOf(document.activeElement);
|
|
44
|
+
if (e.key === "Escape") {
|
|
45
|
+
e.preventDefault(), s();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
!t.length || ![
|
|
49
|
+
"ArrowDown",
|
|
50
|
+
"ArrowUp",
|
|
51
|
+
"Home",
|
|
52
|
+
"End"
|
|
53
|
+
].includes(e.key) || (e.preventDefault(), t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus());
|
|
54
|
+
}
|
|
55
|
+
return se(() => n.visible, (e) => {
|
|
56
|
+
e && _(p);
|
|
57
|
+
}), x(() => window.addEventListener("pointerdown", m)), b(() => window.removeEventListener("pointerdown", m)), (t, n) => (S(), c(o, { to: "body" }, [e.visible ? (S(), u("div", {
|
|
58
|
+
key: 0,
|
|
59
|
+
ref_key: "menu",
|
|
60
|
+
ref: i,
|
|
61
|
+
class: "og-tabs-context-menu",
|
|
62
|
+
style: y({
|
|
63
|
+
left: `${e.x}px`,
|
|
64
|
+
top: `${e.y}px`
|
|
65
|
+
}),
|
|
66
|
+
role: "menu",
|
|
67
|
+
onContextmenu: n[0] ||= le(() => {}, ["prevent"]),
|
|
68
|
+
onKeydown: h
|
|
69
|
+
}, [
|
|
70
|
+
T(t.$slots, "top", {}, void 0, !0),
|
|
71
|
+
(S(!0), u(a, null, w(e.items, (e) => (S(), u(a, { key: e.operation }, [e.dividerBefore ? (S(), u("div", Te)) : l("", !0), d("button", {
|
|
72
|
+
type: "button",
|
|
73
|
+
role: "menuitem",
|
|
74
|
+
disabled: e.disabled,
|
|
75
|
+
onClick: le((n) => t.$emit("select", e.operation), ["stop"])
|
|
76
|
+
}, [e.icon ? (S(), c(D(Se), {
|
|
77
|
+
key: 0,
|
|
78
|
+
"aria-hidden": "true"
|
|
79
|
+
}, {
|
|
80
|
+
default: O(() => [(S(), c(te(e.icon)))]),
|
|
81
|
+
_: 2
|
|
82
|
+
}, 1024)) : l("", !0), d("span", null, ne(e.label), 1)], 8, Ee)], 64))), 128)),
|
|
83
|
+
T(t.$slots, "bottom", {}, void 0, !0)
|
|
84
|
+
], 36)) : l("", !0)]));
|
|
85
|
+
}
|
|
86
|
+
}), Oe = (e, t) => {
|
|
87
|
+
let n = e.__vccOpts || e;
|
|
88
|
+
for (let [e, r] of t) n[e] = r;
|
|
89
|
+
return n;
|
|
90
|
+
}, ke = /*#__PURE__*/ Oe(De, [["__scopeId", "data-v-49db788b"]]);
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/tabState.ts
|
|
93
|
+
function A(e, t) {
|
|
94
|
+
return e.find((e) => e.key === t);
|
|
95
|
+
}
|
|
96
|
+
function Ae(e) {
|
|
97
|
+
return [...e.filter((e) => e.pinned), ...e.filter((e) => !e.pinned)];
|
|
98
|
+
}
|
|
99
|
+
function je(e, t) {
|
|
100
|
+
let n = t?.trim().toLocaleLowerCase();
|
|
101
|
+
return Ae(n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n)) : e);
|
|
102
|
+
}
|
|
103
|
+
function Me(e) {
|
|
104
|
+
return !!(e && !e.disabled && !e.readonly && !e.pinned && e.closable !== !1);
|
|
105
|
+
}
|
|
106
|
+
function Ne(e) {
|
|
107
|
+
return !!(e && !e.disabled && !e.readonly && e.pinnable !== !1);
|
|
108
|
+
}
|
|
109
|
+
function Pe(e) {
|
|
110
|
+
return !!(e && !e.disabled && !e.readonly && !e.pinned && e.draggable !== !1);
|
|
111
|
+
}
|
|
112
|
+
function Fe(e, t, n) {
|
|
113
|
+
let r = A(e, t);
|
|
114
|
+
if (!r || r.pinned === n) return [...e];
|
|
115
|
+
let i = Ae(e.filter((e) => e.key !== t)), a = {
|
|
116
|
+
...r,
|
|
117
|
+
pinned: n
|
|
118
|
+
}, o = n ? i.filter((e) => e.pinned).length : i.findIndex((e) => !e.pinned);
|
|
119
|
+
return i.splice(o < 0 ? i.length : o, 0, a), i;
|
|
120
|
+
}
|
|
121
|
+
function Ie(e, t) {
|
|
122
|
+
return e.filter((e) => !t.has(e.key));
|
|
123
|
+
}
|
|
124
|
+
function Le(e, t, n) {
|
|
125
|
+
if (n === "all") return e.filter(Me);
|
|
126
|
+
let r = e.findIndex((e) => e.key === t);
|
|
127
|
+
if (r < 0) return [];
|
|
128
|
+
if (n === "current") {
|
|
129
|
+
let t = e[r];
|
|
130
|
+
return t && Me(t) ? [t] : [];
|
|
131
|
+
}
|
|
132
|
+
return n === "others" ? e.filter((e) => e.key !== t && Me(e)) : (n === "left" ? e.slice(0, r) : e.slice(r + 1)).filter(Me);
|
|
133
|
+
}
|
|
134
|
+
function Re(e, t, n) {
|
|
135
|
+
let r = e.findIndex((e) => e.key === n), i = (e) => e !== void 0 && t.some((t) => t.key === e && !t.disabled);
|
|
136
|
+
for (let t = r + 1; t < e.length; t += 1) {
|
|
137
|
+
let n = e[t];
|
|
138
|
+
if (n && i(n.key)) return n.key;
|
|
139
|
+
}
|
|
140
|
+
for (let t = r - 1; t >= 0; --t) {
|
|
141
|
+
let n = e[t];
|
|
142
|
+
if (n && i(n.key)) return n.key;
|
|
143
|
+
}
|
|
144
|
+
let a = t.find((e) => !e.disabled);
|
|
145
|
+
if (a) return a.key;
|
|
146
|
+
}
|
|
147
|
+
function ze(e, t, n) {
|
|
148
|
+
let r = Ae(e), i = A(r, t), a = A(r, n);
|
|
149
|
+
if (!i || !a || i.key === a.key || !Pe(i) || !Pe(a)) return [...e];
|
|
150
|
+
let o = r.filter((e) => e.key !== t);
|
|
151
|
+
return o.splice(o.findIndex((e) => e.key === n), 0, i), o;
|
|
152
|
+
}
|
|
153
|
+
function j(e, t, n) {
|
|
154
|
+
let r = Ae(e), i = A(r, t);
|
|
155
|
+
if (!i || !Pe(i)) return [...e];
|
|
156
|
+
let a = r.filter((e) => e.key !== t), o = a.findIndex((e) => !e.pinned), s = n === "top" ? o : a.length;
|
|
157
|
+
return a.splice(s < 0 ? a.length : s, 0, i), a;
|
|
158
|
+
}
|
|
159
|
+
function Be(e) {
|
|
160
|
+
return e === "current" ? "close" : `close-${e}`;
|
|
161
|
+
}
|
|
162
|
+
function Ve(e) {
|
|
163
|
+
let t = /* @__PURE__ */ new Set();
|
|
164
|
+
return e.some((e) => t.has(e.key) ? !0 : (t.add(e.key), !1));
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/OgTabsFinder.vue?vue&type=script&setup=true&lang.ts
|
|
168
|
+
var He = ["aria-label"], Ue = { class: "og-tabs-finder__content" }, We = [
|
|
169
|
+
"aria-expanded",
|
|
170
|
+
"aria-controls",
|
|
171
|
+
"aria-activedescendant",
|
|
172
|
+
"placeholder"
|
|
173
|
+
], Ge = ["id", "aria-label"], Ke = [
|
|
174
|
+
"id",
|
|
175
|
+
"aria-selected",
|
|
176
|
+
"disabled",
|
|
177
|
+
"onClick"
|
|
178
|
+
], qe = { class: "og-tabs-finder__label" }, Je = { class: "og-tabs-finder__title" }, Ye = ["aria-label"], Xe = /*#__PURE__*/ Oe(/* @__PURE__ */ m({
|
|
179
|
+
__name: "OgTabsFinder",
|
|
180
|
+
props: {
|
|
181
|
+
tabs: {},
|
|
182
|
+
activeKey: {},
|
|
183
|
+
locale: {}
|
|
184
|
+
},
|
|
185
|
+
emits: ["activate"],
|
|
186
|
+
setup(e, { emit: t }) {
|
|
187
|
+
let n = e, r = t, i = E(!1), o = E(""), f = E(-1), m = re(), h = re(), g = ae("input"), v = s(() => je(n.tabs, o.value)), y = s(() => v.value.filter((e) => !e.disabled)), b = s(() => y.value[f.value]), x = s(() => v.value.length > 0);
|
|
188
|
+
function C(e) {
|
|
189
|
+
return `og-tabs-finder-option-${h}-${typeof e.key}-${String(e.key)}`;
|
|
190
|
+
}
|
|
191
|
+
function T(e) {
|
|
192
|
+
let t = y.value.length;
|
|
193
|
+
t && (f.value = (f.value + e + t) % t);
|
|
194
|
+
}
|
|
195
|
+
function te(e) {
|
|
196
|
+
switch (e.key) {
|
|
197
|
+
case "ArrowDown":
|
|
198
|
+
e.preventDefault(), T(1);
|
|
199
|
+
break;
|
|
200
|
+
case "ArrowUp":
|
|
201
|
+
e.preventDefault(), T(-1);
|
|
202
|
+
break;
|
|
203
|
+
case "Home":
|
|
204
|
+
e.preventDefault(), f.value = 0;
|
|
205
|
+
break;
|
|
206
|
+
case "End":
|
|
207
|
+
e.preventDefault(), f.value = y.value.length - 1;
|
|
208
|
+
break;
|
|
209
|
+
case "Enter": b.value && (e.preventDefault(), ie(b.value.key));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function ie(e) {
|
|
213
|
+
i.value = !1, r("activate", e);
|
|
214
|
+
}
|
|
215
|
+
function le() {
|
|
216
|
+
g.value?.focus();
|
|
217
|
+
}
|
|
218
|
+
return se(i, (e) => {
|
|
219
|
+
e && (o.value = "", f.value = -1, _(() => {
|
|
220
|
+
le(), window.setTimeout(le, 260);
|
|
221
|
+
}));
|
|
222
|
+
}, { flush: "sync" }), se(v, () => {
|
|
223
|
+
f.value >= y.value.length && (f.value = y.value.length - 1);
|
|
224
|
+
}, { flush: "sync" }), (t, n) => (S(), c(D(k), {
|
|
225
|
+
visible: i.value,
|
|
226
|
+
"onUpdate:visible": n[1] ||= (e) => i.value = e,
|
|
227
|
+
trigger: "click",
|
|
228
|
+
placement: "bottom-end",
|
|
229
|
+
width: 320,
|
|
230
|
+
"popper-class": "og-tabs-finder",
|
|
231
|
+
onAfterEnter: le
|
|
232
|
+
}, {
|
|
233
|
+
reference: O(() => [d("button", {
|
|
234
|
+
type: "button",
|
|
235
|
+
class: "og-tabs__action",
|
|
236
|
+
"aria-label": e.locale.findTabs
|
|
237
|
+
}, [p(D(Se), { "aria-hidden": "true" }, {
|
|
238
|
+
default: O(() => [p(D(_e))]),
|
|
239
|
+
_: 1
|
|
240
|
+
})], 8, He)]),
|
|
241
|
+
default: O(() => [d("div", Ue, [ce(d("input", {
|
|
242
|
+
ref_key: "input",
|
|
243
|
+
ref: g,
|
|
244
|
+
"onUpdate:modelValue": n[0] ||= (e) => o.value = e,
|
|
245
|
+
class: "og-tabs-finder__input",
|
|
246
|
+
role: "combobox",
|
|
247
|
+
"aria-autocomplete": "list",
|
|
248
|
+
"aria-haspopup": "listbox",
|
|
249
|
+
"aria-expanded": i.value,
|
|
250
|
+
"aria-controls": x.value ? D(m) : void 0,
|
|
251
|
+
"aria-activedescendant": b.value ? C(b.value) : void 0,
|
|
252
|
+
placeholder: e.locale.findTabsPlaceholder,
|
|
253
|
+
onKeydown: te
|
|
254
|
+
}, null, 40, We), [[oe, o.value]]), x.value ? (S(), u("div", {
|
|
255
|
+
key: 0,
|
|
256
|
+
id: D(m),
|
|
257
|
+
class: "og-tabs-finder__list",
|
|
258
|
+
role: "listbox",
|
|
259
|
+
"aria-label": e.locale.findTabs
|
|
260
|
+
}, [(S(!0), u(a, null, w(v.value, (t) => (S(), u("button", {
|
|
261
|
+
id: C(t),
|
|
262
|
+
key: `${typeof t.key}:${String(t.key)}`,
|
|
263
|
+
type: "button",
|
|
264
|
+
role: "option",
|
|
265
|
+
"aria-selected": t.key === e.activeKey,
|
|
266
|
+
class: ee({ "is-active": t.key === b.value?.key }),
|
|
267
|
+
disabled: t.disabled,
|
|
268
|
+
onClick: (e) => ie(t.key)
|
|
269
|
+
}, [d("span", qe, [d("span", Je, ne(t.label), 1), t.dirty ? (S(), u("span", {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: "og-tabs-finder__dirty",
|
|
272
|
+
"aria-label": e.locale.unsaved
|
|
273
|
+
}, null, 8, Ye)) : l("", !0)])], 10, Ke))), 128))], 8, Ge)) : (S(), c(D(xe), {
|
|
274
|
+
key: 1,
|
|
275
|
+
description: e.locale.noResults,
|
|
276
|
+
"image-size": 56
|
|
277
|
+
}, null, 8, ["description"]))])]),
|
|
278
|
+
_: 1
|
|
279
|
+
}, 8, ["visible"]));
|
|
280
|
+
}
|
|
281
|
+
}), [["__scopeId", "data-v-884c1955"]]);
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/tabKey.ts
|
|
284
|
+
function M(e) {
|
|
285
|
+
return `${typeof e == "number" ? "n" : "s"}:${encodeURIComponent(String(e))}`;
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/OgTabsLabel.vue?vue&type=script&setup=true&lang.ts
|
|
289
|
+
var Ze = [
|
|
290
|
+
"data-tab-key",
|
|
291
|
+
"data-tab-id",
|
|
292
|
+
"title"
|
|
293
|
+
], Qe = { class: "og-tabs-label__text" }, $e = ["aria-label"], et = { class: "og-tabs-sr-only" }, tt = ["aria-label"], nt = {
|
|
294
|
+
key: 3,
|
|
295
|
+
class: "og-tabs-label__badge"
|
|
296
|
+
}, rt = /*#__PURE__*/ Oe(/* @__PURE__ */ m({
|
|
297
|
+
__name: "OgTabsLabel",
|
|
298
|
+
props: {
|
|
299
|
+
tab: {},
|
|
300
|
+
active: { type: Boolean },
|
|
301
|
+
minWidth: {},
|
|
302
|
+
maxWidth: {},
|
|
303
|
+
locale: {}
|
|
304
|
+
},
|
|
305
|
+
setup(e) {
|
|
306
|
+
return (t, n) => (S(), u("span", {
|
|
307
|
+
class: "og-tabs-label",
|
|
308
|
+
"data-tab-key": String(e.tab.key),
|
|
309
|
+
"data-tab-id": D(M)(e.tab.key),
|
|
310
|
+
style: y({
|
|
311
|
+
minWidth: e.minWidth,
|
|
312
|
+
maxWidth: e.maxWidth
|
|
313
|
+
}),
|
|
314
|
+
title: e.tab.remark ? `${e.tab.label}\n${e.tab.remark}` : e.tab.label
|
|
315
|
+
}, [
|
|
316
|
+
T(t.$slots, "before", { tab: e.tab }, void 0, !0),
|
|
317
|
+
e.tab.icon ? (S(), c(D(Se), {
|
|
318
|
+
key: 0,
|
|
319
|
+
class: "og-tabs-label__icon",
|
|
320
|
+
"aria-hidden": "true"
|
|
321
|
+
}, {
|
|
322
|
+
default: O(() => [(S(), c(te(e.tab.icon)))]),
|
|
323
|
+
_: 1
|
|
324
|
+
})) : l("", !0),
|
|
325
|
+
e.tab.pinned ? (S(), c(D(Se), {
|
|
326
|
+
key: 1,
|
|
327
|
+
class: "og-tabs-label__pin",
|
|
328
|
+
"aria-label": e.locale.pinned
|
|
329
|
+
}, {
|
|
330
|
+
default: O(() => [p(D(me))]),
|
|
331
|
+
_: 1
|
|
332
|
+
}, 8, ["aria-label"])) : l("", !0),
|
|
333
|
+
d("span", Qe, [T(t.$slots, "default", {
|
|
334
|
+
tab: e.tab,
|
|
335
|
+
active: e.active
|
|
336
|
+
}, () => [f(ne(e.tab.label), 1)], !0)]),
|
|
337
|
+
e.tab.dirty ? (S(), u("span", {
|
|
338
|
+
key: 2,
|
|
339
|
+
class: "og-tabs-label__dirty",
|
|
340
|
+
"aria-label": e.locale.unsaved
|
|
341
|
+
}, [d("span", et, ne(e.locale.unsaved), 1)], 8, $e)) : l("", !0),
|
|
342
|
+
T(t.$slots, "status", { tab: e.tab }, () => [e.tab.statusIcon || e.tab.status === "success" || e.tab.status === "warning" || e.tab.status === "error" ? (S(), c(D(Se), {
|
|
343
|
+
key: 0,
|
|
344
|
+
class: ee(["og-tabs-label__status", [`is-${e.tab.status}`]]),
|
|
345
|
+
"aria-hidden": "true"
|
|
346
|
+
}, {
|
|
347
|
+
default: O(() => [(S(), c(te(e.tab.statusIcon || (e.tab.status === "success" ? D(de) : e.tab.status === "error" ? D(fe) : D(ye)))))]),
|
|
348
|
+
_: 1
|
|
349
|
+
}, 8, ["class"])) : e.tab.status === "loading" ? (S(), u("span", {
|
|
350
|
+
key: 1,
|
|
351
|
+
class: "og-tabs-label__loading",
|
|
352
|
+
"aria-label": e.locale.loading
|
|
353
|
+
}, null, 8, tt)) : l("", !0)], !0),
|
|
354
|
+
e.tab.badge === void 0 ? l("", !0) : (S(), u("span", nt, ne(e.tab.badge), 1)),
|
|
355
|
+
T(t.$slots, "after", { tab: e.tab }, void 0, !0)
|
|
356
|
+
], 12, Ze));
|
|
357
|
+
}
|
|
358
|
+
}), [["__scopeId", "data-v-b81db2ee"]]);
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/useTabsController.ts
|
|
361
|
+
function it(e) {
|
|
362
|
+
let t = E(!1);
|
|
363
|
+
function n(t, n, r, i = {}) {
|
|
364
|
+
let a = e.getItems(), o = e.getActiveKey();
|
|
365
|
+
return {
|
|
366
|
+
operation: t,
|
|
367
|
+
source: n,
|
|
368
|
+
tab: r,
|
|
369
|
+
activeKey: o,
|
|
370
|
+
activeTab: A(a, o),
|
|
371
|
+
items: a,
|
|
372
|
+
...i
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
async function r(n) {
|
|
376
|
+
let r = t.value ? "busy" : e.getDeniedReason(n.operation, n.tab);
|
|
377
|
+
if (r) return e.onDenied(n.operation, n.tab, r), !1;
|
|
378
|
+
t.value = !0;
|
|
379
|
+
try {
|
|
380
|
+
return await e.getProps().beforeAction?.(n) !== !1 && (e.onRequest(n), !0);
|
|
381
|
+
} catch (t) {
|
|
382
|
+
return e.onError(n, t), !1;
|
|
383
|
+
} finally {
|
|
384
|
+
t.value = !1;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function i(t, i = "api") {
|
|
388
|
+
let a = A(e.getItems(), t);
|
|
389
|
+
return !a || a.disabled ? (e.onDenied("activate", a, a ? "disabled" : "not-found"), Promise.resolve(!1)) : t === e.getActiveKey() ? Promise.resolve(!0) : r(n("activate", i, a, { nextActiveKey: t }));
|
|
390
|
+
}
|
|
391
|
+
function a(t, i = "api") {
|
|
392
|
+
let a = e.getItems(), o = A(a, t);
|
|
393
|
+
if (!Me(o)) return e.onDenied("close", o, o?.pinned ? "pinned" : o ? "readonly" : "not-found"), Promise.resolve(!1);
|
|
394
|
+
let s = Ie(a, /* @__PURE__ */ new Set([t])), c = t === e.getActiveKey() ? Re(Ae(a), s, t) : e.getActiveKey();
|
|
395
|
+
return r(n("close", i, o, {
|
|
396
|
+
targets: [o],
|
|
397
|
+
nextItems: s,
|
|
398
|
+
nextActiveKey: c
|
|
399
|
+
}));
|
|
400
|
+
}
|
|
401
|
+
function o(t, i, a = "api") {
|
|
402
|
+
let o = e.getItems(), s = Ae(o), c = Le(s, i, t);
|
|
403
|
+
if (!c.length) return e.onDenied(Be(t), A(o, i), "boundary"), Promise.resolve(!1);
|
|
404
|
+
let l = new Set(c.map((e) => e.key)), u = e.getActiveKey(), d = Ie(o, l), f = u !== void 0 && l.has(u) ? Re(s, d, u) : u;
|
|
405
|
+
return r(n(Be(t), a, t === "current" ? c[0] : A(o, i), {
|
|
406
|
+
targets: c,
|
|
407
|
+
nextItems: d,
|
|
408
|
+
nextActiveKey: f
|
|
409
|
+
}));
|
|
410
|
+
}
|
|
411
|
+
function s(t, i, a = "api") {
|
|
412
|
+
let o = A(e.getItems(), t);
|
|
413
|
+
return !o || !Ne(o) || o.pinned === i ? (e.onDenied(i ? "pin" : "unpin", o, o ? o.pinned === i ? "boundary" : "readonly" : "not-found"), Promise.resolve(!1)) : r(n(i ? "pin" : "unpin", a, o, { nextItems: Fe(e.getItems(), t, i) }));
|
|
414
|
+
}
|
|
415
|
+
function c(t, i, a = "api") {
|
|
416
|
+
let o = e.getItems(), s = A(o, t), c = A(o, i), l = ze(o, t, i);
|
|
417
|
+
return !s || !c || l.every((e, t) => e.key === o[t]?.key) ? (e.onDenied("move", s, s ? "boundary" : "not-found"), Promise.resolve(!1)) : r(n("move", a, s, {
|
|
418
|
+
nextItems: l,
|
|
419
|
+
targetTab: c
|
|
420
|
+
}));
|
|
421
|
+
}
|
|
422
|
+
function l(t, i, a = "api") {
|
|
423
|
+
let o = e.getItems(), s = i === void 0 ? j(o, t, "bottom") : ze(o, t, i), c = A(o, t);
|
|
424
|
+
return !c || s.every((e, t) => e.key === o[t]?.key) ? (e.onDenied("move", c, c ? "boundary" : "not-found"), Promise.resolve(!1)) : r(n("move", a, c, {
|
|
425
|
+
nextItems: s,
|
|
426
|
+
targetTab: i === void 0 ? void 0 : A(o, i)
|
|
427
|
+
}));
|
|
428
|
+
}
|
|
429
|
+
function u(t, i, a = "api") {
|
|
430
|
+
let o = e.getItems(), s = A(o, t), c = j(o, t, i);
|
|
431
|
+
return !s || c.every((e, t) => e.key === o[t]?.key) ? (e.onDenied(i === "top" ? "move-top" : "move-bottom", s, s ? "boundary" : "not-found"), Promise.resolve(!1)) : r(n(i === "top" ? "move-top" : "move-bottom", a, s, { nextItems: c }));
|
|
432
|
+
}
|
|
433
|
+
function d(t, i = "api") {
|
|
434
|
+
let a = A(e.getItems(), t);
|
|
435
|
+
return a ? r(n("refresh", i, a)) : (e.onDenied("refresh", a, "not-found"), Promise.resolve(!1));
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
pending: t,
|
|
439
|
+
dispatch: r,
|
|
440
|
+
activate: i,
|
|
441
|
+
close: a,
|
|
442
|
+
closeScope: (t, n = "api") => o(t, e.getActiveKey(), n),
|
|
443
|
+
closeScopeAt: o,
|
|
444
|
+
refreshAt: d,
|
|
445
|
+
pin: (e, t = "api") => s(e, !0, t),
|
|
446
|
+
unpin: (e, t = "api") => s(e, !1, t),
|
|
447
|
+
move: c,
|
|
448
|
+
moveBefore: l,
|
|
449
|
+
moveTop: (e, t = "api") => u(e, "top", t),
|
|
450
|
+
moveBottom: (e, t = "api") => u(e, "bottom", t),
|
|
451
|
+
refresh: (t = "api") => {
|
|
452
|
+
let n = e.getActiveKey();
|
|
453
|
+
return n === void 0 ? Promise.resolve(!1) : d(n, t);
|
|
454
|
+
},
|
|
455
|
+
scrollTo: e.onScrollTo,
|
|
456
|
+
getItems: e.getItems
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region ../../node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js
|
|
461
|
+
function at(e, t, n) {
|
|
462
|
+
return (t = ut(t)) in e ? Object.defineProperty(e, t, {
|
|
463
|
+
value: n,
|
|
464
|
+
enumerable: !0,
|
|
465
|
+
configurable: !0,
|
|
466
|
+
writable: !0
|
|
467
|
+
}) : e[t] = n, e;
|
|
468
|
+
}
|
|
469
|
+
function N() {
|
|
470
|
+
return N = Object.assign ? Object.assign.bind() : function(e) {
|
|
471
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
472
|
+
var n = arguments[t];
|
|
473
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
474
|
+
}
|
|
475
|
+
return e;
|
|
476
|
+
}, N.apply(null, arguments);
|
|
477
|
+
}
|
|
478
|
+
function ot(e, t) {
|
|
479
|
+
var n = Object.keys(e);
|
|
480
|
+
if (Object.getOwnPropertySymbols) {
|
|
481
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
482
|
+
t && (r = r.filter(function(t) {
|
|
483
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
484
|
+
})), n.push.apply(n, r);
|
|
485
|
+
}
|
|
486
|
+
return n;
|
|
487
|
+
}
|
|
488
|
+
function P(e) {
|
|
489
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
490
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
491
|
+
t % 2 ? ot(Object(n), !0).forEach(function(t) {
|
|
492
|
+
at(e, t, n[t]);
|
|
493
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ot(Object(n)).forEach(function(t) {
|
|
494
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
return e;
|
|
498
|
+
}
|
|
499
|
+
function st(e, t) {
|
|
500
|
+
if (e == null) return {};
|
|
501
|
+
var n, r, i = ct(e, t);
|
|
502
|
+
if (Object.getOwnPropertySymbols) {
|
|
503
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
504
|
+
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
505
|
+
}
|
|
506
|
+
return i;
|
|
507
|
+
}
|
|
508
|
+
function ct(e, t) {
|
|
509
|
+
if (e == null) return {};
|
|
510
|
+
var n = {};
|
|
511
|
+
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
512
|
+
if (t.indexOf(r) !== -1) continue;
|
|
513
|
+
n[r] = e[r];
|
|
514
|
+
}
|
|
515
|
+
return n;
|
|
516
|
+
}
|
|
517
|
+
function lt(e, t) {
|
|
518
|
+
if (typeof e != "object" || !e) return e;
|
|
519
|
+
var n = e[Symbol.toPrimitive];
|
|
520
|
+
if (n !== void 0) {
|
|
521
|
+
var r = n.call(e, t || "default");
|
|
522
|
+
if (typeof r != "object") return r;
|
|
523
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
524
|
+
}
|
|
525
|
+
return (t === "string" ? String : Number)(e);
|
|
526
|
+
}
|
|
527
|
+
function ut(e) {
|
|
528
|
+
var t = lt(e, "string");
|
|
529
|
+
return typeof t == "symbol" ? t : t + "";
|
|
530
|
+
}
|
|
531
|
+
function dt(e) {
|
|
532
|
+
"@babel/helpers - typeof";
|
|
533
|
+
return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
534
|
+
return typeof e;
|
|
535
|
+
} : function(e) {
|
|
536
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
537
|
+
}, dt(e);
|
|
538
|
+
}
|
|
539
|
+
var ft = "1.15.7";
|
|
540
|
+
function pt(e) {
|
|
541
|
+
if (typeof window < "u" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(e);
|
|
542
|
+
}
|
|
543
|
+
var mt = pt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), ht = pt(/Edge/i), gt = pt(/firefox/i), _t = pt(/safari/i) && !pt(/chrome/i) && !pt(/android/i), vt = pt(/iP(ad|od|hone)/i), yt = pt(/chrome/i) && pt(/android/i), bt = {
|
|
544
|
+
capture: !1,
|
|
545
|
+
passive: !1
|
|
599
546
|
};
|
|
600
|
-
function
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
function
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
function
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
var
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
for (var i = 0, r = 0, l = e.children; r < l.length; ) {
|
|
716
|
-
if (l[r].style.display !== "none" && l[r] !== w.ghost && (n || l[r] !== w.dragged) && de(l[r], o.draggable, e, !1)) {
|
|
717
|
-
if (i === t)
|
|
718
|
-
return l[r];
|
|
719
|
-
i++;
|
|
720
|
-
}
|
|
721
|
-
r++;
|
|
722
|
-
}
|
|
723
|
-
return null;
|
|
724
|
-
}
|
|
725
|
-
function Jt(e, t) {
|
|
726
|
-
for (var o = e.lastElementChild; o && (o === w.ghost || y(o, "display") === "none" || t && !Et(o, t)); )
|
|
727
|
-
o = o.previousElementSibling;
|
|
728
|
-
return o || null;
|
|
729
|
-
}
|
|
730
|
-
function le(e, t) {
|
|
731
|
-
var o = 0;
|
|
732
|
-
if (!e || !e.parentNode)
|
|
733
|
-
return -1;
|
|
734
|
-
for (; e = e.previousElementSibling; )
|
|
735
|
-
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== w.clone && (!t || Et(e, t)) && o++;
|
|
736
|
-
return o;
|
|
737
|
-
}
|
|
738
|
-
function wn(e) {
|
|
739
|
-
var t = 0, o = 0, n = pe();
|
|
740
|
-
if (e)
|
|
741
|
-
do {
|
|
742
|
-
var i = He(e), r = i.a, l = i.d;
|
|
743
|
-
t += e.scrollLeft * r, o += e.scrollTop * l;
|
|
744
|
-
} while (e !== n && (e = e.parentNode));
|
|
745
|
-
return [t, o];
|
|
746
|
-
}
|
|
747
|
-
function li(e, t) {
|
|
748
|
-
for (var o in e)
|
|
749
|
-
if (e.hasOwnProperty(o)) {
|
|
750
|
-
for (var n in t)
|
|
751
|
-
if (t.hasOwnProperty(n) && t[n] === e[o][n]) return Number(o);
|
|
752
|
-
}
|
|
753
|
-
return -1;
|
|
754
|
-
}
|
|
755
|
-
function Ce(e, t) {
|
|
756
|
-
if (!e || !e.getBoundingClientRect) return pe();
|
|
757
|
-
var o = e, n = !1;
|
|
758
|
-
do
|
|
759
|
-
if (o.clientWidth < o.scrollWidth || o.clientHeight < o.scrollHeight) {
|
|
760
|
-
var i = y(o);
|
|
761
|
-
if (o.clientWidth < o.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || o.clientHeight < o.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
762
|
-
if (!o.getBoundingClientRect || o === document.body) return pe();
|
|
763
|
-
if (n || t) return o;
|
|
764
|
-
n = !0;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
while (o = o.parentNode);
|
|
768
|
-
return pe();
|
|
769
|
-
}
|
|
770
|
-
function si(e, t) {
|
|
771
|
-
if (e && t)
|
|
772
|
-
for (var o in t)
|
|
773
|
-
t.hasOwnProperty(o) && (e[o] = t[o]);
|
|
774
|
-
return e;
|
|
775
|
-
}
|
|
776
|
-
function Mt(e, t) {
|
|
777
|
-
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);
|
|
778
|
-
}
|
|
779
|
-
var it;
|
|
780
|
-
function $n(e, t) {
|
|
781
|
-
return function() {
|
|
782
|
-
if (!it) {
|
|
783
|
-
var o = arguments, n = this;
|
|
784
|
-
o.length === 1 ? e.call(n, o[0]) : e.apply(n, o), it = setTimeout(function() {
|
|
785
|
-
it = void 0;
|
|
786
|
-
}, t);
|
|
787
|
-
}
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
function ui() {
|
|
791
|
-
clearTimeout(it), it = void 0;
|
|
792
|
-
}
|
|
793
|
-
function Rn(e, t, o) {
|
|
794
|
-
e.scrollLeft += t, e.scrollTop += o;
|
|
795
|
-
}
|
|
796
|
-
function Fn(e) {
|
|
797
|
-
var t = window.Polymer, o = window.jQuery || window.Zepto;
|
|
798
|
-
return t && t.dom ? t.dom(e).cloneNode(!0) : o ? o(e).clone(!0)[0] : e.cloneNode(!0);
|
|
799
|
-
}
|
|
800
|
-
function Bn(e, t, o) {
|
|
801
|
-
var n = {};
|
|
802
|
-
return Array.from(e.children).forEach(function(i) {
|
|
803
|
-
var r, l, a, u;
|
|
804
|
-
if (!(!de(i, t.draggable, e, !1) || i.animated || i === o)) {
|
|
805
|
-
var d = L(i);
|
|
806
|
-
n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, d.left), n.top = Math.min((l = n.top) !== null && l !== void 0 ? l : 1 / 0, d.top), n.right = Math.max((a = n.right) !== null && a !== void 0 ? a : -1 / 0, d.right), n.bottom = Math.max((u = n.bottom) !== null && u !== void 0 ? u : -1 / 0, d.bottom);
|
|
807
|
-
}
|
|
808
|
-
}), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
|
|
809
|
-
}
|
|
810
|
-
var ne = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
811
|
-
function ci() {
|
|
812
|
-
var e = [], t;
|
|
813
|
-
return {
|
|
814
|
-
captureAnimationState: function() {
|
|
815
|
-
if (e = [], !!this.options.animation) {
|
|
816
|
-
var n = [].slice.call(this.el.children);
|
|
817
|
-
n.forEach(function(i) {
|
|
818
|
-
if (!(y(i, "display") === "none" || i === w.ghost)) {
|
|
819
|
-
e.push({
|
|
820
|
-
target: i,
|
|
821
|
-
rect: L(i)
|
|
822
|
-
});
|
|
823
|
-
var r = ge({}, e[e.length - 1].rect);
|
|
824
|
-
if (i.thisAnimationDuration) {
|
|
825
|
-
var l = He(i, !0);
|
|
826
|
-
l && (r.top -= l.f, r.left -= l.e);
|
|
827
|
-
}
|
|
828
|
-
i.fromRect = r;
|
|
829
|
-
}
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
},
|
|
833
|
-
addAnimationState: function(n) {
|
|
834
|
-
e.push(n);
|
|
835
|
-
},
|
|
836
|
-
removeAnimationState: function(n) {
|
|
837
|
-
e.splice(li(e, {
|
|
838
|
-
target: n
|
|
839
|
-
}), 1);
|
|
840
|
-
},
|
|
841
|
-
animateAll: function(n) {
|
|
842
|
-
var i = this;
|
|
843
|
-
if (!this.options.animation) {
|
|
844
|
-
clearTimeout(t), typeof n == "function" && n();
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
var r = !1, l = 0;
|
|
848
|
-
e.forEach(function(a) {
|
|
849
|
-
var u = 0, d = a.target, f = d.fromRect, h = L(d), c = d.prevFromRect, v = d.prevToRect, m = a.rect, g = He(d, !0);
|
|
850
|
-
g && (h.top -= g.f, h.left -= g.e), d.toRect = h, d.thisAnimationDuration && Mt(c, h) && !Mt(f, h) && // Make sure animatingRect is on line between toRect & fromRect
|
|
851
|
-
(m.top - h.top) / (m.left - h.left) === (f.top - h.top) / (f.left - h.left) && (u = fi(m, c, v, i.options)), Mt(h, f) || (d.prevFromRect = f, d.prevToRect = h, u || (u = i.options.animation), i.animate(d, m, h, u)), u && (r = !0, l = Math.max(l, u), clearTimeout(d.animationResetTimer), d.animationResetTimer = setTimeout(function() {
|
|
852
|
-
d.animationTime = 0, d.prevFromRect = null, d.fromRect = null, d.prevToRect = null, d.thisAnimationDuration = null;
|
|
853
|
-
}, u), d.thisAnimationDuration = u);
|
|
854
|
-
}), clearTimeout(t), r ? t = setTimeout(function() {
|
|
855
|
-
typeof n == "function" && n();
|
|
856
|
-
}, l) : typeof n == "function" && n(), e = [];
|
|
857
|
-
},
|
|
858
|
-
animate: function(n, i, r, l) {
|
|
859
|
-
if (l) {
|
|
860
|
-
y(n, "transition", ""), y(n, "transform", "");
|
|
861
|
-
var a = He(this.el), u = a && a.a, d = a && a.d, f = (i.left - r.left) / (u || 1), h = (i.top - r.top) / (d || 1);
|
|
862
|
-
n.animatingX = !!f, n.animatingY = !!h, y(n, "transform", "translate3d(" + f + "px," + h + "px,0)"), this.forRepaintDummy = di(n), y(n, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), y(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
|
|
863
|
-
y(n, "transition", ""), y(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
|
|
864
|
-
}, l);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
};
|
|
868
|
-
}
|
|
869
|
-
function di(e) {
|
|
870
|
-
return e.offsetWidth;
|
|
871
|
-
}
|
|
872
|
-
function fi(e, t, o, n) {
|
|
873
|
-
return Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) / Math.sqrt(Math.pow(t.top - o.top, 2) + Math.pow(t.left - o.left, 2)) * n.animation;
|
|
874
|
-
}
|
|
875
|
-
var Re = [], $t = {
|
|
876
|
-
initializeByDefault: !0
|
|
877
|
-
}, ct = {
|
|
878
|
-
mount: function(t) {
|
|
879
|
-
for (var o in $t)
|
|
880
|
-
$t.hasOwnProperty(o) && !(o in t) && (t[o] = $t[o]);
|
|
881
|
-
Re.forEach(function(n) {
|
|
882
|
-
if (n.pluginName === t.pluginName)
|
|
883
|
-
throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
|
|
884
|
-
}), Re.push(t);
|
|
885
|
-
},
|
|
886
|
-
pluginEvent: function(t, o, n) {
|
|
887
|
-
var i = this;
|
|
888
|
-
this.eventCanceled = !1, n.cancel = function() {
|
|
889
|
-
i.eventCanceled = !0;
|
|
890
|
-
};
|
|
891
|
-
var r = t + "Global";
|
|
892
|
-
Re.forEach(function(l) {
|
|
893
|
-
o[l.pluginName] && (o[l.pluginName][r] && o[l.pluginName][r](ge({
|
|
894
|
-
sortable: o
|
|
895
|
-
}, n)), o.options[l.pluginName] && o[l.pluginName][t] && o[l.pluginName][t](ge({
|
|
896
|
-
sortable: o
|
|
897
|
-
}, n)));
|
|
898
|
-
});
|
|
899
|
-
},
|
|
900
|
-
initializePlugins: function(t, o, n, i) {
|
|
901
|
-
Re.forEach(function(a) {
|
|
902
|
-
var u = a.pluginName;
|
|
903
|
-
if (!(!t.options[u] && !a.initializeByDefault)) {
|
|
904
|
-
var d = new a(t, o, t.options);
|
|
905
|
-
d.sortable = t, d.options = t.options, t[u] = d, we(n, d.defaults);
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
for (var r in t.options)
|
|
909
|
-
if (t.options.hasOwnProperty(r)) {
|
|
910
|
-
var l = this.modifyOption(t, r, t.options[r]);
|
|
911
|
-
typeof l < "u" && (t.options[r] = l);
|
|
912
|
-
}
|
|
913
|
-
},
|
|
914
|
-
getEventProperties: function(t, o) {
|
|
915
|
-
var n = {};
|
|
916
|
-
return Re.forEach(function(i) {
|
|
917
|
-
typeof i.eventProperties == "function" && we(n, i.eventProperties.call(o[i.pluginName], t));
|
|
918
|
-
}), n;
|
|
919
|
-
},
|
|
920
|
-
modifyOption: function(t, o, n) {
|
|
921
|
-
var i;
|
|
922
|
-
return Re.forEach(function(r) {
|
|
923
|
-
t[r.pluginName] && r.optionListeners && typeof r.optionListeners[o] == "function" && (i = r.optionListeners[o].call(t[r.pluginName], n));
|
|
924
|
-
}), i;
|
|
925
|
-
}
|
|
926
|
-
};
|
|
927
|
-
function hi(e) {
|
|
928
|
-
var t = e.sortable, o = e.rootEl, n = e.name, i = e.targetEl, r = e.cloneEl, l = e.toEl, a = e.fromEl, u = e.oldIndex, d = e.newIndex, f = e.oldDraggableIndex, h = e.newDraggableIndex, c = e.originalEvent, v = e.putSortable, m = e.extraEventProperties;
|
|
929
|
-
if (t = t || o && o[ne], !!t) {
|
|
930
|
-
var g, S = t.options, k = "on" + n.charAt(0).toUpperCase() + n.substr(1);
|
|
931
|
-
window.CustomEvent && !Ee && !ut ? g = new CustomEvent(n, {
|
|
932
|
-
bubbles: !0,
|
|
933
|
-
cancelable: !0
|
|
934
|
-
}) : (g = document.createEvent("Event"), g.initEvent(n, !0, !0)), g.to = l || o, g.from = a || o, g.item = i || o, g.clone = r, g.oldIndex = u, g.newIndex = d, g.oldDraggableIndex = f, g.newDraggableIndex = h, g.originalEvent = c, g.pullMode = v ? v.lastPutMode : void 0;
|
|
935
|
-
var x = ge(ge({}, m), ct.getEventProperties(n, t));
|
|
936
|
-
for (var T in x)
|
|
937
|
-
g[T] = x[T];
|
|
938
|
-
o && o.dispatchEvent(g), S[k] && S[k].call(t, g);
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
var vi = ["evt"], te = function(t, o) {
|
|
942
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = ni(n, vi);
|
|
943
|
-
ct.pluginEvent.bind(w)(t, o, ge({
|
|
944
|
-
dragEl: p,
|
|
945
|
-
parentEl: B,
|
|
946
|
-
ghostEl: E,
|
|
947
|
-
rootEl: $,
|
|
948
|
-
nextEl: Ne,
|
|
949
|
-
lastDownEl: mt,
|
|
950
|
-
cloneEl: R,
|
|
951
|
-
cloneHidden: Se,
|
|
952
|
-
dragStarted: Qe,
|
|
953
|
-
putSortable: z,
|
|
954
|
-
activeSortable: w.active,
|
|
955
|
-
originalEvent: i,
|
|
956
|
-
oldIndex: Le,
|
|
957
|
-
oldDraggableIndex: rt,
|
|
958
|
-
newIndex: re,
|
|
959
|
-
newDraggableIndex: _e,
|
|
960
|
-
hideGhostForTarget: Yn,
|
|
961
|
-
unhideGhostForTarget: Hn,
|
|
962
|
-
cloneNowHidden: function() {
|
|
963
|
-
Se = !0;
|
|
964
|
-
},
|
|
965
|
-
cloneNowShown: function() {
|
|
966
|
-
Se = !1;
|
|
967
|
-
},
|
|
968
|
-
dispatchSortableEvent: function(a) {
|
|
969
|
-
J({
|
|
970
|
-
sortable: o,
|
|
971
|
-
name: a,
|
|
972
|
-
originalEvent: i
|
|
973
|
-
});
|
|
974
|
-
}
|
|
975
|
-
}, r));
|
|
976
|
-
};
|
|
977
|
-
function J(e) {
|
|
978
|
-
hi(ge({
|
|
979
|
-
putSortable: z,
|
|
980
|
-
cloneEl: R,
|
|
981
|
-
targetEl: p,
|
|
982
|
-
rootEl: $,
|
|
983
|
-
oldIndex: Le,
|
|
984
|
-
oldDraggableIndex: rt,
|
|
985
|
-
newIndex: re,
|
|
986
|
-
newDraggableIndex: _e
|
|
987
|
-
}, e));
|
|
988
|
-
}
|
|
989
|
-
var p, B, E, $, Ne, mt, R, Se, Le, re, rt, _e, dt, z, Be = !1, Tt = !1, _t = [], Oe, ce, Rt, Ft, En, Tn, Qe, Fe, at, lt = !1, ft = !1, pt, G, Bt = [], zt = !1, Dt = [], kt = typeof document < "u", ht = Qt, _n = ut || Ee ? "cssFloat" : "float", mi = kt && !On && !Qt && "draggable" in document.createElement("div"), Wn = (function() {
|
|
990
|
-
if (kt) {
|
|
991
|
-
if (Ee)
|
|
992
|
-
return !1;
|
|
993
|
-
var e = document.createElement("x");
|
|
994
|
-
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
995
|
-
}
|
|
996
|
-
})(), Ln = function(t, o) {
|
|
997
|
-
var n = y(t), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = ze(t, 0, o), l = ze(t, 1, o), a = r && y(r), u = l && y(l), d = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + L(r).width, f = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + L(l).width;
|
|
998
|
-
if (n.display === "flex")
|
|
999
|
-
return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
1000
|
-
if (n.display === "grid")
|
|
1001
|
-
return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
1002
|
-
if (r && a.float && a.float !== "none") {
|
|
1003
|
-
var h = a.float === "left" ? "left" : "right";
|
|
1004
|
-
return l && (u.clear === "both" || u.clear === h) ? "vertical" : "horizontal";
|
|
1005
|
-
}
|
|
1006
|
-
return r && (a.display === "block" || a.display === "flex" || a.display === "table" || a.display === "grid" || d >= i && n[_n] === "none" || l && n[_n] === "none" && d + f > i) ? "vertical" : "horizontal";
|
|
1007
|
-
}, pi = function(t, o, n) {
|
|
1008
|
-
var i = n ? t.left : t.top, r = n ? t.right : t.bottom, l = n ? t.width : t.height, a = n ? o.left : o.top, u = n ? o.right : o.bottom, d = n ? o.width : o.height;
|
|
1009
|
-
return i === a || r === u || i + l / 2 === a + d / 2;
|
|
1010
|
-
}, gi = function(t, o) {
|
|
1011
|
-
var n;
|
|
1012
|
-
return _t.some(function(i) {
|
|
1013
|
-
var r = i[ne].options.emptyInsertThreshold;
|
|
1014
|
-
if (!(!r || Jt(i))) {
|
|
1015
|
-
var l = L(i), a = t >= l.left - r && t <= l.right + r, u = o >= l.top - r && o <= l.bottom + r;
|
|
1016
|
-
if (a && u)
|
|
1017
|
-
return n = i;
|
|
1018
|
-
}
|
|
1019
|
-
}), n;
|
|
1020
|
-
}, Xn = function(t) {
|
|
1021
|
-
function o(r, l) {
|
|
1022
|
-
return function(a, u, d, f) {
|
|
1023
|
-
var h = a.options.group.name && u.options.group.name && a.options.group.name === u.options.group.name;
|
|
1024
|
-
if (r == null && (l || h))
|
|
1025
|
-
return !0;
|
|
1026
|
-
if (r == null || r === !1)
|
|
1027
|
-
return !1;
|
|
1028
|
-
if (l && r === "clone")
|
|
1029
|
-
return r;
|
|
1030
|
-
if (typeof r == "function")
|
|
1031
|
-
return o(r(a, u, d, f), l)(a, u, d, f);
|
|
1032
|
-
var c = (l ? a : u).options.group.name;
|
|
1033
|
-
return r === !0 || typeof r == "string" && r === c || r.join && r.indexOf(c) > -1;
|
|
1034
|
-
};
|
|
1035
|
-
}
|
|
1036
|
-
var n = {}, i = t.group;
|
|
1037
|
-
(!i || qt(i) != "object") && (i = {
|
|
1038
|
-
name: i
|
|
1039
|
-
}), n.name = i.name, n.checkPull = o(i.pull, !0), n.checkPut = o(i.put), n.revertClone = i.revertClone, t.group = n;
|
|
1040
|
-
}, Yn = function() {
|
|
1041
|
-
!Wn && E && y(E, "display", "none");
|
|
1042
|
-
}, Hn = function() {
|
|
1043
|
-
!Wn && E && y(E, "display", "");
|
|
1044
|
-
};
|
|
1045
|
-
kt && !On && document.addEventListener("click", function(e) {
|
|
1046
|
-
if (Tt)
|
|
1047
|
-
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Tt = !1, !1;
|
|
1048
|
-
}, !0);
|
|
1049
|
-
var Pe = function(t) {
|
|
1050
|
-
if (p) {
|
|
1051
|
-
t = t.touches ? t.touches[0] : t;
|
|
1052
|
-
var o = gi(t.clientX, t.clientY);
|
|
1053
|
-
if (o) {
|
|
1054
|
-
var n = {};
|
|
1055
|
-
for (var i in t)
|
|
1056
|
-
t.hasOwnProperty(i) && (n[i] = t[i]);
|
|
1057
|
-
n.target = n.rootEl = o, n.preventDefault = void 0, n.stopPropagation = void 0, o[ne]._onDragOver(n);
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}, bi = function(t) {
|
|
1061
|
-
p && p.parentNode[ne]._isOutsideThisEl(t.target);
|
|
1062
|
-
};
|
|
1063
|
-
function w(e, t) {
|
|
1064
|
-
if (!(e && e.nodeType && e.nodeType === 1))
|
|
1065
|
-
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
|
|
1066
|
-
this.el = e, this.options = t = we({}, t), e[ne] = this;
|
|
1067
|
-
var o = {
|
|
1068
|
-
group: null,
|
|
1069
|
-
sort: !0,
|
|
1070
|
-
disabled: !1,
|
|
1071
|
-
store: null,
|
|
1072
|
-
handle: null,
|
|
1073
|
-
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
1074
|
-
swapThreshold: 1,
|
|
1075
|
-
// percentage; 0 <= x <= 1
|
|
1076
|
-
invertSwap: !1,
|
|
1077
|
-
// invert always
|
|
1078
|
-
invertedSwapThreshold: null,
|
|
1079
|
-
// will be set to same as swapThreshold if default
|
|
1080
|
-
removeCloneOnHide: !0,
|
|
1081
|
-
direction: function() {
|
|
1082
|
-
return Ln(e, this.options);
|
|
1083
|
-
},
|
|
1084
|
-
ghostClass: "sortable-ghost",
|
|
1085
|
-
chosenClass: "sortable-chosen",
|
|
1086
|
-
dragClass: "sortable-drag",
|
|
1087
|
-
ignore: "a, img",
|
|
1088
|
-
filter: null,
|
|
1089
|
-
preventOnFilter: !0,
|
|
1090
|
-
animation: 0,
|
|
1091
|
-
easing: null,
|
|
1092
|
-
setData: function(l, a) {
|
|
1093
|
-
l.setData("Text", a.textContent);
|
|
1094
|
-
},
|
|
1095
|
-
dropBubble: !1,
|
|
1096
|
-
dragoverBubble: !1,
|
|
1097
|
-
dataIdAttr: "data-id",
|
|
1098
|
-
delay: 0,
|
|
1099
|
-
delayOnTouchOnly: !1,
|
|
1100
|
-
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
1101
|
-
forceFallback: !1,
|
|
1102
|
-
fallbackClass: "sortable-fallback",
|
|
1103
|
-
fallbackOnBody: !1,
|
|
1104
|
-
fallbackTolerance: 0,
|
|
1105
|
-
fallbackOffset: {
|
|
1106
|
-
x: 0,
|
|
1107
|
-
y: 0
|
|
1108
|
-
},
|
|
1109
|
-
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
1110
|
-
supportPointer: w.supportPointer !== !1 && "PointerEvent" in window && (!ot || Qt),
|
|
1111
|
-
emptyInsertThreshold: 5
|
|
1112
|
-
};
|
|
1113
|
-
ct.initializePlugins(this, e, o);
|
|
1114
|
-
for (var n in o)
|
|
1115
|
-
!(n in t) && (t[n] = o[n]);
|
|
1116
|
-
Xn(t);
|
|
1117
|
-
for (var i in this)
|
|
1118
|
-
i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
1119
|
-
this.nativeDraggable = t.forceFallback ? !1 : mi, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? I(e, "pointerdown", this._onTapStart) : (I(e, "mousedown", this._onTapStart), I(e, "touchstart", this._onTapStart)), this.nativeDraggable && (I(e, "dragover", this), I(e, "dragenter", this)), _t.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), we(this, ci());
|
|
1120
|
-
}
|
|
1121
|
-
w.prototype = /** @lends Sortable.prototype */
|
|
1122
|
-
{
|
|
1123
|
-
constructor: w,
|
|
1124
|
-
_isOutsideThisEl: function(t) {
|
|
1125
|
-
!this.el.contains(t) && t !== this.el && (Fe = null);
|
|
1126
|
-
},
|
|
1127
|
-
_getDirection: function(t, o) {
|
|
1128
|
-
return typeof this.options.direction == "function" ? this.options.direction.call(this, t, o, p) : this.options.direction;
|
|
1129
|
-
},
|
|
1130
|
-
_onTapStart: function(t) {
|
|
1131
|
-
if (t.cancelable) {
|
|
1132
|
-
var o = this, n = this.el, i = this.options, r = i.preventOnFilter, l = t.type, a = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, u = (a || t).target, d = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || u, f = i.filter;
|
|
1133
|
-
if (Ci(n), !p && !(/mousedown|pointerdown/.test(l) && t.button !== 0 || i.disabled) && !d.isContentEditable && !(!this.nativeDraggable && ot && u && u.tagName.toUpperCase() === "SELECT") && (u = de(u, i.draggable, n, !1), !(u && u.animated) && mt !== u)) {
|
|
1134
|
-
if (Le = le(u), rt = le(u, i.draggable), typeof f == "function") {
|
|
1135
|
-
if (f.call(this, t, u, this)) {
|
|
1136
|
-
J({
|
|
1137
|
-
sortable: o,
|
|
1138
|
-
rootEl: d,
|
|
1139
|
-
name: "filter",
|
|
1140
|
-
targetEl: u,
|
|
1141
|
-
toEl: n,
|
|
1142
|
-
fromEl: n
|
|
1143
|
-
}), te("filter", o, {
|
|
1144
|
-
evt: t
|
|
1145
|
-
}), r && t.preventDefault();
|
|
1146
|
-
return;
|
|
1147
|
-
}
|
|
1148
|
-
} else if (f && (f = f.split(",").some(function(h) {
|
|
1149
|
-
if (h = de(d, h.trim(), n, !1), h)
|
|
1150
|
-
return J({
|
|
1151
|
-
sortable: o,
|
|
1152
|
-
rootEl: h,
|
|
1153
|
-
name: "filter",
|
|
1154
|
-
targetEl: u,
|
|
1155
|
-
fromEl: n,
|
|
1156
|
-
toEl: n
|
|
1157
|
-
}), te("filter", o, {
|
|
1158
|
-
evt: t
|
|
1159
|
-
}), !0;
|
|
1160
|
-
}), f)) {
|
|
1161
|
-
r && t.preventDefault();
|
|
1162
|
-
return;
|
|
1163
|
-
}
|
|
1164
|
-
i.handle && !de(d, i.handle, n, !1) || this._prepareDragStart(t, a, u);
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
},
|
|
1168
|
-
_prepareDragStart: function(t, o, n) {
|
|
1169
|
-
var i = this, r = i.el, l = i.options, a = r.ownerDocument, u;
|
|
1170
|
-
if (n && !p && n.parentNode === r) {
|
|
1171
|
-
var d = L(n);
|
|
1172
|
-
if ($ = r, p = n, B = p.parentNode, Ne = p.nextSibling, mt = n, dt = l.group, w.dragged = p, Oe = {
|
|
1173
|
-
target: p,
|
|
1174
|
-
clientX: (o || t).clientX,
|
|
1175
|
-
clientY: (o || t).clientY
|
|
1176
|
-
}, En = Oe.clientX - d.left, Tn = Oe.clientY - d.top, this._lastX = (o || t).clientX, this._lastY = (o || t).clientY, p.style["will-change"] = "all", u = function() {
|
|
1177
|
-
if (te("delayEnded", i, {
|
|
1178
|
-
evt: t
|
|
1179
|
-
}), w.eventCanceled) {
|
|
1180
|
-
i._onDrop();
|
|
1181
|
-
return;
|
|
1182
|
-
}
|
|
1183
|
-
i._disableDelayedDragEvents(), !gn && i.nativeDraggable && (p.draggable = !0), i._triggerDragStart(t, o), J({
|
|
1184
|
-
sortable: i,
|
|
1185
|
-
name: "choose",
|
|
1186
|
-
originalEvent: t
|
|
1187
|
-
}), ie(p, l.chosenClass, !0);
|
|
1188
|
-
}, l.ignore.split(",").forEach(function(f) {
|
|
1189
|
-
Mn(p, f.trim(), Wt);
|
|
1190
|
-
}), I(a, "dragover", Pe), I(a, "mousemove", Pe), I(a, "touchmove", Pe), l.supportPointer ? (I(a, "pointerup", i._onDrop), !this.nativeDraggable && I(a, "pointercancel", i._onDrop)) : (I(a, "mouseup", i._onDrop), I(a, "touchend", i._onDrop), I(a, "touchcancel", i._onDrop)), gn && this.nativeDraggable && (this.options.touchStartThreshold = 4, p.draggable = !0), te("delayStart", this, {
|
|
1191
|
-
evt: t
|
|
1192
|
-
}), l.delay && (!l.delayOnTouchOnly || o) && (!this.nativeDraggable || !(ut || Ee))) {
|
|
1193
|
-
if (w.eventCanceled) {
|
|
1194
|
-
this._onDrop();
|
|
1195
|
-
return;
|
|
1196
|
-
}
|
|
1197
|
-
l.supportPointer ? (I(a, "pointerup", i._disableDelayedDrag), I(a, "pointercancel", i._disableDelayedDrag)) : (I(a, "mouseup", i._disableDelayedDrag), I(a, "touchend", i._disableDelayedDrag), I(a, "touchcancel", i._disableDelayedDrag)), I(a, "mousemove", i._delayedDragTouchMoveHandler), I(a, "touchmove", i._delayedDragTouchMoveHandler), l.supportPointer && I(a, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(u, l.delay);
|
|
1198
|
-
} else
|
|
1199
|
-
u();
|
|
1200
|
-
}
|
|
1201
|
-
},
|
|
1202
|
-
_delayedDragTouchMoveHandler: function(t) {
|
|
1203
|
-
var o = t.touches ? t.touches[0] : t;
|
|
1204
|
-
Math.max(Math.abs(o.clientX - this._lastX), Math.abs(o.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
1205
|
-
},
|
|
1206
|
-
_disableDelayedDrag: function() {
|
|
1207
|
-
p && Wt(p), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
1208
|
-
},
|
|
1209
|
-
_disableDelayedDragEvents: function() {
|
|
1210
|
-
var t = this.el.ownerDocument;
|
|
1211
|
-
C(t, "mouseup", this._disableDelayedDrag), C(t, "touchend", this._disableDelayedDrag), C(t, "touchcancel", this._disableDelayedDrag), C(t, "pointerup", this._disableDelayedDrag), C(t, "pointercancel", this._disableDelayedDrag), C(t, "mousemove", this._delayedDragTouchMoveHandler), C(t, "touchmove", this._delayedDragTouchMoveHandler), C(t, "pointermove", this._delayedDragTouchMoveHandler);
|
|
1212
|
-
},
|
|
1213
|
-
_triggerDragStart: function(t, o) {
|
|
1214
|
-
o = o || t.pointerType == "touch" && t, !this.nativeDraggable || o ? this.options.supportPointer ? I(document, "pointermove", this._onTouchMove) : o ? I(document, "touchmove", this._onTouchMove) : I(document, "mousemove", this._onTouchMove) : (I(p, "dragend", this), I($, "dragstart", this._onDragStart));
|
|
1215
|
-
try {
|
|
1216
|
-
document.selection ? gt(function() {
|
|
1217
|
-
document.selection.empty();
|
|
1218
|
-
}) : window.getSelection().removeAllRanges();
|
|
1219
|
-
} catch {
|
|
1220
|
-
}
|
|
1221
|
-
},
|
|
1222
|
-
_dragStarted: function(t, o) {
|
|
1223
|
-
if (Be = !1, $ && p) {
|
|
1224
|
-
te("dragStarted", this, {
|
|
1225
|
-
evt: o
|
|
1226
|
-
}), this.nativeDraggable && I(document, "dragover", bi);
|
|
1227
|
-
var n = this.options;
|
|
1228
|
-
!t && ie(p, n.dragClass, !1), ie(p, n.ghostClass, !0), w.active = this, t && this._appendGhost(), J({
|
|
1229
|
-
sortable: this,
|
|
1230
|
-
name: "start",
|
|
1231
|
-
originalEvent: o
|
|
1232
|
-
});
|
|
1233
|
-
} else
|
|
1234
|
-
this._nulling();
|
|
1235
|
-
},
|
|
1236
|
-
_emulateDragOver: function() {
|
|
1237
|
-
if (ce) {
|
|
1238
|
-
this._lastX = ce.clientX, this._lastY = ce.clientY, Yn();
|
|
1239
|
-
for (var t = document.elementFromPoint(ce.clientX, ce.clientY), o = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(ce.clientX, ce.clientY), t !== o); )
|
|
1240
|
-
o = t;
|
|
1241
|
-
if (p.parentNode[ne]._isOutsideThisEl(t), o)
|
|
1242
|
-
do {
|
|
1243
|
-
if (o[ne]) {
|
|
1244
|
-
var n = void 0;
|
|
1245
|
-
if (n = o[ne]._onDragOver({
|
|
1246
|
-
clientX: ce.clientX,
|
|
1247
|
-
clientY: ce.clientY,
|
|
1248
|
-
target: t,
|
|
1249
|
-
rootEl: o
|
|
1250
|
-
}), n && !this.options.dragoverBubble)
|
|
1251
|
-
break;
|
|
1252
|
-
}
|
|
1253
|
-
t = o;
|
|
1254
|
-
} while (o = Nn(o));
|
|
1255
|
-
Hn();
|
|
1256
|
-
}
|
|
1257
|
-
},
|
|
1258
|
-
_onTouchMove: function(t) {
|
|
1259
|
-
if (Oe) {
|
|
1260
|
-
var o = this.options, n = o.fallbackTolerance, i = o.fallbackOffset, r = t.touches ? t.touches[0] : t, l = E && He(E, !0), a = E && l && l.a, u = E && l && l.d, d = ht && G && wn(G), f = (r.clientX - Oe.clientX + i.x) / (a || 1) + (d ? d[0] - Bt[0] : 0) / (a || 1), h = (r.clientY - Oe.clientY + i.y) / (u || 1) + (d ? d[1] - Bt[1] : 0) / (u || 1);
|
|
1261
|
-
if (!w.active && !Be) {
|
|
1262
|
-
if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
|
|
1263
|
-
return;
|
|
1264
|
-
this._onDragStart(t, !0);
|
|
1265
|
-
}
|
|
1266
|
-
if (E) {
|
|
1267
|
-
l ? (l.e += f - (Rt || 0), l.f += h - (Ft || 0)) : l = {
|
|
1268
|
-
a: 1,
|
|
1269
|
-
b: 0,
|
|
1270
|
-
c: 0,
|
|
1271
|
-
d: 1,
|
|
1272
|
-
e: f,
|
|
1273
|
-
f: h
|
|
1274
|
-
};
|
|
1275
|
-
var c = "matrix(".concat(l.a, ",").concat(l.b, ",").concat(l.c, ",").concat(l.d, ",").concat(l.e, ",").concat(l.f, ")");
|
|
1276
|
-
y(E, "webkitTransform", c), y(E, "mozTransform", c), y(E, "msTransform", c), y(E, "transform", c), Rt = f, Ft = h, ce = r;
|
|
1277
|
-
}
|
|
1278
|
-
t.cancelable && t.preventDefault();
|
|
1279
|
-
}
|
|
1280
|
-
},
|
|
1281
|
-
_appendGhost: function() {
|
|
1282
|
-
if (!E) {
|
|
1283
|
-
var t = this.options.fallbackOnBody ? document.body : $, o = L(p, !0, ht, !0, t), n = this.options;
|
|
1284
|
-
if (ht) {
|
|
1285
|
-
for (G = t; y(G, "position") === "static" && y(G, "transform") === "none" && G !== document; )
|
|
1286
|
-
G = G.parentNode;
|
|
1287
|
-
G !== document.body && G !== document.documentElement ? (G === document && (G = pe()), o.top += G.scrollTop, o.left += G.scrollLeft) : G = pe(), Bt = wn(G);
|
|
1288
|
-
}
|
|
1289
|
-
E = p.cloneNode(!0), ie(E, n.ghostClass, !1), ie(E, n.fallbackClass, !0), ie(E, n.dragClass, !0), y(E, "transition", ""), y(E, "transform", ""), y(E, "box-sizing", "border-box"), y(E, "margin", 0), y(E, "top", o.top), y(E, "left", o.left), y(E, "width", o.width), y(E, "height", o.height), y(E, "opacity", "0.8"), y(E, "position", ht ? "absolute" : "fixed"), y(E, "zIndex", "100000"), y(E, "pointerEvents", "none"), w.ghost = E, t.appendChild(E), y(E, "transform-origin", En / parseInt(E.style.width) * 100 + "% " + Tn / parseInt(E.style.height) * 100 + "%");
|
|
1290
|
-
}
|
|
1291
|
-
},
|
|
1292
|
-
_onDragStart: function(t, o) {
|
|
1293
|
-
var n = this, i = t.dataTransfer, r = n.options;
|
|
1294
|
-
if (te("dragStart", this, {
|
|
1295
|
-
evt: t
|
|
1296
|
-
}), w.eventCanceled) {
|
|
1297
|
-
this._onDrop();
|
|
1298
|
-
return;
|
|
1299
|
-
}
|
|
1300
|
-
te("setupClone", this), w.eventCanceled || (R = Fn(p), R.removeAttribute("id"), R.draggable = !1, R.style["will-change"] = "", this._hideClone(), ie(R, this.options.chosenClass, !1), w.clone = R), n.cloneId = gt(function() {
|
|
1301
|
-
te("clone", n), !w.eventCanceled && (n.options.removeCloneOnHide || $.insertBefore(R, p), n._hideClone(), J({
|
|
1302
|
-
sortable: n,
|
|
1303
|
-
name: "clone"
|
|
1304
|
-
}));
|
|
1305
|
-
}), !o && ie(p, r.dragClass, !0), o ? (Tt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (C(document, "mouseup", n._onDrop), C(document, "touchend", n._onDrop), C(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, p)), I(document, "drop", n), y(p, "transform", "translateZ(0)")), Be = !0, n._dragStartId = gt(n._dragStarted.bind(n, o, t)), I(document, "selectstart", n), Qe = !0, window.getSelection().removeAllRanges(), ot && y(document.body, "user-select", "none");
|
|
1306
|
-
},
|
|
1307
|
-
// Returns true - if no further action is needed (either inserted or another condition)
|
|
1308
|
-
_onDragOver: function(t) {
|
|
1309
|
-
var o = this.el, n = t.target, i, r, l, a = this.options, u = a.group, d = w.active, f = dt === u, h = a.sort, c = z || d, v, m = this, g = !1;
|
|
1310
|
-
if (zt) return;
|
|
1311
|
-
function S(Te, It) {
|
|
1312
|
-
te(Te, m, ge({
|
|
1313
|
-
evt: t,
|
|
1314
|
-
isOwner: f,
|
|
1315
|
-
axis: v ? "vertical" : "horizontal",
|
|
1316
|
-
revert: l,
|
|
1317
|
-
dragRect: i,
|
|
1318
|
-
targetRect: r,
|
|
1319
|
-
canSort: h,
|
|
1320
|
-
fromSortable: c,
|
|
1321
|
-
target: n,
|
|
1322
|
-
completed: x,
|
|
1323
|
-
onMove: function(je, Ge) {
|
|
1324
|
-
return vt($, o, p, i, je, L(je), t, Ge);
|
|
1325
|
-
},
|
|
1326
|
-
changed: T
|
|
1327
|
-
}, It));
|
|
1328
|
-
}
|
|
1329
|
-
function k() {
|
|
1330
|
-
S("dragOverAnimationCapture"), m.captureAnimationState(), m !== c && c.captureAnimationState();
|
|
1331
|
-
}
|
|
1332
|
-
function x(Te) {
|
|
1333
|
-
return S("dragOverCompleted", {
|
|
1334
|
-
insertion: Te
|
|
1335
|
-
}), Te && (f ? d._hideClone() : d._showClone(m), m !== c && (ie(p, z ? z.options.ghostClass : d.options.ghostClass, !1), ie(p, a.ghostClass, !0)), z !== m && m !== w.active ? z = m : m === w.active && z && (z = null), c === m && (m._ignoreWhileAnimating = n), m.animateAll(function() {
|
|
1336
|
-
S("dragOverAnimationComplete"), m._ignoreWhileAnimating = null;
|
|
1337
|
-
}), m !== c && (c.animateAll(), c._ignoreWhileAnimating = null)), (n === p && !p.animated || n === o && !n.animated) && (Fe = null), !a.dragoverBubble && !t.rootEl && n !== document && (p.parentNode[ne]._isOutsideThisEl(t.target), !Te && Pe(t)), !a.dragoverBubble && t.stopPropagation && t.stopPropagation(), g = !0;
|
|
1338
|
-
}
|
|
1339
|
-
function T() {
|
|
1340
|
-
re = le(p), _e = le(p, a.draggable), J({
|
|
1341
|
-
sortable: m,
|
|
1342
|
-
name: "change",
|
|
1343
|
-
toEl: o,
|
|
1344
|
-
newIndex: re,
|
|
1345
|
-
newDraggableIndex: _e,
|
|
1346
|
-
originalEvent: t
|
|
1347
|
-
});
|
|
1348
|
-
}
|
|
1349
|
-
if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), n = de(n, a.draggable, o, !0), S("dragOver"), w.eventCanceled) return g;
|
|
1350
|
-
if (p.contains(t.target) || n.animated && n.animatingX && n.animatingY || m._ignoreWhileAnimating === n)
|
|
1351
|
-
return x(!1);
|
|
1352
|
-
if (Tt = !1, d && !a.disabled && (f ? h || (l = B !== $) : z === this || (this.lastPutMode = dt.checkPull(this, d, p, t)) && u.checkPut(this, d, p, t))) {
|
|
1353
|
-
if (v = this._getDirection(t, n) === "vertical", i = L(p), S("dragOverValid"), w.eventCanceled) return g;
|
|
1354
|
-
if (l)
|
|
1355
|
-
return B = $, k(), this._hideClone(), S("revert"), w.eventCanceled || (Ne ? $.insertBefore(p, Ne) : $.appendChild(p)), x(!0);
|
|
1356
|
-
var _ = Jt(o, a.draggable);
|
|
1357
|
-
if (!_ || Ti(t, v, this) && !_.animated) {
|
|
1358
|
-
if (_ === p)
|
|
1359
|
-
return x(!1);
|
|
1360
|
-
if (_ && o === t.target && (n = _), n && (r = L(n)), vt($, o, p, i, n, r, t, !!n) !== !1)
|
|
1361
|
-
return k(), _ && _.nextSibling ? o.insertBefore(p, _.nextSibling) : o.appendChild(p), B = o, T(), x(!0);
|
|
1362
|
-
} else if (_ && Ei(t, v, this)) {
|
|
1363
|
-
var P = ze(o, 0, a, !0);
|
|
1364
|
-
if (P === p)
|
|
1365
|
-
return x(!1);
|
|
1366
|
-
if (n = P, r = L(n), vt($, o, p, i, n, r, t, !1) !== !1)
|
|
1367
|
-
return k(), o.insertBefore(p, P), B = o, T(), x(!0);
|
|
1368
|
-
} else if (n.parentNode === o) {
|
|
1369
|
-
r = L(n);
|
|
1370
|
-
var U = 0, be, ke = p.parentNode !== o, H = !pi(p.animated && p.toRect || i, n.animated && n.toRect || r, v), Ie = v ? "top" : "left", q = yn(n, "top", "top") || yn(p, "top", "top"), Z = q ? q.scrollTop : void 0;
|
|
1371
|
-
Fe !== n && (be = r[Ie], lt = !1, ft = !H && a.invertSwap || ke), U = _i(t, n, r, v, H ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, ft, Fe === n);
|
|
1372
|
-
var M;
|
|
1373
|
-
if (U !== 0) {
|
|
1374
|
-
var oe = le(p);
|
|
1375
|
-
do
|
|
1376
|
-
oe -= U, M = B.children[oe];
|
|
1377
|
-
while (M && (y(M, "display") === "none" || M === E));
|
|
1378
|
-
}
|
|
1379
|
-
if (U === 0 || M === n)
|
|
1380
|
-
return x(!1);
|
|
1381
|
-
Fe = n, at = U;
|
|
1382
|
-
var xe = n.nextElementSibling, fe = !1;
|
|
1383
|
-
fe = U === 1;
|
|
1384
|
-
var Ae = vt($, o, p, i, n, r, t, fe);
|
|
1385
|
-
if (Ae !== !1)
|
|
1386
|
-
return (Ae === 1 || Ae === -1) && (fe = Ae === 1), zt = !0, setTimeout(wi, 30), k(), fe && !xe ? o.appendChild(p) : n.parentNode.insertBefore(p, fe ? xe : n), q && Rn(q, 0, Z - q.scrollTop), B = p.parentNode, be !== void 0 && !ft && (pt = Math.abs(be - L(n)[Ie])), T(), x(!0);
|
|
1387
|
-
}
|
|
1388
|
-
if (o.contains(p))
|
|
1389
|
-
return x(!1);
|
|
1390
|
-
}
|
|
1391
|
-
return !1;
|
|
1392
|
-
},
|
|
1393
|
-
_ignoreWhileAnimating: null,
|
|
1394
|
-
_offMoveEvents: function() {
|
|
1395
|
-
C(document, "mousemove", this._onTouchMove), C(document, "touchmove", this._onTouchMove), C(document, "pointermove", this._onTouchMove), C(document, "dragover", Pe), C(document, "mousemove", Pe), C(document, "touchmove", Pe);
|
|
1396
|
-
},
|
|
1397
|
-
_offUpEvents: function() {
|
|
1398
|
-
var t = this.el.ownerDocument;
|
|
1399
|
-
C(t, "mouseup", this._onDrop), C(t, "touchend", this._onDrop), C(t, "pointerup", this._onDrop), C(t, "pointercancel", this._onDrop), C(t, "touchcancel", this._onDrop), C(document, "selectstart", this);
|
|
1400
|
-
},
|
|
1401
|
-
_onDrop: function(t) {
|
|
1402
|
-
var o = this.el, n = this.options;
|
|
1403
|
-
if (re = le(p), _e = le(p, n.draggable), te("drop", this, {
|
|
1404
|
-
evt: t
|
|
1405
|
-
}), B = p && p.parentNode, re = le(p), _e = le(p, n.draggable), w.eventCanceled) {
|
|
1406
|
-
this._nulling();
|
|
1407
|
-
return;
|
|
1408
|
-
}
|
|
1409
|
-
Be = !1, ft = !1, lt = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), jt(this.cloneId), jt(this._dragStartId), this.nativeDraggable && (C(document, "drop", this), C(o, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), ot && y(document.body, "user-select", ""), y(p, "transform", ""), t && (Qe && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), E && E.parentNode && E.parentNode.removeChild(E), ($ === B || z && z.lastPutMode !== "clone") && R && R.parentNode && R.parentNode.removeChild(R), p && (this.nativeDraggable && C(p, "dragend", this), Wt(p), p.style["will-change"] = "", Qe && !Be && ie(p, z ? z.options.ghostClass : this.options.ghostClass, !1), ie(p, this.options.chosenClass, !1), J({
|
|
1410
|
-
sortable: this,
|
|
1411
|
-
name: "unchoose",
|
|
1412
|
-
toEl: B,
|
|
1413
|
-
newIndex: null,
|
|
1414
|
-
newDraggableIndex: null,
|
|
1415
|
-
originalEvent: t
|
|
1416
|
-
}), $ !== B ? (re >= 0 && (J({
|
|
1417
|
-
rootEl: B,
|
|
1418
|
-
name: "add",
|
|
1419
|
-
toEl: B,
|
|
1420
|
-
fromEl: $,
|
|
1421
|
-
originalEvent: t
|
|
1422
|
-
}), J({
|
|
1423
|
-
sortable: this,
|
|
1424
|
-
name: "remove",
|
|
1425
|
-
toEl: B,
|
|
1426
|
-
originalEvent: t
|
|
1427
|
-
}), J({
|
|
1428
|
-
rootEl: B,
|
|
1429
|
-
name: "sort",
|
|
1430
|
-
toEl: B,
|
|
1431
|
-
fromEl: $,
|
|
1432
|
-
originalEvent: t
|
|
1433
|
-
}), J({
|
|
1434
|
-
sortable: this,
|
|
1435
|
-
name: "sort",
|
|
1436
|
-
toEl: B,
|
|
1437
|
-
originalEvent: t
|
|
1438
|
-
})), z && z.save()) : re !== Le && re >= 0 && (J({
|
|
1439
|
-
sortable: this,
|
|
1440
|
-
name: "update",
|
|
1441
|
-
toEl: B,
|
|
1442
|
-
originalEvent: t
|
|
1443
|
-
}), J({
|
|
1444
|
-
sortable: this,
|
|
1445
|
-
name: "sort",
|
|
1446
|
-
toEl: B,
|
|
1447
|
-
originalEvent: t
|
|
1448
|
-
})), w.active && ((re == null || re === -1) && (re = Le, _e = rt), J({
|
|
1449
|
-
sortable: this,
|
|
1450
|
-
name: "end",
|
|
1451
|
-
toEl: B,
|
|
1452
|
-
originalEvent: t
|
|
1453
|
-
}), this.save()))), this._nulling();
|
|
1454
|
-
},
|
|
1455
|
-
_nulling: function() {
|
|
1456
|
-
te("nulling", this), $ = p = B = E = Ne = R = mt = Se = Oe = ce = Qe = re = _e = Le = rt = Fe = at = z = dt = w.dragged = w.ghost = w.clone = w.active = null;
|
|
1457
|
-
var t = this.el;
|
|
1458
|
-
Dt.forEach(function(o) {
|
|
1459
|
-
t.contains(o) && (o.checked = !0);
|
|
1460
|
-
}), Dt.length = Rt = Ft = 0;
|
|
1461
|
-
},
|
|
1462
|
-
handleEvent: function(t) {
|
|
1463
|
-
switch (t.type) {
|
|
1464
|
-
case "drop":
|
|
1465
|
-
case "dragend":
|
|
1466
|
-
this._onDrop(t);
|
|
1467
|
-
break;
|
|
1468
|
-
case "dragenter":
|
|
1469
|
-
case "dragover":
|
|
1470
|
-
p && (this._onDragOver(t), yi(t));
|
|
1471
|
-
break;
|
|
1472
|
-
case "selectstart":
|
|
1473
|
-
t.preventDefault();
|
|
1474
|
-
break;
|
|
1475
|
-
}
|
|
1476
|
-
},
|
|
1477
|
-
/**
|
|
1478
|
-
* Serializes the item into an array of string.
|
|
1479
|
-
* @returns {String[]}
|
|
1480
|
-
*/
|
|
1481
|
-
toArray: function() {
|
|
1482
|
-
for (var t = [], o, n = this.el.children, i = 0, r = n.length, l = this.options; i < r; i++)
|
|
1483
|
-
o = n[i], de(o, l.draggable, this.el, !1) && t.push(o.getAttribute(l.dataIdAttr) || Si(o));
|
|
1484
|
-
return t;
|
|
1485
|
-
},
|
|
1486
|
-
/**
|
|
1487
|
-
* Sorts the elements according to the array.
|
|
1488
|
-
* @param {String[]} order order of the items
|
|
1489
|
-
*/
|
|
1490
|
-
sort: function(t, o) {
|
|
1491
|
-
var n = {}, i = this.el;
|
|
1492
|
-
this.toArray().forEach(function(r, l) {
|
|
1493
|
-
var a = i.children[l];
|
|
1494
|
-
de(a, this.options.draggable, i, !1) && (n[r] = a);
|
|
1495
|
-
}, this), o && this.captureAnimationState(), t.forEach(function(r) {
|
|
1496
|
-
n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
|
|
1497
|
-
}), o && this.animateAll();
|
|
1498
|
-
},
|
|
1499
|
-
/**
|
|
1500
|
-
* Save the current sorting
|
|
1501
|
-
*/
|
|
1502
|
-
save: function() {
|
|
1503
|
-
var t = this.options.store;
|
|
1504
|
-
t && t.set && t.set(this);
|
|
1505
|
-
},
|
|
1506
|
-
/**
|
|
1507
|
-
* 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.
|
|
1508
|
-
* @param {HTMLElement} el
|
|
1509
|
-
* @param {String} [selector] default: `options.draggable`
|
|
1510
|
-
* @returns {HTMLElement|null}
|
|
1511
|
-
*/
|
|
1512
|
-
closest: function(t, o) {
|
|
1513
|
-
return de(t, o || this.options.draggable, this.el, !1);
|
|
1514
|
-
},
|
|
1515
|
-
/**
|
|
1516
|
-
* Set/get option
|
|
1517
|
-
* @param {string} name
|
|
1518
|
-
* @param {*} [value]
|
|
1519
|
-
* @returns {*}
|
|
1520
|
-
*/
|
|
1521
|
-
option: function(t, o) {
|
|
1522
|
-
var n = this.options;
|
|
1523
|
-
if (o === void 0)
|
|
1524
|
-
return n[t];
|
|
1525
|
-
var i = ct.modifyOption(this, t, o);
|
|
1526
|
-
typeof i < "u" ? n[t] = i : n[t] = o, t === "group" && Xn(n);
|
|
1527
|
-
},
|
|
1528
|
-
/**
|
|
1529
|
-
* Destroy
|
|
1530
|
-
*/
|
|
1531
|
-
destroy: function() {
|
|
1532
|
-
te("destroy", this);
|
|
1533
|
-
var t = this.el;
|
|
1534
|
-
t[ne] = null, C(t, "mousedown", this._onTapStart), C(t, "touchstart", this._onTapStart), C(t, "pointerdown", this._onTapStart), this.nativeDraggable && (C(t, "dragover", this), C(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(o) {
|
|
1535
|
-
o.removeAttribute("draggable");
|
|
1536
|
-
}), this._onDrop(), this._disableDelayedDragEvents(), _t.splice(_t.indexOf(this.el), 1), this.el = t = null;
|
|
1537
|
-
},
|
|
1538
|
-
_hideClone: function() {
|
|
1539
|
-
if (!Se) {
|
|
1540
|
-
if (te("hideClone", this), w.eventCanceled) return;
|
|
1541
|
-
y(R, "display", "none"), this.options.removeCloneOnHide && R.parentNode && R.parentNode.removeChild(R), Se = !0;
|
|
1542
|
-
}
|
|
1543
|
-
},
|
|
1544
|
-
_showClone: function(t) {
|
|
1545
|
-
if (t.lastPutMode !== "clone") {
|
|
1546
|
-
this._hideClone();
|
|
1547
|
-
return;
|
|
1548
|
-
}
|
|
1549
|
-
if (Se) {
|
|
1550
|
-
if (te("showClone", this), w.eventCanceled) return;
|
|
1551
|
-
p.parentNode == $ && !this.options.group.revertClone ? $.insertBefore(R, p) : Ne ? $.insertBefore(R, Ne) : $.appendChild(R), this.options.group.revertClone && this.animate(p, R), y(R, "display", ""), Se = !1;
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
|
-
};
|
|
1555
|
-
function yi(e) {
|
|
1556
|
-
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
1557
|
-
}
|
|
1558
|
-
function vt(e, t, o, n, i, r, l, a) {
|
|
1559
|
-
var u, d = e[ne], f = d.options.onMove, h;
|
|
1560
|
-
return window.CustomEvent && !Ee && !ut ? u = new CustomEvent("move", {
|
|
1561
|
-
bubbles: !0,
|
|
1562
|
-
cancelable: !0
|
|
1563
|
-
}) : (u = document.createEvent("Event"), u.initEvent("move", !0, !0)), u.to = t, u.from = e, u.dragged = o, u.draggedRect = n, u.related = i || t, u.relatedRect = r || L(t), u.willInsertAfter = a, u.originalEvent = l, e.dispatchEvent(u), f && (h = f.call(d, u, l)), h;
|
|
1564
|
-
}
|
|
1565
|
-
function Wt(e) {
|
|
1566
|
-
e.draggable = !1;
|
|
1567
|
-
}
|
|
1568
|
-
function wi() {
|
|
1569
|
-
zt = !1;
|
|
1570
|
-
}
|
|
1571
|
-
function Ei(e, t, o) {
|
|
1572
|
-
var n = L(ze(o.el, 0, o.options, !0)), i = Bn(o.el, o.options, E), r = 10;
|
|
1573
|
-
return t ? e.clientX < i.left - r || e.clientY < n.top && e.clientX < n.right : e.clientY < i.top - r || e.clientY < n.bottom && e.clientX < n.left;
|
|
1574
|
-
}
|
|
1575
|
-
function Ti(e, t, o) {
|
|
1576
|
-
var n = L(Jt(o.el, o.options.draggable)), i = Bn(o.el, o.options, E), r = 10;
|
|
1577
|
-
return t ? e.clientX > i.right + r || e.clientY > n.bottom && e.clientX > n.left : e.clientY > i.bottom + r || e.clientX > n.right && e.clientY > n.top;
|
|
1578
|
-
}
|
|
1579
|
-
function _i(e, t, o, n, i, r, l, a) {
|
|
1580
|
-
var u = n ? e.clientY : e.clientX, d = n ? o.height : o.width, f = n ? o.top : o.left, h = n ? o.bottom : o.right, c = !1;
|
|
1581
|
-
if (!l) {
|
|
1582
|
-
if (a && pt < d * i) {
|
|
1583
|
-
if (!lt && (at === 1 ? u > f + d * r / 2 : u < h - d * r / 2) && (lt = !0), lt)
|
|
1584
|
-
c = !0;
|
|
1585
|
-
else if (at === 1 ? u < f + pt : u > h - pt)
|
|
1586
|
-
return -at;
|
|
1587
|
-
} else if (u > f + d * (1 - i) / 2 && u < h - d * (1 - i) / 2)
|
|
1588
|
-
return Di(t);
|
|
1589
|
-
}
|
|
1590
|
-
return c = c || l, c && (u < f + d * r / 2 || u > h - d * r / 2) ? u > f + d / 2 ? 1 : -1 : 0;
|
|
1591
|
-
}
|
|
1592
|
-
function Di(e) {
|
|
1593
|
-
return le(p) < le(e) ? 1 : -1;
|
|
1594
|
-
}
|
|
1595
|
-
function Si(e) {
|
|
1596
|
-
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, o = t.length, n = 0; o--; )
|
|
1597
|
-
n += t.charCodeAt(o);
|
|
1598
|
-
return n.toString(36);
|
|
1599
|
-
}
|
|
1600
|
-
function Ci(e) {
|
|
1601
|
-
Dt.length = 0;
|
|
1602
|
-
for (var t = e.getElementsByTagName("input"), o = t.length; o--; ) {
|
|
1603
|
-
var n = t[o];
|
|
1604
|
-
n.checked && Dt.push(n);
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
function gt(e) {
|
|
1608
|
-
return setTimeout(e, 0);
|
|
547
|
+
function F(e, t, n) {
|
|
548
|
+
e.addEventListener(t, n, !mt && bt);
|
|
549
|
+
}
|
|
550
|
+
function I(e, t, n) {
|
|
551
|
+
e.removeEventListener(t, n, !mt && bt);
|
|
552
|
+
}
|
|
553
|
+
function xt(e, t) {
|
|
554
|
+
if (t) {
|
|
555
|
+
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
556
|
+
if (e.matches) return e.matches(t);
|
|
557
|
+
if (e.msMatchesSelector) return e.msMatchesSelector(t);
|
|
558
|
+
if (e.webkitMatchesSelector) return e.webkitMatchesSelector(t);
|
|
559
|
+
} catch {
|
|
560
|
+
return !1;
|
|
561
|
+
}
|
|
562
|
+
return !1;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function St(e) {
|
|
566
|
+
return e.host && e !== document && e.host.nodeType && e.host !== e ? e.host : e.parentNode;
|
|
567
|
+
}
|
|
568
|
+
function Ct(e, t, n, r) {
|
|
569
|
+
if (e) {
|
|
570
|
+
n ||= document;
|
|
571
|
+
do {
|
|
572
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && xt(e, t) : xt(e, t)) || r && e === n) return e;
|
|
573
|
+
if (e === n) break;
|
|
574
|
+
} while (e = St(e));
|
|
575
|
+
}
|
|
576
|
+
return null;
|
|
577
|
+
}
|
|
578
|
+
var wt = /\s+/g;
|
|
579
|
+
function L(e, t, n) {
|
|
580
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(wt, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(wt, " "));
|
|
581
|
+
}
|
|
582
|
+
function R(e, t, n) {
|
|
583
|
+
var r = e && e.style;
|
|
584
|
+
if (r) {
|
|
585
|
+
if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
|
|
586
|
+
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
function Tt(e, t) {
|
|
590
|
+
var n = "";
|
|
591
|
+
if (typeof e == "string") n = e;
|
|
592
|
+
else do {
|
|
593
|
+
var r = R(e, "transform");
|
|
594
|
+
r && r !== "none" && (n = r + " " + n);
|
|
595
|
+
} while (!t && (e = e.parentNode));
|
|
596
|
+
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
597
|
+
return i && new i(n);
|
|
598
|
+
}
|
|
599
|
+
function Et(e, t, n) {
|
|
600
|
+
if (e) {
|
|
601
|
+
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
602
|
+
if (n) for (; i < a; i++) n(r[i], i);
|
|
603
|
+
return r;
|
|
604
|
+
}
|
|
605
|
+
return [];
|
|
606
|
+
}
|
|
607
|
+
function Dt() {
|
|
608
|
+
return document.scrollingElement || document.documentElement;
|
|
609
|
+
}
|
|
610
|
+
function z(e, t, n, r, i) {
|
|
611
|
+
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
612
|
+
var a, o, s, c, l, u, d;
|
|
613
|
+
if (e !== window && e.parentNode && e !== Dt() ? (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, !mt)) do
|
|
614
|
+
if (i && i.getBoundingClientRect && (R(i, "transform") !== "none" || n && R(i, "position") !== "static")) {
|
|
615
|
+
var f = i.getBoundingClientRect();
|
|
616
|
+
o -= f.top + parseInt(R(i, "border-top-width")), s -= f.left + parseInt(R(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
while (i = i.parentNode);
|
|
620
|
+
if (r && e !== window) {
|
|
621
|
+
var p = Tt(i || e), m = p && p.a, h = p && p.d;
|
|
622
|
+
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
623
|
+
}
|
|
624
|
+
return {
|
|
625
|
+
top: o,
|
|
626
|
+
left: s,
|
|
627
|
+
bottom: c,
|
|
628
|
+
right: l,
|
|
629
|
+
width: d,
|
|
630
|
+
height: u
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
function Ot(e, t, n) {
|
|
635
|
+
for (var r = Nt(e, !0), i = z(e)[t]; r;) {
|
|
636
|
+
var a = z(r)[n], o = void 0;
|
|
637
|
+
if (o = n === "top" || n === "left" ? i >= a : i <= a, !o) return r;
|
|
638
|
+
if (r === Dt()) break;
|
|
639
|
+
r = Nt(r, !1);
|
|
640
|
+
}
|
|
641
|
+
return !1;
|
|
642
|
+
}
|
|
643
|
+
function kt(e, t, n, r) {
|
|
644
|
+
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
645
|
+
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && Ct(o[a], n.draggable, e, !1)) {
|
|
646
|
+
if (i === t) return o[a];
|
|
647
|
+
i++;
|
|
648
|
+
}
|
|
649
|
+
a++;
|
|
650
|
+
}
|
|
651
|
+
return null;
|
|
652
|
+
}
|
|
653
|
+
function At(e, t) {
|
|
654
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || R(n, "display") === "none" || t && !xt(n, t));) n = n.previousElementSibling;
|
|
655
|
+
return n || null;
|
|
656
|
+
}
|
|
657
|
+
function B(e, t) {
|
|
658
|
+
var n = 0;
|
|
659
|
+
if (!e || !e.parentNode) return -1;
|
|
660
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || xt(e, t)) && n++;
|
|
661
|
+
return n;
|
|
1609
662
|
}
|
|
1610
663
|
function jt(e) {
|
|
1611
|
-
|
|
664
|
+
var t = 0, n = 0, r = Dt();
|
|
665
|
+
if (e) do {
|
|
666
|
+
var i = Tt(e), a = i.a, o = i.d;
|
|
667
|
+
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
668
|
+
} while (e !== r && (e = e.parentNode));
|
|
669
|
+
return [t, n];
|
|
1612
670
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
671
|
+
function Mt(e, t) {
|
|
672
|
+
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
673
|
+
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
674
|
+
}
|
|
675
|
+
return -1;
|
|
676
|
+
}
|
|
677
|
+
function Nt(e, t) {
|
|
678
|
+
if (!e || !e.getBoundingClientRect) return Dt();
|
|
679
|
+
var n = e, r = !1;
|
|
680
|
+
do
|
|
681
|
+
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
682
|
+
var i = R(n);
|
|
683
|
+
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
684
|
+
if (!n.getBoundingClientRect || n === document.body) return Dt();
|
|
685
|
+
if (r || t) return n;
|
|
686
|
+
r = !0;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
while (n = n.parentNode);
|
|
690
|
+
return Dt();
|
|
691
|
+
}
|
|
692
|
+
function Pt(e, t) {
|
|
693
|
+
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
694
|
+
return e;
|
|
695
|
+
}
|
|
696
|
+
function Ft(e, t) {
|
|
697
|
+
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);
|
|
698
|
+
}
|
|
699
|
+
var It;
|
|
700
|
+
function Lt(e, t) {
|
|
701
|
+
return function() {
|
|
702
|
+
if (!It) {
|
|
703
|
+
var n = arguments, r = this;
|
|
704
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), It = setTimeout(function() {
|
|
705
|
+
It = void 0;
|
|
706
|
+
}, t);
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function Rt() {
|
|
711
|
+
clearTimeout(It), It = void 0;
|
|
712
|
+
}
|
|
713
|
+
function zt(e, t, n) {
|
|
714
|
+
e.scrollLeft += t, e.scrollTop += n;
|
|
715
|
+
}
|
|
716
|
+
function Bt(e) {
|
|
717
|
+
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
718
|
+
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
719
|
+
}
|
|
720
|
+
function Vt(e, t, n) {
|
|
721
|
+
var r = {};
|
|
722
|
+
return Array.from(e.children).forEach(function(i) {
|
|
723
|
+
if (!(!Ct(i, t.draggable, e, !1) || i.animated || i === n)) {
|
|
724
|
+
var a = z(i);
|
|
725
|
+
r.left = Math.min(r.left ?? Infinity, a.left), r.top = Math.min(r.top ?? Infinity, a.top), r.right = Math.max(r.right ?? -Infinity, a.right), r.bottom = Math.max(r.bottom ?? -Infinity, a.bottom);
|
|
726
|
+
}
|
|
727
|
+
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
728
|
+
}
|
|
729
|
+
var V = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
730
|
+
function Ht() {
|
|
731
|
+
var e = [], t;
|
|
732
|
+
return {
|
|
733
|
+
captureAnimationState: function() {
|
|
734
|
+
e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
|
|
735
|
+
if (R(t, "display") !== "none" && t !== Q.ghost) {
|
|
736
|
+
e.push({
|
|
737
|
+
target: t,
|
|
738
|
+
rect: z(t)
|
|
739
|
+
});
|
|
740
|
+
var n = P({}, e[e.length - 1].rect);
|
|
741
|
+
if (t.thisAnimationDuration) {
|
|
742
|
+
var r = Tt(t, !0);
|
|
743
|
+
r && (n.top -= r.f, n.left -= r.e);
|
|
744
|
+
}
|
|
745
|
+
t.fromRect = n;
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
},
|
|
749
|
+
addAnimationState: function(t) {
|
|
750
|
+
e.push(t);
|
|
751
|
+
},
|
|
752
|
+
removeAnimationState: function(t) {
|
|
753
|
+
e.splice(Mt(e, { target: t }), 1);
|
|
754
|
+
},
|
|
755
|
+
animateAll: function(n) {
|
|
756
|
+
var r = this;
|
|
757
|
+
if (!this.options.animation) {
|
|
758
|
+
clearTimeout(t), typeof n == "function" && n();
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
var i = !1, a = 0;
|
|
762
|
+
e.forEach(function(e) {
|
|
763
|
+
var t = 0, n = e.target, o = n.fromRect, s = z(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Tt(n, !0);
|
|
764
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Ft(c, s) && !Ft(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = Wt(u, c, l, r.options)), Ft(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() {
|
|
765
|
+
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
766
|
+
}, t), n.thisAnimationDuration = t);
|
|
767
|
+
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
768
|
+
typeof n == "function" && n();
|
|
769
|
+
}, a) : typeof n == "function" && n(), e = [];
|
|
770
|
+
},
|
|
771
|
+
animate: function(e, t, n, r) {
|
|
772
|
+
if (r) {
|
|
773
|
+
R(e, "transition", ""), R(e, "transform", "");
|
|
774
|
+
var i = Tt(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
775
|
+
e.animatingX = !!s, e.animatingY = !!c, R(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = Ut(e), R(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), R(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
776
|
+
R(e, "transition", ""), R(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
777
|
+
}, r);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
function Ut(e) {
|
|
783
|
+
return e.offsetWidth;
|
|
784
|
+
}
|
|
785
|
+
function Wt(e, t, n, r) {
|
|
786
|
+
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;
|
|
787
|
+
}
|
|
788
|
+
var Gt = [], Kt = { initializeByDefault: !0 }, qt = {
|
|
789
|
+
mount: function(e) {
|
|
790
|
+
for (var t in Kt) Kt.hasOwnProperty(t) && !(t in e) && (e[t] = Kt[t]);
|
|
791
|
+
Gt.forEach(function(t) {
|
|
792
|
+
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
793
|
+
}), Gt.push(e);
|
|
794
|
+
},
|
|
795
|
+
pluginEvent: function(e, t, n) {
|
|
796
|
+
var r = this;
|
|
797
|
+
this.eventCanceled = !1, n.cancel = function() {
|
|
798
|
+
r.eventCanceled = !0;
|
|
799
|
+
};
|
|
800
|
+
var i = e + "Global";
|
|
801
|
+
Gt.forEach(function(r) {
|
|
802
|
+
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](P({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](P({ sortable: t }, n)));
|
|
803
|
+
});
|
|
804
|
+
},
|
|
805
|
+
initializePlugins: function(e, t, n, r) {
|
|
806
|
+
for (var i in Gt.forEach(function(r) {
|
|
807
|
+
var i = r.pluginName;
|
|
808
|
+
if (!(!e.options[i] && !r.initializeByDefault)) {
|
|
809
|
+
var a = new r(e, t, e.options);
|
|
810
|
+
a.sortable = e, a.options = e.options, e[i] = a, N(n, a.defaults);
|
|
811
|
+
}
|
|
812
|
+
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
813
|
+
var a = this.modifyOption(e, i, e.options[i]);
|
|
814
|
+
a !== void 0 && (e.options[i] = a);
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
getEventProperties: function(e, t) {
|
|
818
|
+
var n = {};
|
|
819
|
+
return Gt.forEach(function(r) {
|
|
820
|
+
typeof r.eventProperties == "function" && N(n, r.eventProperties.call(t[r.pluginName], e));
|
|
821
|
+
}), n;
|
|
822
|
+
},
|
|
823
|
+
modifyOption: function(e, t, n) {
|
|
824
|
+
var r;
|
|
825
|
+
return Gt.forEach(function(i) {
|
|
826
|
+
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
827
|
+
}), r;
|
|
828
|
+
}
|
|
1638
829
|
};
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
830
|
+
function Jt(e) {
|
|
831
|
+
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;
|
|
832
|
+
if (t ||= n && n[V], t) {
|
|
833
|
+
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
834
|
+
window.CustomEvent && !mt && !ht ? h = new CustomEvent(r, {
|
|
835
|
+
bubbles: !0,
|
|
836
|
+
cancelable: !0
|
|
837
|
+
}) : (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;
|
|
838
|
+
var ee = P(P({}, m), qt.getEventProperties(r, t));
|
|
839
|
+
for (var v in ee) h[v] = ee[v];
|
|
840
|
+
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
var Yt = ["evt"], H = function(e, t) {
|
|
844
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = st(n, Yt);
|
|
845
|
+
qt.pluginEvent.bind(Q)(e, t, P({
|
|
846
|
+
dragEl: W,
|
|
847
|
+
parentEl: G,
|
|
848
|
+
ghostEl: K,
|
|
849
|
+
rootEl: q,
|
|
850
|
+
nextEl: Xt,
|
|
851
|
+
lastDownEl: Zt,
|
|
852
|
+
cloneEl: J,
|
|
853
|
+
cloneHidden: Qt,
|
|
854
|
+
dragStarted: pn,
|
|
855
|
+
putSortable: X,
|
|
856
|
+
activeSortable: Q.active,
|
|
857
|
+
originalEvent: r,
|
|
858
|
+
oldIndex: $t,
|
|
859
|
+
oldDraggableIndex: en,
|
|
860
|
+
newIndex: Y,
|
|
861
|
+
newDraggableIndex: tn,
|
|
862
|
+
hideGhostForTarget: jn,
|
|
863
|
+
unhideGhostForTarget: Mn,
|
|
864
|
+
cloneNowHidden: function() {
|
|
865
|
+
Qt = !0;
|
|
866
|
+
},
|
|
867
|
+
cloneNowShown: function() {
|
|
868
|
+
Qt = !1;
|
|
869
|
+
},
|
|
870
|
+
dispatchSortableEvent: function(e) {
|
|
871
|
+
U({
|
|
872
|
+
sortable: t,
|
|
873
|
+
name: e,
|
|
874
|
+
originalEvent: r
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
}, i));
|
|
1647
878
|
};
|
|
1648
|
-
|
|
1649
|
-
|
|
879
|
+
function U(e) {
|
|
880
|
+
Jt(P({
|
|
881
|
+
putSortable: X,
|
|
882
|
+
cloneEl: J,
|
|
883
|
+
targetEl: W,
|
|
884
|
+
rootEl: q,
|
|
885
|
+
oldIndex: $t,
|
|
886
|
+
oldDraggableIndex: en,
|
|
887
|
+
newIndex: Y,
|
|
888
|
+
newDraggableIndex: tn
|
|
889
|
+
}, e));
|
|
890
|
+
}
|
|
891
|
+
var W, G, K, q, Xt, Zt, J, Qt, $t, Y, en, tn, nn, X, rn = !1, an = !1, on = [], sn, cn, ln, un, dn, fn, pn, mn, hn, gn = !1, _n = !1, vn, Z, yn = [], bn = !1, xn = [], Sn = typeof document < "u", Cn = vt, wn = ht || mt ? "cssFloat" : "float", Tn = Sn && !yt && !vt && "draggable" in document.createElement("div"), En = function() {
|
|
892
|
+
if (Sn) {
|
|
893
|
+
if (mt) return !1;
|
|
894
|
+
var e = document.createElement("x");
|
|
895
|
+
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
896
|
+
}
|
|
897
|
+
}(), Dn = function(e, t) {
|
|
898
|
+
var n = R(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = kt(e, 0, t), a = kt(e, 1, t), o = i && R(i), s = a && R(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + z(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + z(a).width;
|
|
899
|
+
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
900
|
+
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
901
|
+
if (i && o.float && o.float !== "none") {
|
|
902
|
+
var u = o.float === "left" ? "left" : "right";
|
|
903
|
+
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
904
|
+
}
|
|
905
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[wn] === "none" || a && n[wn] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
906
|
+
}, On = function(e, t, n) {
|
|
907
|
+
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;
|
|
908
|
+
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
909
|
+
}, kn = function(e, t) {
|
|
910
|
+
var n;
|
|
911
|
+
return on.some(function(r) {
|
|
912
|
+
var i = r[V].options.emptyInsertThreshold;
|
|
913
|
+
if (!(!i || At(r))) {
|
|
914
|
+
var a = z(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
915
|
+
if (o && s) return n = r;
|
|
916
|
+
}
|
|
917
|
+
}), n;
|
|
918
|
+
}, An = function(e) {
|
|
919
|
+
function t(e, n) {
|
|
920
|
+
return function(r, i, a, o) {
|
|
921
|
+
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
922
|
+
if (e == null && (n || s)) return !0;
|
|
923
|
+
if (e == null || e === !1) return !1;
|
|
924
|
+
if (n && e === "clone") return e;
|
|
925
|
+
if (typeof e == "function") return t(e(r, i, a, o), n)(r, i, a, o);
|
|
926
|
+
var c = (n ? r : i).options.group.name;
|
|
927
|
+
return e === !0 || typeof e == "string" && e === c || e.join && e.indexOf(c) > -1;
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
var n = {}, r = e.group;
|
|
931
|
+
(!r || dt(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;
|
|
932
|
+
}, jn = function() {
|
|
933
|
+
!En && K && R(K, "display", "none");
|
|
934
|
+
}, Mn = function() {
|
|
935
|
+
!En && K && R(K, "display", "");
|
|
1650
936
|
};
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
dragStarted: function(o) {
|
|
1667
|
-
var n = o.originalEvent;
|
|
1668
|
-
this.sortable.nativeDraggable ? I(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? I(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? I(document, "touchmove", this._handleFallbackAutoScroll) : I(document, "mousemove", this._handleFallbackAutoScroll);
|
|
1669
|
-
},
|
|
1670
|
-
dragOverCompleted: function(o) {
|
|
1671
|
-
var n = o.originalEvent;
|
|
1672
|
-
!this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
|
|
1673
|
-
},
|
|
1674
|
-
drop: function() {
|
|
1675
|
-
this.sortable.nativeDraggable ? C(document, "dragover", this._handleAutoScroll) : (C(document, "pointermove", this._handleFallbackAutoScroll), C(document, "touchmove", this._handleFallbackAutoScroll), C(document, "mousemove", this._handleFallbackAutoScroll)), Dn(), bt(), ui();
|
|
1676
|
-
},
|
|
1677
|
-
nulling: function() {
|
|
1678
|
-
St = Gt = Je = Kt = et = Lt = Xt = null, W.length = 0;
|
|
1679
|
-
},
|
|
1680
|
-
_handleFallbackAutoScroll: function(o) {
|
|
1681
|
-
this._handleAutoScroll(o, !0);
|
|
1682
|
-
},
|
|
1683
|
-
_handleAutoScroll: function(o, n) {
|
|
1684
|
-
var i = this, r = (o.touches ? o.touches[0] : o).clientX, l = (o.touches ? o.touches[0] : o).clientY, a = document.elementFromPoint(r, l);
|
|
1685
|
-
if (St = o, n || this.options.forceAutoScrollFallback || ut || Ee || ot) {
|
|
1686
|
-
Yt(o, this.options, a, n);
|
|
1687
|
-
var u = Ce(a, !0);
|
|
1688
|
-
Kt && (!et || r !== Lt || l !== Xt) && (et && Dn(), et = setInterval(function() {
|
|
1689
|
-
var d = Ce(document.elementFromPoint(r, l), !0);
|
|
1690
|
-
d !== u && (u = d, bt()), Yt(o, i.options, d, n);
|
|
1691
|
-
}, 10), Lt = r, Xt = l);
|
|
1692
|
-
} else {
|
|
1693
|
-
if (!this.options.bubbleScroll || Ce(a, !0) === pe()) {
|
|
1694
|
-
bt();
|
|
1695
|
-
return;
|
|
1696
|
-
}
|
|
1697
|
-
Yt(o, this.options, Ce(a, !1), !1);
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
}, we(e, {
|
|
1701
|
-
pluginName: "scroll",
|
|
1702
|
-
initializeByDefault: !0
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1705
|
-
function bt() {
|
|
1706
|
-
W.forEach(function(e) {
|
|
1707
|
-
clearInterval(e.pid);
|
|
1708
|
-
}), W = [];
|
|
1709
|
-
}
|
|
1710
|
-
function Dn() {
|
|
1711
|
-
clearInterval(et);
|
|
1712
|
-
}
|
|
1713
|
-
var Yt = $n(function(e, t, o, n) {
|
|
1714
|
-
if (t.scroll) {
|
|
1715
|
-
var i = (e.touches ? e.touches[0] : e).clientX, r = (e.touches ? e.touches[0] : e).clientY, l = t.scrollSensitivity, a = t.scrollSpeed, u = pe(), d = !1, f;
|
|
1716
|
-
Gt !== o && (Gt = o, bt(), Je = t.scroll, f = t.scrollFn, Je === !0 && (Je = Ce(o, !0)));
|
|
1717
|
-
var h = 0, c = Je;
|
|
1718
|
-
do {
|
|
1719
|
-
var v = c, m = L(v), g = m.top, S = m.bottom, k = m.left, x = m.right, T = m.width, _ = m.height, P = void 0, U = void 0, be = v.scrollWidth, ke = v.scrollHeight, H = y(v), Ie = v.scrollLeft, q = v.scrollTop;
|
|
1720
|
-
v === u ? (P = T < be && (H.overflowX === "auto" || H.overflowX === "scroll" || H.overflowX === "visible"), U = _ < ke && (H.overflowY === "auto" || H.overflowY === "scroll" || H.overflowY === "visible")) : (P = T < be && (H.overflowX === "auto" || H.overflowX === "scroll"), U = _ < ke && (H.overflowY === "auto" || H.overflowY === "scroll"));
|
|
1721
|
-
var Z = P && (Math.abs(x - i) <= l && Ie + T < be) - (Math.abs(k - i) <= l && !!Ie), M = U && (Math.abs(S - r) <= l && q + _ < ke) - (Math.abs(g - r) <= l && !!q);
|
|
1722
|
-
if (!W[h])
|
|
1723
|
-
for (var oe = 0; oe <= h; oe++)
|
|
1724
|
-
W[oe] || (W[oe] = {});
|
|
1725
|
-
(W[h].vx != Z || W[h].vy != M || W[h].el !== v) && (W[h].el = v, W[h].vx = Z, W[h].vy = M, clearInterval(W[h].pid), (Z != 0 || M != 0) && (d = !0, W[h].pid = setInterval((function() {
|
|
1726
|
-
n && this.layer === 0 && w.active._onTouchMove(St);
|
|
1727
|
-
var xe = W[this.layer].vy ? W[this.layer].vy * a : 0, fe = W[this.layer].vx ? W[this.layer].vx * a : 0;
|
|
1728
|
-
typeof f == "function" && f.call(w.dragged.parentNode[ne], fe, xe, e, St, W[this.layer].el) !== "continue" || Rn(W[this.layer].el, fe, xe);
|
|
1729
|
-
}).bind({
|
|
1730
|
-
layer: h
|
|
1731
|
-
}), 24))), h++;
|
|
1732
|
-
} while (t.bubbleScroll && c !== u && (c = Ce(c, !1)));
|
|
1733
|
-
Kt = d;
|
|
1734
|
-
}
|
|
1735
|
-
}, 30), qn = function(t) {
|
|
1736
|
-
var o = t.originalEvent, n = t.putSortable, i = t.dragEl, r = t.activeSortable, l = t.dispatchSortableEvent, a = t.hideGhostForTarget, u = t.unhideGhostForTarget;
|
|
1737
|
-
if (o) {
|
|
1738
|
-
var d = n || r;
|
|
1739
|
-
a();
|
|
1740
|
-
var f = o.changedTouches && o.changedTouches.length ? o.changedTouches[0] : o, h = document.elementFromPoint(f.clientX, f.clientY);
|
|
1741
|
-
u(), d && !d.el.contains(h) && (l("spill"), this.onSpill({
|
|
1742
|
-
dragEl: i,
|
|
1743
|
-
putSortable: n
|
|
1744
|
-
}));
|
|
1745
|
-
}
|
|
937
|
+
Sn && !yt && document.addEventListener("click", function(e) {
|
|
938
|
+
if (an) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), an = !1, !1;
|
|
939
|
+
}, !0);
|
|
940
|
+
var Nn = function(e) {
|
|
941
|
+
if (W) {
|
|
942
|
+
e = e.touches ? e.touches[0] : e;
|
|
943
|
+
var t = kn(e.clientX, e.clientY);
|
|
944
|
+
if (t) {
|
|
945
|
+
var n = {};
|
|
946
|
+
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
947
|
+
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[V]._onDragOver(n);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
}, Pn = function(e) {
|
|
951
|
+
W && W.parentNode[V]._isOutsideThisEl(e.target);
|
|
1746
952
|
};
|
|
1747
|
-
function
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
953
|
+
function Q(e, t) {
|
|
954
|
+
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
955
|
+
this.el = e, this.options = t = N({}, t), e[V] = this;
|
|
956
|
+
var n = {
|
|
957
|
+
group: null,
|
|
958
|
+
sort: !0,
|
|
959
|
+
disabled: !1,
|
|
960
|
+
store: null,
|
|
961
|
+
handle: null,
|
|
962
|
+
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
963
|
+
swapThreshold: 1,
|
|
964
|
+
invertSwap: !1,
|
|
965
|
+
invertedSwapThreshold: null,
|
|
966
|
+
removeCloneOnHide: !0,
|
|
967
|
+
direction: function() {
|
|
968
|
+
return Dn(e, this.options);
|
|
969
|
+
},
|
|
970
|
+
ghostClass: "sortable-ghost",
|
|
971
|
+
chosenClass: "sortable-chosen",
|
|
972
|
+
dragClass: "sortable-drag",
|
|
973
|
+
ignore: "a, img",
|
|
974
|
+
filter: null,
|
|
975
|
+
preventOnFilter: !0,
|
|
976
|
+
animation: 0,
|
|
977
|
+
easing: null,
|
|
978
|
+
setData: function(e, t) {
|
|
979
|
+
e.setData("Text", t.textContent);
|
|
980
|
+
},
|
|
981
|
+
dropBubble: !1,
|
|
982
|
+
dragoverBubble: !1,
|
|
983
|
+
dataIdAttr: "data-id",
|
|
984
|
+
delay: 0,
|
|
985
|
+
delayOnTouchOnly: !1,
|
|
986
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
987
|
+
forceFallback: !1,
|
|
988
|
+
fallbackClass: "sortable-fallback",
|
|
989
|
+
fallbackOnBody: !1,
|
|
990
|
+
fallbackTolerance: 0,
|
|
991
|
+
fallbackOffset: {
|
|
992
|
+
x: 0,
|
|
993
|
+
y: 0
|
|
994
|
+
},
|
|
995
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && (!_t || vt),
|
|
996
|
+
emptyInsertThreshold: 5
|
|
997
|
+
};
|
|
998
|
+
for (var r in qt.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
999
|
+
for (var i in An(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
1000
|
+
this.nativeDraggable = !t.forceFallback && Tn, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? F(e, "pointerdown", this._onTapStart) : (F(e, "mousedown", this._onTapStart), F(e, "touchstart", this._onTapStart)), this.nativeDraggable && (F(e, "dragover", this), F(e, "dragenter", this)), on.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), N(this, Ht());
|
|
1001
|
+
}
|
|
1002
|
+
Q.prototype = {
|
|
1003
|
+
constructor: Q,
|
|
1004
|
+
_isOutsideThisEl: function(e) {
|
|
1005
|
+
!this.el.contains(e) && e !== this.el && (mn = null);
|
|
1006
|
+
},
|
|
1007
|
+
_getDirection: function(e, t) {
|
|
1008
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, W) : this.options.direction;
|
|
1009
|
+
},
|
|
1010
|
+
_onTapStart: function(e) {
|
|
1011
|
+
if (e.cancelable) {
|
|
1012
|
+
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;
|
|
1013
|
+
if (Wn(n), !W && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && _t && s && s.tagName.toUpperCase() === "SELECT") && (s = Ct(s, r.draggable, n, !1), !(s && s.animated) && Zt !== s)) {
|
|
1014
|
+
if ($t = B(s), en = B(s, r.draggable), typeof l == "function") {
|
|
1015
|
+
if (l.call(this, e, s, this)) {
|
|
1016
|
+
U({
|
|
1017
|
+
sortable: t,
|
|
1018
|
+
rootEl: c,
|
|
1019
|
+
name: "filter",
|
|
1020
|
+
targetEl: s,
|
|
1021
|
+
toEl: n,
|
|
1022
|
+
fromEl: n
|
|
1023
|
+
}), H("filter", t, { evt: e }), i && e.preventDefault();
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
} else if (l && (l = l.split(",").some(function(r) {
|
|
1027
|
+
if (r = Ct(c, r.trim(), n, !1), r) return U({
|
|
1028
|
+
sortable: t,
|
|
1029
|
+
rootEl: r,
|
|
1030
|
+
name: "filter",
|
|
1031
|
+
targetEl: s,
|
|
1032
|
+
fromEl: n,
|
|
1033
|
+
toEl: n
|
|
1034
|
+
}), H("filter", t, { evt: e }), !0;
|
|
1035
|
+
}), l)) {
|
|
1036
|
+
i && e.preventDefault();
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
r.handle && !Ct(c, r.handle, n, !1) || this._prepareDragStart(e, o, s);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
_prepareDragStart: function(e, t, n) {
|
|
1044
|
+
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
1045
|
+
if (n && !W && n.parentNode === i) {
|
|
1046
|
+
var c = z(n);
|
|
1047
|
+
if (q = i, W = n, G = W.parentNode, Xt = W.nextSibling, Zt = n, nn = a.group, Q.dragged = W, sn = {
|
|
1048
|
+
target: W,
|
|
1049
|
+
clientX: (t || e).clientX,
|
|
1050
|
+
clientY: (t || e).clientY
|
|
1051
|
+
}, dn = sn.clientX - c.left, fn = sn.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, W.style["will-change"] = "all", s = function() {
|
|
1052
|
+
if (H("delayEnded", r, { evt: e }), Q.eventCanceled) {
|
|
1053
|
+
r._onDrop();
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
r._disableDelayedDragEvents(), !gt && r.nativeDraggable && (W.draggable = !0), r._triggerDragStart(e, t), U({
|
|
1057
|
+
sortable: r,
|
|
1058
|
+
name: "choose",
|
|
1059
|
+
originalEvent: e
|
|
1060
|
+
}), L(W, a.chosenClass, !0);
|
|
1061
|
+
}, a.ignore.split(",").forEach(function(e) {
|
|
1062
|
+
Et(W, e.trim(), Ln);
|
|
1063
|
+
}), F(o, "dragover", Nn), F(o, "mousemove", Nn), F(o, "touchmove", Nn), a.supportPointer ? (F(o, "pointerup", r._onDrop), !this.nativeDraggable && F(o, "pointercancel", r._onDrop)) : (F(o, "mouseup", r._onDrop), F(o, "touchend", r._onDrop), F(o, "touchcancel", r._onDrop)), gt && this.nativeDraggable && (this.options.touchStartThreshold = 4, W.draggable = !0), H("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(ht || mt))) {
|
|
1064
|
+
if (Q.eventCanceled) {
|
|
1065
|
+
this._onDrop();
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
a.supportPointer ? (F(o, "pointerup", r._disableDelayedDrag), F(o, "pointercancel", r._disableDelayedDrag)) : (F(o, "mouseup", r._disableDelayedDrag), F(o, "touchend", r._disableDelayedDrag), F(o, "touchcancel", r._disableDelayedDrag)), F(o, "mousemove", r._delayedDragTouchMoveHandler), F(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && F(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
|
|
1069
|
+
} else s();
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
_delayedDragTouchMoveHandler: function(e) {
|
|
1073
|
+
var t = e.touches ? e.touches[0] : e;
|
|
1074
|
+
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();
|
|
1075
|
+
},
|
|
1076
|
+
_disableDelayedDrag: function() {
|
|
1077
|
+
W && Ln(W), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
1078
|
+
},
|
|
1079
|
+
_disableDelayedDragEvents: function() {
|
|
1080
|
+
var e = this.el.ownerDocument;
|
|
1081
|
+
I(e, "mouseup", this._disableDelayedDrag), I(e, "touchend", this._disableDelayedDrag), I(e, "touchcancel", this._disableDelayedDrag), I(e, "pointerup", this._disableDelayedDrag), I(e, "pointercancel", this._disableDelayedDrag), I(e, "mousemove", this._delayedDragTouchMoveHandler), I(e, "touchmove", this._delayedDragTouchMoveHandler), I(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
1082
|
+
},
|
|
1083
|
+
_triggerDragStart: function(e, t) {
|
|
1084
|
+
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? F(document, "pointermove", this._onTouchMove) : t ? F(document, "touchmove", this._onTouchMove) : F(document, "mousemove", this._onTouchMove) : (F(W, "dragend", this), F(q, "dragstart", this._onDragStart));
|
|
1085
|
+
try {
|
|
1086
|
+
document.selection ? Gn(function() {
|
|
1087
|
+
document.selection.empty();
|
|
1088
|
+
}) : window.getSelection().removeAllRanges();
|
|
1089
|
+
} catch {}
|
|
1090
|
+
},
|
|
1091
|
+
_dragStarted: function(e, t) {
|
|
1092
|
+
if (rn = !1, q && W) {
|
|
1093
|
+
H("dragStarted", this, { evt: t }), this.nativeDraggable && F(document, "dragover", Pn);
|
|
1094
|
+
var n = this.options;
|
|
1095
|
+
!e && L(W, n.dragClass, !1), L(W, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), U({
|
|
1096
|
+
sortable: this,
|
|
1097
|
+
name: "start",
|
|
1098
|
+
originalEvent: t
|
|
1099
|
+
});
|
|
1100
|
+
} else this._nulling();
|
|
1101
|
+
},
|
|
1102
|
+
_emulateDragOver: function() {
|
|
1103
|
+
if (cn) {
|
|
1104
|
+
this._lastX = cn.clientX, this._lastY = cn.clientY, jn();
|
|
1105
|
+
for (var e = document.elementFromPoint(cn.clientX, cn.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(cn.clientX, cn.clientY), e !== t);) t = e;
|
|
1106
|
+
if (W.parentNode[V]._isOutsideThisEl(e), t) do {
|
|
1107
|
+
if (t[V]) {
|
|
1108
|
+
var n = void 0;
|
|
1109
|
+
if (n = t[V]._onDragOver({
|
|
1110
|
+
clientX: cn.clientX,
|
|
1111
|
+
clientY: cn.clientY,
|
|
1112
|
+
target: e,
|
|
1113
|
+
rootEl: t
|
|
1114
|
+
}), n && !this.options.dragoverBubble) break;
|
|
1115
|
+
}
|
|
1116
|
+
e = t;
|
|
1117
|
+
} while (t = St(t));
|
|
1118
|
+
Mn();
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
_onTouchMove: function(e) {
|
|
1122
|
+
if (sn) {
|
|
1123
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = K && Tt(K, !0), o = K && a && a.a, s = K && a && a.d, c = Cn && Z && jt(Z), l = (i.clientX - sn.clientX + r.x) / (o || 1) + (c ? c[0] - yn[0] : 0) / (o || 1), u = (i.clientY - sn.clientY + r.y) / (s || 1) + (c ? c[1] - yn[1] : 0) / (s || 1);
|
|
1124
|
+
if (!Q.active && !rn) {
|
|
1125
|
+
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
1126
|
+
this._onDragStart(e, !0);
|
|
1127
|
+
}
|
|
1128
|
+
if (K) {
|
|
1129
|
+
a ? (a.e += l - (ln || 0), a.f += u - (un || 0)) : a = {
|
|
1130
|
+
a: 1,
|
|
1131
|
+
b: 0,
|
|
1132
|
+
c: 0,
|
|
1133
|
+
d: 1,
|
|
1134
|
+
e: l,
|
|
1135
|
+
f: u
|
|
1136
|
+
};
|
|
1137
|
+
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
1138
|
+
R(K, "webkitTransform", d), R(K, "mozTransform", d), R(K, "msTransform", d), R(K, "transform", d), ln = l, un = u, cn = i;
|
|
1139
|
+
}
|
|
1140
|
+
e.cancelable && e.preventDefault();
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
_appendGhost: function() {
|
|
1144
|
+
if (!K) {
|
|
1145
|
+
var e = this.options.fallbackOnBody ? document.body : q, t = z(W, !0, Cn, !0, e), n = this.options;
|
|
1146
|
+
if (Cn) {
|
|
1147
|
+
for (Z = e; R(Z, "position") === "static" && R(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
1148
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = Dt()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = Dt(), yn = jt(Z);
|
|
1149
|
+
}
|
|
1150
|
+
K = W.cloneNode(!0), L(K, n.ghostClass, !1), L(K, n.fallbackClass, !0), L(K, n.dragClass, !0), R(K, "transition", ""), R(K, "transform", ""), R(K, "box-sizing", "border-box"), R(K, "margin", 0), R(K, "top", t.top), R(K, "left", t.left), R(K, "width", t.width), R(K, "height", t.height), R(K, "opacity", "0.8"), R(K, "position", Cn ? "absolute" : "fixed"), R(K, "zIndex", "100000"), R(K, "pointerEvents", "none"), Q.ghost = K, e.appendChild(K), R(K, "transform-origin", dn / parseInt(K.style.width) * 100 + "% " + fn / parseInt(K.style.height) * 100 + "%");
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
_onDragStart: function(e, t) {
|
|
1154
|
+
var n = this, r = e.dataTransfer, i = n.options;
|
|
1155
|
+
if (H("dragStart", this, { evt: e }), Q.eventCanceled) {
|
|
1156
|
+
this._onDrop();
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
H("setupClone", this), Q.eventCanceled || (J = Bt(W), J.removeAttribute("id"), J.draggable = !1, J.style["will-change"] = "", this._hideClone(), L(J, this.options.chosenClass, !1), Q.clone = J), n.cloneId = Gn(function() {
|
|
1160
|
+
H("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || q.insertBefore(J, W), n._hideClone(), U({
|
|
1161
|
+
sortable: n,
|
|
1162
|
+
name: "clone"
|
|
1163
|
+
}));
|
|
1164
|
+
}), !t && L(W, i.dragClass, !0), t ? (an = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (I(document, "mouseup", n._onDrop), I(document, "touchend", n._onDrop), I(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, W)), F(document, "drop", n), R(W, "transform", "translateZ(0)")), rn = !0, n._dragStartId = Gn(n._dragStarted.bind(n, t, e)), F(document, "selectstart", n), pn = !0, window.getSelection().removeAllRanges(), _t && R(document.body, "user-select", "none");
|
|
1165
|
+
},
|
|
1166
|
+
_onDragOver: function(e) {
|
|
1167
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = nn === s, u = o.sort, d = X || c, f, p = this, m = !1;
|
|
1168
|
+
if (bn) return;
|
|
1169
|
+
function h(o, s) {
|
|
1170
|
+
H(o, p, P({
|
|
1171
|
+
evt: e,
|
|
1172
|
+
isOwner: l,
|
|
1173
|
+
axis: f ? "vertical" : "horizontal",
|
|
1174
|
+
revert: a,
|
|
1175
|
+
dragRect: r,
|
|
1176
|
+
targetRect: i,
|
|
1177
|
+
canSort: u,
|
|
1178
|
+
fromSortable: d,
|
|
1179
|
+
target: n,
|
|
1180
|
+
completed: _,
|
|
1181
|
+
onMove: function(n, i) {
|
|
1182
|
+
return In(q, t, W, r, n, z(n), e, i);
|
|
1183
|
+
},
|
|
1184
|
+
changed: ee
|
|
1185
|
+
}, s));
|
|
1186
|
+
}
|
|
1187
|
+
function g() {
|
|
1188
|
+
h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
|
|
1189
|
+
}
|
|
1190
|
+
function _(r) {
|
|
1191
|
+
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (L(W, X ? X.options.ghostClass : c.options.ghostClass, !1), L(W, o.ghostClass, !0)), X !== p && p !== Q.active ? X = p : p === Q.active && X && (X = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
1192
|
+
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
1193
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === W && !W.animated || n === t && !n.animated) && (mn = null), !o.dragoverBubble && !e.rootEl && n !== document && (W.parentNode[V]._isOutsideThisEl(e.target), !r && Nn(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
1194
|
+
}
|
|
1195
|
+
function ee() {
|
|
1196
|
+
Y = B(W), tn = B(W, o.draggable), U({
|
|
1197
|
+
sortable: p,
|
|
1198
|
+
name: "change",
|
|
1199
|
+
toEl: t,
|
|
1200
|
+
newIndex: Y,
|
|
1201
|
+
newDraggableIndex: tn,
|
|
1202
|
+
originalEvent: e
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = Ct(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
1206
|
+
if (W.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
1207
|
+
if (an = !1, c && !o.disabled && (l ? u || (a = G !== q) : X === this || (this.lastPutMode = nn.checkPull(this, c, W, e)) && s.checkPut(this, c, W, e))) {
|
|
1208
|
+
if (f = this._getDirection(e, n) === "vertical", r = z(W), h("dragOverValid"), Q.eventCanceled) return m;
|
|
1209
|
+
if (a) return G = q, g(), this._hideClone(), h("revert"), Q.eventCanceled || (Xt ? q.insertBefore(W, Xt) : q.appendChild(W)), _(!0);
|
|
1210
|
+
var v = At(t, o.draggable);
|
|
1211
|
+
if (!v || Bn(e, f, this) && !v.animated) {
|
|
1212
|
+
if (v === W) return _(!1);
|
|
1213
|
+
if (v && t === e.target && (n = v), n && (i = z(n)), In(q, t, W, r, n, i, e, !!n) !== !1) return g(), v && v.nextSibling ? t.insertBefore(W, v.nextSibling) : t.appendChild(W), G = t, ee(), _(!0);
|
|
1214
|
+
} else if (v && zn(e, f, this)) {
|
|
1215
|
+
var y = kt(t, 0, o, !0);
|
|
1216
|
+
if (y === W) return _(!1);
|
|
1217
|
+
if (n = y, i = z(n), In(q, t, W, r, n, i, e, !1) !== !1) return g(), t.insertBefore(W, y), G = t, ee(), _(!0);
|
|
1218
|
+
} else if (n.parentNode === t) {
|
|
1219
|
+
i = z(n);
|
|
1220
|
+
var b = 0, x, S = W.parentNode !== t, C = !On(W.animated && W.toRect || r, n.animated && n.toRect || i, f), w = f ? "top" : "left", T = Ot(n, "top", "top") || Ot(W, "top", "top"), te = T ? T.scrollTop : void 0;
|
|
1221
|
+
mn !== n && (x = i[w], gn = !1, _n = !C && o.invertSwap || S), b = Vn(e, n, i, f, C ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, _n, mn === n);
|
|
1222
|
+
var E;
|
|
1223
|
+
if (b !== 0) {
|
|
1224
|
+
var ne = B(W);
|
|
1225
|
+
do
|
|
1226
|
+
ne -= b, E = G.children[ne];
|
|
1227
|
+
while (E && (R(E, "display") === "none" || E === K));
|
|
1228
|
+
}
|
|
1229
|
+
if (b === 0 || E === n) return _(!1);
|
|
1230
|
+
mn = n, hn = b;
|
|
1231
|
+
var D = n.nextElementSibling, re = !1;
|
|
1232
|
+
re = b === 1;
|
|
1233
|
+
var ie = In(q, t, W, r, n, i, e, re);
|
|
1234
|
+
if (ie !== !1) return (ie === 1 || ie === -1) && (re = ie === 1), bn = !0, setTimeout(Rn, 30), g(), re && !D ? t.appendChild(W) : n.parentNode.insertBefore(W, re ? D : n), T && zt(T, 0, te - T.scrollTop), G = W.parentNode, x !== void 0 && !_n && (vn = Math.abs(x - z(n)[w])), ee(), _(!0);
|
|
1235
|
+
}
|
|
1236
|
+
if (t.contains(W)) return _(!1);
|
|
1237
|
+
}
|
|
1238
|
+
return !1;
|
|
1239
|
+
},
|
|
1240
|
+
_ignoreWhileAnimating: null,
|
|
1241
|
+
_offMoveEvents: function() {
|
|
1242
|
+
I(document, "mousemove", this._onTouchMove), I(document, "touchmove", this._onTouchMove), I(document, "pointermove", this._onTouchMove), I(document, "dragover", Nn), I(document, "mousemove", Nn), I(document, "touchmove", Nn);
|
|
1243
|
+
},
|
|
1244
|
+
_offUpEvents: function() {
|
|
1245
|
+
var e = this.el.ownerDocument;
|
|
1246
|
+
I(e, "mouseup", this._onDrop), I(e, "touchend", this._onDrop), I(e, "pointerup", this._onDrop), I(e, "pointercancel", this._onDrop), I(e, "touchcancel", this._onDrop), I(document, "selectstart", this);
|
|
1247
|
+
},
|
|
1248
|
+
_onDrop: function(e) {
|
|
1249
|
+
var t = this.el, n = this.options;
|
|
1250
|
+
if (Y = B(W), tn = B(W, n.draggable), H("drop", this, { evt: e }), G = W && W.parentNode, Y = B(W), tn = B(W, n.draggable), Q.eventCanceled) {
|
|
1251
|
+
this._nulling();
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
rn = !1, _n = !1, gn = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Kn(this.cloneId), Kn(this._dragStartId), this.nativeDraggable && (I(document, "drop", this), I(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), _t && R(document.body, "user-select", ""), R(W, "transform", ""), e && (pn && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), K && K.parentNode && K.parentNode.removeChild(K), (q === G || X && X.lastPutMode !== "clone") && J && J.parentNode && J.parentNode.removeChild(J), W && (this.nativeDraggable && I(W, "dragend", this), Ln(W), W.style["will-change"] = "", pn && !rn && L(W, X ? X.options.ghostClass : this.options.ghostClass, !1), L(W, this.options.chosenClass, !1), U({
|
|
1255
|
+
sortable: this,
|
|
1256
|
+
name: "unchoose",
|
|
1257
|
+
toEl: G,
|
|
1258
|
+
newIndex: null,
|
|
1259
|
+
newDraggableIndex: null,
|
|
1260
|
+
originalEvent: e
|
|
1261
|
+
}), q === G ? Y !== $t && Y >= 0 && (U({
|
|
1262
|
+
sortable: this,
|
|
1263
|
+
name: "update",
|
|
1264
|
+
toEl: G,
|
|
1265
|
+
originalEvent: e
|
|
1266
|
+
}), U({
|
|
1267
|
+
sortable: this,
|
|
1268
|
+
name: "sort",
|
|
1269
|
+
toEl: G,
|
|
1270
|
+
originalEvent: e
|
|
1271
|
+
})) : (Y >= 0 && (U({
|
|
1272
|
+
rootEl: G,
|
|
1273
|
+
name: "add",
|
|
1274
|
+
toEl: G,
|
|
1275
|
+
fromEl: q,
|
|
1276
|
+
originalEvent: e
|
|
1277
|
+
}), U({
|
|
1278
|
+
sortable: this,
|
|
1279
|
+
name: "remove",
|
|
1280
|
+
toEl: G,
|
|
1281
|
+
originalEvent: e
|
|
1282
|
+
}), U({
|
|
1283
|
+
rootEl: G,
|
|
1284
|
+
name: "sort",
|
|
1285
|
+
toEl: G,
|
|
1286
|
+
fromEl: q,
|
|
1287
|
+
originalEvent: e
|
|
1288
|
+
}), U({
|
|
1289
|
+
sortable: this,
|
|
1290
|
+
name: "sort",
|
|
1291
|
+
toEl: G,
|
|
1292
|
+
originalEvent: e
|
|
1293
|
+
})), X && X.save()), Q.active && ((Y == null || Y === -1) && (Y = $t, tn = en), U({
|
|
1294
|
+
sortable: this,
|
|
1295
|
+
name: "end",
|
|
1296
|
+
toEl: G,
|
|
1297
|
+
originalEvent: e
|
|
1298
|
+
}), this.save()))), this._nulling();
|
|
1299
|
+
},
|
|
1300
|
+
_nulling: function() {
|
|
1301
|
+
H("nulling", this), q = W = G = K = Xt = J = Zt = Qt = sn = cn = pn = Y = tn = $t = en = mn = hn = X = nn = Q.dragged = Q.ghost = Q.clone = Q.active = null;
|
|
1302
|
+
var e = this.el;
|
|
1303
|
+
xn.forEach(function(t) {
|
|
1304
|
+
e.contains(t) && (t.checked = !0);
|
|
1305
|
+
}), xn.length = ln = un = 0;
|
|
1306
|
+
},
|
|
1307
|
+
handleEvent: function(e) {
|
|
1308
|
+
switch (e.type) {
|
|
1309
|
+
case "drop":
|
|
1310
|
+
case "dragend":
|
|
1311
|
+
this._onDrop(e);
|
|
1312
|
+
break;
|
|
1313
|
+
case "dragenter":
|
|
1314
|
+
case "dragover":
|
|
1315
|
+
W && (this._onDragOver(e), Fn(e));
|
|
1316
|
+
break;
|
|
1317
|
+
case "selectstart": e.preventDefault();
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
toArray: function() {
|
|
1321
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], Ct(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || Un(t));
|
|
1322
|
+
return e;
|
|
1323
|
+
},
|
|
1324
|
+
sort: function(e, t) {
|
|
1325
|
+
var n = {}, r = this.el;
|
|
1326
|
+
this.toArray().forEach(function(e, t) {
|
|
1327
|
+
var i = r.children[t];
|
|
1328
|
+
Ct(i, this.options.draggable, r, !1) && (n[e] = i);
|
|
1329
|
+
}, this), t && this.captureAnimationState(), e.forEach(function(e) {
|
|
1330
|
+
n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
|
|
1331
|
+
}), t && this.animateAll();
|
|
1332
|
+
},
|
|
1333
|
+
save: function() {
|
|
1334
|
+
var e = this.options.store;
|
|
1335
|
+
e && e.set && e.set(this);
|
|
1336
|
+
},
|
|
1337
|
+
closest: function(e, t) {
|
|
1338
|
+
return Ct(e, t || this.options.draggable, this.el, !1);
|
|
1339
|
+
},
|
|
1340
|
+
option: function(e, t) {
|
|
1341
|
+
var n = this.options;
|
|
1342
|
+
if (t === void 0) return n[e];
|
|
1343
|
+
var r = qt.modifyOption(this, e, t);
|
|
1344
|
+
n[e] = r === void 0 ? t : r, e === "group" && An(n);
|
|
1345
|
+
},
|
|
1346
|
+
destroy: function() {
|
|
1347
|
+
H("destroy", this);
|
|
1348
|
+
var e = this.el;
|
|
1349
|
+
e[V] = null, I(e, "mousedown", this._onTapStart), I(e, "touchstart", this._onTapStart), I(e, "pointerdown", this._onTapStart), this.nativeDraggable && (I(e, "dragover", this), I(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
1350
|
+
e.removeAttribute("draggable");
|
|
1351
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), on.splice(on.indexOf(this.el), 1), this.el = e = null;
|
|
1352
|
+
},
|
|
1353
|
+
_hideClone: function() {
|
|
1354
|
+
if (!Qt) {
|
|
1355
|
+
if (H("hideClone", this), Q.eventCanceled) return;
|
|
1356
|
+
R(J, "display", "none"), this.options.removeCloneOnHide && J.parentNode && J.parentNode.removeChild(J), Qt = !0;
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
_showClone: function(e) {
|
|
1360
|
+
if (e.lastPutMode !== "clone") {
|
|
1361
|
+
this._hideClone();
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
if (Qt) {
|
|
1365
|
+
if (H("showClone", this), Q.eventCanceled) return;
|
|
1366
|
+
W.parentNode == q && !this.options.group.revertClone ? q.insertBefore(J, W) : Xt ? q.insertBefore(J, Xt) : q.appendChild(J), this.options.group.revertClone && this.animate(W, J), R(J, "display", ""), Qt = !1;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1762
1369
|
};
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}
|
|
1766
|
-
function
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1370
|
+
function Fn(e) {
|
|
1371
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
1372
|
+
}
|
|
1373
|
+
function In(e, t, n, r, i, a, o, s) {
|
|
1374
|
+
var c, l = e[V], u = l.options.onMove, d;
|
|
1375
|
+
return window.CustomEvent && !mt && !ht ? c = new CustomEvent("move", {
|
|
1376
|
+
bubbles: !0,
|
|
1377
|
+
cancelable: !0
|
|
1378
|
+
}) : (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 || z(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
1379
|
+
}
|
|
1380
|
+
function Ln(e) {
|
|
1381
|
+
e.draggable = !1;
|
|
1382
|
+
}
|
|
1383
|
+
function Rn() {
|
|
1384
|
+
bn = !1;
|
|
1385
|
+
}
|
|
1386
|
+
function zn(e, t, n) {
|
|
1387
|
+
var r = z(kt(n.el, 0, n.options, !0)), i = Vt(n.el, n.options, K), a = 10;
|
|
1388
|
+
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;
|
|
1389
|
+
}
|
|
1390
|
+
function Bn(e, t, n) {
|
|
1391
|
+
var r = z(At(n.el, n.options.draggable)), i = Vt(n.el, n.options, K), a = 10;
|
|
1392
|
+
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;
|
|
1393
|
+
}
|
|
1394
|
+
function Vn(e, t, n, r, i, a, o, s) {
|
|
1395
|
+
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;
|
|
1396
|
+
if (!o) {
|
|
1397
|
+
if (s && vn < l * i) {
|
|
1398
|
+
if (!gn && (hn === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (gn = !0), gn) f = !0;
|
|
1399
|
+
else if (hn === 1 ? c < u + vn : c > d - vn) return -hn;
|
|
1400
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return Hn(t);
|
|
1401
|
+
}
|
|
1402
|
+
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
1403
|
+
}
|
|
1404
|
+
function Hn(e) {
|
|
1405
|
+
return B(W) < B(e) ? 1 : -1;
|
|
1406
|
+
}
|
|
1407
|
+
function Un(e) {
|
|
1408
|
+
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
1409
|
+
return r.toString(36);
|
|
1410
|
+
}
|
|
1411
|
+
function Wn(e) {
|
|
1412
|
+
xn.length = 0;
|
|
1413
|
+
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
1414
|
+
var r = t[n];
|
|
1415
|
+
r.checked && xn.push(r);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
function Gn(e) {
|
|
1419
|
+
return setTimeout(e, 0);
|
|
1420
|
+
}
|
|
1421
|
+
function Kn(e) {
|
|
1422
|
+
return clearTimeout(e);
|
|
1423
|
+
}
|
|
1424
|
+
Sn && F(document, "touchmove", function(e) {
|
|
1425
|
+
(Q.active || rn) && e.cancelable && e.preventDefault();
|
|
1426
|
+
}), Q.utils = {
|
|
1427
|
+
on: F,
|
|
1428
|
+
off: I,
|
|
1429
|
+
css: R,
|
|
1430
|
+
find: Et,
|
|
1431
|
+
is: function(e, t) {
|
|
1432
|
+
return !!Ct(e, t, e, !1);
|
|
1433
|
+
},
|
|
1434
|
+
extend: Pt,
|
|
1435
|
+
throttle: Lt,
|
|
1436
|
+
closest: Ct,
|
|
1437
|
+
toggleClass: L,
|
|
1438
|
+
clone: Bt,
|
|
1439
|
+
index: B,
|
|
1440
|
+
nextTick: Gn,
|
|
1441
|
+
cancelNextTick: Kn,
|
|
1442
|
+
detectDirection: Dn,
|
|
1443
|
+
getChild: kt,
|
|
1444
|
+
expando: V
|
|
1445
|
+
}, Q.get = function(e) {
|
|
1446
|
+
return e[V];
|
|
1447
|
+
}, Q.mount = function() {
|
|
1448
|
+
var e = [...arguments];
|
|
1449
|
+
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
1450
|
+
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
1451
|
+
e.utils && (Q.utils = P(P({}, Q.utils), e.utils)), qt.mount(e);
|
|
1452
|
+
});
|
|
1453
|
+
}, Q.create = function(e, t) {
|
|
1454
|
+
return new Q(e, t);
|
|
1455
|
+
}, Q.version = ft;
|
|
1456
|
+
var $ = [], qn, Jn, Yn = !1, Xn, Zn, Qn, $n;
|
|
1457
|
+
function er() {
|
|
1458
|
+
function e() {
|
|
1459
|
+
for (var e in this.defaults = {
|
|
1460
|
+
scroll: !0,
|
|
1461
|
+
forceAutoScrollFallback: !1,
|
|
1462
|
+
scrollSensitivity: 30,
|
|
1463
|
+
scrollSpeed: 10,
|
|
1464
|
+
bubbleScroll: !0
|
|
1465
|
+
}, this) e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
|
|
1466
|
+
}
|
|
1467
|
+
return e.prototype = {
|
|
1468
|
+
dragStarted: function(e) {
|
|
1469
|
+
var t = e.originalEvent;
|
|
1470
|
+
this.sortable.nativeDraggable ? F(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? F(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? F(document, "touchmove", this._handleFallbackAutoScroll) : F(document, "mousemove", this._handleFallbackAutoScroll);
|
|
1471
|
+
},
|
|
1472
|
+
dragOverCompleted: function(e) {
|
|
1473
|
+
var t = e.originalEvent;
|
|
1474
|
+
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
1475
|
+
},
|
|
1476
|
+
drop: function() {
|
|
1477
|
+
this.sortable.nativeDraggable ? I(document, "dragover", this._handleAutoScroll) : (I(document, "pointermove", this._handleFallbackAutoScroll), I(document, "touchmove", this._handleFallbackAutoScroll), I(document, "mousemove", this._handleFallbackAutoScroll)), nr(), tr(), Rt();
|
|
1478
|
+
},
|
|
1479
|
+
nulling: function() {
|
|
1480
|
+
Qn = Jn = qn = Yn = $n = Xn = Zn = null, $.length = 0;
|
|
1481
|
+
},
|
|
1482
|
+
_handleFallbackAutoScroll: function(e) {
|
|
1483
|
+
this._handleAutoScroll(e, !0);
|
|
1484
|
+
},
|
|
1485
|
+
_handleAutoScroll: function(e, t) {
|
|
1486
|
+
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
1487
|
+
if (Qn = e, t || this.options.forceAutoScrollFallback || ht || mt || _t) {
|
|
1488
|
+
rr(e, this.options, a, t);
|
|
1489
|
+
var o = Nt(a, !0);
|
|
1490
|
+
Yn && (!$n || r !== Xn || i !== Zn) && ($n && nr(), $n = setInterval(function() {
|
|
1491
|
+
var a = Nt(document.elementFromPoint(r, i), !0);
|
|
1492
|
+
a !== o && (o = a, tr()), rr(e, n.options, a, t);
|
|
1493
|
+
}, 10), Xn = r, Zn = i);
|
|
1494
|
+
} else {
|
|
1495
|
+
if (!this.options.bubbleScroll || Nt(a, !0) === Dt()) {
|
|
1496
|
+
tr();
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
rr(e, this.options, Nt(a, !1), !1);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}, N(e, {
|
|
1503
|
+
pluginName: "scroll",
|
|
1504
|
+
initializeByDefault: !0
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
function tr() {
|
|
1508
|
+
$.forEach(function(e) {
|
|
1509
|
+
clearInterval(e.pid);
|
|
1510
|
+
}), $ = [];
|
|
1511
|
+
}
|
|
1512
|
+
function nr() {
|
|
1513
|
+
clearInterval($n);
|
|
1514
|
+
}
|
|
1515
|
+
var rr = Lt(function(e, t, n, r) {
|
|
1516
|
+
if (t.scroll) {
|
|
1517
|
+
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = Dt(), l = !1, u;
|
|
1518
|
+
Jn !== n && (Jn = n, tr(), qn = t.scroll, u = t.scrollFn, qn === !0 && (qn = Nt(n, !0)));
|
|
1519
|
+
var d = 0, f = qn;
|
|
1520
|
+
do {
|
|
1521
|
+
var p = f, m = z(p), h = m.top, g = m.bottom, _ = m.left, ee = m.right, v = m.width, y = m.height, b = void 0, x = void 0, S = p.scrollWidth, C = p.scrollHeight, w = R(p), T = p.scrollLeft, te = p.scrollTop;
|
|
1522
|
+
p === c ? (b = v < S && (w.overflowX === "auto" || w.overflowX === "scroll" || w.overflowX === "visible"), x = y < C && (w.overflowY === "auto" || w.overflowY === "scroll" || w.overflowY === "visible")) : (b = v < S && (w.overflowX === "auto" || w.overflowX === "scroll"), x = y < C && (w.overflowY === "auto" || w.overflowY === "scroll"));
|
|
1523
|
+
var E = b && (Math.abs(ee - i) <= o && T + v < S) - (Math.abs(_ - i) <= o && !!T), ne = x && (Math.abs(g - a) <= o && te + y < C) - (Math.abs(h - a) <= o && !!te);
|
|
1524
|
+
if (!$[d]) for (var D = 0; D <= d; D++) $[D] || ($[D] = {});
|
|
1525
|
+
($[d].vx != E || $[d].vy != ne || $[d].el !== p) && ($[d].el = p, $[d].vx = E, $[d].vy = ne, clearInterval($[d].pid), (E != 0 || ne != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
1526
|
+
r && this.layer === 0 && Q.active._onTouchMove(Qn);
|
|
1527
|
+
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
1528
|
+
(typeof u != "function" || u.call(Q.dragged.parentNode[V], n, t, e, Qn, $[this.layer].el) === "continue") && zt($[this.layer].el, n, t);
|
|
1529
|
+
}.bind({ layer: d }), 24))), d++;
|
|
1530
|
+
} while (t.bubbleScroll && f !== c && (f = Nt(f, !1)));
|
|
1531
|
+
Yn = l;
|
|
1532
|
+
}
|
|
1533
|
+
}, 30), ir = function(e) {
|
|
1534
|
+
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
1535
|
+
if (t) {
|
|
1536
|
+
var c = n || i;
|
|
1537
|
+
o();
|
|
1538
|
+
var l = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, u = document.elementFromPoint(l.clientX, l.clientY);
|
|
1539
|
+
s(), c && !c.el.contains(u) && (a("spill"), this.onSpill({
|
|
1540
|
+
dragEl: r,
|
|
1541
|
+
putSortable: n
|
|
1542
|
+
}));
|
|
1543
|
+
}
|
|
1774
1544
|
};
|
|
1775
|
-
|
|
1776
|
-
|
|
1545
|
+
function ar() {}
|
|
1546
|
+
ar.prototype = {
|
|
1547
|
+
startIndex: null,
|
|
1548
|
+
dragStart: function(e) {
|
|
1549
|
+
var t = e.oldDraggableIndex;
|
|
1550
|
+
this.startIndex = t;
|
|
1551
|
+
},
|
|
1552
|
+
onSpill: function(e) {
|
|
1553
|
+
var t = e.dragEl, n = e.putSortable;
|
|
1554
|
+
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
1555
|
+
var r = kt(this.sortable.el, this.startIndex, this.options);
|
|
1556
|
+
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
1557
|
+
},
|
|
1558
|
+
drop: ir
|
|
1559
|
+
}, N(ar, { pluginName: "revertOnSpill" });
|
|
1560
|
+
function or() {}
|
|
1561
|
+
or.prototype = {
|
|
1562
|
+
onSpill: function(e) {
|
|
1563
|
+
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
1564
|
+
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
1565
|
+
},
|
|
1566
|
+
drop: ir
|
|
1567
|
+
}, N(or, { pluginName: "removeOnSpill" }), Q.mount(new er()), Q.mount(or, ar);
|
|
1568
|
+
//#endregion
|
|
1569
|
+
//#region src/useTabsDrag.ts
|
|
1570
|
+
function sr(e) {
|
|
1571
|
+
let t, n = [];
|
|
1572
|
+
function r(e) {
|
|
1573
|
+
return e?.getAttribute("data-tab-id") ?? e?.querySelector("[data-tab-id]")?.getAttribute("data-tab-id") ?? void 0;
|
|
1574
|
+
}
|
|
1575
|
+
function i() {
|
|
1576
|
+
t?.destroy(), t = void 0;
|
|
1577
|
+
}
|
|
1578
|
+
function a(t) {
|
|
1579
|
+
let n = t.map(r), i = e.items().map((e) => M(e.key));
|
|
1580
|
+
return n.length === i.length && n.every((e, t) => e === i[t]);
|
|
1581
|
+
}
|
|
1582
|
+
function o() {
|
|
1583
|
+
i();
|
|
1584
|
+
let o = e.element.value;
|
|
1585
|
+
!o || !e.enabled() || (t = Q.create(o, {
|
|
1586
|
+
animation: 120,
|
|
1587
|
+
draggable: e.selector ?? "[role=\"tab\"]",
|
|
1588
|
+
direction: "horizontal",
|
|
1589
|
+
scroll: e.scrollElement?.() ?? !0,
|
|
1590
|
+
scrollSensitivity: 36,
|
|
1591
|
+
scrollSpeed: 18,
|
|
1592
|
+
onMove(t) {
|
|
1593
|
+
let n = r(t.dragged), i = r(t.related), a = e.items(), o = a.find((e) => M(e.key) === n), s = a.find((e) => M(e.key) === i), c = !!(o && s && e.canDrag(o) && e.canDrag(s) && o.pinned === s.pinned);
|
|
1594
|
+
return c || e.onInvalid?.(), c;
|
|
1595
|
+
},
|
|
1596
|
+
onStart(t) {
|
|
1597
|
+
n = [...t.from.querySelectorAll(e.selector ?? "[role=\"tab\"]")];
|
|
1598
|
+
},
|
|
1599
|
+
onEnd(t) {
|
|
1600
|
+
let i = r(t.item), o = e.items(), s = o.find((e) => M(e.key) === i), c = t.item.nextElementSibling instanceof HTMLElement ? r(t.item.nextElementSibling) : void 0, l = o.find((e) => M(e.key) === c);
|
|
1601
|
+
s && e.onMove(s.key, l?.key), _(() => {
|
|
1602
|
+
a(n) && n.forEach((e) => t.from.appendChild(e));
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
}));
|
|
1606
|
+
}
|
|
1607
|
+
se([
|
|
1608
|
+
e.element,
|
|
1609
|
+
e.items,
|
|
1610
|
+
e.enabled
|
|
1611
|
+
], o, {
|
|
1612
|
+
immediate: !0,
|
|
1613
|
+
flush: "post"
|
|
1614
|
+
}), b(i);
|
|
1615
|
+
}
|
|
1616
|
+
//#endregion
|
|
1617
|
+
//#region src/useTabsNavState.ts
|
|
1618
|
+
function cr(e, t) {
|
|
1619
|
+
let n = E(!1), r;
|
|
1620
|
+
function i() {
|
|
1621
|
+
let e = t.value, r = e?.parentElement;
|
|
1622
|
+
n.value = !!(e && r && e.scrollWidth > r.clientWidth + 1);
|
|
1623
|
+
}
|
|
1624
|
+
function a() {
|
|
1625
|
+
r?.disconnect();
|
|
1626
|
+
let e = t.value, n = e?.parentElement;
|
|
1627
|
+
if (!e || !n || typeof ResizeObserver > "u") {
|
|
1628
|
+
i();
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
r = new ResizeObserver(i), r.observe(e), r.observe(n), i();
|
|
1632
|
+
}
|
|
1633
|
+
function o(t) {
|
|
1634
|
+
_(() => e.value?.querySelector(`[data-tab-id="${t}"]`)?.closest("[role=\"tab\"]")?.focus());
|
|
1635
|
+
}
|
|
1636
|
+
return se([e, t], a, {
|
|
1637
|
+
immediate: !0,
|
|
1638
|
+
flush: "post"
|
|
1639
|
+
}), b(() => r?.disconnect()), {
|
|
1640
|
+
overflowed: n,
|
|
1641
|
+
focusTab: o
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
//#endregion
|
|
1645
|
+
//#region src/OgTabs.vue?vue&type=script&setup=true&lang.ts
|
|
1646
|
+
var lr = ["aria-busy"], ur = {
|
|
1647
|
+
key: 0,
|
|
1648
|
+
class: "og-tabs__header"
|
|
1649
|
+
}, dr = {
|
|
1650
|
+
key: 1,
|
|
1651
|
+
class: "og-tabs__empty"
|
|
1652
|
+
}, fr = {
|
|
1653
|
+
key: 2,
|
|
1654
|
+
class: "og-tabs__bar"
|
|
1655
|
+
}, pr = { class: "og-tabs__actions" }, mr = ["aria-label"], hr = /* @__PURE__ */ m({
|
|
1656
|
+
inheritAttrs: !1,
|
|
1657
|
+
__name: "OgTabs",
|
|
1658
|
+
props: {
|
|
1659
|
+
modelValue: {},
|
|
1660
|
+
items: {},
|
|
1661
|
+
variant: {},
|
|
1662
|
+
density: {},
|
|
1663
|
+
renderContent: {
|
|
1664
|
+
type: Boolean,
|
|
1665
|
+
default: void 0
|
|
1666
|
+
},
|
|
1667
|
+
features: {},
|
|
1668
|
+
readonly: { type: Boolean },
|
|
1669
|
+
busy: { type: Boolean },
|
|
1670
|
+
tabsProps: {},
|
|
1671
|
+
locale: {},
|
|
1672
|
+
minTabWidth: {},
|
|
1673
|
+
maxTabWidth: {},
|
|
1674
|
+
themeColor: {},
|
|
1675
|
+
sticky: {
|
|
1676
|
+
type: [Boolean, Number],
|
|
1677
|
+
default: void 0
|
|
1678
|
+
},
|
|
1679
|
+
finderThreshold: {},
|
|
1680
|
+
contextMenu: {},
|
|
1681
|
+
actionPolicy: {},
|
|
1682
|
+
beforeAction: {}
|
|
1683
|
+
},
|
|
1684
|
+
emits: [
|
|
1685
|
+
"update:modelValue",
|
|
1686
|
+
"update:items",
|
|
1687
|
+
"action-request",
|
|
1688
|
+
"close-request",
|
|
1689
|
+
"refresh-request",
|
|
1690
|
+
"pin-change-request",
|
|
1691
|
+
"reorder-request",
|
|
1692
|
+
"operation-denied",
|
|
1693
|
+
"operation-error",
|
|
1694
|
+
"tab-click",
|
|
1695
|
+
"tab-change",
|
|
1696
|
+
"tab-remove"
|
|
1697
|
+
],
|
|
1698
|
+
setup(t, { expose: n, emit: i }) {
|
|
1699
|
+
let o = t, m = i, ee = ie();
|
|
1700
|
+
function y(e) {
|
|
1701
|
+
if (Ve(e)) throw TypeError("[OgTabs] Duplicate tab keys are not supported.");
|
|
1702
|
+
}
|
|
1703
|
+
y(o.items);
|
|
1704
|
+
let b = e(), x = ae("tabsRoot"), te = ae("nativeTabs"), E = C(), re = C({
|
|
1705
|
+
x: 0,
|
|
1706
|
+
y: 0
|
|
1707
|
+
}), oe = C(!1), ce = C(), le = C(), de = s(() => o.variant ?? b?.variant ?? "default"), fe = s(() => o.density ?? b?.density ?? "default"), _e = s(() => o.renderContent ?? b?.renderContent ?? !0), ye = s(() => ({
|
|
1708
|
+
...b?.features,
|
|
1709
|
+
...o.features
|
|
1710
|
+
})), xe = s(() => ({
|
|
1711
|
+
...b?.tabsProps,
|
|
1712
|
+
...o.tabsProps
|
|
1713
|
+
})), k = s(() => be(r, b?.localeSource?.value, b?.locale, o.locale)), Te = s(() => ({
|
|
1714
|
+
...b?.contextMenu,
|
|
1715
|
+
...o.contextMenu
|
|
1716
|
+
})), Ee = s(() => o.minTabWidth ?? b?.minTabWidth), De = s(() => o.maxTabWidth ?? b?.maxTabWidth), Oe = s(() => o.themeColor ?? b?.themeColor), je = s(() => o.sticky ?? b?.sticky), Fe = s(() => o.finderThreshold ?? b?.finderThreshold ?? 8), Ie = s(() => (y(o.items), o.items)), ze = s(() => Ae(Ie.value)), j = s(() => o.modelValue), Be = s(() => A(Ie.value, j.value)), He = s(() => j.value === void 0 ? void 0 : M(j.value)), Ue = s(() => ({
|
|
1717
|
+
...xe.value,
|
|
1718
|
+
modelValue: He.value ?? ""
|
|
1719
|
+
})), We = s(() => te.value?.tabNavRef?.tabListRef ?? null), Ge = s(() => Te.value.enabled !== !1), Ke = s(() => new Set(Te.value.hiddenActions)), qe = s(() => $e(Ee.value)), Je = s(() => $e(De.value) ?? "240px"), Ye = cr(x, We), Ze = s(() => Qe("finder") && (Ye.overflowed.value || ze.value.length >= Fe.value));
|
|
1720
|
+
function Qe(e) {
|
|
1721
|
+
return e === "pin" || e === "drag" ? ye.value[e] === !0 : ye.value[e] !== !1;
|
|
1722
|
+
}
|
|
1723
|
+
function $e(e) {
|
|
1724
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
1725
|
+
}
|
|
1726
|
+
function et(e) {
|
|
1727
|
+
return Ie.value.find((t) => M(t.key) === String(e))?.key;
|
|
1728
|
+
}
|
|
1729
|
+
function tt(e) {
|
|
1730
|
+
let t = e.paneName === void 0 ? void 0 : et(e.paneName);
|
|
1731
|
+
return t === void 0 ? e : {
|
|
1732
|
+
...e,
|
|
1733
|
+
paneName: t
|
|
1734
|
+
};
|
|
1735
|
+
}
|
|
1736
|
+
function nt(e) {
|
|
1737
|
+
m("action-request", e), Object.hasOwn(e, "nextActiveKey") && m("update:modelValue", e.nextActiveKey), e.nextItems && m("update:items", e.nextItems), e.operation.startsWith("close") && m("close-request", e), e.operation === "refresh" && m("refresh-request", e), (e.operation === "pin" || e.operation === "unpin") && m("pin-change-request", e), (e.operation === "move" || e.operation === "move-top" || e.operation === "move-bottom") && m("reorder-request", e);
|
|
1738
|
+
}
|
|
1739
|
+
function at(e) {
|
|
1740
|
+
_(() => x.value?.querySelector(`[data-tab-id="${M(e)}"]`)?.closest("[role=\"tab\"]")?.scrollIntoView?.({
|
|
1741
|
+
block: "nearest",
|
|
1742
|
+
inline: "nearest"
|
|
1743
|
+
}));
|
|
1744
|
+
}
|
|
1745
|
+
let N = it({
|
|
1746
|
+
getItems: () => Ie.value,
|
|
1747
|
+
getActiveKey: () => j.value,
|
|
1748
|
+
getProps: () => o,
|
|
1749
|
+
getDeniedReason: (e, t) => ot(e, t),
|
|
1750
|
+
onRequest: nt,
|
|
1751
|
+
onDenied: (e, t, n) => m("operation-denied", e, t, n),
|
|
1752
|
+
onError: (e, t) => m("operation-error", e, t),
|
|
1753
|
+
onScrollTo: at
|
|
1754
|
+
});
|
|
1755
|
+
function ot(e, t) {
|
|
1756
|
+
if (o.busy || N?.pending.value) return "busy";
|
|
1757
|
+
let n = o.actionPolicy;
|
|
1758
|
+
if (n && (n.mode === "allow" ? !n.actions.includes(e) : n.actions.includes(e))) return "policy";
|
|
1759
|
+
if (e === "activate") return t ? t.disabled ? "disabled" : void 0 : "not-found";
|
|
1760
|
+
if (!t && e !== "close-all") return "not-found";
|
|
1761
|
+
if (o.readonly || t?.readonly || t?.disabled) return t?.disabled ? "disabled" : "readonly";
|
|
1762
|
+
if (e.startsWith("close")) return Qe("close") ? e === "close" && !Me(t) ? t?.pinned ? "pinned" : "readonly" : void 0 : "policy";
|
|
1763
|
+
if (e === "refresh") return Qe("refresh") ? void 0 : "policy";
|
|
1764
|
+
if (e === "pin" || e === "unpin") return Qe("pin") ? Ne(t) ? void 0 : "readonly" : "policy";
|
|
1765
|
+
if (e === "move" || e === "move-top" || e === "move-bottom") return Qe("drag") ? Pe(t) ? void 0 : t?.pinned ? "pinned" : "boundary" : "policy";
|
|
1766
|
+
}
|
|
1767
|
+
function P(e, t) {
|
|
1768
|
+
N.activate(e, t).then((t) => {
|
|
1769
|
+
t && at(e);
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
function st(e) {
|
|
1773
|
+
let t = ze.value, n = Re(t, t.filter((t) => t.key !== e), e);
|
|
1774
|
+
le.value = n === void 0 ? void 0 : M(n);
|
|
1775
|
+
}
|
|
1776
|
+
function ct(e, t) {
|
|
1777
|
+
st(e), N.close(e, t).then((e) => {
|
|
1778
|
+
e || (le.value = void 0);
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
function lt(e, t, n) {
|
|
1782
|
+
let r = ze.value, i = Le(r, t, e), a = j.value;
|
|
1783
|
+
if (a !== void 0 && i.some((e) => e.key === a)) {
|
|
1784
|
+
let e = Re(r, r.filter((e) => !i.some((t) => t.key === e.key)), a);
|
|
1785
|
+
le.value = e === void 0 ? void 0 : M(e);
|
|
1786
|
+
}
|
|
1787
|
+
N.closeScopeAt(e, t, n).then((e) => {
|
|
1788
|
+
e || (le.value = void 0);
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
function ut(e, t, n, r) {
|
|
1792
|
+
if (!Ge.value) return;
|
|
1793
|
+
let i = t.getBoundingClientRect(), a = t.closest("[role=\"tab\"]") ?? t;
|
|
1794
|
+
E.value = e, ce.value = a, re.value = {
|
|
1795
|
+
x: n ?? i.left,
|
|
1796
|
+
y: r ?? i.bottom + 4
|
|
1797
|
+
}, oe.value = !0;
|
|
1798
|
+
}
|
|
1799
|
+
function dt(e, t) {
|
|
1800
|
+
e.preventDefault(), ut(t, e.currentTarget, e.clientX, e.clientY);
|
|
1801
|
+
}
|
|
1802
|
+
function ft(e) {
|
|
1803
|
+
Be.value && ut(Be.value, e.currentTarget);
|
|
1804
|
+
}
|
|
1805
|
+
function pt() {
|
|
1806
|
+
oe.value = !1;
|
|
1807
|
+
let e = ce.value;
|
|
1808
|
+
ce.value = void 0, _(() => e?.focus());
|
|
1809
|
+
}
|
|
1810
|
+
function mt(e, t) {
|
|
1811
|
+
re.value = {
|
|
1812
|
+
x: e,
|
|
1813
|
+
y: t
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
function ht(e) {
|
|
1817
|
+
let t = E.value;
|
|
1818
|
+
pt(), t && (e.startsWith("close") ? lt(e === "close" ? "current" : e.replace("close-", ""), t.key, "menu") : e === "refresh" ? N.refreshAt(t.key, "menu") : e === "pin" ? N.pin(t.key, "menu") : e === "unpin" ? N.unpin(t.key, "menu") : e === "move-top" ? N.moveTop(t.key, "menu") : e === "move-bottom" && N.moveBottom(t.key, "menu"));
|
|
1819
|
+
}
|
|
1820
|
+
let gt = s(() => {
|
|
1821
|
+
let e = E.value;
|
|
1822
|
+
return e ? [
|
|
1823
|
+
{
|
|
1824
|
+
operation: "refresh",
|
|
1825
|
+
label: k.value.refresh,
|
|
1826
|
+
icon: ge
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
operation: "close",
|
|
1830
|
+
label: k.value.close,
|
|
1831
|
+
icon: pe,
|
|
1832
|
+
dividerBefore: !0
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
operation: "close-others",
|
|
1836
|
+
label: k.value.closeOthers,
|
|
1837
|
+
icon: pe
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
operation: "close-left",
|
|
1841
|
+
label: k.value.closeLeft,
|
|
1842
|
+
icon: pe
|
|
1843
|
+
},
|
|
1844
|
+
{
|
|
1845
|
+
operation: "close-right",
|
|
1846
|
+
label: k.value.closeRight,
|
|
1847
|
+
icon: pe
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
operation: "close-all",
|
|
1851
|
+
label: k.value.closeAll,
|
|
1852
|
+
icon: pe
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
operation: e.pinned ? "unpin" : "pin",
|
|
1856
|
+
label: e.pinned ? k.value.unpin : k.value.pin,
|
|
1857
|
+
icon: me,
|
|
1858
|
+
dividerBefore: !0
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
operation: "move-top",
|
|
1862
|
+
label: k.value.moveTop,
|
|
1863
|
+
icon: ve,
|
|
1864
|
+
dividerBefore: !0
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
operation: "move-bottom",
|
|
1868
|
+
label: k.value.moveBottom,
|
|
1869
|
+
icon: ue
|
|
1870
|
+
}
|
|
1871
|
+
].filter((e) => !Ke.value.has(e.operation) && (e.operation !== "refresh" || Qe("refresh")) && (!["pin", "unpin"].includes(e.operation) || Qe("pin")) && (!["move-top", "move-bottom"].includes(e.operation) || Qe("drag"))).map((t) => ({
|
|
1872
|
+
...t,
|
|
1873
|
+
disabled: ot(t.operation, e) !== void 0
|
|
1874
|
+
})) : [];
|
|
1875
|
+
});
|
|
1876
|
+
function _t(e) {
|
|
1877
|
+
if (!Qe("keyboard")) return;
|
|
1878
|
+
let t = e.target instanceof HTMLElement ? e.target.closest("[role=\"tab\"]") : null;
|
|
1879
|
+
if (!t) return;
|
|
1880
|
+
let n = t.querySelector("[data-tab-id]")?.getAttribute("data-tab-id"), r = ze.value.find((e) => M(e.key) === n);
|
|
1881
|
+
if (r) {
|
|
1882
|
+
if (e.key === "Delete") {
|
|
1883
|
+
e.preventDefault(), ct(r.key, "keyboard");
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
if (e.key === "Home" || e.key === "End") {
|
|
1887
|
+
e.preventDefault();
|
|
1888
|
+
let t = (e.key === "Home" ? ze.value : [...ze.value].reverse()).find((e) => !e.disabled);
|
|
1889
|
+
t && (P(t.key, "keyboard"), Ye.focusTab(M(t.key)));
|
|
1890
|
+
return;
|
|
1891
|
+
}
|
|
1892
|
+
(e.key === "ContextMenu" || e.key === "F10" && e.shiftKey) && (e.preventDefault(), ut(r, t));
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
async function vt(e) {
|
|
1896
|
+
let t = et(e);
|
|
1897
|
+
return t === void 0 ? !1 : t === j.value || await N.activate(t, "native") && j.value === t;
|
|
1898
|
+
}
|
|
1899
|
+
function yt(e, t) {
|
|
1900
|
+
m("tab-click", tt(e), t);
|
|
1901
|
+
}
|
|
1902
|
+
function bt(e) {
|
|
1903
|
+
m("tab-change", et(e) ?? e);
|
|
1904
|
+
}
|
|
1905
|
+
function F(e) {
|
|
1906
|
+
m("tab-remove", et(e) ?? e);
|
|
1907
|
+
let t = et(e);
|
|
1908
|
+
t !== void 0 && ct(t, "native");
|
|
1909
|
+
}
|
|
1910
|
+
sr({
|
|
1911
|
+
element: We,
|
|
1912
|
+
selector: "[role=\"tab\"]",
|
|
1913
|
+
enabled: () => Qe("drag") && !o.readonly && !o.busy,
|
|
1914
|
+
items: () => ze.value,
|
|
1915
|
+
canDrag: Pe,
|
|
1916
|
+
onMove: (e, t) => {
|
|
1917
|
+
N.moveBefore(e, t, "drag");
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1920
|
+
let I = "";
|
|
1921
|
+
return se([Ie, j], ([e, t], [n]) => {
|
|
1922
|
+
if (t !== void 0 && A(e, t)) {
|
|
1923
|
+
I = "";
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
let r = `${String(t)}:${e.map((e) => String(e.key)).join("|")}`;
|
|
1927
|
+
if (I === r) return;
|
|
1928
|
+
I = r;
|
|
1929
|
+
let i = t === void 0 ? Ae(e).find((e) => !e.disabled)?.key : Re(Ae(n || e), e, t);
|
|
1930
|
+
m("update:modelValue", i);
|
|
1931
|
+
}, { immediate: !0 }), se(j, (e) => {
|
|
1932
|
+
e !== void 0 && at(e), e !== void 0 && le.value === M(e) && (Ye.focusTab(le.value), le.value = void 0);
|
|
1933
|
+
}), n({
|
|
1934
|
+
...N,
|
|
1935
|
+
getNativeTabs: () => te.value ?? void 0
|
|
1936
|
+
}), (e, n) => (S(), u("div", g({
|
|
1937
|
+
ref_key: "tabsRoot",
|
|
1938
|
+
ref: x
|
|
1939
|
+
}, e.$attrs, {
|
|
1940
|
+
class: ["og-tabs", [
|
|
1941
|
+
`og-tabs--${de.value}`,
|
|
1942
|
+
`og-tabs--${fe.value}`,
|
|
1943
|
+
{
|
|
1944
|
+
"is-sticky": je.value,
|
|
1945
|
+
"is-pending": D(N).pending.value || t.busy
|
|
1946
|
+
}
|
|
1947
|
+
]],
|
|
1948
|
+
style: {
|
|
1949
|
+
"--og-tabs-sticky-top": typeof je.value == "number" ? `${je.value}px` : "0px",
|
|
1950
|
+
"--og-tabs-theme-color": Oe.value,
|
|
1951
|
+
"--og-tabs-tab-min-width": qe.value,
|
|
1952
|
+
"--og-tabs-tab-max-width": Je.value
|
|
1953
|
+
},
|
|
1954
|
+
"aria-busy": t.busy || D(N).pending.value,
|
|
1955
|
+
onKeydown: _t
|
|
1956
|
+
}), [
|
|
1957
|
+
ee.header ? (S(), u("div", ur, [T(e.$slots, "header")])) : l("", !0),
|
|
1958
|
+
Ie.value.length ? (S(), u("div", fr, [p(D(we), g({
|
|
1959
|
+
ref_key: "nativeTabs",
|
|
1960
|
+
ref: te
|
|
1961
|
+
}, Ue.value, {
|
|
1962
|
+
class: "og-tabs__native",
|
|
1963
|
+
"before-leave": vt,
|
|
1964
|
+
onTabClick: yt,
|
|
1965
|
+
onTabChange: bt,
|
|
1966
|
+
onTabRemove: F
|
|
1967
|
+
}), {
|
|
1968
|
+
default: O(() => [(S(!0), u(a, null, w(ze.value, (t) => (S(), c(D(Ce), {
|
|
1969
|
+
key: D(M)(t.key),
|
|
1970
|
+
name: D(M)(t.key),
|
|
1971
|
+
disabled: t.disabled === !0,
|
|
1972
|
+
closable: ot("close", t) === void 0,
|
|
1973
|
+
lazy: t.lazy === !0
|
|
1974
|
+
}, {
|
|
1975
|
+
label: O(() => [p(rt, {
|
|
1976
|
+
tab: t,
|
|
1977
|
+
active: t.key === j.value,
|
|
1978
|
+
"min-width": qe.value,
|
|
1979
|
+
"max-width": Je.value,
|
|
1980
|
+
locale: k.value,
|
|
1981
|
+
onContextmenu: (e) => dt(e, t)
|
|
1982
|
+
}, {
|
|
1983
|
+
default: O((t) => [T(e.$slots, "label", g({ ref_for: !0 }, t))]),
|
|
1984
|
+
before: O((t) => [T(e.$slots, "tabBefore", g({ ref_for: !0 }, t))]),
|
|
1985
|
+
after: O((t) => [T(e.$slots, "tabAfter", g({ ref_for: !0 }, t))]),
|
|
1986
|
+
status: O((t) => [T(e.$slots, "status", g({ ref_for: !0 }, t))]),
|
|
1987
|
+
_: 3
|
|
1988
|
+
}, 8, [
|
|
1989
|
+
"tab",
|
|
1990
|
+
"active",
|
|
1991
|
+
"min-width",
|
|
1992
|
+
"max-width",
|
|
1993
|
+
"locale",
|
|
1994
|
+
"onContextmenu"
|
|
1995
|
+
])]),
|
|
1996
|
+
default: O(() => [_e.value && t.key === j.value ? T(e.$slots, "default", {
|
|
1997
|
+
tab: t,
|
|
1998
|
+
active: !0
|
|
1999
|
+
}, void 0, void 0, 0) : l("", !0)]),
|
|
2000
|
+
_: 2
|
|
2001
|
+
}, 1032, [
|
|
2002
|
+
"name",
|
|
2003
|
+
"disabled",
|
|
2004
|
+
"closable",
|
|
2005
|
+
"lazy"
|
|
2006
|
+
]))), 128))]),
|
|
2007
|
+
_: 3
|
|
2008
|
+
}, 16), d("div", pr, [
|
|
2009
|
+
Ze.value ? (S(), c(Xe, {
|
|
2010
|
+
key: 0,
|
|
2011
|
+
tabs: ze.value,
|
|
2012
|
+
"active-key": j.value,
|
|
2013
|
+
locale: k.value,
|
|
2014
|
+
onActivate: n[0] ||= (e) => P(e, "finder")
|
|
2015
|
+
}, null, 8, [
|
|
2016
|
+
"tabs",
|
|
2017
|
+
"active-key",
|
|
2018
|
+
"locale"
|
|
2019
|
+
])) : l("", !0),
|
|
2020
|
+
Ge.value && Be.value ? (S(), u("button", {
|
|
2021
|
+
key: 1,
|
|
2022
|
+
type: "button",
|
|
2023
|
+
class: "og-tabs__action",
|
|
2024
|
+
"aria-label": k.value.tabActions,
|
|
2025
|
+
onClick: ft
|
|
2026
|
+
}, [p(D(Se), { "aria-hidden": "true" }, {
|
|
2027
|
+
default: O(() => [p(D(he))]),
|
|
2028
|
+
_: 1
|
|
2029
|
+
})], 8, mr)) : l("", !0),
|
|
2030
|
+
T(e.$slots, "extra")
|
|
2031
|
+
])])) : (S(), u("div", dr, [T(e.$slots, "empty", {}, () => [f(ne(k.value.empty), 1)])])),
|
|
2032
|
+
p(ke, {
|
|
2033
|
+
visible: oe.value,
|
|
2034
|
+
x: re.value.x,
|
|
2035
|
+
y: re.value.y,
|
|
2036
|
+
items: gt.value,
|
|
2037
|
+
onSelect: ht,
|
|
2038
|
+
onClose: pt,
|
|
2039
|
+
onReposition: mt
|
|
2040
|
+
}, {
|
|
2041
|
+
top: O(() => [T(e.$slots, "contextMenuTop", v(h({
|
|
2042
|
+
operation: "refresh",
|
|
2043
|
+
source: "menu",
|
|
2044
|
+
tab: E.value,
|
|
2045
|
+
activeKey: j.value,
|
|
2046
|
+
activeTab: Be.value,
|
|
2047
|
+
items: Ie.value
|
|
2048
|
+
})))]),
|
|
2049
|
+
bottom: O(() => [T(e.$slots, "contextMenuBottom", v(h({
|
|
2050
|
+
operation: "refresh",
|
|
2051
|
+
source: "menu",
|
|
2052
|
+
tab: E.value,
|
|
2053
|
+
activeKey: j.value,
|
|
2054
|
+
activeTab: Be.value,
|
|
2055
|
+
items: Ie.value
|
|
2056
|
+
})))]),
|
|
2057
|
+
_: 3
|
|
2058
|
+
}, 8, [
|
|
2059
|
+
"visible",
|
|
2060
|
+
"x",
|
|
2061
|
+
"y",
|
|
2062
|
+
"items"
|
|
2063
|
+
])
|
|
2064
|
+
], 16, lr));
|
|
2065
|
+
}
|
|
1777
2066
|
});
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
function Ii(e) {
|
|
1781
|
-
let t, o = [];
|
|
1782
|
-
function n(a) {
|
|
1783
|
-
return a?.getAttribute("data-tab-id") ?? a?.querySelector("[data-tab-id]")?.getAttribute("data-tab-id") ?? void 0;
|
|
1784
|
-
}
|
|
1785
|
-
function i() {
|
|
1786
|
-
t?.destroy(), t = void 0;
|
|
1787
|
-
}
|
|
1788
|
-
function r(a) {
|
|
1789
|
-
const u = a.map(n), d = e.items().map((f) => V(f.key));
|
|
1790
|
-
return u.length === d.length && u.every((f, h) => f === d[h]);
|
|
1791
|
-
}
|
|
1792
|
-
function l() {
|
|
1793
|
-
i();
|
|
1794
|
-
const a = e.element.value;
|
|
1795
|
-
!a || !e.enabled() || (t = w.create(a, {
|
|
1796
|
-
animation: 120,
|
|
1797
|
-
draggable: e.selector ?? '[role="tab"]',
|
|
1798
|
-
direction: "horizontal",
|
|
1799
|
-
scroll: e.scrollElement?.() ?? !0,
|
|
1800
|
-
scrollSensitivity: 36,
|
|
1801
|
-
scrollSpeed: 18,
|
|
1802
|
-
onMove(u) {
|
|
1803
|
-
const d = n(u.dragged), f = n(u.related), h = e.items(), c = h.find((g) => V(g.key) === d), v = h.find((g) => V(g.key) === f), m = !!(c && v && e.canDrag(c) && e.canDrag(v) && c.pinned === v.pinned);
|
|
1804
|
-
return m || e.onInvalid?.(), m;
|
|
1805
|
-
},
|
|
1806
|
-
onStart(u) {
|
|
1807
|
-
o = [
|
|
1808
|
-
...u.from.querySelectorAll(e.selector ?? '[role="tab"]')
|
|
1809
|
-
];
|
|
1810
|
-
},
|
|
1811
|
-
onEnd(u) {
|
|
1812
|
-
const d = n(u.item), f = e.items(), h = f.find((m) => V(m.key) === d), c = u.item.nextElementSibling instanceof HTMLElement ? n(u.item.nextElementSibling) : void 0, v = f.find((m) => V(m.key) === c);
|
|
1813
|
-
h && e.onMove(h.key, v?.key), qe(() => {
|
|
1814
|
-
r(o) && o.forEach((m) => u.from.appendChild(m));
|
|
1815
|
-
});
|
|
1816
|
-
}
|
|
1817
|
-
}));
|
|
1818
|
-
}
|
|
1819
|
-
Me([e.element, e.items, e.enabled], l, {
|
|
1820
|
-
immediate: !0,
|
|
1821
|
-
flush: "post"
|
|
1822
|
-
}), Vt(i);
|
|
1823
|
-
}
|
|
1824
|
-
function xi(e, t) {
|
|
1825
|
-
const o = tt(!1);
|
|
1826
|
-
let n;
|
|
1827
|
-
function i() {
|
|
1828
|
-
const a = t.value, u = a?.parentElement;
|
|
1829
|
-
o.value = !!(a && u && a.scrollWidth > u.clientWidth + 1);
|
|
1830
|
-
}
|
|
1831
|
-
function r() {
|
|
1832
|
-
n?.disconnect();
|
|
1833
|
-
const a = t.value, u = a?.parentElement;
|
|
1834
|
-
if (!a || !u || typeof ResizeObserver > "u") {
|
|
1835
|
-
i();
|
|
1836
|
-
return;
|
|
1837
|
-
}
|
|
1838
|
-
n = new ResizeObserver(i), n.observe(a), n.observe(u), i();
|
|
1839
|
-
}
|
|
1840
|
-
function l(a) {
|
|
1841
|
-
qe(
|
|
1842
|
-
() => e.value?.querySelector(`[data-tab-id="${a}"]`)?.closest('[role="tab"]')?.focus()
|
|
1843
|
-
);
|
|
1844
|
-
}
|
|
1845
|
-
return Me([e, t], r, { immediate: !0, flush: "post" }), Vt(() => n?.disconnect()), { overflowed: o, focusTab: l };
|
|
1846
|
-
}
|
|
1847
|
-
const Ai = ["aria-busy"], Oi = {
|
|
1848
|
-
key: 0,
|
|
1849
|
-
class: "og-tabs__header"
|
|
1850
|
-
}, Pi = {
|
|
1851
|
-
key: 1,
|
|
1852
|
-
class: "og-tabs__empty"
|
|
1853
|
-
}, Ni = {
|
|
1854
|
-
key: 2,
|
|
1855
|
-
class: "og-tabs__bar"
|
|
1856
|
-
}, Mi = { class: "og-tabs__actions" }, $i = ["aria-label"], Yi = /* @__PURE__ */ Ct({
|
|
1857
|
-
inheritAttrs: !1,
|
|
1858
|
-
__name: "OgTabs",
|
|
1859
|
-
props: {
|
|
1860
|
-
modelValue: {},
|
|
1861
|
-
items: {},
|
|
1862
|
-
variant: {},
|
|
1863
|
-
density: {},
|
|
1864
|
-
renderContent: { type: Boolean, default: void 0 },
|
|
1865
|
-
features: {},
|
|
1866
|
-
readonly: { type: Boolean },
|
|
1867
|
-
busy: { type: Boolean },
|
|
1868
|
-
tabsProps: {},
|
|
1869
|
-
locale: {},
|
|
1870
|
-
minTabWidth: {},
|
|
1871
|
-
maxTabWidth: {},
|
|
1872
|
-
themeColor: {},
|
|
1873
|
-
sticky: { type: [Boolean, Number], default: void 0 },
|
|
1874
|
-
finderThreshold: {},
|
|
1875
|
-
contextMenu: {},
|
|
1876
|
-
actionPolicy: {},
|
|
1877
|
-
beforeAction: {}
|
|
1878
|
-
},
|
|
1879
|
-
emits: ["update:modelValue", "update:items", "action-request", "close-request", "refresh-request", "pin-change-request", "reorder-request", "operation-denied", "operation-error", "tab-click", "tab-change", "tab-remove"],
|
|
1880
|
-
setup(e, { expose: t, emit: o }) {
|
|
1881
|
-
const n = e, i = o, r = mo();
|
|
1882
|
-
function l(s) {
|
|
1883
|
-
if ($o(s)) throw new TypeError("[OgTabs] Duplicate tab keys are not supported.");
|
|
1884
|
-
}
|
|
1885
|
-
l(n.items);
|
|
1886
|
-
const a = so(), u = yt("tabsRoot"), d = yt("nativeTabs"), f = Ue(), h = Ue({ x: 0, y: 0 }), c = Ue(!1), v = Ue(), m = Ue(), g = O(() => n.variant ?? a?.variant ?? "default"), S = O(() => n.density ?? a?.density ?? "default"), k = O(() => n.renderContent ?? a?.renderContent ?? !0), x = O(() => ({ ...a?.features, ...n.features })), T = O(() => ({ ...a?.tabsProps, ...n.tabsProps })), _ = O(
|
|
1887
|
-
() => Do(
|
|
1888
|
-
uo,
|
|
1889
|
-
a?.localeSource?.value,
|
|
1890
|
-
a?.locale,
|
|
1891
|
-
n.locale
|
|
1892
|
-
)
|
|
1893
|
-
), P = O(() => ({ ...a?.contextMenu, ...n.contextMenu })), U = O(() => n.minTabWidth ?? a?.minTabWidth), be = O(() => n.maxTabWidth ?? a?.maxTabWidth), ke = O(() => n.themeColor ?? a?.themeColor), H = O(() => n.sticky ?? a?.sticky), Ie = O(() => n.finderThreshold ?? a?.finderThreshold ?? 8), q = O(() => (l(n.items), n.items)), Z = O(() => me(q.value)), M = O(() => n.modelValue), oe = O(() => X(q.value, M.value)), xe = O(
|
|
1894
|
-
() => M.value === void 0 ? void 0 : V(M.value)
|
|
1895
|
-
), fe = O(() => ({
|
|
1896
|
-
...T.value,
|
|
1897
|
-
modelValue: xe.value ?? ""
|
|
1898
|
-
})), Ae = O(() => d.value?.tabNavRef?.tabListRef ?? null), Te = O(() => P.value.enabled !== !1), It = O(
|
|
1899
|
-
() => new Set(P.value.hiddenActions)
|
|
1900
|
-
), xt = O(() => nn(U.value)), je = O(() => nn(be.value) ?? "240px"), Ge = xi(u, Ae), zn = O(
|
|
1901
|
-
() => he("finder") && (Ge.overflowed.value || Z.value.length >= Ie.value)
|
|
1902
|
-
);
|
|
1903
|
-
function he(s) {
|
|
1904
|
-
return s === "pin" || s === "drag" ? x.value[s] === !0 : x.value[s] !== !1;
|
|
1905
|
-
}
|
|
1906
|
-
function nn(s) {
|
|
1907
|
-
return typeof s == "number" ? `${s}px` : s;
|
|
1908
|
-
}
|
|
1909
|
-
function Ke(s) {
|
|
1910
|
-
return q.value.find((b) => V(b.key) === String(s))?.key;
|
|
1911
|
-
}
|
|
1912
|
-
function jn(s) {
|
|
1913
|
-
const b = s.paneName === void 0 ? void 0 : Ke(s.paneName);
|
|
1914
|
-
return b === void 0 ? s : { ...s, paneName: b };
|
|
1915
|
-
}
|
|
1916
|
-
function Gn(s) {
|
|
1917
|
-
i("action-request", s), Object.prototype.hasOwnProperty.call(s, "nextActiveKey") && i("update:modelValue", s.nextActiveKey), s.nextItems && i("update:items", s.nextItems), s.operation.startsWith("close") && i("close-request", s), s.operation === "refresh" && i("refresh-request", s), (s.operation === "pin" || s.operation === "unpin") && i("pin-change-request", s), (s.operation === "move" || s.operation === "move-top" || s.operation === "move-bottom") && i("reorder-request", s);
|
|
1918
|
-
}
|
|
1919
|
-
function At(s) {
|
|
1920
|
-
qe(
|
|
1921
|
-
() => u.value?.querySelector(`[data-tab-id="${V(s)}"]`)?.closest('[role="tab"]')?.scrollIntoView?.({ block: "nearest", inline: "nearest" })
|
|
1922
|
-
);
|
|
1923
|
-
}
|
|
1924
|
-
const ee = ei({
|
|
1925
|
-
getItems: () => q.value,
|
|
1926
|
-
getActiveKey: () => M.value,
|
|
1927
|
-
getProps: () => n,
|
|
1928
|
-
getDeniedReason: (s, b) => Ot(s, b),
|
|
1929
|
-
onRequest: Gn,
|
|
1930
|
-
onDenied: (s, b, D) => i("operation-denied", s, b, D),
|
|
1931
|
-
onError: (s, b) => i("operation-error", s, b),
|
|
1932
|
-
onScrollTo: At
|
|
1933
|
-
});
|
|
1934
|
-
function Ot(s, b) {
|
|
1935
|
-
if (n.busy || ee?.pending.value) return "busy";
|
|
1936
|
-
const D = n.actionPolicy;
|
|
1937
|
-
if (D && (D.mode === "allow" ? !D.actions.includes(s) : D.actions.includes(s)))
|
|
1938
|
-
return "policy";
|
|
1939
|
-
if (s === "activate") return b ? b.disabled ? "disabled" : void 0 : "not-found";
|
|
1940
|
-
if (!b && s !== "close-all") return "not-found";
|
|
1941
|
-
if (n.readonly || b?.readonly || b?.disabled)
|
|
1942
|
-
return b?.disabled ? "disabled" : "readonly";
|
|
1943
|
-
if (s.startsWith("close"))
|
|
1944
|
-
return he("close") ? s === "close" && !We(b) ? b?.pinned ? "pinned" : "readonly" : void 0 : "policy";
|
|
1945
|
-
if (s === "refresh") return he("refresh") ? void 0 : "policy";
|
|
1946
|
-
if (s === "pin" || s === "unpin")
|
|
1947
|
-
return he("pin") ? xn(b) ? void 0 : "readonly" : "policy";
|
|
1948
|
-
if (s === "move" || s === "move-top" || s === "move-bottom")
|
|
1949
|
-
return he("drag") ? st(b) ? void 0 : b?.pinned ? "pinned" : "boundary" : "policy";
|
|
1950
|
-
}
|
|
1951
|
-
function on(s, b) {
|
|
1952
|
-
ee.activate(s, b).then((D) => {
|
|
1953
|
-
D && At(s);
|
|
1954
|
-
});
|
|
1955
|
-
}
|
|
1956
|
-
function Kn(s) {
|
|
1957
|
-
const b = Z.value, D = b.filter((Q) => Q.key !== s), N = nt(b, D, s);
|
|
1958
|
-
m.value = N === void 0 ? void 0 : V(N);
|
|
1959
|
-
}
|
|
1960
|
-
function rn(s, b) {
|
|
1961
|
-
Kn(s), ee.close(s, b).then((D) => {
|
|
1962
|
-
D || (m.value = void 0);
|
|
1963
|
-
});
|
|
1964
|
-
}
|
|
1965
|
-
function Vn(s, b, D) {
|
|
1966
|
-
const N = Z.value, Q = An(N, b, s), ue = M.value;
|
|
1967
|
-
if (ue !== void 0 && Q.some((Ve) => Ve.key === ue)) {
|
|
1968
|
-
const Ve = N.filter((ao) => !Q.some((lo) => lo.key === ao.key)), ln = nt(N, Ve, ue);
|
|
1969
|
-
m.value = ln === void 0 ? void 0 : V(ln);
|
|
1970
|
-
}
|
|
1971
|
-
ee.closeScopeAt(s, b, D).then((Ve) => {
|
|
1972
|
-
Ve || (m.value = void 0);
|
|
1973
|
-
});
|
|
1974
|
-
}
|
|
1975
|
-
function Pt(s, b, D, N) {
|
|
1976
|
-
if (!Te.value) return;
|
|
1977
|
-
const Q = b.getBoundingClientRect(), ue = b.closest('[role="tab"]') ?? b;
|
|
1978
|
-
f.value = s, v.value = ue, h.value = { x: D ?? Q.left, y: N ?? Q.bottom + 4 }, c.value = !0;
|
|
1979
|
-
}
|
|
1980
|
-
function Un(s, b) {
|
|
1981
|
-
s.preventDefault(), Pt(b, s.currentTarget, s.clientX, s.clientY);
|
|
1982
|
-
}
|
|
1983
|
-
function Zn(s) {
|
|
1984
|
-
oe.value && Pt(oe.value, s.currentTarget);
|
|
1985
|
-
}
|
|
1986
|
-
function an() {
|
|
1987
|
-
c.value = !1;
|
|
1988
|
-
const s = v.value;
|
|
1989
|
-
v.value = void 0, qe(() => s?.focus());
|
|
1990
|
-
}
|
|
1991
|
-
function Qn(s, b) {
|
|
1992
|
-
h.value = { x: s, y: b };
|
|
1993
|
-
}
|
|
1994
|
-
function Jn(s) {
|
|
1995
|
-
const b = f.value;
|
|
1996
|
-
an(), b && (s.startsWith("close") ? Vn(
|
|
1997
|
-
s === "close" ? "current" : s.replace("close-", ""),
|
|
1998
|
-
b.key,
|
|
1999
|
-
"menu"
|
|
2000
|
-
) : s === "refresh" ? ee.refreshAt(b.key, "menu") : s === "pin" ? ee.pin(b.key, "menu") : s === "unpin" ? ee.unpin(b.key, "menu") : s === "move-top" ? ee.moveTop(b.key, "menu") : s === "move-bottom" && ee.moveBottom(b.key, "menu"));
|
|
2001
|
-
}
|
|
2002
|
-
const eo = O(() => {
|
|
2003
|
-
const s = f.value;
|
|
2004
|
-
return s ? [
|
|
2005
|
-
{ operation: "refresh", label: _.value.refresh, icon: wo },
|
|
2006
|
-
{ operation: "close", label: _.value.close, icon: Ze, dividerBefore: !0 },
|
|
2007
|
-
{ operation: "close-others", label: _.value.closeOthers, icon: Ze },
|
|
2008
|
-
{ operation: "close-left", label: _.value.closeLeft, icon: Ze },
|
|
2009
|
-
{ operation: "close-right", label: _.value.closeRight, icon: Ze },
|
|
2010
|
-
{ operation: "close-all", label: _.value.closeAll, icon: Ze },
|
|
2011
|
-
{
|
|
2012
|
-
operation: s.pinned ? "unpin" : "pin",
|
|
2013
|
-
label: s.pinned ? _.value.unpin : _.value.pin,
|
|
2014
|
-
icon: In,
|
|
2015
|
-
dividerBefore: !0
|
|
2016
|
-
},
|
|
2017
|
-
{ operation: "move-top", label: _.value.moveTop, icon: Eo, dividerBefore: !0 },
|
|
2018
|
-
{ operation: "move-bottom", label: _.value.moveBottom, icon: To }
|
|
2019
|
-
].filter(
|
|
2020
|
-
(D) => !It.value.has(D.operation) && (D.operation !== "refresh" || he("refresh")) && (!["pin", "unpin"].includes(D.operation) || he("pin")) && (!["move-top", "move-bottom"].includes(D.operation) || he("drag"))
|
|
2021
|
-
).map((D) => ({ ...D, disabled: Ot(D.operation, s) !== void 0 })) : [];
|
|
2022
|
-
});
|
|
2023
|
-
function to(s) {
|
|
2024
|
-
if (!he("keyboard")) return;
|
|
2025
|
-
const b = s.target instanceof HTMLElement ? s.target.closest('[role="tab"]') : null;
|
|
2026
|
-
if (!b) return;
|
|
2027
|
-
const D = b.querySelector("[data-tab-id]")?.getAttribute("data-tab-id"), N = Z.value.find((Q) => V(Q.key) === D);
|
|
2028
|
-
if (N) {
|
|
2029
|
-
if (s.key === "Delete") {
|
|
2030
|
-
s.preventDefault(), rn(N.key, "keyboard");
|
|
2031
|
-
return;
|
|
2032
|
-
}
|
|
2033
|
-
if (s.key === "Home" || s.key === "End") {
|
|
2034
|
-
s.preventDefault();
|
|
2035
|
-
const Q = (s.key === "Home" ? Z.value : [...Z.value].reverse()).find((ue) => !ue.disabled);
|
|
2036
|
-
Q && (on(Q.key, "keyboard"), Ge.focusTab(V(Q.key)));
|
|
2037
|
-
return;
|
|
2038
|
-
}
|
|
2039
|
-
(s.key === "ContextMenu" || s.key === "F10" && s.shiftKey) && (s.preventDefault(), Pt(N, b));
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
async function no(s) {
|
|
2043
|
-
const b = Ke(s);
|
|
2044
|
-
return b === void 0 ? !1 : b === M.value ? !0 : await ee.activate(b, "native") && M.value === b;
|
|
2045
|
-
}
|
|
2046
|
-
function oo(s, b) {
|
|
2047
|
-
i("tab-click", jn(s), b);
|
|
2048
|
-
}
|
|
2049
|
-
function io(s) {
|
|
2050
|
-
i("tab-change", Ke(s) ?? s);
|
|
2051
|
-
}
|
|
2052
|
-
function ro(s) {
|
|
2053
|
-
i("tab-remove", Ke(s) ?? s);
|
|
2054
|
-
const b = Ke(s);
|
|
2055
|
-
b !== void 0 && rn(b, "native");
|
|
2056
|
-
}
|
|
2057
|
-
Ii({
|
|
2058
|
-
element: Ae,
|
|
2059
|
-
selector: '[role="tab"]',
|
|
2060
|
-
enabled: () => he("drag") && !n.readonly && !n.busy,
|
|
2061
|
-
items: () => Z.value,
|
|
2062
|
-
canDrag: st,
|
|
2063
|
-
onMove: (s, b) => {
|
|
2064
|
-
ee.moveBefore(s, b, "drag");
|
|
2065
|
-
}
|
|
2066
|
-
});
|
|
2067
|
-
let Nt = "";
|
|
2068
|
-
return Me(
|
|
2069
|
-
[q, M],
|
|
2070
|
-
([s, b], [D]) => {
|
|
2071
|
-
if (b !== void 0 && X(s, b)) {
|
|
2072
|
-
Nt = "";
|
|
2073
|
-
return;
|
|
2074
|
-
}
|
|
2075
|
-
const N = `${String(b)}:${s.map((ue) => String(ue.key)).join("|")}`;
|
|
2076
|
-
if (Nt === N) return;
|
|
2077
|
-
Nt = N;
|
|
2078
|
-
const Q = b === void 0 ? me(s).find((ue) => !ue.disabled)?.key : nt(me(D || s), s, b);
|
|
2079
|
-
i("update:modelValue", Q);
|
|
2080
|
-
},
|
|
2081
|
-
{ immediate: !0 }
|
|
2082
|
-
), Me(M, (s) => {
|
|
2083
|
-
s !== void 0 && At(s), s !== void 0 && m.value === V(s) && (Ge.focusTab(m.value), m.value = void 0);
|
|
2084
|
-
}), t({
|
|
2085
|
-
...ee,
|
|
2086
|
-
getNativeTabs: () => d.value ?? void 0
|
|
2087
|
-
}), (s, b) => (A(), Y("div", $e({
|
|
2088
|
-
ref_key: "tabsRoot",
|
|
2089
|
-
ref: u
|
|
2090
|
-
}, s.$attrs, {
|
|
2091
|
-
class: ["og-tabs", [
|
|
2092
|
-
`og-tabs--${g.value}`,
|
|
2093
|
-
`og-tabs--${S.value}`,
|
|
2094
|
-
{ "is-sticky": H.value, "is-pending": F(ee).pending.value || e.busy }
|
|
2095
|
-
]],
|
|
2096
|
-
style: {
|
|
2097
|
-
"--og-tabs-sticky-top": typeof H.value == "number" ? `${H.value}px` : "0px",
|
|
2098
|
-
"--og-tabs-theme-color": ke.value,
|
|
2099
|
-
"--og-tabs-tab-min-width": xt.value,
|
|
2100
|
-
"--og-tabs-tab-max-width": je.value
|
|
2101
|
-
},
|
|
2102
|
-
"aria-busy": e.busy || F(ee).pending.value,
|
|
2103
|
-
onKeydown: to
|
|
2104
|
-
}), [
|
|
2105
|
-
r.header ? (A(), Y("div", Oi, [
|
|
2106
|
-
K(s.$slots, "header")
|
|
2107
|
-
])) : ae("", !0),
|
|
2108
|
-
q.value.length ? (A(), Y("div", Ni, [
|
|
2109
|
-
De(F(ko), $e({
|
|
2110
|
-
ref_key: "nativeTabs",
|
|
2111
|
-
ref: d
|
|
2112
|
-
}, fe.value, {
|
|
2113
|
-
class: "og-tabs__native",
|
|
2114
|
-
"before-leave": no,
|
|
2115
|
-
onTabClick: oo,
|
|
2116
|
-
onTabChange: io,
|
|
2117
|
-
onTabRemove: ro
|
|
2118
|
-
}), {
|
|
2119
|
-
default: j(() => [
|
|
2120
|
-
(A(!0), Y(wt, null, Ut(Z.value, (D) => (A(), se(F(Io), {
|
|
2121
|
-
key: F(V)(D.key),
|
|
2122
|
-
name: F(V)(D.key),
|
|
2123
|
-
disabled: D.disabled === !0,
|
|
2124
|
-
closable: Ot("close", D) === void 0,
|
|
2125
|
-
lazy: D.lazy === !0
|
|
2126
|
-
}, {
|
|
2127
|
-
label: j(() => [
|
|
2128
|
-
De(Jo, {
|
|
2129
|
-
tab: D,
|
|
2130
|
-
active: D.key === M.value,
|
|
2131
|
-
"min-width": xt.value,
|
|
2132
|
-
"max-width": je.value,
|
|
2133
|
-
locale: _.value,
|
|
2134
|
-
onContextmenu: (N) => Un(N, D)
|
|
2135
|
-
}, {
|
|
2136
|
-
default: j((N) => [
|
|
2137
|
-
K(s.$slots, "label", $e({ ref_for: !0 }, N))
|
|
2138
|
-
]),
|
|
2139
|
-
before: j((N) => [
|
|
2140
|
-
K(s.$slots, "tabBefore", $e({ ref_for: !0 }, N))
|
|
2141
|
-
]),
|
|
2142
|
-
after: j((N) => [
|
|
2143
|
-
K(s.$slots, "tabAfter", $e({ ref_for: !0 }, N))
|
|
2144
|
-
]),
|
|
2145
|
-
status: j((N) => [
|
|
2146
|
-
K(s.$slots, "status", $e({ ref_for: !0 }, N))
|
|
2147
|
-
]),
|
|
2148
|
-
_: 3
|
|
2149
|
-
}, 8, ["tab", "active", "min-width", "max-width", "locale", "onContextmenu"])
|
|
2150
|
-
]),
|
|
2151
|
-
default: j(() => [
|
|
2152
|
-
k.value && D.key === M.value ? K(s.$slots, "default", {
|
|
2153
|
-
tab: D,
|
|
2154
|
-
active: !0
|
|
2155
|
-
}, void 0, void 0, 0) : ae("", !0)
|
|
2156
|
-
]),
|
|
2157
|
-
_: 2
|
|
2158
|
-
}, 1032, ["name", "disabled", "closable", "lazy"]))), 128))
|
|
2159
|
-
]),
|
|
2160
|
-
_: 3
|
|
2161
|
-
}, 16),
|
|
2162
|
-
ve("div", Mi, [
|
|
2163
|
-
zn.value ? (A(), se(zo, {
|
|
2164
|
-
key: 0,
|
|
2165
|
-
tabs: Z.value,
|
|
2166
|
-
"active-key": M.value,
|
|
2167
|
-
locale: _.value,
|
|
2168
|
-
onActivate: b[0] || (b[0] = (D) => on(D, "finder"))
|
|
2169
|
-
}, null, 8, ["tabs", "active-key", "locale"])) : ae("", !0),
|
|
2170
|
-
Te.value && oe.value ? (A(), Y("button", {
|
|
2171
|
-
key: 1,
|
|
2172
|
-
type: "button",
|
|
2173
|
-
class: "og-tabs__action",
|
|
2174
|
-
"aria-label": _.value.tabActions,
|
|
2175
|
-
onClick: Zn
|
|
2176
|
-
}, [
|
|
2177
|
-
De(F(Ye), { "aria-hidden": "true" }, {
|
|
2178
|
-
default: j(() => [
|
|
2179
|
-
De(F(_o))
|
|
2180
|
-
]),
|
|
2181
|
-
_: 1
|
|
2182
|
-
})
|
|
2183
|
-
], 8, $i)) : ae("", !0),
|
|
2184
|
-
K(s.$slots, "extra")
|
|
2185
|
-
])
|
|
2186
|
-
])) : (A(), Y("div", Pi, [
|
|
2187
|
-
K(s.$slots, "empty", {}, () => [
|
|
2188
|
-
kn(Xe(_.value.empty), 1)
|
|
2189
|
-
])
|
|
2190
|
-
])),
|
|
2191
|
-
De(Po, {
|
|
2192
|
-
visible: c.value,
|
|
2193
|
-
x: h.value.x,
|
|
2194
|
-
y: h.value.y,
|
|
2195
|
-
items: eo.value,
|
|
2196
|
-
onSelect: Jn,
|
|
2197
|
-
onClose: an,
|
|
2198
|
-
onReposition: Qn
|
|
2199
|
-
}, {
|
|
2200
|
-
top: j(() => [
|
|
2201
|
-
K(s.$slots, "contextMenuTop", cn(dn({
|
|
2202
|
-
operation: "refresh",
|
|
2203
|
-
source: "menu",
|
|
2204
|
-
tab: f.value,
|
|
2205
|
-
activeKey: M.value,
|
|
2206
|
-
activeTab: oe.value,
|
|
2207
|
-
items: q.value
|
|
2208
|
-
})))
|
|
2209
|
-
]),
|
|
2210
|
-
bottom: j(() => [
|
|
2211
|
-
K(s.$slots, "contextMenuBottom", cn(dn({
|
|
2212
|
-
operation: "refresh",
|
|
2213
|
-
source: "menu",
|
|
2214
|
-
tab: f.value,
|
|
2215
|
-
activeKey: M.value,
|
|
2216
|
-
activeTab: oe.value,
|
|
2217
|
-
items: q.value
|
|
2218
|
-
})))
|
|
2219
|
-
]),
|
|
2220
|
-
_: 3
|
|
2221
|
-
}, 8, ["visible", "x", "y", "items"])
|
|
2222
|
-
], 16, Ai));
|
|
2223
|
-
}
|
|
2224
|
-
});
|
|
2225
|
-
export {
|
|
2226
|
-
Gi as OG_TABS_LOCALE_EN_US,
|
|
2227
|
-
uo as OG_TABS_LOCALE_ZH_CN,
|
|
2228
|
-
Ki as OG_TABS_LOCALE_ZH_TW,
|
|
2229
|
-
Yi as OgTabs,
|
|
2230
|
-
We as canCloseTab,
|
|
2231
|
-
st as canMoveTab,
|
|
2232
|
-
xn as canPinTab,
|
|
2233
|
-
zi as createOgTabs,
|
|
2234
|
-
No as filterTabs,
|
|
2235
|
-
X as findTab,
|
|
2236
|
-
An as getCloseScopeTabs,
|
|
2237
|
-
$o as hasDuplicateKeys,
|
|
2238
|
-
hn as moveTab,
|
|
2239
|
-
vn as moveTabToEdge,
|
|
2240
|
-
mn as operationForCloseScope,
|
|
2241
|
-
me as orderTabs,
|
|
2242
|
-
fn as removeTabs,
|
|
2243
|
-
nt as resolveNextActive,
|
|
2244
|
-
Mo as setTabPinned,
|
|
2245
|
-
so as useOgTabsGlobalConfig,
|
|
2246
|
-
ei as useTabsController
|
|
2247
|
-
};
|
|
2067
|
+
//#endregion
|
|
2068
|
+
export { n as OG_TABS_LOCALE_EN_US, r as OG_TABS_LOCALE_ZH_CN, i as OG_TABS_LOCALE_ZH_TW, hr as OgTabs, Me as canCloseTab, Pe as canMoveTab, Ne as canPinTab, t as createOgTabs, je as filterTabs, A as findTab, Le as getCloseScopeTabs, Ve as hasDuplicateKeys, ze as moveTab, j as moveTabToEdge, Be as operationForCloseScope, Ae as orderTabs, Ie as removeTabs, Re as resolveNextActive, Fe as setTabPinned, e as useOgTabsGlobalConfig, it as useTabsController };
|