From de2bb88b138992606fb5a4ae97d7d95c94ac6c81 Mon Sep 17 00:00:00 2001 From: Achour berrahma Date: Wed, 22 Jan 2025 16:52:07 +0100 Subject: [PATCH] Resolve comments of PR #667 (#675) Signed-off-by: achour94 --- src/components/customAGGrid/customAggrid.tsx | 1 + .../reactHookForm/agGridTable/CustomAgGridTable.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/customAGGrid/customAggrid.tsx b/src/components/customAGGrid/customAggrid.tsx index d5b17ad9..28f138f6 100644 --- a/src/components/customAGGrid/customAggrid.tsx +++ b/src/components/customAGGrid/customAggrid.tsx @@ -68,6 +68,7 @@ export const CustomAGGrid = React.forwardRef((pr getLocaleText={getLocaleText} onColumnResized={onColumnResized} enableCellTextSelection + theme="legacy" {...agGridReactProps} /> diff --git a/src/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.tsx b/src/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.tsx index 547a8ef3..306c7c23 100644 --- a/src/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.tsx +++ b/src/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.tsx @@ -7,12 +7,12 @@ import { useCallback, useEffect, useState } from 'react'; import { useFieldArray, useFormContext } from 'react-hook-form'; -import { AgGridReact } from 'ag-grid-react'; +import { AgGridReact, AgGridReactProps } from 'ag-grid-react'; import 'ag-grid-community/styles/ag-grid.css'; import 'ag-grid-community/styles/ag-theme-alpine.css'; import { Box, useTheme } from '@mui/material'; import { useIntl } from 'react-intl'; -import { CellEditingStoppedEvent, ColumnState, RowSelectionOptions, SortChangedEvent } from 'ag-grid-community'; +import { CellEditingStoppedEvent, ColumnState, SortChangedEvent } from 'ag-grid-community'; import { BottomRightButtons } from './BottomRightButtons'; import { FieldConstants } from '../../../../utils/constants/fieldConstants'; @@ -83,7 +83,7 @@ export interface CustomAgGridTableProps { defaultColDef: unknown; pagination: boolean; paginationPageSize: number; - rowSelection?: RowSelectionOptions | 'single' | 'multiple'; + rowSelection?: AgGridReactProps['rowSelection']; alwaysShowVerticalScroll: boolean; stopEditingWhenCellsLoseFocus: boolean; } @@ -234,7 +234,7 @@ export function CustomAgGridTable({ onGridReady={onGridReady} getLocaleText={getLocaleText} cacheOverflowSize={10} - rowSelection={rowSelection || 'multiple'} + rowSelection={rowSelection ?? 'multiple'} rowDragEntireRow rowDragManaged onRowDragEnd={(e) => move(getIndex(e.node.data), e.overIndex)} @@ -251,6 +251,7 @@ export function CustomAgGridTable({ paginationPageSize={paginationPageSize} alwaysShowVerticalScroll={alwaysShowVerticalScroll} stopEditingWhenCellsLoseFocus={stopEditingWhenCellsLoseFocus} + theme="legacy" {...props} />