@synerise/ds-table 0.47.17 → 0.48.1
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/CHANGELOG.md +19 -0
- package/dist/InfiniteScroll/BackToTopButton.d.ts +3 -1
- package/dist/InfiniteScroll/BackToTopButton.styles.d.ts +6 -2
- package/dist/InfiniteScroll/BackToTopButton.styles.js +4 -2
- package/dist/InfiniteScroll/InfiniteLoaderItem.d.ts +1 -4
- package/dist/InfiniteScroll/InfiniteLoaderItem.js +1 -1
- package/dist/InfiniteScroll/InfiniteLoaderItem.styles.d.ts +1 -0
- package/dist/InfiniteScroll/InfiniteLoaderItem.styles.js +6 -0
- package/dist/InfiniteScroll/InfiniteLoaderItem.types.d.ts +17 -0
- package/dist/InfiniteScroll/InfiniteLoaderItem.types.js +1 -0
- package/dist/InfiniteScroll/OuterListElement.d.ts +3 -0
- package/dist/InfiniteScroll/OuterListElement.js +78 -0
- package/dist/InfiniteScroll/constants.d.ts +0 -13
- package/dist/InfiniteScroll/utils.d.ts +1 -1
- package/dist/Table.js +4 -1
- package/dist/Table.styles.js +1 -1
- package/dist/Table.types.d.ts +12 -10
- package/dist/TableHeader/TableHeader.js +3 -2
- package/dist/TableHeader/TableHeader.types.d.ts +12 -11
- package/dist/VirtualTable/VirtualTable.d.ts +23 -8
- package/dist/VirtualTable/VirtualTable.js +145 -98
- package/dist/VirtualTable/VirtualTable.styles.d.ts +17 -1
- package/dist/VirtualTable/VirtualTable.styles.js +37 -6
- package/dist/VirtualTable/VirtualTable.types.d.ts +13 -3
- package/dist/VirtualTable/VirtualTableRow.d.ts +1 -1
- package/dist/VirtualTable/VirtualTableRow.js +1 -1
- package/dist/VirtualTable/constants.d.ts +2 -0
- package/dist/VirtualTable/constants.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/style/index.css +1 -1
- package/package.json +24 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.48.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.48.0...@synerise/ds-table@0.48.1) (2024-03-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-table
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.48.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.47.17...@synerise/ds-table@0.48.0) (2024-03-20)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **table:** sticky virtualised table ([4733821](https://github.com/synerise/synerise-design/commit/47338215ed6355a90edf7350e6002c96c9f83809))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.47.17](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.47.16...@synerise/ds-table@0.47.17) (2024-03-18)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-table
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@synerise/ds-button';
|
|
3
|
-
export declare const BackToTopButton: (props: ButtonProps
|
|
3
|
+
export declare const BackToTopButton: (props: ButtonProps & {
|
|
4
|
+
isSticky?: boolean;
|
|
5
|
+
}) => React.ReactElement;
|
|
4
6
|
export default BackToTopButton;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import Button from '@synerise/ds-button';
|
|
2
|
-
export declare const OffsetButton: import("styled-components").StyledComponent<typeof Button, any, {
|
|
2
|
+
export declare const OffsetButton: import("styled-components").StyledComponent<typeof Button, any, {
|
|
3
|
+
isSticky?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
3
5
|
declare const _default: {
|
|
4
|
-
OffsetButton: import("styled-components").StyledComponent<typeof Button, any, {
|
|
6
|
+
OffsetButton: import("styled-components").StyledComponent<typeof Button, any, {
|
|
7
|
+
isSticky?: boolean | undefined;
|
|
8
|
+
}, never>;
|
|
5
9
|
};
|
|
6
10
|
export default _default;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
2
|
import Button from '@synerise/ds-button';
|
|
3
3
|
export var OffsetButton = styled(Button).withConfig({
|
|
4
4
|
displayName: "BackToTopButtonstyles__OffsetButton",
|
|
5
5
|
componentId: "sc-8vxnei-0"
|
|
6
|
-
})(["
|
|
6
|
+
})(["", ""], function (props) {
|
|
7
|
+
return props.isSticky ? css(["&&&{transform:translate(10px,-100%);}"]) : css(["&&&{position:absolute;right:-16px;bottom:-16px;z-index:2;}"]);
|
|
8
|
+
});
|
|
7
9
|
export default {
|
|
8
10
|
OffsetButton: OffsetButton
|
|
9
11
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface LoaderItemProps {
|
|
4
|
-
infiniteScroll: InfiniteScrollProps;
|
|
5
|
-
}
|
|
2
|
+
import { LoaderItemProps } from './InfiniteLoaderItem.types';
|
|
6
3
|
declare const InfiniteLoaderItem: ({ infiniteScroll }: LoaderItemProps) => React.ReactElement;
|
|
7
4
|
export default InfiniteLoaderItem;
|
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import Alert from '@synerise/ds-alert';
|
|
3
3
|
import Button from '@synerise/ds-button';
|
|
4
4
|
import Icon, { RefreshM } from '@synerise/ds-icon';
|
|
5
|
-
import Loader from '@synerise/ds-loader';
|
|
6
5
|
import { TableLocaleContext } from '../utils/locale';
|
|
6
|
+
import { Loader } from './InfiniteLoaderItem.styles';
|
|
7
7
|
import { infiniteScrollPropsToState } from './utils';
|
|
8
8
|
|
|
9
9
|
var LoadingItem = function LoadingItem() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Loader: import("styled-components").StyledComponent<({ size, label, labelPosition, color, percent, percentFormatter, text, fontSize, mode, className, }: import("@synerise/ds-loader/dist/Loader.types").LoaderProps) => JSX.Element, any, {}, never>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
+
export type InfiniteScrollState = {
|
|
3
|
+
hasError: boolean;
|
|
4
|
+
hasMore: boolean;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type InfiniteScrollProps = InfiniteScrollState & {
|
|
8
|
+
maxScroll?: number;
|
|
9
|
+
showBackToTopButton?: boolean;
|
|
10
|
+
render?: (state: InfiniteScrollState) => ReactElement;
|
|
11
|
+
onRetryButtonClick?: (event: ReactMouseEvent<HTMLElement, MouseEvent>) => void;
|
|
12
|
+
onScrollEndReach: () => void;
|
|
13
|
+
onScrollTopReach?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export type LoaderItemProps = {
|
|
16
|
+
infiniteScroll: InfiniteScrollProps;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React, { MutableRefObject } from 'react';
|
|
2
|
+
declare const OuterListElement: (containerRef: MutableRefObject<HTMLDivElement | null | undefined>, isSticky: boolean) => React.ForwardRefExoticComponent<React.HTMLAttributes<Element> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export default OuterListElement;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var _excluded = ["height"];
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
|
|
11
|
+
import React, { useCallback, useState, forwardRef, useEffect } from 'react';
|
|
12
|
+
import Scrollbar from '@synerise/ds-scrollbar';
|
|
13
|
+
|
|
14
|
+
var OuterListElement = function OuterListElement(containerRef, isSticky) {
|
|
15
|
+
return forwardRef(function (_ref, ref) {
|
|
16
|
+
var onWheel = _ref.onWheel,
|
|
17
|
+
onScroll = _ref.onScroll,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
style = _ref.style;
|
|
20
|
+
|
|
21
|
+
var _useState = useState(null),
|
|
22
|
+
header = _useState[0],
|
|
23
|
+
setHeader = _useState[1];
|
|
24
|
+
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
if (containerRef != null && containerRef.current) {
|
|
27
|
+
var headerElement = containerRef.current.querySelector('.ant-table-header');
|
|
28
|
+
headerElement && setHeader(headerElement);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
var onScrollHandler = useCallback(function (event) {
|
|
32
|
+
if (header) {
|
|
33
|
+
header.scrollTo({
|
|
34
|
+
left: event.currentTarget.scrollLeft
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onScroll && onScroll(event);
|
|
39
|
+
}, [onScroll, header]);
|
|
40
|
+
|
|
41
|
+
var onWheelHandler = function onWheelHandler(event) {
|
|
42
|
+
if (header) {
|
|
43
|
+
var _event$currentTarget, _event$currentTarget$;
|
|
44
|
+
|
|
45
|
+
header.scrollTo({
|
|
46
|
+
left: (_event$currentTarget = event.currentTarget) == null ? void 0 : (_event$currentTarget$ = _event$currentTarget.parentElement) == null ? void 0 : _event$currentTarget$.scrollLeft
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onWheel && onWheel(event);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
if (isSticky) {
|
|
54
|
+
// uses native browser scroll
|
|
55
|
+
var _ref2 = style || {},
|
|
56
|
+
height = _ref2.height,
|
|
57
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
58
|
+
|
|
59
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
ref: ref,
|
|
61
|
+
onWheel: onWheelHandler,
|
|
62
|
+
"data-testid": "virtual-table-scrollable-window-sticky",
|
|
63
|
+
style: _objectSpread({}, rest, {
|
|
64
|
+
maxHeight: height
|
|
65
|
+
})
|
|
66
|
+
}, children);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/React.createElement(Scrollbar, {
|
|
70
|
+
ref: ref,
|
|
71
|
+
onScroll: onScrollHandler,
|
|
72
|
+
absolute: true,
|
|
73
|
+
maxHeight: style == null ? void 0 : style.height
|
|
74
|
+
}, children);
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default OuterListElement;
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface InfiniteScrollState {
|
|
3
|
-
hasError: boolean;
|
|
4
|
-
hasMore: boolean;
|
|
5
|
-
isLoading: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface InfiniteScrollProps extends InfiniteScrollState {
|
|
8
|
-
showBackToTopButton?: boolean;
|
|
9
|
-
render?: (state: InfiniteScrollState) => React.ReactElement;
|
|
10
|
-
onRetryButtonClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
11
|
-
onScrollEndReach: () => void;
|
|
12
|
-
onScrollTopReach?: () => void;
|
|
13
|
-
}
|
|
14
1
|
export declare const infiniteLoaderItemHeight = 64;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InfiniteScrollProps, InfiniteScrollState } from './
|
|
1
|
+
import { InfiniteScrollProps, InfiniteScrollState } from './InfiniteLoaderItem.types';
|
|
2
2
|
export declare const infiniteScrollPropsToState: ({ hasError, hasMore, isLoading, }: InfiniteScrollProps) => InfiniteScrollState;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
infiniteScrollPropsToState: ({ hasError, hasMore, isLoading, }: InfiniteScrollProps) => InfiniteScrollState;
|
package/dist/Table.js
CHANGED
|
@@ -35,6 +35,7 @@ function DSTable(props) {
|
|
|
35
35
|
cellSize = props.cellSize,
|
|
36
36
|
dataSource = props.dataSource,
|
|
37
37
|
dataSourceFull = props.dataSourceFull,
|
|
38
|
+
dataSourceTotalCount = props.dataSourceTotalCount,
|
|
38
39
|
roundedHeader = props.roundedHeader,
|
|
39
40
|
filters = props.filters,
|
|
40
41
|
searchComponent = props.searchComponent,
|
|
@@ -65,6 +66,7 @@ function DSTable(props) {
|
|
|
65
66
|
|
|
66
67
|
return [].concat(items);
|
|
67
68
|
}, []) : dataSource;
|
|
69
|
+
var totalCount = dataSourceTotalCount || (dataSource == null ? void 0 : dataSource.length) || (dataSourceFull == null ? void 0 : dataSourceFull.length);
|
|
68
70
|
return !hideTitleBar && /*#__PURE__*/React.createElement(TableHeader, {
|
|
69
71
|
withBorderTop: headerWithBorderTop,
|
|
70
72
|
selectedRows: size,
|
|
@@ -74,6 +76,7 @@ function DSTable(props) {
|
|
|
74
76
|
selection: selection,
|
|
75
77
|
dataSource: data,
|
|
76
78
|
dataSourceFull: dataSourceFull,
|
|
79
|
+
dataSourceTotalCount: totalCount,
|
|
77
80
|
searchComponent: searchComponent,
|
|
78
81
|
filterComponent: filterComponent,
|
|
79
82
|
headerButton: headerButton,
|
|
@@ -82,7 +85,7 @@ function DSTable(props) {
|
|
|
82
85
|
renderSelectionTitle: renderSelectionTitle,
|
|
83
86
|
hideTitlePart: hideTitlePart
|
|
84
87
|
});
|
|
85
|
-
}, [selection, grouped, dataSource, hideTitleBar, headerWithBorderTop, title, filters, itemsMenu, dataSourceFull, searchComponent, filterComponent, headerButton, rowKey, tableLocale, renderSelectionTitle, hideTitlePart]);
|
|
88
|
+
}, [selection, grouped, dataSource, dataSourceTotalCount, hideTitleBar, headerWithBorderTop, title, filters, itemsMenu, dataSourceFull, searchComponent, filterComponent, headerButton, rowKey, tableLocale, renderSelectionTitle, hideTitlePart]);
|
|
86
89
|
var footerPagination = React.useMemo(function () {
|
|
87
90
|
return _objectSpread({
|
|
88
91
|
showTotal: function showTotal(total, range) {
|
package/dist/Table.styles.js
CHANGED
|
@@ -87,7 +87,7 @@ export var Spinner = styled.div.withConfig({
|
|
|
87
87
|
export var TableWrapper = styled.div.withConfig({
|
|
88
88
|
displayName: "Tablestyles__TableWrapper",
|
|
89
89
|
componentId: "dacfhr-14"
|
|
90
|
-
})(["table{.ant-table-thead{", ";}}.ant-table-wrapper .ant-table{z-index:1;}.ant-table .ant-table-cell.ant-table-selection-column,.ant-table .ant-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:inline-block;}}.ant-table .ant-table-cell.ant-table-selection-column + .ant-table-cell.ds-table-star-column{padding-left:0;}.ant-table .ant-table-thead th{transition:background 0.3s,border-color 0.3s;background-color:", ";border-bottom-color:", ";&.ant-table-column-has-sorters{cursor:default;}&.ant-table-column-has-sorters:hover{background-color:", ";border-bottom:2px solid ", ";> *{margin-bottom:-1px;}}> *{display:flex;width:100%;}[class^='ant-table-column-sorters']{width:100%;}&.ant-table-column-sort{background-color:", ";border-bottom:2px solid ", ";&:hover{background-color:", ";border-bottom:2px solid ", ";}& > [class^='ant-table-column-sorters']{overflow:hidden;}> *{margin-bottom:-1px;}}&.ant-table-cell-ellipsis.ant-table-column-has-sorters{overflow:visible;}&:not(.ds-table-column-sort){.ds-table-column-sorter{margin-left:8px;}}&.ds-table-active-column{background-color:", ";border-bottom:2px solid ", ";cursor:default;&:hover{background-color:", ";border-bottom:2px solid ", ";}.ant-table-column-sorter{display:none;}> *{margin-bottom:-1px;}}}.ant-table tr.ant-table-row:not(:hover) td.ant-table-column-sort{background-color:", ";}.ant-table .ant-table-column-sorter{margin-left:8px;max-width:32px;min-width:32px;}.ant-table-cell .ds-sort-dropdown-button{opacity:0;}.ant-table-cell:hover .ds-sort-dropdown-button,.ant-table-cell.ant-table-column-sort .ds-sort-dropdown-button{opacity:1;}.ant-table-wrapper.virtual-table.virtual-table-infinite-scroll .ant-table .ant-table-header{box-shadow:0 4px 12px 0 rgba(35,41,54,0.04);}.virtual-table .ant-table-container{overflow:auto hidden;}.virtual-table .virtual-table-row:not(:hover) .virtual-table-cell.ant-table-column-sort{background-color:", ";}& .ant-table .ant-table-cell-scrollbar{box-shadow:none;}& .ant-table th.ant-table-cell{white-space:", ";}"], function (props) {
|
|
90
|
+
})(["table{.ant-table-thead{", ";}}.ant-table-wrapper .ant-table{z-index:1;}.ant-table .ant-table-cell.ant-table-selection-column,.ant-table .ant-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:inline-block;}}.ant-table .ant-table-cell.ant-table-selection-column + .ant-table-cell.ds-table-star-column{padding-left:0;}.ant-table .ant-table-thead th{transition:background 0.3s,border-color 0.3s;background-color:", ";border-bottom-color:", ";&.ant-table-column-has-sorters{cursor:default;}&.ant-table-column-has-sorters:hover{background-color:", ";border-bottom:2px solid ", ";> *{margin-bottom:-1px;}}> *{display:flex;width:100%;}[class^='ant-table-column-sorters']{width:100%;}&.ant-table-column-sort{background-color:", ";border-bottom:2px solid ", ";&:hover{background-color:", ";border-bottom:2px solid ", ";}& > [class^='ant-table-column-sorters']{overflow:hidden;}> *{margin-bottom:-1px;}}&.ant-table-cell-ellipsis.ant-table-column-has-sorters{overflow:visible;}&:not(.ds-table-column-sort){.ds-table-column-sorter{margin-left:8px;}}&.ds-table-active-column{background-color:", ";border-bottom:2px solid ", ";cursor:default;&:hover{background-color:", ";border-bottom:2px solid ", ";}.ant-table-column-sorter{display:none;}> *{margin-bottom:-1px;}}}.ant-table tr.ant-table-row:not(:hover) td.ant-table-column-sort{background-color:", ";}.ant-table .ant-table-column-sorter{margin-left:8px;max-width:32px;min-width:32px;}.ant-table-cell .ds-sort-dropdown-button{opacity:0;}.ant-table-cell:hover .ds-sort-dropdown-button,.ant-table-cell.ant-table-column-sort .ds-sort-dropdown-button{opacity:1;}.ant-table-wrapper.virtual-table.virtual-table-infinite-scroll .ant-table .ant-table-header{box-shadow:0 4px 12px 0 rgba(35,41,54,0.04);}.virtual-table:not(.with-sticky-header) .ant-table-container{overflow:auto hidden;}.virtual-table .virtual-table-row:not(:hover) .virtual-table-cell.ant-table-column-sort{background-color:", ";}& .ant-table .ant-table-cell-scrollbar{box-shadow:none;}& .ant-table th.ant-table-cell{white-space:", ";}"], function (props) {
|
|
91
91
|
return props.hideColumnNames ? 'display: none' : '';
|
|
92
92
|
}, function (_ref3) {
|
|
93
93
|
var theme = _ref3.theme;
|
package/dist/Table.types.d.ts
CHANGED
|
@@ -72,18 +72,19 @@ export type DSColumnType<T> = Omit<ColumnType<T>, 'fixed'> & {
|
|
|
72
72
|
sortRender?: SortRender<T>;
|
|
73
73
|
childRender?: (value: unknown, row: T, index: number) => React.ReactNode;
|
|
74
74
|
};
|
|
75
|
+
export type CustomizeScrollBodyInfo = {
|
|
76
|
+
scrollbarSize: number;
|
|
77
|
+
ref: React.Ref<{
|
|
78
|
+
scrollLeft: number;
|
|
79
|
+
}>;
|
|
80
|
+
onScroll: (info: {
|
|
81
|
+
currentTarget?: HTMLElement;
|
|
82
|
+
scrollLeft?: number;
|
|
83
|
+
}) => void;
|
|
84
|
+
};
|
|
75
85
|
type AntTableComponentsType<T> = AntTableProps<T>['components'];
|
|
76
86
|
type DSTableComponentsType<T> = AntTableComponentsType<T> & {
|
|
77
|
-
body?: (data: T[], info:
|
|
78
|
-
scrollbarSize: number;
|
|
79
|
-
ref: React.Ref<{
|
|
80
|
-
scrollLeft: number;
|
|
81
|
-
}>;
|
|
82
|
-
onScroll: (info: {
|
|
83
|
-
currentTarget?: HTMLElement;
|
|
84
|
-
scrollLeft?: number;
|
|
85
|
-
}) => void;
|
|
86
|
-
}, defaultTableProps?: DSTableProps<T>) => React.ReactNode;
|
|
87
|
+
body?: (data: T[], info: CustomizeScrollBodyInfo, defaultTableProps?: DSTableProps<T>) => React.ReactNode;
|
|
87
88
|
};
|
|
88
89
|
export type SingleColumnSort = {
|
|
89
90
|
columnKey: string;
|
|
@@ -116,5 +117,6 @@ export interface DSTableProps<T extends any & GroupType<T>> extends AntTableProp
|
|
|
116
117
|
disableColumnNamesLineBreak?: boolean;
|
|
117
118
|
onSort?: OnSortFn;
|
|
118
119
|
dataSourceFull?: T[];
|
|
120
|
+
dataSourceTotalCount?: number;
|
|
119
121
|
}
|
|
120
122
|
export {};
|
|
@@ -21,6 +21,7 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
21
21
|
selection = _ref.selection,
|
|
22
22
|
dataSource = _ref.dataSource,
|
|
23
23
|
dataSourceFull = _ref.dataSourceFull,
|
|
24
|
+
dataSourceTotalCount = _ref.dataSourceTotalCount,
|
|
24
25
|
rowKey = _ref.rowKey,
|
|
25
26
|
withBorderTop = _ref.withBorderTop,
|
|
26
27
|
headerButton = _ref.headerButton,
|
|
@@ -76,8 +77,8 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
76
77
|
ref: titleRef
|
|
77
78
|
}, title)) : /*#__PURE__*/React.createElement("strong", {
|
|
78
79
|
ref: titleRef
|
|
79
|
-
}, title)), !hideTitlePart && /*#__PURE__*/React.createElement(S.TitleSeparator, null)), !hideTitlePart && /*#__PURE__*/React.createElement(S.TitlePart, null, /*#__PURE__*/React.createElement("strong", null, formatValue(
|
|
80
|
-
}, [selection, dataSource, itemsMenu, locale, selectedRows, rowKey, dataSourceFull, renderSelectionTitle, filters, formatValue, title, isTitleTruncated, hideTitlePart]);
|
|
80
|
+
}, title)), !hideTitlePart && /*#__PURE__*/React.createElement(S.TitleSeparator, null)), !hideTitlePart && /*#__PURE__*/React.createElement(S.TitlePart, null, /*#__PURE__*/React.createElement("strong", null, formatValue(dataSourceTotalCount)), " ", /*#__PURE__*/React.createElement("span", null, locale.pagination.items))));
|
|
81
|
+
}, [selection, dataSource, itemsMenu, locale, selectedRows, rowKey, dataSourceFull, renderSelectionTitle, filters, formatValue, title, isTitleTruncated, hideTitlePart, dataSourceTotalCount]);
|
|
81
82
|
return /*#__PURE__*/React.createElement(S.Header, {
|
|
82
83
|
withBorderTop: withBorderTop
|
|
83
84
|
}, renderLeftSide, /*#__PURE__*/React.createElement(S.Right, null, headerButton, filters == null ? void 0 : filters.map(function (filter) {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactText, ReactNode } from 'react';
|
|
2
2
|
import { Filter, Locale, RowSelection } from '../Table.types';
|
|
3
|
-
export
|
|
4
|
-
key:
|
|
5
|
-
}> {
|
|
6
|
-
title?:
|
|
3
|
+
export type Props<T extends {
|
|
4
|
+
key: ReactText;
|
|
5
|
+
}> = {
|
|
6
|
+
title?: ReactNode;
|
|
7
7
|
filters?: Filter[];
|
|
8
8
|
selectedRows?: number;
|
|
9
|
-
itemsMenu:
|
|
9
|
+
itemsMenu: ReactNode;
|
|
10
10
|
selection?: RowSelection<T>;
|
|
11
11
|
dataSource: T[];
|
|
12
12
|
dataSourceFull?: T[];
|
|
13
|
-
searchComponent?:
|
|
14
|
-
filterComponent?:
|
|
13
|
+
searchComponent?: ReactNode;
|
|
14
|
+
filterComponent?: ReactNode;
|
|
15
15
|
rowKey?: Function | string;
|
|
16
16
|
withBorderTop?: boolean;
|
|
17
|
-
headerButton?:
|
|
17
|
+
headerButton?: ReactNode;
|
|
18
18
|
locale: Locale;
|
|
19
|
-
renderSelectionTitle?: (selection?: RowSelection<T>, filters?: Filter[]) =>
|
|
19
|
+
renderSelectionTitle?: (selection?: RowSelection<T>, filters?: Filter[]) => ReactNode;
|
|
20
20
|
hideTitlePart?: boolean;
|
|
21
|
-
|
|
21
|
+
dataSourceTotalCount?: number;
|
|
22
|
+
};
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
}>(
|
|
8
|
-
|
|
1
|
+
import React, { Ref, ReactElement } from 'react';
|
|
2
|
+
import { FixedSizeList as List } from 'react-window';
|
|
3
|
+
import { RowType, DSTableProps } from '../Table.types';
|
|
4
|
+
import { Props, VirtualTableRef } from './VirtualTable.types';
|
|
5
|
+
declare const _default: <T extends object & RowType<T> & {
|
|
6
|
+
expandedChild?: boolean | undefined;
|
|
7
|
+
}>(p: DSTableProps<T> & {
|
|
8
|
+
cellHeight: number;
|
|
9
|
+
infiniteScroll?: import("../InfiniteScroll/InfiniteLoaderItem.types").InfiniteScrollProps | undefined;
|
|
10
|
+
initialWidth: number;
|
|
11
|
+
scroll: {
|
|
12
|
+
x?: number | undefined;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
sticky?: ((boolean | import("rc-table/lib/interface").TableSticky | undefined) & {
|
|
16
|
+
scrollThreshold?: number | undefined;
|
|
17
|
+
}) | undefined;
|
|
18
|
+
onListRefChange?: ((ref: React.RefObject<List<any>>) => void) | undefined;
|
|
19
|
+
onRowClick?: ((row: T) => void) | undefined;
|
|
20
|
+
} & {
|
|
21
|
+
ref?: React.Ref<VirtualTableRef> | undefined;
|
|
22
|
+
}) => ReactElement;
|
|
23
|
+
export default _default;
|