@gx-design-vue/pro-table 0.2.0-beta.75 → 0.2.0-beta.77
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/ProTable.d.ts +29 -423
- package/dist/_utils/ant-design-vue/table/props.d.ts +17 -168
- package/dist/hooks/useColums.d.ts +2 -2
- package/dist/hooks/useFetchData.d.ts +5 -5
- package/dist/hooks/useRowSelection.d.ts +1 -1
- package/dist/hooks/useTable.d.ts +16 -12
- package/dist/hooks/useTableForm.d.ts +4 -4
- package/dist/hooks/useTableScroll.d.ts +1 -1
- package/dist/pro-table.js +1042 -1207
- package/dist/pro-table.umd.cjs +1 -1
- package/dist/props.d.ts +7 -167
- package/dist/types/ColumnTypings.d.ts +5 -5
- package/dist/types/SlotsTypings.d.ts +6 -5
- package/dist/types/TableTypings.d.ts +22 -17
- package/dist/typing.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties, ComputedRef, Ref } from 'vue';
|
|
2
|
-
import type { Breakpoint, CustomRender,
|
|
2
|
+
import type { Breakpoint, CustomRender, SizeType, VueNode, WithFalse } from '@gx-design-vue/pro-utils';
|
|
3
3
|
import type { ProColumnType, ProColumnsType, ProSearchMap } from './ColumnTypings';
|
|
4
4
|
import type { CustomDataRender, DefaultRender, PageItemRender } from './SlotsTypings';
|
|
5
|
-
import type { FilterValue, SorterResult, TableCurrentDataSource, TablePaginationConfig, TableProps, TableRowSelection } from '../_utils';
|
|
5
|
+
import type { FilterValue, SelectionSelectFn, SorterResult, TableCurrentDataSource, TablePaginationConfig, TableProps, TableRowSelection } from '../_utils';
|
|
6
|
+
import type { DefaultRecordType } from '../typing';
|
|
6
7
|
import type { ColumnSettingProps } from '../components/ColumnSetting';
|
|
7
8
|
import type { ColumnsState, ColumnsStateType } from '../hooks/useColumnSetting';
|
|
8
|
-
export type ProTabelFeachParams<R =
|
|
9
|
+
export type ProTabelFeachParams<R = DefaultRecordType> = {
|
|
9
10
|
params?: R;
|
|
10
11
|
filters?: Record<string, FilterValue | null>;
|
|
11
12
|
sorter?: SorterResult | SorterResult[];
|
|
@@ -63,17 +64,21 @@ export interface OptionConfig {
|
|
|
63
64
|
fullScreen?: (() => VueNode | JSX.Element) | boolean | (() => Promise<void>);
|
|
64
65
|
}
|
|
65
66
|
/** action表格实例 */
|
|
66
|
-
export interface ProCoreActionType<T =
|
|
67
|
+
export interface ProCoreActionType<T = DefaultRecordType, R = DefaultRecordType> {
|
|
67
68
|
/** @name loadingStatus */
|
|
68
69
|
loading: Ref<boolean>;
|
|
69
70
|
dataSource: ComputedRef<T[]>;
|
|
70
71
|
getLoadingStatus: () => boolean;
|
|
71
72
|
pagination: R | boolean;
|
|
72
73
|
pageState: PageState;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
selectedKey: ComputedRef<(string | number)[]>;
|
|
75
|
+
selectedItem: ComputedRef<T[]>;
|
|
76
|
+
rowsSelection?: {
|
|
76
77
|
clear: () => void;
|
|
78
|
+
sync: (data: T[]) => void;
|
|
79
|
+
remove: (keys: (string | number)[]) => void;
|
|
80
|
+
select: SelectionSelectFn<T>;
|
|
81
|
+
selectAll: TableRowSelection<T>['onSelectAll'];
|
|
77
82
|
};
|
|
78
83
|
/** @name 刷新 */
|
|
79
84
|
reload: (info?: ProTabelFeachParams<R>) => void;
|
|
@@ -98,7 +103,7 @@ export interface ProCoreActionType<T = RecordType, R = RecordType> {
|
|
|
98
103
|
setLoading: (loading: boolean) => void;
|
|
99
104
|
}
|
|
100
105
|
/** form查询表单实例 */
|
|
101
|
-
export interface ProCoreFormType<R =
|
|
106
|
+
export interface ProCoreFormType<R = DefaultRecordType> {
|
|
102
107
|
/** @name 获取表格-表单请求参数 */
|
|
103
108
|
getFormState?: () => R;
|
|
104
109
|
/** @name 获取表格-内部表单参数 */
|
|
@@ -106,23 +111,23 @@ export interface ProCoreFormType<R = RecordType> {
|
|
|
106
111
|
/** @name 重置内部表单组件参数 */
|
|
107
112
|
restFormState?: (callBack?: () => void) => void;
|
|
108
113
|
}
|
|
109
|
-
export interface ProTableRef<T =
|
|
114
|
+
export interface ProTableRef<T = DefaultRecordType, R = DefaultRecordType> {
|
|
110
115
|
formRef: () => ProCoreFormType<R>;
|
|
111
116
|
actionRef: () => ProCoreActionType<T, R>;
|
|
112
117
|
}
|
|
113
|
-
export type ProTableProps<DataRecord extends object =
|
|
118
|
+
export type ProTableProps<DataRecord extends object = DefaultRecordType, ParamsType extends object = DefaultRecordType> = Omit<TableProps, 'columns' | 'dataSource'> & Partial<{
|
|
114
119
|
dataSource: DataRecord[];
|
|
115
120
|
tableProps: {
|
|
116
121
|
class?: string;
|
|
117
122
|
style?: CSSProperties;
|
|
118
123
|
};
|
|
119
|
-
rowKey:
|
|
124
|
+
rowKey: keyof DataRecord;
|
|
120
125
|
titleTipText: string;
|
|
121
126
|
autoScroll: boolean;
|
|
122
127
|
emptyTextProps: {
|
|
123
128
|
class?: string;
|
|
124
129
|
style?: CSSProperties;
|
|
125
|
-
extraProps?:
|
|
130
|
+
extraProps?: DefaultRecordType;
|
|
126
131
|
};
|
|
127
132
|
columnEmptyText: ProFieldEmptyText;
|
|
128
133
|
showLoading: boolean;
|
|
@@ -144,17 +149,17 @@ export type ProTableProps<DataRecord extends object = Record<string, any>, Param
|
|
|
144
149
|
debounceTime: number;
|
|
145
150
|
request: RequsetFunction<DataRecord, ParamsType>;
|
|
146
151
|
params: ParamsType;
|
|
147
|
-
postData: (data:
|
|
152
|
+
postData: (data: DataRecord[]) => DataRecord[];
|
|
148
153
|
pagination: ProTablePagination;
|
|
149
154
|
search: SearchConfig | boolean;
|
|
150
155
|
searchMap: ProSearchMap<undefined, keyof ParamsType | keyof DataRecord>[];
|
|
151
|
-
onReset: (params?: Partial<ParamsType>) =>
|
|
152
|
-
onReload: (params?: Partial<ParamsType>) =>
|
|
153
|
-
onSubmit: (params?: Partial<ParamsType>) =>
|
|
156
|
+
onReset: (params?: Partial<ParamsType>) => void;
|
|
157
|
+
onReload: (params?: Partial<ParamsType>) => void;
|
|
158
|
+
onSubmit: (params?: Partial<ParamsType>) => void;
|
|
154
159
|
onSizeChange: (size: string) => any;
|
|
155
160
|
onLoadingChange: (loading: boolean) => any;
|
|
156
161
|
onRequestError: (e: Error) => void;
|
|
157
|
-
onBeforeSearchSubmit: RequsetFunction<
|
|
162
|
+
onBeforeSearchSubmit: RequsetFunction<DataRecord, ParamsType>;
|
|
158
163
|
onColumnsStateChange: (data: ColumnsState[]) => void;
|
|
159
164
|
titleTip: DefaultRender;
|
|
160
165
|
emptyText: DefaultRender;
|
package/dist/typing.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type DefaultRecordType = Record<string,
|
|
1
|
+
export declare type DefaultRecordType = Record<string, any>;
|