@spacego/fe-components 0.0.1-alpha.4 → 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.
|
@@ -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]);
|
|
@@ -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
|
};
|