material-react-table 1.14.0 → 1.15.1
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/README.md +3 -2
- package/dist/cjs/index.js +18 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/column.utils.d.ts +4 -4
- package/dist/cjs/types/sortingFns.d.ts +1 -418
- package/dist/cjs/types/types.d.ts +3 -3
- package/dist/esm/material-react-table.esm.js +18 -17
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/column.utils.d.ts +4 -4
- package/dist/esm/types/sortingFns.d.ts +1 -418
- package/dist/esm/types/types.d.ts +3 -3
- package/dist/index.d.ts +14 -14
- package/package.json +36 -36
- package/src/body/MRT_TableBodyRow.tsx +7 -5
- package/src/buttons/MRT_ExpandAllButton.tsx +2 -3
- package/src/buttons/MRT_ExpandButton.tsx +2 -3
- package/src/buttons/MRT_FullScreenToggleButton.tsx +1 -1
- package/src/footer/MRT_TableFooterRow.tsx +2 -2
- package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -9
- package/src/head/MRT_TableHeadRow.tsx +2 -2
- package/src/sortingFns.ts +1 -5
- package/src/types.ts +375 -377
package/src/types.ts
CHANGED
|
@@ -364,7 +364,7 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> =
|
|
|
364
364
|
* @example accessorKey: 'username' //simple
|
|
365
365
|
* @example accessorKey: 'name.firstName' //deep key dot notation
|
|
366
366
|
*/
|
|
367
|
-
accessorKey?: DeepKeys<TData>;
|
|
367
|
+
accessorKey?: (string & {}) | DeepKeys<TData>;
|
|
368
368
|
aggregationFn?: MRT_AggregationFn<TData> | Array<MRT_AggregationFn<TData>>;
|
|
369
369
|
/**
|
|
370
370
|
* Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
|
|
@@ -603,383 +603,381 @@ export type MRT_CreateTableFeature<
|
|
|
603
603
|
* @link https://www.material-react-table.com/docs/api/props
|
|
604
604
|
*/
|
|
605
605
|
export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
| 'state'
|
|
619
|
-
> & {
|
|
620
|
-
columnFilterModeOptions?: Array<
|
|
621
|
-
LiteralUnion<string & MRT_FilterOption>
|
|
622
|
-
> | null;
|
|
623
|
-
/**
|
|
624
|
-
* The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
|
|
625
|
-
*
|
|
626
|
-
* See more info on creating columns on the official docs site:
|
|
627
|
-
* @link https://www.material-react-table.com/docs/guides/data-columns
|
|
628
|
-
* @link https://www.material-react-table.com/docs/guides/display-columns
|
|
629
|
-
*
|
|
630
|
-
* See all Columns Options on the official docs site:
|
|
631
|
-
* @link https://www.material-react-table.com/docs/api/column-options
|
|
632
|
-
*/
|
|
633
|
-
columns: MRT_ColumnDef<TData>[];
|
|
634
|
-
/**
|
|
635
|
-
* Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
|
|
636
|
-
*
|
|
637
|
-
* See the usage guide for more info on creating columns and data:
|
|
638
|
-
* @link https://www.material-react-table.com/docs/getting-started/usage
|
|
639
|
-
*/
|
|
640
|
-
data: TData[];
|
|
641
|
-
/**
|
|
642
|
-
* Instead of specifying a bunch of the same options for each column, you can just change an option in the `defaultColumn` prop to change a default option for all columns.
|
|
643
|
-
*/
|
|
644
|
-
defaultColumn?: Partial<MRT_ColumnDef<TData>>;
|
|
645
|
-
/**
|
|
646
|
-
* Change the default options for display columns.
|
|
647
|
-
*/
|
|
648
|
-
defaultDisplayColumn?: Partial<MRT_ColumnDef<TData>>;
|
|
649
|
-
displayColumnDefOptions?: Partial<{
|
|
650
|
-
[key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef>;
|
|
651
|
-
}>;
|
|
652
|
-
editingMode?: 'table' | 'modal' | 'row' | 'cell';
|
|
653
|
-
enableBottomToolbar?: boolean;
|
|
654
|
-
enableClickToCopy?: boolean;
|
|
655
|
-
enableColumnActions?: boolean;
|
|
656
|
-
enableColumnDragging?: boolean;
|
|
657
|
-
enableColumnFilterModes?: boolean;
|
|
658
|
-
enableColumnOrdering?: boolean;
|
|
659
|
-
enableColumnVirtualization?: boolean;
|
|
660
|
-
enableDensityToggle?: boolean;
|
|
661
|
-
enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
|
|
662
|
-
enableExpandAll?: boolean;
|
|
663
|
-
enableFacetedValues?: boolean;
|
|
664
|
-
enableFilterMatchHighlighting?: boolean;
|
|
665
|
-
enableFullScreenToggle?: boolean;
|
|
666
|
-
enableGlobalFilterModes?: boolean;
|
|
667
|
-
enableGlobalFilterRankedResults?: boolean;
|
|
668
|
-
enablePagination?: boolean;
|
|
669
|
-
enableRowActions?: boolean;
|
|
670
|
-
enableRowDragging?: boolean;
|
|
671
|
-
enableRowNumbers?: boolean;
|
|
672
|
-
enableRowOrdering?: boolean;
|
|
673
|
-
enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
|
|
674
|
-
enableRowVirtualization?: boolean;
|
|
675
|
-
enableSelectAll?: boolean;
|
|
676
|
-
enableStickyFooter?: boolean;
|
|
677
|
-
enableStickyHeader?: boolean;
|
|
678
|
-
enableTableFooter?: boolean;
|
|
679
|
-
enableTableHead?: boolean;
|
|
680
|
-
enableToolbarInternalActions?: boolean;
|
|
681
|
-
enableTopToolbar?: boolean;
|
|
682
|
-
expandRowsFn?: (dataRow: TData) => TData[];
|
|
683
|
-
getRowId?: (
|
|
684
|
-
originalRow: TData,
|
|
685
|
-
index: number,
|
|
686
|
-
parentRow: MRT_Row<TData>,
|
|
687
|
-
) => string;
|
|
688
|
-
globalFilterFn?: MRT_FilterOption;
|
|
689
|
-
globalFilterModeOptions?: MRT_FilterOption[] | null;
|
|
690
|
-
icons?: Partial<MRT_Icons>;
|
|
691
|
-
initialState?: Partial<MRT_TableState<TData>>;
|
|
692
|
-
/**
|
|
693
|
-
* Changes which kind of CSS layout is used to render the table. `semantic` uses default semantic HTML elements, while `grid` adds CSS grid and flexbox styles
|
|
694
|
-
*/
|
|
695
|
-
layoutMode?: 'semantic' | 'grid';
|
|
696
|
-
/**
|
|
697
|
-
* Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
|
|
698
|
-
*
|
|
699
|
-
* See the localization (i18n) guide for more info:
|
|
700
|
-
* @link https://www.material-react-table.com/docs/guides/localization
|
|
701
|
-
*/
|
|
702
|
-
localization?: Partial<MRT_Localization>;
|
|
703
|
-
/**
|
|
704
|
-
* Memoize cells, rows, or the entire table body to potentially improve render performance.
|
|
705
|
-
*
|
|
706
|
-
* @warning This will break some dynamic rendering features. See the memoization guide for more info:
|
|
707
|
-
* @link https://www.material-react-table.com/docs/guides/memoize-components
|
|
708
|
-
*/
|
|
709
|
-
memoMode?: 'cells' | 'rows' | 'table-body';
|
|
710
|
-
muiBottomToolbarProps?:
|
|
711
|
-
| ToolbarProps
|
|
712
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
|
|
713
|
-
muiExpandAllButtonProps?:
|
|
714
|
-
| IconButtonProps
|
|
715
|
-
| ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps);
|
|
716
|
-
muiExpandButtonProps?:
|
|
717
|
-
| IconButtonProps
|
|
718
|
-
| ((props: {
|
|
719
|
-
table: MRT_TableInstance<TData>;
|
|
720
|
-
row: MRT_Row<TData>;
|
|
721
|
-
}) => IconButtonProps);
|
|
722
|
-
muiLinearProgressProps?:
|
|
723
|
-
| LinearProgressProps
|
|
724
|
-
| ((props: {
|
|
725
|
-
isTopToolbar: boolean;
|
|
726
|
-
table: MRT_TableInstance<TData>;
|
|
727
|
-
}) => LinearProgressProps);
|
|
728
|
-
muiSearchTextFieldProps?:
|
|
729
|
-
| TextFieldProps
|
|
730
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps);
|
|
731
|
-
muiSelectAllCheckboxProps?:
|
|
732
|
-
| CheckboxProps
|
|
733
|
-
| ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps);
|
|
734
|
-
muiSelectCheckboxProps?:
|
|
735
|
-
| (CheckboxProps | RadioProps)
|
|
736
|
-
| ((props: {
|
|
737
|
-
table: MRT_TableInstance<TData>;
|
|
738
|
-
row: MRT_Row<TData>;
|
|
739
|
-
}) => CheckboxProps | RadioProps);
|
|
740
|
-
muiTableBodyCellCopyButtonProps?:
|
|
741
|
-
| ButtonProps
|
|
742
|
-
| ((props: {
|
|
743
|
-
cell: MRT_Cell<TData>;
|
|
744
|
-
column: MRT_Column<TData>;
|
|
745
|
-
row: MRT_Row<TData>;
|
|
746
|
-
table: MRT_TableInstance<TData>;
|
|
747
|
-
}) => ButtonProps);
|
|
748
|
-
muiTableBodyCellEditTextFieldProps?:
|
|
749
|
-
| TextFieldProps
|
|
750
|
-
| ((props: {
|
|
751
|
-
cell: MRT_Cell<TData>;
|
|
752
|
-
column: MRT_Column<TData>;
|
|
753
|
-
row: MRT_Row<TData>;
|
|
754
|
-
table: MRT_TableInstance<TData>;
|
|
755
|
-
}) => TextFieldProps);
|
|
756
|
-
muiTableBodyCellProps?:
|
|
757
|
-
| TableCellProps
|
|
758
|
-
| ((props: {
|
|
759
|
-
cell: MRT_Cell<TData>;
|
|
760
|
-
column: MRT_Column<TData>;
|
|
761
|
-
row: MRT_Row<TData>;
|
|
762
|
-
table: MRT_TableInstance<TData>;
|
|
763
|
-
}) => TableCellProps);
|
|
764
|
-
muiTableBodyCellSkeletonProps?:
|
|
765
|
-
| SkeletonProps
|
|
766
|
-
| ((props: {
|
|
767
|
-
cell: MRT_Cell<TData>;
|
|
768
|
-
column: MRT_Column<TData>;
|
|
769
|
-
row: MRT_Row<TData>;
|
|
770
|
-
table: MRT_TableInstance<TData>;
|
|
771
|
-
}) => SkeletonProps);
|
|
772
|
-
muiTableBodyProps?:
|
|
773
|
-
| TableBodyProps
|
|
774
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps);
|
|
775
|
-
muiTableBodyRowDragHandleProps?:
|
|
776
|
-
| IconButtonProps
|
|
777
|
-
| ((props: {
|
|
778
|
-
table: MRT_TableInstance<TData>;
|
|
779
|
-
row: MRT_Row<TData>;
|
|
780
|
-
}) => IconButtonProps);
|
|
781
|
-
muiTableBodyRowProps?:
|
|
782
|
-
| TableRowProps
|
|
783
|
-
| ((props: {
|
|
784
|
-
isDetailPanel?: boolean;
|
|
785
|
-
row: MRT_Row<TData>;
|
|
786
|
-
staticRowIndex: number;
|
|
787
|
-
table: MRT_TableInstance<TData>;
|
|
788
|
-
}) => TableRowProps);
|
|
789
|
-
muiTableContainerProps?:
|
|
790
|
-
| TableContainerProps
|
|
791
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps);
|
|
792
|
-
muiTableDetailPanelProps?:
|
|
793
|
-
| TableCellProps
|
|
794
|
-
| ((props: {
|
|
795
|
-
table: MRT_TableInstance<TData>;
|
|
796
|
-
row: MRT_Row<TData>;
|
|
797
|
-
}) => TableCellProps);
|
|
798
|
-
muiTableFooterCellProps?:
|
|
799
|
-
| TableCellProps
|
|
800
|
-
| ((props: {
|
|
801
|
-
table: MRT_TableInstance<TData>;
|
|
802
|
-
column: MRT_Column<TData>;
|
|
803
|
-
}) => TableCellProps);
|
|
804
|
-
muiTableFooterProps?:
|
|
805
|
-
| TableFooterProps
|
|
806
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps);
|
|
807
|
-
muiTableFooterRowProps?:
|
|
808
|
-
| TableRowProps
|
|
809
|
-
| ((props: {
|
|
810
|
-
table: MRT_TableInstance<TData>;
|
|
811
|
-
footerGroup: MRT_HeaderGroup<TData>;
|
|
812
|
-
}) => TableRowProps);
|
|
813
|
-
muiTableHeadCellColumnActionsButtonProps?:
|
|
814
|
-
| IconButtonProps
|
|
815
|
-
| ((props: {
|
|
816
|
-
table: MRT_TableInstance<TData>;
|
|
817
|
-
column: MRT_Column<TData>;
|
|
818
|
-
}) => IconButtonProps);
|
|
819
|
-
muiTableHeadCellDragHandleProps?:
|
|
820
|
-
| IconButtonProps
|
|
821
|
-
| ((props: {
|
|
822
|
-
table: MRT_TableInstance<TData>;
|
|
823
|
-
column: MRT_Column<TData>;
|
|
824
|
-
}) => IconButtonProps);
|
|
825
|
-
muiTableHeadCellFilterCheckboxProps?:
|
|
826
|
-
| CheckboxProps
|
|
827
|
-
| ((props: {
|
|
828
|
-
column: MRT_Column<TData>;
|
|
829
|
-
table: MRT_TableInstance<TData>;
|
|
830
|
-
}) => CheckboxProps);
|
|
831
|
-
muiTableHeadCellFilterTextFieldProps?:
|
|
832
|
-
| TextFieldProps
|
|
833
|
-
| ((props: {
|
|
834
|
-
table: MRT_TableInstance<TData>;
|
|
835
|
-
column: MRT_Column<TData>;
|
|
836
|
-
rangeFilterIndex?: number;
|
|
837
|
-
}) => TextFieldProps);
|
|
838
|
-
muiTableHeadCellFilterSliderProps?:
|
|
839
|
-
| SliderProps
|
|
840
|
-
| ((props: {
|
|
841
|
-
table: MRT_TableInstance<TData>;
|
|
842
|
-
column: MRT_Column<TData>;
|
|
843
|
-
}) => TextFieldProps);
|
|
844
|
-
muiTableHeadCellProps?:
|
|
845
|
-
| TableCellProps
|
|
846
|
-
| ((props: {
|
|
847
|
-
table: MRT_TableInstance<TData>;
|
|
848
|
-
column: MRT_Column<TData>;
|
|
849
|
-
}) => TableCellProps);
|
|
850
|
-
muiTableHeadProps?:
|
|
851
|
-
| TableHeadProps
|
|
852
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps);
|
|
853
|
-
muiTableHeadRowProps?:
|
|
854
|
-
| TableRowProps
|
|
855
|
-
| ((props: {
|
|
856
|
-
table: MRT_TableInstance<TData>;
|
|
857
|
-
headerGroup: MRT_HeaderGroup<TData>;
|
|
858
|
-
}) => TableRowProps);
|
|
859
|
-
muiTablePaginationProps?:
|
|
860
|
-
| Partial<Omit<TablePaginationProps, 'rowsPerPage'>>
|
|
861
|
-
| ((props: {
|
|
862
|
-
table: MRT_TableInstance<TData>;
|
|
863
|
-
}) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
|
|
864
|
-
muiTablePaperProps?:
|
|
865
|
-
| PaperProps
|
|
866
|
-
| ((props: { table: MRT_TableInstance<TData> }) => PaperProps);
|
|
867
|
-
muiTableProps?:
|
|
868
|
-
| TableProps
|
|
869
|
-
| ((props: { table: MRT_TableInstance<TData> }) => TableProps);
|
|
870
|
-
muiToolbarAlertBannerChipProps?:
|
|
871
|
-
| ChipProps
|
|
872
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ChipProps);
|
|
873
|
-
muiToolbarAlertBannerProps?:
|
|
874
|
-
| AlertProps
|
|
875
|
-
| ((props: { table: MRT_TableInstance<TData> }) => AlertProps);
|
|
876
|
-
muiTopToolbarProps?:
|
|
877
|
-
| ToolbarProps
|
|
878
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
|
|
879
|
-
onDensityChange?: OnChangeFn<MRT_DensityState>;
|
|
880
|
-
onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
|
|
881
|
-
onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
882
|
-
onEditingCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
|
|
883
|
-
onEditingRowCancel?: (props: {
|
|
884
|
-
row: MRT_Row<TData>;
|
|
885
|
-
table: MRT_TableInstance<TData>;
|
|
886
|
-
}) => void;
|
|
887
|
-
onEditingRowSave?: (props: {
|
|
888
|
-
exitEditingMode: () => void;
|
|
889
|
-
row: MRT_Row<TData>;
|
|
890
|
-
table: MRT_TableInstance<TData>;
|
|
891
|
-
values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
|
|
892
|
-
}) => Promise<void> | void;
|
|
893
|
-
onEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
894
|
-
onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
|
|
895
|
-
onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
|
|
896
|
-
onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
|
|
897
|
-
onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
898
|
-
onIsFullScreenChange?: OnChangeFn<boolean>;
|
|
899
|
-
onShowAlertBannerChange?: OnChangeFn<boolean>;
|
|
900
|
-
onShowColumnFiltersChange?: OnChangeFn<boolean>;
|
|
901
|
-
onShowGlobalFilterChange?: OnChangeFn<boolean>;
|
|
902
|
-
onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
|
|
903
|
-
positionActionsColumn?: 'first' | 'last';
|
|
904
|
-
positionExpandColumn?: 'first' | 'last';
|
|
905
|
-
positionGlobalFilter?: 'left' | 'right' | 'none';
|
|
906
|
-
positionPagination?: 'bottom' | 'top' | 'both' | 'none';
|
|
907
|
-
positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
|
|
908
|
-
positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
|
|
909
|
-
renderBottomToolbar?:
|
|
910
|
-
| ReactNode
|
|
911
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
|
|
912
|
-
renderBottomToolbarCustomActions?: (props: {
|
|
913
|
-
table: MRT_TableInstance<TData>;
|
|
914
|
-
}) => ReactNode;
|
|
915
|
-
renderColumnActionsMenuItems?: (props: {
|
|
916
|
-
column: MRT_Column<TData>;
|
|
917
|
-
closeMenu: () => void;
|
|
918
|
-
internalColumnMenuItems: ReactNode[];
|
|
919
|
-
table: MRT_TableInstance<TData>;
|
|
920
|
-
}) => ReactNode[];
|
|
921
|
-
renderColumnFilterModeMenuItems?: (props: {
|
|
922
|
-
column: MRT_Column<TData>;
|
|
923
|
-
internalFilterOptions: MRT_InternalFilterOption[];
|
|
924
|
-
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
925
|
-
table: MRT_TableInstance<TData>;
|
|
926
|
-
}) => ReactNode[];
|
|
927
|
-
renderDetailPanel?: (props: {
|
|
928
|
-
row: MRT_Row<TData>;
|
|
929
|
-
table: MRT_TableInstance<TData>;
|
|
930
|
-
}) => ReactNode;
|
|
931
|
-
renderGlobalFilterModeMenuItems?: (props: {
|
|
932
|
-
internalFilterOptions: MRT_InternalFilterOption[];
|
|
933
|
-
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
934
|
-
table: MRT_TableInstance<TData>;
|
|
935
|
-
}) => ReactNode[];
|
|
936
|
-
renderEmptyRowsFallback?: (props: {
|
|
937
|
-
table: MRT_TableInstance<TData>;
|
|
938
|
-
}) => ReactNode;
|
|
939
|
-
renderRowActionMenuItems?: (props: {
|
|
940
|
-
closeMenu: () => void;
|
|
941
|
-
row: MRT_Row<TData>;
|
|
942
|
-
table: MRT_TableInstance<TData>;
|
|
943
|
-
}) => ReactNode[];
|
|
944
|
-
renderRowActions?: (props: {
|
|
945
|
-
cell: MRT_Cell<TData>;
|
|
946
|
-
row: MRT_Row<TData>;
|
|
947
|
-
table: MRT_TableInstance<TData>;
|
|
948
|
-
}) => ReactNode;
|
|
949
|
-
renderToolbarInternalActions?: (props: {
|
|
950
|
-
table: MRT_TableInstance<TData>;
|
|
951
|
-
}) => ReactNode;
|
|
952
|
-
renderTopToolbar?:
|
|
953
|
-
| ReactNode
|
|
954
|
-
| ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
|
|
955
|
-
renderTopToolbarCustomActions?: (props: {
|
|
956
|
-
table: MRT_TableInstance<TData>;
|
|
957
|
-
}) => ReactNode;
|
|
958
|
-
rowCount?: number;
|
|
959
|
-
rowNumberMode?: 'original' | 'static';
|
|
960
|
-
selectAllMode?: 'all' | 'page';
|
|
961
|
-
/**
|
|
962
|
-
* Manage state externally any way you want, then pass it back into MRT.
|
|
963
|
-
*/
|
|
964
|
-
state?: Partial<MRT_TableState<TData>>;
|
|
965
|
-
/**
|
|
966
|
-
* Sequence of features important any dependent feature must be defined first
|
|
967
|
-
*/
|
|
968
|
-
tableFeatures?: Array<MRT_CreateTableFeature<TData>>;
|
|
969
|
-
/**
|
|
970
|
-
* Get access to the table instance via a ref to read state or call built-in methods
|
|
971
|
-
*/
|
|
972
|
-
tableInstanceRef?: MutableRefObject<MRT_TableInstance<TData> | null>;
|
|
973
|
-
/**
|
|
974
|
-
* @deprecated Use `rowVirtualizerInstanceRef` instead
|
|
975
|
-
*/
|
|
976
|
-
virtualizerInstanceRef?: any;
|
|
977
|
-
/**
|
|
978
|
-
* @deprecated Use `rowVirtualizerProps` instead
|
|
979
|
-
*/
|
|
980
|
-
virtualizerProps?: any;
|
|
981
|
-
}
|
|
606
|
+
Omit<
|
|
607
|
+
Partial<TableOptions<TData>>,
|
|
608
|
+
| 'columns'
|
|
609
|
+
| 'data'
|
|
610
|
+
| 'defaultColumn'
|
|
611
|
+
| 'enableRowSelection'
|
|
612
|
+
| 'expandRowsFn'
|
|
613
|
+
| 'getRowId'
|
|
614
|
+
| 'globalFilterFn'
|
|
615
|
+
| 'initialState'
|
|
616
|
+
| 'onStateChange'
|
|
617
|
+
| 'state'
|
|
982
618
|
> & {
|
|
619
|
+
columnFilterModeOptions?: Array<
|
|
620
|
+
LiteralUnion<string & MRT_FilterOption>
|
|
621
|
+
> | null;
|
|
622
|
+
/**
|
|
623
|
+
* The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
|
|
624
|
+
*
|
|
625
|
+
* See more info on creating columns on the official docs site:
|
|
626
|
+
* @link https://www.material-react-table.com/docs/guides/data-columns
|
|
627
|
+
* @link https://www.material-react-table.com/docs/guides/display-columns
|
|
628
|
+
*
|
|
629
|
+
* See all Columns Options on the official docs site:
|
|
630
|
+
* @link https://www.material-react-table.com/docs/api/column-options
|
|
631
|
+
*/
|
|
632
|
+
columns: MRT_ColumnDef<TData>[];
|
|
633
|
+
/**
|
|
634
|
+
* Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
|
|
635
|
+
*
|
|
636
|
+
* See the usage guide for more info on creating columns and data:
|
|
637
|
+
* @link https://www.material-react-table.com/docs/getting-started/usage
|
|
638
|
+
*/
|
|
639
|
+
data: TData[];
|
|
640
|
+
/**
|
|
641
|
+
* Instead of specifying a bunch of the same options for each column, you can just change an option in the `defaultColumn` prop to change a default option for all columns.
|
|
642
|
+
*/
|
|
643
|
+
defaultColumn?: Partial<MRT_ColumnDef<TData>>;
|
|
644
|
+
/**
|
|
645
|
+
* Change the default options for display columns.
|
|
646
|
+
*/
|
|
647
|
+
defaultDisplayColumn?: Partial<MRT_ColumnDef<TData>>;
|
|
648
|
+
displayColumnDefOptions?: Partial<{
|
|
649
|
+
[key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef>;
|
|
650
|
+
}>;
|
|
651
|
+
editingMode?: 'table' | 'modal' | 'row' | 'cell';
|
|
652
|
+
enableBottomToolbar?: boolean;
|
|
653
|
+
enableClickToCopy?: boolean;
|
|
654
|
+
enableColumnActions?: boolean;
|
|
655
|
+
enableColumnDragging?: boolean;
|
|
656
|
+
enableColumnFilterModes?: boolean;
|
|
657
|
+
enableColumnOrdering?: boolean;
|
|
658
|
+
enableColumnVirtualization?: boolean;
|
|
659
|
+
enableDensityToggle?: boolean;
|
|
660
|
+
enableEditing?: boolean | ((row: MRT_Row<TData>) => boolean);
|
|
661
|
+
enableExpandAll?: boolean;
|
|
662
|
+
enableFacetedValues?: boolean;
|
|
663
|
+
enableFilterMatchHighlighting?: boolean;
|
|
664
|
+
enableFullScreenToggle?: boolean;
|
|
665
|
+
enableGlobalFilterModes?: boolean;
|
|
666
|
+
enableGlobalFilterRankedResults?: boolean;
|
|
667
|
+
enablePagination?: boolean;
|
|
668
|
+
enableRowActions?: boolean;
|
|
669
|
+
enableRowDragging?: boolean;
|
|
670
|
+
enableRowNumbers?: boolean;
|
|
671
|
+
enableRowOrdering?: boolean;
|
|
672
|
+
enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean);
|
|
673
|
+
enableRowVirtualization?: boolean;
|
|
674
|
+
enableSelectAll?: boolean;
|
|
675
|
+
enableStickyFooter?: boolean;
|
|
676
|
+
enableStickyHeader?: boolean;
|
|
677
|
+
enableTableFooter?: boolean;
|
|
678
|
+
enableTableHead?: boolean;
|
|
679
|
+
enableToolbarInternalActions?: boolean;
|
|
680
|
+
enableTopToolbar?: boolean;
|
|
681
|
+
expandRowsFn?: (dataRow: TData) => TData[];
|
|
682
|
+
getRowId?: (
|
|
683
|
+
originalRow: TData,
|
|
684
|
+
index: number,
|
|
685
|
+
parentRow: MRT_Row<TData>,
|
|
686
|
+
) => string;
|
|
687
|
+
globalFilterFn?: MRT_FilterOption;
|
|
688
|
+
globalFilterModeOptions?: MRT_FilterOption[] | null;
|
|
689
|
+
icons?: Partial<MRT_Icons>;
|
|
690
|
+
initialState?: Partial<MRT_TableState<TData>>;
|
|
691
|
+
/**
|
|
692
|
+
* Changes which kind of CSS layout is used to render the table. `semantic` uses default semantic HTML elements, while `grid` adds CSS grid and flexbox styles
|
|
693
|
+
*/
|
|
694
|
+
layoutMode?: 'semantic' | 'grid';
|
|
695
|
+
/**
|
|
696
|
+
* Pass in either a locale imported from `material-react-table/locales/*` or a custom locale object.
|
|
697
|
+
*
|
|
698
|
+
* See the localization (i18n) guide for more info:
|
|
699
|
+
* @link https://www.material-react-table.com/docs/guides/localization
|
|
700
|
+
*/
|
|
701
|
+
localization?: Partial<MRT_Localization>;
|
|
702
|
+
/**
|
|
703
|
+
* Memoize cells, rows, or the entire table body to potentially improve render performance.
|
|
704
|
+
*
|
|
705
|
+
* @warning This will break some dynamic rendering features. See the memoization guide for more info:
|
|
706
|
+
* @link https://www.material-react-table.com/docs/guides/memoize-components
|
|
707
|
+
*/
|
|
708
|
+
memoMode?: 'cells' | 'rows' | 'table-body';
|
|
709
|
+
muiBottomToolbarProps?:
|
|
710
|
+
| ToolbarProps
|
|
711
|
+
| ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
|
|
712
|
+
muiExpandAllButtonProps?:
|
|
713
|
+
| IconButtonProps
|
|
714
|
+
| ((props: { table: MRT_TableInstance<TData> }) => IconButtonProps);
|
|
715
|
+
muiExpandButtonProps?:
|
|
716
|
+
| IconButtonProps
|
|
717
|
+
| ((props: {
|
|
718
|
+
table: MRT_TableInstance<TData>;
|
|
719
|
+
row: MRT_Row<TData>;
|
|
720
|
+
}) => IconButtonProps);
|
|
721
|
+
muiLinearProgressProps?:
|
|
722
|
+
| LinearProgressProps
|
|
723
|
+
| ((props: {
|
|
724
|
+
isTopToolbar: boolean;
|
|
725
|
+
table: MRT_TableInstance<TData>;
|
|
726
|
+
}) => LinearProgressProps);
|
|
727
|
+
muiSearchTextFieldProps?:
|
|
728
|
+
| TextFieldProps
|
|
729
|
+
| ((props: { table: MRT_TableInstance<TData> }) => TextFieldProps);
|
|
730
|
+
muiSelectAllCheckboxProps?:
|
|
731
|
+
| CheckboxProps
|
|
732
|
+
| ((props: { table: MRT_TableInstance<TData> }) => CheckboxProps);
|
|
733
|
+
muiSelectCheckboxProps?:
|
|
734
|
+
| (CheckboxProps | RadioProps)
|
|
735
|
+
| ((props: {
|
|
736
|
+
table: MRT_TableInstance<TData>;
|
|
737
|
+
row: MRT_Row<TData>;
|
|
738
|
+
}) => CheckboxProps | RadioProps);
|
|
739
|
+
muiTableBodyCellCopyButtonProps?:
|
|
740
|
+
| ButtonProps
|
|
741
|
+
| ((props: {
|
|
742
|
+
cell: MRT_Cell<TData>;
|
|
743
|
+
column: MRT_Column<TData>;
|
|
744
|
+
row: MRT_Row<TData>;
|
|
745
|
+
table: MRT_TableInstance<TData>;
|
|
746
|
+
}) => ButtonProps);
|
|
747
|
+
muiTableBodyCellEditTextFieldProps?:
|
|
748
|
+
| TextFieldProps
|
|
749
|
+
| ((props: {
|
|
750
|
+
cell: MRT_Cell<TData>;
|
|
751
|
+
column: MRT_Column<TData>;
|
|
752
|
+
row: MRT_Row<TData>;
|
|
753
|
+
table: MRT_TableInstance<TData>;
|
|
754
|
+
}) => TextFieldProps);
|
|
755
|
+
muiTableBodyCellProps?:
|
|
756
|
+
| TableCellProps
|
|
757
|
+
| ((props: {
|
|
758
|
+
cell: MRT_Cell<TData>;
|
|
759
|
+
column: MRT_Column<TData>;
|
|
760
|
+
row: MRT_Row<TData>;
|
|
761
|
+
table: MRT_TableInstance<TData>;
|
|
762
|
+
}) => TableCellProps);
|
|
763
|
+
muiTableBodyCellSkeletonProps?:
|
|
764
|
+
| SkeletonProps
|
|
765
|
+
| ((props: {
|
|
766
|
+
cell: MRT_Cell<TData>;
|
|
767
|
+
column: MRT_Column<TData>;
|
|
768
|
+
row: MRT_Row<TData>;
|
|
769
|
+
table: MRT_TableInstance<TData>;
|
|
770
|
+
}) => SkeletonProps);
|
|
771
|
+
muiTableBodyProps?:
|
|
772
|
+
| TableBodyProps
|
|
773
|
+
| ((props: { table: MRT_TableInstance<TData> }) => TableBodyProps);
|
|
774
|
+
muiTableBodyRowDragHandleProps?:
|
|
775
|
+
| IconButtonProps
|
|
776
|
+
| ((props: {
|
|
777
|
+
table: MRT_TableInstance<TData>;
|
|
778
|
+
row: MRT_Row<TData>;
|
|
779
|
+
}) => IconButtonProps);
|
|
780
|
+
muiTableBodyRowProps?:
|
|
781
|
+
| TableRowProps
|
|
782
|
+
| ((props: {
|
|
783
|
+
isDetailPanel?: boolean;
|
|
784
|
+
row: MRT_Row<TData>;
|
|
785
|
+
staticRowIndex: number;
|
|
786
|
+
table: MRT_TableInstance<TData>;
|
|
787
|
+
}) => TableRowProps);
|
|
788
|
+
muiTableContainerProps?:
|
|
789
|
+
| TableContainerProps
|
|
790
|
+
| ((props: { table: MRT_TableInstance<TData> }) => TableContainerProps);
|
|
791
|
+
muiTableDetailPanelProps?:
|
|
792
|
+
| TableCellProps
|
|
793
|
+
| ((props: {
|
|
794
|
+
table: MRT_TableInstance<TData>;
|
|
795
|
+
row: MRT_Row<TData>;
|
|
796
|
+
}) => TableCellProps);
|
|
797
|
+
muiTableFooterCellProps?:
|
|
798
|
+
| TableCellProps
|
|
799
|
+
| ((props: {
|
|
800
|
+
table: MRT_TableInstance<TData>;
|
|
801
|
+
column: MRT_Column<TData>;
|
|
802
|
+
}) => TableCellProps);
|
|
803
|
+
muiTableFooterProps?:
|
|
804
|
+
| TableFooterProps
|
|
805
|
+
| ((props: { table: MRT_TableInstance<TData> }) => TableFooterProps);
|
|
806
|
+
muiTableFooterRowProps?:
|
|
807
|
+
| TableRowProps
|
|
808
|
+
| ((props: {
|
|
809
|
+
table: MRT_TableInstance<TData>;
|
|
810
|
+
footerGroup: MRT_HeaderGroup<TData>;
|
|
811
|
+
}) => TableRowProps);
|
|
812
|
+
muiTableHeadCellColumnActionsButtonProps?:
|
|
813
|
+
| IconButtonProps
|
|
814
|
+
| ((props: {
|
|
815
|
+
table: MRT_TableInstance<TData>;
|
|
816
|
+
column: MRT_Column<TData>;
|
|
817
|
+
}) => IconButtonProps);
|
|
818
|
+
muiTableHeadCellDragHandleProps?:
|
|
819
|
+
| IconButtonProps
|
|
820
|
+
| ((props: {
|
|
821
|
+
table: MRT_TableInstance<TData>;
|
|
822
|
+
column: MRT_Column<TData>;
|
|
823
|
+
}) => IconButtonProps);
|
|
824
|
+
muiTableHeadCellFilterCheckboxProps?:
|
|
825
|
+
| CheckboxProps
|
|
826
|
+
| ((props: {
|
|
827
|
+
column: MRT_Column<TData>;
|
|
828
|
+
table: MRT_TableInstance<TData>;
|
|
829
|
+
}) => CheckboxProps);
|
|
830
|
+
muiTableHeadCellFilterTextFieldProps?:
|
|
831
|
+
| TextFieldProps
|
|
832
|
+
| ((props: {
|
|
833
|
+
table: MRT_TableInstance<TData>;
|
|
834
|
+
column: MRT_Column<TData>;
|
|
835
|
+
rangeFilterIndex?: number;
|
|
836
|
+
}) => TextFieldProps);
|
|
837
|
+
muiTableHeadCellFilterSliderProps?:
|
|
838
|
+
| SliderProps
|
|
839
|
+
| ((props: {
|
|
840
|
+
table: MRT_TableInstance<TData>;
|
|
841
|
+
column: MRT_Column<TData>;
|
|
842
|
+
}) => TextFieldProps);
|
|
843
|
+
muiTableHeadCellProps?:
|
|
844
|
+
| TableCellProps
|
|
845
|
+
| ((props: {
|
|
846
|
+
table: MRT_TableInstance<TData>;
|
|
847
|
+
column: MRT_Column<TData>;
|
|
848
|
+
}) => TableCellProps);
|
|
849
|
+
muiTableHeadProps?:
|
|
850
|
+
| TableHeadProps
|
|
851
|
+
| ((props: { table: MRT_TableInstance<TData> }) => TableHeadProps);
|
|
852
|
+
muiTableHeadRowProps?:
|
|
853
|
+
| TableRowProps
|
|
854
|
+
| ((props: {
|
|
855
|
+
table: MRT_TableInstance<TData>;
|
|
856
|
+
headerGroup: MRT_HeaderGroup<TData>;
|
|
857
|
+
}) => TableRowProps);
|
|
858
|
+
muiTablePaginationProps?:
|
|
859
|
+
| Partial<Omit<TablePaginationProps, 'rowsPerPage'>>
|
|
860
|
+
| ((props: {
|
|
861
|
+
table: MRT_TableInstance<TData>;
|
|
862
|
+
}) => Partial<Omit<TablePaginationProps, 'rowsPerPage'>>);
|
|
863
|
+
muiTablePaperProps?:
|
|
864
|
+
| PaperProps
|
|
865
|
+
| ((props: { table: MRT_TableInstance<TData> }) => PaperProps);
|
|
866
|
+
muiTableProps?:
|
|
867
|
+
| TableProps
|
|
868
|
+
| ((props: { table: MRT_TableInstance<TData> }) => TableProps);
|
|
869
|
+
muiToolbarAlertBannerChipProps?:
|
|
870
|
+
| ChipProps
|
|
871
|
+
| ((props: { table: MRT_TableInstance<TData> }) => ChipProps);
|
|
872
|
+
muiToolbarAlertBannerProps?:
|
|
873
|
+
| AlertProps
|
|
874
|
+
| ((props: { table: MRT_TableInstance<TData> }) => AlertProps);
|
|
875
|
+
muiTopToolbarProps?:
|
|
876
|
+
| ToolbarProps
|
|
877
|
+
| ((props: { table: MRT_TableInstance<TData> }) => ToolbarProps);
|
|
878
|
+
onDensityChange?: OnChangeFn<MRT_DensityState>;
|
|
879
|
+
onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
|
|
880
|
+
onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
881
|
+
onEditingCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
|
|
882
|
+
onEditingRowCancel?: (props: {
|
|
883
|
+
row: MRT_Row<TData>;
|
|
884
|
+
table: MRT_TableInstance<TData>;
|
|
885
|
+
}) => void;
|
|
886
|
+
onEditingRowSave?: (props: {
|
|
887
|
+
exitEditingMode: () => void;
|
|
888
|
+
row: MRT_Row<TData>;
|
|
889
|
+
table: MRT_TableInstance<TData>;
|
|
890
|
+
values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
|
|
891
|
+
}) => Promise<void> | void;
|
|
892
|
+
onEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
893
|
+
onColumnFilterFnsChange?: OnChangeFn<{ [key: string]: MRT_FilterOption }>;
|
|
894
|
+
onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
|
|
895
|
+
onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
|
|
896
|
+
onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
|
897
|
+
onIsFullScreenChange?: OnChangeFn<boolean>;
|
|
898
|
+
onShowAlertBannerChange?: OnChangeFn<boolean>;
|
|
899
|
+
onShowColumnFiltersChange?: OnChangeFn<boolean>;
|
|
900
|
+
onShowGlobalFilterChange?: OnChangeFn<boolean>;
|
|
901
|
+
onShowToolbarDropZoneChange?: OnChangeFn<boolean>;
|
|
902
|
+
positionActionsColumn?: 'first' | 'last';
|
|
903
|
+
positionExpandColumn?: 'first' | 'last';
|
|
904
|
+
positionGlobalFilter?: 'left' | 'right' | 'none';
|
|
905
|
+
positionPagination?: 'bottom' | 'top' | 'both' | 'none';
|
|
906
|
+
positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
|
|
907
|
+
positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
|
|
908
|
+
renderBottomToolbar?:
|
|
909
|
+
| ReactNode
|
|
910
|
+
| ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
|
|
911
|
+
renderBottomToolbarCustomActions?: (props: {
|
|
912
|
+
table: MRT_TableInstance<TData>;
|
|
913
|
+
}) => ReactNode;
|
|
914
|
+
renderColumnActionsMenuItems?: (props: {
|
|
915
|
+
column: MRT_Column<TData>;
|
|
916
|
+
closeMenu: () => void;
|
|
917
|
+
internalColumnMenuItems: ReactNode[];
|
|
918
|
+
table: MRT_TableInstance<TData>;
|
|
919
|
+
}) => ReactNode[];
|
|
920
|
+
renderColumnFilterModeMenuItems?: (props: {
|
|
921
|
+
column: MRT_Column<TData>;
|
|
922
|
+
internalFilterOptions: MRT_InternalFilterOption[];
|
|
923
|
+
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
924
|
+
table: MRT_TableInstance<TData>;
|
|
925
|
+
}) => ReactNode[];
|
|
926
|
+
renderDetailPanel?: (props: {
|
|
927
|
+
row: MRT_Row<TData>;
|
|
928
|
+
table: MRT_TableInstance<TData>;
|
|
929
|
+
}) => ReactNode;
|
|
930
|
+
renderGlobalFilterModeMenuItems?: (props: {
|
|
931
|
+
internalFilterOptions: MRT_InternalFilterOption[];
|
|
932
|
+
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
933
|
+
table: MRT_TableInstance<TData>;
|
|
934
|
+
}) => ReactNode[];
|
|
935
|
+
renderEmptyRowsFallback?: (props: {
|
|
936
|
+
table: MRT_TableInstance<TData>;
|
|
937
|
+
}) => ReactNode;
|
|
938
|
+
renderRowActionMenuItems?: (props: {
|
|
939
|
+
closeMenu: () => void;
|
|
940
|
+
row: MRT_Row<TData>;
|
|
941
|
+
table: MRT_TableInstance<TData>;
|
|
942
|
+
}) => ReactNode[];
|
|
943
|
+
renderRowActions?: (props: {
|
|
944
|
+
cell: MRT_Cell<TData>;
|
|
945
|
+
row: MRT_Row<TData>;
|
|
946
|
+
table: MRT_TableInstance<TData>;
|
|
947
|
+
}) => ReactNode;
|
|
948
|
+
renderToolbarInternalActions?: (props: {
|
|
949
|
+
table: MRT_TableInstance<TData>;
|
|
950
|
+
}) => ReactNode;
|
|
951
|
+
renderTopToolbar?:
|
|
952
|
+
| ReactNode
|
|
953
|
+
| ((props: { table: MRT_TableInstance<TData> }) => ReactNode);
|
|
954
|
+
renderTopToolbarCustomActions?: (props: {
|
|
955
|
+
table: MRT_TableInstance<TData>;
|
|
956
|
+
}) => ReactNode;
|
|
957
|
+
rowCount?: number;
|
|
958
|
+
rowNumberMode?: 'original' | 'static';
|
|
959
|
+
selectAllMode?: 'all' | 'page';
|
|
960
|
+
/**
|
|
961
|
+
* Manage state externally any way you want, then pass it back into MRT.
|
|
962
|
+
*/
|
|
963
|
+
state?: Partial<MRT_TableState<TData>>;
|
|
964
|
+
/**
|
|
965
|
+
* Sequence of features important any dependent feature must be defined first
|
|
966
|
+
*/
|
|
967
|
+
tableFeatures?: Array<MRT_CreateTableFeature<TData>>;
|
|
968
|
+
/**
|
|
969
|
+
* Get access to the table instance via a ref to read state or call built-in methods
|
|
970
|
+
*/
|
|
971
|
+
tableInstanceRef?: MutableRefObject<MRT_TableInstance<TData> | null>;
|
|
972
|
+
/**
|
|
973
|
+
* @deprecated Use `rowVirtualizerInstanceRef` instead
|
|
974
|
+
*/
|
|
975
|
+
virtualizerInstanceRef?: any;
|
|
976
|
+
/**
|
|
977
|
+
* @deprecated Use `rowVirtualizerProps` instead
|
|
978
|
+
*/
|
|
979
|
+
virtualizerProps?: any;
|
|
980
|
+
} & {
|
|
983
981
|
columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<
|
|
984
982
|
HTMLDivElement,
|
|
985
983
|
HTMLTableCellElement
|