@styloviz/tree-view 0.4.0 → 1.0.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"styloviz-tree-view.mjs","sources":["../../../../projects/tree-view-free/src/lib/tree-view.component.ts","../../../../projects/tree-view-free/src/styloviz-tree-view.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { SvIconComponent } from '@styloviz/icons';\nimport {\n SvEmptyShellComponent,\n SvErrorShellComponent,\n SvSkeletonShellComponent,\n type SvDataError,\n} from '@styloviz/core';\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport interface TreeNode {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n children?: TreeNode[];\n readonly expanded?: boolean;\n readonly disabled?: boolean;\n readonly badge?: string;\n}\n\nexport interface FlatNode {\n readonly node: TreeNode;\n readonly depth: number;\n readonly isLast: boolean;\n readonly hasChildren: boolean;\n readonly isExpanded: boolean;\n}\n\nexport interface TreeNodeClickEvent {\n readonly node: TreeNode;\n readonly depth: number;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * SvTreeViewComponent (Free) — Collapsible single-select tree.\n *\n * For the full 8-variant suite (file explorer, checkbox tri-state,\n * org chart, tree table, searchable, draggable, lazy-load) upgrade to\n * `@styloviz-pro/tree-view`.\n *\n * @example\n * ```html\n * <sv-tree-view [nodes]=\"nodes\" (nodeClick)=\"onNodeClick($event)\" />\n * ```\n */\n@Component({\n imports: [SvIconComponent, SvSkeletonShellComponent, SvErrorShellComponent, SvEmptyShellComponent],\n selector: 'sv-tree-view',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (loading()) {\n <div class=\"p-2\" data-sv-state=\"loading\">\n <sv-skeleton-shell variant=\"list\" [rows]=\"5\" ariaLabel=\"Loading tree\" />\n </div>\n } @else if (error()) {\n <sv-error-shell\n [error]=\"error()\"\n title=\"Could not load this tree\"\n (retry)=\"retry.emit()\"\n data-sv-state=\"error\"\n />\n } @else {\n\n <div class=\"sv-tree-view select-none\" role=\"tree\">\n @for (fn of visibleNodes(); track fn.node.id) {\n <div class=\"group flex items-center gap-1 rounded-lg px-1 outline-none transition-colors duration-100 cursor-pointer focus-visible:ring-2 focus-visible:ring-indigo-400\"\n [class]=\"fn.node.disabled\n ? 'opacity-40 cursor-not-allowed py-1.5'\n : isSelected(fn.node.id)\n ? 'py-1.5 bg-indigo-50 dark:bg-indigo-900/25'\n : 'py-1.5 hover:bg-gray-100/70 dark:hover:bg-gray-800/50'\"\n (click)=\"select(fn.node, fn.depth); setActive(fn.node.id)\"\n (keydown)=\"onKeydown($event, fn, $index)\"\n role=\"treeitem\"\n [attr.data-tree-id]=\"fn.node.id\"\n [attr.tabindex]=\"treeTabIndex(fn.node.id)\"\n [attr.aria-level]=\"fn.depth + 1\"\n [attr.aria-expanded]=\"fn.hasChildren ? fn.isExpanded : null\"\n [attr.aria-selected]=\"isSelected(fn.node.id)\">\n\n <!--\n Depth spacers, one per level, carrying the optional connector guide.\n Indentation used to be a paddingLeft on the row, which left\n showLines - declared, documented, default true - with nothing to\n hang a line on, so it did nothing at all. The Pro twin has rendered\n these all along; this is the same 20px-per-level geometry.\n (No backticks in here: this template is an inline JS literal.)\n -->\n @for (d of depthArray(fn.depth); track d) {\n <span class=\"relative w-5 shrink-0 self-stretch\" aria-hidden=\"true\">\n @if (showLines()) {\n <span class=\"absolute inset-y-0 left-1/2 w-px -translate-x-1/2\n bg-gray-200 dark:bg-gray-700/70\"></span>\n }\n </span>\n }\n\n <!-- Chevron toggle -->\n <button type=\"button\"\n class=\"flex h-5 w-5 shrink-0 items-center justify-center rounded\n text-gray-400 transition-all hover:text-gray-700 dark:hover:text-gray-200\n focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-indigo-400\"\n [class.invisible]=\"!fn.hasChildren\"\n (click)=\"toggle(fn.node); $event.stopPropagation()\"\n [attr.aria-label]=\"fn.isExpanded ? 'Collapse' : 'Expand'\">\n <sv-icon name=\"chevron-right\"\n [cssClass]=\"'h-3.5 w-3.5 transition-transform duration-150' + (fn.isExpanded ? ' rotate-90' : '')\"\n [strokeWidth]=\"2\" />\n </button>\n\n <!-- Icon -->\n @if (fn.node.icon) {\n <span class=\"shrink-0 text-sm\" aria-hidden=\"true\">{{ fn.node.icon }}</span>\n }\n\n <!-- Label -->\n <span class=\"flex-1 truncate text-[13px] font-medium\"\n [class]=\"isSelected(fn.node.id)\n ? 'text-indigo-700 dark:text-indigo-300'\n : 'text-gray-800 dark:text-gray-100'\">\n {{ fn.node.label }}\n </span>\n\n <!-- Badge -->\n @if (fn.node.badge) {\n <span class=\"ml-auto shrink-0 rounded-full bg-gray-100 px-1.5 py-px\n text-[10px] font-semibold text-gray-600\n dark:bg-gray-800 dark:text-gray-300\">\n {{ fn.node.badge }}\n </span>\n }\n </div>\n }\n\n @if (!visibleNodes().length) {\n <sv-empty-shell reason=\"no-data\" [title]=\"emptyText()\" data-sv-state=\"empty\" />\n }\n </div>\n }\n\n `,\n})\nexport class SvTreeViewComponent {\n /** Tree node data (nested children, optional icons). */\n readonly nodes = input<TreeNode[]>([]);\n /** Enable single-row selection highlight. @default true */\n readonly selectable = input<boolean>(true);\n /** Show vertical connector guide lines. @default true */\n readonly showLines = input<boolean>(true);\n\n /**\n * True while the tree is being fetched. Replaces it with a placeholder.\n * @default false\n */\n readonly loading = input<boolean>(false);\n\n /**\n * Load failure. Use `toSvDataError()` from `@styloviz/core` to normalize an\n * `HttpErrorResponse`.\n * @default null\n */\n readonly error = input<SvDataError | string | null>(null);\n\n /** Copy for the empty state. @default 'No items to display' */\n readonly emptyText = input<string>('No items to display');\n\n readonly nodeClick = output<TreeNodeClickEvent>();\n readonly nodeExpand = output<TreeNode>();\n readonly nodeCollapse = output<TreeNode>();\n readonly nodeSelect = output<TreeNode>();\n /** The host should re-run the failed load. */\n readonly retry = output<void>();\n\n /**\n * Expanded node ids. Two-way bindable, so an expansion state loaded from the\n * server — or restored from a URL — survives a reload.\n */\n readonly expandedIds = model<Set<string>>(new Set());\n /** The selected node id. Two-way bindable. */\n readonly selectedId = model<string | null>(null);\n /** The treeitem currently in the tab order (roving tabindex). */\n readonly activeId = signal<string | null>(null);\n\n private readonly _nodes = signal<TreeNode[]>([]);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly visibleNodes = computed<FlatNode[]>(() =>\n this._flatten(this._nodes(), 0, this.expandedIds())\n );\n\n /** Applied only on the first non-empty node set — after that the user owns it. */\n private _seededFromNodes = false;\n\n constructor() {\n // `nodes` used to be read once in ngOnInit, so a host that fetched the tree\n // asynchronously and bound the result saw an empty component forever.\n effect(() => {\n const incoming = this.nodes();\n this._nodes.set(incoming);\n if (this._seededFromNodes || incoming.length === 0) return;\n this._seededFromNodes = true;\n const ids = new Set<string>();\n this._collectExpanded(incoming, ids);\n if (ids.size) this.expandedIds.set(ids);\n // Seed the roving tabindex on the first node so the tree is tab-reachable.\n // ★ UNREACHABLE BRANCH — the `?? null` right operand can never be taken.\n // The guard four lines up already returned for `incoming.length === 0`,\n // `_nodes` was set to `incoming` synchronously above, and `_flatten` of a\n // non-empty list always yields at least one row — so `[0]` is defined and\n // the `?.` never short-circuits. Kept because the expression is what\n // makes the `activeId` type honest; counted as unreachable, not uncovered.\n this.activeId.set(this.visibleNodes()[0]?.node.id ?? null);\n });\n }\n\n toggle(node: TreeNode): void {\n if (node.disabled) return;\n const ids = new Set(this.expandedIds());\n if (ids.has(node.id)) {\n ids.delete(node.id);\n this.nodeCollapse.emit(node);\n } else {\n ids.add(node.id);\n this.nodeExpand.emit(node);\n }\n this.expandedIds.set(ids);\n }\n\n /** One entry per ancestor level, for the indentation spacers. */\n depthArray(depth: number): number[] {\n return Array.from({ length: depth }, (_, i) => i);\n }\n\n select(node: TreeNode, depth: number): void {\n if (node.disabled || !this.selectable()) return;\n this.selectedId.set(node.id);\n this.nodeSelect.emit(node);\n this.nodeClick.emit({ node, depth });\n }\n\n isSelected(id: string): boolean { return this.selectedId() === id; }\n\n // ── Keyboard navigation (WAI-ARIA tree) ─────────────────────────────────────\n\n /** Roving tabindex: only the active treeitem is in the tab order. */\n treeTabIndex(id: string): number {\n const active = this.activeId() ?? this.visibleNodes()[0]?.node.id ?? null;\n return id === active ? 0 : -1;\n }\n\n setActive(id: string): void { this.activeId.set(id); }\n\n /**\n * Arrow / Home / End / Enter / Space handling per the WAI-ARIA tree pattern.\n * Arrow Up/Down move between visible rows; Right expands or steps into a\n * child; Left collapses or steps to the parent; Enter/Space selects.\n */\n onKeydown(event: KeyboardEvent, fn: FlatNode, index: number): void {\n const list = this.visibleNodes();\n switch (event.key) {\n case 'ArrowDown': event.preventDefault(); this._focusStep(list, index, +1); break;\n case 'ArrowUp': event.preventDefault(); this._focusStep(list, index, -1); break;\n case 'Home': event.preventDefault(); this._focusFrom(list, 0, +1); break;\n case 'End': event.preventDefault(); this._focusFrom(list, list.length - 1, -1); break;\n case 'ArrowRight':\n event.preventDefault();\n if (fn.hasChildren && !fn.isExpanded) { this.toggle(fn.node); }\n else if (fn.hasChildren && fn.isExpanded) { this._focusStep(list, index, +1); }\n break;\n case 'ArrowLeft':\n event.preventDefault();\n if (fn.hasChildren && fn.isExpanded) { this.toggle(fn.node); }\n else { this._focusParent(list, index, fn.depth); }\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.select(fn.node, fn.depth);\n this.setActive(fn.node.id);\n break;\n default:\n return;\n }\n }\n\n /** Move focus by `dir` steps from `from`, skipping disabled rows. */\n private _focusStep(list: readonly FlatNode[], from: number, dir: 1 | -1): void {\n for (let i = from + dir; i >= 0 && i < list.length; i += dir) {\n if (!list[i].node.disabled) { this._focus(list[i].node.id); return; }\n }\n }\n\n /** From `start`, find the first enabled row in direction `dir` and focus it. */\n private _focusFrom(list: readonly FlatNode[], start: number, dir: 1 | -1): void {\n for (let i = start; i >= 0 && i < list.length; i += dir) {\n if (!list[i].node.disabled) { this._focus(list[i].node.id); return; }\n }\n }\n\n /** Focus the parent row (nearest previous row with a smaller depth). */\n private _focusParent(list: readonly FlatNode[], index: number, depth: number): void {\n for (let i = index - 1; i >= 0; i--) {\n if (list[i].depth < depth) { this._focus(list[i].node.id); return; }\n }\n }\n\n /** Set the active id and move DOM focus to that row (after any re-render). */\n private _focus(id: string): void {\n this.setActive(id);\n queueMicrotask(() => {\n const rows = this.host.nativeElement.querySelectorAll<HTMLElement>('[data-tree-id]');\n rows.forEach(el => { if (el.dataset['treeId'] === id) el.focus(); });\n });\n }\n\n private _flatten(nodes: TreeNode[], depth: number, expanded: Set<string>): FlatNode[] {\n const result: FlatNode[] = [];\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const hasChildren = !!node.children?.length;\n const isExp = expanded.has(node.id);\n result.push({ node, depth, isLast: i === nodes.length - 1, hasChildren, isExpanded: isExp });\n if (isExp && node.children?.length) {\n result.push(...this._flatten(node.children, depth + 1, expanded));\n }\n }\n return result;\n }\n\n private _collectExpanded(nodes: TreeNode[], ids: Set<string>): void {\n for (const n of nodes) {\n if (n.expanded) ids.add(n.id);\n if (n.children) this._collectExpanded(n.children, ids);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AA6CA;AAEA;;;;;;;;;;;AAWG;MAmGU,mBAAmB,CAAA;;AAErB,IAAA,KAAK,GAAQ,KAAK,CAAa,EAAE,4EAAC;;AAElC,IAAA,UAAU,GAAG,KAAK,CAAU,IAAI,iFAAC;;AAEjC,IAAA,SAAS,GAAI,KAAK,CAAU,IAAI,gFAAC;AAE1C;;;AAGG;AACM,IAAA,OAAO,GAAG,KAAK,CAAU,KAAK,8EAAC;AAExC;;;;AAIG;AACM,IAAA,KAAK,GAAG,KAAK,CAA8B,IAAI,4EAAC;;AAGhD,IAAA,SAAS,GAAG,KAA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B,EAAE,qBAAqB,CAAC;AAClG,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,UAAU,EAAE,IAAI;oBAChB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FT,EAAA,CAAA;AACF,iBAAA;;;AC5JD;;AAEG;;;;"}
1
+ {"version":3,"file":"styloviz-tree-view.mjs","names":[],"sources":["../../../../projects/tree-view-free/src/lib/tree-view.component.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { SvIconComponent } from '@styloviz/icons';\nimport {\n SvEmptyShellComponent,\n SvErrorShellComponent,\n SvSkeletonShellComponent,\n createTypeahead,\n svAttrSelector,\n svCollectionTarget,\n svCutHierarchyCycles,\n svIsTypeaheadKey,\n svRecoverFocus,\n svSuccessorIndex,\n svWarnUnvirtualizedCeiling,\n warnOnDuplicateItemKeys,\n type SvDataError,\n} from '@styloviz/core';\n\ndeclare const ngDevMode: boolean | undefined;\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport interface TreeNode {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n children?: TreeNode[];\n readonly expanded?: boolean;\n readonly disabled?: boolean;\n readonly badge?: string;\n}\n\nexport interface FlatNode {\n readonly node: TreeNode;\n readonly depth: number;\n readonly isLast: boolean;\n readonly hasChildren: boolean;\n readonly isExpanded: boolean;\n}\n\nexport interface TreeNodeClickEvent {\n readonly node: TreeNode;\n readonly depth: number;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * SvTreeViewComponent (Free) — Collapsible single-select tree.\n *\n * For the full 8-variant suite (file explorer, checkbox tri-state,\n * org chart, tree table, searchable, draggable, lazy-load) upgrade to\n * `@styloviz-pro/tree-view`.\n *\n * @example\n * ```html\n * <sv-tree-view [nodes]=\"nodes\" (nodeClick)=\"onNodeClick($event)\" />\n * ```\n */\n@Component({\n imports: [SvIconComponent, SvSkeletonShellComponent, SvErrorShellComponent, SvEmptyShellComponent],\n selector: 'sv-tree-view',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (loading()) {\n <div class=\"p-2\" data-sv-state=\"loading\">\n <sv-skeleton-shell variant=\"list\" [rows]=\"5\" ariaLabel=\"Loading tree\" />\n </div>\n } @else if (error()) {\n <sv-error-shell\n [error]=\"error()\"\n title=\"Could not load this tree\"\n (retry)=\"retry.emit()\"\n data-sv-state=\"error\"\n />\n } @else {\n\n <div class=\"sv-tree-view select-none\" role=\"tree\" [attr.aria-label]=\"ariaLabel().trim() || null\">\n @for (fn of visibleNodes(); track fn.node.id) {\n <div class=\"group flex items-center gap-1 rounded-lg px-1 outline-none transition-colors duration-100 cursor-pointer focus-visible:ring-2 focus-visible:ring-brandaccent-400\"\n [class]=\"fn.node.disabled\n ? 'opacity-40 cursor-not-allowed py-1.5'\n : isSelected(fn.node.id)\n ? 'py-1.5 bg-brandaccent-50 dark:bg-brandaccent-900/25'\n : 'py-1.5 hover:bg-gray-100/70 dark:hover:bg-gray-800/50'\"\n (click)=\"select(fn.node, fn.depth); setActive(fn.node.id)\"\n (keydown)=\"onKeydown($event, fn, $index)\"\n role=\"treeitem\"\n [attr.data-tree-id]=\"fn.node.id\"\n [attr.tabindex]=\"treeTabIndex(fn.node.id)\"\n [attr.aria-level]=\"fn.depth + 1\"\n [attr.aria-expanded]=\"fn.hasChildren ? fn.isExpanded : null\"\n [attr.aria-selected]=\"selectable() ? isSelected(fn.node.id) : null\">\n\n <!--\n Depth spacers, one per level, carrying the optional connector guide.\n Indentation used to be a paddingLeft on the row, which left\n showLines - declared, documented, default true - with nothing to\n hang a line on, so it did nothing at all. The Pro twin has rendered\n these all along; this is the same 20px-per-level geometry.\n (No backticks in here: this template is an inline JS literal.)\n -->\n @for (d of depthArray(fn.depth); track d) {\n <span class=\"relative w-5 shrink-0 self-stretch\" aria-hidden=\"true\">\n @if (showLines()) {\n <span class=\"absolute inset-y-0 left-1/2 w-px -translate-x-1/2\n bg-gray-200 dark:bg-gray-700/70\"></span>\n }\n </span>\n }\n\n <!-- Chevron toggle -->\n <!-- Out of the tab order (X-10): ArrowRight/ArrowLeft on the row\n expand and collapse, so a 1,500-row tree stays ONE tab stop. -->\n <button type=\"button\"\n tabindex=\"-1\"\n class=\"flex h-5 w-5 shrink-0 items-center justify-center rounded\n text-gray-400 transition-all hover:text-gray-700 dark:hover:text-gray-200\n focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-brandaccent-400\"\n [class.invisible]=\"!fn.hasChildren\"\n (click)=\"toggle(fn.node); $event.stopPropagation()\"\n [attr.aria-label]=\"(fn.isExpanded ? 'Collapse ' : 'Expand ') + fn.node.label\">\n <sv-icon name=\"chevron-right\"\n [cssClass]=\"'h-3.5 w-3.5 transition-transform duration-150' + (fn.isExpanded ? ' rotate-90' : '')\"\n [strokeWidth]=\"2\" />\n </button>\n\n <!-- Icon -->\n @if (fn.node.icon) {\n <span class=\"shrink-0 text-sm\" aria-hidden=\"true\">{{ fn.node.icon }}</span>\n }\n\n <!-- Label -->\n <span class=\"flex-1 truncate text-[13px] font-medium\"\n [class]=\"isSelected(fn.node.id)\n ? 'text-brandaccent-700 dark:text-brandaccent-300'\n : 'text-gray-800 dark:text-gray-100'\">\n {{ fn.node.label }}\n </span>\n\n <!-- Badge -->\n @if (fn.node.badge) {\n <span class=\"ml-auto shrink-0 rounded-full bg-gray-100 px-1.5 py-px\n text-[10px] font-semibold text-gray-600\n dark:bg-gray-800 dark:text-gray-300\">\n {{ fn.node.badge }}\n </span>\n }\n </div>\n }\n\n @if (!visibleNodes().length) {\n <sv-empty-shell reason=\"no-data\" [title]=\"emptyText()\" data-sv-state=\"empty\" />\n }\n </div>\n }\n\n `,\n})\nexport class SvTreeViewComponent {\n /** Tree node data (nested children, optional icons). */\n readonly nodes = input<TreeNode[]>([]);\n /**\n * Enable single-row selection highlight. @default true\n *\n * ★ Also decides whether the rows claim `aria-selected` at all. A display-only\n * tree that reports `aria-selected=\"false\"` on every row announces a\n * selection model that does not exist, and a listener can only discover that\n * by pressing Enter and getting nothing.\n */\n readonly selectable = input<boolean>(true);\n /** Show vertical connector guide lines. @default true */\n readonly showLines = input<boolean>(true);\n /**\n * What this tree is, e.g. `'Project files'` — names the `role=\"tree\"` region.\n *\n * ★ Two trees side by side both announce as an unnamed \"tree\" without this.\n * Left unset, no name is invented: an `aria-label` of \"Tree\" only repeats\n * the role. Matches `sv-tree-view-pro`'s input of the same name.\n *\n * @default ''\n */\n readonly ariaLabel = input<string>('');\n\n /**\n * True while the tree is being fetched. Replaces it with a placeholder.\n * @default false\n */\n readonly loading = input<boolean>(false);\n\n /**\n * Load failure. Use `toSvDataError()` from `@styloviz/core` to normalize an\n * `HttpErrorResponse`.\n * @default null\n */\n readonly error = input<SvDataError | string | null>(null);\n\n /** Copy for the empty state. @default 'No items to display' */\n readonly emptyText = input<string>('No items to display');\n\n /** Fires when an enabled node is clicked or activated with Enter/Space while `selectable`; payload is the node and its depth (0 for roots). */\n readonly nodeClick = output<TreeNodeClickEvent>();\n /** Fires with the node when an enabled parent is expanded, by its chevron or ArrowRight. */\n readonly nodeExpand = output<TreeNode>();\n /** Fires with the node when an expanded parent is collapsed, by its chevron or ArrowLeft. */\n readonly nodeCollapse = output<TreeNode>();\n /** Fires with the node when it becomes selected by click or Enter/Space; never fires while `selectable` is false. */\n readonly nodeSelect = output<TreeNode>();\n /** The host should re-run the failed load. */\n readonly retry = output<void>();\n\n /**\n * Expanded node ids. Two-way bindable, so an expansion state loaded from the\n * server — or restored from a URL — survives a reload.\n */\n readonly expandedIds = model<Set<string>>(new Set());\n /** The selected node id. Two-way bindable. */\n readonly selectedId = model<string | null>(null);\n /** The treeitem currently in the tab order (roving tabindex). */\n readonly activeId = signal<string | null>(null);\n\n private readonly _nodes = signal<TreeNode[]>([]);\n private readonly _warnedBindings = new Set<string>();\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Injected, not the global: this runs during SSR, where there is no `document`. */\n private readonly _doc = inject(DOCUMENT);\n\n readonly visibleNodes = computed<FlatNode[]>(() => {\n const rows = this._flatten(this._nodes(), 0, this.expandedIds());\n // `TreeNode.id` is required by the type, but the type cannot require it to be\n // UNIQUE, and a tree is where duplicates are easiest to introduce: ids unique\n // among their own siblings collide the moment two branches are flattened into\n // one `@for`. Angular answers that with NG0955 and an empty tree.\n warnOnDuplicateItemKeys(rows, (n) => n.node.id, 'sv-tree-view [nodes]');\n return rows;\n });\n\n /** Applied only on the first non-empty node set — after that the user owns it. */\n private _seededFromNodes = false;\n\n constructor() {\n // `nodes` used to be read once in ngOnInit, so a host that fetched the tree\n // asynchronously and bound the result saw an empty component forever.\n effect(() => {\n // ★ Cut before anything walks it. `_flatten` and `_collectExpanded` both\n // recurse into `children` unconditionally, so a cycle in the host's data\n // — the ordinary result of building `children` from a `parentId` map —\n // recursed until the stack ended and took the tab with it.\n const incoming = svCutHierarchyCycles(this.nodes(), 'sv-tree-view').nodes as TreeNode[];\n // `X-12`: the host may delete the node that holds focus. Note where it\n // was BEFORE the new set renders, so focus can go to its successor.\n const focusedRow = untracked(() => this._focusedRowSnapshot());\n this._nodes.set(incoming);\n if (focusedRow) this._recoverAfterNodesChange(focusedRow);\n if (this._seededFromNodes || incoming.length === 0) return;\n this._seededFromNodes = true;\n const ids = new Set<string>();\n this._collectExpanded(incoming, ids);\n // `node.expanded` seeds this only when nobody else has: `expandedIds` is a\n // `model`, so a host may have bound a restored view, and the flags must not\n // win on first render only to lose on the next write.\n if (ids.size && untracked(this.expandedIds).size === 0) {\n this.expandedIds.set(ids);\n }\n // Seed the roving tabindex on the first node so the tree is tab-reachable.\n // ★ UNREACHABLE BRANCH — the `?? null` right operand can never be taken.\n // The guard four lines up already returned for `incoming.length === 0`,\n // `_nodes` was set to `incoming` synchronously above, and `_flatten` of a\n // non-empty list always yields at least one row — so `[0]` is defined and\n // the `?.` never short-circuits. Kept because the expression is what\n // makes the `activeId` type honest; counted as unreachable, not uncovered.\n this.activeId.set(this.visibleNodes()[0]?.node.id ?? null);\n });\n\n // `X-10`: a tree renders every visible row. Past the documented ceiling,\n // say so once in dev mode.\n effect(() => svWarnUnvirtualizedCeiling('sv-tree-view', this.visibleNodes().length, false));\n\n effect(() => this._warnIgnoredBindings());\n }\n\n /** Dev-mode only, once per instance: bindings the tree cannot act on. */\n private _warnIgnoredBindings(): void {\n if (typeof ngDevMode === 'undefined' || !ngDevMode) return;\n // An unnamed tree: two of them side by side both announce as \"tree\", and a\n // listener cannot tell the folder pane from the permissions pane.\n if (\n !this.ariaLabel().trim() &&\n !this.host.nativeElement.hasAttribute('aria-labelledby') &&\n !this._warnedBindings.has('no-name')\n ) {\n this._warnedBindings.add('no-name');\n console.warn(\n '[styloviz] sv-tree-view: the tree has no accessible name — [ariaLabel] is ' +\n 'empty and the host has no aria-labelledby, so a screen reader announces only ' +\n '\"tree\". Pass [ariaLabel]=\"\\'Project files\\'\" (or similar).',\n );\n }\n }\n\n // ── Focus after the host mutates `nodes` (X-12) ─────────────────────────────\n\n /** The row holding DOM focus, and its index among the visible rows — or null. */\n private _focusedRowSnapshot(): { readonly id: string; readonly index: number } | null {\n const active = this._doc.activeElement as HTMLElement | null;\n if (!active || !this.host.nativeElement.contains(active)) return null;\n const id = (active.closest('[data-tree-id]') as HTMLElement | null)?.dataset['treeId'];\n if (id === undefined) return null;\n return { id, index: this.visibleNodes().findIndex(fn => fn.node.id === id) };\n }\n\n /**\n * The kit's mutation rule (`svSuccessorIndex`): when a new `nodes` set drops\n * the focused row, focus the row now at its index, else the one before it,\n * else the tree itself — never `<body>`. Runs after the render, the only\n * point at which the successor row exists.\n */\n private _recoverAfterNodesChange(was: { readonly id: string; readonly index: number }): void {\n setTimeout(() => {\n const list = this.visibleNodes();\n if (list.some(fn => fn.node.id === was.id)) return;\n const next = list[svSuccessorIndex(was.index, list.length)];\n if (next) this.setActive(next.node.id);\n const root = this.host.nativeElement;\n const successor = next ? root.querySelector<HTMLElement>(svAttrSelector('data-tree-id', next.node.id)) : null;\n // The roving tab stop moves with focus; the binding catches up on the\n // next render, and focus cannot wait for it.\n if (successor && !next?.node.disabled) successor.tabIndex = 0;\n svRecoverFocus({\n to: [successor],\n fallback: root.querySelector('[role=\"tree\"]'),\n });\n }, 0);\n }\n\n toggle(node: TreeNode): void {\n if (node.disabled) return;\n const ids = new Set(this.expandedIds());\n const collapsing = ids.has(node.id);\n if (collapsing) ids.delete(node.id);\n else ids.add(node.id);\n this.expandedIds.set(ids);\n\n // Collapsing hides every descendant, including the one that may hold focus.\n // The WAI-ARIA tree pattern puts focus on the parent that was collapsed.\n if (collapsing) this._repairFocus(node.id);\n\n if (collapsing) this.nodeCollapse.emit(node);\n else this.nodeExpand.emit(node);\n }\n\n /**\n * Put DOM focus back on a rendered row after a collapse removed the one that\n * had it, preferring `preferredId`.\n *\n * ★ Acts only when the row that actually holds focus has left the render.\n * Collapsing by clicking a chevron leaves focus on that chevron, whose row is\n * still there, and moving it would put a focus ring on screen for a mouse\n * user who never asked for one.\n */\n private _repairFocus(preferredId: string): void {\n const active = this._doc.activeElement;\n if (!active || !this.host.nativeElement.contains(active)) return;\n\n const row = (active as HTMLElement).closest('[data-tree-id]') as HTMLElement | null;\n const activeRowId = row?.dataset['treeId'] ?? null;\n if (activeRowId === null) return;\n\n const list = this.visibleNodes();\n if (list.some(fn => fn.node.id === activeRowId)) return;\n\n const target = list.some(fn => fn.node.id === preferredId)\n ? preferredId\n : this._tabStopId();\n if (target) this._focus(target);\n }\n\n /** One entry per ancestor level, for the indentation spacers. */\n depthArray(depth: number): number[] {\n return Array.from({ length: depth }, (_, i) => i);\n }\n\n select(node: TreeNode, depth: number): void {\n if (node.disabled || !this.selectable()) return;\n this.selectedId.set(node.id);\n this.nodeSelect.emit(node);\n this.nodeClick.emit({ node, depth });\n }\n\n isSelected(id: string): boolean { return this.selectedId() === id; }\n\n // ── Keyboard navigation (WAI-ARIA tree) ─────────────────────────────────────\n\n /**\n * The treeitem that holds the tab stop.\n *\n * ★★★ THE ACTIVE NODE IS NOT ALWAYS STILL RENDERED, and the `??` above could\n * not see that: it falls back when `activeId` is null, not when `activeId`\n * names a row that has gone. Collapsing a parent while a descendant was\n * active left every row at −1 — a fully populated tree that Tab could not\n * enter, and no arrow key could rescue it because arrows need focus inside\n * the tree first.\n */\n private readonly _tabStopId = computed<string | null>(() => {\n const list = this.visibleNodes();\n const active = this.activeId();\n if (active !== null && list.some(fn => fn.node.id === active)) return active;\n return list[0]?.node.id ?? null;\n });\n\n treeTabIndex(id: string): number {\n return id === this._tabStopId() ? 0 : -1;\n }\n\n setActive(id: string): void { this.activeId.set(id); }\n\n /**\n * Arrow / Home / End / Enter / Space handling per the WAI-ARIA tree pattern.\n * Arrow Up/Down move between visible rows; Right expands or steps into a\n * child; Left collapses or steps to the parent; Enter/Space selects.\n */\n onKeydown(event: KeyboardEvent, fn: FlatNode, index: number): void {\n const list = this.visibleNodes();\n switch (event.key) {\n case 'ArrowDown': event.preventDefault(); this._focusStep(list, index, +1); break;\n case 'ArrowUp': event.preventDefault(); this._focusStep(list, index, -1); break;\n case 'Home': event.preventDefault(); this._focusFrom(list, 0, +1); break;\n case 'End': event.preventDefault(); this._focusFrom(list, list.length - 1, -1); break;\n case 'PageDown':\n case 'PageUp': {\n // `X-10`: a page of rows, clamped at the ends — never wrapped. Lands on\n // the nearest enabled row in the direction of travel.\n event.preventDefault();\n const next = svCollectionTarget(event.key, list.length, index, { pageSize: 10 }) ?? index;\n const dir = event.key === 'PageDown' ? 1 : -1;\n if (list[next]?.node.disabled) this._focusFrom(list, next, dir);\n else if (list[next]) this._focus(list[next].node.id);\n break;\n }\n case 'ArrowRight':\n event.preventDefault();\n if (fn.hasChildren && !fn.isExpanded) { this.toggle(fn.node); }\n else if (fn.hasChildren && fn.isExpanded) { this._focusStep(list, index, +1); }\n break;\n case 'ArrowLeft':\n event.preventDefault();\n if (fn.hasChildren && fn.isExpanded) { this.toggle(fn.node); }\n else { this._focusParent(list, index, fn.depth); }\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.select(fn.node, fn.depth);\n this.setActive(fn.node.id);\n break;\n default:\n this._typeahead(event, list, index);\n return;\n }\n }\n\n /** `X-10` typeahead over visible, enabled rows — type \"re\" to reach \"Reports\". */\n private readonly _typeaheadBuffer = createTypeahead<FlatNode>({ labelOf: fn => fn.node.label });\n\n private _typeahead(event: KeyboardEvent, list: readonly FlatNode[], index: number): void {\n if (!svIsTypeaheadKey(event)) return;\n const enabled = list.filter(fn => !fn.node.disabled);\n const current = enabled.findIndex(fn => fn.node.id === list[index]?.node.id);\n const next = this._typeaheadBuffer.handle(event.key, enabled, current);\n if (next === null) return;\n event.preventDefault();\n this._focus(enabled[next].node.id);\n }\n\n /** Move focus by `dir` steps from `from`, skipping disabled rows. */\n private _focusStep(list: readonly FlatNode[], from: number, dir: 1 | -1): void {\n for (let i = from + dir; i >= 0 && i < list.length; i += dir) {\n if (!list[i].node.disabled) { this._focus(list[i].node.id); return; }\n }\n }\n\n /** From `start`, find the first enabled row in direction `dir` and focus it. */\n private _focusFrom(list: readonly FlatNode[], start: number, dir: 1 | -1): void {\n for (let i = start; i >= 0 && i < list.length; i += dir) {\n if (!list[i].node.disabled) { this._focus(list[i].node.id); return; }\n }\n }\n\n /** Focus the parent row (nearest previous row with a smaller depth). */\n private _focusParent(list: readonly FlatNode[], index: number, depth: number): void {\n for (let i = index - 1; i >= 0; i--) {\n if (list[i].depth < depth) { this._focus(list[i].node.id); return; }\n }\n }\n\n /**\n * Set the active id and move DOM focus to that row once the view has caught\n * up with the signals.\n *\n * ★★ A MICROTASK IS TOO EARLY (DD-45-I3, matching the Pro twin's `_focusRow`).\n * Change detection is itself scheduled from the same event handler, so a\n * `queueMicrotask` ran BEFORE the re-render: a row that the keystroke's own\n * state change was about to render was not in the DOM yet, and the focus\n * call found nothing, leaving the user on whatever they had before. A\n * macrotask lands after the render, the only point at which the element\n * that will keep focus is the one on screen.\n */\n private _focus(id: string): void {\n this.setActive(id);\n setTimeout(() => {\n const rows = this.host.nativeElement.querySelectorAll<HTMLElement>('[data-tree-id]');\n rows.forEach(el => { if (el.dataset['treeId'] === id) el.focus(); });\n }, 0);\n }\n\n /**\n * ★ Appends into one accumulator rather than splicing each level in with\n * `push(...children)`. A spread call passes one argument per element, so a\n * branch with more visible descendants than the engine's argument cap —\n * ~65k in JavaScriptCore, ~124k in V8 — threw `RangeError` and took the\n * render with it. A demo fixture never gets there; a real folder tree does.\n */\n private _flatten(nodes: TreeNode[], depth: number, expanded: Set<string>): FlatNode[] {\n const out: FlatNode[] = [];\n this._flattenInto(out, nodes, depth, expanded);\n return out;\n }\n\n private _flattenInto(out: FlatNode[], nodes: TreeNode[], depth: number, expanded: Set<string>): void {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const hasChildren = !!node.children?.length;\n const isExp = expanded.has(node.id);\n out.push({ node, depth, isLast: i === nodes.length - 1, hasChildren, isExpanded: isExp });\n if (isExp && node.children?.length) {\n this._flattenInto(out, node.children, depth + 1, expanded);\n }\n }\n }\n\n private _collectExpanded(nodes: TreeNode[], ids: Set<string>): void {\n for (const n of nodes) {\n if (n.expanded) ids.add(n.id);\n if (n.children) this._collectExpanded(n.children, ids);\n }\n }\n}\n"],"mappings":";;;;;AA6KA,IAAa,sBAAb,MAAa,oBAAmB;CAErB,QAAa,MAAkB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CASlC,aAAa,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEjC,YAAa,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YA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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.",
5
5
  "keywords": [
6
6
  "angular",
7
7
  "tailwind",
8
8
  "tree-view",
9
- "tree"
9
+ "tree",
10
+ "ui-kit",
11
+ "styloviz",
12
+ "view"
10
13
  ],
11
14
  "license": "MIT",
12
15
  "author": "sazzad-bs23",
13
- "homepage": "https://styloviz.dev",
16
+ "homepage": "https://styloviz.dev/docs/tree-view",
14
17
  "repository": {
15
18
  "type": "git",
16
19
  "url": "git+https://github.com/rhossain/angular-tailwind-dashboard-components.git",
17
20
  "directory": "projects/tree-view-free"
18
21
  },
19
22
  "bugs": {
20
- "url": "https://github.com/rhossain/angular-tailwind-dashboard-components/issues"
23
+ "url": "https://github.com/styloviz/community/discussions"
21
24
  },
22
25
  "peerDependencies": {
23
- "@angular/common": ">=21.0.0",
24
- "@angular/core": ">=21.0.0",
25
- "@styloviz/core": ">=0.1.0",
26
- "@styloviz/icons": ">=0.1.0"
26
+ "@angular/common": ">=21.0.0 <23.0.0",
27
+ "@angular/core": ">=21.0.0 <23.0.0",
28
+ "@styloviz/core": "^1.0.1",
29
+ "@styloviz/icons": "^1.0.1"
27
30
  },
28
31
  "publishConfig": {
29
32
  "access": "public"
@@ -1,25 +1,24 @@
1
- import * as _angular_core from '@angular/core';
2
- import { SvDataError } from '@styloviz/core';
3
-
1
+ import { SvDataError } from "@styloviz/core";
2
+ import * as i0 from "@angular/core";
4
3
  interface TreeNode {
5
- readonly id: string;
6
- readonly label: string;
7
- readonly icon?: string;
8
- children?: TreeNode[];
9
- readonly expanded?: boolean;
10
- readonly disabled?: boolean;
11
- readonly badge?: string;
4
+ readonly id: string;
5
+ readonly label: string;
6
+ readonly icon?: string;
7
+ children?: TreeNode[];
8
+ readonly expanded?: boolean;
9
+ readonly disabled?: boolean;
10
+ readonly badge?: string;
12
11
  }
13
12
  interface FlatNode {
14
- readonly node: TreeNode;
15
- readonly depth: number;
16
- readonly isLast: boolean;
17
- readonly hasChildren: boolean;
18
- readonly isExpanded: boolean;
13
+ readonly node: TreeNode;
14
+ readonly depth: number;
15
+ readonly isLast: boolean;
16
+ readonly hasChildren: boolean;
17
+ readonly isExpanded: boolean;
19
18
  }
20
19
  interface TreeNodeClickEvent {
21
- readonly node: TreeNode;
22
- readonly depth: number;
20
+ readonly node: TreeNode;
21
+ readonly depth: number;
23
22
  }
24
23
  /**
25
24
  * SvTreeViewComponent (Free) — Collapsible single-select tree.
@@ -33,75 +32,204 @@ interface TreeNodeClickEvent {
33
32
  * <sv-tree-view [nodes]="nodes" (nodeClick)="onNodeClick($event)" />
34
33
  * ```
35
34
  */
36
- declare class SvTreeViewComponent {
37
- /** Tree node data (nested children, optional icons). */
38
- readonly nodes: _angular_core.InputSignal<TreeNode[]>;
39
- /** Enable single-row selection highlight. @default true */
40
- readonly selectable: _angular_core.InputSignal<boolean>;
41
- /** Show vertical connector guide lines. @default true */
42
- readonly showLines: _angular_core.InputSignal<boolean>;
43
- /**
44
- * True while the tree is being fetched. Replaces it with a placeholder.
45
- * @default false
46
- */
47
- readonly loading: _angular_core.InputSignal<boolean>;
48
- /**
49
- * Load failure. Use `toSvDataError()` from `@styloviz/core` to normalize an
50
- * `HttpErrorResponse`.
51
- * @default null
52
- */
53
- readonly error: _angular_core.InputSignal<string | SvDataError | null>;
54
- /** Copy for the empty state. @default 'No items to display' */
55
- readonly emptyText: _angular_core.InputSignal<string>;
56
- readonly nodeClick: _angular_core.OutputEmitterRef<TreeNodeClickEvent>;
57
- readonly nodeExpand: _angular_core.OutputEmitterRef<TreeNode>;
58
- readonly nodeCollapse: _angular_core.OutputEmitterRef<TreeNode>;
59
- readonly nodeSelect: _angular_core.OutputEmitterRef<TreeNode>;
60
- /** The host should re-run the failed load. */
61
- readonly retry: _angular_core.OutputEmitterRef<void>;
62
- /**
63
- * Expanded node ids. Two-way bindable, so an expansion state loaded from the
64
- * server — or restored from a URL — survives a reload.
65
- */
66
- readonly expandedIds: _angular_core.ModelSignal<Set<string>>;
67
- /** The selected node id. Two-way bindable. */
68
- readonly selectedId: _angular_core.ModelSignal<string | null>;
69
- /** The treeitem currently in the tab order (roving tabindex). */
70
- readonly activeId: _angular_core.WritableSignal<string | null>;
71
- private readonly _nodes;
72
- private readonly host;
73
- readonly visibleNodes: _angular_core.Signal<FlatNode[]>;
74
- /** Applied only on the first non-empty node set — after that the user owns it. */
75
- private _seededFromNodes;
76
- constructor();
77
- toggle(node: TreeNode): void;
78
- /** One entry per ancestor level, for the indentation spacers. */
79
- depthArray(depth: number): number[];
80
- select(node: TreeNode, depth: number): void;
81
- isSelected(id: string): boolean;
82
- /** Roving tabindex: only the active treeitem is in the tab order. */
83
- treeTabIndex(id: string): number;
84
- setActive(id: string): void;
85
- /**
86
- * Arrow / Home / End / Enter / Space handling per the WAI-ARIA tree pattern.
87
- * Arrow Up/Down move between visible rows; Right expands or steps into a
88
- * child; Left collapses or steps to the parent; Enter/Space selects.
89
- */
90
- onKeydown(event: KeyboardEvent, fn: FlatNode, index: number): void;
91
- /** Move focus by `dir` steps from `from`, skipping disabled rows. */
92
- private _focusStep;
93
- /** From `start`, find the first enabled row in direction `dir` and focus it. */
94
- private _focusFrom;
95
- /** Focus the parent row (nearest previous row with a smaller depth). */
96
- private _focusParent;
97
- /** Set the active id and move DOM focus to that row (after any re-render). */
98
- private _focus;
99
- private _flatten;
100
- private _collectExpanded;
101
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SvTreeViewComponent, never>;
102
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SvTreeViewComponent, "sv-tree-view", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "showLines": { "alias": "showLines"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "expandedIds": { "alias": "expandedIds"; "required": false; "isSignal": true; }; "selectedId": { "alias": "selectedId"; "required": false; "isSignal": true; }; }, { "nodeClick": "nodeClick"; "nodeExpand": "nodeExpand"; "nodeCollapse": "nodeCollapse"; "nodeSelect": "nodeSelect"; "retry": "retry"; "expandedIds": "expandedIdsChange"; "selectedId": "selectedIdChange"; }, never, never, true, never>;
35
+ export declare class SvTreeViewComponent {
36
+ /** Tree node data (nested children, optional icons). */
37
+ readonly nodes: import("@angular/core").InputSignal<TreeNode[]>;
38
+ /**
39
+ * Enable single-row selection highlight. @default true
40
+ *
41
+ * ★ Also decides whether the rows claim `aria-selected` at all. A display-only
42
+ * tree that reports `aria-selected="false"` on every row announces a
43
+ * selection model that does not exist, and a listener can only discover that
44
+ * by pressing Enter and getting nothing.
45
+ */
46
+ readonly selectable: import("@angular/core").InputSignal<boolean>;
47
+ /** Show vertical connector guide lines. @default true */
48
+ readonly showLines: import("@angular/core").InputSignal<boolean>;
49
+ /**
50
+ * What this tree is, e.g. `'Project files'` — names the `role="tree"` region.
51
+ *
52
+ * ★ Two trees side by side both announce as an unnamed "tree" without this.
53
+ * Left unset, no name is invented: an `aria-label` of "Tree" only repeats
54
+ * the role. Matches `sv-tree-view-pro`'s input of the same name.
55
+ *
56
+ * @default ''
57
+ */
58
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
59
+ /**
60
+ * True while the tree is being fetched. Replaces it with a placeholder.
61
+ * @default false
62
+ */
63
+ readonly loading: import("@angular/core").InputSignal<boolean>;
64
+ /**
65
+ * Load failure. Use `toSvDataError()` from `@styloviz/core` to normalize an
66
+ * `HttpErrorResponse`.
67
+ * @default null
68
+ */
69
+ readonly error: import("@angular/core").InputSignal<string | SvDataError | null>;
70
+ /** Copy for the empty state. @default 'No items to display' */
71
+ readonly emptyText: import("@angular/core").InputSignal<string>;
72
+ /** Fires when an enabled node is clicked or activated with Enter/Space while `selectable`; payload is the node and its depth (0 for roots). */
73
+ readonly nodeClick: import("@angular/core").OutputEmitterRef<TreeNodeClickEvent>;
74
+ /** Fires with the node when an enabled parent is expanded, by its chevron or ArrowRight. */
75
+ readonly nodeExpand: import("@angular/core").OutputEmitterRef<TreeNode>;
76
+ /** Fires with the node when an expanded parent is collapsed, by its chevron or ArrowLeft. */
77
+ readonly nodeCollapse: import("@angular/core").OutputEmitterRef<TreeNode>;
78
+ /** Fires with the node when it becomes selected by click or Enter/Space; never fires while `selectable` is false. */
79
+ readonly nodeSelect: import("@angular/core").OutputEmitterRef<TreeNode>;
80
+ /** The host should re-run the failed load. */
81
+ readonly retry: import("@angular/core").OutputEmitterRef<void>;
82
+ /**
83
+ * Expanded node ids. Two-way bindable, so an expansion state loaded from the
84
+ * server — or restored from a URL — survives a reload.
85
+ */
86
+ readonly expandedIds: import("@angular/core").ModelSignal<Set<string>>;
87
+ /** The selected node id. Two-way bindable. */
88
+ readonly selectedId: import("@angular/core").ModelSignal<string | null>;
89
+ /** The treeitem currently in the tab order (roving tabindex). */
90
+ readonly activeId: import("@angular/core").WritableSignal<string | null>;
91
+ private readonly _nodes;
92
+ private readonly _warnedBindings;
93
+ private readonly host;
94
+ /** Injected, not the global: this runs during SSR, where there is no `document`. */
95
+ private readonly _doc;
96
+ readonly visibleNodes: import("@angular/core").Signal<FlatNode[]>;
97
+ /** Applied only on the first non-empty node set — after that the user owns it. */
98
+ private _seededFromNodes;
99
+ constructor();
100
+ /** Dev-mode only, once per instance: bindings the tree cannot act on. */
101
+ private _warnIgnoredBindings;
102
+ /** The row holding DOM focus, and its index among the visible rows — or null. */
103
+ private _focusedRowSnapshot;
104
+ /**
105
+ * The kit's mutation rule (`svSuccessorIndex`): when a new `nodes` set drops
106
+ * the focused row, focus the row now at its index, else the one before it,
107
+ * else the tree itself — never `<body>`. Runs after the render, the only
108
+ * point at which the successor row exists.
109
+ */
110
+ private _recoverAfterNodesChange;
111
+ toggle(node: TreeNode): void;
112
+ /**
113
+ * Put DOM focus back on a rendered row after a collapse removed the one that
114
+ * had it, preferring `preferredId`.
115
+ *
116
+ * ★ Acts only when the row that actually holds focus has left the render.
117
+ * Collapsing by clicking a chevron leaves focus on that chevron, whose row is
118
+ * still there, and moving it would put a focus ring on screen for a mouse
119
+ * user who never asked for one.
120
+ */
121
+ private _repairFocus;
122
+ /** One entry per ancestor level, for the indentation spacers. */
123
+ depthArray(depth: number): number[];
124
+ select(node: TreeNode, depth: number): void;
125
+ isSelected(id: string): boolean;
126
+ /**
127
+ * The treeitem that holds the tab stop.
128
+ *
129
+ * ★★★ THE ACTIVE NODE IS NOT ALWAYS STILL RENDERED, and the `??` above could
130
+ * not see that: it falls back when `activeId` is null, not when `activeId`
131
+ * names a row that has gone. Collapsing a parent while a descendant was
132
+ * active left every row at −1 — a fully populated tree that Tab could not
133
+ * enter, and no arrow key could rescue it because arrows need focus inside
134
+ * the tree first.
135
+ */
136
+ private readonly _tabStopId;
137
+ treeTabIndex(id: string): number;
138
+ setActive(id: string): void;
139
+ /**
140
+ * Arrow / Home / End / Enter / Space handling per the WAI-ARIA tree pattern.
141
+ * Arrow Up/Down move between visible rows; Right expands or steps into a
142
+ * child; Left collapses or steps to the parent; Enter/Space selects.
143
+ */
144
+ onKeydown(event: KeyboardEvent, fn: FlatNode, index: number): void;
145
+ /** `X-10` typeahead over visible, enabled rows — type "re" to reach "Reports". */
146
+ private readonly _typeaheadBuffer;
147
+ private _typeahead;
148
+ /** Move focus by `dir` steps from `from`, skipping disabled rows. */
149
+ private _focusStep;
150
+ /** From `start`, find the first enabled row in direction `dir` and focus it. */
151
+ private _focusFrom;
152
+ /** Focus the parent row (nearest previous row with a smaller depth). */
153
+ private _focusParent;
154
+ /**
155
+ * Set the active id and move DOM focus to that row once the view has caught
156
+ * up with the signals.
157
+ *
158
+ * ★★ A MICROTASK IS TOO EARLY (DD-45-I3, matching the Pro twin's `_focusRow`).
159
+ * Change detection is itself scheduled from the same event handler, so a
160
+ * `queueMicrotask` ran BEFORE the re-render: a row that the keystroke's own
161
+ * state change was about to render was not in the DOM yet, and the focus
162
+ * call found nothing, leaving the user on whatever they had before. A
163
+ * macrotask lands after the render, the only point at which the element
164
+ * that will keep focus is the one on screen.
165
+ */
166
+ private _focus;
167
+ /**
168
+ * ★ Appends into one accumulator rather than splicing each level in with
169
+ * `push(...children)`. A spread call passes one argument per element, so a
170
+ * branch with more visible descendants than the engine's argument cap —
171
+ * ~65k in JavaScriptCore, ~124k in V8 — threw `RangeError` and took the
172
+ * render with it. A demo fixture never gets there; a real folder tree does.
173
+ */
174
+ private _flatten;
175
+ private _flattenInto;
176
+ private _collectExpanded;
177
+ static ɵfac: i0.ɵɵFactoryDeclaration<SvTreeViewComponent, never>;
178
+ static ɵcmp: i0.ɵɵComponentDeclaration<SvTreeViewComponent, "sv-tree-view", never, {
179
+ "nodes": {
180
+ "alias": "nodes";
181
+ "required": false;
182
+ "isSignal": true;
183
+ };
184
+ "selectable": {
185
+ "alias": "selectable";
186
+ "required": false;
187
+ "isSignal": true;
188
+ };
189
+ "showLines": {
190
+ "alias": "showLines";
191
+ "required": false;
192
+ "isSignal": true;
193
+ };
194
+ "ariaLabel": {
195
+ "alias": "ariaLabel";
196
+ "required": false;
197
+ "isSignal": true;
198
+ };
199
+ "loading": {
200
+ "alias": "loading";
201
+ "required": false;
202
+ "isSignal": true;
203
+ };
204
+ "error": {
205
+ "alias": "error";
206
+ "required": false;
207
+ "isSignal": true;
208
+ };
209
+ "emptyText": {
210
+ "alias": "emptyText";
211
+ "required": false;
212
+ "isSignal": true;
213
+ };
214
+ "expandedIds": {
215
+ "alias": "expandedIds";
216
+ "required": false;
217
+ "isSignal": true;
218
+ };
219
+ "selectedId": {
220
+ "alias": "selectedId";
221
+ "required": false;
222
+ "isSignal": true;
223
+ };
224
+ }, {
225
+ "nodeClick": "nodeClick";
226
+ "nodeExpand": "nodeExpand";
227
+ "nodeCollapse": "nodeCollapse";
228
+ "nodeSelect": "nodeSelect";
229
+ "retry": "retry";
230
+ "expandedIds": "expandedIdsChange";
231
+ "selectedId": "selectedIdChange";
232
+ }, never, never, true, never>;
103
233
  }
104
-
105
- export { SvTreeViewComponent };
106
234
  export type { FlatNode, TreeNode, TreeNodeClickEvent };
107
- //# sourceMappingURL=styloviz-tree-view.d.ts.map
235
+ //# sourceMappingURL=styloviz-tree-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styloviz-tree-view.d.ts","sources":["../../../../projects/tree-view-free/src/lib/tree-view.component.ts"],"mappings":";;;UAsBiB,QAAQ;AACvB;AACA;AACA;AACA,eAAW,QAAQ;AACnB;AACA;AACA;AACD;UAEgB,QAAQ;AACvB,mBAAe,QAAQ;AACvB;AACA;AACA;AACA;AACD;UAEgB,kBAAkB;AACjC,mBAAe,QAAQ;AACvB;AACD;AAID;;;;;;;;;;;AAWG;AACH,cAkGa,mBAAmB;;oBAEhB,aAAA,CAAA,WAAA,CAAA,QAAA;;yBAEK,aAAA,CAAA,WAAA;;wBAED,aAAA,CAAA,WAAA;AAElB;;;AAGG;sBACa,aAAA,CAAA,WAAA;AAEhB;;;;AAIG;oBACW,aAAA,CAAA,WAAA,UAAA,WAAA;;wBAGI,aAAA,CAAA,WAAA;wBAEA,aAAA,CAAA,gBAAA,CAAA,kBAAA;yBACC,aAAA,CAAA,gBAAA,CAAA,QAAA;2BACE,aAAA,CAAA,gBAAA,CAAA,QAAA;yBACF,aAAA,CAAA,gBAAA,CAAA,QAAA;;oBAEL,aAAA,CAAA,gBAAA;AAEd;;;AAGG;0BACiB,aAAA,CAAA,WAAA,CAAA,GAAA;;yBAED,aAAA,CAAA,WAAA;;uBAEF,aAAA,CAAA,cAAA;AAEjB;AACA;2BAEqB,aAAA,CAAA,MAAA,CAAA,QAAA;;;;AA6BrB,iBAAa,QAAQ;;AAcrB;iBAIa,QAAQ;AAOrB;;AAKA;AAKA;AAEA;;;;AAIG;AACH,qBAAiB,aAAa,MAAM,QAAQ;;AA6B5C;;AAOA;;AAOA;;AAOA;AAQA;AAcA;oDA3LW,mBAAmB;sDAAnB,mBAAmB;AAiM/B;;;;","names":[]}
1
+ {"version":3,"file":"styloviz-tree-view.d.ts","names":[],"sources":["../../../../projects/tree-view-free/src/lib/tree-view.component.ts"],"mappings":";;UAmCiB;WACN;WACA;WACA;EACT,WAAW;WACF;WACA;WACA;;UAGM;WACN,MAAM;WACN;WACA;WACA;WACA;;UAGM;WACN,MAAM;WACN;;;;;;;;;;;;;;qBAsHE;;WAEF,+BAAK,YAAA;;;;;;;;;WASL,oCAAU;;WAEV,mCAAS;;;;;;;;;;WAUT,mCAAS;;;;;WAMT,iCAAO;;;;;;WAOP,+BAAK,qBAAA;;WAGL,mCAAS;;WAGT,mCAAS,iBAAA;;WAET,oCAAU,iBAAA;;WAEV,sCAAY,iBAAA;;WAEZ,oCAAU,iBAAA;;WAEV,+BAAK;;;;;WAML,qCAAW,YAAA;;WAEX,oCAAU;;WAEV,kCAAQ;mBAEA;mBACA;mBACA;;mBAEA;WAER,sCAAY,OAAA;;UAWb;;;UA4CA;;UAqBA;;;;;;;UAcA;EAkBR,OAAO,MAAM;;;;;;;;;;UAyBL;;EAkBR,WAAW;EAIX,OAAO,MAAM,UAAU;EAOvB,WAAW;;;;;;;;;;;mBAcM;EAOjB,aAAa;EAIb,UAAU;;;;;;EAOV,UAAU,OAAO,eAAe,IAAI,UAAU;;mBAyC7B;UAET;;UAWA;;UAOA;;UAOA;;;;;;;;;;;;;UAkBA;;;;;;;;UAeA;UAMA;UAYA;SA7XG,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAmB;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA"}