@nanahoshi/mona-ui 0.27.1 → 0.28.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 (359) hide show
  1. package/docs/api/auto-complete.md +67 -0
  2. package/docs/api/avatar.md +31 -0
  3. package/docs/api/breadcrumb.md +74 -0
  4. package/docs/api/button-group.md +71 -0
  5. package/docs/api/button.md +84 -0
  6. package/docs/api/calendar.md +123 -0
  7. package/docs/api/card.md +97 -0
  8. package/docs/api/chart.md +4380 -0
  9. package/docs/api/check-box.md +70 -0
  10. package/docs/api/chip.md +55 -0
  11. package/docs/api/circular-progress-bar.md +71 -0
  12. package/docs/api/collapsible.md +71 -0
  13. package/docs/api/color-gradient.md +54 -0
  14. package/docs/api/color-palette.md +52 -0
  15. package/docs/api/color-picker.md +89 -0
  16. package/docs/api/combo-box.md +69 -0
  17. package/docs/api/command.md +282 -0
  18. package/docs/api/common.md +599 -0
  19. package/docs/api/contextmenu.md +239 -0
  20. package/docs/api/date-input.md +119 -0
  21. package/docs/api/date-picker.md +67 -0
  22. package/docs/api/datetime-picker.md +72 -0
  23. package/docs/api/dialog.md +291 -0
  24. package/docs/api/dropdown-button.md +248 -0
  25. package/docs/api/dropdown-list.md +72 -0
  26. package/docs/api/dropdowns.md +172 -0
  27. package/docs/api/editor.md +117 -0
  28. package/docs/api/expansion-panel.md +85 -0
  29. package/docs/api/fieldset.md +33 -0
  30. package/docs/api/filter.md +116 -0
  31. package/docs/api/grid.md +1445 -0
  32. package/docs/api/i18n.md +1699 -0
  33. package/docs/api/label.md +58 -0
  34. package/docs/api/list-box.md +301 -0
  35. package/docs/api/list-view.md +294 -0
  36. package/docs/api/list.md +119 -0
  37. package/docs/api/locales.md +134 -0
  38. package/docs/api/menubar.md +275 -0
  39. package/docs/api/multi-select.md +92 -0
  40. package/docs/api/notification.md +164 -0
  41. package/docs/api/numeric-text-box.md +130 -0
  42. package/docs/api/otp-input.md +100 -0
  43. package/docs/api/pager.md +371 -0
  44. package/docs/api/placeholder.md +18 -0
  45. package/docs/api/popover.md +170 -0
  46. package/docs/api/popup-menu.md +328 -0
  47. package/docs/api/popup.md +299 -0
  48. package/docs/api/progress-bar.md +79 -0
  49. package/docs/api/query.md +367 -0
  50. package/docs/api/radio-button.md +113 -0
  51. package/docs/api/rating.md +187 -0
  52. package/docs/api/scroll-view.md +93 -0
  53. package/docs/api/segmented.md +114 -0
  54. package/docs/api/sheet.md +65 -0
  55. package/docs/api/sidebar.md +583 -0
  56. package/docs/api/skeleton.md +26 -0
  57. package/docs/api/slider.md +173 -0
  58. package/docs/api/spinner.md +132 -0
  59. package/docs/api/split-button.md +261 -0
  60. package/docs/api/splitter.md +57 -0
  61. package/docs/api/stepper.md +148 -0
  62. package/docs/api/switch.md +78 -0
  63. package/docs/api/tabs.md +139 -0
  64. package/docs/api/text-area.md +20 -0
  65. package/docs/api/text-box.md +106 -0
  66. package/docs/api/theme.md +627 -0
  67. package/docs/api/time-picker.md +69 -0
  68. package/docs/api/time-selector.md +54 -0
  69. package/docs/api/tooltip.md +112 -0
  70. package/docs/api/tree-view.md +631 -0
  71. package/docs/api/window.md +245 -0
  72. package/docs/auto-complete.md +28 -329
  73. package/docs/avatar.md +4 -24
  74. package/docs/breadcrumb.md +10 -65
  75. package/docs/button-group.md +7 -60
  76. package/docs/button.md +8 -67
  77. package/docs/calendar.md +16 -121
  78. package/docs/card.md +16 -79
  79. package/docs/chart-bar.md +16 -234
  80. package/docs/chart-financial.md +10 -121
  81. package/docs/chart-funnel.md +13 -176
  82. package/docs/chart-heatmap.md +15 -131
  83. package/docs/chart-line-area.md +12 -137
  84. package/docs/chart-pie.md +17 -221
  85. package/docs/chart-radar.md +13 -129
  86. package/docs/chart-radial.md +13 -211
  87. package/docs/chart-scatter.md +6 -74
  88. package/docs/chart-treemap.md +14 -196
  89. package/docs/chart.md +168 -1892
  90. package/docs/checkbox.md +5 -61
  91. package/docs/chip.md +7 -42
  92. package/docs/circular-progress-bar.md +9 -61
  93. package/docs/collapsible.md +5 -87
  94. package/docs/color-gradient.md +8 -81
  95. package/docs/color-palette.md +7 -69
  96. package/docs/color-picker.md +9 -105
  97. package/docs/combo-box.md +28 -331
  98. package/docs/command.md +25 -236
  99. package/docs/contextmenu.md +15 -140
  100. package/docs/date-picker.md +7 -110
  101. package/docs/datetime-picker.md +7 -129
  102. package/docs/decimal-textbox.md +6 -69
  103. package/docs/dialog.md +23 -263
  104. package/docs/dropdown-button.md +15 -146
  105. package/docs/dropdown-list.md +29 -332
  106. package/docs/editor.md +10 -164
  107. package/docs/expansion-panel.md +7 -69
  108. package/docs/fieldset.md +5 -24
  109. package/docs/grid-columns.md +12 -92
  110. package/docs/grid-editing.md +29 -291
  111. package/docs/grid-grouping.md +11 -50
  112. package/docs/grid-rows.md +10 -74
  113. package/docs/grid-selection.md +7 -36
  114. package/docs/grid-server.md +8 -293
  115. package/docs/grid-sorting-filtering.md +10 -333
  116. package/docs/grid-state-export.md +17 -228
  117. package/docs/grid.md +23 -216
  118. package/docs/input.md +7 -19
  119. package/docs/installation.md +147 -15
  120. package/docs/introduction.md +37 -15
  121. package/docs/label.md +8 -39
  122. package/docs/list-box.md +21 -253
  123. package/docs/list-view.md +25 -232
  124. package/docs/menubar.md +21 -167
  125. package/docs/multi-select.md +31 -350
  126. package/docs/notification.md +17 -116
  127. package/docs/numeric-textbox.md +9 -78
  128. package/docs/otp-input.md +9 -95
  129. package/docs/pager.md +19 -239
  130. package/docs/placeholder.md +5 -18
  131. package/docs/popover.md +13 -123
  132. package/docs/popup-menu.md +22 -243
  133. package/docs/popup.md +24 -248
  134. package/docs/progress-bar.md +10 -75
  135. package/docs/radio-button.md +8 -96
  136. package/docs/range-slider.md +9 -82
  137. package/docs/rating.md +15 -163
  138. package/docs/scroll-view.md +9 -86
  139. package/docs/segmented.md +8 -90
  140. package/docs/sheet.md +10 -74
  141. package/docs/sidebar-menus.md +20 -155
  142. package/docs/sidebar-state.md +16 -134
  143. package/docs/sidebar.md +18 -218
  144. package/docs/skeleton.md +5 -26
  145. package/docs/slider.md +9 -97
  146. package/docs/spinner.md +15 -95
  147. package/docs/split-button.md +21 -166
  148. package/docs/splitter.md +9 -56
  149. package/docs/stepper.md +13 -127
  150. package/docs/switch.md +8 -58
  151. package/docs/tabs.md +13 -111
  152. package/docs/textarea.md +4 -13
  153. package/docs/textbox.md +10 -77
  154. package/docs/theming-built-in-themes.md +67 -0
  155. package/docs/theming-custom-colors.md +274 -0
  156. package/docs/theming-custom-themes.md +168 -0
  157. package/docs/theming.md +164 -248
  158. package/docs/time-picker.md +7 -112
  159. package/docs/tooltip-directive.md +12 -96
  160. package/docs/tooltip.md +12 -96
  161. package/docs/tree-view.md +42 -495
  162. package/docs/window.md +19 -230
  163. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  164. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  165. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  166. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  167. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  168. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  169. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  170. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  171. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  172. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  173. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  174. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -389
  175. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  176. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  177. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  178. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  179. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  180. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -740
  181. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  182. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -254
  183. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  184. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  185. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  186. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  187. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  188. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -729
  189. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  190. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  191. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  192. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  193. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  194. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  195. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  196. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  197. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  198. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  199. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  200. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  201. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5068
  202. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  203. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  204. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  205. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  206. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  207. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  208. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  209. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  210. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  211. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  212. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  213. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  214. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  215. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  216. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  217. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  218. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  219. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  220. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  221. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  222. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  223. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  224. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  225. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  226. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  227. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  228. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  229. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  230. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  231. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  232. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  233. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  234. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  235. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  236. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  237. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  238. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  239. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  240. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  241. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  242. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  243. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  244. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  245. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  246. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  247. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  248. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  249. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  250. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  251. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  252. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  253. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  254. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  255. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  256. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  257. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  258. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  259. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  260. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  261. package/llms.txt +80 -2
  262. package/package.json +62 -23
  263. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  264. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  265. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  266. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  267. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  268. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  269. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  270. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  271. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  272. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  273. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  274. package/types/nanahoshi-mona-ui-collapsible.d.ts +105 -87
  275. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  276. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  277. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  278. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  279. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  280. package/types/nanahoshi-mona-ui-common.d.ts +360 -385
  281. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  282. package/types/nanahoshi-mona-ui-date-input.d.ts +97 -97
  283. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  284. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  285. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  286. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  287. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  288. package/types/nanahoshi-mona-ui-dropdowns.d.ts +255 -235
  289. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  290. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  291. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  292. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  293. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  294. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  295. package/types/nanahoshi-mona-ui-i18n.d.ts +999 -1052
  296. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  297. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  298. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  299. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  300. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  301. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  302. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  303. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  304. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  305. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  306. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  307. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  308. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  309. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  310. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  311. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  312. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  313. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  314. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  315. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  316. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  317. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  318. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  319. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  320. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  321. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  322. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  323. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  324. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  325. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  326. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  327. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  328. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  329. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  330. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  331. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  332. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  333. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  334. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  335. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  336. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  337. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  338. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  339. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  340. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  341. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  342. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  343. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  344. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  345. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  346. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  347. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  348. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  349. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  350. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  351. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  352. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  353. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  354. package/types/nanahoshi-mona-ui.d.ts +1 -2
  355. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  356. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  357. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  358. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  359. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,162 +1,183 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Renderer2, input, effect, Directive, InjectionToken, computed, signal, DestroyRef, DOCUMENT, afterEveryRender, untracked } from '@angular/core';
3
- import { GlobalPositionStrategy, ConnectionPositionPair } from '@angular/cdk/overlay';
4
- import { forEach } from '@mirei/ts-collections';
5
- import { Observable, timer, take, debounceTime, map, merge, scan, filter } from 'rxjs';
6
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
-
8
- class AttributeBinderDirective {
9
- #element;
10
- #previousKeys;
11
- #renderer;
12
- constructor() {
13
- this.#element = inject(ElementRef);
14
- this.#previousKeys = new Set();
15
- this.#renderer = inject(Renderer2);
16
- this.attributes = input({}, { ...(ngDevMode ? { debugName: "attributes" } : /* istanbul ignore next */ {}), alias: "monaAttributeBinder" });
17
- effect(() => {
18
- const attributes = this.attributes();
19
- const nextKeys = new Set(Object.keys(attributes));
20
- for (const prevKey of this.#previousKeys) {
21
- if (!nextKeys.has(prevKey)) {
22
- this.#renderer.removeAttribute(this.#element.nativeElement, prevKey);
23
- }
24
- }
25
- for (const [key, value] of Object.entries(attributes)) {
26
- if (value == null || value === false) {
27
- this.#renderer.removeAttribute(this.#element.nativeElement, key);
28
- }
29
- else {
30
- const attributeValue = typeof value === "boolean" ? String(value) : value;
31
- this.#renderer.setAttribute(this.#element.nativeElement, key, attributeValue);
32
- }
33
- }
34
- this.#previousKeys.clear();
35
- for (const key of nextKeys) {
36
- this.#previousKeys.add(key);
37
- }
38
- });
39
- }
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AttributeBinderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: AttributeBinderDirective, isStandalone: true, selector: "[monaAttributeBinder]", inputs: { attributes: { classPropertyName: "attributes", publicName: "monaAttributeBinder", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
42
- }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AttributeBinderDirective, decorators: [{
44
- type: Directive,
45
- args: [{
46
- selector: "[monaAttributeBinder]"
47
- }]
48
- }], ctorParameters: () => [], propDecorators: { attributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaAttributeBinder", required: false }] }] } });
49
-
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, DestroyRef, Directive, ElementRef, InjectionToken, Renderer2, afterEveryRender, computed, effect, inject, input, signal, untracked } from "@angular/core";
3
+ import { Observable, debounceTime, filter, map, merge, scan, take, timer } from "rxjs";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ var AttributeBinderDirective = class AttributeBinderDirective {
6
+ #element;
7
+ #previousKeys;
8
+ #renderer;
9
+ constructor() {
10
+ this.#element = inject(ElementRef);
11
+ this.#previousKeys = /* @__PURE__ */ new Set();
12
+ this.#renderer = inject(Renderer2);
13
+ this.attributes = input({}, {
14
+ ...ngDevMode ? { debugName: "attributes" } : /* istanbul ignore next */ {},
15
+ alias: "monaAttributeBinder"
16
+ });
17
+ effect(() => {
18
+ const attributes = this.attributes();
19
+ const nextKeys = new Set(Object.keys(attributes));
20
+ for (const prevKey of this.#previousKeys) if (!nextKeys.has(prevKey)) this.#renderer.removeAttribute(this.#element.nativeElement, prevKey);
21
+ for (const [key, value] of Object.entries(attributes)) if (value == null || value === false) this.#renderer.removeAttribute(this.#element.nativeElement, key);
22
+ else {
23
+ const attributeValue = typeof value === "boolean" ? String(value) : value;
24
+ this.#renderer.setAttribute(this.#element.nativeElement, key, attributeValue);
25
+ }
26
+ this.#previousKeys.clear();
27
+ for (const key of nextKeys) this.#previousKeys.add(key);
28
+ });
29
+ }
30
+ static {
31
+ this.ɵfac = i0.ɵɵngDeclareFactory({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.6",
34
+ ngImport: i0,
35
+ type: AttributeBinderDirective,
36
+ deps: [],
37
+ target: i0.ɵɵFactoryTarget.Directive
38
+ });
39
+ }
40
+ static {
41
+ this.ɵdir = i0.ɵɵngDeclareDirective({
42
+ minVersion: "17.1.0",
43
+ version: "22.2.6",
44
+ type: AttributeBinderDirective,
45
+ isStandalone: true,
46
+ selector: "[monaAttributeBinder]",
47
+ inputs: { attributes: {
48
+ classPropertyName: "attributes",
49
+ publicName: "monaAttributeBinder",
50
+ isSignal: true,
51
+ isRequired: false,
52
+ transformFunction: null
53
+ } },
54
+ ngImport: i0
55
+ });
56
+ }
57
+ };
58
+ i0.ɵɵngDeclareClassMetadata({
59
+ minVersion: "12.0.0",
60
+ version: "22.2.6",
61
+ ngImport: i0,
62
+ type: AttributeBinderDirective,
63
+ decorators: [{
64
+ type: Directive,
65
+ args: [{ selector: "[monaAttributeBinder]" }]
66
+ }],
67
+ ctorParameters: () => [],
68
+ propDecorators: { attributes: [{
69
+ type: i0.Input,
70
+ args: [{
71
+ isSignal: true,
72
+ alias: "monaAttributeBinder",
73
+ required: false
74
+ }]
75
+ }] }
76
+ });
50
77
  const isValidHex = (hex) => {
51
- return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(hex);
78
+ return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(hex);
52
79
  };
53
-
54
80
  const hex2rgba = (hex) => {
55
- let r = 0, g = 0, b = 0, a = 255;
56
- if (hex.length == 4 || hex.length == 5) {
57
- r = parseInt(hex[1] + hex[1], 16);
58
- g = parseInt(hex[2] + hex[2], 16);
59
- b = parseInt(hex[3] + hex[3], 16);
60
- if (hex.length == 5) {
61
- a = parseInt(hex[4] + hex[4], 16);
62
- }
63
- }
64
- else if (hex.length == 7 || hex.length == 9) {
65
- r = parseInt(hex.slice(1, 3), 16);
66
- g = parseInt(hex.slice(3, 5), 16);
67
- b = parseInt(hex.slice(5, 7), 16);
68
- if (hex.length == 9) {
69
- a = parseInt(hex.slice(7, 9), 16);
70
- }
71
- }
72
- return { r: r, g: g, b: b, a: a };
81
+ let r = 0, g = 0, b = 0, a = 255;
82
+ if (hex.length == 4 || hex.length == 5) {
83
+ r = parseInt(hex[1] + hex[1], 16);
84
+ g = parseInt(hex[2] + hex[2], 16);
85
+ b = parseInt(hex[3] + hex[3], 16);
86
+ if (hex.length == 5) a = parseInt(hex[4] + hex[4], 16);
87
+ } else if (hex.length == 7 || hex.length == 9) {
88
+ r = parseInt(hex.slice(1, 3), 16);
89
+ g = parseInt(hex.slice(3, 5), 16);
90
+ b = parseInt(hex.slice(5, 7), 16);
91
+ if (hex.length == 9) a = parseInt(hex.slice(7, 9), 16);
92
+ }
93
+ return {
94
+ r,
95
+ g,
96
+ b,
97
+ a
98
+ };
73
99
  };
74
-
75
100
  const hsla2hsva = (hue, saturation, lightness, alpha) => {
76
- if (hue == null || saturation == null || lightness == null) {
77
- return { h: 0, s: 0, v: 0, a: 255 };
78
- }
79
- const h = hue;
80
- const s = saturation / 100;
81
- const l = lightness / 100;
82
- const v = l + s * Math.min(l, 1 - l);
83
- const sv = v === 0 ? 0 : 2 * (1 - l / v);
84
- return {
85
- h: h,
86
- s: sv * 100,
87
- v: v * 100,
88
- a: alpha ?? 255
89
- };
101
+ if (hue == null || saturation == null || lightness == null) return {
102
+ h: 0,
103
+ s: 0,
104
+ v: 0,
105
+ a: 255
106
+ };
107
+ const h = hue;
108
+ const s = saturation / 100;
109
+ const l = lightness / 100;
110
+ const v = l + s * Math.min(l, 1 - l);
111
+ return {
112
+ h,
113
+ s: (v === 0 ? 0 : 2 * (1 - l / v)) * 100,
114
+ v: v * 100,
115
+ a: alpha ?? 255
116
+ };
90
117
  };
91
-
92
118
  const hsva2rgba = (hue, saturation, value, alpha) => {
93
- if (hue == null || saturation == null || value == null) {
94
- return { r: 0, g: 0, b: 0, a: 255 };
95
- }
96
- const h = hue;
97
- const s = saturation / 100;
98
- const v = value / 100;
99
- const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(0, Math.min(k, 4 - k, 1));
100
- return {
101
- r: Math.round(f(5) * 255),
102
- g: Math.round(f(3) * 255),
103
- b: Math.round(f(1) * 255),
104
- a: alpha ?? 255
105
- };
119
+ if (hue == null || saturation == null || value == null) return {
120
+ r: 0,
121
+ g: 0,
122
+ b: 0,
123
+ a: 255
124
+ };
125
+ const h = hue;
126
+ const s = saturation / 100;
127
+ const v = value / 100;
128
+ const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(0, Math.min(k, 4 - k, 1));
129
+ return {
130
+ r: Math.round(f(5) * 255),
131
+ g: Math.round(f(3) * 255),
132
+ b: Math.round(f(1) * 255),
133
+ a: alpha ?? 255
134
+ };
106
135
  };
107
-
108
136
  const toHexByte = (value) => {
109
- const byte = Math.min(255, Math.max(0, Math.round(value)));
110
- return byte.toString(16).padStart(2, "0");
137
+ return Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0");
111
138
  };
112
139
  const rgba2hex = (r, g, b, a) => {
113
- if (r == null || g == null || b == null || a == null) {
114
- return "";
115
- }
116
- const aHex = toHexByte(a);
117
- return `#${toHexByte(r)}${toHexByte(g)}${toHexByte(b)}${aHex !== "ff" ? aHex : ""}`;
140
+ if (r == null || g == null || b == null || a == null) return "";
141
+ const aHex = toHexByte(a);
142
+ return `#${toHexByte(r)}${toHexByte(g)}${toHexByte(b)}${aHex !== "ff" ? aHex : ""}`;
118
143
  };
119
-
120
144
  const rgba2hsla = (red, green, blue, alpha) => {
121
- if (red == null || green == null || blue == null) {
122
- return { h: 0, s: 0, l: 0, a: 255 };
123
- }
124
- const r = red / 255;
125
- const g = green / 255;
126
- const b = blue / 255;
127
- const max = Math.max(r, g, b);
128
- const min = Math.min(r, g, b);
129
- let h = 0;
130
- let s;
131
- const l = (max + min) / 2;
132
- const d = max - min;
133
- if (d === 0) {
134
- h = s = 0;
135
- }
136
- else {
137
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
138
- switch (max) {
139
- case r:
140
- h = (g - b) / d + (g < b ? 6 : 0);
141
- break;
142
- case g:
143
- h = (b - r) / d + 2;
144
- break;
145
- case b:
146
- h = (r - g) / d + 4;
147
- break;
148
- }
149
- h /= 6;
150
- }
151
- // One decimal, because whole percentages can't bring most colors back: #123456 would return as #123354.
152
- return {
153
- h: Math.round(h * 3600) / 10,
154
- s: Math.round(s * 1000) / 10,
155
- l: Math.round(l * 1000) / 10,
156
- a: alpha ?? 255
157
- };
145
+ if (red == null || green == null || blue == null) return {
146
+ h: 0,
147
+ s: 0,
148
+ l: 0,
149
+ a: 255
150
+ };
151
+ const r = red / 255;
152
+ const g = green / 255;
153
+ const b = blue / 255;
154
+ const max = Math.max(r, g, b);
155
+ const min = Math.min(r, g, b);
156
+ let h = 0;
157
+ let s;
158
+ const l = (max + min) / 2;
159
+ const d = max - min;
160
+ if (d === 0) h = s = 0;
161
+ else {
162
+ s = l > .5 ? d / (2 - max - min) : d / (max + min);
163
+ switch (max) {
164
+ case r:
165
+ h = (g - b) / d + (g < b ? 6 : 0);
166
+ break;
167
+ case g:
168
+ h = (b - r) / d + 2;
169
+ break;
170
+ case b: h = (r - g) / d + 4;
171
+ }
172
+ h /= 6;
173
+ }
174
+ return {
175
+ h: Math.round(h * 3600) / 10,
176
+ s: Math.round(s * 1e3) / 10,
177
+ l: Math.round(l * 1e3) / 10,
178
+ a: alpha ?? 255
179
+ };
158
180
  };
159
-
160
181
  const NUMBER = "[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?";
161
182
  const SEPARATOR = "(?:\\s*,\\s*|\\s+)";
162
183
  const ALPHA = `(?:\\s*[,/]\\s*(${NUMBER}%?))?`;
@@ -164,534 +185,335 @@ const RGB_PATTERN = new RegExp(`^rgba?\\(\\s*(${NUMBER}%?)${SEPARATOR}(${NUMBER}
164
185
  const HSL_PATTERN = new RegExp(`^hsla?\\(\\s*(${NUMBER})(?:deg)?${SEPARATOR}(${NUMBER})%?${SEPARATOR}(${NUMBER})%?${ALPHA}\\s*\\)$`, "i");
165
186
  const clamp = (value, max) => Math.min(max, Math.max(0, value));
166
187
  const parseAlpha = (text) => {
167
- if (text === undefined) {
168
- return 255;
169
- }
170
- const opacity = text.endsWith("%") ? parseFloat(text) / 100 : parseFloat(text);
171
- return Math.round(clamp(opacity, 1) * 255);
188
+ if (text === void 0) return 255;
189
+ const opacity = text.endsWith("%") ? parseFloat(text) / 100 : parseFloat(text);
190
+ return Math.round(clamp(opacity, 1) * 255);
172
191
  };
173
192
  const parseRgbChannel = (text) => {
174
- const channel = text.endsWith("%") ? (parseFloat(text) / 100) * 255 : parseFloat(text);
175
- return Math.round(clamp(channel, 255));
193
+ const channel = text.endsWith("%") ? parseFloat(text) / 100 * 255 : parseFloat(text);
194
+ return Math.round(clamp(channel, 255));
176
195
  };
177
196
  const parseFunctionalColor = (color) => {
178
- const rgb = RGB_PATTERN.exec(color);
179
- if (rgb) {
180
- return {
181
- r: parseRgbChannel(rgb[1]),
182
- g: parseRgbChannel(rgb[2]),
183
- b: parseRgbChannel(rgb[3]),
184
- a: parseAlpha(rgb[4])
185
- };
186
- }
187
- const hsl = HSL_PATTERN.exec(color);
188
- if (hsl) {
189
- const hue = ((parseFloat(hsl[1]) % 360) + 360) % 360;
190
- const hsv = hsla2hsva(hue, clamp(parseFloat(hsl[2]), 100), clamp(parseFloat(hsl[3]), 100), parseAlpha(hsl[4]));
191
- return hsva2rgba(hsv.h, hsv.s, hsv.v, hsv.a);
192
- }
193
- return null;
197
+ const rgb = RGB_PATTERN.exec(color);
198
+ if (rgb) return {
199
+ r: parseRgbChannel(rgb[1]),
200
+ g: parseRgbChannel(rgb[2]),
201
+ b: parseRgbChannel(rgb[3]),
202
+ a: parseAlpha(rgb[4])
203
+ };
204
+ const hsl = HSL_PATTERN.exec(color);
205
+ if (hsl) {
206
+ const hue = (parseFloat(hsl[1]) % 360 + 360) % 360;
207
+ const hsv = hsla2hsva(hue, clamp(parseFloat(hsl[2]), 100), clamp(parseFloat(hsl[3]), 100), parseAlpha(hsl[4]));
208
+ return hsva2rgba(hsv.h, hsv.s, hsv.v, hsv.a);
209
+ }
210
+ return null;
194
211
  };
195
- /**
196
- * Asks the browser about everything else it can paint: color names, `transparent`, `oklch()`, `color-mix()` and so on.
197
- * A color the browser rejects leaves `fillStyle` as it was, so it reads differently from two starting points.
198
- */
199
212
  const readThroughCanvas = (color, document) => {
200
- const context = document.createElement("canvas").getContext?.("2d", { willReadFrequently: true });
201
- if (!context) {
202
- return null;
203
- }
204
- context.fillStyle = "#000000";
205
- context.fillStyle = color;
206
- const fromBlack = context.fillStyle;
207
- context.fillStyle = "#ffffff";
208
- context.fillStyle = color;
209
- if (typeof fromBlack !== "string" || context.fillStyle !== fromBlack) {
210
- return null;
211
- }
212
- if (isValidHex(fromBlack)) {
213
- return hex2rgba(fromBlack);
214
- }
215
- const legacy = parseFunctionalColor(fromBlack);
216
- if (legacy) {
217
- return legacy;
218
- }
219
- // Wider color spaces keep their own notation in `fillStyle`, so read what actually gets painted.
220
- context.clearRect(0, 0, 1, 1);
221
- context.fillRect(0, 0, 1, 1);
222
- const [r, g, b, a] = context.getImageData(0, 0, 1, 1).data;
223
- return { r, g, b, a };
213
+ const context = document.createElement("canvas").getContext?.("2d", { willReadFrequently: true });
214
+ if (!context) return null;
215
+ context.fillStyle = "#000000";
216
+ context.fillStyle = color;
217
+ const fromBlack = context.fillStyle;
218
+ context.fillStyle = "#ffffff";
219
+ context.fillStyle = color;
220
+ if (typeof fromBlack !== "string" || context.fillStyle !== fromBlack) return null;
221
+ if (isValidHex(fromBlack)) return hex2rgba(fromBlack);
222
+ const legacy = parseFunctionalColor(fromBlack);
223
+ if (legacy) return legacy;
224
+ context.clearRect(0, 0, 1, 1);
225
+ context.fillRect(0, 0, 1, 1);
226
+ const [r, g, b, a] = context.getImageData(0, 0, 1, 1).data;
227
+ return {
228
+ r,
229
+ g,
230
+ b,
231
+ a
232
+ };
224
233
  };
225
- /**
226
- * Reads a CSS color. Hex, `rgb()` and `hsl()` in both their comma and space forms need nothing but the text; with a
227
- * `document`, anything else the browser can paint is read through a canvas.
228
- * @returns The channels, each from 0 to 255, or null when the text isn't a color.
229
- */
230
234
  const parseColor = (text, document) => {
231
- const color = text.trim();
232
- if (!color) {
233
- return null;
234
- }
235
- if (isValidHex(color)) {
236
- return hex2rgba(color);
237
- }
238
- return parseFunctionalColor(color) ?? (document ? readThroughCanvas(color, document) : null);
235
+ const color = text.trim();
236
+ if (!color) return null;
237
+ if (isValidHex(color)) return hex2rgba(color);
238
+ return parseFunctionalColor(color) ?? (document ? readThroughCanvas(color, document) : null);
239
239
  };
240
- /**
241
- * A key that is equal for two spellings of the same color, such as `#ABC`, `#aabbcc` and `rgb(170, 187, 204)`. Text that
242
- * can't be read as a color only compares equal to itself, ignoring case.
243
- */
244
240
  const colorKey = (text, document) => {
245
- const color = parseColor(text, document);
246
- return color ? rgba2hex(color.r, color.g, color.b, color.a) : text.trim().toLowerCase();
241
+ const color = parseColor(text, document);
242
+ return color ? rgba2hex(color.r, color.g, color.b, color.a) : text.trim().toLowerCase();
247
243
  };
248
- /**
249
- * The shortest opacity, as CSS writes it, that still reads back as the same 8-bit alpha. A saved `0.5` stays `0.5`.
250
- */
251
244
  const formatAlpha = (alpha) => {
252
- const short = Math.round((alpha / 255) * 100) / 100;
253
- return Math.round(short * 255) === alpha ? short : Math.round((alpha / 255) * 1000) / 1000;
245
+ const short = Math.round(alpha / 255 * 100) / 100;
246
+ return Math.round(short * 255) === alpha ? short : Math.round(alpha / 255 * 1e3) / 1e3;
254
247
  };
255
-
256
- /**
257
- * Hue, saturation and value are left unrounded, so converting to RGB and back returns the same color. Round them for
258
- * display only.
259
- */
260
248
  const rgba2hsva = (r, g, b, a) => {
261
- if (r == null || g == null || b == null) {
262
- return { h: 0, s: 0, v: 0, a: 255 };
263
- }
264
- r = r / 255;
265
- g = g / 255;
266
- b = b / 255;
267
- const max = Math.max(r, g, b);
268
- const min = Math.min(r, g, b);
269
- let h = 0;
270
- const v = max;
271
- const d = max - min;
272
- const s = max === 0 ? 0 : d / max;
273
- if (max !== min) {
274
- if (max === r) {
275
- h = (g - b) / d + (g < b ? 6 : 0);
276
- }
277
- else if (max === g) {
278
- h = (b - r) / d + 2;
279
- }
280
- else if (max === b) {
281
- h = (r - g) / d + 4;
282
- }
283
- h /= 6;
284
- }
285
- return {
286
- h: h * 360,
287
- s: s * 100,
288
- v: v * 100,
289
- a: a ?? 255
290
- };
291
- };
292
-
293
- const tokensOf = (element, attribute) => (element.getAttribute(attribute) ?? "").split(/\s+/).filter(token => token !== "");
294
- /**
295
- * Adds `id` to an id-list attribute such as `aria-describedby`, keeping the ids already there.
296
- */
249
+ if (r == null || g == null || b == null) return {
250
+ h: 0,
251
+ s: 0,
252
+ v: 0,
253
+ a: 255
254
+ };
255
+ r = r / 255;
256
+ g = g / 255;
257
+ b = b / 255;
258
+ const max = Math.max(r, g, b);
259
+ const min = Math.min(r, g, b);
260
+ let h = 0;
261
+ const v = max;
262
+ const d = max - min;
263
+ const s = max === 0 ? 0 : d / max;
264
+ if (max !== min) {
265
+ if (max === r) h = (g - b) / d + (g < b ? 6 : 0);
266
+ else if (max === g) h = (b - r) / d + 2;
267
+ else if (max === b) h = (r - g) / d + 4;
268
+ h /= 6;
269
+ }
270
+ return {
271
+ h: h * 360,
272
+ s: s * 100,
273
+ v: v * 100,
274
+ a: a ?? 255
275
+ };
276
+ };
277
+ const tokensOf = (element, attribute) => (element.getAttribute(attribute) ?? "").split(/\s+/).filter((token) => token !== "");
297
278
  const addAriaReference = (element, attribute, id) => {
298
- const tokens = tokensOf(element, attribute);
299
- if (!tokens.includes(id)) {
300
- element.setAttribute(attribute, [...tokens, id].join(" "));
301
- }
279
+ const tokens = tokensOf(element, attribute);
280
+ if (!tokens.includes(id)) element.setAttribute(attribute, [...tokens, id].join(" "));
302
281
  };
303
- /**
304
- * Removes `id` from an id-list attribute, and the attribute itself once it holds no ids.
305
- */
306
282
  const removeAriaReference = (element, attribute, id) => {
307
- const tokens = tokensOf(element, attribute).filter(token => token !== id);
308
- if (tokens.length) {
309
- element.setAttribute(attribute, tokens.join(" "));
310
- }
311
- else {
312
- element.removeAttribute(attribute);
313
- }
283
+ const tokens = tokensOf(element, attribute).filter((token) => token !== id);
284
+ if (tokens.length) element.setAttribute(attribute, tokens.join(" "));
285
+ else element.removeAttribute(attribute);
314
286
  };
315
-
316
- /**
317
- * Generates a unique control ID for an element.
318
- * The ID consists of the `mona-` prefix followed by a random hexadecimal string.
319
- * It contains only characters that are safe in CSS selectors, so it can be used with `querySelector("#…")` unescaped.
320
- * @param {number} [level=0] - The nesting level of the element. This increases the length of the generated ID.
321
- * @param {number} [length=7] - The base length of the random part of the ID.
322
- * @returns {string} A unique control ID string for use for elements.
323
- */
324
287
  const createElementControlId = (level = 0, length = 7) => {
325
- const idLength = length + level;
326
- const prefix = "mona-";
327
- if (typeof crypto !== "undefined" && crypto.getRandomValues) {
328
- const array = new Uint8Array(Math.ceil(idLength / 2));
329
- crypto.getRandomValues(array);
330
- const randomId = Array.from(array, byte => byte.toString(16).padStart(2, "0"))
331
- .join("")
332
- .substring(0, idLength);
333
- return `${prefix}${randomId}`;
334
- }
335
- let hex = "";
336
- const chars = "0123456789abcdef";
337
- for (let i = 0; i < idLength; i++) {
338
- hex += chars[Math.floor(Math.random() * 16)];
339
- }
340
- return `${prefix}${hex}`;
288
+ const idLength = length + level;
289
+ const prefix = "mona-";
290
+ if (typeof crypto !== "undefined" && crypto.getRandomValues) {
291
+ const array = new Uint8Array(Math.ceil(idLength / 2));
292
+ crypto.getRandomValues(array);
293
+ return `${prefix}${Array.from(array, (byte) => byte.toString(16).padStart(2, "0")).join("").substring(0, idLength)}`;
294
+ }
295
+ let hex = "";
296
+ const chars = "0123456789abcdef";
297
+ for (let i = 0; i < idLength; i++) hex += chars[Math.floor(Math.random() * 16)];
298
+ return `${prefix}${hex}`;
341
299
  };
342
-
343
- /**
344
- * Whether the enclosing `mona-fieldset` is disabled. A native `<fieldset disabled>` reaches only native controls,
345
- * so the fieldset also provides this for controls that draw their own focusable element.
346
- */
347
300
  const MONA_FIELDSET_DISABLED = new InjectionToken("MONA_FIELDSET_DISABLED");
348
- /**
349
- * Combines a control's own `disabled` with the enclosing `mona-fieldset`. Call it from an injection context.
350
- *
351
- * @param disabled Reads the control's own disabled state. It runs lazily, so it may read an input declared later.
352
- */
353
301
  function injectEffectiveDisabled(disabled) {
354
- const fieldsetDisabled = inject(MONA_FIELDSET_DISABLED, { optional: true });
355
- return computed(() => disabled() || (fieldsetDisabled?.() ?? false));
302
+ const fieldsetDisabled = inject(MONA_FIELDSET_DISABLED, { optional: true });
303
+ return computed(() => disabled() || (fieldsetDisabled?.() ?? false));
356
304
  }
357
-
358
- /**
359
- * Provided by `mona-label` to the content it wraps.
360
- */
361
305
  const MONA_LABEL = new InjectionToken("MONA_LABEL");
362
- /**
363
- * Connects a control to a `mona-label` or `label[monaLabel]` that names it, by wrapping it or through `[for]`.
364
- */
365
306
  function injectLabelAssociation(options) {
366
- const context = options.wrapped === false ? null : inject(MONA_LABEL, { optional: true });
367
- const fromTarget = signal(null, /* @ts-ignore */
368
- ...(ngDevMode ? [{ debugName: "fromTarget" }] : /* istanbul ignore next */ []));
369
- const { activate } = options;
370
- if (context && activate) {
371
- const element = inject(ElementRef).nativeElement;
372
- const named = () => !!options.ariaLabel() || !!options.ariaLabelledBy();
373
- inject(DestroyRef).onDestroy(context.register({ activate, element, named }));
374
- }
375
- return {
376
- labelledBy: computed(() => {
377
- const explicit = options.ariaLabelledBy();
378
- if (explicit) {
379
- return explicit;
380
- }
381
- if (options.ariaLabel()) {
382
- return null;
383
- }
384
- return fromTarget() ?? context?.captionId() ?? null;
385
- }),
386
- setLabelledBy: id => fromTarget.set(id)
387
- };
307
+ const context = options.wrapped === false ? null : inject(MONA_LABEL, { optional: true });
308
+ const fromTarget = signal(null, ...ngDevMode ? [{ debugName: "fromTarget" }] : /* istanbul ignore next */ []);
309
+ const { activate } = options;
310
+ if (context && activate) {
311
+ const element = inject(ElementRef).nativeElement;
312
+ const named = () => !!options.ariaLabel() || !!options.ariaLabelledBy();
313
+ inject(DestroyRef).onDestroy(context.register({
314
+ activate,
315
+ element,
316
+ named
317
+ }));
318
+ }
319
+ return {
320
+ labelledBy: computed(() => {
321
+ const explicit = options.ariaLabelledBy();
322
+ if (explicit) return explicit;
323
+ if (options.ariaLabel()) return null;
324
+ return fromTarget() ?? context?.captionId() ?? null;
325
+ }),
326
+ setLabelledBy: (id) => fromTarget.set(id)
327
+ };
388
328
  }
389
-
390
- /**
391
- * Whether a closing popup may move focus back to its trigger without taking it from somewhere the user put it.
392
- * That holds while focus is on the page itself or inside one of `containers`, usually the trigger and the popup.
393
- * A click on another field that closed the popup, or a Tab out of it, must leave focus where it went.
394
- * This is the rule the CDK dialog uses.
395
- */
396
329
  function focusCanReturn(document, ...containers) {
397
- const activeElement = document.activeElement;
398
- if (activeElement == null || activeElement === document.body) {
399
- return true;
400
- }
401
- return containers.some(container => container?.contains(activeElement));
330
+ const activeElement = document.activeElement;
331
+ if (activeElement == null || activeElement === document.body) return true;
332
+ return containers.some((container) => container?.contains(activeElement));
402
333
  }
403
-
404
- /**
405
- * Focuses an element given directly, by reference, or by a selector inside `host`, and returns it (or `null` when the
406
- * selector matches nothing).
407
- */
408
334
  function focusElement(host, element) {
409
- const target = element instanceof ElementRef
410
- ? element.nativeElement
411
- : element instanceof HTMLElement
412
- ? element
413
- : host.querySelector(element);
414
- target?.focus();
415
- return target;
335
+ const target = element instanceof ElementRef ? element.nativeElement : element instanceof HTMLElement ? element : host.querySelector(element);
336
+ target?.focus();
337
+ return target;
416
338
  }
417
-
418
- /**
419
- * How many open modal overlays made each element inert. An element is made inert by the first and released by the
420
- * last, so closing one of two stacked modals leaves the page behind the other one inert.
421
- */
422
- const inertCounts = new WeakMap();
423
- /**
424
- * Elements left alone: they hold no content, announce for everyone (live regions, CDK's live announcer), or hold the
425
- * popups a modal opens. A modal in the overlay container has that container on its own path, so this only matters for
426
- * one in the page.
427
- */
428
- const isExempt = (element) => element instanceof HTMLScriptElement ||
429
- element instanceof HTMLStyleElement ||
430
- element instanceof HTMLTemplateElement ||
431
- element.hasAttribute("aria-live") ||
432
- element.classList.contains("cdk-overlay-backdrop") ||
433
- element.classList.contains("cdk-overlay-container");
434
- /**
435
- * Makes everything outside a modal overlay inert, so assistive technology, the pointer and Tab can't reach the page
436
- * behind it. Walking up from `element` to `<body>`, every sibling is made inert, except that inside the CDK overlay
437
- * container only the overlays opened before this one are: popups opened later (a dropdown inside the dialog) stay
438
- * usable. Elements that were inert already are left as they are.
439
- * @param element the overlay's host element (the CDK overlay wrapper)
440
- * @param options what to leave alone, and where to stop
441
- * @returns the function that releases what this call made inert
442
- */
339
+ const inertCounts = /* @__PURE__ */ new WeakMap();
340
+ const isExempt = (element) => element instanceof HTMLScriptElement || element instanceof HTMLStyleElement || element instanceof HTMLTemplateElement || element.hasAttribute("aria-live") || element.classList.contains("cdk-overlay-backdrop") || element.classList.contains("cdk-overlay-container");
443
341
  const inertOutside = (element, options = {}) => {
444
- const body = element.ownerDocument.body;
445
- const acquired = [];
446
- let node = element;
447
- while (node && node !== body && node !== options.stopAt && node.parentElement) {
448
- const parent = node.parentElement;
449
- const onlyEarlier = parent.classList.contains("cdk-overlay-container");
450
- for (const sibling of Array.from(parent.children)) {
451
- if (sibling === node) {
452
- if (onlyEarlier) {
453
- break;
454
- }
455
- continue;
456
- }
457
- if (isExempt(sibling) || options.keep?.(sibling)) {
458
- continue;
459
- }
460
- const count = inertCounts.get(sibling) ?? 0;
461
- if (count === 0 && sibling.hasAttribute("inert")) {
462
- continue;
463
- }
464
- inertCounts.set(sibling, count + 1);
465
- if (count === 0) {
466
- sibling.setAttribute("inert", "");
467
- }
468
- acquired.push(sibling);
469
- }
470
- node = parent;
471
- }
472
- let released = false;
473
- return () => {
474
- if (released) {
475
- return;
476
- }
477
- released = true;
478
- for (const sibling of acquired) {
479
- const count = (inertCounts.get(sibling) ?? 1) - 1;
480
- if (count <= 0) {
481
- inertCounts.delete(sibling);
482
- sibling.removeAttribute("inert");
483
- }
484
- else {
485
- inertCounts.set(sibling, count);
486
- }
487
- }
488
- };
342
+ const body = element.ownerDocument.body;
343
+ const acquired = [];
344
+ let node = element;
345
+ while (node && node !== body && node !== options.stopAt && node.parentElement) {
346
+ const parent = node.parentElement;
347
+ const onlyEarlier = parent.classList.contains("cdk-overlay-container");
348
+ for (const sibling of Array.from(parent.children)) {
349
+ if (sibling === node) {
350
+ if (onlyEarlier) break;
351
+ continue;
352
+ }
353
+ if (isExempt(sibling) || options.keep?.(sibling)) continue;
354
+ const count = inertCounts.get(sibling) ?? 0;
355
+ if (count === 0 && sibling.hasAttribute("inert")) continue;
356
+ inertCounts.set(sibling, count + 1);
357
+ if (count === 0) sibling.setAttribute("inert", "");
358
+ acquired.push(sibling);
359
+ }
360
+ node = parent;
361
+ }
362
+ let released = false;
363
+ return () => {
364
+ if (released) return;
365
+ released = true;
366
+ for (const sibling of acquired) {
367
+ const count = (inertCounts.get(sibling) ?? 1) - 1;
368
+ if (count <= 0) {
369
+ inertCounts.delete(sibling);
370
+ sibling.removeAttribute("inert");
371
+ } else inertCounts.set(sibling, count);
372
+ }
373
+ };
489
374
  };
490
-
491
- /**
492
- * The text of the elements an `aria-labelledby` value points to, joined with spaces, for names built from a
493
- * component's name ("Filter {name}"). It's read after every render, so it follows the labelling elements' text.
494
- * Call it in an injection context.
495
- * @param ids Returns the space-separated element ids.
496
- */
497
375
  function injectLabelledByText(ids) {
498
- const document = inject(DOCUMENT);
499
- const text = signal("", /* @ts-ignore */
500
- ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
501
- afterEveryRender({
502
- read: () => {
503
- const value = ids()
504
- .split(/\s+/)
505
- .filter(id => id.length > 0)
506
- .map(id => document.getElementById(id)?.textContent?.replace(/\s+/g, " ").trim() ?? "")
507
- .filter(part => part.length > 0)
508
- .join(" ");
509
- if (value !== untracked(text)) {
510
- text.set(value);
511
- }
512
- }
513
- });
514
- return text.asReadonly();
376
+ const document = inject(DOCUMENT);
377
+ const text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
378
+ afterEveryRender({ read: () => {
379
+ const value = ids().split(/\s+/).filter((id) => id.length > 0).map((id) => document.getElementById(id)?.textContent?.replace(/\s+/g, " ").trim() ?? "").filter((part) => part.length > 0).join(" ");
380
+ if (value !== untracked(text)) text.set(value);
381
+ } });
382
+ return text.asReadonly();
383
+ }
384
+ function createPageScrollBlockStrategy(document, block) {
385
+ return {
386
+ attach: (overlayRef) => block.attach(overlayRef),
387
+ disable: () => block.disable(),
388
+ enable: () => {
389
+ if (rootScrollsVertically(document)) block.enable();
390
+ }
391
+ };
392
+ }
393
+ function rootScrollsVertically(document) {
394
+ const view = document.defaultView;
395
+ if (!view) return false;
396
+ const rootOverflow = view.getComputedStyle(document.documentElement).overflowY;
397
+ const overflow = rootOverflow === "visible" && document.body ? view.getComputedStyle(document.body).overflowY : rootOverflow;
398
+ return overflow !== "hidden" && overflow !== "clip";
515
399
  }
516
-
517
- /**
518
- * Places a global overlay through its position strategy, so later `updatePosition()` calls (a direction change, a
519
- * resize) keep it where it is instead of resetting inline styles. Each axis is independent: a `top` alone keeps the
520
- * overlay centered horizontally. Centering follows the overlay's size as it grows or shrinks.
521
- */
522
400
  const positionGlobalOverlay = (overlayRef, position) => {
523
- const strategy = overlayRef.getConfig().positionStrategy;
524
- if (!(strategy instanceof GlobalPositionStrategy)) {
525
- return;
526
- }
527
- if (position.left != null) {
528
- strategy.left(`${position.left}px`);
529
- }
530
- else {
531
- strategy.centerHorizontally();
532
- }
533
- if (position.top != null) {
534
- strategy.top(`${position.top}px`);
535
- }
536
- else {
537
- strategy.centerVertically();
538
- }
539
- overlayRef.updatePosition();
540
- };
541
-
401
+ const strategy = overlayRef.getConfig().positionStrategy;
402
+ if (!isGlobalPositionStrategy(strategy)) return;
403
+ if (position.left != null) strategy.left(`${position.left}px`);
404
+ else strategy.centerHorizontally();
405
+ if (position.top != null) strategy.top(`${position.top}px`);
406
+ else strategy.centerVertically();
407
+ overlayRef.updatePosition();
408
+ };
409
+ function isGlobalPositionStrategy(strategy) {
410
+ const candidate = strategy;
411
+ return typeof candidate?.centerHorizontally === "function" && typeof candidate.centerVertically === "function" && typeof candidate.left === "function" && typeof candidate.top === "function";
412
+ }
542
413
  const rxFromResize = (target, options) => {
543
- return new Observable(observer => {
544
- const elements = target instanceof Element ? [target] : Array.from(target ?? []);
545
- for (const element of elements) {
546
- if (!(element instanceof Element)) {
547
- observer.error(new TypeError("target must be an Element or an iterable of Elements"));
548
- return;
549
- }
550
- }
551
- const resizeObserver = new ResizeObserver(entries => observer.next(entries));
552
- forEach(elements, e => resizeObserver.observe(e, options));
553
- return () => resizeObserver.disconnect();
554
- });
414
+ return new Observable((observer) => {
415
+ const elements = target instanceof Element ? [target] : Array.from(target ?? []);
416
+ for (const element of elements) if (!(element instanceof Element)) {
417
+ observer.error(/* @__PURE__ */ new TypeError("target must be an Element or an iterable of Elements"));
418
+ return;
419
+ }
420
+ const resizeObserver = new ResizeObserver((entries) => observer.next(entries));
421
+ for (const element of elements) resizeObserver.observe(element, options);
422
+ return () => resizeObserver.disconnect();
423
+ });
555
424
  };
556
-
557
- /** Marks the controls the toolbar manages, so they are still found once their Tab stop is set to -1. */
558
425
  const ITEM_MARKER = "data-mona-toolbar-item";
559
426
  const ITEM_SELECTOR = `:is(button, input, select, textarea, a[href], [tabindex]):not([tabindex='-1']), [${ITEM_MARKER}]`;
560
- /** Input types whose Left and Right arrows don't do anything, so the toolbar can use them. */
561
- const BUTTON_LIKE_INPUT_TYPES = new Set(["button", "checkbox", "color", "file", "image", "radio", "reset", "submit"]);
562
- /** Roles of widgets that use Left and Right themselves. A select-only combobox uses only Up and Down. */
563
- const HORIZONTAL_KEY_ROLES = new Set(["radiogroup", "searchbox", "slider", "spinbutton", "tablist", "textbox"]);
427
+ const BUTTON_LIKE_INPUT_TYPES = /* @__PURE__ */ new Set([
428
+ "button",
429
+ "checkbox",
430
+ "color",
431
+ "file",
432
+ "image",
433
+ "radio",
434
+ "reset",
435
+ "submit"
436
+ ]);
437
+ const HORIZONTAL_KEY_ROLES = /* @__PURE__ */ new Set([
438
+ "radiogroup",
439
+ "searchbox",
440
+ "slider",
441
+ "spinbutton",
442
+ "tablist",
443
+ "textbox"
444
+ ]);
564
445
  function usesHorizontalArrows(element) {
565
- if (element instanceof HTMLInputElement) {
566
- return !BUTTON_LIKE_INPUT_TYPES.has(element.type);
567
- }
568
- if (element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement || element.isContentEditable) {
569
- return true;
570
- }
571
- const role = element.getAttribute("role");
572
- return role != null && HORIZONTAL_KEY_ROLES.has(role);
446
+ if (element instanceof HTMLInputElement) return !BUTTON_LIKE_INPUT_TYPES.has(element.type);
447
+ if (element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement || element.isContentEditable) return true;
448
+ const role = element.getAttribute("role");
449
+ return role != null && HORIZONTAL_KEY_ROLES.has(role);
573
450
  }
574
451
  function isUnavailable(element) {
575
- const disabled = (element instanceof HTMLButtonElement ||
576
- element instanceof HTMLInputElement ||
577
- element instanceof HTMLSelectElement ||
578
- element instanceof HTMLTextAreaElement) &&
579
- element.disabled;
580
- return (disabled ||
581
- element.hasAttribute("disabled") ||
582
- element.getAttribute("aria-disabled") === "true" ||
583
- element.closest("[hidden], [aria-hidden='true']") != null);
452
+ return (element instanceof HTMLButtonElement || element instanceof HTMLInputElement || element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement) && element.disabled || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true" || element.closest("[hidden], [aria-hidden='true']") != null;
584
453
  }
585
- /**
586
- * The keyboard of an APG toolbar over controls that other components render: one Tab stop, Left and Right (mirrored
587
- * in right-to-left text) to move between controls, Home and End to the ends. Disabled and hidden controls are
588
- * skipped; a control inside another one (a button inside a combobox) belongs to it.
589
- *
590
- * Call {@link sync} after every render, so controls added later join the Tab stop, and forward the toolbar's
591
- * `focusin` and `keydown` events.
592
- */
593
- class RovingToolbar {
594
- #element;
595
- #active = null;
596
- #activeIndex = 0;
597
- constructor(element) {
598
- this.#element = element;
599
- }
600
- /** The Tab stop follows focus, also when a control is clicked. */
601
- onFocusIn(event) {
602
- const target = event.target;
603
- const item = this.#targets().find(candidate => candidate === target || candidate.contains(target));
604
- if (item != null && item !== this.#active) {
605
- this.#active = item;
606
- this.sync();
607
- }
608
- }
609
- onKeydown(event) {
610
- const key = event.key;
611
- if (key !== "ArrowLeft" && key !== "ArrowRight" && key !== "Home" && key !== "End") {
612
- return;
613
- }
614
- const target = event.target;
615
- if (event.defaultPrevented ||
616
- event.isComposing ||
617
- event.altKey ||
618
- event.ctrlKey ||
619
- event.metaKey ||
620
- usesHorizontalArrows(target)) {
621
- return;
622
- }
623
- const targets = this.#targets();
624
- const currentIndex = targets.findIndex(item => item === target || item.contains(target));
625
- if (currentIndex === -1) {
626
- return;
627
- }
628
- event.preventDefault();
629
- let nextIndex;
630
- if (key === "Home") {
631
- nextIndex = 0;
632
- }
633
- else if (key === "End") {
634
- nextIndex = targets.length - 1;
635
- }
636
- else {
637
- const element = this.#element();
638
- const rtl = element?.ownerDocument.defaultView?.getComputedStyle(element).direction === "rtl";
639
- const step = (key === "ArrowRight") !== rtl ? 1 : -1;
640
- nextIndex = (currentIndex + step + targets.length) % targets.length;
641
- }
642
- this.#active = targets[nextIndex];
643
- this.sync();
644
- targets[nextIndex].focus();
645
- }
646
- /** Gives the active control the Tab stop and takes it from the others. */
647
- sync() {
648
- const targets = this.#targets();
649
- if (targets.length === 0) {
650
- return;
651
- }
652
- const itemIndex = this.#active == null ? -1 : targets.indexOf(this.#active);
653
- const activeIndex = itemIndex !== -1 ? itemIndex : Math.min(this.#activeIndex, targets.length - 1);
654
- this.#active = targets[activeIndex];
655
- this.#activeIndex = activeIndex;
656
- for (const [index, target] of targets.entries()) {
657
- const tabIndex = index === activeIndex ? "0" : "-1";
658
- if (target.getAttribute("tabindex") !== tabIndex) {
659
- target.setAttribute("tabindex", tabIndex);
660
- }
661
- if (!target.hasAttribute(ITEM_MARKER)) {
662
- target.setAttribute(ITEM_MARKER, "");
663
- }
664
- }
665
- }
666
- #targets() {
667
- const element = this.#element();
668
- if (element == null) {
669
- return [];
670
- }
671
- const candidates = Array.from(element.querySelectorAll(ITEM_SELECTOR)).filter(candidate => !isUnavailable(candidate));
672
- return candidates.filter(candidate => !candidates.some(other => other !== candidate && other.contains(candidate)));
673
- }
674
- }
675
-
454
+ var RovingToolbar = class {
455
+ #element;
456
+ #active = null;
457
+ #activeIndex = 0;
458
+ constructor(element) {
459
+ this.#element = element;
460
+ }
461
+ onFocusIn(event) {
462
+ const target = event.target;
463
+ const item = this.#targets().find((candidate) => candidate === target || candidate.contains(target));
464
+ if (item != null && item !== this.#active) {
465
+ this.#active = item;
466
+ this.sync();
467
+ }
468
+ }
469
+ onKeydown(event) {
470
+ const key = event.key;
471
+ if (key !== "ArrowLeft" && key !== "ArrowRight" && key !== "Home" && key !== "End") return;
472
+ const target = event.target;
473
+ if (event.defaultPrevented || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || usesHorizontalArrows(target)) return;
474
+ const targets = this.#targets();
475
+ const currentIndex = targets.findIndex((item) => item === target || item.contains(target));
476
+ if (currentIndex === -1) return;
477
+ event.preventDefault();
478
+ let nextIndex;
479
+ if (key === "Home") nextIndex = 0;
480
+ else if (key === "End") nextIndex = targets.length - 1;
481
+ else {
482
+ const element = this.#element();
483
+ const rtl = element?.ownerDocument.defaultView?.getComputedStyle(element).direction === "rtl";
484
+ nextIndex = (currentIndex + (key === "ArrowRight" !== rtl ? 1 : -1) + targets.length) % targets.length;
485
+ }
486
+ this.#active = targets[nextIndex];
487
+ this.sync();
488
+ targets[nextIndex].focus();
489
+ }
490
+ sync() {
491
+ const targets = this.#targets();
492
+ if (targets.length === 0) return;
493
+ const itemIndex = this.#active == null ? -1 : targets.indexOf(this.#active);
494
+ const activeIndex = itemIndex !== -1 ? itemIndex : Math.min(this.#activeIndex, targets.length - 1);
495
+ this.#active = targets[activeIndex];
496
+ this.#activeIndex = activeIndex;
497
+ for (const [index, target] of targets.entries()) {
498
+ const tabIndex = index === activeIndex ? "0" : "-1";
499
+ if (target.getAttribute("tabindex") !== tabIndex) target.setAttribute("tabindex", tabIndex);
500
+ if (!target.hasAttribute(ITEM_MARKER)) target.setAttribute(ITEM_MARKER, "");
501
+ }
502
+ }
503
+ #targets() {
504
+ const element = this.#element();
505
+ if (element == null) return [];
506
+ const candidates = Array.from(element.querySelectorAll(ITEM_SELECTOR)).filter((candidate) => !isUnavailable(candidate));
507
+ return candidates.filter((candidate) => !candidates.some((other) => other !== candidate && other.contains(candidate)));
508
+ }
509
+ };
676
510
  const rxTimeout = (destroyRef, fn, delay = 0) => {
677
- timer(delay)
678
- .pipe(takeUntilDestroyed(destroyRef), take(1))
679
- .subscribe(() => fn());
511
+ timer(delay).pipe(takeUntilDestroyed(destroyRef), take(1)).subscribe(() => fn());
680
512
  };
681
-
682
- /**
683
- * What says a row is selected besides its tint, which is faint in every theme and gone in forced colors. The row
684
- * has to be positioned.
685
- */
686
513
  const themeSelectionBarClasses = `
687
514
  before:absolute before:inset-y-0 before:start-0 before:w-0.5 before:bg-(--color-selected-border)
688
515
  before:forced-color-adjust-none forced-colors:before:bg-[Highlight]
689
516
  `;
690
- /**
691
- * A border in the text's color for a selected control, drawn only when the user asks for more contrast or forced colors
692
- * are on. Elsewhere the fill says it alone. A control with a border of its own adds `after:-inset-px`, so this one
693
- * replaces it.
694
- */
695
517
  const themeSelectionBorderClasses = `
696
518
  relative
697
519
  after:pointer-events-none after:absolute after:inset-0
@@ -725,415 +547,308 @@ const themeOverlaySurfaceClasses = `
725
547
  [background-color:var(--mona-effect-overlay-background-color,var(--color-surface-overlay))]
726
548
  ${themeOverlayBackdropClasses}
727
549
  `;
728
-
729
- /**
730
- * How long a popup opened by hovering waits after the pointer leaves its anchor, so the pointer can cross the gap
731
- * onto the popup and stay there (WCAG 1.4.13, Content on Hover or Focus).
732
- */
733
550
  const HOVER_GRACE = 100;
734
- /**
735
- * When to show and hide a popup that follows the pointer and focus, shared by the tooltip and the hover popover.
736
- *
737
- * - A show waits for `showDelay`, and leaving the anchor first cancels it.
738
- * - The popup stays while the pointer is on the anchor or on the popup, or focus is on the anchor. Leaving waits for
739
- * `hideDelay` (at least {@link HOVER_GRACE} for the pointer), and coming back cancels the hide.
740
- * - Moving to another anchor replaces the popup.
741
- * - After a dismissal (Escape), the popup stays closed until the pointer and focus have left that anchor.
742
- */
743
- class HoverIntent {
744
- #config;
745
- #anchor = null;
746
- #dismissed = null;
747
- #focused = false;
748
- #hideTimer = null;
749
- #hovered = false;
750
- #panelCleanup = null;
751
- #panelHovered = false;
752
- #pending = null;
753
- #showTimer = null;
754
- #tracked = null;
755
- constructor(config) {
756
- this.#config = config;
757
- }
758
- /**
759
- * Reports that the popup for `anchor` started closing for a reason of its own (Escape, an outside click, being
760
- * disabled). With `dismissed`, it stays closed until the pointer and focus have left the anchor.
761
- */
762
- closed(anchor, dismissed = false) {
763
- if (this.#anchor !== anchor) {
764
- return;
765
- }
766
- if (dismissed && (this.#hovered || this.#focused)) {
767
- this.#dismissed = anchor;
768
- }
769
- this.#release();
770
- }
771
- /** Stops every timer and forgets every anchor, without closing anything. */
772
- dispose() {
773
- this.#clearShow();
774
- this.#cancelHide();
775
- this.#release();
776
- this.#pending = null;
777
- this.#tracked = null;
778
- this.#dismissed = null;
779
- }
780
- /** The pointer moved onto `anchor`, or focus moved into it. */
781
- enter(anchor, source) {
782
- if (anchor !== this.#tracked) {
783
- this.#tracked = anchor;
784
- this.#hovered = false;
785
- this.#focused = false;
786
- }
787
- this.#setActive(source, true);
788
- if (this.#dismissed === anchor) {
789
- return;
790
- }
791
- this.#dismissed = null;
792
- this.#cancelHide();
793
- if (this.#anchor === anchor || this.#pending === anchor) {
794
- return;
795
- }
796
- this.#clearShow();
797
- this.#pending = anchor;
798
- const delay = this.#config.showDelay();
799
- if (delay > 0) {
800
- this.#showTimer = setTimeout(() => this.#show(anchor), delay);
801
- }
802
- else {
803
- this.#show(anchor);
804
- }
805
- }
806
- /** Hides the popup now, as leaving would, and cancels a pending show. */
807
- hideNow() {
808
- this.#clearShow();
809
- this.#pending = null;
810
- this.#cancelHide();
811
- if (this.#anchor) {
812
- this.#release();
813
- this.#config.hide();
814
- }
815
- }
816
- /** The pointer left `anchor`, or focus left it. */
817
- leave(anchor, source) {
818
- if (anchor !== this.#tracked) {
819
- return;
820
- }
821
- this.#setActive(source, false);
822
- if (this.#hovered || this.#focused) {
823
- return;
824
- }
825
- if (this.#dismissed === anchor) {
826
- this.#dismissed = null;
827
- return;
828
- }
829
- if (this.#pending === anchor) {
830
- this.#clearShow();
831
- this.#pending = null;
832
- }
833
- if (this.#anchor === anchor && !this.#panelHovered) {
834
- this.#scheduleHide(source);
835
- }
836
- }
837
- /**
838
- * Reports that the popup for `anchor` is open. While the pointer is on `panel`, the popup stays.
839
- */
840
- opened(anchor, panel) {
841
- this.#release();
842
- this.#anchor = anchor;
843
- if (!panel) {
844
- return;
845
- }
846
- const enter = (event) => {
847
- if (event.pointerType === "touch") {
848
- return;
849
- }
850
- this.#panelHovered = true;
851
- this.#cancelHide();
852
- };
853
- const leave = (event) => {
854
- if (event.pointerType === "touch") {
855
- return;
856
- }
857
- this.#panelHovered = false;
858
- if (this.#anchor === anchor && !this.#hovered && !this.#focused) {
859
- this.#scheduleHide("pointer");
860
- }
861
- };
862
- panel.addEventListener("pointerenter", enter);
863
- panel.addEventListener("pointerleave", leave);
864
- this.#panelCleanup = () => {
865
- panel.removeEventListener("pointerenter", enter);
866
- panel.removeEventListener("pointerleave", leave);
867
- };
868
- }
869
- #cancelHide() {
870
- if (this.#hideTimer != null) {
871
- clearTimeout(this.#hideTimer);
872
- this.#hideTimer = null;
873
- }
874
- }
875
- #clearShow() {
876
- if (this.#showTimer != null) {
877
- clearTimeout(this.#showTimer);
878
- this.#showTimer = null;
879
- }
880
- }
881
- #release() {
882
- this.#panelCleanup?.();
883
- this.#panelCleanup = null;
884
- this.#panelHovered = false;
885
- this.#anchor = null;
886
- this.#cancelHide();
887
- }
888
- #scheduleHide(source) {
889
- this.#cancelHide();
890
- const delay = Math.max(this.#config.hideDelay(), source === "pointer" ? HOVER_GRACE : 0);
891
- const hide = () => {
892
- this.#hideTimer = null;
893
- if (this.#anchor) {
894
- this.#release();
895
- this.#config.hide();
896
- }
897
- };
898
- if (delay > 0) {
899
- this.#hideTimer = setTimeout(hide, delay);
900
- }
901
- else {
902
- hide();
903
- }
904
- }
905
- #setActive(source, active) {
906
- if (source === "pointer") {
907
- this.#hovered = active;
908
- }
909
- else {
910
- this.#focused = active;
911
- }
912
- }
913
- #show(anchor) {
914
- this.#showTimer = null;
915
- this.#pending = null;
916
- if (this.#anchor && this.#anchor !== anchor) {
917
- this.#release();
918
- this.#config.hide();
919
- }
920
- this.#config.show(anchor);
921
- }
922
- /** The anchor whose popup is open, if any. */
923
- get anchor() {
924
- return this.#anchor;
925
- }
926
- }
927
- /**
928
- * Feeds a {@link HoverIntent} from pointer and focus events delegated on `root`, so anchors added, removed or
929
- * re-rendered later need no listeners of their own. Touch pointers are ignored: a tap that focuses the anchor shows
930
- * the popup through focus instead, and it isn't hidden again by the pointer leaving after the tap.
931
- * @param resolve the anchor an event target belongs to, or `null`
932
- * @returns the function that removes the listeners
933
- */
551
+ var HoverIntent = class {
552
+ #config;
553
+ #anchor = null;
554
+ #dismissed = null;
555
+ #focused = false;
556
+ #hideTimer = null;
557
+ #hovered = false;
558
+ #panelCleanup = null;
559
+ #panelHovered = false;
560
+ #pending = null;
561
+ #showTimer = null;
562
+ #tracked = null;
563
+ constructor(config) {
564
+ this.#config = config;
565
+ }
566
+ closed(anchor, dismissed = false) {
567
+ if (this.#anchor !== anchor) return;
568
+ if (dismissed && (this.#hovered || this.#focused)) this.#dismissed = anchor;
569
+ this.#release();
570
+ }
571
+ dispose() {
572
+ this.#clearShow();
573
+ this.#cancelHide();
574
+ this.#release();
575
+ this.#pending = null;
576
+ this.#tracked = null;
577
+ this.#dismissed = null;
578
+ }
579
+ enter(anchor, source) {
580
+ if (anchor !== this.#tracked) {
581
+ this.#tracked = anchor;
582
+ this.#hovered = false;
583
+ this.#focused = false;
584
+ }
585
+ this.#setActive(source, true);
586
+ if (this.#dismissed === anchor) return;
587
+ this.#dismissed = null;
588
+ this.#cancelHide();
589
+ if (this.#anchor === anchor || this.#pending === anchor) return;
590
+ this.#clearShow();
591
+ this.#pending = anchor;
592
+ const delay = this.#config.showDelay();
593
+ if (delay > 0) this.#showTimer = setTimeout(() => this.#show(anchor), delay);
594
+ else this.#show(anchor);
595
+ }
596
+ hideNow() {
597
+ this.#clearShow();
598
+ this.#pending = null;
599
+ this.#cancelHide();
600
+ if (this.#anchor) {
601
+ this.#release();
602
+ this.#config.hide();
603
+ }
604
+ }
605
+ leave(anchor, source) {
606
+ if (anchor !== this.#tracked) return;
607
+ this.#setActive(source, false);
608
+ if (this.#hovered || this.#focused) return;
609
+ if (this.#dismissed === anchor) {
610
+ this.#dismissed = null;
611
+ return;
612
+ }
613
+ if (this.#pending === anchor) {
614
+ this.#clearShow();
615
+ this.#pending = null;
616
+ }
617
+ if (this.#anchor === anchor && !this.#panelHovered) this.#scheduleHide(source);
618
+ }
619
+ opened(anchor, panel) {
620
+ this.#release();
621
+ this.#anchor = anchor;
622
+ if (!panel) return;
623
+ const enter = (event) => {
624
+ if (event.pointerType === "touch") return;
625
+ this.#panelHovered = true;
626
+ this.#cancelHide();
627
+ };
628
+ const leave = (event) => {
629
+ if (event.pointerType === "touch") return;
630
+ this.#panelHovered = false;
631
+ if (this.#anchor === anchor && !this.#hovered && !this.#focused) this.#scheduleHide("pointer");
632
+ };
633
+ panel.addEventListener("pointerenter", enter);
634
+ panel.addEventListener("pointerleave", leave);
635
+ this.#panelCleanup = () => {
636
+ panel.removeEventListener("pointerenter", enter);
637
+ panel.removeEventListener("pointerleave", leave);
638
+ };
639
+ }
640
+ #cancelHide() {
641
+ if (this.#hideTimer != null) {
642
+ clearTimeout(this.#hideTimer);
643
+ this.#hideTimer = null;
644
+ }
645
+ }
646
+ #clearShow() {
647
+ if (this.#showTimer != null) {
648
+ clearTimeout(this.#showTimer);
649
+ this.#showTimer = null;
650
+ }
651
+ }
652
+ #release() {
653
+ this.#panelCleanup?.();
654
+ this.#panelCleanup = null;
655
+ this.#panelHovered = false;
656
+ this.#anchor = null;
657
+ this.#cancelHide();
658
+ }
659
+ #scheduleHide(source) {
660
+ this.#cancelHide();
661
+ const delay = Math.max(this.#config.hideDelay(), source === "pointer" ? 100 : 0);
662
+ const hide = () => {
663
+ this.#hideTimer = null;
664
+ if (this.#anchor) {
665
+ this.#release();
666
+ this.#config.hide();
667
+ }
668
+ };
669
+ if (delay > 0) this.#hideTimer = setTimeout(hide, delay);
670
+ else hide();
671
+ }
672
+ #setActive(source, active) {
673
+ if (source === "pointer") this.#hovered = active;
674
+ else this.#focused = active;
675
+ }
676
+ #show(anchor) {
677
+ this.#showTimer = null;
678
+ this.#pending = null;
679
+ if (this.#anchor && this.#anchor !== anchor) {
680
+ this.#release();
681
+ this.#config.hide();
682
+ }
683
+ this.#config.show(anchor);
684
+ }
685
+ get anchor() {
686
+ return this.#anchor;
687
+ }
688
+ };
934
689
  const listenForHover = (root, resolve, intent) => {
935
- const anchorOf = (target) => target instanceof Element ? resolve(target) : null;
936
- const stillInside = (anchor, to) => to instanceof Node && anchor.contains(to);
937
- const over = (event) => {
938
- if (event.pointerType === "touch") {
939
- return;
940
- }
941
- const anchor = anchorOf(event.target);
942
- if (anchor) {
943
- intent.enter(anchor, "pointer");
944
- }
945
- };
946
- const out = (event) => {
947
- if (event.pointerType === "touch") {
948
- return;
949
- }
950
- const anchor = anchorOf(event.target);
951
- if (anchor && !stillInside(anchor, event.relatedTarget)) {
952
- intent.leave(anchor, "pointer");
953
- }
954
- };
955
- const focusIn = (event) => {
956
- const anchor = anchorOf(event.target);
957
- if (anchor) {
958
- intent.enter(anchor, "focus");
959
- }
960
- };
961
- const focusOut = (event) => {
962
- const anchor = anchorOf(event.target);
963
- if (anchor && !stillInside(anchor, event.relatedTarget)) {
964
- intent.leave(anchor, "focus");
965
- }
966
- };
967
- root.addEventListener("pointerover", over);
968
- root.addEventListener("pointerout", out);
969
- root.addEventListener("focusin", focusIn);
970
- root.addEventListener("focusout", focusOut);
971
- return () => {
972
- root.removeEventListener("pointerover", over);
973
- root.removeEventListener("pointerout", out);
974
- root.removeEventListener("focusin", focusIn);
975
- root.removeEventListener("focusout", focusOut);
976
- };
690
+ const anchorOf = (target) => target instanceof Element ? resolve(target) : null;
691
+ const stillInside = (anchor, to) => to instanceof Node && anchor.contains(to);
692
+ const over = (event) => {
693
+ if (event.pointerType === "touch") return;
694
+ const anchor = anchorOf(event.target);
695
+ if (anchor) intent.enter(anchor, "pointer");
696
+ };
697
+ const out = (event) => {
698
+ if (event.pointerType === "touch") return;
699
+ const anchor = anchorOf(event.target);
700
+ if (anchor && !stillInside(anchor, event.relatedTarget)) intent.leave(anchor, "pointer");
701
+ };
702
+ const focusIn = (event) => {
703
+ const anchor = anchorOf(event.target);
704
+ if (anchor) intent.enter(anchor, "focus");
705
+ };
706
+ const focusOut = (event) => {
707
+ const anchor = anchorOf(event.target);
708
+ if (anchor && !stillInside(anchor, event.relatedTarget)) intent.leave(anchor, "focus");
709
+ };
710
+ root.addEventListener("pointerover", over);
711
+ root.addEventListener("pointerout", out);
712
+ root.addEventListener("focusin", focusIn);
713
+ root.addEventListener("focusout", focusOut);
714
+ return () => {
715
+ root.removeEventListener("pointerover", over);
716
+ root.removeEventListener("pointerout", out);
717
+ root.removeEventListener("focusin", focusIn);
718
+ root.removeEventListener("focusout", focusOut);
719
+ };
977
720
  };
978
- /**
979
- * Calls `callback` once `element` leaves the document, for a popup that would otherwise stay anchored to nothing.
980
- * @returns the function that stops watching
981
- */
982
721
  const onDisconnect = (element, callback) => {
983
- const view = element.ownerDocument.defaultView;
984
- if (!view?.MutationObserver) {
985
- return () => undefined;
986
- }
987
- const observer = new view.MutationObserver(() => {
988
- if (!element.isConnected) {
989
- observer.disconnect();
990
- callback();
991
- }
992
- });
993
- observer.observe(element.ownerDocument.body, { childList: true, subtree: true });
994
- return () => observer.disconnect();
722
+ const view = element.ownerDocument.defaultView;
723
+ if (!view?.MutationObserver) return () => void 0;
724
+ const observer = new view.MutationObserver(() => {
725
+ if (!element.isConnected) {
726
+ observer.disconnect();
727
+ callback();
728
+ }
729
+ });
730
+ observer.observe(element.ownerDocument.body, {
731
+ childList: true,
732
+ subtree: true
733
+ });
734
+ return () => observer.disconnect();
995
735
  };
996
-
997
736
  const OPPOSITE = {
998
- bottom: "top",
999
- left: "right",
1000
- right: "left",
1001
- top: "bottom"
737
+ bottom: "top",
738
+ left: "right",
739
+ right: "left",
740
+ top: "bottom"
1002
741
  };
1003
742
  const resolveOverlaySide = (side, direction) => {
1004
- if (side === "start") {
1005
- return direction === "rtl" ? "right" : "left";
1006
- }
1007
- if (side === "end") {
1008
- return direction === "rtl" ? "left" : "right";
1009
- }
1010
- return side;
1011
- };
743
+ if (side === "start") return direction === "rtl" ? "right" : "left";
744
+ if (side === "end") return direction === "rtl" ? "left" : "right";
745
+ return side;
746
+ };
747
+ const position = (origin, overlay, offsetX, offsetY) => ({
748
+ ...origin,
749
+ ...overlay,
750
+ offsetX,
751
+ offsetY
752
+ });
1012
753
  const positionFor = (side, gap, direction) => {
1013
- // The overlay's start and end follow its direction, so a physical side is translated for RTL.
1014
- const left = direction === "rtl" ? "end" : "start";
1015
- const right = direction === "rtl" ? "start" : "end";
1016
- switch (side) {
1017
- case "top":
1018
- return new ConnectionPositionPair({ originX: "center", originY: "top" }, { overlayX: "center", overlayY: "bottom" }, 0, -gap);
1019
- case "bottom":
1020
- return new ConnectionPositionPair({ originX: "center", originY: "bottom" }, { overlayX: "center", overlayY: "top" }, 0, gap);
1021
- case "left":
1022
- return new ConnectionPositionPair({ originX: left, originY: "center" }, { overlayX: right, overlayY: "center" }, -gap, 0);
1023
- case "right":
1024
- return new ConnectionPositionPair({ originX: right, originY: "center" }, { overlayX: left, overlayY: "center" }, gap, 0);
1025
- }
754
+ const left = direction === "rtl" ? "end" : "start";
755
+ const right = direction === "rtl" ? "start" : "end";
756
+ switch (side) {
757
+ case "top": return position({
758
+ originX: "center",
759
+ originY: "top"
760
+ }, {
761
+ overlayX: "center",
762
+ overlayY: "bottom"
763
+ }, 0, -gap);
764
+ case "bottom": return position({
765
+ originX: "center",
766
+ originY: "bottom"
767
+ }, {
768
+ overlayX: "center",
769
+ overlayY: "top"
770
+ }, 0, gap);
771
+ case "left": return position({
772
+ originX: left,
773
+ originY: "center"
774
+ }, {
775
+ overlayX: right,
776
+ overlayY: "center"
777
+ }, -gap, 0);
778
+ case "right": return position({
779
+ originX: right,
780
+ originY: "center"
781
+ }, {
782
+ overlayX: left,
783
+ overlayY: "center"
784
+ }, gap, 0);
785
+ }
1026
786
  };
1027
- /**
1028
- * Positions for a popup centered on `side` of its anchor, flipping to the opposite side when it doesn't fit. Each
1029
- * position carries its own offset, so the gap stays between the popup and its anchor after a flip.
1030
- * @param gap the distance between the anchor and the popup, in pixels
1031
- * @param direction the overlay's direction
1032
- */
1033
787
  const overlaySidePositions = (side, gap, direction) => [positionFor(side, gap, direction), positionFor(OPPOSITE[side], gap, direction)];
1034
- /**
1035
- * The physical side of its anchor a popup ended up on, from the position the overlay chose.
1036
- */
1037
788
  const sideOfPosition = (position, direction) => {
1038
- if (position.overlayY === "bottom" && position.overlayX === "center") {
1039
- return "top";
1040
- }
1041
- if (position.overlayY === "top" && position.overlayX === "center") {
1042
- return "bottom";
1043
- }
1044
- // A popup to the anchor's right touches it with its left edge: the overlay's start in LTR, its end in RTL.
1045
- const leftEdge = position.overlayX === (direction === "rtl" ? "end" : "start");
1046
- return leftEdge ? "right" : "left";
789
+ if (position.overlayY === "bottom" && position.overlayX === "center") return "top";
790
+ if (position.overlayY === "top" && position.overlayX === "center") return "bottom";
791
+ return position.overlayX === (direction === "rtl" ? "end" : "start") ? "right" : "left";
1047
792
  };
1048
-
1049
793
  const restoreOverlayScroll = (overlayRef, element) => {
1050
- requestAnimationFrame(() => {
1051
- const scrollableContent = findScrollableElement(overlayRef.overlayElement);
1052
- const scrollTop = scrollableContent?.scrollTop ?? 0;
1053
- const width = element.getBoundingClientRect().width;
1054
- overlayRef.updatePosition();
1055
- overlayRef.updateSize({ width });
1056
- requestAnimationFrame(() => {
1057
- if (scrollableContent) {
1058
- scrollableContent.scrollTop = scrollTop;
1059
- }
1060
- });
1061
- });
794
+ requestAnimationFrame(() => {
795
+ const scrollableContent = findScrollableElement(overlayRef.overlayElement);
796
+ const scrollTop = scrollableContent?.scrollTop ?? 0;
797
+ const width = element.getBoundingClientRect().width;
798
+ overlayRef.updatePosition();
799
+ overlayRef.updateSize({ width });
800
+ requestAnimationFrame(() => {
801
+ if (scrollableContent) scrollableContent.scrollTop = scrollTop;
802
+ });
803
+ });
1062
804
  };
1063
805
  const findScrollableElement = (container) => {
1064
- const virtualViewport = container.querySelector(".cdk-virtual-scroll-viewport");
1065
- if (virtualViewport) {
1066
- return virtualViewport;
1067
- }
1068
- const scrollable = container.querySelector("ul, [style*='overflow']");
1069
- if (scrollable && scrollable.scrollHeight > scrollable.clientHeight) {
1070
- return scrollable;
1071
- }
1072
- if (container.scrollHeight > container.clientHeight) {
1073
- return container;
1074
- }
1075
- return null;
806
+ const virtualViewport = container.querySelector(".cdk-virtual-scroll-viewport");
807
+ if (virtualViewport) return virtualViewport;
808
+ const scrollable = container.querySelector("ul, [style*='overflow']");
809
+ if (scrollable && scrollable.scrollHeight > scrollable.clientHeight) return scrollable;
810
+ if (container.scrollHeight > container.clientHeight) return container;
811
+ return null;
1076
812
  };
1077
-
1078
- /**
1079
- * Converts a number or a string into a CSS-compliant value.
1080
- * - If the input is a number (e.g., 100), it appends 'px'.
1081
- * - If the input is a numeric string (e.g., "100"), it appends 'px'.
1082
- * - If the input is a string with a unit (e.g., "100px", "10rem"), it returns it as is.
1083
- *
1084
- * @param value The number or string to convert.
1085
- * @returns A CSS-compliant string value.
1086
- */
1087
813
  const toCssValue = (value) => {
1088
- if (value == null || (typeof value === "string" && value.trim() === "")) {
1089
- return "";
1090
- }
1091
- if (typeof value === "number" || isFinite(Number(value))) {
1092
- return value === 0 ? "0" : `${value}px`;
1093
- }
1094
- return String(value);
814
+ if (value == null || typeof value === "string" && value.trim() === "") return "";
815
+ if (typeof value === "number" || isFinite(Number(value))) return value === 0 ? "0" : `${value}px`;
816
+ return String(value);
1095
817
  };
1096
-
1097
818
  var NavigationKeys;
1098
- (function (NavigationKeys) {
1099
- NavigationKeys["ArrowUp"] = "ArrowUp";
1100
- NavigationKeys["ArrowDown"] = "ArrowDown";
1101
- NavigationKeys["ArrowLeft"] = "ArrowLeft";
1102
- NavigationKeys["ArrowRight"] = "ArrowRight";
1103
- NavigationKeys["Enter"] = "Enter";
1104
- NavigationKeys["Escape"] = "Escape";
1105
- NavigationKeys["Home"] = "Home";
1106
- NavigationKeys["End"] = "End";
1107
- NavigationKeys["PageDown"] = "PageDown";
1108
- NavigationKeys["PageUp"] = "PageUp";
1109
- NavigationKeys["Space"] = " ";
819
+ (function(NavigationKeys) {
820
+ NavigationKeys["ArrowUp"] = "ArrowUp";
821
+ NavigationKeys["ArrowDown"] = "ArrowDown";
822
+ NavigationKeys["ArrowLeft"] = "ArrowLeft";
823
+ NavigationKeys["ArrowRight"] = "ArrowRight";
824
+ NavigationKeys["Enter"] = "Enter";
825
+ NavigationKeys["Escape"] = "Escape";
826
+ NavigationKeys["Home"] = "Home";
827
+ NavigationKeys["End"] = "End";
828
+ NavigationKeys["PageDown"] = "PageDown";
829
+ NavigationKeys["PageUp"] = "PageUp";
830
+ NavigationKeys["Space"] = " ";
1110
831
  })(NavigationKeys || (NavigationKeys = {}));
1111
832
  const navigationKeysList = Object.values(NavigationKeys);
1112
833
  const isNavigationKey = (key) => {
1113
- return navigationKeysList.includes(key);
834
+ return navigationKeysList.includes(key);
1114
835
  };
1115
-
1116
- /**
1117
- * Returns whether a `KeyboardEvent.key` value should feed typeahead.
1118
- * Any single letter or digit in any script counts, plus space, `-` and `_`.
1119
- */
1120
836
  const isTypeaheadKey = (key, modifiers) => {
1121
- if (modifiers?.ctrlKey || modifiers?.metaKey || modifiers?.altKey) {
1122
- return false;
1123
- }
1124
- return /^[\p{L}\p{M}\p{N}\-_\s]$/u.test(key);
837
+ if (modifiers?.ctrlKey || modifiers?.metaKey || modifiers?.altKey) return false;
838
+ return /^[\p{L}\p{M}\p{N}\-_\s]$/u.test(key);
1125
839
  };
1126
- /** How long typeahead waits after the last key before it starts a new search, in milliseconds. */
1127
840
  const TYPEAHEAD_RESET_DELAY = 200;
1128
841
  const setupTypeahead = (typeaheadKey$) => {
1129
- const resetTrigger$ = typeaheadKey$.pipe(debounceTime(TYPEAHEAD_RESET_DELAY), map(() => ({ type: "reset", value: "" })));
1130
- const keypress$ = typeaheadKey$.pipe(map(key => ({ type: "key", value: key })));
1131
- return merge(keypress$, resetTrigger$).pipe(scan((buffer, action) => (action.type === "reset" ? "" : buffer + action.value.toLowerCase()), ""), filter(buffer => buffer.length > 0));
1132
- };
1133
-
1134
- /**
1135
- * Generated bundle index. Do not edit.
1136
- */
842
+ const resetTrigger$ = typeaheadKey$.pipe(debounceTime(200), map(() => ({
843
+ type: "reset",
844
+ value: ""
845
+ })));
846
+ const keypress$ = typeaheadKey$.pipe(map((key) => ({
847
+ type: "key",
848
+ value: key
849
+ })));
850
+ return merge(keypress$, resetTrigger$).pipe(scan((buffer, action) => action.type === "reset" ? "" : buffer + action.value.toLowerCase(), ""), filter((buffer) => buffer.length > 0));
851
+ };
852
+ export { AttributeBinderDirective, HOVER_GRACE, HoverIntent, MONA_FIELDSET_DISABLED, MONA_LABEL, NavigationKeys, RovingToolbar, TYPEAHEAD_RESET_DELAY, addAriaReference, colorKey, createElementControlId, createPageScrollBlockStrategy, focusCanReturn, focusElement, formatAlpha, hex2rgba, hsla2hsva, hsva2rgba, inertOutside, injectEffectiveDisabled, injectLabelAssociation, injectLabelledByText, isNavigationKey, isTypeaheadKey, isValidHex, listenForHover, navigationKeysList, onDisconnect, overlaySidePositions, parseColor, positionGlobalOverlay, removeAriaReference, resolveOverlaySide, restoreOverlayScroll, rgba2hex, rgba2hsla, rgba2hsva, rxFromResize, rxTimeout, setupTypeahead, sideOfPosition, themeControlBackdropClasses, themeControlSurfaceClasses, themeOverlayBackdropClasses, themeOverlaySurfaceClasses, themeRaisedBackdropClasses, themeRaisedSurfaceClasses, themeSelectionBarClasses, themeSelectionBorderClasses, toCssValue };
1137
853
 
1138
- export { AttributeBinderDirective, HOVER_GRACE, HoverIntent, MONA_FIELDSET_DISABLED, MONA_LABEL, NavigationKeys, RovingToolbar, TYPEAHEAD_RESET_DELAY, addAriaReference, colorKey, createElementControlId, focusCanReturn, focusElement, formatAlpha, hex2rgba, hsla2hsva, hsva2rgba, inertOutside, injectEffectiveDisabled, injectLabelAssociation, injectLabelledByText, isNavigationKey, isTypeaheadKey, isValidHex, listenForHover, navigationKeysList, onDisconnect, overlaySidePositions, parseColor, positionGlobalOverlay, removeAriaReference, resolveOverlaySide, restoreOverlayScroll, rgba2hex, rgba2hsla, rgba2hsva, rxFromResize, rxTimeout, setupTypeahead, sideOfPosition, themeControlBackdropClasses, themeControlSurfaceClasses, themeOverlayBackdropClasses, themeOverlaySurfaceClasses, themeRaisedBackdropClasses, themeRaisedSurfaceClasses, themeSelectionBarClasses, themeSelectionBorderClasses, toCssValue };
1139
- //# sourceMappingURL=nanahoshi-mona-ui-internal.mjs.map
854
+ //# sourceMappingURL=nanahoshi-mona-ui-internal.mjs.map