@spacego/fe-components 0.2.0 → 0.2.1

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.
@@ -1,16 +1,14 @@
1
1
  import { FormInstance } from 'antd';
2
2
  import { default as React } from 'react';
3
3
  import { FeFormProps } from '../../fe-form/fe-form/index.d';
4
-
5
-
6
- export interface IFormParams<DataType = any>
7
- extends FeFormProps<DataType> {
8
- setFormData: (data: Partial<DataType> | DataType) => void;
9
- key?: string;
10
- }
11
-
12
- export interface IFormProps<DataType> {
13
- formProps: FeFormProps<DataType>;
14
- formRef: React.RefObject<FormInstance>;
15
- validate: (key?: keyof DataType) => Promise<any> | undefined;
16
- }
4
+ export interface IFormParams<DataType = any>
5
+ extends FeFormProps<DataType> {
6
+ setFormData: (data: Partial<DataType> | DataType) => void;
7
+ key?: string;
8
+ }
9
+
10
+ export interface IFormProps<DataType> {
11
+ formProps: FeFormProps<DataType>;
12
+ formRef: React.RefObject<FormInstance>;
13
+ validate: (key?: keyof DataType) => Promise<any> | undefined;
14
+ }
@@ -1,98 +1,98 @@
1
- /*
2
- * @Author: dushuai
3
- * @Date: 2026-01-13 20:55:57
4
- * @LastEditors: dushuai
5
- * @LastEditTime: 2026-01-26 23:49:50
6
- * @description: 类型声明
7
- */
8
- /// <reference types="vite-plugin-svgr/client" />
9
-
10
- /**
11
- * 菜单类型枚举
12
- * @1 目录 - 仅用于菜单分组,不对应实际页面
13
- * @2 菜单 - 对应实际页面路由
14
- * @3 按钮 - 页面内的按钮权限
15
- */
16
- export type MenuType = 1 | 2 | 3;
17
-
18
- /**
19
- * 路由类型
20
- */
21
- export interface IRoute {
22
- /** 数据库主键id */
23
- id: number
24
- /** 菜单类型:1目录、2菜单、3按钮 */
25
- menuType: MenuType
26
- /** 菜单唯一标识,必填且唯一 */
27
- menuId: string
28
- /** 路由路径 */
29
- path?: string
30
- /**
31
- * 菜单标识
32
- * - 菜单类型:对应 pages 目录下文件夹名称(如 home、system/user)
33
- * - 按钮类型:权限标识(如 user:add、user:edit)
34
- */
35
- menuCode?: string
36
- /** 父级菜单的menuId */
37
- parentId?: string
38
- /** 是否受保护,默认true */
39
- protected?: boolean
40
- /** 是否是首页(仅菜单类型有效) */
41
- index?: boolean
42
- /** 路由/菜单标题 */
43
- title?: string
44
- /** 路由/菜单图标 */
45
- icon?: string
46
- /** 排序,数字越小越靠前 */
47
- sort?: number
48
- /** 是否在侧边栏菜单中显示,默认true(详情页等不需要显示在菜单中的页面设为false) */
49
- isShowMenu?: boolean
50
- /** 是否独立菜单 */
51
- isIndependentMenu?: boolean
52
- /** 激活路由的menuId */
53
- activeRouteMenuId?: string
54
- }
55
-
56
- /**
57
- * 更新store
58
- */
59
- export type TUpdateStore<T> = T | Partial<T> | ((state: T) => T | Partial<T>);
60
-
61
- declare global {
62
- interface Number {
63
- toFixedNew: (len: number) => string;
64
- countDecimals: () => number;
65
- }
66
- }
67
-
68
- /**
69
- * @name 基础属性
70
- */
71
- export interface IBasicProps {
72
- /**
73
- * @name 样式
74
- */
75
- style?: React.CSSProperties;
76
- /**
77
- * @name 类名
78
- */
79
- className?: string;
80
- /**
81
- * @name children
82
- */
83
- children?: React.ReactNode | string;
84
- }
85
-
86
- /**
87
- * @name 权限属性
88
- */
89
- export interface IPermissionProps {
90
- /**
91
- * @name 按钮权限字符串
92
- */
93
- btnPermission?: string;
94
- /**
95
- * @name 当无权限时展示的内容,默认为null不展示任何内容
96
- */
97
- fallback?: React.ReactNode;
98
- }
1
+ /*
2
+ * @Author: dushuai
3
+ * @Date: 2026-01-13 20:55:57
4
+ * @LastEditors: dushuai
5
+ * @LastEditTime: 2026-01-26 23:49:50
6
+ * @description: 类型声明
7
+ */
8
+ /// <reference types="vite-plugin-svgr/client" />
9
+
10
+ /**
11
+ * 菜单类型枚举
12
+ * @1 目录 - 仅用于菜单分组,不对应实际页面
13
+ * @2 菜单 - 对应实际页面路由
14
+ * @3 按钮 - 页面内的按钮权限
15
+ */
16
+ export type MenuType = 1 | 2 | 3;
17
+
18
+ /**
19
+ * 路由类型
20
+ */
21
+ export interface IRoute {
22
+ /** 数据库主键id */
23
+ id: number
24
+ /** 菜单类型:1目录、2菜单、3按钮 */
25
+ menuType: MenuType
26
+ /** 菜单唯一标识,必填且唯一 */
27
+ menuId: string
28
+ /** 路由路径 */
29
+ path?: string
30
+ /**
31
+ * 菜单标识
32
+ * - 菜单类型:对应 pages 目录下文件夹名称(如 home、system/user)
33
+ * - 按钮类型:权限标识(如 user:add、user:edit)
34
+ */
35
+ menuCode?: string
36
+ /** 父级菜单的menuId */
37
+ parentId?: string
38
+ /** 是否受保护,默认true */
39
+ protected?: boolean
40
+ /** 是否是首页(仅菜单类型有效) */
41
+ index?: boolean
42
+ /** 路由/菜单标题 */
43
+ title?: string
44
+ /** 路由/菜单图标 */
45
+ icon?: string
46
+ /** 排序,数字越小越靠前 */
47
+ sort?: number
48
+ /** 是否在侧边栏菜单中显示,默认true(详情页等不需要显示在菜单中的页面设为false) */
49
+ isShowMenu?: boolean
50
+ /** 是否独立菜单 */
51
+ isIndependentMenu?: boolean
52
+ /** 激活路由的menuId */
53
+ activeRouteMenuId?: string
54
+ }
55
+
56
+ /**
57
+ * 更新store
58
+ */
59
+ export type TUpdateStore<T> = T | Partial<T> | ((state: T) => T | Partial<T>);
60
+
61
+ declare global {
62
+ interface Number {
63
+ toFixedNew: (len: number) => string;
64
+ countDecimals: () => number;
65
+ }
66
+ }
67
+
68
+ /**
69
+ * @name 基础属性
70
+ */
71
+ export interface IBasicProps {
72
+ /**
73
+ * @name 样式
74
+ */
75
+ style?: React.CSSProperties;
76
+ /**
77
+ * @name 类名
78
+ */
79
+ className?: string;
80
+ /**
81
+ * @name children
82
+ */
83
+ children?: React.ReactNode | string;
84
+ }
85
+
86
+ /**
87
+ * @name 权限属性
88
+ */
89
+ export interface IPermissionProps {
90
+ /**
91
+ * @name 按钮权限字符串
92
+ */
93
+ btnPermission?: string;
94
+ /**
95
+ * @name 当无权限时展示的内容,默认为null不展示任何内容
96
+ */
97
+ fallback?: React.ReactNode;
98
+ }
@@ -1,38 +1,38 @@
1
- /*
2
- * @Author: dushuai
3
- * @Date: 2025-12-07 16:31:57
4
- * @LastEditors: dushuai
5
- * @LastEditTime: 2026-01-13 22:14:53
6
- * @description: 请求config配置
7
- */
8
- declare module 'axios' {
9
- export interface AxiosRequestConfig {
10
- /**
11
- * @name 是否单独处理请求数据,true:返回结构为Response类型(且不处理错误码),false:返回结构为data类型,默认false
12
- */
13
- isCheck?: boolean;
14
- /**
15
- * @name 是否加载loading
16
- * @default true
17
- */
18
- showLoading?: boolean;
19
- /**
20
- * @name 加载loading的文本,最多七个字
21
- */
22
- loadingText?: string;
23
- }
24
- }
25
-
26
- export interface IResponse<T = unknown> {
27
- code: number;
28
- data: T;
29
- msg: string;
30
- }
31
-
32
- export interface IRecord<T = unknown> {
33
- pageNum: number;
34
- pageSize: number;
35
- records: T[];
36
- total: number;
37
- totalPage?: number;
38
- }
1
+ /*
2
+ * @Author: dushuai
3
+ * @Date: 2025-12-07 16:31:57
4
+ * @LastEditors: dushuai
5
+ * @LastEditTime: 2026-01-13 22:14:53
6
+ * @description: 请求config配置
7
+ */
8
+ declare module 'axios' {
9
+ export interface AxiosRequestConfig {
10
+ /**
11
+ * @name 是否单独处理请求数据,true:返回结构为Response类型(且不处理错误码),false:返回结构为data类型,默认false
12
+ */
13
+ isCheck?: boolean;
14
+ /**
15
+ * @name 是否加载loading
16
+ * @default true
17
+ */
18
+ showLoading?: boolean;
19
+ /**
20
+ * @name 加载loading的文本,最多七个字
21
+ */
22
+ loadingText?: string;
23
+ }
24
+ }
25
+
26
+ export interface IResponse<T = unknown> {
27
+ code: number;
28
+ data: T;
29
+ msg: string;
30
+ }
31
+
32
+ export interface IRecord<T = unknown> {
33
+ pageNum: number;
34
+ pageSize: number;
35
+ records: T[];
36
+ total: number;
37
+ totalPage?: number;
38
+ }
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "@spacego/fe-components",
3
- "version": "0.2.0",
4
- "description": "🚀 A component library for fe to use.",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "module": "lib/index.js",
8
- "typings": "lib/types/index.d.ts",
9
- "style": "lib/index.css",
10
- "exports": {
11
- ".": {
12
- "types": "./lib/types/index.d.ts",
13
- "import": "./lib/index.js",
14
- "require": "./lib/index.js"
15
- },
16
- "./index.css": {
17
- "import": "./lib/index.css",
18
- "require": "./lib/index.css"
19
- },
20
- "./*": {
21
- "types": "./lib/types/*.d.ts",
22
- "import": "./lib/*.js",
23
- "require": "./lib/*.js"
24
- }
25
- },
26
- "files": [
27
- "lib"
28
- ],
29
- "scripts": {
30
- "build": "vite build"
31
- },
32
- "keywords": [
33
- "components",
34
- "react",
35
- "spacego",
36
- "fe"
37
- ],
38
- "publishConfig": {
39
- "registry": "https://registry.npmjs.org/",
40
- "access": "public"
41
- },
42
- "author": "dshuais",
43
- "license": "MIT",
44
- "packageManager": "pnpm@10.8.0",
45
- "devDependencies": {
46
- "@ant-design/icons": "^6.1.0",
47
- "@dnd-kit/core": "^6.3.1",
48
- "@dnd-kit/modifiers": "^9.0.0",
49
- "@dnd-kit/sortable": "^10.0.0",
50
- "@spacego/turbo-utils": "workspace:^",
51
- "@spacego/zustand": "workspace:^",
52
- "@tailwindcss/vite": "^4.1.18",
53
- "@types/lodash-es": "^4.17.12",
54
- "@types/nprogress": "^0.2.3",
55
- "@types/react": "^18.2.66",
56
- "@types/react-resizable": "^3.0.8",
57
- "@vitejs/plugin-react-swc": "3.5.0",
58
- "ahooks": "^3.9.6",
59
- "antd": "^6.2.1",
60
- "axios": "^1.13.4",
61
- "lodash-es": "^4.17.21",
62
- "nprogress": "^0.2.0",
63
- "quill": "^2.0.3",
64
- "react": "^18.2.0",
65
- "react-dom": "^18.2.0",
66
- "react-draggable": "^4.5.0",
67
- "react-icons": "^5.5.0",
68
- "react-resizable": "^3.1.3",
69
- "react-router-dom": "^7.12.0",
70
- "rollup-plugin-clear": "^2.0.7",
71
- "sass": "^1.97.3",
72
- "tailwindcss": "^4.1.18",
73
- "typescript": "^5.8.3",
74
- "vite": "^6.3.3",
75
- "vite-plugin-dts": "^4.5.3",
76
- "vite-plugin-svgr": "^4.5.0",
77
- "zustand": "^5.0.10"
78
- }
1
+ {
2
+ "name": "@spacego/fe-components",
3
+ "version": "0.2.1",
4
+ "description": "🚀 A component library for fe to use.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "module": "lib/index.js",
8
+ "typings": "lib/types/index.d.ts",
9
+ "style": "lib/index.css",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./lib/types/index.d.ts",
13
+ "import": "./lib/index.js",
14
+ "require": "./lib/index.js"
15
+ },
16
+ "./index.css": {
17
+ "import": "./lib/index.css",
18
+ "require": "./lib/index.css"
19
+ },
20
+ "./*": {
21
+ "types": "./lib/types/*.d.ts",
22
+ "import": "./lib/*.js",
23
+ "require": "./lib/*.js"
24
+ }
25
+ },
26
+ "files": [
27
+ "lib"
28
+ ],
29
+ "keywords": [
30
+ "components",
31
+ "react",
32
+ "spacego",
33
+ "fe"
34
+ ],
35
+ "publishConfig": {
36
+ "registry": "https://registry.npmjs.org/",
37
+ "access": "public"
38
+ },
39
+ "author": "dshuais",
40
+ "license": "MIT",
41
+ "packageManager": "pnpm@10.8.0",
42
+ "devDependencies": {
43
+ "@ant-design/icons": "^6.1.0",
44
+ "@dnd-kit/core": "^6.3.1",
45
+ "@dnd-kit/modifiers": "^9.0.0",
46
+ "@dnd-kit/sortable": "^10.0.0",
47
+ "@tailwindcss/vite": "^4.1.18",
48
+ "@types/lodash-es": "^4.17.12",
49
+ "@types/nprogress": "^0.2.3",
50
+ "@types/react": "^18.2.66",
51
+ "@types/react-resizable": "^3.0.8",
52
+ "@vitejs/plugin-react-swc": "3.5.0",
53
+ "ahooks": "^3.9.6",
54
+ "antd": "^6.2.1",
55
+ "axios": "^1.13.4",
56
+ "lodash-es": "^4.17.21",
57
+ "nprogress": "^0.2.0",
58
+ "quill": "^2.0.3",
59
+ "react": "^18.2.0",
60
+ "react-dom": "^18.2.0",
61
+ "react-draggable": "^4.5.0",
62
+ "react-icons": "^5.5.0",
63
+ "react-resizable": "^3.1.3",
64
+ "react-router-dom": "^7.12.0",
65
+ "rollup-plugin-clear": "^2.0.7",
66
+ "sass": "^1.97.3",
67
+ "tailwindcss": "^4.1.18",
68
+ "typescript": "^5.8.3",
69
+ "vite": "^6.3.3",
70
+ "vite-plugin-dts": "^4.5.3",
71
+ "vite-plugin-svgr": "^4.5.0",
72
+ "zustand": "^5.0.10",
73
+ "@spacego/turbo-utils": "^0.1.0",
74
+ "@spacego/zustand": "^1.0.1"
75
+ },
76
+ "scripts": {
77
+ "build": "vite build"
78
+ }
79
79
  }