@gx-design-vue/pro-table 0.2.0-beta.9 → 0.2.0-beta.91

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.
Files changed (40) hide show
  1. package/dist/ProTable.d.ts +195 -793
  2. package/dist/_utils/ant-design-vue/index.d.ts +2 -0
  3. package/dist/_utils/ant-design-vue/input/typings.d.ts +1 -0
  4. package/dist/_utils/ant-design-vue/table/props.d.ts +33 -2
  5. package/dist/_utils/ant-design-vue/table/typings.d.ts +6 -5
  6. package/dist/_utils/ant-design-vue/tooltip/typings.d.ts +1 -0
  7. package/dist/components/ColumnSetting/index.d.ts +14 -14
  8. package/dist/components/ColumnSetting/style.d.ts +2 -5
  9. package/dist/components/Form/dateFormat.d.ts +20 -0
  10. package/dist/components/Form/index.d.ts +15 -14
  11. package/dist/components/Form/style.d.ts +2 -5
  12. package/dist/components/ListToolBar/index.d.ts +18 -18
  13. package/dist/components/ListToolBar/style.d.ts +2 -5
  14. package/dist/components/ToolBar/FullscreenIcon.d.ts +1 -2
  15. package/dist/components/ToolBar/index.d.ts +18 -18
  16. package/dist/context/TableContext.d.ts +10 -11
  17. package/dist/hooks/useColums.d.ts +88 -7
  18. package/dist/hooks/useFetchData.d.ts +18 -15
  19. package/dist/hooks/useLoading.d.ts +5 -4
  20. package/dist/hooks/usePagination.d.ts +8 -3
  21. package/dist/hooks/useRowSelection.d.ts +10 -7
  22. package/dist/hooks/useTable.d.ts +38 -11
  23. package/dist/hooks/useTableForm.d.ts +8 -8
  24. package/dist/hooks/useTableScroll.d.ts +7 -7
  25. package/dist/hooks/useTableSize.d.ts +1 -1
  26. package/dist/index.d.ts +6 -5
  27. package/dist/pro-table.js +2706 -0
  28. package/dist/pro-table.umd.cjs +1 -0
  29. package/dist/props.d.ts +72 -358
  30. package/dist/style.d.ts +2 -6
  31. package/dist/types/ColumnTypings.d.ts +22 -12
  32. package/dist/types/SlotsTypings.d.ts +42 -8
  33. package/dist/types/TableTypings.d.ts +97 -59
  34. package/dist/typing.d.ts +1 -1
  35. package/dist/utils/utils.d.ts +4 -1
  36. package/package.json +20 -43
  37. package/volar.d.ts +3 -3
  38. package/dist/pro-table.mjs +0 -35090
  39. package/dist/pro-table.umd.js +0 -364
  40. package/dist/utils/config.d.ts +0 -1
@@ -1,12 +1,39 @@
1
- import type { Ref, ComputedRef } from 'vue';
2
- import type { ProCoreActionType, ProCoreFormType, ProTableRef } from '../types/TableTypings';
3
- export declare function useTable(tableRef: Ref<ProTableRef>): {
4
- params: ComputedRef<Record<string, any>>;
5
- loading: ComputedRef<ProCoreActionType['getLoadingStatus']>;
6
- reload: ProCoreActionType['reload'];
7
- mutate: ProCoreActionType['reSetDataList'];
8
- setPage: ProCoreActionType['changePageInfo'];
9
- changeLoading: ProCoreActionType['loadingOperation'];
10
- actionRef: ComputedRef<ProCoreActionType>;
11
- formRef: ComputedRef<ProCoreFormType>;
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { BaseTableProps } from '../props';
3
+ import type { DefaultRecordType } from '../typing';
4
+ import type { ProColumnsType, ProSearchMap } from '../types/ColumnTypings';
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 & {
7
+ params: R;
8
+ columns: ProColumnsType<T, R>;
9
+ dataSource: T[];
10
+ rowSelection: ProTableRowSelection<T>;
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;
17
+ };
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?: {
20
+ state?: BaseTableState<T, R>;
21
+ request?: RequsetFunction<T, R>;
22
+ }): {
23
+ loading: Ref<boolean>;
24
+ dataSource: ComputedRef<T[]>;
25
+ selectedKeys: ProCoreActionType<T, R>['selectedKeys'];
26
+ selectedItems: ProCoreActionType<T, R>['selectedItems'];
27
+ rowsSelection: ProCoreActionType<T, R>['rowsSelection'];
28
+ requestParams: ComputedRef<RequsetConfig<R>['params']>;
29
+ reload: ProCoreActionType<T, R>['reload'];
30
+ mutate: ProCoreActionType<T, R>['reSetDataList'];
31
+ setPageAndReload: ProCoreActionType<T, R>['setPageAndReload'];
32
+ setData: ProCoreActionType<T, R>['setData'];
33
+ setPagination: ProCoreActionType<T, R>['setPagination'];
34
+ reloadAndReset: ProCoreActionType<T, R>['reloadAndReset'];
35
+ setLoading: ProCoreActionType<T, R>['setLoading'];
36
+ actionRef: ComputedRef<Partial<ProCoreActionType<T, R>>>;
37
+ formRef: ComputedRef<ProCoreFormType<R>>;
38
+ tableState: ProTableState<T, R>;
12
39
  };
@@ -1,16 +1,16 @@
1
1
  import type { ComputedRef, Ref } from 'vue';
2
- import type { RecordType } from '@gx-design-vue/pro-utils';
3
- import type { ProTableProps } from '../types/TableTypings';
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
- export declare function useTableForm({ search, searchMap, params, columns }: {
7
- search: Ref<ProTableProps['search']>;
6
+ export declare function useTableForm({ searchMap, params, columns, setPagination }: {
8
7
  searchMap: Ref<ProTableProps['searchMap']>;
9
8
  params: Ref<ProTableProps['params']>;
10
9
  columns: ComputedRef<ProTableProps['columns']>;
10
+ setPagination: (info: Partial<ProTablePagination>) => void;
11
11
  }): {
12
- formDataRef: Ref<ProSearchMap<"text">[]>;
13
- formParamsRef: RecordType;
14
- defaultParamsRef: RecordType;
15
- setFormParams: (params: any) => void;
12
+ formDataRef: Ref<ProSearchMap[], ProSearchMap[]>;
13
+ formParamsRef: DefaultRecordType;
14
+ defaultParamsRef: DefaultRecordType;
15
+ setFormParams: (params: DefaultRecordType) => void;
16
16
  };
@@ -13,16 +13,16 @@ type ConfigScroll = {
13
13
  type useTableScrollType = {
14
14
  columns: ComputedRef<ProColumnsType>;
15
15
  innerWidth: Ref<number>;
16
- screensRef: Ref<Partial<Record<Breakpoint, boolean>>>;
16
+ screens: Ref<Partial<Record<Breakpoint, boolean>>>;
17
17
  } & ConfigScroll;
18
18
  export declare function useConfigScroll(props: ProTableProps): ConfigScroll;
19
- export declare function useTableScroll({ scroll, columns, autoScroll, modalScroll, neverScroll, rowSelection, screensRef, innerWidth, scrollBreakpoint, }: useTableScrollType): {
20
- getScrollRef: ComputedRef<({
21
- x?: string | number | true | undefined;
22
- y?: string | number | undefined;
19
+ export declare function useTableScroll({ scroll, columns, autoScroll, modalScroll, neverScroll, rowSelection, screens, innerWidth, scrollBreakpoint }: useTableScrollType): {
20
+ proScroll: ComputedRef<({
21
+ x?: number | true | string;
22
+ y?: number | string;
23
23
  } & {
24
- scrollToFirstRowOnChange?: boolean | undefined;
24
+ scrollToFirstRowOnChange?: boolean;
25
25
  }) | undefined>;
26
- breakpoint: ComputedRef<boolean>;
26
+ breakpoint: ComputedRef<boolean | undefined>;
27
27
  };
28
28
  export {};
@@ -4,6 +4,6 @@ export declare function useTableSize({ size, emit }: {
4
4
  size: Ref<SizeType>;
5
5
  emit: any;
6
6
  }): {
7
- sizeRef: Ref<SizeType>;
7
+ sizeRef: Ref<SizeType, SizeType>;
8
8
  setTableSize: (size: SizeType) => void;
9
9
  };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { useTable } from './hooks/useTable';
1
+ export type { BaseTableProps } from './props';
2
+ export type { ProTableProps, PageState } from './types/TableTypings';
3
+ export type { CustomRenderResult, ProTableBodyCellProps } from './types/SlotsTypings';
4
+ export type { ProColumnType, ProColumnsType, ProSearchMap } from './types/ColumnTypings';
5
+ export * from './hooks/useTable';
2
6
  export { proTableProps } from './props';
3
7
  export { default } from './ProTable';
4
- export type { ProTableProps } from './types/TableTypings';
5
- export type { RequsetFunction, ProTableRef, ProCoreActionType, ProTabelFeachParams, ProCoreFormType } from './types/TableTypings';
6
- export type { ProColumnType, ProColumnsType, ProSearchMap } from './types/ColumnTypings';
7
- export { useTable };
8
+ export type { RequsetFunction, ProTableRef, ProCoreActionType, ProTabelFeachParams, ProCoreFormType, OptionConfig, SearchConfig } from './types/TableTypings';
8
9
  export { default as GProTable } from './ProTable';