mamba-layout 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js.js +22 -24
- package/dist/layout.es.js +498 -500
- package/dist/layout.global.js +1 -1
- package/package.json +1 -1
package/dist/index.js.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as N, readonly as pt, computed as S, unref as f, onActivated as mt,
|
|
2
|
-
import { Fold as Fe, ArrowDown as
|
|
1
|
+
import { ref as N, readonly as pt, computed as S, unref as f, onActivated as mt, onMounted as Re, onUnmounted as Ke, watch as re, defineComponent as M, openBlock as l, createElementBlock as y, normalizeClass as K, resolveComponent as L, Fragment as U, createBlock as k, resolveDynamicComponent as Ae, mergeProps as Je, withCtx as C, createCommentVNode as I, createElementVNode as d, toDisplayString as E, renderList as J, withDirectives as ht, vShow as gt, createVNode as _, renderSlot as z, watchEffect as Oe, Transition as Ee } from "vue";
|
|
2
|
+
import { Fold as Fe, ArrowDown as _e, Moon as ft, Sunny as vt, Expand as yt, User as bt, ArrowLeft as At, ArrowRight as he, Clock as _t } from "@element-plus/icons-vue";
|
|
3
3
|
import { useRoute as ie, useRouter as He } from "vue-router";
|
|
4
4
|
import { createI18n as Ct } from "vue-i18n";
|
|
5
|
-
const St = 3600 * 24 * 7,
|
|
5
|
+
const St = 3600 * 24 * 7, Ce = "UTC", Qe = "timezone", wt = [
|
|
6
6
|
"UTC",
|
|
7
7
|
"Asia/Shanghai",
|
|
8
8
|
"Asia/Hong_Kong",
|
|
@@ -96,15 +96,15 @@ const Ne = (n, e, t) => {
|
|
|
96
96
|
} catch {
|
|
97
97
|
return !1;
|
|
98
98
|
}
|
|
99
|
-
}, Ye = () => ne(Intl.DateTimeFormat().resolvedOptions().timeZone) ||
|
|
99
|
+
}, Ye = () => ne(Intl.DateTimeFormat().resolvedOptions().timeZone) || Ce, Se = N(
|
|
100
100
|
ne(W.get(Qe)) || Ye()
|
|
101
|
-
), kt = () => pt(
|
|
101
|
+
), kt = () => pt(Se);
|
|
102
102
|
function It(n) {
|
|
103
103
|
const e = ne(n);
|
|
104
|
-
e && (
|
|
104
|
+
e && (Se.value = e, W.set(Qe, e, null));
|
|
105
105
|
}
|
|
106
106
|
const Lt = (n) => {
|
|
107
|
-
const e = ne(n) ||
|
|
107
|
+
const e = ne(n) || Ce, t = Me.get(e);
|
|
108
108
|
if (t) return t;
|
|
109
109
|
const a = new Intl.DateTimeFormat("en-US", {
|
|
110
110
|
timeZone: e,
|
|
@@ -118,7 +118,7 @@ const Lt = (n) => {
|
|
|
118
118
|
});
|
|
119
119
|
return Me.set(e, a), a;
|
|
120
120
|
}, xt = (n, e) => Lt(e).formatToParts(n).reduce((a, o) => (o.type !== "literal" && (a[o.type] = Number(o.value)), a), {}), Et = (n, e = /* @__PURE__ */ new Date()) => {
|
|
121
|
-
const t = ne(n) ||
|
|
121
|
+
const t = ne(n) || Ce, a = xt(e, t), o = Date.UTC(
|
|
122
122
|
a.year || 0,
|
|
123
123
|
(a.month || 1) - 1,
|
|
124
124
|
a.day || 1,
|
|
@@ -135,7 +135,7 @@ const Lt = (n) => {
|
|
|
135
135
|
).padStart(2, "0")}`;
|
|
136
136
|
}, Mt = (n, e = /* @__PURE__ */ new Date()) => `${n} (${We(n, e)})`, Dt = (n = /* @__PURE__ */ new Date()) => {
|
|
137
137
|
const e = new Set(
|
|
138
|
-
[Ye(), ...wt,
|
|
138
|
+
[Ye(), ...wt, Se.value].filter(
|
|
139
139
|
qe
|
|
140
140
|
)
|
|
141
141
|
);
|
|
@@ -254,7 +254,7 @@ const Jt = (n) => {
|
|
|
254
254
|
const o = ie(), s = a ? [...a] : [], r = [], c = [];
|
|
255
255
|
for (const p in n) {
|
|
256
256
|
[...s], n[p];
|
|
257
|
-
const b = ((i = o.meta) == null ? void 0 : i.parent) || o.path, T = ((h = n[p].path) == null ? void 0 : h.replace(/\/:(\w+)/g, "/([^/]+)")) || "", B = new RegExp(`^${T}$`);
|
|
257
|
+
const b = ((i = o == null ? void 0 : o.meta) == null ? void 0 : i.parent) || o.path, T = ((h = n[p].path) == null ? void 0 : h.replace(/\/:(\w+)/g, "/([^/]+)")) || "", B = new RegExp(`^${T}$`);
|
|
258
258
|
b == n[p].path ? r.push({ index: p, item: n[p] }) : B.test(b) && c.push({ index: p, item: n[p] });
|
|
259
259
|
}
|
|
260
260
|
const g = r.length > 0 ? r : c;
|
|
@@ -287,21 +287,19 @@ const Jt = (n) => {
|
|
|
287
287
|
}, Be = () => {
|
|
288
288
|
const n = ie();
|
|
289
289
|
V.value = "/" + (n.path.split("/").filter(Boolean).shift() || ""), et(), ae.value = oe();
|
|
290
|
-
},
|
|
290
|
+
}, be = () => {
|
|
291
291
|
const n = window.innerWidth < Ot;
|
|
292
292
|
ye.value = n, ve.value = !n;
|
|
293
293
|
};
|
|
294
|
-
|
|
295
|
-
Re(() => {
|
|
296
|
-
window.addEventListener("resize", Se);
|
|
297
|
-
});
|
|
298
|
-
Ke(() => {
|
|
299
|
-
window.removeEventListener("resize", Se);
|
|
300
|
-
});
|
|
294
|
+
be();
|
|
301
295
|
function H() {
|
|
302
296
|
const n = ie();
|
|
303
297
|
return Be(), mt(() => {
|
|
304
298
|
Be();
|
|
299
|
+
}), Re(() => {
|
|
300
|
+
window.addEventListener("resize", be);
|
|
301
|
+
}), Ke(() => {
|
|
302
|
+
window.removeEventListener("resize", be);
|
|
305
303
|
}), re(
|
|
306
304
|
() => V.value,
|
|
307
305
|
() => void (ae.value = oe())
|
|
@@ -387,7 +385,7 @@ const Ht = { class: "menu-item-icon" }, Qt = ["innerHTML"], zt = /* @__PURE__ */
|
|
|
387
385
|
var v, p;
|
|
388
386
|
const m = L("AsideSubMenuItem", !0);
|
|
389
387
|
return l(), y(U, null, [
|
|
390
|
-
(l(), k(
|
|
388
|
+
(l(), k(Ae(r.value), Je({
|
|
391
389
|
class: ["pt-1 pb-1 pl-3 pr-3 flex items-center gap-2 rounded-md", [
|
|
392
390
|
e.menu.path == f(a) ? "bg-[var(--ui-sidebar-active-bg,var(--el-fill-color))] text-[var(--ui-sidebar-active-fg)] font-medium" : "text-[var(--ui-sidebar-foreground)]",
|
|
393
391
|
(v = t.value) != null && v.length ? " h-7" : " h-9.5 cursor-pointer hover:bg-[var(--ui-sidebar-hover-bg)]"
|
|
@@ -539,7 +537,7 @@ const ot = (n, e) => n.reduce(
|
|
|
539
537
|
d("span", null, E(i.name), 1),
|
|
540
538
|
(h = i.children) != null && h.length ? (l(), k(c, { key: 0 }, {
|
|
541
539
|
default: C(() => [
|
|
542
|
-
_(f(
|
|
540
|
+
_(f(_e))
|
|
543
541
|
]),
|
|
544
542
|
_: 1
|
|
545
543
|
})) : I("", !0)
|
|
@@ -576,7 +574,7 @@ const ot = (n, e) => n.reduce(
|
|
|
576
574
|
iconOnly: { type: Boolean, default: !0 }
|
|
577
575
|
},
|
|
578
576
|
setup(n) {
|
|
579
|
-
return (e, t) => (l(), k(
|
|
577
|
+
return (e, t) => (l(), k(Ae(n.tag), {
|
|
580
578
|
type: n.tag === "button" ? n.type : void 0,
|
|
581
579
|
class: K(["nav-icon-btn", { "nav-icon-btn--icon-only": n.iconOnly }])
|
|
582
580
|
}, {
|
|
@@ -1652,7 +1650,7 @@ const ot = (n, e) => n.reduce(
|
|
|
1652
1650
|
class: "language-select__caret"
|
|
1653
1651
|
}, {
|
|
1654
1652
|
default: C(() => [
|
|
1655
|
-
_(f(
|
|
1653
|
+
_(f(_e))
|
|
1656
1654
|
]),
|
|
1657
1655
|
_: 1
|
|
1658
1656
|
})) : I("", !0)
|
|
@@ -2055,7 +2053,7 @@ const ot = (n, e) => n.reduce(
|
|
|
2055
2053
|
class: "timezone-select__caret"
|
|
2056
2054
|
}, {
|
|
2057
2055
|
default: C(() => [
|
|
2058
|
-
_(f(
|
|
2056
|
+
_(f(_e))
|
|
2059
2057
|
]),
|
|
2060
2058
|
_: 1
|
|
2061
2059
|
})) : I("", !0)
|
|
@@ -2497,7 +2495,7 @@ const ot = (n, e) => n.reduce(
|
|
|
2497
2495
|
key: g(T),
|
|
2498
2496
|
class: "layout-page-view"
|
|
2499
2497
|
}, [
|
|
2500
|
-
(l(), k(
|
|
2498
|
+
(l(), k(Ae(b)))
|
|
2501
2499
|
]))
|
|
2502
2500
|
]),
|
|
2503
2501
|
_: 2
|