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.
- package/dist/cjs/MaterialReactTable.d.ts +19 -1
- package/dist/cjs/body/MRT_EditRowModal.d.ts +1 -0
- package/dist/cjs/buttons/MRT_ColumnPinningButtons.d.ts +1 -0
- package/dist/cjs/buttons/MRT_EditActionButtons.d.ts +1 -0
- package/dist/cjs/buttons/MRT_FullScreenToggleButton.d.ts +2 -1
- package/dist/cjs/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/cjs/buttons/MRT_ShowHideColumnsButton.d.ts +2 -1
- package/dist/cjs/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -1
- package/dist/cjs/buttons/MRT_ToggleFiltersButton.d.ts +2 -1
- package/dist/cjs/buttons/MRT_ToggleGlobalFilterButton.d.ts +2 -1
- package/dist/cjs/column.utils.d.ts +3 -2
- package/dist/cjs/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/cjs/index.js +286 -204
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/inputs/MRT_EditCellTextField.d.ts +1 -0
- package/dist/cjs/inputs/MRT_GlobalFilterTextField.d.ts +1 -0
- package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +1 -0
- package/dist/cjs/menus/MRT_ShowHideColumnsMenu.d.ts +1 -0
- package/dist/cjs/toolbar/MRT_TablePagination.d.ts +1 -0
- package/dist/cjs/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -0
- package/dist/cjs/toolbar/MRT_TopToolbar.d.ts +1 -1
- package/dist/esm/MaterialReactTable.d.ts +19 -1
- package/dist/esm/body/MRT_EditRowModal.d.ts +1 -0
- package/dist/esm/buttons/MRT_ColumnPinningButtons.d.ts +1 -0
- package/dist/esm/buttons/MRT_EditActionButtons.d.ts +1 -0
- package/dist/esm/buttons/MRT_FullScreenToggleButton.d.ts +2 -1
- package/dist/esm/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/esm/buttons/MRT_ShowHideColumnsButton.d.ts +2 -1
- package/dist/esm/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -1
- package/dist/esm/buttons/MRT_ToggleFiltersButton.d.ts +2 -1
- package/dist/esm/buttons/MRT_ToggleGlobalFilterButton.d.ts +2 -1
- package/dist/esm/column.utils.d.ts +3 -2
- package/dist/esm/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/esm/inputs/MRT_EditCellTextField.d.ts +1 -0
- package/dist/esm/inputs/MRT_GlobalFilterTextField.d.ts +1 -0
- package/dist/esm/material-react-table.esm.js +47 -6
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +1 -0
- package/dist/esm/menus/MRT_ShowHideColumnsMenu.d.ts +1 -0
- package/dist/esm/toolbar/MRT_TablePagination.d.ts +1 -0
- package/dist/esm/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -0
- package/dist/esm/toolbar/MRT_TopToolbar.d.ts +1 -1
- package/dist/index.d.ts +20 -1
- package/locales/cs.esm.js.map +1 -1
- package/locales/cs.js.map +1 -1
- package/package.json +10 -8
- package/src/MaterialReactTable.tsx +19 -21
- package/src/_locales/cs.ts +4 -2
- package/src/body/MRT_EditRowModal.tsx +6 -8
- package/src/body/MRT_TableBody.tsx +4 -3
- package/src/body/MRT_TableBodyCell.tsx +3 -1
- package/src/body/MRT_TableBodyRow.tsx +2 -1
- package/src/body/MRT_TableDetailPanel.tsx +3 -1
- package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -1
- package/src/buttons/MRT_CopyButton.tsx +2 -1
- package/src/buttons/MRT_EditActionButtons.tsx +4 -1
- package/src/buttons/MRT_ExpandAllButton.tsx +2 -1
- package/src/buttons/MRT_ExpandButton.tsx +2 -1
- package/src/buttons/MRT_FullScreenToggleButton.tsx +3 -1
- package/src/buttons/MRT_GrabHandleButton.tsx +3 -1
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +3 -1
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +3 -1
- package/src/buttons/MRT_ToggleFiltersButton.tsx +3 -1
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -1
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +2 -1
- package/src/column.utils.ts +5 -3
- package/src/footer/MRT_TableFooter.tsx +2 -1
- package/src/footer/MRT_TableFooterCell.tsx +1 -1
- package/src/footer/MRT_TableFooterRow.tsx +1 -1
- package/src/head/MRT_TableHead.tsx +1 -1
- package/src/head/MRT_TableHeadCell.tsx +4 -1
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +2 -1
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +1 -1
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +4 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +2 -1
- package/src/head/MRT_TableHeadCellSortLabel.tsx +4 -2
- package/src/head/MRT_TableHeadRow.tsx +2 -1
- package/src/inputs/MRT_EditCellTextField.tsx +2 -1
- package/src/inputs/MRT_FilterCheckbox.tsx +4 -6
- package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
- package/src/inputs/MRT_FilterTextField.tsx +11 -13
- package/src/inputs/MRT_GlobalFilterTextField.tsx +6 -8
- package/src/inputs/MRT_SelectCheckbox.tsx +4 -1
- package/src/menus/MRT_ColumnActionMenu.tsx +6 -2
- package/src/menus/MRT_FilterOptionMenu.tsx +3 -1
- package/src/menus/MRT_RowActionMenu.tsx +5 -2
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +5 -2
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +6 -8
- package/src/sortingFns.ts +2 -2
- package/src/table/MRT_Table.tsx +1 -1
- package/src/table/MRT_TableContainer.tsx +1 -1
- package/src/table/MRT_TablePaper.tsx +1 -1
- package/src/table/MRT_TableRoot.tsx +5 -4
- package/src/toolbar/MRT_BottomToolbar.tsx +4 -1
- package/src/toolbar/MRT_LinearProgressBar.tsx +2 -1
- package/src/toolbar/MRT_TablePagination.tsx +1 -1
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +5 -1
- package/src/toolbar/MRT_ToolbarDropZone.tsx +4 -1
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +1 -1
- package/src/toolbar/MRT_TopToolbar.tsx +5 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { MRT_Header, MRT_InternalFilterOption, MRT_Localization, MRT_TableInstance } from '..';
|
|
2
3
|
export declare const mrtFilterOptions: (localization: MRT_Localization) => MRT_InternalFilterOption[];
|
|
3
4
|
interface Props<TData extends Record<string, any> = {}> {
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from 'react';
|
|
2
|
-
import type { AlertProps
|
|
2
|
+
import type { AlertProps } from '@mui/material/Alert';
|
|
3
|
+
import type { ButtonProps } from '@mui/material/Button';
|
|
4
|
+
import type { CheckboxProps } from '@mui/material/Checkbox';
|
|
5
|
+
import type { ChipProps } from '@mui/material/Chip';
|
|
6
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
7
|
+
import type { LinearProgressProps } from '@mui/material/LinearProgress';
|
|
8
|
+
import type { PaperProps } from '@mui/material/Paper';
|
|
9
|
+
import type { RadioProps } from '@mui/material/Radio';
|
|
10
|
+
import type { SkeletonProps } from '@mui/material/Skeleton';
|
|
11
|
+
import type { TableBodyProps } from '@mui/material/TableBody';
|
|
12
|
+
import type { TableCellProps } from '@mui/material/TableCell';
|
|
13
|
+
import type { TableContainerProps } from '@mui/material/TableContainer';
|
|
14
|
+
import type { TableFooterProps } from '@mui/material/TableFooter';
|
|
15
|
+
import type { TableHeadProps } from '@mui/material/TableHead';
|
|
16
|
+
import type { TablePaginationProps } from '@mui/material/TablePagination';
|
|
17
|
+
import type { TableProps } from '@mui/material/Table';
|
|
18
|
+
import type { TableRowProps } from '@mui/material/TableRow';
|
|
19
|
+
import type { TextFieldProps } from '@mui/material/TextField';
|
|
20
|
+
import type { ToolbarProps } from '@mui/material/Toolbar';
|
|
3
21
|
import type { Cell, Column, ColumnDef, DeepKeys, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
|
|
4
22
|
import type { Options as VirtualizerOptions, VirtualItem } from 'react-virtual';
|
|
5
23
|
import { MRT_FilterFns } from './filterFns';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
2
3
|
import { MRT_TableInstance } from '..';
|
|
3
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
|
4
5
|
table: MRT_TableInstance<TData>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IconButtonProps } from '@mui/material';
|
|
2
1
|
import { DragEventHandler } from 'react';
|
|
2
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
interface Props<TData extends Record<string, any> = {}> {
|
|
5
5
|
iconButtonProps?: IconButtonProps;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
2
3
|
import { MRT_TableInstance } from '..';
|
|
3
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
|
4
5
|
table: MRT_TableInstance<TData>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
2
3
|
import { MRT_TableInstance } from '..';
|
|
3
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
|
4
5
|
table: MRT_TableInstance<TData>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
2
3
|
import { MRT_TableInstance } from '..';
|
|
3
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
|
4
5
|
table: MRT_TableInstance<TData>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconButtonProps } from '@mui/material/IconButton';
|
|
2
3
|
import { MRT_TableInstance } from '..';
|
|
3
4
|
interface Props<TData extends Record<string, any> = {}> extends IconButtonProps {
|
|
4
5
|
table: MRT_TableInstance<TData>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ColumnOrderState, GroupingState } from '@tanstack/react-table';
|
|
2
|
-
import { TableCellProps, Theme } from '@mui/material';
|
|
1
|
+
import type { ColumnOrderState, GroupingState } from '@tanstack/react-table';
|
|
3
2
|
import { MRT_FilterFns } from './filterFns';
|
|
4
3
|
import { MRT_SortingFns } from './sortingFns';
|
|
4
|
+
import type { TableCellProps } from '@mui/material/TableCell';
|
|
5
|
+
import type { Theme } from '@mui/material/styles';
|
|
5
6
|
import type { MaterialReactTableProps, MRT_Column, MRT_ColumnDef, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterOption, MRT_Header, MRT_TableInstance } from '.';
|
|
6
7
|
export declare const getColumnId: <TData extends Record<string, any> = {}>(columnDef: MRT_ColumnDef<TData>) => string;
|
|
7
8
|
export declare const getAllLeafColumnDefs: <TData extends Record<string, any> = {}>(columns: MRT_ColumnDef<TData>[]) => MRT_ColumnDef<TData>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useRef, useState, useCallback, useEffect, Fragment, memo, useLayoutEffect } from 'react';
|
|
2
2
|
import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
|
3
|
-
import { alpha, lighten,
|
|
3
|
+
import { alpha, lighten, useTheme, darken } from '@mui/material/styles';
|
|
4
4
|
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
5
5
|
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
|
6
6
|
import CancelIcon from '@mui/icons-material/Cancel';
|
|
@@ -32,7 +32,48 @@ import SearchOffIcon from '@mui/icons-material/SearchOff';
|
|
|
32
32
|
import SortIcon from '@mui/icons-material/Sort';
|
|
33
33
|
import ViewColumnIcon from '@mui/icons-material/ViewColumn';
|
|
34
34
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
35
|
+
import Box from '@mui/material/Box';
|
|
36
|
+
import Dialog from '@mui/material/Dialog';
|
|
37
|
+
import Grow from '@mui/material/Grow';
|
|
38
|
+
import IconButton from '@mui/material/IconButton';
|
|
39
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
40
|
+
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
41
|
+
import Menu from '@mui/material/Menu';
|
|
42
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
43
|
+
import Button from '@mui/material/Button';
|
|
44
|
+
import Divider from '@mui/material/Divider';
|
|
45
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
46
|
+
import Switch from '@mui/material/Switch';
|
|
47
|
+
import Typography from '@mui/material/Typography';
|
|
48
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
49
|
+
import Radio from '@mui/material/Radio';
|
|
50
|
+
import Paper from '@mui/material/Paper';
|
|
51
|
+
import Toolbar from '@mui/material/Toolbar';
|
|
52
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
53
|
+
import Collapse from '@mui/material/Collapse';
|
|
54
|
+
import InputAdornment from '@mui/material/InputAdornment';
|
|
55
|
+
import TextField from '@mui/material/TextField';
|
|
56
|
+
import debounce from '@mui/material/utils/debounce';
|
|
57
|
+
import LinearProgress from '@mui/material/LinearProgress';
|
|
58
|
+
import TablePagination from '@mui/material/TablePagination';
|
|
59
|
+
import Alert from '@mui/material/Alert';
|
|
60
|
+
import AlertTitle from '@mui/material/AlertTitle';
|
|
61
|
+
import Chip from '@mui/material/Chip';
|
|
62
|
+
import Fade from '@mui/material/Fade';
|
|
63
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
64
|
+
import Table from '@mui/material/Table';
|
|
65
|
+
import TableHead from '@mui/material/TableHead';
|
|
66
|
+
import TableRow from '@mui/material/TableRow';
|
|
67
|
+
import TableCell from '@mui/material/TableCell';
|
|
68
|
+
import TableSortLabel from '@mui/material/TableSortLabel';
|
|
35
69
|
import { useVirtual } from 'react-virtual';
|
|
70
|
+
import TableBody from '@mui/material/TableBody';
|
|
71
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
72
|
+
import TableFooter from '@mui/material/TableFooter';
|
|
73
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
74
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
75
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
76
|
+
import Stack from '@mui/material/Stack';
|
|
36
77
|
|
|
37
78
|
/******************************************************************************
|
|
38
79
|
Copyright (c) Microsoft Corporation.
|
|
@@ -88,7 +129,7 @@ const prepareColumns = ({ columnDefs, columnFilterFns, defaultDisplayColumn, fil
|
|
|
88
129
|
}
|
|
89
130
|
if (!columnDef.columnDefType)
|
|
90
131
|
columnDef.columnDefType = 'data';
|
|
91
|
-
if (
|
|
132
|
+
if ((_a = columnDef.columns) === null || _a === void 0 ? void 0 : _a.length) {
|
|
92
133
|
columnDef.columnDefType = 'group';
|
|
93
134
|
columnDef.columns = prepareColumns({
|
|
94
135
|
columnDefs: columnDef.columns,
|
|
@@ -1448,7 +1489,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1448
1489
|
: (_b = column.getFilterValue()) !== null && _b !== void 0 ? _b : '';
|
|
1449
1490
|
});
|
|
1450
1491
|
const handleChangeDebounced = useCallback(debounce((event) => {
|
|
1451
|
-
|
|
1492
|
+
const value = textFieldProps.type === 'date'
|
|
1452
1493
|
? event.target.valueAsDate
|
|
1453
1494
|
: textFieldProps.type === 'number'
|
|
1454
1495
|
? event.target.valueAsNumber
|
|
@@ -1752,7 +1793,7 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
|
1752
1793
|
const { options: { localization }, } = table;
|
|
1753
1794
|
const { column } = header;
|
|
1754
1795
|
const { columnDef } = column;
|
|
1755
|
-
const sortTooltip =
|
|
1796
|
+
const sortTooltip = column.getIsSorted()
|
|
1756
1797
|
? column.getIsSorted() === 'desc'
|
|
1757
1798
|
? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
|
|
1758
1799
|
: localization.sortedByColumnAsc.replace('{column}', columnDef.header)
|
|
@@ -2301,8 +2342,8 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2301
2342
|
let paddingTop = 0;
|
|
2302
2343
|
let paddingBottom = 0;
|
|
2303
2344
|
if (enableRowVirtualization) {
|
|
2304
|
-
paddingTop =
|
|
2305
|
-
paddingBottom =
|
|
2345
|
+
paddingTop = virtualRows.length ? virtualRows[0].start : 0;
|
|
2346
|
+
paddingBottom = virtualRows.length
|
|
2306
2347
|
? virtualizer.totalSize - virtualRows[virtualRows.length - 1].end
|
|
2307
2348
|
: 0;
|
|
2308
2349
|
}
|