@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,70 +1,54 @@
1
- import * as i0 from '@angular/core';
2
- import { signal, computed, Injectable, inject, ApplicationRef, DestroyRef, ElementRef, Injector, Renderer2, input, booleanAttribute, model, numberAttribute, effect, untracked, afterNextRender, isDevMode, createComponent, afterRenderEffect, Directive, InjectionToken } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
5
- import { Subject, fromEvent, takeWhile } from 'rxjs';
6
- import { twMerge } from 'tailwind-merge';
7
- import { cva } from 'class-variance-authority';
8
- import { themeSelectionBorderClasses, themeControlSurfaceClasses } from '@nanahoshi/mona-ui/internal';
9
-
10
- /**
11
- * Coordinates a `mona-button-group` with its buttons: the group publishes its look, size, rounding, disabled state
12
- * and members here, and buttons report clicks and receive selection changes through it. It is public so the
13
- * button-group entry point can provide it; applications don't need to use it directly.
14
- *
15
- * @hidden
16
- */
17
- class ButtonService {
18
- constructor() {
19
- this.#members = signal(null, /* @ts-ignore */
20
- ...(ngDevMode ? [{ debugName: "#members" }] : /* istanbul ignore next */ []));
21
- /**
22
- * A click on a toggleable member, with the member and whether it was selected before the click. The group
23
- * answers it by applying its selection rules through {@link buttonSelect$}.
24
- */
25
- this.buttonClick$ = new Subject();
26
- /** A selection change the group applies to a member: the member and whether it is now selected. */
27
- this.buttonSelect$ = new Subject();
28
- /** Whether the group is disabled. Members are disabled while it is `true`, whatever their own `disabled` input. */
29
- this.groupDisabled = signal(false, /* @ts-ignore */
30
- ...(ngDevMode ? [{ debugName: "groupDisabled" }] : /* istanbul ignore next */ []));
31
- /** The group's `look`, which members use in place of their own while it is set. */
32
- this.groupLook = signal(undefined, /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "groupLook" }] : /* istanbul ignore next */ []));
34
- /** Whether the group is read-only. Toggleable members then report `aria-disabled` and keep their selection. */
35
- this.groupReadonly = signal(false, /* @ts-ignore */
36
- ...(ngDevMode ? [{ debugName: "groupReadonly" }] : /* istanbul ignore next */ []));
37
- /** The group's `rounded`, which members use in place of their own while it is set. */
38
- this.groupRounded = signal(undefined, /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "groupRounded" }] : /* istanbul ignore next */ []));
40
- /** The group's `size`, which members use in place of their own while it is set. */
41
- this.groupSize = signal(undefined, /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "groupSize" }] : /* istanbul ignore next */ []));
43
- /**
44
- * Every click on a member, toggleable or not, reported after the group has applied its selection.
45
- */
46
- this.memberClick$ = new Subject();
47
- /**
48
- * The buttons that belong to the group. Only these follow the group's look, size, rounding, disabled state and
49
- * selection; other buttons that can inject this service ignore it.
50
- */
51
- this.members = computed(() => this.#members()?.() ?? [], /* @ts-ignore */
52
- ...(ngDevMode ? [{ debugName: "members" }] : /* istanbul ignore next */ []));
53
- }
54
- #members;
55
- /**
56
- * Sets the source of the group's members, such as the group's `contentChildren(ButtonDirective)` query.
57
- */
58
- setMembers(members) {
59
- this.#members.set(members);
60
- }
61
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
62
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonService }); }
63
- }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonService, decorators: [{
65
- type: Injectable
66
- }] });
67
-
1
+ import * as i0 from "@angular/core";
2
+ import { ApplicationRef, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, Renderer2, afterNextRender, afterRenderEffect, booleanAttribute, computed, createComponent, effect, inject, input, isDevMode, model, numberAttribute, signal, untracked } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import { IndicatorIconComponent } from "@nanahoshi/mona-ui/internal/indicator-icon";
5
+ import { Subject, fromEvent, takeWhile } from "rxjs";
6
+ import { twMerge } from "tailwind-merge";
7
+ import { cva } from "class-variance-authority";
8
+ import { themeControlSurfaceClasses, themeSelectionBorderClasses } from "@nanahoshi/mona-ui/internal";
9
+ var ButtonService = class ButtonService {
10
+ constructor() {
11
+ this.#members = signal(null, ...ngDevMode ? [{ debugName: "#members" }] : /* istanbul ignore next */ []);
12
+ this.buttonClick$ = new Subject();
13
+ this.buttonSelect$ = new Subject();
14
+ this.groupDisabled = signal(false, ...ngDevMode ? [{ debugName: "groupDisabled" }] : /* istanbul ignore next */ []);
15
+ this.groupLook = signal(void 0, ...ngDevMode ? [{ debugName: "groupLook" }] : /* istanbul ignore next */ []);
16
+ this.groupReadonly = signal(false, ...ngDevMode ? [{ debugName: "groupReadonly" }] : /* istanbul ignore next */ []);
17
+ this.groupRounded = signal(void 0, ...ngDevMode ? [{ debugName: "groupRounded" }] : /* istanbul ignore next */ []);
18
+ this.groupSize = signal(void 0, ...ngDevMode ? [{ debugName: "groupSize" }] : /* istanbul ignore next */ []);
19
+ this.memberClick$ = new Subject();
20
+ this.members = computed(() => this.#members()?.() ?? [], ...ngDevMode ? [{ debugName: "members" }] : /* istanbul ignore next */ []);
21
+ }
22
+ #members;
23
+ setMembers(members) {
24
+ this.#members.set(members);
25
+ }
26
+ static {
27
+ this.ɵfac = i0.ɵɵngDeclareFactory({
28
+ minVersion: "12.0.0",
29
+ version: "22.2.6",
30
+ ngImport: i0,
31
+ type: ButtonService,
32
+ deps: [],
33
+ target: i0.ɵɵFactoryTarget.Injectable
34
+ });
35
+ }
36
+ static {
37
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
38
+ minVersion: "12.0.0",
39
+ version: "22.2.6",
40
+ ngImport: i0,
41
+ type: ButtonService
42
+ });
43
+ }
44
+ };
45
+ i0.ɵɵngDeclareClassMetadata({
46
+ minVersion: "12.0.0",
47
+ version: "22.2.6",
48
+ ngImport: i0,
49
+ type: ButtonService,
50
+ decorators: [{ type: Injectable }]
51
+ });
68
52
  const buttonThemeVariants = cva(`
69
53
  inline-flex items-center justify-center gap-2
70
54
  cursor-pointer whitespace-nowrap
@@ -73,550 +57,671 @@ const buttonThemeVariants = cva(`
73
57
  focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-indicator
74
58
  forced-colors:border forced-colors:border-[ButtonBorder]
75
59
  `, {
76
- variants: {
77
- disabled: {
78
- true: `
60
+ variants: {
61
+ disabled: {
62
+ true: `
79
63
  pointer-events-none select-none
80
64
  disabled:border-disabled-border disabled:bg-disabled-background disabled:text-disabled-foreground
81
65
  disabled:shadow-none
82
66
  `,
83
- false: ""
84
- },
85
- iconOnly: {
86
- true: "aspect-square",
87
- false: "aspect-auto"
88
- },
89
- loading: {
90
- true: "pointer-events-none",
91
- false: ""
92
- },
93
- look: {
94
- default: `
67
+ false: ""
68
+ },
69
+ iconOnly: {
70
+ true: "aspect-square",
71
+ false: "aspect-auto"
72
+ },
73
+ loading: {
74
+ true: "pointer-events-none",
75
+ false: ""
76
+ },
77
+ look: {
78
+ default: `
95
79
  ${themeControlSurfaceClasses} text-foreground
96
80
  border border-input-border
97
81
  hover:bg-hover active:bg-active
98
82
  focus-visible:border-focus-indicator
99
83
  `,
100
- primary: `
84
+ primary: `
101
85
  bg-primary text-primary-foreground
102
86
  hover:bg-primary-hover active:bg-primary-active
103
87
  `,
104
- success: `
88
+ success: `
105
89
  bg-success text-success-foreground
106
90
  hover:bg-success-hover
107
91
  active:bg-success-active
108
92
  `,
109
- error: `
93
+ error: `
110
94
  bg-error text-error-foreground
111
95
  hover:bg-error-hover
112
96
  active:bg-error-active
113
97
  `,
114
- warning: `
98
+ warning: `
115
99
  bg-warning text-warning-foreground
116
100
  hover:bg-warning-hover
117
101
  active:bg-warning-active
118
102
  `,
119
- info: `
103
+ info: `
120
104
  bg-info text-info-foreground
121
105
  hover:bg-info-hover
122
106
  active:bg-info-active
123
107
  `,
124
- outline: `
108
+ outline: `
125
109
  ${themeControlSurfaceClasses} text-foreground
126
110
  border border-input-border
127
111
  hover:bg-hover active:bg-active
128
112
  focus-visible:border-focus-indicator
129
113
  `,
130
- secondary: `
114
+ secondary: `
131
115
  bg-secondary text-secondary-foreground
132
116
  hover:bg-secondary-hover
133
117
  active:bg-secondary-active
134
118
  `,
135
- ghost: `
119
+ ghost: `
136
120
  bg-transparent text-foreground
137
121
  shadow-none
138
122
  hover:bg-hover active:bg-active
139
123
  `,
140
- link: `
124
+ link: `
141
125
  bg-transparent text-foreground
142
126
  shadow-none
143
127
  underline-offset-4 hover:underline
144
128
  `,
145
- clear: `
129
+ clear: `
146
130
  bg-transparent
147
131
  border-0 shadow-none
148
132
  hover:bg-transparent active:bg-transparent
149
133
  `
150
- },
151
- rounded: {
152
- full: "rounded-full",
153
- large: "rounded-lg",
154
- medium: "rounded-md",
155
- none: "rounded-none",
156
- small: "rounded-sm"
157
- },
158
- size: {
159
- large: "h-10 px-6",
160
- medium: "h-9 px-4",
161
- small: "h-8 px-3 text-xs"
162
- },
163
- selected: {
164
- true: themeSelectionBorderClasses
165
- }
166
- },
167
- compoundVariants: [
168
- {
169
- look: "default",
170
- selected: true,
171
- class: `
134
+ },
135
+ rounded: {
136
+ full: "rounded-full",
137
+ large: "rounded-lg",
138
+ medium: "rounded-md",
139
+ none: "rounded-none",
140
+ small: "rounded-sm"
141
+ },
142
+ size: {
143
+ large: "h-10 px-6",
144
+ medium: "h-9 px-4",
145
+ small: "h-8 px-3 text-xs"
146
+ },
147
+ selected: { true: themeSelectionBorderClasses }
148
+ },
149
+ compoundVariants: [
150
+ {
151
+ look: "default",
152
+ selected: true,
153
+ class: `
172
154
  after:-inset-px
173
155
  bg-(--color-selected) text-(--color-selected-foreground)
174
156
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
175
157
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
176
158
  `
177
- },
178
- {
179
- look: "primary",
180
- selected: true,
181
- class: `
159
+ },
160
+ {
161
+ look: "primary",
162
+ selected: true,
163
+ class: `
182
164
  bg-primary-selected text-primary-foreground
183
165
  hover:bg-primary-selected hover:text-primary-foreground
184
166
  active:bg-primary-active active:text-primary-foreground
185
167
  `
186
- },
187
- {
188
- look: "secondary",
189
- selected: true,
190
- class: `
168
+ },
169
+ {
170
+ look: "secondary",
171
+ selected: true,
172
+ class: `
191
173
  bg-secondary-selected text-secondary-foreground
192
174
  hover:bg-secondary-selected hover:text-secondary-foreground
193
175
  active:bg-secondary-active active:text-secondary-foreground
194
176
  `
195
- },
196
- {
197
- look: "success",
198
- selected: true,
199
- class: `
177
+ },
178
+ {
179
+ look: "success",
180
+ selected: true,
181
+ class: `
200
182
  bg-success-selected text-success-foreground
201
183
  hover:bg-success-selected hover:text-success-foreground
202
184
  active:bg-success-active active:text-success-foreground
203
185
  `
204
- },
205
- {
206
- look: "error",
207
- selected: true,
208
- class: `
186
+ },
187
+ {
188
+ look: "error",
189
+ selected: true,
190
+ class: `
209
191
  bg-error-selected text-error-foreground
210
192
  hover:bg-error-selected hover:text-error-foreground
211
193
  active:bg-error-active active:text-error-foreground
212
194
  `
213
- },
214
- {
215
- look: "warning",
216
- selected: true,
217
- class: `
195
+ },
196
+ {
197
+ look: "warning",
198
+ selected: true,
199
+ class: `
218
200
  bg-warning-selected text-warning-foreground
219
201
  hover:bg-warning-selected hover:text-warning-foreground
220
202
  active:bg-warning-active active:text-warning-foreground
221
203
  `
222
- },
223
- {
224
- look: "info",
225
- selected: true,
226
- class: `
204
+ },
205
+ {
206
+ look: "info",
207
+ selected: true,
208
+ class: `
227
209
  bg-info-selected text-info-foreground
228
210
  hover:bg-info-selected hover:text-info-foreground
229
211
  active:bg-info-active active:text-info-foreground
230
212
  `
231
- },
232
- {
233
- look: "outline",
234
- selected: true,
235
- class: `
213
+ },
214
+ {
215
+ look: "outline",
216
+ selected: true,
217
+ class: `
236
218
  after:-inset-px
237
219
  bg-(--color-selected) text-(--color-selected-foreground)
238
220
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
239
221
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
240
222
  `
241
- },
242
- {
243
- look: "ghost",
244
- selected: true,
245
- class: `
223
+ },
224
+ {
225
+ look: "ghost",
226
+ selected: true,
227
+ class: `
246
228
  bg-(--color-selected) text-(--color-selected-foreground)
247
229
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
248
230
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
249
231
  `
250
- },
251
- {
252
- look: "link",
253
- selected: true,
254
- class: `
232
+ },
233
+ {
234
+ look: "link",
235
+ selected: true,
236
+ class: `
255
237
  bg-(--color-selected) text-(--color-selected-foreground)
256
238
  hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
257
239
  active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
258
240
  `
259
- },
260
- {
261
- look: "clear",
262
- selected: true,
263
- class: `
241
+ },
242
+ {
243
+ look: "clear",
244
+ selected: true,
245
+ class: `
264
246
  bg-transparent border-0
265
247
  hover:bg-transparent active:bg-transparent
266
248
  `
267
- },
268
- {
269
- disabled: true,
270
- look: "ghost",
271
- class: "disabled:bg-transparent disabled:text-disabled-foreground"
272
- },
273
- {
274
- iconOnly: true,
275
- loading: true,
276
- class: "[&>:not(mona-indicator-icon)]:hidden"
277
- },
278
- {
279
- iconOnly: true,
280
- size: "small",
281
- class: "h-8 w-8 p-0"
282
- },
283
- {
284
- iconOnly: true,
285
- size: "medium",
286
- class: "h-9 w-9 p-0"
287
- },
288
- {
289
- iconOnly: true,
290
- size: "large",
291
- class: "h-10 w-10 p-0"
292
- }
293
- ],
294
- defaultVariants: {
295
- look: "default",
296
- rounded: "medium",
297
- size: "medium"
298
- }
249
+ },
250
+ {
251
+ disabled: true,
252
+ look: "ghost",
253
+ class: "disabled:bg-transparent disabled:text-disabled-foreground"
254
+ },
255
+ {
256
+ iconOnly: true,
257
+ loading: true,
258
+ class: "[&>:not(mona-indicator-icon)]:hidden"
259
+ },
260
+ {
261
+ iconOnly: true,
262
+ size: "small",
263
+ class: "h-8 w-8 p-0"
264
+ },
265
+ {
266
+ iconOnly: true,
267
+ size: "medium",
268
+ class: "h-9 w-9 p-0"
269
+ },
270
+ {
271
+ iconOnly: true,
272
+ size: "large",
273
+ class: "h-10 w-10 p-0"
274
+ }
275
+ ],
276
+ defaultVariants: {
277
+ look: "default",
278
+ rounded: "medium",
279
+ size: "medium"
280
+ }
281
+ });
282
+ var ButtonDirective = class ButtonDirective {
283
+ #appRef;
284
+ #buttonService;
285
+ #destroyRef;
286
+ #group;
287
+ #hostElementRef;
288
+ #injector;
289
+ #renderer;
290
+ #loaderComponentRef;
291
+ #toggleSubscription;
292
+ constructor() {
293
+ this.#appRef = inject(ApplicationRef);
294
+ this.#buttonService = inject(ButtonService, { optional: true });
295
+ this.#destroyRef = inject(DestroyRef);
296
+ this.#group = computed(() => this.#buttonService?.members().includes(this) ? this.#buttonService : null, ...ngDevMode ? [{ debugName: "#group" }] : /* istanbul ignore next */ []);
297
+ this.#hostElementRef = inject(ElementRef);
298
+ this.#injector = inject(Injector);
299
+ this.#renderer = inject(Renderer2);
300
+ this.#loaderComponentRef = null;
301
+ this.#toggleSubscription = null;
302
+ this.baseClass = computed(() => {
303
+ const disabled = this.effectiveDisabled();
304
+ const iconOnly = this.iconOnly();
305
+ const loading = this.loading();
306
+ const look = this.effectiveLook();
307
+ const rounded = this.effectiveRounded();
308
+ const size = this.effectiveSize();
309
+ const selected = this.selected();
310
+ const userClass = this.userClass();
311
+ const variantClasses = buttonThemeVariants({
312
+ disabled,
313
+ iconOnly,
314
+ loading,
315
+ look,
316
+ rounded,
317
+ selected,
318
+ size
319
+ });
320
+ return twMerge(variantClasses, userClass);
321
+ }, ...ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []);
322
+ this.effectiveLook = computed(() => this.#group()?.groupLook() ?? this.look(), ...ngDevMode ? [{ debugName: "effectiveLook" }] : /* istanbul ignore next */ []);
323
+ this.effectiveRounded = computed(() => this.#group()?.groupRounded() ?? this.rounded(), ...ngDevMode ? [{ debugName: "effectiveRounded" }] : /* istanbul ignore next */ []);
324
+ this.effectiveSize = computed(() => this.#group()?.groupSize() ?? this.size(), ...ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []);
325
+ this.groupReadonly = computed(() => !!this.#group()?.groupReadonly() && this.effectiveToggleable(), ...ngDevMode ? [{ debugName: "groupReadonly" }] : /* istanbul ignore next */ []);
326
+ this.loadingSize = computed(() => {
327
+ switch (this.effectiveSize()) {
328
+ case "small": return 12;
329
+ case "large": return 16;
330
+ default: return 14;
331
+ }
332
+ }, ...ngDevMode ? [{ debugName: "loadingSize" }] : /* istanbul ignore next */ []);
333
+ this.ariaHasPopup = input("false", {
334
+ ...ngDevMode ? { debugName: "ariaHasPopup" } : /* istanbul ignore next */ {},
335
+ alias: "aria-haspopup"
336
+ });
337
+ this.disabled = input(false, {
338
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
339
+ transform: booleanAttribute
340
+ });
341
+ this.effectiveDisabled = computed(() => this.#group()?.groupDisabled() || this.disabled(), ...ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []);
342
+ this.effectiveToggleable = computed(() => this.toggleable() ?? !!this.#group(), ...ngDevMode ? [{ debugName: "effectiveToggleable" }] : /* istanbul ignore next */ []);
343
+ this.iconOnly = input(false, {
344
+ ...ngDevMode ? { debugName: "iconOnly" } : /* istanbul ignore next */ {},
345
+ transform: booleanAttribute
346
+ });
347
+ this.loading = input(false, {
348
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
349
+ transform: booleanAttribute
350
+ });
351
+ this.look = model("default", ...ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []);
352
+ this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
353
+ this.selected = model(false, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
354
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
355
+ this.tabindex = input(0, {
356
+ ...ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {},
357
+ transform: (value) => numberAttribute(value, 0)
358
+ });
359
+ this.toggleable = input(void 0, {
360
+ ...ngDevMode ? { debugName: "toggleable" } : /* istanbul ignore next */ {},
361
+ transform: (value) => value === void 0 ? void 0 : booleanAttribute(value)
362
+ });
363
+ this.type = input("button", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
364
+ this.userClass = input("", {
365
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
366
+ alias: "class"
367
+ });
368
+ this.value = input(...ngDevMode ? [void 0, { debugName: "value" }] : /* istanbul ignore next */ []);
369
+ effect(() => {
370
+ if (this.effectiveToggleable()) untracked(() => this.#setToggleableEvent());
371
+ });
372
+ effect(() => {
373
+ const loading = this.loading();
374
+ const loaderSize = this.loadingSize();
375
+ untracked(() => {
376
+ if (loading) this.#createLoader(loaderSize);
377
+ else this.#removeLoader();
378
+ });
379
+ });
380
+ this.#blockClicksWhileLoading();
381
+ this.#destroyRef.onDestroy(() => this.#removeLoader());
382
+ if (this.#buttonService) afterNextRender({ read: () => this.#setSubscriptions() });
383
+ if (isDevMode()) this.#warnIfIconOnlyWithoutName();
384
+ }
385
+ #blockClicksWhileLoading() {
386
+ const host = this.#hostElementRef.nativeElement;
387
+ const listener = (event) => {
388
+ if (this.loading()) {
389
+ event.preventDefault();
390
+ event.stopImmediatePropagation();
391
+ }
392
+ };
393
+ host.addEventListener("click", listener, { capture: true });
394
+ this.#destroyRef.onDestroy(() => host.removeEventListener("click", listener, { capture: true }));
395
+ }
396
+ #createLoader(size) {
397
+ if (this.#loaderComponentRef) {
398
+ this.#loaderComponentRef.setInput("size", size);
399
+ return;
400
+ }
401
+ this.#loaderComponentRef = createComponent(IndicatorIconComponent, {
402
+ environmentInjector: this.#appRef.injector,
403
+ elementInjector: this.#injector
404
+ });
405
+ this.#loaderComponentRef.setInput("preset", "loading");
406
+ this.#loaderComponentRef.setInput("size", size);
407
+ this.#loaderComponentRef.setInput("class", "self-center h-auto");
408
+ this.#appRef.attachView(this.#loaderComponentRef.hostView);
409
+ const loaderElement = this.#loaderComponentRef.location.nativeElement;
410
+ this.#renderer.insertBefore(this.#hostElementRef.nativeElement, loaderElement, this.#hostElementRef.nativeElement.firstChild);
411
+ }
412
+ #removeLoader() {
413
+ if (this.#loaderComponentRef) {
414
+ this.#appRef.detachView(this.#loaderComponentRef.hostView);
415
+ this.#loaderComponentRef.destroy();
416
+ this.#loaderComponentRef = null;
417
+ }
418
+ }
419
+ #setSubscriptions() {
420
+ this.#buttonService?.buttonSelect$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((result) => {
421
+ const [button, selected] = result;
422
+ if (button === this) this.selected.set(selected);
423
+ });
424
+ const host = this.#hostElementRef.nativeElement;
425
+ fromEvent(host, "click").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
426
+ if (!this.effectiveToggleable()) this.#group()?.memberClick$.next([this, host]);
427
+ });
428
+ }
429
+ #hasAccessibleName() {
430
+ const host = this.#hostElementRef.nativeElement;
431
+ return [
432
+ "aria-label",
433
+ "aria-labelledby",
434
+ "title"
435
+ ].some((name) => !!host.getAttribute(name)?.trim()) || !!host.textContent?.trim();
436
+ }
437
+ #setToggleableEvent() {
438
+ this.#toggleSubscription?.unsubscribe();
439
+ this.#toggleSubscription = fromEvent(this.#hostElementRef.nativeElement, "click").pipe(takeUntilDestroyed(this.#destroyRef), takeWhile(() => this.effectiveToggleable())).subscribe(() => {
440
+ if (this.effectiveDisabled()) return;
441
+ const wasSelected = this.selected();
442
+ const group = this.#group();
443
+ if (group) {
444
+ group.buttonClick$.next([this, wasSelected]);
445
+ group.memberClick$.next([this, this.#hostElementRef.nativeElement]);
446
+ } else this.selected.set(!this.selected());
447
+ });
448
+ }
449
+ #warnIfIconOnlyWithoutName() {
450
+ let warned = false;
451
+ afterRenderEffect({ read: () => {
452
+ if (warned || !this.iconOnly() || this.#hasAccessibleName()) return;
453
+ warned = true;
454
+ console.warn("[Mona Button] An icon-only button needs an accessible name. Add aria-label, aria-labelledby or title.", this.#hostElementRef.nativeElement);
455
+ } });
456
+ }
457
+ static {
458
+ this.ɵfac = i0.ɵɵngDeclareFactory({
459
+ minVersion: "12.0.0",
460
+ version: "22.2.6",
461
+ ngImport: i0,
462
+ type: ButtonDirective,
463
+ deps: [],
464
+ target: i0.ɵɵFactoryTarget.Directive
465
+ });
466
+ }
467
+ static {
468
+ this.ɵdir = i0.ɵɵngDeclareDirective({
469
+ minVersion: "17.1.0",
470
+ version: "22.2.6",
471
+ type: ButtonDirective,
472
+ isStandalone: true,
473
+ selector: "button[monaButton]",
474
+ inputs: {
475
+ ariaHasPopup: {
476
+ classPropertyName: "ariaHasPopup",
477
+ publicName: "aria-haspopup",
478
+ isSignal: true,
479
+ isRequired: false,
480
+ transformFunction: null
481
+ },
482
+ disabled: {
483
+ classPropertyName: "disabled",
484
+ publicName: "disabled",
485
+ isSignal: true,
486
+ isRequired: false,
487
+ transformFunction: null
488
+ },
489
+ iconOnly: {
490
+ classPropertyName: "iconOnly",
491
+ publicName: "iconOnly",
492
+ isSignal: true,
493
+ isRequired: false,
494
+ transformFunction: null
495
+ },
496
+ loading: {
497
+ classPropertyName: "loading",
498
+ publicName: "loading",
499
+ isSignal: true,
500
+ isRequired: false,
501
+ transformFunction: null
502
+ },
503
+ look: {
504
+ classPropertyName: "look",
505
+ publicName: "look",
506
+ isSignal: true,
507
+ isRequired: false,
508
+ transformFunction: null
509
+ },
510
+ rounded: {
511
+ classPropertyName: "rounded",
512
+ publicName: "rounded",
513
+ isSignal: true,
514
+ isRequired: false,
515
+ transformFunction: null
516
+ },
517
+ selected: {
518
+ classPropertyName: "selected",
519
+ publicName: "selected",
520
+ isSignal: true,
521
+ isRequired: false,
522
+ transformFunction: null
523
+ },
524
+ size: {
525
+ classPropertyName: "size",
526
+ publicName: "size",
527
+ isSignal: true,
528
+ isRequired: false,
529
+ transformFunction: null
530
+ },
531
+ tabindex: {
532
+ classPropertyName: "tabindex",
533
+ publicName: "tabindex",
534
+ isSignal: true,
535
+ isRequired: false,
536
+ transformFunction: null
537
+ },
538
+ toggleable: {
539
+ classPropertyName: "toggleable",
540
+ publicName: "toggleable",
541
+ isSignal: true,
542
+ isRequired: false,
543
+ transformFunction: null
544
+ },
545
+ type: {
546
+ classPropertyName: "type",
547
+ publicName: "type",
548
+ isSignal: true,
549
+ isRequired: false,
550
+ transformFunction: null
551
+ },
552
+ userClass: {
553
+ classPropertyName: "userClass",
554
+ publicName: "class",
555
+ isSignal: true,
556
+ isRequired: false,
557
+ transformFunction: null
558
+ },
559
+ value: {
560
+ classPropertyName: "value",
561
+ publicName: "value",
562
+ isSignal: true,
563
+ isRequired: false,
564
+ transformFunction: null
565
+ }
566
+ },
567
+ outputs: {
568
+ look: "lookChange",
569
+ selected: "selectedChange"
570
+ },
571
+ host: { properties: {
572
+ "attr.aria-busy": "loading() ? 'true' : undefined",
573
+ "attr.aria-disabled": "effectiveDisabled() || loading() || groupReadonly() ? 'true' : undefined",
574
+ "attr.aria-haspopup": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null",
575
+ "attr.aria-pressed": "effectiveToggleable() ? (selected() ? 'true' : 'false') : undefined",
576
+ "attr.data-look": "effectiveLook()",
577
+ "attr.data-size": "effectiveSize()",
578
+ "attr.disabled": "effectiveDisabled() ? '' : undefined",
579
+ "attr.tabindex": "effectiveDisabled() ? -1 : tabindex()",
580
+ "attr.type": "type()",
581
+ "class": "baseClass()"
582
+ } },
583
+ ngImport: i0
584
+ });
585
+ }
586
+ };
587
+ i0.ɵɵngDeclareClassMetadata({
588
+ minVersion: "12.0.0",
589
+ version: "22.2.6",
590
+ ngImport: i0,
591
+ type: ButtonDirective,
592
+ decorators: [{
593
+ type: Directive,
594
+ args: [{
595
+ selector: "button[monaButton]",
596
+ host: {
597
+ "[attr.aria-busy]": "loading() ? 'true' : undefined",
598
+ "[attr.aria-disabled]": "effectiveDisabled() || loading() || groupReadonly() ? 'true' : undefined",
599
+ "[attr.aria-haspopup]": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null",
600
+ "[attr.aria-pressed]": "effectiveToggleable() ? (selected() ? 'true' : 'false') : undefined",
601
+ "[attr.data-look]": "effectiveLook()",
602
+ "[attr.data-size]": "effectiveSize()",
603
+ "[attr.disabled]": "effectiveDisabled() ? '' : undefined",
604
+ "[attr.tabindex]": "effectiveDisabled() ? -1 : tabindex()",
605
+ "[attr.type]": "type()",
606
+ "[class]": "baseClass()"
607
+ }
608
+ }]
609
+ }],
610
+ ctorParameters: () => [],
611
+ propDecorators: {
612
+ ariaHasPopup: [{
613
+ type: i0.Input,
614
+ args: [{
615
+ isSignal: true,
616
+ alias: "aria-haspopup",
617
+ required: false
618
+ }]
619
+ }],
620
+ disabled: [{
621
+ type: i0.Input,
622
+ args: [{
623
+ isSignal: true,
624
+ alias: "disabled",
625
+ required: false
626
+ }]
627
+ }],
628
+ iconOnly: [{
629
+ type: i0.Input,
630
+ args: [{
631
+ isSignal: true,
632
+ alias: "iconOnly",
633
+ required: false
634
+ }]
635
+ }],
636
+ loading: [{
637
+ type: i0.Input,
638
+ args: [{
639
+ isSignal: true,
640
+ alias: "loading",
641
+ required: false
642
+ }]
643
+ }],
644
+ look: [{
645
+ type: i0.Input,
646
+ args: [{
647
+ isSignal: true,
648
+ alias: "look",
649
+ required: false
650
+ }]
651
+ }, {
652
+ type: i0.Output,
653
+ args: ["lookChange"]
654
+ }],
655
+ rounded: [{
656
+ type: i0.Input,
657
+ args: [{
658
+ isSignal: true,
659
+ alias: "rounded",
660
+ required: false
661
+ }]
662
+ }],
663
+ selected: [{
664
+ type: i0.Input,
665
+ args: [{
666
+ isSignal: true,
667
+ alias: "selected",
668
+ required: false
669
+ }]
670
+ }, {
671
+ type: i0.Output,
672
+ args: ["selectedChange"]
673
+ }],
674
+ size: [{
675
+ type: i0.Input,
676
+ args: [{
677
+ isSignal: true,
678
+ alias: "size",
679
+ required: false
680
+ }]
681
+ }],
682
+ tabindex: [{
683
+ type: i0.Input,
684
+ args: [{
685
+ isSignal: true,
686
+ alias: "tabindex",
687
+ required: false
688
+ }]
689
+ }],
690
+ toggleable: [{
691
+ type: i0.Input,
692
+ args: [{
693
+ isSignal: true,
694
+ alias: "toggleable",
695
+ required: false
696
+ }]
697
+ }],
698
+ type: [{
699
+ type: i0.Input,
700
+ args: [{
701
+ isSignal: true,
702
+ alias: "type",
703
+ required: false
704
+ }]
705
+ }],
706
+ userClass: [{
707
+ type: i0.Input,
708
+ args: [{
709
+ isSignal: true,
710
+ alias: "class",
711
+ required: false
712
+ }]
713
+ }],
714
+ value: [{
715
+ type: i0.Input,
716
+ args: [{
717
+ isSignal: true,
718
+ alias: "value",
719
+ required: false
720
+ }]
721
+ }]
722
+ }
299
723
  });
300
-
301
- class ButtonDirective {
302
- #appRef;
303
- #buttonService;
304
- #destroyRef;
305
- /**
306
- * The service of the group this button belongs to. A `ButtonService` higher up the injector tree is not enough:
307
- * buttons inside a component projected into a group, or inside a popup opened from one, are not members.
308
- */
309
- #group;
310
- #hostElementRef;
311
- #injector;
312
- #renderer;
313
- #loaderComponentRef;
314
- #toggleSubscription;
315
- constructor() {
316
- this.#appRef = inject(ApplicationRef);
317
- this.#buttonService = inject(ButtonService, { optional: true });
318
- this.#destroyRef = inject(DestroyRef);
319
- /**
320
- * The service of the group this button belongs to. A `ButtonService` higher up the injector tree is not enough:
321
- * buttons inside a component projected into a group, or inside a popup opened from one, are not members.
322
- */
323
- this.#group = computed(() => (this.#buttonService?.members().includes(this) ? this.#buttonService : null), /* @ts-ignore */
324
- ...(ngDevMode ? [{ debugName: "#group" }] : /* istanbul ignore next */ []));
325
- this.#hostElementRef = inject(ElementRef);
326
- this.#injector = inject(Injector);
327
- this.#renderer = inject(Renderer2);
328
- this.#loaderComponentRef = null;
329
- this.#toggleSubscription = null;
330
- this.baseClass = computed(() => {
331
- const disabled = this.effectiveDisabled();
332
- const iconOnly = this.iconOnly();
333
- const loading = this.loading();
334
- const look = this.effectiveLook();
335
- const rounded = this.effectiveRounded();
336
- const size = this.effectiveSize();
337
- const selected = this.selected();
338
- const userClass = this.userClass();
339
- const variantClasses = buttonThemeVariants({ disabled, iconOnly, loading, look, rounded, selected, size });
340
- return twMerge(variantClasses, userClass);
341
- }, /* @ts-ignore */
342
- ...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
343
- this.effectiveLook = computed(() => this.#group()?.groupLook() ?? this.look(), /* @ts-ignore */
344
- ...(ngDevMode ? [{ debugName: "effectiveLook" }] : /* istanbul ignore next */ []));
345
- this.effectiveRounded = computed(() => this.#group()?.groupRounded() ?? this.rounded(), /* @ts-ignore */
346
- ...(ngDevMode ? [{ debugName: "effectiveRounded" }] : /* istanbul ignore next */ []));
347
- this.effectiveSize = computed(() => this.#group()?.groupSize() ?? this.size(), /* @ts-ignore */
348
- ...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
349
- /**
350
- * A read-only group's toggle buttons keep focus, so they can't be natively disabled.
351
- */
352
- this.groupReadonly = computed(() => !!this.#group()?.groupReadonly() && this.effectiveToggleable(), /* @ts-ignore */
353
- ...(ngDevMode ? [{ debugName: "groupReadonly" }] : /* istanbul ignore next */ []));
354
- this.loadingSize = computed(() => {
355
- const size = this.effectiveSize();
356
- switch (size) {
357
- case "small":
358
- return 12;
359
- case "large":
360
- return 16;
361
- case "medium":
362
- default:
363
- return 14;
364
- }
365
- }, /* @ts-ignore */
366
- ...(ngDevMode ? [{ debugName: "loadingSize" }] : /* istanbul ignore next */ []));
367
- /**
368
- * @description Value forwarded to the `aria-haspopup` attribute. Set when this button triggers a popup, menu,
369
- * listbox, tree, grid, or dialog. Omit or leave as `"false"` for plain action buttons.
370
- * @default "false"
371
- */
372
- this.ariaHasPopup = input("false", { ...(ngDevMode ? { debugName: "ariaHasPopup" } : /* istanbul ignore next */ {}), alias: "aria-haspopup" });
373
- /**
374
- * @description Renders the component with reduced visual emphasis and removes pointer interaction.
375
- * Accepts the bare attribute form (`<button monaButton disabled>`).
376
- * When inside a `ButtonGroup`, the button is disabled when either it or the group is disabled.
377
- * @default false
378
- */
379
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
380
- /**
381
- * Whether the button is disabled, by its own input or its group's. A dropdown or split button reads this to close
382
- * its menu.
383
- */
384
- this.effectiveDisabled = computed(() => this.#group()?.groupDisabled() || this.disabled(), /* @ts-ignore */
385
- ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
386
- /**
387
- * Whether a click toggles the button: buttons in a group do unless `toggleable` is `false`. The group reads this to
388
- * know which buttons take part in its selection.
389
- */
390
- this.effectiveToggleable = computed(() => this.toggleable() ?? !!this.#group(), /* @ts-ignore */
391
- ...(ngDevMode ? [{ debugName: "effectiveToggleable" }] : /* istanbul ignore next */ []));
392
- /**
393
- * @description Removes horizontal padding and fixes a square aspect ratio sized to match `size`.
394
- * Provide `aria-label` on the host when using icon-only buttons; in dev mode, an icon-only button without an
395
- * accessible name logs a warning.
396
- * @default false
397
- */
398
- this.iconOnly = input(false, { ...(ngDevMode ? { debugName: "iconOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
399
- /**
400
- * @description Displays a loading indicator and prevents interaction while an operation is in progress.
401
- * Sets `aria-busy="true"` and `aria-disabled="true"` on the host. The button stays focusable, so keyboard focus
402
- * isn't lost when loading starts, and clicks (including form submission) are blocked until it ends.
403
- * @default false
404
- */
405
- this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
406
- /**
407
- * @description Visual style variant of the button. When inside a `ButtonGroup`, the group's look takes precedence.
408
- * `"outline"` looks the same as `"default"`. `"clear"` shows no selected state, so use another look for
409
- * toggle buttons.
410
- * @default "default"
411
- */
412
- this.look = model("default", /* @ts-ignore */
413
- ...(ngDevMode ? [{ debugName: "look" }] : /* istanbul ignore next */ []));
414
- /**
415
- * @description Border-radius preset applied to the component.
416
- * When inside a `ButtonGroup`, the group's value takes precedence.
417
- * @default "medium"
418
- */
419
- this.rounded = input("medium", /* @ts-ignore */
420
- ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
421
- /**
422
- * @description Whether the button is in the selected/pressed state. Drives `aria-pressed` when the button is toggleable.
423
- * Managed by `toggleable` click handling or by `ButtonGroup` selection policy.
424
- * @default false
425
- */
426
- this.selected = model(false, /* @ts-ignore */
427
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
428
- /**
429
- * @description Size preset controlling the button's height and horizontal padding.
430
- * When inside a `ButtonGroup`, the group's value takes precedence.
431
- * @default "medium"
432
- */
433
- this.size = input("medium", /* @ts-ignore */
434
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
435
- /**
436
- * @description Tab index of the host element. Automatically overridden to `-1` when the button is disabled.
437
- * Accepts a numeric string and converts it to a number; a value that is not a number falls back to `0`.
438
- * @default 0
439
- */
440
- this.tabindex = input(0, { ...(ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {}), transform: (value) => numberAttribute(value, 0) });
441
- /**
442
- * @description Enables toggle behavior — each click flips the `selected` state and `aria-pressed` is managed.
443
- * Accepts the bare attribute form. Buttons in a `ButtonGroup` are toggleable unless this is set to `false`.
444
- * @default undefined
445
- */
446
- this.toggleable = input(undefined, { ...(ngDevMode ? { debugName: "toggleable" } : /* istanbul ignore next */ {}), transform: (value) => (value === undefined ? undefined : booleanAttribute(value)) });
447
- /**
448
- * @description Native `type` attribute of the button. Defaults to `"button"` to prevent accidental
449
- * form submission; set to `"submit"` or `"reset"` explicitly when that behavior is intended.
450
- * @default "button"
451
- */
452
- this.type = input("button", /* @ts-ignore */
453
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
454
- /**
455
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
456
- * @default ""
457
- */
458
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
459
- /**
460
- * @description What a `ButtonGroup`'s `value` holds while this button is selected. A button without one takes no part
461
- * in the group's `value`.
462
- * @default undefined
463
- */
464
- this.value = input(/* @ts-ignore */
465
- ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
466
- effect(() => {
467
- const toggleable = this.effectiveToggleable();
468
- if (toggleable) {
469
- untracked(() => this.#setToggleableEvent());
470
- }
471
- });
472
- effect(() => {
473
- const loading = this.loading();
474
- const loaderSize = this.loadingSize();
475
- untracked(() => {
476
- if (loading) {
477
- this.#createLoader(loaderSize);
478
- }
479
- else {
480
- this.#removeLoader();
481
- }
482
- });
483
- });
484
- this.#blockClicksWhileLoading();
485
- this.#destroyRef.onDestroy(() => this.#removeLoader());
486
- if (this.#buttonService) {
487
- afterNextRender({
488
- read: () => this.#setSubscriptions()
489
- });
490
- }
491
- if (isDevMode()) {
492
- this.#warnIfIconOnlyWithoutName();
493
- }
494
- }
495
- /**
496
- * A loading button keeps focus, so it is not natively disabled. A capturing listener registered before any other
497
- * stops activation from reaching the user's handlers, the toggle handler and form submission.
498
- */
499
- #blockClicksWhileLoading() {
500
- const host = this.#hostElementRef.nativeElement;
501
- const listener = (event) => {
502
- if (this.loading()) {
503
- event.preventDefault();
504
- event.stopImmediatePropagation();
505
- }
506
- };
507
- host.addEventListener("click", listener, { capture: true });
508
- this.#destroyRef.onDestroy(() => host.removeEventListener("click", listener, { capture: true }));
509
- }
510
- #createLoader(size) {
511
- if (this.#loaderComponentRef) {
512
- this.#loaderComponentRef.setInput("size", size);
513
- return;
514
- }
515
- this.#loaderComponentRef = createComponent(IndicatorIconComponent, {
516
- environmentInjector: this.#appRef.injector,
517
- elementInjector: this.#injector
518
- });
519
- this.#loaderComponentRef.setInput("preset", "loading");
520
- this.#loaderComponentRef.setInput("size", size);
521
- this.#loaderComponentRef.setInput("class", "self-center h-auto");
522
- this.#appRef.attachView(this.#loaderComponentRef.hostView);
523
- const loaderElement = this.#loaderComponentRef.location.nativeElement;
524
- this.#renderer.insertBefore(this.#hostElementRef.nativeElement, loaderElement, this.#hostElementRef.nativeElement.firstChild);
525
- }
526
- #removeLoader() {
527
- if (this.#loaderComponentRef) {
528
- this.#appRef.detachView(this.#loaderComponentRef.hostView);
529
- this.#loaderComponentRef.destroy();
530
- this.#loaderComponentRef = null;
531
- }
532
- }
533
- #setSubscriptions() {
534
- this.#buttonService?.buttonSelect$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(result => {
535
- const [button, selected] = result;
536
- if (button === this) {
537
- this.selected.set(selected);
538
- }
539
- });
540
- const host = this.#hostElementRef.nativeElement;
541
- fromEvent(host, "click")
542
- .pipe(takeUntilDestroyed(this.#destroyRef))
543
- .subscribe(() => {
544
- if (!this.effectiveToggleable()) {
545
- this.#group()?.memberClick$.next([this, host]);
546
- }
547
- });
548
- }
549
- #hasAccessibleName() {
550
- const host = this.#hostElementRef.nativeElement;
551
- const named = ["aria-label", "aria-labelledby", "title"].some(name => !!host.getAttribute(name)?.trim());
552
- return named || !!host.textContent?.trim();
553
- }
554
- #setToggleableEvent() {
555
- this.#toggleSubscription?.unsubscribe();
556
- this.#toggleSubscription = fromEvent(this.#hostElementRef.nativeElement, "click")
557
- .pipe(takeUntilDestroyed(this.#destroyRef), takeWhile(() => this.effectiveToggleable()))
558
- .subscribe(() => {
559
- if (this.effectiveDisabled()) {
560
- return;
561
- }
562
- const wasSelected = this.selected();
563
- const group = this.#group();
564
- if (group) {
565
- group.buttonClick$.next([this, wasSelected]);
566
- group.memberClick$.next([this, this.#hostElementRef.nativeElement]);
567
- }
568
- else {
569
- this.selected.set(!this.selected());
570
- }
571
- });
572
- }
573
- #warnIfIconOnlyWithoutName() {
574
- let warned = false;
575
- afterRenderEffect({
576
- read: () => {
577
- if (warned || !this.iconOnly() || this.#hasAccessibleName()) {
578
- return;
579
- }
580
- warned = true;
581
- console.warn("[Mona Button] An icon-only button needs an accessible name. Add aria-label, aria-labelledby or title.", this.#hostElementRef.nativeElement);
582
- }
583
- });
584
- }
585
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
586
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ButtonDirective, isStandalone: true, selector: "button[monaButton]", inputs: { ariaHasPopup: { classPropertyName: "ariaHasPopup", publicName: "aria-haspopup", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, toggleable: { classPropertyName: "toggleable", publicName: "toggleable", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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: { look: "lookChange", selected: "selectedChange" }, host: { properties: { "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-disabled": "effectiveDisabled() || loading() || groupReadonly() ? 'true' : undefined", "attr.aria-haspopup": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null", "attr.aria-pressed": "effectiveToggleable() ? (selected() ? 'true' : 'false') : undefined", "attr.data-look": "effectiveLook()", "attr.data-size": "effectiveSize()", "attr.disabled": "effectiveDisabled() ? '' : undefined", "attr.tabindex": "effectiveDisabled() ? -1 : tabindex()", "attr.type": "type()", "class": "baseClass()" } }, ngImport: i0 }); }
587
- }
588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ButtonDirective, decorators: [{
589
- type: Directive,
590
- args: [{
591
- selector: "button[monaButton]",
592
- host: {
593
- "[attr.aria-busy]": "loading() ? 'true' : undefined",
594
- "[attr.aria-disabled]": "effectiveDisabled() || loading() || groupReadonly() ? 'true' : undefined",
595
- "[attr.aria-haspopup]": "ariaHasPopup() !== 'false' ? ariaHasPopup() : null",
596
- "[attr.aria-pressed]": "effectiveToggleable() ? (selected() ? 'true' : 'false') : undefined",
597
- "[attr.data-look]": "effectiveLook()",
598
- "[attr.data-size]": "effectiveSize()",
599
- "[attr.disabled]": "effectiveDisabled() ? '' : undefined",
600
- "[attr.tabindex]": "effectiveDisabled() ? -1 : tabindex()",
601
- "[attr.type]": "type()",
602
- "[class]": "baseClass()"
603
- }
604
- }]
605
- }], ctorParameters: () => [], propDecorators: { ariaHasPopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-haspopup", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }, { type: i0.Output, args: ["lookChange"] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }], toggleable: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleable", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
606
-
607
- /**
608
- * Provided by a component that implements {@link ButtonGroupMember}, so a `mona-button-group` can find it among its
609
- * content children.
610
- */
611
724
  const BUTTON_GROUP_MEMBER = new InjectionToken("BUTTON_GROUP_MEMBER");
612
-
613
- /*
614
- * Public API Surface of @nanahoshi/mona-ui/button
615
- */
616
-
617
- /**
618
- * Generated bundle index. Do not edit.
619
- */
620
-
621
725
  export { BUTTON_GROUP_MEMBER, ButtonDirective, ButtonService };
622
- //# sourceMappingURL=nanahoshi-mona-ui-button.mjs.map
726
+
727
+ //# sourceMappingURL=nanahoshi-mona-ui-button.mjs.map