material-react-table 1.2.2 → 1.2.3
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/column.utils.d.ts +1 -1
- package/dist/cjs/index.js +90 -31
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/table/MRT_TableRoot.d.ts +2 -2
- package/dist/esm/column.utils.d.ts +1 -1
- package/dist/esm/material-react-table.esm.js +60 -31
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/table/MRT_TableRoot.d.ts +2 -2
- package/package.json +1 -1
- package/src/column.utils.ts +3 -3
- package/src/icons.ts +60 -62
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_FilterOption, MRT_Row, MRT_TableInstance, MRT_TableState, MaterialReactTableProps, MRT_Localization } from '..';
|
|
3
|
-
export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/table-core").TableOptions<TData>>, "
|
|
3
|
+
export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/table-core").TableOptions<TData>>, "state" | "data" | "onStateChange" | "initialState" | "columns" | "defaultColumn" | "enableRowSelection" | "expandRowsFn"> & {
|
|
4
4
|
columnFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined;
|
|
5
5
|
columns: MRT_ColumnDef<TData>[];
|
|
6
6
|
data: TData[];
|
|
@@ -13,7 +13,7 @@ export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(pro
|
|
|
13
13
|
"mrt-row-select": Partial<MRT_ColumnDef<{}>>;
|
|
14
14
|
"mrt-row-numbers": Partial<MRT_ColumnDef<{}>>;
|
|
15
15
|
}> | undefined;
|
|
16
|
-
editingMode?: "
|
|
16
|
+
editingMode?: "cell" | "row" | "table" | "modal" | undefined;
|
|
17
17
|
enableBottomToolbar?: boolean | undefined;
|
|
18
18
|
enableClickToCopy?: boolean | undefined;
|
|
19
19
|
enableColumnActions?: boolean | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ColumnOrderState, GroupingState } from '@tanstack/react-table';
|
|
2
2
|
import { TableCellProps, Theme } from '@mui/material';
|
|
3
|
-
import { MaterialReactTableProps, MRT_Column, MRT_ColumnDef, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterOption, MRT_Header, MRT_TableInstance } from '.';
|
|
4
3
|
import { MRT_FilterFns } from './filterFns';
|
|
5
4
|
import { MRT_SortingFns } from './sortingFns';
|
|
5
|
+
import type { MaterialReactTableProps, MRT_Column, MRT_ColumnDef, MRT_DefinedColumnDef, MRT_DisplayColumnIds, MRT_FilterOption, MRT_Header, MRT_TableInstance } from '.';
|
|
6
6
|
export declare const getColumnId: <TData extends Record<string, any> = {}>(columnDef: MRT_ColumnDef<TData>) => string;
|
|
7
7
|
export declare const getAllLeafColumnDefs: <TData extends Record<string, any> = {}>(columns: MRT_ColumnDef<TData>[]) => MRT_ColumnDef<TData>[];
|
|
8
8
|
export declare const prepareColumns: <TData extends Record<string, any> = {}>({ columnDefs, columnFilterFns, defaultDisplayColumn, filterFns, sortingFns, }: {
|
|
@@ -2,7 +2,36 @@ import React, { useMemo, useRef, useState, useCallback, useEffect, Fragment, mem
|
|
|
2
2
|
import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
|
3
3
|
import { alpha, lighten, Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Radio, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, useMediaQuery, Toolbar, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, DialogTitle, DialogContent, Stack, DialogActions } from '@mui/material';
|
|
4
4
|
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
5
|
-
import
|
|
5
|
+
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
|
6
|
+
import CancelIcon from '@mui/icons-material/Cancel';
|
|
7
|
+
import CheckBoxIcon from '@mui/icons-material/CheckBox';
|
|
8
|
+
import ClearAllIcon from '@mui/icons-material/ClearAll';
|
|
9
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
10
|
+
import DensityLargeIcon from '@mui/icons-material/DensityLarge';
|
|
11
|
+
import DensityMediumIcon from '@mui/icons-material/DensityMedium';
|
|
12
|
+
import DensitySmallIcon from '@mui/icons-material/DensitySmall';
|
|
13
|
+
import DragHandleIcon from '@mui/icons-material/DragHandle';
|
|
14
|
+
import DynamicFeedIcon from '@mui/icons-material/DynamicFeed';
|
|
15
|
+
import EditIcon from '@mui/icons-material/Edit';
|
|
16
|
+
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
|
|
17
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
18
|
+
import FilterAltIcon from '@mui/icons-material/FilterAlt';
|
|
19
|
+
import FilterAltOffIcon from '@mui/icons-material/FilterAltOff';
|
|
20
|
+
import FilterListIcon from '@mui/icons-material/FilterList';
|
|
21
|
+
import FilterListOffIcon from '@mui/icons-material/FilterListOff';
|
|
22
|
+
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
|
|
23
|
+
import FullscreenIcon from '@mui/icons-material/Fullscreen';
|
|
24
|
+
import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown';
|
|
25
|
+
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
|
26
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
27
|
+
import PushPinIcon from '@mui/icons-material/PushPin';
|
|
28
|
+
import RestartAltIcon from '@mui/icons-material/RestartAlt';
|
|
29
|
+
import SaveIcon from '@mui/icons-material/Save';
|
|
30
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
31
|
+
import SearchOffIcon from '@mui/icons-material/SearchOff';
|
|
32
|
+
import SortIcon from '@mui/icons-material/Sort';
|
|
33
|
+
import ViewColumnIcon from '@mui/icons-material/ViewColumn';
|
|
34
|
+
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
6
35
|
import { useVirtual } from 'react-virtual';
|
|
7
36
|
|
|
8
37
|
/******************************************************************************
|
|
@@ -276,36 +305,36 @@ const MRT_FilterFns = Object.assign(Object.assign({}, filterFns), { between,
|
|
|
276
305
|
startsWith });
|
|
277
306
|
|
|
278
307
|
const MRT_Default_Icons = {
|
|
279
|
-
ArrowRightIcon
|
|
280
|
-
CancelIcon
|
|
281
|
-
CheckBoxIcon
|
|
282
|
-
ClearAllIcon
|
|
283
|
-
CloseIcon
|
|
284
|
-
DensityLargeIcon
|
|
285
|
-
DensityMediumIcon
|
|
286
|
-
DensitySmallIcon
|
|
287
|
-
DragHandleIcon
|
|
288
|
-
DynamicFeedIcon
|
|
289
|
-
EditIcon
|
|
290
|
-
ExpandLessIcon
|
|
291
|
-
ExpandMoreIcon
|
|
292
|
-
FilterAltIcon
|
|
293
|
-
FilterAltOffIcon
|
|
294
|
-
FilterListIcon
|
|
295
|
-
FilterListOffIcon
|
|
296
|
-
FullscreenExitIcon
|
|
297
|
-
FullscreenIcon
|
|
298
|
-
KeyboardDoubleArrowDownIcon
|
|
299
|
-
MoreHorizIcon
|
|
300
|
-
MoreVertIcon
|
|
301
|
-
PushPinIcon
|
|
302
|
-
RestartAltIcon
|
|
303
|
-
SaveIcon
|
|
304
|
-
SearchIcon
|
|
305
|
-
SearchOffIcon
|
|
306
|
-
SortIcon
|
|
307
|
-
ViewColumnIcon
|
|
308
|
-
VisibilityOffIcon
|
|
308
|
+
ArrowRightIcon,
|
|
309
|
+
CancelIcon,
|
|
310
|
+
CheckBoxIcon,
|
|
311
|
+
ClearAllIcon,
|
|
312
|
+
CloseIcon,
|
|
313
|
+
DensityLargeIcon,
|
|
314
|
+
DensityMediumIcon,
|
|
315
|
+
DensitySmallIcon,
|
|
316
|
+
DragHandleIcon,
|
|
317
|
+
DynamicFeedIcon,
|
|
318
|
+
EditIcon,
|
|
319
|
+
ExpandLessIcon,
|
|
320
|
+
ExpandMoreIcon,
|
|
321
|
+
FilterAltIcon,
|
|
322
|
+
FilterAltOffIcon,
|
|
323
|
+
FilterListIcon,
|
|
324
|
+
FilterListOffIcon,
|
|
325
|
+
FullscreenExitIcon,
|
|
326
|
+
FullscreenIcon,
|
|
327
|
+
KeyboardDoubleArrowDownIcon,
|
|
328
|
+
MoreHorizIcon,
|
|
329
|
+
MoreVertIcon,
|
|
330
|
+
PushPinIcon,
|
|
331
|
+
RestartAltIcon,
|
|
332
|
+
SaveIcon,
|
|
333
|
+
SearchIcon,
|
|
334
|
+
SearchOffIcon,
|
|
335
|
+
SortIcon,
|
|
336
|
+
ViewColumnIcon,
|
|
337
|
+
VisibilityOffIcon,
|
|
309
338
|
};
|
|
310
339
|
|
|
311
340
|
const fuzzy = (rowA, rowB, columnId) => {
|