ngwr 16.1.0 → 16.3.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 (412) hide show
  1. package/badge/styles/_tag.scss +73 -1
  2. package/calendar/styles/_index.scss +22 -0
  3. package/cascader/styles/_rules.scss +7 -0
  4. package/color-picker/styles/_index.scss +21 -0
  5. package/date-picker/styles/_index.scss +108 -1
  6. package/dropdown/styles/_index.scss +40 -10
  7. package/fesm2022/ngwr-affix.mjs +3 -3
  8. package/fesm2022/ngwr-alert-testing.mjs +70 -0
  9. package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
  10. package/fesm2022/ngwr-alert.mjs +3 -3
  11. package/fesm2022/ngwr-anchor.mjs +17 -6
  12. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  13. package/fesm2022/ngwr-animations-aurora.mjs +3 -3
  14. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  15. package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
  16. package/fesm2022/ngwr-animations-confetti.mjs +3 -3
  17. package/fesm2022/ngwr-animations-decode.mjs +3 -3
  18. package/fesm2022/ngwr-animations-destruct.mjs +3 -3
  19. package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
  20. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  21. package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
  22. package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
  23. package/fesm2022/ngwr-animations-glitch.mjs +3 -3
  24. package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
  25. package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
  26. package/fesm2022/ngwr-animations-marquee.mjs +3 -3
  27. package/fesm2022/ngwr-animations-orbit.mjs +3 -3
  28. package/fesm2022/ngwr-animations-reveal.mjs +3 -3
  29. package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
  30. package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
  31. package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
  32. package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
  33. package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
  34. package/fesm2022/ngwr-animations-tilt.mjs +3 -3
  35. package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
  36. package/fesm2022/ngwr-avatar.mjs +3 -3
  37. package/fesm2022/ngwr-back-top.mjs +3 -3
  38. package/fesm2022/ngwr-badge.mjs +129 -11
  39. package/fesm2022/ngwr-badge.mjs.map +1 -1
  40. package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
  41. package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
  42. package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
  43. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  44. package/fesm2022/ngwr-burger-testing.mjs +45 -0
  45. package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
  46. package/fesm2022/ngwr-burger.mjs +3 -3
  47. package/fesm2022/ngwr-button.mjs +6 -6
  48. package/fesm2022/ngwr-calendar-testing.mjs +18 -0
  49. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  50. package/fesm2022/ngwr-calendar.mjs +500 -73
  51. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  52. package/fesm2022/ngwr-card.mjs +9 -9
  53. package/fesm2022/ngwr-carousel.mjs +6 -6
  54. package/fesm2022/ngwr-cascader.mjs +37 -16
  55. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  56. package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
  57. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  58. package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
  59. package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
  60. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
  61. package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
  62. package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
  63. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  64. package/fesm2022/ngwr-charts-core.mjs +3 -3
  65. package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
  66. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  67. package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
  68. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  69. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  70. package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
  71. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
  73. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
  75. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
  77. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
  79. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
  81. package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
  82. package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
  83. package/fesm2022/ngwr-checkbox.mjs +6 -6
  84. package/fesm2022/ngwr-clipboard.mjs +3 -3
  85. package/fesm2022/ngwr-collapse.mjs +9 -9
  86. package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
  87. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  88. package/fesm2022/ngwr-color-picker.mjs +153 -37
  89. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  90. package/fesm2022/ngwr-command-palette.mjs +3 -3
  91. package/fesm2022/ngwr-comment.mjs +10 -6
  92. package/fesm2022/ngwr-comment.mjs.map +1 -1
  93. package/fesm2022/ngwr-compare-testing.mjs +84 -0
  94. package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
  95. package/fesm2022/ngwr-compare.mjs +3 -3
  96. package/fesm2022/ngwr-context-menu.mjs +12 -12
  97. package/fesm2022/ngwr-cookie.mjs +3 -3
  98. package/fesm2022/ngwr-copy-value.mjs +3 -3
  99. package/fesm2022/ngwr-counter.mjs +6 -6
  100. package/fesm2022/ngwr-date-picker-testing.mjs +48 -4
  101. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-date-picker.mjs +492 -75
  103. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
  105. package/fesm2022/ngwr-date-stamp.mjs +76 -12
  106. package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
  107. package/fesm2022/ngwr-date.mjs +144 -12
  108. package/fesm2022/ngwr-date.mjs.map +1 -1
  109. package/fesm2022/ngwr-density.mjs +6 -6
  110. package/fesm2022/ngwr-descriptions.mjs +6 -6
  111. package/fesm2022/ngwr-dialog.mjs +18 -18
  112. package/fesm2022/ngwr-directives.mjs +15 -15
  113. package/fesm2022/ngwr-divider.mjs +3 -3
  114. package/fesm2022/ngwr-drawer.mjs +51 -29
  115. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  116. package/fesm2022/ngwr-dropdown-testing.mjs +48 -5
  117. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  118. package/fesm2022/ngwr-dropdown.mjs +407 -116
  119. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  120. package/fesm2022/ngwr-editor.mjs +4 -3
  121. package/fesm2022/ngwr-editor.mjs.map +1 -1
  122. package/fesm2022/ngwr-empty.mjs +3 -3
  123. package/fesm2022/ngwr-event-calendar.mjs +186 -33
  124. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  125. package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
  126. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  127. package/fesm2022/ngwr-file-upload.mjs +274 -15
  128. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  129. package/fesm2022/ngwr-form.mjs +9 -9
  130. package/fesm2022/ngwr-form.mjs.map +1 -1
  131. package/fesm2022/ngwr-graph-testing.mjs +3 -0
  132. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  133. package/fesm2022/ngwr-graph.mjs +102 -42
  134. package/fesm2022/ngwr-graph.mjs.map +1 -1
  135. package/fesm2022/ngwr-hotkey.mjs +6 -6
  136. package/fesm2022/ngwr-i18n-ar.mjs +26 -6
  137. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-cs.mjs +26 -6
  139. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  140. package/fesm2022/ngwr-i18n-de.mjs +26 -6
  141. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  142. package/fesm2022/ngwr-i18n-en.mjs +26 -6
  143. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  144. package/fesm2022/ngwr-i18n-es.mjs +26 -6
  145. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  146. package/fesm2022/ngwr-i18n-fr.mjs +26 -6
  147. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-he.mjs +26 -6
  149. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-hi.mjs +26 -6
  151. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-id.mjs +26 -6
  153. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-it.mjs +26 -6
  155. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-ja.mjs +26 -6
  157. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-ko.mjs +26 -6
  159. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  160. package/fesm2022/ngwr-i18n-nl.mjs +26 -6
  161. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  162. package/fesm2022/ngwr-i18n-pl.mjs +26 -6
  163. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  164. package/fesm2022/ngwr-i18n-pt.mjs +26 -6
  165. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-ru.mjs +26 -6
  167. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-sv.mjs +26 -6
  169. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-tr.mjs +26 -6
  171. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-uk.mjs +26 -6
  173. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  174. package/fesm2022/ngwr-i18n-vi.mjs +26 -6
  175. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-zh-tw.mjs +26 -6
  177. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n-zh.mjs +26 -6
  179. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  180. package/fesm2022/ngwr-i18n.mjs +9 -9
  181. package/fesm2022/ngwr-icon.mjs +6 -6
  182. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  183. package/fesm2022/ngwr-input-number-testing.mjs +11 -0
  184. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  185. package/fesm2022/ngwr-input-number.mjs +68 -7
  186. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  187. package/fesm2022/ngwr-input-otp.mjs +23 -3
  188. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  189. package/fesm2022/ngwr-input-testing.mjs +24 -1
  190. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  191. package/fesm2022/ngwr-input.mjs +152 -36
  192. package/fesm2022/ngwr-input.mjs.map +1 -1
  193. package/fesm2022/ngwr-keyboard.mjs +3 -3
  194. package/fesm2022/ngwr-knob.mjs +3 -3
  195. package/fesm2022/ngwr-layout.mjs +15 -15
  196. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  197. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  198. package/fesm2022/ngwr-lightbox.mjs +249 -13
  199. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  200. package/fesm2022/ngwr-list.mjs +8 -8
  201. package/fesm2022/ngwr-list.mjs.map +1 -1
  202. package/fesm2022/ngwr-load-state.mjs +15 -15
  203. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  204. package/fesm2022/ngwr-mention.mjs +6 -6
  205. package/fesm2022/ngwr-meta.mjs +6 -6
  206. package/fesm2022/ngwr-overlay.mjs +175 -13
  207. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  208. package/fesm2022/ngwr-page-header.mjs +3 -3
  209. package/fesm2022/ngwr-pagination.mjs +5 -3
  210. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  211. package/fesm2022/ngwr-pipes.mjs +57 -33
  212. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  213. package/fesm2022/ngwr-platform.mjs +9 -9
  214. package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
  215. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  216. package/fesm2022/ngwr-popconfirm.mjs +44 -63
  217. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  218. package/fesm2022/ngwr-popover-testing.mjs +7 -1
  219. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  220. package/fesm2022/ngwr-popover.mjs +58 -156
  221. package/fesm2022/ngwr-popover.mjs.map +1 -1
  222. package/fesm2022/ngwr-progress.mjs +50 -9
  223. package/fesm2022/ngwr-progress.mjs.map +1 -1
  224. package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
  225. package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
  226. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  227. package/fesm2022/ngwr-qr.mjs +3 -3
  228. package/fesm2022/ngwr-radio.mjs +6 -6
  229. package/fesm2022/ngwr-rating.mjs +3 -3
  230. package/fesm2022/ngwr-resizable-testing.mjs +113 -0
  231. package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
  232. package/fesm2022/ngwr-resizable.mjs +3 -3
  233. package/fesm2022/ngwr-result.mjs +12 -12
  234. package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
  235. package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
  236. package/fesm2022/ngwr-schema-form.mjs +418 -19
  237. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  238. package/fesm2022/ngwr-scroll.mjs +3 -3
  239. package/fesm2022/ngwr-segmented.mjs +3 -3
  240. package/fesm2022/ngwr-select-testing.mjs +19 -0
  241. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  242. package/fesm2022/ngwr-select.mjs +263 -83
  243. package/fesm2022/ngwr-select.mjs.map +1 -1
  244. package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
  245. package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
  246. package/fesm2022/ngwr-sidebar.mjs +3 -3
  247. package/fesm2022/ngwr-skeleton.mjs +3 -3
  248. package/fesm2022/ngwr-slider-testing.mjs +23 -0
  249. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  250. package/fesm2022/ngwr-slider.mjs +108 -14
  251. package/fesm2022/ngwr-slider.mjs.map +1 -1
  252. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  253. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  254. package/fesm2022/ngwr-sortable-list.mjs +284 -63
  255. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  256. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  257. package/fesm2022/ngwr-spinner.mjs +3 -3
  258. package/fesm2022/ngwr-splitter.mjs +3 -3
  259. package/fesm2022/ngwr-statistic.mjs +9 -9
  260. package/fesm2022/ngwr-stepper.mjs +42 -11
  261. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  262. package/fesm2022/ngwr-storage.mjs +3 -3
  263. package/fesm2022/ngwr-switch.mjs +3 -3
  264. package/fesm2022/ngwr-table-testing.mjs +88 -2
  265. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  266. package/fesm2022/ngwr-table.mjs +891 -74
  267. package/fesm2022/ngwr-table.mjs.map +1 -1
  268. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  269. package/fesm2022/ngwr-tabs-testing.mjs +1 -1
  270. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  271. package/fesm2022/ngwr-tabs.mjs +15 -10
  272. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  273. package/fesm2022/ngwr-textarea-testing.mjs +11 -0
  274. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  275. package/fesm2022/ngwr-textarea.mjs +128 -16
  276. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  277. package/fesm2022/ngwr-theme.mjs +3 -3
  278. package/fesm2022/ngwr-timeline.mjs +6 -6
  279. package/fesm2022/ngwr-toast.mjs +40 -19
  280. package/fesm2022/ngwr-toast.mjs.map +1 -1
  281. package/fesm2022/ngwr-toolbar.mjs +3 -3
  282. package/fesm2022/ngwr-tour.mjs +6 -6
  283. package/fesm2022/ngwr-transfer-testing.mjs +6 -0
  284. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  285. package/fesm2022/ngwr-transfer.mjs +24 -5
  286. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  287. package/fesm2022/ngwr-tree-testing.mjs +62 -2
  288. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  289. package/fesm2022/ngwr-tree.mjs +966 -78
  290. package/fesm2022/ngwr-tree.mjs.map +1 -1
  291. package/fesm2022/ngwr-typography.mjs +3 -3
  292. package/fesm2022/ngwr-utils-router.mjs +3 -3
  293. package/fesm2022/ngwr-utils.mjs +34 -1
  294. package/fesm2022/ngwr-utils.mjs.map +1 -1
  295. package/fesm2022/ngwr-version.mjs +1 -1
  296. package/fesm2022/ngwr-version.mjs.map +1 -1
  297. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  298. package/fesm2022/ngwr-window.mjs +33 -22
  299. package/fesm2022/ngwr-window.mjs.map +1 -1
  300. package/file-upload/styles/_index.scss +156 -0
  301. package/i18n/ar.json +28 -6
  302. package/i18n/cs.json +28 -6
  303. package/i18n/de.json +28 -6
  304. package/i18n/en.json +28 -6
  305. package/i18n/es.json +28 -6
  306. package/i18n/fr.json +28 -6
  307. package/i18n/he.json +28 -6
  308. package/i18n/hi.json +28 -6
  309. package/i18n/id.json +28 -6
  310. package/i18n/it.json +28 -6
  311. package/i18n/ja.json +28 -6
  312. package/i18n/ko.json +28 -6
  313. package/i18n/nl.json +28 -6
  314. package/i18n/pl.json +28 -6
  315. package/i18n/pt.json +28 -6
  316. package/i18n/ru.json +28 -6
  317. package/i18n/sv.json +28 -6
  318. package/i18n/tr.json +28 -6
  319. package/i18n/uk.json +28 -6
  320. package/i18n/vi.json +28 -6
  321. package/i18n/zh-TW.json +28 -6
  322. package/i18n/zh.json +28 -6
  323. package/input/styles/_index.scss +68 -1
  324. package/input-otp/styles/_index.scss +14 -0
  325. package/lightbox/styles/_rules.scss +96 -0
  326. package/llms-full.txt +61 -25
  327. package/llms.txt +12 -0
  328. package/overlay/styles/_arrow.scss +4 -4
  329. package/package.json +37 -1
  330. package/popconfirm/styles/_index.scss +3 -11
  331. package/progress/styles/_index.scss +32 -0
  332. package/schema-form/styles/_index.scss +78 -0
  333. package/schematics/use/rule.js +2 -0
  334. package/schematics/use/symbol-map.json +5 -0
  335. package/select/styles/_index.scss +114 -22
  336. package/skills/ngwr/SKILL.md +1 -1
  337. package/skills/ngwr/references/catalog.md +11 -2
  338. package/slider/styles/_index.scss +128 -0
  339. package/sortable-list/styles/_rules.scss +23 -1
  340. package/table/styles/_index.scss +167 -3
  341. package/textarea/styles/_index.scss +80 -0
  342. package/theme/styles/_focus.scss +5 -0
  343. package/theme/styles/_motion.scss +5 -0
  344. package/transfer/styles/_index.scss +84 -0
  345. package/tree/styles/_index.scss +138 -5
  346. package/types/ngwr-alert-testing.d.ts +88 -0
  347. package/types/ngwr-badge.d.ts +72 -2
  348. package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
  349. package/types/ngwr-burger-testing.d.ts +51 -0
  350. package/types/ngwr-calendar-testing.d.ts +18 -6
  351. package/types/ngwr-calendar.d.ts +272 -22
  352. package/types/ngwr-cascader.d.ts +10 -1
  353. package/types/ngwr-charts-chart-legend.d.ts +9 -4
  354. package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
  355. package/types/ngwr-charts-line-chart.d.ts +7 -4
  356. package/types/ngwr-color-picker-testing.d.ts +15 -4
  357. package/types/ngwr-color-picker.d.ts +76 -6
  358. package/types/ngwr-compare-testing.d.ts +72 -0
  359. package/types/ngwr-date-picker-testing.d.ts +40 -8
  360. package/types/ngwr-date-picker.d.ts +178 -10
  361. package/types/ngwr-date-stamp-testing.d.ts +1 -1
  362. package/types/ngwr-date-stamp.d.ts +53 -7
  363. package/types/ngwr-date.d.ts +188 -15
  364. package/types/ngwr-drawer.d.ts +9 -0
  365. package/types/ngwr-dropdown-testing.d.ts +73 -5
  366. package/types/ngwr-dropdown.d.ts +124 -6
  367. package/types/ngwr-event-calendar.d.ts +66 -8
  368. package/types/ngwr-file-upload-testing.d.ts +31 -2
  369. package/types/ngwr-file-upload.d.ts +148 -1
  370. package/types/ngwr-form.d.ts +47 -3
  371. package/types/ngwr-graph-testing.d.ts +8 -3
  372. package/types/ngwr-graph.d.ts +147 -7
  373. package/types/ngwr-input-number-testing.d.ts +10 -0
  374. package/types/ngwr-input-number.d.ts +30 -1
  375. package/types/ngwr-input-otp.d.ts +10 -0
  376. package/types/ngwr-input-testing.d.ts +30 -0
  377. package/types/ngwr-input.d.ts +54 -3
  378. package/types/ngwr-lightbox-testing.d.ts +27 -0
  379. package/types/ngwr-lightbox.d.ts +71 -6
  380. package/types/ngwr-overlay.d.ts +84 -5
  381. package/types/ngwr-pipes.d.ts +34 -13
  382. package/types/ngwr-popconfirm-testing.d.ts +12 -3
  383. package/types/ngwr-popconfirm.d.ts +28 -3
  384. package/types/ngwr-popover-testing.d.ts +19 -2
  385. package/types/ngwr-popover.d.ts +22 -2
  386. package/types/ngwr-progress.d.ts +29 -1
  387. package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
  388. package/types/ngwr-resizable-testing.d.ts +116 -0
  389. package/types/ngwr-schema-form-testing.d.ts +260 -0
  390. package/types/ngwr-schema-form.d.ts +76 -6
  391. package/types/ngwr-select-testing.d.ts +20 -0
  392. package/types/ngwr-select.d.ts +112 -11
  393. package/types/ngwr-sidebar-testing.d.ts +176 -0
  394. package/types/ngwr-slider-testing.d.ts +10 -1
  395. package/types/ngwr-slider.d.ts +109 -3
  396. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  397. package/types/ngwr-sortable-list.d.ts +119 -10
  398. package/types/ngwr-stepper.d.ts +20 -11
  399. package/types/ngwr-table-testing.d.ts +70 -6
  400. package/types/ngwr-table.d.ts +480 -50
  401. package/types/ngwr-tabs-testing.d.ts +14 -17
  402. package/types/ngwr-tabs.d.ts +6 -0
  403. package/types/ngwr-textarea-testing.d.ts +10 -0
  404. package/types/ngwr-textarea.d.ts +48 -2
  405. package/types/ngwr-toast.d.ts +8 -1
  406. package/types/ngwr-transfer-testing.d.ts +3 -0
  407. package/types/ngwr-transfer.d.ts +24 -1
  408. package/types/ngwr-tree-testing.d.ts +65 -1
  409. package/types/ngwr-tree.d.ts +333 -12
  410. package/types/ngwr-utils.d.ts +28 -0
  411. package/types/ngwr-version.d.ts +1 -1
  412. package/types/ngwr-window.d.ts +7 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-comment.mjs","names":[],"sources":["../../../projects/lib/comment/comment.ts","../../../projects/lib/comment/comment.html","../../../projects/lib/comment/comment-composer.ts","../../../projects/lib/comment/comment-composer.html"],"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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrCommentSide, WrCommentVariant } from './types';\n\n/**\n * One entry in a discussion or a chat: avatar, author, time, body, actions and\n * nested replies. The data stays with the app: the component takes no array,\n * fetches nothing and sorts nothing. Everything is projected or passed as a\n * string, and the app formats the time itself (`wrDate` is the usual route).\n *\n * Slots, each optional:\n *\n * - `<wr-avatar>` or `[wrCommentAvatar]` for the avatar column\n * - `[wrCommentAuthor]` for an author drawn by the app (a profile link) in\n * place of the `author` input\n * - default content for the body\n * - `[wrCommentActions]` for the action row under the body\n * - nested `<wr-comment>` elements, or a `[wrCommentReplies]` wrapper, for\n * replies; they indent twice, and deeper levels sit flush with their parent\n * so a phone keeps room for the body\n *\n * The host is an `article` named after the author, replies sit in a `group`\n * named by `repliesLabel`, and no heading level is assumed: the page owns the\n * outline. Wrap a thread in a list and a chat in `role=\"log\"`.\n *\n * `variant=\"bubble\"` draws the body as a chat bubble; `side=\"end\"` puts it on\n * the reader's own side of the log.\n *\n * @example\n * ```html\n * <wr-comment author=\"Ann\" time=\"2 hours ago\" [datetime]=\"posted\">\n * <wr-avatar size=\"2.5rem\" alt=\"\">AN</wr-avatar>\n * Looks good to me.\n * <div wrCommentActions><button wr-btn size=\"sm\">Reply</button></div>\n * <wr-comment author=\"Bob\" time=\"an hour ago\">Thanks!</wr-comment>\n * </wr-comment>\n *\n * <wr-comment variant=\"bubble\" side=\"end\" time=\"09:41\">On my way.</wr-comment>\n * ```\n *\n * @see https://ngwr.dev/reference/components/comment\n */\n@Component({\n selector: 'wr-comment',\n templateUrl: './comment.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-comment',\n '[class]': 'classes()',\n role: 'article',\n '[attr.aria-label]': 'author() || null',\n },\n})\nexport class WrComment {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('comment');\n }\n\n /**\n * Who wrote it. Also the article's accessible name. Leave it empty when a\n * `[wrCommentAuthor]` element draws the name instead.\n *\n * @default ''\n */\n readonly author = input<string>('');\n\n /**\n * When it was written, already formatted: the component does no date\n * formatting. Run a `Date` through the `wrDate` pipe on the way in.\n *\n * @default ''\n */\n readonly time = input<string>('');\n\n /**\n * The same moment, machine-readable. With it the time renders as a\n * `<time datetime>`: a `Date` is written as ISO 8601, a string as given.\n *\n * @default null\n */\n readonly datetime = input<Date | string | null>(null);\n\n /**\n * `row` is a discussion entry; `bubble` is a chat message, which takes no replies.\n *\n * @default 'row'\n */\n readonly variant = input<WrCommentVariant>('row');\n\n /**\n * Which inline side a bubble sits on. `end` is the reader's own message.\n * Ignored by the `row` variant.\n *\n * @default 'start'\n */\n readonly side = input<WrCommentSide>('start');\n\n /** Accessible name of the replies group. Falls back to `comment.replies`, then `'Replies'`. */\n readonly repliesLabel = input<string | null>(null);\n\n protected readonly resolvedRepliesLabel = useI18nText(this.repliesLabel, 'comment.replies', 'Replies');\n\n protected readonly isoDatetime = computed(() => {\n const value = this.datetime();\n if (value === null) return null;\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.toISOString();\n return value || null;\n });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.variant() === 'bubble') parts.push('wr-comment--bubble', `wr-comment--${this.side()}`);\n return parts.join(' ');\n });\n}\n","<div class=\"wr-comment__avatar\">\n <ng-content select=\"wr-avatar, [wrCommentAvatar]\" />\n</div>\n\n<div class=\"wr-comment__main\">\n <div class=\"wr-comment__head\">\n @if (author(); as name) {\n <span class=\"wr-comment__author\">{{ name }}</span>\n }\n <ng-content select=\"[wrCommentAuthor]\" />\n @if (time(); as printed) {\n @if (isoDatetime(); as iso) {\n <time class=\"wr-comment__time\" [attr.datetime]=\"iso\">{{ printed }}</time>\n } @else {\n <span class=\"wr-comment__time\">{{ printed }}</span>\n }\n }\n </div>\n\n <div class=\"wr-comment__body\"><ng-content /></div>\n\n <div class=\"wr-comment__actions\">\n <ng-content select=\"[wrCommentActions]\" />\n </div>\n</div>\n\n<div class=\"wr-comment__replies\" role=\"group\" [attr.aria-label]=\"resolvedRepliesLabel()\">\n <ng-content select=\"wr-comment, [wrCommentReplies]\" />\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrTextarea } from 'ngwr/textarea';\nimport { wrIsComposing, WR_KEYS, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * A chat composer: an autosizing field with a send button. Enter sends,\n * Shift+Enter adds a line, Ctrl+Enter and Cmd+Enter always send. The text is\n * emitted through `send` and the composer decides nothing about where it goes.\n *\n * A signal-forms native control: it implements `FormValueControl<string>`, so\n * `[formField]` binds straight to its `value` model. `[(value)]` works\n * standalone.\n *\n * What sends and what does not:\n *\n * - Whitespace-only text never sends; the button is disabled until there is\n * something to send, and Enter does nothing.\n * - `disabled`, `readonly` and `sending` all block sending and keep the text.\n * `sending` also marks the composer `aria-busy`; the field stays editable so\n * the next message can be typed.\n * - An Enter that confirms an IME composition never sends. Both signals are\n * read, `isComposing` and `keyCode === 229`, because Safari fires\n * `compositionend` before the keydown, so `isComposing` is already `false`\n * on the committing keystroke.\n *\n * The text is trimmed and, with `clearOnSend` (the default), the field is\n * cleared BEFORE `send` emits: an app whose request fails puts the text back\n * through the composer's own model, `composer.value.set(text)`, at any time,\n * and nothing overwrites it. A model bound with `[(value)]` takes that write\n * only once change detection has run in between: written back synchronously\n * from the handler, the bound expression still holds the value Angular last\n * bound, so the input is skipped. An app that would rather keep the text until\n * the request succeeds sets `[clearOnSend]=\"false\"` and clears the model\n * itself. Focus stays in the field after sending, unless the `send` handler\n * moved it.\n *\n * @example\n * ```html\n * <wr-comment-composer placeholder=\"Message\" [(value)]=\"draft\" (send)=\"post($event)\" />\n *\n * <wr-comment-composer [sending]=\"posting()\" [clearOnSend]=\"false\" (send)=\"post($event)\">\n * <button wrComposerActions wr-btn size=\"sm\">Attach</button>\n * </wr-comment-composer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/comment\n */\n@Component({\n selector: 'wr-comment-composer',\n templateUrl: './comment-composer.html',\n imports: [WrButton, WrTextarea],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-comment-composer',\n '[class]': 'classes()',\n '[attr.aria-busy]': 'sending() ? \"true\" : null',\n },\n})\nexport class WrCommentComposer implements FormValueControl<string> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('comment');\n }\n\n /** Native placeholder text. @default '' */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name for the field. Falls back to the placeholder: the native\n * `<textarea>` lives inside the component, so a `<label for>` outside cannot\n * reach it.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /** Accessible name of the send button. Falls back to `comment.send`, then `'Send'`. */\n readonly sendLabel = input<string | null>(null);\n\n /** Visible row count while the field is empty. @default 1 */\n readonly rows = input(1, { transform: (v: unknown): number => coerceNumberProperty(v, 1) });\n\n /** Rows the field grows to before it scrolls on its own. @default 6 */\n readonly maxRows = input(6, { transform: (v: unknown): number => coerceNumberProperty(v, 6) });\n\n /**\n * Disable the field and the button. Bound automatically from the field's\n * disabled state when used with `[formField]`. The text is kept.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Read-only state: the text is shown and announced, keeps its tab stop and\n * cannot be edited or sent.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * A send is in flight: the button is disabled, the host is `aria-busy` and\n * Enter does nothing. The field stays editable and the text is kept.\n *\n * @default false\n */\n readonly sending = input(false, { transform: coerceBooleanProperty });\n\n /**\n * `true`: Enter sends and Shift+Enter adds a line. `false`: Enter adds a line\n * and only Ctrl+Enter or Cmd+Enter sends.\n *\n * @default true\n */\n readonly enterSends = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Clear the field before `send` emits. With `false` the text stays until the\n * app clears the model itself.\n *\n * @default true\n */\n readonly clearOnSend = input(true, { transform: coerceBooleanProperty });\n\n /** The draft. Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<string>('');\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** The trimmed text, once per send. Where it goes is the app's business. */\n readonly send = output<string>();\n\n protected readonly resolvedSendLabel = useI18nText(this.sendLabel, 'comment.send', 'Send');\n\n /** Whether a send would go through right now. */\n protected readonly canSend = computed(\n () => this.value().trim() !== '' && !this.disabled() && !this.readonly() && !this.sending()\n );\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.disabled()) parts.push('wr-comment-composer--disabled');\n if (this.readonly()) parts.push('wr-comment-composer--readonly');\n if (this.sending()) parts.push('wr-comment-composer--sending');\n return parts.join(' ');\n });\n\n private readonly field = viewChild.required(WrTextarea);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Focus the field, which is what Signal Forms calls to focus this control. */\n focus(options?: FocusOptions): void {\n this.field().focus(options);\n }\n\n /**\n * Send the current text, exactly as the button and Enter do: nothing happens\n * for whitespace-only text or while `disabled`, `readonly` or `sending`.\n */\n submit(): void {\n if (!this.canSend()) return;\n const text = this.value().trim();\n const hadFocus = this.host.nativeElement.contains(this.host.nativeElement.ownerDocument.activeElement);\n if (this.clearOnSend()) this.value.set('');\n this.send.emit(text);\n // A keyboard user is on the button, which sending just disabled: hand focus\n // back unless the handler moved it. A pointer never took it (see the template).\n if (hadFocus && this.host.nativeElement.contains(this.host.nativeElement.ownerDocument.activeElement)) {\n this.focus();\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key !== WR_KEYS.ENTER || wrIsComposing(event)) return;\n const modifier = event.ctrlKey || event.metaKey;\n if (!modifier && (event.shiftKey || event.altKey || !this.enterSends())) return;\n // A sending Enter never reaches the field: on empty text it would only add\n // blank lines that the next send trims away.\n event.preventDefault();\n this.submit();\n }\n}\n","<wr-textarea\n class=\"wr-comment-composer__field\"\n autosize\n [rows]=\"rows()\"\n [maxRows]=\"maxRows()\"\n [resizable]=\"false\"\n [placeholder]=\"placeholder()\"\n [ariaLabel]=\"ariaLabel()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [(value)]=\"value\"\n (touch)=\"touch.emit()\"\n (keydown)=\"onKeydown($event)\"\n/>\n\n<div class=\"wr-comment-composer__actions\">\n <ng-content select=\"[wrComposerActions]\" />\n</div>\n\n<button\n wr-btn\n type=\"button\"\n color=\"primary\"\n shape=\"pill\"\n class=\"wr-comment-composer__send\"\n [attr.aria-label]=\"resolvedSendLabel()\"\n [disabled]=\"!canSend()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"submit()\"\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\n d=\"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z\"\n />\n <path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"ngwr-comment.mjs","names":[],"sources":["../../../projects/lib/comment/comment.ts","../../../projects/lib/comment/comment.html","../../../projects/lib/comment/comment-composer.ts","../../../projects/lib/comment/comment-composer.html"],"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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrCommentSide, WrCommentVariant } from './types';\n\n/**\n * One entry in a discussion or a chat: avatar, author, time, body, actions and\n * nested replies. The data stays with the app: the component takes no array,\n * fetches nothing and sorts nothing. Everything is projected or passed as a\n * string, and the app formats the time itself (`wrDate` is the usual route).\n *\n * Slots, each optional:\n *\n * - `<wr-avatar>` or `[wrCommentAvatar]` for the avatar column\n * - `[wrCommentAuthor]` for an author drawn by the app (a profile link) in\n * place of the `author` input\n * - default content for the body\n * - `[wrCommentActions]` for the action row under the body\n * - nested `<wr-comment>` elements, or a `[wrCommentReplies]` wrapper, for\n * replies; they indent twice, and deeper levels sit flush with their parent\n * so a phone keeps room for the body\n *\n * The host is an `article` named after the author, replies sit in a `group`\n * named by `repliesLabel`, and no heading level is assumed: the page owns the\n * outline. Wrap a thread in a list and a chat in `role=\"log\"`.\n *\n * `variant=\"bubble\"` draws the body as a chat bubble; `side=\"end\"` puts it on\n * the reader's own side of the log.\n *\n * @example\n * ```html\n * <wr-comment author=\"Ann\" time=\"2 hours ago\" [datetime]=\"posted\">\n * <wr-avatar size=\"2.5rem\" alt=\"\">AN</wr-avatar>\n * Looks good to me.\n * <div wrCommentActions><button wr-btn size=\"sm\">Reply</button></div>\n * <wr-comment author=\"Bob\" time=\"an hour ago\">Thanks!</wr-comment>\n * </wr-comment>\n *\n * <wr-comment variant=\"bubble\" side=\"end\" time=\"09:41\">On my way.</wr-comment>\n * ```\n *\n * @see https://ngwr.dev/reference/components/comment\n */\n@Component({\n selector: 'wr-comment',\n templateUrl: './comment.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-comment',\n '[class]': 'classes()',\n role: 'article',\n '[attr.aria-label]': 'author() || null',\n },\n})\nexport class WrComment {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('comment');\n }\n\n /**\n * Who wrote it. Also the article's accessible name. Leave it empty when a\n * `[wrCommentAuthor]` element draws the name instead.\n *\n * @default ''\n */\n readonly author = input<string>('');\n\n /**\n * When it was written, already formatted: the component does no date\n * formatting. Run a `Date` through the `wrDate` pipe on the way in.\n *\n * @default ''\n */\n readonly time = input<string>('');\n\n /**\n * The same moment, machine-readable. With it the time renders as a\n * `<time datetime>`: a `Date` is written as ISO 8601, a string as given.\n *\n * @default null\n */\n readonly datetime = input<Date | string | null>(null);\n\n /**\n * `row` is a discussion entry; `bubble` is a chat message, which takes no replies.\n *\n * @default 'row'\n */\n readonly variant = input<WrCommentVariant>('row');\n\n /**\n * Which inline side a bubble sits on. `end` is the reader's own message.\n * Ignored by the `row` variant.\n *\n * @default 'start'\n */\n readonly side = input<WrCommentSide>('start');\n\n /** Accessible name of the replies group. Falls back to `comment.replies`, then `'Replies'`. */\n readonly repliesLabel = input<string | null>(null);\n\n protected readonly resolvedRepliesLabel = useI18nText(this.repliesLabel, 'comment.replies', 'Replies');\n\n protected readonly isoDatetime = computed(() => {\n const value = this.datetime();\n if (value === null) return null;\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.toISOString();\n return value || null;\n });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.variant() === 'bubble') parts.push('wr-comment--bubble', `wr-comment--${this.side()}`);\n return parts.join(' ');\n });\n}\n","<div class=\"wr-comment__avatar\">\n <ng-content select=\"wr-avatar, [wrCommentAvatar]\" />\n</div>\n\n<div class=\"wr-comment__main\">\n <div class=\"wr-comment__head\">\n @if (author(); as name) {\n <span class=\"wr-comment__author\">{{ name }}</span>\n }\n <ng-content select=\"[wrCommentAuthor]\" />\n @if (time(); as printed) {\n @if (isoDatetime(); as iso) {\n <time class=\"wr-comment__time\" [attr.datetime]=\"iso\">{{ printed }}</time>\n } @else {\n <span class=\"wr-comment__time\">{{ printed }}</span>\n }\n }\n </div>\n\n <div class=\"wr-comment__body\"><ng-content /></div>\n\n <div class=\"wr-comment__actions\">\n <ng-content select=\"[wrCommentActions]\" />\n </div>\n</div>\n\n<div class=\"wr-comment__replies\" role=\"group\" [attr.aria-label]=\"resolvedRepliesLabel()\">\n <ng-content select=\"wr-comment, [wrCommentReplies]\" />\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrTextarea } from 'ngwr/textarea';\nimport { wrIsComposing, WR_KEYS, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * A chat composer: an autosizing field with a send button. Enter sends,\n * Shift+Enter adds a line, Ctrl+Enter and Cmd+Enter always send. The text is\n * emitted through `send` and the composer decides nothing about where it goes.\n *\n * A signal-forms native control: it implements `FormValueControl<string>`, so\n * `[formField]` binds straight to its `value` model. `[(value)]` works\n * standalone.\n *\n * What sends and what does not:\n *\n * - Whitespace-only text never sends; the button is disabled until there is\n * something to send, and Enter does nothing.\n * - `disabled`, `readonly` and `sending` all block sending and keep the text.\n * `sending` also marks the composer `aria-busy`; the field stays editable so\n * the next message can be typed.\n * - An Enter that confirms an IME composition never sends. Both signals are\n * read, `isComposing` and `keyCode === 229`, because Safari fires\n * `compositionend` before the keydown, so `isComposing` is already `false`\n * on the committing keystroke.\n *\n * The text is trimmed and, with `clearOnSend` (the default), the field is\n * cleared BEFORE `send` emits: an app whose request fails puts the text back\n * through the composer's own model, `composer.value.set(text)`, at any time,\n * and nothing overwrites it. A model bound with `[(value)]` takes that write\n * only once change detection has run in between: written back synchronously\n * from the handler, the bound expression still holds the value Angular last\n * bound, so the input is skipped. An app that would rather keep the text until\n * the request succeeds sets `[clearOnSend]=\"false\"` and clears the model\n * itself. Focus stays in the field after sending, unless the `send` handler\n * moved it.\n *\n * @example\n * ```html\n * <wr-comment-composer placeholder=\"Message\" [(value)]=\"draft\" (send)=\"post($event)\" />\n *\n * <wr-comment-composer [sending]=\"posting()\" [clearOnSend]=\"false\" (send)=\"post($event)\">\n * <button wrComposerActions wr-btn size=\"sm\">Attach</button>\n * </wr-comment-composer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/comment\n */\n@Component({\n selector: 'wr-comment-composer',\n templateUrl: './comment-composer.html',\n imports: [WrButton, WrTextarea],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-comment-composer',\n '[class]': 'classes()',\n '[attr.aria-busy]': 'sending() ? \"true\" : null',\n },\n})\nexport class WrCommentComposer implements FormValueControl<string> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('comment');\n }\n\n /** Native placeholder text. @default '' */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name for the field. Falls back to the placeholder: the native\n * `<textarea>` lives inside the component, so a `<label for>` outside cannot\n * reach it.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /** Accessible name of the send button. Falls back to `comment.send`, then `'Send'`. */\n readonly sendLabel = input<string | null>(null);\n\n /** Visible row count while the field is empty. @default 1 */\n readonly rows = input(1, { transform: (v: unknown): number => coerceNumberProperty(v, 1) });\n\n /** Rows the field grows to before it scrolls on its own. @default 6 */\n readonly maxRows = input(6, { transform: (v: unknown): number => coerceNumberProperty(v, 6) });\n\n /**\n * Disable the field and the button. Bound automatically from the field's\n * disabled state when used with `[formField]`. The text is kept.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Read-only state: the text is shown and announced, keeps its tab stop and\n * cannot be edited or sent.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * A send is in flight: the button is disabled, the host is `aria-busy` and\n * Enter does nothing. The field stays editable and the text is kept.\n *\n * @default false\n */\n readonly sending = input(false, { transform: coerceBooleanProperty });\n\n /**\n * `true`: Enter sends and Shift+Enter adds a line. `false`: Enter adds a line\n * and only Ctrl+Enter or Cmd+Enter sends.\n *\n * @default true\n */\n readonly enterSends = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Clear the field before `send` emits. With `false` the text stays until the\n * app clears the model itself.\n *\n * @default true\n */\n readonly clearOnSend = input(true, { transform: coerceBooleanProperty });\n\n /** The draft. Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<string>('');\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /** The trimmed text, once per send. Where it goes is the app's business. */\n readonly send = output<string>();\n\n protected readonly resolvedSendLabel = useI18nText(this.sendLabel, 'comment.send', 'Send');\n\n /** Whether a send would go through right now. */\n protected readonly canSend = computed(\n () => this.value().trim() !== '' && !this.disabled() && !this.readonly() && !this.sending()\n );\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.disabled()) parts.push('wr-comment-composer--disabled');\n if (this.readonly()) parts.push('wr-comment-composer--readonly');\n if (this.sending()) parts.push('wr-comment-composer--sending');\n return parts.join(' ');\n });\n\n private readonly field = viewChild.required(WrTextarea);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Focus the field, which is what Signal Forms calls to focus this control. */\n focus(options?: FocusOptions): void {\n this.field().focus(options);\n }\n\n /**\n * Send the current text, exactly as the button and Enter do: nothing happens\n * for whitespace-only text or while `disabled`, `readonly` or `sending`.\n */\n submit(): void {\n if (!this.canSend()) return;\n const text = this.value().trim();\n const hadFocus = this.host.nativeElement.contains(this.host.nativeElement.ownerDocument.activeElement);\n if (this.clearOnSend()) this.value.set('');\n this.send.emit(text);\n // A keyboard user is on the button, which sending just disabled: hand focus\n // back unless the handler moved it. A pointer never took it (see the template).\n if (hadFocus && this.host.nativeElement.contains(this.host.nativeElement.ownerDocument.activeElement)) {\n this.focus();\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key !== WR_KEYS.ENTER || wrIsComposing(event)) return;\n const modifier = event.ctrlKey || event.metaKey;\n if (!modifier && (event.shiftKey || event.altKey || !this.enterSends())) return;\n // A sending Enter never reaches the field: on empty text it would only add\n // blank lines that the next send trims away.\n event.preventDefault();\n this.submit();\n }\n}\n","<wr-textarea\n class=\"wr-comment-composer__field\"\n autosize\n [rows]=\"rows()\"\n [maxRows]=\"maxRows()\"\n [resizable]=\"false\"\n [placeholder]=\"placeholder()\"\n [ariaLabel]=\"ariaLabel()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [(value)]=\"value\"\n (touch)=\"touch.emit()\"\n (keydown)=\"onKeydown($event)\"\n/>\n\n<div class=\"wr-comment-composer__actions\">\n <ng-content select=\"[wrComposerActions]\" />\n</div>\n\n<button\n wr-btn\n type=\"button\"\n color=\"primary\"\n shape=\"pill\"\n class=\"wr-comment-composer__send\"\n [attr.aria-label]=\"resolvedSendLabel()\"\n [disabled]=\"!canSend()\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"submit()\"\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\n d=\"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z\"\n />\n <path d=\"M6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
@@ -0,0 +1,84 @@
1
+ import { ComponentHarness, HarnessPredicate, TestKey } from "@angular/cdk/testing";
2
+ /**
3
+ * @license
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
7
+ */
8
+ var WrCompareHarness = class WrCompareHarness extends ComponentHarness {
9
+ static hostSelector = "wr-compare";
10
+ static with(options = {}) {
11
+ return new HarnessPredicate(WrCompareHarness, options).addOption("label", options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label)).addOption("orientation", options.orientation, async (harness, orientation) => await harness.getOrientation() === orientation).addOption("disabled", options.disabled, async (harness, disabled) => await harness.isDisabled() === disabled);
12
+ }
13
+ slider = this.locatorFor(".wr-compare__surface[role=\"slider\"]");
14
+ async getPosition() {
15
+ return this.numeric("aria-valuenow");
16
+ }
17
+ async getMinPosition() {
18
+ return this.numeric("aria-valuemin");
19
+ }
20
+ async getMaxPosition() {
21
+ return this.numeric("aria-valuemax");
22
+ }
23
+ async getOrientation() {
24
+ return await (await this.slider()).getAttribute("aria-orientation") === "vertical" ? "vertical" : "horizontal";
25
+ }
26
+ async getLabel() {
27
+ return (await this.slider()).getAttribute("aria-label");
28
+ }
29
+ async isDisabled() {
30
+ return await (await this.slider()).getAttribute("aria-disabled") === "true";
31
+ }
32
+ async hasHandle() {
33
+ return await this.locatorForOptional(".wr-compare__handle")() !== null;
34
+ }
35
+ async getBeforeText() {
36
+ return (await this.locatorFor(".wr-compare__layer--before")()).text();
37
+ }
38
+ async getAfterText() {
39
+ return (await this.locatorFor(".wr-compare__layer--after")()).text();
40
+ }
41
+ async focus() {
42
+ return (await this.slider()).focus();
43
+ }
44
+ async isFocused() {
45
+ return (await this.slider()).isFocused();
46
+ }
47
+ async setPosition(target) {
48
+ const [min, max] = [await this.getMinPosition(), await this.getMaxPosition()];
49
+ if (target < min || target > max || !Number.isInteger(target)) throw new Error(`WrCompareHarness.setPosition(${target}): unreachable. This slider accepts whole percents in ${min}–${max}.`);
50
+ const slider = await this.slider();
51
+ const before = await this.getPosition();
52
+ if (target === min) await slider.sendKeys(TestKey.HOME);
53
+ else if (target === max) await slider.sendKeys(TestKey.END);
54
+ else {
55
+ let [grow, shrink] = await this.getOrientation() === "vertical" ? [TestKey.DOWN_ARROW, TestKey.UP_ARROW] : [TestKey.RIGHT_ARROW, TestKey.LEFT_ARROW];
56
+ let now = before;
57
+ let turned = false;
58
+ for (let press = 0; now !== target && press < 64; press++) {
59
+ const gap = target - now;
60
+ const [key, back] = gap > 0 ? [grow, shrink] : [shrink, grow];
61
+ await (Math.abs(gap) >= 10 ? slider.sendKeys({ shift: true }, key) : slider.sendKeys(key));
62
+ const next = await this.getPosition();
63
+ if (Math.sign(next - now) === Math.sign(gap)) {
64
+ now = next;
65
+ continue;
66
+ }
67
+ if (next !== now) await (Math.abs(gap) >= 10 ? slider.sendKeys({ shift: true }, back) : slider.sendKeys(back));
68
+ now = await this.getPosition();
69
+ if (turned) break;
70
+ turned = true;
71
+ [grow, shrink] = [shrink, grow];
72
+ }
73
+ }
74
+ const landed = await this.getPosition();
75
+ if (landed !== target) throw new Error(`WrCompareHarness.setPosition(${target}): the divider stopped at ${landed}, from ${before}. A disabled slider ignores its keys, which is the usual reason.`);
76
+ }
77
+ async numeric(attribute) {
78
+ const raw = await (await this.slider()).getAttribute(attribute);
79
+ return raw === null ? NaN : Number(raw);
80
+ }
81
+ };
82
+ export { WrCompareHarness };
83
+
84
+ //# sourceMappingURL=ngwr-compare-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-compare-testing.mjs","names":[],"sources":["../../../projects/lib/compare/testing/wr-compare-harness.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 { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrCompareHarnessFilters } from './types';\n\n/**\n * Test harness for `<wr-compare>`, the before/after slider.\n *\n * The position is read from the slider's `aria-valuenow`, in whole percent,\n * and written with the keyboard. There is no `dragTo()`: a drag divides the\n * pointer's offset by the host's measured width, a unit test has no layout, and\n * the component keeps its position when the host measures zero, so a dragging\n * method would resolve having moved nothing.\n *\n * @example\n * ```ts\n * const compare = await loader.getHarness(WrCompareHarness);\n *\n * await compare.setPosition(30);\n * expect(await compare.getPosition()).toBe(30);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCompareHarness extends ComponentHarness {\n static hostSelector = 'wr-compare';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCompareHarnessFilters = {}): HarnessPredicate<WrCompareHarness> {\n return new HarnessPredicate(WrCompareHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption(\n 'orientation',\n options.orientation,\n async (harness, orientation) => (await harness.getOrientation()) === orientation\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly slider = this.locatorFor('.wr-compare__surface[role=\"slider\"]');\n\n /** The divider position in whole percent, from `aria-valuenow`. */\n async getPosition(): Promise<number> {\n return this.numeric('aria-valuenow');\n }\n\n /** The lowest position the divider may reach, from `aria-valuemin`. */\n async getMinPosition(): Promise<number> {\n return this.numeric('aria-valuemin');\n }\n\n /** The highest position the divider may reach, from `aria-valuemax`. */\n async getMaxPosition(): Promise<number> {\n return this.numeric('aria-valuemax');\n }\n\n /** The axis the divider moves along, from `aria-orientation`. */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.slider()).getAttribute('aria-orientation')) === 'vertical' ? 'vertical' : 'horizontal';\n }\n\n /** The slider's accessible name. */\n async getLabel(): Promise<string | null> {\n return (await this.slider()).getAttribute('aria-label');\n }\n\n /** Whether the slider refuses interaction, from `aria-disabled`. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.slider()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the round drag handle is drawn on the divider (`showHandle`). */\n async hasHandle(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-compare__handle')()) !== null;\n }\n\n /** The text of the \"before\" layer, trimmed. */\n async getBeforeText(): Promise<string> {\n return (await this.locatorFor('.wr-compare__layer--before')()).text();\n }\n\n /** The text of the \"after\" layer, trimmed. */\n async getAfterText(): Promise<string> {\n return (await this.locatorFor('.wr-compare__layer--after')()).text();\n }\n\n /** Move keyboard focus to the slider. */\n async focus(): Promise<void> {\n return (await this.slider()).focus();\n }\n\n /** Whether the slider holds focus. */\n async isFocused(): Promise<boolean> {\n return (await this.slider()).isFocused();\n }\n\n /**\n * Walk the divider to `target` with the keys a user has: Home and End for the\n * bounds, Shift+arrow for tens, an arrow for ones.\n *\n * Which arrow grows the position depends on the orientation and on the reading\n * direction, which a harness cannot read, so the walk watches where each press\n * lands and turns around when the first one went the wrong way.\n *\n * Throws for a target outside `[min, max]`, for a fractional one (a key lands\n * on a whole percent) and when the divider stops moving, which is what a\n * disabled slider does.\n */\n async setPosition(target: number): Promise<void> {\n const [min, max] = [await this.getMinPosition(), await this.getMaxPosition()];\n if (target < min || target > max || !Number.isInteger(target)) {\n throw new Error(\n `WrCompareHarness.setPosition(${target}): unreachable. This slider accepts whole percents in ${min}–${max}.`\n );\n }\n\n const slider = await this.slider();\n const before = await this.getPosition();\n if (target === min) await slider.sendKeys(TestKey.HOME);\n else if (target === max) await slider.sendKeys(TestKey.END);\n else {\n const vertical = (await this.getOrientation()) === 'vertical';\n let [grow, shrink] = vertical\n ? [TestKey.DOWN_ARROW, TestKey.UP_ARROW]\n : [TestKey.RIGHT_ARROW, TestKey.LEFT_ARROW];\n\n let now = before;\n let turned = false;\n // Bounded: the range is 101 values wide, and a turn costs two presses.\n for (let press = 0; now !== target && press < 64; press++) {\n const gap = target - now;\n const [key, back] = gap > 0 ? [grow, shrink] : [shrink, grow];\n await (Math.abs(gap) >= 10 ? slider.sendKeys({ shift: true }, key) : slider.sendKeys(key));\n const next = await this.getPosition();\n\n if (Math.sign(next - now) === Math.sign(gap)) {\n now = next;\n continue;\n }\n // Nothing moved, or it moved away: the page reads right to left, or the\n // slider is inert. Put a wrong step back, and turn around once.\n if (next !== now) await (Math.abs(gap) >= 10 ? slider.sendKeys({ shift: true }, back) : slider.sendKeys(back));\n now = await this.getPosition();\n if (turned) break;\n turned = true;\n [grow, shrink] = [shrink, grow];\n }\n }\n\n const landed = await this.getPosition();\n if (landed !== target) {\n throw new Error(\n `WrCompareHarness.setPosition(${target}): the divider stopped at ${landed}, from ${before}. A disabled ` +\n 'slider ignores its keys, which is the usual reason.'\n );\n }\n }\n\n private async numeric(attribute: string): Promise<number> {\n const raw = await (await this.slider()).getAttribute(attribute);\n return raw === null ? Number.NaN : Number(raw);\n }\n}\n"],"mappings":";;;;;;;AA8BA,IAAa,mBAAb,MAAa,yBAAyB,iBAAgB;CACpD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAmC,CAAA,GAAE;EAC/C,OAAO,IAAI,iBAAiB,kBAAkB,OAAO,CAAC,CACnD,UAAU,SAAS,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,cAAc,QAAQ,SAAQ,GAAI,KAAK,CAAC,CAAC,CAChH,UACC,eACA,QAAQ,aACR,OAAO,SAAS,gBAAiB,MAAM,QAAQ,eAAc,MAAQ,WAAW,CACjF,CACA,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ;CACnH;CAEiB,SAAS,KAAK,WAAW,uCAAqC;CAG/E,MAAM,cAAW;EACf,OAAO,KAAK,QAAQ,eAAe;CACrC;CAGA,MAAM,iBAAc;EAClB,OAAO,KAAK,QAAQ,eAAe;CACrC;CAGA,MAAM,iBAAc;EAClB,OAAO,KAAK,QAAQ,eAAe;CACrC;CAGA,MAAM,iBAAc;EAClB,OAAQ,OAAO,MAAM,KAAK,OAAM,EAA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AAS;GAEb,KAAK,IAAI,QAAQ,GAAG,QAAQ,UAAU,QAAQ,IAAI,SAAS;IACzD,MAAM,MAAM,SAAS;IACrB,MAAM,CAAC,KAAK,QAAQ,MAAM,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,QAAQ,IAAI;IAC5D,OAAO,KAAK,IAAI,GAAG,KAAK,KAAK,OAAO,SAAS,EAAE,OAAO,KAAI,GAAI,GAAG,IAAI,OAAO,SAAS,GAAG;IACxF,MAAM,OAAO,MAAM,KAAK,YAAW;IAEnC,IAAI,KAAK,KAAK,OAAO,GAAG,MAAM,KAAK,KAAK,GAAG,GAAG;KAC5C,MAAM;KACN;IACF;IAGA,IAAI,SAAS,KAAK,OAAO,KAAK,IAAI,GAAG,KAAK,KAAK,OAAO,SAAS,EAAE,OAAO,KAAI,GAAI,IAAI,IAAI,OAAO,SAAS,IAAI;IAC5G,MAAM,MAAM,KAAK,YAAW;IAC5B,IAAI,QAAQ;IACZ,SAAS;IACT,CAAC,MAAM,UAAU,CAAC,QAAQ,IAAI;GAChC;EACF;EAEA,MAAM,SAAS,MAAM,KAAK,YAAW;EACrC,IAAI,WAAW,QACb,MAAM,IAAI,MACR,gCAAgC,OAAM,4BAA6B,OAAM,SAAU,OAAM,iEAClC;CAG7D;CAEQ,MAAM,QAAQ,WAAiB;EACrC,MAAM,MAAM,OAAO,MAAM,KAAK,OAAM,EAAA,CAAI,aAAa,SAAS;EAC9D,OAAO,QAAQ,OAAO,MAAa,OAAO,GAAG;CAC/C"}
@@ -115,7 +115,7 @@ var WrCompare = class WrCompare {
115
115
  }
116
116
  static ɵfac = i0.ɵɵngDeclareFactory({
117
117
  minVersion: "12.0.0",
118
- version: "22.2.5",
118
+ version: "22.2.6",
119
119
  ngImport: i0,
120
120
  type: WrCompare,
121
121
  deps: [],
@@ -123,7 +123,7 @@ var WrCompare = class WrCompare {
123
123
  });
124
124
  static ɵcmp = i0.ɵɵngDeclareComponent({
125
125
  minVersion: "17.0.0",
126
- version: "22.2.5",
126
+ version: "22.2.6",
127
127
  type: WrCompare,
128
128
  isStandalone: true,
129
129
  selector: "wr-compare",
@@ -190,7 +190,7 @@ var WrCompare = class WrCompare {
190
190
  };
191
191
  i0.ɵɵngDeclareClassMetadata({
192
192
  minVersion: "12.0.0",
193
- version: "22.2.5",
193
+ version: "22.2.6",
194
194
  ngImport: i0,
195
195
  type: WrCompare,
196
196
  decorators: [{
@@ -281,7 +281,7 @@ var WrContextMenuItem = class WrContextMenuItem {
281
281
  }
282
282
  static ɵfac = i0.ɵɵngDeclareFactory({
283
283
  minVersion: "12.0.0",
284
- version: "22.2.5",
284
+ version: "22.2.6",
285
285
  ngImport: i0,
286
286
  type: WrContextMenuItem,
287
287
  deps: [],
@@ -289,7 +289,7 @@ var WrContextMenuItem = class WrContextMenuItem {
289
289
  });
290
290
  static ɵcmp = i0.ɵɵngDeclareComponent({
291
291
  minVersion: "17.0.0",
292
- version: "22.2.5",
292
+ version: "22.2.6",
293
293
  type: WrContextMenuItem,
294
294
  isStandalone: true,
295
295
  selector: "wr-context-menu-item",
@@ -350,7 +350,7 @@ var WrContextMenuItem = class WrContextMenuItem {
350
350
  };
351
351
  i0.ɵɵngDeclareClassMetadata({
352
352
  minVersion: "12.0.0",
353
- version: "22.2.5",
353
+ version: "22.2.6",
354
354
  ngImport: i0,
355
355
  type: WrContextMenuItem,
356
356
  decorators: [{
@@ -660,7 +660,7 @@ var WrContextMenu = class WrContextMenu {
660
660
  }
661
661
  static ɵfac = i0.ɵɵngDeclareFactory({
662
662
  minVersion: "12.0.0",
663
- version: "22.2.5",
663
+ version: "22.2.6",
664
664
  ngImport: i0,
665
665
  type: WrContextMenu,
666
666
  deps: [],
@@ -668,7 +668,7 @@ var WrContextMenu = class WrContextMenu {
668
668
  });
669
669
  static ɵdir = i0.ɵɵngDeclareDirective({
670
670
  minVersion: "17.1.0",
671
- version: "22.2.5",
671
+ version: "22.2.6",
672
672
  type: WrContextMenu,
673
673
  isStandalone: true,
674
674
  selector: "[wrContextMenu]",
@@ -696,7 +696,7 @@ var WrContextMenu = class WrContextMenu {
696
696
  };
697
697
  i0.ɵɵngDeclareClassMetadata({
698
698
  minVersion: "12.0.0",
699
- version: "22.2.5",
699
+ version: "22.2.6",
700
700
  ngImport: i0,
701
701
  type: WrContextMenu,
702
702
  decorators: [{
@@ -743,7 +743,7 @@ var WrContextMenuPanel = class WrContextMenuPanel {
743
743
  contentTpl = viewChild.required(TemplateRef, ...ngDevMode ? [{ debugName: "contentTpl" }] : /* istanbul ignore next */ []);
744
744
  static ɵfac = i0.ɵɵngDeclareFactory({
745
745
  minVersion: "12.0.0",
746
- version: "22.2.5",
746
+ version: "22.2.6",
747
747
  ngImport: i0,
748
748
  type: WrContextMenuPanel,
749
749
  deps: [],
@@ -751,7 +751,7 @@ var WrContextMenuPanel = class WrContextMenuPanel {
751
751
  });
752
752
  static ɵcmp = i0.ɵɵngDeclareComponent({
753
753
  minVersion: "17.2.0",
754
- version: "22.2.5",
754
+ version: "22.2.6",
755
755
  type: WrContextMenuPanel,
756
756
  isStandalone: true,
757
757
  selector: "wr-context-menu",
@@ -779,7 +779,7 @@ var WrContextMenuPanel = class WrContextMenuPanel {
779
779
  };
780
780
  i0.ɵɵngDeclareClassMetadata({
781
781
  minVersion: "12.0.0",
782
- version: "22.2.5",
782
+ version: "22.2.6",
783
783
  ngImport: i0,
784
784
  type: WrContextMenuPanel,
785
785
  decorators: [{
@@ -820,7 +820,7 @@ var WrContextMenuDivider = class WrContextMenuDivider {
820
820
  }
821
821
  static ɵfac = i0.ɵɵngDeclareFactory({
822
822
  minVersion: "12.0.0",
823
- version: "22.2.5",
823
+ version: "22.2.6",
824
824
  ngImport: i0,
825
825
  type: WrContextMenuDivider,
826
826
  deps: [],
@@ -828,7 +828,7 @@ var WrContextMenuDivider = class WrContextMenuDivider {
828
828
  });
829
829
  static ɵcmp = i0.ɵɵngDeclareComponent({
830
830
  minVersion: "14.0.0",
831
- version: "22.2.5",
831
+ version: "22.2.6",
832
832
  type: WrContextMenuDivider,
833
833
  isStandalone: true,
834
834
  selector: "wr-context-menu-divider",
@@ -847,7 +847,7 @@ var WrContextMenuDivider = class WrContextMenuDivider {
847
847
  };
848
848
  i0.ɵɵngDeclareClassMetadata({
849
849
  minVersion: "12.0.0",
850
- version: "22.2.5",
850
+ version: "22.2.6",
851
851
  ngImport: i0,
852
852
  type: WrContextMenuDivider,
853
853
  decorators: [{
@@ -82,7 +82,7 @@ var WrCookie = class WrCookie {
82
82
  }
83
83
  static ɵfac = i0.ɵɵngDeclareFactory({
84
84
  minVersion: "12.0.0",
85
- version: "22.2.5",
85
+ version: "22.2.6",
86
86
  ngImport: i0,
87
87
  type: WrCookie,
88
88
  deps: [],
@@ -90,14 +90,14 @@ var WrCookie = class WrCookie {
90
90
  });
91
91
  static ɵprov = i0.ɵɵngDeclareService({
92
92
  minVersion: "22.0.0",
93
- version: "22.2.5",
93
+ version: "22.2.6",
94
94
  ngImport: i0,
95
95
  type: WrCookie
96
96
  });
97
97
  };
98
98
  i0.ɵɵngDeclareClassMetadata({
99
99
  minVersion: "12.0.0",
100
- version: "22.2.5",
100
+ version: "22.2.6",
101
101
  ngImport: i0,
102
102
  type: WrCookie,
103
103
  decorators: [{ type: Service }]
@@ -65,7 +65,7 @@ var WrCopyValue = class WrCopyValue {
65
65
  }
66
66
  static ɵfac = i0.ɵɵngDeclareFactory({
67
67
  minVersion: "12.0.0",
68
- version: "22.2.5",
68
+ version: "22.2.6",
69
69
  ngImport: i0,
70
70
  type: WrCopyValue,
71
71
  deps: [],
@@ -73,7 +73,7 @@ var WrCopyValue = class WrCopyValue {
73
73
  });
74
74
  static ɵcmp = i0.ɵɵngDeclareComponent({
75
75
  minVersion: "17.0.0",
76
- version: "22.2.5",
76
+ version: "22.2.6",
77
77
  type: WrCopyValue,
78
78
  isStandalone: true,
79
79
  selector: "wr-copy-value",
@@ -129,7 +129,7 @@ var WrCopyValue = class WrCopyValue {
129
129
  };
130
130
  i0.ɵɵngDeclareClassMetadata({
131
131
  minVersion: "12.0.0",
132
- version: "22.2.5",
132
+ version: "22.2.6",
133
133
  ngImport: i0,
134
134
  type: WrCopyValue,
135
135
  decorators: [{
@@ -124,7 +124,7 @@ var WrCounter = class WrCounter {
124
124
  }
125
125
  static ɵfac = i0.ɵɵngDeclareFactory({
126
126
  minVersion: "12.0.0",
127
- version: "22.2.5",
127
+ version: "22.2.6",
128
128
  ngImport: i0,
129
129
  type: WrCounter,
130
130
  deps: [],
@@ -132,7 +132,7 @@ var WrCounter = class WrCounter {
132
132
  });
133
133
  static ɵcmp = i0.ɵɵngDeclareComponent({
134
134
  minVersion: "17.0.0",
135
- version: "22.2.5",
135
+ version: "22.2.6",
136
136
  type: WrCounter,
137
137
  isStandalone: true,
138
138
  selector: "wr-counter",
@@ -202,7 +202,7 @@ var WrCounter = class WrCounter {
202
202
  };
203
203
  i0.ɵɵngDeclareClassMetadata({
204
204
  minVersion: "12.0.0",
205
- version: "22.2.5",
205
+ version: "22.2.6",
206
206
  ngImport: i0,
207
207
  type: WrCounter,
208
208
  decorators: [{
@@ -439,7 +439,7 @@ var WrCountUp = class WrCountUp {
439
439
  }
440
440
  static ɵfac = i0.ɵɵngDeclareFactory({
441
441
  minVersion: "12.0.0",
442
- version: "22.2.5",
442
+ version: "22.2.6",
443
443
  ngImport: i0,
444
444
  type: WrCountUp,
445
445
  deps: [],
@@ -447,7 +447,7 @@ var WrCountUp = class WrCountUp {
447
447
  });
448
448
  static ɵcmp = i0.ɵɵngDeclareComponent({
449
449
  minVersion: "17.1.0",
450
- version: "22.2.5",
450
+ version: "22.2.6",
451
451
  type: WrCountUp,
452
452
  isStandalone: true,
453
453
  selector: "wr-count-up",
@@ -543,7 +543,7 @@ var WrCountUp = class WrCountUp {
543
543
  };
544
544
  i0.ɵɵngDeclareClassMetadata({
545
545
  minVersion: "12.0.0",
546
- version: "22.2.5",
546
+ version: "22.2.6",
547
547
  ngImport: i0,
548
548
  type: WrCountUp,
549
549
  decorators: [{
@@ -102,6 +102,7 @@ var WrDatePickerHarnessBase = class extends ComponentHarness {
102
102
  async getView() {
103
103
  if (await this.inPanel("[role=\"grid\"]")) return "day";
104
104
  if (await this.inPanel(".wr-calendar__months")) return "month";
105
+ if (await this.inPanel(".wr-calendar__quarters")) return "quarter";
105
106
  if (await this.inPanel(".wr-calendar__years")) return "year";
106
107
  throw new Error(this.noCalendar("getView"));
107
108
  }
@@ -134,6 +135,18 @@ var WrDatePickerHarnessBase = class extends ComponentHarness {
134
135
  if (!chip) throw new Error(`${this.harnessName}.selectMonth(${JSON.stringify(month)}): no such month. Pass a 0-based index, or the label the calendar renders — a short month name in the active locale.`);
135
136
  await chip.click();
136
137
  }
138
+ async selectQuarter(quarter) {
139
+ const chips = await this.allInPanel(".wr-calendar__quarters .wr-calendar__chip");
140
+ if (chips.length === 0) throw new Error(`${this.harnessName}.selectQuarter(): the calendar is not showing its quarter view. Only mode="quarter" has one, and from its year view selectYear() comes back to it.`);
141
+ const chip = chips[quarter - 1];
142
+ if (!chip) throw new Error(`${this.harnessName}.selectQuarter(${quarter}): a year has quarters 1 to 4.`);
143
+ if (await chip.getProperty("disabled")) throw new Error(`${this.harnessName}.selectQuarter(${quarter}): that quarter is disabled: min / max or dateFilter rules out every day in it.`);
144
+ await chip.click();
145
+ }
146
+ async selectWeek(dayOfMonth) {
147
+ if (!await this.inPanel(".wr-calendar--week")) throw new Error(`${this.harnessName}.selectWeek(): the calendar does not pick weeks, that is mode="week". selectDay() picks a day.`);
148
+ await this.selectDay(dayOfMonth);
149
+ }
137
150
  async selectYear(year) {
138
151
  const chips = await this.allInPanel(".wr-calendar__years .wr-calendar__chip");
139
152
  if (chips.length === 0) throw new Error(`${this.harnessName}.selectYear(): the calendar is not showing its year view — call zoomOut() until getView() answers "year".`);
@@ -185,7 +198,7 @@ var WrDatePickerHarnessBase = class extends ComponentHarness {
185
198
  }
186
199
  async requireGrid(method) {
187
200
  if (await this.inPanel("[role=\"grid\"]")) return;
188
- throw new Error(`${this.harnessName}.${method}(): this popup has no day grid. mode="time" renders a time stepper only, and a calendar zoomed out to its month / year view offers chips instead of day cells — selectMonth() / selectYear() come back to the days.`);
201
+ throw new Error(`${this.harnessName}.${method}(): this popup has no day grid. mode="time" renders a time stepper only, and a calendar on its month / quarter / year view offers chips instead of day cells: selectMonth() / selectYear() come back to the days, except in a period mode, which has none.`);
189
202
  }
190
203
  async panel() {
191
204
  return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();
@@ -208,8 +221,14 @@ var WrDatePickerHarness = class WrDatePickerHarness extends WrDatePickerHarnessB
208
221
  harnessName = "WrDatePickerHarness";
209
222
  async getMode() {
210
223
  const host = await this.host();
211
- if (await host.hasClass("wr-date-picker--time")) return "time";
212
- if (await host.hasClass("wr-date-picker--datetime")) return "datetime";
224
+ for (const mode of [
225
+ "time",
226
+ "datetime",
227
+ "week",
228
+ "month",
229
+ "quarter",
230
+ "year"
231
+ ]) if (await host.hasClass(`wr-date-picker--${mode}`)) return mode;
213
232
  return "date";
214
233
  }
215
234
  async getValueText() {
@@ -275,7 +294,14 @@ var WrDateRangePickerHarness = class WrDateRangePickerHarness extends WrDatePick
275
294
  }
276
295
  harnessName = "WrDateRangePickerHarness";
277
296
  async getMode() {
278
- return await (await this.host()).hasClass("wr-date-range-picker--datetime") ? "datetime" : "date";
297
+ const host = await this.host();
298
+ for (const mode of [
299
+ "datetime",
300
+ "month",
301
+ "quarter",
302
+ "year"
303
+ ]) if (await host.hasClass(`wr-date-range-picker--${mode}`)) return mode;
304
+ return "date";
279
305
  }
280
306
  async getStartText() {
281
307
  return (await this.field("start")).getProperty("value");
@@ -326,6 +352,24 @@ var WrDateRangePickerHarness = class WrDateRangePickerHarness extends WrDatePick
326
352
  async toggleMeridiem(end) {
327
353
  await (await this.timePanel(end)).toggleMeridiem();
328
354
  }
355
+ async getPresets() {
356
+ return Promise.all((await this.presetButtons()).map((button) => button.text()));
357
+ }
358
+ async getActivePreset() {
359
+ for (const button of await this.presetButtons()) if (await button.getAttribute("aria-pressed") === "true") return button.text();
360
+ return null;
361
+ }
362
+ async selectPreset(label) {
363
+ const buttons = await this.presetButtons();
364
+ const labels = await Promise.all(buttons.map((button) => button.text()));
365
+ const button = buttons[labels.indexOf(label)];
366
+ if (!button) throw new Error(`${this.harnessName}.selectPreset(${JSON.stringify(label)}): no such preset. The popup shows ${labels.length ? labels.map((shown) => JSON.stringify(shown)).join(", ") : "none"}.`);
367
+ if (await button.getProperty("disabled")) throw new Error(`${this.harnessName}.selectPreset(${JSON.stringify(label)}): the preset is disabled — its range reaches outside minDate / maxDate.`);
368
+ await button.click();
369
+ }
370
+ presetButtons() {
371
+ return this.allInPanel(".wr-date-range-presets__item");
372
+ }
329
373
  async type(end, text) {
330
374
  const field = await this.field(end);
331
375
  await field.clear();