material-react-table 1.0.0-beta.15 → 1.0.0-beta.16
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 +27 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +27 -5
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/MaterialReactTable.tsx +1 -1
- package/src/inputs/MRT_SelectCheckbox.tsx +11 -2
- package/src/toolbar/MRT_TablePagination.tsx +19 -0
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.0-beta.
|
|
2
|
+
"version": "1.0.0-beta.16",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
5
|
"description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"analyze": "size-limit --why",
|
|
45
|
-
"build": "rm -rf dist locales && rollup -c && size-limit && rm -rf material-react-table-docs/node_modules/material-react-table && cp -r dist material-react-table-docs/node_modules/material-react-table/ && cp -r locales material-react-table-docs/node_modules/material-react-table/ && cp -r src material-react-table-docs/node_modules/material-react-table/ && cp -r package.json material-react-table-docs/node_modules/material-react-table/",
|
|
45
|
+
"build": "rm -rf dist locales && rollup -c && size-limit && rm -rf material-react-table-docs/node_modules/material-react-table && mkdir material-react-table-docs/node_modules/material-react-table && cp -r dist material-react-table-docs/node_modules/material-react-table/dist && cp -r locales material-react-table-docs/node_modules/material-react-table/ && cp -r src material-react-table-docs/node_modules/material-react-table/ && cp -r package.json material-react-table-docs/node_modules/material-react-table/",
|
|
46
46
|
"build-storybook": "build-storybook",
|
|
47
47
|
"format": "prettier -w .",
|
|
48
48
|
"lint": "eslint .",
|
|
@@ -1038,7 +1038,7 @@ export default <TData extends Record<string, any> = {}>({
|
|
|
1038
1038
|
positionToolbarAlertBanner = 'top',
|
|
1039
1039
|
positionToolbarDropZone = 'top',
|
|
1040
1040
|
rowNumberMode = 'original',
|
|
1041
|
-
selectAllMode = '
|
|
1041
|
+
selectAllMode = 'page',
|
|
1042
1042
|
sortingFns,
|
|
1043
1043
|
...rest
|
|
1044
1044
|
}: MaterialReactTableProps<TData>) => (
|
|
@@ -42,10 +42,19 @@ export const MRT_SelectCheckbox: FC<Props> = ({ row, selectAll, table }) => {
|
|
|
42
42
|
>
|
|
43
43
|
<Checkbox
|
|
44
44
|
checked={
|
|
45
|
-
selectAll
|
|
45
|
+
selectAll
|
|
46
|
+
? selectAllMode === 'page'
|
|
47
|
+
? table.getIsAllPageRowsSelected()
|
|
48
|
+
: table.getIsAllRowsSelected()
|
|
49
|
+
: row?.getIsSelected()
|
|
46
50
|
}
|
|
47
51
|
indeterminate={
|
|
48
|
-
selectAll
|
|
52
|
+
selectAll
|
|
53
|
+
? table.getIsSomeRowsSelected() &&
|
|
54
|
+
!(selectAllMode === 'page'
|
|
55
|
+
? table.getIsAllPageRowsSelected()
|
|
56
|
+
: table.getIsAllRowsSelected())
|
|
57
|
+
: row?.getIsSomeSelected()
|
|
49
58
|
}
|
|
50
59
|
inputProps={{
|
|
51
60
|
'aria-label': selectAll
|
|
@@ -56,6 +56,25 @@ export const MRT_TablePagination = <TData extends Record<string, any> = {}>({
|
|
|
56
56
|
showLastButton={showFirstLastPageButtons}
|
|
57
57
|
{...tablePaginationProps}
|
|
58
58
|
sx={(theme) => ({
|
|
59
|
+
'& .MuiTablePagination-toolbar': {
|
|
60
|
+
display: 'flex',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
},
|
|
63
|
+
'& .MuiTablePagination-selectLabel': {
|
|
64
|
+
m: '0 -1px',
|
|
65
|
+
},
|
|
66
|
+
'&. MuiInputBase-root': {
|
|
67
|
+
m: '0 1px',
|
|
68
|
+
},
|
|
69
|
+
'& . MuiTablePagination-select': {
|
|
70
|
+
m: '0 1px',
|
|
71
|
+
},
|
|
72
|
+
'& .MuiTablePagination-displayedRows': {
|
|
73
|
+
m: '0 1px',
|
|
74
|
+
},
|
|
75
|
+
'& .MuiTablePagination-actions': {
|
|
76
|
+
m: '0 1px',
|
|
77
|
+
},
|
|
59
78
|
mt:
|
|
60
79
|
position === 'top' &&
|
|
61
80
|
enableToolbarInternalActions &&
|
|
@@ -20,6 +20,7 @@ export const MRT_ToolbarAlertBanner: FC<Props> = ({
|
|
|
20
20
|
muiToolbarAlertBannerProps,
|
|
21
21
|
muiToolbarAlertBannerChipProps,
|
|
22
22
|
positionToolbarAlertBanner,
|
|
23
|
+
rowCount,
|
|
23
24
|
},
|
|
24
25
|
} = table;
|
|
25
26
|
const { grouping, showAlertBanner } = getState();
|
|
@@ -43,7 +44,7 @@ export const MRT_ToolbarAlertBanner: FC<Props> = ({
|
|
|
43
44
|
)
|
|
44
45
|
?.replace(
|
|
45
46
|
'{rowCount}',
|
|
46
|
-
getPrePaginationRowModel().rows.length.toString(),
|
|
47
|
+
(rowCount ?? getPrePaginationRowModel().rows.length).toString(),
|
|
47
48
|
)
|
|
48
49
|
: null;
|
|
49
50
|
|