material-react-table 0.38.2 → 0.38.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/dist/cjs/MaterialReactTable.d.ts +1 -0
- package/dist/cjs/index.js +23 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/MaterialReactTable.d.ts +1 -0
- package/dist/esm/material-react-table.esm.js +23 -7
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/MaterialReactTable.tsx +1 -0
- package/src/buttons/MRT_ExpandAllButton.tsx +5 -3
- package/src/buttons/MRT_GrabHandleButton.tsx +5 -3
- package/src/footer/MRT_TableFooter.tsx +22 -2
- package/src/head/MRT_TableHeadRow.tsx +3 -1
- package/src/table/MRT_TablePaper.tsx +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -479,6 +479,7 @@ declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = O
|
|
|
479
479
|
enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
|
|
480
480
|
enableRowVirtualization?: boolean;
|
|
481
481
|
enableSelectAll?: boolean;
|
|
482
|
+
enableStickyFooter?: boolean;
|
|
482
483
|
enableStickyHeader?: boolean;
|
|
483
484
|
enableTableFooter?: boolean;
|
|
484
485
|
enableTableHead?: boolean;
|
package/package.json
CHANGED
|
@@ -488,6 +488,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
|
488
488
|
enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
|
|
489
489
|
enableRowVirtualization?: boolean;
|
|
490
490
|
enableSelectAll?: boolean;
|
|
491
|
+
enableStickyFooter?: boolean;
|
|
491
492
|
enableStickyHeader?: boolean;
|
|
492
493
|
enableTableFooter?: boolean;
|
|
493
494
|
enableTableHead?: boolean;
|
|
@@ -40,12 +40,14 @@ export const MRT_ExpandAllButton: FC<Props> = ({ table }) => {
|
|
|
40
40
|
disabled={!getCanSomeRowsExpand() && !renderDetailPanel}
|
|
41
41
|
onClick={() => toggleAllRowsExpanded(!getIsAllRowsExpanded())}
|
|
42
42
|
{...iconButtonProps}
|
|
43
|
-
sx={{
|
|
43
|
+
sx={(theme) => ({
|
|
44
44
|
height: density === 'compact' ? '1.75rem' : '2.25rem',
|
|
45
45
|
width: density === 'compact' ? '1.75rem' : '2.25rem',
|
|
46
46
|
mt: density !== 'compact' ? '-0.25rem' : undefined,
|
|
47
|
-
...iconButtonProps?.sx
|
|
48
|
-
|
|
47
|
+
...(iconButtonProps?.sx instanceof Function
|
|
48
|
+
? iconButtonProps?.sx(theme)
|
|
49
|
+
: (iconButtonProps?.sx as any)),
|
|
50
|
+
})}
|
|
49
51
|
>
|
|
50
52
|
<KeyboardDoubleArrowDownIcon
|
|
51
53
|
style={{
|
|
@@ -37,7 +37,7 @@ export const MRT_GrabHandleButton = <TData extends Record<string, any> = {}>({
|
|
|
37
37
|
onDragEnd={onDragEnd}
|
|
38
38
|
size="small"
|
|
39
39
|
{...iconButtonProps}
|
|
40
|
-
sx={{
|
|
40
|
+
sx={(theme) => ({
|
|
41
41
|
cursor: 'grab',
|
|
42
42
|
m: 0,
|
|
43
43
|
opacity: 0.5,
|
|
@@ -50,8 +50,10 @@ export const MRT_GrabHandleButton = <TData extends Record<string, any> = {}>({
|
|
|
50
50
|
'&:active': {
|
|
51
51
|
cursor: 'grabbing',
|
|
52
52
|
},
|
|
53
|
-
...iconButtonProps?.sx
|
|
54
|
-
|
|
53
|
+
...(iconButtonProps?.sx instanceof Function
|
|
54
|
+
? iconButtonProps?.sx(theme)
|
|
55
|
+
: (iconButtonProps?.sx as any)),
|
|
56
|
+
})}
|
|
55
57
|
>
|
|
56
58
|
<DragHandleIcon />
|
|
57
59
|
</IconButton>
|
|
@@ -10,16 +10,36 @@ interface Props {
|
|
|
10
10
|
export const MRT_TableFooter: FC<Props> = ({ table }) => {
|
|
11
11
|
const {
|
|
12
12
|
getFooterGroups,
|
|
13
|
-
|
|
13
|
+
getState,
|
|
14
|
+
options: { enableStickyFooter, muiTableFooterProps },
|
|
14
15
|
} = table;
|
|
16
|
+
const { isFullScreen } = getState();
|
|
15
17
|
|
|
16
18
|
const tableFooterProps =
|
|
17
19
|
muiTableFooterProps instanceof Function
|
|
18
20
|
? muiTableFooterProps({ table })
|
|
19
21
|
: muiTableFooterProps;
|
|
20
22
|
|
|
23
|
+
const stickFooter =
|
|
24
|
+
(isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
|
|
25
|
+
|
|
21
26
|
return (
|
|
22
|
-
<TableFooter
|
|
27
|
+
<TableFooter
|
|
28
|
+
{...tableFooterProps}
|
|
29
|
+
sx={(theme) => ({
|
|
30
|
+
position: stickFooter ? 'sticky' : undefined,
|
|
31
|
+
bottom: stickFooter ? 0 : undefined,
|
|
32
|
+
opacity: stickFooter ? 0.95 : undefined,
|
|
33
|
+
outline: stickFooter
|
|
34
|
+
? theme.palette.mode === 'light'
|
|
35
|
+
? `1px solid ${theme.palette.grey[300]}`
|
|
36
|
+
: `1px solid ${theme.palette.grey[700]}`
|
|
37
|
+
: undefined,
|
|
38
|
+
...(tableFooterProps?.sx instanceof Function
|
|
39
|
+
? tableFooterProps?.sx(theme)
|
|
40
|
+
: (tableFooterProps?.sx as any)),
|
|
41
|
+
})}
|
|
42
|
+
>
|
|
23
43
|
{getFooterGroups().map((footerGroup) => (
|
|
24
44
|
<MRT_TableFooterRow
|
|
25
45
|
footerGroup={footerGroup as any}
|
|
@@ -24,7 +24,9 @@ export const MRT_TableHeadRow: FC<Props> = ({ headerGroup, table }) => {
|
|
|
24
24
|
sx={(theme) => ({
|
|
25
25
|
boxShadow: `4px 0 8px ${alpha(theme.palette.common.black, 0.1)}`,
|
|
26
26
|
backgroundColor: lighten(theme.palette.background.default, 0.04),
|
|
27
|
-
...(tableRowProps?.sx
|
|
27
|
+
...(tableRowProps?.sx instanceof Function
|
|
28
|
+
? tableRowProps?.sx(theme)
|
|
29
|
+
: (tableRowProps?.sx as any)),
|
|
28
30
|
})}
|
|
29
31
|
>
|
|
30
32
|
{headerGroup.headers.map((header: MRT_Header, index) => (
|
|
@@ -35,10 +35,12 @@ export const MRT_TablePaper: FC<Props> = ({ table }) => {
|
|
|
35
35
|
<Paper
|
|
36
36
|
elevation={2}
|
|
37
37
|
{...tablePaperProps}
|
|
38
|
-
sx={{
|
|
38
|
+
sx={(theme) => ({
|
|
39
39
|
transition: 'all 0.2s ease-in-out',
|
|
40
|
-
...tablePaperProps?.sx
|
|
41
|
-
|
|
40
|
+
...(tablePaperProps?.sx instanceof Function
|
|
41
|
+
? tablePaperProps?.sx(theme)
|
|
42
|
+
: (tablePaperProps?.sx as any)),
|
|
43
|
+
})}
|
|
42
44
|
style={{
|
|
43
45
|
...tablePaperProps?.style,
|
|
44
46
|
height: isFullScreen ? '100vh' : undefined,
|