ngwr 10.2.1 → 11.1.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 (431) hide show
  1. package/README.md +39 -19
  2. package/action-sheet/styles/_index.scss +4 -1
  3. package/anchor/styles/_index.scss +6 -5
  4. package/back-top/styles/_index.scss +6 -1
  5. package/blur-text/styles/_index.scss +13 -0
  6. package/button/styles/_index.scss +11 -6
  7. package/calendar/styles/_index.scss +11 -2
  8. package/carousel/styles/_index.scss +13 -2
  9. package/cascader/styles/_index.scss +5 -3
  10. package/circular-text/styles/_index.scss +2 -0
  11. package/collapse/styles/_index.scss +1 -1
  12. package/color-picker/styles/_index.scss +6 -1
  13. package/command-palette/styles/_index.scss +2 -1
  14. package/compare/styles/_index.scss +1 -2
  15. package/context-menu/styles/_index.scss +8 -2
  16. package/descriptions/styles/_index.scss +2 -2
  17. package/dialog/styles/_index.scss +7 -0
  18. package/drawer/styles/_index.scss +20 -1
  19. package/dropdown/styles/_index.scss +19 -5
  20. package/empty/styles/_index.scss +10 -0
  21. package/falling-text/styles/_index.scss +2 -1
  22. package/fesm2022/ngwr-action-sheet.mjs +13 -3
  23. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  24. package/fesm2022/ngwr-affix.mjs +40 -13
  25. package/fesm2022/ngwr-affix.mjs.map +1 -1
  26. package/fesm2022/ngwr-anchor.mjs +18 -6
  27. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  28. package/fesm2022/ngwr-aurora.mjs +2 -2
  29. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  30. package/fesm2022/ngwr-avatar.mjs +31 -7
  31. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  32. package/fesm2022/ngwr-back-top.mjs +6 -2
  33. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  34. package/fesm2022/ngwr-badge.mjs +1 -1
  35. package/fesm2022/ngwr-badge.mjs.map +1 -1
  36. package/fesm2022/ngwr-bar-chart.mjs +30 -9
  37. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  38. package/fesm2022/ngwr-blur-text.mjs +2 -2
  39. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  40. package/fesm2022/ngwr-border-glow.mjs +2 -2
  41. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  42. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  43. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  44. package/fesm2022/ngwr-burger.mjs +9 -4
  45. package/fesm2022/ngwr-burger.mjs.map +1 -1
  46. package/fesm2022/ngwr-button-testing.mjs +96 -0
  47. package/fesm2022/ngwr-button-testing.mjs.map +1 -0
  48. package/fesm2022/ngwr-button.mjs +31 -14
  49. package/fesm2022/ngwr-button.mjs.map +1 -1
  50. package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
  51. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  52. package/fesm2022/ngwr-calendar.mjs +20 -1
  53. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  54. package/fesm2022/ngwr-card.mjs +2 -2
  55. package/fesm2022/ngwr-card.mjs.map +1 -1
  56. package/fesm2022/ngwr-carousel-testing.mjs +377 -0
  57. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
  58. package/fesm2022/ngwr-carousel.mjs +67 -13
  59. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  60. package/fesm2022/ngwr-cascader-testing.mjs +534 -0
  61. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
  62. package/fesm2022/ngwr-cascader.mjs +2 -2
  63. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  64. package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
  65. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
  66. package/fesm2022/ngwr-checkbox.mjs +9 -3
  67. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  68. package/fesm2022/ngwr-circular-text.mjs +2 -2
  69. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  70. package/fesm2022/ngwr-click-spark.mjs +2 -2
  71. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  72. package/fesm2022/ngwr-collapse-testing.mjs +368 -0
  73. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
  74. package/fesm2022/ngwr-color-picker.mjs +134 -14
  75. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  76. package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
  77. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
  78. package/fesm2022/ngwr-command-palette.mjs +58 -8
  79. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  80. package/fesm2022/ngwr-compare.mjs +103 -13
  81. package/fesm2022/ngwr-compare.mjs.map +1 -1
  82. package/fesm2022/ngwr-config.mjs +106 -0
  83. package/fesm2022/ngwr-config.mjs.map +1 -0
  84. package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
  85. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
  86. package/fesm2022/ngwr-context-menu.mjs +94 -8
  87. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  88. package/fesm2022/ngwr-cookie.mjs +5 -1
  89. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  90. package/fesm2022/ngwr-counter.mjs +11 -3
  91. package/fesm2022/ngwr-counter.mjs.map +1 -1
  92. package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
  93. package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
  94. package/fesm2022/ngwr-date-adapter.mjs +54 -8
  95. package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
  96. package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
  97. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
  98. package/fesm2022/ngwr-date-picker.mjs +73 -3
  99. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  100. package/fesm2022/ngwr-decrypt-text.mjs +27 -9
  101. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  102. package/fesm2022/ngwr-dialog-testing.mjs +89 -0
  103. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
  104. package/fesm2022/ngwr-directives.mjs +36 -12
  105. package/fesm2022/ngwr-directives.mjs.map +1 -1
  106. package/fesm2022/ngwr-donut-chart.mjs +22 -5
  107. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  108. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  109. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  110. package/fesm2022/ngwr-drawer-testing.mjs +250 -0
  111. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
  112. package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
  113. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
  114. package/fesm2022/ngwr-dropdown.mjs +10 -2
  115. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  116. package/fesm2022/ngwr-empty.mjs +24 -7
  117. package/fesm2022/ngwr-empty.mjs.map +1 -1
  118. package/fesm2022/ngwr-event-calendar.mjs +57 -10
  119. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  120. package/fesm2022/ngwr-falling-text.mjs +2 -2
  121. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  122. package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
  123. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
  124. package/fesm2022/ngwr-form-testing.mjs +451 -0
  125. package/fesm2022/ngwr-form-testing.mjs.map +1 -0
  126. package/fesm2022/ngwr-form.mjs +19 -3
  127. package/fesm2022/ngwr-form.mjs.map +1 -1
  128. package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
  129. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  130. package/fesm2022/ngwr-gauge.mjs +19 -5
  131. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  132. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  133. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  134. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  135. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-en.mjs +50 -0
  137. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-ru.mjs +48 -0
  139. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  140. package/fesm2022/ngwr-image-cropper.mjs +23 -0
  141. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  142. package/fesm2022/ngwr-input-number-testing.mjs +306 -0
  143. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
  144. package/fesm2022/ngwr-input-number.mjs +35 -3
  145. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  146. package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
  147. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
  148. package/fesm2022/ngwr-input-otp.mjs +36 -5
  149. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  150. package/fesm2022/ngwr-input-testing.mjs +102 -0
  151. package/fesm2022/ngwr-input-testing.mjs.map +1 -0
  152. package/fesm2022/ngwr-input.mjs +47 -10
  153. package/fesm2022/ngwr-input.mjs.map +1 -1
  154. package/fesm2022/ngwr-knob.mjs +44 -8
  155. package/fesm2022/ngwr-knob.mjs.map +1 -1
  156. package/fesm2022/ngwr-layout.mjs +21 -5
  157. package/fesm2022/ngwr-layout.mjs.map +1 -1
  158. package/fesm2022/ngwr-lightbox.mjs +33 -6
  159. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  160. package/fesm2022/ngwr-line-chart.mjs +17 -4
  161. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  162. package/fesm2022/ngwr-list.mjs +2 -2
  163. package/fesm2022/ngwr-list.mjs.map +1 -1
  164. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  165. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  166. package/fesm2022/ngwr-markdown-testing.mjs +516 -0
  167. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
  168. package/fesm2022/ngwr-markdown.mjs +1492 -0
  169. package/fesm2022/ngwr-markdown.mjs.map +1 -0
  170. package/fesm2022/ngwr-marquee.mjs +17 -6
  171. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  172. package/fesm2022/ngwr-mention-testing.mjs +513 -0
  173. package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
  174. package/fesm2022/ngwr-mention.mjs +10 -1
  175. package/fesm2022/ngwr-mention.mjs.map +1 -1
  176. package/fesm2022/ngwr-meta.mjs +22 -7
  177. package/fesm2022/ngwr-meta.mjs.map +1 -1
  178. package/fesm2022/ngwr-meter-group.mjs +19 -5
  179. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  180. package/fesm2022/ngwr-overlay.mjs +41 -1
  181. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  182. package/fesm2022/ngwr-pagination-testing.mjs +389 -0
  183. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
  184. package/fesm2022/ngwr-pagination.mjs +14 -2
  185. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  186. package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
  187. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
  188. package/fesm2022/ngwr-popconfirm.mjs +95 -17
  189. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  190. package/fesm2022/ngwr-popover-testing.mjs +316 -0
  191. package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
  192. package/fesm2022/ngwr-popover.mjs +21 -3
  193. package/fesm2022/ngwr-popover.mjs.map +1 -1
  194. package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
  195. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  196. package/fesm2022/ngwr-qr.mjs +13 -3
  197. package/fesm2022/ngwr-qr.mjs.map +1 -1
  198. package/fesm2022/ngwr-radio-testing.mjs +392 -0
  199. package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
  200. package/fesm2022/ngwr-radio.mjs +10 -3
  201. package/fesm2022/ngwr-radio.mjs.map +1 -1
  202. package/fesm2022/ngwr-rating-testing.mjs +384 -0
  203. package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
  204. package/fesm2022/ngwr-rating.mjs +37 -2
  205. package/fesm2022/ngwr-rating.mjs.map +1 -1
  206. package/fesm2022/ngwr-segmented-testing.mjs +512 -0
  207. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
  208. package/fesm2022/ngwr-select-testing.mjs +268 -0
  209. package/fesm2022/ngwr-select-testing.mjs.map +1 -0
  210. package/fesm2022/ngwr-select.mjs +87 -16
  211. package/fesm2022/ngwr-select.mjs.map +1 -1
  212. package/fesm2022/ngwr-shiny-text.mjs +2 -2
  213. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  214. package/fesm2022/ngwr-sidebar.mjs +65 -12
  215. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  216. package/fesm2022/ngwr-slider-testing.mjs +478 -0
  217. package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
  218. package/fesm2022/ngwr-slider.mjs +57 -13
  219. package/fesm2022/ngwr-slider.mjs.map +1 -1
  220. package/fesm2022/ngwr-sparkline.mjs +26 -6
  221. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  222. package/fesm2022/ngwr-speed-dial.mjs +37 -4
  223. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  224. package/fesm2022/ngwr-spinner.mjs +12 -3
  225. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  226. package/fesm2022/ngwr-splash-cursor.mjs +2 -2
  227. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  228. package/fesm2022/ngwr-split-text.mjs +2 -2
  229. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  230. package/fesm2022/ngwr-splitter.mjs +70 -9
  231. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  232. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  233. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  234. package/fesm2022/ngwr-star-border.mjs +2 -2
  235. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  236. package/fesm2022/ngwr-statistic.mjs +24 -7
  237. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  238. package/fesm2022/ngwr-stepper-testing.mjs +477 -0
  239. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
  240. package/fesm2022/ngwr-switch-testing.mjs +77 -0
  241. package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
  242. package/fesm2022/ngwr-switch.mjs +9 -3
  243. package/fesm2022/ngwr-switch.mjs.map +1 -1
  244. package/fesm2022/ngwr-table-testing.mjs +580 -0
  245. package/fesm2022/ngwr-table-testing.mjs.map +1 -0
  246. package/fesm2022/ngwr-table.mjs +87 -14
  247. package/fesm2022/ngwr-table.mjs.map +1 -1
  248. package/fesm2022/ngwr-tabs-testing.mjs +617 -0
  249. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
  250. package/fesm2022/ngwr-tabs.mjs +38 -6
  251. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  252. package/fesm2022/ngwr-textarea-testing.mjs +238 -0
  253. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
  254. package/fesm2022/ngwr-textarea.mjs +32 -4
  255. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  256. package/fesm2022/ngwr-tilt-card.mjs +2 -2
  257. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  258. package/fesm2022/ngwr-toast-testing.mjs +101 -0
  259. package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
  260. package/fesm2022/ngwr-toast.mjs +2 -2
  261. package/fesm2022/ngwr-toast.mjs.map +1 -1
  262. package/fesm2022/ngwr-tour.mjs +61 -9
  263. package/fesm2022/ngwr-tour.mjs.map +1 -1
  264. package/fesm2022/ngwr-transfer-testing.mjs +538 -0
  265. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
  266. package/fesm2022/ngwr-transfer.mjs +45 -14
  267. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  268. package/fesm2022/ngwr-tree-testing.mjs +734 -0
  269. package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
  270. package/fesm2022/ngwr-tree.mjs +73 -7
  271. package/fesm2022/ngwr-tree.mjs.map +1 -1
  272. package/fesm2022/ngwr-typewriter.mjs +5 -3
  273. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  274. package/fesm2022/ngwr-version.mjs +1 -1
  275. package/fesm2022/ngwr-version.mjs.map +1 -1
  276. package/fesm2022/ngwr-virtual-scroll.mjs +31 -5
  277. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  278. package/fesm2022/ngwr-waves.mjs +3 -3
  279. package/fesm2022/ngwr-waves.mjs.map +1 -1
  280. package/fesm2022/ngwr-window.mjs +8 -0
  281. package/fesm2022/ngwr-window.mjs.map +1 -1
  282. package/file-upload/styles/_index.scss +7 -2
  283. package/gauge/styles/_index.scss +1 -1
  284. package/glitch-text/styles/_index.scss +4 -0
  285. package/i18n/en.json +48 -0
  286. package/i18n/ru.json +48 -0
  287. package/image-cropper/styles/_index.scss +13 -1
  288. package/input/styles/_index.scss +2 -2
  289. package/input-number/styles/_index.scss +7 -2
  290. package/knob/styles/_index.scss +8 -1
  291. package/layout/styles/_index.scss +3 -3
  292. package/lightbox/styles/_index.scss +10 -2
  293. package/line-chart/styles/_index.scss +6 -0
  294. package/llms-full.txt +151 -4
  295. package/llms.txt +57 -8
  296. package/loading-bar/styles/_index.scss +1 -2
  297. package/markdown/styles/_index.scss +296 -0
  298. package/marquee/styles/_index.scss +12 -0
  299. package/mcp/api.js +512 -0
  300. package/mcp/catalog.js +157 -0
  301. package/mcp/server.js +273 -0
  302. package/mcp/tools.js +366 -0
  303. package/meter-group/styles/_index.scss +1 -1
  304. package/package.json +186 -35
  305. package/pagination/styles/_index.scss +6 -6
  306. package/popover/styles/_index.scss +37 -5
  307. package/rating/styles/_index.scss +10 -0
  308. package/result/styles/_index.scss +3 -1
  309. package/schematics/use/symbol-map.json +2 -0
  310. package/segmented/styles/_index.scss +12 -1
  311. package/select/styles/_index.scss +32 -10
  312. package/sidebar/styles/_index.scss +30 -5
  313. package/slider/styles/_index.scss +15 -0
  314. package/speed-dial/styles/_index.scss +20 -0
  315. package/split-text/styles/_index.scss +13 -0
  316. package/star-border/styles/_index.scss +2 -0
  317. package/stepper/styles/_index.scss +19 -3
  318. package/styles/_grid.scss +4 -4
  319. package/styles.scss +1 -0
  320. package/switch/styles/_index.scss +5 -3
  321. package/table/styles/_index.scss +25 -12
  322. package/tabs/styles/_index.scss +11 -1
  323. package/textarea/styles/_index.scss +5 -0
  324. package/theme/styles/_colors.scss +44 -15
  325. package/theme/styles/_dark.scss +35 -15
  326. package/theme/styles/_mixins.scss +3 -0
  327. package/timeline/styles/_index.scss +2 -2
  328. package/toast/styles/_index.scss +17 -8
  329. package/toolbar/styles/_index.scss +3 -3
  330. package/tour/styles/_index.scss +7 -1
  331. package/tree/styles/_index.scss +9 -5
  332. package/types/ngwr-action-sheet.d.ts +9 -1
  333. package/types/ngwr-affix.d.ts +7 -1
  334. package/types/ngwr-anchor.d.ts +8 -1
  335. package/types/ngwr-avatar.d.ts +13 -3
  336. package/types/ngwr-bar-chart.d.ts +16 -0
  337. package/types/ngwr-burger.d.ts +6 -2
  338. package/types/ngwr-button-testing.d.ts +85 -0
  339. package/types/ngwr-button.d.ts +26 -10
  340. package/types/ngwr-calendar-heatmap.d.ts +16 -2
  341. package/types/ngwr-calendar.d.ts +10 -0
  342. package/types/ngwr-carousel-testing.d.ts +257 -0
  343. package/types/ngwr-carousel.d.ts +20 -4
  344. package/types/ngwr-cascader-testing.d.ts +392 -0
  345. package/types/ngwr-checkbox-testing.d.ts +77 -0
  346. package/types/ngwr-checkbox.d.ts +7 -2
  347. package/types/ngwr-collapse-testing.d.ts +290 -0
  348. package/types/ngwr-color-picker.d.ts +20 -11
  349. package/types/ngwr-command-palette-testing.d.ts +437 -0
  350. package/types/ngwr-command-palette.d.ts +25 -2
  351. package/types/ngwr-compare.d.ts +50 -2
  352. package/types/ngwr-config.d.ts +176 -0
  353. package/types/ngwr-context-menu-testing.d.ts +401 -0
  354. package/types/ngwr-context-menu.d.ts +65 -17
  355. package/types/ngwr-counter.d.ts +6 -1
  356. package/types/ngwr-date-adapter-luxon.d.ts +26 -0
  357. package/types/ngwr-date-picker-testing.d.ts +518 -0
  358. package/types/ngwr-date-picker.d.ts +4 -0
  359. package/types/ngwr-dialog-testing.d.ts +79 -0
  360. package/types/ngwr-directives.d.ts +10 -1
  361. package/types/ngwr-donut-chart.d.ts +8 -1
  362. package/types/ngwr-drawer-testing.d.ts +196 -0
  363. package/types/ngwr-dropdown-testing.d.ts +202 -0
  364. package/types/ngwr-dropdown.d.ts +7 -1
  365. package/types/ngwr-empty.d.ts +19 -4
  366. package/types/ngwr-event-calendar.d.ts +26 -1
  367. package/types/ngwr-file-upload-testing.d.ts +194 -0
  368. package/types/ngwr-form-testing.d.ts +379 -0
  369. package/types/ngwr-form.d.ts +17 -0
  370. package/types/ngwr-gauge.d.ts +13 -1
  371. package/types/ngwr-image-cropper.d.ts +10 -0
  372. package/types/ngwr-input-number-testing.d.ts +226 -0
  373. package/types/ngwr-input-number.d.ts +29 -1
  374. package/types/ngwr-input-otp-testing.d.ts +299 -0
  375. package/types/ngwr-input-otp.d.ts +23 -2
  376. package/types/ngwr-input-testing.d.ts +84 -0
  377. package/types/ngwr-input.d.ts +20 -6
  378. package/types/ngwr-knob.d.ts +18 -0
  379. package/types/ngwr-layout.d.ts +1 -0
  380. package/types/ngwr-lightbox.d.ts +17 -3
  381. package/types/ngwr-line-chart.d.ts +9 -2
  382. package/types/ngwr-markdown-testing.d.ts +462 -0
  383. package/types/ngwr-markdown.d.ts +534 -0
  384. package/types/ngwr-marquee.d.ts +12 -2
  385. package/types/ngwr-mention-testing.d.ts +359 -0
  386. package/types/ngwr-meta.d.ts +4 -2
  387. package/types/ngwr-meter-group.d.ts +11 -1
  388. package/types/ngwr-overlay.d.ts +33 -2
  389. package/types/ngwr-pagination-testing.d.ts +291 -0
  390. package/types/ngwr-pagination.d.ts +1 -0
  391. package/types/ngwr-popconfirm-testing.d.ts +235 -0
  392. package/types/ngwr-popconfirm.d.ts +31 -21
  393. package/types/ngwr-popover-testing.d.ts +221 -0
  394. package/types/ngwr-popover.d.ts +9 -0
  395. package/types/ngwr-pull-to-refresh.d.ts +7 -0
  396. package/types/ngwr-qr.d.ts +9 -1
  397. package/types/ngwr-radio-testing.d.ts +296 -0
  398. package/types/ngwr-radio.d.ts +8 -2
  399. package/types/ngwr-rating-testing.d.ts +291 -0
  400. package/types/ngwr-rating.d.ts +23 -0
  401. package/types/ngwr-segmented-testing.d.ts +401 -0
  402. package/types/ngwr-select-testing.d.ts +175 -0
  403. package/types/ngwr-select.d.ts +45 -4
  404. package/types/ngwr-sidebar.d.ts +17 -2
  405. package/types/ngwr-slider-testing.d.ts +329 -0
  406. package/types/ngwr-slider.d.ts +35 -1
  407. package/types/ngwr-sparkline.d.ts +12 -2
  408. package/types/ngwr-speed-dial.d.ts +17 -18
  409. package/types/ngwr-spinner.d.ts +8 -1
  410. package/types/ngwr-splitter.d.ts +24 -1
  411. package/types/ngwr-statistic.d.ts +12 -2
  412. package/types/ngwr-stepper-testing.d.ts +346 -0
  413. package/types/ngwr-switch-testing.d.ts +66 -0
  414. package/types/ngwr-switch.d.ts +7 -2
  415. package/types/ngwr-table-testing.d.ts +423 -0
  416. package/types/ngwr-table.d.ts +42 -0
  417. package/types/ngwr-tabs-testing.d.ts +470 -0
  418. package/types/ngwr-tabs.d.ts +9 -0
  419. package/types/ngwr-textarea-testing.d.ts +184 -0
  420. package/types/ngwr-textarea.d.ts +7 -2
  421. package/types/ngwr-toast-testing.d.ts +80 -0
  422. package/types/ngwr-tour.d.ts +27 -0
  423. package/types/ngwr-transfer-testing.d.ts +444 -0
  424. package/types/ngwr-transfer.d.ts +16 -1
  425. package/types/ngwr-tree-testing.d.ts +501 -0
  426. package/types/ngwr-tree.d.ts +33 -0
  427. package/types/ngwr-version.d.ts +1 -1
  428. package/types/ngwr-virtual-scroll.d.ts +13 -1
  429. package/typewriter/styles/_index.scss +1 -1
  430. package/typography/styles/_index.scss +1 -1
  431. package/window/styles/_index.scss +32 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-pagination.mjs","sources":["../../../projects/lib/pagination/pagination.ts","../../../projects/lib/pagination/pagination.html","../../../projects/lib/pagination/ngwr-pagination.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 { Component, ViewEncapsulation, computed, input, model } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrPaginationAlign, WrPaginationShape, WrPaginationSize } from './interfaces';\n\nconst ELLIPSIS = '…' as const;\ntype PageEntry = number | typeof ELLIPSIS;\n\n/**\n * Numbered page navigator with optional total / page-size controls.\n *\n * Two-way binds `currentPage` and `pageSize` via signal `model()` inputs.\n *\n * @example\n * ```html\n * <wr-pagination\n * [total]=\"120\"\n * [(currentPage)]=\"page\"\n * [(pageSize)]=\"size\"\n * showTotal\n * showSizeChanger\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/pagination\n */\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()', role: 'navigation', '[attr.aria-label]': 'navLabel()' },\n imports: [WrButton, WrSelect, WrOption],\n})\nexport class WrPagination {\n /** Currently displayed page (1-based). Two-way bindable. */\n readonly currentPage = model<number>(1);\n\n /** Items per page. Two-way bindable. */\n readonly pageSize = model<number>(10);\n\n /** Total item count across all pages. */\n readonly total = input(0, { transform: numAttr(0) });\n\n /** Options shown in the page-size dropdown. */\n readonly pageSizeOptions = input<readonly number[]>([10, 20, 50, 100]);\n\n /** Render the page-size dropdown. @default false */\n readonly showSizeChanger = input(false, { transform: coerceBooleanProperty });\n\n /** Render the \"X–Y of Z\" total label. @default false */\n readonly showTotal = input(false, { transform: coerceBooleanProperty });\n\n /** Horizontal alignment. @default 'start' */\n readonly align = input<WrPaginationAlign>('start');\n\n /** Size variant — cascades to every internal button. @default 'sm' */\n readonly size = input<WrPaginationSize>('sm');\n\n /** Cell corner treatment. @default 'rounded' */\n readonly shape = input<WrPaginationShape>('rounded');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Collapse to a compact `‹ page / total ›` pager when the control's own box\n * is too narrow for the full numbered strip (a container query on its own\n * width, not the viewport). @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Localised text between range and total (\"X–Y of Z\"). Falls back to `pagination.of` then `'of'`. */\n readonly ofLabel = input<string | null>(null);\n\n /** Previous-page button aria-label. Falls back to `pagination.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Next-page button aria-label. Falls back to `pagination.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** \"Items per page\" label. Falls back to `pagination.itemsPerPage`. */\n readonly itemsPerPageLabel = input<string | null>(null);\n\n /** Accessible name for the `role=\"navigation\"` host. Falls back to `pagination.label`. */\n readonly label = input<string | null>(null);\n\n /** Resolved labels. */\n protected readonly resolvedOf = useI18nText(this.ofLabel, 'pagination.of', 'of');\n protected readonly resolvedPrev = useI18nText(this.prevLabel, 'pagination.prev', 'Previous page');\n protected readonly resolvedNext = useI18nText(this.nextLabel, 'pagination.next', 'Next page');\n protected readonly resolvedItemsPerPage = useI18nText(\n this.itemsPerPageLabel,\n 'pagination.itemsPerPage',\n 'Items per page'\n );\n\n /**\n * Page-size option text — interpolates `{{size}}`. Was the template literal\n * `{{ option }} / page`, which no catalog could reach, so a Russian UI read\n * \"25 / page\".\n */\n protected readonly perPage = useI18nFormatter('pagination.perPage', '{{size}} / page');\n\n /** Per-page-button aria-label — interpolates `{{page}}`. */\n protected readonly goToPage = useI18nFormatter('pagination.goToPage', 'Go to page {{page}}');\n\n /** The nav landmark's own accessible name — was a hardcoded English literal. */\n protected readonly navLabel = useI18nText(this.label, 'pagination.label', 'Pagination');\n\n /** Internal: total page count. */\n protected readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.pageSize())));\n\n /** Internal: \"X–Y of Z\" string. */\n protected readonly rangeLabel = computed(() => {\n const start = this.total() === 0 ? 0 : (this.currentPage() - 1) * this.pageSize() + 1;\n const end = Math.min(this.currentPage() * this.pageSize(), this.total());\n return `${start}-${end} ${this.resolvedOf()} ${this.total()}`;\n });\n\n /**\n * Internal: page list with ellipses. Window of 7 visible page slots.\n *\n * 1 … 5 6 [7] 8 9 … 20\n */\n protected readonly pages = computed<readonly PageEntry[]>(() => {\n const total = this.totalPages();\n const current = this.currentPage();\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const items: PageEntry[] = [1];\n if (current > 4) items.push(ELLIPSIS);\n\n let start: number;\n let end: number;\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 3) items.push(ELLIPSIS);\n if (end !== total) items.push(total);\n\n return items;\n });\n\n protected readonly ellipsis = ELLIPSIS;\n\n protected readonly classes = computed(() => {\n const parts = [\n 'wr-pagination',\n `wr-pagination--${this.align()}`,\n `wr-pagination--${this.size()}`,\n `wr-pagination--${this.shape()}`,\n ];\n if (this.disabled()) parts.push('wr-pagination--disabled');\n if (this.responsive()) parts.push('wr-pagination--responsive');\n return parts.join(' ');\n });\n\n protected isCurrent(page: number): boolean {\n return this.currentPage() === page;\n }\n\n protected goTo(page: number | typeof ELLIPSIS): void {\n if (typeof page !== 'number') return;\n if (this.disabled() || page < 1 || page > this.totalPages() || page === this.currentPage()) return;\n this.currentPage.set(page);\n }\n\n /**\n * `wr-select` carries an `unknown` value by design, so the size arrives\n * untyped and is narrowed here. It used to arrive as `any` through\n * `[ngModel]`, which hid the coercion rather than removing the need for it.\n */\n protected onSizeChange(size: unknown): void {\n const next = Number(size);\n if (this.disabled() || !Number.isFinite(next) || next <= 0 || next === this.pageSize()) return;\n this.pageSize.set(next);\n const cap = Math.max(1, Math.ceil(this.total() / next));\n if (this.currentPage() > cap) this.currentPage.set(cap);\n }\n}\n","<div class=\"wr-pagination__inner\">\n @if (showTotal()) {\n <span class=\"wr-pagination__total\">{{ rangeLabel() }}</span>\n }\n\n <div class=\"wr-pagination__nav\">\n <wr-btn\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedPrev()\"\n [disabled]=\"disabled() || currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n </wr-btn>\n\n @for (page of pages(); track $index) {\n @if (page === ellipsis) {\n <span class=\"wr-pagination__ellipsis\">{{ ellipsis }}</span>\n } @else {\n <wr-btn\n class=\"wr-pagination__page\"\n [size]=\"size()\"\n [outlined]=\"!isCurrent(page)\"\n [color]=\"isCurrent(page) ? 'primary' : null\"\n [attr.aria-current]=\"isCurrent(page) ? 'page' : null\"\n [attr.aria-label]=\"goToPage({ page })\"\n [disabled]=\"disabled()\"\n (click)=\"goTo(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <!-- Compact pager — shown only in responsive mode on a narrow box (CSS). -->\n <span class=\"wr-pagination__current\" aria-hidden=\"true\">{{ currentPage() }} / {{ totalPages() }}</span>\n\n <wr-btn\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedNext()\"\n [disabled]=\"disabled() || currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <wr-select\n class=\"wr-pagination__size\"\n [attr.aria-label]=\"resolvedItemsPerPage()\"\n [disabled]=\"disabled()\"\n [value]=\"pageSize()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\">{{ perPage({ size: option }) }}</wr-option>\n }\n </wr-select>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAYH,MAAM,QAAQ,GAAG,GAAY;AAG7B;;;;;;;;;;;;;;;;;AAiBG;MAQU,YAAY,CAAA;;IAEd,WAAW,GAAG,KAAK,CAAS,CAAC;oFAAC;;IAG9B,QAAQ,GAAG,KAAK,CAAS,EAAE;iFAAC;;AAG5B,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;IAG3C,eAAe,GAAG,KAAK,CAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;wFAAC;;IAG7D,eAAe,GA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2nFAyFA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED9CY,QAAQ,EAAA,QAAA,EAAA,mCAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,cAAA,EAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,uBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,QAAQ,miBAAE,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAE3B,YAAY,EAAA,UAAA,EAAA,CAAA;kBAPxB,SAAS;+BACE,eAAe,EAAA,aAAA,EAEV,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,EAAA,OAAA,EAC9E,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAA,QAAA,EAAA,2nFAAA,EAAA;;;AE3CzC;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-pagination.mjs","sources":["../../../projects/lib/pagination/pagination.ts","../../../projects/lib/pagination/pagination.html","../../../projects/lib/pagination/ngwr-pagination.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 { Component, ViewEncapsulation, computed, effect, input, model, untracked } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { numAttr } from 'ngwr/utils';\n\nimport type { WrPaginationAlign, WrPaginationShape, WrPaginationSize } from './interfaces';\n\nconst ELLIPSIS = '…' as const;\ntype PageEntry = number | typeof ELLIPSIS;\n\n/**\n * Numbered page navigator with optional total / page-size controls.\n *\n * Two-way binds `currentPage` and `pageSize` via signal `model()` inputs.\n *\n * @example\n * ```html\n * <wr-pagination\n * [total]=\"120\"\n * [(currentPage)]=\"page\"\n * [(pageSize)]=\"size\"\n * showTotal\n * showSizeChanger\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/pagination\n */\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()', role: 'navigation', '[attr.aria-label]': 'navLabel()' },\n imports: [WrButton, WrSelect, WrOption],\n})\nexport class WrPagination {\n /** Currently displayed page (1-based). Two-way bindable. */\n readonly currentPage = model<number>(1);\n\n /** Items per page. Two-way bindable. */\n readonly pageSize = model<number>(10);\n\n /** Total item count across all pages. */\n readonly total = input(0, { transform: numAttr(0) });\n\n /** Options shown in the page-size dropdown. */\n readonly pageSizeOptions = input<readonly number[]>([10, 20, 50, 100]);\n\n /** Render the page-size dropdown. @default false */\n readonly showSizeChanger = input(false, { transform: coerceBooleanProperty });\n\n /** Render the \"X–Y of Z\" total label. @default false */\n readonly showTotal = input(false, { transform: coerceBooleanProperty });\n\n /** Horizontal alignment. @default 'start' */\n readonly align = input<WrPaginationAlign>('start');\n\n /** Size variant — cascades to every internal button. @default 'sm' */\n readonly size = input<WrPaginationSize>('sm');\n\n /** Cell corner treatment. @default 'rounded' */\n readonly shape = input<WrPaginationShape>('rounded');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Collapse to a compact `‹ page / total ›` pager when the control's own box\n * is too narrow for the full numbered strip (a container query on its own\n * width, not the viewport). @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Localised text between range and total (\"X–Y of Z\"). Falls back to `pagination.of` then `'of'`. */\n readonly ofLabel = input<string | null>(null);\n\n /** Previous-page button aria-label. Falls back to `pagination.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Next-page button aria-label. Falls back to `pagination.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** \"Items per page\" label. Falls back to `pagination.itemsPerPage`. */\n readonly itemsPerPageLabel = input<string | null>(null);\n\n /** Accessible name for the `role=\"navigation\"` host. Falls back to `pagination.label`. */\n readonly label = input<string | null>(null);\n\n /** Resolved labels. */\n protected readonly resolvedOf = useI18nText(this.ofLabel, 'pagination.of', 'of');\n protected readonly resolvedPrev = useI18nText(this.prevLabel, 'pagination.prev', 'Previous page');\n protected readonly resolvedNext = useI18nText(this.nextLabel, 'pagination.next', 'Next page');\n protected readonly resolvedItemsPerPage = useI18nText(\n this.itemsPerPageLabel,\n 'pagination.itemsPerPage',\n 'Items per page'\n );\n\n /**\n * Page-size option text — interpolates `{{size}}`. Was the template literal\n * `{{ option }} / page`, which no catalog could reach, so a Russian UI read\n * \"25 / page\".\n */\n protected readonly perPage = useI18nFormatter('pagination.perPage', '{{size}} / page');\n\n /** Per-page-button aria-label — interpolates `{{page}}`. */\n protected readonly goToPage = useI18nFormatter('pagination.goToPage', 'Go to page {{page}}');\n\n /** The nav landmark's own accessible name — was a hardcoded English literal. */\n protected readonly navLabel = useI18nText(this.label, 'pagination.label', 'Pagination');\n\n /** Internal: total page count. */\n protected readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.pageSize())));\n\n /** Internal: \"X–Y of Z\" string. */\n protected readonly rangeLabel = computed(() => {\n const start = this.total() === 0 ? 0 : (this.currentPage() - 1) * this.pageSize() + 1;\n const end = Math.min(this.currentPage() * this.pageSize(), this.total());\n return `${start}-${end} ${this.resolvedOf()} ${this.total()}`;\n });\n\n /**\n * Internal: page list with ellipses. Window of 7 visible page slots.\n *\n * 1 … 5 6 [7] 8 9 … 20\n */\n protected readonly pages = computed<readonly PageEntry[]>(() => {\n const total = this.totalPages();\n const current = this.currentPage();\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const items: PageEntry[] = [1];\n if (current > 4) items.push(ELLIPSIS);\n\n let start: number;\n let end: number;\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 3) items.push(ELLIPSIS);\n if (end !== total) items.push(total);\n\n return items;\n });\n\n protected readonly ellipsis = ELLIPSIS;\n\n protected readonly classes = computed(() => {\n const parts = [\n 'wr-pagination',\n `wr-pagination--${this.align()}`,\n `wr-pagination--${this.size()}`,\n `wr-pagination--${this.shape()}`,\n ];\n if (this.disabled()) parts.push('wr-pagination--disabled');\n if (this.responsive()) parts.push('wr-pagination--responsive');\n return parts.join(' ');\n });\n\n protected isCurrent(page: number): boolean {\n return this.currentPage() === page;\n }\n\n protected goTo(page: number | typeof ELLIPSIS): void {\n if (typeof page !== 'number') return;\n if (this.disabled() || page < 1 || page > this.totalPages() || page === this.currentPage()) return;\n this.currentPage.set(page);\n }\n\n /**\n * `wr-select` carries an `unknown` value by design, so the size arrives\n * untyped and is narrowed here. It used to arrive as `any` through\n * `[ngModel]`, which hid the coercion rather than removing the need for it.\n */\n constructor() {\n // A shrinking `total` must not leave the pager on a page that no longer\n // exists: it only ever pulled back when the SIZE changed through its own\n // control, so a filtered list left \"page 7 of 2\" pointing at nothing.\n effect(() => {\n const cap = this.totalPages();\n untracked(() => {\n if (this.currentPage() > cap) this.currentPage.set(cap);\n });\n });\n }\n\n protected onSizeChange(size: unknown): void {\n const next = Number(size);\n if (this.disabled() || !Number.isFinite(next) || next <= 0 || next === this.pageSize()) return;\n this.pageSize.set(next);\n const cap = Math.max(1, Math.ceil(this.total() / next));\n if (this.currentPage() > cap) this.currentPage.set(cap);\n }\n}\n","<div class=\"wr-pagination__inner\">\n @if (showTotal()) {\n <span class=\"wr-pagination__total\">{{ rangeLabel() }}</span>\n }\n\n <div class=\"wr-pagination__nav\">\n <wr-btn\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedPrev()\"\n [disabled]=\"disabled() || currentPage() === 1\"\n (click)=\"goTo(currentPage() - 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n </wr-btn>\n\n @for (page of pages(); track $index) {\n @if (page === ellipsis) {\n <span class=\"wr-pagination__ellipsis\">{{ ellipsis }}</span>\n } @else {\n <wr-btn\n class=\"wr-pagination__page\"\n [size]=\"size()\"\n [outlined]=\"!isCurrent(page)\"\n [color]=\"isCurrent(page) ? 'primary' : null\"\n [attr.aria-current]=\"isCurrent(page) ? 'page' : null\"\n [attr.aria-label]=\"goToPage({ page })\"\n [disabled]=\"disabled()\"\n (click)=\"goTo(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <!-- Compact pager — shown only in responsive mode on a narrow box (CSS). -->\n <span class=\"wr-pagination__current\" aria-hidden=\"true\">{{ currentPage() }} / {{ totalPages() }}</span>\n\n <wr-btn\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedNext()\"\n [disabled]=\"disabled() || currentPage() === totalPages()\"\n (click)=\"goTo(currentPage() + 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <wr-select\n class=\"wr-pagination__size\"\n [attr.aria-label]=\"resolvedItemsPerPage()\"\n [disabled]=\"disabled()\"\n [value]=\"pageSize()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\">{{ perPage({ size: option }) }}</wr-option>\n }\n </wr-select>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAYH,MAAM,QAAQ,GAAG,GAAY;AAG7B;;;;;;;;;;;;;;;;;AAiBG;MAQU,YAAY,CAAA;;IAEd,WAAW,GAAG,KAAK,CAAS,CAAC;oFAAC;;IAG9B,QAAQ,GAAG,KAAK,CAAS,EAAE;iFAAC;;AAG5B,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;IAG3C,eAAe,GAAG,KAAK,CAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;wFAAC;;IAG7D,eAAe,GAAG,KAAK,CAAC,KAAK,uFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAGpE,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG9D,KAAK,GAAG,KAAK,CAAoB,OAAO;8EAAC;;IAGzC,IAAI,GAAG,KAAK,CAAmB,IAAI;6EAAC;;IAGpC,KAAK,GAAG,KAAK,CAAoB,SAAS;8EAAC;;IAG3C,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAEtE;;;;AAIG;IACM,UAAU,GAAG,KAAK,CAAC,KAAK,kFAAI,SAAS,EAAE,qBAAqB,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EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,cAAA,EAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,uBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,QAAQ,miBAAE,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAE3B,YAAY,EAAA,UAAA,EAAA,CAAA;kBAPxB,SAAS;+BACE,eAAe,EAAA,aAAA,EAEV,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,EAAA,OAAA,EAC9E,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAA,QAAA,EAAA,2nFAAA,EAAA;;;AE3CzC;;AAEG;;;;"}
@@ -0,0 +1,309 @@
1
+ import { ContentContainerComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
2
+ import { WR_COLORS } from 'ngwr/theme';
3
+
4
+ /**
5
+ * @license
6
+ *
7
+ * Use of this source code is governed by an MIT-style license that can be
8
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
9
+ */
10
+ /**
11
+ * Test harness for `[wrPopconfirm]` — the "are you sure?" dialog anchored to its
12
+ * trigger.
13
+ *
14
+ * The panel is NOT inside the trigger: it is a component portal in the overlay
15
+ * container, a sibling of the whole app. So everything about it is reached
16
+ * through the document root, scoped by the `aria-controls` id the trigger
17
+ * publishes while the dialog is showing — which is what keeps two popconfirms
18
+ * from reading each other's question, and why every panel reader throws while the
19
+ * dialog is shut: there is no element to answer about.
20
+ *
21
+ * **The two actions are told apart by their own modifiers**, never by position.
22
+ * `.wr-popconfirm__action--cancel` and `--confirm` are what `cancel()` and
23
+ * `confirm()` click, so a template that ever reorders the pair cannot silently
24
+ * turn a spec's "cancel" into a delete.
25
+ *
26
+ * Being a CONTENT CONTAINER means a consumer's own harnesses resolve INSIDE this
27
+ * instance's panel — `popconfirm.getHarness(WrButtonHarness…)` reaches the
28
+ * buttons without the spec ever naming the overlay.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const loader = TestbedHarnessEnvironment.loader(fixture);
33
+ * const remove = await loader.getHarness(WrPopconfirmHarness.with({ triggerText: 'Delete' }));
34
+ *
35
+ * await remove.open();
36
+ * expect(await remove.getMessage()).toBe('Delete this item?');
37
+ * await remove.confirm();
38
+ * ```
39
+ *
40
+ * @see https://ngwr.dev/guides/testing
41
+ */
42
+ class WrPopconfirmHarness extends ContentContainerComponentHarness {
43
+ /**
44
+ * The directive's host — whatever element the consumer put `[wrPopconfirm]` on.
45
+ *
46
+ * Matched by the marker class, not by `[wrPopconfirm]`: the question is normally
47
+ * BOUND (`[wrPopconfirm]="question"`), and a property binding leaves no
48
+ * attribute in the DOM at all. Same shape as `.wr-popover-trigger` and
49
+ * `.wr-dropdown-trigger`.
50
+ */
51
+ static hostSelector = '.wr-popconfirm-trigger';
52
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
53
+ static with(options = {}) {
54
+ return new HarnessPredicate(WrPopconfirmHarness, options)
55
+ .addOption('triggerText', options.triggerText, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text))
56
+ .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);
57
+ }
58
+ /** The trigger's own visible label. The question inside the panel is `getMessage()`. */
59
+ async getTriggerText() {
60
+ return (await this.host()).text();
61
+ }
62
+ /**
63
+ * Whether the dialog is showing.
64
+ *
65
+ * Read from `aria-expanded` rather than from a class, because that is the whole
66
+ * of what the trigger tells a screen reader — the directive puts no state class
67
+ * on its host at all.
68
+ */
69
+ async isOpen() {
70
+ return (await (await this.host()).getAttribute('aria-expanded')) === 'true';
71
+ }
72
+ /** Whether the trigger currently has keyboard focus — the state it is handed back on close. */
73
+ async isTriggerFocused() {
74
+ return (await this.host()).isFocused();
75
+ }
76
+ /**
77
+ * Press the trigger to open the dialog.
78
+ *
79
+ * Throws when nothing opens, because the reason is always worth failing on: a
80
+ * native `<button disabled>` trigger never receives the click at all. (A
81
+ * DISABLED `<wr-btn>` is a jsdom blind spot in the other direction — it is kept
82
+ * inert by `pointer-events: none`, which jsdom does not apply, so it opens here
83
+ * and would not in a browser.)
84
+ */
85
+ async open() {
86
+ if (await this.isOpen())
87
+ return;
88
+ await (await this.host()).click();
89
+ if (await this.isOpen())
90
+ return;
91
+ throw new Error('WrPopconfirmHarness.open(): the dialog did not open. A disabled trigger takes no click — assert ' +
92
+ 'the disabled state instead of trying to open it.');
93
+ }
94
+ /**
95
+ * Press the trigger again to take the question back.
96
+ *
97
+ * This is the ONE way out that answers nothing: the directive treats a second
98
+ * press as withdrawing the question, so `cancelled` does NOT fire — unlike
99
+ * `cancel()`, `sendEscape()` and `clickOutside()`, which all emit it. Use this
100
+ * when a spec needs the panel gone without recording an answer.
101
+ */
102
+ async close() {
103
+ if (!(await this.isOpen()))
104
+ return;
105
+ await (await this.host()).click();
106
+ if (!(await this.isOpen()))
107
+ return;
108
+ throw new Error('WrPopconfirmHarness.close(): the dialog is still open after a second press of the trigger.');
109
+ }
110
+ /** The question being asked. */
111
+ async getMessage() {
112
+ return (await this.inPanel('.wr-popconfirm__message')).text();
113
+ }
114
+ /**
115
+ * The confirm button's label.
116
+ *
117
+ * Resolved, not given: `confirmText` falls back to the `popconfirm.confirm`
118
+ * catalog entry, so a localized app reads its own word here and a spec that
119
+ * asserted the English default would be asserting the wrong thing.
120
+ */
121
+ async getConfirmText() {
122
+ return (await this.action('confirm')).text();
123
+ }
124
+ /** The cancel button's label — `cancelText`, or the `popconfirm.cancel` catalog entry. */
125
+ async getCancelText() {
126
+ return (await this.action('cancel')).text();
127
+ }
128
+ /**
129
+ * Both action labels in the order they are rendered: cancel first, confirm
130
+ * second.
131
+ *
132
+ * That order is deliberate and worth reading — the destructive choice is the one
133
+ * being confirmed, so the safe one comes first and takes the initial focus.
134
+ */
135
+ async getActionLabels() {
136
+ const actions = await this.allInPanel('.wr-popconfirm__action');
137
+ return Promise.all(actions.map(action => action.text()));
138
+ }
139
+ /**
140
+ * The confirm button's intent colour.
141
+ *
142
+ * Checked against `WR_COLORS` rather than pattern-matched out of the class list:
143
+ * `wr-btn--*` also spells the size, the shape and the icon position, so only the
144
+ * intent list can say which of them is a colour. Today `WrButton` happens to
145
+ * emit the colour first, so a first-match regex would agree — but that order is
146
+ * not a contract, and the same regex on a button with no colour answers `sm`.
147
+ * Never `null` in practice — `confirmColor` defaults to `primary` — but typed
148
+ * for it, since the button itself allows no colour at all.
149
+ */
150
+ async getConfirmColor() {
151
+ const classes = (await (await this.action('confirm')).getAttribute('class')) ?? '';
152
+ const present = classes.split(/\s+/);
153
+ return WR_COLORS.find(color => present.includes(`wr-btn--${color}`)) ?? null;
154
+ }
155
+ /** Which action holds keyboard focus, by label, or `null` when focus is elsewhere. */
156
+ async getFocusedActionLabel() {
157
+ for (const action of await this.allInPanel('.wr-popconfirm__action')) {
158
+ if (await action.isFocused())
159
+ return action.text();
160
+ }
161
+ return null;
162
+ }
163
+ /** Answer the question: click confirm, which emits `confirmed` and closes the dialog. */
164
+ async confirm() {
165
+ return (await this.action('confirm')).click();
166
+ }
167
+ /** Decline: click cancel, which emits `cancelled` and closes the dialog. */
168
+ async cancel() {
169
+ return (await this.action('cancel')).click();
170
+ }
171
+ /**
172
+ * Dismiss with Escape, which emits `cancelled`.
173
+ *
174
+ * Sent at the pane rather than at the focused button, because the target makes
175
+ * no difference: the key is picked up by the overlay's keyboard dispatcher,
176
+ * which keeps one listener on the document and routes to the topmost overlay.
177
+ * The pane is the one element guaranteed to be there.
178
+ */
179
+ async sendEscape() {
180
+ return (await this.pane()).sendKeys(TestKey.ESCAPE);
181
+ }
182
+ /**
183
+ * Dismiss by pressing outside the panel, which emits `cancelled`.
184
+ *
185
+ * The press lands on the overlay CONTAINER — an ancestor of the pane (the CDK
186
+ * puts a host `<div>` between the two), and so outside the panel by the only
187
+ * measure that matters here, since the dismissal is decided by whether the press
188
+ * started inside the pane. With two dialogs showing it dismisses BOTH: neither
189
+ * pane contains the container. jsdom has no layout
190
+ * and no `document.elementFromPoint`, so a harness cannot aim at "whatever is
191
+ * under the pointer"; to dismiss by pressing a specific element instead, click
192
+ * that element's own `TestElement`.
193
+ */
194
+ async clickOutside() {
195
+ const id = await this.panelId();
196
+ const container = await this.documentRootLocatorFactory().locatorFor('.cdk-overlay-container')();
197
+ await container.click();
198
+ if (!(await this.isOpen()))
199
+ return;
200
+ throw new Error(`WrPopconfirmHarness.clickOutside(): the dialog (#${id}) is still open. An outside press is judged ` +
201
+ 'by where it started, so a press that began inside the panel does not dismiss it.');
202
+ }
203
+ /**
204
+ * The role the open panel announces — `'dialog'`.
205
+ *
206
+ * Worth asserting rather than assuming: the directive sets it on the OVERLAY
207
+ * PANE, not on the panel component a consumer can see in the template.
208
+ */
209
+ async getRole() {
210
+ return (await this.pane()).getAttribute('role');
211
+ }
212
+ /**
213
+ * The dialog's accessible name — the `ariaLabel` input, or the catalog's
214
+ * `popconfirm.label`.
215
+ *
216
+ * A `role="dialog"` with no name announces as a bare "dialog" and trips axe's
217
+ * `aria-dialog-name`, which is why there is always one.
218
+ */
219
+ async getLabel() {
220
+ return (await this.pane()).getAttribute('aria-label');
221
+ }
222
+ /**
223
+ * Whether the dialog claims modality.
224
+ *
225
+ * `false`, deliberately, and worth pinning: focus is moved into the panel but
226
+ * NOT trapped, because Escape and an outside click both dismiss — trapping
227
+ * would only make it harder to leave.
228
+ */
229
+ async isModal() {
230
+ return (await (await this.pane()).getAttribute('aria-modal')) === 'true';
231
+ }
232
+ /**
233
+ * The text a screen reader reads as the dialog's DESCRIPTION, resolved through
234
+ * `aria-describedby` the way an assistive technology would.
235
+ *
236
+ * This is the question, and it is the entire content of a confirmation: without
237
+ * the link the dialog announces its name and then nothing at all.
238
+ */
239
+ async getDescriptionText() {
240
+ const id = await (await this.pane()).getAttribute('aria-describedby');
241
+ if (!id)
242
+ return null;
243
+ const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();
244
+ return described ? described.text() : null;
245
+ }
246
+ /**
247
+ * Which side of the trigger the panel is anchored to.
248
+ *
249
+ * The side that was ASKED for, read off the pane's public modifier class —
250
+ * `position` is an input, so a bound one never reaches the DOM, and the panel's
251
+ * own offset is a CDK inline style that says nothing in a layout-less jsdom.
252
+ * Not where the panel ended up: the position strategy is flexible and pushes,
253
+ * so a panel with no room on that side moves without the class changing.
254
+ */
255
+ async getPosition() {
256
+ const classes = (await (await this.pane()).getAttribute('class')) ?? '';
257
+ const modifier = /wr-popconfirm-overlay--([a-z]+)/.exec(classes);
258
+ return modifier ? modifier[1] : null;
259
+ }
260
+ /**
261
+ * Harnesses for anything inside the panel resolve within THIS instance's dialog.
262
+ *
263
+ * Scoped by the published id rather than by `.wr-popconfirm`: the overlay
264
+ * container is shared, so a class query would answer with whichever popconfirm
265
+ * opened first.
266
+ */
267
+ async getRootHarnessLoader() {
268
+ return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);
269
+ }
270
+ /**
271
+ * One of the two action buttons.
272
+ *
273
+ * By its own modifier class, never by index: both are a `<wr-btn size="sm">`, so
274
+ * before the modifiers existed the only thing telling them apart was document
275
+ * order — and a harness that clicked "the second button" would go on passing
276
+ * while it started confirming what a spec meant to cancel.
277
+ */
278
+ async action(role) {
279
+ return this.inPanel(`.wr-popconfirm__action--${role}`);
280
+ }
281
+ /** One element inside THIS instance's panel. */
282
+ async inPanel(selector) {
283
+ return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()} ${selector}`)();
284
+ }
285
+ /** Every matching element inside THIS instance's panel, in document order. */
286
+ async allInPanel(selector) {
287
+ return this.documentRootLocatorFactory().locatorForAll(`#${await this.panelId()} ${selector}`)();
288
+ }
289
+ /** This instance's overlay pane — the element carrying the dialog semantics. */
290
+ async pane() {
291
+ return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();
292
+ }
293
+ /** The id the trigger publishes for its dialog, which exists only while the dialog does. */
294
+ async panelId() {
295
+ const id = await (await this.host()).getAttribute('aria-controls');
296
+ if (!id) {
297
+ throw new Error('WrPopconfirmHarness: nothing is showing. The trigger publishes its dialog id as aria-controls ' +
298
+ 'only while the dialog is open — call open() first.');
299
+ }
300
+ return id;
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Generated bundle index. Do not edit.
306
+ */
307
+
308
+ export { WrPopconfirmHarness };
309
+ //# sourceMappingURL=ngwr-popconfirm-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-popconfirm-testing.mjs","sources":["../../../projects/lib/popconfirm/testing/wr-popconfirm-harness.ts","../../../projects/lib/popconfirm/testing/ngwr-popconfirm-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrPopconfirmPosition } from 'ngwr/popconfirm';\nimport { WR_COLORS, type WrColor } from 'ngwr/theme';\n\nimport type { WrPopconfirmHarnessFilters } from './interfaces';\n\n/** The two answers a popconfirm offers, which are also its two action modifiers. */\ntype WrPopconfirmAction = 'confirm' | 'cancel';\n\n/**\n * Test harness for `[wrPopconfirm]` — the \"are you sure?\" dialog anchored to its\n * trigger.\n *\n * The panel is NOT inside the trigger: it is a component portal in the overlay\n * container, a sibling of the whole app. So everything about it is reached\n * through the document root, scoped by the `aria-controls` id the trigger\n * publishes while the dialog is showing — which is what keeps two popconfirms\n * from reading each other's question, and why every panel reader throws while the\n * dialog is shut: there is no element to answer about.\n *\n * **The two actions are told apart by their own modifiers**, never by position.\n * `.wr-popconfirm__action--cancel` and `--confirm` are what `cancel()` and\n * `confirm()` click, so a template that ever reorders the pair cannot silently\n * turn a spec's \"cancel\" into a delete.\n *\n * Being a CONTENT CONTAINER means a consumer's own harnesses resolve INSIDE this\n * instance's panel — `popconfirm.getHarness(WrButtonHarness…)` reaches the\n * buttons without the spec ever naming the overlay.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const remove = await loader.getHarness(WrPopconfirmHarness.with({ triggerText: 'Delete' }));\n *\n * await remove.open();\n * expect(await remove.getMessage()).toBe('Delete this item?');\n * await remove.confirm();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrPopconfirmHarness extends ContentContainerComponentHarness {\n /**\n * The directive's host — whatever element the consumer put `[wrPopconfirm]` on.\n *\n * Matched by the marker class, not by `[wrPopconfirm]`: the question is normally\n * BOUND (`[wrPopconfirm]=\"question\"`), and a property binding leaves no\n * attribute in the DOM at all. Same shape as `.wr-popover-trigger` and\n * `.wr-dropdown-trigger`.\n */\n static hostSelector = '.wr-popconfirm-trigger';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrPopconfirmHarnessFilters = {}): HarnessPredicate<WrPopconfirmHarness> {\n return new HarnessPredicate(WrPopconfirmHarness, options)\n .addOption('triggerText', options.triggerText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getTriggerText(), text)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /** The trigger's own visible label. The question inside the panel is `getMessage()`. */\n async getTriggerText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * Whether the dialog is showing.\n *\n * Read from `aria-expanded` rather than from a class, because that is the whole\n * of what the trigger tells a screen reader — the directive puts no state class\n * on its host at all.\n */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the trigger currently has keyboard focus — the state it is handed back on close. */\n async isTriggerFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Press the trigger to open the dialog.\n *\n * Throws when nothing opens, because the reason is always worth failing on: a\n * native `<button disabled>` trigger never receives the click at all. (A\n * DISABLED `<wr-btn>` is a jsdom blind spot in the other direction — it is kept\n * inert by `pointer-events: none`, which jsdom does not apply, so it opens here\n * and would not in a browser.)\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.host()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrPopconfirmHarness.open(): the dialog did not open. A disabled trigger takes no click — assert ' +\n 'the disabled state instead of trying to open it.'\n );\n }\n\n /**\n * Press the trigger again to take the question back.\n *\n * This is the ONE way out that answers nothing: the directive treats a second\n * press as withdrawing the question, so `cancelled` does NOT fire — unlike\n * `cancel()`, `sendEscape()` and `clickOutside()`, which all emit it. Use this\n * when a spec needs the panel gone without recording an answer.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.host()).click();\n if (!(await this.isOpen())) return;\n\n throw new Error('WrPopconfirmHarness.close(): the dialog is still open after a second press of the trigger.');\n }\n\n /** The question being asked. */\n async getMessage(): Promise<string> {\n return (await this.inPanel('.wr-popconfirm__message')).text();\n }\n\n /**\n * The confirm button's label.\n *\n * Resolved, not given: `confirmText` falls back to the `popconfirm.confirm`\n * catalog entry, so a localized app reads its own word here and a spec that\n * asserted the English default would be asserting the wrong thing.\n */\n async getConfirmText(): Promise<string> {\n return (await this.action('confirm')).text();\n }\n\n /** The cancel button's label — `cancelText`, or the `popconfirm.cancel` catalog entry. */\n async getCancelText(): Promise<string> {\n return (await this.action('cancel')).text();\n }\n\n /**\n * Both action labels in the order they are rendered: cancel first, confirm\n * second.\n *\n * That order is deliberate and worth reading — the destructive choice is the one\n * being confirmed, so the safe one comes first and takes the initial focus.\n */\n async getActionLabels(): Promise<string[]> {\n const actions = await this.allInPanel('.wr-popconfirm__action');\n return Promise.all(actions.map(action => action.text()));\n }\n\n /**\n * The confirm button's intent colour.\n *\n * Checked against `WR_COLORS` rather than pattern-matched out of the class list:\n * `wr-btn--*` also spells the size, the shape and the icon position, so only the\n * intent list can say which of them is a colour. Today `WrButton` happens to\n * emit the colour first, so a first-match regex would agree — but that order is\n * not a contract, and the same regex on a button with no colour answers `sm`.\n * Never `null` in practice — `confirmColor` defaults to `primary` — but typed\n * for it, since the button itself allows no colour at all.\n */\n async getConfirmColor(): Promise<WrColor | null> {\n const classes = (await (await this.action('confirm')).getAttribute('class')) ?? '';\n const present = classes.split(/\\s+/);\n return WR_COLORS.find(color => present.includes(`wr-btn--${color}`)) ?? null;\n }\n\n /** Which action holds keyboard focus, by label, or `null` when focus is elsewhere. */\n async getFocusedActionLabel(): Promise<string | null> {\n for (const action of await this.allInPanel('.wr-popconfirm__action')) {\n if (await action.isFocused()) return action.text();\n }\n return null;\n }\n\n /** Answer the question: click confirm, which emits `confirmed` and closes the dialog. */\n async confirm(): Promise<void> {\n return (await this.action('confirm')).click();\n }\n\n /** Decline: click cancel, which emits `cancelled` and closes the dialog. */\n async cancel(): Promise<void> {\n return (await this.action('cancel')).click();\n }\n\n /**\n * Dismiss with Escape, which emits `cancelled`.\n *\n * Sent at the pane rather than at the focused button, because the target makes\n * no difference: the key is picked up by the overlay's keyboard dispatcher,\n * which keeps one listener on the document and routes to the topmost overlay.\n * The pane is the one element guaranteed to be there.\n */\n async sendEscape(): Promise<void> {\n return (await this.pane()).sendKeys(TestKey.ESCAPE);\n }\n\n /**\n * Dismiss by pressing outside the panel, which emits `cancelled`.\n *\n * The press lands on the overlay CONTAINER — an ancestor of the pane (the CDK\n * puts a host `<div>` between the two), and so outside the panel by the only\n * measure that matters here, since the dismissal is decided by whether the press\n * started inside the pane. With two dialogs showing it dismisses BOTH: neither\n * pane contains the container. jsdom has no layout\n * and no `document.elementFromPoint`, so a harness cannot aim at \"whatever is\n * under the pointer\"; to dismiss by pressing a specific element instead, click\n * that element's own `TestElement`.\n */\n async clickOutside(): Promise<void> {\n const id = await this.panelId();\n const container = await this.documentRootLocatorFactory().locatorFor('.cdk-overlay-container')();\n\n await container.click();\n if (!(await this.isOpen())) return;\n\n throw new Error(\n `WrPopconfirmHarness.clickOutside(): the dialog (#${id}) is still open. An outside press is judged ` +\n 'by where it started, so a press that began inside the panel does not dismiss it.'\n );\n }\n\n /**\n * The role the open panel announces — `'dialog'`.\n *\n * Worth asserting rather than assuming: the directive sets it on the OVERLAY\n * PANE, not on the panel component a consumer can see in the template.\n */\n async getRole(): Promise<string | null> {\n return (await this.pane()).getAttribute('role');\n }\n\n /**\n * The dialog's accessible name — the `ariaLabel` input, or the catalog's\n * `popconfirm.label`.\n *\n * A `role=\"dialog\"` with no name announces as a bare \"dialog\" and trips axe's\n * `aria-dialog-name`, which is why there is always one.\n */\n async getLabel(): Promise<string | null> {\n return (await this.pane()).getAttribute('aria-label');\n }\n\n /**\n * Whether the dialog claims modality.\n *\n * `false`, deliberately, and worth pinning: focus is moved into the panel but\n * NOT trapped, because Escape and an outside click both dismiss — trapping\n * would only make it harder to leave.\n */\n async isModal(): Promise<boolean> {\n return (await (await this.pane()).getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * The text a screen reader reads as the dialog's DESCRIPTION, resolved through\n * `aria-describedby` the way an assistive technology would.\n *\n * This is the question, and it is the entire content of a confirmation: without\n * the link the dialog announces its name and then nothing at all.\n */\n async getDescriptionText(): Promise<string | null> {\n const id = await (await this.pane()).getAttribute('aria-describedby');\n if (!id) return null;\n\n const described = await this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();\n return described ? described.text() : null;\n }\n\n /**\n * Which side of the trigger the panel is anchored to.\n *\n * The side that was ASKED for, read off the pane's public modifier class —\n * `position` is an input, so a bound one never reaches the DOM, and the panel's\n * own offset is a CDK inline style that says nothing in a layout-less jsdom.\n * Not where the panel ended up: the position strategy is flexible and pushes,\n * so a panel with no room on that side moves without the class changing.\n */\n async getPosition(): Promise<WrPopconfirmPosition | null> {\n const classes = (await (await this.pane()).getAttribute('class')) ?? '';\n const modifier = /wr-popconfirm-overlay--([a-z]+)/.exec(classes);\n return modifier ? (modifier[1] as WrPopconfirmPosition) : null;\n }\n\n /**\n * Harnesses for anything inside the panel resolve within THIS instance's dialog.\n *\n * Scoped by the published id rather than by `.wr-popconfirm`: the overlay\n * container is shared, so a class query would answer with whichever popconfirm\n * opened first.\n */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /**\n * One of the two action buttons.\n *\n * By its own modifier class, never by index: both are a `<wr-btn size=\"sm\">`, so\n * before the modifiers existed the only thing telling them apart was document\n * order — and a harness that clicked \"the second button\" would go on passing\n * while it started confirming what a spec meant to cancel.\n */\n private async action(role: WrPopconfirmAction): Promise<TestElement> {\n return this.inPanel(`.wr-popconfirm__action--${role}`);\n }\n\n /** One element inside THIS instance's panel. */\n private async inPanel(selector: string): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()} ${selector}`)();\n }\n\n /** Every matching element inside THIS instance's panel, in document order. */\n private async allInPanel(selector: string): Promise<TestElement[]> {\n return this.documentRootLocatorFactory().locatorForAll(`#${await this.panelId()} ${selector}`)();\n }\n\n /** This instance's overlay pane — the element carrying the dialog semantics. */\n private async pane(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /** The id the trigger publishes for its dialog, which exists only while the dialog does. */\n private async panelId(): Promise<string> {\n const id = await (await this.host()).getAttribute('aria-controls');\n\n if (!id) {\n throw new Error(\n 'WrPopconfirmHarness: nothing is showing. The trigger publishes its dialog id as aria-controls ' +\n 'only while the dialog is open — call open() first.'\n );\n }\n return id;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;AAKG;AAkBH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACG,MAAO,mB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