@@ -11,7 +11,7 @@ import type {
11
11
} from '../interface' ;
12
12
import { getCellFixedInfo } from '../utils/fixUtil' ;
13
13
import { getColumnsKey } from '../utils/valueUtil' ;
14
- import { TableProps } from '..' ;
14
+ import type { TableProps } from '..' ;
15
15
16
16
export interface RowProps < RecordType > {
17
17
cells : readonly CellType < RecordType > [ ] ;
@@ -51,23 +51,15 @@ const HeaderRow = <RecordType extends any>(props: RowProps<RecordType>) => {
51
51
return (
52
52
< RowComponent { ...rowProps } className = { classNames . row } style = { styles . row } >
53
53
{ cells . map ( ( cell : CellType < RecordType > , cellIndex ) => {
54
- const { column } = cell ;
55
- const fixedInfo = getCellFixedInfo (
56
- cell . colStart ,
57
- cell . colEnd ,
58
- flattenColumns ,
59
- stickyOffsets ,
60
- ) ;
54
+ const { column, colStart, colEnd, colSpan } = cell ;
55
+ const fixedInfo = getCellFixedInfo ( colStart , colEnd , flattenColumns , stickyOffsets ) ;
61
56
62
- let additionalProps : React . HTMLAttributes < HTMLElement > ;
63
- if ( column && column . onHeaderCell ) {
64
- additionalProps = cell . column . onHeaderCell ( column ) ;
65
- }
57
+ const additionalProps : React . HTMLAttributes < HTMLElement > = column ?. onHeaderCell ( column ) ;
66
58
67
59
return (
68
60
< Cell
69
61
{ ...cell }
70
- scope = { column . title ? ( cell . colSpan > 1 ? 'colgroup' : 'col' ) : null }
62
+ scope = { column . title ? ( colSpan > 1 ? 'colgroup' : 'col' ) : null }
71
63
ellipsis = { column . ellipsis }
72
64
align = { column . align }
73
65
component = { CellComponent }
0 commit comments