@gx-design-vue/pro-table 0.2.0-alpha.13 → 0.2.0-alpha.15
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.js +9 -0
- package/dist/components/ScrollBar/Thumb.d.ts +1 -1
- package/dist/components/SearchForm/FormItemWrapper.d.ts +2 -2
- package/dist/components/SearchForm/SearchForm.d.ts +3 -3
- package/dist/components/Toolbar/ListToolBar.d.ts +8 -8
- package/dist/components/Toolbar/index.d.ts +5 -5
- package/dist/hooks/useTable.js +10 -5
- package/dist/pro-table.esm.js +217 -205
- package/dist/pro-table.js +1 -1
- package/package.json +4 -4
package/dist/ProTable.js
CHANGED
|
@@ -249,6 +249,15 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
249
249
|
};
|
|
250
250
|
continue;
|
|
251
251
|
}
|
|
252
|
+
if (key === "expandable") {
|
|
253
|
+
const userExpandable = props.expandable;
|
|
254
|
+
const controlledExpandedRowKeys = props.expandedRowKeys;
|
|
255
|
+
if (userExpandable !== void 0 || controlledExpandedRowKeys !== void 0) result.expandable = {
|
|
256
|
+
...userExpandable ?? {},
|
|
257
|
+
...controlledExpandedRowKeys !== void 0 ? { expandedRowKeys: controlledExpandedRowKeys } : {}
|
|
258
|
+
};
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
252
261
|
const val = props[key];
|
|
253
262
|
if (val !== void 0) result[key] = val;
|
|
254
263
|
}
|
|
@@ -44,9 +44,9 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
44
44
|
readonly default: () => {};
|
|
45
45
|
};
|
|
46
46
|
}>> & Readonly<{}>, {
|
|
47
|
-
readonly vertical: boolean;
|
|
48
47
|
readonly always: boolean;
|
|
49
48
|
readonly barStyle: CSSProperties;
|
|
49
|
+
readonly vertical: boolean;
|
|
50
50
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
51
51
|
//#endregion
|
|
52
52
|
export { _default as default, thumbProps };
|
|
@@ -70,11 +70,11 @@ declare const FormItemWrapper: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
70
70
|
default: any;
|
|
71
71
|
};
|
|
72
72
|
}>> & Readonly<{}>, {
|
|
73
|
+
hashId: string;
|
|
73
74
|
label: any;
|
|
74
75
|
labelWidth: string | number;
|
|
75
|
-
labelAlign: "left" | "
|
|
76
|
+
labelAlign: "left" | "center" | "right";
|
|
76
77
|
colon: boolean;
|
|
77
|
-
hashId: string;
|
|
78
78
|
formItemStyle: CSSProperties;
|
|
79
79
|
globalLabelGap: number;
|
|
80
80
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
@@ -112,6 +112,9 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
112
112
|
};
|
|
113
113
|
}>> & Readonly<{}>, {
|
|
114
114
|
loading: any;
|
|
115
|
+
onReset: (params: Record<string, any>) => void;
|
|
116
|
+
proClasses: Record<string, string>;
|
|
117
|
+
proStyles: Record<string, any>;
|
|
115
118
|
formColumns: ProSearchMap<"text", string>[];
|
|
116
119
|
formConfig: FormConfig;
|
|
117
120
|
formAutoRequest: boolean;
|
|
@@ -122,9 +125,6 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
122
125
|
resetText?: string;
|
|
123
126
|
};
|
|
124
127
|
cardBordered: boolean;
|
|
125
|
-
proClasses: Record<string, string>;
|
|
126
|
-
proStyles: Record<string, any>;
|
|
127
|
-
onReset: (params: Record<string, any>) => void;
|
|
128
128
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
129
129
|
//#endregion
|
|
130
130
|
export { ProTableSearchForm as default };
|
|
@@ -93,19 +93,19 @@ declare const ListToolBar: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
93
93
|
default: () => {};
|
|
94
94
|
};
|
|
95
95
|
}>> & Readonly<{}>, {
|
|
96
|
-
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
97
|
-
[key: string]: any;
|
|
98
|
-
}>[];
|
|
99
|
-
proClasses: Record<string, any>;
|
|
100
|
-
proStyles: Record<string, any>;
|
|
101
|
-
titleTipText: string;
|
|
102
|
-
actionsPlacement: ToolbarPlacement;
|
|
103
96
|
headerTitle: any;
|
|
104
|
-
listToolAfter: any;
|
|
105
97
|
headerTitleTip: any;
|
|
98
|
+
titleTipText: string;
|
|
106
99
|
settings: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
107
100
|
[key: string]: any;
|
|
108
101
|
}>[];
|
|
102
|
+
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
}>[];
|
|
105
|
+
actionsPlacement: ToolbarPlacement;
|
|
106
|
+
listToolAfter: any;
|
|
107
|
+
proClasses: Record<string, any>;
|
|
108
|
+
proStyles: Record<string, any>;
|
|
109
109
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
110
110
|
//#endregion
|
|
111
111
|
export { ListToolBar, ListToolBarSetting };
|
|
@@ -87,17 +87,17 @@ declare const Toolbar: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
87
87
|
default: () => {};
|
|
88
88
|
};
|
|
89
89
|
}>> & Readonly<{}>, {
|
|
90
|
+
headerTitle: any;
|
|
91
|
+
headerTitleTip: any;
|
|
92
|
+
titleTipText: string;
|
|
90
93
|
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
91
94
|
[key: string]: any;
|
|
92
95
|
}>[];
|
|
96
|
+
actionsPlacement: ToolbarPlacement;
|
|
97
|
+
listToolAfter: any;
|
|
93
98
|
proClasses: Record<string, any>;
|
|
94
99
|
proStyles: Record<string, any>;
|
|
95
100
|
options: any;
|
|
96
|
-
titleTipText: string;
|
|
97
|
-
actionsPlacement: ToolbarPlacement;
|
|
98
|
-
headerTitle: any;
|
|
99
|
-
listToolAfter: any;
|
|
100
|
-
headerTitleTip: any;
|
|
101
101
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { Toolbar, Toolbar as default };
|
package/dist/hooks/useTable.js
CHANGED
|
@@ -3,16 +3,21 @@ import { merge } from "@gx-design-vue/pro-utils";
|
|
|
3
3
|
//#region src/hooks/useTable.ts
|
|
4
4
|
const EMPTY_ARRAY = [];
|
|
5
5
|
function useTable(tableRef, options) {
|
|
6
|
-
const tableState = reactive({
|
|
6
|
+
const tableState = reactive({
|
|
7
|
+
params: {},
|
|
8
|
+
searchMap: []
|
|
9
|
+
});
|
|
7
10
|
const syncedStateKeys = /* @__PURE__ */ new Set();
|
|
8
11
|
function syncTableState(state = {}) {
|
|
9
|
-
const
|
|
10
|
-
for (const key of syncedStateKeys) if (!(key in nextState)) {
|
|
12
|
+
for (const key of syncedStateKeys) if (!(key in state)) {
|
|
11
13
|
delete tableState[key];
|
|
12
14
|
syncedStateKeys.delete(key);
|
|
13
15
|
}
|
|
14
|
-
Object.
|
|
15
|
-
|
|
16
|
+
for (const key of Object.keys(state)) {
|
|
17
|
+
const nextValue = state[key];
|
|
18
|
+
if (nextValue !== tableState[key]) tableState[key] = nextValue;
|
|
19
|
+
syncedStateKeys.add(key);
|
|
20
|
+
}
|
|
16
21
|
if (options?.request) tableState.request = options.request;
|
|
17
22
|
}
|
|
18
23
|
watch(() => toValue(options?.state), (newState) => {
|