mamba-layout 0.12.0 → 0.14.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 CHANGED
@@ -1,8 +1,8 @@
1
- import { ref as N, readonly as pt, computed as S, unref as f, onActivated as mt, watch as re, onMounted as Re, onUnmounted as Ke, defineComponent as M, openBlock as l, createElementBlock as y, normalizeClass as K, resolveComponent as L, Fragment as U, createBlock as k, resolveDynamicComponent as be, 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 Ae, 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";
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, _e = "UTC", Qe = "timezone", wt = [
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) || _e, Ce = N(
99
+ }, Ye = () => ne(Intl.DateTimeFormat().resolvedOptions().timeZone) || Ce, Se = N(
100
100
  ne(W.get(Qe)) || Ye()
101
- ), kt = () => pt(Ce);
101
+ ), kt = () => pt(Se);
102
102
  function It(n) {
103
103
  const e = ne(n);
104
- e && (Ce.value = e, W.set(Qe, e, null));
104
+ e && (Se.value = e, W.set(Qe, e, null));
105
105
  }
106
106
  const Lt = (n) => {
107
- const e = ne(n) || _e, t = Me.get(e);
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) || _e, a = xt(e, t), o = Date.UTC(
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, Ce.value].filter(
138
+ [Ye(), ...wt, Se.value].filter(
139
139
  qe
140
140
  )
141
141
  );
@@ -251,7 +251,9 @@ const Jt = (n) => {
251
251
  })) || [];
252
252
  }, $e = (n, e, t = 0, a) => {
253
253
  var i, h, m, v;
254
- const o = ie(), s = a ? [...a] : [], r = [], c = [];
254
+ const o = ie();
255
+ if (!o) return;
256
+ const s = a ? [...a] : [], r = [], c = [];
255
257
  for (const p in n) {
256
258
  [...s], n[p];
257
259
  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}$`);
@@ -287,21 +289,19 @@ const Jt = (n) => {
287
289
  }, Be = () => {
288
290
  const n = ie();
289
291
  V.value = "/" + (n.path.split("/").filter(Boolean).shift() || ""), et(), ae.value = oe();
290
- }, Se = () => {
292
+ }, be = () => {
291
293
  const n = window.innerWidth < Ot;
292
294
  ye.value = n, ve.value = !n;
293
295
  };
294
- Se();
295
- Re(() => {
296
- window.addEventListener("resize", Se);
297
- });
298
- Ke(() => {
299
- window.removeEventListener("resize", Se);
300
- });
296
+ be();
301
297
  function H() {
302
298
  const n = ie();
303
299
  return Be(), mt(() => {
304
300
  Be();
301
+ }), Re(() => {
302
+ window.addEventListener("resize", be);
303
+ }), Ke(() => {
304
+ window.removeEventListener("resize", be);
305
305
  }), re(
306
306
  () => V.value,
307
307
  () => void (ae.value = oe())
@@ -387,7 +387,7 @@ const Ht = { class: "menu-item-icon" }, Qt = ["innerHTML"], zt = /* @__PURE__ */
387
387
  var v, p;
388
388
  const m = L("AsideSubMenuItem", !0);
389
389
  return l(), y(U, null, [
390
- (l(), k(be(r.value), Je({
390
+ (l(), k(Ae(r.value), Je({
391
391
  class: ["pt-1 pb-1 pl-3 pr-3 flex items-center gap-2 rounded-md", [
392
392
  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
393
  (v = t.value) != null && v.length ? " h-7" : " h-9.5 cursor-pointer hover:bg-[var(--ui-sidebar-hover-bg)]"
@@ -539,7 +539,7 @@ const ot = (n, e) => n.reduce(
539
539
  d("span", null, E(i.name), 1),
540
540
  (h = i.children) != null && h.length ? (l(), k(c, { key: 0 }, {
541
541
  default: C(() => [
542
- _(f(Ae))
542
+ _(f(_e))
543
543
  ]),
544
544
  _: 1
545
545
  })) : I("", !0)
@@ -576,7 +576,7 @@ const ot = (n, e) => n.reduce(
576
576
  iconOnly: { type: Boolean, default: !0 }
577
577
  },
578
578
  setup(n) {
579
- return (e, t) => (l(), k(be(n.tag), {
579
+ return (e, t) => (l(), k(Ae(n.tag), {
580
580
  type: n.tag === "button" ? n.type : void 0,
581
581
  class: K(["nav-icon-btn", { "nav-icon-btn--icon-only": n.iconOnly }])
582
582
  }, {
@@ -1652,7 +1652,7 @@ const ot = (n, e) => n.reduce(
1652
1652
  class: "language-select__caret"
1653
1653
  }, {
1654
1654
  default: C(() => [
1655
- _(f(Ae))
1655
+ _(f(_e))
1656
1656
  ]),
1657
1657
  _: 1
1658
1658
  })) : I("", !0)
@@ -2055,7 +2055,7 @@ const ot = (n, e) => n.reduce(
2055
2055
  class: "timezone-select__caret"
2056
2056
  }, {
2057
2057
  default: C(() => [
2058
- _(f(Ae))
2058
+ _(f(_e))
2059
2059
  ]),
2060
2060
  _: 1
2061
2061
  })) : I("", !0)
@@ -2497,7 +2497,7 @@ const ot = (n, e) => n.reduce(
2497
2497
  key: g(T),
2498
2498
  class: "layout-page-view"
2499
2499
  }, [
2500
- (l(), k(be(b)))
2500
+ (l(), k(Ae(b)))
2501
2501
  ]))
2502
2502
  ]),
2503
2503
  _: 2