@kne/table-page 0.1.17 → 0.1.19
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/README.md +26 -5
- package/dist/index.css +9 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +14 -14
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -1414,16 +1414,15 @@ const Table = p => {
|
|
|
1414
1414
|
setResizeGuideStyle(null);
|
|
1415
1415
|
return;
|
|
1416
1416
|
}
|
|
1417
|
+
const wrapperRect = root.getBoundingClientRect();
|
|
1417
1418
|
const headerRect = headerCell.getBoundingClientRect();
|
|
1418
1419
|
const resizeBar = headerCell.querySelector('.table-cell-resize-bar');
|
|
1419
1420
|
const barRect = resizeBar == null ? void 0 : resizeBar.getBoundingClientRect();
|
|
1420
1421
|
const containerRect = tableContainer.getBoundingClientRect();
|
|
1421
1422
|
setResizeGuideStyle({
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
height: Math.round(containerRect.height),
|
|
1426
|
-
zIndex: 100
|
|
1423
|
+
left: Math.round(((_barRect$right = barRect == null ? void 0 : barRect.right) != null ? _barRect$right : headerRect.right) - wrapperRect.left),
|
|
1424
|
+
top: Math.round(containerRect.top - wrapperRect.top),
|
|
1425
|
+
height: Math.round(containerRect.height)
|
|
1427
1426
|
});
|
|
1428
1427
|
}, [currentMoveColumnIndex]);
|
|
1429
1428
|
useLayoutEffect(() => {
|
|
@@ -2885,7 +2884,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2885
2884
|
}
|
|
2886
2885
|
const nextSize = Number(size);
|
|
2887
2886
|
const currentPage = get(requestParams, [pagination.paramsType, pagination.currentName], 1);
|
|
2888
|
-
const currentSize = Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize ||
|
|
2887
|
+
const currentSize = Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize || 20;
|
|
2889
2888
|
if (nextSize !== currentSize) {
|
|
2890
2889
|
pagination.onShowSizeChange && pagination.onShowSizeChange(page, nextSize);
|
|
2891
2890
|
}
|
|
@@ -2903,7 +2902,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2903
2902
|
const useCardLoadMore = isCardModeActive && pagination.open && !pagination.forcePagination;
|
|
2904
2903
|
const useLoadMoreMode = useMobileLoadMore || useCardLoadMore;
|
|
2905
2904
|
const currentPage = get(requestParams, [pagination.paramsType, pagination.currentName], 1);
|
|
2906
|
-
const currentPageSize = Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize ||
|
|
2905
|
+
const currentPageSize = Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize || 20;
|
|
2907
2906
|
const loadMoreNoMore = !formatData.total || currentPage * currentPageSize >= formatData.total;
|
|
2908
2907
|
const handleLoadMore = useRefCallback(async () => {
|
|
2909
2908
|
const mergeList = pagination.mergeList || defaultMergeList;
|
|
@@ -2935,7 +2934,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2935
2934
|
showTotal: typeof pagination.showTotal === 'function' ? pagination.showTotal : defaultShowTotal
|
|
2936
2935
|
} : {}, {
|
|
2937
2936
|
current: get(requestParams, [pagination.paramsType, pagination.currentName], 1),
|
|
2938
|
-
pageSize: Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize ||
|
|
2937
|
+
pageSize: Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize || 20,
|
|
2939
2938
|
onChange: handlePaginationChange,
|
|
2940
2939
|
size: pagination.size,
|
|
2941
2940
|
hideOnSinglePage: pagination.hideOnSinglePage,
|
|
@@ -3042,9 +3041,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3042
3041
|
ref: tableContentRef,
|
|
3043
3042
|
enabled: horizontalScroller && renderType === 'Table' && !isCardModeActive,
|
|
3044
3043
|
getPortalContainer: getScrollContainer,
|
|
3045
|
-
className:
|
|
3046
|
-
'is-loading': !isComplete && !data
|
|
3047
|
-
}),
|
|
3044
|
+
className: style$1['table-content'],
|
|
3048
3045
|
children: [showOuterTab ? /*#__PURE__*/jsx(TablePageTabs, {
|
|
3049
3046
|
filterValue: filterValue,
|
|
3050
3047
|
onFilterChange: handleFilterChange,
|
|
@@ -3077,7 +3074,10 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3077
3074
|
}) : tableElement]
|
|
3078
3075
|
});
|
|
3079
3076
|
return /*#__PURE__*/jsx("div", {
|
|
3080
|
-
className: style$1['table-page'],
|
|
3077
|
+
className: classnames(style$1['table-page'], 'loading-container', {
|
|
3078
|
+
// reload 会保留旧 data,仅将 isComplete 置为 false;用蒙层提示切换中,避免卸载表格
|
|
3079
|
+
'is-loading': !isComplete
|
|
3080
|
+
}),
|
|
3081
3081
|
style: scrollTopInsetStyle,
|
|
3082
3082
|
children: useLoadMoreMode ? /*#__PURE__*/jsx(ScrollLoader, _extends({
|
|
3083
3083
|
className: style$1['mobile-load-more'],
|
|
@@ -3108,13 +3108,13 @@ const TablePage = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
3108
3108
|
pagination = Object.assign({}, {
|
|
3109
3109
|
showSizeChanger: true,
|
|
3110
3110
|
showQuickJumper: true,
|
|
3111
|
-
hideOnSinglePage:
|
|
3111
|
+
hideOnSinglePage: true,
|
|
3112
3112
|
open: true,
|
|
3113
3113
|
paramsType: 'data',
|
|
3114
3114
|
requestType: 'reload',
|
|
3115
3115
|
currentName: 'currentPage',
|
|
3116
3116
|
pageSizeName: 'perPage',
|
|
3117
|
-
pageSize:
|
|
3117
|
+
pageSize: 20
|
|
3118
3118
|
}, pagination);
|
|
3119
3119
|
const pageSizeKey = `${(props.name || 'common').toUpperCase()}_TABLE_PAGE_SIZE`;
|
|
3120
3120
|
const cachePageSize = pagination.cachePageSize !== false;
|