@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.
@@ -1,183 +1,32 @@
1
1
  import type { PropType } from 'vue';
2
- import type { SizeType } from '@gx-design-vue/pro-utils';
3
- import type { ColumnType, ColumnsType, FilterValue, GetPopupContainer, RcTableProps, SortOrder, SorterResult, TableCurrentDataSource, TableLocale, TableProps, TableRowSelection } from './typings';
2
+ import type { RcTableProps, TableProps } from './typings';
4
3
  import type { SpinProps } from '../spin/typings';
5
- import type { TooltipProps } from '../tooltip/typings';
6
- import type { ProTablePagination } from '../../../types/TableTypings';
7
- export declare const tableProps: () => {
8
- prefixCls: {
9
- type: PropType<string>;
10
- default: undefined;
11
- };
12
- columns: {
13
- type: PropType<ColumnsType>;
14
- default: () => never[];
15
- };
16
- tableLayout: {
17
- type: PropType<TableProps["tableLayout"]>;
18
- default: undefined;
19
- };
20
- rowClassName: {
21
- type: PropType<TableProps["rowClassName"]>;
22
- default: undefined;
23
- };
24
- title: {
25
- type: PropType<TableProps["title"]>;
26
- default: undefined;
27
- };
28
- footer: {
29
- type: PropType<TableProps["footer"]>;
30
- default: undefined;
31
- };
32
- id: {
33
- type: PropType<TableProps["id"]>;
34
- default: undefined;
35
- };
36
- showHeader: {
37
- type: PropType<boolean>;
38
- default: undefined;
39
- };
40
- components: {
41
- type: PropType<TableProps["components"]>;
42
- default: undefined;
43
- };
44
- customRow: {
45
- type: PropType<TableProps["customRow"]>;
46
- default: undefined;
47
- };
48
- customHeaderRow: {
49
- type: PropType<TableProps["customHeaderRow"]>;
50
- default: undefined;
51
- };
52
- direction: {
53
- type: PropType<TableProps["direction"]>;
54
- default: undefined;
55
- };
56
- expandFixed: {
57
- type: PropType<TableProps["expandFixed"]>;
58
- default: undefined;
59
- };
60
- expandColumnWidth: {
61
- type: PropType<number>;
62
- default: undefined;
63
- };
64
- expandedRowKeys: {
65
- type: PropType<TableProps["expandedRowKeys"]>;
66
- default: undefined;
67
- };
68
- defaultExpandedRowKeys: {
69
- type: PropType<TableProps["defaultExpandedRowKeys"]>;
70
- default: undefined;
71
- };
72
- expandedRowRender: {
73
- type: PropType<TableProps["expandedRowRender"]>;
74
- default: undefined;
75
- };
76
- expandRowByClick: {
77
- type: PropType<boolean>;
78
- default: undefined;
79
- };
80
- expandIcon: {
81
- type: PropType<TableProps["expandIcon"]>;
82
- default: undefined;
83
- };
84
- onExpand: {
85
- type: PropType<TableProps["onExpand"]>;
86
- default: undefined;
87
- };
88
- onExpandedRowsChange: {
89
- type: PropType<TableProps["onExpandedRowsChange"]>;
90
- default: undefined;
91
- };
92
- 'onUpdate:expandedRowKeys': {
93
- type: PropType<TableProps["onExpandedRowsChange"]>;
94
- default: undefined;
95
- };
96
- defaultExpandAllRows: {
97
- type: PropType<boolean>;
98
- default: undefined;
99
- };
100
- indentSize: {
101
- type: PropType<number>;
102
- default: undefined;
103
- };
104
- /** @deprecated Please use `EXPAND_COLUMN` in `columns` directly */
105
- expandIconColumnIndex: {
106
- type: PropType<number>;
107
- default: undefined;
108
- };
109
- showExpandColumn: {
110
- type: PropType<boolean>;
111
- default: undefined;
112
- };
113
- expandedRowClassName: {
114
- type: PropType<TableProps["expandedRowClassName"]>;
115
- default: undefined;
116
- };
117
- childrenColumnName: {
118
- type: PropType<TableProps["childrenColumnName"]>;
119
- default: undefined;
120
- };
121
- rowExpandable: {
122
- type: PropType<TableProps["rowExpandable"]>;
123
- default: undefined;
124
- };
125
- sticky: {
126
- type: PropType<TableProps["sticky"]>;
127
- default: undefined;
128
- };
129
- dropdownPrefixCls: {
130
- type: PropType<string>;
131
- default: undefined;
132
- };
133
- dataSource: {
134
- type: PropType<RcTableProps["data"]>;
135
- default: undefined;
4
+ declare const omitProps: (keyof TableProps)[];
5
+ export type AntTableProps = Omit<TableProps, typeof omitProps[number]>;
6
+ export declare const tableProps: {
7
+ /**
8
+ * @Author gx12358
9
+ * @DateTime 2022/2/8
10
+ * @lastTime 2022/2/8
11
+ * @description 是否展示外边框和列边框
12
+ */
13
+ bordered: {
14
+ type: PropType<TableProps["bordered"]>;
15
+ default: boolean;
136
16
  };
137
17
  loading: {
138
18
  type: PropType<boolean | SpinProps>;
139
19
  default: undefined;
140
20
  };
141
- size: {
142
- type: PropType<SizeType>;
143
- default: undefined;
144
- };
145
- locale: {
146
- type: PropType<TableLocale>;
147
- default: undefined;
148
- };
149
- onChange: {
150
- type: PropType<(pagination: ProTablePagination, filters: Record<string, FilterValue | null>, sorter: SorterResult | SorterResult[], extra: TableCurrentDataSource) => void>;
151
- default: undefined;
152
- };
153
- onResizeColumn: {
154
- type: PropType<(w: number, col: ColumnType) => void>;
155
- default: undefined;
156
- };
157
- rowSelection: {
158
- type: PropType<TableRowSelection>;
159
- default: undefined;
160
- };
161
- getPopupContainer: {
162
- type: PropType<GetPopupContainer>;
163
- default: undefined;
164
- };
165
21
  scroll: {
166
22
  type: PropType<RcTableProps["scroll"] & {
167
23
  scrollToFirstRowOnChange?: boolean;
168
24
  }>;
169
25
  default: undefined;
170
26
  };
171
- sortDirections: {
172
- type: PropType<SortOrder[]>;
173
- default: undefined;
174
- };
175
- showSorterTooltip: {
176
- type: PropType<boolean | TooltipProps>;
177
- default: boolean;
178
- };
179
- transformCellText: {
180
- type: PropType<TableProps["transformCellText"]>;
181
- default: undefined;
27
+ 'onUpdate:expandedRowKeys': {
28
+ type: import("vue").PropType<(expandedKeys: import("ant-design-vue/es/vc-table/interface").Key[]) => void>;
29
+ default: (expandedKeys: import("ant-design-vue/es/vc-table/interface").Key[]) => void;
182
30
  };
183
31
  };
32
+ export {};
@@ -15,8 +15,8 @@ type UseColumnsType = {
15
15
  export declare function useConfigColumns(props: ProTableProps): ConfigColumns;
16
16
  export declare function useColumns({ scroll, columns, breakpoint, draggabled, autoScroll, neverScroll }: UseColumnsType): {
17
17
  breakpoint: ComputedRef<boolean | undefined>;
18
- getProColumns: ComputedRef<(import("@gx-design-vue/pro-utils/dist").DefaultProColumn & Omit<import("ant-design-vue/es/table/interface").ColumnType<import("../typing").DefaultRecordType>, "key" | "dataIndex" | "width"> & {
19
- children?: ProColumnsType<import("../typing").DefaultRecordType, import("@gx-design-vue/pro-utils/dist").RecordType> | undefined;
18
+ proColumns: ComputedRef<(import("@gx-design-vue/pro-utils/dist").DefaultProColumn & Omit<import("ant-design-vue/es/table/interface").ColumnType<import("../typing").DefaultRecordType>, "key" | "dataIndex" | "width"> & {
19
+ children?: ProColumnsType<import("../typing").DefaultRecordType, import("../typing").DefaultRecordType> | undefined;
20
20
  uuid?: string | number;
21
21
  index?: number;
22
22
  show?: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { ComputedRef, Ref } from 'vue';
2
- import type { RecordType } from '@gx-design-vue/pro-utils';
3
2
  import type { FilterValue, SorterResult, TableCurrentDataSource } from '../_utils/ant-design-vue/table/typings';
4
3
  import type { ProTabelFeachParams, ProTablePagination, ProTablePaginationConfig, ProTableProps } from '../types/TableTypings';
4
+ import type { DefaultRecordType } from '../typing';
5
5
  import type { ProColumnsType } from '../types/ColumnTypings';
6
6
  interface ActionType {
7
7
  loading: ComputedRef<boolean | undefined>;
@@ -12,7 +12,7 @@ interface ActionType {
12
12
  removeRowKeys: (keyList: (string | number)[]) => void;
13
13
  syncSelectedRows: (dataList: any[]) => void;
14
14
  columns: ComputedRef<ProColumnsType>;
15
- formParamsRef: RecordType;
15
+ formParamsRef: DefaultRecordType;
16
16
  onBeforeSearchSubmit: ProTableProps['onBeforeSearchSubmit'];
17
17
  hasCustomRender: ComputedRef<boolean>;
18
18
  }
@@ -26,10 +26,10 @@ export type ConfigFetchData = {
26
26
  };
27
27
  export declare function useConfigFetchData(props: ProTableProps): Omit<ConfigFetchData, 'waitRequest'>;
28
28
  export declare function useFetchData({ polling, request, postData, dataSource, waitRequest, debounceTime }: ConfigFetchData, { columns, loading, setLoading, setColumns, removeRowKeys, syncSelectedRows, formParamsRef, setPagination, paginationInfo, onBeforeSearchSubmit, hasCustomRender }: ActionType, emit: any): {
29
- dataSource: ComputedRef<RecordType[]>;
29
+ dataSource: ComputedRef<DefaultRecordType[]>;
30
30
  isTreeDataRef: ComputedRef<boolean>;
31
- reSetDataList: (list: RecordType[]) => void;
32
- changeDataValue: <T = RecordType>({ key, record, type }: {
31
+ reSetDataList: (list: DefaultRecordType[]) => void;
32
+ changeDataValue: <T = DefaultRecordType>({ key, record, type }: {
33
33
  record: T;
34
34
  type: "update" | "push" | "delete" | "unshift";
35
35
  key?: keyof T;
@@ -7,7 +7,7 @@ export declare function useRowSelection(rowKey: Ref<string>, rowSelection: Ref<P
7
7
  selectedItem: Ref<RecordType[], RecordType[]>;
8
8
  selectRowKey: SelectionSelectFn<RecordType>;
9
9
  selectAllRowKey: (selected: boolean, selectedRows: RecordType[], changeRows: RecordType[]) => void;
10
- removeRowKeys: (keyList: (string | number)[]) => void;
10
+ removeRowKeys: (keys: (string | number)[]) => void;
11
11
  changeRowKey: () => void;
12
12
  syncSelectedRows: (dataList: RecordType[]) => void;
13
13
  clearAllRowKeys: () => void;
@@ -1,26 +1,30 @@
1
- import { ComputedRef, Ref } from 'vue';
1
+ import type { ComputedRef, Ref } from 'vue';
2
2
  import type { BaseTableProps } from '../props';
3
+ import type { DefaultRecordType } from '../typing';
3
4
  import type { ProColumnsType, ProSearchMap } from '../types/ColumnTypings';
4
- import { ProCoreActionType, ProCoreFormType, ProTableProps, ProTableRef, ProTableRowSelection, RequsetConfig, RequsetFunction } from '../types/TableTypings';
5
- export type ProTableState<T extends object = Record<string, any>, R extends object = Record<string, any>> = Omit<BaseTableProps, 'params' | 'dataSource' | 'searchMap' | 'rowSelection' | 'columns'> & {
5
+ import type { ProCoreActionType, ProCoreFormType, ProTableProps, ProTableRef, ProTableRowSelection, RequsetConfig, RequsetFunction } from '../types/TableTypings';
6
+ export type ProTableState<T extends object = DefaultRecordType, R extends object = DefaultRecordType> = BaseTableProps & {
6
7
  params: R;
7
- dataSource: T[];
8
8
  columns: ProColumnsType<T, R>;
9
+ dataSource: T[];
9
10
  rowSelection: ProTableRowSelection<T>;
10
11
  searchMap: ProSearchMap<undefined, keyof R | keyof T>[];
12
+ rowKey?: keyof T;
13
+ postData?: (data: T[]) => any;
14
+ onReset?: (params?: Partial<R>) => void;
15
+ onReload?: (params?: Partial<R>) => void;
16
+ onSubmit?: (params?: Partial<R>) => void;
11
17
  };
12
- export type BaseTableState<T extends object = Record<string, any>, R extends object = Record<string, any>> = Omit<ProTableProps<T, R>, 'request'>;
13
- export declare function useTable<T extends object = Record<string, any>, R extends object = Record<string, any>>(tableRef: Ref<ProTableRef<T> | undefined>, options?: {
18
+ export type BaseTableState<T extends object = DefaultRecordType, R extends object = DefaultRecordType> = Omit<ProTableProps<T, R>, 'request'>;
19
+ export declare function useTable<T extends object = DefaultRecordType, R extends object = DefaultRecordType>(tableRef: Ref<ProTableRef<T> | undefined>, options?: {
14
20
  state?: BaseTableState<T, R>;
15
21
  request?: RequsetFunction<T, R>;
16
22
  }): {
17
- dataSource: ComputedRef<T[]>;
18
- rowsSelection: () => {
19
- keys: (string | number)[];
20
- items: T[];
21
- clear: () => void;
22
- };
23
23
  loading: Ref<boolean>;
24
+ dataSource: ComputedRef<T[]>;
25
+ selectedKey: ProCoreActionType<T, R>['selectedKey'];
26
+ selectedItem: ProCoreActionType<T, R>['selectedItem'];
27
+ rowsSelection: ProCoreActionType<T, R>['rowsSelection'];
24
28
  requestParams: ComputedRef<RequsetConfig<R>['params']>;
25
29
  reload: ProCoreActionType<T, R>['reload'];
26
30
  mutate: ProCoreActionType<T, R>['reSetDataList'];
@@ -1,6 +1,6 @@
1
1
  import type { ComputedRef, Ref } from 'vue';
2
- import { type RecordType } from '@gx-design-vue/pro-utils';
3
2
  import type { ProTablePagination, ProTableProps } from '../types/TableTypings';
3
+ import type { DefaultRecordType } from '../typing';
4
4
  import type { ProSearchMap } from '../types/ColumnTypings';
5
5
  export declare function handleFormDefaultValue(data: ProSearchMap[]): any;
6
6
  export declare function useTableForm({ search, searchMap, params, columns, setPagination }: {
@@ -11,7 +11,7 @@ export declare function useTableForm({ search, searchMap, params, columns, setPa
11
11
  setPagination: (info: Partial<ProTablePagination>) => void;
12
12
  }): {
13
13
  formDataRef: Ref<ProSearchMap[], ProSearchMap[]>;
14
- formParamsRef: RecordType;
15
- defaultParamsRef: RecordType;
16
- setFormParams: (params: RecordType) => void;
14
+ formParamsRef: DefaultRecordType;
15
+ defaultParamsRef: DefaultRecordType;
16
+ setFormParams: (params: DefaultRecordType) => void;
17
17
  };
@@ -17,7 +17,7 @@ type useTableScrollType = {
17
17
  } & ConfigScroll;
18
18
  export declare function useConfigScroll(props: ProTableProps): ConfigScroll;
19
19
  export declare function useTableScroll({ scroll, columns, autoScroll, modalScroll, neverScroll, rowSelection, screens, innerWidth, scrollBreakpoint }: useTableScrollType): {
20
- getScrollRef: ComputedRef<({
20
+ proScroll: ComputedRef<({
21
21
  x?: number | true | string;
22
22
  y?: number | string;
23
23
  } & {