@@ -57,7 +57,6 @@ const getStyle = (
57
57
const selectedRowBackground = genLinerGradient ( rowStyle . selectedRowBackground ) ;
58
58
const hoverRowBackground = genLinerGradient ( rowStyle . hoverRowBackground ) ;
59
59
const alternateBackground = genLinerGradient ( rowStyle . alternateBackground ) ;
60
- // const tableAutoHeight =
61
60
62
61
return css `
63
62
.ant-table-body {
@@ -123,7 +122,9 @@ const getStyle = (
123
122
` ;
124
123
} ;
125
124
126
- const TitleResizeHandle = styled . span `
125
+ const TitleResizeHandle = styled . span < {
126
+ $visibleResizables : boolean ;
127
+ } > `
127
128
position: absolute;
128
129
top: 0;
129
130
right: -5px;
@@ -135,10 +136,9 @@ const TitleResizeHandle = styled.span`
135
136
136
137
const BackgroundWrapper = styled . div < {
137
138
$style : TableStyleType ;
138
- $tableAutoHeight ? : boolean ;
139
+ $tableAutoHeight : boolean ;
139
140
} > `
140
- ${ ( props ) => ! props . $tableAutoHeight && ` height: calc(100% - ${ props . $style . margin } - ${ props . $style . margin } ) !important` } ;
141
- ${ ( props ) => props . $tableAutoHeight && ` height: calc(100% + ${ props . $style . margin } ` } ;
141
+ ${ ( props ) => ! props . $tableAutoHeight && `height: calc(100% - ${ props . $style . margin } - ${ props . $style . margin } );` }
142
142
background: ${ ( props ) => props . $style . background } !important;
143
143
border: ${ ( props ) => `${ props . $style . borderWidth } solid ${ props . $style . border } !important` } ;
144
144
border-radius: ${ ( props ) => props . $style . radius } !important;
@@ -435,7 +435,8 @@ const ResizeableTitle = (props: any) => {
435
435
draggableOpts = { { enableUserSelectHack : false } }
436
436
handle = { ( axis : ResizeHandleAxis , ref : ReactRef < HTMLDivElement > ) => (
437
437
< TitleResizeHandle
438
- ref = { ref }
438
+ ref = { ref }
439
+ $visibleResizables = { props . visibleResizables }
439
440
onClick = { ( e ) => {
440
441
e . preventDefault ( ) ;
441
442
e . stopPropagation ( ) ;
@@ -451,6 +452,7 @@ const ResizeableTitle = (props: any) => {
451
452
type CustomTableProps < RecordType > = Omit < TableProps < RecordType > , "components" | "columns" > & {
452
453
columns : CustomColumnType < RecordType > [ ] ;
453
454
viewModeResizable : boolean ;
455
+ visibleResizables : boolean ;
454
456
rowColorFn : RowColorViewType ;
455
457
rowHeightFn : RowHeightViewType ;
456
458
columnsStyle : TableColumnStyleType ;
@@ -673,12 +675,13 @@ export function TableCompView(props: {
673
675
const [ loading , setLoading ] = useState ( false ) ;
674
676
const { comp, onDownload, onRefresh } = props ;
675
677
const compChildren = comp . children ;
676
- const tableAutoHeight = compChildren . autoHeight . getView ( ) ;
677
678
const style = compChildren . style . getView ( ) ;
678
679
const rowStyle = compChildren . rowStyle . getView ( ) ;
679
680
const headerStyle = compChildren . headerStyle . getView ( ) ;
680
681
const toolbarStyle = compChildren . toolbarStyle . getView ( ) ;
681
682
const rowAutoHeight = compChildren . rowAutoHeight . getView ( ) ;
683
+ const tableAutoHeight = comp . getTableAutoHeight ( ) ;
684
+ const visibleResizables = compChildren . visibleResizables . getView ( ) ;
682
685
const columnsStyle = compChildren . columnsStyle . getView ( ) ;
683
686
const changeSet = useMemo ( ( ) => compChildren . columns . getChangeSet ( ) , [ compChildren . columns ] ) ;
684
687
const hasChange = useMemo ( ( ) => ! _ . isEmpty ( changeSet ) , [ changeSet ] ) ;
@@ -785,11 +788,9 @@ export function TableCompView(props: {
785
788
}
786
789
787
790
return (
788
- < BackgroundColorContext . Provider value = { style . background } >
791
+ < BackgroundColorContext . Provider value = { style . background } >
789
792
790
- < BackgroundWrapper ref = { ref } $style = { style }
791
- $tableAutoHeight = { compChildren . autoHeight . getView ( ) }
792
- >
793
+ < BackgroundWrapper ref = { ref } $style = { style } $tableAutoHeight = { tableAutoHeight } >
793
794
{ toolbar . position === "above" && toolbarView }
794
795
< TableWrapper
795
796
$style = { style }
@@ -800,8 +801,6 @@ export function TableCompView(props: {
800
801
$fixedHeader = { compChildren . fixedHeader . getView ( ) }
801
802
$fixedToolbar = { toolbar . fixedToolbar && toolbar . position === 'above' }
802
803
>
803
-
804
-
805
804
< ResizeableTable < RecordType >
806
805
expandable = { {
807
806
...expansion . expandableConfig ,
@@ -824,6 +823,7 @@ export function TableCompView(props: {
824
823
columns = { antdColumns }
825
824
columnsStyle = { columnsStyle }
826
825
viewModeResizable = { compChildren . viewModeResizable . getView ( ) }
826
+ visibleResizables = { compChildren . visibleResizables . getView ( ) }
827
827
dataSource = { pageDataInfo . data }
828
828
size = { compChildren . size . getView ( ) }
829
829
rowAutoHeight = { rowAutoHeight }
0 commit comments