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.
- package/dist/index.css +1 -0
- package/dist/index.js.js +2560 -0
- package/dist/layout/hooks/useTheme.d.ts +6 -14
- package/dist/layout.es.js +5734 -5735
- package/dist/layout.global.js +30 -30
- package/package.json +1 -1
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/assets/logo.png.js +0 -4
- package/dist/components/UserAvatar/index.js +0 -5
- package/dist/components/UserAvatar/src/UserAvatar.css +0 -1
- package/dist/components/UserAvatar/src/UserAvatar.vue.js +0 -7
- package/dist/components/UserAvatar/src/UserAvatar.vue2.js +0 -61
- package/dist/components/index.js +0 -10
- package/dist/index.js +0 -35
- package/dist/layout/BaseLayout.css +0 -1
- package/dist/layout/BaseLayout.vue.js +0 -7
- package/dist/layout/BaseLayout.vue2.js +0 -111
- package/dist/layout/components/AppSelect.css +0 -1
- package/dist/layout/components/AppSelect.vue.js +0 -7
- package/dist/layout/components/AppSelect.vue2.js +0 -69
- package/dist/layout/components/AsideBar.css +0 -1
- package/dist/layout/components/AsideBar.vue.js +0 -7
- package/dist/layout/components/AsideBar.vue2.js +0 -49
- package/dist/layout/components/AsideSubMenuItem.vue.js +0 -84
- package/dist/layout/components/AsideSubMenuItem.vue2.js +0 -4
- package/dist/layout/components/AsideSubMenus.vue.js +0 -36
- package/dist/layout/components/AsideSubMenus.vue2.js +0 -4
- package/dist/layout/components/HeaderBar.css +0 -1
- package/dist/layout/components/HeaderBar.vue.js +0 -7
- package/dist/layout/components/HeaderBar.vue2.js +0 -55
- package/dist/layout/components/LanguageSelect.css +0 -1
- package/dist/layout/components/LanguageSelect.vue.js +0 -8
- package/dist/layout/components/LanguageSelect.vue2.js +0 -100
- package/dist/layout/components/LanguageSelect2.css +0 -1
- package/dist/layout/components/LayoutBreadcrumb.css +0 -1
- package/dist/layout/components/LayoutBreadcrumb.vue.js +0 -7
- package/dist/layout/components/LayoutBreadcrumb.vue2.js +0 -189
- package/dist/layout/components/MenuItemIcon.css +0 -1
- package/dist/layout/components/MenuItemIcon.vue.js +0 -7
- package/dist/layout/components/MenuItemIcon.vue2.js +0 -23
- package/dist/layout/components/NavIconBtn.css +0 -1
- package/dist/layout/components/NavIconBtn.vue.js +0 -7
- package/dist/layout/components/NavIconBtn.vue2.js +0 -23
- package/dist/layout/components/SHeaderRight.css +0 -1
- package/dist/layout/components/SHeaderRight.vue.js +0 -7
- package/dist/layout/components/SHeaderRight.vue2.js +0 -68
- package/dist/layout/components/ThemeToggle.css +0 -1
- package/dist/layout/components/ThemeToggle.vue.js +0 -7
- package/dist/layout/components/ThemeToggle.vue2.js +0 -30
- package/dist/layout/components/TimezoneSelect.css +0 -1
- package/dist/layout/components/TimezoneSelect.vue.js +0 -8
- package/dist/layout/components/TimezoneSelect.vue2.js +0 -78
- package/dist/layout/components/TimezoneSelect2.css +0 -1
- package/dist/layout/components/UserInfo.css +0 -1
- package/dist/layout/components/UserInfo.vue.js +0 -8
- package/dist/layout/components/UserInfo.vue2.js +0 -111
- package/dist/layout/components/UserInfo2.css +0 -1
- package/dist/layout/components/index.js +0 -8
- package/dist/layout/components/mobile/AppSelectMobile.vue.js +0 -60
- package/dist/layout/components/mobile/AppSelectMobile.vue2.js +0 -4
- package/dist/layout/components/mobile/AsideBarMobile.css +0 -1
- package/dist/layout/components/mobile/AsideBarMobile.vue.js +0 -7
- package/dist/layout/components/mobile/AsideBarMobile.vue2.js +0 -49
- package/dist/layout/components/mobile/AsideUserMobile.css +0 -1
- package/dist/layout/components/mobile/AsideUserMobile.vue.js +0 -7
- package/dist/layout/components/mobile/AsideUserMobile.vue2.js +0 -56
- package/dist/layout/components/mobile/AsideUserMobilePopover.css +0 -1
- package/dist/layout/components/mobile/AsideUserMobilePopover.vue.js +0 -7
- package/dist/layout/components/mobile/AsideUserMobilePopover.vue2.js +0 -52
- package/dist/layout/components/mobile/HeaderRightMobile.css +0 -1
- package/dist/layout/components/mobile/HeaderRightMobile.vue.js +0 -7
- package/dist/layout/components/mobile/HeaderRightMobile.vue2.js +0 -46
- package/dist/layout/components/mobile/MobileMenuToggle.css +0 -1
- package/dist/layout/components/mobile/MobileMenuToggle.vue.js +0 -7
- package/dist/layout/components/mobile/MobileMenuToggle.vue2.js +0 -33
- package/dist/layout/hooks/index.js +0 -21
- package/dist/layout/hooks/useApp.js +0 -20
- package/dist/layout/hooks/useSetting.js +0 -24
- package/dist/layout/hooks/useState.js +0 -100
- package/dist/layout/hooks/useTheme.js +0 -48
- package/dist/layout/utils/index.js +0 -54
- package/dist/locales/en/account.js +0 -12
- package/dist/locales/en/admin.js +0 -209
- package/dist/locales/en/common.js +0 -42
- package/dist/locales/en/components.js +0 -39
- package/dist/locales/en/constant.js +0 -153
- package/dist/locales/en/filterBox.js +0 -13
- package/dist/locales/en/index.js +0 -22
- package/dist/locales/en/instanceForm.js +0 -19
- package/dist/locales/en/password.js +0 -20
- package/dist/locales/index.js +0 -12
- package/dist/locales/messages.js +0 -9
- package/dist/locales/zh-cn/account.js +0 -12
- package/dist/locales/zh-cn/admin.js +0 -207
- package/dist/locales/zh-cn/common.js +0 -42
- package/dist/locales/zh-cn/components.js +0 -39
- package/dist/locales/zh-cn/constant.js +0 -153
- package/dist/locales/zh-cn/filterBox.js +0 -13
- package/dist/locales/zh-cn/index.js +0 -22
- package/dist/locales/zh-cn/instanceForm.js +0 -19
- package/dist/locales/zh-cn/password.js +0 -20
- package/dist/utils/createContext.js +0 -14
- package/dist/utils/repoUtils.js +0 -160
package/dist/utils/repoUtils.js
DELETED
|
@@ -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
|
-
};
|