@origen-ui/tabs 1.0.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/LICENSE +21 -0
- package/README.md +92 -0
- package/dist/config-BVOCsdxN.js +16 -0
- package/dist/config-DbOzZnZx.cjs +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.mjs +2247 -0
- package/dist/locale.cjs +1 -0
- package/dist/locale.d.ts +64 -0
- package/dist/locale.mjs +63 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +209 -0
- package/dist/runtime.mjs +9 -0
- package/dist/style.css +1 -0
- package/package.json +77 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2247 @@
|
|
|
1
|
+
import { u as so } from "./config-BVOCsdxN.js";
|
|
2
|
+
import { c as zi } from "./config-BVOCsdxN.js";
|
|
3
|
+
import { OG_TABS_LOCALE_ZH_CN as uo } from "./locale.mjs";
|
|
4
|
+
import { OG_TABS_LOCALE_EN_US as Gi, OG_TABS_LOCALE_ZH_TW as Ki } from "./locale.mjs";
|
|
5
|
+
import { defineComponent as Ct, useTemplateRef as yt, watch as Me, nextTick as qe, onMounted as co, onBeforeUnmount as Vt, openBlock as A, createBlock as se, Teleport as fo, createElementBlock as Y, withModifiers as sn, normalizeStyle as Sn, renderSlot as K, Fragment as wt, renderList as Ut, createCommentVNode as ae, createElementVNode as ve, unref as F, withCtx as j, resolveDynamicComponent as Ht, toDisplayString as Xe, shallowRef as tt, useId as un, computed as O, withDirectives as ho, vModelText as vo, normalizeClass as Cn, createVNode as De, createTextVNode as kn, useSlots as mo, ref as Ue, mergeProps as $e, normalizeProps as cn, guardReactiveProps as dn } from "vue";
|
|
6
|
+
import { Search as po, CollectionTag as In, CircleCheckFilled as go, CircleCloseFilled as bo, WarningFilled as yo, Refresh as wo, Close as Ze, Top as Eo, Bottom as To, MoreFilled as _o } from "@element-plus/icons-vue";
|
|
7
|
+
import { mergeLocale as Do } from "@origen-ui/shared";
|
|
8
|
+
import { ElIcon as Ye, ElPopover as So, ElEmpty as Co, ElTabs as ko, ElTabPane as Io } from "element-plus";
|
|
9
|
+
const xo = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "og-tabs-context-menu__divider",
|
|
12
|
+
role: "separator"
|
|
13
|
+
}, Ao = ["disabled", "onClick"], Oo = /* @__PURE__ */ Ct({
|
|
14
|
+
__name: "OgTabsContextMenu",
|
|
15
|
+
props: {
|
|
16
|
+
visible: { type: Boolean },
|
|
17
|
+
x: {},
|
|
18
|
+
y: {},
|
|
19
|
+
items: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["select", "close", "reposition"],
|
|
22
|
+
setup(e, { emit: t }) {
|
|
23
|
+
const o = e, n = t, i = yt("menu");
|
|
24
|
+
function r() {
|
|
25
|
+
n("close");
|
|
26
|
+
}
|
|
27
|
+
function l() {
|
|
28
|
+
return [
|
|
29
|
+
...i.value?.querySelectorAll('[role="menuitem"]:not(:disabled)') ?? []
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
function a() {
|
|
33
|
+
const f = i.value;
|
|
34
|
+
if (!f) return;
|
|
35
|
+
const h = f.getBoundingClientRect();
|
|
36
|
+
n(
|
|
37
|
+
"reposition",
|
|
38
|
+
Math.max(4, Math.min(o.x, window.innerWidth - h.width - 4)),
|
|
39
|
+
Math.max(4, Math.min(o.y, window.innerHeight - h.height - 4))
|
|
40
|
+
), l()[0]?.focus();
|
|
41
|
+
}
|
|
42
|
+
function u(f) {
|
|
43
|
+
i.value?.contains(f.target) || r();
|
|
44
|
+
}
|
|
45
|
+
function d(f) {
|
|
46
|
+
const h = l(), c = h.indexOf(document.activeElement);
|
|
47
|
+
if (f.key === "Escape") {
|
|
48
|
+
f.preventDefault(), r();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!h.length || !["ArrowDown", "ArrowUp", "Home", "End"].includes(f.key)) return;
|
|
52
|
+
f.preventDefault();
|
|
53
|
+
const v = f.key === "Home" ? 0 : f.key === "End" ? h.length - 1 : (c + (f.key === "ArrowDown" ? 1 : -1) + h.length) % h.length;
|
|
54
|
+
h[v]?.focus();
|
|
55
|
+
}
|
|
56
|
+
return Me(
|
|
57
|
+
() => o.visible,
|
|
58
|
+
(f) => {
|
|
59
|
+
f && qe(a);
|
|
60
|
+
}
|
|
61
|
+
), co(() => window.addEventListener("pointerdown", u)), Vt(() => window.removeEventListener("pointerdown", u)), (f, h) => (A(), se(fo, { to: "body" }, [
|
|
62
|
+
e.visible ? (A(), Y("div", {
|
|
63
|
+
key: 0,
|
|
64
|
+
ref_key: "menu",
|
|
65
|
+
ref: i,
|
|
66
|
+
class: "og-tabs-context-menu",
|
|
67
|
+
style: Sn({ left: `${e.x}px`, top: `${e.y}px` }),
|
|
68
|
+
role: "menu",
|
|
69
|
+
onContextmenu: h[0] || (h[0] = sn(() => {
|
|
70
|
+
}, ["prevent"])),
|
|
71
|
+
onKeydown: d
|
|
72
|
+
}, [
|
|
73
|
+
K(f.$slots, "top", {}, void 0, !0),
|
|
74
|
+
(A(!0), Y(wt, null, Ut(e.items, (c) => (A(), Y(wt, {
|
|
75
|
+
key: c.operation
|
|
76
|
+
}, [
|
|
77
|
+
c.dividerBefore ? (A(), Y("div", xo)) : ae("", !0),
|
|
78
|
+
ve("button", {
|
|
79
|
+
type: "button",
|
|
80
|
+
role: "menuitem",
|
|
81
|
+
disabled: c.disabled,
|
|
82
|
+
onClick: sn((v) => f.$emit("select", c.operation), ["stop"])
|
|
83
|
+
}, [
|
|
84
|
+
c.icon ? (A(), se(F(Ye), {
|
|
85
|
+
key: 0,
|
|
86
|
+
"aria-hidden": "true"
|
|
87
|
+
}, {
|
|
88
|
+
default: j(() => [
|
|
89
|
+
(A(), se(Ht(c.icon)))
|
|
90
|
+
]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, 1024)) : ae("", !0),
|
|
93
|
+
ve("span", null, Xe(c.label), 1)
|
|
94
|
+
], 8, Ao)
|
|
95
|
+
], 64))), 128)),
|
|
96
|
+
K(f.$slots, "bottom", {}, void 0, !0)
|
|
97
|
+
], 36)) : ae("", !0)
|
|
98
|
+
]));
|
|
99
|
+
}
|
|
100
|
+
}), Zt = (e, t) => {
|
|
101
|
+
const o = e.__vccOpts || e;
|
|
102
|
+
for (const [n, i] of t)
|
|
103
|
+
o[n] = i;
|
|
104
|
+
return o;
|
|
105
|
+
}, Po = /* @__PURE__ */ Zt(Oo, [["__scopeId", "data-v-49db788b"]]);
|
|
106
|
+
function X(e, t) {
|
|
107
|
+
return e.find((o) => o.key === t);
|
|
108
|
+
}
|
|
109
|
+
function me(e) {
|
|
110
|
+
return [...e.filter((t) => t.pinned), ...e.filter((t) => !t.pinned)];
|
|
111
|
+
}
|
|
112
|
+
function No(e, t) {
|
|
113
|
+
const o = t?.trim().toLocaleLowerCase();
|
|
114
|
+
return me(o ? e.filter((n) => n.label.toLocaleLowerCase().includes(o)) : e);
|
|
115
|
+
}
|
|
116
|
+
function We(e) {
|
|
117
|
+
return !!(e && !e.disabled && !e.readonly && !e.pinned && e.closable !== !1);
|
|
118
|
+
}
|
|
119
|
+
function xn(e) {
|
|
120
|
+
return !!(e && !e.disabled && !e.readonly && e.pinnable !== !1);
|
|
121
|
+
}
|
|
122
|
+
function st(e) {
|
|
123
|
+
return !!(e && !e.disabled && !e.readonly && !e.pinned && e.draggable !== !1);
|
|
124
|
+
}
|
|
125
|
+
function Mo(e, t, o) {
|
|
126
|
+
const n = X(e, t);
|
|
127
|
+
if (!n || n.pinned === o) return [...e];
|
|
128
|
+
const i = me(e.filter((a) => a.key !== t)), r = { ...n, pinned: o }, l = o ? i.filter((a) => a.pinned).length : i.findIndex((a) => !a.pinned);
|
|
129
|
+
return i.splice(l < 0 ? i.length : l, 0, r), i;
|
|
130
|
+
}
|
|
131
|
+
function fn(e, t) {
|
|
132
|
+
return e.filter((o) => !t.has(o.key));
|
|
133
|
+
}
|
|
134
|
+
function An(e, t, o) {
|
|
135
|
+
if (o === "all") return e.filter(We);
|
|
136
|
+
const n = e.findIndex((i) => i.key === t);
|
|
137
|
+
if (n < 0) return [];
|
|
138
|
+
if (o === "current") {
|
|
139
|
+
const i = e[n];
|
|
140
|
+
return i && We(i) ? [i] : [];
|
|
141
|
+
}
|
|
142
|
+
return o === "others" ? e.filter((i) => i.key !== t && We(i)) : (o === "left" ? e.slice(0, n) : e.slice(n + 1)).filter(We);
|
|
143
|
+
}
|
|
144
|
+
function nt(e, t, o) {
|
|
145
|
+
const n = e.findIndex((l) => l.key === o), i = (l) => l !== void 0 && t.some((a) => a.key === l && !a.disabled);
|
|
146
|
+
for (let l = n + 1; l < e.length; l += 1) {
|
|
147
|
+
const a = e[l];
|
|
148
|
+
if (a && i(a.key)) return a.key;
|
|
149
|
+
}
|
|
150
|
+
for (let l = n - 1; l >= 0; l -= 1) {
|
|
151
|
+
const a = e[l];
|
|
152
|
+
if (a && i(a.key)) return a.key;
|
|
153
|
+
}
|
|
154
|
+
const r = t.find((l) => !l.disabled);
|
|
155
|
+
if (r) return r.key;
|
|
156
|
+
}
|
|
157
|
+
function hn(e, t, o) {
|
|
158
|
+
const n = me(e), i = X(n, t), r = X(n, o);
|
|
159
|
+
if (!i || !r || i.key === r.key || !st(i) || !st(r))
|
|
160
|
+
return [...e];
|
|
161
|
+
const l = n.filter((a) => a.key !== t);
|
|
162
|
+
return l.splice(
|
|
163
|
+
l.findIndex((a) => a.key === o),
|
|
164
|
+
0,
|
|
165
|
+
i
|
|
166
|
+
), l;
|
|
167
|
+
}
|
|
168
|
+
function vn(e, t, o) {
|
|
169
|
+
const n = me(e), i = X(n, t);
|
|
170
|
+
if (!i || !st(i)) return [...e];
|
|
171
|
+
const r = n.filter((u) => u.key !== t), l = r.findIndex((u) => !u.pinned), a = o === "top" ? l : r.length;
|
|
172
|
+
return r.splice(a < 0 ? r.length : a, 0, i), r;
|
|
173
|
+
}
|
|
174
|
+
function mn(e) {
|
|
175
|
+
return e === "current" ? "close" : `close-${e}`;
|
|
176
|
+
}
|
|
177
|
+
function $o(e) {
|
|
178
|
+
const t = /* @__PURE__ */ new Set();
|
|
179
|
+
return e.some((o) => t.has(o.key) ? !0 : (t.add(o.key), !1));
|
|
180
|
+
}
|
|
181
|
+
const Ro = ["aria-label"], Fo = { class: "og-tabs-finder__content" }, Bo = ["aria-expanded", "aria-controls", "aria-activedescendant", "placeholder"], Wo = ["id", "aria-label"], Lo = ["id", "aria-selected", "disabled", "onClick"], Xo = { class: "og-tabs-finder__label" }, Yo = { class: "og-tabs-finder__title" }, Ho = ["aria-label"], qo = /* @__PURE__ */ Ct({
|
|
182
|
+
__name: "OgTabsFinder",
|
|
183
|
+
props: {
|
|
184
|
+
tabs: {},
|
|
185
|
+
activeKey: {},
|
|
186
|
+
locale: {}
|
|
187
|
+
},
|
|
188
|
+
emits: ["activate"],
|
|
189
|
+
setup(e, { emit: t }) {
|
|
190
|
+
const o = e, n = t, i = tt(!1), r = tt(""), l = tt(-1), a = un(), u = un(), d = yt("input"), f = O(() => No(o.tabs, r.value)), h = O(() => f.value.filter((T) => !T.disabled)), c = O(() => h.value[l.value]), v = O(() => f.value.length > 0);
|
|
191
|
+
function m(T) {
|
|
192
|
+
return `og-tabs-finder-option-${u}-${typeof T.key}-${String(T.key)}`;
|
|
193
|
+
}
|
|
194
|
+
function g(T) {
|
|
195
|
+
const _ = h.value.length;
|
|
196
|
+
_ && (l.value = (l.value + T + _) % _);
|
|
197
|
+
}
|
|
198
|
+
function S(T) {
|
|
199
|
+
switch (T.key) {
|
|
200
|
+
case "ArrowDown":
|
|
201
|
+
T.preventDefault(), g(1);
|
|
202
|
+
break;
|
|
203
|
+
case "ArrowUp":
|
|
204
|
+
T.preventDefault(), g(-1);
|
|
205
|
+
break;
|
|
206
|
+
case "Home":
|
|
207
|
+
T.preventDefault(), l.value = 0;
|
|
208
|
+
break;
|
|
209
|
+
case "End":
|
|
210
|
+
T.preventDefault(), l.value = h.value.length - 1;
|
|
211
|
+
break;
|
|
212
|
+
case "Enter":
|
|
213
|
+
c.value && (T.preventDefault(), k(c.value.key));
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function k(T) {
|
|
218
|
+
i.value = !1, n("activate", T);
|
|
219
|
+
}
|
|
220
|
+
function x() {
|
|
221
|
+
d.value?.focus();
|
|
222
|
+
}
|
|
223
|
+
return Me(
|
|
224
|
+
i,
|
|
225
|
+
(T) => {
|
|
226
|
+
T && (r.value = "", l.value = -1, qe(() => {
|
|
227
|
+
x(), window.setTimeout(x, 260);
|
|
228
|
+
}));
|
|
229
|
+
},
|
|
230
|
+
{ flush: "sync" }
|
|
231
|
+
), Me(
|
|
232
|
+
f,
|
|
233
|
+
() => {
|
|
234
|
+
l.value >= h.value.length && (l.value = h.value.length - 1);
|
|
235
|
+
},
|
|
236
|
+
{ flush: "sync" }
|
|
237
|
+
), (T, _) => (A(), se(F(So), {
|
|
238
|
+
visible: i.value,
|
|
239
|
+
"onUpdate:visible": _[1] || (_[1] = (P) => i.value = P),
|
|
240
|
+
trigger: "click",
|
|
241
|
+
placement: "bottom-end",
|
|
242
|
+
width: 320,
|
|
243
|
+
"popper-class": "og-tabs-finder",
|
|
244
|
+
onAfterEnter: x
|
|
245
|
+
}, {
|
|
246
|
+
reference: j(() => [
|
|
247
|
+
ve("button", {
|
|
248
|
+
type: "button",
|
|
249
|
+
class: "og-tabs__action",
|
|
250
|
+
"aria-label": e.locale.findTabs
|
|
251
|
+
}, [
|
|
252
|
+
De(F(Ye), { "aria-hidden": "true" }, {
|
|
253
|
+
default: j(() => [
|
|
254
|
+
De(F(po))
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
})
|
|
258
|
+
], 8, Ro)
|
|
259
|
+
]),
|
|
260
|
+
default: j(() => [
|
|
261
|
+
ve("div", Fo, [
|
|
262
|
+
ho(ve("input", {
|
|
263
|
+
ref_key: "input",
|
|
264
|
+
ref: d,
|
|
265
|
+
"onUpdate:modelValue": _[0] || (_[0] = (P) => r.value = P),
|
|
266
|
+
class: "og-tabs-finder__input",
|
|
267
|
+
role: "combobox",
|
|
268
|
+
"aria-autocomplete": "list",
|
|
269
|
+
"aria-haspopup": "listbox",
|
|
270
|
+
"aria-expanded": i.value,
|
|
271
|
+
"aria-controls": v.value ? F(a) : void 0,
|
|
272
|
+
"aria-activedescendant": c.value ? m(c.value) : void 0,
|
|
273
|
+
placeholder: e.locale.findTabsPlaceholder,
|
|
274
|
+
onKeydown: S
|
|
275
|
+
}, null, 40, Bo), [
|
|
276
|
+
[vo, r.value]
|
|
277
|
+
]),
|
|
278
|
+
v.value ? (A(), Y("div", {
|
|
279
|
+
key: 0,
|
|
280
|
+
id: F(a),
|
|
281
|
+
class: "og-tabs-finder__list",
|
|
282
|
+
role: "listbox",
|
|
283
|
+
"aria-label": e.locale.findTabs
|
|
284
|
+
}, [
|
|
285
|
+
(A(!0), Y(wt, null, Ut(f.value, (P) => (A(), Y("button", {
|
|
286
|
+
id: m(P),
|
|
287
|
+
key: `${typeof P.key}:${String(P.key)}`,
|
|
288
|
+
type: "button",
|
|
289
|
+
role: "option",
|
|
290
|
+
"aria-selected": P.key === e.activeKey,
|
|
291
|
+
class: Cn({ "is-active": P.key === c.value?.key }),
|
|
292
|
+
disabled: P.disabled,
|
|
293
|
+
onClick: (U) => k(P.key)
|
|
294
|
+
}, [
|
|
295
|
+
ve("span", Xo, [
|
|
296
|
+
ve("span", Yo, Xe(P.label), 1),
|
|
297
|
+
P.dirty ? (A(), Y("span", {
|
|
298
|
+
key: 0,
|
|
299
|
+
class: "og-tabs-finder__dirty",
|
|
300
|
+
"aria-label": e.locale.unsaved
|
|
301
|
+
}, null, 8, Ho)) : ae("", !0)
|
|
302
|
+
])
|
|
303
|
+
], 10, Lo))), 128))
|
|
304
|
+
], 8, Wo)) : (A(), se(F(Co), {
|
|
305
|
+
key: 1,
|
|
306
|
+
description: e.locale.noResults,
|
|
307
|
+
"image-size": 56
|
|
308
|
+
}, null, 8, ["description"]))
|
|
309
|
+
])
|
|
310
|
+
]),
|
|
311
|
+
_: 1
|
|
312
|
+
}, 8, ["visible"]));
|
|
313
|
+
}
|
|
314
|
+
}), zo = /* @__PURE__ */ Zt(qo, [["__scopeId", "data-v-884c1955"]]);
|
|
315
|
+
function V(e) {
|
|
316
|
+
return `${typeof e == "number" ? "n" : "s"}:${encodeURIComponent(String(e))}`;
|
|
317
|
+
}
|
|
318
|
+
const jo = ["data-tab-key", "data-tab-id", "title"], Go = { class: "og-tabs-label__text" }, Ko = ["aria-label"], Vo = { class: "og-tabs-sr-only" }, Uo = ["aria-label"], Zo = {
|
|
319
|
+
key: 3,
|
|
320
|
+
class: "og-tabs-label__badge"
|
|
321
|
+
}, Qo = /* @__PURE__ */ Ct({
|
|
322
|
+
__name: "OgTabsLabel",
|
|
323
|
+
props: {
|
|
324
|
+
tab: {},
|
|
325
|
+
active: { type: Boolean },
|
|
326
|
+
minWidth: {},
|
|
327
|
+
maxWidth: {},
|
|
328
|
+
locale: {}
|
|
329
|
+
},
|
|
330
|
+
setup(e) {
|
|
331
|
+
return (t, o) => (A(), Y("span", {
|
|
332
|
+
class: "og-tabs-label",
|
|
333
|
+
"data-tab-key": String(e.tab.key),
|
|
334
|
+
"data-tab-id": F(V)(e.tab.key),
|
|
335
|
+
style: Sn({ minWidth: e.minWidth, maxWidth: e.maxWidth }),
|
|
336
|
+
title: e.tab.remark ? `${e.tab.label}
|
|
337
|
+
${e.tab.remark}` : e.tab.label
|
|
338
|
+
}, [
|
|
339
|
+
K(t.$slots, "before", { tab: e.tab }, void 0, !0),
|
|
340
|
+
e.tab.icon ? (A(), se(F(Ye), {
|
|
341
|
+
key: 0,
|
|
342
|
+
class: "og-tabs-label__icon",
|
|
343
|
+
"aria-hidden": "true"
|
|
344
|
+
}, {
|
|
345
|
+
default: j(() => [
|
|
346
|
+
(A(), se(Ht(e.tab.icon)))
|
|
347
|
+
]),
|
|
348
|
+
_: 1
|
|
349
|
+
})) : ae("", !0),
|
|
350
|
+
e.tab.pinned ? (A(), se(F(Ye), {
|
|
351
|
+
key: 1,
|
|
352
|
+
class: "og-tabs-label__pin",
|
|
353
|
+
"aria-label": e.locale.pinned
|
|
354
|
+
}, {
|
|
355
|
+
default: j(() => [
|
|
356
|
+
De(F(In))
|
|
357
|
+
]),
|
|
358
|
+
_: 1
|
|
359
|
+
}, 8, ["aria-label"])) : ae("", !0),
|
|
360
|
+
ve("span", Go, [
|
|
361
|
+
K(t.$slots, "default", {
|
|
362
|
+
tab: e.tab,
|
|
363
|
+
active: e.active
|
|
364
|
+
}, () => [
|
|
365
|
+
kn(Xe(e.tab.label), 1)
|
|
366
|
+
], !0)
|
|
367
|
+
]),
|
|
368
|
+
e.tab.dirty ? (A(), Y("span", {
|
|
369
|
+
key: 2,
|
|
370
|
+
class: "og-tabs-label__dirty",
|
|
371
|
+
"aria-label": e.locale.unsaved
|
|
372
|
+
}, [
|
|
373
|
+
ve("span", Vo, Xe(e.locale.unsaved), 1)
|
|
374
|
+
], 8, Ko)) : ae("", !0),
|
|
375
|
+
K(t.$slots, "status", { tab: e.tab }, () => [
|
|
376
|
+
e.tab.statusIcon || e.tab.status === "success" || e.tab.status === "warning" || e.tab.status === "error" ? (A(), se(F(Ye), {
|
|
377
|
+
key: 0,
|
|
378
|
+
class: Cn(["og-tabs-label__status", [`is-${e.tab.status}`]]),
|
|
379
|
+
"aria-hidden": "true"
|
|
380
|
+
}, {
|
|
381
|
+
default: j(() => [
|
|
382
|
+
(A(), se(Ht(
|
|
383
|
+
e.tab.statusIcon || (e.tab.status === "success" ? F(go) : e.tab.status === "error" ? F(bo) : F(yo))
|
|
384
|
+
)))
|
|
385
|
+
]),
|
|
386
|
+
_: 1
|
|
387
|
+
}, 8, ["class"])) : e.tab.status === "loading" ? (A(), Y("span", {
|
|
388
|
+
key: 1,
|
|
389
|
+
class: "og-tabs-label__loading",
|
|
390
|
+
"aria-label": e.locale.loading
|
|
391
|
+
}, null, 8, Uo)) : ae("", !0)
|
|
392
|
+
], !0),
|
|
393
|
+
e.tab.badge !== void 0 ? (A(), Y("span", Zo, Xe(e.tab.badge), 1)) : ae("", !0),
|
|
394
|
+
K(t.$slots, "after", { tab: e.tab }, void 0, !0)
|
|
395
|
+
], 12, jo));
|
|
396
|
+
}
|
|
397
|
+
}), Jo = /* @__PURE__ */ Zt(Qo, [["__scopeId", "data-v-b81db2ee"]]);
|
|
398
|
+
function ei(e) {
|
|
399
|
+
const t = tt(!1);
|
|
400
|
+
function o(c, v, m, g = {}) {
|
|
401
|
+
const S = e.getItems(), k = e.getActiveKey();
|
|
402
|
+
return {
|
|
403
|
+
operation: c,
|
|
404
|
+
source: v,
|
|
405
|
+
tab: m,
|
|
406
|
+
activeKey: k,
|
|
407
|
+
activeTab: X(S, k),
|
|
408
|
+
items: S,
|
|
409
|
+
...g
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
async function n(c) {
|
|
413
|
+
const v = t.value ? "busy" : e.getDeniedReason(c.operation, c.tab);
|
|
414
|
+
if (v)
|
|
415
|
+
return e.onDenied(c.operation, c.tab, v), !1;
|
|
416
|
+
t.value = !0;
|
|
417
|
+
try {
|
|
418
|
+
return await e.getProps().beforeAction?.(c) === !1 ? !1 : (e.onRequest(c), !0);
|
|
419
|
+
} catch (m) {
|
|
420
|
+
return e.onError(c, m), !1;
|
|
421
|
+
} finally {
|
|
422
|
+
t.value = !1;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function i(c, v = "api") {
|
|
426
|
+
const m = X(e.getItems(), c);
|
|
427
|
+
return !m || m.disabled ? (e.onDenied("activate", m, m ? "disabled" : "not-found"), Promise.resolve(!1)) : c === e.getActiveKey() ? Promise.resolve(!0) : n(o("activate", v, m, { nextActiveKey: c }));
|
|
428
|
+
}
|
|
429
|
+
function r(c, v = "api") {
|
|
430
|
+
const m = e.getItems(), g = X(m, c);
|
|
431
|
+
if (!We(g))
|
|
432
|
+
return e.onDenied("close", g, g?.pinned ? "pinned" : g ? "readonly" : "not-found"), Promise.resolve(!1);
|
|
433
|
+
const S = fn(m, /* @__PURE__ */ new Set([c])), k = c === e.getActiveKey() ? nt(me(m), S, c) : e.getActiveKey();
|
|
434
|
+
return n(
|
|
435
|
+
o("close", v, g, { targets: [g], nextItems: S, nextActiveKey: k })
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
function l(c, v, m = "api") {
|
|
439
|
+
const g = e.getItems(), S = me(g), k = An(S, v, c);
|
|
440
|
+
if (!k.length)
|
|
441
|
+
return e.onDenied(mn(c), X(g, v), "boundary"), Promise.resolve(!1);
|
|
442
|
+
const x = new Set(k.map((U) => U.key)), T = e.getActiveKey(), _ = fn(g, x), P = T !== void 0 && x.has(T) ? nt(S, _, T) : T;
|
|
443
|
+
return n(
|
|
444
|
+
o(
|
|
445
|
+
mn(c),
|
|
446
|
+
m,
|
|
447
|
+
c === "current" ? k[0] : X(g, v),
|
|
448
|
+
{ targets: k, nextItems: _, nextActiveKey: P }
|
|
449
|
+
)
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
function a(c, v, m = "api") {
|
|
453
|
+
const g = X(e.getItems(), c);
|
|
454
|
+
return !g || !xn(g) || g.pinned === v ? (e.onDenied(
|
|
455
|
+
v ? "pin" : "unpin",
|
|
456
|
+
g,
|
|
457
|
+
g ? g.pinned === v ? "boundary" : "readonly" : "not-found"
|
|
458
|
+
), Promise.resolve(!1)) : n(
|
|
459
|
+
o(v ? "pin" : "unpin", m, g, {
|
|
460
|
+
nextItems: Mo(e.getItems(), c, v)
|
|
461
|
+
})
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
function u(c, v, m = "api") {
|
|
465
|
+
const g = e.getItems(), S = X(g, c), k = X(g, v), x = hn(g, c, v);
|
|
466
|
+
return !S || !k || x.every((T, _) => T.key === g[_]?.key) ? (e.onDenied("move", S, S ? "boundary" : "not-found"), Promise.resolve(!1)) : n(o("move", m, S, { nextItems: x, targetTab: k }));
|
|
467
|
+
}
|
|
468
|
+
function d(c, v, m = "api") {
|
|
469
|
+
const g = e.getItems(), S = v === void 0 ? vn(g, c, "bottom") : hn(g, c, v), k = X(g, c);
|
|
470
|
+
return !k || S.every((x, T) => x.key === g[T]?.key) ? (e.onDenied("move", k, k ? "boundary" : "not-found"), Promise.resolve(!1)) : n(
|
|
471
|
+
o("move", m, k, {
|
|
472
|
+
nextItems: S,
|
|
473
|
+
targetTab: v === void 0 ? void 0 : X(g, v)
|
|
474
|
+
})
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
function f(c, v, m = "api") {
|
|
478
|
+
const g = e.getItems(), S = X(g, c), k = vn(g, c, v);
|
|
479
|
+
return !S || k.every((x, T) => x.key === g[T]?.key) ? (e.onDenied(
|
|
480
|
+
v === "top" ? "move-top" : "move-bottom",
|
|
481
|
+
S,
|
|
482
|
+
S ? "boundary" : "not-found"
|
|
483
|
+
), Promise.resolve(!1)) : n(
|
|
484
|
+
o(v === "top" ? "move-top" : "move-bottom", m, S, { nextItems: k })
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
function h(c, v = "api") {
|
|
488
|
+
const m = X(e.getItems(), c);
|
|
489
|
+
return m ? n(o("refresh", v, m)) : (e.onDenied("refresh", m, "not-found"), Promise.resolve(!1));
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
pending: t,
|
|
493
|
+
dispatch: n,
|
|
494
|
+
activate: i,
|
|
495
|
+
close: r,
|
|
496
|
+
closeScope: (c, v = "api") => l(c, e.getActiveKey(), v),
|
|
497
|
+
closeScopeAt: l,
|
|
498
|
+
refreshAt: h,
|
|
499
|
+
pin: (c, v = "api") => a(c, !0, v),
|
|
500
|
+
unpin: (c, v = "api") => a(c, !1, v),
|
|
501
|
+
move: u,
|
|
502
|
+
moveBefore: d,
|
|
503
|
+
moveTop: (c, v = "api") => f(c, "top", v),
|
|
504
|
+
moveBottom: (c, v = "api") => f(c, "bottom", v),
|
|
505
|
+
refresh: (c = "api") => {
|
|
506
|
+
const v = e.getActiveKey();
|
|
507
|
+
return v === void 0 ? Promise.resolve(!1) : h(v, c);
|
|
508
|
+
},
|
|
509
|
+
scrollTo: e.onScrollTo,
|
|
510
|
+
getItems: e.getItems
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function ti(e, t, o) {
|
|
514
|
+
return (t = ri(t)) in e ? Object.defineProperty(e, t, {
|
|
515
|
+
value: o,
|
|
516
|
+
enumerable: !0,
|
|
517
|
+
configurable: !0,
|
|
518
|
+
writable: !0
|
|
519
|
+
}) : e[t] = o, e;
|
|
520
|
+
}
|
|
521
|
+
function we() {
|
|
522
|
+
return we = Object.assign ? Object.assign.bind() : function(e) {
|
|
523
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
524
|
+
var o = arguments[t];
|
|
525
|
+
for (var n in o) ({}).hasOwnProperty.call(o, n) && (e[n] = o[n]);
|
|
526
|
+
}
|
|
527
|
+
return e;
|
|
528
|
+
}, we.apply(null, arguments);
|
|
529
|
+
}
|
|
530
|
+
function pn(e, t) {
|
|
531
|
+
var o = Object.keys(e);
|
|
532
|
+
if (Object.getOwnPropertySymbols) {
|
|
533
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
534
|
+
t && (n = n.filter(function(i) {
|
|
535
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
536
|
+
})), o.push.apply(o, n);
|
|
537
|
+
}
|
|
538
|
+
return o;
|
|
539
|
+
}
|
|
540
|
+
function ge(e) {
|
|
541
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
542
|
+
var o = arguments[t] != null ? arguments[t] : {};
|
|
543
|
+
t % 2 ? pn(Object(o), !0).forEach(function(n) {
|
|
544
|
+
ti(e, n, o[n]);
|
|
545
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : pn(Object(o)).forEach(function(n) {
|
|
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
|
|
599
|
+
};
|
|
600
|
+
function I(e, t, o) {
|
|
601
|
+
e.addEventListener(t, o, !Ee && Pn);
|
|
602
|
+
}
|
|
603
|
+
function C(e, t, o) {
|
|
604
|
+
e.removeEventListener(t, o, !Ee && Pn);
|
|
605
|
+
}
|
|
606
|
+
function Et(e, t) {
|
|
607
|
+
if (t) {
|
|
608
|
+
if (t[0] === ">" && (t = t.substring(1)), e)
|
|
609
|
+
try {
|
|
610
|
+
if (e.matches)
|
|
611
|
+
return e.matches(t);
|
|
612
|
+
if (e.msMatchesSelector)
|
|
613
|
+
return e.msMatchesSelector(t);
|
|
614
|
+
if (e.webkitMatchesSelector)
|
|
615
|
+
return e.webkitMatchesSelector(t);
|
|
616
|
+
} catch {
|
|
617
|
+
return !1;
|
|
618
|
+
}
|
|
619
|
+
return !1;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function Nn(e) {
|
|
623
|
+
return e.host && e !== document && e.host.nodeType && e.host !== e ? e.host : e.parentNode;
|
|
624
|
+
}
|
|
625
|
+
function de(e, t, o, n) {
|
|
626
|
+
if (e) {
|
|
627
|
+
o = o || document;
|
|
628
|
+
do {
|
|
629
|
+
if (t != null && (t[0] === ">" ? e.parentNode === o && Et(e, t) : Et(e, t)) || n && e === o)
|
|
630
|
+
return e;
|
|
631
|
+
if (e === o) break;
|
|
632
|
+
} while (e = Nn(e));
|
|
633
|
+
}
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
var bn = /\s+/g;
|
|
637
|
+
function ie(e, t, o) {
|
|
638
|
+
if (e && t)
|
|
639
|
+
if (e.classList)
|
|
640
|
+
e.classList[o ? "add" : "remove"](t);
|
|
641
|
+
else {
|
|
642
|
+
var n = (" " + e.className + " ").replace(bn, " ").replace(" " + t + " ", " ");
|
|
643
|
+
e.className = (n + (o ? " " + t : "")).replace(bn, " ");
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
function y(e, t, o) {
|
|
647
|
+
var n = e && e.style;
|
|
648
|
+
if (n) {
|
|
649
|
+
if (o === void 0)
|
|
650
|
+
return document.defaultView && document.defaultView.getComputedStyle ? o = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (o = e.currentStyle), t === void 0 ? o : o[t];
|
|
651
|
+
!(t in n) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), n[t] = o + (typeof o == "string" ? "" : "px");
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
function He(e, t) {
|
|
655
|
+
var o = "";
|
|
656
|
+
if (typeof e == "string")
|
|
657
|
+
o = e;
|
|
658
|
+
else
|
|
659
|
+
do {
|
|
660
|
+
var n = y(e, "transform");
|
|
661
|
+
n && n !== "none" && (o = n + " " + o);
|
|
662
|
+
} while (!t && (e = e.parentNode));
|
|
663
|
+
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
664
|
+
return i && new i(o);
|
|
665
|
+
}
|
|
666
|
+
function Mn(e, t, o) {
|
|
667
|
+
if (e) {
|
|
668
|
+
var n = e.getElementsByTagName(t), i = 0, r = n.length;
|
|
669
|
+
if (o)
|
|
670
|
+
for (; i < r; i++)
|
|
671
|
+
o(n[i], i);
|
|
672
|
+
return n;
|
|
673
|
+
}
|
|
674
|
+
return [];
|
|
675
|
+
}
|
|
676
|
+
function pe() {
|
|
677
|
+
var e = document.scrollingElement;
|
|
678
|
+
return e || document.documentElement;
|
|
679
|
+
}
|
|
680
|
+
function L(e, t, o, n, i) {
|
|
681
|
+
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
682
|
+
var r, l, a, u, d, f, h;
|
|
683
|
+
if (e !== window && e.parentNode && e !== pe() ? (r = e.getBoundingClientRect(), l = r.top, a = r.left, u = r.bottom, d = r.right, f = r.height, h = r.width) : (l = 0, a = 0, u = window.innerHeight, d = window.innerWidth, f = window.innerHeight, h = window.innerWidth), (t || o) && e !== window && (i = i || e.parentNode, !Ee))
|
|
684
|
+
do
|
|
685
|
+
if (i && i.getBoundingClientRect && (y(i, "transform") !== "none" || o && y(i, "position") !== "static")) {
|
|
686
|
+
var c = i.getBoundingClientRect();
|
|
687
|
+
l -= c.top + parseInt(y(i, "border-top-width")), a -= c.left + parseInt(y(i, "border-left-width")), u = l + r.height, d = a + r.width;
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
while (i = i.parentNode);
|
|
691
|
+
if (n && e !== window) {
|
|
692
|
+
var v = He(i || e), m = v && v.a, g = v && v.d;
|
|
693
|
+
v && (l /= g, a /= m, h /= m, f /= g, u = l + f, d = a + h);
|
|
694
|
+
}
|
|
695
|
+
return {
|
|
696
|
+
top: l,
|
|
697
|
+
left: a,
|
|
698
|
+
bottom: u,
|
|
699
|
+
right: d,
|
|
700
|
+
width: h,
|
|
701
|
+
height: f
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
function yn(e, t, o) {
|
|
706
|
+
for (var n = Ce(e, !0), i = L(e)[t]; n; ) {
|
|
707
|
+
var r = L(n)[o], l = void 0;
|
|
708
|
+
if (l = i >= r, !l) return n;
|
|
709
|
+
if (n === pe()) break;
|
|
710
|
+
n = Ce(n, !1);
|
|
711
|
+
}
|
|
712
|
+
return !1;
|
|
713
|
+
}
|
|
714
|
+
function ze(e, t, o, n) {
|
|
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);
|
|
1609
|
+
}
|
|
1610
|
+
function jt(e) {
|
|
1611
|
+
return clearTimeout(e);
|
|
1612
|
+
}
|
|
1613
|
+
kt && I(document, "touchmove", function(e) {
|
|
1614
|
+
(w.active || Be) && e.cancelable && e.preventDefault();
|
|
1615
|
+
});
|
|
1616
|
+
w.utils = {
|
|
1617
|
+
on: I,
|
|
1618
|
+
off: C,
|
|
1619
|
+
css: y,
|
|
1620
|
+
find: Mn,
|
|
1621
|
+
is: function(t, o) {
|
|
1622
|
+
return !!de(t, o, t, !1);
|
|
1623
|
+
},
|
|
1624
|
+
extend: si,
|
|
1625
|
+
throttle: $n,
|
|
1626
|
+
closest: de,
|
|
1627
|
+
toggleClass: ie,
|
|
1628
|
+
clone: Fn,
|
|
1629
|
+
index: le,
|
|
1630
|
+
nextTick: gt,
|
|
1631
|
+
cancelNextTick: jt,
|
|
1632
|
+
detectDirection: Ln,
|
|
1633
|
+
getChild: ze,
|
|
1634
|
+
expando: ne
|
|
1635
|
+
};
|
|
1636
|
+
w.get = function(e) {
|
|
1637
|
+
return e[ne];
|
|
1638
|
+
};
|
|
1639
|
+
w.mount = function() {
|
|
1640
|
+
for (var e = arguments.length, t = new Array(e), o = 0; o < e; o++)
|
|
1641
|
+
t[o] = arguments[o];
|
|
1642
|
+
t[0].constructor === Array && (t = t[0]), t.forEach(function(n) {
|
|
1643
|
+
if (!n.prototype || !n.prototype.constructor)
|
|
1644
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
|
|
1645
|
+
n.utils && (w.utils = ge(ge({}, w.utils), n.utils)), ct.mount(n);
|
|
1646
|
+
});
|
|
1647
|
+
};
|
|
1648
|
+
w.create = function(e, t) {
|
|
1649
|
+
return new w(e, t);
|
|
1650
|
+
};
|
|
1651
|
+
w.version = ai;
|
|
1652
|
+
var W = [], Je, Gt, Kt = !1, Lt, Xt, St, et;
|
|
1653
|
+
function ki() {
|
|
1654
|
+
function e() {
|
|
1655
|
+
this.defaults = {
|
|
1656
|
+
scroll: !0,
|
|
1657
|
+
forceAutoScrollFallback: !1,
|
|
1658
|
+
scrollSensitivity: 30,
|
|
1659
|
+
scrollSpeed: 10,
|
|
1660
|
+
bubbleScroll: !0
|
|
1661
|
+
};
|
|
1662
|
+
for (var t in this)
|
|
1663
|
+
t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
|
|
1664
|
+
}
|
|
1665
|
+
return e.prototype = {
|
|
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
|
+
}
|
|
1746
|
+
};
|
|
1747
|
+
function en() {
|
|
1748
|
+
}
|
|
1749
|
+
en.prototype = {
|
|
1750
|
+
startIndex: null,
|
|
1751
|
+
dragStart: function(t) {
|
|
1752
|
+
var o = t.oldDraggableIndex;
|
|
1753
|
+
this.startIndex = o;
|
|
1754
|
+
},
|
|
1755
|
+
onSpill: function(t) {
|
|
1756
|
+
var o = t.dragEl, n = t.putSortable;
|
|
1757
|
+
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
1758
|
+
var i = ze(this.sortable.el, this.startIndex, this.options);
|
|
1759
|
+
i ? this.sortable.el.insertBefore(o, i) : this.sortable.el.appendChild(o), this.sortable.animateAll(), n && n.animateAll();
|
|
1760
|
+
},
|
|
1761
|
+
drop: qn
|
|
1762
|
+
};
|
|
1763
|
+
we(en, {
|
|
1764
|
+
pluginName: "revertOnSpill"
|
|
1765
|
+
});
|
|
1766
|
+
function tn() {
|
|
1767
|
+
}
|
|
1768
|
+
tn.prototype = {
|
|
1769
|
+
onSpill: function(t) {
|
|
1770
|
+
var o = t.dragEl, n = t.putSortable, i = n || this.sortable;
|
|
1771
|
+
i.captureAnimationState(), o.parentNode && o.parentNode.removeChild(o), i.animateAll();
|
|
1772
|
+
},
|
|
1773
|
+
drop: qn
|
|
1774
|
+
};
|
|
1775
|
+
we(tn, {
|
|
1776
|
+
pluginName: "removeOnSpill"
|
|
1777
|
+
});
|
|
1778
|
+
w.mount(new ki());
|
|
1779
|
+
w.mount(tn, en);
|
|
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
|
+
};
|