@spacego/fe-components 0.2.3 → 0.3.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.
- package/README.md +37 -37
- package/lib/fe-form/fe-form-select/index.js +26 -30
- package/lib/fe-layouts/auth-layout/index.js +4 -4
- package/lib/fe-layouts/basics-layout/components/utils/index.js +8 -8
- package/lib/fe-layouts/basics-layout/index.js +5 -3
- package/lib/fe-layouts/layout.js +25 -23
- package/lib/fe-table/fe-edit-table-cell/index.js +4 -4
- package/lib/fe-table/fe-normal-table/index.js +3 -3
- package/lib/fe-table/fe-table-link/index.js +3 -3
- package/lib/fe-table/fe-table-toolbar/index.js +4 -4
- package/lib/fe-table/use-table/index.js +3 -3
- package/lib/index.css +1 -1
- package/lib/index.js +165 -163
- package/lib/node_modules/.pnpm/@rc-component_pagination@1.2.0_nnrd3gsncyragczmpvfhocinkq/node_modules/@rc-component/pagination/es/locale/zh_CN.js +18 -0
- package/lib/node_modules/.pnpm/@rc-component_picker@1.9.0_xrdeekns7he6t7xjrt27lnhvge/node_modules/@rc-component/picker/es/locale/common.js +9 -0
- package/lib/node_modules/.pnpm/@rc-component_picker@1.9.0_xrdeekns7he6t7xjrt27lnhvge/node_modules/@rc-component/picker/es/locale/zh_CN.js +78 -0
- package/lib/node_modules/.pnpm/antd@6.2.2_nnrd3gsncyragczmpvfhocinkq/node_modules/antd/es/calendar/locale/zh_CN.js +4 -0
- package/lib/node_modules/.pnpm/antd@6.2.2_nnrd3gsncyragczmpvfhocinkq/node_modules/antd/es/date-picker/locale/zh_CN.js +24 -0
- package/lib/node_modules/.pnpm/antd@6.2.2_nnrd3gsncyragczmpvfhocinkq/node_modules/antd/es/locale/zh_CN.js +146 -0
- package/lib/node_modules/.pnpm/antd@6.2.2_nnrd3gsncyragczmpvfhocinkq/node_modules/antd/es/time-picker/locale/zh_CN.js +7 -0
- package/lib/router/utils.js +31 -30
- package/lib/store/modules/layout-config.store.js +4 -4
- package/lib/store/modules/theme.store.js +4 -4
- package/lib/types/fe-auto-complete/auto-complete.d.ts +4 -0
- package/lib/types/fe-auto-complete/index.d.ts +3 -2
- package/lib/types/fe-button/button.d.ts +18 -0
- package/lib/types/fe-button/index.d.ts +3 -16
- package/lib/types/fe-cascader/cascader.d.ts +9 -0
- package/lib/types/fe-cascader/index.d.ts +3 -7
- package/lib/types/fe-checkbox/checkbox.d.ts +8 -0
- package/lib/types/fe-checkbox/index.d.ts +3 -6
- package/lib/types/fe-checkbox-group/checkbox-group.d.ts +7 -0
- package/lib/types/fe-checkbox-group/index.d.ts +3 -5
- package/lib/types/fe-date-picker/date-picker.d.ts +5 -0
- package/lib/types/fe-date-picker/index.d.ts +3 -3
- package/lib/types/fe-description-render/description-render.d.ts +33 -0
- package/lib/types/fe-description-render/index.d.ts +8 -31
- package/lib/types/fe-descriptions/descriptions.d.ts +4 -0
- package/lib/types/fe-descriptions/index.d.ts +3 -2
- package/lib/types/fe-empty/empty.d.ts +4 -0
- package/lib/types/fe-empty/index.d.ts +3 -2
- package/lib/types/fe-error-block/error-block.d.ts +8 -0
- package/lib/types/fe-error-block/index.d.ts +3 -6
- package/lib/types/fe-form/fe-form/form.d.ts +356 -0
- package/lib/types/fe-form/fe-form/index.d.ts +3 -354
- package/lib/types/fe-form/fe-form-auto-complete/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-btn-group/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-cascader/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-checkbox-group/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-date-picker/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-date-range-picker/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-input/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-input-input/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-input-number/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-item/form-item.d.ts +68 -0
- package/lib/types/fe-form/fe-form-item/index.d.ts +3 -66
- package/lib/types/fe-form/fe-form-label/form-label.d.ts +45 -0
- package/lib/types/fe-form/fe-form-label/index.d.ts +3 -43
- package/lib/types/fe-form/fe-form-radio/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-render/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-rich-text/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-select/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-switch/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-text/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-text-area/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-time-picker/index.d.ts +1 -1
- package/lib/types/fe-form/fe-form-upload/index.d.ts +1 -1
- package/lib/types/fe-form/index.d.ts +4 -4
- package/lib/types/fe-form/utils/index.d.ts +1 -1
- package/lib/types/fe-input/index.d.ts +3 -12
- package/lib/types/fe-input/input.d.ts +14 -0
- package/lib/types/fe-input-number/index.d.ts +3 -2
- package/lib/types/fe-input-number/input-number.d.ts +4 -0
- package/lib/types/fe-layouts/basics-layout/components/utils/index.d.ts +7 -6
- package/lib/types/fe-layouts/context/global-context.d.ts +240 -238
- package/lib/types/fe-link/index.d.ts +3 -6
- package/lib/types/fe-link/link.d.ts +8 -0
- package/lib/types/fe-loading/index.d.ts +1 -1
- package/lib/types/fe-map/index.d.ts +3 -73
- package/lib/types/fe-map/map.d.ts +73 -0
- package/lib/types/fe-modal/index.d.ts +3 -20
- package/lib/types/fe-modal/modal.d.ts +22 -0
- package/lib/types/fe-pagination/index.d.ts +3 -2
- package/lib/types/fe-pagination/pagination.d.ts +4 -0
- package/lib/types/fe-panel/index.d.ts +3 -61
- package/lib/types/fe-panel/panel-toolbar.d.ts +6 -4
- package/lib/types/fe-panel/panel.d.ts +63 -0
- package/lib/types/fe-permission/index.d.ts +3 -10
- package/lib/types/fe-permission/permission.d.ts +12 -0
- package/lib/types/fe-permission-provider/index.d.ts +3 -8
- package/lib/types/fe-permission-provider/permission-provider.d.ts +10 -0
- package/lib/types/fe-radio/index.d.ts +3 -2
- package/lib/types/fe-radio/radio.d.ts +4 -0
- package/lib/types/fe-radio-group/index.d.ts +3 -2
- package/lib/types/fe-radio-group/radio-group.d.ts +4 -0
- package/lib/types/fe-rich-text/index.d.ts +3 -167
- package/lib/types/fe-rich-text/rich-text.d.ts +169 -0
- package/lib/types/fe-select/index.d.ts +3 -8
- package/lib/types/fe-select/select.d.ts +10 -0
- package/lib/types/fe-switch/index.d.ts +3 -2
- package/lib/types/fe-switch/switch.d.ts +4 -0
- package/lib/types/fe-table/fe-table-link/index.d.ts +3 -10
- package/lib/types/fe-table/fe-table-link/table-link.d.ts +12 -0
- package/lib/types/fe-table/fe-table-render/index.d.ts +3 -11
- package/lib/types/fe-table/fe-table-render/table-render.d.ts +13 -0
- package/lib/types/fe-table/fe-table-toolbar/index.d.ts +3 -16
- package/lib/types/fe-table/fe-table-toolbar/table-toolbar.d.ts +18 -0
- package/lib/types/fe-table/type/table-context.d.ts +60 -60
- package/lib/types/fe-table/type/table.d.ts +789 -787
- package/lib/types/fe-text-area/index.d.ts +3 -4
- package/lib/types/fe-text-area/text-area.d.ts +6 -0
- package/lib/types/fe-time-picker/index.d.ts +3 -3
- package/lib/types/fe-time-picker/time-picker.d.ts +5 -0
- package/lib/types/fe-upload/index.d.ts +3 -85
- package/lib/types/fe-upload/upload.d.ts +87 -0
- package/lib/types/fe-upload-atomic/index.d.ts +3 -2
- package/lib/types/fe-upload-atomic/upload-atomic.d.ts +4 -0
- package/lib/types/fe-upload-crop/index.d.ts +2 -2
- package/lib/types/hooks/index.d.ts +1 -0
- package/lib/types/hooks/{use-descriptions → use-descriptions.hook}/index.d.ts +1 -1
- package/lib/types/hooks/use-descriptions.hook/use-descriptions.d.ts +153 -0
- package/lib/types/hooks/use-form.hook/index.d.ts +3 -0
- package/lib/types/hooks/{use-form/index.d.ts → use-form.hook/use-form.d.ts} +14 -12
- package/lib/types/hooks/use-permission.hook/index.d.ts +10 -10
- package/lib/types/hooks/use-permission.hook/use-permission.d.ts +10 -0
- package/lib/types/index.d.ts +30 -1
- package/lib/types/router/utils.d.ts +2 -1
- package/lib/types/typings/index.d.ts +98 -98
- package/lib/types/typings/shims-axios.d.ts +38 -38
- package/package.json +3 -3
- /package/lib/hooks/{use-form → use-form.hook}/index.js +0 -0
|
@@ -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
|
-
/** 父级菜单的
|
|
37
|
-
parentId?:
|
|
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
|
+
/** 父级菜单的id */
|
|
37
|
+
parentId?: number
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spacego/fe-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "🚀 A component library for fe to use.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"vite-plugin-dts": "^4.5.3",
|
|
71
71
|
"vite-plugin-svgr": "^4.5.0",
|
|
72
72
|
"zustand": "^5.0.10",
|
|
73
|
-
"@spacego/
|
|
74
|
-
"@spacego/
|
|
73
|
+
"@spacego/zustand": "^1.0.1",
|
|
74
|
+
"@spacego/turbo-utils": "^0.1.0"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "vite build"
|
|
File without changes
|