From 5fee13b2eb8235eeb24375ca73a64fe312f781bc Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 5 Jul 2021 08:44:07 -0700 Subject: [PATCH] feat(data-table): make title, description slottable #720 (#722) Closes #720 --- COMPONENT_INDEX.md | 2 + docs/src/COMPONENT_API.json | 12 +++++ docs/src/pages/components/DataTable.svx | 62 +++++++++++++++++++++++++ src/DataTable/DataTable.svelte | 14 +++++- types/DataTable/DataTable.d.ts | 2 + 5 files changed, 91 insertions(+), 1 deletion(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 6c64109a..091a5b0c 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -963,7 +963,9 @@ export interface DataTableCell { | -- | Yes | -- | -- | | cell | No | { row: DataTableRow; cell: DataTableCell; } | {cell.display ? cell.display(cell.value) : cell.value} | | cell-header | No | { header: DataTableNonEmptyHeader; } | {header.value} | +| description | No | -- | {description} | | expanded-row | No | { row: DataTableRow; } | -- | +| title | No | -- | {title} | ### Events diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 925b35c2..294ce682 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -2091,10 +2091,22 @@ "fallback": "{header.value}", "slot_props": "{ header: DataTableNonEmptyHeader; }" }, + { + "name": "description", + "default": false, + "fallback": "{description}", + "slot_props": "{}" + }, { "name": "expanded-row", "default": false, "slot_props": "{ row: DataTableRow; }" + }, + { + "name": "title", + "default": false, + "fallback": "{title}", + "slot_props": "{}" } ], "events": [ diff --git a/docs/src/pages/components/DataTable.svx b/docs/src/pages/components/DataTable.svx index 9a5db7f3..41ecd931 100644 --- a/docs/src/pages/components/DataTable.svx +++ b/docs/src/pages/components/DataTable.svx @@ -194,6 +194,68 @@ The slot name for the table header cells is `"cell-header"`. ]}" /> +### Slottable title, description + +The `title` and `description` props are slottable. + + + Load balancers + + Your organization's active load balancers. + + + ### With toolbar - + +
+ {#if title || $$slots.title} +

+ {title} +

+ {/if} + {#if description || $$slots.description} +

+ {description} +

+ {/if} +
{}