@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,86 +1,133 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { inject, TemplateRef, Directive, DestroyRef, NgZone, computed, viewChild, contentChild, signal, input, booleanAttribute, numberAttribute, output, model, afterNextRender, isDevMode, Component } from '@angular/core';
4
- import { LucideStar, LucideHeart, LucideFlame, LucideDiamond, LucideCircle, LucideDynamicIcon } from '@lucide/angular';
5
- import { injectLabelAssociation, injectEffectiveDisabled, createElementControlId } from '@nanahoshi/mona-ui/internal';
6
- import { range } from '@mirei/ts-collections';
7
- import { formatNumber, injectComponentDirection, MonaI18nService } from '@nanahoshi/mona-ui/i18n';
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`.
1
+ import { NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Directive, NgZone, TemplateRef, afterNextRender, booleanAttribute, computed, contentChild, inject, input, isDevMode, model, numberAttribute, output, signal, viewChild } from "@angular/core";
4
+ import { LucideCircle, LucideDiamond, LucideDynamicIcon, LucideFlame, LucideHeart, LucideStar } from "@lucide/angular";
5
+ import { createElementControlId, injectEffectiveDisabled, injectLabelAssociation } from "@nanahoshi/mona-ui/internal";
6
+ import { range } from "@mirei/ts-collections";
7
+ import { MonaI18nService, formatNumber, injectComponentDirection } from "@nanahoshi/mona-ui/i18n";
8
+ import { twMerge } from "tailwind-merge";
9
+ import { cva } from "class-variance-authority";
13
10
  function localizeNumber(value, options) {
14
- return formatNumber(value, "en-US", options);
11
+ return formatNumber(value, "en-US", options);
15
12
  }
16
13
  const RATING_DEFAULT_MESSAGES = {
17
- notRated: "Not rated",
18
- valueText: (value, max) => `${localizeNumber(value)} out of ${localizeNumber(max)}`
14
+ notRated: "Not rated",
15
+ valueText: (value, max) => `${localizeNumber(value)} out of ${localizeNumber(max)}`
19
16
  };
20
-
21
- /**
22
- * @description Renders the pointer-preview visual for rating items. Overrides the default preset
23
- * overlay whenever the visible state comes from pointer preview.
24
- */
25
- class RatingHoveredItemTemplateDirective {
26
- constructor() {
27
- this.templateRef = inject(TemplateRef);
28
- }
29
- static ngTemplateContextGuard(_directive, _context) {
30
- return true;
31
- }
32
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingHoveredItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
33
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: RatingHoveredItemTemplateDirective, isStandalone: true, selector: "ng-template[monaRatingHoveredItemTemplate]", ngImport: i0 }); }
34
- }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingHoveredItemTemplateDirective, decorators: [{
36
- type: Directive,
37
- args: [{
38
- selector: "ng-template[monaRatingHoveredItemTemplate]"
39
- }]
40
- }] });
41
-
42
- /**
43
- * @description Renders the default (unselected) visual for every rating item. Overrides the
44
- * default preset icon for the base layer of each item.
45
- */
46
- class RatingItemTemplateDirective {
47
- constructor() {
48
- this.templateRef = inject(TemplateRef);
49
- }
50
- static ngTemplateContextGuard(_directive, _context) {
51
- return true;
52
- }
53
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
54
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: RatingItemTemplateDirective, isStandalone: true, selector: "ng-template[monaRatingItemTemplate]", ngImport: i0 }); }
55
- }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingItemTemplateDirective, decorators: [{
57
- type: Directive,
58
- args: [{
59
- selector: "ng-template[monaRatingItemTemplate]"
60
- }]
61
- }] });
62
-
63
- /**
64
- * @description Renders the committed selected visual for rating items. Overrides the default
65
- * preset overlay whenever the visible state comes from the committed value.
66
- */
67
- class RatingSelectedItemTemplateDirective {
68
- constructor() {
69
- this.templateRef = inject(TemplateRef);
70
- }
71
- static ngTemplateContextGuard(_directive, _context) {
72
- return true;
73
- }
74
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingSelectedItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
75
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: RatingSelectedItemTemplateDirective, isStandalone: true, selector: "ng-template[monaRatingSelectedItemTemplate]", ngImport: i0 }); }
76
- }
77
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingSelectedItemTemplateDirective, decorators: [{
78
- type: Directive,
79
- args: [{
80
- selector: "ng-template[monaRatingSelectedItemTemplate]"
81
- }]
82
- }] });
83
-
17
+ var RatingHoveredItemTemplateDirective = class RatingHoveredItemTemplateDirective {
18
+ constructor() {
19
+ this.templateRef = inject(TemplateRef);
20
+ }
21
+ static ngTemplateContextGuard(_directive, _context) {
22
+ return true;
23
+ }
24
+ static {
25
+ this.ɵfac = i0.ɵɵngDeclareFactory({
26
+ minVersion: "12.0.0",
27
+ version: "22.2.6",
28
+ ngImport: i0,
29
+ type: RatingHoveredItemTemplateDirective,
30
+ deps: [],
31
+ target: i0.ɵɵFactoryTarget.Directive
32
+ });
33
+ }
34
+ static {
35
+ this.ɵdir = i0.ɵɵngDeclareDirective({
36
+ minVersion: "14.0.0",
37
+ version: "22.2.6",
38
+ type: RatingHoveredItemTemplateDirective,
39
+ isStandalone: true,
40
+ selector: "ng-template[monaRatingHoveredItemTemplate]",
41
+ ngImport: i0
42
+ });
43
+ }
44
+ };
45
+ i0.ɵɵngDeclareClassMetadata({
46
+ minVersion: "12.0.0",
47
+ version: "22.2.6",
48
+ ngImport: i0,
49
+ type: RatingHoveredItemTemplateDirective,
50
+ decorators: [{
51
+ type: Directive,
52
+ args: [{ selector: "ng-template[monaRatingHoveredItemTemplate]" }]
53
+ }]
54
+ });
55
+ var RatingItemTemplateDirective = class RatingItemTemplateDirective {
56
+ constructor() {
57
+ this.templateRef = inject(TemplateRef);
58
+ }
59
+ static ngTemplateContextGuard(_directive, _context) {
60
+ return true;
61
+ }
62
+ static {
63
+ this.ɵfac = i0.ɵɵngDeclareFactory({
64
+ minVersion: "12.0.0",
65
+ version: "22.2.6",
66
+ ngImport: i0,
67
+ type: RatingItemTemplateDirective,
68
+ deps: [],
69
+ target: i0.ɵɵFactoryTarget.Directive
70
+ });
71
+ }
72
+ static {
73
+ this.ɵdir = i0.ɵɵngDeclareDirective({
74
+ minVersion: "14.0.0",
75
+ version: "22.2.6",
76
+ type: RatingItemTemplateDirective,
77
+ isStandalone: true,
78
+ selector: "ng-template[monaRatingItemTemplate]",
79
+ ngImport: i0
80
+ });
81
+ }
82
+ };
83
+ i0.ɵɵngDeclareClassMetadata({
84
+ minVersion: "12.0.0",
85
+ version: "22.2.6",
86
+ ngImport: i0,
87
+ type: RatingItemTemplateDirective,
88
+ decorators: [{
89
+ type: Directive,
90
+ args: [{ selector: "ng-template[monaRatingItemTemplate]" }]
91
+ }]
92
+ });
93
+ var RatingSelectedItemTemplateDirective = class RatingSelectedItemTemplateDirective {
94
+ constructor() {
95
+ this.templateRef = inject(TemplateRef);
96
+ }
97
+ static ngTemplateContextGuard(_directive, _context) {
98
+ return true;
99
+ }
100
+ static {
101
+ this.ɵfac = i0.ɵɵngDeclareFactory({
102
+ minVersion: "12.0.0",
103
+ version: "22.2.6",
104
+ ngImport: i0,
105
+ type: RatingSelectedItemTemplateDirective,
106
+ deps: [],
107
+ target: i0.ɵɵFactoryTarget.Directive
108
+ });
109
+ }
110
+ static {
111
+ this.ɵdir = i0.ɵɵngDeclareDirective({
112
+ minVersion: "14.0.0",
113
+ version: "22.2.6",
114
+ type: RatingSelectedItemTemplateDirective,
115
+ isStandalone: true,
116
+ selector: "ng-template[monaRatingSelectedItemTemplate]",
117
+ ngImport: i0
118
+ });
119
+ }
120
+ };
121
+ i0.ɵɵngDeclareClassMetadata({
122
+ minVersion: "12.0.0",
123
+ version: "22.2.6",
124
+ ngImport: i0,
125
+ type: RatingSelectedItemTemplateDirective,
126
+ decorators: [{
127
+ type: Directive,
128
+ args: [{ selector: "ng-template[monaRatingSelectedItemTemplate]" }]
129
+ }]
130
+ });
84
131
  const ratingContainerThemeVariants = cva(`inline-flex items-center gap-2.5`);
85
132
  const ratingControlThemeVariants = cva(`
86
133
  group
@@ -95,28 +142,20 @@ const ratingControlThemeVariants = cva(`
95
142
  data-[invalid="true"]:outline-2 data-[invalid="true"]:outline-error
96
143
  data-[invalid="true"]:focus-visible:outline-error
97
144
  `, {
98
- variants: {
99
- size: {
100
- small: "gap-1 p-0.5",
101
- medium: "gap-1 p-1",
102
- large: "gap-1.5 p-1.5"
103
- }
104
- },
105
- defaultVariants: {
106
- size: "medium"
107
- }
145
+ variants: { size: {
146
+ small: "gap-1 p-0.5",
147
+ medium: "gap-1 p-1",
148
+ large: "gap-1.5 p-1.5"
149
+ } },
150
+ defaultVariants: { size: "medium" }
108
151
  });
109
152
  const ratingItemThemeVariants = cva(`relative flex items-center justify-center overflow-hidden`, {
110
- variants: {
111
- size: {
112
- small: "h-6 w-6",
113
- medium: "h-7 w-7",
114
- large: "h-8 w-8"
115
- }
116
- },
117
- defaultVariants: {
118
- size: "medium"
119
- }
153
+ variants: { size: {
154
+ small: "h-6 w-6",
155
+ medium: "h-7 w-7",
156
+ large: "h-8 w-8"
157
+ } },
158
+ defaultVariants: { size: "medium" }
120
159
  });
121
160
  const ratingIconThemeVariants = cva(`
122
161
  block shrink-0
@@ -124,28 +163,20 @@ const ratingIconThemeVariants = cva(`
124
163
  transition-colors duration-(--mona-motion-fast)
125
164
  group-data-[disabled="true"]:text-disabled-foreground
126
165
  `, {
127
- variants: {
128
- size: {
129
- small: "h-4 w-4",
130
- medium: "h-5 w-5",
131
- large: "h-6 w-6"
132
- }
133
- },
134
- defaultVariants: {
135
- size: "medium"
136
- }
166
+ variants: { size: {
167
+ small: "h-4 w-4",
168
+ medium: "h-5 w-5",
169
+ large: "h-6 w-6"
170
+ } },
171
+ defaultVariants: { size: "medium" }
137
172
  });
138
173
  const ratingOverlayIconThemeVariants = cva(`block shrink-0`, {
139
- variants: {
140
- size: {
141
- small: "h-4 w-4",
142
- medium: "h-5 w-5",
143
- large: "h-6 w-6"
144
- }
145
- },
146
- defaultVariants: {
147
- size: "medium"
148
- }
174
+ variants: { size: {
175
+ small: "h-4 w-4",
176
+ medium: "h-5 w-5",
177
+ large: "h-6 w-6"
178
+ } },
179
+ defaultVariants: { size: "medium" }
149
180
  });
150
181
  const ratingOverlayClipThemeVariants = cva(`
151
182
  absolute bottom-0 start-0 top-0
@@ -157,529 +188,748 @@ const ratingOverlayContentThemeVariants = cva(`
157
188
  transition-colors duration-(--mona-motion-fast)
158
189
  group-data-[disabled="true"]:text-disabled-foreground
159
190
  `, {
160
- variants: {
161
- size: {
162
- small: "h-6 w-6",
163
- medium: "h-7 w-7",
164
- large: "h-8 w-8"
165
- }
166
- },
167
- defaultVariants: {
168
- size: "medium"
169
- }
191
+ variants: { size: {
192
+ small: "h-6 w-6",
193
+ medium: "h-7 w-7",
194
+ large: "h-8 w-8"
195
+ } },
196
+ defaultVariants: { size: "medium" }
170
197
  });
171
198
  const ratingLabelThemeVariants = cva(`whitespace-nowrap`, {
172
- variants: {
173
- size: {
174
- small: "text-sm",
175
- medium: "text-sm",
176
- large: "text-base"
177
- }
178
- },
179
- defaultVariants: {
180
- size: "medium"
181
- }
199
+ variants: { size: {
200
+ small: "text-sm",
201
+ medium: "text-sm",
202
+ large: "text-base"
203
+ } },
204
+ defaultVariants: { size: "medium" }
182
205
  });
183
-
184
206
  const DEFAULT_ITEMS_COUNT = 5;
185
- /**
186
- * Normalizes an arbitrary `itemsCount` value into a safe positive integer.
187
- * Numeric strings are converted, fractional values are floored, and
188
- * non-finite values fall back to the default.
189
- */
190
207
  function normalizeItemsCount(value) {
191
- if (typeof value === "string") {
192
- if (value.trim() === "") {
193
- return DEFAULT_ITEMS_COUNT;
194
- }
195
- value = Number(value);
196
- }
197
- if (typeof value !== "number" || !Number.isFinite(value)) {
198
- return DEFAULT_ITEMS_COUNT;
199
- }
200
- return Math.max(1, Math.floor(value));
208
+ if (typeof value === "string") {
209
+ if (value.trim() === "") return DEFAULT_ITEMS_COUNT;
210
+ value = Number(value);
211
+ }
212
+ if (typeof value !== "number" || !Number.isFinite(value)) return DEFAULT_ITEMS_COUNT;
213
+ return Math.max(1, Math.floor(value));
201
214
  }
202
- /**
203
- * Returns the interaction step for the given precision.
204
- */
205
215
  function getRatingStep(precision) {
206
- return precision === "half" ? 0.5 : 1;
216
+ return precision === "half" ? .5 : 1;
207
217
  }
208
- /**
209
- * Rounds a value to the nearest multiple of the given step while avoiding
210
- * floating-point drift. The result is constrained to one decimal place.
211
- */
212
218
  function normalizeToStep(value, step) {
213
- const normalized = Math.round((value + Number.EPSILON) / step) * step;
214
- return Number(normalized.toFixed(1));
219
+ const normalized = Math.round((value + Number.EPSILON) / step) * step;
220
+ return Number(normalized.toFixed(1));
215
221
  }
216
- /**
217
- * Normalizes an externally supplied value for rendering and interaction.
218
- * Non-finite values become `0`, out-of-range values are clamped to the
219
- * valid domain, and the result is snapped to the active precision step.
220
- */
221
222
  function normalizeRatingValue(value, itemsCount, precision) {
222
- if (typeof value !== "number" || !Number.isFinite(value)) {
223
- return 0;
224
- }
225
- const clamped = Math.max(0, Math.min(itemsCount, value));
226
- return Math.max(0, Math.min(itemsCount, normalizeToStep(clamped, getRatingStep(precision))));
223
+ if (typeof value !== "number" || !Number.isFinite(value)) return 0;
224
+ return Math.max(0, Math.min(itemsCount, normalizeToStep(Math.max(0, Math.min(itemsCount, value)), getRatingStep(precision))));
227
225
  }
228
- /**
229
- * Fill amount for one item in continuous selection mode: every item at or
230
- * below the display value fills fully, one boundary item fills partially.
231
- */
232
226
  function getContinuousItemFill(displayValue, itemValue) {
233
- return Math.max(0, Math.min(1, displayValue - (itemValue - 1)));
227
+ return Math.max(0, Math.min(1, displayValue - (itemValue - 1)));
234
228
  }
235
- /**
236
- * Fill amount for one item in single selection mode: only the item
237
- * representing the display value fills, possibly partially.
238
- */
239
229
  function getSingleItemFill(displayValue, itemValue) {
240
- if (displayValue === 0) {
241
- return 0;
242
- }
243
- const activeItem = Math.ceil(displayValue);
244
- if (itemValue !== activeItem) {
245
- return 0;
246
- }
247
- return Math.max(0, Math.min(1, displayValue - (itemValue - 1)));
230
+ if (displayValue === 0) return 0;
231
+ if (itemValue !== Math.ceil(displayValue)) return 0;
232
+ return Math.max(0, Math.min(1, displayValue - (itemValue - 1)));
248
233
  }
249
- /**
250
- * Converts a pointer position inside an item into a candidate rating value.
251
- * Whole-item precision always selects the full item; half precision splits
252
- * the item into two horizontal regions, honoring the effective text
253
- * direction so the first visual half maps to the lower value.
254
- */
255
234
  function getPointerRatingValue(args) {
256
- const { clientX, direction, itemRect, itemValue, precision } = args;
257
- if (precision === "item") {
258
- return itemValue;
259
- }
260
- let ratio = (clientX - itemRect.left) / itemRect.width;
261
- if (direction === "rtl") {
262
- ratio = 1 - ratio;
263
- }
264
- return ratio <= 0.5 ? itemValue - 0.5 : itemValue;
235
+ const { clientX, direction, itemRect, itemValue, precision } = args;
236
+ if (precision === "item") return itemValue;
237
+ let ratio = (clientX - itemRect.left) / itemRect.width;
238
+ if (direction === "rtl") ratio = 1 - ratio;
239
+ return ratio <= .5 ? itemValue - .5 : itemValue;
265
240
  }
266
-
267
241
  const ratingIcons = {
268
- circle: LucideCircle,
269
- diamond: LucideDiamond,
270
- flame: LucideFlame,
271
- heart: LucideHeart,
272
- star: LucideStar
242
+ circle: LucideCircle,
243
+ diamond: LucideDiamond,
244
+ flame: LucideFlame,
245
+ heart: LucideHeart,
246
+ star: LucideStar
273
247
  };
274
- class RatingComponent {
275
- #destroyRef;
276
- #direction;
277
- #i18n;
278
- #label;
279
- #zone;
280
- constructor() {
281
- this.#destroyRef = inject(DestroyRef);
282
- this.#direction = injectComponentDirection();
283
- this.#i18n = inject(MonaI18nService);
284
- this.#label = injectLabelAssociation({
285
- activate: () => this.focus(),
286
- ariaLabel: () => this.ariaLabel(),
287
- ariaLabelledBy: () => this.ariaLabelledBy()
288
- });
289
- this.#zone = inject(NgZone);
290
- this.activeState = computed(() => this.previewActive() ? "hovered" : "selected", /* @ts-ignore */
291
- ...(ngDevMode ? [{ debugName: "activeState" }] : /* istanbul ignore next */ []));
292
- this.containerClasses = computed(() => twMerge(ratingContainerThemeVariants(), this.userClass()), /* @ts-ignore */
293
- ...(ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []));
294
- this.controlClasses = computed(() => ratingControlThemeVariants({ size: this.size() }), /* @ts-ignore */
295
- ...(ngDevMode ? [{ debugName: "controlClasses" }] : /* istanbul ignore next */ []));
296
- this.controlElement = viewChild.required("ratingControl", /* @ts-ignore */
297
- ...(ngDevMode ? [{ debugName: "controlElement" }] : /* istanbul ignore next */ []));
298
- this.displayValue = computed(() => this.previewValue() ?? this.normalizedValue(), /* @ts-ignore */
299
- ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
300
- this.effectiveAriaLabelledBy = computed(() => {
301
- const labelledBy = this.#label.labelledBy();
302
- if (labelledBy) {
303
- return labelledBy;
304
- }
305
- if (!this.ariaLabel() && this.label()) {
306
- return this.labelId;
307
- }
308
- return null;
309
- }, /* @ts-ignore */
310
- ...(ngDevMode ? [{ debugName: "effectiveAriaLabelledBy" }] : /* istanbul ignore next */ []));
311
- this.effectiveAriaValueText = computed(() => {
312
- const custom = this.ariaValueText();
313
- if (custom) {
314
- return custom(this.normalizedValue(), this.itemsCount());
315
- }
316
- return this.normalizedValue() === 0
317
- ? this.messages().notRated
318
- : this.messages().valueText(this.normalizedValue(), this.itemsCount());
319
- }, /* @ts-ignore */
320
- ...(ngDevMode ? [{ debugName: "effectiveAriaValueText" }] : /* istanbul ignore next */ []));
321
- this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
322
- this.effectiveTabIndex = computed(() => (this.effectiveDisabled() ? -1 : this.tabindex()), /* @ts-ignore */
323
- ...(ngDevMode ? [{ debugName: "effectiveTabIndex" }] : /* istanbul ignore next */ []));
324
- this.hoveredTemplate = contentChild(RatingHoveredItemTemplateDirective, { ...(ngDevMode ? { debugName: "hoveredTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
325
- this.iconClasses = computed(() => ratingIconThemeVariants({ size: this.size() }), /* @ts-ignore */
326
- ...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
327
- this.iconToRender = computed(() => ratingIcons[this.icon()], /* @ts-ignore */
328
- ...(ngDevMode ? [{ debugName: "iconToRender" }] : /* istanbul ignore next */ []));
329
- this.interactionDisabled = computed(() => this.effectiveDisabled() || this.readonly(), /* @ts-ignore */
330
- ...(ngDevMode ? [{ debugName: "interactionDisabled" }] : /* istanbul ignore next */ []));
331
- this.interactionStep = computed(() => getRatingStep(this.precision()), /* @ts-ignore */
332
- ...(ngDevMode ? [{ debugName: "interactionStep" }] : /* istanbul ignore next */ []));
333
- this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.normalizedValue() === 0)), /* @ts-ignore */
334
- ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
335
- this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
336
- ...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
337
- this.itemClasses = computed(() => ratingItemThemeVariants({ size: this.size() }), /* @ts-ignore */
338
- ...(ngDevMode ? [{ debugName: "itemClasses" }] : /* istanbul ignore next */ []));
339
- this.itemTemplate = contentChild(RatingItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
340
- this.items = computed(() => range(1, this.itemsCount())
341
- .select(itemValue => ({ index: itemValue - 1, itemValue }))
342
- .toArray(), /* @ts-ignore */
343
- ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
344
- this.labelClasses = computed(() => ratingLabelThemeVariants({ size: this.size() }), /* @ts-ignore */
345
- ...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
346
- this.labelId = createElementControlId();
347
- this.messages = this.#i18n.componentMessages("rating", RATING_DEFAULT_MESSAGES);
348
- this.normalizedValue = computed(() => normalizeRatingValue(this.value(), this.itemsCount(), this.precision()), /* @ts-ignore */
349
- ...(ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []));
350
- this.overlayClipClasses = computed(() => ratingOverlayClipThemeVariants(), /* @ts-ignore */
351
- ...(ngDevMode ? [{ debugName: "overlayClipClasses" }] : /* istanbul ignore next */ []));
352
- this.overlayColor = computed(() => this.color() || "var(--color-primary)", /* @ts-ignore */
353
- ...(ngDevMode ? [{ debugName: "overlayColor" }] : /* istanbul ignore next */ []));
354
- this.overlayContentClasses = computed(() => ratingOverlayContentThemeVariants({ size: this.size() }), /* @ts-ignore */
355
- ...(ngDevMode ? [{ debugName: "overlayContentClasses" }] : /* istanbul ignore next */ []));
356
- this.overlayIconClasses = computed(() => ratingOverlayIconThemeVariants({ size: this.size() }), /* @ts-ignore */
357
- ...(ngDevMode ? [{ debugName: "overlayIconClasses" }] : /* istanbul ignore next */ []));
358
- this.overlayTemplate = computed(() => this.activeState() === "hovered" ? this.hoveredTemplate() : this.selectedTemplate(), /* @ts-ignore */
359
- ...(ngDevMode ? [{ debugName: "overlayTemplate" }] : /* istanbul ignore next */ []));
360
- this.previewActive = computed(() => this.previewValue() !== null, /* @ts-ignore */
361
- ...(ngDevMode ? [{ debugName: "previewActive" }] : /* istanbul ignore next */ []));
362
- this.previewValue = signal(null, /* @ts-ignore */
363
- ...(ngDevMode ? [{ debugName: "previewValue" }] : /* istanbul ignore next */ []));
364
- this.selectedTemplate = contentChild(RatingSelectedItemTemplateDirective, { ...(ngDevMode ? { debugName: "selectedTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
365
- /**
366
- * @description Associates help text or an error description with the focusable rating control.
367
- * @default null
368
- */
369
- this.ariaDescribedBy = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
370
- /**
371
- * @description Explicit accessible name for the rating control. Provide `aria-label`,
372
- * `aria-labelledby`, or `label` so assistive technology can announce the control.
373
- * @default null
374
- */
375
- this.ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
376
- /**
377
- * @description IDs of external elements providing the accessible name for the rating control.
378
- * @default null
379
- */
380
- this.ariaLabelledBy = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
381
- /**
382
- * @description Custom screen-reader value announcement. Receives the normalized value and the
383
- * item count and returns the string to expose through `aria-valuetext`.
384
- * @default null
385
- */
386
- this.ariaValueText = input(null, /* @ts-ignore */
387
- ...(ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []));
388
- /**
389
- * @description Lets a click on the current value clear the rating, so pointer and touch users can undo one. The
390
- * keyboard can always clear it with Home.
391
- * @default false
392
- */
393
- this.clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
394
- /**
395
- * @description CSS color for selected and hovered rating visuals. Empty, `null`, and `undefined` values use the
396
- * primary theme color.
397
- * @default undefined
398
- */
399
- this.color = input(/* @ts-ignore */
400
- ...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
401
- /**
402
- * @description Disables pointer and keyboard interaction and removes the control from the tab
403
- * sequence. When bound to a signal form field via `[formField]`, this is written by the signal
404
- * forms `Field` directive.
405
- * @default false
406
- */
407
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
408
- /**
409
- * @description Built-in icon used for the default rating visuals. Choose `star`, `heart`,
410
- * `circle`, `diamond`, or `flame`; use item templates to supply a custom icon.
411
- * @default "star"
412
- */
413
- this.icon = input("star", /* @ts-ignore */
414
- ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
415
- /**
416
- * @description Marks the component as invalid. Error styling requires both `invalid` and
417
- * `touched` to be `true`. When bound to a signal form field via `[formField]`, this is written
418
- * by the signal forms `Field` directive.
419
- * @default false
420
- */
421
- this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
422
- /**
423
- * @description Number of rating items. Fractional values are floored and values below one are
424
- * raised to one.
425
- * @default 5
426
- */
427
- this.itemsCount = input(5, { ...(ngDevMode ? { debugName: "itemsCount" } : /* istanbul ignore next */ {}), transform: normalizeItemsCount });
428
- /**
429
- * @description Optional visible label rendered before or after the rating items. When no
430
- * explicit `aria-label` or `aria-labelledby` is supplied, the label provides the accessible
431
- * name.
432
- * @default null
433
- */
434
- this.label = input(null, /* @ts-ignore */
435
- ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
436
- /**
437
- * @description Places the visible label before or after the item group.
438
- * @default "after"
439
- */
440
- this.labelPosition = input("after", /* @ts-ignore */
441
- ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
442
- /**
443
- * @description Selection granularity of the rating.
444
- * @default "item"
445
- */
446
- this.precision = input("item", /* @ts-ignore */
447
- ...(ngDevMode ? [{ debugName: "precision" }] : /* istanbul ignore next */ []));
448
- /**
449
- * @description Prevents value changes while preserving focusability and normal visual emphasis.
450
- * @default false
451
- */
452
- this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
453
- /**
454
- * @description Shows the invalid state while the rating is `0` and the control is touched. The `required` rule of
455
- * signal forms doesn't treat `0` as empty, so it won't fail the form by itself: use `min(path, 1)` to reject an
456
- * unrated value. When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
457
- * @default false
458
- */
459
- this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
460
- /**
461
- * @description Controls cumulative or single-item filling.
462
- * @default "continuous"
463
- */
464
- this.selection = input("continuous", /* @ts-ignore */
465
- ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
466
- /**
467
- * @description Size preset controlling the icon dimensions, item hitboxes, spacing, and label
468
- * typography.
469
- * @default "medium"
470
- */
471
- this.size = input("medium", /* @ts-ignore */
472
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
473
- /**
474
- * @description Tab index applied to the focusable rating control when not disabled. Accepts a
475
- * numeric string and converts it to a number.
476
- * @default 0
477
- */
478
- this.tabindex = input(0, { ...(ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {}), transform: (value) => numberAttribute(value, 0) });
479
- /**
480
- * @description Emitted when the control loses focus or a pointer commits a rating, marking the field as touched.
481
- */
482
- this.touch = output();
483
- /**
484
- * @description Marks the component as touched. When bound to a signal form field via
485
- * `[formField]`, this is written by the signal forms `Field` directive.
486
- * @default false
487
- */
488
- this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
489
- /**
490
- * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
491
- * @default ""
492
- */
493
- this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
494
- /**
495
- * @description Current rating value. `0` represents an unrated state. Values are normalized
496
- * for rendering but are not rewritten until the user interacts with the component.
497
- * @default 0
498
- */
499
- this.value = model(0, /* @ts-ignore */
500
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
501
- afterNextRender(() => {
502
- const control = this.controlElement().nativeElement;
503
- // Outside the template, so a pointer moving over the items doesn't check the view on every event.
504
- const onPointerMove = (event) => this.onPointerMove(event);
505
- this.#zone.runOutsideAngular(() => control.addEventListener("pointermove", onPointerMove));
506
- this.#destroyRef.onDestroy(() => control.removeEventListener("pointermove", onPointerMove));
507
- if (isDevMode() && !this.ariaLabel() && !this.effectiveAriaLabelledBy()) {
508
- console.warn("[Mona Rating] A rating needs an accessible name. Set aria-label, aria-labelledby or label, or " +
509
- "use a mona-label.", control);
510
- }
511
- });
512
- }
513
- /** Blurs the inner slider control if focused. */
514
- blur() {
515
- this.controlElement().nativeElement.blur();
516
- }
517
- /** Focuses the inner slider control. Does nothing while disabled. */
518
- focus(options) {
519
- if (!this.effectiveDisabled()) {
520
- this.controlElement().nativeElement.focus(options);
521
- }
522
- }
523
- /**
524
- * @internal
525
- */
526
- setLabelledBy(id) {
527
- this.#label.setLabelledBy(id);
528
- }
529
- createItemContext(item) {
530
- return {
531
- $implicit: item.index,
532
- fill: this.getItemFill(item.itemValue),
533
- hovered: this.previewActive(),
534
- index: item.index,
535
- itemValue: item.itemValue,
536
- selected: !this.previewActive()
537
- };
538
- }
539
- getItemFill(itemValue) {
540
- const displayValue = this.displayValue();
541
- if (this.selection() === "single") {
542
- return getSingleItemFill(displayValue, itemValue);
543
- }
544
- return getContinuousItemFill(displayValue, itemValue);
545
- }
546
- onBlur() {
547
- this.previewValue.set(null);
548
- this.touch.emit();
549
- }
550
- onClick(event) {
551
- if (this.interactionDisabled()) {
552
- return;
553
- }
554
- const candidate = this.getCandidateFromPointerEvent(event);
555
- if (candidate === null) {
556
- return;
557
- }
558
- const normalized = this.normalizeCandidate(candidate);
559
- if (normalized !== this.normalizedValue()) {
560
- this.value.set(normalized);
561
- }
562
- else if (this.clearable()) {
563
- this.previewValue.set(null);
564
- this.value.set(0);
565
- }
566
- this.touch.emit();
567
- }
568
- onKeydown(event) {
569
- if (this.interactionDisabled()) {
570
- return;
571
- }
572
- const action = this.getKeyAction(event.key);
573
- if (action === null) {
574
- return;
575
- }
576
- event.preventDefault();
577
- this.previewValue.set(null);
578
- const current = this.normalizedValue();
579
- let next;
580
- switch (action) {
581
- case "decrease":
582
- next = this.normalizeCandidate(current - this.interactionStep());
583
- break;
584
- case "end":
585
- next = this.itemsCount();
586
- break;
587
- case "home":
588
- next = 0;
589
- break;
590
- case "increase":
591
- next = this.normalizeCandidate(current + this.interactionStep());
592
- break;
593
- case "pageDecrease":
594
- next = this.normalizeCandidate(current - 1);
595
- break;
596
- case "pageIncrease":
597
- next = this.normalizeCandidate(current + 1);
598
- break;
599
- }
600
- if (next !== current) {
601
- this.value.set(next);
602
- }
603
- }
604
- onPointerLeave() {
605
- this.previewValue.set(null);
606
- }
607
- onPointerMove(event) {
608
- if (this.interactionDisabled()) {
609
- return;
610
- }
611
- const candidate = this.getCandidateFromPointerEvent(event);
612
- if (candidate !== null) {
613
- this.previewValue.set(candidate);
614
- }
615
- }
616
- getCandidateFromPointerEvent(event) {
617
- const controlElement = this.controlElement().nativeElement;
618
- const target = event.target;
619
- const itemElement = target?.closest("[data-rating-index]") ?? null;
620
- if (!itemElement || !controlElement.contains(itemElement)) {
621
- return null;
622
- }
623
- const itemValue = Number(itemElement.getAttribute("data-rating-value"));
624
- // A whole-item rating doesn't depend on where in the item the pointer is, so it needs no layout read.
625
- if (this.precision() === "item") {
626
- return itemValue;
627
- }
628
- const itemRect = itemElement.getBoundingClientRect();
629
- const direction = getComputedStyle(controlElement).direction === "rtl" ? "rtl" : "ltr";
630
- return getPointerRatingValue({
631
- clientX: event.clientX,
632
- direction,
633
- itemRect,
634
- itemValue,
635
- precision: this.precision()
636
- });
637
- }
638
- getKeyAction(key) {
639
- const isRtl = this.isRtl();
640
- const decreaseKey = isRtl ? "ArrowRight" : "ArrowLeft";
641
- const increaseKey = isRtl ? "ArrowLeft" : "ArrowRight";
642
- switch (key) {
643
- case increaseKey:
644
- case "ArrowUp":
645
- return "increase";
646
- case decreaseKey:
647
- case "ArrowDown":
648
- return "decrease";
649
- case "Home":
650
- return "home";
651
- case "End":
652
- return "end";
653
- case "PageDown":
654
- return "pageDecrease";
655
- case "PageUp":
656
- return "pageIncrease";
657
- default:
658
- return null;
659
- }
660
- }
661
- normalizeCandidate(value) {
662
- return normalizeRatingValue(value, this.itemsCount(), this.precision());
663
- }
664
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
665
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RatingComponent, isStandalone: true, selector: "mona-rating", inputs: { ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", 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 }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "ariaValueText", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, itemsCount: { classPropertyName: "itemsCount", publicName: "itemsCount", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", 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 }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, queries: [{ propertyName: "hoveredTemplate", first: true, predicate: RatingHoveredItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: RatingItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "selectedTemplate", first: true, predicate: RatingSelectedItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "controlElement", first: true, predicate: ["ratingControl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"containerClasses()\">\n @if (label() && labelPosition() === \"before\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n\n <div\n #ratingControl\n role=\"slider\"\n [class]=\"controlClasses()\"\n [attr.tabindex]=\"effectiveTabIndex()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"itemsCount()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"effectiveAriaValueText()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"effectiveAriaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.data-disabled]=\"effectiveDisabled() || null\"\n [attr.data-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.data-precision]=\"precision()\"\n [attr.data-selection]=\"selection()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick($event)\">\n @for (item of items(); track item.itemValue) {\n <span\n [class]=\"itemClasses()\"\n [attr.data-rating-index]=\"item.index\"\n [attr.data-rating-value]=\"item.itemValue\"\n aria-hidden=\"true\">\n <span class=\"flex h-full w-full items-center justify-center\">\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg lucideIcon [lucideIcon]=\"iconToRender()\" [class]=\"iconClasses()\" fill=\"none\"></svg>\n }\n </span>\n\n @let fill = getItemFill(item.itemValue);\n\n @if (fill > 0) {\n <span [class]=\"overlayClipClasses()\" [style.inline-size.%]=\"fill * 100\">\n <span\n [class]=\"overlayContentClasses()\"\n [attr.data-state]=\"activeState()\"\n [style.color]=\"effectiveDisabled() ? null : overlayColor()\">\n @if (overlayTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"overlayTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg\n lucideIcon\n [lucideIcon]=\"iconToRender()\"\n [class]=\"overlayIconClasses()\"\n fill=\"currentColor\"></svg>\n }\n </span>\n </span>\n }\n </span>\n }\n </div>\n\n @if (label() && labelPosition() === \"after\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }] }); }
666
- }
667
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RatingComponent, decorators: [{
668
- type: Component,
669
- args: [{ selector: "mona-rating", imports: [NgTemplateOutlet, LucideDynamicIcon], template: "<div [class]=\"containerClasses()\">\n @if (label() && labelPosition() === \"before\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n\n <div\n #ratingControl\n role=\"slider\"\n [class]=\"controlClasses()\"\n [attr.tabindex]=\"effectiveTabIndex()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"itemsCount()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"effectiveAriaValueText()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"effectiveAriaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.data-disabled]=\"effectiveDisabled() || null\"\n [attr.data-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.data-precision]=\"precision()\"\n [attr.data-selection]=\"selection()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick($event)\">\n @for (item of items(); track item.itemValue) {\n <span\n [class]=\"itemClasses()\"\n [attr.data-rating-index]=\"item.index\"\n [attr.data-rating-value]=\"item.itemValue\"\n aria-hidden=\"true\">\n <span class=\"flex h-full w-full items-center justify-center\">\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg lucideIcon [lucideIcon]=\"iconToRender()\" [class]=\"iconClasses()\" fill=\"none\"></svg>\n }\n </span>\n\n @let fill = getItemFill(item.itemValue);\n\n @if (fill > 0) {\n <span [class]=\"overlayClipClasses()\" [style.inline-size.%]=\"fill * 100\">\n <span\n [class]=\"overlayContentClasses()\"\n [attr.data-state]=\"activeState()\"\n [style.color]=\"effectiveDisabled() ? null : overlayColor()\">\n @if (overlayTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"overlayTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg\n lucideIcon\n [lucideIcon]=\"iconToRender()\"\n [class]=\"overlayIconClasses()\"\n fill=\"currentColor\"></svg>\n }\n </span>\n </span>\n }\n </span>\n }\n </div>\n\n @if (label() && labelPosition() === \"after\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n</div>\n" }]
670
- }], ctorParameters: () => [], propDecorators: { controlElement: [{ type: i0.ViewChild, args: ["ratingControl", { isSignal: true }] }], hoveredTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RatingHoveredItemTemplateDirective), { ...{
671
- read: TemplateRef
672
- }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RatingItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], selectedTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RatingSelectedItemTemplateDirective), { ...{
673
- read: TemplateRef
674
- }, isSignal: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", 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 }] }], ariaValueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaValueText", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], itemsCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemsCount", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], precision: [{ type: i0.Input, args: [{ isSignal: true, alias: "precision", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", 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"] }] } });
675
-
676
- /*
677
- * Public API Surface of @nanahoshi/mona-ui/rating
678
- */
679
-
680
- /**
681
- * Generated bundle index. Do not edit.
682
- */
683
-
248
+ var RatingComponent = class RatingComponent {
249
+ #destroyRef;
250
+ #direction;
251
+ #i18n;
252
+ #label;
253
+ #zone;
254
+ constructor() {
255
+ this.#destroyRef = inject(DestroyRef);
256
+ this.#direction = injectComponentDirection();
257
+ this.#i18n = inject(MonaI18nService);
258
+ this.#label = injectLabelAssociation({
259
+ activate: () => this.focus(),
260
+ ariaLabel: () => this.ariaLabel(),
261
+ ariaLabelledBy: () => this.ariaLabelledBy()
262
+ });
263
+ this.#zone = inject(NgZone);
264
+ this.activeState = computed(() => this.previewActive() ? "hovered" : "selected", ...ngDevMode ? [{ debugName: "activeState" }] : /* istanbul ignore next */ []);
265
+ this.containerClasses = computed(() => twMerge(ratingContainerThemeVariants(), this.userClass()), ...ngDevMode ? [{ debugName: "containerClasses" }] : /* istanbul ignore next */ []);
266
+ this.controlClasses = computed(() => ratingControlThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "controlClasses" }] : /* istanbul ignore next */ []);
267
+ this.controlElement = viewChild.required("ratingControl", ...ngDevMode ? [{ debugName: "controlElement" }] : /* istanbul ignore next */ []);
268
+ this.displayValue = computed(() => this.previewValue() ?? this.normalizedValue(), ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
269
+ this.effectiveAriaLabelledBy = computed(() => {
270
+ const labelledBy = this.#label.labelledBy();
271
+ if (labelledBy) return labelledBy;
272
+ if (!this.ariaLabel() && this.label()) return this.labelId;
273
+ return null;
274
+ }, ...ngDevMode ? [{ debugName: "effectiveAriaLabelledBy" }] : /* istanbul ignore next */ []);
275
+ this.effectiveAriaValueText = computed(() => {
276
+ const custom = this.ariaValueText();
277
+ if (custom) return custom(this.normalizedValue(), this.itemsCount());
278
+ return this.normalizedValue() === 0 ? this.messages().notRated : this.messages().valueText(this.normalizedValue(), this.itemsCount());
279
+ }, ...ngDevMode ? [{ debugName: "effectiveAriaValueText" }] : /* istanbul ignore next */ []);
280
+ this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
281
+ this.effectiveTabIndex = computed(() => this.effectiveDisabled() ? -1 : this.tabindex(), ...ngDevMode ? [{ debugName: "effectiveTabIndex" }] : /* istanbul ignore next */ []);
282
+ this.hoveredTemplate = contentChild(RatingHoveredItemTemplateDirective, {
283
+ ...ngDevMode ? { debugName: "hoveredTemplate" } : /* istanbul ignore next */ {},
284
+ read: TemplateRef
285
+ });
286
+ this.iconClasses = computed(() => ratingIconThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []);
287
+ this.iconToRender = computed(() => ratingIcons[this.icon()], ...ngDevMode ? [{ debugName: "iconToRender" }] : /* istanbul ignore next */ []);
288
+ this.interactionDisabled = computed(() => this.effectiveDisabled() || this.readonly(), ...ngDevMode ? [{ debugName: "interactionDisabled" }] : /* istanbul ignore next */ []);
289
+ this.interactionStep = computed(() => getRatingStep(this.precision()), ...ngDevMode ? [{ debugName: "interactionStep" }] : /* istanbul ignore next */ []);
290
+ this.invalidState = computed(() => this.touched() && (this.invalid() || this.required() && this.normalizedValue() === 0), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
291
+ this.isRtl = computed(() => this.#direction() === "rtl", ...ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []);
292
+ this.itemClasses = computed(() => ratingItemThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "itemClasses" }] : /* istanbul ignore next */ []);
293
+ this.itemTemplate = contentChild(RatingItemTemplateDirective, {
294
+ ...ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {},
295
+ read: TemplateRef
296
+ });
297
+ this.items = computed(() => range(1, this.itemsCount()).select((itemValue) => ({
298
+ index: itemValue - 1,
299
+ itemValue
300
+ })).toArray(), ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
301
+ this.labelClasses = computed(() => ratingLabelThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []);
302
+ this.labelId = createElementControlId();
303
+ this.messages = this.#i18n.componentMessages("rating", RATING_DEFAULT_MESSAGES);
304
+ this.normalizedValue = computed(() => normalizeRatingValue(this.value(), this.itemsCount(), this.precision()), ...ngDevMode ? [{ debugName: "normalizedValue" }] : /* istanbul ignore next */ []);
305
+ this.overlayClipClasses = computed(() => ratingOverlayClipThemeVariants(), ...ngDevMode ? [{ debugName: "overlayClipClasses" }] : /* istanbul ignore next */ []);
306
+ this.overlayColor = computed(() => this.color() || "var(--color-primary)", ...ngDevMode ? [{ debugName: "overlayColor" }] : /* istanbul ignore next */ []);
307
+ this.overlayContentClasses = computed(() => ratingOverlayContentThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "overlayContentClasses" }] : /* istanbul ignore next */ []);
308
+ this.overlayIconClasses = computed(() => ratingOverlayIconThemeVariants({ size: this.size() }), ...ngDevMode ? [{ debugName: "overlayIconClasses" }] : /* istanbul ignore next */ []);
309
+ this.overlayTemplate = computed(() => this.activeState() === "hovered" ? this.hoveredTemplate() : this.selectedTemplate(), ...ngDevMode ? [{ debugName: "overlayTemplate" }] : /* istanbul ignore next */ []);
310
+ this.previewActive = computed(() => this.previewValue() !== null, ...ngDevMode ? [{ debugName: "previewActive" }] : /* istanbul ignore next */ []);
311
+ this.previewValue = signal(null, ...ngDevMode ? [{ debugName: "previewValue" }] : /* istanbul ignore next */ []);
312
+ this.selectedTemplate = contentChild(RatingSelectedItemTemplateDirective, {
313
+ ...ngDevMode ? { debugName: "selectedTemplate" } : /* istanbul ignore next */ {},
314
+ read: TemplateRef
315
+ });
316
+ this.ariaDescribedBy = input(null, {
317
+ ...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
318
+ alias: "aria-describedby"
319
+ });
320
+ this.ariaLabel = input(null, {
321
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
322
+ alias: "aria-label"
323
+ });
324
+ this.ariaLabelledBy = input(null, {
325
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
326
+ alias: "aria-labelledby"
327
+ });
328
+ this.ariaValueText = input(null, ...ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []);
329
+ this.clearable = input(false, {
330
+ ...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
331
+ transform: booleanAttribute
332
+ });
333
+ this.color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
334
+ this.disabled = input(false, {
335
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
336
+ transform: booleanAttribute
337
+ });
338
+ this.icon = input("star", ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
339
+ this.invalid = input(false, {
340
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
341
+ transform: booleanAttribute
342
+ });
343
+ this.itemsCount = input(5, {
344
+ ...ngDevMode ? { debugName: "itemsCount" } : /* istanbul ignore next */ {},
345
+ transform: normalizeItemsCount
346
+ });
347
+ this.label = input(null, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
348
+ this.labelPosition = input("after", ...ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []);
349
+ this.precision = input("item", ...ngDevMode ? [{ debugName: "precision" }] : /* istanbul ignore next */ []);
350
+ this.readonly = input(false, {
351
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
352
+ transform: booleanAttribute
353
+ });
354
+ this.required = input(false, {
355
+ ...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
356
+ transform: booleanAttribute
357
+ });
358
+ this.selection = input("continuous", ...ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []);
359
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
360
+ this.tabindex = input(0, {
361
+ ...ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {},
362
+ transform: (value) => numberAttribute(value, 0)
363
+ });
364
+ this.touch = output();
365
+ this.touched = input(false, {
366
+ ...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
367
+ transform: booleanAttribute
368
+ });
369
+ this.userClass = input("", {
370
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
371
+ alias: "class"
372
+ });
373
+ this.value = model(0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
374
+ afterNextRender(() => {
375
+ const control = this.controlElement().nativeElement;
376
+ const onPointerMove = (event) => this.onPointerMove(event);
377
+ this.#zone.runOutsideAngular(() => control.addEventListener("pointermove", onPointerMove));
378
+ this.#destroyRef.onDestroy(() => control.removeEventListener("pointermove", onPointerMove));
379
+ if (isDevMode() && !this.ariaLabel() && !this.effectiveAriaLabelledBy()) console.warn("[Mona Rating] A rating needs an accessible name. Set aria-label, aria-labelledby or label, or use a mona-label.", control);
380
+ });
381
+ }
382
+ blur() {
383
+ this.controlElement().nativeElement.blur();
384
+ }
385
+ focus(options) {
386
+ if (!this.effectiveDisabled()) this.controlElement().nativeElement.focus(options);
387
+ }
388
+ setLabelledBy(id) {
389
+ this.#label.setLabelledBy(id);
390
+ }
391
+ createItemContext(item) {
392
+ return {
393
+ $implicit: item.index,
394
+ fill: this.getItemFill(item.itemValue),
395
+ hovered: this.previewActive(),
396
+ index: item.index,
397
+ itemValue: item.itemValue,
398
+ selected: !this.previewActive()
399
+ };
400
+ }
401
+ getItemFill(itemValue) {
402
+ const displayValue = this.displayValue();
403
+ if (this.selection() === "single") return getSingleItemFill(displayValue, itemValue);
404
+ return getContinuousItemFill(displayValue, itemValue);
405
+ }
406
+ onBlur() {
407
+ this.previewValue.set(null);
408
+ this.touch.emit();
409
+ }
410
+ onClick(event) {
411
+ if (this.interactionDisabled()) return;
412
+ const candidate = this.getCandidateFromPointerEvent(event);
413
+ if (candidate === null) return;
414
+ const normalized = this.normalizeCandidate(candidate);
415
+ if (normalized !== this.normalizedValue()) this.value.set(normalized);
416
+ else if (this.clearable()) {
417
+ this.previewValue.set(null);
418
+ this.value.set(0);
419
+ }
420
+ this.touch.emit();
421
+ }
422
+ onKeydown(event) {
423
+ if (this.interactionDisabled()) return;
424
+ const action = this.getKeyAction(event.key);
425
+ if (action === null) return;
426
+ event.preventDefault();
427
+ this.previewValue.set(null);
428
+ const current = this.normalizedValue();
429
+ let next;
430
+ switch (action) {
431
+ case "decrease":
432
+ next = this.normalizeCandidate(current - this.interactionStep());
433
+ break;
434
+ case "end":
435
+ next = this.itemsCount();
436
+ break;
437
+ case "home":
438
+ next = 0;
439
+ break;
440
+ case "increase":
441
+ next = this.normalizeCandidate(current + this.interactionStep());
442
+ break;
443
+ case "pageDecrease":
444
+ next = this.normalizeCandidate(current - 1);
445
+ break;
446
+ case "pageIncrease": next = this.normalizeCandidate(current + 1);
447
+ }
448
+ if (next !== current) this.value.set(next);
449
+ }
450
+ onPointerLeave() {
451
+ this.previewValue.set(null);
452
+ }
453
+ onPointerMove(event) {
454
+ if (this.interactionDisabled()) return;
455
+ const candidate = this.getCandidateFromPointerEvent(event);
456
+ if (candidate !== null) this.previewValue.set(candidate);
457
+ }
458
+ getCandidateFromPointerEvent(event) {
459
+ const controlElement = this.controlElement().nativeElement;
460
+ const itemElement = event.target?.closest("[data-rating-index]") ?? null;
461
+ if (!itemElement || !controlElement.contains(itemElement)) return null;
462
+ const itemValue = Number(itemElement.getAttribute("data-rating-value"));
463
+ if (this.precision() === "item") return itemValue;
464
+ const itemRect = itemElement.getBoundingClientRect();
465
+ const direction = getComputedStyle(controlElement).direction === "rtl" ? "rtl" : "ltr";
466
+ return getPointerRatingValue({
467
+ clientX: event.clientX,
468
+ direction,
469
+ itemRect,
470
+ itemValue,
471
+ precision: this.precision()
472
+ });
473
+ }
474
+ getKeyAction(key) {
475
+ const isRtl = this.isRtl();
476
+ const decreaseKey = isRtl ? "ArrowRight" : "ArrowLeft";
477
+ const increaseKey = isRtl ? "ArrowLeft" : "ArrowRight";
478
+ switch (key) {
479
+ case increaseKey:
480
+ case "ArrowUp": return "increase";
481
+ case decreaseKey:
482
+ case "ArrowDown": return "decrease";
483
+ case "Home": return "home";
484
+ case "End": return "end";
485
+ case "PageDown": return "pageDecrease";
486
+ case "PageUp": return "pageIncrease";
487
+ default: return null;
488
+ }
489
+ }
490
+ normalizeCandidate(value) {
491
+ return normalizeRatingValue(value, this.itemsCount(), this.precision());
492
+ }
493
+ static {
494
+ this.ɵfac = i0.ɵɵngDeclareFactory({
495
+ minVersion: "12.0.0",
496
+ version: "22.2.6",
497
+ ngImport: i0,
498
+ type: RatingComponent,
499
+ deps: [],
500
+ target: i0.ɵɵFactoryTarget.Component
501
+ });
502
+ }
503
+ static {
504
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
505
+ minVersion: "17.0.0",
506
+ version: "22.2.6",
507
+ type: RatingComponent,
508
+ isStandalone: true,
509
+ selector: "mona-rating",
510
+ inputs: {
511
+ ariaDescribedBy: {
512
+ classPropertyName: "ariaDescribedBy",
513
+ publicName: "aria-describedby",
514
+ isSignal: true,
515
+ isRequired: false,
516
+ transformFunction: null
517
+ },
518
+ ariaLabel: {
519
+ classPropertyName: "ariaLabel",
520
+ publicName: "aria-label",
521
+ isSignal: true,
522
+ isRequired: false,
523
+ transformFunction: null
524
+ },
525
+ ariaLabelledBy: {
526
+ classPropertyName: "ariaLabelledBy",
527
+ publicName: "aria-labelledby",
528
+ isSignal: true,
529
+ isRequired: false,
530
+ transformFunction: null
531
+ },
532
+ ariaValueText: {
533
+ classPropertyName: "ariaValueText",
534
+ publicName: "ariaValueText",
535
+ isSignal: true,
536
+ isRequired: false,
537
+ transformFunction: null
538
+ },
539
+ clearable: {
540
+ classPropertyName: "clearable",
541
+ publicName: "clearable",
542
+ isSignal: true,
543
+ isRequired: false,
544
+ transformFunction: null
545
+ },
546
+ color: {
547
+ classPropertyName: "color",
548
+ publicName: "color",
549
+ isSignal: true,
550
+ isRequired: false,
551
+ transformFunction: null
552
+ },
553
+ disabled: {
554
+ classPropertyName: "disabled",
555
+ publicName: "disabled",
556
+ isSignal: true,
557
+ isRequired: false,
558
+ transformFunction: null
559
+ },
560
+ icon: {
561
+ classPropertyName: "icon",
562
+ publicName: "icon",
563
+ isSignal: true,
564
+ isRequired: false,
565
+ transformFunction: null
566
+ },
567
+ invalid: {
568
+ classPropertyName: "invalid",
569
+ publicName: "invalid",
570
+ isSignal: true,
571
+ isRequired: false,
572
+ transformFunction: null
573
+ },
574
+ itemsCount: {
575
+ classPropertyName: "itemsCount",
576
+ publicName: "itemsCount",
577
+ isSignal: true,
578
+ isRequired: false,
579
+ transformFunction: null
580
+ },
581
+ label: {
582
+ classPropertyName: "label",
583
+ publicName: "label",
584
+ isSignal: true,
585
+ isRequired: false,
586
+ transformFunction: null
587
+ },
588
+ labelPosition: {
589
+ classPropertyName: "labelPosition",
590
+ publicName: "labelPosition",
591
+ isSignal: true,
592
+ isRequired: false,
593
+ transformFunction: null
594
+ },
595
+ precision: {
596
+ classPropertyName: "precision",
597
+ publicName: "precision",
598
+ isSignal: true,
599
+ isRequired: false,
600
+ transformFunction: null
601
+ },
602
+ readonly: {
603
+ classPropertyName: "readonly",
604
+ publicName: "readonly",
605
+ isSignal: true,
606
+ isRequired: false,
607
+ transformFunction: null
608
+ },
609
+ required: {
610
+ classPropertyName: "required",
611
+ publicName: "required",
612
+ isSignal: true,
613
+ isRequired: false,
614
+ transformFunction: null
615
+ },
616
+ selection: {
617
+ classPropertyName: "selection",
618
+ publicName: "selection",
619
+ isSignal: true,
620
+ isRequired: false,
621
+ transformFunction: null
622
+ },
623
+ size: {
624
+ classPropertyName: "size",
625
+ publicName: "size",
626
+ isSignal: true,
627
+ isRequired: false,
628
+ transformFunction: null
629
+ },
630
+ tabindex: {
631
+ classPropertyName: "tabindex",
632
+ publicName: "tabindex",
633
+ isSignal: true,
634
+ isRequired: false,
635
+ transformFunction: null
636
+ },
637
+ touched: {
638
+ classPropertyName: "touched",
639
+ publicName: "touched",
640
+ isSignal: true,
641
+ isRequired: false,
642
+ transformFunction: null
643
+ },
644
+ userClass: {
645
+ classPropertyName: "userClass",
646
+ publicName: "class",
647
+ isSignal: true,
648
+ isRequired: false,
649
+ transformFunction: null
650
+ },
651
+ value: {
652
+ classPropertyName: "value",
653
+ publicName: "value",
654
+ isSignal: true,
655
+ isRequired: false,
656
+ transformFunction: null
657
+ }
658
+ },
659
+ outputs: {
660
+ touch: "touch",
661
+ value: "valueChange"
662
+ },
663
+ queries: [
664
+ {
665
+ propertyName: "hoveredTemplate",
666
+ first: true,
667
+ predicate: RatingHoveredItemTemplateDirective,
668
+ descendants: true,
669
+ read: TemplateRef,
670
+ isSignal: true
671
+ },
672
+ {
673
+ propertyName: "itemTemplate",
674
+ first: true,
675
+ predicate: RatingItemTemplateDirective,
676
+ descendants: true,
677
+ read: TemplateRef,
678
+ isSignal: true
679
+ },
680
+ {
681
+ propertyName: "selectedTemplate",
682
+ first: true,
683
+ predicate: RatingSelectedItemTemplateDirective,
684
+ descendants: true,
685
+ read: TemplateRef,
686
+ isSignal: true
687
+ }
688
+ ],
689
+ viewQueries: [{
690
+ propertyName: "controlElement",
691
+ first: true,
692
+ predicate: ["ratingControl"],
693
+ descendants: true,
694
+ isSignal: true
695
+ }],
696
+ ngImport: i0,
697
+ template: "<div [class]=\"containerClasses()\">\n @if (label() && labelPosition() === \"before\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n\n <div\n #ratingControl\n role=\"slider\"\n [class]=\"controlClasses()\"\n [attr.tabindex]=\"effectiveTabIndex()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"itemsCount()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"effectiveAriaValueText()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"effectiveAriaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.data-disabled]=\"effectiveDisabled() || null\"\n [attr.data-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.data-precision]=\"precision()\"\n [attr.data-selection]=\"selection()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick($event)\">\n @for (item of items(); track item.itemValue) {\n <span\n [class]=\"itemClasses()\"\n [attr.data-rating-index]=\"item.index\"\n [attr.data-rating-value]=\"item.itemValue\"\n aria-hidden=\"true\">\n <span class=\"flex h-full w-full items-center justify-center\">\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg lucideIcon [lucideIcon]=\"iconToRender()\" [class]=\"iconClasses()\" fill=\"none\"></svg>\n }\n </span>\n\n @let fill = getItemFill(item.itemValue);\n\n @if (fill > 0) {\n <span [class]=\"overlayClipClasses()\" [style.inline-size.%]=\"fill * 100\">\n <span\n [class]=\"overlayContentClasses()\"\n [attr.data-state]=\"activeState()\"\n [style.color]=\"effectiveDisabled() ? null : overlayColor()\">\n @if (overlayTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"overlayTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg\n lucideIcon\n [lucideIcon]=\"iconToRender()\"\n [class]=\"overlayIconClasses()\"\n fill=\"currentColor\"></svg>\n }\n </span>\n </span>\n }\n </span>\n }\n </div>\n\n @if (label() && labelPosition() === \"after\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n</div>\n",
698
+ dependencies: [{
699
+ kind: "directive",
700
+ type: NgTemplateOutlet,
701
+ selector: "[ngTemplateOutlet]",
702
+ inputs: [
703
+ "ngTemplateOutletContext",
704
+ "ngTemplateOutlet",
705
+ "ngTemplateOutletInjector"
706
+ ]
707
+ }, {
708
+ kind: "component",
709
+ type: LucideDynamicIcon,
710
+ selector: "svg[lucideIcon]",
711
+ inputs: ["lucideIcon"]
712
+ }]
713
+ });
714
+ }
715
+ };
716
+ i0.ɵɵngDeclareClassMetadata({
717
+ minVersion: "12.0.0",
718
+ version: "22.2.6",
719
+ ngImport: i0,
720
+ type: RatingComponent,
721
+ decorators: [{
722
+ type: Component,
723
+ args: [{
724
+ selector: "mona-rating",
725
+ imports: [NgTemplateOutlet, LucideDynamicIcon],
726
+ template: "<div [class]=\"containerClasses()\">\n @if (label() && labelPosition() === \"before\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n\n <div\n #ratingControl\n role=\"slider\"\n [class]=\"controlClasses()\"\n [attr.tabindex]=\"effectiveTabIndex()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"itemsCount()\"\n [attr.aria-valuenow]=\"normalizedValue()\"\n [attr.aria-valuetext]=\"effectiveAriaValueText()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"effectiveAriaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.aria-disabled]=\"effectiveDisabled() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"invalidState() || null\"\n [attr.data-disabled]=\"effectiveDisabled() || null\"\n [attr.data-readonly]=\"readonly() || null\"\n [attr.data-invalid]=\"invalidState() || null\"\n [attr.data-precision]=\"precision()\"\n [attr.data-selection]=\"selection()\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"onBlur()\"\n (pointerleave)=\"onPointerLeave()\"\n (click)=\"onClick($event)\">\n @for (item of items(); track item.itemValue) {\n <span\n [class]=\"itemClasses()\"\n [attr.data-rating-index]=\"item.index\"\n [attr.data-rating-value]=\"item.itemValue\"\n aria-hidden=\"true\">\n <span class=\"flex h-full w-full items-center justify-center\">\n @if (itemTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg lucideIcon [lucideIcon]=\"iconToRender()\" [class]=\"iconClasses()\" fill=\"none\"></svg>\n }\n </span>\n\n @let fill = getItemFill(item.itemValue);\n\n @if (fill > 0) {\n <span [class]=\"overlayClipClasses()\" [style.inline-size.%]=\"fill * 100\">\n <span\n [class]=\"overlayContentClasses()\"\n [attr.data-state]=\"activeState()\"\n [style.color]=\"effectiveDisabled() ? null : overlayColor()\">\n @if (overlayTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"overlayTemplate()!\"\n [ngTemplateOutletContext]=\"createItemContext(item)\">\n </ng-container>\n } @else {\n <svg\n lucideIcon\n [lucideIcon]=\"iconToRender()\"\n [class]=\"overlayIconClasses()\"\n fill=\"currentColor\"></svg>\n }\n </span>\n </span>\n }\n </span>\n }\n </div>\n\n @if (label() && labelPosition() === \"after\") {\n <span [id]=\"labelId\" [class]=\"labelClasses()\">{{ label() }}</span>\n }\n</div>\n"
727
+ }]
728
+ }],
729
+ ctorParameters: () => [],
730
+ propDecorators: {
731
+ controlElement: [{
732
+ type: i0.ViewChild,
733
+ args: ["ratingControl", { isSignal: true }]
734
+ }],
735
+ hoveredTemplate: [{
736
+ type: i0.ContentChild,
737
+ args: [i0.forwardRef(() => RatingHoveredItemTemplateDirective), {
738
+ read: TemplateRef,
739
+ isSignal: true
740
+ }]
741
+ }],
742
+ itemTemplate: [{
743
+ type: i0.ContentChild,
744
+ args: [i0.forwardRef(() => RatingItemTemplateDirective), {
745
+ read: TemplateRef,
746
+ isSignal: true
747
+ }]
748
+ }],
749
+ selectedTemplate: [{
750
+ type: i0.ContentChild,
751
+ args: [i0.forwardRef(() => RatingSelectedItemTemplateDirective), {
752
+ read: TemplateRef,
753
+ isSignal: true
754
+ }]
755
+ }],
756
+ ariaDescribedBy: [{
757
+ type: i0.Input,
758
+ args: [{
759
+ isSignal: true,
760
+ alias: "aria-describedby",
761
+ required: false
762
+ }]
763
+ }],
764
+ ariaLabel: [{
765
+ type: i0.Input,
766
+ args: [{
767
+ isSignal: true,
768
+ alias: "aria-label",
769
+ required: false
770
+ }]
771
+ }],
772
+ ariaLabelledBy: [{
773
+ type: i0.Input,
774
+ args: [{
775
+ isSignal: true,
776
+ alias: "aria-labelledby",
777
+ required: false
778
+ }]
779
+ }],
780
+ ariaValueText: [{
781
+ type: i0.Input,
782
+ args: [{
783
+ isSignal: true,
784
+ alias: "ariaValueText",
785
+ required: false
786
+ }]
787
+ }],
788
+ clearable: [{
789
+ type: i0.Input,
790
+ args: [{
791
+ isSignal: true,
792
+ alias: "clearable",
793
+ required: false
794
+ }]
795
+ }],
796
+ color: [{
797
+ type: i0.Input,
798
+ args: [{
799
+ isSignal: true,
800
+ alias: "color",
801
+ required: false
802
+ }]
803
+ }],
804
+ disabled: [{
805
+ type: i0.Input,
806
+ args: [{
807
+ isSignal: true,
808
+ alias: "disabled",
809
+ required: false
810
+ }]
811
+ }],
812
+ icon: [{
813
+ type: i0.Input,
814
+ args: [{
815
+ isSignal: true,
816
+ alias: "icon",
817
+ required: false
818
+ }]
819
+ }],
820
+ invalid: [{
821
+ type: i0.Input,
822
+ args: [{
823
+ isSignal: true,
824
+ alias: "invalid",
825
+ required: false
826
+ }]
827
+ }],
828
+ itemsCount: [{
829
+ type: i0.Input,
830
+ args: [{
831
+ isSignal: true,
832
+ alias: "itemsCount",
833
+ required: false
834
+ }]
835
+ }],
836
+ label: [{
837
+ type: i0.Input,
838
+ args: [{
839
+ isSignal: true,
840
+ alias: "label",
841
+ required: false
842
+ }]
843
+ }],
844
+ labelPosition: [{
845
+ type: i0.Input,
846
+ args: [{
847
+ isSignal: true,
848
+ alias: "labelPosition",
849
+ required: false
850
+ }]
851
+ }],
852
+ precision: [{
853
+ type: i0.Input,
854
+ args: [{
855
+ isSignal: true,
856
+ alias: "precision",
857
+ required: false
858
+ }]
859
+ }],
860
+ readonly: [{
861
+ type: i0.Input,
862
+ args: [{
863
+ isSignal: true,
864
+ alias: "readonly",
865
+ required: false
866
+ }]
867
+ }],
868
+ required: [{
869
+ type: i0.Input,
870
+ args: [{
871
+ isSignal: true,
872
+ alias: "required",
873
+ required: false
874
+ }]
875
+ }],
876
+ selection: [{
877
+ type: i0.Input,
878
+ args: [{
879
+ isSignal: true,
880
+ alias: "selection",
881
+ required: false
882
+ }]
883
+ }],
884
+ size: [{
885
+ type: i0.Input,
886
+ args: [{
887
+ isSignal: true,
888
+ alias: "size",
889
+ required: false
890
+ }]
891
+ }],
892
+ tabindex: [{
893
+ type: i0.Input,
894
+ args: [{
895
+ isSignal: true,
896
+ alias: "tabindex",
897
+ required: false
898
+ }]
899
+ }],
900
+ touch: [{
901
+ type: i0.Output,
902
+ args: ["touch"]
903
+ }],
904
+ touched: [{
905
+ type: i0.Input,
906
+ args: [{
907
+ isSignal: true,
908
+ alias: "touched",
909
+ required: false
910
+ }]
911
+ }],
912
+ userClass: [{
913
+ type: i0.Input,
914
+ args: [{
915
+ isSignal: true,
916
+ alias: "class",
917
+ required: false
918
+ }]
919
+ }],
920
+ value: [{
921
+ type: i0.Input,
922
+ args: [{
923
+ isSignal: true,
924
+ alias: "value",
925
+ required: false
926
+ }]
927
+ }, {
928
+ type: i0.Output,
929
+ args: ["valueChange"]
930
+ }]
931
+ }
932
+ });
684
933
  export { RATING_DEFAULT_MESSAGES, RatingComponent, RatingHoveredItemTemplateDirective, RatingItemTemplateDirective, RatingSelectedItemTemplateDirective };
685
- //# sourceMappingURL=nanahoshi-mona-ui-rating.mjs.map
934
+
935
+ //# sourceMappingURL=nanahoshi-mona-ui-rating.mjs.map