@gx-design-vue/pro-table 0.2.0-alpha.15 → 0.2.0-alpha.17
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 +19 -5
- package/dist/components/ScrollBar/Bar.d.ts +1 -1
- package/dist/components/ScrollBar/Thumb.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 +2 -2
- package/dist/components/Toolbar/ListToolBar.d.ts +6 -6
- package/dist/components/Toolbar/index.d.ts +4 -4
- package/dist/hooks/useFetchData.js +1 -1
- package/dist/interface.d.ts +1 -1
- package/dist/pro-table.esm.js +207 -189
- package/dist/pro-table.js +1 -1
- package/dist/style/index.js +10 -0
- package/package.json +5 -5
package/dist/ProTable.js
CHANGED
|
@@ -87,6 +87,20 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
87
87
|
loading: computed(() => props.loading),
|
|
88
88
|
onChange: (val) => props.onLoadingChange?.(val)
|
|
89
89
|
});
|
|
90
|
+
/**
|
|
91
|
+
* loading 指示器解析:
|
|
92
|
+
* 优先级 loading(SpinProps).indicator > 全局 configContext.indicator > Spin 默认。
|
|
93
|
+
* configContext.indicator 可能是函数,需调用取值(与 AppPage 一致)。
|
|
94
|
+
*/
|
|
95
|
+
const resolvedIndicator = computed(() => {
|
|
96
|
+
const loadingProp = props.loading;
|
|
97
|
+
if (loadingProp && typeof loadingProp === "object") {
|
|
98
|
+
const indicator = loadingProp.indicator;
|
|
99
|
+
if (indicator !== void 0) return indicator;
|
|
100
|
+
}
|
|
101
|
+
const ctxIndicator = configContext?.indicator?.value;
|
|
102
|
+
return typeof ctxIndicator === "function" ? ctxIndicator() : ctxIndicator;
|
|
103
|
+
});
|
|
90
104
|
const { selectedRowKeys, selectedItems, mergedRowSelection, select: selectRow, selectAll: selectAllRows, remove: removeSelectedKeys, clear: clearSelectedKeys, sync: syncSelectedRows } = useRowSelection({
|
|
91
105
|
rowKey: computed(() => props.rowKey),
|
|
92
106
|
rowSelection: computed(() => props.rowSelection),
|
|
@@ -195,7 +209,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
195
209
|
}
|
|
196
210
|
if (action === "reset") {
|
|
197
211
|
emit("reset", params);
|
|
198
|
-
if (props.request && formActions.value?.resetReload) reload({ params });
|
|
212
|
+
if (props.request && formActions.value?.resetReload !== false) reload({ params });
|
|
199
213
|
} else if (props.request) {
|
|
200
214
|
emit("submit", params);
|
|
201
215
|
reload({ params });
|
|
@@ -372,7 +386,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
372
386
|
"listToolAfter": slots.listToolAfter?.() ?? props.listToolAfter,
|
|
373
387
|
"proClasses": props.proClasses ?? {},
|
|
374
388
|
"proStyles": props.proStyles ?? {}
|
|
375
|
-
}, null),
|
|
389
|
+
}, null), createVNode("div", { "class": `${prefixCls.value}-loading-container` }, [isCustomRenderMode.value ? createVNode("div", { "class": classNames(`${prefixCls.value}-list`, props.proClasses?.list) }, [createVNode("div", {
|
|
376
390
|
"class": classNames(`${prefixCls.value}-list-content`, props.proClasses?.listContent),
|
|
377
391
|
"style": props.proStyles?.listContent
|
|
378
392
|
}, [renderCustomContent()]), paginationInfo.value !== false && dataSource.value?.length > 0 && createVNode(Pagination, mergeProps(paginationInfo.value, {
|
|
@@ -380,7 +394,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
380
394
|
"class": classNames(`${prefixCls.value}-pagination`, props.proClasses?.pagination),
|
|
381
395
|
"style": props.proStyles?.pagination,
|
|
382
396
|
"onChange": onCustomPaginationChange
|
|
383
|
-
}), null)])
|
|
397
|
+
}), null)]) : createVNode(Fragment, null, [createVNode(Table, mergeProps(passThroughProps.value, {
|
|
384
398
|
"scroll": tableScroll.value,
|
|
385
399
|
"dataSource": dataSource.value,
|
|
386
400
|
"columns": props.draggable ? resizableColumns.value : tableColumns.value,
|
|
@@ -388,7 +402,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
388
402
|
"rowKey": props.rowKey,
|
|
389
403
|
"size": tableSize.value,
|
|
390
404
|
"pagination": paginationInfo.value,
|
|
391
|
-
"loading":
|
|
405
|
+
"loading": false,
|
|
392
406
|
"rowSelection": mergedRowSelection.value,
|
|
393
407
|
"onChange": onTableChange,
|
|
394
408
|
"onUpdate:expandedRowKeys": onTableExpandedRowKeysChange,
|
|
@@ -400,7 +414,7 @@ const ForwardProTable = /* @__PURE__ */ defineComponent((props, { attrs, slots,
|
|
|
400
414
|
}), tableSlots.value), scrollEl.value && createVNode(Teleport, { "to": scrollEl.value }, { default: () => [createVNode(Bar_default, {
|
|
401
415
|
"ref": barRef,
|
|
402
416
|
"hasScrollY": !!tableScroll.value.y
|
|
403
|
-
}, null)] })])])])]);
|
|
417
|
+
}, null)] })]), loadingState.value && createVNode("div", { "class": classNames(`${prefixCls.value}-loading-mask`, hashId.value) }, [createVNode(Spin, { "indicator": resolvedIndicator.value }, null)])])])])]);
|
|
404
418
|
};
|
|
405
419
|
}, {
|
|
406
420
|
props: /* @__PURE__ */ mergeDefaults({
|
|
@@ -70,11 +70,11 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
70
70
|
};
|
|
71
71
|
}>> & Readonly<{}>, {
|
|
72
72
|
readonly always: boolean;
|
|
73
|
-
readonly minSize: number;
|
|
74
73
|
readonly barStyle: {
|
|
75
74
|
x: CSSProperties;
|
|
76
75
|
y: CSSProperties;
|
|
77
76
|
};
|
|
77
|
+
readonly minSize: number;
|
|
78
78
|
readonly hasScrollY: boolean;
|
|
79
79
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
80
80
|
//#endregion
|
|
@@ -44,9 +44,9 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
44
44
|
readonly default: () => {};
|
|
45
45
|
};
|
|
46
46
|
}>> & Readonly<{}>, {
|
|
47
|
+
readonly vertical: boolean;
|
|
47
48
|
readonly always: boolean;
|
|
48
49
|
readonly barStyle: CSSProperties;
|
|
49
|
-
readonly vertical: boolean;
|
|
50
50
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
51
51
|
//#endregion
|
|
52
52
|
export { _default as default, thumbProps };
|
|
@@ -67,8 +67,8 @@ declare const FormItemContainer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
67
67
|
default: any;
|
|
68
68
|
};
|
|
69
69
|
}>> & Readonly<{}>, {
|
|
70
|
-
autoRequest: boolean;
|
|
71
70
|
loading: boolean;
|
|
71
|
+
autoRequest: boolean;
|
|
72
72
|
onSubmit: () => void;
|
|
73
73
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
74
74
|
//#endregion
|
|
@@ -73,7 +73,7 @@ declare const FormItemWrapper: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
73
73
|
hashId: string;
|
|
74
74
|
label: any;
|
|
75
75
|
labelWidth: string | number;
|
|
76
|
-
labelAlign: "left" | "
|
|
76
|
+
labelAlign: "left" | "right" | "center";
|
|
77
77
|
colon: boolean;
|
|
78
78
|
formItemStyle: CSSProperties;
|
|
79
79
|
globalLabelGap: number;
|
|
@@ -111,8 +111,6 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
111
111
|
default: any;
|
|
112
112
|
};
|
|
113
113
|
}>> & Readonly<{}>, {
|
|
114
|
-
loading: any;
|
|
115
|
-
onReset: (params: Record<string, any>) => void;
|
|
116
114
|
proClasses: Record<string, string>;
|
|
117
115
|
proStyles: Record<string, any>;
|
|
118
116
|
formColumns: ProSearchMap<"text", string>[];
|
|
@@ -124,7 +122,9 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
124
122
|
searchText?: string;
|
|
125
123
|
resetText?: string;
|
|
126
124
|
};
|
|
125
|
+
loading: any;
|
|
127
126
|
cardBordered: boolean;
|
|
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
|
-
headerTitle: any;
|
|
97
|
-
headerTitleTip: any;
|
|
98
96
|
titleTipText: string;
|
|
99
|
-
|
|
100
|
-
[key: string]: any;
|
|
101
|
-
}>[];
|
|
97
|
+
actionsPlacement: ToolbarPlacement;
|
|
102
98
|
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
103
99
|
[key: string]: any;
|
|
104
100
|
}>[];
|
|
105
|
-
|
|
101
|
+
headerTitle: any;
|
|
106
102
|
listToolAfter: any;
|
|
103
|
+
headerTitleTip: any;
|
|
107
104
|
proClasses: Record<string, any>;
|
|
108
105
|
proStyles: Record<string, any>;
|
|
106
|
+
settings: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}>[];
|
|
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
|
-
|
|
91
|
-
headerTitleTip: any;
|
|
90
|
+
options: any;
|
|
92
91
|
titleTipText: string;
|
|
92
|
+
actionsPlacement: ToolbarPlacement;
|
|
93
93
|
actions: VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
94
94
|
[key: string]: any;
|
|
95
95
|
}>[];
|
|
96
|
-
|
|
96
|
+
headerTitle: any;
|
|
97
97
|
listToolAfter: any;
|
|
98
|
+
headerTitleTip: any;
|
|
98
99
|
proClasses: Record<string, any>;
|
|
99
100
|
proStyles: Record<string, any>;
|
|
100
|
-
options: any;
|
|
101
101
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { Toolbar, Toolbar as default };
|
|
@@ -50,7 +50,7 @@ function useFetchData(config, action) {
|
|
|
50
50
|
}
|
|
51
51
|
/** 写入表格数据并同步 sortIndex,无 request 时同步 dataSource total */
|
|
52
52
|
function setTableDataList(list) {
|
|
53
|
-
tableDataList.value = getSortIndex(list, toRaw(pageInfo));
|
|
53
|
+
tableDataList.value = getSortIndex(toRaw(list), toRaw(pageInfo));
|
|
54
54
|
if (!request || !isFunction(request)) {
|
|
55
55
|
const total = list.length || 0;
|
|
56
56
|
if (total !== pageInfo.total) setPagination({ total });
|