carbon-components-svelte/types/DataTable/TableHeader.svelte.d.ts
metonym 72c24b83b2
feat(data-table): support programmatic sorting (#1337)
* refactor(data-table): pass down sortable props instead of using context

* feat(data-table): support programmatic sorting

* test(data-table): assert new props

* docs(data-table): add "Programmatic sorting" example

* refactor(data-table): remove unused tableSortable store

* refactor(data-table): remove unused indices
2022-06-05 13:37:50 -07:00

52 lines
1.1 KiB
TypeScript

/// <reference types="svelte" />
import type { SvelteComponentTyped } from "svelte";
export interface TableHeaderProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["th"]> {
/**
* 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?: string;
/**
* Override the default id translations
* @default () => ""
*/
translateWithId?: () => string;
/**
* Set an id for the top-level element
* @default "ccs-" + Math.random().toString(36)
*/
id?: string;
}
export default class TableHeader extends SvelteComponentTyped<
TableHeaderProps,
{
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
mouseleave: WindowEventMap["mouseleave"];
click: WindowEventMap["click"];
},
{ default: {} }
> {}