@gx-design-vue/pro-table 0.2.0-beta.71 → 0.2.0-beta.72

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,9 +1,17 @@
1
1
  import type { ComputedRef, Ref } from 'vue';
2
2
  import type { BaseTableProps } from '../props';
3
- import type { ProSearchMap } from '../types/ColumnTypings';
3
+ import type { ProColumnsType, ProSearchMap } from '../types/ColumnTypings';
4
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'> & {
6
+ params: R;
7
+ dataSource: T[];
8
+ columns: ProColumnsType<T, R>;
9
+ rowSelection: ProTableRowSelection<T>;
10
+ searchMap: ProSearchMap<undefined, keyof R | keyof T>[];
11
+ };
12
+ export type BaseTableState<T extends object = Record<string, any>, R extends object = Record<string, any>> = Omit<ProTableProps<T, R>, 'request'>;
5
13
  export declare function useTable<T extends object = Record<string, any>, R extends object = Record<string, any>>(tableRef: Ref<ProTableRef<T> | undefined>, options?: {
6
- state?: Omit<ProTableProps<T, R>, 'request'>;
14
+ state?: BaseTableState<T, R>;
7
15
  request?: RequsetFunction<T, R>;
8
16
  }): {
9
17
  dataSource: ComputedRef<T[]>;
@@ -23,10 +31,5 @@ export declare function useTable<T extends object = Record<string, any>, R exten
23
31
  setLoading: ProCoreActionType<T, R>['setLoading'];
24
32
  actionRef: ComputedRef<Partial<ProCoreActionType<T, R>>>;
25
33
  formRef: ComputedRef<ProCoreFormType<R>>;
26
- tableState: Omit<BaseTableProps, 'params' | 'dataSource' | 'searchMap' | 'rowSelection'> & {
27
- params: R;
28
- dataSource: T[];
29
- rowSelection: ProTableRowSelection<T>;
30
- searchMap: ProSearchMap<undefined, keyof R>[];
31
- };
34
+ tableState: ProTableState<T, R>;
32
35
  };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { useTable } from './hooks/useTable';
2
1
  export type { BaseTableProps } from './props';
3
2
  export type { ProTableProps, PageState } from './types/TableTypings';
4
3
  export type { ProTableBodyCellProps } from './types/SlotsTypings';
5
4
  export type { ProColumnType, ProColumnsType, ProSearchMap } from './types/ColumnTypings';
5
+ export * from './hooks/useTable';
6
6
  export { proTableProps } from './props';
7
7
  export { default } from './ProTable';
8
8
  export type { RequsetFunction, ProTableRef, ProCoreActionType, ProTabelFeachParams, ProCoreFormType, OptionConfig, SearchConfig } from './types/TableTypings';
9
- export { useTable, };
10
9
  export { default as GProTable } from './ProTable';