vue-stack-tabs 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/favicon.svg +9 -9
- package/dist/vue-stack-tabs.es.js +116 -112
- package/dist/vue-stack-tabs.umd.js +1 -1
- package/package.json +1 -1
- package/src/lib/assets/style/transition.scss +62 -62
- package/src/lib/hooks/useStackTab.ts +119 -119
- package/src/lib/hooks/useTabRouter.ts +103 -103
- package/src/lib/hooks/useTabpanel.tsx +13 -7
- package/src/lib/utils/TabIdHelper.ts +70 -70
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var vn = Object.defineProperty;
|
|
2
2
|
var mn = (t, e, n) => e in t ? vn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var _t = (t, e, n) => mn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { inject as ct, ref as D, reactive as Ie, readonly as xt, toRaw as gn, defineComponent as ee, openBlock as R, createElementBlock as V, normalizeStyle as Fe, unref as x, createElementVNode as Q, createCommentVNode as se, nextTick as le, onMounted as He, onDeactivated as yn, onActivated as wn, onUnmounted as Ze, createVNode as
|
|
4
|
+
import { inject as ct, ref as D, reactive as Ie, readonly as xt, toRaw as gn, defineComponent as ee, openBlock as R, createElementBlock as V, normalizeStyle as Fe, unref as x, createElementVNode as Q, createCommentVNode as se, nextTick as le, onMounted as He, onDeactivated as yn, onActivated as wn, onUnmounted as Ze, createVNode as N, resolveComponent as Xt, normalizeClass as fe, withModifiers as xe, toDisplayString as Gt, Fragment as je, renderList as lt, createBlock as ge, computed as ke, renderSlot as Te, watch as kn, withDirectives as Yt, vShow as Kt, withCtx as ue, TransitionGroup as Jt, mergeProps as _n, Transition as Qt, provide as xn, onBeforeMount as Tn, onBeforeUnmount as Tt, KeepAlive as Sn, resolveDynamicComponent as On, getCurrentInstance as en } from "vue";
|
|
5
5
|
import { useRouter as ut, useRoute as An } from "vue-router";
|
|
6
6
|
const En = {
|
|
7
7
|
VueStackTab: {
|
|
@@ -200,7 +200,7 @@ const ft = (t = ".stack-tab__container *") => {
|
|
|
200
200
|
);
|
|
201
201
|
return e.length ? Math.max(...e.filter((n) => n < 9e4)) + 1 : 1;
|
|
202
202
|
};
|
|
203
|
-
var
|
|
203
|
+
var be = /* @__PURE__ */ ((t) => (t.WHEEL = "wheel", t.BUTTON = "button", t.BOTH = "both", t))(be || {});
|
|
204
204
|
class Xe {
|
|
205
205
|
//
|
|
206
206
|
constructor(e) {
|
|
@@ -879,7 +879,7 @@ const ds = fs(), hs = {
|
|
|
879
879
|
install(t) {
|
|
880
880
|
t.provide("tabEmitter", ds);
|
|
881
881
|
}
|
|
882
|
-
},
|
|
882
|
+
}, ye = () => ct("tabEmitter");
|
|
883
883
|
var Z = /* @__PURE__ */ ((t) => (t.PAGE_LOADING = "PAGE_LOADING", t.TAB_ACTIVE = "TAB_ACTIVE", t))(Z || {});
|
|
884
884
|
const ps = /* @__PURE__ */ ee({
|
|
885
885
|
__name: "PageLoading",
|
|
@@ -887,7 +887,7 @@ const ps = /* @__PURE__ */ ee({
|
|
|
887
887
|
tId: {}
|
|
888
888
|
},
|
|
889
889
|
setup(t) {
|
|
890
|
-
const e = t, n =
|
|
890
|
+
const e = t, n = ye(), s = D(!1);
|
|
891
891
|
return n.on(Z.PAGE_LOADING, ({ tId: r, value: o }) => {
|
|
892
892
|
r === e.tId && (s.value = o);
|
|
893
893
|
}), (r, o) => s.value ? (R(), V("div", {
|
|
@@ -898,10 +898,10 @@ const ps = /* @__PURE__ */ ee({
|
|
|
898
898
|
Q("div", { class: "stack-tab-loading--spin turn" }, null, -1)
|
|
899
899
|
]), 4)) : se("", !0);
|
|
900
900
|
}
|
|
901
|
-
}), M = D([]), Ye = [],
|
|
901
|
+
}), M = D([]), Ye = [], W = D([]), ae = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), he = D(!0), Ke = "stacktab-active-tab", pe = /* @__PURE__ */ new Map();
|
|
902
902
|
let Lt = !1, $e = 0, zt = !1, Je = "";
|
|
903
903
|
const Ce = () => {
|
|
904
|
-
const t = ut(), e =
|
|
904
|
+
const t = ut(), e = ye(), {
|
|
905
905
|
t: n
|
|
906
906
|
} = Me(), s = () => M.value.length, r = (b) => {
|
|
907
907
|
for (const B of b) {
|
|
@@ -921,8 +921,8 @@ const Ce = () => {
|
|
|
921
921
|
query: ne(q.query, {
|
|
922
922
|
__tab: z
|
|
923
923
|
})
|
|
924
|
-
},
|
|
925
|
-
|
|
924
|
+
}, we = new Xe();
|
|
925
|
+
we.push(X);
|
|
926
926
|
const Y = {
|
|
927
927
|
id: h.id,
|
|
928
928
|
title: P.title,
|
|
@@ -930,9 +930,9 @@ const Ce = () => {
|
|
|
930
930
|
refreshable: P.refreshable,
|
|
931
931
|
iframe: P.iframe,
|
|
932
932
|
active: !1,
|
|
933
|
-
pages:
|
|
933
|
+
pages: we
|
|
934
934
|
};
|
|
935
|
-
|
|
935
|
+
W.value.push(ze), Ye.push(Y), M.value.push({
|
|
936
936
|
...Y
|
|
937
937
|
});
|
|
938
938
|
}
|
|
@@ -971,13 +971,13 @@ const Ce = () => {
|
|
|
971
971
|
}, b.query.__tab = rt(h)), F.has(h.id) || !v)
|
|
972
972
|
return;
|
|
973
973
|
const z = b.matched[b.matched.length - 1].path, q = b.path.endsWith("/") ? b.path.substring(0, b.path.length - 1) : b.path, P = Ct(h.id, z === q ? q : b.path, b.query.valueOf());
|
|
974
|
-
if (
|
|
974
|
+
if (de.has(P))
|
|
975
975
|
return ae.get(P);
|
|
976
976
|
const ze = b.query.__src;
|
|
977
977
|
let X = null;
|
|
978
978
|
for (const Y of x(M))
|
|
979
979
|
Y.active = !1, Y.id === h.id && (X = Y);
|
|
980
|
-
const
|
|
980
|
+
const we = {
|
|
981
981
|
id: P,
|
|
982
982
|
tabId: h.id,
|
|
983
983
|
path: b.path,
|
|
@@ -985,7 +985,7 @@ const Ce = () => {
|
|
|
985
985
|
};
|
|
986
986
|
if (X === null) {
|
|
987
987
|
const Y = new Xe();
|
|
988
|
-
Y.push(
|
|
988
|
+
Y.push(we), X = {
|
|
989
989
|
id: h.id,
|
|
990
990
|
title: h.title,
|
|
991
991
|
closable: h.closable,
|
|
@@ -1001,7 +1001,7 @@ const Ce = () => {
|
|
|
1001
1001
|
});
|
|
1002
1002
|
});
|
|
1003
1003
|
} else
|
|
1004
|
-
X.active = !0, (X.pages.isEmpty() || X.pages.peek().id !==
|
|
1004
|
+
X.active = !0, (X.pages.isEmpty() || X.pages.peek().id !== we.id) && X.pages.push(we);
|
|
1005
1005
|
return U(X), ae.has(P) ? B = ae.get(P) : (B = /* @__PURE__ */ ee({
|
|
1006
1006
|
name: P,
|
|
1007
1007
|
components: {
|
|
@@ -1019,20 +1019,20 @@ const Ce = () => {
|
|
|
1019
1019
|
kt.emit("onLoaded"), p(P), $(), F.clear(), v.props = null;
|
|
1020
1020
|
}), Ze(() => {
|
|
1021
1021
|
l(P);
|
|
1022
|
-
}), () =>
|
|
1022
|
+
}), () => N("div", {
|
|
1023
1023
|
class: "cache-page-wrapper",
|
|
1024
1024
|
id: "W-" + h.id,
|
|
1025
1025
|
style: [zt ? "overflow:auto" : "overflow:hidden"]
|
|
1026
|
-
}, [
|
|
1026
|
+
}, [N(Xt("dynamic-component"), {
|
|
1027
1027
|
tId: h.id,
|
|
1028
1028
|
pId: P
|
|
1029
|
-
}, null),
|
|
1029
|
+
}, null), N(ps, {
|
|
1030
1030
|
tId: h.id
|
|
1031
1031
|
}, null)]);
|
|
1032
1032
|
}
|
|
1033
1033
|
}), ae.set(P, B)), A(P), B;
|
|
1034
1034
|
}, p = (b) => {
|
|
1035
|
-
const v =
|
|
1035
|
+
const v = pe.get(b);
|
|
1036
1036
|
if (v) {
|
|
1037
1037
|
for (const B of v.keys())
|
|
1038
1038
|
if (document.querySelector(B)) {
|
|
@@ -1042,7 +1042,7 @@ const Ce = () => {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
}, f = (b) => {
|
|
1044
1044
|
var B, h;
|
|
1045
|
-
const v =
|
|
1045
|
+
const v = pe.get(b);
|
|
1046
1046
|
if (v)
|
|
1047
1047
|
for (const z of v.keys()) {
|
|
1048
1048
|
const q = {
|
|
@@ -1052,11 +1052,11 @@ const Ce = () => {
|
|
|
1052
1052
|
v.set(z, q);
|
|
1053
1053
|
}
|
|
1054
1054
|
}, l = (b) => {
|
|
1055
|
-
const v =
|
|
1056
|
-
v && (v.clear(),
|
|
1055
|
+
const v = pe.get(b);
|
|
1056
|
+
v && (v.clear(), pe.delete(b));
|
|
1057
1057
|
}, m = (b, ...v) => {
|
|
1058
|
-
|
|
1059
|
-
const B =
|
|
1058
|
+
pe.has(b) || pe.set(b, /* @__PURE__ */ new Map());
|
|
1059
|
+
const B = pe.get(b);
|
|
1060
1060
|
for (const h of v)
|
|
1061
1061
|
B.set(h, {
|
|
1062
1062
|
top: 0,
|
|
@@ -1161,10 +1161,10 @@ const Ce = () => {
|
|
|
1161
1161
|
for (const B of x(M))
|
|
1162
1162
|
if (B.id === b) {
|
|
1163
1163
|
const h = (v = B.pages.peek()) == null ? void 0 : v.id;
|
|
1164
|
-
for (let z =
|
|
1165
|
-
if (
|
|
1166
|
-
|
|
1167
|
-
|
|
1164
|
+
for (let z = W.value.length - 1; z >= 0; z--)
|
|
1165
|
+
if (W.value[z] === h) {
|
|
1166
|
+
W.value.splice(z, 1), B.active && (he.value = !1, le(() => {
|
|
1167
|
+
he.value = !0;
|
|
1168
1168
|
}));
|
|
1169
1169
|
break;
|
|
1170
1170
|
}
|
|
@@ -1175,14 +1175,14 @@ const Ce = () => {
|
|
|
1175
1175
|
M.value.forEach((v) => {
|
|
1176
1176
|
b.add(v.pages.peek().id);
|
|
1177
1177
|
});
|
|
1178
|
-
for (let v =
|
|
1179
|
-
const B =
|
|
1180
|
-
b.has(B) &&
|
|
1178
|
+
for (let v = W.value.length - 1; v >= 0; v--) {
|
|
1179
|
+
const B = W.value[v];
|
|
1180
|
+
b.has(B) && W.value.splice(v, 1);
|
|
1181
1181
|
}
|
|
1182
1182
|
le(() => {
|
|
1183
|
-
|
|
1183
|
+
he.value = !1, le(() => {
|
|
1184
1184
|
setTimeout(() => {
|
|
1185
|
-
|
|
1185
|
+
he.value = !0;
|
|
1186
1186
|
}, 300);
|
|
1187
1187
|
});
|
|
1188
1188
|
});
|
|
@@ -1191,16 +1191,20 @@ const Ce = () => {
|
|
|
1191
1191
|
}, _ = (b) => ae.get(b), k = (b) => {
|
|
1192
1192
|
ae.delete(b);
|
|
1193
1193
|
}, L = (b) => {
|
|
1194
|
-
|
|
1194
|
+
de.add(b);
|
|
1195
1195
|
}, $ = () => {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1196
|
+
if (de.size > 0) {
|
|
1197
|
+
for (let b = W.value.length - 1; b >= 0; b--)
|
|
1198
|
+
de.has(W.value[b]) && x(W).splice(b, 1);
|
|
1199
|
+
for (const b of de)
|
|
1200
|
+
k(b);
|
|
1201
|
+
de.clear();
|
|
1202
|
+
}
|
|
1199
1203
|
}, G = (b) => {
|
|
1200
|
-
for (let v =
|
|
1201
|
-
b ===
|
|
1204
|
+
for (let v = W.value.length - 1; v >= 0; v--)
|
|
1205
|
+
b === W.value[v] && x(W).splice(v, 1);
|
|
1202
1206
|
}, A = (b) => {
|
|
1203
|
-
new Set(
|
|
1207
|
+
new Set(W.value).has(b) || W.value.push(b);
|
|
1204
1208
|
}, C = (b, v = !0) => {
|
|
1205
1209
|
e.emit("FORWARD");
|
|
1206
1210
|
for (let B = M.value.length - 1; B >= 0; B--) {
|
|
@@ -1223,20 +1227,20 @@ const Ce = () => {
|
|
|
1223
1227
|
}, re = () => {
|
|
1224
1228
|
window.sessionStorage.removeItem(Je + Ke);
|
|
1225
1229
|
}, Le = () => {
|
|
1226
|
-
|
|
1230
|
+
he.value = !1, wt(), le(() => {
|
|
1227
1231
|
x(M).push(...Ye), e.emit(Z.TAB_ACTIVE, {
|
|
1228
1232
|
id: Ye[0].id
|
|
1229
1233
|
}), le(() => {
|
|
1230
|
-
|
|
1234
|
+
he.value = !0;
|
|
1231
1235
|
});
|
|
1232
1236
|
});
|
|
1233
1237
|
}, wt = () => {
|
|
1234
|
-
x(M).splice(0), ae.clear(),
|
|
1238
|
+
x(M).splice(0), ae.clear(), de.clear(), F.clear(), x(W).splice(0);
|
|
1235
1239
|
};
|
|
1236
1240
|
return {
|
|
1237
1241
|
tabs: M,
|
|
1238
|
-
caches:
|
|
1239
|
-
pageShown:
|
|
1242
|
+
caches: W,
|
|
1243
|
+
pageShown: he,
|
|
1240
1244
|
initialed: Lt,
|
|
1241
1245
|
setMaxSize: (b) => {
|
|
1242
1246
|
$e = b;
|
|
@@ -1288,7 +1292,7 @@ const Ce = () => {
|
|
|
1288
1292
|
}, null, 2),
|
|
1289
1293
|
Q("div", {
|
|
1290
1294
|
style: { "margin-left": "8px" },
|
|
1291
|
-
onContextmenu: n[0] || (n[0] =
|
|
1295
|
+
onContextmenu: n[0] || (n[0] = xe(() => {
|
|
1292
1296
|
}, ["prevent"]))
|
|
1293
1297
|
}, Gt(e.title), 33)
|
|
1294
1298
|
]));
|
|
@@ -1332,46 +1336,46 @@ const Ce = () => {
|
|
|
1332
1336
|
"z-index": x(ft)(".stack-tab,.stack-tab *")
|
|
1333
1337
|
})
|
|
1334
1338
|
}, [
|
|
1335
|
-
|
|
1339
|
+
N(ce, {
|
|
1336
1340
|
icon: "stack-tab__icon-reload svg-mask",
|
|
1337
1341
|
title: x(n)("VueStackTab.reload"),
|
|
1338
1342
|
onClick: m[0] || (m[0] = (S) => x(c)(l.tabItem.id))
|
|
1339
1343
|
}, null, 8, ["title"]),
|
|
1340
|
-
|
|
1344
|
+
N(ce, {
|
|
1341
1345
|
icon: "stack-tab__icon-reload-all svg-mask",
|
|
1342
1346
|
title: x(n)("VueStackTab.reloadAll"),
|
|
1343
1347
|
onClick: x(p)
|
|
1344
1348
|
}, null, 8, ["title", "onClick"]),
|
|
1345
|
-
|
|
1349
|
+
N(ce, {
|
|
1346
1350
|
icon: "stack-tab__icon-close svg-mask",
|
|
1347
1351
|
title: x(n)("VueStackTab.close"),
|
|
1348
1352
|
disabled: l.tabItem.closable ? null : "disabled",
|
|
1349
1353
|
onClick: m[1] || (m[1] = (S) => x(o)(l.tabItem.id))
|
|
1350
1354
|
}, null, 8, ["title", "disabled"]),
|
|
1351
|
-
|
|
1355
|
+
N(ce, {
|
|
1352
1356
|
icon: "stack-tab__icon-close-lefts svg-mask",
|
|
1353
1357
|
title: x(n)("VueStackTab.closeLeft"),
|
|
1354
1358
|
disabled: l.index <= 0 ? "disabled" : null,
|
|
1355
1359
|
onClick: m[2] || (m[2] = (S) => x(d)(l.tabItem.id))
|
|
1356
1360
|
}, null, 8, ["title", "disabled"]),
|
|
1357
|
-
|
|
1361
|
+
N(ce, {
|
|
1358
1362
|
icon: "stack-tab__icon-close-rights svg-mask",
|
|
1359
1363
|
title: x(n)("VueStackTab.closeRight"),
|
|
1360
1364
|
disabled: l.index >= l.max - 1 ? "disabled" : null,
|
|
1361
1365
|
onClick: m[3] || (m[3] = (S) => x(a)(l.tabItem.id))
|
|
1362
1366
|
}, null, 8, ["title", "disabled"]),
|
|
1363
|
-
|
|
1367
|
+
N(ce, {
|
|
1364
1368
|
icon: "stack-tab__icon-close-others svg-mask",
|
|
1365
1369
|
title: x(n)("VueStackTab.closeOthers"),
|
|
1366
1370
|
onClick: m[4] || (m[4] = (S) => x(f)(l.tabItem.id))
|
|
1367
1371
|
}, null, 8, ["title"]),
|
|
1368
|
-
|
|
1372
|
+
N(ce, {
|
|
1369
1373
|
icon: "stack-tab__icon-close-all svg-mask",
|
|
1370
1374
|
title: x(n)("VueStackTab.closeAll"),
|
|
1371
1375
|
onClick: x(i)
|
|
1372
1376
|
}, null, 8, ["title", "onClick"]),
|
|
1373
1377
|
l.contextMenu !== void 0 && l.contextMenu.length > 0 ? (R(), V("div", vs)) : se("", !0),
|
|
1374
|
-
(R(!0), V(je, null, lt(l.contextMenu, (S, E) => (R(),
|
|
1378
|
+
(R(!0), V(je, null, lt(l.contextMenu, (S, E) => (R(), ge(ce, {
|
|
1375
1379
|
key: E,
|
|
1376
1380
|
icon: S.icon,
|
|
1377
1381
|
title: S.title,
|
|
@@ -1418,11 +1422,11 @@ const Ce = () => {
|
|
|
1418
1422
|
},
|
|
1419
1423
|
emits: ["close", "active"],
|
|
1420
1424
|
setup(t, { emit: e }) {
|
|
1421
|
-
const n = e, s =
|
|
1425
|
+
const n = e, s = ye(), { t: r } = Me(), o = D(), i = t;
|
|
1422
1426
|
s.on(Z.TAB_ACTIVE, ({ id: p, isRoute: f }) => {
|
|
1423
1427
|
i.item.id === p && c(f);
|
|
1424
1428
|
});
|
|
1425
|
-
const d =
|
|
1429
|
+
const d = ke(() => i.item.title || r("undefined")), a = () => {
|
|
1426
1430
|
n("close", i.item);
|
|
1427
1431
|
}, c = (p = !0) => {
|
|
1428
1432
|
n("active", i.item, o, p);
|
|
@@ -1446,17 +1450,17 @@ const Ce = () => {
|
|
|
1446
1450
|
key: 0,
|
|
1447
1451
|
class: "stack-tab__icon-close-fill stack-tab__item-button",
|
|
1448
1452
|
title: x(r)("VueStackTab.close"),
|
|
1449
|
-
onClick:
|
|
1453
|
+
onClick: xe(a, ["stop"])
|
|
1450
1454
|
}, null, 8, xs)) : se("", !0)
|
|
1451
1455
|
], 2));
|
|
1452
1456
|
}
|
|
1453
1457
|
});
|
|
1454
|
-
var
|
|
1455
|
-
return
|
|
1458
|
+
var ve = [], Ss = function() {
|
|
1459
|
+
return ve.some(function(t) {
|
|
1456
1460
|
return t.activeTargets.length > 0;
|
|
1457
1461
|
});
|
|
1458
1462
|
}, Os = function() {
|
|
1459
|
-
return
|
|
1463
|
+
return ve.some(function(t) {
|
|
1460
1464
|
return t.skippedTargets.length > 0;
|
|
1461
1465
|
});
|
|
1462
1466
|
}, Rt = "ResizeObserver loop completed with undelivered notifications.", As = function() {
|
|
@@ -1468,16 +1472,16 @@ var be = [], Ss = function() {
|
|
|
1468
1472
|
(function(t) {
|
|
1469
1473
|
t.BORDER_BOX = "border-box", t.CONTENT_BOX = "content-box", t.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
|
|
1470
1474
|
})(Be || (Be = {}));
|
|
1471
|
-
var
|
|
1475
|
+
var me = function(t) {
|
|
1472
1476
|
return Object.freeze(t);
|
|
1473
1477
|
}, Es = /* @__PURE__ */ function() {
|
|
1474
1478
|
function t(e, n) {
|
|
1475
|
-
this.inlineSize = e, this.blockSize = n,
|
|
1479
|
+
this.inlineSize = e, this.blockSize = n, me(this);
|
|
1476
1480
|
}
|
|
1477
1481
|
return t;
|
|
1478
1482
|
}(), ln = function() {
|
|
1479
1483
|
function t(e, n, s, r) {
|
|
1480
|
-
return this.x = e, this.y = n, this.width = s, this.height = r, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width,
|
|
1484
|
+
return this.x = e, this.y = n, this.width = s, this.height = r, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, me(this);
|
|
1481
1485
|
}
|
|
1482
1486
|
return t.prototype.toJSON = function() {
|
|
1483
1487
|
var e = this, n = e.x, s = e.y, r = e.top, o = e.right, i = e.bottom, d = e.left, a = e.width, c = e.height;
|
|
@@ -1517,22 +1521,22 @@ var ve = function(t) {
|
|
|
1517
1521
|
return !1;
|
|
1518
1522
|
}, Ee = typeof window < "u" ? window : {}, De = /* @__PURE__ */ new WeakMap(), Dt = /auto|scroll/, Bs = /^tb|vertical/, Ms = /msie|trident/i.test(Ee.navigator && Ee.navigator.userAgent), K = function(t) {
|
|
1519
1523
|
return parseFloat(t || "0");
|
|
1520
|
-
},
|
|
1524
|
+
}, _e = function(t, e, n) {
|
|
1521
1525
|
return t === void 0 && (t = 0), e === void 0 && (e = 0), n === void 0 && (n = !1), new Es((n ? e : t) || 0, (n ? t : e) || 0);
|
|
1522
|
-
}, Pt =
|
|
1523
|
-
devicePixelContentBoxSize:
|
|
1524
|
-
borderBoxSize:
|
|
1525
|
-
contentBoxSize:
|
|
1526
|
+
}, Pt = me({
|
|
1527
|
+
devicePixelContentBoxSize: _e(),
|
|
1528
|
+
borderBoxSize: _e(),
|
|
1529
|
+
contentBoxSize: _e(),
|
|
1526
1530
|
contentRect: new ln(0, 0, 0, 0)
|
|
1527
1531
|
}), fn = function(t, e) {
|
|
1528
1532
|
if (e === void 0 && (e = !1), De.has(t) && !e)
|
|
1529
1533
|
return De.get(t);
|
|
1530
1534
|
if (un(t))
|
|
1531
1535
|
return De.set(t, Pt), Pt;
|
|
1532
|
-
var n = getComputedStyle(t), s = gt(t) && t.ownerSVGElement && t.getBBox(), r = !Ms && n.boxSizing === "border-box", o = Bs.test(n.writingMode || ""), i = !s && Dt.test(n.overflowY || ""), d = !s && Dt.test(n.overflowX || ""), a = s ? 0 : K(n.paddingTop), c = s ? 0 : K(n.paddingRight), p = s ? 0 : K(n.paddingBottom), f = s ? 0 : K(n.paddingLeft), l = s ? 0 : K(n.borderTopWidth), m = s ? 0 : K(n.borderRightWidth), S = s ? 0 : K(n.borderBottomWidth), E = s ? 0 : K(n.borderLeftWidth), I = f + c, y = a + p, w = E + m, T = l + S, g = d ? t.offsetHeight - T - t.clientHeight : 0, O = i ? t.offsetWidth - w - t.clientWidth : 0, u = r ? I + w : 0, _ = r ? y + T : 0, k = s ? s.width : K(n.width) - u - O, L = s ? s.height : K(n.height) - _ - g, $ = k + I + O + w, G = L + y + g + T, A =
|
|
1533
|
-
devicePixelContentBoxSize:
|
|
1534
|
-
borderBoxSize:
|
|
1535
|
-
contentBoxSize:
|
|
1536
|
+
var n = getComputedStyle(t), s = gt(t) && t.ownerSVGElement && t.getBBox(), r = !Ms && n.boxSizing === "border-box", o = Bs.test(n.writingMode || ""), i = !s && Dt.test(n.overflowY || ""), d = !s && Dt.test(n.overflowX || ""), a = s ? 0 : K(n.paddingTop), c = s ? 0 : K(n.paddingRight), p = s ? 0 : K(n.paddingBottom), f = s ? 0 : K(n.paddingLeft), l = s ? 0 : K(n.borderTopWidth), m = s ? 0 : K(n.borderRightWidth), S = s ? 0 : K(n.borderBottomWidth), E = s ? 0 : K(n.borderLeftWidth), I = f + c, y = a + p, w = E + m, T = l + S, g = d ? t.offsetHeight - T - t.clientHeight : 0, O = i ? t.offsetWidth - w - t.clientWidth : 0, u = r ? I + w : 0, _ = r ? y + T : 0, k = s ? s.width : K(n.width) - u - O, L = s ? s.height : K(n.height) - _ - g, $ = k + I + O + w, G = L + y + g + T, A = me({
|
|
1537
|
+
devicePixelContentBoxSize: _e(Math.round(k * devicePixelRatio), Math.round(L * devicePixelRatio), o),
|
|
1538
|
+
borderBoxSize: _e($, G, o),
|
|
1539
|
+
contentBoxSize: _e(k, L, o),
|
|
1536
1540
|
contentRect: new ln(f, a, k, L)
|
|
1537
1541
|
});
|
|
1538
1542
|
return De.set(t, A), A;
|
|
@@ -1549,7 +1553,7 @@ var ve = function(t) {
|
|
|
1549
1553
|
}, Cs = /* @__PURE__ */ function() {
|
|
1550
1554
|
function t(e) {
|
|
1551
1555
|
var n = fn(e);
|
|
1552
|
-
this.target = e, this.contentRect = n.contentRect, this.borderBoxSize =
|
|
1556
|
+
this.target = e, this.contentRect = n.contentRect, this.borderBoxSize = me([n.borderBoxSize]), this.contentBoxSize = me([n.contentBoxSize]), this.devicePixelContentBoxSize = me([n.devicePixelContentBoxSize]);
|
|
1553
1557
|
}
|
|
1554
1558
|
return t;
|
|
1555
1559
|
}(), hn = function(t) {
|
|
@@ -1560,7 +1564,7 @@ var ve = function(t) {
|
|
|
1560
1564
|
return e;
|
|
1561
1565
|
}, Ls = function() {
|
|
1562
1566
|
var t = 1 / 0, e = [];
|
|
1563
|
-
|
|
1567
|
+
ve.forEach(function(i) {
|
|
1564
1568
|
if (i.activeTargets.length !== 0) {
|
|
1565
1569
|
var d = [];
|
|
1566
1570
|
i.activeTargets.forEach(function(c) {
|
|
@@ -1577,7 +1581,7 @@ var ve = function(t) {
|
|
|
1577
1581
|
}
|
|
1578
1582
|
return t;
|
|
1579
1583
|
}, Nt = function(t) {
|
|
1580
|
-
|
|
1584
|
+
ve.forEach(function(n) {
|
|
1581
1585
|
n.activeTargets.splice(0, n.activeTargets.length), n.skippedTargets.splice(0, n.skippedTargets.length), n.observationTargets.forEach(function(r) {
|
|
1582
1586
|
r.isActive() && (hn(r.target) > t ? n.activeTargets.push(r) : n.skippedTargets.push(r));
|
|
1583
1587
|
});
|
|
@@ -1698,10 +1702,10 @@ var ve = function(t) {
|
|
|
1698
1702
|
Pe.set(e, s);
|
|
1699
1703
|
}, t.observe = function(e, n, s) {
|
|
1700
1704
|
var r = Pe.get(e), o = r.observationTargets.length === 0;
|
|
1701
|
-
qt(r.observationTargets, n) < 0 && (o &&
|
|
1705
|
+
qt(r.observationTargets, n) < 0 && (o && ve.push(r), r.observationTargets.push(new qs(n, s && s.box)), Ut(1), it.schedule());
|
|
1702
1706
|
}, t.unobserve = function(e, n) {
|
|
1703
1707
|
var s = Pe.get(e), r = qt(s.observationTargets, n), o = s.observationTargets.length === 1;
|
|
1704
|
-
r >= 0 && (o &&
|
|
1708
|
+
r >= 0 && (o && ve.splice(ve.indexOf(s), 1), s.observationTargets.splice(r, 1), Ut(-1));
|
|
1705
1709
|
}, t.disconnect = function(e) {
|
|
1706
1710
|
var n = this, s = Pe.get(e);
|
|
1707
1711
|
s.observationTargets.slice().forEach(function(r) {
|
|
@@ -1759,7 +1763,7 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1759
1763
|
class: fe(["stack-tab__mask-button", e.iconClass])
|
|
1760
1764
|
}, null, 2)),
|
|
1761
1765
|
"icon" in e.$slots ? (R(), V("div", Zs, [
|
|
1762
|
-
|
|
1766
|
+
Te(e.$slots, "icon")
|
|
1763
1767
|
])) : se("", !0)
|
|
1764
1768
|
], 10, Hs));
|
|
1765
1769
|
}
|
|
@@ -1786,11 +1790,11 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1786
1790
|
});
|
|
1787
1791
|
const m = (A) => {
|
|
1788
1792
|
i.value = A.scrollLeft <= 10, d.value = A.clientWidth + A.scrollLeft - A.scrollWidth >= -10, a.value = A.scrollWidth !== A.clientWidth;
|
|
1789
|
-
}, S =
|
|
1793
|
+
}, S = ke(() => f.scrollWidth > f.clientWidth), E = ke(() => {
|
|
1790
1794
|
if (!S.value) return 0;
|
|
1791
1795
|
const { clientWidth: A, scrollWidth: C } = f;
|
|
1792
1796
|
return A / C * A;
|
|
1793
|
-
}), I =
|
|
1797
|
+
}), I = ke(() => {
|
|
1794
1798
|
if (!S.value) return 0;
|
|
1795
1799
|
const { clientWidth: A, scrollWidth: C, scrollLeft: U } = f;
|
|
1796
1800
|
return (A - E.value) * (U / (C - A));
|
|
@@ -1851,7 +1855,7 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1851
1855
|
return !(C < U || C + A.clientWidth > U + n.value.clientWidth);
|
|
1852
1856
|
};
|
|
1853
1857
|
return e({ scrollIntoView: $, isInView: G }), (A, C) => (R(), V(je, null, [
|
|
1854
|
-
a.value ? (R(),
|
|
1858
|
+
a.value ? (R(), ge(at, {
|
|
1855
1859
|
key: 0,
|
|
1856
1860
|
"icon-class": "stack-tab__icon-left-arrow",
|
|
1857
1861
|
disabled: i.value,
|
|
@@ -1861,7 +1865,7 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1861
1865
|
ref_key: "headerScroll",
|
|
1862
1866
|
ref: c,
|
|
1863
1867
|
class: "stack-tab__scroll",
|
|
1864
|
-
onWheelPassive:
|
|
1868
|
+
onWheelPassive: xe(u, ["prevent"])
|
|
1865
1869
|
}, [
|
|
1866
1870
|
Q("div", {
|
|
1867
1871
|
ref_key: "container",
|
|
@@ -1873,7 +1877,7 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1873
1877
|
}]),
|
|
1874
1878
|
onScrollPassive: y
|
|
1875
1879
|
}, [
|
|
1876
|
-
|
|
1880
|
+
Te(A.$slots, "default")
|
|
1877
1881
|
], 34),
|
|
1878
1882
|
Yt(Q("div", {
|
|
1879
1883
|
ref_key: "bar",
|
|
@@ -1888,13 +1892,13 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1888
1892
|
width: `${E.value}px`,
|
|
1889
1893
|
transform: `translateX(${I.value}px)`
|
|
1890
1894
|
}),
|
|
1891
|
-
onMousedown:
|
|
1895
|
+
onMousedown: xe(_, ["prevent"])
|
|
1892
1896
|
}, null, 38)
|
|
1893
1897
|
], 2), [
|
|
1894
1898
|
[Kt, S.value]
|
|
1895
1899
|
])
|
|
1896
1900
|
], 544),
|
|
1897
|
-
a.value ? (R(),
|
|
1901
|
+
a.value ? (R(), ge(at, {
|
|
1898
1902
|
key: 1,
|
|
1899
1903
|
"icon-class": "stack-tab__icon-right-arrow",
|
|
1900
1904
|
disabled: d.value,
|
|
@@ -1906,7 +1910,7 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1906
1910
|
__name: "index",
|
|
1907
1911
|
props: {
|
|
1908
1912
|
space: {},
|
|
1909
|
-
tabScrollMode: { default:
|
|
1913
|
+
tabScrollMode: { default: be.BOTH },
|
|
1910
1914
|
tabTransition: { default: () => ({
|
|
1911
1915
|
name: "stack-tab-zoom"
|
|
1912
1916
|
}) },
|
|
@@ -1915,9 +1919,9 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1915
1919
|
},
|
|
1916
1920
|
emits: ["active"],
|
|
1917
1921
|
setup(t, { emit: e }) {
|
|
1918
|
-
const { t: n } = Me(), s = ct("maximum"), r = e, o = D(), { shown: i, contextMenuData: d, showContextMenu: a } = ws(), c = t, { removeTab: p, active: f, tabs: l } = Ce(), m =
|
|
1922
|
+
const { t: n } = Me(), s = ct("maximum"), r = e, o = D(), { shown: i, contextMenuData: d, showContextMenu: a } = ws(), c = t, { removeTab: p, active: f, tabs: l } = Ce(), m = ke(() => typeof c.tabTransition == "string" ? {
|
|
1919
1923
|
name: c.tabTransition
|
|
1920
|
-
} : c.tabTransition), S =
|
|
1924
|
+
} : c.tabTransition), S = ke(() => c.tabScrollMode === be.BOTH || c.tabScrollMode === be.BUTTON), E = c.tabScrollMode === be.BOTH || c.tabScrollMode === be.WHEEL, I = (w) => {
|
|
1921
1925
|
w.closable && p(w.id), i.value = !1;
|
|
1922
1926
|
}, y = (w, T, g) => {
|
|
1923
1927
|
o.value && (le(() => {
|
|
@@ -1925,8 +1929,8 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1925
1929
|
}), f(w.id, g), r("active", w.id));
|
|
1926
1930
|
};
|
|
1927
1931
|
return (w, T) => (R(), V("div", Xs, [
|
|
1928
|
-
|
|
1929
|
-
|
|
1932
|
+
Te(w.$slots, "leftButton"),
|
|
1933
|
+
N(js, {
|
|
1930
1934
|
ref_key: "scroll",
|
|
1931
1935
|
ref: o,
|
|
1932
1936
|
space: w.space,
|
|
@@ -1934,21 +1938,21 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1934
1938
|
"is-scroll-button": S.value
|
|
1935
1939
|
}, {
|
|
1936
1940
|
default: ue(() => [
|
|
1937
|
-
|
|
1941
|
+
N(Jt, _n({
|
|
1938
1942
|
key: "tabItemTrans",
|
|
1939
1943
|
tag: "ul",
|
|
1940
1944
|
class: "stack-tab__nav"
|
|
1941
1945
|
}, m.value, { appear: "" }), {
|
|
1942
1946
|
default: ue(() => [
|
|
1943
|
-
(R(!0), V(je, null, lt(x(l), (g, O) => (R(),
|
|
1947
|
+
(R(!0), V(je, null, lt(x(l), (g, O) => (R(), ge(Ts, {
|
|
1944
1948
|
key: g.id,
|
|
1945
1949
|
contextmenu: w.contextmenu,
|
|
1946
1950
|
item: g,
|
|
1947
|
-
onContextmenu:
|
|
1951
|
+
onContextmenu: xe(
|
|
1948
1952
|
(u) => x(a)(u, g, O, x(l).length),
|
|
1949
1953
|
["prevent"]
|
|
1950
1954
|
),
|
|
1951
|
-
onMouseup:
|
|
1955
|
+
onMouseup: xe((u) => I(g), ["middle", "prevent"]),
|
|
1952
1956
|
onClose: I,
|
|
1953
1957
|
onActive: y
|
|
1954
1958
|
}, null, 8, ["contextmenu", "item", "onContextmenu", "onMouseup"]))), 128))
|
|
@@ -1958,18 +1962,18 @@ const Hs = ["disabled", "title"], Zs = {
|
|
|
1958
1962
|
]),
|
|
1959
1963
|
_: 1
|
|
1960
1964
|
}, 8, ["space", "is-scroll-wheel", "is-scroll-button"]),
|
|
1961
|
-
|
|
1962
|
-
|
|
1965
|
+
Te(w.$slots, "rightButton"),
|
|
1966
|
+
N(at, {
|
|
1963
1967
|
"icon-class": x(s) ? "stack-tab__icon-restore" : "stack-tab__icon-fullscreen",
|
|
1964
1968
|
title: x(n)("VueStackTab.maximum"),
|
|
1965
1969
|
onClick: T[0] || (T[0] = (g) => s.value = !x(s))
|
|
1966
1970
|
}, null, 8, ["icon-class", "title"]),
|
|
1967
|
-
|
|
1971
|
+
N(Qt, {
|
|
1968
1972
|
name: "stack-tab-zoom",
|
|
1969
1973
|
appear: ""
|
|
1970
1974
|
}, {
|
|
1971
1975
|
default: ue(() => [
|
|
1972
|
-
x(i) ? (R(),
|
|
1976
|
+
x(i) ? (R(), ge(ys, {
|
|
1973
1977
|
key: "tabMenuTrans",
|
|
1974
1978
|
left: x(d).left,
|
|
1975
1979
|
top: x(d).top,
|
|
@@ -2010,7 +2014,7 @@ function Ys(t, e, n) {
|
|
|
2010
2014
|
}
|
|
2011
2015
|
let Ht;
|
|
2012
2016
|
const Ks = () => {
|
|
2013
|
-
const t = ut(), { active: e, hasTab: n, pageShown: s, reset: r, canAddTab: o, renewTab: i, getTab: d } = Ce(), a =
|
|
2017
|
+
const t = ut(), { active: e, hasTab: n, pageShown: s, reset: r, canAddTab: o, renewTab: i, getTab: d } = Ce(), a = ye(), c = Ys(500, (m, S = !1) => new Promise((E, I) => {
|
|
2014
2018
|
if (!s.value) {
|
|
2015
2019
|
I();
|
|
2016
2020
|
return;
|
|
@@ -2069,7 +2073,7 @@ const Ks = () => {
|
|
|
2069
2073
|
pageTransition: { default: "stack-tab-swap" },
|
|
2070
2074
|
pageTransitionBack: { default: "stack-tab-swap-back" },
|
|
2071
2075
|
tabTransition: { default: "stack-tab-zoom" },
|
|
2072
|
-
tabScrollMode: { default:
|
|
2076
|
+
tabScrollMode: { default: be.BOTH },
|
|
2073
2077
|
width: { default: "100%" },
|
|
2074
2078
|
height: { default: "100%" },
|
|
2075
2079
|
i18n: { default: "zh-CN" },
|
|
@@ -2094,7 +2098,7 @@ const Ks = () => {
|
|
|
2094
2098
|
});
|
|
2095
2099
|
const T = () => {
|
|
2096
2100
|
l("onPageLoaded");
|
|
2097
|
-
}, g = D(m.pageTransition), O =
|
|
2101
|
+
}, g = D(m.pageTransition), O = ye();
|
|
2098
2102
|
return O.on("FORWARD", () => {
|
|
2099
2103
|
g.value = m.pageTransition;
|
|
2100
2104
|
}), O.on("BACKWARD", () => {
|
|
@@ -2111,31 +2115,31 @@ const Ks = () => {
|
|
|
2111
2115
|
"z-index": E.value ? x(ft)("body *:not(.stack-tab,.stack-tab *)") : void 0
|
|
2112
2116
|
})
|
|
2113
2117
|
}, [
|
|
2114
|
-
|
|
2118
|
+
N(Gs, {
|
|
2115
2119
|
space: u.space,
|
|
2116
2120
|
onActive: w,
|
|
2117
2121
|
"tab-transition": u.tabTransition,
|
|
2118
2122
|
max: u.max
|
|
2119
2123
|
}, {
|
|
2120
2124
|
leftButton: ue(() => [
|
|
2121
|
-
|
|
2125
|
+
Te(u.$slots, "leftButton")
|
|
2122
2126
|
]),
|
|
2123
2127
|
rightButton: ue(() => [
|
|
2124
|
-
|
|
2128
|
+
Te(u.$slots, "rightButton")
|
|
2125
2129
|
]),
|
|
2126
2130
|
_: 3
|
|
2127
2131
|
}, 8, ["space", "tab-transition", "max"]),
|
|
2128
2132
|
Q("div", Js, [
|
|
2129
|
-
|
|
2133
|
+
N(k, null, {
|
|
2130
2134
|
default: ue(({ Component: L, route: $ }) => [
|
|
2131
|
-
|
|
2135
|
+
N(Qt, {
|
|
2132
2136
|
name: g.value,
|
|
2133
2137
|
appear: "",
|
|
2134
2138
|
mode: "out-in"
|
|
2135
2139
|
}, {
|
|
2136
2140
|
default: ue(() => [
|
|
2137
|
-
(R(),
|
|
2138
|
-
x(s) ? (R(),
|
|
2141
|
+
(R(), ge(Sn, { include: x(r) }, [
|
|
2142
|
+
x(s) ? (R(), ge(On(y($, L)), {
|
|
2139
2143
|
key: `${$.name}_${$.fullPath}`,
|
|
2140
2144
|
onOnLoaded: T
|
|
2141
2145
|
}, null, 32)) : se("", !0)
|
|
@@ -2146,7 +2150,7 @@ const Ks = () => {
|
|
|
2146
2150
|
]),
|
|
2147
2151
|
_: 1
|
|
2148
2152
|
}),
|
|
2149
|
-
|
|
2153
|
+
N(Jt, {
|
|
2150
2154
|
name: u.pageTransition,
|
|
2151
2155
|
appear: ""
|
|
2152
2156
|
}, {
|
|
@@ -2204,7 +2208,7 @@ const nr = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" :
|
|
|
2204
2208
|
d + `background-image: url(${i});background-size: 580px 100px;background-repeat: norepeat; color: transparent;`
|
|
2205
2209
|
);
|
|
2206
2210
|
}, ur = () => {
|
|
2207
|
-
const { attrs: t, props: e } = en(), { pageShown: n, getTab: s, markDeletableCache: r, removeComponent: o, getComponent: i, addPageScroller: d } = Ce(), a = An(), c = ut(), p =
|
|
2211
|
+
const { attrs: t, props: e } = en(), { pageShown: n, getTab: s, markDeletableCache: r, removeComponent: o, getComponent: i, addPageScroller: d } = Ce(), a = An(), c = ut(), p = ye();
|
|
2208
2212
|
let f = "", l = "";
|
|
2209
2213
|
f = t.tId || e.tId;
|
|
2210
2214
|
const m = t.pId || e.pId;
|
|
@@ -2269,7 +2273,7 @@ const nr = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" :
|
|
|
2269
2273
|
};
|
|
2270
2274
|
}
|
|
2271
2275
|
}), gr = () => {
|
|
2272
|
-
const t =
|
|
2276
|
+
const t = ye(), { attrs: e } = en();
|
|
2273
2277
|
Ze(() => {
|
|
2274
2278
|
s();
|
|
2275
2279
|
});
|
|
@@ -2281,7 +2285,7 @@ const nr = (t) => t.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" :
|
|
|
2281
2285
|
return { openTabLoading: n, closeTabLoading: s };
|
|
2282
2286
|
}, yr = {
|
|
2283
2287
|
install(t, e) {
|
|
2284
|
-
lr("0.1.
|
|
2288
|
+
lr("0.1.46"), t.component("VueStackTabs", er).use(hs).use(Un().getI18n(e));
|
|
2285
2289
|
}
|
|
2286
2290
|
};
|
|
2287
2291
|
export {
|
|
@@ -2289,7 +2293,7 @@ export {
|
|
|
2289
2293
|
Xe as Stack,
|
|
2290
2294
|
er as StackTab,
|
|
2291
2295
|
at as TabHeaderButton,
|
|
2292
|
-
|
|
2296
|
+
be as TabScrollMode,
|
|
2293
2297
|
yr as default,
|
|
2294
2298
|
Ks as useStackTab,
|
|
2295
2299
|
gr as useTabLoading,
|