ngwr 16.5.0 → 16.7.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 (450) hide show
  1. package/avatar/styles/_index.scss +39 -0
  2. package/back-top/styles/_index.scss +6 -0
  3. package/breadcrumbs/styles/_rules.scss +34 -0
  4. package/button/styles/_index.scss +45 -2
  5. package/cascader/styles/_rules.scss +7 -0
  6. package/charts/chart-legend/styles/_index.scss +1 -9
  7. package/copy-value/styles/_index.scss +4 -0
  8. package/counter/styles/_index.scss +1 -8
  9. package/date-picker/styles/_index.scss +15 -9
  10. package/dialog/styles/_index.scss +37 -0
  11. package/dropdown/styles/_index.scss +17 -0
  12. package/editor/styles/_index.scss +1 -8
  13. package/event-calendar/styles/_index.scss +2 -6
  14. package/fesm2022/ngwr-affix.mjs +4 -4
  15. package/fesm2022/ngwr-affix.mjs.map +1 -1
  16. package/fesm2022/ngwr-alert.mjs +3 -3
  17. package/fesm2022/ngwr-anchor.mjs +12 -5
  18. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  19. package/fesm2022/ngwr-animations-aurora.mjs +3 -3
  20. package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
  21. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  22. package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
  23. package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
  24. package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
  25. package/fesm2022/ngwr-animations-confetti.mjs +3 -3
  26. package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
  27. package/fesm2022/ngwr-animations-decode.mjs +3 -3
  28. package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
  29. package/fesm2022/ngwr-animations-destruct.mjs +3 -3
  30. package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
  31. package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
  32. package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
  33. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  34. package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
  35. package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
  36. package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
  37. package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
  38. package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
  39. package/fesm2022/ngwr-animations-glitch.mjs +3 -3
  40. package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
  41. package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
  42. package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
  43. package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
  44. package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
  45. package/fesm2022/ngwr-animations-marquee.mjs +4 -3
  46. package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
  47. package/fesm2022/ngwr-animations-orbit.mjs +3 -3
  48. package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
  49. package/fesm2022/ngwr-animations-reveal.mjs +3 -3
  50. package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
  51. package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
  52. package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
  53. package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
  54. package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
  55. package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
  56. package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
  57. package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
  58. package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
  59. package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
  60. package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
  61. package/fesm2022/ngwr-animations-tilt.mjs +23 -16
  62. package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
  63. package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
  64. package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
  65. package/fesm2022/ngwr-avatar.mjs +171 -6
  66. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  67. package/fesm2022/ngwr-back-top.mjs +3 -3
  68. package/fesm2022/ngwr-badge.mjs +6 -6
  69. package/fesm2022/ngwr-breadcrumbs.mjs +47 -13
  70. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  71. package/fesm2022/ngwr-burger.mjs +3 -3
  72. package/fesm2022/ngwr-button.mjs +38 -9
  73. package/fesm2022/ngwr-button.mjs.map +1 -1
  74. package/fesm2022/ngwr-calendar.mjs +3 -3
  75. package/fesm2022/ngwr-card.mjs +9 -9
  76. package/fesm2022/ngwr-carousel.mjs +14 -8
  77. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  78. package/fesm2022/ngwr-cascader.mjs +27 -7
  79. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
  81. package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
  82. package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
  83. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
  84. package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
  85. package/fesm2022/ngwr-charts-chart-legend.mjs +9 -9
  86. package/fesm2022/ngwr-charts-core.mjs +18 -11
  87. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
  89. package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
  90. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  91. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  92. package/fesm2022/ngwr-charts-line-chart.mjs +3 -3
  93. package/fesm2022/ngwr-charts-meter-group.mjs +7 -5
  94. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  95. package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
  96. package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
  97. package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
  98. package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
  99. package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
  100. package/fesm2022/ngwr-checkbox.mjs +9 -8
  101. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  102. package/fesm2022/ngwr-clipboard.mjs +3 -3
  103. package/fesm2022/ngwr-collapse.mjs +9 -9
  104. package/fesm2022/ngwr-color-picker.mjs +27 -7
  105. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  106. package/fesm2022/ngwr-command-palette.mjs +3 -3
  107. package/fesm2022/ngwr-comment.mjs +7 -6
  108. package/fesm2022/ngwr-comment.mjs.map +1 -1
  109. package/fesm2022/ngwr-compare.mjs +3 -3
  110. package/fesm2022/ngwr-context-menu.mjs +16 -17
  111. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  112. package/fesm2022/ngwr-cookie.mjs +3 -3
  113. package/fesm2022/ngwr-copy-value.mjs +3 -3
  114. package/fesm2022/ngwr-counter.mjs +6 -6
  115. package/fesm2022/ngwr-date-picker-testing.mjs +35 -0
  116. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  117. package/fesm2022/ngwr-date-picker.mjs +151 -54
  118. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  119. package/fesm2022/ngwr-date-stamp.mjs +3 -3
  120. package/fesm2022/ngwr-date.mjs +40 -16
  121. package/fesm2022/ngwr-date.mjs.map +1 -1
  122. package/fesm2022/ngwr-density.mjs +6 -6
  123. package/fesm2022/ngwr-descriptions.mjs +6 -6
  124. package/fesm2022/ngwr-dialog.mjs +35 -24
  125. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  126. package/fesm2022/ngwr-directives.mjs +189 -23
  127. package/fesm2022/ngwr-directives.mjs.map +1 -1
  128. package/fesm2022/ngwr-divider.mjs +3 -3
  129. package/fesm2022/ngwr-drawer.mjs +18 -18
  130. package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
  131. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  132. package/fesm2022/ngwr-dropdown.mjs +59 -16
  133. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  134. package/fesm2022/ngwr-editor.mjs +6 -5
  135. package/fesm2022/ngwr-editor.mjs.map +1 -1
  136. package/fesm2022/ngwr-empty.mjs +3 -3
  137. package/fesm2022/ngwr-event-calendar.mjs +27 -15
  138. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  139. package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
  140. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-file-upload.mjs +68 -13
  142. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  143. package/fesm2022/ngwr-form.mjs +181 -12
  144. package/fesm2022/ngwr-form.mjs.map +1 -1
  145. package/fesm2022/ngwr-graph-testing.mjs +30 -0
  146. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  147. package/fesm2022/ngwr-graph.mjs +100 -11
  148. package/fesm2022/ngwr-graph.mjs.map +1 -1
  149. package/fesm2022/ngwr-hotkey.mjs +6 -6
  150. package/fesm2022/ngwr-i18n-ar.mjs +21 -2
  151. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-cs.mjs +21 -2
  153. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-de.mjs +21 -2
  155. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-en.mjs +21 -2
  157. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-es.mjs +21 -2
  159. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  160. package/fesm2022/ngwr-i18n-fr.mjs +21 -2
  161. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  162. package/fesm2022/ngwr-i18n-he.mjs +21 -2
  163. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  164. package/fesm2022/ngwr-i18n-hi.mjs +21 -2
  165. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-id.mjs +21 -2
  167. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-it.mjs +21 -2
  169. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-ja.mjs +21 -2
  171. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-kk.mjs +520 -0
  173. package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
  174. package/fesm2022/ngwr-i18n-ko.mjs +21 -2
  175. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-nl.mjs +21 -2
  177. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n-pl.mjs +21 -2
  179. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  180. package/fesm2022/ngwr-i18n-pt.mjs +21 -2
  181. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  182. package/fesm2022/ngwr-i18n-ru.mjs +21 -2
  183. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  184. package/fesm2022/ngwr-i18n-sv.mjs +21 -2
  185. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  186. package/fesm2022/ngwr-i18n-tr.mjs +21 -2
  187. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  188. package/fesm2022/ngwr-i18n-uk.mjs +21 -2
  189. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  190. package/fesm2022/ngwr-i18n-vi.mjs +21 -2
  191. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  192. package/fesm2022/ngwr-i18n-zh-tw.mjs +21 -2
  193. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  194. package/fesm2022/ngwr-i18n-zh.mjs +21 -2
  195. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  196. package/fesm2022/ngwr-i18n.mjs +91 -20
  197. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  198. package/fesm2022/ngwr-icon.mjs +6 -6
  199. package/fesm2022/ngwr-image-cropper.mjs +8 -4
  200. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  201. package/fesm2022/ngwr-input-number.mjs +27 -4
  202. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  203. package/fesm2022/ngwr-input-otp.mjs +5 -5
  204. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  205. package/fesm2022/ngwr-input.mjs +25 -17
  206. package/fesm2022/ngwr-input.mjs.map +1 -1
  207. package/fesm2022/ngwr-keyboard.mjs +3 -3
  208. package/fesm2022/ngwr-knob.mjs +3 -3
  209. package/fesm2022/ngwr-layout.mjs +15 -15
  210. package/fesm2022/ngwr-layout.mjs.map +1 -1
  211. package/fesm2022/ngwr-lightbox.mjs +8 -8
  212. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  213. package/fesm2022/ngwr-list.mjs +9 -9
  214. package/fesm2022/ngwr-list.mjs.map +1 -1
  215. package/fesm2022/ngwr-load-state.mjs +16 -15
  216. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  217. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  218. package/fesm2022/ngwr-loading-bar.mjs +8 -8
  219. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  220. package/fesm2022/ngwr-mention.mjs +14 -6
  221. package/fesm2022/ngwr-mention.mjs.map +1 -1
  222. package/fesm2022/ngwr-meta.mjs +15 -12
  223. package/fesm2022/ngwr-meta.mjs.map +1 -1
  224. package/fesm2022/ngwr-overlay.mjs +9 -9
  225. package/fesm2022/ngwr-page-header.mjs +24 -3
  226. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  227. package/fesm2022/ngwr-pagination-testing.mjs +3 -0
  228. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  229. package/fesm2022/ngwr-pagination.mjs +34 -5
  230. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  231. package/fesm2022/ngwr-pipes.mjs +35 -28
  232. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  233. package/fesm2022/ngwr-platform.mjs +9 -9
  234. package/fesm2022/ngwr-popconfirm.mjs +9 -7
  235. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  236. package/fesm2022/ngwr-popover.mjs +162 -18
  237. package/fesm2022/ngwr-popover.mjs.map +1 -1
  238. package/fesm2022/ngwr-progress.mjs +75 -10
  239. package/fesm2022/ngwr-progress.mjs.map +1 -1
  240. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  241. package/fesm2022/ngwr-qr.mjs +9 -5
  242. package/fesm2022/ngwr-qr.mjs.map +1 -1
  243. package/fesm2022/ngwr-radio.mjs +77 -11
  244. package/fesm2022/ngwr-radio.mjs.map +1 -1
  245. package/fesm2022/ngwr-rating.mjs +3 -3
  246. package/fesm2022/ngwr-resizable.mjs +3 -3
  247. package/fesm2022/ngwr-result.mjs +12 -12
  248. package/fesm2022/ngwr-schema-form.mjs +20 -7
  249. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  250. package/fesm2022/ngwr-scroll.mjs +233 -10
  251. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  252. package/fesm2022/ngwr-segmented.mjs +23 -3
  253. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  254. package/fesm2022/ngwr-select.mjs +106 -26
  255. package/fesm2022/ngwr-select.mjs.map +1 -1
  256. package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
  257. package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
  258. package/fesm2022/ngwr-sidebar.mjs +66 -11
  259. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  260. package/fesm2022/ngwr-skeleton.mjs +3 -3
  261. package/fesm2022/ngwr-slider.mjs +3 -3
  262. package/fesm2022/ngwr-sortable-list.mjs +27 -15
  263. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  264. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  265. package/fesm2022/ngwr-spinner.mjs +3 -3
  266. package/fesm2022/ngwr-splitter.mjs +3 -3
  267. package/fesm2022/ngwr-statistic.mjs +9 -9
  268. package/fesm2022/ngwr-stepper.mjs +6 -6
  269. package/fesm2022/ngwr-storage.mjs +4 -4
  270. package/fesm2022/ngwr-storage.mjs.map +1 -1
  271. package/fesm2022/ngwr-switch.mjs +5 -5
  272. package/fesm2022/ngwr-switch.mjs.map +1 -1
  273. package/fesm2022/ngwr-table-router.mjs +89 -0
  274. package/fesm2022/ngwr-table-router.mjs.map +1 -0
  275. package/fesm2022/ngwr-table-testing.mjs +5 -0
  276. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  277. package/fesm2022/ngwr-table.mjs +307 -47
  278. package/fesm2022/ngwr-table.mjs.map +1 -1
  279. package/fesm2022/ngwr-tabs-router.mjs +9 -5
  280. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  281. package/fesm2022/ngwr-tabs-testing.mjs +8 -1
  282. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  283. package/fesm2022/ngwr-tabs.mjs +60 -10
  284. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  285. package/fesm2022/ngwr-textarea.mjs +5 -5
  286. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  287. package/fesm2022/ngwr-theme.mjs +3 -3
  288. package/fesm2022/ngwr-timeline.mjs +6 -6
  289. package/fesm2022/ngwr-toast.mjs +43 -15
  290. package/fesm2022/ngwr-toast.mjs.map +1 -1
  291. package/fesm2022/ngwr-toolbar.mjs +3 -3
  292. package/fesm2022/ngwr-tour.mjs +9 -8
  293. package/fesm2022/ngwr-tour.mjs.map +1 -1
  294. package/fesm2022/ngwr-transfer.mjs +4 -3
  295. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  296. package/fesm2022/ngwr-tree.mjs +3 -3
  297. package/fesm2022/ngwr-typography.mjs +23 -3
  298. package/fesm2022/ngwr-typography.mjs.map +1 -1
  299. package/fesm2022/ngwr-utils-router.mjs +3 -3
  300. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  301. package/fesm2022/ngwr-utils.mjs +74 -4
  302. package/fesm2022/ngwr-utils.mjs.map +1 -1
  303. package/fesm2022/ngwr-validators.mjs +33 -1
  304. package/fesm2022/ngwr-validators.mjs.map +1 -1
  305. package/fesm2022/ngwr-version.mjs +1 -1
  306. package/fesm2022/ngwr-version.mjs.map +1 -1
  307. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  308. package/fesm2022/ngwr-window.mjs +18 -13
  309. package/fesm2022/ngwr-window.mjs.map +1 -1
  310. package/file-upload/styles/_index.scss +16 -0
  311. package/form/styles/_index.scss +37 -0
  312. package/graph/styles/_index.scss +49 -9
  313. package/i18n/ar.json +19 -2
  314. package/i18n/cs.json +19 -2
  315. package/i18n/de.json +19 -2
  316. package/i18n/en.json +19 -2
  317. package/i18n/es.json +19 -2
  318. package/i18n/fr.json +19 -2
  319. package/i18n/he.json +19 -2
  320. package/i18n/hi.json +19 -2
  321. package/i18n/id.json +19 -2
  322. package/i18n/it.json +19 -2
  323. package/i18n/ja.json +19 -2
  324. package/i18n/kk.json +567 -0
  325. package/i18n/ko.json +19 -2
  326. package/i18n/nl.json +19 -2
  327. package/i18n/pl.json +19 -2
  328. package/i18n/pt.json +19 -2
  329. package/i18n/ru.json +19 -2
  330. package/i18n/sv.json +19 -2
  331. package/i18n/tr.json +19 -2
  332. package/i18n/uk.json +19 -2
  333. package/i18n/vi.json +19 -2
  334. package/i18n/zh-TW.json +19 -2
  335. package/i18n/zh.json +19 -2
  336. package/image-cropper/styles/_index.scss +1 -9
  337. package/input-number/styles/_index.scss +7 -0
  338. package/layout/styles/_index.scss +13 -1
  339. package/llms-full.txt +37 -26
  340. package/llms.txt +4 -1
  341. package/loading-bar/styles/_rules.scss +6 -0
  342. package/package.json +16 -8
  343. package/page-header/styles/_index.scss +18 -0
  344. package/pagination/styles/_index.scss +6 -0
  345. package/popover/styles/_index.scss +9 -0
  346. package/progress/styles/_index.scss +64 -0
  347. package/schematics/use/symbol-map.json +7 -0
  348. package/segmented/styles/_index.scss +7 -0
  349. package/select/styles/_index.scss +7 -0
  350. package/sidebar/styles/_index.scss +64 -6
  351. package/skills/ngwr/SKILL.md +7 -6
  352. package/skills/ngwr/references/catalog.md +7 -5
  353. package/sortable-list/styles/_rules.scss +1 -9
  354. package/speed-dial/styles/_index.scss +6 -0
  355. package/stepper/styles/_index.scss +1 -9
  356. package/table/styles/_index.scss +168 -30
  357. package/tabs/styles/_index.scss +9 -0
  358. package/theme/_index.scss +12 -1
  359. package/theme/styles/_colors.scss +11 -0
  360. package/theme/styles/_contrast.scss +6 -0
  361. package/theme/styles/_focus.scss +3 -1
  362. package/theme/styles/_index.scss +1 -0
  363. package/theme/styles/_mixins.scss +45 -0
  364. package/theme/styles/_print.scss +17 -0
  365. package/toast/styles/_index.scss +7 -0
  366. package/tour/styles/_index.scss +9 -0
  367. package/tree/styles/_index.scss +1 -9
  368. package/types/ngwr-anchor.d.ts +3 -0
  369. package/types/ngwr-animations-aurora.d.ts +6 -0
  370. package/types/ngwr-animations-blur-reveal.d.ts +6 -0
  371. package/types/ngwr-animations-click-sparks.d.ts +6 -0
  372. package/types/ngwr-animations-confetti.d.ts +6 -0
  373. package/types/ngwr-animations-decode.d.ts +6 -0
  374. package/types/ngwr-animations-destruct.d.ts +6 -0
  375. package/types/ngwr-animations-dot-grid.d.ts +6 -0
  376. package/types/ngwr-animations-falling-letters.d.ts +6 -0
  377. package/types/ngwr-animations-flow-lines.d.ts +6 -0
  378. package/types/ngwr-animations-fluid-cursor.d.ts +6 -0
  379. package/types/ngwr-animations-glitch.d.ts +6 -0
  380. package/types/ngwr-animations-glow-border.d.ts +6 -0
  381. package/types/ngwr-animations-gradient-flow.d.ts +6 -0
  382. package/types/ngwr-animations-marquee.d.ts +6 -0
  383. package/types/ngwr-animations-orbit.d.ts +6 -0
  384. package/types/ngwr-animations-reveal.d.ts +6 -0
  385. package/types/ngwr-animations-ripple-grid.d.ts +6 -0
  386. package/types/ngwr-animations-rotate-reveal.d.ts +6 -0
  387. package/types/ngwr-animations-shimmer.d.ts +6 -0
  388. package/types/ngwr-animations-spotlight.d.ts +6 -0
  389. package/types/ngwr-animations-thread-lines.d.ts +6 -0
  390. package/types/ngwr-animations-tilt.d.ts +10 -0
  391. package/types/ngwr-animations-typewriter.d.ts +6 -0
  392. package/types/ngwr-avatar.d.ts +39 -0
  393. package/types/ngwr-breadcrumbs.d.ts +25 -0
  394. package/types/ngwr-button.d.ts +35 -3
  395. package/types/ngwr-carousel.d.ts +2 -0
  396. package/types/ngwr-cascader.d.ts +7 -0
  397. package/types/ngwr-charts-core.d.ts +16 -0
  398. package/types/ngwr-charts-meter-group.d.ts +2 -0
  399. package/types/ngwr-checkbox.d.ts +1 -0
  400. package/types/ngwr-color-picker.d.ts +1 -0
  401. package/types/ngwr-context-menu.d.ts +1 -1
  402. package/types/ngwr-date-picker-testing.d.ts +22 -0
  403. package/types/ngwr-date-picker.d.ts +97 -17
  404. package/types/ngwr-date.d.ts +51 -0
  405. package/types/ngwr-dialog.d.ts +39 -8
  406. package/types/ngwr-directives.d.ts +57 -4
  407. package/types/ngwr-drawer.d.ts +1 -1
  408. package/types/ngwr-dropdown-testing.d.ts +8 -1
  409. package/types/ngwr-dropdown.d.ts +30 -1
  410. package/types/ngwr-event-calendar.d.ts +4 -0
  411. package/types/ngwr-file-upload-testing.d.ts +10 -0
  412. package/types/ngwr-file-upload.d.ts +55 -1
  413. package/types/ngwr-form.d.ts +87 -1
  414. package/types/ngwr-graph-testing.d.ts +28 -1
  415. package/types/ngwr-graph.d.ts +53 -3
  416. package/types/ngwr-i18n-kk.d.ts +3 -0
  417. package/types/ngwr-i18n.d.ts +65 -5
  418. package/types/ngwr-image-cropper.d.ts +6 -0
  419. package/types/ngwr-input-number.d.ts +8 -0
  420. package/types/ngwr-input.d.ts +7 -0
  421. package/types/ngwr-layout.d.ts +1 -1
  422. package/types/ngwr-loading-bar-router.d.ts +6 -0
  423. package/types/ngwr-page-header.d.ts +23 -1
  424. package/types/ngwr-pagination-testing.d.ts +8 -0
  425. package/types/ngwr-pagination.d.ts +16 -0
  426. package/types/ngwr-popconfirm.d.ts +1 -1
  427. package/types/ngwr-popover.d.ts +67 -4
  428. package/types/ngwr-progress.d.ts +63 -1
  429. package/types/ngwr-radio.d.ts +47 -5
  430. package/types/ngwr-scroll.d.ts +86 -0
  431. package/types/ngwr-segmented.d.ts +7 -0
  432. package/types/ngwr-select.d.ts +88 -25
  433. package/types/ngwr-sidebar-testing.d.ts +21 -7
  434. package/types/ngwr-sidebar.d.ts +66 -4
  435. package/types/ngwr-sortable-list.d.ts +20 -7
  436. package/types/ngwr-table-router.d.ts +49 -0
  437. package/types/ngwr-table-testing.d.ts +7 -0
  438. package/types/ngwr-table.d.ts +241 -10
  439. package/types/ngwr-tabs-router.d.ts +7 -1
  440. package/types/ngwr-tabs-testing.d.ts +5 -1
  441. package/types/ngwr-tabs.d.ts +34 -1
  442. package/types/ngwr-toast.d.ts +11 -0
  443. package/types/ngwr-tour.d.ts +0 -1
  444. package/types/ngwr-typography.d.ts +7 -0
  445. package/types/ngwr-utils-router.d.ts +6 -0
  446. package/types/ngwr-utils.d.ts +69 -2
  447. package/types/ngwr-validators.d.ts +49 -1
  448. package/types/ngwr-version.d.ts +1 -1
  449. package/typography/styles/_index.scss +4 -0
  450. package/window/styles/_index.scss +1 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-file-upload.mjs","names":[],"sources":["../../../projects/lib/file-upload/file-upload.ts","../../../projects/lib/file-upload/file-upload.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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n LOCALE_ID,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrProgress } from 'ngwr/progress';\nimport { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport type {\n WrFileUploadRejection,\n WrFileUploadRejectionReason,\n WrFileUploadSize,\n WrFileUploadState,\n WrFileUploadStatusMap,\n} from './types';\n\n/** One list row: the file, what `[status]` says about it and its thumbnail. */\ninterface FileRow {\n readonly file: File;\n readonly classes: string;\n readonly state: WrFileUploadState | null;\n readonly percent: number | null;\n readonly message: string | null;\n readonly preview: string | null;\n}\n\n/** Does `file` match the `accept` attribute (extensions or MIME globs)? */\nfunction matchesAccept(file: File, accept: string): boolean {\n if (!accept) return true;\n const tokens = accept\n .split(',')\n .map(t => t.trim().toLowerCase())\n .filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const mime = file.type.toLowerCase();\n return tokens.some(token => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return mime.startsWith(token.slice(0, -1));\n return mime === token;\n });\n}\n\n/**\n * Drag-and-drop file upload zone. Click to browse, drag-and-drop to add,\n * with an optional file list + remove buttons.\n *\n * A signal-forms native control: it implements\n * `FormValueControl<File | readonly File[] | null>`, so `[formField]` binds\n * straight to its `value` model — no `ControlValueAccessor` in between.\n * `[(value)]` works standalone. The value shape follows `multiple`: a single\n * `File` (or `null`), or a `File[]` array.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-file-upload [formField]=\"form.files\" [multiple]=\"true\" accept=\"image/*\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-file-upload [(value)]=\"avatar\" accept=\".png,.jpg\" [maxSize]=\"2 * 1024 * 1024\" />\n * ```\n *\n * The component does no HTTP. The app uploads, and tells the list where each\n * file stands through `[status]`, a `Map` keyed by the `File` objects in `value`:\n *\n * ```html\n * <wr-file-upload [(value)]=\"files\" multiple [status]=\"statuses()\" (retry)=\"upload($event)\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/file-upload\n */\n@Component({\n selector: 'wr-file-upload',\n templateUrl: './file-upload.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-file-upload', '[class]': 'classes()' },\n imports: [WrButton, WrProgress],\n})\nexport class WrFileUpload implements FormValueControl<File | readonly File[] | null> {\n /** Allow multiple files. Single mode replaces on each add. @default false */\n readonly multiple = input(false, { transform: coerceBooleanProperty });\n\n /** `accept` attribute — comma-separated MIME types or extensions. @default '' */\n readonly accept = input<string>('');\n\n /**\n * Control size: the drop zone's padding, icon and text, and the list rows.\n *\n * @default 'md'\n */\n readonly size = input<WrFileUploadSize>('md');\n\n /** Max bytes per file. `0` disables the check. @default 0 */\n readonly maxSize = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Max files (multi mode only). `0` disables the check. @default 0 */\n readonly maxFiles = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Render the picked-files list below the zone. @default true */\n readonly showList = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Disable interaction. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes to the selection while the zone stays focusable and the files\n * still submit. Bound automatically from the field's readonly state when used\n * with `[formField]`.\n *\n * The zone stops opening the picker, a drop is refused and the per-file remove\n * buttons go inert — but the list stays readable, which is the point. No\n * `aria-readonly`: the zone is a `role=\"button\"`, and ARIA does not define the\n * state for that role, so `aria-disabled` would be the only mirror available\n * and it would say the wrong thing.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Where the app's upload of each file stands, keyed by the `File` objects in\n * `value`. A row with an entry draws its state: a progress bar while\n * `uploading` (indeterminate without a `percent`), a mark when `done`, the\n * `message` and a retry button on `error`. A file with no entry is a plain row.\n *\n * Pass a new `Map` on each change: an input sees a new reference, not a `set()`\n * on the one it already holds. `null` (the default) renders nothing extra.\n *\n * @default null\n */\n readonly status = input<WrFileUploadStatusMap | null>(null);\n\n /**\n * Show a thumbnail beside each image file. The thumbnail is an object URL,\n * revoked when its file leaves the list or the component is destroyed. Browser\n * only: nothing is created on the server.\n *\n * @default false\n */\n readonly previews = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Take files pasted with Ctrl/Cmd+V while the drop zone has focus. They go\n * through the same `accept`, `maxSize` and `maxFiles` rules as a drop. A paste\n * that carries no file is left alone.\n *\n * @default false\n */\n readonly acceptPaste = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** id of the zone's visible copy, which names it. @internal */\n protected readonly hintId = wrRandomId('wr-file-upload-hint');\n\n /**\n * The zone's name, as `aria-labelledby`: the field's label when a\n * `<wr-form-field>` wraps it, then the zone's own visible copy.\n *\n * The zone is a `div[role=\"button\"]`, so `<wr-form-field>`'s `<label for>`\n * cannot reach it, and `aria-labelledby` is the direction that works for a\n * role. The visible copy is always part of the name (WCAG 2.5.3, Label in\n * Name): a speech-input user says what they see, and a name without it leaves\n * \"Click to browse\" matching nothing. `null` while `dropZoneLabel` overrides.\n */\n protected readonly labelledBy = computed(() =>\n this.dropZoneLabel() ? null : [this.fieldAria.labelledBy(), this.hintId].filter(Boolean).join(' ')\n );\n\n /** The `dropZoneLabel` override, or `null` so the visible copy names the zone. */\n protected readonly zoneName = computed(() => {\n const label = this.dropZoneLabel();\n return label === '' ? null : label;\n });\n\n /** Primary call-to-action label. Falls back to `fileUpload.browse`. */\n readonly pickLabel = input<string | null>(null);\n\n /** Secondary instruction below the CTA. Falls back to `fileUpload.dropZone`. */\n readonly dropLabel = input<string | null>(null);\n\n /**\n * Overrides the drop zone's accessible name. Unset, the zone is named by its\n * visible copy, after the field's label inside a `<wr-form-field>`. An\n * override must contain that copy, or speech input cannot reach the control\n * (WCAG 2.5.3).\n */\n readonly dropZoneLabel = input<string | null>(null);\n\n /**\n * Name of each row's remove button. `{{name}}` is the row's file name, so the\n * buttons of a list are told apart. Falls back to `fileUpload.removeFile`,\n * \"Remove {{name}}\" in English.\n */\n readonly removeFileLabel = input<string | null>(null);\n\n /** Retry button text on a failed row. Falls back to `fileUpload.retry`. */\n readonly retryLabel = input<string | null>(null);\n\n /** Name of the `uploading` state: the progress bar's name and the announcement. Falls back to `fileUpload.uploading`. */\n readonly uploadingLabel = input<string | null>(null);\n\n /** Name of the `done` state: the mark's name and the announcement. Falls back to `fileUpload.uploaded`. */\n readonly uploadedLabel = input<string | null>(null);\n\n /** Text of a failed row whose status carries no `message`. Falls back to `fileUpload.failed`. */\n readonly failedLabel = input<string | null>(null);\n\n protected readonly resolvedPick = useI18nText(this.pickLabel, 'fileUpload.browse', 'Click to browse');\n protected readonly resolvedDrop = useI18nText(this.dropLabel, 'fileUpload.dropZone', 'or drop files here');\n private readonly removeText = useI18nFormatter('fileUpload.removeFile', 'Remove {{name}}');\n\n /** The remove button of one row, named after its file. */\n protected removeName(name: string): string {\n const given = this.removeFileLabel();\n return given ? given.replace(/\\{\\{\\s*name\\s*\\}\\}/g, () => name) : this.removeText({ name });\n }\n\n protected readonly resolvedRetry = useI18nText(this.retryLabel, 'fileUpload.retry', 'Try again');\n protected readonly resolvedUploading = useI18nText(this.uploadingLabel, 'fileUpload.uploading', 'Uploading');\n protected readonly resolvedUploaded = useI18nText(this.uploadedLabel, 'fileUpload.uploaded', 'Uploaded');\n protected readonly resolvedFailed = useI18nText(this.failedLabel, 'fileUpload.failed', 'Upload failed');\n\n /** `{{name}}: {{status}}`: a state said about one file. */\n protected readonly statusText = useI18nFormatter('fileUpload.status', '{{name}}: {{status}}');\n\n /** Optional helper text shown below the labels (e.g. accepted formats). */\n readonly helperText = input<string>('');\n\n /**\n * Selected file(s). Bound by `[formField]`, or two-way via `[(value)]`. Shape\n * follows `multiple`: a single `File` (or `null`), or a `File[]` array.\n */\n readonly value = model<File | readonly File[] | null>(null);\n\n /** Emitted when files are rejected for type / size / count reasons. */\n readonly rejected = output<readonly WrFileUploadRejection[]>();\n\n /** Emitted with the file when the retry button of a failed row is pressed. */\n readonly retry = output<File>();\n\n /** Emitted on commit so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n protected readonly picker = viewChild.required<ElementRef<HTMLInputElement>>('picker');\n private readonly zone = viewChild.required<ElementRef<HTMLElement>>('zone');\n\n protected readonly files = signal<readonly File[]>([]);\n protected readonly dragging = signal(false);\n\n /**\n * How many elements of the zone the drag is inside. The browser fires `dragleave`\n * on the zone when the pointer moves onto its own label or icon, with `dragenter`\n * on the child just before it, so \"left the zone\" read off a single event switched\n * the highlight off over the zone's text and back on over its padding. Every enter\n * counts up and every leave down; the drag has left when the count is back to 0.\n */\n private dragDepth = 0;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** id prefix of the file names, which describe each row's retry button. @internal */\n protected readonly nameId = wrRandomId('wr-file-upload-name');\n\n /** The object URL of each previewed image file. */\n private readonly previewUrls = signal<ReadonlyMap<File, string>>(new Map());\n\n protected readonly rows = computed<readonly FileRow[]>(() => {\n const status = this.status();\n const urls = this.previewUrls();\n return this.files().map(file => {\n const entry = status?.get(file);\n const percent = entry?.state === 'uploading' ? entry.percent : null;\n const state = entry?.state ?? null;\n return {\n file,\n classes: state ? `wr-file-upload__item wr-file-upload__item--${state}` : 'wr-file-upload__item',\n state,\n percent: typeof percent === 'number' && Number.isFinite(percent) ? percent : null,\n message: entry?.state === 'error' && entry.message ? entry.message : null,\n preview: urls.get(file) ?? null,\n };\n });\n });\n\n /** `aria-busy` on the list: at least one file is uploading. */\n protected readonly busy = computed(() => this.rows().some(row => row.state === 'uploading'));\n\n /** What the one live region says: the states that changed in the last `[status]` write. */\n protected readonly announcement = signal('');\n\n /** The state each file had at the last `[status]` write, to tell a change from a percent tick. */\n private lastStates: ReadonlyMap<File, WrFileUploadState> | null = null;\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-file-upload--${size}`);\n if (this.dragging()) parts.push('wr-file-upload--dragging');\n if (this.disabled()) parts.push('wr-file-upload--disabled');\n else if (this.readonly()) parts.push('wr-file-upload--readonly');\n return parts.join(' ');\n });\n\n /**\n * Human-readable file size (e.g. `1.2 MB`).\n *\n * Every piece of this used to be English and unreachable: a module-level unit\n * table with no catalog key, and `toFixed()`, which writes an ASCII decimal\n * point whatever `LOCALE_ID` says. A Russian page showed translated drop-zone\n * copy above `3.4 KB`. The number now goes through `Intl.NumberFormat` and the\n * unit through the catalog, joined by a template the catalog also owns — so a\n * locale controls the separator, the digits and whether a space sits before\n * the unit.\n *\n * Not a `computed`: it is called per file, with the file's size as its\n * argument. It still re-runs on a locale switch, because the formatters it\n * calls are signals read during the same change detection that renders the row.\n */\n protected formatBytes(bytes: number): string {\n if (!Number.isFinite(bytes) || bytes <= 0) {\n return this.sizeText({ value: this.number(0, 0), unit: this.unitTexts[0]() });\n }\n const i = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), this.unitTexts.length - 1);\n const v = bytes / 1024 ** i;\n const digits = v >= 100 || i === 0 ? 0 : 1;\n return this.sizeText({ value: this.number(v, digits), unit: this.unitTexts[i]() });\n }\n\n /** `{{value}} {{unit}}` — the join, so a locale owns the space too. */\n private readonly sizeText = useI18nFormatter('fileUpload.size', '{{value}} {{unit}}');\n\n /**\n * One resolved signal per binary unit, indexed by the power of 1024 the\n * arithmetic lands on.\n *\n * Spelled out rather than built from a key list: `i18n.spec.ts` reads every\n * catalog key the library asks for out of the SOURCE, by matching a quoted\n * dotted string inside the call, so a key built by interpolation is invisible\n * to it. That spec fails rather than passing quietly, but either way the key\n * would stop being checked.\n */\n private readonly unitTexts = [\n wrReadI18nText('fileUpload.unitByte', 'B'),\n wrReadI18nText('fileUpload.unitKb', 'KB'),\n wrReadI18nText('fileUpload.unitMb', 'MB'),\n wrReadI18nText('fileUpload.unitGb', 'GB'),\n wrReadI18nText('fileUpload.unitTb', 'TB'),\n ] as const;\n\n private readonly locale = inject(LOCALE_ID);\n\n private number(value: number, digits: number): string {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n }).format(value);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('file-upload');\n // Rebuild the internal file list from an external `value` write (mirrors the\n // old `writeValue`). Skipped when the value is merely the echo of an\n // in-component edit, so re-syncing can never clobber a live selection.\n effect(() => {\n const v = this.value();\n untracked(() => {\n // Coerce null/undefined to `[]` — a classic-forms binding can write\n // null, which the old `writeValue(v: … | null)` accepted too.\n const next: readonly File[] = v === null || v === undefined ? [] : Array.isArray(v) ? v : [v as File];\n const current = this.files();\n if (current.length === next.length && current.every((file, i) => file === next[i])) return;\n this.files.set(next);\n });\n });\n\n effect(() => {\n const rows = this.status() === null ? null : this.rows();\n untracked(() => this.announce(rows));\n });\n\n effect(() => {\n const images = this.previews() && this.browser ? this.files().filter(file => file.type.startsWith('image/')) : [];\n untracked(() => this.syncPreviews(images));\n });\n inject(DestroyRef).onDestroy(() => this.syncPreviews([]));\n }\n\n /**\n * Focus the drop zone — what Signal Forms calls to focus this control, from\n * `focusBoundControl()`. The zone is the control: the real file input beside\n * it is hidden and out of the tab order, and the host has no tab stop. A\n * read-only zone still takes it; a disabled one is left alone, as a disabled\n * native control refuses the same call.\n */\n focus(options?: FocusOptions): void {\n if (!this.disabled()) this.zone().nativeElement.focus(options);\n }\n\n // Template handlers\n\n protected openPicker(): void {\n if (this.disabled() || this.readonly()) return;\n this.picker().nativeElement.click();\n }\n\n protected onZoneKey(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.openPicker();\n }\n }\n\n protected onPickerChange(event: Event): void {\n const target = event.target as HTMLInputElement;\n if (target.files) this.acceptFiles(Array.from(target.files));\n // Reset so picking the same file twice re-fires `change`.\n target.value = '';\n }\n\n protected onDragEnter(event: DragEvent): void {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n this.dragDepth++;\n this.dragging.set(true);\n }\n\n protected onDragOver(event: DragEvent): void {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n }\n\n protected onDragLeave(): void {\n // See `dragDepth`: a leave onto one of the zone's own children is not leaving.\n this.dragDepth = Math.max(0, this.dragDepth - 1);\n if (this.dragDepth === 0) this.dragging.set(false);\n }\n\n protected onDrop(event: DragEvent): void {\n event.preventDefault();\n this.dragDepth = 0;\n this.dragging.set(false);\n if (this.disabled() || this.readonly()) return;\n const dropped = event.dataTransfer?.files ? Array.from(event.dataTransfer.files) : [];\n if (dropped.length > 0) this.acceptFiles(dropped);\n }\n\n protected onPaste(event: ClipboardEvent): void {\n if (!this.acceptPaste() || this.disabled() || this.readonly()) return;\n const pasted = event.clipboardData?.files ? Array.from(event.clipboardData.files) : [];\n if (pasted.length === 0) return;\n event.preventDefault();\n this.acceptFiles(pasted);\n }\n\n protected onRetry(file: File, index: number): void {\n if (this.disabled()) return;\n const button = this.host.nativeElement.ownerDocument.activeElement;\n const hadFocus = !!button?.matches('.wr-file-upload__retry') && this.host.nativeElement.contains(button);\n this.retry.emit(file);\n if (!hadFocus) return;\n // A handler that moves the file out of `error` takes the button away, and\n // focus with it. The row's remove button is what is left to hold it.\n afterNextRender(\n () => {\n if (button?.isConnected) return;\n this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-file-upload__remove')[index]?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected removeAt(index: number): void {\n if (this.disabled() || this.readonly()) return;\n // Read before the row goes: the button that holds focus is about to leave the\n // document, and focus with it — to `<body>`, so the next Tab restarted at the top\n // of the page. A middle row only kept it by accident, through `track $index`\n // reusing the button for the file that moved up.\n const focused = this.host.nativeElement.ownerDocument.activeElement;\n const hadFocus = !!focused?.matches('.wr-file-upload__remove') && this.host.nativeElement.contains(focused);\n const next = this.files().filter((_, i) => i !== index);\n this.files.set(next);\n this.emit();\n if (!hadFocus) return;\n afterNextRender(\n () => {\n // The row that took this one's place, else the one before it, else the zone.\n const buttons = this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-file-upload__remove');\n const target = buttons[Math.min(index, buttons.length - 1)] ?? this.zone().nativeElement;\n target.focus();\n },\n { injector: this.injector }\n );\n }\n\n // Internals\n\n private acceptFiles(incoming: readonly File[]): void {\n if (this.disabled() || this.readonly()) return;\n const accept = this.accept();\n const maxSize = this.maxSize();\n const rejections: WrFileUploadRejection[] = [];\n const accepted: File[] = [];\n\n for (const file of incoming) {\n const reason = this.reject(file, accept, maxSize);\n if (reason) rejections.push({ file, reason });\n else accepted.push(file);\n }\n\n let next: File[];\n if (this.multiple()) {\n const listed = this.files();\n const maxFiles = this.maxFiles();\n // The cap rejects incoming files only: a list already over it keeps what it holds.\n const room = maxFiles > 0 ? Math.max(0, maxFiles - listed.length) : accepted.length;\n for (const file of accepted.slice(room)) rejections.push({ file, reason: 'count' });\n next = [...listed, ...accepted.slice(0, room)];\n } else {\n // Single mode — last accepted wins, prior selection cleared.\n next = accepted.length > 0 ? [accepted[accepted.length - 1]] : [...this.files()];\n }\n\n this.files.set(next);\n this.touch.emit();\n this.emit();\n if (rejections.length > 0) this.rejected.emit(rejections);\n }\n\n /**\n * Say each state a file has just entered, in one string. `pending` is the\n * resting state and a percent tick is not a change, so neither is said, and\n * the states present when `[status]` is first bound are a starting point\n * rather than news.\n */\n private announce(rows: readonly FileRow[] | null): void {\n if (rows === null) {\n this.lastStates = null;\n return;\n }\n const next = new Map<File, WrFileUploadState>();\n const changed: string[] = [];\n for (const row of rows) {\n if (row.state === null) continue;\n next.set(row.file, row.state);\n if (this.lastStates === null || row.state === 'pending' || this.lastStates.get(row.file) === row.state) continue;\n const status =\n row.state === 'uploading'\n ? this.resolvedUploading()\n : row.state === 'done'\n ? this.resolvedUploaded()\n : (row.message ?? this.resolvedFailed());\n changed.push(this.statusText({ name: row.file.name, status }));\n }\n this.lastStates = next;\n if (changed.length > 0) {\n this.announcement.set(new Intl.ListFormat(this.locale, { style: 'short', type: 'unit' }).format(changed));\n }\n }\n\n /** Hold one object URL per file in `images`, and revoke the ones that left. */\n private syncPreviews(images: readonly File[]): void {\n const current = this.previewUrls();\n if (current.size === images.length && images.every(file => current.has(file))) return;\n if (typeof URL === 'undefined' || typeof URL.createObjectURL !== 'function') return;\n const next = new Map<File, string>();\n for (const file of images) next.set(file, current.get(file) ?? URL.createObjectURL(file));\n for (const [file, url] of current) if (!next.has(file)) URL.revokeObjectURL(url);\n this.previewUrls.set(next);\n }\n\n private reject(file: File, accept: string, maxSize: number): WrFileUploadRejectionReason | null {\n if (accept && !matchesAccept(file, accept)) return 'type';\n if (maxSize > 0 && file.size > maxSize) return 'size';\n return null;\n }\n\n private emit(): void {\n const list = this.files();\n if (this.multiple()) {\n this.value.set(list);\n } else {\n this.value.set(list.length > 0 ? list[0] : null);\n }\n }\n}\n","<div\n #zone\n class=\"wr-file-upload__zone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"zoneName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"openPicker()\"\n (keydown)=\"onZoneKey($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n (paste)=\"onPaste($event)\"\n>\n <svg class=\"wr-file-upload__icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <div class=\"wr-file-upload__hint\" [id]=\"hintId\">\n <strong>{{ resolvedPick() }}</strong>\n <span>{{ resolvedDrop() }}</span>\n @if (helperText()) {\n <small>{{ helperText() }}</small>\n }\n </div>\n</div>\n\n<!--\n The real <input type=\"file\"> is never operated directly — the zone above is\n the control and forwards clicks here, so the input is visually hidden and kept\n OUTSIDE the zone: inside, it nested one interactive element within another\n (the zone is role=\"button\") and put two tab stops where users see one. It is\n positioned absolutely and clipped, so being a sibling changes nothing visually.\n aria-hidden must be paired with tabindex=\"-1\", or hiding a focusable element is\n itself a violation.\n-->\n<input\n #picker\n class=\"wr-file-upload__picker\"\n type=\"file\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [attr.accept]=\"accept() || null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"onPickerChange($event)\"\n/>\n\n@if (showList() && files().length > 0) {\n <ul class=\"wr-file-upload__list\" [attr.aria-busy]=\"busy() || null\">\n @for (row of rows(); track $index) {\n <li [class]=\"row.classes\">\n @if (row.preview; as url) {\n <img class=\"wr-file-upload__preview\" alt=\"\" [src]=\"url\" />\n }\n <span\n class=\"wr-file-upload__name\"\n [attr.id]=\"row.state === 'error' ? `${nameId}-${$index}` : null\"\n [title]=\"row.file.name\"\n >{{ row.file.name }}</span\n >\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.file.size) }}</span>\n @switch (row.state) {\n @case ('done') {\n <span class=\"wr-file-upload__done\" role=\"img\" [attr.aria-label]=\"resolvedUploaded()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M20 6 9 17l-5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n }\n @case ('error') {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-file-upload__retry\"\n [attr.aria-describedby]=\"`${nameId}-${$index}`\"\n [disabled]=\"disabled()\"\n (click)=\"onRetry(row.file, $index)\"\n >\n {{ resolvedRetry() }}\n </button>\n }\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.file.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeAt($index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n @if (row.state === 'uploading') {\n <wr-progress\n class=\"wr-file-upload__progress\"\n size=\"sm\"\n [indeterminate]=\"row.percent === null\"\n [value]=\"row.percent ?? 0\"\n [ariaLabel]=\"statusText({ name: row.file.name, status: resolvedUploading() })\"\n />\n } @else if (row.state === 'error') {\n <span class=\"wr-file-upload__error\">{{ row.message ?? resolvedFailed() }}</span>\n }\n </li>\n }\n </ul>\n}\n\n<!-- One live region for the whole list, in the DOM before any state changes: a\n region inserted together with its text is often not read. -->\n@if (status() !== null) {\n <span class=\"wr-file-upload__announce\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n}\n"],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AA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CACjB,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-file-upload.mjs","names":[],"sources":["../../../projects/lib/file-upload/file-upload.ts","../../../projects/lib/file-upload/file-upload.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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n LOCALE_ID,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrProgress } from 'ngwr/progress';\nimport { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport type {\n WrFileUploadRejection,\n WrFileUploadRejectionReason,\n WrFileUploadSize,\n WrFileUploadState,\n WrFileUploadStatusMap,\n WrStoredFile,\n} from './types';\n\n/** One row of a stored file, listed before the picked ones. */\ninterface StoredRow {\n readonly stored: WrStoredFile;\n readonly url: string | null;\n readonly size: number | null;\n}\n\n/** One list row: the file, what `[status]` says about it and its thumbnail. */\ninterface FileRow {\n readonly file: File;\n readonly classes: string;\n readonly state: WrFileUploadState | null;\n readonly percent: number | null;\n readonly message: string | null;\n readonly preview: string | null;\n}\n\n/** Does `file` match the `accept` attribute (extensions or MIME globs)? */\nfunction matchesAccept(file: File, accept: string): boolean {\n if (!accept) return true;\n const tokens = accept\n .split(',')\n .map(t => t.trim().toLowerCase())\n .filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const mime = file.type.toLowerCase();\n return tokens.some(token => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return mime.startsWith(token.slice(0, -1));\n return mime === token;\n });\n}\n\n/**\n * Drag-and-drop file upload zone. Click to browse, drag-and-drop to add,\n * with an optional file list + remove buttons.\n *\n * A signal-forms native control: it implements\n * `FormValueControl<File | readonly File[] | null>`, so `[formField]` binds\n * straight to its `value` model — no `ControlValueAccessor` in between.\n * `[(value)]` works standalone. The value shape follows `multiple`: a single\n * `File` (or `null`), or a `File[]` array.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-file-upload [formField]=\"form.files\" [multiple]=\"true\" accept=\"image/*\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-file-upload [(value)]=\"avatar\" accept=\".png,.jpg\" [maxSize]=\"2 * 1024 * 1024\" />\n * ```\n *\n * The component does no HTTP. The app uploads, and tells the list where each\n * file stands through `[status]`, a `Map` keyed by the `File` objects in `value`:\n *\n * ```html\n * <wr-file-upload [(value)]=\"files\" multiple [status]=\"statuses()\" (retry)=\"upload($event)\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/file-upload\n */\n@Component({\n selector: 'wr-file-upload',\n templateUrl: './file-upload.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-file-upload', '[class]': 'classes()' },\n imports: [WrButton, WrProgress],\n})\nexport class WrFileUpload implements FormValueControl<File | readonly File[] | null> {\n /** Allow multiple files. Single mode replaces on each add. @default false */\n readonly multiple = input(false, { transform: coerceBooleanProperty });\n\n /** `accept` attribute — comma-separated MIME types or extensions. @default '' */\n readonly accept = input<string>('');\n\n /**\n * Control size: the drop zone's padding, icon and text, and the list rows.\n *\n * @default 'md'\n */\n readonly size = input<WrFileUploadSize>('md');\n\n /** Max bytes per file. `0` disables the check. @default 0 */\n readonly maxSize = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Max files (multi mode only). `0` disables the check. @default 0 */\n readonly maxFiles = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Render the picked-files list below the zone. @default true */\n readonly showList = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Disable interaction. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse changes to the selection while the zone stays focusable and the files\n * still submit. Bound automatically from the field's readonly state when used\n * with `[formField]`.\n *\n * The zone stops opening the picker, a drop is refused and the per-file remove\n * buttons go inert — but the list stays readable, which is the point. No\n * `aria-readonly`: the zone is a `role=\"button\"`, and ARIA does not define the\n * state for that role, so `aria-disabled` would be the only mirror available\n * and it would say the wrong thing.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Where the app's upload of each file stands, keyed by the `File` objects in\n * `value`. A row with an entry draws its state: a progress bar while\n * `uploading` (indeterminate without a `percent`), a mark when `done`, the\n * `message` and a retry button on `error`. A file with no entry is a plain row.\n *\n * Pass a new `Map` on each change: an input sees a new reference, not a `set()`\n * on the one it already holds. `null` (the default) renders nothing extra.\n *\n * @default null\n */\n readonly status = input<WrFileUploadStatusMap | null>(null);\n\n /**\n * Files that already live on a server, listed before the picked ones with the\n * same look: name, size when known, a link when `url` is set, and a remove\n * button. They are not part of `value`, so a form value stays the `File`s the\n * user picked. Removing one does not change this input: `(storedRemove)` emits\n * the descriptor and the app drops it from the list it passes in.\n *\n * In multiple mode they count toward `maxFiles`. In single mode a pick does not\n * replace them: the app clears its own list when it takes the new file. A\n * `required` rule on the control sees `value` only, so an edit form whose file\n * is stored validates against its own list instead.\n *\n * @default []\n */\n readonly stored = input<readonly WrStoredFile[]>([]);\n\n /**\n * Show a thumbnail beside each image file. The thumbnail is an object URL,\n * revoked when its file leaves the list or the component is destroyed. Browser\n * only: nothing is created on the server.\n *\n * @default false\n */\n readonly previews = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Take files pasted with Ctrl/Cmd+V while the drop zone has focus. They go\n * through the same `accept`, `maxSize` and `maxFiles` rules as a drop. A paste\n * that carries no file is left alone.\n *\n * @default false\n */\n readonly acceptPaste = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** id of the zone's visible copy, which names it. @internal */\n protected readonly hintId = wrRandomId('wr-file-upload-hint');\n\n /**\n * The zone's name, as `aria-labelledby`: the field's label when a\n * `<wr-form-field>` wraps it, then the zone's own visible copy.\n *\n * The zone is a `div[role=\"button\"]`, so `<wr-form-field>`'s `<label for>`\n * cannot reach it, and `aria-labelledby` is the direction that works for a\n * role. The visible copy is always part of the name (WCAG 2.5.3, Label in\n * Name): a speech-input user says what they see, and a name without it leaves\n * \"Click to browse\" matching nothing. `null` while `dropZoneLabel` overrides.\n */\n protected readonly labelledBy = computed(() =>\n this.dropZoneLabel() ? null : [this.fieldAria.labelledBy(), this.hintId].filter(Boolean).join(' ')\n );\n\n /** The `dropZoneLabel` override, or `null` so the visible copy names the zone. */\n protected readonly zoneName = computed(() => {\n const label = this.dropZoneLabel();\n return label === '' ? null : label;\n });\n\n /** Primary call-to-action label. Falls back to `fileUpload.browse`. */\n readonly pickLabel = input<string | null>(null);\n\n /** Secondary instruction below the CTA. Falls back to `fileUpload.dropZone`. */\n readonly dropLabel = input<string | null>(null);\n\n /**\n * Overrides the drop zone's accessible name. Unset, the zone is named by its\n * visible copy, after the field's label inside a `<wr-form-field>`. An\n * override must contain that copy, or speech input cannot reach the control\n * (WCAG 2.5.3).\n */\n readonly dropZoneLabel = input<string | null>(null);\n\n /**\n * Name of each row's remove button. `{{name}}` is the row's file name, so the\n * buttons of a list are told apart. Falls back to `fileUpload.removeFile`,\n * \"Remove {{name}}\" in English.\n */\n readonly removeFileLabel = input<string | null>(null);\n\n /** Retry button text on a failed row. Falls back to `fileUpload.retry`. */\n readonly retryLabel = input<string | null>(null);\n\n /** Name of the `uploading` state: the progress bar's name and the announcement. Falls back to `fileUpload.uploading`. */\n readonly uploadingLabel = input<string | null>(null);\n\n /** Name of the `done` state: the mark's name and the announcement. Falls back to `fileUpload.uploaded`. */\n readonly uploadedLabel = input<string | null>(null);\n\n /** Text of a failed row whose status carries no `message`. Falls back to `fileUpload.failed`. */\n readonly failedLabel = input<string | null>(null);\n\n protected readonly resolvedPick = useI18nText(this.pickLabel, 'fileUpload.browse', 'Click to browse');\n protected readonly resolvedDrop = useI18nText(this.dropLabel, 'fileUpload.dropZone', 'or drop files here');\n private readonly removeText = useI18nFormatter('fileUpload.removeFile', 'Remove {{name}}');\n\n /** The remove button of one row, named after its file. */\n protected removeName(name: string): string {\n const given = this.removeFileLabel();\n return given ? given.replace(/\\{\\{\\s*name\\s*\\}\\}/g, () => name) : this.removeText({ name });\n }\n\n /** A link that leaves the page says so: `{{name}} (opens in a new tab)`. */\n protected readonly openText = useI18nFormatter('fileUpload.openFile', '{{name}} (opens in a new tab)');\n\n protected readonly resolvedRetry = useI18nText(this.retryLabel, 'fileUpload.retry', 'Try again');\n protected readonly resolvedUploading = useI18nText(this.uploadingLabel, 'fileUpload.uploading', 'Uploading');\n protected readonly resolvedUploaded = useI18nText(this.uploadedLabel, 'fileUpload.uploaded', 'Uploaded');\n protected readonly resolvedFailed = useI18nText(this.failedLabel, 'fileUpload.failed', 'Upload failed');\n\n /** `{{name}}: {{status}}`: a state said about one file. */\n protected readonly statusText = useI18nFormatter('fileUpload.status', '{{name}}: {{status}}');\n\n /** Optional helper text shown below the labels (e.g. accepted formats). */\n readonly helperText = input<string>('');\n\n /**\n * Selected file(s). Bound by `[formField]`, or two-way via `[(value)]`. Shape\n * follows `multiple`: a single `File` (or `null`), or a `File[]` array.\n */\n readonly value = model<File | readonly File[] | null>(null);\n\n /** Emitted when files are rejected for type / size / count reasons. */\n readonly rejected = output<readonly WrFileUploadRejection[]>();\n\n /** Emitted with the descriptor when the remove button of a stored row is pressed. */\n readonly storedRemove = output<WrStoredFile>();\n\n /** Emitted with the file when the retry button of a failed row is pressed. */\n readonly retry = output<File>();\n\n /** Emitted on commit so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n protected readonly picker = viewChild.required<ElementRef<HTMLInputElement>>('picker');\n private readonly zone = viewChild.required<ElementRef<HTMLElement>>('zone');\n\n protected readonly files = signal<readonly File[]>([]);\n protected readonly dragging = signal(false);\n\n /**\n * How many elements of the zone the drag is inside. The browser fires `dragleave`\n * on the zone when the pointer moves onto its own label or icon, with `dragenter`\n * on the child just before it, so \"left the zone\" read off a single event switched\n * the highlight off over the zone's text and back on over its padding. Every enter\n * counts up and every leave down; the drag has left when the count is back to 0.\n */\n private dragDepth = 0;\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** id prefix of the file names, which describe each row's retry button. @internal */\n protected readonly nameId = wrRandomId('wr-file-upload-name');\n\n /** The object URL of each previewed image file. */\n private readonly previewUrls = signal<ReadonlyMap<File, string>>(new Map());\n\n protected readonly rows = computed<readonly FileRow[]>(() => {\n const status = this.status();\n const urls = this.previewUrls();\n return this.files().map(file => {\n const entry = status?.get(file);\n const percent = entry?.state === 'uploading' ? entry.percent : null;\n const state = entry?.state ?? null;\n return {\n file,\n classes: state ? `wr-file-upload__item wr-file-upload__item--${state}` : 'wr-file-upload__item',\n state,\n percent: typeof percent === 'number' && Number.isFinite(percent) ? percent : null,\n message: entry?.state === 'error' && entry.message ? entry.message : null,\n preview: urls.get(file) ?? null,\n };\n });\n });\n\n protected readonly storedRows = computed<readonly StoredRow[]>(() =>\n this.stored().map(stored => ({\n stored,\n url: stored.url ?? null,\n size: typeof stored.size === 'number' && Number.isFinite(stored.size) && stored.size >= 0 ? stored.size : null,\n }))\n );\n\n /** `aria-busy` on the list: at least one file is uploading. */\n protected readonly busy = computed(() => this.rows().some(row => row.state === 'uploading'));\n\n /** What the one live region says: the states that changed in the last `[status]` write. */\n protected readonly announcement = signal('');\n\n /** The state each file had at the last `[status]` write, to tell a change from a percent tick. */\n private lastStates: ReadonlyMap<File, WrFileUploadState> | null = null;\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-file-upload--${size}`);\n if (this.dragging()) parts.push('wr-file-upload--dragging');\n if (this.disabled()) parts.push('wr-file-upload--disabled');\n else if (this.readonly()) parts.push('wr-file-upload--readonly');\n return parts.join(' ');\n });\n\n /**\n * Human-readable file size (e.g. `1.2 MB`).\n *\n * Every piece of this used to be English and unreachable: a module-level unit\n * table with no catalog key, and `toFixed()`, which writes an ASCII decimal\n * point whatever `LOCALE_ID` says. A Russian page showed translated drop-zone\n * copy above `3.4 KB`. The number now goes through `Intl.NumberFormat` and the\n * unit through the catalog, joined by a template the catalog also owns — so a\n * locale controls the separator, the digits and whether a space sits before\n * the unit.\n *\n * Not a `computed`: it is called per file, with the file's size as its\n * argument. It still re-runs on a locale switch, because the formatters it\n * calls are signals read during the same change detection that renders the row.\n */\n protected formatBytes(bytes: number): string {\n if (!Number.isFinite(bytes) || bytes <= 0) {\n return this.sizeText({ value: this.number(0, 0), unit: this.unitTexts[0]() });\n }\n // Under one byte the log is negative; a stored size can be fractional.\n const i = Math.max(0, Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), this.unitTexts.length - 1));\n const v = bytes / 1024 ** i;\n const digits = v >= 100 || i === 0 ? 0 : 1;\n return this.sizeText({ value: this.number(v, digits), unit: this.unitTexts[i]() });\n }\n\n /** `{{value}} {{unit}}` — the join, so a locale owns the space too. */\n private readonly sizeText = useI18nFormatter('fileUpload.size', '{{value}} {{unit}}');\n\n /**\n * One resolved signal per binary unit, indexed by the power of 1024 the\n * arithmetic lands on.\n *\n * Spelled out rather than built from a key list: `i18n.spec.ts` reads every\n * catalog key the library asks for out of the SOURCE, by matching a quoted\n * dotted string inside the call, so a key built by interpolation is invisible\n * to it. That spec fails rather than passing quietly, but either way the key\n * would stop being checked.\n */\n private readonly unitTexts = [\n wrReadI18nText('fileUpload.unitByte', 'B'),\n wrReadI18nText('fileUpload.unitKb', 'KB'),\n wrReadI18nText('fileUpload.unitMb', 'MB'),\n wrReadI18nText('fileUpload.unitGb', 'GB'),\n wrReadI18nText('fileUpload.unitTb', 'TB'),\n ] as const;\n\n private readonly locale = inject(LOCALE_ID);\n\n private number(value: number, digits: number): string {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n }).format(value);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('file-upload');\n // A stored row whose remove button had focus has left: put focus on a\n // neighbour, unless the user has moved it somewhere else meanwhile.\n effect(() => {\n const stored = this.stored();\n const pending = this.focusAfterStored;\n if (!pending || stored.includes(pending.stored)) return;\n this.focusAfterStored = null;\n untracked(() => this.focusRemoveNear(() => pending.index, true));\n });\n // Rebuild the internal file list from an external `value` write (mirrors the\n // old `writeValue`). Skipped when the value is merely the echo of an\n // in-component edit, so re-syncing can never clobber a live selection.\n effect(() => {\n const v = this.value();\n untracked(() => {\n // Coerce null/undefined to `[]` — a classic-forms binding can write\n // null, which the old `writeValue(v: … | null)` accepted too.\n const next: readonly File[] = v === null || v === undefined ? [] : Array.isArray(v) ? v : [v as File];\n const current = this.files();\n if (current.length === next.length && current.every((file, i) => file === next[i])) return;\n this.files.set(next);\n });\n });\n\n effect(() => {\n const rows = this.status() === null ? null : this.rows();\n untracked(() => this.announce(rows));\n });\n\n effect(() => {\n const images = this.previews() && this.browser ? this.files().filter(file => file.type.startsWith('image/')) : [];\n untracked(() => this.syncPreviews(images));\n });\n inject(DestroyRef).onDestroy(() => this.syncPreviews([]));\n }\n\n /**\n * Focus the drop zone — what Signal Forms calls to focus this control, from\n * `focusBoundControl()`. The zone is the control: the real file input beside\n * it is hidden and out of the tab order, and the host has no tab stop. A\n * read-only zone still takes it; a disabled one is left alone, as a disabled\n * native control refuses the same call.\n */\n focus(options?: FocusOptions): void {\n if (!this.disabled()) this.zone().nativeElement.focus(options);\n }\n\n // Template handlers\n\n protected openPicker(): void {\n if (this.disabled() || this.readonly()) return;\n this.picker().nativeElement.click();\n }\n\n protected onZoneKey(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.openPicker();\n }\n }\n\n protected onPickerChange(event: Event): void {\n const target = event.target as HTMLInputElement;\n if (target.files) this.acceptFiles(Array.from(target.files));\n // Reset so picking the same file twice re-fires `change`.\n target.value = '';\n }\n\n protected onDragEnter(event: DragEvent): void {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n this.dragDepth++;\n this.dragging.set(true);\n }\n\n protected onDragOver(event: DragEvent): void {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n }\n\n protected onDragLeave(): void {\n // See `dragDepth`: a leave onto one of the zone's own children is not leaving.\n this.dragDepth = Math.max(0, this.dragDepth - 1);\n if (this.dragDepth === 0) this.dragging.set(false);\n }\n\n protected onDrop(event: DragEvent): void {\n event.preventDefault();\n this.dragDepth = 0;\n this.dragging.set(false);\n if (this.disabled() || this.readonly()) return;\n const dropped = event.dataTransfer?.files ? Array.from(event.dataTransfer.files) : [];\n if (dropped.length > 0) this.acceptFiles(dropped);\n }\n\n protected onPaste(event: ClipboardEvent): void {\n if (!this.acceptPaste() || this.disabled() || this.readonly()) return;\n const pasted = event.clipboardData?.files ? Array.from(event.clipboardData.files) : [];\n if (pasted.length === 0) return;\n event.preventDefault();\n this.acceptFiles(pasted);\n }\n\n protected onRetry(file: File, index: number): void {\n if (this.disabled()) return;\n const button = this.host.nativeElement.ownerDocument.activeElement;\n const hadFocus = !!button?.matches('.wr-file-upload__retry') && this.host.nativeElement.contains(button);\n this.retry.emit(file);\n if (!hadFocus) return;\n // A handler that moves the file out of `error` takes the button away, and\n // focus with it. The row's remove button is what is left to hold it.\n afterNextRender(\n () => {\n if (button?.isConnected) return;\n this.host.nativeElement\n .querySelectorAll<HTMLElement>('.wr-file-upload__remove')\n [this.stored().length + index]?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected removeStored(row: StoredRow, index: number): void {\n if (this.disabled() || this.readonly()) return;\n const focused = this.host.nativeElement.ownerDocument.activeElement;\n const hadFocus = !!focused?.matches('.wr-file-upload__remove') && this.host.nativeElement.contains(focused);\n // The app drops the row when it likes, after a server delete as often as not,\n // so focus moves once the row has actually left (see the constructor).\n this.focusAfterStored = hadFocus ? { stored: row.stored, index } : null;\n this.storedRemove.emit(row.stored);\n }\n\n /** The stored row whose remove button held focus when it was pressed, until the row leaves. */\n private focusAfterStored: { readonly stored: WrStoredFile; readonly index: number } | null = null;\n\n /**\n * Put focus on the remove button at the index `at` gives after the render,\n * else the one before it, else the zone. Read late: a handler may change\n * `stored` in the same cycle, which moves every picked row.\n */\n private focusRemoveNear(at: () => number, onlyIfLost = false): void {\n afterNextRender(\n () => {\n const doc = this.host.nativeElement.ownerDocument;\n const active = doc.activeElement;\n // Focus the user put anywhere, in this component or not, stays where it is.\n if (onlyIfLost && active && active !== doc.body) return;\n const index = at();\n const buttons = this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-file-upload__remove');\n const target = buttons[Math.min(index, buttons.length - 1)] ?? this.zone().nativeElement;\n target.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected removeAt(index: number): void {\n if (this.disabled() || this.readonly()) return;\n // Read before the row goes: the button that holds focus is about to leave the\n // document, and focus with it — to `<body>`, so the next Tab restarted at the top\n // of the page. A middle row only kept it by accident, through `track $index`\n // reusing the button for the file that moved up.\n const focused = this.host.nativeElement.ownerDocument.activeElement;\n const hadFocus = !!focused?.matches('.wr-file-upload__remove') && this.host.nativeElement.contains(focused);\n const next = this.files().filter((_, i) => i !== index);\n this.files.set(next);\n this.emit();\n if (!hadFocus) return;\n // The row that took this one's place, else the one before it, else the zone.\n this.focusRemoveNear(() => this.stored().length + index);\n }\n\n // Internals\n\n private acceptFiles(incoming: readonly File[]): void {\n if (this.disabled() || this.readonly()) return;\n const accept = this.accept();\n const maxSize = this.maxSize();\n const rejections: WrFileUploadRejection[] = [];\n const accepted: File[] = [];\n\n for (const file of incoming) {\n const reason = this.reject(file, accept, maxSize);\n if (reason) rejections.push({ file, reason });\n else accepted.push(file);\n }\n\n let next: File[];\n if (this.multiple()) {\n const listed = this.files();\n const maxFiles = this.maxFiles();\n // The cap rejects incoming files only: a list already over it keeps what it holds.\n const room = maxFiles > 0 ? Math.max(0, maxFiles - listed.length - this.stored().length) : accepted.length;\n for (const file of accepted.slice(room)) rejections.push({ file, reason: 'count' });\n next = [...listed, ...accepted.slice(0, room)];\n } else {\n // Single mode — last accepted wins, prior selection cleared.\n next = accepted.length > 0 ? [accepted[accepted.length - 1]] : [...this.files()];\n }\n\n this.files.set(next);\n this.touch.emit();\n this.emit();\n if (rejections.length > 0) this.rejected.emit(rejections);\n }\n\n /**\n * Say each state a file has just entered, in one string. `pending` is the\n * resting state and a percent tick is not a change, so neither is said, and\n * the states present when `[status]` is first bound are a starting point\n * rather than news.\n */\n private announce(rows: readonly FileRow[] | null): void {\n if (rows === null) {\n this.lastStates = null;\n return;\n }\n const next = new Map<File, WrFileUploadState>();\n const changed: string[] = [];\n for (const row of rows) {\n if (row.state === null) continue;\n next.set(row.file, row.state);\n if (this.lastStates === null || row.state === 'pending' || this.lastStates.get(row.file) === row.state) continue;\n const status =\n row.state === 'uploading'\n ? this.resolvedUploading()\n : row.state === 'done'\n ? this.resolvedUploaded()\n : (row.message ?? this.resolvedFailed());\n changed.push(this.statusText({ name: row.file.name, status }));\n }\n this.lastStates = next;\n if (changed.length > 0) {\n this.announcement.set(new Intl.ListFormat(this.locale, { style: 'short', type: 'unit' }).format(changed));\n }\n }\n\n /** Hold one object URL per file in `images`, and revoke the ones that left. */\n private syncPreviews(images: readonly File[]): void {\n const current = this.previewUrls();\n if (current.size === images.length && images.every(file => current.has(file))) return;\n if (typeof URL === 'undefined' || typeof URL.createObjectURL !== 'function') return;\n const next = new Map<File, string>();\n for (const file of images) next.set(file, current.get(file) ?? URL.createObjectURL(file));\n for (const [file, url] of current) if (!next.has(file)) URL.revokeObjectURL(url);\n this.previewUrls.set(next);\n }\n\n private reject(file: File, accept: string, maxSize: number): WrFileUploadRejectionReason | null {\n if (accept && !matchesAccept(file, accept)) return 'type';\n if (maxSize > 0 && file.size > maxSize) return 'size';\n return null;\n }\n\n private emit(): void {\n const list = this.files();\n if (this.multiple()) {\n this.value.set(list);\n } else {\n this.value.set(list.length > 0 ? list[0] : null);\n }\n }\n}\n","<div\n #zone\n class=\"wr-file-upload__zone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"zoneName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"openPicker()\"\n (keydown)=\"onZoneKey($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n (paste)=\"onPaste($event)\"\n>\n <svg class=\"wr-file-upload__icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <div class=\"wr-file-upload__hint\" [id]=\"hintId\">\n <strong>{{ resolvedPick() }}</strong>\n <span>{{ resolvedDrop() }}</span>\n @if (helperText()) {\n <small>{{ helperText() }}</small>\n }\n </div>\n</div>\n\n<!--\n The real <input type=\"file\"> is never operated directly — the zone above is\n the control and forwards clicks here, so the input is visually hidden and kept\n OUTSIDE the zone: inside, it nested one interactive element within another\n (the zone is role=\"button\") and put two tab stops where users see one. It is\n positioned absolutely and clipped, so being a sibling changes nothing visually.\n aria-hidden must be paired with tabindex=\"-1\", or hiding a focusable element is\n itself a violation.\n-->\n<input\n #picker\n class=\"wr-file-upload__picker\"\n type=\"file\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [attr.accept]=\"accept() || null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"onPickerChange($event)\"\n/>\n\n@if (showList() && (files().length > 0 || storedRows().length > 0)) {\n <ul class=\"wr-file-upload__list\" [attr.aria-busy]=\"busy() || null\">\n @for (row of storedRows(); track row.stored) {\n <li class=\"wr-file-upload__item wr-file-upload__item--stored\">\n <span class=\"wr-file-upload__name\" [title]=\"row.stored.name\">\n @if (row.url; as url) {\n <a\n class=\"wr-file-upload__link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"url\"\n [attr.aria-label]=\"openText({ name: row.stored.name })\"\n >{{ row.stored.name }}</a\n >\n } @else {\n {{ row.stored.name }}\n }\n </span>\n @if (row.size !== null) {\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.stored.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeStored(row, $index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </li>\n }\n @for (row of rows(); track $index) {\n <li [class]=\"row.classes\">\n @if (row.preview; as url) {\n <img class=\"wr-file-upload__preview\" alt=\"\" [src]=\"url\" />\n }\n <span\n class=\"wr-file-upload__name\"\n [attr.id]=\"row.state === 'error' ? `${nameId}-${$index}` : null\"\n [title]=\"row.file.name\"\n >{{ row.file.name }}</span\n >\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.file.size) }}</span>\n @switch (row.state) {\n @case ('done') {\n <span class=\"wr-file-upload__done\" role=\"img\" [attr.aria-label]=\"resolvedUploaded()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M20 6 9 17l-5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n }\n @case ('error') {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-file-upload__retry\"\n [attr.aria-describedby]=\"`${nameId}-${$index}`\"\n [disabled]=\"disabled()\"\n (click)=\"onRetry(row.file, $index)\"\n >\n {{ resolvedRetry() }}\n </button>\n }\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.file.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeAt($index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n @if (row.state === 'uploading') {\n <wr-progress\n class=\"wr-file-upload__progress\"\n size=\"sm\"\n [indeterminate]=\"row.percent === null\"\n [value]=\"row.percent ?? 0\"\n [ariaLabel]=\"statusText({ name: row.file.name, status: resolvedUploading() })\"\n />\n } @else if (row.state === 'error') {\n <span class=\"wr-file-upload__error\">{{ row.message ?? resolvedFailed() }}</span>\n }\n </li>\n }\n </ul>\n}\n\n<!-- One live region for the whole list, in the DOM before any state changes: a\n region inserted together with its text is often not read. -->\n@if (status() !== null) {\n <span class=\"wr-file-upload__announce\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+DA,SAAS,cAAc,MAAY,QAAc;CAC/C,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,SAAS,OACZ,MAAM,GAAG,CAAC,CACV,KAAI,MAAK,EAAE,KAAI,CAAE,CAAC,YAAW,CAAE,CAAC,CAChC,OAAO,OAAO;CACjB,IAAI,OAAO,WAAW,GAAG,OAAO;CAChC,MAAM,OAAO,KAAK,KAAK,YAAW;CAClC,MAAM,OAAO,KAAK,KAAK,YAAW;CAClC,OAAO,OAAO,MAAK,UAAQ;EACzB,IAAI,MAAM,WAAW,GAAG,GAAG,OAAO,KAAK,SAAS,KAAK;EACrD,IAAI,MAAM,SAAS,IAAI,GAAG,OAAO,KAAK,WAAW,MAAM,MAAM,GAAG,EAAE,CAAC;EACnE,OAAO,SAAS;CAClB,CAAC;AACH;AAqCA,IAAa,eAAb,MAAa,aAAY;CAEd,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,SAAS,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAO1B,OAAO,MAAwB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGpC,UAAU,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,GAAG,qBAAqB,GAAG,CAAC,CAAC;CAAC,CAAA;CAG/F,WAAW,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+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,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CACjB,QAAM,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Component, DestroyRef, InjectionToken, PLATFORM_ID, ViewEncapsulation, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isDevMode, signal, untracked } from "@angular/core";
3
- import { coerceBooleanProperty } from "@angular/cdk/coercion";
2
+ import { Component, DestroyRef, Directive, InjectionToken, PLATFORM_ID, ViewEncapsulation, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isDevMode, signal, untracked } from "@angular/core";
3
+ import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
4
  import { isPlatformBrowser } from "@angular/common";
5
5
  import { wrCheckStyles } from "ngwr/utils";
6
6
  import { WrI18n, useI18nText } from "ngwr/i18n";
@@ -13,6 +13,174 @@ import { AbstractControl, NgControl } from "@angular/forms";
13
13
  * Use of this source code is governed by an MIT-style license that can be
14
14
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
15
15
  */
16
+ var WrForm = class WrForm {
17
+ constructor() {
18
+ if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("form");
19
+ }
20
+ inline = input(false, {
21
+ ...ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {},
22
+ transform: coerceBooleanProperty
23
+ });
24
+ columns = input(1, {
25
+ ...ngDevMode ? { debugName: "columns" } : /* istanbul ignore next */ {},
26
+ transform: (value) => Math.max(1, Math.floor(coerceNumberProperty(value, 1)))
27
+ });
28
+ grid = computed(() => !this.inline() && this.columns() > 1, ...ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []);
29
+ static ɵfac = i0.ɵɵngDeclareFactory({
30
+ minVersion: "12.0.0",
31
+ version: "22.3.0",
32
+ ngImport: i0,
33
+ type: WrForm,
34
+ deps: [],
35
+ target: i0.ɵɵFactoryTarget.Directive
36
+ });
37
+ static ɵdir = i0.ɵɵngDeclareDirective({
38
+ minVersion: "17.1.0",
39
+ version: "22.3.0",
40
+ type: WrForm,
41
+ isStandalone: true,
42
+ selector: "[wrForm]",
43
+ inputs: {
44
+ inline: {
45
+ classPropertyName: "inline",
46
+ publicName: "inline",
47
+ isSignal: true,
48
+ isRequired: false,
49
+ transformFunction: null
50
+ },
51
+ columns: {
52
+ classPropertyName: "columns",
53
+ publicName: "columns",
54
+ isSignal: true,
55
+ isRequired: false,
56
+ transformFunction: null
57
+ }
58
+ },
59
+ host: {
60
+ properties: {
61
+ "class.wr-form--inline": "inline()",
62
+ "class.wr-form--columns": "grid()",
63
+ "style.--wr-form-columns": "columns()"
64
+ },
65
+ classAttribute: "wr-form"
66
+ },
67
+ ngImport: i0
68
+ });
69
+ };
70
+ i0.ɵɵngDeclareClassMetadata({
71
+ minVersion: "12.0.0",
72
+ version: "22.3.0",
73
+ ngImport: i0,
74
+ type: WrForm,
75
+ decorators: [{
76
+ type: Directive,
77
+ args: [{
78
+ selector: "[wrForm]",
79
+ host: {
80
+ class: "wr-form",
81
+ "[class.wr-form--inline]": "inline()",
82
+ "[class.wr-form--columns]": "grid()",
83
+ "[style.--wr-form-columns]": "columns()"
84
+ }
85
+ }]
86
+ }],
87
+ ctorParameters: () => [],
88
+ propDecorators: {
89
+ inline: [{
90
+ type: i0.Input,
91
+ args: [{
92
+ isSignal: true,
93
+ alias: "inline",
94
+ required: false
95
+ }]
96
+ }],
97
+ columns: [{
98
+ type: i0.Input,
99
+ args: [{
100
+ isSignal: true,
101
+ alias: "columns",
102
+ required: false
103
+ }]
104
+ }]
105
+ }
106
+ });
107
+ var WrFormSpan = class WrFormSpan {
108
+ form = inject(WrForm, { optional: true });
109
+ constructor() {
110
+ if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("form");
111
+ }
112
+ span = input("full", {
113
+ ...ngDevMode ? { debugName: "span" } : /* istanbul ignore next */ {},
114
+ alias: "wrFormSpan",
115
+ transform: (value) => {
116
+ const count = Math.floor(coerceNumberProperty(value, 0));
117
+ return count >= 1 ? count : "full";
118
+ }
119
+ });
120
+ track = computed(() => {
121
+ const span = this.span();
122
+ if (span === "full") return "1 / -1";
123
+ return `span ${this.form ? Math.min(span, this.form.columns()) : span}`;
124
+ }, ...ngDevMode ? [{ debugName: "track" }] : /* istanbul ignore next */ []);
125
+ static ɵfac = i0.ɵɵngDeclareFactory({
126
+ minVersion: "12.0.0",
127
+ version: "22.3.0",
128
+ ngImport: i0,
129
+ type: WrFormSpan,
130
+ deps: [],
131
+ target: i0.ɵɵFactoryTarget.Directive
132
+ });
133
+ static ɵdir = i0.ɵɵngDeclareDirective({
134
+ minVersion: "17.1.0",
135
+ version: "22.3.0",
136
+ type: WrFormSpan,
137
+ isStandalone: true,
138
+ selector: "[wrFormSpan]",
139
+ inputs: { span: {
140
+ classPropertyName: "span",
141
+ publicName: "wrFormSpan",
142
+ isSignal: true,
143
+ isRequired: false,
144
+ transformFunction: null
145
+ } },
146
+ host: {
147
+ properties: { "style.--wr-form-span": "track()" },
148
+ classAttribute: "wr-form__span"
149
+ },
150
+ ngImport: i0
151
+ });
152
+ };
153
+ i0.ɵɵngDeclareClassMetadata({
154
+ minVersion: "12.0.0",
155
+ version: "22.3.0",
156
+ ngImport: i0,
157
+ type: WrFormSpan,
158
+ decorators: [{
159
+ type: Directive,
160
+ args: [{
161
+ selector: "[wrFormSpan]",
162
+ host: {
163
+ class: "wr-form__span",
164
+ "[style.--wr-form-span]": "track()"
165
+ }
166
+ }]
167
+ }],
168
+ ctorParameters: () => [],
169
+ propDecorators: { span: [{
170
+ type: i0.Input,
171
+ args: [{
172
+ isSignal: true,
173
+ alias: "wrFormSpan",
174
+ required: false
175
+ }]
176
+ }] }
177
+ });
178
+ /**
179
+ * @license
180
+ *
181
+ * Use of this source code is governed by an MIT-style license that can be
182
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
183
+ */
16
184
  var WrFormItem = class WrFormItem {
17
185
  constructor() {
18
186
  if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("form");
@@ -28,7 +196,7 @@ var WrFormItem = class WrFormItem {
28
196
  }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
29
197
  static ɵfac = i0.ɵɵngDeclareFactory({
30
198
  minVersion: "12.0.0",
31
- version: "22.2.6",
199
+ version: "22.3.0",
32
200
  ngImport: i0,
33
201
  type: WrFormItem,
34
202
  deps: [],
@@ -36,7 +204,7 @@ var WrFormItem = class WrFormItem {
36
204
  });
37
205
  static ɵcmp = i0.ɵɵngDeclareComponent({
38
206
  minVersion: "17.1.0",
39
- version: "22.2.6",
207
+ version: "22.3.0",
40
208
  type: WrFormItem,
41
209
  isStandalone: true,
42
210
  selector: "wr-form-item",
@@ -59,7 +227,7 @@ var WrFormItem = class WrFormItem {
59
227
  };
60
228
  i0.ɵɵngDeclareClassMetadata({
61
229
  minVersion: "12.0.0",
62
- version: "22.2.6",
230
+ version: "22.3.0",
63
231
  ngImport: i0,
64
232
  type: WrFormItem,
65
233
  decorators: [{
@@ -145,7 +313,7 @@ var WrFormError = class WrFormError {
145
313
  }, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
146
314
  static ɵfac = i0.ɵɵngDeclareFactory({
147
315
  minVersion: "12.0.0",
148
- version: "22.2.6",
316
+ version: "22.3.0",
149
317
  ngImport: i0,
150
318
  type: WrFormError,
151
319
  deps: [],
@@ -153,7 +321,7 @@ var WrFormError = class WrFormError {
153
321
  });
154
322
  static ɵcmp = i0.ɵɵngDeclareComponent({
155
323
  minVersion: "17.1.0",
156
- version: "22.2.6",
324
+ version: "22.3.0",
157
325
  type: WrFormError,
158
326
  isStandalone: true,
159
327
  selector: "wr-form-error",
@@ -180,7 +348,7 @@ var WrFormError = class WrFormError {
180
348
  };
181
349
  i0.ɵɵngDeclareClassMetadata({
182
350
  minVersion: "12.0.0",
183
- version: "22.2.6",
351
+ version: "22.3.0",
184
352
  ngImport: i0,
185
353
  type: WrFormError,
186
354
  decorators: [{
@@ -321,7 +489,7 @@ var WrFormField = class WrFormField {
321
489
  }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
322
490
  static ɵfac = i0.ɵɵngDeclareFactory({
323
491
  minVersion: "12.0.0",
324
- version: "22.2.6",
492
+ version: "22.3.0",
325
493
  ngImport: i0,
326
494
  type: WrFormField,
327
495
  deps: [],
@@ -329,7 +497,7 @@ var WrFormField = class WrFormField {
329
497
  });
330
498
  static ɵcmp = i0.ɵɵngDeclareComponent({
331
499
  minVersion: "17.0.0",
332
- version: "22.2.6",
500
+ version: "22.3.0",
333
501
  type: WrFormField,
334
502
  isStandalone: true,
335
503
  selector: "wr-form-field",
@@ -410,7 +578,7 @@ var WrFormField = class WrFormField {
410
578
  };
411
579
  i0.ɵɵngDeclareClassMetadata({
412
580
  minVersion: "12.0.0",
413
- version: "22.2.6",
581
+ version: "22.3.0",
414
582
  ngImport: i0,
415
583
  type: WrFormField,
416
584
  decorators: [{
@@ -511,6 +679,7 @@ function useFormFieldAria(options) {
511
679
  return {
512
680
  describedBy: computed(() => field?.describedBy() ?? field?.hintId?.() ?? null),
513
681
  ariaInvalid: computed(() => (field?.errorKeys().length ?? 0) > 0 ? "true" : null),
682
+ ariaRequired: computed(() => field?.required?.() ? "true" : null),
514
683
  labelledBy: computed(() => field?.labelId?.() ?? null)
515
684
  };
516
685
  }
@@ -525,6 +694,6 @@ function wrFieldLabel(key) {
525
694
  const spaced = key.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ");
526
695
  return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();
527
696
  }
528
- export { WR_FIELD, WR_FORM_FIELD, WrFormError, WrFormField, WrFormItem, useFormFieldAria, wrFieldLabel };
697
+ export { WR_FIELD, WR_FORM_FIELD, WrForm, WrFormError, WrFormField, WrFormItem, WrFormSpan, useFormFieldAria, wrFieldLabel };
529
698
 
530
699
  //# sourceMappingURL=ngwr-form.mjs.map