material-react-table 0.23.4 → 0.23.5

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.
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { MRT_TableInstance } from '..';
3
3
  interface Props {
4
- alignTo: 'bottom' | 'top';
4
+ isTopToolbar: boolean;
5
5
  table: MRT_TableInstance;
6
6
  }
7
7
  export declare const MRT_LinearProgressBar: FC<Props>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.23.4",
2
+ "version": "0.23.5",
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.",
@@ -439,8 +439,10 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
439
439
  muiLinearProgressProps?:
440
440
  | LinearProgressProps
441
441
  | (({
442
+ isTopToolbar,
442
443
  table,
443
444
  }: {
445
+ isTopToolbar: boolean;
444
446
  table: MRT_TableInstance<TData>;
445
447
  }) => LinearProgressProps);
446
448
  muiSearchTextFieldProps?:
@@ -3,11 +3,11 @@ import { Collapse, LinearProgress } from '@mui/material';
3
3
  import { MRT_TableInstance } from '..';
4
4
 
5
5
  interface Props {
6
- alignTo: 'bottom' | 'top';
6
+ isTopToolbar: boolean;
7
7
  table: MRT_TableInstance;
8
8
  }
9
9
 
10
- export const MRT_LinearProgressBar: FC<Props> = ({ alignTo, table }) => {
10
+ export const MRT_LinearProgressBar: FC<Props> = ({ isTopToolbar, table }) => {
11
11
  const {
12
12
  options: { muiLinearProgressProps },
13
13
  getState,
@@ -16,7 +16,7 @@ export const MRT_LinearProgressBar: FC<Props> = ({ alignTo, table }) => {
16
16
 
17
17
  const linearProgressProps =
18
18
  muiLinearProgressProps instanceof Function
19
- ? muiLinearProgressProps({ table })
19
+ ? muiLinearProgressProps({ isTopToolbar, table })
20
20
  : muiLinearProgressProps;
21
21
 
22
22
  return (
@@ -25,9 +25,9 @@ export const MRT_LinearProgressBar: FC<Props> = ({ alignTo, table }) => {
25
25
  mountOnEnter
26
26
  unmountOnExit
27
27
  sx={{
28
- bottom: alignTo === 'bottom' ? 0 : undefined,
28
+ bottom: isTopToolbar ? 0 : undefined,
29
29
  position: 'absolute',
30
- top: alignTo === 'top' ? 0 : undefined,
30
+ top: !isTopToolbar ? 0 : undefined,
31
31
  width: '100%',
32
32
  }}
33
33
  >
@@ -53,7 +53,7 @@ export const MRT_ToolbarBottom: FC<Props> = ({ table }) => {
53
53
  } as any)
54
54
  }
55
55
  >
56
- <MRT_LinearProgressBar alignTo="top" table={table} />
56
+ <MRT_LinearProgressBar isTopToolbar={false} table={table} />
57
57
  {positionToolbarAlertBanner === 'bottom' && (
58
58
  <MRT_ToolbarAlertBanner table={table} />
59
59
  )}
@@ -103,7 +103,7 @@ export const MRT_ToolbarTop: FC<Props> = ({ table }) => {
103
103
  ['top', 'both'].includes(positionPagination ?? '') && (
104
104
  <MRT_TablePagination table={table} position="top" />
105
105
  )}
106
- <MRT_LinearProgressBar alignTo="bottom" table={table} />
106
+ <MRT_LinearProgressBar isTopToolbar table={table} />
107
107
  </Toolbar>
108
108
  );
109
109
  };