material-react-table 1.2.3 → 1.2.4

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 (100) hide show
  1. package/dist/cjs/MaterialReactTable.d.ts +19 -1
  2. package/dist/cjs/body/MRT_EditRowModal.d.ts +1 -0
  3. package/dist/cjs/buttons/MRT_ColumnPinningButtons.d.ts +1 -0
  4. package/dist/cjs/buttons/MRT_EditActionButtons.d.ts +1 -0
  5. package/dist/cjs/buttons/MRT_FullScreenToggleButton.d.ts +2 -1
  6. package/dist/cjs/buttons/MRT_GrabHandleButton.d.ts +1 -1
  7. package/dist/cjs/buttons/MRT_ShowHideColumnsButton.d.ts +2 -1
  8. package/dist/cjs/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -1
  9. package/dist/cjs/buttons/MRT_ToggleFiltersButton.d.ts +2 -1
  10. package/dist/cjs/buttons/MRT_ToggleGlobalFilterButton.d.ts +2 -1
  11. package/dist/cjs/column.utils.d.ts +3 -2
  12. package/dist/cjs/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  13. package/dist/cjs/index.js +286 -204
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/inputs/MRT_EditCellTextField.d.ts +1 -0
  16. package/dist/cjs/inputs/MRT_GlobalFilterTextField.d.ts +1 -0
  17. package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +1 -0
  18. package/dist/cjs/menus/MRT_ShowHideColumnsMenu.d.ts +1 -0
  19. package/dist/cjs/toolbar/MRT_TablePagination.d.ts +1 -0
  20. package/dist/cjs/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -0
  21. package/dist/cjs/toolbar/MRT_TopToolbar.d.ts +1 -1
  22. package/dist/esm/MaterialReactTable.d.ts +19 -1
  23. package/dist/esm/body/MRT_EditRowModal.d.ts +1 -0
  24. package/dist/esm/buttons/MRT_ColumnPinningButtons.d.ts +1 -0
  25. package/dist/esm/buttons/MRT_EditActionButtons.d.ts +1 -0
  26. package/dist/esm/buttons/MRT_FullScreenToggleButton.d.ts +2 -1
  27. package/dist/esm/buttons/MRT_GrabHandleButton.d.ts +1 -1
  28. package/dist/esm/buttons/MRT_ShowHideColumnsButton.d.ts +2 -1
  29. package/dist/esm/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -1
  30. package/dist/esm/buttons/MRT_ToggleFiltersButton.d.ts +2 -1
  31. package/dist/esm/buttons/MRT_ToggleGlobalFilterButton.d.ts +2 -1
  32. package/dist/esm/column.utils.d.ts +3 -2
  33. package/dist/esm/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  34. package/dist/esm/inputs/MRT_EditCellTextField.d.ts +1 -0
  35. package/dist/esm/inputs/MRT_GlobalFilterTextField.d.ts +1 -0
  36. package/dist/esm/material-react-table.esm.js +47 -6
  37. package/dist/esm/material-react-table.esm.js.map +1 -1
  38. package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +1 -0
  39. package/dist/esm/menus/MRT_ShowHideColumnsMenu.d.ts +1 -0
  40. package/dist/esm/toolbar/MRT_TablePagination.d.ts +1 -0
  41. package/dist/esm/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -0
  42. package/dist/esm/toolbar/MRT_TopToolbar.d.ts +1 -1
  43. package/dist/index.d.ts +20 -1
  44. package/locales/cs.esm.js.map +1 -1
  45. package/locales/cs.js.map +1 -1
  46. package/package.json +10 -8
  47. package/src/MaterialReactTable.tsx +19 -21
  48. package/src/_locales/cs.ts +4 -2
  49. package/src/body/MRT_EditRowModal.tsx +6 -8
  50. package/src/body/MRT_TableBody.tsx +4 -3
  51. package/src/body/MRT_TableBodyCell.tsx +3 -1
  52. package/src/body/MRT_TableBodyRow.tsx +2 -1
  53. package/src/body/MRT_TableDetailPanel.tsx +3 -1
  54. package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -1
  55. package/src/buttons/MRT_CopyButton.tsx +2 -1
  56. package/src/buttons/MRT_EditActionButtons.tsx +4 -1
  57. package/src/buttons/MRT_ExpandAllButton.tsx +2 -1
  58. package/src/buttons/MRT_ExpandButton.tsx +2 -1
  59. package/src/buttons/MRT_FullScreenToggleButton.tsx +3 -1
  60. package/src/buttons/MRT_GrabHandleButton.tsx +3 -1
  61. package/src/buttons/MRT_ShowHideColumnsButton.tsx +3 -1
  62. package/src/buttons/MRT_ToggleDensePaddingButton.tsx +3 -1
  63. package/src/buttons/MRT_ToggleFiltersButton.tsx +3 -1
  64. package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -1
  65. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +2 -1
  66. package/src/column.utils.ts +5 -3
  67. package/src/footer/MRT_TableFooter.tsx +2 -1
  68. package/src/footer/MRT_TableFooterCell.tsx +1 -1
  69. package/src/footer/MRT_TableFooterRow.tsx +1 -1
  70. package/src/head/MRT_TableHead.tsx +1 -1
  71. package/src/head/MRT_TableHeadCell.tsx +4 -1
  72. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +2 -1
  73. package/src/head/MRT_TableHeadCellFilterContainer.tsx +1 -1
  74. package/src/head/MRT_TableHeadCellFilterLabel.tsx +4 -1
  75. package/src/head/MRT_TableHeadCellResizeHandle.tsx +2 -1
  76. package/src/head/MRT_TableHeadCellSortLabel.tsx +4 -2
  77. package/src/head/MRT_TableHeadRow.tsx +2 -1
  78. package/src/inputs/MRT_EditCellTextField.tsx +2 -1
  79. package/src/inputs/MRT_FilterCheckbox.tsx +4 -6
  80. package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
  81. package/src/inputs/MRT_FilterTextField.tsx +11 -13
  82. package/src/inputs/MRT_GlobalFilterTextField.tsx +6 -8
  83. package/src/inputs/MRT_SelectCheckbox.tsx +4 -1
  84. package/src/menus/MRT_ColumnActionMenu.tsx +6 -2
  85. package/src/menus/MRT_FilterOptionMenu.tsx +3 -1
  86. package/src/menus/MRT_RowActionMenu.tsx +5 -2
  87. package/src/menus/MRT_ShowHideColumnsMenu.tsx +5 -2
  88. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +6 -8
  89. package/src/sortingFns.ts +2 -2
  90. package/src/table/MRT_Table.tsx +1 -1
  91. package/src/table/MRT_TableContainer.tsx +1 -1
  92. package/src/table/MRT_TablePaper.tsx +1 -1
  93. package/src/table/MRT_TableRoot.tsx +5 -4
  94. package/src/toolbar/MRT_BottomToolbar.tsx +4 -1
  95. package/src/toolbar/MRT_LinearProgressBar.tsx +2 -1
  96. package/src/toolbar/MRT_TablePagination.tsx +1 -1
  97. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +5 -1
  98. package/src/toolbar/MRT_ToolbarDropZone.tsx +4 -1
  99. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +1 -1
  100. package/src/toolbar/MRT_TopToolbar.tsx +5 -1
@@ -5,14 +5,12 @@ import React, {
5
5
  useEffect,
6
6
  useState,
7
7
  } from 'react';
8
- import {
9
- Collapse,
10
- debounce,
11
- IconButton,
12
- InputAdornment,
13
- TextField,
14
- Tooltip,
15
- } from '@mui/material';
8
+ import Collapse from '@mui/material/Collapse';
9
+ import IconButton from '@mui/material/IconButton';
10
+ import InputAdornment from '@mui/material/InputAdornment';
11
+ import TextField from '@mui/material/TextField';
12
+ import Tooltip from '@mui/material/Tooltip';
13
+ import debounce from '@mui/material/utils/debounce';
16
14
  import { MRT_FilterOptionMenu } from '../menus/MRT_FilterOptionMenu';
17
15
  import { MRT_TableInstance } from '..';
18
16
 
@@ -1,5 +1,8 @@
1
1
  import React, { FC, MouseEvent } from 'react';
2
- import { Checkbox, Tooltip, Radio, Theme } from '@mui/material';
2
+ import Checkbox from '@mui/material/Checkbox';
3
+ import Tooltip from '@mui/material/Tooltip';
4
+ import Radio from '@mui/material/Radio';
5
+ import type { Theme } from '@mui/material/styles';
3
6
  import type { MRT_Row, MRT_TableInstance } from '..';
4
7
 
5
8
  interface Props {
@@ -1,8 +1,12 @@
1
1
  import React, { FC, useState } from 'react';
2
- import { Box, IconButton, ListItemIcon, Menu, MenuItem } from '@mui/material';
3
- import type { MRT_Header, MRT_TableInstance } from '..';
2
+ import Box from '@mui/material/Box';
3
+ import IconButton from '@mui/material/IconButton';
4
+ import ListItemIcon from '@mui/material/ListItemIcon';
5
+ import Menu from '@mui/material/Menu';
6
+ import MenuItem from '@mui/material/MenuItem';
4
7
  import { MRT_FilterOptionMenu } from './MRT_FilterOptionMenu';
5
8
  import { MRT_ShowHideColumnsMenu } from './MRT_ShowHideColumnsMenu';
9
+ import type { MRT_Header, MRT_TableInstance } from '..';
6
10
 
7
11
  export const commonMenuItemStyles = {
8
12
  py: '6px',
@@ -1,5 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
- import { Box, Menu, MenuItem } from '@mui/material';
2
+ import Box from '@mui/material/Box';
3
+ import Menu from '@mui/material/Menu';
4
+ import MenuItem from '@mui/material/MenuItem';
3
5
  import type {
4
6
  MRT_FilterOption,
5
7
  MRT_Header,
@@ -1,10 +1,13 @@
1
1
  import React, { FC, MouseEvent } from 'react';
2
- import { Box, ListItemIcon, Menu, MenuItem } from '@mui/material';
3
- import type { MRT_Row, MRT_TableInstance } from '..';
2
+ import Box from '@mui/material/Box';
3
+ import ListItemIcon from '@mui/material/ListItemIcon';
4
+ import Menu from '@mui/material/Menu';
5
+ import MenuItem from '@mui/material/MenuItem';
4
6
  import {
5
7
  commonListItemStyles,
6
8
  commonMenuItemStyles,
7
9
  } from './MRT_ColumnActionMenu';
10
+ import type { MRT_Row, MRT_TableInstance } from '..';
8
11
 
9
12
  interface Props {
10
13
  anchorEl: HTMLElement | null;
@@ -1,8 +1,11 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { Button, Menu, Divider, Box } from '@mui/material';
2
+ import Box from '@mui/material/Box';
3
+ import Button from '@mui/material/Button';
4
+ import Divider from '@mui/material/Divider';
5
+ import Menu from '@mui/material/Menu';
3
6
  import { MRT_ShowHideColumnsMenuItems } from './MRT_ShowHideColumnsMenuItems';
4
- import type { MRT_Column, MRT_TableInstance } from '..';
5
7
  import { getDefaultColumnOrderIds } from '../column.utils';
8
+ import type { MRT_Column, MRT_TableInstance } from '..';
6
9
 
7
10
  interface Props<TData extends Record<string, any> = {}> {
8
11
  anchorEl: HTMLElement | null;
@@ -5,14 +5,12 @@ import React, {
5
5
  useRef,
6
6
  useState,
7
7
  } from 'react';
8
- import {
9
- Box,
10
- FormControlLabel,
11
- MenuItem,
12
- Switch,
13
- Tooltip,
14
- Typography,
15
- } from '@mui/material';
8
+ import Box from '@mui/material/Box';
9
+ import FormControlLabel from '@mui/material/FormControlLabel';
10
+ import MenuItem from '@mui/material/MenuItem';
11
+ import Switch from '@mui/material/Switch';
12
+ import Tooltip from '@mui/material/Tooltip';
13
+ import Typography from '@mui/material/Typography';
16
14
  import { MRT_ColumnPinningButtons } from '../buttons/MRT_ColumnPinningButtons';
17
15
  import { MRT_GrabHandleButton } from '../buttons/MRT_GrabHandleButton';
18
16
  import { reorderColumn } from '../column.utils';
package/src/sortingFns.ts CHANGED
@@ -10,8 +10,8 @@ const fuzzy = <TData extends Record<string, any> = {}>(
10
10
  let dir = 0;
11
11
  if (rowA.columnFiltersMeta[columnId]) {
12
12
  dir = compareItems(
13
- rowA.columnFiltersMeta[columnId]! as RankingInfo,
14
- rowB.columnFiltersMeta[columnId]! as RankingInfo,
13
+ rowA.columnFiltersMeta[columnId] as RankingInfo,
14
+ rowB.columnFiltersMeta[columnId] as RankingInfo,
15
15
  );
16
16
  }
17
17
  // Provide a fallback for when the item ranks are equal
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { Table } from '@mui/material';
2
+ import Table from '@mui/material/Table';
3
3
  import { MRT_TableHead } from '../head/MRT_TableHead';
4
4
  import { Memo_MRT_TableBody, MRT_TableBody } from '../body/MRT_TableBody';
5
5
  import { MRT_TableFooter } from '../footer/MRT_TableFooter';
@@ -1,5 +1,5 @@
1
1
  import React, { FC, useEffect, useLayoutEffect, useState } from 'react';
2
- import { TableContainer } from '@mui/material';
2
+ import TableContainer from '@mui/material/TableContainer';
3
3
  import { MRT_Table } from './MRT_Table';
4
4
  import type { MRT_TableInstance } from '..';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { Paper } from '@mui/material';
2
+ import Paper from '@mui/material/Paper';
3
3
  import { MRT_TopToolbar } from '../toolbar/MRT_TopToolbar';
4
4
  import { MRT_BottomToolbar } from '../toolbar/MRT_BottomToolbar';
5
5
  import { MRT_TableContainer } from './MRT_TableContainer';
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect, useMemo, useRef, useState } from 'react';
2
2
  import {
3
- TableState,
4
3
  getCoreRowModel,
5
4
  getExpandedRowModel,
6
5
  getFacetedRowModel,
@@ -9,14 +8,16 @@ import {
9
8
  getPaginationRowModel,
10
9
  getSortedRowModel,
11
10
  useReactTable,
12
- GroupingState,
13
11
  } from '@tanstack/react-table';
14
- import { Box, Dialog, Grow } from '@mui/material';
12
+ import Box from '@mui/material/Box';
13
+ import Dialog from '@mui/material/Dialog';
14
+ import Grow from '@mui/material/Grow';
15
15
  import { MRT_ExpandAllButton } from '../buttons/MRT_ExpandAllButton';
16
16
  import { MRT_ExpandButton } from '../buttons/MRT_ExpandButton';
17
17
  import { MRT_ToggleRowActionMenuButton } from '../buttons/MRT_ToggleRowActionMenuButton';
18
18
  import { MRT_SelectCheckbox } from '../inputs/MRT_SelectCheckbox';
19
19
  import { MRT_TablePaper } from './MRT_TablePaper';
20
+ import { MRT_EditRowModal } from '../body/MRT_EditRowModal';
20
21
  import {
21
22
  prepareColumns,
22
23
  getAllLeafColumnDefs,
@@ -25,6 +26,7 @@ import {
25
26
  showExpandColumn,
26
27
  getColumnId,
27
28
  } from '../column.utils';
29
+ import type { GroupingState, TableState } from '@tanstack/react-table';
28
30
  import type {
29
31
  MRT_Cell,
30
32
  MRT_Column,
@@ -36,7 +38,6 @@ import type {
36
38
  MaterialReactTableProps,
37
39
  MRT_Localization,
38
40
  } from '..';
39
- import { MRT_EditRowModal } from '../body/MRT_EditRowModal';
40
41
 
41
42
  export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
42
43
  props: MaterialReactTableProps<TData> & { localization: MRT_Localization },
@@ -1,5 +1,8 @@
1
1
  import React, { FC } from 'react';
2
- import { alpha, Box, Toolbar, useMediaQuery } from '@mui/material';
2
+ import Box from '@mui/material/Box';
3
+ import Toolbar from '@mui/material/Toolbar';
4
+ import useMediaQuery from '@mui/material/useMediaQuery';
5
+ import { alpha } from '@mui/material/styles';
3
6
  import { MRT_TablePagination } from './MRT_TablePagination';
4
7
  import { MRT_ToolbarAlertBanner } from './MRT_ToolbarAlertBanner';
5
8
  import { MRT_LinearProgressBar } from './MRT_LinearProgressBar';
@@ -1,5 +1,6 @@
1
1
  import React, { FC } from 'react';
2
- import { Collapse, LinearProgress } from '@mui/material';
2
+ import Collapse from '@mui/material/Collapse';
3
+ import LinearProgress from '@mui/material/LinearProgress';
3
4
  import { MRT_TableInstance } from '..';
4
5
 
5
6
  interface Props {
@@ -1,5 +1,5 @@
1
1
  import React, { ChangeEvent } from 'react';
2
- import { TablePagination } from '@mui/material';
2
+ import TablePagination from '@mui/material/TablePagination';
3
3
  import { MRT_TableInstance } from '..';
4
4
 
5
5
  interface Props<TData extends Record<string, any> = {}> {
@@ -1,5 +1,9 @@
1
1
  import React, { FC, Fragment } from 'react';
2
- import { Alert, AlertTitle, Box, Chip, Collapse } from '@mui/material';
2
+ import Alert from '@mui/material/Alert';
3
+ import AlertTitle from '@mui/material/AlertTitle';
4
+ import Box from '@mui/material/Box';
5
+ import Chip from '@mui/material/Chip';
6
+ import Collapse from '@mui/material/Collapse';
3
7
  import { MRT_TableInstance } from '..';
4
8
 
5
9
  interface Props {
@@ -1,5 +1,8 @@
1
1
  import React, { DragEvent, FC } from 'react';
2
- import { alpha, Box, Fade, Typography } from '@mui/material';
2
+ import { alpha } from '@mui/material/styles';
3
+ import Box from '@mui/material/Box';
4
+ import Fade from '@mui/material/Fade';
5
+ import Typography from '@mui/material/Typography';
3
6
  import { MRT_TableInstance } from '..';
4
7
 
5
8
  interface Props {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Box } from '@mui/material';
2
+ import Box from '@mui/material/Box';
3
3
  import { MRT_FullScreenToggleButton } from '../buttons/MRT_FullScreenToggleButton';
4
4
  import { MRT_ShowHideColumnsButton } from '../buttons/MRT_ShowHideColumnsButton';
5
5
  import { MRT_ToggleDensePaddingButton } from '../buttons/MRT_ToggleDensePaddingButton';
@@ -1,5 +1,8 @@
1
1
  import React, { FC } from 'react';
2
- import { Box, lighten, Theme, Toolbar, useMediaQuery } from '@mui/material';
2
+ import Box from '@mui/material/Box';
3
+ import Toolbar from '@mui/material/Toolbar';
4
+ import useMediaQuery from '@mui/material/useMediaQuery';
5
+ import { lighten } from '@mui/material/styles';
3
6
  import { MRT_GlobalFilterTextField } from '../inputs/MRT_GlobalFilterTextField';
4
7
  import { MRT_LinearProgressBar } from './MRT_LinearProgressBar';
5
8
  import { MRT_TableInstance } from '..';
@@ -7,6 +10,7 @@ import { MRT_TablePagination } from './MRT_TablePagination';
7
10
  import { MRT_ToolbarAlertBanner } from './MRT_ToolbarAlertBanner';
8
11
  import { MRT_ToolbarInternalButtons } from './MRT_ToolbarInternalButtons';
9
12
  import { MRT_ToolbarDropZone } from './MRT_ToolbarDropZone';
13
+ import type { Theme } from '@mui/material/styles';
10
14
 
11
15
  export const commonToolbarStyles = ({ theme }: { theme: Theme }) => ({
12
16
  alignItems: 'flex-start',