@gx-design-vue/pro-table 0.0.2 → 0.0.3-rc.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.
- package/dist/ProTable.d.ts +95 -95
- package/dist/_utils/ant-design-vue/table/props.d.ts +2 -1
- package/dist/_utils/ant-design-vue/table/typings.d.ts +1 -0
- package/dist/_utils/index.d.ts +0 -1
- package/dist/components/ColumnSetting/index.d.ts +1 -0
- package/dist/components/ColumnSetting/style.less +1 -3
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/style.less +1 -8
- package/dist/components/Form/useForm.d.ts +1 -0
- package/dist/components/ListToolBar/index.d.ts +13 -12
- package/dist/components/ListToolBar/style.less +1 -0
- package/dist/components/ToolBar/index.d.ts +1 -0
- package/dist/components/ToolBar/style.less +5 -29
- package/dist/context/TableContext.d.ts +2 -1
- package/dist/design/ant-design-theme.less +4 -0
- package/dist/design/ant-design-vue.less +19 -0
- package/dist/design/config.less +0 -5
- package/dist/hooks/useDebounceFn.d.ts +1 -5
- package/dist/hooks/useFetchData.d.ts +6 -4
- package/dist/hooks/useLoading.d.ts +1 -1
- package/dist/hooks/useRowSelection.d.ts +2 -0
- package/dist/hooks/useTableForm.d.ts +1 -0
- package/dist/hooks/useTableScroll.d.ts +1 -0
- package/dist/hooks/useTableSize.d.ts +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/pro-table.less +5 -0
- package/dist/pro-table.mjs +1178 -1253
- package/dist/pro-table.umd.js +1 -1
- package/dist/props.d.ts +40 -22
- package/dist/style/index.less +18 -0
- package/dist/style/table.less +0 -8
- package/dist/style.css +1 -1
- package/dist/style.less +3 -5
- package/dist/types/column.d.ts +11 -3
- package/dist/types/table.d.ts +30 -19
- package/dist/typing.d.ts +9 -0
- package/dist/utils/config.d.ts +1 -0
- package/dist/utils/utils.d.ts +2 -0
- package/package.json +11 -12
- package/dist/_utils/gx-design-vue/extract-public-props.d.ts +0 -7
- package/dist/_utils/gx-design-vue/index.d.ts +0 -2
- package/dist/_utils/gx-design-vue/typings.d.ts +0 -1
- package/dist/hooks/core/index.d.ts +0 -3
- package/dist/hooks/core/useMemo.d.ts +0 -10
- package/dist/hooks/core/useTimeout.d.ts +0 -11
- package/dist/typings/components.d.ts +0 -6
- package/dist/utils/index.d.ts +0 -86
- package/dist/utils/validate.d.ts +0 -25
package/dist/style.less
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
@import './
|
|
2
|
-
@import './
|
|
3
|
-
@import './
|
|
4
|
-
@import './components/ListToolBar/style.less';
|
|
5
|
-
@import './components/ToolBar/style.less';
|
|
1
|
+
@import './design/ant-design-theme.less';
|
|
2
|
+
@import './design/ant-design-vue.less';
|
|
3
|
+
@import './pro-table.less';
|
package/dist/types/column.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { VNodeChild } from 'vue';
|
|
2
2
|
import type { TooltipProps } from 'ant-design-vue/es/tooltip/Tooltip';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RecordType, VueNode, Breakpoint } from '../typing';
|
|
4
|
+
import type { ColumnFilterItem, ColumnTitle, CompareFn, FilterDropdownProps, FilterValue, Key, SortOrder, AlignType, CellEllipsisType, DataIndex, FixedType, GetComponentProps, RenderedCell } from '../_utils';
|
|
4
5
|
/**
|
|
5
6
|
* @param text 文本框
|
|
6
7
|
* @param date 日期 YYYY-MM-DD
|
|
@@ -18,7 +19,7 @@ export declare type ProFieldValueType = 'text' | 'date' | 'select' | 'treeSelect
|
|
|
18
19
|
* @param time: 时间 HH:mm:ss
|
|
19
20
|
* @param select 下拉选择器
|
|
20
21
|
*/
|
|
21
|
-
export declare type ProFieldValueFormat = 'data' | 'dateMonth' | 'dateRange' | '
|
|
22
|
+
export declare type ProFieldValueFormat = 'data' | 'dateMonth' | 'dateRange' | 'time';
|
|
22
23
|
export declare type ProSchemaValueEnumType = {
|
|
23
24
|
/** @name 演示的文案 */
|
|
24
25
|
text: VNodeChild | JSX.Element;
|
|
@@ -33,7 +34,7 @@ export declare type ProSearchMap<ValueType = 'text', ValueFormat = 'date'> = {
|
|
|
33
34
|
name?: string;
|
|
34
35
|
/** 选择如何渲染相应的模式 */
|
|
35
36
|
valueType?: ProSchemaValueType<ValueType>;
|
|
36
|
-
|
|
37
|
+
valueFormat?: ProSchemaValueFormat<ValueFormat>;
|
|
37
38
|
placeholder?: string | string[];
|
|
38
39
|
/** valueType为select生效 */
|
|
39
40
|
allowClear?: boolean;
|
|
@@ -142,6 +143,13 @@ export declare type ProColumn = {
|
|
|
142
143
|
copyable?: boolean;
|
|
143
144
|
/** 值为空时,默认取值 */
|
|
144
145
|
columnEmptyText?: string;
|
|
146
|
+
valueType?: ProColumnsValueType;
|
|
147
|
+
};
|
|
148
|
+
export declare type ProColumnsValueType = 'text' | 'link' | 'time' | 'dateMonth' | 'dateTime' | {
|
|
149
|
+
node?: string;
|
|
150
|
+
class?: string;
|
|
151
|
+
attr?: string;
|
|
152
|
+
click?: () => void;
|
|
145
153
|
};
|
|
146
154
|
export declare type ProColumns = ProColumn[];
|
|
147
155
|
export {};
|
package/dist/types/table.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VNodeChild } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RecordType, VueNode, Breakpoint, WithFalse, CustomRender } from '../typing';
|
|
3
|
+
import type { TableRowSelection, TablePaginationConfig, SpinProps } from '../_utils';
|
|
3
4
|
export declare type ProTabelFeachParams = {
|
|
4
5
|
params?: any;
|
|
5
6
|
filters?: any;
|
|
@@ -9,29 +10,32 @@ export declare type ProTabelFeachParams = {
|
|
|
9
10
|
immediate?: boolean;
|
|
10
11
|
isPolling?: boolean;
|
|
11
12
|
};
|
|
13
|
+
export declare type TablePaginationPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
12
14
|
export declare type ProFieldEmptyText = string | false;
|
|
13
15
|
export declare type ProTableRowSelection<T = any> = TableRowSelection<T> & {
|
|
14
16
|
defaultSelectKeys: (string | number)[];
|
|
15
17
|
defaultSelectRows: T[];
|
|
16
18
|
};
|
|
17
|
-
export
|
|
19
|
+
export interface ProTablePaginationConfig extends Omit<TablePaginationConfig, 'position'> {
|
|
18
20
|
total?: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
position?: string;
|
|
22
|
-
};
|
|
21
|
+
position?: TablePaginationPosition[];
|
|
22
|
+
}
|
|
23
23
|
export declare type ProTablePagination = ProTablePaginationConfig | false;
|
|
24
24
|
export declare type SortOrder = 'descend' | 'ascend' | null;
|
|
25
|
-
export declare type RequestData = {
|
|
26
|
-
data:
|
|
27
|
-
success
|
|
28
|
-
total
|
|
25
|
+
export declare type RequestData<T = any> = {
|
|
26
|
+
data: T[] | undefined;
|
|
27
|
+
success: boolean;
|
|
28
|
+
total: number;
|
|
29
29
|
} & RecordType;
|
|
30
|
-
export declare type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
30
|
+
export declare type RequsetConfig = {
|
|
31
|
+
params: {
|
|
32
|
+
pageSize?: number;
|
|
33
|
+
pageNum?: number;
|
|
34
|
+
};
|
|
35
|
+
sort: Record<string, SortOrder>;
|
|
36
|
+
filter: Record<string, any[] | null>;
|
|
37
|
+
};
|
|
38
|
+
export declare type RequsetFunction<T = any> = (params: RequsetConfig['params'], sort: RequsetConfig['sort'], filter: RequsetConfig['filter']) => Promise<Partial<RequestData<T>>>;
|
|
35
39
|
export declare type ColConfig = Partial<Record<Breakpoint, number>>;
|
|
36
40
|
export declare type SearchConfig = {
|
|
37
41
|
searchText?: string;
|
|
@@ -56,8 +60,8 @@ export interface OptionConfig {
|
|
|
56
60
|
fullScreen?: (() => VNodeChild | JSX.Element) | boolean | (() => Promise<void>);
|
|
57
61
|
}
|
|
58
62
|
export declare type ProCoreActionTypeConfig = {
|
|
59
|
-
formParams?: RecordType;
|
|
60
63
|
pageParams?: RecordType | boolean;
|
|
64
|
+
getLoadingStatus?: boolean | SpinProps | undefined;
|
|
61
65
|
/** @name 刷新 */
|
|
62
66
|
reload?: (info?: ProTabelFeachParams) => void;
|
|
63
67
|
/** @name 刷新并清空表单,重置为第一页 */
|
|
@@ -67,12 +71,19 @@ export declare type ProCoreActionTypeConfig = {
|
|
|
67
71
|
/** @name 更新TableData属性值 */
|
|
68
72
|
reSetDataList?: (data: RecordType[]) => void;
|
|
69
73
|
/** @name 更新TableData属性值 */
|
|
70
|
-
changeDataValue?: ({ key,
|
|
74
|
+
changeDataValue?: ({ key, params }: {
|
|
71
75
|
key?: string;
|
|
72
|
-
|
|
76
|
+
params: RecordType;
|
|
73
77
|
}) => void;
|
|
74
78
|
/** @name 改变loading状态 */
|
|
75
79
|
loadingOperation?: (loading: boolean) => void;
|
|
76
80
|
};
|
|
77
81
|
/** 操作类型 */
|
|
78
|
-
export declare type ProCoreActionType = (
|
|
82
|
+
export declare type ProCoreActionType = (config: ProCoreActionTypeConfig) => void;
|
|
83
|
+
export declare type ProCoreFormTypeConfig = {
|
|
84
|
+
formParams?: RecordType;
|
|
85
|
+
/** @name 刷新 */
|
|
86
|
+
restForm?: () => void;
|
|
87
|
+
};
|
|
88
|
+
/** 操作类型 */
|
|
89
|
+
export declare type ProCoreFormType = (config: ProCoreFormTypeConfig) => void;
|
package/dist/typing.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Slot, VNode, VNodeChild, PropType as VuePropType } from 'vue';
|
|
2
|
+
export declare type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
3
|
+
export declare type WithFalse<T> = T | false;
|
|
4
|
+
export declare type RecordType = Record<string, any>;
|
|
5
|
+
export declare type PropType<T> = VuePropType<T>;
|
|
6
|
+
export declare type VueNode = VNodeChild | JSX.Element;
|
|
7
|
+
export declare type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
8
|
+
export declare type ProVueNode = VueNode | VueNode[] | WithFalse<() => CustomRender>;
|
|
9
|
+
export declare type CustomRender = Slot | VNodeChild | VNode | ((...props: any[]) => Slot) | ((...props: any[]) => VNode) | ((...args: any[]) => VNode) | VNode[] | JSX.Element | string | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const proTableSlots: string[];
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gx-design-vue/pro-table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-rc.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite",
|
|
6
|
-
"build": "
|
|
6
|
+
"build": "vite build",
|
|
7
7
|
"types": "vue-tsc --declaration --emitDeclarationOnly",
|
|
8
8
|
"preview": "vite preview --port 5050",
|
|
9
9
|
"test:unit": "vitest --environment jsdom",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"./dist/style.less": "./dist/style.less"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@vueuse/core": "^
|
|
30
|
-
"
|
|
29
|
+
"@vueuse/core": "^6.8.0",
|
|
30
|
+
"@gx-design-vue/pro-utils": "0.0.5-rc.04",
|
|
31
|
+
"@gx-design-vue/pro-hooks": "0.0.1-rc.05",
|
|
32
|
+
"ant-design-vue": "^3.2.15",
|
|
31
33
|
"dayjs": "^1.11.0",
|
|
32
34
|
"lodash-es": "^4.17.21",
|
|
33
|
-
"
|
|
34
|
-
"vue": "3.2.39",
|
|
35
|
-
"vue-router": "^4.0.14",
|
|
35
|
+
"vue": "^3.0.0",
|
|
36
36
|
"vue-types": "^4.1.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@types/lodash-es": "^4.17.6",
|
|
43
43
|
"@types/jsdom": "^16.2.14",
|
|
44
44
|
"@types/node": "^16.11.26",
|
|
45
|
-
"@vitejs/plugin-vue": "3.1.0",
|
|
46
|
-
"@vitejs/plugin-vue-jsx": "2.0.1",
|
|
45
|
+
"@vitejs/plugin-vue": "^3.1.0",
|
|
46
|
+
"@vitejs/plugin-vue-jsx": "^2.0.1",
|
|
47
47
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
48
48
|
"@vue/eslint-config-typescript": "^10.0.0",
|
|
49
49
|
"@vue/test-utils": "^2.0.0-rc.18",
|
|
@@ -65,9 +65,8 @@
|
|
|
65
65
|
"stylelint-config-standard": "^25.0.0",
|
|
66
66
|
"stylelint-order": "^5.0.0",
|
|
67
67
|
"typescript": "^4.6.4",
|
|
68
|
-
"vite": "3.1.3",
|
|
69
|
-
"
|
|
70
|
-
"vue-eslint-parser": "9.0.3",
|
|
68
|
+
"vite": "^3.1.3",
|
|
69
|
+
"vue-eslint-parser": "^9.0.3",
|
|
71
70
|
"vue-tsc": "0.39.4"
|
|
72
71
|
},
|
|
73
72
|
"description": "Gx Design"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ExtractPropTypes } from 'vue';
|
|
2
|
-
declare type RemoveReadonly<T> = {
|
|
3
|
-
-readonly [key in keyof T]: T[key];
|
|
4
|
-
};
|
|
5
|
-
export declare type ExtractPublicPropTypes<T> = Omit<Partial<RemoveReadonly<ExtractPropTypes<T>>>, Extract<keyof T, `internal${string}`>>;
|
|
6
|
-
export declare type ExtractInternalPropTypes<T> = Partial<ExtractPropTypes<T>>;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { ProTablePagination } from '../types/table';
|
|
2
|
-
import type { AlignType } from '../_utils';
|
|
3
|
-
import type { ProSearchMap } from '../types/column';
|
|
4
|
-
import type { ProColumns } from '../types/column';
|
|
5
|
-
export declare const proTableSlots: string[];
|
|
6
|
-
/**
|
|
7
|
-
* 根据 key 和 dataIndex 生成唯一 id
|
|
8
|
-
*
|
|
9
|
-
* @param key 用户设置的 key
|
|
10
|
-
* @param dataIndex 在对象中的数据
|
|
11
|
-
* @param index 序列号,理论上唯一
|
|
12
|
-
*/
|
|
13
|
-
export declare const genColumnKey: (key?: string | number | undefined, index?: number) => string;
|
|
14
|
-
export declare function handleShowIndex(columns: ProColumns, { align, showIndex }: {
|
|
15
|
-
align: AlignType;
|
|
16
|
-
showIndex: boolean;
|
|
17
|
-
}): ProColumns;
|
|
18
|
-
export declare function handleFormDefaultValue(data: ProSearchMap[]): any;
|
|
19
|
-
/**
|
|
20
|
-
* @Author gx12358
|
|
21
|
-
* @DateTime 2021/11/3
|
|
22
|
-
* @lastTime 2021/11/3
|
|
23
|
-
* @description 如果是个方法执行一下它
|
|
24
|
-
*/
|
|
25
|
-
export declare function runFunction<T extends any[]>(valueEnum: any, ...rest: T): any;
|
|
26
|
-
/**
|
|
27
|
-
* @Author gx12358
|
|
28
|
-
* @DateTime 2022/10/11
|
|
29
|
-
* @lastTime 2022/10/11
|
|
30
|
-
* @description 简单深拷贝下
|
|
31
|
-
*/
|
|
32
|
-
export declare function deepCopy(data: object | any[]): any;
|
|
33
|
-
/**
|
|
34
|
-
* @Author gx12358
|
|
35
|
-
* @DateTime 2021/1/28
|
|
36
|
-
* @lastTime 2021/1/28
|
|
37
|
-
* @description 判断删除是否到当前页最后一条
|
|
38
|
-
*/
|
|
39
|
-
export declare function handleCurrentPage(pageConfig: {
|
|
40
|
-
current: number;
|
|
41
|
-
pageSize: number | undefined;
|
|
42
|
-
total: number | undefined;
|
|
43
|
-
} | undefined, number: number): number;
|
|
44
|
-
/**
|
|
45
|
-
* @Author gaoxiang
|
|
46
|
-
* @DateTime 2020/7/24
|
|
47
|
-
* @lastTime 2020/7/24
|
|
48
|
-
* @description 数组(树形)添加序号
|
|
49
|
-
*/
|
|
50
|
-
export declare function getSortIndex(data?: any[], pageConfig?: ProTablePagination, childrenKey?: string): any;
|
|
51
|
-
/**
|
|
52
|
-
* @Author gaoxiang
|
|
53
|
-
* @DateTime 2019/11/29
|
|
54
|
-
* @lastTime 2019/11/29
|
|
55
|
-
* @description 排序(从小到大)
|
|
56
|
-
*/
|
|
57
|
-
export declare function compareToMax(obj1: RecordType, obj2: RecordType, key: string): number;
|
|
58
|
-
/**
|
|
59
|
-
* @Author gaoxiang
|
|
60
|
-
* @DateTime 2019/12/11
|
|
61
|
-
* @lastTime 2019/12/11
|
|
62
|
-
* @description 数组去重
|
|
63
|
-
*/
|
|
64
|
-
export declare function arrayRepeat(data: any[]): any;
|
|
65
|
-
/**
|
|
66
|
-
* @Author gaoxiang
|
|
67
|
-
* @DateTime 2020/8/26
|
|
68
|
-
* @lastTime 2020/8/26
|
|
69
|
-
* @description 处理表格字段为空
|
|
70
|
-
*/
|
|
71
|
-
export declare function hanndleField(str: any, customize: any): {
|
|
72
|
-
value: any;
|
|
73
|
-
success: boolean;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* @Author gaoxiang
|
|
77
|
-
* @DateTime 2019/11/29
|
|
78
|
-
* @lastTime 2019/11/29
|
|
79
|
-
* @description 随机uuid
|
|
80
|
-
*/
|
|
81
|
-
export declare function getRandomNumber(): {
|
|
82
|
-
uuid(len?: number, rad?: number): any;
|
|
83
|
-
uuidFast(): string;
|
|
84
|
-
uuidString(): string;
|
|
85
|
-
uuidCompact(): string;
|
|
86
|
-
};
|
package/dist/utils/validate.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare function is(val: unknown, type: string): boolean;
|
|
2
|
-
export declare function isBoolean(val: unknown): val is boolean;
|
|
3
|
-
export declare function isNumber(val: unknown): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* @author gx12358 2539306317@qq.com
|
|
6
|
-
* @description 判断是否是数组
|
|
7
|
-
* @param arg
|
|
8
|
-
* @returns {arg is any[]|boolean}
|
|
9
|
-
*/
|
|
10
|
-
export declare function isArray(arg: unknown): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* @Author gaoxiang
|
|
13
|
-
* @DateTime 2019/11/29
|
|
14
|
-
* @lastTime 2019/11/29
|
|
15
|
-
* @description 是否是对象
|
|
16
|
-
*/
|
|
17
|
-
export declare function isObject(val: any): val is Record<any, any>;
|
|
18
|
-
/**
|
|
19
|
-
* @author gx12358 2539306317@qq.com
|
|
20
|
-
* @description 判断是否是字符串
|
|
21
|
-
* @param value
|
|
22
|
-
* @returns {boolean}
|
|
23
|
-
*/
|
|
24
|
-
export declare function isString(value: unknown): boolean;
|
|
25
|
-
export declare function isFunction(func: any): boolean;
|