material-react-table 1.0.0-beta.4 → 1.0.0-beta.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/dist/cjs/index.js +15 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/localization.d.ts +2 -0
- package/dist/esm/localization.d.ts +2 -0
- package/dist/esm/material-react-table.esm.js +15 -4
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/body/MRT_TableBody.tsx +51 -29
- package/src/localization.ts +4 -0
|
@@ -200,6 +200,8 @@ const MRT_DefaultLocalization_EN = {
|
|
|
200
200
|
max: 'Max',
|
|
201
201
|
min: 'Min',
|
|
202
202
|
move: 'Move',
|
|
203
|
+
noRecordsToDisplay: 'No records to display',
|
|
204
|
+
noResultsFound: 'No results found',
|
|
203
205
|
or: 'or',
|
|
204
206
|
pinToLeft: 'Pin to left',
|
|
205
207
|
pinToRight: 'Pin to right',
|
|
@@ -2155,8 +2157,8 @@ const MRT_TableBodyRow = ({ row, rowIndex, table, virtualRow, }) => {
|
|
|
2155
2157
|
};
|
|
2156
2158
|
|
|
2157
2159
|
const MRT_TableBody = ({ table }) => {
|
|
2158
|
-
const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization, manualFiltering, manualSorting, muiTableBodyProps, virtualizerInstanceRef, virtualizerProps, }, refs: { tableContainerRef }, } = table;
|
|
2159
|
-
const { globalFilter, pagination, sorting } = getState();
|
|
2160
|
+
const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization, localization, manualFiltering, manualSorting, muiTableBodyProps, virtualizerInstanceRef, virtualizerProps, }, refs: { tableContainerRef }, } = table;
|
|
2161
|
+
const { columnFilters, globalFilter, pagination, sorting } = getState();
|
|
2160
2162
|
const tableBodyProps = muiTableBodyProps instanceof Function
|
|
2161
2163
|
? muiTableBodyProps({ table })
|
|
2162
2164
|
: muiTableBodyProps;
|
|
@@ -2221,7 +2223,16 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2221
2223
|
// ? virtualizer.getTotalSize() - virtualRows[virtualRows.length - 1].end
|
|
2222
2224
|
// : 0;
|
|
2223
2225
|
// }
|
|
2224
|
-
return (React.createElement(TableBody, Object.assign({}, tableBodyProps),
|
|
2226
|
+
return (React.createElement(TableBody, Object.assign({}, tableBodyProps), !rows.length ? (React.createElement(TableRow, null,
|
|
2227
|
+
React.createElement(TableCell, { colSpan: table.getVisibleLeafColumns().length },
|
|
2228
|
+
React.createElement(Box, { sx: {
|
|
2229
|
+
maxWidth: '100vw',
|
|
2230
|
+
py: '2rem',
|
|
2231
|
+
textAlign: 'center',
|
|
2232
|
+
width: '100%',
|
|
2233
|
+
} }, globalFilter || columnFilters.length
|
|
2234
|
+
? localization.noResultsFound
|
|
2235
|
+
: localization.noRecordsToDisplay)))) : (React.createElement(React.Fragment, null,
|
|
2225
2236
|
enableRowVirtualization && paddingTop > 0 && (React.createElement("tr", null,
|
|
2226
2237
|
React.createElement("td", { style: { height: `${paddingTop}px` } }))),
|
|
2227
2238
|
(enableRowVirtualization ? virtualRows : rows).map((rowOrVirtualRow, rowIndex) => {
|
|
@@ -2231,7 +2242,7 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2231
2242
|
return (React.createElement(MRT_TableBodyRow, { key: row.id, row: row, rowIndex: enableRowVirtualization ? rowOrVirtualRow.index : rowIndex, table: table, virtualRow: enableRowVirtualization ? rowOrVirtualRow : null }));
|
|
2232
2243
|
}),
|
|
2233
2244
|
enableRowVirtualization && paddingBottom > 0 && (React.createElement("tr", null,
|
|
2234
|
-
React.createElement("td", { style: { height: `${paddingBottom}px` } })))));
|
|
2245
|
+
React.createElement("td", { style: { height: `${paddingBottom}px` } })))))));
|
|
2235
2246
|
};
|
|
2236
2247
|
|
|
2237
2248
|
const MRT_TableFooterCell = ({ footer, table }) => {
|