@gx-design-vue/pro-table 0.2.0-alpha.22 → 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/ScrollBar/Bar.d.ts +1 -1
- package/dist/components/SearchForm/CollapseToggle.d.ts +1 -1
- package/dist/components/SearchForm/FormItemContainer.d.ts +1 -1
- package/dist/components/SearchForm/FormItemWrapper.d.ts +1 -1
- package/dist/components/SearchForm/SearchForm.d.ts +4 -4
- package/dist/components/Toolbar/ListToolBar.d.ts +5 -5
- package/dist/components/Toolbar/index.d.ts +5 -5
- package/dist/hooks/useTable.d.ts +1 -0
- package/dist/hooks/useTable.js +10 -5
- package/dist/pro-table.esm.js +369 -260
- package/dist/pro-table.js +3 -3
- package/package.json +4 -4
|
@@ -79,11 +79,11 @@ declare const DragHandle: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
79
79
|
};
|
|
80
80
|
}>> & Readonly<{}>, {
|
|
81
81
|
prefixCls: string;
|
|
82
|
-
hashId: string;
|
|
83
82
|
record: Record<string, any>;
|
|
84
83
|
handleRender: Function;
|
|
85
84
|
index: number;
|
|
86
85
|
disabled: boolean;
|
|
86
|
+
hashId: string;
|
|
87
87
|
cssVarCls: string;
|
|
88
88
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
89
89
|
//#endregion
|
|
@@ -68,11 +68,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
68
68
|
};
|
|
69
69
|
}>> & Readonly<{}>, {
|
|
70
70
|
readonly always: boolean;
|
|
71
|
+
readonly minSize: number;
|
|
71
72
|
readonly barStyle: {
|
|
72
73
|
x: CSSProperties;
|
|
73
74
|
y: CSSProperties;
|
|
74
75
|
};
|
|
75
|
-
readonly minSize: number;
|
|
76
76
|
readonly hasScrollY: boolean;
|
|
77
77
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
78
78
|
//#endregion
|
|
@@ -45,9 +45,9 @@ declare const CollapseToggle: import("vue").DefineComponent<import("vue").Extrac
|
|
|
45
45
|
required: true;
|
|
46
46
|
};
|
|
47
47
|
}>> & Readonly<{}>, {
|
|
48
|
+
hashId: string;
|
|
48
49
|
collapsed: boolean;
|
|
49
50
|
collapseRender: WithFalse<(collapsed?: boolean) => CustomRender>;
|
|
50
|
-
hashId: string;
|
|
51
51
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { CollapseToggle };
|
|
@@ -65,8 +65,8 @@ declare const FormItemContainer: import("vue").DefineComponent<import("vue").Ext
|
|
|
65
65
|
default: any;
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
|
-
loading: boolean;
|
|
69
68
|
autoRequest: boolean;
|
|
69
|
+
loading: boolean;
|
|
70
70
|
onSubmit: () => void;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
//#endregion
|
|
@@ -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,10 @@ declare const ProTableSearchForm: import("vue").DefineComponent<import("vue").Ex
|
|
|
109
109
|
default: any;
|
|
110
110
|
};
|
|
111
111
|
}>> & Readonly<{}>, {
|
|
112
|
+
loading: any;
|
|
113
|
+
onReset: (params: Record<string, any>) => void;
|
|
114
|
+
proClasses: Record<string, string>;
|
|
115
|
+
proStyles: Record<string, any>;
|
|
112
116
|
formColumns: ProSearchMap<"text", string>[];
|
|
113
117
|
formConfig: FormConfig;
|
|
114
118
|
formAutoRequest: boolean;
|
|
@@ -118,11 +122,7 @@ declare const ProTableSearchForm: import("vue").DefineComponent<import("vue").Ex
|
|
|
118
122
|
searchText?: string;
|
|
119
123
|
resetText?: string;
|
|
120
124
|
};
|
|
121
|
-
loading: any;
|
|
122
125
|
cardBordered: boolean;
|
|
123
|
-
proClasses: Record<string, string>;
|
|
124
|
-
proStyles: Record<string, any>;
|
|
125
|
-
onReset: (params: Record<string, any>) => void;
|
|
126
126
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
127
127
|
//#endregion
|
|
128
128
|
export { ProTableSearchForm as default };
|
|
@@ -91,19 +91,19 @@ declare const ListToolBar: import("vue").DefineComponent<import("vue").ExtractPr
|
|
|
91
91
|
default: () => {};
|
|
92
92
|
};
|
|
93
93
|
}>> & Readonly<{}>, {
|
|
94
|
-
actions: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
95
|
-
[key: string]: any;
|
|
96
|
-
}>[];
|
|
97
|
-
proClasses: Record<string, any>;
|
|
98
|
-
proStyles: Record<string, any>;
|
|
99
94
|
headerTitle: any;
|
|
100
95
|
headerTitleTip: any;
|
|
101
96
|
titleTipText: string;
|
|
102
97
|
settings: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
103
98
|
[key: string]: any;
|
|
104
99
|
}>[];
|
|
100
|
+
actions: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
101
|
+
[key: string]: any;
|
|
102
|
+
}>[];
|
|
105
103
|
actionsPlacement: ToolbarPlacement;
|
|
106
104
|
listToolAfter: any;
|
|
105
|
+
proClasses: Record<string, any>;
|
|
106
|
+
proStyles: Record<string, any>;
|
|
107
107
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
108
108
|
//#endregion
|
|
109
109
|
export { ListToolBar, ListToolBarSetting };
|
|
@@ -85,16 +85,16 @@ declare const Toolbar: import("vue").DefineComponent<import("vue").ExtractPropTy
|
|
|
85
85
|
default: () => {};
|
|
86
86
|
};
|
|
87
87
|
}>> & Readonly<{}>, {
|
|
88
|
-
actions: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
89
|
-
[key: string]: any;
|
|
90
|
-
}>[];
|
|
91
|
-
proClasses: Record<string, any>;
|
|
92
|
-
proStyles: Record<string, any>;
|
|
93
88
|
headerTitle: any;
|
|
94
89
|
headerTitleTip: any;
|
|
95
90
|
titleTipText: string;
|
|
91
|
+
actions: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
}>[];
|
|
96
94
|
actionsPlacement: ToolbarPlacement;
|
|
97
95
|
listToolAfter: any;
|
|
96
|
+
proClasses: Record<string, any>;
|
|
97
|
+
proStyles: Record<string, any>;
|
|
98
98
|
options: any;
|
|
99
99
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
100
100
|
//#endregion
|
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
|
}
|