material-react-table 0.14.0 → 0.14.3

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.14.0",
2
+ "version": "0.14.3",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI implementation of TanStack React Table, inspired by material-table and the MUI X DataGrid, written from the ground up in TypeScript.",
@@ -30,6 +30,7 @@ export const MRT_TableBodyCell: FC<Props> = ({
30
30
  muiTableBodyCellProps,
31
31
  muiTableBodyCellSkeletonProps,
32
32
  onCellClick,
33
+ onRowClick,
33
34
  rowNumberMode,
34
35
  tableId,
35
36
  },
@@ -146,7 +147,10 @@ export const MRT_TableBodyCell: FC<Props> = ({
146
147
  : getIsFirstRightPinnedColumn()
147
148
  ? `-4px 0 4px -2px ${alpha(theme.palette.common.black, 0.1)}`
148
149
  : undefined,
149
- cursor: isEditable && editingMode === 'cell' ? 'pointer' : 'text',
150
+ cursor:
151
+ (isEditable && editingMode === 'cell') || onRowClick || onCellClick
152
+ ? 'pointer'
153
+ : 'text',
150
154
  left:
151
155
  column.getIsPinned() === 'left'
152
156
  ? `${column.getStart('left')}px`
@@ -5,7 +5,7 @@ import { MRT_TableHeadCellFilterLabel } from './MRT_TableHeadCellFilterLabel';
5
5
  import { MRT_GrabHandleButton } from '../buttons/MRT_GrabHandleButton';
6
6
  import { MRT_TableHeadCellResizeHandle } from './MRT_TableHeadCellResizeHandle';
7
7
  import { MRT_TableHeadCellSortLabel } from './MRT_TableHeadCellSortLabel';
8
- import { MRT_ToggleColumnActionMenuButton } from '../buttons/MRT_ToggleColumnActionMenuButton';
8
+ import { MRT_TableHeadCellColumnActionsButton } from './MRT_TableHeadCellColumnActionsButton';
9
9
  import type { MRT_Header, MRT_TableInstance } from '..';
10
10
 
11
11
  interface Props {
@@ -162,6 +162,7 @@ export const MRT_TableHeadCell: FC<Props> = ({
162
162
  justifyContent:
163
163
  columnDefType === 'group' ? 'center' : 'space-between',
164
164
  opacity: isDragging ? 0.5 : 1,
165
+ position: 'relative',
165
166
  width: '100%',
166
167
  }}
167
168
  >
@@ -205,7 +206,7 @@ export const MRT_TableHeadCell: FC<Props> = ({
205
206
  {(enableColumnActions || columnDef.enableColumnActions) &&
206
207
  columnDef.enableColumnActions !== false &&
207
208
  columnDefType !== 'group' && (
208
- <MRT_ToggleColumnActionMenuButton
209
+ <MRT_TableHeadCellColumnActionsButton
209
210
  header={header}
210
211
  instance={instance}
211
212
  />
@@ -8,7 +8,7 @@ interface Props {
8
8
  instance: MRT_TableInstance;
9
9
  }
10
10
 
11
- export const MRT_ToggleColumnActionMenuButton: FC<Props> = ({
11
+ export const MRT_TableHeadCellColumnActionsButton: FC<Props> = ({
12
12
  header,
13
13
  instance,
14
14
  }) => {
@@ -66,7 +66,6 @@ export const MRT_ToggleColumnActionMenuButton: FC<Props> = ({
66
66
  {...iconButtonProps}
67
67
  sx={{
68
68
  height: '2rem',
69
- mr: '2px',
70
69
  mt: '-0.2rem',
71
70
  opacity: 0.5,
72
71
  transition: 'opacity 0.2s',
@@ -72,6 +72,7 @@ export const MRT_TableHeadCellFilterLabel: FC<Props> = ({
72
72
  backgroundColor: 'transparent',
73
73
  opacity: 0.8,
74
74
  },
75
+ width: '1.5ch',
75
76
  }}
76
77
  >
77
78
  {showFilters && !column.getFilterValue() ? (
@@ -31,6 +31,7 @@ export const MRT_TableHeadCellResizeHandle: FC<Props> = ({
31
31
  height: showFilters && columnDefType === 'data' ? '4rem' : '2rem',
32
32
  opacity: 0.8,
33
33
  position: 'absolute',
34
+ mr: '-1rem',
34
35
  right: '1px',
35
36
  touchAction: 'none',
36
37
  transition: column.getIsResizing() ? undefined : 'all 0.2s ease-in-out',
@@ -32,6 +32,10 @@ export const MRT_TableHeadCellSortLabel: FC<Props> = ({ header, instance }) => {
32
32
  ? (column.getIsSorted() as 'asc' | 'desc')
33
33
  : undefined
34
34
  }
35
+ sx={{
36
+ width: '2ch',
37
+ transform: 'translateX(-0.5ch)',
38
+ }}
35
39
  />
36
40
  </Tooltip>
37
41
  );
@@ -47,7 +47,9 @@ export const MRT_ToolbarBottom: FC<Props> = ({ instance }) => {
47
47
  ...commonToolbarStyles({ theme }),
48
48
  bottom: isFullScreen ? '0' : undefined,
49
49
  boxShadow: `-3px 0 6px ${alpha(theme.palette.common.black, 0.1)}`,
50
+ left: 0,
50
51
  position: isFullScreen ? 'fixed' : 'relative',
52
+ right: 0,
51
53
  ...toolbarProps?.sx,
52
54
  } as any)
53
55
  }