1- import { Theme , ThemeProvider , createTheme , styled } from '@mui/material' ;
1+ import { Theme , ThemeProvider , createTheme , styled } from '@mui/material/styles ' ;
22import MUIDataTable , { MUIDataTableColumn } from 'mui-datatables' ;
33import React , { useCallback } from 'react' ;
44import { Checkbox , Collapse , ListItemIcon , ListItemText , Menu , MenuItem } from '../base' ;
@@ -7,7 +7,9 @@ import { EllipsisIcon } from '../icons/Ellipsis';
77import { ColView } from './Helpers/ResponsiveColumns/responsive-coulmns.tsx' ;
88import { TooltipIcon } from './TooltipIconButton' ;
99
10- export const IconWrapper = styled ( 'div' ) < { disabled ?: boolean } > ( ( { disabled = false } ) => ( {
10+ export const IconWrapper = styled ( 'div' , {
11+ shouldForwardProp : ( prop ) => prop !== 'disabled'
12+ } ) < { disabled ?: boolean } > ( ( { disabled = false } ) => ( {
1113 cursor : disabled ? 'not-allowed' : 'pointer' ,
1214 opacity : disabled ? '0.5' : '1' ,
1315 display : 'flex' ,
@@ -126,17 +128,18 @@ const dataTableTheme = (theme: Theme, backgroundColor?: string) =>
126128 typography : {
127129 fontFamily : theme . typography . fontFamily
128130 } ,
129- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
130- //@ts -ignore
131131 palette : {
132+ mode : theme . palette . mode ,
132133 text : {
133134 primary : theme . palette . text . default ,
134135 secondary : theme . palette . text . secondary
135136 } ,
136137 background : {
137- default : backgroundColor || theme . palette . background . constant ?. table ,
138- paper : backgroundColor || theme . palette . background . constant ?. table
139- }
138+ default : backgroundColor || theme . palette . background ?. constant ?. table ,
139+ paper : backgroundColor || theme . palette . background ?. constant ?. table
140+ } ,
141+ border : { ...theme . palette . border } ,
142+ icon : { ...theme . palette . icon }
140143 } ,
141144 components : {
142145 MuiTableCell : {
@@ -190,6 +193,7 @@ const dataTableTheme = (theme: Theme, backgroundColor?: string) =>
190193 intermediate : false ,
191194 color : 'transparent' ,
192195 '&.Mui-checked' : {
196+ color : theme . palette . primary . main ,
193197 '& .MuiSvgIcon-root' : {
194198 width : '1.25rem' ,
195199 height : '1.25rem' ,
@@ -287,7 +291,7 @@ const ResponsiveDataTable = ({
287291 updateCols,
288292 columnVisibility,
289293 rowsPerPageOptions = [ 10 , 25 , 50 , 100 ] ,
290- theme,
294+ theme : customTheme ,
291295 backgroundColor,
292296 ...props
293297} : ResponsiveDataTableProps ) : JSX . Element => {
@@ -391,8 +395,11 @@ const ResponsiveDataTable = ({
391395
392396 const finalTheme = ( baseTheme : Theme ) => {
393397 const defaultTheme = dataTableTheme ( baseTheme , backgroundColor ) ;
394- if ( theme ) {
395- return createTheme ( defaultTheme , typeof theme === 'function' ? theme ( baseTheme ) : theme ) ;
398+ if ( customTheme ) {
399+ return createTheme (
400+ defaultTheme ,
401+ typeof customTheme === 'function' ? customTheme ( baseTheme ) : customTheme
402+ ) ;
396403 }
397404 return defaultTheme ;
398405 } ;
@@ -404,7 +411,11 @@ const ResponsiveDataTable = ({
404411 data = { data || [ ] }
405412 title = { undefined }
406413 components = { components }
407- options = { updatedOptions }
414+ options = { {
415+ ...updatedOptions ,
416+ elevation : 0 ,
417+ enableNestedDataAccess : '.'
418+ } }
408419 { ...props }
409420 />
410421 </ ThemeProvider >
0 commit comments