xph-crud 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/dist/index.js +6 -0
- package/dist/index.umd.cjs +8 -8
- package/dist/types/common/index.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/actions/types/actionItem.d.ts +59 -18
- package/dist/types/common/src/components/actions/types/actions.d.ts +30 -0
- package/dist/types/common/src/{componnets → components}/auth/types/index.d.ts +9 -0
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogContentMaxHeight.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogFooter.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogPosition.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogSize.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogZoom.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useDragDialog.d.ts +1 -1
- package/dist/types/common/src/{componnets → components}/dialog/hooks/useResizeDialog.d.ts +1 -1
- package/dist/types/common/src/components/dialog/types/dialog.d.ts +99 -0
- package/dist/types/common/src/{componnets → components}/index.d.ts +3 -0
- package/dist/types/common/src/hooks/useAsyncState.d.ts +2 -2
- package/dist/types/common/src/hooks/useExtendCompProps.d.ts +1 -1
- package/dist/types/common/src/types/extendComponent.d.ts +3 -1
- package/dist/types/common/src/utils/getValueByPath.d.ts +7 -4
- package/dist/types/common/src/utils/uuid.d.ts +3 -0
- package/dist/types/form/index.d.ts +1 -0
- package/dist/types/form/src/helper.d.ts +1 -1
- package/dist/types/form/src/hooks/useApiComonentCache.d.ts +6 -9
- package/dist/types/form/src/hooks/useForm.d.ts +1 -1
- package/dist/types/form/src/types/form.d.ts +81 -19
- package/dist/types/form/src/types/formItem.d.ts +102 -23
- package/dist/types/table/index.d.ts +3 -2
- package/dist/types/table/src/components/crudFormDialog/index.d.ts +2 -2
- package/dist/types/table/src/components/table/components/cellFunc/types/cellFunc.d.ts +32 -17
- package/dist/types/table/src/types/apiTable.d.ts +52 -21
- package/dist/types/table/src/types/column.d.ts +6 -2
- package/dist/types/table/src/types/crudFormDialog.d.ts +21 -8
- package/dist/types/table/src/types/searchForm.d.ts +6 -1
- package/dist/types/table/src/types/table.d.ts +22 -18
- package/package.json +1 -1
- package/dist/types/common/src/componnets/actions/types/actions.d.ts +0 -18
- package/dist/types/common/src/componnets/dialog/types/dialog.d.ts +0 -32
- /package/dist/types/common/src/{componnets → components}/actions/actions.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/components/button.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/components/dropdown.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/components/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/components/more.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/hooks/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/hooks/useActionItems.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/hooks/useActionsProps.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/hooks/useExtendActions.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/hooks/useRenderContent.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/actions/types/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/auth/auth.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/auth/hooks/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/auth/hooks/useAuthProps.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/auth/hooks/useExtendAuth.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/components/headerBtns/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/components/minimizeDialog/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/dialog.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogActions.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogChangeRecord.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogProps.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useExtendDialog.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useMinResizeRecord.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useMinimizeDialog.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useOnContainerSizeChange.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useOnPropsSizeChange.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/usePopperContainerSize.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/hooks/useTopShowDialog.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/dialog/types/index.d.ts +0 -0
- /package/dist/types/common/src/{componnets → components}/portal/portal.d.ts +0 -0
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { IXphActionsProps, TXphExtendComponentPropsMap } from '../../../../../../../common';
|
|
2
2
|
import { IComponentColumnProps, TDataSourceItem } from '../../../../../types';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @description cellFunc中每一项对应的组件componentProps属性映射
|
|
6
|
+
*/
|
|
5
7
|
export type TCellComponentPropsMap<CellFuncExtendPropsMap extends TXphExtendComponentPropsMap = {}, ActionsExtendPropsMap extends TXphExtendComponentPropsMap = {}> = {
|
|
6
8
|
link: {
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 超链接,点击超链接跳转
|
|
11
|
+
*/
|
|
8
12
|
url?: string;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* 点击事件(优先级最高)
|
|
15
|
+
*/
|
|
10
16
|
onClick?: () => void;
|
|
11
17
|
};
|
|
12
18
|
actions: IXphActionsProps<ActionsExtendPropsMap>;
|
|
13
19
|
tag: {
|
|
14
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* 标签的枚举
|
|
22
|
+
*/
|
|
15
23
|
enums: Array<{
|
|
16
24
|
label: string;
|
|
17
25
|
value: any;
|
|
@@ -25,7 +33,9 @@ type Without<T, K> = {
|
|
|
25
33
|
[P in Exclude<keyof T, K>]?: never;
|
|
26
34
|
};
|
|
27
35
|
type XOR<T extends any[]> = T extends [infer A, infer B, ...infer Rest] ? A | B extends object ? (Without<A, keyof B> & B) | (Without<B, keyof A> & A) | XOR<[A | B, ...Rest]> : A | B : T extends [infer A] ? A : never;
|
|
28
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @description cellFunc中每一项的配置
|
|
38
|
+
*/
|
|
29
39
|
interface ICellProps<T extends keyof TCellComponentPropsMap<J, K>, J extends TXphExtendComponentPropsMap = {}, K extends TXphExtendComponentPropsMap = {}> {
|
|
30
40
|
component: T;
|
|
31
41
|
componentProps?: TCellComponentPropsMap<J, K>[T];
|
|
@@ -34,14 +44,10 @@ type TCellFuncPropsMap<J extends TXphExtendComponentPropsMap = {}, K extends TXp
|
|
|
34
44
|
[T in keyof TCellComponentPropsMap<J, K>]: ICellProps<T, J, K>;
|
|
35
45
|
}[keyof TCellComponentPropsMap<J, K>];
|
|
36
46
|
export type TCellProps<J extends TXphExtendComponentPropsMap = {}, K extends TXphExtendComponentPropsMap = {}> = XOR<[TCellFuncPropsMap<J, K>]>;
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
T = TDataSourceItem,
|
|
41
|
-
/** 单元格的扩展组件props映射 */
|
|
42
|
-
J extends TXphExtendComponentPropsMap = {},
|
|
43
|
-
/** 操作组的扩展组件props映射 */
|
|
44
|
-
K extends TXphExtendComponentPropsMap = {}> {
|
|
47
|
+
/**
|
|
48
|
+
* @description CellFunc组件的props
|
|
49
|
+
*/
|
|
50
|
+
export interface ICellFuncProps<T = TDataSourceItem, J extends TXphExtendComponentPropsMap = {}, K extends TXphExtendComponentPropsMap = {}> {
|
|
45
51
|
dslConfig: TCellProps<J, K>[];
|
|
46
52
|
renderPrams: {
|
|
47
53
|
text: any;
|
|
@@ -50,21 +56,30 @@ K extends TXphExtendComponentPropsMap = {}> {
|
|
|
50
56
|
column: Omit<IComponentColumnProps<T, K, K>, "cellFunc">;
|
|
51
57
|
};
|
|
52
58
|
}
|
|
53
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* @description cellFunc中每一项对应的组件的props
|
|
61
|
+
*/
|
|
54
62
|
export interface ICurCellFuncProps<J extends TXphExtendComponentPropsMap = {}, K extends TXphExtendComponentPropsMap = {}, T extends keyof TCellComponentPropsMap<J, K> = keyof TCellComponentPropsMap<J, K>> {
|
|
55
63
|
curComponentProps?: TCellComponentPropsMap<J, K>[T];
|
|
56
64
|
cellFuncProps: ICellFuncProps<TDataSourceItem, J, K>;
|
|
57
65
|
}
|
|
58
66
|
/**
|
|
59
|
-
*
|
|
60
|
-
* 因为渲染是从cellFuncs中的最后一项开始的,所以mainClick是排在后面的组件传递到前面的
|
|
61
|
-
*
|
|
67
|
+
* @description 因为渲染是从cellFuncs中的最后一项开始的,所以mainClick是排在后面的组件传递到前面的
|
|
62
68
|
* 目的:目的是为了将自定义组件的点击事件交给最底层的组件进行调用
|
|
63
69
|
* 注意:因为多个自定义组件可能都有mainClick,所以也需要保证其他组件的正常调用(即:传递给子组件Comp的时候,需要把父组件传递过来的mainClick给手动执行一下)
|
|
64
70
|
*/
|
|
65
71
|
export interface IMainProps {
|
|
72
|
+
/**
|
|
73
|
+
* 点击事件
|
|
74
|
+
*/
|
|
66
75
|
mainClick?: () => void;
|
|
76
|
+
/**
|
|
77
|
+
* 内容样式
|
|
78
|
+
*/
|
|
67
79
|
mainStyle?: React.CSSProperties;
|
|
80
|
+
/**
|
|
81
|
+
* 内容
|
|
82
|
+
*/
|
|
68
83
|
mainHandleText?: () => any;
|
|
69
84
|
}
|
|
70
85
|
export {};
|
|
@@ -9,49 +9,80 @@ export interface IFunctionToolbarParams<T = TDataSourceItem> {
|
|
|
9
9
|
loading: boolean;
|
|
10
10
|
selection: T[];
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @description 扩展antd table的属性
|
|
14
|
+
*/
|
|
13
15
|
export type TApiTableProps<T = TDataSourceItem, J extends TXphExtendComponentPropsMap = {}, K extends TXphExtendComponentPropsMap = {}, L extends TXphExtendComponentPropsMap = {}> = {
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* 列配置项,默认为`[]`
|
|
18
|
+
*/
|
|
15
19
|
columns?: TColumnProps<T, J, K>[];
|
|
16
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* 首次是否自动请求,默认为`true`
|
|
22
|
+
*/
|
|
17
23
|
autoRequest?: boolean;
|
|
18
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* 获取datasource的api
|
|
26
|
+
*/
|
|
19
27
|
api?: (params: any) => Promise<any>;
|
|
20
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* 格式化返回的datasource
|
|
30
|
+
*/
|
|
21
31
|
formatDataSource?: (data: any) => any[];
|
|
22
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* 是否开启前端自动分页(当api不支持分页时可用)
|
|
34
|
+
*/
|
|
23
35
|
autoPagination?: boolean;
|
|
24
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* 单选 / 多选
|
|
38
|
+
*/
|
|
25
39
|
rowSelection?: RowSelectionType | TableRowSelection<T>;
|
|
26
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* 分页配置(因为分页器是独立出来的,使用table的分页器布局需要修改样式)
|
|
42
|
+
* 默认为`{ pageSize: 20, total: 0, showTotal: (total) => `共:$\\{total\\} 条`, current: 1, pageSizeOptions: [10, 20, 50, 100], showSizeChanger: true, showQuickJumper: true, }`
|
|
43
|
+
*/
|
|
27
44
|
pagination?: false | PaginationProps;
|
|
28
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* 表格撑满父容器(virtual为true时,默认fullHeight为true),默认为`false`
|
|
47
|
+
*/
|
|
29
48
|
fullHeight?: boolean;
|
|
30
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* 顶部操作栏配置,函数时可以传递参数,参数是什么由调用方决定
|
|
51
|
+
*/
|
|
31
52
|
toolbar?: IXphActionsProps<L> | ((e: IFunctionToolbarParams<T>) => IXphActionsProps<L>);
|
|
32
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* 分页请求参数中传递到接口的属性名
|
|
55
|
+
* 默认为`{ pageSize: "pageSize", current: "current", }`
|
|
56
|
+
*/
|
|
33
57
|
requestFields?: {
|
|
34
|
-
/** 当前页 */
|
|
35
58
|
current?: string;
|
|
36
|
-
/** 当前页大小 */
|
|
37
59
|
pageSize?: string;
|
|
38
60
|
};
|
|
39
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* 响应结果中获取数据的属性名
|
|
63
|
+
* 默认为`{ current: "current", list: "data", total: "total", }`
|
|
64
|
+
*/
|
|
40
65
|
responseFields?: {
|
|
41
|
-
/** 当前页 */
|
|
42
66
|
current?: string;
|
|
43
|
-
/** 列表 */
|
|
44
67
|
list?: string;
|
|
45
|
-
/** 所有页总数 */
|
|
46
68
|
total?: string;
|
|
47
69
|
};
|
|
48
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* 排序、筛选变化时触发
|
|
72
|
+
*/
|
|
49
73
|
onChange?: (filters: any, sorter: any, extra: any) => void;
|
|
50
|
-
} & Omit<TableProps<T>,
|
|
51
|
-
/** 内部控制的属性/重写的属性 */
|
|
52
|
-
"rowSelection" | "columns" | "loading" | "dataSource" | "pagination">;
|
|
74
|
+
} & Omit<TableProps<T>, "rowSelection" | "columns" | "loading" | "dataSource" | "pagination">;
|
|
53
75
|
export type TApiTableActionType = {
|
|
76
|
+
/**
|
|
77
|
+
* 重置事件(重置页码、表单后重新请求)
|
|
78
|
+
*/
|
|
54
79
|
resetAllData: () => Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* 重置事件(重置表单后重新请求)
|
|
82
|
+
*/
|
|
55
83
|
resetData: () => Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* 刷新数据
|
|
86
|
+
*/
|
|
56
87
|
reloadData: () => Promise<void>;
|
|
57
88
|
} & TableRef;
|
|
@@ -3,10 +3,14 @@ import { TDataSourceItem } from './table';
|
|
|
3
3
|
import { TCellProps } from '../components/table/components/cellFunc/types';
|
|
4
4
|
import { TXphExtendComponentPropsMap } from '../../../common';
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @description 扩展一下antd column的属性,不一定要扩展,只是预留
|
|
8
|
+
*/
|
|
7
9
|
type TBaseColumnType<T> = {} & ColumnType<T>;
|
|
8
10
|
export interface IComponentColumnProps<T, J extends TXphExtendComponentPropsMap = {}, K extends TXphExtendComponentPropsMap = {}> extends Omit<TBaseColumnType<T>, "render"> {
|
|
9
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* 单元格渲染属性(原理也是使用render渲染不同的内容)
|
|
13
|
+
*/
|
|
10
14
|
cellFunc: ((props: {
|
|
11
15
|
text: any;
|
|
12
16
|
record: T;
|
|
@@ -2,31 +2,44 @@ import { IXphFormProps, IXphFormActionType } from '../../../form';
|
|
|
2
2
|
import { TXphExtendComponentPropsMap, IXphDialogProps, IXphDialogActionType } from '../../../common';
|
|
3
3
|
|
|
4
4
|
export type TCrudFormDialogProps<T extends TXphExtendComponentPropsMap = {}> = Omit<IXphDialogProps, "onOk" | "onCancel"> & {
|
|
5
|
+
/**
|
|
6
|
+
* crud弹窗的form配置
|
|
7
|
+
*/
|
|
5
8
|
formProps: IXphFormProps<T>;
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* crud弹窗点击确定的回调
|
|
11
|
+
*/
|
|
12
|
+
onOk?: (event: {
|
|
7
13
|
values: any;
|
|
8
14
|
data: any;
|
|
9
15
|
}) => Promise<any>;
|
|
10
|
-
|
|
16
|
+
/**
|
|
17
|
+
* crud弹窗点击取消回调
|
|
18
|
+
*/
|
|
19
|
+
onCancel?: (event: {
|
|
11
20
|
values: any;
|
|
12
21
|
data: any;
|
|
13
22
|
}) => Promise<any>;
|
|
14
23
|
};
|
|
15
24
|
export interface IOpenActionConfig {
|
|
16
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* 回填表单的内容
|
|
27
|
+
*/
|
|
17
28
|
data: any;
|
|
18
29
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param values 表单项的值(如果弹窗传递了onCancel属性就不用传这个了,这个是为了方便所有操作都在close函数中处理)
|
|
30
|
+
* 点击确定的回调(如果弹窗传递了onOk属性就不用传这个了,这个是为了方便所有操作都在open函数中处理)
|
|
21
31
|
*/
|
|
22
|
-
ok?: (
|
|
32
|
+
ok?: (event: {
|
|
23
33
|
values: any;
|
|
24
34
|
}) => Promise<any>;
|
|
25
|
-
/**
|
|
26
|
-
|
|
35
|
+
/**
|
|
36
|
+
* 点击取消的回调(如果弹窗传递了onCancel属性就不用传这个了,这个是为了方便所有操作都在open函数中处理)
|
|
37
|
+
*/
|
|
38
|
+
cancel?: (event: {
|
|
27
39
|
values: any;
|
|
28
40
|
}) => Promise<any>;
|
|
29
41
|
}
|
|
30
42
|
export interface ICrudFormDialogActionType extends IXphFormActionType, Omit<IXphDialogActionType, "open"> {
|
|
43
|
+
/** 打开crud弹窗 */
|
|
31
44
|
open: (config: IOpenActionConfig) => Promise<void>;
|
|
32
45
|
}
|
|
@@ -2,9 +2,14 @@ import { IXphFormProps, IXphFormActionType } from '../../../form';
|
|
|
2
2
|
import { TXphExtendComponentPropsMap } from '../../../common';
|
|
3
3
|
|
|
4
4
|
export type TSearchFormActionType = IXphFormActionType & {
|
|
5
|
+
/**
|
|
6
|
+
* 设置表单的loading
|
|
7
|
+
*/
|
|
5
8
|
setFormLoading: (loading: boolean) => void;
|
|
6
9
|
};
|
|
7
10
|
export type TSearchFormProps<T extends TXphExtendComponentPropsMap = {}> = IXphFormProps<T> & {
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* 是否显示搜索 & 重置按钮
|
|
13
|
+
*/
|
|
9
14
|
showSearch?: boolean;
|
|
10
15
|
};
|
|
@@ -3,29 +3,33 @@ import { ICrudFormDialogActionType, TCrudFormDialogProps } from './crudFormDialo
|
|
|
3
3
|
import { TApiTableProps, TApiTableActionType } from './apiTable';
|
|
4
4
|
import { TXphExtendComponentPropsMap } from '../../../common';
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @description 行数据
|
|
8
|
+
*/
|
|
7
9
|
export type TDataSourceItem = Record<PropertyKey, any>;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
RecordType = TDataSourceItem,
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ActionsExtendPropsMap extends TXphExtendComponentPropsMap = {},
|
|
16
|
-
/** 顶部操作栏扩展组件props映射 */
|
|
17
|
-
ToolbarExtendPropsMap extends TXphExtendComponentPropsMap = {},
|
|
18
|
-
/** 表单扩展组件props映射(包括:搜素表单 & 新增/修改表单) */
|
|
19
|
-
FormExtendPropsMap extends TXphExtendComponentPropsMap = {}> = {
|
|
20
|
-
/** 表格配置 */
|
|
10
|
+
/**
|
|
11
|
+
* @description 整个组件的配置
|
|
12
|
+
*/
|
|
13
|
+
export type TTableProps<RecordType = TDataSourceItem, CellFuncExtendPropsMap extends TXphExtendComponentPropsMap = {}, ActionsExtendPropsMap extends TXphExtendComponentPropsMap = {}, ToolbarExtendPropsMap extends TXphExtendComponentPropsMap = {}, FormExtendPropsMap extends TXphExtendComponentPropsMap = {}> = {
|
|
14
|
+
/**
|
|
15
|
+
* 表格配置
|
|
16
|
+
*/
|
|
21
17
|
table?: TApiTableProps<RecordType, CellFuncExtendPropsMap, ActionsExtendPropsMap, ToolbarExtendPropsMap>;
|
|
22
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* 搜索表单配置项
|
|
20
|
+
*/
|
|
23
21
|
searchForm?: TSearchFormProps<FormExtendPropsMap>;
|
|
24
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* (新增 / 修改)表单弹窗配置项
|
|
24
|
+
*/
|
|
25
25
|
crudFormDialog?: TCrudFormDialogProps<FormExtendPropsMap>;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* 分页改变事件
|
|
28
|
+
*/
|
|
27
29
|
onPaginationChange?: (page: number, pageSize: number) => void;
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* 列表选中事件
|
|
32
|
+
*/
|
|
29
33
|
onRowSelectionChange?: (selectedRowKeys: React.Key[], selectedRows: RecordType[]) => void;
|
|
30
34
|
};
|
|
31
35
|
export type TTableActionType = TApiTableActionType & ICrudFormDialogActionType;
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TActionItemProps } from './actionItem';
|
|
2
|
-
import { ButtonProps } from 'antd/lib/button';
|
|
3
|
-
import { TXphExtendComponentPropsMap } from '../../../types';
|
|
4
|
-
|
|
5
|
-
export interface IActionsProps<T extends TXphExtendComponentPropsMap = {}> {
|
|
6
|
-
/** 类型 */
|
|
7
|
-
type?: ButtonProps["type"];
|
|
8
|
-
/** 操作项 */
|
|
9
|
-
items?: TActionItemProps<T>[];
|
|
10
|
-
/** 禁用(items中的componentProps的disabled优先级最高) */
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
/** 自定义内容(items的优先级高于render) */
|
|
13
|
-
render?: React.ReactElement;
|
|
14
|
-
/** 超过多少个item自动省略,默认是10(其余全部放在一个dropdown中) */
|
|
15
|
-
max?: number;
|
|
16
|
-
/** 是否需要从扩展中继承属性(可能有些特殊情况,不需要使用扩展中的属性) */
|
|
17
|
-
inherit?: boolean;
|
|
18
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from 'antd';
|
|
2
|
-
|
|
3
|
-
export interface IDialogProps {
|
|
4
|
-
width?: number;
|
|
5
|
-
height?: number;
|
|
6
|
-
mask?: boolean;
|
|
7
|
-
title?: string;
|
|
8
|
-
okProps?: Omit<ButtonProps, "children" | "onClick">;
|
|
9
|
-
cancelProps?: Omit<ButtonProps, "children" | "onClick">;
|
|
10
|
-
okText?: string;
|
|
11
|
-
cancelText?: string;
|
|
12
|
-
/** 点击确定按钮触发该事件 */
|
|
13
|
-
onOk?: (args: any) => Promise<void>;
|
|
14
|
-
/** 点击取消按钮触发该事件 */
|
|
15
|
-
onCancel?: (args: any) => Promise<void>;
|
|
16
|
-
renderFooter?: ({ loading }: {
|
|
17
|
-
loading: boolean;
|
|
18
|
-
}) => React.ReactElement;
|
|
19
|
-
renderTitle?: () => React.ReactElement;
|
|
20
|
-
/** 打开的时候会触发该事件 */
|
|
21
|
-
onOpen?: () => void;
|
|
22
|
-
/** 关闭的时候会触发该事件 */
|
|
23
|
-
onClose?: () => void;
|
|
24
|
-
/** 挂载弹窗的容器,默认是body */
|
|
25
|
-
getPopperContainer?: () => HTMLElement | null;
|
|
26
|
-
}
|
|
27
|
-
export interface IDialogActionType {
|
|
28
|
-
open: () => Promise<void>;
|
|
29
|
-
close: () => void;
|
|
30
|
-
setLoading: (loading: boolean) => void;
|
|
31
|
-
getVisible: () => boolean;
|
|
32
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/actions/hooks/useExtendActions.d.ts
RENAMED
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/actions/hooks/useRenderContent.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/components/headerBtns/index.d.ts
RENAMED
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/components/minimizeDialog/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/hooks/useDialogChangeRecord.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/hooks/useMinResizeRecord.d.ts
RENAMED
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/hooks/useMinimizeDialog.d.ts
RENAMED
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/hooks/useOnContainerSizeChange.d.ts
RENAMED
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/hooks/useOnPropsSizeChange.d.ts
RENAMED
|
File without changes
|
/package/dist/types/common/src/{componnets → components}/dialog/hooks/usePopperContainerSize.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|