UNPKG

material-react-table

Version:

A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.

257 lines (256 loc) 15.7 kB
import React from 'react'; import type { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_FilterOption, MRT_Row, MRT_TableInstance, MRT_TableState, MaterialReactTableProps, MRT_Localization } from '..'; export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/table-core").TableOptions<TData>>, "state" | "data" | "onStateChange" | "initialState" | "columns" | "defaultColumn" | "globalFilterFn" | "enableRowSelection" | "expandRowsFn"> & { columnFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined; columns: MRT_ColumnDef<TData>[]; data: TData[]; defaultColumn?: Partial<MRT_ColumnDef<TData>> | undefined; defaultDisplayColumn?: Partial<MRT_ColumnDef<TData>> | undefined; displayColumnDefOptions?: Partial<{ "mrt-row-drag": Partial<MRT_ColumnDef<{}>>; "mrt-row-actions": Partial<MRT_ColumnDef<{}>>; "mrt-row-expand": Partial<MRT_ColumnDef<{}>>; "mrt-row-select": Partial<MRT_ColumnDef<{}>>; "mrt-row-numbers": Partial<MRT_ColumnDef<{}>>; }> | undefined; editingMode?: "cell" | "row" | "table" | "modal" | undefined; enableBottomToolbar?: boolean | undefined; enableClickToCopy?: boolean | undefined; enableColumnActions?: boolean | undefined; enableColumnDragging?: boolean | undefined; enableColumnFilterModes?: boolean | undefined; enableColumnOrdering?: boolean | undefined; enableDensityToggle?: boolean | undefined; enableEditing?: boolean | undefined; enableExpandAll?: boolean | undefined; enableFullScreenToggle?: boolean | undefined; enableGlobalFilterModes?: boolean | undefined; enableGlobalFilterRankedResults?: boolean | undefined; enablePagination?: boolean | undefined; enableRowActions?: boolean | undefined; enableRowDragging?: boolean | undefined; enableRowNumbers?: boolean | undefined; enableRowOrdering?: boolean | undefined; enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean) | undefined; enableRowVirtualization?: boolean | undefined; enableSelectAll?: boolean | undefined; enableStickyFooter?: boolean | undefined; enableStickyHeader?: boolean | undefined; enableTableFooter?: boolean | undefined; enableTableHead?: boolean | undefined; enableToolbarInternalActions?: boolean | undefined; enableTopToolbar?: boolean | undefined; expandRowsFn?: ((dataRow: TData) => TData[]) | undefined; globalFilterFn?: MRT_FilterOption | undefined; globalFilterModeOptions?: MRT_FilterOption[] | null | undefined; icons?: Partial<import("..").MRT_Icons> | undefined; initialState?: Partial<MRT_TableState<TData>> | undefined; localization?: Partial<MRT_Localization> | undefined; memoMode?: "rows" | "cells" | "table-body" | undefined; muiBottomToolbarProps?: import("@mui/material").ToolbarProps<"div", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").ToolbarProps<"div", {}>) | undefined; muiExpandAllButtonProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").IconButtonProps<"button", {}>) | undefined; muiExpandButtonProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ row, table, }: { table: MRT_TableInstance<TData>; row: MRT_Row<TData>; }) => import("@mui/material").IconButtonProps<"button", {}>) | undefined; muiLinearProgressProps?: import("@mui/material").LinearProgressProps | (({ isTopToolbar, table, }: { isTopToolbar: boolean; table: MRT_TableInstance<TData>; }) => import("@mui/material").LinearProgressProps) | undefined; muiSearchTextFieldProps?: import("@mui/material").TextFieldProps | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").TextFieldProps) | undefined; muiSelectAllCheckboxProps?: import("@mui/material").CheckboxProps | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").CheckboxProps) | undefined; muiSelectCheckboxProps?: import("@mui/material").CheckboxProps | import("@mui/material").RadioProps | (({ table, row, }: { table: MRT_TableInstance<TData>; row: MRT_Row<TData>; }) => import("@mui/material").CheckboxProps | import("@mui/material").RadioProps) | undefined; muiTableBodyCellCopyButtonProps?: import("@mui/material").ButtonProps<"button", {}> | (({ cell, column, row, table, }: { cell: MRT_Cell<TData>; column: MRT_Column<TData>; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => import("@mui/material").ButtonProps<"button", {}>) | undefined; muiTableBodyCellEditTextFieldProps?: import("@mui/material").TextFieldProps | (({ cell, column, row, table, }: { cell: MRT_Cell<TData>; column: MRT_Column<TData>; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => import("@mui/material").TextFieldProps) | undefined; muiTableBodyCellProps?: import("@mui/material").TableCellProps | (({ cell, column, row, table, }: { cell: MRT_Cell<TData>; column: MRT_Column<TData>; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => import("@mui/material").TableCellProps) | undefined; muiTableBodyCellSkeletonProps?: import("@mui/material").SkeletonProps<"span", {}> | (({ cell, column, row, table, }: { cell: MRT_Cell<TData>; column: MRT_Column<TData>; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => import("@mui/material").SkeletonProps<"span", {}>) | undefined; muiTableBodyProps?: import("@mui/material").TableBodyProps<"tbody", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").TableBodyProps<"tbody", {}>) | undefined; muiTableBodyRowDragHandleProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table, row, }: { table: MRT_TableInstance<TData>; row: MRT_Row<TData>; }) => import("@mui/material").IconButtonProps<"button", {}>) | undefined; muiTableBodyRowProps?: import("@mui/material").TableRowProps<"tr", {}> | (({ table, row, }: { table: MRT_TableInstance<TData>; row: MRT_Row<TData>; }) => import("@mui/material").TableRowProps<"tr", {}>) | undefined; muiTableContainerProps?: import("@mui/material").TableContainerProps<"div", {}> | (({ table, }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").TableContainerProps<"div", {}>) | undefined; muiTableDetailPanelProps?: import("@mui/material").TableCellProps | (({ table, row, }: { table: MRT_TableInstance<TData>; row: MRT_Row<TData>; }) => import("@mui/material").TableCellProps) | undefined; muiTableFooterCellProps?: import("@mui/material").TableCellProps | (({ table, column, }: { table: MRT_TableInstance<TData>; column: MRT_Column<TData>; }) => import("@mui/material").TableCellProps) | undefined; muiTableFooterProps?: import("@mui/material").TableFooterProps<"tfoot", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").TableFooterProps<"tfoot", {}>) | undefined; muiTableFooterRowProps?: import("@mui/material").TableRowProps<"tr", {}> | (({ table, footerGroup, }: { table: MRT_TableInstance<TData>; footerGroup: import("..").MRT_HeaderGroup<TData>; }) => import("@mui/material").TableRowProps<"tr", {}>) | undefined; muiTableHeadCellColumnActionsButtonProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table, column, }: { table: MRT_TableInstance<TData>; column: MRT_Column<TData>; }) => import("@mui/material").IconButtonProps<"button", {}>) | undefined; muiTableHeadCellDragHandleProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table, column, }: { table: MRT_TableInstance<TData>; column: MRT_Column<TData>; }) => import("@mui/material").IconButtonProps<"button", {}>) | undefined; muiTableHeadCellFilterCheckboxProps?: import("@mui/material").CheckboxProps | (({ column, table, }: { column: MRT_Column<TData>; table: MRT_TableInstance<TData>; }) => import("@mui/material").CheckboxProps) | undefined; muiTableHeadCellFilterTextFieldProps?: import("@mui/material").TextFieldProps | (({ table, column, rangeFilterIndex, }: { table: MRT_TableInstance<TData>; column: MRT_Column<TData>; rangeFilterIndex?: number | undefined; }) => import("@mui/material").TextFieldProps) | undefined; muiTableHeadCellProps?: import("@mui/material").TableCellProps | (({ table, column, }: { table: MRT_TableInstance<TData>; column: MRT_Column<TData>; }) => import("@mui/material").TableCellProps) | undefined; muiTableHeadProps?: import("@mui/material").TableHeadProps<"thead", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").TableHeadProps<"thead", {}>) | undefined; muiTableHeadRowProps?: import("@mui/material").TableRowProps<"tr", {}> | (({ table, headerGroup, }: { table: MRT_TableInstance<TData>; headerGroup: import("..").MRT_HeaderGroup<TData>; }) => import("@mui/material").TableRowProps<"tr", {}>) | undefined; muiTablePaginationProps?: Partial<import("@mui/material").TablePaginationProps<React.JSXElementConstructor<import("@mui/material").TablePaginationBaseProps>, {}>> | (({ table, }: { table: MRT_TableInstance<TData>; }) => Partial<import("@mui/material").TablePaginationProps<React.JSXElementConstructor<import("@mui/material").TablePaginationBaseProps>, {}>>) | undefined; muiTablePaperProps?: import("@mui/material").PaperProps<"div", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").PaperProps<"div", {}>) | undefined; muiTableProps?: import("@mui/material").TableProps<"table", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").TableProps<"table", {}>) | undefined; muiToolbarAlertBannerChipProps?: import("@mui/material").ChipProps<"div", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").ChipProps<"div", {}>) | undefined; muiToolbarAlertBannerProps?: import("@mui/material").AlertProps | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").AlertProps) | undefined; muiTopToolbarProps?: import("@mui/material").ToolbarProps<"div", {}> | (({ table }: { table: MRT_TableInstance<TData>; }) => import("@mui/material").ToolbarProps<"div", {}>) | undefined; onDensityChange?: import("@tanstack/table-core").OnChangeFn<import("..").DensityState> | undefined; onDraggingColumnChange?: import("@tanstack/table-core").OnChangeFn<MRT_Column<TData> | null> | undefined; onDraggingRowChange?: import("@tanstack/table-core").OnChangeFn<MRT_Row<TData> | null> | undefined; onEditingCellChange?: import("@tanstack/table-core").OnChangeFn<MRT_Cell<TData> | null> | undefined; onEditingRowSave?: (({ exitEditingMode, row, table, values, }: { exitEditingMode: () => void; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; values: Record<(string & Record<never, never>) | (string & import("@tanstack/table-core").DeepKeys<TData>), any>; }) => void | Promise<void>) | undefined; onEditingRowChange?: import("@tanstack/table-core").OnChangeFn<MRT_Row<TData> | null> | undefined; onFilterFnsChange?: import("@tanstack/table-core").OnChangeFn<{ [key: string]: MRT_FilterOption; }> | undefined; onGlobalFilterFnChange?: import("@tanstack/table-core").OnChangeFn<MRT_FilterOption> | undefined; onHoveredColumnChange?: import("@tanstack/table-core").OnChangeFn<MRT_Column<TData> | null> | undefined; onHoveredRowChange?: import("@tanstack/table-core").OnChangeFn<MRT_Row<TData> | null> | undefined; onIsFullScreenChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined; onShowAlertBannerChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined; onShowFiltersChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined; onShowGlobalFilterChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined; positionActionsColumn?: "first" | "last" | undefined; positionExpandColumn?: "first" | "last" | undefined; positionGlobalFilter?: "left" | "right" | undefined; positionPagination?: "bottom" | "top" | "both" | undefined; positionToolbarAlertBanner?: "bottom" | "top" | "none" | undefined; positionToolbarDropZone?: "bottom" | "top" | "none" | "both" | undefined; renderBottomToolbar?: React.ReactNode | (({ table }: { table: MRT_TableInstance<TData>; }) => React.ReactNode); renderBottomToolbarCustomActions?: (({ table, }: { table: MRT_TableInstance<TData>; }) => React.ReactNode) | undefined; renderColumnActionsMenuItems?: (({ column, closeMenu, table, }: { column: MRT_Column<TData>; closeMenu: () => void; table: MRT_TableInstance<TData>; }) => React.ReactNode[]) | undefined; renderColumnFilterModeMenuItems?: (({ column, internalFilterOptions, onSelectFilterMode, table, }: { column: MRT_Column<TData>; internalFilterOptions: import("..").MRT_InternalFilterOption[]; onSelectFilterMode: (filterMode: MRT_FilterOption) => void; table: MRT_TableInstance<TData>; }) => React.ReactNode[]) | undefined; renderDetailPanel?: (({ row, table, }: { row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => React.ReactNode) | undefined; renderGlobalFilterModeMenuItems?: (({ internalFilterOptions, onSelectFilterMode, table, }: { internalFilterOptions: import("..").MRT_InternalFilterOption[]; onSelectFilterMode: (filterMode: MRT_FilterOption) => void; table: MRT_TableInstance<TData>; }) => React.ReactNode[]) | undefined; renderRowActionMenuItems?: (({ closeMenu, row, table, }: { closeMenu: () => void; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => React.ReactNode[]) | undefined; renderRowActions?: (({ cell, row, table, }: { cell: MRT_Cell<TData>; row: MRT_Row<TData>; table: MRT_TableInstance<TData>; }) => React.ReactNode) | undefined; renderToolbarInternalActions?: (({ table, }: { table: MRT_TableInstance<TData>; }) => React.ReactNode) | undefined; renderTopToolbar?: React.ReactNode | (({ table }: { table: MRT_TableInstance<TData>; }) => React.ReactNode); renderTopToolbarCustomActions?: (({ table, }: { table: MRT_TableInstance<TData>; }) => React.ReactNode) | undefined; rowCount?: number | undefined; rowNumberMode?: "original" | "static" | undefined; selectAllMode?: "all" | "page" | undefined; state?: Partial<MRT_TableState<TData>> | undefined; tableInstanceRef?: React.MutableRefObject<MRT_TableInstance<TData> | null> | undefined; virtualizerProps?: Partial<import("react-virtual").Options<HTMLDivElement>> | (({ table, }: { table: MRT_TableInstance<TData>; }) => Partial<import("react-virtual").Options<HTMLDivElement>>) | undefined; virtualizerInstanceRef?: React.MutableRefObject<import("..").Virtualizer | null> | undefined; } & { localization: MRT_Localization; }) => JSX.Element;