@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,19 +1,13 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, ElementRef, computed, contentChildren, input, booleanAttribute, output, model, effect, untracked, afterNextRender, Component } from '@angular/core';
3
- import { outputFromObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { ButtonService, ButtonDirective, BUTTON_GROUP_MEMBER } from '@nanahoshi/mona-ui/button';
5
- import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
6
- import { injectLabelAssociation, injectEffectiveDisabled } from '@nanahoshi/mona-ui/internal';
7
- import { filter, map } from 'rxjs';
8
- import { twMerge } from 'tailwind-merge';
9
- import { cva } from 'class-variance-authority';
10
-
11
- // Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
12
- // Edit the JSON file and run `npm run generate:locale-catalogs`.
13
- const BUTTON_GROUP_DEFAULT_MESSAGES = {
14
- buttonGroup: "Button group"
15
- };
16
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, DestroyRef, ElementRef, afterNextRender, booleanAttribute, computed, contentChildren, effect, inject, input, model, output, untracked } from "@angular/core";
3
+ import { outputFromObservable, takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import { BUTTON_GROUP_MEMBER, ButtonDirective, ButtonService } from "@nanahoshi/mona-ui/button";
5
+ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
6
+ import { injectEffectiveDisabled, injectLabelAssociation } from "@nanahoshi/mona-ui/internal";
7
+ import { filter, map } from "rxjs";
8
+ import { twMerge } from "tailwind-merge";
9
+ import { cva } from "class-variance-authority";
10
+ const BUTTON_GROUP_DEFAULT_MESSAGES = { buttonGroup: "Button group" };
17
11
  const buttonGroupThemeVariants = cva(`
18
12
  inline-flex items-center justify-center
19
13
  border border-input-border
@@ -33,374 +27,534 @@ const buttonGroupThemeVariants = cva(`
33
27
  [&>*>button:not(:last-of-type)]:border-e
34
28
  [&>*>button:not(:last-of-type)]:border-border-subtle
35
29
  `, {
36
- variants: {
37
- look: {
38
- default: "",
39
- error: "border-transparent",
40
- ghost: "border-transparent [&>*:not(:last-child)]:border-e-0 [&>*>button:not(:last-of-type)]:border-e-0",
41
- info: "border-transparent",
42
- outline: "",
43
- primary: "border-transparent",
44
- secondary: "border-transparent",
45
- success: "border-transparent",
46
- warning: "border-transparent"
47
- },
48
- rounded: {
49
- full: `
30
+ variants: {
31
+ look: {
32
+ default: "",
33
+ error: "border-transparent",
34
+ ghost: "border-transparent [&>*:not(:last-child)]:border-e-0 [&>*>button:not(:last-of-type)]:border-e-0",
35
+ info: "border-transparent",
36
+ outline: "",
37
+ primary: "border-transparent",
38
+ secondary: "border-transparent",
39
+ success: "border-transparent",
40
+ warning: "border-transparent"
41
+ },
42
+ rounded: {
43
+ full: `
50
44
  rounded-full
51
45
  [&>button]:first:rounded-ss-full [&>button]:first:rounded-es-full
52
46
  [&>button]:last:rounded-se-full [&>button]:last:rounded-ee-full
53
47
  [&>*:first-child>button:first-of-type]:rounded-ss-full! [&>*:first-child>button:first-of-type]:rounded-es-full!
54
48
  [&>*:last-child>button:last-of-type]:rounded-se-full! [&>*:last-child>button:last-of-type]:rounded-ee-full!
55
49
  `,
56
- large: `
50
+ large: `
57
51
  rounded-lg
58
52
  [&>button]:first:rounded-ss-lg [&>button]:first:rounded-es-lg
59
53
  [&>button]:last:rounded-se-lg [&>button]:last:rounded-ee-lg
60
54
  [&>*:first-child>button:first-of-type]:rounded-ss-lg! [&>*:first-child>button:first-of-type]:rounded-es-lg!
61
55
  [&>*:last-child>button:last-of-type]:rounded-se-lg! [&>*:last-child>button:last-of-type]:rounded-ee-lg!
62
56
  `,
63
- medium: `
57
+ medium: `
64
58
  rounded-md
65
59
  [&>button]:first:rounded-ss-md [&>button]:first:rounded-es-md
66
60
  [&>button]:last:rounded-se-md [&>button]:last:rounded-ee-md
67
61
  [&>*:first-child>button:first-of-type]:rounded-ss-md! [&>*:first-child>button:first-of-type]:rounded-es-md!
68
62
  [&>*:last-child>button:last-of-type]:rounded-se-md! [&>*:last-child>button:last-of-type]:rounded-ee-md!
69
63
  `,
70
- none: `
64
+ none: `
71
65
  rounded-none
72
66
  `,
73
- small: `
67
+ small: `
74
68
  rounded-sm
75
69
  [&>button]:first:rounded-ss-sm [&>button]:first:rounded-es-sm
76
70
  [&>button]:last:rounded-se-sm [&>button]:last:rounded-ee-sm
77
71
  [&>*:first-child>button:first-of-type]:rounded-ss-sm! [&>*:first-child>button:first-of-type]:rounded-es-sm!
78
72
  [&>*:last-child>button:last-of-type]:rounded-se-sm! [&>*:last-child>button:last-of-type]:rounded-ee-sm!
79
73
  `
80
- },
81
- size: {
82
- large: ``,
83
- medium: "",
84
- small: ``
85
- }
86
- },
87
- defaultVariants: {
88
- look: "default",
89
- size: "medium"
90
- }
74
+ },
75
+ size: {
76
+ large: ``,
77
+ medium: "",
78
+ small: ``
79
+ }
80
+ },
81
+ defaultVariants: {
82
+ look: "default",
83
+ size: "medium"
84
+ }
85
+ });
86
+ var ButtonGroupComponent = class ButtonGroupComponent {
87
+ #buttonService;
88
+ #destroyRef;
89
+ #hostElementRef;
90
+ #i18n;
91
+ #label;
92
+ #lastSelected;
93
+ constructor() {
94
+ this.#buttonService = inject(ButtonService, { self: true });
95
+ this.#destroyRef = inject(DestroyRef);
96
+ this.#hostElementRef = inject(ElementRef);
97
+ this.#i18n = inject(MonaI18nService);
98
+ this.#label = injectLabelAssociation({
99
+ activate: () => this.focus(),
100
+ ariaLabel: () => this.ariaLabel(),
101
+ ariaLabelledBy: () => this.ariaLabelledBy()
102
+ });
103
+ this.#lastSelected = [];
104
+ this.baseClass = computed(() => {
105
+ const look = this.look();
106
+ const rounded = this.rounded();
107
+ const size = this.size();
108
+ const variantClasses = buttonGroupThemeVariants({
109
+ look,
110
+ rounded,
111
+ size
112
+ });
113
+ const userClass = this.userClass();
114
+ return twMerge(variantClasses, userClass);
115
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
116
+ this.buttons = contentChildren(ButtonDirective, ...ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []);
117
+ this.components = contentChildren(BUTTON_GROUP_MEMBER, ...ngDevMode ? [{ debugName: "components" }] : /* istanbul ignore next */ []);
118
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
119
+ this.invalidState = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
120
+ this.labelledBy = this.#label.labelledBy;
121
+ this.members = computed(() => [...this.buttons(), ...this.components().flatMap((component) => component.groupButtons())], ...ngDevMode ? [{ debugName: "members" }] : /* istanbul ignore next */ []);
122
+ this.messages = this.#i18n.componentMessages("buttonGroup", BUTTON_GROUP_DEFAULT_MESSAGES);
123
+ this.allowEmpty = input(true, {
124
+ ...ngDevMode ? { debugName: "allowEmpty" } : /* istanbul ignore next */ {},
125
+ transform: booleanAttribute
126
+ });
127
+ this.ariaLabel = input(void 0, {
128
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
129
+ alias: "aria-label"
130
+ });
131
+ this.ariaLabelledBy = input("", {
132
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
133
+ alias: "aria-labelledby"
134
+ });
135
+ this.buttonClick = outputFromObservable(this.#buttonService.memberClick$.pipe(filter(([button]) => this.buttons().includes(button) && !(this.readonly() && button.effectiveToggleable())), map(([button, element]) => ({
136
+ button: element,
137
+ selected: button.selected(),
138
+ value: button.value()
139
+ })), takeUntilDestroyed(this.#destroyRef)));
140
+ this.disabled = input(false, {
141
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
142
+ transform: booleanAttribute
143
+ });
144
+ this.invalid = input(false, {
145
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
146
+ transform: booleanAttribute
147
+ });
148
+ this.look = input("outline", ...ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []);
149
+ this.readonly = input(false, {
150
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
151
+ transform: booleanAttribute
152
+ });
153
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
154
+ this.selection = input("multiple", ...ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []);
155
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
156
+ this.touch = output();
157
+ this.touched = input(false, {
158
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
159
+ transform: booleanAttribute
160
+ });
161
+ this.userClass = input("", {
162
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
163
+ alias: "class"
164
+ });
165
+ this.value = model(void 0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
166
+ this.#buttonService.setMembers(this.members);
167
+ effect(() => {
168
+ const disabled = this.effectiveDisabled();
169
+ untracked(() => this.#buttonService.groupDisabled.set(disabled));
170
+ });
171
+ effect(() => {
172
+ const readonly = this.readonly();
173
+ untracked(() => this.#buttonService.groupReadonly.set(readonly));
174
+ });
175
+ effect(() => {
176
+ const look = this.look();
177
+ untracked(() => this.#buttonService.groupLook.set(look));
178
+ });
179
+ effect(() => {
180
+ const rounded = this.rounded();
181
+ untracked(() => this.#buttonService.groupRounded.set(rounded));
182
+ });
183
+ effect(() => {
184
+ const size = this.size();
185
+ untracked(() => this.#buttonService.groupSize.set(size));
186
+ });
187
+ effect(() => {
188
+ const value = this.value();
189
+ if (value === void 0) return;
190
+ const values = this.valuesOf(value);
191
+ for (const button of this.valueButtons()) {
192
+ const selected = values.includes(button.value());
193
+ untracked(() => button.selected.set(selected));
194
+ }
195
+ });
196
+ effect(() => {
197
+ const buttons = this.buttons();
198
+ const selected = buttons.filter((button) => button.selected());
199
+ const single = this.selection() === "single";
200
+ const allowEmpty = this.allowEmpty();
201
+ untracked(() => this.enforceSelectionPolicy(buttons, selected, single, allowEmpty));
202
+ });
203
+ afterNextRender({ read: () => this.setSubscriptions() });
204
+ }
205
+ focus(options) {
206
+ const host = this.#hostElementRef.nativeElement;
207
+ (host.querySelector("button[aria-pressed='true']:not(:disabled)") ?? host.querySelector("button:not(:disabled)"))?.focus(options);
208
+ }
209
+ setLabelledBy(id) {
210
+ this.#label.setLabelledBy(id);
211
+ }
212
+ onFocusOut(event) {
213
+ const nextTarget = event.relatedTarget;
214
+ if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) return;
215
+ this.touch.emit();
216
+ }
217
+ commitValue() {
218
+ const buttons = this.valueButtons();
219
+ if (buttons.length === 0) return;
220
+ const selected = buttons.filter((button) => button.selected()).map((button) => button.value());
221
+ if (this.selection() === "single") {
222
+ this.value.set(selected[0] ?? null);
223
+ return;
224
+ }
225
+ const known = buttons.map((button) => button.value());
226
+ const waiting = this.valuesOf(this.value()).filter((value) => !known.includes(value));
227
+ this.value.set([...waiting, ...selected]);
228
+ }
229
+ enforceSelectionPolicy(buttons, selected, single, allowEmpty) {
230
+ if (single && selected.length > 1) {
231
+ const fresh = selected.filter((button) => !this.#lastSelected.includes(button));
232
+ const keep = fresh.length < selected.length ? fresh[fresh.length - 1] ?? selected[0] : selected[0];
233
+ selected.filter((button) => button !== keep).forEach((button) => button.selected.set(false));
234
+ this.#lastSelected = [keep];
235
+ this.commitValue();
236
+ return;
237
+ }
238
+ if (single && !allowEmpty && selected.length === 0 && this.value() === void 0) {
239
+ const previous = this.#lastSelected.find((button) => buttons.includes(button));
240
+ previous?.selected.set(true);
241
+ if (previous) return;
242
+ }
243
+ this.#lastSelected = selected;
244
+ }
245
+ setSubscriptions() {
246
+ this.#buttonService.buttonClick$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(([button, wasSelected]) => {
247
+ if (this.readonly()) return;
248
+ if (this.selection() === "single") {
249
+ if (wasSelected && !this.allowEmpty()) return;
250
+ this.buttons().forEach((b) => {
251
+ if (b.selected()) this.#buttonService.buttonSelect$.next([b, false]);
252
+ });
253
+ if (!wasSelected) this.#buttonService.buttonSelect$.next([button, true]);
254
+ } else this.#buttonService.buttonSelect$.next([button, !wasSelected]);
255
+ this.commitValue();
256
+ this.touch.emit();
257
+ });
258
+ }
259
+ valueButtons() {
260
+ return this.buttons().filter((button) => button.effectiveToggleable() && button.value() !== void 0);
261
+ }
262
+ valuesOf(value) {
263
+ if (value == null) return [];
264
+ return Array.isArray(value) ? value : [value];
265
+ }
266
+ static {
267
+ this.ɵfac = i0.ɵɵngDeclareFactory({
268
+ minVersion: "12.0.0",
269
+ version: "22.2.6",
270
+ ngImport: i0,
271
+ type: ButtonGroupComponent,
272
+ deps: [],
273
+ target: i0.ɵɵFactoryTarget.Component
274
+ });
275
+ }
276
+ static {
277
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
278
+ minVersion: "17.2.0",
279
+ version: "22.2.6",
280
+ type: ButtonGroupComponent,
281
+ isStandalone: true,
282
+ selector: "mona-button-group",
283
+ inputs: {
284
+ allowEmpty: {
285
+ classPropertyName: "allowEmpty",
286
+ publicName: "allowEmpty",
287
+ isSignal: true,
288
+ isRequired: false,
289
+ transformFunction: null
290
+ },
291
+ ariaLabel: {
292
+ classPropertyName: "ariaLabel",
293
+ publicName: "aria-label",
294
+ isSignal: true,
295
+ isRequired: false,
296
+ transformFunction: null
297
+ },
298
+ ariaLabelledBy: {
299
+ classPropertyName: "ariaLabelledBy",
300
+ publicName: "aria-labelledby",
301
+ isSignal: true,
302
+ isRequired: false,
303
+ transformFunction: null
304
+ },
305
+ disabled: {
306
+ classPropertyName: "disabled",
307
+ publicName: "disabled",
308
+ isSignal: true,
309
+ isRequired: false,
310
+ transformFunction: null
311
+ },
312
+ invalid: {
313
+ classPropertyName: "invalid",
314
+ publicName: "invalid",
315
+ isSignal: true,
316
+ isRequired: false,
317
+ transformFunction: null
318
+ },
319
+ look: {
320
+ classPropertyName: "look",
321
+ publicName: "look",
322
+ isSignal: true,
323
+ isRequired: false,
324
+ transformFunction: null
325
+ },
326
+ readonly: {
327
+ classPropertyName: "readonly",
328
+ publicName: "readonly",
329
+ isSignal: true,
330
+ isRequired: false,
331
+ transformFunction: null
332
+ },
333
+ rounded: {
334
+ classPropertyName: "rounded",
335
+ publicName: "rounded",
336
+ isSignal: true,
337
+ isRequired: false,
338
+ transformFunction: null
339
+ },
340
+ selection: {
341
+ classPropertyName: "selection",
342
+ publicName: "selection",
343
+ isSignal: true,
344
+ isRequired: false,
345
+ transformFunction: null
346
+ },
347
+ size: {
348
+ classPropertyName: "size",
349
+ publicName: "size",
350
+ isSignal: true,
351
+ isRequired: false,
352
+ transformFunction: null
353
+ },
354
+ touched: {
355
+ classPropertyName: "touched",
356
+ publicName: "touched",
357
+ isSignal: true,
358
+ isRequired: false,
359
+ transformFunction: null
360
+ },
361
+ userClass: {
362
+ classPropertyName: "userClass",
363
+ publicName: "class",
364
+ isSignal: true,
365
+ isRequired: false,
366
+ transformFunction: null
367
+ },
368
+ value: {
369
+ classPropertyName: "value",
370
+ publicName: "value",
371
+ isSignal: true,
372
+ isRequired: false,
373
+ transformFunction: null
374
+ }
375
+ },
376
+ outputs: {
377
+ buttonClick: "buttonClick",
378
+ touch: "touch",
379
+ value: "valueChange"
380
+ },
381
+ host: {
382
+ attributes: { "role": "group" },
383
+ listeners: { "focusout": "onFocusOut($event)" },
384
+ properties: {
385
+ "attr.aria-invalid": "invalidState() ? 'true' : null",
386
+ "attr.aria-label": "labelledBy() ? null : ariaLabel() || messages().buttonGroup",
387
+ "attr.aria-labelledby": "labelledBy()",
388
+ "attr.data-invalid": "invalidState() || null",
389
+ "attr.data-readonly": "readonly() || null",
390
+ "class": "baseClass()"
391
+ }
392
+ },
393
+ providers: [ButtonService],
394
+ queries: [{
395
+ propertyName: "buttons",
396
+ predicate: ButtonDirective,
397
+ isSignal: true
398
+ }, {
399
+ propertyName: "components",
400
+ predicate: BUTTON_GROUP_MEMBER,
401
+ isSignal: true
402
+ }],
403
+ ngImport: i0,
404
+ template: "<ng-content select=\"[monaButton], mona-dropdown-button, mona-split-button\"></ng-content>\n"
405
+ });
406
+ }
407
+ };
408
+ i0.ɵɵngDeclareClassMetadata({
409
+ minVersion: "12.0.0",
410
+ version: "22.2.6",
411
+ ngImport: i0,
412
+ type: ButtonGroupComponent,
413
+ decorators: [{
414
+ type: Component,
415
+ args: [{
416
+ selector: "mona-button-group",
417
+ providers: [ButtonService],
418
+ host: {
419
+ "[attr.aria-invalid]": "invalidState() ? 'true' : null",
420
+ "[attr.aria-label]": "labelledBy() ? null : ariaLabel() || messages().buttonGroup",
421
+ "[attr.aria-labelledby]": "labelledBy()",
422
+ "[attr.data-invalid]": "invalidState() || null",
423
+ "[attr.data-readonly]": "readonly() || null",
424
+ "(focusout)": "onFocusOut($event)",
425
+ "[class]": "baseClass()",
426
+ role: "group"
427
+ },
428
+ template: "<ng-content select=\"[monaButton], mona-dropdown-button, mona-split-button\"></ng-content>\n"
429
+ }]
430
+ }],
431
+ ctorParameters: () => [],
432
+ propDecorators: {
433
+ buttons: [{
434
+ type: i0.ContentChildren,
435
+ args: [i0.forwardRef(() => ButtonDirective), { isSignal: true }]
436
+ }],
437
+ components: [{
438
+ type: i0.ContentChildren,
439
+ args: [i0.forwardRef(() => BUTTON_GROUP_MEMBER), { isSignal: true }]
440
+ }],
441
+ allowEmpty: [{
442
+ type: i0.Input,
443
+ args: [{
444
+ isSignal: true,
445
+ alias: "allowEmpty",
446
+ required: false
447
+ }]
448
+ }],
449
+ ariaLabel: [{
450
+ type: i0.Input,
451
+ args: [{
452
+ isSignal: true,
453
+ alias: "aria-label",
454
+ required: false
455
+ }]
456
+ }],
457
+ ariaLabelledBy: [{
458
+ type: i0.Input,
459
+ args: [{
460
+ isSignal: true,
461
+ alias: "aria-labelledby",
462
+ required: false
463
+ }]
464
+ }],
465
+ buttonClick: [{
466
+ type: i0.Output,
467
+ args: ["buttonClick"]
468
+ }],
469
+ disabled: [{
470
+ type: i0.Input,
471
+ args: [{
472
+ isSignal: true,
473
+ alias: "disabled",
474
+ required: false
475
+ }]
476
+ }],
477
+ invalid: [{
478
+ type: i0.Input,
479
+ args: [{
480
+ isSignal: true,
481
+ alias: "invalid",
482
+ required: false
483
+ }]
484
+ }],
485
+ look: [{
486
+ type: i0.Input,
487
+ args: [{
488
+ isSignal: true,
489
+ alias: "look",
490
+ required: false
491
+ }]
492
+ }],
493
+ readonly: [{
494
+ type: i0.Input,
495
+ args: [{
496
+ isSignal: true,
497
+ alias: "readonly",
498
+ required: false
499
+ }]
500
+ }],
501
+ rounded: [{
502
+ type: i0.Input,
503
+ args: [{
504
+ isSignal: true,
505
+ alias: "rounded",
506
+ required: false
507
+ }]
508
+ }],
509
+ selection: [{
510
+ type: i0.Input,
511
+ args: [{
512
+ isSignal: true,
513
+ alias: "selection",
514
+ required: false
515
+ }]
516
+ }],
517
+ size: [{
518
+ type: i0.Input,
519
+ args: [{
520
+ isSignal: true,
521
+ alias: "size",
522
+ required: false
523
+ }]
524
+ }],
525
+ touch: [{
526
+ type: i0.Output,
527
+ args: ["touch"]
528
+ }],
529
+ touched: [{
530
+ type: i0.Input,
531
+ args: [{
532
+ isSignal: true,
533
+ alias: "touched",
534
+ required: false
535
+ }]
536
+ }],
537
+ userClass: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "class",
542
+ required: false
543
+ }]
544
+ }],
545
+ value: [{
546
+ type: i0.Input,
547
+ args: [{
548
+ isSignal: true,
549
+ alias: "value",
550
+ required: false
551
+ }]
552
+ }, {
553
+ type: i0.Output,
554
+ args: ["valueChange"]
555
+ }]
556
+ }
91
557
  });
92
-
93
- class ButtonGroupComponent {
94
- #buttonService;
95
- #destroyRef;
96
- #hostElementRef;
97
- #i18n;
98
- #label;
99
- /** The buttons seen selected last time, to tell which one is new and which one to bring back. */
100
- #lastSelected;
101
- constructor() {
102
- this.#buttonService = inject(ButtonService, { self: true });
103
- this.#destroyRef = inject(DestroyRef);
104
- this.#hostElementRef = inject(ElementRef);
105
- this.#i18n = inject(MonaI18nService);
106
- this.#label = injectLabelAssociation({
107
- activate: () => this.focus(),
108
- ariaLabel: () => this.ariaLabel(),
109
- ariaLabelledBy: () => this.ariaLabelledBy()
110
- });
111
- /** The buttons seen selected last time, to tell which one is new and which one to bring back. */
112
- this.#lastSelected = [];
113
- this.baseClass = computed(() => {
114
- const look = this.look();
115
- const rounded = this.rounded();
116
- const size = this.size();
117
- const variantClasses = buttonGroupThemeVariants({ look, rounded, size });
118
- const userClass = this.userClass();
119
- return twMerge(variantClasses, userClass);
120
- }, /* @ts-ignore */
121
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
122
- /**
123
- * The group's own buttons: they follow its look, size, rounding and disabled state, and its selection.
124
- */
125
- this.buttons = contentChildren(ButtonDirective, /* @ts-ignore */
126
- ...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
127
- /**
128
- * Dropdown and split buttons placed in the group. Their buttons follow the group's look, size, rounding and
129
- * disabled state, but not its selection.
130
- */
131
- this.components = contentChildren(BUTTON_GROUP_MEMBER, /* @ts-ignore */
132
- ...(ngDevMode ? [{ debugName: "components" }] : /* istanbul ignore next */ []));
133
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
134
- this.invalidState = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
136
- this.labelledBy = this.#label.labelledBy;
137
- this.members = computed(() => [
138
- ...this.buttons(),
139
- ...this.components().flatMap(component => component.groupButtons())
140
- ], /* @ts-ignore */
141
- ...(ngDevMode ? [{ debugName: "members" }] : /* istanbul ignore next */ []));
142
- this.messages = this.#i18n.componentMessages("buttonGroup", BUTTON_GROUP_DEFAULT_MESSAGES);
143
- /**
144
- * @description When `false` and `selection` is `"single"`, a selected button stays selected until another one takes
145
- * over: the active button can't be deselected, and clearing every `selected` brings it back. It doesn't choose a
146
- * first button, and a `value` of `null` still clears the group, so a form can reset it. Has no effect in `"multiple"`
147
- * mode.
148
- * @default true
149
- */
150
- this.allowEmpty = input(true, { ...(ngDevMode ? { debugName: "allowEmpty" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
151
- /**
152
- * @description Accessible name for the host element. Override when multiple button groups appear on the same page
153
- * so screen reader users can distinguish them.
154
- */
155
- this.ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
156
- /**
157
- * @description Id of the element that names the group.
158
- * @default ""
159
- */
160
- this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
161
- /**
162
- * @description Emitted when a button placed directly in the group is clicked, toggleable or not, after the group has
163
- * applied its selection. Not emitted for a dropdown or split button's own buttons, for a disabled button, or for a
164
- * toggle button while the group is read-only, since nothing was selected.
165
- */
166
- this.buttonClick = outputFromObservable(this.#buttonService.memberClick$.pipe(filter(([button]) => this.buttons().includes(button) && !(this.readonly() && button.effectiveToggleable())), map(([button, element]) => ({
167
- button: element,
168
- selected: button.selected(),
169
- value: button.value()
170
- })), takeUntilDestroyed(this.#destroyRef)));
171
- /**
172
- * @description Renders all child buttons with reduced visual emphasis and removes pointer interaction. When bound to
173
- * a signal form field via `[formField]`, this is written by the `FormField` directive.
174
- * @default false
175
- */
176
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
177
- /**
178
- * @description Marks the group as invalid. Error styling requires both `invalid` and `touched` to be `true`. When
179
- * bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
180
- * @default false
181
- */
182
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
183
- /**
184
- * @description Visual style variant propagated to all child buttons.
185
- * Also controls container-level divider and border behavior.
186
- * @default "outline"
187
- */
188
- this.look = input("outline", /* @ts-ignore */
189
- ...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
190
- /**
191
- * @description Prevents selection changes while the buttons stay focusable. Buttons that aren't toggleable keep
192
- * working. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
193
- * @default false
194
- */
195
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
196
- /**
197
- * @description Border-radius preset applied to the container and the outer corners of the first and last child button.
198
- * @default "medium"
199
- */
200
- this.rounded = input("medium", /* @ts-ignore */
201
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
202
- /**
203
- * @description Whether one button can be selected at a time (`"single"`) or each toggles on its own (`"multiple"`).
204
- * The buttons stay toggle buttons with `aria-pressed` in both. For a choice that must always hold one value, use
205
- * `mona-segmented`, which is a radio group.
206
- * @default "multiple"
207
- */
208
- this.selection = input("multiple", /* @ts-ignore */
209
- ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
210
- /**
211
- * @description Size preset propagated to all child buttons, overriding their individual `size` inputs.
212
- * @default "medium"
213
- */
214
- this.size = input("medium", /* @ts-ignore */
215
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
216
- /**
217
- * @description Emitted when a user changes the selection or focus leaves the group.
218
- * The `FormField` directive listens to this to mark the field as touched.
219
- */
220
- this.touch = output();
221
- /**
222
- * @description Marks the group as touched. When bound to a signal form field via `[formField]`, this is written by
223
- * the `FormField` directive.
224
- * @default false
225
- */
226
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
227
- /**
228
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
229
- * @default ""
230
- */
231
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
232
- /**
233
- * @description The value of the selected button in `"single"` mode, or `null`, and an array of the selected buttons'
234
- * values in `"multiple"` mode. Buttons take part by having a `value`. While `undefined`, it leaves each button's
235
- * `selected` alone. A value with no button yet stays, so one that loads before its button isn't lost. Use either this
236
- * or `[(selected)]` on the buttons, not both.
237
- * @default undefined
238
- */
239
- this.value = model(undefined, /* @ts-ignore */
240
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
241
- this.#buttonService.setMembers(this.members);
242
- effect(() => {
243
- const disabled = this.effectiveDisabled();
244
- untracked(() => this.#buttonService.groupDisabled.set(disabled));
245
- });
246
- effect(() => {
247
- const readonly = this.readonly();
248
- untracked(() => this.#buttonService.groupReadonly.set(readonly));
249
- });
250
- effect(() => {
251
- const look = this.look();
252
- untracked(() => this.#buttonService.groupLook.set(look));
253
- });
254
- effect(() => {
255
- const rounded = this.rounded();
256
- untracked(() => this.#buttonService.groupRounded.set(rounded));
257
- });
258
- effect(() => {
259
- const size = this.size();
260
- untracked(() => this.#buttonService.groupSize.set(size));
261
- });
262
- effect(() => {
263
- const value = this.value();
264
- if (value === undefined) {
265
- return;
266
- }
267
- const values = this.valuesOf(value);
268
- for (const button of this.valueButtons()) {
269
- const selected = values.includes(button.value());
270
- untracked(() => button.selected.set(selected));
271
- }
272
- });
273
- effect(() => {
274
- const buttons = this.buttons();
275
- const selected = buttons.filter(button => button.selected());
276
- const single = this.selection() === "single";
277
- const allowEmpty = this.allowEmpty();
278
- untracked(() => this.enforceSelectionPolicy(buttons, selected, single, allowEmpty));
279
- });
280
- afterNextRender({
281
- read: () => this.setSubscriptions()
282
- });
283
- }
284
- /**
285
- * @description Moves focus to the selected button, or the first enabled one.
286
- * @param options Options passed to the native `focus()` call, such as `preventScroll`.
287
- */
288
- focus(options) {
289
- const host = this.#hostElementRef.nativeElement;
290
- const target = host.querySelector("button[aria-pressed='true']:not(:disabled)") ??
291
- host.querySelector("button:not(:disabled)");
292
- target?.focus(options);
293
- }
294
- /**
295
- * @internal
296
- */
297
- setLabelledBy(id) {
298
- this.#label.setLabelledBy(id);
299
- }
300
- onFocusOut(event) {
301
- const nextTarget = event.relatedTarget;
302
- if (nextTarget instanceof Node && this.#hostElementRef.nativeElement.contains(nextTarget)) {
303
- return;
304
- }
305
- this.touch.emit();
306
- }
307
- commitValue() {
308
- const buttons = this.valueButtons();
309
- if (buttons.length === 0) {
310
- return;
311
- }
312
- const selected = buttons.filter(button => button.selected()).map(button => button.value());
313
- if (this.selection() === "single") {
314
- this.value.set(selected[0] ?? null);
315
- return;
316
- }
317
- const known = buttons.map(button => button.value());
318
- const waiting = this.valuesOf(this.value()).filter(value => !known.includes(value));
319
- this.value.set([...waiting, ...selected]);
320
- }
321
- /**
322
- * Holds the group to `selection` and `allowEmpty` however a button's `selected` changed, since a binding can change
323
- * it as well as a click. A form's `value` of `null` is left alone, so the form can reset the group.
324
- */
325
- enforceSelectionPolicy(buttons, selected, single, allowEmpty) {
326
- if (single && selected.length > 1) {
327
- // Both new, as on the first render, keeps the first. A new one next to an old one keeps the new one.
328
- const fresh = selected.filter(button => !this.#lastSelected.includes(button));
329
- const keep = fresh.length < selected.length ? (fresh[fresh.length - 1] ?? selected[0]) : selected[0];
330
- selected.filter(button => button !== keep).forEach(button => button.selected.set(false));
331
- this.#lastSelected = [keep];
332
- this.commitValue();
333
- return;
334
- }
335
- if (single && !allowEmpty && selected.length === 0 && this.value() === undefined) {
336
- const previous = this.#lastSelected.find(button => buttons.includes(button));
337
- previous?.selected.set(true);
338
- if (previous) {
339
- return;
340
- }
341
- }
342
- this.#lastSelected = selected;
343
- }
344
- setSubscriptions() {
345
- this.#buttonService.buttonClick$
346
- .pipe(takeUntilDestroyed(this.#destroyRef))
347
- .subscribe(([button, wasSelected]) => {
348
- if (this.readonly()) {
349
- return;
350
- }
351
- if (this.selection() === "single") {
352
- if (wasSelected && !this.allowEmpty()) {
353
- return;
354
- }
355
- this.buttons().forEach(b => {
356
- if (b.selected()) {
357
- this.#buttonService.buttonSelect$.next([b, false]);
358
- }
359
- });
360
- if (!wasSelected) {
361
- this.#buttonService.buttonSelect$.next([button, true]);
362
- }
363
- }
364
- else {
365
- this.#buttonService.buttonSelect$.next([button, !wasSelected]);
366
- }
367
- this.commitValue();
368
- this.touch.emit();
369
- });
370
- }
371
- valueButtons() {
372
- return this.buttons().filter(button => button.effectiveToggleable() && button.value() !== undefined);
373
- }
374
- valuesOf(value) {
375
- if (value == null) {
376
- return [];
377
- }
378
- return Array.isArray(value) ? value : [value];
379
- }
380
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
381
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: ButtonGroupComponent, isStandalone: true, selector: "mona-button-group", inputs: { allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", 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 }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", 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: { buttonClick: "buttonClick", touch: "touch", value: "valueChange" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onFocusOut($event)" }, properties: { "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.aria-label": "labelledBy() ? null : ariaLabel() || messages().buttonGroup", "attr.aria-labelledby": "labelledBy()", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "class": "baseClass()" } }, providers: [ButtonService], queries: [{ propertyName: "buttons", predicate: ButtonDirective, isSignal: true }, { propertyName: "components", predicate: BUTTON_GROUP_MEMBER, isSignal: true }], ngImport: i0, template: "<ng-content select=\"[monaButton], mona-dropdown-button, mona-split-button\"></ng-content>\n" }); }
382
- }
383
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonGroupComponent, decorators: [{
384
- type: Component,
385
- args: [{ selector: "mona-button-group", providers: [ButtonService], host: {
386
- "[attr.aria-invalid]": "invalidState() ? 'true' : null",
387
- "[attr.aria-label]": "labelledBy() ? null : ariaLabel() || messages().buttonGroup",
388
- "[attr.aria-labelledby]": "labelledBy()",
389
- "[attr.data-invalid]": "invalidState() || null",
390
- "[attr.data-readonly]": "readonly() || null",
391
- "(focusout)": "onFocusOut($event)",
392
- "[class]": "baseClass()",
393
- role: "group"
394
- }, template: "<ng-content select=\"[monaButton], mona-dropdown-button, mona-split-button\"></ng-content>\n" }]
395
- }], ctorParameters: () => [], propDecorators: { buttons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ButtonDirective), { isSignal: true }] }], components: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BUTTON_GROUP_MEMBER), { isSignal: true }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", 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 }] }], buttonClick: [{ type: i0.Output, args: ["buttonClick"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", 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"] }] } });
396
-
397
- /*
398
- * Public API Surface of @nanahoshi/mona-ui/button-group
399
- */
400
-
401
- /**
402
- * Generated bundle index. Do not edit.
403
- */
404
-
405
558
  export { BUTTON_GROUP_DEFAULT_MESSAGES, ButtonGroupComponent };
406
- //# sourceMappingURL=nanahoshi-mona-ui-button-group.mjs.map
559
+
560
+ //# sourceMappingURL=nanahoshi-mona-ui-button-group.mjs.map