diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 2da9656f..88c73be4 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -835,15 +835,15 @@ export interface DataTableCell { ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :---------- | :--------------- | :------- | :-------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------- | -| columns | let | No | number | 5 | Specify the number of columns | -| rows | let | No | number | 5 | Specify the number of rows | -| size | let | No | "compact" | "short" | "tall" | -- | Set the size of the data table | -| zebra | let | No | boolean | false | Set to `true` to apply zebra styles to the datatable rows | -| showHeader | let | No | boolean | true | Set to `false` to hide the header | -| headers | let | No | string[] | [] | Set the column headers
If `headers` has one more items, `count` is ignored | -| showToolbar | let | No | boolean | true | Set to `false` to hide the toolbar | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :---------- | :--------------- | :------- | :------------------------------------------------------ | ------------------ | -------------------------------------------------------------------------------------------- | +| columns | let | No | number | 5 | Specify the number of columns
Superseded by `headers` if `headers` is a non-empty array | +| rows | let | No | number | 5 | Specify the number of rows | +| size | let | No | "compact" | "short" | "tall" | -- | Set the size of the data table | +| zebra | let | No | boolean | false | Set to `true` to apply zebra styles to the datatable rows | +| showHeader | let | No | boolean | true | Set to `false` to hide the header | +| headers | let | No | string[] | Partial[] | [] | Set the column headers
Supersedes `columns` if value is a non-empty array | +| showToolbar | let | No | boolean | true | Set to `false` to hide the toolbar | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 79579b29..46c52c63 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -3281,7 +3281,7 @@ { "name": "columns", "kind": "let", - "description": "Specify the number of columns", + "description": "Specify the number of columns\nSuperseded by `headers` if `headers` is a non-empty array", "type": "number", "value": "5", "isFunction": false, @@ -3330,8 +3330,8 @@ { "name": "headers", "kind": "let", - "description": "Set the column headers\nIf `headers` has one more items, `count` is ignored", - "type": "string[]", + "description": "Set the column headers\nSupersedes `columns` if value is a non-empty array", + "type": "string[] | Partial[]", "value": "[]", "isFunction": false, "constant": false, @@ -3356,7 +3356,11 @@ { "type": "forwarded", "name": "mouseleave", "element": "table" } ], "typedefs": [], - "rest_props": { "type": "Element", "name": "table" } + "rest_props": { "type": "Element", "name": "table" }, + "extends": { + "interface": "DataTableHeader", + "import": "\"../DataTable/DataTable\"" + } }, { "moduleName": "DatePicker", diff --git a/docs/src/pages/components/DataTable.svx b/docs/src/pages/components/DataTable.svx index 8998770a..d978c060 100644 --- a/docs/src/pages/components/DataTable.svx +++ b/docs/src/pages/components/DataTable.svx @@ -824,6 +824,12 @@ In the following example, each row in the sortable data table has an overflow me +### Skeleton with object headers + +`headers` can also be an array of objects. The type is the same as the `headers` prop type used in `DataTable`. + + + ### Skeleton without header, toolbar diff --git a/src/DataTableSkeleton/DataTableSkeleton.svelte b/src/DataTableSkeleton/DataTableSkeleton.svelte index 854714ce..2ee4ade3 100644 --- a/src/DataTableSkeleton/DataTableSkeleton.svelte +++ b/src/DataTableSkeleton/DataTableSkeleton.svelte @@ -1,5 +1,10 @@