Tree Row
Uma linha de árvore de arquivos com recuo, botão de expandir, seleção e ações.
Angular: disponível Vue: disponível React: disponível React Native: ainda não disponível
Uso
<sone-sidebar style="width: 18rem">
@for (line of visibleLines(); track line.id) {
<sone-tree-row
[label]="line.label"
[icon]="line.icon"
[depth]="line.depth"
[count]="line.count"
[expandable]="line.expandable"
[expanded]="expanded().has(line.id)"
[selected]="selectedId() === line.id"
(activate)="selectedId.set(line.id)"
(toggleExpand)="toggle(line.id)"
/>
}
</sone-sidebar>Importação
import {
SoneTreeRowComponent,
} from "@surface-one/angular/tree-row";Referência da API
SoneTreeRowComponentComponente
Nesting is DRAWN, not built: consumers stay FLAT (one `@for` over depth-tagged lines) rather than a recursive component pair, so there is no T2 cycle risk. Owns 100% of the row's visual box so a Meetings row and a Notes row never diverge; feature-specific content projects in as trailing `<ng-content>`. Inside a `[soneTree]` (`@surface-one/angular/tree`) the row becomes a `role="treeitem"` with `aria-level` / `aria-expanded` / `aria-selected` and the tree's roving tabindex; its own buttons leave the Tab order. Outside a tree it renders exactly as before.
| Nome | Tipo | Padrão |
|---|---|---|
labelobrigatório | string | — |
depth | number | 0 |
selected | boolean | false |
icon | TreeRowIcon | "folder" |
emoji | string | null | null |
count | number | null | null |
expandable | boolean | false |
expanded | boolean | false |
level`aria-level` inside a `[soneTree]` (default: `depth + 1`). | number | null | null |
hasChildrenWhether the row has children, for `aria-expanded` (default: `expandable`). | boolean | null | null |
| Nome | Tipo |
|---|---|
activate | void |
toggleExpand | void |