[5d6f37a] | 1 | import { Theme, alpha } from '@mui/material/styles';
|
---|
| 2 | import { tableCellClasses } from '@mui/material/TableCell';
|
---|
| 3 | import { tableRowClasses } from '@mui/material/TableRow';
|
---|
| 4 |
|
---|
| 5 | // ----------------------------------------------------------------------
|
---|
| 6 |
|
---|
| 7 | export function table(theme: Theme) {
|
---|
| 8 | return {
|
---|
| 9 | MuiTableContainer: {
|
---|
| 10 | styleOverrides: {
|
---|
| 11 | root: {
|
---|
| 12 | position: 'relative',
|
---|
| 13 | },
|
---|
| 14 | },
|
---|
| 15 | },
|
---|
| 16 | MuiTableRow: {
|
---|
| 17 | styleOverrides: {
|
---|
| 18 | root: {
|
---|
| 19 | [`&.${tableRowClasses.selected}`]: {
|
---|
| 20 | backgroundColor: alpha(theme.palette.primary.dark, 0.04),
|
---|
| 21 | '&:hover': {
|
---|
| 22 | backgroundColor: alpha(theme.palette.primary.dark, 0.08),
|
---|
| 23 | },
|
---|
| 24 | },
|
---|
| 25 | '&:last-of-type': {
|
---|
| 26 | [`& .${tableCellClasses.root}`]: {
|
---|
| 27 | borderColor: 'transparent',
|
---|
| 28 | },
|
---|
| 29 | },
|
---|
| 30 | },
|
---|
| 31 | },
|
---|
| 32 | },
|
---|
| 33 | MuiTableCell: {
|
---|
| 34 | styleOverrides: {
|
---|
| 35 | root: {
|
---|
| 36 | borderBottomStyle: 'dashed',
|
---|
| 37 | },
|
---|
| 38 | head: {
|
---|
| 39 | fontSize: 14,
|
---|
| 40 | color: theme.palette.text.secondary,
|
---|
| 41 | fontWeight: theme.typography.fontWeightSemiBold,
|
---|
| 42 | backgroundColor: theme.palette.background.neutral,
|
---|
| 43 | },
|
---|
| 44 | stickyHeader: {
|
---|
| 45 | backgroundColor: theme.palette.background.paper,
|
---|
| 46 | backgroundImage: `linear-gradient(to bottom, ${theme.palette.background.neutral} 0%, ${theme.palette.background.neutral} 100%)`,
|
---|
| 47 | },
|
---|
| 48 | paddingCheckbox: {
|
---|
| 49 | paddingLeft: theme.spacing(1),
|
---|
| 50 | },
|
---|
| 51 | },
|
---|
| 52 | },
|
---|
| 53 | MuiTablePagination: {
|
---|
| 54 | styleOverrides: {
|
---|
| 55 | root: {
|
---|
| 56 | width: '100%',
|
---|
| 57 | },
|
---|
| 58 | toolbar: {
|
---|
| 59 | height: 64,
|
---|
| 60 | },
|
---|
| 61 | actions: {
|
---|
| 62 | marginRight: 8,
|
---|
| 63 | },
|
---|
| 64 | select: {
|
---|
| 65 | paddingLeft: 8,
|
---|
| 66 | '&:focus': {
|
---|
| 67 | borderRadius: theme.shape.borderRadius,
|
---|
| 68 | },
|
---|
| 69 | },
|
---|
| 70 | selectIcon: {
|
---|
| 71 | right: 4,
|
---|
| 72 | width: 16,
|
---|
| 73 | height: 16,
|
---|
| 74 | top: 'calc(50% - 8px)',
|
---|
| 75 | },
|
---|
| 76 | },
|
---|
| 77 | },
|
---|
| 78 | };
|
---|
| 79 | }
|
---|