material-react-table 1.0.0-beta.6 → 1.0.0-beta.7
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/dist/cjs/index.js +6 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +6 -9
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/footer/MRT_TableFooter.tsx +3 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +7 -7
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
-
import { TableFooter } from '@mui/material';
|
|
2
|
+
import { lighten, TableFooter } from '@mui/material';
|
|
3
3
|
import { MRT_TableFooterRow } from './MRT_TableFooterRow';
|
|
4
4
|
import type { MRT_TableInstance } from '..';
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ export const MRT_TableFooter: FC<Props> = ({ table }) => {
|
|
|
27
27
|
<TableFooter
|
|
28
28
|
{...tableFooterProps}
|
|
29
29
|
sx={(theme) => ({
|
|
30
|
-
|
|
30
|
+
backgroundColor: lighten(theme.palette.background.default, 0.06),
|
|
31
31
|
bottom: stickFooter ? 0 : undefined,
|
|
32
32
|
opacity: stickFooter ? 0.95 : undefined,
|
|
33
33
|
outline: stickFooter
|
|
@@ -35,6 +35,7 @@ export const MRT_TableFooter: FC<Props> = ({ table }) => {
|
|
|
35
35
|
? `1px solid ${theme.palette.grey[300]}`
|
|
36
36
|
: `1px solid ${theme.palette.grey[700]}`
|
|
37
37
|
: undefined,
|
|
38
|
+
position: stickFooter ? 'sticky' : undefined,
|
|
38
39
|
...(tableFooterProps?.sx instanceof Function
|
|
39
40
|
? tableFooterProps?.sx(theme)
|
|
40
41
|
: (tableFooterProps?.sx as any)),
|
|
@@ -17,11 +17,11 @@ export const MRT_TableHeadCellFilterLabel: FC<Props> = ({ header, table }) => {
|
|
|
17
17
|
const { column } = header;
|
|
18
18
|
const { columnDef } = column;
|
|
19
19
|
|
|
20
|
-
const isRangeFilter =
|
|
21
|
-
'
|
|
22
|
-
'betweenInclusive',
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const isRangeFilter =
|
|
21
|
+
columnDef.filterVariant === 'range' ||
|
|
22
|
+
['between', 'betweenInclusive', 'inNumberRange'].includes(
|
|
23
|
+
columnDef._filterFn,
|
|
24
|
+
);
|
|
25
25
|
const currentFilterOption = columnDef._filterFn;
|
|
26
26
|
const filterTooltip = localization.filteringByColumn
|
|
27
27
|
.replace('{column}', String(columnDef.header))
|
|
@@ -51,8 +51,8 @@ export const MRT_TableHeadCellFilterLabel: FC<Props> = ({ header, table }) => {
|
|
|
51
51
|
<Grow
|
|
52
52
|
unmountOnExit
|
|
53
53
|
in={
|
|
54
|
-
(!!column.getFilterValue() && isRangeFilter) ||
|
|
55
|
-
(
|
|
54
|
+
(!!column.getFilterValue() && !isRangeFilter) ||
|
|
55
|
+
(isRangeFilter && // @ts-ignore
|
|
56
56
|
(!!column.getFilterValue()?.[0] || !!column.getFilterValue()?.[1]))
|
|
57
57
|
}
|
|
58
58
|
>
|