material-react-table 2.3.1 → 2.4.0

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/index.d.ts CHANGED
@@ -30,7 +30,7 @@ import { TableHeadProps } from '@mui/material/TableHead';
30
30
  import { TableRowProps } from '@mui/material/TableRow';
31
31
  import { TextFieldProps } from '@mui/material/TextField';
32
32
  import { Theme } from '@mui/material/styles';
33
- import { DatePickerProps } from '@mui/x-date-pickers';
33
+ import { DatePickerProps, DateTimePickerProps, TimePickerProps } from '@mui/x-date-pickers';
34
34
  import * as _tanstack_match_sorter_utils from '@tanstack/match-sorter-utils';
35
35
  import { RankingInfo } from '@tanstack/match-sorter-utils';
36
36
  import { CollapseProps } from '@mui/material/Collapse';
@@ -178,6 +178,11 @@ type MRT_DensityState = 'comfortable' | 'compact' | 'spacious';
178
178
  type MRT_ColumnFilterFnsState = Record<string, MRT_FilterOption>;
179
179
  type MRT_RowData = Record<string, any>;
180
180
 
181
+ type MRT_ColumnVirtualizer<TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableCellElement> = Virtualizer<TScrollElement, TItemElement> & {
182
+ virtualPaddingLeft?: number;
183
+ virtualPaddingRight?: number;
184
+ };
185
+ type MRT_RowVirtualizer<TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableRowElement> = Virtualizer<TScrollElement, TItemElement>;
181
186
  type MRT_ColumnHelper<TData extends MRT_RowData> = {
182
187
  accessor: <TAccessor extends AccessorFn<TData> | DeepKeys<TData>, TValue extends TAccessor extends AccessorFn<TData, infer TReturn> ? TReturn : TAccessor extends DeepKeys<TData> ? DeepValue<TData, TAccessor> : never>(accessor: TAccessor, column: MRT_DisplayColumnDef<TData, TValue>) => MRT_ColumnDef<TData, TValue>;
183
188
  display: (column: MRT_DisplayColumnDef<TData>) => MRT_ColumnDef<TData>;
@@ -466,7 +471,7 @@ type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<ColumnDef
466
471
  text?: string;
467
472
  value: any;
468
473
  } | string)[];
469
- filterVariant?: 'autocomplete' | 'checkbox' | 'date' | 'date-range' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text';
474
+ filterVariant?: 'autocomplete' | 'checkbox' | 'date' | 'date-range' | 'datetime' | 'datetime-range' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text' | 'time' | 'time-range';
470
475
  /**
471
476
  * footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
472
477
  */
@@ -518,6 +523,11 @@ type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<ColumnDef
518
523
  rangeFilterIndex?: number;
519
524
  table: MRT_TableInstance<TData>;
520
525
  }) => DatePickerProps<any>) | DatePickerProps<any>;
526
+ muiFilterDateTimePickerProps?: ((props: {
527
+ column: MRT_Column<TData>;
528
+ rangeFilterIndex?: number;
529
+ table: MRT_TableInstance<TData>;
530
+ }) => DateTimePickerProps<any>) | DateTimePickerProps<any>;
521
531
  muiFilterSliderProps?: ((props: {
522
532
  column: MRT_Column<TData>;
523
533
  table: MRT_TableInstance<TData>;
@@ -527,6 +537,11 @@ type MRT_ColumnDef<TData extends MRT_RowData, TValue = unknown> = Omit<ColumnDef
527
537
  rangeFilterIndex?: number;
528
538
  table: MRT_TableInstance<TData>;
529
539
  }) => TextFieldProps) | TextFieldProps;
540
+ muiFilterTimePickerProps?: ((props: {
541
+ column: MRT_Column<TData>;
542
+ rangeFilterIndex?: number;
543
+ table: MRT_TableInstance<TData>;
544
+ }) => TimePickerProps<any>) | TimePickerProps<any>;
530
545
  muiTableBodyCellProps?: ((props: {
531
546
  cell: MRT_Cell<TData, TValue>;
532
547
  column: MRT_Column<TData>;
@@ -613,7 +628,7 @@ type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-row-expand
613
628
  type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'getRowId' | 'globalFilterFn' | 'initialState' | 'onStateChange' | 'state'> & {
614
629
  columnFilterDisplayMode?: 'custom' | 'popover' | 'subheader';
615
630
  columnFilterModeOptions?: Array<LiteralUnion<string & MRT_FilterOption>> | null;
616
- columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableCellElement> | null>;
631
+ columnVirtualizerInstanceRef?: MutableRefObject<MRT_ColumnVirtualizer | null>;
617
632
  columnVirtualizerOptions?: ((props: {
618
633
  table: MRT_TableInstance<TData>;
619
634
  }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>) | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>;
@@ -760,6 +775,11 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
760
775
  rangeFilterIndex?: number;
761
776
  table: MRT_TableInstance<TData>;
762
777
  }) => DatePickerProps<any>) | DatePickerProps<any>;
778
+ muiFilterDateTimePickerProps?: ((props: {
779
+ column: MRT_Column<TData>;
780
+ rangeFilterIndex?: number;
781
+ table: MRT_TableInstance<TData>;
782
+ }) => DateTimePickerProps<any>) | DateTimePickerProps<any>;
763
783
  muiFilterSliderProps?: ((props: {
764
784
  column: MRT_Column<TData>;
765
785
  table: MRT_TableInstance<TData>;
@@ -769,6 +789,11 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
769
789
  rangeFilterIndex?: number;
770
790
  table: MRT_TableInstance<TData>;
771
791
  }) => TextFieldProps) | TextFieldProps;
792
+ muiFilterTimePickerProps?: ((props: {
793
+ column: MRT_Column<TData>;
794
+ rangeFilterIndex?: number;
795
+ table: MRT_TableInstance<TData>;
796
+ }) => TimePickerProps<any>) | TimePickerProps<any>;
772
797
  muiLinearProgressProps?: ((props: {
773
798
  isTopToolbar: boolean;
774
799
  table: MRT_TableInstance<TData>;
@@ -976,7 +1001,7 @@ type MRT_TableOptions<TData extends MRT_RowData> = Omit<Partial<TableOptions<TDa
976
1001
  rowCount?: number;
977
1002
  rowNumberDisplayMode?: 'original' | 'static';
978
1003
  rowPinningDisplayMode?: 'bottom' | 'select-bottom' | 'select-sticky' | 'select-top' | 'sticky' | 'top' | 'top-and-bottom';
979
- rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableRowElement> | null>;
1004
+ rowVirtualizerInstanceRef?: MutableRefObject<MRT_RowVirtualizer | null>;
980
1005
  rowVirtualizerOptions?: ((props: {
981
1006
  table: MRT_TableInstance<TData>;
982
1007
  }) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>) | Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
@@ -994,14 +1019,12 @@ type Props$U<TData extends MRT_RowData> = Xor<TableInstanceProp<TData>, MRT_Tabl
994
1019
  declare const MaterialReactTable: <TData extends MRT_RowData>(props: Props$U<TData>) => react_jsx_runtime.JSX.Element;
995
1020
 
996
1021
  interface Props$T<TData extends MRT_RowData> extends TableBodyProps {
997
- columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
1022
+ columnVirtualizer?: MRT_ColumnVirtualizer;
998
1023
  table: MRT_TableInstance<TData>;
999
1024
  virtualColumns?: VirtualItem[];
1000
- virtualPaddingLeft?: number;
1001
- virtualPaddingRight?: number;
1002
1025
  }
1003
- declare const MRT_TableBody: <TData extends MRT_RowData>({ columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, ...rest }: Props$T<TData>) => react_jsx_runtime.JSX.Element;
1004
- declare const Memo_MRT_TableBody: <TData extends MRT_RowData>({ columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, ...rest }: Props$T<TData>) => react_jsx_runtime.JSX.Element;
1026
+ declare const MRT_TableBody: <TData extends MRT_RowData>({ columnVirtualizer, table, virtualColumns, ...rest }: Props$T<TData>) => react_jsx_runtime.JSX.Element;
1027
+ declare const Memo_MRT_TableBody: <TData extends MRT_RowData>({ columnVirtualizer, table, virtualColumns, ...rest }: Props$T<TData>) => react_jsx_runtime.JSX.Element;
1005
1028
 
1006
1029
  interface Props$S<TData extends MRT_RowData> extends TableCellProps {
1007
1030
  cell: MRT_Cell<TData>;
@@ -1022,7 +1045,7 @@ interface Props$R<TData extends MRT_RowData> {
1022
1045
  declare const MRT_TableBodyCellValue: <TData extends MRT_RowData>({ cell, table, }: Props$R<TData>) => ReactNode;
1023
1046
 
1024
1047
  interface Props$Q<TData extends MRT_RowData> {
1025
- columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
1048
+ columnVirtualizer?: MRT_ColumnVirtualizer;
1026
1049
  measureElement?: (element: HTMLTableRowElement) => void;
1027
1050
  numRows?: number;
1028
1051
  pinnedRowIds?: string[];
@@ -1030,12 +1053,10 @@ interface Props$Q<TData extends MRT_RowData> {
1030
1053
  rowIndex: number;
1031
1054
  table: MRT_TableInstance<TData>;
1032
1055
  virtualColumns?: VirtualItem[];
1033
- virtualPaddingLeft?: number;
1034
- virtualPaddingRight?: number;
1035
1056
  virtualRow?: VirtualItem;
1036
1057
  }
1037
- declare const MRT_TableBodyRow: <TData extends MRT_RowData>({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }: Props$Q<TData>) => react_jsx_runtime.JSX.Element;
1038
- declare const Memo_MRT_TableBodyRow: <TData extends MRT_RowData>({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }: Props$Q<TData>) => react_jsx_runtime.JSX.Element;
1058
+ declare const MRT_TableBodyRow: <TData extends MRT_RowData>({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualRow, }: Props$Q<TData>) => react_jsx_runtime.JSX.Element;
1059
+ declare const Memo_MRT_TableBodyRow: <TData extends MRT_RowData>({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualRow, }: Props$Q<TData>) => react_jsx_runtime.JSX.Element;
1039
1060
 
1040
1061
  interface Props$P<TData extends MRT_RowData> extends IconButtonProps {
1041
1062
  row: MRT_Row<TData>;
@@ -1259,12 +1280,11 @@ declare const getValueAndLabel: (option: {
1259
1280
  };
1260
1281
 
1261
1282
  interface Props$z<TData extends MRT_RowData> extends TableFooterProps {
1283
+ columnVirtualizer?: MRT_ColumnVirtualizer;
1262
1284
  table: MRT_TableInstance<TData>;
1263
1285
  virtualColumns?: VirtualItem[];
1264
- virtualPaddingLeft?: number;
1265
- virtualPaddingRight?: number;
1266
1286
  }
1267
- declare const MRT_TableFooter: <TData extends MRT_RowData>({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, ...rest }: Props$z<TData>) => react_jsx_runtime.JSX.Element;
1287
+ declare const MRT_TableFooter: <TData extends MRT_RowData>({ columnVirtualizer, table, virtualColumns, ...rest }: Props$z<TData>) => react_jsx_runtime.JSX.Element;
1268
1288
 
1269
1289
  interface Props$y<TData extends MRT_RowData> extends TableCellProps {
1270
1290
  footer: MRT_Header<TData>;
@@ -1273,21 +1293,19 @@ interface Props$y<TData extends MRT_RowData> extends TableCellProps {
1273
1293
  declare const MRT_TableFooterCell: <TData extends MRT_RowData>({ footer, table, ...rest }: Props$y<TData>) => react_jsx_runtime.JSX.Element;
1274
1294
 
1275
1295
  interface Props$x<TData extends MRT_RowData> extends TableRowProps {
1296
+ columnVirtualizer?: MRT_ColumnVirtualizer;
1276
1297
  footerGroup: MRT_HeaderGroup<TData>;
1277
1298
  table: MRT_TableInstance<TData>;
1278
1299
  virtualColumns?: VirtualItem[];
1279
- virtualPaddingLeft?: number;
1280
- virtualPaddingRight?: number;
1281
1300
  }
1282
- declare const MRT_TableFooterRow: <TData extends MRT_RowData>({ footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, ...rest }: Props$x<TData>) => react_jsx_runtime.JSX.Element | null;
1301
+ declare const MRT_TableFooterRow: <TData extends MRT_RowData>({ columnVirtualizer, footerGroup, table, virtualColumns, ...rest }: Props$x<TData>) => react_jsx_runtime.JSX.Element | null;
1283
1302
 
1284
1303
  interface Props$w<TData extends MRT_RowData> extends TableHeadProps {
1304
+ columnVirtualizer?: MRT_ColumnVirtualizer;
1285
1305
  table: MRT_TableInstance<TData>;
1286
1306
  virtualColumns?: VirtualItem[];
1287
- virtualPaddingLeft?: number;
1288
- virtualPaddingRight?: number;
1289
1307
  }
1290
- declare const MRT_TableHead: <TData extends MRT_RowData>({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, ...rest }: Props$w<TData>) => react_jsx_runtime.JSX.Element;
1308
+ declare const MRT_TableHead: <TData extends MRT_RowData>({ columnVirtualizer, table, virtualColumns, ...rest }: Props$w<TData>) => react_jsx_runtime.JSX.Element;
1291
1309
 
1292
1310
  interface Props$v<TData extends MRT_RowData> extends TableCellProps {
1293
1311
  header: MRT_Header<TData>;
@@ -1333,18 +1351,14 @@ interface Props$p<TData extends MRT_RowData> extends TableSortLabelProps {
1333
1351
  declare const MRT_TableHeadCellSortLabel: <TData extends MRT_RowData>({ header, table, ...rest }: Props$p<TData>) => react_jsx_runtime.JSX.Element;
1334
1352
 
1335
1353
  interface Props$o<TData extends MRT_RowData> extends TableRowProps {
1354
+ columnVirtualizer?: MRT_ColumnVirtualizer;
1336
1355
  headerGroup: MRT_HeaderGroup<TData>;
1337
1356
  table: MRT_TableInstance<TData>;
1338
1357
  virtualColumns?: VirtualItem[];
1339
- virtualPaddingLeft?: number;
1340
- virtualPaddingRight?: number;
1341
1358
  }
1342
- declare const MRT_TableHeadRow: <TData extends MRT_RowData>({ headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, ...rest }: Props$o<TData>) => react_jsx_runtime.JSX.Element;
1359
+ declare const MRT_TableHeadRow: <TData extends MRT_RowData>({ columnVirtualizer, headerGroup, table, virtualColumns, ...rest }: Props$o<TData>) => react_jsx_runtime.JSX.Element;
1343
1360
 
1344
- declare const useMRT_ColumnVirtualizer: <TData extends MRT_RowData, TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableCellElement>(table: MRT_TableInstance<TData>) => (Virtualizer<TScrollElement, TItemElement> & {
1345
- virtualPaddingLeft?: number | undefined;
1346
- virtualPaddingRight?: number | undefined;
1347
- }) | undefined;
1361
+ declare const useMRT_ColumnVirtualizer: <TData extends MRT_RowData, TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableCellElement>(table: MRT_TableInstance<TData>) => MRT_ColumnVirtualizer | undefined;
1348
1362
 
1349
1363
  interface Params<TData extends MRT_RowData> {
1350
1364
  columnOrder: ColumnOrderState;
@@ -1356,9 +1370,9 @@ declare const useMRT_DisplayColumns: <TData extends MRT_RowData>(params: Params<
1356
1370
 
1357
1371
  declare const useMRT_Effects: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>) => void;
1358
1372
 
1359
- declare const useMRT_RowVirtualizer: <TData extends MRT_RowData, TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableRowElement>(table: MRT_TableInstance<TData>) => Virtualizer<TScrollElement, TItemElement> | undefined;
1373
+ declare const useMRT_RowVirtualizer: <TData extends MRT_RowData, TScrollElement extends Element | Window = HTMLDivElement, TItemElement extends Element = HTMLTableRowElement>(table: MRT_TableInstance<TData>, rows?: MRT_Row<TData>[] | undefined) => MRT_RowVirtualizer<TScrollElement, TItemElement> | undefined;
1360
1374
 
1361
- declare const useMRT_Rows: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>) => MRT_Row<TData>[];
1375
+ declare const useMRT_Rows: <TData extends MRT_RowData>(table: MRT_TableInstance<TData>, pinnedRowIds?: string[]) => MRT_Row<TData>[];
1362
1376
 
1363
1377
  declare const useMRT_TableInstance: <TData extends MRT_RowData>(tableOptions: MRT_DefinedTableOptions<TData>) => MRT_TableInstance<TData>;
1364
1378
 
@@ -1585,4 +1599,4 @@ declare const MRT_TopToolbar: <TData extends MRT_RowData>({ table, }: Props<TDat
1585
1599
 
1586
1600
  declare const useMaterialReactTable: <TData extends MRT_RowData>(tableOptions: MRT_TableOptions<TData>) => MRT_TableInstance<TData>;
1587
1601
 
1588
- export { type LiteralUnion, type MRT_AggregationFn, MRT_AggregationFns, type MRT_AggregationOption, MRT_BottomToolbar, type MRT_Cell, type MRT_Column, MRT_ColumnActionMenu, type MRT_ColumnDef, type MRT_ColumnFilterFnsState, type MRT_ColumnHelper, MRT_ColumnPinningButtons, MRT_CopyButton, MRT_DefaultColumn, MRT_DefaultDisplayColumn, type MRT_DefinedColumnDef, type MRT_DefinedTableOptions, type MRT_DensityState, type MRT_DisplayColumnDef, type MRT_DisplayColumnIds, MRT_EditActionButtons, MRT_EditCellTextField, MRT_EditRowModal, MRT_ExpandAllButton, MRT_ExpandButton, MRT_FilterCheckbox, type MRT_FilterFn, MRT_FilterFns, type MRT_FilterOption, MRT_FilterOptionMenu, MRT_FilterRangeFields, MRT_FilterRangeSlider, MRT_FilterTextField, MRT_GlobalFilterTextField, MRT_GrabHandleButton, type MRT_GroupColumnDef, type MRT_Header, type MRT_HeaderGroup, type MRT_Icons, type MRT_InternalFilterOption, MRT_LinearProgressBar, type MRT_Localization, type MRT_Row, MRT_RowActionMenu, type MRT_RowData, type MRT_RowModel, MRT_RowPinButton, MRT_SelectCheckbox, MRT_ShowHideColumnsButton, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, type MRT_SortingFn, MRT_SortingFns, type MRT_SortingOption, MRT_Table, MRT_TableBody, MRT_TableBodyCell, MRT_TableBodyCellValue, MRT_TableBodyRow, MRT_TableBodyRowGrabHandle, MRT_TableBodyRowPinButton, MRT_TableContainer, MRT_TableDetailPanel, MRT_TableFooter, MRT_TableFooterCell, MRT_TableFooterRow, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellColumnActionsButton, MRT_TableHeadCellFilterContainer, MRT_TableHeadCellFilterLabel, MRT_TableHeadCellGrabHandle, MRT_TableHeadCellResizeHandle, MRT_TableHeadCellSortLabel, MRT_TableHeadRow, type MRT_TableInstance, MRT_TableLoadingOverlay, type MRT_TableOptions, MRT_TablePagination, MRT_TablePaper, type MRT_TableState, type MRT_Theme, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleFullScreenButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MaterialReactTable, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, type Prettify, type Xor, commonListItemStyles, commonMenuItemStyles, createMRTColumnHelper, createRow, extraIndexRangeExtractor, flexRender, getAllLeafColumnDefs, getCanRankRows, getColumnId, getCommonMRTCellStyles, getCommonToolbarStyles, getDefaultColumnFilterFn, getDefaultColumnOrderIds, getIsFirstColumn, getIsFirstRightPinnedColumn, getIsLastColumn, getIsLastLeftPinnedColumn, getLeadingDisplayColumnIds, getMRTTheme, getTotalRight, getTrailingDisplayColumnIds, getValueAndLabel, mrtFilterOptions, parseCSSVarId, parseFromValuesOrFunc, prepareColumns, rankGlobalFuzzy, reorderColumn, showExpandColumn, useMRT_ColumnVirtualizer, useMRT_DisplayColumns, useMRT_Effects, useMRT_RowVirtualizer, useMRT_Rows, useMRT_TableInstance, useMRT_TableOptions, useMaterialReactTable };
1602
+ export { type LiteralUnion, type MRT_AggregationFn, MRT_AggregationFns, type MRT_AggregationOption, MRT_BottomToolbar, type MRT_Cell, type MRT_Column, MRT_ColumnActionMenu, type MRT_ColumnDef, type MRT_ColumnFilterFnsState, type MRT_ColumnHelper, MRT_ColumnPinningButtons, type MRT_ColumnVirtualizer, MRT_CopyButton, MRT_DefaultColumn, MRT_DefaultDisplayColumn, type MRT_DefinedColumnDef, type MRT_DefinedTableOptions, type MRT_DensityState, type MRT_DisplayColumnDef, type MRT_DisplayColumnIds, MRT_EditActionButtons, MRT_EditCellTextField, MRT_EditRowModal, MRT_ExpandAllButton, MRT_ExpandButton, MRT_FilterCheckbox, type MRT_FilterFn, MRT_FilterFns, type MRT_FilterOption, MRT_FilterOptionMenu, MRT_FilterRangeFields, MRT_FilterRangeSlider, MRT_FilterTextField, MRT_GlobalFilterTextField, MRT_GrabHandleButton, type MRT_GroupColumnDef, type MRT_Header, type MRT_HeaderGroup, type MRT_Icons, type MRT_InternalFilterOption, MRT_LinearProgressBar, type MRT_Localization, type MRT_Row, MRT_RowActionMenu, type MRT_RowData, type MRT_RowModel, MRT_RowPinButton, type MRT_RowVirtualizer, MRT_SelectCheckbox, MRT_ShowHideColumnsButton, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, type MRT_SortingFn, MRT_SortingFns, type MRT_SortingOption, MRT_Table, MRT_TableBody, MRT_TableBodyCell, MRT_TableBodyCellValue, MRT_TableBodyRow, MRT_TableBodyRowGrabHandle, MRT_TableBodyRowPinButton, MRT_TableContainer, MRT_TableDetailPanel, MRT_TableFooter, MRT_TableFooterCell, MRT_TableFooterRow, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellColumnActionsButton, MRT_TableHeadCellFilterContainer, MRT_TableHeadCellFilterLabel, MRT_TableHeadCellGrabHandle, MRT_TableHeadCellResizeHandle, MRT_TableHeadCellSortLabel, MRT_TableHeadRow, type MRT_TableInstance, MRT_TableLoadingOverlay, type MRT_TableOptions, MRT_TablePagination, MRT_TablePaper, type MRT_TableState, type MRT_Theme, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleFullScreenButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MaterialReactTable, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, type Prettify, type Xor, commonListItemStyles, commonMenuItemStyles, createMRTColumnHelper, createRow, extraIndexRangeExtractor, flexRender, getAllLeafColumnDefs, getCanRankRows, getColumnId, getCommonMRTCellStyles, getCommonToolbarStyles, getDefaultColumnFilterFn, getDefaultColumnOrderIds, getIsFirstColumn, getIsFirstRightPinnedColumn, getIsLastColumn, getIsLastLeftPinnedColumn, getLeadingDisplayColumnIds, getMRTTheme, getTotalRight, getTrailingDisplayColumnIds, getValueAndLabel, mrtFilterOptions, parseCSSVarId, parseFromValuesOrFunc, prepareColumns, rankGlobalFuzzy, reorderColumn, showExpandColumn, useMRT_ColumnVirtualizer, useMRT_DisplayColumns, useMRT_Effects, useMRT_RowVirtualizer, useMRT_Rows, useMRT_TableInstance, useMRT_TableOptions, useMaterialReactTable };
package/dist/index.esm.js CHANGED
@@ -67,6 +67,8 @@ import Chip from '@mui/material/Chip';
67
67
  import InputAdornment from '@mui/material/InputAdornment';
68
68
  import { debounce } from '@mui/material/utils';
69
69
  import { DatePicker } from '@mui/x-date-pickers/DatePicker';
70
+ import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
71
+ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
70
72
  import FormHelperText from '@mui/material/FormHelperText';
71
73
  import Slider from '@mui/material/Slider';
72
74
  import Stack from '@mui/material/Stack';
@@ -802,11 +804,12 @@ const MRT_TableDetailPanel = (_a) => {
802
804
  : undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, py: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: renderDetailPanel && (jsx(Collapse, { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true, children: !isLoading && renderDetailPanel({ row, table }) })) })) })));
803
805
  };
804
806
 
805
- const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
807
+ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualRow, }) => {
806
808
  var _a, _b, _c, _d;
807
809
  const theme = useTheme();
808
810
  const { getState, options: { enableRowOrdering, enableRowPinning, enableStickyFooter, enableStickyHeader, layoutMode, memoMode, muiTableBodyRowProps, renderDetailPanel, rowPinningDisplayMode, }, refs: { tableFooterRef, tableHeadRef }, setHoveredRow, } = table;
809
811
  const { density, draggingColumn, draggingRow, editingCell, editingRow, hoveredRow, isFullScreen, rowPinning, } = getState();
812
+ const { virtualPaddingLeft, virtualPaddingRight } = columnVirtualizer !== null && columnVirtualizer !== void 0 ? columnVirtualizer : {};
810
813
  const isPinned = enableRowPinning && row.getIsPinned();
811
814
  const tableRowProps = parseFromValuesOrFunc(muiTableBodyRowProps, {
812
815
  row,
@@ -923,8 +926,9 @@ const useMRT_ColumnVirtualizer = (table) => {
923
926
  //get first 16 column widths and average them if calc is needed
924
927
  const averageColumnWidth = useMemo(() => {
925
928
  var _a, _b, _c, _d;
926
- if (!enableColumnVirtualization || (columnVirtualizerProps === null || columnVirtualizerProps === void 0 ? void 0 : columnVirtualizerProps.estimateSize))
929
+ if (!enableColumnVirtualization || (columnVirtualizerProps === null || columnVirtualizerProps === void 0 ? void 0 : columnVirtualizerProps.estimateSize)) {
927
930
  return 0;
931
+ }
928
932
  const columnsWidths = (_d = (_c = (_b = (_a = table
929
933
  .getRowModel()
930
934
  .rows[0]) === null || _a === void 0 ? void 0 : _a.getCenterVisibleCells()) === null || _b === void 0 ? void 0 : _b.slice(0, 16)) === null || _c === void 0 ? void 0 : _c.map((cell) => cell.column.getSize() * 1.2)) !== null && _d !== void 0 ? _d : [];
@@ -1082,7 +1086,8 @@ const MRT_EditActionButtons = (_a) => {
1082
1086
  });
1083
1087
  }
1084
1088
  };
1085
- return (jsx(Box, { onClick: (e) => e.stopPropagation(), sx: (theme) => (Object.assign({ display: 'flex', gap: '0.75rem' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: variant === 'icon' ? (jsxs(Fragment, { children: [jsx(Tooltip, { title: localization.cancel, children: jsx(IconButton, { "aria-label": localization.cancel, onClick: handleCancel, children: jsx(CancelIcon, {}) }) }), jsx(Tooltip, { title: localization.save, children: jsx(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSubmitRow, children: isSaving ? jsx(CircularProgress, { size: 18 }) : jsx(SaveIcon, {}) }) })] })) : (jsxs(Fragment, { children: [jsx(Button, { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxs(Button, { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsx(CircularProgress, { color: "inherit", size: 18 }), localization.save] })] })) }));
1089
+ return (jsx(Box, { onClick: (e) => e.stopPropagation(), sx: (theme) => (Object.assign({ display: 'flex', gap: '0.75rem' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: variant === 'icon' ? (jsxs(Fragment, { children: [jsx(Tooltip, { title: localization.cancel, children: jsx(IconButton, { "aria-label": localization.cancel, onClick: handleCancel, children: jsx(CancelIcon, {}) }) }), ((isCreating && onCreatingRowSave) ||
1090
+ (isEditing && onEditingRowSave)) && (jsx(Tooltip, { title: localization.save, children: jsx(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSubmitRow, children: isSaving ? jsx(CircularProgress, { size: 18 }) : jsx(SaveIcon, {}) }) }))] })) : (jsxs(Fragment, { children: [jsx(Button, { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxs(Button, { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsx(CircularProgress, { color: "inherit", size: 18 }), localization.save] })] })) }));
1086
1091
  };
1087
1092
 
1088
1093
  const mrtFilterOptions = (localization) => [
@@ -1174,7 +1179,7 @@ const mrtFilterOptions = (localization) => [
1174
1179
  const rangeModes = ['between', 'betweenInclusive', 'inNumberRange'];
1175
1180
  const emptyModes = ['empty', 'notEmpty'];
1176
1181
  const arrModes = ['arrIncludesSome', 'arrIncludesAll', 'arrIncludes'];
1177
- const rangeVariants = ['range-slider', 'date-range', 'range'];
1182
+ const rangeVariants = ['range-slider', 'date-range', 'datetime-range', 'range'];
1178
1183
  const MRT_FilterOptionMenu = (_a) => {
1179
1184
  var _b, _c, _d, _e;
1180
1185
  var { anchorEl, header, onSelect, setAnchorEl, setFilterValue, table } = _a, rest = __rest(_a, ["anchorEl", "header", "onSelect", "setAnchorEl", "setFilterValue", "table"]);
@@ -1690,14 +1695,15 @@ const useMRT_Effects = (table) => {
1690
1695
  }, [density]);
1691
1696
  };
1692
1697
 
1693
- const useMRT_RowVirtualizer = (table) => {
1698
+ const useMRT_RowVirtualizer = (table, rows) => {
1699
+ var _a;
1694
1700
  const { getRowModel, getState, options: { enableRowVirtualization, rowVirtualizerInstanceRef, rowVirtualizerOptions, }, refs: { tableContainerRef }, } = table;
1695
1701
  const { density, draggingRow } = getState();
1696
1702
  const rowVirtualizerProps = parseFromValuesOrFunc(rowVirtualizerOptions, {
1697
1703
  table,
1698
1704
  });
1699
1705
  const rowVirtualizer = enableRowVirtualization
1700
- ? useVirtualizer(Object.assign({ count: getRowModel().rows.length, estimateSize: () => density === 'compact' ? 37 : density === 'comfortable' ? 58 : 73, getScrollElement: () => tableContainerRef.current, measureElement: typeof window !== 'undefined' &&
1706
+ ? useVirtualizer(Object.assign({ count: (_a = rows === null || rows === void 0 ? void 0 : rows.length) !== null && _a !== void 0 ? _a : getRowModel().rows.length, estimateSize: () => density === 'compact' ? 37 : density === 'comfortable' ? 58 : 73, getScrollElement: () => tableContainerRef.current, measureElement: typeof window !== 'undefined' &&
1701
1707
  navigator.userAgent.indexOf('Firefox') === -1
1702
1708
  ? (element) => element === null || element === void 0 ? void 0 : element.getBoundingClientRect().height
1703
1709
  : undefined, overscan: 4, rangeExtractor: useCallback((range) => {
@@ -1726,7 +1732,7 @@ const MRT_SortingFns = Object.assign(Object.assign({}, sortingFns), { fuzzy: fuz
1726
1732
  const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
1727
1733
  Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
1728
1734
 
1729
- const useMRT_Rows = (table) => {
1735
+ const useMRT_Rows = (table, pinnedRowIds = []) => {
1730
1736
  const { getBottomRows, getCenterRows, getPrePaginationRowModel, getRowModel, getState, getTopRows, options: { enableGlobalFilterRankedResults, enablePagination, enableRowPinning, manualExpanding, manualFiltering, manualGrouping, manualPagination, manualSorting, rowPinningDisplayMode, }, } = table;
1731
1737
  const { expanded, globalFilter, pagination, rowPinning, sorting } = getState();
1732
1738
  const shouldRankRows = useMemo(() => getCanRankRows(table) &&
@@ -1741,9 +1747,6 @@ const useMRT_Rows = (table) => {
1741
1747
  manualSorting,
1742
1748
  sorting,
1743
1749
  ]);
1744
- const pinnedRowIds = useMemo(() => getRowModel()
1745
- .rows.filter((row) => row.getIsPinned())
1746
- .map((r) => r.id), [rowPinning, table.getRowModel().rows]);
1747
1750
  const rows = useMemo(() => {
1748
1751
  let rows = [];
1749
1752
  if (!shouldRankRows) {
@@ -2269,7 +2272,7 @@ const useMRT_TableOptions = (_a) => {
2269
2272
 
2270
2273
  const MRT_TableBody = (_a) => {
2271
2274
  var _b, _c, _d, _e, _f, _g;
2272
- var { columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["columnVirtualizer", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
2275
+ var { columnVirtualizer, table, virtualColumns } = _a, rest = __rest(_a, ["columnVirtualizer", "table", "virtualColumns"]);
2273
2276
  const { getBottomRows, getIsSomeRowsPinned, getRowModel, getState, getTopRows, options: { createDisplayMode, enableStickyFooter, enableStickyHeader, layoutMode, localization, memoMode, muiTableBodyProps, renderEmptyRowsFallback, rowPinningDisplayMode, }, refs: { tableFooterRef, tableHeadRef, tablePaperRef }, } = table;
2274
2277
  const { columnFilters, creatingRow, globalFilter, isFullScreen, rowPinning } = getState();
2275
2278
  const tableBodyProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyProps, { table })), rest);
@@ -2277,11 +2280,16 @@ const MRT_TableBody = (_a) => {
2277
2280
  ((_b = tableHeadRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) ||
2278
2281
  0;
2279
2282
  const tableFooterHeight = (enableStickyFooter && ((_c = tableFooterRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight)) || 0;
2280
- const pinnedRowIds = useMemo(() => getRowModel()
2281
- .rows.filter((row) => row.getIsPinned())
2282
- .map((r) => r.id), [rowPinning, table.getRowModel().rows]);
2283
- const rows = useMRT_Rows(table);
2284
- const rowVirtualizer = useMRT_RowVirtualizer(table);
2283
+ const pinnedRowIds = useMemo(() => {
2284
+ var _a, _b;
2285
+ if (!((_a = rowPinning.bottom) === null || _a === void 0 ? void 0 : _a.length) && !((_b = rowPinning.top) === null || _b === void 0 ? void 0 : _b.length))
2286
+ return [];
2287
+ return getRowModel()
2288
+ .rows.filter((row) => row.getIsPinned())
2289
+ .map((r) => r.id);
2290
+ }, [rowPinning, getRowModel().rows]);
2291
+ const rows = useMRT_Rows(table, pinnedRowIds);
2292
+ const rowVirtualizer = useMRT_RowVirtualizer(table, rows);
2285
2293
  const virtualRows = rowVirtualizer
2286
2294
  ? rowVirtualizer.getVirtualItems()
2287
2295
  : undefined;
@@ -2290,8 +2298,6 @@ const MRT_TableBody = (_a) => {
2290
2298
  numRows: rows.length,
2291
2299
  table,
2292
2300
  virtualColumns,
2293
- virtualPaddingLeft,
2294
- virtualPaddingRight,
2295
2301
  };
2296
2302
  const CreatingRow = creatingRow && createDisplayMode === 'row' && (jsx(MRT_TableBodyRow, Object.assign({}, commonRowProps, { row: creatingRow, rowIndex: -1 })));
2297
2303
  return (jsxs(Fragment, { children: [!(rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) &&
@@ -2362,8 +2368,9 @@ const MRT_TableFooterCell = (_a) => {
2362
2368
 
2363
2369
  const MRT_TableFooterRow = (_a) => {
2364
2370
  var _b;
2365
- var { footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["footerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
2371
+ var { columnVirtualizer, footerGroup, table, virtualColumns } = _a, rest = __rest(_a, ["columnVirtualizer", "footerGroup", "table", "virtualColumns"]);
2366
2372
  const { options: { layoutMode, muiTableFooterRowProps }, } = table;
2373
+ const { virtualPaddingLeft, virtualPaddingRight } = columnVirtualizer !== null && columnVirtualizer !== void 0 ? columnVirtualizer : {};
2367
2374
  // if no content in row, skip row
2368
2375
  if (!((_b = footerGroup.headers) === null || _b === void 0 ? void 0 : _b.some((header) => (typeof header.column.columnDef.footer === 'string' &&
2369
2376
  !!header.column.columnDef.footer) ||
@@ -2382,7 +2389,7 @@ const MRT_TableFooterRow = (_a) => {
2382
2389
  };
2383
2390
 
2384
2391
  const MRT_TableFooter = (_a) => {
2385
- var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
2392
+ var { columnVirtualizer, table, virtualColumns } = _a, rest = __rest(_a, ["columnVirtualizer", "table", "virtualColumns"]);
2386
2393
  const { getFooterGroups, getState, options: { enableStickyFooter, layoutMode, muiTableFooterProps }, refs: { tableFooterRef }, } = table;
2387
2394
  const { isFullScreen } = getState();
2388
2395
  const tableFooterProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterProps, {
@@ -2399,11 +2406,11 @@ const MRT_TableFooter = (_a) => {
2399
2406
  ? theme.palette.mode === 'light'
2400
2407
  ? `1px solid ${theme.palette.grey[300]}`
2401
2408
  : `1px solid ${theme.palette.grey[700]}`
2402
- : undefined, position: stickFooter ? 'sticky' : undefined, zIndex: stickFooter ? 1 : undefined }, parseFromValuesOrFunc(tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx, theme))), children: getFooterGroups().map((footerGroup) => (jsx(MRT_TableFooterRow, { footerGroup: footerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, footerGroup.id))) })));
2409
+ : undefined, position: stickFooter ? 'sticky' : undefined, zIndex: stickFooter ? 1 : undefined }, parseFromValuesOrFunc(tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx, theme))), children: getFooterGroups().map((footerGroup) => (jsx(MRT_TableFooterRow, { columnVirtualizer: columnVirtualizer, footerGroup: footerGroup, table: table, virtualColumns: virtualColumns }, footerGroup.id))) })));
2403
2410
  };
2404
2411
 
2405
2412
  const MRT_TableHeadCellColumnActionsButton = (_a) => {
2406
- var _b;
2413
+ var _b, _c;
2407
2414
  var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
2408
2415
  const { options: { icons: { MoreVertIcon }, localization, muiColumnActionsButtonProps, }, } = table;
2409
2416
  const { column } = header;
@@ -2423,7 +2430,7 @@ const MRT_TableHeadCellColumnActionsButton = (_a) => {
2423
2430
  })), rest);
2424
2431
  return (jsxs(Fragment, { children: [jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : localization.columnActions, children: jsx(IconButton, Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ '&:hover': {
2425
2432
  opacity: 1,
2426
- }, height: '2rem', m: '-8px -4px', opacity: 0.3, transition: 'all 150ms', width: '2rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: jsx(MoreVertIcon, { style: { transform: 'scale(0.9)' } }) })) }), anchorEl && (jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
2433
+ }, height: '2rem', m: '-8px -4px', opacity: 0.3, transition: 'all 150ms', width: '2rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_c = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _c !== void 0 ? _c : (jsx(MoreVertIcon, { style: { transform: 'scale(0.9)' } })) })) }), anchorEl && (jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
2427
2434
  };
2428
2435
 
2429
2436
  const MRT_FilterCheckbox = (_a) => {
@@ -2456,9 +2463,9 @@ const MRT_FilterCheckbox = (_a) => {
2456
2463
  };
2457
2464
 
2458
2465
  const MRT_FilterTextField = (_a) => {
2459
- var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2466
+ var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2460
2467
  var { header, rangeFilterIndex, table } = _a, rest = __rest(_a, ["header", "rangeFilterIndex", "table"]);
2461
- const { options: { columnFilterModeOptions, enableColumnFilterModes, icons: { CloseIcon, FilterListIcon }, localization, manualFiltering, muiFilterAutocompleteProps, muiFilterDatePickerProps, muiFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
2468
+ const { options: { columnFilterModeOptions, enableColumnFilterModes, icons: { CloseIcon, FilterListIcon }, localization, manualFiltering, muiFilterAutocompleteProps, muiFilterDatePickerProps, muiFilterDateTimePickerProps, muiFilterTextFieldProps, muiFilterTimePickerProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
2462
2469
  const { column } = header;
2463
2470
  const { columnDef } = column;
2464
2471
  const { filterVariant } = columnDef;
@@ -2474,7 +2481,15 @@ const MRT_FilterTextField = (_a) => {
2474
2481
  column,
2475
2482
  table,
2476
2483
  }));
2477
- const isDateFilter = filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('date');
2484
+ const dateTimePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterDateTimePickerProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterDateTimePickerProps, {
2485
+ column,
2486
+ table,
2487
+ }));
2488
+ const timePickerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTimePickerProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterTimePickerProps, {
2489
+ column,
2490
+ table,
2491
+ }));
2492
+ const isDateFilter = (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('date')) || (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('time'));
2478
2493
  const isAutocompleteFilter = filterVariant === 'autocomplete';
2479
2494
  const isRangeFilter = (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.includes('range')) || rangeFilterIndex !== undefined;
2480
2495
  const isSelectFilter = filterVariant === 'select';
@@ -2641,12 +2656,22 @@ const MRT_FilterTextField = (_a) => {
2641
2656
  : !filterChipLabel
2642
2657
  ? '120px'
2643
2658
  : 'auto', mx: '-2px', p: 0, width: 'calc(100% + 4px)' }, parseFromValuesOrFunc(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx, theme))) });
2644
- return (jsxs(Fragment, { children: [isDateFilter ? (jsx(DatePicker, Object.assign({ onChange: (newDate) => {
2645
- handleChange(newDate);
2646
- }, value: filterValue || null }, datePickerProps, { slotProps: {
2647
- field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_m = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _m === void 0 ? void 0 : _m.field),
2648
- textField: Object.assign(Object.assign({}, commonTextFieldProps), (_o = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _o === void 0 ? void 0 : _o.textField),
2649
- } }))) : isAutocompleteFilter ? (jsx(Autocomplete, Object.assign({ freeSolo: true, getOptionLabel: (option) => getValueAndLabel(option).label, onChange: (_e, newValue) => handleChange(getValueAndLabel(newValue).value), options: (_p = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option) => getValueAndLabel(option))) !== null && _p !== void 0 ? _p : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
2659
+ const commonDatePickerProps = {
2660
+ onChange: (newDate) => {
2661
+ handleChange(newDate);
2662
+ },
2663
+ value: filterValue || null,
2664
+ };
2665
+ return (jsxs(Fragment, { children: [(filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('time')) ? (jsx(TimePicker, Object.assign({}, commonDatePickerProps, timePickerProps, { slotProps: {
2666
+ field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_m = timePickerProps === null || timePickerProps === void 0 ? void 0 : timePickerProps.slotProps) === null || _m === void 0 ? void 0 : _m.field),
2667
+ textField: Object.assign(Object.assign({}, commonTextFieldProps), (_o = timePickerProps === null || timePickerProps === void 0 ? void 0 : timePickerProps.slotProps) === null || _o === void 0 ? void 0 : _o.textField),
2668
+ } }))) : (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('datetime')) ? (jsx(DateTimePicker, Object.assign({}, commonDatePickerProps, dateTimePickerProps, { slotProps: {
2669
+ field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_p = dateTimePickerProps === null || dateTimePickerProps === void 0 ? void 0 : dateTimePickerProps.slotProps) === null || _p === void 0 ? void 0 : _p.field),
2670
+ textField: Object.assign(Object.assign({}, commonTextFieldProps), (_q = dateTimePickerProps === null || dateTimePickerProps === void 0 ? void 0 : dateTimePickerProps.slotProps) === null || _q === void 0 ? void 0 : _q.textField),
2671
+ } }))) : (filterVariant === null || filterVariant === void 0 ? void 0 : filterVariant.startsWith('date')) ? (jsx(DatePicker, Object.assign({}, commonDatePickerProps, datePickerProps, { slotProps: {
2672
+ field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_r = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _r === void 0 ? void 0 : _r.field),
2673
+ textField: Object.assign(Object.assign({}, commonTextFieldProps), (_s = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _s === void 0 ? void 0 : _s.textField),
2674
+ } }))) : isAutocompleteFilter ? (jsx(Autocomplete, Object.assign({ freeSolo: true, getOptionLabel: (option) => getValueAndLabel(option).label, onChange: (_e, newValue) => handleChange(getValueAndLabel(newValue).value), options: (_t = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option) => getValueAndLabel(option))) !== null && _t !== void 0 ? _t : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
2650
2675
  var _a;
2651
2676
  return (jsx(TextField, Object.assign({}, builtinTextFieldProps, commonTextFieldProps, { InputProps: Object.assign(Object.assign({}, builtinTextFieldProps.InputProps), { startAdornment: (_a = commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.startAdornment }), inputProps: Object.assign(Object.assign({}, builtinTextFieldProps.inputProps), commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.inputProps), onChange: handleTextFieldChange })));
2652
2677
  }, value: filterValue }))) : (jsx(TextField, Object.assign({ SelectProps: {
@@ -2661,7 +2686,7 @@ const MRT_FilterTextField = (_a) => {
2661
2686
  }, onChange: handleTextFieldChange, select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { value: filterValue !== null && filterValue !== void 0 ? filterValue : '', children: (isSelectFilter || isMultiSelectFilter) && [
2662
2687
  jsx(MenuItem, { disabled: true, divider: true, hidden: true, value: "", children: jsx(Box, { sx: { opacity: 0.5 }, children: filterPlaceholder }) }, "p"),
2663
2688
  ...[
2664
- (_q = textFieldProps.children) !== null && _q !== void 0 ? _q : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
2689
+ (_u = textFieldProps.children) !== null && _u !== void 0 ? _u : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
2665
2690
  var _a;
2666
2691
  const { label, value } = getValueAndLabel(option);
2667
2692
  return (jsxs(MenuItem, { sx: {
@@ -3070,8 +3095,9 @@ const MRT_TableHeadCell = (_a) => {
3070
3095
  };
3071
3096
 
3072
3097
  const MRT_TableHeadRow = (_a) => {
3073
- var { headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["headerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
3098
+ var { columnVirtualizer, headerGroup, table, virtualColumns } = _a, rest = __rest(_a, ["columnVirtualizer", "headerGroup", "table", "virtualColumns"]);
3074
3099
  const { options: { layoutMode, muiTableHeadRowProps }, } = table;
3100
+ const { virtualPaddingLeft, virtualPaddingRight } = columnVirtualizer !== null && columnVirtualizer !== void 0 ? columnVirtualizer : {};
3075
3101
  const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadRowProps, {
3076
3102
  headerGroup,
3077
3103
  table,
@@ -3140,7 +3166,7 @@ const MRT_TablePagination = (_a) => {
3140
3166
  last: LastPageIcon,
3141
3167
  next: ChevronRightIcon,
3142
3168
  previous: ChevronLeftIcon,
3143
- } }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxs(Fragment, { children: [jsx(Typography, { align: "center", component: "span", sx: { m: '0 4px', minWidth: '8ch' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxs(Box, { gap: "xs", children: [showFirstButton && (jsx(IconButton, { "aria-label": localization.goToFirstPage, disabled: pageIndex <= 0 || disabled, onClick: () => setPageIndex(0), size: "small", children: jsx(FirstPageIcon, {}) })), jsx(IconButton, { "aria-label": localization.goToPreviousPage, disabled: pageIndex <= 0 || disabled, onClick: () => setPageIndex(pageIndex - 1), size: "small", children: jsx(ChevronLeftIcon, {}) }), jsx(IconButton, { "aria-label": localization.goToNextPage, disabled: lastRowIndex >= totalRowCount || disabled, onClick: () => setPageIndex(pageIndex + 1), size: "small", children: jsx(ChevronRightIcon, {}) }), showLastButton && (jsx(IconButton, { "aria-label": localization.goToLastPage, disabled: lastRowIndex >= totalRowCount || disabled, onClick: () => setPageIndex(numberOfPages - 1), size: "small", children: jsx(LastPageIcon, {}) }))] })] })) : null] }));
3169
+ } }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxs(Fragment, { children: [jsx(Typography, { align: "center", component: "span", sx: { m: '0 4px', minWidth: '8ch' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxs(Box, { gap: "xs", children: [showFirstButton && (jsx(Tooltip, { title: localization.goToFirstPage, children: jsx(IconButton, { "aria-label": localization.goToFirstPage, disabled: pageIndex <= 0 || disabled, onClick: () => setPageIndex(0), size: "small", children: jsx(FirstPageIcon, {}) }) })), jsx(Tooltip, { title: localization.goToPreviousPage, children: jsx(IconButton, { "aria-label": localization.goToPreviousPage, disabled: pageIndex <= 0 || disabled, onClick: () => setPageIndex(pageIndex - 1), size: "small", children: jsx(ChevronLeftIcon, {}) }) }), jsx(Tooltip, { title: localization.goToNextPage, children: jsx(IconButton, { "aria-label": localization.goToNextPage, disabled: lastRowIndex >= totalRowCount || disabled, onClick: () => setPageIndex(pageIndex + 1), size: "small", children: jsx(ChevronRightIcon, {}) }) }), showLastButton && (jsx(Tooltip, { title: localization.goToLastPage, children: jsx(IconButton, { "aria-label": localization.goToLastPage, disabled: lastRowIndex >= totalRowCount || disabled, onClick: () => setPageIndex(numberOfPages - 1), size: "small", children: jsx(LastPageIcon, {}) }) }))] })] })) : null] }));
3144
3170
  };
3145
3171
 
3146
3172
  const MRT_GlobalFilterTextField = (_a) => {
@@ -3512,7 +3538,7 @@ const MRT_TopToolbar = ({ table, }) => {
3512
3538
  };
3513
3539
 
3514
3540
  const MRT_TableHead = (_a) => {
3515
- var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
3541
+ var { columnVirtualizer, table, virtualColumns } = _a, rest = __rest(_a, ["columnVirtualizer", "table", "virtualColumns"]);
3516
3542
  const { getHeaderGroups, getSelectedRowModel, getState, options: { enableStickyHeader, layoutMode, muiTableHeadProps, positionToolbarAlertBanner, }, refs: { tableHeadRef }, } = table;
3517
3543
  const { isFullScreen, showAlertBanner } = getState();
3518
3544
  const tableHeadProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadProps, { table })), rest);
@@ -3529,7 +3555,7 @@ const MRT_TableHead = (_a) => {
3529
3555
  }, children: jsx("th", { colSpan: table.getVisibleLeafColumns().length, style: {
3530
3556
  display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
3531
3557
  padding: 0,
3532
- }, children: jsx(MRT_ToolbarAlertBanner, { table: table }) }) })) : (getHeaderGroups().map((headerGroup) => (jsx(MRT_TableHeadRow, { headerGroup: headerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, headerGroup.id)))) })));
3558
+ }, children: jsx(MRT_ToolbarAlertBanner, { table: table }) }) })) : (getHeaderGroups().map((headerGroup) => (jsx(MRT_TableHeadRow, { columnVirtualizer: columnVirtualizer, headerGroup: headerGroup, table: table, virtualColumns: virtualColumns }, headerGroup.id)))) })));
3533
3559
  };
3534
3560
 
3535
3561
  const MRT_Table = (_a) => {
@@ -3552,18 +3578,15 @@ const MRT_Table = (_a) => {
3552
3578
  return colSizes;
3553
3579
  }, [columns, columnSizing, columnSizingInfo, columnVisibility]);
3554
3580
  const columnVirtualizer = useMRT_ColumnVirtualizer(table);
3555
- const { virtualPaddingLeft, virtualPaddingRight } = columnVirtualizer !== null && columnVirtualizer !== void 0 ? columnVirtualizer : {};
3556
3581
  const virtualColumns = columnVirtualizer
3557
3582
  ? columnVirtualizer.getVirtualItems()
3558
3583
  : undefined;
3559
3584
  const commonTableGroupProps = {
3585
+ columnVirtualizer,
3560
3586
  table,
3561
3587
  virtualColumns,
3562
- virtualPaddingLeft,
3563
- virtualPaddingRight,
3564
3588
  };
3565
- const commonTableBodyProps = Object.assign(Object.assign({}, commonTableGroupProps), { columnVirtualizer });
3566
- return (jsxs(Table, Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style), sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined }, parseFromValuesOrFunc(tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx, theme))), children: [enableTableHead && jsx(MRT_TableHead, Object.assign({}, commonTableGroupProps)), memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (jsx(Memo_MRT_TableBody, Object.assign({}, commonTableBodyProps))) : (jsx(MRT_TableBody, Object.assign({}, commonTableBodyProps))), enableTableFooter && jsx(MRT_TableFooter, Object.assign({}, commonTableGroupProps))] })));
3589
+ return (jsxs(Table, Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style), sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined }, parseFromValuesOrFunc(tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx, theme))), children: [enableTableHead && jsx(MRT_TableHead, Object.assign({}, commonTableGroupProps)), memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (jsx(Memo_MRT_TableBody, Object.assign({}, commonTableGroupProps))) : (jsx(MRT_TableBody, Object.assign({}, commonTableGroupProps))), enableTableFooter && jsx(MRT_TableFooter, Object.assign({}, commonTableGroupProps))] })));
3567
3590
  };
3568
3591
 
3569
3592
  const MRT_TableLoadingOverlay = (_a) => {