mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
feat: add toHierarchy
utility for TreeView
, RecursiveList
(#2072)
Co-authored-by: Bram <bramhavers@gmail.com>
This commit is contained in:
parent
f1a27ec855
commit
48afd18e5e
19 changed files with 413 additions and 23 deletions
|
@ -37,4 +37,11 @@ Set `type` to `"ordered"` to use the ordered list variant.
|
|||
|
||||
Set `type` to `"ordered-native"` to use the native styles for an ordered list.
|
||||
|
||||
<FileSource src="/framed/RecursiveList/RecursiveListOrderedNative" />
|
||||
<FileSource src="/framed/RecursiveList/RecursiveListOrderedNative" />
|
||||
|
||||
## Flat data structure
|
||||
|
||||
If working with a flat data structure, use the `toHierarchy` utility
|
||||
to convert a flat data structure into a hierarchical array accepted by the `nodes` prop.
|
||||
|
||||
<FileSource src="/framed/RecursiveList/RecursiveListFlatArray" />
|
||||
|
|
|
@ -107,3 +107,10 @@ Use the `TreeView.showNode` method to show a specific node.
|
|||
If a matching node is found, it will be expanded, selected, and focused.
|
||||
|
||||
<FileSource src="/framed/TreeView/TreeViewShowNode" />
|
||||
|
||||
## Flat data structure
|
||||
|
||||
If working with a flat data structure, use the `toHierarchy` utility
|
||||
to convert a flat data structure into a hierarchical array accepted by the `nodes` prop.
|
||||
|
||||
<FileSource src="/framed/TreeView/TreeViewFlatArray" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue