@@ -3,7 +3,7 @@ import { css } from '@linaria/core';
3
3
import clsx from 'clsx' ;
4
4
5
5
import { getColSpan } from './utils' ;
6
- import type { CalculatedColumn , Direction , Position , ResizedWidth } from './types' ;
6
+ import type { CalculatedColumn , Direction , Maybe , Position , ResizedWidth } from './types' ;
7
7
import type { DataGridProps } from './DataGrid' ;
8
8
import HeaderCell from './HeaderCell' ;
9
9
import { cell , cellFrozen } from './style/cell' ;
@@ -23,6 +23,7 @@ export interface HeaderRowProps<R, SR, K extends React.Key> extends SharedDataGr
23
23
selectedCellIdx : number | undefined ;
24
24
shouldFocusGrid : boolean ;
25
25
direction : Direction ;
26
+ headerRowClass : Maybe < string > ;
26
27
}
27
28
28
29
const headerRow = css `
@@ -46,6 +47,7 @@ const headerRow = css`
46
47
export const headerRowClassname = `rdg-header-row ${ headerRow } ` ;
47
48
48
49
function HeaderRow < R , SR , K extends React . Key > ( {
50
+ headerRowClass,
49
51
rowIdx,
50
52
columns,
51
53
onColumnResize,
@@ -91,9 +93,13 @@ function HeaderRow<R, SR, K extends React.Key>({
91
93
< div
92
94
role = "row"
93
95
aria-rowindex = { rowIdx } // aria-rowindex is 1 based
94
- className = { clsx ( headerRowClassname , {
95
- [ rowSelectedClassname ] : selectedCellIdx === - 1
96
- } ) }
96
+ className = { clsx (
97
+ headerRowClassname ,
98
+ {
99
+ [ rowSelectedClassname ] : selectedCellIdx === - 1
100
+ } ,
101
+ headerRowClass
102
+ ) }
97
103
>
98
104
{ cells }
99
105
</ div >
0 commit comments