@@ -180,37 +180,37 @@ const hookColumRender = <
180180 < React . Fragment >
181181 { render ?.( d , row , index ) }
182182 {
183- columnSchema && ( 'sorter' in columnSchema || columnSchema . style || columnSchema . hoverStyle || columnSchema . rowHoverStyle || columnSchema . columnHoverStyle )
184- ? (
185- < div
186- style = { { display : 'none' } }
187- ref = { ( el ) => {
188- const tdEl = el ?. parentElement ;
189- if ( tdEl ) {
190- const context = { props : { record : row . record , recordIndex : row . index , ext : extraProps . ext } } ;
191- const parseStyleSchema = ( style : string | Record < string , string > | undefined ) => parseCSS ( typeof style === 'string' ? safeExecute ( style , context ) : style ) ;
192- tdEl . dataset . tableUuid = tableInfo . uuid ;
193- tdEl . dataset . columnKey = columnSchema . key ;
194- tdEl . dataset . rowKey = row . key ;
195- tdEl . dataset . basicStyle = stringifyCSS ( Object . assign (
196- {
197- 'text-align' : columnSchema . align ,
198- background : sorter ?. key === columnSchema . key ? 'var(--drip-table-column-sorted-background-color, inherit)' : void 0 ,
199- } ,
200- parseStyleSchema ( columnSchema . style ) ,
201- ) ) ;
202- tdEl . dataset . hoverStyle = stringifyCSS ( parseStyleSchema ( columnSchema . hoverStyle ) ) ;
203- tdEl . dataset . rowHoverStyle = stringifyCSS ( parseStyleSchema ( columnSchema . rowHoverStyle ) ) ;
204- tdEl . dataset . columnHoverStyle = stringifyCSS ( parseStyleSchema ( columnSchema . columnHoverStyle ) ) ;
205- tdEl . addEventListener ( 'mouseenter' , onCellMouseEnter ) ;
206- tdEl . addEventListener ( 'mouseleave' , onCellMouseLeave ) ;
207- updateCellElementStyle ( tdEl , void 0 , void 0 ) ;
208- }
209- } }
210- />
211- )
212- : null
213- }
183+ columnSchema && ( 'sorter' in columnSchema || columnSchema . style || columnSchema . hoverStyle || columnSchema . rowHoverStyle || columnSchema . columnHoverStyle )
184+ ? (
185+ < div
186+ style = { { display : 'none' } }
187+ ref = { ( el ) => {
188+ const tdEl = el ?. parentElement ;
189+ if ( tdEl ) {
190+ const context = { props : { record : row . record , recordIndex : row . index , ext : extraProps . ext } } ;
191+ const parseStyleSchema = ( style : string | Record < string , string > | undefined ) => parseCSS ( typeof style === 'string' ? safeExecute ( style , context ) : style ) ;
192+ tdEl . dataset . tableUuid = tableInfo . uuid ;
193+ tdEl . dataset . columnKey = columnSchema . key ;
194+ tdEl . dataset . rowKey = row . key ;
195+ tdEl . dataset . basicStyle = stringifyCSS ( Object . assign (
196+ {
197+ 'text-align' : columnSchema . align ,
198+ background : sorter ?. key === columnSchema . key ? 'var(--drip-table-column-sorted-background-color, inherit)' : void 0 ,
199+ } ,
200+ parseStyleSchema ( columnSchema . style ) ,
201+ ) ) ;
202+ tdEl . dataset . hoverStyle = stringifyCSS ( parseStyleSchema ( columnSchema . hoverStyle ) ) ;
203+ tdEl . dataset . rowHoverStyle = stringifyCSS ( parseStyleSchema ( columnSchema . rowHoverStyle ) ) ;
204+ tdEl . dataset . columnHoverStyle = stringifyCSS ( parseStyleSchema ( columnSchema . columnHoverStyle ) ) ;
205+ tdEl . addEventListener ( 'mouseenter' , onCellMouseEnter ) ;
206+ tdEl . addEventListener ( 'mouseleave' , onCellMouseLeave ) ;
207+ updateCellElementStyle ( tdEl , void 0 , void 0 ) ;
208+ }
209+ } }
210+ />
211+ )
212+ : null
213+ }
214214 </ React . Fragment >
215215 ) ;
216216 } ;
@@ -1422,7 +1422,9 @@ function TableLayout<
14221422 </ Slot >
14231423 )
14241424 : (
1425- < span className = { `${ prefixCls } -row-slot__error` } > { `自定义插槽组件渲染函数 tableProps.slots['${ slotType } '] 不存在` } </ span >
1425+ < span className = { `${ prefixCls } -row-slot__error` } >
1426+ { `自定义插槽组件渲染函数 tableProps.slots['${ slotType } '] 不存在` }
1427+ </ span >
14261428 ) ;
14271429 }
14281430 return render ?.( o , row , index ) ;
@@ -1772,8 +1774,8 @@ function TableLayout<
17721774 ...subtable ? tableProps . subtableProps . filter ( sp => sp . subtableID === subtable . id ) || [ ] : [ ] ,
17731775 ...tableProps . subtableProps . filter (
17741776 sp => sp . recordKeys
1775- && sp . recordKeys . length === 1
1776- && sp . recordKeys [ 0 ] === row . record [ rowKey ] ,
1777+ && sp . recordKeys . length === 1
1778+ && sp . recordKeys [ 0 ] === row . record [ rowKey ] ,
17771779 ) || [ ] ,
17781780 ] . map ( sp => sp . properties ) ,
17791781 )
@@ -1901,9 +1903,8 @@ function TableLayout<
19011903 [ tableProps . emptyText , tableProps . schema . emptyText ] ,
19021904 ) ;
19031905
1904- return (
1906+ const renderTableLayout = (
19051907 < React . Fragment >
1906- { paginationPosition === 'top' ? renderPagination : void 0 }
19071908 { props . header }
19081909 < ResizeObserver onResize = { rcTableOnResize } >
19091910 < div className = { `${ prefixCls } -resize-observer` } >
@@ -1968,9 +1969,24 @@ function TableLayout<
19681969 </ div >
19691970 </ ResizeObserver >
19701971 { props . footer }
1971- { paginationPosition === 'bottom' ? renderPagination : void 0 }
19721972 </ React . Fragment >
19731973 ) ;
1974+
1975+ return tableProps . schema . pagination && tableProps . schema . pagination ?. sticky
1976+ ? (
1977+ < React . Fragment >
1978+ { paginationPosition === 'top' ? renderPagination : void 0 }
1979+ < div > { renderTableLayout } </ div >
1980+ { paginationPosition === 'bottom' ? renderPagination : void 0 }
1981+ </ React . Fragment >
1982+ )
1983+ : (
1984+ < React . Fragment >
1985+ { paginationPosition === 'top' ? renderPagination : void 0 }
1986+ { renderTableLayout }
1987+ { paginationPosition === 'bottom' ? renderPagination : void 0 }
1988+ </ React . Fragment >
1989+ ) ;
19741990}
19751991
19761992export default TableLayout ;
0 commit comments