@gx-design-vue/pro-table 0.2.0-beta.13 → 0.2.0-beta.131

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 (50) hide show
  1. package/dist/ProTable.d.ts +253 -792
  2. package/dist/_utils/ant-design-vue/index.d.ts +4 -2
  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/_utils/index.d.ts +1 -1
  8. package/dist/components/Form/components/RequestSelect.d.ts +39 -0
  9. package/dist/components/Form/{useForm.d.ts → hooks/useForm.d.ts} +1 -1
  10. package/dist/components/Form/index.d.ts +15 -27
  11. package/dist/components/Form/style.d.ts +2 -5
  12. package/dist/components/Form/utils/config.d.ts +5 -0
  13. package/dist/components/Form/utils/dateFormat.d.ts +20 -0
  14. package/dist/components/ListToolBar/index.d.ts +20 -33
  15. package/dist/components/ListToolBar/style.d.ts +2 -5
  16. package/dist/components/ToolBar/FullscreenIcon.d.ts +1 -1
  17. package/dist/components/ToolBar/index.d.ts +22 -23
  18. package/dist/context/TableContext.d.ts +15 -16
  19. package/dist/hooks/tryOnActivated.d.ts +2 -0
  20. package/dist/hooks/useColumnSetting.d.ts +6 -7
  21. package/dist/hooks/useColumns.d.ts +101 -0
  22. package/dist/hooks/useDebounceFn.d.ts +2 -2
  23. package/dist/hooks/useFetchData.d.ts +21 -16
  24. package/dist/hooks/useLoading.d.ts +5 -8
  25. package/dist/hooks/usePagination.d.ts +7 -6
  26. package/dist/hooks/useRowSelection.d.ts +11 -8
  27. package/dist/hooks/useTable.d.ts +40 -11
  28. package/dist/hooks/useTableForm.d.ts +9 -9
  29. package/dist/hooks/useTableScroll.d.ts +17 -18
  30. package/dist/hooks/useTableSize.d.ts +4 -7
  31. package/dist/index.d.ts +8 -7
  32. package/dist/pro-table.js +2307 -0
  33. package/dist/pro-table.umd.cjs +12 -0
  34. package/dist/props.d.ts +94 -377
  35. package/dist/style.d.ts +2 -6
  36. package/dist/types/ColumnTypings.d.ts +54 -16
  37. package/dist/types/SlotsTypings.d.ts +47 -9
  38. package/dist/types/TableTypings.d.ts +124 -76
  39. package/dist/utils/utils.d.ts +4 -1
  40. package/package.json +31 -51
  41. package/volar.d.ts +3 -3
  42. package/dist/components/ColumnSetting/hooks/useRefFunction/index.d.ts +0 -1
  43. package/dist/components/ColumnSetting/index.d.ts +0 -35
  44. package/dist/components/ColumnSetting/style.d.ts +0 -6
  45. package/dist/components/ToolBar/DensityIcon.d.ts +0 -3
  46. package/dist/hooks/useColums.d.ts +0 -24
  47. package/dist/pro-table.mjs +0 -35100
  48. package/dist/pro-table.umd.js +0 -364
  49. package/dist/typing.d.ts +0 -1
  50. package/dist/utils/config.d.ts +0 -1
@@ -1,9 +1,6 @@
1
1
  import type { Ref } from 'vue';
2
- import type { SpinProps } from '../_utils';
3
- export declare function useLoading({ emit, loading }: {
4
- loading: Ref<boolean | SpinProps | undefined>;
5
- emit: any;
6
- }): {
7
- getLoading: import("vue").ComputedRef<boolean>;
8
- setLoading: (loading: boolean) => void;
9
- };
2
+ import type { BaseTableProps } from '../props';
3
+ export declare function useLoading(options: {
4
+ loading: Ref<BaseTableProps['loading']>;
5
+ onChange: (value: BaseTableProps['loading']) => void;
6
+ }): [Ref<boolean>, (value: boolean) => void];
@@ -1,10 +1,11 @@
1
- import type { Ref, Slots, ComputedRef } from 'vue';
2
- import type { ProTableProps, ProTablePagination } from '../types/TableTypings';
3
- export declare function usePagination({ slots, props, pagination }: {
4
- slots: Slots;
5
- props: ComputedRef<ProTableProps>;
1
+ import type { Ref } from 'vue';
2
+ import type { PageItemRender } from '../types/SlotsTypings';
3
+ import type { PageState, ProTablePagination, ProTableProps } from '../types/TableTypings';
4
+ export declare function usePagination({ pagination, pageItemRender }: {
6
5
  pagination: Ref<ProTableProps['pagination']>;
6
+ pageItemRender: PageItemRender;
7
7
  }): {
8
- getPaginationInfo: ComputedRef<ProTablePagination>;
8
+ paginationInfo: Ref<ProTablePagination | false>;
9
+ requestPagination: PageState;
9
10
  setPagination: (info: Partial<ProTablePagination>) => void;
10
11
  };
@@ -1,11 +1,14 @@
1
- import type { Ref } from 'vue';
2
1
  import type { RecordType } from '@gx-design-vue/pro-utils';
3
- import type { ProTableProps, ProTableRowSelection } from '../types/TableTypings';
4
- export declare function useRowSelection(rowKey: Ref<ProTableProps['rowKey']>, rowSelection: Ref<ProTableRowSelection | undefined>): {
5
- selectedKey: Ref<(string | number)[]>;
6
- selectRowKey: (record: RecordType, selected: any[]) => void;
7
- selectAllRowKey: (selected: any[], selectedRows: any[], changeRows: any[]) => void;
8
- removeRowKeys: (keyList: (string | number)[]) => void;
2
+ import type { Ref } from 'vue';
3
+ import type { Key, SelectionSelectFn } from '../_utils';
4
+ import type { ProTableRowSelection } from '../types/TableTypings';
5
+ export declare function useRowSelection(rowKey: Ref<string>, rowSelection: Ref<ProTableRowSelection | undefined>): {
6
+ selectedKeys: Ref<Key[], Key[]>;
7
+ selectedItems: Ref<RecordType[], RecordType[]>;
8
+ selectRowKey: SelectionSelectFn<RecordType>;
9
+ selectAllRowKey: (selected: boolean, selectedRows: RecordType[], changeRows: RecordType[]) => void;
10
+ removeRowKeys: (keys: (string | number)[]) => void;
9
11
  changeRowKey: () => void;
10
- syncSelectedRows: (dataList: any[]) => void;
12
+ syncSelectedRows: (dataList: RecordType[]) => void;
13
+ clearAllRowKeys: () => void;
11
14
  };
@@ -1,12 +1,41 @@
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 { RecordType } from '@gx-design-vue/pro-utils';
2
+ import type { ComputedRef, MaybeRef, Reactive, Ref } from 'vue';
3
+ import type { BaseTableProps } from '../props';
4
+ import type { ProColumnsType, ProSearchMap } from '../types/ColumnTypings';
5
+ import type { ProCoreActionType, ProCoreFormType, ProTableProps, ProTableRef, ProTableRowSelection, RequestConfig, RequestFunction } from '../types/TableTypings';
6
+ export type ProTableState<T extends object = RecordType, R extends object = RecordType> = 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;
12
17
  };
18
+ export type BaseTableState<T extends object = RecordType, R extends object = RecordType> = Omit<ProTableProps<T, R>, 'request'>;
19
+ export interface UseTableReturn<T extends object = RecordType, R extends object = RecordType> {
20
+ loading: Ref<boolean>;
21
+ dataSource: ComputedRef<T[]>;
22
+ selectedKeys: ProCoreActionType<T, R>['selectedKeys'];
23
+ selectedItems: ProCoreActionType<T, R>['selectedItems'];
24
+ rowsSelection: ProCoreActionType<T, R>['rowsSelection'];
25
+ requestSearch: ComputedRef<RequestConfig<R>['params']>;
26
+ reload: ProCoreActionType<T, R>['reload'];
27
+ mutate: ProCoreActionType<T, R>['reSetDataList'];
28
+ setPageAndReload: ProCoreActionType<T, R>['setPageAndReload'];
29
+ setDataValue: ProCoreActionType<T, R>['setDataValue'];
30
+ setPagination: ProCoreActionType<T, R>['setPagination'];
31
+ reloadAndReset: ProCoreActionType<T, R>['reloadAndReset'];
32
+ setLoading: ProCoreActionType<T, R>['setLoading'];
33
+ actionRef: ComputedRef<Partial<ProCoreActionType<T, R>>>;
34
+ formRef: ComputedRef<ProCoreFormType<R>>;
35
+ tableState: Reactive<ProTableState<T, R>>;
36
+ updateSearchMap: (key: keyof R | keyof T, value: Partial<any>) => void;
37
+ }
38
+ export declare function useTable<T extends object = RecordType, R extends object = RecordType>(tableRef: Ref<ProTableRef<T> | undefined>, options?: {
39
+ state?: MaybeRef<BaseTableState<T, R>> | Reactive<BaseTableState<T, R>> | ComputedRef<BaseTableState<T, R>>;
40
+ request?: RequestFunction<T, R>;
41
+ }): UseTableReturn<T, R>;
@@ -1,16 +1,16 @@
1
- import type { ComputedRef, Ref } from 'vue';
2
1
  import type { RecordType } from '@gx-design-vue/pro-utils';
3
- import type { ProTableProps } from '../types/TableTypings';
2
+ import type { ComputedRef, Ref } from 'vue';
4
3
  import type { ProSearchMap } from '../types/ColumnTypings';
5
- export declare function handleFormDefaultValue(data: ProSearchMap[]): any;
6
- export declare function useTableForm({ search, searchMap, params, columns }: {
7
- search: Ref<ProTableProps['search']>;
4
+ import type { ProTablePagination, ProTableProps } from '../types/TableTypings';
5
+ export declare function handleFormDefaultValue(data: ProSearchMap[]): RecordType;
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<"text", string>[], ProSearchMap<"text", string>[]>;
13
+ formState: RecordType;
14
+ defaultState: RecordType;
15
+ setFormState: (params: RecordType) => void;
16
16
  };
@@ -1,28 +1,27 @@
1
+ import type { Breakpoint } from '@gx-design-vue/pro-utils';
1
2
  import type { ComputedRef, Ref } from 'vue';
2
- import { type Breakpoint } from '@gx-design-vue/pro-utils';
3
- import type { ProTableProps } from '../types/TableTypings';
4
3
  import type { ProColumnsType } from '../types/ColumnTypings';
5
- type ConfigScroll = {
6
- scroll: ComputedRef<ProTableProps['scroll']>;
7
- autoScroll: ComputedRef<ProTableProps['autoScroll']>;
8
- modalScroll: ComputedRef<ProTableProps['modalScroll']>;
9
- neverScroll: ComputedRef<ProTableProps['neverScroll']>;
10
- rowSelection: ComputedRef<ProTableProps['rowSelection']>;
11
- scrollBreakpoint: ComputedRef<ProTableProps['scrollBreakpoint']>;
12
- };
4
+ import type { ProTableProps } from '../types/TableTypings';
5
+ interface ConfigScroll {
6
+ scroll: Ref<ProTableProps['scroll']>;
7
+ autoScroll: Ref<ProTableProps['autoScroll']>;
8
+ modalScroll: Ref<ProTableProps['modalScroll']>;
9
+ neverScroll: Ref<ProTableProps['neverScroll']>;
10
+ rowSelection: Ref<ProTableProps['rowSelection']>;
11
+ scrollBreakpoint: Ref<ProTableProps['scrollBreakpoint']>;
12
+ }
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
- 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;
18
+ export declare function useTableScroll({ scroll, columns, autoScroll, modalScroll, neverScroll, rowSelection, screens, innerWidth, scrollBreakpoint }: useTableScrollType): {
19
+ proScroll: ComputedRef<({
20
+ x?: number | true | string;
21
+ y?: number | string;
23
22
  } & {
24
- scrollToFirstRowOnChange?: boolean | undefined;
23
+ scrollToFirstRowOnChange?: boolean;
25
24
  }) | undefined>;
26
- breakpoint: ComputedRef<boolean>;
25
+ breakpoint: ComputedRef<boolean | undefined>;
27
26
  };
28
27
  export {};
@@ -1,9 +1,6 @@
1
- import type { Ref } from 'vue';
2
1
  import type { SizeType } from '@gx-design-vue/pro-utils';
3
- export declare function useTableSize({ size, emit }: {
2
+ import type { Ref } from 'vue';
3
+ export declare function useTableSize(options: {
4
4
  size: Ref<SizeType>;
5
- emit: any;
6
- }): {
7
- sizeRef: Ref<SizeType>;
8
- setTableSize: (size: SizeType) => void;
9
- };
5
+ onChange: (value: SizeType) => void;
6
+ }): [Ref<SizeType>, (value: SizeType) => void];
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { useTable } from './hooks/useTable';
1
+ import ProTable from './ProTable';
2
+ export * from './hooks/useTable';
2
3
  export { proTableProps } from './props';
3
- 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 { default as GProTable } from './ProTable';
4
+ export { ProTable as GProTable };
5
+ export type { BaseTableProps } from './props';
6
+ export type { ProColumnsType, ProColumnType, ProFieldValueType, ProSearchMap } from './types/ColumnTypings';
7
+ export type { CustomRenderResult, ProTableBodyCellProps } from './types/SlotsTypings';
8
+ export type { PageState, ProTableProps, RequestConfig } from './types/TableTypings';
9
+ export type { OptionConfig, ProCoreActionType, ProCoreFormType, ProTableFetchParams, ProTableRef, RequestFunction, SearchConfig } from './types/TableTypings';