@gx-design-vue/pro-table 0.2.0-beta.134 → 0.2.0-beta.136

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.
@@ -374,7 +374,6 @@ declare const ProTable: import("vue").DefineComponent<import("vue").ExtractPropT
374
374
  titleTip: import("./types/SlotsTypings").DefaultRender;
375
375
  settingExtra: import("./types/SlotsTypings").DefaultRender;
376
376
  pageItemRender: import("./types/SlotsTypings").PageItemRender | undefined;
377
- autoScroll: boolean | undefined;
378
377
  tableProps: {
379
378
  class?: string;
380
379
  style?: CSSProperties;
@@ -384,6 +383,7 @@ declare const ProTable: import("vue").DefineComponent<import("vue").ExtractPropT
384
383
  actions?: import("./types/SlotsTypings").DefaultRender[];
385
384
  } | undefined;
386
385
  titleTipText: string | undefined;
386
+ autoScroll: boolean | undefined;
387
387
  keepAliveReload: boolean | undefined;
388
388
  emptyTextProps: {
389
389
  class?: string;
@@ -16,7 +16,10 @@ declare const tableForm: {
16
16
  default: boolean;
17
17
  };
18
18
  prefixCls: PropType<string>;
19
- defaultState: PropType<RecordType>;
19
+ defaultFormSearch: {
20
+ type: PropType<RecordType>;
21
+ default: () => {};
22
+ };
20
23
  onSearch: PropType<(formState: any, buttonActions?: "reset" | "submit") => any>;
21
24
  };
22
25
  export type ProTableFormProps = ExtractPropTypes<typeof tableForm>;
@@ -1,7 +1,6 @@
1
1
  import type { SizeType } from '@gx-design-vue/pro-utils';
2
2
  import type { ComputedRef, Ref } from 'vue';
3
3
  import type { PaginationProps } from '../_utils';
4
- import type { ColumnsState } from '../hooks/useColumnSetting';
5
4
  import type { ProColumnsType } from '../types/ColumnTypings';
6
5
  import type { FormConfig } from '../types/TableTypings';
7
6
  export interface ProTableContextProps {
@@ -19,7 +18,6 @@ export interface ProTableContextProps {
19
18
  setTableSize: (size: SizeType) => void;
20
19
  };
21
20
  setPagination: (info: Partial<PaginationProps>) => void;
22
- changeColumns: (map: Record<string, ColumnsState>, fixed: boolean) => void;
23
21
  }
24
22
  declare const provideTableContext: (value: ProTableContextProps) => void, useTableContext: (injectDefaultValue?: ProTableContextProps | undefined) => ProTableContextProps;
25
23
  export { provideTableContext, useTableContext };
@@ -1,18 +1,14 @@
1
- import type { ComputedRef } from 'vue';
1
+ import type { ComputedRef, Ref } from 'vue';
2
2
  import type { ProColumnsType, ProColumnType } from '../types/ColumnTypings';
3
3
  import type { ProTableProps } from '../types/TableTypings';
4
- import type { ColumnsState } from './useColumnSetting';
5
- export interface ConfigColumns {
6
- draggable: ComputedRef<ProTableProps['draggable']>;
7
- neverScroll: ComputedRef<ProTableProps['neverScroll']>;
8
- autoScroll: ComputedRef<ProTableProps['autoScroll']>;
9
- }
10
- type UseColumnsType = {
4
+ interface UseColumnsType {
11
5
  scroll: ComputedRef<ProTableProps['scroll']>;
12
6
  breakpoint: ComputedRef<boolean | undefined>;
13
7
  columns: ComputedRef<ProColumnsType>;
14
- } & ConfigColumns;
15
- export declare function useConfigColumns(props: ProTableProps): ConfigColumns;
8
+ draggable: Ref<ProTableProps['draggable']>;
9
+ neverScroll: Ref<ProTableProps['neverScroll']>;
10
+ autoScroll: Ref<ProTableProps['autoScroll']>;
11
+ }
16
12
  export declare function useColumns({ scroll, columns, breakpoint, draggable, autoScroll, neverScroll }: UseColumnsType): {
17
13
  breakpoint: ComputedRef<boolean | undefined>;
18
14
  proColumns: ComputedRef<(import("../types/ColumnTypings").DefaultProColumnWithKeyOrDataIndex<import("@gx-design-vue/pro-utils/dist").RecordType> & Omit<import("ant-design-vue/es/table/interface").ColumnType<import("@gx-design-vue/pro-utils/dist").RecordType>, keyof import("../types/ColumnTypings").DefaultProColumn | "key" | "dataIndex"> & {
@@ -95,7 +91,6 @@ export declare function useColumns({ scroll, columns, breakpoint, draggable, aut
95
91
  valueType?: import("../types/ColumnTypings").ProColumnsValueType;
96
92
  })[]>;
97
93
  setColumns: (columnList: ProColumnsType) => void;
98
- changeColumns: (columnState: Record<string, ColumnsState>) => void;
99
94
  resizeColumnWidth: (width: number, col: ProColumnType) => void;
100
95
  };
101
96
  export {};
@@ -1,24 +1,24 @@
1
1
  import type { RecordType } from '@gx-design-vue/pro-utils';
2
- import type { ComputedRef, Ref } from 'vue';
2
+ import type { ComputedRef, Reactive, Ref } from 'vue';
3
3
  import type { FilterValue, SorterResult, TableCurrentDataSource } from '../_utils';
4
4
  import type { ProColumnsType } from '../types/ColumnTypings';
5
- import type { ProTableFetchParams, ProTablePagination, ProTablePaginationConfig, ProTableProps } from '../types/TableTypings';
5
+ import type { PageState, ProTableFetchParams, ProTablePagination, ProTablePaginationConfig, ProTableProps } from '../types/TableTypings';
6
6
  interface ActionType {
7
7
  loading: Ref<boolean>;
8
- paginationInfo: Ref<ProTablePagination>;
8
+ pageInfo: Reactive<PageState>;
9
9
  setPagination: (info: Partial<ProTablePagination>) => void;
10
10
  setLoading: (loading: boolean) => void;
11
11
  setColumns: (columnList: ProColumnsType) => void;
12
12
  removeRowKeys: (keyList: (string | number)[]) => void;
13
13
  syncSelectedRows: (dataList: any[]) => void;
14
14
  columns: ComputedRef<ProColumnsType>;
15
- defaultState: Ref<RecordType>;
15
+ defaultFormSearch: Ref<RecordType>;
16
+ params: Ref<ProTableProps['params']>;
16
17
  onRequestError: ProTableProps['onRequestError'];
17
18
  onBeforeSearchSubmit: ProTableProps['onBeforeSearchSubmit'];
18
19
  hasCustomRender: ComputedRef<boolean>;
19
20
  }
20
21
  export interface ConfigFetchData {
21
- params: ComputedRef<ProTableProps['params']>;
22
22
  rowKey: ComputedRef<ProTableProps['rowKey']>;
23
23
  polling: ComputedRef<ProTableProps['polling']>;
24
24
  request: ProTableProps['request'];
@@ -29,11 +29,11 @@ export interface ConfigFetchData {
29
29
  autoRequest: ComputedRef<ProTableProps['autoRequest']>;
30
30
  }
31
31
  export declare function useConfigFetchData(props: ProTableProps): Omit<ConfigFetchData, 'waitRequest'>;
32
- export declare function useFetchData({ params, rowKey, autoRequest, polling, request, postData, dataSource, waitRequest, debounceTime }: ConfigFetchData, { columns, setLoading, setColumns, removeRowKeys, syncSelectedRows, defaultState, setPagination, paginationInfo, onRequestError, onBeforeSearchSubmit, hasCustomRender }: ActionType, emit: any): {
33
- dataSource: ComputedRef<RecordType[]>;
32
+ export declare function useFetchData({ rowKey, autoRequest, polling, request, postData, dataSource, waitRequest, debounceTime }: ConfigFetchData, { params, columns, setLoading, setColumns, removeRowKeys, syncSelectedRows, defaultFormSearch, setPagination, pageInfo, onRequestError, onBeforeSearchSubmit, hasCustomRender }: ActionType, emit: any): {
33
+ dataSource: ComputedRef<any[]>;
34
34
  isTreeDataRef: ComputedRef<boolean>;
35
- reSetDataList: (list: RecordType[]) => void;
36
- changeDataValue: ({ key, type, row, value }: {
35
+ setTableDataList: (list: RecordType[]) => void;
36
+ operateTableDataRow: ({ key, type, row, value }: {
37
37
  row?: Partial<RecordType> | undefined;
38
38
  key?: string | undefined;
39
39
  value?: any;
@@ -17,22 +17,39 @@ export type ProTableState<T extends object = RecordType, R extends object = Reco
17
17
  };
18
18
  export type BaseTableState<T extends object = RecordType, R extends object = RecordType> = Omit<ProTableProps<T, R>, 'request'>;
19
19
  export interface UseTableReturn<T extends object = RecordType, R extends object = RecordType> {
20
+ /** @name loading 状态,可以直接进行修改 */
20
21
  loading: Ref<boolean>;
22
+ /** @name 只读表格数据,不能修改 */
21
23
  dataSource: ComputedRef<T[]>;
24
+ /** @name 表格列选择keys,只读 */
22
25
  selectedKeys: ProCoreActionType<T, R>['selectedKeys'];
26
+ /** @name 表格列选择rows,只读 */
23
27
  selectedItems: ProCoreActionType<T, R>['selectedItems'];
28
+ /** @name 表格列选项操作 */
24
29
  rowsSelection: ProCoreActionType<T, R>['rowsSelection'];
30
+ /** @name 表格请求参数 */
25
31
  requestSearch: ComputedRef<RequestConfig<R>['params']>;
32
+ /** @name 主动刷新,按照当前的参数在当前页重新请求下 */
26
33
  reload: ProCoreActionType<T, R>['reload'];
27
- mutate: ProCoreActionType<T, R>['reSetDataList'];
28
- setPageAndReload: ProCoreActionType<T, R>['setPageAndReload'];
29
- setDataValue: ProCoreActionType<T, R>['setDataValue'];
34
+ /** @name 更新表格数据,直接替换,谨慎操作 */
35
+ setTableDataList: ProCoreActionType<T, R>['setTableDataList'];
36
+ /** @name 更新TableData属性值 */
37
+ operateTableDataRow: ProCoreActionType<T, R>['operateTableDataRow'];
38
+ /** @name 设置翻页、排序、筛选、并且刷新(reload) */
39
+ setPageInfo: ProCoreActionType<T, R>['setPageInfo'];
40
+ /** @name 设置翻页 */
30
41
  setPagination: ProCoreActionType<T, R>['setPagination'];
42
+ /** @name 刷新并清空表单,重置为第一页 */
31
43
  reloadAndReset: ProCoreActionType<T, R>['reloadAndReset'];
44
+ /** @name 改变loading状态 */
32
45
  setLoading: ProCoreActionType<T, R>['setLoading'];
33
- actionRef: ComputedRef<Partial<ProCoreActionType<T, R>>>;
46
+ /** @name action表格实例 */
47
+ actionRef: ComputedRef<ProCoreActionType<T, R>>;
48
+ /** @name form查询表单实例 */
34
49
  formRef: ComputedRef<ProCoreFormType<R>>;
50
+ /** @name 表格参数,用于传递给ProTable组件使用,可以对其进行修改 */
35
51
  tableState: Reactive<ProTableState<T, R>>;
52
+ /** @name 更新表格参数 SearchMap,key为SearchMap唯一字段,value是更新的参数,会merge */
36
53
  updateSearchMap: (key: keyof R | keyof T, value: Partial<any>) => void;
37
54
  }
38
55
  export declare function useTable<T extends object = RecordType, R extends object = RecordType>(tableRef: Ref<ProTableRef<T> | undefined>, options?: {
@@ -74,5 +74,5 @@ export declare function useTableForm({ searchMap, columns }: {
74
74
  disabled?: boolean | undefined;
75
75
  }[] | undefined;
76
76
  }[]>;
77
- defaultState: Ref<RecordType, RecordType>;
77
+ defaultFormSearch: Ref<RecordType, RecordType>;
78
78
  };