@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.
@@ -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 A() {
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, l] = u(!1), d = (r) => {
21
- const i = r.currentTarget.getBoundingClientRect(), h = i.left + i.width / 2, x = i.top + i.height / 2;
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: () => l(!0),
44
- onMouseLeave: () => l(!1),
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: () => l(!0),
63
- onMouseLeave: () => l(!1),
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
- A as default
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 b, useState as v, useEffect as k } from "react";
5
- import { MdClear as g } from "react-icons/md";
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 = b(null), [l, m] = v(!1), a = () => {
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 k(() => (a(), window.addEventListener("resize", a), () => {
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(g, { className: "text-xs text-[#333333] dark:text-[#cfd0d0] hover:text-black dark:hover:text-white transition-all" })
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;
@@ -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 h, Spin as c } from "antd";
4
- import { useMemo as u } from "react";
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 g } from "../utils/theme.js";
7
- import { useLayoutConfigStore as d } from "../store/modules/layout-config.store.js";
8
- import { useThemeStore as C } from "../store/modules/theme.store.js";
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 y from "./context/global-context.provider.js";
13
- import k from "./auth-layout/index.js";
14
- import L from "./basics-layout/index.js";
15
- import M from "./blank-layout/index.js";
16
- function q(p) {
17
- const { layoutType: e } = p, { loadingConfig: s } = d(n(["loadingConfig"])), { theme: t, themeColor: r } = C(n(["theme", "themeColor"])), l = u(() => {
18
- const f = g(t);
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: f === "dark" ? i.darkAlgorithm : i.defaultAlgorithm,
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", M],
35
- ["basic", L],
36
- ["auth", k]
34
+ ["blank", T],
35
+ ["basic", M],
36
+ ["auth", L]
37
37
  ])).get(e);
38
- return /* @__PURE__ */ o(h, { theme: l, children: /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(
39
- c,
38
+ return /* @__PURE__ */ o(c, { theme: f, children: /* @__PURE__ */ o(k, { ...s, children: /* @__PURE__ */ o(
39
+ u,
40
40
  {
41
- spinning: s.show && e !== "basic",
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
- q as default
48
+ z as default
49
49
  };
@@ -1,4 +1,5 @@
1
- export interface IFeLayoutProps {
1
+ import { IGlobalContextProps } from './context';
2
+ export interface IFeLayoutProps extends IGlobalContextProps {
2
3
  /**
3
4
  * 布局类型,空白布局和后台布局
4
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacego/fe-components",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.5",
4
4
  "description": "🚀 A component library for fe to use.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",