@gx-design-vue/pro-table 0.2.0-beta.11 → 0.2.0-beta.111
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.
- package/dist/ProTable.d.ts +231 -796
- package/dist/_utils/ant-design-vue/index.d.ts +4 -2
- package/dist/_utils/ant-design-vue/input/typings.d.ts +1 -0
- package/dist/_utils/ant-design-vue/table/props.d.ts +33 -2
- package/dist/_utils/ant-design-vue/table/typings.d.ts +6 -5
- package/dist/_utils/ant-design-vue/tooltip/typings.d.ts +1 -0
- package/dist/_utils/index.d.ts +1 -1
- package/dist/components/ColumnSetting/index.d.ts +16 -16
- package/dist/components/ColumnSetting/style.d.ts +2 -5
- package/dist/components/Form/components/RequestSelect.d.ts +39 -0
- package/dist/components/Form/{useForm.d.ts → hooks/useForm.d.ts} +1 -1
- package/dist/components/Form/index.d.ts +39 -21
- package/dist/components/Form/style.d.ts +2 -5
- package/dist/components/Form/utils/config.d.ts +5 -0
- package/dist/components/Form/utils/dateFormat.d.ts +20 -0
- package/dist/components/ListToolBar/index.d.ts +21 -21
- package/dist/components/ListToolBar/style.d.ts +2 -5
- package/dist/components/ToolBar/FullscreenIcon.d.ts +1 -1
- package/dist/components/ToolBar/index.d.ts +20 -20
- package/dist/context/TableContext.d.ts +16 -14
- package/dist/hooks/tryOnActivated.d.ts +2 -0
- package/dist/hooks/useColumnSetting.d.ts +6 -6
- package/dist/hooks/useColumns.d.ts +102 -0
- package/dist/hooks/useDebounceFn.d.ts +2 -2
- package/dist/hooks/useFetchData.d.ts +20 -15
- package/dist/hooks/useLoading.d.ts +4 -3
- package/dist/hooks/usePagination.d.ts +8 -3
- package/dist/hooks/useRowSelection.d.ts +11 -8
- package/dist/hooks/useTable.d.ts +38 -11
- package/dist/hooks/useTableForm.d.ts +6 -6
- package/dist/hooks/useTableScroll.d.ts +11 -11
- package/dist/hooks/useTableSize.d.ts +2 -2
- package/dist/index.d.ts +6 -5
- package/dist/pro-table.js +2995 -0
- package/dist/pro-table.umd.cjs +1 -0
- package/dist/props.d.ts +94 -359
- package/dist/style.d.ts +2 -6
- package/dist/types/ColumnTypings.d.ts +54 -16
- package/dist/types/SlotsTypings.d.ts +42 -9
- package/dist/types/TableTypings.d.ts +117 -67
- package/dist/utils/utils.d.ts +4 -1
- package/package.json +28 -50
- package/volar.d.ts +3 -3
- package/dist/hooks/useColums.d.ts +0 -24
- package/dist/pro-table.mjs +0 -35085
- package/dist/pro-table.umd.js +0 -364
- package/dist/typing.d.ts +0 -1
- package/dist/utils/config.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RecordType, VueNode } from '@gx-design-vue/pro-utils';
|
|
2
|
-
import type {
|
|
3
|
-
import type { ColumnType } from '../_utils';
|
|
2
|
+
import type { CSSProperties } from 'vue';
|
|
3
|
+
import type { AlignType, ColumnType, TooltipProps } from '../_utils';
|
|
4
4
|
/**
|
|
5
5
|
* @param text 文本框
|
|
6
6
|
* @param date 日期 YYYY-MM-DD
|
|
@@ -9,7 +9,7 @@ import type { ColumnType } from '../_utils';
|
|
|
9
9
|
* @param time: 时间 HH:mm:ss
|
|
10
10
|
* @param select 下拉选择器
|
|
11
11
|
*/
|
|
12
|
-
export type ProFieldValueType = 'text' | '
|
|
12
|
+
export type ProFieldValueType = 'text' | 'number' | 'numberRange' | 'select' | 'treeSelect' | 'date' | 'dateWeek' | 'dateQuarter' | 'dateMonth' | 'dateYear' | 'dateRange' | 'time';
|
|
13
13
|
/**
|
|
14
14
|
* @param text 文本框
|
|
15
15
|
* @param date 日期 YYYY-MM-DD
|
|
@@ -19,17 +19,18 @@ export type ProFieldValueType = 'text' | 'date' | 'select' | 'treeSelect' | 'dat
|
|
|
19
19
|
* @param select 下拉选择器
|
|
20
20
|
*/
|
|
21
21
|
export type ProFieldValueFormat = 'YYYY-MM-DD' | 'YYYY-MM' | 'YYYY-MM-DD HH:mm:ss' | 'HH:mm:ss';
|
|
22
|
-
export
|
|
22
|
+
export interface ProSchemaValueEnumType {
|
|
23
23
|
/** @name 演示的文案 */
|
|
24
|
-
|
|
24
|
+
label: VueNode | JSX.Element;
|
|
25
25
|
/** @name 演示的value值 */
|
|
26
26
|
value: any;
|
|
27
27
|
/** @name 是否禁用 */
|
|
28
28
|
disabled?: boolean;
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
type ProSchemaValueType<ValueType> = (ValueType | ProFieldValueType);
|
|
31
|
-
export
|
|
32
|
-
name
|
|
31
|
+
export interface ProSearchMap<ValueType = 'text', ParamsKey = string> {
|
|
32
|
+
name: ParamsKey;
|
|
33
|
+
order?: number;
|
|
33
34
|
/** 选择如何渲染相应的模式 */
|
|
34
35
|
valueType?: ProSchemaValueType<ValueType>;
|
|
35
36
|
/** valueType为date|dateMonth|dateRange|time生效 */
|
|
@@ -55,18 +56,55 @@ export type ProSearchMap<ValueType = 'text'> = {
|
|
|
55
56
|
initialValue?: any;
|
|
56
57
|
/** 针对select、treeselect取值的key */
|
|
57
58
|
valueKey?: string;
|
|
58
|
-
/**
|
|
59
|
-
|
|
59
|
+
/** 远程查询数据 */
|
|
60
|
+
request?: {
|
|
61
|
+
fetch?: () => Promise<ProSchemaValueEnumType[]>;
|
|
62
|
+
manual?: boolean;
|
|
63
|
+
debounceTime?: number;
|
|
64
|
+
};
|
|
65
|
+
/** 查询表单label */
|
|
66
|
+
label?: string;
|
|
67
|
+
/** 查询表单label - 宽度 */
|
|
68
|
+
labelWidth?: string | number;
|
|
69
|
+
/** 查询表单label - 对齐方式 */
|
|
70
|
+
labelAlign?: 'center' | 'left' | 'right';
|
|
71
|
+
/** 表单的属性值(ant-design) */
|
|
72
|
+
field?: {
|
|
73
|
+
rules?: RegExp;
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
};
|
|
60
76
|
/**
|
|
61
77
|
* 支持 object 和Map,Map 是支持其他基础类型作为 key
|
|
62
78
|
*
|
|
63
79
|
* @name 映射值的类型
|
|
64
80
|
*/
|
|
65
81
|
valueEnum?: ProSchemaValueEnumType[];
|
|
82
|
+
}
|
|
83
|
+
export type ColumnWithKeyOrDataIndex<T = any[]> = {
|
|
84
|
+
key: keyof T | 'action' | string;
|
|
85
|
+
dataIndex?: keyof T | 'action' | string;
|
|
86
|
+
} | {
|
|
87
|
+
key?: keyof T | 'action' | string;
|
|
88
|
+
dataIndex: keyof T | 'action' | string;
|
|
66
89
|
};
|
|
67
|
-
export
|
|
68
|
-
children?: ProColumnsType<RecordType>;
|
|
90
|
+
export interface DefaultProColumn {
|
|
69
91
|
uuid?: string | number;
|
|
92
|
+
align?: AlignType;
|
|
93
|
+
fixed?: boolean | 'right' | 'left';
|
|
94
|
+
width?: number | string;
|
|
95
|
+
}
|
|
96
|
+
export type DefaultProColumnWithKeyOrDataIndex<T = any[]> = DefaultProColumn & ColumnWithKeyOrDataIndex<T>;
|
|
97
|
+
export type ProColumn<T = undefined, R = any[]> = T extends undefined ? DefaultProColumnWithKeyOrDataIndex<R> : DefaultProColumnWithKeyOrDataIndex<R> & T;
|
|
98
|
+
export type ProColumnType<DataValue = RecordType, SearchParama = RecordType> = ProColumn<Omit<ColumnType<DataValue>, keyof DefaultProColumnWithKeyOrDataIndex> & {
|
|
99
|
+
children?: ProColumnsType<DataValue, SearchParama>;
|
|
100
|
+
index?: number;
|
|
101
|
+
copyText?: string | ((record: ProColumnType) => string);
|
|
102
|
+
tooltip?: false | (TooltipProps & {
|
|
103
|
+
width?: number;
|
|
104
|
+
targetStyle?: Partial<CSSProperties>;
|
|
105
|
+
hiddenLine?: number;
|
|
106
|
+
class?: string;
|
|
107
|
+
});
|
|
70
108
|
/** 不在列表中显示 */
|
|
71
109
|
show?: boolean;
|
|
72
110
|
/** 列表顺序值 */
|
|
@@ -74,15 +112,15 @@ export type ProColumnType<RecordType = DefaultRecordType> = ColumnType<RecordTyp
|
|
|
74
112
|
/** 不在配置工具中显示 */
|
|
75
113
|
hideInSetting?: boolean;
|
|
76
114
|
/** 表单搜索配置 */
|
|
77
|
-
searchConfig?: ProSearchMap
|
|
115
|
+
searchConfig?: ProSearchMap<undefined, keyof DataValue | keyof SearchParama>;
|
|
78
116
|
/** 是否拷贝 */
|
|
79
117
|
copyable?: boolean;
|
|
80
118
|
/** 值为空时,默认取值 */
|
|
81
119
|
columnEmptyText?: string;
|
|
82
120
|
valueType?: ProColumnsValueType;
|
|
83
|
-
}
|
|
84
|
-
export type ProColumnsType<RecordType =
|
|
85
|
-
export type ProColumnsValueType = 'text' | 'link' | 'time' | 'dateMonth' | 'dateTime' | {
|
|
121
|
+
}, DataValue>;
|
|
122
|
+
export type ProColumnsType<DataValue = RecordType, SearchParama = RecordType> = ProColumnType<DataValue, SearchParama>[];
|
|
123
|
+
export type ProColumnsValueType = 'text' | 'link' | 'time' | 'dateMonth' | 'dateTime' | 'date' | {
|
|
86
124
|
node?: string;
|
|
87
125
|
class?: string;
|
|
88
126
|
attr?: string;
|
|
@@ -1,12 +1,45 @@
|
|
|
1
|
-
import type { CustomRender, WithFalse } from '@gx-design-vue/pro-utils';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { CustomRender, RecordType, WithFalse } from '@gx-design-vue/pro-utils';
|
|
2
|
+
import type { ColumnType, RenderExpandIconProps } from '../_utils';
|
|
3
|
+
import type { ProColumnType } from '../types/ColumnTypings';
|
|
4
|
+
export interface ProTableBodyCellProps<T = RecordType> {
|
|
5
|
+
text: any;
|
|
6
|
+
value: any;
|
|
7
|
+
record: T;
|
|
8
|
+
index: number;
|
|
9
|
+
column: ProColumnType<T>;
|
|
10
|
+
}
|
|
11
|
+
export interface AntTableSlotsType {
|
|
12
|
+
emptyText?: any;
|
|
13
|
+
expandIcon?: RenderExpandIconProps<any>;
|
|
14
|
+
title?: any;
|
|
15
|
+
footer?: any;
|
|
16
|
+
summary?: any;
|
|
17
|
+
expandedRowRender?: any;
|
|
18
|
+
expandColumnTitle?: any;
|
|
19
|
+
bodyCell?: (props: ProTableBodyCellProps<any>) => void;
|
|
20
|
+
headerCell?: (props: {
|
|
21
|
+
title: any;
|
|
22
|
+
column: ColumnType;
|
|
23
|
+
}) => void;
|
|
24
|
+
customFilterIcon?: any;
|
|
25
|
+
customFilterDropdown?: any;
|
|
26
|
+
default: any;
|
|
27
|
+
}
|
|
28
|
+
export type ProTableSlotsKey = 'search' | 'headerTitle' | 'toolBarBtn' | 'titleTip' | 'settingExtra' | 'optionsExtra' | 'pageItemRender' | 'customRender';
|
|
29
|
+
export declare const proTableSlotsKey: ProTableSlotsKey[];
|
|
30
|
+
export type Slots = Readonly<Omit<Record<ProTableSlotsKey, () => void>, 'customRender'> & {
|
|
31
|
+
customRender: (params: CustomRenderResult) => void;
|
|
32
|
+
}>;
|
|
33
|
+
export interface CustomRenderResult<T = RecordType> {
|
|
34
|
+
currentData: T[];
|
|
35
|
+
dataSource: T[];
|
|
36
|
+
}
|
|
37
|
+
export type PageItemFn = (opt: {
|
|
8
38
|
page: number;
|
|
9
39
|
type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next';
|
|
10
40
|
originalElement: any;
|
|
11
|
-
}) => CustomRender
|
|
12
|
-
export type
|
|
41
|
+
}) => CustomRender;
|
|
42
|
+
export type CustomDataFn<T = RecordType> = (params: CustomRenderResult<T>) => CustomRender;
|
|
43
|
+
export type DefaultRender = WithFalse<CustomRender>;
|
|
44
|
+
export type PageItemRender = WithFalse<PageItemFn>;
|
|
45
|
+
export type CustomDataRender<T = RecordType> = WithFalse<CustomDataFn<T>>;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { DefaultRecordType } from '../typing';
|
|
5
|
-
import type { HeaderTitleRender, ToolBarBtnRender, CustomizeRender, TitleTipRender, OptionsExtraRender, SettingExtraRender, PageItemRender } from './SlotsTypings';
|
|
6
|
-
import type { TableRowSelection, TablePaginationConfig, SpinProps, TableFilters, TableSorter, TableProps } from '../_utils';
|
|
1
|
+
import type { Breakpoint, CustomRender, RecordType, SizeType, VueNode, WithFalse } from '@gx-design-vue/pro-utils';
|
|
2
|
+
import type { ComputedRef, CSSProperties, Ref } from 'vue';
|
|
3
|
+
import type { FilterValue, SelectionSelectFn, SorterResult, TableCurrentDataSource, TablePaginationConfig, TableProps, TableRowSelection } from '../_utils';
|
|
7
4
|
import type { ColumnSettingProps } from '../components/ColumnSetting';
|
|
8
5
|
import type { ColumnsState, ColumnsStateType } from '../hooks/useColumnSetting';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import type { ProColumnsType, ProColumnType, ProSearchMap } from './ColumnTypings';
|
|
7
|
+
import type { CustomDataRender, DefaultRender, PageItemRender } from './SlotsTypings';
|
|
8
|
+
export interface ProTableFetchParams<R = RecordType> {
|
|
9
|
+
params?: R;
|
|
10
|
+
filters?: Record<string, FilterValue | null>;
|
|
11
|
+
sorter?: SorterResult | SorterResult[];
|
|
13
12
|
pagination?: ProTablePagination;
|
|
14
13
|
removeKeys?: (string | number)[];
|
|
15
14
|
immediate?: boolean;
|
|
16
15
|
isPolling?: boolean;
|
|
17
|
-
|
|
16
|
+
showLoading?: boolean;
|
|
17
|
+
extra?: TableCurrentDataSource;
|
|
18
|
+
}
|
|
18
19
|
export type TablePaginationPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
19
20
|
export type ProFieldEmptyText = string | false;
|
|
20
21
|
export type ProTableRowSelection<T = any> = Omit<TableRowSelection<T>, 'selectedRowKeys'> & {
|
|
@@ -25,31 +26,46 @@ export interface ProTablePaginationConfig extends Omit<TablePaginationConfig, 'p
|
|
|
25
26
|
position?: TablePaginationPosition[];
|
|
26
27
|
}
|
|
27
28
|
export type ProTablePagination = ProTablePaginationConfig | false;
|
|
28
|
-
export
|
|
29
|
+
export interface PageState {
|
|
30
|
+
pageSize: number;
|
|
31
|
+
pageNum: number;
|
|
32
|
+
}
|
|
33
|
+
export interface RequestData<T = any> {
|
|
29
34
|
data: T[] | undefined;
|
|
30
35
|
success: boolean;
|
|
31
36
|
total: number;
|
|
32
|
-
}
|
|
33
|
-
export
|
|
34
|
-
params: {
|
|
35
|
-
pageSize
|
|
36
|
-
pageNum
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
filter:
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
}
|
|
38
|
+
export interface RequestConfig<T> {
|
|
39
|
+
params: T extends undefined ? PageState : {
|
|
40
|
+
pageSize: number;
|
|
41
|
+
pageNum: number;
|
|
42
|
+
} & Partial<T>;
|
|
43
|
+
sorter: SorterResult | SorterResult[];
|
|
44
|
+
filter: Record<string, FilterValue | null>;
|
|
45
|
+
extra: TableCurrentDataSource;
|
|
46
|
+
}
|
|
47
|
+
export type RequestFunction<T = any, D = undefined> = (params: RequestConfig<D>['params'], sort: RequestConfig<D>['sorter'], filter: RequestConfig<D>['filter']) => Promise<Partial<RequestData<T>> | undefined>;
|
|
42
48
|
export type ColConfig = Partial<Record<Breakpoint, number>>;
|
|
43
|
-
export
|
|
44
|
-
searchText?: string;
|
|
45
|
-
resetText?: string;
|
|
49
|
+
export interface SearchConfig {
|
|
46
50
|
className?: string;
|
|
51
|
+
actions?: {
|
|
52
|
+
reload?: boolean;
|
|
53
|
+
reset?: boolean;
|
|
54
|
+
searchText?: string;
|
|
55
|
+
resetText?: string;
|
|
56
|
+
};
|
|
57
|
+
collapsed?: boolean;
|
|
47
58
|
defaultCollapsed?: boolean;
|
|
48
|
-
|
|
49
|
-
showReset?: boolean;
|
|
59
|
+
manualRequest?: boolean;
|
|
50
60
|
collapseRender?: WithFalse<(collapsed?: boolean) => CustomRender>;
|
|
51
61
|
span?: ColConfig;
|
|
52
|
-
|
|
62
|
+
label?: {
|
|
63
|
+
gap?: number;
|
|
64
|
+
colon?: boolean;
|
|
65
|
+
width?: number;
|
|
66
|
+
align?: 'center' | 'left' | 'right';
|
|
67
|
+
};
|
|
68
|
+
}
|
|
53
69
|
export interface OptionConfig {
|
|
54
70
|
reload?: (() => VueNode | JSX.Element) | boolean;
|
|
55
71
|
density?: boolean;
|
|
@@ -57,80 +73,114 @@ export interface OptionConfig {
|
|
|
57
73
|
fullScreen?: (() => VueNode | JSX.Element) | boolean | (() => Promise<void>);
|
|
58
74
|
}
|
|
59
75
|
/** action表格实例 */
|
|
60
|
-
export interface ProCoreActionType {
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
export interface ProCoreActionType<T = RecordType, R = RecordType> {
|
|
77
|
+
/** @name loadingStatus */
|
|
78
|
+
loading: Ref<boolean>;
|
|
79
|
+
dataSource: ComputedRef<T[]>;
|
|
80
|
+
getLoadingStatus: () => boolean;
|
|
81
|
+
pagination: R | boolean;
|
|
82
|
+
pageState: PageState;
|
|
83
|
+
selectedKeys: ComputedRef<(string | number)[]>;
|
|
84
|
+
selectedItems: ComputedRef<T[]>;
|
|
85
|
+
rowsSelection?: {
|
|
86
|
+
clear: () => void;
|
|
87
|
+
sync: (data: T[]) => void;
|
|
88
|
+
remove: (keys: (string | number)[]) => void;
|
|
89
|
+
select: SelectionSelectFn<T>;
|
|
90
|
+
selectAll: TableRowSelection<T>['onSelectAll'];
|
|
91
|
+
};
|
|
63
92
|
/** @name 刷新 */
|
|
64
|
-
reload
|
|
93
|
+
reload: (info?: ProTableFetchParams<R>) => void;
|
|
65
94
|
/** @name 刷新并清空表单,重置为第一页 */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
95
|
+
reloadAndReset: (options?: {
|
|
96
|
+
callBack?: () => void;
|
|
97
|
+
wait?: boolean;
|
|
98
|
+
}) => void;
|
|
99
|
+
/** @name 设置翻页 */
|
|
100
|
+
setPagination: (pagination: ProTablePaginationConfig) => void;
|
|
101
|
+
/** @name 设置翻页、排序、筛选、并且reload */
|
|
102
|
+
setPageAndReload: (pagination: ProTablePaginationConfig, filters?: Record<string, FilterValue | null>, sorter?: SorterResult | SorterResult[], extra?: TableCurrentDataSource) => void;
|
|
69
103
|
/** @name 更新TableData属性值 */
|
|
70
|
-
reSetDataList
|
|
104
|
+
reSetDataList: (data: T[]) => void;
|
|
71
105
|
/** @name 更新TableData属性值 */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
106
|
+
setDataValue: ({ key, type, params, value }: {
|
|
107
|
+
params?: Partial<T>;
|
|
108
|
+
key?: keyof T;
|
|
109
|
+
value?: any;
|
|
110
|
+
type?: 'update' | 'push' | 'delete' | 'unshift';
|
|
75
111
|
}) => void;
|
|
76
112
|
/** @name 改变loading状态 */
|
|
77
|
-
|
|
113
|
+
setLoading: (loading: boolean) => void;
|
|
78
114
|
}
|
|
79
115
|
/** form查询表单实例 */
|
|
80
|
-
export interface ProCoreFormType {
|
|
116
|
+
export interface ProCoreFormType<R = RecordType> {
|
|
81
117
|
/** @name 获取表格-表单请求参数 */
|
|
82
|
-
|
|
118
|
+
getFormState?: () => R;
|
|
83
119
|
/** @name 获取表格-内部表单参数 */
|
|
84
|
-
|
|
120
|
+
getFormInnerState?: () => R;
|
|
85
121
|
/** @name 重置内部表单组件参数 */
|
|
86
|
-
|
|
122
|
+
restFormState?: (callBack?: () => void) => void;
|
|
87
123
|
}
|
|
88
|
-
export interface ProTableRef {
|
|
89
|
-
formRef: () => ProCoreFormType
|
|
90
|
-
actionRef: () => ProCoreActionType
|
|
124
|
+
export interface ProTableRef<T = RecordType, R = RecordType> {
|
|
125
|
+
formRef: () => ProCoreFormType<R>;
|
|
126
|
+
actionRef: () => ProCoreActionType<T, R>;
|
|
91
127
|
}
|
|
92
|
-
export type ProTableProps<RecordType extends
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
128
|
+
export type ProTableProps<DataRecord extends object = RecordType, ParamsType extends object = RecordType> = Omit<TableProps, 'columns' | 'dataSource'> & Partial<{
|
|
129
|
+
dataSource: DataRecord[];
|
|
130
|
+
tableProps: {
|
|
131
|
+
class?: string;
|
|
132
|
+
style?: CSSProperties;
|
|
133
|
+
};
|
|
134
|
+
rowKey: keyof DataRecord;
|
|
96
135
|
titleTipText: string;
|
|
97
136
|
autoScroll: boolean;
|
|
137
|
+
showSearch: boolean;
|
|
138
|
+
keepAliveReload: boolean;
|
|
139
|
+
emptyTextProps: {
|
|
140
|
+
class?: string;
|
|
141
|
+
style?: CSSProperties;
|
|
142
|
+
extraProps?: RecordType;
|
|
143
|
+
};
|
|
98
144
|
columnEmptyText: ProFieldEmptyText;
|
|
145
|
+
showLoading: boolean;
|
|
99
146
|
neverScroll: boolean;
|
|
100
147
|
modalScroll: boolean;
|
|
101
148
|
scrollBreakpoint: Breakpoint | number;
|
|
149
|
+
useDefaultScrollStyle: boolean;
|
|
102
150
|
draggabled: boolean;
|
|
103
151
|
bordered: boolean;
|
|
104
152
|
showIndex: boolean;
|
|
153
|
+
cardBordered: boolean;
|
|
105
154
|
virtualScroll: boolean;
|
|
106
155
|
size: SizeType;
|
|
107
156
|
align: ProColumnType['align'];
|
|
108
157
|
options: OptionConfig | boolean;
|
|
109
158
|
rowSelection: ProTableRowSelection;
|
|
110
|
-
columns: ProColumnsType<
|
|
159
|
+
columns: ProColumnsType<DataRecord, ParamsType>;
|
|
111
160
|
columnsState: ColumnsStateType;
|
|
112
161
|
waitRequest: boolean;
|
|
113
162
|
polling: number;
|
|
114
163
|
debounceTime: number;
|
|
115
|
-
request:
|
|
116
|
-
params:
|
|
117
|
-
postData: (data:
|
|
164
|
+
request: RequestFunction<DataRecord, ParamsType>;
|
|
165
|
+
params: ParamsType;
|
|
166
|
+
postData: (data: DataRecord[]) => DataRecord[];
|
|
118
167
|
pagination: ProTablePagination;
|
|
119
|
-
search: SearchConfig;
|
|
120
|
-
searchMap: ProSearchMap[];
|
|
121
|
-
onReset: (params?: Partial<
|
|
122
|
-
onReload: (params?: Partial<
|
|
123
|
-
onSubmit: (params?: Partial<
|
|
168
|
+
search: SearchConfig | false;
|
|
169
|
+
searchMap: ProSearchMap<undefined, keyof ParamsType | keyof DataRecord>[];
|
|
170
|
+
onReset: (params?: Partial<ParamsType>) => void;
|
|
171
|
+
onReload: (params?: Partial<ParamsType>) => void;
|
|
172
|
+
onSubmit: (params?: Partial<ParamsType>) => void;
|
|
124
173
|
onSizeChange: (size: string) => any;
|
|
125
174
|
onLoadingChange: (loading: boolean) => any;
|
|
126
175
|
onRequestError: (e: Error) => void;
|
|
127
|
-
onBeforeSearchSubmit:
|
|
176
|
+
onBeforeSearchSubmit: RequestFunction<DataRecord, ParamsType>;
|
|
128
177
|
onColumnsStateChange: (data: ColumnsState[]) => void;
|
|
129
|
-
titleTip:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
178
|
+
titleTip: DefaultRender;
|
|
179
|
+
emptyText: DefaultRender;
|
|
180
|
+
headerTitle: DefaultRender;
|
|
181
|
+
toolBarBtn: DefaultRender;
|
|
182
|
+
customRender: CustomDataRender;
|
|
183
|
+
optionsExtra: DefaultRender;
|
|
184
|
+
settingExtra: DefaultRender;
|
|
135
185
|
pageItemRender: PageItemRender;
|
|
136
186
|
}>;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { ProColumnsValueType } from '../types/ColumnTypings';
|
|
2
|
-
|
|
2
|
+
import type { ProTablePagination } from '../types/TableTypings';
|
|
3
|
+
export declare function valueFormat(value: any, format: ProColumnsValueType | undefined, className: string, hashId: string): any;
|
|
4
|
+
export declare function getCurrentData(data: any[], pageInfo: ProTablePagination): any[];
|
|
5
|
+
export declare function handleCopy(codeStr: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gx-design-vue/pro-table",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.2.0-beta.111",
|
|
5
|
+
"description": "Gx Design Pro Table",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/pro-table.js",
|
|
9
|
+
"require": "./dist/pro-table.umd.cjs"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/pro-table.umd.cjs",
|
|
13
|
+
"module": "./dist/pro-table.js",
|
|
14
|
+
"types": "./dist",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"volar.d.ts"
|
|
18
|
+
],
|
|
4
19
|
"scripts": {
|
|
5
20
|
"dev": "vite",
|
|
6
21
|
"build": "vite build",
|
|
@@ -10,61 +25,24 @@
|
|
|
10
25
|
"typecheck": "vue-tsc --noEmit && vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
|
11
26
|
"lint": "TIMING=1 eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
|
12
27
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
],
|
|
17
|
-
"types": "./dist",
|
|
18
|
-
"main": "./dist/pro-table.umd.js",
|
|
19
|
-
"module": "./dist/pro-table.mjs",
|
|
20
|
-
"exports": {
|
|
21
|
-
".": {
|
|
22
|
-
"import": "./dist/pro-table.mjs",
|
|
23
|
-
"require": "./dist/pro-table.umd.js"
|
|
24
|
-
}
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"ant-design-vue": "^4.1.2",
|
|
30
|
+
"vue": ">=3.0.0"
|
|
25
31
|
},
|
|
26
32
|
"dependencies": {
|
|
33
|
+
"@gx-design-vue/pro-app": "^0.1.0-beta.25",
|
|
34
|
+
"@gx-design-vue/pro-hooks": "^0.2.0-beta.44",
|
|
35
|
+
"@gx-design-vue/pro-provider": "^0.1.0-beta.108",
|
|
36
|
+
"@gx-design-vue/pro-utils": "^0.2.0-beta.62",
|
|
27
37
|
"@vueuse/core": "^9.10.0",
|
|
28
|
-
"@gx-design-vue/pro-utils": "^0.2.0-beta.6",
|
|
29
|
-
"@gx-design-vue/pro-hooks": "^0.2.0-beta.6",
|
|
30
|
-
"@gx-design-vue/pro-provider": "^0.1.0-beta.14",
|
|
31
|
-
"ant-design-vue": "^4.0.0",
|
|
32
38
|
"dayjs": "^1.11.0",
|
|
33
|
-
"lodash-es": "^4.17.21"
|
|
34
|
-
"vue": "^3.2.45",
|
|
35
|
-
"vue-types": "^4.1.1"
|
|
39
|
+
"lodash-es": "^4.17.21"
|
|
36
40
|
},
|
|
37
41
|
"devDependencies": {
|
|
38
|
-
"@rollup/plugin-typescript": "^8.3.0",
|
|
39
|
-
"@rushstack/eslint-patch": "^1.1.0",
|
|
40
42
|
"@types/lodash-es": "^4.17.6",
|
|
41
|
-
"
|
|
42
|
-
"@types/node": "^16.11.26",
|
|
43
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
|
44
|
-
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
45
|
-
"@vue/eslint-config-prettier": "^7.0.0",
|
|
46
|
-
"@vue/eslint-config-typescript": "^10.0.0",
|
|
47
|
-
"@vue/tsconfig": "^0.1.3",
|
|
48
|
-
"eslint": "^8.13.0",
|
|
49
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
50
|
-
"eslint-plugin-vue": "^8.6.0",
|
|
51
|
-
"jsdom": "^19.0.0",
|
|
52
|
-
"less": "^4.1.2",
|
|
53
|
-
"postcss": "^8.4.12",
|
|
54
|
-
"postcss-html": "^1.4.1",
|
|
55
|
-
"postcss-less": "^6.0.0",
|
|
56
|
-
"prettier": "^2.6.2",
|
|
57
|
-
"rollup": "^2.70.2",
|
|
58
|
-
"stylelint": "^14.7.1",
|
|
59
|
-
"stylelint-config-prettier": "^9.0.3",
|
|
60
|
-
"stylelint-config-recommended": "^7.0.0",
|
|
61
|
-
"stylelint-config-recommended-vue": "^1.4.0",
|
|
62
|
-
"stylelint-config-standard": "^25.0.0",
|
|
63
|
-
"stylelint-order": "^5.0.0",
|
|
64
|
-
"typescript": "^4.6.4",
|
|
65
|
-
"vite": "^4.3.8",
|
|
66
|
-
"vue-eslint-parser": "^9.0.3",
|
|
67
|
-
"vue-tsc": "^1.0.24"
|
|
43
|
+
"typescript": "^5.3.3"
|
|
68
44
|
},
|
|
69
|
-
"
|
|
45
|
+
"authors": [
|
|
46
|
+
"gx12358 <gx12358@gmail.com> (https://github.com/gx12358)"
|
|
47
|
+
]
|
|
70
48
|
}
|
package/volar.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Auto generated component declarations
|
|
2
|
-
declare module
|
|
2
|
+
declare module 'vue' {
|
|
3
3
|
export interface GlobalComponents {
|
|
4
|
-
GProTable: typeof import(
|
|
4
|
+
GProTable: typeof import('@gx-design-vue/pro-table')['GProTable'];
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export {}
|
|
8
|
+
export {}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Ref, ComputedRef } from 'vue';
|
|
2
|
-
import type { ColumnsState } from './useColumnSetting';
|
|
3
|
-
import type { ProTableProps } from '../types/TableTypings';
|
|
4
|
-
import type { ProColumnType, ProColumnsType } from '../types/ColumnTypings';
|
|
5
|
-
export type ConfigColumns = {
|
|
6
|
-
draggabled: ComputedRef<ProTableProps['draggabled']>;
|
|
7
|
-
neverScroll: ComputedRef<ProTableProps['neverScroll']>;
|
|
8
|
-
autoScroll: ComputedRef<ProTableProps['autoScroll']>;
|
|
9
|
-
};
|
|
10
|
-
type UseColumnsType = {
|
|
11
|
-
scroll: ComputedRef<ProTableProps['scroll']>;
|
|
12
|
-
breakpoint: ComputedRef<boolean>;
|
|
13
|
-
columns: ComputedRef<ProColumnsType>;
|
|
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<ProColumnType<import("../typing").DefaultRecordType>[]>;
|
|
19
|
-
cacheProColumns: Ref<ProColumnsType<import("../typing").DefaultRecordType>>;
|
|
20
|
-
setColumns: (columnList: ProColumnsType<import("../typing").DefaultRecordType>) => void;
|
|
21
|
-
changeColumns: (columnState: Record<string, ColumnsState>) => void;
|
|
22
|
-
resizeColumnWidth: (w: number, col: ProColumnType) => void;
|
|
23
|
-
};
|
|
24
|
-
export {};
|