material-react-table 0.40.5 → 0.40.6
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/index.js +10 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +11 -6
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +1 -3
- package/src/inputs/MRT_FilterTextField.tsx +11 -3
- package/src/table/MRT_TableRoot.tsx +1 -0
|
@@ -2,7 +2,7 @@ import React, { useMemo, useRef, useState, useCallback, Fragment, useEffect, use
|
|
|
2
2
|
import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
|
3
3
|
import { ArrowRight, Cancel, CheckBox, ClearAll, Close, DensityLarge, DensityMedium, DensitySmall, DragHandle, DynamicFeed, Edit, ExpandLess, ExpandMore, FilterAlt, FilterAltOff, FilterList, FilterListOff, FullscreenExit, Fullscreen, KeyboardDoubleArrowDown, MoreHoriz, MoreVert, PushPin, RestartAlt, Save, Search, SearchOff, Sort, ViewColumn, VisibilityOff } from '@mui/icons-material';
|
|
4
4
|
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
5
|
-
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten,
|
|
5
|
+
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, DialogTitle, DialogContent, Stack, DialogActions } from '@mui/material';
|
|
6
6
|
import { useVirtual } from 'react-virtual';
|
|
7
7
|
|
|
8
8
|
/******************************************************************************
|
|
@@ -1503,9 +1503,14 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1503
1503
|
value = option.value;
|
|
1504
1504
|
text = option.text;
|
|
1505
1505
|
}
|
|
1506
|
-
return (React.createElement(MenuItem, { key: value,
|
|
1506
|
+
return (React.createElement(MenuItem, { key: value, sx: {
|
|
1507
|
+
display: 'flex',
|
|
1508
|
+
m: 0,
|
|
1509
|
+
alignItems: 'center',
|
|
1510
|
+
gap: '0.5rem',
|
|
1511
|
+
}, value: value },
|
|
1507
1512
|
isMultiSelectFilter && (React.createElement(Checkbox, { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })),
|
|
1508
|
-
|
|
1513
|
+
text));
|
|
1509
1514
|
})),
|
|
1510
1515
|
React.createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table })));
|
|
1511
1516
|
};
|
|
@@ -1526,8 +1531,7 @@ const MRT_TableHeadCellFilterContainer = ({ header, table, }) => {
|
|
|
1526
1531
|
|
|
1527
1532
|
const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1528
1533
|
var _a, _b, _c;
|
|
1529
|
-
const {
|
|
1530
|
-
const { columnFilterFns } = getState();
|
|
1534
|
+
const { options: { icons: { FilterAltIcon }, localization, }, } = table;
|
|
1531
1535
|
const { column } = header;
|
|
1532
1536
|
const { columnDef } = column;
|
|
1533
1537
|
const isRangeFilter = [
|
|
@@ -1535,7 +1539,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
|
1535
1539
|
'betweenInclusive',
|
|
1536
1540
|
'inNumberRange',
|
|
1537
1541
|
].includes(columnDef._filterFn);
|
|
1538
|
-
const currentFilterOption =
|
|
1542
|
+
const currentFilterOption = columnDef._filterFn;
|
|
1539
1543
|
const filterTooltip = localization.filteringByColumn
|
|
1540
1544
|
.replace('{column}', String(columnDef.header))
|
|
1541
1545
|
.replace('{filterType}',
|
|
@@ -2419,6 +2423,7 @@ const MRT_TableRoot = (props) => {
|
|
|
2419
2423
|
props.displayColumnDefOptions,
|
|
2420
2424
|
props.editingMode,
|
|
2421
2425
|
props.enableColumnDragging,
|
|
2426
|
+
props.enableColumnFilterModes,
|
|
2422
2427
|
props.enableColumnOrdering,
|
|
2423
2428
|
props.enableEditing,
|
|
2424
2429
|
props.enableExpandAll,
|