@gx-design-vue/pro-table 0.0.1

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 (52) hide show
  1. package/README.md +1 -0
  2. package/dist/ProTable.d.ts +704 -0
  3. package/dist/_utils/ant-design-vue/index.d.ts +5 -0
  4. package/dist/_utils/ant-design-vue/pagination/typings.d.ts +1 -0
  5. package/dist/_utils/ant-design-vue/table/props.d.ts +191 -0
  6. package/dist/_utils/ant-design-vue/table/typings.d.ts +11 -0
  7. package/dist/_utils/gx-design-vue/extract-public-props.d.ts +7 -0
  8. package/dist/_utils/gx-design-vue/index.d.ts +2 -0
  9. package/dist/_utils/gx-design-vue/typings.d.ts +1 -0
  10. package/dist/_utils/hooks/useRefFunction/index.d.ts +1 -0
  11. package/dist/_utils/index.d.ts +15 -0
  12. package/dist/_utils/typings.d.ts +40 -0
  13. package/dist/components/ColumnSetting/index.d.ts +10 -0
  14. package/dist/components/ColumnSetting/style.less +95 -0
  15. package/dist/components/Form/index.d.ts +35 -0
  16. package/dist/components/Form/style.less +42 -0
  17. package/dist/components/Form/useForm.d.ts +6 -0
  18. package/dist/components/ListToolBar/index.d.ts +61 -0
  19. package/dist/components/ListToolBar/style.less +62 -0
  20. package/dist/components/ToolBar/DensityIcon.d.ts +3 -0
  21. package/dist/components/ToolBar/FullscreenIcon.d.ts +3 -0
  22. package/dist/components/ToolBar/index.d.ts +16 -0
  23. package/dist/components/ToolBar/style.less +40 -0
  24. package/dist/context/TableContext.d.ts +25 -0
  25. package/dist/design/config.less +7 -0
  26. package/dist/hooks/core/index.d.ts +3 -0
  27. package/dist/hooks/core/useMemo.d.ts +10 -0
  28. package/dist/hooks/core/useTimeout.d.ts +11 -0
  29. package/dist/hooks/useColumnSetting.d.ts +30 -0
  30. package/dist/hooks/useColums.d.ts +24 -0
  31. package/dist/hooks/useDebounceFn.d.ts +10 -0
  32. package/dist/hooks/useFetchData.d.ts +37 -0
  33. package/dist/hooks/useLoading.d.ts +17 -0
  34. package/dist/hooks/usePagination.d.ts +11 -0
  35. package/dist/hooks/useRowSelection.d.ts +9 -0
  36. package/dist/hooks/useTableForm.d.ts +15 -0
  37. package/dist/hooks/useTableScroll.d.ts +27 -0
  38. package/dist/hooks/useTableSize.d.ts +9 -0
  39. package/dist/index.d.ts +6 -0
  40. package/dist/pro-table.mjs +2095 -0
  41. package/dist/pro-table.umd.js +1 -0
  42. package/dist/props.d.ts +433 -0
  43. package/dist/style/index.less +168 -0
  44. package/dist/style/table.less +42 -0
  45. package/dist/style.css +1 -0
  46. package/dist/style.less +5 -0
  47. package/dist/types/column.d.ts +147 -0
  48. package/dist/types/table.d.ts +78 -0
  49. package/dist/typings/components.d.ts +6 -0
  50. package/dist/utils/index.d.ts +86 -0
  51. package/dist/utils/validate.d.ts +25 -0
  52. package/package.json +74 -0
@@ -0,0 +1,25 @@
1
+ import type { Ref, ComputedRef } from 'vue';
2
+ import type { InjectionKey, Slots } from 'vue';
3
+ import type { ProColumns } from '../types/column';
4
+ import type { ColumnsState, SettingsAction } from '../hooks/useColumnSetting';
5
+ import type { SizeType, PaginationProps } from '../../../_utils';
6
+ export declare type ContextType = any;
7
+ export interface TableContextProps {
8
+ columns?: ComputedRef<ProColumns>;
9
+ cacheColumns?: ComputedRef<ProColumns>;
10
+ tableSize?: Ref<SizeType>;
11
+ action?: {
12
+ /** @name 刷新 */
13
+ reload: (info?: any) => void;
14
+ toggle: () => Promise<void>;
15
+ setTableSize: (size: SizeType) => void;
16
+ };
17
+ setPagination: (info: Partial<PaginationProps>) => void;
18
+ settingsAction: SettingsAction;
19
+ slots: Slots;
20
+ changeColumns: (map: Record<string, ColumnsState>, fixed: boolean) => void;
21
+ [key: string]: any;
22
+ }
23
+ export declare const useContext: <T>(contextInjectKey?: string | InjectionKey<ContextType>, defaultValue?: ContextType) => T;
24
+ export declare const provideTableContext: (value: TableContextProps | ComputedRef<TableContextProps>) => void;
25
+ export declare const useTableContext: () => Required<TableContextProps>;
@@ -0,0 +1,7 @@
1
+ @root-entry-name: default;
2
+
3
+ @import 'ant-design-vue/es/style/themes/default.less';
4
+ @import 'ant-design-vue/es/style/core/index.less';
5
+
6
+ @gx-prefix: gx;
7
+ @gx-prefix-pro: ~'@{gx-prefix}-pro';
@@ -0,0 +1,3 @@
1
+ import useMemo from './useMemo';
2
+ export * from './useTimeout';
3
+ export { useMemo };
@@ -0,0 +1,10 @@
1
+ import type { ComputedRef, WritableComputedRef } from 'vue';
2
+ declare type MemoGetter<T> = () => T;
3
+ declare type MemoSetter<T> = (v: T) => void;
4
+ interface WritableMemoOptions<T> {
5
+ get: MemoGetter<T>;
6
+ set: MemoSetter<T>;
7
+ }
8
+ declare function useMemo<T>(getter: MemoGetter<T>): ComputedRef<T>;
9
+ declare function useMemo<T>(options: WritableMemoOptions<T>): WritableComputedRef<T>;
10
+ export default useMemo;
@@ -0,0 +1,11 @@
1
+ export declare function tryOnUnmounted(fn: Fn): void;
2
+ export declare function useTimeoutFn(handle: Fn<any>, wait: number, native?: boolean): {
3
+ readyRef: import("vue").Ref<boolean>;
4
+ stop: () => void;
5
+ start: () => void;
6
+ };
7
+ export declare function useTimeoutRef(wait: number): {
8
+ readyRef: import("vue").Ref<boolean>;
9
+ stop: () => void;
10
+ start: () => void;
11
+ };
@@ -0,0 +1,30 @@
1
+ import type { Ref } from 'vue';
2
+ import type { ProColumns } from '../types/column';
3
+ export declare type SettingsOperationType = 'fixed' | 'drop' | 'show' | undefined;
4
+ export declare type ColumnsState = {
5
+ show?: boolean;
6
+ fixed?: 'right' | 'left' | boolean | undefined;
7
+ order?: number;
8
+ disable?: boolean | {
9
+ checkbox: boolean;
10
+ icon: boolean;
11
+ };
12
+ };
13
+ export declare type SettingsAction = {
14
+ autoScroll?: Ref<boolean>;
15
+ sortKeyColumns: Ref<string[]>;
16
+ columnsMap: Record<string, ColumnsState>;
17
+ operationType: Ref<SettingsOperationType>;
18
+ setSortKeyColumns: (value: string[]) => void;
19
+ cacheColumnsMap: Record<string, ColumnsState>;
20
+ setColumnsMap: (value: Record<string, ColumnsState>, key?: SettingsOperationType) => void;
21
+ };
22
+ export declare type ColumnsStateType = {
23
+ value?: Record<string, ColumnsState>;
24
+ onChange?: (map: Record<string, ColumnsState>) => void;
25
+ };
26
+ export declare function useColumnSetting({ columns, columnsState, changeColumns }: {
27
+ columns: Ref<ProColumns>;
28
+ columnsState: Ref<ColumnsStateType | undefined>;
29
+ changeColumns?: (map: Record<string, ColumnsState>, fixed: boolean) => void;
30
+ }): SettingsAction;
@@ -0,0 +1,24 @@
1
+ import type { Ref, ComputedRef } from 'vue';
2
+ import type { ColumnsState } from './useColumnSetting';
3
+ import type { ProTableProps } from '../ProTable';
4
+ import type { ProColumn, ProColumns } from '../types/column';
5
+ export declare type ConfigColumns = {
6
+ draggabled: ComputedRef<ProTableProps['draggabled']>;
7
+ neverScroll: ComputedRef<ProTableProps['neverScroll']>;
8
+ autoScroll: ComputedRef<ProTableProps['autoScroll']>;
9
+ };
10
+ declare type UseColumnsType = {
11
+ scroll: ComputedRef<ProTableProps['scroll']>;
12
+ breakpoint: ComputedRef<boolean>;
13
+ columns: ComputedRef<ProColumns>;
14
+ } & ConfigColumns;
15
+ export declare function useConfigColumns(props: ProTableProps): ConfigColumns;
16
+ export declare function useColumns({ scroll, columns, breakpoint, draggabled, autoScroll, neverScroll }: UseColumnsType): {
17
+ breakpoint: ComputedRef<boolean>;
18
+ getProColumns: ComputedRef<ProColumn[]>;
19
+ cacheProColumns: Ref<ProColumns>;
20
+ setColumns: (columnList: ProColumns) => void;
21
+ changeColumns: (columnState: Record<string, ColumnsState>) => void;
22
+ resizeColumnWidth: (w: number, col: any) => void;
23
+ };
24
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ProTabelFeachParams } from '../types/table';
2
+ export declare type ReturnValue<T extends any[]> = {
3
+ run: (...args: T) => void;
4
+ cancel: () => void;
5
+ };
6
+ declare function useDebounceFn<T extends any[]>(fn: (...args: T) => Promise<any>, wait?: number): {
7
+ cancel: () => void;
8
+ run: (...args: ProTabelFeachParams[]) => Promise<void>;
9
+ };
10
+ export default useDebounceFn;
@@ -0,0 +1,37 @@
1
+ import type { ComputedRef } from 'vue';
2
+ import type { SpinProps } from '../_utils';
3
+ import type { ProTableProps } from '../ProTable';
4
+ import type { ProTablePagination, ProTablePaginationConfig } from '../types/table';
5
+ import type { ProColumns } from '../types/column';
6
+ interface ActionType {
7
+ getLoading: ComputedRef<boolean | SpinProps | undefined>;
8
+ getPaginationInfo: ComputedRef<ProTablePagination>;
9
+ setPagination: (info: Partial<ProTablePagination>) => void;
10
+ setLoading: (loading: boolean | SpinProps) => void;
11
+ setColumns: (columnList: ProColumns) => void;
12
+ removeRowKeys: (keyList: (string | number)[]) => void;
13
+ columns: ComputedRef<ProColumns>;
14
+ formParamsRef: RecordType;
15
+ beforeSearchSubmit: ProTableProps['beforeSearchSubmit'];
16
+ }
17
+ export declare type ConfigFetchData = {
18
+ polling: ComputedRef<ProTableProps['polling']>;
19
+ request: ComputedRef<ProTableProps['request']>;
20
+ postData: ComputedRef<ProTableProps['postData']>;
21
+ waitRequest: ComputedRef<ProTableProps['waitRequest']>;
22
+ debounceTime: ComputedRef<ProTableProps['debounceTime']>;
23
+ dataSource: ComputedRef<ProTableProps['dataSource']>;
24
+ };
25
+ export declare function useConfigFetchData(props: ProTableProps): ConfigFetchData;
26
+ export declare function useFetchData({ polling, request, postData, dataSource, waitRequest, debounceTime, }: ConfigFetchData, { columns, getLoading, setLoading, setColumns, removeRowKeys, formParamsRef, setPagination, getPaginationInfo, beforeSearchSubmit }: ActionType, emit: any): {
27
+ getDataSourceRef: ComputedRef<RecordType[]>;
28
+ isTreeDataRef: ComputedRef<boolean>;
29
+ reSetDataList: (list: RecordType[]) => void;
30
+ changeDataValue: ({ key, value }: {
31
+ key?: string | undefined;
32
+ value: RecordType;
33
+ }) => void;
34
+ handleTableChange: (pagination: ProTablePaginationConfig, filters: any, sorter: any) => void;
35
+ reload: (info?: any) => Promise<void>;
36
+ };
37
+ export {};
@@ -0,0 +1,17 @@
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
+ prefixCls?: string | undefined;
9
+ spinning?: boolean | undefined;
10
+ size?: "small" | "default" | "large" | undefined;
11
+ wrapperClassName?: string | undefined;
12
+ tip?: string | undefined;
13
+ delay?: number | undefined;
14
+ indicator?: any;
15
+ }>;
16
+ setLoading: (loading: boolean | SpinProps) => void;
17
+ };
@@ -0,0 +1,11 @@
1
+ import type { Ref, Slots, ComputedRef } from 'vue';
2
+ import type { ProTableProps } from '../ProTable';
3
+ import type { ProTablePagination } from '../types/table';
4
+ export declare function usePagination({ slots, props, pagination }: {
5
+ slots: Slots;
6
+ props: ComputedRef<ProTableProps>;
7
+ pagination: Ref<ProTableProps['pagination']>;
8
+ }): {
9
+ getPaginationInfo: ComputedRef<ProTablePagination>;
10
+ setPagination: (info: Partial<ProTablePagination>) => void;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { Ref } from 'vue';
2
+ import type { ProTableProps } from '../ProTable';
3
+ export declare function useRowSelection(rowKey: Ref<ProTableProps['rowKey']>, rowSelection: Ref<ProTableProps['rowSelection']>): {
4
+ selectedKey: Ref<(string | number)[]>;
5
+ selectRowKey: (record: RecordType, selected: any[]) => void;
6
+ selectAllRowKey: (selected: any[], selectedRows: any[], changeRows: any[]) => void;
7
+ removeRowKeys: (keyList: (string | number)[]) => void;
8
+ changeRowKey: () => void;
9
+ };
@@ -0,0 +1,15 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { ProTableProps } from '../ProTable';
3
+ import type { SearchConfig } from '../types/table';
4
+ import type { ProSearchMap } from '../types/column';
5
+ export declare function useTableForm({ search, searchMap, params, columns }: {
6
+ search: Ref<SearchConfig>;
7
+ searchMap: Ref<ProSearchMap[]>;
8
+ params: Ref<ProTableProps['params']>;
9
+ columns: ComputedRef<ProTableProps['columns']>;
10
+ }): {
11
+ formDataRef: Ref<ProSearchMap<"text", "date">[]>;
12
+ formParamsRef: RecordType;
13
+ defaultParamsRef: RecordType;
14
+ setFormParams: (params: any) => void;
15
+ };
@@ -0,0 +1,27 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { ProTableProps } from '../ProTable';
3
+ import type { ProColumns } from '../types/column';
4
+ declare type ConfigScroll = {
5
+ scroll: ComputedRef<ProTableProps['scroll']>;
6
+ autoScroll: ComputedRef<ProTableProps['autoScroll']>;
7
+ modalScroll: ComputedRef<ProTableProps['modalScroll']>;
8
+ neverScroll: ComputedRef<ProTableProps['neverScroll']>;
9
+ rowSelection: ComputedRef<ProTableProps['rowSelection']>;
10
+ scrollBreakpoint: ComputedRef<ProTableProps['scrollBreakpoint']>;
11
+ };
12
+ declare type useTableScrollType = {
13
+ columns: ComputedRef<ProColumns>;
14
+ innerWidth: Ref<number>;
15
+ screensRef: Ref<Partial<Record<Breakpoint, boolean>>>;
16
+ } & ConfigScroll;
17
+ export declare function useConfigScroll(props: ProTableProps): ConfigScroll;
18
+ export declare function useTableScroll({ scroll, columns, autoScroll, modalScroll, neverScroll, rowSelection, screensRef, innerWidth, scrollBreakpoint, }: useTableScrollType): {
19
+ getScrollRef: ComputedRef<({
20
+ x?: string | number | true | undefined;
21
+ y?: string | number | undefined;
22
+ } & {
23
+ scrollToFirstRowOnChange?: boolean | undefined;
24
+ }) | undefined>;
25
+ breakpoint: ComputedRef<boolean>;
26
+ };
27
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Ref } from 'vue';
2
+ import type { SizeType } from '../_utils';
3
+ export declare function useTableSize({ size, emit }: {
4
+ size: Ref<SizeType>;
5
+ emit: any;
6
+ }): {
7
+ sizeRef: Ref<SizeType>;
8
+ setTableSize: (size: SizeType) => void;
9
+ };
@@ -0,0 +1,6 @@
1
+ import './design/config.less';
2
+ import './style/table.less';
3
+ import './style.less';
4
+ export { default as ProTable } from './ProTable';
5
+ export { proTableProps } from './props';
6
+ export type { ProTableProps } from './ProTable';