ngwr 10.2.0 → 11.0.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 (471) hide show
  1. package/README.md +39 -19
  2. package/anchor/styles/_index.scss +4 -4
  3. package/back-top/styles/_index.scss +6 -1
  4. package/blur-text/styles/_index.scss +13 -0
  5. package/button/styles/_index.scss +11 -6
  6. package/carousel/styles/_index.scss +13 -2
  7. package/cascader/styles/_index.scss +2 -2
  8. package/circular-text/styles/_index.scss +2 -0
  9. package/collapse/styles/_index.scss +1 -1
  10. package/color-picker/styles/_index.scss +6 -1
  11. package/compare/styles/_index.scss +1 -2
  12. package/context-menu/styles/_index.scss +6 -1
  13. package/descriptions/styles/_index.scss +2 -2
  14. package/dialog/styles/_index.scss +38 -0
  15. package/drawer/styles/_index.scss +20 -1
  16. package/dropdown/styles/_index.scss +19 -5
  17. package/empty/styles/_index.scss +10 -0
  18. package/fesm2022/ngwr-action-sheet.mjs +15 -5
  19. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  20. package/fesm2022/ngwr-affix.mjs +43 -16
  21. package/fesm2022/ngwr-affix.mjs.map +1 -1
  22. package/fesm2022/ngwr-alert.mjs +3 -3
  23. package/fesm2022/ngwr-anchor.mjs +20 -8
  24. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  25. package/fesm2022/ngwr-aurora.mjs +4 -4
  26. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  27. package/fesm2022/ngwr-avatar.mjs +33 -9
  28. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  29. package/fesm2022/ngwr-back-top.mjs +8 -4
  30. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  31. package/fesm2022/ngwr-badge.mjs +6 -6
  32. package/fesm2022/ngwr-badge.mjs.map +1 -1
  33. package/fesm2022/ngwr-bar-chart.mjs +32 -11
  34. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  35. package/fesm2022/ngwr-blur-text.mjs +4 -4
  36. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  37. package/fesm2022/ngwr-border-glow.mjs +4 -4
  38. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  39. package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
  40. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  41. package/fesm2022/ngwr-burger.mjs +11 -6
  42. package/fesm2022/ngwr-burger.mjs.map +1 -1
  43. package/fesm2022/ngwr-button-testing.mjs +96 -0
  44. package/fesm2022/ngwr-button-testing.mjs.map +1 -0
  45. package/fesm2022/ngwr-button.mjs +89 -24
  46. package/fesm2022/ngwr-button.mjs.map +1 -1
  47. package/fesm2022/ngwr-calendar-heatmap.mjs +42 -10
  48. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  49. package/fesm2022/ngwr-calendar.mjs +108 -9
  50. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  51. package/fesm2022/ngwr-card.mjs +10 -10
  52. package/fesm2022/ngwr-card.mjs.map +1 -1
  53. package/fesm2022/ngwr-carousel-testing.mjs +377 -0
  54. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
  55. package/fesm2022/ngwr-carousel.mjs +72 -18
  56. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  57. package/fesm2022/ngwr-cascader-testing.mjs +534 -0
  58. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
  59. package/fesm2022/ngwr-cascader.mjs +4 -4
  60. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  61. package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
  62. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
  63. package/fesm2022/ngwr-checkbox.mjs +15 -9
  64. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  65. package/fesm2022/ngwr-circular-text.mjs +4 -4
  66. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  67. package/fesm2022/ngwr-click-spark.mjs +4 -4
  68. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  69. package/fesm2022/ngwr-clipboard.mjs +18 -4
  70. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  71. package/fesm2022/ngwr-collapse-testing.mjs +368 -0
  72. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
  73. package/fesm2022/ngwr-collapse.mjs +9 -9
  74. package/fesm2022/ngwr-color-picker.mjs +139 -19
  75. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  76. package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
  77. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
  78. package/fesm2022/ngwr-command-palette.mjs +60 -10
  79. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  80. package/fesm2022/ngwr-compare.mjs +105 -15
  81. package/fesm2022/ngwr-compare.mjs.map +1 -1
  82. package/fesm2022/ngwr-confetti.mjs +3 -3
  83. package/fesm2022/ngwr-config.mjs +106 -0
  84. package/fesm2022/ngwr-config.mjs.map +1 -0
  85. package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
  86. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
  87. package/fesm2022/ngwr-context-menu.mjs +104 -18
  88. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  89. package/fesm2022/ngwr-cookie.mjs +8 -4
  90. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  91. package/fesm2022/ngwr-counter.mjs +17 -9
  92. package/fesm2022/ngwr-counter.mjs.map +1 -1
  93. package/fesm2022/ngwr-date-adapter-fns.mjs +3 -3
  94. package/fesm2022/ngwr-date-adapter-luxon.mjs +55 -7
  95. package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
  96. package/fesm2022/ngwr-date-adapter.mjs +57 -11
  97. package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
  98. package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
  99. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
  100. package/fesm2022/ngwr-date-picker.mjs +409 -57
  101. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  102. package/fesm2022/ngwr-decrypt-text.mjs +30 -12
  103. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  104. package/fesm2022/ngwr-density.mjs +6 -6
  105. package/fesm2022/ngwr-descriptions.mjs +6 -6
  106. package/fesm2022/ngwr-dialog-testing.mjs +89 -0
  107. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
  108. package/fesm2022/ngwr-dialog.mjs +33 -17
  109. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  110. package/fesm2022/ngwr-directives.mjs +48 -24
  111. package/fesm2022/ngwr-directives.mjs.map +1 -1
  112. package/fesm2022/ngwr-divider.mjs +3 -3
  113. package/fesm2022/ngwr-donut-chart.mjs +24 -7
  114. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  115. package/fesm2022/ngwr-drag-drop.mjs +7 -7
  116. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  117. package/fesm2022/ngwr-drawer-testing.mjs +250 -0
  118. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
  119. package/fesm2022/ngwr-drawer.mjs +37 -19
  120. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  121. package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
  122. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
  123. package/fesm2022/ngwr-dropdown.mjs +19 -11
  124. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  125. package/fesm2022/ngwr-empty.mjs +26 -9
  126. package/fesm2022/ngwr-empty.mjs.map +1 -1
  127. package/fesm2022/ngwr-event-calendar.mjs +62 -15
  128. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  129. package/fesm2022/ngwr-falling-text.mjs +4 -4
  130. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  131. package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
  132. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
  133. package/fesm2022/ngwr-file-upload.mjs +3 -3
  134. package/fesm2022/ngwr-form-testing.mjs +451 -0
  135. package/fesm2022/ngwr-form-testing.mjs.map +1 -0
  136. package/fesm2022/ngwr-form.mjs +28 -12
  137. package/fesm2022/ngwr-form.mjs.map +1 -1
  138. package/fesm2022/ngwr-fuzzy-text.mjs +11 -4
  139. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  140. package/fesm2022/ngwr-gauge.mjs +21 -7
  141. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  142. package/fesm2022/ngwr-glitch-text.mjs +4 -4
  143. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  144. package/fesm2022/ngwr-gradient-text.mjs +4 -4
  145. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  146. package/fesm2022/ngwr-hotkey.mjs +31 -10
  147. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-en.mjs +61 -0
  149. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-ru.mjs +59 -0
  151. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n.mjs +9 -9
  153. package/fesm2022/ngwr-icon.mjs +6 -6
  154. package/fesm2022/ngwr-image-cropper.mjs +26 -3
  155. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  156. package/fesm2022/ngwr-input-number-testing.mjs +306 -0
  157. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
  158. package/fesm2022/ngwr-input-number.mjs +37 -5
  159. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  160. package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
  161. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
  162. package/fesm2022/ngwr-input-otp.mjs +39 -8
  163. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  164. package/fesm2022/ngwr-input-testing.mjs +102 -0
  165. package/fesm2022/ngwr-input-testing.mjs.map +1 -0
  166. package/fesm2022/ngwr-input.mjs +62 -25
  167. package/fesm2022/ngwr-input.mjs.map +1 -1
  168. package/fesm2022/ngwr-keyboard.mjs +3 -3
  169. package/fesm2022/ngwr-knob.mjs +46 -10
  170. package/fesm2022/ngwr-knob.mjs.map +1 -1
  171. package/fesm2022/ngwr-layout.mjs +36 -20
  172. package/fesm2022/ngwr-layout.mjs.map +1 -1
  173. package/fesm2022/ngwr-lightbox.mjs +35 -8
  174. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  175. package/fesm2022/ngwr-line-chart.mjs +19 -6
  176. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  177. package/fesm2022/ngwr-list.mjs +14 -9
  178. package/fesm2022/ngwr-list.mjs.map +1 -1
  179. package/fesm2022/ngwr-loading-bar.mjs +71 -31
  180. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  181. package/fesm2022/ngwr-markdown-testing.mjs +516 -0
  182. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
  183. package/fesm2022/ngwr-markdown.mjs +1492 -0
  184. package/fesm2022/ngwr-markdown.mjs.map +1 -0
  185. package/fesm2022/ngwr-marquee.mjs +19 -8
  186. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  187. package/fesm2022/ngwr-media.mjs +3 -3
  188. package/fesm2022/ngwr-mention-testing.mjs +513 -0
  189. package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
  190. package/fesm2022/ngwr-mention.mjs +16 -7
  191. package/fesm2022/ngwr-mention.mjs.map +1 -1
  192. package/fesm2022/ngwr-meta.mjs +28 -13
  193. package/fesm2022/ngwr-meta.mjs.map +1 -1
  194. package/fesm2022/ngwr-meter-group.mjs +22 -8
  195. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  196. package/fesm2022/ngwr-overlay.mjs +57 -8
  197. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  198. package/fesm2022/ngwr-page-header.mjs +3 -3
  199. package/fesm2022/ngwr-pagination-testing.mjs +389 -0
  200. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
  201. package/fesm2022/ngwr-pagination.mjs +27 -11
  202. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  203. package/fesm2022/ngwr-pipes.mjs +21 -21
  204. package/fesm2022/ngwr-platform.mjs +9 -9
  205. package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
  206. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
  207. package/fesm2022/ngwr-popconfirm.mjs +99 -21
  208. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  209. package/fesm2022/ngwr-popover-testing.mjs +316 -0
  210. package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
  211. package/fesm2022/ngwr-popover.mjs +48 -10
  212. package/fesm2022/ngwr-popover.mjs.map +1 -1
  213. package/fesm2022/ngwr-progress.mjs +3 -3
  214. package/fesm2022/ngwr-pull-to-refresh.mjs +19 -4
  215. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  216. package/fesm2022/ngwr-qr.mjs +15 -5
  217. package/fesm2022/ngwr-qr.mjs.map +1 -1
  218. package/fesm2022/ngwr-radio-testing.mjs +392 -0
  219. package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
  220. package/fesm2022/ngwr-radio.mjs +16 -9
  221. package/fesm2022/ngwr-radio.mjs.map +1 -1
  222. package/fesm2022/ngwr-rating-testing.mjs +384 -0
  223. package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
  224. package/fesm2022/ngwr-rating.mjs +40 -5
  225. package/fesm2022/ngwr-rating.mjs.map +1 -1
  226. package/fesm2022/ngwr-result.mjs +12 -12
  227. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  228. package/fesm2022/ngwr-scroll.mjs +3 -3
  229. package/fesm2022/ngwr-segmented-testing.mjs +512 -0
  230. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
  231. package/fesm2022/ngwr-segmented.mjs +3 -3
  232. package/fesm2022/ngwr-select-testing.mjs +268 -0
  233. package/fesm2022/ngwr-select-testing.mjs.map +1 -0
  234. package/fesm2022/ngwr-select.mjs +96 -25
  235. package/fesm2022/ngwr-select.mjs.map +1 -1
  236. package/fesm2022/ngwr-shiny-text.mjs +7 -7
  237. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  238. package/fesm2022/ngwr-sidebar.mjs +67 -14
  239. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  240. package/fesm2022/ngwr-skeleton.mjs +3 -3
  241. package/fesm2022/ngwr-slider-testing.mjs +478 -0
  242. package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
  243. package/fesm2022/ngwr-slider.mjs +59 -15
  244. package/fesm2022/ngwr-slider.mjs.map +1 -1
  245. package/fesm2022/ngwr-sparkline.mjs +28 -8
  246. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  247. package/fesm2022/ngwr-speed-dial.mjs +39 -6
  248. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  249. package/fesm2022/ngwr-spinner.mjs +14 -5
  250. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  251. package/fesm2022/ngwr-splash-cursor.mjs +4 -4
  252. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  253. package/fesm2022/ngwr-split-text.mjs +4 -4
  254. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  255. package/fesm2022/ngwr-splitter.mjs +72 -11
  256. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  257. package/fesm2022/ngwr-spotlight-card.mjs +7 -7
  258. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  259. package/fesm2022/ngwr-squircle.mjs +6 -6
  260. package/fesm2022/ngwr-star-border.mjs +4 -4
  261. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  262. package/fesm2022/ngwr-statistic.mjs +33 -16
  263. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  264. package/fesm2022/ngwr-stepper-testing.mjs +477 -0
  265. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
  266. package/fesm2022/ngwr-stepper.mjs +6 -6
  267. package/fesm2022/ngwr-storage.mjs +27 -17
  268. package/fesm2022/ngwr-storage.mjs.map +1 -1
  269. package/fesm2022/ngwr-switch-testing.mjs +77 -0
  270. package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
  271. package/fesm2022/ngwr-switch.mjs +12 -6
  272. package/fesm2022/ngwr-switch.mjs.map +1 -1
  273. package/fesm2022/ngwr-table-testing.mjs +580 -0
  274. package/fesm2022/ngwr-table-testing.mjs.map +1 -0
  275. package/fesm2022/ngwr-table.mjs +105 -44
  276. package/fesm2022/ngwr-table.mjs.map +1 -1
  277. package/fesm2022/ngwr-tabs-testing.mjs +617 -0
  278. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
  279. package/fesm2022/ngwr-tabs.mjs +44 -12
  280. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  281. package/fesm2022/ngwr-textarea-testing.mjs +238 -0
  282. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
  283. package/fesm2022/ngwr-textarea.mjs +35 -7
  284. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  285. package/fesm2022/ngwr-theme.mjs +3 -3
  286. package/fesm2022/ngwr-tilt-card.mjs +7 -7
  287. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  288. package/fesm2022/ngwr-timeline.mjs +6 -6
  289. package/fesm2022/ngwr-toast-testing.mjs +101 -0
  290. package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
  291. package/fesm2022/ngwr-toast.mjs +55 -21
  292. package/fesm2022/ngwr-toast.mjs.map +1 -1
  293. package/fesm2022/ngwr-toolbar.mjs +3 -3
  294. package/fesm2022/ngwr-tour.mjs +67 -15
  295. package/fesm2022/ngwr-tour.mjs.map +1 -1
  296. package/fesm2022/ngwr-transfer-testing.mjs +538 -0
  297. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
  298. package/fesm2022/ngwr-transfer.mjs +47 -16
  299. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  300. package/fesm2022/ngwr-tree-testing.mjs +734 -0
  301. package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
  302. package/fesm2022/ngwr-tree.mjs +75 -9
  303. package/fesm2022/ngwr-tree.mjs.map +1 -1
  304. package/fesm2022/ngwr-typewriter.mjs +7 -5
  305. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  306. package/fesm2022/ngwr-typography.mjs +3 -3
  307. package/fesm2022/ngwr-version.mjs +1 -1
  308. package/fesm2022/ngwr-version.mjs.map +1 -1
  309. package/fesm2022/ngwr-virtual-scroll.mjs +33 -7
  310. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  311. package/fesm2022/ngwr-waves.mjs +5 -5
  312. package/fesm2022/ngwr-waves.mjs.map +1 -1
  313. package/fesm2022/ngwr-window.mjs +88 -18
  314. package/fesm2022/ngwr-window.mjs.map +1 -1
  315. package/gauge/styles/_index.scss +1 -1
  316. package/glitch-text/styles/_index.scss +4 -0
  317. package/i18n/en.json +56 -0
  318. package/i18n/ru.json +56 -0
  319. package/image-cropper/styles/_index.scss +13 -1
  320. package/input/styles/_index.scss +2 -2
  321. package/input-number/styles/_index.scss +7 -2
  322. package/knob/styles/_index.scss +8 -1
  323. package/layout/styles/_index.scss +3 -3
  324. package/lightbox/styles/_index.scss +10 -2
  325. package/line-chart/styles/_index.scss +6 -0
  326. package/llms-full.txt +151 -4
  327. package/llms.txt +57 -8
  328. package/loading-bar/styles/_index.scss +1 -2
  329. package/markdown/styles/_index.scss +296 -0
  330. package/marquee/styles/_index.scss +12 -0
  331. package/mcp/api.js +512 -0
  332. package/mcp/catalog.js +157 -0
  333. package/mcp/server.js +273 -0
  334. package/mcp/tools.js +366 -0
  335. package/meter-group/styles/_index.scss +1 -1
  336. package/package.json +186 -35
  337. package/pagination/styles/_index.scss +6 -6
  338. package/popover/styles/_index.scss +37 -5
  339. package/rating/styles/_index.scss +10 -0
  340. package/schematics/use/symbol-map.json +2 -0
  341. package/segmented/styles/_index.scss +7 -0
  342. package/select/styles/_index.scss +29 -9
  343. package/sidebar/styles/_index.scss +30 -5
  344. package/slider/styles/_index.scss +15 -0
  345. package/speed-dial/styles/_index.scss +20 -0
  346. package/split-text/styles/_index.scss +13 -0
  347. package/star-border/styles/_index.scss +2 -0
  348. package/stepper/styles/_index.scss +1 -1
  349. package/styles/_grid.scss +4 -4
  350. package/styles.scss +1 -0
  351. package/switch/styles/_index.scss +5 -3
  352. package/table/styles/_index.scss +22 -11
  353. package/tabs/styles/_index.scss +11 -1
  354. package/textarea/styles/_index.scss +5 -0
  355. package/theme/styles/_colors.scss +29 -13
  356. package/theme/styles/_dark.scss +11 -3
  357. package/theme/styles/_mixins.scss +3 -0
  358. package/timeline/styles/_index.scss +2 -2
  359. package/toast/styles/_index.scss +17 -8
  360. package/toolbar/styles/_index.scss +3 -3
  361. package/tour/styles/_index.scss +7 -1
  362. package/tree/styles/_index.scss +5 -3
  363. package/types/ngwr-action-sheet.d.ts +9 -1
  364. package/types/ngwr-affix.d.ts +7 -1
  365. package/types/ngwr-anchor.d.ts +8 -1
  366. package/types/ngwr-avatar.d.ts +13 -3
  367. package/types/ngwr-bar-chart.d.ts +16 -0
  368. package/types/ngwr-burger.d.ts +6 -2
  369. package/types/ngwr-button-testing.d.ts +85 -0
  370. package/types/ngwr-button.d.ts +58 -10
  371. package/types/ngwr-calendar-heatmap.d.ts +16 -2
  372. package/types/ngwr-calendar.d.ts +37 -1
  373. package/types/ngwr-carousel-testing.d.ts +257 -0
  374. package/types/ngwr-carousel.d.ts +20 -4
  375. package/types/ngwr-cascader-testing.d.ts +392 -0
  376. package/types/ngwr-checkbox-testing.d.ts +77 -0
  377. package/types/ngwr-checkbox.d.ts +7 -2
  378. package/types/ngwr-clipboard.d.ts +8 -1
  379. package/types/ngwr-collapse-testing.d.ts +290 -0
  380. package/types/ngwr-color-picker.d.ts +20 -11
  381. package/types/ngwr-command-palette-testing.d.ts +437 -0
  382. package/types/ngwr-command-palette.d.ts +25 -2
  383. package/types/ngwr-compare.d.ts +50 -2
  384. package/types/ngwr-config.d.ts +176 -0
  385. package/types/ngwr-context-menu-testing.d.ts +401 -0
  386. package/types/ngwr-context-menu.d.ts +65 -17
  387. package/types/ngwr-counter.d.ts +6 -1
  388. package/types/ngwr-date-adapter-luxon.d.ts +26 -0
  389. package/types/ngwr-date-picker-testing.d.ts +518 -0
  390. package/types/ngwr-date-picker.d.ts +128 -8
  391. package/types/ngwr-dialog-testing.d.ts +79 -0
  392. package/types/ngwr-dialog.d.ts +13 -0
  393. package/types/ngwr-directives.d.ts +10 -1
  394. package/types/ngwr-donut-chart.d.ts +8 -1
  395. package/types/ngwr-drawer-testing.d.ts +196 -0
  396. package/types/ngwr-drawer.d.ts +15 -0
  397. package/types/ngwr-dropdown-testing.d.ts +202 -0
  398. package/types/ngwr-dropdown.d.ts +7 -1
  399. package/types/ngwr-empty.d.ts +19 -4
  400. package/types/ngwr-event-calendar.d.ts +26 -1
  401. package/types/ngwr-file-upload-testing.d.ts +194 -0
  402. package/types/ngwr-form-testing.d.ts +379 -0
  403. package/types/ngwr-form.d.ts +17 -0
  404. package/types/ngwr-gauge.d.ts +13 -1
  405. package/types/ngwr-hotkey.d.ts +2 -0
  406. package/types/ngwr-image-cropper.d.ts +10 -0
  407. package/types/ngwr-input-number-testing.d.ts +226 -0
  408. package/types/ngwr-input-number.d.ts +29 -1
  409. package/types/ngwr-input-otp-testing.d.ts +299 -0
  410. package/types/ngwr-input-otp.d.ts +23 -2
  411. package/types/ngwr-input-testing.d.ts +84 -0
  412. package/types/ngwr-input.d.ts +20 -6
  413. package/types/ngwr-knob.d.ts +18 -0
  414. package/types/ngwr-layout.d.ts +1 -0
  415. package/types/ngwr-lightbox.d.ts +17 -3
  416. package/types/ngwr-line-chart.d.ts +9 -2
  417. package/types/ngwr-list.d.ts +7 -2
  418. package/types/ngwr-loading-bar.d.ts +4 -7
  419. package/types/ngwr-markdown-testing.d.ts +462 -0
  420. package/types/ngwr-markdown.d.ts +534 -0
  421. package/types/ngwr-marquee.d.ts +12 -2
  422. package/types/ngwr-mention-testing.d.ts +359 -0
  423. package/types/ngwr-meta.d.ts +4 -2
  424. package/types/ngwr-meter-group.d.ts +11 -1
  425. package/types/ngwr-overlay.d.ts +33 -2
  426. package/types/ngwr-pagination-testing.d.ts +291 -0
  427. package/types/ngwr-pagination.d.ts +7 -1
  428. package/types/ngwr-popconfirm-testing.d.ts +235 -0
  429. package/types/ngwr-popconfirm.d.ts +31 -21
  430. package/types/ngwr-popover-testing.d.ts +221 -0
  431. package/types/ngwr-popover.d.ts +19 -2
  432. package/types/ngwr-pull-to-refresh.d.ts +7 -0
  433. package/types/ngwr-qr.d.ts +9 -1
  434. package/types/ngwr-radio-testing.d.ts +296 -0
  435. package/types/ngwr-radio.d.ts +8 -2
  436. package/types/ngwr-rating-testing.d.ts +291 -0
  437. package/types/ngwr-rating.d.ts +23 -0
  438. package/types/ngwr-segmented-testing.d.ts +401 -0
  439. package/types/ngwr-select-testing.d.ts +175 -0
  440. package/types/ngwr-select.d.ts +45 -4
  441. package/types/ngwr-sidebar.d.ts +17 -2
  442. package/types/ngwr-slider-testing.d.ts +329 -0
  443. package/types/ngwr-slider.d.ts +35 -1
  444. package/types/ngwr-sparkline.d.ts +12 -2
  445. package/types/ngwr-speed-dial.d.ts +17 -18
  446. package/types/ngwr-spinner.d.ts +8 -1
  447. package/types/ngwr-splitter.d.ts +24 -1
  448. package/types/ngwr-statistic.d.ts +12 -2
  449. package/types/ngwr-stepper-testing.d.ts +346 -0
  450. package/types/ngwr-storage.d.ts +10 -1
  451. package/types/ngwr-switch-testing.d.ts +66 -0
  452. package/types/ngwr-switch.d.ts +7 -2
  453. package/types/ngwr-table-testing.d.ts +423 -0
  454. package/types/ngwr-table.d.ts +42 -0
  455. package/types/ngwr-tabs-testing.d.ts +470 -0
  456. package/types/ngwr-tabs.d.ts +9 -0
  457. package/types/ngwr-textarea-testing.d.ts +184 -0
  458. package/types/ngwr-textarea.d.ts +7 -2
  459. package/types/ngwr-toast-testing.d.ts +80 -0
  460. package/types/ngwr-toast.d.ts +19 -4
  461. package/types/ngwr-tour.d.ts +27 -0
  462. package/types/ngwr-transfer-testing.d.ts +444 -0
  463. package/types/ngwr-transfer.d.ts +16 -1
  464. package/types/ngwr-tree-testing.d.ts +501 -0
  465. package/types/ngwr-tree.d.ts +33 -0
  466. package/types/ngwr-version.d.ts +1 -1
  467. package/types/ngwr-virtual-scroll.d.ts +13 -1
  468. package/types/ngwr-window.d.ts +23 -2
  469. package/typewriter/styles/_index.scss +1 -1
  470. package/typography/styles/_index.scss +1 -1
  471. package/window/styles/_index.scss +32 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-context-menu-testing.mjs","sources":["../../../projects/lib/context-menu/testing/wait.ts","../../../projects/lib/context-menu/testing/wr-context-menu-item-harness.ts","../../../projects/lib/context-menu/testing/wr-context-menu-harness.ts","../../../projects/lib/context-menu/testing/ngwr-context-menu-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\n/** How long the waiters poll before giving up, in ms. Generous next to the 500ms hold. */\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 * Every delay in this component family is wall-clock: a plain `setTimeout` inside\n * the directive for the 500ms long-press hold, the 120ms submenu hover and the\n * 220ms exit animation the pane is held alive through, and a `performance.now()`\n * comparison for the 200ms window in which outside presses are ignored — no timer\n * behind that one, just elapsed time. Under zoneless change detection `whenStable()` resolves\n * without waiting for a macrotask, so the waiters have to let REAL time pass —\n * reading a faked global instead would mean the sleep never fires at all, and\n * the harness would hang where it should fail with the message it prepared.\n */\nconst realSetTimeout = globalThis.setTimeout;\n\n/** Let real time pass, whatever a spec has done to the global clock. */\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => {\n realSetTimeout(resolve, ms);\n });\n}\n\nexport { DEFAULT_TIMEOUT, POLL_STEP, sleep };\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 { ComponentHarness, type HarnessLoader, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrContextMenuItemHarnessFilters } from './interfaces';\nimport { DEFAULT_TIMEOUT, POLL_STEP, sleep } from './wait';\n\n/**\n * Test harness for one `<wr-context-menu-item>` inside a context menu.\n *\n * The selector is the CLASS rather than the element, matching\n * `.wr-dropdown-item`: it is public API, and it is on the host whichever way the\n * item was written. A `<wr-context-menu-divider>` is deliberately not one of\n * these — it announces `role=\"separator\"` rather than `menuitem`, so it is not\n * something a user can land on and not a member of the item list\n * (`WrContextMenuHarness.getDividerCount()` counts those).\n *\n * An item that owns a `[submenu]` is also the way INTO it: the submenu is a\n * second overlay pane, a sibling of the root menu rather than a child of the\n * item, and it is reached through the id the item publishes as `aria-controls`\n * while it is open. `getSubmenuItems()` answers with these same harnesses, so a\n * chain of any depth is walked by repeating the call.\n *\n * @example\n * ```ts\n * const [cut, copy, more] = await menu.getItems();\n *\n * expect(await copy.isDisabled()).toBe(true);\n * await more.openSubmenu();\n * await more.clickSubmenuItem({ text: 'Duplicate' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrContextMenuItemHarness extends ComponentHarness {\n /** The class the item paints on its host. */\n static hostSelector = '.wr-context-menu-item';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrContextMenuItemHarnessFilters = {}): HarnessPredicate<WrContextMenuItemHarness> {\n return new HarnessPredicate(WrContextMenuItemHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption(\n 'hasSubmenu',\n options.hasSubmenu,\n async (harness, hasSubmenu) => (await harness.hasSubmenu()) === hasSubmenu\n );\n }\n\n /**\n * The item's label, trimmed.\n *\n * Read from the label span, not from the host: a registered icon is written in\n * with `innerHTML`, so an icon carrying a `<title>` would otherwise become\n * part of the answer.\n */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-context-menu-item__label')()).text();\n }\n\n /** The role the item announces — `menuitem`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /**\n * Whether the item refuses activation.\n *\n * `aria-disabled`, not the `--disabled` modifier class: both are there, and\n * this is the one a screen reader is told.\n */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * Whether the item owns a nested submenu.\n *\n * Read from `aria-haspopup`, not from the `--has-submenu` class or the\n * `[submenu]` input: the input is always BOUND (it takes a\n * `<wr-context-menu>` reference), so it never reaches the DOM, and the ARIA\n * property is what announces the item as a drill-down.\n */\n async hasSubmenu(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-haspopup')) === 'menu';\n }\n\n /** Whether this item's submenu is showing, per `aria-expanded`. */\n async isSubmenuOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the item shows a leading icon. */\n async hasIcon(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-context-menu-item__icon')()) !== null;\n }\n\n /** The leading icon's registered name, or `null` when the item has no icon. */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('.wr-context-menu-item__icon')();\n // `<wr-icon>` reflects the name it was asked for as `data-icon`, whether or not\n // that name is registered — so this answers what the item MEANT to draw.\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /**\n * Whether the item holds focus.\n *\n * Worth asking, because nothing in this component ever puts it there: unlike\n * `<wr-dropdown-menu>`, a context menu does not focus its first item on open\n * and has no arrow-key cursor between items. Focus lands on an item when\n * something sends it a key — which every keyboard method here does, since the\n * CDK focuses an element before typing into it.\n */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Click the item. A disabled item throws instead.\n *\n * Refusing is the only honest answer. A browser never delivers the click at all:\n * `pointer-events: none` on the `--disabled` modifier takes the row out of the\n * hit test. jsdom loads no stylesheets, so a click dispatched here DOES land on\n * the host, and while the component's own handler refuses it (a disabled item\n * dismisses nothing), the consumer's `(click)` on that same host is a separate\n * listener and runs — so the spec would record an activation that cannot happen\n * in a browser. Assert `isDisabled()` instead.\n *\n * Activating a LEAF item dismisses the whole chain, root menu included. An item\n * that owns a submenu is not a leaf: clicking it does nothing at all (hover or\n * `openSubmenu()` is how it opens).\n */\n async click(): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrContextMenuItemHarness.click(): \"${await this.getText()}\" is disabled, so clicking it would ` +\n 'report behaviour a browser cannot produce — the pointer is stopped by CSS, which jsdom does ' +\n 'not load. Assert isDisabled() instead.'\n );\n }\n\n return (await this.host()).click();\n }\n\n /**\n * Press Enter on the item — the keyboard equivalent of a click, and the route\n * a spec should prefer, since it needs no hit test.\n *\n * Deliberately does NOT refuse a disabled item the way `click()` does: the\n * component guards the keyboard path itself, so the key can be sent honestly\n * and a spec can assert that nothing happened. On an item that owns a submenu\n * this OPENS the submenu rather than activating the row, which is the APG\n * behaviour — activating it would close the menu and leave the submenu\n * unreachable from the keyboard.\n */\n async activateByKeyboard(): Promise<void> {\n return (await this.host()).sendKeys(TestKey.ENTER);\n }\n\n /**\n * Open this item's submenu with the right arrow and wait until it says so.\n *\n * The keyboard, not the pointer: it opens with no delay (hover waits out\n * 120ms — `openSubmenuByHover()` covers that path) and needs no coordinates,\n * which jsdom could not supply anyway. Sending the key focuses the item first,\n * exactly as a roving cursor would have.\n */\n async openSubmenu(timeout = DEFAULT_TIMEOUT): Promise<void> {\n await this.assertHasSubmenu('openSubmenu');\n if (await this.isSubmenuOpen()) return;\n\n await (await this.host()).sendKeys(TestKey.RIGHT_ARROW);\n if (await this.isSubmenuOpen()) return;\n if (await this.settled(true, timeout)) return;\n\n throw new Error(\n `WrContextMenuItemHarness.openSubmenu(): \"${await this.getText()}\" did not open its submenu within ` +\n `${timeout}ms. A disabled item refuses the key outright — check isDisabled().`\n );\n }\n\n /**\n * Open this item's submenu by resting the pointer on it, the gesture a mouse\n * user actually makes, and wait out the hover delay.\n */\n async openSubmenuByHover(timeout = DEFAULT_TIMEOUT): Promise<void> {\n await this.assertHasSubmenu('openSubmenuByHover');\n if (await this.isSubmenuOpen()) return;\n\n await (await this.host()).hover();\n if (await this.settled(true, timeout)) return;\n\n throw new Error(\n `WrContextMenuItemHarness.openSubmenuByHover(): \"${await this.getText()}\" did not open its submenu ` +\n `within ${timeout}ms. The hover path is a real 120ms timer, so a spec on fake timers has to ` +\n 'advance the clock itself; a disabled item ignores the pointer entirely.'\n );\n }\n\n /** Close this item's submenu with the left arrow. An item without one open is left alone. */\n async closeSubmenu(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (!(await this.isSubmenuOpen())) return;\n\n await (await this.host()).sendKeys(TestKey.LEFT_ARROW);\n if (await this.settled(false, timeout)) return;\n\n throw new Error(\n `WrContextMenuItemHarness.closeSubmenu(): \"${await this.getText()}\" still reports its submenu open ` +\n `after ${timeout}ms.`\n );\n }\n\n /**\n * The items in THIS item's submenu, in DOM order.\n *\n * Throws while the submenu is shut, and while the item owns none: both would\n * otherwise answer with an empty array, which reads like a submenu that\n * rendered nothing and fails somewhere else entirely.\n */\n async getSubmenuItems(filters: WrContextMenuItemHarnessFilters = {}): Promise<WrContextMenuItemHarness[]> {\n const loader = await this.submenuLoader();\n return loader.getAllHarnesses(WrContextMenuItemHarness.with(filters));\n }\n\n /** The labels of the items in this item's submenu, in DOM order. */\n async getSubmenuItemTexts(): Promise<string[]> {\n const items = await this.getSubmenuItems();\n return Promise.all(items.map(item => item.getText()));\n }\n\n /**\n * Open the submenu if it is shut, then click the first item in it matching the\n * filters.\n *\n * Picking a leaf dismisses the whole chain — this item's submenu and the root\n * menu with it.\n */\n async clickSubmenuItem(filters: WrContextMenuItemHarnessFilters): Promise<void> {\n await this.openSubmenu();\n\n const [item] = await this.getSubmenuItems(filters);\n if (!item) {\n const offered = await this.getSubmenuItemTexts();\n throw new Error(\n `WrContextMenuItemHarness.clickSubmenuItem(): no item matched ${JSON.stringify(filters)}. ` +\n `The submenu of \"${await this.getText()}\" offers: ${offered.join(', ')}.`\n );\n }\n\n await item.click();\n }\n\n /**\n * A loader scoped to THIS item's submenu pane.\n *\n * Scoped by the published id rather than by `.wr-context-menu`: every pane in\n * the chain — the root menu and each open submenu — carries that class in one\n * shared overlay container, so a class query would answer with whichever\n * opened first.\n */\n private async submenuLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.submenuId()}`);\n }\n\n /** The id this item publishes as `aria-controls`, which its open submenu carries. */\n private async submenuId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n if (!id) {\n const label = await this.getText();\n throw new Error(\n `WrContextMenuItemHarness: \"${label}\" has no submenu showing. An item publishes aria-controls only ` +\n 'while its submenu is open — call openSubmenu() first, and check that it owns one at all with ' +\n 'hasSubmenu().'\n );\n }\n return id;\n }\n\n /** Fail early, and by name, when the item is not a drill-down at all. */\n private async assertHasSubmenu(method: string): Promise<void> {\n if (await this.hasSubmenu()) return;\n\n throw new Error(\n `WrContextMenuItemHarness.${method}(): \"${await this.getText()}\" owns no submenu, so there is ` +\n 'nothing to open. An item that does advertises it with aria-haspopup=\"menu\" — hasSubmenu().'\n );\n }\n\n /** Poll until `isSubmenuOpen()` 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.isSubmenuOpen()) === open) return true;\n\n await sleep(POLL_STEP);\n await this.forceStabilize();\n }\n return false;\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 {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrContextMenuHarnessFilters, WrContextMenuItemHarnessFilters } from './interfaces';\nimport { DEFAULT_TIMEOUT, POLL_STEP, sleep } from './wait';\nimport { WrContextMenuItemHarness } from './wr-context-menu-item-harness';\n\n/**\n * How long to sit still before an outside press is allowed to dismiss the menu.\n *\n * The directive ignores outside events for 200ms after opening, because the very\n * right-click that opened the menu still has its own `mouseup` / `auxclick`\n * pending — without the window, lifting the finger would shut the menu again.\n */\nconst OUTSIDE_GUARD_MS = 250;\n\n/**\n * Test harness for `[wrContextMenu]` — the right-click target, and the menu it\n * opens.\n *\n * The harness matches the TARGET, because that is the only part of a context\n * menu in the fixture: `<wr-context-menu>` renders nothing of its own (it hands\n * over an `<ng-template>` and hides its host), and the menu is portalled into the\n * overlay container, a sibling of the whole app. So every item is read through\n * the document root, scoped by the `aria-controls` id the target publishes while\n * its menu is up — which is what keeps two menus on one page from answering with\n * each other's items, and what keeps a re-opened menu from answering with the one\n * still playing its exit animation.\n *\n * That scoped loader is also this harness's CONTENT loader, so\n * `menu.getHarness(…)` resolves inside THIS menu: a component the consumer\n * projected into the menu is reachable without the spec ever touching the\n * overlay.\n *\n * **How it differs from `WrDropdownHarness`, its closest sibling.**\n *\n * - The gesture is a real `contextmenu` event, not a click — `open()` sends one,\n * and `openByLongPress()` covers the touch path. There is no toggle: a second\n * right-click re-opens the menu at the new pointer position.\n * - Activating an item DISMISSES the menu (a dropdown's stays up), so\n * `clickItem()` leaves it closed.\n * - Submenus are a first-class input here rather than a nested trigger, so they\n * are driven from {@link WrContextMenuItemHarness}.\n * - The menu never takes focus: nothing focuses the first item and there is no\n * arrow-key cursor between items, so there is no `getFocusedItemText()` to ask\n * — see `WrContextMenuItemHarness.isFocused()`.\n *\n * **Timing.** The waits are real: a 500ms `setTimeout` for the long-press hold and\n * another 220ms one for the exit animation the pane is held alive through, plus the\n * outside-press window above — that one is a `performance.now()` comparison against\n * the moment the menu opened rather than a timer, so only wall-clock time gets past\n * it. The methods that must sit out real time say so; a spec on fake timers should\n * drive the clock itself and read `isOpen()`.\n *\n * @example\n * ```ts\n * const menu = await loader.getHarness(WrContextMenuHarness.with({ text: 'Right-click me' }));\n *\n * await menu.open();\n * expect(await menu.getItemTexts()).toEqual(['Cut', 'Copy', 'More']);\n *\n * await menu.clickItem({ text: 'Cut' });\n * expect(await menu.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrContextMenuHarness extends ContentContainerComponentHarness {\n /** The directive's host — whatever element the consumer put `[wrContextMenu]` on. */\n static hostSelector = '.wr-context-menu-host';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrContextMenuHarnessFilters = {}): HarnessPredicate<WrContextMenuHarness> {\n return new HarnessPredicate(WrContextMenuHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getTargetText(), text))\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /** The target's own visible text — the content that gets right-clicked. */\n async getTargetText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * Whether this target's menu is showing.\n *\n * Read from the target rather than from the overlay, and that is the whole\n * point: a closed menu's pane stays in the DOM for its exit animation, while\n * the reference is dropped the instant the close begins. Asking the DOM\n * \"is a menu present\" would answer `true` for a quarter of a second after every\n * dismissal.\n *\n * So the answer is only as good as the directive's claim on `aria-controls`:\n * put `[wrContextMenu]` on an element that publishes one of its own and the two\n * fight over a single attribute.\n */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-controls')) !== null;\n }\n\n /** The role the menu announces — `menu`. Throws while no menu is open. */\n async getMenuRole(): Promise<string | null> {\n return (await this.menu()).getAttribute('role');\n }\n\n /**\n * Everything the open menu renders as text, runs of whitespace collapsed.\n *\n * Wider than `getItemTexts()` on purpose: `<wr-context-menu>` projects whatever\n * it is given, so a section heading or any other markup a consumer put between\n * the items shows up here and in no item harness. Dividers contribute nothing —\n * they render no text.\n *\n * Expect to match a FRAGMENT of this rather than the whole of it: Angular\n * strips the whitespace between elements at compile time, so the labels run\n * together (`'Pick oneAppleBanana'`). The collapsing here only tidies newlines\n * inside a single block of projected text.\n */\n async getMenuText(): Promise<string> {\n return (await (await this.menu()).text()).replace(/\\s+/g, ' ').trim();\n }\n\n /**\n * Open the menu by right-clicking the target, the gesture the directive\n * actually listens for (`contextmenu`, which is also what Shift+F10 sends).\n *\n * An already-open menu is left alone — `rightClick()` is the raw gesture if\n * what you want is the re-open.\n *\n * Note for a spec with two targets: a `contextmenu` event anywhere is an\n * outside pointer event for every OTHER open menu, so this dismisses them on\n * the way in. `openByLongPress()` is the route that does not.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await this.rightClick();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrContextMenuHarness.open(): the right-click did not open a menu. The directive answers ' +\n '`contextmenu` on its own host, so check this is the element you put [wrContextMenu] on. One ' +\n 'deliberate exception: a right-click within 700ms of a long-press open is swallowed, because touch ' +\n 'browsers fire a synthetic contextmenu after the hold.'\n );\n }\n\n /**\n * Send a `contextmenu` to the target whatever state the menu is in.\n *\n * On an open menu this re-opens it at the new pointer position — the previous\n * pane is dismissed and a fresh one takes its place, which is why the harness\n * scopes by a per-open id rather than by class: for the length of the exit\n * animation both are in the container, the dying one first.\n *\n * The coordinates the CDK requires are all zeros, and meaningless: jsdom has no\n * layout. Nothing here needs them — the event is dispatched on the element\n * itself, no hit test involved.\n */\n async rightClick(): Promise<void> {\n return (await this.host()).rightClick(0, 0);\n }\n\n /**\n * Open the menu with a touch long-press — hold a non-mouse pointer on the\n * target for 500ms — and wait until it is up.\n *\n * Worth its own method rather than an argument to `open()`, for the reason the\n * dropdown has `openByKeyboard()`: it is the only way to get TWO context menus\n * open at once. The press emits no `click` / `auxclick` / `contextmenu`, so it\n * is not an outside press for anyone else's menu, while a right-click is.\n *\n * The pointer fields the directive reads are assigned onto a synthetic event:\n * what matters is a primary pointer that is not a mouse. Movement beyond 10px,\n * a scroll, or an early lift cancels the hold in the component — none of which\n * this does.\n */\n async openByLongPress(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (await this.isOpen()) return;\n\n const host = await this.host();\n await host.dispatchEvent('pointerdown', {\n pointerType: 'touch',\n isPrimary: true,\n clientX: 0,\n clientY: 0,\n pageX: 0,\n pageY: 0,\n });\n\n const opened = await this.settled(true, timeout);\n // The finger comes off once the menu is up — after the hold, so it reads as a\n // completed long-press rather than the early lift that cancels one.\n await host.dispatchEvent('pointerup');\n\n if (opened) return;\n\n throw new Error(\n `WrContextMenuHarness.openByLongPress(): nothing opened within ${timeout}ms. The hold is a real 500ms ` +\n 'timer, so a spec on fake timers has to advance the clock itself and read isOpen().'\n );\n }\n\n /**\n * Dismiss the menu with Escape and wait until its pane has left the DOM.\n *\n * Escape is delivered by the CDK's keyboard dispatcher to the TOP-MOST overlay,\n * so with a later menu (or any other overlay) open on top, this one keeps\n * waiting its turn — that is what the throw below is about. The wait covers the\n * 220ms exit animation, so a spec can assert afterwards that nothing lingers.\n */\n async close(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (!(await this.isOpen())) return;\n\n // Captured first: the target drops the reference the instant the close starts,\n // and the wait below still has to know which pane to watch.\n const id = await this.menuId();\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n\n if (await this.isOpen()) {\n throw new Error(\n 'WrContextMenuHarness.close(): Escape did not dismiss the menu. The CDK keyboard dispatcher ' +\n 'delivers it to the TOP-MOST overlay only, so anything opened after this menu takes it first.'\n );\n }\n\n return this.waitUntilGone(id, 'close', timeout);\n }\n\n /**\n * Dismiss the menu by pressing outside it, the way a user gets rid of one, and\n * wait until its pane has left the DOM.\n *\n * Sits out real time first: the directive ignores outside events for 200ms after\n * opening, so the right-click that opened the menu cannot immediately close it\n * again with its own trailing `auxclick`. The press then lands on the TARGET,\n * which is outside the pane and therefore counts — the page background is not\n * something a harness has a handle on. A target that carries a `(click)` of its\n * own will see it fire, so assert on the dismissal rather than on that handler.\n */\n async closeByOutsidePress(timeout = DEFAULT_TIMEOUT): Promise<void> {\n if (!(await this.isOpen())) return;\n\n const id = await this.menuId();\n await sleep(OUTSIDE_GUARD_MS);\n await this.forceStabilize();\n await (await this.host()).click();\n\n if (await this.isOpen()) {\n throw new Error(\n 'WrContextMenuHarness.closeByOutsidePress(): the menu is still open. A press inside the pane is ' +\n 'not an outside press, and neither is one that started inside it — this one lands on the target.'\n );\n }\n\n return this.waitUntilGone(id, 'closeByOutsidePress', timeout);\n }\n\n /**\n * The items in this menu, in DOM order.\n *\n * Only this menu's own: an open submenu is a separate pane, so its items are\n * `WrContextMenuItemHarness.getSubmenuItems()`, not part of this list. Dividers\n * are not items either.\n *\n * Throws while the menu is shut — the items do not exist anywhere until the\n * portal is attached, and an empty array reads like a menu that rendered\n * nothing.\n */\n async getItems(filters: WrContextMenuItemHarnessFilters = {}): Promise<WrContextMenuItemHarness[]> {\n return this.getAllHarnesses(WrContextMenuItemHarness.with(filters));\n }\n\n /** The labels of this menu's items, in DOM order. */\n async getItemTexts(): Promise<string[]> {\n const items = await this.getItems();\n return Promise.all(items.map(item => item.getText()));\n }\n\n /**\n * How many separators this menu shows.\n *\n * Counted by `role=\"separator\"` rather than by `.wr-context-menu-divider`, so a\n * separator the consumer wrote themselves counts too — the role is what tells a\n * screen reader where one group of items ends. A separator is never a member of\n * `getItems()`.\n */\n async getDividerCount(): Promise<number> {\n const separators = await this.inMenuAll('[role=\"separator\"]');\n return separators.length;\n }\n\n /**\n * Open the menu if it is shut, then click the first item matching the filters.\n *\n * Picking a leaf DISMISSES the menu — unlike a dropdown, which stays up. The\n * dismissal is reported at once (the target drops its reference synchronously),\n * while the pane plays its exit animation for another 220ms.\n */\n async clickItem(filters: WrContextMenuItemHarnessFilters): Promise<void> {\n await this.open();\n\n const [item] = await this.getItems(filters);\n if (!item) {\n const offered = await this.getItemTexts();\n throw new Error(\n `WrContextMenuHarness.clickItem(): no item matched ${JSON.stringify(filters)}. ` +\n `The menu offers: ${offered.join(', ')}.`\n );\n }\n\n await item.click();\n }\n\n /**\n * A loader scoped to THIS target's menu — the content loader every\n * `HarnessLoader` method on this class runs through, `getItems()` included.\n *\n * Scoped by the published id rather than by `.wr-context-menu`: the overlay\n * container is shared by every pane on the page, so a bare class query would\n * answer with whichever menu opened first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.menuId()}`);\n }\n\n /** This target's menu element in the overlay. */\n private async menu(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.menuId()}`)();\n }\n\n /** Every element inside THIS menu matching the selector. */\n private async inMenuAll(selector: string): Promise<TestElement[]> {\n return this.documentRootLocatorFactory().locatorForAll(`#${await this.menuId()} ${selector}`)();\n }\n\n /** The id the target publishes as `aria-controls`, which its open menu carries. */\n private async menuId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n if (!id) {\n throw new Error(\n 'WrContextMenuHarness: no menu is open, so there is nothing inside it to read — call open() ' +\n 'first. The target publishes `aria-controls` only while its menu is up.'\n );\n }\n return id;\n }\n\n /** Poll until the pane with this id has been disposed. */\n private async waitUntilGone(id: string, method: string, timeout: number): Promise<void> {\n const locate = this.documentRootLocatorFactory().locatorForOptional(`#${id}`);\n\n for (let waited = 0; waited <= timeout; waited += POLL_STEP) {\n if ((await locate()) === null) return;\n\n await sleep(POLL_STEP);\n await this.forceStabilize();\n }\n\n throw new Error(\n `WrContextMenuHarness.${method}(): the menu was still in the DOM ${timeout}ms after it closed. The ` +\n 'directive keeps the pane alive for its 220ms exit animation and disposes it on a real timer, so a ' +\n 'spec on fake timers has to advance the clock itself.'\n );\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAEH;AACA,MAAM,eAAe,GAAG,IAAI;AAE5B;AACA,MAAM,SAAS,GAAG,EAAE;AAEpB;;;;;;;;;;;;AAYG;AACH,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU;AAE5C;AACA,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;;ACjCA;;;;;AAKG;AAOH;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,MAAO,wBAAyB,SAAQ,gBAAgB,CAAA;;AAE5D,IAAA,OAAO,YAAY,GAAG,uBAAuB;;AAG7C,IAAA,OAAO,IAAI,CAAC,OAAA,GAA2C,EAAE,EAAA;AACvD,QAAA,OAAO,IAAI,gBAAgB,CAAC,wBAAwB,EAAE,OAAO;aAC1D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC;aAC1G,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,OAAO,EAAE,QAAQ,KAAK,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,QAAQ;aAC9G,SAAS,CACR,YAAY,EACZ,OAAO,CAAC,UAAU,EAClB,OAAO,OAAO,EAAE,UAAU,KAAK,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,UAAU,CAC3E;IACL;AAEA;;;;;;AAMG;AACH,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,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AE;QAC7B;AAEA,QAAA,MAAM,IAAI,KAAK,CACb,wBAAwB,MAAM,CAAA,kCAAA,EAAqC,OAAO,CAAA,wBAAA,CAA0B;YAClG,oGAAoG;AACpG,YAAA,sDAAsD,CACzD;IACH;;AAGQ,IAAA,MAAM,OAAO,CAAC,IAAa,EAAE,OAAe,EAAA;AAClD,QAAA,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE;YAC3D,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI;AAAE,gBAAA,OAAO,IAAI;AAE/C,YAAA,MAAM,KAAK,CAAC,SAAS,CAAC;AACtB,YAAA,MAAM,IAAI,CAAC,cAAc,EAAE;QAC7B;AACA,QAAA,OAAO,KAAK;IACd;;;ACnYF;;AAEG;;;;"}
@@ -1,9 +1,11 @@
1
1
  import { ScrollStrategyOptions } from '@angular/cdk/overlay';
2
2
  import { TemplatePortal } from '@angular/cdk/portal';
3
3
  import * as i0 from '@angular/core';
4
- import { input, computed, inject, ElementRef, ViewContainerRef, DestroyRef, ViewEncapsulation, Component, Directive, viewChild, TemplateRef } from '@angular/core';
4
+ import { input, computed, inject, ElementRef, ViewContainerRef, DestroyRef, signal, ViewEncapsulation, Component, Directive, viewChild, TemplateRef } from '@angular/core';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { WR_OVERLAY, WrOutsideClick } from 'ngwr/overlay';
6
+ import { WR_OVERLAY, wrMirrorOffsets, WrOutsideClick } from 'ngwr/overlay';
7
+ import { randomId } from 'ngwr/utils';
8
+ import { Directionality } from '@angular/cdk/bidi';
7
9
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
8
10
  import { WrIcon } from 'ngwr/icon';
9
11
 
@@ -60,6 +62,7 @@ class WrContextMenuItem {
60
62
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
61
63
  host = inject(ElementRef);
62
64
  overlay = inject(WR_OVERLAY);
65
+ dir = inject(Directionality, { optional: true });
63
66
  vcr = inject(ViewContainerRef);
64
67
  scrollStrategies = inject(ScrollStrategyOptions);
65
68
  destroyRef = inject(DestroyRef);
@@ -67,6 +70,22 @@ class WrContextMenuItem {
67
70
  openTimer = null;
68
71
  closeTimer = null;
69
72
  submenuOpen = false;
73
+ /**
74
+ * Id of the submenu's menu element while it is open, published on the item as
75
+ * `aria-controls` — the same contract the root trigger keeps (see
76
+ * {@link WrContextMenu}). Each submenu pane is its own overlay in the shared
77
+ * container, so `aria-haspopup` / `aria-expanded` say that a submenu EXISTS
78
+ * and is showing, and this says WHICH one.
79
+ *
80
+ * A signal, not a plain field like `submenuOpen`: host bindings re-run only
81
+ * when something they read has changed, and this flips outside change
82
+ * detection. Writing it is also what now refreshes `aria-expanded` next to
83
+ * it, which used to depend on some unrelated work dirtying the view.
84
+ *
85
+ * @internal
86
+ */
87
+ submenuId = signal(null, /* @ts-ignore */
88
+ ...(ngDevMode ? [{ debugName: "submenuId" }] : /* istanbul ignore next */ []));
70
89
  /**
71
90
  * Global registry of open submenus keyed by the host element of the
72
91
  * item that owns them. Used to cascade-close descendants when a
@@ -115,15 +134,30 @@ class WrContextMenuItem {
115
134
  event.preventDefault();
116
135
  this.host.nativeElement.click();
117
136
  }
118
- /** @internal Right-arrow opens the submenu. */
137
+ /**
138
+ * @internal The arrow that walks INTO a submenu, which is the one pointing the
139
+ * way the menu cascades: right in LTR, left in RTL. The panes mirror with the
140
+ * reading direction (the CDK flips their placement), so a fixed ArrowRight
141
+ * would ask an RTL user to press toward the parent to open the child.
142
+ */
119
143
  onArrowRight(event) {
144
+ if (this.isRtl())
145
+ return this.closeFromKey(event);
146
+ this.openFromKey(event);
147
+ }
148
+ /** @internal The arrow that walks back OUT — the mirror of {@link onArrowRight}. */
149
+ onArrowLeft(event) {
150
+ if (this.isRtl())
151
+ return this.openFromKey(event);
152
+ this.closeFromKey(event);
153
+ }
154
+ openFromKey(event) {
120
155
  if (this.disabled() || !this.submenu())
121
156
  return;
122
157
  event.preventDefault();
123
158
  this.scheduleOpen(0);
124
159
  }
125
- /** @internal Left-arrow closes the submenu (if open). */
126
- onArrowLeft(event) {
160
+ closeFromKey(event) {
127
161
  if (!this.submenu() || !this.submenuOpen)
128
162
  return;
129
163
  event.preventDefault();
@@ -200,7 +234,7 @@ class WrContextMenuItem {
200
234
  const positionStrategy = this.overlay
201
235
  .position()
202
236
  .flexibleConnectedTo(this.host)
203
- .withPositions(positions)
237
+ .withPositions(wrMirrorOffsets(positions, this.isRtl()))
204
238
  .withPush(true);
205
239
  this.submenuRef = this.overlay.create({
206
240
  positionStrategy,
@@ -212,6 +246,13 @@ class WrContextMenuItem {
212
246
  // Mirror the open animation pattern from the root menu directive.
213
247
  const pane = this.submenuRef.overlayElement;
214
248
  requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));
249
+ // Name the pane's menu so the item can point at it — minted per open for
250
+ // the same reason the root does it (a closing pane outlives its close).
251
+ const menuEl = pane.querySelector('.wr-context-menu');
252
+ if (menuEl) {
253
+ menuEl.id = randomId('wr-context-menu');
254
+ this.submenuId.set(menuEl.id);
255
+ }
215
256
  // Track mouse entering / leaving the submenu so we don't auto-close
216
257
  // when the cursor crosses the gap between item and submenu pane.
217
258
  pane.addEventListener('mouseenter', this.onSubmenuEnter);
@@ -294,6 +335,7 @@ class WrContextMenuItem {
294
335
  return;
295
336
  this.submenuRef = null;
296
337
  this.submenuOpen = false;
338
+ this.submenuId.set(null);
297
339
  WrContextMenuItem.openSubmenus.delete(this.host.nativeElement);
298
340
  const pane = ref.overlayElement;
299
341
  pane.removeEventListener('mouseenter', this.onSubmenuEnter);
@@ -314,10 +356,20 @@ class WrContextMenuItem {
314
356
  pane.classList.remove('wr-context-menu-overlay--open');
315
357
  setTimeout(() => ref.dispose(), SUBMENU_TRANSITION_MS);
316
358
  }
317
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
318
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: WrContextMenuItem, isStandalone: true, selector: "wr-context-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "menuitem" }, listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave($event)", "click": "onClick()", "keydown.enter": "activate($event)", "keydown.space": "activate($event)", "keydown.arrowRight": "onArrowRight($event)", "keydown.arrowLeft": "onArrowLeft($event)" }, properties: { "class": "classes()", "attr.tabindex": "-1", "attr.aria-disabled": "disabled() ? true : null", "attr.aria-haspopup": "submenu() ? \"menu\" : null", "attr.aria-expanded": "submenu() ? (submenuOpen ? \"true\" : \"false\") : null" } }, ngImport: i0, template: "@if (icon(); as name) {\n <wr-icon class=\"wr-context-menu-item__icon\" [name]=\"name\" size=\"14\" />\n}\n<span class=\"wr-context-menu-item__label\"><ng-content /></span>\n@if (submenu()) {\n <svg\n class=\"wr-icon__svg wr-context-menu-item__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
359
+ /**
360
+ * Whether the app reads right-to-left.
361
+ *
362
+ * Optional inject: `Directionality` is root-provided, so this is never null in
363
+ * an app — but a bare `TestBed` that provides nothing should still get a
364
+ * component that works, and defaulting to LTR is the honest fallback.
365
+ */
366
+ isRtl() {
367
+ return this.dir?.value === 'rtl';
368
+ }
369
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
370
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrContextMenuItem, isStandalone: true, selector: "wr-context-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "menuitem" }, listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave($event)", "click": "onClick()", "keydown.enter": "activate($event)", "keydown.space": "activate($event)", "keydown.arrowRight": "onArrowRight($event)", "keydown.arrowLeft": "onArrowLeft($event)" }, properties: { "class": "classes()", "attr.tabindex": "-1", "attr.aria-disabled": "disabled() ? true : null", "attr.aria-haspopup": "submenu() ? \"menu\" : null", "attr.aria-expanded": "submenu() ? (submenuOpen ? \"true\" : \"false\") : null", "attr.aria-controls": "submenuId()" } }, ngImport: i0, template: "@if (icon(); as name) {\n <wr-icon class=\"wr-context-menu-item__icon\" [name]=\"name\" size=\"14\" />\n}\n<span class=\"wr-context-menu-item__label\"><ng-content /></span>\n@if (submenu()) {\n <svg\n class=\"wr-icon__svg wr-context-menu-item__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
319
371
  }
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenuItem, decorators: [{
372
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuItem, decorators: [{
321
373
  type: Component,
322
374
  args: [{ selector: 'wr-context-menu-item', encapsulation: ViewEncapsulation.None, host: {
323
375
  role: 'menuitem',
@@ -326,6 +378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
326
378
  '[attr.aria-disabled]': 'disabled() ? true : null',
327
379
  '[attr.aria-haspopup]': 'submenu() ? "menu" : null',
328
380
  '[attr.aria-expanded]': 'submenu() ? (submenuOpen ? "true" : "false") : null',
381
+ '[attr.aria-controls]': 'submenuId()',
329
382
  '(mouseenter)': 'onMouseEnter()',
330
383
  '(mouseleave)': 'onMouseLeave($event)',
331
384
  '(click)': 'onClick()',
@@ -368,6 +421,24 @@ class WrContextMenu {
368
421
  vcr = inject(ViewContainerRef);
369
422
  scrollStrategies = inject(ScrollStrategyOptions);
370
423
  destroyRef = inject(DestroyRef);
424
+ /**
425
+ * Id of the menu element while this trigger's menu is open, published on the
426
+ * host as `aria-controls`. The pane is portalled into the overlay container, a
427
+ * sibling of the whole app, so this reference is the ONLY link between a
428
+ * trigger and the menu it opened — for a screen reader, and for anything else
429
+ * that has to find it. Cleared on close, which is also what tells an open
430
+ * trigger from a closing one: the pane itself lingers for the exit animation.
431
+ *
432
+ * A signal, not a plain field: host bindings re-run only when something they
433
+ * READ has changed, and this one flips outside change detection (from a
434
+ * pointer handler, and from `onDestroy`). Held as a plain string it published
435
+ * the id on open — the overlay attach happens to dirty the host view — and
436
+ * then kept it forever, so the trigger still pointed at a menu that was gone.
437
+ *
438
+ * @internal
439
+ */
440
+ openMenuId = signal(null, /* @ts-ignore */
441
+ ...(ngDevMode ? [{ debugName: "openMenuId" }] : /* istanbul ignore next */ []));
371
442
  overlayRef = null;
372
443
  closingTimer = null;
373
444
  leaveTimer = null;
@@ -529,6 +600,16 @@ class WrContextMenu {
529
600
  pane.style.right = 'auto';
530
601
  pane.style.bottom = 'auto';
531
602
  pane.style.margin = '0';
603
+ // Name the menu we just opened so the host can point at it. The id is
604
+ // minted per OPEN rather than living on the panel: `closeOverlay()` keeps
605
+ // the previous pane in the DOM for its exit animation, so a re-open would
606
+ // otherwise leave two elements answering to the same id — with the dying
607
+ // one first in document order.
608
+ const menuEl = pane.querySelector('.wr-context-menu');
609
+ if (menuEl) {
610
+ menuEl.id = randomId('wr-context-menu');
611
+ this.openMenuId.set(menuEl.id);
612
+ }
532
613
  const sync = () => {
533
614
  pane.style.top = `${y - window.scrollY}px`;
534
615
  pane.style.left = `${x - window.scrollX}px`;
@@ -609,6 +690,10 @@ class WrContextMenu {
609
690
  if (!this.overlayRef)
610
691
  return;
611
692
  this.cancelLeaveTimer();
693
+ // Drop the reference immediately: the pane below stays in the DOM until the
694
+ // exit animation has played, and a trigger still pointing at a menu on its
695
+ // way out reads as open.
696
+ this.openMenuId.set(null);
612
697
  if (WrContextMenu.activeRoot === this)
613
698
  WrContextMenu.activeRoot = null;
614
699
  // Submenu panes live in the CDK overlay container, not inside the
@@ -645,15 +730,16 @@ class WrContextMenu {
645
730
  this.closeOverlay();
646
731
  }, WrContextMenu.LEAVE_DELAY);
647
732
  }
648
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
649
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: WrContextMenu, isStandalone: true, selector: "[wrContextMenu]", inputs: { menu: { classPropertyName: "menu", publicName: "wrContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)", "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp()", "pointercancel": "onPointerUp()" }, classAttribute: "wr-context-menu-host" }, ngImport: i0 });
733
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
734
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: WrContextMenu, isStandalone: true, selector: "[wrContextMenu]", inputs: { menu: { classPropertyName: "menu", publicName: "wrContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)", "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp()", "pointercancel": "onPointerUp()" }, properties: { "attr.aria-controls": "openMenuId()" }, classAttribute: "wr-context-menu-host" }, ngImport: i0 });
650
735
  }
651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenu, decorators: [{
736
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenu, decorators: [{
652
737
  type: Directive,
653
738
  args: [{
654
739
  selector: '[wrContextMenu]',
655
740
  host: {
656
741
  class: 'wr-context-menu-host',
742
+ '[attr.aria-controls]': 'openMenuId()',
657
743
  '(contextmenu)': 'onContextMenu($event)',
658
744
  '(pointerdown)': 'onPointerDown($event)',
659
745
  '(pointermove)': 'onPointerMove($event)',
@@ -687,10 +773,10 @@ class WrContextMenuPanel {
687
773
  /** The internal template the directive portals into the overlay. @internal */
688
774
  contentTpl = viewChild.required(TemplateRef, /* @ts-ignore */
689
775
  ...(ngDevMode ? [{ debugName: "contentTpl" }] : /* istanbul ignore next */ []));
690
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenuPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
691
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.0", type: WrContextMenuPanel, isStandalone: true, selector: "wr-context-menu", host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["wrContextMenu"], ngImport: i0, template: '<ng-template><div class="wr-context-menu" role="menu"><ng-content /></div></ng-template>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
776
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
777
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: WrContextMenuPanel, isStandalone: true, selector: "wr-context-menu", host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["wrContextMenu"], ngImport: i0, template: '<ng-template><div class="wr-context-menu" role="menu"><ng-content /></div></ng-template>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
692
778
  }
693
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenuPanel, decorators: [{
779
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuPanel, decorators: [{
694
780
  type: Component,
695
781
  args: [{
696
782
  selector: 'wr-context-menu',
@@ -723,10 +809,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
723
809
  * ```
724
810
  */
725
811
  class WrContextMenuDivider {
726
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenuDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
727
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.0", type: WrContextMenuDivider, isStandalone: true, selector: "wr-context-menu-divider", host: { attributes: { "role": "separator", "aria-orientation": "horizontal" }, classAttribute: "wr-context-menu-divider" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
812
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
813
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: WrContextMenuDivider, isStandalone: true, selector: "wr-context-menu-divider", host: { attributes: { "role": "separator", "aria-orientation": "horizontal" }, classAttribute: "wr-context-menu-divider" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
728
814
  }
729
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: WrContextMenuDivider, decorators: [{
815
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuDivider, decorators: [{
730
816
  type: Component,
731
817
  args: [{
732
818
  selector: 'wr-context-menu-divider',