@@ -131,9 +131,10 @@ const TableWrapper = styled.div<{
131131 $rowStyle : TableRowStyleType ;
132132 toolbarPosition : "above" | "below" | "close" ;
133133 fixedHeader : boolean ;
134+ fixedToolbar : boolean ;
134135} > `
135136 max-height: 100%;
136- overflow-y: ${ ( props ) => ( props . fixedHeader ? "hidden" : " auto" ) } ;
137+ overflow-y: auto;
137138 background: white;
138139 border: ${ ( props ) => `1px solid ${ props . $style . border } ` } ;
139140 border-radius: ${ ( props ) => props . $style . radius } ;
@@ -168,6 +169,10 @@ const TableWrapper = styled.div<{
168169 border-top: none !important;
169170 border-inline-start: none !important;
170171
172+ .ant-table-content {
173+ overflow: unset !important;
174+ }
175+
171176 // A table expand row contains table
172177 .ant-table-tbody .ant-table-wrapper:only-child .ant-table {
173178 margin: 0;
@@ -182,7 +187,15 @@ const TableWrapper = styled.div<{
182187 border-color: ${ ( props ) => props . $style . border } ;
183188 color: ${ ( props ) => props . $style . headerText } ;
184189 border-inline-end: ${ ( props ) => `1px solid ${ props . $style . border } ` } !important;
185-
190+ ${ ( props ) =>
191+ props . fixedHeader && `
192+ position: sticky;
193+ position: -webkit-sticky;
194+ top: ${ props . fixedToolbar ? '47px' : '0' } ;
195+ z-index: 99;
196+ `
197+ }
198+
186199 &:last-child {
187200 border-inline-end: none !important;
188201 }
@@ -371,9 +384,6 @@ type CustomTableProps<RecordType> = Omit<TableProps<RecordType>, "components" |
371384 viewModeResizable : boolean ;
372385 rowColorFn : RowColorViewType ;
373386 columnsStyle : TableColumnStyleType ;
374- fixedHeader : boolean ;
375- height ?: number ;
376- autoHeight ?: boolean ;
377387} ;
378388
379389function TableCellView ( props : {
@@ -547,9 +557,7 @@ function ResizeableTable<RecordType extends object>(props: CustomTableProps<Reco
547557 columns = { columns }
548558 scroll = { {
549559 x : COL_MIN_WIDTH * columns . length ,
550- y : props . fixedHeader && props . height && ! props . autoHeight
551- ? `${ props . height - 100 } px`
552- : undefined ,
560+ y : undefined ,
553561 } }
554562 > </ Table >
555563 ) ;
@@ -563,10 +571,10 @@ export function TableCompView(props: {
563571 onDownload : ( fileName : string ) => void ;
564572} ) {
565573 const editorState = useContext ( EditorContext ) ;
566- const { width, height , ref } = useResizeDetector ( {
574+ const { width, ref } = useResizeDetector ( {
567575 refreshMode : "debounce" ,
568576 refreshRate : 600 ,
569- handleHeight : true ,
577+ handleHeight : false ,
570578 } ) ;
571579 const viewMode = useUserViewMode ( ) ;
572580 const compName = useContext ( CompNameContext ) ;
@@ -591,7 +599,6 @@ export function TableCompView(props: {
591599 ( ) => compChildren . dynamicColumnConfig . getView ( ) ,
592600 [ compChildren . dynamicColumnConfig ]
593601 ) ;
594- const autoHeight = compChildren . autoHeight . getView ( ) ;
595602 const columnsAggrData = comp . columnAggrData ;
596603 const expansion = useMemo ( ( ) => compChildren . expansion . getView ( ) , [ compChildren . expansion ] ) ;
597604 const antdColumns = useMemo (
@@ -689,6 +696,7 @@ export function TableCompView(props: {
689696 $rowStyle = { rowStyle }
690697 toolbarPosition = { toolbar . position }
691698 fixedHeader = { compChildren . fixedHeader . getView ( ) }
699+ fixedToolbar = { toolbar . fixedToolbar && toolbar . position === 'above' }
692700 >
693701 { toolbar . position === "above" && toolbarView }
694702 < ResizeableTable < RecordType >
@@ -709,15 +717,12 @@ export function TableCompView(props: {
709717 onTableChange ( pagination , filters , sorter , extra , comp . dispatch , onEvent ) ;
710718 } }
711719 showHeader = { ! compChildren . hideHeader . getView ( ) }
712- fixedHeader = { compChildren . fixedHeader . getView ( ) }
713720 columns = { antdColumns }
714721 columnsStyle = { columnsStyle }
715722 viewModeResizable = { compChildren . viewModeResizable . getView ( ) }
716723 dataSource = { pageDataInfo . data }
717724 size = { compChildren . size . getView ( ) }
718725 tableLayout = "fixed"
719- height = { height }
720- autoHeight = { autoHeight }
721726 loading = {
722727 loading ||
723728 // fixme isLoading type
0 commit comments