@spacego/fe-components 0.3.0 → 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-layouts/basics-layout/components/utils/index.js +8 -8
- package/lib/router/utils.js +31 -30
- package/lib/types/fe-auto-complete/auto-complete.d.ts +3 -1
- package/lib/types/fe-button/button.d.ts +15 -13
- package/lib/types/fe-cascader/cascader.d.ts +8 -6
- package/lib/types/fe-checkbox/checkbox.d.ts +6 -4
- package/lib/types/fe-checkbox-group/checkbox-group.d.ts +6 -4
- package/lib/types/fe-date-picker/date-picker.d.ts +4 -2
- package/lib/types/fe-description-render/description-render.d.ts +32 -30
- package/lib/types/fe-descriptions/descriptions.d.ts +3 -1
- package/lib/types/fe-empty/empty.d.ts +3 -1
- package/lib/types/fe-error-block/error-block.d.ts +7 -5
- package/lib/types/fe-form/fe-form/form.d.ts +338 -336
- package/lib/types/fe-form/fe-form-item/form-item.d.ts +66 -64
- package/lib/types/fe-form/fe-form-label/form-label.d.ts +44 -42
- package/lib/types/fe-input/input.d.ts +12 -10
- package/lib/types/fe-input-number/input-number.d.ts +3 -1
- 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/link.d.ts +6 -4
- package/lib/types/fe-map/map.d.ts +73 -73
- package/lib/types/fe-modal/modal.d.ts +20 -18
- package/lib/types/fe-pagination/pagination.d.ts +3 -1
- package/lib/types/fe-panel/panel-toolbar.d.ts +5 -3
- package/lib/types/fe-panel/panel.d.ts +60 -58
- package/lib/types/fe-permission/permission.d.ts +11 -9
- package/lib/types/fe-permission-provider/permission-provider.d.ts +8 -6
- package/lib/types/fe-radio/radio.d.ts +3 -1
- package/lib/types/fe-radio-group/radio-group.d.ts +3 -1
- package/lib/types/fe-rich-text/rich-text.d.ts +167 -165
- package/lib/types/fe-select/select.d.ts +9 -7
- package/lib/types/fe-switch/switch.d.ts +3 -1
- package/lib/types/fe-table/fe-table-link/table-link.d.ts +10 -8
- package/lib/types/fe-table/fe-table-render/table-render.d.ts +12 -10
- package/lib/types/fe-table/fe-table-toolbar/table-toolbar.d.ts +16 -14
- 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/text-area.d.ts +5 -3
- package/lib/types/fe-time-picker/time-picker.d.ts +4 -2
- package/lib/types/fe-upload/upload.d.ts +83 -81
- package/lib/types/fe-upload-atomic/upload-atomic.d.ts +3 -1
- package/lib/types/hooks/use-descriptions.hook/use-descriptions.d.ts +151 -149
- package/lib/types/hooks/use-form.hook/use-form.d.ts +13 -11
- package/lib/types/hooks/use-permission.hook/use-permission.d.ts +10 -10
- 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
|
@@ -1,66 +1,68 @@
|
|
|
1
1
|
import { FeFormRule } from '../fe-form/form.d';
|
|
2
2
|
import { FeFormLabelProps } from '../fe-form-label/form-label.d';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| '
|
|
47
|
-
| '
|
|
48
|
-
| '
|
|
49
|
-
| '
|
|
50
|
-
| '
|
|
51
|
-
| '
|
|
52
|
-
| '
|
|
53
|
-
| '
|
|
54
|
-
| '
|
|
55
|
-
| '
|
|
56
|
-
| '
|
|
57
|
-
| '
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface FeFormItemProps extends FeFormLabelProps {
|
|
6
|
+
/**
|
|
7
|
+
* 表单标识
|
|
8
|
+
*/
|
|
9
|
+
name?: string | string[];
|
|
10
|
+
/**
|
|
11
|
+
* 表单类型
|
|
12
|
+
*/
|
|
13
|
+
type: string;
|
|
14
|
+
/**
|
|
15
|
+
* 表单规则触发方式
|
|
16
|
+
*/
|
|
17
|
+
validateTrigger?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 表单报错提示
|
|
20
|
+
*/
|
|
21
|
+
requiredMessage?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 表单规则
|
|
24
|
+
*/
|
|
25
|
+
rules?: FeFormRule[];
|
|
26
|
+
/**
|
|
27
|
+
* 初始化值
|
|
28
|
+
*/
|
|
29
|
+
initialValue?: any;
|
|
30
|
+
/**
|
|
31
|
+
* 是否必填
|
|
32
|
+
*/
|
|
33
|
+
required: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 其他属性
|
|
36
|
+
*/
|
|
37
|
+
attributes?: Record<string, any>;
|
|
38
|
+
/**
|
|
39
|
+
* 表单内容
|
|
40
|
+
*/
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* 表单值类型
|
|
44
|
+
*/
|
|
45
|
+
valueType?:
|
|
46
|
+
| 'string'
|
|
47
|
+
| 'number'
|
|
48
|
+
| 'boolean'
|
|
49
|
+
| 'method'
|
|
50
|
+
| 'regexp'
|
|
51
|
+
| 'integer'
|
|
52
|
+
| 'float'
|
|
53
|
+
| 'object'
|
|
54
|
+
| 'enum'
|
|
55
|
+
| 'date'
|
|
56
|
+
| 'url'
|
|
57
|
+
| 'hex'
|
|
58
|
+
| 'email'
|
|
59
|
+
| 'array';
|
|
60
|
+
/**
|
|
61
|
+
* 获取值的属性
|
|
62
|
+
*/
|
|
63
|
+
getValueProps?: (value: any) => any;
|
|
64
|
+
/**
|
|
65
|
+
* 标准化值
|
|
66
|
+
*/
|
|
67
|
+
normalize?: (value: any) => any;
|
|
68
|
+
}
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface FeFormLabelProps {
|
|
5
|
+
/**
|
|
6
|
+
* 标签
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* 标签左侧内容
|
|
11
|
+
*/
|
|
12
|
+
labelLeft?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* 标签右侧内容
|
|
15
|
+
*/
|
|
16
|
+
labelRight?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* 标签对齐方式
|
|
19
|
+
*/
|
|
20
|
+
labelAlign?: 'left' | 'right';
|
|
21
|
+
/**
|
|
22
|
+
* 标签宽度
|
|
23
|
+
*/
|
|
24
|
+
labelWidth?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 是否显示新增按钮
|
|
27
|
+
*/
|
|
28
|
+
showAdd?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 点击新增按钮
|
|
31
|
+
*/
|
|
32
|
+
onAddClick?: (evt: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
33
|
+
/**
|
|
34
|
+
* 是否显示右侧提示
|
|
35
|
+
*/
|
|
36
|
+
showHint?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 提示文案
|
|
39
|
+
*/
|
|
40
|
+
hintText?: string | React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* 是否需要展示label
|
|
43
|
+
*/
|
|
44
|
+
needLabel?: boolean;
|
|
45
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { InputProps } from 'antd';
|
|
2
2
|
import { PasswordProps } from 'antd/es/input/Password';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface FeInputProps extends InputProps {
|
|
6
|
+
/**
|
|
7
|
+
* @name 是否默认开启input的title属性,默认把value当作title
|
|
8
|
+
*/
|
|
9
|
+
isShowTitle?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @name 密码输入框的属性
|
|
12
|
+
*/
|
|
13
|
+
passwordAttr?: PasswordProps;
|
|
14
|
+
}
|
|
@@ -2,7 +2,8 @@ import { RouteObject } from 'react-router-dom';
|
|
|
2
2
|
import { MenuItem } from '../../../../router/utils';
|
|
3
3
|
/** RouteNode 类型定义 */
|
|
4
4
|
export type RouteNode = RouteObject & {
|
|
5
|
-
parentId?:
|
|
5
|
+
parentId?: number;
|
|
6
|
+
dbId?: number;
|
|
6
7
|
children?: RouteNode[];
|
|
7
8
|
handle?: {
|
|
8
9
|
title?: string;
|
|
@@ -20,17 +21,17 @@ export declare function normalizePath(path?: string): string;
|
|
|
20
21
|
*/
|
|
21
22
|
export declare function findRouteByPath(path: string, routeList: RouteNode[]): RouteNode | null;
|
|
22
23
|
/**
|
|
23
|
-
* 构建路由映射表(
|
|
24
|
+
* 构建路由映射表(dbId -> RouteNode)
|
|
24
25
|
*/
|
|
25
|
-
export declare function buildRouteMap(routeList: RouteNode[]): Map<
|
|
26
|
+
export declare function buildRouteMap(routeList: RouteNode[]): Map<number, RouteNode>;
|
|
26
27
|
/**
|
|
27
|
-
* 根据
|
|
28
|
+
* 根据 dbId 查找路由节点
|
|
28
29
|
*/
|
|
29
|
-
export declare function getRouteById(id:
|
|
30
|
+
export declare function getRouteById(id: number, routeMap: Map<number, RouteNode>): RouteNode | null;
|
|
30
31
|
/**
|
|
31
32
|
* 递归查找父级路由链(从根到当前),根据 isIndependentMenu 过滤层级
|
|
32
33
|
*/
|
|
33
|
-
export declare function findParentRoutes(route: RouteNode, routeMap: Map<
|
|
34
|
+
export declare function findParentRoutes(route: RouteNode, routeMap: Map<number, RouteNode>): RouteNode[];
|
|
34
35
|
/**
|
|
35
36
|
* 递归查找菜单的父级 key
|
|
36
37
|
*/
|