File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export type Layout = {
10
10
horizontalScroll : boolean ;
11
11
hiddenColumns : string [];
12
12
fullHeight ?: boolean ;
13
+ resizedLayout ?: string [];
13
14
inheritLayout ?: boolean ;
14
15
};
15
16
```
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @table-library/react-table-library" ,
3
- "version" : " 2.0.15 " ,
3
+ "version" : " 2.0.16 " ,
4
4
"description" : " react-table-library" ,
5
5
"type" : " module" ,
6
6
"main" : " main.js" ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { useShiftDown } from '@table-library/react-table-library/common/hooks/us
17
17
import { Nullish } from '@table-library/react-table-library/types/common' ;
18
18
import { TableProps } from '@table-library/react-table-library/types/table' ;
19
19
import {
20
+ Layout ,
20
21
TableMemory ,
21
22
TableMemoryRef ,
22
23
TableElementRef ,
@@ -33,12 +34,12 @@ const useTableElementRef = (ref: TableElementRef | Nullish): TableElementRef =>
33
34
return tableElementRef ;
34
35
} ;
35
36
36
- const useTableMemoryRef = ( ) : TableMemoryRef => {
37
+ const useTableMemoryRef = ( layout : Layout | Nullish ) : TableMemoryRef => {
37
38
const tableMemoryRef = React . useRef < TableMemory | null > ( null ) ;
38
39
39
40
if ( ! tableMemoryRef . current ) {
40
41
tableMemoryRef . current = {
41
- resizedLayout : [ ] ,
42
+ resizedLayout : layout ?. resizedLayout ?? [ ] ,
42
43
hiddenSpacesInMemory : [ ] ,
43
44
} ;
44
45
}
@@ -63,7 +64,7 @@ const Table: React.FC<TableProps> = React.forwardRef(
63
64
ref : any ,
64
65
) => {
65
66
const tableElementRef = useTableElementRef ( ref ) ;
66
- const tableMemoryRef = useTableMemoryRef ( ) ;
67
+ const tableMemoryRef = useTableMemoryRef ( layout ) ;
67
68
68
69
// if changed, adjust useFeatures hook
69
70
const modifiedNodes = applyModifiers ( {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ export type Layout = {
5
5
horizontalScroll : boolean ;
6
6
hiddenColumns : string [ ] ;
7
7
fullHeight ?: boolean ;
8
+ resizedLayout ?: string [ ] ;
8
9
inheritLayout ?: boolean ;
9
10
} ;
10
11
You can’t perform that action at this time.
0 commit comments