Fix that toHierarchy couldn't be found. Updated docs and test.

This commit is contained in:
Bram 2024-12-02 17:44:38 +01:00 committed by Eric Liu
commit 21d599c8b6
11 changed files with 70 additions and 47 deletions

View file

@ -20,12 +20,6 @@ type $Props = {
*/
nodes?: Array<TreeNode>;
/**
* Provide a flat array of nodes to render
* @default []
*/
nodesFlat?: Array<TreeNode & { pid?: any }>;
/**
* Set the current active node id
* Only one node can be active
@ -100,6 +94,11 @@ export default class TreeView extends SvelteComponentTyped<
*/
collapseAll: () => void;
/**
* Create a nested array from a flat array
*/
toHierarchy: (flatArray: TreeNode[] & { pid?: any }[]) => TreeNode[];
/**
* Programmatically expand a subset of nodes.
* Expands all nodes if no argument is provided