Commit graph

3 commits

Author SHA1 Message Date
Eric Liu
5f1e8de1e1 Re-work toHierarchy utility
Refactor `toHiearchy` to be more generic, performant

- Use callback to "pick" generic parent ID property instead of requiring that `pid` be hardcoded`
- Account for edge cases of an invalid parent ID
- Use Map to store node children for lookups
- Use one pass instead of removing empty nodes at the very end
- DX: use generics to type `toHierarchy`
- Make `toHierarchy` even more generic (reusable with `RecursiveList`)

Co-Authored-By: Bram <bramhavers@gmail.com>
2024-12-09 12:20:20 -08:00
Eric Liu
f1a27ec855
test(tree-view): coverage for expandAll and expandNodes (#2063) 2024-12-08 11:09:23 -08:00
Eric Liu
8b477b12f9 test: scaffold component testing with Vitest 2024-11-23 13:36:31 -08:00