@cdevhub/ngx-tw 0.2.0 → 0.3.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.
Files changed (144) hide show
  1. package/README.md +264 -49
  2. package/fesm2022/cdevhub-ngx-tw-accordion.mjs +11 -7
  3. package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
  4. package/fesm2022/cdevhub-ngx-tw-alert.mjs +43 -29
  5. package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
  6. package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs +103 -0
  7. package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs.map +1 -0
  8. package/fesm2022/cdevhub-ngx-tw-avatar.mjs +56 -31
  9. package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
  10. package/fesm2022/cdevhub-ngx-tw-badge.mjs +61 -35
  11. package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
  12. package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +154 -93
  13. package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
  14. package/fesm2022/cdevhub-ngx-tw-button.mjs +35 -22
  15. package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
  16. package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +3 -3
  17. package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
  18. package/fesm2022/cdevhub-ngx-tw-calendar.mjs +416 -216
  19. package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
  20. package/fesm2022/cdevhub-ngx-tw-card.mjs +33 -24
  21. package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
  22. package/fesm2022/cdevhub-ngx-tw-carousel.mjs +152 -81
  23. package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
  24. package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +99 -47
  25. package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
  26. package/fesm2022/cdevhub-ngx-tw-code-block.mjs +42 -29
  27. package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
  28. package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +46 -29
  29. package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
  30. package/fesm2022/cdevhub-ngx-tw-combobox.mjs +205 -110
  31. package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
  32. package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +141 -74
  33. package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
  34. package/fesm2022/cdevhub-ngx-tw-core.mjs +16 -11
  35. package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
  36. package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +395 -149
  37. package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
  38. package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +305 -150
  39. package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
  40. package/fesm2022/cdevhub-ngx-tw-dialog.mjs +56 -43
  41. package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
  42. package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +51 -33
  43. package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
  44. package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +905 -0
  45. package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -0
  46. package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +49 -26
  47. package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
  48. package/fesm2022/cdevhub-ngx-tw-form-field.mjs +133 -74
  49. package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
  50. package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs +2 -2
  51. package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs.map +1 -1
  52. package/fesm2022/cdevhub-ngx-tw-icon.mjs +28 -17
  53. package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
  54. package/fesm2022/cdevhub-ngx-tw-input.mjs +37 -21
  55. package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
  56. package/fesm2022/cdevhub-ngx-tw-item.mjs +33 -24
  57. package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
  58. package/fesm2022/cdevhub-ngx-tw-menu.mjs +63 -48
  59. package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
  60. package/fesm2022/cdevhub-ngx-tw-number-input.mjs +622 -0
  61. package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -0
  62. package/fesm2022/cdevhub-ngx-tw-paginator.mjs +142 -72
  63. package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
  64. package/fesm2022/cdevhub-ngx-tw-popover.mjs +101 -46
  65. package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
  66. package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +57 -30
  67. package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
  68. package/fesm2022/cdevhub-ngx-tw-radio.mjs +108 -57
  69. package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
  70. package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +46 -26
  71. package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
  72. package/fesm2022/cdevhub-ngx-tw-select.mjs +227 -122
  73. package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
  74. package/fesm2022/cdevhub-ngx-tw-separator.mjs +21 -12
  75. package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -1
  76. package/fesm2022/cdevhub-ngx-tw-sheet.mjs +58 -44
  77. package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
  78. package/fesm2022/cdevhub-ngx-tw-skeleton.mjs +25 -14
  79. package/fesm2022/cdevhub-ngx-tw-skeleton.mjs.map +1 -1
  80. package/fesm2022/cdevhub-ngx-tw-slider.mjs +155 -79
  81. package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
  82. package/fesm2022/cdevhub-ngx-tw-sort.mjs +47 -25
  83. package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
  84. package/fesm2022/cdevhub-ngx-tw-spinner.mjs +29 -16
  85. package/fesm2022/cdevhub-ngx-tw-spinner.mjs.map +1 -1
  86. package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -42
  87. package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
  88. package/fesm2022/cdevhub-ngx-tw-stat.mjs +107 -64
  89. package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
  90. package/fesm2022/cdevhub-ngx-tw-stepper.mjs +113 -47
  91. package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
  92. package/fesm2022/cdevhub-ngx-tw-switch.mjs +61 -32
  93. package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
  94. package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +88 -42
  95. package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
  96. package/fesm2022/cdevhub-ngx-tw-table.mjs +266 -118
  97. package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
  98. package/fesm2022/cdevhub-ngx-tw-tabs.mjs +102 -52
  99. package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
  100. package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +798 -0
  101. package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -0
  102. package/fesm2022/cdevhub-ngx-tw-textarea.mjs +16 -8
  103. package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
  104. package/fesm2022/cdevhub-ngx-tw-theme.mjs +22 -14
  105. package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
  106. package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +243 -95
  107. package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
  108. package/fesm2022/cdevhub-ngx-tw-timeline.mjs +149 -82
  109. package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
  110. package/fesm2022/cdevhub-ngx-tw-toast.mjs +100 -55
  111. package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
  112. package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +50 -28
  113. package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
  114. package/fesm2022/cdevhub-ngx-tw-transfer.mjs +1129 -0
  115. package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -0
  116. package/fesm2022/cdevhub-ngx-tw-tree.mjs +554 -0
  117. package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -0
  118. package/fesm2022/cdevhub-ngx-tw.mjs +7 -0
  119. package/fesm2022/cdevhub-ngx-tw.mjs.map +1 -1
  120. package/package.json +45 -17
  121. package/theme/_dark.css +16 -12
  122. package/theme/_semantic.css +3 -2
  123. package/theme/index.css +10 -2
  124. package/types/cdevhub-ngx-tw-aspect-ratio.d.ts +40 -0
  125. package/types/cdevhub-ngx-tw-calendar.d.ts +39 -8
  126. package/types/cdevhub-ngx-tw-code-block.d.ts +8 -7
  127. package/types/cdevhub-ngx-tw-command-palette.d.ts +7 -0
  128. package/types/cdevhub-ngx-tw-date-picker.d.ts +36 -10
  129. package/types/cdevhub-ngx-tw-file-upload.d.ts +250 -0
  130. package/types/cdevhub-ngx-tw-form-field.d.ts +22 -3
  131. package/types/cdevhub-ngx-tw-icon-lucide.d.ts +21 -3
  132. package/types/cdevhub-ngx-tw-number-input.d.ts +130 -0
  133. package/types/cdevhub-ngx-tw-popover.d.ts +8 -0
  134. package/types/cdevhub-ngx-tw-select.d.ts +1 -1
  135. package/types/cdevhub-ngx-tw-stepper.d.ts +30 -2
  136. package/types/cdevhub-ngx-tw-tab-nav.d.ts +8 -0
  137. package/types/cdevhub-ngx-tw-table.d.ts +30 -1
  138. package/types/cdevhub-ngx-tw-tabs.d.ts +8 -0
  139. package/types/cdevhub-ngx-tw-tags-input.d.ts +217 -0
  140. package/types/cdevhub-ngx-tw-time-picker.d.ts +31 -6
  141. package/types/cdevhub-ngx-tw-toast.d.ts +1 -1
  142. package/types/cdevhub-ngx-tw-transfer.d.ts +330 -0
  143. package/types/cdevhub-ngx-tw-tree.d.ts +189 -0
  144. package/types/cdevhub-ngx-tw.d.ts +7 -0
@@ -0,0 +1,554 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, TemplateRef, Directive, input, model, output, contentChild, viewChild, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import * as i1 from '@angular/cdk/tree';
5
+ import { CdkTreeModule } from '@angular/cdk/tree';
6
+ import { tv } from 'tailwind-variants';
7
+
8
+ /*
9
+ * tw-tree — hierarchical, keyboard-navigable tree-view wrapping Angular CDK's
10
+ * `CdkTree` (children-accessor model). CDK owns flattening, the expansion model,
11
+ * ARIA wiring (`role="tree"`/`"treeitem"`, `aria-level`/`-setsize`/`-posinset`/
12
+ * `-expanded`) and roving-tabindex keyboard navigation; this component owns the
13
+ * row wrapper, per-level indentation, optional connector lines, optional
14
+ * (consumer-rendered) selection, and a typed per-node template context.
15
+ *
16
+ * Architecture decisions (verified against @angular/cdk 21.2.x source):
17
+ * - Children-accessor render path only. `treeControl` / `FlatTreeControl` /
18
+ * `NestedTreeControl` are @deprecated in CDK v21 and are NOT used. Flat
19
+ * `cdk-tree-node` + a single `*cdkTreeNodeDef` (not `cdkNestedTreeNode`).
20
+ * - `[isExpandable]` MUST be bound per node. Without a `treeControl`,
21
+ * `CdkTreeNode._isExpandable()` returns the `isExpandable` *input* (default
22
+ * `false`); unbound, branches get no `aria-expanded`, `expand()/collapse()`
23
+ * no-op, and arrow-key expansion is dead. We bind it from `hasChildren(node)`.
24
+ * - `CdkTreeNode.isLeafNode` is unusable here: with no `treeControl` its getter
25
+ * short-circuits the optional-chain to `undefined` and returns `false` for
26
+ * EVERY node (silently — no throw). We compute `hasChildren` ourselves.
27
+ * - Selection is OURS, not CDK tree's (CDK's model is expansion-only). It lives
28
+ * in a `signal<ReadonlySet<unknown>>` of node keys — a signal (not CDK's
29
+ * `SelectionModel`) so it integrates with OnPush + `computed()` without
30
+ * bridging an RxJS `changed` stream. NOT a form control (no CVA).
31
+ * - Expansion is bidirectionally synced with the `expandedKeys` model:
32
+ * model→CDK via a guarded `effect()` (CDK's `select`/`deselect` are
33
+ * idempotent → settles in one tick); CDK→model via each node's
34
+ * `(expandedChange)` output with compare-before-write (no signal cycle).
35
+ */
36
+ // ── Resolved-default constants ───────────────────────────────────────
37
+ const SELECTION_DEFAULTS = {
38
+ mode: 'none',
39
+ cascade: true,
40
+ initialKeys: [],
41
+ };
42
+ const DISPLAY_DEFAULTS = {
43
+ size: 'md',
44
+ indent: 16,
45
+ showLines: false,
46
+ };
47
+ // ── tv() config ──────────────────────────────────────────────────────
48
+ //
49
+ // Indentation is rendered with one spacer span per ancestor level (width =
50
+ // `indent` px) rather than a single inline `padding-left`: this avoids an
51
+ // inline-style-vs-class left-padding conflict and lets `showLines` draw a
52
+ // per-level vertical guide (`border-s` on each stretched spacer) instead of a
53
+ // single root rail. `items-stretch` on the row makes spacers span the full row
54
+ // height so guides connect across stacked rows; the content wrapper re-centers
55
+ // the projected template vertically.
56
+ const treeVariants = tv({
57
+ slots: {
58
+ root: 'block',
59
+ node: 'group/node flex items-stretch rounded-md cursor-pointer select-none text-sm text-fg pe-2 transition-colors duration-200 motion-reduce:transition-none hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',
60
+ spacer: 'shrink-0 self-stretch',
61
+ content: 'flex items-center gap-1.5 min-w-0 flex-1',
62
+ },
63
+ variants: {
64
+ size: {
65
+ xs: { content: 'py-0' },
66
+ sm: { content: 'py-0.5' },
67
+ md: { content: 'py-1' },
68
+ lg: { content: 'py-1.5' },
69
+ xl: { content: 'py-2' },
70
+ },
71
+ selected: {
72
+ true: { node: 'bg-primary-50 text-primary-700 hover:bg-primary-50' },
73
+ false: {},
74
+ },
75
+ lines: {
76
+ true: { spacer: 'border-s border-border' },
77
+ false: {},
78
+ },
79
+ },
80
+ defaultVariants: {
81
+ size: 'md',
82
+ selected: false,
83
+ lines: false,
84
+ },
85
+ }, { twMerge: true });
86
+ // ── TreeNodeDefDirective ─────────────────────────────────────────────
87
+ //
88
+ // Pure TemplateRef carrier for the consumer's per-node template. Mirrors
89
+ // table's `CellDefDirective`: a typed context + `ngTemplateContextGuard` so
90
+ // `let-node` / `let-expanded="expanded"` etc. type-check inside the template.
91
+ /** Structural directive (`*twTreeNode="let node"`) declaring the per-node template. Typed as `TwTreeNodeContext<T>`. */
92
+ class TreeNodeDefDirective {
93
+ /** @internal Consumer-projected per-node template. */
94
+ template = inject((TemplateRef));
95
+ /** @internal */
96
+ static ngTemplateContextGuard(_dir, _ctx) {
97
+ return true;
98
+ }
99
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TreeNodeDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
100
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: TreeNodeDefDirective, isStandalone: true, selector: "[twTreeNode]", ngImport: i0 });
101
+ }
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TreeNodeDefDirective, decorators: [{
103
+ type: Directive,
104
+ args: [{ selector: '[twTreeNode]' }]
105
+ }] });
106
+ // ── TreeComponent ────────────────────────────────────────────────────
107
+ /**
108
+ * A hierarchical, keyboard-navigable tree-view wrapping `@angular/cdk/tree`
109
+ * (children-accessor model). Consumers supply the per-node template via the
110
+ * `*twTreeNode` structural directive and receive a typed context exposing the
111
+ * node, its depth/expansion/children flags, its selection state, and action
112
+ * functions (`toggle`, `expand`, `collapse`, `toggleSelection`).
113
+ *
114
+ * Selection is optional and managed internally (`'none' | 'single' | 'multiple'`).
115
+ * In `'multiple'` mode with `cascade`, selecting a branch selects all its leaf
116
+ * descendants and the branch reports `'indeterminate'` when partially selected.
117
+ * This is NOT a form control — selection is exposed via the `selectionChange`
118
+ * output and the public `toggleSelection` / `selectionState` methods.
119
+ */
120
+ class TreeComponent {
121
+ // ── Inputs (5 — at the cap, do not add more) ──
122
+ /** Root nodes of the tree. Each node's children are resolved via `childrenAccessor`. Defaults to `[]`. */
123
+ data = input([], /* @ts-ignore */
124
+ ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
125
+ /** Resolves a node's direct children; return an empty array for leaf nodes. Required. */
126
+ childrenAccessor = input.required(/* @ts-ignore */
127
+ ...(ngDevMode ? [{ debugName: "childrenAccessor" }] : /* istanbul ignore next */ []));
128
+ /** Identifies a node across data changes and keys both expansion and selection state. When unset, node identity is used. */
129
+ trackBy = input(/* @ts-ignore */
130
+ ...(ngDevMode ? [undefined, { debugName: "trackBy" }] : /* istanbul ignore next */ []));
131
+ /** Node-selection behavior — `mode`, `cascade`, `initialKeys`. Accepts a partial; unset keys fall back to the defaults. Defaults to selection disabled. */
132
+ selection = input({}, /* @ts-ignore */
133
+ ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
134
+ /** Display configuration — `size`, `indent`, `showLines`. Accepts a partial; unset keys fall back to the defaults. */
135
+ display = input({}, /* @ts-ignore */
136
+ ...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
137
+ // ── Model (two-way) ──
138
+ /** Two-way bound list of expansion key values (resolved via `trackBy`) for currently-expanded nodes. Set a new array on every change; do not mutate in place. Changes when a node is expanded or collapsed. Defaults to `[]` (all collapsed). */
139
+ expandedKeys = model([], /* @ts-ignore */
140
+ ...(ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []));
141
+ // ── Outputs ──
142
+ /** Fires after the selection changes by user interaction. Payload is every node whose `selectionState` is `'checked'` (selected leaves plus fully-checked branches in cascade mode). */
143
+ selectionChange = output();
144
+ /** Fires after a node is expanded or collapsed by user interaction. Payload identifies the node and its new expansion state. */
145
+ expandedChange = output();
146
+ // ── Content / view queries ──
147
+ /** @internal Consumer-projected per-node template (`*twTreeNode`). */
148
+ nodeTemplate = contentChild((TreeNodeDefDirective), /* @ts-ignore */
149
+ ...(ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []));
150
+ /** @internal The CDK tree inside our view. */
151
+ cdkTree = viewChild.required('cdkTreeRef', /* @ts-ignore */
152
+ ...(ngDevMode ? [{ debugName: "cdkTree" }] : /* istanbul ignore next */ []));
153
+ // ── Internal selection state ──
154
+ /** @internal Selected node keys. In cascade mode this holds leaf keys only; branch state is derived. */
155
+ selectedKeys = signal(new Set(), /* @ts-ignore */
156
+ ...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
157
+ /** @internal One-shot guard so `initialKeys` seeds selection exactly once. */
158
+ seeded = false;
159
+ // ── Resolved config ──
160
+ /** @internal Resolved selection configuration. */
161
+ resolvedSelection = computed(() => ({
162
+ ...SELECTION_DEFAULTS,
163
+ ...this.selection(),
164
+ }), /* @ts-ignore */
165
+ ...(ngDevMode ? [{ debugName: "resolvedSelection" }] : /* istanbul ignore next */ []));
166
+ /** @internal Resolved display configuration. */
167
+ resolvedDisplay = computed(() => ({
168
+ ...DISPLAY_DEFAULTS,
169
+ ...this.display(),
170
+ }), /* @ts-ignore */
171
+ ...(ngDevMode ? [{ debugName: "resolvedDisplay" }] : /* istanbul ignore next */ []));
172
+ /** @internal Indentation width in px per level. */
173
+ indentWidth = computed(() => this.resolvedDisplay().indent, /* @ts-ignore */
174
+ ...(ngDevMode ? [{ debugName: "indentWidth" }] : /* istanbul ignore next */ []));
175
+ /** @internal Snapshot of the root nodes as a mutable array (CDK's `dataSource` rejects `readonly T[]`). */
176
+ dataArray = computed(() => [...this.data()], /* @ts-ignore */
177
+ ...(ngDevMode ? [{ debugName: "dataArray" }] : /* istanbul ignore next */ []));
178
+ // ── Variant class outputs ──
179
+ variants = computed(() => treeVariants({
180
+ size: this.resolvedDisplay().size,
181
+ lines: this.resolvedDisplay().showLines,
182
+ }), /* @ts-ignore */
183
+ ...(ngDevMode ? [{ debugName: "variants" }] : /* istanbul ignore next */ []));
184
+ rootClasses = computed(() => this.variants().root(), /* @ts-ignore */
185
+ ...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
186
+ spacerClasses = computed(() => this.variants().spacer(), /* @ts-ignore */
187
+ ...(ngDevMode ? [{ debugName: "spacerClasses" }] : /* istanbul ignore next */ []));
188
+ contentClasses = computed(() => this.variants().content(), /* @ts-ignore */
189
+ ...(ngDevMode ? [{ debugName: "contentClasses" }] : /* istanbul ignore next */ []));
190
+ constructor() {
191
+ // Seed selection from `initialKeys` exactly once — the first time selection
192
+ // is enabled (`mode !== 'none'`), so the seed survives a config that arrives
193
+ // after the initial change-detection pass. Reads `selection()` (tracked) and
194
+ // writes `selectedKeys` (untracked, and never track-read here) → no cycle.
195
+ effect(() => {
196
+ const config = this.resolvedSelection();
197
+ if (this.seeded || config.mode === 'none')
198
+ return;
199
+ this.seeded = true;
200
+ untracked(() => this.selectedKeys.set(new Set(config.initialKeys)));
201
+ });
202
+ // model → CDK expansion sync. Reads `expandedKeys()` / `data()` /
203
+ // `childrenAccessor()` (tracked) and writes ONLY to CDK's expansion model
204
+ // (`expand`/`collapse` are idempotent — they `select`/`deselect` a key and
205
+ // no-op when unchanged), never to a tracked signal → settles in one tick.
206
+ effect(() => {
207
+ const tree = this.cdkTree();
208
+ const wanted = new Set(this.expandedKeys());
209
+ const all = this.flattenAll();
210
+ if (!tree)
211
+ return;
212
+ untracked(() => {
213
+ for (const node of all) {
214
+ const key = this.keyOf(node);
215
+ const isOpen = tree.isExpanded(node);
216
+ if (wanted.has(key) && !isOpen)
217
+ tree.expand(node);
218
+ else if (!wanted.has(key) && isOpen)
219
+ tree.collapse(node);
220
+ }
221
+ });
222
+ });
223
+ }
224
+ // ── Key + traversal helpers ──
225
+ /** @internal Resolves a node's identity key via `trackBy`, falling back to the node itself. */
226
+ keyOf(node) {
227
+ const tb = this.trackBy();
228
+ return tb ? tb(node) : node;
229
+ }
230
+ /** @internal Direct children of a node (always a fresh mutable array). */
231
+ childrenOf(node) {
232
+ return this.childrenAccessor()(node);
233
+ }
234
+ /** Whether the node has at least one child (is a branch). */
235
+ hasChildren(node) {
236
+ return this.childrenOf(node).length > 0;
237
+ }
238
+ /** @internal Depth-first list of every node in the tree (under collapsed parents too). */
239
+ flattenAll() {
240
+ const out = [];
241
+ const walk = (nodes) => {
242
+ for (const n of nodes) {
243
+ out.push(n);
244
+ walk(this.childrenOf(n));
245
+ }
246
+ };
247
+ walk(this.data());
248
+ return out;
249
+ }
250
+ /** @internal All leaf descendants of a node (the node itself if it is a leaf). */
251
+ leavesOf(node) {
252
+ const out = [];
253
+ const walk = (n) => {
254
+ const children = this.childrenOf(n);
255
+ if (children.length === 0) {
256
+ out.push(n);
257
+ return;
258
+ }
259
+ for (const child of children)
260
+ walk(child);
261
+ };
262
+ walk(node);
263
+ return out;
264
+ }
265
+ // ── Template helpers ──
266
+ /** @internal Array of length `level` used to render per-level indent spacers. */
267
+ indentMarkers(level) {
268
+ return level > 0 ? Array.from({ length: level }) : [];
269
+ }
270
+ /** @internal Per-node row classes (incorporates the selected state). */
271
+ nodeClasses(node) {
272
+ return treeVariants({
273
+ size: this.resolvedDisplay().size,
274
+ lines: this.resolvedDisplay().showLines,
275
+ selected: this.selectionState(node) === 'checked',
276
+ }).node();
277
+ }
278
+ /** @internal Builds the typed context handed to the consumer's `*twTreeNode` template. */
279
+ buildContext(node, level) {
280
+ return {
281
+ $implicit: node,
282
+ node,
283
+ level,
284
+ expanded: this.isExpanded(node),
285
+ hasChildren: this.hasChildren(node),
286
+ selectionState: this.selectionState(node),
287
+ toggle: () => this.toggle(node),
288
+ expand: () => this.expand(node),
289
+ collapse: () => this.collapse(node),
290
+ toggleSelection: () => this.toggleSelection(node),
291
+ };
292
+ }
293
+ /**
294
+ * @internal `aria-selected` for `'single'` mode (boolean selection), or `null`
295
+ * otherwise. Multiple mode uses `aria-checked` instead so the tri-state
296
+ * `'mixed'` value is exposed to assistive tech on the focusable treeitem.
297
+ */
298
+ ariaSelected(node) {
299
+ if (this.resolvedSelection().mode !== 'single')
300
+ return null;
301
+ return this.selectionState(node) === 'checked' ? 'true' : 'false';
302
+ }
303
+ /**
304
+ * @internal Tri-state `aria-checked` for `'multiple'` mode (`'mixed'` for a
305
+ * partially-selected branch), or `null` otherwise. APG exposes checkbox-tree
306
+ * selection on the treeitem via `aria-checked`; `aria-selected` cannot carry
307
+ * the indeterminate state.
308
+ */
309
+ ariaChecked(node) {
310
+ if (this.resolvedSelection().mode !== 'multiple')
311
+ return null;
312
+ const state = this.selectionState(node);
313
+ if (state === 'checked')
314
+ return 'true';
315
+ if (state === 'indeterminate')
316
+ return 'mixed';
317
+ return 'false';
318
+ }
319
+ // ── CDK boundary adapters (stable arrow fields) ──
320
+ /** @internal Adapts the consumer's `readonly`-returning accessor to CDK's mutable-array contract. */
321
+ cdkChildrenAccessor = (node) => [...this.childrenOf(node)];
322
+ /** @internal CDK row-tracking function keyed via `trackBy`. */
323
+ cdkTrackBy = (_index, node) => this.keyOf(node);
324
+ /** @internal Keys CDK's expansion model via `trackBy`. */
325
+ cdkExpansionKey = (node) => this.keyOf(node);
326
+ // ── Expansion ──
327
+ /** Whether the node is currently expanded. */
328
+ isExpanded(node) {
329
+ return this.cdkTree().isExpanded(node);
330
+ }
331
+ /** Expands the node if collapsed. Emits `expandedChange` and updates `expandedKeys` via the CDK callback. */
332
+ expand(node) {
333
+ this.cdkTree().expand(node);
334
+ }
335
+ /** Collapses the node if expanded. Emits `expandedChange` and updates `expandedKeys` via the CDK callback. */
336
+ collapse(node) {
337
+ this.cdkTree().collapse(node);
338
+ }
339
+ /** Toggles the node's expand/collapse state. No-op on leaf nodes. */
340
+ toggle(node) {
341
+ if (!this.hasChildren(node))
342
+ return;
343
+ this.cdkTree().toggle(node);
344
+ }
345
+ /**
346
+ * @internal Bridges CDK's per-node `(expandedChange)` to the `expandedKeys`
347
+ * model. Compare-before-write: only mutates the model and emits when the
348
+ * key's membership actually changes, so the model→CDK effect cannot loop.
349
+ */
350
+ onCdkExpandedChange(node, expanded) {
351
+ const key = this.keyOf(node);
352
+ const current = new Set(this.expandedKeys());
353
+ const has = current.has(key);
354
+ if (expanded && !has) {
355
+ current.add(key);
356
+ this.expandedKeys.set([...current]);
357
+ this.expandedChange.emit({ node, expanded: true });
358
+ }
359
+ else if (!expanded && has) {
360
+ current.delete(key);
361
+ this.expandedKeys.set([...current]);
362
+ this.expandedChange.emit({ node, expanded: false });
363
+ }
364
+ }
365
+ // ── Selection ──
366
+ /**
367
+ * Returns the tri-state selection status of a node. `'unchecked'` when
368
+ * selection is disabled.
369
+ *
370
+ * For cascade branches this walks the node's leaf descendants on each call and
371
+ * is invoked a few times per node per change-detection pass (row class, ARIA,
372
+ * context). This assumes small-to-medium trees; the component has no
373
+ * virtualization and is not tuned for very large data sets.
374
+ */
375
+ selectionState(node) {
376
+ const mode = this.resolvedSelection().mode;
377
+ if (mode === 'none')
378
+ return 'unchecked';
379
+ const selected = this.selectedKeys();
380
+ if (mode === 'single') {
381
+ return selected.has(this.keyOf(node)) ? 'checked' : 'unchecked';
382
+ }
383
+ // multiple
384
+ if (!this.resolvedSelection().cascade || !this.hasChildren(node)) {
385
+ return selected.has(this.keyOf(node)) ? 'checked' : 'unchecked';
386
+ }
387
+ // cascade branch: derive from leaf descendants
388
+ const leaves = this.leavesOf(node);
389
+ if (leaves.length === 0)
390
+ return 'unchecked';
391
+ let selectedCount = 0;
392
+ for (const leaf of leaves) {
393
+ if (selected.has(this.keyOf(leaf)))
394
+ selectedCount++;
395
+ }
396
+ if (selectedCount === 0)
397
+ return 'unchecked';
398
+ if (selectedCount === leaves.length)
399
+ return 'checked';
400
+ return 'indeterminate';
401
+ }
402
+ /** Toggles selection for a node (cascades to leaf descendants in `'multiple'` mode with `cascade` on). No-op when `selection.mode === 'none'`. */
403
+ toggleSelection(node) {
404
+ const config = this.resolvedSelection();
405
+ if (config.mode === 'none')
406
+ return;
407
+ const next = new Set(this.selectedKeys());
408
+ const key = this.keyOf(node);
409
+ if (config.mode === 'single') {
410
+ const wasSelected = next.has(key);
411
+ next.clear();
412
+ if (!wasSelected)
413
+ next.add(key);
414
+ }
415
+ else if (!config.cascade || !this.hasChildren(node)) {
416
+ if (next.has(key))
417
+ next.delete(key);
418
+ else
419
+ next.add(key);
420
+ }
421
+ else {
422
+ // cascade branch: select all leaf descendants unless already fully checked
423
+ const fullyChecked = this.selectionState(node) === 'checked';
424
+ for (const leaf of this.leavesOf(node)) {
425
+ const leafKey = this.keyOf(leaf);
426
+ if (fullyChecked)
427
+ next.delete(leafKey);
428
+ else
429
+ next.add(leafKey);
430
+ }
431
+ }
432
+ this.selectedKeys.set(next);
433
+ this.selectionChange.emit(this.selectedNodes());
434
+ }
435
+ /** @internal Every node currently reporting `selectionState() === 'checked'`. */
436
+ selectedNodes() {
437
+ if (this.resolvedSelection().mode === 'none')
438
+ return [];
439
+ return this.flattenAll().filter((node) => this.selectionState(node) === 'checked');
440
+ }
441
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
442
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: TreeComponent, isStandalone: true, selector: "tw-tree", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, childrenAccessor: { classPropertyName: "childrenAccessor", publicName: "childrenAccessor", isSignal: true, isRequired: true, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, expandedKeys: { classPropertyName: "expandedKeys", publicName: "expandedKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedKeys: "expandedKeysChange", selectionChange: "selectionChange", expandedChange: "expandedChange" }, host: { properties: { "class": "rootClasses()" } }, queries: [{ propertyName: "nodeTemplate", first: true, predicate: (TreeNodeDefDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "cdkTree", first: true, predicate: ["cdkTreeRef"], descendants: true, isSignal: true }], exportAs: ["twTree"], ngImport: i0, template: `
443
+ <cdk-tree
444
+ #cdkTreeRef
445
+ role="tree"
446
+ [dataSource]="dataArray()"
447
+ [childrenAccessor]="cdkChildrenAccessor"
448
+ [trackBy]="cdkTrackBy"
449
+ [expansionKey]="cdkExpansionKey"
450
+ >
451
+ <cdk-tree-node
452
+ *cdkTreeNodeDef="let node"
453
+ #treeNode="cdkTreeNode"
454
+ [class]="nodeClasses(node)"
455
+ [isExpandable]="hasChildren(node)"
456
+ [attr.aria-selected]="ariaSelected(node)"
457
+ [attr.aria-checked]="ariaChecked(node)"
458
+ (activation)="toggleSelection(node)"
459
+ (expandedChange)="onCdkExpandedChange(node, $event)"
460
+ >
461
+ @for (marker of indentMarkers(treeNode.level); track $index) {
462
+ <span [class]="spacerClasses()" [style.width.px]="indentWidth()"></span>
463
+ }
464
+ <span [class]="contentClasses()">
465
+ <ng-container
466
+ [ngTemplateOutlet]="nodeTemplate()?.template ?? null"
467
+ [ngTemplateOutletContext]="buildContext(node, treeNode.level)"
468
+ />
469
+ </span>
470
+ </cdk-tree-node>
471
+ </cdk-tree>
472
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CdkTreeModule }, { kind: "directive", type: i1.CdkTreeNodeDef, selector: "[cdkTreeNodeDef]", inputs: ["cdkTreeNodeDefWhen"] }, { kind: "component", type: i1.CdkTree, selector: "cdk-tree", inputs: ["dataSource", "treeControl", "levelAccessor", "childrenAccessor", "trackBy", "expansionKey"], exportAs: ["cdkTree"] }, { kind: "directive", type: i1.CdkTreeNode, selector: "cdk-tree-node", inputs: ["role", "isExpandable", "isExpanded", "isDisabled", "cdkTreeNodeTypeaheadLabel"], outputs: ["activation", "expandedChange"], exportAs: ["cdkTreeNode"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
473
+ }
474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TreeComponent, decorators: [{
475
+ type: Component,
476
+ args: [{
477
+ selector: 'tw-tree',
478
+ exportAs: 'twTree',
479
+ changeDetection: ChangeDetectionStrategy.OnPush,
480
+ imports: [CdkTreeModule, NgTemplateOutlet],
481
+ host: {
482
+ '[class]': 'rootClasses()',
483
+ },
484
+ template: `
485
+ <cdk-tree
486
+ #cdkTreeRef
487
+ role="tree"
488
+ [dataSource]="dataArray()"
489
+ [childrenAccessor]="cdkChildrenAccessor"
490
+ [trackBy]="cdkTrackBy"
491
+ [expansionKey]="cdkExpansionKey"
492
+ >
493
+ <cdk-tree-node
494
+ *cdkTreeNodeDef="let node"
495
+ #treeNode="cdkTreeNode"
496
+ [class]="nodeClasses(node)"
497
+ [isExpandable]="hasChildren(node)"
498
+ [attr.aria-selected]="ariaSelected(node)"
499
+ [attr.aria-checked]="ariaChecked(node)"
500
+ (activation)="toggleSelection(node)"
501
+ (expandedChange)="onCdkExpandedChange(node, $event)"
502
+ >
503
+ @for (marker of indentMarkers(treeNode.level); track $index) {
504
+ <span [class]="spacerClasses()" [style.width.px]="indentWidth()"></span>
505
+ }
506
+ <span [class]="contentClasses()">
507
+ <ng-container
508
+ [ngTemplateOutlet]="nodeTemplate()?.template ?? null"
509
+ [ngTemplateOutletContext]="buildContext(node, treeNode.level)"
510
+ />
511
+ </span>
512
+ </cdk-tree-node>
513
+ </cdk-tree>
514
+ `,
515
+ }]
516
+ }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], childrenAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "childrenAccessor", required: true }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], display: [{ type: i0.Input, args: [{ isSignal: true, alias: "display", required: false }] }], expandedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedKeys", required: false }] }, { type: i0.Output, args: ["expandedKeysChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }], nodeTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TreeNodeDefDirective), { isSignal: true }] }], cdkTree: [{ type: i0.ViewChild, args: ['cdkTreeRef', { isSignal: true }] }] } });
517
+ // ── TreeNodeToggleDirective ──────────────────────────────────────────
518
+ //
519
+ // Optional low-ceremony toggle: `<button twTreeNodeToggle [twTreeNodeToggle]="node">`.
520
+ // It injects the host `TreeComponent` (an ancestor at the consumer's declaration
521
+ // site) and calls `tree.toggle(node)` on click. It deliberately does NOT extend
522
+ // CDK's `CdkTreeNodeToggle`, which injects `CdkTreeNode` — that node lives inside
523
+ // TreeComponent's own view and is unreachable from a projected `*twTreeNode`
524
+ // template (DI resolves at the declaration site, not the insertion site). For
525
+ // most cases the context `toggle()` function is simpler.
526
+ /** Attribute directive (`[twTreeNodeToggle]="node"`) that toggles the given node's expansion on click. */
527
+ class TreeNodeToggleDirective {
528
+ tree = inject((TreeComponent));
529
+ /** The node whose expansion this control toggles. */
530
+ node = input.required({ ...(ngDevMode ? { debugName: "node" } : /* istanbul ignore next */ {}), alias: 'twTreeNodeToggle' });
531
+ /** @internal Toggles the node and stops the click from bubbling to row activation. */
532
+ onClick(event) {
533
+ event.stopPropagation();
534
+ this.tree.toggle(this.node());
535
+ }
536
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TreeNodeToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
537
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: TreeNodeToggleDirective, isStandalone: true, selector: "[twTreeNodeToggle]", inputs: { node: { classPropertyName: "node", publicName: "twTreeNodeToggle", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
538
+ }
539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TreeNodeToggleDirective, decorators: [{
540
+ type: Directive,
541
+ args: [{
542
+ selector: '[twTreeNodeToggle]',
543
+ host: {
544
+ '(click)': 'onClick($event)',
545
+ },
546
+ }]
547
+ }], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "twTreeNodeToggle", required: true }] }] } });
548
+
549
+ /**
550
+ * Generated bundle index. Do not edit.
551
+ */
552
+
553
+ export { TreeComponent, TreeNodeDefDirective, TreeNodeToggleDirective };
554
+ //# sourceMappingURL=cdevhub-ngx-tw-tree.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdevhub-ngx-tw-tree.mjs","sources":["../../../projects/ngx-tw/tree/tree.ts","../../../projects/ngx-tw/tree/cdevhub-ngx-tw-tree.ts"],"sourcesContent":["/*\n * tw-tree — hierarchical, keyboard-navigable tree-view wrapping Angular CDK's\n * `CdkTree` (children-accessor model). CDK owns flattening, the expansion model,\n * ARIA wiring (`role=\"tree\"`/`\"treeitem\"`, `aria-level`/`-setsize`/`-posinset`/\n * `-expanded`) and roving-tabindex keyboard navigation; this component owns the\n * row wrapper, per-level indentation, optional connector lines, optional\n * (consumer-rendered) selection, and a typed per-node template context.\n *\n * Architecture decisions (verified against @angular/cdk 21.2.x source):\n * - Children-accessor render path only. `treeControl` / `FlatTreeControl` /\n * `NestedTreeControl` are @deprecated in CDK v21 and are NOT used. Flat\n * `cdk-tree-node` + a single `*cdkTreeNodeDef` (not `cdkNestedTreeNode`).\n * - `[isExpandable]` MUST be bound per node. Without a `treeControl`,\n * `CdkTreeNode._isExpandable()` returns the `isExpandable` *input* (default\n * `false`); unbound, branches get no `aria-expanded`, `expand()/collapse()`\n * no-op, and arrow-key expansion is dead. We bind it from `hasChildren(node)`.\n * - `CdkTreeNode.isLeafNode` is unusable here: with no `treeControl` its getter\n * short-circuits the optional-chain to `undefined` and returns `false` for\n * EVERY node (silently — no throw). We compute `hasChildren` ourselves.\n * - Selection is OURS, not CDK tree's (CDK's model is expansion-only). It lives\n * in a `signal<ReadonlySet<unknown>>` of node keys — a signal (not CDK's\n * `SelectionModel`) so it integrates with OnPush + `computed()` without\n * bridging an RxJS `changed` stream. NOT a form control (no CVA).\n * - Expansion is bidirectionally synced with the `expandedKeys` model:\n * model→CDK via a guarded `effect()` (CDK's `select`/`deselect` are\n * idempotent → settles in one tick); CDK→model via each node's\n * `(expandedChange)` output with compare-before-write (no signal cycle).\n */\n\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n TemplateRef,\n type TrackByFunction,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { type CdkTree, CdkTreeModule } from '@angular/cdk/tree';\nimport { tv } from 'tailwind-variants';\nimport type { TwSize } from '@cdevhub/ngx-tw/core';\n\n// ── Public types ─────────────────────────────────────────────────────\n\n/** Tri-state selection status of a tree node. */\nexport type TwTreeSelectionState = 'checked' | 'unchecked' | 'indeterminate';\n\n/** Configuration for node selection behavior. Pass any subset; unset keys fall back to the defaults. */\nexport interface TwTreeSelectionConfig {\n /** Selection mode. `'single'` is scalar (one node, no cascade/indeterminate); `'multiple'` supports cascade + tri-state. `'none'` disables selection. Defaults to `'none'`. */\n mode: 'none' | 'single' | 'multiple';\n /** In `'multiple'` mode, selecting a branch selects all its leaf descendants and a branch renders `'indeterminate'` when only some are selected. Ignored in `'single'`/`'none'`. Defaults to `true`. */\n cascade?: boolean;\n /** Pre-selected node keys (matched via `trackBy`). In cascade mode these are leaf-node keys. Defaults to `[]`. */\n initialKeys?: readonly unknown[];\n}\n\n/** Display configuration for the tree. Pass any subset; unset keys fall back to the defaults. */\nexport interface TwTreeDisplayConfig {\n /** Row vertical density. Defaults to `'md'`. */\n size?: TwSize;\n /** Indentation per level, in pixels. Defaults to `16`. */\n indent?: number;\n /** Render connecting guide lines down the indent gutter. Defaults to `false`. */\n showLines?: boolean;\n}\n\n/** Context surfaced to a `*twTreeNode` template. Generic over the node type `T`. */\nexport interface TwTreeNodeContext<T> {\n /** The node data (implicit `let-node`). */\n $implicit: T;\n /** The node data, aliased for readability. */\n node: T;\n /** Zero-based depth of the node. */\n level: number;\n /** Whether the node is currently expanded. Always `false` for leaf nodes. */\n expanded: boolean;\n /** Whether the node has children (is a branch, not a leaf). */\n hasChildren: boolean;\n /** Tri-state selection status of this node. `'unchecked'` when selection is disabled. */\n selectionState: TwTreeSelectionState;\n /** Toggles this node's expand/collapse state. No-op on leaf nodes. */\n toggle: () => void;\n /** Expands this node. No-op on leaf nodes or when already expanded. */\n expand: () => void;\n /** Collapses this node. No-op when already collapsed. */\n collapse: () => void;\n /** Toggles this node's selection (cascades in `'multiple'` mode with `cascade` on). No-op when selection is disabled. */\n toggleSelection: () => void;\n}\n\n// ── Resolved-default constants ───────────────────────────────────────\n\nconst SELECTION_DEFAULTS: Required<TwTreeSelectionConfig> = {\n mode: 'none',\n cascade: true,\n initialKeys: [],\n};\n\nconst DISPLAY_DEFAULTS: Required<TwTreeDisplayConfig> = {\n size: 'md',\n indent: 16,\n showLines: false,\n};\n\n// ── tv() config ──────────────────────────────────────────────────────\n//\n// Indentation is rendered with one spacer span per ancestor level (width =\n// `indent` px) rather than a single inline `padding-left`: this avoids an\n// inline-style-vs-class left-padding conflict and lets `showLines` draw a\n// per-level vertical guide (`border-s` on each stretched spacer) instead of a\n// single root rail. `items-stretch` on the row makes spacers span the full row\n// height so guides connect across stacked rows; the content wrapper re-centers\n// the projected template vertically.\n\nconst treeVariants = tv(\n {\n slots: {\n root: 'block',\n node: 'group/node flex items-stretch rounded-md cursor-pointer select-none text-sm text-fg pe-2 transition-colors duration-200 motion-reduce:transition-none hover:bg-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n spacer: 'shrink-0 self-stretch',\n content: 'flex items-center gap-1.5 min-w-0 flex-1',\n },\n variants: {\n size: {\n xs: { content: 'py-0' },\n sm: { content: 'py-0.5' },\n md: { content: 'py-1' },\n lg: { content: 'py-1.5' },\n xl: { content: 'py-2' },\n },\n selected: {\n true: { node: 'bg-primary-50 text-primary-700 hover:bg-primary-50' },\n false: {},\n },\n lines: {\n true: { spacer: 'border-s border-border' },\n false: {},\n },\n },\n defaultVariants: {\n size: 'md',\n selected: false,\n lines: false,\n },\n },\n { twMerge: true },\n);\n\n// ── TreeNodeDefDirective ─────────────────────────────────────────────\n//\n// Pure TemplateRef carrier for the consumer's per-node template. Mirrors\n// table's `CellDefDirective`: a typed context + `ngTemplateContextGuard` so\n// `let-node` / `let-expanded=\"expanded\"` etc. type-check inside the template.\n\n/** Structural directive (`*twTreeNode=\"let node\"`) declaring the per-node template. Typed as `TwTreeNodeContext<T>`. */\n@Directive({ selector: '[twTreeNode]' })\nexport class TreeNodeDefDirective<T = unknown> {\n /** @internal Consumer-projected per-node template. */\n readonly template = inject(TemplateRef<TwTreeNodeContext<T>>);\n\n /** @internal */\n static ngTemplateContextGuard<T>(\n _dir: TreeNodeDefDirective<T>,\n _ctx: unknown,\n ): _ctx is TwTreeNodeContext<T> {\n return true;\n }\n}\n\n// ── TreeComponent ────────────────────────────────────────────────────\n\n/**\n * A hierarchical, keyboard-navigable tree-view wrapping `@angular/cdk/tree`\n * (children-accessor model). Consumers supply the per-node template via the\n * `*twTreeNode` structural directive and receive a typed context exposing the\n * node, its depth/expansion/children flags, its selection state, and action\n * functions (`toggle`, `expand`, `collapse`, `toggleSelection`).\n *\n * Selection is optional and managed internally (`'none' | 'single' | 'multiple'`).\n * In `'multiple'` mode with `cascade`, selecting a branch selects all its leaf\n * descendants and the branch reports `'indeterminate'` when partially selected.\n * This is NOT a form control — selection is exposed via the `selectionChange`\n * output and the public `toggleSelection` / `selectionState` methods.\n */\n@Component({\n selector: 'tw-tree',\n exportAs: 'twTree',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CdkTreeModule, NgTemplateOutlet],\n host: {\n '[class]': 'rootClasses()',\n },\n template: `\n <cdk-tree\n #cdkTreeRef\n role=\"tree\"\n [dataSource]=\"dataArray()\"\n [childrenAccessor]=\"cdkChildrenAccessor\"\n [trackBy]=\"cdkTrackBy\"\n [expansionKey]=\"cdkExpansionKey\"\n >\n <cdk-tree-node\n *cdkTreeNodeDef=\"let node\"\n #treeNode=\"cdkTreeNode\"\n [class]=\"nodeClasses(node)\"\n [isExpandable]=\"hasChildren(node)\"\n [attr.aria-selected]=\"ariaSelected(node)\"\n [attr.aria-checked]=\"ariaChecked(node)\"\n (activation)=\"toggleSelection(node)\"\n (expandedChange)=\"onCdkExpandedChange(node, $event)\"\n >\n @for (marker of indentMarkers(treeNode.level); track $index) {\n <span [class]=\"spacerClasses()\" [style.width.px]=\"indentWidth()\"></span>\n }\n <span [class]=\"contentClasses()\">\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplate()?.template ?? null\"\n [ngTemplateOutletContext]=\"buildContext(node, treeNode.level)\"\n />\n </span>\n </cdk-tree-node>\n </cdk-tree>\n `,\n})\nexport class TreeComponent<T = unknown> {\n // ── Inputs (5 — at the cap, do not add more) ──\n\n /** Root nodes of the tree. Each node's children are resolved via `childrenAccessor`. Defaults to `[]`. */\n readonly data = input<readonly T[]>([]);\n\n /** Resolves a node's direct children; return an empty array for leaf nodes. Required. */\n readonly childrenAccessor = input.required<(node: T) => readonly T[]>();\n\n /** Identifies a node across data changes and keys both expansion and selection state. When unset, node identity is used. */\n readonly trackBy = input<(node: T) => unknown>();\n\n /** Node-selection behavior — `mode`, `cascade`, `initialKeys`. Accepts a partial; unset keys fall back to the defaults. Defaults to selection disabled. */\n readonly selection = input<Partial<TwTreeSelectionConfig>>({});\n\n /** Display configuration — `size`, `indent`, `showLines`. Accepts a partial; unset keys fall back to the defaults. */\n readonly display = input<Partial<TwTreeDisplayConfig>>({});\n\n // ── Model (two-way) ──\n\n /** Two-way bound list of expansion key values (resolved via `trackBy`) for currently-expanded nodes. Set a new array on every change; do not mutate in place. Changes when a node is expanded or collapsed. Defaults to `[]` (all collapsed). */\n readonly expandedKeys = model<readonly unknown[]>([]);\n\n // ── Outputs ──\n\n /** Fires after the selection changes by user interaction. Payload is every node whose `selectionState` is `'checked'` (selected leaves plus fully-checked branches in cascade mode). */\n readonly selectionChange = output<readonly T[]>();\n\n /** Fires after a node is expanded or collapsed by user interaction. Payload identifies the node and its new expansion state. */\n readonly expandedChange = output<{ node: T; expanded: boolean }>();\n\n // ── Content / view queries ──\n\n /** @internal Consumer-projected per-node template (`*twTreeNode`). */\n readonly nodeTemplate = contentChild(TreeNodeDefDirective<T>);\n\n /** @internal The CDK tree inside our view. */\n private readonly cdkTree = viewChild.required<CdkTree<T>>('cdkTreeRef');\n\n // ── Internal selection state ──\n\n /** @internal Selected node keys. In cascade mode this holds leaf keys only; branch state is derived. */\n private readonly selectedKeys = signal<ReadonlySet<unknown>>(new Set());\n\n /** @internal One-shot guard so `initialKeys` seeds selection exactly once. */\n private seeded = false;\n\n // ── Resolved config ──\n\n /** @internal Resolved selection configuration. */\n private readonly resolvedSelection = computed<Required<TwTreeSelectionConfig>>(() => ({\n ...SELECTION_DEFAULTS,\n ...this.selection(),\n }));\n\n /** @internal Resolved display configuration. */\n private readonly resolvedDisplay = computed<Required<TwTreeDisplayConfig>>(() => ({\n ...DISPLAY_DEFAULTS,\n ...this.display(),\n }));\n\n /** @internal Indentation width in px per level. */\n readonly indentWidth = computed(() => this.resolvedDisplay().indent);\n\n /** @internal Snapshot of the root nodes as a mutable array (CDK's `dataSource` rejects `readonly T[]`). */\n readonly dataArray = computed<T[]>(() => [...this.data()]);\n\n // ── Variant class outputs ──\n\n private readonly variants = computed(() =>\n treeVariants({\n size: this.resolvedDisplay().size,\n lines: this.resolvedDisplay().showLines,\n }),\n );\n\n readonly rootClasses = computed(() => this.variants().root());\n readonly spacerClasses = computed(() => this.variants().spacer());\n readonly contentClasses = computed(() => this.variants().content());\n\n constructor() {\n // Seed selection from `initialKeys` exactly once — the first time selection\n // is enabled (`mode !== 'none'`), so the seed survives a config that arrives\n // after the initial change-detection pass. Reads `selection()` (tracked) and\n // writes `selectedKeys` (untracked, and never track-read here) → no cycle.\n effect(() => {\n const config = this.resolvedSelection();\n if (this.seeded || config.mode === 'none') return;\n this.seeded = true;\n untracked(() => this.selectedKeys.set(new Set(config.initialKeys)));\n });\n\n // model → CDK expansion sync. Reads `expandedKeys()` / `data()` /\n // `childrenAccessor()` (tracked) and writes ONLY to CDK's expansion model\n // (`expand`/`collapse` are idempotent — they `select`/`deselect` a key and\n // no-op when unchanged), never to a tracked signal → settles in one tick.\n effect(() => {\n const tree = this.cdkTree();\n const wanted = new Set(this.expandedKeys());\n const all = this.flattenAll();\n if (!tree) return;\n untracked(() => {\n for (const node of all) {\n const key = this.keyOf(node);\n const isOpen = tree.isExpanded(node);\n if (wanted.has(key) && !isOpen) tree.expand(node);\n else if (!wanted.has(key) && isOpen) tree.collapse(node);\n }\n });\n });\n }\n\n // ── Key + traversal helpers ──\n\n /** @internal Resolves a node's identity key via `trackBy`, falling back to the node itself. */\n private keyOf(node: T): unknown {\n const tb = this.trackBy();\n return tb ? tb(node) : node;\n }\n\n /** @internal Direct children of a node (always a fresh mutable array). */\n private childrenOf(node: T): readonly T[] {\n return this.childrenAccessor()(node);\n }\n\n /** Whether the node has at least one child (is a branch). */\n hasChildren(node: T): boolean {\n return this.childrenOf(node).length > 0;\n }\n\n /** @internal Depth-first list of every node in the tree (under collapsed parents too). */\n private flattenAll(): T[] {\n const out: T[] = [];\n const walk = (nodes: readonly T[]): void => {\n for (const n of nodes) {\n out.push(n);\n walk(this.childrenOf(n));\n }\n };\n walk(this.data());\n return out;\n }\n\n /** @internal All leaf descendants of a node (the node itself if it is a leaf). */\n private leavesOf(node: T): T[] {\n const out: T[] = [];\n const walk = (n: T): void => {\n const children = this.childrenOf(n);\n if (children.length === 0) {\n out.push(n);\n return;\n }\n for (const child of children) walk(child);\n };\n walk(node);\n return out;\n }\n\n // ── Template helpers ──\n\n /** @internal Array of length `level` used to render per-level indent spacers. */\n indentMarkers(level: number): readonly number[] {\n return level > 0 ? Array.from({ length: level }) : [];\n }\n\n /** @internal Per-node row classes (incorporates the selected state). */\n nodeClasses(node: T): string {\n return treeVariants({\n size: this.resolvedDisplay().size,\n lines: this.resolvedDisplay().showLines,\n selected: this.selectionState(node) === 'checked',\n }).node();\n }\n\n /** @internal Builds the typed context handed to the consumer's `*twTreeNode` template. */\n buildContext(node: T, level: number): TwTreeNodeContext<T> {\n return {\n $implicit: node,\n node,\n level,\n expanded: this.isExpanded(node),\n hasChildren: this.hasChildren(node),\n selectionState: this.selectionState(node),\n toggle: () => this.toggle(node),\n expand: () => this.expand(node),\n collapse: () => this.collapse(node),\n toggleSelection: () => this.toggleSelection(node),\n };\n }\n\n /**\n * @internal `aria-selected` for `'single'` mode (boolean selection), or `null`\n * otherwise. Multiple mode uses `aria-checked` instead so the tri-state\n * `'mixed'` value is exposed to assistive tech on the focusable treeitem.\n */\n ariaSelected(node: T): 'true' | 'false' | null {\n if (this.resolvedSelection().mode !== 'single') return null;\n return this.selectionState(node) === 'checked' ? 'true' : 'false';\n }\n\n /**\n * @internal Tri-state `aria-checked` for `'multiple'` mode (`'mixed'` for a\n * partially-selected branch), or `null` otherwise. APG exposes checkbox-tree\n * selection on the treeitem via `aria-checked`; `aria-selected` cannot carry\n * the indeterminate state.\n */\n ariaChecked(node: T): 'true' | 'false' | 'mixed' | null {\n if (this.resolvedSelection().mode !== 'multiple') return null;\n const state = this.selectionState(node);\n if (state === 'checked') return 'true';\n if (state === 'indeterminate') return 'mixed';\n return 'false';\n }\n\n // ── CDK boundary adapters (stable arrow fields) ──\n\n /** @internal Adapts the consumer's `readonly`-returning accessor to CDK's mutable-array contract. */\n readonly cdkChildrenAccessor = (node: T): T[] => [...this.childrenOf(node)];\n\n /** @internal CDK row-tracking function keyed via `trackBy`. */\n readonly cdkTrackBy: TrackByFunction<T> = (_index, node) => this.keyOf(node);\n\n /** @internal Keys CDK's expansion model via `trackBy`. */\n readonly cdkExpansionKey = (node: T): unknown => this.keyOf(node);\n\n // ── Expansion ──\n\n /** Whether the node is currently expanded. */\n isExpanded(node: T): boolean {\n return this.cdkTree().isExpanded(node);\n }\n\n /** Expands the node if collapsed. Emits `expandedChange` and updates `expandedKeys` via the CDK callback. */\n expand(node: T): void {\n this.cdkTree().expand(node);\n }\n\n /** Collapses the node if expanded. Emits `expandedChange` and updates `expandedKeys` via the CDK callback. */\n collapse(node: T): void {\n this.cdkTree().collapse(node);\n }\n\n /** Toggles the node's expand/collapse state. No-op on leaf nodes. */\n toggle(node: T): void {\n if (!this.hasChildren(node)) return;\n this.cdkTree().toggle(node);\n }\n\n /**\n * @internal Bridges CDK's per-node `(expandedChange)` to the `expandedKeys`\n * model. Compare-before-write: only mutates the model and emits when the\n * key's membership actually changes, so the model→CDK effect cannot loop.\n */\n onCdkExpandedChange(node: T, expanded: boolean): void {\n const key = this.keyOf(node);\n const current = new Set(this.expandedKeys());\n const has = current.has(key);\n if (expanded && !has) {\n current.add(key);\n this.expandedKeys.set([...current]);\n this.expandedChange.emit({ node, expanded: true });\n } else if (!expanded && has) {\n current.delete(key);\n this.expandedKeys.set([...current]);\n this.expandedChange.emit({ node, expanded: false });\n }\n }\n\n // ── Selection ──\n\n /**\n * Returns the tri-state selection status of a node. `'unchecked'` when\n * selection is disabled.\n *\n * For cascade branches this walks the node's leaf descendants on each call and\n * is invoked a few times per node per change-detection pass (row class, ARIA,\n * context). This assumes small-to-medium trees; the component has no\n * virtualization and is not tuned for very large data sets.\n */\n selectionState(node: T): TwTreeSelectionState {\n const mode = this.resolvedSelection().mode;\n if (mode === 'none') return 'unchecked';\n\n const selected = this.selectedKeys();\n if (mode === 'single') {\n return selected.has(this.keyOf(node)) ? 'checked' : 'unchecked';\n }\n\n // multiple\n if (!this.resolvedSelection().cascade || !this.hasChildren(node)) {\n return selected.has(this.keyOf(node)) ? 'checked' : 'unchecked';\n }\n\n // cascade branch: derive from leaf descendants\n const leaves = this.leavesOf(node);\n if (leaves.length === 0) return 'unchecked';\n let selectedCount = 0;\n for (const leaf of leaves) {\n if (selected.has(this.keyOf(leaf))) selectedCount++;\n }\n if (selectedCount === 0) return 'unchecked';\n if (selectedCount === leaves.length) return 'checked';\n return 'indeterminate';\n }\n\n /** Toggles selection for a node (cascades to leaf descendants in `'multiple'` mode with `cascade` on). No-op when `selection.mode === 'none'`. */\n toggleSelection(node: T): void {\n const config = this.resolvedSelection();\n if (config.mode === 'none') return;\n\n const next = new Set(this.selectedKeys());\n const key = this.keyOf(node);\n\n if (config.mode === 'single') {\n const wasSelected = next.has(key);\n next.clear();\n if (!wasSelected) next.add(key);\n } else if (!config.cascade || !this.hasChildren(node)) {\n if (next.has(key)) next.delete(key);\n else next.add(key);\n } else {\n // cascade branch: select all leaf descendants unless already fully checked\n const fullyChecked = this.selectionState(node) === 'checked';\n for (const leaf of this.leavesOf(node)) {\n const leafKey = this.keyOf(leaf);\n if (fullyChecked) next.delete(leafKey);\n else next.add(leafKey);\n }\n }\n\n this.selectedKeys.set(next);\n this.selectionChange.emit(this.selectedNodes());\n }\n\n /** @internal Every node currently reporting `selectionState() === 'checked'`. */\n private selectedNodes(): readonly T[] {\n if (this.resolvedSelection().mode === 'none') return [];\n return this.flattenAll().filter((node) => this.selectionState(node) === 'checked');\n }\n}\n\n// ── TreeNodeToggleDirective ──────────────────────────────────────────\n//\n// Optional low-ceremony toggle: `<button twTreeNodeToggle [twTreeNodeToggle]=\"node\">`.\n// It injects the host `TreeComponent` (an ancestor at the consumer's declaration\n// site) and calls `tree.toggle(node)` on click. It deliberately does NOT extend\n// CDK's `CdkTreeNodeToggle`, which injects `CdkTreeNode` — that node lives inside\n// TreeComponent's own view and is unreachable from a projected `*twTreeNode`\n// template (DI resolves at the declaration site, not the insertion site). For\n// most cases the context `toggle()` function is simpler.\n\n/** Attribute directive (`[twTreeNodeToggle]=\"node\"`) that toggles the given node's expansion on click. */\n@Directive({\n selector: '[twTreeNodeToggle]',\n host: {\n '(click)': 'onClick($event)',\n },\n})\nexport class TreeNodeToggleDirective<T = unknown> {\n private readonly tree = inject(TreeComponent<T>);\n\n /** The node whose expansion this control toggles. */\n readonly node = input.required<T>({ alias: 'twTreeNodeToggle' });\n\n /** @internal Toggles the node and stops the click from bubbling to row activation. */\n onClick(event: Event): void {\n event.stopPropagation();\n this.tree.toggle(this.node());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AAyEH;AAEA,MAAM,kBAAkB,GAAoC;AAC1D,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,WAAW,EAAE,EAAE;CAChB;AAED,MAAM,gBAAgB,GAAkC;AACtD,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,KAAK;CACjB;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY,GAAG,EAAE,CACrB;AACE,IAAA,KAAK,EAAE;AACL,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,IAAI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