mamba-layout 0.7.0 → 0.9.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.
Files changed (103) hide show
  1. package/dist/index.css +1 -0
  2. package/dist/index.js.js +2560 -0
  3. package/dist/layout/hooks/useTheme.d.ts +6 -14
  4. package/dist/layout.es.js +5734 -5735
  5. package/dist/layout.global.js +30 -30
  6. package/package.json +1 -1
  7. package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
  8. package/dist/assets/logo.png.js +0 -4
  9. package/dist/components/UserAvatar/index.js +0 -5
  10. package/dist/components/UserAvatar/src/UserAvatar.css +0 -1
  11. package/dist/components/UserAvatar/src/UserAvatar.vue.js +0 -7
  12. package/dist/components/UserAvatar/src/UserAvatar.vue2.js +0 -61
  13. package/dist/components/index.js +0 -10
  14. package/dist/index.js +0 -35
  15. package/dist/layout/BaseLayout.css +0 -1
  16. package/dist/layout/BaseLayout.vue.js +0 -7
  17. package/dist/layout/BaseLayout.vue2.js +0 -111
  18. package/dist/layout/components/AppSelect.css +0 -1
  19. package/dist/layout/components/AppSelect.vue.js +0 -7
  20. package/dist/layout/components/AppSelect.vue2.js +0 -69
  21. package/dist/layout/components/AsideBar.css +0 -1
  22. package/dist/layout/components/AsideBar.vue.js +0 -7
  23. package/dist/layout/components/AsideBar.vue2.js +0 -49
  24. package/dist/layout/components/AsideSubMenuItem.vue.js +0 -84
  25. package/dist/layout/components/AsideSubMenuItem.vue2.js +0 -4
  26. package/dist/layout/components/AsideSubMenus.vue.js +0 -36
  27. package/dist/layout/components/AsideSubMenus.vue2.js +0 -4
  28. package/dist/layout/components/HeaderBar.css +0 -1
  29. package/dist/layout/components/HeaderBar.vue.js +0 -7
  30. package/dist/layout/components/HeaderBar.vue2.js +0 -55
  31. package/dist/layout/components/LanguageSelect.css +0 -1
  32. package/dist/layout/components/LanguageSelect.vue.js +0 -8
  33. package/dist/layout/components/LanguageSelect.vue2.js +0 -100
  34. package/dist/layout/components/LanguageSelect2.css +0 -1
  35. package/dist/layout/components/LayoutBreadcrumb.css +0 -1
  36. package/dist/layout/components/LayoutBreadcrumb.vue.js +0 -7
  37. package/dist/layout/components/LayoutBreadcrumb.vue2.js +0 -189
  38. package/dist/layout/components/MenuItemIcon.css +0 -1
  39. package/dist/layout/components/MenuItemIcon.vue.js +0 -7
  40. package/dist/layout/components/MenuItemIcon.vue2.js +0 -23
  41. package/dist/layout/components/NavIconBtn.css +0 -1
  42. package/dist/layout/components/NavIconBtn.vue.js +0 -7
  43. package/dist/layout/components/NavIconBtn.vue2.js +0 -23
  44. package/dist/layout/components/SHeaderRight.css +0 -1
  45. package/dist/layout/components/SHeaderRight.vue.js +0 -7
  46. package/dist/layout/components/SHeaderRight.vue2.js +0 -68
  47. package/dist/layout/components/ThemeToggle.css +0 -1
  48. package/dist/layout/components/ThemeToggle.vue.js +0 -7
  49. package/dist/layout/components/ThemeToggle.vue2.js +0 -30
  50. package/dist/layout/components/TimezoneSelect.css +0 -1
  51. package/dist/layout/components/TimezoneSelect.vue.js +0 -8
  52. package/dist/layout/components/TimezoneSelect.vue2.js +0 -78
  53. package/dist/layout/components/TimezoneSelect2.css +0 -1
  54. package/dist/layout/components/UserInfo.css +0 -1
  55. package/dist/layout/components/UserInfo.vue.js +0 -8
  56. package/dist/layout/components/UserInfo.vue2.js +0 -111
  57. package/dist/layout/components/UserInfo2.css +0 -1
  58. package/dist/layout/components/index.js +0 -8
  59. package/dist/layout/components/mobile/AppSelectMobile.vue.js +0 -60
  60. package/dist/layout/components/mobile/AppSelectMobile.vue2.js +0 -4
  61. package/dist/layout/components/mobile/AsideBarMobile.css +0 -1
  62. package/dist/layout/components/mobile/AsideBarMobile.vue.js +0 -7
  63. package/dist/layout/components/mobile/AsideBarMobile.vue2.js +0 -49
  64. package/dist/layout/components/mobile/AsideUserMobile.css +0 -1
  65. package/dist/layout/components/mobile/AsideUserMobile.vue.js +0 -7
  66. package/dist/layout/components/mobile/AsideUserMobile.vue2.js +0 -56
  67. package/dist/layout/components/mobile/AsideUserMobilePopover.css +0 -1
  68. package/dist/layout/components/mobile/AsideUserMobilePopover.vue.js +0 -7
  69. package/dist/layout/components/mobile/AsideUserMobilePopover.vue2.js +0 -52
  70. package/dist/layout/components/mobile/HeaderRightMobile.css +0 -1
  71. package/dist/layout/components/mobile/HeaderRightMobile.vue.js +0 -7
  72. package/dist/layout/components/mobile/HeaderRightMobile.vue2.js +0 -46
  73. package/dist/layout/components/mobile/MobileMenuToggle.css +0 -1
  74. package/dist/layout/components/mobile/MobileMenuToggle.vue.js +0 -7
  75. package/dist/layout/components/mobile/MobileMenuToggle.vue2.js +0 -33
  76. package/dist/layout/hooks/index.js +0 -21
  77. package/dist/layout/hooks/useApp.js +0 -20
  78. package/dist/layout/hooks/useSetting.js +0 -24
  79. package/dist/layout/hooks/useState.js +0 -100
  80. package/dist/layout/hooks/useTheme.js +0 -48
  81. package/dist/layout/utils/index.js +0 -54
  82. package/dist/locales/en/account.js +0 -12
  83. package/dist/locales/en/admin.js +0 -209
  84. package/dist/locales/en/common.js +0 -42
  85. package/dist/locales/en/components.js +0 -39
  86. package/dist/locales/en/constant.js +0 -153
  87. package/dist/locales/en/filterBox.js +0 -13
  88. package/dist/locales/en/index.js +0 -22
  89. package/dist/locales/en/instanceForm.js +0 -19
  90. package/dist/locales/en/password.js +0 -20
  91. package/dist/locales/index.js +0 -12
  92. package/dist/locales/messages.js +0 -9
  93. package/dist/locales/zh-cn/account.js +0 -12
  94. package/dist/locales/zh-cn/admin.js +0 -207
  95. package/dist/locales/zh-cn/common.js +0 -42
  96. package/dist/locales/zh-cn/components.js +0 -39
  97. package/dist/locales/zh-cn/constant.js +0 -153
  98. package/dist/locales/zh-cn/filterBox.js +0 -13
  99. package/dist/locales/zh-cn/index.js +0 -22
  100. package/dist/locales/zh-cn/instanceForm.js +0 -19
  101. package/dist/locales/zh-cn/password.js +0 -20
  102. package/dist/utils/createContext.js +0 -14
  103. package/dist/utils/repoUtils.js +0 -160
@@ -1,160 +0,0 @@
1
- import { ref as E, readonly as Z } from "vue";
2
- const D = 3600 * 24 * 7, u = "UTC", S = "timezone", A = [
3
- "UTC",
4
- "Asia/Shanghai",
5
- "Asia/Hong_Kong",
6
- "Asia/Singapore",
7
- "Asia/Tokyo",
8
- "Europe/London",
9
- "Europe/Berlin",
10
- "America/New_York",
11
- "America/Los_Angeles"
12
- ], T = /* @__PURE__ */ new Map(), l = () => {
13
- try {
14
- return globalThis.localStorage;
15
- } catch {
16
- return;
17
- }
18
- }, m = {
19
- get(e, t = null) {
20
- const n = l(), o = n == null ? void 0 : n.getItem(e.toUpperCase());
21
- if (!o) return t;
22
- try {
23
- const r = JSON.parse(o);
24
- if (r.expire === null || r.expire >= Date.now())
25
- return r.value;
26
- n == null || n.removeItem(e.toUpperCase());
27
- } catch {
28
- return t;
29
- }
30
- return t;
31
- },
32
- set(e, t, n = D) {
33
- const o = l(), r = {
34
- value: t,
35
- expire: n === null ? null : Date.now() + n * 1e3
36
- };
37
- o == null || o.setItem(e.toUpperCase(), JSON.stringify(r));
38
- },
39
- clear() {
40
- var e;
41
- (e = l()) == null || e.clear();
42
- }
43
- }, L = (e) => typeof e == "object" && e !== null, h = (e) => {
44
- if (!L(e) || Object.prototype.toString.call(e) !== "[object Object]") return !1;
45
- const t = Object.getPrototypeOf(e);
46
- return t === null || t === Object.prototype;
47
- };
48
- function U(e, t) {
49
- if (!h(e)) return t;
50
- if (!h(t)) return e;
51
- const n = e;
52
- return Object.keys(t).concat(Object.getOwnPropertySymbols(t)).forEach((o) => {
53
- n[o] = U(
54
- n[o],
55
- t[o]
56
- );
57
- }), n;
58
- }
59
- function M() {
60
- const e = typeof navigator > "u" ? "en-US" : navigator.language;
61
- return String(m.get("locale", e)).includes("zh") ? "zh-CN" : "en-US";
62
- }
63
- const d = (e, t, n) => {
64
- var o;
65
- return ((o = t == null ? void 0 : t[n]) == null ? void 0 : o[e]) || "";
66
- }, z = (e, t, n = "") => {
67
- const o = e;
68
- return d(t, o, M()) || n || d(t, o, "en-US");
69
- }, F = (e = "") => e.replace(/【.*】/, ""), j = (e, t, n) => {
70
- var o, r, s, i, f;
71
- for (const c of t) {
72
- const C = ((o = c.path) == null ? void 0 : o.replace(/\/:(\w+)/g, "/([^/]+)")) || "", b = new RegExp(`^${C}$`);
73
- if (((r = c.path) == null ? void 0 : r.toLowerCase()) === e || b.test(e))
74
- return ((s = c.meta) == null ? void 0 : s.visible) === "0" && (n == null ? void 0 : n.path) || "";
75
- if ((i = c.children) != null && i.length) {
76
- const g = j(
77
- e,
78
- c.children,
79
- ((f = c.meta) == null ? void 0 : f.visible) === "1" ? c : n
80
- );
81
- if (g) return g;
82
- }
83
- }
84
- return "";
85
- }, x = (e, t) => {
86
- const n = e.resolve(t);
87
- if (!(n != null && n.name)) return !1;
88
- const o = String(n.name).split("-").filter((s) => !!s && s !== "index"), r = n.path.split("-").join("/").split("/").filter(Boolean);
89
- return o.length === r.length && o.every((s, i) => s === r[i]);
90
- }, a = (e) => typeof e == "string" && O(e) ? e : "", O = (e) => {
91
- try {
92
- return new Intl.DateTimeFormat("en-US", { timeZone: e }).format(/* @__PURE__ */ new Date()), !0;
93
- } catch {
94
- return !1;
95
- }
96
- }, y = () => a(Intl.DateTimeFormat().resolvedOptions().timeZone) || u, p = E(
97
- a(m.get(S)) || y()
98
- ), B = () => Z(p);
99
- function R(e) {
100
- const t = a(e);
101
- t && (p.value = t, m.set(S, t, null));
102
- }
103
- const _ = (e) => {
104
- const t = a(e) || u, n = T.get(t);
105
- if (n) return n;
106
- const o = new Intl.DateTimeFormat("en-US", {
107
- timeZone: t,
108
- year: "numeric",
109
- month: "2-digit",
110
- day: "2-digit",
111
- hour: "2-digit",
112
- minute: "2-digit",
113
- second: "2-digit",
114
- hourCycle: "h23"
115
- });
116
- return T.set(t, o), o;
117
- }, v = (e, t) => _(t).formatToParts(e).reduce((o, r) => (r.type !== "literal" && (o[r.type] = Number(r.value)), o), {}), I = (e, t = /* @__PURE__ */ new Date()) => {
118
- const n = a(e) || u, o = v(t, n), r = Date.UTC(
119
- o.year || 0,
120
- (o.month || 1) - 1,
121
- o.day || 1,
122
- o.hour || 0,
123
- o.minute || 0,
124
- o.second || 0,
125
- t.getMilliseconds()
126
- );
127
- return Math.round((r - t.getTime()) / 6e4);
128
- }, w = (e, t = /* @__PURE__ */ new Date()) => {
129
- const n = I(e, t), o = n >= 0 ? "+" : "-", r = Math.abs(n), s = Math.floor(r / 60), i = r % 60;
130
- return `UTC${o}${String(s).padStart(2, "0")}:${String(
131
- i
132
- ).padStart(2, "0")}`;
133
- }, K = (e, t = /* @__PURE__ */ new Date()) => `${e} (${w(e, t)})`, H = (e = /* @__PURE__ */ new Date()) => {
134
- const t = new Set(
135
- [y(), ...A, p.value].filter(
136
- O
137
- )
138
- );
139
- return Array.from(t).map((n) => {
140
- const o = w(n, e);
141
- return {
142
- value: n,
143
- label: `${n} (${o})`,
144
- offset: o
145
- };
146
- });
147
- };
148
- export {
149
- m as Storage,
150
- U as deepMerge,
151
- M as getCurrentLocale,
152
- j as getRouteLastVisibleParentMenu,
153
- K as getTimeZoneLabel,
154
- H as getTimeZoneOptions,
155
- x as hasRoutePermission,
156
- F as replaceName,
157
- R as setCurrentTimeZone,
158
- z as tname,
159
- B as useCurrentTimeZone
160
- };