ngwr 16.0.0 → 16.2.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 (295) hide show
  1. package/badge/styles/_tag.scss +8 -4
  2. package/button/styles/_index.scss +13 -7
  3. package/cascader/styles/_rules.scss +4 -2
  4. package/checkbox/styles/_index.scss +4 -2
  5. package/date-picker/styles/_index.scss +95 -3
  6. package/date-stamp/styles/_index.scss +38 -0
  7. package/dialog/styles/_index.scss +38 -0
  8. package/dropdown/styles/_index.scss +37 -1
  9. package/fesm2022/internal-CVLvP9b_.mjs +33 -0
  10. package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +11 -7
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-avatar.mjs +11 -7
  14. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  15. package/fesm2022/ngwr-back-top.mjs +10 -6
  16. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  17. package/fesm2022/ngwr-badge.mjs +18 -6
  18. package/fesm2022/ngwr-badge.mjs.map +1 -1
  19. package/fesm2022/ngwr-burger.mjs +9 -6
  20. package/fesm2022/ngwr-burger.mjs.map +1 -1
  21. package/fesm2022/ngwr-button.mjs +8 -4
  22. package/fesm2022/ngwr-button.mjs.map +1 -1
  23. package/fesm2022/ngwr-calendar.mjs +19 -8
  24. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  25. package/fesm2022/ngwr-card.mjs +9 -5
  26. package/fesm2022/ngwr-card.mjs.map +1 -1
  27. package/fesm2022/ngwr-cascader.mjs +11 -5
  28. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  29. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
  30. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-checkbox.mjs +10 -6
  32. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngwr-clipboard.mjs +2 -1
  34. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  35. package/fesm2022/ngwr-collapse.mjs +9 -5
  36. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +4 -2
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-comment.mjs +13 -7
  40. package/fesm2022/ngwr-comment.mjs.map +1 -1
  41. package/fesm2022/ngwr-compare.mjs +9 -3
  42. package/fesm2022/ngwr-compare.mjs.map +1 -1
  43. package/fesm2022/ngwr-context-menu.mjs +4 -2
  44. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  45. package/fesm2022/ngwr-copy-value.mjs +11 -6
  46. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  47. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  48. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-date-picker.mjs +238 -38
  50. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  51. package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
  52. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
  53. package/fesm2022/ngwr-date-stamp.mjs +213 -0
  54. package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
  55. package/fesm2022/ngwr-date.mjs +364 -54
  56. package/fesm2022/ngwr-date.mjs.map +1 -1
  57. package/fesm2022/ngwr-descriptions.mjs +9 -5
  58. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog-testing.mjs +23 -2
  60. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-dialog.mjs +45 -16
  62. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  63. package/fesm2022/ngwr-directives.mjs +102 -11
  64. package/fesm2022/ngwr-directives.mjs.map +1 -1
  65. package/fesm2022/ngwr-divider.mjs +4 -2
  66. package/fesm2022/ngwr-divider.mjs.map +1 -1
  67. package/fesm2022/ngwr-drawer.mjs +29 -3
  68. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  69. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  70. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-dropdown.mjs +362 -26
  72. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  73. package/fesm2022/ngwr-editor.mjs +5 -2
  74. package/fesm2022/ngwr-editor.mjs.map +1 -1
  75. package/fesm2022/ngwr-event-calendar.mjs +4 -2
  76. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  77. package/fesm2022/ngwr-file-upload.mjs +9 -3
  78. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  79. package/fesm2022/ngwr-form.mjs +18 -6
  80. package/fesm2022/ngwr-form.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  86. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  88. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  90. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  92. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  94. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  96. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  98. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  100. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  102. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  104. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  106. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  108. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  110. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  112. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  114. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  116. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  118. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  120. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  122. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  124. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n.mjs +34 -8
  126. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  127. package/fesm2022/ngwr-input-number.mjs +9 -3
  128. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  129. package/fesm2022/ngwr-input-otp.mjs +4 -2
  130. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  131. package/fesm2022/ngwr-input.mjs +20 -10
  132. package/fesm2022/ngwr-input.mjs.map +1 -1
  133. package/fesm2022/ngwr-keyboard.mjs +9 -3
  134. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  135. package/fesm2022/ngwr-knob.mjs +9 -3
  136. package/fesm2022/ngwr-knob.mjs.map +1 -1
  137. package/fesm2022/ngwr-layout.mjs +13 -5
  138. package/fesm2022/ngwr-layout.mjs.map +1 -1
  139. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  140. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-lightbox.mjs +255 -15
  142. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  143. package/fesm2022/ngwr-list.mjs +13 -5
  144. package/fesm2022/ngwr-list.mjs.map +1 -1
  145. package/fesm2022/ngwr-load-state.mjs +9 -5
  146. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  147. package/fesm2022/ngwr-overlay.mjs +84 -1
  148. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  149. package/fesm2022/ngwr-pagination.mjs +3 -2
  150. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  151. package/fesm2022/ngwr-pipes.mjs +47 -9
  152. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  153. package/fesm2022/ngwr-popover.mjs +93 -4
  154. package/fesm2022/ngwr-popover.mjs.map +1 -1
  155. package/fesm2022/ngwr-progress.mjs +4 -2
  156. package/fesm2022/ngwr-progress.mjs.map +1 -1
  157. package/fesm2022/ngwr-radio.mjs +9 -5
  158. package/fesm2022/ngwr-radio.mjs.map +1 -1
  159. package/fesm2022/ngwr-rating.mjs +9 -3
  160. package/fesm2022/ngwr-rating.mjs.map +1 -1
  161. package/fesm2022/ngwr-resizable.mjs +503 -0
  162. package/fesm2022/ngwr-resizable.mjs.map +1 -0
  163. package/fesm2022/ngwr-result.mjs +9 -5
  164. package/fesm2022/ngwr-result.mjs.map +1 -1
  165. package/fesm2022/ngwr-schema-form.mjs +3 -0
  166. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  167. package/fesm2022/ngwr-segmented.mjs +4 -2
  168. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  169. package/fesm2022/ngwr-select.mjs +13 -5
  170. package/fesm2022/ngwr-select.mjs.map +1 -1
  171. package/fesm2022/ngwr-skeleton.mjs +4 -2
  172. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  173. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  174. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  175. package/fesm2022/ngwr-slider.mjs +91 -13
  176. package/fesm2022/ngwr-slider.mjs.map +1 -1
  177. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  178. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  180. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  181. package/fesm2022/ngwr-speed-dial.mjs +4 -2
  182. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  183. package/fesm2022/ngwr-spinner.mjs +4 -2
  184. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  185. package/fesm2022/ngwr-splitter.mjs +17 -21
  186. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  187. package/fesm2022/ngwr-stepper.mjs +9 -3
  188. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  189. package/fesm2022/ngwr-switch.mjs +9 -5
  190. package/fesm2022/ngwr-switch.mjs.map +1 -1
  191. package/fesm2022/ngwr-table-testing.mjs +5 -1
  192. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  193. package/fesm2022/ngwr-table.mjs +167 -10
  194. package/fesm2022/ngwr-table.mjs.map +1 -1
  195. package/fesm2022/ngwr-textarea.mjs +9 -3
  196. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  197. package/fesm2022/ngwr-timeline.mjs +18 -8
  198. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  199. package/fesm2022/ngwr-toast-testing.mjs +6 -1
  200. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  201. package/fesm2022/ngwr-toast.mjs +529 -104
  202. package/fesm2022/ngwr-toast.mjs.map +1 -1
  203. package/fesm2022/ngwr-transfer.mjs +4 -2
  204. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  205. package/fesm2022/ngwr-tree.mjs +4 -2
  206. package/fesm2022/ngwr-tree.mjs.map +1 -1
  207. package/fesm2022/ngwr-typography.mjs +9 -3
  208. package/fesm2022/ngwr-typography.mjs.map +1 -1
  209. package/fesm2022/ngwr-utils-router.mjs +18 -2
  210. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  211. package/fesm2022/ngwr-utils.mjs +9 -2
  212. package/fesm2022/ngwr-utils.mjs.map +1 -1
  213. package/fesm2022/ngwr-version.mjs +1 -1
  214. package/fesm2022/ngwr-version.mjs.map +1 -1
  215. package/fesm2022/ngwr-window.mjs +7 -4
  216. package/fesm2022/ngwr-window.mjs.map +1 -1
  217. package/fesm2022/ngwr.mjs.map +1 -1
  218. package/i18n/ar.json +13 -2
  219. package/i18n/cs.json +13 -2
  220. package/i18n/de.json +13 -2
  221. package/i18n/en.json +13 -2
  222. package/i18n/es.json +13 -2
  223. package/i18n/fr.json +13 -2
  224. package/i18n/he.json +13 -2
  225. package/i18n/hi.json +13 -2
  226. package/i18n/id.json +13 -2
  227. package/i18n/it.json +13 -2
  228. package/i18n/ja.json +13 -2
  229. package/i18n/ko.json +13 -2
  230. package/i18n/nl.json +13 -2
  231. package/i18n/pl.json +13 -2
  232. package/i18n/pt.json +13 -2
  233. package/i18n/ru.json +13 -2
  234. package/i18n/sv.json +13 -2
  235. package/i18n/tr.json +13 -2
  236. package/i18n/uk.json +13 -2
  237. package/i18n/vi.json +13 -2
  238. package/i18n/zh-TW.json +13 -2
  239. package/i18n/zh.json +13 -2
  240. package/input/styles/_index.scss +10 -5
  241. package/input-number/styles/_index.scss +6 -3
  242. package/input-otp/styles/_index.scss +4 -2
  243. package/lightbox/styles/_rules.scss +96 -0
  244. package/llms-full.txt +40 -17
  245. package/llms.txt +20 -4
  246. package/package.json +19 -1
  247. package/radio/styles/_index.scss +4 -2
  248. package/resizable/styles/_index.scss +154 -0
  249. package/schematics/use/rule.js +1 -0
  250. package/schematics/use/symbol-map.json +5 -0
  251. package/select/styles/_index.scss +6 -3
  252. package/skills/ngwr/SKILL.md +1 -1
  253. package/skills/ngwr/references/catalog.md +6 -2
  254. package/skills/ngwr/references/setup.md +3 -0
  255. package/slider/styles/_index.scss +106 -0
  256. package/sortable-list/styles/_rules.scss +23 -1
  257. package/switch/styles/_index.scss +4 -2
  258. package/table/styles/_index.scss +53 -0
  259. package/textarea/styles/_index.scss +4 -2
  260. package/theme/styles/_motion.scss +6 -0
  261. package/toast/styles/_index.scss +19 -0
  262. package/types/ngwr-burger.d.ts +0 -1
  263. package/types/ngwr-calendar.d.ts +7 -0
  264. package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
  265. package/types/ngwr-clipboard.d.ts +7 -0
  266. package/types/ngwr-date-picker-testing.d.ts +17 -0
  267. package/types/ngwr-date-picker.d.ts +88 -4
  268. package/types/ngwr-date-stamp-testing.d.ts +47 -0
  269. package/types/ngwr-date-stamp.d.ts +127 -0
  270. package/types/ngwr-date.d.ts +251 -37
  271. package/types/ngwr-dialog-testing.d.ts +10 -0
  272. package/types/ngwr-dialog.d.ts +72 -4
  273. package/types/ngwr-directives.d.ts +36 -1
  274. package/types/ngwr-drawer.d.ts +21 -0
  275. package/types/ngwr-dropdown-testing.d.ts +53 -5
  276. package/types/ngwr-dropdown.d.ts +100 -0
  277. package/types/ngwr-i18n.d.ts +44 -14
  278. package/types/ngwr-lightbox-testing.d.ts +27 -0
  279. package/types/ngwr-lightbox.d.ts +71 -6
  280. package/types/ngwr-overlay.d.ts +36 -0
  281. package/types/ngwr-pipes.d.ts +48 -13
  282. package/types/ngwr-popover.d.ts +39 -1
  283. package/types/ngwr-resizable.d.ts +228 -0
  284. package/types/ngwr-slider-testing.d.ts +8 -1
  285. package/types/ngwr-slider.d.ts +89 -3
  286. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  287. package/types/ngwr-sortable-list.d.ts +113 -10
  288. package/types/ngwr-table-testing.d.ts +3 -1
  289. package/types/ngwr-table.d.ts +120 -4
  290. package/types/ngwr-toast-testing.d.ts +12 -1
  291. package/types/ngwr-toast.d.ts +215 -18
  292. package/types/ngwr-utils-router.d.ts +22 -0
  293. package/types/ngwr-utils.d.ts +8 -1
  294. package/types/ngwr-version.d.ts +1 -1
  295. package/types/ngwr.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-tree.mjs","names":[],"sources":["../../../projects/lib/tree/tree.ts","../../../projects/lib/tree/tree.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList, wrCheckStyles, type WrClassInput } from 'ngwr/utils';\n\nimport type { WrTreeNode, WrTreeSelectionMode, WrTreeSize } from './types';\n\ninterface FlatNode<TId> {\n readonly node: WrTreeNode<TId>;\n readonly depth: number;\n readonly hasChildren: boolean;\n /** Absolute position in the flattened visible list. */\n readonly index: number;\n /** 1-based position within its sibling group (ARIA `aria-posinset`). */\n readonly posinset: number;\n /** Sibling count at this level (ARIA `aria-setsize`). */\n readonly setsize: number;\n}\n\ninterface SelectedChip<TId> {\n readonly id: TId;\n readonly label: string;\n}\n\nlet panelUid = 0;\n\n/**\n * Hierarchical tree. Data-driven — pass `[nodes]` with optional `children`\n * arrays. Supports single / multi selection (two-way `[(selected)]`),\n * controlled expand state (two-way `[(expanded)]`), and full keyboard\n * navigation.\n *\n * Two render shapes, picked by `[openOn]`:\n * - `'inline'` (default) — renders the tree list in-place. Use as a display\n * widget or form-less hierarchical picker.\n * - `'overlay'` — renders a `<wr-select>`-style trigger button (with chips\n * in multi mode) that opens a popover containing the tree. A signal-forms\n * native control: it implements `FormValueControl<unknown>`, so `[formField]`\n * binds straight to its `value` model — no `ControlValueAccessor` in between.\n * `[(value)]` and classic `[(ngModel)]` / reactive forms all keep working via\n * Angular's bridge. Replaces the standalone `<wr-tree-select>`.\n *\n * Value type in `overlay` mode: `TId | null` in single mode,\n * `readonly TId[]` in multi mode.\n *\n * @example\n * ```html\n * <!-- Inline tree (display widget) -->\n * <wr-tree [nodes]=\"folders\" [(selected)]=\"picked\" [(expanded)]=\"open\" />\n *\n * <!-- Form-bound combobox (signal forms) -->\n * <wr-tree\n * openOn=\"overlay\"\n * [nodes]=\"folders\"\n * selectionMode=\"single\"\n * [formField]=\"form.folder\"\n * placeholder=\"Pick a folder\"\n * />\n *\n * <!-- standalone two-way binding -->\n * <wr-tree openOn=\"overlay\" [nodes]=\"folders\" [(value)]=\"picked\" placeholder=\"Pick a folder\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/tree\n */\n@Component({\n selector: 'wr-tree',\n templateUrl: './tree.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()', '(focusout)': 'onFocusOut($event)' },\n imports: [NgTemplateOutlet],\n})\nexport class WrTree<TId = string> implements FormValueControl<unknown> {\n /** Tree data. */\n readonly nodes = input<readonly WrTreeNode<TId>[]>([]);\n\n /** Selected node ids (two-way bindable). */\n readonly selected = model<readonly TId[]>([]);\n\n /** Expanded node ids (two-way bindable). */\n readonly expanded = model<readonly TId[]>([]);\n\n /** Selection behavior. @default 'single' */\n readonly selectionMode = input<WrTreeSelectionMode>('single');\n\n /**\n * Disable the whole tree. Bound automatically from the field's disabled\n * state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse selection changes while the tree stays focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * Expanding and collapsing keep working: a branch is NAVIGATION, not a value,\n * so a read-only tree is still browsable — it is picking and un-picking that\n * stops. In `overlay` mode the trigger additionally refuses to open, because\n * there the panel exists only to choose from and it already shows what is\n * chosen.\n *\n * `aria-readonly` rides on the combobox trigger only; role `tree` does not\n * support the state, so the inline shape has nothing valid to mirror it onto.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n // Overlay-mode inputs (ignored when openOn='inline')\n\n /** Render shape. @default 'inline' */\n readonly openOn = input<'inline' | 'overlay'>('inline');\n\n /** Trigger size — shares the `--wr-control-*` contract. The panel keeps its size. @default 'md' */\n readonly size = input<WrTreeSize>('md');\n\n /** Placeholder shown on the trigger when no node is selected. */\n readonly placeholder = input<string>('');\n\n /**\n * The same fall-through `wr-select` has had all along: an unset placeholder\n * takes the catalog's `tree.placeholder`, so an overlay trigger with nothing\n * selected reads \"Select…\" in the app's language instead of rendering an\n * empty span. The key shipped in both catalogs and nothing read it.\n */\n protected readonly resolvedPlaceholder = useI18nText(this.placeholder, 'tree.placeholder', '');\n\n /**\n * Accessible name of the overlay trigger. Falls back to the placeholder, then\n * to `select.label` — a `role=\"combobox\"` with nothing selected and no\n * placeholder otherwise has no name at all.\n *\n * An INLINE tree puts it on the `role=\"tree\"` itself, which ARIA requires to\n * have a name — an `aria-label` on the `<wr-tree>` host never reaches it.\n * Inside a `<wr-form-field>` the field's label names the tree instead.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly labelText = useI18nText(this.ariaLabel, 'select.label', 'Select');\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder must fall through to the catalog string.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.resolvedPlaceholder();\n return placeholder ? placeholder : this.labelText();\n });\n\n /** Show a clear-all (×) button on the trigger when at least one node is selected. @default true */\n readonly clearable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Cap on the number of chips rendered on the trigger before\n * collapsing the rest into `+N more` (multi mode only). `0` = render\n * every chip. @default 0\n */\n readonly maxTagCount = input(0, {\n transform: (v: unknown): number => Math.max(0, Number(v) || 0),\n });\n\n /** Auto-expand every node that has children on first open of the overlay. @default false */\n readonly defaultExpandAll = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Window the visible-node list so a large tree keeps only ~one viewport of\n * rows in the DOM. Opt-in and OFF by default — a tree without it renders\n * byte-identically to today. Works in both `inline` and `overlay` shapes;\n * while on, keyboard navigation switches to the `aria-activedescendant`\n * pattern so Arrow / Home / End / Enter keep working across un-rendered rows.\n * @default false\n */\n readonly virtualScroll = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Uniform row height in px used to map scroll offset to node index. `0`\n * (default) measures the first rendered row once and reuses it, so it adapts\n * to the active density / touch target automatically. Read only when\n * `virtualScroll` is on. @default 0\n */\n readonly rowHeight = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Height of the scroll viewport when `virtualScroll` is on — a number (px) or\n * any CSS length (`'60vh'`). A numeric px value lets the server prerender the\n * exact first window. @default 288\n */\n readonly viewportHeight = input<number | string>(288);\n\n /** Extra rows kept rendered above and below the viewport as scroll headroom. @default 6 */\n readonly overscan = input(6, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 6)) });\n\n /**\n * Extra CSS classes for the overlay pane, when `openOn` puts the tree in one.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n *\n * Inline trees never open an overlay, so this input does nothing for the\n * default `openOn=\"inline\"` — the host element is right there to take a\n * class of its own.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Form value — the current selection as seen by a bound field. Bound by\n * `[formField]`, or two-way via `[(value)]`. Shape follows `selectionMode`:\n * `TId | null` in single mode, `readonly TId[]` in multi mode. Works in both\n * `openOn` modes; `[(selected)]` stays the inline-native API and always\n * carries an array, whatever the selection mode.\n */\n readonly value = model<unknown>(undefined);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** Fires after the overlay panel opens. */\n readonly opened = output<void>();\n\n /** Fires after the overlay panel closes. */\n readonly closed = output<void>();\n\n // Internals\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly injector = inject(Injector);\n /**\n * Ambient reading direction. Optional so a bare `TestBed` — or a consumer who\n * never set a direction — needs no provider; `Directionality` is root-provided\n * anyway, and a missing one simply reads as `ltr`.\n *\n * Read at keystroke time rather than cached, so a runtime `dir` flip needs no\n * subscription to `change` — the overlay is the half that does, and\n * `wrFollowDirection` in `openOverlay()` is where that lives.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /** Currently focused row's index in the flattened visible list. */\n protected readonly focusedIndex = signal(0);\n\n /**\n * The node the cursor is on, written with {@link focusedIndex}. The index alone\n * names a SLOT: opening a branch above the cursor or collapsing one around it\n * moves every row below, and the tab stop then sat on whichever node took the\n * slot — the next arrow walked from a row the user had never been on.\n */\n private readonly cursorId = signal<{ readonly id: TId } | null>(null);\n\n /** Each node's parent id, so a cursor hidden by a collapse can climb to a visible row. */\n private readonly parentMap = computed<ReadonlyMap<TId, TId>>(() => {\n const map = new Map<TId, TId>();\n const walk = (list: readonly WrTreeNode<TId>[], parent: TId | null): void => {\n for (const n of list) {\n if (parent !== null) map.set(n.id, parent);\n if (n.children?.length) walk(n.children, n.id);\n }\n };\n walk(this.nodes(), null);\n return map;\n });\n\n /**\n * The cursor as the DOM sees it: the row of the cursor's node, else its\n * nearest visible ancestor when a collapse hid it, else the raw index clamped\n * to the list that exists RIGHT NOW.\n *\n * The clamp is the last resort for a node that left the data altogether.\n * Nothing shrank the raw index when the list did: collapsing a branch above\n * the cursor left it past the end, which gave the tree zero rows with\n * `tabindex=\"0\"` (no way back in with Tab) and made every arrow key a no-op,\n * because `onKeydown` bails when `flat[i]` is undefined.\n */\n protected readonly cursorIndex = computed(() => {\n const flat = this.flat();\n const cursor = this.cursorId();\n if (cursor) {\n const parents = this.parentMap();\n for (let id: TId | undefined = cursor.id; id !== undefined; id = parents.get(id)) {\n const at = flat.findIndex(f => f.node.id === id);\n if (at !== -1) return at;\n }\n }\n return Math.min(this.focusedIndex(), Math.max(0, flat.length - 1));\n });\n\n /** Resolved ARIA labels — signals, so they follow both a late catalog and a locale switch. */\n protected readonly clearLabel = wrReadI18nText('tree.clearSelection', 'Clear selection');\n protected readonly expandLabel = wrReadI18nText('tree.expand', 'Expand');\n protected readonly collapseLabel = wrReadI18nText('tree.collapse', 'Collapse');\n protected readonly chipRemoveLabel = useI18nFormatter('tree.removeItem', 'Remove {{label}}');\n\n /**\n * The overflow chip past `maxTagCount`. It was the literal `+{{ extra }} more`\n * in the template while `wr-select` — the same chip, the same string — read\n * `select.more` from the catalog, so a Russian tree rendered\n * `[\"Черновик\", \"+2 more\"]`.\n */\n protected readonly chipMoreLabel = useI18nFormatter('tree.more', '+{{count}} more');\n\n /** Flattened list of currently visible nodes — what the template renders. */\n protected readonly flat = computed<readonly FlatNode<TId>[]>(() => {\n const expanded = new Set(this.expanded());\n const out: FlatNode<TId>[] = [];\n const walk = (list: readonly WrTreeNode<TId>[], depth: number): void => {\n list.forEach((node, i) => {\n const hasChildren = (node.children?.length ?? 0) > 0;\n out.push({ node, depth, hasChildren, index: out.length, posinset: i + 1, setsize: list.length });\n if (hasChildren && expanded.has(node.id)) walk(node.children!, depth + 1);\n });\n };\n walk(this.nodes(), 0);\n return out;\n });\n\n protected readonly selectedSet = computed(() => new Set(this.selected()));\n protected readonly expandedSet = computed(() => new Set(this.expanded()));\n\n protected readonly isOverlay = computed(() => this.openOn() === 'overlay');\n protected readonly isMulti = computed(() => this.selectionMode() === 'multi');\n protected readonly hasSelection = computed(() => this.selected().length > 0);\n\n /** Overlay-mode trigger label / chip map. */\n private readonly labelMap = computed<ReadonlyMap<TId, string>>(() => {\n const map = new Map<TId, string>();\n const walk = (list: readonly WrTreeNode<TId>[]): void => {\n for (const n of list) {\n map.set(n.id, n.label);\n if (n.children?.length) walk(n.children);\n }\n };\n walk(this.nodes());\n return map;\n });\n\n protected readonly selectedChips = computed<readonly SelectedChip<TId>[]>(() => {\n const map = this.labelMap();\n return this.selected().map<SelectedChip<TId>>(id => ({ id, label: map.get(id) ?? String(id) }));\n });\n\n protected readonly visibleChips = computed<readonly SelectedChip<TId>[]>(() => {\n const cap = this.maxTagCount();\n const chips = this.selectedChips();\n return cap > 0 && chips.length > cap ? chips.slice(0, cap) : chips;\n });\n\n protected readonly hiddenChipCount = computed(() => {\n const cap = this.maxTagCount();\n const total = this.selectedChips().length;\n return cap > 0 && total > cap ? total - cap : 0;\n });\n\n protected readonly singleLabel = computed<string | null>(() => {\n if (this.isMulti()) return null;\n const first = this.selected()[0];\n if (first == null) return null;\n return this.labelMap().get(first) ?? null;\n });\n\n /** Overlay open state. Only meaningful when `openOn='overlay'`. */\n protected readonly isOpen = signal(false);\n\n /** Trigger / panel id for `aria-controls`. */\n protected readonly panelId = `wr-tree-panel-${++panelUid}`;\n\n protected readonly classes = computed(() => {\n const parts = ['wr-tree'];\n if (this.disabled()) parts.push('wr-tree--disabled');\n else if (this.readonly()) parts.push('wr-tree--readonly');\n if (this.isOverlay()) {\n parts.push('wr-tree--combobox');\n const size = this.size();\n if (size !== 'md') parts.push(`wr-tree--${size}`);\n if (this.isOpen()) parts.push('wr-tree--open');\n if (this.isMulti()) parts.push('wr-tree--multi');\n }\n return parts.join(' ');\n });\n\n protected readonly panelTpl = viewChild('panelTpl', { read: TemplateRef });\n\n private overlayRef: OverlayRef | null = null;\n\n // --- Virtual scroll -------------------------------------------------------\n\n private static readonly FALLBACK_ROW_PX = 32;\n private static readonly FALLBACK_VIEWPORT_PX = 288;\n\n /** Live vertical scroll offset (px); 0 on the server / before first scroll. */\n private readonly scrollTop = signal(0);\n /** Measured viewport clientHeight (px); 0 until the browser observer fires. */\n private readonly viewportPx = signal(0);\n /** Measured first-row height (px) when `rowHeight` is auto; 0 until measured. */\n private readonly measuredRowPx = signal(0);\n\n /** Virtualization active (opt-in and there is anything to window). */\n protected readonly virtualized = computed(() => this.virtualScroll() && this.flat().length > 0);\n\n /** Effective uniform row height (px). */\n protected readonly effRowH = computed(() =>\n this.rowHeight() > 0 ? this.rowHeight() : this.measuredRowPx() || WrTree.FALLBACK_ROW_PX\n );\n\n /** Deterministic viewport px for SSR + first paint (numeric height, else fallback). */\n private readonly fallbackViewportPx = computed(() => {\n const h = this.viewportHeight();\n if (typeof h === 'number') return h;\n return /^\\d+$/.test(h) ? Number(h) : WrTree.FALLBACK_VIEWPORT_PX;\n });\n\n /** `viewportHeight` as a CSS length for the inline max-height (bare number → px). */\n protected readonly resolvedViewportHeight = computed(() => {\n const h = this.viewportHeight();\n return typeof h === 'number' || /^\\d+$/.test(h) ? `${h}px` : h;\n });\n\n /** Rendered window [start,end) + spacer pads (px). Pure math from `scrollTop`. */\n protected readonly virtualWindow = computed<{ start: number; end: number; padTop: number; padBottom: number }>(() => {\n const total = this.flat().length;\n if (!this.virtualized() || total === 0) return { start: 0, end: total, padTop: 0, padBottom: 0 };\n const h = this.effRowH();\n const vp = this.viewportPx() || this.fallbackViewportPx();\n const over = this.overscan();\n // Clamp `first` so a transient effRowH shrink (auto-measure landing below the\n // fallback within one frame) can't push it past the list and slice to empty.\n const first = Math.min(Math.floor(this.scrollTop() / h), total - 1);\n // `+ 1` covers the partial row at the viewport's bottom edge even at overscan 0.\n const count = Math.ceil(vp / h) + 1;\n const start = Math.max(0, first - over);\n const end = Math.min(total, first + count + over);\n return { start, end, padTop: start * h, padBottom: (total - end) * h };\n });\n\n /** Nodes placed in the list. SAME array instance as `flat()` when off → byte-identical DOM. */\n protected readonly windowRows = computed<readonly FlatNode<TId>[]>(() => {\n if (!this.virtualized()) return this.flat();\n const { start, end } = this.virtualWindow();\n return this.flat().slice(start, end);\n });\n\n /** Stable id for a row at flat index `i` — the `aria-activedescendant` target. */\n protected rowId(i: number): string {\n return `${this.panelId}-row-${i}`;\n }\n\n /**\n * Active-descendant id when virtualized (focus stays on the list container),\n * else `null`. Returns `null` while the focused row is outside the rendered\n * window (e.g. mouse-wheeled away) so `aria-activedescendant` never dangles at\n * a removed element — the next arrow key scrolls it back and re-establishes it.\n */\n protected readonly activeRowId = computed(() => {\n if (!this.virtualized()) return null;\n const i = this.cursorIndex();\n const { start, end } = this.virtualWindow();\n return i >= start && i < end ? this.rowId(i) : null;\n });\n\n /** The scrollable `<ul>` — inside the overlay panel in overlay mode, else in the host. */\n private get listElement(): HTMLElement | null {\n const root = this.overlayRef?.overlayElement ?? this.host.nativeElement;\n return root.querySelector<HTMLElement>('.wr-tree__list');\n }\n\n /** Scroll flat index `i` just into view (sets the `scrollTop` signal synchronously). */\n private ensureVisible(i: number): void {\n const h = this.effRowH();\n const vp = this.viewportPx() || this.fallbackViewportPx();\n const top = i * h;\n const cur = this.scrollTop();\n let next = cur;\n if (top < cur) next = top;\n else if (top + h > cur + vp) next = top + h - vp;\n if (next !== cur) {\n this.scrollTop.set(next);\n this.listElement?.scrollTo({ top: next });\n }\n }\n\n /** Whether this OPEN has already auto-expanded; reset when the panel closes. */\n private didExpandAll = false;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('tree');\n // Drive the overlay open/close in response to the `open` signal.\n effect(() => {\n if (!this.isOverlay()) return;\n if (this.isOpen()) {\n this.openOverlay();\n // Once per OPEN, which is what the input documents. Reading `expanded()`\n // as part of the guard made it a dependency of this effect, so closing\n // the last branch re-ran it and inflated the tree again — collapsible one\n // branch at a time, never all the way.\n if (this.defaultExpandAll() && !this.didExpandAll) {\n this.didExpandAll = true;\n untracked(() => {\n if (this.expanded().length === 0) this.expanded.set(this.collectExpandableIds(this.nodes()));\n });\n }\n } else {\n this.didExpandAll = false;\n this.closeOverlay();\n }\n });\n\n // Disabling the control closes any open overlay (mirrors the side effect\n // of the old CVA setDisabledState).\n effect(() => {\n if (this.disabled() || this.readonly()) this.isOpen.set(false);\n });\n\n // Bridge an external `value` write back into the internal `selected`\n // state (this is the old writeValue body). `undefined` is the untouched\n // sentinel — no field / ngModel has written yet, so leave any preset\n // `[(selected)]` alone; a real `null` still clears, exactly as\n // `writeValue(null)` did. Guarded against the echo of our own `emit()`\n // (equality check under `untracked`) so a live pick is never clobbered.\n effect(() => {\n const value = this.value();\n if (value === undefined) return;\n untracked(() => {\n const next: readonly TId[] = this.isMulti()\n ? Array.isArray(value)\n ? (value as readonly TId[])\n : []\n : value == null\n ? []\n : [value as TId];\n const current = this.selected();\n if (next.length === current.length && next.every((id, i) => id === current[i])) return;\n this.selected.set(next);\n });\n });\n\n // Wire the scroll listener + viewport/row measurement — only while virtual\n // and in the browser. Re-runs when the list (re)appears (overlay open, data\n // change), deferring the DOM read to a microtask so the portal / inline list\n // is attached. No-op on the server (SSR renders the deterministic first\n // window from inputs alone).\n effect(onCleanup => {\n if (!isPlatformBrowser(this.platformId) || !this.virtualScroll()) return;\n const open = this.isOverlay() ? this.isOpen() : true;\n this.flat();\n if (!open) return;\n let raf = 0;\n let ro: ResizeObserver | null = null;\n let el: HTMLElement | null = null;\n // `onCleanup` can run BEFORE the microtask below — the effect re-runs, or\n // the component is destroyed, in the same task that scheduled it. It would\n // then tear down nothing (`el` and `ro` are still null) and the\n // continuation would go on to attach a scroll listener and a\n // `ResizeObserver` that nothing is left to remove.\n let cancelled = false;\n const onScroll = (): void => {\n if (raf) return;\n raf = requestAnimationFrame(() => {\n raf = 0;\n if (el) this.scrollTop.set(el.scrollTop);\n });\n };\n queueMicrotask(() => {\n if (cancelled) return;\n el = this.listElement;\n if (!el) return;\n // The overlay `<ul>` is destroyed + recreated on each open, but the\n // `scrollTop` signal persists — restore the fresh element to it so a\n // reopened panel isn't blank (window computed from a non-zero signal\n // while the new DOM sits at scrollTop 0). No-op on first open / inline.\n if (el.scrollTop !== this.scrollTop()) el.scrollTop = this.scrollTop();\n this.viewportPx.set(el.clientHeight);\n if (this.rowHeight() === 0) {\n const h = el.querySelector<HTMLElement>('.wr-tree__row')?.offsetHeight ?? 0;\n if (h > 0) this.measuredRowPx.set(h);\n }\n el.addEventListener('scroll', onScroll, { passive: true });\n if (typeof ResizeObserver !== 'undefined') {\n ro = new ResizeObserver(() => {\n if (el) this.viewportPx.set(el.clientHeight);\n });\n ro.observe(el);\n }\n });\n onCleanup(() => {\n cancelled = true;\n if (raf) cancelAnimationFrame(raf);\n if (el) el.removeEventListener('scroll', onScroll);\n ro?.disconnect();\n });\n });\n\n this.destroyRef.onDestroy(() => this.closeOverlay(false));\n }\n\n // Template handlers\n\n protected onRowClick(flat: FlatNode<TId>, event: MouseEvent): void {\n if (this.disabled() || flat.node.disabled) return;\n if (flat.hasChildren && (event.target as HTMLElement).closest('.wr-tree__toggle')) {\n this.toggleExpanded(flat.node.id);\n return;\n }\n this.focusIndex(flat.index);\n this.select(flat.node.id, event.ctrlKey || event.metaKey);\n }\n\n protected onToggleClick(node: WrTreeNode<TId>, event: MouseEvent): void {\n event.stopPropagation();\n if (this.disabled() || node.disabled) return;\n this.toggleExpanded(node.id);\n }\n\n /**\n * Map a physical arrow onto the expand / collapse axis.\n *\n * The APG gives ArrowRight the job of opening a branch and ArrowLeft the job\n * of closing it because the arrows follow the INDENT, and the indent grows\n * rightward. Under `dir=\"rtl\"` it grows leftward, so the two swap — without\n * this an RTL user cannot open a node at all.\n *\n * Up / Down travel the block axis and Home / End name a semantic position\n * (first / last), so all four are returned untouched in both directions.\n */\n private inlineKey(key: string): string {\n if (this.dir?.value !== 'rtl') return key;\n if (key === 'ArrowRight') return 'ArrowLeft';\n if (key === 'ArrowLeft') return 'ArrowRight';\n return key;\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) return;\n const flat = this.flat();\n const i = this.cursorIndex();\n const current = flat[i];\n if (!current) return;\n\n // The cursor move is identical in both render shapes — `focusIndex()` owns\n // the roving-tabindex / `aria-activedescendant` split — so mirroring here\n // covers the windowed tree too.\n switch (this.inlineKey(event.key)) {\n case 'ArrowDown':\n event.preventDefault();\n this.focusIndex(Math.min(flat.length - 1, i + 1));\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusIndex(Math.max(0, i - 1));\n break;\n case 'ArrowRight':\n event.preventDefault();\n if (current.hasChildren && !this.expandedSet().has(current.node.id)) {\n this.toggleExpanded(current.node.id);\n } else if (current.hasChildren) {\n this.focusIndex(Math.min(flat.length - 1, i + 1));\n }\n break;\n case 'ArrowLeft':\n event.preventDefault();\n if (current.hasChildren && this.expandedSet().has(current.node.id)) {\n this.toggleExpanded(current.node.id);\n } else if (current.depth > 0) {\n for (let j = i - 1; j >= 0; j--) {\n if (flat[j].depth < current.depth) {\n this.focusIndex(j);\n break;\n }\n }\n }\n break;\n case 'Home':\n event.preventDefault();\n this.focusIndex(0);\n break;\n case 'End':\n event.preventDefault();\n this.focusIndex(flat.length - 1);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n if (!current.node.disabled) this.select(current.node.id, event.ctrlKey || event.metaKey);\n break;\n default:\n break;\n }\n }\n\n /**\n * Focus the tree — what Signal Forms calls to focus this control. Focus goes\n * where Tab would put it: the row holding the roving tab stop, or the list\n * itself while it is windowed, since the list is the tab stop then. In overlay\n * mode that is the trigger, and the panel stays shut.\n */\n focus(options?: FocusOptions): void {\n const host = this.host.nativeElement;\n let stop: HTMLElement | null;\n if (this.isOverlay()) stop = host.querySelector<HTMLElement>('.wr-tree__trigger');\n else if (this.virtualized()) stop = host.querySelector<HTMLElement>('.wr-tree__list');\n else stop = host.querySelector<HTMLElement>(`[data-tree-index=\"${this.cursorIndex()}\"]`);\n stop?.focus(options);\n }\n\n /** Open the overlay panel, as the trigger does. Refused inline, and while disabled or read-only. */\n open(): void {\n if (!this.isOverlay() || this.disabled() || this.readonly()) return;\n this.isOpen.set(true);\n }\n\n /** Close the overlay panel. */\n close(): void {\n this.isOpen.set(false);\n }\n\n // Overlay-mode trigger handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n this.isOpen.update(v => !v);\n }\n\n /** Trigger blur — mark the bound field touched. */\n /**\n * Leaving an INLINE tree marks it touched.\n *\n * `onBlur` below belongs to the overlay trigger, which only renders under\n * `openOn=\"overlay\"` — so an inline tree emitted `touch` on SELECTION and\n * nowhere else. Focusing it and walking away without choosing anything left\n * the control neither touched nor dirty, which is exactly the state a\n * `<wr-form-field>` waits for before it will show a message: a `required`\n * tree the user considered and skipped stayed silent, and the form looked\n * fine while being invalid.\n *\n * `relatedTarget` inside the host means focus only moved BETWEEN rows, which\n * is not leaving. A `null` one — clicking the page background, or a browser\n * that withholds it — counts as leaving, which is the safe direction: marking\n * touched too eagerly shows a message the field already had grounds for.\n */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof Node && this.host.nativeElement.contains(next)) return;\n this.touch.emit();\n }\n\n protected onBlur(): void {\n this.touch.emit();\n }\n\n /**\n * Backspace on the CLOSED overlay trigger — the keyboard twin of the two ×\n * controls inside it.\n *\n * Both the clear × and every chip's remove × are `tabindex=\"-1\"` spans inside\n * this `<button>`, and they carried `(keydown.enter)` / `(keydown.space)`\n * bindings that could never fire: a keydown goes to the focused element, and\n * those spans cannot be focused. The spans stay unfocusable, since a focusable\n * child of a button is `nested-interactive`.\n *\n * What that cost differs by mode, and the difference is worth keeping straight.\n * In SINGLE mode it was a real WCAG 2.1.1 failure: Enter on the selected row\n * re-selects it, so the × was the only way back to nothing. In MULTI mode it\n * was not — Ctrl/Cmd+Enter on a row in the panel toggles it off, which is the\n * route {@link WrTreeHarness.selectNode} drives with `additive`. The multi\n * branch below is parity with `wr-select` and a shorter path, not a repair.\n *\n * The same key and the same split `wr-select` uses, so the two read alike:\n * in MULTI mode Backspace drops the last chip — chip removal is its own\n * control, not gated on `clearable()` — and in SINGLE mode it clears, gated on\n * `clearable()`, because that input IS the clear control. Only while closed:\n * an open panel owns the keyboard.\n */\n protected onTriggerKey(event: KeyboardEvent): void {\n // The APG combobox keys, and the ones `wr-select` and `wr-cascader` open on:\n // ArrowDown / ArrowUp, with or without Alt. Enter and Space already open it\n // through the native button click.\n if ((event.key === 'ArrowDown' || event.key === 'ArrowUp') && !this.isOpen()) {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n this.isOpen.set(true);\n return;\n }\n if (event.key !== 'Backspace') return;\n if (this.disabled() || this.readonly() || this.isOpen() || !this.hasSelection()) return;\n\n if (this.isMulti()) {\n const chips = this.selectedChips();\n const last = chips[chips.length - 1];\n if (!last) return;\n event.preventDefault();\n this.removeChip(last.id, event);\n return;\n }\n\n if (!this.clearable()) return;\n event.preventDefault();\n this.clearSelection(event);\n }\n\n protected removeChip(id: TId, event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n const next = this.selected().filter(x => x !== id);\n this.selected.set(next);\n this.emit();\n }\n\n protected clearSelection(event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n this.selected.set([]);\n this.emit();\n }\n\n // Selection / expansion plumbing\n\n private toggleExpanded(id: TId): void {\n const set = new Set(this.expanded());\n const collapsing = set.has(id);\n if (collapsing) set.delete(id);\n else set.add(id);\n this.expanded.set([...set]);\n // A collapse that hid the cursor hands it to the row that hid it, the APG's\n // rule — so reopening the branch does not pull the tab stop back inside.\n if (!collapsing) return;\n const row = this.flat()[this.cursorIndex()];\n if (row) this.cursorId.set({ id: row.node.id });\n }\n\n private select(id: TId, additive: boolean): void {\n // Every selection path funnels through here — row click, Enter, Space — so\n // one guard covers them all while expand / collapse stays reachable.\n if (this.readonly()) return;\n const mode = this.selectionMode();\n if (mode === 'none') return;\n if (mode === 'single') {\n this.selected.set([id]);\n } else {\n const set = new Set(this.selected());\n if (additive) {\n if (set.has(id)) set.delete(id);\n else set.add(id);\n } else {\n // Plain click toggles single id in multi mode — common UX.\n if (set.size === 1 && set.has(id)) set.delete(id);\n else {\n set.clear();\n set.add(id);\n }\n }\n this.selected.set([...set]);\n }\n\n // Propagate to the bound value — in BOTH modes. The inbound half of this\n // bridge (the `value` -> `selected` effect above) was never gated, so\n // gating the outbound half left an inline tree in a form accepting a\n // programmatic write and never reporting the user's pick: `[formField]`\n // compiled, rows announced `aria-selected`, and the control stayed at its\n // initial value forever. One-way is worse than unsupported, because it\n // looks wired up. `[(selected)]` remains the inline-native API; `value`\n // simply stops lying. Closing on a single pick stays overlay-only — an\n // inline tree has no panel to close.\n this.emit();\n if (this.isOverlay() && mode === 'single' && this.selected().length > 0) {\n this.isOpen.set(false);\n }\n }\n\n private emit(): void {\n this.touch.emit();\n if (this.isMulti()) {\n this.value.set(this.selected());\n } else {\n this.value.set(this.selected()[0] ?? null);\n }\n }\n\n private focusIndex(i: number): void {\n this.focusedIndex.set(i);\n const row = this.flat()[i];\n this.cursorId.set(row ? { id: row.node.id } : null);\n if (this.virtualized()) {\n // Managed-focus (aria-activedescendant): focus stays on the list container.\n // Setting `scrollTop` synchronously materializes row `i` in the SAME change\n // detection pass, so the id referenced by `aria-activedescendant` is present\n // — no rAF/microtask race, no \"points at an absent id\" gap.\n this.ensureVisible(i);\n this.listElement?.focus();\n return;\n }\n // Non-virtual roving tabindex: defer so the DOM has updated tabindex, then\n // move focus to the row element.\n queueMicrotask(() => {\n const root = this.overlayRef?.overlayElement ?? this.host.nativeElement;\n const row = root.querySelector<HTMLElement>(`[data-tree-index=\"${i}\"]`);\n row?.focus();\n });\n }\n\n // Overlay\n\n private collectExpandableIds(list: readonly WrTreeNode<TId>[]): readonly TId[] {\n const out: TId[] = [];\n const walk = (items: readonly WrTreeNode<TId>[]): void => {\n for (const n of items) {\n if (n.children?.length) {\n out.push(n.id);\n walk(n.children);\n }\n }\n };\n walk(list);\n return out;\n }\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n const tpl = this.panelTpl();\n if (!tpl) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n width: this.host.nativeElement.getBoundingClientRect().width,\n panelClass: wrToClassList('wr-tree-overlay', this.panelClass()),\n });\n\n // The pane is appended to `<body>`, so the only thing telling it which way\n // to read is the `dir` the CDK captured when this ref was created. The\n // arrow-key mapping above reads `Directionality` LIVE, so without this a\n // mid-session flip left ArrowLeft opening branches the panel still indented\n // rightward. Ends with the ref; reopening installs a new one.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n this.overlayRef.attach(new TemplatePortal(tpl, this.vcr));\n\n // The panel owns the keyboard from here, in BOTH render shapes. `onKeydown`\n // lives on the `<ul>` inside the portal, and the trigger's own handler\n // (`onTriggerKey`) acts only while CLOSED, so leaving focus on the trigger —\n // which is what the non-virtual shape used to do — made an overlay tree\n // mouse-only: arrows, Home/End and\n // Enter all did nothing, and the rows were reachable only by tabbing through\n // the rest of the page, since the pane is appended to `<body>`. Virtual mode\n // focuses the LIST (managed focus via `aria-activedescendant`); the\n // non-virtual shape focuses the roving row, which carries the tab stop.\n //\n // `afterNextRender`, NOT `queueMicrotask`: under zoneless CD the scheduler\n // runs change detection in a macrotask, so a microtask queued here fires\n // first and focuses whatever the panel held before this open — the same trap\n // that once left `wr-calendar`'s ring and real focus on different days.\n afterNextRender(\n () => {\n if (this.virtualized()) {\n this.listElement?.focus();\n return;\n }\n const row = this.overlayRef?.overlayElement.querySelector<HTMLElement>(\n `[data-tree-index=\"${this.cursorIndex()}\"]`\n );\n row?.focus();\n },\n { injector: this.injector }\n );\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.isOpen.set(false);\n return;\n }\n if (event.key === 'Tab') {\n // Tab closes the panel and moves on from the TRIGGER, as `wr-dropdown`\n // does. Left alone, the browser's Tab ran from the row, and the pane\n // sits at the end of `<body>`: focus left the document and the panel\n // stayed open over a combobox nobody was on. So the trigger takes\n // focus here, synchronously and with no `preventDefault`, and the\n // browser's own Tab carries on from it to its real neighbour. Not from\n // a field outside the panel: the dispatcher routes every document\n // keydown to the topmost overlay, and that caret is not ours to move.\n const typedIn = event.target;\n const ours =\n typedIn instanceof Node &&\n (this.host.nativeElement.contains(typedIn) || (this.overlayRef?.overlayElement.contains(typedIn) ?? false));\n if (ours) this.host.nativeElement.querySelector<HTMLElement>('.wr-tree__trigger')?.focus();\n this.isOpen.set(false);\n }\n });\n\n this.opened.emit();\n }\n\n /** `notify: false` is the destroy path: an output cannot emit from a destroyed view. */\n private closeOverlay(notify = true): void {\n if (!this.overlayRef) return;\n // Hand the focus back before the panel it lives in disappears. The keyboard\n // path in virtual mode focuses the list itself, so closing left the document\n // focused on `<body>` and the next Tab started from the top of the page —\n // `wr-dropdown` returns focus to its own trigger for the same reason.\n const active = this.host.nativeElement.ownerDocument.activeElement;\n const inPanel = active instanceof Node && this.overlayRef.overlayElement.contains(active);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (!notify) return;\n if (inPanel) this.host.nativeElement.querySelector<HTMLElement>('.wr-tree__trigger')?.focus();\n this.closed.emit();\n }\n}\n","@if (isOverlay()) {\n <button\n type=\"button\"\n class=\"wr-tree__trigger\"\n role=\"combobox\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [disabled]=\"disabled()\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKey($event)\"\n (blur)=\"onBlur()\"\n >\n @if (isMulti()) {\n @if (hasSelection()) {\n <span class=\"wr-tree__chips\">\n @for (chip of visibleChips(); track chip.id) {\n <span class=\"wr-tree__chip\">\n <span class=\"wr-tree__chip-label\">{{ chip.label }}</span>\n <span\n class=\"wr-tree__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip(chip.id, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-tree__chip wr-tree__chip--more\">{{ chipMoreLabel({ count: extra }) }}</span>\n }\n </span>\n } @else {\n <span class=\"wr-tree__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n } @else {\n @if (singleLabel(); as label) {\n <span class=\"wr-tree__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-tree__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n }\n\n @if (clearable() && hasSelection() && !disabled() && !readonly()) {\n <span\n class=\"wr-tree__clear\"\n role=\"button\"\n [attr.aria-label]=\"clearLabel()\"\n tabindex=\"-1\"\n (click)=\"clearSelection($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-tree__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n\n <!-- Tree list lives inside the overlay panel. -->\n <ng-template #panelTpl>\n <div class=\"wr-tree-panel\" [class.wr-tree-panel--virtual]=\"virtualized()\" [attr.id]=\"panelId\">\n <ng-container [ngTemplateOutlet]=\"listTpl\" />\n </div>\n </ng-template>\n} @else {\n <ng-container [ngTemplateOutlet]=\"listTpl\" />\n}\n\n<!-- Shared row list — rendered inline (default) or projected into the\n overlay panel (when openOn=\"overlay\"). -->\n<ng-template #listTpl>\n <!-- Roving tabindex (non-virtual) / aria-activedescendant (virtual): the tree\n owns keyboard focus and routes arrow keys to its currently-focused row.\n The field's error state is bound here for the INLINE shape only — in\n overlay mode the trigger carries it, and the panel would otherwise\n describe the same error a second time. -->\n <ul\n class=\"wr-tree__list\"\n role=\"tree\"\n [attr.aria-multiselectable]=\"isMulti() ? 'true' : null\"\n [attr.aria-label]=\"isOverlay() ? null : ariaLabel()\"\n [attr.aria-labelledby]=\"isOverlay() ? null : fieldAria.labelledBy()\"\n [attr.aria-invalid]=\"isOverlay() ? null : fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"isOverlay() ? null : fieldAria.describedBy()\"\n [class.wr-tree__list--virtual]=\"virtualized()\"\n [attr.tabindex]=\"virtualized() ? 0 : null\"\n [attr.aria-activedescendant]=\"activeRowId()\"\n [style.max-height]=\"virtualized() ? resolvedViewportHeight() : null\"\n [style.overflow-y]=\"virtualized() ? 'auto' : null\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (virtualized() && virtualWindow().padTop > 0) {\n <!-- `aria-setsize` / `aria-posinset` in BOTH shapes: the list is flat with no\n `role=\"group\"` either way, so the set a row belongs to is never expressed\n by the DOM. Gated behind the virtual flag, the same tree announced a\n position with windowing on and nothing with it off. -->\n <li\n class=\"wr-tree__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [style.height.px]=\"virtualWindow().padTop\"\n ></li>\n }\n @for (entry of windowRows(); track entry.node.id) {\n <!-- Click handler lives on focusable rows; keyboard handling is owned\n by the parent <ul> via the roving-tabindex pattern. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <li\n class=\"wr-tree__row\"\n role=\"treeitem\"\n [attr.id]=\"virtualized() ? rowId(entry.index) : null\"\n [class.wr-tree__row--selected]=\"selectedSet().has(entry.node.id)\"\n [class.wr-tree__row--active]=\"virtualized() && entry.index === cursorIndex()\"\n [class.wr-tree__row--disabled]=\"entry.node.disabled\"\n [attr.aria-level]=\"entry.depth + 1\"\n [attr.aria-setsize]=\"entry.setsize\"\n [attr.aria-posinset]=\"entry.posinset\"\n [attr.aria-expanded]=\"entry.hasChildren ? expandedSet().has(entry.node.id) : null\"\n [attr.aria-selected]=\"selectionMode() === 'none' ? null : selectedSet().has(entry.node.id)\"\n [attr.aria-disabled]=\"entry.node.disabled || disabled() || null\"\n [attr.data-tree-index]=\"entry.index\"\n [attr.tabindex]=\"virtualized() ? null : entry.index === cursorIndex() ? 0 : -1\"\n [style.--wr-tree-depth]=\"entry.depth\"\n (click)=\"onRowClick(entry, $event)\"\n >\n @if (entry.hasChildren) {\n <button\n type=\"button\"\n class=\"wr-tree__toggle\"\n tabindex=\"-1\"\n [attr.aria-label]=\"expandedSet().has(entry.node.id) ? collapseLabel() : expandLabel()\"\n (click)=\"onToggleClick(entry.node, $event)\"\n >\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M3 1 L7 5 L3 9 Z\" fill=\"currentColor\" />\n </svg>\n </button>\n } @else {\n <span class=\"wr-tree__toggle wr-tree__toggle--leaf\" aria-hidden=\"true\"></span>\n }\n <span class=\"wr-tree__label\">{{ entry.node.label }}</span>\n </li>\n }\n @if (virtualized() && virtualWindow().padBottom > 0) {\n <li\n class=\"wr-tree__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [style.height.px]=\"virtualWindow().padBottom\"\n ></li>\n }\n </ul>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2DA,IAAI,WAAW;AAgDf,IAAa,SAAb,MAAa,OAAM;CAER,QAAQ,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7C,WAAW,MAAsB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAGpC,WAAW,MAAsB,CAAA,GAAG,GAAA,Y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MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAU;IAAI,MAAM;IAAa,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-tree.mjs","names":[],"sources":["../../../projects/lib/tree/tree.ts","../../../projects/lib/tree/tree.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList, wrCheckStyles, type WrClassInput } from 'ngwr/utils';\n\nimport type { WrTreeNode, WrTreeSelectionMode, WrTreeSize } from './types';\n\ninterface FlatNode<TId> {\n readonly node: WrTreeNode<TId>;\n readonly depth: number;\n readonly hasChildren: boolean;\n /** Absolute position in the flattened visible list. */\n readonly index: number;\n /** 1-based position within its sibling group (ARIA `aria-posinset`). */\n readonly posinset: number;\n /** Sibling count at this level (ARIA `aria-setsize`). */\n readonly setsize: number;\n}\n\ninterface SelectedChip<TId> {\n readonly id: TId;\n readonly label: string;\n}\n\nlet panelUid = 0;\n\n/**\n * Hierarchical tree. Data-driven — pass `[nodes]` with optional `children`\n * arrays. Supports single / multi selection (two-way `[(selected)]`),\n * controlled expand state (two-way `[(expanded)]`), and full keyboard\n * navigation.\n *\n * Two render shapes, picked by `[openOn]`:\n * - `'inline'` (default) — renders the tree list in-place. Use as a display\n * widget or form-less hierarchical picker.\n * - `'overlay'` — renders a `<wr-select>`-style trigger button (with chips\n * in multi mode) that opens a popover containing the tree. A signal-forms\n * native control: it implements `FormValueControl<unknown>`, so `[formField]`\n * binds straight to its `value` model — no `ControlValueAccessor` in between.\n * `[(value)]` and classic `[(ngModel)]` / reactive forms all keep working via\n * Angular's bridge. Replaces the standalone `<wr-tree-select>`.\n *\n * Value type in `overlay` mode: `TId | null` in single mode,\n * `readonly TId[]` in multi mode.\n *\n * @example\n * ```html\n * <!-- Inline tree (display widget) -->\n * <wr-tree [nodes]=\"folders\" [(selected)]=\"picked\" [(expanded)]=\"open\" />\n *\n * <!-- Form-bound combobox (signal forms) -->\n * <wr-tree\n * openOn=\"overlay\"\n * [nodes]=\"folders\"\n * selectionMode=\"single\"\n * [formField]=\"form.folder\"\n * placeholder=\"Pick a folder\"\n * />\n *\n * <!-- standalone two-way binding -->\n * <wr-tree openOn=\"overlay\" [nodes]=\"folders\" [(value)]=\"picked\" placeholder=\"Pick a folder\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/tree\n */\n@Component({\n selector: 'wr-tree',\n templateUrl: './tree.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-tree', '[class]': 'classes()', '(focusout)': 'onFocusOut($event)' },\n imports: [NgTemplateOutlet],\n})\nexport class WrTree<TId = string> implements FormValueControl<unknown> {\n /** Tree data. */\n readonly nodes = input<readonly WrTreeNode<TId>[]>([]);\n\n /** Selected node ids (two-way bindable). */\n readonly selected = model<readonly TId[]>([]);\n\n /** Expanded node ids (two-way bindable). */\n readonly expanded = model<readonly TId[]>([]);\n\n /** Selection behavior. @default 'single' */\n readonly selectionMode = input<WrTreeSelectionMode>('single');\n\n /**\n * Disable the whole tree. Bound automatically from the field's disabled\n * state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse selection changes while the tree stays focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * Expanding and collapsing keep working: a branch is NAVIGATION, not a value,\n * so a read-only tree is still browsable — it is picking and un-picking that\n * stops. In `overlay` mode the trigger additionally refuses to open, because\n * there the panel exists only to choose from and it already shows what is\n * chosen.\n *\n * `aria-readonly` rides on the combobox trigger only; role `tree` does not\n * support the state, so the inline shape has nothing valid to mirror it onto.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n // Overlay-mode inputs (ignored when openOn='inline')\n\n /** Render shape. @default 'inline' */\n readonly openOn = input<'inline' | 'overlay'>('inline');\n\n /** Trigger size — shares the `--wr-control-*` contract. The panel keeps its size. @default 'md' */\n readonly size = input<WrTreeSize>('md');\n\n /** Placeholder shown on the trigger when no node is selected. */\n readonly placeholder = input<string>('');\n\n /**\n * The same fall-through `wr-select` has had all along: an unset placeholder\n * takes the catalog's `tree.placeholder`, so an overlay trigger with nothing\n * selected reads \"Select…\" in the app's language instead of rendering an\n * empty span. The key shipped in both catalogs and nothing read it.\n */\n protected readonly resolvedPlaceholder = useI18nText(this.placeholder, 'tree.placeholder', '');\n\n /**\n * Accessible name of the overlay trigger. Falls back to the placeholder, then\n * to `select.label` — a `role=\"combobox\"` with nothing selected and no\n * placeholder otherwise has no name at all.\n *\n * An INLINE tree puts it on the `role=\"tree\"` itself, which ARIA requires to\n * have a name — an `aria-label` on the `<wr-tree>` host never reaches it.\n * Inside a `<wr-form-field>` the field's label names the tree instead.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly labelText = useI18nText(this.ariaLabel, 'select.label', 'Select');\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder must fall through to the catalog string.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.resolvedPlaceholder();\n return placeholder ? placeholder : this.labelText();\n });\n\n /** Show a clear-all (×) button on the trigger when at least one node is selected. @default true */\n readonly clearable = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Cap on the number of chips rendered on the trigger before\n * collapsing the rest into `+N more` (multi mode only). `0` = render\n * every chip. @default 0\n */\n readonly maxTagCount = input(0, {\n transform: (v: unknown): number => Math.max(0, Number(v) || 0),\n });\n\n /** Auto-expand every node that has children on first open of the overlay. @default false */\n readonly defaultExpandAll = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Window the visible-node list so a large tree keeps only ~one viewport of\n * rows in the DOM. Opt-in and OFF by default — a tree without it renders\n * byte-identically to today. Works in both `inline` and `overlay` shapes;\n * while on, keyboard navigation switches to the `aria-activedescendant`\n * pattern so Arrow / Home / End / Enter keep working across un-rendered rows.\n * @default false\n */\n readonly virtualScroll = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Uniform row height in px used to map scroll offset to node index. `0`\n * (default) measures the first rendered row once and reuses it, so it adapts\n * to the active density / touch target automatically. Read only when\n * `virtualScroll` is on. @default 0\n */\n readonly rowHeight = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Height of the scroll viewport when `virtualScroll` is on — a number (px) or\n * any CSS length (`'60vh'`). A numeric px value lets the server prerender the\n * exact first window. @default 288\n */\n readonly viewportHeight = input<number | string>(288);\n\n /** Extra rows kept rendered above and below the viewport as scroll headroom. @default 6 */\n readonly overscan = input(6, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 6)) });\n\n /**\n * Extra CSS classes for the overlay pane, when `openOn` puts the tree in one.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n *\n * Inline trees never open an overlay, so this input does nothing for the\n * default `openOn=\"inline\"` — the host element is right there to take a\n * class of its own.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Form value — the current selection as seen by a bound field. Bound by\n * `[formField]`, or two-way via `[(value)]`. Shape follows `selectionMode`:\n * `TId | null` in single mode, `readonly TId[]` in multi mode. Works in both\n * `openOn` modes; `[(selected)]` stays the inline-native API and always\n * carries an array, whatever the selection mode.\n */\n readonly value = model<unknown>(undefined);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** Fires after the overlay panel opens. */\n readonly opened = output<void>();\n\n /** Fires after the overlay panel closes. */\n readonly closed = output<void>();\n\n // Internals\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly injector = inject(Injector);\n /**\n * Ambient reading direction. Optional so a bare `TestBed` — or a consumer who\n * never set a direction — needs no provider; `Directionality` is root-provided\n * anyway, and a missing one simply reads as `ltr`.\n *\n * Read at keystroke time rather than cached, so a runtime `dir` flip needs no\n * subscription to `change` — the overlay is the half that does, and\n * `wrFollowDirection` in `openOverlay()` is where that lives.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /** Currently focused row's index in the flattened visible list. */\n protected readonly focusedIndex = signal(0);\n\n /**\n * The node the cursor is on, written with {@link focusedIndex}. The index alone\n * names a SLOT: opening a branch above the cursor or collapsing one around it\n * moves every row below, and the tab stop then sat on whichever node took the\n * slot — the next arrow walked from a row the user had never been on.\n */\n private readonly cursorId = signal<{ readonly id: TId } | null>(null);\n\n /** Each node's parent id, so a cursor hidden by a collapse can climb to a visible row. */\n private readonly parentMap = computed<ReadonlyMap<TId, TId>>(() => {\n const map = new Map<TId, TId>();\n const walk = (list: readonly WrTreeNode<TId>[], parent: TId | null): void => {\n for (const n of list) {\n if (parent !== null) map.set(n.id, parent);\n if (n.children?.length) walk(n.children, n.id);\n }\n };\n walk(this.nodes(), null);\n return map;\n });\n\n /**\n * The cursor as the DOM sees it: the row of the cursor's node, else its\n * nearest visible ancestor when a collapse hid it, else the raw index clamped\n * to the list that exists RIGHT NOW.\n *\n * The clamp is the last resort for a node that left the data altogether.\n * Nothing shrank the raw index when the list did: collapsing a branch above\n * the cursor left it past the end, which gave the tree zero rows with\n * `tabindex=\"0\"` (no way back in with Tab) and made every arrow key a no-op,\n * because `onKeydown` bails when `flat[i]` is undefined.\n */\n protected readonly cursorIndex = computed(() => {\n const flat = this.flat();\n const cursor = this.cursorId();\n if (cursor) {\n const parents = this.parentMap();\n for (let id: TId | undefined = cursor.id; id !== undefined; id = parents.get(id)) {\n const at = flat.findIndex(f => f.node.id === id);\n if (at !== -1) return at;\n }\n }\n return Math.min(this.focusedIndex(), Math.max(0, flat.length - 1));\n });\n\n /** Resolved ARIA labels — signals, so they follow both a late catalog and a locale switch. */\n protected readonly clearLabel = wrReadI18nText('tree.clearSelection', 'Clear selection');\n protected readonly expandLabel = wrReadI18nText('tree.expand', 'Expand');\n protected readonly collapseLabel = wrReadI18nText('tree.collapse', 'Collapse');\n protected readonly chipRemoveLabel = useI18nFormatter('tree.removeItem', 'Remove {{label}}');\n\n /**\n * The overflow chip past `maxTagCount`. It was the literal `+{{ extra }} more`\n * in the template while `wr-select` — the same chip, the same string — read\n * `select.more` from the catalog, so a Russian tree rendered\n * `[\"Черновик\", \"+2 more\"]`.\n */\n protected readonly chipMoreLabel = useI18nFormatter('tree.more', '+{{count}} more');\n\n /** Flattened list of currently visible nodes — what the template renders. */\n protected readonly flat = computed<readonly FlatNode<TId>[]>(() => {\n const expanded = new Set(this.expanded());\n const out: FlatNode<TId>[] = [];\n const walk = (list: readonly WrTreeNode<TId>[], depth: number): void => {\n list.forEach((node, i) => {\n const hasChildren = (node.children?.length ?? 0) > 0;\n out.push({ node, depth, hasChildren, index: out.length, posinset: i + 1, setsize: list.length });\n if (hasChildren && expanded.has(node.id)) walk(node.children!, depth + 1);\n });\n };\n walk(this.nodes(), 0);\n return out;\n });\n\n protected readonly selectedSet = computed(() => new Set(this.selected()));\n protected readonly expandedSet = computed(() => new Set(this.expanded()));\n\n protected readonly isOverlay = computed(() => this.openOn() === 'overlay');\n protected readonly isMulti = computed(() => this.selectionMode() === 'multi');\n protected readonly hasSelection = computed(() => this.selected().length > 0);\n\n /** Overlay-mode trigger label / chip map. */\n private readonly labelMap = computed<ReadonlyMap<TId, string>>(() => {\n const map = new Map<TId, string>();\n const walk = (list: readonly WrTreeNode<TId>[]): void => {\n for (const n of list) {\n map.set(n.id, n.label);\n if (n.children?.length) walk(n.children);\n }\n };\n walk(this.nodes());\n return map;\n });\n\n protected readonly selectedChips = computed<readonly SelectedChip<TId>[]>(() => {\n const map = this.labelMap();\n return this.selected().map<SelectedChip<TId>>(id => ({ id, label: map.get(id) ?? String(id) }));\n });\n\n protected readonly visibleChips = computed<readonly SelectedChip<TId>[]>(() => {\n const cap = this.maxTagCount();\n const chips = this.selectedChips();\n return cap > 0 && chips.length > cap ? chips.slice(0, cap) : chips;\n });\n\n protected readonly hiddenChipCount = computed(() => {\n const cap = this.maxTagCount();\n const total = this.selectedChips().length;\n return cap > 0 && total > cap ? total - cap : 0;\n });\n\n protected readonly singleLabel = computed<string | null>(() => {\n if (this.isMulti()) return null;\n const first = this.selected()[0];\n if (first == null) return null;\n return this.labelMap().get(first) ?? null;\n });\n\n /** Overlay open state. Only meaningful when `openOn='overlay'`. */\n protected readonly isOpen = signal(false);\n\n /** Trigger / panel id for `aria-controls`. */\n protected readonly panelId = `wr-tree-panel-${++panelUid}`;\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.disabled()) parts.push('wr-tree--disabled');\n else if (this.readonly()) parts.push('wr-tree--readonly');\n if (this.isOverlay()) {\n parts.push('wr-tree--combobox');\n const size = this.size();\n if (size !== 'md') parts.push(`wr-tree--${size}`);\n if (this.isOpen()) parts.push('wr-tree--open');\n if (this.isMulti()) parts.push('wr-tree--multi');\n }\n return parts.join(' ');\n });\n\n protected readonly panelTpl = viewChild('panelTpl', { read: TemplateRef });\n\n private overlayRef: OverlayRef | null = null;\n\n // --- Virtual scroll -------------------------------------------------------\n\n private static readonly FALLBACK_ROW_PX = 32;\n private static readonly FALLBACK_VIEWPORT_PX = 288;\n\n /** Live vertical scroll offset (px); 0 on the server / before first scroll. */\n private readonly scrollTop = signal(0);\n /** Measured viewport clientHeight (px); 0 until the browser observer fires. */\n private readonly viewportPx = signal(0);\n /** Measured first-row height (px) when `rowHeight` is auto; 0 until measured. */\n private readonly measuredRowPx = signal(0);\n\n /** Virtualization active (opt-in and there is anything to window). */\n protected readonly virtualized = computed(() => this.virtualScroll() && this.flat().length > 0);\n\n /** Effective uniform row height (px). */\n protected readonly effRowH = computed(() =>\n this.rowHeight() > 0 ? this.rowHeight() : this.measuredRowPx() || WrTree.FALLBACK_ROW_PX\n );\n\n /** Deterministic viewport px for SSR + first paint (numeric height, else fallback). */\n private readonly fallbackViewportPx = computed(() => {\n const h = this.viewportHeight();\n if (typeof h === 'number') return h;\n return /^\\d+$/.test(h) ? Number(h) : WrTree.FALLBACK_VIEWPORT_PX;\n });\n\n /** `viewportHeight` as a CSS length for the inline max-height (bare number → px). */\n protected readonly resolvedViewportHeight = computed(() => {\n const h = this.viewportHeight();\n return typeof h === 'number' || /^\\d+$/.test(h) ? `${h}px` : h;\n });\n\n /** Rendered window [start,end) + spacer pads (px). Pure math from `scrollTop`. */\n protected readonly virtualWindow = computed<{ start: number; end: number; padTop: number; padBottom: number }>(() => {\n const total = this.flat().length;\n if (!this.virtualized() || total === 0) return { start: 0, end: total, padTop: 0, padBottom: 0 };\n const h = this.effRowH();\n const vp = this.viewportPx() || this.fallbackViewportPx();\n const over = this.overscan();\n // Clamp `first` so a transient effRowH shrink (auto-measure landing below the\n // fallback within one frame) can't push it past the list and slice to empty.\n const first = Math.min(Math.floor(this.scrollTop() / h), total - 1);\n // `+ 1` covers the partial row at the viewport's bottom edge even at overscan 0.\n const count = Math.ceil(vp / h) + 1;\n const start = Math.max(0, first - over);\n const end = Math.min(total, first + count + over);\n return { start, end, padTop: start * h, padBottom: (total - end) * h };\n });\n\n /** Nodes placed in the list. SAME array instance as `flat()` when off → byte-identical DOM. */\n protected readonly windowRows = computed<readonly FlatNode<TId>[]>(() => {\n if (!this.virtualized()) return this.flat();\n const { start, end } = this.virtualWindow();\n return this.flat().slice(start, end);\n });\n\n /** Stable id for a row at flat index `i` — the `aria-activedescendant` target. */\n protected rowId(i: number): string {\n return `${this.panelId}-row-${i}`;\n }\n\n /**\n * Active-descendant id when virtualized (focus stays on the list container),\n * else `null`. Returns `null` while the focused row is outside the rendered\n * window (e.g. mouse-wheeled away) so `aria-activedescendant` never dangles at\n * a removed element — the next arrow key scrolls it back and re-establishes it.\n */\n protected readonly activeRowId = computed(() => {\n if (!this.virtualized()) return null;\n const i = this.cursorIndex();\n const { start, end } = this.virtualWindow();\n return i >= start && i < end ? this.rowId(i) : null;\n });\n\n /** The scrollable `<ul>` — inside the overlay panel in overlay mode, else in the host. */\n private get listElement(): HTMLElement | null {\n const root = this.overlayRef?.overlayElement ?? this.host.nativeElement;\n return root.querySelector<HTMLElement>('.wr-tree__list');\n }\n\n /** Scroll flat index `i` just into view (sets the `scrollTop` signal synchronously). */\n private ensureVisible(i: number): void {\n const h = this.effRowH();\n const vp = this.viewportPx() || this.fallbackViewportPx();\n const top = i * h;\n const cur = this.scrollTop();\n let next = cur;\n if (top < cur) next = top;\n else if (top + h > cur + vp) next = top + h - vp;\n if (next !== cur) {\n this.scrollTop.set(next);\n this.listElement?.scrollTo({ top: next });\n }\n }\n\n /** Whether this OPEN has already auto-expanded; reset when the panel closes. */\n private didExpandAll = false;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('tree');\n // Drive the overlay open/close in response to the `open` signal.\n effect(() => {\n if (!this.isOverlay()) return;\n if (this.isOpen()) {\n this.openOverlay();\n // Once per OPEN, which is what the input documents. Reading `expanded()`\n // as part of the guard made it a dependency of this effect, so closing\n // the last branch re-ran it and inflated the tree again — collapsible one\n // branch at a time, never all the way.\n if (this.defaultExpandAll() && !this.didExpandAll) {\n this.didExpandAll = true;\n untracked(() => {\n if (this.expanded().length === 0) this.expanded.set(this.collectExpandableIds(this.nodes()));\n });\n }\n } else {\n this.didExpandAll = false;\n this.closeOverlay();\n }\n });\n\n // Disabling the control closes any open overlay (mirrors the side effect\n // of the old CVA setDisabledState).\n effect(() => {\n if (this.disabled() || this.readonly()) this.isOpen.set(false);\n });\n\n // Bridge an external `value` write back into the internal `selected`\n // state (this is the old writeValue body). `undefined` is the untouched\n // sentinel — no field / ngModel has written yet, so leave any preset\n // `[(selected)]` alone; a real `null` still clears, exactly as\n // `writeValue(null)` did. Guarded against the echo of our own `emit()`\n // (equality check under `untracked`) so a live pick is never clobbered.\n effect(() => {\n const value = this.value();\n if (value === undefined) return;\n untracked(() => {\n const next: readonly TId[] = this.isMulti()\n ? Array.isArray(value)\n ? (value as readonly TId[])\n : []\n : value == null\n ? []\n : [value as TId];\n const current = this.selected();\n if (next.length === current.length && next.every((id, i) => id === current[i])) return;\n this.selected.set(next);\n });\n });\n\n // Wire the scroll listener + viewport/row measurement — only while virtual\n // and in the browser. Re-runs when the list (re)appears (overlay open, data\n // change), deferring the DOM read to a microtask so the portal / inline list\n // is attached. No-op on the server (SSR renders the deterministic first\n // window from inputs alone).\n effect(onCleanup => {\n if (!isPlatformBrowser(this.platformId) || !this.virtualScroll()) return;\n const open = this.isOverlay() ? this.isOpen() : true;\n this.flat();\n if (!open) return;\n let raf = 0;\n let ro: ResizeObserver | null = null;\n let el: HTMLElement | null = null;\n // `onCleanup` can run BEFORE the microtask below — the effect re-runs, or\n // the component is destroyed, in the same task that scheduled it. It would\n // then tear down nothing (`el` and `ro` are still null) and the\n // continuation would go on to attach a scroll listener and a\n // `ResizeObserver` that nothing is left to remove.\n let cancelled = false;\n const onScroll = (): void => {\n if (raf) return;\n raf = requestAnimationFrame(() => {\n raf = 0;\n if (el) this.scrollTop.set(el.scrollTop);\n });\n };\n queueMicrotask(() => {\n if (cancelled) return;\n el = this.listElement;\n if (!el) return;\n // The overlay `<ul>` is destroyed + recreated on each open, but the\n // `scrollTop` signal persists — restore the fresh element to it so a\n // reopened panel isn't blank (window computed from a non-zero signal\n // while the new DOM sits at scrollTop 0). No-op on first open / inline.\n if (el.scrollTop !== this.scrollTop()) el.scrollTop = this.scrollTop();\n this.viewportPx.set(el.clientHeight);\n if (this.rowHeight() === 0) {\n const h = el.querySelector<HTMLElement>('.wr-tree__row')?.offsetHeight ?? 0;\n if (h > 0) this.measuredRowPx.set(h);\n }\n el.addEventListener('scroll', onScroll, { passive: true });\n if (typeof ResizeObserver !== 'undefined') {\n ro = new ResizeObserver(() => {\n if (el) this.viewportPx.set(el.clientHeight);\n });\n ro.observe(el);\n }\n });\n onCleanup(() => {\n cancelled = true;\n if (raf) cancelAnimationFrame(raf);\n if (el) el.removeEventListener('scroll', onScroll);\n ro?.disconnect();\n });\n });\n\n this.destroyRef.onDestroy(() => this.closeOverlay(false));\n }\n\n // Template handlers\n\n protected onRowClick(flat: FlatNode<TId>, event: MouseEvent): void {\n if (this.disabled() || flat.node.disabled) return;\n if (flat.hasChildren && (event.target as HTMLElement).closest('.wr-tree__toggle')) {\n this.toggleExpanded(flat.node.id);\n return;\n }\n this.focusIndex(flat.index);\n this.select(flat.node.id, event.ctrlKey || event.metaKey);\n }\n\n protected onToggleClick(node: WrTreeNode<TId>, event: MouseEvent): void {\n event.stopPropagation();\n if (this.disabled() || node.disabled) return;\n this.toggleExpanded(node.id);\n }\n\n /**\n * Map a physical arrow onto the expand / collapse axis.\n *\n * The APG gives ArrowRight the job of opening a branch and ArrowLeft the job\n * of closing it because the arrows follow the INDENT, and the indent grows\n * rightward. Under `dir=\"rtl\"` it grows leftward, so the two swap — without\n * this an RTL user cannot open a node at all.\n *\n * Up / Down travel the block axis and Home / End name a semantic position\n * (first / last), so all four are returned untouched in both directions.\n */\n private inlineKey(key: string): string {\n if (this.dir?.value !== 'rtl') return key;\n if (key === 'ArrowRight') return 'ArrowLeft';\n if (key === 'ArrowLeft') return 'ArrowRight';\n return key;\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) return;\n const flat = this.flat();\n const i = this.cursorIndex();\n const current = flat[i];\n if (!current) return;\n\n // The cursor move is identical in both render shapes — `focusIndex()` owns\n // the roving-tabindex / `aria-activedescendant` split — so mirroring here\n // covers the windowed tree too.\n switch (this.inlineKey(event.key)) {\n case 'ArrowDown':\n event.preventDefault();\n this.focusIndex(Math.min(flat.length - 1, i + 1));\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusIndex(Math.max(0, i - 1));\n break;\n case 'ArrowRight':\n event.preventDefault();\n if (current.hasChildren && !this.expandedSet().has(current.node.id)) {\n this.toggleExpanded(current.node.id);\n } else if (current.hasChildren) {\n this.focusIndex(Math.min(flat.length - 1, i + 1));\n }\n break;\n case 'ArrowLeft':\n event.preventDefault();\n if (current.hasChildren && this.expandedSet().has(current.node.id)) {\n this.toggleExpanded(current.node.id);\n } else if (current.depth > 0) {\n for (let j = i - 1; j >= 0; j--) {\n if (flat[j].depth < current.depth) {\n this.focusIndex(j);\n break;\n }\n }\n }\n break;\n case 'Home':\n event.preventDefault();\n this.focusIndex(0);\n break;\n case 'End':\n event.preventDefault();\n this.focusIndex(flat.length - 1);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n if (!current.node.disabled) this.select(current.node.id, event.ctrlKey || event.metaKey);\n break;\n default:\n break;\n }\n }\n\n /**\n * Focus the tree — what Signal Forms calls to focus this control. Focus goes\n * where Tab would put it: the row holding the roving tab stop, or the list\n * itself while it is windowed, since the list is the tab stop then. In overlay\n * mode that is the trigger, and the panel stays shut.\n */\n focus(options?: FocusOptions): void {\n const host = this.host.nativeElement;\n let stop: HTMLElement | null;\n if (this.isOverlay()) stop = host.querySelector<HTMLElement>('.wr-tree__trigger');\n else if (this.virtualized()) stop = host.querySelector<HTMLElement>('.wr-tree__list');\n else stop = host.querySelector<HTMLElement>(`[data-tree-index=\"${this.cursorIndex()}\"]`);\n stop?.focus(options);\n }\n\n /** Open the overlay panel, as the trigger does. Refused inline, and while disabled or read-only. */\n open(): void {\n if (!this.isOverlay() || this.disabled() || this.readonly()) return;\n this.isOpen.set(true);\n }\n\n /** Close the overlay panel. */\n close(): void {\n this.isOpen.set(false);\n }\n\n // Overlay-mode trigger handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n this.isOpen.update(v => !v);\n }\n\n /** Trigger blur — mark the bound field touched. */\n /**\n * Leaving an INLINE tree marks it touched.\n *\n * `onBlur` below belongs to the overlay trigger, which only renders under\n * `openOn=\"overlay\"` — so an inline tree emitted `touch` on SELECTION and\n * nowhere else. Focusing it and walking away without choosing anything left\n * the control neither touched nor dirty, which is exactly the state a\n * `<wr-form-field>` waits for before it will show a message: a `required`\n * tree the user considered and skipped stayed silent, and the form looked\n * fine while being invalid.\n *\n * `relatedTarget` inside the host means focus only moved BETWEEN rows, which\n * is not leaving. A `null` one — clicking the page background, or a browser\n * that withholds it — counts as leaving, which is the safe direction: marking\n * touched too eagerly shows a message the field already had grounds for.\n */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof Node && this.host.nativeElement.contains(next)) return;\n this.touch.emit();\n }\n\n protected onBlur(): void {\n this.touch.emit();\n }\n\n /**\n * Backspace on the CLOSED overlay trigger — the keyboard twin of the two ×\n * controls inside it.\n *\n * Both the clear × and every chip's remove × are `tabindex=\"-1\"` spans inside\n * this `<button>`, and they carried `(keydown.enter)` / `(keydown.space)`\n * bindings that could never fire: a keydown goes to the focused element, and\n * those spans cannot be focused. The spans stay unfocusable, since a focusable\n * child of a button is `nested-interactive`.\n *\n * What that cost differs by mode, and the difference is worth keeping straight.\n * In SINGLE mode it was a real WCAG 2.1.1 failure: Enter on the selected row\n * re-selects it, so the × was the only way back to nothing. In MULTI mode it\n * was not — Ctrl/Cmd+Enter on a row in the panel toggles it off, which is the\n * route {@link WrTreeHarness.selectNode} drives with `additive`. The multi\n * branch below is parity with `wr-select` and a shorter path, not a repair.\n *\n * The same key and the same split `wr-select` uses, so the two read alike:\n * in MULTI mode Backspace drops the last chip — chip removal is its own\n * control, not gated on `clearable()` — and in SINGLE mode it clears, gated on\n * `clearable()`, because that input IS the clear control. Only while closed:\n * an open panel owns the keyboard.\n */\n protected onTriggerKey(event: KeyboardEvent): void {\n // The APG combobox keys, and the ones `wr-select` and `wr-cascader` open on:\n // ArrowDown / ArrowUp, with or without Alt. Enter and Space already open it\n // through the native button click.\n if ((event.key === 'ArrowDown' || event.key === 'ArrowUp') && !this.isOpen()) {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n this.isOpen.set(true);\n return;\n }\n if (event.key !== 'Backspace') return;\n if (this.disabled() || this.readonly() || this.isOpen() || !this.hasSelection()) return;\n\n if (this.isMulti()) {\n const chips = this.selectedChips();\n const last = chips[chips.length - 1];\n if (!last) return;\n event.preventDefault();\n this.removeChip(last.id, event);\n return;\n }\n\n if (!this.clearable()) return;\n event.preventDefault();\n this.clearSelection(event);\n }\n\n protected removeChip(id: TId, event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n const next = this.selected().filter(x => x !== id);\n this.selected.set(next);\n this.emit();\n }\n\n protected clearSelection(event: Event): void {\n event.stopPropagation();\n if (this.disabled() || this.readonly()) return;\n this.selected.set([]);\n this.emit();\n }\n\n // Selection / expansion plumbing\n\n private toggleExpanded(id: TId): void {\n const set = new Set(this.expanded());\n const collapsing = set.has(id);\n if (collapsing) set.delete(id);\n else set.add(id);\n this.expanded.set([...set]);\n // A collapse that hid the cursor hands it to the row that hid it, the APG's\n // rule — so reopening the branch does not pull the tab stop back inside.\n if (!collapsing) return;\n const row = this.flat()[this.cursorIndex()];\n if (row) this.cursorId.set({ id: row.node.id });\n }\n\n private select(id: TId, additive: boolean): void {\n // Every selection path funnels through here — row click, Enter, Space — so\n // one guard covers them all while expand / collapse stays reachable.\n if (this.readonly()) return;\n const mode = this.selectionMode();\n if (mode === 'none') return;\n if (mode === 'single') {\n this.selected.set([id]);\n } else {\n const set = new Set(this.selected());\n if (additive) {\n if (set.has(id)) set.delete(id);\n else set.add(id);\n } else {\n // Plain click toggles single id in multi mode — common UX.\n if (set.size === 1 && set.has(id)) set.delete(id);\n else {\n set.clear();\n set.add(id);\n }\n }\n this.selected.set([...set]);\n }\n\n // Propagate to the bound value — in BOTH modes. The inbound half of this\n // bridge (the `value` -> `selected` effect above) was never gated, so\n // gating the outbound half left an inline tree in a form accepting a\n // programmatic write and never reporting the user's pick: `[formField]`\n // compiled, rows announced `aria-selected`, and the control stayed at its\n // initial value forever. One-way is worse than unsupported, because it\n // looks wired up. `[(selected)]` remains the inline-native API; `value`\n // simply stops lying. Closing on a single pick stays overlay-only — an\n // inline tree has no panel to close.\n this.emit();\n if (this.isOverlay() && mode === 'single' && this.selected().length > 0) {\n this.isOpen.set(false);\n }\n }\n\n private emit(): void {\n this.touch.emit();\n if (this.isMulti()) {\n this.value.set(this.selected());\n } else {\n this.value.set(this.selected()[0] ?? null);\n }\n }\n\n private focusIndex(i: number): void {\n this.focusedIndex.set(i);\n const row = this.flat()[i];\n this.cursorId.set(row ? { id: row.node.id } : null);\n if (this.virtualized()) {\n // Managed-focus (aria-activedescendant): focus stays on the list container.\n // Setting `scrollTop` synchronously materializes row `i` in the SAME change\n // detection pass, so the id referenced by `aria-activedescendant` is present\n // — no rAF/microtask race, no \"points at an absent id\" gap.\n this.ensureVisible(i);\n this.listElement?.focus();\n return;\n }\n // Non-virtual roving tabindex: defer so the DOM has updated tabindex, then\n // move focus to the row element.\n queueMicrotask(() => {\n const root = this.overlayRef?.overlayElement ?? this.host.nativeElement;\n const row = root.querySelector<HTMLElement>(`[data-tree-index=\"${i}\"]`);\n row?.focus();\n });\n }\n\n // Overlay\n\n private collectExpandableIds(list: readonly WrTreeNode<TId>[]): readonly TId[] {\n const out: TId[] = [];\n const walk = (items: readonly WrTreeNode<TId>[]): void => {\n for (const n of items) {\n if (n.children?.length) {\n out.push(n.id);\n walk(n.children);\n }\n }\n };\n walk(list);\n return out;\n }\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n const tpl = this.panelTpl();\n if (!tpl) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n ])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n width: this.host.nativeElement.getBoundingClientRect().width,\n panelClass: wrToClassList('wr-tree-overlay', this.panelClass()),\n });\n\n // The pane is appended to `<body>`, so the only thing telling it which way\n // to read is the `dir` the CDK captured when this ref was created. The\n // arrow-key mapping above reads `Directionality` LIVE, so without this a\n // mid-session flip left ArrowLeft opening branches the panel still indented\n // rightward. Ends with the ref; reopening installs a new one.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n this.overlayRef.attach(new TemplatePortal(tpl, this.vcr));\n\n // The panel owns the keyboard from here, in BOTH render shapes. `onKeydown`\n // lives on the `<ul>` inside the portal, and the trigger's own handler\n // (`onTriggerKey`) acts only while CLOSED, so leaving focus on the trigger —\n // which is what the non-virtual shape used to do — made an overlay tree\n // mouse-only: arrows, Home/End and\n // Enter all did nothing, and the rows were reachable only by tabbing through\n // the rest of the page, since the pane is appended to `<body>`. Virtual mode\n // focuses the LIST (managed focus via `aria-activedescendant`); the\n // non-virtual shape focuses the roving row, which carries the tab stop.\n //\n // `afterNextRender`, NOT `queueMicrotask`: under zoneless CD the scheduler\n // runs change detection in a macrotask, so a microtask queued here fires\n // first and focuses whatever the panel held before this open — the same trap\n // that once left `wr-calendar`'s ring and real focus on different days.\n afterNextRender(\n () => {\n if (this.virtualized()) {\n this.listElement?.focus();\n return;\n }\n const row = this.overlayRef?.overlayElement.querySelector<HTMLElement>(\n `[data-tree-index=\"${this.cursorIndex()}\"]`\n );\n row?.focus();\n },\n { injector: this.injector }\n );\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.isOpen.set(false);\n return;\n }\n if (event.key === 'Tab') {\n // Tab closes the panel and moves on from the TRIGGER, as `wr-dropdown`\n // does. Left alone, the browser's Tab ran from the row, and the pane\n // sits at the end of `<body>`: focus left the document and the panel\n // stayed open over a combobox nobody was on. So the trigger takes\n // focus here, synchronously and with no `preventDefault`, and the\n // browser's own Tab carries on from it to its real neighbour. Not from\n // a field outside the panel: the dispatcher routes every document\n // keydown to the topmost overlay, and that caret is not ours to move.\n const typedIn = event.target;\n const ours =\n typedIn instanceof Node &&\n (this.host.nativeElement.contains(typedIn) || (this.overlayRef?.overlayElement.contains(typedIn) ?? false));\n if (ours) this.host.nativeElement.querySelector<HTMLElement>('.wr-tree__trigger')?.focus();\n this.isOpen.set(false);\n }\n });\n\n this.opened.emit();\n }\n\n /** `notify: false` is the destroy path: an output cannot emit from a destroyed view. */\n private closeOverlay(notify = true): void {\n if (!this.overlayRef) return;\n // Hand the focus back before the panel it lives in disappears. The keyboard\n // path in virtual mode focuses the list itself, so closing left the document\n // focused on `<body>` and the next Tab started from the top of the page —\n // `wr-dropdown` returns focus to its own trigger for the same reason.\n const active = this.host.nativeElement.ownerDocument.activeElement;\n const inPanel = active instanceof Node && this.overlayRef.overlayElement.contains(active);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (!notify) return;\n if (inPanel) this.host.nativeElement.querySelector<HTMLElement>('.wr-tree__trigger')?.focus();\n this.closed.emit();\n }\n}\n","@if (isOverlay()) {\n <button\n type=\"button\"\n class=\"wr-tree__trigger\"\n role=\"combobox\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [disabled]=\"disabled()\"\n [attr.aria-haspopup]=\"'tree'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onTriggerClick()\"\n (keydown)=\"onTriggerKey($event)\"\n (blur)=\"onBlur()\"\n >\n @if (isMulti()) {\n @if (hasSelection()) {\n <span class=\"wr-tree__chips\">\n @for (chip of visibleChips(); track chip.id) {\n <span class=\"wr-tree__chip\">\n <span class=\"wr-tree__chip-label\">{{ chip.label }}</span>\n <span\n class=\"wr-tree__chip-remove\"\n role=\"button\"\n [attr.aria-label]=\"chipRemoveLabel({ label: chip.label })\"\n tabindex=\"-1\"\n (click)=\"removeChip(chip.id, $event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n </span>\n }\n @if (hiddenChipCount(); as extra) {\n <span class=\"wr-tree__chip wr-tree__chip--more\">{{ chipMoreLabel({ count: extra }) }}</span>\n }\n </span>\n } @else {\n <span class=\"wr-tree__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n } @else {\n @if (singleLabel(); as label) {\n <span class=\"wr-tree__value\">{{ label }}</span>\n } @else {\n <span class=\"wr-tree__placeholder\">{{ resolvedPlaceholder() }}</span>\n }\n }\n\n @if (clearable() && hasSelection() && !disabled() && !readonly()) {\n <span\n class=\"wr-tree__clear\"\n role=\"button\"\n [attr.aria-label]=\"clearLabel()\"\n tabindex=\"-1\"\n (click)=\"clearSelection($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n\n <svg\n class=\"wr-icon__svg wr-tree__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n\n <!-- Tree list lives inside the overlay panel. -->\n <ng-template #panelTpl>\n <div class=\"wr-tree-panel\" [class.wr-tree-panel--virtual]=\"virtualized()\" [attr.id]=\"panelId\">\n <ng-container [ngTemplateOutlet]=\"listTpl\" />\n </div>\n </ng-template>\n} @else {\n <ng-container [ngTemplateOutlet]=\"listTpl\" />\n}\n\n<!-- Shared row list — rendered inline (default) or projected into the\n overlay panel (when openOn=\"overlay\"). -->\n<ng-template #listTpl>\n <!-- Roving tabindex (non-virtual) / aria-activedescendant (virtual): the tree\n owns keyboard focus and routes arrow keys to its currently-focused row.\n The field's error state is bound here for the INLINE shape only — in\n overlay mode the trigger carries it, and the panel would otherwise\n describe the same error a second time. -->\n <ul\n class=\"wr-tree__list\"\n role=\"tree\"\n [attr.aria-multiselectable]=\"isMulti() ? 'true' : null\"\n [attr.aria-label]=\"isOverlay() ? null : ariaLabel()\"\n [attr.aria-labelledby]=\"isOverlay() ? null : fieldAria.labelledBy()\"\n [attr.aria-invalid]=\"isOverlay() ? null : fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"isOverlay() ? null : fieldAria.describedBy()\"\n [class.wr-tree__list--virtual]=\"virtualized()\"\n [attr.tabindex]=\"virtualized() ? 0 : null\"\n [attr.aria-activedescendant]=\"activeRowId()\"\n [style.max-height]=\"virtualized() ? resolvedViewportHeight() : null\"\n [style.overflow-y]=\"virtualized() ? 'auto' : null\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (virtualized() && virtualWindow().padTop > 0) {\n <!-- `aria-setsize` / `aria-posinset` in BOTH shapes: the list is flat with no\n `role=\"group\"` either way, so the set a row belongs to is never expressed\n by the DOM. Gated behind the virtual flag, the same tree announced a\n position with windowing on and nothing with it off. -->\n <li\n class=\"wr-tree__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [style.height.px]=\"virtualWindow().padTop\"\n ></li>\n }\n @for (entry of windowRows(); track entry.node.id) {\n <!-- Click handler lives on focusable rows; keyboard handling is owned\n by the parent <ul> via the roving-tabindex pattern. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <li\n class=\"wr-tree__row\"\n role=\"treeitem\"\n [attr.id]=\"virtualized() ? rowId(entry.index) : null\"\n [class.wr-tree__row--selected]=\"selectedSet().has(entry.node.id)\"\n [class.wr-tree__row--active]=\"virtualized() && entry.index === cursorIndex()\"\n [class.wr-tree__row--disabled]=\"entry.node.disabled\"\n [attr.aria-level]=\"entry.depth + 1\"\n [attr.aria-setsize]=\"entry.setsize\"\n [attr.aria-posinset]=\"entry.posinset\"\n [attr.aria-expanded]=\"entry.hasChildren ? expandedSet().has(entry.node.id) : null\"\n [attr.aria-selected]=\"selectionMode() === 'none' ? null : selectedSet().has(entry.node.id)\"\n [attr.aria-disabled]=\"entry.node.disabled || disabled() || null\"\n [attr.data-tree-index]=\"entry.index\"\n [attr.tabindex]=\"virtualized() ? null : entry.index === cursorIndex() ? 0 : -1\"\n [style.--wr-tree-depth]=\"entry.depth\"\n (click)=\"onRowClick(entry, $event)\"\n >\n @if (entry.hasChildren) {\n <button\n type=\"button\"\n class=\"wr-tree__toggle\"\n tabindex=\"-1\"\n [attr.aria-label]=\"expandedSet().has(entry.node.id) ? collapseLabel() : expandLabel()\"\n (click)=\"onToggleClick(entry.node, $event)\"\n >\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M3 1 L7 5 L3 9 Z\" fill=\"currentColor\" />\n </svg>\n </button>\n } @else {\n <span class=\"wr-tree__toggle wr-tree__toggle--leaf\" aria-hidden=\"true\"></span>\n }\n <span class=\"wr-tree__label\">{{ entry.node.label }}</span>\n </li>\n }\n @if (virtualized() && virtualWindow().padBottom > 0) {\n <li\n class=\"wr-tree__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [style.height.px]=\"virtualWindow().padBottom\"\n ></li>\n }\n </ul>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2DA,IAAI,WAAW;AAgDf,IAAa,SAAb,MAAa,OAAM;CAER,QAAQ,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7C,WAAW,MAAsB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAGpC,WAAW,MAAsB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,C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EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAU;IAAI,MAAM;IAAa,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -24,7 +24,7 @@ var WrTypography = class WrTypography {
24
24
  transform: coerceBooleanProperty
25
25
  });
26
26
  classes = computed(() => {
27
- const parts = ["wr-typography", `wr-typography--${this.variant()}`];
27
+ const parts = [`wr-typography--${this.variant()}`];
28
28
  const tone = this.tone();
29
29
  if (tone) parts.push(`wr-typography--tone-${tone}`);
30
30
  const align = this.align();
@@ -84,7 +84,10 @@ var WrTypography = class WrTypography {
84
84
  transformFunction: null
85
85
  }
86
86
  },
87
- host: { properties: { "class": "classes()" } },
87
+ host: {
88
+ properties: { "class": "classes()" },
89
+ classAttribute: "wr-typography"
90
+ },
88
91
  ngImport: i0
89
92
  });
90
93
  };
@@ -97,7 +100,10 @@ i0.ɵɵngDeclareClassMetadata({
97
100
  type: Directive,
98
101
  args: [{
99
102
  selector: "[wrTypography]",
100
- host: { "[class]": "classes()" }
103
+ host: {
104
+ class: "wr-typography",
105
+ "[class]": "classes()"
106
+ }
101
107
  }]
102
108
  }],
103
109
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-typography.mjs","names":[],"sources":["../../../projects/lib/typography/typography.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTypographyAlign, WrTypographyTone, WrTypographyVariant } from './types';\n\n/**\n * Semantic typography directive. Attaches to any native element and\n * applies the visual treatment for the chosen `variant` (`h1`–`h6`,\n * `display`, `lead`, `body`, `small`, `caption`, `overline`, `code`, `list`,\n * `link`).\n *\n * Reads from the same `--wr-text-*` / `--wr-font-weight-*` / `--wr-leading-*`\n * tokens used by the opt-in typography utility classes — themeable by\n * overriding tokens at `:root`.\n *\n * @example\n * ```html\n * <h1 wrTypography variant=\"display\">Build interfaces</h1>\n * <h2 wrTypography variant=\"h2\" tone=\"primary\">that feel alive.</h2>\n * <p wrTypography variant=\"lead\">A developer-first library.</p>\n * <span wrTypography variant=\"caption\" tone=\"muted\">v1.6.0 — released today</span>\n * <code wrTypography variant=\"code\">inject(WrTheme)</code>\n * ```\n *\n * @see https://ngwr.dev/guides/typography/overview\n */\n@Directive({\n selector: '[wrTypography]',\n host: { '[class]': 'classes()' },\n})\nexport class WrTypography {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('typography');\n }\n\n /** Visual variant. @default 'body' */\n readonly variant = input<WrTypographyVariant>('body');\n\n /**\n * Color tone. `null` (default) keeps the variant's own color — the page ink\n * for headings and body, the muted role for `lead`, `caption`, `overline`\n * and `list`, primary for links. `tone=\"base\"` pulls a muted variant back to\n * the page ink.\n * Every other tone is emphasis only: a tone never carries a state on its\n * own. Four of the five intents share one lightness, and `success` against\n * `danger` is 1.05:1 as text, so the words have to name the state\n * (`500 Server Error`, not a red `Request`) — or reach for `<wr-alert>`,\n * which draws a glyph per type.\n */\n readonly tone = input<WrTypographyTone | null>(null);\n\n /** Horizontal alignment. */\n readonly align = input<WrTypographyAlign | null>(null);\n\n /** Truncate to single line with ellipsis. @default false */\n readonly truncate = input(false, { transform: coerceBooleanProperty });\n\n /** Render with monospace font. @default false (auto-true for `code`) */\n readonly mono = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-typography', `wr-typography--${this.variant()}`];\n const tone = this.tone();\n if (tone) parts.push(`wr-typography--tone-${tone}`);\n const align = this.align();\n if (align) parts.push(`wr-typography--align-${align}`);\n if (this.truncate()) parts.push('wr-typography--truncate');\n if (this.mono() || this.variant() === 'code') parts.push('wr-typography--mono');\n return parts.join(' ');\n });\n}\n"],"mappings":";;;;;;;;;;AAuCA,IAAa,eAAb,MAAa,aAAY;CACvB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,YAAY;CAC/E;CAGS,UAAU,MAA2B,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAa5C,OAAO,MAA+B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAG3C,QAAQ,MAAgC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7C,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,OAAO,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAE5C,UAAU,eAAc;EACzC,MAAM,QAAQ,CAAC,iBAAiB,kBAAkB,KAAK,QAAO,GAAI;EAClE,MAAM,OAAO,KAAK,KAAI;EACtB,IAAI,MAAM,MAAM,KAAK,uBAAuB,MAAM;EAClD,MAAM,QAAQ,KAAK,MAAK;EACxB,IAAI,OAAO,MAAM,KAAK,wBAAwB,OAAO;EACrD,IAAI,KAAK,SAAQ,GAAI,MAAM,KAAK,yBAAyB;EACzD,IAAI,KAAK,KAAI,KAAM,KAAK,QAAO,MAAO,QAAQ,MAAM,KAAK,qBAAqB;EAC9E,OAAO,MAAM,KAAK,GAAG;CACvB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAvCS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,SAAA,YAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAJxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,WAAW,YAAW;EAC/B,CAAA"}
1
+ {"version":3,"file":"ngwr-typography.mjs","names":[],"sources":["../../../projects/lib/typography/typography.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTypographyAlign, WrTypographyTone, WrTypographyVariant } from './types';\n\n/**\n * Semantic typography directive. Attaches to any native element and\n * applies the visual treatment for the chosen `variant` (`h1`–`h6`,\n * `display`, `lead`, `body`, `small`, `caption`, `overline`, `code`, `list`,\n * `link`).\n *\n * Reads from the same `--wr-text-*` / `--wr-font-weight-*` / `--wr-leading-*`\n * tokens used by the opt-in typography utility classes — themeable by\n * overriding tokens at `:root`.\n *\n * @example\n * ```html\n * <h1 wrTypography variant=\"display\">Build interfaces</h1>\n * <h2 wrTypography variant=\"h2\" tone=\"primary\">that feel alive.</h2>\n * <p wrTypography variant=\"lead\">A developer-first library.</p>\n * <span wrTypography variant=\"caption\" tone=\"muted\">v1.6.0 — released today</span>\n * <code wrTypography variant=\"code\">inject(WrTheme)</code>\n * ```\n *\n * @see https://ngwr.dev/guides/typography/overview\n */\n@Directive({\n selector: '[wrTypography]',\n host: { class: 'wr-typography', '[class]': 'classes()' },\n})\nexport class WrTypography {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('typography');\n }\n\n /** Visual variant. @default 'body' */\n readonly variant = input<WrTypographyVariant>('body');\n\n /**\n * Color tone. `null` (default) keeps the variant's own color — the page ink\n * for headings and body, the muted role for `lead`, `caption`, `overline`\n * and `list`, primary for links. `tone=\"base\"` pulls a muted variant back to\n * the page ink.\n * Every other tone is emphasis only: a tone never carries a state on its\n * own. Four of the five intents share one lightness, and `success` against\n * `danger` is 1.05:1 as text, so the words have to name the state\n * (`500 Server Error`, not a red `Request`) — or reach for `<wr-alert>`,\n * which draws a glyph per type.\n */\n readonly tone = input<WrTypographyTone | null>(null);\n\n /** Horizontal alignment. */\n readonly align = input<WrTypographyAlign | null>(null);\n\n /** Truncate to single line with ellipsis. @default false */\n readonly truncate = input(false, { transform: coerceBooleanProperty });\n\n /** Render with monospace font. @default false (auto-true for `code`) */\n readonly mono = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = [`wr-typography--${this.variant()}`];\n const tone = this.tone();\n if (tone) parts.push(`wr-typography--tone-${tone}`);\n const align = this.align();\n if (align) parts.push(`wr-typography--align-${align}`);\n if (this.truncate()) parts.push('wr-typography--truncate');\n if (this.mono() || this.variant() === 'code') parts.push('wr-typography--mono');\n return parts.join(' ');\n });\n}\n"],"mappings":";;;;;;;;;;AAuCA,IAAa,eAAb,MAAa,aAAY;CACvB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,YAAY;CAC/E;CAGS,UAAU,MAA2B,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAa5C,OAAO,MAA+B,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAG3C,QAAQ,MAAgC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7C,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,OAAO,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAE5C,UAAU,eAAc;EACzC,MAAM,QAAQ,CAAC,kBAAkB,KAAK,QAAO,GAAI;EACjD,MAAM,OAAO,KAAK,KAAI;EACtB,IAAI,MAAM,MAAM,KAAK,uBAAuB,MAAM;EAClD,MAAM,QAAQ,KAAK,MAAK;EACxB,IAAI,OAAO,MAAM,KAAK,wBAAwB,OAAO;EACrD,IAAI,KAAK,SAAQ,GAAI,MAAM,KAAK,yBAAyB;EACzD,IAAI,KAAK,KAAI,KAAM,KAAK,QAAO,MAAO,QAAQ,MAAM,KAAK,qBAAqB;EAC9E,OAAO,MAAM,KAAK,GAAG;CACvB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAvCS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,SAAA,YAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EAJxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IAAE,OAAO;IAAiB,WAAW;GAAW;EACvD,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
- import { DestroyRef, PLATFORM_ID, Service, assertInInjectionContext, inject, signal, untracked } from "@angular/core";
2
+ import { ApplicationRef, DestroyRef, PLATFORM_ID, Service, assertInInjectionContext, inject, provideAppInitializer, signal, untracked } from "@angular/core";
3
3
  import { isPlatformBrowser } from "@angular/common";
4
+ import { wrFeature } from "ngwr/utils";
4
5
  import { NavigationCancel, NavigationEnd, NavigationError, NavigationSkipped, NavigationStart, Router } from "@angular/router";
5
6
  /**
6
7
  * @license
@@ -160,6 +161,21 @@ function wrQueryParam(name, options = {}) {
160
161
  * Use of this source code is governed by an MIT-style license that can be
161
162
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
162
163
  */
163
- export { wrQueryParam };
164
+ function withRenderOnNavigation() {
165
+ return wrFeature("render-on-navigation", [provideAppInitializer(() => {
166
+ const appRef = inject(ApplicationRef);
167
+ const subscription = inject(Router).events.subscribe((event) => {
168
+ if (event instanceof NavigationEnd) queueMicrotask(() => appRef.tick());
169
+ });
170
+ inject(DestroyRef).onDestroy(() => subscription.unsubscribe());
171
+ })]);
172
+ }
173
+ /**
174
+ * @license
175
+ *
176
+ * Use of this source code is governed by an MIT-style license that can be
177
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
178
+ */
179
+ export { withRenderOnNavigation, wrQueryParam };
164
180
 
165
181
  //# sourceMappingURL=ngwr-utils-router.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-utils-router.mjs","names":[],"sources":["../../../projects/lib/utils/router/query-param.ts","../../../projects/lib/utils/router/public-api.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n PLATFORM_ID,\n Service,\n type WritableSignal,\n assertInInjectionContext,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n NavigationCancel,\n NavigationEnd,\n NavigationError,\n NavigationSkipped,\n NavigationStart,\n type Params,\n Router,\n} from '@angular/router';\n\nimport type { WrQueryParamOptions, WrQueryParamStringOptions } from './types';\n\n/** One signal following one parameter. */\ninterface Follower {\n readonly name: string;\n /** The raw value the signal last agreed with, `null` for absent. */\n raw: string | null;\n readonly decode: (raw: string | null) => unknown;\n /** The setter the signal was born with: moves it without writing the address. */\n readonly write: (value: unknown) => void;\n}\n\n/**\n * The one writer behind every {@link wrQueryParam}: collects the writes of a\n * task and navigates once with all of them, and moves every follower when a\n * navigation settles.\n */\n@Service()\nclass WrQueryParams {\n private readonly router = inject(Router);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly followers = new Set<Follower>();\n /** Writes not yet navigated, per parameter: the raw value, `null` to remove. */\n private readonly batch = new Map<string, { readonly from: Follower; readonly raw: string | null }>();\n private replaceUrl = false;\n private scheduled = false;\n private inFlight: boolean;\n\n constructor() {\n this.inFlight = untracked(this.router.currentNavigation) !== null;\n const sub = this.router.events.subscribe(event => {\n if (event instanceof NavigationStart) this.inFlight = true;\n else if (\n event instanceof NavigationEnd ||\n event instanceof NavigationCancel ||\n event instanceof NavigationError ||\n event instanceof NavigationSkipped\n ) {\n this.inFlight = false;\n this.settle();\n }\n });\n inject(DestroyRef).onDestroy(() => sub.unsubscribe());\n }\n\n /** The parameter as the router holds it: the first value of a repeated one. */\n raw(name: string): string | null {\n return this.router.routerState.snapshot.root.queryParamMap.get(name);\n }\n\n follow(follower: Follower): () => void {\n this.followers.add(follower);\n return () => this.followers.delete(follower);\n }\n\n write(from: Follower, raw: string | null, replaceUrl: boolean): void {\n if (!this.isBrowser) return;\n this.replaceUrl = this.batch.size === 0 ? replaceUrl : this.replaceUrl && replaceUrl;\n this.batch.set(from.name, { from, raw });\n this.schedule();\n }\n\n private schedule(): void {\n if (this.scheduled) return;\n this.scheduled = true;\n queueMicrotask(() => {\n this.scheduled = false;\n this.flush();\n });\n }\n\n private flush(): void {\n // A navigation in flight is left to land; `settle()` flushes after it, onto\n // the address it produced. Navigating now would supersede it, and a link\n // the user clicked would be lost to a keystroke.\n if (this.batch.size === 0 || this.inFlight) return;\n const current = this.router.routerState.snapshot.root.queryParams;\n const queryParams: Params = {};\n let changed = false;\n for (const [name, { raw }] of this.batch) {\n queryParams[name] = raw;\n const was: unknown = current[name];\n if (raw !== (typeof was === 'string' ? was : was == null ? null : undefined)) changed = true;\n }\n const replaceUrl = this.replaceUrl;\n this.batch.clear();\n if (!changed) {\n // Two signals of one parameter can write opposite values in a task.\n this.settle();\n return;\n }\n void this.router.navigate([], { queryParams, queryParamsHandling: 'merge', preserveFragment: true, replaceUrl });\n }\n\n /** Every follower takes the address as it stands, except one with a write still to go. */\n private settle(): void {\n // A write that waited for the navigation which destroyed its signal belongs\n // to the page that navigation left, not to the address it produced.\n for (const [name, { from }] of this.batch) if (!this.followers.has(from)) this.batch.delete(name);\n for (const follower of this.followers) {\n if (this.batch.has(follower.name)) continue;\n const raw = this.raw(follower.name);\n if (raw === follower.raw) continue;\n follower.raw = raw;\n follower.write(follower.decode(raw));\n }\n if (this.batch.size > 0) this.schedule();\n }\n}\n\n/**\n * A writable signal linked to one query parameter.\n *\n * ```ts\n * readonly q = wrQueryParam('q');\n * readonly page = wrQueryParam<number>('page', { default: 1, parse: raw => Number(raw) || 1, serialize: String });\n * ```\n *\n * - **Reads** follow the address: Back, Forward and any navigation that\n * changes the parameter move the signal. An absent parameter reads as\n * `default`; a repeated one reads its first value.\n * - **Writes** are `set` and `update`, as on any signal. The signal takes the\n * value at once, and one navigation per task carries every write made in\n * it, across every `wrQueryParam` signal of the app. Other parameters and\n * the fragment survive it. Writing `default` removes the parameter, and a\n * write that changes nothing navigates nothing.\n * - **`replaceUrl`** is per signal. When writes with and without it meet in one\n * task, the navigation pushes: a history entry replaced by mistake is lost,\n * one pushed by mistake is one more Back.\n * - **A write during a navigation** waits for it, then lands on the address\n * it produced. A navigation of this signal's own that is cancelled, fails\n * or is superseded leaves the address as it was, and the signal reads it\n * again: a lost write is read back, never kept.\n * - **A string needs no options.** Any other `T` needs `default`, `parse` and\n * `serialize`. The address is user input: a `parse` that throws reads as\n * `default`, and what else it cannot read is for it to decide.\n * - **Lifetime.** Needs an injection context and follows the address until that\n * context is destroyed. A write already made is navigated all the same,\n * unless it was waiting for the navigation that destroyed the context: the\n * address that navigation produced belongs to another page.\n * - **On the server** it reads the parameter from the router, and a write\n * moves the signal only; nothing navigates during prerender. Hydration\n * navigates nothing either, since reading never does.\n *\n * Lives in `ngwr/utils/router`, since `@angular/router` is an optional peer.\n *\n * @param name - The parameter's name in the address.\n * @param options - `default` and `replaceUrl`, plus `parse` and `serialize` for a type other than `string`.\n * @returns The signal.\n */\nexport function wrQueryParam(name: string, options?: WrQueryParamStringOptions): WritableSignal<string>;\n// eslint-disable-next-line no-redeclare -- an overload, so `T` is inferred from `parse`\nexport function wrQueryParam<T>(name: string, options: WrQueryParamOptions<T>): WritableSignal<T>;\n// eslint-disable-next-line no-redeclare -- the implementation behind the two overloads\nexport function wrQueryParam<T>(\n name: string,\n options: WrQueryParamStringOptions | WrQueryParamOptions<T> = {}\n): WritableSignal<T> {\n assertInInjectionContext(wrQueryParam);\n const params = inject(WrQueryParams);\n const typed = 'parse' in options ? options : null;\n const fallback = (typed ? typed.default : (options.default ?? '')) as T;\n const parse = typed ? typed.parse : (raw: string): T => raw as T;\n const serialize = typed ? typed.serialize : (value: T): string => value as string;\n const replaceUrl = options.replaceUrl ?? false;\n\n let fallbackRaw: string | undefined;\n try {\n fallbackRaw = serialize(fallback);\n } catch {\n fallbackRaw = undefined;\n }\n\n const decode = (raw: string | null): T => {\n if (raw === null) return fallback;\n try {\n return parse(raw);\n } catch {\n return fallback;\n }\n };\n const encode = (value: T): string | null => {\n if (Object.is(value, fallback)) return null;\n const raw = serialize(value);\n return raw === fallbackRaw ? null : raw;\n };\n\n const raw = params.raw(name);\n const sig = signal<T>(decode(raw));\n const write = sig.set.bind(sig);\n const follower: Follower = { name, raw, decode, write: write as (value: unknown) => void };\n\n sig.set = value => {\n const next = encode(value);\n follower.raw = next;\n write(value);\n params.write(follower, next, replaceUrl);\n };\n sig.update = fn => sig.set(fn(untracked(sig)));\n\n inject(DestroyRef).onDestroy(params.follow(follower));\n return sig;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { wrQueryParam } from './query-param';\nexport type { W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AAQ,WAAW,UAAU,UAAU;CAC7C,MAAM,WAAY,QAAQ,MAAM,UAAW,QAAQ,WAAW;CAC9D,MAAM,QAAQ,QAAQ,MAAM,SAAS,QAAmB;CACxD,MAAM,YAAY,QAAQ,MAAM,aAAa,UAAqB;CAClE,MAAM,aAAa,QAAQ,cAAc;CAEzC,IAAI;CACJ,IAAI;EACF,cAAc,UAAU,QAAQ;CAClC,QAAQ;EACN,cAAc;CAChB;CAEA,MAAM,UAAU,QAAyB;EACvC,IAAI,QAAQ,MAAM,OAAO;EACzB,IAAI;GACF,OAAO,MAAM,GAAG;EAClB,QAAQ;GACN,OAAO;EACT;CACF;CACA,MAAM,UAAU,UAA2B;EACzC,IAAI,OAAO,GAAG,OAAO,QAAQ,GAAG,OAAO;EACvC,MAAM,MAAM,UAAU,KAAK;EAC3B,OAAO,QAAQ,cAAc,OAAO;CACtC;CAEA,MAAM,MAAM,OAAO,IAAI,IAAI;CAC3B,MAAM,MAAM,OAAU,OAAO,GAAG,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,MAAM,QAAQ,IAAI,IAAI,KAAK,GAAG;CAC9B,MAAM,WAAqB;EAAE;EAAM;EAAK;EAAe;CAAiC;CAExF,IAAI,OAAM,UAAQ;EAChB,MAAM,OAAO,OAAO,KAAK;EACzB,SAAS,MAAM;EACf,MAAM,KAAK;EACX,OAAO,MAAM,UAAU,MAAM,UAAU;CACzC;CACA,IAAI,UAAS,OAAM,IAAI,IAAI,GAAG,UAAU,GAAG,CAAC,CAAC;CAE7C,OAAO,UAAU,CAAC,CAAC,UAAU,OAAO,OAAO,QAAQ,CAAC;CACpD,OAAO;AACT"}
1
+ {"version":3,"file":"ngwr-utils-router.mjs","names":[],"sources":["../../../projects/lib/utils/router/query-param.ts","../../../projects/lib/utils/router/render-on-navigation.ts","../../../projects/lib/utils/router/public-api.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n PLATFORM_ID,\n Service,\n type WritableSignal,\n assertInInjectionContext,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n NavigationCancel,\n NavigationEnd,\n NavigationError,\n NavigationSkipped,\n NavigationStart,\n type Params,\n Router,\n} from '@angular/router';\n\nimport type { WrQueryParamOptions, WrQueryParamStringOptions } from './types';\n\n/** One signal following one parameter. */\ninterface Follower {\n readonly name: string;\n /** The raw value the signal last agreed with, `null` for absent. */\n raw: string | null;\n readonly decode: (raw: string | null) => unknown;\n /** The setter the signal was born with: moves it without writing the address. */\n readonly write: (value: unknown) => void;\n}\n\n/**\n * The one writer behind every {@link wrQueryParam}: collects the writes of a\n * task and navigates once with all of them, and moves every follower when a\n * navigation settles.\n */\n@Service()\nclass WrQueryParams {\n private readonly router = inject(Router);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly followers = new Set<Follower>();\n /** Writes not yet navigated, per parameter: the raw value, `null` to remove. */\n private readonly batch = new Map<string, { readonly from: Follower; readonly raw: string | null }>();\n private replaceUrl = false;\n private scheduled = false;\n private inFlight: boolean;\n\n constructor() {\n this.inFlight = untracked(this.router.currentNavigation) !== null;\n const sub = this.router.events.subscribe(event => {\n if (event instanceof NavigationStart) this.inFlight = true;\n else if (\n event instanceof NavigationEnd ||\n event instanceof NavigationCancel ||\n event instanceof NavigationError ||\n event instanceof NavigationSkipped\n ) {\n this.inFlight = false;\n this.settle();\n }\n });\n inject(DestroyRef).onDestroy(() => sub.unsubscribe());\n }\n\n /** The parameter as the router holds it: the first value of a repeated one. */\n raw(name: string): string | null {\n return this.router.routerState.snapshot.root.queryParamMap.get(name);\n }\n\n follow(follower: Follower): () => void {\n this.followers.add(follower);\n return () => this.followers.delete(follower);\n }\n\n write(from: Follower, raw: string | null, replaceUrl: boolean): void {\n if (!this.isBrowser) return;\n this.replaceUrl = this.batch.size === 0 ? replaceUrl : this.replaceUrl && replaceUrl;\n this.batch.set(from.name, { from, raw });\n this.schedule();\n }\n\n private schedule(): void {\n if (this.scheduled) return;\n this.scheduled = true;\n queueMicrotask(() => {\n this.scheduled = false;\n this.flush();\n });\n }\n\n private flush(): void {\n // A navigation in flight is left to land; `settle()` flushes after it, onto\n // the address it produced. Navigating now would supersede it, and a link\n // the user clicked would be lost to a keystroke.\n if (this.batch.size === 0 || this.inFlight) return;\n const current = this.router.routerState.snapshot.root.queryParams;\n const queryParams: Params = {};\n let changed = false;\n for (const [name, { raw }] of this.batch) {\n queryParams[name] = raw;\n const was: unknown = current[name];\n if (raw !== (typeof was === 'string' ? was : was == null ? null : undefined)) changed = true;\n }\n const replaceUrl = this.replaceUrl;\n this.batch.clear();\n if (!changed) {\n // Two signals of one parameter can write opposite values in a task.\n this.settle();\n return;\n }\n void this.router.navigate([], { queryParams, queryParamsHandling: 'merge', preserveFragment: true, replaceUrl });\n }\n\n /** Every follower takes the address as it stands, except one with a write still to go. */\n private settle(): void {\n // A write that waited for the navigation which destroyed its signal belongs\n // to the page that navigation left, not to the address it produced.\n for (const [name, { from }] of this.batch) if (!this.followers.has(from)) this.batch.delete(name);\n for (const follower of this.followers) {\n if (this.batch.has(follower.name)) continue;\n const raw = this.raw(follower.name);\n if (raw === follower.raw) continue;\n follower.raw = raw;\n follower.write(follower.decode(raw));\n }\n if (this.batch.size > 0) this.schedule();\n }\n}\n\n/**\n * A writable signal linked to one query parameter.\n *\n * ```ts\n * readonly q = wrQueryParam('q');\n * readonly page = wrQueryParam<number>('page', { default: 1, parse: raw => Number(raw) || 1, serialize: String });\n * ```\n *\n * - **Reads** follow the address: Back, Forward and any navigation that\n * changes the parameter move the signal. An absent parameter reads as\n * `default`; a repeated one reads its first value.\n * - **Writes** are `set` and `update`, as on any signal. The signal takes the\n * value at once, and one navigation per task carries every write made in\n * it, across every `wrQueryParam` signal of the app. Other parameters and\n * the fragment survive it. Writing `default` removes the parameter, and a\n * write that changes nothing navigates nothing.\n * - **`replaceUrl`** is per signal. When writes with and without it meet in one\n * task, the navigation pushes: a history entry replaced by mistake is lost,\n * one pushed by mistake is one more Back.\n * - **A write during a navigation** waits for it, then lands on the address\n * it produced. A navigation of this signal's own that is cancelled, fails\n * or is superseded leaves the address as it was, and the signal reads it\n * again: a lost write is read back, never kept.\n * - **A string needs no options.** Any other `T` needs `default`, `parse` and\n * `serialize`. The address is user input: a `parse` that throws reads as\n * `default`, and what else it cannot read is for it to decide.\n * - **Lifetime.** Needs an injection context and follows the address until that\n * context is destroyed. A write already made is navigated all the same,\n * unless it was waiting for the navigation that destroyed the context: the\n * address that navigation produced belongs to another page.\n * - **On the server** it reads the parameter from the router, and a write\n * moves the signal only; nothing navigates during prerender. Hydration\n * navigates nothing either, since reading never does.\n *\n * Lives in `ngwr/utils/router`, since `@angular/router` is an optional peer.\n *\n * @param name - The parameter's name in the address.\n * @param options - `default` and `replaceUrl`, plus `parse` and `serialize` for a type other than `string`.\n * @returns The signal.\n */\nexport function wrQueryParam(name: string, options?: WrQueryParamStringOptions): WritableSignal<string>;\n// eslint-disable-next-line no-redeclare -- an overload, so `T` is inferred from `parse`\nexport function wrQueryParam<T>(name: string, options: WrQueryParamOptions<T>): WritableSignal<T>;\n// eslint-disable-next-line no-redeclare -- the implementation behind the two overloads\nexport function wrQueryParam<T>(\n name: string,\n options: WrQueryParamStringOptions | WrQueryParamOptions<T> = {}\n): WritableSignal<T> {\n assertInInjectionContext(wrQueryParam);\n const params = inject(WrQueryParams);\n const typed = 'parse' in options ? options : null;\n const fallback = (typed ? typed.default : (options.default ?? '')) as T;\n const parse = typed ? typed.parse : (raw: string): T => raw as T;\n const serialize = typed ? typed.serialize : (value: T): string => value as string;\n const replaceUrl = options.replaceUrl ?? false;\n\n let fallbackRaw: string | undefined;\n try {\n fallbackRaw = serialize(fallback);\n } catch {\n fallbackRaw = undefined;\n }\n\n const decode = (raw: string | null): T => {\n if (raw === null) return fallback;\n try {\n return parse(raw);\n } catch {\n return fallback;\n }\n };\n const encode = (value: T): string | null => {\n if (Object.is(value, fallback)) return null;\n const raw = serialize(value);\n return raw === fallbackRaw ? null : raw;\n };\n\n const raw = params.raw(name);\n const sig = signal<T>(decode(raw));\n const write = sig.set.bind(sig);\n const follower: Follower = { name, raw, decode, write: write as (value: unknown) => void };\n\n sig.set = value => {\n const next = encode(value);\n follower.raw = next;\n write(value);\n params.write(follower, next, replaceUrl);\n };\n sig.update = fn => sig.set(fn(untracked(sig)));\n\n inject(DestroyRef).onDestroy(params.follow(follower));\n return sig;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ApplicationRef, DestroyRef, inject, provideAppInitializer } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\n\nimport { type WrFeature, wrFeature } from 'ngwr/utils';\n\n/**\n * `provideWr()` feature: render a routed page in the task that inserted it.\n *\n * Zoneless, the router inserts the new page into the DOM in one task and its\n * first change detection runs in a later one (Angular schedules it as a\n * macrotask, by design: angular/angular#57528). A browser that styles the page\n * in between sees elements without their bound classes and attributes, and any\n * CSS transition on them then fades from the browser's defaults to the app's\n * look on every page switch. Ticking right after `NavigationEnd`, before the\n * task ends, binds the page before the browser paints it. The scheduled tick is\n * cancelled by this one, so nothing runs twice.\n *\n * ngwr's own components carry their base class statically and do not depend on\n * this; it covers the app's own bindings on a routed page.\n *\n * @example\n * ```ts\n * provideWr(withRenderOnNavigation())\n * ```\n */\nexport function withRenderOnNavigation(): WrFeature<'render-on-navigation'> {\n return wrFeature('render-on-navigation', [\n provideAppInitializer(() => {\n const appRef = inject(ApplicationRef);\n const subscription = inject(Router).events.subscribe(event => {\n // A microtask, not `afterNextRender`: it has to run before the task that\n // inserted the page ends, and a tick inside the router's own event\n // emission could re-enter one already running.\n if (event instanceof NavigationEnd) queueMicrotask(() => appRef.tick());\n });\n inject(DestroyRef).onDestroy(() => subscription.unsubscribe());\n }),\n ]);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport { wrQueryParam } from './query-param';\nexport { withRenderOnNavigation } from './render-on-navigation';\nexport type { WrQueryParamOptions, WrQueryParamStringOptions } from './types';\n"],"mappings":";;;;;;;;;;;AA6CA,IACM,gBADN,MACM,cAAa;CACA,SAAS,OAAO,MAAM;CACtB,YAAY,kBAAkB,OAAO,WAAW,CAAC;CACjD,4BAAY,IAAI,IAAG;CAEnB,wBAAQ,IAAI,IAAG;CACxB,aAAa;CACb,YAAY;CACZ;CAER,cAAA;EACE,KAAK,WAAW,UAAU,KAAK,OAAO,iBAAiB,MAAM;EAC7D,MAAM,MAAM,KAAK,OAAO,OAAO,WAAU,UAAQ;GAC/C,IAAI,iBAAiB,iBAAiB,KAAK,WAAW;QACjD,IACH,iBAAiB,iBACjB,iBAAiB,oBACjB,iBAAiB,mBACjB,iBAAiB,mBACjB;IACA,KAAK,WAAW;IAChB,KAAK,OAAM;GACb;EACF,CAAC;EACD,OAAO,UAAU,CAAC,CAAC,gBAAgB,IAAI,YAAW,CAAE;CACtD;CAGA,IAAI,MAAY;EACd,OAAO,KAAK,OAAO,YAAY,SAAS,KAAK,cAAc,IAAI,IAAI;CACrE;CAEA,OAAO,UAAkB;EACvB,KAAK,UAAU,IAAI,QAAQ;EAC3B,aAAa,KAAK,UAAU,OAAO,QAAQ;CAC7C;CAEA,MAAM,MAAgB,KAAoB,YAAmB;EAC3D,IAAI,CAAC,KAAK,WAAW;EACrB,KAAK,aAAa,KAAK,MAAM,SAAS,IAAI,aAAa,KAAK,cAAc;EAC1E,KAAK,MAAM,IAAI,KAAK,MAAM;GAAE;GAAM;EAAG,CAAE;EACvC,KAAK,SAAQ;CACf;CAEQ,WAAQ;EACd,IAAI,KAAK,WAAW;EACpB,KAAK,YAAY;EACjB,q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O,OAAO,QAAQ,CAAC;CACpD,OAAO;AACT;;;;;;;ACtMA,SAAgB,yBAAsB;CACpC,OAAO,UAAU,wBAAwB,CACvC,4BAA2B;EACzB,MAAM,SAAS,OAAO,cAAc;EACpC,MAAM,eAAe,OAAO,MAAM,CAAC,CAAC,OAAO,WAAU,UAAQ;GAI3D,IAAI,iBAAiB,eAAe,qBAAqB,OAAO,KAAI,CAAE;EACxE,CAAC;EACD,OAAO,UAAU,CAAC,CAAC,gBAAgB,aAAa,YAAW,CAAE;CAC/D,CAAC,CACF,CAAA;AACH"}
@@ -1,4 +1,4 @@
1
- import { DOCUMENT, DestroyRef, ElementRef, PLATFORM_ID, afterNextRender, assertInInjectionContext, computed, effect, inject, linkedSignal, signal } from "@angular/core";
1
+ import { DOCUMENT, DestroyRef, ElementRef, InjectionToken, PLATFORM_ID, afterNextRender, assertInInjectionContext, computed, effect, inject, linkedSignal, signal } from "@angular/core";
2
2
  import { coerceNumberProperty } from "@angular/cdk/coercion";
3
3
  import { DOCUMENT as DOCUMENT$1, isPlatformBrowser } from "@angular/common";
4
4
  /**
@@ -817,6 +817,13 @@ function wrInitials(name, locale, options) {
817
817
  * Use of this source code is governed by an MIT-style license that can be
818
818
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
819
819
  */
820
+ const WR_LIVE_LOCALE = new InjectionToken("WR_LIVE_LOCALE");
821
+ /**
822
+ * @license
823
+ *
824
+ * Use of this source code is governed by an MIT-style license that can be
825
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
826
+ */
820
827
  function wrFeature(kind, providers) {
821
828
  return {
822
829
  ɵkind: kind,
@@ -935,6 +942,6 @@ function wrResourceValue(resource, fallback) {
935
942
  effect(() => value());
936
943
  return value.asReadonly();
937
944
  }
938
- export { WR_KEYS, WR_KEY_LABELS, wrAction, wrBadgeError, wrBadgeLog, wrBadgeWarn, wrCheckStyles, wrClamp, wrContentDispositionFileName, wrDebounce, wrDecimal, wrDecimalAdd, wrDecimalCompare, wrDecimalDivide, wrDecimalMultiply, wrDecimalRound, wrDecimalSubtract, wrDownloadBlob, wrFeature, wrGetFocusableElements, wrGetRootFontSize, wrHasModifier, wrInitials, wrIsComposing, wrIsDefined, wrIsNonEmptyArray, wrIsObservable, wrIsPrintableKey, wrIsSafeCssValue, wrKeyedAction, wrNoop, wrNumAttr, wrRandomId, wrResolveCssColor, wrResolveCssColorChannels, wrResolveCssSize, wrResourceValue, wrRestoreFocus, wrRound, wrThrottle, wrToClassList, wrTrapFocus, wrWatchColorScheme };
945
+ export { WR_KEYS, WR_KEY_LABELS, WR_LIVE_LOCALE, wrAction, wrBadgeError, wrBadgeLog, wrBadgeWarn, wrCheckStyles, wrClamp, wrContentDispositionFileName, wrDebounce, wrDecimal, wrDecimalAdd, wrDecimalCompare, wrDecimalDivide, wrDecimalMultiply, wrDecimalRound, wrDecimalSubtract, wrDownloadBlob, wrFeature, wrGetFocusableElements, wrGetRootFontSize, wrHasModifier, wrInitials, wrIsComposing, wrIsDefined, wrIsNonEmptyArray, wrIsObservable, wrIsPrintableKey, wrIsSafeCssValue, wrKeyedAction, wrNoop, wrNumAttr, wrRandomId, wrResolveCssColor, wrResolveCssColorChannels, wrResolveCssSize, wrResourceValue, wrRestoreFocus, wrRound, wrThrottle, wrToClassList, wrTrapFocus, wrWatchColorScheme };
939
946
 
940
947
  //# sourceMappingURL=ngwr-utils.mjs.map