material-react-table 0.25.0 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +13 -11
  2. package/dist/{utils.d.ts → column.utils.d.ts} +1 -1
  3. package/dist/filtersFns.d.ts +22 -54
  4. package/dist/localization.d.ts +3 -0
  5. package/dist/material-react-table.cjs.development.js +188 -103
  6. package/dist/material-react-table.cjs.development.js.map +1 -1
  7. package/dist/material-react-table.cjs.production.min.js +1 -1
  8. package/dist/material-react-table.cjs.production.min.js.map +1 -1
  9. package/dist/material-react-table.esm.js +188 -103
  10. package/dist/material-react-table.esm.js.map +1 -1
  11. package/dist/table/MRT_TableRoot.d.ts +1 -1
  12. package/package.json +1 -1
  13. package/src/body/MRT_TableBodyCell.tsx +3 -1
  14. package/src/body/MRT_TableBodyRow.tsx +3 -1
  15. package/src/body/MRT_TableDetailPanel.tsx +5 -3
  16. package/src/buttons/MRT_CopyButton.tsx +5 -3
  17. package/src/buttons/MRT_ExpandButton.tsx +5 -3
  18. package/src/{utils.ts → column.utils.ts} +0 -0
  19. package/src/filtersFns.ts +47 -13
  20. package/src/footer/MRT_TableFooterCell.tsx +3 -1
  21. package/src/head/MRT_TableHeadCell.tsx +5 -1
  22. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +5 -3
  23. package/src/head/MRT_TableHeadCellGrabHandle.tsx +1 -1
  24. package/src/inputs/MRT_FilterTextField.tsx +9 -4
  25. package/src/inputs/MRT_SelectCheckbox.tsx +5 -3
  26. package/src/localization.ts +6 -0
  27. package/src/menus/MRT_FilterOptionMenu.tsx +105 -72
  28. package/src/menus/MRT_ShowHideColumnsMenu.tsx +1 -1
  29. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +1 -1
  30. package/src/table/MRT_Table.tsx +5 -3
  31. package/src/table/MRT_TableContainer.tsx +5 -3
  32. package/src/table/MRT_TableRoot.tsx +12 -12
  33. package/src/toolbar/MRT_TablePagination.tsx +5 -3
  34. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +5 -3
  35. package/src/toolbar/MRT_ToolbarBottom.tsx +3 -1
  36. package/src/toolbar/MRT_ToolbarTop.tsx +3 -1
@@ -51,15 +51,17 @@ export const MRT_TableContainer: FC<Props> = ({ table }) => {
51
51
  <TableContainer
52
52
  ref={tableContainerRef}
53
53
  {...tableContainerProps}
54
- sx={{
54
+ sx={(theme) => ({
55
55
  maxWidth: '100%',
56
56
  maxHeight:
57
57
  enableStickyHeader || enableRowVirtualization
58
58
  ? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 9999px)`
59
59
  : undefined,
60
60
  overflow: 'auto',
61
- ...tableContainerProps?.sx,
62
- }}
61
+ ...(tableContainerProps?.sx instanceof Function
62
+ ? tableContainerProps.sx(theme)
63
+ : (tableContainerProps?.sx as any)),
64
+ })}
63
65
  style={{
64
66
  maxHeight: isFullScreen
65
67
  ? `calc(100vh - ${totalToolbarHeight}px)`
@@ -10,28 +10,28 @@ import {
10
10
  getSortedRowModel,
11
11
  useReactTable,
12
12
  } from '@tanstack/react-table';
13
- import {
14
- MRT_Cell,
15
- MRT_Column,
16
- MRT_ColumnDef,
17
- MRT_FilterOption,
18
- MRT_Row,
19
- MRT_TableInstance,
20
- MRT_TableState,
21
- } from '..';
13
+ import { Box, Dialog, Grow } from '@mui/material';
22
14
  import { MRT_ExpandAllButton } from '../buttons/MRT_ExpandAllButton';
23
15
  import { MRT_ExpandButton } from '../buttons/MRT_ExpandButton';
24
16
  import { MRT_ToggleRowActionMenuButton } from '../buttons/MRT_ToggleRowActionMenuButton';
25
17
  import { MRT_SelectCheckbox } from '../inputs/MRT_SelectCheckbox';
26
- import { MaterialReactTableProps } from '../MaterialReactTable';
27
18
  import { MRT_TablePaper } from './MRT_TablePaper';
28
- import { Box, Dialog, Grow } from '@mui/material';
29
19
  import {
30
20
  prepareColumns,
31
21
  getAllLeafColumnDefs,
32
22
  getDefaultColumnOrderIds,
33
- } from '../utils';
23
+ } from '../column.utils';
34
24
  import { MRT_FilterFns } from '../filtersFns';
25
+ import type {
26
+ MRT_Cell,
27
+ MRT_Column,
28
+ MRT_ColumnDef,
29
+ MRT_FilterOption,
30
+ MRT_Row,
31
+ MRT_TableInstance,
32
+ MRT_TableState,
33
+ MaterialReactTableProps,
34
+ } from '..';
35
35
 
36
36
  const defaultDisplayColumnDefOptions = {
37
37
  columnDefType: 'display',
@@ -52,7 +52,7 @@ export const MRT_TablePagination: FC<Props> = ({ table, position }) => {
52
52
  showFirstButton={showFirstLastPageButtons}
53
53
  showLastButton={showFirstLastPageButtons}
54
54
  {...tablePaginationProps}
55
- sx={{
55
+ sx={(theme) => ({
56
56
  m: '0 0.5rem',
57
57
  mt:
58
58
  position === 'top' &&
@@ -62,8 +62,10 @@ export const MRT_TablePagination: FC<Props> = ({ table, position }) => {
62
62
  : undefined,
63
63
  position: 'relative',
64
64
  zIndex: 2,
65
- ...tablePaginationProps?.sx,
66
- }}
65
+ ...(tablePaginationProps?.sx instanceof Function
66
+ ? tablePaginationProps.sx(theme)
67
+ : (tablePaginationProps?.sx as any)),
68
+ })}
67
69
  />
68
70
  );
69
71
  };
@@ -63,7 +63,7 @@ export const MRT_ToolbarAlertBanner: FC<Props> = ({
63
63
  color="info"
64
64
  icon={false}
65
65
  {...alertProps}
66
- sx={{
66
+ sx={(theme) => ({
67
67
  borderRadius: 0,
68
68
  fontSize: '1rem',
69
69
  left: 0,
@@ -73,8 +73,10 @@ export const MRT_ToolbarAlertBanner: FC<Props> = ({
73
73
  top: 0,
74
74
  width: '100%',
75
75
  zIndex: 2,
76
- ...alertProps?.sx,
77
- }}
76
+ ...(alertProps?.sx instanceof Function
77
+ ? alertProps.sx(theme)
78
+ : (alertProps?.sx as any)),
79
+ })}
78
80
  >
79
81
  {alertProps?.title && <AlertTitle>{alertProps.title}</AlertTitle>}
80
82
  <Box sx={{ p: '0.5rem 1rem' }}>
@@ -49,7 +49,9 @@ export const MRT_ToolbarBottom: FC<Props> = ({ table }) => {
49
49
  left: 0,
50
50
  position: isFullScreen ? 'fixed' : 'relative',
51
51
  right: 0,
52
- ...toolbarProps?.sx,
52
+ ...(toolbarProps?.sx instanceof Function
53
+ ? toolbarProps.sx(theme)
54
+ : (toolbarProps?.sx as any)),
53
55
  } as any)
54
56
  }
55
57
  >
@@ -62,7 +62,9 @@ export const MRT_ToolbarTop: FC<Props> = ({ table }) => {
62
62
  position: isFullScreen ? 'sticky' : undefined,
63
63
  top: isFullScreen ? '0' : undefined,
64
64
  ...commonToolbarStyles({ theme }),
65
- ...toolbarProps?.sx,
65
+ ...(toolbarProps?.sx instanceof Function
66
+ ? toolbarProps.sx(theme)
67
+ : (toolbarProps?.sx as any)),
66
68
  } as any)
67
69
  }
68
70
  >