material-react-table 0.40.3 → 0.40.4

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.
@@ -4,7 +4,7 @@ import { MRT_Localization } from '../localization';
4
4
  export declare const mrtFilterOptions: (localization: MRT_Localization) => MRT_InternalFilterOption[];
5
5
  interface Props<TData extends Record<string, any> = {}> {
6
6
  anchorEl: HTMLElement | null;
7
- header?: MRT_Header;
7
+ header?: MRT_Header<TData>;
8
8
  onSelect?: () => void;
9
9
  setAnchorEl: (anchorEl: HTMLElement | null) => void;
10
10
  table: MRT_TableInstance<TData>;
package/dist/index.d.ts CHANGED
@@ -408,10 +408,12 @@ declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<Column
408
408
  table: MRT_TableInstance<TData>;
409
409
  column: MRT_Column<TData>;
410
410
  }) => TableCellProps);
411
- renderColumnFilterModeMenuItems?: ({ table, column, }: {
412
- table: MRT_TableInstance<TData>;
411
+ renderColumnFilterModeMenuItems?: ({ column, internalFilterOptions, onSelectFilterMode, table, }: {
413
412
  column: MRT_Column<TData>;
414
- }) => ReactNode[];
413
+ internalFilterOptions: MRT_InternalFilterOption[];
414
+ onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
415
+ table: MRT_TableInstance<TData>;
416
+ }) => ReactNode;
415
417
  sortingFn?: MRT_SortingFn;
416
418
  };
417
419
  declare type MRT_DefinedColumnDef<TData extends Record<string, any> = {}> = Omit<MRT_ColumnDef<TData>, 'id'> & {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.40.3",
2
+ "version": "0.40.4",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
@@ -363,12 +363,16 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<
363
363
  column: MRT_Column<TData>;
364
364
  }) => TableCellProps);
365
365
  renderColumnFilterModeMenuItems?: ({
366
- table,
367
366
  column,
367
+ internalFilterOptions,
368
+ onSelectFilterMode,
369
+ table,
368
370
  }: {
369
- table: MRT_TableInstance<TData>;
370
371
  column: MRT_Column<TData>;
371
- }) => ReactNode[];
372
+ internalFilterOptions: MRT_InternalFilterOption[];
373
+ onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
374
+ table: MRT_TableInstance<TData>;
375
+ }) => ReactNode;
372
376
  sortingFn?: MRT_SortingFn;
373
377
  };
374
378
 
@@ -99,7 +99,7 @@ export const mrtFilterOptions = (
99
99
 
100
100
  interface Props<TData extends Record<string, any> = {}> {
101
101
  anchorEl: HTMLElement | null;
102
- header?: MRT_Header;
102
+ header?: MRT_Header<TData>;
103
103
  onSelect?: () => void;
104
104
  setAnchorEl: (anchorEl: HTMLElement | null) => void;
105
105
  table: MRT_TableInstance<TData>;
@@ -177,8 +177,14 @@ export const MRT_FilterOptionMenu = <TData extends Record<string, any> = {}>({
177
177
  dense: density === 'compact',
178
178
  }}
179
179
  >
180
- {(header && column
181
- ? renderColumnFilterModeMenuItems?.({
180
+ {(header && column && columnDef
181
+ ? columnDef.renderColumnFilterModeMenuItems?.({
182
+ column: column as any,
183
+ internalFilterOptions,
184
+ onSelectFilterMode: handleSelectFilterMode,
185
+ table,
186
+ }) ??
187
+ renderColumnFilterModeMenuItems?.({
182
188
  column: column as any,
183
189
  internalFilterOptions,
184
190
  onSelectFilterMode: handleSelectFilterMode,