@styloviz/tree-view 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/fesm2022/styloviz-tree-view.mjs +525 -27
- package/fesm2022/styloviz-tree-view.mjs.map +1 -1
- package/package.json +122 -5
- package/schematics/migration.json +3 -0
- package/schematics/package.json +4 -0
- package/types/styloviz-tree-view.d.ts +218 -5
- package/types/styloviz-tree-view.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @styloviz/tree-view
|
|
2
2
|
|
|
3
|
-
> 8
|
|
3
|
+
> 8 variants: collapsible tree, file explorer, tri-state checkboxes, org chart, tree table, searchable, drag & drop reordering and lazy load. Lazy loading, the tree-table columns and drag & drop reordering are Pro (`sv-tree-view-pro`); the free component renders the nodes you give it. Both draw as an indented list or, with `layout="org"`, as a top-down org chart of boxes joined by connector lines.
|
|
4
4
|
|
|
5
|
-
Part of the **Styloviz UI Kit** —
|
|
5
|
+
Part of the **Styloviz UI Kit** — an Angular 21 & 22 + Tailwind CSS 4 dashboard component library. Standalone, `OnPush`, strongly typed, dark-mode ready.
|
|
6
|
+
|
|
7
|
+
> **Free tier — MIT licensed.** Use it in personal and commercial projects at no cost, with no account or key. Styloviz Pro (`@styloviz-pro/*`) is a separate tier under a commercial license, installed from its own registry; nothing in this package requires it. Licensing: https://styloviz.dev/license · Pro: https://styloviz.dev/pricing
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
8
10
|
|
|
@@ -59,10 +61,12 @@ export class DemoComponent {}
|
|
|
59
61
|
| --- | --- | --- | --- |
|
|
60
62
|
| `nodes` | `TreeNode[]` | `[]` | Tree node data (nested children, optional icons). |
|
|
61
63
|
| `selectable` | `boolean` | `true` | Enable single-row selection highlight. |
|
|
62
|
-
| `showLines` | `boolean` | `true` | Show vertical connector guide lines. |
|
|
64
|
+
| `showLines` | `boolean` | `true` | Show vertical connector guide lines in the `list` layout. The `org` layout always draws its connectors — they are what make it a chart. |
|
|
65
|
+
| `layout` | `TreeViewLayout` | `'list'` | How the tree is drawn: `list` (indented rows) or `org` (top-down boxes joined by connector lines, each parent centred over its children). Same tree, same keyboard model, same outputs — only the picture changes. `org` shows each node's `role` and `department` and scrolls sideways inside a labelled region when it is wider than its container. |
|
|
63
66
|
| `ariaLabel` | `string` | `''` | What this tree is, e.g. `'Project files'` — names the `role="tree"` region. Two trees side by side both announce as an unnamed "tree" without this. Left unset, no name is invented: an `aria-label` of "Tree" only repeats the role. Matches `sv-tree-view-pro`'s input of the same name. |
|
|
64
67
|
| `loading` | `boolean` | `false` | True while the tree is being fetched. Replaces it with a placeholder. |
|
|
65
68
|
| `error` | `SvDataError \| string \| null` | `null` | Load failure. Use `toSvDataError()` from `@styloviz/core` to normalize an `HttpErrorResponse`. |
|
|
69
|
+
| `iconTemplate` | `TemplateRef<TreeIconContext> \| null` | `null` | A template for the glyph before each label in the `list` layout, drawn in place of the text `icon`. Stamped with TreeIconContext — the node as `$implicit`, plus `expanded` and `depth` — so a host can draw an icon-library glyph per node (`sv-file-tree` draws a file-type glyph this way). Decorative: the row's name is its label. The `org` layout keeps its initials avatar. Same input on `sv-tree-view-pro`. |
|
|
66
70
|
| `emptyText` | `string` | `'No items to display'` | Copy for the empty state. |
|
|
67
71
|
| `expandedIds` | `Set<string> (two-way)` | `new Set()` | Expanded node ids. Two-way bindable, so an expansion state loaded from the server — or restored from a URL — survives a reload. |
|
|
68
72
|
| `selectedId` | `string \| null (two-way)` | `null` | The selected node id. Two-way bindable. |
|
|
@@ -85,4 +89,4 @@ Full API reference and live demos: https://styloviz.dev/docs/tree-view
|
|
|
85
89
|
|
|
86
90
|
## License
|
|
87
91
|
|
|
88
|
-
MIT
|
|
92
|
+
MIT — see https://styloviz.dev/license. Styloviz Pro (`@styloviz-pro/*`) is licensed separately.
|