ngwr 14.3.1 → 14.5.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 (368) hide show
  1. package/README.md +4 -4
  2. package/avatar/styles/_index.scss +4 -2
  3. package/badge/styles/_index.scss +4 -1
  4. package/badge/styles/_tag.scss +3 -0
  5. package/cascader/styles/_rules.scss +3 -0
  6. package/command-palette/styles/_index.scss +23 -0
  7. package/context-menu/styles/_index.scss +13 -1
  8. package/fesm2022/ngwr-action-sheet.mjs +3 -3
  9. package/fesm2022/ngwr-affix.mjs +17 -4
  10. package/fesm2022/ngwr-affix.mjs.map +1 -1
  11. package/fesm2022/ngwr-alert.mjs +4 -4
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-anchor.mjs +3 -3
  14. package/fesm2022/ngwr-aurora.mjs +3 -3
  15. package/fesm2022/ngwr-avatar.mjs +3 -3
  16. package/fesm2022/ngwr-back-top.mjs +3 -3
  17. package/fesm2022/ngwr-badge.mjs +6 -6
  18. package/fesm2022/ngwr-bar-chart-testing.mjs +18 -2
  19. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-bar-chart.mjs +3 -3
  21. package/fesm2022/ngwr-blur-text.mjs +3 -3
  22. package/fesm2022/ngwr-border-glow.mjs +3 -3
  23. package/fesm2022/ngwr-breadcrumbs.mjs +7 -7
  24. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  25. package/fesm2022/ngwr-burger.mjs +3 -3
  26. package/fesm2022/ngwr-button.mjs +6 -6
  27. package/fesm2022/ngwr-calendar-heatmap-testing.mjs +12 -9
  28. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
  29. package/fesm2022/ngwr-calendar-heatmap.mjs +35 -7
  30. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-calendar.mjs +32 -4
  32. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  33. package/fesm2022/ngwr-card.mjs +9 -9
  34. package/fesm2022/ngwr-carousel.mjs +6 -6
  35. package/fesm2022/ngwr-cascader-testing.mjs +87 -17
  36. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  37. package/fesm2022/ngwr-cascader.mjs +76 -5
  38. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  39. package/fesm2022/ngwr-checkbox-testing.mjs +13 -2
  40. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
  41. package/fesm2022/ngwr-checkbox.mjs +42 -7
  42. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  43. package/fesm2022/ngwr-circular-text.mjs +3 -3
  44. package/fesm2022/ngwr-click-spark.mjs +3 -3
  45. package/fesm2022/ngwr-clipboard.mjs +3 -3
  46. package/fesm2022/ngwr-collapse.mjs +9 -9
  47. package/fesm2022/ngwr-color-picker.mjs +24 -8
  48. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  49. package/fesm2022/ngwr-command-palette.mjs +16 -3
  50. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  51. package/fesm2022/ngwr-compare.mjs +3 -3
  52. package/fesm2022/ngwr-confetti.mjs +3 -3
  53. package/fesm2022/ngwr-context-menu.mjs +47 -15
  54. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  55. package/fesm2022/ngwr-cookie.mjs +3 -3
  56. package/fesm2022/ngwr-counter.mjs +6 -6
  57. package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
  58. package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
  59. package/fesm2022/ngwr-date-picker.mjs +111 -28
  60. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  61. package/fesm2022/ngwr-date.mjs +3 -3
  62. package/fesm2022/ngwr-decrypt-text.mjs +3 -3
  63. package/fesm2022/ngwr-density.mjs +6 -6
  64. package/fesm2022/ngwr-descriptions.mjs +6 -6
  65. package/fesm2022/ngwr-dialog.mjs +27 -16
  66. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  67. package/fesm2022/ngwr-directives.mjs +12 -12
  68. package/fesm2022/ngwr-divider.mjs +3 -3
  69. package/fesm2022/ngwr-donut-chart-testing.mjs +18 -2
  70. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-donut-chart.mjs +4 -4
  72. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  73. package/fesm2022/ngwr-drag-drop.mjs +7 -7
  74. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  75. package/fesm2022/ngwr-drawer.mjs +66 -20
  76. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  77. package/fesm2022/ngwr-dropdown.mjs +54 -16
  78. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  79. package/fesm2022/ngwr-empty.mjs +3 -3
  80. package/fesm2022/ngwr-event-calendar.mjs +6 -6
  81. package/fesm2022/ngwr-falling-text.mjs +3 -3
  82. package/fesm2022/ngwr-file-upload.mjs +18 -5
  83. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  84. package/fesm2022/ngwr-form.mjs +66 -14
  85. package/fesm2022/ngwr-form.mjs.map +1 -1
  86. package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
  87. package/fesm2022/ngwr-gauge-testing.mjs +16 -2
  88. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
  89. package/fesm2022/ngwr-gauge.mjs +3 -3
  90. package/fesm2022/ngwr-glitch-text.mjs +3 -3
  91. package/fesm2022/ngwr-gradient-text.mjs +3 -3
  92. package/fesm2022/ngwr-graph-testing.mjs +243 -0
  93. package/fesm2022/ngwr-graph-testing.mjs.map +1 -0
  94. package/fesm2022/ngwr-graph.mjs +1112 -0
  95. package/fesm2022/ngwr-graph.mjs.map +1 -0
  96. package/fesm2022/ngwr-hotkey.mjs +6 -6
  97. package/fesm2022/ngwr-i18n-ar.mjs +7 -0
  98. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-cs.mjs +7 -0
  100. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-de.mjs +7 -0
  102. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-en.mjs +23 -2
  104. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-es.mjs +7 -0
  106. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-fr.mjs +7 -0
  108. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-he.mjs +7 -0
  110. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-hi.mjs +7 -0
  112. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-id.mjs +7 -0
  114. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-it.mjs +7 -0
  116. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-ja.mjs +7 -0
  118. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-ko.mjs +7 -0
  120. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-nl.mjs +7 -0
  122. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-pl.mjs +7 -0
  124. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n-pt.mjs +7 -0
  126. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  127. package/fesm2022/ngwr-i18n-ru.mjs +7 -0
  128. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  129. package/fesm2022/ngwr-i18n-sv.mjs +7 -0
  130. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  131. package/fesm2022/ngwr-i18n-tr.mjs +7 -0
  132. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  133. package/fesm2022/ngwr-i18n-uk.mjs +7 -0
  134. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  135. package/fesm2022/ngwr-i18n-vi.mjs +7 -0
  136. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  137. package/fesm2022/ngwr-i18n-zh-TW.mjs +7 -0
  138. package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
  139. package/fesm2022/ngwr-i18n-zh.mjs +7 -0
  140. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  141. package/fesm2022/ngwr-i18n.mjs +9 -9
  142. package/fesm2022/ngwr-icon.mjs +6 -6
  143. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  144. package/fesm2022/ngwr-input-number.mjs +15 -6
  145. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  146. package/fesm2022/ngwr-input-otp.mjs +38 -6
  147. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  148. package/fesm2022/ngwr-input.mjs +15 -15
  149. package/fesm2022/ngwr-keyboard.mjs +3 -3
  150. package/fesm2022/ngwr-knob-testing.mjs +11 -3
  151. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  152. package/fesm2022/ngwr-knob.mjs +19 -4
  153. package/fesm2022/ngwr-knob.mjs.map +1 -1
  154. package/fesm2022/ngwr-layout.mjs +15 -15
  155. package/fesm2022/ngwr-lightbox.mjs +27 -6
  156. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  157. package/fesm2022/ngwr-line-chart-testing.mjs +18 -2
  158. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
  159. package/fesm2022/ngwr-line-chart.mjs +22 -4
  160. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  161. package/fesm2022/ngwr-list.mjs +7 -7
  162. package/fesm2022/ngwr-list.mjs.map +1 -1
  163. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  164. package/fesm2022/ngwr-markdown.mjs +6 -6
  165. package/fesm2022/ngwr-marquee.mjs +3 -3
  166. package/fesm2022/ngwr-media.mjs +3 -3
  167. package/fesm2022/ngwr-mention.mjs +24 -8
  168. package/fesm2022/ngwr-mention.mjs.map +1 -1
  169. package/fesm2022/ngwr-meta.mjs +6 -6
  170. package/fesm2022/ngwr-meter-group.mjs +3 -3
  171. package/fesm2022/ngwr-overlay.mjs +125 -10
  172. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  173. package/fesm2022/ngwr-page-header.mjs +3 -3
  174. package/fesm2022/ngwr-pagination.mjs +33 -6
  175. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  176. package/fesm2022/ngwr-pipes.mjs +21 -21
  177. package/fesm2022/ngwr-platform.mjs +9 -9
  178. package/fesm2022/ngwr-popconfirm.mjs +25 -9
  179. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  180. package/fesm2022/ngwr-popover-testing.mjs +22 -5
  181. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  182. package/fesm2022/ngwr-popover.mjs +243 -37
  183. package/fesm2022/ngwr-popover.mjs.map +1 -1
  184. package/fesm2022/ngwr-progress.mjs +3 -3
  185. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  186. package/fesm2022/ngwr-qr.mjs +3 -3
  187. package/fesm2022/ngwr-radio.mjs +6 -6
  188. package/fesm2022/ngwr-rating-testing.mjs +12 -3
  189. package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
  190. package/fesm2022/ngwr-rating.mjs +19 -4
  191. package/fesm2022/ngwr-rating.mjs.map +1 -1
  192. package/fesm2022/ngwr-result.mjs +13 -13
  193. package/fesm2022/ngwr-result.mjs.map +1 -1
  194. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  195. package/fesm2022/ngwr-schema-form.mjs +3 -3
  196. package/fesm2022/ngwr-scroll.mjs +3 -3
  197. package/fesm2022/ngwr-segmented.mjs +37 -4
  198. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  199. package/fesm2022/ngwr-select.mjs +24 -10
  200. package/fesm2022/ngwr-select.mjs.map +1 -1
  201. package/fesm2022/ngwr-shiny-text.mjs +6 -6
  202. package/fesm2022/ngwr-sidebar.mjs +3 -3
  203. package/fesm2022/ngwr-skeleton.mjs +3 -3
  204. package/fesm2022/ngwr-slider.mjs +18 -5
  205. package/fesm2022/ngwr-slider.mjs.map +1 -1
  206. package/fesm2022/ngwr-sparkline.mjs +3 -3
  207. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  208. package/fesm2022/ngwr-spinner.mjs +3 -3
  209. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  210. package/fesm2022/ngwr-split-text.mjs +3 -3
  211. package/fesm2022/ngwr-splitter.mjs +3 -3
  212. package/fesm2022/ngwr-spotlight-card.mjs +6 -6
  213. package/fesm2022/ngwr-squircle.mjs +28 -9
  214. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  215. package/fesm2022/ngwr-star-border.mjs +3 -3
  216. package/fesm2022/ngwr-statistic.mjs +20 -13
  217. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  218. package/fesm2022/ngwr-stepper.mjs +6 -6
  219. package/fesm2022/ngwr-storage.mjs +3 -3
  220. package/fesm2022/ngwr-switch.mjs +3 -3
  221. package/fesm2022/ngwr-table.mjs +18 -18
  222. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  223. package/fesm2022/ngwr-tabs.mjs +6 -6
  224. package/fesm2022/ngwr-textarea.mjs +3 -3
  225. package/fesm2022/ngwr-theme.mjs +3 -3
  226. package/fesm2022/ngwr-tilt-card.mjs +6 -6
  227. package/fesm2022/ngwr-timeline.mjs +6 -6
  228. package/fesm2022/ngwr-toast.mjs +29 -12
  229. package/fesm2022/ngwr-toast.mjs.map +1 -1
  230. package/fesm2022/ngwr-toolbar.mjs +3 -3
  231. package/fesm2022/ngwr-tour.mjs +26 -12
  232. package/fesm2022/ngwr-tour.mjs.map +1 -1
  233. package/fesm2022/ngwr-transfer.mjs +88 -11
  234. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  235. package/fesm2022/ngwr-tree-testing.mjs +24 -0
  236. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  237. package/fesm2022/ngwr-tree.mjs +81 -9
  238. package/fesm2022/ngwr-tree.mjs.map +1 -1
  239. package/fesm2022/ngwr-typewriter.mjs +3 -3
  240. package/fesm2022/ngwr-typography.mjs +3 -3
  241. package/fesm2022/ngwr-version.mjs +1 -1
  242. package/fesm2022/ngwr-version.mjs.map +1 -1
  243. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  244. package/fesm2022/ngwr-waves.mjs +3 -3
  245. package/fesm2022/ngwr-window.mjs +30 -13
  246. package/fesm2022/ngwr-window.mjs.map +1 -1
  247. package/form/styles/_index.scss +63 -0
  248. package/graph/styles/_index.scss +113 -0
  249. package/i18n/ar.json +9 -2
  250. package/i18n/cs.json +9 -2
  251. package/i18n/de.json +9 -2
  252. package/i18n/en.json +11 -4
  253. package/i18n/es.json +9 -2
  254. package/i18n/fr.json +9 -2
  255. package/i18n/he.json +9 -2
  256. package/i18n/hi.json +9 -2
  257. package/i18n/id.json +9 -2
  258. package/i18n/it.json +9 -2
  259. package/i18n/ja.json +9 -2
  260. package/i18n/ko.json +9 -2
  261. package/i18n/nl.json +9 -2
  262. package/i18n/pl.json +9 -2
  263. package/i18n/pt.json +9 -2
  264. package/i18n/ru.json +9 -2
  265. package/i18n/sv.json +9 -2
  266. package/i18n/tr.json +9 -2
  267. package/i18n/uk.json +9 -2
  268. package/i18n/vi.json +9 -2
  269. package/i18n/zh-TW.json +9 -2
  270. package/i18n/zh.json +9 -2
  271. package/input-otp/styles/_index.scss +5 -1
  272. package/line-chart/styles/_index.scss +5 -3
  273. package/llms-full.txt +13 -3
  274. package/llms.txt +8 -6
  275. package/markdown/styles/_index.scss +4 -1
  276. package/mention/styles/_index.scss +22 -1
  277. package/package.json +10 -1
  278. package/radio/styles/_index.scss +3 -0
  279. package/result/styles/_index.scss +12 -0
  280. package/schematics/migrations/v14/index.js +6 -3
  281. package/schematics/migrations.json +1 -1
  282. package/schematics/ng-add/index.js +34 -5
  283. package/schematics/use/symbol-map.json +2 -0
  284. package/segmented/styles/_index.scss +12 -1
  285. package/select/styles/_index.scss +20 -1
  286. package/skills/ngwr/SKILL.md +1 -1
  287. package/skills/ngwr/references/catalog.md +2 -0
  288. package/statistic/styles/_index.scss +4 -0
  289. package/stepper/styles/_index.scss +36 -0
  290. package/styles.scss +1 -0
  291. package/switch/styles/_index.scss +3 -0
  292. package/table/styles/_index.scss +12 -0
  293. package/tabs/styles/_index.scss +4 -1
  294. package/textarea/styles/_index.scss +6 -1
  295. package/theme/styles/_colors.scss +11 -0
  296. package/theme/styles/_contrast.scss +136 -0
  297. package/theme/styles/_focus.scss +7 -0
  298. package/theme/styles/_index.scss +1 -0
  299. package/theme/styles/_mixins.scss +15 -8
  300. package/timeline/styles/_index.scss +28 -1
  301. package/toast/styles/_index.scss +11 -0
  302. package/tree/styles/_index.scss +27 -1
  303. package/types/ngwr-badge.d.ts +1 -1
  304. package/types/ngwr-bar-chart-testing.d.ts +11 -1
  305. package/types/ngwr-button.d.ts +1 -1
  306. package/types/ngwr-calendar-heatmap-testing.d.ts +10 -5
  307. package/types/ngwr-calendar-heatmap.d.ts +22 -0
  308. package/types/ngwr-calendar.d.ts +21 -0
  309. package/types/ngwr-cascader-testing.d.ts +74 -17
  310. package/types/ngwr-cascader.d.ts +35 -0
  311. package/types/ngwr-checkbox-testing.d.ts +12 -1
  312. package/types/ngwr-checkbox.d.ts +10 -0
  313. package/types/ngwr-clipboard.d.ts +1 -1
  314. package/types/ngwr-color-picker.d.ts +8 -0
  315. package/types/ngwr-confetti.d.ts +1 -1
  316. package/types/ngwr-context-menu.d.ts +10 -0
  317. package/types/ngwr-cookie.d.ts +1 -1
  318. package/types/ngwr-date-adapters-fns.d.ts +1 -1
  319. package/types/ngwr-date-adapters-luxon.d.ts +1 -1
  320. package/types/ngwr-date-picker.d.ts +16 -0
  321. package/types/ngwr-date.d.ts +9 -3
  322. package/types/ngwr-density.d.ts +1 -1
  323. package/types/ngwr-dialog.d.ts +2 -1
  324. package/types/ngwr-donut-chart-testing.d.ts +11 -1
  325. package/types/ngwr-drawer.d.ts +29 -1
  326. package/types/ngwr-dropdown.d.ts +25 -0
  327. package/types/ngwr-file-upload.d.ts +11 -0
  328. package/types/ngwr-form.d.ts +25 -0
  329. package/types/ngwr-gauge-testing.d.ts +9 -1
  330. package/types/ngwr-graph-testing.d.ts +190 -0
  331. package/types/ngwr-graph.d.ts +203 -0
  332. package/types/ngwr-hotkey.d.ts +1 -1
  333. package/types/ngwr-i18n.d.ts +1 -1
  334. package/types/ngwr-input-number.d.ts +12 -2
  335. package/types/ngwr-input-otp.d.ts +12 -0
  336. package/types/ngwr-knob-testing.d.ts +11 -3
  337. package/types/ngwr-knob.d.ts +13 -0
  338. package/types/ngwr-lightbox.d.ts +15 -0
  339. package/types/ngwr-line-chart-testing.d.ts +11 -1
  340. package/types/ngwr-line-chart.d.ts +18 -0
  341. package/types/ngwr-loading-bar.d.ts +1 -1
  342. package/types/ngwr-markdown.d.ts +1 -1
  343. package/types/ngwr-media.d.ts +1 -1
  344. package/types/ngwr-mention.d.ts +7 -0
  345. package/types/ngwr-meta.d.ts +1 -1
  346. package/types/ngwr-overlay.d.ts +64 -6
  347. package/types/ngwr-pagination.d.ts +16 -0
  348. package/types/ngwr-platform.d.ts +3 -3
  349. package/types/ngwr-popconfirm.d.ts +1 -0
  350. package/types/ngwr-popover-testing.d.ts +22 -5
  351. package/types/ngwr-popover.d.ts +44 -8
  352. package/types/ngwr-rating-testing.d.ts +12 -3
  353. package/types/ngwr-rating.d.ts +13 -0
  354. package/types/ngwr-scroll.d.ts +1 -1
  355. package/types/ngwr-segmented.d.ts +16 -0
  356. package/types/ngwr-select.d.ts +7 -0
  357. package/types/ngwr-squircle.d.ts +22 -3
  358. package/types/ngwr-statistic.d.ts +0 -1
  359. package/types/ngwr-storage.d.ts +1 -1
  360. package/types/ngwr-theme.d.ts +1 -1
  361. package/types/ngwr-toast.d.ts +3 -1
  362. package/types/ngwr-tour.d.ts +7 -1
  363. package/types/ngwr-transfer.d.ts +52 -0
  364. package/types/ngwr-tree-testing.d.ts +20 -0
  365. package/types/ngwr-tree.d.ts +43 -1
  366. package/types/ngwr-version.d.ts +1 -1
  367. package/types/ngwr-window.d.ts +2 -1
  368. package/typography/styles/_index.scss +26 -4
@@ -2,10 +2,10 @@ import { Directionality } from '@angular/cdk/bidi';
2
2
  import { ScrollStrategyOptions } from '@angular/cdk/overlay';
3
3
  import { ComponentPortal } from '@angular/cdk/portal';
4
4
  import * as i0 from '@angular/core';
5
- import { input, output, ViewEncapsulation, Component, inject, ElementRef, ViewContainerRef, DestroyRef, signal, Directive } from '@angular/core';
5
+ import { input, output, ViewEncapsulation, Component, inject, ElementRef, ViewContainerRef, Injector, DestroyRef, signal, Directive } from '@angular/core';
6
6
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
7
  import { useI18nText } from 'ngwr/i18n';
8
- import { WR_OVERLAY, WrOutsideClick, wrMirrorOffsets } from 'ngwr/overlay';
8
+ import { WR_OVERLAY, WrOutsideClick, wrMirrorOffsets, wrFollowDirection } from 'ngwr/overlay';
9
9
  import { WrButton } from 'ngwr/button';
10
10
 
11
11
  /**
@@ -48,10 +48,10 @@ class WrPopconfirmPanel {
48
48
  ...(ngDevMode ? [{ debugName: "confirmColor" }] : /* istanbul ignore next */ []));
49
49
  confirmed = output();
50
50
  cancelled = output();
51
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: WrPopconfirmPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
52
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: WrPopconfirmPanel, isStandalone: true, selector: "wr-popconfirm", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, messageId: { classPropertyName: "messageId", publicName: "messageId", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { classAttribute: "wr-popconfirm" }, ngImport: i0, template: "<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n", dependencies: [{ kind: "component", type: WrButton, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: ["color", "size", "shape", "icon", "iconPosition", "disabled", "outlined", "block", "loading", "disabledWhenLoading"] }], encapsulation: i0.ViewEncapsulation.None });
51
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopconfirmPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
52
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: WrPopconfirmPanel, isStandalone: true, selector: "wr-popconfirm", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, messageId: { classPropertyName: "messageId", publicName: "messageId", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { classAttribute: "wr-popconfirm" }, ngImport: i0, template: "<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n", dependencies: [{ kind: "component", type: WrButton, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: ["color", "size", "shape", "icon", "iconPosition", "disabled", "outlined", "block", "loading", "disabledWhenLoading"] }], encapsulation: i0.ViewEncapsulation.None });
53
53
  }
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: WrPopconfirmPanel, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopconfirmPanel, decorators: [{
55
55
  type: Component,
56
56
  args: [{ selector: 'wr-popconfirm', encapsulation: ViewEncapsulation.None, host: { class: 'wr-popconfirm' }, imports: [WrButton], template: "<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\n" }]
57
57
  }], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], messageId: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageId", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], confirmColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmColor", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
@@ -119,6 +119,7 @@ class WrPopconfirm {
119
119
  outsideClick = inject(WrOutsideClick);
120
120
  vcr = inject(ViewContainerRef);
121
121
  scrollStrategies = inject(ScrollStrategyOptions);
122
+ injector = inject(Injector);
122
123
  destroyRef = inject(DestroyRef);
123
124
  /** @internal Public so the host bindings can read it. */
124
125
  isOpen = signal(false, /* @ts-ignore */
@@ -144,16 +145,31 @@ class WrPopconfirm {
144
145
  open() {
145
146
  if (this.overlayRef)
146
147
  return;
148
+ // Read ONCE, here, and mirror this list rather than the input: the side is
149
+ // chosen at open and a later `position` write moves nothing, so a follower
150
+ // that re-read the signal would let a direction flip quietly adopt a
151
+ // position the panel never opened with — and the `wr-popconfirm-overlay--…`
152
+ // class minted from the same read below, which is what the stylesheet hangs
153
+ // the arrow and the spacing off, would still name the old one.
154
+ const positions = WR_POPCONFIRM_POSITIONS[this.position()];
147
155
  const positionStrategy = this.overlay
148
156
  .position()
149
157
  .flexibleConnectedTo(this.host)
150
- .withPositions(wrMirrorOffsets(WR_POPCONFIRM_POSITIONS[this.position()], this.isRtl()))
158
+ .withPositions(wrMirrorOffsets(positions, this.isRtl()))
151
159
  .withPush(true);
152
160
  this.overlayRef = this.overlay.create({
153
161
  positionStrategy,
154
162
  scrollStrategy: this.scrollStrategies.reposition(),
155
163
  panelClass: ['wr-popconfirm-overlay', `wr-popconfirm-overlay--${this.position()}`],
156
164
  });
165
+ // `isRtl()` above answered once, at `create()`, and so did the CDK's own
166
+ // capture of the direction — neither is revisited if the app flips while the
167
+ // question is still on screen. Both halves have to move: the `dir` on the
168
+ // host, so `start` / `end` resolve to the other edge, and the mirrored list,
169
+ // because `offsetX` is added to the final PHYSICAL x. Leave the list behind
170
+ // and the 8px gap on `left` / `right` becomes an 8px overlap over the very
171
+ // control the panel is asking about.
172
+ wrFollowDirection(this.overlayRef, this.dir, this.injector, direction => positionStrategy.withPositions(wrMirrorOffsets(positions, direction === 'rtl')));
157
173
  // Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,
158
174
  // so trapping focus would only make it harder to leave. It still needs a role, a
159
175
  // name and the question read out as its description.
@@ -235,10 +251,10 @@ class WrPopconfirm {
235
251
  isRtl() {
236
252
  return this.dir?.value === 'rtl';
237
253
  }
238
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: WrPopconfirm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
239
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.5", type: WrPopconfirm, isStandalone: true, selector: "[wrPopconfirm]", inputs: { message: { classPropertyName: "message", publicName: "wrPopconfirm", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-haspopup": "\"dialog\"", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? panelId : null" }, classAttribute: "wr-popconfirm-trigger" }, exportAs: ["wrPopconfirm"], ngImport: i0 });
254
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopconfirm, deps: [], target: i0.ɵɵFactoryTarget.Directive });
255
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: WrPopconfirm, isStandalone: true, selector: "[wrPopconfirm]", inputs: { message: { classPropertyName: "message", publicName: "wrPopconfirm", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, confirmColor: { classPropertyName: "confirmColor", publicName: "confirmColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { listeners: { "click": "toggle($event)" }, properties: { "attr.aria-haspopup": "\"dialog\"", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "isOpen() ? panelId : null" }, classAttribute: "wr-popconfirm-trigger" }, exportAs: ["wrPopconfirm"], ngImport: i0 });
240
256
  }
241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: WrPopconfirm, decorators: [{
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrPopconfirm, decorators: [{
242
258
  type: Directive,
243
259
  args: [{
244
260
  selector: '[wrPopconfirm]',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-popconfirm.mjs","sources":["../../../projects/lib/popconfirm/interfaces/popconfirm-position.ts","../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/popconfirm.ts","../../../projects/lib/popconfirm/ngwr-popconfirm.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 { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type WrPopconfirmPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/** @internal */\nexport const WR_POPCONFIRM_POSITIONS: Record<WrPopconfirmPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -8 }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 8 }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 }],\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, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Confirmation panel rendered inside the popconfirm overlay. Not part\n * of the public template API — use `[wrPopconfirm]` instead.\n *\n * @internal\n */\n@Component({\n selector: 'wr-popconfirm',\n templateUrl: './popconfirm-panel.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-popconfirm' },\n imports: [WrButton],\n})\nexport class WrPopconfirmPanel {\n readonly message = input.required<string>();\n\n /** Id the anchoring directive points `aria-describedby` at. */\n readonly messageId = input<string | null>(null);\n readonly confirmText = input<string>('Confirm');\n readonly cancelText = input<string>('Cancel');\n readonly confirmColor = input<WrColor>('primary');\n\n readonly confirmed = output<void>();\n readonly cancelled = output<void>();\n}\n","<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\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, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DestroyRef, Directive, ElementRef, ViewContainerRef, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrMirrorOffsets } from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\n\nimport { WR_POPCONFIRM_POSITIONS, type WrPopconfirmPosition } from './interfaces';\nimport { WrPopconfirmPanel } from './popconfirm-panel';\n\n/**\n * Small \"Are you sure?\" panel anchored to its trigger. Fires `confirmed`\n * or `cancelled` and closes automatically. Built on CDK Overlay.\n *\n * @example\n * ```html\n * <wr-btn\n * color=\"danger\"\n * [wrPopconfirm]=\"'Delete this item?'\"\n * confirmColor=\"danger\"\n * confirmText=\"Delete\"\n * (confirmed)=\"remove()\"\n * >Delete</wr-btn>\n * ```\n *\n * @see https://ngwr.dev/reference/components/popconfirm\n */\nlet popconfirmUid = 0;\n\n@Directive({\n selector: '[wrPopconfirm]',\n exportAs: 'wrPopconfirm',\n host: {\n // Marks the trigger the way `[wrPopover]` and `[wrDropdown]` mark theirs. The\n // question is normally BOUND (`[wrPopconfirm]=\"question\"`), which leaves no\n // attribute in the DOM at all, so without this there is nothing to find a\n // trigger by once the panel is shut.\n class: 'wr-popconfirm-trigger',\n '(click)': 'toggle($event)',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n // Names the dialog this trigger opened, as every other overlay trigger in the\n // catalog does. `aria-haspopup=\"dialog\"` promises a dialog and `aria-expanded`\n // says it is showing; without the id, which one is left to guess.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n },\n})\nexport class WrPopconfirm {\n /** Confirmation message. */\n readonly message = input.required<string>({ alias: 'wrPopconfirm' });\n\n /** Anchor side. @default 'top' */\n readonly position = input<WrPopconfirmPosition>('top');\n\n /** Label for the confirm button. @default 'Confirm' */\n /** Confirm button text. Falls back to `popconfirm.confirm`. */\n readonly confirmText = input<string | null>(null);\n\n /** Label for the cancel button. @default 'Cancel' */\n /** Cancel button text. Falls back to `popconfirm.cancel`. */\n readonly cancelText = input<string | null>(null);\n\n /**\n * Accessible name of the confirmation dialog. `role=\"dialog\"` with no name\n * announces as a bare \"dialog\". Falls back to `popconfirm.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The catalog has carried these translated for as long as the component has\n // existed; the labels were hard-coded English defaults, so a localized app got\n // English buttons with the right strings sitting one file away.\n private readonly resolvedConfirm = useI18nText(this.confirmText, 'popconfirm.confirm', 'Confirm');\n private readonly resolvedCancel = useI18nText(this.cancelText, 'popconfirm.cancel', 'Cancel');\n private readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'popconfirm.label', 'Confirm action');\n\n /** Color of the confirm button. @default 'primary' */\n readonly confirmColor = input<WrColor>('primary');\n\n /** Fires when the user clicks confirm. */\n readonly confirmed = output<void>();\n\n /** Fires when the user clicks cancel or dismisses the overlay. */\n readonly cancelled = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so the host bindings can read it. */\n readonly isOpen = signal(false);\n\n private overlayRef: OverlayRef | null = null;\n\n private readonly uid = ++popconfirmUid;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-popconfirm-${this.uid}`;\n\n private readonly messageId = `wr-popconfirm-message-${this.uid}`;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n open(): void {\n if (this.overlayRef) return;\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(WR_POPCONFIRM_POSITIONS[this.position()], this.isRtl()))\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: ['wr-popconfirm-overlay', `wr-popconfirm-overlay--${this.position()}`],\n });\n\n // Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,\n // so trapping focus would only make it harder to leave. It still needs a role, a\n // name and the question read out as its description.\n const pane = this.overlayRef.overlayElement;\n pane.id = this.panelId;\n pane.setAttribute('role', 'dialog');\n pane.setAttribute('aria-modal', 'false');\n pane.setAttribute('aria-label', this.resolvedAriaLabel());\n pane.setAttribute('aria-describedby', this.messageId);\n\n const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);\n const ref = this.overlayRef.attach(portal);\n ref.setInput('message', this.message());\n ref.setInput('messageId', this.messageId);\n ref.setInput('confirmText', this.resolvedConfirm());\n ref.setInput('cancelText', this.resolvedCancel());\n ref.setInput('confirmColor', this.confirmColor());\n // Render now rather than next frame: the buttons have to exist before focus can\n // move to one, and a deferred focus is the class of bug this repo keeps finding.\n ref.changeDetectorRef.detectChanges();\n // Focus has to enter the panel — the overlay container sits at the end of\n // `<body>`, so Tab from the trigger went to the next thing on the PAGE and the\n // only way to confirm was unreachable. Cancel first: the action being confirmed\n // is usually the destructive one.\n pane.querySelector<HTMLElement>('.wr-popconfirm__actions wr-btn')?.focus();\n this.isOpen.set(true);\n\n ref.instance.confirmed.subscribe(() => {\n this.confirmed.emit();\n this.close();\n });\n ref.instance.cancelled.subscribe(() => this.dismiss());\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.dismiss();\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n close(): void {\n this.dispose();\n }\n\n private dismiss(): void {\n if (!this.overlayRef) return;\n this.cancelled.emit();\n this.dispose();\n }\n\n private dispose(): void {\n if (!this.overlayRef) return;\n // Focus lives inside the panel while it is open, and removing the panel would\n // drop it to `<body>` — hand it back to the trigger instead, as `wr-dropdown`\n // does on Escape. Only when focus is still IN there: if the user has already\n // clicked elsewhere, taking it back would be stealing.\n const returnFocus = this.overlayRef.overlayElement.contains(document.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.isOpen.set(false);\n if (returnFocus) this.host.nativeElement.focus();\n }\n\n /**\n * Whether the app reads right-to-left.\n *\n * Optional inject: `Directionality` is root-provided, so this is never null in\n * an app — but a bare `TestBed` that provides nothing should still get a\n * component that works, and defaulting to LTR is the honest fallback.\n */\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAMH;AACO,MAAM,uBAAuB,GAAsD;IACxF,GAAG,EAAE,CAAC,EAAE,OAAO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AA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,gBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,2BAAA,EAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAlBxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,IAAI,EAAE;;;;;AAKJ,wBAAA,KAAK,EAAE,uBAAuB;AAC9B,wBAAA,SAAS,EAAE,gBAAgB;AAC3B,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,sBAAsB,EAAE,UAAU;;;;AAIlC,wBAAA,sBAAsB,EAAE,2BAA2B;AACpD,qBAAA;AACF,iBAAA;;;ACxDD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-popconfirm.mjs","sources":["../../../projects/lib/popconfirm/interfaces/popconfirm-position.ts","../../../projects/lib/popconfirm/popconfirm-panel.ts","../../../projects/lib/popconfirm/popconfirm-panel.html","../../../projects/lib/popconfirm/popconfirm.ts","../../../projects/lib/popconfirm/ngwr-popconfirm.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 { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type WrPopconfirmPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/** @internal */\nexport const WR_POPCONFIRM_POSITIONS: Record<WrPopconfirmPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -8 }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 8 }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 }],\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, input, output } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Confirmation panel rendered inside the popconfirm overlay. Not part\n * of the public template API — use `[wrPopconfirm]` instead.\n *\n * @internal\n */\n@Component({\n selector: 'wr-popconfirm',\n templateUrl: './popconfirm-panel.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-popconfirm' },\n imports: [WrButton],\n})\nexport class WrPopconfirmPanel {\n readonly message = input.required<string>();\n\n /** Id the anchoring directive points `aria-describedby` at. */\n readonly messageId = input<string | null>(null);\n readonly confirmText = input<string>('Confirm');\n readonly cancelText = input<string>('Cancel');\n readonly confirmColor = input<WrColor>('primary');\n\n readonly confirmed = output<void>();\n readonly cancelled = output<void>();\n}\n","<p class=\"wr-popconfirm__message\" [attr.id]=\"messageId()\">{{ message() }}</p>\n\n<div class=\"wr-popconfirm__actions\">\n <wr-btn class=\"wr-popconfirm__action wr-popconfirm__action--cancel\" size=\"sm\" (click)=\"cancelled.emit()\">\n {{ cancelText() }}\n </wr-btn>\n <wr-btn\n class=\"wr-popconfirm__action wr-popconfirm__action--confirm\"\n size=\"sm\"\n [color]=\"confirmColor()\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmText() }}\n </wr-btn>\n</div>\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, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOutsideClick, wrFollowDirection, wrMirrorOffsets } from 'ngwr/overlay';\nimport type { WrColor } from 'ngwr/theme';\n\nimport { WR_POPCONFIRM_POSITIONS, type WrPopconfirmPosition } from './interfaces';\nimport { WrPopconfirmPanel } from './popconfirm-panel';\n\n/**\n * Small \"Are you sure?\" panel anchored to its trigger. Fires `confirmed`\n * or `cancelled` and closes automatically. Built on CDK Overlay.\n *\n * @example\n * ```html\n * <wr-btn\n * color=\"danger\"\n * [wrPopconfirm]=\"'Delete this item?'\"\n * confirmColor=\"danger\"\n * confirmText=\"Delete\"\n * (confirmed)=\"remove()\"\n * >Delete</wr-btn>\n * ```\n *\n * @see https://ngwr.dev/reference/components/popconfirm\n */\nlet popconfirmUid = 0;\n\n@Directive({\n selector: '[wrPopconfirm]',\n exportAs: 'wrPopconfirm',\n host: {\n // Marks the trigger the way `[wrPopover]` and `[wrDropdown]` mark theirs. The\n // question is normally BOUND (`[wrPopconfirm]=\"question\"`), which leaves no\n // attribute in the DOM at all, so without this there is nothing to find a\n // trigger by once the panel is shut.\n class: 'wr-popconfirm-trigger',\n '(click)': 'toggle($event)',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n // Names the dialog this trigger opened, as every other overlay trigger in the\n // catalog does. `aria-haspopup=\"dialog\"` promises a dialog and `aria-expanded`\n // says it is showing; without the id, which one is left to guess.\n '[attr.aria-controls]': 'isOpen() ? panelId : null',\n },\n})\nexport class WrPopconfirm {\n /** Confirmation message. */\n readonly message = input.required<string>({ alias: 'wrPopconfirm' });\n\n /** Anchor side. @default 'top' */\n readonly position = input<WrPopconfirmPosition>('top');\n\n /** Label for the confirm button. @default 'Confirm' */\n /** Confirm button text. Falls back to `popconfirm.confirm`. */\n readonly confirmText = input<string | null>(null);\n\n /** Label for the cancel button. @default 'Cancel' */\n /** Cancel button text. Falls back to `popconfirm.cancel`. */\n readonly cancelText = input<string | null>(null);\n\n /**\n * Accessible name of the confirmation dialog. `role=\"dialog\"` with no name\n * announces as a bare \"dialog\". Falls back to `popconfirm.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The catalog has carried these translated for as long as the component has\n // existed; the labels were hard-coded English defaults, so a localized app got\n // English buttons with the right strings sitting one file away.\n private readonly resolvedConfirm = useI18nText(this.confirmText, 'popconfirm.confirm', 'Confirm');\n private readonly resolvedCancel = useI18nText(this.cancelText, 'popconfirm.cancel', 'Cancel');\n private readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'popconfirm.label', 'Confirm action');\n\n /** Color of the confirm button. @default 'primary' */\n readonly confirmColor = input<WrColor>('primary');\n\n /** Fires when the user clicks confirm. */\n readonly confirmed = output<void>();\n\n /** Fires when the user clicks cancel or dismisses the overlay. */\n readonly cancelled = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so the host bindings can read it. */\n readonly isOpen = signal(false);\n\n private overlayRef: OverlayRef | null = null;\n\n private readonly uid = ++popconfirmUid;\n\n /** @internal Public so the host binding can read it. */\n protected readonly panelId = `wr-popconfirm-${this.uid}`;\n\n private readonly messageId = `wr-popconfirm-message-${this.uid}`;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.dispose());\n }\n\n /** @internal */\n protected toggle(event: MouseEvent): void {\n event.stopPropagation();\n if (this.overlayRef) {\n this.close();\n } else {\n this.open();\n }\n }\n\n open(): void {\n if (this.overlayRef) return;\n\n // Read ONCE, here, and mirror this list rather than the input: the side is\n // chosen at open and a later `position` write moves nothing, so a follower\n // that re-read the signal would let a direction flip quietly adopt a\n // position the panel never opened with — and the `wr-popconfirm-overlay--…`\n // class minted from the same read below, which is what the stylesheet hangs\n // the arrow and the spacing off, would still name the old one.\n const positions = WR_POPCONFIRM_POSITIONS[this.position()];\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(positions, this.isRtl()))\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: ['wr-popconfirm-overlay', `wr-popconfirm-overlay--${this.position()}`],\n });\n\n // `isRtl()` above answered once, at `create()`, and so did the CDK's own\n // capture of the direction — neither is revisited if the app flips while the\n // question is still on screen. Both halves have to move: the `dir` on the\n // host, so `start` / `end` resolve to the other edge, and the mirrored list,\n // because `offsetX` is added to the final PHYSICAL x. Leave the list behind\n // and the 8px gap on `left` / `right` becomes an 8px overlap over the very\n // control the panel is asking about.\n wrFollowDirection(this.overlayRef, this.dir, this.injector, direction =>\n positionStrategy.withPositions(wrMirrorOffsets(positions, direction === 'rtl'))\n );\n\n // Non-modal by choice, like `wr-popover`: an outside click or Escape closes it,\n // so trapping focus would only make it harder to leave. It still needs a role, a\n // name and the question read out as its description.\n const pane = this.overlayRef.overlayElement;\n pane.id = this.panelId;\n pane.setAttribute('role', 'dialog');\n pane.setAttribute('aria-modal', 'false');\n pane.setAttribute('aria-label', this.resolvedAriaLabel());\n pane.setAttribute('aria-describedby', this.messageId);\n\n const portal = new ComponentPortal(WrPopconfirmPanel, this.vcr);\n const ref = this.overlayRef.attach(portal);\n ref.setInput('message', this.message());\n ref.setInput('messageId', this.messageId);\n ref.setInput('confirmText', this.resolvedConfirm());\n ref.setInput('cancelText', this.resolvedCancel());\n ref.setInput('confirmColor', this.confirmColor());\n // Render now rather than next frame: the buttons have to exist before focus can\n // move to one, and a deferred focus is the class of bug this repo keeps finding.\n ref.changeDetectorRef.detectChanges();\n // Focus has to enter the panel — the overlay container sits at the end of\n // `<body>`, so Tab from the trigger went to the next thing on the PAGE and the\n // only way to confirm was unreachable. Cancel first: the action being confirmed\n // is usually the destructive one.\n pane.querySelector<HTMLElement>('.wr-popconfirm__actions wr-btn')?.focus();\n this.isOpen.set(true);\n\n ref.instance.confirmed.subscribe(() => {\n this.confirmed.emit();\n this.close();\n });\n ref.instance.cancelled.subscribe(() => this.dismiss());\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.dismiss();\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n close(): void {\n this.dispose();\n }\n\n private dismiss(): void {\n if (!this.overlayRef) return;\n this.cancelled.emit();\n this.dispose();\n }\n\n private dispose(): void {\n if (!this.overlayRef) return;\n // Focus lives inside the panel while it is open, and removing the panel would\n // drop it to `<body>` — hand it back to the trigger instead, as `wr-dropdown`\n // does on Escape. Only when focus is still IN there: if the user has already\n // clicked elsewhere, taking it back would be stealing.\n const returnFocus = this.overlayRef.overlayElement.contains(document.activeElement);\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.isOpen.set(false);\n if (returnFocus) this.host.nativeElement.focus();\n }\n\n /**\n * Whether the app reads right-to-left.\n *\n * Optional inject: `Directionality` is root-provided, so this is never null in\n * an app — but a bare `TestBed` that provides nothing should still get a\n * component that works, and defaulting to LTR is the honest fallback.\n */\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n}\n","/**\n * Generated b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over** — template content, opens on click (or hover), announces
33
33
  * `role="dialog"` and is what the trigger's `aria-expanded` describes;
34
- * - **tooltip** — string content, opens on hover AND focus after a delay,
35
- * announces `role="tooltip"` and DESCRIBES its trigger instead of being
36
- * owned by it.
34
+ * - **tooltip** — string content, opens after a delay on hover or on KEYBOARD
35
+ * focus (never on a `.focus()` call — see {@link focus}), announces
36
+ * `role="tooltip"` and DESCRIBES its trigger instead of being owned by it.
37
37
  *
38
38
  * The panel is never inside the trigger: it is a portal in the overlay
39
39
  * container, a sibling of the whole app. It is reached through the document
@@ -123,7 +123,9 @@ class WrPopoverHarness extends ContentContainerComponentHarness {
123
123
  * Hover leads because a click is an outside pointer event for every OTHER open
124
124
  * panel, so leading with it would dismiss someone else's popover on the way to
125
125
  * opening this one; a click-driven popover ignores the hover outright. A
126
- * tooltip is never clicked at all — hover and focus are its only gestures.
126
+ * tooltip is never clicked at all, and hover is the only one of its two
127
+ * gestures a harness can perform — the other is a keyboard focus, which is
128
+ * `FocusMonitor`'s to grant (see {@link focus}).
127
129
  *
128
130
  * Throws when nothing appears: a tooltip with an empty string never opens, and
129
131
  * a spec on fake timers has to advance the clock itself.
@@ -166,7 +168,22 @@ class WrPopoverHarness extends ContentContainerComponentHarness {
166
168
  async mouseAway() {
167
169
  return (await this.host()).mouseAway();
168
170
  }
169
- /** Focus the trigger — a tooltip's other opening gesture, so keyboard users get the hint too. */
171
+ /**
172
+ * Focus the trigger PROGRAMMATICALLY — and note that this does not open a
173
+ * tooltip.
174
+ *
175
+ * `TestElement.focus()` is a `.focus()` call, which is the one kind of focus a
176
+ * tooltip deliberately ignores: it shows for a KEYBOARD focus only, because
177
+ * every overlay in the catalog hands focus back to the trigger it was opened
178
+ * from, and a tooltip that answered those appeared with no pointer to leave and
179
+ * no focus to lose. So this method is the way to assert that NOTHING happens.
180
+ *
181
+ * There is no keyboard-origin twin, and it cannot be written honestly here:
182
+ * origin is `FocusMonitor`'s answer, this class has no injector, and the Tab
183
+ * that would earn it moves focus in a browser and not in jsdom. A spec that
184
+ * needs the opening gesture drives `FocusMonitor.focusVia(el, 'keyboard')`
185
+ * itself, the way `popover.spec.ts` does — or uses `hover()`.
186
+ */
170
187
  async focus() {
171
188
  return (await this.host()).focus();
172
189
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-popover-testing.mjs","sources":["../../../projects/lib/popover/testing/wr-popover-harness.ts","../../../projects/lib/popover/testing/ngwr-popover-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrPopoverPosition } from 'ngwr/popover';\n\nimport type { WrPopoverHarnessFilters } from './interfaces';\n\n/** How long the waiters poll before giving up, in ms. Generous next to the 120ms default delays. */\nconst DEFAULT_TIMEOUT = 1000;\n\n/** How often they re-check, in ms. */\nconst POLL_STEP = 10;\n\n/**\n * The real `setTimeout`, captured at module load — before a spec can install\n * fake timers.\n *\n * The waiters have to let REAL time pass: the show / hide delays are plain\n * `setTimeout`s inside the directive, and under zoneless change detection\n * `whenStable()` resolves without waiting for a macrotask. Reading the faked\n * global instead would mean the sleep never fires at all, and the harness would\n * hang where it should fail with the message it prepared.\n */\nconst realSetTimeout = globalThis.setTimeout;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => {\n realSetTimeout(resolve, ms);\n });\n}\n\n/**\n * Test harness for `[wrPopover]` — both shapes the one directive ships:\n *\n * - **popover** — template content, opens on click (or hover), announces\n * `role=\"dialog\"` and is what the trigger's `aria-expanded` describes;\n * - **tooltip** — string content, opens on hover AND focus after a delay,\n * announces `role=\"tooltip\"` and DESCRIBES its trigger instead of being\n * owned by it.\n *\n * The panel is never inside the trigger: it is a portal in the overlay\n * container, a sibling of the whole app. It is reached through the document\n * root, scoped by the id the trigger publishes while the panel is showing —\n * `aria-controls` in popover mode, `aria-describedby` in tooltip mode. That id\n * is what lets two popovers be open at once without reading each other's\n * content, and it is why every panel reader throws while the panel is shut:\n * there is no element to answer about.\n *\n * Being a CONTENT CONTAINER is the point in popover mode — the panel holds the\n * consumer's own components, so `popover.getHarness(WrButtonHarness…)` reaches\n * them without the spec ever touching the overlay.\n *\n * **Timing.** A tooltip opens on `showDelay` and hides on `hideDelay`; a hover\n * popover hides 120ms after the pointer leaves. `open()`, `close()` and the two\n * waiters sit out that REAL time, so a spec that installs fake timers should\n * drive the clock itself and read `isOpen()` rather than call them.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const details = await loader.getHarness(WrPopoverHarness.with({ triggerText: 'Details' }));\n *\n * await details.open();\n * expect(await details.getRole()).toBe('dialog');\n * await (await details.getHarness(WrButtonHarness.with({ text: 'Confirm' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrPopoverHarness extends ContentContainerComponentHarness {\n /**\n * The directive's host — whatever element the consumer put `[wrPopover]` on.\n *\n * Matched by the marker class, not by `[wrPopover]`: popover-mode content is a\n * `TemplateRef` and so is always BOUND (`[wrPopover]=\"tpl\"`), which leaves no\n * attribute in the DOM at all, and a CLOSED tooltip publishes no ARIA either.\n * (A tooltip written with the static string form, `wrPopover=\"Save changes\"`,\n * does keep the attribute — but only that one shape would be findable by it.)\n * Same shape as `.wr-dropdown-trigger`.\n */\n static hostSelector = '.wr-popover-trigger';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrPopoverHarnessFilters = {}): HarnessPredicate<WrPopoverHarness> {\n return new HarnessPredicate(WrPopoverHarness, options)\n .addOption('triggerText', options.triggerText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('mode', options.mode, async (harness, mode) => (await harness.getMode()) === mode)\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /**\n * Which shape this trigger carries.\n *\n * Read from the ARIA contract, not from the `mode` input: a bound `[mode]`\n * never reaches the DOM, while `aria-haspopup=\"dialog\"` is on every popover\n * trigger and on no tooltip trigger — a tooltip is a description of the\n * control, not a popup it owns.\n */\n async getMode(): Promise<'popover' | 'tooltip'> {\n return (await (await this.host()).getAttribute('aria-haspopup')) === 'dialog' ? 'popover' : 'tooltip';\n }\n\n /** The trigger's own visible text. The panel's content is `getContentText()`. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * Whether the panel is showing.\n *\n * Two different signals because the two modes advertise different things: a\n * popover flips `aria-expanded` on its trigger, a tooltip has none at all and\n * links its description instead. So a tooltip's answer is only as good as the\n * directive's claim on `aria-describedby` — put the tooltip on a control that\n * is ALSO described by something else (a `<wr-form-field>` hint, say) and the\n * two bindings fight over one attribute.\n */\n async isOpen(): Promise<boolean> {\n const host = await this.host();\n return (await this.getMode()) === 'popover'\n ? (await host.getAttribute('aria-expanded')) === 'true'\n : (await host.getAttribute('aria-describedby')) !== null;\n }\n\n /**\n * Open the panel with the gesture this trigger actually answers to, and wait\n * until it is showing.\n *\n * `trigger` is an input, so the DOM does not say which gesture this popover\n * wants — the harness moves the pointer on first and falls back to a click.\n * Hover leads because a click is an outside pointer event for every OTHER open\n * panel, so leading with it would dismiss someone else's popover on the way to\n * opening this one; a click-driven popover ignores the hover outright. A\n * tooltip is never clicked at all — hover and focus are its only gestures.\n *\n * Throws when nothing appears: a tooltip with an empty string never opens, and\n * a spec on fake timers has to advance the clock itself.\n */\n async open(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.isOpen()) return;\n\n const host = await this.host();\n await host.hover();\n if ((await this.getMode()) === 'tooltip') return this.waitUntilOpen(timeout);\n\n if (await this.isOpen()) return;\n await host.click();\n return this.waitUntilOpen(timeout);\n }\n\n /**\n * Dismiss the panel and wait until it is gone.\n *\n * Escape, because it is the one gesture both modes honour immediately: a\n * popover is closed by the overlay's keyboard dispatcher, a tooltip by the\n * directive's own binding — no delay in either. To exercise the delayed\n * pointer path instead, call `mouseAway()` and then `waitUntilClosed()`.\n */\n async close(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await this.sendEscape();\n return this.waitUntilClosed(timeout);\n }\n\n /** Click the trigger. Opens a click-driven popover, toggles it shut again, and does nothing else. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move the pointer onto the trigger — opens a hover popover at once, a tooltip after `showDelay`. */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer off the trigger. The panel goes after the grace period, not instantly. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /** Focus the trigger — a tooltip's other opening gesture, so keyboard users get the hint too. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blur the trigger, which hides a tooltip after `hideDelay`. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Press Escape on the trigger. Both modes dismiss on it, and neither moves focus. */\n async sendEscape(): Promise<void> {\n return (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** Wait out a pending show. Resolves at once when the panel is already up. */\n async waitUntilOpen(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.settled(true, timeout)) return;\n\n throw new Error(\n `WrPopoverHarness.waitUntilOpen(): nothing opened within ${timeout}ms. A tooltip waits out its ` +\n 'showDelay (and never opens at all for an empty string); this wait uses real time, so a spec on ' +\n 'fake timers has to advance the clock itself and read isOpen().'\n );\n }\n\n /** Wait out a pending hide. Resolves at once when the panel is already gone. */\n async waitUntilClosed(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.settled(false, timeout)) return;\n\n throw new Error(\n `WrPopoverHarness.waitUntilClosed(): still showing after ${timeout}ms. A hover popover closes 120ms ` +\n 'after the pointer leaves — and only if it left at all, since a mouseleave INTO that panel is ' +\n 'deliberately not a leave. A tooltip closes on its hideDelay after mouseleave or blur.'\n );\n }\n\n /**\n * The panel's text.\n *\n * In tooltip mode that is the string itself, rendered into the small text\n * panel; in popover mode it is everything the projected template renders.\n */\n async getContentText(): Promise<string> {\n return (await this.panel()).text();\n }\n\n /**\n * The role the open panel announces: `'dialog'` for a popover, `'tooltip'` for\n * a tooltip.\n *\n * Worth asserting rather than assuming, twice over: the directive sets it on\n * the OVERLAY PANE, not on the content a consumer wrote, and in tooltip mode\n * the pane is deliberately the only element carrying it — the text panel\n * inside has none, or the description would nest a tooltip in a tooltip.\n */\n async getRole(): Promise<string | null> {\n return (await this.panel()).getAttribute('role');\n }\n\n /**\n * The panel's accessible name — `null` in tooltip mode.\n *\n * A popover is a named `role=\"dialog\"`: the `ariaLabel` input, or the i18n\n * catalog's `popover.label` when the consumer says nothing, because an unnamed\n * dialog announces as \"dialog\" and nothing else. A tooltip has no name of its\n * own; it IS the trigger's description, which is `getDescriptionText()`.\n */\n async getLabel(): Promise<string | null> {\n return (await this.panel()).getAttribute('aria-label');\n }\n\n /**\n * Whether the panel claims modality.\n *\n * `false`, deliberately, and worth pinning: the popover sets\n * `aria-modal=\"false\"` because focus is NOT trapped and the panel dismisses on\n * outside click / Escape rather than blocking the page.\n */\n async isModal(): Promise<boolean> {\n return (await (await this.panel()).getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * Where the panel sits relative to the trigger, or `null` when it is presented\n * as a sheet and has no anchor.\n *\n * The APPLIED position, not the requested one: CDK flips a placement that does\n * not fit to the next in its fallback chain and swaps the modifier class with\n * it. Under a unit test that is always the requested placement — jsdom measures\n * every box as 0×0, so the first candidate always \"fits\" — but in a browser the\n * two can differ, and this answers what is on screen. The directive defaults\n * the request per mode (`bottom` for a popover, `top` for a tooltip).\n *\n * The arrow itself is a `::after` pseudo-element, so it exists for no DOM query\n * at all; this class is the placement, and it is what the arrow's own CSS keys\n * off.\n */\n async getPosition(): Promise<WrPopoverPosition | null> {\n const classes = (await (await this.panel()).getAttribute('class')) ?? '';\n const modifier = /wr-(?:popover|tooltip)-overlay--([a-z-]+)/.exec(classes);\n return modifier ? (modifier[1] as WrPopoverPosition) : null;\n }\n\n /** Whether the popover is presented as a full-width bottom sheet instead of an anchored panel. */\n async isSheet(): Promise<boolean> {\n return (await this.panel()).hasClass('wr-overlay-sheet');\n }\n\n /**\n * The text a screen reader reads as the TRIGGER'S DESCRIPTION, or `null` when\n * it describes nothing.\n *\n * This resolves `aria-describedby` the way an assistive technology would, so\n * it answers the whole of tooltip mode's naming contract in one call. Always\n * `null` for a popover, open or shut — a popover is a thing the trigger owns\n * (`aria-haspopup` / `aria-expanded`), never a description of it.\n */\n async getDescriptionText(): Promise<string | null> {\n const id = await (await this.host()).getAttribute('aria-describedby');\n if (!id) return null;\n\n const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();\n return described ? described.text() : null;\n }\n\n /**\n * Harnesses for the consumer's own components are resolved inside THIS\n * instance's panel.\n *\n * Scoped by the published id rather than by `.wr-popover-overlay`: the overlay\n * container is shared, so a class query would answer with whichever popover\n * opened first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /** Poll until `isOpen()` reports `open`, and say whether it did. */\n private async settled(open: boolean, timeout: number): Promise<boolean> {\n for (let waited = 0; waited <= timeout; waited += POLL_STEP) {\n if ((await this.isOpen()) === open) return true;\n\n await sleep(POLL_STEP);\n await this.forceStabilize();\n }\n return false;\n }\n\n /** This instance's overlay pane. */\n private async panel(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /** The id the trigger publishes for its panel, which only exists while the panel does. */\n private async panelId(): Promise<string> {\n const attribute = (await this.getMode()) === 'popover' ? 'aria-controls' : 'aria-describedby';\n const id = await (await this.host()).getAttribute(attribute);\n\n if (!id) {\n throw new Error(\n `WrPopoverHarness: nothing is showing. The trigger publishes its panel id as ${attribute} only ` +\n 'while the panel is open — call open() first (a tooltip also has to wait out its showDelay).'\n );\n }\n return id;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAcH;AACA,MAAM,eAAe,GAAG,IAAI;AAE5B;AACA,MAAM,SAAS,GAAG,EAAE;AAEpB;;;;;;;;;AASG;AACH,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU;AAE5C,SAAS,KAAK,CAAC,EAAU,EAAA;AACvB,IAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAG;AAC3B,QAAA,cAAc,CAAC,OAAO,EAAE,EAAE,CAAC;AAC7B,IAAA,CAAC,CAAC;AACJ;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACG,MAAO,gBAAiB,SAAQ,gCAAgC,CAAA;AACpE;;;;;;;;;AASG;AACH,IAAA,OAAO,YAAY,GAAG,qBAAqB;;AAG3C,IAAA,OAAO,IAAI,CAAC,OAAA,GAAmC,EAAE,EAAA;AAC/C,QAAA,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO;aAClD,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,IAAI,KAC3D,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC;aAE/D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,IAAI,KAAK,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI;aAC3F,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,IAAI,KAAK,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAChG;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,OAAO,GAAA;QACX,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,E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AA,OAAO,EAAE;IACX;;;ACxWF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-popover-testing.mjs","sources":["../../../projects/lib/popover/testing/wr-popover-harness.ts","../../../projects/lib/popover/testing/ngwr-popover-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrPopoverPosition } from 'ngwr/popover';\n\nimport type { WrPopoverHarnessFilters } from './interfaces';\n\n/** How long the waiters poll before giving up, in ms. Generous next to the 120ms default delays. */\nconst DEFAULT_TIMEOUT = 1000;\n\n/** How often they re-check, in ms. */\nconst POLL_STEP = 10;\n\n/**\n * The real `setTimeout`, captured at module load — before a spec can install\n * fake timers.\n *\n * The waiters have to let REAL time pass: the show / hide delays are plain\n * `setTimeout`s inside the directive, and under zoneless change detection\n * `whenStable()` resolves without waiting for a macrotask. Reading the faked\n * global instead would mean the sleep never fires at all, and the harness would\n * hang where it should fail with the message it prepared.\n */\nconst realSetTimeout = globalThis.setTimeout;\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => {\n realSetTimeout(resolve, ms);\n });\n}\n\n/**\n * Test harness for `[wrPopover]` — both shapes the one directive ships:\n *\n * - **popover** — template content, opens on click (or hover), announces\n * `role=\"dialog\"` and is what the trigger's `aria-expanded` describes;\n * - **tooltip** — string content, opens after a delay on hover or on KEYBOARD\n * focus (never on a `.focus()` call — see {@link focus}), announces\n * `role=\"tooltip\"` and DESCRIBES its trigger instead of being owned by it.\n *\n * The panel is never inside the trigger: it is a portal in the overlay\n * container, a sibling of the whole app. It is reached through the document\n * root, scoped by the id the trigger publishes while the panel is showing —\n * `aria-controls` in popover mode, `aria-describedby` in tooltip mode. That id\n * is what lets two popovers be open at once without reading each other's\n * content, and it is why every panel reader throws while the panel is shut:\n * there is no element to answer about.\n *\n * Being a CONTENT CONTAINER is the point in popover mode — the panel holds the\n * consumer's own components, so `popover.getHarness(WrButtonHarness…)` reaches\n * them without the spec ever touching the overlay.\n *\n * **Timing.** A tooltip opens on `showDelay` and hides on `hideDelay`; a hover\n * popover hides 120ms after the pointer leaves. `open()`, `close()` and the two\n * waiters sit out that REAL time, so a spec that installs fake timers should\n * drive the clock itself and read `isOpen()` rather than call them.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const details = await loader.getHarness(WrPopoverHarness.with({ triggerText: 'Details' }));\n *\n * await details.open();\n * expect(await details.getRole()).toBe('dialog');\n * await (await details.getHarness(WrButtonHarness.with({ text: 'Confirm' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrPopoverHarness extends ContentContainerComponentHarness {\n /**\n * The directive's host — whatever element the consumer put `[wrPopover]` on.\n *\n * Matched by the marker class, not by `[wrPopover]`: popover-mode content is a\n * `TemplateRef` and so is always BOUND (`[wrPopover]=\"tpl\"`), which leaves no\n * attribute in the DOM at all, and a CLOSED tooltip publishes no ARIA either.\n * (A tooltip written with the static string form, `wrPopover=\"Save changes\"`,\n * does keep the attribute — but only that one shape would be findable by it.)\n * Same shape as `.wr-dropdown-trigger`.\n */\n static hostSelector = '.wr-popover-trigger';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrPopoverHarnessFilters = {}): HarnessPredicate<WrPopoverHarness> {\n return new HarnessPredicate(WrPopoverHarness, options)\n .addOption('triggerText', options.triggerText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('mode', options.mode, async (harness, mode) => (await harness.getMode()) === mode)\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /**\n * Which shape this trigger carries.\n *\n * Read from the ARIA contract, not from the `mode` input: a bound `[mode]`\n * never reaches the DOM, while `aria-haspopup=\"dialog\"` is on every popover\n * trigger and on no tooltip trigger — a tooltip is a description of the\n * control, not a popup it owns.\n */\n async getMode(): Promise<'popover' | 'tooltip'> {\n return (await (await this.host()).getAttribute('aria-haspopup')) === 'dialog' ? 'popover' : 'tooltip';\n }\n\n /** The trigger's own visible text. The panel's content is `getContentText()`. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * Whether the panel is showing.\n *\n * Two different signals because the two modes advertise different things: a\n * popover flips `aria-expanded` on its trigger, a tooltip has none at all and\n * links its description instead. So a tooltip's answer is only as good as the\n * directive's claim on `aria-describedby` — put the tooltip on a control that\n * is ALSO described by something else (a `<wr-form-field>` hint, say) and the\n * two bindings fight over one attribute.\n */\n async isOpen(): Promise<boolean> {\n const host = await this.host();\n return (await this.getMode()) === 'popover'\n ? (await host.getAttribute('aria-expanded')) === 'true'\n : (await host.getAttribute('aria-describedby')) !== null;\n }\n\n /**\n * Open the panel with the gesture this trigger actually answers to, and wait\n * until it is showing.\n *\n * `trigger` is an input, so the DOM does not say which gesture this popover\n * wants — the harness moves the pointer on first and falls back to a click.\n * Hover leads because a click is an outside pointer event for every OTHER open\n * panel, so leading with it would dismiss someone else's popover on the way to\n * opening this one; a click-driven popover ignores the hover outright. A\n * tooltip is never clicked at all, and hover is the only one of its two\n * gestures a harness can perform — the other is a keyboard focus, which is\n * `FocusMonitor`'s to grant (see {@link focus}).\n *\n * Throws when nothing appears: a tooltip with an empty string never opens, and\n * a spec on fake timers has to advance the clock itself.\n */\n async open(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.isOpen()) return;\n\n const host = await this.host();\n await host.hover();\n if ((await this.getMode()) === 'tooltip') return this.waitUntilOpen(timeout);\n\n if (await this.isOpen()) return;\n await host.click();\n return this.waitUntilOpen(timeout);\n }\n\n /**\n * Dismiss the panel and wait until it is gone.\n *\n * Escape, because it is the one gesture both modes honour immediately: a\n * popover is closed by the overlay's keyboard dispatcher, a tooltip by the\n * directive's own binding — no delay in either. To exercise the delayed\n * pointer path instead, call `mouseAway()` and then `waitUntilClosed()`.\n */\n async close(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await this.sendEscape();\n return this.waitUntilClosed(timeout);\n }\n\n /** Click the trigger. Opens a click-driven popover, toggles it shut again, and does nothing else. */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move the pointer onto the trigger — opens a hover popover at once, a tooltip after `showDelay`. */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer off the trigger. The panel goes after the grace period, not instantly. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * Focus the trigger PROGRAMMATICALLY — and note that this does not open a\n * tooltip.\n *\n * `TestElement.focus()` is a `.focus()` call, which is the one kind of focus a\n * tooltip deliberately ignores: it shows for a KEYBOARD focus only, because\n * every overlay in the catalog hands focus back to the trigger it was opened\n * from, and a tooltip that answered those appeared with no pointer to leave and\n * no focus to lose. So this method is the way to assert that NOTHING happens.\n *\n * There is no keyboard-origin twin, and it cannot be written honestly here:\n * origin is `FocusMonitor`'s answer, this class has no injector, and the Tab\n * that would earn it moves focus in a browser and not in jsdom. A spec that\n * needs the opening gesture drives `FocusMonitor.focusVia(el, 'keyboard')`\n * itself, the way `popover.spec.ts` does — or uses `hover()`.\n */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blur the trigger, which hides a tooltip after `hideDelay`. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Press Escape on the trigger. Both modes dismiss on it, and neither moves focus. */\n async sendEscape(): Promise<void> {\n return (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** Wait out a pending show. Resolves at once when the panel is already up. */\n async waitUntilOpen(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.settled(true, timeout)) return;\n\n throw new Error(\n `WrPopoverHarness.waitUntilOpen(): nothing opened within ${timeout}ms. A tooltip waits out its ` +\n 'showDelay (and never opens at all for an empty string); this wait uses real time, so a spec on ' +\n 'fake timers has to advance the clock itself and read isOpen().'\n );\n }\n\n /** Wait out a pending hide. Resolves at once when the panel is already gone. */\n async waitUntilClosed(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.settled(false, timeout)) return;\n\n throw new Error(\n `WrPopoverHarness.waitUntilClosed(): still showing after ${timeout}ms. A hover popover closes 120ms ` +\n 'after the pointer leaves — and only if it left at all, since a mouseleave INTO that panel is ' +\n 'deliberately not a leave. A tooltip closes on its hideDelay after mouseleave or blur.'\n );\n }\n\n /**\n * The panel's text.\n *\n * In tooltip mode that is the string itself, rendered into the small text\n * panel; in popover mode it is everything the projected template renders.\n */\n async getContentText(): Promise<string> {\n return (await this.panel()).text();\n }\n\n /**\n * The role the open panel announces: `'dialog'` for a popover, `'tooltip'` for\n * a tooltip.\n *\n * Worth asserting rather than assuming, twice over: the directive sets it on\n * the OVERLAY PANE, not on the content a consumer wrote, and in tooltip mode\n * the pane is deliberately the only element carrying it — the text panel\n * inside has none, or the description would nest a tooltip in a tooltip.\n */\n async getRole(): Promise<string | null> {\n return (await this.panel()).getAttribute('role');\n }\n\n /**\n * The panel's accessible name — `null` in tooltip mode.\n *\n * A popover is a named `role=\"dialog\"`: the `ariaLabel` input, or the i18n\n * catalog's `popover.label` when the consumer says nothing, because an unnamed\n * dialog announces as \"dialog\" and nothing else. A tooltip has no name of its\n * own; it IS the trigger's description, which is `getDescriptionText()`.\n */\n async getLabel(): Promise<string | null> {\n return (await this.panel()).getAttribute('aria-label');\n }\n\n /**\n * Whether the panel claims modality.\n *\n * `false`, deliberately, and worth pinning: the popover sets\n * `aria-modal=\"false\"` because focus is NOT trapped and the panel dismisses on\n * outside click / Escape rather than blocking the page.\n */\n async isModal(): Promise<boolean> {\n return (await (await this.panel()).getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * Where the panel sits relative to the trigger, or `null` when it is presented\n * as a sheet and has no anchor.\n *\n * The APPLIED position, not the requested one: CDK flips a placement that does\n * not fit to the next in its fallback chain and swaps the modifier class with\n * it. Under a unit test that is always the requested placement — jsdom measures\n * every box as 0×0, so the first candidate always \"fits\" — but in a browser the\n * two can differ, and this answers what is on screen. The directive defaults\n * the request per mode (`bottom` for a popover, `top` for a tooltip).\n *\n * The arrow itself is a `::after` pseudo-element, so it exists for no DOM query\n * at all; this class is the placement, and it is what the arrow's own CSS keys\n * off.\n */\n async getPosition(): Promise<WrPopoverPosition | null> {\n const classes = (await (await this.panel()).getAttribute('class')) ?? '';\n const modifier = /wr-(?:popover|tooltip)-overlay--([a-z-]+)/.exec(classes);\n return modifier ? (modifier[1] as WrPopoverPosition) : null;\n }\n\n /** Whether the popover is presented as a full-width bottom sheet instead of an anchored panel. */\n async isSheet(): Promise<boolean> {\n return (await this.panel()).hasClass('wr-overlay-sheet');\n }\n\n /**\n * The text a screen reader reads as the TRIGGER'S DESCRIPTION, or `null` when\n * it describes nothing.\n *\n * This resolves `aria-describedby` the way an assistive technology would, so\n * it answers the whole of tooltip mode's naming contract in one call. Always\n * `null` for a popover, open or shut — a popover is a thing the trigger owns\n * (`aria-haspopup` / `aria-expanded`), never a description of it.\n */\n async getDescriptionText(): Promise<string | null> {\n const id = await (await this.host()).getAttribute('aria-describedby');\n if (!id) return null;\n\n const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();\n return described ? described.text() : null;\n }\n\n /**\n * Harnesses for the consumer's own components are resolved inside THIS\n * instance's panel.\n *\n * Scoped by the published id rather than by `.wr-popover-overlay`: the overlay\n * container is shared, so a class query would answer with whichever popover\n * opened first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /** Poll until `isOpen()` reports `open`, and say whether it did. */\n private async settled(open: boolean, timeout: number): Promise<boolean> {\n for (let waited = 0; waited <= timeout; waited += POLL_STEP) {\n if ((await this.isOpen()) === open) return true;\n\n await sleep(POLL_STEP);\n await this.forceStabilize();\n }\n return false;\n }\n\n /** This instance's overlay pane. */\n private async panel(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /** The id the trigger publishes for its panel, which only exists while the panel does. */\n private async panelId(): Promise<string> {\n const attribute = (await this.getMode()) === 'popover' ? 'aria-controls' : 'aria-describedby';\n const id = await (await this.host()).getAttribute(attribute);\n\n if (!id) {\n throw new Error(\n `WrPopoverHarness: nothing is showing. The trigger publishes its panel id as ${attribute} only ` +\n 'while the panel is open — call open() first (a tooltip also has to wait out its showDelay).'\n );\n }\n return id;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAcH;AACA,MAAM,eAAe,GAAG,IAAI;AAE5B;AACA,MAAM,SAAS,GAAG,EAAE;AAEpB;;;;;;;;;AASG;AACH,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU;AAE5C,SAAS,KAAK,CAAC,EAAU,EAAA;AACvB,IAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAG;AAC3B,QAAA,cAAc,CAAC,OAAO,EAAE,EAAE,CAAC;AAC7B,IAAA,CAAC,CAAC;AACJ;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACG,MAAO,gBAAiB,SAAQ,gCAAgC,CAAA;AACpE;;;;;;;;;AASG;AACH,IAAA,OAAO,YAAY,GAAG,qBAAqB;;AAG3C,IAAA,OAAO,IAAI,CAAC,OAAA,GAAmC,EAAE,EAAA;AAC/C,QAAA,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO;aAClD,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,IAAI,KAC3D,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC;aAE/D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,I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