@synerise/ds-table 0.56.2 → 0.56.4
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/VirtualTable/VirtualTable.d.ts +2 -1
- package/dist/VirtualTable/VirtualTable.js +9 -0
- package/dist/VirtualTable/VirtualTable.styles.d.ts +2 -0
- package/dist/VirtualTable/VirtualTable.styles.js +1 -1
- package/dist/VirtualTable/VirtualTable.types.d.ts +3 -1
- package/package.json +22 -22
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.56.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.56.3...@synerise/ds-table@0.56.4) (2024-08-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **table:** virtual table sticky header offsets ([177720d](https://github.com/synerise/synerise-design/commit/177720d7d92140f497c7c2234904dae73065348e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.56.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.56.2...@synerise/ds-table@0.56.3) (2024-08-27)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-table
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.56.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-table@0.56.1...@synerise/ds-table@0.56.2) (2024-08-19)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-table
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { Ref, ReactElement } from 'react';
|
|
3
3
|
import { FixedSizeList as List } from 'react-window';
|
|
4
4
|
import type { RowType, DSTableProps, RowSelection, CustomizeScrollBodyInfo, DSColumnType } from '../Table.types';
|
|
5
|
-
import type {
|
|
5
|
+
import type { VirtualTableRef, VirtualTableProps } from './VirtualTable.types';
|
|
6
6
|
declare const _default: <T extends object & RowType<T> & {
|
|
7
7
|
expandedChild?: boolean | undefined;
|
|
8
8
|
}>(p: import("../Table.types").AntTableProps<T> & {
|
|
@@ -45,6 +45,7 @@ declare const _default: <T extends object & RowType<T> & {
|
|
|
45
45
|
};
|
|
46
46
|
sticky?: ((boolean | import("rc-table/lib/interface").TableSticky | undefined) & {
|
|
47
47
|
scrollThreshold?: number | undefined;
|
|
48
|
+
offsetHeader?: number | undefined;
|
|
48
49
|
getContainer: () => HTMLDivElement;
|
|
49
50
|
}) | undefined;
|
|
50
51
|
onListRefChange?: ((ref: React.RefObject<List<any>>) => void) | undefined;
|
|
@@ -170,6 +170,10 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
170
170
|
scrollWidth = _useState4[0],
|
|
171
171
|
setScrollWidth = _useState4[1];
|
|
172
172
|
|
|
173
|
+
var _useState5 = useState(0),
|
|
174
|
+
titleBarHeight = _useState5[0],
|
|
175
|
+
setTitleBarHeight = _useState5[1];
|
|
176
|
+
|
|
173
177
|
var _useRowStar = useRowStar((rowStar == null ? void 0 : rowStar.starredRowKeys) || []),
|
|
174
178
|
getRowStarColumn = _useRowStar.getRowStarColumn; // deprecated, verify if not used and remove
|
|
175
179
|
|
|
@@ -376,6 +380,7 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
376
380
|
};
|
|
377
381
|
}, [mergedColumns, selection, rowStar, onRowClick, infiniteScroll, cellHeight]);
|
|
378
382
|
var offsetScroll = sticky && sticky !== true ? sticky.offsetScroll : 0;
|
|
383
|
+
var offsetStickyHeader = sticky && sticky !== true ? sticky.offsetHeader : 0;
|
|
379
384
|
var connectObject = useMemo(function () {
|
|
380
385
|
var obj = {};
|
|
381
386
|
Object.defineProperty(obj, 'scrollLeft', {
|
|
@@ -558,7 +563,9 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
558
563
|
useEffect(function () {
|
|
559
564
|
if (containerRef != null && containerRef.current) {
|
|
560
565
|
var headerElement = containerRef.current.querySelector('.ant-table-header');
|
|
566
|
+
var titleElement = containerRef.current.querySelector('.ant-table-title');
|
|
561
567
|
headerElement && setScrollWidth(headerElement.scrollWidth);
|
|
568
|
+
titleElement && setTitleBarHeight(titleElement.clientHeight);
|
|
562
569
|
}
|
|
563
570
|
}, [tableWidth, mergedColumns.length, dataSource.length]);
|
|
564
571
|
|
|
@@ -571,6 +578,8 @@ var VirtualTable = function VirtualTable(props, forwardedRef) {
|
|
|
571
578
|
|
|
572
579
|
return /*#__PURE__*/React.createElement(S.VirtualTableWrapper, {
|
|
573
580
|
isSticky: isSticky,
|
|
581
|
+
titleBarTop: offsetStickyHeader || 0,
|
|
582
|
+
titleBarHeight: titleBarHeight,
|
|
574
583
|
style: isSticky ? {} : relativeInlineStyle,
|
|
575
584
|
key: "relative-container",
|
|
576
585
|
ref: containerRef,
|
|
@@ -24,6 +24,8 @@ export declare const StickyScrollbarContent: import("styled-components").StyledC
|
|
|
24
24
|
export declare const ColWrapper: import("styled-components").StyledComponent<"div", any, ColWrapperProps, never>;
|
|
25
25
|
export declare const VirtualTableWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
26
26
|
isSticky: boolean;
|
|
27
|
+
titleBarHeight: number;
|
|
28
|
+
titleBarTop: number;
|
|
27
29
|
isHeaderVisible?: boolean | undefined;
|
|
28
30
|
}, never>;
|
|
29
31
|
export {};
|
|
@@ -58,5 +58,5 @@ export var VirtualTableWrapper = styled.div.withConfig({
|
|
|
58
58
|
displayName: "VirtualTablestyles__VirtualTableWrapper",
|
|
59
59
|
componentId: "aehkhc-7"
|
|
60
60
|
})(["", ""], function (props) {
|
|
61
|
-
return props.isSticky ? css([".ant-table-title{position:sticky;top
|
|
61
|
+
return props.isSticky ? css([".ant-table-title{position:sticky;top:", "px;z-index:99;}.ant-table-title,.ant-table-sticky-header{transition:top 0.3s ease-in-out;}", ";"], props.titleBarTop - props.titleBarHeight, props.isHeaderVisible && css([".ant-table-title{top:", "px;}.ant-table-sticky-header{top:", "px !important;}"], props.titleBarTop, props.titleBarTop + props.titleBarHeight)) : css(["position:relative;"]);
|
|
62
62
|
});
|
|
@@ -10,7 +10,7 @@ export type VirtualColumnType<T> = DSColumnType<T> & {
|
|
|
10
10
|
left?: number;
|
|
11
11
|
right?: number;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
13
|
+
export type VirtualTableProps<T> = DSTableProps<T> & {
|
|
14
14
|
cellHeight: number;
|
|
15
15
|
infiniteScroll?: InfiniteScrollProps;
|
|
16
16
|
initialWidth: number;
|
|
@@ -20,6 +20,7 @@ export type Props<T> = DSTableProps<T> & {
|
|
|
20
20
|
};
|
|
21
21
|
sticky?: DSTableProps<T>['sticky'] & {
|
|
22
22
|
scrollThreshold?: number;
|
|
23
|
+
offsetHeader?: number;
|
|
23
24
|
getContainer: () => HTMLDivElement;
|
|
24
25
|
};
|
|
25
26
|
onListRefChange?: (ref: RefObject<List>) => void;
|
|
@@ -34,3 +35,4 @@ export type VirtualTableRef = {
|
|
|
34
35
|
scrollToTop: () => void;
|
|
35
36
|
scrollTo: (top: number) => void;
|
|
36
37
|
};
|
|
38
|
+
export type Props<T> = VirtualTableProps<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-table",
|
|
3
|
-
"version": "0.56.
|
|
3
|
+
"version": "0.56.4",
|
|
4
4
|
"description": "Table UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -33,29 +33,29 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-alert": "^0.8.
|
|
37
|
-
"@synerise/ds-badge": "^0.8.
|
|
38
|
-
"@synerise/ds-button": "^0.21.
|
|
39
|
-
"@synerise/ds-button-group": "^0.7.
|
|
36
|
+
"@synerise/ds-alert": "^0.8.25",
|
|
37
|
+
"@synerise/ds-badge": "^0.8.6",
|
|
38
|
+
"@synerise/ds-button": "^0.21.7",
|
|
39
|
+
"@synerise/ds-button-group": "^0.7.11",
|
|
40
40
|
"@synerise/ds-checkbox": "^0.12.4",
|
|
41
|
-
"@synerise/ds-column-manager": "^0.11.
|
|
41
|
+
"@synerise/ds-column-manager": "^0.11.69",
|
|
42
42
|
"@synerise/ds-data-format": "^0.5.2",
|
|
43
|
-
"@synerise/ds-dropdown": "^0.18.
|
|
43
|
+
"@synerise/ds-dropdown": "^0.18.11",
|
|
44
44
|
"@synerise/ds-flag": "^0.5.1",
|
|
45
|
-
"@synerise/ds-icon": "^0.65.
|
|
46
|
-
"@synerise/ds-input": "^0.
|
|
47
|
-
"@synerise/ds-loader": "^0.3.
|
|
48
|
-
"@synerise/ds-menu": "^0.19.
|
|
49
|
-
"@synerise/ds-modal": "^0.17.
|
|
50
|
-
"@synerise/ds-pagination": "^0.7.
|
|
51
|
-
"@synerise/ds-result": "^0.
|
|
52
|
-
"@synerise/ds-scrollbar": "^0.11.
|
|
53
|
-
"@synerise/ds-search": "^0.9.
|
|
54
|
-
"@synerise/ds-select": "^0.16.
|
|
55
|
-
"@synerise/ds-skeleton": "^0.6.
|
|
56
|
-
"@synerise/ds-status": "^0.6.
|
|
57
|
-
"@synerise/ds-tags": "^0.10.
|
|
58
|
-
"@synerise/ds-tooltip": "^0.14.
|
|
45
|
+
"@synerise/ds-icon": "^0.65.2",
|
|
46
|
+
"@synerise/ds-input": "^0.24.1",
|
|
47
|
+
"@synerise/ds-loader": "^0.3.11",
|
|
48
|
+
"@synerise/ds-menu": "^0.19.11",
|
|
49
|
+
"@synerise/ds-modal": "^0.17.38",
|
|
50
|
+
"@synerise/ds-pagination": "^0.7.59",
|
|
51
|
+
"@synerise/ds-result": "^0.7.1",
|
|
52
|
+
"@synerise/ds-scrollbar": "^0.11.7",
|
|
53
|
+
"@synerise/ds-search": "^0.9.7",
|
|
54
|
+
"@synerise/ds-select": "^0.16.13",
|
|
55
|
+
"@synerise/ds-skeleton": "^0.6.5",
|
|
56
|
+
"@synerise/ds-status": "^0.6.19",
|
|
57
|
+
"@synerise/ds-tags": "^0.10.4",
|
|
58
|
+
"@synerise/ds-tooltip": "^0.14.37",
|
|
59
59
|
"@synerise/ds-typography": "^0.15.1",
|
|
60
60
|
"@synerise/ds-utils": "^0.28.2",
|
|
61
61
|
"@types/react-window": "^1.8.5",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"react-dom": "^16.14.0",
|
|
78
78
|
"styled-components": "5.0.1"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "d5df67eecdc1cbcb56def8c17d04b7d883876fbf"
|
|
81
81
|
}
|