Tree

Obsługa klawiatury dla drzewa wierszy — strzałki, rozwijanie i zwijanie, wyszukiwanie po pierwszych literach i jeden przystanek Tab, zgodnie ze wzorcem WAI-ARIA tree.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: jeszcze niedostępny

Użycie

Opened: roadmap

Import

ts
import {
  SoneTreeDirective,
  SoneTreeItemDirective,
} from "@surface-one/angular/tree";

Dokumentacja API

SoneTreeDirectiveDyrektywa

`[soneTree]` — the WAI-ARIA tree pattern over FLAT rows (`sone-tree-row`, or any element with `[soneTreeItem]`): `role="tree"`, one Tab stop (roving tabindex), ↑ / ↓ move, → expands or enters the first child, ← collapses or goes to the parent, Home / End, typeahead, Enter / Space activate and `*` expands every sibling. Rows keep rendering only what is expanded; the tree reads their order from the DOM and their level from `aria-level`. Expand / collapse only change state; the rows they add or remove appear on the next render. A navigation key that lands before it (key repeat, a fast typist) would walk the stale rows, so it is held and replayed on the row once that render is done.

Selektor
[soneTree]
Eksport jako
soneTree

SoneTreeItemDirectiveDyrektywa

`[soneTreeItem]` — makes any element a row of the enclosing `[soneTree]` (for rows that are not `sone-tree-row`, such as a "View all" link): `role="treeitem"`, `aria-level`, `aria-expanded`, `aria-selected` and the roving tabindex. Enter / Space click it; →/← emit `expandedChange`.

Selektor
[soneTreeItem]
Wejścia
NazwaTyp Domyślnie
level

1-based nesting level.

number1
hasChildrenbooleanfalse
expandeddwukierunkowebooleanfalse
selectedbooleanfalse