@spacego/fe-components 0.3.1 → 0.3.3
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/index.js +25 -27
- package/lib/index.css +1 -1
- package/lib/index.js +101 -103
- package/lib/types/fe-auto-complete/auto-complete.d.ts +1 -3
- package/lib/types/fe-button/button.d.ts +13 -15
- package/lib/types/fe-cascader/cascader.d.ts +6 -8
- package/lib/types/fe-checkbox/checkbox.d.ts +4 -6
- package/lib/types/fe-checkbox-group/checkbox-group.d.ts +4 -6
- package/lib/types/fe-date-picker/date-picker.d.ts +2 -4
- package/lib/types/fe-description-render/description-render.d.ts +30 -32
- package/lib/types/fe-descriptions/descriptions.d.ts +1 -3
- package/lib/types/fe-empty/empty.d.ts +1 -3
- package/lib/types/fe-error-block/error-block.d.ts +5 -7
- package/lib/types/fe-form/fe-form/form.d.ts +279 -338
- package/lib/types/fe-form/fe-form-item/form-item.d.ts +64 -66
- package/lib/types/fe-form/fe-form-label/form-label.d.ts +42 -44
- package/lib/types/fe-form/index.d.ts +0 -1
- package/lib/types/fe-input/input.d.ts +10 -12
- package/lib/types/fe-input-number/input-number.d.ts +1 -3
- package/lib/types/fe-layouts/context/global-context.d.ts +238 -240
- package/lib/types/fe-link/link.d.ts +4 -6
- package/lib/types/fe-map/map.d.ts +73 -73
- package/lib/types/fe-modal/modal.d.ts +18 -20
- package/lib/types/fe-pagination/pagination.d.ts +1 -3
- package/lib/types/fe-panel/panel-toolbar.d.ts +3 -5
- package/lib/types/fe-panel/panel.d.ts +58 -60
- package/lib/types/fe-permission/permission.d.ts +9 -11
- package/lib/types/fe-permission-provider/permission-provider.d.ts +6 -8
- package/lib/types/fe-radio/radio.d.ts +1 -3
- package/lib/types/fe-radio-group/radio-group.d.ts +1 -3
- package/lib/types/fe-rich-text/rich-text.d.ts +165 -167
- package/lib/types/fe-select/select.d.ts +7 -9
- package/lib/types/fe-switch/switch.d.ts +1 -3
- package/lib/types/fe-table/fe-table-link/table-link.d.ts +8 -10
- package/lib/types/fe-table/fe-table-render/table-render.d.ts +10 -12
- package/lib/types/fe-table/fe-table-toolbar/table-toolbar.d.ts +14 -16
- package/lib/types/fe-table/fe-table-utils/index.d.ts +4 -4
- package/lib/types/fe-table/type/table-context.d.ts +60 -60
- package/lib/types/fe-table/type/table.d.ts +787 -789
- package/lib/types/fe-text-area/text-area.d.ts +3 -5
- package/lib/types/fe-time-picker/time-picker.d.ts +2 -4
- package/lib/types/fe-upload/upload.d.ts +81 -83
- package/lib/types/fe-upload-atomic/upload-atomic.d.ts +1 -3
- package/lib/types/hooks/use-descriptions.hook/use-descriptions.d.ts +149 -151
- package/lib/types/hooks/use-form.hook/use-form.d.ts +11 -13
- package/lib/types/hooks/use-permission.hook/use-permission.d.ts +10 -10
- 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/fe-form/fe-form-input-input/index.js +0 -63
- package/lib/types/fe-form/fe-form-input-input/index.d.ts +0 -3
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IToolBarBtnConfig } from '../type/table.d';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare const FeTableToolbar: React.ForwardRefExoticComponent<FeTableToolbarProps>;
|
|
3
|
+
export interface FeTableToolbarProps {
|
|
4
|
+
config: IToolBarBtnConfig[];
|
|
5
|
+
btnPermissionList?: string[];
|
|
6
|
+
modal?: {
|
|
7
|
+
confirm: (config: {
|
|
8
|
+
title?: string;
|
|
9
|
+
content?: React.ReactNode;
|
|
10
|
+
onOk?: () => void;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const FeTableToolbar: React.ForwardRefExoticComponent<FeTableToolbarProps>;
|
|
@@ -48,7 +48,7 @@ export declare const processTableColumns: (columns: ITableColumns<any>[], column
|
|
|
48
48
|
filter?: any;
|
|
49
49
|
dictfilterParams?: {
|
|
50
50
|
dictList: Array<{
|
|
51
|
-
|
|
51
|
+
value: string;
|
|
52
52
|
label: string;
|
|
53
53
|
}>;
|
|
54
54
|
};
|
|
@@ -57,7 +57,7 @@ export declare const processTableColumns: (columns: ITableColumns<any>[], column
|
|
|
57
57
|
filter?: any;
|
|
58
58
|
dictfilterParams?: {
|
|
59
59
|
dictList: Array<{
|
|
60
|
-
|
|
60
|
+
value: string;
|
|
61
61
|
label: string;
|
|
62
62
|
}>;
|
|
63
63
|
};
|
|
@@ -100,7 +100,7 @@ export declare const applyColumnStyles: (columns: ITableColumns<any>[]) => {
|
|
|
100
100
|
filter?: any;
|
|
101
101
|
dictfilterParams?: {
|
|
102
102
|
dictList: Array<{
|
|
103
|
-
|
|
103
|
+
value: string;
|
|
104
104
|
label: string;
|
|
105
105
|
}>;
|
|
106
106
|
};
|
|
@@ -109,7 +109,7 @@ export declare const applyColumnStyles: (columns: ITableColumns<any>[]) => {
|
|
|
109
109
|
filter?: any;
|
|
110
110
|
dictfilterParams?: {
|
|
111
111
|
dictList: Array<{
|
|
112
|
-
|
|
112
|
+
value: string;
|
|
113
113
|
label: string;
|
|
114
114
|
}>;
|
|
115
115
|
};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 可编辑表格上下文类型定义
|
|
3
|
-
*/
|
|
4
|
-
export interface TableContext {
|
|
5
|
-
/**
|
|
6
|
-
* 当前行记录(包含最新表单数据)
|
|
7
|
-
* 注意:这里的字段值是已经从表单中获取的最新值
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
currentRecord: Record<string, any>;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 所有表格行数据
|
|
14
|
-
* 格式: { rowId: rowData }
|
|
15
|
-
* 例如: { '1': { id: 1, name: '张三' }, '2': { id: 2, name: '李四' } }
|
|
16
|
-
*/
|
|
17
|
-
allTableData: Record<string, Record<string, any>>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Ant Design Form 表单实例
|
|
21
|
-
* 可以使用所有表单方法,如:
|
|
22
|
-
* - getFieldValue(name)
|
|
23
|
-
* - setFieldValue(name, value)
|
|
24
|
-
* - getFieldsValue()
|
|
25
|
-
* - setFieldsValue(values)
|
|
26
|
-
* - validateFields()
|
|
27
|
-
*/
|
|
28
|
-
form: any;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 带表格上下文的事件处理器类型
|
|
33
|
-
* 用于为事件处理器提供类型提示
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* import type { TableEventHandler } from '@orchid/fe-table';
|
|
38
|
-
*
|
|
39
|
-
* const handleBlur: TableEventHandler<[React.FocusEvent]> = (event, tableContext) => {
|
|
40
|
-
* const { currentRecord, form } = tableContext;
|
|
41
|
-
* // ...
|
|
42
|
-
* };
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export type TableEventHandler<T extends any[] = any[]> = (...args: [...T, TableContext]) => void | Promise<void>;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 表格值变更事件处理器
|
|
49
|
-
*/
|
|
50
|
-
export type TableValueChangeHandler = TableEventHandler<[any]>;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 表格点击事件处理器
|
|
54
|
-
*/
|
|
55
|
-
export type TableClickHandler = TableEventHandler<[React.MouseEvent]>;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 表格焦点事件处理器
|
|
59
|
-
*/
|
|
60
|
-
export type TableFocusHandler = TableEventHandler<[React.FocusEvent]>;
|
|
1
|
+
/**
|
|
2
|
+
* 可编辑表格上下文类型定义
|
|
3
|
+
*/
|
|
4
|
+
export interface TableContext {
|
|
5
|
+
/**
|
|
6
|
+
* 当前行记录(包含最新表单数据)
|
|
7
|
+
* 注意:这里的字段值是已经从表单中获取的最新值
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
currentRecord: Record<string, any>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 所有表格行数据
|
|
14
|
+
* 格式: { rowId: rowData }
|
|
15
|
+
* 例如: { '1': { id: 1, name: '张三' }, '2': { id: 2, name: '李四' } }
|
|
16
|
+
*/
|
|
17
|
+
allTableData: Record<string, Record<string, any>>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Ant Design Form 表单实例
|
|
21
|
+
* 可以使用所有表单方法,如:
|
|
22
|
+
* - getFieldValue(name)
|
|
23
|
+
* - setFieldValue(name, value)
|
|
24
|
+
* - getFieldsValue()
|
|
25
|
+
* - setFieldsValue(values)
|
|
26
|
+
* - validateFields()
|
|
27
|
+
*/
|
|
28
|
+
form: any;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 带表格上下文的事件处理器类型
|
|
33
|
+
* 用于为事件处理器提供类型提示
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* import type { TableEventHandler } from '@orchid/fe-table';
|
|
38
|
+
*
|
|
39
|
+
* const handleBlur: TableEventHandler<[React.FocusEvent]> = (event, tableContext) => {
|
|
40
|
+
* const { currentRecord, form } = tableContext;
|
|
41
|
+
* // ...
|
|
42
|
+
* };
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export type TableEventHandler<T extends any[] = any[]> = (...args: [...T, TableContext]) => void | Promise<void>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 表格值变更事件处理器
|
|
49
|
+
*/
|
|
50
|
+
export type TableValueChangeHandler = TableEventHandler<[any]>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 表格点击事件处理器
|
|
54
|
+
*/
|
|
55
|
+
export type TableClickHandler = TableEventHandler<[React.MouseEvent]>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 表格焦点事件处理器
|
|
59
|
+
*/
|
|
60
|
+
export type TableFocusHandler = TableEventHandler<[React.FocusEvent]>;
|