ngwr 16.0.0 → 16.2.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 (295) hide show
  1. package/badge/styles/_tag.scss +8 -4
  2. package/button/styles/_index.scss +13 -7
  3. package/cascader/styles/_rules.scss +4 -2
  4. package/checkbox/styles/_index.scss +4 -2
  5. package/date-picker/styles/_index.scss +95 -3
  6. package/date-stamp/styles/_index.scss +38 -0
  7. package/dialog/styles/_index.scss +38 -0
  8. package/dropdown/styles/_index.scss +37 -1
  9. package/fesm2022/internal-CVLvP9b_.mjs +33 -0
  10. package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +11 -7
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-avatar.mjs +11 -7
  14. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  15. package/fesm2022/ngwr-back-top.mjs +10 -6
  16. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  17. package/fesm2022/ngwr-badge.mjs +18 -6
  18. package/fesm2022/ngwr-badge.mjs.map +1 -1
  19. package/fesm2022/ngwr-burger.mjs +9 -6
  20. package/fesm2022/ngwr-burger.mjs.map +1 -1
  21. package/fesm2022/ngwr-button.mjs +8 -4
  22. package/fesm2022/ngwr-button.mjs.map +1 -1
  23. package/fesm2022/ngwr-calendar.mjs +19 -8
  24. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  25. package/fesm2022/ngwr-card.mjs +9 -5
  26. package/fesm2022/ngwr-card.mjs.map +1 -1
  27. package/fesm2022/ngwr-cascader.mjs +11 -5
  28. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  29. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
  30. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-checkbox.mjs +10 -6
  32. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngwr-clipboard.mjs +2 -1
  34. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  35. package/fesm2022/ngwr-collapse.mjs +9 -5
  36. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +4 -2
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-comment.mjs +13 -7
  40. package/fesm2022/ngwr-comment.mjs.map +1 -1
  41. package/fesm2022/ngwr-compare.mjs +9 -3
  42. package/fesm2022/ngwr-compare.mjs.map +1 -1
  43. package/fesm2022/ngwr-context-menu.mjs +4 -2
  44. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  45. package/fesm2022/ngwr-copy-value.mjs +11 -6
  46. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  47. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  48. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-date-picker.mjs +238 -38
  50. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  51. package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
  52. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
  53. package/fesm2022/ngwr-date-stamp.mjs +213 -0
  54. package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
  55. package/fesm2022/ngwr-date.mjs +364 -54
  56. package/fesm2022/ngwr-date.mjs.map +1 -1
  57. package/fesm2022/ngwr-descriptions.mjs +9 -5
  58. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog-testing.mjs +23 -2
  60. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-dialog.mjs +45 -16
  62. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  63. package/fesm2022/ngwr-directives.mjs +102 -11
  64. package/fesm2022/ngwr-directives.mjs.map +1 -1
  65. package/fesm2022/ngwr-divider.mjs +4 -2
  66. package/fesm2022/ngwr-divider.mjs.map +1 -1
  67. package/fesm2022/ngwr-drawer.mjs +29 -3
  68. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  69. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  70. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-dropdown.mjs +362 -26
  72. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  73. package/fesm2022/ngwr-editor.mjs +5 -2
  74. package/fesm2022/ngwr-editor.mjs.map +1 -1
  75. package/fesm2022/ngwr-event-calendar.mjs +4 -2
  76. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  77. package/fesm2022/ngwr-file-upload.mjs +9 -3
  78. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  79. package/fesm2022/ngwr-form.mjs +18 -6
  80. package/fesm2022/ngwr-form.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  86. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  88. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  90. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  92. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  94. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  96. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  98. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  100. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  102. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  104. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  106. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  108. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  110. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  112. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  114. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  116. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  118. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  120. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  122. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  124. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n.mjs +34 -8
  126. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  127. package/fesm2022/ngwr-input-number.mjs +9 -3
  128. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  129. package/fesm2022/ngwr-input-otp.mjs +4 -2
  130. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  131. package/fesm2022/ngwr-input.mjs +20 -10
  132. package/fesm2022/ngwr-input.mjs.map +1 -1
  133. package/fesm2022/ngwr-keyboard.mjs +9 -3
  134. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  135. package/fesm2022/ngwr-knob.mjs +9 -3
  136. package/fesm2022/ngwr-knob.mjs.map +1 -1
  137. package/fesm2022/ngwr-layout.mjs +13 -5
  138. package/fesm2022/ngwr-layout.mjs.map +1 -1
  139. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  140. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-lightbox.mjs +255 -15
  142. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  143. package/fesm2022/ngwr-list.mjs +13 -5
  144. package/fesm2022/ngwr-list.mjs.map +1 -1
  145. package/fesm2022/ngwr-load-state.mjs +9 -5
  146. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  147. package/fesm2022/ngwr-overlay.mjs +84 -1
  148. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  149. package/fesm2022/ngwr-pagination.mjs +3 -2
  150. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  151. package/fesm2022/ngwr-pipes.mjs +47 -9
  152. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  153. package/fesm2022/ngwr-popover.mjs +93 -4
  154. package/fesm2022/ngwr-popover.mjs.map +1 -1
  155. package/fesm2022/ngwr-progress.mjs +4 -2
  156. package/fesm2022/ngwr-progress.mjs.map +1 -1
  157. package/fesm2022/ngwr-radio.mjs +9 -5
  158. package/fesm2022/ngwr-radio.mjs.map +1 -1
  159. package/fesm2022/ngwr-rating.mjs +9 -3
  160. package/fesm2022/ngwr-rating.mjs.map +1 -1
  161. package/fesm2022/ngwr-resizable.mjs +503 -0
  162. package/fesm2022/ngwr-resizable.mjs.map +1 -0
  163. package/fesm2022/ngwr-result.mjs +9 -5
  164. package/fesm2022/ngwr-result.mjs.map +1 -1
  165. package/fesm2022/ngwr-schema-form.mjs +3 -0
  166. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  167. package/fesm2022/ngwr-segmented.mjs +4 -2
  168. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  169. package/fesm2022/ngwr-select.mjs +13 -5
  170. package/fesm2022/ngwr-select.mjs.map +1 -1
  171. package/fesm2022/ngwr-skeleton.mjs +4 -2
  172. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  173. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  174. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  175. package/fesm2022/ngwr-slider.mjs +91 -13
  176. package/fesm2022/ngwr-slider.mjs.map +1 -1
  177. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  178. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  180. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  181. package/fesm2022/ngwr-speed-dial.mjs +4 -2
  182. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  183. package/fesm2022/ngwr-spinner.mjs +4 -2
  184. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  185. package/fesm2022/ngwr-splitter.mjs +17 -21
  186. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  187. package/fesm2022/ngwr-stepper.mjs +9 -3
  188. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  189. package/fesm2022/ngwr-switch.mjs +9 -5
  190. package/fesm2022/ngwr-switch.mjs.map +1 -1
  191. package/fesm2022/ngwr-table-testing.mjs +5 -1
  192. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  193. package/fesm2022/ngwr-table.mjs +167 -10
  194. package/fesm2022/ngwr-table.mjs.map +1 -1
  195. package/fesm2022/ngwr-textarea.mjs +9 -3
  196. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  197. package/fesm2022/ngwr-timeline.mjs +18 -8
  198. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  199. package/fesm2022/ngwr-toast-testing.mjs +6 -1
  200. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  201. package/fesm2022/ngwr-toast.mjs +529 -104
  202. package/fesm2022/ngwr-toast.mjs.map +1 -1
  203. package/fesm2022/ngwr-transfer.mjs +4 -2
  204. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  205. package/fesm2022/ngwr-tree.mjs +4 -2
  206. package/fesm2022/ngwr-tree.mjs.map +1 -1
  207. package/fesm2022/ngwr-typography.mjs +9 -3
  208. package/fesm2022/ngwr-typography.mjs.map +1 -1
  209. package/fesm2022/ngwr-utils-router.mjs +18 -2
  210. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  211. package/fesm2022/ngwr-utils.mjs +9 -2
  212. package/fesm2022/ngwr-utils.mjs.map +1 -1
  213. package/fesm2022/ngwr-version.mjs +1 -1
  214. package/fesm2022/ngwr-version.mjs.map +1 -1
  215. package/fesm2022/ngwr-window.mjs +7 -4
  216. package/fesm2022/ngwr-window.mjs.map +1 -1
  217. package/fesm2022/ngwr.mjs.map +1 -1
  218. package/i18n/ar.json +13 -2
  219. package/i18n/cs.json +13 -2
  220. package/i18n/de.json +13 -2
  221. package/i18n/en.json +13 -2
  222. package/i18n/es.json +13 -2
  223. package/i18n/fr.json +13 -2
  224. package/i18n/he.json +13 -2
  225. package/i18n/hi.json +13 -2
  226. package/i18n/id.json +13 -2
  227. package/i18n/it.json +13 -2
  228. package/i18n/ja.json +13 -2
  229. package/i18n/ko.json +13 -2
  230. package/i18n/nl.json +13 -2
  231. package/i18n/pl.json +13 -2
  232. package/i18n/pt.json +13 -2
  233. package/i18n/ru.json +13 -2
  234. package/i18n/sv.json +13 -2
  235. package/i18n/tr.json +13 -2
  236. package/i18n/uk.json +13 -2
  237. package/i18n/vi.json +13 -2
  238. package/i18n/zh-TW.json +13 -2
  239. package/i18n/zh.json +13 -2
  240. package/input/styles/_index.scss +10 -5
  241. package/input-number/styles/_index.scss +6 -3
  242. package/input-otp/styles/_index.scss +4 -2
  243. package/lightbox/styles/_rules.scss +96 -0
  244. package/llms-full.txt +40 -17
  245. package/llms.txt +20 -4
  246. package/package.json +19 -1
  247. package/radio/styles/_index.scss +4 -2
  248. package/resizable/styles/_index.scss +154 -0
  249. package/schematics/use/rule.js +1 -0
  250. package/schematics/use/symbol-map.json +5 -0
  251. package/select/styles/_index.scss +6 -3
  252. package/skills/ngwr/SKILL.md +1 -1
  253. package/skills/ngwr/references/catalog.md +6 -2
  254. package/skills/ngwr/references/setup.md +3 -0
  255. package/slider/styles/_index.scss +106 -0
  256. package/sortable-list/styles/_rules.scss +23 -1
  257. package/switch/styles/_index.scss +4 -2
  258. package/table/styles/_index.scss +53 -0
  259. package/textarea/styles/_index.scss +4 -2
  260. package/theme/styles/_motion.scss +6 -0
  261. package/toast/styles/_index.scss +19 -0
  262. package/types/ngwr-burger.d.ts +0 -1
  263. package/types/ngwr-calendar.d.ts +7 -0
  264. package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
  265. package/types/ngwr-clipboard.d.ts +7 -0
  266. package/types/ngwr-date-picker-testing.d.ts +17 -0
  267. package/types/ngwr-date-picker.d.ts +88 -4
  268. package/types/ngwr-date-stamp-testing.d.ts +47 -0
  269. package/types/ngwr-date-stamp.d.ts +127 -0
  270. package/types/ngwr-date.d.ts +251 -37
  271. package/types/ngwr-dialog-testing.d.ts +10 -0
  272. package/types/ngwr-dialog.d.ts +72 -4
  273. package/types/ngwr-directives.d.ts +36 -1
  274. package/types/ngwr-drawer.d.ts +21 -0
  275. package/types/ngwr-dropdown-testing.d.ts +53 -5
  276. package/types/ngwr-dropdown.d.ts +100 -0
  277. package/types/ngwr-i18n.d.ts +44 -14
  278. package/types/ngwr-lightbox-testing.d.ts +27 -0
  279. package/types/ngwr-lightbox.d.ts +71 -6
  280. package/types/ngwr-overlay.d.ts +36 -0
  281. package/types/ngwr-pipes.d.ts +48 -13
  282. package/types/ngwr-popover.d.ts +39 -1
  283. package/types/ngwr-resizable.d.ts +228 -0
  284. package/types/ngwr-slider-testing.d.ts +8 -1
  285. package/types/ngwr-slider.d.ts +89 -3
  286. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  287. package/types/ngwr-sortable-list.d.ts +113 -10
  288. package/types/ngwr-table-testing.d.ts +3 -1
  289. package/types/ngwr-table.d.ts +120 -4
  290. package/types/ngwr-toast-testing.d.ts +12 -1
  291. package/types/ngwr-toast.d.ts +215 -18
  292. package/types/ngwr-utils-router.d.ts +22 -0
  293. package/types/ngwr-utils.d.ts +8 -1
  294. package/types/ngwr-version.d.ts +1 -1
  295. package/types/ngwr.d.ts +1 -0
@@ -131,7 +131,7 @@ var WrEventCalendar = class WrEventCalendar {
131
131
  dragging = computed(() => this.drag()?.event.id ?? null, ...ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []);
132
132
  chipTemplate = computed(() => this.chipTpl()?.template ?? null, ...ngDevMode ? [{ debugName: "chipTemplate" }] : /* istanbul ignore next */ []);
133
133
  classes = computed(() => {
134
- const parts = ["wr-event-calendar", `wr-event-calendar--${this.view()}`];
134
+ const parts = [`wr-event-calendar--${this.view()}`];
135
135
  if (this.editable()) parts.push("wr-event-calendar--editable");
136
136
  if (this.drag()) parts.push("wr-event-calendar--dragging");
137
137
  return parts.join(" ");
@@ -735,7 +735,8 @@ var WrEventCalendar = class WrEventCalendar {
735
735
  "pointerup": "onPointerUp($event)",
736
736
  "pointercancel": "drag.set(null)"
737
737
  },
738
- properties: { "class": "classes()" }
738
+ properties: { "class": "classes()" },
739
+ classAttribute: "wr-event-calendar"
739
740
  },
740
741
  queries: [{
741
742
  propertyName: "chipTpl",
@@ -795,6 +796,7 @@ i0.ɵɵngDeclareClassMetadata({
795
796
  selector: "wr-event-calendar",
796
797
  encapsulation: ViewEncapsulation.None,
797
798
  host: {
799
+ class: "wr-event-calendar",
798
800
  "[class]": "classes()",
799
801
  "(pointerup)": "onPointerUp($event)",
800
802
  "(pointercancel)": "drag.set(null)"
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-event-calendar.mjs","names":[],"sources":["../../../projects/lib/event-calendar/event-calendar-event-template.ts","../../../projects/lib/event-calendar/event-calendar.ts","../../../projects/lib/event-calendar/event-calendar.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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrCalendarEventContext } from './types';\n\n/**\n * Replace the chip's contents. The event is the implicit context; the chip\n * itself — its button, its position and its drag handling — stays with the\n * calendar, so a custom template cannot break the geometry.\n *\n * @example\n * ```html\n * <wr-event-calendar [events]=\"events\">\n * <ng-template wrCalendarEvent let-event>\n * <strong>{{ event.title }}</strong> — {{ event.data.room }}\n * </ng-template>\n * </wr-event-calendar>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrCalendarEvent]',\n})\nexport class WrCalendarEventTemplate {\n readonly template = inject<TemplateRef<WrCalendarEventContext>>(TemplateRef);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { TemplateRef } from '@angular/core';\nimport {\n Component,\n DOCUMENT,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n contentChild,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrButton, WrButtonGroup } from 'ngwr/button';\nimport { WrDateAdapter } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrCalendarEventTemplate } from './event-calendar-event-template';\nimport type {\n WrCalendarEvent,\n WrCalendarEventChange,\n WrCalendarEventContext,\n WrCalendarSlot,\n WrCalendarView,\n} from './types';\n\n/**\n * Stands in for the consumer input `useI18nText` expects — the header strings take no\n * label inputs of their own.\n */\nconst NO_OVERRIDE = signal<string | null>(null).asReadonly();\n\nconst MINUTES_PER_DAY = 24 * 60;\nconst DAYS_PER_WEEK = 7;\nconst MONTH_ROWS = 6;\n\n/**\n * A chip that spans whole days — every month-view event, and the all-day band\n * of the time views. It lives in the cell where its segment STARTS and reaches\n * right with a `calc()` width, so it stays inside one `role=\"gridcell\"` however\n * far it spans.\n */\ninterface BandChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Index of the day it starts on, within the row it was laid out against. */\n readonly column: number;\n readonly span: number;\n readonly lane: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\n/**\n * A chip positioned against the time grid. Same rule — it belongs to the cell\n * holding its start — but sized in percentages OF THAT CELL, which works only\n * because every slot row is the same height.\n */\ninterface TimeChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Offset into the start cell, 0–100. */\n readonly top: number;\n /** Height as a multiple of the cell, ×100. */\n readonly height: number;\n /**\n * Lane offset from the column's inline START, 0–100 — not from its physical\n * left. Concurrent events are laid out in reading order, so under `dir=\"rtl\"`\n * lane 0 belongs at the right; a physical `left` would read the cluster\n * back-to-front, which is the one thing in this component that was not logical.\n */\n readonly inlineStart: number;\n /** Lane width as a share of the column, 0–100. */\n readonly width: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\ninterface DayCell {\n readonly date: Date;\n readonly key: string;\n readonly day: string;\n readonly label: string;\n readonly inMonth: boolean;\n readonly isToday: boolean;\n readonly bands: readonly BandChip[];\n readonly hidden: number;\n}\n\ninterface MonthWeek {\n readonly key: string;\n readonly days: readonly DayCell[];\n /**\n * How many lanes the row's chips fill. The chips are absolutely positioned,\n * so this is the only way the row's height can know about them.\n */\n readonly lanes: number;\n}\n\ninterface TimeCell {\n readonly key: string;\n readonly date: Date;\n readonly label: string;\n readonly chips: readonly TimeChip[];\n}\n\ninterface TimeRow {\n readonly key: string;\n readonly label: string;\n /** Minutes from midnight — also what the drag target reads off the cell. */\n readonly minutes: number;\n readonly major: boolean;\n readonly cells: readonly TimeCell[];\n}\n\ninterface ColumnHeader {\n readonly key: string;\n readonly date: Date;\n readonly weekday: string;\n readonly day: string;\n readonly label: string;\n readonly isToday: boolean;\n}\n\n/** Live drag state. `null` whenever the pointer is not down on a chip. */\ninterface DragState {\n readonly event: WrCalendarEvent;\n readonly kind: 'move' | 'resize';\n readonly originDate: Date;\n readonly originMinutes: number;\n readonly pointerId: number;\n}\n\n/**\n * Month / week / day event calendar with drag to move and resize.\n *\n * `events` is an INPUT, never mutated: a drag emits `eventChange` describing\n * where the event would land and stops there. Apply it to your own state and\n * the calendar re-renders — so an unhandled output is a cancelled drag, an\n * optimistic update is one `set`, and a rejected server write needs no rollback\n * path inside the component.\n *\n * Every chip lives inside the `role=\"gridcell\"` where it starts and reaches out\n * with `calc()` widths or percentage heights. That is what keeps the ARIA grid\n * valid — an events layer floating over the grid would leave rows owning\n * something other than cells — and it means no pixel measurement anywhere.\n *\n * **Keyboard.** The grid is one tab stop with a roving cursor: arrows move by\n * day (left / right) and by week or slot (up / down), `Home` / `End` jump to\n * the ends of the row, `Enter` on an empty cell emits `slotClick`, and `Enter`\n * on a cell holding events focuses the first chip (`Escape` returns). On a\n * focused chip, `Alt` + arrows move the event — the keyboard equivalent of the\n * drag, emitting the same `eventChange`.\n *\n * Date math and formatting go through {@link WrDateAdapter} — the native one\n * unless `provideWr(withDates(...))` registers another.\n *\n * @example\n * ```html\n * <wr-event-calendar\n * editable\n * [events]=\"events()\"\n * [(view)]=\"view\"\n * [(date)]=\"anchor\"\n * (eventChange)=\"apply($event)\"\n * (slotClick)=\"compose($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/event-calendar\n */\n@Component({\n selector: 'wr-event-calendar',\n templateUrl: './event-calendar.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n // A drag has to end wherever the pointer is released, including outside the\n // chip it started on — so the host owns the release, not the chip.\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'drag.set(null)',\n },\n imports: [NgTemplateOutlet, WrButton, WrButtonGroup],\n})\nexport class WrEventCalendar {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('event-calendar');\n }\n\n /** Everything to render. Never mutated — see `eventChange`. */\n readonly events = input<readonly WrCalendarEvent[]>([]);\n\n /** Which span is shown. Two-way bindable. @default 'month' */\n readonly view = model<WrCalendarView>('month');\n\n /** Any date inside the shown span. Two-way bindable. */\n readonly date = model<Date>(new Date());\n\n /** Which buttons the view switcher offers. Empty hides it. */\n readonly views = input<readonly WrCalendarView[]>(['month', 'week', 'day']);\n\n /** Allow dragging chips to move and resize them. @default false */\n readonly editable = input(false, { transform: coerceBooleanProperty });\n\n /** Minutes per row in the time views — also the drag snap. @default 30 */\n readonly slotMinutes = input(30, { transform: wrNumAttr(30) });\n\n /** First hour the time views show. @default 0 */\n readonly dayStartHour = input(0, { transform: wrNumAttr(0) });\n\n /** First hour they do NOT show, exclusive. @default 24 */\n readonly dayEndHour = input(24, { transform: wrNumAttr(24) });\n\n /** Lanes a month cell shows before collapsing the rest into “+N more”. @default 3 */\n readonly maxLanes = input(3, { transform: wrNumAttr(3) });\n\n /** Hide the built-in header — supply your own navigation instead. @default false */\n readonly hideHeader = input(false, { transform: coerceBooleanProperty });\n\n /** A chip was activated. */\n readonly eventClick = output<WrCalendarEvent>();\n\n /** Empty space was activated — the slot the user pointed at. */\n readonly slotClick = output<WrCalendarSlot>();\n\n /** A drag or an `Alt` + arrow finished. Apply it yourself; nothing moves until you do. */\n readonly eventChange = output<WrCalendarEventChange>();\n\n private readonly adapter = inject<WrDateAdapter<Date>>(WrDateAdapter);\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly chipTpl = contentChild(WrCalendarEventTemplate);\n\n // Reactive: a calendar is as long-lived as the page it sits on, so a catalog that\n // finishes loading after construction — or a locale switch — has to reach these.\n // Resolved once, as they were, they froze the English defaults in place.\n protected readonly todayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.today', 'Today');\n protected readonly previousLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.previous', 'Previous');\n protected readonly nextLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.next', 'Next');\n protected readonly allDayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.allDay', 'All day');\n protected readonly timeLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.time', 'Time');\n protected readonly moreLabel = useI18nFormatter('eventCalendar.more', '+{{count}} more');\n // The five composed strings. Each was a template literal, which localises the\n // words inside it and freezes the word ORDER and the punctuation between them\n // — `wr-calendar` learned the same thing one component over and its\n // `calendar.header` / `.yearRange` / `.dayLabel` are the shape copied here.\n private readonly headerText = useI18nFormatter('eventCalendar.header', '{{month}} {{year}}');\n private readonly rangeText = useI18nFormatter('eventCalendar.range', '{{from}} – {{to}}');\n private readonly chipLabelText = useI18nFormatter('eventCalendar.chipLabel', '{{title}}, {{time}}');\n private readonly slotLabelText = useI18nFormatter('eventCalendar.slotLabel', '{{time}} — {{date}}');\n private readonly allDayCellText = useI18nFormatter('eventCalendar.allDayCellLabel', '{{label}} — {{date}}');\n private readonly monthLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.month', 'Month');\n private readonly weekLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.week', 'Week');\n private readonly dayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.day', 'Day');\n\n protected readonly viewLabels = computed<Record<WrCalendarView, string>>(() => ({\n month: this.monthLabel(),\n week: this.weekLabel(),\n day: this.dayLabel(),\n }));\n\n /** Accessible name of the grid; overridable for a page with several. */\n readonly ariaLabel = input<string | null>(null);\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'eventCalendar.label', 'Calendar');\n\n /**\n * `[day, minutes]` of the roving cursor — `minutes === -1` means a month cell\n * or the all-day band. Raw, so it survives a view switch; read\n * {@link cursorCell}, which clamps it to what the current view actually has.\n */\n private readonly cursor = signal<readonly [number, number]>([0, -1]);\n\n /**\n * The cursor as the current view can honour it. Exactly one cell may carry\n * `tabindex=\"0\"`, so a stale coordinate — the 09:30 row after switching to\n * month, day 34 after switching to week — must fall back to a real cell\n * rather than leave the grid with no tab stop at all.\n */\n protected readonly cursorCell = computed<readonly [number, number]>(() => {\n const [day, minutes] = this.cursor();\n const columns = Math.max(1, this.days().length);\n const clamped = Math.min(columns - 1, Math.max(0, day));\n\n if (this.view() === 'month') return [clamped, -1];\n if (minutes === -1 && this.hasAllDay()) return [clamped, -1];\n\n const rows = this.rows();\n const known = rows.some(row => row.minutes === minutes);\n return [clamped, known ? minutes : (rows[0]?.minutes ?? 0)];\n });\n\n /** Non-null only while a pointer is down on a chip. @internal */\n protected readonly drag = signal<DragState | null>(null);\n\n protected readonly dragging = computed(() => this.drag()?.event.id ?? null);\n\n protected readonly chipTemplate = computed<TemplateRef<WrCalendarEventContext> | null>(\n () => this.chipTpl()?.template ?? null\n );\n\n protected readonly classes = computed(() => {\n const parts = ['wr-event-calendar', `wr-event-calendar--${this.view()}`];\n if (this.editable()) parts.push('wr-event-calendar--editable');\n if (this.drag()) parts.push('wr-event-calendar--dragging');\n return parts.join(' ');\n });\n\n // ---------------------------------------------------------------- ranges\n\n /** Inclusive-exclusive window the current view covers. */\n private readonly range = computed<readonly [Date, Date]>(() => {\n const anchor = this.startOfDay(this.date());\n switch (this.view()) {\n case 'day':\n return [anchor, this.adapter.addDays(anchor, 1)];\n case 'week': {\n const start = this.startOfWeek(anchor);\n return [start, this.adapter.addDays(start, DAYS_PER_WEEK)];\n }\n default: {\n const first = this.adapter.createDate(this.adapter.getYear(anchor), this.adapter.getMonth(anchor), 1);\n const start = this.startOfWeek(first);\n return [start, this.adapter.addDays(start, MONTH_ROWS * DAYS_PER_WEEK)];\n }\n }\n });\n\n /** Every day the view shows, left to right. */\n private readonly days = computed<readonly Date[]>(() => {\n const [start, end] = this.range();\n const count = Math.round((end.getTime() - start.getTime()) / (MINUTES_PER_DAY * 60_000));\n return Array.from({ length: count }, (_, i) => this.adapter.addDays(start, i));\n });\n\n /** Only what overlaps the window — everything downstream works off this. */\n private readonly visible = computed<readonly WrCalendarEvent[]>(() => {\n const [start, end] = this.range();\n return [...this.events()]\n .filter(e => e.end.getTime() > start.getTime() && e.start.getTime() < end.getTime())\n .sort((a, b) => {\n const byStart = a.start.getTime() - b.start.getTime();\n // Ties go to the longer event, so a week-long band claims its lane\n // before the one-day events sitting alongside it.\n return byStart !== 0 ? byStart : b.end.getTime() - a.end.getTime();\n });\n });\n\n protected readonly title = computed(() => {\n const anchor = this.date();\n const months = this.adapter.getMonthNames('long');\n switch (this.view()) {\n case 'day':\n return this.adapter.format(anchor, 'longDate');\n case 'week': {\n const [start] = this.range();\n const last = this.adapter.addDays(start, DAYS_PER_WEEK - 1);\n return this.rangeText({\n from: this.adapter.format(start, 'mediumDate'),\n to: this.adapter.format(last, 'mediumDate'),\n });\n }\n default:\n return this.headerText({ month: months[this.adapter.getMonth(anchor)], year: this.adapter.getYear(anchor) });\n }\n });\n\n /**\n * The adapter contract is \"names ordered from `getFirstDayOfWeek()` onwards\",\n * so the list is ALREADY rotated. Rotating it again here put every column one\n * day out for every locale whose week does not start on Sunday — invisible in\n * en-US, wrong everywhere else. `wr-calendar` consumes the same call directly.\n */\n protected readonly weekdayNames = computed(() => this.adapter.getDayOfWeekNames('short'));\n\n protected readonly switcher = computed(() => this.views().map(view => ({ view, label: this.viewLabels()[view] })));\n\n // ----------------------------------------------------------- month model\n\n protected readonly weeks = computed<readonly MonthWeek[]>(() => {\n const days = this.days();\n const events = this.visible();\n const weeks: MonthWeek[] = [];\n const month = this.adapter.getMonth(this.date());\n\n for (let w = 0; w * DAYS_PER_WEEK < days.length; w++) {\n const row = days.slice(w * DAYS_PER_WEEK, (w + 1) * DAYS_PER_WEEK);\n const { chips, hidden } = this.bandLayout(events, row, this.maxLanes());\n\n weeks.push({\n key: this.iso(row[0]),\n lanes: this.laneCount(chips),\n days: row.map((date, col) => ({\n date,\n key: this.iso(date),\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n inMonth: this.adapter.getMonth(date) === month,\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n bands: chips.filter(chip => chip.column === col),\n hidden: hidden[col],\n })),\n });\n }\n\n return weeks;\n });\n\n // ------------------------------------------------------------ time model\n\n protected readonly columns = computed<readonly ColumnHeader[]>(() => {\n const weekdays = this.adapter.getDayOfWeekNames('short');\n const first = this.adapter.getFirstDayOfWeek();\n return this.days().map(date => ({\n key: this.iso(date),\n date,\n // `weekdays` is indexed from the week's first day; `getDayOfWeek` is\n // absolute (0 = Sunday). Mixing the two spaces named Monday \"Tue\".\n weekday: weekdays[(this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK],\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n }));\n });\n\n /** The all-day band above the time grid — same layout as a month week. */\n protected readonly allDayBands = computed<readonly BandChip[]>(() => {\n const days = this.days();\n const events = this.visible().filter(e => e.allDay === true || this.spansWholeDay(e));\n return this.bandLayout(events, days, Number.POSITIVE_INFINITY).chips;\n });\n\n protected readonly allDayCells = computed<\n readonly { key: string; date: Date; label: string; bands: readonly BandChip[] }[]\n >(() => {\n const days = this.days();\n const chips = this.allDayBands();\n return days.map((date, col) => ({\n key: this.iso(date),\n date,\n label: this.allDayCellText({ label: this.allDayLabel(), date: this.adapter.format(date, 'longDate') }),\n bands: chips.filter(chip => chip.column === col),\n }));\n });\n\n protected readonly hasAllDay = computed(() => this.allDayBands().length > 0);\n\n /** Lanes the all-day band fills — it has no `maxLanes` cap, so its row has to grow instead. */\n protected readonly allDayLanes = computed(() => this.laneCount(this.allDayBands()));\n\n protected readonly rows = computed<readonly TimeRow[]>(() => {\n const slot = Math.max(5, this.slotMinutes());\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const days = this.days();\n const placed = this.timeLayout(days, slot);\n const rows: TimeRow[] = [];\n\n // Each half of a cell's name is invariant along one axis: the day reads the\n // same down a column, the clock the same across a row. Formatting per CELL\n // asked the adapter for 336 of each on a default week (48 slots × 7 days)\n // where 48 clocks and 7 dates say the same thing, and\n // `WrNativeDateAdapter.format` builds a fresh `Intl.DateTimeFormat` per call.\n const dayLabels = days.map(date => this.adapter.format(date, 'longDate'));\n\n for (let minutes = from; minutes < to; minutes += slot) {\n const clock = this.clock(minutes);\n rows.push({\n key: String(minutes),\n minutes,\n major: minutes % 60 === 0,\n label: minutes % 60 === 0 ? clock : '',\n cells: days.map((date, col) => ({\n key: `${this.iso(date)}:${minutes}`,\n date,\n label: this.slotLabelText({ time: clock, date: dayLabels[col] }),\n chips: placed[col].filter(chip => chip.slotMinutes === minutes).map(chip => chip.chip),\n })),\n });\n }\n\n return rows;\n });\n\n // ------------------------------------------------------------------ nav\n\n protected step(direction: -1 | 1): void {\n const anchor = this.date();\n switch (this.view()) {\n case 'day':\n this.date.set(this.adapter.addDays(anchor, direction));\n break;\n case 'week':\n this.date.set(this.adapter.addDays(anchor, direction * DAYS_PER_WEEK));\n break;\n default:\n this.date.set(this.adapter.addMonths(anchor, direction));\n }\n }\n\n protected goToday(): void {\n this.date.set(this.adapter.today());\n }\n\n protected setView(view: WrCalendarView): void {\n this.view.set(view);\n }\n\n /** “+N more” opens that day — the overflow is only ever a month-view problem. */\n protected openDay(date: Date): void {\n this.date.set(date);\n this.view.set('day');\n }\n\n // -------------------------------------------------------------- pointer\n\n protected onChipPointerDown(event: PointerEvent, chipEvent: WrCalendarEvent, kind: 'move' | 'resize'): void {\n if (!this.canDrag(chipEvent) || event.button !== 0) return;\n\n // The cell is found by geometry, not through the chip: `cellUnder` skips\n // every chip in the hit-test stack, so neither this one nor a neighbour\n // overlapping it can stand in for the cell under the pointer.\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n try {\n (event.target as HTMLElement).setPointerCapture?.(event.pointerId);\n } catch {\n // Capture is an optimisation — it keeps the release on this element even\n // when the pointer leaves it. A pointer that is already gone throws here,\n // and losing capture is not a reason to lose the drag.\n }\n event.preventDefault();\n event.stopPropagation();\n\n this.drag.set({\n event: chipEvent,\n kind,\n originDate: cell.date,\n originMinutes: cell.minutes,\n pointerId: event.pointerId,\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const state = this.drag();\n this.drag.set(null);\n if (state?.pointerId !== event.pointerId) return;\n\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n const dayDelta = this.daysBetween(state.originDate, cell.date);\n const minuteDelta = cell.minutes < 0 || state.originMinutes < 0 ? 0 : cell.minutes - state.originMinutes;\n if (dayDelta === 0 && minuteDelta === 0) return;\n\n const { event: source, kind } = state;\n if (kind === 'resize') {\n const end = this.shift(source.end, dayDelta, minuteDelta);\n // A resize that would end at or before the start is a no-op, not an\n // inverted event.\n if (end.getTime() <= source.start.getTime()) return;\n this.eventChange.emit({ event: source, start: source.start, end, kind });\n return;\n }\n\n this.eventChange.emit({\n event: source,\n start: this.shift(source.start, dayDelta, minuteDelta),\n end: this.shift(source.end, dayDelta, minuteDelta),\n kind,\n });\n }\n\n protected onChipClick(event: WrCalendarEvent): void {\n this.eventClick.emit(event);\n }\n\n protected onCellClick(date: Date, minutes: number): void {\n this.slotClick.emit(this.slotAt(date, minutes));\n }\n\n // ------------------------------------------------------------- keyboard\n\n protected onChipKeyDown(event: KeyboardEvent, chipEvent: WrCalendarEvent): void {\n if (event.key === 'Escape') {\n this.focusCell(event);\n return;\n }\n\n if (!event.altKey || !this.canDrag(chipEvent)) return;\n\n const slot = Math.max(5, this.slotMinutes());\n const inTime = this.view() !== 'month';\n let days = 0;\n let minutes = 0;\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n days = -1;\n break;\n case 'ArrowRight':\n days = 1;\n break;\n case 'ArrowUp':\n if (inTime) minutes = -slot;\n else days = -DAYS_PER_WEEK;\n break;\n case 'ArrowDown':\n if (inTime) minutes = slot;\n else days = DAYS_PER_WEEK;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n\n // `Shift` turns the same gesture into a resize, moving the END alone. Without it\n // the keyboard could move an event and never re-length one — and the resize grab\n // area is `aria-hidden` and unfocusable precisely BECAUSE this exists, so its\n // absence left the operation on the mouse only.\n if (event.shiftKey) {\n const end = this.shift(chipEvent.end, days, minutes);\n // Same rule as the pointer path: a resize that would end at or before the\n // start is a no-op rather than an inverted event.\n if (end.getTime() <= chipEvent.start.getTime()) return;\n this.eventChange.emit({ event: chipEvent, start: chipEvent.start, end, kind: 'resize' });\n this.refocusChip(chipEvent.id);\n return;\n }\n\n this.eventChange.emit({\n event: chipEvent,\n start: this.shift(chipEvent.start, days, minutes),\n end: this.shift(chipEvent.end, days, minutes),\n kind: 'move',\n });\n this.refocusChip(chipEvent.id);\n }\n\n /**\n * Put focus back on the chip a keyboard move re-rendered.\n *\n * A host that applies the change re-renders the event in another cell, under\n * another track key, so the focused button is destroyed and focus falls to\n * `<body>` — every `Alt` + arrow then had to start again from the top of the\n * page. Only a LOST focus is taken back: a host that refused the change, or\n * moved focus somewhere on purpose, is left alone. `afterNextRender`, never a\n * microtask: zoneless change detection runs in a macrotask, so a microtask\n * would look before the new chip exists.\n */\n private refocusChip(id: WrCalendarEvent['id']): void {\n afterNextRender(\n () => {\n const active = this.document.activeElement;\n if (active && active !== this.document.body && active.isConnected) return;\n const chip = [...this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-event-calendar__chip')].find(\n el => el.dataset['eventId'] === String(id)\n );\n chip?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected onGridKeyDown(event: KeyboardEvent): void {\n // Handled per cell, not on the grid: the element carrying the keyboard\n // should be the one that actually holds focus. Chips sit inside cells and\n // own their keys, so let anything originating in one bubble straight past.\n if (event.target !== event.currentTarget) return;\n\n const [day, minutes] = this.cursorCell();\n const columns = this.days().length;\n const rows = this.rows();\n const inTime = this.view() !== 'month';\n let next: readonly [number, number];\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n next = [Math.max(0, day - 1), minutes];\n break;\n case 'ArrowRight':\n next = [Math.min(columns - 1, day + 1), minutes];\n break;\n case 'ArrowUp':\n // Hold position at the top row, the way ArrowDown does at the bottom. A\n // `Math.max(0, …)` clamp reads as the same thing and is not: from the\n // Wednesday of the first week it lands on 0, so the cursor jumps\n // SIDEWAYS to Sunday instead of staying put.\n next = inTime\n ? [day, this.stepRow(minutes, -1, rows)]\n : [day - DAYS_PER_WEEK >= 0 ? day - DAYS_PER_WEEK : day, minutes];\n break;\n case 'ArrowDown':\n next = inTime\n ? [day, this.stepRow(minutes, 1, rows)]\n : [day + DAYS_PER_WEEK < columns ? day + DAYS_PER_WEEK : day, minutes];\n break;\n case 'Home':\n next = [day - (day % DAYS_PER_WEEK), minutes];\n break;\n case 'End':\n next = [Math.min(columns - 1, day - (day % DAYS_PER_WEEK) + DAYS_PER_WEEK - 1), minutes];\n break;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const cell = event.target as HTMLElement;\n const chip = cell.querySelector<HTMLElement>('.wr-event-calendar__chip');\n if (chip) chip.focus();\n else this.onCellClick(this.days()[day], minutes);\n return;\n }\n default:\n return;\n }\n\n event.preventDefault();\n this.cursor.set(next);\n this.focusCursor(event.currentTarget as HTMLElement);\n }\n\n /**\n * Keep the roving cursor on the cell that actually has focus.\n *\n * The cursor was only ever written by an arrow key, while focus moves for three\n * other reasons — a click, a Tab onto a chip, Escape out of one — so the next\n * arrow read a coordinate nobody was standing on and threw focus back to it,\n * usually the top-left of the grid.\n */\n protected onCellFocus(day: number, minutes: number): void {\n const [d, m] = this.cursor();\n if (d !== day || m !== minutes) this.cursor.set([day, minutes]);\n }\n\n protected isCursor(day: number, minutes: number): boolean {\n const [d, m] = this.cursorCell();\n return d === day && m === minutes;\n }\n\n // --------------------------------------------------------------- layout\n\n /**\n * Greedy lane packing for day-spanning chips. Sorted by start then by length,\n * each segment takes the first lane its columns are free in — the classic\n * interval-graph colouring, and the reason a long event keeps one lane across\n * the whole week instead of stair-stepping.\n *\n * `limit` caps the visible lanes; anything past it is reported per column so\n * the cell can say how much it is hiding.\n */\n private bandLayout(\n events: readonly WrCalendarEvent[],\n days: readonly Date[],\n limit: number\n ): { chips: readonly BandChip[]; hidden: readonly number[] } {\n const first = days[0];\n const last = this.adapter.addDays(days[days.length - 1], 1);\n const lanes: number[][] = [];\n const chips: BandChip[] = [];\n const hidden = days.map(() => 0);\n\n for (const event of events) {\n if (event.end.getTime() <= first.getTime() || event.start.getTime() >= last.getTime()) continue;\n\n const from = Math.max(0, this.daysBetween(first, this.startOfDay(event.start)));\n // An exclusive end landing exactly on midnight belongs to the previous\n // day — otherwise every all-day event paints one column too wide.\n const endDay = this.startOfDay(new Date(event.end.getTime() - 1));\n const to = Math.min(days.length - 1, this.daysBetween(first, endDay));\n if (to < from) continue;\n\n let lane = lanes.findIndex(taken => taken.every(col => col < from || col > to));\n if (lane === -1) {\n lane = lanes.length;\n lanes.push([]);\n }\n for (let col = from; col <= to; col++) lanes[lane].push(col);\n\n if (lane >= limit) {\n for (let col = from; col <= to; col++) hidden[col]++;\n continue;\n }\n\n chips.push({\n key: `${String(event.id)}:${from}`,\n event,\n column: from,\n span: to - from + 1,\n lane,\n continuesBefore: event.start.getTime() < first.getTime(),\n continuesAfter: event.end.getTime() > last.getTime(),\n });\n }\n\n return { chips, hidden };\n }\n\n private laneCount(chips: readonly BandChip[]): number {\n return chips.reduce((count, chip) => Math.max(count, chip.lane + 1), 0);\n }\n\n /**\n * Column layout inside one day: events that overlap in time share the width.\n * Clusters are built by a running high-water mark — a new cluster starts the\n * moment an event begins after everything before it has ended.\n */\n private timeLayout(days: readonly Date[], slot: number): readonly { chip: TimeChip; slotMinutes: number }[][] {\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const timed = this.visible().filter(e => !e.allDay && !this.spansWholeDay(e));\n\n return days.map(day => {\n const dayStart = this.startOfDay(day);\n const windowStart = dayStart.getTime() + from * 60_000;\n const windowEnd = dayStart.getTime() + to * 60_000;\n\n const onDay = timed\n .filter(e => e.end.getTime() > windowStart && e.start.getTime() < windowEnd)\n .map(event => ({\n event,\n from: Math.max(windowStart, event.start.getTime()),\n to: Math.min(windowEnd, event.end.getTime()),\n }))\n .sort((a, b) => {\n const byStart = a.from - b.from;\n return byStart !== 0 ? byStart : b.to - a.to;\n });\n\n const out: { chip: TimeChip; slotMinutes: number }[] = [];\n let cluster: typeof onDay = [];\n let highWater = -1;\n\n const flush = (): void => {\n for (const [index, item] of cluster.entries()) {\n const minutes = Math.floor((item.from - dayStart.getTime()) / 60_000);\n const slotStart = from + Math.floor((minutes - from) / slot) * slot;\n const length = (item.to - item.from) / 60_000;\n\n out.push({\n slotMinutes: slotStart,\n chip: {\n key: `${String(item.event.id)}:${minutes}`,\n event: item.event,\n top: ((minutes - slotStart) / slot) * 100,\n height: (length / slot) * 100,\n inlineStart: (index / cluster.length) * 100,\n width: (1 / cluster.length) * 100,\n continuesBefore: item.event.start.getTime() < windowStart,\n continuesAfter: item.event.end.getTime() > windowEnd,\n },\n });\n }\n cluster = [];\n };\n\n for (const item of onDay) {\n if (cluster.length > 0 && item.from >= highWater) flush();\n cluster.push(item);\n highWater = Math.max(highWater, item.to);\n }\n flush();\n\n return out;\n });\n }\n\n // --------------------------------------------------------------- chrome\n\n protected chipLabel(event: WrCalendarEvent): string {\n const time = event.allDay ? this.allDayLabel() : this.adapter.format(event.start, 'time');\n return this.chipLabelText({ title: event.title, time });\n }\n\n protected chipTime(event: WrCalendarEvent): string {\n return event.allDay ? this.allDayLabel() : this.adapter.format(event.start, 'time');\n }\n\n protected canDrag(event: WrCalendarEvent): boolean {\n return this.editable() && event.editable !== false;\n }\n\n // --------------------------------------------------------------- helpers\n\n private slotAt(date: Date, minutes: number): WrCalendarSlot {\n if (minutes < 0) {\n const start = this.startOfDay(date);\n return { start, end: this.adapter.addDays(start, 1), allDay: true };\n }\n const start = new Date(this.startOfDay(date).getTime() + minutes * 60_000);\n return { start, end: new Date(start.getTime() + Math.max(5, this.slotMinutes()) * 60_000), allDay: false };\n }\n\n /**\n * The `[data-cell-date]` under the pointer, or `null` outside the grid.\n *\n * Walks the whole hit-test stack rather than climbing from the topmost\n * element. A chip lives in the cell it STARTS in and reaches past it, so\n * `elementFromPoint(…).closest()` over any chip — a neighbour covering the\n * drop slot, a multi-day band covering the drop day — answered with that\n * chip's start cell, and the event landed there instead of under the\n * pointer. The stack lists the cell itself, below the chips; something that\n * is not part of this calendar coming first means the pointer is over\n * another layer, which is not a drop.\n */\n private cellUnder(x: number, y: number): { date: Date; minutes: number } | null {\n const host = this.host.nativeElement;\n for (const el of this.document.elementsFromPoint?.(x, y) ?? []) {\n if (!host.contains(el)) return null;\n if (!(el instanceof HTMLElement) || !el.matches('[data-cell-date]')) continue;\n // Epoch millis rather than a formatted date: `new Date('2026-08-08')` is\n // parsed as UTC and lands on the previous day west of Greenwich.\n const stamp = Number(el.dataset['cellDate']);\n if (!Number.isFinite(stamp)) return null;\n return { date: new Date(stamp), minutes: Number(el.dataset['cellMinutes'] ?? -1) };\n }\n return null;\n }\n\n /** Value of a cell's `data-cell-date`. @internal */\n protected stamp(date: Date): number {\n return this.startOfDay(date).getTime();\n }\n\n private focusCursor(from: HTMLElement): void {\n const [day, minutes] = this.cursorCell();\n from.closest('[role=\"grid\"]')?.querySelector<HTMLElement>(`[data-cell-index=\"${day}:${minutes}\"]`)?.focus();\n }\n\n private focusCell(event: KeyboardEvent): void {\n event.preventDefault();\n (event.target as HTMLElement).closest<HTMLElement>('[data-cell-date]')?.focus();\n }\n\n /**\n * Move one time row, treating the all-day band as the row above the first —\n * otherwise the band is mouse-only, which is the kind of gap that makes a\n * keyboard user give up on the whole grid.\n */\n private stepRow(minutes: number, direction: -1 | 1, rows: readonly TimeRow[]): number {\n if (minutes === -1) return direction === 1 ? (rows[0]?.minutes ?? -1) : -1;\n\n const index = rows.findIndex(row => row.minutes === minutes);\n if (index === -1) return rows[0]?.minutes ?? -1;\n if (index === 0 && direction === -1) return this.hasAllDay() ? -1 : minutes;\n\n return rows[Math.min(rows.length - 1, index + direction)].minutes;\n }\n\n private shift(date: Date, days: number, minutes: number): Date {\n return new Date(this.adapter.addDays(date, days).getTime() + minutes * 60_000);\n }\n\n private startOfDay(date: Date): Date {\n return this.adapter.setTime(date, 0, 0, 0);\n }\n\n private startOfWeek(date: Date): Date {\n const first = this.adapter.getFirstDayOfWeek();\n const offset = (this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK;\n return this.startOfDay(this.adapter.addDays(date, -offset));\n }\n\n /** Whole days apart — computed on the day floor, so DST cannot round it off. */\n private daysBetween(from: Date, to: Date): number {\n const a = this.startOfDay(from);\n const b = this.startOfDay(to);\n return Math.round((b.getTime() - a.getTime()) / (MINUTES_PER_DAY * 60_000));\n }\n\n private spansWholeDay(event: WrCalendarEvent): boolean {\n return event.end.getTime() - event.start.getTime() >= MINUTES_PER_DAY * 60_000;\n }\n\n private clock(minutes: number): string {\n const date = this.adapter.setTime(this.adapter.today(), Math.floor(minutes / 60), minutes % 60, 0);\n return this.adapter.format(date, 'time');\n }\n\n private iso(date: Date): string {\n return `${this.adapter.getYear(date)}-${this.adapter.getMonth(date) + 1}-${this.adapter.getDate(date)}`;\n }\n\n /**\n * The key as the grid SEES it.\n *\n * A day step follows visual order, so under `dir=\"rtl\"` ArrowRight goes back a\n * day. Up/Down move by week or by row and never flip; Home/End are semantic.\n * Both key handlers route through here — the grid nav and the `Alt`+arrow drag,\n * which moves an event and would otherwise reschedule it the wrong way.\n */\n private inlineKey(key: string): string {\n if (this.dir?.value !== 'rtl') return key;\n if (key === 'ArrowRight') return 'ArrowLeft';\n if (key === 'ArrowLeft') return 'ArrowRight';\n return key;\n }\n}\n","<!--\n Two grids, one rule: a chip always lives inside the `role=\"gridcell\"` where it\n STARTS, and reaches out from there — `calc()` widths for day-spanning bands,\n percentage heights for timed chips. A floating events layer would read better\n in the template and would leave `role=\"row\"` owning something other than\n cells, which is exactly what the axe gate rejects.\n-->\n@if (!hideHeader()) {\n <div class=\"wr-event-calendar__header\">\n <div class=\"wr-event-calendar__nav\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--prev\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"step(-1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button wr-btn type=\"button\" size=\"sm\" outlined class=\"wr-event-calendar__today\" (click)=\"goToday()\">\n {{ todayLabel() }}\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--next\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"step(1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <h2 class=\"wr-event-calendar__title\">{{ title() }}</h2>\n\n @if (switcher().length > 1) {\n <wr-btn-group>\n @for (item of switcher(); track item.view) {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-event-calendar__view\"\n [outlined]=\"view() !== item.view\"\n [color]=\"view() === item.view ? 'primary' : null\"\n [attr.aria-pressed]=\"view() === item.view\"\n (click)=\"setView(item.view)\"\n >\n {{ item.label }}\n </button>\n }\n </wr-btn-group>\n }\n </div>\n}\n\n@if (view() === 'month') {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--month\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (name of weekdayNames(); track $index) {\n <div role=\"columnheader\" class=\"wr-event-calendar__weekday\">{{ name }}</div>\n }\n </div>\n\n @for (week of weeks(); track week.key; let w = $index) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [style.--wr-event-calendar-lanes]=\"week.lanes\">\n @for (cell of week.days; track cell.key; let c = $index) {\n @let index = w * 7 + c;\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--day\"\n [class.wr-event-calendar__cell--muted]=\"!cell.inMonth\"\n [class.wr-event-calendar__cell--today]=\"cell.isToday\"\n [attr.tabindex]=\"isCursor(index, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${index}:-1`\"\n (focusin)=\"onCellFocus(index, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n <span class=\"wr-event-calendar__daynum\" aria-hidden=\"true\">{{ cell.day }}</span>\n\n @for (chip of cell.bands; track chip.key) {\n <ng-container\n [ngTemplateOutlet]=\"band\"\n [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '1.75rem' }\"\n />\n }\n\n @if (cell.hidden > 0) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__more\"\n [style.--wr-event-calendar-lane]=\"maxLanes()\"\n (click)=\"openDay(cell.date); $event.stopPropagation()\"\n >\n {{ moreLabel({ count: cell.hidden }) }}\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--time\"\n [style.--wr-event-calendar-cols]=\"columns().length\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n <div role=\"columnheader\" class=\"wr-event-calendar__gutter\" [attr.aria-label]=\"timeLabel()\"></div>\n @for (column of columns(); track column.key) {\n <div\n role=\"columnheader\"\n class=\"wr-event-calendar__colhead\"\n [class.wr-event-calendar__colhead--today]=\"column.isToday\"\n >\n <span class=\"wr-event-calendar__colhead-weekday\">{{ column.weekday }}</span>\n <span class=\"wr-event-calendar__colhead-day\">{{ column.day }}</span>\n </div>\n }\n </div>\n\n @if (hasAllDay()) {\n <div\n role=\"row\"\n class=\"wr-event-calendar__row wr-event-calendar__row--allday\"\n [style.--wr-event-calendar-lanes]=\"allDayLanes()\"\n >\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ allDayLabel() }}</div>\n @for (cell of allDayCells(); track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--allday\"\n [attr.tabindex]=\"isCursor(c, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${c}:-1`\"\n (focusin)=\"onCellFocus(c, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.bands; track chip.key) {\n <ng-container [ngTemplateOutlet]=\"band\" [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '0rem' }\" />\n }\n </div>\n }\n </div>\n }\n\n @for (row of rows(); track row.key) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [class.wr-event-calendar__row--major]=\"row.major\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ row.label }}</div>\n @for (cell of row.cells; track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--slot\"\n [class.wr-event-calendar__cell--major]=\"row.major\"\n [attr.tabindex]=\"isCursor(c, row.minutes) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"row.minutes\"\n [attr.data-cell-index]=\"`${c}:${row.minutes}`\"\n (focusin)=\"onCellFocus(c, row.minutes)\"\n (click)=\"onCellClick(cell.date, row.minutes)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.chips; track chip.key) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--time\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.top.%]=\"chip.top\"\n [style.--wr-event-calendar-block-size.%]=\"chip.height\"\n [style.--wr-event-calendar-inline-start.%]=\"chip.inlineStart\"\n [style.--wr-event-calendar-inline-size.%]=\"chip.width\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n <span class=\"wr-event-calendar__chip-time\" aria-hidden=\"true\">{{ chipTime(chip.event) }}</span>\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n\n @if (canDrag(chip.event) && !chip.continuesAfter) {\n <!--\n A grab area, not a control: the same resize is on the keyboard as\n `Alt` + `Shift` + arrows on the chip itself, so exposing a second\n focusable thing here would add a tab stop that leads nowhere.\n -->\n <span\n class=\"wr-event-calendar__resize\"\n aria-hidden=\"true\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'resize')\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n\n<!-- One chip shape for both day-spanning cases: month cells and the all-day band. -->\n<ng-template #band let-chip let-offset=\"offset\">\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--band\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.--wr-event-calendar-span]=\"chip.span\"\n [style.--wr-event-calendar-lane]=\"chip.lane\"\n [style.--wr-event-calendar-offset]=\"offset\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n </button>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,IAAa,0BAAb,MAAa,wBAAuB;CACzB,WAAW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AA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-event-calendar.mjs","names":[],"sources":["../../../projects/lib/event-calendar/event-calendar-event-template.ts","../../../projects/lib/event-calendar/event-calendar.ts","../../../projects/lib/event-calendar/event-calendar.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 { Directive, TemplateRef, inject } from '@angular/core';\n\nimport type { WrCalendarEventContext } from './types';\n\n/**\n * Replace the chip's contents. The event is the implicit context; the chip\n * itself — its button, its position and its drag handling — stays with the\n * calendar, so a custom template cannot break the geometry.\n *\n * @example\n * ```html\n * <wr-event-calendar [events]=\"events\">\n * <ng-template wrCalendarEvent let-event>\n * <strong>{{ event.title }}</strong> — {{ event.data.room }}\n * </ng-template>\n * </wr-event-calendar>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrCalendarEvent]',\n})\nexport class WrCalendarEventTemplate {\n readonly template = inject<TemplateRef<WrCalendarEventContext>>(TemplateRef);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport type { TemplateRef } from '@angular/core';\nimport {\n Component,\n DOCUMENT,\n ElementRef,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n computed,\n contentChild,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrButton, WrButtonGroup } from 'ngwr/button';\nimport { WrDateAdapter } from 'ngwr/date';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrCalendarEventTemplate } from './event-calendar-event-template';\nimport type {\n WrCalendarEvent,\n WrCalendarEventChange,\n WrCalendarEventContext,\n WrCalendarSlot,\n WrCalendarView,\n} from './types';\n\n/**\n * Stands in for the consumer input `useI18nText` expects — the header strings take no\n * label inputs of their own.\n */\nconst NO_OVERRIDE = signal<string | null>(null).asReadonly();\n\nconst MINUTES_PER_DAY = 24 * 60;\nconst DAYS_PER_WEEK = 7;\nconst MONTH_ROWS = 6;\n\n/**\n * A chip that spans whole days — every month-view event, and the all-day band\n * of the time views. It lives in the cell where its segment STARTS and reaches\n * right with a `calc()` width, so it stays inside one `role=\"gridcell\"` however\n * far it spans.\n */\ninterface BandChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Index of the day it starts on, within the row it was laid out against. */\n readonly column: number;\n readonly span: number;\n readonly lane: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\n/**\n * A chip positioned against the time grid. Same rule — it belongs to the cell\n * holding its start — but sized in percentages OF THAT CELL, which works only\n * because every slot row is the same height.\n */\ninterface TimeChip {\n readonly key: string;\n readonly event: WrCalendarEvent;\n /** Offset into the start cell, 0–100. */\n readonly top: number;\n /** Height as a multiple of the cell, ×100. */\n readonly height: number;\n /**\n * Lane offset from the column's inline START, 0–100 — not from its physical\n * left. Concurrent events are laid out in reading order, so under `dir=\"rtl\"`\n * lane 0 belongs at the right; a physical `left` would read the cluster\n * back-to-front, which is the one thing in this component that was not logical.\n */\n readonly inlineStart: number;\n /** Lane width as a share of the column, 0–100. */\n readonly width: number;\n readonly continuesBefore: boolean;\n readonly continuesAfter: boolean;\n}\n\ninterface DayCell {\n readonly date: Date;\n readonly key: string;\n readonly day: string;\n readonly label: string;\n readonly inMonth: boolean;\n readonly isToday: boolean;\n readonly bands: readonly BandChip[];\n readonly hidden: number;\n}\n\ninterface MonthWeek {\n readonly key: string;\n readonly days: readonly DayCell[];\n /**\n * How many lanes the row's chips fill. The chips are absolutely positioned,\n * so this is the only way the row's height can know about them.\n */\n readonly lanes: number;\n}\n\ninterface TimeCell {\n readonly key: string;\n readonly date: Date;\n readonly label: string;\n readonly chips: readonly TimeChip[];\n}\n\ninterface TimeRow {\n readonly key: string;\n readonly label: string;\n /** Minutes from midnight — also what the drag target reads off the cell. */\n readonly minutes: number;\n readonly major: boolean;\n readonly cells: readonly TimeCell[];\n}\n\ninterface ColumnHeader {\n readonly key: string;\n readonly date: Date;\n readonly weekday: string;\n readonly day: string;\n readonly label: string;\n readonly isToday: boolean;\n}\n\n/** Live drag state. `null` whenever the pointer is not down on a chip. */\ninterface DragState {\n readonly event: WrCalendarEvent;\n readonly kind: 'move' | 'resize';\n readonly originDate: Date;\n readonly originMinutes: number;\n readonly pointerId: number;\n}\n\n/**\n * Month / week / day event calendar with drag to move and resize.\n *\n * `events` is an INPUT, never mutated: a drag emits `eventChange` describing\n * where the event would land and stops there. Apply it to your own state and\n * the calendar re-renders — so an unhandled output is a cancelled drag, an\n * optimistic update is one `set`, and a rejected server write needs no rollback\n * path inside the component.\n *\n * Every chip lives inside the `role=\"gridcell\"` where it starts and reaches out\n * with `calc()` widths or percentage heights. That is what keeps the ARIA grid\n * valid — an events layer floating over the grid would leave rows owning\n * something other than cells — and it means no pixel measurement anywhere.\n *\n * **Keyboard.** The grid is one tab stop with a roving cursor: arrows move by\n * day (left / right) and by week or slot (up / down), `Home` / `End` jump to\n * the ends of the row, `Enter` on an empty cell emits `slotClick`, and `Enter`\n * on a cell holding events focuses the first chip (`Escape` returns). On a\n * focused chip, `Alt` + arrows move the event — the keyboard equivalent of the\n * drag, emitting the same `eventChange`.\n *\n * Date math and formatting go through {@link WrDateAdapter} — the native one\n * unless `provideWr(withDates(...))` registers another.\n *\n * @example\n * ```html\n * <wr-event-calendar\n * editable\n * [events]=\"events()\"\n * [(view)]=\"view\"\n * [(date)]=\"anchor\"\n * (eventChange)=\"apply($event)\"\n * (slotClick)=\"compose($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/event-calendar\n */\n@Component({\n selector: 'wr-event-calendar',\n templateUrl: './event-calendar.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-event-calendar',\n '[class]': 'classes()',\n // A drag has to end wherever the pointer is released, including outside the\n // chip it started on — so the host owns the release, not the chip.\n '(pointerup)': 'onPointerUp($event)',\n '(pointercancel)': 'drag.set(null)',\n },\n imports: [NgTemplateOutlet, WrButton, WrButtonGroup],\n})\nexport class WrEventCalendar {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('event-calendar');\n }\n\n /** Everything to render. Never mutated — see `eventChange`. */\n readonly events = input<readonly WrCalendarEvent[]>([]);\n\n /** Which span is shown. Two-way bindable. @default 'month' */\n readonly view = model<WrCalendarView>('month');\n\n /** Any date inside the shown span. Two-way bindable. */\n readonly date = model<Date>(new Date());\n\n /** Which buttons the view switcher offers. Empty hides it. */\n readonly views = input<readonly WrCalendarView[]>(['month', 'week', 'day']);\n\n /** Allow dragging chips to move and resize them. @default false */\n readonly editable = input(false, { transform: coerceBooleanProperty });\n\n /** Minutes per row in the time views — also the drag snap. @default 30 */\n readonly slotMinutes = input(30, { transform: wrNumAttr(30) });\n\n /** First hour the time views show. @default 0 */\n readonly dayStartHour = input(0, { transform: wrNumAttr(0) });\n\n /** First hour they do NOT show, exclusive. @default 24 */\n readonly dayEndHour = input(24, { transform: wrNumAttr(24) });\n\n /** Lanes a month cell shows before collapsing the rest into “+N more”. @default 3 */\n readonly maxLanes = input(3, { transform: wrNumAttr(3) });\n\n /** Hide the built-in header — supply your own navigation instead. @default false */\n readonly hideHeader = input(false, { transform: coerceBooleanProperty });\n\n /** A chip was activated. */\n readonly eventClick = output<WrCalendarEvent>();\n\n /** Empty space was activated — the slot the user pointed at. */\n readonly slotClick = output<WrCalendarSlot>();\n\n /** A drag or an `Alt` + arrow finished. Apply it yourself; nothing moves until you do. */\n readonly eventChange = output<WrCalendarEventChange>();\n\n private readonly adapter = inject<WrDateAdapter<Date>>(WrDateAdapter);\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n private readonly dir = inject(Directionality, { optional: true });\n private readonly chipTpl = contentChild(WrCalendarEventTemplate);\n\n // Reactive: a calendar is as long-lived as the page it sits on, so a catalog that\n // finishes loading after construction — or a locale switch — has to reach these.\n // Resolved once, as they were, they froze the English defaults in place.\n protected readonly todayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.today', 'Today');\n protected readonly previousLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.previous', 'Previous');\n protected readonly nextLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.next', 'Next');\n protected readonly allDayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.allDay', 'All day');\n protected readonly timeLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.time', 'Time');\n protected readonly moreLabel = useI18nFormatter('eventCalendar.more', '+{{count}} more');\n // The five composed strings. Each was a template literal, which localises the\n // words inside it and freezes the word ORDER and the punctuation between them\n // — `wr-calendar` learned the same thing one component over and its\n // `calendar.header` / `.yearRange` / `.dayLabel` are the shape copied here.\n private readonly headerText = useI18nFormatter('eventCalendar.header', '{{month}} {{year}}');\n private readonly rangeText = useI18nFormatter('eventCalendar.range', '{{from}} – {{to}}');\n private readonly chipLabelText = useI18nFormatter('eventCalendar.chipLabel', '{{title}}, {{time}}');\n private readonly slotLabelText = useI18nFormatter('eventCalendar.slotLabel', '{{time}} — {{date}}');\n private readonly allDayCellText = useI18nFormatter('eventCalendar.allDayCellLabel', '{{label}} — {{date}}');\n private readonly monthLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.month', 'Month');\n private readonly weekLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.week', 'Week');\n private readonly dayLabel = useI18nText(NO_OVERRIDE, 'eventCalendar.day', 'Day');\n\n protected readonly viewLabels = computed<Record<WrCalendarView, string>>(() => ({\n month: this.monthLabel(),\n week: this.weekLabel(),\n day: this.dayLabel(),\n }));\n\n /** Accessible name of the grid; overridable for a page with several. */\n readonly ariaLabel = input<string | null>(null);\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'eventCalendar.label', 'Calendar');\n\n /**\n * `[day, minutes]` of the roving cursor — `minutes === -1` means a month cell\n * or the all-day band. Raw, so it survives a view switch; read\n * {@link cursorCell}, which clamps it to what the current view actually has.\n */\n private readonly cursor = signal<readonly [number, number]>([0, -1]);\n\n /**\n * The cursor as the current view can honour it. Exactly one cell may carry\n * `tabindex=\"0\"`, so a stale coordinate — the 09:30 row after switching to\n * month, day 34 after switching to week — must fall back to a real cell\n * rather than leave the grid with no tab stop at all.\n */\n protected readonly cursorCell = computed<readonly [number, number]>(() => {\n const [day, minutes] = this.cursor();\n const columns = Math.max(1, this.days().length);\n const clamped = Math.min(columns - 1, Math.max(0, day));\n\n if (this.view() === 'month') return [clamped, -1];\n if (minutes === -1 && this.hasAllDay()) return [clamped, -1];\n\n const rows = this.rows();\n const known = rows.some(row => row.minutes === minutes);\n return [clamped, known ? minutes : (rows[0]?.minutes ?? 0)];\n });\n\n /** Non-null only while a pointer is down on a chip. @internal */\n protected readonly drag = signal<DragState | null>(null);\n\n protected readonly dragging = computed(() => this.drag()?.event.id ?? null);\n\n protected readonly chipTemplate = computed<TemplateRef<WrCalendarEventContext> | null>(\n () => this.chipTpl()?.template ?? null\n );\n\n protected readonly classes = computed(() => {\n const parts = [`wr-event-calendar--${this.view()}`];\n if (this.editable()) parts.push('wr-event-calendar--editable');\n if (this.drag()) parts.push('wr-event-calendar--dragging');\n return parts.join(' ');\n });\n\n // ---------------------------------------------------------------- ranges\n\n /** Inclusive-exclusive window the current view covers. */\n private readonly range = computed<readonly [Date, Date]>(() => {\n const anchor = this.startOfDay(this.date());\n switch (this.view()) {\n case 'day':\n return [anchor, this.adapter.addDays(anchor, 1)];\n case 'week': {\n const start = this.startOfWeek(anchor);\n return [start, this.adapter.addDays(start, DAYS_PER_WEEK)];\n }\n default: {\n const first = this.adapter.createDate(this.adapter.getYear(anchor), this.adapter.getMonth(anchor), 1);\n const start = this.startOfWeek(first);\n return [start, this.adapter.addDays(start, MONTH_ROWS * DAYS_PER_WEEK)];\n }\n }\n });\n\n /** Every day the view shows, left to right. */\n private readonly days = computed<readonly Date[]>(() => {\n const [start, end] = this.range();\n const count = Math.round((end.getTime() - start.getTime()) / (MINUTES_PER_DAY * 60_000));\n return Array.from({ length: count }, (_, i) => this.adapter.addDays(start, i));\n });\n\n /** Only what overlaps the window — everything downstream works off this. */\n private readonly visible = computed<readonly WrCalendarEvent[]>(() => {\n const [start, end] = this.range();\n return [...this.events()]\n .filter(e => e.end.getTime() > start.getTime() && e.start.getTime() < end.getTime())\n .sort((a, b) => {\n const byStart = a.start.getTime() - b.start.getTime();\n // Ties go to the longer event, so a week-long band claims its lane\n // before the one-day events sitting alongside it.\n return byStart !== 0 ? byStart : b.end.getTime() - a.end.getTime();\n });\n });\n\n protected readonly title = computed(() => {\n const anchor = this.date();\n const months = this.adapter.getMonthNames('long');\n switch (this.view()) {\n case 'day':\n return this.adapter.format(anchor, 'longDate');\n case 'week': {\n const [start] = this.range();\n const last = this.adapter.addDays(start, DAYS_PER_WEEK - 1);\n return this.rangeText({\n from: this.adapter.format(start, 'mediumDate'),\n to: this.adapter.format(last, 'mediumDate'),\n });\n }\n default:\n return this.headerText({ month: months[this.adapter.getMonth(anchor)], year: this.adapter.getYear(anchor) });\n }\n });\n\n /**\n * The adapter contract is \"names ordered from `getFirstDayOfWeek()` onwards\",\n * so the list is ALREADY rotated. Rotating it again here put every column one\n * day out for every locale whose week does not start on Sunday — invisible in\n * en-US, wrong everywhere else. `wr-calendar` consumes the same call directly.\n */\n protected readonly weekdayNames = computed(() => this.adapter.getDayOfWeekNames('short'));\n\n protected readonly switcher = computed(() => this.views().map(view => ({ view, label: this.viewLabels()[view] })));\n\n // ----------------------------------------------------------- month model\n\n protected readonly weeks = computed<readonly MonthWeek[]>(() => {\n const days = this.days();\n const events = this.visible();\n const weeks: MonthWeek[] = [];\n const month = this.adapter.getMonth(this.date());\n\n for (let w = 0; w * DAYS_PER_WEEK < days.length; w++) {\n const row = days.slice(w * DAYS_PER_WEEK, (w + 1) * DAYS_PER_WEEK);\n const { chips, hidden } = this.bandLayout(events, row, this.maxLanes());\n\n weeks.push({\n key: this.iso(row[0]),\n lanes: this.laneCount(chips),\n days: row.map((date, col) => ({\n date,\n key: this.iso(date),\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n inMonth: this.adapter.getMonth(date) === month,\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n bands: chips.filter(chip => chip.column === col),\n hidden: hidden[col],\n })),\n });\n }\n\n return weeks;\n });\n\n // ------------------------------------------------------------ time model\n\n protected readonly columns = computed<readonly ColumnHeader[]>(() => {\n const weekdays = this.adapter.getDayOfWeekNames('short');\n const first = this.adapter.getFirstDayOfWeek();\n return this.days().map(date => ({\n key: this.iso(date),\n date,\n // `weekdays` is indexed from the week's first day; `getDayOfWeek` is\n // absolute (0 = Sunday). Mixing the two spaces named Monday \"Tue\".\n weekday: weekdays[(this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK],\n day: String(this.adapter.getDate(date)),\n label: this.adapter.format(date, 'longDate'),\n isToday: this.adapter.isSameDay(date, this.adapter.today()),\n }));\n });\n\n /** The all-day band above the time grid — same layout as a month week. */\n protected readonly allDayBands = computed<readonly BandChip[]>(() => {\n const days = this.days();\n const events = this.visible().filter(e => e.allDay === true || this.spansWholeDay(e));\n return this.bandLayout(events, days, Number.POSITIVE_INFINITY).chips;\n });\n\n protected readonly allDayCells = computed<\n readonly { key: string; date: Date; label: string; bands: readonly BandChip[] }[]\n >(() => {\n const days = this.days();\n const chips = this.allDayBands();\n return days.map((date, col) => ({\n key: this.iso(date),\n date,\n label: this.allDayCellText({ label: this.allDayLabel(), date: this.adapter.format(date, 'longDate') }),\n bands: chips.filter(chip => chip.column === col),\n }));\n });\n\n protected readonly hasAllDay = computed(() => this.allDayBands().length > 0);\n\n /** Lanes the all-day band fills — it has no `maxLanes` cap, so its row has to grow instead. */\n protected readonly allDayLanes = computed(() => this.laneCount(this.allDayBands()));\n\n protected readonly rows = computed<readonly TimeRow[]>(() => {\n const slot = Math.max(5, this.slotMinutes());\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const days = this.days();\n const placed = this.timeLayout(days, slot);\n const rows: TimeRow[] = [];\n\n // Each half of a cell's name is invariant along one axis: the day reads the\n // same down a column, the clock the same across a row. Formatting per CELL\n // asked the adapter for 336 of each on a default week (48 slots × 7 days)\n // where 48 clocks and 7 dates say the same thing, and\n // `WrNativeDateAdapter.format` builds a fresh `Intl.DateTimeFormat` per call.\n const dayLabels = days.map(date => this.adapter.format(date, 'longDate'));\n\n for (let minutes = from; minutes < to; minutes += slot) {\n const clock = this.clock(minutes);\n rows.push({\n key: String(minutes),\n minutes,\n major: minutes % 60 === 0,\n label: minutes % 60 === 0 ? clock : '',\n cells: days.map((date, col) => ({\n key: `${this.iso(date)}:${minutes}`,\n date,\n label: this.slotLabelText({ time: clock, date: dayLabels[col] }),\n chips: placed[col].filter(chip => chip.slotMinutes === minutes).map(chip => chip.chip),\n })),\n });\n }\n\n return rows;\n });\n\n // ------------------------------------------------------------------ nav\n\n protected step(direction: -1 | 1): void {\n const anchor = this.date();\n switch (this.view()) {\n case 'day':\n this.date.set(this.adapter.addDays(anchor, direction));\n break;\n case 'week':\n this.date.set(this.adapter.addDays(anchor, direction * DAYS_PER_WEEK));\n break;\n default:\n this.date.set(this.adapter.addMonths(anchor, direction));\n }\n }\n\n protected goToday(): void {\n this.date.set(this.adapter.today());\n }\n\n protected setView(view: WrCalendarView): void {\n this.view.set(view);\n }\n\n /** “+N more” opens that day — the overflow is only ever a month-view problem. */\n protected openDay(date: Date): void {\n this.date.set(date);\n this.view.set('day');\n }\n\n // -------------------------------------------------------------- pointer\n\n protected onChipPointerDown(event: PointerEvent, chipEvent: WrCalendarEvent, kind: 'move' | 'resize'): void {\n if (!this.canDrag(chipEvent) || event.button !== 0) return;\n\n // The cell is found by geometry, not through the chip: `cellUnder` skips\n // every chip in the hit-test stack, so neither this one nor a neighbour\n // overlapping it can stand in for the cell under the pointer.\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n try {\n (event.target as HTMLElement).setPointerCapture?.(event.pointerId);\n } catch {\n // Capture is an optimisation — it keeps the release on this element even\n // when the pointer leaves it. A pointer that is already gone throws here,\n // and losing capture is not a reason to lose the drag.\n }\n event.preventDefault();\n event.stopPropagation();\n\n this.drag.set({\n event: chipEvent,\n kind,\n originDate: cell.date,\n originMinutes: cell.minutes,\n pointerId: event.pointerId,\n });\n }\n\n protected onPointerUp(event: PointerEvent): void {\n const state = this.drag();\n this.drag.set(null);\n if (state?.pointerId !== event.pointerId) return;\n\n const cell = this.cellUnder(event.clientX, event.clientY);\n if (!cell) return;\n\n const dayDelta = this.daysBetween(state.originDate, cell.date);\n const minuteDelta = cell.minutes < 0 || state.originMinutes < 0 ? 0 : cell.minutes - state.originMinutes;\n if (dayDelta === 0 && minuteDelta === 0) return;\n\n const { event: source, kind } = state;\n if (kind === 'resize') {\n const end = this.shift(source.end, dayDelta, minuteDelta);\n // A resize that would end at or before the start is a no-op, not an\n // inverted event.\n if (end.getTime() <= source.start.getTime()) return;\n this.eventChange.emit({ event: source, start: source.start, end, kind });\n return;\n }\n\n this.eventChange.emit({\n event: source,\n start: this.shift(source.start, dayDelta, minuteDelta),\n end: this.shift(source.end, dayDelta, minuteDelta),\n kind,\n });\n }\n\n protected onChipClick(event: WrCalendarEvent): void {\n this.eventClick.emit(event);\n }\n\n protected onCellClick(date: Date, minutes: number): void {\n this.slotClick.emit(this.slotAt(date, minutes));\n }\n\n // ------------------------------------------------------------- keyboard\n\n protected onChipKeyDown(event: KeyboardEvent, chipEvent: WrCalendarEvent): void {\n if (event.key === 'Escape') {\n this.focusCell(event);\n return;\n }\n\n if (!event.altKey || !this.canDrag(chipEvent)) return;\n\n const slot = Math.max(5, this.slotMinutes());\n const inTime = this.view() !== 'month';\n let days = 0;\n let minutes = 0;\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n days = -1;\n break;\n case 'ArrowRight':\n days = 1;\n break;\n case 'ArrowUp':\n if (inTime) minutes = -slot;\n else days = -DAYS_PER_WEEK;\n break;\n case 'ArrowDown':\n if (inTime) minutes = slot;\n else days = DAYS_PER_WEEK;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n\n // `Shift` turns the same gesture into a resize, moving the END alone. Without it\n // the keyboard could move an event and never re-length one — and the resize grab\n // area is `aria-hidden` and unfocusable precisely BECAUSE this exists, so its\n // absence left the operation on the mouse only.\n if (event.shiftKey) {\n const end = this.shift(chipEvent.end, days, minutes);\n // Same rule as the pointer path: a resize that would end at or before the\n // start is a no-op rather than an inverted event.\n if (end.getTime() <= chipEvent.start.getTime()) return;\n this.eventChange.emit({ event: chipEvent, start: chipEvent.start, end, kind: 'resize' });\n this.refocusChip(chipEvent.id);\n return;\n }\n\n this.eventChange.emit({\n event: chipEvent,\n start: this.shift(chipEvent.start, days, minutes),\n end: this.shift(chipEvent.end, days, minutes),\n kind: 'move',\n });\n this.refocusChip(chipEvent.id);\n }\n\n /**\n * Put focus back on the chip a keyboard move re-rendered.\n *\n * A host that applies the change re-renders the event in another cell, under\n * another track key, so the focused button is destroyed and focus falls to\n * `<body>` — every `Alt` + arrow then had to start again from the top of the\n * page. Only a LOST focus is taken back: a host that refused the change, or\n * moved focus somewhere on purpose, is left alone. `afterNextRender`, never a\n * microtask: zoneless change detection runs in a macrotask, so a microtask\n * would look before the new chip exists.\n */\n private refocusChip(id: WrCalendarEvent['id']): void {\n afterNextRender(\n () => {\n const active = this.document.activeElement;\n if (active && active !== this.document.body && active.isConnected) return;\n const chip = [...this.host.nativeElement.querySelectorAll<HTMLElement>('.wr-event-calendar__chip')].find(\n el => el.dataset['eventId'] === String(id)\n );\n chip?.focus();\n },\n { injector: this.injector }\n );\n }\n\n protected onGridKeyDown(event: KeyboardEvent): void {\n // Handled per cell, not on the grid: the element carrying the keyboard\n // should be the one that actually holds focus. Chips sit inside cells and\n // own their keys, so let anything originating in one bubble straight past.\n if (event.target !== event.currentTarget) return;\n\n const [day, minutes] = this.cursorCell();\n const columns = this.days().length;\n const rows = this.rows();\n const inTime = this.view() !== 'month';\n let next: readonly [number, number];\n\n switch (this.inlineKey(event.key)) {\n case 'ArrowLeft':\n next = [Math.max(0, day - 1), minutes];\n break;\n case 'ArrowRight':\n next = [Math.min(columns - 1, day + 1), minutes];\n break;\n case 'ArrowUp':\n // Hold position at the top row, the way ArrowDown does at the bottom. A\n // `Math.max(0, …)` clamp reads as the same thing and is not: from the\n // Wednesday of the first week it lands on 0, so the cursor jumps\n // SIDEWAYS to Sunday instead of staying put.\n next = inTime\n ? [day, this.stepRow(minutes, -1, rows)]\n : [day - DAYS_PER_WEEK >= 0 ? day - DAYS_PER_WEEK : day, minutes];\n break;\n case 'ArrowDown':\n next = inTime\n ? [day, this.stepRow(minutes, 1, rows)]\n : [day + DAYS_PER_WEEK < columns ? day + DAYS_PER_WEEK : day, minutes];\n break;\n case 'Home':\n next = [day - (day % DAYS_PER_WEEK), minutes];\n break;\n case 'End':\n next = [Math.min(columns - 1, day - (day % DAYS_PER_WEEK) + DAYS_PER_WEEK - 1), minutes];\n break;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n const cell = event.target as HTMLElement;\n const chip = cell.querySelector<HTMLElement>('.wr-event-calendar__chip');\n if (chip) chip.focus();\n else this.onCellClick(this.days()[day], minutes);\n return;\n }\n default:\n return;\n }\n\n event.preventDefault();\n this.cursor.set(next);\n this.focusCursor(event.currentTarget as HTMLElement);\n }\n\n /**\n * Keep the roving cursor on the cell that actually has focus.\n *\n * The cursor was only ever written by an arrow key, while focus moves for three\n * other reasons — a click, a Tab onto a chip, Escape out of one — so the next\n * arrow read a coordinate nobody was standing on and threw focus back to it,\n * usually the top-left of the grid.\n */\n protected onCellFocus(day: number, minutes: number): void {\n const [d, m] = this.cursor();\n if (d !== day || m !== minutes) this.cursor.set([day, minutes]);\n }\n\n protected isCursor(day: number, minutes: number): boolean {\n const [d, m] = this.cursorCell();\n return d === day && m === minutes;\n }\n\n // --------------------------------------------------------------- layout\n\n /**\n * Greedy lane packing for day-spanning chips. Sorted by start then by length,\n * each segment takes the first lane its columns are free in — the classic\n * interval-graph colouring, and the reason a long event keeps one lane across\n * the whole week instead of stair-stepping.\n *\n * `limit` caps the visible lanes; anything past it is reported per column so\n * the cell can say how much it is hiding.\n */\n private bandLayout(\n events: readonly WrCalendarEvent[],\n days: readonly Date[],\n limit: number\n ): { chips: readonly BandChip[]; hidden: readonly number[] } {\n const first = days[0];\n const last = this.adapter.addDays(days[days.length - 1], 1);\n const lanes: number[][] = [];\n const chips: BandChip[] = [];\n const hidden = days.map(() => 0);\n\n for (const event of events) {\n if (event.end.getTime() <= first.getTime() || event.start.getTime() >= last.getTime()) continue;\n\n const from = Math.max(0, this.daysBetween(first, this.startOfDay(event.start)));\n // An exclusive end landing exactly on midnight belongs to the previous\n // day — otherwise every all-day event paints one column too wide.\n const endDay = this.startOfDay(new Date(event.end.getTime() - 1));\n const to = Math.min(days.length - 1, this.daysBetween(first, endDay));\n if (to < from) continue;\n\n let lane = lanes.findIndex(taken => taken.every(col => col < from || col > to));\n if (lane === -1) {\n lane = lanes.length;\n lanes.push([]);\n }\n for (let col = from; col <= to; col++) lanes[lane].push(col);\n\n if (lane >= limit) {\n for (let col = from; col <= to; col++) hidden[col]++;\n continue;\n }\n\n chips.push({\n key: `${String(event.id)}:${from}`,\n event,\n column: from,\n span: to - from + 1,\n lane,\n continuesBefore: event.start.getTime() < first.getTime(),\n continuesAfter: event.end.getTime() > last.getTime(),\n });\n }\n\n return { chips, hidden };\n }\n\n private laneCount(chips: readonly BandChip[]): number {\n return chips.reduce((count, chip) => Math.max(count, chip.lane + 1), 0);\n }\n\n /**\n * Column layout inside one day: events that overlap in time share the width.\n * Clusters are built by a running high-water mark — a new cluster starts the\n * moment an event begins after everything before it has ended.\n */\n private timeLayout(days: readonly Date[], slot: number): readonly { chip: TimeChip; slotMinutes: number }[][] {\n const from = Math.max(0, Math.min(23, this.dayStartHour())) * 60;\n const to = Math.max(from + slot, Math.min(24, this.dayEndHour()) * 60);\n const timed = this.visible().filter(e => !e.allDay && !this.spansWholeDay(e));\n\n return days.map(day => {\n const dayStart = this.startOfDay(day);\n const windowStart = dayStart.getTime() + from * 60_000;\n const windowEnd = dayStart.getTime() + to * 60_000;\n\n const onDay = timed\n .filter(e => e.end.getTime() > windowStart && e.start.getTime() < windowEnd)\n .map(event => ({\n event,\n from: Math.max(windowStart, event.start.getTime()),\n to: Math.min(windowEnd, event.end.getTime()),\n }))\n .sort((a, b) => {\n const byStart = a.from - b.from;\n return byStart !== 0 ? byStart : b.to - a.to;\n });\n\n const out: { chip: TimeChip; slotMinutes: number }[] = [];\n let cluster: typeof onDay = [];\n let highWater = -1;\n\n const flush = (): void => {\n for (const [index, item] of cluster.entries()) {\n const minutes = Math.floor((item.from - dayStart.getTime()) / 60_000);\n const slotStart = from + Math.floor((minutes - from) / slot) * slot;\n const length = (item.to - item.from) / 60_000;\n\n out.push({\n slotMinutes: slotStart,\n chip: {\n key: `${String(item.event.id)}:${minutes}`,\n event: item.event,\n top: ((minutes - slotStart) / slot) * 100,\n height: (length / slot) * 100,\n inlineStart: (index / cluster.length) * 100,\n width: (1 / cluster.length) * 100,\n continuesBefore: item.event.start.getTime() < windowStart,\n continuesAfter: item.event.end.getTime() > windowEnd,\n },\n });\n }\n cluster = [];\n };\n\n for (const item of onDay) {\n if (cluster.length > 0 && item.from >= highWater) flush();\n cluster.push(item);\n highWater = Math.max(highWater, item.to);\n }\n flush();\n\n return out;\n });\n }\n\n // --------------------------------------------------------------- chrome\n\n protected chipLabel(event: WrCalendarEvent): string {\n const time = event.allDay ? this.allDayLabel() : this.adapter.format(event.start, 'time');\n return this.chipLabelText({ title: event.title, time });\n }\n\n protected chipTime(event: WrCalendarEvent): string {\n return event.allDay ? this.allDayLabel() : this.adapter.format(event.start, 'time');\n }\n\n protected canDrag(event: WrCalendarEvent): boolean {\n return this.editable() && event.editable !== false;\n }\n\n // --------------------------------------------------------------- helpers\n\n private slotAt(date: Date, minutes: number): WrCalendarSlot {\n if (minutes < 0) {\n const start = this.startOfDay(date);\n return { start, end: this.adapter.addDays(start, 1), allDay: true };\n }\n const start = new Date(this.startOfDay(date).getTime() + minutes * 60_000);\n return { start, end: new Date(start.getTime() + Math.max(5, this.slotMinutes()) * 60_000), allDay: false };\n }\n\n /**\n * The `[data-cell-date]` under the pointer, or `null` outside the grid.\n *\n * Walks the whole hit-test stack rather than climbing from the topmost\n * element. A chip lives in the cell it STARTS in and reaches past it, so\n * `elementFromPoint(…).closest()` over any chip — a neighbour covering the\n * drop slot, a multi-day band covering the drop day — answered with that\n * chip's start cell, and the event landed there instead of under the\n * pointer. The stack lists the cell itself, below the chips; something that\n * is not part of this calendar coming first means the pointer is over\n * another layer, which is not a drop.\n */\n private cellUnder(x: number, y: number): { date: Date; minutes: number } | null {\n const host = this.host.nativeElement;\n for (const el of this.document.elementsFromPoint?.(x, y) ?? []) {\n if (!host.contains(el)) return null;\n if (!(el instanceof HTMLElement) || !el.matches('[data-cell-date]')) continue;\n // Epoch millis rather than a formatted date: `new Date('2026-08-08')` is\n // parsed as UTC and lands on the previous day west of Greenwich.\n const stamp = Number(el.dataset['cellDate']);\n if (!Number.isFinite(stamp)) return null;\n return { date: new Date(stamp), minutes: Number(el.dataset['cellMinutes'] ?? -1) };\n }\n return null;\n }\n\n /** Value of a cell's `data-cell-date`. @internal */\n protected stamp(date: Date): number {\n return this.startOfDay(date).getTime();\n }\n\n private focusCursor(from: HTMLElement): void {\n const [day, minutes] = this.cursorCell();\n from.closest('[role=\"grid\"]')?.querySelector<HTMLElement>(`[data-cell-index=\"${day}:${minutes}\"]`)?.focus();\n }\n\n private focusCell(event: KeyboardEvent): void {\n event.preventDefault();\n (event.target as HTMLElement).closest<HTMLElement>('[data-cell-date]')?.focus();\n }\n\n /**\n * Move one time row, treating the all-day band as the row above the first —\n * otherwise the band is mouse-only, which is the kind of gap that makes a\n * keyboard user give up on the whole grid.\n */\n private stepRow(minutes: number, direction: -1 | 1, rows: readonly TimeRow[]): number {\n if (minutes === -1) return direction === 1 ? (rows[0]?.minutes ?? -1) : -1;\n\n const index = rows.findIndex(row => row.minutes === minutes);\n if (index === -1) return rows[0]?.minutes ?? -1;\n if (index === 0 && direction === -1) return this.hasAllDay() ? -1 : minutes;\n\n return rows[Math.min(rows.length - 1, index + direction)].minutes;\n }\n\n private shift(date: Date, days: number, minutes: number): Date {\n return new Date(this.adapter.addDays(date, days).getTime() + minutes * 60_000);\n }\n\n private startOfDay(date: Date): Date {\n return this.adapter.setTime(date, 0, 0, 0);\n }\n\n private startOfWeek(date: Date): Date {\n const first = this.adapter.getFirstDayOfWeek();\n const offset = (this.adapter.getDayOfWeek(date) - first + DAYS_PER_WEEK) % DAYS_PER_WEEK;\n return this.startOfDay(this.adapter.addDays(date, -offset));\n }\n\n /** Whole days apart — computed on the day floor, so DST cannot round it off. */\n private daysBetween(from: Date, to: Date): number {\n const a = this.startOfDay(from);\n const b = this.startOfDay(to);\n return Math.round((b.getTime() - a.getTime()) / (MINUTES_PER_DAY * 60_000));\n }\n\n private spansWholeDay(event: WrCalendarEvent): boolean {\n return event.end.getTime() - event.start.getTime() >= MINUTES_PER_DAY * 60_000;\n }\n\n private clock(minutes: number): string {\n const date = this.adapter.setTime(this.adapter.today(), Math.floor(minutes / 60), minutes % 60, 0);\n return this.adapter.format(date, 'time');\n }\n\n private iso(date: Date): string {\n return `${this.adapter.getYear(date)}-${this.adapter.getMonth(date) + 1}-${this.adapter.getDate(date)}`;\n }\n\n /**\n * The key as the grid SEES it.\n *\n * A day step follows visual order, so under `dir=\"rtl\"` ArrowRight goes back a\n * day. Up/Down move by week or by row and never flip; Home/End are semantic.\n * Both key handlers route through here — the grid nav and the `Alt`+arrow drag,\n * which moves an event and would otherwise reschedule it the wrong way.\n */\n private inlineKey(key: string): string {\n if (this.dir?.value !== 'rtl') return key;\n if (key === 'ArrowRight') return 'ArrowLeft';\n if (key === 'ArrowLeft') return 'ArrowRight';\n return key;\n }\n}\n","<!--\n Two grids, one rule: a chip always lives inside the `role=\"gridcell\"` where it\n STARTS, and reaches out from there — `calc()` widths for day-spanning bands,\n percentage heights for timed chips. A floating events layer would read better\n in the template and would leave `role=\"row\"` owning something other than\n cells, which is exactly what the axe gate rejects.\n-->\n@if (!hideHeader()) {\n <div class=\"wr-event-calendar__header\">\n <div class=\"wr-event-calendar__nav\">\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--prev\"\n [attr.aria-label]=\"previousLabel()\"\n (click)=\"step(-1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button wr-btn type=\"button\" size=\"sm\" outlined class=\"wr-event-calendar__today\" (click)=\"goToday()\">\n {{ todayLabel() }}\n </button>\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-event-calendar__step wr-event-calendar__step--next\"\n [attr.aria-label]=\"nextLabel()\"\n (click)=\"step(1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n </div>\n\n <h2 class=\"wr-event-calendar__title\">{{ title() }}</h2>\n\n @if (switcher().length > 1) {\n <wr-btn-group>\n @for (item of switcher(); track item.view) {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-event-calendar__view\"\n [outlined]=\"view() !== item.view\"\n [color]=\"view() === item.view ? 'primary' : null\"\n [attr.aria-pressed]=\"view() === item.view\"\n (click)=\"setView(item.view)\"\n >\n {{ item.label }}\n </button>\n }\n </wr-btn-group>\n }\n </div>\n}\n\n@if (view() === 'month') {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--month\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n @for (name of weekdayNames(); track $index) {\n <div role=\"columnheader\" class=\"wr-event-calendar__weekday\">{{ name }}</div>\n }\n </div>\n\n @for (week of weeks(); track week.key; let w = $index) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [style.--wr-event-calendar-lanes]=\"week.lanes\">\n @for (cell of week.days; track cell.key; let c = $index) {\n @let index = w * 7 + c;\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--day\"\n [class.wr-event-calendar__cell--muted]=\"!cell.inMonth\"\n [class.wr-event-calendar__cell--today]=\"cell.isToday\"\n [attr.tabindex]=\"isCursor(index, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${index}:-1`\"\n (focusin)=\"onCellFocus(index, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n <span class=\"wr-event-calendar__daynum\" aria-hidden=\"true\">{{ cell.day }}</span>\n\n @for (chip of cell.bands; track chip.key) {\n <ng-container\n [ngTemplateOutlet]=\"band\"\n [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '1.75rem' }\"\n />\n }\n\n @if (cell.hidden > 0) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__more\"\n [style.--wr-event-calendar-lane]=\"maxLanes()\"\n (click)=\"openDay(cell.date); $event.stopPropagation()\"\n >\n {{ moreLabel({ count: cell.hidden }) }}\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n} @else {\n <div\n role=\"grid\"\n class=\"wr-event-calendar__grid wr-event-calendar__grid--time\"\n [style.--wr-event-calendar-cols]=\"columns().length\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div role=\"row\" class=\"wr-event-calendar__row\">\n <div role=\"columnheader\" class=\"wr-event-calendar__gutter\" [attr.aria-label]=\"timeLabel()\"></div>\n @for (column of columns(); track column.key) {\n <div\n role=\"columnheader\"\n class=\"wr-event-calendar__colhead\"\n [class.wr-event-calendar__colhead--today]=\"column.isToday\"\n >\n <span class=\"wr-event-calendar__colhead-weekday\">{{ column.weekday }}</span>\n <span class=\"wr-event-calendar__colhead-day\">{{ column.day }}</span>\n </div>\n }\n </div>\n\n @if (hasAllDay()) {\n <div\n role=\"row\"\n class=\"wr-event-calendar__row wr-event-calendar__row--allday\"\n [style.--wr-event-calendar-lanes]=\"allDayLanes()\"\n >\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ allDayLabel() }}</div>\n @for (cell of allDayCells(); track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--allday\"\n [attr.tabindex]=\"isCursor(c, -1) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"-1\"\n [attr.data-cell-index]=\"`${c}:-1`\"\n (focusin)=\"onCellFocus(c, -1)\"\n (click)=\"onCellClick(cell.date, -1)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.bands; track chip.key) {\n <ng-container [ngTemplateOutlet]=\"band\" [ngTemplateOutletContext]=\"{ $implicit: chip, offset: '0rem' }\" />\n }\n </div>\n }\n </div>\n }\n\n @for (row of rows(); track row.key) {\n <div role=\"row\" class=\"wr-event-calendar__row\" [class.wr-event-calendar__row--major]=\"row.major\">\n <div role=\"rowheader\" class=\"wr-event-calendar__gutter\">{{ row.label }}</div>\n @for (cell of row.cells; track cell.key; let c = $index) {\n <div\n role=\"gridcell\"\n class=\"wr-event-calendar__cell wr-event-calendar__cell--slot\"\n [class.wr-event-calendar__cell--major]=\"row.major\"\n [attr.tabindex]=\"isCursor(c, row.minutes) ? 0 : -1\"\n [attr.data-cell-date]=\"stamp(cell.date)\"\n [attr.data-cell-minutes]=\"row.minutes\"\n [attr.data-cell-index]=\"`${c}:${row.minutes}`\"\n (focusin)=\"onCellFocus(c, row.minutes)\"\n (click)=\"onCellClick(cell.date, row.minutes)\"\n (keydown)=\"onGridKeyDown($event)\"\n >\n <span class=\"wr-event-calendar__sr-only\">{{ cell.label }}</span>\n @for (chip of cell.chips; track chip.key) {\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--time\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.top.%]=\"chip.top\"\n [style.--wr-event-calendar-block-size.%]=\"chip.height\"\n [style.--wr-event-calendar-inline-start.%]=\"chip.inlineStart\"\n [style.--wr-event-calendar-inline-size.%]=\"chip.width\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n <span class=\"wr-event-calendar__chip-time\" aria-hidden=\"true\">{{ chipTime(chip.event) }}</span>\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n\n @if (canDrag(chip.event) && !chip.continuesAfter) {\n <!--\n A grab area, not a control: the same resize is on the keyboard as\n `Alt` + `Shift` + arrows on the chip itself, so exposing a second\n focusable thing here would add a tab stop that leads nowhere.\n -->\n <span\n class=\"wr-event-calendar__resize\"\n aria-hidden=\"true\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'resize')\"\n ></span>\n }\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n}\n\n<!-- One chip shape for both day-spanning cases: month cells and the all-day band. -->\n<ng-template #band let-chip let-offset=\"offset\">\n <button\n type=\"button\"\n class=\"wr-event-calendar__chip wr-event-calendar__chip--band\"\n [class.wr-event-calendar__chip--dragging]=\"dragging() === chip.event.id\"\n [class.wr-event-calendar__chip--continues-before]=\"chip.continuesBefore\"\n [class.wr-event-calendar__chip--continues-after]=\"chip.continuesAfter\"\n [style.--wr-event-calendar-color]=\"`var(--wr-color-${chip.event.color ?? 'primary'})`\"\n [style.--wr-event-calendar-span]=\"chip.span\"\n [style.--wr-event-calendar-lane]=\"chip.lane\"\n [style.--wr-event-calendar-offset]=\"offset\"\n [attr.aria-label]=\"chipLabel(chip.event)\"\n [attr.data-event-id]=\"chip.event.id\"\n (click)=\"onChipClick(chip.event); $event.stopPropagation()\"\n (keydown)=\"onChipKeyDown($event, chip.event)\"\n (pointerdown)=\"onChipPointerDown($event, chip.event, 'move')\"\n >\n @if (chipTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: chip.event }\" />\n } @else {\n <span class=\"wr-event-calendar__chip-title\" aria-hidden=\"true\">{{ chip.event.title }}</span>\n }\n </button>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,IAAa,0BAAb,MAAa,wBAAuB;CACzB,WAAW,OAA4C,WAAW;CADhE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAuB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAvB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAuB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAvB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EAHnC,MAAA;EAAU,MAAA,CAAA,EACT,UAAU,+BACX,CAAA;;;;;;;;;ACkBD,MAAM,cAAc,OAAsB,IAAI,CAAC,CAAC,WAAU;AAE1D,M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A,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,uBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -74,7 +74,7 @@ var WrFileUpload = class WrFileUpload {
74
74
  host = inject(ElementRef);
75
75
  injector = inject(Injector);
76
76
  classes = computed(() => {
77
- const parts = ["wr-file-upload"];
77
+ const parts = [];
78
78
  if (this.dragging()) parts.push("wr-file-upload--dragging");
79
79
  if (this.disabled()) parts.push("wr-file-upload--disabled");
80
80
  else if (this.readonly()) parts.push("wr-file-upload--readonly");
@@ -327,7 +327,10 @@ var WrFileUpload = class WrFileUpload {
327
327
  rejected: "rejected",
328
328
  touch: "touch"
329
329
  },
330
- host: { properties: { "class": "classes()" } },
330
+ host: {
331
+ properties: { "class": "classes()" },
332
+ classAttribute: "wr-file-upload"
333
+ },
331
334
  viewQueries: [{
332
335
  propertyName: "picker",
333
336
  first: true,
@@ -356,7 +359,10 @@ i0.ɵɵngDeclareClassMetadata({
356
359
  args: [{
357
360
  selector: "wr-file-upload",
358
361
  encapsulation: ViewEncapsulation.None,
359
- host: { "[class]": "classes()" },
362
+ host: {
363
+ class: "wr-file-upload",
364
+ "[class]": "classes()"
365
+ },
360
366
  imports: [],
361
367
  template: "<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>\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\">\n @for (file of files(); track $index) {\n <li class=\"wr-file-upload__item\">\n <span class=\"wr-file-upload__name\" [title]=\"file.name\">{{ file.name }}</span>\n <span class=\"wr-file-upload__size\">{{ formatBytes(file.size) }}</span>\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"resolvedRemove()\"\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 </li>\n }\n </ul>\n}\n"
362
368
  }]
@@ -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 {\n Component,\n ElementRef,\n Injector,\n LOCALE_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 { useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrFileUploadRejection, WrFileUploadRejectionReason } from './types';\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 * @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]': 'classes()' },\n imports: [],\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 /** 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 /** 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 /** Remove-file button aria-label. Falls back to `fileUpload.removeFile`. */\n readonly removeFileLabel = 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 protected readonly resolvedRemove = useI18nText(this.removeFileLabel, 'fileUpload.removeFile', 'Remove file');\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 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\n protected readonly classes = computed(() => {\n const parts = ['wr-file-upload'];\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\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 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 next = [...this.files(), ...accepted];\n const maxFiles = this.maxFiles();\n if (maxFiles > 0 && next.length > maxFiles) {\n const overflow = next.splice(maxFiles);\n for (const file of overflow) rejections.push({ file, reason: 'count' });\n }\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 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>\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\">\n @for (file of files(); track $index) {\n <li class=\"wr-file-upload__item\">\n <span class=\"wr-file-upload__name\" [title]=\"file.name\">{{ file.name }}</span>\n <span class=\"wr-file-upload__size\">{{ formatBytes(file.size) }}</span>\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"resolvedRemove()\"\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 </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AAA;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 {\n Component,\n ElementRef,\n Injector,\n LOCALE_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 { useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrFileUploadRejection, WrFileUploadRejectionReason } from './types';\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 * @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: [],\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 /** 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 /** 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 /** Remove-file button aria-label. Falls back to `fileUpload.removeFile`. */\n readonly removeFileLabel = 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 protected readonly resolvedRemove = useI18nText(this.removeFileLabel, 'fileUpload.removeFile', 'Remove file');\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 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\n protected readonly classes = computed(() => {\n const parts: string[] = [];\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\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 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 next = [...this.files(), ...accepted];\n const maxFiles = this.maxFiles();\n if (maxFiles > 0 && next.length > maxFiles) {\n const overflow = next.splice(maxFiles);\n for (const file of overflow) rejections.push({ file, reason: 'count' });\n }\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 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>\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\">\n @for (file of files(); track $index) {\n <li class=\"wr-file-upload__item\">\n <span class=\"wr-file-upload__name\" [title]=\"file.name\">{{ file.name }}</span>\n <span class=\"wr-file-upload__size\">{{ formatBytes(file.size) }}</span>\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"resolvedRemove()\"\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 </li>\n }\n </ul>\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,SAAS,cAAc,MAAY,QAAc;CAC/C,IAAI,CAAC,QAAQ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