@kne/table-page 0.1.11 → 0.1.13
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 +296 -60
- package/dist/index.css +78 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +176 -46
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +170 -50
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -3
package/dist/index.modern.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import '@kne/table-view/dist/index.css';
|
|
2
|
+
import '@kne/scroll-loader/dist/index.css';
|
|
2
3
|
import { withFetch } from '@kne/react-fetch';
|
|
3
4
|
import { Checkbox, Row, Col, Input, List, Tooltip, Button, Collapse, Popover, Empty, Table as Table$1, Tabs, Dropdown, Pagination } from 'antd';
|
|
4
5
|
import { SearchInput, FilterOuter, FilterLines, FilterValueDisplay, getFilterValue } from '@kne/react-filter';
|
|
6
|
+
import ScrollLoader from '@kne/scroll-loader';
|
|
5
7
|
import { useState, useMemo, useRef, useCallback, useEffect, useLayoutEffect, forwardRef } from 'react';
|
|
6
8
|
import classnames from 'classnames';
|
|
7
9
|
import get from 'lodash/get';
|
|
@@ -24,6 +26,8 @@ import { createWithIntlProvider, useIntl } from '@kne/react-intl';
|
|
|
24
26
|
import filterZhCN from '@kne/react-filter/dist/locale/zh-CN';
|
|
25
27
|
import filterEnUS from '@kne/react-filter/dist/locale/en-US';
|
|
26
28
|
import { createPortal } from 'react-dom';
|
|
29
|
+
import ButtonGroup, { ButtonFooter } from '@kne/button-group';
|
|
30
|
+
import '@kne/button-group/dist/index.css';
|
|
27
31
|
import '@kne/react-filter/dist/index.css';
|
|
28
32
|
|
|
29
33
|
function _extends() {
|
|
@@ -45,12 +49,12 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
45
49
|
return t;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
const _excluded$
|
|
52
|
+
const _excluded$4 = ["renderMobile"];
|
|
49
53
|
const TableView = _ref => {
|
|
50
54
|
let {
|
|
51
55
|
renderMobile = true
|
|
52
56
|
} = _ref,
|
|
53
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
57
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
54
58
|
return /*#__PURE__*/jsx(TableView$1, _extends({
|
|
55
59
|
renderMobile: renderMobile
|
|
56
60
|
}, props));
|
|
@@ -1006,7 +1010,7 @@ const observeViewportIntersection = (element, onChange) => {
|
|
|
1006
1010
|
};
|
|
1007
1011
|
};
|
|
1008
1012
|
|
|
1009
|
-
const _excluded$
|
|
1013
|
+
const _excluded$3 = ["className", "dataSource", "columns", "rowKey", "rowSelection", "valueIsEmpty", "emptyIsPlaceholder", "placeholder", "empty", "onRowSelect", "render", "renderMobile", "context", "sticky", "scrollTopInset", "stickyOffset", "getStickyContainer", "headerStyle", "pagination", "sortRender", "mobileSortToolbar", "name", "controllerOpen", "tableServerApis", "scroll", "summary", "size"],
|
|
1010
1014
|
_excluded2$2 = ["y"],
|
|
1011
1015
|
_excluded3 = ["getContainer"];
|
|
1012
1016
|
const mapJustifyToAlign = justify => {
|
|
@@ -1089,7 +1093,7 @@ const Table = p => {
|
|
|
1089
1093
|
summary,
|
|
1090
1094
|
size
|
|
1091
1095
|
} = props,
|
|
1092
|
-
others = _objectWithoutPropertiesLoose(props, _excluded$
|
|
1096
|
+
others = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
1093
1097
|
const sizeClassName = size === 'small' ? style$2['is-size-small'] : size === 'large' ? style$2['is-size-large'] : null;
|
|
1094
1098
|
const useMobileRender = isRenderMobileActive(renderMobile, isMobile);
|
|
1095
1099
|
const columns = useMemo(() => resolveColumns(columnsProp), [columnsProp]);
|
|
@@ -1481,7 +1485,7 @@ Table.useSelectedRow = useSelectedRow;
|
|
|
1481
1485
|
Table.useSort = useSort;
|
|
1482
1486
|
Table.sortDataSource = useSort.sortDataSource;
|
|
1483
1487
|
|
|
1484
|
-
var style$1 = {"table-page":"kne-table-page_ut9rJ","table-page-tabs-outer":"kne-table-page_IowJl","table-content":"kne-table-page_dxN6N","table-with-toolbar":"kne-table-page_sf06r","is-mobile-render":"kne-table-page_D6KGb","has-summary":"kne-table-page_IRdzb","table-in-toolbar":"kne-table-page_sawIT","pagination":"kne-table-page_DSTEf","total_text":"kne-table-page_pJhKr","floating-scrollbar":"kne-table-page_iu8E1","floating-scrollbar-embedded":"kne-table-page_PIv-C","floating-scrollbar-thumb":"kne-table-page_RjZsu","is-moving":"kne-table-page_y-4Ou"};
|
|
1488
|
+
var style$1 = {"table-page":"kne-table-page_ut9rJ","table-page-tabs-outer":"kne-table-page_IowJl","table-content":"kne-table-page_dxN6N","table-with-toolbar":"kne-table-page_sf06r","is-mobile-render":"kne-table-page_D6KGb","has-summary":"kne-table-page_IRdzb","table-in-toolbar":"kne-table-page_sawIT","mobile-load-more":"kne-table-page_UqVnb","table-page-button-footer":"kne-table-page_fCJem","table-page-button-footer-inner":"kne-table-page_QUaIh","table-page-button-footer-group":"kne-table-page_cgfZv","pagination":"kne-table-page_DSTEf","total_text":"kne-table-page_pJhKr","floating-scrollbar":"kne-table-page_iu8E1","floating-scrollbar-embedded":"kne-table-page_PIv-C","floating-scrollbar-thumb":"kne-table-page_RjZsu","is-moving":"kne-table-page_y-4Ou"};
|
|
1485
1489
|
|
|
1486
1490
|
const BAR_HEIGHT = 15;
|
|
1487
1491
|
const THUMB_MARGIN = 2;
|
|
@@ -1744,7 +1748,70 @@ const HorizontalScroller = /*#__PURE__*/forwardRef(({
|
|
|
1744
1748
|
});
|
|
1745
1749
|
});
|
|
1746
1750
|
|
|
1747
|
-
|
|
1751
|
+
const _excluded$2 = ["size", "moreType", "showLength", "list", "getPopupContainer"];
|
|
1752
|
+
const hasButtonGroupList = buttonGroup => Array.isArray(buttonGroup == null ? void 0 : buttonGroup.list) && buttonGroup.list.length > 0;
|
|
1753
|
+
const normalizeButtonGroupList = (list, defaultSize) => {
|
|
1754
|
+
if (!Array.isArray(list)) {
|
|
1755
|
+
return list;
|
|
1756
|
+
}
|
|
1757
|
+
return list.map(item => {
|
|
1758
|
+
var _item$size;
|
|
1759
|
+
if (typeof item === 'function') {
|
|
1760
|
+
return item;
|
|
1761
|
+
}
|
|
1762
|
+
if (defaultSize === undefined) {
|
|
1763
|
+
return _extends({}, item);
|
|
1764
|
+
}
|
|
1765
|
+
return _extends({}, item, {
|
|
1766
|
+
size: (_item$size = item.size) != null ? _item$size : defaultSize
|
|
1767
|
+
});
|
|
1768
|
+
});
|
|
1769
|
+
};
|
|
1770
|
+
const resolveButtonGroupProps = (buttonGroup, getPopupContainer, {
|
|
1771
|
+
defaultSize,
|
|
1772
|
+
defaultShowLength,
|
|
1773
|
+
minShowLength
|
|
1774
|
+
}) => {
|
|
1775
|
+
if (!buttonGroup) {
|
|
1776
|
+
return {};
|
|
1777
|
+
}
|
|
1778
|
+
const {
|
|
1779
|
+
size,
|
|
1780
|
+
moreType,
|
|
1781
|
+
showLength,
|
|
1782
|
+
list,
|
|
1783
|
+
getPopupContainer: userGetPopupContainer
|
|
1784
|
+
} = buttonGroup,
|
|
1785
|
+
rest = _objectWithoutPropertiesLoose(buttonGroup, _excluded$2);
|
|
1786
|
+
const resolvedShowLength = Number.isInteger(showLength) ? Math.max(minShowLength, showLength) : defaultShowLength;
|
|
1787
|
+
return _extends({}, rest, {
|
|
1788
|
+
list: normalizeButtonGroupList(list, defaultSize)
|
|
1789
|
+
}, defaultSize !== undefined ? {
|
|
1790
|
+
size: size != null ? size : defaultSize
|
|
1791
|
+
} : size !== undefined ? {
|
|
1792
|
+
size
|
|
1793
|
+
} : {}, {
|
|
1794
|
+
moreType: moreType != null ? moreType : 'link',
|
|
1795
|
+
showLength: resolvedShowLength,
|
|
1796
|
+
getPopupContainer: userGetPopupContainer != null ? userGetPopupContainer : getPopupContainer
|
|
1797
|
+
});
|
|
1798
|
+
};
|
|
1799
|
+
const resolveToolbarButtonGroupProps = (buttonGroup, getPopupContainer) => {
|
|
1800
|
+
return resolveButtonGroupProps(buttonGroup, getPopupContainer, {
|
|
1801
|
+
defaultSize: 'small',
|
|
1802
|
+
defaultShowLength: 1,
|
|
1803
|
+
minShowLength: 1
|
|
1804
|
+
});
|
|
1805
|
+
};
|
|
1806
|
+
const resolveFooterButtonGroupProps = (buttonGroup, getPopupContainer) => {
|
|
1807
|
+
return resolveButtonGroupProps(buttonGroup, getPopupContainer, {
|
|
1808
|
+
defaultSize: undefined,
|
|
1809
|
+
defaultShowLength: 2,
|
|
1810
|
+
minShowLength: 2
|
|
1811
|
+
});
|
|
1812
|
+
};
|
|
1813
|
+
|
|
1814
|
+
var style = {"kne-responsive-boundary":"kne-table-page_u90lj","kne-responsive-scroll":"kne-table-page_bSj1H","table-toolbar-section":"kne-table-page_I21Xn","has-value-display":"kne-table-page_COnMY","table-toolbar":"kne-table-page_x6mv7","table-toolbar-value-display":"kne-table-page_vbwMg","table-toolbar-batch":"kne-table-page_k8-Ku","table-toolbar-batch-btn":"kne-table-page_gZtbT","table-toolbar-batch-clear-btn":"kne-table-page_o6Oml","table-toolbar-actions":"kne-table-page_t3-57","table-toolbar-button-group":"kne-table-page_2sdSC","table-toolbar-search":"kne-table-page_pB5en","table-page-tabs":"kne-table-page_UTy3R","is-mobile-render":"kne-table-page_J-AEV","has-mobile-search":"kne-table-page_14SJt","table-toolbar-search-row":"kne-table-page_zuGJv","is-mobile":"kne-table-page_n9eAS","has-mobile-search-only":"kne-table-page_Y5IR1","has-tabs":"kne-table-page_EImBh","table-toolbar-search-input":"kne-table-page_t60hK","table-toolbar-filter":"kne-table-page_Jyfm7","table-toolbar-divider":"kne-table-page_z--2N","table-toolbar-filter-outer":"kne-table-page_PiWGM","table-toolbar-filter-inner":"kne-table-page_AX3aK"};
|
|
1748
1815
|
|
|
1749
1816
|
const _excluded$1 = ["list", "displayLine", "extraExpand", "className"],
|
|
1750
1817
|
_excluded2$1 = ["className", "style"];
|
|
@@ -1826,6 +1893,7 @@ const TableToolbar = ({
|
|
|
1826
1893
|
tabProps,
|
|
1827
1894
|
renderTab: _renderTab = true,
|
|
1828
1895
|
batchActions,
|
|
1896
|
+
buttonGroup,
|
|
1829
1897
|
rowSelection,
|
|
1830
1898
|
selectedRows,
|
|
1831
1899
|
batchContext,
|
|
@@ -1873,6 +1941,7 @@ const TableToolbar = ({
|
|
|
1873
1941
|
const showBatch = batchMenuItems.length > 0;
|
|
1874
1942
|
const showFilter = (filter == null || (_filter$list = filter.list) == null ? void 0 : _filter$list.length) > 0;
|
|
1875
1943
|
const showSearch = search && search.name;
|
|
1944
|
+
const showButtonGroup = !isMobile && hasButtonGroupList(buttonGroup);
|
|
1876
1945
|
const hasTab = !!(tab != null && tab.name && Array.isArray(tab.list) && tab.list.length > 0);
|
|
1877
1946
|
const showTab = hasTab && _renderTab;
|
|
1878
1947
|
const batchButtonLabel = hasSelection ? isMobile ? formatMessage({
|
|
@@ -1886,7 +1955,7 @@ const TableToolbar = ({
|
|
|
1886
1955
|
}) : formatMessage({
|
|
1887
1956
|
id: 'BatchOperations'
|
|
1888
1957
|
});
|
|
1889
|
-
if (!showBatch && !showFilter && !showSearch && !showTab) {
|
|
1958
|
+
if (!showBatch && !showFilter && !showSearch && !showTab && !showButtonGroup) {
|
|
1890
1959
|
return null;
|
|
1891
1960
|
}
|
|
1892
1961
|
const _ref = filter || {},
|
|
@@ -1905,7 +1974,9 @@ const TableToolbar = ({
|
|
|
1905
1974
|
searchRest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
|
|
1906
1975
|
const hasValueDisplay = (filterValue == null ? void 0 : filterValue.length) > 0;
|
|
1907
1976
|
const showMobileSearchRow = isMobile && showSearch;
|
|
1908
|
-
const showMainToolbar = showBatch || showFilter || !isMobile && showSearch;
|
|
1977
|
+
const showMainToolbar = showBatch || showFilter || !isMobile && (showSearch || showButtonGroup);
|
|
1978
|
+
const showDesktopActions = !showMobileSearchRow && (showSearch || showButtonGroup);
|
|
1979
|
+
const showActionsDivider = showDesktopActions && (showBatch || showFilter);
|
|
1909
1980
|
const searchInputNode = showSearch ? /*#__PURE__*/jsx(SearchInput, _extends({
|
|
1910
1981
|
allowClear: true,
|
|
1911
1982
|
bordered: false,
|
|
@@ -1917,6 +1988,10 @@ const TableToolbar = ({
|
|
|
1917
1988
|
maxWidth: '100%'
|
|
1918
1989
|
}) : searchStyle
|
|
1919
1990
|
}, searchRest)) : null;
|
|
1991
|
+
const buttonGroupNode = showButtonGroup ? /*#__PURE__*/jsx("div", {
|
|
1992
|
+
className: style['table-toolbar-button-group'],
|
|
1993
|
+
children: /*#__PURE__*/jsx(ButtonGroup, _extends({}, resolveToolbarButtonGroupProps(buttonGroup, getPopupContainer)))
|
|
1994
|
+
}) : null;
|
|
1920
1995
|
return /*#__PURE__*/jsx(FilterOuter, {
|
|
1921
1996
|
value: filterValue,
|
|
1922
1997
|
onChange: onFilterChange,
|
|
@@ -1989,13 +2064,16 @@ const TableToolbar = ({
|
|
|
1989
2064
|
label: ""
|
|
1990
2065
|
}, filterRest))
|
|
1991
2066
|
})
|
|
1992
|
-
}) : null,
|
|
1993
|
-
children: [
|
|
2067
|
+
}) : null, showDesktopActions ? /*#__PURE__*/jsxs(Fragment, {
|
|
2068
|
+
children: [showActionsDivider ? /*#__PURE__*/jsx("span", {
|
|
1994
2069
|
className: style['table-toolbar-divider'],
|
|
1995
2070
|
"aria-hidden": true
|
|
1996
|
-
}), /*#__PURE__*/
|
|
1997
|
-
className: style['table-toolbar-
|
|
1998
|
-
children:
|
|
2071
|
+
}) : null, /*#__PURE__*/jsxs("div", {
|
|
2072
|
+
className: style['table-toolbar-actions'],
|
|
2073
|
+
children: [showSearch ? /*#__PURE__*/jsx("div", {
|
|
2074
|
+
className: style['table-toolbar-search'],
|
|
2075
|
+
children: searchInputNode
|
|
2076
|
+
}) : null, buttonGroupNode]
|
|
1999
2077
|
})]
|
|
2000
2078
|
}) : null]
|
|
2001
2079
|
}) : null, hasValueDisplay ? /*#__PURE__*/jsx("div", {
|
|
@@ -2013,8 +2091,13 @@ const TableToolbar = ({
|
|
|
2013
2091
|
});
|
|
2014
2092
|
};
|
|
2015
2093
|
|
|
2016
|
-
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", "selectedRows", "rowSelection", "renderMobile"],
|
|
2094
|
+
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"],
|
|
2017
2095
|
_excluded2 = ["pagination", "horizontalScroller", "getScrollContainer"];
|
|
2096
|
+
const defaultMergeList = (data, newData) => {
|
|
2097
|
+
return Object.assign({}, newData, {
|
|
2098
|
+
pageData: [...((data == null ? void 0 : data.pageData) || []), ...((newData == null ? void 0 : newData.pageData) || [])]
|
|
2099
|
+
});
|
|
2100
|
+
};
|
|
2018
2101
|
const readPageSize = key => {
|
|
2019
2102
|
try {
|
|
2020
2103
|
const value = localStorage.getItem(key);
|
|
@@ -2104,6 +2187,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2104
2187
|
tab,
|
|
2105
2188
|
tabProps,
|
|
2106
2189
|
batchActions,
|
|
2190
|
+
buttonGroup,
|
|
2107
2191
|
selectedRows,
|
|
2108
2192
|
rowSelection,
|
|
2109
2193
|
renderMobile = true
|
|
@@ -2113,7 +2197,10 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2113
2197
|
formatMessage
|
|
2114
2198
|
} = useIntl();
|
|
2115
2199
|
const isMobile = useIsMobile();
|
|
2200
|
+
const getPopupContainer = usePopupContainer();
|
|
2116
2201
|
const isMobileRenderActive = isRenderMobileActive(renderMobile, isMobile);
|
|
2202
|
+
const showButtonGroup = hasButtonGroupList(buttonGroup);
|
|
2203
|
+
const showMobileButtonFooter = isMobile && showButtonGroup;
|
|
2117
2204
|
const tableContentRef = useRef(null);
|
|
2118
2205
|
const pendingScrollRef = useRef(false);
|
|
2119
2206
|
const handlerDataFormat = useRefCallback(dataFormat);
|
|
@@ -2144,7 +2231,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2144
2231
|
pagination
|
|
2145
2232
|
}), [data, fetchProps, requestParams, refresh, reload, loadMore, send, dataFormat, pagination]);
|
|
2146
2233
|
const hasTab = !!(tab != null && tab.name && Array.isArray(tab.list) && tab.list.length > 0);
|
|
2147
|
-
const hasInnerToolbar = !!(filter != null && (_filter$list = filter.list) != null && _filter$list.length || search && search.name || batchActions && batchActions.length);
|
|
2234
|
+
const hasInnerToolbar = !!(filter != null && (_filter$list = filter.list) != null && _filter$list.length || search && search.name || batchActions && batchActions.length || showButtonGroup && !isMobile);
|
|
2148
2235
|
const showOuterTab = hasTab && !isMobile;
|
|
2149
2236
|
const showInnerTab = hasTab && isMobile;
|
|
2150
2237
|
const wrapWithToolbar = hasInnerToolbar || showInnerTab;
|
|
@@ -2204,9 +2291,22 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2204
2291
|
});
|
|
2205
2292
|
}
|
|
2206
2293
|
});
|
|
2294
|
+
const useMobileLoadMore = isMobileRenderActive && pagination.open && !pagination.forcePagination;
|
|
2295
|
+
const currentPage = get(requestParams, [pagination.paramsType, pagination.currentName], 1);
|
|
2296
|
+
const currentPageSize = Number(get(requestParams, [pagination.paramsType, pagination.pageSizeName], pagination.pageSize)) || pagination.pageSize || 50;
|
|
2297
|
+
const loadMoreNoMore = !formatData.total || currentPage * currentPageSize >= formatData.total;
|
|
2298
|
+
const handleLoadMore = useRefCallback(async () => {
|
|
2299
|
+
const mergeList = pagination.mergeList || defaultMergeList;
|
|
2300
|
+
await loadMore({
|
|
2301
|
+
[pagination.paramsType]: buildRequestParamsWithFilter(filterValue, {
|
|
2302
|
+
[pagination.currentName]: currentPage + 1,
|
|
2303
|
+
[pagination.pageSizeName]: currentPageSize
|
|
2304
|
+
})
|
|
2305
|
+
}, mergeList);
|
|
2306
|
+
});
|
|
2207
2307
|
const paginationConfig = useMemo(() => {
|
|
2208
2308
|
var _mobilePagination$sho;
|
|
2209
|
-
if (!pagination.open || !(formatData.total > 0)) {
|
|
2309
|
+
if (useMobileLoadMore || !pagination.open || !(formatData.total > 0)) {
|
|
2210
2310
|
return null;
|
|
2211
2311
|
}
|
|
2212
2312
|
const defaultShowTotal = total => /*#__PURE__*/jsxs(Fragment, {
|
|
@@ -2245,7 +2345,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2245
2345
|
showLessItems: (_mobilePagination$sho = mobilePagination.showLessItems) != null ? _mobilePagination$sho : true,
|
|
2246
2346
|
pageSizeOptions: pagination.pageSizeOptions || ['10', '20', '50', '100']
|
|
2247
2347
|
});
|
|
2248
|
-
}, [pagination, formatData.total, requestParams, formatMessage, handlePaginationChange, isMobileRenderActive]);
|
|
2348
|
+
}, [pagination, formatData.total, requestParams, formatMessage, handlePaginationChange, isMobileRenderActive, useMobileLoadMore]);
|
|
2249
2349
|
const batchContext = useMemo(() => ({
|
|
2250
2350
|
data,
|
|
2251
2351
|
fetchProps,
|
|
@@ -2285,47 +2385,67 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
2285
2385
|
});
|
|
2286
2386
|
const TableComponent = TABLE_COMPONENTS[renderType] || Table;
|
|
2287
2387
|
const tableElement = /*#__PURE__*/jsx(TableComponent, _extends({}, tableProps));
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2388
|
+
const tableMain = /*#__PURE__*/jsxs(HorizontalScroller, {
|
|
2389
|
+
ref: tableContentRef,
|
|
2390
|
+
enabled: horizontalScroller && renderType === 'Table',
|
|
2391
|
+
getPortalContainer: getScrollContainer,
|
|
2392
|
+
className: classnames(style$1['table-content'], 'loading-container', {
|
|
2393
|
+
'is-loading': !isComplete && !data
|
|
2394
|
+
}),
|
|
2395
|
+
children: [showOuterTab ? /*#__PURE__*/jsx(TablePageTabs, {
|
|
2396
|
+
filterValue: filterValue,
|
|
2397
|
+
onFilterChange: handleFilterChange,
|
|
2398
|
+
tab: tab,
|
|
2399
|
+
tabProps: tabProps,
|
|
2400
|
+
className: style$1['table-page-tabs-outer'],
|
|
2401
|
+
isMobileRender: isMobileRenderActive
|
|
2402
|
+
}) : null, wrapWithToolbar ? /*#__PURE__*/jsxs("div", {
|
|
2403
|
+
className: classnames(style$1['table-with-toolbar'], {
|
|
2404
|
+
[style$1['is-mobile-render']]: isMobileRenderActive
|
|
2297
2405
|
}),
|
|
2298
|
-
children: [
|
|
2406
|
+
children: [/*#__PURE__*/jsx(TableToolbar, {
|
|
2299
2407
|
filterValue: filterValue,
|
|
2300
2408
|
onFilterChange: handleFilterChange,
|
|
2409
|
+
filter: filter,
|
|
2410
|
+
search: search,
|
|
2301
2411
|
tab: tab,
|
|
2302
2412
|
tabProps: tabProps,
|
|
2303
|
-
|
|
2413
|
+
renderTab: showInnerTab,
|
|
2414
|
+
batchActions: batchActions,
|
|
2415
|
+
buttonGroup: buttonGroup,
|
|
2416
|
+
rowSelection: rowSelection,
|
|
2417
|
+
selectedRows: selectedRows,
|
|
2418
|
+
batchContext: batchContext,
|
|
2304
2419
|
isMobileRender: isMobileRenderActive
|
|
2305
|
-
})
|
|
2306
|
-
|
|
2420
|
+
}), tableElement]
|
|
2421
|
+
}) : tableElement]
|
|
2422
|
+
});
|
|
2423
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2424
|
+
className: style$1['table-page'],
|
|
2425
|
+
style: scrollTopInsetStyle,
|
|
2426
|
+
children: [useMobileLoadMore ? /*#__PURE__*/jsx(ScrollLoader, _extends({
|
|
2427
|
+
className: style$1['mobile-load-more'],
|
|
2428
|
+
completeTips: formatData.total > 0 ? undefined : null
|
|
2429
|
+
}, pagination.loadMore || {}, {
|
|
2430
|
+
useSimpleBar: false,
|
|
2431
|
+
isLoading: !isComplete,
|
|
2432
|
+
noMore: loadMoreNoMore,
|
|
2433
|
+
onLoader: handleLoadMore,
|
|
2434
|
+
children: tableMain
|
|
2435
|
+
})) : /*#__PURE__*/jsxs(Fragment, {
|
|
2436
|
+
children: [tableMain, paginationConfig ? /*#__PURE__*/jsx(Pagination, _extends({
|
|
2437
|
+
className: classnames(style$1['pagination'], {
|
|
2307
2438
|
[style$1['is-mobile-render']]: isMobileRenderActive
|
|
2308
|
-
})
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
renderTab: showInnerTab,
|
|
2317
|
-
batchActions: batchActions,
|
|
2318
|
-
rowSelection: rowSelection,
|
|
2319
|
-
selectedRows: selectedRows,
|
|
2320
|
-
batchContext: batchContext,
|
|
2321
|
-
isMobileRender: isMobileRenderActive
|
|
2322
|
-
}), tableElement]
|
|
2323
|
-
}) : tableElement]
|
|
2324
|
-
}), paginationConfig ? /*#__PURE__*/jsx(Pagination, _extends({
|
|
2325
|
-
className: classnames(style$1['pagination'], {
|
|
2326
|
-
[style$1['is-mobile-render']]: isMobileRenderActive
|
|
2439
|
+
})
|
|
2440
|
+
}, paginationConfig)) : null]
|
|
2441
|
+
}), showMobileButtonFooter ? /*#__PURE__*/jsx(ButtonFooter, {
|
|
2442
|
+
className: style$1['table-page-button-footer'],
|
|
2443
|
+
innerClassName: style$1['table-page-button-footer-inner'],
|
|
2444
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2445
|
+
className: style$1['table-page-button-footer-group'],
|
|
2446
|
+
children: /*#__PURE__*/jsx(ButtonGroup, _extends({}, resolveFooterButtonGroupProps(buttonGroup, getPopupContainer)))
|
|
2327
2447
|
})
|
|
2328
|
-
}
|
|
2448
|
+
}) : null]
|
|
2329
2449
|
});
|
|
2330
2450
|
});
|
|
2331
2451
|
const TablePageInner = withFetch(TablePageInnerContent);
|