material-react-table 1.5.0-beta.2 → 1.5.1
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 +1 -1
- package/dist/cjs/index.js +11 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/_locales/zh-Hans.d.ts +2 -0
- package/dist/cjs/types/_locales/zh-Hant.d.ts +2 -0
- package/dist/cjs/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +6 -6
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/material-react-table.esm.js +11 -8
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/_locales/zh-Hans.d.ts +2 -0
- package/dist/esm/types/_locales/zh-Hant.d.ts +2 -0
- package/dist/esm/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +6 -6
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +28 -21
- package/locales/zh-Hans.d.ts +2 -0
- package/locales/zh-Hans.esm.d.ts +2 -0
- package/locales/zh-Hans.esm.js +94 -0
- package/locales/zh-Hans.esm.js.map +1 -0
- package/locales/zh-Hans.js +98 -0
- package/locales/zh-Hans.js.map +1 -0
- package/locales/zh-Hant.d.ts +2 -0
- package/locales/zh-Hant.esm.d.ts +2 -0
- package/locales/zh-Hant.esm.js +94 -0
- package/locales/zh-Hant.esm.js.map +1 -0
- package/locales/zh-Hant.js +98 -0
- package/locales/zh-Hant.js.map +1 -0
- package/package.json +11 -11
- package/src/MaterialReactTable.tsx +7 -0
- package/src/_locales/zh-Hans.ts +94 -0
- package/src/_locales/zh-Hant.ts +94 -0
- package/src/body/MRT_TableBody.tsx +1 -4
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +11 -9
- package/src/column.utils.ts +1 -3
- package/src/footer/MRT_TableFooter.tsx +1 -0
- package/src/index.tsx +2 -0
- package/src/table/MRT_Table.tsx +1 -0
package/README.md
CHANGED
@@ -57,7 +57,7 @@ _All features can easily be enabled/disabled_
|
|
57
57
|
|
58
58
|
_**Fully Fleshed out [Docs](https://www.material-react-table.com/docs/guides#guides) are available for all features**_
|
59
59
|
|
60
|
-
- [x] <
|
60
|
+
- [x] < 41kb gzipped - [Bundlephobia](https://bundlephobia.com/package/material-react-table)
|
61
61
|
- [x] Advanced TypeScript Generics Support (TypeScript Optional)
|
62
62
|
- [x] Aggregation and Grouping (Sum, Average, Count, etc.)
|
63
63
|
- [x] Click To Copy Cell Values
|
package/dist/cjs/index.js
CHANGED
@@ -320,9 +320,7 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
|
|
320
320
|
: undefined, ml: table.options.enableColumnVirtualization &&
|
321
321
|
column.getIsPinned() === 'left' &&
|
322
322
|
column.getPinnedIndex() === 0
|
323
|
-
? `-${column.getSize() *
|
324
|
-
((_b = (_a = table.getState().columnPinning.left) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1) *
|
325
|
-
1.2}px`
|
323
|
+
? `-${column.getSize() * ((_b = (_a = table.getState().columnPinning.left) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1)}px`
|
326
324
|
: undefined, mr: table.options.enableColumnVirtualization &&
|
327
325
|
column.getIsPinned() === 'right' &&
|
328
326
|
column.getPinnedIndex() === table.getVisibleLeafColumns().length - 1
|
@@ -2466,9 +2464,7 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
2466
2464
|
}
|
2467
2465
|
return rankedRows;
|
2468
2466
|
}
|
2469
|
-
return
|
2470
|
-
? getRowModel().rows
|
2471
|
-
: getPrePaginationRowModel().rows;
|
2467
|
+
return getRowModel().rows;
|
2472
2468
|
}, [
|
2473
2469
|
enableGlobalFilterRankedResults,
|
2474
2470
|
(enableGlobalFilterRankedResults && globalFilter) || !enablePagination
|
@@ -2600,7 +2596,7 @@ const MRT_TableFooter = ({ table, virtualColumns, virtualPaddingLeft, virtualPad
|
|
2600
2596
|
? theme.palette.mode === 'light'
|
2601
2597
|
? `1px solid ${theme.palette.grey[300]}`
|
2602
2598
|
: `1px solid ${theme.palette.grey[700]}`
|
2603
|
-
: undefined, position: stickFooter ? 'sticky' : undefined }, ((tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx) instanceof Function
|
2599
|
+
: undefined, position: stickFooter ? 'sticky' : undefined, zIndex: stickFooter ? 1 : undefined }, ((tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx) instanceof Function
|
2604
2600
|
? tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx(theme)
|
2605
2601
|
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx))) }), getFooterGroups().map((footerGroup) => (React__default["default"].createElement(MRT_TableFooterRow, { footerGroup: footerGroup, key: footerGroup.id, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight })))));
|
2606
2602
|
};
|
@@ -2618,6 +2614,8 @@ const MRT_Table = ({ table }) => {
|
|
2618
2614
|
//get first 16 column widths and average them
|
2619
2615
|
const averageColumnWidth = React.useMemo(() => {
|
2620
2616
|
var _a, _b, _c, _d;
|
2617
|
+
if (!enableColumnVirtualization)
|
2618
|
+
return 0;
|
2621
2619
|
const columnsWidths = (_d = (_c = (_b = (_a = table
|
2622
2620
|
.getRowModel()
|
2623
2621
|
.rows[0]) === null || _a === void 0 ? void 0 : _a.getCenterVisibleCells()) === null || _b === void 0 ? void 0 : _b.slice(0, 16)) === null || _c === void 0 ? void 0 : _c.map((cell) => cell.column.getSize() * 1.2)) !== null && _d !== void 0 ? _d : [];
|
@@ -3020,8 +3018,13 @@ const MaterialReactTable = (_a) => {
|
|
3020
3018
|
const _defaultDisplayColumn = React.useMemo(() => (Object.assign(Object.assign({}, MRT_DefaultDisplayColumn), defaultDisplayColumn)), [defaultDisplayColumn]);
|
3021
3019
|
if (rest.enableRowVirtualization || rest.enableColumnVirtualization) {
|
3022
3020
|
layoutMode = 'grid';
|
3021
|
+
}
|
3022
|
+
if (rest.enableRowVirtualization) {
|
3023
3023
|
enableStickyHeader = true;
|
3024
3024
|
}
|
3025
|
+
if (enablePagination === false && manualPagination === undefined) {
|
3026
|
+
manualPagination = true;
|
3027
|
+
}
|
3025
3028
|
if (!((_b = rest.data) === null || _b === void 0 ? void 0 : _b.length)) {
|
3026
3029
|
manualFiltering = true;
|
3027
3030
|
manualGrouping = true;
|
@@ -3040,6 +3043,7 @@ exports.MRT_TablePagination = MRT_TablePagination;
|
|
3040
3043
|
exports.MRT_ToggleDensePaddingButton = MRT_ToggleDensePaddingButton;
|
3041
3044
|
exports.MRT_ToggleFiltersButton = MRT_ToggleFiltersButton;
|
3042
3045
|
exports.MRT_ToggleGlobalFilterButton = MRT_ToggleGlobalFilterButton;
|
3046
|
+
exports.MRT_ToggleRowActionMenuButton = MRT_ToggleRowActionMenuButton;
|
3043
3047
|
exports.MRT_ToolbarAlertBanner = MRT_ToolbarAlertBanner;
|
3044
3048
|
exports.MRT_ToolbarDropZone = MRT_ToolbarDropZone;
|
3045
3049
|
exports.MRT_ToolbarInternalButtons = MRT_ToolbarInternalButtons;
|