material-react-table 1.0.0-beta.1 → 1.0.0-beta.2

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.
Files changed (43) hide show
  1. package/dist/cjs/body/MRT_EditRowModal.d.ts +0 -1
  2. package/dist/cjs/body/MRT_TableBody.d.ts +1 -2
  3. package/dist/cjs/buttons/MRT_ColumnPinningButtons.d.ts +0 -1
  4. package/dist/cjs/buttons/MRT_EditActionButtons.d.ts +0 -1
  5. package/dist/cjs/buttons/MRT_FullScreenToggleButton.d.ts +0 -1
  6. package/dist/cjs/buttons/MRT_ShowHideColumnsButton.d.ts +0 -1
  7. package/dist/cjs/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -1
  8. package/dist/cjs/buttons/MRT_ToggleFiltersButton.d.ts +0 -1
  9. package/dist/cjs/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -1
  10. package/dist/cjs/index.js +14 -10
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/inputs/MRT_EditCellTextField.d.ts +0 -1
  13. package/dist/cjs/inputs/MRT_GlobalFilterTextField.d.ts +0 -1
  14. package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +0 -1
  15. package/dist/cjs/menus/MRT_ShowHideColumnsMenu.d.ts +0 -1
  16. package/dist/cjs/table/MRT_Table.d.ts +1 -2
  17. package/dist/cjs/table/MRT_TableRoot.d.ts +0 -1
  18. package/dist/esm/body/MRT_EditRowModal.d.ts +0 -1
  19. package/dist/esm/body/MRT_TableBody.d.ts +1 -2
  20. package/dist/esm/buttons/MRT_ColumnPinningButtons.d.ts +0 -1
  21. package/dist/esm/buttons/MRT_EditActionButtons.d.ts +0 -1
  22. package/dist/esm/buttons/MRT_FullScreenToggleButton.d.ts +0 -1
  23. package/dist/esm/buttons/MRT_ShowHideColumnsButton.d.ts +0 -1
  24. package/dist/esm/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -1
  25. package/dist/esm/buttons/MRT_ToggleFiltersButton.d.ts +0 -1
  26. package/dist/esm/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -1
  27. package/dist/esm/inputs/MRT_EditCellTextField.d.ts +0 -1
  28. package/dist/esm/inputs/MRT_GlobalFilterTextField.d.ts +0 -1
  29. package/dist/esm/material-react-table.esm.js +14 -10
  30. package/dist/esm/material-react-table.esm.js.map +1 -1
  31. package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +0 -1
  32. package/dist/esm/menus/MRT_ShowHideColumnsMenu.d.ts +0 -1
  33. package/dist/esm/table/MRT_Table.d.ts +1 -2
  34. package/dist/esm/table/MRT_TableRoot.d.ts +0 -1
  35. package/dist/index.d.ts +0 -1
  36. package/package.json +6 -6
  37. package/src/body/MRT_TableBody.tsx +3 -3
  38. package/src/head/MRT_TableHeadCell.tsx +1 -1
  39. package/src/inputs/MRT_FilterTextField.tsx +6 -1
  40. package/src/table/MRT_Table.tsx +3 -4
  41. package/src/table/MRT_TableContainer.tsx +2 -11
  42. package/src/table/MRT_TableRoot.tsx +3 -3
  43. package/src/toolbar/MRT_TablePagination.tsx +1 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MRT_Row, MRT_TableInstance } from '..';
3
2
  interface Props<TData extends Record<string, any> = {}> {
4
3
  open: boolean;
@@ -1,8 +1,7 @@
1
- import { FC, RefObject } from 'react';
1
+ import { FC } from 'react';
2
2
  import type { MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  table: MRT_TableInstance;
5
- tableContainerRef: RefObject<HTMLDivElement>;
6
5
  }
7
6
  export declare const MRT_TableBody: FC<Props>;
8
7
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MRT_Column, MRT_TableInstance } from '..';
3
2
  interface Props<TData extends Record<string, any> = {}> {
4
3
  column: MRT_Column<TData>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MRT_Row, MRT_TableInstance } from '..';
3
2
  interface Props<TData extends Record<string, any> = {}> {
4
3
  row: MRT_Row<TData>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IconButtonProps } from '@mui/material';
3
2
  import { MRT_TableInstance } from '..';
4
3
  interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IconButtonProps } from '@mui/material';
3
2
  import { MRT_TableInstance } from '..';
4
3
  interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IconButtonProps } from '@mui/material';
3
2
  import { MRT_TableInstance } from '..';
4
3
  interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IconButtonProps } from '@mui/material';
3
2
  import { MRT_TableInstance } from '..';
4
3
  interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IconButtonProps } from '@mui/material';
3
2
  import { MRT_TableInstance } from '..';
4
3
  interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
package/dist/cjs/index.js CHANGED
@@ -1083,7 +1083,7 @@ const MRT_TablePagination = ({ table, position }) => {
1083
1083
  enableToolbarInternalActions &&
1084
1084
  !showGlobalFilter
1085
1085
  ? '3.5rem'
1086
- : '-0.25rem', position: 'relative', zIndex: 2 }, ((tablePaginationProps === null || tablePaginationProps === void 0 ? void 0 : tablePaginationProps.sx) instanceof Function
1086
+ : undefined, position: 'relative', zIndex: 2 }, ((tablePaginationProps === null || tablePaginationProps === void 0 ? void 0 : tablePaginationProps.sx) instanceof Function
1087
1087
  ? tablePaginationProps.sx(theme)
1088
1088
  : tablePaginationProps === null || tablePaginationProps === void 0 ? void 0 : tablePaginationProps.sx))) })));
1089
1089
  };
@@ -1513,7 +1513,11 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1513
1513
  if (textFieldProps.inputRef) {
1514
1514
  textFieldProps.inputRef = inputRef;
1515
1515
  }
1516
- }, sx: (theme) => (Object.assign({ p: 0, minWidth: !filterChipLabel ? '120px' : 'auto', width: '100%', '& .MuiSelect-icon': {
1516
+ }, sx: (theme) => (Object.assign({ p: 0, minWidth: columnDef.filterVariant === 'range'
1517
+ ? '90px'
1518
+ : !filterChipLabel
1519
+ ? '120px'
1520
+ : 'auto', width: '100%', '& .MuiSelect-icon': {
1517
1521
  mr: '1.5rem',
1518
1522
  } }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
1519
1523
  ? textFieldProps.sx(theme)
@@ -1704,7 +1708,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
1704
1708
  return column.getIsPinned() === 'right' && column.getPinnedIndex() === 0;
1705
1709
  };
1706
1710
  const getTotalRight = () => {
1707
- return ((table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 150);
1711
+ return ((table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 180);
1708
1712
  };
1709
1713
  const handleDragEnter = (_e) => {
1710
1714
  if (enableGrouping && (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone') {
@@ -2169,8 +2173,8 @@ const MRT_TableBodyRow = ({ row, rowIndex, table, virtualRow, }) => {
2169
2173
  renderDetailPanel && !row.getIsGrouped() && (React__default["default"].createElement(MRT_TableDetailPanel, { row: row, table: table }))));
2170
2174
  };
2171
2175
 
2172
- const MRT_TableBody = ({ table, tableContainerRef }) => {
2173
- const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization, manualFiltering, manualSorting, muiTableBodyProps, virtualizerInstanceRef, virtualizerProps, }, } = table;
2176
+ const MRT_TableBody = ({ table }) => {
2177
+ const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization, manualFiltering, manualSorting, muiTableBodyProps, virtualizerInstanceRef, virtualizerProps, }, refs: { tableContainerRef }, } = table;
2174
2178
  const { globalFilter, pagination, sorting } = getState();
2175
2179
  const tableBodyProps = muiTableBodyProps instanceof Function
2176
2180
  ? muiTableBodyProps({ table })
@@ -2311,7 +2315,7 @@ const MRT_TableFooter = ({ table }) => {
2311
2315
  : 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 })))));
2312
2316
  };
2313
2317
 
2314
- const MRT_Table = ({ tableContainerRef, table }) => {
2318
+ const MRT_Table = ({ table }) => {
2315
2319
  const { getState, options: { enableColumnResizing, enableRowVirtualization, enableStickyHeader, enableTableFooter, enableTableHead, muiTableProps, }, } = table;
2316
2320
  const { isFullScreen } = getState();
2317
2321
  const tableProps = muiTableProps instanceof Function
@@ -2321,7 +2325,7 @@ const MRT_Table = ({ tableContainerRef, table }) => {
2321
2325
  ? tableProps.sx(theme)
2322
2326
  : tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx))) }),
2323
2327
  enableTableHead && React__default["default"].createElement(MRT_TableHead, { table: table }),
2324
- React__default["default"].createElement(MRT_TableBody, { tableContainerRef: tableContainerRef, table: table }),
2328
+ React__default["default"].createElement(MRT_TableBody, { table: table }),
2325
2329
  enableTableFooter && React__default["default"].createElement(MRT_TableFooter, { table: table })));
2326
2330
  };
2327
2331
 
@@ -2356,7 +2360,7 @@ const MRT_TableContainer = ({ table }) => {
2356
2360
  : tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx))), style: Object.assign({ maxHeight: isFullScreen
2357
2361
  ? `calc(100vh - ${totalToolbarHeight}px)`
2358
2362
  : undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style) }),
2359
- React__default["default"].createElement(MRT_Table, { tableContainerRef: tableContainerRef, table: table })));
2363
+ React__default["default"].createElement(MRT_Table, { table: table })));
2360
2364
  };
2361
2365
 
2362
2366
  const MRT_TablePaper = ({ table }) => {
@@ -2534,9 +2538,9 @@ const MRT_TableRoot = (props) => {
2534
2538
  props.tableInstanceRef.current = table;
2535
2539
  }
2536
2540
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
2537
- React__default["default"].createElement(material.Dialog, { PaperComponent: material.Box, TransitionComponent: material.Grow, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => setIsFullScreen(false), open: isFullScreen, transitionDuration: 400 },
2541
+ React__default["default"].createElement(material.Dialog, { PaperComponent: material.Box, TransitionComponent: material.Grow, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => table.setIsFullScreen(false), open: table.getState().isFullScreen, transitionDuration: 400 },
2538
2542
  React__default["default"].createElement(MRT_TablePaper, { table: table })),
2539
- !isFullScreen && React__default["default"].createElement(MRT_TablePaper, { table: table }),
2543
+ !table.getState().isFullScreen && React__default["default"].createElement(MRT_TablePaper, { table: table }),
2540
2544
  editingRow && props.editingMode === 'modal' && (React__default["default"].createElement(MRT_EditRowModal, { row: editingRow, table: table, open: true }))));
2541
2545
  };
2542
2546