mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
52 lines
1,022 B
TypeScript
52 lines
1,022 B
TypeScript
import type { SvelteComponentTyped } from "svelte";
|
|
import type { SvelteHTMLElements } from "svelte/elements";
|
|
|
|
type $RestProps = SvelteHTMLElements["section"];
|
|
|
|
type $Props = {
|
|
/**
|
|
* Set the size of the table
|
|
* @default undefined
|
|
*/
|
|
size?: "compact" | "short" | "medium" | "tall";
|
|
|
|
/**
|
|
* Set to `true` to use zebra styles
|
|
* @default false
|
|
*/
|
|
zebra?: boolean;
|
|
|
|
/**
|
|
* Set to `true` to use static width
|
|
* @default false
|
|
*/
|
|
useStaticWidth?: boolean;
|
|
|
|
/**
|
|
* Set to `true` for the sortable variant
|
|
* @default false
|
|
*/
|
|
sortable?: boolean;
|
|
|
|
/**
|
|
* Set to `true` to enable a sticky header
|
|
* @default false
|
|
*/
|
|
stickyHeader?: boolean;
|
|
|
|
/**
|
|
* Set the style attribute on the `table` element
|
|
* @default undefined
|
|
*/
|
|
tableStyle?: string;
|
|
|
|
[key: `data-${string}`]: any;
|
|
};
|
|
|
|
export type TableProps = Omit<$RestProps, keyof $Props> & $Props;
|
|
|
|
export default class Table extends SvelteComponentTyped<
|
|
TableProps,
|
|
Record<string, any>,
|
|
{ default: {} }
|
|
> {}
|