material-react-table 0.40.6 → 0.40.7
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 +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/MaterialReactTable.d.ts +1 -1
- package/dist/esm/material-react-table.esm.js +3 -3
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +1 -1
- package/src/inputs/MRT_EditCellTextField.tsx +1 -6
- package/src/menus/MRT_FilterOptionMenu.tsx +3 -3
|
@@ -311,7 +311,7 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
|
|
|
311
311
|
enableTableHead?: boolean;
|
|
312
312
|
enableToolbarInternalActions?: boolean;
|
|
313
313
|
enableTopToolbar?: boolean;
|
|
314
|
-
|
|
314
|
+
globalFilterModeOptions?: (MRT_FilterOption | string)[] | null;
|
|
315
315
|
expandRowsFn?: (dataRow: TData) => TData[];
|
|
316
316
|
icons?: Partial<MRT_Icons>;
|
|
317
317
|
initialState?: Partial<MRT_TableState<TData>>;
|
|
@@ -383,7 +383,7 @@ const mrtFilterOptions = (localization) => [
|
|
|
383
383
|
];
|
|
384
384
|
const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table, }) => {
|
|
385
385
|
var _a, _b, _c, _d;
|
|
386
|
-
const { getState, options: {
|
|
386
|
+
const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
387
387
|
const { globalFilterFn, density } = getState();
|
|
388
388
|
const { column } = header !== null && header !== void 0 ? header : {};
|
|
389
389
|
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
|
@@ -391,8 +391,8 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table,
|
|
|
391
391
|
const internalFilterOptions = useMemo(() => mrtFilterOptions(localization).filter((filterOption) => columnDef
|
|
392
392
|
? allowedColumnFilterOptions === undefined ||
|
|
393
393
|
(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.includes(filterOption.option))
|
|
394
|
-
: (!
|
|
395
|
-
|
|
394
|
+
: (!globalFilterModeOptions ||
|
|
395
|
+
globalFilterModeOptions.includes(filterOption.option)) &&
|
|
396
396
|
['fuzzy', 'contains', 'startsWith'].includes(filterOption.option)), []);
|
|
397
397
|
const handleSelectFilterMode = (option) => {
|
|
398
398
|
if (header && column) {
|