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,589 @@
1
+ import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
2
+
3
+ /**
4
+ * @license
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
8
+ */
9
+ /**
10
+ * Test harness for one command inside an open `<wr-command-palette>`.
11
+ *
12
+ * An item is an `option` in the palette's listbox, and it is never focused — the
13
+ * search input keeps focus and points at the highlighted row with
14
+ * `aria-activedescendant` — so `aria-selected` and the row's `id` are the whole
15
+ * story a screen reader is told, and both are read here rather than the
16
+ * `--active` class that paints it.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const palette = await loader.getHarness(WrCommandPaletteHarness);
21
+ * const [first] = await palette.getItems();
22
+ *
23
+ * expect(await first.getLabel()).toBe('Open file');
24
+ * expect(await first.getShortcut()).toBe('⌘O');
25
+ * ```
26
+ *
27
+ * @see https://ngwr.dev/guides/testing
28
+ */
29
+ class WrCommandPaletteItemHarness extends ComponentHarness {
30
+ /** The row the palette renders per command — also the `role="option"`. */
31
+ static hostSelector = '.wr-command-palette__option';
32
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
33
+ static with(options = {}) {
34
+ return new HarnessPredicate(WrCommandPaletteItemHarness, options)
35
+ .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getLabel(), text))
36
+ .addOption('active', options.active, async (harness, active) => (await harness.isActive()) === active);
37
+ }
38
+ /**
39
+ * The item's primary label.
40
+ *
41
+ * Read from the label element rather than from the host's text: the host also
42
+ * holds the description, the shortcut hint, and whatever text sits inside a
43
+ * registered icon's SVG (`<title>`, most often) — an icon with one would
44
+ * otherwise turn up in the middle of the answer.
45
+ */
46
+ async getLabel() {
47
+ return (await this.locatorFor('.wr-command-palette__option-label')()).text();
48
+ }
49
+ /** The secondary line under the label, or `null` when the item declares none. */
50
+ async getDescription() {
51
+ const description = await this.locatorForOptional('.wr-command-palette__option-description')();
52
+ return description ? description.text() : null;
53
+ }
54
+ /**
55
+ * The shortcut hint painted on the right, or `null` when the item declares none.
56
+ *
57
+ * A hint only — the palette draws whatever string it was given and binds
58
+ * nothing. Only `trigger` is a real keybinding.
59
+ */
60
+ async getShortcut() {
61
+ const shortcut = await this.locatorForOptional('.wr-command-palette__option-shortcut')();
62
+ return shortcut ? shortcut.text() : null;
63
+ }
64
+ /**
65
+ * The leading icon's registered name, or `null` when the item declares no icon.
66
+ *
67
+ * The icon SLOT is always painted — an item without one gets a blank span so
68
+ * every label stays on the same left edge — so the query is for the `<wr-icon>`
69
+ * itself. It reflects the name it was asked for as `data-icon` whether or not
70
+ * that name is registered, so this answers what the item MEANT to draw.
71
+ */
72
+ async getIconName() {
73
+ const icon = await this.locatorForOptional('wr-icon.wr-command-palette__option-icon')();
74
+ return icon ? icon.getAttribute('data-icon') : null;
75
+ }
76
+ /** The role the item announces — `option`. */
77
+ async getRole() {
78
+ return (await this.host()).getAttribute('role');
79
+ }
80
+ /**
81
+ * Whether this item is the highlighted one.
82
+ *
83
+ * From `aria-selected`, not the `wr-command-palette__option--active` class:
84
+ * both are public and the template paints them from the same predicate, but the
85
+ * attribute is what a screen reader acts on — and it is the one
86
+ * `aria-activedescendant` has to agree with. See
87
+ * `WrCommandPaletteHarness.isActiveItemAnnounced()`.
88
+ */
89
+ async isActive() {
90
+ return (await (await this.host()).getAttribute('aria-selected')) === 'true';
91
+ }
92
+ /** The row's `id` — what the search input points at while this item is highlighted. */
93
+ async getId() {
94
+ const id = await (await this.host()).getAttribute('id');
95
+ if (!id) {
96
+ throw new Error(`WrCommandPaletteItemHarness.getId(): "${await this.getLabel()}" has no id, so no search input can ` +
97
+ 'point at it with `aria-activedescendant` — the palette assigns one per rendered row.');
98
+ }
99
+ return id;
100
+ }
101
+ /**
102
+ * Run this command — the pointer path.
103
+ *
104
+ * The palette commits on `mousedown` rather than on `click`, so that a press
105
+ * inside the panel never lets the input lose focus first; the CDK's click
106
+ * sequence opens with one, so this drives the real handler. It needs no
107
+ * coordinates, which is what makes it usable in jsdom at all.
108
+ *
109
+ * With `closeOnPick` left at its default this also closes the palette, taking
110
+ * every item harness — including this one — out of the DOM.
111
+ */
112
+ async click() {
113
+ return (await this.host()).click();
114
+ }
115
+ /**
116
+ * Move the pointer onto this item, which highlights it.
117
+ *
118
+ * The palette follows the pointer as well as the keyboard, but only the
119
+ * keyboard scrolls the row into view — hovering deliberately leaves the scroll
120
+ * position alone, since moving it would fight the pointer that caused the move.
121
+ */
122
+ async hover() {
123
+ return (await this.host()).hover();
124
+ }
125
+ }
126
+
127
+ /**
128
+ * @license
129
+ *
130
+ * Use of this source code is governed by an MIT-style license that can be
131
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
132
+ */
133
+ /**
134
+ * Test harness for one bucket of commands inside an open `<wr-command-palette>`.
135
+ *
136
+ * The palette buckets its items by `group`, in the order each group first
137
+ * appears in `items` — which is why this exists as a harness of its own: it is
138
+ * the only way to ask which commands ended up under which heading, and the
139
+ * rendered order is the contract every index in the palette is counted against.
140
+ *
141
+ * A bucket WITH a title is a labelled `group`; the bucket holding ungrouped items
142
+ * carries `role="none"` instead, so its options belong to the listbox directly —
143
+ * a `listbox` may only own `option` and `group` children, and a role-less
144
+ * wrapper in between is something ARIA has no rule for.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * const palette = await loader.getHarness(WrCommandPaletteHarness);
149
+ * const [file] = await palette.getGroups({ title: 'File' });
150
+ *
151
+ * expect(await file.getItemLabels()).toEqual(['Open file', 'Save file']);
152
+ * ```
153
+ *
154
+ * @see https://ngwr.dev/guides/testing
155
+ */
156
+ class WrCommandPaletteGroupHarness extends ComponentHarness {
157
+ static hostSelector = '.wr-command-palette__group';
158
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
159
+ static with(options = {}) {
160
+ return new HarnessPredicate(WrCommandPaletteGroupHarness, options).addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title));
161
+ }
162
+ /** The heading over this bucket, or `null` for the one holding ungrouped items. */
163
+ async getTitle() {
164
+ const title = await this.locatorForOptional('.wr-command-palette__group-title')();
165
+ return title ? title.text() : null;
166
+ }
167
+ /**
168
+ * The role this bucket announces — `group` when it has a title, `none` when it
169
+ * does not, which promotes its options to the listbox's own children.
170
+ */
171
+ async getRole() {
172
+ return (await this.host()).getAttribute('role');
173
+ }
174
+ /**
175
+ * Whether this bucket takes its accessible name from its own heading.
176
+ *
177
+ * The reference IS the group's name — no bucket carries an `aria-label` — and
178
+ * the id it points at is generated, so a spec cannot hard-code one. `false` for
179
+ * the untitled bucket, which has no name and needs none: it is `role="none"`.
180
+ */
181
+ async isLabelledByTitle() {
182
+ const title = await this.locatorForOptional('.wr-command-palette__group-title')();
183
+ if (!title)
184
+ return false;
185
+ const labelledBy = await (await this.host()).getAttribute('aria-labelledby');
186
+ return labelledBy !== null && labelledBy === (await title.getAttribute('id'));
187
+ }
188
+ /** The commands in this bucket, in rendered order. */
189
+ async getItems(filters = {}) {
190
+ return this.locatorForAll(WrCommandPaletteItemHarness.with(filters))();
191
+ }
192
+ /** The labels of the commands in this bucket, in rendered order. */
193
+ async getItemLabels() {
194
+ const items = await this.getItems();
195
+ return Promise.all(items.map(item => item.getLabel()));
196
+ }
197
+ }
198
+
199
+ /**
200
+ * @license
201
+ *
202
+ * Use of this source code is governed by an MIT-style license that can be
203
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
204
+ */
205
+ /**
206
+ * Test harness for `<wr-command-palette>` — the `⌘K` modal, its search box and
207
+ * the filtered list of commands.
208
+ *
209
+ * Three things about this component shape the harness, and none of them match the
210
+ * other overlay harnesses in the library:
211
+ *
212
+ * 1. **It is an element, and it keeps its own dialog.** The panel is NOT portalled
213
+ * into the overlay container: the whole `role="dialog"` lives inside
214
+ * `<wr-command-palette>`, wrapped in an `@if (open())`. So every query here is
215
+ * host-scoped — two palettes on one page cannot read each other's rows — and a
216
+ * closed palette holds nothing at all, which is why the readers below throw
217
+ * instead of answering emptily.
218
+ * 2. **There is no trigger element.** The way in is a GLOBAL hotkey (`trigger`,
219
+ * `'mod+k'` by default), bound on the document, so {@link open} presses a chord
220
+ * at the document rather than clicking anything. A palette with
221
+ * `[trigger]="null"` cannot be opened from the DOM at all — set the bound
222
+ * `open` from the spec. And because the first binding to match a chord calls
223
+ * `preventDefault()`, which stops the rest, two palettes sharing one chord
224
+ * means only the first-registered one ever toggles: see {@link pressTrigger}.
225
+ * 3. **The rows are never focused.** Focus stays in the search input, which points
226
+ * at the highlighted row with `aria-activedescendant`. Navigation is therefore
227
+ * `moveTo*`, not `focus`, and "where am I" is answered by `aria-selected` plus
228
+ * that reference — {@link isActiveItemAnnounced} asserts the pair agrees.
229
+ *
230
+ * @example
231
+ * ```ts
232
+ * const palette = await loader.getHarness(WrCommandPaletteHarness);
233
+ *
234
+ * await palette.open();
235
+ * await palette.setQuery('file');
236
+ * await palette.moveToNextItem();
237
+ * await palette.runActiveItem();
238
+ * ```
239
+ *
240
+ * @see https://ngwr.dev/guides/testing
241
+ */
242
+ class WrCommandPaletteHarness extends ComponentHarness {
243
+ static hostSelector = 'wr-command-palette';
244
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
245
+ static with(options = {}) {
246
+ return new HarnessPredicate(WrCommandPaletteHarness, options)
247
+ .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open)
248
+ .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));
249
+ }
250
+ /** Whether the palette is showing. */
251
+ async isOpen() {
252
+ return (await this.dialog()) !== null;
253
+ }
254
+ /**
255
+ * The role the palette announces — `dialog` — or `null` while it is closed.
256
+ *
257
+ * Worth asking rather than assuming: the role sits on the palette's own
258
+ * backdrop-and-panel wrapper, not on the `<wr-command-palette>` host, so a
259
+ * consumer looking for it on the element they wrote would not find it.
260
+ */
261
+ async getRole() {
262
+ const dialog = await this.dialog();
263
+ return dialog ? dialog.getAttribute('role') : null;
264
+ }
265
+ /** Whether the palette is marked `aria-modal`. `false` while it is closed. */
266
+ async isModal() {
267
+ const dialog = await this.dialog();
268
+ return dialog !== null && (await dialog.getAttribute('aria-modal')) === 'true';
269
+ }
270
+ /**
271
+ * The palette's accessible name — `paletteLabel`, or the catalogue string it
272
+ * falls back to. `null` while it is closed, since the element carrying the name
273
+ * does not exist then.
274
+ */
275
+ async getLabel() {
276
+ const dialog = await this.dialog();
277
+ return dialog ? dialog.getAttribute('aria-label') : null;
278
+ }
279
+ /**
280
+ * Whether this opening is presented full-screen instead of as a centred modal.
281
+ *
282
+ * Read from the `--sheet` modifier, which is public API: `responsive` is an
283
+ * input that never reaches the DOM, and the decision also folds in the viewport
284
+ * width — so the class is the only place the outcome exists. `false` while closed.
285
+ *
286
+ * That width is sampled when the palette last RECOMPUTED the decision, which is
287
+ * when `responsive` or the app-wide `provideWrResponsiveOverlays()` config
288
+ * changes — not when the palette opens. So a spec that narrows the viewport and
289
+ * then opens sees nothing move until one of those two changes as well.
290
+ */
291
+ async isPresentedAsSheet() {
292
+ const dialog = await this.dialog();
293
+ return dialog !== null && (await dialog.hasClass('wr-command-palette--sheet'));
294
+ }
295
+ /** The search box's placeholder — `placeholder`, or the catalogue fallback. */
296
+ async getPlaceholder() {
297
+ return (await this.searchInput('getPlaceholder')).getProperty('placeholder');
298
+ }
299
+ /** What is currently typed in the search box. */
300
+ async getQuery() {
301
+ return (await this.searchInput('getQuery')).getProperty('value');
302
+ }
303
+ /**
304
+ * Replace the search query, filtering the list.
305
+ *
306
+ * The palette matches a query against each item's label, description, group and
307
+ * keywords, and every keystroke sends the highlight back to the FIRST result —
308
+ * so a spec that moves the highlight and then types has to move it again.
309
+ */
310
+ async setQuery(query) {
311
+ const input = await this.searchInput('setQuery');
312
+ await input.clear();
313
+ if (query)
314
+ await input.sendKeys(query);
315
+ }
316
+ /**
317
+ * Whether the search box and the list are wired to each other the way a
318
+ * combobox and its listbox have to be: the input announces itself expanded and
319
+ * its `aria-controls` names THIS palette's listbox.
320
+ *
321
+ * The ids are generated per instance, so a spec cannot hard-code one — and this
322
+ * reads the listbox inside this host, so a second palette's list can never
323
+ * satisfy it.
324
+ */
325
+ async isSearchWiredToList() {
326
+ const input = await this.searchInput('isSearchWiredToList');
327
+ const controls = await input.getAttribute('aria-controls');
328
+ return ((await input.getAttribute('aria-expanded')) === 'true' &&
329
+ controls !== null &&
330
+ controls === (await (await this.listbox()).getAttribute('id')));
331
+ }
332
+ /**
333
+ * The commands currently offered, in rendered order.
334
+ *
335
+ * Rendered order, not the order they were passed in: the palette buckets by
336
+ * `group` as each group first appears, so two interleaved groups come back
337
+ * regrouped — and that order is what the arrows walk and what every index here
338
+ * counts against.
339
+ */
340
+ async getItems(filters = {}) {
341
+ await this.requireOpen('getItems');
342
+ return this.locatorForAll(WrCommandPaletteItemHarness.with(filters))();
343
+ }
344
+ /** The labels of the commands currently offered, in rendered order. */
345
+ async getItemLabels() {
346
+ const items = await this.getItems();
347
+ return Promise.all(items.map(item => item.getLabel()));
348
+ }
349
+ /** The buckets the commands are grouped into, in rendered order. */
350
+ async getGroups(filters = {}) {
351
+ await this.requireOpen('getGroups');
352
+ return this.locatorForAll(WrCommandPaletteGroupHarness.with(filters))();
353
+ }
354
+ /**
355
+ * One entry per bucket, in rendered order — `null` for the bucket holding
356
+ * ungrouped items, which is unlabelled by design.
357
+ */
358
+ async getGroupTitles() {
359
+ const groups = await this.getGroups();
360
+ return Promise.all(groups.map(group => group.getTitle()));
361
+ }
362
+ /**
363
+ * The "no results" message, or `null` when the palette has results.
364
+ *
365
+ * The two are exclusive — the panel renders the message INSTEAD of the buckets —
366
+ * so a non-null answer here and an empty {@link getItemLabels} are the same fact.
367
+ */
368
+ async getEmptyText() {
369
+ await this.requireOpen('getEmptyText');
370
+ const empty = await this.locatorForOptional('.wr-command-palette__empty')();
371
+ return empty ? empty.text() : null;
372
+ }
373
+ /** The highlighted command, or `null` when nothing matches the query. */
374
+ async getActiveItem() {
375
+ const [active] = await this.getItems({ active: true });
376
+ return active ?? null;
377
+ }
378
+ /** The highlighted command's label, or `null` when nothing matches the query. */
379
+ async getActiveItemLabel() {
380
+ const active = await this.getActiveItem();
381
+ return active ? active.getLabel() : null;
382
+ }
383
+ /**
384
+ * Where the highlight sits in the rendered list, or `-1` when nothing matches
385
+ * the query.
386
+ */
387
+ async getActiveItemIndex() {
388
+ const items = await this.getItems();
389
+ for (let index = 0; index < items.length; index++) {
390
+ if (await items[index].isActive())
391
+ return index;
392
+ }
393
+ return -1;
394
+ }
395
+ /**
396
+ * Whether the search box points at the row that is actually highlighted.
397
+ *
398
+ * The rows are not focusable, so this reference is the ONLY thing telling a
399
+ * screen-reader user where they are — and it is a per-instance id, so it is also
400
+ * what would give away a palette announcing another palette's row. An empty list
401
+ * announces nothing, and that counts as agreeing.
402
+ */
403
+ async isActiveItemAnnounced() {
404
+ const announced = await (await this.searchInput('isActiveItemAnnounced')).getAttribute('aria-activedescendant');
405
+ const active = await this.getActiveItem();
406
+ if (!active)
407
+ return announced === null;
408
+ return announced !== null && announced === (await active.getId());
409
+ }
410
+ /**
411
+ * Open the palette with its global hotkey.
412
+ *
413
+ * Throws when the chord changes nothing, because every reason it would is worth
414
+ * failing on rather than continuing against a closed palette — see
415
+ * {@link pressTrigger} for the list.
416
+ */
417
+ async open() {
418
+ if (await this.isOpen())
419
+ return;
420
+ await this.pressTrigger();
421
+ }
422
+ /**
423
+ * Close the palette with Escape, the way a keyboard user does. A closed palette
424
+ * is left alone.
425
+ */
426
+ async close() {
427
+ if (!(await this.isOpen()))
428
+ return;
429
+ await (await this.searchInput('close')).sendKeys(TestKey.ESCAPE);
430
+ if (!(await this.isOpen()))
431
+ return;
432
+ throw new Error('WrCommandPaletteHarness.close(): Escape did not close the palette. The panel handles it whatever ' +
433
+ 'holds focus inside, so check that `open` is not being written back by the binding it came from.');
434
+ }
435
+ /** Dismiss the palette by clicking outside the panel, on the backdrop. */
436
+ async clickBackdrop() {
437
+ await this.requireOpen('clickBackdrop');
438
+ await (await this.locatorFor('.wr-command-palette__backdrop')()).click();
439
+ }
440
+ /**
441
+ * Press the palette's global trigger chord, which TOGGLES it.
442
+ *
443
+ * Two things make this the least local method on the harness, and both are the
444
+ * component's design rather than a shortcut here:
445
+ *
446
+ * - The chord is dispatched at the document, because that is where `trigger` is
447
+ * bound. It reaches every palette on the page, not just this one.
448
+ * - `mod` is Cmd on a Mac and Ctrl everywhere else, and nothing in the DOM says
449
+ * which. The binding compares modifier state EXACTLY, so a chord with both set
450
+ * matches neither: Ctrl is tried first, then Cmd, watching whether this palette
451
+ * moved.
452
+ *
453
+ * Throws when neither did anything. With two palettes bound to the same chord
454
+ * that is exactly what happens to the SECOND one — the first binding to match
455
+ * calls `preventDefault()`, which stops the rest — and the first palette will
456
+ * have toggled on the way. Give the palettes different `trigger` specs, or drive
457
+ * them through the bound `open`.
458
+ */
459
+ async pressTrigger() {
460
+ const before = await this.isOpen();
461
+ await this.pressHotkey('k', { control: true });
462
+ if ((await this.isOpen()) !== before)
463
+ return;
464
+ await this.pressHotkey('k', { meta: true });
465
+ if ((await this.isOpen()) !== before)
466
+ return;
467
+ throw new Error('WrCommandPaletteHarness.pressTrigger(): `mod+k` left this palette ' +
468
+ `${before ? 'open' : 'closed'}. It fails when \`trigger\` is \`null\` (nothing is bound — write the ` +
469
+ 'bound `open` instead), when `trigger` is some other spec (press it with pressHotkey()), or when ' +
470
+ 'another palette is bound to the same chord and matched it first.');
471
+ }
472
+ /**
473
+ * Press an arbitrary chord at the document, where `trigger` is bound — the way
474
+ * to exercise a palette whose `trigger` is not the default `'mod+k'`.
475
+ *
476
+ * The keys go to the `<wr-command-palette>` host and bubble to the document from
477
+ * there. Any element inside the page would do — the listener is the document's,
478
+ * and it fires even while a text field has focus — but the host is the one this
479
+ * harness can always reach, and it takes no focus of its own, so an open palette
480
+ * keeps the caret in its search box.
481
+ */
482
+ async pressHotkey(key, modifiers = {}) {
483
+ await (await this.host()).sendKeys(modifiers, key);
484
+ }
485
+ /** Move the highlight down one row. Wraps from the last row to the first. */
486
+ async moveToNextItem() {
487
+ await (await this.searchInput('moveToNextItem')).sendKeys(TestKey.DOWN_ARROW);
488
+ }
489
+ /** Move the highlight up one row. Wraps from the first row to the last. */
490
+ async moveToPreviousItem() {
491
+ await (await this.searchInput('moveToPreviousItem')).sendKeys(TestKey.UP_ARROW);
492
+ }
493
+ /** Move the highlight to the first row — Home. */
494
+ async moveToFirstItem() {
495
+ await (await this.searchInput('moveToFirstItem')).sendKeys(TestKey.HOME);
496
+ }
497
+ /** Move the highlight to the last row — End. */
498
+ async moveToLastItem() {
499
+ await (await this.searchInput('moveToLastItem')).sendKeys(TestKey.END);
500
+ }
501
+ /**
502
+ * Run the highlighted command — Enter in the search box, the accessible path.
503
+ *
504
+ * Throws when nothing is highlighted, which happens exactly when the query
505
+ * matches nothing: Enter would then be a no-op and the spec would pass having
506
+ * run no command at all. Assert {@link getEmptyText} instead.
507
+ */
508
+ async runActiveItem() {
509
+ const input = await this.searchInput('runActiveItem');
510
+ if (!(await this.getActiveItem())) {
511
+ throw new Error('WrCommandPaletteHarness.runActiveItem(): nothing is highlighted, so Enter would run nothing — ' +
512
+ `the query "${await this.getQuery()}" matches no command. Assert getEmptyText() instead.`);
513
+ }
514
+ await input.sendKeys(TestKey.ENTER);
515
+ }
516
+ /**
517
+ * Run the first command matching the filters, by pointer.
518
+ *
519
+ * The palette must already be open — unlike a select, there is nothing to click
520
+ * to open it, so this cannot do it for you. With `closeOnPick` left at its
521
+ * default the palette closes as the command runs.
522
+ */
523
+ async runItem(filters) {
524
+ const [item] = await this.getItems(filters);
525
+ if (!item) {
526
+ const offered = await this.getItemLabels();
527
+ throw new Error(`WrCommandPaletteHarness.runItem(): no command matched ${JSON.stringify(filters)}. ` +
528
+ `The palette offers: ${offered.length > 0 ? offered.join(', ') : '(nothing — the query matches none)'}.`);
529
+ }
530
+ await item.click();
531
+ }
532
+ /** Put the caret in the search box. The palette does this itself as it opens. */
533
+ async focus() {
534
+ return (await this.searchInput('focus')).focus();
535
+ }
536
+ /**
537
+ * Take focus out of the search box.
538
+ *
539
+ * The palette emits nothing on blur — it exists so a spec can prove
540
+ * {@link focus} puts the caret back where the component put it.
541
+ */
542
+ async blur() {
543
+ return (await this.searchInput('blur')).blur();
544
+ }
545
+ /**
546
+ * Whether the caret is in the search box.
547
+ *
548
+ * The only focus question worth asking of this component: the rows are never
549
+ * focused, so the input is where focus is meant to stay for as long as the
550
+ * palette is open.
551
+ */
552
+ async isSearchInputFocused() {
553
+ return (await this.searchInput('isSearchInputFocused')).isFocused();
554
+ }
555
+ /** The palette's dialog wrapper, or `null` while it is closed. */
556
+ async dialog() {
557
+ // The role, not `.wr-command-palette`: both sit on the same element, but the
558
+ // role is what a screen reader is told, and the element only exists while the
559
+ // palette is open — so "is there a dialog in this host" IS the open state.
560
+ return this.locatorForOptional('[role="dialog"]')();
561
+ }
562
+ /** The search box, or a failure naming the reason there is none. */
563
+ async searchInput(method) {
564
+ await this.requireOpen(method);
565
+ // Matched on the role rather than on `.wr-command-palette__search input`: the
566
+ // combobox is the accessible contract, and the search row also holds a
567
+ // decorative icon and the `esc` hint.
568
+ return this.locatorFor('input[role="combobox"]')();
569
+ }
570
+ /** This palette's listbox. */
571
+ async listbox() {
572
+ return this.locatorFor('[role="listbox"]')();
573
+ }
574
+ /** Fail with the reason when the panel is not rendered. */
575
+ async requireOpen(method) {
576
+ if (await this.isOpen())
577
+ return;
578
+ throw new Error(`WrCommandPaletteHarness.${method}(): the palette is closed, so nothing it holds exists — the search ` +
579
+ 'box, the list and the rows are all inside an `@if (open())`. Call open() to press the global ' +
580
+ 'trigger, or set the bound `open` when this palette has none.');
581
+ }
582
+ }
583
+
584
+ /**
585
+ * Generated bundle index. Do not edit.
586
+ */
587
+
588
+ export { WrCommandPaletteGroupHarness, WrCommandPaletteHarness, WrCommandPaletteItemHarness };
589
+ //# sourceMappingURL=ngwr-command-palette-testing.mjs.map