ngwr 10.2.1 → 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 (425) 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 +7 -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 +13 -3
  19. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  20. package/fesm2022/ngwr-affix.mjs +40 -13
  21. package/fesm2022/ngwr-affix.mjs.map +1 -1
  22. package/fesm2022/ngwr-anchor.mjs +18 -6
  23. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  24. package/fesm2022/ngwr-aurora.mjs +2 -2
  25. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  26. package/fesm2022/ngwr-avatar.mjs +31 -7
  27. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  28. package/fesm2022/ngwr-back-top.mjs +6 -2
  29. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  30. package/fesm2022/ngwr-badge.mjs +1 -1
  31. package/fesm2022/ngwr-badge.mjs.map +1 -1
  32. package/fesm2022/ngwr-bar-chart.mjs +30 -9
  33. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  34. package/fesm2022/ngwr-blur-text.mjs +2 -2
  35. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  36. package/fesm2022/ngwr-border-glow.mjs +2 -2
  37. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  38. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  39. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  40. package/fesm2022/ngwr-burger.mjs +9 -4
  41. package/fesm2022/ngwr-burger.mjs.map +1 -1
  42. package/fesm2022/ngwr-button-testing.mjs +96 -0
  43. package/fesm2022/ngwr-button-testing.mjs.map +1 -0
  44. package/fesm2022/ngwr-button.mjs +31 -14
  45. package/fesm2022/ngwr-button.mjs.map +1 -1
  46. package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
  47. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  48. package/fesm2022/ngwr-calendar.mjs +20 -1
  49. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  50. package/fesm2022/ngwr-card.mjs +2 -2
  51. package/fesm2022/ngwr-card.mjs.map +1 -1
  52. package/fesm2022/ngwr-carousel-testing.mjs +377 -0
  53. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
  54. package/fesm2022/ngwr-carousel.mjs +67 -13
  55. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  56. package/fesm2022/ngwr-cascader-testing.mjs +534 -0
  57. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
  58. package/fesm2022/ngwr-cascader.mjs +2 -2
  59. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  60. package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
  61. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
  62. package/fesm2022/ngwr-checkbox.mjs +9 -3
  63. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  64. package/fesm2022/ngwr-circular-text.mjs +2 -2
  65. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  66. package/fesm2022/ngwr-click-spark.mjs +2 -2
  67. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  68. package/fesm2022/ngwr-collapse-testing.mjs +368 -0
  69. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
  70. package/fesm2022/ngwr-color-picker.mjs +134 -14
  71. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  72. package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
  73. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
  74. package/fesm2022/ngwr-command-palette.mjs +58 -8
  75. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  76. package/fesm2022/ngwr-compare.mjs +103 -13
  77. package/fesm2022/ngwr-compare.mjs.map +1 -1
  78. package/fesm2022/ngwr-config.mjs +106 -0
  79. package/fesm2022/ngwr-config.mjs.map +1 -0
  80. package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
  81. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
  82. package/fesm2022/ngwr-context-menu.mjs +94 -8
  83. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  84. package/fesm2022/ngwr-cookie.mjs +5 -1
  85. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  86. package/fesm2022/ngwr-counter.mjs +11 -3
  87. package/fesm2022/ngwr-counter.mjs.map +1 -1
  88. package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
  89. package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
  90. package/fesm2022/ngwr-date-adapter.mjs +54 -8
  91. package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
  92. package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
  93. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
  94. package/fesm2022/ngwr-date-picker.mjs +73 -3
  95. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  96. package/fesm2022/ngwr-decrypt-text.mjs +27 -9
  97. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  98. package/fesm2022/ngwr-dialog-testing.mjs +89 -0
  99. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
  100. package/fesm2022/ngwr-directives.mjs +36 -12
  101. package/fesm2022/ngwr-directives.mjs.map +1 -1
  102. package/fesm2022/ngwr-donut-chart.mjs +22 -5
  103. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  104. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  105. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  106. package/fesm2022/ngwr-drawer-testing.mjs +250 -0
  107. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
  108. package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
  109. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
  110. package/fesm2022/ngwr-dropdown.mjs +10 -2
  111. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  112. package/fesm2022/ngwr-empty.mjs +24 -7
  113. package/fesm2022/ngwr-empty.mjs.map +1 -1
  114. package/fesm2022/ngwr-event-calendar.mjs +57 -10
  115. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  116. package/fesm2022/ngwr-falling-text.mjs +2 -2
  117. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  118. package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
  119. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
  120. package/fesm2022/ngwr-form-testing.mjs +451 -0
  121. package/fesm2022/ngwr-form-testing.mjs.map +1 -0
  122. package/fesm2022/ngwr-form.mjs +19 -3
  123. package/fesm2022/ngwr-form.mjs.map +1 -1
  124. package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
  125. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  126. package/fesm2022/ngwr-gauge.mjs +19 -5
  127. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  128. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  129. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  130. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  131. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  132. package/fesm2022/ngwr-i18n-en.mjs +50 -0
  133. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  134. package/fesm2022/ngwr-i18n-ru.mjs +48 -0
  135. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  136. package/fesm2022/ngwr-image-cropper.mjs +23 -0
  137. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  138. package/fesm2022/ngwr-input-number-testing.mjs +306 -0
  139. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
  140. package/fesm2022/ngwr-input-number.mjs +35 -3
  141. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  142. package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
  143. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
  144. package/fesm2022/ngwr-input-otp.mjs +36 -5
  145. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  146. package/fesm2022/ngwr-input-testing.mjs +102 -0
  147. package/fesm2022/ngwr-input-testing.mjs.map +1 -0
  148. package/fesm2022/ngwr-input.mjs +47 -10
  149. package/fesm2022/ngwr-input.mjs.map +1 -1
  150. package/fesm2022/ngwr-knob.mjs +44 -8
  151. package/fesm2022/ngwr-knob.mjs.map +1 -1
  152. package/fesm2022/ngwr-layout.mjs +21 -5
  153. package/fesm2022/ngwr-layout.mjs.map +1 -1
  154. package/fesm2022/ngwr-lightbox.mjs +33 -6
  155. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  156. package/fesm2022/ngwr-line-chart.mjs +17 -4
  157. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  158. package/fesm2022/ngwr-list.mjs +2 -2
  159. package/fesm2022/ngwr-list.mjs.map +1 -1
  160. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  161. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  162. package/fesm2022/ngwr-markdown-testing.mjs +516 -0
  163. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
  164. package/fesm2022/ngwr-markdown.mjs +1492 -0
  165. package/fesm2022/ngwr-markdown.mjs.map +1 -0
  166. package/fesm2022/ngwr-marquee.mjs +17 -6
  167. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  168. package/fesm2022/ngwr-mention-testing.mjs +513 -0
  169. package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
  170. package/fesm2022/ngwr-mention.mjs +10 -1
  171. package/fesm2022/ngwr-mention.mjs.map +1 -1
  172. package/fesm2022/ngwr-meta.mjs +22 -7
  173. package/fesm2022/ngwr-meta.mjs.map +1 -1
  174. package/fesm2022/ngwr-meter-group.mjs +19 -5
  175. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  176. package/fesm2022/ngwr-overlay.mjs +41 -1
  177. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  178. package/fesm2022/ngwr-pagination-testing.mjs +389 -0
  179. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
  180. package/fesm2022/ngwr-pagination.mjs +14 -2
  181. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  182. package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
  183. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
  184. package/fesm2022/ngwr-popconfirm.mjs +95 -17
  185. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  186. package/fesm2022/ngwr-popover-testing.mjs +316 -0
  187. package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
  188. package/fesm2022/ngwr-popover.mjs +21 -3
  189. package/fesm2022/ngwr-popover.mjs.map +1 -1
  190. package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
  191. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  192. package/fesm2022/ngwr-qr.mjs +13 -3
  193. package/fesm2022/ngwr-qr.mjs.map +1 -1
  194. package/fesm2022/ngwr-radio-testing.mjs +392 -0
  195. package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
  196. package/fesm2022/ngwr-radio.mjs +10 -3
  197. package/fesm2022/ngwr-radio.mjs.map +1 -1
  198. package/fesm2022/ngwr-rating-testing.mjs +384 -0
  199. package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
  200. package/fesm2022/ngwr-rating.mjs +37 -2
  201. package/fesm2022/ngwr-rating.mjs.map +1 -1
  202. package/fesm2022/ngwr-segmented-testing.mjs +512 -0
  203. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
  204. package/fesm2022/ngwr-select-testing.mjs +268 -0
  205. package/fesm2022/ngwr-select-testing.mjs.map +1 -0
  206. package/fesm2022/ngwr-select.mjs +87 -16
  207. package/fesm2022/ngwr-select.mjs.map +1 -1
  208. package/fesm2022/ngwr-shiny-text.mjs +2 -2
  209. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  210. package/fesm2022/ngwr-sidebar.mjs +65 -12
  211. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  212. package/fesm2022/ngwr-slider-testing.mjs +478 -0
  213. package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
  214. package/fesm2022/ngwr-slider.mjs +57 -13
  215. package/fesm2022/ngwr-slider.mjs.map +1 -1
  216. package/fesm2022/ngwr-sparkline.mjs +26 -6
  217. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  218. package/fesm2022/ngwr-speed-dial.mjs +37 -4
  219. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  220. package/fesm2022/ngwr-spinner.mjs +12 -3
  221. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  222. package/fesm2022/ngwr-splash-cursor.mjs +2 -2
  223. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  224. package/fesm2022/ngwr-split-text.mjs +2 -2
  225. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  226. package/fesm2022/ngwr-splitter.mjs +70 -9
  227. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  228. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  229. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  230. package/fesm2022/ngwr-star-border.mjs +2 -2
  231. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  232. package/fesm2022/ngwr-statistic.mjs +24 -7
  233. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  234. package/fesm2022/ngwr-stepper-testing.mjs +477 -0
  235. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
  236. package/fesm2022/ngwr-switch-testing.mjs +77 -0
  237. package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
  238. package/fesm2022/ngwr-switch.mjs +9 -3
  239. package/fesm2022/ngwr-switch.mjs.map +1 -1
  240. package/fesm2022/ngwr-table-testing.mjs +580 -0
  241. package/fesm2022/ngwr-table-testing.mjs.map +1 -0
  242. package/fesm2022/ngwr-table.mjs +87 -14
  243. package/fesm2022/ngwr-table.mjs.map +1 -1
  244. package/fesm2022/ngwr-tabs-testing.mjs +617 -0
  245. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
  246. package/fesm2022/ngwr-tabs.mjs +38 -6
  247. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  248. package/fesm2022/ngwr-textarea-testing.mjs +238 -0
  249. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
  250. package/fesm2022/ngwr-textarea.mjs +32 -4
  251. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  252. package/fesm2022/ngwr-tilt-card.mjs +2 -2
  253. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  254. package/fesm2022/ngwr-toast-testing.mjs +101 -0
  255. package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
  256. package/fesm2022/ngwr-toast.mjs +2 -2
  257. package/fesm2022/ngwr-toast.mjs.map +1 -1
  258. package/fesm2022/ngwr-tour.mjs +61 -9
  259. package/fesm2022/ngwr-tour.mjs.map +1 -1
  260. package/fesm2022/ngwr-transfer-testing.mjs +538 -0
  261. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
  262. package/fesm2022/ngwr-transfer.mjs +45 -14
  263. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  264. package/fesm2022/ngwr-tree-testing.mjs +734 -0
  265. package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
  266. package/fesm2022/ngwr-tree.mjs +73 -7
  267. package/fesm2022/ngwr-tree.mjs.map +1 -1
  268. package/fesm2022/ngwr-typewriter.mjs +5 -3
  269. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  270. package/fesm2022/ngwr-version.mjs +1 -1
  271. package/fesm2022/ngwr-version.mjs.map +1 -1
  272. package/fesm2022/ngwr-virtual-scroll.mjs +31 -5
  273. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  274. package/fesm2022/ngwr-waves.mjs +3 -3
  275. package/fesm2022/ngwr-waves.mjs.map +1 -1
  276. package/fesm2022/ngwr-window.mjs +8 -0
  277. package/fesm2022/ngwr-window.mjs.map +1 -1
  278. package/gauge/styles/_index.scss +1 -1
  279. package/glitch-text/styles/_index.scss +4 -0
  280. package/i18n/en.json +48 -0
  281. package/i18n/ru.json +48 -0
  282. package/image-cropper/styles/_index.scss +13 -1
  283. package/input/styles/_index.scss +2 -2
  284. package/input-number/styles/_index.scss +7 -2
  285. package/knob/styles/_index.scss +8 -1
  286. package/layout/styles/_index.scss +3 -3
  287. package/lightbox/styles/_index.scss +10 -2
  288. package/line-chart/styles/_index.scss +6 -0
  289. package/llms-full.txt +151 -4
  290. package/llms.txt +57 -8
  291. package/loading-bar/styles/_index.scss +1 -2
  292. package/markdown/styles/_index.scss +296 -0
  293. package/marquee/styles/_index.scss +12 -0
  294. package/mcp/api.js +512 -0
  295. package/mcp/catalog.js +157 -0
  296. package/mcp/server.js +273 -0
  297. package/mcp/tools.js +366 -0
  298. package/meter-group/styles/_index.scss +1 -1
  299. package/package.json +186 -35
  300. package/pagination/styles/_index.scss +6 -6
  301. package/popover/styles/_index.scss +37 -5
  302. package/rating/styles/_index.scss +10 -0
  303. package/schematics/use/symbol-map.json +2 -0
  304. package/segmented/styles/_index.scss +7 -0
  305. package/select/styles/_index.scss +29 -9
  306. package/sidebar/styles/_index.scss +30 -5
  307. package/slider/styles/_index.scss +15 -0
  308. package/speed-dial/styles/_index.scss +20 -0
  309. package/split-text/styles/_index.scss +13 -0
  310. package/star-border/styles/_index.scss +2 -0
  311. package/stepper/styles/_index.scss +1 -1
  312. package/styles/_grid.scss +4 -4
  313. package/styles.scss +1 -0
  314. package/switch/styles/_index.scss +5 -3
  315. package/table/styles/_index.scss +22 -11
  316. package/tabs/styles/_index.scss +11 -1
  317. package/textarea/styles/_index.scss +5 -0
  318. package/theme/styles/_colors.scss +29 -13
  319. package/theme/styles/_dark.scss +11 -3
  320. package/theme/styles/_mixins.scss +3 -0
  321. package/timeline/styles/_index.scss +2 -2
  322. package/toast/styles/_index.scss +17 -8
  323. package/toolbar/styles/_index.scss +3 -3
  324. package/tour/styles/_index.scss +7 -1
  325. package/tree/styles/_index.scss +5 -3
  326. package/types/ngwr-action-sheet.d.ts +9 -1
  327. package/types/ngwr-affix.d.ts +7 -1
  328. package/types/ngwr-anchor.d.ts +8 -1
  329. package/types/ngwr-avatar.d.ts +13 -3
  330. package/types/ngwr-bar-chart.d.ts +16 -0
  331. package/types/ngwr-burger.d.ts +6 -2
  332. package/types/ngwr-button-testing.d.ts +85 -0
  333. package/types/ngwr-button.d.ts +26 -10
  334. package/types/ngwr-calendar-heatmap.d.ts +16 -2
  335. package/types/ngwr-calendar.d.ts +10 -0
  336. package/types/ngwr-carousel-testing.d.ts +257 -0
  337. package/types/ngwr-carousel.d.ts +20 -4
  338. package/types/ngwr-cascader-testing.d.ts +392 -0
  339. package/types/ngwr-checkbox-testing.d.ts +77 -0
  340. package/types/ngwr-checkbox.d.ts +7 -2
  341. package/types/ngwr-collapse-testing.d.ts +290 -0
  342. package/types/ngwr-color-picker.d.ts +20 -11
  343. package/types/ngwr-command-palette-testing.d.ts +437 -0
  344. package/types/ngwr-command-palette.d.ts +25 -2
  345. package/types/ngwr-compare.d.ts +50 -2
  346. package/types/ngwr-config.d.ts +176 -0
  347. package/types/ngwr-context-menu-testing.d.ts +401 -0
  348. package/types/ngwr-context-menu.d.ts +65 -17
  349. package/types/ngwr-counter.d.ts +6 -1
  350. package/types/ngwr-date-adapter-luxon.d.ts +26 -0
  351. package/types/ngwr-date-picker-testing.d.ts +518 -0
  352. package/types/ngwr-date-picker.d.ts +4 -0
  353. package/types/ngwr-dialog-testing.d.ts +79 -0
  354. package/types/ngwr-directives.d.ts +10 -1
  355. package/types/ngwr-donut-chart.d.ts +8 -1
  356. package/types/ngwr-drawer-testing.d.ts +196 -0
  357. package/types/ngwr-dropdown-testing.d.ts +202 -0
  358. package/types/ngwr-dropdown.d.ts +7 -1
  359. package/types/ngwr-empty.d.ts +19 -4
  360. package/types/ngwr-event-calendar.d.ts +26 -1
  361. package/types/ngwr-file-upload-testing.d.ts +194 -0
  362. package/types/ngwr-form-testing.d.ts +379 -0
  363. package/types/ngwr-form.d.ts +17 -0
  364. package/types/ngwr-gauge.d.ts +13 -1
  365. package/types/ngwr-image-cropper.d.ts +10 -0
  366. package/types/ngwr-input-number-testing.d.ts +226 -0
  367. package/types/ngwr-input-number.d.ts +29 -1
  368. package/types/ngwr-input-otp-testing.d.ts +299 -0
  369. package/types/ngwr-input-otp.d.ts +23 -2
  370. package/types/ngwr-input-testing.d.ts +84 -0
  371. package/types/ngwr-input.d.ts +20 -6
  372. package/types/ngwr-knob.d.ts +18 -0
  373. package/types/ngwr-layout.d.ts +1 -0
  374. package/types/ngwr-lightbox.d.ts +17 -3
  375. package/types/ngwr-line-chart.d.ts +9 -2
  376. package/types/ngwr-markdown-testing.d.ts +462 -0
  377. package/types/ngwr-markdown.d.ts +534 -0
  378. package/types/ngwr-marquee.d.ts +12 -2
  379. package/types/ngwr-mention-testing.d.ts +359 -0
  380. package/types/ngwr-meta.d.ts +4 -2
  381. package/types/ngwr-meter-group.d.ts +11 -1
  382. package/types/ngwr-overlay.d.ts +33 -2
  383. package/types/ngwr-pagination-testing.d.ts +291 -0
  384. package/types/ngwr-pagination.d.ts +1 -0
  385. package/types/ngwr-popconfirm-testing.d.ts +235 -0
  386. package/types/ngwr-popconfirm.d.ts +31 -21
  387. package/types/ngwr-popover-testing.d.ts +221 -0
  388. package/types/ngwr-popover.d.ts +9 -0
  389. package/types/ngwr-pull-to-refresh.d.ts +7 -0
  390. package/types/ngwr-qr.d.ts +9 -1
  391. package/types/ngwr-radio-testing.d.ts +296 -0
  392. package/types/ngwr-radio.d.ts +8 -2
  393. package/types/ngwr-rating-testing.d.ts +291 -0
  394. package/types/ngwr-rating.d.ts +23 -0
  395. package/types/ngwr-segmented-testing.d.ts +401 -0
  396. package/types/ngwr-select-testing.d.ts +175 -0
  397. package/types/ngwr-select.d.ts +45 -4
  398. package/types/ngwr-sidebar.d.ts +17 -2
  399. package/types/ngwr-slider-testing.d.ts +329 -0
  400. package/types/ngwr-slider.d.ts +35 -1
  401. package/types/ngwr-sparkline.d.ts +12 -2
  402. package/types/ngwr-speed-dial.d.ts +17 -18
  403. package/types/ngwr-spinner.d.ts +8 -1
  404. package/types/ngwr-splitter.d.ts +24 -1
  405. package/types/ngwr-statistic.d.ts +12 -2
  406. package/types/ngwr-stepper-testing.d.ts +346 -0
  407. package/types/ngwr-switch-testing.d.ts +66 -0
  408. package/types/ngwr-switch.d.ts +7 -2
  409. package/types/ngwr-table-testing.d.ts +423 -0
  410. package/types/ngwr-table.d.ts +42 -0
  411. package/types/ngwr-tabs-testing.d.ts +470 -0
  412. package/types/ngwr-tabs.d.ts +9 -0
  413. package/types/ngwr-textarea-testing.d.ts +184 -0
  414. package/types/ngwr-textarea.d.ts +7 -2
  415. package/types/ngwr-toast-testing.d.ts +80 -0
  416. package/types/ngwr-tour.d.ts +27 -0
  417. package/types/ngwr-transfer-testing.d.ts +444 -0
  418. package/types/ngwr-transfer.d.ts +16 -1
  419. package/types/ngwr-tree-testing.d.ts +501 -0
  420. package/types/ngwr-tree.d.ts +33 -0
  421. package/types/ngwr-version.d.ts +1 -1
  422. package/types/ngwr-virtual-scroll.d.ts +13 -1
  423. package/typewriter/styles/_index.scss +1 -1
  424. package/typography/styles/_index.scss +1 -1
  425. 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,CA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AE,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,8 +356,18 @@ class WrContextMenuItem {
314
356
  pane.classList.remove('wr-context-menu-overlay--open');
315
357
  setTimeout(() => ref.dispose(), SUBMENU_TRANSITION_MS);
316
358
  }
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
+ }
317
369
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
318
- 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" } }, 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 });
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
372
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenuItem, decorators: [{
321
373
  type: Component,
@@ -326,6 +378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", 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
@@ -646,7 +731,7 @@ class WrContextMenu {
646
731
  }, WrContextMenu.LEAVE_DELAY);
647
732
  }
648
733
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
649
- 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()" }, classAttribute: "wr-context-menu-host" }, ngImport: i0 });
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
736
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrContextMenu, decorators: [{
652
737
  type: Directive,
@@ -654,6 +739,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
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)',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-context-menu.mjs","sources":["../../../projects/lib/context-menu/context-menu-item.ts","../../../projects/lib/context-menu/context-menu-item.html","../../../projects/lib/context-menu/context-menu.ts","../../../projects/lib/context-menu/context-menu-panel.ts","../../../projects/lib/context-menu/context-menu-divider.ts","../../../projects/lib/context-menu/ngwr-context-menu.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type ConnectedPosition, type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n} from '@angular/core';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrContextMenu } from './context-menu';\nimport type { WrContextMenuPanel } from './context-menu-panel';\n\n/** Hover delay (ms) before a submenu opens. */\nconst SUBMENU_OPEN_DELAY = 120;\n/** Grace window (ms) before a submenu closes when the cursor leaves it. */\nconst SUBMENU_CLOSE_DELAY = 240;\n/** Animation duration of the submenu — mirrors the root menu CSS. */\nconst SUBMENU_TRANSITION_MS = 220;\n\n/**\n * Single row inside a `<wr-context-menu>`. Mirrors `<wr-dropdown-item>` —\n * rendered as a menu item with an optional leading icon and an optional\n * nested `[submenu]` that opens to the right on hover.\n *\n * @example\n * ```html\n * <wr-context-menu #menu>\n * <wr-context-menu-item icon=\"copy\" (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item icon=\"more\" [submenu]=\"extras\">More…</wr-context-menu-item>\n * </wr-context-menu>\n *\n * <wr-context-menu #extras>\n * <wr-context-menu-item (click)=\"duplicate()\">Duplicate</wr-context-menu-item>\n * <wr-context-menu-item (click)=\"archive()\">Archive</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n */\n@Component({\n selector: 'wr-context-menu-item',\n templateUrl: './context-menu-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'menuitem',\n '[class]': 'classes()',\n '[attr.tabindex]': '-1',\n '[attr.aria-disabled]': 'disabled() ? true : null',\n '[attr.aria-haspopup]': 'submenu() ? \"menu\" : null',\n '[attr.aria-expanded]': 'submenu() ? (submenuOpen ? \"true\" : \"false\") : null',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave($event)',\n '(click)': 'onClick()',\n '(keydown.enter)': 'activate($event)',\n '(keydown.space)': 'activate($event)',\n '(keydown.arrowRight)': 'onArrowRight($event)',\n '(keydown.arrowLeft)': 'onArrowLeft($event)',\n },\n imports: [WrIcon],\n})\nexport class WrContextMenuItem {\n /** Optional leading icon name. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n /** Disable interaction (suppresses pointer + keyboard). @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Optional nested `<wr-context-menu>`. When set, hovering the item\n * (or pressing →) opens it to the right with a chevron indicator.\n */\n readonly submenu = input<WrContextMenuPanel | null>(null);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-context-menu-item'];\n if (this.disabled()) parts.push('wr-context-menu-item--disabled');\n if (this.submenu()) parts.push('wr-context-menu-item--has-submenu');\n return parts.join(' ');\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n private submenuRef: OverlayRef | null = null;\n private openTimer: ReturnType<typeof setTimeout> | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n protected submenuOpen = false;\n\n /**\n * Global registry of open submenus keyed by the host element of the\n * item that owns them. Used to cascade-close descendants when a\n * parent submenu is disposed — Angular's onDestroy on detached\n * portals doesn't always tear down the deepest grand-children's\n * overlays in the right order, leaving orphaned floating panes.\n */\n private static readonly openSubmenus = new Map<HTMLElement, WrContextMenuItem>();\n\n /**\n * Dispose every open submenu pane on the page. Called by the root\n * `WrContextMenu` when its own overlay closes — destroyRef cascade\n * isn't reliable across separate overlay panes (each pane lives in\n * the CDK overlay container, not inside the parent pane's view).\n */\n static disposeAll(immediate: boolean): void {\n for (const [, owner] of [...WrContextMenuItem.openSubmenus]) {\n owner.disposeSubmenu(immediate);\n }\n }\n\n constructor() {\n this.destroyRef.onDestroy(() => this.disposeSubmenu(true));\n }\n\n /**\n * @internal Pointer activation — selecting a leaf item dismisses the\n * whole menu chain. The consumer's own `(click)` binding on the host\n * runs in the same event; we defer the close to a microtask so that\n * handler (the actual \"select\") always completes before the overlay\n * tears down, regardless of listener registration order. Items that\n * own a submenu (or are disabled) don't dismiss — clicking them just\n * drills into / ignores the row.\n */\n protected onClick(): void {\n if (this.disabled() || this.submenu()) return;\n queueMicrotask(() => WrContextMenu.closeActive());\n }\n\n /** @internal Keyboard activation — Enter / Space. */\n protected activate(event: Event): void {\n if (this.disabled()) return;\n if (this.submenu()) {\n event.preventDefault();\n this.scheduleOpen(0);\n return;\n }\n event.preventDefault();\n this.host.nativeElement.click();\n }\n\n /** @internal Right-arrow opens the submenu. */\n protected onArrowRight(event: Event): void {\n if (this.disabled() || !this.submenu()) return;\n event.preventDefault();\n this.scheduleOpen(0);\n }\n\n /** @internal Left-arrow closes the submenu (if open). */\n protected onArrowLeft(event: Event): void {\n if (!this.submenu() || !this.submenuOpen) return;\n event.preventDefault();\n this.scheduleClose(0);\n }\n\n /** @internal Hover schedules a submenu open after a small delay. */\n protected onMouseEnter(): void {\n if (this.disabled() || !this.submenu()) return;\n this.cancelClose();\n this.scheduleOpen(SUBMENU_OPEN_DELAY);\n }\n\n /** @internal Hover-out schedules a close with a grace window. */\n protected onMouseLeave(event: MouseEvent): void {\n if (!this.submenu()) return;\n this.cancelOpen();\n // Only skip the close when the cursor is moving into MY OWN submenu\n // (the user is drilling further down). Moving elsewhere — sibling\n // item, ancestor menu, or completely off the chain — should close\n // this item's submenu and let the cascade-on-dispose tear down any\n // descendants.\n if (this.relatedTargetIsInsideOwnSubmenu(event)) return;\n this.scheduleClose(SUBMENU_CLOSE_DELAY);\n }\n\n // Submenu lifecycle\n\n private scheduleOpen(delay: number): void {\n if (this.submenuRef) return;\n this.cancelOpen();\n if (delay === 0) {\n this.openSubmenu();\n return;\n }\n this.openTimer = setTimeout(() => {\n this.openTimer = null;\n this.openSubmenu();\n }, delay);\n }\n\n private scheduleClose(delay: number): void {\n this.cancelClose();\n if (delay === 0) {\n this.disposeSubmenu(false);\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.disposeSubmenu(false);\n }, delay);\n }\n\n private cancelOpen(): void {\n if (this.openTimer !== null) {\n clearTimeout(this.openTimer);\n this.openTimer = null;\n }\n }\n\n private cancelClose(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private openSubmenu(): void {\n const panel = this.submenu();\n if (!panel || this.submenuRef) return;\n\n // Position to the right of the item, vertically aligned with the\n // item's top. Falls back to opening to the LEFT if there's no room.\n const positions: ConnectedPosition[] = [\n { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 4 },\n { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -4 },\n ];\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(positions)\n .withPush(true);\n\n this.submenuRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: ['wr-context-menu-overlay', 'wr-context-menu-overlay--submenu'],\n });\n\n const portal = new TemplatePortal(panel.contentTpl(), this.vcr);\n this.submenuRef.attach(portal);\n\n // Mirror the open animation pattern from the root menu directive.\n const pane = this.submenuRef.overlayElement;\n requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));\n\n // Track mouse entering / leaving the submenu so we don't auto-close\n // when the cursor crosses the gap between item and submenu pane.\n pane.addEventListener('mouseenter', this.onSubmenuEnter);\n pane.addEventListener('mouseleave', this.onSubmenuLeave);\n\n this.submenuOpen = true;\n WrContextMenuItem.openSubmenus.set(this.host.nativeElement, this);\n }\n\n /** Bound handlers (= preserves identity for removeEventListener). */\n private readonly onSubmenuEnter = (): void => {\n this.cancelClose();\n // Cursor is inside our pane — keep the whole chain (root + every\n // ancestor submenu) alive.\n WrContextMenu.keepChainAlive();\n };\n private readonly onSubmenuLeave = (event: MouseEvent): void => {\n // Only stay open if the cursor is moving into a DESCENDANT submenu\n // of ours (an item inside our pane opening its own submenu). Moving\n // back up to an ancestor menu, sideways to a sibling, or completely\n // off-chain should dismiss this submenu (cascade-on-dispose then\n // tears down any deeper levels we own).\n if (this.relatedTargetIsInsideDescendantSubmenu(event)) return;\n this.scheduleClose(SUBMENU_CLOSE_DELAY);\n // If the cursor left ALL menu panes (root + every submenu), tear\n // down the whole chain. Otherwise just close this pane and let the\n // user continue navigating ancestors.\n if (!this.relatedTargetIsInsideAnyMenu(event)) {\n WrContextMenu.scheduleChainClose();\n }\n };\n\n private relatedTargetIsInsideAnyMenu(event: MouseEvent): boolean {\n const related = event.relatedTarget;\n if (!(related instanceof Element)) return false;\n return !!related.closest('.wr-context-menu-overlay');\n }\n\n /**\n * `true` when the cursor moved from this item directly into the pane\n * of its own (just-opening) submenu — drilling down. Sibling items\n * and ancestor menus do NOT count.\n */\n private relatedTargetIsInsideOwnSubmenu(event: MouseEvent): boolean {\n const related = event.relatedTarget;\n if (!(related instanceof Element) || !this.submenuRef) return false;\n return this.submenuRef.overlayElement.contains(related);\n }\n\n /**\n * `true` when the cursor moved from our submenu pane into another\n * submenu pane whose owner-item lives INSIDE ours — the user is\n * drilling further down the chain (e.g., from the Share submenu into\n * the Export-as submenu). Moving back up the chain returns false so\n * we close.\n */\n private relatedTargetIsInsideDescendantSubmenu(event: MouseEvent): boolean {\n const related = event.relatedTarget;\n if (!(related instanceof Element) || !this.submenuRef) return false;\n const targetPane = related.closest('.wr-context-menu-overlay');\n if (!targetPane) return false;\n const myPane = this.submenuRef.overlayElement;\n if (targetPane === myPane) return true;\n // Find the owner-item of the pane the cursor is heading into. If\n // that owner-item is inside our own pane, the destination is a\n // descendant submenu.\n for (const [ownerEl, owner] of WrContextMenuItem.openSubmenus) {\n if (owner.submenuRef?.overlayElement === targetPane) {\n return myPane.contains(ownerEl);\n }\n }\n return false;\n }\n\n private disposeSubmenu(immediate: boolean): void {\n this.cancelOpen();\n this.cancelClose();\n const ref = this.submenuRef;\n if (!ref) return;\n this.submenuRef = null;\n this.submenuOpen = false;\n WrContextMenuItem.openSubmenus.delete(this.host.nativeElement);\n\n const pane = ref.overlayElement;\n pane.removeEventListener('mouseenter', this.onSubmenuEnter);\n pane.removeEventListener('mouseleave', this.onSubmenuLeave);\n\n // Cascade-close any descendant submenus whose owner-item lives inside\n // the pane we're about to dispose. Without this, when a parent submenu\n // closes (via hover-out grace timer), a grandchild submenu whose owner\n // is rendered inside the parent's portal is orphaned — its OverlayRef\n // stays alive in the DOM with no parent to reach it from.\n for (const [ownerEl, owner] of WrContextMenuItem.openSubmenus) {\n if (pane.contains(ownerEl)) owner.disposeSubmenu(immediate);\n }\n\n if (immediate) {\n ref.dispose();\n return;\n }\n pane.classList.remove('wr-context-menu-overlay--open');\n setTimeout(() => ref.dispose(), SUBMENU_TRANSITION_MS);\n }\n}\n","@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","/**\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 OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { DestroyRef, Directive, ElementRef, ViewContainerRef, inject, input } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WrOutsideClick } from 'ngwr/overlay';\n\nimport { WrContextMenuItem } from './context-menu-item';\nimport type { WrContextMenuPanel } from './context-menu-panel';\n\n/**\n * Attach to any element to show a `<wr-context-menu>` at the pointer\n * position when the user right-clicks or otherwise sends a `contextmenu`\n * event (Shift+F10, etc.). The native browser menu is suppressed for the\n * host element.\n *\n * @example\n * ```html\n * <div [wrContextMenu]=\"menu\">Right-click me</div>\n * <wr-context-menu #menu>\n * <wr-context-menu-item (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item (click)=\"remove()\">Delete</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/context-menu\n */\n@Directive({\n selector: '[wrContextMenu]',\n host: {\n class: 'wr-context-menu-host',\n '(contextmenu)': 'onContextMenu($event)',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp()',\n '(pointercancel)': 'onPointerUp()',\n },\n})\nexport class WrContextMenu {\n /** Menu to open. Pass a `<wr-context-menu>` template reference. */\n readonly menu = input.required<WrContextMenuPanel>({ alias: 'wrContextMenu' });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n private overlayRef: OverlayRef | null = null;\n private closingTimer: ReturnType<typeof setTimeout> | null = null;\n private leaveTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Touch long-press → open. Right-click keeps using `(contextmenu)`.\n private pressTimer: ReturnType<typeof setTimeout> | null = null;\n private pressX = 0;\n private pressY = 0;\n private pressPageX = 0;\n private pressPageY = 0;\n private lastLongPressAt = 0;\n private cancelPressScroll: (() => void) | null = null;\n\n /**\n * Single open root menu at a time. Submenu items use this to signal\n * chain-level hover state: when the cursor enters ANY pane in the\n * chain (root or submenu) `keepChainAlive()` cancels the close timer;\n * when the cursor leaves ALL panes `scheduleChainClose()` starts it.\n * The whole chain (root → submenus) tears down through the root's\n * close (submenus react to their owner-item destroyRef + the static\n * registry in `WrContextMenuItem`).\n */\n private static activeRoot: WrContextMenu | null = null;\n\n /** Called from a submenu pane's mouseenter — keep the whole chain alive. */\n static keepChainAlive(): void {\n WrContextMenu.activeRoot?.cancelLeaveTimer();\n }\n\n /** Called from a submenu pane's mouseleave when the cursor left ALL menus. */\n static scheduleChainClose(): void {\n WrContextMenu.activeRoot?.scheduleLeave();\n }\n\n /**\n * Called from a `<wr-context-menu-item>` click — selecting an item\n * dismisses the whole chain (root + any open submenus). Items live in\n * a detached overlay portal, so they reach their owning root through\n * this static handle rather than DI.\n */\n static closeActive(): void {\n WrContextMenu.activeRoot?.closeOverlay();\n }\n\n /**\n * Open/close animation duration in ms. Matches the longest SCSS\n * transition on `.wr-context-menu-overlay` (the spring-scale curve).\n * The directive holds the overlay alive for this long during close\n * so the exit animation can play before the pane is removed from\n * the DOM.\n */\n private static readonly TRANSITION_MS = 220;\n /**\n * Grace window after the cursor leaves the root pane. Long enough\n * for the user to dip momentarily into the gap between the root and\n * a submenu (or back from a submenu), short enough to feel snappy\n * on a deliberate hover-out.\n */\n private static readonly LEAVE_DELAY = 240;\n\n /** Hold duration before a touch long-press opens the menu. */\n private static readonly LONG_PRESS_MS = 500;\n /** Finger travel (px) that turns a pending long-press into a scroll/drag. */\n private static readonly PRESS_MOVE_TOLERANCE = 10;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.cancelPress();\n this.closeOverlay();\n });\n }\n\n /** @internal Right-click handler — opens at the pointer (or re-positions if already open). */\n protected onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n // Some touch browsers (Android Chrome) fire a synthetic `contextmenu`\n // right after a long-press has already opened the menu — swallow it so it\n // doesn't re-open / restart the animation.\n if (Date.now() - this.lastLongPressAt < 700) return;\n event.stopPropagation();\n // Re-open at the new position even if it was already open.\n // Use page coords (document-relative) so the menu anchors to the\n // zone it was opened over — scrolling the page carries the menu\n // along with the content, matching native + PrimeNG behavior.\n this.closeOverlay();\n this.openOverlay(event.pageX, event.pageY);\n }\n\n /**\n * @internal Touch/pen long-press → open the menu at the press point. Desktop\n * right-click stays on `(contextmenu)`; this path is filtered to non-mouse\n * pointers. Deliberately does NOT `preventDefault`/`setPointerCapture` or set\n * `touch-action` — a press that turns into a scroll must still scroll, so the\n * open is cancelled on movement (> tolerance), on scroll, and on early lift.\n */\n protected onPointerDown(event: PointerEvent): void {\n if (event.pointerType === 'mouse' || !event.isPrimary || this.pressTimer !== null) return;\n this.pressX = event.clientX;\n this.pressY = event.clientY;\n this.pressPageX = event.pageX;\n this.pressPageY = event.pageY;\n this.pressTimer = setTimeout(() => {\n this.pressTimer = null;\n this.cancelPress();\n this.lastLongPressAt = Date.now();\n this.closeOverlay();\n this.openOverlay(this.pressPageX, this.pressPageY);\n }, WrContextMenu.LONG_PRESS_MS);\n const onScroll = (): void => this.cancelPress();\n document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n this.cancelPressScroll = (): void => document.removeEventListener('scroll', onScroll, { capture: true });\n }\n\n /** @internal Finger moved too far before the hold fired — it's a scroll/drag. */\n protected onPointerMove(event: PointerEvent): void {\n if (this.pressTimer === null) return;\n if (Math.hypot(event.clientX - this.pressX, event.clientY - this.pressY) > WrContextMenu.PRESS_MOVE_TOLERANCE) {\n this.cancelPress();\n }\n }\n\n /** @internal Lifted (or the browser claimed the gesture) before the hold fired. */\n protected onPointerUp(): void {\n this.cancelPress();\n }\n\n private cancelPress(): void {\n if (this.pressTimer !== null) {\n clearTimeout(this.pressTimer);\n this.pressTimer = null;\n }\n this.cancelPressScroll?.();\n this.cancelPressScroll = null;\n }\n\n /** Close the menu. */\n close(): void {\n this.closeOverlay();\n }\n\n // Overlay\n\n private openOverlay(x: number, y: number): void {\n // GlobalPositionStrategy uses margins, which led to flaky positioning\n // (`position: static` inline overridden by our `!important`, etc.).\n // Use it just to create the overlay, then write the coords directly to\n // the pane element via `top`/`left` so the menu sits exactly where the\n // user clicked and never moves until we close it.\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global(),\n // `noop` so scroll doesn't dismiss the menu. With absolute coords\n // pinned to viewport (`position: fixed` in the panel CSS), the menu\n // visually stays put as the page scrolls underneath.\n scrollStrategy: this.scrollStrategies.noop(),\n panelClass: ['wr-context-menu-overlay'],\n });\n\n const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Position model: the pane uses `position: fixed` (panel CSS) but we\n // want the menu to anchor to the DOCUMENT — when the user scrolls,\n // the menu should travel with the content it was opened over (native\n // browser + PrimeNG behavior). Strategy:\n //\n // - Record the page coords (pageX/pageY = document-relative).\n // - Each frame the user scrolls, set top/left to (pageX/Y minus the\n // current scroll offset). At scroll 0 this matches clientX/Y; as\n // scroll grows the menu shifts up/left visually, which is exactly\n // what `position: absolute` inside an un-fixed container would do\n // naturally — we just have to emulate it manually because CDK's\n // overlay container is `position: fixed`.\n const pane = this.overlayRef.overlayElement;\n pane.style.right = 'auto';\n pane.style.bottom = 'auto';\n pane.style.margin = '0';\n\n const sync = (): void => {\n pane.style.top = `${y - window.scrollY}px`;\n pane.style.left = `${x - window.scrollX}px`;\n };\n sync();\n\n // Trigger the open transition on the next frame — adding the class\n // synchronously with attach would skip the initial 0→1 frame and\n // the menu would just appear without animating.\n requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));\n\n // Hover-out closes the menu after a grace window, unless the\n // cursor moved INTO a descendant submenu (any other\n // `.wr-context-menu-overlay`). Re-entering the root cancels the\n // scheduled close so the user can dip out and back without losing\n // the menu.\n const onPaneLeave = (event: MouseEvent): void => {\n const related = event.relatedTarget;\n // Moving into ANY other menu pane (a submenu) keeps the chain\n // alive — the submenu's own mouseenter will cancel any pending\n // chain-close. Only schedule when the cursor genuinely left the\n // chain.\n if (related instanceof Element && related.closest('.wr-context-menu-overlay')) return;\n this.scheduleLeave();\n };\n const onPaneEnter = (): void => this.cancelLeaveTimer();\n pane.addEventListener('mouseleave', onPaneLeave);\n pane.addEventListener('mouseenter', onPaneEnter);\n WrContextMenu.activeRoot = this;\n this.overlayRef.detachments().subscribe(() => {\n pane.removeEventListener('mouseleave', onPaneLeave);\n pane.removeEventListener('mouseenter', onPaneEnter);\n });\n // Capture-phase listener on document catches scroll events from ANY\n // ancestor (window, html, body, custom scroll containers), so the\n // menu stays anchored to the click position even inside scrollable\n // layouts.\n document.addEventListener('scroll', sync, { capture: true, passive: true });\n // On resize the page layout reflows — the original pageX/pageY no\n // longer points at whatever the user right-clicked. Dismiss the menu\n // rather than dragging it across a now-stale coordinate (matches\n // PrimeNG / native behavior).\n const onResize = (): void => this.closeOverlay();\n window.addEventListener('resize', onResize, { passive: true });\n this.overlayRef.detachments().subscribe(() => {\n document.removeEventListener('scroll', sync, { capture: true });\n window.removeEventListener('resize', onResize);\n });\n\n // The right-click that opens the menu still has `mouseup` + `auxclick`\n // events pending, and the outside-click source fires on `auxclick` — which\n // would close the menu the instant the user lifts their finger. Two-part\n // guard:\n // 1. Track the open timestamp.\n // 2. Ignore any outside events that arrive within a short window\n // after the open (long enough to cover the original mouseup +\n // auxclick, short enough that a deliberate second click is\n // still respected).\n const openedAt = performance.now();\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (performance.now() - openedAt < 200) return;\n this.closeOverlay();\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.closeOverlay();\n this.host.nativeElement.focus();\n }\n });\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.cancelLeaveTimer();\n if (WrContextMenu.activeRoot === this) WrContextMenu.activeRoot = null;\n // Submenu panes live in the CDK overlay container, not inside the\n // root pane's view — destroyRef cascade through portal detach\n // doesn't reach them. Close them all explicitly first so they\n // don't float when the root is dismissed (outside-click, Esc, etc).\n WrContextMenuItem.disposeAll(false);\n const ref = this.overlayRef;\n const pane = ref.overlayElement;\n // Detach immediately would skip the exit animation. Remove the open\n // class first so the SCSS transition runs back to the default\n // (faded + scaled-down) state, then dispose after the transition.\n pane.classList.remove('wr-context-menu-overlay--open');\n if (this.closingTimer !== null) clearTimeout(this.closingTimer);\n this.closingTimer = setTimeout(() => {\n ref.dispose();\n this.closingTimer = null;\n }, WrContextMenu.TRANSITION_MS);\n // Mark immediately so a subsequent right-click opens a fresh menu\n // rather than landing on the disposing one.\n this.overlayRef = null;\n }\n\n private cancelLeaveTimer(): void {\n if (this.leaveTimer !== null) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n }\n\n private scheduleLeave(): void {\n this.cancelLeaveTimer();\n this.leaveTimer = setTimeout(() => {\n this.leaveTimer = null;\n this.closeOverlay();\n }, WrContextMenu.LEAVE_DELAY);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, TemplateRef, ViewEncapsulation, viewChild } from '@angular/core';\n\n/**\n * Container for the rows shown when a {@link WrContextMenu} opens.\n * The component itself doesn't render; the directive portals the inner\n * template into an overlay positioned at the pointer.\n *\n * @example\n * ```html\n * <div [wrContextMenu]=\"menu\">Right-click me</div>\n * <wr-context-menu #menu>\n * <wr-context-menu-item icon=\"copy\" (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item icon=\"trash\" (click)=\"remove()\">Delete</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n */\n@Component({\n selector: 'wr-context-menu',\n template: '<ng-template><div class=\"wr-context-menu\" role=\"menu\"><ng-content /></div></ng-template>',\n exportAs: 'wrContextMenu',\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display:none' },\n})\nexport class WrContextMenuPanel {\n /** The internal template the directive portals into the overlay. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\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 } from '@angular/core';\n\n/**\n * Thin horizontal separator inside a `<wr-context-menu>`. Use it to\n * group related items (e.g., a destructive action below a divider, or\n * a \"More\" section below the primary items).\n *\n * @example\n * ```html\n * <wr-context-menu #menu>\n * <wr-context-menu-item (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item (click)=\"paste()\">Paste</wr-context-menu-item>\n * <wr-context-menu-divider />\n * <wr-context-menu-item (click)=\"remove()\">Delete</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n */\n@Component({\n selector: 'wr-context-menu-divider',\n template: '',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-context-menu-divider',\n role: 'separator',\n 'aria-orientation': 'horizontal',\n },\n})\nexport class WrContextMenuDivider {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAsBH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,oBAAoB,+MARrB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQD,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAVhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,QAAQ,EAAE,EAAE;oBACZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,yBAAyB;AAChC,wBAAA,IAAI,EAAE,WAAW;AACjB,wBAAA,kBAAkB,EAAE,YAAY;AACjC,qBAAA;AACF,iBAAA;;;ACjCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-context-menu.mjs","sources":["../../../projects/lib/context-menu/context-menu-item.ts","../../../projects/lib/context-menu/context-menu-item.html","../../../projects/lib/context-menu/context-menu.ts","../../../projects/lib/context-menu/context-menu-panel.ts","../../../projects/lib/context-menu/context-menu-divider.ts","../../../projects/lib/context-menu/ngwr-context-menu.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type ConnectedPosition, type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\nimport { WR_OVERLAY, wrMirrorOffsets } from 'ngwr/overlay';\nimport { randomId } from 'ngwr/utils';\n\nimport { WrContextMenu } from './context-menu';\nimport type { WrContextMenuPanel } from './context-menu-panel';\n\n/** Hover delay (ms) before a submenu opens. */\nconst SUBMENU_OPEN_DELAY = 120;\n/** Grace window (ms) before a submenu closes when the cursor leaves it. */\nconst SUBMENU_CLOSE_DELAY = 240;\n/** Animation duration of the submenu — mirrors the root menu CSS. */\nconst SUBMENU_TRANSITION_MS = 220;\n\n/**\n * Single row inside a `<wr-context-menu>`. Mirrors `<wr-dropdown-item>` —\n * rendered as a menu item with an optional leading icon and an optional\n * nested `[submenu]` that opens to the right on hover.\n *\n * @example\n * ```html\n * <wr-context-menu #menu>\n * <wr-context-menu-item icon=\"copy\" (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item icon=\"more\" [submenu]=\"extras\">More…</wr-context-menu-item>\n * </wr-context-menu>\n *\n * <wr-context-menu #extras>\n * <wr-context-menu-item (click)=\"duplicate()\">Duplicate</wr-context-menu-item>\n * <wr-context-menu-item (click)=\"archive()\">Archive</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n */\n@Component({\n selector: 'wr-context-menu-item',\n templateUrl: './context-menu-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'menuitem',\n '[class]': 'classes()',\n '[attr.tabindex]': '-1',\n '[attr.aria-disabled]': 'disabled() ? true : null',\n '[attr.aria-haspopup]': 'submenu() ? \"menu\" : null',\n '[attr.aria-expanded]': 'submenu() ? (submenuOpen ? \"true\" : \"false\") : null',\n '[attr.aria-controls]': 'submenuId()',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave($event)',\n '(click)': 'onClick()',\n '(keydown.enter)': 'activate($event)',\n '(keydown.space)': 'activate($event)',\n '(keydown.arrowRight)': 'onArrowRight($event)',\n '(keydown.arrowLeft)': 'onArrowLeft($event)',\n },\n imports: [WrIcon],\n})\nexport class WrContextMenuItem {\n /** Optional leading icon name. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n /** Disable interaction (suppresses pointer + keyboard). @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Optional nested `<wr-context-menu>`. When set, hovering the item\n * (or pressing →) opens it to the right with a chevron indicator.\n */\n readonly submenu = input<WrContextMenuPanel | null>(null);\n\n protected readonly classes = computed(() => {\n const parts = ['wr-context-menu-item'];\n if (this.disabled()) parts.push('wr-context-menu-item--disabled');\n if (this.submenu()) parts.push('wr-context-menu-item--has-submenu');\n return parts.join(' ');\n });\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 vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n private submenuRef: OverlayRef | null = null;\n private openTimer: ReturnType<typeof setTimeout> | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n protected submenuOpen = false;\n\n /**\n * Id of the submenu's menu element while it is open, published on the item as\n * `aria-controls` — the same contract the root trigger keeps (see\n * {@link WrContextMenu}). Each submenu pane is its own overlay in the shared\n * container, so `aria-haspopup` / `aria-expanded` say that a submenu EXISTS\n * and is showing, and this says WHICH one.\n *\n * A signal, not a plain field like `submenuOpen`: host bindings re-run only\n * when something they read has changed, and this flips outside change\n * detection. Writing it is also what now refreshes `aria-expanded` next to\n * it, which used to depend on some unrelated work dirtying the view.\n *\n * @internal\n */\n protected readonly submenuId = signal<string | null>(null);\n\n /**\n * Global registry of open submenus keyed by the host element of the\n * item that owns them. Used to cascade-close descendants when a\n * parent submenu is disposed — Angular's onDestroy on detached\n * portals doesn't always tear down the deepest grand-children's\n * overlays in the right order, leaving orphaned floating panes.\n */\n private static readonly openSubmenus = new Map<HTMLElement, WrContextMenuItem>();\n\n /**\n * Dispose every open submenu pane on the page. Called by the root\n * `WrContextMenu` when its own overlay closes — destroyRef cascade\n * isn't reliable across separate overlay panes (each pane lives in\n * the CDK overlay container, not inside the parent pane's view).\n */\n static disposeAll(immediate: boolean): void {\n for (const [, owner] of [...WrContextMenuItem.openSubmenus]) {\n owner.disposeSubmenu(immediate);\n }\n }\n\n constructor() {\n this.destroyRef.onDestroy(() => this.disposeSubmenu(true));\n }\n\n /**\n * @internal Pointer activation — selecting a leaf item dismisses the\n * whole menu chain. The consumer's own `(click)` binding on the host\n * runs in the same event; we defer the close to a microtask so that\n * handler (the actual \"select\") always completes before the overlay\n * tears down, regardless of listener registration order. Items that\n * own a submenu (or are disabled) don't dismiss — clicking them just\n * drills into / ignores the row.\n */\n protected onClick(): void {\n if (this.disabled() || this.submenu()) return;\n queueMicrotask(() => WrContextMenu.closeActive());\n }\n\n /** @internal Keyboard activation — Enter / Space. */\n protected activate(event: Event): void {\n if (this.disabled()) return;\n if (this.submenu()) {\n event.preventDefault();\n this.scheduleOpen(0);\n return;\n }\n event.preventDefault();\n this.host.nativeElement.click();\n }\n\n /**\n * @internal The arrow that walks INTO a submenu, which is the one pointing the\n * way the menu cascades: right in LTR, left in RTL. The panes mirror with the\n * reading direction (the CDK flips their placement), so a fixed ArrowRight\n * would ask an RTL user to press toward the parent to open the child.\n */\n protected onArrowRight(event: Event): void {\n if (this.isRtl()) return this.closeFromKey(event);\n this.openFromKey(event);\n }\n\n /** @internal The arrow that walks back OUT — the mirror of {@link onArrowRight}. */\n protected onArrowLeft(event: Event): void {\n if (this.isRtl()) return this.openFromKey(event);\n this.closeFromKey(event);\n }\n\n private openFromKey(event: Event): void {\n if (this.disabled() || !this.submenu()) return;\n event.preventDefault();\n this.scheduleOpen(0);\n }\n\n private closeFromKey(event: Event): void {\n if (!this.submenu() || !this.submenuOpen) return;\n event.preventDefault();\n this.scheduleClose(0);\n }\n\n /** @internal Hover schedules a submenu open after a small delay. */\n protected onMouseEnter(): void {\n if (this.disabled() || !this.submenu()) return;\n this.cancelClose();\n this.scheduleOpen(SUBMENU_OPEN_DELAY);\n }\n\n /** @internal Hover-out schedules a close with a grace window. */\n protected onMouseLeave(event: MouseEvent): void {\n if (!this.submenu()) return;\n this.cancelOpen();\n // Only skip the close when the cursor is moving into MY OWN submenu\n // (the user is drilling further down). Moving elsewhere — sibling\n // item, ancestor menu, or completely off the chain — should close\n // this item's submenu and let the cascade-on-dispose tear down any\n // descendants.\n if (this.relatedTargetIsInsideOwnSubmenu(event)) return;\n this.scheduleClose(SUBMENU_CLOSE_DELAY);\n }\n\n // Submenu lifecycle\n\n private scheduleOpen(delay: number): void {\n if (this.submenuRef) return;\n this.cancelOpen();\n if (delay === 0) {\n this.openSubmenu();\n return;\n }\n this.openTimer = setTimeout(() => {\n this.openTimer = null;\n this.openSubmenu();\n }, delay);\n }\n\n private scheduleClose(delay: number): void {\n this.cancelClose();\n if (delay === 0) {\n this.disposeSubmenu(false);\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n this.disposeSubmenu(false);\n }, delay);\n }\n\n private cancelOpen(): void {\n if (this.openTimer !== null) {\n clearTimeout(this.openTimer);\n this.openTimer = null;\n }\n }\n\n private cancelClose(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private openSubmenu(): void {\n const panel = this.submenu();\n if (!panel || this.submenuRef) return;\n\n // Position to the right of the item, vertically aligned with the\n // item's top. Falls back to opening to the LEFT if there's no room.\n const positions: ConnectedPosition[] = [\n { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 4 },\n { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -4 },\n ];\n\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(wrMirrorOffsets(positions, this.isRtl()))\n .withPush(true);\n\n this.submenuRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.reposition(),\n panelClass: ['wr-context-menu-overlay', 'wr-context-menu-overlay--submenu'],\n });\n\n const portal = new TemplatePortal(panel.contentTpl(), this.vcr);\n this.submenuRef.attach(portal);\n\n // Mirror the open animation pattern from the root menu directive.\n const pane = this.submenuRef.overlayElement;\n requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));\n\n // Name the pane's menu so the item can point at it — minted per open for\n // the same reason the root does it (a closing pane outlives its close).\n const menuEl = pane.querySelector<HTMLElement>('.wr-context-menu');\n if (menuEl) {\n menuEl.id = randomId('wr-context-menu');\n this.submenuId.set(menuEl.id);\n }\n\n // Track mouse entering / leaving the submenu so we don't auto-close\n // when the cursor crosses the gap between item and submenu pane.\n pane.addEventListener('mouseenter', this.onSubmenuEnter);\n pane.addEventListener('mouseleave', this.onSubmenuLeave);\n\n this.submenuOpen = true;\n WrContextMenuItem.openSubmenus.set(this.host.nativeElement, this);\n }\n\n /** Bound handlers (= preserves identity for removeEventListener). */\n private readonly onSubmenuEnter = (): void => {\n this.cancelClose();\n // Cursor is inside our pane — keep the whole chain (root + every\n // ancestor submenu) alive.\n WrContextMenu.keepChainAlive();\n };\n private readonly onSubmenuLeave = (event: MouseEvent): void => {\n // Only stay open if the cursor is moving into a DESCENDANT submenu\n // of ours (an item inside our pane opening its own submenu). Moving\n // back up to an ancestor menu, sideways to a sibling, or completely\n // off-chain should dismiss this submenu (cascade-on-dispose then\n // tears down any deeper levels we own).\n if (this.relatedTargetIsInsideDescendantSubmenu(event)) return;\n this.scheduleClose(SUBMENU_CLOSE_DELAY);\n // If the cursor left ALL menu panes (root + every submenu), tear\n // down the whole chain. Otherwise just close this pane and let the\n // user continue navigating ancestors.\n if (!this.relatedTargetIsInsideAnyMenu(event)) {\n WrContextMenu.scheduleChainClose();\n }\n };\n\n private relatedTargetIsInsideAnyMenu(event: MouseEvent): boolean {\n const related = event.relatedTarget;\n if (!(related instanceof Element)) return false;\n return !!related.closest('.wr-context-menu-overlay');\n }\n\n /**\n * `true` when the cursor moved from this item directly into the pane\n * of its own (just-opening) submenu — drilling down. Sibling items\n * and ancestor menus do NOT count.\n */\n private relatedTargetIsInsideOwnSubmenu(event: MouseEvent): boolean {\n const related = event.relatedTarget;\n if (!(related instanceof Element) || !this.submenuRef) return false;\n return this.submenuRef.overlayElement.contains(related);\n }\n\n /**\n * `true` when the cursor moved from our submenu pane into another\n * submenu pane whose owner-item lives INSIDE ours — the user is\n * drilling further down the chain (e.g., from the Share submenu into\n * the Export-as submenu). Moving back up the chain returns false so\n * we close.\n */\n private relatedTargetIsInsideDescendantSubmenu(event: MouseEvent): boolean {\n const related = event.relatedTarget;\n if (!(related instanceof Element) || !this.submenuRef) return false;\n const targetPane = related.closest('.wr-context-menu-overlay');\n if (!targetPane) return false;\n const myPane = this.submenuRef.overlayElement;\n if (targetPane === myPane) return true;\n // Find the owner-item of the pane the cursor is heading into. If\n // that owner-item is inside our own pane, the destination is a\n // descendant submenu.\n for (const [ownerEl, owner] of WrContextMenuItem.openSubmenus) {\n if (owner.submenuRef?.overlayElement === targetPane) {\n return myPane.contains(ownerEl);\n }\n }\n return false;\n }\n\n private disposeSubmenu(immediate: boolean): void {\n this.cancelOpen();\n this.cancelClose();\n const ref = this.submenuRef;\n if (!ref) return;\n this.submenuRef = null;\n this.submenuOpen = false;\n this.submenuId.set(null);\n WrContextMenuItem.openSubmenus.delete(this.host.nativeElement);\n\n const pane = ref.overlayElement;\n pane.removeEventListener('mouseenter', this.onSubmenuEnter);\n pane.removeEventListener('mouseleave', this.onSubmenuLeave);\n\n // Cascade-close any descendant submenus whose owner-item lives inside\n // the pane we're about to dispose. Without this, when a parent submenu\n // closes (via hover-out grace timer), a grandchild submenu whose owner\n // is rendered inside the parent's portal is orphaned — its OverlayRef\n // stays alive in the DOM with no parent to reach it from.\n for (const [ownerEl, owner] of WrContextMenuItem.openSubmenus) {\n if (pane.contains(ownerEl)) owner.disposeSubmenu(immediate);\n }\n\n if (immediate) {\n ref.dispose();\n return;\n }\n pane.classList.remove('wr-context-menu-overlay--open');\n setTimeout(() => ref.dispose(), SUBMENU_TRANSITION_MS);\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","@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","/**\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 OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { DestroyRef, Directive, ElementRef, ViewContainerRef, inject, input, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WrOutsideClick } from 'ngwr/overlay';\nimport { randomId } from 'ngwr/utils';\n\nimport { WrContextMenuItem } from './context-menu-item';\nimport type { WrContextMenuPanel } from './context-menu-panel';\n\n/**\n * Attach to any element to show a `<wr-context-menu>` at the pointer\n * position when the user right-clicks or otherwise sends a `contextmenu`\n * event (Shift+F10, etc.). The native browser menu is suppressed for the\n * host element.\n *\n * @example\n * ```html\n * <div [wrContextMenu]=\"menu\">Right-click me</div>\n * <wr-context-menu #menu>\n * <wr-context-menu-item (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item (click)=\"remove()\">Delete</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/context-menu\n */\n@Directive({\n selector: '[wrContextMenu]',\n host: {\n class: 'wr-context-menu-host',\n '[attr.aria-controls]': 'openMenuId()',\n '(contextmenu)': 'onContextMenu($event)',\n '(pointerdown)': 'onPointerDown($event)',\n '(pointermove)': 'onPointerMove($event)',\n '(pointerup)': 'onPointerUp()',\n '(pointercancel)': 'onPointerUp()',\n },\n})\nexport class WrContextMenu {\n /** Menu to open. Pass a `<wr-context-menu>` template reference. */\n readonly menu = input.required<WrContextMenuPanel>({ alias: 'wrContextMenu' });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Id of the menu element while this trigger's menu is open, published on the\n * host as `aria-controls`. The pane is portalled into the overlay container, a\n * sibling of the whole app, so this reference is the ONLY link between a\n * trigger and the menu it opened — for a screen reader, and for anything else\n * that has to find it. Cleared on close, which is also what tells an open\n * trigger from a closing one: the pane itself lingers for the exit animation.\n *\n * A signal, not a plain field: host bindings re-run only when something they\n * READ has changed, and this one flips outside change detection (from a\n * pointer handler, and from `onDestroy`). Held as a plain string it published\n * the id on open — the overlay attach happens to dirty the host view — and\n * then kept it forever, so the trigger still pointed at a menu that was gone.\n *\n * @internal\n */\n protected readonly openMenuId = signal<string | null>(null);\n\n private overlayRef: OverlayRef | null = null;\n private closingTimer: ReturnType<typeof setTimeout> | null = null;\n private leaveTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Touch long-press → open. Right-click keeps using `(contextmenu)`.\n private pressTimer: ReturnType<typeof setTimeout> | null = null;\n private pressX = 0;\n private pressY = 0;\n private pressPageX = 0;\n private pressPageY = 0;\n private lastLongPressAt = 0;\n private cancelPressScroll: (() => void) | null = null;\n\n /**\n * Single open root menu at a time. Submenu items use this to signal\n * chain-level hover state: when the cursor enters ANY pane in the\n * chain (root or submenu) `keepChainAlive()` cancels the close timer;\n * when the cursor leaves ALL panes `scheduleChainClose()` starts it.\n * The whole chain (root → submenus) tears down through the root's\n * close (submenus react to their owner-item destroyRef + the static\n * registry in `WrContextMenuItem`).\n */\n private static activeRoot: WrContextMenu | null = null;\n\n /** Called from a submenu pane's mouseenter — keep the whole chain alive. */\n static keepChainAlive(): void {\n WrContextMenu.activeRoot?.cancelLeaveTimer();\n }\n\n /** Called from a submenu pane's mouseleave when the cursor left ALL menus. */\n static scheduleChainClose(): void {\n WrContextMenu.activeRoot?.scheduleLeave();\n }\n\n /**\n * Called from a `<wr-context-menu-item>` click — selecting an item\n * dismisses the whole chain (root + any open submenus). Items live in\n * a detached overlay portal, so they reach their owning root through\n * this static handle rather than DI.\n */\n static closeActive(): void {\n WrContextMenu.activeRoot?.closeOverlay();\n }\n\n /**\n * Open/close animation duration in ms. Matches the longest SCSS\n * transition on `.wr-context-menu-overlay` (the spring-scale curve).\n * The directive holds the overlay alive for this long during close\n * so the exit animation can play before the pane is removed from\n * the DOM.\n */\n private static readonly TRANSITION_MS = 220;\n /**\n * Grace window after the cursor leaves the root pane. Long enough\n * for the user to dip momentarily into the gap between the root and\n * a submenu (or back from a submenu), short enough to feel snappy\n * on a deliberate hover-out.\n */\n private static readonly LEAVE_DELAY = 240;\n\n /** Hold duration before a touch long-press opens the menu. */\n private static readonly LONG_PRESS_MS = 500;\n /** Finger travel (px) that turns a pending long-press into a scroll/drag. */\n private static readonly PRESS_MOVE_TOLERANCE = 10;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.cancelPress();\n this.closeOverlay();\n });\n }\n\n /** @internal Right-click handler — opens at the pointer (or re-positions if already open). */\n protected onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n // Some touch browsers (Android Chrome) fire a synthetic `contextmenu`\n // right after a long-press has already opened the menu — swallow it so it\n // doesn't re-open / restart the animation.\n if (Date.now() - this.lastLongPressAt < 700) return;\n event.stopPropagation();\n // Re-open at the new position even if it was already open.\n // Use page coords (document-relative) so the menu anchors to the\n // zone it was opened over — scrolling the page carries the menu\n // along with the content, matching native + PrimeNG behavior.\n this.closeOverlay();\n this.openOverlay(event.pageX, event.pageY);\n }\n\n /**\n * @internal Touch/pen long-press → open the menu at the press point. Desktop\n * right-click stays on `(contextmenu)`; this path is filtered to non-mouse\n * pointers. Deliberately does NOT `preventDefault`/`setPointerCapture` or set\n * `touch-action` — a press that turns into a scroll must still scroll, so the\n * open is cancelled on movement (> tolerance), on scroll, and on early lift.\n */\n protected onPointerDown(event: PointerEvent): void {\n if (event.pointerType === 'mouse' || !event.isPrimary || this.pressTimer !== null) return;\n this.pressX = event.clientX;\n this.pressY = event.clientY;\n this.pressPageX = event.pageX;\n this.pressPageY = event.pageY;\n this.pressTimer = setTimeout(() => {\n this.pressTimer = null;\n this.cancelPress();\n this.lastLongPressAt = Date.now();\n this.closeOverlay();\n this.openOverlay(this.pressPageX, this.pressPageY);\n }, WrContextMenu.LONG_PRESS_MS);\n const onScroll = (): void => this.cancelPress();\n document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n this.cancelPressScroll = (): void => document.removeEventListener('scroll', onScroll, { capture: true });\n }\n\n /** @internal Finger moved too far before the hold fired — it's a scroll/drag. */\n protected onPointerMove(event: PointerEvent): void {\n if (this.pressTimer === null) return;\n if (Math.hypot(event.clientX - this.pressX, event.clientY - this.pressY) > WrContextMenu.PRESS_MOVE_TOLERANCE) {\n this.cancelPress();\n }\n }\n\n /** @internal Lifted (or the browser claimed the gesture) before the hold fired. */\n protected onPointerUp(): void {\n this.cancelPress();\n }\n\n private cancelPress(): void {\n if (this.pressTimer !== null) {\n clearTimeout(this.pressTimer);\n this.pressTimer = null;\n }\n this.cancelPressScroll?.();\n this.cancelPressScroll = null;\n }\n\n /** Close the menu. */\n close(): void {\n this.closeOverlay();\n }\n\n // Overlay\n\n private openOverlay(x: number, y: number): void {\n // GlobalPositionStrategy uses margins, which led to flaky positioning\n // (`position: static` inline overridden by our `!important`, etc.).\n // Use it just to create the overlay, then write the coords directly to\n // the pane element via `top`/`left` so the menu sits exactly where the\n // user clicked and never moves until we close it.\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global(),\n // `noop` so scroll doesn't dismiss the menu. With absolute coords\n // pinned to viewport (`position: fixed` in the panel CSS), the menu\n // visually stays put as the page scrolls underneath.\n scrollStrategy: this.scrollStrategies.noop(),\n panelClass: ['wr-context-menu-overlay'],\n });\n\n const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Position model: the pane uses `position: fixed` (panel CSS) but we\n // want the menu to anchor to the DOCUMENT — when the user scrolls,\n // the menu should travel with the content it was opened over (native\n // browser + PrimeNG behavior). Strategy:\n //\n // - Record the page coords (pageX/pageY = document-relative).\n // - Each frame the user scrolls, set top/left to (pageX/Y minus the\n // current scroll offset). At scroll 0 this matches clientX/Y; as\n // scroll grows the menu shifts up/left visually, which is exactly\n // what `position: absolute` inside an un-fixed container would do\n // naturally — we just have to emulate it manually because CDK's\n // overlay container is `position: fixed`.\n const pane = this.overlayRef.overlayElement;\n pane.style.right = 'auto';\n pane.style.bottom = 'auto';\n pane.style.margin = '0';\n\n // Name the menu we just opened so the host can point at it. The id is\n // minted per OPEN rather than living on the panel: `closeOverlay()` keeps\n // the previous pane in the DOM for its exit animation, so a re-open would\n // otherwise leave two elements answering to the same id — with the dying\n // one first in document order.\n const menuEl = pane.querySelector<HTMLElement>('.wr-context-menu');\n if (menuEl) {\n menuEl.id = randomId('wr-context-menu');\n this.openMenuId.set(menuEl.id);\n }\n\n const sync = (): void => {\n pane.style.top = `${y - window.scrollY}px`;\n pane.style.left = `${x - window.scrollX}px`;\n };\n sync();\n\n // Trigger the open transition on the next frame — adding the class\n // synchronously with attach would skip the initial 0→1 frame and\n // the menu would just appear without animating.\n requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));\n\n // Hover-out closes the menu after a grace window, unless the\n // cursor moved INTO a descendant submenu (any other\n // `.wr-context-menu-overlay`). Re-entering the root cancels the\n // scheduled close so the user can dip out and back without losing\n // the menu.\n const onPaneLeave = (event: MouseEvent): void => {\n const related = event.relatedTarget;\n // Moving into ANY other menu pane (a submenu) keeps the chain\n // alive — the submenu's own mouseenter will cancel any pending\n // chain-close. Only schedule when the cursor genuinely left the\n // chain.\n if (related instanceof Element && related.closest('.wr-context-menu-overlay')) return;\n this.scheduleLeave();\n };\n const onPaneEnter = (): void => this.cancelLeaveTimer();\n pane.addEventListener('mouseleave', onPaneLeave);\n pane.addEventListener('mouseenter', onPaneEnter);\n WrContextMenu.activeRoot = this;\n this.overlayRef.detachments().subscribe(() => {\n pane.removeEventListener('mouseleave', onPaneLeave);\n pane.removeEventListener('mouseenter', onPaneEnter);\n });\n // Capture-phase listener on document catches scroll events from ANY\n // ancestor (window, html, body, custom scroll containers), so the\n // menu stays anchored to the click position even inside scrollable\n // layouts.\n document.addEventListener('scroll', sync, { capture: true, passive: true });\n // On resize the page layout reflows — the original pageX/pageY no\n // longer points at whatever the user right-clicked. Dismiss the menu\n // rather than dragging it across a now-stale coordinate (matches\n // PrimeNG / native behavior).\n const onResize = (): void => this.closeOverlay();\n window.addEventListener('resize', onResize, { passive: true });\n this.overlayRef.detachments().subscribe(() => {\n document.removeEventListener('scroll', sync, { capture: true });\n window.removeEventListener('resize', onResize);\n });\n\n // The right-click that opens the menu still has `mouseup` + `auxclick`\n // events pending, and the outside-click source fires on `auxclick` — which\n // would close the menu the instant the user lifts their finger. Two-part\n // guard:\n // 1. Track the open timestamp.\n // 2. Ignore any outside events that arrive within a short window\n // after the open (long enough to cover the original mouseup +\n // auxclick, short enough that a deliberate second click is\n // still respected).\n const openedAt = performance.now();\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (performance.now() - openedAt < 200) return;\n this.closeOverlay();\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.closeOverlay();\n this.host.nativeElement.focus();\n }\n });\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.cancelLeaveTimer();\n // Drop the reference immediately: the pane below stays in the DOM until the\n // exit animation has played, and a trigger still pointing at a menu on its\n // way out reads as open.\n this.openMenuId.set(null);\n if (WrContextMenu.activeRoot === this) WrContextMenu.activeRoot = null;\n // Submenu panes live in the CDK overlay container, not inside the\n // root pane's view — destroyRef cascade through portal detach\n // doesn't reach them. Close them all explicitly first so they\n // don't float when the root is dismissed (outside-click, Esc, etc).\n WrContextMenuItem.disposeAll(false);\n const ref = this.overlayRef;\n const pane = ref.overlayElement;\n // Detach immediately would skip the exit animation. Remove the open\n // class first so the SCSS transition runs back to the default\n // (faded + scaled-down) state, then dispose after the transition.\n pane.classList.remove('wr-context-menu-overlay--open');\n if (this.closingTimer !== null) clearTimeout(this.closingTimer);\n this.closingTimer = setTimeout(() => {\n ref.dispose();\n this.closingTimer = null;\n }, WrContextMenu.TRANSITION_MS);\n // Mark immediately so a subsequent right-click opens a fresh menu\n // rather than landing on the disposing one.\n this.overlayRef = null;\n }\n\n private cancelLeaveTimer(): void {\n if (this.leaveTimer !== null) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n }\n\n private scheduleLeave(): void {\n this.cancelLeaveTimer();\n this.leaveTimer = setTimeout(() => {\n this.leaveTimer = null;\n this.closeOverlay();\n }, WrContextMenu.LEAVE_DELAY);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, TemplateRef, ViewEncapsulation, viewChild } from '@angular/core';\n\n/**\n * Container for the rows shown when a {@link WrContextMenu} opens.\n * The component itself doesn't render; the directive portals the inner\n * template into an overlay positioned at the pointer.\n *\n * @example\n * ```html\n * <div [wrContextMenu]=\"menu\">Right-click me</div>\n * <wr-context-menu #menu>\n * <wr-context-menu-item icon=\"copy\" (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item icon=\"trash\" (click)=\"remove()\">Delete</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n */\n@Component({\n selector: 'wr-context-menu',\n template: '<ng-template><div class=\"wr-context-menu\" role=\"menu\"><ng-content /></div></ng-template>',\n exportAs: 'wrContextMenu',\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display:none' },\n})\nexport class WrContextMenuPanel {\n /** The internal template the directive portals into the overlay. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\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 } from '@angular/core';\n\n/**\n * Thin horizontal separator inside a `<wr-context-menu>`. Use it to\n * group related items (e.g., a destructive action below a divider, or\n * a \"More\" section below the primary items).\n *\n * @example\n * ```html\n * <wr-context-menu #menu>\n * <wr-context-menu-item (click)=\"copy()\">Copy</wr-context-menu-item>\n * <wr-context-menu-item (click)=\"paste()\">Paste</wr-context-menu-item>\n * <wr-context-menu-divider />\n * <wr-context-menu-item (click)=\"remove()\">Delete</wr-context-menu-item>\n * </wr-context-menu>\n * ```\n */\n@Component({\n selector: 'wr-context-menu-divider',\n template: '',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-context-menu-divider',\n role: 'separator',\n 'aria-orientation': 'horizontal',\n },\n})\nexport class WrContextMenuDivider {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;AAKG;AAyBH;AACA,MAAM,kBAAkB,GAAG,GAAG;AAC9B;AACA,MAAM,mBAAmB,GAAG,GAAG;AAC/B;AACA,MAAM,qBAAqB,GAAG,GAAG;AAEjC;;;;;;;;;;;;;;;;;AAiBG;MAuBU,iBAAiB,CAAA;;IAEnB,IAAI,GAAG,KAAK,CAAoB,IAAI;6EAAC;;IAGrC,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBA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AAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQD,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAVhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,QAAQ,EAAE,EAAE;oBACZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,yBAAyB;AAChC,wBAAA,IAAI,EAAE,WAAW;AACjB,wBAAA,kBAAkB,EAAE,YAAY;AACjC,qBAAA;AACF,iBAAA;;;ACjCD;;AAEG;;;;"}
@@ -86,7 +86,11 @@ class WrCookie {
86
86
  parts.push(`path=${opts.path}`);
87
87
  if (opts.domain)
88
88
  parts.push(`domain=${opts.domain}`);
89
- if (opts.secure)
89
+ // `SameSite=None` REQUIRES `Secure`: every modern browser drops the cookie outright
90
+ // without it, so asking for one without the other used to be a silent no-op — the one
91
+ // failure a cookie API must not have. The caller asked for a cross-site cookie, and
92
+ // this is what one is.
93
+ if (opts.secure || opts.sameSite === 'None')
90
94
  parts.push('secure');
91
95
  parts.push(`samesite=${opts.sameSite}`);
92
96
  try {