@lunit/oui
Version:
Lunit Oncology UI components
64 lines (63 loc) • 2.55 kB
JavaScript
import { styled } from '@mui/material/styles';
const DataGridContainer = styled('div')(({ theme }) => ({
height: '100%',
width: '100%',
'.MuiDataGrid-root': {
border: 'none',
overflowY: 'hidden',
borderRadius: 0,
'--DataGrid-rowBorderColor': theme.palette.neutralGrey[80],
'.MuiDataGrid-row': {
'&:last-child .MuiDataGrid-cell': {
borderBottom: `1px solid ${theme.palette.neutralGrey[80]}`,
},
'.MuiDataGrid-cellCheckbox': {
borderRight: 0,
},
'&:hover': { backgroundColor: theme.palette.others.RowHover },
'&.Mui-selected': {
backgroundColor: theme.palette.others.RowHover,
border: 'transparent',
'&:hover': { backgroundColor: theme.palette.others.RowHover },
},
'& .hover-shown': { opacity: 0 },
'&:hover .hover-shown, & .hover-shown.menu-active': { opacity: 1 },
},
'.MuiDataGrid-cell': {
fontWeight: theme.typography.body5.fontWeight,
fontSize: theme.typography.body5.fontSize,
padding: theme.spacing(0, 2),
'&.MuiDataGrid-cell--withRightBorder:not(.MuiDataGrid-cellCheckbox)': {
borderRight: `1px solid ${theme.palette.neutralGrey[80]}`,
},
'&:focus, &:focus-within, &:focus-visible': { outline: 'none' },
},
'.MuiDataGrid-columnHeader': {
padding: theme.spacing(0, 2),
'&.MuiDataGrid-columnHeader--withRightBorder:not(.MuiDataGrid-columnHeaderCheckbox)': {
borderRight: `1px solid ${theme.palette.neutralGrey[80]}`,
},
'&:focus': { outline: 'none' },
},
'.MuiDataGrid-columnSeparator': { position: 'relative' },
'.MuiDataGrid-iconSeparator': { display: 'none' },
'.MuiDataGrid-columnHeaderTitleContainer': {
padding: 0,
'&:focus': { outline: 'none' },
},
},
'.MuiDataGrid-columnHeaders': {
borderTop: `1px solid ${theme.palette.neutralGrey[80]}`,
borderBottom: `1px solid ${theme.palette.neutralGrey[80]}`,
borderRadius: 0,
'&:focus': { outline: 'none' },
'.MuiDataGrid-columnHeaderCheckbox': {
borderRight: 0,
},
},
'.MuiDataGrid-columnHeaderTitle': {
...theme.typography.body_b1,
color: theme.palette.neutralGrey[40],
},
}));
export default DataGridContainer;