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>>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -391,7 +391,7 @@ const mrtFilterOptions = (localization) => [
|
|
|
391
391
|
];
|
|
392
392
|
const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table, }) => {
|
|
393
393
|
var _a, _b, _c, _d;
|
|
394
|
-
const { getState, options: {
|
|
394
|
+
const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
395
395
|
const { globalFilterFn, density } = getState();
|
|
396
396
|
const { column } = header !== null && header !== void 0 ? header : {};
|
|
397
397
|
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
|
@@ -399,8 +399,8 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table,
|
|
|
399
399
|
const internalFilterOptions = React.useMemo(() => mrtFilterOptions(localization).filter((filterOption) => columnDef
|
|
400
400
|
? allowedColumnFilterOptions === undefined ||
|
|
401
401
|
(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.includes(filterOption.option))
|
|
402
|
-
: (!
|
|
403
|
-
|
|
402
|
+
: (!globalFilterModeOptions ||
|
|
403
|
+
globalFilterModeOptions.includes(filterOption.option)) &&
|
|
404
404
|
['fuzzy', 'contains', 'startsWith'].includes(filterOption.option)), []);
|
|
405
405
|
const handleSelectFilterMode = (option) => {
|
|
406
406
|
if (header && column) {
|