diff --git a/.gitignore b/.gitignore index 09ec862dc1..dfdb0b8a9a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ npm-debug.log **.orig +.idea \ No newline at end of file diff --git a/README.md b/README.md index e131eac6cf..692cb4a66d 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,8 @@ function MyGrid() { ###### `rowClass?: Maybe<(row: R) => Maybe>` +###### `headerRowClass?: Maybe>` + ##### `direction?: Maybe<'ltr' | 'rtl'>` This property sets the text direction of the grid, it defaults to `'ltr'` (left-to-right). Setting `direction` to `'rtl'` has the following effects: diff --git a/src/DataGrid.tsx b/src/DataGrid.tsx index f386331d0b..dfb22f2758 100644 --- a/src/DataGrid.tsx +++ b/src/DataGrid.tsx @@ -187,6 +187,7 @@ export interface DataGridProps extends Sha */ renderers?: Maybe>; rowClass?: Maybe<(row: R, rowIdx: number) => Maybe>; + headerRowClass?: Maybe; /** @default 'ltr' */ direction?: Maybe; 'data-testid'?: Maybe; @@ -240,6 +241,7 @@ function DataGrid( className, style, rowClass, + headerRowClass, direction: rawDirection, // ARIA role: rawRole, @@ -1092,6 +1094,7 @@ function DataGrid( /> ))} extends SharedDataGr selectedCellIdx: number | undefined; shouldFocusGrid: boolean; direction: Direction; + headerRowClass: Maybe; } const headerRow = css` - @layer rdg.HeaderRow { + @layer rdg . HeaderRow { display: contents; line-height: var(--rdg-header-row-height); background-color: var(--rdg-header-background-color); @@ -47,6 +49,7 @@ const headerRow = css` export const headerRowClassname = `rdg-header-row ${headerRow}`; function HeaderRow({ + headerRowClass, rowIdx, columns, onColumnResize, @@ -92,9 +95,13 @@ function HeaderRow({
{cells}