@fragiola/primitives-angular 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/LICENSE +21 -0
  3. package/README.md +54 -2
  4. package/fesm2022/fragiola-primitives-angular-accordion.mjs +567 -0
  5. package/fesm2022/fragiola-primitives-angular-accordion.mjs.map +1 -0
  6. package/fesm2022/fragiola-primitives-angular-alert-dialog.mjs +562 -0
  7. package/fesm2022/fragiola-primitives-angular-alert-dialog.mjs.map +1 -0
  8. package/fesm2022/fragiola-primitives-angular-aspect-ratio.mjs +79 -0
  9. package/fesm2022/fragiola-primitives-angular-aspect-ratio.mjs.map +1 -0
  10. package/fesm2022/fragiola-primitives-angular-async-list.mjs +44 -0
  11. package/fesm2022/fragiola-primitives-angular-async-list.mjs.map +1 -0
  12. package/fesm2022/fragiola-primitives-angular-autocomplete-virtual.mjs +243 -0
  13. package/fesm2022/fragiola-primitives-angular-autocomplete-virtual.mjs.map +1 -0
  14. package/fesm2022/fragiola-primitives-angular-autocomplete.mjs +1751 -0
  15. package/fesm2022/fragiola-primitives-angular-autocomplete.mjs.map +1 -0
  16. package/fesm2022/fragiola-primitives-angular-avatar.mjs +308 -0
  17. package/fesm2022/fragiola-primitives-angular-avatar.mjs.map +1 -0
  18. package/fesm2022/fragiola-primitives-angular-breadcrumbs.mjs +355 -0
  19. package/fesm2022/fragiola-primitives-angular-breadcrumbs.mjs.map +1 -0
  20. package/fesm2022/fragiola-primitives-angular-button.mjs +156 -0
  21. package/fesm2022/fragiola-primitives-angular-button.mjs.map +1 -0
  22. package/fesm2022/fragiola-primitives-angular-calendar-preset.mjs +126 -0
  23. package/fesm2022/fragiola-primitives-angular-calendar-preset.mjs.map +1 -0
  24. package/fesm2022/fragiola-primitives-angular-calendar-view.mjs +289 -0
  25. package/fesm2022/fragiola-primitives-angular-calendar-view.mjs.map +1 -0
  26. package/fesm2022/fragiola-primitives-angular-calendar.mjs +1222 -0
  27. package/fesm2022/fragiola-primitives-angular-calendar.mjs.map +1 -0
  28. package/fesm2022/fragiola-primitives-angular-carousel.mjs +1031 -0
  29. package/fesm2022/fragiola-primitives-angular-carousel.mjs.map +1 -0
  30. package/fesm2022/fragiola-primitives-angular-cascade-select.mjs +1391 -0
  31. package/fesm2022/fragiola-primitives-angular-cascade-select.mjs.map +1 -0
  32. package/fesm2022/fragiola-primitives-angular-checkbox-group.mjs +221 -0
  33. package/fesm2022/fragiola-primitives-angular-checkbox-group.mjs.map +1 -0
  34. package/fesm2022/fragiola-primitives-angular-checkbox.mjs +474 -0
  35. package/fesm2022/fragiola-primitives-angular-checkbox.mjs.map +1 -0
  36. package/fesm2022/fragiola-primitives-angular-clipboard.mjs +389 -0
  37. package/fesm2022/fragiola-primitives-angular-clipboard.mjs.map +1 -0
  38. package/fesm2022/fragiola-primitives-angular-collapsible.mjs +314 -0
  39. package/fesm2022/fragiola-primitives-angular-collapsible.mjs.map +1 -0
  40. package/fesm2022/fragiola-primitives-angular-color-area.mjs +609 -0
  41. package/fesm2022/fragiola-primitives-angular-color-area.mjs.map +1 -0
  42. package/fesm2022/fragiola-primitives-angular-color-field.mjs +675 -0
  43. package/fesm2022/fragiola-primitives-angular-color-field.mjs.map +1 -0
  44. package/fesm2022/fragiola-primitives-angular-color-picker-popover.mjs +572 -0
  45. package/fesm2022/fragiola-primitives-angular-color-picker-popover.mjs.map +1 -0
  46. package/fesm2022/fragiola-primitives-angular-color-picker.mjs +528 -0
  47. package/fesm2022/fragiola-primitives-angular-color-picker.mjs.map +1 -0
  48. package/fesm2022/fragiola-primitives-angular-color-slider.mjs +868 -0
  49. package/fesm2022/fragiola-primitives-angular-color-slider.mjs.map +1 -0
  50. package/fesm2022/fragiola-primitives-angular-color-swatch-picker.mjs +503 -0
  51. package/fesm2022/fragiola-primitives-angular-color-swatch-picker.mjs.map +1 -0
  52. package/fesm2022/fragiola-primitives-angular-color-swatch.mjs +141 -0
  53. package/fesm2022/fragiola-primitives-angular-color-swatch.mjs.map +1 -0
  54. package/fesm2022/fragiola-primitives-angular-color-wheel.mjs +554 -0
  55. package/fesm2022/fragiola-primitives-angular-color-wheel.mjs.map +1 -0
  56. package/fesm2022/fragiola-primitives-angular-combobox-virtual.mjs +247 -0
  57. package/fesm2022/fragiola-primitives-angular-combobox-virtual.mjs.map +1 -0
  58. package/fesm2022/fragiola-primitives-angular-combobox.mjs +2083 -0
  59. package/fesm2022/fragiola-primitives-angular-combobox.mjs.map +1 -0
  60. package/fesm2022/fragiola-primitives-angular-command-virtual.mjs +263 -0
  61. package/fesm2022/fragiola-primitives-angular-command-virtual.mjs.map +1 -0
  62. package/fesm2022/fragiola-primitives-angular-command.mjs +977 -0
  63. package/fesm2022/fragiola-primitives-angular-command.mjs.map +1 -0
  64. package/fesm2022/fragiola-primitives-angular-context-menu.mjs +1012 -0
  65. package/fesm2022/fragiola-primitives-angular-context-menu.mjs.map +1 -0
  66. package/fesm2022/fragiola-primitives-angular-date-field.mjs +1030 -0
  67. package/fesm2022/fragiola-primitives-angular-date-field.mjs.map +1 -0
  68. package/fesm2022/fragiola-primitives-angular-date-picker-input.mjs +511 -0
  69. package/fesm2022/fragiola-primitives-angular-date-picker-input.mjs.map +1 -0
  70. package/fesm2022/fragiola-primitives-angular-date-picker.mjs +991 -0
  71. package/fesm2022/fragiola-primitives-angular-date-picker.mjs.map +1 -0
  72. package/fesm2022/fragiola-primitives-angular-date-range-field.mjs +847 -0
  73. package/fesm2022/fragiola-primitives-angular-date-range-field.mjs.map +1 -0
  74. package/fesm2022/fragiola-primitives-angular-date-range-picker-input.mjs +260 -0
  75. package/fesm2022/fragiola-primitives-angular-date-range-picker-input.mjs.map +1 -0
  76. package/fesm2022/fragiola-primitives-angular-date-range-picker.mjs +128 -0
  77. package/fesm2022/fragiola-primitives-angular-date-range-picker.mjs.map +1 -0
  78. package/fesm2022/fragiola-primitives-angular-dialog.mjs +1076 -0
  79. package/fesm2022/fragiola-primitives-angular-dialog.mjs.map +1 -0
  80. package/fesm2022/fragiola-primitives-angular-direction.mjs +82 -0
  81. package/fesm2022/fragiola-primitives-angular-direction.mjs.map +1 -0
  82. package/fesm2022/fragiola-primitives-angular-drawer.mjs +890 -0
  83. package/fesm2022/fragiola-primitives-angular-drawer.mjs.map +1 -0
  84. package/fesm2022/fragiola-primitives-angular-drop-zone.mjs +189 -0
  85. package/fesm2022/fragiola-primitives-angular-drop-zone.mjs.map +1 -0
  86. package/fesm2022/fragiola-primitives-angular-editable.mjs +955 -0
  87. package/fesm2022/fragiola-primitives-angular-editable.mjs.map +1 -0
  88. package/fesm2022/fragiola-primitives-angular-field.mjs +929 -0
  89. package/fesm2022/fragiola-primitives-angular-field.mjs.map +1 -0
  90. package/fesm2022/fragiola-primitives-angular-fieldset.mjs +164 -0
  91. package/fesm2022/fragiola-primitives-angular-fieldset.mjs.map +1 -0
  92. package/fesm2022/fragiola-primitives-angular-file-upload.mjs +1370 -0
  93. package/fesm2022/fragiola-primitives-angular-file-upload.mjs.map +1 -0
  94. package/fesm2022/fragiola-primitives-angular-form.mjs +162 -0
  95. package/fesm2022/fragiola-primitives-angular-form.mjs.map +1 -0
  96. package/fesm2022/fragiola-primitives-angular-hover-card.mjs +906 -0
  97. package/fesm2022/fragiola-primitives-angular-hover-card.mjs.map +1 -0
  98. package/fesm2022/fragiola-primitives-angular-internal.mjs +980 -0
  99. package/fesm2022/fragiola-primitives-angular-internal.mjs.map +1 -0
  100. package/fesm2022/fragiola-primitives-angular-label.mjs +65 -0
  101. package/fesm2022/fragiola-primitives-angular-label.mjs.map +1 -0
  102. package/fesm2022/fragiola-primitives-angular-link.mjs +109 -0
  103. package/fesm2022/fragiola-primitives-angular-link.mjs.map +1 -0
  104. package/fesm2022/fragiola-primitives-angular-listbox-virtual.mjs +657 -0
  105. package/fesm2022/fragiola-primitives-angular-listbox-virtual.mjs.map +1 -0
  106. package/fesm2022/fragiola-primitives-angular-listbox.mjs +851 -0
  107. package/fesm2022/fragiola-primitives-angular-listbox.mjs.map +1 -0
  108. package/fesm2022/fragiola-primitives-angular-menu.mjs +2258 -0
  109. package/fesm2022/fragiola-primitives-angular-menu.mjs.map +1 -0
  110. package/fesm2022/fragiola-primitives-angular-menubar.mjs +303 -0
  111. package/fesm2022/fragiola-primitives-angular-menubar.mjs.map +1 -0
  112. package/fesm2022/fragiola-primitives-angular-meter.mjs +410 -0
  113. package/fesm2022/fragiola-primitives-angular-meter.mjs.map +1 -0
  114. package/fesm2022/fragiola-primitives-angular-month-calendar.mjs +1066 -0
  115. package/fesm2022/fragiola-primitives-angular-month-calendar.mjs.map +1 -0
  116. package/fesm2022/fragiola-primitives-angular-month-picker.mjs +514 -0
  117. package/fesm2022/fragiola-primitives-angular-month-picker.mjs.map +1 -0
  118. package/fesm2022/fragiola-primitives-angular-month-range-calendar.mjs +163 -0
  119. package/fesm2022/fragiola-primitives-angular-month-range-calendar.mjs.map +1 -0
  120. package/fesm2022/fragiola-primitives-angular-month-range-picker.mjs +177 -0
  121. package/fesm2022/fragiola-primitives-angular-month-range-picker.mjs.map +1 -0
  122. package/fesm2022/fragiola-primitives-angular-multiple-calendar.mjs +216 -0
  123. package/fesm2022/fragiola-primitives-angular-multiple-calendar.mjs.map +1 -0
  124. package/fesm2022/fragiola-primitives-angular-navigation-menu.mjs +1413 -0
  125. package/fesm2022/fragiola-primitives-angular-navigation-menu.mjs.map +1 -0
  126. package/fesm2022/fragiola-primitives-angular-number-field.mjs +1210 -0
  127. package/fesm2022/fragiola-primitives-angular-number-field.mjs.map +1 -0
  128. package/fesm2022/fragiola-primitives-angular-otp-field.mjs +751 -0
  129. package/fesm2022/fragiola-primitives-angular-otp-field.mjs.map +1 -0
  130. package/fesm2022/fragiola-primitives-angular-pagination.mjs +758 -0
  131. package/fesm2022/fragiola-primitives-angular-pagination.mjs.map +1 -0
  132. package/fesm2022/fragiola-primitives-angular-password-input.mjs +542 -0
  133. package/fesm2022/fragiola-primitives-angular-password-input.mjs.map +1 -0
  134. package/fesm2022/fragiola-primitives-angular-popover.mjs +1011 -0
  135. package/fesm2022/fragiola-primitives-angular-popover.mjs.map +1 -0
  136. package/fesm2022/fragiola-primitives-angular-progress.mjs +472 -0
  137. package/fesm2022/fragiola-primitives-angular-progress.mjs.map +1 -0
  138. package/fesm2022/fragiola-primitives-angular-radio-group.mjs +321 -0
  139. package/fesm2022/fragiola-primitives-angular-radio-group.mjs.map +1 -0
  140. package/fesm2022/fragiola-primitives-angular-radio.mjs +273 -0
  141. package/fesm2022/fragiola-primitives-angular-radio.mjs.map +1 -0
  142. package/fesm2022/fragiola-primitives-angular-range-calendar.mjs +108 -0
  143. package/fesm2022/fragiola-primitives-angular-range-calendar.mjs.map +1 -0
  144. package/fesm2022/fragiola-primitives-angular-rating.mjs +643 -0
  145. package/fesm2022/fragiola-primitives-angular-rating.mjs.map +1 -0
  146. package/fesm2022/fragiola-primitives-angular-render.mjs +1 -0
  147. package/fesm2022/fragiola-primitives-angular-scroll-area.mjs +553 -0
  148. package/fesm2022/fragiola-primitives-angular-scroll-area.mjs.map +1 -0
  149. package/fesm2022/fragiola-primitives-angular-search-field.mjs +487 -0
  150. package/fesm2022/fragiola-primitives-angular-search-field.mjs.map +1 -0
  151. package/fesm2022/fragiola-primitives-angular-segmented-control.mjs +762 -0
  152. package/fesm2022/fragiola-primitives-angular-segmented-control.mjs.map +1 -0
  153. package/fesm2022/fragiola-primitives-angular-select-virtual.mjs +246 -0
  154. package/fesm2022/fragiola-primitives-angular-select-virtual.mjs.map +1 -0
  155. package/fesm2022/fragiola-primitives-angular-select.mjs +1433 -0
  156. package/fesm2022/fragiola-primitives-angular-select.mjs.map +1 -0
  157. package/fesm2022/fragiola-primitives-angular-separator.mjs +102 -0
  158. package/fesm2022/fragiola-primitives-angular-separator.mjs.map +1 -0
  159. package/fesm2022/fragiola-primitives-angular-slider.mjs +1090 -0
  160. package/fesm2022/fragiola-primitives-angular-slider.mjs.map +1 -0
  161. package/fesm2022/fragiola-primitives-angular-steps.mjs +819 -0
  162. package/fesm2022/fragiola-primitives-angular-steps.mjs.map +1 -0
  163. package/fesm2022/fragiola-primitives-angular-switch.mjs +422 -0
  164. package/fesm2022/fragiola-primitives-angular-switch.mjs.map +1 -0
  165. package/fesm2022/fragiola-primitives-angular-tabs.mjs +726 -0
  166. package/fesm2022/fragiola-primitives-angular-tabs.mjs.map +1 -0
  167. package/fesm2022/fragiola-primitives-angular-tag-group.mjs +768 -0
  168. package/fesm2022/fragiola-primitives-angular-tag-group.mjs.map +1 -0
  169. package/fesm2022/fragiola-primitives-angular-tags-input.mjs +1126 -0
  170. package/fesm2022/fragiola-primitives-angular-tags-input.mjs.map +1 -0
  171. package/fesm2022/fragiola-primitives-angular-time-field.mjs +187 -0
  172. package/fesm2022/fragiola-primitives-angular-time-field.mjs.map +1 -0
  173. package/fesm2022/fragiola-primitives-angular-time-range-field.mjs +188 -0
  174. package/fesm2022/fragiola-primitives-angular-time-range-field.mjs.map +1 -0
  175. package/fesm2022/fragiola-primitives-angular-toast.mjs +744 -0
  176. package/fesm2022/fragiola-primitives-angular-toast.mjs.map +1 -0
  177. package/fesm2022/fragiola-primitives-angular-toggle-group.mjs +245 -0
  178. package/fesm2022/fragiola-primitives-angular-toggle-group.mjs.map +1 -0
  179. package/fesm2022/fragiola-primitives-angular-toggle.mjs +229 -0
  180. package/fesm2022/fragiola-primitives-angular-toggle.mjs.map +1 -0
  181. package/fesm2022/fragiola-primitives-angular-toolbar.mjs +623 -0
  182. package/fesm2022/fragiola-primitives-angular-toolbar.mjs.map +1 -0
  183. package/fesm2022/fragiola-primitives-angular-tooltip.mjs +975 -0
  184. package/fesm2022/fragiola-primitives-angular-tooltip.mjs.map +1 -0
  185. package/fesm2022/fragiola-primitives-angular-year-calendar.mjs +163 -0
  186. package/fesm2022/fragiola-primitives-angular-year-calendar.mjs.map +1 -0
  187. package/fesm2022/fragiola-primitives-angular-year-picker.mjs +177 -0
  188. package/fesm2022/fragiola-primitives-angular-year-picker.mjs.map +1 -0
  189. package/fesm2022/fragiola-primitives-angular-year-range-calendar.mjs +163 -0
  190. package/fesm2022/fragiola-primitives-angular-year-range-calendar.mjs.map +1 -0
  191. package/fesm2022/fragiola-primitives-angular-year-range-picker.mjs +177 -0
  192. package/fesm2022/fragiola-primitives-angular-year-range-picker.mjs.map +1 -0
  193. package/fesm2022/fragiola-primitives-angular.mjs +94 -0
  194. package/package.json +437 -3
  195. package/types/fragiola-primitives-angular-accordion.d.ts +154 -0
  196. package/types/fragiola-primitives-angular-alert-dialog.d.ts +176 -0
  197. package/types/fragiola-primitives-angular-aspect-ratio.d.ts +25 -0
  198. package/types/fragiola-primitives-angular-async-list.d.ts +32 -0
  199. package/types/fragiola-primitives-angular-autocomplete-virtual.d.ts +82 -0
  200. package/types/fragiola-primitives-angular-autocomplete.d.ts +496 -0
  201. package/types/fragiola-primitives-angular-avatar.d.ts +94 -0
  202. package/types/fragiola-primitives-angular-breadcrumbs.d.ts +62 -0
  203. package/types/fragiola-primitives-angular-button.d.ts +66 -0
  204. package/types/fragiola-primitives-angular-calendar-preset.d.ts +35 -0
  205. package/types/fragiola-primitives-angular-calendar-view.d.ts +80 -0
  206. package/types/fragiola-primitives-angular-calendar.d.ts +414 -0
  207. package/types/fragiola-primitives-angular-carousel.d.ts +300 -0
  208. package/types/fragiola-primitives-angular-cascade-select.d.ts +404 -0
  209. package/types/fragiola-primitives-angular-checkbox-group.d.ts +74 -0
  210. package/types/fragiola-primitives-angular-checkbox.d.ts +111 -0
  211. package/types/fragiola-primitives-angular-clipboard.d.ts +106 -0
  212. package/types/fragiola-primitives-angular-collapsible.d.ts +88 -0
  213. package/types/fragiola-primitives-angular-color-area.d.ts +174 -0
  214. package/types/fragiola-primitives-angular-color-field.d.ts +174 -0
  215. package/types/fragiola-primitives-angular-color-picker-popover.d.ts +180 -0
  216. package/types/fragiola-primitives-angular-color-picker.d.ts +137 -0
  217. package/types/fragiola-primitives-angular-color-slider.d.ts +228 -0
  218. package/types/fragiola-primitives-angular-color-swatch-picker.d.ts +146 -0
  219. package/types/fragiola-primitives-angular-color-swatch.d.ts +43 -0
  220. package/types/fragiola-primitives-angular-color-wheel.d.ts +144 -0
  221. package/types/fragiola-primitives-angular-combobox-virtual.d.ts +84 -0
  222. package/types/fragiola-primitives-angular-combobox.d.ts +582 -0
  223. package/types/fragiola-primitives-angular-command-virtual.d.ts +93 -0
  224. package/types/fragiola-primitives-angular-command.d.ts +283 -0
  225. package/types/fragiola-primitives-angular-context-menu.d.ts +278 -0
  226. package/types/fragiola-primitives-angular-date-field.d.ts +486 -0
  227. package/types/fragiola-primitives-angular-date-picker-input.d.ts +139 -0
  228. package/types/fragiola-primitives-angular-date-picker.d.ts +331 -0
  229. package/types/fragiola-primitives-angular-date-range-field.d.ts +333 -0
  230. package/types/fragiola-primitives-angular-date-range-picker-input.d.ts +89 -0
  231. package/types/fragiola-primitives-angular-date-range-picker.d.ts +35 -0
  232. package/types/fragiola-primitives-angular-dialog.d.ts +359 -0
  233. package/types/fragiola-primitives-angular-direction.d.ts +31 -0
  234. package/types/fragiola-primitives-angular-drawer.d.ts +242 -0
  235. package/types/fragiola-primitives-angular-drop-zone.d.ts +68 -0
  236. package/types/fragiola-primitives-angular-editable.d.ts +219 -0
  237. package/types/fragiola-primitives-angular-field.d.ts +397 -0
  238. package/types/fragiola-primitives-angular-fieldset.d.ts +47 -0
  239. package/types/fragiola-primitives-angular-file-upload.d.ts +351 -0
  240. package/types/fragiola-primitives-angular-form.d.ts +44 -0
  241. package/types/fragiola-primitives-angular-hover-card.d.ts +279 -0
  242. package/types/fragiola-primitives-angular-internal.d.ts +695 -0
  243. package/types/fragiola-primitives-angular-label.d.ts +14 -0
  244. package/types/fragiola-primitives-angular-link.d.ts +33 -0
  245. package/types/fragiola-primitives-angular-listbox-virtual.d.ts +193 -0
  246. package/types/fragiola-primitives-angular-listbox.d.ts +237 -0
  247. package/types/fragiola-primitives-angular-menu.d.ts +758 -0
  248. package/types/fragiola-primitives-angular-menubar.d.ts +76 -0
  249. package/types/fragiola-primitives-angular-meter.d.ts +117 -0
  250. package/types/fragiola-primitives-angular-month-calendar.d.ts +380 -0
  251. package/types/fragiola-primitives-angular-month-picker.d.ts +183 -0
  252. package/types/fragiola-primitives-angular-month-range-calendar.d.ts +54 -0
  253. package/types/fragiola-primitives-angular-month-range-picker.d.ts +56 -0
  254. package/types/fragiola-primitives-angular-multiple-calendar.d.ts +73 -0
  255. package/types/fragiola-primitives-angular-navigation-menu.d.ts +355 -0
  256. package/types/fragiola-primitives-angular-number-field.d.ts +305 -0
  257. package/types/fragiola-primitives-angular-otp-field.d.ts +210 -0
  258. package/types/fragiola-primitives-angular-pagination.d.ts +239 -0
  259. package/types/fragiola-primitives-angular-password-input.d.ts +149 -0
  260. package/types/fragiola-primitives-angular-popover.d.ts +303 -0
  261. package/types/fragiola-primitives-angular-progress.d.ts +126 -0
  262. package/types/fragiola-primitives-angular-radio-group.d.ts +123 -0
  263. package/types/fragiola-primitives-angular-radio.d.ts +67 -0
  264. package/types/fragiola-primitives-angular-range-calendar.d.ts +33 -0
  265. package/types/fragiola-primitives-angular-rating.d.ts +195 -0
  266. package/types/fragiola-primitives-angular-render.d.ts +2 -0
  267. package/types/fragiola-primitives-angular-scroll-area.d.ts +134 -0
  268. package/types/fragiola-primitives-angular-search-field.d.ts +129 -0
  269. package/types/fragiola-primitives-angular-segmented-control.d.ts +232 -0
  270. package/types/fragiola-primitives-angular-select-virtual.d.ts +81 -0
  271. package/types/fragiola-primitives-angular-select.d.ts +403 -0
  272. package/types/fragiola-primitives-angular-separator.d.ts +32 -0
  273. package/types/fragiola-primitives-angular-slider.d.ts +297 -0
  274. package/types/fragiola-primitives-angular-steps.d.ts +194 -0
  275. package/types/fragiola-primitives-angular-switch.d.ts +102 -0
  276. package/types/fragiola-primitives-angular-tabs.d.ts +215 -0
  277. package/types/fragiola-primitives-angular-tag-group.d.ts +232 -0
  278. package/types/fragiola-primitives-angular-tags-input.d.ts +318 -0
  279. package/types/fragiola-primitives-angular-time-field.d.ts +63 -0
  280. package/types/fragiola-primitives-angular-time-range-field.d.ts +65 -0
  281. package/types/fragiola-primitives-angular-toast.d.ts +196 -0
  282. package/types/fragiola-primitives-angular-toggle-group.d.ts +89 -0
  283. package/types/fragiola-primitives-angular-toggle.d.ts +86 -0
  284. package/types/fragiola-primitives-angular-toolbar.d.ts +187 -0
  285. package/types/fragiola-primitives-angular-tooltip.d.ts +330 -0
  286. package/types/fragiola-primitives-angular-year-calendar.d.ts +54 -0
  287. package/types/fragiola-primitives-angular-year-picker.d.ts +56 -0
  288. package/types/fragiola-primitives-angular-year-range-calendar.d.ts +54 -0
  289. package/types/fragiola-primitives-angular-year-range-picker.d.ts +56 -0
  290. package/types/fragiola-primitives-angular.d.ts +94 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragiola-primitives-angular-internal.mjs","names":[],"sources":["../../internal/utils/button-behaviour.ts","../../internal/utils/change-details.ts","../../internal/utils/color-picker-binding.ts","../../internal/utils/conditional-view.ts","../../internal/utils/controllable.ts","../../internal/utils/file-drop-target.ts","../../internal/utils/flush.ts","../../internal/utils/hidden-input.ts","../../internal/utils/host-element.ts","../../internal/utils/inject-enclosing.ts","../../internal/utils/inject-id.ts","../../internal/utils/label-id.ts","../../internal/utils/link-press.ts","../../internal/utils/live-region.ts","../../internal/utils/overlay-handle.ts","../../internal/utils/presence.ts","../../internal/utils/overlay-root.ts","../../internal/utils/overlay-trigger.ts","../../internal/utils/own-attribute.ts","../../internal/utils/panel-transition.ts","../../internal/utils/portal.ts","../../internal/utils/provided-direction.ts","../../internal/utils/positioner.ts","../../internal/utils/roving-composite.ts","../../internal/utils/roving-scope.ts","../../internal/utils/roving-item.ts","../../internal/utils/state-attributes.ts","../../internal/utils/toggle-group-context.ts","../../internal/utils/virtual-rows.ts"],"sourcesContent":["import { afterNextRender, DestroyRef, inject } from \"@angular/core\";\n\nexport type ButtonType = \"button\" | \"submit\" | \"reset\";\n\nexport interface ButtonOptions {\n disabled: boolean;\n focusableWhenDisabled: boolean;\n nativeButton: boolean;\n type: ButtonType | undefined;\n /** The consumer's own `tabindex` (or a composite's roving one), or `null`. */\n tabIndex: string | null;\n}\n\n/** A button's attributes (spec/button.md, \"State attributes and ARIA\"); `null` removes one. */\nexport function buttonAttributes(options: ButtonOptions) {\n const { disabled, focusableWhenDisabled, nativeButton, type, tabIndex } =\n options;\n if (nativeButton) {\n return {\n type: type ?? \"button\",\n role: null,\n disabled: disabled && !focusableWhenDisabled ? \"\" : null,\n \"aria-disabled\": disabled && focusableWhenDisabled ? \"true\" : null,\n tabindex: tabIndex,\n };\n }\n return {\n type: type ?? null,\n role: \"button\",\n disabled: null,\n \"aria-disabled\": disabled ? \"true\" : null,\n tabindex: !disabled || focusableWhenDisabled ? (tabIndex ?? \"0\") : \"-1\",\n };\n}\n\n/**\n * What a non-native button does with a key a native button would act on (spec/button.md,\n * \"Keyboard\"): Enter clicks on its key down; Space only prevents its key down (no scroll) and\n * clicks on its key up. `null` for any other key.\n */\nexport function nativeKeyAction(\n type: \"keydown\" | \"keyup\",\n key: string,\n): \"click\" | \"prevent\" | \"click-on-keyup\" | null {\n if (type === \"keydown\") {\n if (key === \"Enter\") {\n return \"click\";\n }\n return key === \" \" ? \"prevent\" : null;\n }\n return key === \" \" ? \"click-on-keyup\" : null;\n}\n\n/** The keys a roving composite acts on (spec/toolbar.md, \"Keyboard\"). */\nconst COMPOSITE_KEYS: readonly string[] = [\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n];\n\n/** The events a disabled button keeps from the consumer's handlers (spec/button.md, \"Pointer\"). */\nconst GUARDED = [\"click\", \"mousedown\", \"pointerdown\", \"keydown\", \"keyup\"];\n\nexport interface ButtonBehaviourOptions {\n disabled: () => boolean;\n nativeButton: () => boolean;\n /**\n * An item of a roving composite (a toolbar's button, a Toggle in a group): while disabled and\n * focusable, the composite's keys still reach the composite (spec/toolbar.md, \"Disabled\n * items\"), handed to it here since the consumer's handlers are stopped. `null` outside one.\n */\n composite?: () => ((event: KeyboardEvent) => void) | null;\n}\n\n/**\n * A button's behaviour on its host (spec/button.md), shared by Button, Toggle and\n * Toolbar.Button (the package's own code, not the `/button` entry), in an injection context.\n * While disabled, no press, pointer down or key but Tab reaches the consumer's handlers: a\n * capturing listener on the element stops them first. A non-native button gets the keys a\n * native button has, after the consumer's own handlers.\n */\nexport function buttonBehaviour(\n host: HTMLElement,\n options: ButtonBehaviourOptions,\n): void {\n const guard = (event: Event) => {\n if (!options.disabled()) {\n return;\n }\n if (event instanceof KeyboardEvent && event.key === \"Tab\") {\n return;\n }\n const composite =\n event instanceof KeyboardEvent &&\n event.type === \"keydown\" &&\n COMPOSITE_KEYS.includes(event.key)\n ? (options.composite?.() ?? null)\n : null;\n event.stopImmediatePropagation();\n if (composite !== null) {\n composite(event as KeyboardEvent);\n return;\n }\n // a focusable disabled submit button does not submit, on a press or on Enter\n if (event.type !== \"mousedown\" && event.type !== \"keyup\") {\n event.preventDefault();\n }\n };\n // at the target, capturing listeners run before the consumer's own `(click)`\n for (const type of GUARDED) {\n host.addEventListener(type, guard, { capture: true });\n }\n\n // a non-native button's keys, after the consumer's own handlers (registered with the\n // template, before this runs), so one that prevents the key's default keeps it\n const onKey = (event: KeyboardEvent) => {\n if (\n options.nativeButton() ||\n event.defaultPrevented ||\n event.target !== event.currentTarget\n ) {\n return;\n }\n const action = nativeKeyAction(\n event.type as \"keydown\" | \"keyup\",\n event.key,\n );\n if (action === \"prevent\") {\n event.preventDefault();\n } else if (action !== null) {\n event.preventDefault();\n host.click();\n }\n };\n afterNextRender(() => {\n host.addEventListener(\"keydown\", onKey);\n host.addEventListener(\"keyup\", onKey);\n });\n inject(DestroyRef).onDestroy(() => {\n for (const type of GUARDED) {\n host.removeEventListener(type, guard, { capture: true });\n }\n host.removeEventListener(\"keydown\", onKey);\n host.removeEventListener(\"keyup\", onKey);\n });\n}\n","import { ElementRef } from \"@angular/core\";\n\n/** Why a value or an open state changed (spec/README.md, \"Change details\"). */\nexport type ChangeReason =\n | \"trigger-press\"\n | \"close-press\"\n | \"escape-key\"\n | \"outside-press\"\n | \"focus-out\"\n | \"item-press\"\n | \"list-navigation\"\n | \"input-change\"\n | \"input-press\"\n | \"input-clear\"\n | \"input-blur\"\n | \"input-paste\"\n | \"clear-press\"\n | \"submit-press\"\n | \"cancel-press\"\n | \"chip-remove-press\"\n | \"trigger-hover\"\n | \"trigger-focus\"\n | \"keyboard\"\n | \"increment-press\"\n | \"decrement-press\"\n | \"wheel\"\n | \"scrub\"\n | \"track-press\"\n | \"drag\"\n | \"swipe\"\n | \"previous-press\"\n | \"next-press\"\n | \"first-press\"\n | \"last-press\"\n | \"autoplay\"\n | \"focus-in\"\n | \"imperative-action\"\n | \"page-change\"\n | \"backspace-key\"\n | \"drop\"\n | \"delete-press\"\n | \"none\";\n\n/** What a change reports besides its value (spec/README.md, \"Change details\"). */\nexport interface ChangeDetails {\n reason: ChangeReason;\n /** The DOM event that caused it, when known; `undefined` when programmatic. */\n event?: Event | undefined;\n}\n\n/** What an overlay's open change reports (spec/README.md, \"Open change details\"). */\nexport interface OpenChangeDetails extends ChangeDetails {\n /** The DOM event that caused it; `undefined` when programmatic. */\n event: Event | undefined;\n /** The trigger the change is associated with: the pressed one, else the active one. */\n trigger: HTMLElement | undefined;\n /** Called while `(openChangeDetails)` is handled: the change does not happen. */\n cancel(): void;\n readonly isCanceled: boolean;\n /** A close: the popup stays mounted (`data-ending-style`) until the root's `unmount()`. */\n preventUnmountOnClose(): void;\n}\n\n/** An overlay's imperative actions: public methods of its root directive (spec/README.md, \"Lifecycle\"). */\nexport interface OverlayActions {\n /** Closes the overlay (reason `imperative-action`). */\n close(): void;\n /** Ends a running exit now, or the exit held by `preventUnmountOnClose()`. */\n unmount(): void;\n}\n\n/**\n * What `(openChangeDetails)` emits: the new open state and why. An overlay emits it before the\n * state changes, with its `OpenChangeDetails` (`details.cancel()` keeps the state as it is;\n * `(openChange)` then emits nothing); a disclosure (Collapsible) with `ChangeDetails`.\n */\nexport interface OpenChangeEvent<\n Details extends ChangeDetails = OpenChangeDetails,\n> {\n open: boolean;\n details: Details;\n}\n\n/** The details of one open change; `held` tells whether `preventUnmountOnClose()` was called. */\nexport function createOpenChangeDetails(\n reason: ChangeReason,\n event: Event | undefined,\n trigger: HTMLElement | undefined,\n): { details: OpenChangeDetails; held: () => boolean } {\n let canceled = false;\n let held = false;\n const details: OpenChangeDetails = {\n reason,\n event,\n trigger,\n cancel: () => {\n canceled = true;\n },\n get isCanceled() {\n return canceled;\n },\n preventUnmountOnClose: () => {\n held = true;\n },\n };\n return { details, held: () => held };\n}\n\n/** What `(valueChangeDetails)` emits: the new value and why it changed. */\nexport interface ValueChangeEvent<T> {\n value: T;\n details: ChangeDetails;\n}\n\n/**\n * An element to focus: an element (a template reference variable on it), an `ElementRef`, a\n * getter read when the focus moves, or `false` for none.\n */\nexport type FocusTarget =\n | HTMLElement\n | ElementRef<HTMLElement>\n | (() => HTMLElement | null)\n | false\n | null\n | undefined;\n\nexport function resolveFocusTarget(\n target: FocusTarget,\n): HTMLElement | null | false {\n if (target === false) {\n return false;\n }\n if (target == null) {\n return null;\n }\n if (target instanceof ElementRef) {\n return target.nativeElement;\n }\n return typeof target === \"function\" ? target() : target;\n}\n","import { InjectionToken, inject, type Signal } from \"@angular/core\";\nimport type { Color } from \"@fragiola/primitives/color\";\nimport type { ChangeDetails } from \"./change-details.ts\";\n\n/**\n * What a `[colorPickerRoot]` shares with the color controls inside it (spec/color-picker.md,\n * \"Sharing the color\"). The token lives in the package's shared code, as a ToggleGroup's does, so\n * a color control used alone ships none of ColorPicker's code (D8).\n */\nexport interface ColorPickerBinding {\n /** The picker's color. */\n readonly value: Signal<Color>;\n /** Every control inside is disabled. */\n readonly disabled: Signal<boolean>;\n /** A bound control changed it. */\n setValue: (color: Color, details: ChangeDetails) => void;\n /** A bound control's change is complete. */\n commit: (color: Color, details: ChangeDetails) => void;\n /**\n * The picker's popup (its positioner, portalled out of the Root) is part of the picker: focus\n * in it is focus in the picker's Field control. Returns its cleanup.\n */\n registerPopup: (element: HTMLElement) => () => void;\n}\n\n// pure: an entry that never injects it bundles none of it (every other entry's size stays as it\n// was, docs/size.md)\nexport const COLOR_PICKER_BINDING =\n /* @__PURE__ */ new InjectionToken<ColorPickerBinding>(\n \"ColorPickerBinding\",\n );\n\n/** The enclosing ColorPicker's binding, or `null` outside one. */\nexport function injectColorPickerBinding(): ColorPickerBinding | null {\n return inject(COLOR_PICKER_BINDING, { optional: true });\n}\n","import {\n type EmbeddedViewRef,\n effect,\n inject,\n type Signal,\n signal,\n TemplateRef,\n untracked,\n ViewContainerRef,\n} from \"@angular/core\";\n\n/**\n * A structural part's view (spec/README.md, API mapping: Angular, \"a part rendered only in some\n * states is structural\"): renders the directive's template while `show()` is true, in its\n * directive's injection context, and returns the element it rendered (`null` while hidden), on\n * which the directive writes its attributes and listens. `setup` runs on each element it renders,\n * before it is shown.\n */\nexport function conditionalView(\n show: Signal<boolean>,\n setup?: (element: HTMLElement) => void,\n): Signal<HTMLElement | null> {\n const template = inject(TemplateRef);\n const container = inject(ViewContainerRef);\n const element = signal<HTMLElement | null>(null);\n let view: EmbeddedViewRef<unknown> | null = null;\n effect(() => {\n const shown = show();\n untracked(() => {\n if (!shown) {\n container.clear();\n view = null;\n element.set(null);\n return;\n }\n if (view !== null) {\n return;\n }\n view = container.createEmbeddedView(template);\n const rendered =\n (view.rootNodes as Node[]).find(\n (node): node is HTMLElement => node instanceof HTMLElement,\n ) ?? null;\n if (rendered !== null) {\n setup?.(rendered);\n }\n element.set(rendered);\n });\n });\n return element.asReadonly();\n}\n\n/** Writes `attributes` on `element` (`null` removes one). */\nexport function writeAttributes(\n element: HTMLElement,\n attributes: Record<string, string | null>,\n): void {\n for (const [name, value] of Object.entries(attributes)) {\n if (value === null) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value);\n }\n }\n}\n","import {\n computed,\n type OutputEmitterRef,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\n\nexport interface Controllable<T, Details> {\n value: Signal<T>;\n set: (next: T, details: Details) => void;\n}\n\n/**\n * A value given as an input with its `*Change` output (spec/README.md, API mapping: Angular):\n * controlled when the consumer binds it (`[(open)]` or a one-way `[open]`), which it only reports\n * through the output; its own otherwise, seeded once by `fallback()` (the `default*` input, read on\n * first use, after the inputs are set). Not a `model()`: a model writes its own value on change,\n * so a one-way binding, or a consumer keeping the old value, would lose control.\n */\nexport function controllable<T, Details>(\n bound: Signal<T | undefined>,\n change: Pick<OutputEmitterRef<T>, \"emit\">,\n fallback: () => T,\n onChange: (value: T, details: Details) => void,\n): Controllable<T, Details> {\n let seed: { value: T } | null = null;\n const own = signal<{ value: T } | null>(null);\n const value = computed(() => {\n const given = bound();\n if (given !== undefined) {\n return given;\n }\n const local = own();\n if (local !== null) {\n return local.value;\n }\n seed ??= { value: untracked(fallback) };\n return seed.value;\n });\n return {\n value,\n set: (next, details) => {\n if (Object.is(untracked(value), next)) {\n return;\n }\n if (untracked(bound) === undefined) {\n own.set({ value: next });\n }\n change.emit(next);\n onChange(next, details);\n },\n };\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n inject,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\n// types only: the file entries pass the toolkit's `watchFileDrop` in, so this shared entry imports\n// nothing of `/file` and the components that do not take files never reference it\nimport type { watchFileDrop } from \"@fragiola/primitives/file\";\nimport type { ChangeReason } from \"./change-details.ts\";\n\nexport interface FileDropTargetOptions {\n /** The toolkit's `watchFileDrop`, passed in by the entry that imports `/file`. */\n watch: typeof watchFileDrop;\n disabled: Signal<boolean>;\n /** Files dropped (`drop`) or pasted (`input-paste`). */\n onFiles: (files: File[], reason: ChangeReason, event: Event) => void;\n /** A drag of files entered or left. */\n onDropTargetChange?: (active: boolean, event: Event) => void;\n /** A click, Enter or Space: the file dialog's opening. */\n onActivate: (event: Event) => void;\n}\n\n/**\n * A drop target for files on `host` (spec/drop-zone.md), in its directive's injection context:\n * the toolkit's `watchFileDrop` once the page renders in the browser, and its drag state for\n * `data-drop-target` (none while disabled). DropZone's Root and FileUpload's Dropzone share it.\n */\nexport function fileDropTarget(\n host: HTMLElement,\n options: FileDropTargetOptions,\n): Signal<boolean> {\n const active = signal(false);\n let stop: (() => void) | null = null;\n afterNextRender(() => {\n stop = options.watch(host, {\n disabled: () => untracked(options.disabled),\n onDropTargetChange: (next, event) => {\n active.set(next);\n options.onDropTargetChange?.(next, event);\n },\n onFiles: (files, reason, event) =>\n options.onFiles(\n files,\n reason === \"drop\" ? \"drop\" : \"input-paste\",\n event,\n ),\n onActivate: options.onActivate,\n });\n });\n inject(DestroyRef).onDestroy(() => stop?.());\n return computed(() => active() && !options.disabled());\n}\n","import { ApplicationRef, inject } from \"@angular/core\";\n\n/**\n * Renders a state change at once, from an event handler (spec/menu.md, \"Keyboard\": a key that\n * opens or closes a level moves the focus before the next key arrives). React renders the state a\n * discrete event set before the next one; Angular's zoneless scheduler renders it in a later task,\n * after input that the browser already queued (two quick ArrowDown presses would both reach the\n * trigger). A change made during change detection (an overlay closed because the overlay it was\n * opened from closed, from that one's after-render cleanup) is rendered by the running pass, which\n * refreshes the views it marked: the nested tick is skipped.\n */\nexport function injectFlush(): () => void {\n const app = inject(ApplicationRef);\n return () => {\n try {\n app.tick();\n } catch (error) {\n // NG0101: `tick` called while a tick runs\n if ((error as { code?: number } | null)?.code !== 101) {\n throw error;\n }\n }\n };\n}\n","import {\n afterNextRender,\n afterRenderEffect,\n DestroyRef,\n inject,\n type Signal,\n} from \"@angular/core\";\nimport { VISUALLY_HIDDEN_INPUT_STYLE } from \"@fragiola/primitives/form\";\n\n/**\n * A form control's hidden input (spec/README.md, \"Forms\"), created by the directive itself: a\n * root on an `<ng-container>` has no element to render it in, and a part on the consumer's own\n * element (the checkbox's `<button>`) cannot add a sibling from a template. It goes right after\n * `anchor` (the container's comment, or the host element), as React renders it after its part,\n * with the structural hidden style unless it is `type=\"hidden\"`; it is removed with the directive.\n * It is inserted after the first render (Epic #22: server rendering and hydration). With `present`,\n * it is in the page only while `present()` is true (a picker's input, only while it has a name),\n * inserted and removed after the render that changed it.\n */\nexport function createHiddenInput(\n anchor: Node,\n attributes: Record<string, string>,\n present?: Signal<boolean>,\n): HTMLInputElement {\n const input = (anchor.ownerDocument ?? document).createElement(\"input\");\n for (const [name, value] of Object.entries(attributes)) {\n input.setAttribute(name, value);\n }\n if (input.type !== \"hidden\") {\n input.setAttribute(\"aria-hidden\", \"true\");\n input.tabIndex = -1;\n Object.assign(input.style, VISUALLY_HIDDEN_INPUT_STYLE);\n }\n // after the render, never during it: a hydration walks the server's DOM as its template has\n // it, and a node inserted on the way breaks it (NG0502). So the server renders none (an after\n // render hook never runs there), and the browser inserts it once its view is in the page (a\n // view inside an `@if` is attached after its directives are made)\n const insert = () => {\n if (!input.isConnected) {\n anchor.parentNode?.insertBefore(input, anchor.nextSibling);\n }\n };\n if (present === undefined) {\n afterNextRender(insert);\n } else {\n // the write phase: before a read-phase effect that bridges the input to its form\n afterRenderEffect({\n write: () => {\n if (present()) {\n insert();\n } else {\n input.remove();\n }\n },\n });\n }\n inject(DestroyRef).onDestroy(() => input.remove());\n return input;\n}\n\n/** Sets or removes an attribute of the hidden input (`null` removes it). */\nexport function setInputAttribute(\n input: HTMLInputElement,\n name: string,\n value: string | null,\n): void {\n if (value === null) {\n input.removeAttribute(name);\n } else {\n input.setAttribute(name, value);\n }\n}\n","import {\n DestroyRef,\n ElementRef,\n inject,\n type WritableSignal,\n} from \"@angular/core\";\n\n/** The element a part's directive sits on (the consumer's own element: Angular's `render`). */\nexport function injectHost<T extends HTMLElement = HTMLElement>(): T {\n return inject<ElementRef<T>>(ElementRef).nativeElement;\n}\n\n/**\n * Registers the host element in its root (`trigger`, `popup`, ...) for as long as the directive\n * lives, and returns it. A later element of the same part keeps its place.\n */\nexport function registerHost<T extends HTMLElement = HTMLElement>(\n target: WritableSignal<HTMLElement | null>,\n): T {\n const host = injectHost<T>();\n target.set(host);\n inject(DestroyRef).onDestroy(() => {\n if (target() === host) {\n target.set(null);\n }\n });\n return host;\n}\n","import { inject, type ProviderToken } from \"@angular/core\";\n\n/** The directive of the enclosing part, or an error naming the part and the function. */\nexport function injectEnclosing<T>(\n token: ProviderToken<T>,\n selector: string,\n fn: string,\n): T {\n const directive = inject(token, { optional: true });\n if (directive === null) {\n throw new Error(`${fn}() must be used inside [${selector}]`);\n }\n return directive;\n}\n","import { APP_ID, Injectable, inject } from \"@angular/core\";\n\n/** The application's id counter: one per application, so a server render starts where the browser does. */\n@Injectable({ providedIn: \"root\" })\nexport class IdCounter {\n private readonly appId = inject(APP_ID);\n private count = 0;\n\n /** The next id: `primitives-dialog-1`, then `-2`, ... (`primitives-dialog-<app>-1` in an app given its own `APP_ID`). */\n next(prefix: string): string {\n this.count += 1;\n return this.appId === \"ng\"\n ? `${prefix}-${this.count}`\n : `${prefix}-${this.appId}-${this.count}`;\n }\n}\n\n/**\n * A document-unique id from the application's own counter (Epic #22), in an injection context.\n * The toolkit's `createId` counts for the whole JavaScript realm: on a server that renders many\n * pages, its ids would never be the browser's, and a hydrated page would change them all.\n */\nexport function injectId(prefix = \"primitives\"): string {\n return inject(IdCounter).next(prefix);\n}\n","import {\n computed,\n DestroyRef,\n effect,\n inject,\n type Signal,\n type WritableSignal,\n} from \"@angular/core\";\nimport { injectId } from \"./inject-id.ts\";\n\n/**\n * The id of a part that names or describes another (a title, a description, a group label): the\n * consumer's `id` input or a generated one, registered in `target` (the root's `titleId`, ...) for\n * as long as the part lives.\n */\nexport function labelId(\n id: Signal<string | undefined>,\n target: WritableSignal<string | undefined>,\n prefix: string,\n): Signal<string> {\n const generated = injectId(prefix);\n const resolved = computed(() => id() ?? generated);\n effect(() => target.set(resolved()));\n inject(DestroyRef).onDestroy(() => target.set(undefined));\n return resolved;\n}\n","import { DestroyRef, inject, untracked } from \"@angular/core\";\nimport { injectHost } from \"./host-element.ts\";\n\n/**\n * A disabled link's press (spec/link.md, \"Pointer\"), shared by Link and Breadcrumbs' Link (not the\n * `/link` entry): a native click listener on the host anchor, in the capture phase, that prevents\n * the click's default (no navigation) and stops it there while `disabled()`, so no listener of the\n * anchor or around it runs after it: the consumer's `(click)` and a `routerLink` on the same anchor\n * included (Angular's `RouterLink` does not check `defaultPrevented`). Button's disabled-press\n * rule, for an anchor. In an injection context.\n */\nexport function injectLinkPress(disabled: () => boolean): void {\n const host = injectHost();\n const stop = (event: Event) => {\n if (untracked(disabled)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n host.addEventListener(\"click\", stop, true);\n inject(DestroyRef).onDestroy(() =>\n host.removeEventListener(\"click\", stop, true),\n );\n}\n","import { afterNextRender, DestroyRef, inject } from \"@angular/core\";\n\n/** A polite live region's structural style: visually hidden, still read (Clipboard's announcer's). */\nconst LIVE_REGION_STYLE = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n margin: \"-1px\",\n padding: \"0\",\n border: \"0\",\n overflow: \"hidden\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n} as const;\n\n/**\n * A polite live region (spec/drop-zone.md, spec/file-upload.md), in its directive's injection\n * context: appended as the host's last child after the first render (a server renders none, as\n * Clipboard's announcer), removed with the directive. The entry writes into it with the toolkit's\n * `announceText`.\n */\nexport function createLiveRegion(\n host: HTMLElement,\n part: string,\n): HTMLSpanElement {\n const region = host.ownerDocument.createElement(\"span\");\n region.setAttribute(\"aria-live\", \"polite\");\n region.setAttribute(\"aria-atomic\", \"true\");\n region.setAttribute(\"data-primitives-part\", part);\n Object.assign(region.style, LIVE_REGION_STYLE);\n afterNextRender(() => {\n if (!region.isConnected) {\n host.appendChild(region);\n }\n });\n inject(DestroyRef).onDestroy(() => region.remove());\n return region;\n}\n","import {\n computed,\n effect,\n type Signal,\n signal,\n untracked,\n type WritableSignal,\n} from \"@angular/core\";\nimport type { OverlayRoot } from \"./overlay-root.ts\";\n\n/**\n * A handle of detached triggers (spec/README.md, \"Detached triggers\"): it connects a root directive\n * and trigger directives rendered anywhere. The open state and the payload stay in the root; the\n * handle holds the attached root, which its triggers read, and forwards its methods to it. A call\n * while no root is attached does nothing.\n */\nexport interface OverlayHandle<Payload = unknown> {\n /** Opens from the trigger of this id (the active trigger), or with no trigger (`null`). */\n open(triggerId: string | null): void;\n /** Opens with this payload and no trigger. */\n openWithPayload(payload: Payload): void;\n /** Closes it (reason `imperative-action`). */\n close(): void;\n readonly isOpen: boolean;\n}\n\n/** What a root directive attaches to its handle: itself, with its overlay state. */\nexport interface HandleRoot {\n readonly overlay: OverlayRoot;\n}\n\n/**\n * The handle object of every overlay (each component types it with its own name). The roots\n * attached to it form a stack: the newest one serves the handle, and detaching it gives the\n * handle back to the previous one.\n */\nexport class OverlayHandleStore<Payload = unknown>\n implements OverlayHandle<Payload>\n{\n private readonly stack: WritableSignal<readonly HandleRoot[]> = signal([]);\n private readonly attached: Signal<HandleRoot | null> = computed(\n () => this.stack().at(-1) ?? null,\n );\n\n /** The component it belongs to (`\"dialog\"`, `\"menu\"`, ...): a handle serves one kind. */\n readonly component: string;\n\n constructor(component: string) {\n this.component = component;\n }\n\n /** The attached root, `null` until one is attached (a signal its triggers render from). */\n readonly root: Signal<HandleRoot | null> = this.attached;\n\n /** Puts a root on top of the stack (again, if it already was attached). */\n attach(root: HandleRoot): void {\n this.stack.update((roots) => [\n ...roots.filter((other) => other !== root),\n root,\n ]);\n }\n\n /** Takes a root off the stack: the previous one serves the handle when it was on top. */\n detach(root: HandleRoot): void {\n if (untracked(this.stack).includes(root)) {\n this.stack.update((roots) =>\n roots.filter((other) => other !== root),\n );\n }\n }\n\n open(triggerId: string | null): void {\n untracked(this.attached)?.overlay.openFromHandle(triggerId);\n }\n\n openWithPayload(payload: Payload): void {\n untracked(this.attached)?.overlay.openWithPayload(payload);\n }\n\n close(): void {\n untracked(this.attached)?.overlay.closeFromHandle();\n }\n\n get isOpen(): boolean {\n return untracked(this.attached)?.overlay.open() ?? false;\n }\n}\n\n/**\n * Attaches a root directive to its `[handle]` while it is set, in the root's injection context.\n */\nexport function attachHandle(\n handle: Signal<OverlayHandle<never> | undefined>,\n root: HandleRoot,\n): void {\n effect((onCleanup) => {\n const store = handle() as OverlayHandleStore<never> | undefined;\n if (store === undefined) {\n return;\n }\n untracked(() => store.attach(root));\n onCleanup(() => store.detach(root));\n });\n}\n","import {\n afterRenderEffect,\n computed,\n linkedSignal,\n type Signal,\n untracked,\n} from \"@angular/core\";\nimport {\n isAnimating,\n nextFrame,\n waitForAnimations,\n} from \"@fragiola/primitives/presence\";\n\nexport type TransitionStatus = \"starting\" | \"ending\" | undefined;\n\nexport interface Presence {\n /** Whether the element is rendered: open, or closing while its exit animation runs. */\n mounted: Signal<boolean>;\n status: Signal<TransitionStatus>;\n /** Keeps the next exit running until `finish()` (a close's `preventUnmountOnClose()`). */\n hold: () => void;\n /** Ends a running exit now (the root's `unmount()`). */\n finish: () => void;\n}\n\nexport interface PresenceOptions {\n /** Whether an element open on the first render starts with `data-starting-style` (`true`). */\n enterOnMount?: boolean;\n /**\n * Called once an opening's starting frame ended and its animations finished (`true`), and once\n * an exit's animations finished (`false`); never on the first render, nor for an exit a\n * reopening interrupted (spec/README.md, \"Lifecycle\").\n */\n onComplete?: (open: boolean) => void;\n}\n\n/**\n * Keeps an element mounted while its exit animation runs (spec/dialog.md, \"Animation\"):\n * `data-starting-style` for the first frame after mounting, `data-ending-style` until every\n * animation on the element has finished. The status derives from `open` in the same pass, so the\n * element's first render (or a kept-mounted element shown again) already carries\n * `data-starting-style`; the effect only clears it.\n *\n * The effect runs after rendering (`afterRenderEffect`), as React's and Vue's post-render effects:\n * the exit is awaited once the element carries `data-ending-style`, so its transition has started.\n * A plain `effect` runs before the view is refreshed, finds no animation, and unmounts at once.\n */\nexport function createPresence(\n open: Signal<boolean>,\n element: Signal<HTMLElement | null>,\n options: PresenceOptions = {},\n): Presence {\n const status = linkedSignal<boolean, TransitionStatus>({\n source: open,\n computation: (isOpen, previous) => {\n if (isOpen) {\n // the first render's state already shows itself, unless it enters on mount\n return previous === undefined && options.enterOnMount === false\n ? undefined\n : \"starting\";\n }\n const wasShown =\n previous !== undefined &&\n (previous.source || previous.value === \"ending\");\n return wasShown ? \"ending\" : undefined;\n },\n });\n // the open state last acted on (the first render's state already shows the first one), the\n // change of `open` each transition belongs to (a newer one cancels an older one's end), an\n // opening whose enter has to report its end, and an exit held until `finish()`\n let actedOn: boolean | undefined;\n let epoch = 0;\n let entering = false;\n let held = false;\n\n const finish = () => {\n if (untracked(status) !== \"ending\") {\n return;\n }\n held = false;\n epoch += 1;\n status.set(undefined);\n options.onComplete?.(false);\n };\n\n afterRenderEffect((onCleanup) => {\n const isOpen = open();\n const current = status();\n const node = element();\n if (actedOn === undefined) {\n actedOn = isOpen;\n } else if (isOpen !== actedOn) {\n actedOn = isOpen;\n epoch += 1;\n entering = isOpen;\n if (isOpen) {\n held = false;\n }\n }\n if (current === \"starting\") {\n if (node) {\n onCleanup(nextFrame(node, () => status.set(undefined)));\n }\n return;\n }\n if (current === undefined) {\n if (entering && isOpen) {\n // the enter transition started once `data-starting-style` was removed\n entering = false;\n const at = epoch;\n const report = () => {\n if (epoch === at && untracked(open)) {\n options.onComplete?.(true);\n }\n };\n if (node) {\n void waitForAnimations(node).then(report);\n } else {\n report();\n }\n }\n return;\n }\n if (held) {\n return;\n }\n let cancelled = false;\n const at = epoch;\n const end = () => {\n if (!cancelled && epoch === at && !held) {\n finish();\n }\n };\n // nothing to animate: it ends in the same render, before a paint\n if (node && isAnimating(node)) {\n void waitForAnimations(node).then(end);\n } else {\n end();\n }\n onCleanup(() => {\n cancelled = true;\n });\n });\n return {\n mounted: computed(() => open() || status() === \"ending\"),\n status,\n hold: () => {\n held = true;\n },\n finish,\n };\n}\n","import {\n computed,\n effect,\n type OutputEmitterRef,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\nimport {\n type ChangeReason,\n createOpenChangeDetails,\n type OpenChangeEvent,\n} from \"./change-details.ts\";\nimport { injectFlush } from \"./flush.ts\";\nimport { injectId } from \"./inject-id.ts\";\nimport { createPresence } from \"./presence.ts\";\n\n/** The inputs and outputs every overlay root directive declares (spec/README.md, \"Overlays\"). */\nexport interface OverlayRootInputs {\n open: Signal<boolean | undefined>;\n openChange: Pick<OutputEmitterRef<boolean>, \"emit\">;\n defaultOpen: Signal<boolean>;\n /** `(openChangeComplete)`: an opening's or a closing's transition finished. */\n openChangeComplete?: Pick<OutputEmitterRef<boolean>, \"emit\">;\n /** The active trigger's id, controlled together with `open` (detached triggers). */\n triggerId?: Signal<string | null | undefined>;\n defaultTriggerId?: Signal<string | null | undefined>;\n}\n\n/** A trigger the root knows: its element and its payload. */\ninterface TriggerEntry {\n element: HTMLElement;\n payload: Signal<unknown>;\n}\n\n/** The options of one `setOpen` call. */\nexport interface SetOpenOptions {\n /** An explicit payload (a handle's `openWithPayload`). */\n payload?: { value: unknown };\n /** It moves to a trigger not rendered yet (a handle's `open(id)`). */\n movesUnrendered?: boolean;\n}\n\n/**\n * The state every overlay root shares: open (bound or its own) with its last reason, the\n * triggers (one set through `singleTrigger`, or any number registered by their id), the active\n * trigger, its payload, the positioner and popup elements, ids, the presence of the popup (mounted\n * while its exit animation runs), and the handle's and the actions' entry points. Created in a root\n * directive's injection context.\n *\n * `setOpen` emits `openChangeDetails` before it changes the state, and returns whether the change\n * happened (a canceled one, or one with nothing to change, did not); it is called from event\n * handlers, and renders the change at once (`injectFlush`).\n *\n * `lastReason` is the reason of the change that made the current `open`: `null` when the bound\n * `open` changed with no request of the overlay's own (a close the consumer made), so a close\n * never reuses an earlier change's reason for its focus return.\n */\nexport function createOverlayRoot(\n inputs: OverlayRootInputs,\n emit: (event: OpenChangeEvent) => void,\n prefix: string,\n) {\n // the open state: bound, else its own, seeded once by `defaultOpen` (read on first use, after\n // the inputs are set)\n let seed: { value: boolean } | null = null;\n const own = signal<{ value: boolean } | null>(null);\n const open = computed(() => {\n const bound = inputs.open();\n if (bound !== undefined) {\n return bound;\n }\n const local = own();\n if (local !== null) {\n return local.value;\n }\n seed ??= { value: untracked(inputs.defaultOpen) };\n return seed.value;\n });\n\n // the triggers: one set through `singleTrigger` (Select, Combobox, the pickers, a submenu), or\n // any number registered by their id (Dialog, Popover, Menu, Tooltip)\n const singleTrigger = signal<HTMLElement | null>(null);\n const registry = signal<ReadonlyMap<string, TriggerEntry>>(new Map());\n let triggerSeed: { value: string | null } | null = null;\n const ownTriggerId = signal<{ value: string | null } | null>(null);\n const requestedTriggerId = computed(() => {\n const bound = inputs.triggerId?.();\n if (bound !== undefined) {\n return bound;\n }\n const local = ownTriggerId();\n if (local !== null) {\n return local.value;\n }\n triggerSeed ??= {\n value: untracked(() => inputs.defaultTriggerId?.()) ?? null,\n };\n return triggerSeed.value;\n });\n // the active trigger: the requested one, else the first registered\n const active = computed(() => {\n const entries = registry();\n const requested = requestedTriggerId();\n const entry = requested === null ? undefined : entries.get(requested);\n if (entry !== undefined && requested !== null) {\n return { id: requested, ...entry };\n }\n const first = entries.entries().next();\n if (first.done !== true) {\n const [id, found] = first.value;\n return { id, ...found };\n }\n return null;\n });\n const trigger = computed(\n () => active()?.element ?? singleTrigger() ?? null,\n );\n // a single trigger's id once it has one (its directive writes it while rendering)\n const activeTriggerId = computed(\n () => active()?.id ?? (singleTrigger()?.id || null),\n );\n const triggers = computed(() => {\n const all = [...registry().values()].map((entry) => entry.element);\n const single = singleTrigger();\n return single ? [...all, single] : all;\n });\n // an explicit payload (`openWithPayload`), else the active trigger's\n const explicitPayload = signal<{ value: unknown } | null>(null);\n const payload = computed(() => {\n const explicit = explicitPayload();\n return explicit ? explicit.value : active()?.payload();\n });\n\n const positioner = signal<HTMLElement | null>(null);\n const popup = signal<HTMLElement | null>(null);\n const lastReason: { current: ChangeReason | null } = { current: null };\n let requested: boolean | null = null;\n // the open state just reported, until the microtask after it: a second report of the same\n // change in the same task (a popover's Tab-out, then its focus watch) is not repeated\n let pending: { open: boolean; trigger: HTMLElement | null } | null = null;\n // before rendering, so before the popup's after-render effects end its session\n effect(() => {\n const value = open();\n untracked(() => {\n if (requested !== value) {\n lastReason.current = null;\n }\n requested = null;\n });\n });\n const presence = createPresence(open, popup, {\n onComplete: (value) => inputs.openChangeComplete?.emit(value),\n });\n const id = injectId(prefix);\n const flush = injectFlush();\n\n const setOpen = (\n next: boolean,\n reason: ChangeReason,\n event?: Event,\n pressed?: HTMLElement | null,\n options: SetOpenOptions = {},\n ): boolean => {\n const current = untracked(open);\n const before = pending ?? {\n open: current,\n trigger: untracked(trigger),\n };\n // a press on another trigger of the open overlay moves it there (not deduplicated)\n const moves =\n next &&\n before.open &&\n ((pressed != null && pressed !== before.trigger) ||\n options.movesUnrendered === true);\n if (before.open === next && !moves && options.payload === undefined) {\n return false;\n }\n const { details, held } = createOpenChangeDetails(\n reason,\n event,\n options.movesUnrendered === true\n ? undefined\n : (pressed ?? untracked(trigger)) || undefined,\n );\n emit({ open: next, details });\n if (details.isCanceled) {\n return false;\n }\n if (!next && held()) {\n presence.hold();\n }\n lastReason.current = reason;\n requested = next;\n pending = {\n open: next,\n trigger: next && pressed != null ? pressed : before.trigger,\n };\n if (next && pressed != null && pressed.id !== \"\") {\n if (untracked(() => inputs.triggerId?.()) === undefined) {\n ownTriggerId.set({ value: pressed.id });\n }\n explicitPayload.set(null);\n }\n if (moves && options.movesUnrendered === true) {\n explicitPayload.set(null);\n }\n if (next && options.payload !== undefined) {\n explicitPayload.set(options.payload);\n }\n if (untracked(inputs.open) === undefined) {\n own.set({ value: next });\n }\n if (current !== next) {\n inputs.openChange.emit(next);\n }\n // a request the consumer turned down is forgotten once it is answered\n queueMicrotask(() => {\n pending = null;\n requested = null;\n });\n // the popup (and its focus) or the focus return, before the next event\n flush();\n return true;\n };\n\n return {\n open,\n setOpen,\n lastReason,\n /** The active trigger: the registered one, else the single one. */\n trigger,\n /** The trigger of an overlay with one trigger (`registerHost(overlay.singleTrigger)`). */\n singleTrigger,\n /** Every trigger of the overlay (its layer's `ignore` and `owner`). */\n triggers,\n activeTriggerId,\n /** The payload of the active trigger (or of `openWithPayload`). */\n payload,\n /** Registers a trigger by its id while it lives; returns its unregistration. */\n registerTrigger: (\n triggerId: string,\n element: HTMLElement,\n triggerPayload: Signal<unknown>,\n ): (() => void) => {\n registry.update((entries) =>\n new Map(entries).set(triggerId, {\n element,\n payload: triggerPayload,\n }),\n );\n return () => {\n if (untracked(registry).get(triggerId)?.element === element) {\n registry.update((entries) => {\n const next = new Map(entries);\n next.delete(triggerId);\n return next;\n });\n }\n };\n },\n positioner,\n popup,\n presence,\n /** The id of a single trigger with none of its own. */\n triggerId: `${id}-trigger`,\n popupId: `${id}-popup`,\n // the handle's entry points (spec/README.md, \"Detached triggers\")\n openFromHandle: (triggerId: string | null) => {\n const element =\n triggerId === null\n ? null\n : untracked(registry).get(triggerId)?.element;\n if (triggerId !== null && element === undefined) {\n // a trigger not rendered (yet): it becomes the active one when it registers; an\n // overlay open on another trigger moves to it, as a press on another trigger\n const isOpen = pending?.open ?? untracked(open);\n if (\n setOpen(true, \"imperative-action\", undefined, null, {\n movesUnrendered:\n isOpen &&\n untracked(requestedTriggerId) !== triggerId,\n }) &&\n untracked(() => inputs.triggerId?.()) === undefined\n ) {\n ownTriggerId.set({ value: triggerId });\n }\n return;\n }\n setOpen(true, \"imperative-action\", undefined, element);\n },\n openWithPayload: (value: unknown) => {\n setOpen(true, \"imperative-action\", undefined, null, {\n payload: { value },\n });\n },\n closeFromHandle: () => {\n setOpen(false, \"imperative-action\");\n },\n // the actions (spec/README.md, \"Lifecycle\")\n close: () => {\n setOpen(false, \"imperative-action\");\n },\n unmount: () => presence.finish(),\n };\n}\n\nexport type OverlayRoot = ReturnType<typeof createOverlayRoot>;\n","import { computed, effect, type Signal, untracked } from \"@angular/core\";\nimport { injectHost } from \"./host-element.ts\";\nimport { injectId } from \"./inject-id.ts\";\nimport type {\n HandleRoot,\n OverlayHandle,\n OverlayHandleStore,\n} from \"./overlay-handle.ts\";\n\n/** What a trigger directive of an overlay with detached triggers declares. */\nexport interface OverlayTriggerInputs {\n /** The handle of a root this trigger opens from anywhere (spec/README.md, \"Detached triggers\"). */\n handle: Signal<OverlayHandle<never> | undefined>;\n /** What the root's `payload()` gives while this trigger is the active one. */\n payload: Signal<unknown>;\n /** The trigger's id (generated when not given): `triggerId` and the handle's `open` name it. */\n id: Signal<string | undefined>;\n}\n\n/**\n * A trigger of an overlay with detached triggers, in its directive's injection context: its root\n * (the enclosing root directive, or the one attached to its `[handle]`, `null` until that root is\n * attached), its id, its registration with the root while it lives, and whether it is the active\n * trigger of the open overlay.\n */\nexport function overlayTrigger<Root extends HandleRoot>(\n enclosing: Root | null,\n inputs: OverlayTriggerInputs,\n options: { prefix: string; selector: string },\n) {\n const host = injectHost();\n const generated = injectId(`${options.prefix}-trigger`);\n const id = computed(() => inputs.id() ?? generated);\n const root = computed((): Root | null => {\n const handle = inputs.handle() as OverlayHandleStore<never> | undefined;\n return handle === undefined\n ? enclosing\n : (handle.root() as Root | null);\n });\n effect((onCleanup) => {\n const current = root();\n const triggerId = id();\n if (current === null) {\n if (untracked(inputs.handle) === undefined) {\n throw new Error(\n `[${options.selector}] must be inside its root, or have a [handle].`,\n );\n }\n return;\n }\n onCleanup(\n untracked(() =>\n current.overlay.registerTrigger(\n triggerId,\n host,\n inputs.payload,\n ),\n ),\n );\n });\n const active = computed(() => {\n const current = root();\n return (\n current?.overlay.open() === true &&\n current.overlay.activeTriggerId() === id()\n );\n });\n return { root, id, active, host };\n}\n","import { HostAttributeToken, inject } from \"@angular/core\";\n\n/**\n * The consumer's own static attribute on the host element (`aria-labelledby=\"...\"`), or `null`. A\n * part that binds the same attribute falls back to it, so a host binding never removes it.\n */\nexport function ownAttribute(name: string): string | null {\n return inject(new HostAttributeToken(name), { optional: true });\n}\n","import {\n afterRenderEffect,\n computed,\n effect,\n linkedSignal,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\nimport {\n freezePanelSize,\n isAnimating,\n nextFrame,\n type PanelSize,\n panelSizeVariables,\n waitForAnimations,\n watchBeforeMatch,\n} from \"@fragiola/primitives/presence\";\nimport { conditionalView } from \"./conditional-view.ts\";\nimport { injectFlush } from \"./flush.ts\";\nimport type { TransitionStatus } from \"./presence.ts\";\n\nexport interface PanelOptions {\n /** Keep a closed panel in the DOM, `hidden` (default `false`). */\n keepMounted?: boolean;\n /** Keep a closed panel in the DOM, `hidden=\"until-found\"`: find-in-page opens it. */\n hiddenUntilFound?: boolean;\n}\n\n/**\n * A disclosure panel's options from its structural directive's main input:\n * `*collapsiblePanel` alone gives `\"\"` (none), `*collapsiblePanel=\"{ keepMounted: true }\"` the\n * object.\n */\nexport function panelOptions(value: unknown): PanelOptions {\n return typeof value === \"object\" && value !== null\n ? (value as PanelOptions)\n : {};\n}\n\nexport interface PanelTransitionOptions {\n open: Signal<boolean>;\n /** The size variables' prefix: `collapsible` gives `--collapsible-panel-height`. */\n prefix: string;\n options: Signal<PanelOptions>;\n /** The browser's find-in-page matched the closed panel's content: open it. */\n onFound: () => void;\n}\n\nexport interface PanelTransition {\n /** The panel's element while it is rendered, else `null`. */\n element: Signal<HTMLElement | null>;\n status: Signal<TransitionStatus>;\n /** The `hidden` attribute's value: `\"\"`, `\"until-found\"`, or `null` while shown. */\n hidden: Signal<string | null>;\n /** The size variables' values (`auto` at rest, pixels while a transition runs). */\n variables: Signal<Record<string, string>>;\n}\n\n/**\n * A disclosure panel's view and its open and close mechanics (spec/collapsible.md, \"Animation\"\n * and \"Find in page\"), shared by Collapsible and Accordion: the structural directive's view,\n * rendered while the panel is shown or exiting (always, when kept mounted), `data-starting-style`\n * and `data-ending-style`, and the size variables, a length while a transition runs and `auto` at\n * rest. A panel open on the first render, or opened by a find-in-page match, has no transition.\n * Created in a structural directive's injection context.\n *\n * Closing measures the panel before `data-ending-style` reaches the DOM: a plain `effect` runs\n * before the view is refreshed, so the element is still the open one when the size is frozen; the\n * ending status is set after it. The ends of the transitions are awaited after rendering\n * (`afterRenderEffect`), as `createPresence` does.\n */\nexport function createPanelTransition({\n open,\n prefix,\n options,\n onFound,\n}: PanelTransitionOptions): PanelTransition {\n const flush = injectFlush();\n // a find-in-page match opens the panel at once, with no transition\n let skipTransition = false;\n // shown: open, or closing while its exit runs (the first render shows the first state)\n const shown = linkedSignal<boolean, boolean>({\n source: open,\n computation: (isOpen, previous) => isOpen || (previous?.value ?? false),\n });\n // `starting` in the same pass as the open state, so the first frame shown carries it\n const status = linkedSignal<boolean, TransitionStatus>({\n source: open,\n computation: (isOpen, previous) => {\n if (previous === undefined) {\n return undefined;\n }\n if (isOpen) {\n // reopened while closing: back from where it is to its size, with no start\n return skipTransition || previous.value === \"ending\"\n ? undefined\n : \"starting\";\n }\n // `ending` is set once the size is frozen\n return previous.value === \"ending\" ? \"ending\" : undefined;\n },\n });\n const size = signal<PanelSize | null>(null);\n const kept = computed(() => {\n const { keepMounted = false, hiddenUntilFound = false } = options();\n return keepMounted || hiddenUntilFound;\n });\n const element = conditionalView(computed(() => shown() || kept()));\n\n let actedOn: boolean | undefined;\n // whether the last close is still running its exit\n let exiting = false;\n effect(() => {\n const isOpen = open();\n untracked(() => {\n const previous = actedOn;\n actedOn = isOpen;\n if (previous === undefined || previous === isOpen) {\n return;\n }\n if (isOpen) {\n // the status reads the flags: computed before they are reset\n status();\n const node = element();\n if (skipTransition) {\n skipTransition = false;\n size.set(null);\n } else if (exiting && node !== null) {\n // reopened while closing: back from where it is to its size, measured again\n size.set(freezePanelSize(node, prefix));\n }\n exiting = false;\n return;\n }\n const node = element();\n if (node === null || node.hidden) {\n shown.set(false);\n status.set(undefined);\n size.set(null);\n return;\n }\n // the size in pixels, applied, before `data-ending-style`: the transition starts from it\n size.set(freezePanelSize(node, prefix));\n exiting = true;\n status.set(\"ending\");\n });\n });\n\n // opening: measured with its starting style applied, which the next frame removes\n afterRenderEffect((onCleanup) => {\n const node = element();\n if (status() !== \"starting\" || node === null) {\n return;\n }\n untracked(() => {\n size.set(freezePanelSize(node, prefix));\n onCleanup(nextFrame(node, () => status.set(undefined)));\n });\n });\n\n // opened: back to `auto` once its transition ended\n afterRenderEffect((onCleanup) => {\n const node = element();\n if (\n !open() ||\n status() !== undefined ||\n size() === null ||\n node === null\n ) {\n return;\n }\n let cancelled = false;\n const cancelFrame = nextFrame(node, () => {\n void waitForAnimations(node).then(() => {\n if (!cancelled) {\n size.set(null);\n }\n });\n });\n onCleanup(() => {\n cancelled = true;\n cancelFrame();\n });\n });\n\n // closing: unmounted (or hidden) once its transition ended\n afterRenderEffect((onCleanup) => {\n if (status() !== \"ending\") {\n return;\n }\n const node = untracked(element);\n let cancelled = false;\n const finish = () => {\n if (!cancelled) {\n exiting = false;\n shown.set(false);\n status.set(undefined);\n size.set(null);\n }\n };\n // nothing to animate: it ends in the same render, before a paint\n if (node === null || !isAnimating(node)) {\n finish();\n return;\n }\n const cancelFrame = nextFrame(node, () => {\n void waitForAnimations(node).then(finish);\n });\n onCleanup(() => {\n cancelled = true;\n cancelFrame();\n });\n });\n\n afterRenderEffect((onCleanup) => {\n const node = element();\n if (node === null || !options().hiddenUntilFound) {\n return;\n }\n onCleanup(\n watchBeforeMatch(node, {\n onMatch: () => {\n skipTransition = true;\n untracked(onFound);\n // rendered within the event: the panel shows the match, open, before the\n // toolkit checks a task later whether the app kept it closed\n flush();\n },\n isOpen: () => {\n const isOpen = untracked(open);\n if (!isOpen) {\n skipTransition = false;\n }\n return isOpen;\n },\n }),\n );\n });\n\n return {\n element,\n status,\n hidden: computed(() => {\n if (shown()) {\n return null;\n }\n return options().hiddenUntilFound ? \"until-found\" : \"\";\n }),\n variables: computed(() => panelSizeVariables(prefix, size())),\n };\n}\n\n/** Writes a panel's size variables on it (structural inline style). */\nexport function writeVariables(\n element: HTMLElement,\n variables: Record<string, string>,\n): void {\n for (const [name, value] of Object.entries(variables)) {\n element.style.setProperty(name, value);\n }\n}\n","import {\n DestroyRef,\n DOCUMENT,\n type EmbeddedViewRef,\n effect,\n inject,\n PLATFORM_ID,\n type Signal,\n TemplateRef,\n untracked,\n ViewContainerRef,\n} from \"@angular/core\";\n\n/**\n * The options of an overlay's structural portal (spec/README.md, API mapping: Angular):\n * `*dialogPortal=\"{ keepMounted: true }\"`, `*dialogPortal=\"{ container: element }\"`, or\n * `*dialogPortal=\"element\"` for a container alone.\n */\nexport interface OverlayPortalOptions {\n /** Where the content goes (default: the document's `body`). */\n container?: Element | null;\n /**\n * Keeps the content rendered while the overlay is closed (hidden), before its first opening\n * and after an exit ends (default `false`; spec/README.md, \"Lifecycle\").\n */\n keepMounted?: boolean;\n}\n\n/**\n * The structural portal (spec/README.md, API mapping: Angular): renders the directive's template\n * while `mounted()` is true (always with `keepMounted`), and moves its nodes to the end of the\n * container (default: the document's `body`), as React's `createPortal`. The view stays in its\n * declaration's change detection and injectors; Angular inserts later nodes next to their anchors,\n * which moved with it, and removes the nodes wherever they are when it clears the view. When the\n * portal itself is destroyed with an enclosing view (a submenu's portal inside its parent's popup),\n * Angular only detaches that view's own root nodes, so the portal removes the nodes it moved.\n *\n * A server render renders nothing: the content appears once the page runs in the browser\n * (spec/README.md, \"Lifecycle\"), and the server never reads a `document` it does not have.\n */\nexport function mountPortal(\n mounted: Signal<boolean>,\n options: Signal<OverlayPortalOptions>,\n): void {\n // `\"browser\"` or `\"server\"` (`isPlatformServer` lives in @angular/common, not a peer)\n if (inject(PLATFORM_ID) !== \"browser\") {\n return;\n }\n const doc = inject(DOCUMENT);\n const template = inject(TemplateRef);\n const viewContainer = inject(ViewContainerRef);\n let view: EmbeddedViewRef<unknown> | null = null;\n let moved: Node[] = [];\n inject(DestroyRef).onDestroy(() => {\n // the view's root nodes now (a root `@if` / `@for` adds nodes after the move), and the\n // ones moved at first\n const nodes = new Set<Node>(moved);\n try {\n for (const node of (view?.rootNodes ?? []) as Node[]) {\n nodes.add(node);\n }\n } catch {\n // a view already destroyed with its parent: the nodes moved at first are all we know\n }\n for (const node of nodes) {\n node.parentNode?.removeChild(node);\n }\n moved = [];\n });\n effect(() => {\n const { container, keepMounted = false } = options();\n const show = mounted() || keepMounted;\n const target = container ?? doc.body;\n untracked(() => {\n if (show && view === null) {\n view = viewContainer.createEmbeddedView(template);\n moved = [...(view.rootNodes as Node[])];\n for (const node of moved) {\n target.appendChild(node);\n }\n } else if (!show && view !== null) {\n viewContainer.clear();\n view = null;\n moved = [];\n }\n });\n });\n}\n\n/**\n * The portal's input transform: `*dialogPortal` alone gives `\"\"` (the default container and no\n * option), `*dialogPortal=\"element\"` that element, and `*dialogPortal=\"{ keepMounted: true }\"`\n * the options.\n */\nexport function portalOptions(value: unknown): OverlayPortalOptions {\n if (typeof Element !== \"undefined\" && value instanceof Element) {\n return { container: value };\n }\n return typeof value === \"object\" && value !== null\n ? (value as OverlayPortalOptions)\n : {};\n}\n","import { InjectionToken, inject, type Signal } from \"@angular/core\";\nimport type { Direction } from \"@fragiola/primitives/direction\";\n\n/**\n * The direction a DirectionProvider gives (spec/direction.md): provided by the `/direction`\n * entry's `[directionProvider]` and `provideDirection()`, read by the components here, so no\n * component imports the provider's entry (D8).\n */\nexport const DIRECTION = new InjectionToken<Signal<Direction>>(\"DIRECTION\");\n\n/**\n * The enclosing provider's direction, as a getter (`null` without a provider), in an injection\n * context: a component passes it to `getDirection(element, provided())`, read when it needs the\n * direction (a key press, a positioning).\n */\nexport function injectProvidedDirection(): () => Direction | null {\n const provided = inject(DIRECTION, { optional: true });\n return () => provided?.() ?? null;\n}\n","import {\n afterRenderEffect,\n type Signal,\n signal,\n untracked,\n type WritableSignal,\n} from \"@angular/core\";\nimport {\n type Align,\n anchorFloating,\n type Side,\n type VirtualAnchor,\n} from \"@fragiola/primitives/positioning\";\nimport { injectProvidedDirection } from \"./provided-direction.ts\";\n\n/** The positioning inputs every Positioner directive declares (spec/popover.md, \"Positioning\"). */\nexport interface PositionerInputs {\n side: Signal<Side | undefined>;\n align: Signal<Align | undefined>;\n sideOffset: Signal<number | undefined>;\n alignOffset: Signal<number | undefined>;\n collisionPadding: Signal<number | undefined>;\n /** The element to anchor to (default: the trigger). */\n anchor: Signal<Element | null | undefined>;\n}\n\nexport interface Placement {\n side: Side;\n align: Align;\n}\n\n/** Where an overlay is placed; setting an equal placement changes nothing. */\nexport function placementSignal(initial: Placement): WritableSignal<Placement> {\n return signal(initial, {\n equal: (a, b) => a.side === b.side && a.align === b.align,\n });\n}\n\n/**\n * Positions an overlay's positioner next to its anchor while both exist, from its inputs with the\n * given defaults, after each render, while `mounted()` (open, or its exit running): a kept-mounted\n * closed overlay is not positioned (spec/README.md, \"Lifecycle\"). Reports where it ended up in\n * `placed` (the root's). Its logical sides follow a DirectionProvider's direction, else the\n * anchor's computed one.\n */\nexport function positionOverlay(\n inputs: PositionerInputs,\n defaults: Placement,\n elements: {\n /** The trigger, or a point (a context menu's virtual anchor). */\n anchor: Signal<Element | VirtualAnchor | null>;\n positioner: HTMLElement;\n arrow?: Signal<HTMLElement | null>;\n mounted?: Signal<boolean>;\n },\n placed: WritableSignal<Placement>,\n): void {\n const direction = injectProvidedDirection();\n afterRenderEffect((onCleanup) => {\n const anchor = inputs.anchor() ?? elements.anchor();\n const options = {\n side: inputs.side() ?? defaults.side,\n align: inputs.align() ?? defaults.align,\n sideOffset: inputs.sideOffset() ?? 0,\n alignOffset: inputs.alignOffset() ?? 0,\n collisionPadding: inputs.collisionPadding() ?? 8,\n arrow: elements.arrow?.() ?? null,\n };\n if (anchor === null || elements.mounted?.() === false) {\n return;\n }\n untracked(() => {\n onCleanup(\n anchorFloating(anchor, elements.positioner, {\n ...options,\n direction,\n onPlaced: (next) => placed.set(next),\n }),\n );\n });\n });\n}\n","import { computed, signal } from \"@angular/core\";\nimport {\n inDocumentOrder,\n type RovingOrientation,\n rovingKeys,\n rovingKeyTarget,\n rovingTabStop,\n textFieldKeepsKey,\n} from \"@fragiola/primitives/collection\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport { injectFlush } from \"./flush.ts\";\nimport { injectHost } from \"./host-element.ts\";\nimport { injectProvidedDirection } from \"./provided-direction.ts\";\nimport type { RovingScope } from \"./roving-scope.ts\";\n\ninterface RovingItem {\n element: HTMLElement;\n focusable: () => boolean;\n}\n\nexport interface RovingCompositeOptions {\n orientation: () => RovingOrientation;\n loopFocus: () => boolean;\n disabled: () => boolean;\n}\n\n/**\n * The root of a roving-focus scope on the host element, in an injection context (spec/toolbar.md,\n * \"Focus\" and \"Nested composites\"): its registered items, the one holding the tab stop (the one\n * that last had focus while it can take focus, else the first that can), and the key handler the\n * host binds: the orientation's arrows (mirrored in RTL), Home and End move the focus through the\n * items in document order, unless a handler before it prevented the key, a modifier is held, or\n * a text field keeps it. The focus it moves is rendered within the key's event, so a quick next\n * key reaches the new tab stop (AGENTS.md, \"Porting\", 8).\n */\nexport function injectRovingComposite(\n options: RovingCompositeOptions,\n): RovingScope {\n const host = injectHost();\n const direction = injectProvidedDirection();\n const flush = injectFlush();\n const items = signal<readonly RovingItem[]>([]);\n const active = signal<HTMLElement | null>(null);\n const ordered = computed(() =>\n inDocumentOrder(items(), (item) => item.element),\n );\n const tabStop = computed(() => {\n const list = ordered();\n const index = rovingTabStop(\n list.length,\n list.findIndex((item) => item.element === active()),\n (candidate) => !list[candidate]?.focusable(),\n );\n return list[index]?.element ?? null;\n });\n\n const keydown = (event: KeyboardEvent) => {\n if (\n event.defaultPrevented ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return;\n }\n const list = ordered();\n const from = list.findIndex((item) => item.element === event.target);\n if (from === -1) {\n // not one of its items (a menu's popup rendered from an item): not its key\n return;\n }\n const orientation = options.orientation();\n const rtl = getDirection(host, direction()) === \"rtl\";\n if (\n textFieldKeepsKey(\n event.target as Element,\n event.key,\n rovingKeys(orientation, rtl),\n )\n ) {\n return;\n }\n const target = rovingKeyTarget(event.key, from, list.length, {\n orientation,\n rtl,\n loop: options.loopFocus(),\n skip: (candidate) => !list[candidate]?.focusable(),\n });\n const element = target === null ? undefined : list[target]?.element;\n if (element === undefined) {\n return;\n }\n event.preventDefault();\n element.focus();\n // the toolbar's keys select a text field's whole text (Base UI)\n if (element.tagName === \"INPUT\" || element.tagName === \"TEXTAREA\") {\n (element as HTMLInputElement).select();\n }\n flush();\n };\n\n return {\n orientation: computed(options.orientation),\n root: computed(() => host),\n disabled: computed(options.disabled),\n tabStop,\n register: (element, focusable) => {\n const item = { element, focusable };\n items.update((current) => [...current, item]);\n return () =>\n items.update((current) =>\n current.filter((entry) => entry !== item),\n );\n },\n focused: (element) => active.set(element),\n keydown,\n };\n}\n","import { computed, InjectionToken, type Signal } from \"@angular/core\";\nimport type { RovingOrientation } from \"@fragiola/primitives/collection\";\n\n/**\n * A roving-focus scope (spec/toolbar.md, \"Nested composites\"): provided by a `[toolbarRoot]`, or by\n * a `[toggleGroup]` with none around it, and passed on by a `[toolbarGroup]` with its `disabled`;\n * every item inside (a Toolbar's Button, Link and Input, a Toggle) registers with the nearest one.\n * It lives in the package's shared code, so no component entry imports another's for it (D8).\n */\nexport interface RovingScope {\n readonly orientation: Signal<RovingOrientation>;\n /** The scope disables its items (a disabled Toolbar.Root or Toolbar.Group). */\n readonly disabled: Signal<boolean>;\n /** The scope's root element: only an element inside it is one of its items (\"Nested composites\", 6). */\n readonly root: Signal<HTMLElement>;\n /** The item holding the tab stop (`tabindex=\"0\"`); `null` before the items are known. */\n readonly tabStop: Signal<HTMLElement | null>;\n /**\n * Registers an item, and returns its cleanup; `focusable`: it can take focus (not disabled,\n * or focusable when disabled), read when the tab stop or a key needs it.\n */\n register: (element: HTMLElement, focusable: () => boolean) => () => void;\n /** An item took focus: it holds the tab stop now. */\n focused: (element: HTMLElement) => void;\n /**\n * The composite's key handler, on its root's `keydown`; an item whose own handlers a disabled\n * guard stopped (a focusable disabled Toolbar.Button) hands it the composite's keys.\n */\n keydown: (event: KeyboardEvent) => void;\n}\n\nexport const ROVING_SCOPE = new InjectionToken<RovingScope>(\"RovingScope\");\n\n/**\n * The scope an element is in: `scope`, unless the element is outside the scope's root (a Toggle in\n * a popup that a portal renders from a Toolbar's item: the portal's view keeps its declaration's\n * injector, the element is elsewhere), then `null`. Before the element is rendered (`rendered`\n * false: a server render, the first render) it is taken as inside, so the server's output does not\n * change. Reactive through `rendered` and the scope's `root`.\n */\nexport function scopeOfElement(\n scope: RovingScope | null,\n element: HTMLElement,\n rendered: boolean,\n): RovingScope | null {\n if (scope === null || !rendered) {\n return scope;\n }\n return scope.root().contains(element) ? scope : null;\n}\n\n/**\n * A scope that forwards every field to `current()`'s (a ToggleGroup's: the Toolbar's around it,\n * or its own once it is known to be outside the toolbar's element). Its `root` changes with\n * `current`, so its items register again with the scope they are now in.\n */\nexport function forwardingScope(current: () => RovingScope): RovingScope {\n return {\n orientation: computed(() => current().orientation()),\n disabled: computed(() => current().disabled()),\n root: computed(() => current().root()),\n tabStop: computed(() => current().tabStop()),\n register: (element, focusable) =>\n current().register(element, focusable),\n focused: (element) => current().focused(element),\n keydown: (event) => current().keydown(event),\n };\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n effect,\n inject,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\nimport { injectHost } from \"./host-element.ts\";\nimport {\n ROVING_SCOPE,\n type RovingScope,\n scopeOfElement,\n} from \"./roving-scope.ts\";\n\nexport interface RovingItemBinding {\n /**\n * The scope it is an item of: the nearest one (or `explicit`), unless the host is outside that\n * scope's root (a popup a portal renders); `null` then.\n */\n scope: Signal<RovingScope | null>;\n /**\n * The roving `tabindex`: `\"0\"` on the scope's tab stop, `\"-1\"` on every other item; `null`\n * outside the scope.\n */\n tabIndex: Signal<string | null>;\n}\n\n/**\n * The host as an item of the nearest roving-focus scope (spec/toolbar.md, \"Nested composites\"), or\n * `null` with none around it, in an injection context: it registers once rendered (never on a\n * server, so every item has `tabindex=\"-1\"` until the items are known), takes the roving\n * `tabindex` and tells the scope when it takes focus. A host outside the scope's root (rendered\n * through a portal) is in no scope (\"Nested composites\", 6). `explicit` names the scope instead\n * of the nearest one (a Menubar's, which its Triggers read from the bar's contract; `null`: none).\n */\nexport function injectRovingItem(\n focusable: () => boolean,\n explicit?: RovingScope | null,\n): RovingItemBinding | null {\n const around =\n explicit === undefined\n ? inject(ROVING_SCOPE, { optional: true })\n : explicit;\n if (around === null) {\n return null;\n }\n const host = injectHost();\n const rendered = signal(false);\n afterNextRender(() => rendered.set(true));\n const scope = computed(() => {\n // the root is read even when the host is not rendered yet: a forwarding scope (a\n // ToggleGroup's) changes it with the scope its items are in\n around.root();\n return scopeOfElement(around, host, rendered());\n });\n // registered once rendered, again whenever the scope it is in changes (its root included)\n effect((onCleanup) => {\n const current = scope();\n around.root();\n if (!rendered() || current === null) {\n return;\n }\n onCleanup(untracked(() => current.register(host, focusable)));\n });\n const onFocus = () => scope()?.focused(host);\n host.addEventListener(\"focus\", onFocus);\n inject(DestroyRef).onDestroy(() => {\n host.removeEventListener(\"focus\", onFocus);\n });\n return {\n scope,\n tabIndex: computed(() => {\n const current = scope();\n if (current === null) {\n return null;\n }\n return current.tabStop() === host ? \"0\" : \"-1\";\n }),\n };\n}\n","/**\n * A `data-*` value for a host binding (spec/README.md, \"State attributes\"): `true` gives an empty\n * attribute, `false`, `null` and `undefined` give none (`null` removes it, never `\"false\"`),\n * strings are values.\n */\nexport function dataValue(\n value: boolean | string | null | undefined,\n): string | null {\n if (value === true) {\n return \"\";\n }\n return typeof value === \"string\" ? value : null;\n}\n\n/** The same for a whole state record: `[attr.data-open]=\"data().open\"`. */\nexport function dataValues<K extends string>(\n state: Record<K, boolean | string | null | undefined>,\n): Record<K, string | null> {\n const values = {} as Record<K, string | null>;\n for (const key of Object.keys(state) as K[]) {\n values[key] = dataValue(state[key]);\n }\n return values;\n}\n\n/**\n * The same as attributes, for a part a structural directive renders (it writes them on the element,\n * with no host binding): `{ open: true }` gives `{ \"data-open\": \"\" }`.\n */\nexport function dataAttributes(\n state: Record<string, boolean | string | null | undefined>,\n): Record<string, string | null> {\n const attributes: Record<string, string | null> = {};\n for (const [key, value] of Object.entries(state)) {\n attributes[`data-${key}`] = dataValue(value);\n }\n return attributes;\n}\n","import { InjectionToken, type Signal } from \"@angular/core\";\nimport type { ChangeDetails } from \"./change-details.ts\";\n\n/**\n * What a `[toggleGroup]` gives its Toggles (spec/toggle-group.md). The token lives in the\n * package's shared code: an entry exports only its API (the API pages), so `/toggle` cannot\n * export it to `/toggle-group`; a Toggle alone still ships no ToggleGroup code.\n */\nexport interface ToggleGroupContext {\n /** The values of the pressed toggles. */\n readonly value: Signal<readonly string[]>;\n readonly disabled: Signal<boolean>;\n /** A Toggle of the group was pressed or released. */\n setPressed: (\n value: string,\n pressed: boolean,\n details: ChangeDetails,\n ) => void;\n}\n\nexport const TOGGLE_GROUP = new InjectionToken<ToggleGroupContext>(\n \"ToggleGroup\",\n);\n","import {\n afterNextRender,\n afterRenderEffect,\n computed,\n DestroyRef,\n effect,\n inject,\n type Signal,\n signal,\n untracked,\n} from \"@angular/core\";\n// types only: the virtual entries pass the toolkit's `createVirtualizer` in, so this shared entry\n// imports nothing of `/virtual` and the components that do not opt in never reference it\nimport type {\n createVirtualizer,\n Virtualizer,\n VirtualRange,\n} from \"@fragiola/primitives/virtual\";\n\n/** A row's size in pixels before it is measured: a number, or a function of the index. */\nexport type VirtualItemSize = number | ((index: number) => number);\n\n/**\n * A rendered row of a virtual list (spec/virtual-lists.md): its item, its place in the set and the\n * room the unrendered rows take before and after it. The template renders a part's `rows()` with\n * an `@for (row of list.rows(); track row.index)`, each Item with the part's row directive bound to\n * it.\n */\nexport interface VirtualRowData<Item> {\n readonly index: number;\n readonly item: Item;\n /** The number of items (`aria-setsize`). */\n readonly setSize: number;\n /** The room of the unrendered rows before it (its `margin-block-start`), or `null`. */\n readonly spaceBefore: number | null;\n /** On the last rendered row, the room of the unrendered rows after it, or `null`. */\n readonly spaceAfter: number | null;\n}\n\nexport interface VirtualRowsOptions<Item> {\n /** The toolkit's `createVirtualizer` (`@fragiola/primitives/virtual`). */\n createVirtualizer: typeof createVirtualizer;\n /** The list element: its scroll container is watched once it renders. */\n host: HTMLElement;\n items: () => readonly Item[];\n /** Rows always rendered (the focused, highlighted or selected one; the ends). */\n pinned: () => readonly number[];\n itemSize: Signal<VirtualItemSize>;\n measure: Signal<boolean>;\n overscan: Signal<number>;\n loading: Signal<boolean>;\n /** The last row came into view while not `loading`. */\n loadMore: () => void;\n}\n\nexport interface VirtualRows<Item> {\n /** The rendered rows. */\n rows: Signal<readonly VirtualRowData<Item>[]>;\n range: Signal<VirtualRange>;\n virtualizer: Virtualizer;\n /** The rendered rows' elements, by index. */\n elements: Signal<ReadonlyMap<number, HTMLElement>>;\n /** Whether the rows are measured (`measure`). */\n measure: Signal<boolean>;\n /** A row's element rendered at `index`; returns its unregistration. */\n register(index: number, element: HTMLElement): () => void;\n}\n\n/**\n * The rows of a virtual list (spec/virtual-lists.md), in an injection context: the toolkit's\n * virtualizer over the items, attached to the list's scroll container after the first render (on\n * a server, the first rows and the pinned ones), rendering again when its range changes; emits\n * `loadMore` when the last row comes into view while not `loading`.\n */\nexport function injectVirtualRows<Item>(\n options: VirtualRowsOptions<Item>,\n): VirtualRows<Item> {\n const version = signal(0);\n const virtualizer = options.createVirtualizer({\n count: 0,\n onChange: () => version.update((count) => count + 1),\n });\n const range = computed(() => {\n version();\n const count = options.items().length;\n const estimateSize = options.itemSize();\n const overscan = options.overscan();\n const pinned = options.pinned();\n virtualizer.update({ count, estimateSize, overscan, pinned });\n return virtualizer.range();\n });\n const rows = computed<readonly VirtualRowData<Item>[]>(() => {\n const current = range();\n const items = options.items();\n const last = current.rows.length - 1;\n return current.rows.map((row, position) => ({\n index: row.index,\n item: items[row.index] as Item,\n setSize: items.length,\n spaceBefore: row.spaceBefore > 0 ? row.spaceBefore : null,\n spaceAfter:\n position === last && current.spaceAfter > 0\n ? current.spaceAfter\n : null,\n }));\n });\n const elements = signal<ReadonlyMap<number, HTMLElement>>(new Map());\n\n let detach: (() => void) | null = null;\n afterNextRender(() => {\n detach = virtualizer.attach(options.host);\n });\n inject(DestroyRef).onDestroy(() => detach?.());\n\n // load more on scroll end: once per change of the loading state, the count or the last row in\n // view\n const end = computed(() => range().visibleEnd);\n const count = computed(() => options.items().length);\n effect(() => {\n const loading = options.loading();\n const total = count();\n if (!loading && total > 0 && end() >= total - 1) {\n untracked(options.loadMore);\n }\n });\n\n return {\n rows,\n range,\n virtualizer,\n elements,\n measure: options.measure,\n register(index, element) {\n elements.update((current) => new Map(current).set(index, element));\n return () =>\n elements.update((current) => {\n if (current.get(index) !== element) {\n return current;\n }\n const next = new Map(current);\n next.delete(index);\n return next;\n });\n },\n };\n}\n\n/**\n * A row directive's work, in its injection context: registers its element at its index and, unless\n * the list's `measure` is `false`, measures it once rendered and on every resize.\n */\nexport function bindVirtualRow(\n rows: VirtualRows<unknown>,\n row: Signal<VirtualRowData<unknown>>,\n host: HTMLElement,\n): void {\n const index = computed(() => row().index);\n afterRenderEffect((onCleanup) => {\n const at = index();\n const stop = untracked(() => rows.register(at, host));\n onCleanup(stop);\n });\n afterRenderEffect((onCleanup) => {\n const at = index();\n if (!rows.measure()) {\n return;\n }\n const stop = untracked(() => rows.virtualizer.measure(at, host));\n onCleanup(stop);\n });\n}\n\n/**\n * The rows a combobox's keys reach from the DOM (Combobox, Autocomplete): the ends, the\n * highlighted row and its neighbours, and the selected row (the list opens on it).\n */\nexport function reachableRows(\n count: number,\n highlighted: number | undefined,\n selected: number,\n): number[] {\n const rows = [0, count - 1];\n if (highlighted !== undefined) {\n rows.push(highlighted - 1, highlighted, highlighted + 1);\n }\n if (selected >= 0) {\n rows.push(selected);\n }\n return rows;\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,iBAAiB,SAAsB;CACnD,MAAM,EAAE,UAAU,uBAAuB,cAAc,MAAM,aACzD;CACJ,IAAI,cACA,OAAO;EACH,MAAM,QAAQ;EACd,MAAM;EACN,UAAU,YAAY,CAAC,wBAAwB,KAAK;EACpD,iBAAiB,YAAY,wBAAwB,SAAS;EAC9D,U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,MAAM,UAAU,QAAQ,QAAO;EAC/B,MAAM,QAAQ,MAAK;EACnB,IAAI,CAAC,WAAW,QAAQ,KAAK,IAAG,KAAM,QAAQ,GAC1C,UAAU,QAAQ,QAAQ;CAElC,CAAC;CAED,OAAO;EACH;EACA;EACA;EACA;EACA,SAAS,QAAQ;EACjB,SAAS,OAAO,SAAO;GACnB,SAAS,QAAQ,YAAY,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,OAAO,OAAO,CAAC;GACjE,aACI,SAAS,QAAQ,YAAW;IACxB,IAAI,QAAQ,IAAI,KAAK,MAAM,SACvB,OAAO;IAEX,MAAM,OAAO,IAAI,IAAI,OAAO;IAC5B,KAAK,OAAO,KAAK;IACjB,OAAO;GACX,CAAC;EACT;CACH;AACL;AAMA,SAAgB,eACZ,MACA,KACA,MAAiB;CAEjB,MAAM,QAAQ,eAAe,IAAG,CAAE,CAAC,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACzC,mBAAmB,cAAa;EAC5B,MAAM,KAAK,MAAK;EAEhB,UADa,gBAAgB,KAAK,SAAS,IAAI,IAAI,CACzC,CAAI;CAClB,CAAC;CACD,mBAAmB,cAAa;EAC5B,MAAM,KAAK,MAAK;EAChB,IAAI,CAAC,KAAK,QAAO,GACb;EAGJ,UADa,gBAAgB,KAAK,YAAY,QAAQ,IAAI,IAAI,CACpD,CAAI;CAClB,CAAC;AACL;AAMA,SAAgB,cACZ,OACA,aACA,UAAgB;CAEhB,MAAM,OAAO,CAAC,GAAG,QAAQ,CAAC;CAC1B,IAAI,gBAAgB,QAChB,KAAK,KAAK,cAAc,GAAG,aAAa,cAAc,CAAC;CAE3D,IAAI,YAAY,GACZ,KAAK,KAAK,QAAQ;CAEtB,OAAO;AACX"}
@@ -0,0 +1,65 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Directive } from "@angular/core";
3
+ import { labelFocusTarget, preventLabelSelection } from "@fragiola/primitives/form";
4
+ import { injectHost } from "@fragiola/primitives-angular/internal";
5
+ var Label = class Label {
6
+ constructor() {
7
+ this.host = injectHost();
8
+ }
9
+ onMouseDown(event) {
10
+ preventLabelSelection(event);
11
+ }
12
+ onClick(event) {
13
+ if (event.defaultPrevented) return;
14
+ labelFocusTarget(this.host)?.focus();
15
+ }
16
+ static {
17
+ this.ɵfac = i0.ɵɵngDeclareFactory({
18
+ minVersion: "12.0.0",
19
+ version: "22.2.6",
20
+ ngImport: i0,
21
+ type: Label,
22
+ deps: [],
23
+ target: i0.ɵɵFactoryTarget.Directive
24
+ });
25
+ }
26
+ static {
27
+ this.ɵdir = i0.ɵɵngDeclareDirective({
28
+ minVersion: "14.0.0",
29
+ version: "22.2.6",
30
+ type: Label,
31
+ isStandalone: true,
32
+ selector: "label[label]",
33
+ host: {
34
+ attributes: { "data-primitives-part": "label-root" },
35
+ listeners: {
36
+ "mousedown": "onMouseDown($event)",
37
+ "click": "onClick($event)"
38
+ }
39
+ },
40
+ exportAs: ["label"],
41
+ ngImport: i0
42
+ });
43
+ }
44
+ };
45
+ i0.ɵɵngDeclareClassMetadata({
46
+ minVersion: "12.0.0",
47
+ version: "22.2.6",
48
+ ngImport: i0,
49
+ type: Label,
50
+ decorators: [{
51
+ type: Directive,
52
+ args: [{
53
+ selector: "label[label]",
54
+ exportAs: "label",
55
+ host: {
56
+ "data-primitives-part": "label-root",
57
+ "(mousedown)": "onMouseDown($event)",
58
+ "(click)": "onClick($event)"
59
+ }
60
+ }]
61
+ }]
62
+ });
63
+ export { Label };
64
+
65
+ //# sourceMappingURL=fragiola-primitives-angular-label.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragiola-primitives-angular-label.mjs","names":[],"sources":["../../label/directives/label.directive.ts"],"sourcesContent":["import { Directive } from \"@angular/core\";\nimport {\n labelFocusTarget,\n preventLabelSelection,\n} from \"@fragiola/primitives/form\";\nimport { injectHost } from \"@fragiola/primitives-angular/internal\";\n\n/**\n * A `<label>` (spec/label.md): `<label label for=\"email\">Email</label>`. It names its control by\n * the native `for` or by wrapping it, a press reaches the control (or focuses the element `for`\n * names when that is no labelable one), and a double press selects none of its text. Its own\n * handlers run before the consumer's `(mousedown)` and `(click)`.\n */\n@Directive({\n selector: \"label[label]\",\n exportAs: \"label\",\n host: {\n \"data-primitives-part\": \"label-root\",\n \"(mousedown)\": \"onMouseDown($event)\",\n \"(click)\": \"onClick($event)\",\n },\n})\nexport class Label {\n private readonly host = injectHost<HTMLLabelElement>();\n\n protected onMouseDown(event: MouseEvent): void {\n // spec/label.md, \"Pointer\": a double press selects no text\n preventLabelSelection(event);\n }\n\n protected onClick(event: MouseEvent): void {\n if (event.defaultPrevented) {\n return;\n }\n // a `for` that names no labelable element (a Slider's thumb): focus it, as React's Label\n labelFocusTarget(this.host)?.focus();\n }\n}\n"],"mappings":";;;;AAsBA,IAAa,QAAb,MAAa,MAAK;CATlB,cAAA;EAUqB,KAAA,OAAO,WAAU;CAcrC;CAZa,YAAY,OAAiB;EAEnC,sBAAsB,KAAK;CAC/B;CAEU,QAAQ,OAAiB;EAC/B,IAAI,MAAM,kBACN;EAGJ,iBAAiB,KAAK,IAAI,CAAC,EAAE,MAAK;CACtC;CAdS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAK,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAL;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAK,cAAA;GAAA,UAAA;GAAA,MAAA;IAAA,YAAA,EAAA,wBAAA,aAAA;IAAA,WAAA;KAAA,aAAA;KAAA,SAAA;IAAA;GAAA;GAAA,UAAA,CAAA,OAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAL,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAK,YAAA,CAAA;EATjB,MAAA;EAAU,MAAA,CAAA;GACP,UAAU;GACV,UAAU;GACV,MAAM;IACF,wBAAwB;IACxB,eAAe;IACf,WAAW;GACd;EACJ,CAAA"}
@@ -0,0 +1,109 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, booleanAttribute, computed, input } from "@angular/core";
3
+ import { dataValues, injectLinkPress } from "@fragiola/primitives-angular/internal";
4
+ var Link = class Link {
5
+ constructor() {
6
+ this.disabled = input(false, {
7
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
8
+ transform: booleanAttribute
9
+ });
10
+ this.current = input(false, {
11
+ ...ngDevMode ? { debugName: "current" } : /* istanbul ignore next */ {},
12
+ transform: booleanAttribute
13
+ });
14
+ this.state = computed(() => ({
15
+ disabled: this.disabled(),
16
+ current: this.current()
17
+ }), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
18
+ this.data = computed(() => dataValues(this.state()), ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
19
+ injectLinkPress(this.disabled);
20
+ }
21
+ static {
22
+ this.ɵfac = i0.ɵɵngDeclareFactory({
23
+ minVersion: "12.0.0",
24
+ version: "22.2.6",
25
+ ngImport: i0,
26
+ type: Link,
27
+ deps: [],
28
+ target: i0.ɵɵFactoryTarget.Directive
29
+ });
30
+ }
31
+ static {
32
+ this.ɵdir = i0.ɵɵngDeclareDirective({
33
+ minVersion: "17.1.0",
34
+ version: "22.2.6",
35
+ type: Link,
36
+ isStandalone: true,
37
+ selector: "a[link]",
38
+ inputs: {
39
+ disabled: {
40
+ classPropertyName: "disabled",
41
+ publicName: "disabled",
42
+ isSignal: true,
43
+ isRequired: false,
44
+ transformFunction: null
45
+ },
46
+ current: {
47
+ classPropertyName: "current",
48
+ publicName: "current",
49
+ isSignal: true,
50
+ isRequired: false,
51
+ transformFunction: null
52
+ }
53
+ },
54
+ host: {
55
+ attributes: { "data-primitives-part": "link-root" },
56
+ properties: {
57
+ "attr.aria-disabled": "disabled() ? 'true' : null",
58
+ "attr.aria-current": "current() ? 'page' : null",
59
+ "attr.data-disabled": "data().disabled",
60
+ "attr.data-current": "data().current"
61
+ }
62
+ },
63
+ exportAs: ["link"],
64
+ ngImport: i0
65
+ });
66
+ }
67
+ };
68
+ i0.ɵɵngDeclareClassMetadata({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.6",
71
+ ngImport: i0,
72
+ type: Link,
73
+ decorators: [{
74
+ type: Directive,
75
+ args: [{
76
+ selector: "a[link]",
77
+ exportAs: "link",
78
+ host: {
79
+ "data-primitives-part": "link-root",
80
+ "[attr.aria-disabled]": "disabled() ? 'true' : null",
81
+ "[attr.aria-current]": "current() ? 'page' : null",
82
+ "[attr.data-disabled]": "data().disabled",
83
+ "[attr.data-current]": "data().current"
84
+ }
85
+ }]
86
+ }],
87
+ ctorParameters: () => [],
88
+ propDecorators: {
89
+ disabled: [{
90
+ type: i0.Input,
91
+ args: [{
92
+ isSignal: true,
93
+ alias: "disabled",
94
+ required: false
95
+ }]
96
+ }],
97
+ current: [{
98
+ type: i0.Input,
99
+ args: [{
100
+ isSignal: true,
101
+ alias: "current",
102
+ required: false
103
+ }]
104
+ }]
105
+ }
106
+ });
107
+ export { Link };
108
+
109
+ //# sourceMappingURL=fragiola-primitives-angular-link.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragiola-primitives-angular-link.mjs","names":[],"sources":["../../link/directives/link.directive.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, input } from \"@angular/core\";\nimport {\n dataValues,\n injectLinkPress,\n} from \"@fragiola/primitives-angular/internal\";\n\nexport interface LinkState {\n disabled: boolean;\n current: boolean;\n}\n\n/**\n * A link with a disabled and a current state (spec/link.md): `<a link href=\"/docs\">`, or on a\n * router's own anchor, `<a routerLink=\"/docs\" link>`. A disabled link's press navigates nowhere:\n * its click stops in its capture phase, before the router's listener.\n */\n@Directive({\n selector: \"a[link]\",\n exportAs: \"link\",\n host: {\n \"data-primitives-part\": \"link-root\",\n \"[attr.aria-disabled]\": \"disabled() ? 'true' : null\",\n \"[attr.aria-current]\": \"current() ? 'page' : null\",\n \"[attr.data-disabled]\": \"data().disabled\",\n \"[attr.data-current]\": \"data().current\",\n },\n})\nexport class Link {\n /** The link is unavailable: `aria-disabled`, and its press navigates nowhere. */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** It links to the page the app is on: `aria-current=\"page\"`. */\n readonly current = input(false, { transform: booleanAttribute });\n readonly state = computed<LinkState>(() => ({\n disabled: this.disabled(),\n current: this.current(),\n }));\n protected readonly data = computed(() => dataValues(this.state()));\n\n constructor() {\n injectLinkPress(this.disabled);\n }\n}\n"],"mappings":";;;AA2BA,IAAa,OAAb,MAAa,KAAI;CAWb,cAAA;EATS,KAAA,WAAW,MAAM,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;GAAI,WAAW;EAAgB,CAAA;EAErD,KAAA,UAAU,MAAM,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;GAAI,WAAW;EAAgB,CAAA;EACpD,KAAA,QAAQ,gBAA2B;GACxC,UAAU,KAAK,SAAQ;GACvB,SAAS,KAAK,QAAO;EACxB,IAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACgB,KAAA,OAAO,eAAe,WAAW,KAAK,MAAK,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAG9D,gBAAgB,KAAK,QAAQ;CACjC;CAbS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAI,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAJ;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAI,cAAA;GAAA,UAAA;GAAA,QAAA;IAAA,UA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