import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type TableHeaderTranslationId = "columnSortAscending" | "columnSortDescending"; type $RestProps = SvelteHTMLElements["th"]; type $Props = { /** * Set to `true` for the sortable variant * @default false */ sortable?: boolean; /** * Specify the sort direction. * @default "none" */ sortDirection?: "none" | "ascending" | "descending"; /** * Set to `true` if the column sorting * @default false */ active?: boolean; /** * Specify the `scope` attribute * @default "col" */ scope?: "col" | "row" | "colgroup" | "rowgroup"; /** * Override the default translation ids. * @default (id) => defaultTranslations[id] */ translateWithId?: (id: TableHeaderTranslationId) => string; /** * Set an id for the top-level element * @default uniqueId() */ id?: string; decorator?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type TableHeaderProps = Omit<$RestProps, keyof $Props> & $Props; export default class TableHeader extends SvelteComponentTyped< TableHeaderProps, { click: WindowEventMap["click"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: Record; decorator: Record; } > { /** * Default translation ids */ translationIds: { columnSortAscending: "columnSortAscending"; columnSortDescending: "columnSortDescending" }; }