@@ -3,7 +3,7 @@ import { css } from '@linaria/core';
33import clsx from 'clsx' ;
44
55import { getColSpan } from './utils' ;
6- import type { CalculatedColumn , Direction , Position , ResizedWidth } from './types' ;
6+ import type { CalculatedColumn , Direction , Maybe , Position , ResizedWidth } from './types' ;
77import type { DataGridProps } from './DataGrid' ;
88import HeaderCell from './HeaderCell' ;
99import { cell , cellFrozen } from './style/cell' ;
@@ -23,6 +23,7 @@ export interface HeaderRowProps<R, SR, K extends React.Key> extends SharedDataGr
2323 selectedCellIdx : number | undefined ;
2424 shouldFocusGrid : boolean ;
2525 direction : Direction ;
26+ headerRowClass : Maybe < string > ;
2627}
2728
2829const headerRow = css `
@@ -46,6 +47,7 @@ const headerRow = css`
4647export const headerRowClassname = `rdg-header-row ${ headerRow } ` ;
4748
4849function HeaderRow < R , SR , K extends React . Key > ( {
50+ headerRowClass,
4951 rowIdx,
5052 columns,
5153 onColumnResize,
@@ -91,9 +93,13 @@ function HeaderRow<R, SR, K extends React.Key>({
9193 < div
9294 role = "row"
9395 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+ ) }
97103 >
98104 { cells }
99105 </ div >
0 commit comments