@gx-design-vue/pro-table 0.2.0-alpha.15 → 0.2.0-alpha.16
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 +18 -4
- 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 +2 -2
- package/dist/components/SearchForm/SearchForm.d.ts +1 -1
- package/dist/hooks/useFetchData.js +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 +4 -4
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),
|
|
@@ -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,9 +67,9 @@ declare const FormItemContainer: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
67
67
|
default: any;
|
|
68
68
|
};
|
|
69
69
|
}>> & Readonly<{}>, {
|
|
70
|
+
onSubmit: () => void;
|
|
70
71
|
autoRequest: boolean;
|
|
71
72
|
loading: boolean;
|
|
72
|
-
onSubmit: () => void;
|
|
73
73
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
74
74
|
//#endregion
|
|
75
75
|
export { FormItemContainer };
|
|
@@ -70,10 +70,10 @@ declare const FormItemWrapper: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
70
70
|
default: any;
|
|
71
71
|
};
|
|
72
72
|
}>> & Readonly<{}>, {
|
|
73
|
-
hashId: string;
|
|
74
73
|
label: any;
|
|
74
|
+
hashId: string;
|
|
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,10 +111,10 @@ declare const ProTableSearchForm: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
111
111
|
default: any;
|
|
112
112
|
};
|
|
113
113
|
}>> & Readonly<{}>, {
|
|
114
|
-
loading: any;
|
|
115
114
|
onReset: (params: Record<string, any>) => void;
|
|
116
115
|
proClasses: Record<string, string>;
|
|
117
116
|
proStyles: Record<string, any>;
|
|
117
|
+
loading: any;
|
|
118
118
|
formColumns: ProSearchMap<"text", string>[];
|
|
119
119
|
formConfig: FormConfig;
|
|
120
120
|
formAutoRequest: boolean;
|
|
@@ -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 });
|