import React from "react"; import { type ResizeProps } from "./useTableColumnResize"; type SortDirection = "asc" | "desc" | "none"; interface DataTableThProps extends React.HTMLAttributes, ResizeProps { resizeHandler?: (event: React.MouseEvent | React.TouchEvent) => void; /** * Content alignment inside cell * @default "left" */ textAlign?: "left" | "center" | "right"; /** * Makes the column header sortable. The entire header cell content becomes * a clickable button when true. */ sortable?: boolean; /** * Current sort direction. Only relevant when `sortable` is true. * Uses values matching the `aria-sort` attribute directly. * @default "none" */ sortDirection?: SortDirection; /** * Called when the user clicks the sortable header. * The consumer is responsible for determining and setting the next sort state. */ onSortClick?: (event: React.MouseEvent) => void; render?: { filterMenu?: { title: string; content: React.ReactNode; }; }; /** * TODO: Shouldnt be needed to declare these here... But getting type-errors if not */ colSpan?: number; rowSpan?: number; /** * Temp hack to solve overflow and alignment */ UNSAFE_isSelection?: boolean; } /** * TODO: * - Plan for pinning: Move it into "settings" dialog like here: https://cloudscape.design/examples/react/table.html * - Keyboard-nav breaks in headers now because of the resize-handles. * Toggling `data-block-keyboard-nav` does not work since the created "grid" does not update when toggling this attribute. */ declare const DataTableTh: React.ForwardRefExoticComponent & React.RefAttributes>; export { DataTableTh }; export type { DataTableThProps };