mamba-layout 0.5.0 → 0.6.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/components/index.js +8 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +27 -33
- package/dist/layout/components/TimezoneSelect.css +1 -0
- package/dist/layout/components/TimezoneSelect.vue.d.ts +7 -0
- package/dist/layout/components/TimezoneSelect.vue.js +8 -0
- package/dist/layout/components/TimezoneSelect.vue2.js +78 -0
- package/dist/layout/components/TimezoneSelect2.css +1 -0
- package/dist/layout/components/index.d.ts +2 -0
- package/dist/layout/components/index.js +6 -2
- package/dist/layout/utils/index.js +20 -25
- package/dist/layout.css +1 -1
- package/dist/layout.es.js +228 -228
- package/dist/layout.global.js +6 -6
- package/dist/utils/repoUtils.js +133 -71
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
1
|
+
import { default as a } from "./UserAvatar/src/UserAvatar.vue.js";
|
|
2
|
+
import { default as t } from "../layout/components/LayoutBreadcrumb.vue.js";
|
|
3
|
+
import { default as m } from "../layout/components/TimezoneSelect.vue.js";
|
|
4
|
+
import { default as u } from "../layout/components/UserInfo.vue.js";
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
t as LayoutBreadcrumb,
|
|
7
|
+
m as TimezoneSelect,
|
|
8
|
+
a as UserAvatar,
|
|
9
|
+
u as UserInfo
|
|
6
10
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export { default as BaseLayout } from './layout/BaseLayout.vue';
|
|
2
|
-
export { default, default as LayoutBreadcrumb, } from './layout/components/LayoutBreadcrumb.vue';
|
|
3
2
|
export * from './layout/hooks/useApp';
|
|
4
|
-
export * from './layout/hooks/useSetting';
|
|
5
3
|
export * from './layout/hooks/useState';
|
|
6
|
-
export
|
|
4
|
+
export { useTheme } from './layout/hooks/useTheme';
|
|
7
5
|
export * from './layout/hooks';
|
|
8
|
-
export * from './layout/utils';
|
|
9
6
|
export * from './components';
|
|
10
7
|
export * from './layout/components';
|
|
11
8
|
export { default as i18n } from './locales';
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
import { default as o } from "./layout/BaseLayout.vue.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { messages as
|
|
2
|
+
import { useApp as a } from "./layout/hooks/useApp.js";
|
|
3
|
+
import { injectLayoutContext as f, provideLayoutContext as s, useStateHook as p } from "./layout/hooks/useState.js";
|
|
4
|
+
import { initTheme as x, setTheme as n, syncThemeFromSetting as i, toggleTheme as d, useTheme as l } from "./layout/hooks/useTheme.js";
|
|
5
|
+
import { provideSetting as T, useSetting as h } from "./layout/hooks/useSetting.js";
|
|
6
|
+
import { default as S } from "./components/UserAvatar/src/UserAvatar.vue.js";
|
|
7
|
+
import { default as L } from "./layout/components/LayoutBreadcrumb.vue.js";
|
|
8
|
+
import { default as A } from "./layout/components/TimezoneSelect.vue.js";
|
|
9
|
+
import { default as C } from "./layout/components/UserInfo.vue.js";
|
|
10
|
+
import { default as b } from "./locales/index.js";
|
|
11
|
+
import { messages as k } from "./locales/messages.js";
|
|
12
12
|
export {
|
|
13
13
|
o as BaseLayout,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
l as
|
|
31
|
-
h as syncThemeFromSetting,
|
|
32
|
-
S as toggleTheme,
|
|
33
|
-
u as useApp,
|
|
34
|
-
i as useSetting,
|
|
35
|
-
y as useStateHook,
|
|
36
|
-
T as useTheme
|
|
14
|
+
L as LayoutBreadcrumb,
|
|
15
|
+
A as TimezoneSelect,
|
|
16
|
+
S as UserAvatar,
|
|
17
|
+
C as UserInfo,
|
|
18
|
+
b as i18n,
|
|
19
|
+
x as initTheme,
|
|
20
|
+
f as injectLayoutContext,
|
|
21
|
+
k as messages,
|
|
22
|
+
s as provideLayoutContext,
|
|
23
|
+
T as provideSetting,
|
|
24
|
+
n as setTheme,
|
|
25
|
+
i as syncThemeFromSetting,
|
|
26
|
+
d as toggleTheme,
|
|
27
|
+
a as useApp,
|
|
28
|
+
h as useSetting,
|
|
29
|
+
p as useStateHook,
|
|
30
|
+
l as useTheme
|
|
37
31
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.top-timezone-popover{padding:6px!important;border:1px solid var(--ui-border-default)!important;background:var(--ui-bg-card)!important;box-shadow:var(--ui-shadow-pop)!important}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
showLabel?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
showLabel: boolean;
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as w, ref as y, computed as c, resolveComponent as f, openBlock as t, createBlock as d, withCtx as o, createElementVNode as i, createElementBlock as r, Fragment as T, renderList as Z, normalizeClass as L, toDisplayString as u, createVNode as n, unref as b, createCommentVNode as h } from "vue";
|
|
2
|
+
import { Clock as B, ArrowDown as N } from "@element-plus/icons-vue";
|
|
3
|
+
import { useCurrentTimeZone as x, getTimeZoneOptions as V, getTimeZoneLabel as D, setCurrentTimeZone as E } from "../../utils/repoUtils.js";
|
|
4
|
+
import O from "./NavIconBtn.vue.js";
|
|
5
|
+
const S = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "timezone-select__current"
|
|
8
|
+
}, A = { class: "timezone-select__panel" }, F = ["onClick"], I = { class: "timezone-select__name" }, R = { class: "timezone-select__offset" }, H = /* @__PURE__ */ w({
|
|
9
|
+
__name: "TimezoneSelect",
|
|
10
|
+
props: {
|
|
11
|
+
showLabel: { type: Boolean, default: !1 }
|
|
12
|
+
},
|
|
13
|
+
setup(l) {
|
|
14
|
+
const z = x(), s = y(!1), a = c(() => z.value), C = c(() => V()), m = c(() => D(a.value)), k = (_) => {
|
|
15
|
+
E(_), s.value = !1;
|
|
16
|
+
};
|
|
17
|
+
return (_, p) => {
|
|
18
|
+
const v = f("el-icon"), g = f("el-popover");
|
|
19
|
+
return t(), d(g, {
|
|
20
|
+
visible: s.value,
|
|
21
|
+
"onUpdate:visible": p[0] || (p[0] = (e) => s.value = e),
|
|
22
|
+
placement: "bottom",
|
|
23
|
+
width: 280,
|
|
24
|
+
trigger: "hover",
|
|
25
|
+
"popper-class": "top-timezone-popover"
|
|
26
|
+
}, {
|
|
27
|
+
reference: o(() => [
|
|
28
|
+
n(O, {
|
|
29
|
+
tag: "div",
|
|
30
|
+
class: "timezone-select",
|
|
31
|
+
"icon-only": !l.showLabel,
|
|
32
|
+
title: m.value,
|
|
33
|
+
"aria-label": m.value
|
|
34
|
+
}, {
|
|
35
|
+
default: o(() => [
|
|
36
|
+
n(v, null, {
|
|
37
|
+
default: o(() => [
|
|
38
|
+
n(b(B))
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
}),
|
|
42
|
+
l.showLabel ? (t(), r("span", S, u(a.value), 1)) : h("", !0),
|
|
43
|
+
l.showLabel ? (t(), d(v, {
|
|
44
|
+
key: 1,
|
|
45
|
+
class: "timezone-select__caret"
|
|
46
|
+
}, {
|
|
47
|
+
default: o(() => [
|
|
48
|
+
n(b(N))
|
|
49
|
+
]),
|
|
50
|
+
_: 1
|
|
51
|
+
})) : h("", !0)
|
|
52
|
+
]),
|
|
53
|
+
_: 1
|
|
54
|
+
}, 8, ["icon-only", "title", "aria-label"])
|
|
55
|
+
]),
|
|
56
|
+
default: o(() => [
|
|
57
|
+
i("div", A, [
|
|
58
|
+
(t(!0), r(T, null, Z(C.value, (e) => (t(), r("button", {
|
|
59
|
+
key: e.value,
|
|
60
|
+
type: "button",
|
|
61
|
+
class: L(["timezone-select__option", {
|
|
62
|
+
"timezone-select__option--active": e.value === a.value
|
|
63
|
+
}]),
|
|
64
|
+
onClick: (U) => k(e.value)
|
|
65
|
+
}, [
|
|
66
|
+
i("span", I, u(e.value), 1),
|
|
67
|
+
i("span", R, u(e.offset), 1)
|
|
68
|
+
], 10, F))), 128))
|
|
69
|
+
])
|
|
70
|
+
]),
|
|
71
|
+
_: 1
|
|
72
|
+
}, 8, ["visible"]);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
H as default
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.timezone-select[data-v-e62f5f2d]{flex-shrink:0}.timezone-select__current[data-v-e62f5f2d]{max-width:132px;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:600;line-height:1}.timezone-select__caret[data-v-e62f5f2d]{font-size:12px}.timezone-select__panel[data-v-e62f5f2d]{display:grid;gap:4px;max-height:min(360px,70vh);overflow-y:auto}.timezone-select__option[data-v-e62f5f2d]{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;border:0;border-radius:var(--ui-radius-control);background:transparent;color:var(--ui-text-primary);text-align:left;cursor:pointer;transition:background var(--ui-transition-fast),color var(--ui-transition-fast)}.timezone-select__option[data-v-e62f5f2d]:hover{background:var(--ui-bg-muted)}.timezone-select__name[data-v-e62f5f2d]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.timezone-select__offset[data-v-e62f5f2d]{color:var(--ui-text-muted);font-size:12px;white-space:nowrap}.timezone-select__option--active[data-v-e62f5f2d]{color:var(--el-color-primary);background:var(--el-color-primary-light-10)}.timezone-select__option--active .timezone-select__offset[data-v-e62f5f2d]{color:var(--el-color-primary)}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as r } from "./LayoutBreadcrumb.vue.js";
|
|
2
|
+
import { default as t } from "./TimezoneSelect.vue.js";
|
|
3
|
+
import { default as m } from "./UserInfo.vue.js";
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
r as LayoutBreadcrumb,
|
|
6
|
+
t as TimezoneSelect,
|
|
7
|
+
m as UserInfo
|
|
4
8
|
};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const n = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i"), c = (o || window.location.search.replace(/^\?/, "")).match(n);
|
|
3
|
-
return c != null ? decodeURI(c[2]) : "";
|
|
4
|
-
}
|
|
5
|
-
const h = () => typeof location > "u" ? "" : location.href, p = (e) => (e == null ? void 0 : e.loginPath) || `/login?redirect=${encodeURIComponent(h())}`, C = (e) => {
|
|
1
|
+
const u = () => typeof location > "u" ? "" : location.href, p = (e) => (e == null ? void 0 : e.loginPath) || `/login?redirect=${encodeURIComponent(u())}`, $ = (e) => {
|
|
6
2
|
typeof location > "u" || (location.href = p(e));
|
|
7
|
-
},
|
|
8
|
-
var
|
|
3
|
+
}, C = (e) => (e == null ? void 0 : e.userCenterPath) || "/usercenter/home", L = (e) => {
|
|
4
|
+
var a;
|
|
9
5
|
const o = e.themeColor, n = {};
|
|
10
6
|
if (o)
|
|
11
7
|
for (const r in o) {
|
|
@@ -14,33 +10,33 @@ const h = () => typeof location > "u" ? "" : location.href, p = (e) => (e == nul
|
|
|
14
10
|
n[i] = o[r], r == "colorPrimary" && f(o[r]);
|
|
15
11
|
}
|
|
16
12
|
let t = document.getElementById("layout-style");
|
|
17
|
-
t && ((
|
|
18
|
-
const
|
|
19
|
-
t.innerHTML = `html:root{${
|
|
13
|
+
t && ((a = t.parentNode) == null || a.removeChild(t)), t = document.createElement("style"), t.id = "layout-style", document.head.appendChild(t);
|
|
14
|
+
const l = Object.keys(n).map((r) => r + ":" + n[r]).join(";");
|
|
15
|
+
t.innerHTML = `html:root{${l}}`;
|
|
20
16
|
};
|
|
21
17
|
function f(e) {
|
|
22
|
-
var
|
|
18
|
+
var l;
|
|
23
19
|
let o = document.getElementById("primary-style");
|
|
24
20
|
if (e == "theme-default" && o) {
|
|
25
|
-
(
|
|
21
|
+
(l = o.parentNode) == null || l.removeChild(o);
|
|
26
22
|
return;
|
|
27
23
|
}
|
|
28
24
|
const n = g(e);
|
|
29
25
|
o || (o = document.createElement("style"), o.id = "primary-style", document.head.appendChild(o));
|
|
30
|
-
const t = Object.keys(n).map((
|
|
26
|
+
const t = Object.keys(n).map((a) => a + ":" + n[a]).join(";");
|
|
31
27
|
o.innerHTML = `html:root{${t}}`;
|
|
32
28
|
}
|
|
33
29
|
function g(e) {
|
|
34
|
-
var
|
|
35
|
-
const o = ((
|
|
36
|
-
const
|
|
37
|
-
return `rgb(${
|
|
38
|
-
}, i = (
|
|
39
|
-
const
|
|
40
|
-
return `rgb(${Math.round(n *
|
|
30
|
+
var d;
|
|
31
|
+
const o = ((d = e.match(/\d+/g)) == null ? void 0 : d.map(Number)) || [], [n, t, l] = o, a = `rgb(${n}, ${t}, ${l})`, r = (m) => {
|
|
32
|
+
const c = m / 100, y = Math.min(255, n + (255 - n) * c), h = Math.min(255, t + (255 - t) * c), s = Math.min(255, l + (255 - l) * c);
|
|
33
|
+
return `rgb(${y.toFixed(1)}, ${h.toFixed(1)}, ${s.toFixed(1)})`;
|
|
34
|
+
}, i = (m) => {
|
|
35
|
+
const c = 1 - m / 100;
|
|
36
|
+
return `rgb(${Math.round(n * c)} ${Math.round(t * c)} ${Math.round(l * c)})`;
|
|
41
37
|
};
|
|
42
38
|
return {
|
|
43
|
-
"--el-color-primary":
|
|
39
|
+
"--el-color-primary": a,
|
|
44
40
|
"--el-color-primary-light-3": r(30),
|
|
45
41
|
"--el-color-primary-light-5": r(50),
|
|
46
42
|
"--el-color-primary-light-7": r(70),
|
|
@@ -51,9 +47,8 @@ function g(e) {
|
|
|
51
47
|
}
|
|
52
48
|
export {
|
|
53
49
|
p as getLayoutLoginPath,
|
|
54
|
-
|
|
55
|
-
$ as
|
|
56
|
-
|
|
57
|
-
b as setLayoutStyle,
|
|
50
|
+
C as getLayoutUserCenterPath,
|
|
51
|
+
$ as redirectToLayoutLogin,
|
|
52
|
+
L as setLayoutStyle,
|
|
58
53
|
f as setPrimaryColor
|
|
59
54
|
};
|