material-react-table 1.0.0-beta.17 → 1.0.0-beta.18
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 +6 -0
- package/dist/cjs/index.js +14 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/esm/MaterialReactTable.d.ts +6 -0
- package/dist/esm/material-react-table.esm.js +14 -5
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/index.d.ts +7 -1
- package/locales/en.esm.js +6 -0
- package/locales/en.esm.js.map +1 -1
- package/locales/en.js +6 -0
- package/locales/en.js.map +1 -1
- package/locales/pt-BR.esm.js +7 -1
- package/locales/pt-BR.esm.js.map +1 -1
- package/locales/pt-BR.js +7 -1
- package/locales/pt-BR.js.map +1 -1
- package/package.json +10 -10
- package/src/MaterialReactTable.tsx +6 -0
- package/src/_locales/en.ts +6 -0
- package/src/_locales/es.ts +0 -86
- package/src/_locales/pt-BR.ts +7 -1
- package/src/toolbar/MRT_TablePagination.tsx +20 -5
- package/dist/cjs/_locales/es.d.ts +0 -2
- package/dist/esm/_locales/es.d.ts +0 -2
|
@@ -47,6 +47,10 @@ export interface MRT_Localization {
|
|
|
47
47
|
filterStartsWith: string;
|
|
48
48
|
filterWeakEquals: string;
|
|
49
49
|
filteringByColumn: string;
|
|
50
|
+
goToFirstPage: string;
|
|
51
|
+
goToLastPage: string;
|
|
52
|
+
goToNextPage: string;
|
|
53
|
+
goToPreviousPage: string;
|
|
50
54
|
grab: string;
|
|
51
55
|
groupByColumn: string;
|
|
52
56
|
groupedBy: string;
|
|
@@ -57,6 +61,7 @@ export interface MRT_Localization {
|
|
|
57
61
|
move: string;
|
|
58
62
|
noRecordsToDisplay: string;
|
|
59
63
|
noResultsFound: string;
|
|
64
|
+
of: string;
|
|
60
65
|
or: string;
|
|
61
66
|
pinToLeft: string;
|
|
62
67
|
pinToRight: string;
|
|
@@ -65,6 +70,7 @@ export interface MRT_Localization {
|
|
|
65
70
|
rowActions: string;
|
|
66
71
|
rowNumber: string;
|
|
67
72
|
rowNumbers: string;
|
|
73
|
+
rowsPerPage: string;
|
|
68
74
|
save: string;
|
|
69
75
|
search: string;
|
|
70
76
|
select: string;
|
package/dist/cjs/index.js
CHANGED
|
@@ -200,6 +200,10 @@ const MRT_Localization_EN = {
|
|
|
200
200
|
filterStartsWith: 'Starts With',
|
|
201
201
|
filterWeakEquals: 'Equals',
|
|
202
202
|
filteringByColumn: 'Filtering by {column} - {filterType} {filterValue}',
|
|
203
|
+
goToFirstPage: 'Go to first page',
|
|
204
|
+
goToLastPage: 'Go to last page',
|
|
205
|
+
goToNextPage: 'Go to next page',
|
|
206
|
+
goToPreviousPage: 'Go to previous page',
|
|
203
207
|
grab: 'Grab',
|
|
204
208
|
groupByColumn: 'Group by {column}',
|
|
205
209
|
groupedBy: 'Grouped by ',
|
|
@@ -210,6 +214,7 @@ const MRT_Localization_EN = {
|
|
|
210
214
|
move: 'Move',
|
|
211
215
|
noRecordsToDisplay: 'No records to display',
|
|
212
216
|
noResultsFound: 'No results found',
|
|
217
|
+
of: 'of',
|
|
213
218
|
or: 'or',
|
|
214
219
|
pinToLeft: 'Pin to left',
|
|
215
220
|
pinToRight: 'Pin to right',
|
|
@@ -218,6 +223,7 @@ const MRT_Localization_EN = {
|
|
|
218
223
|
rowActions: 'Row Actions',
|
|
219
224
|
rowNumber: '#',
|
|
220
225
|
rowNumbers: 'Row Numbers',
|
|
226
|
+
rowsPerPage: 'Rows per page',
|
|
221
227
|
save: 'Save',
|
|
222
228
|
search: 'Search',
|
|
223
229
|
selectedCountOfRowCountRowsSelected: '{selectedCount} of {rowCount} row(s) selected',
|
|
@@ -1122,7 +1128,7 @@ const MRT_LinearProgressBar = ({ isTopToolbar, table }) => {
|
|
|
1122
1128
|
};
|
|
1123
1129
|
|
|
1124
1130
|
const MRT_TablePagination = ({ table, position, }) => {
|
|
1125
|
-
const { getPrePaginationRowModel, getState, setPageIndex, setPageSize, options: { muiTablePaginationProps, enableToolbarInternalActions, rowCount, }, } = table;
|
|
1131
|
+
const { getPrePaginationRowModel, getState, setPageIndex, setPageSize, options: { muiTablePaginationProps, enableToolbarInternalActions, localization, rowCount, }, } = table;
|
|
1126
1132
|
const { pagination: { pageSize = 10, pageIndex = 0 }, showGlobalFilter, } = getState();
|
|
1127
1133
|
const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
|
|
1128
1134
|
const showFirstLastPageButtons = totalRowCount / pageSize > 2;
|
|
@@ -1132,10 +1138,13 @@ const MRT_TablePagination = ({ table, position, }) => {
|
|
|
1132
1138
|
const handleChangeRowsPerPage = (event) => {
|
|
1133
1139
|
setPageSize(+event.target.value);
|
|
1134
1140
|
};
|
|
1135
|
-
return (React__default["default"].createElement(material.TablePagination, Object.assign({
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1141
|
+
return (React__default["default"].createElement(material.TablePagination, Object.assign({ component: "div", count: totalRowCount, getItemAriaLabel: (type) => type === 'first'
|
|
1142
|
+
? localization.goToFirstPage
|
|
1143
|
+
: type === 'last'
|
|
1144
|
+
? localization.goToLastPage
|
|
1145
|
+
: type === 'next'
|
|
1146
|
+
? localization.goToNextPage
|
|
1147
|
+
: localization.goToPreviousPage, labelDisplayedRows: ({ from, to, count }) => `${from}-${to} ${localization.of} ${count}`, labelRowsPerPage: localization.rowsPerPage, onPageChange: (_, newPage) => setPageIndex(newPage), onRowsPerPageChange: handleChangeRowsPerPage, page: pageIndex, rowsPerPage: pageSize, rowsPerPageOptions: [5, 10, 15, 20, 25, 30, 50, 100], showFirstButton: showFirstLastPageButtons, showLastButton: showFirstLastPageButtons }, tablePaginationProps, { SelectProps: Object.assign({ sx: { m: '0 1rem 0 1ch' }, MenuProps: { MenuListProps: { disablePadding: true }, sx: { m: 0 } } }, tablePaginationProps === null || tablePaginationProps === void 0 ? void 0 : tablePaginationProps.SelectProps), sx: (theme) => (Object.assign({ '& .MuiTablePagination-toolbar': {
|
|
1139
1148
|
display: 'flex',
|
|
1140
1149
|
alignItems: 'center',
|
|
1141
1150
|
}, '& .MuiTablePagination-selectLabel': {
|