From c8dcb0c185650533349f5758a7cf39ba82212ef3 Mon Sep 17 00:00:00 2001 From: Magnus Heskestad Waage <57612883+mhwaage@users.noreply.github.com> Date: Wed, 22 May 2024 09:41:42 +0200 Subject: [PATCH] Forward multiRowSelection options to tanstack (#3355) --- packages/eds-data-grid-react/src/EdsDataGrid.tsx | 2 ++ packages/eds-data-grid-react/src/EdsDataGridProps.ts | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/packages/eds-data-grid-react/src/EdsDataGrid.tsx b/packages/eds-data-grid-react/src/EdsDataGrid.tsx index 30f23db01a..6b17d838e4 100644 --- a/packages/eds-data-grid-react/src/EdsDataGrid.tsx +++ b/packages/eds-data-grid-react/src/EdsDataGrid.tsx @@ -41,6 +41,7 @@ export function EdsDataGrid({ columnResizeMode, pageSize, rowSelection, + multiRowSelection, selectedRows, enableColumnFiltering, debug, @@ -227,6 +228,7 @@ export function EdsDataGrid({ debugHeaders: debug, debugColumns: debug, enableRowSelection: rowSelection ?? false, + enableMultiRowSelection: multiRowSelection, enableColumnPinning: true, enablePinning: true, getRowId, diff --git a/packages/eds-data-grid-react/src/EdsDataGridProps.ts b/packages/eds-data-grid-react/src/EdsDataGridProps.ts index 0da9d16d37..281feba21d 100644 --- a/packages/eds-data-grid-react/src/EdsDataGridProps.ts +++ b/packages/eds-data-grid-react/src/EdsDataGridProps.ts @@ -34,6 +34,13 @@ type BaseProps = { * @default false */ rowSelection?: boolean | ((row: Row) => boolean) + /** + * Only used if row selection has been enabled via `rowSelection` + * Enables/disables multiple row selection for all rows in the table OR + * A function that given a row, returns whether to enable/disable multiple row selection for that row's children/grandchildren + * @default true + */ + multiRowSelection?: boolean | ((row: Row) => boolean) /** * Callback for when row-selection changes */