@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,34 +1,67 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { input, inject, TemplateRef, Directive, DestroyRef, ElementRef, computed, signal, contentChild, viewChildren, booleanAttribute, output, model, afterNextRender, isDevMode, afterRenderEffect, Component } from '@angular/core';
4
- import { injectComponentDirection } from '@nanahoshi/mona-ui/i18n';
5
- import { themeControlSurfaceClasses, injectLabelAssociation, injectEffectiveDisabled, createElementControlId } from '@nanahoshi/mona-ui/internal';
6
- import { twMerge } from 'tailwind-merge';
7
- import { cva } from 'class-variance-authority';
8
-
9
- /**
10
- * @description Renders the visual content of every segmented option. Overrides the default label
11
- * text of each option. Bind the options, as `[monaSegmentedItemTemplate]="options"`, to type `let-option` from them.
12
- */
13
- class SegmentedItemTemplateDirective {
14
- constructor() {
15
- /** @description The options, to type `let-option` from them. It changes nothing else. */
16
- this.options = input(undefined, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaSegmentedItemTemplate" });
17
- this.templateRef = inject(TemplateRef);
18
- }
19
- static ngTemplateContextGuard(_directive, _context) {
20
- return true;
21
- }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SegmentedItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: SegmentedItemTemplateDirective, isStandalone: true, selector: "ng-template[monaSegmentedItemTemplate]", inputs: { options: { classPropertyName: "options", publicName: "monaSegmentedItemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
24
- }
25
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SegmentedItemTemplateDirective, decorators: [{
26
- type: Directive,
27
- args: [{
28
- selector: "ng-template[monaSegmentedItemTemplate]"
29
- }]
30
- }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaSegmentedItemTemplate", required: false }] }] } });
31
-
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, inject, input, isDevMode, model, output, signal, viewChildren } from "@angular/core";
4
+ import { injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
5
+ import { createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
6
+ import { twMerge } from "tailwind-merge";
7
+ import { cva } from "class-variance-authority";
8
+ var SegmentedItemTemplateDirective = class SegmentedItemTemplateDirective {
9
+ constructor() {
10
+ this.options = input(void 0, {
11
+ ...ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {},
12
+ alias: "monaSegmentedItemTemplate"
13
+ });
14
+ this.templateRef = inject(TemplateRef);
15
+ }
16
+ static ngTemplateContextGuard(_directive, _context) {
17
+ return true;
18
+ }
19
+ static {
20
+ this.ɵfac = i0.ɵɵngDeclareFactory({
21
+ minVersion: "12.0.0",
22
+ version: "22.2.6",
23
+ ngImport: i0,
24
+ type: SegmentedItemTemplateDirective,
25
+ deps: [],
26
+ target: i0.ɵɵFactoryTarget.Directive
27
+ });
28
+ }
29
+ static {
30
+ this.ɵdir = i0.ɵɵngDeclareDirective({
31
+ minVersion: "17.1.0",
32
+ version: "22.2.6",
33
+ type: SegmentedItemTemplateDirective,
34
+ isStandalone: true,
35
+ selector: "ng-template[monaSegmentedItemTemplate]",
36
+ inputs: { options: {
37
+ classPropertyName: "options",
38
+ publicName: "monaSegmentedItemTemplate",
39
+ isSignal: true,
40
+ isRequired: false,
41
+ transformFunction: null
42
+ } },
43
+ ngImport: i0
44
+ });
45
+ }
46
+ };
47
+ i0.ɵɵngDeclareClassMetadata({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.6",
50
+ ngImport: i0,
51
+ type: SegmentedItemTemplateDirective,
52
+ decorators: [{
53
+ type: Directive,
54
+ args: [{ selector: "ng-template[monaSegmentedItemTemplate]" }]
55
+ }],
56
+ propDecorators: { options: [{
57
+ type: i0.Input,
58
+ args: [{
59
+ isSignal: true,
60
+ alias: "monaSegmentedItemTemplate",
61
+ required: false
62
+ }]
63
+ }] }
64
+ });
32
65
  const segmentedContainerThemeVariants = cva(`
33
66
  relative inline-flex items-center gap-0.5
34
67
  ${themeControlSurfaceClasses}
@@ -39,25 +72,25 @@ const segmentedContainerThemeVariants = cva(`
39
72
  data-[readonly='true']:[&_*]:cursor-default
40
73
  transition-colors duration-(--mona-motion-fast)
41
74
  `, {
42
- variants: {
43
- alignment: {
44
- start: "justify-start",
45
- center: "justify-center",
46
- end: "justify-end",
47
- stretch: "justify-stretch"
48
- },
49
- rounded: {
50
- none: "rounded-none",
51
- small: "rounded-sm",
52
- medium: "rounded-md",
53
- large: "rounded-lg",
54
- full: "rounded-full"
55
- }
56
- },
57
- defaultVariants: {
58
- alignment: "stretch",
59
- rounded: "medium"
60
- }
75
+ variants: {
76
+ alignment: {
77
+ start: "justify-start",
78
+ center: "justify-center",
79
+ end: "justify-end",
80
+ stretch: "justify-stretch"
81
+ },
82
+ rounded: {
83
+ none: "rounded-none",
84
+ small: "rounded-sm",
85
+ medium: "rounded-md",
86
+ large: "rounded-lg",
87
+ full: "rounded-full"
88
+ }
89
+ },
90
+ defaultVariants: {
91
+ alignment: "stretch",
92
+ rounded: "medium"
93
+ }
61
94
  });
62
95
  const segmentedOptionThemeVariants = cva(`
63
96
  relative flex cursor-pointer items-center justify-center gap-1
@@ -78,31 +111,31 @@ const segmentedOptionThemeVariants = cva(`
78
111
  has-[input:focus-visible]:outline-offset-1
79
112
  has-[input:focus-visible]:outline-focus-indicator
80
113
  `, {
81
- variants: {
82
- alignment: {
83
- start: "flex-none",
84
- center: "flex-none",
85
- end: "flex-none",
86
- stretch: "flex-1"
87
- },
88
- rounded: {
89
- none: "rounded-none",
90
- small: "rounded-xs",
91
- medium: "rounded-sm",
92
- large: "rounded-md",
93
- full: "rounded-full"
94
- },
95
- size: {
96
- small: "h-6 px-1.5 text-sm",
97
- medium: "h-8 px-2.5 text-sm",
98
- large: "h-10 px-3.5 text-base"
99
- }
100
- },
101
- defaultVariants: {
102
- alignment: "stretch",
103
- rounded: "medium",
104
- size: "medium"
105
- }
114
+ variants: {
115
+ alignment: {
116
+ start: "flex-none",
117
+ center: "flex-none",
118
+ end: "flex-none",
119
+ stretch: "flex-1"
120
+ },
121
+ rounded: {
122
+ none: "rounded-none",
123
+ small: "rounded-xs",
124
+ medium: "rounded-sm",
125
+ large: "rounded-md",
126
+ full: "rounded-full"
127
+ },
128
+ size: {
129
+ small: "h-6 px-1.5 text-sm",
130
+ medium: "h-8 px-2.5 text-sm",
131
+ large: "h-10 px-3.5 text-base"
132
+ }
133
+ },
134
+ defaultVariants: {
135
+ alignment: "stretch",
136
+ rounded: "medium",
137
+ size: "medium"
138
+ }
106
139
  });
107
140
  const segmentedIndicatorThemeVariants = cva(`
108
141
  pointer-events-none absolute top-0 left-0
@@ -111,23 +144,23 @@ const segmentedIndicatorThemeVariants = cva(`
111
144
  data-[disabled='true']:opacity-50
112
145
  motion-reduce:transition-none
113
146
  `, {
114
- variants: {
115
- animate: {
116
- true: "transition-[transform,width,height] duration-(--mona-motion-fast) ease-out",
117
- false: "transition-none"
118
- },
119
- rounded: {
120
- none: "rounded-none",
121
- small: "rounded-xs",
122
- medium: "rounded-sm",
123
- large: "rounded-md",
124
- full: "rounded-full"
125
- }
126
- },
127
- defaultVariants: {
128
- animate: true,
129
- rounded: "medium"
130
- }
147
+ variants: {
148
+ animate: {
149
+ true: "transition-[transform,width,height] duration-(--mona-motion-fast) ease-out",
150
+ false: "transition-none"
151
+ },
152
+ rounded: {
153
+ none: "rounded-none",
154
+ small: "rounded-xs",
155
+ medium: "rounded-sm",
156
+ large: "rounded-md",
157
+ full: "rounded-full"
158
+ }
159
+ },
160
+ defaultVariants: {
161
+ animate: true,
162
+ rounded: "medium"
163
+ }
131
164
  });
132
165
  const segmentedInputThemeVariants = cva(`
133
166
  peer absolute inset-0 z-10 h-full w-full
@@ -135,367 +168,584 @@ const segmentedInputThemeVariants = cva(`
135
168
  outline-none focus-visible:outline-hidden
136
169
  disabled:cursor-not-allowed
137
170
  `);
138
-
139
- class SegmentedComponent {
140
- #destroyRef;
141
- #direction;
142
- #hostElementRef;
143
- #label;
144
- #lastAnimatedIndex;
145
- #lastOptions;
146
- #lastSize;
147
- #observedOptionElements;
148
- #resizeObserver;
149
- constructor() {
150
- this.#destroyRef = inject(DestroyRef);
151
- this.#direction = injectComponentDirection();
152
- this.#hostElementRef = inject(ElementRef);
153
- this.#label = injectLabelAssociation({
154
- activate: () => this.focus(),
155
- ariaLabel: () => this.ariaLabel(),
156
- ariaLabelledBy: () => this.ariaLabelledBy()
157
- });
158
- this.#lastAnimatedIndex = null;
159
- this.#lastOptions = null;
160
- this.#lastSize = null;
161
- this.#observedOptionElements = [];
162
- this.#resizeObserver = null;
163
- this.containerClasses = computed(() => {
164
- const classes = segmentedContainerThemeVariants({ alignment: this.alignment(), rounded: this.rounded() });
165
- return twMerge(classes, this.userClass());
166
- }, /* @ts-ignore */
167
- ...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
168
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
169
- this.geometryReady = computed(() => !!this.indicatorGeometry(), /* @ts-ignore */
170
- ...(ngDevMode ? [{ debugName: "geometryReady" }] : /* istanbul ignore next */ []));
171
- this.groupName = createElementControlId();
172
- this.indicatorClasses = computed(() => {
173
- const animate = this.animate() && this.indicatorTransitionEnabled();
174
- const rounded = this.rounded();
175
- return segmentedIndicatorThemeVariants({ animate, rounded });
176
- }, /* @ts-ignore */
177
- ...(ngDevMode ? [{ debugName: "indicatorClasses" }] : /* istanbul ignore next */ []));
178
- this.indicatorGeometry = signal(null, /* @ts-ignore */
179
- ...(ngDevMode ? [{ debugName: "indicatorGeometry" }] : /* istanbul ignore next */ []));
180
- this.indicatorInitialized = signal(false, /* @ts-ignore */
181
- ...(ngDevMode ? [{ debugName: "indicatorInitialized" }] : /* istanbul ignore next */ []));
182
- this.indicatorTransitionEnabled = signal(false, /* @ts-ignore */
183
- ...(ngDevMode ? [{ debugName: "indicatorTransitionEnabled" }] : /* istanbul ignore next */ []));
184
- this.inputClasses = computed(() => segmentedInputThemeVariants(), /* @ts-ignore */
185
- ...(ngDevMode ? [{ debugName: "inputClasses" }] : /* istanbul ignore next */ []));
186
- this.invalidState = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
187
- ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
188
- this.itemTemplate = contentChild(SegmentedItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
189
- this.labelledBy = this.#label.labelledBy;
190
- this.optionClasses = computed(() => {
191
- const alignment = this.alignment();
192
- const rounded = this.rounded();
193
- const size = this.size();
194
- return segmentedOptionThemeVariants({ alignment, rounded, size });
195
- }, /* @ts-ignore */
196
- ...(ngDevMode ? [{ debugName: "optionClasses" }] : /* istanbul ignore next */ []));
197
- this.optionContexts = computed(() => {
198
- const disabled = this.effectiveDisabled();
199
- const value = this.value();
200
- return this.options().map((option, index) => ({
201
- $implicit: option,
202
- disabled: disabled || !!option.disabled,
203
- index,
204
- option,
205
- selected: option.value === value
206
- }));
207
- }, /* @ts-ignore */
208
- ...(ngDevMode ? [{ debugName: "optionContexts" }] : /* istanbul ignore next */ []));
209
- this.optionElements = viewChildren("optionElement", /* @ts-ignore */
210
- ...(ngDevMode ? [{ debugName: "optionElements" }] : /* istanbul ignore next */ []));
211
- this.radioInputs = viewChildren("radioInput", /* @ts-ignore */
212
- ...(ngDevMode ? [{ debugName: "radioInputs" }] : /* istanbul ignore next */ []));
213
- this.selectedIndex = computed(() => {
214
- const value = this.value();
215
- return this.options().findIndex(option => option.value === value);
216
- }, /* @ts-ignore */
217
- ...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
218
- this.selectedOptionDisabled = computed(() => {
219
- const selectedIndex = this.selectedIndex();
220
- if (selectedIndex === -1) {
221
- return false;
222
- }
223
- const option = this.options()[selectedIndex];
224
- return this.effectiveDisabled() || !!option?.disabled;
225
- }, /* @ts-ignore */
226
- ...(ngDevMode ? [{ debugName: "selectedOptionDisabled" }] : /* istanbul ignore next */ []));
227
- /**
228
- * @description Controls the alignment of the items inside the segmented component.
229
- * @default "stretch"
230
- */
231
- this.alignment = input("stretch", /* @ts-ignore */
232
- ...(ngDevMode ? [{ debugName: "alignment" }] : /* istanbul ignore next */ []));
233
- /**
234
- * @description Controls whether the selection indicator animates between selected options.
235
- * When false, selection changes are applied immediately without transition.
236
- * @default true
237
- */
238
- this.animate = input(true, { ...(ngDevMode ? { debugName: "animate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
239
- /**
240
- * @description Accessible name for the radio group. Provide either `aria-label` or `aria-labelledby`.
241
- * @default null
242
- */
243
- this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
244
- /**
245
- * @description ID of an external element that provides the accessible name for the radio group.
246
- * @default null
247
- */
248
- this.ariaLabelledBy = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
249
- /**
250
- * @description Disables every option in the group and prevents value changes.
251
- * @default false
252
- */
253
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
254
- /**
255
- * @description Marks the component as invalid. Error styling requires both `invalid` and `touched` to be `true`.
256
- * When bound to a signal form field via `[formField]`, this is written by the signal forms `FormField` directive.
257
- * @default false
258
- */
259
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
260
- /**
261
- * @description The name of the radios, for a native `<form>`. Generated when empty, so two groups don't interfere.
262
- * When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
263
- * @default ""
264
- */
265
- this.name = input("", /* @ts-ignore */
266
- ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
267
- /**
268
- * @description The list of selectable options. Exactly one option is selected at a time.
269
- */
270
- this.options = input.required(/* @ts-ignore */
271
- ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
272
- /**
273
- * @description Prevents value changes while the control stays focusable and readable. When bound to a signal form
274
- * field via `[formField]`, this is written by the `FormField` directive.
275
- * @default false
276
- */
277
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
278
- /**
279
- * @description Marks the group as required, as `aria-required`. When bound to a signal form field via `[formField]`,
280
- * this is written by the `FormField` directive.
281
- * @default false
282
- */
283
- this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
284
- /**
285
- * @description Border-radius preset applied to the segmented container and its options.
286
- * @default "medium"
287
- */
288
- this.rounded = input("medium", /* @ts-ignore */
289
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
290
- /**
291
- * @description Size preset controlling the height, horizontal padding, text size, and spacing of each option.
292
- * @default "medium"
293
- */
294
- this.size = input("medium", /* @ts-ignore */
295
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
296
- /**
297
- * @description Emitted when the selected value changes or focus leaves the group.
298
- */
299
- this.touch = output();
300
- /**
301
- * @description Marks the component as touched. When bound to a signal form field via `[formField]`,
302
- * this is written by the signal forms `FormField` directive.
303
- * @default false
304
- */
305
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
306
- /**
307
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
308
- * @default ""
309
- */
310
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
311
- /**
312
- * @description The currently selected value. When it matches no current option, no option is checked.
313
- * A `null` value is allowed initially but cannot be restored through segmented interaction.
314
- * @default null
315
- */
316
- this.value = model(null, /* @ts-ignore */
317
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
318
- afterNextRender(() => {
319
- if (isDevMode() && !this.#label.labelledBy() && !this.ariaLabel()) {
320
- console.warn("[Mona Segmented] A segmented control needs an accessible name. Set aria-label, aria-labelledby " +
321
- "or use a mona-label.", this.#hostElementRef.nativeElement);
322
- }
323
- });
324
- // A browser checks a clicked radio on its own, and `[checked]` writes only when its binding changes, so a value
325
- // put back in the meantime would leave the rejected radio checked.
326
- afterRenderEffect({
327
- write: () => {
328
- const value = this.value();
329
- const options = this.options();
330
- this.radioInputs().forEach(({ nativeElement }, index) => {
331
- nativeElement.checked = options[index]?.value === value;
332
- });
333
- }
334
- });
335
- afterRenderEffect({
336
- read: () => {
337
- this.selectedIndex();
338
- // The options swap sides, with no change of size for the observer to report.
339
- this.#direction();
340
- const optionElements = this.optionElements();
341
- this.alignment();
342
- this.rounded();
343
- this.animate();
344
- const size = this.size();
345
- const options = this.options();
346
- const isSizeChange = this.#lastSize !== null && this.#lastSize !== size;
347
- const isOptionsChange = this.#lastOptions !== null && this.#lastOptions !== options;
348
- const suppressTransition = isSizeChange || isOptionsChange;
349
- this.#lastSize = size;
350
- this.#lastOptions = options;
351
- this.observeOptionElements(optionElements);
352
- this.updateIndicatorGeometry({ suppressTransition });
353
- }
354
- });
355
- afterNextRender({
356
- read: () => {
357
- this.setupResizeObserver();
358
- }
359
- });
360
- this.#destroyRef.onDestroy(() => {
361
- this.#resizeObserver?.disconnect();
362
- });
363
- }
364
- /**
365
- * @description Moves focus to the selected option, or the first enabled one.
366
- * @param options Options passed to the native `focus()` call, such as `preventScroll`.
367
- */
368
- focus(options) {
369
- const host = this.#hostElementRef.nativeElement;
370
- const target = host.querySelector("input:checked:not(:disabled)") ??
371
- host.querySelector("input:not(:disabled)");
372
- target?.focus(options);
373
- }
374
- /**
375
- * @internal
376
- */
377
- setLabelledBy(id) {
378
- this.#label.setLabelledBy(id);
379
- }
380
- onFocusOut(event) {
381
- const nextTarget = event.relatedTarget;
382
- if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) {
383
- return;
384
- }
385
- this.touch.emit();
386
- }
387
- onOptionChange(option) {
388
- if (this.effectiveDisabled() || this.readonly() || option.disabled) {
389
- return;
390
- }
391
- this.value.set(option.value);
392
- this.touch.emit();
393
- }
394
- onOptionClick(event) {
395
- // Canceling the click makes the browser restore the previously checked option.
396
- if (this.readonly()) {
397
- event.preventDefault();
398
- }
399
- }
400
- observeOptionElements(optionElements) {
401
- if (!this.#resizeObserver) {
402
- return;
403
- }
404
- const elements = optionElements.map(optionElement => optionElement.nativeElement);
405
- for (const element of this.#observedOptionElements) {
406
- if (!elements.includes(element)) {
407
- this.#resizeObserver.unobserve(element);
408
- }
409
- }
410
- for (const element of elements) {
411
- if (!this.#observedOptionElements.includes(element)) {
412
- this.#resizeObserver.observe(element);
413
- }
414
- }
415
- this.#observedOptionElements = elements;
416
- }
417
- setupResizeObserver() {
418
- if (typeof ResizeObserver === "undefined") {
419
- return;
420
- }
421
- this.#resizeObserver = new ResizeObserver(() => {
422
- this.updateIndicatorGeometry({ suppressTransition: true });
423
- });
424
- this.#resizeObserver.observe(this.#hostElementRef.nativeElement);
425
- this.observeOptionElements(this.optionElements());
426
- }
427
- updateIndicatorGeometry(options) {
428
- const selectedIndex = this.selectedIndex();
429
- if (selectedIndex === -1) {
430
- this.#lastAnimatedIndex = null;
431
- this.indicatorGeometry.set(null);
432
- this.indicatorTransitionEnabled.set(false);
433
- return;
434
- }
435
- const optionElements = this.optionElements();
436
- const selectedElementRef = optionElements[selectedIndex];
437
- if (!selectedElementRef?.nativeElement) {
438
- this.#lastAnimatedIndex = null;
439
- this.indicatorGeometry.set(null);
440
- this.indicatorTransitionEnabled.set(false);
441
- return;
442
- }
443
- const option = selectedElementRef.nativeElement;
444
- // `offsetLeft`/`offsetTop`/`offsetWidth`/`offsetHeight` are pure layout values, relative to
445
- // the nearest positioned ancestor (the host, which is `position: relative` and the option's
446
- // direct parent). Unlike `getBoundingClientRect()`, they are unaffected by any CSS transform
447
- // an ancestor applies — e.g. the scale animation `mona-popup` plays while opening. Measuring
448
- // with `getBoundingClientRect()` there could capture a mid-transition (e.g. 95%-scaled)
449
- // snapshot that never gets corrected once the animation settles, undersizing/misplacing the
450
- // indicator relative to the option's real, final box.
451
- const x = option.offsetLeft;
452
- const y = option.offsetTop;
453
- const width = option.offsetWidth;
454
- const height = option.offsetHeight;
455
- const shouldAnimate = !options?.suppressTransition &&
456
- this.animate() &&
457
- this.indicatorInitialized() &&
458
- this.#lastAnimatedIndex !== null &&
459
- this.#lastAnimatedIndex !== selectedIndex;
460
- this.indicatorTransitionEnabled.set(shouldAnimate);
461
- this.indicatorGeometry.set({
462
- height,
463
- transform: `translate3d(${x}px, ${y}px, 0)`,
464
- width
465
- });
466
- this.#lastAnimatedIndex = selectedIndex;
467
- if (!this.indicatorInitialized()) {
468
- this.indicatorInitialized.set(true);
469
- }
470
- }
471
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SegmentedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
472
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SegmentedComponent, isStandalone: true, selector: "mona-segmented", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "attr.aria-disabled": "effectiveDisabled() || undefined", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "labelledBy()", "attr.aria-readonly": "readonly() || null", "attr.aria-required": "required() || null", "attr.data-disabled": "effectiveDisabled()", "attr.data-readonly": "readonly() || null", "attr.data-invalid": "invalidState() || null", "attr.role": "'radiogroup'", "class": "containerClasses()" } }, queries: [{ propertyName: "itemTemplate", first: true, predicate: SegmentedItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "optionElements", predicate: ["optionElement"], descendants: true, isSignal: true }, { propertyName: "radioInputs", predicate: ["radioInput"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span\n class=\"pointer-events-none flex flex-1 items-center justify-center gap-1\n [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
473
- }
474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SegmentedComponent, decorators: [{
475
- type: Component,
476
- args: [{ selector: "mona-segmented", imports: [NgTemplateOutlet], host: {
477
- "[attr.aria-disabled]": "effectiveDisabled() || undefined",
478
- "[attr.aria-invalid]": "invalidState() ? 'true' : null",
479
- "[attr.aria-label]": "ariaLabel()",
480
- "[attr.aria-labelledby]": "labelledBy()",
481
- "[attr.aria-readonly]": "readonly() || null",
482
- "[attr.aria-required]": "required() || null",
483
- "[attr.data-disabled]": "effectiveDisabled()",
484
- "[attr.data-readonly]": "readonly() || null",
485
- "(focusout)": "onFocusOut($event)",
486
- "[attr.data-invalid]": "invalidState() || null",
487
- "[attr.role]": "'radiogroup'",
488
- "[class]": "containerClasses()"
489
- }, template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span\n class=\"pointer-events-none flex flex-1 items-center justify-center gap-1\n [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n\n" }]
490
- }], ctorParameters: () => [], propDecorators: { itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SegmentedItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], optionElements: [{ type: i0.ViewChildren, args: ["optionElement", { isSignal: true }] }], radioInputs: [{ type: i0.ViewChildren, args: ["radioInput", { isSignal: true }] }], alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], animate: [{ type: i0.Input, args: [{ isSignal: true, alias: "animate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
491
-
492
- /*
493
- * Public API Surface of @nanahoshi/mona-ui/segmented
494
- */
495
-
496
- /**
497
- * Generated bundle index. Do not edit.
498
- */
499
-
171
+ var SegmentedComponent = class SegmentedComponent {
172
+ #destroyRef;
173
+ #direction;
174
+ #hostElementRef;
175
+ #label;
176
+ #lastAnimatedIndex;
177
+ #lastOptions;
178
+ #lastSize;
179
+ #observedOptionElements;
180
+ #resizeObserver;
181
+ constructor() {
182
+ this.#destroyRef = inject(DestroyRef);
183
+ this.#direction = injectComponentDirection();
184
+ this.#hostElementRef = inject(ElementRef);
185
+ this.#label = injectLabelAssociation({
186
+ activate: () => this.focus(),
187
+ ariaLabel: () => this.ariaLabel(),
188
+ ariaLabelledBy: () => this.ariaLabelledBy()
189
+ });
190
+ this.#lastAnimatedIndex = null;
191
+ this.#lastOptions = null;
192
+ this.#lastSize = null;
193
+ this.#observedOptionElements = [];
194
+ this.#resizeObserver = null;
195
+ this.containerClasses = computed(() => {
196
+ const classes = segmentedContainerThemeVariants({
197
+ alignment: this.alignment(),
198
+ rounded: this.rounded()
199
+ });
200
+ return twMerge(classes, this.userClass());
201
+ }, ...ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []);
202
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
203
+ this.geometryReady = computed(() => !!this.indicatorGeometry(), ...ngDevMode ? [{ debugName: "geometryReady" }] : /* istanbul ignore next */ []);
204
+ this.groupName = createElementControlId();
205
+ this.indicatorClasses = computed(() => {
206
+ const animate = this.animate() && this.indicatorTransitionEnabled();
207
+ const rounded = this.rounded();
208
+ return segmentedIndicatorThemeVariants({
209
+ animate,
210
+ rounded
211
+ });
212
+ }, ...ngDevMode ? [{ debugName: "indicatorClasses" }] : /* istanbul ignore next */ []);
213
+ this.indicatorGeometry = signal(null, ...ngDevMode ? [{ debugName: "indicatorGeometry" }] : /* istanbul ignore next */ []);
214
+ this.indicatorInitialized = signal(false, ...ngDevMode ? [{ debugName: "indicatorInitialized" }] : /* istanbul ignore next */ []);
215
+ this.indicatorTransitionEnabled = signal(false, ...ngDevMode ? [{ debugName: "indicatorTransitionEnabled" }] : /* istanbul ignore next */ []);
216
+ this.inputClasses = computed(() => segmentedInputThemeVariants(), ...ngDevMode ? [{ debugName: "inputClasses" }] : /* istanbul ignore next */ []);
217
+ this.invalidState = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
218
+ this.itemTemplate = contentChild(SegmentedItemTemplateDirective, {
219
+ ...ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {},
220
+ read: TemplateRef
221
+ });
222
+ this.labelledBy = this.#label.labelledBy;
223
+ this.optionClasses = computed(() => {
224
+ const alignment = this.alignment();
225
+ const rounded = this.rounded();
226
+ const size = this.size();
227
+ return segmentedOptionThemeVariants({
228
+ alignment,
229
+ rounded,
230
+ size
231
+ });
232
+ }, ...ngDevMode ? [{ debugName: "optionClasses" }] : /* istanbul ignore next */ []);
233
+ this.optionContexts = computed(() => {
234
+ const disabled = this.effectiveDisabled();
235
+ const value = this.value();
236
+ return this.options().map((option, index) => ({
237
+ $implicit: option,
238
+ disabled: disabled || !!option.disabled,
239
+ index,
240
+ option,
241
+ selected: option.value === value
242
+ }));
243
+ }, ...ngDevMode ? [{ debugName: "optionContexts" }] : /* istanbul ignore next */ []);
244
+ this.optionElements = viewChildren("optionElement", ...ngDevMode ? [{ debugName: "optionElements" }] : /* istanbul ignore next */ []);
245
+ this.radioInputs = viewChildren("radioInput", ...ngDevMode ? [{ debugName: "radioInputs" }] : /* istanbul ignore next */ []);
246
+ this.selectedIndex = computed(() => {
247
+ const value = this.value();
248
+ return this.options().findIndex((option) => option.value === value);
249
+ }, ...ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []);
250
+ this.selectedOptionDisabled = computed(() => {
251
+ const selectedIndex = this.selectedIndex();
252
+ if (selectedIndex === -1) return false;
253
+ const option = this.options()[selectedIndex];
254
+ return this.effectiveDisabled() || !!option?.disabled;
255
+ }, ...ngDevMode ? [{ debugName: "selectedOptionDisabled" }] : /* istanbul ignore next */ []);
256
+ this.alignment = input("stretch", ...ngDevMode ? [{ debugName: "alignment" }] : /* istanbul ignore next */ []);
257
+ this.animate = input(true, {
258
+ ...ngDevMode ? { debugName: "animate" } : /* istanbul ignore next */ {},
259
+ transform: booleanAttribute
260
+ });
261
+ this.ariaLabel = input(null, {
262
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
263
+ alias: "aria-label"
264
+ });
265
+ this.ariaLabelledBy = input(null, {
266
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
267
+ alias: "aria-labelledby"
268
+ });
269
+ this.disabled = input(false, {
270
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
271
+ transform: booleanAttribute
272
+ });
273
+ this.invalid = input(false, {
274
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
275
+ transform: booleanAttribute
276
+ });
277
+ this.name = input("", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
278
+ this.options = input.required(...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
279
+ this.readonly = input(false, {
280
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
281
+ transform: booleanAttribute
282
+ });
283
+ this.required = input(false, {
284
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
285
+ transform: booleanAttribute
286
+ });
287
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
288
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
289
+ this.touch = output();
290
+ this.touched = input(false, {
291
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
292
+ transform: booleanAttribute
293
+ });
294
+ this.userClass = input("", {
295
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
296
+ alias: "class"
297
+ });
298
+ this.value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
299
+ afterNextRender(() => {
300
+ if (isDevMode() && !this.#label.labelledBy() && !this.ariaLabel()) console.warn("[Mona Segmented] A segmented control needs an accessible name. Set aria-label, aria-labelledby or use a mona-label.", this.#hostElementRef.nativeElement);
301
+ });
302
+ afterRenderEffect({ write: () => {
303
+ const value = this.value();
304
+ const options = this.options();
305
+ this.radioInputs().forEach(({ nativeElement }, index) => {
306
+ nativeElement.checked = options[index]?.value === value;
307
+ });
308
+ } });
309
+ afterRenderEffect({ read: () => {
310
+ this.selectedIndex();
311
+ this.#direction();
312
+ const optionElements = this.optionElements();
313
+ this.alignment();
314
+ this.rounded();
315
+ this.animate();
316
+ const size = this.size();
317
+ const options = this.options();
318
+ const isSizeChange = this.#lastSize !== null && this.#lastSize !== size;
319
+ const isOptionsChange = this.#lastOptions !== null && this.#lastOptions !== options;
320
+ const suppressTransition = isSizeChange || isOptionsChange;
321
+ this.#lastSize = size;
322
+ this.#lastOptions = options;
323
+ this.observeOptionElements(optionElements);
324
+ this.updateIndicatorGeometry({ suppressTransition });
325
+ } });
326
+ afterNextRender({ read: () => {
327
+ this.setupResizeObserver();
328
+ } });
329
+ this.#destroyRef.onDestroy(() => {
330
+ this.#resizeObserver?.disconnect();
331
+ });
332
+ }
333
+ focus(options) {
334
+ const host = this.#hostElementRef.nativeElement;
335
+ (host.querySelector("input:checked:not(:disabled)") ?? host.querySelector("input:not(:disabled)"))?.focus(options);
336
+ }
337
+ setLabelledBy(id) {
338
+ this.#label.setLabelledBy(id);
339
+ }
340
+ onFocusOut(event) {
341
+ const nextTarget = event.relatedTarget;
342
+ if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) return;
343
+ this.touch.emit();
344
+ }
345
+ onOptionChange(option) {
346
+ if (this.effectiveDisabled() || this.readonly() || option.disabled) return;
347
+ this.value.set(option.value);
348
+ this.touch.emit();
349
+ }
350
+ onOptionClick(event) {
351
+ if (this.readonly()) event.preventDefault();
352
+ }
353
+ observeOptionElements(optionElements) {
354
+ if (!this.#resizeObserver) return;
355
+ const elements = optionElements.map((optionElement) => optionElement.nativeElement);
356
+ for (const element of this.#observedOptionElements) if (!elements.includes(element)) this.#resizeObserver.unobserve(element);
357
+ for (const element of elements) if (!this.#observedOptionElements.includes(element)) this.#resizeObserver.observe(element);
358
+ this.#observedOptionElements = elements;
359
+ }
360
+ setupResizeObserver() {
361
+ if (typeof ResizeObserver === "undefined") return;
362
+ this.#resizeObserver = new ResizeObserver(() => {
363
+ this.updateIndicatorGeometry({ suppressTransition: true });
364
+ });
365
+ this.#resizeObserver.observe(this.#hostElementRef.nativeElement);
366
+ this.observeOptionElements(this.optionElements());
367
+ }
368
+ updateIndicatorGeometry(options) {
369
+ const selectedIndex = this.selectedIndex();
370
+ if (selectedIndex === -1) {
371
+ this.#lastAnimatedIndex = null;
372
+ this.indicatorGeometry.set(null);
373
+ this.indicatorTransitionEnabled.set(false);
374
+ return;
375
+ }
376
+ const selectedElementRef = this.optionElements()[selectedIndex];
377
+ if (!selectedElementRef?.nativeElement) {
378
+ this.#lastAnimatedIndex = null;
379
+ this.indicatorGeometry.set(null);
380
+ this.indicatorTransitionEnabled.set(false);
381
+ return;
382
+ }
383
+ const option = selectedElementRef.nativeElement;
384
+ const x = option.offsetLeft;
385
+ const y = option.offsetTop;
386
+ const width = option.offsetWidth;
387
+ const height = option.offsetHeight;
388
+ const shouldAnimate = !options?.suppressTransition && this.animate() && this.indicatorInitialized() && this.#lastAnimatedIndex !== null && this.#lastAnimatedIndex !== selectedIndex;
389
+ this.indicatorTransitionEnabled.set(shouldAnimate);
390
+ this.indicatorGeometry.set({
391
+ height,
392
+ transform: `translate3d(${x}px, ${y}px, 0)`,
393
+ width
394
+ });
395
+ this.#lastAnimatedIndex = selectedIndex;
396
+ if (!this.indicatorInitialized()) this.indicatorInitialized.set(true);
397
+ }
398
+ static {
399
+ this.ɵfac = i0.ɵɵngDeclareFactory({
400
+ minVersion: "12.0.0",
401
+ version: "22.2.6",
402
+ ngImport: i0,
403
+ type: SegmentedComponent,
404
+ deps: [],
405
+ target: i0.ɵɵFactoryTarget.Component
406
+ });
407
+ }
408
+ static {
409
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
410
+ minVersion: "17.0.0",
411
+ version: "22.2.6",
412
+ type: SegmentedComponent,
413
+ isStandalone: true,
414
+ selector: "mona-segmented",
415
+ inputs: {
416
+ alignment: {
417
+ classPropertyName: "alignment",
418
+ publicName: "alignment",
419
+ isSignal: true,
420
+ isRequired: false,
421
+ transformFunction: null
422
+ },
423
+ animate: {
424
+ classPropertyName: "animate",
425
+ publicName: "animate",
426
+ isSignal: true,
427
+ isRequired: false,
428
+ transformFunction: null
429
+ },
430
+ ariaLabel: {
431
+ classPropertyName: "ariaLabel",
432
+ publicName: "aria-label",
433
+ isSignal: true,
434
+ isRequired: false,
435
+ transformFunction: null
436
+ },
437
+ ariaLabelledBy: {
438
+ classPropertyName: "ariaLabelledBy",
439
+ publicName: "aria-labelledby",
440
+ isSignal: true,
441
+ isRequired: false,
442
+ transformFunction: null
443
+ },
444
+ disabled: {
445
+ classPropertyName: "disabled",
446
+ publicName: "disabled",
447
+ isSignal: true,
448
+ isRequired: false,
449
+ transformFunction: null
450
+ },
451
+ invalid: {
452
+ classPropertyName: "invalid",
453
+ publicName: "invalid",
454
+ isSignal: true,
455
+ isRequired: false,
456
+ transformFunction: null
457
+ },
458
+ name: {
459
+ classPropertyName: "name",
460
+ publicName: "name",
461
+ isSignal: true,
462
+ isRequired: false,
463
+ transformFunction: null
464
+ },
465
+ options: {
466
+ classPropertyName: "options",
467
+ publicName: "options",
468
+ isSignal: true,
469
+ isRequired: true,
470
+ transformFunction: null
471
+ },
472
+ readonly: {
473
+ classPropertyName: "readonly",
474
+ publicName: "readonly",
475
+ isSignal: true,
476
+ isRequired: false,
477
+ transformFunction: null
478
+ },
479
+ required: {
480
+ classPropertyName: "required",
481
+ publicName: "required",
482
+ isSignal: true,
483
+ isRequired: false,
484
+ transformFunction: null
485
+ },
486
+ rounded: {
487
+ classPropertyName: "rounded",
488
+ publicName: "rounded",
489
+ isSignal: true,
490
+ isRequired: false,
491
+ transformFunction: null
492
+ },
493
+ size: {
494
+ classPropertyName: "size",
495
+ publicName: "size",
496
+ isSignal: true,
497
+ isRequired: false,
498
+ transformFunction: null
499
+ },
500
+ touched: {
501
+ classPropertyName: "touched",
502
+ publicName: "touched",
503
+ isSignal: true,
504
+ isRequired: false,
505
+ transformFunction: null
506
+ },
507
+ userClass: {
508
+ classPropertyName: "userClass",
509
+ publicName: "class",
510
+ isSignal: true,
511
+ isRequired: false,
512
+ transformFunction: null
513
+ },
514
+ value: {
515
+ classPropertyName: "value",
516
+ publicName: "value",
517
+ isSignal: true,
518
+ isRequired: false,
519
+ transformFunction: null
520
+ }
521
+ },
522
+ outputs: {
523
+ touch: "touch",
524
+ value: "valueChange"
525
+ },
526
+ host: {
527
+ listeners: { "focusout": "onFocusOut($event)" },
528
+ properties: {
529
+ "attr.aria-disabled": "effectiveDisabled() || undefined",
530
+ "attr.aria-invalid": "invalidState() ? 'true' : null",
531
+ "attr.aria-label": "ariaLabel()",
532
+ "attr.aria-labelledby": "labelledBy()",
533
+ "attr.aria-readonly": "readonly() || null",
534
+ "attr.aria-required": "required() || null",
535
+ "attr.data-disabled": "effectiveDisabled()",
536
+ "attr.data-readonly": "readonly() || null",
537
+ "attr.data-invalid": "invalidState() || null",
538
+ "attr.role": "'radiogroup'",
539
+ "class": "containerClasses()"
540
+ }
541
+ },
542
+ queries: [{
543
+ propertyName: "itemTemplate",
544
+ first: true,
545
+ predicate: SegmentedItemTemplateDirective,
546
+ descendants: true,
547
+ read: TemplateRef,
548
+ isSignal: true
549
+ }],
550
+ viewQueries: [{
551
+ propertyName: "optionElements",
552
+ predicate: ["optionElement"],
553
+ descendants: true,
554
+ isSignal: true
555
+ }, {
556
+ propertyName: "radioInputs",
557
+ predicate: ["radioInput"],
558
+ descendants: true,
559
+ isSignal: true
560
+ }],
561
+ ngImport: i0,
562
+ template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span\n class=\"pointer-events-none flex flex-1 items-center justify-center gap-1\n [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n\n",
563
+ dependencies: [{
564
+ kind: "directive",
565
+ type: NgTemplateOutlet,
566
+ selector: "[ngTemplateOutlet]",
567
+ inputs: [
568
+ "ngTemplateOutletContext",
569
+ "ngTemplateOutlet",
570
+ "ngTemplateOutletInjector"
571
+ ]
572
+ }]
573
+ });
574
+ }
575
+ };
576
+ i0.ɵɵngDeclareClassMetadata({
577
+ minVersion: "12.0.0",
578
+ version: "22.2.6",
579
+ ngImport: i0,
580
+ type: SegmentedComponent,
581
+ decorators: [{
582
+ type: Component,
583
+ args: [{
584
+ selector: "mona-segmented",
585
+ imports: [NgTemplateOutlet],
586
+ host: {
587
+ "[attr.aria-disabled]": "effectiveDisabled() || undefined",
588
+ "[attr.aria-invalid]": "invalidState() ? 'true' : null",
589
+ "[attr.aria-label]": "ariaLabel()",
590
+ "[attr.aria-labelledby]": "labelledBy()",
591
+ "[attr.aria-readonly]": "readonly() || null",
592
+ "[attr.aria-required]": "required() || null",
593
+ "[attr.data-disabled]": "effectiveDisabled()",
594
+ "[attr.data-readonly]": "readonly() || null",
595
+ "(focusout)": "onFocusOut($event)",
596
+ "[attr.data-invalid]": "invalidState() || null",
597
+ "[attr.role]": "'radiogroup'",
598
+ "[class]": "containerClasses()"
599
+ },
600
+ template: "@if (indicatorGeometry(); as geometry) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClasses()\"\n [attr.data-disabled]=\"selectedOptionDisabled() ? 'true' : null\"\n [style.transform]=\"geometry.transform\"\n [style.width.px]=\"geometry.width\"\n [style.height.px]=\"geometry.height\"></div>\n}\n\n@for (option of options(); track option.value) {\n @let selected = option.value === value();\n @let optionDisabled = effectiveDisabled() || option.disabled;\n\n <label\n #optionElement\n [class]=\"optionClasses()\"\n [attr.data-selected]=\"selected\"\n [attr.data-indicator]=\"geometryReady() || null\"\n [attr.data-disabled]=\"optionDisabled\">\n <input\n #radioInput\n type=\"radio\"\n [name]=\"name() || groupName\"\n [value]=\"option.value\"\n [checked]=\"selected\"\n [disabled]=\"optionDisabled\"\n [class]=\"inputClasses()\"\n [attr.aria-label]=\"itemTemplate() ? option.label : null\"\n (change)=\"onOptionChange(option)\"\n (click)=\"onOptionClick($event)\" />\n\n <span\n class=\"pointer-events-none flex flex-1 items-center justify-center gap-1\n [border-radius:inherit]\">\n @if (itemTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContexts()[$index]\"></ng-container>\n } @else {\n {{ option.label }}\n }\n </span>\n </label>\n}\n\n"
601
+ }]
602
+ }],
603
+ ctorParameters: () => [],
604
+ propDecorators: {
605
+ itemTemplate: [{
606
+ type: i0.ContentChild,
607
+ args: [i0.forwardRef(() => SegmentedItemTemplateDirective), {
608
+ read: TemplateRef,
609
+ isSignal: true
610
+ }]
611
+ }],
612
+ optionElements: [{
613
+ type: i0.ViewChildren,
614
+ args: ["optionElement", { isSignal: true }]
615
+ }],
616
+ radioInputs: [{
617
+ type: i0.ViewChildren,
618
+ args: ["radioInput", { isSignal: true }]
619
+ }],
620
+ alignment: [{
621
+ type: i0.Input,
622
+ args: [{
623
+ isSignal: true,
624
+ alias: "alignment",
625
+ required: false
626
+ }]
627
+ }],
628
+ animate: [{
629
+ type: i0.Input,
630
+ args: [{
631
+ isSignal: true,
632
+ alias: "animate",
633
+ required: false
634
+ }]
635
+ }],
636
+ ariaLabel: [{
637
+ type: i0.Input,
638
+ args: [{
639
+ isSignal: true,
640
+ alias: "aria-label",
641
+ required: false
642
+ }]
643
+ }],
644
+ ariaLabelledBy: [{
645
+ type: i0.Input,
646
+ args: [{
647
+ isSignal: true,
648
+ alias: "aria-labelledby",
649
+ required: false
650
+ }]
651
+ }],
652
+ disabled: [{
653
+ type: i0.Input,
654
+ args: [{
655
+ isSignal: true,
656
+ alias: "disabled",
657
+ required: false
658
+ }]
659
+ }],
660
+ invalid: [{
661
+ type: i0.Input,
662
+ args: [{
663
+ isSignal: true,
664
+ alias: "invalid",
665
+ required: false
666
+ }]
667
+ }],
668
+ name: [{
669
+ type: i0.Input,
670
+ args: [{
671
+ isSignal: true,
672
+ alias: "name",
673
+ required: false
674
+ }]
675
+ }],
676
+ options: [{
677
+ type: i0.Input,
678
+ args: [{
679
+ isSignal: true,
680
+ alias: "options",
681
+ required: true
682
+ }]
683
+ }],
684
+ readonly: [{
685
+ type: i0.Input,
686
+ args: [{
687
+ isSignal: true,
688
+ alias: "readonly",
689
+ required: false
690
+ }]
691
+ }],
692
+ required: [{
693
+ type: i0.Input,
694
+ args: [{
695
+ isSignal: true,
696
+ alias: "required",
697
+ required: false
698
+ }]
699
+ }],
700
+ rounded: [{
701
+ type: i0.Input,
702
+ args: [{
703
+ isSignal: true,
704
+ alias: "rounded",
705
+ required: false
706
+ }]
707
+ }],
708
+ size: [{
709
+ type: i0.Input,
710
+ args: [{
711
+ isSignal: true,
712
+ alias: "size",
713
+ required: false
714
+ }]
715
+ }],
716
+ touch: [{
717
+ type: i0.Output,
718
+ args: ["touch"]
719
+ }],
720
+ touched: [{
721
+ type: i0.Input,
722
+ args: [{
723
+ isSignal: true,
724
+ alias: "touched",
725
+ required: false
726
+ }]
727
+ }],
728
+ userClass: [{
729
+ type: i0.Input,
730
+ args: [{
731
+ isSignal: true,
732
+ alias: "class",
733
+ required: false
734
+ }]
735
+ }],
736
+ value: [{
737
+ type: i0.Input,
738
+ args: [{
739
+ isSignal: true,
740
+ alias: "value",
741
+ required: false
742
+ }]
743
+ }, {
744
+ type: i0.Output,
745
+ args: ["valueChange"]
746
+ }]
747
+ }
748
+ });
500
749
  export { SegmentedComponent, SegmentedItemTemplateDirective };
501
- //# sourceMappingURL=nanahoshi-mona-ui-segmented.mjs.map
750
+
751
+ //# sourceMappingURL=nanahoshi-mona-ui-segmented.mjs.map