@kne/table-page 0.1.24 → 0.1.26
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 +328 -6
- package/dist/index.css +35 -29
- package/dist/index.css.map +1 -1
- package/dist/index.js +117 -423
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +110 -425
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -2
package/dist/index.modern.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Checkbox, Row, Col, Input, List, Tooltip, Button, Collapse, Popover, Em
|
|
|
5
5
|
import { HolderOutlined, RedoOutlined, SettingOutlined, LoadingOutlined, CaretRightOutlined, DownOutlined, MinusSquareOutlined, TableOutlined, AppstoreOutlined } from '@ant-design/icons';
|
|
6
6
|
import { SearchInput, FilterLines, FilterOuter, FilterValueDisplay, getFilterValue } from '@kne/react-filter';
|
|
7
7
|
import ScrollLoader from '@kne/scroll-loader';
|
|
8
|
-
import { useState, useMemo, useRef, useCallback, useEffect, useLayoutEffect, forwardRef } from 'react';
|
|
8
|
+
import { useState, useMemo, useRef, useCallback, useEffect, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
9
9
|
import classnames from 'classnames';
|
|
10
10
|
import get from 'lodash/get';
|
|
11
11
|
import { TableView as TableView$1, isOptionsColumn, parseColumnWidth, isTreeDataType, normalizeTreeData, collectExpandableKeys, buildTreeKeyMaps, nodeCanExpand, isRenderMobileActive, resolveColumns, resolveCheckRelation, flattenVisibleTree, getTreeSelectionColumnWidth, toggleExpandedKey, getTreeCheckState, useSelectedRow, useSort, wrapColumnHeaderTitle, isAllTreeSelected, hasAnyTreeSelected, buildSelectAllKeys, buildClearSelectAllKeys, toggleTreeCheck, renderColumnTitle, getColumnEllipsis, computeColumnsValue, renderCellContent, computeDisplay, globalParams } from '@kne/table-view';
|
|
@@ -25,8 +25,9 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
25
25
|
import { createWithIntlProvider, useIntl } from '@kne/react-intl';
|
|
26
26
|
import filterZhCN from '@kne/react-filter/dist/locale/zh-CN';
|
|
27
27
|
import filterEnUS from '@kne/react-filter/dist/locale/en-US';
|
|
28
|
+
import StickyScroller, { isDocumentScrollContainer, getViewportRect } from '@kne/react-sticky-scroller';
|
|
28
29
|
import useControlValue from '@kne/use-control-value';
|
|
29
|
-
import
|
|
30
|
+
import '@kne/react-sticky-scroller/dist/index.css';
|
|
30
31
|
import '@kne/button-group/dist/index.css';
|
|
31
32
|
import '@kne/react-filter/dist/index.css';
|
|
32
33
|
import ButtonGroup from '@kne/button-group';
|
|
@@ -771,9 +772,6 @@ const parsePixelValue = value => {
|
|
|
771
772
|
const num = parseFloat(value);
|
|
772
773
|
return Number.isNaN(num) ? 0 : num;
|
|
773
774
|
};
|
|
774
|
-
const isDocumentScrollContainer = container => {
|
|
775
|
-
return !container || container === document.body || container === document.documentElement || container === document.scrollingElement;
|
|
776
|
-
};
|
|
777
775
|
const normalizeScrollTopInsetCSSValue = value => {
|
|
778
776
|
if (value == null) {
|
|
779
777
|
return undefined;
|
|
@@ -807,25 +805,6 @@ const readScrollTopInsetPixels = element => {
|
|
|
807
805
|
const fromVar = readCssVariableLength(element, '--scroll-top-inset', '0px') || readCssVariableLength(element, '--sticky-offset', '0px') || readCssVariableLength(element, '--nav-height', '0px');
|
|
808
806
|
return fromVar;
|
|
809
807
|
};
|
|
810
|
-
const getViewportRect = () => {
|
|
811
|
-
const visualViewport = window.visualViewport;
|
|
812
|
-
if (visualViewport) {
|
|
813
|
-
return {
|
|
814
|
-
top: visualViewport.offsetTop,
|
|
815
|
-
bottom: visualViewport.offsetTop + visualViewport.height,
|
|
816
|
-
left: visualViewport.offsetLeft,
|
|
817
|
-
right: visualViewport.offsetLeft + visualViewport.width,
|
|
818
|
-
height: visualViewport.height
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
return {
|
|
822
|
-
top: 0,
|
|
823
|
-
bottom: window.innerHeight,
|
|
824
|
-
left: 0,
|
|
825
|
-
right: window.innerWidth,
|
|
826
|
-
height: window.innerHeight
|
|
827
|
-
};
|
|
828
|
-
};
|
|
829
808
|
const getTableElement = root => {
|
|
830
809
|
if (!root) {
|
|
831
810
|
return null;
|
|
@@ -917,32 +896,6 @@ const scrollAnchorIntoView = (root, {
|
|
|
917
896
|
});
|
|
918
897
|
});
|
|
919
898
|
};
|
|
920
|
-
const getTableScrollElement = root => {
|
|
921
|
-
if (!root) {
|
|
922
|
-
return null;
|
|
923
|
-
}
|
|
924
|
-
return root.querySelector('.ant-table-body') || root.querySelector('.ant-table-content');
|
|
925
|
-
};
|
|
926
|
-
const getElementViewportState = element => {
|
|
927
|
-
if (!element) {
|
|
928
|
-
return {
|
|
929
|
-
isBottomInViewport: true,
|
|
930
|
-
isPartiallyInViewport: false,
|
|
931
|
-
isTopInViewport: true,
|
|
932
|
-
rect: null,
|
|
933
|
-
viewport: getViewportRect()
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
const rect = element.getBoundingClientRect();
|
|
937
|
-
const viewport = getViewportRect();
|
|
938
|
-
return {
|
|
939
|
-
isBottomInViewport: rect.bottom > viewport.top && rect.bottom <= viewport.bottom,
|
|
940
|
-
isPartiallyInViewport: rect.top < viewport.bottom && rect.bottom > viewport.top,
|
|
941
|
-
isTopInViewport: rect.top >= viewport.top && rect.top < viewport.bottom,
|
|
942
|
-
rect,
|
|
943
|
-
viewport
|
|
944
|
-
};
|
|
945
|
-
};
|
|
946
899
|
const isTopEdgeInViewport = (element, scrollMarginTop = 0, getScrollContainer) => {
|
|
947
900
|
if (!element) {
|
|
948
901
|
return true;
|
|
@@ -954,64 +907,10 @@ const isTopEdgeInViewport = (element, scrollMarginTop = 0, getScrollContainer) =
|
|
|
954
907
|
const _viewportTop = containerRect.top + scrollMarginTop;
|
|
955
908
|
return rect.top >= _viewportTop && rect.top < containerRect.bottom;
|
|
956
909
|
}
|
|
957
|
-
const
|
|
958
|
-
isTopInViewport,
|
|
959
|
-
viewport
|
|
960
|
-
} = getElementViewportState(element);
|
|
961
|
-
if (!rect) {
|
|
962
|
-
return true;
|
|
963
|
-
}
|
|
910
|
+
const viewport = getViewportRect();
|
|
964
911
|
const viewportTop = viewport.top + scrollMarginTop;
|
|
965
912
|
return rect.top >= viewportTop && rect.top < viewport.bottom;
|
|
966
913
|
};
|
|
967
|
-
const shouldShowFloatingScrollbar = (scrollEl, viewportState, getScrollContainer) => {
|
|
968
|
-
if (!scrollEl || scrollEl.scrollWidth <= scrollEl.clientWidth + 1) {
|
|
969
|
-
return false;
|
|
970
|
-
}
|
|
971
|
-
const explicitContainer = typeof getScrollContainer === 'function' ? getScrollContainer() : null;
|
|
972
|
-
if (!isDocumentScrollContainer(explicitContainer)) {
|
|
973
|
-
const rect = scrollEl.getBoundingClientRect();
|
|
974
|
-
const containerRect = explicitContainer.getBoundingClientRect();
|
|
975
|
-
return rect.top < containerRect.bottom && rect.bottom > containerRect.bottom;
|
|
976
|
-
}
|
|
977
|
-
const state = viewportState || getElementViewportState(scrollEl);
|
|
978
|
-
if (!state.isPartiallyInViewport) {
|
|
979
|
-
return false;
|
|
980
|
-
}
|
|
981
|
-
return !state.isBottomInViewport;
|
|
982
|
-
};
|
|
983
|
-
const observeViewportIntersection = (element, onChange) => {
|
|
984
|
-
var _window$visualViewpor, _window$visualViewpor2;
|
|
985
|
-
if (!element) {
|
|
986
|
-
return () => {};
|
|
987
|
-
}
|
|
988
|
-
const notify = entry => {
|
|
989
|
-
onChange(getElementViewportState(element));
|
|
990
|
-
};
|
|
991
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
992
|
-
notify();
|
|
993
|
-
}, {
|
|
994
|
-
root: null,
|
|
995
|
-
threshold: [0, 0.01, 0.25, 0.5, 0.75, 1]
|
|
996
|
-
});
|
|
997
|
-
observer.observe(element);
|
|
998
|
-
const handleViewportChange = () => {
|
|
999
|
-
notify();
|
|
1000
|
-
};
|
|
1001
|
-
window.addEventListener('scroll', handleViewportChange, true);
|
|
1002
|
-
window.addEventListener('resize', handleViewportChange);
|
|
1003
|
-
(_window$visualViewpor = window.visualViewport) == null || _window$visualViewpor.addEventListener('resize', handleViewportChange);
|
|
1004
|
-
(_window$visualViewpor2 = window.visualViewport) == null || _window$visualViewpor2.addEventListener('scroll', handleViewportChange);
|
|
1005
|
-
notify();
|
|
1006
|
-
return () => {
|
|
1007
|
-
var _window$visualViewpor3, _window$visualViewpor4;
|
|
1008
|
-
observer.disconnect();
|
|
1009
|
-
window.removeEventListener('scroll', handleViewportChange, true);
|
|
1010
|
-
window.removeEventListener('resize', handleViewportChange);
|
|
1011
|
-
(_window$visualViewpor3 = window.visualViewport) == null || _window$visualViewpor3.removeEventListener('resize', handleViewportChange);
|
|
1012
|
-
(_window$visualViewpor4 = window.visualViewport) == null || _window$visualViewpor4.removeEventListener('scroll', handleViewportChange);
|
|
1013
|
-
};
|
|
1014
|
-
};
|
|
1015
914
|
|
|
1016
915
|
/** 叶子去掉空 children,懒加载节点保留 [],避免 antd 把所有节点当成可展开 */
|
|
1017
916
|
const prepareAntdTreeNodes = (nodes, {
|
|
@@ -1582,7 +1481,11 @@ const Table = p => {
|
|
|
1582
1481
|
return undefined;
|
|
1583
1482
|
}
|
|
1584
1483
|
const getRowKey = record => resolveRowKey(rowKey, record);
|
|
1585
|
-
|
|
1484
|
+
// 全选判断/操作只针对可勾选行,排除 disabled
|
|
1485
|
+
const allKeys = isTree ? ((treeKeyMaps == null ? void 0 : treeKeyMaps.allKeys) || []).filter(key => {
|
|
1486
|
+
var _treeKeyMaps$nodeMap$;
|
|
1487
|
+
return !((_treeKeyMaps$nodeMap$ = treeKeyMaps.nodeMap.get(key)) != null && _treeKeyMaps$nodeMap$.disabled);
|
|
1488
|
+
}) : (dataSource || []).filter(item => !item.disabled).map(getRowKey);
|
|
1586
1489
|
const useTreeCheck = isTree && rowSelection.type === 'checkbox' && checkRelation !== 'independent' && treeKeyMaps;
|
|
1587
1490
|
const renderSelectAllNode = () => {
|
|
1588
1491
|
if (rowSelection.type !== 'checkbox') {
|
|
@@ -1632,7 +1535,7 @@ const Table = p => {
|
|
|
1632
1535
|
});
|
|
1633
1536
|
}
|
|
1634
1537
|
const checkedAll = rowSelection.isSelectedAll || allKeys.length > 0 && allKeys.every(key => (rowSelection.selectedRowKeys || []).indexOf(key) > -1);
|
|
1635
|
-
const indeterminate = !checkedAll && (rowSelection.selectedRowKeys || []).
|
|
1538
|
+
const indeterminate = !checkedAll && allKeys.some(key => (rowSelection.selectedRowKeys || []).indexOf(key) > -1);
|
|
1636
1539
|
return /*#__PURE__*/jsx(Checkbox, {
|
|
1637
1540
|
checked: checkedAll,
|
|
1638
1541
|
indeterminate: indeterminate,
|
|
@@ -1650,6 +1553,9 @@ const Table = p => {
|
|
|
1650
1553
|
});
|
|
1651
1554
|
return;
|
|
1652
1555
|
}
|
|
1556
|
+
if (allKeys.length === 0) {
|
|
1557
|
+
return;
|
|
1558
|
+
}
|
|
1653
1559
|
const merged = existing.slice();
|
|
1654
1560
|
allKeys.forEach(key => {
|
|
1655
1561
|
if (merged.indexOf(key) === -1) {
|
|
@@ -1764,39 +1670,13 @@ const Table = p => {
|
|
|
1764
1670
|
}
|
|
1765
1671
|
return _extends({
|
|
1766
1672
|
type: rowSelection.type === 'radio' ? 'radio' : 'checkbox',
|
|
1767
|
-
preserveSelectedRowKeys: true
|
|
1673
|
+
preserveSelectedRowKeys: true,
|
|
1674
|
+
hideSelectAll: true
|
|
1768
1675
|
}, hasFixedColumn ? {
|
|
1769
1676
|
fixed: 'left'
|
|
1770
1677
|
} : {}, {
|
|
1771
1678
|
selectedRowKeys: rowSelection.isSelectedAll ? allKeys : rowSelection.selectedRowKeys,
|
|
1772
|
-
onChange: (selectedRowKeys, selectedRows
|
|
1773
|
-
if (info.type === 'all') {
|
|
1774
|
-
const _checked = selectedRowKeys.length > 0;
|
|
1775
|
-
if (typeof rowSelection.onIsSelectAllChange === 'function') {
|
|
1776
|
-
rowSelection.onIsSelectAllChange(_checked);
|
|
1777
|
-
return;
|
|
1778
|
-
}
|
|
1779
|
-
const pageKeys = (dataSource || []).filter(item => !item.disabled).map(getRowKey);
|
|
1780
|
-
const existing = rowSelection.selectedRowKeys || [];
|
|
1781
|
-
if (!_checked) {
|
|
1782
|
-
rowSelection.onChange(existing.filter(key => pageKeys.indexOf(key) === -1), undefined, {
|
|
1783
|
-
context,
|
|
1784
|
-
checked: false
|
|
1785
|
-
});
|
|
1786
|
-
return;
|
|
1787
|
-
}
|
|
1788
|
-
const merged = existing.slice();
|
|
1789
|
-
pageKeys.forEach(key => {
|
|
1790
|
-
if (merged.indexOf(key) === -1) {
|
|
1791
|
-
merged.push(key);
|
|
1792
|
-
}
|
|
1793
|
-
});
|
|
1794
|
-
rowSelection.onChange(merged, undefined, {
|
|
1795
|
-
context,
|
|
1796
|
-
checked: true
|
|
1797
|
-
});
|
|
1798
|
-
return;
|
|
1799
|
-
}
|
|
1679
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
1800
1680
|
const currentKey = selectedRows.length > 0 ? getRowKey(selectedRows[selectedRows.length - 1]) : selectedRowKeys[selectedRowKeys.length - 1];
|
|
1801
1681
|
const checked = selectedRowKeys.indexOf(currentKey) > -1;
|
|
1802
1682
|
rowSelection.onChange(selectedRowKeys, currentKey, {
|
|
@@ -1808,17 +1688,14 @@ const Table = p => {
|
|
|
1808
1688
|
disabled: record.disabled || rowSelection.isSelectedAll
|
|
1809
1689
|
})
|
|
1810
1690
|
}, rowSelection.type === 'checkbox' ? {
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
visibility: 'hidden'
|
|
1814
|
-
}
|
|
1815
|
-
})),
|
|
1691
|
+
columnWidth: antdSelectionColumnWidth || 48,
|
|
1692
|
+
columnTitle: wrapColContent(renderSelectAllNode()),
|
|
1816
1693
|
renderCell: (checked, record, index, originNode) => wrapColContent(originNode),
|
|
1817
1694
|
onCell: () => ({
|
|
1818
1695
|
className: getAntCellClassName(style$2['selection-col'])
|
|
1819
1696
|
})
|
|
1820
1697
|
} : {
|
|
1821
|
-
columnWidth:
|
|
1698
|
+
columnWidth: antdSelectionColumnWidth || 48,
|
|
1822
1699
|
renderCell: (checked, record, index, originNode) => wrapColContent(originNode),
|
|
1823
1700
|
onCell: () => ({
|
|
1824
1701
|
className: getAntCellClassName(style$2['radio-col'])
|
|
@@ -1886,11 +1763,11 @@ const Table = p => {
|
|
|
1886
1763
|
if (cssValue) {
|
|
1887
1764
|
next['--scroll-top-inset'] = cssValue;
|
|
1888
1765
|
}
|
|
1889
|
-
if (
|
|
1766
|
+
if (antdSelectionColumnWidth) {
|
|
1890
1767
|
next['--selection-col-width'] = `${antdSelectionColumnWidth}px`;
|
|
1891
1768
|
}
|
|
1892
1769
|
return Object.keys(next).length > 0 ? next : undefined;
|
|
1893
|
-
}, [resolvedScrollTopInset,
|
|
1770
|
+
}, [resolvedScrollTopInset, antdSelectionColumnWidth]);
|
|
1894
1771
|
const useTreeCheckForRow = isTree && (rowSelection == null ? void 0 : rowSelection.type) === 'checkbox' && checkRelation !== 'independent' && treeKeyMaps;
|
|
1895
1772
|
if (useMobileRender) {
|
|
1896
1773
|
return /*#__PURE__*/jsx(TableView, _extends({}, others, {
|
|
@@ -2002,268 +1879,7 @@ Table.useSelectedRow = useSelectedRow;
|
|
|
2002
1879
|
Table.useSort = useSort;
|
|
2003
1880
|
Table.sortDataSource = useSort.sortDataSource;
|
|
2004
1881
|
|
|
2005
|
-
var style$1 = {"table-page":"kne-table-page_ut9rJ","fetch-stack":"kne-table-page_dpy7d","toolbar-height-reserve":"kne-table-page_daceW","table-page-tabs-outer":"kne-table-page_IowJl","table-content":"kne-table-page_dxN6N","table-with-toolbar":"kne-table-page_sf06r","is-sticky":"kne-table-page_7lYyk","is-loading-shell":"kne-table-page_LY8zA","is-mobile-render":"kne-table-page_D6KGb","has-summary":"kne-table-page_IRdzb","table-cell-skeleton":"kne-table-page_--DrO","table-skeleton-spin":"kne-table-page_cZ1zq","table-in-toolbar":"kne-table-page_sawIT","is-card-mode":"kne-table-page_kH6wM","is-card-render":"kne-table-page_-WbMN","card-mode-toggle":"kne-table-page_ostpI","mobile-load-more":"kne-table-page_UqVnb","pagination":"kne-table-page_DSTEf","total_text":"kne-table-page_pJhKr"
|
|
2006
|
-
|
|
2007
|
-
const BAR_HEIGHT = 15;
|
|
2008
|
-
const THUMB_MARGIN = 2;
|
|
2009
|
-
const computeBarMetrics = (scrollEl, viewportState, getPortalContainer) => {
|
|
2010
|
-
const rect = scrollEl.getBoundingClientRect();
|
|
2011
|
-
const portalContainer = typeof getPortalContainer === 'function' ? getPortalContainer() : null;
|
|
2012
|
-
const useEmbeddedPlacement = !isDocumentScrollContainer(portalContainer);
|
|
2013
|
-
const trackWidth = rect.width;
|
|
2014
|
-
const thumbWidth = Math.max(trackWidth * scrollEl.clientWidth / scrollEl.scrollWidth - THUMB_MARGIN * 2, 24);
|
|
2015
|
-
const maxThumbOffset = trackWidth - thumbWidth - THUMB_MARGIN * 2;
|
|
2016
|
-
const scrollRatio = scrollEl.scrollWidth > scrollEl.clientWidth ? scrollEl.scrollLeft / (scrollEl.scrollWidth - scrollEl.clientWidth) : 0;
|
|
2017
|
-
const visible = shouldShowFloatingScrollbar(scrollEl, viewportState, getPortalContainer);
|
|
2018
|
-
if (useEmbeddedPlacement) {
|
|
2019
|
-
const containerRect = portalContainer.getBoundingClientRect();
|
|
2020
|
-
return {
|
|
2021
|
-
placement: 'embedded',
|
|
2022
|
-
offsetLeft: Math.round(rect.left - containerRect.left),
|
|
2023
|
-
width: Math.round(trackWidth),
|
|
2024
|
-
thumbWidth,
|
|
2025
|
-
thumbLeft: THUMB_MARGIN + maxThumbOffset * scrollRatio,
|
|
2026
|
-
visible
|
|
2027
|
-
};
|
|
2028
|
-
}
|
|
2029
|
-
const viewport = getViewportRect();
|
|
2030
|
-
return {
|
|
2031
|
-
placement: 'fixed',
|
|
2032
|
-
left: Math.round(rect.left),
|
|
2033
|
-
width: Math.round(trackWidth),
|
|
2034
|
-
bottom: window.innerHeight - viewport.bottom,
|
|
2035
|
-
thumbWidth,
|
|
2036
|
-
thumbLeft: THUMB_MARGIN + maxThumbOffset * scrollRatio,
|
|
2037
|
-
visible
|
|
2038
|
-
};
|
|
2039
|
-
};
|
|
2040
|
-
const metricsEqual = (prev, next) => {
|
|
2041
|
-
if (!prev || !next) {
|
|
2042
|
-
return prev === next;
|
|
2043
|
-
}
|
|
2044
|
-
return prev.placement === next.placement && prev.visible === next.visible && prev.width === next.width && prev.thumbWidth === next.thumbWidth && prev.thumbLeft === next.thumbLeft && (prev.placement === 'embedded' ? prev.offsetLeft === next.offsetLeft : prev.left === next.left && prev.bottom === next.bottom);
|
|
2045
|
-
};
|
|
2046
|
-
const FloatingScrollBar = ({
|
|
2047
|
-
metrics,
|
|
2048
|
-
onThumbDrag,
|
|
2049
|
-
getPortalContainer
|
|
2050
|
-
}) => {
|
|
2051
|
-
const startRef = useRef(0);
|
|
2052
|
-
const [moving, setMoving] = useState(false);
|
|
2053
|
-
const movingRef = useRef(false);
|
|
2054
|
-
const onThumbDragRef = useRef(onThumbDrag);
|
|
2055
|
-
onThumbDragRef.current = onThumbDrag;
|
|
2056
|
-
useEffect(() => {
|
|
2057
|
-
movingRef.current = moving;
|
|
2058
|
-
}, [moving]);
|
|
2059
|
-
useEffect(() => {
|
|
2060
|
-
const moveHandler = event => {
|
|
2061
|
-
if (!movingRef.current) {
|
|
2062
|
-
return;
|
|
2063
|
-
}
|
|
2064
|
-
onThumbDragRef.current(event.clientX - startRef.current);
|
|
2065
|
-
startRef.current = event.clientX;
|
|
2066
|
-
};
|
|
2067
|
-
const upHandler = () => {
|
|
2068
|
-
setMoving(false);
|
|
2069
|
-
};
|
|
2070
|
-
document.addEventListener('mousemove', moveHandler, true);
|
|
2071
|
-
document.addEventListener('mouseup', upHandler, true);
|
|
2072
|
-
return () => {
|
|
2073
|
-
document.removeEventListener('mousemove', moveHandler, true);
|
|
2074
|
-
document.removeEventListener('mouseup', upHandler, true);
|
|
2075
|
-
};
|
|
2076
|
-
}, []);
|
|
2077
|
-
if (!(metrics != null && metrics.visible)) {
|
|
2078
|
-
return null;
|
|
2079
|
-
}
|
|
2080
|
-
const portalContainer = typeof getPortalContainer === 'function' ? getPortalContainer() : null;
|
|
2081
|
-
const useEmbeddedPlacement = metrics.placement === 'embedded';
|
|
2082
|
-
const portalTarget = useEmbeddedPlacement && portalContainer ? portalContainer : document.body;
|
|
2083
|
-
return /*#__PURE__*/createPortal(/*#__PURE__*/jsx("div", {
|
|
2084
|
-
className: classnames(style$1['floating-scrollbar'], 'table-page-floating-scrollbar', {
|
|
2085
|
-
[style$1['floating-scrollbar-embedded']]: useEmbeddedPlacement
|
|
2086
|
-
}),
|
|
2087
|
-
style: useEmbeddedPlacement ? {
|
|
2088
|
-
marginLeft: metrics.offsetLeft,
|
|
2089
|
-
width: metrics.width,
|
|
2090
|
-
height: BAR_HEIGHT
|
|
2091
|
-
} : {
|
|
2092
|
-
left: metrics.left,
|
|
2093
|
-
width: metrics.width,
|
|
2094
|
-
height: BAR_HEIGHT,
|
|
2095
|
-
bottom: metrics.bottom
|
|
2096
|
-
},
|
|
2097
|
-
children: /*#__PURE__*/jsx("div", {
|
|
2098
|
-
className: classnames(style$1['floating-scrollbar-thumb'], {
|
|
2099
|
-
[style$1['is-moving']]: moving
|
|
2100
|
-
}),
|
|
2101
|
-
style: {
|
|
2102
|
-
width: metrics.thumbWidth,
|
|
2103
|
-
left: metrics.thumbLeft
|
|
2104
|
-
},
|
|
2105
|
-
onMouseDown: event => {
|
|
2106
|
-
event.preventDefault();
|
|
2107
|
-
startRef.current = event.clientX;
|
|
2108
|
-
setMoving(true);
|
|
2109
|
-
}
|
|
2110
|
-
})
|
|
2111
|
-
}), portalTarget);
|
|
2112
|
-
};
|
|
2113
|
-
const HorizontalScroller = /*#__PURE__*/forwardRef(({
|
|
2114
|
-
className,
|
|
2115
|
-
enabled: _enabled = true,
|
|
2116
|
-
getPortalContainer,
|
|
2117
|
-
children
|
|
2118
|
-
}, forwardedRef) => {
|
|
2119
|
-
const [metrics, setMetrics] = useState(null);
|
|
2120
|
-
const containerRef = useRef(null);
|
|
2121
|
-
const scrollElRef = useRef(null);
|
|
2122
|
-
const viewportStateRef = useRef(null);
|
|
2123
|
-
const metricsRef = useRef(null);
|
|
2124
|
-
const setContainerRef = useRefCallback(node => {
|
|
2125
|
-
containerRef.current = node;
|
|
2126
|
-
if (typeof forwardedRef === 'function') {
|
|
2127
|
-
forwardedRef(node);
|
|
2128
|
-
} else if (forwardedRef) {
|
|
2129
|
-
forwardedRef.current = node;
|
|
2130
|
-
}
|
|
2131
|
-
});
|
|
2132
|
-
const updateMetrics = useRefCallback(() => {
|
|
2133
|
-
const scrollEl = scrollElRef.current;
|
|
2134
|
-
if (!scrollEl) {
|
|
2135
|
-
metricsRef.current = null;
|
|
2136
|
-
setMetrics(null);
|
|
2137
|
-
return;
|
|
2138
|
-
}
|
|
2139
|
-
const nextMetrics = computeBarMetrics(scrollEl, viewportStateRef.current, getPortalContainer);
|
|
2140
|
-
if (metricsEqual(metricsRef.current, nextMetrics)) {
|
|
2141
|
-
return;
|
|
2142
|
-
}
|
|
2143
|
-
metricsRef.current = nextMetrics;
|
|
2144
|
-
setMetrics(nextMetrics);
|
|
2145
|
-
});
|
|
2146
|
-
const handleThumbDrag = useRefCallback(deltaX => {
|
|
2147
|
-
const scrollEl = scrollElRef.current;
|
|
2148
|
-
if (!scrollEl) {
|
|
2149
|
-
return;
|
|
2150
|
-
}
|
|
2151
|
-
const trackWidth = scrollEl.clientWidth;
|
|
2152
|
-
const scrollableWidth = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
2153
|
-
const thumbWidth = Math.max(trackWidth * scrollEl.clientWidth / scrollEl.scrollWidth - THUMB_MARGIN * 2, 24);
|
|
2154
|
-
const thumbTravel = trackWidth - thumbWidth - THUMB_MARGIN * 2;
|
|
2155
|
-
if (thumbTravel <= 0) {
|
|
2156
|
-
return;
|
|
2157
|
-
}
|
|
2158
|
-
scrollEl.scrollLeft += deltaX / thumbTravel * scrollableWidth;
|
|
2159
|
-
updateMetrics();
|
|
2160
|
-
});
|
|
2161
|
-
useEffect(() => {
|
|
2162
|
-
if (!_enabled) {
|
|
2163
|
-
scrollElRef.current = null;
|
|
2164
|
-
viewportStateRef.current = null;
|
|
2165
|
-
metricsRef.current = null;
|
|
2166
|
-
setMetrics(null);
|
|
2167
|
-
return undefined;
|
|
2168
|
-
}
|
|
2169
|
-
const root = containerRef.current;
|
|
2170
|
-
if (!root) {
|
|
2171
|
-
return undefined;
|
|
2172
|
-
}
|
|
2173
|
-
let scrollEl = null;
|
|
2174
|
-
let unobserveViewport = null;
|
|
2175
|
-
let contentResizeObserver = null;
|
|
2176
|
-
const portalContainer = typeof getPortalContainer === 'function' ? getPortalContainer() : null;
|
|
2177
|
-
const useEmbeddedPlacement = !isDocumentScrollContainer(portalContainer);
|
|
2178
|
-
const detachScrollEl = () => {
|
|
2179
|
-
var _contentResizeObserve;
|
|
2180
|
-
unobserveViewport == null || unobserveViewport();
|
|
2181
|
-
unobserveViewport = null;
|
|
2182
|
-
if (!scrollEl) {
|
|
2183
|
-
return;
|
|
2184
|
-
}
|
|
2185
|
-
scrollEl.removeEventListener('scroll', updateMetrics);
|
|
2186
|
-
(_contentResizeObserve = contentResizeObserver) == null || _contentResizeObserve.disconnect();
|
|
2187
|
-
contentResizeObserver = null;
|
|
2188
|
-
scrollElRef.current = null;
|
|
2189
|
-
viewportStateRef.current = null;
|
|
2190
|
-
scrollEl = null;
|
|
2191
|
-
};
|
|
2192
|
-
const attachScrollEl = nextScrollEl => {
|
|
2193
|
-
if (!nextScrollEl || nextScrollEl === scrollEl) {
|
|
2194
|
-
return;
|
|
2195
|
-
}
|
|
2196
|
-
detachScrollEl();
|
|
2197
|
-
scrollEl = nextScrollEl;
|
|
2198
|
-
scrollElRef.current = scrollEl;
|
|
2199
|
-
if (!useEmbeddedPlacement) {
|
|
2200
|
-
unobserveViewport = observeViewportIntersection(scrollEl, state => {
|
|
2201
|
-
viewportStateRef.current = state;
|
|
2202
|
-
updateMetrics();
|
|
2203
|
-
});
|
|
2204
|
-
}
|
|
2205
|
-
scrollEl.addEventListener('scroll', updateMetrics, {
|
|
2206
|
-
passive: true
|
|
2207
|
-
});
|
|
2208
|
-
contentResizeObserver = new ResizeObserver(updateMetrics);
|
|
2209
|
-
contentResizeObserver.observe(scrollEl);
|
|
2210
|
-
Array.from(scrollEl.children).forEach(child => {
|
|
2211
|
-
contentResizeObserver.observe(child);
|
|
2212
|
-
});
|
|
2213
|
-
};
|
|
2214
|
-
const onLayoutChange = () => {
|
|
2215
|
-
attachScrollEl(getTableScrollElement(root));
|
|
2216
|
-
updateMetrics();
|
|
2217
|
-
};
|
|
2218
|
-
const containerResizeObserver = new ResizeObserver(onLayoutChange);
|
|
2219
|
-
containerResizeObserver.observe(root);
|
|
2220
|
-
onLayoutChange();
|
|
2221
|
-
const onWindowChange = () => {
|
|
2222
|
-
if (!useEmbeddedPlacement) {
|
|
2223
|
-
updateMetrics();
|
|
2224
|
-
}
|
|
2225
|
-
};
|
|
2226
|
-
if (!useEmbeddedPlacement) {
|
|
2227
|
-
var _window$visualViewpor, _window$visualViewpor2;
|
|
2228
|
-
window.addEventListener('scroll', onWindowChange, true);
|
|
2229
|
-
window.addEventListener('resize', onWindowChange);
|
|
2230
|
-
(_window$visualViewpor = window.visualViewport) == null || _window$visualViewpor.addEventListener('resize', onWindowChange);
|
|
2231
|
-
(_window$visualViewpor2 = window.visualViewport) == null || _window$visualViewpor2.addEventListener('scroll', onWindowChange);
|
|
2232
|
-
}
|
|
2233
|
-
if (useEmbeddedPlacement && portalContainer) {
|
|
2234
|
-
portalContainer.addEventListener('scroll', updateMetrics, {
|
|
2235
|
-
passive: true
|
|
2236
|
-
});
|
|
2237
|
-
window.addEventListener('resize', updateMetrics);
|
|
2238
|
-
}
|
|
2239
|
-
return () => {
|
|
2240
|
-
detachScrollEl();
|
|
2241
|
-
containerResizeObserver.disconnect();
|
|
2242
|
-
if (!useEmbeddedPlacement) {
|
|
2243
|
-
var _window$visualViewpor3, _window$visualViewpor4;
|
|
2244
|
-
window.removeEventListener('scroll', onWindowChange, true);
|
|
2245
|
-
window.removeEventListener('resize', onWindowChange);
|
|
2246
|
-
(_window$visualViewpor3 = window.visualViewport) == null || _window$visualViewpor3.removeEventListener('resize', onWindowChange);
|
|
2247
|
-
(_window$visualViewpor4 = window.visualViewport) == null || _window$visualViewpor4.removeEventListener('scroll', onWindowChange);
|
|
2248
|
-
}
|
|
2249
|
-
if (useEmbeddedPlacement && portalContainer) {
|
|
2250
|
-
portalContainer.removeEventListener('scroll', updateMetrics);
|
|
2251
|
-
window.removeEventListener('resize', updateMetrics);
|
|
2252
|
-
}
|
|
2253
|
-
};
|
|
2254
|
-
}, [_enabled, updateMetrics, getPortalContainer]);
|
|
2255
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
2256
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
2257
|
-
ref: setContainerRef,
|
|
2258
|
-
className: className,
|
|
2259
|
-
children: children
|
|
2260
|
-
}), _enabled ? /*#__PURE__*/jsx(FloatingScrollBar, {
|
|
2261
|
-
metrics: metrics,
|
|
2262
|
-
onThumbDrag: handleThumbDrag,
|
|
2263
|
-
getPortalContainer: getPortalContainer
|
|
2264
|
-
}) : null]
|
|
2265
|
-
});
|
|
2266
|
-
});
|
|
1882
|
+
var style$1 = {"table-page":"kne-table-page_ut9rJ","fetch-stack":"kne-table-page_dpy7d","toolbar-height-reserve":"kne-table-page_daceW","table-page-tabs-outer":"kne-table-page_IowJl","table-content":"kne-table-page_dxN6N","table-with-toolbar":"kne-table-page_sf06r","is-sticky":"kne-table-page_7lYyk","is-loading-shell":"kne-table-page_LY8zA","is-mobile-render":"kne-table-page_D6KGb","has-summary":"kne-table-page_IRdzb","table-cell-skeleton":"kne-table-page_--DrO","table-skeleton-spin":"kne-table-page_cZ1zq","table-in-toolbar":"kne-table-page_sawIT","is-card-mode":"kne-table-page_kH6wM","is-card-render":"kne-table-page_-WbMN","card-mode-toggle":"kne-table-page_ostpI","mobile-load-more":"kne-table-page_UqVnb","pagination":"kne-table-page_DSTEf","total_text":"kne-table-page_pJhKr"};
|
|
2267
1883
|
|
|
2268
1884
|
const _excluded$2 = ["size", "moreType", "showLength", "list", "getPopupContainer"];
|
|
2269
1885
|
const hasButtonGroupList = buttonGroup => Array.isArray(buttonGroup == null ? void 0 : buttonGroup.list) && buttonGroup.list.length > 0;
|
|
@@ -2822,7 +2438,7 @@ const isPaginationSearchParamsEnabled = pagination => {
|
|
|
2822
2438
|
return !!(pagination != null && pagination.searchParams && typeof pagination.setSearchParams === 'function');
|
|
2823
2439
|
};
|
|
2824
2440
|
|
|
2825
|
-
const _excluded = ["data", "refresh", "reload", "requestParams", "fetchProps", "isComplete", "loadMore", "send", "dataFormat", "className", "columns", "getColumns", "pagination", "columnRenderProps", "summary", "sticky", "scrollTopInset", "stickyOffset", "renderType", "horizontalScroller", "getScrollContainer", "filter", "search", "tab", "tabProps", "batchActions", "buttonGroup", "selectedRows", "rowSelection", "renderMobile", "renderCard", "forceCard", "mobileSortToolbar", "filterSeedParams"],
|
|
2441
|
+
const _excluded = ["data", "refresh", "reload", "requestParams", "fetchProps", "isComplete", "loadMore", "send", "dataFormat", "className", "columns", "getColumns", "pagination", "columnRenderProps", "summary", "sticky", "scrollTopInset", "stickyOffset", "renderType", "horizontalScroller", "getScrollContainer", "filter", "search", "tab", "tabProps", "batchActions", "buttonGroup", "selectedRows", "rowSelection", "renderMobile", "renderCard", "forceCard", "mobileSortToolbar", "filterSeedParams", "filterFetchApiRef"],
|
|
2826
2442
|
_excluded2 = ["loading"],
|
|
2827
2443
|
_excluded3 = ["pagination", "horizontalScroller", "getScrollContainer", "filter"],
|
|
2828
2444
|
_excluded4 = ["searchParamsValue"];
|
|
@@ -3218,7 +2834,8 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3218
2834
|
renderCard,
|
|
3219
2835
|
forceCard = false,
|
|
3220
2836
|
mobileSortToolbar,
|
|
3221
|
-
filterSeedParams = {}
|
|
2837
|
+
filterSeedParams = {},
|
|
2838
|
+
filterFetchApiRef
|
|
3222
2839
|
} = _ref,
|
|
3223
2840
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
3224
2841
|
const {
|
|
@@ -3305,6 +2922,29 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3305
2922
|
});
|
|
3306
2923
|
return merged;
|
|
3307
2924
|
});
|
|
2925
|
+
|
|
2926
|
+
// react-fetch 的 reload 以 props.data(首包种子)为底合并,裸调会丢掉当前已选筛选。
|
|
2927
|
+
// 对外(ref / batchActions / summary)统一注入 filterValue,保证 UI 与查询一致。
|
|
2928
|
+
// handleFilterChange 仍走原始 reload:setState 前要用新 value 组参,不能读旧 filterValue。
|
|
2929
|
+
const injectFilterParams = useRefCallback((sendProps = {}) => {
|
|
2930
|
+
const paramsType = pagination.paramsType;
|
|
2931
|
+
const incoming = get(sendProps, paramsType);
|
|
2932
|
+
return Object.assign({}, sendProps, {
|
|
2933
|
+
[paramsType]: buildRequestParamsWithFilter(filterValue, isPlainObject(incoming) ? incoming : {})
|
|
2934
|
+
});
|
|
2935
|
+
});
|
|
2936
|
+
const reloadWithFilter = useRefCallback((sendProps, force) => reload(injectFilterParams(sendProps), force));
|
|
2937
|
+
const refreshWithFilter = useRefCallback((sendProps, force) => refresh(injectFilterParams(sendProps), force));
|
|
2938
|
+
const sendWithFilter = useRefCallback((sendProps, force) => send(injectFilterParams(sendProps), force));
|
|
2939
|
+
const loadMoreWithFilter = useRefCallback((sendProps, callback, force) => loadMore(injectFilterParams(sendProps), callback, force));
|
|
2940
|
+
if (filterFetchApiRef) {
|
|
2941
|
+
filterFetchApiRef.current = {
|
|
2942
|
+
reload: reloadWithFilter,
|
|
2943
|
+
refresh: refreshWithFilter,
|
|
2944
|
+
send: sendWithFilter,
|
|
2945
|
+
loadMore: loadMoreWithFilter
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
3308
2948
|
const formatData = useMemo(() => {
|
|
3309
2949
|
return handlerDataFormat(data);
|
|
3310
2950
|
}, [data, handlerDataFormat]);
|
|
@@ -3313,13 +2953,13 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3313
2953
|
data,
|
|
3314
2954
|
fetchProps,
|
|
3315
2955
|
requestParams,
|
|
3316
|
-
refresh,
|
|
3317
|
-
reload,
|
|
3318
|
-
loadMore,
|
|
3319
|
-
send,
|
|
2956
|
+
refresh: refreshWithFilter,
|
|
2957
|
+
reload: reloadWithFilter,
|
|
2958
|
+
loadMore: loadMoreWithFilter,
|
|
2959
|
+
send: sendWithFilter,
|
|
3320
2960
|
dataFormat,
|
|
3321
2961
|
pagination
|
|
3322
|
-
}), [data, fetchProps, requestParams,
|
|
2962
|
+
}), [data, fetchProps, requestParams, refreshWithFilter, reloadWithFilter, loadMoreWithFilter, sendWithFilter, dataFormat, pagination]);
|
|
3323
2963
|
const hasTab = !!(tab != null && tab.name && Array.isArray(tab.list) && tab.list.length > 0);
|
|
3324
2964
|
const hasInnerToolbar = !!(filter != null && (_filter$list3 = filter.list) != null && _filter$list3.length || search && search.name || batchActions && batchActions.length || showButtonGroup || showCardModeToggle);
|
|
3325
2965
|
const showOuterTab = hasTab && !isMobile;
|
|
@@ -3459,13 +3099,13 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3459
3099
|
data,
|
|
3460
3100
|
fetchProps,
|
|
3461
3101
|
requestParams,
|
|
3462
|
-
refresh,
|
|
3463
|
-
reload,
|
|
3464
|
-
loadMore,
|
|
3465
|
-
send,
|
|
3102
|
+
refresh: refreshWithFilter,
|
|
3103
|
+
reload: reloadWithFilter,
|
|
3104
|
+
loadMore: loadMoreWithFilter,
|
|
3105
|
+
send: sendWithFilter,
|
|
3466
3106
|
dataFormat,
|
|
3467
3107
|
pagination
|
|
3468
|
-
}), [data, fetchProps, requestParams,
|
|
3108
|
+
}), [data, fetchProps, requestParams, refreshWithFilter, reloadWithFilter, loadMoreWithFilter, sendWithFilter, dataFormat, pagination]);
|
|
3469
3109
|
const tableContext = _extends({}, columnRenderProps, {
|
|
3470
3110
|
requestParams,
|
|
3471
3111
|
fetchProps,
|
|
@@ -3537,7 +3177,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3537
3177
|
setCardMode(next);
|
|
3538
3178
|
}
|
|
3539
3179
|
}) : null;
|
|
3540
|
-
const tableMain = /*#__PURE__*/jsxs(
|
|
3180
|
+
const tableMain = /*#__PURE__*/jsxs(StickyScroller, {
|
|
3541
3181
|
ref: tableContentRef,
|
|
3542
3182
|
enabled: horizontalScroller && renderType === 'Table' && !isCardModeActive,
|
|
3543
3183
|
getPortalContainer: getScrollContainer,
|
|
@@ -3606,11 +3246,56 @@ const TablePageInner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3606
3246
|
loading: loadingProp
|
|
3607
3247
|
} = props,
|
|
3608
3248
|
rest = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
3249
|
+
const fetchRef = useRef(null);
|
|
3250
|
+
const filterFetchApiRef = useRef(null);
|
|
3609
3251
|
const reserveToolbar = hasToolbarArea(props, isMobile);
|
|
3610
3252
|
const loading = loadingProp !== undefined ? loadingProp : /*#__PURE__*/jsx(TablePageLoadingShell, _extends({}, props));
|
|
3253
|
+
useImperativeHandle(ref, () => ({
|
|
3254
|
+
get isLoading() {
|
|
3255
|
+
var _fetchRef$current;
|
|
3256
|
+
return (_fetchRef$current = fetchRef.current) == null ? void 0 : _fetchRef$current.isLoading;
|
|
3257
|
+
},
|
|
3258
|
+
get isComplete() {
|
|
3259
|
+
var _fetchRef$current2;
|
|
3260
|
+
return (_fetchRef$current2 = fetchRef.current) == null ? void 0 : _fetchRef$current2.isComplete;
|
|
3261
|
+
},
|
|
3262
|
+
get data() {
|
|
3263
|
+
var _fetchRef$current3;
|
|
3264
|
+
return (_fetchRef$current3 = fetchRef.current) == null ? void 0 : _fetchRef$current3.data;
|
|
3265
|
+
},
|
|
3266
|
+
get requestParams() {
|
|
3267
|
+
var _fetchRef$current4;
|
|
3268
|
+
return (_fetchRef$current4 = fetchRef.current) == null ? void 0 : _fetchRef$current4.requestParams;
|
|
3269
|
+
},
|
|
3270
|
+
get error() {
|
|
3271
|
+
var _fetchRef$current5;
|
|
3272
|
+
return (_fetchRef$current5 = fetchRef.current) == null ? void 0 : _fetchRef$current5.error;
|
|
3273
|
+
},
|
|
3274
|
+
get setData() {
|
|
3275
|
+
var _fetchRef$current6;
|
|
3276
|
+
return (_fetchRef$current6 = fetchRef.current) == null ? void 0 : _fetchRef$current6.setData;
|
|
3277
|
+
},
|
|
3278
|
+
send: (...args) => {
|
|
3279
|
+
var _ref2, _filterFetchApiRef$cu, _fetchRef$current7;
|
|
3280
|
+
return (_ref2 = ((_filterFetchApiRef$cu = filterFetchApiRef.current) == null ? void 0 : _filterFetchApiRef$cu.send) || ((_fetchRef$current7 = fetchRef.current) == null ? void 0 : _fetchRef$current7.send)) == null ? void 0 : _ref2(...args);
|
|
3281
|
+
},
|
|
3282
|
+
refresh: (...args) => {
|
|
3283
|
+
var _ref3, _filterFetchApiRef$cu2, _fetchRef$current8;
|
|
3284
|
+
return (_ref3 = ((_filterFetchApiRef$cu2 = filterFetchApiRef.current) == null ? void 0 : _filterFetchApiRef$cu2.refresh) || ((_fetchRef$current8 = fetchRef.current) == null ? void 0 : _fetchRef$current8.refresh)) == null ? void 0 : _ref3(...args);
|
|
3285
|
+
},
|
|
3286
|
+
reload: (...args) => {
|
|
3287
|
+
var _ref4, _filterFetchApiRef$cu3, _fetchRef$current9;
|
|
3288
|
+
return (_ref4 = ((_filterFetchApiRef$cu3 = filterFetchApiRef.current) == null ? void 0 : _filterFetchApiRef$cu3.reload) || ((_fetchRef$current9 = fetchRef.current) == null ? void 0 : _fetchRef$current9.reload)) == null ? void 0 : _ref4(...args);
|
|
3289
|
+
},
|
|
3290
|
+
loadMore: (...args) => {
|
|
3291
|
+
var _ref5, _filterFetchApiRef$cu4, _fetchRef$current0;
|
|
3292
|
+
return (_ref5 = ((_filterFetchApiRef$cu4 = filterFetchApiRef.current) == null ? void 0 : _filterFetchApiRef$cu4.loadMore) || ((_fetchRef$current0 = fetchRef.current) == null ? void 0 : _fetchRef$current0.loadMore)) == null ? void 0 : _ref5(...args);
|
|
3293
|
+
}
|
|
3294
|
+
}));
|
|
3611
3295
|
const fetched = /*#__PURE__*/jsx(TablePageFetched, _extends({}, rest, {
|
|
3612
3296
|
loading: loading,
|
|
3613
|
-
ref:
|
|
3297
|
+
ref: fetchRef,
|
|
3298
|
+
filterFetchApiRef: filterFetchApiRef
|
|
3614
3299
|
}));
|
|
3615
3300
|
if (!reserveToolbar) {
|
|
3616
3301
|
return fetched;
|
|
@@ -3623,14 +3308,14 @@ const TablePageInner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3623
3308
|
}), fetched]
|
|
3624
3309
|
});
|
|
3625
3310
|
});
|
|
3626
|
-
const TablePage = /*#__PURE__*/forwardRef((
|
|
3311
|
+
const TablePage = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
3627
3312
|
let {
|
|
3628
3313
|
pagination,
|
|
3629
3314
|
horizontalScroller = true,
|
|
3630
3315
|
getScrollContainer,
|
|
3631
3316
|
filter: filterProp
|
|
3632
|
-
} =
|
|
3633
|
-
props = _objectWithoutPropertiesLoose(
|
|
3317
|
+
} = _ref6,
|
|
3318
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded3);
|
|
3634
3319
|
pagination = Object.assign({}, {
|
|
3635
3320
|
showSizeChanger: true,
|
|
3636
3321
|
showQuickJumper: true,
|
|
@@ -3650,8 +3335,8 @@ const TablePage = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
3650
3335
|
pageSizeName: pagination.pageSizeName
|
|
3651
3336
|
}) : {});
|
|
3652
3337
|
const [pageSize, setPageSize] = useState(() => {
|
|
3653
|
-
var
|
|
3654
|
-
return (
|
|
3338
|
+
var _ref7, _urlPagination$pageSi;
|
|
3339
|
+
return (_ref7 = (_urlPagination$pageSi = urlPagination.pageSize) != null ? _urlPagination$pageSi : cachePageSize ? readPageSize(pageSizeKey) : null) != null ? _ref7 : pagination.pageSize;
|
|
3655
3340
|
});
|
|
3656
3341
|
const [initialCurrent] = useState(() => {
|
|
3657
3342
|
if (urlPagination.current != null) {
|