ngwr 14.7.0 → 14.9.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 (482) hide show
  1. package/README.md +66 -332
  2. package/alert/styles/_index.scss +10 -0
  3. package/avatar/styles/_index.scss +18 -7
  4. package/badge/styles/_index.scss +7 -0
  5. package/badge/styles/_tag.scss +7 -1
  6. package/bar-chart/styles/_index.scss +1 -0
  7. package/button/styles/_index.scss +6 -0
  8. package/calendar-heatmap/styles/_index.scss +1 -0
  9. package/cascader/styles/_rules.scss +87 -15
  10. package/checkbox/styles/_index.scss +4 -0
  11. package/command-palette/styles/_index.scss +1 -1
  12. package/date-picker/styles/_index.scss +30 -0
  13. package/density/styles/_index.scss +4 -2
  14. package/divider/styles/_index.scss +2 -0
  15. package/donut-chart/styles/_index.scss +10 -0
  16. package/dropdown/styles/_index.scss +67 -5
  17. package/editor/styles/_index.scss +441 -0
  18. package/event-calendar/styles/_index.scss +209 -35
  19. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-action-sheet.mjs +3 -3
  21. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  22. package/fesm2022/ngwr-affix.mjs +3 -3
  23. package/fesm2022/ngwr-affix.mjs.map +1 -1
  24. package/fesm2022/ngwr-alert.mjs +3 -3
  25. package/fesm2022/ngwr-alert.mjs.map +1 -1
  26. package/fesm2022/ngwr-anchor.mjs +3 -3
  27. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  28. package/fesm2022/ngwr-aurora.mjs +3 -3
  29. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  30. package/fesm2022/ngwr-avatar.mjs +3 -3
  31. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  32. package/fesm2022/ngwr-back-top.mjs +3 -3
  33. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  34. package/fesm2022/ngwr-badge.mjs +28 -13
  35. package/fesm2022/ngwr-badge.mjs.map +1 -1
  36. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
  37. package/fesm2022/ngwr-bar-chart.mjs +31 -6
  38. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  39. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-blur-text.mjs +3 -3
  41. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  42. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
  43. package/fesm2022/ngwr-border-glow.mjs +3 -3
  44. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  45. package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
  46. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  47. package/fesm2022/ngwr-burger.mjs +3 -3
  48. package/fesm2022/ngwr-burger.mjs.map +1 -1
  49. package/fesm2022/ngwr-button-testing.mjs.map +1 -1
  50. package/fesm2022/ngwr-button.mjs +6 -6
  51. package/fesm2022/ngwr-button.mjs.map +1 -1
  52. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
  53. package/fesm2022/ngwr-calendar-heatmap.mjs +61 -6
  54. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  55. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  56. package/fesm2022/ngwr-calendar.mjs +3 -3
  57. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  58. package/fesm2022/ngwr-card.mjs +9 -9
  59. package/fesm2022/ngwr-card.mjs.map +1 -1
  60. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-carousel.mjs +6 -6
  62. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  63. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  64. package/fesm2022/ngwr-cascader.mjs +4 -4
  65. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  66. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
  67. package/fesm2022/ngwr-checkbox.mjs +18 -8
  68. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
  70. package/fesm2022/ngwr-circular-text.mjs +3 -3
  71. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  72. package/fesm2022/ngwr-click-spark.mjs +3 -3
  73. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  74. package/fesm2022/ngwr-clipboard.mjs +3 -3
  75. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  76. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
  77. package/fesm2022/ngwr-collapse.mjs +9 -9
  78. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  79. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-color-picker.mjs +6 -6
  81. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  82. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
  83. package/fesm2022/ngwr-command-palette.mjs +3 -3
  84. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  85. package/fesm2022/ngwr-compare.mjs +3 -3
  86. package/fesm2022/ngwr-compare.mjs.map +1 -1
  87. package/fesm2022/ngwr-confetti.mjs +3 -3
  88. package/fesm2022/ngwr-confetti.mjs.map +1 -1
  89. package/fesm2022/ngwr-config.mjs.map +1 -1
  90. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  91. package/fesm2022/ngwr-context-menu.mjs +12 -12
  92. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  93. package/fesm2022/ngwr-cookie.mjs +3 -3
  94. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  95. package/fesm2022/ngwr-counter.mjs +6 -6
  96. package/fesm2022/ngwr-counter.mjs.map +1 -1
  97. package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
  98. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
  100. package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
  101. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-date-picker.mjs +721 -62
  103. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-date.mjs +3 -3
  105. package/fesm2022/ngwr-date.mjs.map +1 -1
  106. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
  107. package/fesm2022/ngwr-decrypt-text.mjs +3 -3
  108. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  109. package/fesm2022/ngwr-density.mjs +6 -6
  110. package/fesm2022/ngwr-density.mjs.map +1 -1
  111. package/fesm2022/ngwr-descriptions.mjs +6 -6
  112. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  113. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-dialog.mjs +15 -15
  115. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  116. package/fesm2022/ngwr-directives.mjs +12 -12
  117. package/fesm2022/ngwr-directives.mjs.map +1 -1
  118. package/fesm2022/ngwr-divider.mjs +3 -3
  119. package/fesm2022/ngwr-divider.mjs.map +1 -1
  120. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
  121. package/fesm2022/ngwr-donut-chart.mjs +48 -6
  122. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  123. package/fesm2022/ngwr-drag-drop.mjs +6 -6
  124. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  125. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
  126. package/fesm2022/ngwr-drawer.mjs +18 -18
  127. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  128. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  129. package/fesm2022/ngwr-dropdown.mjs +174 -25
  130. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  131. package/fesm2022/ngwr-editor-testing.mjs +568 -0
  132. package/fesm2022/ngwr-editor-testing.mjs.map +1 -0
  133. package/fesm2022/ngwr-editor.mjs +2601 -0
  134. package/fesm2022/ngwr-editor.mjs.map +1 -0
  135. package/fesm2022/ngwr-empty.mjs +3 -3
  136. package/fesm2022/ngwr-empty.mjs.map +1 -1
  137. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
  138. package/fesm2022/ngwr-event-calendar.mjs +14 -7
  139. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  140. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-falling-text.mjs +3 -3
  142. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  143. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  144. package/fesm2022/ngwr-file-upload.mjs +3 -3
  145. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  146. package/fesm2022/ngwr-form-testing.mjs.map +1 -1
  147. package/fesm2022/ngwr-form.mjs +61 -10
  148. package/fesm2022/ngwr-form.mjs.map +1 -1
  149. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
  150. package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
  151. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  152. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
  153. package/fesm2022/ngwr-gauge.mjs +35 -6
  154. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  155. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
  156. package/fesm2022/ngwr-glitch-text.mjs +3 -3
  157. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  158. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
  159. package/fesm2022/ngwr-gradient-text.mjs +3 -3
  160. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  161. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  162. package/fesm2022/ngwr-graph.mjs +6 -6
  163. package/fesm2022/ngwr-graph.mjs.map +1 -1
  164. package/fesm2022/ngwr-hotkey.mjs +6 -6
  165. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-ar.mjs +31 -0
  167. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-cs.mjs +31 -0
  169. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-de.mjs +31 -0
  171. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-en.mjs +39 -0
  173. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  174. package/fesm2022/ngwr-i18n-es.mjs +31 -0
  175. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-fr.mjs +31 -0
  177. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n-he.mjs +31 -0
  179. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  180. package/fesm2022/ngwr-i18n-hi.mjs +31 -0
  181. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  182. package/fesm2022/ngwr-i18n-id.mjs +31 -0
  183. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  184. package/fesm2022/ngwr-i18n-it.mjs +31 -0
  185. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  186. package/fesm2022/ngwr-i18n-ja.mjs +31 -0
  187. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  188. package/fesm2022/ngwr-i18n-ko.mjs +31 -0
  189. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  190. package/fesm2022/ngwr-i18n-nl.mjs +31 -0
  191. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  192. package/fesm2022/ngwr-i18n-pl.mjs +31 -0
  193. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  194. package/fesm2022/ngwr-i18n-pt.mjs +31 -0
  195. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  196. package/fesm2022/ngwr-i18n-ru.mjs +31 -0
  197. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  198. package/fesm2022/ngwr-i18n-sv.mjs +31 -0
  199. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  200. package/fesm2022/ngwr-i18n-tr.mjs +31 -0
  201. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  202. package/fesm2022/ngwr-i18n-uk.mjs +31 -0
  203. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  204. package/fesm2022/ngwr-i18n-vi.mjs +31 -0
  205. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  206. package/fesm2022/ngwr-i18n-zh-TW.mjs +31 -0
  207. package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
  208. package/fesm2022/ngwr-i18n-zh.mjs +31 -0
  209. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  210. package/fesm2022/ngwr-i18n.mjs +9 -9
  211. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  212. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  213. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  214. package/fesm2022/ngwr-icon.mjs +6 -6
  215. package/fesm2022/ngwr-icon.mjs.map +1 -1
  216. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
  217. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  218. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  219. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  220. package/fesm2022/ngwr-input-number.mjs +15 -3
  221. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  222. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
  223. package/fesm2022/ngwr-input-otp.mjs +3 -3
  224. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  225. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  226. package/fesm2022/ngwr-input.mjs +15 -15
  227. package/fesm2022/ngwr-input.mjs.map +1 -1
  228. package/fesm2022/ngwr-keyboard.mjs +3 -3
  229. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  230. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  231. package/fesm2022/ngwr-knob.mjs +3 -3
  232. package/fesm2022/ngwr-knob.mjs.map +1 -1
  233. package/fesm2022/ngwr-layout.mjs +15 -15
  234. package/fesm2022/ngwr-layout.mjs.map +1 -1
  235. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  236. package/fesm2022/ngwr-lightbox.mjs +3 -3
  237. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  238. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
  239. package/fesm2022/ngwr-line-chart.mjs +18 -7
  240. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  241. package/fesm2022/ngwr-list.mjs +6 -6
  242. package/fesm2022/ngwr-list.mjs.map +1 -1
  243. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  244. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  245. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  246. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
  247. package/fesm2022/ngwr-markdown.mjs +798 -17
  248. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  249. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
  250. package/fesm2022/ngwr-marquee.mjs +3 -3
  251. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  252. package/fesm2022/ngwr-media.mjs +3 -3
  253. package/fesm2022/ngwr-media.mjs.map +1 -1
  254. package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
  255. package/fesm2022/ngwr-mention.mjs +6 -6
  256. package/fesm2022/ngwr-mention.mjs.map +1 -1
  257. package/fesm2022/ngwr-meta.mjs +6 -6
  258. package/fesm2022/ngwr-meta.mjs.map +1 -1
  259. package/fesm2022/ngwr-meter-group-testing.mjs +7 -3
  260. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
  261. package/fesm2022/ngwr-meter-group.mjs +26 -6
  262. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  263. package/fesm2022/ngwr-overlay.mjs +6 -6
  264. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  265. package/fesm2022/ngwr-page-header.mjs +13 -5
  266. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  267. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  268. package/fesm2022/ngwr-pagination.mjs +3 -3
  269. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  270. package/fesm2022/ngwr-pipes.mjs +21 -21
  271. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  272. package/fesm2022/ngwr-platform.mjs +9 -9
  273. package/fesm2022/ngwr-platform.mjs.map +1 -1
  274. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  275. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  276. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  277. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  278. package/fesm2022/ngwr-popover.mjs +578 -16
  279. package/fesm2022/ngwr-popover.mjs.map +1 -1
  280. package/fesm2022/ngwr-progress.mjs +3 -3
  281. package/fesm2022/ngwr-progress.mjs.map +1 -1
  282. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  283. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  284. package/fesm2022/ngwr-qr.mjs +3 -3
  285. package/fesm2022/ngwr-qr.mjs.map +1 -1
  286. package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
  287. package/fesm2022/ngwr-radio.mjs +6 -6
  288. package/fesm2022/ngwr-radio.mjs.map +1 -1
  289. package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
  290. package/fesm2022/ngwr-rating.mjs +3 -3
  291. package/fesm2022/ngwr-rating.mjs.map +1 -1
  292. package/fesm2022/ngwr-result.mjs +12 -12
  293. package/fesm2022/ngwr-result.mjs.map +1 -1
  294. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
  295. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  296. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  297. package/fesm2022/ngwr-schema-form.mjs +3 -3
  298. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  299. package/fesm2022/ngwr-scroll.mjs +3 -3
  300. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  301. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
  302. package/fesm2022/ngwr-segmented.mjs +3 -3
  303. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  304. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  305. package/fesm2022/ngwr-select.mjs +12 -12
  306. package/fesm2022/ngwr-select.mjs.map +1 -1
  307. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
  308. package/fesm2022/ngwr-shiny-text.mjs +6 -6
  309. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  310. package/fesm2022/ngwr-sidebar.mjs +10 -3
  311. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  312. package/fesm2022/ngwr-skeleton.mjs +3 -3
  313. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  314. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  315. package/fesm2022/ngwr-slider.mjs +3 -3
  316. package/fesm2022/ngwr-slider.mjs.map +1 -1
  317. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
  318. package/fesm2022/ngwr-sparkline.mjs +84 -10
  319. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  320. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
  321. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  322. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  323. package/fesm2022/ngwr-spinner.mjs +3 -3
  324. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  325. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
  326. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  327. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  328. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
  329. package/fesm2022/ngwr-split-text.mjs +3 -3
  330. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  331. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
  332. package/fesm2022/ngwr-splitter.mjs +3 -3
  333. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  334. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
  335. package/fesm2022/ngwr-spotlight-card.mjs +6 -6
  336. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  337. package/fesm2022/ngwr-squircle.mjs +6 -6
  338. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  339. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
  340. package/fesm2022/ngwr-star-border.mjs +3 -3
  341. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  342. package/fesm2022/ngwr-statistic.mjs +9 -9
  343. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  344. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  345. package/fesm2022/ngwr-stepper.mjs +6 -6
  346. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  347. package/fesm2022/ngwr-storage.mjs +3 -3
  348. package/fesm2022/ngwr-storage.mjs.map +1 -1
  349. package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
  350. package/fesm2022/ngwr-switch.mjs +3 -3
  351. package/fesm2022/ngwr-switch.mjs.map +1 -1
  352. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  353. package/fesm2022/ngwr-table.mjs +18 -18
  354. package/fesm2022/ngwr-table.mjs.map +1 -1
  355. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  356. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  357. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  358. package/fesm2022/ngwr-tabs.mjs +6 -6
  359. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  360. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  361. package/fesm2022/ngwr-textarea.mjs +3 -3
  362. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  363. package/fesm2022/ngwr-theme.mjs +3 -3
  364. package/fesm2022/ngwr-theme.mjs.map +1 -1
  365. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
  366. package/fesm2022/ngwr-tilt-card.mjs +6 -6
  367. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  368. package/fesm2022/ngwr-timeline.mjs +6 -6
  369. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  370. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  371. package/fesm2022/ngwr-toast.mjs +9 -9
  372. package/fesm2022/ngwr-toast.mjs.map +1 -1
  373. package/fesm2022/ngwr-toolbar.mjs +10 -3
  374. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  375. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  376. package/fesm2022/ngwr-tour.mjs +6 -6
  377. package/fesm2022/ngwr-tour.mjs.map +1 -1
  378. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  379. package/fesm2022/ngwr-transfer.mjs +3 -3
  380. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  381. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  382. package/fesm2022/ngwr-tree.mjs +3 -3
  383. package/fesm2022/ngwr-tree.mjs.map +1 -1
  384. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
  385. package/fesm2022/ngwr-typewriter.mjs +3 -3
  386. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  387. package/fesm2022/ngwr-typography.mjs +7 -3
  388. package/fesm2022/ngwr-typography.mjs.map +1 -1
  389. package/fesm2022/ngwr-utils.mjs.map +1 -1
  390. package/fesm2022/ngwr-validators.mjs.map +1 -1
  391. package/fesm2022/ngwr-version.mjs +1 -1
  392. package/fesm2022/ngwr-version.mjs.map +1 -1
  393. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  394. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  395. package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
  396. package/fesm2022/ngwr-waves.mjs +3 -3
  397. package/fesm2022/ngwr-waves.mjs.map +1 -1
  398. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  399. package/fesm2022/ngwr-window.mjs +12 -12
  400. package/fesm2022/ngwr-window.mjs.map +1 -1
  401. package/form/styles/_index.scss +16 -1
  402. package/gauge/styles/_index.scss +1 -0
  403. package/i18n/ar.json +32 -1
  404. package/i18n/cs.json +32 -1
  405. package/i18n/de.json +32 -1
  406. package/i18n/en.json +32 -1
  407. package/i18n/es.json +32 -1
  408. package/i18n/fr.json +32 -1
  409. package/i18n/he.json +32 -1
  410. package/i18n/hi.json +32 -1
  411. package/i18n/id.json +32 -1
  412. package/i18n/it.json +32 -1
  413. package/i18n/ja.json +32 -1
  414. package/i18n/ko.json +32 -1
  415. package/i18n/nl.json +32 -1
  416. package/i18n/pl.json +32 -1
  417. package/i18n/pt.json +32 -1
  418. package/i18n/ru.json +32 -1
  419. package/i18n/sv.json +32 -1
  420. package/i18n/tr.json +32 -1
  421. package/i18n/uk.json +32 -1
  422. package/i18n/vi.json +32 -1
  423. package/i18n/zh-TW.json +32 -1
  424. package/i18n/zh.json +32 -1
  425. package/input/styles/_index.scss +24 -1
  426. package/input-number/styles/_index.scss +69 -0
  427. package/input-otp/styles/_index.scss +5 -5
  428. package/line-chart/styles/_index.scss +30 -2
  429. package/llms-full.txt +14 -4
  430. package/llms.txt +188 -132
  431. package/mcp/providers.js +2 -2
  432. package/mcp/server.js +1 -1
  433. package/meter-group/styles/_index.scss +1 -0
  434. package/overlay/styles/_arrow.scss +30 -2
  435. package/package.json +43 -2
  436. package/page-header/styles/_index.scss +37 -1
  437. package/pagination/styles/_index.scss +9 -5
  438. package/popover/styles/_index.scss +73 -5
  439. package/progress/styles/_index.scss +4 -0
  440. package/radio/styles/_index.scss +4 -1
  441. package/schematics/use/symbol-map.json +1 -0
  442. package/select/styles/_index.scss +51 -12
  443. package/sidebar/styles/_index.scss +44 -2
  444. package/skeleton/styles/_index.scss +3 -0
  445. package/skills/ngwr/SKILL.md +5 -5
  446. package/skills/ngwr/references/catalog.md +2 -0
  447. package/skills/ngwr/references/setup.md +3 -3
  448. package/sparkline/styles/_index.scss +19 -0
  449. package/styles.scss +1 -0
  450. package/table/styles/_index.scss +7 -0
  451. package/textarea/styles/_index.scss +12 -3
  452. package/theme/styles/_colors.scss +39 -13
  453. package/theme/styles/_contrast.scss +9 -7
  454. package/toast/styles/_index.scss +4 -0
  455. package/toolbar/styles/_index.scss +35 -1
  456. package/tree/styles/_index.scss +46 -7
  457. package/types/ngwr-badge.d.ts +22 -7
  458. package/types/ngwr-bar-chart.d.ts +19 -1
  459. package/types/ngwr-calendar-heatmap.d.ts +29 -1
  460. package/types/ngwr-checkbox.d.ts +2 -0
  461. package/types/ngwr-config.d.ts +12 -0
  462. package/types/ngwr-date-picker.d.ts +308 -43
  463. package/types/ngwr-donut-chart.d.ts +24 -1
  464. package/types/ngwr-dropdown.d.ts +22 -2
  465. package/types/ngwr-editor-testing.d.ts +378 -0
  466. package/types/ngwr-editor.d.ts +449 -0
  467. package/types/ngwr-event-calendar.d.ts +8 -0
  468. package/types/ngwr-form.d.ts +35 -5
  469. package/types/ngwr-gauge.d.ts +20 -1
  470. package/types/ngwr-input-number.d.ts +7 -0
  471. package/types/ngwr-line-chart.d.ts +9 -1
  472. package/types/ngwr-markdown.d.ts +61 -2
  473. package/types/ngwr-meter-group-testing.d.ts +3 -2
  474. package/types/ngwr-meter-group.d.ts +14 -1
  475. package/types/ngwr-page-header.d.ts +10 -2
  476. package/types/ngwr-popover.d.ts +154 -3
  477. package/types/ngwr-sidebar.d.ts +7 -0
  478. package/types/ngwr-sparkline.d.ts +43 -1
  479. package/types/ngwr-toolbar.d.ts +7 -0
  480. package/types/ngwr-typography.d.ts +4 -0
  481. package/types/ngwr-version.d.ts +1 -1
  482. package/typography/styles/_index.scss +16 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-tree.mjs","sources":["../../../projects/lib/tree/tree.ts","../../../projects/lib/tree/tree.html","../../../projects/lib/tree/ngwr-tree.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 { 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 { readI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\n\nimport type { WrTreeNode, WrTreeSelectionMode } from './interfaces';\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 /** 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 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 * 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 // 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 cursor as the DOM sees it, clamped to the list that exists RIGHT NOW.\n *\n * The raw index is only ever written when a row is focused, and nothing shrank\n * it when the list did: collapsing a branch above the cursor left the index\n * past the end, which gave the tree zero rows with `tabindex=\"0\"` (no way back\n * in with Tab) and made every arrow key a no-op, because `onKeydown` bails when\n * `flat[i]` is undefined.\n */\n protected readonly cursorIndex = computed(() => {\n const last = Math.max(0, this.flat().length - 1);\n return Math.min(this.focusedIndex(), last);\n });\n\n /** Resolved ARIA labels — signals, so they follow both a late catalog and a locale switch. */\n protected readonly clearLabel = readI18nText('tree.clearSelection', 'Clear selection');\n protected readonly expandLabel = readI18nText('tree.expand', 'Expand');\n protected readonly collapseLabel = readI18nText('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 open = 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 if (this.open()) 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 // Drive the overlay open/close in response to the `open` signal.\n effect(() => {\n if (!this.isOverlay()) return;\n if (this.open()) {\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.open.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.open() : 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());\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 // Overlay-mode trigger handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n this.open.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 if (event.key !== 'Backspace') return;\n if (this.disabled() || this.readonly() || this.open() || !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 if (set.has(id)) set.delete(id);\n else set.add(id);\n this.expanded.set([...set]);\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.open.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 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: 'wr-tree-overlay',\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.open.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.open.set(false);\n }\n });\n }\n\n private closeOverlay(): 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 (inPanel) this.host.nativeElement.querySelector<HTMLElement>('.wr-tree__trigger')?.focus();\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]=\"open()\"\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-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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAqDH,IAAI,QAAQ,GAAG,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;MAQU,MAAM,CAAA;;IAER,KAAK,GAAG,KAAK,CAA6B,EAAE;8EAAC;;IAG7C,QAAQ,GAAG,KAAK,CAAiB,EAAE;iFAAC;;IAGpC,QAAQ,GAAG,KAAK,CAAiB,EAAE;iFAAC;;IAGpC,aAAa,GAAG,KAAK,CAAsB,QAAQ;sFAAC;AAE7D;;;;;AAKG;IACM,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEtE;;;;;;;;;;;;;;;AAeG;IACM,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAGnD,SAAS,GAAG,gBAAgB,EAAE;;;IAKxC,MAAM,GAAG,KAAK,CAAuB,QAAQ;+EAAC;;IAG9C,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;AAExC;;;;;AAKG;IACgB,mBAAmB,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,EAAE,CAAC;AAE9F;;;;AAIG;IACM,SAAS,GAAG,KAAK,CAAgB,IAAI;kFAAC;IAE9B,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;AAC/D,IAAA,iBAAiB,GAAG,QAAQ,CAAC,MAAK;;AAEnD,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE;AACjC,QAAA,IAAI,QAAQ;AAAE,YAAA,OAA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,EAAA,KAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5W3E;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-tree.mjs","sources":["../../../projects/lib/tree/tree.ts","../../../projects/lib/tree/tree.html","../../../projects/lib/tree/ngwr-tree.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 { 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 { readI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection } from 'ngwr/overlay';\n\nimport type { WrTreeNode, WrTreeSelectionMode } from './interfaces';\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 /** 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 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 * 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 // 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 cursor as the DOM sees it, clamped to the list that exists RIGHT NOW.\n *\n * The raw index is only ever written when a row is focused, and nothing shrank\n * it when the list did: collapsing a branch above the cursor left the index\n * past the end, which gave the tree zero rows with `tabindex=\"0\"` (no way back\n * in with Tab) and made every arrow key a no-op, because `onKeydown` bails when\n * `flat[i]` is undefined.\n */\n protected readonly cursorIndex = computed(() => {\n const last = Math.max(0, this.flat().length - 1);\n return Math.min(this.focusedIndex(), last);\n });\n\n /** Resolved ARIA labels — signals, so they follow both a late catalog and a locale switch. */\n protected readonly clearLabel = readI18nText('tree.clearSelection', 'Clear selection');\n protected readonly expandLabel = readI18nText('tree.expand', 'Expand');\n protected readonly collapseLabel = readI18nText('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 open = 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 if (this.open()) 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 // Drive the overlay open/close in response to the `open` signal.\n effect(() => {\n if (!this.isOverlay()) return;\n if (this.open()) {\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.open.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.open() : 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());\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 // Overlay-mode trigger handlers\n\n protected onTriggerClick(): void {\n if (this.disabled() || this.readonly()) return;\n this.open.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 if (event.key !== 'Backspace') return;\n if (this.disabled() || this.readonly() || this.open() || !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 if (set.has(id)) set.delete(id);\n else set.add(id);\n this.expanded.set([...set]);\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.open.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 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: 'wr-tree-overlay',\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.open.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.open.set(false);\n }\n });\n }\n\n private closeOverlay(): 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 (inPanel) this.host.nativeElement.querySelector<HTMLElement>('.wr-tree__trigger')?.focus();\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]=\"open()\"\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-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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;AAKG;AAqDH,IAAI,QAAQ,GAAG,CAAC;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;MAQU,MAAM,CAAA;;IAER,KAAK,GAAG,KAAK,CAA6B,EAAE;8EAAC;;IAG7C,QAAQ,GAAG,KAAK,CAAiB,EAAE;iFAAC;;IAGpC,QAAQ,GAA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A,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,UAAU,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5W3E;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-typewriter-testing.mjs","sources":["../../../projects/lib/typewriter/testing/wr-typewriter-harness.ts","../../../projects/lib/typewriter/testing/ngwr-typewriter-testing.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 { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrTypewriterHarnessFilters } from './interfaces';\n\n/** The one text node the state machine writes into — the whole of its observable output. */\nconst CONTENT = '.wr-typewriter__content';\n\n/** The caret. Not hidden when it is unwanted — removed from the document entirely. */\nconst CURSOR = '.wr-typewriter__cursor';\n\n/**\n * A `color:` declaration in an inline `style` attribute.\n *\n * The run has to start at the beginning or just after a `;` so that `background-color`\n * — or any other `-color` longhand a consumer's own style attribute might carry — cannot\n * be mistaken for it.\n */\nconst INLINE_COLOR = /(?:^|;)\\s*color\\s*:\\s*([^;]+)/;\n\n/** Exactly what the element holds — untrimmed, unlike `TestElement.text()`. */\nasync function rawText(element: TestElement): Promise<string> {\n return (await element.getProperty<string | null>('textContent')) ?? '';\n}\n\n/**\n * Test harness for `<wr-typewriter>`.\n *\n * **The typed string is the entire component, and it is a moving target.**\n * {@link getText} reads the one text node the machine writes into, which mid-run holds\n * a FRAGMENT — `'Hell'` on the way to `'Hello'` — and between sentences holds whatever\n * is left of the previous one. That is not a limitation to work around; it is what the\n * component renders, and pinning it tick by tick is what proves the machine types one\n * character at a time, deletes one at a time, pauses, cycles, and stops when told not to\n * loop. Install fake timers for `setTimeout` / `clearTimeout` only and advance the clock\n * yourself before every read — awaiting a harness method flushes microtasks, never\n * timers, so an unadvanced read answers with the previous frame.\n *\n * **What is typed is also what is announced, and no second copy exists.** There is\n * deliberately no `getAccessibleText()` here: the component renders one plain text node\n * and nothing else, so a screen reader landing mid-word hears the fragment. (Its sibling\n * `wr-rotating-text` carries a visually-hidden copy of the whole phrase; this one does\n * not, and inventing a method that implied otherwise would report an accessible layer\n * that is not there.) The single a11y decision the component does make is the caret, and\n * {@link isCursorDecorative} is how a spec holds it: without `aria-hidden` every phrase\n * is announced as `Hello pipe`, and nothing else in the DOM would change.\n *\n * **The methods that are missing are missing on purpose.** There is no `isTyping()` or\n * `getPhase()` — the phase is a private signal that never reaches the document, and its\n * only proxy, the caret vanishing, exists solely when `hideCursorWhileTyping` is set, so\n * the method would report \"not typing\" for the DEFAULT configuration while the machine\n * types. No `isComplete()` / `isFinished()`: a machine stopped on its last sentence and\n * one pausing between sentences render the identical string and the identical caret, so\n * assert the `sentenceComplete` output instead. No `isCursorBlinking()` /\n * `getCursorOpacity()`: the blink is a `@keyframes` rule from a stylesheet a unit test\n * never loads, and a mid-animation opacity is a number that means nothing.\n * No `isVisible()` / `waitForVisible()`: `startOnVisible` hangs off an\n * `IntersectionObserver` jsdom does not implement, so any answer would be the spec's own\n * stub echoing back. And no `getTypingSpeed()` / `getDeletingSpeed()` /\n * `getPauseDuration()` / `getInitialDelay()`: none of them is ever written to the DOM, so\n * reading them would mean reading the component instance rather than the rendered\n * control. They are observable exactly once — as the cadence of {@link getText}.\n *\n * What DOES survive a test with no layout, besides the string: the caret's presence,\n * glyph and `aria-hidden`, and the two values the host writes inline —\n * {@link getColor} and {@link getCursorBlinkDuration}.\n *\n * ```ts\n * // jsdom implements no IntersectionObserver, so `[startOnVisible]` throws on boot.\n * vi.stubGlobal('IntersectionObserver', StubObserver);\n * // Fake these two and no more: faking the microtask queue deadlocks `whenStable`,\n * // which is where the machine boots and where every harness read stabilizes.\n * vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });\n * ```\n *\n * @example\n * ```ts\n * const typewriter = await loader.getHarness(WrTypewriterHarness);\n *\n * vi.advanceTimersByTime(0); // the first tick is scheduled at `initialDelay`\n * expect(await typewriter.getText()).toBe('H');\n *\n * vi.advanceTimersByTime(50);\n * expect(await typewriter.getText()).toBe('He');\n * expect(await typewriter.isCursorDecorative()).toBe(true);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTypewriterHarness extends ComponentHarness {\n static hostSelector = 'wr-typewriter';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTypewriterHarnessFilters = {}): HarnessPredicate<WrTypewriterHarness> {\n return new HarnessPredicate(WrTypewriterHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption(\n 'hasCursor',\n options.hasCursor,\n async (harness, hasCursor) => (await harness.hasCursor()) === hasCursor\n );\n }\n\n private readonly content = this.locatorFor(CONTENT);\n private readonly cursor = this.locatorForOptional(CURSOR);\n\n /**\n * One custom property off the host's `style` ATTRIBUTE.\n *\n * Not `getCssValue()`, which is `getComputedStyle`: with the entry point's own\n * stylesheet loaded that resolves the sheet's declaration, so the method\n * answers plausibly at exactly the moment the host binding — the thing under\n * test — is what broke. The sibling reader below already says this; the\n * blink duration was reading the computed value anyway.\n */\n private async inlineVar(property: string): Promise<string> {\n const attr = (await (await this.host()).getAttribute('style')) ?? '';\n const found = new RegExp(`(?:^|;)\\\\s*${property}\\\\s*:\\\\s*([^;]+)`).exec(attr);\n return (found?.[1] ?? '').trim();\n }\n\n /**\n * What has been typed so far — a FRAGMENT while the machine is running.\n *\n * This is the whole state machine in one string, and every timing input is observable\n * only through it: one character per `typingSpeed`, one fewer per `deletingSpeed`, the\n * `pauseDuration` gap, the swap to the next entry in `[texts]`, and the stop that\n * `[loop]=\"false\"` puts on the last sentence. `reverseMode` shows up here too, and\n * `[...await getText()].length` is what proves the reversal counted CODE POINTS: a\n * `split('')` reversal turns one emoji into two lone surrogates, which is a pair of\n * broken glyphs on screen and the same character count as a correct answer.\n *\n * Untrimmed, because the fragment is what it is: a phrase typed as far as `'Hello '`\n * genuinely has a trailing space, and trimming would make that frame indistinguishable\n * from the one before it.\n *\n * The empty string is a real state, not a failure — nothing has been typed until the\n * first tick fires, and a deletion run passes back through it on its way to the next\n * sentence.\n */\n async getText(): Promise<string> {\n return rawText(await this.content());\n }\n\n /**\n * Whether a caret is in the document at all.\n *\n * The component removes the element rather than hiding it, which makes this two\n * questions at once. Statically it answers `showCursor`. While the machine runs it\n * also answers `hideCursorWhileTyping` — and the caret going away is the ONLY evidence\n * anywhere in the DOM that the component considers itself mid-phase, since the phase\n * signal is private. Do not read that as `isTyping()`, though: with\n * `hideCursorWhileTyping` off, which is the default, the caret stays put from the first\n * character to the last.\n */\n async hasCursor(): Promise<boolean> {\n return (await this.cursor()) !== null;\n }\n\n /**\n * The caret glyph, or `null` when there is no caret.\n *\n * `null` rather than `''` on purpose: \"no cursor element\" and \"a cursor element\n * rendering nothing\" are different failures, and an interpolated glyph that stopped\n * arriving is exactly the second one. Untrimmed, since a caret can legitimately be a\n * space-padded glyph and `TestElement.text()` would erase it.\n */\n async getCursorCharacter(): Promise<string | null> {\n const cursor = await this.cursor();\n return cursor ? rawText(cursor) : null;\n }\n\n /**\n * Whether the caret is kept out of the accessibility tree.\n *\n * The component's one deliberate a11y decision, and a silent one to lose: drop the\n * attribute and nothing on screen changes while every phrase starts being announced as\n * `Hello pipe`.\n *\n * Throws when there is no caret. `false` would read as \"the caret is announced\", which\n * is the opposite of what an absent caret means — and it is the answer a component that\n * stopped rendering its cursor entirely would also give. Ask {@link hasCursor} first\n * when the caret's presence is itself in question.\n */\n async isCursorDecorative(): Promise<boolean> {\n const cursor = await this.cursor();\n\n if (!cursor) {\n throw new Error(\n 'WrTypewriterHarness.isCursorDecorative(): this <wr-typewriter> has no cursor element, so there is ' +\n 'nothing to be hidden from a screen reader and \"false\" would read as \"the cursor is announced\" — the ' +\n 'opposite of what an absent cursor means. `showCursor` is off, or `hideCursorWhileTyping` has taken ' +\n 'it away for this phase; ask hasCursor().'\n );\n }\n\n return (await cursor.getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * The caret's blink half-cycle in seconds, from the custom property the host writes.\n *\n * The blink itself is a CSS keyframe and unobservable, so this custom property is the\n * only channel `[cursorBlinkDuration]` has into it — a binding that quietly stopped\n * writing it would leave the blink stuck at the stylesheet's default with no other\n * symptom anywhere.\n *\n * Throws rather than answering when the property is missing or unparseable, and says\n * which it was. The stylesheet's own `0.5s` fallback is never applied in a test that\n * loads no stylesheets, so an absent property reads as the empty string here — and\n * `0.5` returned from a `parseFloat('')` would be indistinguishable from the component\n * writing the default correctly.\n */\n async getCursorBlinkDuration(): Promise<number> {\n const raw = await this.inlineVar('--wr-typewriter-cursor-blink');\n const seconds = Number.parseFloat(raw);\n\n if (!Number.isFinite(seconds)) {\n throw new Error(\n `WrTypewriterHarness.getCursorBlinkDuration(): --wr-typewriter-cursor-blink reads ${JSON.stringify(raw)}, ` +\n 'which is not a number of seconds. The component writes this property inline on every render; the ' +\n 'stylesheet default behind it never applies in a test, so an empty read means the binding stopped ' +\n 'reaching the DOM rather than that the caret blinks at 0.5s.'\n );\n }\n\n return seconds;\n }\n\n /**\n * The colour the host paints the phrase in, exactly as it is written inline.\n *\n * `[textColors]` cycles per SENTENCE, so this is how a spec pins that the colour index\n * follows the sentence index rather than drifting; and with no colours given the\n * component writes the literal `inherit`, which is a value worth asserting rather than\n * an absence.\n *\n * Read off the `style` ATTRIBUTE rather than through `getCssValue`, which would answer\n * from a computed style. jsdom hands `inherit` straight back, so `getCssValue` would\n * agree here and lie in a real browser, where the keyword resolves to whatever rgb\n * triple the parent happens to carry.\n *\n * Throws when the host carries no `color` declaration: the component writes one on\n * every render, so its absence means the binding is gone, and any string returned in\n * its place would be a guess at what the page inherits.\n */\n async getColor(): Promise<string> {\n const style = (await (await this.host()).getAttribute('style')) ?? '';\n const declaration = INLINE_COLOR.exec(style);\n\n if (!declaration) {\n throw new Error(\n `WrTypewriterHarness.getColor(): the host carries no inline color — its style attribute is ` +\n `${JSON.stringify(style)}. The component writes one on every render, \"inherit\" when [textColors] is ` +\n 'empty, so nothing there means the binding stopped reaching the DOM.'\n );\n }\n\n return declaration[1].trim();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,OAAO,GAAG,yBAAyB;AAEzC;AACA,MAAM,MAAM,GAAG,wBAAwB;AAEvC;;;;;;AAMG;AACH,MAAM,YAAY,GAAG,+BAA+B;AAEpD;AACA,eAAe,OAAO,CAAC,OAAoB,EAAA;IACzC,OAAO,CAAC,MAAM,OAAO,CAAC,WAAW,CAAgB,aAAa,CAAC,KAAK,EAAE;AACxE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DG;AACG,MAAO,mBAAoB,SAAQ,gBAAgB,CAAA;AACvD,IAAA,OAAO,YAAY,GAAG,eAAe;;AAGrC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAsC,EAAE,EAAA;AAClD,QAAA,OAAO,IAAI,gBAAgB,CAAC,mBAAmB,EAAE,OAAO;aACrD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC;aAC1G,SAAS,CACR,WAAW,EACX,OAAO,CAAC,SAAS,E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sG;gBACtG,qGAAqG;AACrG,gBAAA,0CAA0C,CAC7C;QACH;QAEA,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM,MAAM;IAC9D;AAEA;;;;;;;;;;;;;AAaG;AACH,IAAA,MAAM,sBAAsB,GAAA;QAC1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC;QAChE,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC7B,MAAM,IAAI,KAAK,CACb,CAAA,iFAAA,EAAoF,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA,EAAA,CAAI;gBACzG,mGAAmG;gBACnG,mGAAmG;AACnG,gBAAA,6DAA6D,CAChE;QACH;AAEA,QAAA,OAAO,OAAO;IAChB;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QACrE,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAE5C,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CACb,CAAA,0FAAA,CAA4F;AAC1F,gBAAA,CAAA,EAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA,2EAAA,CAA6E;AACrG,gBAAA,qEAAqE,CACxE;QACH;AAEA,QAAA,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;IAC9B;;;ACzQF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-typewriter-testing.mjs","sources":["../../../projects/lib/typewriter/testing/wr-typewriter-harness.ts","../../../projects/lib/typewriter/testing/ngwr-typewriter-testing.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 { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrTypewriterHarnessFilters } from './interfaces';\n\n/** The one text node the state machine writes into — the whole of its observable output. */\nconst CONTENT = '.wr-typewriter__content';\n\n/** The caret. Not hidden when it is unwanted — removed from the document entirely. */\nconst CURSOR = '.wr-typewriter__cursor';\n\n/**\n * A `color:` declaration in an inline `style` attribute.\n *\n * The run has to start at the beginning or just after a `;` so that `background-color`\n * — or any other `-color` longhand a consumer's own style attribute might carry — cannot\n * be mistaken for it.\n */\nconst INLINE_COLOR = /(?:^|;)\\s*color\\s*:\\s*([^;]+)/;\n\n/** Exactly what the element holds — untrimmed, unlike `TestElement.text()`. */\nasync function rawText(element: TestElement): Promise<string> {\n return (await element.getProperty<string | null>('textContent')) ?? '';\n}\n\n/**\n * Test harness for `<wr-typewriter>`.\n *\n * **The typed string is the entire component, and it is a moving target.**\n * {@link getText} reads the one text node the machine writes into, which mid-run holds\n * a FRAGMENT — `'Hell'` on the way to `'Hello'` — and between sentences holds whatever\n * is left of the previous one. That is not a limitation to work around; it is what the\n * component renders, and pinning it tick by tick is what proves the machine types one\n * character at a time, deletes one at a time, pauses, cycles, and stops when told not to\n * loop. Install fake timers for `setTimeout` / `clearTimeout` only and advance the clock\n * yourself before every read — awaiting a harness method flushes microtasks, never\n * timers, so an unadvanced read answers with the previous frame.\n *\n * **What is typed is also what is announced, and no second copy exists.** There is\n * deliberately no `getAccessibleText()` here: the component renders one plain text node\n * and nothing else, so a screen reader landing mid-word hears the fragment. (Its sibling\n * `wr-rotating-text` carries a visually-hidden copy of the whole phrase; this one does\n * not, and inventing a method that implied otherwise would report an accessible layer\n * that is not there.) The single a11y decision the component does make is the caret, and\n * {@link isCursorDecorative} is how a spec holds it: without `aria-hidden` every phrase\n * is announced as `Hello pipe`, and nothing else in the DOM would change.\n *\n * **The methods that are missing are missing on purpose.** There is no `isTyping()` or\n * `getPhase()` — the phase is a private signal that never reaches the document, and its\n * only proxy, the caret vanishing, exists solely when `hideCursorWhileTyping` is set, so\n * the method would report \"not typing\" for the DEFAULT configuration while the machine\n * types. No `isComplete()` / `isFinished()`: a machine stopped on its last sentence and\n * one pausing between sentences render the identical string and the identical caret, so\n * assert the `sentenceComplete` output instead. No `isCursorBlinking()` /\n * `getCursorOpacity()`: the blink is a `@keyframes` rule from a stylesheet a unit test\n * never loads, and a mid-animation opacity is a number that means nothing.\n * No `isVisible()` / `waitForVisible()`: `startOnVisible` hangs off an\n * `IntersectionObserver` jsdom does not implement, so any answer would be the spec's own\n * stub echoing back. And no `getTypingSpeed()` / `getDeletingSpeed()` /\n * `getPauseDuration()` / `getInitialDelay()`: none of them is ever written to the DOM, so\n * reading them would mean reading the component instance rather than the rendered\n * control. They are observable exactly once — as the cadence of {@link getText}.\n *\n * What DOES survive a test with no layout, besides the string: the caret's presence,\n * glyph and `aria-hidden`, and the two values the host writes inline —\n * {@link getColor} and {@link getCursorBlinkDuration}.\n *\n * ```ts\n * // jsdom implements no IntersectionObserver, so `[startOnVisible]` throws on boot.\n * vi.stubGlobal('IntersectionObserver', StubObserver);\n * // Fake these two and no more: faking the microtask queue deadlocks `whenStable`,\n * // which is where the machine boots and where every harness read stabilizes.\n * vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });\n * ```\n *\n * @example\n * ```ts\n * const typewriter = await loader.getHarness(WrTypewriterHarness);\n *\n * vi.advanceTimersByTime(0); // the first tick is scheduled at `initialDelay`\n * expect(await typewriter.getText()).toBe('H');\n *\n * vi.advanceTimersByTime(50);\n * expect(await typewriter.getText()).toBe('He');\n * expect(await typewriter.isCursorDecorative()).toBe(true);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTypewriterHarness extends ComponentHarness {\n static hostSelector = 'wr-typewriter';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTypewriterHarnessFilters = {}): HarnessPredicate<WrTypewriterHarness> {\n return new HarnessPredicate(WrTypewriterHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption(\n 'hasCursor',\n options.hasCursor,\n async (harness, hasCursor) => (await harness.hasCursor()) === hasCursor\n );\n }\n\n private readonly content = this.locatorFor(CONTENT);\n private readonly cursor = this.locatorForOptional(CURSOR);\n\n /**\n * One custom property off the host's `style` ATTRIBUTE.\n *\n * Not `getCssValue()`, which is `getComputedStyle`: with the entry point's own\n * stylesheet loaded that resolves the sheet's declaration, so the method\n * answers plausibly at exactly the moment the host binding — the thing under\n * test — is what broke. The sibling reader below already says this; the\n * blink duration was reading the computed value anyway.\n */\n private async inlineVar(property: string): Promise<string> {\n const attr = (await (await this.host()).getAttribute('style')) ?? '';\n const found = new RegExp(`(?:^|;)\\\\s*${property}\\\\s*:\\\\s*([^;]+)`).exec(attr);\n return (found?.[1] ?? '').trim();\n }\n\n /**\n * What has been typed so far — a FRAGMENT while the machine is running.\n *\n * This is the whole state machine in one string, and every timing input is observable\n * only through it: one character per `typingSpeed`, one fewer per `deletingSpeed`, the\n * `pauseDuration` gap, the swap to the next entry in `[texts]`, and the stop that\n * `[loop]=\"false\"` puts on the last sentence. `reverseMode` shows up here too, and\n * `[...await getText()].length` is what proves the reversal counted CODE POINTS: a\n * `split('')` reversal turns one emoji into two lone surrogates, which is a pair of\n * broken glyphs on screen and the same character count as a correct answer.\n *\n * Untrimmed, because the fragment is what it is: a phrase typed as far as `'Hello '`\n * genuinely has a trailing space, and trimming would make that frame indistinguishable\n * from the one before it.\n *\n * The empty string is a real state, not a failure — nothing has been typed until the\n * first tick fires, and a deletion run passes back through it on its way to the next\n * sentence.\n */\n async getText(): Promise<string> {\n return rawText(await this.content());\n }\n\n /**\n * Whether a caret is in the document at all.\n *\n * The component removes the element rather than hiding it, which makes this two\n * questions at once. Statically it answers `showCursor`. While the machine runs it\n * also answers `hideCursorWhileTyping` — and the caret going away is the ONLY evidence\n * anywhere in the DOM that the component considers itself mid-phase, since the phase\n * signal is private. Do not read that as `isTyping()`, though: with\n * `hideCursorWhileTyping` off, which is the default, the caret stays put from the first\n * character to the last.\n */\n async hasCursor(): Promise<boolean> {\n return (await this.cursor()) !== null;\n }\n\n /**\n * The caret glyph, or `null` when there is no caret.\n *\n * `null` rather than `''` on purpose: \"no cursor element\" and \"a cursor element\n * rendering nothing\" are different failures, and an interpolated glyph that stopped\n * arriving is exactly the second one. Untrimmed, since a caret can legitimately be a\n * space-padded glyph and `TestElement.text()` would erase it.\n */\n async getCursorCharacter(): Promise<string | null> {\n const cursor = await this.cursor();\n return cursor ? rawText(cursor) : null;\n }\n\n /**\n * Whether the caret is kept out of the accessibility tree.\n *\n * The component's one deliberate a11y decision, and a silent one to lose: drop the\n * attribute and nothing on screen changes while every phrase starts being announced as\n * `Hello pipe`.\n *\n * Throws when there is no caret. `false` would read as \"the caret is announced\", which\n * is the opposite of what an absent caret means — and it is the answer a component that\n * stopped rendering its cursor entirely would also give. Ask {@link hasCursor} first\n * when the caret's presence is itself in question.\n */\n async isCursorDecorative(): Promise<boolean> {\n const cursor = await this.cursor();\n\n if (!cursor) {\n throw new Error(\n 'WrTypewriterHarness.isCursorDecorative(): this <wr-typewriter> has no cursor element, so there is ' +\n 'nothing to be hidden from a screen reader and \"false\" would read as \"the cursor is announced\" — the ' +\n 'opposite of what an absent cursor means. `showCursor` is off, or `hideCursorWhileTyping` has taken ' +\n 'it away for this phase; ask hasCursor().'\n );\n }\n\n return (await cursor.getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * The caret's blink half-cycle in seconds, from the custom property the host writes.\n *\n * The blink itself is a CSS keyframe and unobservable, so this custom property is the\n * only channel `[cursorBlinkDuration]` has into it — a binding that quietly stopped\n * writing it would leave the blink stuck at the stylesheet's default with no other\n * symptom anywhere.\n *\n * Throws rather than answering when the property is missing or unparseable, and says\n * which it was. The stylesheet's own `0.5s` fallback is never applied in a test that\n * loads no stylesheets, so an absent property reads as the empty string here — and\n * `0.5` returned from a `parseFloat('')` would be indistinguishable from the component\n * writing the default correctly.\n */\n async getCursorBlinkDuration(): Promise<number> {\n const raw = await this.inlineVar('--wr-typewriter-cursor-blink');\n const seconds = Number.parseFloat(raw);\n\n if (!Number.isFinite(seconds)) {\n throw new Error(\n `WrTypewriterHarness.getCursorBlinkDuration(): --wr-typewriter-cursor-blink reads ${JSON.stringify(raw)}, ` +\n 'which is not a number of seconds. The component writes this property inline on every render; the ' +\n 'stylesheet default behind it never applies in a test, so an empty read means the binding stopped ' +\n 'reaching the DOM rather than that the caret blinks at 0.5s.'\n );\n }\n\n return seconds;\n }\n\n /**\n * The colour the host paints the phrase in, exactly as it is written inline.\n *\n * `[textColors]` cycles per SENTENCE, so this is how a spec pins that the colour index\n * follows the sentence index rather than drifting; and with no colours given the\n * component writes the literal `inherit`, which is a value worth asserting rather than\n * an absence.\n *\n * Read off the `style` ATTRIBUTE rather than through `getCssValue`, which would answer\n * from a computed style. jsdom hands `inherit` straight back, so `getCssValue` would\n * agree here and lie in a real browser, where the keyword resolves to whatever rgb\n * triple the parent happens to carry.\n *\n * Throws when the host carries no `color` declaration: the component writes one on\n * every render, so its absence means the binding is gone, and any string returned in\n * its place would be a guess at what the page inherits.\n */\n async getColor(): Promise<string> {\n const style = (await (await this.host()).getAttribute('style')) ?? '';\n const declaration = INLINE_COLOR.exec(style);\n\n if (!declaration) {\n throw new Error(\n `WrTypewriterHarness.getColor(): the host carries no inline color — its style attribute is ` +\n `${JSON.stringify(style)}. The component writes one on every render, \"inherit\" when [textColors] is ` +\n 'empty, so nothing there means the binding stopped reaching the DOM.'\n );\n }\n\n return declaration[1].trim();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,OAAO,GAAG,yBAAyB;AAEzC;AACA,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;AAEA,QAAA,OAAO,OAAO;IAChB;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QACrE,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAE5C,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CACb,CAAA,0FAAA,CAA4F;AAC1F,gBAAA,CAAA,EAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA,2EAAA,CAA6E;AACrG,gBAAA,qEAAqE,CACxE;QACH;AAEA,QAAA,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;IAC9B;;;ACzQF;;AAEG;;"}
@@ -224,10 +224,10 @@ class WrTypewriter {
224
224
  this.phase.set('deleting');
225
225
  this.scheduleNext(this.pauseDuration());
226
226
  }
227
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrTypewriter, deps: [], target: i0.ɵɵFactoryTarget.Component });
228
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrTypewriter, isStandalone: true, selector: "wr-typewriter", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: false, transformFunction: null }, typingSpeed: { classPropertyName: "typingSpeed", publicName: "typingSpeed", isSignal: true, isRequired: false, transformFunction: null }, initialDelay: { classPropertyName: "initialDelay", publicName: "initialDelay", isSignal: true, isRequired: false, transformFunction: null }, pauseDuration: { classPropertyName: "pauseDuration", publicName: "pauseDuration", isSignal: true, isRequired: false, transformFunction: null }, deletingSpeed: { classPropertyName: "deletingSpeed", publicName: "deletingSpeed", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, showCursor: { classPropertyName: "showCursor", publicName: "showCursor", isSignal: true, isRequired: false, transformFunction: null }, hideCursorWhileTyping: { classPropertyName: "hideCursorWhileTyping", publicName: "hideCursorWhileTyping", isSignal: true, isRequired: false, transformFunction: null }, cursorCharacter: { classPropertyName: "cursorCharacter", publicName: "cursorCharacter", isSignal: true, isRequired: false, transformFunction: null }, cursorBlinkDuration: { classPropertyName: "cursorBlinkDuration", publicName: "cursorBlinkDuration", isSignal: true, isRequired: false, transformFunction: null }, textColors: { classPropertyName: "textColors", publicName: "textColors", isSignal: true, isRequired: false, transformFunction: null }, variableSpeed: { classPropertyName: "variableSpeed", publicName: "variableSpeed", isSignal: true, isRequired: false, transformFunction: null }, reverseMode: { classPropertyName: "reverseMode", publicName: "reverseMode", isSignal: true, isRequired: false, transformFunction: null }, startOnVisible: { classPropertyName: "startOnVisible", publicName: "startOnVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sentenceComplete: "sentenceComplete" }, host: { properties: { "style.color": "activeColor()", "style.--wr-typewriter-cursor-blink": "cursorBlinkDuration() + 's'" }, classAttribute: "wr-typewriter" }, ngImport: i0, template: "<span class=\"wr-typewriter__content\">{{ displayed() }}</span>\n@if (cursorVisible()) {\n <span class=\"wr-typewriter__cursor\" aria-hidden=\"true\">{{ cursorCharacter() }}</span>\n}\n", styles: [".wr-typewriter{--wr-typewriter-cursor-blink: .5s;display:inline-flex;align-items:baseline}.wr-typewriter__content{white-space:pre}.wr-typewriter__cursor{display:inline-block;margin-inline-start:1px;animation:wr-typewriter-blink var(--wr-typewriter-cursor-blink) ease-in-out infinite alternate}@keyframes wr-typewriter-blink{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.wr-typewriter__cursor{animation:none;opacity:1}}\n"], encapsulation: i0.ViewEncapsulation.None });
227
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrTypewriter, deps: [], target: i0.ɵɵFactoryTarget.Component });
228
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: WrTypewriter, isStandalone: true, selector: "wr-typewriter", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: false, transformFunction: null }, typingSpeed: { classPropertyName: "typingSpeed", publicName: "typingSpeed", isSignal: true, isRequired: false, transformFunction: null }, initialDelay: { classPropertyName: "initialDelay", publicName: "initialDelay", isSignal: true, isRequired: false, transformFunction: null }, pauseDuration: { classPropertyName: "pauseDuration", publicName: "pauseDuration", isSignal: true, isRequired: false, transformFunction: null }, deletingSpeed: { classPropertyName: "deletingSpeed", publicName: "deletingSpeed", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, showCursor: { classPropertyName: "showCursor", publicName: "showCursor", isSignal: true, isRequired: false, transformFunction: null }, hideCursorWhileTyping: { classPropertyName: "hideCursorWhileTyping", publicName: "hideCursorWhileTyping", isSignal: true, isRequired: false, transformFunction: null }, cursorCharacter: { classPropertyName: "cursorCharacter", publicName: "cursorCharacter", isSignal: true, isRequired: false, transformFunction: null }, cursorBlinkDuration: { classPropertyName: "cursorBlinkDuration", publicName: "cursorBlinkDuration", isSignal: true, isRequired: false, transformFunction: null }, textColors: { classPropertyName: "textColors", publicName: "textColors", isSignal: true, isRequired: false, transformFunction: null }, variableSpeed: { classPropertyName: "variableSpeed", publicName: "variableSpeed", isSignal: true, isRequired: false, transformFunction: null }, reverseMode: { classPropertyName: "reverseMode", publicName: "reverseMode", isSignal: true, isRequired: false, transformFunction: null }, startOnVisible: { classPropertyName: "startOnVisible", publicName: "startOnVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sentenceComplete: "sentenceComplete" }, host: { properties: { "style.color": "activeColor()", "style.--wr-typewriter-cursor-blink": "cursorBlinkDuration() + 's'" }, classAttribute: "wr-typewriter" }, ngImport: i0, template: "<span class=\"wr-typewriter__content\">{{ displayed() }}</span>\n@if (cursorVisible()) {\n <span class=\"wr-typewriter__cursor\" aria-hidden=\"true\">{{ cursorCharacter() }}</span>\n}\n", styles: [".wr-typewriter{--wr-typewriter-cursor-blink: .5s;display:inline-flex;align-items:baseline}.wr-typewriter__content{white-space:pre}.wr-typewriter__cursor{display:inline-block;margin-inline-start:1px;animation:wr-typewriter-blink var(--wr-typewriter-cursor-blink) ease-in-out infinite alternate}@keyframes wr-typewriter-blink{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.wr-typewriter__cursor{animation:none;opacity:1}}\n"], encapsulation: i0.ViewEncapsulation.None });
229
229
  }
230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrTypewriter, decorators: [{
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrTypewriter, decorators: [{
231
231
  type: Component,
232
232
  args: [{ selector: 'wr-typewriter', encapsulation: ViewEncapsulation.None, host: {
233
233
  class: 'wr-typewriter',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-typewriter.mjs","sources":["../../../projects/lib/typewriter/typewriter.ts","../../../projects/lib/typewriter/typewriter.html","../../../projects/lib/typewriter/ngwr-typewriter.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 * Angular adaptation of the TextType effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/text-type\n *\n * The reactbits version uses GSAP for the cursor blink. This port is\n * dependency-free — vanilla `setTimeout` loop for typing/deleting,\n * pure-CSS keyframes for the cursor blink.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrTypewriterVariableSpeed } from './interfaces';\n\n/**\n * Classic typewriter — types out a string char-by-char, optionally\n * deletes it, then types the next string. Cycles through `[texts]` (or\n * a single string) with a blinking cursor.\n *\n * @example\n * ```html\n * <wr-typewriter [texts]=\"['design.', 'ship.', 'iterate.']\" />\n * <wr-typewriter\n * text=\"Hello, ngwr.\"\n * [loop]=\"false\"\n * [typingSpeed]=\"35\"\n * cursorCharacter=\"▎\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/text-type\n */\n@Component({\n selector: 'wr-typewriter',\n templateUrl: './typewriter.html',\n styleUrl: './typewriter.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-typewriter',\n '[style.color]': 'activeColor()',\n '[style.--wr-typewriter-cursor-blink]': \"cursorBlinkDuration() + 's'\",\n },\n})\nexport class WrTypewriter {\n /** Single string. Use either `text` or `texts`. */\n readonly text = input<string | undefined>(undefined);\n\n /** Strings to cycle. Use either `text` or `texts`. */\n readonly texts = input<readonly string[] | undefined>(undefined);\n\n /** Per-char typing speed in ms. @default 50 */\n readonly typingSpeed = input(50, { transform: numAttr(50) });\n\n /** Initial delay before typing starts, in ms. @default 0 */\n readonly initialDelay = input(0, { transform: numAttr(0) });\n\n /** Pause between sentences (after typing complete, before deleting), in ms. @default 2000 */\n readonly pauseDuration = input(2000, { transform: numAttr(2000) });\n\n /** Per-char deletion speed in ms. @default 30 */\n readonly deletingSpeed = input(30, { transform: numAttr(30) });\n\n /** Loop back to the first string after the last. @default true */\n readonly loop = input(true, { transform: coerceBooleanProperty });\n\n /** Show the cursor. @default true */\n readonly showCursor = input(true, { transform: coerceBooleanProperty });\n\n /** Hide the cursor while typing / deleting. @default false */\n readonly hideCursorWhileTyping = input(false, { transform: coerceBooleanProperty });\n\n /** Cursor glyph. @default '|' */\n readonly cursorCharacter = input('|');\n\n /** Cursor blink half-cycle in seconds. @default 0.5 */\n readonly cursorBlinkDuration = input(0.5, { transform: numAttr(0.5) });\n\n /** Cycle through these colours per string. */\n readonly textColors = input<readonly string[]>([]);\n\n /** Randomise typing speed per char between `min` and `max`. */\n readonly variableSpeed = input<WrTypewriterVariableSpeed | undefined>(undefined);\n\n /** Reverse the string (type it backwards). @default false */\n readonly reverseMode = input(false, { transform: coerceBooleanProperty });\n\n /** Start typing only after the host enters the viewport. @default false */\n readonly startOnVisible = input(false, { transform: coerceBooleanProperty });\n\n /** Emits with `(text, index)` when a string finishes typing. */\n readonly sentenceComplete = output<{ text: string; index: number }>();\n\n protected readonly displayed = signal('');\n protected readonly cursorVisible = computed(() => {\n if (!this.showCursor()) return false;\n if (!this.hideCursorWhileTyping()) return true;\n // While typing or deleting, cursor stays hidden.\n return this.phase() === 'idle';\n });\n protected readonly activeColor = computed(() => {\n const colours = this.textColors();\n if (colours.length === 0) return 'inherit';\n return colours[this.currentTextIndex() % colours.length];\n });\n\n /** Resolved list of strings (either `texts` or wrap `text` in an array). */\n private readonly textArray = computed<readonly string[]>(() => {\n const list = this.texts();\n if (list && list.length > 0) return list;\n const single = this.text();\n return single ? [single] : [];\n });\n\n private readonly currentTextIndex = signal(0);\n private readonly phase = signal<'idle' | 'typing' | 'deleting'>('idle');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n private isVisible = false;\n\n constructor() {\n if (!this.isBrowser) {\n // SSR: type nothing, but settle on the first phrase so prerendered\n // HTML carries real text instead of an empty span. Mirrors\n // `wr-decrypt-text`.\n effect(() => this.displayed.set(this.textArray()[0] ?? ''));\n return;\n }\n afterNextRender(() => this.boot());\n this.destroyRef.onDestroy(() => clearTimeout(this.timer));\n }\n\n private boot(): void {\n if (this.startOnVisible()) {\n const io = new IntersectionObserver(\n (entries, obs) => {\n for (const e of entries) {\n if (e.isIntersecting) {\n obs.disconnect();\n this.isVisible = true;\n this.scheduleNext(this.initialDelay());\n break;\n }\n }\n },\n { threshold: 0.1 }\n );\n io.observe(this.host.nativeElement);\n this.destroyRef.onDestroy(() => io.disconnect());\n } else {\n this.isVisible = true;\n this.scheduleNext(this.initialDelay());\n }\n }\n\n private scheduleNext(delay: number): void {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => this.tick(), delay);\n }\n\n private tick(): void {\n if (!this.isVisible) return;\n const arr = this.textArray();\n if (arr.length === 0) return;\n\n // Clamped, because `texts` can shrink under a running index — a filtered or\n // reloaded list — and nothing resets `currentTextIndex`. Unclamped, `arr[idx]`\n // came back `undefined` and threw inside the `setTimeout`: on the spread below\n // under `reverseMode`, on the `target.length` read otherwise. Either way the\n // throw pre-empts `scheduleNext`, so the typewriter stopped for good. Same\n // guard as `wr-rotating-text`. Written back so `activeColor`, which reads the\n // signal directly, picks the same sentence.\n const idx = Math.min(this.currentTextIndex(), arr.length - 1);\n this.currentTextIndex.set(idx);\n const raw = arr[idx];\n // Reversed by CODE POINT: `split('')` reverses UTF-16 units, which turns an\n // emoji into a pair of lone surrogates rather than typing it backwards.\n const target = this.reverseMode() ? [...raw].reverse().join('') : raw;\n const displayed = this.displayed();\n\n // Reduced motion: show each sentence whole — no per-char typing or\n // deleting. Multi-text setups still advance on the pause cadence,\n // since the sentence swap itself is content, not decoration.\n if (this.platform.prefersReducedMotion()) {\n if (displayed !== target) {\n this.displayed.set(target);\n this.phase.set('idle');\n this.sentenceComplete.emit({ text: raw, index: idx });\n }\n if (arr.length === 1 || (!this.loop() && idx === arr.length - 1)) return;\n this.currentTextIndex.set((idx + 1) % arr.length);\n this.scheduleNext(this.pauseDuration());\n return;\n }\n\n if (this.phase() === 'deleting') {\n if (displayed.length === 0) {\n // Finished deleting → advance to next text.\n this.phase.set('idle');\n const nextIndex = (idx + 1) % arr.length;\n // Non-loop: stop if we just finished the last sentence.\n if (!this.loop() && idx === arr.length - 1) return;\n this.currentTextIndex.set(nextIndex);\n this.scheduleNext(this.pauseDuration());\n return;\n }\n // Continue deleting.\n this.displayed.set(displayed.slice(0, -1));\n this.scheduleNext(this.deletingSpeed());\n return;\n }\n\n // Typing or idle.\n if (displayed.length < target.length) {\n this.phase.set('typing');\n this.displayed.set(target.slice(0, displayed.length + 1));\n const delay = this.variableSpeed()\n ? Math.random() * (this.variableSpeed()!.max - this.variableSpeed()!.min) + this.variableSpeed()!.min\n : this.typingSpeed();\n this.scheduleNext(delay);\n return;\n }\n\n // Typing complete for this sentence.\n this.sentenceComplete.emit({ text: raw, index: idx });\n\n // Single text + no loop → stop here.\n if (arr.length === 1 && !this.loop()) {\n this.phase.set('idle');\n return;\n }\n // Non-loop on last sentence → stop here.\n if (!this.loop() && idx === arr.length - 1) {\n this.phase.set('idle');\n return;\n }\n\n // Start deleting after the pause.\n this.phase.set('deleting');\n this.scheduleNext(this.pauseDuration());\n }\n}\n\nexport type { WrTypewriterVariableSpeed } from './interfaces';\n","<span class=\"wr-typewriter__content\">{{ displayed() }}</span>\n@if (cursorVisible()) {\n <span class=\"wr-typewriter__cursor\" aria-hidden=\"true\">{{ cursorCharacter() }}</span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;AAYG;AAwBH;;;;;;;;;;;;;;;;;AAiBG;MAYU,YAAY,CAAA;;IAEd,IAAI,GAAG,KAAK,CAAqB,SAAS;6EAAC;;IAG3C,KAAK,GAAG,KAAK,CAAgC,SAAS;8EAAC;;AAGvD,IAAA,WAAW,GAAG,KAAK,CAAC,EAAE,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,aAAA,EAAA,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CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,aAAA,EAGV,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,eAAe;AACtB,wBAAA,eAAe,EAAE,eAAe;AAChC,wBAAA,sCAAsC,EAAE,6BAA6B;AACtE,qBAAA,EAAA,QAAA,EAAA,4LAAA,EAAA,MAAA,EAAA,CAAA,0bAAA,CAAA,EAAA;;;AE/DH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-typewriter.mjs","sources":["../../../projects/lib/typewriter/typewriter.ts","../../../projects/lib/typewriter/typewriter.html","../../../projects/lib/typewriter/ngwr-typewriter.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 * Angular adaptation of the TextType effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/text-type\n *\n * The reactbits version uses GSAP for the cursor blink. This port is\n * dependency-free — vanilla `setTimeout` loop for typing/deleting,\n * pure-CSS keyframes for the cursor blink.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrTypewriterVariableSpeed } from './interfaces';\n\n/**\n * Classic typewriter — types out a string char-by-char, optionally\n * deletes it, then types the next string. Cycles through `[texts]` (or\n * a single string) with a blinking cursor.\n *\n * @example\n * ```html\n * <wr-typewriter [texts]=\"['design.', 'ship.', 'iterate.']\" />\n * <wr-typewriter\n * text=\"Hello, ngwr.\"\n * [loop]=\"false\"\n * [typingSpeed]=\"35\"\n * cursorCharacter=\"▎\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/text-type\n */\n@Component({\n selector: 'wr-typewriter',\n templateUrl: './typewriter.html',\n styleUrl: './typewriter.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-typewriter',\n '[style.color]': 'activeColor()',\n '[style.--wr-typewriter-cursor-blink]': \"cursorBlinkDuration() + 's'\",\n },\n})\nexport class WrTypewriter {\n /** Single string. Use either `text` or `texts`. */\n readonly text = input<string | undefined>(undefined);\n\n /** Strings to cycle. Use either `text` or `texts`. */\n readonly texts = input<readonly string[] | undefined>(undefined);\n\n /** Per-char typing speed in ms. @default 50 */\n readonly typingSpeed = input(50, { transform: numAttr(50) });\n\n /** Initial delay before typing starts, in ms. @default 0 */\n readonly initialDelay = input(0, { transform: numAttr(0) });\n\n /** Pause between sentences (after typing complete, before deleting), in ms. @default 2000 */\n readonly pauseDuration = input(2000, { transform: numAttr(2000) });\n\n /** Per-char deletion speed in ms. @default 30 */\n readonly deletingSpeed = input(30, { transform: numAttr(30) });\n\n /** Loop back to the first string after the last. @default true */\n readonly loop = input(true, { transform: coerceBooleanProperty });\n\n /** Show the cursor. @default true */\n readonly showCursor = input(true, { transform: coerceBooleanProperty });\n\n /** Hide the cursor while typing / deleting. @default false */\n readonly hideCursorWhileTyping = input(false, { transform: coerceBooleanProperty });\n\n /** Cursor glyph. @default '|' */\n readonly cursorCharacter = input('|');\n\n /** Cursor blink half-cycle in seconds. @default 0.5 */\n readonly cursorBlinkDuration = input(0.5, { transform: numAttr(0.5) });\n\n /** Cycle through these colours per string. */\n readonly textColors = input<readonly string[]>([]);\n\n /** Randomise typing speed per char between `min` and `max`. */\n readonly variableSpeed = input<WrTypewriterVariableSpeed | undefined>(undefined);\n\n /** Reverse the string (type it backwards). @default false */\n readonly reverseMode = input(false, { transform: coerceBooleanProperty });\n\n /** Start typing only after the host enters the viewport. @default false */\n readonly startOnVisible = input(false, { transform: coerceBooleanProperty });\n\n /** Emits with `(text, index)` when a string finishes typing. */\n readonly sentenceComplete = output<{ text: string; index: number }>();\n\n protected readonly displayed = signal('');\n protected readonly cursorVisible = computed(() => {\n if (!this.showCursor()) return false;\n if (!this.hideCursorWhileTyping()) return true;\n // While typing or deleting, cursor stays hidden.\n return this.phase() === 'idle';\n });\n protected readonly activeColor = computed(() => {\n const colours = this.textColors();\n if (colours.length === 0) return 'inherit';\n return colours[this.currentTextIndex() % colours.length];\n });\n\n /** Resolved list of strings (either `texts` or wrap `text` in an array). */\n private readonly textArray = computed<readonly string[]>(() => {\n const list = this.texts();\n if (list && list.length > 0) return list;\n const single = this.text();\n return single ? [single] : [];\n });\n\n private readonly currentTextIndex = signal(0);\n private readonly phase = signal<'idle' | 'typing' | 'deleting'>('idle');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n private isVisible = false;\n\n constructor() {\n if (!this.isBrowser) {\n // SSR: type nothing, but settle on the first phrase so prerendered\n // HTML carries real text instead of an empty span. Mirrors\n // `wr-decrypt-text`.\n effect(() => this.displayed.set(this.textArray()[0] ?? ''));\n return;\n }\n afterNextRender(() => this.boot());\n this.destroyRef.onDestroy(() => clearTimeout(this.timer));\n }\n\n private boot(): void {\n if (this.startOnVisible()) {\n const io = new IntersectionObserver(\n (entries, obs) => {\n for (const e of entries) {\n if (e.isIntersecting) {\n obs.disconnect();\n this.isVisible = true;\n this.scheduleNext(this.initialDelay());\n break;\n }\n }\n },\n { threshold: 0.1 }\n );\n io.observe(this.host.nativeElement);\n this.destroyRef.onDestroy(() => io.disconnect());\n } else {\n this.isVisible = true;\n this.scheduleNext(this.initialDelay());\n }\n }\n\n private scheduleNext(delay: number): void {\n clearTimeout(this.timer);\n this.timer = setTimeout(() => this.tick(), delay);\n }\n\n private tick(): void {\n if (!this.isVisible) return;\n const arr = this.textArray();\n if (arr.length === 0) return;\n\n // Clamped, because `texts` can shrink under a running index — a filtered or\n // reloaded list — and nothing resets `currentTextIndex`. Unclamped, `arr[idx]`\n // came back `undefined` and threw inside the `setTimeout`: on the spread below\n // under `reverseMode`, on the `target.length` read otherwise. Either way the\n // throw pre-empts `scheduleNext`, so the typewriter stopped for good. Same\n // guard as `wr-rotating-text`. Written back so `activeColor`, which reads the\n // signal directly, picks the same sentence.\n const idx = Math.min(this.currentTextIndex(), arr.length - 1);\n this.currentTextIndex.set(idx);\n const raw = arr[idx];\n // Reversed by CODE POINT: `split('')` reverses UTF-16 units, which turns an\n // emoji into a pair of lone surrogates rather than typing it backwards.\n const target = this.reverseMode() ? [...raw].reverse().join('') : raw;\n const displayed = this.displayed();\n\n // Reduced motion: show each sentence whole — no per-char typing or\n // deleting. Multi-text setups still advance on the pause cadence,\n // since the sentence swap itself is content, not decoration.\n if (this.platform.prefersReducedMotion()) {\n if (displayed !== target) {\n this.displayed.set(target);\n this.phase.set('idle');\n this.sentenceComplete.emit({ text: raw, index: idx });\n }\n if (arr.length === 1 || (!this.loop() && idx === arr.length - 1)) return;\n this.currentTextIndex.set((idx + 1) % arr.length);\n this.scheduleNext(this.pauseDuration());\n return;\n }\n\n if (this.phase() === 'deleting') {\n if (displayed.length === 0) {\n // Finished deleting → advance to next text.\n this.phase.set('idle');\n const nextIndex = (idx + 1) % arr.length;\n // Non-loop: stop if we just finished the last sentence.\n if (!this.loop() && idx === arr.length - 1) return;\n this.currentTextIndex.set(nextIndex);\n this.scheduleNext(this.pauseDuration());\n return;\n }\n // Continue deleting.\n this.displayed.set(displayed.slice(0, -1));\n this.scheduleNext(this.deletingSpeed());\n return;\n }\n\n // Typing or idle.\n if (displayed.length < target.length) {\n this.phase.set('typing');\n this.displayed.set(target.slice(0, displayed.length + 1));\n const delay = this.variableSpeed()\n ? Math.random() * (this.variableSpeed()!.max - this.variableSpeed()!.min) + this.variableSpeed()!.min\n : this.typingSpeed();\n this.scheduleNext(delay);\n return;\n }\n\n // Typing complete for this sentence.\n this.sentenceComplete.emit({ text: raw, index: idx });\n\n // Single text + no loop → stop here.\n if (arr.length === 1 && !this.loop()) {\n this.phase.set('idle');\n return;\n }\n // Non-loop on last sentence → stop here.\n if (!this.loop() && idx === arr.length - 1) {\n this.phase.set('idle');\n return;\n }\n\n // Start deleting after the pause.\n this.phase.set('deleting');\n this.scheduleNext(this.pauseDuration());\n }\n}\n\nexport type { WrTypewriterVariableSpeed } from './interfaces';\n","<span class=\"wr-typewriter__content\">{{ displayed() }}</span>\n@if (cursorVisible()) {\n <span class=\"wr-typewriter__cursor\" aria-hidden=\"true\">{{ cursorCharacter() }}</span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;AAYG;AAwBH;;;;;;;;;;;;;;;;;AAiBG;MAYU,YAAY,CAAA;;IAEd,IAAI,GAAG,KAAK,CAAqB,SAAS;6EAAC;;IAG3C,KAAK,GAAG,KAAK,CAAgC,SAAS;8EAAC;;AAGvD,IAAA,WAAW,GAAG,KAAK,CAAC,EAAE,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,aAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,EAAA,CAAG;;AAGnD,IAAA,YAAY,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,cAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;AAGlD,IAAA,aAAa,GAAG,KAAK,CAAC,IAAI,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,eAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAA,CAAG;;AAGzD,IAAA,aAAa,GAAG,KAAK,CAAC,EAAE,EAAA,EAAA,IAAA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