material-react-table 1.2.4 → 1.2.5

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.
@@ -398,7 +398,7 @@ export declare type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' |
398
398
  * See the full props list on the official docs site:
399
399
  * @link https://www.material-react-table.com/docs/api/props
400
400
  */
401
- export declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'initialState' | 'onStateChange' | 'state'> & {
401
+ export declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'globalFilterFn' | 'initialState' | 'onStateChange' | 'state'> & {
402
402
  columnFilterModeOptions?: (MRT_FilterOption | string)[] | null;
403
403
  /**
404
404
  * The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
@@ -456,8 +456,9 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
456
456
  enableTableHead?: boolean;
457
457
  enableToolbarInternalActions?: boolean;
458
458
  enableTopToolbar?: boolean;
459
- globalFilterModeOptions?: (MRT_FilterOption | string)[] | null;
460
459
  expandRowsFn?: (dataRow: TData) => TData[];
460
+ globalFilterFn?: MRT_FilterOption;
461
+ globalFilterModeOptions?: MRT_FilterOption[] | null;
461
462
  icons?: Partial<MRT_Icons>;
462
463
  initialState?: Partial<MRT_TableState<TData>>;
463
464
  /**
package/dist/cjs/index.js CHANGED
@@ -2640,14 +2640,11 @@ const MRT_TableRoot = (props) => {
2640
2640
  const tablePaperRef = React.useRef(null);
2641
2641
  const topToolbarRef = React.useRef(null);
2642
2642
  const initialState = React.useMemo(() => {
2643
- var _a, _b;
2643
+ var _a, _b, _c;
2644
2644
  const initState = (_a = props.initialState) !== null && _a !== void 0 ? _a : {};
2645
2645
  initState.columnOrder =
2646
2646
  (_b = initState.columnOrder) !== null && _b !== void 0 ? _b : getDefaultColumnOrderIds(props);
2647
- initState.globalFilterFn =
2648
- props.globalFilterFn instanceof String
2649
- ? props.globalFilterFn
2650
- : 'fuzzy';
2647
+ initState.globalFilterFn = (_c = props.globalFilterFn) !== null && _c !== void 0 ? _c : 'fuzzy';
2651
2648
  return initState;
2652
2649
  }, []);
2653
2650
  const [columnFilterFns, setColumnFilterFns] = React.useState(() => Object.assign({}, ...getAllLeafColumnDefs(props.columns).map((col) => {