@origen-ui/tabs 2.0.2 → 3.0.4
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/README.md +63 -24
- package/dist/config-CXJb0BE-.cjs +1 -0
- package/dist/config-MtK7PAXS.js +24 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +146 -88
- package/dist/index.mjs +1792 -1118
- package/dist/locale.mjs +1 -2
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +69 -34
- package/dist/runtime.mjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +16 -13
- package/dist/config-C6gh_5SI.cjs +0 -1
- package/dist/config-CxS92Qea.js +0 -13
package/dist/index.mjs
CHANGED
|
@@ -1,155 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Fragment as a, Teleport as o,
|
|
4
|
-
import {
|
|
5
|
-
import { mergeLocale as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
{
|
|
11
|
-
operation: "refresh",
|
|
12
|
-
label: e.labels.refresh
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
operation: e.pinned ? "unpin" : "pin",
|
|
16
|
-
label: e.labels.pin
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
operation: "move-top",
|
|
20
|
-
label: e.labels.moveTop
|
|
21
|
-
}
|
|
22
|
-
].filter((t) => !(e.hidden.has(t.operation) || t.operation === "refresh" && e.features.refresh === !1 || (t.operation === "pin" || t.operation === "unpin") && e.features.pin !== !0 || t.operation === "move-top" && e.features.drag !== !0));
|
|
1
|
+
import { OG_TABS_LOCALE_EN_US as e, OG_TABS_LOCALE_ZH_CN as t, OG_TABS_LOCALE_ZH_TW as n } from "./locale.mjs";
|
|
2
|
+
import { n as r, t as i } from "./config-MtK7PAXS.js";
|
|
3
|
+
import { Fragment as a, Teleport as o, cloneVNode as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, mergeProps as v, nextTick as y, normalizeClass as b, normalizeProps as x, normalizeStyle as S, onBeforeUnmount as C, onMounted as w, openBlock as T, ref as E, renderList as ee, renderSlot as D, resolveDynamicComponent as O, shallowRef as k, toDisplayString as A, unref as j, useAttrs as te, useId as ne, useSlots as re, useTemplateRef as ie, vModelText as ae, watch as oe, withCtx as M, withDirectives as se, withModifiers as ce } from "vue";
|
|
4
|
+
import { ElEmpty as le, ElIcon as ue, ElPopover as de, ElTabPane as fe, ElTabs as pe } from "element-plus";
|
|
5
|
+
import { filterComponentProps as me, mergeLocale as he } from "@origen-ui/shared";
|
|
6
|
+
import { Bottom as ge, CircleCheckFilled as _e, CircleCloseFilled as ve, Close as ye, CollectionTag as be, MoreFilled as xe, Refresh as Se, Search as Ce, Top as we, WarningFilled as Te } from "@element-plus/icons-vue";
|
|
7
|
+
// src/tabKey.ts
|
|
8
|
+
function N(e) {
|
|
9
|
+
return `${typeof e == "number" ? "n" : "s"}:${encodeURIComponent(String(e))}`;
|
|
23
10
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return [...i.value?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []];
|
|
50
|
-
}
|
|
51
|
-
function p() {
|
|
52
|
-
let e = i.value;
|
|
53
|
-
if (!e) return;
|
|
54
|
-
let t = e.getBoundingClientRect();
|
|
55
|
-
r("reposition", Math.max(4, Math.min(n.x, window.innerWidth - t.width - 4)), Math.max(4, Math.min(n.y, window.innerHeight - t.height - 4))), f()[0]?.focus();
|
|
56
|
-
}
|
|
57
|
-
function m(e) {
|
|
58
|
-
i.value?.contains(e.target) || s();
|
|
59
|
-
}
|
|
60
|
-
function h(e) {
|
|
61
|
-
let t = f(), n = t.indexOf(document.activeElement);
|
|
62
|
-
if (e.key === "Escape") {
|
|
63
|
-
e.preventDefault(), s();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
!t.length || ![
|
|
67
|
-
"ArrowDown",
|
|
68
|
-
"ArrowUp",
|
|
69
|
-
"Home",
|
|
70
|
-
"End"
|
|
71
|
-
].includes(e.key) || (e.preventDefault(), t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus());
|
|
72
|
-
}
|
|
73
|
-
return ce(() => n.visible, (e) => {
|
|
74
|
-
e && _(p);
|
|
75
|
-
}), te(() => window.addEventListener("pointerdown", m)), b(() => window.removeEventListener("pointerdown", m)), (t, n) => (x(), c(o, { to: "body" }, [e.visible ? (x(), u("div", {
|
|
76
|
-
key: 0,
|
|
77
|
-
ref_key: "menu",
|
|
78
|
-
ref: i,
|
|
79
|
-
class: "og-tabs-context-menu",
|
|
80
|
-
style: y({
|
|
81
|
-
left: `${e.x}px`,
|
|
82
|
-
top: `${e.y}px`
|
|
83
|
-
}),
|
|
84
|
-
role: "menu",
|
|
85
|
-
onContextmenu: n[0] ||= ue(() => {}, ["prevent"]),
|
|
86
|
-
onKeydown: h
|
|
87
|
-
}, [
|
|
88
|
-
w(t.$slots, "top", {}, void 0, !0),
|
|
89
|
-
(x(!0), u(a, null, C(e.items, (e) => (x(), u(a, { key: e.operation }, [e.dividerBefore ? (x(), u("div", De)) : l("", !0), d("button", {
|
|
90
|
-
type: "button",
|
|
91
|
-
role: "menuitem",
|
|
92
|
-
disabled: e.disabled,
|
|
93
|
-
onClick: ue((n) => t.$emit("select", e.operation), ["stop"])
|
|
94
|
-
}, [e.icon ? (x(), c(E(Ce), {
|
|
95
|
-
key: 0,
|
|
96
|
-
"aria-hidden": "true"
|
|
97
|
-
}, {
|
|
98
|
-
default: D(() => [(x(), c(ne(e.icon)))]),
|
|
99
|
-
_: 2
|
|
100
|
-
}, 1024)) : l("", !0), d("span", null, re(e.label), 1)], 8, Oe)], 64))), 128)),
|
|
101
|
-
w(t.$slots, "bottom", {}, void 0, !0)
|
|
102
|
-
], 36)) : l("", !0)]));
|
|
11
|
+
// src/tabStateRevision.ts
|
|
12
|
+
function Ee(e, t) {
|
|
13
|
+
return JSON.stringify([t, e.map((e) => [
|
|
14
|
+
e.key,
|
|
15
|
+
e.label,
|
|
16
|
+
e.badge,
|
|
17
|
+
e.status,
|
|
18
|
+
e.remark,
|
|
19
|
+
e.dirty === !0,
|
|
20
|
+
e.disabled === !0,
|
|
21
|
+
e.readonly === !0,
|
|
22
|
+
e.closable !== !1,
|
|
23
|
+
e.pinned === !0,
|
|
24
|
+
e.pinnable !== !1,
|
|
25
|
+
e.draggable !== !1,
|
|
26
|
+
e.lazy === !0
|
|
27
|
+
])]);
|
|
28
|
+
}
|
|
29
|
+
// src/composables/useOgTabsActionBridge.ts
|
|
30
|
+
function De(e) {
|
|
31
|
+
async function t(t) {
|
|
32
|
+
let n = r();
|
|
33
|
+
e.emit.actionRequest(t);
|
|
34
|
+
let o = await i(t);
|
|
35
|
+
return o === void 0 ? (n === r() && (a(t), await y(), t.revision = r()), "committed") : o;
|
|
103
36
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
37
|
+
let n = {
|
|
38
|
+
close: "closeRequest",
|
|
39
|
+
"close-others": "closeRequest",
|
|
40
|
+
"close-left": "closeRequest",
|
|
41
|
+
"close-right": "closeRequest",
|
|
42
|
+
"close-all": "closeRequest",
|
|
43
|
+
refresh: "refreshRequest",
|
|
44
|
+
pin: "pinChangeRequest",
|
|
45
|
+
unpin: "pinChangeRequest",
|
|
46
|
+
move: "reorderRequest",
|
|
47
|
+
"move-top": "reorderRequest",
|
|
48
|
+
"move-bottom": "reorderRequest"
|
|
49
|
+
};
|
|
50
|
+
function r() {
|
|
51
|
+
return Ee(e.tabs.value, e.activeKey.value);
|
|
52
|
+
}
|
|
53
|
+
async function i(t) {
|
|
54
|
+
let n = e.props.ogActionHandler;
|
|
55
|
+
if (!n) return;
|
|
56
|
+
let i = await n(t);
|
|
57
|
+
if (i === "stale") return "stale";
|
|
58
|
+
if (i === "committed" || i === "applied") return await y(), t.revision = r(), "committed";
|
|
59
|
+
}
|
|
60
|
+
function a(t) {
|
|
61
|
+
Object.hasOwn(t, "nextActiveKey") && e.emit.updateModelValue(t.nextActiveKey), t.nextItems && e.emit.updateItems(t.nextItems);
|
|
62
|
+
let r = n[t.operation];
|
|
63
|
+
r !== void 0 && e.emit[r](t);
|
|
64
|
+
}
|
|
65
|
+
function o(t) {
|
|
66
|
+
y(() => e.root.value?.querySelector(`[data-tab-id="${N(t)}"]`)?.closest("[role=\"tab\"]")?.scrollIntoView?.({
|
|
67
|
+
block: "nearest",
|
|
68
|
+
inline: "nearest"
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
emitRequest: t,
|
|
73
|
+
scrollTo: o
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// src/tabState.ts
|
|
77
|
+
function P(e, t) {
|
|
112
78
|
return e.find((e) => e.key === t);
|
|
113
79
|
}
|
|
114
|
-
function
|
|
80
|
+
function Oe(e) {
|
|
115
81
|
return [...e.filter((e) => e.pinned), ...e.filter((e) => !e.pinned)];
|
|
116
82
|
}
|
|
117
|
-
function
|
|
83
|
+
function ke(e, t) {
|
|
118
84
|
let n = t?.trim().toLocaleLowerCase();
|
|
119
|
-
return
|
|
85
|
+
return Oe(n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n)) : e);
|
|
120
86
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
87
|
+
function Ae(e) {
|
|
88
|
+
return !(!e || e.disabled || e.readonly || e.pinned || e.closable === !1);
|
|
123
89
|
}
|
|
124
|
-
function
|
|
125
|
-
return
|
|
90
|
+
function je(e) {
|
|
91
|
+
return !(!e || e.disabled || e.readonly || e.pinnable === !1);
|
|
126
92
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
93
|
+
function Me(e) {
|
|
94
|
+
return !(!e || e.disabled || e.readonly || e.pinned || e.draggable === !1);
|
|
129
95
|
}
|
|
130
|
-
function
|
|
131
|
-
let r =
|
|
96
|
+
function Ne(e, t, n) {
|
|
97
|
+
let r = P(e, t);
|
|
132
98
|
if (!r || r.pinned === n) return [...e];
|
|
133
|
-
let i =
|
|
99
|
+
let i = Oe(e.filter((e) => e.key !== t)), a = {
|
|
134
100
|
...r,
|
|
135
101
|
pinned: n
|
|
136
102
|
}, o = n ? i.filter((e) => e.pinned).length : i.findIndex((e) => !e.pinned);
|
|
137
103
|
return i.splice(o < 0 ? i.length : o, 0, a), i;
|
|
138
104
|
}
|
|
139
|
-
function
|
|
105
|
+
function Pe(e, t) {
|
|
140
106
|
return e.filter((e) => !t.has(e.key));
|
|
141
107
|
}
|
|
142
|
-
function
|
|
143
|
-
if (n === "all") return e.filter(
|
|
108
|
+
function Fe(e, t, n) {
|
|
109
|
+
if (n === "all") return e.filter(Ae);
|
|
144
110
|
let r = e.findIndex((e) => e.key === t);
|
|
145
111
|
if (r < 0) return [];
|
|
146
112
|
if (n === "current") {
|
|
147
113
|
let t = e[r];
|
|
148
|
-
return t &&
|
|
114
|
+
return t && Ae(t) ? [t] : [];
|
|
149
115
|
}
|
|
150
|
-
return n === "others" ? e.filter((e) => e.key !== t &&
|
|
116
|
+
return n === "others" ? e.filter((e) => e.key !== t && Ae(e)) : (n === "left" ? e.slice(0, r) : e.slice(r + 1)).filter(Ae);
|
|
151
117
|
}
|
|
152
|
-
function
|
|
118
|
+
function Ie(e, t, n) {
|
|
153
119
|
let r = e.findIndex((e) => e.key === n), i = (e) => e !== void 0 && t.some((t) => t.key === e && !t.disabled);
|
|
154
120
|
for (let t = r + 1; t < e.length; t += 1) {
|
|
155
121
|
let n = e[t];
|
|
@@ -162,334 +128,460 @@ function Be(e, t, n) {
|
|
|
162
128
|
let a = t.find((e) => !e.disabled);
|
|
163
129
|
if (a) return a.key;
|
|
164
130
|
}
|
|
165
|
-
function
|
|
166
|
-
let r =
|
|
167
|
-
if (!i || !a || i.key === a.key || !
|
|
131
|
+
function Le(e, t, n) {
|
|
132
|
+
let r = Oe(e), i = P(r, t), a = P(r, n);
|
|
133
|
+
if (!i || !a || i.key === a.key || !Me(i) || !Me(a)) return [...e];
|
|
168
134
|
let o = r.filter((e) => e.key !== t);
|
|
169
135
|
return o.splice(o.findIndex((e) => e.key === n), 0, i), o;
|
|
170
136
|
}
|
|
171
|
-
function
|
|
172
|
-
let r =
|
|
173
|
-
if (!i || !
|
|
137
|
+
function Re(e, t, n) {
|
|
138
|
+
let r = Oe(e), i = P(r, t);
|
|
139
|
+
if (!i || !Me(i)) return [...e];
|
|
174
140
|
let a = r.filter((e) => e.key !== t), o = a.findIndex((e) => !e.pinned), s = n === "top" ? o : a.length;
|
|
175
141
|
return a.splice(s < 0 ? a.length : s, 0, i), a;
|
|
176
142
|
}
|
|
177
|
-
function
|
|
143
|
+
function ze(e) {
|
|
178
144
|
return e === "current" ? "close" : `close-${e}`;
|
|
179
145
|
}
|
|
180
|
-
function
|
|
146
|
+
function Be(e) {
|
|
181
147
|
let t = /* @__PURE__ */ new Set();
|
|
182
148
|
return e.some((e) => t.has(e.key) ? !0 : (t.add(e.key), !1));
|
|
183
149
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
tabs: {},
|
|
200
|
-
activeKey: {},
|
|
201
|
-
locale: {}
|
|
202
|
-
},
|
|
203
|
-
emits: ["activate"],
|
|
204
|
-
setup(e, { emit: t }) {
|
|
205
|
-
let n = e, r = t, i = T(!1), o = T(""), f = T(-1), m = ie(), h = ie(), g = oe("input"), v = s(() => Ne(n.tabs, o.value)), y = s(() => v.value.filter((e) => !e.disabled)), b = s(() => y.value[f.value]), te = s(() => v.value.length > 0);
|
|
206
|
-
function S(e) {
|
|
207
|
-
return `og-tabs-finder-option-${h}-${typeof e.key}-${String(e.key)}`;
|
|
208
|
-
}
|
|
209
|
-
function w(e) {
|
|
210
|
-
let t = y.value.length;
|
|
211
|
-
t && (f.value = (f.value + e + t) % t);
|
|
212
|
-
}
|
|
213
|
-
function ne(e) {
|
|
214
|
-
switch (e.key) {
|
|
215
|
-
case "ArrowDown":
|
|
216
|
-
e.preventDefault(), w(1);
|
|
217
|
-
break;
|
|
218
|
-
case "ArrowUp":
|
|
219
|
-
e.preventDefault(), w(-1);
|
|
220
|
-
break;
|
|
221
|
-
case "Home":
|
|
222
|
-
e.preventDefault(), f.value = 0;
|
|
223
|
-
break;
|
|
224
|
-
case "End":
|
|
225
|
-
e.preventDefault(), f.value = y.value.length - 1;
|
|
226
|
-
break;
|
|
227
|
-
case "Enter": b.value && (e.preventDefault(), ae(b.value.key));
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
function ae(e) {
|
|
231
|
-
i.value = !1, r("activate", e);
|
|
232
|
-
}
|
|
233
|
-
function ue() {
|
|
234
|
-
g.value?.focus();
|
|
150
|
+
// src/tabActionExecutor.ts
|
|
151
|
+
function Ve(e) {
|
|
152
|
+
let t = !1;
|
|
153
|
+
async function n(n) {
|
|
154
|
+
let r;
|
|
155
|
+
if (r = t ? "busy" : e.getDeniedReason(n.operation, n.tab), r) return e.onDenied(n.operation, n.tab, r), !1;
|
|
156
|
+
t = !0, e.onPendingChange?.(!0);
|
|
157
|
+
try {
|
|
158
|
+
if (await e.beforeAction?.(n) === !1 || e.getRevision && n.revision !== void 0 && e.getRevision() !== n.revision) return !1;
|
|
159
|
+
let t = await e.onRequest(n);
|
|
160
|
+
return t === "stale" || e.getRevision && n.revision !== void 0 && e.getRevision() !== n.revision ? (e.onDenied(n.operation, n.tab, "stale"), !1) : t === "committed" || t === void 0 || t === "applied";
|
|
161
|
+
} catch (t) {
|
|
162
|
+
return e.onError(n, t), !1;
|
|
163
|
+
} finally {
|
|
164
|
+
t = !1, e.onPendingChange?.(!1);
|
|
235
165
|
}
|
|
236
|
-
return ce([i, y], ([e, t], [n]) => {
|
|
237
|
-
e && !n && (o.value = "", f.value = -1, _(ue)), f.value >= t.length && (f.value = t.length - 1);
|
|
238
|
-
}, { flush: "sync" }), (t, n) => (x(), c(E(O), {
|
|
239
|
-
visible: i.value,
|
|
240
|
-
"onUpdate:visible": n[1] ||= (e) => i.value = e,
|
|
241
|
-
trigger: "click",
|
|
242
|
-
placement: "bottom-end",
|
|
243
|
-
width: 320,
|
|
244
|
-
"popper-class": "og-tabs-finder",
|
|
245
|
-
onAfterEnter: ue
|
|
246
|
-
}, {
|
|
247
|
-
reference: D(() => [d("button", {
|
|
248
|
-
type: "button",
|
|
249
|
-
class: "og-tabs__action",
|
|
250
|
-
"aria-label": e.locale.findTabs
|
|
251
|
-
}, [p(E(Ce), { "aria-hidden": "true" }, {
|
|
252
|
-
default: D(() => [p(E(ve))]),
|
|
253
|
-
_: 1
|
|
254
|
-
})], 8, Ue)]),
|
|
255
|
-
default: D(() => [d("div", We, [le(d("input", {
|
|
256
|
-
ref_key: "input",
|
|
257
|
-
ref: g,
|
|
258
|
-
"onUpdate:modelValue": n[0] ||= (e) => o.value = e,
|
|
259
|
-
class: "og-tabs-finder__input",
|
|
260
|
-
role: "combobox",
|
|
261
|
-
"aria-autocomplete": "list",
|
|
262
|
-
"aria-haspopup": "listbox",
|
|
263
|
-
"aria-expanded": i.value,
|
|
264
|
-
"aria-controls": te.value ? E(m) : void 0,
|
|
265
|
-
"aria-activedescendant": b.value ? S(b.value) : void 0,
|
|
266
|
-
placeholder: e.locale.findTabsPlaceholder,
|
|
267
|
-
onKeydown: ne
|
|
268
|
-
}, null, 40, Ge), [[se, o.value]]), te.value ? (x(), u("div", {
|
|
269
|
-
key: 0,
|
|
270
|
-
id: E(m),
|
|
271
|
-
class: "og-tabs-finder__list",
|
|
272
|
-
role: "listbox",
|
|
273
|
-
"aria-label": e.locale.findTabs
|
|
274
|
-
}, [(x(!0), u(a, null, C(v.value, (t) => (x(), u("button", {
|
|
275
|
-
id: S(t),
|
|
276
|
-
key: `${typeof t.key}:${String(t.key)}`,
|
|
277
|
-
type: "button",
|
|
278
|
-
role: "option",
|
|
279
|
-
"aria-selected": t.key === e.activeKey,
|
|
280
|
-
class: ee({ "is-active": t.key === b.value?.key }),
|
|
281
|
-
disabled: t.disabled,
|
|
282
|
-
onClick: (e) => ae(t.key)
|
|
283
|
-
}, [d("span", Je, [d("span", Ye, re(t.label), 1), t.dirty ? (x(), u("span", {
|
|
284
|
-
key: 0,
|
|
285
|
-
class: "og-tabs-finder__dirty",
|
|
286
|
-
"aria-label": e.locale.unsaved
|
|
287
|
-
}, null, 8, Xe)) : l("", !0)])], 10, qe))), 128))], 8, Ke)) : (x(), c(E(Se), {
|
|
288
|
-
key: 1,
|
|
289
|
-
description: e.locale.noResults,
|
|
290
|
-
"image-size": 56
|
|
291
|
-
}, null, 8, ["description"]))])]),
|
|
292
|
-
_: 1
|
|
293
|
-
}, 8, ["visible"]));
|
|
294
166
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return `${typeof e == "number" ? "n" : "s"}:${encodeURIComponent(String(e))}`;
|
|
167
|
+
return {
|
|
168
|
+
isPending: () => t,
|
|
169
|
+
execute: n
|
|
170
|
+
};
|
|
300
171
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
172
|
+
// src/tabCommandPlanner.ts
|
|
173
|
+
function He(e, t, n, r = {}) {
|
|
174
|
+
return {
|
|
175
|
+
operation: t,
|
|
176
|
+
source: e.source,
|
|
177
|
+
revision: e.revision,
|
|
178
|
+
tab: n,
|
|
179
|
+
activeKey: e.activeKey,
|
|
180
|
+
activeTab: P(e.items, e.activeKey),
|
|
181
|
+
items: e.items,
|
|
182
|
+
...r
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function Ue(e, t) {
|
|
186
|
+
let n = P(e.items, t);
|
|
187
|
+
if (!Ae(n)) return {
|
|
188
|
+
operation: "close",
|
|
189
|
+
tab: n
|
|
190
|
+
};
|
|
191
|
+
let r = Pe(e.items, /* @__PURE__ */ new Set([t])), i = t === e.activeKey ? Ie(Oe(e.items), r, t) : e.activeKey;
|
|
192
|
+
return He(e, "close", n, {
|
|
193
|
+
targets: [n],
|
|
194
|
+
nextItems: r,
|
|
195
|
+
nextActiveKey: i
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function We(e, t, n) {
|
|
199
|
+
let r = Oe(e.items), i = Fe(r, n, t);
|
|
200
|
+
if (!i.length) return {
|
|
201
|
+
operation: ze(t),
|
|
202
|
+
tab: P(e.items, n)
|
|
203
|
+
};
|
|
204
|
+
let a = new Set(i.map((e) => e.key)), o = Pe(e.items, a), s = e.activeKey !== void 0 && a.has(e.activeKey) ? Ie(r, o, e.activeKey) : e.activeKey, c = P(e.items, n);
|
|
205
|
+
return t === "current" && (c = i[0]), He(e, ze(t), c, {
|
|
206
|
+
targets: i,
|
|
207
|
+
nextItems: o,
|
|
208
|
+
nextActiveKey: s
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function Ge(e, t, n) {
|
|
212
|
+
let r = P(e.items, t), i = n ? "pin" : "unpin";
|
|
213
|
+
return !r || !je(r) || r.pinned === n ? {
|
|
214
|
+
operation: i,
|
|
215
|
+
tab: r
|
|
216
|
+
} : He(e, i, r, { nextItems: Ne(e.items, t, n) });
|
|
217
|
+
}
|
|
218
|
+
function Ke(e, t, n) {
|
|
219
|
+
let r = P(e.items, t), i = P(e.items, n), a = Le(e.items, t, n);
|
|
220
|
+
return !r || !i || a.every((t, n) => t.key === e.items[n]?.key) ? {
|
|
221
|
+
operation: "move",
|
|
222
|
+
tab: r
|
|
223
|
+
} : He(e, "move", r, {
|
|
224
|
+
nextItems: a,
|
|
225
|
+
targetTab: i
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function qe(e, t, n) {
|
|
229
|
+
let r = P(e.items, t), i = n === void 0 ? Re(e.items, t, "bottom") : Le(e.items, t, n);
|
|
230
|
+
if (!r || i.every((t, n) => t.key === e.items[n]?.key)) return {
|
|
231
|
+
operation: "move",
|
|
232
|
+
tab: r
|
|
233
|
+
};
|
|
234
|
+
let a;
|
|
235
|
+
return n !== void 0 && (a = P(e.items, n)), He(e, "move", r, {
|
|
236
|
+
nextItems: i,
|
|
237
|
+
targetTab: a
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function Je(e, t, n) {
|
|
241
|
+
let r = P(e.items, t), i = "move-bottom";
|
|
242
|
+
n === "top" && (i = "move-top");
|
|
243
|
+
let a = Re(e.items, t, n);
|
|
244
|
+
return !r || a.every((t, n) => t.key === e.items[n]?.key) ? {
|
|
245
|
+
operation: i,
|
|
246
|
+
tab: r
|
|
247
|
+
} : He(e, i, r, { nextItems: a });
|
|
248
|
+
}
|
|
249
|
+
function Ye(e, t) {
|
|
250
|
+
let n = P(e.items, t);
|
|
251
|
+
return n ? He(e, "refresh", n) : {
|
|
252
|
+
operation: "refresh",
|
|
253
|
+
tab: n
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function Xe(e) {
|
|
257
|
+
return !("source" in e);
|
|
258
|
+
}
|
|
259
|
+
// src/tabControllerCommands.ts
|
|
260
|
+
function Ze(e, t) {
|
|
261
|
+
let n = e.getRevision ?? (() => Ee(e.getItems(), e.getActiveKey())), r = Ve({
|
|
262
|
+
getRevision: n,
|
|
263
|
+
getDeniedReason: e.getDeniedReason,
|
|
264
|
+
beforeAction: (t) => e.getProps().ogBeforeAction?.(t),
|
|
265
|
+
onRequest: e.onRequest,
|
|
266
|
+
onDenied: e.onDenied,
|
|
267
|
+
onError: e.onError,
|
|
268
|
+
onPendingChange: t
|
|
269
|
+
});
|
|
270
|
+
function i(t, r, i, a = {}) {
|
|
271
|
+
let o = e.getItems(), s = e.getActiveKey();
|
|
379
272
|
return {
|
|
380
273
|
operation: t,
|
|
381
|
-
source:
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
274
|
+
source: r,
|
|
275
|
+
revision: n(),
|
|
276
|
+
tab: i,
|
|
277
|
+
activeKey: s,
|
|
278
|
+
activeTab: P(o, s),
|
|
279
|
+
items: o,
|
|
280
|
+
...a
|
|
387
281
|
};
|
|
388
282
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (r) return e.onDenied(n.operation, n.tab, r), !1;
|
|
392
|
-
t.value = !0;
|
|
393
|
-
try {
|
|
394
|
-
return await e.getProps().beforeAction?.(n) !== !1 && (e.onRequest(n), !0);
|
|
395
|
-
} catch (t) {
|
|
396
|
-
return e.onError(n, t), !1;
|
|
397
|
-
} finally {
|
|
398
|
-
t.value = !1;
|
|
399
|
-
}
|
|
283
|
+
function a(t, n) {
|
|
284
|
+
return r.isPending() ? (e.onDenied(t, n, "busy"), !0) : !1;
|
|
400
285
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
403
|
-
return !a || a.disabled ? (e.onDenied("activate", a, a ? "disabled" : "not-found"), Promise.resolve(!1)) : t === e.getActiveKey() ? Promise.resolve(!0) : r(n("activate", i, a, { nextActiveKey: t }));
|
|
404
|
-
}
|
|
405
|
-
function a(t, i = "api") {
|
|
406
|
-
let a = e.getItems(), o = k(a, t);
|
|
407
|
-
if (!Pe(o)) return e.onDenied("close", o, o?.pinned ? "pinned" : o ? "readonly" : "not-found"), Promise.resolve(!1);
|
|
408
|
-
let s = Re(a, /* @__PURE__ */ new Set([t])), c = t === e.getActiveKey() ? Be(Me(a), s, t) : e.getActiveKey();
|
|
409
|
-
return r(n("close", i, o, {
|
|
410
|
-
targets: [o],
|
|
411
|
-
nextItems: s,
|
|
412
|
-
nextActiveKey: c
|
|
413
|
-
}));
|
|
286
|
+
function o(e) {
|
|
287
|
+
return r.execute(e);
|
|
414
288
|
}
|
|
415
|
-
function
|
|
416
|
-
let
|
|
417
|
-
|
|
418
|
-
let l = new Set(c.map((e) => e.key)), u = e.getActiveKey(), d = Re(o, l), f = u !== void 0 && l.has(u) ? Be(s, d, u) : u;
|
|
419
|
-
return r(n(Ve(t), a, t === "current" ? c[0] : k(o, i), {
|
|
420
|
-
targets: c,
|
|
421
|
-
nextItems: d,
|
|
422
|
-
nextActiveKey: f
|
|
423
|
-
}));
|
|
289
|
+
function s(t, n = "api") {
|
|
290
|
+
let r = P(e.getItems(), t);
|
|
291
|
+
return a("activate", r) ? Promise.resolve(!1) : !r || r.disabled ? (e.onDenied("activate", r, r ? "disabled" : "not-found"), Promise.resolve(!1)) : t === e.getActiveKey() ? Promise.resolve(!0) : o(i("activate", n, r, { nextActiveKey: t }));
|
|
424
292
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
427
|
-
return !o || !Fe(o) || o.pinned === i ? (e.onDenied(i ? "pin" : "unpin", o, o ? o.pinned === i ? "boundary" : "readonly" : "not-found"), Promise.resolve(!1)) : r(n(i ? "pin" : "unpin", a, o, { nextItems: Le(e.getItems(), t, i) }));
|
|
293
|
+
function c(e = "api") {
|
|
294
|
+
return o(i("add", e, void 0));
|
|
428
295
|
}
|
|
429
|
-
function
|
|
430
|
-
let
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
296
|
+
function l(t, r = "api") {
|
|
297
|
+
let i = e.getItems(), s = P(i, t);
|
|
298
|
+
if (a("close", s)) return Promise.resolve(!1);
|
|
299
|
+
if (!s || s.disabled || s.readonly || s.pinned || s.closable === !1) {
|
|
300
|
+
let t = s ? s.pinned ? "pinned" : "readonly" : "not-found";
|
|
301
|
+
return e.onDenied("close", s, t), Promise.resolve(!1);
|
|
302
|
+
}
|
|
303
|
+
let c = Ue({
|
|
304
|
+
activeKey: e.getActiveKey(),
|
|
305
|
+
items: i,
|
|
306
|
+
source: r,
|
|
307
|
+
revision: n()
|
|
308
|
+
}, t);
|
|
309
|
+
return Xe(c) ? Promise.resolve(!1) : o(c);
|
|
435
310
|
}
|
|
436
|
-
function
|
|
437
|
-
let
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
311
|
+
function u(t, r, i = "api") {
|
|
312
|
+
let s = e.getItems(), c = ze(t);
|
|
313
|
+
if (a(c, P(s, r))) return Promise.resolve(!1);
|
|
314
|
+
let l = We({
|
|
315
|
+
activeKey: e.getActiveKey(),
|
|
316
|
+
items: s,
|
|
317
|
+
source: i,
|
|
318
|
+
revision: n()
|
|
319
|
+
}, t, r);
|
|
320
|
+
return Xe(l) ? (e.onDenied(c, l.tab, "boundary"), Promise.resolve(!1)) : o(l);
|
|
321
|
+
}
|
|
322
|
+
function d(t, r, i = "api") {
|
|
323
|
+
let s = e.getItems(), c = P(s, t), l = r ? "pin" : "unpin";
|
|
324
|
+
if (a(l, c)) return Promise.resolve(!1);
|
|
325
|
+
let u = Ge({
|
|
326
|
+
activeKey: e.getActiveKey(),
|
|
327
|
+
items: s,
|
|
328
|
+
source: i,
|
|
329
|
+
revision: n()
|
|
330
|
+
}, t, r);
|
|
331
|
+
if (Xe(u)) {
|
|
332
|
+
let t = c ? c.pinned === r ? "boundary" : "readonly" : "not-found";
|
|
333
|
+
return e.onDenied(l, c, t), Promise.resolve(!1);
|
|
334
|
+
}
|
|
335
|
+
return o(u);
|
|
336
|
+
}
|
|
337
|
+
function f(t, r, i = "api") {
|
|
338
|
+
let s = e.getItems(), c = P(s, t);
|
|
339
|
+
if (a("move", c)) return Promise.resolve(!1);
|
|
340
|
+
let l = Ke({
|
|
341
|
+
activeKey: e.getActiveKey(),
|
|
342
|
+
items: s,
|
|
343
|
+
source: i,
|
|
344
|
+
revision: n()
|
|
345
|
+
}, t, r);
|
|
346
|
+
return Xe(l) ? (e.onDenied("move", c, c ? "boundary" : "not-found"), Promise.resolve(!1)) : o(l);
|
|
442
347
|
}
|
|
443
|
-
function
|
|
444
|
-
let
|
|
445
|
-
|
|
348
|
+
function p(t, r, i = "api") {
|
|
349
|
+
let s = e.getItems(), c = P(s, t);
|
|
350
|
+
if (a("move", c)) return Promise.resolve(!1);
|
|
351
|
+
let l = qe({
|
|
352
|
+
activeKey: e.getActiveKey(),
|
|
353
|
+
items: s,
|
|
354
|
+
source: i,
|
|
355
|
+
revision: n()
|
|
356
|
+
}, t, r);
|
|
357
|
+
return Xe(l) ? (e.onDenied("move", c, c ? "boundary" : "not-found"), Promise.resolve(!1)) : o(l);
|
|
446
358
|
}
|
|
447
|
-
function
|
|
448
|
-
let
|
|
449
|
-
|
|
359
|
+
function m(t, r, i = "api") {
|
|
360
|
+
let s = e.getItems(), c = P(s, t), l = r === "top" ? "move-top" : "move-bottom";
|
|
361
|
+
if (a(l, c)) return Promise.resolve(!1);
|
|
362
|
+
let u = Je({
|
|
363
|
+
activeKey: e.getActiveKey(),
|
|
364
|
+
items: s,
|
|
365
|
+
source: i,
|
|
366
|
+
revision: n()
|
|
367
|
+
}, t, r);
|
|
368
|
+
return Xe(u) ? (e.onDenied(l, c, c ? "boundary" : "not-found"), Promise.resolve(!1)) : o(u);
|
|
369
|
+
}
|
|
370
|
+
function h(t, r = "api") {
|
|
371
|
+
let i = e.getItems(), s = Ye({
|
|
372
|
+
activeKey: e.getActiveKey(),
|
|
373
|
+
items: i,
|
|
374
|
+
source: r,
|
|
375
|
+
revision: n()
|
|
376
|
+
}, t);
|
|
377
|
+
return a("refresh", s.tab) ? Promise.resolve(!1) : Xe(s) ? (e.onDenied("refresh", s.tab, "not-found"), Promise.resolve(!1)) : o(s);
|
|
450
378
|
}
|
|
451
379
|
return {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
moveBottom: (e, t = "api") => u(e, "bottom", t),
|
|
380
|
+
dispatch: o,
|
|
381
|
+
activate: s,
|
|
382
|
+
close: l,
|
|
383
|
+
closeScope: (t, n = "api") => u(t, e.getActiveKey(), n),
|
|
384
|
+
closeScopeAt: u,
|
|
385
|
+
refreshAt: h,
|
|
386
|
+
pin: (e, t = "api") => d(e, !0, t),
|
|
387
|
+
unpin: (e, t = "api") => d(e, !1, t),
|
|
388
|
+
move: f,
|
|
389
|
+
moveBefore: p,
|
|
390
|
+
moveTop: (e, t = "api") => m(e, "top", t),
|
|
391
|
+
moveBottom: (e, t = "api") => m(e, "bottom", t),
|
|
465
392
|
refresh: (t = "api") => {
|
|
466
393
|
let n = e.getActiveKey();
|
|
467
|
-
return n === void 0 ? Promise.resolve(!1) :
|
|
394
|
+
return n === void 0 ? Promise.resolve(!1) : h(n, t);
|
|
468
395
|
},
|
|
396
|
+
requestAdd: c
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
// src/composables/useTabsController.ts
|
|
400
|
+
function Qe(e) {
|
|
401
|
+
let t = k(!1);
|
|
402
|
+
return {
|
|
403
|
+
pending: t,
|
|
404
|
+
...Ze(e, (e) => {
|
|
405
|
+
t.value = e;
|
|
406
|
+
}),
|
|
469
407
|
scrollTo: e.onScrollTo,
|
|
470
408
|
getItems: e.getItems
|
|
471
409
|
};
|
|
472
410
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
411
|
+
// src/composables/useOgTabsController.ts
|
|
412
|
+
function $e(e) {
|
|
413
|
+
let t = E(), n = Qe({
|
|
414
|
+
getItems: () => e.tabs.value,
|
|
415
|
+
getActiveKey: () => e.activeKey.value,
|
|
416
|
+
getProps: () => e.props,
|
|
417
|
+
getRevision: () => Ee(e.tabs.value, e.activeKey.value),
|
|
418
|
+
getDeniedReason: (e, t) => r(e, t),
|
|
419
|
+
onRequest: e.onRequest,
|
|
420
|
+
onDenied: e.emit.operationDenied,
|
|
421
|
+
onError: e.emit.operationError,
|
|
422
|
+
onScrollTo: e.scrollTo
|
|
423
|
+
});
|
|
424
|
+
function r(e, t) {
|
|
425
|
+
if (l()) return "busy";
|
|
426
|
+
if (u(e)) return "policy";
|
|
427
|
+
if (e === "activate") return d(t);
|
|
428
|
+
if (f(e, t)) return "not-found";
|
|
429
|
+
let n = p(t);
|
|
430
|
+
return n === void 0 ? m(e, t) : n;
|
|
431
|
+
}
|
|
432
|
+
let i = () => void 0;
|
|
433
|
+
function a(e) {
|
|
434
|
+
if (!Ae(e)) return e?.pinned ? "pinned" : "readonly";
|
|
435
|
+
}
|
|
436
|
+
function o(e) {
|
|
437
|
+
if (!je(e)) return "readonly";
|
|
438
|
+
}
|
|
439
|
+
function s(e) {
|
|
440
|
+
if (!Me(e)) return e?.pinned ? "pinned" : "boundary";
|
|
441
|
+
}
|
|
442
|
+
let c = {
|
|
443
|
+
add: {
|
|
444
|
+
feature: "add",
|
|
445
|
+
check: i
|
|
446
|
+
},
|
|
447
|
+
close: {
|
|
448
|
+
feature: "close",
|
|
449
|
+
check: a
|
|
450
|
+
},
|
|
451
|
+
"close-others": {
|
|
452
|
+
feature: "close",
|
|
453
|
+
check: i
|
|
454
|
+
},
|
|
455
|
+
"close-left": {
|
|
456
|
+
feature: "close",
|
|
457
|
+
check: i
|
|
458
|
+
},
|
|
459
|
+
"close-right": {
|
|
460
|
+
feature: "close",
|
|
461
|
+
check: i
|
|
462
|
+
},
|
|
463
|
+
"close-all": {
|
|
464
|
+
feature: "close",
|
|
465
|
+
check: i
|
|
466
|
+
},
|
|
467
|
+
refresh: {
|
|
468
|
+
feature: "refresh",
|
|
469
|
+
check: i
|
|
470
|
+
},
|
|
471
|
+
pin: {
|
|
472
|
+
feature: "pin",
|
|
473
|
+
check: o
|
|
474
|
+
},
|
|
475
|
+
unpin: {
|
|
476
|
+
feature: "pin",
|
|
477
|
+
check: o
|
|
478
|
+
},
|
|
479
|
+
move: {
|
|
480
|
+
feature: "drag",
|
|
481
|
+
check: s
|
|
482
|
+
},
|
|
483
|
+
"move-top": {
|
|
484
|
+
feature: "drag",
|
|
485
|
+
check: s
|
|
486
|
+
},
|
|
487
|
+
"move-bottom": {
|
|
488
|
+
feature: "drag",
|
|
489
|
+
check: s
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
function l() {
|
|
493
|
+
return e.props.ogBusy ? !0 : n.pending.value;
|
|
494
|
+
}
|
|
495
|
+
function u(t) {
|
|
496
|
+
let n = e.props.ogActionPolicy;
|
|
497
|
+
if (!n) return !1;
|
|
498
|
+
let r = n.actions.includes(t);
|
|
499
|
+
return n.mode === "allow" ? !r : r;
|
|
500
|
+
}
|
|
501
|
+
function d(e) {
|
|
502
|
+
if (!e) return "not-found";
|
|
503
|
+
if (e.disabled) return "disabled";
|
|
504
|
+
}
|
|
505
|
+
function f(e, t) {
|
|
506
|
+
return t || e === "close-all" ? !1 : e !== "add";
|
|
507
|
+
}
|
|
508
|
+
function p(t) {
|
|
509
|
+
if (e.props.ogReadonly || t?.readonly || t?.disabled) return t?.disabled ? "disabled" : "readonly";
|
|
510
|
+
}
|
|
511
|
+
function m(t, n) {
|
|
512
|
+
let r = c[t];
|
|
513
|
+
if (r !== void 0) return e.featureEnabled(r.feature) ? r.check(n) : "policy";
|
|
514
|
+
}
|
|
515
|
+
function h(t, r) {
|
|
516
|
+
n.activate(t, r).then((n) => {
|
|
517
|
+
n && e.scrollTo(t);
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
function g(n) {
|
|
521
|
+
let r = e.orderedTabs.value, i = Ie(r, r.filter((e) => e.key !== n), n);
|
|
522
|
+
i === void 0 ? t.value = void 0 : t.value = N(i);
|
|
523
|
+
}
|
|
524
|
+
function _(e, r) {
|
|
525
|
+
g(e), n.close(e, r).then((e) => {
|
|
526
|
+
e || (t.value = void 0);
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
function v(r, i, a) {
|
|
530
|
+
let o = e.orderedTabs.value, s = Fe(o, i, r), c = e.activeKey.value;
|
|
531
|
+
if (c !== void 0 && s.some((e) => e.key === c)) {
|
|
532
|
+
let e = Ie(o, o.filter((e) => !s.some((t) => t.key === e.key)), c);
|
|
533
|
+
e === void 0 ? t.value = void 0 : t.value = N(e);
|
|
534
|
+
}
|
|
535
|
+
n.closeScopeAt(r, i, a).then((e) => {
|
|
536
|
+
e || (t.value = void 0);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
async function b(t) {
|
|
540
|
+
let r = e.keyFromNativeName(t);
|
|
541
|
+
return r === void 0 || r === e.activeKey.value ? r !== void 0 : await n.activate(r, "native") ? (await y(), await y(), e.activeKey.value === r) : !1;
|
|
542
|
+
}
|
|
543
|
+
function x(t, n) {
|
|
544
|
+
e.emit.tabClick(e.publicPane(t), n);
|
|
545
|
+
}
|
|
546
|
+
function S(t) {
|
|
547
|
+
e.emit.tabChange(e.keyFromNativeName(t));
|
|
548
|
+
}
|
|
549
|
+
function C(t) {
|
|
550
|
+
let n = e.keyFromNativeName(t);
|
|
551
|
+
e.emit.tabRemove(n), n !== void 0 && _(n, "native");
|
|
552
|
+
}
|
|
553
|
+
return {
|
|
554
|
+
activate: h,
|
|
555
|
+
beforeNativeLeave: b,
|
|
556
|
+
controller: n,
|
|
557
|
+
deniedReason: r,
|
|
558
|
+
onNativeTabChange: S,
|
|
559
|
+
onNativeTabClick: x,
|
|
560
|
+
onNativeTabRemove: C,
|
|
561
|
+
pendingFocusId: t,
|
|
562
|
+
requestClose: _,
|
|
563
|
+
requestCloseScope: v
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
// ../../node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js
|
|
567
|
+
function et(e, t, n) {
|
|
568
|
+
return (t = st(t)) in e ? Object.defineProperty(e, t, {
|
|
569
|
+
value: n,
|
|
570
|
+
enumerable: !0,
|
|
571
|
+
configurable: !0,
|
|
572
|
+
writable: !0
|
|
573
|
+
}) : e[t] = n, e;
|
|
574
|
+
}
|
|
575
|
+
function tt() {
|
|
576
|
+
return tt = Object.assign ? Object.assign.bind() : function(e) {
|
|
577
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
578
|
+
var n = arguments[t];
|
|
579
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
580
|
+
}
|
|
489
581
|
return e;
|
|
490
|
-
},
|
|
582
|
+
}, tt.apply(null, arguments);
|
|
491
583
|
}
|
|
492
|
-
function
|
|
584
|
+
function nt(e, t) {
|
|
493
585
|
var n = Object.keys(e);
|
|
494
586
|
if (Object.getOwnPropertySymbols) {
|
|
495
587
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -499,27 +591,27 @@ function N(e, t) {
|
|
|
499
591
|
}
|
|
500
592
|
return n;
|
|
501
593
|
}
|
|
502
|
-
function
|
|
594
|
+
function rt(e) {
|
|
503
595
|
for (var t = 1; t < arguments.length; t++) {
|
|
504
596
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
505
|
-
t % 2 ?
|
|
506
|
-
|
|
507
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
597
|
+
t % 2 ? nt(Object(n), !0).forEach(function(t) {
|
|
598
|
+
et(e, t, n[t]);
|
|
599
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : nt(Object(n)).forEach(function(t) {
|
|
508
600
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
509
601
|
});
|
|
510
602
|
}
|
|
511
603
|
return e;
|
|
512
604
|
}
|
|
513
|
-
function
|
|
605
|
+
function it(e, t) {
|
|
514
606
|
if (e == null) return {};
|
|
515
|
-
var n, r, i =
|
|
607
|
+
var n, r, i = at(e, t);
|
|
516
608
|
if (Object.getOwnPropertySymbols) {
|
|
517
609
|
var a = Object.getOwnPropertySymbols(e);
|
|
518
610
|
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
519
611
|
}
|
|
520
612
|
return i;
|
|
521
613
|
}
|
|
522
|
-
function
|
|
614
|
+
function at(e, t) {
|
|
523
615
|
if (e == null) return {};
|
|
524
616
|
var n = {};
|
|
525
617
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -528,7 +620,7 @@ function lt(e, t) {
|
|
|
528
620
|
}
|
|
529
621
|
return n;
|
|
530
622
|
}
|
|
531
|
-
function
|
|
623
|
+
function ot(e, t) {
|
|
532
624
|
if (typeof e != "object" || !e) return e;
|
|
533
625
|
var n = e[Symbol.toPrimitive];
|
|
534
626
|
if (n !== void 0) {
|
|
@@ -538,33 +630,33 @@ function ut(e, t) {
|
|
|
538
630
|
}
|
|
539
631
|
return (t === "string" ? String : Number)(e);
|
|
540
632
|
}
|
|
541
|
-
function
|
|
542
|
-
var t =
|
|
633
|
+
function st(e) {
|
|
634
|
+
var t = ot(e, "string");
|
|
543
635
|
return typeof t == "symbol" ? t : t + "";
|
|
544
636
|
}
|
|
545
|
-
function
|
|
637
|
+
function ct(e) {
|
|
546
638
|
"@babel/helpers - typeof";
|
|
547
|
-
return
|
|
639
|
+
return ct = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
548
640
|
return typeof e;
|
|
549
641
|
} : function(e) {
|
|
550
642
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
551
|
-
},
|
|
643
|
+
}, ct(e);
|
|
552
644
|
}
|
|
553
|
-
var
|
|
554
|
-
function
|
|
645
|
+
var lt = "1.15.7";
|
|
646
|
+
function ut(e) {
|
|
555
647
|
if (typeof window < "u" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(e);
|
|
556
648
|
}
|
|
557
|
-
var
|
|
649
|
+
var dt = ut(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), ft = ut(/Edge/i), pt = ut(/firefox/i), mt = ut(/safari/i) && !ut(/chrome/i) && !ut(/android/i), ht = ut(/iP(ad|od|hone)/i), gt = ut(/chrome/i) && ut(/android/i), _t = {
|
|
558
650
|
capture: !1,
|
|
559
651
|
passive: !1
|
|
560
652
|
};
|
|
561
653
|
function F(e, t, n) {
|
|
562
|
-
e.addEventListener(t, n, !
|
|
654
|
+
e.addEventListener(t, n, !dt && _t);
|
|
563
655
|
}
|
|
564
656
|
function I(e, t, n) {
|
|
565
|
-
e.removeEventListener(t, n, !
|
|
657
|
+
e.removeEventListener(t, n, !dt && _t);
|
|
566
658
|
}
|
|
567
|
-
function
|
|
659
|
+
function vt(e, t) {
|
|
568
660
|
if (t) {
|
|
569
661
|
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
570
662
|
if (e.matches) return e.matches(t);
|
|
@@ -576,22 +668,22 @@ function St(e, t) {
|
|
|
576
668
|
return !1;
|
|
577
669
|
}
|
|
578
670
|
}
|
|
579
|
-
function
|
|
671
|
+
function yt(e) {
|
|
580
672
|
return e.host && e !== document && e.host.nodeType && e.host !== e ? e.host : e.parentNode;
|
|
581
673
|
}
|
|
582
|
-
function
|
|
674
|
+
function bt(e, t, n, r) {
|
|
583
675
|
if (e) {
|
|
584
676
|
n ||= document;
|
|
585
677
|
do {
|
|
586
|
-
if (t != null && (t[0] === ">" ? e.parentNode === n &&
|
|
678
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && vt(e, t) : vt(e, t)) || r && e === n) return e;
|
|
587
679
|
if (e === n) break;
|
|
588
|
-
} while (e =
|
|
680
|
+
} while (e = yt(e));
|
|
589
681
|
}
|
|
590
682
|
return null;
|
|
591
683
|
}
|
|
592
|
-
var
|
|
684
|
+
var xt = /\s+/g;
|
|
593
685
|
function L(e, t, n) {
|
|
594
|
-
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(
|
|
686
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(xt, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(xt, " "));
|
|
595
687
|
}
|
|
596
688
|
function R(e, t, n) {
|
|
597
689
|
var r = e && e.style;
|
|
@@ -600,7 +692,7 @@ function R(e, t, n) {
|
|
|
600
692
|
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
601
693
|
}
|
|
602
694
|
}
|
|
603
|
-
function
|
|
695
|
+
function St(e, t) {
|
|
604
696
|
var n = "";
|
|
605
697
|
if (typeof e == "string") n = e;
|
|
606
698
|
else do {
|
|
@@ -610,7 +702,7 @@ function Et(e, t) {
|
|
|
610
702
|
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
611
703
|
return i && new i(n);
|
|
612
704
|
}
|
|
613
|
-
function
|
|
705
|
+
function Ct(e, t, n) {
|
|
614
706
|
if (e) {
|
|
615
707
|
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
616
708
|
if (n) for (; i < a; i++) n(r[i], i);
|
|
@@ -618,13 +710,13 @@ function Dt(e, t, n) {
|
|
|
618
710
|
}
|
|
619
711
|
return [];
|
|
620
712
|
}
|
|
621
|
-
function
|
|
713
|
+
function wt() {
|
|
622
714
|
return document.scrollingElement || document.documentElement;
|
|
623
715
|
}
|
|
624
716
|
function z(e, t, n, r, i) {
|
|
625
|
-
if (
|
|
717
|
+
if (e.getBoundingClientRect || e === window) {
|
|
626
718
|
var a, o, s, c, l, u, d;
|
|
627
|
-
if (e !== window && e.parentNode && e !==
|
|
719
|
+
if (e !== window && e.parentNode && e !== wt() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !dt)) do
|
|
628
720
|
if (i && i.getBoundingClientRect && (R(i, "transform") !== "none" || n && R(i, "position") !== "static")) {
|
|
629
721
|
var f = i.getBoundingClientRect();
|
|
630
722
|
o -= f.top + parseInt(R(i, "border-top-width")), s -= f.left + parseInt(R(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
@@ -632,7 +724,7 @@ function z(e, t, n, r, i) {
|
|
|
632
724
|
}
|
|
633
725
|
while (i = i.parentNode);
|
|
634
726
|
if (r && e !== window) {
|
|
635
|
-
var p =
|
|
727
|
+
var p = St(i || e), m = p && p.a, h = p && p.d;
|
|
636
728
|
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
637
729
|
}
|
|
638
730
|
return {
|
|
@@ -645,18 +737,18 @@ function z(e, t, n, r, i) {
|
|
|
645
737
|
};
|
|
646
738
|
}
|
|
647
739
|
}
|
|
648
|
-
function
|
|
649
|
-
for (var r =
|
|
740
|
+
function Tt(e, t, n) {
|
|
741
|
+
for (var r = At(e, !0), i = z(e)[t]; r;) {
|
|
650
742
|
var a = z(r)[n], o = void 0;
|
|
651
743
|
if (o = n === "top" || n === "left" ? i >= a : i <= a, !o) return r;
|
|
652
|
-
if (r ===
|
|
653
|
-
r =
|
|
744
|
+
if (r === wt()) break;
|
|
745
|
+
r = At(r, !1);
|
|
654
746
|
}
|
|
655
747
|
return !1;
|
|
656
748
|
}
|
|
657
|
-
function
|
|
749
|
+
function Et(e, t, n, r) {
|
|
658
750
|
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
659
|
-
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) &&
|
|
751
|
+
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && bt(o[a], n.draggable, e, !1)) {
|
|
660
752
|
if (i === t) return o[a];
|
|
661
753
|
i++;
|
|
662
754
|
}
|
|
@@ -664,84 +756,84 @@ function At(e, t, n, r) {
|
|
|
664
756
|
}
|
|
665
757
|
return null;
|
|
666
758
|
}
|
|
667
|
-
function
|
|
668
|
-
for (var n = e.lastElementChild; n && (n === Q.ghost || R(n, "display") === "none" || t && !
|
|
759
|
+
function Dt(e, t) {
|
|
760
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || R(n, "display") === "none" || t && !vt(n, t));) n = n.previousElementSibling;
|
|
669
761
|
return n || null;
|
|
670
762
|
}
|
|
671
763
|
function B(e, t) {
|
|
672
764
|
var n = 0;
|
|
673
765
|
if (!e || !e.parentNode) return -1;
|
|
674
|
-
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t ||
|
|
766
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || vt(e, t)) && n++;
|
|
675
767
|
return n;
|
|
676
768
|
}
|
|
677
|
-
function
|
|
678
|
-
var t = 0, n = 0, r =
|
|
769
|
+
function Ot(e) {
|
|
770
|
+
var t = 0, n = 0, r = wt();
|
|
679
771
|
if (e) do {
|
|
680
|
-
var i =
|
|
772
|
+
var i = St(e), a = i.a, o = i.d;
|
|
681
773
|
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
682
774
|
} while (e !== r && (e = e.parentNode));
|
|
683
775
|
return [t, n];
|
|
684
776
|
}
|
|
685
|
-
function
|
|
777
|
+
function kt(e, t) {
|
|
686
778
|
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
687
779
|
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
688
780
|
}
|
|
689
781
|
return -1;
|
|
690
782
|
}
|
|
691
|
-
function
|
|
692
|
-
if (!e || !e.getBoundingClientRect) return
|
|
783
|
+
function At(e, t) {
|
|
784
|
+
if (!e || !e.getBoundingClientRect) return wt();
|
|
693
785
|
var n = e, r = !1;
|
|
694
786
|
do
|
|
695
787
|
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
696
788
|
var i = R(n);
|
|
697
789
|
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
698
|
-
if (!n.getBoundingClientRect || n === document.body) return
|
|
790
|
+
if (!n.getBoundingClientRect || n === document.body) return wt();
|
|
699
791
|
if (r || t) return n;
|
|
700
792
|
r = !0;
|
|
701
793
|
}
|
|
702
794
|
}
|
|
703
795
|
while (n = n.parentNode);
|
|
704
|
-
return
|
|
796
|
+
return wt();
|
|
705
797
|
}
|
|
706
|
-
function
|
|
798
|
+
function jt(e, t) {
|
|
707
799
|
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
708
800
|
return e;
|
|
709
801
|
}
|
|
710
|
-
function
|
|
802
|
+
function Mt(e, t) {
|
|
711
803
|
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);
|
|
712
804
|
}
|
|
713
|
-
var
|
|
714
|
-
function
|
|
805
|
+
var Nt;
|
|
806
|
+
function Pt(e, t) {
|
|
715
807
|
return function() {
|
|
716
|
-
if (!
|
|
808
|
+
if (!Nt) {
|
|
717
809
|
var n = arguments, r = this;
|
|
718
|
-
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n),
|
|
719
|
-
|
|
810
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), Nt = setTimeout(function() {
|
|
811
|
+
Nt = void 0;
|
|
720
812
|
}, t);
|
|
721
813
|
}
|
|
722
814
|
};
|
|
723
815
|
}
|
|
724
|
-
function
|
|
725
|
-
clearTimeout(
|
|
816
|
+
function Ft() {
|
|
817
|
+
clearTimeout(Nt), Nt = void 0;
|
|
726
818
|
}
|
|
727
|
-
function
|
|
819
|
+
function It(e, t, n) {
|
|
728
820
|
e.scrollLeft += t, e.scrollTop += n;
|
|
729
821
|
}
|
|
730
|
-
function
|
|
822
|
+
function Lt(e) {
|
|
731
823
|
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
732
824
|
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
733
825
|
}
|
|
734
|
-
function
|
|
826
|
+
function Rt(e, t, n) {
|
|
735
827
|
var r = {};
|
|
736
828
|
return Array.from(e.children).forEach(function(i) {
|
|
737
|
-
if (
|
|
829
|
+
if (bt(i, t.draggable, e, !1) && !i.animated && i !== n) {
|
|
738
830
|
var a = z(i);
|
|
739
831
|
r.left = Math.min(r.left ?? Infinity, a.left), r.top = Math.min(r.top ?? Infinity, a.top), r.right = Math.max(r.right ?? -Infinity, a.right), r.bottom = Math.max(r.bottom ?? -Infinity, a.bottom);
|
|
740
832
|
}
|
|
741
833
|
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
742
834
|
}
|
|
743
835
|
var V = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
744
|
-
function
|
|
836
|
+
function zt() {
|
|
745
837
|
var e = [], t;
|
|
746
838
|
return {
|
|
747
839
|
captureAnimationState: function() {
|
|
@@ -751,9 +843,9 @@ function Ut() {
|
|
|
751
843
|
target: t,
|
|
752
844
|
rect: z(t)
|
|
753
845
|
});
|
|
754
|
-
var n =
|
|
846
|
+
var n = rt({}, e[e.length - 1].rect);
|
|
755
847
|
if (t.thisAnimationDuration) {
|
|
756
|
-
var r =
|
|
848
|
+
var r = St(t, !0);
|
|
757
849
|
r && (n.top -= r.f, n.left -= r.e);
|
|
758
850
|
}
|
|
759
851
|
t.fromRect = n;
|
|
@@ -764,47 +856,46 @@ function Ut() {
|
|
|
764
856
|
e.push(t);
|
|
765
857
|
},
|
|
766
858
|
removeAnimationState: function(t) {
|
|
767
|
-
e.splice(
|
|
859
|
+
e.splice(kt(e, { target: t }), 1);
|
|
768
860
|
},
|
|
769
861
|
animateAll: function(n) {
|
|
770
862
|
var r = this;
|
|
771
|
-
if (!this.options.animation)
|
|
772
|
-
|
|
773
|
-
|
|
863
|
+
if (!this.options.animation) clearTimeout(t), typeof n == "function" && n();
|
|
864
|
+
else {
|
|
865
|
+
var i = !1, a = 0;
|
|
866
|
+
e.forEach(function(e) {
|
|
867
|
+
var t = 0, n = e.target, o = n.fromRect, s = z(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = St(n, !0);
|
|
868
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Mt(c, s) && !Mt(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = Vt(u, c, l, r.options)), Mt(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() {
|
|
869
|
+
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
870
|
+
}, t), n.thisAnimationDuration = t);
|
|
871
|
+
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
872
|
+
typeof n == "function" && n();
|
|
873
|
+
}, a) : typeof n == "function" && n(), e = [];
|
|
774
874
|
}
|
|
775
|
-
var i = !1, a = 0;
|
|
776
|
-
e.forEach(function(e) {
|
|
777
|
-
var t = 0, n = e.target, o = n.fromRect, s = z(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Et(n, !0);
|
|
778
|
-
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && It(c, s) && !It(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = Gt(u, c, l, r.options)), It(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() {
|
|
779
|
-
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
780
|
-
}, t), n.thisAnimationDuration = t);
|
|
781
|
-
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
782
|
-
typeof n == "function" && n();
|
|
783
|
-
}, a) : typeof n == "function" && n(), e = [];
|
|
784
875
|
},
|
|
785
876
|
animate: function(e, t, n, r) {
|
|
786
877
|
if (r) {
|
|
787
878
|
R(e, "transition", ""), R(e, "transform", "");
|
|
788
|
-
var i =
|
|
789
|
-
e.animatingX = !!s, e.animatingY = !!c, R(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy =
|
|
879
|
+
var i = St(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
880
|
+
e.animatingX = !!s, e.animatingY = !!c, R(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = Bt(e), R(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), R(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
790
881
|
R(e, "transition", ""), R(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
791
882
|
}, r);
|
|
792
883
|
}
|
|
793
884
|
}
|
|
794
885
|
};
|
|
795
886
|
}
|
|
796
|
-
function
|
|
887
|
+
function Bt(e) {
|
|
797
888
|
return e.offsetWidth;
|
|
798
889
|
}
|
|
799
|
-
function
|
|
890
|
+
function Vt(e, t, n, r) {
|
|
800
891
|
return Math.sqrt((t.top - e.top) ** 2 + (t.left - e.left) ** 2) / Math.sqrt((t.top - n.top) ** 2 + (t.left - n.left) ** 2) * r.animation;
|
|
801
892
|
}
|
|
802
|
-
var
|
|
893
|
+
var Ht = [], Ut = { initializeByDefault: !0 }, Wt = {
|
|
803
894
|
mount: function(e) {
|
|
804
|
-
for (var t in
|
|
805
|
-
|
|
895
|
+
for (var t in Ut) Ut.hasOwnProperty(t) && !(t in e) && (e[t] = Ut[t]);
|
|
896
|
+
Ht.forEach(function(t) {
|
|
806
897
|
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
807
|
-
}),
|
|
898
|
+
}), Ht.push(e);
|
|
808
899
|
},
|
|
809
900
|
pluginEvent: function(e, t, n) {
|
|
810
901
|
var r = this;
|
|
@@ -812,16 +903,16 @@ var Kt = [], qt = { initializeByDefault: !0 }, Jt = {
|
|
|
812
903
|
r.eventCanceled = !0;
|
|
813
904
|
};
|
|
814
905
|
var i = e + "Global";
|
|
815
|
-
|
|
816
|
-
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](
|
|
906
|
+
Ht.forEach(function(r) {
|
|
907
|
+
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](rt({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](rt({ sortable: t }, n)));
|
|
817
908
|
});
|
|
818
909
|
},
|
|
819
910
|
initializePlugins: function(e, t, n, r) {
|
|
820
|
-
for (var i in
|
|
911
|
+
for (var i in Ht.forEach(function(r) {
|
|
821
912
|
var i = r.pluginName;
|
|
822
|
-
if (
|
|
913
|
+
if (e.options[i] || r.initializeByDefault) {
|
|
823
914
|
var a = new r(e, t, e.options);
|
|
824
|
-
a.sortable = e, a.options = e.options, e[i] = a,
|
|
915
|
+
a.sortable = e, a.options = e.options, e[i] = a, tt(n, a.defaults);
|
|
825
916
|
}
|
|
826
917
|
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
827
918
|
var a = this.modifyOption(e, i, e.options[i]);
|
|
@@ -830,56 +921,56 @@ var Kt = [], qt = { initializeByDefault: !0 }, Jt = {
|
|
|
830
921
|
},
|
|
831
922
|
getEventProperties: function(e, t) {
|
|
832
923
|
var n = {};
|
|
833
|
-
return
|
|
834
|
-
typeof r.eventProperties == "function" &&
|
|
924
|
+
return Ht.forEach(function(r) {
|
|
925
|
+
typeof r.eventProperties == "function" && tt(n, r.eventProperties.call(t[r.pluginName], e));
|
|
835
926
|
}), n;
|
|
836
927
|
},
|
|
837
928
|
modifyOption: function(e, t, n) {
|
|
838
929
|
var r;
|
|
839
|
-
return
|
|
930
|
+
return Ht.forEach(function(i) {
|
|
840
931
|
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
841
932
|
}), r;
|
|
842
933
|
}
|
|
843
934
|
};
|
|
844
|
-
function
|
|
935
|
+
function Gt(e) {
|
|
845
936
|
var t = e.sortable, n = e.rootEl, r = e.name, i = e.targetEl, a = e.cloneEl, o = e.toEl, s = e.fromEl, c = e.oldIndex, l = e.newIndex, u = e.oldDraggableIndex, d = e.newDraggableIndex, f = e.originalEvent, p = e.putSortable, m = e.extraEventProperties;
|
|
846
937
|
if (t ||= n && n[V], t) {
|
|
847
938
|
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
848
|
-
window.CustomEvent && !
|
|
939
|
+
window.CustomEvent && !dt && !ft ? h = new CustomEvent(r, {
|
|
849
940
|
bubbles: !0,
|
|
850
941
|
cancelable: !0
|
|
851
942
|
}) : (h = document.createEvent("Event"), h.initEvent(r, !0, !0)), h.to = o || n, h.from = s || n, h.item = i || n, h.clone = a, h.oldIndex = c, h.newIndex = l, h.oldDraggableIndex = u, h.newDraggableIndex = d, h.originalEvent = f, h.pullMode = p ? p.lastPutMode : void 0;
|
|
852
|
-
var
|
|
853
|
-
for (var
|
|
943
|
+
var v = rt(rt({}, m), Wt.getEventProperties(r, t));
|
|
944
|
+
for (var y in v) h[y] = v[y];
|
|
854
945
|
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
855
946
|
}
|
|
856
947
|
}
|
|
857
|
-
var
|
|
858
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i =
|
|
859
|
-
|
|
948
|
+
var Kt = ["evt"], H = function(e, t) {
|
|
949
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = it(n, Kt);
|
|
950
|
+
Wt.pluginEvent.bind(Q)(e, t, rt({
|
|
860
951
|
dragEl: W,
|
|
861
952
|
parentEl: G,
|
|
862
953
|
ghostEl: K,
|
|
863
954
|
rootEl: q,
|
|
864
|
-
nextEl:
|
|
865
|
-
lastDownEl:
|
|
955
|
+
nextEl: qt,
|
|
956
|
+
lastDownEl: Jt,
|
|
866
957
|
cloneEl: J,
|
|
867
|
-
cloneHidden:
|
|
868
|
-
dragStarted:
|
|
958
|
+
cloneHidden: Yt,
|
|
959
|
+
dragStarted: un,
|
|
869
960
|
putSortable: X,
|
|
870
961
|
activeSortable: Q.active,
|
|
871
962
|
originalEvent: r,
|
|
872
|
-
oldIndex:
|
|
873
|
-
oldDraggableIndex:
|
|
963
|
+
oldIndex: Xt,
|
|
964
|
+
oldDraggableIndex: Zt,
|
|
874
965
|
newIndex: Y,
|
|
875
|
-
newDraggableIndex:
|
|
876
|
-
hideGhostForTarget:
|
|
877
|
-
unhideGhostForTarget:
|
|
966
|
+
newDraggableIndex: Qt,
|
|
967
|
+
hideGhostForTarget: On,
|
|
968
|
+
unhideGhostForTarget: kn,
|
|
878
969
|
cloneNowHidden: function() {
|
|
879
|
-
|
|
970
|
+
Yt = !0;
|
|
880
971
|
},
|
|
881
972
|
cloneNowShown: function() {
|
|
882
|
-
|
|
973
|
+
Yt = !1;
|
|
883
974
|
},
|
|
884
975
|
dispatchSortableEvent: function(e) {
|
|
885
976
|
U({
|
|
@@ -891,45 +982,45 @@ var Xt = ["evt"], H = function(e, t) {
|
|
|
891
982
|
}, i));
|
|
892
983
|
};
|
|
893
984
|
function U(e) {
|
|
894
|
-
|
|
985
|
+
Gt(rt({
|
|
895
986
|
putSortable: X,
|
|
896
987
|
cloneEl: J,
|
|
897
988
|
targetEl: W,
|
|
898
989
|
rootEl: q,
|
|
899
|
-
oldIndex:
|
|
900
|
-
oldDraggableIndex:
|
|
990
|
+
oldIndex: Xt,
|
|
991
|
+
oldDraggableIndex: Zt,
|
|
901
992
|
newIndex: Y,
|
|
902
|
-
newDraggableIndex:
|
|
993
|
+
newDraggableIndex: Qt
|
|
903
994
|
}, e));
|
|
904
995
|
}
|
|
905
|
-
var W, G, K, q,
|
|
906
|
-
if (
|
|
907
|
-
if (
|
|
996
|
+
var W, G, K, q, qt, Jt, J, Yt, Xt, Y, Zt, Qt, $t, X, en = !1, tn = !1, nn = [], rn, an, on, sn, cn, ln, un, dn, fn, pn = !1, mn = !1, hn, Z, gn = [], _n = !1, vn = [], yn = typeof document < "u", bn = ht, xn = ft || dt ? "cssFloat" : "float", Sn = yn && !gt && !ht && "draggable" in document.createElement("div"), Cn = function() {
|
|
997
|
+
if (yn) {
|
|
998
|
+
if (dt) return !1;
|
|
908
999
|
var e = document.createElement("x");
|
|
909
1000
|
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
910
1001
|
}
|
|
911
|
-
}(),
|
|
912
|
-
var n = R(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i =
|
|
1002
|
+
}(), wn = function(e, t) {
|
|
1003
|
+
var n = R(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = Et(e, 0, t), a = Et(e, 1, t), o = i && R(i), s = a && R(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + z(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + z(a).width;
|
|
913
1004
|
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
914
1005
|
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
915
1006
|
if (i && o.float && o.float !== "none") {
|
|
916
1007
|
var u = o.float === "left" ? "left" : "right";
|
|
917
1008
|
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
918
1009
|
}
|
|
919
|
-
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[
|
|
920
|
-
},
|
|
1010
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[xn] === "none" || a && n[xn] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
1011
|
+
}, Tn = function(e, t, n) {
|
|
921
1012
|
var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height;
|
|
922
1013
|
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
923
|
-
},
|
|
1014
|
+
}, En = function(e, t) {
|
|
924
1015
|
var n;
|
|
925
|
-
return
|
|
1016
|
+
return nn.some(function(r) {
|
|
926
1017
|
var i = r[V].options.emptyInsertThreshold;
|
|
927
|
-
if (
|
|
1018
|
+
if (i && !Dt(r)) {
|
|
928
1019
|
var a = z(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
929
1020
|
if (o && s) return n = r;
|
|
930
1021
|
}
|
|
931
1022
|
}), n;
|
|
932
|
-
},
|
|
1023
|
+
}, Dn = function(e) {
|
|
933
1024
|
function t(e, n) {
|
|
934
1025
|
return function(r, i, a, o) {
|
|
935
1026
|
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
@@ -942,31 +1033,31 @@ var W, G, K, q, Zt, Qt, J, $t, en, Y, tn, nn, rn, X, an = !1, on = !1, sn = [],
|
|
|
942
1033
|
};
|
|
943
1034
|
}
|
|
944
1035
|
var n = {}, r = e.group;
|
|
945
|
-
|
|
946
|
-
},
|
|
947
|
-
!
|
|
948
|
-
},
|
|
949
|
-
!
|
|
1036
|
+
r && ct(r) == "object" || (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n;
|
|
1037
|
+
}, On = function() {
|
|
1038
|
+
!Cn && K && R(K, "display", "none");
|
|
1039
|
+
}, kn = function() {
|
|
1040
|
+
!Cn && K && R(K, "display", "");
|
|
950
1041
|
};
|
|
951
|
-
|
|
952
|
-
if (
|
|
1042
|
+
yn && !gt && document.addEventListener("click", function(e) {
|
|
1043
|
+
if (tn) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), tn = !1, !1;
|
|
953
1044
|
}, !0);
|
|
954
|
-
var
|
|
1045
|
+
var An = function(e) {
|
|
955
1046
|
if (W) {
|
|
956
1047
|
e = e.touches ? e.touches[0] : e;
|
|
957
|
-
var t =
|
|
1048
|
+
var t = En(e.clientX, e.clientY);
|
|
958
1049
|
if (t) {
|
|
959
1050
|
var n = {};
|
|
960
1051
|
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
961
1052
|
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[V]._onDragOver(n);
|
|
962
1053
|
}
|
|
963
1054
|
}
|
|
964
|
-
},
|
|
1055
|
+
}, jn = function(e) {
|
|
965
1056
|
W && W.parentNode[V]._isOutsideThisEl(e.target);
|
|
966
1057
|
};
|
|
967
1058
|
function Q(e, t) {
|
|
968
1059
|
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
969
|
-
this.el = e, this.options = t =
|
|
1060
|
+
this.el = e, this.options = t = tt({}, t), e[V] = this;
|
|
970
1061
|
var n = {
|
|
971
1062
|
group: null,
|
|
972
1063
|
sort: !0,
|
|
@@ -979,7 +1070,7 @@ function Q(e, t) {
|
|
|
979
1070
|
invertedSwapThreshold: null,
|
|
980
1071
|
removeCloneOnHide: !0,
|
|
981
1072
|
direction: function() {
|
|
982
|
-
return
|
|
1073
|
+
return wn(e, this.options);
|
|
983
1074
|
},
|
|
984
1075
|
ghostClass: "sortable-ghost",
|
|
985
1076
|
chosenClass: "sortable-chosen",
|
|
@@ -1006,17 +1097,17 @@ function Q(e, t) {
|
|
|
1006
1097
|
x: 0,
|
|
1007
1098
|
y: 0
|
|
1008
1099
|
},
|
|
1009
|
-
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && (!
|
|
1100
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && (!mt || ht),
|
|
1010
1101
|
emptyInsertThreshold: 5
|
|
1011
1102
|
};
|
|
1012
|
-
for (var r in
|
|
1013
|
-
for (var i in
|
|
1014
|
-
this.nativeDraggable = !t.forceFallback &&
|
|
1103
|
+
for (var r in Wt.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
1104
|
+
for (var i in Dn(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
1105
|
+
this.nativeDraggable = !t.forceFallback && Sn, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? F(e, "pointerdown", this._onTapStart) : (F(e, "mousedown", this._onTapStart), F(e, "touchstart", this._onTapStart)), this.nativeDraggable && (F(e, "dragover", this), F(e, "dragenter", this)), nn.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), tt(this, zt());
|
|
1015
1106
|
}
|
|
1016
1107
|
Q.prototype = {
|
|
1017
1108
|
constructor: Q,
|
|
1018
1109
|
_isOutsideThisEl: function(e) {
|
|
1019
|
-
!this.el.contains(e) && e !== this.el && (
|
|
1110
|
+
!this.el.contains(e) && e !== this.el && (dn = null);
|
|
1020
1111
|
},
|
|
1021
1112
|
_getDirection: function(e, t) {
|
|
1022
1113
|
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, W) : this.options.direction;
|
|
@@ -1024,8 +1115,8 @@ Q.prototype = {
|
|
|
1024
1115
|
_onTapStart: function(e) {
|
|
1025
1116
|
if (e.cancelable) {
|
|
1026
1117
|
var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
|
|
1027
|
-
if (
|
|
1028
|
-
if (
|
|
1118
|
+
if (Vn(n), !W && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && mt && s && s.tagName.toUpperCase() === "SELECT") && (s = bt(s, r.draggable, n, !1), !(s && s.animated) && Jt !== s)) {
|
|
1119
|
+
if (Xt = B(s), Zt = B(s, r.draggable), typeof l == "function") {
|
|
1029
1120
|
if (l.call(this, e, s, this)) {
|
|
1030
1121
|
U({
|
|
1031
1122
|
sortable: t,
|
|
@@ -1038,7 +1129,7 @@ Q.prototype = {
|
|
|
1038
1129
|
return;
|
|
1039
1130
|
}
|
|
1040
1131
|
} else if (l && (l = l.split(",").some(function(r) {
|
|
1041
|
-
if (r =
|
|
1132
|
+
if (r = bt(c, r.trim(), n, !1), r) return U({
|
|
1042
1133
|
sortable: t,
|
|
1043
1134
|
rootEl: r,
|
|
1044
1135
|
name: "filter",
|
|
@@ -1050,7 +1141,7 @@ Q.prototype = {
|
|
|
1050
1141
|
i && e.preventDefault();
|
|
1051
1142
|
return;
|
|
1052
1143
|
}
|
|
1053
|
-
r.handle
|
|
1144
|
+
(!r.handle || bt(c, r.handle, n, !1)) && this._prepareDragStart(e, o, s);
|
|
1054
1145
|
}
|
|
1055
1146
|
}
|
|
1056
1147
|
},
|
|
@@ -1058,23 +1149,19 @@ Q.prototype = {
|
|
|
1058
1149
|
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
1059
1150
|
if (n && !W && n.parentNode === i) {
|
|
1060
1151
|
var c = z(n);
|
|
1061
|
-
if (q = i, W = n, G = W.parentNode,
|
|
1152
|
+
if (q = i, W = n, G = W.parentNode, qt = W.nextSibling, Jt = n, $t = a.group, Q.dragged = W, rn = {
|
|
1062
1153
|
target: W,
|
|
1063
1154
|
clientX: (t || e).clientX,
|
|
1064
1155
|
clientY: (t || e).clientY
|
|
1065
|
-
},
|
|
1066
|
-
|
|
1067
|
-
r._onDrop();
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
r._disableDelayedDragEvents(), !_t && r.nativeDraggable && (W.draggable = !0), r._triggerDragStart(e, t), U({
|
|
1156
|
+
}, cn = rn.clientX - c.left, ln = rn.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, W.style["will-change"] = "all", s = function() {
|
|
1157
|
+
H("delayEnded", r, { evt: e }), Q.eventCanceled ? r._onDrop() : (r._disableDelayedDragEvents(), !pt && r.nativeDraggable && (W.draggable = !0), r._triggerDragStart(e, t), U({
|
|
1071
1158
|
sortable: r,
|
|
1072
1159
|
name: "choose",
|
|
1073
1160
|
originalEvent: e
|
|
1074
|
-
}), L(W, a.chosenClass, !0);
|
|
1161
|
+
}), L(W, a.chosenClass, !0));
|
|
1075
1162
|
}, a.ignore.split(",").forEach(function(e) {
|
|
1076
|
-
|
|
1077
|
-
}), F(o, "dragover",
|
|
1163
|
+
Ct(W, e.trim(), Pn);
|
|
1164
|
+
}), F(o, "dragover", An), F(o, "mousemove", An), F(o, "touchmove", An), a.supportPointer ? (F(o, "pointerup", r._onDrop), !this.nativeDraggable && F(o, "pointercancel", r._onDrop)) : (F(o, "mouseup", r._onDrop), F(o, "touchend", r._onDrop), F(o, "touchcancel", r._onDrop)), pt && this.nativeDraggable && (this.options.touchStartThreshold = 4, W.draggable = !0), H("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(ft || dt))) {
|
|
1078
1165
|
if (Q.eventCanceled) {
|
|
1079
1166
|
this._onDrop();
|
|
1080
1167
|
return;
|
|
@@ -1088,7 +1175,7 @@ Q.prototype = {
|
|
|
1088
1175
|
Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
1089
1176
|
},
|
|
1090
1177
|
_disableDelayedDrag: function() {
|
|
1091
|
-
W &&
|
|
1178
|
+
W && Pn(W), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
1092
1179
|
},
|
|
1093
1180
|
_disableDelayedDragEvents: function() {
|
|
1094
1181
|
var e = this.el.ownerDocument;
|
|
@@ -1097,14 +1184,14 @@ Q.prototype = {
|
|
|
1097
1184
|
_triggerDragStart: function(e, t) {
|
|
1098
1185
|
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? F(document, "pointermove", this._onTouchMove) : t ? F(document, "touchmove", this._onTouchMove) : F(document, "mousemove", this._onTouchMove) : (F(W, "dragend", this), F(q, "dragstart", this._onDragStart));
|
|
1099
1186
|
try {
|
|
1100
|
-
document.selection ?
|
|
1187
|
+
document.selection ? Hn(function() {
|
|
1101
1188
|
document.selection.empty();
|
|
1102
1189
|
}) : window.getSelection().removeAllRanges();
|
|
1103
1190
|
} catch {}
|
|
1104
1191
|
},
|
|
1105
1192
|
_dragStarted: function(e, t) {
|
|
1106
|
-
if (
|
|
1107
|
-
H("dragStarted", this, { evt: t }), this.nativeDraggable && F(document, "dragover",
|
|
1193
|
+
if (en = !1, q && W) {
|
|
1194
|
+
H("dragStarted", this, { evt: t }), this.nativeDraggable && F(document, "dragover", jn);
|
|
1108
1195
|
var n = this.options;
|
|
1109
1196
|
!e && L(W, n.dragClass, !1), L(W, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), U({
|
|
1110
1197
|
sortable: this,
|
|
@@ -1114,33 +1201,33 @@ Q.prototype = {
|
|
|
1114
1201
|
} else this._nulling();
|
|
1115
1202
|
},
|
|
1116
1203
|
_emulateDragOver: function() {
|
|
1117
|
-
if (
|
|
1118
|
-
this._lastX =
|
|
1119
|
-
for (var e = document.elementFromPoint(
|
|
1204
|
+
if (an) {
|
|
1205
|
+
this._lastX = an.clientX, this._lastY = an.clientY, On();
|
|
1206
|
+
for (var e = document.elementFromPoint(an.clientX, an.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(an.clientX, an.clientY), e !== t);) t = e;
|
|
1120
1207
|
if (W.parentNode[V]._isOutsideThisEl(e), t) do {
|
|
1121
1208
|
if (t[V]) {
|
|
1122
1209
|
var n = void 0;
|
|
1123
1210
|
if (n = t[V]._onDragOver({
|
|
1124
|
-
clientX:
|
|
1125
|
-
clientY:
|
|
1211
|
+
clientX: an.clientX,
|
|
1212
|
+
clientY: an.clientY,
|
|
1126
1213
|
target: e,
|
|
1127
1214
|
rootEl: t
|
|
1128
1215
|
}), n && !this.options.dragoverBubble) break;
|
|
1129
1216
|
}
|
|
1130
1217
|
e = t;
|
|
1131
|
-
} while (t =
|
|
1132
|
-
|
|
1218
|
+
} while (t = yt(t));
|
|
1219
|
+
kn();
|
|
1133
1220
|
}
|
|
1134
1221
|
},
|
|
1135
1222
|
_onTouchMove: function(e) {
|
|
1136
|
-
if (
|
|
1137
|
-
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = K &&
|
|
1138
|
-
if (!Q.active && !
|
|
1223
|
+
if (rn) {
|
|
1224
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = K && St(K, !0), o = K && a && a.a, s = K && a && a.d, c = bn && Z && Ot(Z), l = (i.clientX - rn.clientX + r.x) / (o || 1) + (c ? c[0] - gn[0] : 0) / (o || 1), u = (i.clientY - rn.clientY + r.y) / (s || 1) + (c ? c[1] - gn[1] : 0) / (s || 1);
|
|
1225
|
+
if (!Q.active && !en) {
|
|
1139
1226
|
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
1140
1227
|
this._onDragStart(e, !0);
|
|
1141
1228
|
}
|
|
1142
1229
|
if (K) {
|
|
1143
|
-
a ? (a.e += l - (
|
|
1230
|
+
a ? (a.e += l - (on || 0), a.f += u - (sn || 0)) : a = {
|
|
1144
1231
|
a: 1,
|
|
1145
1232
|
b: 0,
|
|
1146
1233
|
c: 0,
|
|
@@ -1149,39 +1236,35 @@ Q.prototype = {
|
|
|
1149
1236
|
f: u
|
|
1150
1237
|
};
|
|
1151
1238
|
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
1152
|
-
R(K, "webkitTransform", d), R(K, "mozTransform", d), R(K, "msTransform", d), R(K, "transform", d),
|
|
1239
|
+
R(K, "webkitTransform", d), R(K, "mozTransform", d), R(K, "msTransform", d), R(K, "transform", d), on = l, sn = u, an = i;
|
|
1153
1240
|
}
|
|
1154
1241
|
e.cancelable && e.preventDefault();
|
|
1155
1242
|
}
|
|
1156
1243
|
},
|
|
1157
1244
|
_appendGhost: function() {
|
|
1158
1245
|
if (!K) {
|
|
1159
|
-
var e = this.options.fallbackOnBody ? document.body : q, t = z(W, !0,
|
|
1160
|
-
if (
|
|
1246
|
+
var e = this.options.fallbackOnBody ? document.body : q, t = z(W, !0, bn, !0, e), n = this.options;
|
|
1247
|
+
if (bn) {
|
|
1161
1248
|
for (Z = e; R(Z, "position") === "static" && R(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
1162
|
-
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z =
|
|
1249
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = wt()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = wt(), gn = Ot(Z);
|
|
1163
1250
|
}
|
|
1164
|
-
K = W.cloneNode(!0), L(K, n.ghostClass, !1), L(K, n.fallbackClass, !0), L(K, n.dragClass, !0), R(K, "transition", ""), R(K, "transform", ""), R(K, "box-sizing", "border-box"), R(K, "margin", 0), R(K, "top", t.top), R(K, "left", t.left), R(K, "width", t.width), R(K, "height", t.height), R(K, "opacity", "0.8"), R(K, "position",
|
|
1251
|
+
K = W.cloneNode(!0), L(K, n.ghostClass, !1), L(K, n.fallbackClass, !0), L(K, n.dragClass, !0), R(K, "transition", ""), R(K, "transform", ""), R(K, "box-sizing", "border-box"), R(K, "margin", 0), R(K, "top", t.top), R(K, "left", t.left), R(K, "width", t.width), R(K, "height", t.height), R(K, "opacity", "0.8"), R(K, "position", bn ? "absolute" : "fixed"), R(K, "zIndex", "100000"), R(K, "pointerEvents", "none"), Q.ghost = K, e.appendChild(K), R(K, "transform-origin", cn / parseInt(K.style.width) * 100 + "% " + ln / parseInt(K.style.height) * 100 + "%");
|
|
1165
1252
|
}
|
|
1166
1253
|
},
|
|
1167
1254
|
_onDragStart: function(e, t) {
|
|
1168
1255
|
var n = this, r = e.dataTransfer, i = n.options;
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
|
-
H("setupClone", this), Q.eventCanceled || (J = Vt(W), J.removeAttribute("id"), J.draggable = !1, J.style["will-change"] = "", this._hideClone(), L(J, this.options.chosenClass, !1), Q.clone = J), n.cloneId = Kn(function() {
|
|
1174
|
-
H("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || q.insertBefore(J, W), n._hideClone(), U({
|
|
1256
|
+
H("dragStart", this, { evt: e }), Q.eventCanceled ? this._onDrop() : (H("setupClone", this), Q.eventCanceled || (J = Lt(W), J.removeAttribute("id"), J.draggable = !1, J.style["will-change"] = "", this._hideClone(), L(J, this.options.chosenClass, !1), Q.clone = J), n.cloneId = Hn(function() {
|
|
1257
|
+
H("clone", n), Q.eventCanceled || (n.options.removeCloneOnHide || q.insertBefore(J, W), n._hideClone(), U({
|
|
1175
1258
|
sortable: n,
|
|
1176
1259
|
name: "clone"
|
|
1177
1260
|
}));
|
|
1178
|
-
}), !t && L(W, i.dragClass, !0), t ? (
|
|
1261
|
+
}), !t && L(W, i.dragClass, !0), t ? (tn = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (I(document, "mouseup", n._onDrop), I(document, "touchend", n._onDrop), I(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, W)), F(document, "drop", n), R(W, "transform", "translateZ(0)")), en = !0, n._dragStartId = Hn(n._dragStarted.bind(n, t, e)), F(document, "selectstart", n), un = !0, window.getSelection().removeAllRanges(), mt && R(document.body, "user-select", "none"));
|
|
1179
1262
|
},
|
|
1180
1263
|
_onDragOver: function(e) {
|
|
1181
|
-
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l =
|
|
1182
|
-
if (
|
|
1264
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = $t === s, u = o.sort, d = X || c, f, p = this, m = !1;
|
|
1265
|
+
if (_n) return;
|
|
1183
1266
|
function h(o, s) {
|
|
1184
|
-
H(o, p,
|
|
1267
|
+
H(o, p, rt({
|
|
1185
1268
|
evt: e,
|
|
1186
1269
|
isOwner: l,
|
|
1187
1270
|
axis: f ? "vertical" : "horizontal",
|
|
@@ -1193,9 +1276,9 @@ Q.prototype = {
|
|
|
1193
1276
|
target: n,
|
|
1194
1277
|
completed: _,
|
|
1195
1278
|
onMove: function(n, i) {
|
|
1196
|
-
return
|
|
1279
|
+
return Nn(q, t, W, r, n, z(n), e, i);
|
|
1197
1280
|
},
|
|
1198
|
-
changed:
|
|
1281
|
+
changed: v
|
|
1199
1282
|
}, s));
|
|
1200
1283
|
}
|
|
1201
1284
|
function g() {
|
|
@@ -1204,48 +1287,48 @@ Q.prototype = {
|
|
|
1204
1287
|
function _(r) {
|
|
1205
1288
|
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (L(W, X ? X.options.ghostClass : c.options.ghostClass, !1), L(W, o.ghostClass, !0)), X !== p && p !== Q.active ? X = p : p === Q.active && X && (X = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
1206
1289
|
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
1207
|
-
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === W && !W.animated || n === t && !n.animated) && (
|
|
1290
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === W && !W.animated || n === t && !n.animated) && (dn = null), !o.dragoverBubble && !e.rootEl && n !== document && (W.parentNode[V]._isOutsideThisEl(e.target), !r && An(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
1208
1291
|
}
|
|
1209
|
-
function
|
|
1210
|
-
Y = B(W),
|
|
1292
|
+
function v() {
|
|
1293
|
+
Y = B(W), Qt = B(W, o.draggable), U({
|
|
1211
1294
|
sortable: p,
|
|
1212
1295
|
name: "change",
|
|
1213
1296
|
toEl: t,
|
|
1214
1297
|
newIndex: Y,
|
|
1215
|
-
newDraggableIndex:
|
|
1298
|
+
newDraggableIndex: Qt,
|
|
1216
1299
|
originalEvent: e
|
|
1217
1300
|
});
|
|
1218
1301
|
}
|
|
1219
|
-
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n =
|
|
1302
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = bt(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
1220
1303
|
if (W.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
1221
|
-
if (
|
|
1304
|
+
if (tn = !1, c && !o.disabled && (l ? u || (a = G !== q) : X === this || (this.lastPutMode = $t.checkPull(this, c, W, e)) && s.checkPut(this, c, W, e))) {
|
|
1222
1305
|
if (f = this._getDirection(e, n) === "vertical", r = z(W), h("dragOverValid"), Q.eventCanceled) return m;
|
|
1223
|
-
if (a) return G = q, g(), this._hideClone(), h("revert"), Q.eventCanceled || (
|
|
1224
|
-
var
|
|
1225
|
-
if (!
|
|
1226
|
-
if (v === W) return _(!1);
|
|
1227
|
-
if (v && t === e.target && (n = v), n && (i = z(n)), Ln(q, t, W, r, n, i, e, !!n) !== !1) return g(), v && v.nextSibling ? t.insertBefore(W, v.nextSibling) : t.appendChild(W), G = t, ee(), _(!0);
|
|
1228
|
-
} else if (v && Bn(e, f, this)) {
|
|
1229
|
-
var y = At(t, 0, o, !0);
|
|
1306
|
+
if (a) return G = q, g(), this._hideClone(), h("revert"), Q.eventCanceled || (qt ? q.insertBefore(W, qt) : q.appendChild(W)), _(!0);
|
|
1307
|
+
var y = Dt(t, o.draggable);
|
|
1308
|
+
if (!y || Ln(e, f, this) && !y.animated) {
|
|
1230
1309
|
if (y === W) return _(!1);
|
|
1231
|
-
if (n = y, i = z(n),
|
|
1310
|
+
if (y && t === e.target && (n = y), n && (i = z(n)), Nn(q, t, W, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(W, y.nextSibling) : t.appendChild(W), G = t, v(), _(!0);
|
|
1311
|
+
} else if (y && In(e, f, this)) {
|
|
1312
|
+
var b = Et(t, 0, o, !0);
|
|
1313
|
+
if (b === W) return _(!1);
|
|
1314
|
+
if (n = b, i = z(n), Nn(q, t, W, r, n, i, e, !1) !== !1) return g(), t.insertBefore(W, b), G = t, v(), _(!0);
|
|
1232
1315
|
} else if (n.parentNode === t) {
|
|
1233
1316
|
i = z(n);
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
var
|
|
1237
|
-
if (
|
|
1238
|
-
var
|
|
1317
|
+
var x = 0, S, C = W.parentNode !== t, w = !Tn(W.animated && W.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = Tt(n, "top", "top") || Tt(W, "top", "top"), ee = E ? E.scrollTop : void 0;
|
|
1318
|
+
dn !== n && (S = i[T], pn = !1, mn = !w && o.invertSwap || C), x = Rn(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, mn, dn === n);
|
|
1319
|
+
var D;
|
|
1320
|
+
if (x !== 0) {
|
|
1321
|
+
var O = B(W);
|
|
1239
1322
|
do
|
|
1240
|
-
|
|
1241
|
-
while (
|
|
1323
|
+
O -= x, D = G.children[O];
|
|
1324
|
+
while (D && (R(D, "display") === "none" || D === K));
|
|
1242
1325
|
}
|
|
1243
|
-
if (
|
|
1244
|
-
|
|
1245
|
-
var
|
|
1246
|
-
|
|
1247
|
-
var
|
|
1248
|
-
if (
|
|
1326
|
+
if (x === 0 || D === n) return _(!1);
|
|
1327
|
+
dn = n, fn = x;
|
|
1328
|
+
var k = n.nextElementSibling, A = !1;
|
|
1329
|
+
A = x === 1;
|
|
1330
|
+
var j = Nn(q, t, W, r, n, i, e, A);
|
|
1331
|
+
if (j !== !1) return (j === 1 || j === -1) && (A = j === 1), _n = !0, setTimeout(Fn, 30), g(), A && !k ? t.appendChild(W) : n.parentNode.insertBefore(W, A ? k : n), E && It(E, 0, ee - E.scrollTop), G = W.parentNode, S !== void 0 && !mn && (hn = Math.abs(S - z(n)[T])), v(), _(!0);
|
|
1249
1332
|
}
|
|
1250
1333
|
if (t.contains(W)) return _(!1);
|
|
1251
1334
|
}
|
|
@@ -1253,7 +1336,7 @@ Q.prototype = {
|
|
|
1253
1336
|
},
|
|
1254
1337
|
_ignoreWhileAnimating: null,
|
|
1255
1338
|
_offMoveEvents: function() {
|
|
1256
|
-
I(document, "mousemove", this._onTouchMove), I(document, "touchmove", this._onTouchMove), I(document, "pointermove", this._onTouchMove), I(document, "dragover",
|
|
1339
|
+
I(document, "mousemove", this._onTouchMove), I(document, "touchmove", this._onTouchMove), I(document, "pointermove", this._onTouchMove), I(document, "dragover", An), I(document, "mousemove", An), I(document, "touchmove", An);
|
|
1257
1340
|
},
|
|
1258
1341
|
_offUpEvents: function() {
|
|
1259
1342
|
var e = this.el.ownerDocument;
|
|
@@ -1261,18 +1344,14 @@ Q.prototype = {
|
|
|
1261
1344
|
},
|
|
1262
1345
|
_onDrop: function(e) {
|
|
1263
1346
|
var t = this.el, n = this.options;
|
|
1264
|
-
|
|
1265
|
-
this._nulling();
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
an = !1, vn = !1, _n = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), qn(this.cloneId), qn(this._dragStartId), this.nativeDraggable && (I(document, "drop", this), I(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), vt && R(document.body, "user-select", ""), R(W, "transform", ""), e && (mn && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), K && K.parentNode && K.parentNode.removeChild(K), (q === G || X && X.lastPutMode !== "clone") && J && J.parentNode && J.parentNode.removeChild(J), W && (this.nativeDraggable && I(W, "dragend", this), Rn(W), W.style["will-change"] = "", mn && !an && L(W, X ? X.options.ghostClass : this.options.ghostClass, !1), L(W, this.options.chosenClass, !1), U({
|
|
1347
|
+
Y = B(W), Qt = B(W, n.draggable), H("drop", this, { evt: e }), G = W && W.parentNode, Y = B(W), Qt = B(W, n.draggable), Q.eventCanceled || (en = !1, mn = !1, pn = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Un(this.cloneId), Un(this._dragStartId), this.nativeDraggable && (I(document, "drop", this), I(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), mt && R(document.body, "user-select", ""), R(W, "transform", ""), e && (un && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), K && K.parentNode && K.parentNode.removeChild(K), (q === G || X && X.lastPutMode !== "clone") && J && J.parentNode && J.parentNode.removeChild(J), W && (this.nativeDraggable && I(W, "dragend", this), Pn(W), W.style["will-change"] = "", un && !en && L(W, X ? X.options.ghostClass : this.options.ghostClass, !1), L(W, this.options.chosenClass, !1), U({
|
|
1269
1348
|
sortable: this,
|
|
1270
1349
|
name: "unchoose",
|
|
1271
1350
|
toEl: G,
|
|
1272
1351
|
newIndex: null,
|
|
1273
1352
|
newDraggableIndex: null,
|
|
1274
1353
|
originalEvent: e
|
|
1275
|
-
}), q === G ? Y !==
|
|
1354
|
+
}), q === G ? Y !== Xt && Y >= 0 && (U({
|
|
1276
1355
|
sortable: this,
|
|
1277
1356
|
name: "update",
|
|
1278
1357
|
toEl: G,
|
|
@@ -1304,19 +1383,19 @@ Q.prototype = {
|
|
|
1304
1383
|
name: "sort",
|
|
1305
1384
|
toEl: G,
|
|
1306
1385
|
originalEvent: e
|
|
1307
|
-
})), X && X.save()), Q.active && ((Y == null || Y === -1) && (Y =
|
|
1386
|
+
})), X && X.save()), Q.active && ((Y == null || Y === -1) && (Y = Xt, Qt = Zt), U({
|
|
1308
1387
|
sortable: this,
|
|
1309
1388
|
name: "end",
|
|
1310
1389
|
toEl: G,
|
|
1311
1390
|
originalEvent: e
|
|
1312
|
-
}), this.save()))), this._nulling();
|
|
1391
|
+
}), this.save())))), this._nulling();
|
|
1313
1392
|
},
|
|
1314
1393
|
_nulling: function() {
|
|
1315
|
-
H("nulling", this), q = W = G = K =
|
|
1394
|
+
H("nulling", this), q = W = G = K = qt = J = Jt = Yt = rn = an = un = Y = Qt = Xt = Zt = dn = fn = X = $t = Q.dragged = Q.ghost = Q.clone = Q.active = null;
|
|
1316
1395
|
var e = this.el;
|
|
1317
|
-
|
|
1396
|
+
vn.forEach(function(t) {
|
|
1318
1397
|
e.contains(t) && (t.checked = !0);
|
|
1319
|
-
}),
|
|
1398
|
+
}), vn.length = on = sn = 0;
|
|
1320
1399
|
},
|
|
1321
1400
|
handleEvent: function(e) {
|
|
1322
1401
|
switch (e.type) {
|
|
@@ -1326,20 +1405,20 @@ Q.prototype = {
|
|
|
1326
1405
|
break;
|
|
1327
1406
|
case "dragenter":
|
|
1328
1407
|
case "dragover":
|
|
1329
|
-
W && (this._onDragOver(e),
|
|
1408
|
+
W && (this._onDragOver(e), Mn(e));
|
|
1330
1409
|
break;
|
|
1331
1410
|
case "selectstart": e.preventDefault();
|
|
1332
1411
|
}
|
|
1333
1412
|
},
|
|
1334
1413
|
toArray: function() {
|
|
1335
|
-
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r],
|
|
1414
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], bt(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || Bn(t));
|
|
1336
1415
|
return e;
|
|
1337
1416
|
},
|
|
1338
1417
|
sort: function(e, t) {
|
|
1339
1418
|
var n = {}, r = this.el;
|
|
1340
1419
|
this.toArray().forEach(function(e, t) {
|
|
1341
1420
|
var i = r.children[t];
|
|
1342
|
-
|
|
1421
|
+
bt(i, this.options.draggable, r, !1) && (n[e] = i);
|
|
1343
1422
|
}, this), t && this.captureAnimationState(), e.forEach(function(e) {
|
|
1344
1423
|
n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
|
|
1345
1424
|
}), t && this.animateAll();
|
|
@@ -1349,112 +1428,109 @@ Q.prototype = {
|
|
|
1349
1428
|
e && e.set && e.set(this);
|
|
1350
1429
|
},
|
|
1351
1430
|
closest: function(e, t) {
|
|
1352
|
-
return
|
|
1431
|
+
return bt(e, t || this.options.draggable, this.el, !1);
|
|
1353
1432
|
},
|
|
1354
1433
|
option: function(e, t) {
|
|
1355
1434
|
var n = this.options;
|
|
1356
1435
|
if (t === void 0) return n[e];
|
|
1357
|
-
var r =
|
|
1358
|
-
n[e] = r === void 0 ? t : r, e === "group" &&
|
|
1436
|
+
var r = Wt.modifyOption(this, e, t);
|
|
1437
|
+
n[e] = r === void 0 ? t : r, e === "group" && Dn(n);
|
|
1359
1438
|
},
|
|
1360
1439
|
destroy: function() {
|
|
1361
1440
|
H("destroy", this);
|
|
1362
1441
|
var e = this.el;
|
|
1363
1442
|
e[V] = null, I(e, "mousedown", this._onTapStart), I(e, "touchstart", this._onTapStart), I(e, "pointerdown", this._onTapStart), this.nativeDraggable && (I(e, "dragover", this), I(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
1364
1443
|
e.removeAttribute("draggable");
|
|
1365
|
-
}), this._onDrop(), this._disableDelayedDragEvents(),
|
|
1444
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), nn.splice(nn.indexOf(this.el), 1), this.el = e = null;
|
|
1366
1445
|
},
|
|
1367
1446
|
_hideClone: function() {
|
|
1368
|
-
if (
|
|
1447
|
+
if (!Yt) {
|
|
1369
1448
|
if (H("hideClone", this), Q.eventCanceled) return;
|
|
1370
|
-
R(J, "display", "none"), this.options.removeCloneOnHide && J.parentNode && J.parentNode.removeChild(J),
|
|
1449
|
+
R(J, "display", "none"), this.options.removeCloneOnHide && J.parentNode && J.parentNode.removeChild(J), Yt = !0;
|
|
1371
1450
|
}
|
|
1372
1451
|
},
|
|
1373
1452
|
_showClone: function(e) {
|
|
1374
|
-
if (e.lastPutMode !== "clone")
|
|
1375
|
-
|
|
1376
|
-
return;
|
|
1377
|
-
}
|
|
1378
|
-
if ($t) {
|
|
1453
|
+
if (e.lastPutMode !== "clone") this._hideClone();
|
|
1454
|
+
else if (Yt) {
|
|
1379
1455
|
if (H("showClone", this), Q.eventCanceled) return;
|
|
1380
|
-
W.parentNode == q && !this.options.group.revertClone ? q.insertBefore(J, W) :
|
|
1456
|
+
W.parentNode == q && !this.options.group.revertClone ? q.insertBefore(J, W) : qt ? q.insertBefore(J, qt) : q.appendChild(J), this.options.group.revertClone && this.animate(W, J), R(J, "display", ""), Yt = !1;
|
|
1381
1457
|
}
|
|
1382
1458
|
}
|
|
1383
1459
|
};
|
|
1384
|
-
function
|
|
1460
|
+
function Mn(e) {
|
|
1385
1461
|
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
1386
1462
|
}
|
|
1387
|
-
function
|
|
1463
|
+
function Nn(e, t, n, r, i, a, o, s) {
|
|
1388
1464
|
var c, l = e[V], u = l.options.onMove, d;
|
|
1389
|
-
return window.CustomEvent && !
|
|
1465
|
+
return window.CustomEvent && !dt && !ft ? c = new CustomEvent("move", {
|
|
1390
1466
|
bubbles: !0,
|
|
1391
1467
|
cancelable: !0
|
|
1392
1468
|
}) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || z(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
1393
1469
|
}
|
|
1394
|
-
function
|
|
1470
|
+
function Pn(e) {
|
|
1395
1471
|
e.draggable = !1;
|
|
1396
1472
|
}
|
|
1397
|
-
function
|
|
1398
|
-
|
|
1473
|
+
function Fn() {
|
|
1474
|
+
_n = !1;
|
|
1399
1475
|
}
|
|
1400
|
-
function
|
|
1401
|
-
var r = z(
|
|
1476
|
+
function In(e, t, n) {
|
|
1477
|
+
var r = z(Et(n.el, 0, n.options, !0)), i = Rt(n.el, n.options, K), a = 10;
|
|
1402
1478
|
return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left;
|
|
1403
1479
|
}
|
|
1404
|
-
function
|
|
1405
|
-
var r = z(
|
|
1480
|
+
function Ln(e, t, n) {
|
|
1481
|
+
var r = z(Dt(n.el, n.options.draggable)), i = Rt(n.el, n.options, K), a = 10;
|
|
1406
1482
|
return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top;
|
|
1407
1483
|
}
|
|
1408
|
-
function
|
|
1484
|
+
function Rn(e, t, n, r, i, a, o, s) {
|
|
1409
1485
|
var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1;
|
|
1410
1486
|
if (!o) {
|
|
1411
|
-
if (s &&
|
|
1412
|
-
if (!
|
|
1413
|
-
else if (
|
|
1414
|
-
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return
|
|
1487
|
+
if (s && hn < l * i) {
|
|
1488
|
+
if (!pn && (fn === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (pn = !0), pn) f = !0;
|
|
1489
|
+
else if (fn === 1 ? c < u + hn : c > d - hn) return -fn;
|
|
1490
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return zn(t);
|
|
1415
1491
|
}
|
|
1416
1492
|
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
1417
1493
|
}
|
|
1418
|
-
function
|
|
1494
|
+
function zn(e) {
|
|
1419
1495
|
return B(W) < B(e) ? 1 : -1;
|
|
1420
1496
|
}
|
|
1421
|
-
function
|
|
1497
|
+
function Bn(e) {
|
|
1422
1498
|
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
1423
1499
|
return r.toString(36);
|
|
1424
1500
|
}
|
|
1425
|
-
function
|
|
1426
|
-
|
|
1501
|
+
function Vn(e) {
|
|
1502
|
+
vn.length = 0;
|
|
1427
1503
|
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
1428
1504
|
var r = t[n];
|
|
1429
|
-
r.checked &&
|
|
1505
|
+
r.checked && vn.push(r);
|
|
1430
1506
|
}
|
|
1431
1507
|
}
|
|
1432
|
-
function
|
|
1508
|
+
function Hn(e) {
|
|
1433
1509
|
return setTimeout(e, 0);
|
|
1434
1510
|
}
|
|
1435
|
-
function
|
|
1511
|
+
function Un(e) {
|
|
1436
1512
|
return clearTimeout(e);
|
|
1437
1513
|
}
|
|
1438
|
-
|
|
1439
|
-
(Q.active ||
|
|
1514
|
+
yn && F(document, "touchmove", function(e) {
|
|
1515
|
+
(Q.active || en) && e.cancelable && e.preventDefault();
|
|
1440
1516
|
}), Q.utils = {
|
|
1441
1517
|
on: F,
|
|
1442
1518
|
off: I,
|
|
1443
1519
|
css: R,
|
|
1444
|
-
find:
|
|
1520
|
+
find: Ct,
|
|
1445
1521
|
is: function(e, t) {
|
|
1446
|
-
return !!
|
|
1522
|
+
return !!bt(e, t, e, !1);
|
|
1447
1523
|
},
|
|
1448
|
-
extend:
|
|
1449
|
-
throttle:
|
|
1450
|
-
closest:
|
|
1524
|
+
extend: jt,
|
|
1525
|
+
throttle: Pt,
|
|
1526
|
+
closest: bt,
|
|
1451
1527
|
toggleClass: L,
|
|
1452
|
-
clone:
|
|
1528
|
+
clone: Lt,
|
|
1453
1529
|
index: B,
|
|
1454
|
-
nextTick:
|
|
1455
|
-
cancelNextTick:
|
|
1456
|
-
detectDirection:
|
|
1457
|
-
getChild:
|
|
1530
|
+
nextTick: Hn,
|
|
1531
|
+
cancelNextTick: Un,
|
|
1532
|
+
detectDirection: wn,
|
|
1533
|
+
getChild: Et,
|
|
1458
1534
|
expando: V
|
|
1459
1535
|
}, Q.get = function(e) {
|
|
1460
1536
|
return e[V];
|
|
@@ -1462,13 +1538,13 @@ Cn && F(document, "touchmove", function(e) {
|
|
|
1462
1538
|
var e = [...arguments];
|
|
1463
1539
|
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
1464
1540
|
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
1465
|
-
e.utils && (Q.utils =
|
|
1541
|
+
e.utils && (Q.utils = rt(rt({}, Q.utils), e.utils)), Wt.mount(e);
|
|
1466
1542
|
});
|
|
1467
1543
|
}, Q.create = function(e, t) {
|
|
1468
1544
|
return new Q(e, t);
|
|
1469
|
-
}, Q.version =
|
|
1470
|
-
var $ = [],
|
|
1471
|
-
function
|
|
1545
|
+
}, Q.version = lt;
|
|
1546
|
+
var $ = [], Wn, Gn, Kn = !1, qn, Jn, Yn, Xn;
|
|
1547
|
+
function Zn() {
|
|
1472
1548
|
function e() {
|
|
1473
1549
|
for (var e in this.defaults = {
|
|
1474
1550
|
scroll: !0,
|
|
@@ -1488,63 +1564,63 @@ function tr() {
|
|
|
1488
1564
|
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
1489
1565
|
},
|
|
1490
1566
|
drop: function() {
|
|
1491
|
-
this.sortable.nativeDraggable ? I(document, "dragover", this._handleAutoScroll) : (I(document, "pointermove", this._handleFallbackAutoScroll), I(document, "touchmove", this._handleFallbackAutoScroll), I(document, "mousemove", this._handleFallbackAutoScroll)),
|
|
1567
|
+
this.sortable.nativeDraggable ? I(document, "dragover", this._handleAutoScroll) : (I(document, "pointermove", this._handleFallbackAutoScroll), I(document, "touchmove", this._handleFallbackAutoScroll), I(document, "mousemove", this._handleFallbackAutoScroll)), $n(), Qn(), Ft();
|
|
1492
1568
|
},
|
|
1493
1569
|
nulling: function() {
|
|
1494
|
-
|
|
1570
|
+
Yn = Gn = Wn = Kn = Xn = qn = Jn = null, $.length = 0;
|
|
1495
1571
|
},
|
|
1496
1572
|
_handleFallbackAutoScroll: function(e) {
|
|
1497
1573
|
this._handleAutoScroll(e, !0);
|
|
1498
1574
|
},
|
|
1499
1575
|
_handleAutoScroll: function(e, t) {
|
|
1500
1576
|
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
1501
|
-
if (
|
|
1502
|
-
|
|
1503
|
-
var o =
|
|
1504
|
-
|
|
1505
|
-
var a =
|
|
1506
|
-
a !== o && (o = a,
|
|
1507
|
-
}, 10),
|
|
1577
|
+
if (Yn = e, t || this.options.forceAutoScrollFallback || ft || dt || mt) {
|
|
1578
|
+
er(e, this.options, a, t);
|
|
1579
|
+
var o = At(a, !0);
|
|
1580
|
+
Kn && (!Xn || r !== qn || i !== Jn) && (Xn && $n(), Xn = setInterval(function() {
|
|
1581
|
+
var a = At(document.elementFromPoint(r, i), !0);
|
|
1582
|
+
a !== o && (o = a, Qn()), er(e, n.options, a, t);
|
|
1583
|
+
}, 10), qn = r, Jn = i);
|
|
1508
1584
|
} else {
|
|
1509
|
-
if (!this.options.bubbleScroll ||
|
|
1510
|
-
|
|
1585
|
+
if (!this.options.bubbleScroll || At(a, !0) === wt()) {
|
|
1586
|
+
Qn();
|
|
1511
1587
|
return;
|
|
1512
1588
|
}
|
|
1513
|
-
|
|
1589
|
+
er(e, this.options, At(a, !1), !1);
|
|
1514
1590
|
}
|
|
1515
1591
|
}
|
|
1516
|
-
},
|
|
1592
|
+
}, tt(e, {
|
|
1517
1593
|
pluginName: "scroll",
|
|
1518
1594
|
initializeByDefault: !0
|
|
1519
1595
|
});
|
|
1520
1596
|
}
|
|
1521
|
-
function
|
|
1597
|
+
function Qn() {
|
|
1522
1598
|
$.forEach(function(e) {
|
|
1523
1599
|
clearInterval(e.pid);
|
|
1524
1600
|
}), $ = [];
|
|
1525
1601
|
}
|
|
1526
|
-
function
|
|
1527
|
-
clearInterval(
|
|
1602
|
+
function $n() {
|
|
1603
|
+
clearInterval(Xn);
|
|
1528
1604
|
}
|
|
1529
|
-
var
|
|
1605
|
+
var er = Pt(function(e, t, n, r) {
|
|
1530
1606
|
if (t.scroll) {
|
|
1531
|
-
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c =
|
|
1532
|
-
|
|
1533
|
-
var d = 0, f =
|
|
1607
|
+
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = wt(), l = !1, u;
|
|
1608
|
+
Gn !== n && (Gn = n, Qn(), Wn = t.scroll, u = t.scrollFn, Wn === !0 && (Wn = At(n, !0)));
|
|
1609
|
+
var d = 0, f = Wn;
|
|
1534
1610
|
do {
|
|
1535
|
-
var p = f, m = z(p), h = m.top, g = m.bottom, _ = m.left,
|
|
1536
|
-
p === c ? (
|
|
1537
|
-
var
|
|
1538
|
-
if (!$[d]) for (var
|
|
1539
|
-
($[d].vx !=
|
|
1540
|
-
r && this.layer === 0 && Q.active._onTouchMove(
|
|
1611
|
+
var p = f, m = z(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, T = R(p), E = p.scrollLeft, ee = p.scrollTop;
|
|
1612
|
+
p === c ? (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll" || T.overflowX === "visible"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll" || T.overflowY === "visible")) : (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll"));
|
|
1613
|
+
var D = x && (Math.abs(v - i) <= o && E + y < C) - (Math.abs(_ - i) <= o && !!E), O = S && (Math.abs(g - a) <= o && ee + b < w) - (Math.abs(h - a) <= o && !!ee);
|
|
1614
|
+
if (!$[d]) for (var k = 0; k <= d; k++) $[k] || ($[k] = {});
|
|
1615
|
+
($[d].vx != D || $[d].vy != O || $[d].el !== p) && ($[d].el = p, $[d].vx = D, $[d].vy = O, clearInterval($[d].pid), (D != 0 || O != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
1616
|
+
r && this.layer === 0 && Q.active._onTouchMove(Yn);
|
|
1541
1617
|
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
1542
|
-
(typeof u != "function" || u.call(Q.dragged.parentNode[V], n, t, e,
|
|
1618
|
+
(typeof u != "function" || u.call(Q.dragged.parentNode[V], n, t, e, Yn, $[this.layer].el) === "continue") && It($[this.layer].el, n, t);
|
|
1543
1619
|
}.bind({ layer: d }), 24))), d++;
|
|
1544
|
-
} while (t.bubbleScroll && f !== c && (f =
|
|
1545
|
-
|
|
1620
|
+
} while (t.bubbleScroll && f !== c && (f = At(f, !1)));
|
|
1621
|
+
Kn = l;
|
|
1546
1622
|
}
|
|
1547
|
-
}, 30),
|
|
1623
|
+
}, 30), tr = function(e) {
|
|
1548
1624
|
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
1549
1625
|
if (t) {
|
|
1550
1626
|
var c = n || i;
|
|
@@ -1556,8 +1632,8 @@ var ir = Rt(function(e, t, n, r) {
|
|
|
1556
1632
|
}));
|
|
1557
1633
|
}
|
|
1558
1634
|
};
|
|
1559
|
-
function
|
|
1560
|
-
|
|
1635
|
+
function nr() {}
|
|
1636
|
+
nr.prototype = {
|
|
1561
1637
|
startIndex: null,
|
|
1562
1638
|
dragStart: function(e) {
|
|
1563
1639
|
var t = e.oldDraggableIndex;
|
|
@@ -1566,22 +1642,21 @@ or.prototype = {
|
|
|
1566
1642
|
onSpill: function(e) {
|
|
1567
1643
|
var t = e.dragEl, n = e.putSortable;
|
|
1568
1644
|
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
1569
|
-
var r =
|
|
1645
|
+
var r = Et(this.sortable.el, this.startIndex, this.options);
|
|
1570
1646
|
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
1571
1647
|
},
|
|
1572
|
-
drop:
|
|
1573
|
-
},
|
|
1574
|
-
function
|
|
1575
|
-
|
|
1648
|
+
drop: tr
|
|
1649
|
+
}, tt(nr, { pluginName: "revertOnSpill" });
|
|
1650
|
+
function rr() {}
|
|
1651
|
+
rr.prototype = {
|
|
1576
1652
|
onSpill: function(e) {
|
|
1577
1653
|
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
1578
1654
|
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
1579
1655
|
},
|
|
1580
|
-
drop:
|
|
1581
|
-
},
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
function cr(e) {
|
|
1656
|
+
drop: tr
|
|
1657
|
+
}, tt(rr, { pluginName: "removeOnSpill" }), Q.mount(new Zn()), Q.mount(rr, nr);
|
|
1658
|
+
// src/composables/useTabsDrag.ts
|
|
1659
|
+
function ir(e) {
|
|
1585
1660
|
let t, n = [];
|
|
1586
1661
|
function r(e) {
|
|
1587
1662
|
return e?.getAttribute("data-tab-id") ?? e?.querySelector("[data-tab-id]")?.getAttribute("data-tab-id") ?? void 0;
|
|
@@ -1590,13 +1665,13 @@ function cr(e) {
|
|
|
1590
1665
|
t?.destroy(), t = void 0;
|
|
1591
1666
|
}
|
|
1592
1667
|
function a(t) {
|
|
1593
|
-
let n = t.map(r), i = e.items().map((e) =>
|
|
1668
|
+
let n = t.map(r), i = e.items().map((e) => N(e.key));
|
|
1594
1669
|
return n.length === i.length && n.every((e, t) => e === i[t]);
|
|
1595
1670
|
}
|
|
1596
1671
|
function o() {
|
|
1597
1672
|
i();
|
|
1598
1673
|
let o = e.element.value;
|
|
1599
|
-
|
|
1674
|
+
o && e.enabled() && (t = Q.create(o, {
|
|
1600
1675
|
animation: 120,
|
|
1601
1676
|
draggable: e.selector ?? "[role=\"tab\"]",
|
|
1602
1677
|
direction: "horizontal",
|
|
@@ -1604,415 +1679,829 @@ function cr(e) {
|
|
|
1604
1679
|
scrollSensitivity: 36,
|
|
1605
1680
|
scrollSpeed: 18,
|
|
1606
1681
|
onMove(t) {
|
|
1607
|
-
let n = r(t.dragged), i = r(t.related), a = e.items(), o = a.find((e) =>
|
|
1682
|
+
let n = r(t.dragged), i = r(t.related), a = e.items(), o = a.find((e) => N(e.key) === n), s = a.find((e) => N(e.key) === i), c = !!(o && s && e.canDrag(o) && e.canDrag(s) && o.pinned === s.pinned);
|
|
1608
1683
|
return c || e.onInvalid?.(), c;
|
|
1609
1684
|
},
|
|
1610
1685
|
onStart(t) {
|
|
1611
1686
|
n = [...t.from.querySelectorAll(e.selector ?? "[role=\"tab\"]")];
|
|
1612
1687
|
},
|
|
1613
1688
|
onEnd(t) {
|
|
1614
|
-
let i = r(t.item), o = e.items(), s = o.find((e) =>
|
|
1615
|
-
s && e.onMove(s.key, l?.key),
|
|
1689
|
+
let i = r(t.item), o = e.items(), s = o.find((e) => N(e.key) === i), c = t.item.nextElementSibling instanceof HTMLElement ? r(t.item.nextElementSibling) : void 0, l = o.find((e) => N(e.key) === c);
|
|
1690
|
+
s && e.onMove(s.key, l?.key), y(() => {
|
|
1616
1691
|
a(n) && n.forEach((e) => t.from.appendChild(e));
|
|
1617
1692
|
});
|
|
1618
1693
|
}
|
|
1619
1694
|
}));
|
|
1620
1695
|
}
|
|
1621
|
-
|
|
1696
|
+
oe([
|
|
1622
1697
|
e.element,
|
|
1623
1698
|
e.items,
|
|
1624
1699
|
e.enabled
|
|
1625
1700
|
], o, {
|
|
1626
1701
|
immediate: !0,
|
|
1627
1702
|
flush: "post"
|
|
1628
|
-
}),
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1703
|
+
}), C(i);
|
|
1704
|
+
}
|
|
1705
|
+
// src/composables/useOgTabsLifecycle.ts
|
|
1706
|
+
function ar(e) {
|
|
1707
|
+
ir({
|
|
1708
|
+
element: e.nativeNav,
|
|
1709
|
+
selector: "[role=\"tab\"]",
|
|
1710
|
+
enabled: () => e.featureEnabled("drag") && !e.props.ogReadonly && !e.props.ogBusy,
|
|
1711
|
+
items: () => e.orderedTabs.value,
|
|
1712
|
+
canDrag: Me,
|
|
1713
|
+
onMove: (t, n) => {
|
|
1714
|
+
e.controller.moveBefore(t, n, "drag");
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
let t = "";
|
|
1718
|
+
oe([e.tabs, e.activeKey], ([n, r], [i]) => {
|
|
1719
|
+
if (r !== void 0 && P(n, r)) {
|
|
1720
|
+
t = "";
|
|
1643
1721
|
return;
|
|
1644
1722
|
}
|
|
1645
|
-
|
|
1723
|
+
let a = `${String(r)}:${n.map((e) => String(e.key)).join("|")}`;
|
|
1724
|
+
if (t === a) return;
|
|
1725
|
+
t = a;
|
|
1726
|
+
let o;
|
|
1727
|
+
o = r === void 0 ? Oe(n).find((e) => !e.disabled)?.key : Ie(Oe(i || n), n, r), e.emitActiveKey(o);
|
|
1728
|
+
}, { immediate: !0 }), oe(e.activeKey, (t) => {
|
|
1729
|
+
t !== void 0 && e.scrollTo(t), t !== void 0 && e.pendingFocusId.value === N(t) && (e.focusTab(e.pendingFocusId.value), e.pendingFocusId.value = void 0);
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
// src/composables/useOgTabsModel.ts
|
|
1733
|
+
function or(e) {
|
|
1734
|
+
let { props: n, globalConfig: r, slots: i, navOverflowed: a, assertUnique: o } = e, s = c(() => n.ogVariant ?? r?.variant ?? "default"), l = c(() => n.ogDensity ?? r?.density ?? "default"), u = c(() => n.ogRenderContent ?? r?.renderContent ?? !0), d = c(() => ({
|
|
1735
|
+
...r?.features,
|
|
1736
|
+
...n.ogFeatures
|
|
1737
|
+
})), f = c(() => he(t, r?.localeSource?.value, r?.locale, n.ogLocale)), p = c(() => ({
|
|
1738
|
+
...r?.contextMenu,
|
|
1739
|
+
...n.ogContextMenu
|
|
1740
|
+
})), m = c(() => n.ogMinTabWidth ?? r?.minTabWidth), h = c(() => n.ogMaxTabWidth ?? r?.maxTabWidth), g = c(() => n.ogThemeColor ?? r?.themeColor), _ = c(() => n.ogSticky ?? r?.sticky), v = c(() => n.ogFinderThreshold ?? r?.finderThreshold ?? 8), y = c(() => (o(n.ogItems), n.ogItems)), b = c(() => Oe(y.value)), x = c(() => n.modelValue), S = c(() => P(y.value, x.value)), C = c(() => {
|
|
1741
|
+
if (x.value !== void 0) return N(x.value);
|
|
1742
|
+
}), w = c(() => p.value.enabled !== !1), T = c(() => new Set(p.value.hiddenActions ?? [])), E = c(() => sr(m.value)), ee = c(() => sr(h.value) ?? "240px"), D = c(() => k("finder") && (a.value || b.value.length >= v.value)), O = c(() => D.value || w.value && S.value !== void 0 || !!i.extra);
|
|
1743
|
+
function k(e) {
|
|
1744
|
+
return e === "add" ? d.value.add === !0 : e === "pin" || e === "drag" ? d.value[e] === !0 : d.value[e] !== !1;
|
|
1646
1745
|
}
|
|
1647
|
-
function
|
|
1648
|
-
|
|
1746
|
+
function A(e) {
|
|
1747
|
+
return y.value.find((t) => N(t.key) === String(e))?.key;
|
|
1649
1748
|
}
|
|
1650
|
-
return
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1749
|
+
return {
|
|
1750
|
+
actionsVisible: O,
|
|
1751
|
+
activeKey: x,
|
|
1752
|
+
activeTab: S,
|
|
1753
|
+
contextMenu: p,
|
|
1754
|
+
density: l,
|
|
1755
|
+
featureEnabled: k,
|
|
1756
|
+
features: d,
|
|
1757
|
+
finderThreshold: v,
|
|
1758
|
+
finderVisible: D,
|
|
1759
|
+
hiddenMenuActions: T,
|
|
1760
|
+
keyFromNativeName: A,
|
|
1761
|
+
locale: f,
|
|
1762
|
+
maxTabWidth: h,
|
|
1763
|
+
maxWidth: ee,
|
|
1764
|
+
menuEnabled: w,
|
|
1765
|
+
minTabWidth: m,
|
|
1766
|
+
minWidth: E,
|
|
1767
|
+
nativeModelValue: C,
|
|
1768
|
+
orderedTabs: b,
|
|
1769
|
+
renderContent: u,
|
|
1770
|
+
sticky: _,
|
|
1771
|
+
tabs: y,
|
|
1772
|
+
themeColor: g,
|
|
1773
|
+
variant: s
|
|
1656
1774
|
};
|
|
1657
1775
|
}
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
modelValue
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1776
|
+
function sr(e) {
|
|
1777
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
1778
|
+
}
|
|
1779
|
+
// src/composables/useOgTabsNativeBridge.ts
|
|
1780
|
+
function cr(e) {
|
|
1781
|
+
let t = c(() => {
|
|
1782
|
+
let t = {}, n = e.props.ogTabsEvents;
|
|
1783
|
+
n?.tabClick && (t.onTabClick = (e, t) => n.tabClick?.(r(e), t)), n?.tabChange && (t.onTabChange = (t) => n.tabChange?.(e.keyFromNativeName(t))), t.onEdit = (t, r) => {
|
|
1784
|
+
if (r === "add") {
|
|
1785
|
+
e.requestNativeAdd();
|
|
1786
|
+
return;
|
|
1787
|
+
}
|
|
1788
|
+
let i;
|
|
1789
|
+
t !== void 0 && (i = e.keyFromNativeName(t)), n?.edit?.(i, r);
|
|
1790
|
+
}, n?.tabRemove && (t.onTabRemove = (t) => n.tabRemove?.(e.keyFromNativeName(t)));
|
|
1791
|
+
let i = Object.fromEntries(Object.entries(e.attrs).filter(([e]) => /^on[A-Z]/u.test(e) && e !== "onUpdate:modelValue")), a = Object.fromEntries(Object.entries(e.attrs).filter(([e]) => e === "role" || e === "title"));
|
|
1792
|
+
return {
|
|
1793
|
+
...me(pe.props, [
|
|
1794
|
+
e.globalConfig?.nativeProps,
|
|
1795
|
+
e.attrs,
|
|
1796
|
+
e.props
|
|
1797
|
+
], [
|
|
1798
|
+
"modelValue",
|
|
1799
|
+
"beforeLeave",
|
|
1800
|
+
"closable",
|
|
1801
|
+
"editable",
|
|
1802
|
+
"addable"
|
|
1803
|
+
]),
|
|
1804
|
+
...a,
|
|
1805
|
+
...i,
|
|
1806
|
+
modelValue: e.nativeModelValue.value ?? "",
|
|
1807
|
+
editable: e.featureEnabled("add"),
|
|
1808
|
+
addable: e.featureEnabled("add"),
|
|
1809
|
+
...t
|
|
1810
|
+
};
|
|
1811
|
+
}), n = c(() => e.tabs.value.length ? {} : Object.fromEntries(Object.entries(e.attrs).filter(([e]) => !e.toLowerCase().startsWith("og"))));
|
|
1812
|
+
function r(t) {
|
|
1813
|
+
let n;
|
|
1814
|
+
t.paneName !== void 0 && (n = e.keyFromNativeName(t.paneName));
|
|
1815
|
+
let r = t.getVnode();
|
|
1816
|
+
return {
|
|
1817
|
+
...t,
|
|
1818
|
+
paneName: n,
|
|
1819
|
+
props: {
|
|
1820
|
+
...t.props,
|
|
1821
|
+
name: n
|
|
1822
|
+
},
|
|
1823
|
+
getVnode: () => s(r, { name: n })
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
return {
|
|
1827
|
+
nativeBindings: t,
|
|
1828
|
+
publicPane: r,
|
|
1829
|
+
rootAttrs: n
|
|
1830
|
+
};
|
|
1831
|
+
}
|
|
1832
|
+
// src/actionPresentation.ts
|
|
1833
|
+
function lr(e) {
|
|
1834
|
+
return [
|
|
1835
|
+
{
|
|
1836
|
+
operation: "refresh",
|
|
1837
|
+
label: e.labels.refresh
|
|
1680
1838
|
},
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
tabsProps: {},
|
|
1685
|
-
locale: {},
|
|
1686
|
-
minTabWidth: {},
|
|
1687
|
-
maxTabWidth: {},
|
|
1688
|
-
themeColor: {},
|
|
1689
|
-
sticky: {
|
|
1690
|
-
type: [Boolean, Number],
|
|
1691
|
-
default: void 0
|
|
1839
|
+
{
|
|
1840
|
+
operation: e.pinned ? "unpin" : "pin",
|
|
1841
|
+
label: e.labels.pin
|
|
1692
1842
|
},
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
beforeAction: {}
|
|
1697
|
-
},
|
|
1698
|
-
emits: [
|
|
1699
|
-
"update:modelValue",
|
|
1700
|
-
"update:items",
|
|
1701
|
-
"action-request",
|
|
1702
|
-
"close-request",
|
|
1703
|
-
"refresh-request",
|
|
1704
|
-
"pin-change-request",
|
|
1705
|
-
"reorder-request",
|
|
1706
|
-
"operation-denied",
|
|
1707
|
-
"operation-error",
|
|
1708
|
-
"tab-click",
|
|
1709
|
-
"tab-change",
|
|
1710
|
-
"tab-remove"
|
|
1711
|
-
],
|
|
1712
|
-
setup(t, { expose: n, emit: i }) {
|
|
1713
|
-
let o = t, d = i, m = ae();
|
|
1714
|
-
function y(e) {
|
|
1715
|
-
if (He(e)) throw TypeError("[OgTabs] Duplicate tab keys are not supported.");
|
|
1716
|
-
}
|
|
1717
|
-
y(o.items);
|
|
1718
|
-
let b = e(), te = oe("tabsRoot"), ne = oe("nativeTabs"), T = S(), ie = S({
|
|
1719
|
-
x: 0,
|
|
1720
|
-
y: 0
|
|
1721
|
-
}), se = S(!1), le = S(), ue = S(), fe = s(() => o.variant ?? b?.variant ?? "default"), pe = s(() => o.density ?? b?.density ?? "default"), ve = s(() => o.renderContent ?? b?.renderContent ?? !0), be = s(() => ({
|
|
1722
|
-
...b?.features,
|
|
1723
|
-
...o.features
|
|
1724
|
-
})), Se = s(() => ({
|
|
1725
|
-
...b?.tabsProps,
|
|
1726
|
-
...o.tabsProps
|
|
1727
|
-
})), O = s(() => xe(r, b?.localeSource?.value, b?.locale, o.locale)), De = s(() => ({
|
|
1728
|
-
...b?.contextMenu,
|
|
1729
|
-
...o.contextMenu
|
|
1730
|
-
})), Oe = s(() => o.minTabWidth ?? b?.minTabWidth), ke = s(() => o.maxTabWidth ?? b?.maxTabWidth), Ae = s(() => o.themeColor ?? b?.themeColor), Ne = s(() => o.sticky ?? b?.sticky), Le = s(() => o.finderThreshold ?? b?.finderThreshold ?? 8), Re = s(() => (y(o.items), o.items)), A = s(() => Me(Re.value)), j = s(() => o.modelValue), Ve = s(() => k(Re.value, j.value)), Ue = s(() => j.value === void 0 ? void 0 : M(j.value)), We = s(() => ({
|
|
1731
|
-
...Se.value,
|
|
1732
|
-
modelValue: Ue.value ?? ""
|
|
1733
|
-
})), Ge = s(() => ne.value?.tabNavRef?.tabListRef ?? null), Ke = s(() => De.value.enabled !== !1), qe = s(() => new Set(De.value.hiddenActions)), Je = s(() => tt(Oe.value)), Ye = s(() => tt(ke.value) ?? "240px"), Xe = lr(te, Ge), Qe = s(() => et("finder") && (Xe.overflowed.value || A.value.length >= Le.value)), $e = s(() => Qe.value || Ke.value && Ve.value !== void 0 || !!m.extra);
|
|
1734
|
-
function et(e) {
|
|
1735
|
-
return e === "pin" || e === "drag" ? be.value[e] === !0 : be.value[e] !== !1;
|
|
1736
|
-
}
|
|
1737
|
-
function tt(e) {
|
|
1738
|
-
return typeof e == "number" ? `${e}px` : e;
|
|
1739
|
-
}
|
|
1740
|
-
function nt(e) {
|
|
1741
|
-
return Re.value.find((t) => M(t.key) === String(e))?.key;
|
|
1742
|
-
}
|
|
1743
|
-
function rt(e) {
|
|
1744
|
-
let t = e.paneName === void 0 ? void 0 : nt(e.paneName);
|
|
1745
|
-
return t === void 0 ? e : {
|
|
1746
|
-
...e,
|
|
1747
|
-
paneName: t
|
|
1748
|
-
};
|
|
1749
|
-
}
|
|
1750
|
-
function ot(e) {
|
|
1751
|
-
d("action-request", e), Object.hasOwn(e, "nextActiveKey") && d("update:modelValue", e.nextActiveKey), e.nextItems && d("update:items", e.nextItems), e.operation.startsWith("close") && d("close-request", e), e.operation === "refresh" && d("refresh-request", e), (e.operation === "pin" || e.operation === "unpin") && d("pin-change-request", e), (e.operation === "move" || e.operation === "move-top" || e.operation === "move-bottom") && d("reorder-request", e);
|
|
1752
|
-
}
|
|
1753
|
-
function st(e) {
|
|
1754
|
-
_(() => te.value?.querySelector(`[data-tab-id="${M(e)}"]`)?.closest("[role=\"tab\"]")?.scrollIntoView?.({
|
|
1755
|
-
block: "nearest",
|
|
1756
|
-
inline: "nearest"
|
|
1757
|
-
}));
|
|
1758
|
-
}
|
|
1759
|
-
let N = at({
|
|
1760
|
-
getItems: () => Re.value,
|
|
1761
|
-
getActiveKey: () => j.value,
|
|
1762
|
-
getProps: () => o,
|
|
1763
|
-
getDeniedReason: (e, t) => P(e, t),
|
|
1764
|
-
onRequest: ot,
|
|
1765
|
-
onDenied: (e, t, n) => d("operation-denied", e, t, n),
|
|
1766
|
-
onError: (e, t) => d("operation-error", e, t),
|
|
1767
|
-
onScrollTo: st
|
|
1768
|
-
});
|
|
1769
|
-
function P(e, t) {
|
|
1770
|
-
if (o.busy || N?.pending.value) return "busy";
|
|
1771
|
-
let n = o.actionPolicy;
|
|
1772
|
-
if (n && (n.mode === "allow" ? !n.actions.includes(e) : n.actions.includes(e))) return "policy";
|
|
1773
|
-
if (e === "activate") return t ? t.disabled ? "disabled" : void 0 : "not-found";
|
|
1774
|
-
if (!t && e !== "close-all") return "not-found";
|
|
1775
|
-
if (o.readonly || t?.readonly || t?.disabled) return t?.disabled ? "disabled" : "readonly";
|
|
1776
|
-
if (e.startsWith("close")) return et("close") ? e === "close" && !Pe(t) ? t?.pinned ? "pinned" : "readonly" : void 0 : "policy";
|
|
1777
|
-
if (e === "refresh") return et("refresh") ? void 0 : "policy";
|
|
1778
|
-
if (e === "pin" || e === "unpin") return et("pin") ? Fe(t) ? void 0 : "readonly" : "policy";
|
|
1779
|
-
if (e === "move" || e === "move-top" || e === "move-bottom") return et("drag") ? Ie(t) ? void 0 : t?.pinned ? "pinned" : "boundary" : "policy";
|
|
1780
|
-
}
|
|
1781
|
-
function ct(e, t) {
|
|
1782
|
-
N.activate(e, t).then((t) => {
|
|
1783
|
-
t && st(e);
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
function lt(e) {
|
|
1787
|
-
let t = A.value, n = Be(t, t.filter((t) => t.key !== e), e);
|
|
1788
|
-
ue.value = n === void 0 ? void 0 : M(n);
|
|
1789
|
-
}
|
|
1790
|
-
function ut(e, t) {
|
|
1791
|
-
lt(e), N.close(e, t).then((e) => {
|
|
1792
|
-
e || (ue.value = void 0);
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
|
-
function dt(e, t, n) {
|
|
1796
|
-
let r = A.value, i = ze(r, t, e), a = j.value;
|
|
1797
|
-
if (a !== void 0 && i.some((e) => e.key === a)) {
|
|
1798
|
-
let e = Be(r, r.filter((e) => !i.some((t) => t.key === e.key)), a);
|
|
1799
|
-
ue.value = e === void 0 ? void 0 : M(e);
|
|
1800
|
-
}
|
|
1801
|
-
N.closeScopeAt(e, t, n).then((e) => {
|
|
1802
|
-
e || (ue.value = void 0);
|
|
1803
|
-
});
|
|
1804
|
-
}
|
|
1805
|
-
function ft(e, t, n, r) {
|
|
1806
|
-
if (!Ke.value) return;
|
|
1807
|
-
let i = t.getBoundingClientRect(), a = t.closest("[role=\"tab\"]") ?? t;
|
|
1808
|
-
T.value = e, le.value = a, ie.value = {
|
|
1809
|
-
x: n ?? i.left,
|
|
1810
|
-
y: r ?? i.bottom + 4
|
|
1811
|
-
}, se.value = !0;
|
|
1812
|
-
}
|
|
1813
|
-
function pt(e, t) {
|
|
1814
|
-
e.preventDefault(), ft(t, e.currentTarget, e.clientX, e.clientY);
|
|
1815
|
-
}
|
|
1816
|
-
function mt(e) {
|
|
1817
|
-
Ve.value && ft(Ve.value, e.currentTarget);
|
|
1818
|
-
}
|
|
1819
|
-
function ht() {
|
|
1820
|
-
se.value = !1;
|
|
1821
|
-
let e = le.value;
|
|
1822
|
-
le.value = void 0, _(() => e?.focus());
|
|
1823
|
-
}
|
|
1824
|
-
function gt(e, t) {
|
|
1825
|
-
ie.value = {
|
|
1826
|
-
x: e,
|
|
1827
|
-
y: t
|
|
1828
|
-
};
|
|
1843
|
+
{
|
|
1844
|
+
operation: "move-top",
|
|
1845
|
+
label: e.labels.moveTop
|
|
1829
1846
|
}
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1847
|
+
].filter((t) => !(e.hidden.has(t.operation) || t.operation === "refresh" && e.features.refresh === !1 || (t.operation === "pin" || t.operation === "unpin") && e.features.pin !== !0 || t.operation === "move-top" && e.features.drag !== !0));
|
|
1848
|
+
}
|
|
1849
|
+
// src/composables/useOgTabsContextMenu.ts
|
|
1850
|
+
function ur(e) {
|
|
1851
|
+
return e === "close" ? "current" : e.replace("close-", "");
|
|
1852
|
+
}
|
|
1853
|
+
function dr(e) {
|
|
1854
|
+
let t = E(), n = E({
|
|
1855
|
+
x: 0,
|
|
1856
|
+
y: 0
|
|
1857
|
+
}), r = E(!1), i = E();
|
|
1858
|
+
function a(a, o, s, c) {
|
|
1859
|
+
if (!e.menuEnabled.value) return;
|
|
1860
|
+
let l = o.getBoundingClientRect(), u = o.closest("[role=\"tab\"]") ?? o;
|
|
1861
|
+
t.value = a, i.value = u, n.value = {
|
|
1862
|
+
x: s ?? l.left,
|
|
1863
|
+
y: c ?? l.bottom + 4
|
|
1864
|
+
}, r.value = !0;
|
|
1865
|
+
}
|
|
1866
|
+
function o(e, t) {
|
|
1867
|
+
e.preventDefault(), a(t, e.currentTarget, e.clientX, e.clientY);
|
|
1868
|
+
}
|
|
1869
|
+
function s(t) {
|
|
1870
|
+
e.activeTab.value && a(e.activeTab.value, t.currentTarget);
|
|
1871
|
+
}
|
|
1872
|
+
function l() {
|
|
1873
|
+
r.value = !1;
|
|
1874
|
+
let e = i.value;
|
|
1875
|
+
i.value = void 0, y(() => e?.focus());
|
|
1876
|
+
}
|
|
1877
|
+
function u(e, t) {
|
|
1878
|
+
n.value = {
|
|
1879
|
+
x: e,
|
|
1880
|
+
y: t
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
let d = {
|
|
1884
|
+
refresh: (t) => void e.controller.refreshAt(t, "menu"),
|
|
1885
|
+
pin: (t) => void e.controller.pin(t, "menu"),
|
|
1886
|
+
unpin: (t) => void e.controller.unpin(t, "menu"),
|
|
1887
|
+
"move-top": (t) => void e.controller.moveTop(t, "menu"),
|
|
1888
|
+
"move-bottom": (t) => void e.controller.moveBottom(t, "menu")
|
|
1889
|
+
};
|
|
1890
|
+
function f(t, n) {
|
|
1891
|
+
if (t.startsWith("close")) {
|
|
1892
|
+
e.requestCloseScope(ur(t), n, "menu");
|
|
1893
|
+
return;
|
|
1833
1894
|
}
|
|
1834
|
-
let
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1895
|
+
let r = d[t];
|
|
1896
|
+
r && r(n);
|
|
1897
|
+
}
|
|
1898
|
+
function p(e) {
|
|
1899
|
+
let n = t.value;
|
|
1900
|
+
l(), n && f(e, n.key);
|
|
1901
|
+
}
|
|
1902
|
+
return {
|
|
1903
|
+
menuItems: c(() => {
|
|
1904
|
+
let n = t.value;
|
|
1905
|
+
if (!n) return [];
|
|
1906
|
+
let r = [
|
|
1838
1907
|
{
|
|
1839
1908
|
operation: "refresh",
|
|
1840
|
-
label:
|
|
1841
|
-
icon:
|
|
1909
|
+
label: e.locale.value.refresh,
|
|
1910
|
+
icon: Se
|
|
1842
1911
|
},
|
|
1843
1912
|
{
|
|
1844
1913
|
operation: "close",
|
|
1845
|
-
label:
|
|
1846
|
-
icon:
|
|
1914
|
+
label: e.locale.value.close,
|
|
1915
|
+
icon: ye,
|
|
1847
1916
|
dividerBefore: !0
|
|
1848
1917
|
},
|
|
1849
1918
|
{
|
|
1850
1919
|
operation: "close-others",
|
|
1851
|
-
label:
|
|
1852
|
-
icon:
|
|
1920
|
+
label: e.locale.value.closeOthers,
|
|
1921
|
+
icon: ye
|
|
1853
1922
|
},
|
|
1854
1923
|
{
|
|
1855
1924
|
operation: "close-left",
|
|
1856
|
-
label:
|
|
1857
|
-
icon:
|
|
1925
|
+
label: e.locale.value.closeLeft,
|
|
1926
|
+
icon: ye
|
|
1858
1927
|
},
|
|
1859
1928
|
{
|
|
1860
1929
|
operation: "close-right",
|
|
1861
|
-
label:
|
|
1862
|
-
icon:
|
|
1930
|
+
label: e.locale.value.closeRight,
|
|
1931
|
+
icon: ye
|
|
1863
1932
|
},
|
|
1864
1933
|
{
|
|
1865
1934
|
operation: "close-all",
|
|
1866
|
-
label:
|
|
1867
|
-
icon:
|
|
1935
|
+
label: e.locale.value.closeAll,
|
|
1936
|
+
icon: ye
|
|
1868
1937
|
},
|
|
1869
1938
|
{
|
|
1870
|
-
operation:
|
|
1871
|
-
label:
|
|
1872
|
-
icon:
|
|
1939
|
+
operation: n.pinned ? "unpin" : "pin",
|
|
1940
|
+
label: n.pinned ? e.locale.value.unpin : e.locale.value.pin,
|
|
1941
|
+
icon: be,
|
|
1873
1942
|
dividerBefore: !0
|
|
1874
1943
|
},
|
|
1875
1944
|
{
|
|
1876
1945
|
operation: "move-top",
|
|
1877
|
-
label:
|
|
1878
|
-
icon:
|
|
1946
|
+
label: e.locale.value.moveTop,
|
|
1947
|
+
icon: we,
|
|
1879
1948
|
dividerBefore: !0
|
|
1880
1949
|
},
|
|
1881
1950
|
{
|
|
1882
1951
|
operation: "move-bottom",
|
|
1883
|
-
label:
|
|
1884
|
-
icon:
|
|
1952
|
+
label: e.locale.value.moveBottom,
|
|
1953
|
+
icon: ge
|
|
1885
1954
|
}
|
|
1886
|
-
],
|
|
1887
|
-
hidden:
|
|
1888
|
-
features:
|
|
1955
|
+
], i = new Set(lr({
|
|
1956
|
+
hidden: e.hiddenMenuActions.value,
|
|
1957
|
+
features: e.features.value,
|
|
1889
1958
|
labels: {
|
|
1890
|
-
refresh:
|
|
1891
|
-
pin:
|
|
1892
|
-
moveTop:
|
|
1959
|
+
refresh: e.locale.value.refresh,
|
|
1960
|
+
pin: e.locale.value.pin,
|
|
1961
|
+
moveTop: e.locale.value.moveTop
|
|
1893
1962
|
},
|
|
1894
|
-
pinned:
|
|
1963
|
+
pinned: n.pinned === !0
|
|
1895
1964
|
}).map((e) => e.operation));
|
|
1896
|
-
return
|
|
1965
|
+
return r.filter((t) => {
|
|
1966
|
+
let n = i.has(t.operation) || t.operation !== "refresh" && t.operation !== "pin" && t.operation !== "unpin" && t.operation !== "move-top", r = t.operation !== "move-bottom" || e.featureEnabled("drag");
|
|
1967
|
+
return n && r && !e.hiddenMenuActions.value.has(t.operation);
|
|
1968
|
+
}).map((t) => ({
|
|
1897
1969
|
...t,
|
|
1898
|
-
disabled:
|
|
1970
|
+
disabled: e.deniedReason(t.operation, n) !== void 0
|
|
1899
1971
|
}));
|
|
1900
|
-
})
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1972
|
+
}),
|
|
1973
|
+
menuPosition: n,
|
|
1974
|
+
menuTab: t,
|
|
1975
|
+
menuVisible: r,
|
|
1976
|
+
closeMenu: l,
|
|
1977
|
+
onContextMenu: o,
|
|
1978
|
+
onMenuOperation: p,
|
|
1979
|
+
openActiveMenu: s,
|
|
1980
|
+
openMenu: a,
|
|
1981
|
+
updateMenuPosition: u
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
// src/composables/useOgTabsKeyboard.ts
|
|
1985
|
+
function fr(e) {
|
|
1986
|
+
return (t) => {
|
|
1987
|
+
if (!e.enabled()) return;
|
|
1988
|
+
let n = null;
|
|
1989
|
+
if (t.target instanceof HTMLElement && (n = t.target.closest("[role=\"tab\"]")), !n) return;
|
|
1990
|
+
let r = n.querySelector("[data-tab-id]")?.getAttribute("data-tab-id"), i = e.orderedTabs.value.find((e) => N(e.key) === r);
|
|
1991
|
+
if (i) {
|
|
1992
|
+
if (t.key === "Delete") t.preventDefault(), e.close(i.key, "keyboard");
|
|
1993
|
+
else if (t.key === "Home" || t.key === "End") {
|
|
1994
|
+
t.preventDefault();
|
|
1995
|
+
let n = e.orderedTabs.value;
|
|
1996
|
+
t.key === "End" && (n = [...e.orderedTabs.value].reverse());
|
|
1997
|
+
let r = n.find((e) => !e.disabled);
|
|
1998
|
+
r && (e.activate(r.key, "keyboard"), e.focusTab(N(r.key)));
|
|
1999
|
+
} else (t.key === "ContextMenu" || t.key === "F10" && t.shiftKey) && (t.preventDefault(), e.openMenu(i, n));
|
|
1919
2000
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
// src/composables/useOgTabsUiInteractions.ts
|
|
2004
|
+
function pr(e) {
|
|
2005
|
+
let t = dr({
|
|
2006
|
+
activeTab: e.activeTab,
|
|
2007
|
+
controller: e.controller,
|
|
2008
|
+
deniedReason: e.deniedReason,
|
|
2009
|
+
featureEnabled: e.featureEnabled,
|
|
2010
|
+
features: e.features,
|
|
2011
|
+
hiddenMenuActions: e.hiddenMenuActions,
|
|
2012
|
+
locale: e.locale,
|
|
2013
|
+
menuEnabled: e.menuEnabled,
|
|
2014
|
+
requestCloseScope: e.requestCloseScope
|
|
2015
|
+
}), n = fr({
|
|
2016
|
+
activate: e.activate,
|
|
2017
|
+
close: e.close,
|
|
2018
|
+
enabled: () => e.featureEnabled("keyboard"),
|
|
2019
|
+
focusTab: e.focusTab,
|
|
2020
|
+
openMenu: t.openMenu,
|
|
2021
|
+
orderedTabs: e.orderedTabs
|
|
2022
|
+
});
|
|
2023
|
+
return {
|
|
2024
|
+
...t,
|
|
2025
|
+
onKeydown: n
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
// src/composables/useTabsNavState.ts
|
|
2029
|
+
function mr(e, t) {
|
|
2030
|
+
let n = k(!1), r, i, a = 0, o = !1;
|
|
2031
|
+
function s() {
|
|
2032
|
+
if (o) return;
|
|
2033
|
+
let e = t.value, r = e?.parentElement;
|
|
2034
|
+
n.value = !!(e && r && e.scrollWidth > r.clientWidth + 1);
|
|
2035
|
+
}
|
|
2036
|
+
function c() {
|
|
2037
|
+
a++, typeof window < "u" && i !== void 0 && window.cancelAnimationFrame?.(i), i = void 0;
|
|
2038
|
+
}
|
|
2039
|
+
function l() {
|
|
2040
|
+
if (!(o || i !== void 0)) {
|
|
2041
|
+
if (typeof window < "u" && typeof window.requestAnimationFrame == "function") {
|
|
2042
|
+
let e = ++a;
|
|
2043
|
+
i = window.requestAnimationFrame(() => {
|
|
2044
|
+
o || e !== a || (i = void 0, s());
|
|
2045
|
+
});
|
|
2046
|
+
} else s();
|
|
1923
2047
|
}
|
|
1924
|
-
|
|
1925
|
-
|
|
2048
|
+
}
|
|
2049
|
+
function u() {
|
|
2050
|
+
c(), r?.disconnect();
|
|
2051
|
+
let e = t.value, n = e?.parentElement;
|
|
2052
|
+
!e || !n || typeof ResizeObserver > "u" || (r = new ResizeObserver(l), r.observe(e), r.observe(n)), s();
|
|
2053
|
+
}
|
|
2054
|
+
function d(t) {
|
|
2055
|
+
y(() => e.value?.querySelector(`[data-tab-id="${t}"]`)?.closest("[role=\"tab\"]")?.focus());
|
|
2056
|
+
}
|
|
2057
|
+
return oe([e, t], u, {
|
|
2058
|
+
immediate: !0,
|
|
2059
|
+
flush: "post"
|
|
2060
|
+
}), C(() => {
|
|
2061
|
+
o = !0, c(), r?.disconnect();
|
|
2062
|
+
}), {
|
|
2063
|
+
overflowed: n,
|
|
2064
|
+
focusTab: d
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
// src/composables/useOgTabsRuntime.ts
|
|
2068
|
+
function hr(e) {
|
|
2069
|
+
let t = c(() => e.surface.value?.getRootElement() ?? null), n = c(() => e.surface.value?.getNativeTabs()), r = c(() => n.value?.tabNavRef?.tabListRef ?? null), i = mr(t, r), a = or({
|
|
2070
|
+
assertUnique: e.assertUnique,
|
|
2071
|
+
globalConfig: e.globalConfig,
|
|
2072
|
+
navOverflowed: i.overflowed,
|
|
2073
|
+
props: e.props,
|
|
2074
|
+
slots: e.slots
|
|
2075
|
+
}), o = () => {}, s = cr({
|
|
2076
|
+
attrs: e.attrs,
|
|
2077
|
+
featureEnabled: a.featureEnabled,
|
|
2078
|
+
globalConfig: e.globalConfig,
|
|
2079
|
+
keyFromNativeName: a.keyFromNativeName,
|
|
2080
|
+
nativeModelValue: a.nativeModelValue,
|
|
2081
|
+
props: e.props,
|
|
2082
|
+
requestNativeAdd: () => o(),
|
|
2083
|
+
tabs: a.tabs
|
|
2084
|
+
}), l = De({
|
|
2085
|
+
activeKey: a.activeKey,
|
|
2086
|
+
emit: e.emit,
|
|
2087
|
+
props: e.props,
|
|
2088
|
+
root: t,
|
|
2089
|
+
tabs: a.tabs
|
|
2090
|
+
}), u = $e({
|
|
2091
|
+
activeKey: a.activeKey,
|
|
2092
|
+
emit: e.emit,
|
|
2093
|
+
featureEnabled: a.featureEnabled,
|
|
2094
|
+
keyFromNativeName: a.keyFromNativeName,
|
|
2095
|
+
onRequest: l.emitRequest,
|
|
2096
|
+
orderedTabs: a.orderedTabs,
|
|
2097
|
+
props: e.props,
|
|
2098
|
+
publicPane: s.publicPane,
|
|
2099
|
+
scrollTo: l.scrollTo,
|
|
2100
|
+
tabs: a.tabs
|
|
2101
|
+
});
|
|
2102
|
+
o = () => {
|
|
2103
|
+
u.controller.requestAdd("native");
|
|
2104
|
+
};
|
|
2105
|
+
let d = pr({
|
|
2106
|
+
activeTab: a.activeTab,
|
|
2107
|
+
activate: u.activate,
|
|
2108
|
+
close: u.requestClose,
|
|
2109
|
+
controller: u.controller,
|
|
2110
|
+
deniedReason: u.deniedReason,
|
|
2111
|
+
featureEnabled: a.featureEnabled,
|
|
2112
|
+
features: a.features,
|
|
2113
|
+
focusTab: i.focusTab,
|
|
2114
|
+
hiddenMenuActions: a.hiddenMenuActions,
|
|
2115
|
+
locale: a.locale,
|
|
2116
|
+
menuEnabled: a.menuEnabled,
|
|
2117
|
+
orderedTabs: a.orderedTabs,
|
|
2118
|
+
requestCloseScope: u.requestCloseScope
|
|
2119
|
+
});
|
|
2120
|
+
return ar({
|
|
2121
|
+
activeKey: a.activeKey,
|
|
2122
|
+
controller: u.controller,
|
|
2123
|
+
emitActiveKey: e.emit.updateModelValue,
|
|
2124
|
+
featureEnabled: (e) => a.featureEnabled(e),
|
|
2125
|
+
focusTab: i.focusTab,
|
|
2126
|
+
nativeNav: r,
|
|
2127
|
+
orderedTabs: a.orderedTabs,
|
|
2128
|
+
pendingFocusId: u.pendingFocusId,
|
|
2129
|
+
props: e.props,
|
|
2130
|
+
scrollTo: l.scrollTo,
|
|
2131
|
+
tabs: a.tabs
|
|
2132
|
+
}), {
|
|
2133
|
+
...a,
|
|
2134
|
+
...u,
|
|
2135
|
+
...s,
|
|
2136
|
+
...d,
|
|
2137
|
+
nativeTabs: n
|
|
2138
|
+
};
|
|
2139
|
+
}
|
|
2140
|
+
// src/components/tabs/OgTabsContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
2141
|
+
var gr = {
|
|
2142
|
+
key: 0,
|
|
2143
|
+
class: "og-tabs-context-menu__divider",
|
|
2144
|
+
role: "separator"
|
|
2145
|
+
}, _r = ["disabled", "onClick"], vr = /*@__PURE__*/ g({
|
|
2146
|
+
__name: "OgTabsContextMenu",
|
|
2147
|
+
props: {
|
|
2148
|
+
visible: { type: Boolean },
|
|
2149
|
+
x: {},
|
|
2150
|
+
y: {},
|
|
2151
|
+
items: {}
|
|
2152
|
+
},
|
|
2153
|
+
emits: [
|
|
2154
|
+
"select",
|
|
2155
|
+
"close",
|
|
2156
|
+
"reposition"
|
|
2157
|
+
],
|
|
2158
|
+
setup(e, { emit: t }) {
|
|
2159
|
+
let n = e, r = t, i = ie("menu");
|
|
2160
|
+
function s() {
|
|
2161
|
+
r("close");
|
|
1926
2162
|
}
|
|
1927
|
-
function
|
|
1928
|
-
|
|
2163
|
+
function c() {
|
|
2164
|
+
return [...i.value?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") ?? []];
|
|
1929
2165
|
}
|
|
1930
|
-
function
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
t
|
|
2166
|
+
function p() {
|
|
2167
|
+
let e = i.value;
|
|
2168
|
+
if (!e) return;
|
|
2169
|
+
let t = e.getBoundingClientRect();
|
|
2170
|
+
r("reposition", Math.max(4, Math.min(n.x, window.innerWidth - t.width - 4)), Math.max(4, Math.min(n.y, window.innerHeight - t.height - 4))), c()[0]?.focus();
|
|
1934
2171
|
}
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
2172
|
+
function m(e) {
|
|
2173
|
+
i.value?.contains(e.target) || s();
|
|
2174
|
+
}
|
|
2175
|
+
function h(e) {
|
|
2176
|
+
let t = c(), n = t.indexOf(document.activeElement);
|
|
2177
|
+
e.key === "Escape" ? (e.preventDefault(), s()) : t.length && [
|
|
2178
|
+
"ArrowDown",
|
|
2179
|
+
"ArrowUp",
|
|
2180
|
+
"Home",
|
|
2181
|
+
"End"
|
|
2182
|
+
].includes(e.key) && (e.preventDefault(), t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus());
|
|
2183
|
+
}
|
|
2184
|
+
return oe(() => n.visible, (e) => {
|
|
2185
|
+
e && y(p);
|
|
2186
|
+
}), w(() => window.addEventListener("pointerdown", m)), C(() => window.removeEventListener("pointerdown", m)), (t, n) => (T(), l(o, { to: "body" }, [e.visible ? (T(), d("div", {
|
|
2187
|
+
key: 0,
|
|
2188
|
+
ref_key: "menu",
|
|
2189
|
+
ref: i,
|
|
2190
|
+
class: "og-tabs-context-menu",
|
|
2191
|
+
style: S({
|
|
2192
|
+
left: `${e.x}px`,
|
|
2193
|
+
top: `${e.y}px`
|
|
2194
|
+
}),
|
|
2195
|
+
role: "menu",
|
|
2196
|
+
onContextmenu: n[0] ||= ce(() => {}, ["prevent"]),
|
|
2197
|
+
onKeydown: h
|
|
2198
|
+
}, [
|
|
2199
|
+
D(t.$slots, "top", {}, void 0, !0),
|
|
2200
|
+
(T(!0), d(a, null, ee(e.items, (e) => (T(), d(a, { key: e.operation }, [e.dividerBefore ? (T(), d("div", gr)) : u("", !0), f("button", {
|
|
2201
|
+
type: "button",
|
|
2202
|
+
role: "menuitem",
|
|
2203
|
+
disabled: e.disabled,
|
|
2204
|
+
onClick: ce((n) => t.$emit("select", e.operation), ["stop"])
|
|
2205
|
+
}, [e.icon ? (T(), l(j(ue), {
|
|
2206
|
+
key: 0,
|
|
2207
|
+
"aria-hidden": "true"
|
|
2208
|
+
}, {
|
|
2209
|
+
default: M(() => [(T(), l(O(e.icon)))]),
|
|
2210
|
+
_: 2
|
|
2211
|
+
}, 1024)) : u("", !0), f("span", null, A(e.label), 1)], 8, _r)], 64))), 128)),
|
|
2212
|
+
D(t.$slots, "bottom", {}, void 0, !0)
|
|
2213
|
+
], 36)) : u("", !0)]));
|
|
2214
|
+
}
|
|
2215
|
+
}), yr = (e, t) => {
|
|
2216
|
+
let n = e.__vccOpts || e;
|
|
2217
|
+
for (let [e, r] of t) n[e] = r;
|
|
2218
|
+
return n;
|
|
2219
|
+
}, br = /*#__PURE__*/ yr(vr, [["__scopeId", "data-v-0cada8a2"]]), xr = ["aria-label"], Sr = { class: "og-tabs-finder__content" }, Cr = [
|
|
2220
|
+
"aria-expanded",
|
|
2221
|
+
"aria-controls",
|
|
2222
|
+
"aria-activedescendant",
|
|
2223
|
+
"placeholder"
|
|
2224
|
+
], wr = ["id", "aria-label"], Tr = [
|
|
2225
|
+
"id",
|
|
2226
|
+
"aria-selected",
|
|
2227
|
+
"disabled",
|
|
2228
|
+
"onClick"
|
|
2229
|
+
], Er = { class: "og-tabs-finder__label" }, Dr = { class: "og-tabs-finder__title" }, Or = ["aria-label"], kr = /*#__PURE__*/ yr(/* @__PURE__ */ g({
|
|
2230
|
+
__name: "OgTabsFinder",
|
|
2231
|
+
props: {
|
|
2232
|
+
tabs: {},
|
|
2233
|
+
activeKey: {},
|
|
2234
|
+
locale: {}
|
|
2235
|
+
},
|
|
2236
|
+
emits: ["activate"],
|
|
2237
|
+
setup(e, { emit: t }) {
|
|
2238
|
+
let n = e, r = t, i = k(!1), o = k(""), s = k(-1), p = ne(), m = ne(), g = ie("input"), _ = c(() => ke(n.tabs, o.value)), v = c(() => _.value.filter((e) => !e.disabled)), x = c(() => v.value[s.value]), S = c(() => _.value.length > 0);
|
|
2239
|
+
function C(e) {
|
|
2240
|
+
return `og-tabs-finder-option-${m}-${typeof e.key}-${String(e.key)}`;
|
|
2241
|
+
}
|
|
2242
|
+
function w(e) {
|
|
2243
|
+
let t = v.value.length;
|
|
2244
|
+
t && (s.value = (s.value + e + t) % t);
|
|
2245
|
+
}
|
|
2246
|
+
function E(e) {
|
|
2247
|
+
switch (e.key) {
|
|
2248
|
+
case "ArrowDown":
|
|
2249
|
+
e.preventDefault(), w(1);
|
|
2250
|
+
break;
|
|
2251
|
+
case "ArrowUp":
|
|
2252
|
+
e.preventDefault(), w(-1);
|
|
2253
|
+
break;
|
|
2254
|
+
case "Home":
|
|
2255
|
+
e.preventDefault(), s.value = 0;
|
|
2256
|
+
break;
|
|
2257
|
+
case "End":
|
|
2258
|
+
e.preventDefault(), s.value = v.value.length - 1;
|
|
2259
|
+
break;
|
|
2260
|
+
case "Enter": x.value && (e.preventDefault(), D(x.value.key));
|
|
1950
2261
|
}
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
2262
|
+
}
|
|
2263
|
+
function D(e) {
|
|
2264
|
+
i.value = !1, r("activate", e);
|
|
2265
|
+
}
|
|
2266
|
+
function O() {
|
|
2267
|
+
g.value?.focus();
|
|
2268
|
+
}
|
|
2269
|
+
return oe([i, v], ([e, t], [n]) => {
|
|
2270
|
+
e && !n && (o.value = "", s.value = -1, y(O)), s.value >= t.length && (s.value = t.length - 1);
|
|
2271
|
+
}, { flush: "sync" }), (t, n) => (T(), l(j(de), {
|
|
2272
|
+
visible: i.value,
|
|
2273
|
+
"onUpdate:visible": n[1] ||= (e) => i.value = e,
|
|
2274
|
+
trigger: "click",
|
|
2275
|
+
placement: "bottom-end",
|
|
2276
|
+
width: 320,
|
|
2277
|
+
"popper-class": "og-tabs-finder",
|
|
2278
|
+
onAfterEnter: O
|
|
2279
|
+
}, {
|
|
2280
|
+
reference: M(() => [f("button", {
|
|
2281
|
+
type: "button",
|
|
2282
|
+
class: "og-tabs__action",
|
|
2283
|
+
"aria-label": e.locale.findTabs
|
|
2284
|
+
}, [h(j(ue), { "aria-hidden": "true" }, {
|
|
2285
|
+
default: M(() => [h(j(Ce))]),
|
|
2286
|
+
_: 1
|
|
2287
|
+
})], 8, xr)]),
|
|
2288
|
+
default: M(() => [f("div", Sr, [se(f("input", {
|
|
2289
|
+
ref_key: "input",
|
|
2290
|
+
ref: g,
|
|
2291
|
+
"onUpdate:modelValue": n[0] ||= (e) => o.value = e,
|
|
2292
|
+
class: "og-tabs-finder__input",
|
|
2293
|
+
role: "combobox",
|
|
2294
|
+
"aria-autocomplete": "list",
|
|
2295
|
+
"aria-haspopup": "listbox",
|
|
2296
|
+
"aria-expanded": i.value,
|
|
2297
|
+
"aria-controls": S.value ? j(p) : void 0,
|
|
2298
|
+
"aria-activedescendant": x.value ? C(x.value) : void 0,
|
|
2299
|
+
placeholder: e.locale.findTabsPlaceholder,
|
|
2300
|
+
onKeydown: E
|
|
2301
|
+
}, null, 40, Cr), [[ae, o.value]]), S.value ? (T(), d("div", {
|
|
2302
|
+
key: 0,
|
|
2303
|
+
id: j(p),
|
|
2304
|
+
class: "og-tabs-finder__list",
|
|
2305
|
+
role: "listbox",
|
|
2306
|
+
"aria-label": e.locale.findTabs
|
|
2307
|
+
}, [(T(!0), d(a, null, ee(_.value, (t) => (T(), d("button", {
|
|
2308
|
+
id: C(t),
|
|
2309
|
+
key: `${typeof t.key}:${String(t.key)}`,
|
|
2310
|
+
type: "button",
|
|
2311
|
+
role: "option",
|
|
2312
|
+
"aria-selected": t.key === e.activeKey,
|
|
2313
|
+
class: b({ "is-active": t.key === x.value?.key }),
|
|
2314
|
+
disabled: t.disabled,
|
|
2315
|
+
onClick: (e) => D(t.key)
|
|
2316
|
+
}, [f("span", Er, [f("span", Dr, A(t.label), 1), t.dirty ? (T(), d("span", {
|
|
2317
|
+
key: 0,
|
|
2318
|
+
class: "og-tabs-finder__dirty",
|
|
2319
|
+
"aria-label": e.locale.unsaved
|
|
2320
|
+
}, null, 8, Or)) : u("", !0)])], 10, Tr))), 128))], 8, wr)) : (T(), l(j(le), {
|
|
2321
|
+
key: 1,
|
|
2322
|
+
description: e.locale.noResults,
|
|
2323
|
+
"image-size": 56
|
|
2324
|
+
}, null, 8, ["description"]))])]),
|
|
2325
|
+
_: 1
|
|
2326
|
+
}, 8, ["visible"]));
|
|
2327
|
+
}
|
|
2328
|
+
}), [["__scopeId", "data-v-a0e2ca26"]]), Ar = [
|
|
2329
|
+
"data-tab-key",
|
|
2330
|
+
"data-tab-id",
|
|
2331
|
+
"title"
|
|
2332
|
+
], jr = { class: "og-tabs-label__text" }, Mr = ["aria-label"], Nr = { class: "og-tabs-sr-only" }, Pr = ["aria-label"], Fr = {
|
|
2333
|
+
key: 3,
|
|
2334
|
+
class: "og-tabs-label__badge"
|
|
2335
|
+
}, Ir = /*#__PURE__*/ yr(/* @__PURE__ */ g({
|
|
2336
|
+
__name: "OgTabsLabel",
|
|
2337
|
+
props: {
|
|
2338
|
+
tab: {},
|
|
2339
|
+
active: { type: Boolean },
|
|
2340
|
+
minWidth: {},
|
|
2341
|
+
maxWidth: {},
|
|
2342
|
+
locale: {}
|
|
2343
|
+
},
|
|
2344
|
+
setup(e) {
|
|
2345
|
+
return (t, n) => (T(), d("span", {
|
|
2346
|
+
class: "og-tabs-label",
|
|
2347
|
+
"data-tab-key": String(e.tab.key),
|
|
2348
|
+
"data-tab-id": j(N)(e.tab.key),
|
|
2349
|
+
style: S({
|
|
2350
|
+
minWidth: e.minWidth,
|
|
2351
|
+
maxWidth: e.maxWidth
|
|
2352
|
+
}),
|
|
2353
|
+
title: e.tab.remark ? `${e.tab.label}\n${e.tab.remark}` : e.tab.label
|
|
2354
|
+
}, [
|
|
2355
|
+
D(t.$slots, "before", { tab: e.tab }, void 0, !0),
|
|
2356
|
+
e.tab.icon ? (T(), l(j(ue), {
|
|
2357
|
+
key: 0,
|
|
2358
|
+
class: "og-tabs-label__icon",
|
|
2359
|
+
"aria-hidden": "true"
|
|
2360
|
+
}, {
|
|
2361
|
+
default: M(() => [(T(), l(O(e.tab.icon)))]),
|
|
2362
|
+
_: 1
|
|
2363
|
+
})) : u("", !0),
|
|
2364
|
+
e.tab.pinned ? (T(), l(j(ue), {
|
|
2365
|
+
key: 1,
|
|
2366
|
+
class: "og-tabs-label__pin",
|
|
2367
|
+
"aria-label": e.locale.pinned
|
|
2368
|
+
}, {
|
|
2369
|
+
default: M(() => [h(j(be))]),
|
|
2370
|
+
_: 1
|
|
2371
|
+
}, 8, ["aria-label"])) : u("", !0),
|
|
2372
|
+
f("span", jr, [D(t.$slots, "default", {
|
|
2373
|
+
tab: e.tab,
|
|
2374
|
+
active: e.active
|
|
2375
|
+
}, () => [m(A(e.tab.label), 1)], !0)]),
|
|
2376
|
+
e.tab.dirty ? (T(), d("span", {
|
|
2377
|
+
key: 2,
|
|
2378
|
+
class: "og-tabs-label__dirty",
|
|
2379
|
+
"aria-label": e.locale.unsaved
|
|
2380
|
+
}, [f("span", Nr, A(e.locale.unsaved), 1)], 8, Mr)) : u("", !0),
|
|
2381
|
+
D(t.$slots, "status", { tab: e.tab }, () => [e.tab.statusIcon || e.tab.status === "success" || e.tab.status === "warning" || e.tab.status === "error" ? (T(), l(j(ue), {
|
|
2382
|
+
key: 0,
|
|
2383
|
+
class: b(["og-tabs-label__status", [`is-${e.tab.status}`]]),
|
|
2384
|
+
"aria-hidden": "true"
|
|
2385
|
+
}, {
|
|
2386
|
+
default: M(() => [(T(), l(O(e.tab.statusIcon || (e.tab.status === "success" ? j(_e) : e.tab.status === "error" ? j(ve) : j(Te)))))]),
|
|
2387
|
+
_: 1
|
|
2388
|
+
}, 8, ["class"])) : e.tab.status === "loading" ? (T(), d("span", {
|
|
2389
|
+
key: 1,
|
|
2390
|
+
class: "og-tabs-label__loading",
|
|
2391
|
+
"aria-label": e.locale.loading
|
|
2392
|
+
}, null, 8, Pr)) : u("", !0)], !0),
|
|
2393
|
+
e.tab.badge === void 0 ? u("", !0) : (T(), d("span", Fr, A(e.tab.badge), 1)),
|
|
2394
|
+
D(t.$slots, "after", { tab: e.tab }, void 0, !0)
|
|
2395
|
+
], 12, Ar));
|
|
2396
|
+
}
|
|
2397
|
+
}), [["__scopeId", "data-v-506f42f5"]]), Lr = ["aria-busy"], Rr = {
|
|
2398
|
+
key: 0,
|
|
2399
|
+
class: "og-tabs__header"
|
|
2400
|
+
}, zr = {
|
|
2401
|
+
key: 1,
|
|
2402
|
+
class: "og-tabs__empty"
|
|
2403
|
+
}, Br = {
|
|
2404
|
+
key: 0,
|
|
2405
|
+
class: "og-tabs__actions"
|
|
2406
|
+
}, Vr = ["aria-label"], Hr = /* @__PURE__ */ g({
|
|
2407
|
+
__name: "OgTabsSurface",
|
|
2408
|
+
props: {
|
|
2409
|
+
rootAttrs: {},
|
|
2410
|
+
orderedTabs: {},
|
|
2411
|
+
activeKey: {},
|
|
2412
|
+
activeTab: {},
|
|
2413
|
+
variant: {},
|
|
2414
|
+
density: {},
|
|
2415
|
+
renderContent: { type: Boolean },
|
|
2416
|
+
locale: {},
|
|
2417
|
+
minWidth: {},
|
|
2418
|
+
maxWidth: {},
|
|
2419
|
+
themeColor: {},
|
|
2420
|
+
sticky: { type: [Boolean, Number] },
|
|
2421
|
+
actionsVisible: { type: Boolean },
|
|
2422
|
+
finderVisible: { type: Boolean },
|
|
2423
|
+
showEmpty: { type: Boolean },
|
|
2424
|
+
pending: { type: Boolean },
|
|
2425
|
+
busy: { type: Boolean },
|
|
2426
|
+
menuEnabled: { type: Boolean },
|
|
2427
|
+
menuVisible: { type: Boolean },
|
|
2428
|
+
menuPosition: {},
|
|
2429
|
+
menuItems: {},
|
|
2430
|
+
nativeBindings: {},
|
|
2431
|
+
menuContext: {},
|
|
2432
|
+
beforeNativeLeave: { type: Function },
|
|
2433
|
+
onKeydown: { type: Function },
|
|
2434
|
+
onNativeTabClick: { type: Function },
|
|
2435
|
+
onNativeTabChange: { type: Function },
|
|
2436
|
+
onNativeTabRemove: { type: Function },
|
|
2437
|
+
onContextMenu: { type: Function },
|
|
2438
|
+
onActivate: { type: Function },
|
|
2439
|
+
onOpenActiveMenu: { type: Function },
|
|
2440
|
+
onMenuOperation: { type: Function },
|
|
2441
|
+
onCloseMenu: { type: Function },
|
|
2442
|
+
onReposition: { type: Function },
|
|
2443
|
+
canClose: { type: Function }
|
|
2444
|
+
},
|
|
2445
|
+
setup(e, { expose: t }) {
|
|
2446
|
+
let n = re(), r = ie("tabsRoot"), i = ie("nativeTabs");
|
|
2447
|
+
return t({
|
|
2448
|
+
getRootElement: () => r.value ?? void 0,
|
|
2449
|
+
getNativeTabs: () => i.value ?? void 0
|
|
2450
|
+
}), (t, o) => (T(), d("div", v({
|
|
1962
2451
|
ref_key: "tabsRoot",
|
|
1963
|
-
ref:
|
|
1964
|
-
}, e
|
|
2452
|
+
ref: r
|
|
2453
|
+
}, e.rootAttrs, {
|
|
1965
2454
|
class: ["og-tabs", [
|
|
1966
|
-
`og-tabs--${
|
|
1967
|
-
`og-tabs--variant-${
|
|
1968
|
-
`og-tabs--${
|
|
2455
|
+
`og-tabs--${e.variant}`,
|
|
2456
|
+
`og-tabs--variant-${e.variant}`,
|
|
2457
|
+
`og-tabs--${e.density}`,
|
|
1969
2458
|
{
|
|
1970
|
-
"is-sticky":
|
|
1971
|
-
"is-pending":
|
|
2459
|
+
"is-sticky": e.sticky,
|
|
2460
|
+
"is-pending": e.pending || e.busy
|
|
1972
2461
|
}
|
|
1973
2462
|
]],
|
|
1974
2463
|
style: {
|
|
1975
|
-
"--og-tabs-sticky-top": typeof
|
|
1976
|
-
"--og-tabs-theme-color":
|
|
1977
|
-
"--og-tabs-tab-min-width":
|
|
1978
|
-
"--og-tabs-tab-max-width":
|
|
2464
|
+
"--og-tabs-sticky-top": typeof e.sticky == "number" ? `${e.sticky}px` : "0px",
|
|
2465
|
+
"--og-tabs-theme-color": e.themeColor,
|
|
2466
|
+
"--og-tabs-tab-min-width": e.minWidth,
|
|
2467
|
+
"--og-tabs-tab-max-width": e.maxWidth
|
|
1979
2468
|
},
|
|
1980
|
-
"aria-busy":
|
|
1981
|
-
onKeydown:
|
|
2469
|
+
"aria-busy": e.busy || e.pending,
|
|
2470
|
+
onKeydown: o[2] ||= (...t) => e.onKeydown && e.onKeydown(...t)
|
|
1982
2471
|
}), [
|
|
1983
|
-
|
|
1984
|
-
|
|
2472
|
+
n.header ? (T(), d("div", Rr, [D(t.$slots, "header")])) : u("", !0),
|
|
2473
|
+
e.showEmpty ? (T(), d("div", zr, [D(t.$slots, "empty", {}, () => [m(A(e.locale.empty), 1)])])) : (T(), d("div", {
|
|
1985
2474
|
key: 2,
|
|
1986
|
-
class:
|
|
1987
|
-
}, [
|
|
2475
|
+
class: b(["og-tabs__bar", { "has-actions": e.actionsVisible }])
|
|
2476
|
+
}, [h(j(pe), v({
|
|
1988
2477
|
ref_key: "nativeTabs",
|
|
1989
|
-
ref:
|
|
1990
|
-
},
|
|
2478
|
+
ref: i
|
|
2479
|
+
}, e.nativeBindings, {
|
|
1991
2480
|
class: "og-tabs__native",
|
|
1992
|
-
"before-leave":
|
|
1993
|
-
onTabClick:
|
|
1994
|
-
onTabChange:
|
|
1995
|
-
onTabRemove:
|
|
2481
|
+
"before-leave": e.beforeNativeLeave,
|
|
2482
|
+
onTabClick: e.onNativeTabClick,
|
|
2483
|
+
onTabChange: e.onNativeTabChange,
|
|
2484
|
+
onTabRemove: e.onNativeTabRemove
|
|
1996
2485
|
}), {
|
|
1997
|
-
default:
|
|
1998
|
-
key:
|
|
1999
|
-
name:
|
|
2000
|
-
disabled:
|
|
2001
|
-
closable:
|
|
2002
|
-
lazy:
|
|
2486
|
+
default: M(() => [(T(!0), d(a, null, ee(e.orderedTabs, (n) => (T(), l(j(fe), {
|
|
2487
|
+
key: j(N)(n.key),
|
|
2488
|
+
name: j(N)(n.key),
|
|
2489
|
+
disabled: n.disabled === !0,
|
|
2490
|
+
closable: e.canClose(n),
|
|
2491
|
+
lazy: n.lazy === !0
|
|
2003
2492
|
}, {
|
|
2004
|
-
label:
|
|
2005
|
-
tab:
|
|
2006
|
-
active:
|
|
2007
|
-
"min-width":
|
|
2008
|
-
"max-width":
|
|
2009
|
-
locale:
|
|
2010
|
-
onContextmenu: (
|
|
2493
|
+
label: M(() => [h(Ir, {
|
|
2494
|
+
tab: n,
|
|
2495
|
+
active: n.key === e.activeKey,
|
|
2496
|
+
"min-width": e.minWidth,
|
|
2497
|
+
"max-width": e.maxWidth,
|
|
2498
|
+
locale: e.locale,
|
|
2499
|
+
onContextmenu: (t) => e.onContextMenu(t, n)
|
|
2011
2500
|
}, {
|
|
2012
|
-
default:
|
|
2013
|
-
before:
|
|
2014
|
-
after:
|
|
2015
|
-
status:
|
|
2501
|
+
default: M((e) => [D(t.$slots, "label", v({ ref_for: !0 }, e))]),
|
|
2502
|
+
before: M((e) => [D(t.$slots, "tabBefore", v({ ref_for: !0 }, e))]),
|
|
2503
|
+
after: M((e) => [D(t.$slots, "tabAfter", v({ ref_for: !0 }, e))]),
|
|
2504
|
+
status: M((e) => [D(t.$slots, "status", v({ ref_for: !0 }, e))]),
|
|
2016
2505
|
_: 3
|
|
2017
2506
|
}, 8, [
|
|
2018
2507
|
"tab",
|
|
@@ -2022,10 +2511,10 @@ var ur = ["aria-busy"], dr = {
|
|
|
2022
2511
|
"locale",
|
|
2023
2512
|
"onContextmenu"
|
|
2024
2513
|
])]),
|
|
2025
|
-
default:
|
|
2026
|
-
tab:
|
|
2514
|
+
default: M(() => [e.renderContent && n.key === e.activeKey ? D(t.$slots, "default", {
|
|
2515
|
+
tab: n,
|
|
2027
2516
|
active: !0
|
|
2028
|
-
}, void 0, void 0, 0) :
|
|
2517
|
+
}, void 0, void 0, 0) : u("", !0)]),
|
|
2029
2518
|
_: 2
|
|
2030
2519
|
}, 1032, [
|
|
2031
2520
|
"name",
|
|
@@ -2034,64 +2523,249 @@ var ur = ["aria-busy"], dr = {
|
|
|
2034
2523
|
"lazy"
|
|
2035
2524
|
]))), 128))]),
|
|
2036
2525
|
_: 3
|
|
2037
|
-
}, 16
|
|
2038
|
-
|
|
2526
|
+
}, 16, [
|
|
2527
|
+
"before-leave",
|
|
2528
|
+
"onTabClick",
|
|
2529
|
+
"onTabChange",
|
|
2530
|
+
"onTabRemove"
|
|
2531
|
+
]), e.actionsVisible ? (T(), d("div", Br, [
|
|
2532
|
+
e.finderVisible ? (T(), l(kr, {
|
|
2039
2533
|
key: 0,
|
|
2040
|
-
tabs:
|
|
2041
|
-
"active-key":
|
|
2042
|
-
locale:
|
|
2043
|
-
onActivate:
|
|
2534
|
+
tabs: e.orderedTabs,
|
|
2535
|
+
"active-key": e.activeKey,
|
|
2536
|
+
locale: e.locale,
|
|
2537
|
+
onActivate: o[0] ||= (t) => e.onActivate(t, "finder")
|
|
2044
2538
|
}, null, 8, [
|
|
2045
2539
|
"tabs",
|
|
2046
2540
|
"active-key",
|
|
2047
2541
|
"locale"
|
|
2048
|
-
])) :
|
|
2049
|
-
|
|
2542
|
+
])) : u("", !0),
|
|
2543
|
+
e.menuEnabled && e.activeTab ? (T(), d("button", {
|
|
2050
2544
|
key: 1,
|
|
2051
2545
|
type: "button",
|
|
2052
2546
|
class: "og-tabs__action",
|
|
2053
|
-
"aria-label":
|
|
2054
|
-
onClick:
|
|
2055
|
-
}, [
|
|
2056
|
-
default:
|
|
2547
|
+
"aria-label": e.locale.tabActions,
|
|
2548
|
+
onClick: o[1] ||= (...t) => e.onOpenActiveMenu && e.onOpenActiveMenu(...t)
|
|
2549
|
+
}, [h(j(ue), { "aria-hidden": "true" }, {
|
|
2550
|
+
default: M(() => [h(j(xe))]),
|
|
2057
2551
|
_: 1
|
|
2058
|
-
})], 8,
|
|
2059
|
-
|
|
2060
|
-
])) :
|
|
2061
|
-
|
|
2062
|
-
visible:
|
|
2063
|
-
x:
|
|
2064
|
-
y:
|
|
2065
|
-
items:
|
|
2066
|
-
onSelect:
|
|
2067
|
-
onClose:
|
|
2068
|
-
onReposition:
|
|
2552
|
+
})], 8, Vr)) : u("", !0),
|
|
2553
|
+
D(t.$slots, "extra")
|
|
2554
|
+
])) : u("", !0)], 2)),
|
|
2555
|
+
h(br, {
|
|
2556
|
+
visible: e.menuVisible,
|
|
2557
|
+
x: e.menuPosition.x,
|
|
2558
|
+
y: e.menuPosition.y,
|
|
2559
|
+
items: e.menuItems,
|
|
2560
|
+
onSelect: e.onMenuOperation,
|
|
2561
|
+
onClose: e.onCloseMenu,
|
|
2562
|
+
onReposition: e.onReposition
|
|
2069
2563
|
}, {
|
|
2070
|
-
top:
|
|
2071
|
-
|
|
2072
|
-
source: "menu",
|
|
2073
|
-
tab: T.value,
|
|
2074
|
-
activeKey: j.value,
|
|
2075
|
-
activeTab: Ve.value,
|
|
2076
|
-
items: Re.value
|
|
2077
|
-
})))]),
|
|
2078
|
-
bottom: D(() => [w(e.$slots, "contextMenuBottom", v(h({
|
|
2079
|
-
operation: "refresh",
|
|
2080
|
-
source: "menu",
|
|
2081
|
-
tab: T.value,
|
|
2082
|
-
activeKey: j.value,
|
|
2083
|
-
activeTab: Ve.value,
|
|
2084
|
-
items: Re.value
|
|
2085
|
-
})))]),
|
|
2564
|
+
top: M(() => [D(t.$slots, "contextMenuTop", x(_(e.menuContext)))]),
|
|
2565
|
+
bottom: M(() => [D(t.$slots, "contextMenuBottom", x(_(e.menuContext)))]),
|
|
2086
2566
|
_: 3
|
|
2087
2567
|
}, 8, [
|
|
2088
2568
|
"visible",
|
|
2089
2569
|
"x",
|
|
2090
2570
|
"y",
|
|
2091
|
-
"items"
|
|
2571
|
+
"items",
|
|
2572
|
+
"onSelect",
|
|
2573
|
+
"onClose",
|
|
2574
|
+
"onReposition"
|
|
2092
2575
|
])
|
|
2093
|
-
], 16,
|
|
2576
|
+
], 16, Lr));
|
|
2577
|
+
}
|
|
2578
|
+
}), Ur = /* @__PURE__ */ g({
|
|
2579
|
+
inheritAttrs: !1,
|
|
2580
|
+
__name: "OgTabs",
|
|
2581
|
+
props: {
|
|
2582
|
+
...pe.props,
|
|
2583
|
+
modelValue: {
|
|
2584
|
+
type: [String, Number],
|
|
2585
|
+
default: void 0
|
|
2586
|
+
},
|
|
2587
|
+
ogItems: {
|
|
2588
|
+
type: Array,
|
|
2589
|
+
required: !0
|
|
2590
|
+
},
|
|
2591
|
+
ogVariant: {
|
|
2592
|
+
type: String,
|
|
2593
|
+
default: void 0
|
|
2594
|
+
},
|
|
2595
|
+
ogDensity: {
|
|
2596
|
+
type: String,
|
|
2597
|
+
default: void 0
|
|
2598
|
+
},
|
|
2599
|
+
ogRenderContent: {
|
|
2600
|
+
type: Boolean,
|
|
2601
|
+
default: void 0
|
|
2602
|
+
},
|
|
2603
|
+
ogFeatures: {
|
|
2604
|
+
type: Object,
|
|
2605
|
+
default: void 0
|
|
2606
|
+
},
|
|
2607
|
+
ogReadonly: {
|
|
2608
|
+
type: Boolean,
|
|
2609
|
+
default: void 0
|
|
2610
|
+
},
|
|
2611
|
+
ogBusy: {
|
|
2612
|
+
type: Boolean,
|
|
2613
|
+
default: void 0
|
|
2614
|
+
},
|
|
2615
|
+
ogTabsEvents: {
|
|
2616
|
+
type: Object,
|
|
2617
|
+
default: void 0
|
|
2618
|
+
},
|
|
2619
|
+
ogLocale: {
|
|
2620
|
+
type: Object,
|
|
2621
|
+
default: void 0
|
|
2622
|
+
},
|
|
2623
|
+
ogMinTabWidth: {
|
|
2624
|
+
type: [String, Number],
|
|
2625
|
+
default: void 0
|
|
2626
|
+
},
|
|
2627
|
+
ogMaxTabWidth: {
|
|
2628
|
+
type: [String, Number],
|
|
2629
|
+
default: void 0
|
|
2630
|
+
},
|
|
2631
|
+
ogThemeColor: {
|
|
2632
|
+
type: String,
|
|
2633
|
+
default: void 0
|
|
2634
|
+
},
|
|
2635
|
+
ogSticky: {
|
|
2636
|
+
type: [Boolean, Number],
|
|
2637
|
+
default: void 0
|
|
2638
|
+
},
|
|
2639
|
+
ogFinderThreshold: {
|
|
2640
|
+
type: Number,
|
|
2641
|
+
default: void 0
|
|
2642
|
+
},
|
|
2643
|
+
ogContextMenu: {
|
|
2644
|
+
type: Object,
|
|
2645
|
+
default: void 0
|
|
2646
|
+
},
|
|
2647
|
+
ogActionPolicy: {
|
|
2648
|
+
type: Object,
|
|
2649
|
+
default: void 0
|
|
2650
|
+
},
|
|
2651
|
+
ogBeforeAction: {
|
|
2652
|
+
type: Function,
|
|
2653
|
+
default: void 0
|
|
2654
|
+
},
|
|
2655
|
+
ogActionHandler: {
|
|
2656
|
+
type: Function,
|
|
2657
|
+
default: void 0
|
|
2658
|
+
}
|
|
2659
|
+
},
|
|
2660
|
+
emits: [
|
|
2661
|
+
"update:modelValue",
|
|
2662
|
+
"update:ogItems",
|
|
2663
|
+
"actionRequest",
|
|
2664
|
+
"closeRequest",
|
|
2665
|
+
"refreshRequest",
|
|
2666
|
+
"pinChangeRequest",
|
|
2667
|
+
"reorderRequest",
|
|
2668
|
+
"operationDenied",
|
|
2669
|
+
"operationError",
|
|
2670
|
+
"tabClick",
|
|
2671
|
+
"tabChange",
|
|
2672
|
+
"tabRemove"
|
|
2673
|
+
],
|
|
2674
|
+
setup(e, { expose: t, emit: n }) {
|
|
2675
|
+
let i = e, a = n, o = re(), s = i, u = c(() => s.ogBusy);
|
|
2676
|
+
function d(e) {
|
|
2677
|
+
if (Be(e)) throw TypeError("[OgTabs] Duplicate tab keys are not supported.");
|
|
2678
|
+
}
|
|
2679
|
+
d(s.ogItems);
|
|
2680
|
+
let f = r(), m = te(), h = ie("surface"), { actionsVisible: g, activeKey: v, activeTab: y, activate: b, beforeNativeLeave: S, closeMenu: C, controller: w, deniedReason: E, density: ee, featureEnabled: O, finderVisible: k, locale: A, maxWidth: ne, menuEnabled: ae, menuItems: oe, menuPosition: se, menuTab: ce, menuVisible: le, minWidth: ue, nativeBindings: de, nativeTabs: fe, onContextMenu: pe, onKeydown: me, onMenuOperation: he, onNativeTabChange: ge, onNativeTabClick: _e, onNativeTabRemove: ve, openActiveMenu: ye, orderedTabs: be, renderContent: xe, rootAttrs: Se, sticky: Ce, tabs: we, themeColor: Te, updateMenuPosition: N, variant: Ee } = hr({
|
|
2681
|
+
assertUnique: d,
|
|
2682
|
+
attrs: m,
|
|
2683
|
+
emit: {
|
|
2684
|
+
actionRequest: (e) => a("actionRequest", e),
|
|
2685
|
+
closeRequest: (e) => a("closeRequest", e),
|
|
2686
|
+
operationDenied: (e, t, n) => a("operationDenied", e, t, n),
|
|
2687
|
+
operationError: (e, t) => a("operationError", e, t),
|
|
2688
|
+
pinChangeRequest: (e) => a("pinChangeRequest", e),
|
|
2689
|
+
refreshRequest: (e) => a("refreshRequest", e),
|
|
2690
|
+
reorderRequest: (e) => a("reorderRequest", e),
|
|
2691
|
+
tabChange: (e) => a("tabChange", e),
|
|
2692
|
+
tabClick: (e, t) => a("tabClick", e, t),
|
|
2693
|
+
tabRemove: (e) => a("tabRemove", e),
|
|
2694
|
+
updateItems: (e) => a("update:ogItems", e),
|
|
2695
|
+
updateModelValue: (e) => a("update:modelValue", e)
|
|
2696
|
+
},
|
|
2697
|
+
globalConfig: f,
|
|
2698
|
+
props: s,
|
|
2699
|
+
slots: o,
|
|
2700
|
+
surface: h
|
|
2701
|
+
});
|
|
2702
|
+
return t({
|
|
2703
|
+
...w,
|
|
2704
|
+
getNativeTabs: () => fe.value ?? void 0
|
|
2705
|
+
}), (e, t) => (T(), l(Hr, {
|
|
2706
|
+
ref_key: "surface",
|
|
2707
|
+
ref: h,
|
|
2708
|
+
"root-attrs": {
|
|
2709
|
+
...j(Se),
|
|
2710
|
+
"aria-busy": u.value || j(w).pending.value
|
|
2711
|
+
},
|
|
2712
|
+
"ordered-tabs": j(be),
|
|
2713
|
+
"active-key": j(v),
|
|
2714
|
+
"active-tab": j(y),
|
|
2715
|
+
variant: j(Ee),
|
|
2716
|
+
density: j(ee),
|
|
2717
|
+
"render-content": j(xe),
|
|
2718
|
+
locale: j(A),
|
|
2719
|
+
"min-width": j(ue),
|
|
2720
|
+
"max-width": j(ne),
|
|
2721
|
+
"theme-color": j(Te),
|
|
2722
|
+
sticky: j(Ce),
|
|
2723
|
+
"actions-visible": j(g),
|
|
2724
|
+
"finder-visible": j(k),
|
|
2725
|
+
"show-empty": !j(we).length && !j(O)("add"),
|
|
2726
|
+
pending: j(w).pending.value,
|
|
2727
|
+
busy: u.value === !0,
|
|
2728
|
+
"menu-enabled": j(ae),
|
|
2729
|
+
"menu-visible": j(le),
|
|
2730
|
+
"menu-position": j(se),
|
|
2731
|
+
"menu-items": j(oe),
|
|
2732
|
+
"native-bindings": j(de),
|
|
2733
|
+
"menu-context": {
|
|
2734
|
+
operation: "refresh",
|
|
2735
|
+
source: "menu",
|
|
2736
|
+
tab: j(ce),
|
|
2737
|
+
activeKey: j(v),
|
|
2738
|
+
activeTab: j(y),
|
|
2739
|
+
items: j(we)
|
|
2740
|
+
},
|
|
2741
|
+
"before-native-leave": j(S),
|
|
2742
|
+
"on-keydown": j(me),
|
|
2743
|
+
"on-native-tab-click": j(_e),
|
|
2744
|
+
"on-native-tab-change": j(ge),
|
|
2745
|
+
"on-native-tab-remove": j(ve),
|
|
2746
|
+
"on-context-menu": j(pe),
|
|
2747
|
+
"on-activate": j(b),
|
|
2748
|
+
"on-open-active-menu": j(ye),
|
|
2749
|
+
"on-menu-operation": j(he),
|
|
2750
|
+
"on-close-menu": j(C),
|
|
2751
|
+
"on-reposition": j(N),
|
|
2752
|
+
"can-close": (e) => j(E)("close", e) === void 0
|
|
2753
|
+
}, p({
|
|
2754
|
+
default: M((t) => [D(e.$slots, "default", x(_(t)))]),
|
|
2755
|
+
label: M((t) => [D(e.$slots, "label", x(_(t)))]),
|
|
2756
|
+
tabBefore: M((t) => [D(e.$slots, "tabBefore", x(_(t)))]),
|
|
2757
|
+
tabAfter: M((t) => [D(e.$slots, "tabAfter", x(_(t)))]),
|
|
2758
|
+
status: M((t) => [D(e.$slots, "status", x(_(t)))]),
|
|
2759
|
+
contextMenuTop: M((t) => [D(e.$slots, "contextMenuTop", x(_(t)))]),
|
|
2760
|
+
contextMenuBottom: M((t) => [D(e.$slots, "contextMenuBottom", x(_(t)))]),
|
|
2761
|
+
extra: M(() => [D(e.$slots, "extra")]),
|
|
2762
|
+
empty: M(() => [D(e.$slots, "empty")]),
|
|
2763
|
+
_: 2
|
|
2764
|
+
}, [o.header ? {
|
|
2765
|
+
name: "header",
|
|
2766
|
+
fn: M(() => [D(e.$slots, "header")]),
|
|
2767
|
+
key: "0"
|
|
2768
|
+
} : void 0]), 1032, /* @__PURE__ */ "root-attrs.ordered-tabs.active-key.active-tab.variant.density.render-content.locale.min-width.max-width.theme-color.sticky.actions-visible.finder-visible.show-empty.pending.busy.menu-enabled.menu-visible.menu-position.menu-items.native-bindings.menu-context.before-native-leave.on-keydown.on-native-tab-click.on-native-tab-change.on-native-tab-remove.on-context-menu.on-activate.on-open-active-menu.on-menu-operation.on-close-menu.on-reposition.can-close".split(".")));
|
|
2094
2769
|
}
|
|
2095
2770
|
});
|
|
2096
|
-
|
|
2097
|
-
export { n as OG_TABS_LOCALE_EN_US, r as OG_TABS_LOCALE_ZH_CN, i as OG_TABS_LOCALE_ZH_TW, hr as OgTabs, Pe as canCloseTab, Ie as canMoveTab, Fe as canPinTab, t as createOgTabs, Ne as filterTabs, k as findTab, ze as getCloseScopeTabs, He as hasDuplicateKeys, A as moveTab, j as moveTabToEdge, Ve as operationForCloseScope, Me as orderTabs, Re as removeTabs, Be as resolveNextActive, Le as setTabPinned, e as useOgTabsGlobalConfig, at as useTabsController };
|
|
2771
|
+
export { e as OG_TABS_LOCALE_EN_US, t as OG_TABS_LOCALE_ZH_CN, n as OG_TABS_LOCALE_ZH_TW, Ur as OgTabs, Ae as canCloseTab, Me as canMoveTab, je as canPinTab, i as createOgTabs, Ee as createTabStateRevision, ke as filterTabs, P as findTab, Fe as getCloseScopeTabs, Be as hasDuplicateKeys, Le as moveTab, Re as moveTabToEdge, ze as operationForCloseScope, Oe as orderTabs, Pe as removeTabs, Ie as resolveNextActive, Ne as setTabPinned, r as useOgTabsGlobalConfig, Qe as useTabsController };
|