diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index ded55101..66cded58 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4658,6 +4658,7 @@ export interface TreeNode { icon?: typeof import("svelte").SvelteComponent; disabled?: boolean; expanded?: boolean; + children?: TreeNode[]; } ``` @@ -4668,7 +4669,7 @@ export interface TreeNode { | expandedIds | No | let | Yes | ReadonlyArray | [] | Set the node ids to be expanded | | selectedIds | No | let | Yes | ReadonlyArray | [] | Set the node ids to be selected | | activeId | No | let | Yes | TreeNodeId | "" | Set the current active node id
Only one node can be active | -| children | No | let | No | Array | [] | Provide an array of children nodes to render | +| children | No | let | No | Array | [] | Provide an array of children nodes to render | | size | No | let | No | "default" | "compact" | "default" | Specify the TreeView size | | labelText | No | let | No | string | "" | Specify the label text | | hideLabel | No | let | No | boolean | false | Set to `true` to visually hide the label text | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index afda19f9..2ff90210 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -14320,7 +14320,7 @@ "name": "children", "kind": "let", "description": "Provide an array of children nodes to render", - "type": "Array", + "type": "Array", "value": "[]", "isFunction": false, "isFunctionDeclaration": false, @@ -14483,9 +14483,9 @@ "ts": "type TreeNodeId = string | number" }, { - "type": "{ id: TreeNodeId; text: string; icon?: typeof import(\"svelte\").SvelteComponent; disabled?: boolean; expanded?: boolean; }", + "type": "{ id: TreeNodeId; text: string; icon?: typeof import(\"svelte\").SvelteComponent; disabled?: boolean; expanded?: boolean; children?: TreeNode[]; }", "name": "TreeNode", - "ts": "interface TreeNode { id: TreeNodeId; text: string; icon?: typeof import(\"svelte\").SvelteComponent; disabled?: boolean; expanded?: boolean; }" + "ts": "interface TreeNode { id: TreeNodeId; text: string; icon?: typeof import(\"svelte\").SvelteComponent; disabled?: boolean; expanded?: boolean; children?: TreeNode[]; }" } ], "rest_props": { "type": "Element", "name": "ul" } diff --git a/src/TreeView/TreeView.svelte b/src/TreeView/TreeView.svelte index d9c1e668..264e7135 100644 --- a/src/TreeView/TreeView.svelte +++ b/src/TreeView/TreeView.svelte @@ -1,7 +1,7 @@