import { Column, type ColumnDef, PaginationState, Row, RowSelectionState, type SortingState } from "@tanstack/react-table"; import React, { ReactNode } from "react"; import { DropdownMenu, DropdownMenuItemProps } from "../components"; declare module "@tanstack/react-table" { interface ColumnMeta { className?: string; tooltip?: string; sizeRatio?: number; } } interface TBaseData { onClick?: () => void; onDoubleClick?: () => void; dropdownMenuProps?: React.ComponentPropsWithoutRef; menuItems?: MenuItem[]; } interface ColumnBreakpoint { [columnId: string]: "xs" | "sm" | "md" | "lg" | "xl"; } interface DataTableProps { data: TData[]; totalRowCount?: number; rowCountIsCapped?: boolean; columns: ColumnDef[]; className?: string; widthClassName?: string; filter?: string; filterColumn?: string; pagination?: PaginationState; setPagination?: (pagination: PaginationState) => void; columnsBreakpoints?: ColumnBreakpoint; sorting?: SortingState; setSorting?: (sorting: SortingState) => void; isServerSideSorting?: boolean; disablePaginationNumbers?: boolean; getRowId?: (originalRow: TData, index: number, parent?: Row | undefined) => string; rowSelection?: RowSelectionState; setRowSelection?: (rowSelection: RowSelectionState) => void; enableRowSelection?: boolean | ((row: Row) => boolean); enableMultiRowSelection?: boolean; enableSortingRemoval?: boolean; } export declare function DataTable({ data, totalRowCount, rowCountIsCapped, columns, className, widthClassName, filter, filterColumn, columnsBreakpoints, pagination, setPagination, sorting, setSorting, isServerSideSorting, disablePaginationNumbers, rowSelection, setRowSelection, enableRowSelection, enableMultiRowSelection, getRowId, enableSortingRemoval }: DataTableProps): React.JSX.Element; export interface ScrollableDataTableProps extends DataTableProps { maxHeight?: string | boolean; onLoadMore?: () => void; isLoading?: boolean; containerRef?: React.Ref; } export declare function ScrollableDataTable({ data, totalRowCount, columns, className, widthClassName, columnsBreakpoints, maxHeight, onLoadMore, sorting, setSorting, isLoading, rowSelection, setRowSelection, enableRowSelection, enableMultiRowSelection, getRowId, containerRef }: ScrollableDataTableProps): React.JSX.Element; interface DataTableRootProps extends React.HTMLAttributes { children: ReactNode; containerClassName?: string; containerProps?: React.HTMLAttributes; } export declare namespace DataTable { var Root: ({ children, className, containerClassName, containerProps, ...props }: DataTableRootProps) => React.JSX.Element; } interface HeaderProps extends React.HTMLAttributes { children: ReactNode; } export declare namespace DataTable { var Header: ({ children, className, ...props }: HeaderProps) => React.JSX.Element; } interface HeadProps extends React.ThHTMLAttributes { children?: ReactNode; column: Column; } export declare namespace DataTable { var Head: ({ children, className, column, ...props }: HeadProps) => React.JSX.Element; } export declare namespace DataTable { var Body: ({ children, className, ...props }: React.HTMLAttributes) => React.JSX.Element; } interface RowProps extends React.HTMLAttributes { children: ReactNode; onClick?: () => void; onDoubleClick?: () => void; widthClassName: string; "data-selected"?: boolean; rowData?: TBaseData; } export declare namespace DataTable { var Row: ({ children, className, onClick, onDoubleClick, widthClassName, rowData, ...props }: RowProps) => React.JSX.Element; } interface BaseMenuItem { kind: "item" | "submenu"; label: string; disabled?: boolean; } interface RegularMenuItem extends BaseMenuItem, Omit { kind: "item"; } type SubmenuEntry = { id: string; name: string; }; interface SubmenuMenuItem extends BaseMenuItem { kind: "submenu"; items: SubmenuEntry[]; onSelect: (itemId: string) => void; } export type MenuItem = RegularMenuItem | SubmenuMenuItem; export interface DataTableMoreButtonProps { className?: string; menuItems?: MenuItem[]; dropdownMenuProps?: Omit, "modal">; disabled?: boolean; } export declare namespace DataTable { var MoreButton: ({ className, menuItems, dropdownMenuProps, disabled, }: DataTableMoreButtonProps) => React.JSX.Element | null; } interface CellProps extends React.HTMLAttributes { children: ReactNode; column: Column; } export declare namespace DataTable { var Cell: ({ children, className, column, ...props }: CellProps) => React.JSX.Element; } interface CellContentProps extends React.TdHTMLAttributes { avatarUrl?: string; avatarTooltipLabel?: string; icon?: React.ComponentType<{ className?: string; }>; iconClassName?: string; roundedAvatar?: boolean; children?: ReactNode; description?: string; grow?: boolean; disabled?: boolean; avatarStack?: { items: { name: string; visual?: string | React.ReactNode; }[]; nbVisibleItems?: number; }; } export declare namespace DataTable { var CellContent: ({ children, className, avatarUrl, avatarTooltipLabel, roundedAvatar, icon, iconClassName, description, grow, disabled, avatarStack, ...props }: CellContentProps) => React.JSX.Element; } interface BasicCellContentProps extends React.TdHTMLAttributes { label: string | number; tooltip?: string | number; textToCopy?: string | number; disabled?: boolean; } export declare namespace DataTable { var BasicCellContent: ({ label, tooltip, className, textToCopy, disabled, ...props }: BasicCellContentProps) => React.JSX.Element; } interface CellContentWithCopyProps { children: React.ReactNode; textToCopy?: string; className?: string; } export declare namespace DataTable { var CellContentWithCopy: ({ children, textToCopy, className, }: CellContentWithCopyProps) => React.JSX.Element; } export declare namespace DataTable { var Caption: ({ children, className, ...props }: React.HTMLAttributes) => React.JSX.Element; } export declare function createSelectionColumn(): ColumnDef; export declare function createRadioSelectionColumn(): ColumnDef; //# sourceMappingURL=DataTable.d.ts.map