@spacego/fe-components 0.0.1-alpha.3 → 0.0.1-alpha.5
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/lib/assets/svg/chrome-bg-after.svg.js +3 -2
- package/lib/assets/svg/chrome-bg-before.svg.js +2 -1
- package/lib/assets/svg/icon-arrows-right.svg.js +3 -2
- package/lib/assets/svg/icon-bell.svg.js +3 -2
- package/lib/assets/svg/icon-custom.svg.js +3 -2
- package/lib/assets/svg/icon-sun-moon.svg.js +3 -2
- package/lib/assets/svg/icon-system.svg.js +3 -2
- package/lib/assets/svg/login-view.svg.js +871 -2
- package/lib/fe-layouts/auth-layout/index.js +8 -8
- package/lib/fe-layouts/basics-layout/components/basics-layout/sidebar.js +1 -1
- package/lib/fe-layouts/basics-layout/components/basics-layout/tabs.js +5 -5
- package/lib/fe-layouts/basics-layout/index.js +1 -1
- package/lib/fe-layouts/layout.js +20 -20
- package/lib/types/fe-layouts/layout.d.ts +2 -1
- package/package.json +1 -1
|
@@ -16,9 +16,9 @@ import "antd";
|
|
|
16
16
|
import { useGlobal as C } from "../context/context.js";
|
|
17
17
|
/* empty css */
|
|
18
18
|
import "../basics-layout/index.js";
|
|
19
|
-
function
|
|
20
|
-
const { appName: s, logo: n } = C(), { theme: o, themeColor: c, TOGGLE_THEME: m, SET_THEME_COLOR: f } = T(p(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [a,
|
|
21
|
-
const
|
|
19
|
+
function q() {
|
|
20
|
+
const { appName: s, logo: n } = C(), { theme: o, themeColor: c, TOGGLE_THEME: m, SET_THEME_COLOR: f } = T(p(["theme", "themeColor", "TOGGLE_THEME", "SET_THEME_COLOR"])), [a, i] = u(!1), d = (r) => {
|
|
21
|
+
const l = r.currentTarget.getBoundingClientRect(), h = l.left + l.width / 2, x = l.top + l.height / 2;
|
|
22
22
|
k(o === "light" ? "dark" : "light", h, x).then(() => {
|
|
23
23
|
m();
|
|
24
24
|
});
|
|
@@ -40,8 +40,8 @@ function A() {
|
|
|
40
40
|
opacity: a ? 1 : 0,
|
|
41
41
|
transition: "transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
42
42
|
},
|
|
43
|
-
onMouseEnter: () =>
|
|
44
|
-
onMouseLeave: () =>
|
|
43
|
+
onMouseEnter: () => i(!0),
|
|
44
|
+
onMouseLeave: () => i(!1),
|
|
45
45
|
children: E.map((r) => /* @__PURE__ */ e(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
@@ -59,8 +59,8 @@ function A() {
|
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
className: "w-8 h-8 flex items-center justify-center cursor-pointer hover-scale-animation",
|
|
62
|
-
onMouseEnter: () =>
|
|
63
|
-
onMouseLeave: () =>
|
|
62
|
+
onMouseEnter: () => i(!0),
|
|
63
|
+
onMouseLeave: () => i(!1),
|
|
64
64
|
children: /* @__PURE__ */ e(N, { className: "h-[16px] w-[16px] text-(--color-primary)" })
|
|
65
65
|
}
|
|
66
66
|
),
|
|
@@ -91,5 +91,5 @@ function A() {
|
|
|
91
91
|
] });
|
|
92
92
|
}
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
q as default
|
|
95
95
|
};
|
|
@@ -7,7 +7,7 @@ import "../../../../store/modules/layout-config.store.js";
|
|
|
7
7
|
import "../../../../store/modules/theme.store.js";
|
|
8
8
|
const { Sider: w } = h;
|
|
9
9
|
function A(a) {
|
|
10
|
-
const { collapsed: l, menus: n, activeKey: s, openKeys: o = [], onMenuClick: d, onCollapse: c } = a, [f, i] = y(o);
|
|
10
|
+
const { collapsed: l, menus: n = [], activeKey: s, openKeys: o = [], onMenuClick: d, onCollapse: c } = a, [f, i] = y(o);
|
|
11
11
|
x(() => {
|
|
12
12
|
o.length > 0 && i(o);
|
|
13
13
|
}, [o]);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as r, jsxs as i, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { classnames as s } from "@spacego/turbo-utils";
|
|
3
3
|
import { Divider as x } from "antd";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { MdClear as
|
|
4
|
+
import { useRef as v, useState as b, useEffect as g } from "react";
|
|
5
|
+
import { MdClear as k } from "react-icons/md";
|
|
6
6
|
import y from "../../../../assets/svg/chrome-bg-after.svg.js";
|
|
7
7
|
import w from "../../../../assets/svg/chrome-bg-before.svg.js";
|
|
8
8
|
function z(c) {
|
|
9
|
-
const { tabs: o, activeKey: d, onChange: f, onClose: h } = c, n =
|
|
9
|
+
const { tabs: o, activeKey: d, onChange: f, onClose: h } = c, n = v(null), [l, m] = b(!1), a = () => {
|
|
10
10
|
const e = n.current;
|
|
11
11
|
if (e) {
|
|
12
12
|
const t = e.scrollWidth > e.clientWidth;
|
|
13
13
|
m(t);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
return
|
|
16
|
+
return g(() => (a(), window.addEventListener("resize", a), () => {
|
|
17
17
|
window.removeEventListener("resize", a);
|
|
18
18
|
}), [o]), /* @__PURE__ */ r(
|
|
19
19
|
"div",
|
|
@@ -43,7 +43,7 @@ function z(c) {
|
|
|
43
43
|
onClick: (p) => {
|
|
44
44
|
p.stopPropagation(), h(e.key);
|
|
45
45
|
},
|
|
46
|
-
children: /* @__PURE__ */ r(
|
|
46
|
+
children: /* @__PURE__ */ r(k, { className: "text-xs text-[#333333] dark:text-[#cfd0d0] hover:text-black dark:hover:text-white transition-all" })
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
]
|
|
@@ -14,7 +14,7 @@ import { findRouteByPath as b, findMenuParentKeys as F, buildRouteMap as J, find
|
|
|
14
14
|
/* empty css */
|
|
15
15
|
const { Content: W } = g;
|
|
16
16
|
function fe() {
|
|
17
|
-
const a = P(), m = V(), { token: C, menus: s, routes: n } = z(), { tabsAttribute: A, sidebarCollapsed: v, loadingConfig: _, ADD_TAB: x, REMOVE_TAB: L, SET_ACTIVE_TAB_KEY: E, SET_SIDEBAR_COLLAPSED: S } = Y(N(["tabsAttribute", "sidebarCollapsed", "loadingConfig", "ADD_TAB", "REMOVE_TAB", "SET_ACTIVE_TAB_KEY", "SET_SIDEBAR_COLLAPSED"])), { tabsList: h, tabsActiveKey: r } = A, l = d(() => {
|
|
17
|
+
const a = P(), m = V(), { token: C, menus: s = [], routes: n = [] } = z(), { tabsAttribute: A, sidebarCollapsed: v, loadingConfig: _, ADD_TAB: x, REMOVE_TAB: L, SET_ACTIVE_TAB_KEY: E, SET_SIDEBAR_COLLAPSED: S } = Y(N(["tabsAttribute", "sidebarCollapsed", "loadingConfig", "ADD_TAB", "REMOVE_TAB", "SET_ACTIVE_TAB_KEY", "SET_SIDEBAR_COLLAPSED"])), { tabsList: h, tabsActiveKey: r } = A, l = d(() => {
|
|
18
18
|
var t;
|
|
19
19
|
if (!n || n.length === 0)
|
|
20
20
|
return r;
|
package/lib/fe-layouts/layout.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useSelector as n } from "@spacego/zustand";
|
|
3
|
-
import { theme as i, ConfigProvider as
|
|
4
|
-
import { useMemo as
|
|
3
|
+
import { theme as i, ConfigProvider as c, Spin as u } from "antd";
|
|
4
|
+
import { useMemo as g } from "react";
|
|
5
5
|
import "@ant-design/icons";
|
|
6
|
-
import { getRealTheme as
|
|
7
|
-
import { useLayoutConfigStore as
|
|
8
|
-
import { useThemeStore as
|
|
6
|
+
import { getRealTheme as d } from "../utils/theme.js";
|
|
7
|
+
import { useLayoutConfigStore as C } from "../store/modules/layout-config.store.js";
|
|
8
|
+
import { useThemeStore as y } from "../store/modules/theme.store.js";
|
|
9
9
|
import a from "../config/theme.js";
|
|
10
10
|
import "react-router-dom";
|
|
11
11
|
import "./context/context.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
function
|
|
17
|
-
const { layoutType: e } = p, { loadingConfig:
|
|
18
|
-
const
|
|
12
|
+
import k from "./context/global-context.provider.js";
|
|
13
|
+
import L from "./auth-layout/index.js";
|
|
14
|
+
import M from "./basics-layout/index.js";
|
|
15
|
+
import T from "./blank-layout/index.js";
|
|
16
|
+
function z(p) {
|
|
17
|
+
const { layoutType: e, ...s } = p, { loadingConfig: l } = C(n(["loadingConfig"])), { theme: t, themeColor: r } = y(n(["theme", "themeColor"])), f = g(() => {
|
|
18
|
+
const h = d(t);
|
|
19
19
|
return {
|
|
20
20
|
cssVar: {
|
|
21
21
|
prefix: "ant"
|
|
22
22
|
},
|
|
23
23
|
// 启用 CSS 变量模式,生成 --ant-color-primary 等变量
|
|
24
|
-
algorithm:
|
|
24
|
+
algorithm: h === "dark" ? i.darkAlgorithm : i.defaultAlgorithm,
|
|
25
25
|
token: {
|
|
26
26
|
colorPrimary: r,
|
|
27
27
|
...a.token
|
|
@@ -31,19 +31,19 @@ function q(p) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}, [t, r]), m = (/* @__PURE__ */ new Map([
|
|
34
|
-
["blank",
|
|
35
|
-
["basic",
|
|
36
|
-
["auth",
|
|
34
|
+
["blank", T],
|
|
35
|
+
["basic", M],
|
|
36
|
+
["auth", L]
|
|
37
37
|
])).get(e);
|
|
38
|
-
return /* @__PURE__ */ o(
|
|
39
|
-
|
|
38
|
+
return /* @__PURE__ */ o(c, { theme: f, children: /* @__PURE__ */ o(k, { ...s, children: /* @__PURE__ */ o(
|
|
39
|
+
u,
|
|
40
40
|
{
|
|
41
|
-
spinning:
|
|
41
|
+
spinning: l.show && e !== "basic",
|
|
42
42
|
wrapperClassName: "spin-wrapper-full",
|
|
43
43
|
children: m && /* @__PURE__ */ o(m, {}, e)
|
|
44
44
|
}
|
|
45
45
|
) }) });
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
z as default
|
|
49
49
|
};
|