material-react-table 0.7.0-alpha.2 → 0.7.0-alpha.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.
- package/README.md +29 -19
- package/dist/MaterialReactTable.d.ts +1 -1
- package/dist/buttons/MRT_CopyButton.d.ts +1 -2
- package/dist/material-react-table.cjs.development.js +17 -5
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +17 -5
- package/dist/material-react-table.esm.js.map +1 -1
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +5 -1
- package/src/buttons/MRT_CopyButton.tsx +1 -2
- package/src/localization.ts +0 -1
- package/src/table/MRT_TableRoot.tsx +4 -3
- package/src/toolbar/MRT_TablePagination.tsx +5 -2
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.0-alpha.
|
|
2
|
+
"version": "0.7.0-alpha.5",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
|
-
"description": "A fully featured Material
|
|
5
|
+
"description": "A fully featured Material UI implementation of react-table, inspired by material-table and the MUI X DataGrid, written from the ground up in TypeScript.",
|
|
6
6
|
"author": "Kevin Vandy",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"react-table",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=14"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"analyze": "size-limit --why",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"react": ">=16.8"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@tanstack/react-table": "^8.0.0-alpha.
|
|
100
|
+
"@tanstack/react-table": "^8.0.0-alpha.28",
|
|
101
101
|
"match-sorter": "^6.3.1"
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -46,6 +46,11 @@ import { MRT_Default_Icons, MRT_Icons } from './icons';
|
|
|
46
46
|
import { MRT_FILTER_TYPE } from './enums';
|
|
47
47
|
import { MRT_TableRoot } from './table/MRT_TableRoot';
|
|
48
48
|
|
|
49
|
+
//@ts-ignore
|
|
50
|
+
window.performance = window.performance || {
|
|
51
|
+
now: () => new Date().getTime(),
|
|
52
|
+
};
|
|
53
|
+
|
|
49
54
|
export type MRT_TableOptions<D extends Record<string, any> = {}> = Partial<
|
|
50
55
|
Omit<
|
|
51
56
|
Options<D>,
|
|
@@ -688,7 +693,6 @@ export default <D extends Record<string, any> = {}>({
|
|
|
688
693
|
enableSelectAll = true,
|
|
689
694
|
enableSorting = true,
|
|
690
695
|
enableStickyHeader = true,
|
|
691
|
-
filterTypes,
|
|
692
696
|
icons,
|
|
693
697
|
localization,
|
|
694
698
|
positionActionsColumn = 'first',
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React, { FC,
|
|
1
|
+
import React, { FC, useState } from 'react';
|
|
2
2
|
import { Button, Tooltip } from '@mui/material';
|
|
3
3
|
import { MRT_Cell, MRT_TableInstance } from '..';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
cell: MRT_Cell;
|
|
7
|
-
children: ReactNode;
|
|
8
7
|
tableInstance: MRT_TableInstance;
|
|
9
8
|
}
|
|
10
9
|
|
package/src/localization.ts
CHANGED
|
@@ -94,7 +94,6 @@ export const MRT_DefaultLocalization_EN: MRT_Localization = {
|
|
|
94
94
|
search: 'Search',
|
|
95
95
|
selectedCountOfRowCountRowsSelected:
|
|
96
96
|
'{selectedCount} of {rowCount} row(s) selected',
|
|
97
|
-
|
|
98
97
|
select: 'Select',
|
|
99
98
|
showAll: 'Show all',
|
|
100
99
|
showAllColumns: 'Show all columns',
|
|
@@ -195,15 +195,16 @@ export const MRT_TableRoot = <D extends Record<string, any> = {}>(
|
|
|
195
195
|
//@ts-ignore
|
|
196
196
|
const tableInstance: MRT_TableInstance<{}> = useTable(table, {
|
|
197
197
|
...props,
|
|
198
|
-
//@ts-ignore
|
|
199
|
-
filterTypes: defaultFilterFNs,
|
|
200
|
-
globalFilterType: currentGlobalFilterType,
|
|
201
198
|
columnFilterRowsFn: columnFilterRowsFn,
|
|
202
199
|
columns,
|
|
203
200
|
data,
|
|
201
|
+
debugAll: false,
|
|
204
202
|
expandRowsFn: expandRowsFn,
|
|
203
|
+
//@ts-ignore
|
|
204
|
+
filterTypes: defaultFilterFNs,
|
|
205
205
|
getSubRows: props.getSubRows ?? ((originalRow: D) => originalRow.subRows),
|
|
206
206
|
globalFilterRowsFn: globalFilterRowsFn,
|
|
207
|
+
globalFilterType: currentGlobalFilterType,
|
|
207
208
|
groupRowsFn: groupRowsFn,
|
|
208
209
|
idPrefix,
|
|
209
210
|
onPaginationChange: (updater: any) =>
|
|
@@ -33,14 +33,17 @@ export const MRT_TablePagination: FC<Props> = ({ tableInstance }) => {
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<TablePagination
|
|
36
|
-
SelectProps={{
|
|
36
|
+
SelectProps={{
|
|
37
|
+
sx: { m: '0 1rem 0 1ch' },
|
|
38
|
+
MenuProps: { MenuListProps: { disablePadding: true } },
|
|
39
|
+
}}
|
|
37
40
|
component="div"
|
|
38
41
|
count={getPrePaginationRowModel().rows.length}
|
|
39
42
|
onPageChange={(_: any, newPage: number) => setPageIndex(newPage)}
|
|
40
43
|
onRowsPerPageChange={handleChangeRowsPerPage}
|
|
41
44
|
page={pageIndex}
|
|
42
45
|
rowsPerPage={pageSize}
|
|
43
|
-
rowsPerPageOptions={[5, 10, 20, 25, 50, 100]}
|
|
46
|
+
rowsPerPageOptions={[5, 10, 15, 20, 25, 30, 50, 100]}
|
|
44
47
|
showFirstButton={showFirstLastPageButtons}
|
|
45
48
|
showLastButton={showFirstLastPageButtons}
|
|
46
49
|
{...tablePaginationProps}
|