feat(datatable-skeleton): change to size prop

This commit is contained in:
albert 2020-09-24 10:35:13 +02:00
commit 8d571d2a29
2 changed files with 8 additions and 7 deletions

View file

@ -12,10 +12,10 @@
export let rows = 5;
/**
* Set to `true` to use the compact variant
* @type {boolean} [compact=false]
* Set the size of the data table
* @type {"compact" | "short" | "tall"} [size]
*/
export let compact = false;
export let size = undefined;
/**
* Set to `true` to apply zebra styles to the datatable rows
@ -68,8 +68,10 @@
<table
class:bx--skeleton="{true}"
class:bx--data-table="{true}"
class:bx--data-table--compact="{size === 'compact'}"
class:bx--data-table--short="{size === 'short'}"
class:bx--data-table--tall="{size === 'tall'}"
class:bx--data-table--zebra="{zebra}"
class:bx--data-table--compact="{compact}"
{...$$restProps}
on:click
on:mouseover

5
types/index.d.ts vendored
View file

@ -789,10 +789,9 @@ export class DataTableSkeleton extends CarbonSvelteComponent {
rows?: number;
/**
* Set to `true` to use the compact variant
* @default false
* Set the size of the data table
*/
compact?: boolean;
size?: "compact" | "short" | "tall";
/**
* Set to `true` to apply zebra styles to the datatable rows