ngwr 16.0.0 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/badge/styles/_tag.scss +8 -4
  2. package/button/styles/_index.scss +13 -7
  3. package/cascader/styles/_rules.scss +4 -2
  4. package/checkbox/styles/_index.scss +4 -2
  5. package/date-picker/styles/_index.scss +95 -3
  6. package/date-stamp/styles/_index.scss +38 -0
  7. package/dialog/styles/_index.scss +38 -0
  8. package/dropdown/styles/_index.scss +37 -1
  9. package/fesm2022/internal-CVLvP9b_.mjs +33 -0
  10. package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +11 -7
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-avatar.mjs +11 -7
  14. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  15. package/fesm2022/ngwr-back-top.mjs +10 -6
  16. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  17. package/fesm2022/ngwr-badge.mjs +18 -6
  18. package/fesm2022/ngwr-badge.mjs.map +1 -1
  19. package/fesm2022/ngwr-burger.mjs +9 -6
  20. package/fesm2022/ngwr-burger.mjs.map +1 -1
  21. package/fesm2022/ngwr-button.mjs +8 -4
  22. package/fesm2022/ngwr-button.mjs.map +1 -1
  23. package/fesm2022/ngwr-calendar.mjs +19 -8
  24. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  25. package/fesm2022/ngwr-card.mjs +9 -5
  26. package/fesm2022/ngwr-card.mjs.map +1 -1
  27. package/fesm2022/ngwr-cascader.mjs +11 -5
  28. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  29. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
  30. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-checkbox.mjs +10 -6
  32. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngwr-clipboard.mjs +2 -1
  34. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  35. package/fesm2022/ngwr-collapse.mjs +9 -5
  36. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +4 -2
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-comment.mjs +13 -7
  40. package/fesm2022/ngwr-comment.mjs.map +1 -1
  41. package/fesm2022/ngwr-compare.mjs +9 -3
  42. package/fesm2022/ngwr-compare.mjs.map +1 -1
  43. package/fesm2022/ngwr-context-menu.mjs +4 -2
  44. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  45. package/fesm2022/ngwr-copy-value.mjs +11 -6
  46. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  47. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  48. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-date-picker.mjs +238 -38
  50. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  51. package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
  52. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
  53. package/fesm2022/ngwr-date-stamp.mjs +213 -0
  54. package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
  55. package/fesm2022/ngwr-date.mjs +364 -54
  56. package/fesm2022/ngwr-date.mjs.map +1 -1
  57. package/fesm2022/ngwr-descriptions.mjs +9 -5
  58. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog-testing.mjs +23 -2
  60. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-dialog.mjs +45 -16
  62. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  63. package/fesm2022/ngwr-directives.mjs +102 -11
  64. package/fesm2022/ngwr-directives.mjs.map +1 -1
  65. package/fesm2022/ngwr-divider.mjs +4 -2
  66. package/fesm2022/ngwr-divider.mjs.map +1 -1
  67. package/fesm2022/ngwr-drawer.mjs +29 -3
  68. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  69. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  70. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-dropdown.mjs +362 -26
  72. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  73. package/fesm2022/ngwr-editor.mjs +5 -2
  74. package/fesm2022/ngwr-editor.mjs.map +1 -1
  75. package/fesm2022/ngwr-event-calendar.mjs +4 -2
  76. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  77. package/fesm2022/ngwr-file-upload.mjs +9 -3
  78. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  79. package/fesm2022/ngwr-form.mjs +18 -6
  80. package/fesm2022/ngwr-form.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  86. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  88. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  90. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  92. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  94. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  96. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  98. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  100. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  102. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  104. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  106. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  108. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  110. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  112. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  114. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  116. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  118. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  120. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  122. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  124. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n.mjs +34 -8
  126. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  127. package/fesm2022/ngwr-input-number.mjs +9 -3
  128. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  129. package/fesm2022/ngwr-input-otp.mjs +4 -2
  130. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  131. package/fesm2022/ngwr-input.mjs +20 -10
  132. package/fesm2022/ngwr-input.mjs.map +1 -1
  133. package/fesm2022/ngwr-keyboard.mjs +9 -3
  134. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  135. package/fesm2022/ngwr-knob.mjs +9 -3
  136. package/fesm2022/ngwr-knob.mjs.map +1 -1
  137. package/fesm2022/ngwr-layout.mjs +13 -5
  138. package/fesm2022/ngwr-layout.mjs.map +1 -1
  139. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  140. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-lightbox.mjs +255 -15
  142. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  143. package/fesm2022/ngwr-list.mjs +13 -5
  144. package/fesm2022/ngwr-list.mjs.map +1 -1
  145. package/fesm2022/ngwr-load-state.mjs +9 -5
  146. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  147. package/fesm2022/ngwr-overlay.mjs +84 -1
  148. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  149. package/fesm2022/ngwr-pagination.mjs +3 -2
  150. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  151. package/fesm2022/ngwr-pipes.mjs +47 -9
  152. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  153. package/fesm2022/ngwr-popover.mjs +93 -4
  154. package/fesm2022/ngwr-popover.mjs.map +1 -1
  155. package/fesm2022/ngwr-progress.mjs +4 -2
  156. package/fesm2022/ngwr-progress.mjs.map +1 -1
  157. package/fesm2022/ngwr-radio.mjs +9 -5
  158. package/fesm2022/ngwr-radio.mjs.map +1 -1
  159. package/fesm2022/ngwr-rating.mjs +9 -3
  160. package/fesm2022/ngwr-rating.mjs.map +1 -1
  161. package/fesm2022/ngwr-resizable.mjs +503 -0
  162. package/fesm2022/ngwr-resizable.mjs.map +1 -0
  163. package/fesm2022/ngwr-result.mjs +9 -5
  164. package/fesm2022/ngwr-result.mjs.map +1 -1
  165. package/fesm2022/ngwr-schema-form.mjs +3 -0
  166. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  167. package/fesm2022/ngwr-segmented.mjs +4 -2
  168. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  169. package/fesm2022/ngwr-select.mjs +13 -5
  170. package/fesm2022/ngwr-select.mjs.map +1 -1
  171. package/fesm2022/ngwr-skeleton.mjs +4 -2
  172. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  173. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  174. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  175. package/fesm2022/ngwr-slider.mjs +91 -13
  176. package/fesm2022/ngwr-slider.mjs.map +1 -1
  177. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  178. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  180. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  181. package/fesm2022/ngwr-speed-dial.mjs +4 -2
  182. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  183. package/fesm2022/ngwr-spinner.mjs +4 -2
  184. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  185. package/fesm2022/ngwr-splitter.mjs +17 -21
  186. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  187. package/fesm2022/ngwr-stepper.mjs +9 -3
  188. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  189. package/fesm2022/ngwr-switch.mjs +9 -5
  190. package/fesm2022/ngwr-switch.mjs.map +1 -1
  191. package/fesm2022/ngwr-table-testing.mjs +5 -1
  192. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  193. package/fesm2022/ngwr-table.mjs +167 -10
  194. package/fesm2022/ngwr-table.mjs.map +1 -1
  195. package/fesm2022/ngwr-textarea.mjs +9 -3
  196. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  197. package/fesm2022/ngwr-timeline.mjs +18 -8
  198. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  199. package/fesm2022/ngwr-toast-testing.mjs +6 -1
  200. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  201. package/fesm2022/ngwr-toast.mjs +529 -104
  202. package/fesm2022/ngwr-toast.mjs.map +1 -1
  203. package/fesm2022/ngwr-transfer.mjs +4 -2
  204. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  205. package/fesm2022/ngwr-tree.mjs +4 -2
  206. package/fesm2022/ngwr-tree.mjs.map +1 -1
  207. package/fesm2022/ngwr-typography.mjs +9 -3
  208. package/fesm2022/ngwr-typography.mjs.map +1 -1
  209. package/fesm2022/ngwr-utils-router.mjs +18 -2
  210. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  211. package/fesm2022/ngwr-utils.mjs +9 -2
  212. package/fesm2022/ngwr-utils.mjs.map +1 -1
  213. package/fesm2022/ngwr-version.mjs +1 -1
  214. package/fesm2022/ngwr-version.mjs.map +1 -1
  215. package/fesm2022/ngwr-window.mjs +7 -4
  216. package/fesm2022/ngwr-window.mjs.map +1 -1
  217. package/fesm2022/ngwr.mjs.map +1 -1
  218. package/i18n/ar.json +13 -2
  219. package/i18n/cs.json +13 -2
  220. package/i18n/de.json +13 -2
  221. package/i18n/en.json +13 -2
  222. package/i18n/es.json +13 -2
  223. package/i18n/fr.json +13 -2
  224. package/i18n/he.json +13 -2
  225. package/i18n/hi.json +13 -2
  226. package/i18n/id.json +13 -2
  227. package/i18n/it.json +13 -2
  228. package/i18n/ja.json +13 -2
  229. package/i18n/ko.json +13 -2
  230. package/i18n/nl.json +13 -2
  231. package/i18n/pl.json +13 -2
  232. package/i18n/pt.json +13 -2
  233. package/i18n/ru.json +13 -2
  234. package/i18n/sv.json +13 -2
  235. package/i18n/tr.json +13 -2
  236. package/i18n/uk.json +13 -2
  237. package/i18n/vi.json +13 -2
  238. package/i18n/zh-TW.json +13 -2
  239. package/i18n/zh.json +13 -2
  240. package/input/styles/_index.scss +10 -5
  241. package/input-number/styles/_index.scss +6 -3
  242. package/input-otp/styles/_index.scss +4 -2
  243. package/lightbox/styles/_rules.scss +96 -0
  244. package/llms-full.txt +40 -17
  245. package/llms.txt +20 -4
  246. package/package.json +19 -1
  247. package/radio/styles/_index.scss +4 -2
  248. package/resizable/styles/_index.scss +154 -0
  249. package/schematics/use/rule.js +1 -0
  250. package/schematics/use/symbol-map.json +5 -0
  251. package/select/styles/_index.scss +6 -3
  252. package/skills/ngwr/SKILL.md +1 -1
  253. package/skills/ngwr/references/catalog.md +6 -2
  254. package/skills/ngwr/references/setup.md +3 -0
  255. package/slider/styles/_index.scss +106 -0
  256. package/sortable-list/styles/_rules.scss +23 -1
  257. package/switch/styles/_index.scss +4 -2
  258. package/table/styles/_index.scss +53 -0
  259. package/textarea/styles/_index.scss +4 -2
  260. package/theme/styles/_motion.scss +6 -0
  261. package/toast/styles/_index.scss +19 -0
  262. package/types/ngwr-burger.d.ts +0 -1
  263. package/types/ngwr-calendar.d.ts +7 -0
  264. package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
  265. package/types/ngwr-clipboard.d.ts +7 -0
  266. package/types/ngwr-date-picker-testing.d.ts +17 -0
  267. package/types/ngwr-date-picker.d.ts +88 -4
  268. package/types/ngwr-date-stamp-testing.d.ts +47 -0
  269. package/types/ngwr-date-stamp.d.ts +127 -0
  270. package/types/ngwr-date.d.ts +251 -37
  271. package/types/ngwr-dialog-testing.d.ts +10 -0
  272. package/types/ngwr-dialog.d.ts +72 -4
  273. package/types/ngwr-directives.d.ts +36 -1
  274. package/types/ngwr-drawer.d.ts +21 -0
  275. package/types/ngwr-dropdown-testing.d.ts +53 -5
  276. package/types/ngwr-dropdown.d.ts +100 -0
  277. package/types/ngwr-i18n.d.ts +44 -14
  278. package/types/ngwr-lightbox-testing.d.ts +27 -0
  279. package/types/ngwr-lightbox.d.ts +71 -6
  280. package/types/ngwr-overlay.d.ts +36 -0
  281. package/types/ngwr-pipes.d.ts +48 -13
  282. package/types/ngwr-popover.d.ts +39 -1
  283. package/types/ngwr-resizable.d.ts +228 -0
  284. package/types/ngwr-slider-testing.d.ts +8 -1
  285. package/types/ngwr-slider.d.ts +89 -3
  286. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  287. package/types/ngwr-sortable-list.d.ts +113 -10
  288. package/types/ngwr-table-testing.d.ts +3 -1
  289. package/types/ngwr-table.d.ts +120 -4
  290. package/types/ngwr-toast-testing.d.ts +12 -1
  291. package/types/ngwr-toast.d.ts +215 -18
  292. package/types/ngwr-utils-router.d.ts +22 -0
  293. package/types/ngwr-utils.d.ts +8 -1
  294. package/types/ngwr-version.d.ts +1 -1
  295. package/types/ngwr.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-toast.mjs","names":[],"sources":["../../../projects/lib/toast/toast-item.ts","../../../projects/lib/toast/toast-item.html","../../../projects/lib/toast/toast-host.ts","../../../projects/lib/toast/toast-host.html","../../../projects/lib/toast/toast-ref.ts","../../../projects/lib/toast/default-toast-config.ts","../../../projects/lib/toast/tokens/toast-config.token.ts","../../../projects/lib/toast/services/toast.ts","../../../projects/lib/toast/with-toast.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 { Component, ElementRef, ViewEncapsulation, computed, inject, input, output, signal } from '@angular/core';\n\nimport { wrToClassList, wrCheckStyles, type WrClassInput } from 'ngwr/utils';\n\nimport type { WrToastConfig, WrToastType } from './types';\n\n/**\n * One toast row inside the toast host. Not used directly — see\n * `WrToast.show()`.\n *\n * @internal\n */\n@Component({\n selector: 'wr-toast',\n templateUrl: './toast-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n // See `WrAlert`: a static `title=` feeds the input AND lands on the host.\n '[attr.title]': 'null',\n '[class]': 'classes()',\n '[style.--wr-toast-duration]': 'durationMs()',\n '[style.transform]': 'swipeTransform()',\n '[style.opacity]': 'swipeOpacity()',\n '[style.transition]': 'swiping() ? \"none\" : null',\n '[attr.role]': 'liveRole()',\n '[attr.aria-live]': 'liveLevel()',\n '(mouseenter)': 'onPointer(true)',\n '(mouseleave)': 'onPointer(false)',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onFocusOut($event)',\n '(touchstart)': 'onSwipeStart($event)',\n '(touchmove)': 'onSwipeMove($event)',\n '(touchend)': 'onSwipeEnd()',\n '(touchcancel)': 'onSwipeEnd()',\n },\n})\nexport class WrToastItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('toast');\n }\n\n readonly type = input<WrToastType>('info');\n readonly title = input<string | null>(null);\n readonly message = input.required<string>();\n readonly closable = input<boolean>(true);\n readonly showProgress = input<boolean>(false);\n readonly showCopy = input<boolean>(false);\n /** Text of the action button, from `WrToastOptions.action`. `null` renders none. */\n readonly actionLabel = input<string | null>(null);\n /** Extra classes from `WrToastOptions.class`, merged into the host's own. */\n readonly extraClass = input<WrClassInput>(null);\n /** Auto-dismiss duration in ms — used to scale the progress bar. `0` hides it. */\n readonly duration = input<number>(0);\n /**\n * Already resolved by the host — strings, not the config's nullable shape.\n * The item renders them and never reaches for the catalog itself.\n */\n readonly labels = input.required<{ [K in keyof WrToastConfig['labels']]: string }>();\n\n readonly dismissed = output<void>();\n readonly actionRequested = output<void>();\n readonly pauseRequested = output<void>();\n readonly resumeRequested = output<void>();\n\n /**\n * The countdown holds while the pointer rests on the toast OR focus is inside\n * it. Hover alone left a keyboard user's toast running: focus its Close button\n * and it was removed from under the focus four seconds later, which dropped\n * focus on `<body>` — WCAG 2.2.1 asks for a way to hold a time limit, and the\n * pointer was the only one. Two flags, so leaving by one road while still in\n * by the other does not resume it.\n */\n private hovered = false;\n private focused = false;\n\n /** @internal */\n protected onPointer(over: boolean): void {\n this.syncPause(() => (this.hovered = over));\n }\n\n /** @internal */\n protected onFocusIn(): void {\n this.syncPause(() => (this.focused = true));\n }\n\n /** @internal Focus moving between two buttons of this toast is not leaving it. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.elRef.nativeElement.contains(next)) return;\n this.syncPause(() => (this.focused = false));\n }\n\n private syncPause(change: () => void): void {\n const wasHeld = this.hovered || this.focused;\n change();\n const held = this.hovered || this.focused;\n if (held === wasHeld) return;\n if (held) this.pauseRequested.emit();\n else this.resumeRequested.emit();\n }\n\n /** True for ~1.5s after a successful copy; flips the icon to a check. */\n protected readonly justCopied = signal(false);\n private copyResetTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * `--untitled` when the toast opens on its message. The glyph and the\n * actions are centred on the FIRST line, and with no title that line is the\n * message's, whose line height is its own hook — so the stylesheet needs to\n * know which one it is reading.\n */\n protected readonly classes = computed(() =>\n wrToClassList(\n 'wr-toast',\n `wr-toast--${this.type()}`,\n this.title() ? null : 'wr-toast--untitled',\n this.extraClass()\n ).join(' ')\n );\n\n /** Escalate to `alert`/`assertive` for danger/warning toasts. */\n protected readonly liveRole = computed(() => (this.type() === 'danger' ? 'alert' : 'status'));\n protected readonly liveLevel = computed(() =>\n this.type() === 'danger' || this.type() === 'warning' ? 'assertive' : 'polite'\n );\n\n /** Inline CSS value for `--wr-toast-duration`. */\n protected readonly durationMs = computed(() => `${this.duration()}ms`);\n\n protected readonly progressVisible = computed(() => this.showProgress() && this.duration() > 0);\n\n /**\n * What the copy button puts on the clipboard: the message, or the title when\n * the toast has nothing else. A title-only toast copied an empty string, and\n * still flipped the glyph to the \"Copied\" check.\n */\n private readonly copyText = computed(() => (this.message() !== '' ? this.message() : (this.title() ?? '')));\n\n protected async onCopy(): Promise<void> {\n try {\n await navigator.clipboard.writeText(this.copyText());\n this.justCopied.set(true);\n if (this.copyResetTimer) clearTimeout(this.copyResetTimer);\n this.copyResetTimer = setTimeout(() => this.justCopied.set(false), 1500);\n } catch {\n // Clipboard unavailable (insecure context / permission denied) — silent.\n }\n }\n\n // Swipe-sideways-to-dismiss. The toast follows the finger and fades; releasing\n // past 40% of its width emits `dismissed`, otherwise it snaps back.\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private swipeStartX = 0;\n private swipeWidth = 0;\n protected readonly swipeX = signal(0);\n protected readonly swiping = signal(false);\n\n protected readonly swipeTransform = computed(() => (this.swipeX() === 0 ? null : `translateX(${this.swipeX()}px)`));\n protected readonly swipeOpacity = computed(() => {\n const dist = Math.abs(this.swipeX());\n return dist === 0 ? null : Math.max(0, 1 - dist / (this.swipeWidth || 1));\n });\n\n protected onSwipeStart(event: TouchEvent): void {\n if (!this.closable()) return;\n const touch = event.touches[0];\n if (!touch) return;\n this.swipeStartX = touch.clientX;\n this.swipeWidth = this.elRef.nativeElement.offsetWidth;\n this.swiping.set(true);\n }\n\n protected onSwipeMove(event: TouchEvent): void {\n if (!this.swiping()) return;\n const touch = event.touches[0];\n if (!touch) return;\n this.swipeX.set(touch.clientX - this.swipeStartX);\n }\n\n protected onSwipeEnd(): void {\n if (!this.swiping()) return;\n this.swiping.set(false);\n if (Math.abs(this.swipeX()) > (this.swipeWidth || 0) * 0.4) {\n this.dismissed.emit();\n } else {\n this.swipeX.set(0);\n }\n }\n}\n","<!-- A glyph per type, and this is the one channel the toast had none of. Its\n four types differed by `--wr-toast-accent` alone — a 3px inline-start\n border, in four colours that sit within 1.06:1 of each other in relative\n luminance, so `success` and `danger` were the same 3px line to a reader\n who cannot separate hue. The shapes are the ones `wr-alert` and\n `wr-result` already use for the same four meanings: a check in a broken\n circle, a triangle, an octagon, an `i`. Three components agreeing is worth\n more than three components each being locally reasonable.\n\n `aria-hidden`, because the type is already announced: the host takes\n `role=\"alert\"` for danger and `role=\"status\"` otherwise. -->\n<svg\n class=\"wr-toast__icon 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 @switch (type()) {\n @case ('success') {\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n }\n @case ('warning') {\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n }\n @case ('danger') {\n <path\n d=\"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z\"\n />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n }\n @default {\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n }\n }\n</svg>\n\n<!-- Each part renders only when it has text. A title-only toast is shown with\n `message: ''`, and the empty `<p>` it used to leave behind kept the title's\n bottom margin under it: 4px of dead space that made the card taller below\n its one line than above it. -->\n<div class=\"wr-toast__body\">\n @if (title(); as text) {\n <p class=\"wr-toast__title\">{{ text }}</p>\n }\n @if (message(); as text) {\n <p class=\"wr-toast__message\">{{ text }}</p>\n }\n</div>\n\n<div class=\"wr-toast__actions\">\n @if (actionLabel(); as label) {\n <button type=\"button\" class=\"wr-toast__action wr-toast__action--run\" (click)=\"actionRequested.emit()\">\n {{ label }}\n </button>\n }\n\n @if (showCopy()) {\n <button\n type=\"button\"\n class=\"wr-toast__action wr-toast__action--copy\"\n [attr.aria-label]=\"justCopied() ? labels().copied : labels().copy\"\n [title]=\"justCopied() ? labels().copied : labels().copy\"\n (click)=\"onCopy()\"\n >\n @if (justCopied()) {\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=\"M20 6 9 17l-5-5\" />\n </svg>\n } @else {\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 <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n }\n </button>\n }\n\n @if (closable()) {\n <button\n type=\"button\"\n class=\"wr-toast__action wr-toast__action--close\"\n [attr.aria-label]=\"labels().close\"\n [title]=\"labels().close\"\n (click)=\"dismissed.emit()\"\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 </button>\n }\n</div>\n\n@if (progressVisible()) {\n <span class=\"wr-toast__progress\" aria-hidden=\"true\"></span>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n viewChildren,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrToastItem } from './toast-item';\nimport type { WrToastConfig, WrToastMode, WrToastOptions, WrToastPosition } from './types';\n\n/** ms before the pointer or focus leaving actually collapses the stack. Buffers\n * the cursor briefly leaving the host as toasts reflow underneath it, and focus\n * hopping between two buttons inside the host. */\nconst COLLAPSE_DELAY_MS = 120;\n\n/** Send focus back to `origin` when it is still in the page. */\nfunction returnFocus(origin: HTMLElement | null, monitor: FocusMonitor): void {\n if (origin?.isConnected) wrRestoreFocus(origin, monitor);\n}\n\n/**\n * Whether `el`, the focused element, holds focus the keyboard way — the focus a\n * removal would strand.\n *\n * A pointer press on Close focuses the button too, in Chromium, and handing\n * THAT focus on is a regression rather than a fix: focus inside the region\n * holds every countdown, so after one click the rest of the stack stayed up\n * until the reader clicked somewhere else — measured, two toasts still on\n * screen six seconds after the pointer left. Left alone, the removed button's\n * `focusout` releases the hold, as it always did.\n */\nfunction hasKeyboardFocus(el: Element | null | undefined): boolean {\n if (!el) return false;\n try {\n return el.matches(':focus-visible');\n } catch {\n // An engine without the pseudo-class: err on the side of not losing focus.\n return true;\n }\n}\n\n/** Active entry pushed by the service — adds the bookkeeping fields the host renders. */\ntype ActiveToast = WrToastOptions & {\n readonly id: number;\n readonly resolvedDuration: number;\n};\n\n/**\n * Internal host that lives inside the toast overlay and renders the\n * active stack. Owned by `WrToast`.\n *\n * @internal\n */\n@Component({\n selector: 'wr-toast-host',\n templateUrl: './toast-host.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n '[style.--wr-toast-front-height]': 'frontHeight()',\n role: 'region',\n '[attr.aria-label]': 'regionLabel()',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusOut($event)',\n },\n imports: [WrToastItem],\n})\nexport class WrToastHost {\n readonly position = input<WrToastPosition>('top-end');\n readonly config = input.required<WrToastConfig>();\n /** Layout mode. @default 'stack' (Sonner-style; hover to fan out) */\n readonly mode = input<WrToastMode>('stack');\n\n /**\n * Every string this host and its items render, resolved through the catalog.\n *\n * The config value WINS when the consumer sets one, and its default is now\n * `null` — until v11 those defaults were English literals, so the four\n * `toast.*` keys in the shipped catalogs were dead and a Russian app got an\n * English close button. `region` had no key at all: the live region's name\n * was the literal `'Notifications'` in a host binding.\n */\n protected readonly regionLabel = useI18nText(signal(null), 'toast.region', 'Notifications');\n\n private readonly closeLabel = useI18nText(\n computed(() => this.config().labels.close),\n 'toast.close',\n 'Close'\n );\n private readonly copyLabel = useI18nText(\n computed(() => this.config().labels.copy),\n 'toast.copy',\n 'Copy'\n );\n private readonly copiedLabel = useI18nText(\n computed(() => this.config().labels.copied),\n 'toast.copied',\n 'Copied'\n );\n protected readonly closeAllLabel = useI18nText(\n computed(() => this.config().labels.closeAll),\n 'toast.closeAll',\n 'Close all'\n );\n\n /** What `wr-toast-item` receives — resolved, so the item stays presentational. */\n protected readonly labels = computed(() => ({\n close: this.closeLabel(),\n copy: this.copyLabel(),\n copied: this.copiedLabel(),\n closeAll: this.closeAllLabel(),\n }));\n\n /** @internal — hovering or focusing the stack toggles this in stack mode. */\n protected readonly expanded = signal(false);\n\n /** Pointer is over the host. */\n private readonly hovered = signal(false);\n /** Focus is somewhere inside the host — keyboard equivalent of hovering, and\n * the only way a keyboard user can reach the \"Close all\" button. */\n private readonly focusWithin = signal(false);\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly destroyRef = inject(DestroyRef);\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private collapseTimer: ReturnType<typeof setTimeout> | null = null;\n /** The last value `holdChange` emitted. */\n private held = false;\n\n /** The rendered toasts, in `toasts()` order. */\n private readonly items = viewChildren(WrToastItem, { read: ElementRef });\n\n /**\n * Where focus was before it entered the region, which is where it goes back\n * to when the last toast is closed from inside. Recorded off the `focusin`\n * that crosses INTO the host; a hop between two toasts is not an entry.\n */\n private focusOrigin: HTMLElement | null = null;\n /** True while this host moves focus itself, so the move is not read as an entry. */\n private movingFocus = false;\n\n /**\n * The front toast's height, which the cards behind it take while the stack\n * is collapsed. Each card used to keep its own, so a short front toast — a\n * title alone, a one-line message — left a taller card hanging below it, and\n * that card's last line read through underneath. `null` until measured, and\n * on the server, where the stylesheet falls back to each card's own height.\n */\n protected readonly frontHeight = signal<string | null>(null);\n\n private readonly frontObserver =\n typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver(entries => {\n // `offsetHeight`, the layout box, which no transform reaches: the\n // collapsed stack scales and offsets its cards with them.\n const front = entries[entries.length - 1]?.target as HTMLElement | undefined;\n this.frontHeight.set(front ? `${front.offsetHeight}px` : null);\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('toast');\n this.destroyRef.onDestroy(() => {\n this.clearCollapseTimer();\n this.frontObserver?.disconnect();\n });\n\n // The front card is the LAST one rendered, whichever way the stack grows.\n // Follow it as toasts come and go; the observer reports its height on the\n // first observation and again whenever its text rewraps.\n effect(() => {\n const items = this.items();\n const front = items[items.length - 1]?.nativeElement as HTMLElement | undefined;\n if (!this.frontObserver) return;\n this.frontObserver.disconnect();\n if (front) this.frontObserver.observe(front);\n else this.frontHeight.set(null);\n });\n }\n\n /** @internal */\n protected onMouseEnter(): void {\n this.hovered.set(true);\n this.syncExpanded();\n }\n\n /** @internal */\n protected onMouseLeave(): void {\n this.hovered.set(false);\n this.syncExpanded();\n }\n\n /** @internal */\n protected onFocusIn(event: FocusEvent): void {\n if (!this.focusWithin() && !this.movingFocus) {\n const from = event.relatedTarget;\n this.focusOrigin = from instanceof HTMLElement && !this.elRef.nativeElement.contains(from) ? from : null;\n }\n this.focusWithin.set(true);\n this.syncExpanded();\n }\n\n /**\n * A toast asked to go — its Close button, or a swipe.\n *\n * When keyboard focus was inside it, the removal would drop focus on\n * `<body>`, so it is handed on: to the Close button of the toast that takes\n * its place (the next one in the stack, a promoted one included), else to the\n * previous one. When no toast is left, focus goes back to where it was before\n * it entered the region. A toast closed while focus was elsewhere, or with a\n * pointer, moves nothing — see `hasKeyboardFocus`.\n *\n * @internal\n */\n protected onItemDismissed(id: number, index: number): void {\n this.removeItem(index, () => this.dismissed.emit(id));\n }\n\n /** The action button closes its toast too, so focus moves the same way. @internal */\n protected onItemAction(id: number, index: number): void {\n this.removeItem(index, () => this.actionRequested.emit(id));\n }\n\n private removeItem(index: number, remove: () => void): void {\n const item = this.items()[index]?.nativeElement as HTMLElement | undefined;\n const active = item?.ownerDocument.activeElement;\n const hadFocus = !!item?.contains(active ?? null) && hasKeyboardFocus(active);\n const origin = this.focusOrigin;\n // Synchronous: the service removes the toast here, and disposes this host\n // when it was the last one.\n remove();\n if (!hadFocus) return;\n if (this.toasts().length === 0) {\n returnFocus(origin, this.focusMonitor);\n return;\n }\n afterNextRender(() => this.focusNeighbour(index), { injector: this.injector });\n }\n\n /** \"Close all\" from the keyboard: nothing is left, so focus goes back. @internal */\n protected onCloseAll(): void {\n const host = this.elRef.nativeElement;\n const active = host.ownerDocument.activeElement;\n const hadFocus = host.contains(active) && hasKeyboardFocus(active);\n const origin = this.focusOrigin;\n this.dismissAllRequested.emit();\n if (hadFocus) returnFocus(origin, this.focusMonitor);\n }\n\n /**\n * Focus the Close button nearest to where the removed toast stood: the one\n * now at its index, then forward, then back. A toast with no Close button\n * (`closable: false`) is passed over; with none anywhere, \"Close all\" if\n * it is showing, else the origin.\n */\n private focusNeighbour(index: number): void {\n const items = this.items().map(ref => ref.nativeElement as HTMLElement);\n const order = [...items.slice(index), ...items.slice(0, index).reverse()];\n const close = order\n .map(el => el.querySelector<HTMLElement>('.wr-toast__action--close'))\n .find((el): el is HTMLElement => !!el);\n const target = close ?? this.elRef.nativeElement.querySelector<HTMLElement>('.wr-toast-host__close-all');\n if (!target) {\n returnFocus(this.focusOrigin, this.focusMonitor);\n return;\n }\n this.movingFocus = true;\n try {\n target.focus();\n } finally {\n this.movingFocus = false;\n }\n }\n\n /** @internal Focus moving between two buttons inside the host is not leaving it. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.elRef.nativeElement.contains(next)) return;\n this.focusWithin.set(false);\n this.syncExpanded();\n }\n\n /** Expand immediately while the pointer or focus is inside, and delay the\n * collapse so a cursor briefly slipping off the host during a layout reflow\n * — or focus moving between two buttons inside it — doesn't cause a flicker. */\n private syncExpanded(): void {\n this.syncHold();\n if (this.hovered() || this.focusWithin()) {\n this.clearCollapseTimer();\n this.expanded.set(true);\n return;\n }\n if (this.collapseTimer !== null) return;\n this.collapseTimer = setTimeout(() => {\n this.collapseTimer = null;\n if (!this.hovered() && !this.focusWithin()) this.expanded.set(false);\n }, COLLAPSE_DELAY_MS);\n }\n\n /**\n * Hold EVERY countdown while the reader is in the region, not only the toast\n * under the pointer. Per-toast pausing let the others expire around the one\n * being read: in an expanded stack the pointer rested on #2 while #1 and #3\n * ran out, the stack collapsed, and #2 jumped 140px up from under a pointer\n * that never moved — and a gutter between toasts, which keeps the stack\n * expanded, paused nothing at all. Released at once on leaving, with no\n * collapse delay, so the timers and the progress bars (paused by the same\n * `:hover` / `:focus-within` in the stylesheet) agree.\n */\n private syncHold(): void {\n const held = this.hovered() || this.focusWithin();\n if (held === this.held) return;\n this.held = held;\n this.holdChange.emit(held);\n }\n\n private clearCollapseTimer(): void {\n if (this.collapseTimer !== null) {\n clearTimeout(this.collapseTimer);\n this.collapseTimer = null;\n }\n }\n\n /** @internal — pushed by the service: the rendered (capped) stack. */\n readonly toasts = signal<readonly ActiveToast[]>([]);\n\n /** @internal — pushed by the service: count still queued behind the cap. */\n readonly queued = signal(0);\n\n /** Total outstanding toasts (visible + queued) — what \"Close all\" clears. */\n protected readonly totalCount = computed(() => this.toasts().length + this.queued());\n\n /** @internal — service listens to update its internal state. */\n readonly dismissed = output<number>();\n readonly actionRequested = output<number>();\n readonly pauseRequested = output<number>();\n readonly resumeRequested = output<number>();\n /** @internal — `true` while the pointer or focus is inside the region. */\n readonly holdChange = output<boolean>();\n readonly dismissAllRequested = output<void>();\n\n protected readonly classes = computed(() => {\n const parts = ['wr-toast-host', `wr-toast-host--${this.position()}`, `wr-toast-host--${this.mode()}`];\n if (this.mode() === 'stack' && this.expanded()) parts.push('wr-toast-host--expanded');\n return parts.join(' ');\n });\n\n /** Distance from the front of the stack (0 = newest / fully visible). */\n protected stackIndex(i: number): number {\n return this.toasts().length - 1 - i;\n }\n\n protected readonly closeAllVisible = computed(() => {\n const cfg = this.config();\n // In stack mode the toasts cascade absolutely while collapsed, which\n // makes the close-all button jump between layout positions on hover\n // (button moves → cursor leaves → host collapses → cycle = blink).\n // Only show it once the stack is expanded — by hover OR by focus entering\n // it, so it stays reachable from the keyboard — or always in list mode.\n if (this.mode() === 'stack' && !this.expanded()) return false;\n return cfg.showCloseAll && this.toasts().length >= cfg.closeAllThreshold;\n });\n\n protected showProgressFor(t: WrToastOptions): boolean {\n return t.showProgress ?? this.config().showProgress;\n }\n\n protected showCopyFor(t: WrToastOptions): boolean {\n return t.showCopy ?? this.config().showCopy;\n }\n}\n","@if (closeAllVisible()) {\n <button type=\"button\" class=\"wr-toast-host__close-all\" (click)=\"onCloseAll()\">\n {{ closeAllLabel() }} ({{ totalCount() }})\n </button>\n}\n\n@for (toast of toasts(); track toast.id) {\n <wr-toast\n [style.--wr-toast-stack-index]=\"stackIndex($index)\"\n [type]=\"toast.type ?? 'info'\"\n [title]=\"toast.title ?? null\"\n [message]=\"toast.message\"\n [closable]=\"toast.closable ?? true\"\n [showProgress]=\"showProgressFor(toast)\"\n [showCopy]=\"showCopyFor(toast)\"\n [extraClass]=\"toast.class ?? null\"\n [duration]=\"toast.resolvedDuration\"\n [labels]=\"labels()\"\n [actionLabel]=\"toast.action?.label ?? null\"\n (dismissed)=\"onItemDismissed(toast.id, $index)\"\n (actionRequested)=\"onItemAction(toast.id, $index)\"\n (pauseRequested)=\"pauseRequested.emit(toast.id)\"\n (resumeRequested)=\"resumeRequested.emit(toast.id)\"\n />\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrToastOptions } from './types';\n\n/**\n * Handle returned by `WrToast.show()`. Call `dismiss()` to remove\n * the toast early. Inspect `options` to see what the caller requested.\n */\nexport class WrToastRef {\n constructor(\n public readonly id: number,\n public readonly options: WrToastOptions,\n private readonly onDismiss: (id: number) => void\n ) {}\n\n /** Remove this toast from the stack. */\n dismiss(): void {\n this.onDismiss(this.id);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrToastConfig } from './types';\n\n/**\n * Library defaults applied when no {@link withToast} feature is registered.\n * Merged shallowly with the consumer's overrides (the `labels` sub-object is\n * merged separately so callers can override one string at a time).\n */\nexport const DEFAULT_WR_TOAST_CONFIG: WrToastConfig = {\n position: 'top-end',\n mode: 'stack',\n duration: 4000,\n showProgress: true,\n showCopy: false,\n showCloseAll: true,\n closeAllThreshold: 2,\n maxStack: 5,\n // Null, not English: the host resolves each one through the i18n catalog and\n // falls back to English only if nothing is registered. See `WrToastConfig`.\n labels: {\n close: null,\n copy: null,\n copied: null,\n closeAll: null,\n },\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { DEFAULT_WR_TOAST_CONFIG } from '../default-toast-config';\nimport type { WrToastConfig } from '../types';\n\n/**\n * Holds the global {@link WrToastConfig} used by {@link WrToast}.\n * The default factory returns {@link DEFAULT_WR_TOAST_CONFIG} so the service\n * works out of the box; override via `provideWr(withToast(...))`.\n */\nexport const WR_TOAST_CONFIG = new InjectionToken<WrToastConfig>('WR_TOAST_CONFIG', {\n providedIn: 'root',\n factory: () => DEFAULT_WR_TOAST_CONFIG,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { type ComponentRef, Injector, Service, inject } from '@angular/core';\n\nimport { WR_OVERLAY, wrFollowDirection } from 'ngwr/overlay';\n\nimport { WrToastHost } from '../toast-host';\nimport { WrToastRef } from '../toast-ref';\nimport { WR_TOAST_CONFIG } from '../tokens';\nimport type { WrToastOptions, WrToastPosition } from '../types';\n\ntype ActiveEntry = WrToastOptions & {\n readonly id: number;\n /** Resolved auto-dismiss duration in ms after merging with global config. */\n readonly resolvedDuration: number;\n /** Resolved corner for this stack. */\n readonly resolvedPosition: WrToastPosition;\n /** Pending timeout handle. */\n timer?: ReturnType<typeof setTimeout>;\n /** Timestamp of the last timer (re)start, used to compute remaining on pause. */\n startedAt?: number;\n /** Milliseconds left when paused. */\n remaining: number;\n};\n\n/**\n * Opens toast notifications in a single shared overlay.\n *\n * Global defaults come from {@link WR_TOAST_CONFIG}; register\n * `provideWr(withToast(...))` once at bootstrap to customise. Each\n * `show()` call accepts per-toast overrides via {@link WrToastOptions}.\n *\n * @example\n * ```ts\n * const toast = inject(WrToast);\n *\n * toast.show({ type: 'success', title: 'Saved', message: 'Profile updated.' });\n * toast.show({ type: 'danger', message: 'Network error', duration: 0 });\n * toast.show({ message: 'Permalink copied', position: 'bottom', showCopy: true });\n * toast.show({ message: 'Item deleted', action: { label: 'Undo', run: () => restore() } });\n * ```\n *\n * @see https://ngwr.dev/reference/components/toast\n */\n@Service()\nexport class WrToast {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly config = inject(WR_TOAST_CONFIG);\n private readonly injector = inject(Injector);\n private readonly dir = inject(Directionality, { optional: true });\n\n private overlayRef: OverlayRef | null = null;\n private hostRef: ComponentRef<WrToastHost> | null = null;\n /** Watches the overlay container for overlays opened after the host. */\n private containerObserver: MutationObserver | null = null;\n private currentPosition: WrToastPosition = this.config.position;\n private currentMode: 'stack' | 'list' = this.config.mode;\n private nextId = 1;\n /** Currently rendered toasts (capped at `config.maxStack`). */\n private active: ActiveEntry[] = [];\n /** Overflow waiting for a free slot — promoted FIFO as actives dismiss, so\n * nothing is ever silently dropped. */\n private queue: ActiveEntry[] = [];\n /** The pointer or focus is inside the host: no countdown runs, a toast that\n * arrives meanwhile included. See `WrToastHost.syncHold`. */\n private held = false;\n\n /** Open a toast. Returns a handle you can `dismiss()` early. */\n show(options: WrToastOptions): WrToastRef {\n // `currentPosition` before the injected default, so `setPosition()` holds\n // across a host that has been disposed. `dismiss()` and `dismissAll()`\n // tear the host down, so \"no host alive\" is the state before the first\n // toast of a run and after the last one goes — exactly where the stack\n // used to snap back to the configured corner with nothing to say so.\n // `setMode` already persisted this way, and its JSDoc says it does.\n // `currentPosition` is seeded from the config, so the default still wins\n // when nobody has called `setPosition`.\n const resolvedPosition = options.position ?? this.currentPosition;\n const resolvedDuration = options.duration ?? this.config.duration;\n\n this.ensureHost(resolvedPosition);\n // A toast raised now belongs above everything already on screen, and the host\n // it goes into may be much older than the dialog it has to clear. See\n // `raiseHost`.\n this.raiseHost();\n\n const entry: ActiveEntry = {\n ...options,\n id: this.nextId++,\n resolvedDuration,\n resolvedPosition,\n remaining: resolvedDuration,\n };\n\n const max = this.config.maxStack;\n if (max > 0 && this.active.length >= max) {\n // Stack is full — hold this one in the queue (no timer until it's shown).\n this.queue = [...this.queue, entry];\n this.pushToHost();\n } else {\n this.active = [...this.active, entry];\n this.pushToHost();\n this.startTimer(entry);\n }\n\n return new WrToastRef(entry.id, options, id => this.dismiss(id));\n }\n\n /** Dismiss a single toast by id. */\n dismiss(id: number): void {\n const entry = this.active.find(t => t.id === id);\n if (entry?.timer) clearTimeout(entry.timer);\n this.active = this.active.filter(t => t.id !== id);\n // A dismiss can also target a still-queued toast.\n this.queue = this.queue.filter(t => t.id !== id);\n this.promoteFromQueue();\n this.pushToHost();\n if (this.active.length === 0 && this.queue.length === 0) this.disposeHost();\n }\n\n /**\n * Closes first: a second press finds no entry, so `run` cannot fire twice,\n * and a `run` that throws still leaves the toast closed.\n */\n private runAction(id: number): void {\n const action = this.active.find(t => t.id === id)?.action;\n if (!action) return;\n this.dismiss(id);\n action.run();\n }\n\n /** Dismiss every visible toast. Wired to the host's \"Close all\" button. */\n dismissAll(): void {\n for (const entry of this.active) {\n if (entry.timer) clearTimeout(entry.timer);\n }\n this.active = [];\n this.queue = [];\n this.disposeHost();\n }\n\n /** Change the corner the stack opens in. Affects future toasts. */\n setPosition(position: WrToastPosition): void {\n this.currentPosition = position;\n if (this.hostRef) this.hostRef.setInput('position', position);\n }\n\n /** Switch the layout mode at runtime. Persists across host re-creation. */\n setMode(mode: 'stack' | 'list'): void {\n this.currentMode = mode;\n if (this.hostRef) this.hostRef.setInput('mode', mode);\n }\n\n // Timer\n\n private startTimer(entry: ActiveEntry): void {\n // Never a second timer for one entry: a toast's own pause and the host's\n // hold both resume, and whichever comes second finds the clock running.\n if (entry.remaining <= 0 || entry.timer || this.held) return;\n entry.startedAt = Date.now();\n entry.timer = setTimeout(() => this.dismiss(entry.id), entry.remaining);\n }\n\n private pauseTimer(entry: ActiveEntry): void {\n if (!entry.timer) return;\n clearTimeout(entry.timer);\n entry.timer = undefined;\n if (entry.startedAt) {\n entry.remaining = Math.max(0, entry.remaining - (Date.now() - entry.startedAt));\n }\n }\n\n private setHeld(held: boolean): void {\n this.held = held;\n for (const entry of this.active) {\n if (held) this.pauseTimer(entry);\n else this.startTimer(entry);\n }\n }\n\n // Host plumbing\n\n private ensureHost(position: WrToastPosition): void {\n if (this.overlayRef) {\n if (position !== this.currentPosition) this.setPosition(position);\n return;\n }\n\n this.currentPosition = position;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n hasBackdrop: false,\n panelClass: ['wr-toast-overlay'],\n });\n\n // The corner is `inset-inline-start` / `-end` on the host component, so the\n // side the stack sits on is decided entirely by the `dir` the CDK wrote at\n // create. This host outlives every individual toast — it is torn down only\n // when the last one leaves — so without this a stack raised before a flip\n // stays on the reader's old side for the rest of the run. The position\n // strategy is bare, so nothing else moves. Torn down with the ref by\n // `disposeHost()`, and the next `ensureHost()` installs a new follower.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new ComponentPortal(WrToastHost);\n this.hostRef = this.overlayRef.attach(portal);\n this.hostRef.setInput('position', position);\n this.hostRef.setInput('mode', this.currentMode);\n this.hostRef.setInput('config', this.config);\n\n const inst = this.hostRef.instance;\n inst.dismissed.subscribe(id => this.dismiss(id));\n inst.actionRequested.subscribe(id => this.runAction(id));\n inst.dismissAllRequested.subscribe(() => this.dismissAll());\n inst.pauseRequested.subscribe(id => {\n const entry = this.active.find(t => t.id === id);\n if (entry) this.pauseTimer(entry);\n });\n inst.resumeRequested.subscribe(id => {\n const entry = this.active.find(t => t.id === id);\n if (entry) this.startTimer(entry);\n });\n inst.holdChange.subscribe(held => this.setHeld(held));\n\n this.watchForNewerOverlays();\n }\n\n /**\n * Put the host back on top of the browser's top layer.\n *\n * The stacking rule here is not a z-index and cannot be fixed with one. CDK 22\n * promotes every overlay by calling `showPopover()` on its host element, and\n * the top layer is ordered by the MOMENT of promotion — a popover shown later\n * paints over one shown earlier no matter what either element's z-index, DOM\n * order or containing block says. The toast host is created once and kept\n * alive until the last toast leaves, so its place in that order is frozen at\n * whenever the first toast of the run appeared. Every dialog and drawer opened\n * after that sits above it.\n *\n * The symptom was as bad as the mechanism is quiet: a toast raised from inside\n * an open dialog rendered UNDER the dialog's backdrop, dimmed by it and\n * hit-tested as it — so the close button was unreachable and clicking where it\n * appeared closed the dialog instead. Nothing threw, and a toast with\n * `duration: 0` never went away on its own.\n *\n * Hiding and re-showing moves the host to the end of the top layer. Both calls\n * happen in one task, so there is no frame in which the host is `display:\n * none` and nothing re-runs a toast's enter animation.\n *\n * Skipped while focus is inside the host: Chromium keeps focus across this\n * pair, but the hide-popover algorithm is specified to restore focus to the\n * previously focused element, and a host the user is already tabbing through\n * is by definition reachable. In practice the two never coincide — a modal\n * traps focus, so focus inside the host means nothing is above it to escape.\n */\n private raiseHost(): void {\n const host = this.overlayRef?.hostElement;\n // `usePopover` is off when the platform has no popover support (and on the\n // server), and then there is no top layer to be at the wrong end of.\n if (!host?.isConnected || !host.hasAttribute('popover')) return;\n if (host.contains(host.ownerDocument.activeElement)) return;\n try {\n host.hidePopover();\n host.showPopover();\n } catch {\n // `hidePopover` throws if the host is not showing — nothing to raise.\n }\n }\n\n /**\n * Re-raise the host whenever another overlay joins the container.\n *\n * `show()` covers the reported order (toast raised while a dialog is up). This\n * covers the mirror image, which is the same defect seen from the other side:\n * a toast already on screen when the dialog opens is left under it, unclickable\n * for the rest of its duration, and no further `show()` is coming to fix it.\n *\n * Observing the host's own parent rather than a container resolved from the\n * injector keeps this correct even for an app that rebinds `WR_OVERLAY` — the\n * host is in whichever container it was actually appended to. Re-showing a\n * popover moves nothing in the DOM, so this cannot re-trigger itself.\n */\n private watchForNewerOverlays(): void {\n const parent = this.overlayRef?.hostElement.parentElement;\n if (!parent || typeof MutationObserver === 'undefined') return;\n this.containerObserver = new MutationObserver(() => this.raiseHost());\n this.containerObserver.observe(parent, { childList: true });\n }\n\n /** Fill any free stack slots from the queue (FIFO), starting each promoted\n * toast's auto-dismiss timer only as it becomes visible. */\n private promoteFromQueue(): void {\n const max = this.config.maxStack;\n while ((max <= 0 || this.active.length < max) && this.queue.length > 0) {\n const [next, ...rest] = this.queue;\n this.queue = rest;\n this.active = [...this.active, next];\n this.startTimer(next);\n }\n }\n\n private pushToHost(): void {\n this.hostRef?.instance.toasts.set([...this.active]);\n this.hostRef?.instance.queued.set(this.queue.length);\n }\n\n private disposeHost(): void {\n // The next host starts with nobody in it.\n this.held = false;\n this.containerObserver?.disconnect();\n this.containerObserver = null;\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.hostRef = null;\n }\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ApplicationRef, ENVIRONMENT_INITIALIZER, EnvironmentInjector, inject, isDevMode } from '@angular/core';\n\nimport { type WrFeature, wrFeature } from 'ngwr/utils';\n\nimport { DEFAULT_WR_TOAST_CONFIG } from './default-toast-config';\nimport { WR_TOAST_CONFIG } from './tokens';\nimport type { WrToastConfig } from './types';\n\n/**\n * Registers a global {@link WrToastConfig} for {@link WrToast}, as a feature of\n * `provideWr()`. Any field you omit falls back to {@link DEFAULT_WR_TOAST_CONFIG};\n * the `labels` sub-object is merged separately so you can override a single\n * string at a time (useful for i18n).\n *\n * @example\n * ```ts\n * import { provideWr } from 'ngwr';\n * import { withToast } from 'ngwr/toast';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWr(\n * withToast({\n * position: 'bottom-end',\n * showCopy: true,\n * maxStack: 3,\n * labels: { close: 'Закрыть' },\n * }),\n * ),\n * ],\n * });\n * ```\n *\n * **Bootstrap only, unlike the icon registry.** {@link WrToast} is\n * root-provided, so it reads this token once from the ROOT injector — a\n * `provideWr(withToast())` in a route's `providers` is never seen, and used to\n * be ignored in silence. It now warns in dev mode instead. By contrast\n * `provideWrIcons()` works at any level and chains, so a route may add icons to\n * the set its parent registered.\n */\nexport function withToast(\n config: Partial<Omit<WrToastConfig, 'labels'>> & { readonly labels?: Partial<WrToastConfig['labels']> }\n): WrFeature<'toast'> {\n const merged: WrToastConfig = {\n ...DEFAULT_WR_TOAST_CONFIG,\n ...config,\n labels: { ...DEFAULT_WR_TOAST_CONFIG.labels, ...config.labels },\n };\n return wrFeature('toast', [\n { provide: WR_TOAST_CONFIG, useValue: merged },\n ...(isDevMode()\n ? [\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: (): void => {\n // Compared by identity against the application's own injector: a\n // route creates a child EnvironmentInjector, and the root-provided\n // service will resolve the token from the root regardless of what\n // this one holds. Reported here rather than at the call site,\n // because a feature function cannot know where it was spread.\n const here = inject(EnvironmentInjector);\n if (here !== inject(ApplicationRef).injector) {\n // eslint-disable-next-line no-console -- dev-mode misconfiguration diagnostic\n console.warn(\n '[NGWR] withToast() is in a route or child injector, where WrToast will never read it — ' +\n 'the service is root-provided and resolves WR_TOAST_CONFIG once, from the root. Move ' +\n 'provideWr(withToast()) to the application providers, or set the same fields per call on toast.show().'\n );\n }\n },\n },\n ]\n : []),\n ]);\n}\n"],"mappings":";;;;;;;;;;;;;;AA2CA,IAAa,cAAb,MAAa,YAAW;CACtB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,OAAO;CAC1E;CAES,OAAO,MAAmB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CACjC,QAAQ,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,WAAW,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAC/B,eAAe,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACpC,WAAW,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAEhC,cAAc,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAExC,aAAa,MAAoB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEtC,WAAW,MAAc,GAAE,GAAA,YAAA,CAAA,EA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A;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA,EADnB,MAAA,Q;;;;;;;;ACLD,SAAgB,UACd,QAAuG;CAEvG,MAAM,SAAwB;EAC5B,GAAG;EACH,GAAG;EACH,QAAQ;GAAE,GAAG,wBAAwB;GAAQ,GAAG,OAAO;EAAM;CAC9D;CACD,OAAO,UAAU,SAAS,CACxB;EAAE,SAAS;EAAiB,UAAU;CAAM,GAC5C,GAAI,UAAS,IACT,CACE;EACE,SAAS;EACT,OAAO;EACP,gBAAqB;GAOnB,IADa,OAAO,mBAChB,MAAS,OAAO,cAAc,CAAC,CAAC,UAElC,QAAQ,KACN,kRAEyG;EAG/G;CACD,CACF,IACD,CAAA,CACL,CAAA;AACH"}
1
+ {"version":3,"file":"ngwr-toast.mjs","names":[],"sources":["../../../projects/lib/toast/default-toast-config.ts","../../../projects/lib/toast/tokens/toast-config.token.ts","../../../projects/lib/toast/toast-channel.ts","../../../projects/lib/toast/toast-item.ts","../../../projects/lib/toast/toast-item.html","../../../projects/lib/toast/toast-host.ts","../../../projects/lib/toast/toast-host.html","../../../projects/lib/toast/toast-ref.ts","../../../projects/lib/toast/services/toast.ts","../../../projects/lib/toast/toast-outlet.ts","../../../projects/lib/toast/toast-outlet.html","../../../projects/lib/toast/with-toast.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 type { WrToastConfig } from './types';\n\n/**\n * Library defaults applied when no {@link withToast} feature is registered.\n * Merged shallowly with the consumer's overrides (the `labels` sub-object is\n * merged separately so callers can override one string at a time).\n */\nexport const DEFAULT_WR_TOAST_CONFIG: WrToastConfig = {\n position: 'top-end',\n mode: 'stack',\n duration: 4000,\n showProgress: true,\n showCopy: false,\n showCloseAll: true,\n closeAllThreshold: 2,\n maxStack: 5,\n // Null, not English: the host resolves each one through the i18n catalog and\n // falls back to English only if nothing is registered. See `WrToastConfig`.\n labels: {\n close: null,\n copy: null,\n copied: null,\n closeAll: null,\n },\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { DEFAULT_WR_TOAST_CONFIG } from '../default-toast-config';\nimport type { WrToastConfig } from '../types';\n\n/**\n * Holds the global {@link WrToastConfig} used by {@link WrToast}.\n * The default factory returns {@link DEFAULT_WR_TOAST_CONFIG} so the service\n * works out of the box; override via `provideWr(withToast(...))`.\n */\nexport const WR_TOAST_CONFIG = new InjectionToken<WrToastConfig>('WR_TOAST_CONFIG', {\n providedIn: 'root',\n factory: () => DEFAULT_WR_TOAST_CONFIG,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Service, inject, signal } from '@angular/core';\n\nimport { WR_TOAST_CONFIG } from './tokens';\nimport type { WrToastOptions } from './types';\n\n/** A toast in a channel, with the bookkeeping its countdown needs. */\nexport type WrToastEntry = WrToastOptions & {\n readonly id: number;\n /** Auto-dismiss duration in ms after merging with the config. */\n readonly resolvedDuration: number;\n timer?: ReturnType<typeof setTimeout>;\n /** Timestamp of the last timer (re)start, used to compute remaining on pause. */\n startedAt?: number;\n /** Milliseconds left when paused. */\n remaining: number;\n};\n\n/**\n * One independent stack of toasts: the global one, or an outlet's.\n *\n * At most one pending timer per visible toast, and every operation is\n * O(`maxStack`), however many toasts have passed through.\n *\n * @internal\n */\nexport class WrToastChannel {\n /** The rendered toasts, capped at `maxStack`. */\n readonly toasts = signal<readonly WrToastEntry[]>([]);\n /** How many wait behind the cap. */\n readonly queued = signal(0);\n\n private queue: WrToastEntry[] = [];\n /** The pointer or focus is inside the host: no countdown runs, a toast that\n * arrives meanwhile included. See `WrToastHost.syncHold`. */\n private held = false;\n /** Outlets rendering this channel. */\n private mounts = 0;\n\n /**\n * @param expire called when a toast's countdown runs out\n * @param drops past the cap the oldest toast is dropped; otherwise the newest waits in a queue\n * @param live `false` until an outlet mounts: a toast nobody can see does not count down\n */\n constructor(\n private readonly expire: (id: number) => void,\n private readonly drops: boolean,\n private live: boolean,\n public maxStack: number,\n public duration: number\n ) {}\n\n get empty(): boolean {\n return this.toasts().length === 0 && this.queue.length === 0;\n }\n\n find(id: number): WrToastEntry | undefined {\n return this.toasts().find(t => t.id === id);\n }\n\n add(entry: WrToastEntry): void {\n const max = this.maxStack;\n const active = this.toasts();\n if (max <= 0 || active.length < max) {\n this.toasts.set([...active, entry]);\n } else if (this.drops && this.held) {\n // What the user is reading stays. The arrivals wait, bounded like the\n // stack, and enter on release.\n if (this.queue.length >= max) this.queue.shift();\n this.queue.push(entry);\n this.queued.set(this.queue.length);\n return;\n } else if (this.drops) {\n // Straight out of the array, with no exit to run.\n const kept = active.length - max + 1;\n for (let i = 0; i < kept; i++) this.stopTimer(active[i]);\n this.toasts.set([...active.slice(kept), entry]);\n } else {\n // No timer until it is shown.\n this.queue.push(entry);\n this.queued.set(this.queue.length);\n return;\n }\n this.startTimer(entry);\n }\n\n /** Whether the toast was in this channel, visible or queued. */\n remove(id: number): boolean {\n const active = this.toasts();\n const entry = active.find(t => t.id === id);\n const queuedAt = entry ? -1 : this.queue.findIndex(t => t.id === id);\n if (!entry && queuedAt < 0) return false;\n if (entry) {\n this.stopTimer(entry);\n this.toasts.set(active.filter(t => t !== entry));\n } else {\n this.queue.splice(queuedAt, 1);\n }\n this.promote();\n // The host goes with its last toast, and takes the pointer's hold with it.\n if (this.empty) this.held = false;\n return true;\n }\n\n clear(): void {\n for (const entry of this.toasts()) this.stopTimer(entry);\n this.toasts.set([]);\n this.queue = [];\n this.queued.set(0);\n this.held = false;\n }\n\n pause(id: number): void {\n const entry = this.find(id);\n if (entry) this.pauseTimer(entry);\n }\n\n resume(id: number): void {\n const entry = this.find(id);\n if (entry) this.startTimer(entry);\n }\n\n setHeld(held: boolean): void {\n this.held = held;\n if (!held) this.release();\n this.syncTimers();\n }\n\n /** An outlet's own cap and default duration. A lower cap drops the oldest at once. */\n configure(maxStack: number, duration: number): void {\n this.maxStack = maxStack;\n this.duration = duration;\n const active = this.toasts();\n if (!this.drops || maxStack <= 0 || active.length <= maxStack) return;\n const over = active.length - maxStack;\n for (let i = 0; i < over; i++) this.stopTimer(active[i]);\n this.toasts.set(active.slice(over));\n }\n\n /** How many outlets render the channel after this one joined. */\n mount(): number {\n this.mounts++;\n this.live = true;\n this.syncTimers();\n return this.mounts;\n }\n\n unmount(): void {\n if (--this.mounts > 0) return;\n this.live = false;\n this.held = false;\n this.release();\n this.syncTimers();\n }\n\n /** Let in what arrived during a hold, in arrival order, the oldest toasts making room. */\n private release(): void {\n if (!this.drops || this.queue.length === 0) return;\n const all = [...this.toasts(), ...this.queue];\n const over = this.maxStack > 0 ? Math.max(0, all.length - this.maxStack) : 0;\n for (let i = 0; i < over; i++) this.stopTimer(all[i]);\n this.queue = [];\n this.queued.set(0);\n this.toasts.set(all.slice(over));\n }\n\n private syncTimers(): void {\n const running = this.live && !this.held;\n for (const entry of this.toasts()) {\n if (running) this.startTimer(entry);\n else this.pauseTimer(entry);\n }\n }\n\n /** Fill free slots from the queue, FIFO; a countdown starts as its toast becomes visible. */\n private promote(): void {\n const max = this.maxStack;\n const promoted: WrToastEntry[] = [];\n while (this.queue.length > 0 && (max <= 0 || this.toasts().length + promoted.length < max)) {\n promoted.push(this.queue.shift()!);\n }\n if (promoted.length === 0) return;\n this.toasts.update(active => [...active, ...promoted]);\n this.queued.set(this.queue.length);\n for (const entry of promoted) this.startTimer(entry);\n }\n\n private startTimer(entry: WrToastEntry): void {\n // Never a second timer for one entry: a toast's own pause and the host's\n // hold both resume, and whichever comes second finds the clock running.\n if (entry.remaining <= 0 || entry.timer || this.held || !this.live) return;\n entry.startedAt = Date.now();\n entry.timer = setTimeout(() => this.expire(entry.id), entry.remaining);\n }\n\n private pauseTimer(entry: WrToastEntry): void {\n if (!entry.timer) return;\n this.stopTimer(entry);\n if (entry.startedAt) {\n entry.remaining = Math.max(0, entry.remaining - (Date.now() - entry.startedAt));\n }\n }\n\n private stopTimer(entry: WrToastEntry): void {\n if (!entry.timer) return;\n clearTimeout(entry.timer);\n entry.timer = undefined;\n }\n}\n\n/**\n * The outlet channels, by name. A channel outlives its outlet, so a toast sent\n * before the outlet is in the page waits for it.\n *\n * @internal\n */\n@Service()\nexport class WrToastChannels {\n private readonly config = inject(WR_TOAST_CONFIG);\n private readonly channels = new Map<string, WrToastChannel>();\n\n get(name: string): WrToastChannel {\n let channel = this.channels.get(name);\n if (!channel) {\n channel = new WrToastChannel(id => channel?.remove(id), true, false, this.config.maxStack, this.config.duration);\n this.channels.set(name, channel);\n }\n return channel;\n }\n\n /** Remove the toast from whichever channel holds it. */\n remove(id: number): void {\n for (const channel of this.channels.values()) {\n if (channel.remove(id)) return;\n }\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ElementRef, ViewEncapsulation, computed, inject, input, output, signal } from '@angular/core';\n\nimport { wrToClassList, wrCheckStyles, type WrClassInput } from 'ngwr/utils';\n\nimport type { WrToastConfig, WrToastType } from './types';\n\n/**\n * One toast row inside the toast host. Not used directly — see\n * `WrToast.show()`.\n *\n * @internal\n */\n@Component({\n selector: 'wr-toast',\n templateUrl: './toast-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n // See `WrAlert`: a static `title=` feeds the input AND lands on the host.\n '[attr.title]': 'null',\n class: 'wr-toast',\n '[class]': 'classes()',\n '[style.--wr-toast-duration]': 'durationMs()',\n '[style.transform]': 'swipeTransform()',\n '[style.opacity]': 'swipeOpacity()',\n '[style.transition]': 'swiping() ? \"none\" : null',\n '[attr.role]': 'liveRole()',\n '[attr.aria-live]': 'liveLevel()',\n '(mouseenter)': 'onPointer(true)',\n '(mouseleave)': 'onPointer(false)',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onFocusOut($event)',\n '(touchstart)': 'onSwipeStart($event)',\n '(touchmove)': 'onSwipeMove($event)',\n '(touchend)': 'onSwipeEnd()',\n '(touchcancel)': 'onSwipeEnd()',\n },\n})\nexport class WrToastItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('toast');\n }\n\n readonly type = input<WrToastType>('info');\n readonly title = input<string | null>(null);\n readonly message = input.required<string>();\n readonly closable = input<boolean>(true);\n readonly showProgress = input<boolean>(false);\n readonly showCopy = input<boolean>(false);\n /** Text of the action button, from `WrToastOptions.action`. `null` renders none. */\n readonly actionLabel = input<string | null>(null);\n /** Extra classes from `WrToastOptions.class`, merged into the host's own. */\n readonly extraClass = input<WrClassInput>(null);\n /** Auto-dismiss duration in ms — used to scale the progress bar. `0` hides it. */\n readonly duration = input<number>(0);\n /**\n * Already resolved by the host — strings, not the config's nullable shape.\n * The item renders them and never reaches for the catalog itself.\n */\n readonly labels = input.required<{ [K in keyof WrToastConfig['labels']]: string }>();\n\n readonly dismissed = output<void>();\n readonly actionRequested = output<void>();\n readonly pauseRequested = output<void>();\n readonly resumeRequested = output<void>();\n\n /**\n * The countdown holds while the pointer rests on the toast OR focus is inside\n * it. Hover alone left a keyboard user's toast running: focus its Close button\n * and it was removed from under the focus four seconds later, which dropped\n * focus on `<body>` — WCAG 2.2.1 asks for a way to hold a time limit, and the\n * pointer was the only one. Two flags, so leaving by one road while still in\n * by the other does not resume it.\n */\n private hovered = false;\n private focused = false;\n\n /** @internal */\n protected onPointer(over: boolean): void {\n this.syncPause(() => (this.hovered = over));\n }\n\n /** @internal */\n protected onFocusIn(): void {\n this.syncPause(() => (this.focused = true));\n }\n\n /** @internal Focus moving between two buttons of this toast is not leaving it. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.elRef.nativeElement.contains(next)) return;\n this.syncPause(() => (this.focused = false));\n }\n\n private syncPause(change: () => void): void {\n const wasHeld = this.hovered || this.focused;\n change();\n const held = this.hovered || this.focused;\n if (held === wasHeld) return;\n if (held) this.pauseRequested.emit();\n else this.resumeRequested.emit();\n }\n\n /** True for ~1.5s after a successful copy; flips the icon to a check. */\n protected readonly justCopied = signal(false);\n private copyResetTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * `--untitled` when the toast opens on its message. The glyph and the\n * actions are centred on the FIRST line, and with no title that line is the\n * message's, whose line height is its own hook — so the stylesheet needs to\n * know which one it is reading.\n */\n protected readonly classes = computed(() =>\n wrToClassList(\n 'wr-toast',\n `wr-toast--${this.type()}`,\n this.title() ? null : 'wr-toast--untitled',\n this.extraClass()\n ).join(' ')\n );\n\n /** Escalate to `alert`/`assertive` for danger/warning toasts. */\n protected readonly liveRole = computed(() => (this.type() === 'danger' ? 'alert' : 'status'));\n protected readonly liveLevel = computed(() =>\n this.type() === 'danger' || this.type() === 'warning' ? 'assertive' : 'polite'\n );\n\n /** Inline CSS value for `--wr-toast-duration`. */\n protected readonly durationMs = computed(() => `${this.duration()}ms`);\n\n protected readonly progressVisible = computed(() => this.showProgress() && this.duration() > 0);\n\n /**\n * What the copy button puts on the clipboard: the message, or the title when\n * the toast has nothing else. A title-only toast copied an empty string, and\n * still flipped the glyph to the \"Copied\" check.\n */\n private readonly copyText = computed(() => (this.message() !== '' ? this.message() : (this.title() ?? '')));\n\n protected async onCopy(): Promise<void> {\n try {\n await navigator.clipboard.writeText(this.copyText());\n this.justCopied.set(true);\n if (this.copyResetTimer) clearTimeout(this.copyResetTimer);\n this.copyResetTimer = setTimeout(() => this.justCopied.set(false), 1500);\n } catch {\n // Clipboard unavailable (insecure context / permission denied) — silent.\n }\n }\n\n // Swipe-sideways-to-dismiss. The toast follows the finger and fades; releasing\n // past 40% of its width emits `dismissed`, otherwise it snaps back.\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private swipeStartX = 0;\n private swipeWidth = 0;\n protected readonly swipeX = signal(0);\n protected readonly swiping = signal(false);\n\n protected readonly swipeTransform = computed(() => (this.swipeX() === 0 ? null : `translateX(${this.swipeX()}px)`));\n protected readonly swipeOpacity = computed(() => {\n const dist = Math.abs(this.swipeX());\n return dist === 0 ? null : Math.max(0, 1 - dist / (this.swipeWidth || 1));\n });\n\n protected onSwipeStart(event: TouchEvent): void {\n if (!this.closable()) return;\n const touch = event.touches[0];\n if (!touch) return;\n this.swipeStartX = touch.clientX;\n this.swipeWidth = this.elRef.nativeElement.offsetWidth;\n this.swiping.set(true);\n }\n\n protected onSwipeMove(event: TouchEvent): void {\n if (!this.swiping()) return;\n const touch = event.touches[0];\n if (!touch) return;\n this.swipeX.set(touch.clientX - this.swipeStartX);\n }\n\n protected onSwipeEnd(): void {\n if (!this.swiping()) return;\n this.swiping.set(false);\n if (Math.abs(this.swipeX()) > (this.swipeWidth || 0) * 0.4) {\n this.dismissed.emit();\n } else {\n this.swipeX.set(0);\n }\n }\n}\n","<!-- A glyph per type, and this is the one channel the toast had none of. Its\n four types differed by `--wr-toast-accent` alone — a 3px inline-start\n border, in four colours that sit within 1.06:1 of each other in relative\n luminance, so `success` and `danger` were the same 3px line to a reader\n who cannot separate hue. The shapes are the ones `wr-alert` and\n `wr-result` already use for the same four meanings: a check in a broken\n circle, a triangle, an octagon, an `i`. Three components agreeing is worth\n more than three components each being locally reasonable.\n\n `aria-hidden`, because the type is already announced: the host takes\n `role=\"alert\"` for danger and `role=\"status\"` otherwise. -->\n<svg\n class=\"wr-toast__icon 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 @switch (type()) {\n @case ('success') {\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n }\n @case ('warning') {\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n }\n @case ('danger') {\n <path\n d=\"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z\"\n />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n }\n @default {\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n }\n }\n</svg>\n\n<!-- Each part renders only when it has text. A title-only toast is shown with\n `message: ''`, and the empty `<p>` it used to leave behind kept the title's\n bottom margin under it: 4px of dead space that made the card taller below\n its one line than above it. -->\n<div class=\"wr-toast__body\">\n @if (title(); as text) {\n <p class=\"wr-toast__title\">{{ text }}</p>\n }\n @if (message(); as text) {\n <p class=\"wr-toast__message\">{{ text }}</p>\n }\n</div>\n\n<div class=\"wr-toast__actions\">\n @if (actionLabel(); as label) {\n <button type=\"button\" class=\"wr-toast__action wr-toast__action--run\" (click)=\"actionRequested.emit()\">\n {{ label }}\n </button>\n }\n\n @if (showCopy()) {\n <button\n type=\"button\"\n class=\"wr-toast__action wr-toast__action--copy\"\n [attr.aria-label]=\"justCopied() ? labels().copied : labels().copy\"\n [title]=\"justCopied() ? labels().copied : labels().copy\"\n (click)=\"onCopy()\"\n >\n @if (justCopied()) {\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=\"M20 6 9 17l-5-5\" />\n </svg>\n } @else {\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 <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n }\n </button>\n }\n\n @if (closable()) {\n <button\n type=\"button\"\n class=\"wr-toast__action wr-toast__action--close\"\n [attr.aria-label]=\"labels().close\"\n [title]=\"labels().close\"\n (click)=\"dismissed.emit()\"\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 </button>\n }\n</div>\n\n@if (progressVisible()) {\n <span class=\"wr-toast__progress\" aria-hidden=\"true\"></span>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n viewChildren,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrToastItem } from './toast-item';\nimport type { WrToastConfig, WrToastMode, WrToastOptions, WrToastPosition } from './types';\n\n/** ms before the pointer or focus leaving actually collapses the stack. Buffers\n * the cursor briefly leaving the host as toasts reflow underneath it, and focus\n * hopping between two buttons inside the host. */\nconst COLLAPSE_DELAY_MS = 120;\n\n/** Send focus back to `origin` when it is still in the page. */\nfunction returnFocus(origin: HTMLElement | null, monitor: FocusMonitor): void {\n if (origin?.isConnected) wrRestoreFocus(origin, monitor);\n}\n\n/**\n * Whether `el`, the focused element, holds focus the keyboard way — the focus a\n * removal would strand.\n *\n * A pointer press on Close focuses the button too, in Chromium, and handing\n * THAT focus on is a regression rather than a fix: focus inside the region\n * holds every countdown, so after one click the rest of the stack stayed up\n * until the reader clicked somewhere else — measured, two toasts still on\n * screen six seconds after the pointer left. Left alone, the removed button's\n * `focusout` releases the hold, as it always did.\n */\nfunction hasKeyboardFocus(el: Element | null | undefined): boolean {\n if (!el) return false;\n try {\n return el.matches(':focus-visible');\n } catch {\n // An engine without the pseudo-class: err on the side of not losing focus.\n return true;\n }\n}\n\n/** Active entry pushed by the service — adds the bookkeeping fields the host renders. */\ntype ActiveToast = WrToastOptions & {\n readonly id: number;\n readonly resolvedDuration: number;\n};\n\n/**\n * Internal host that lives inside the toast overlay and renders the\n * active stack. Owned by `WrToast`.\n *\n * @internal\n */\n@Component({\n selector: 'wr-toast-host',\n templateUrl: './toast-host.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-toast-host',\n '[class]': 'classes()',\n '[style.--wr-toast-front-height]': 'frontHeight()',\n role: 'region',\n '[attr.aria-label]': 'regionLabel()',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusOut($event)',\n },\n imports: [WrToastItem],\n})\nexport class WrToastHost {\n readonly position = input<WrToastPosition>('top-end');\n readonly config = input.required<WrToastConfig>();\n /** Layout mode. @default 'stack' (Sonner-style; hover to fan out) */\n readonly mode = input<WrToastMode>('stack');\n\n /**\n * Every string this host and its items render, resolved through the catalog.\n *\n * The config value WINS when the consumer sets one, and its default is now\n * `null` — until v11 those defaults were English literals, so the four\n * `toast.*` keys in the shipped catalogs were dead and a Russian app got an\n * English close button. `region` had no key at all: the live region's name\n * was the literal `'Notifications'` in a host binding.\n */\n protected readonly regionLabel = useI18nText(signal(null), 'toast.region', 'Notifications');\n\n private readonly closeLabel = useI18nText(\n computed(() => this.config().labels.close),\n 'toast.close',\n 'Close'\n );\n private readonly copyLabel = useI18nText(\n computed(() => this.config().labels.copy),\n 'toast.copy',\n 'Copy'\n );\n private readonly copiedLabel = useI18nText(\n computed(() => this.config().labels.copied),\n 'toast.copied',\n 'Copied'\n );\n protected readonly closeAllLabel = useI18nText(\n computed(() => this.config().labels.closeAll),\n 'toast.closeAll',\n 'Close all'\n );\n\n /** What `wr-toast-item` receives — resolved, so the item stays presentational. */\n protected readonly labels = computed(() => ({\n close: this.closeLabel(),\n copy: this.copyLabel(),\n copied: this.copiedLabel(),\n closeAll: this.closeAllLabel(),\n }));\n\n /** @internal — hovering or focusing the stack toggles this in stack mode. */\n protected readonly expanded = signal(false);\n\n /** Pointer is over the host. */\n private readonly hovered = signal(false);\n /** Focus is somewhere inside the host — keyboard equivalent of hovering, and\n * the only way a keyboard user can reach the \"Close all\" button. */\n private readonly focusWithin = signal(false);\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly destroyRef = inject(DestroyRef);\n private readonly elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private collapseTimer: ReturnType<typeof setTimeout> | null = null;\n /** The last value `holdChange` emitted. */\n private held = false;\n\n /** The rendered toasts, in `toasts()` order. */\n private readonly items = viewChildren(WrToastItem, { read: ElementRef });\n\n /**\n * Where focus was before it entered the region, which is where it goes back\n * to when the last toast is closed from inside. Recorded off the `focusin`\n * that crosses INTO the host; a hop between two toasts is not an entry.\n */\n private focusOrigin: HTMLElement | null = null;\n /** True while this host moves focus itself, so the move is not read as an entry. */\n private movingFocus = false;\n\n /**\n * The front toast's height, which the cards behind it take while the stack\n * is collapsed. Each card used to keep its own, so a short front toast — a\n * title alone, a one-line message — left a taller card hanging below it, and\n * that card's last line read through underneath. `null` until measured, and\n * on the server, where the stylesheet falls back to each card's own height.\n */\n protected readonly frontHeight = signal<string | null>(null);\n\n private readonly frontObserver =\n typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver(entries => {\n // `offsetHeight`, the layout box, which no transform reaches: the\n // collapsed stack scales and offsets its cards with them.\n const front = entries[entries.length - 1]?.target as HTMLElement | undefined;\n this.frontHeight.set(front ? `${front.offsetHeight}px` : null);\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('toast');\n this.destroyRef.onDestroy(() => {\n this.clearCollapseTimer();\n this.frontObserver?.disconnect();\n });\n\n // The front card is the LAST one rendered, whichever way the stack grows.\n // Follow it as toasts come and go; the observer reports its height on the\n // first observation and again whenever its text rewraps.\n effect(() => {\n const items = this.items();\n const front = items[items.length - 1]?.nativeElement as HTMLElement | undefined;\n if (!this.frontObserver) return;\n this.frontObserver.disconnect();\n if (front) this.frontObserver.observe(front);\n else this.frontHeight.set(null);\n });\n }\n\n /** @internal */\n protected onMouseEnter(): void {\n this.hovered.set(true);\n this.syncExpanded();\n }\n\n /** @internal */\n protected onMouseLeave(): void {\n this.hovered.set(false);\n this.syncExpanded();\n }\n\n /** @internal */\n protected onFocusIn(event: FocusEvent): void {\n if (!this.focusWithin() && !this.movingFocus) {\n const from = event.relatedTarget;\n this.focusOrigin = from instanceof HTMLElement && !this.elRef.nativeElement.contains(from) ? from : null;\n }\n this.focusWithin.set(true);\n this.syncExpanded();\n }\n\n /**\n * A toast asked to go — its Close button, or a swipe.\n *\n * When keyboard focus was inside it, the removal would drop focus on\n * `<body>`, so it is handed on: to the Close button of the toast that takes\n * its place (the next one in the stack, a promoted one included), else to the\n * previous one. When no toast is left, focus goes back to where it was before\n * it entered the region. A toast closed while focus was elsewhere, or with a\n * pointer, moves nothing — see `hasKeyboardFocus`.\n *\n * @internal\n */\n protected onItemDismissed(id: number, index: number): void {\n this.removeItem(index, () => this.dismissed.emit(id));\n }\n\n /** The action button closes its toast too, so focus moves the same way. @internal */\n protected onItemAction(id: number, index: number): void {\n this.removeItem(index, () => this.actionRequested.emit(id));\n }\n\n private removeItem(index: number, remove: () => void): void {\n const item = this.items()[index]?.nativeElement as HTMLElement | undefined;\n const active = item?.ownerDocument.activeElement;\n const hadFocus = !!item?.contains(active ?? null) && hasKeyboardFocus(active);\n const origin = this.focusOrigin;\n // Synchronous: the service removes the toast here, and disposes this host\n // when it was the last one.\n remove();\n if (!hadFocus) return;\n if (this.toasts().length === 0) {\n returnFocus(origin, this.focusMonitor);\n return;\n }\n afterNextRender(() => this.focusNeighbour(index), { injector: this.injector });\n }\n\n /** \"Close all\" from the keyboard: nothing is left, so focus goes back. @internal */\n protected onCloseAll(): void {\n const host = this.elRef.nativeElement;\n const active = host.ownerDocument.activeElement;\n const hadFocus = host.contains(active) && hasKeyboardFocus(active);\n const origin = this.focusOrigin;\n this.dismissAllRequested.emit();\n if (hadFocus) returnFocus(origin, this.focusMonitor);\n }\n\n /**\n * Focus the Close button nearest to where the removed toast stood: the one\n * now at its index, then forward, then back. A toast with no Close button\n * (`closable: false`) is passed over; with none anywhere, \"Close all\" if\n * it is showing, else the origin.\n */\n private focusNeighbour(index: number): void {\n const items = this.items().map(ref => ref.nativeElement as HTMLElement);\n const order = [...items.slice(index), ...items.slice(0, index).reverse()];\n const close = order\n .map(el => el.querySelector<HTMLElement>('.wr-toast__action--close'))\n .find((el): el is HTMLElement => !!el);\n const target = close ?? this.elRef.nativeElement.querySelector<HTMLElement>('.wr-toast-host__close-all');\n if (!target) {\n returnFocus(this.focusOrigin, this.focusMonitor);\n return;\n }\n this.movingFocus = true;\n try {\n target.focus();\n } finally {\n this.movingFocus = false;\n }\n }\n\n /** @internal Focus moving between two buttons inside the host is not leaving it. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.elRef.nativeElement.contains(next)) return;\n this.focusWithin.set(false);\n this.syncExpanded();\n }\n\n /** Expand immediately while the pointer or focus is inside, and delay the\n * collapse so a cursor briefly slipping off the host during a layout reflow\n * — or focus moving between two buttons inside it — doesn't cause a flicker. */\n private syncExpanded(): void {\n this.syncHold();\n if (this.hovered() || this.focusWithin()) {\n this.clearCollapseTimer();\n this.expanded.set(true);\n return;\n }\n if (this.collapseTimer !== null) return;\n this.collapseTimer = setTimeout(() => {\n this.collapseTimer = null;\n if (!this.hovered() && !this.focusWithin()) this.expanded.set(false);\n }, COLLAPSE_DELAY_MS);\n }\n\n /**\n * Hold EVERY countdown while the reader is in the region, not only the toast\n * under the pointer. Per-toast pausing let the others expire around the one\n * being read: in an expanded stack the pointer rested on #2 while #1 and #3\n * ran out, the stack collapsed, and #2 jumped 140px up from under a pointer\n * that never moved — and a gutter between toasts, which keeps the stack\n * expanded, paused nothing at all. Released at once on leaving, with no\n * collapse delay, so the timers and the progress bars (paused by the same\n * `:hover` / `:focus-within` in the stylesheet) agree.\n */\n private syncHold(): void {\n const held = this.hovered() || this.focusWithin();\n if (held === this.held) return;\n this.held = held;\n this.holdChange.emit(held);\n }\n\n private clearCollapseTimer(): void {\n if (this.collapseTimer !== null) {\n clearTimeout(this.collapseTimer);\n this.collapseTimer = null;\n }\n }\n\n /** @internal — pushed by the service: the rendered (capped) stack. */\n readonly toasts = signal<readonly ActiveToast[]>([]);\n\n /** @internal — pushed by the service: count still queued behind the cap. */\n readonly queued = signal(0);\n\n /** Total outstanding toasts (visible + queued) — what \"Close all\" clears. */\n protected readonly totalCount = computed(() => this.toasts().length + this.queued());\n\n /** @internal — service listens to update its internal state. */\n readonly dismissed = output<number>();\n readonly actionRequested = output<number>();\n readonly pauseRequested = output<number>();\n readonly resumeRequested = output<number>();\n /** @internal — `true` while the pointer or focus is inside the region. */\n readonly holdChange = output<boolean>();\n readonly dismissAllRequested = output<void>();\n\n protected readonly classes = computed(() => {\n const parts = ['wr-toast-host', `wr-toast-host--${this.position()}`, `wr-toast-host--${this.mode()}`];\n if (this.mode() === 'stack' && this.expanded()) parts.push('wr-toast-host--expanded');\n return parts.join(' ');\n });\n\n /** Distance from the front of the stack (0 = newest / fully visible). */\n protected stackIndex(i: number): number {\n return this.toasts().length - 1 - i;\n }\n\n protected readonly closeAllVisible = computed(() => {\n const cfg = this.config();\n // In stack mode the toasts cascade absolutely while collapsed, which\n // makes the close-all button jump between layout positions on hover\n // (button moves → cursor leaves → host collapses → cycle = blink).\n // Only show it once the stack is expanded — by hover OR by focus entering\n // it, so it stays reachable from the keyboard — or always in list mode.\n if (this.mode() === 'stack' && !this.expanded()) return false;\n return cfg.showCloseAll && this.toasts().length >= cfg.closeAllThreshold;\n });\n\n protected showProgressFor(t: WrToastOptions): boolean {\n return t.showProgress ?? this.config().showProgress;\n }\n\n protected showCopyFor(t: WrToastOptions): boolean {\n return t.showCopy ?? this.config().showCopy;\n }\n}\n","@if (closeAllVisible()) {\n <button type=\"button\" class=\"wr-toast-host__close-all\" (click)=\"onCloseAll()\">\n {{ closeAllLabel() }} ({{ totalCount() }})\n </button>\n}\n\n@for (toast of toasts(); track toast.id) {\n <wr-toast\n [style.--wr-toast-stack-index]=\"stackIndex($index)\"\n [type]=\"toast.type ?? 'info'\"\n [title]=\"toast.title ?? null\"\n [message]=\"toast.message\"\n [closable]=\"toast.closable ?? true\"\n [showProgress]=\"showProgressFor(toast)\"\n [showCopy]=\"showCopyFor(toast)\"\n [extraClass]=\"toast.class ?? null\"\n [duration]=\"toast.resolvedDuration\"\n [labels]=\"labels()\"\n [actionLabel]=\"toast.action?.label ?? null\"\n (dismissed)=\"onItemDismissed(toast.id, $index)\"\n (actionRequested)=\"onItemAction(toast.id, $index)\"\n (pauseRequested)=\"pauseRequested.emit(toast.id)\"\n (resumeRequested)=\"resumeRequested.emit(toast.id)\"\n />\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrToastOptions } from './types';\n\n/**\n * Handle returned by `WrToast.show()`. Call `dismiss()` to remove\n * the toast early. Inspect `options` to see what the caller requested.\n */\nexport class WrToastRef {\n constructor(\n public readonly id: number,\n public readonly options: WrToastOptions,\n private readonly onDismiss: (id: number) => void\n ) {}\n\n /** Remove this toast from the stack. */\n dismiss(): void {\n this.onDismiss(this.id);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { type ComponentRef, Injector, Service, inject } from '@angular/core';\n\nimport { WR_OVERLAY, WrOverlayOrder, wrFollowDirection } from 'ngwr/overlay';\n\nimport { WrToastChannel, WrToastChannels, type WrToastEntry } from '../toast-channel';\nimport { WrToastHost } from '../toast-host';\nimport { WrToastRef } from '../toast-ref';\nimport { WR_TOAST_CONFIG } from '../tokens';\nimport type { WrToastOptions, WrToastPosition } from '../types';\n\n/**\n * Opens toast notifications in a single shared overlay, or in the page\n * through a `<wr-toast-outlet>` when `show()` names one.\n *\n * Global defaults come from {@link WR_TOAST_CONFIG}; register\n * `provideWr(withToast(...))` once at bootstrap to customise. Each\n * `show()` call accepts per-toast overrides via {@link WrToastOptions}.\n *\n * @example\n * ```ts\n * const toast = inject(WrToast);\n *\n * toast.show({ type: 'success', title: 'Saved', message: 'Profile updated.' });\n * toast.show({ type: 'danger', message: 'Network error', duration: 0 });\n * toast.show({ message: 'Permalink copied', position: 'bottom', showCopy: true });\n * toast.show({ message: 'Item deleted', action: { label: 'Undo', run: () => restore() } });\n * toast.show({ type: 'danger', message: 'Door forced', outlet: 'alarms' });\n * ```\n *\n * @see https://ngwr.dev/reference/components/toast\n */\n@Service()\nexport class WrToast {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly order = inject(WrOverlayOrder);\n private readonly config = inject(WR_TOAST_CONFIG);\n private readonly injector = inject(Injector);\n private readonly dir = inject(Directionality, { optional: true });\n\n private overlayRef: OverlayRef | null = null;\n private hostRef: ComponentRef<WrToastHost> | null = null;\n /** Watches the overlay container for overlays opened after the host. */\n private containerObserver: MutationObserver | null = null;\n private currentPosition: WrToastPosition = this.config.position;\n private currentMode: 'stack' | 'list' = this.config.mode;\n private nextId = 1;\n /** The stack in the overlay. Past `maxStack` the newest waits, so nothing is\n * ever silently dropped. */\n private readonly global = new WrToastChannel(\n id => this.dismiss(id),\n false,\n true,\n this.config.maxStack,\n this.config.duration\n );\n private readonly outlets = inject(WrToastChannels);\n\n /** Open a toast. Returns a handle you can `dismiss()` early. */\n show(options: WrToastOptions): WrToastRef {\n const id = this.nextId++;\n const ref = new WrToastRef(id, options, toastId => this.dismiss(toastId));\n\n if (options.outlet != null) {\n const channel = this.outlets.get(options.outlet);\n const resolvedDuration = options.duration ?? channel.duration;\n channel.add({ ...options, id, resolvedDuration, remaining: resolvedDuration });\n return ref;\n }\n\n // `currentPosition` before the injected default, so `setPosition()` holds\n // across a host that has been disposed. `dismiss()` and `dismissAll()`\n // tear the host down, so \"no host alive\" is the state before the first\n // toast of a run and after the last one goes — exactly where the stack\n // used to snap back to the configured corner with nothing to say so.\n // `setMode` already persisted this way, and its JSDoc says it does.\n // `currentPosition` is seeded from the config, so the default still wins\n // when nobody has called `setPosition`.\n const resolvedPosition = options.position ?? this.currentPosition;\n const resolvedDuration = options.duration ?? this.config.duration;\n\n this.ensureHost(resolvedPosition);\n // A toast raised now belongs above everything already on screen, and the host\n // it goes into may be much older than the dialog it has to clear. See\n // `raiseHost`.\n this.raiseHost();\n\n const entry: WrToastEntry = { ...options, id, resolvedDuration, remaining: resolvedDuration };\n this.global.add(entry);\n this.pushToHost();\n\n return ref;\n }\n\n /** Dismiss a single toast by id, in whichever stack holds it. */\n dismiss(id: number): void {\n if (!this.global.remove(id)) this.outlets.remove(id);\n this.pushToHost();\n if (this.global.empty) this.disposeHost();\n }\n\n /**\n * Closes first: a second press finds no entry, so `run` cannot fire twice,\n * and a `run` that throws still leaves the toast closed.\n */\n private runAction(id: number): void {\n const action = this.global.find(id)?.action;\n if (!action) return;\n this.dismiss(id);\n action.run();\n }\n\n /**\n * Dismiss every toast of one stack: the global one, or the named outlet's.\n * The global \"Close all\" button calls it with no name, so it leaves the\n * outlets alone.\n */\n dismissAll(outlet?: string): void {\n if (outlet != null) {\n this.outlets.get(outlet).clear();\n return;\n }\n this.global.clear();\n this.disposeHost();\n }\n\n /** Change the corner the stack opens in. Affects future toasts. */\n setPosition(position: WrToastPosition): void {\n this.currentPosition = position;\n if (this.hostRef) this.hostRef.setInput('position', position);\n }\n\n /** Switch the layout mode at runtime. Persists across host re-creation. */\n setMode(mode: 'stack' | 'list'): void {\n this.currentMode = mode;\n if (this.hostRef) this.hostRef.setInput('mode', mode);\n }\n\n // Host plumbing\n\n private ensureHost(position: WrToastPosition): void {\n if (this.overlayRef) {\n if (position !== this.currentPosition) this.setPosition(position);\n return;\n }\n\n this.currentPosition = position;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global(),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n hasBackdrop: false,\n panelClass: ['wr-toast-overlay'],\n });\n\n // The corner is `inset-inline-start` / `-end` on the host component, so the\n // side the stack sits on is decided entirely by the `dir` the CDK wrote at\n // create. This host outlives every individual toast — it is torn down only\n // when the last one leaves — so without this a stack raised before a flip\n // stays on the reader's old side for the rest of the run. The position\n // strategy is bare, so nothing else moves. Torn down with the ref by\n // `disposeHost()`, and the next `ensureHost()` installs a new follower.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new ComponentPortal(WrToastHost);\n this.hostRef = this.overlayRef.attach(portal);\n this.hostRef.setInput('position', position);\n this.hostRef.setInput('mode', this.currentMode);\n this.hostRef.setInput('config', this.config);\n\n const inst = this.hostRef.instance;\n inst.dismissed.subscribe(id => this.dismiss(id));\n inst.actionRequested.subscribe(id => this.runAction(id));\n inst.dismissAllRequested.subscribe(() => this.dismissAll());\n inst.pauseRequested.subscribe(id => this.global.pause(id));\n inst.resumeRequested.subscribe(id => this.global.resume(id));\n inst.holdChange.subscribe(held => this.global.setHeld(held));\n\n this.watchForNewerOverlays();\n }\n\n /**\n * Put the host back on top of the browser's top layer.\n *\n * The stacking rule here is not a z-index and cannot be fixed with one. CDK 22\n * promotes every overlay by calling `showPopover()` on its host element, and\n * the top layer is ordered by the MOMENT of promotion — a popover shown later\n * paints over one shown earlier no matter what either element's z-index, DOM\n * order or containing block says. The toast host is created once and kept\n * alive until the last toast leaves, so its place in that order is frozen at\n * whenever the first toast of the run appeared. Every dialog and drawer opened\n * after that sits above it.\n *\n * The symptom was as bad as the mechanism is quiet: a toast raised from inside\n * an open dialog rendered UNDER the dialog's backdrop, dimmed by it and\n * hit-tested as it — so the close button was unreachable and clicking where it\n * appeared closed the dialog instead. Nothing threw, and a toast with\n * `duration: 0` never went away on its own.\n *\n * Hiding and re-showing moves the host to the end of the top layer. Both calls\n * happen in one task, so there is no frame in which the host is `display:\n * none` and nothing re-runs a toast's enter animation.\n *\n * Skipped while focus is inside the host: Chromium keeps focus across this\n * pair, but the hide-popover algorithm is specified to restore focus to the\n * previously focused element, and a host the user is already tabbing through\n * is by definition reachable. In practice the two never coincide — a modal\n * traps focus, so focus inside the host means nothing is above it to escape.\n *\n * `WrOverlayOrder` does the move, because \"on top\" has an exception: an\n * overlay opened with `toasts: 'below'` stays over the host, so it leaves the\n * host alone where it already sits under one and promotes those overlays\n * again where it does not.\n */\n private raiseHost(): void {\n const host = this.overlayRef?.hostElement;\n // `usePopover` is off when the platform has no popover support (and on the\n // server), and then there is no top layer to be at the wrong end of.\n if (!host?.isConnected || !host.hasAttribute('popover')) return;\n if (host.contains(host.ownerDocument.activeElement)) return;\n this.order.raiseToasts(host);\n }\n\n /**\n * Re-raise the host whenever another overlay joins the container.\n *\n * `show()` covers the reported order (toast raised while a dialog is up). This\n * covers the mirror image, which is the same defect seen from the other side:\n * a toast already on screen when the dialog opens is left under it, unclickable\n * for the rest of its duration, and no further `show()` is coming to fix it.\n *\n * Observing the host's own parent rather than a container resolved from the\n * injector keeps this correct even for an app that rebinds `WR_OVERLAY` — the\n * host is in whichever container it was actually appended to. Re-showing a\n * popover moves nothing in the DOM, so this cannot re-trigger itself.\n */\n private watchForNewerOverlays(): void {\n const parent = this.overlayRef?.hostElement.parentElement;\n if (!parent || typeof MutationObserver === 'undefined') return;\n this.containerObserver = new MutationObserver(() => this.raiseHost());\n this.containerObserver.observe(parent, { childList: true });\n }\n\n private pushToHost(): void {\n this.hostRef?.instance.toasts.set(this.global.toasts());\n this.hostRef?.instance.queued.set(this.global.queued());\n }\n\n private disposeHost(): void {\n // The next host starts with nobody in it.\n this.global.setHeld(false);\n this.containerObserver?.disconnect();\n this.containerObserver = null;\n this.order.dropToasts();\n if (this.overlayRef) {\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.hostRef = null;\n }\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, effect, inject, input, untracked, viewChild } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrToastChannels } from './toast-channel';\nimport { WrToastHost } from './toast-host';\nimport { WR_TOAST_CONFIG } from './tokens';\nimport type { WrToastConfig, WrToastMode, WrToastPosition } from './types';\n\n/**\n * Renders a toast stack inside the page instead of the browser's top layer.\n *\n * `WrToast.show({ outlet: 'alarms' })` sends a toast to the outlet of that\n * name. Each name is a stack of its own: its cap, its countdown hold, its\n * \"Close all\". The global stack is not affected.\n *\n * The outlet fills its nearest positioned ancestor, so give the container\n * `position: relative`. It lets clicks through wherever no toast is, and it\n * carries no `z-index`: order it against its siblings in your own CSS.\n *\n * Past `maxStack` the OLDEST toast is dropped, where the global stack queues\n * the newest, so a busy stream stays at `maxStack` toasts and timers. While\n * the pointer or focus is in the stack nothing shown is dropped: arrivals\n * wait, at most `maxStack` of them, and enter when it leaves. A toast\n * sent while no outlet of the name is in the page waits, without counting\n * down, and shows when the outlet appears.\n *\n * @example\n * ```html\n * <div class=\"map\" style=\"position: relative\">\n * <wr-toast-outlet name=\"alarms\" position=\"top\" [maxStack]=\"10\" />\n * </div>\n * ```\n *\n * ```ts\n * toast.show({ type: 'danger', message: 'Door forced', outlet: 'alarms' });\n * toast.dismissAll('alarms');\n * ```\n *\n * @see https://ngwr.dev/reference/components/toast\n */\n@Component({\n selector: 'wr-toast-outlet',\n templateUrl: './toast-outlet.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-toast-outlet',\n '[attr.name]': 'name()',\n },\n imports: [WrToastHost],\n})\nexport class WrToastOutlet {\n private readonly config = inject(WR_TOAST_CONFIG);\n private readonly channels = inject(WrToastChannels);\n\n /** The channel this outlet renders: the `outlet` of `WrToast.show()`. */\n readonly name = input.required<string>();\n /** Where the stack sits inside the outlet's box. @default the `withToast()` position */\n readonly position = input<WrToastPosition>(this.config.position);\n /** Layout for several toasts: a cascade or a column. @default the `withToast()` mode */\n readonly mode = input<WrToastMode>(this.config.mode);\n /** Auto-dismiss in ms for a toast that sets none; `0` disables. @default the `withToast()` duration */\n readonly duration = input<number>(this.config.duration);\n /** Render the countdown bar. @default the `withToast()` value */\n readonly showProgress = input<boolean>(this.config.showProgress);\n /** Render a copy button on each toast. @default the `withToast()` value */\n readonly showCopy = input<boolean>(this.config.showCopy);\n /** Render \"Close all\" once the stack reaches the threshold. @default the `withToast()` value */\n readonly showCloseAll = input<boolean>(this.config.showCloseAll);\n /** Minimum stack size before \"Close all\" appears. @default the `withToast()` value */\n readonly closeAllThreshold = input<number>(this.config.closeAllThreshold);\n /**\n * Maximum toasts in the stack; `0` is unlimited. Past it the oldest toast is\n * dropped to make room, once the pointer and focus are out of the stack.\n *\n * @default the `withToast()` value\n */\n readonly maxStack = input<number>(this.config.maxStack);\n\n protected readonly channel = computed(() => this.channels.get(this.name()));\n\n /** The app-wide config with this outlet's own inputs over it. */\n protected readonly resolved = computed<WrToastConfig>(() => ({\n ...this.config,\n position: this.position(),\n mode: this.mode(),\n duration: this.duration(),\n showProgress: this.showProgress(),\n showCopy: this.showCopy(),\n showCloseAll: this.showCloseAll(),\n closeAllThreshold: this.closeAllThreshold(),\n maxStack: this.maxStack(),\n }));\n\n private readonly host = viewChild(WrToastHost);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('toast');\n\n effect(() => this.channel().configure(this.maxStack(), this.duration()));\n\n effect(onCleanup => {\n const channel = this.channel();\n // `mount()` reads the stack; tracked, every toast would remount the\n // channel and drop its hold.\n if (untracked(() => channel.mount()) > 1 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n // eslint-disable-next-line no-console -- dev-mode misconfiguration diagnostic\n console.warn(\n `[NGWR] Two <wr-toast-outlet> share the name \"${this.name()}\", so both render the same toasts. ` +\n 'Give each outlet its own name.'\n );\n }\n onCleanup(() => channel.unmount());\n });\n\n effect(() => this.push());\n }\n\n /** @internal */\n protected onDismissed(id: number): void {\n this.channel().remove(id);\n this.push();\n }\n\n /** @internal Closes first, like the global stack: `run` cannot fire twice. */\n protected onAction(id: number): void {\n const channel = this.channel();\n const action = channel.find(id)?.action;\n if (!action) return;\n channel.remove(id);\n this.push();\n action.run();\n }\n\n /** @internal */\n protected onDismissAll(): void {\n this.channel().clear();\n this.push();\n }\n\n /**\n * The host reads its list right after it asks for a removal, to decide where\n * focus goes, so a removal it asked for is pushed at once and not on the next\n * render.\n */\n private push(): void {\n this.host()?.toasts.set(this.channel().toasts());\n }\n}\n","@if (channel().toasts().length > 0) {\n <wr-toast-host\n [position]=\"position()\"\n [mode]=\"mode()\"\n [config]=\"resolved()\"\n (dismissed)=\"onDismissed($event)\"\n (actionRequested)=\"onAction($event)\"\n (dismissAllRequested)=\"onDismissAll()\"\n (pauseRequested)=\"channel().pause($event)\"\n (resumeRequested)=\"channel().resume($event)\"\n (holdChange)=\"channel().setHeld($event)\"\n />\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ApplicationRef, ENVIRONMENT_INITIALIZER, EnvironmentInjector, inject, isDevMode } from '@angular/core';\n\nimport { type WrFeature, wrFeature } from 'ngwr/utils';\n\nimport { DEFAULT_WR_TOAST_CONFIG } from './default-toast-config';\nimport { WR_TOAST_CONFIG } from './tokens';\nimport type { WrToastConfig } from './types';\n\n/**\n * Registers a global {@link WrToastConfig} for {@link WrToast}, as a feature of\n * `provideWr()`. Any field you omit falls back to {@link DEFAULT_WR_TOAST_CONFIG};\n * the `labels` sub-object is merged separately so you can override a single\n * string at a time (useful for i18n).\n *\n * @example\n * ```ts\n * import { provideWr } from 'ngwr';\n * import { withToast } from 'ngwr/toast';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWr(\n * withToast({\n * position: 'bottom-end',\n * showCopy: true,\n * maxStack: 3,\n * labels: { close: 'Закрыть' },\n * }),\n * ),\n * ],\n * });\n * ```\n *\n * **Bootstrap only, unlike the icon registry.** {@link WrToast} is\n * root-provided, so it reads this token once from the ROOT injector — a\n * `provideWr(withToast())` in a route's `providers` is never seen, and used to\n * be ignored in silence. It now warns in dev mode instead. By contrast\n * `provideWrIcons()` works at any level and chains, so a route may add icons to\n * the set its parent registered.\n */\nexport function withToast(\n config: Partial<Omit<WrToastConfig, 'labels'>> & { readonly labels?: Partial<WrToastConfig['labels']> }\n): WrFeature<'toast'> {\n const merged: WrToastConfig = {\n ...DEFAULT_WR_TOAST_CONFIG,\n ...config,\n labels: { ...DEFAULT_WR_TOAST_CONFIG.labels, ...config.labels },\n };\n return wrFeature('toast', [\n { provide: WR_TOAST_CONFIG, useValue: merged },\n ...(isDevMode()\n ? [\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: (): void => {\n // Compared by identity against the application's own injector: a\n // route creates a child EnvironmentInjector, and the root-provided\n // service will resolve the token from the root regardless of what\n // this one holds. Reported here rather than at the call site,\n // because a feature function cannot know where it was spread.\n const here = inject(EnvironmentInjector);\n if (here !== inject(ApplicationRef).injector) {\n // eslint-disable-next-line no-console -- dev-mode misconfiguration diagnostic\n console.warn(\n '[NGWR] withToast() is in a route or child injector, where WrToast will never read it — ' +\n 'the service is root-provided and resolves WR_TOAST_CONFIG once, from the root. Move ' +\n 'provideWr(withToast()) to the application providers, or set the same fields per call on toast.show().'\n );\n }\n },\n },\n ]\n : []),\n ]);\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAa,0BAAyC;CACpD,UAAU;CACV,MAAM;CACN,UAAU;CACV,cAAc;CACd,UAAU;CACV,cAAc;CACd,mBAAmB;CACnB,UAAU;CAGV,QAAQ;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,UAAU;CACX;AACF;;;;;;;ACdD,MAAa,kBAAkB,IAAI,eAA8B,mBAAmB;CAClF,YAAY;CACZ,eAAe;AAChB,CAAA;;;;;;;ACYD,IAAa,iBAAb,MAA2B;CAmBN;CACA;CACT;CACD;CACA;CArBA,SAAS,OAAgC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAE5C,SAAS,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,QAAwB,CAAA;CAGxB,OAAO;CAEP,SAAS;CAOjB,YACmB,QACA,OACT,MACD,UACA,UAAgB;EAJN,KAAA,SAAA;EACA,KAAA,QAAA;EACT,KAAA,OAAA;EACD,KAAA,WAAA;EACA,KAAA,WAAA;CACN;CAEH,IAAI,QAAK;EACP,OAAO,KAAK,OAAM,CAAE,CAAC,WAAW,KAAK,KAAK,MAAM,WAAW;CAC7D;CAEA,KAAK,IAAU;EACb,OAAO,KAAK,OA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CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,mBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,WAAW,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA;;;;;;;AEtD/C,SAAgB,UACd,QAAuG;CAEvG,MAAM,SAAwB;EAC5B,GAAG;EACH,GAAG;EACH,QAAQ;GAAE,GAAG,wBAAwB;GAAQ,GAAG,OAAO;EAAM;CAC9D;CACD,OAAO,UAAU,SAAS,CACxB;EAAE,SAAS;EAAiB,UAAU;CAAM,GAC5C,GAAI,UAAS,IACT,CACE;EACE,SAAS;EACT,OAAO;EACP,gBAAqB;GAOnB,IADa,OAAO,mBAChB,MAAS,OAAO,cAAc,CAAC,CAAC,UAElC,QAAQ,KACN,kRAEyG;EAG/G;CACD,CACF,IACD,CAAA,CACL,CAAA;AACH"}
@@ -87,7 +87,7 @@ var WrTransfer = class WrTransfer {
87
87
  canMoveRight = computed(() => !this.disabled() && !this.readonly() && this.source().checkedCount > 0, ...ngDevMode ? [{ debugName: "canMoveRight" }] : /* istanbul ignore next */ []);
88
88
  canMoveLeft = computed(() => !this.disabled() && !this.readonly() && this.target().checkedCount > 0, ...ngDevMode ? [{ debugName: "canMoveLeft" }] : /* istanbul ignore next */ []);
89
89
  classes = computed(() => {
90
- const parts = ["wr-transfer"];
90
+ const parts = [];
91
91
  if (this.disabled()) parts.push("wr-transfer--disabled");
92
92
  else if (this.readonly()) parts.push("wr-transfer--readonly");
93
93
  if (this.searchable()) parts.push("wr-transfer--searchable");
@@ -279,7 +279,8 @@ var WrTransfer = class WrTransfer {
279
279
  "attr.aria-labelledby": "labelledBy()",
280
280
  "attr.aria-invalid": "fieldAria.ariaInvalid()",
281
281
  "attr.aria-describedby": "fieldAria.describedBy()"
282
- }
282
+ },
283
+ classAttribute: "wr-transfer"
283
284
  },
284
285
  providers: [{
285
286
  provide: WR_FORM_FIELD,
@@ -344,6 +345,7 @@ i0.ɵɵngDeclareClassMetadata({
344
345
  selector: "wr-transfer",
345
346
  encapsulation: ViewEncapsulation.None,
346
347
  host: {
348
+ class: "wr-transfer",
347
349
  "[class]": "classes()",
348
350
  role: "group",
349
351
  "[attr.aria-labelledby]": "labelledBy()",
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-transfer.mjs","names":[],"sources":["../../../projects/lib/transfer/transfer.ts","../../../projects/lib/transfer/transfer.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n HostAttributeToken,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrInput } from 'ngwr/input';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTransferItem } from './types';\n\n/** A pane's rows plus the header state derived from them. */\ninterface PaneState {\n readonly rows: readonly WrTransferItem[];\n /**\n * The staged values this pane is actually SHOWING — visible and enabled. The\n * staging signals can hold more than that (a filter change hides rows without\n * unstaging them), and every consumer of the staged set has to agree on which\n * one it means: the count, the header checkbox and the move all read this.\n */\n readonly checked: readonly unknown[];\n readonly checkedCount: number;\n readonly enabledCount: number;\n readonly allChecked: boolean;\n readonly someChecked: boolean;\n}\n\n/**\n * Dual-listbox picker: two panes and the buttons that move rows between them.\n *\n * The full item set is `[items]` and the RIGHT pane is the value — `[(value)]`\n * holds the chosen `WrTransferItem['value']`s, everything else stays left. The\n * checked state inside each pane is transient staging, deliberately not part of\n * the value: what a form cares about is which rows ended up on the right.\n *\n * A signal-forms native control (`FormValueControl<readonly unknown[]>`), so\n * `[formField]` binds straight to `value`; `[(ngModel)]` and reactive forms keep\n * working through Angular's bridge, and `[(value)]` is the standalone shape.\n *\n * @example\n * ```html\n * <!-- Standalone -->\n * <wr-transfer [items]=\"permissions\" [(value)]=\"granted\" />\n *\n * <!-- Searchable, with pane titles -->\n * <wr-transfer\n * searchable\n * sourceTitle=\"Available\"\n * targetTitle=\"Granted\"\n * [items]=\"permissions\"\n * [formField]=\"form.granted\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/transfer\n */\n@Component({\n selector: 'wr-transfer',\n templateUrl: './transfer.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n // `role=\"group\"` so the error state below has somewhere legible to live: the\n // control is a composite with no single element carrying its semantics, and\n // `aria-invalid` on a bare `generic` host is announced by nothing.\n role: 'group',\n // See `wr-checkbox-group`: not labelable, so the field's label named\n // nothing and the composite announced only its inner parts.\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-invalid]': 'fieldAria.ariaInvalid()',\n '[attr.aria-describedby]': 'fieldAria.describedBy()',\n },\n // The transfer is the control a `<wr-form-field>` wraps; the checkboxes and\n // the search inputs in its own template are parts, not controls. Without this\n // shield each of them found the field's token and announced the one error as\n // its own — which is why `fieldAria` below reads the field with `skipSelf`.\n providers: [{ provide: WR_FORM_FIELD, useValue: null }],\n imports: [WrButton, WrCheckbox, WrInput],\n})\nexport class WrTransfer implements FormValueControl<readonly unknown[]> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('transfer');\n if (typeof ngDevMode === 'undefined' || ngDevMode) effect(() => this.warnAboutOrphans(this.orphans()));\n }\n\n /** Every row, in either pane. Membership of the right pane is `value`. */\n readonly items = input<readonly WrTransferItem[]>([]);\n\n /**\n * Values currently in the RIGHT pane. Two-way bindable; bound automatically\n * by `[formField]` / `[(ngModel)]`.\n */\n readonly value = model<readonly unknown[]>([]);\n\n /** Emitted on blur / commit so a bound field marks itself touched. */\n readonly touch = output<void>();\n\n /** Disable the whole control. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes to the value while both panes stay focusable and readable.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The move buttons go inert and the row checkboxes go read-only; SEARCH keeps\n * working, because filtering a pane changes what is shown and not what is\n * chosen. No `aria-readonly` on the host: role `group` does not support the\n * state, so each row's checkbox mirrors its own instead.\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({ skipSelf: true });\n /**\n * The author's own `aria-labelledby`, read as a static host attribute.\n *\n * A host binding WRITES the attribute, so binding the field's label\n * unconditionally would REMOVE a reference the consumer put there by hand:\n * `<wr-segmented aria-labelledby=\"range-question\">` went nameless the moment\n * the field's label was `null`, which a harness spec caught one commit after\n * it was introduced. `HostAttributeToken` reads it at construction without\n * touching the DOM, so this stays SSR-safe, and the author's own reference\n * wins — the same precedence `[ariaLabel]` has everywhere else.\n */\n private readonly ownLabelledBy = inject(new HostAttributeToken('aria-labelledby'), { optional: true });\n\n /** The surrounding field's label, unless the author named the control. */\n protected readonly labelledBy = computed(() => this.ownLabelledBy ?? this.fieldAria.labelledBy());\n\n /** Show a filter box above each pane. @default false */\n readonly searchable = input(false, { transform: coerceBooleanProperty });\n\n /** Heading above the left pane. Falls back to `transfer.source`. */\n readonly sourceTitle = input<string | null>(null);\n\n /** Heading above the right pane. Falls back to `transfer.target`. */\n readonly targetTitle = input<string | null>(null);\n\n /** Placeholder in both filter boxes. Falls back to `transfer.search`. */\n readonly searchPlaceholder = input<string | null>(null);\n\n /** Shown in a pane with no rows. Falls back to `transfer.empty`. */\n readonly emptyText = input<string | null>(null);\n\n /**\n * Accessible name of each pane's select-all checkbox, composed with the pane\n * heading. Falls back to `transfer.selectAll`.\n */\n readonly selectAllLabel = input<string | null>(null);\n\n /** Accessible name of the move-right button. Falls back to `transfer.toTarget`. */\n readonly toTargetLabel = input<string | null>(null);\n\n /** Accessible name of the move-left button. Falls back to `transfer.toSource`. */\n readonly toSourceLabel = input<string | null>(null);\n\n protected readonly resolvedSourceTitle = useI18nText(this.sourceTitle, 'transfer.source', 'Available');\n protected readonly resolvedTargetTitle = useI18nText(this.targetTitle, 'transfer.target', 'Selected');\n protected readonly resolvedSearch = useI18nText(this.searchPlaceholder, 'transfer.search', 'Search');\n protected readonly resolvedEmpty = useI18nText(this.emptyText, 'transfer.empty', 'Nothing here');\n protected readonly resolvedSelectAll = useI18nText(this.selectAllLabel, 'transfer.selectAll', 'Select all');\n\n /**\n * The select-all checkbox's accessible name, composed IN THE CATALOG.\n *\n * It used to be a template literal — `` `${title} — ${selectAll}` `` — which\n * froze both the separator and the operand order into English. A translator\n * could change each half and not the sentence they make, which is the exact\n * defect the calendar and event-calendar catalogs were rewritten to remove.\n * The key ships as `{{pane}} — {{action}}` in every locale, so nothing reads\n * differently today and every locale can now reorder it without a code change.\n */\n protected readonly selectAllAria = useI18nFormatter('transfer.selectAllAria', '{{pane}} — {{action}}');\n protected readonly resolvedToTarget = useI18nText(this.toTargetLabel, 'transfer.toTarget', 'Move to selected');\n protected readonly resolvedToSource = useI18nText(this.toSourceLabel, 'transfer.toSource', 'Move to available');\n\n /** `{{checked}} / {{total}}` under each heading. @internal */\n protected readonly countLabel = useI18nFormatter('transfer.count', '{{checked}} / {{total}}');\n\n /** Pane order — the template iterates it so both panes share one block. */\n protected readonly panes = ['source', 'target'] as const;\n\n private readonly sourceQuery = signal('');\n private readonly targetQuery = signal('');\n\n /** Staged rows, per pane. Cleared as soon as a move commits them. */\n private readonly sourceChecked = signal<readonly unknown[]>([]);\n private readonly targetChecked = signal<readonly unknown[]>([]);\n\n // The value as a guaranteed array — a classic-forms binding can write null even\n // though the type is `readonly unknown[]`, so normalise every read. Same hazard\n // `wr-checkbox-group` guards; here an unguarded `.map` threw outright.\n private readonly selected = computed<readonly unknown[]>(() => {\n const v = this.value();\n return Array.isArray(v) ? v : [];\n });\n\n private readonly valueSet = computed(() => new Set(this.selected()));\n\n protected readonly source = computed<PaneState>(() =>\n this.pane(\n this.items().filter(item => !this.valueSet().has(item.value)),\n this.sourceQuery(),\n this.sourceChecked()\n )\n );\n\n /** The first item per value, which is the one a scan of `items` would find. */\n private readonly itemByValue = computed(() => {\n const map = new Map<unknown, WrTransferItem>();\n for (const item of this.items()) if (!map.has(item.value)) map.set(item.value, item);\n return map;\n });\n\n // Right-pane order follows `value`, not `items`: the order a user built is\n // the one they expect to read back. Resolved apart from `target`, so a\n // keystroke in the filter or a ticked row does not walk the value again.\n private readonly targetRows = computed<readonly WrTransferItem[]>(() => {\n const byValue = this.itemByValue();\n return this.selected()\n .map(v => byValue.get(v))\n .filter((item): item is WrTransferItem => item !== undefined);\n });\n\n protected readonly target = computed<PaneState>(() =>\n this.pane(this.targetRows(), this.targetQuery(), this.targetChecked())\n );\n\n /** Values no item matches. Equal by content, so its reader runs once per distinct set. */\n private readonly orphans = computed<readonly unknown[]>(\n () => {\n const byValue = this.itemByValue();\n return this.selected().filter(v => !byValue.has(v));\n },\n { equal: (a, b) => a.length === b.length && a.every((v, i) => Object.is(v, b[i])) }\n );\n\n /**\n * Say something when `value` holds a value no `items` entry matches.\n *\n * Such a value is in NEITHER pane — the left one filters out anything already\n * selected and the right one can only render rows it found — and the header\n * counts the rows it shows, so nothing on screen contradicts anything. The\n * result is a value the user can neither see nor remove, and no sign that it\n * is there.\n *\n * A warning rather than an invented row, which matches how the library treats\n * the same question elsewhere: `wr-select` renders a value outside its option\n * list only under an explicit `freeText`, so an unmatched value is a mode a\n * consumer opts into, not a shape a component guesses at. It also stays quiet\n * about the common transient case — `items` arriving after `value` — because\n * the message names the values and a developer can see them settle.\n */\n private warnAboutOrphans(orphans: readonly unknown[]): void {\n if (orphans.length === 0) return;\n\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-transfer>: ${orphans.length} value(s) in \\`value\\` match no \\`items\\` entry ` +\n `and are rendered in neither pane, so a user can neither see nor remove them: ` +\n `${orphans.map(v => JSON.stringify(v)).join(', ')}. ` +\n `If \\`items\\` loads after \\`value\\`, this settles on its own.`\n );\n }\n\n protected readonly canMoveRight = computed(\n () => !this.disabled() && !this.readonly() && this.source().checkedCount > 0\n );\n protected readonly canMoveLeft = computed(\n () => !this.disabled() && !this.readonly() && this.target().checkedCount > 0\n );\n\n protected readonly classes = computed(() => {\n const parts = ['wr-transfer'];\n if (this.disabled()) parts.push('wr-transfer--disabled');\n else if (this.readonly()) parts.push('wr-transfer--readonly');\n if (this.searchable()) parts.push('wr-transfer--searchable');\n return parts.join(' ');\n });\n\n protected isChecked(pane: 'source' | 'target', item: WrTransferItem): boolean {\n return (pane === 'source' ? this.sourceChecked() : this.targetChecked()).includes(item.value);\n }\n\n protected toggle(pane: 'source' | 'target', item: WrTransferItem, checked: boolean): void {\n if (item.disabled || this.readonly()) return;\n const box = pane === 'source' ? this.sourceChecked : this.targetChecked;\n const current = box();\n if (checked) {\n box.set([...current, item.value]);\n return;\n }\n // A `Set` compares with SameValueZero, which is what `WrTransferItem['value']`\n // is documented to use and what `isChecked`'s `includes` already does. A `!==`\n // filter cannot remove `NaN` from its own list, so such a row drew itself\n // unchecked while staying staged.\n const next = new Set(current);\n next.delete(item.value);\n box.set([...next]);\n }\n\n /**\n * Header checkbox — stages or clears every enabled row the filter shows, and\n * only those. Staging outlives a filter change, so a row the filter hides keeps\n * whatever state it had: setting the whole box here unstaged hidden rows on a\n * clear and dropped them on a select, which the pane only revealed once the\n * search was emptied.\n */\n protected toggleAll(pane: 'source' | 'target', checked: boolean): void {\n if (this.readonly()) return;\n const state = pane === 'source' ? this.source() : this.target();\n const box = pane === 'source' ? this.sourceChecked : this.targetChecked;\n const next = new Set(box());\n for (const item of state.rows) {\n if (item.disabled) continue;\n if (checked) next.add(item.value);\n else next.delete(item.value);\n }\n box.set([...next]);\n }\n\n protected onSearch(pane: 'source' | 'target', event: Event): void {\n const query = (event.target as HTMLInputElement | null)?.value ?? '';\n (pane === 'source' ? this.sourceQuery : this.targetQuery).set(query);\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n /**\n * Focus the transfer — what Signal Forms calls to focus this control. The\n * host is a `group` with no tab stop of its own, so focus goes to the left\n * pane's filter when the panes are searchable, otherwise to the first row that\n * can still be ticked — on the right, once nothing on the left can be.\n *\n * The pane's select-all box comes first in the tab order and is passed over\n * on purpose: it acts on every row at once, and a form pointing at the field\n * is asking for a choice. A disabled transfer has nothing left to focus.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement\n .querySelector<HTMLInputElement>(\n '.wr-transfer__search input:not([disabled]), .wr-transfer__item input:not([disabled])'\n )\n ?.focus(options);\n }\n\n /**\n * Keep focus in the widget after a move.\n *\n * A move empties the pane's staging set, which is exactly what disables the\n * button that was just pressed — so the element holding DOM focus went\n * `disabled` as a RESULT of its own activation and the browser dropped focus\n * to `<body>`. From there the next Tab restarts at the top of the document,\n * which for a keyboard user is being thrown out of a control they were in the\n * middle of using.\n *\n * The landing is the FIRST ROW OF THE PANE THE ROWS ARRIVED IN, and the\n * obvious alternative does not work: after a move BOTH buttons are disabled,\n * because each needs something ticked and the move cleared the tick on one\n * side and arrived unticked on the other. The rows that just moved are where\n * the user's attention is and where the next action lives, so that is where\n * focus goes.\n *\n * `afterNextRender`, not `queueMicrotask`: under zoneless CD the microtask\n * runs before the moved rows are in the DOM, so the focus call would land on\n * the pane as it was before the move.\n */\n private restoreFocusAfterMove(landing: 'source' | 'target'): void {\n afterNextRender(\n () => {\n const root = this.host.nativeElement;\n const pane =\n landing === 'target'\n ? root.querySelector<HTMLElement>('.wr-transfer__pane--target')\n : root.querySelector<HTMLElement>('.wr-transfer__pane:not(.wr-transfer__pane--target)');\n const row = pane?.querySelector<HTMLInputElement>('.wr-transfer__item input:not([disabled])');\n row?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected moveRight(): void {\n if (this.disabled() || this.readonly()) return;\n // `source().checked`, not the raw staging box: rows a filter change hid are\n // neither counted nor ticked any more, so moving them would transfer rows the\n // pane never showed as chosen — and, since staging outlives an external write\n // to `value`, could land the same value on the right twice.\n const moving = this.source().checked;\n if (moving.length === 0) return;\n this.value.set([...this.selected(), ...moving]);\n this.sourceChecked.set([]);\n this.touch.emit();\n this.restoreFocusAfterMove('target');\n }\n\n protected moveLeft(): void {\n if (this.disabled() || this.readonly()) return;\n const moving = new Set(this.target().checked);\n if (moving.size === 0) return;\n this.value.set(this.selected().filter(v => !moving.has(v)));\n this.targetChecked.set([]);\n this.touch.emit();\n this.restoreFocusAfterMove('source');\n }\n\n /** Filter, then derive the header state from what survived. */\n private pane(rows: readonly WrTransferItem[], query: string, checked: readonly unknown[]): PaneState {\n const q = query.trim().toLowerCase();\n const visible = q ? rows.filter(item => item.label.toLowerCase().includes(q)) : rows;\n const enabled = visible.filter(item => !item.disabled);\n const staged = new Set(checked);\n const shown = enabled.filter(item => staged.has(item.value)).map(item => item.value);\n return {\n rows: visible,\n checked: shown,\n checkedCount: shown.length,\n enabledCount: enabled.length,\n allChecked: enabled.length > 0 && shown.length === enabled.length,\n someChecked: shown.length > 0 && shown.length < enabled.length,\n };\n }\n}\n","<!--\n Two panes and the buttons between them. Each pane is a PLAIN `<ul>` of\n checkboxes, deliberately: dressing it as a `role=\"listbox\"` of `role=\"option\"`\n rows reads better in the abstract but is invalid — an option may not contain an\n interactive control, and the axe gate says so. The checkbox is the thing the\n user operates, so it is the thing the semantics should describe; the pane\n heading names the group.\n-->\n@for (pane of panes; track pane) {\n @let state = pane === 'source' ? source() : target();\n @let title = pane === 'source' ? resolvedSourceTitle() : resolvedTargetTitle();\n\n <div class=\"wr-transfer__pane\" [class.wr-transfer__pane--target]=\"pane === 'target'\">\n <div class=\"wr-transfer__head\">\n <wr-checkbox\n size=\"sm\"\n [checked]=\"state.allChecked\"\n [indeterminate]=\"state.someChecked\"\n [disabled]=\"disabled() || state.enabledCount === 0\"\n [readonly]=\"readonly()\"\n [ariaLabel]=\"selectAllAria({ action: resolvedSelectAll(), pane: title })\"\n (checkedChange)=\"toggleAll(pane, $event)\"\n />\n <span class=\"wr-transfer__title\">{{ title }}</span>\n <span class=\"wr-transfer__count\">{{\n countLabel({ checked: state.checkedCount, total: state.rows.length })\n }}</span>\n </div>\n\n @if (searchable()) {\n <div class=\"wr-transfer__search\">\n <input\n wrInput\n size=\"sm\"\n type=\"search\"\n [placeholder]=\"resolvedSearch()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"`${title} — ${resolvedSearch()}`\"\n (input)=\"onSearch(pane, $event)\"\n />\n </div>\n }\n\n <ul class=\"wr-transfer__list\" [attr.aria-label]=\"title\">\n @for (item of state.rows; track item.value) {\n <li class=\"wr-transfer__item\" [class.wr-transfer__item--disabled]=\"item.disabled\">\n <wr-checkbox\n size=\"sm\"\n [checked]=\"isChecked(pane, item)\"\n [disabled]=\"disabled() || !!item.disabled\"\n [readonly]=\"readonly()\"\n (checkedChange)=\"toggle(pane, item, $event)\"\n (touch)=\"touch.emit()\"\n >\n {{ item.label }}\n </wr-checkbox>\n </li>\n } @empty {\n <li class=\"wr-transfer__empty\">{{ resolvedEmpty() }}</li>\n }\n </ul>\n </div>\n\n <!-- The buttons live between the panes, so they are emitted after the first. -->\n @if (pane === 'source') {\n <div class=\"wr-transfer__actions\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n color=\"primary\"\n outlined\n class=\"wr-transfer__move wr-transfer__move--to-target\"\n [disabled]=\"!canMoveRight()\"\n [attr.aria-label]=\"resolvedToTarget()\"\n (click)=\"moveRight()\"\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=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n color=\"primary\"\n outlined\n class=\"wr-transfer__move wr-transfer__move--to-source\"\n [disabled]=\"!canMoveLeft()\"\n [attr.aria-label]=\"resolvedToSource()\"\n (click)=\"moveLeft()\"\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=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n </div>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsGA,IAAa,aAAb,MAAa,WAAU;CACrB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,UAAU;EAC3E,IAAI,OAAO,cAAc,eAAe,WAAW,aAAa,KAAK,iBAAiB,KAAK,QAAO,CAAE,CAAC;CACvG;CAGS,QAAQ,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAM5C,QAAQ,MAA0B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,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AA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,iBAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAO,UAAA;IAAA,QAAA,CAAA,QAAA,SAAA;GAAA;EAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAE5B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EAvBtB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,eAER,kBAAkB;GAAI,MAC/B;IACJ,WAAW;IAIX,MAAM;IAGN,0BAA0B;IAC1B,uBAAuB;IACvB,2BAA2B;GAC5B;GAAA,WAKU,CAAC;IAAE,SAAS;IAAe,UAAU;GAAI,CAAE;GAAC,SAC9C;IAAC;IAAU;IAAY;GAAO;GAAC,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-transfer.mjs","names":[],"sources":["../../../projects/lib/transfer/transfer.ts","../../../projects/lib/transfer/transfer.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n HostAttributeToken,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrInput } from 'ngwr/input';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrTransferItem } from './types';\n\n/** A pane's rows plus the header state derived from them. */\ninterface PaneState {\n readonly rows: readonly WrTransferItem[];\n /**\n * The staged values this pane is actually SHOWING — visible and enabled. The\n * staging signals can hold more than that (a filter change hides rows without\n * unstaging them), and every consumer of the staged set has to agree on which\n * one it means: the count, the header checkbox and the move all read this.\n */\n readonly checked: readonly unknown[];\n readonly checkedCount: number;\n readonly enabledCount: number;\n readonly allChecked: boolean;\n readonly someChecked: boolean;\n}\n\n/**\n * Dual-listbox picker: two panes and the buttons that move rows between them.\n *\n * The full item set is `[items]` and the RIGHT pane is the value — `[(value)]`\n * holds the chosen `WrTransferItem['value']`s, everything else stays left. The\n * checked state inside each pane is transient staging, deliberately not part of\n * the value: what a form cares about is which rows ended up on the right.\n *\n * A signal-forms native control (`FormValueControl<readonly unknown[]>`), so\n * `[formField]` binds straight to `value`; `[(ngModel)]` and reactive forms keep\n * working through Angular's bridge, and `[(value)]` is the standalone shape.\n *\n * @example\n * ```html\n * <!-- Standalone -->\n * <wr-transfer [items]=\"permissions\" [(value)]=\"granted\" />\n *\n * <!-- Searchable, with pane titles -->\n * <wr-transfer\n * searchable\n * sourceTitle=\"Available\"\n * targetTitle=\"Granted\"\n * [items]=\"permissions\"\n * [formField]=\"form.granted\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/transfer\n */\n@Component({\n selector: 'wr-transfer',\n templateUrl: './transfer.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-transfer',\n '[class]': 'classes()',\n // `role=\"group\"` so the error state below has somewhere legible to live: the\n // control is a composite with no single element carrying its semantics, and\n // `aria-invalid` on a bare `generic` host is announced by nothing.\n role: 'group',\n // See `wr-checkbox-group`: not labelable, so the field's label named\n // nothing and the composite announced only its inner parts.\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-invalid]': 'fieldAria.ariaInvalid()',\n '[attr.aria-describedby]': 'fieldAria.describedBy()',\n },\n // The transfer is the control a `<wr-form-field>` wraps; the checkboxes and\n // the search inputs in its own template are parts, not controls. Without this\n // shield each of them found the field's token and announced the one error as\n // its own — which is why `fieldAria` below reads the field with `skipSelf`.\n providers: [{ provide: WR_FORM_FIELD, useValue: null }],\n imports: [WrButton, WrCheckbox, WrInput],\n})\nexport class WrTransfer implements FormValueControl<readonly unknown[]> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('transfer');\n if (typeof ngDevMode === 'undefined' || ngDevMode) effect(() => this.warnAboutOrphans(this.orphans()));\n }\n\n /** Every row, in either pane. Membership of the right pane is `value`. */\n readonly items = input<readonly WrTransferItem[]>([]);\n\n /**\n * Values currently in the RIGHT pane. Two-way bindable; bound automatically\n * by `[formField]` / `[(ngModel)]`.\n */\n readonly value = model<readonly unknown[]>([]);\n\n /** Emitted on blur / commit so a bound field marks itself touched. */\n readonly touch = output<void>();\n\n /** Disable the whole control. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes to the value while both panes stay focusable and readable.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The move buttons go inert and the row checkboxes go read-only; SEARCH keeps\n * working, because filtering a pane changes what is shown and not what is\n * chosen. No `aria-readonly` on the host: role `group` does not support the\n * state, so each row's checkbox mirrors its own instead.\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({ skipSelf: true });\n /**\n * The author's own `aria-labelledby`, read as a static host attribute.\n *\n * A host binding WRITES the attribute, so binding the field's label\n * unconditionally would REMOVE a reference the consumer put there by hand:\n * `<wr-segmented aria-labelledby=\"range-question\">` went nameless the moment\n * the field's label was `null`, which a harness spec caught one commit after\n * it was introduced. `HostAttributeToken` reads it at construction without\n * touching the DOM, so this stays SSR-safe, and the author's own reference\n * wins — the same precedence `[ariaLabel]` has everywhere else.\n */\n private readonly ownLabelledBy = inject(new HostAttributeToken('aria-labelledby'), { optional: true });\n\n /** The surrounding field's label, unless the author named the control. */\n protected readonly labelledBy = computed(() => this.ownLabelledBy ?? this.fieldAria.labelledBy());\n\n /** Show a filter box above each pane. @default false */\n readonly searchable = input(false, { transform: coerceBooleanProperty });\n\n /** Heading above the left pane. Falls back to `transfer.source`. */\n readonly sourceTitle = input<string | null>(null);\n\n /** Heading above the right pane. Falls back to `transfer.target`. */\n readonly targetTitle = input<string | null>(null);\n\n /** Placeholder in both filter boxes. Falls back to `transfer.search`. */\n readonly searchPlaceholder = input<string | null>(null);\n\n /** Shown in a pane with no rows. Falls back to `transfer.empty`. */\n readonly emptyText = input<string | null>(null);\n\n /**\n * Accessible name of each pane's select-all checkbox, composed with the pane\n * heading. Falls back to `transfer.selectAll`.\n */\n readonly selectAllLabel = input<string | null>(null);\n\n /** Accessible name of the move-right button. Falls back to `transfer.toTarget`. */\n readonly toTargetLabel = input<string | null>(null);\n\n /** Accessible name of the move-left button. Falls back to `transfer.toSource`. */\n readonly toSourceLabel = input<string | null>(null);\n\n protected readonly resolvedSourceTitle = useI18nText(this.sourceTitle, 'transfer.source', 'Available');\n protected readonly resolvedTargetTitle = useI18nText(this.targetTitle, 'transfer.target', 'Selected');\n protected readonly resolvedSearch = useI18nText(this.searchPlaceholder, 'transfer.search', 'Search');\n protected readonly resolvedEmpty = useI18nText(this.emptyText, 'transfer.empty', 'Nothing here');\n protected readonly resolvedSelectAll = useI18nText(this.selectAllLabel, 'transfer.selectAll', 'Select all');\n\n /**\n * The select-all checkbox's accessible name, composed IN THE CATALOG.\n *\n * It used to be a template literal — `` `${title} — ${selectAll}` `` — which\n * froze both the separator and the operand order into English. A translator\n * could change each half and not the sentence they make, which is the exact\n * defect the calendar and event-calendar catalogs were rewritten to remove.\n * The key ships as `{{pane}} — {{action}}` in every locale, so nothing reads\n * differently today and every locale can now reorder it without a code change.\n */\n protected readonly selectAllAria = useI18nFormatter('transfer.selectAllAria', '{{pane}} — {{action}}');\n protected readonly resolvedToTarget = useI18nText(this.toTargetLabel, 'transfer.toTarget', 'Move to selected');\n protected readonly resolvedToSource = useI18nText(this.toSourceLabel, 'transfer.toSource', 'Move to available');\n\n /** `{{checked}} / {{total}}` under each heading. @internal */\n protected readonly countLabel = useI18nFormatter('transfer.count', '{{checked}} / {{total}}');\n\n /** Pane order — the template iterates it so both panes share one block. */\n protected readonly panes = ['source', 'target'] as const;\n\n private readonly sourceQuery = signal('');\n private readonly targetQuery = signal('');\n\n /** Staged rows, per pane. Cleared as soon as a move commits them. */\n private readonly sourceChecked = signal<readonly unknown[]>([]);\n private readonly targetChecked = signal<readonly unknown[]>([]);\n\n // The value as a guaranteed array — a classic-forms binding can write null even\n // though the type is `readonly unknown[]`, so normalise every read. Same hazard\n // `wr-checkbox-group` guards; here an unguarded `.map` threw outright.\n private readonly selected = computed<readonly unknown[]>(() => {\n const v = this.value();\n return Array.isArray(v) ? v : [];\n });\n\n private readonly valueSet = computed(() => new Set(this.selected()));\n\n protected readonly source = computed<PaneState>(() =>\n this.pane(\n this.items().filter(item => !this.valueSet().has(item.value)),\n this.sourceQuery(),\n this.sourceChecked()\n )\n );\n\n /** The first item per value, which is the one a scan of `items` would find. */\n private readonly itemByValue = computed(() => {\n const map = new Map<unknown, WrTransferItem>();\n for (const item of this.items()) if (!map.has(item.value)) map.set(item.value, item);\n return map;\n });\n\n // Right-pane order follows `value`, not `items`: the order a user built is\n // the one they expect to read back. Resolved apart from `target`, so a\n // keystroke in the filter or a ticked row does not walk the value again.\n private readonly targetRows = computed<readonly WrTransferItem[]>(() => {\n const byValue = this.itemByValue();\n return this.selected()\n .map(v => byValue.get(v))\n .filter((item): item is WrTransferItem => item !== undefined);\n });\n\n protected readonly target = computed<PaneState>(() =>\n this.pane(this.targetRows(), this.targetQuery(), this.targetChecked())\n );\n\n /** Values no item matches. Equal by content, so its reader runs once per distinct set. */\n private readonly orphans = computed<readonly unknown[]>(\n () => {\n const byValue = this.itemByValue();\n return this.selected().filter(v => !byValue.has(v));\n },\n { equal: (a, b) => a.length === b.length && a.every((v, i) => Object.is(v, b[i])) }\n );\n\n /**\n * Say something when `value` holds a value no `items` entry matches.\n *\n * Such a value is in NEITHER pane — the left one filters out anything already\n * selected and the right one can only render rows it found — and the header\n * counts the rows it shows, so nothing on screen contradicts anything. The\n * result is a value the user can neither see nor remove, and no sign that it\n * is there.\n *\n * A warning rather than an invented row, which matches how the library treats\n * the same question elsewhere: `wr-select` renders a value outside its option\n * list only under an explicit `freeText`, so an unmatched value is a mode a\n * consumer opts into, not a shape a component guesses at. It also stays quiet\n * about the common transient case — `items` arriving after `value` — because\n * the message names the values and a developer can see them settle.\n */\n private warnAboutOrphans(orphans: readonly unknown[]): void {\n if (orphans.length === 0) return;\n\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-transfer>: ${orphans.length} value(s) in \\`value\\` match no \\`items\\` entry ` +\n `and are rendered in neither pane, so a user can neither see nor remove them: ` +\n `${orphans.map(v => JSON.stringify(v)).join(', ')}. ` +\n `If \\`items\\` loads after \\`value\\`, this settles on its own.`\n );\n }\n\n protected readonly canMoveRight = computed(\n () => !this.disabled() && !this.readonly() && this.source().checkedCount > 0\n );\n protected readonly canMoveLeft = computed(\n () => !this.disabled() && !this.readonly() && this.target().checkedCount > 0\n );\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.disabled()) parts.push('wr-transfer--disabled');\n else if (this.readonly()) parts.push('wr-transfer--readonly');\n if (this.searchable()) parts.push('wr-transfer--searchable');\n return parts.join(' ');\n });\n\n protected isChecked(pane: 'source' | 'target', item: WrTransferItem): boolean {\n return (pane === 'source' ? this.sourceChecked() : this.targetChecked()).includes(item.value);\n }\n\n protected toggle(pane: 'source' | 'target', item: WrTransferItem, checked: boolean): void {\n if (item.disabled || this.readonly()) return;\n const box = pane === 'source' ? this.sourceChecked : this.targetChecked;\n const current = box();\n if (checked) {\n box.set([...current, item.value]);\n return;\n }\n // A `Set` compares with SameValueZero, which is what `WrTransferItem['value']`\n // is documented to use and what `isChecked`'s `includes` already does. A `!==`\n // filter cannot remove `NaN` from its own list, so such a row drew itself\n // unchecked while staying staged.\n const next = new Set(current);\n next.delete(item.value);\n box.set([...next]);\n }\n\n /**\n * Header checkbox — stages or clears every enabled row the filter shows, and\n * only those. Staging outlives a filter change, so a row the filter hides keeps\n * whatever state it had: setting the whole box here unstaged hidden rows on a\n * clear and dropped them on a select, which the pane only revealed once the\n * search was emptied.\n */\n protected toggleAll(pane: 'source' | 'target', checked: boolean): void {\n if (this.readonly()) return;\n const state = pane === 'source' ? this.source() : this.target();\n const box = pane === 'source' ? this.sourceChecked : this.targetChecked;\n const next = new Set(box());\n for (const item of state.rows) {\n if (item.disabled) continue;\n if (checked) next.add(item.value);\n else next.delete(item.value);\n }\n box.set([...next]);\n }\n\n protected onSearch(pane: 'source' | 'target', event: Event): void {\n const query = (event.target as HTMLInputElement | null)?.value ?? '';\n (pane === 'source' ? this.sourceQuery : this.targetQuery).set(query);\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n /**\n * Focus the transfer — what Signal Forms calls to focus this control. The\n * host is a `group` with no tab stop of its own, so focus goes to the left\n * pane's filter when the panes are searchable, otherwise to the first row that\n * can still be ticked — on the right, once nothing on the left can be.\n *\n * The pane's select-all box comes first in the tab order and is passed over\n * on purpose: it acts on every row at once, and a form pointing at the field\n * is asking for a choice. A disabled transfer has nothing left to focus.\n */\n focus(options?: FocusOptions): void {\n this.host.nativeElement\n .querySelector<HTMLInputElement>(\n '.wr-transfer__search input:not([disabled]), .wr-transfer__item input:not([disabled])'\n )\n ?.focus(options);\n }\n\n /**\n * Keep focus in the widget after a move.\n *\n * A move empties the pane's staging set, which is exactly what disables the\n * button that was just pressed — so the element holding DOM focus went\n * `disabled` as a RESULT of its own activation and the browser dropped focus\n * to `<body>`. From there the next Tab restarts at the top of the document,\n * which for a keyboard user is being thrown out of a control they were in the\n * middle of using.\n *\n * The landing is the FIRST ROW OF THE PANE THE ROWS ARRIVED IN, and the\n * obvious alternative does not work: after a move BOTH buttons are disabled,\n * because each needs something ticked and the move cleared the tick on one\n * side and arrived unticked on the other. The rows that just moved are where\n * the user's attention is and where the next action lives, so that is where\n * focus goes.\n *\n * `afterNextRender`, not `queueMicrotask`: under zoneless CD the microtask\n * runs before the moved rows are in the DOM, so the focus call would land on\n * the pane as it was before the move.\n */\n private restoreFocusAfterMove(landing: 'source' | 'target'): void {\n afterNextRender(\n () => {\n const root = this.host.nativeElement;\n const pane =\n landing === 'target'\n ? root.querySelector<HTMLElement>('.wr-transfer__pane--target')\n : root.querySelector<HTMLElement>('.wr-transfer__pane:not(.wr-transfer__pane--target)');\n const row = pane?.querySelector<HTMLInputElement>('.wr-transfer__item input:not([disabled])');\n row?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected moveRight(): void {\n if (this.disabled() || this.readonly()) return;\n // `source().checked`, not the raw staging box: rows a filter change hid are\n // neither counted nor ticked any more, so moving them would transfer rows the\n // pane never showed as chosen — and, since staging outlives an external write\n // to `value`, could land the same value on the right twice.\n const moving = this.source().checked;\n if (moving.length === 0) return;\n this.value.set([...this.selected(), ...moving]);\n this.sourceChecked.set([]);\n this.touch.emit();\n this.restoreFocusAfterMove('target');\n }\n\n protected moveLeft(): void {\n if (this.disabled() || this.readonly()) return;\n const moving = new Set(this.target().checked);\n if (moving.size === 0) return;\n this.value.set(this.selected().filter(v => !moving.has(v)));\n this.targetChecked.set([]);\n this.touch.emit();\n this.restoreFocusAfterMove('source');\n }\n\n /** Filter, then derive the header state from what survived. */\n private pane(rows: readonly WrTransferItem[], query: string, checked: readonly unknown[]): PaneState {\n const q = query.trim().toLowerCase();\n const visible = q ? rows.filter(item => item.label.toLowerCase().includes(q)) : rows;\n const enabled = visible.filter(item => !item.disabled);\n const staged = new Set(checked);\n const shown = enabled.filter(item => staged.has(item.value)).map(item => item.value);\n return {\n rows: visible,\n checked: shown,\n checkedCount: shown.length,\n enabledCount: enabled.length,\n allChecked: enabled.length > 0 && shown.length === enabled.length,\n someChecked: shown.length > 0 && shown.length < enabled.length,\n };\n }\n}\n","<!--\n Two panes and the buttons between them. Each pane is a PLAIN `<ul>` of\n checkboxes, deliberately: dressing it as a `role=\"listbox\"` of `role=\"option\"`\n rows reads better in the abstract but is invalid — an option may not contain an\n interactive control, and the axe gate says so. The checkbox is the thing the\n user operates, so it is the thing the semantics should describe; the pane\n heading names the group.\n-->\n@for (pane of panes; track pane) {\n @let state = pane === 'source' ? source() : target();\n @let title = pane === 'source' ? resolvedSourceTitle() : resolvedTargetTitle();\n\n <div class=\"wr-transfer__pane\" [class.wr-transfer__pane--target]=\"pane === 'target'\">\n <div class=\"wr-transfer__head\">\n <wr-checkbox\n size=\"sm\"\n [checked]=\"state.allChecked\"\n [indeterminate]=\"state.someChecked\"\n [disabled]=\"disabled() || state.enabledCount === 0\"\n [readonly]=\"readonly()\"\n [ariaLabel]=\"selectAllAria({ action: resolvedSelectAll(), pane: title })\"\n (checkedChange)=\"toggleAll(pane, $event)\"\n />\n <span class=\"wr-transfer__title\">{{ title }}</span>\n <span class=\"wr-transfer__count\">{{\n countLabel({ checked: state.checkedCount, total: state.rows.length })\n }}</span>\n </div>\n\n @if (searchable()) {\n <div class=\"wr-transfer__search\">\n <input\n wrInput\n size=\"sm\"\n type=\"search\"\n [placeholder]=\"resolvedSearch()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"`${title} — ${resolvedSearch()}`\"\n (input)=\"onSearch(pane, $event)\"\n />\n </div>\n }\n\n <ul class=\"wr-transfer__list\" [attr.aria-label]=\"title\">\n @for (item of state.rows; track item.value) {\n <li class=\"wr-transfer__item\" [class.wr-transfer__item--disabled]=\"item.disabled\">\n <wr-checkbox\n size=\"sm\"\n [checked]=\"isChecked(pane, item)\"\n [disabled]=\"disabled() || !!item.disabled\"\n [readonly]=\"readonly()\"\n (checkedChange)=\"toggle(pane, item, $event)\"\n (touch)=\"touch.emit()\"\n >\n {{ item.label }}\n </wr-checkbox>\n </li>\n } @empty {\n <li class=\"wr-transfer__empty\">{{ resolvedEmpty() }}</li>\n }\n </ul>\n </div>\n\n <!-- The buttons live between the panes, so they are emitted after the first. -->\n @if (pane === 'source') {\n <div class=\"wr-transfer__actions\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n color=\"primary\"\n outlined\n class=\"wr-transfer__move wr-transfer__move--to-target\"\n [disabled]=\"!canMoveRight()\"\n [attr.aria-label]=\"resolvedToTarget()\"\n (click)=\"moveRight()\"\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=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n color=\"primary\"\n outlined\n class=\"wr-transfer__move wr-transfer__move--to-source\"\n [disabled]=\"!canMoveLeft()\"\n [attr.aria-label]=\"resolvedToSource()\"\n (click)=\"moveLeft()\"\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=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n </div>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuGA,IAAa,aAAb,MAAa,WAAU;CACrB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,UAAU;EAC3E,IAAI,OAAO,cAAc,eAAe,WAAW,aAAa,KAAK,iBAAiB,KAAK,QAAO,CAAE,CAAC;CACvG;CAGS,QAAQ,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAM5C,QAAQ,MAA0B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;C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A;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,iBAAA,OAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAO,UAAA;IAAA,QAAA,CAAA,QAAA,SAAA;GAAA;EAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAE5B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EAxBtB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,eAER,kBAAkB;GAAI,MAC/B;IACJ,OAAO;IACP,WAAW;IAIX,MAAM;IAGN,0BAA0B;IAC1B,uBAAuB;IACvB,2BAA2B;GAC5B;GAAA,WAKU,CAAC;IAAE,SAAS;IAAe,UAAU;GAAI,CAAE;GAAC,SAC9C;IAAC;IAAU;IAAY;GAAO;GAAC,UAAA;EAAA,CAAA"}
@@ -174,7 +174,7 @@ var WrTree = class WrTree {
174
174
  isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
175
175
  panelId = `wr-tree-panel-${++panelUid}`;
176
176
  classes = computed(() => {
177
- const parts = ["wr-tree"];
177
+ const parts = [];
178
178
  if (this.disabled()) parts.push("wr-tree--disabled");
179
179
  else if (this.readonly()) parts.push("wr-tree--readonly");
180
180
  if (this.isOverlay()) {
@@ -734,7 +734,8 @@ var WrTree = class WrTree {
734
734
  },
735
735
  host: {
736
736
  listeners: { "focusout": "onFocusOut($event)" },
737
- properties: { "class": "classes()" }
737
+ properties: { "class": "classes()" },
738
+ classAttribute: "wr-tree"
738
739
  },
739
740
  viewQueries: [{
740
741
  propertyName: "panelTpl",
@@ -770,6 +771,7 @@ i0.ɵɵngDeclareClassMetadata({
770
771
  selector: "wr-tree",
771
772
  encapsulation: ViewEncapsulation.None,
772
773
  host: {
774
+ class: "wr-tree",
773
775
  "[class]": "classes()",
774
776
  "(focusout)": "onFocusOut($event)"
775
777
  },