@gx-design-vue/pro-table 0.2.0-alpha.21 → 0.2.0-alpha.23
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/components/Drag/Handle.d.ts +1 -1
- package/dist/components/EllipsisText/index.d.ts +1 -1
- package/dist/components/SearchForm/FormItemContainer.d.ts +2 -2
- package/dist/components/SearchForm/FormItemWrapper.d.ts +1 -1
- package/dist/components/SearchForm/SearchForm.d.ts +1 -1
- package/dist/components/Toolbar/ListToolBar.d.ts +6 -6
- package/dist/components/Toolbar/index.d.ts +4 -4
- package/dist/hooks/useBreakpoints.js +1 -0
- package/dist/hooks/useTable.d.ts +1 -0
- package/dist/hooks/useTable.js +10 -5
- package/dist/interface.d.ts +2 -1
- package/dist/pro-table.esm.js +370 -260
- package/dist/pro-table.js +3 -3
- package/package.json +9 -9
|
@@ -79,8 +79,8 @@ declare const DragHandle: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
79
79
|
};
|
|
80
80
|
}>> & Readonly<{}>, {
|
|
81
81
|
prefixCls: string;
|
|
82
|
-
handleRender: Function;
|
|
83
82
|
record: Record<string, any>;
|
|
83
|
+
handleRender: Function;
|
|
84
84
|
index: number;
|
|
85
85
|
disabled: boolean;
|
|
86
86
|
hashId: string;
|
|
@@ -43,8 +43,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
43
43
|
default: string;
|
|
44
44
|
};
|
|
45
45
|
}>> & Readonly<{}>, {
|
|
46
|
-
hashId: string;
|
|
47
46
|
text: string;
|
|
47
|
+
hashId: string;
|
|
48
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { _default as default };
|
|
@@ -65,9 +65,9 @@ declare const FormItemContainer: import("vue").DefineComponent<import("vue").Ext
|
|
|
65
65
|
default: any;
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
|
-
onSubmit: () => void;
|
|
69
|
-
loading: boolean;
|
|
70
68
|
autoRequest: boolean;
|
|
69
|
+
loading: boolean;
|
|
70
|
+
onSubmit: () => void;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
//#endregion
|
|
73
73
|
export { FormItemContainer };
|
|
@@ -68,8 +68,8 @@ declare const FormItemWrapper: import("vue").DefineComponent<import("vue").Extra
|
|
|
68
68
|
default: any;
|
|
69
69
|
};
|
|
70
70
|
}>> & Readonly<{}>, {
|
|
71
|
-
label: any;
|
|
72
71
|
hashId: string;
|
|
72
|
+
label: any;
|
|
73
73
|
labelWidth: string | number;
|
|
74
74
|
labelAlign: "left" | "right" | "center";
|
|
75
75
|
colon: boolean;
|
|
@@ -109,6 +109,7 @@ declare const ProTableSearchForm: import("vue").DefineComponent<import("vue").Ex
|
|
|
109
109
|
default: any;
|
|
110
110
|
};
|
|
111
111
|
}>> & Readonly<{}>, {
|
|
112
|
+
loading: any;
|
|
112
113
|
onReset: (params: Record<string, any>) => void;
|
|
113
114
|
proClasses: Record<string, string>;
|
|
114
115
|
proStyles: Record<string, any>;
|
|
@@ -121,7 +122,6 @@ declare const ProTableSearchForm: import("vue").DefineComponent<import("vue").Ex
|
|
|
121
122
|
searchText?: string;
|
|
122
123
|
resetText?: string;
|
|
123
124
|
};
|
|
124
|
-
loading: any;
|
|
125
125
|
cardBordered: boolean;
|
|
126
126
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
127
127
|
//#endregion
|
|
@@ -91,19 +91,19 @@ declare const ListToolBar: import("vue").DefineComponent<import("vue").ExtractPr
|
|
|
91
91
|
default: () => {};
|
|
92
92
|
};
|
|
93
93
|
}>> & Readonly<{}>, {
|
|
94
|
+
headerTitle: any;
|
|
95
|
+
headerTitleTip: any;
|
|
94
96
|
titleTipText: string;
|
|
95
|
-
|
|
97
|
+
settings: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
98
|
+
[key: string]: any;
|
|
99
|
+
}>[];
|
|
96
100
|
actions: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
97
101
|
[key: string]: any;
|
|
98
102
|
}>[];
|
|
99
|
-
|
|
103
|
+
actionsPlacement: ToolbarPlacement;
|
|
100
104
|
listToolAfter: any;
|
|
101
|
-
headerTitleTip: any;
|
|
102
105
|
proClasses: Record<string, any>;
|
|
103
106
|
proStyles: Record<string, any>;
|
|
104
|
-
settings: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
105
|
-
[key: string]: any;
|
|
106
|
-
}>[];
|
|
107
107
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
108
108
|
//#endregion
|
|
109
109
|
export { ListToolBar, ListToolBarSetting };
|
|
@@ -85,17 +85,17 @@ declare const Toolbar: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
85
85
|
default: () => {};
|
|
86
86
|
};
|
|
87
87
|
}>> & Readonly<{}>, {
|
|
88
|
-
|
|
88
|
+
headerTitle: any;
|
|
89
|
+
headerTitleTip: any;
|
|
89
90
|
titleTipText: string;
|
|
90
|
-
actionsPlacement: ToolbarPlacement;
|
|
91
91
|
actions: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
92
92
|
[key: string]: any;
|
|
93
93
|
}>[];
|
|
94
|
-
|
|
94
|
+
actionsPlacement: ToolbarPlacement;
|
|
95
95
|
listToolAfter: any;
|
|
96
|
-
headerTitleTip: any;
|
|
97
96
|
proClasses: Record<string, any>;
|
|
98
97
|
proStyles: Record<string, any>;
|
|
98
|
+
options: any;
|
|
99
99
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
100
100
|
//#endregion
|
|
101
101
|
export { Toolbar, Toolbar as default };
|
|
@@ -51,6 +51,7 @@ function getBreakpointRowLength(config, rootWidth) {
|
|
|
51
51
|
return span;
|
|
52
52
|
}
|
|
53
53
|
function getColSpanRowLength(colSpan, rootScreen) {
|
|
54
|
+
if (typeof colSpan === "number") return colSpan;
|
|
54
55
|
let span = 4;
|
|
55
56
|
for (let i = 0; i < DEFAULT_BREAKPOINT_SPANS.length; i += 1) {
|
|
56
57
|
const breakpoint = DEFAULT_BREAKPOINT_SPANS[i].breakpoint;
|
package/dist/hooks/useTable.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { FilterValue, SorterResult, TableCurrentDataSource } from "antdv-next/di
|
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useTable.d.ts
|
|
6
6
|
interface UseTableOptions<T = any, R = any> {
|
|
7
|
+
/** 初始状态与后续外部增量;未变化字段不会覆盖 tableState 的运行时修改 */
|
|
7
8
|
state?: MaybeRef<Partial<ProTableProps<T, R>>> | Reactive<Partial<ProTableProps<T, R>>>;
|
|
8
9
|
request?: RequestFunction<T, R>;
|
|
9
10
|
}
|
package/dist/hooks/useTable.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, reactive, ref, toValue, watch } from "vue";
|
|
2
2
|
import { merge } from "@gx-design-vue/pro-utils";
|
|
3
|
+
import { cloneDeep as cloneDeep$1, isEqual } from "es-toolkit";
|
|
3
4
|
//#region src/hooks/useTable.ts
|
|
4
5
|
const EMPTY_ARRAY = [];
|
|
5
6
|
function useTable(tableRef, options) {
|
|
@@ -7,16 +8,20 @@ function useTable(tableRef, options) {
|
|
|
7
8
|
params: {},
|
|
8
9
|
searchMap: []
|
|
9
10
|
});
|
|
10
|
-
const
|
|
11
|
+
const sourceStateSnapshots = /* @__PURE__ */ new Map();
|
|
11
12
|
function syncTableState(state = {}) {
|
|
12
|
-
for (const key of
|
|
13
|
+
for (const key of sourceStateSnapshots.keys()) if (!(key in state)) {
|
|
13
14
|
delete tableState[key];
|
|
14
|
-
|
|
15
|
+
sourceStateSnapshots.delete(key);
|
|
15
16
|
}
|
|
16
17
|
for (const key of Object.keys(state)) {
|
|
17
18
|
const nextValue = state[key];
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const hasSnapshot = sourceStateSnapshots.has(key);
|
|
20
|
+
const previousSourceValue = sourceStateSnapshots.get(key);
|
|
21
|
+
if (!hasSnapshot || !isEqual(previousSourceValue, nextValue)) {
|
|
22
|
+
tableState[key] = nextValue;
|
|
23
|
+
sourceStateSnapshots.set(key, cloneDeep$1(nextValue));
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
if (options?.request) tableState.request = options.request;
|
|
22
27
|
}
|
package/dist/interface.d.ts
CHANGED
|
@@ -22,7 +22,8 @@ interface ToolbarOptionConfig {
|
|
|
22
22
|
reload?: boolean | ((onClick: () => void) => CustomRender);
|
|
23
23
|
fullScreen?: boolean | (() => Promise<void>);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
/** 支持纯数字(如 2 表示所有断点统一列数)或按断点配置(如 { xl: 4, lg: 3 }) */
|
|
26
|
+
type ColConfig = number | Partial<Record<Breakpoint, number>>;
|
|
26
27
|
interface FormConfig {
|
|
27
28
|
className?: string;
|
|
28
29
|
/**
|