mood-ui 0.10.0 → 0.12.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 (351) hide show
  1. package/dist/components/data-display/Chart.cjs +6 -0
  2. package/dist/components/data-display/Chart.cjs.map +1 -0
  3. package/dist/components/data-display/Chart.mjs +7 -0
  4. package/dist/components/data-display/Chart.mjs.map +1 -0
  5. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.cjs +48 -0
  6. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  7. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.mjs +47 -0
  8. package/dist/components/data-display/Chart.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  9. package/dist/components/data-display/Stat.cjs.map +1 -1
  10. package/dist/components/data-display/Stat.mjs.map +1 -1
  11. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.cjs +88 -75
  12. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  13. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.mjs +90 -77
  14. package/dist/components/data-display/Stat.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  15. package/dist/components/data-display/calendar/AgendaView.cjs.map +1 -1
  16. package/dist/components/data-display/calendar/AgendaView.mjs.map +1 -1
  17. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs +4 -1
  18. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  19. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs +4 -1
  20. package/dist/components/data-display/calendar/AgendaView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  21. package/dist/components/data-display/calendar/DayView.cjs.map +1 -1
  22. package/dist/components/data-display/calendar/DayView.mjs.map +1 -1
  23. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs +7 -4
  24. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  25. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs +7 -4
  26. package/dist/components/data-display/calendar/DayView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  27. package/dist/components/data-display/calendar/MonthView.cjs +1 -1
  28. package/dist/components/data-display/calendar/MonthView.cjs.map +1 -1
  29. package/dist/components/data-display/calendar/MonthView.mjs +1 -1
  30. package/dist/components/data-display/calendar/MonthView.mjs.map +1 -1
  31. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs +8 -12
  32. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  33. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs +8 -12
  34. package/dist/components/data-display/calendar/MonthView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  35. package/dist/components/data-display/calendar/Scheduler.cjs.map +1 -1
  36. package/dist/components/data-display/calendar/Scheduler.mjs.map +1 -1
  37. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs +7 -4
  38. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  39. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs +7 -4
  40. package/dist/components/data-display/calendar/Scheduler.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  41. package/dist/components/data-display/calendar/WeekView.cjs.map +1 -1
  42. package/dist/components/data-display/calendar/WeekView.mjs.map +1 -1
  43. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs +7 -4
  44. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  45. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs +7 -4
  46. package/dist/components/data-display/calendar/WeekView.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  47. package/dist/components/data-display/chart/Cartesian.cjs +6 -0
  48. package/dist/components/data-display/chart/Cartesian.cjs.map +1 -0
  49. package/dist/components/data-display/chart/Cartesian.mjs +7 -0
  50. package/dist/components/data-display/chart/Cartesian.mjs.map +1 -0
  51. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.cjs +573 -0
  52. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  53. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.mjs +572 -0
  54. package/dist/components/data-display/chart/Cartesian.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  55. package/dist/components/data-display/chart/Heatmap.cjs +6 -0
  56. package/dist/components/data-display/chart/Heatmap.cjs.map +1 -0
  57. package/dist/components/data-display/chart/Heatmap.mjs +7 -0
  58. package/dist/components/data-display/chart/Heatmap.mjs.map +1 -0
  59. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.cjs +332 -0
  60. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  61. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.mjs +331 -0
  62. package/dist/components/data-display/chart/Heatmap.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  63. package/dist/components/data-display/chart/Polar.cjs +6 -0
  64. package/dist/components/data-display/chart/Polar.cjs.map +1 -0
  65. package/dist/components/data-display/chart/Polar.mjs +7 -0
  66. package/dist/components/data-display/chart/Polar.mjs.map +1 -0
  67. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.cjs +361 -0
  68. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  69. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.mjs +360 -0
  70. package/dist/components/data-display/chart/Polar.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  71. package/dist/components/data-display/chart/Radar.cjs +6 -0
  72. package/dist/components/data-display/chart/Radar.cjs.map +1 -0
  73. package/dist/components/data-display/chart/Radar.mjs +7 -0
  74. package/dist/components/data-display/chart/Radar.mjs.map +1 -0
  75. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.cjs +347 -0
  76. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  77. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.mjs +346 -0
  78. package/dist/components/data-display/chart/Radar.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  79. package/dist/components/data-display/chart/Sparkline.cjs +6 -0
  80. package/dist/components/data-display/chart/Sparkline.cjs.map +1 -0
  81. package/dist/components/data-display/chart/Sparkline.mjs +7 -0
  82. package/dist/components/data-display/chart/Sparkline.mjs.map +1 -0
  83. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.cjs +293 -0
  84. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  85. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.mjs +292 -0
  86. package/dist/components/data-display/chart/Sparkline.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  87. package/dist/components/data-display/chart/useChart.cjs +189 -0
  88. package/dist/components/data-display/chart/useChart.cjs.map +1 -0
  89. package/dist/components/data-display/chart/useChart.mjs +182 -0
  90. package/dist/components/data-display/chart/useChart.mjs.map +1 -0
  91. package/dist/components/data-display/date-picker/DateRangePicker.cjs.map +1 -1
  92. package/dist/components/data-display/date-picker/DateRangePicker.mjs.map +1 -1
  93. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.cjs +1 -7
  94. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  95. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs +1 -7
  96. package/dist/components/data-display/date-picker/DateRangePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  97. package/dist/components/data-display/date-picker/DateTimePicker.cjs.map +1 -1
  98. package/dist/components/data-display/date-picker/DateTimePicker.mjs.map +1 -1
  99. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
  100. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  101. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
  102. package/dist/components/data-display/date-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  103. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.cjs +1 -1
  104. package/dist/components/data-display/table/Table.vue_vue_type_script_setup_true_lang.mjs +1 -1
  105. package/dist/components/feedback/Drawer.cjs.map +1 -1
  106. package/dist/components/feedback/Drawer.mjs.map +1 -1
  107. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs +4 -9
  108. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  109. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs +4 -9
  110. package/dist/components/feedback/Drawer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  111. package/dist/components/feedback/Modal.cjs.map +1 -1
  112. package/dist/components/feedback/Modal.mjs.map +1 -1
  113. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs +4 -9
  114. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  115. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs +4 -9
  116. package/dist/components/feedback/Modal.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  117. package/dist/components/feedback/Tooltip.cjs.map +1 -1
  118. package/dist/components/feedback/Tooltip.mjs.map +1 -1
  119. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs +64 -20
  120. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  121. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs +64 -20
  122. package/dist/components/feedback/Tooltip.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  123. package/dist/components/forms/Button.cjs +1 -1
  124. package/dist/components/forms/Button.cjs.map +1 -1
  125. package/dist/components/forms/Button.mjs +1 -1
  126. package/dist/components/forms/Button.mjs.map +1 -1
  127. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs +76 -63
  128. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  129. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs +77 -64
  130. package/dist/components/forms/Button.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  131. package/dist/components/forms/ButtonGroup.cjs +1 -1
  132. package/dist/components/forms/ButtonGroup.cjs.map +1 -1
  133. package/dist/components/forms/ButtonGroup.mjs +1 -1
  134. package/dist/components/forms/ButtonGroup.mjs.map +1 -1
  135. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.cjs +2 -2
  136. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  137. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.mjs +2 -2
  138. package/dist/components/forms/ButtonGroup.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  139. package/dist/components/forms/Checkbox.cjs +1 -1
  140. package/dist/components/forms/Checkbox.cjs.map +1 -1
  141. package/dist/components/forms/Checkbox.mjs +1 -1
  142. package/dist/components/forms/Checkbox.mjs.map +1 -1
  143. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.cjs +7 -7
  144. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  145. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.mjs +7 -7
  146. package/dist/components/forms/Checkbox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  147. package/dist/components/forms/ColorPicker.vue_vue_type_script_setup_true_lang.cjs +1 -1
  148. package/dist/components/forms/ColorPicker.vue_vue_type_script_setup_true_lang.mjs +1 -1
  149. package/dist/components/forms/Combobox.cjs.map +1 -1
  150. package/dist/components/forms/Combobox.mjs.map +1 -1
  151. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs +4 -4
  152. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  153. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs +4 -4
  154. package/dist/components/forms/Combobox.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  155. package/dist/components/forms/DateField.vue_vue_type_script_setup_true_lang.cjs +2 -2
  156. package/dist/components/forms/DateField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  157. package/dist/components/forms/DateRangeField.vue_vue_type_script_setup_true_lang.cjs +2 -2
  158. package/dist/components/forms/DateRangeField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  159. package/dist/components/forms/DateTimeField.vue_vue_type_script_setup_true_lang.cjs +2 -2
  160. package/dist/components/forms/DateTimeField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  161. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  162. package/dist/components/forms/FileInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  163. package/dist/components/forms/FormField.vue_vue_type_script_setup_true_lang.cjs +1 -1
  164. package/dist/components/forms/FormField.vue_vue_type_script_setup_true_lang.mjs +1 -1
  165. package/dist/components/forms/Input.vue_vue_type_script_setup_true_lang.cjs +1 -1
  166. package/dist/components/forms/Input.vue_vue_type_script_setup_true_lang.mjs +1 -1
  167. package/dist/components/forms/MenuButton.cjs +6 -0
  168. package/dist/components/forms/MenuButton.cjs.map +1 -0
  169. package/dist/components/forms/MenuButton.mjs +7 -0
  170. package/dist/components/forms/MenuButton.mjs.map +1 -0
  171. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.cjs +270 -0
  172. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  173. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.mjs +269 -0
  174. package/dist/components/forms/MenuButton.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  175. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.cjs +2 -2
  176. package/dist/components/forms/MultiSelect.vue_vue_type_script_setup_true_lang.mjs +2 -2
  177. package/dist/components/forms/NumberInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  178. package/dist/components/forms/NumberInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  179. package/dist/components/forms/OTPInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  180. package/dist/components/forms/OTPInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  181. package/dist/components/forms/PasswordInput.vue_vue_type_script_setup_true_lang.cjs +1 -1
  182. package/dist/components/forms/PasswordInput.vue_vue_type_script_setup_true_lang.mjs +1 -1
  183. package/dist/components/forms/PhoneInput.cjs.map +1 -1
  184. package/dist/components/forms/PhoneInput.mjs.map +1 -1
  185. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs +8 -3
  186. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  187. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs +8 -3
  188. package/dist/components/forms/PhoneInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  189. package/dist/components/forms/Radio.cjs +1 -1
  190. package/dist/components/forms/Radio.cjs.map +1 -1
  191. package/dist/components/forms/Radio.mjs +1 -1
  192. package/dist/components/forms/Radio.mjs.map +1 -1
  193. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.cjs +6 -6
  194. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  195. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.mjs +6 -6
  196. package/dist/components/forms/Radio.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  197. package/dist/components/forms/RangeSlider.cjs.map +1 -1
  198. package/dist/components/forms/RangeSlider.mjs.map +1 -1
  199. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.cjs +6 -6
  200. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  201. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.mjs +6 -6
  202. package/dist/components/forms/RangeSlider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  203. package/dist/components/forms/SearchInput.cjs.map +1 -1
  204. package/dist/components/forms/SearchInput.mjs.map +1 -1
  205. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs +230 -23
  206. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  207. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs +232 -25
  208. package/dist/components/forms/SearchInput.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  209. package/dist/components/forms/Segmented.cjs +1 -1
  210. package/dist/components/forms/Segmented.cjs.map +1 -1
  211. package/dist/components/forms/Segmented.mjs +1 -1
  212. package/dist/components/forms/Segmented.mjs.map +1 -1
  213. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.cjs +4 -12
  214. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  215. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.mjs +4 -12
  216. package/dist/components/forms/Segmented.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  217. package/dist/components/forms/Select.vue_vue_type_script_setup_true_lang.cjs +2 -2
  218. package/dist/components/forms/Select.vue_vue_type_script_setup_true_lang.mjs +2 -2
  219. package/dist/components/forms/Slider.cjs.map +1 -1
  220. package/dist/components/forms/Slider.mjs.map +1 -1
  221. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.cjs +6 -6
  222. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  223. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.mjs +6 -6
  224. package/dist/components/forms/Slider.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  225. package/dist/components/forms/Switch.cjs +1 -1
  226. package/dist/components/forms/Switch.cjs.map +1 -1
  227. package/dist/components/forms/Switch.mjs +1 -1
  228. package/dist/components/forms/Switch.mjs.map +1 -1
  229. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.cjs +7 -7
  230. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  231. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.mjs +7 -7
  232. package/dist/components/forms/Switch.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  233. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.cjs +1 -1
  234. package/dist/components/forms/Textarea.vue_vue_type_script_setup_true_lang.mjs +1 -1
  235. package/dist/components/layout/AppShell.cjs.map +1 -1
  236. package/dist/components/layout/AppShell.mjs.map +1 -1
  237. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.cjs +8 -8
  238. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  239. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.mjs +8 -8
  240. package/dist/components/layout/AppShell.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  241. package/dist/components/layout/PopoverPanel.cjs +1 -1
  242. package/dist/components/layout/PopoverPanel.cjs.map +1 -1
  243. package/dist/components/layout/PopoverPanel.mjs +1 -1
  244. package/dist/components/layout/PopoverPanel.mjs.map +1 -1
  245. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs +2 -2
  246. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  247. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs +2 -2
  248. package/dist/components/layout/PopoverPanel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  249. package/dist/components/layout/Sidebar.cjs.map +1 -1
  250. package/dist/components/layout/Sidebar.mjs.map +1 -1
  251. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.cjs +36 -21
  252. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  253. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.mjs +36 -21
  254. package/dist/components/layout/Sidebar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  255. package/dist/components/layout/Topbar.cjs.map +1 -1
  256. package/dist/components/layout/Topbar.mjs.map +1 -1
  257. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.cjs +2 -2
  258. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  259. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.mjs +2 -2
  260. package/dist/components/layout/Topbar.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  261. package/dist/components/navigation/Switcher.cjs.map +1 -1
  262. package/dist/components/navigation/Switcher.mjs.map +1 -1
  263. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs +42 -44
  264. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  265. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs +42 -44
  266. package/dist/components/navigation/Switcher.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  267. package/dist/components/navigation/Tabs.cjs +1 -1
  268. package/dist/components/navigation/Tabs.cjs.map +1 -1
  269. package/dist/components/navigation/Tabs.mjs +1 -1
  270. package/dist/components/navigation/Tabs.mjs.map +1 -1
  271. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.cjs +1 -9
  272. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  273. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.mjs +1 -9
  274. package/dist/components/navigation/Tabs.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  275. package/dist/composables/eventColors.cjs +51 -27
  276. package/dist/composables/eventColors.cjs.map +1 -1
  277. package/dist/composables/eventColors.mjs +51 -27
  278. package/dist/composables/eventColors.mjs.map +1 -1
  279. package/dist/composables/useBodyScrollLock.cjs +44 -0
  280. package/dist/composables/useBodyScrollLock.cjs.map +1 -0
  281. package/dist/composables/useBodyScrollLock.mjs +43 -0
  282. package/dist/composables/useBodyScrollLock.mjs.map +1 -0
  283. package/dist/composables/useCalendarTheme.cjs +29 -8
  284. package/dist/composables/useCalendarTheme.cjs.map +1 -1
  285. package/dist/composables/useCalendarTheme.mjs +29 -8
  286. package/dist/composables/useCalendarTheme.mjs.map +1 -1
  287. package/dist/composables/useField.cjs +21 -23
  288. package/dist/composables/useField.cjs.map +1 -1
  289. package/dist/composables/useField.mjs +21 -24
  290. package/dist/composables/useField.mjs.map +1 -1
  291. package/dist/composables/usePopover.cjs +49 -13
  292. package/dist/composables/usePopover.cjs.map +1 -1
  293. package/dist/composables/usePopover.mjs +49 -13
  294. package/dist/composables/usePopover.mjs.map +1 -1
  295. package/dist/index.cjs +5 -1
  296. package/dist/index.mjs +4 -2
  297. package/dist/mood-ui.css +116 -482
  298. package/dist/types/components/data-display/Chart.vue.d.ts +8 -0
  299. package/dist/types/components/data-display/Stat.vue.d.ts +12 -2
  300. package/dist/types/components/data-display/chart/Cartesian.vue.d.ts +17 -0
  301. package/dist/types/components/data-display/chart/Heatmap.vue.d.ts +10 -0
  302. package/dist/types/components/data-display/chart/Polar.vue.d.ts +9 -0
  303. package/dist/types/components/data-display/chart/Radar.vue.d.ts +10 -0
  304. package/dist/types/components/data-display/chart/Sparkline.vue.d.ts +13 -0
  305. package/dist/types/components/data-display/chart/useChart.d.ts +49 -0
  306. package/dist/types/components/feedback/Drawer.vue.d.ts +2 -2
  307. package/dist/types/components/feedback/Modal.vue.d.ts +2 -2
  308. package/dist/types/components/feedback/Tooltip.vue.d.ts +1 -1
  309. package/dist/types/components/forms/Button.vue.d.ts +3 -2
  310. package/dist/types/components/forms/Combobox.vue.d.ts +3 -3
  311. package/dist/types/components/forms/DateField.vue.d.ts +3 -3
  312. package/dist/types/components/forms/DateRangeField.vue.d.ts +3 -3
  313. package/dist/types/components/forms/DateTimeField.vue.d.ts +3 -3
  314. package/dist/types/components/forms/MenuButton.vue.d.ts +23 -0
  315. package/dist/types/components/forms/MultiSelect.vue.d.ts +3 -3
  316. package/dist/types/components/forms/SearchInput.vue.d.ts +33 -2
  317. package/dist/types/components/forms/Select.vue.d.ts +2 -2
  318. package/dist/types/components/layout/AppShell.vue.d.ts +1 -1
  319. package/dist/types/components/layout/PageHeader.vue.d.ts +1 -1
  320. package/dist/types/components/layout/Sidebar.vue.d.ts +4 -4
  321. package/dist/types/components/layout/Stack.vue.d.ts +1 -1
  322. package/dist/types/components/layout/Topbar.vue.d.ts +1 -1
  323. package/dist/types/components/navigation/Breadcrumbs.vue.d.ts +1 -1
  324. package/dist/types/components/navigation/Switcher.vue.d.ts +3 -3
  325. package/dist/types/composables/eventColors.d.ts +2 -2
  326. package/dist/types/composables/useBodyScrollLock.d.ts +19 -0
  327. package/dist/types/composables/useCalendarTheme.d.ts +2 -0
  328. package/dist/types/composables/useField.d.ts +10 -0
  329. package/dist/types/composables/usePopover.d.ts +7 -0
  330. package/dist/types/index.d.ts +4 -0
  331. package/dist/types/interfaces/data-display/Chart.interface.d.ts +97 -0
  332. package/dist/types/interfaces/data-display/Stat.interface.d.ts +17 -6
  333. package/dist/types/interfaces/data-display/calendar/AgendaView.interface.d.ts +5 -0
  334. package/dist/types/interfaces/data-display/calendar/DayView.interface.d.ts +5 -0
  335. package/dist/types/interfaces/data-display/calendar/MonthView.interface.d.ts +5 -0
  336. package/dist/types/interfaces/data-display/calendar/Scheduler.interface.d.ts +5 -0
  337. package/dist/types/interfaces/data-display/calendar/WeekView.interface.d.ts +5 -0
  338. package/dist/types/interfaces/feedback/Tooltip.interface.d.ts +11 -0
  339. package/dist/types/interfaces/forms/MenuButton.interface.d.ts +38 -0
  340. package/dist/types/interfaces/forms/SearchInput.interface.d.ts +36 -0
  341. package/dist/types/utils/cssLength.d.ts +5 -0
  342. package/dist/types/utils/tooltipArrow.d.ts +34 -0
  343. package/dist/utils/cssLength.cjs +13 -0
  344. package/dist/utils/cssLength.cjs.map +1 -0
  345. package/dist/utils/cssLength.mjs +13 -0
  346. package/dist/utils/cssLength.mjs.map +1 -0
  347. package/dist/utils/tooltipArrow.cjs +37 -0
  348. package/dist/utils/tooltipArrow.cjs.map +1 -0
  349. package/dist/utils/tooltipArrow.mjs +36 -0
  350. package/dist/utils/tooltipArrow.mjs.map +1 -0
  351. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/forms/Combobox.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\"\n >*</span\n >\n </label>\n\n <div\n ref=\"wrapperEl\"\n :class=\"[\n 'modo-field-wrapper flex items-center gap-2',\n wrapperVariantClasses,\n wrapperSizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n role=\"combobox\"\n :aria-haspopup=\"'listbox'\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"listboxId\"\n :aria-owns=\"listboxId\"\n >\n <component\n :is=\"iconLeft\"\n v-if=\"iconLeft\"\n aria-hidden=\"true\"\n :class=\"['shrink-0', affordanceIconClass, iconSizeClasses]\"\n />\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n :value=\"modelValue ?? ''\"\n :placeholder=\"placeholder\"\n :disabled=\"isDisabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :maxlength=\"maxLength\"\n :aria-label=\"!label ? ariaLabel : undefined\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :aria-required=\"required || undefined\"\n :aria-autocomplete=\"'list'\"\n :aria-controls=\"listboxId\"\n :aria-expanded=\"isOpen\"\n :aria-activedescendant=\"isOpen && activeId ? activeId : undefined\"\n :class=\"[\n 'modo-field-native flex-1 min-w-0 bg-transparent p-0',\n 'text-foreground placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n inputTextClasses,\n ]\"\n @input=\"onInput\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n />\n\n <Loader\n v-if=\"loading || isLoadingAsync\"\n :size=\"size === 'large' ? 'medium' : 'small'\"\n :class=\"['shrink-0', affordanceIconClass]\"\n />\n\n <Button\n v-else-if=\"clearable && hasValue && !isDisabled && !readonly\"\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"XMarkIcon\"\n :ariaLabel=\"loc.combobox.clear\"\n tabindex=\"-1\"\n :class=\"['shrink-0', affordanceActionClass]\"\n @click=\"clear\"\n />\n\n <Button\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"ChevronDownIcon\"\n :ariaLabel=\"loc.combobox.toggleOptions\"\n tabindex=\"-1\"\n :class=\"[\n 'shrink-0',\n affordanceActionClass,\n 'transition-transform duration-base ease-standard',\n isOpen ? 'rotate-180' : '',\n ]\"\n @mousedown.prevent\n @click=\"onToggleClick\"\n />\n </div>\n\n <PopoverPanel\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"radius\"\n role=\"listbox\"\n :labelledBy=\"label ? fieldId : undefined\"\n @update:panelRef=\"panelRef = $event\"\n >\n <div class=\"flex flex-col max-h-72\">\n <ul\n :id=\"listboxId\"\n role=\"listbox\"\n class=\"modo-stagger flex-1 overflow-y-auto\"\n tabindex=\"-1\"\n >\n <li\n v-if=\"isLoadingAsync && displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ loadingText }}\n </li>\n <li\n v-else-if=\"displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ emptyText }}\n </li>\n\n <template\n v-for=\"(group, gi) in groupedOptions\"\n :key=\"group.name ?? gi\"\n >\n <li\n v-if=\"group.name\"\n class=\"px-3 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground\"\n role=\"presentation\"\n >\n {{ group.name }}\n </li>\n <li\n v-for=\"opt in group.items\"\n :id=\"optionDomId(String(opt.value))\"\n :key=\"String(opt.value)\"\n role=\"option\"\n :aria-selected=\"matchedOption?.value === opt.value\"\n :aria-disabled=\"opt.disabled || undefined\"\n :class=\"[\n 'flex items-center gap-2 px-3 py-2 text-body cursor-pointer select-none',\n 'transition-colors duration-fast ease-standard',\n opt.disabled\n ? 'text-muted-foreground/60 cursor-not-allowed'\n : ['text-foreground', optionHover],\n activeValue === opt.value && !opt.disabled ? optionSurface : '',\n matchedOption?.value === opt.value ? 'font-medium' : '',\n ]\"\n @pointerenter=\"setActive(opt.value)\"\n @mousedown.prevent\n @touchstart.prevent\n @click=\"selectOption(opt)\"\n >\n <component\n :is=\"opt.icon\"\n v-if=\"opt.icon\"\n aria-hidden=\"true\"\n :class=\"['w-4 h-4 shrink-0', affordanceIconClass]\"\n />\n <div class=\"flex-1 min-w-0\">\n <div class=\"truncate\">\n <Highlight :text=\"opt.label\" :query=\"modelValue ?? ''\" />\n </div>\n <div\n v-if=\"opt.description\"\n class=\"text-caption text-muted-foreground truncate\"\n >\n {{ opt.description }}\n </div>\n </div>\n <CheckIcon\n v-if=\"matchedOption?.value === opt.value\"\n :class=\"['w-4 h-4 shrink-0', checkColorClass]\"\n aria-hidden=\"true\"\n />\n </li>\n </template>\n </ul>\n <slot name=\"footer\" />\n </div>\n </PopoverPanel>\n\n <div\n v-if=\"errorText || helperText || showCounterEffective\"\n class=\"flex items-start gap-2\"\n >\n <Typography\n v-if=\"errorText\"\n :id=\"errorId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"danger\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ errorText }}\n </Typography>\n <Typography\n v-else-if=\"helperText\"\n :id=\"helperId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"muted\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ helperText }}\n </Typography>\n <p\n v-if=\"showCounterEffective\"\n :id=\"counterId\"\n :class=\"[\n 'text-caption ml-auto tabular-nums',\n counterOverflow ? 'text-destructive' : 'text-muted-foreground',\n ]\"\n >\n {{ currentLength }}/{{ maxLength }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineComponent, h, nextTick, ref, useId, watch } from \"vue\";\nimport type {\n Combobox as ComboboxProps,\n SelectOption,\n} from \"../../interfaces/forms/Combobox.interface\";\nimport {\n useFieldState,\n useFieldClasses,\n FIELD_AFFORDANCE_ACTION_BY_COLOR,\n FIELD_AFFORDANCE_ICON_BY_COLOR,\n} from \"../../composables/useField\";\nimport { usePopover } from \"../../composables/usePopover\";\nimport PopoverPanel from \"../layout/PopoverPanel.vue\";\nimport Typography from \"../data-display/Typography.vue\";\nimport Loader from \"../feedback/Loader.vue\";\nimport {\n ChevronDownIcon,\n XMarkIcon,\n CheckIcon,\n} from \"@heroicons/vue/24/outline\";\nimport Button from \"./Button.vue\";\nimport {\n useModoLocale,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\n\nconst loc = useModoLocale();\n\nconst props = withDefaults(defineProps<ComboboxProps>(), {\n modelValue: \"\",\n options: () => [],\n debounce: 250,\n minChars: 0,\n freeSolo: false,\n variant: \"outline\",\n color: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n loading: false,\n fullWidth: false,\n clearable: false,\n placeholder: \"Type to search…\",\n emptyText: \"No results.\",\n loadingText: \"Loading…\",\n autofocus: false,\n});\n\nconst sz = useSizeTokens(() => props.size);\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n change: [value: string, option: SelectOption | null];\n select: [option: SelectOption];\n open: [];\n close: [];\n clear: [];\n search: [query: string];\n}>();\n\nconst {\n fieldId,\n radius,\n stateColor,\n hasError,\n hasValue,\n isDisabled,\n currentLength,\n showCounterEffective,\n counterOverflow,\n errorId,\n helperId,\n counterId,\n describedBy,\n} = useFieldState(props, {\n componentName: \"Combobox\",\n idPrefix: \"modo-combobox\",\n});\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.variant,\n stateColor,\n hasError,\n radius,\n forceFocus: () => isOpen.value,\n halo: () => props.halo,\n});\n\n/* ---------- IDs ---------- */\nconst autoListboxId = useId();\nconst listboxId = computed(() => `modo-combobox-listbox-${autoListboxId}`);\nconst optionDomId = (v: string) => `${listboxId.value}-opt-${v}`;\n\n/* ---------- Options source (sync or async) ---------- */\n\nconst asyncOptions = ref<SelectOption[]>([]);\nconst isLoadingAsync = ref(false);\nlet loadTimer: number | null = null;\nlet loadRequestId = 0;\n\nwatch(\n () => props.modelValue,\n (q) => {\n if (!props.loadOptions) return;\n if (!isOpen.value) return;\n if ((q ?? \"\").length < props.minChars) {\n asyncOptions.value = [];\n return;\n }\n if (loadTimer !== null) clearTimeout(loadTimer);\n isLoadingAsync.value = true;\n const reqId = ++loadRequestId;\n loadTimer = window.setTimeout(async () => {\n try {\n const result = await props.loadOptions!(q ?? \"\");\n if (reqId === loadRequestId) asyncOptions.value = result;\n } finally {\n if (reqId === loadRequestId) isLoadingAsync.value = false;\n }\n emit(\"search\", q ?? \"\");\n }, props.debounce);\n },\n);\n\nconst sourceOptions = computed(() =>\n props.loadOptions ? asyncOptions.value : props.options,\n);\n\nconst displayedOptions = computed(() => {\n const q = (props.modelValue ?? \"\").trim().toLowerCase();\n // Si hay loadOptions, no filtramos localmente (confiamos en el backend).\n if (props.loadOptions) return sourceOptions.value;\n if (!q) return sourceOptions.value;\n return sourceOptions.value.filter(\n (o) =>\n o.label.toLowerCase().includes(q) ||\n (o.description ? o.description.toLowerCase().includes(q) : false),\n );\n});\n\ninterface OptionGroup {\n name?: string;\n items: SelectOption[];\n}\n\nconst groupedOptions = computed<OptionGroup[]>(() => {\n const list = displayedOptions.value;\n if (!list.some((o) => o.group)) {\n return list.length ? [{ items: list }] : [];\n }\n const map = new Map<string | undefined, SelectOption[]>();\n for (const opt of list) {\n const key = opt.group;\n if (!map.has(key)) map.set(key, []);\n map.get(key)!.push(opt);\n }\n const groups: OptionGroup[] = [];\n for (const [name, items] of map) groups.push({ name, items });\n return groups;\n});\n\nconst flatOptions = computed<SelectOption[]>(() =>\n groupedOptions.value.flatMap((g) => g.items),\n);\n\n/** Si el texto actual coincide exactamente (case-insensitive) con alguna opción, la devuelve. */\nconst matchedOption = computed<SelectOption | null>(() => {\n const v = (props.modelValue ?? \"\").trim().toLowerCase();\n if (!v) return null;\n return sourceOptions.value.find((o) => o.label.toLowerCase() === v) ?? null;\n});\n\n/* ---------- Color ---------- */\nconst CHECK_COLOR_BY_STATE: Record<string, string> = {\n default: \"text-foreground\",\n primary: \"text-primary\",\n danger: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n};\nconst checkColorClass = computed(\n () => CHECK_COLOR_BY_STATE[stateColor.value] ?? \"text-foreground\",\n);\nconst affordanceIconClass = computed(\n () =>\n FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? \"text-muted-foreground\",\n);\nconst affordanceActionClass = computed(\n () =>\n FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ??\n \"text-muted-foreground hover:text-foreground\",\n);\n\nconst OPTION_SURFACE: Record<string, string> = {\n default: \"bg-muted\",\n primary: \"bg-primary/10\",\n danger: \"bg-destructive/10\",\n success: \"bg-success/10\",\n warning: \"bg-warning/10\",\n};\nconst OPTION_HOVER: Record<string, string> = {\n default: \"hover:bg-muted\",\n primary: \"hover:bg-primary/10\",\n danger: \"hover:bg-destructive/10\",\n success: \"hover:bg-success/10\",\n warning: \"hover:bg-warning/10\",\n};\nconst optionSurface = computed(\n () => OPTION_SURFACE[stateColor.value] ?? \"bg-muted\",\n);\nconst optionHover = computed(\n () => OPTION_HOVER[stateColor.value] ?? \"hover:bg-muted\",\n);\n\n/* ---------- Popover ---------- */\n\nconst inputEl = ref<HTMLInputElement | null>(null);\nconst wrapperEl = ref<HTMLElement | null>(null);\nconst activeValue = ref<string | number | null>(null);\nconst activeId = computed(() =>\n activeValue.value !== null ? optionDomId(String(activeValue.value)) : \"\",\n);\n\nconst {\n triggerRef,\n panelRef,\n isOpen,\n panelStyle,\n open: openPopover,\n close: closePopover,\n} = usePopover({\n placement: \"bottom-start\",\n matchTriggerWidth: true,\n onOpen: () => {\n emit(\"open\");\n const initial =\n matchedOption.value ?? flatOptions.value.find((o) => !o.disabled);\n activeValue.value = initial ? initial.value : null;\n nextTick(scrollActiveIntoView);\n },\n onClose: () => {\n emit(\"close\");\n },\n});\n\nwatch(wrapperEl, (el) => (triggerRef.value = el));\n\nfunction setActive(v: string | number) {\n activeValue.value = v;\n}\n\nfunction scrollActiveIntoView() {\n if (activeValue.value === null) return;\n const el = document.getElementById(optionDomId(String(activeValue.value)));\n el?.scrollIntoView({ block: \"nearest\" });\n}\n\n/* ---------- Actions ---------- */\n\nfunction onInput(e: Event) {\n const next = (e.target as HTMLInputElement).value;\n emit(\"update:modelValue\", next);\n if (!isOpen.value) openPopover();\n // Activar la primera opción tras filtrar\n nextTick(() => {\n const first = flatOptions.value.find((o) => !o.disabled);\n activeValue.value = first ? first.value : null;\n });\n}\n\nfunction onFocus() {\n if (isDisabled.value || props.readonly) return;\n if (!isOpen.value) openPopover();\n}\n\nfunction onBlur() {\n // Delay para permitir el click en la opción (mousedown.prevent también ayuda).\n setTimeout(() => {\n // Si no es freeSolo y no hay match, resetea al último match válido (o vacío)\n if (!props.freeSolo) {\n const current = (props.modelValue ?? \"\").trim();\n if (current && !matchedOption.value) {\n // Revertir al label de la opción previa si había una\n emit(\"update:modelValue\", lastCommittedValue.value);\n }\n }\n closePopover();\n }, 120);\n}\n\nfunction onToggleClick() {\n if (isDisabled.value || props.readonly) return;\n if (isOpen.value) {\n closePopover();\n inputEl.value?.blur();\n } else {\n inputEl.value?.focus();\n }\n}\n\nconst lastCommittedValue = ref<string>(props.modelValue ?? \"\");\n\nfunction commit(value: string, opt: SelectOption | null) {\n lastCommittedValue.value = value;\n emit(\"update:modelValue\", value);\n emit(\"change\", value, opt);\n}\n\nfunction selectOption(opt: SelectOption) {\n if (opt.disabled) return;\n commit(opt.label, opt);\n emit(\"select\", opt);\n closePopover();\n inputEl.value?.blur();\n}\n\nfunction clear() {\n commit(\"\", null);\n emit(\"clear\");\n inputEl.value?.focus();\n}\n\n/* ---------- Keyboard ---------- */\n\nfunction moveActive(direction: 1 | -1) {\n const list = flatOptions.value.filter((o) => !o.disabled);\n if (list.length === 0) return;\n const currentIdx = list.findIndex((o) => o.value === activeValue.value);\n let nextIdx: number;\n if (currentIdx === -1) {\n nextIdx = direction > 0 ? 0 : list.length - 1;\n } else {\n nextIdx = (currentIdx + direction + list.length) % list.length;\n }\n activeValue.value = list[nextIdx].value;\n scrollActiveIntoView();\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (isDisabled.value || props.readonly) return;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(-1);\n break;\n case \"Enter\": {\n if (!isOpen.value) return;\n const opt = flatOptions.value.find((o) => o.value === activeValue.value);\n if (opt && !opt.disabled) {\n e.preventDefault();\n selectOption(opt);\n } else if (props.freeSolo) {\n e.preventDefault();\n commit(props.modelValue ?? \"\", null);\n // Keep panel open so the user sees the new value added to the list.\n // closePopover();\n }\n break;\n }\n case \"Escape\":\n if (isOpen.value) {\n e.preventDefault();\n closePopover();\n }\n break;\n case \"Tab\":\n // Dejar que Tab cierre naturalmente vía blur.\n break;\n }\n}\n\n/* ---------- Size maps ---------- */\n\nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\nconst inputTextClasses = computed(() => sz.value.text);\nconst iconSizeClasses = computed(() => sz.value.icon);\n\n/* ---------- Inline highlight helper ---------- */\nconst Highlight = defineComponent({\n name: \"ComboboxHighlight\",\n props: {\n text: { type: String, required: true },\n query: { type: String, required: true },\n },\n setup(p) {\n return () => {\n const q = (p.query ?? \"\").trim();\n if (!q) return h(\"span\", p.text);\n const idx = p.text.toLowerCase().indexOf(q.toLowerCase());\n if (idx === -1) return h(\"span\", p.text);\n const before = p.text.slice(0, idx);\n const match = p.text.slice(idx, idx + q.length);\n const after = p.text.slice(idx + q.length);\n return h(\"span\", [\n before,\n h(\n \"span\",\n {\n class:\n \"font-semibold text-foreground bg-primary/10 rounded-sm px-0.5\",\n },\n match,\n ),\n after,\n ]);\n };\n },\n});\n\n/* ---------- Sync committed value when controlling v-model externally ---------- */\nwatch(\n () => props.modelValue,\n (v) => {\n if (matchedOption.value) lastCommittedValue.value = v ?? \"\";\n },\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuQA,MAAM,MAAM,sBAAA,eAAe;EAE3B,MAAM,QAAQ;EAoBd,MAAM,KAAK,sBAAA,oBAAoB,MAAM,KAAK;EAE1C,MAAM,OAAO;EAUb,MAAM,EACJ,SACA,QACA,YACA,UACA,UACA,YACA,eACA,sBACA,iBACA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BAAK,CAAA,sCAAA,GAAA,IAAA,OAA6D,gBAAe,GAAA,qBAAA,wBAAA,CAAA;+CAK/E,cAAa,CAAA,GAAG,OAAA,GAAA,IAAA,iBAAI,QAAA,UAAS,EAAA,IAAA,YAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"Combobox.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/components/forms/Combobox.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\"\n >*</span\n >\n </label>\n\n <div\n ref=\"wrapperEl\"\n :class=\"[\n 'modo-field-wrapper flex items-center gap-2',\n wrapperVariantClasses,\n wrapperSizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n role=\"combobox\"\n :aria-haspopup=\"'listbox'\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"listboxId\"\n :aria-owns=\"listboxId\"\n >\n <component\n :is=\"iconLeft\"\n v-if=\"iconLeft\"\n aria-hidden=\"true\"\n :class=\"['shrink-0', affordanceIconClass, iconSizeClasses]\"\n />\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n :value=\"modelValue ?? ''\"\n :placeholder=\"placeholder\"\n :disabled=\"isDisabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :maxlength=\"maxLength\"\n :aria-label=\"!label ? ariaLabel : undefined\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :aria-required=\"required || undefined\"\n :aria-autocomplete=\"'list'\"\n :aria-controls=\"listboxId\"\n :aria-expanded=\"isOpen\"\n :aria-activedescendant=\"isOpen && activeId ? activeId : undefined\"\n :class=\"[\n 'modo-field-native flex-1 min-w-0 bg-transparent p-0',\n 'text-foreground placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n inputTextClasses,\n ]\"\n @input=\"onInput\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n />\n\n <Loader\n v-if=\"loading || isLoadingAsync\"\n :size=\"size === 'large' ? 'medium' : 'small'\"\n :class=\"['shrink-0', affordanceIconClass]\"\n />\n\n <Button\n v-else-if=\"clearable && hasValue && !isDisabled && !readonly\"\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"XMarkIcon\"\n :ariaLabel=\"loc.combobox.clear\"\n tabindex=\"-1\"\n :class=\"['shrink-0', affordanceActionClass]\"\n @click=\"clear\"\n />\n\n <Button\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"ChevronDownIcon\"\n :ariaLabel=\"loc.combobox.toggleOptions\"\n tabindex=\"-1\"\n :class=\"[\n 'shrink-0',\n affordanceActionClass,\n 'transition-transform duration-base ease-standard',\n isOpen ? 'rotate-180' : '',\n ]\"\n @mousedown.prevent\n @click=\"onToggleClick\"\n />\n </div>\n\n <PopoverPanel\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"radius\"\n role=\"listbox\"\n :labelledBy=\"label ? fieldId : undefined\"\n @update:panelRef=\"panelRef = $event\"\n >\n <div class=\"flex flex-col max-h-72\">\n <ul\n :id=\"listboxId\"\n role=\"listbox\"\n class=\"modo-stagger flex-1 overflow-y-auto\"\n tabindex=\"-1\"\n >\n <li\n v-if=\"isLoadingAsync && displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ loadingText }}\n </li>\n <li\n v-else-if=\"displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ emptyText }}\n </li>\n\n <template\n v-for=\"(group, gi) in groupedOptions\"\n :key=\"group.name ?? gi\"\n >\n <li\n v-if=\"group.name\"\n class=\"px-3 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground\"\n role=\"presentation\"\n >\n {{ group.name }}\n </li>\n <!--\n `mousedown.prevent` keeps focus in the input while an option is\n picked. There is deliberately no `touchstart.prevent` alongside\n it: cancelling touchstart tells the browser to suppress the\n compatibility mouse events *and* the click for that tap, so on a\n touch device the option became impossible to select at all.\n -->\n <li\n v-for=\"opt in group.items\"\n :id=\"optionDomId(String(opt.value))\"\n :key=\"String(opt.value)\"\n role=\"option\"\n :aria-selected=\"matchedOption?.value === opt.value\"\n :aria-disabled=\"opt.disabled || undefined\"\n :class=\"[\n 'flex items-center gap-2 px-3 py-2 text-body cursor-pointer select-none',\n 'transition-colors duration-fast ease-standard',\n opt.disabled\n ? 'text-muted-foreground/60 cursor-not-allowed'\n : ['text-foreground', optionHover],\n activeValue === opt.value && !opt.disabled ? optionSurface : '',\n matchedOption?.value === opt.value ? 'font-medium' : '',\n ]\"\n @pointerenter=\"setActive(opt.value)\"\n @mousedown.prevent\n @click=\"selectOption(opt)\"\n >\n <component\n :is=\"opt.icon\"\n v-if=\"opt.icon\"\n aria-hidden=\"true\"\n :class=\"['w-4 h-4 shrink-0', affordanceIconClass]\"\n />\n <div class=\"flex-1 min-w-0\">\n <div class=\"truncate\">\n <Highlight :text=\"opt.label\" :query=\"modelValue ?? ''\" />\n </div>\n <div\n v-if=\"opt.description\"\n class=\"text-caption text-muted-foreground truncate\"\n >\n {{ opt.description }}\n </div>\n </div>\n <CheckIcon\n v-if=\"matchedOption?.value === opt.value\"\n :class=\"['w-4 h-4 shrink-0', checkColorClass]\"\n aria-hidden=\"true\"\n />\n </li>\n </template>\n </ul>\n <slot name=\"footer\" />\n </div>\n </PopoverPanel>\n\n <div\n v-if=\"errorText || helperText || showCounterEffective\"\n class=\"flex items-start gap-2\"\n >\n <Typography\n v-if=\"errorText\"\n :id=\"errorId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"danger\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ errorText }}\n </Typography>\n <Typography\n v-else-if=\"helperText\"\n :id=\"helperId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"muted\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ helperText }}\n </Typography>\n <p\n v-if=\"showCounterEffective\"\n :id=\"counterId\"\n :class=\"[\n 'text-caption ml-auto tabular-nums',\n counterOverflow ? 'text-destructive' : 'text-muted-foreground',\n ]\"\n >\n {{ currentLength }}/{{ maxLength }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineComponent, h, nextTick, ref, useId, watch } from \"vue\";\nimport type {\n Combobox as ComboboxProps,\n SelectOption,\n} from \"../../interfaces/forms/Combobox.interface\";\nimport {\n useFieldState,\n useFieldClasses,\n FIELD_AFFORDANCE_ACTION_BY_COLOR,\n FIELD_AFFORDANCE_ICON_BY_COLOR,\n} from \"../../composables/useField\";\nimport { usePopover } from \"../../composables/usePopover\";\nimport PopoverPanel from \"../layout/PopoverPanel.vue\";\nimport Typography from \"../data-display/Typography.vue\";\nimport Loader from \"../feedback/Loader.vue\";\nimport {\n ChevronDownIcon,\n XMarkIcon,\n CheckIcon,\n} from \"@heroicons/vue/24/outline\";\nimport Button from \"./Button.vue\";\nimport {\n useModoLocale,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\n\nconst loc = useModoLocale();\n\nconst props = withDefaults(defineProps<ComboboxProps>(), {\n modelValue: \"\",\n options: () => [],\n debounce: 250,\n minChars: 0,\n freeSolo: false,\n variant: \"outline\",\n color: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n loading: false,\n fullWidth: false,\n clearable: false,\n placeholder: \"Type to search…\",\n emptyText: \"No results.\",\n loadingText: \"Loading…\",\n autofocus: false,\n});\n\nconst sz = useSizeTokens(() => props.size);\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n change: [value: string, option: SelectOption | null];\n select: [option: SelectOption];\n open: [];\n close: [];\n clear: [];\n search: [query: string];\n}>();\n\nconst {\n fieldId,\n radius,\n stateColor,\n hasError,\n hasValue,\n isDisabled,\n currentLength,\n showCounterEffective,\n counterOverflow,\n errorId,\n helperId,\n counterId,\n describedBy,\n} = useFieldState(props, {\n componentName: \"Combobox\",\n idPrefix: \"modo-combobox\",\n});\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.variant,\n stateColor,\n hasError,\n radius,\n forceFocus: () => isOpen.value,\n halo: () => props.halo,\n});\n\n/* ---------- IDs ---------- */\nconst autoListboxId = useId();\nconst listboxId = computed(() => `modo-combobox-listbox-${autoListboxId}`);\nconst optionDomId = (v: string) => `${listboxId.value}-opt-${v}`;\n\n/* ---------- Options source (sync or async) ---------- */\n\nconst asyncOptions = ref<SelectOption[]>([]);\nconst isLoadingAsync = ref(false);\nlet loadTimer: number | null = null;\nlet loadRequestId = 0;\n\nwatch(\n () => props.modelValue,\n (q) => {\n if (!props.loadOptions) return;\n if (!isOpen.value) return;\n if ((q ?? \"\").length < props.minChars) {\n asyncOptions.value = [];\n return;\n }\n if (loadTimer !== null) clearTimeout(loadTimer);\n isLoadingAsync.value = true;\n const reqId = ++loadRequestId;\n loadTimer = window.setTimeout(async () => {\n try {\n const result = await props.loadOptions!(q ?? \"\");\n if (reqId === loadRequestId) asyncOptions.value = result;\n } finally {\n if (reqId === loadRequestId) isLoadingAsync.value = false;\n }\n emit(\"search\", q ?? \"\");\n }, props.debounce);\n },\n);\n\nconst sourceOptions = computed(() =>\n props.loadOptions ? asyncOptions.value : props.options,\n);\n\nconst displayedOptions = computed(() => {\n const q = (props.modelValue ?? \"\").trim().toLowerCase();\n // Si hay loadOptions, no filtramos localmente (confiamos en el backend).\n if (props.loadOptions) return sourceOptions.value;\n if (!q) return sourceOptions.value;\n return sourceOptions.value.filter(\n (o) =>\n o.label.toLowerCase().includes(q) ||\n (o.description ? o.description.toLowerCase().includes(q) : false),\n );\n});\n\ninterface OptionGroup {\n name?: string;\n items: SelectOption[];\n}\n\nconst groupedOptions = computed<OptionGroup[]>(() => {\n const list = displayedOptions.value;\n if (!list.some((o) => o.group)) {\n return list.length ? [{ items: list }] : [];\n }\n const map = new Map<string | undefined, SelectOption[]>();\n for (const opt of list) {\n const key = opt.group;\n if (!map.has(key)) map.set(key, []);\n map.get(key)!.push(opt);\n }\n const groups: OptionGroup[] = [];\n for (const [name, items] of map) groups.push({ name, items });\n return groups;\n});\n\nconst flatOptions = computed<SelectOption[]>(() =>\n groupedOptions.value.flatMap((g) => g.items),\n);\n\n/** Si el texto actual coincide exactamente (case-insensitive) con alguna opción, la devuelve. */\nconst matchedOption = computed<SelectOption | null>(() => {\n const v = (props.modelValue ?? \"\").trim().toLowerCase();\n if (!v) return null;\n return sourceOptions.value.find((o) => o.label.toLowerCase() === v) ?? null;\n});\n\n/* ---------- Color ---------- */\nconst CHECK_COLOR_BY_STATE: Record<string, string> = {\n default: \"text-foreground\",\n primary: \"text-primary\",\n danger: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n};\nconst checkColorClass = computed(\n () => CHECK_COLOR_BY_STATE[stateColor.value] ?? \"text-foreground\",\n);\nconst affordanceIconClass = computed(\n () =>\n FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? \"text-muted-foreground\",\n);\nconst affordanceActionClass = computed(\n () =>\n FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ??\n \"text-muted-foreground hover:text-foreground\",\n);\n\nconst OPTION_SURFACE: Record<string, string> = {\n default: \"bg-muted\",\n primary: \"bg-primary/10\",\n danger: \"bg-destructive/10\",\n success: \"bg-success/10\",\n warning: \"bg-warning/10\",\n};\nconst OPTION_HOVER: Record<string, string> = {\n default: \"hover:bg-muted\",\n primary: \"hover:bg-primary/10\",\n danger: \"hover:bg-destructive/10\",\n success: \"hover:bg-success/10\",\n warning: \"hover:bg-warning/10\",\n};\nconst optionSurface = computed(\n () => OPTION_SURFACE[stateColor.value] ?? \"bg-muted\",\n);\nconst optionHover = computed(\n () => OPTION_HOVER[stateColor.value] ?? \"hover:bg-muted\",\n);\n\n/* ---------- Popover ---------- */\n\nconst inputEl = ref<HTMLInputElement | null>(null);\nconst wrapperEl = ref<HTMLElement | null>(null);\nconst activeValue = ref<string | number | null>(null);\nconst activeId = computed(() =>\n activeValue.value !== null ? optionDomId(String(activeValue.value)) : \"\",\n);\n\nconst {\n triggerRef,\n panelRef,\n isOpen,\n panelStyle,\n open: openPopover,\n close: closePopover,\n} = usePopover({\n placement: \"bottom-start\",\n matchTriggerWidth: true,\n // Reposition on scroll instead of closing. Focus is what opens this panel,\n // and focusing a text field is itself a scroll trigger: on mobile the virtual\n // keyboard appears and the browser scrolls the field into view a few frames\n // after the panel opened, which closed the dropdown before the user could\n // ever see it. Typing reopened it — by then the keyboard was already up and\n // no further scroll followed — which is why the list only appeared after the\n // first keystroke. Same reasoning as SearchInput.\n closeOnScroll: false,\n onOpen: () => {\n emit(\"open\");\n const initial =\n matchedOption.value ?? flatOptions.value.find((o) => !o.disabled);\n activeValue.value = initial ? initial.value : null;\n nextTick(scrollActiveIntoView);\n },\n onClose: () => {\n emit(\"close\");\n },\n});\n\nwatch(wrapperEl, (el) => (triggerRef.value = el));\n\nfunction setActive(v: string | number) {\n activeValue.value = v;\n}\n\nfunction scrollActiveIntoView() {\n if (activeValue.value === null) return;\n const el = document.getElementById(optionDomId(String(activeValue.value)));\n el?.scrollIntoView({ block: \"nearest\" });\n}\n\n/* ---------- Actions ---------- */\n\nfunction onInput(e: Event) {\n const next = (e.target as HTMLInputElement).value;\n emit(\"update:modelValue\", next);\n if (!isOpen.value) openPopover();\n // Activar la primera opción tras filtrar\n nextTick(() => {\n const first = flatOptions.value.find((o) => !o.disabled);\n activeValue.value = first ? first.value : null;\n });\n}\n\nfunction onFocus() {\n if (isDisabled.value || props.readonly) return;\n if (!isOpen.value) openPopover();\n}\n\nfunction onBlur() {\n // Delay para permitir el click en la opción (mousedown.prevent también ayuda).\n setTimeout(() => {\n // Si no es freeSolo y no hay match, resetea al último match válido (o vacío)\n if (!props.freeSolo) {\n const current = (props.modelValue ?? \"\").trim();\n if (current && !matchedOption.value) {\n // Revertir al label de la opción previa si había una\n emit(\"update:modelValue\", lastCommittedValue.value);\n }\n }\n closePopover();\n }, 120);\n}\n\nfunction onToggleClick() {\n if (isDisabled.value || props.readonly) return;\n if (isOpen.value) {\n closePopover();\n inputEl.value?.blur();\n } else {\n inputEl.value?.focus();\n }\n}\n\nconst lastCommittedValue = ref<string>(props.modelValue ?? \"\");\n\nfunction commit(value: string, opt: SelectOption | null) {\n lastCommittedValue.value = value;\n emit(\"update:modelValue\", value);\n emit(\"change\", value, opt);\n}\n\nfunction selectOption(opt: SelectOption) {\n if (opt.disabled) return;\n commit(opt.label, opt);\n emit(\"select\", opt);\n closePopover();\n inputEl.value?.blur();\n}\n\nfunction clear() {\n commit(\"\", null);\n emit(\"clear\");\n inputEl.value?.focus();\n}\n\n/* ---------- Keyboard ---------- */\n\nfunction moveActive(direction: 1 | -1) {\n const list = flatOptions.value.filter((o) => !o.disabled);\n if (list.length === 0) return;\n const currentIdx = list.findIndex((o) => o.value === activeValue.value);\n let nextIdx: number;\n if (currentIdx === -1) {\n nextIdx = direction > 0 ? 0 : list.length - 1;\n } else {\n nextIdx = (currentIdx + direction + list.length) % list.length;\n }\n activeValue.value = list[nextIdx].value;\n scrollActiveIntoView();\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (isDisabled.value || props.readonly) return;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(-1);\n break;\n case \"Enter\": {\n if (!isOpen.value) return;\n const opt = flatOptions.value.find((o) => o.value === activeValue.value);\n if (opt && !opt.disabled) {\n e.preventDefault();\n selectOption(opt);\n } else if (props.freeSolo) {\n e.preventDefault();\n commit(props.modelValue ?? \"\", null);\n // Keep panel open so the user sees the new value added to the list.\n // closePopover();\n }\n break;\n }\n case \"Escape\":\n if (isOpen.value) {\n e.preventDefault();\n closePopover();\n }\n break;\n case \"Tab\":\n // Dejar que Tab cierre naturalmente vía blur.\n break;\n }\n}\n\n/* ---------- Size maps ---------- */\n\nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\nconst inputTextClasses = computed(() => sz.value.text);\nconst iconSizeClasses = computed(() => sz.value.icon);\n\n/* ---------- Inline highlight helper ---------- */\nconst Highlight = defineComponent({\n name: \"ComboboxHighlight\",\n props: {\n text: { type: String, required: true },\n query: { type: String, required: true },\n },\n setup(p) {\n return () => {\n const q = (p.query ?? \"\").trim();\n if (!q) return h(\"span\", p.text);\n const idx = p.text.toLowerCase().indexOf(q.toLowerCase());\n if (idx === -1) return h(\"span\", p.text);\n const before = p.text.slice(0, idx);\n const match = p.text.slice(idx, idx + q.length);\n const after = p.text.slice(idx + q.length);\n return h(\"span\", [\n before,\n h(\n \"span\",\n {\n class:\n \"font-semibold text-foreground bg-primary/10 rounded-sm px-0.5\",\n },\n match,\n ),\n after,\n ]);\n };\n },\n});\n\n/* ---------- Sync committed value when controlling v-model externally ---------- */\nwatch(\n () => props.modelValue,\n (v) => {\n if (matchedOption.value) lastCommittedValue.value = v ?? \"\";\n },\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6QA,MAAM,MAAM,sBAAA,eAAe;EAE3B,MAAM,QAAQ;EAoBd,MAAM,KAAK,sBAAA,oBAAoB,MAAM,KAAK;EAE1C,MAAM,OAAO;EAUb,M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AAA,GAAA,IAAA,OAA6D,gBAAe,GAAA,qBAAA,wBAAA,CAAA;+CAK/E,cAAa,CAAA,GAAG,OAAA,GAAA,IAAA,iBAAI,QAAA,UAAS,EAAA,IAAA,YAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA"}
@@ -1,10 +1,10 @@
1
1
  import { useModoLocale, useSizeTokens } from "../../composables/useModoConfig.mjs";
2
2
  import { usePopover } from "../../composables/usePopover.mjs";
3
+ import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
3
4
  import Loader_default from "../feedback/Loader.mjs";
4
5
  import Button_default from "./Button.mjs";
5
- import Typography_default from "../data-display/Typography.mjs";
6
- import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
7
6
  import PopoverPanel_default from "../layout/PopoverPanel.mjs";
7
+ import Typography_default from "../data-display/Typography.mjs";
8
8
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useId, watch, withCtx, withModifiers } from "vue";
9
9
  import { CheckIcon, ChevronDownIcon, XMarkIcon } from "@heroicons/vue/24/outline";
10
10
  //#region src/components/forms/Combobox.vue?vue&type=script&setup=true&lang.ts
@@ -245,6 +245,7 @@ var Combobox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
245
245
  const { triggerRef, panelRef, isOpen, panelStyle, open: openPopover, close: closePopover } = usePopover({
246
246
  placement: "bottom-start",
247
247
  matchTriggerWidth: true,
248
+ closeOnScroll: false,
248
249
  onOpen: () => {
249
250
  emit("open");
250
251
  const initial = matchedOption.value ?? flatOptions.value.find((o) => !o.disabled);
@@ -502,7 +503,7 @@ var Combobox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
502
503
  radius: unref(radius),
503
504
  role: "listbox",
504
505
  labelledBy: __props.label ? unref(fieldId) : void 0,
505
- "onUpdate:panelRef": _cache[3] || (_cache[3] = ($event) => panelRef.value = $event)
506
+ "onUpdate:panelRef": _cache[2] || (_cache[2] = ($event) => panelRef.value = $event)
506
507
  }, {
507
508
  default: withCtx(() => [createElementVNode("div", _hoisted_5, [createElementVNode("ul", {
508
509
  id: listboxId.value,
@@ -526,7 +527,6 @@ var Combobox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
526
527
  ]),
527
528
  onPointerenter: ($event) => setActive(opt.value),
528
529
  onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
529
- onTouchstart: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
530
530
  onClick: ($event) => selectOption(opt)
531
531
  }, [
532
532
  opt.icon ? (openBlock(), createBlock(resolveDynamicComponent(opt.icon), {
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../src/components/forms/Combobox.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\"\n >*</span\n >\n </label>\n\n <div\n ref=\"wrapperEl\"\n :class=\"[\n 'modo-field-wrapper flex items-center gap-2',\n wrapperVariantClasses,\n wrapperSizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n role=\"combobox\"\n :aria-haspopup=\"'listbox'\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"listboxId\"\n :aria-owns=\"listboxId\"\n >\n <component\n :is=\"iconLeft\"\n v-if=\"iconLeft\"\n aria-hidden=\"true\"\n :class=\"['shrink-0', affordanceIconClass, iconSizeClasses]\"\n />\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n :value=\"modelValue ?? ''\"\n :placeholder=\"placeholder\"\n :disabled=\"isDisabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :maxlength=\"maxLength\"\n :aria-label=\"!label ? ariaLabel : undefined\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :aria-required=\"required || undefined\"\n :aria-autocomplete=\"'list'\"\n :aria-controls=\"listboxId\"\n :aria-expanded=\"isOpen\"\n :aria-activedescendant=\"isOpen && activeId ? activeId : undefined\"\n :class=\"[\n 'modo-field-native flex-1 min-w-0 bg-transparent p-0',\n 'text-foreground placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n inputTextClasses,\n ]\"\n @input=\"onInput\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n />\n\n <Loader\n v-if=\"loading || isLoadingAsync\"\n :size=\"size === 'large' ? 'medium' : 'small'\"\n :class=\"['shrink-0', affordanceIconClass]\"\n />\n\n <Button\n v-else-if=\"clearable && hasValue && !isDisabled && !readonly\"\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"XMarkIcon\"\n :ariaLabel=\"loc.combobox.clear\"\n tabindex=\"-1\"\n :class=\"['shrink-0', affordanceActionClass]\"\n @click=\"clear\"\n />\n\n <Button\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"ChevronDownIcon\"\n :ariaLabel=\"loc.combobox.toggleOptions\"\n tabindex=\"-1\"\n :class=\"[\n 'shrink-0',\n affordanceActionClass,\n 'transition-transform duration-base ease-standard',\n isOpen ? 'rotate-180' : '',\n ]\"\n @mousedown.prevent\n @click=\"onToggleClick\"\n />\n </div>\n\n <PopoverPanel\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"radius\"\n role=\"listbox\"\n :labelledBy=\"label ? fieldId : undefined\"\n @update:panelRef=\"panelRef = $event\"\n >\n <div class=\"flex flex-col max-h-72\">\n <ul\n :id=\"listboxId\"\n role=\"listbox\"\n class=\"modo-stagger flex-1 overflow-y-auto\"\n tabindex=\"-1\"\n >\n <li\n v-if=\"isLoadingAsync && displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ loadingText }}\n </li>\n <li\n v-else-if=\"displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ emptyText }}\n </li>\n\n <template\n v-for=\"(group, gi) in groupedOptions\"\n :key=\"group.name ?? gi\"\n >\n <li\n v-if=\"group.name\"\n class=\"px-3 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground\"\n role=\"presentation\"\n >\n {{ group.name }}\n </li>\n <li\n v-for=\"opt in group.items\"\n :id=\"optionDomId(String(opt.value))\"\n :key=\"String(opt.value)\"\n role=\"option\"\n :aria-selected=\"matchedOption?.value === opt.value\"\n :aria-disabled=\"opt.disabled || undefined\"\n :class=\"[\n 'flex items-center gap-2 px-3 py-2 text-body cursor-pointer select-none',\n 'transition-colors duration-fast ease-standard',\n opt.disabled\n ? 'text-muted-foreground/60 cursor-not-allowed'\n : ['text-foreground', optionHover],\n activeValue === opt.value && !opt.disabled ? optionSurface : '',\n matchedOption?.value === opt.value ? 'font-medium' : '',\n ]\"\n @pointerenter=\"setActive(opt.value)\"\n @mousedown.prevent\n @touchstart.prevent\n @click=\"selectOption(opt)\"\n >\n <component\n :is=\"opt.icon\"\n v-if=\"opt.icon\"\n aria-hidden=\"true\"\n :class=\"['w-4 h-4 shrink-0', affordanceIconClass]\"\n />\n <div class=\"flex-1 min-w-0\">\n <div class=\"truncate\">\n <Highlight :text=\"opt.label\" :query=\"modelValue ?? ''\" />\n </div>\n <div\n v-if=\"opt.description\"\n class=\"text-caption text-muted-foreground truncate\"\n >\n {{ opt.description }}\n </div>\n </div>\n <CheckIcon\n v-if=\"matchedOption?.value === opt.value\"\n :class=\"['w-4 h-4 shrink-0', checkColorClass]\"\n aria-hidden=\"true\"\n />\n </li>\n </template>\n </ul>\n <slot name=\"footer\" />\n </div>\n </PopoverPanel>\n\n <div\n v-if=\"errorText || helperText || showCounterEffective\"\n class=\"flex items-start gap-2\"\n >\n <Typography\n v-if=\"errorText\"\n :id=\"errorId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"danger\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ errorText }}\n </Typography>\n <Typography\n v-else-if=\"helperText\"\n :id=\"helperId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"muted\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ helperText }}\n </Typography>\n <p\n v-if=\"showCounterEffective\"\n :id=\"counterId\"\n :class=\"[\n 'text-caption ml-auto tabular-nums',\n counterOverflow ? 'text-destructive' : 'text-muted-foreground',\n ]\"\n >\n {{ currentLength }}/{{ maxLength }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineComponent, h, nextTick, ref, useId, watch } from \"vue\";\nimport type {\n Combobox as ComboboxProps,\n SelectOption,\n} from \"../../interfaces/forms/Combobox.interface\";\nimport {\n useFieldState,\n useFieldClasses,\n FIELD_AFFORDANCE_ACTION_BY_COLOR,\n FIELD_AFFORDANCE_ICON_BY_COLOR,\n} from \"../../composables/useField\";\nimport { usePopover } from \"../../composables/usePopover\";\nimport PopoverPanel from \"../layout/PopoverPanel.vue\";\nimport Typography from \"../data-display/Typography.vue\";\nimport Loader from \"../feedback/Loader.vue\";\nimport {\n ChevronDownIcon,\n XMarkIcon,\n CheckIcon,\n} from \"@heroicons/vue/24/outline\";\nimport Button from \"./Button.vue\";\nimport {\n useModoLocale,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\n\nconst loc = useModoLocale();\n\nconst props = withDefaults(defineProps<ComboboxProps>(), {\n modelValue: \"\",\n options: () => [],\n debounce: 250,\n minChars: 0,\n freeSolo: false,\n variant: \"outline\",\n color: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n loading: false,\n fullWidth: false,\n clearable: false,\n placeholder: \"Type to search…\",\n emptyText: \"No results.\",\n loadingText: \"Loading…\",\n autofocus: false,\n});\n\nconst sz = useSizeTokens(() => props.size);\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n change: [value: string, option: SelectOption | null];\n select: [option: SelectOption];\n open: [];\n close: [];\n clear: [];\n search: [query: string];\n}>();\n\nconst {\n fieldId,\n radius,\n stateColor,\n hasError,\n hasValue,\n isDisabled,\n currentLength,\n showCounterEffective,\n counterOverflow,\n errorId,\n helperId,\n counterId,\n describedBy,\n} = useFieldState(props, {\n componentName: \"Combobox\",\n idPrefix: \"modo-combobox\",\n});\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.variant,\n stateColor,\n hasError,\n radius,\n forceFocus: () => isOpen.value,\n halo: () => props.halo,\n});\n\n/* ---------- IDs ---------- */\nconst autoListboxId = useId();\nconst listboxId = computed(() => `modo-combobox-listbox-${autoListboxId}`);\nconst optionDomId = (v: string) => `${listboxId.value}-opt-${v}`;\n\n/* ---------- Options source (sync or async) ---------- */\n\nconst asyncOptions = ref<SelectOption[]>([]);\nconst isLoadingAsync = ref(false);\nlet loadTimer: number | null = null;\nlet loadRequestId = 0;\n\nwatch(\n () => props.modelValue,\n (q) => {\n if (!props.loadOptions) return;\n if (!isOpen.value) return;\n if ((q ?? \"\").length < props.minChars) {\n asyncOptions.value = [];\n return;\n }\n if (loadTimer !== null) clearTimeout(loadTimer);\n isLoadingAsync.value = true;\n const reqId = ++loadRequestId;\n loadTimer = window.setTimeout(async () => {\n try {\n const result = await props.loadOptions!(q ?? \"\");\n if (reqId === loadRequestId) asyncOptions.value = result;\n } finally {\n if (reqId === loadRequestId) isLoadingAsync.value = false;\n }\n emit(\"search\", q ?? \"\");\n }, props.debounce);\n },\n);\n\nconst sourceOptions = computed(() =>\n props.loadOptions ? asyncOptions.value : props.options,\n);\n\nconst displayedOptions = computed(() => {\n const q = (props.modelValue ?? \"\").trim().toLowerCase();\n // Si hay loadOptions, no filtramos localmente (confiamos en el backend).\n if (props.loadOptions) return sourceOptions.value;\n if (!q) return sourceOptions.value;\n return sourceOptions.value.filter(\n (o) =>\n o.label.toLowerCase().includes(q) ||\n (o.description ? o.description.toLowerCase().includes(q) : false),\n );\n});\n\ninterface OptionGroup {\n name?: string;\n items: SelectOption[];\n}\n\nconst groupedOptions = computed<OptionGroup[]>(() => {\n const list = displayedOptions.value;\n if (!list.some((o) => o.group)) {\n return list.length ? [{ items: list }] : [];\n }\n const map = new Map<string | undefined, SelectOption[]>();\n for (const opt of list) {\n const key = opt.group;\n if (!map.has(key)) map.set(key, []);\n map.get(key)!.push(opt);\n }\n const groups: OptionGroup[] = [];\n for (const [name, items] of map) groups.push({ name, items });\n return groups;\n});\n\nconst flatOptions = computed<SelectOption[]>(() =>\n groupedOptions.value.flatMap((g) => g.items),\n);\n\n/** Si el texto actual coincide exactamente (case-insensitive) con alguna opción, la devuelve. */\nconst matchedOption = computed<SelectOption | null>(() => {\n const v = (props.modelValue ?? \"\").trim().toLowerCase();\n if (!v) return null;\n return sourceOptions.value.find((o) => o.label.toLowerCase() === v) ?? null;\n});\n\n/* ---------- Color ---------- */\nconst CHECK_COLOR_BY_STATE: Record<string, string> = {\n default: \"text-foreground\",\n primary: \"text-primary\",\n danger: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n};\nconst checkColorClass = computed(\n () => CHECK_COLOR_BY_STATE[stateColor.value] ?? \"text-foreground\",\n);\nconst affordanceIconClass = computed(\n () =>\n FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? \"text-muted-foreground\",\n);\nconst affordanceActionClass = computed(\n () =>\n FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ??\n \"text-muted-foreground hover:text-foreground\",\n);\n\nconst OPTION_SURFACE: Record<string, string> = {\n default: \"bg-muted\",\n primary: \"bg-primary/10\",\n danger: \"bg-destructive/10\",\n success: \"bg-success/10\",\n warning: \"bg-warning/10\",\n};\nconst OPTION_HOVER: Record<string, string> = {\n default: \"hover:bg-muted\",\n primary: \"hover:bg-primary/10\",\n danger: \"hover:bg-destructive/10\",\n success: \"hover:bg-success/10\",\n warning: \"hover:bg-warning/10\",\n};\nconst optionSurface = computed(\n () => OPTION_SURFACE[stateColor.value] ?? \"bg-muted\",\n);\nconst optionHover = computed(\n () => OPTION_HOVER[stateColor.value] ?? \"hover:bg-muted\",\n);\n\n/* ---------- Popover ---------- */\n\nconst inputEl = ref<HTMLInputElement | null>(null);\nconst wrapperEl = ref<HTMLElement | null>(null);\nconst activeValue = ref<string | number | null>(null);\nconst activeId = computed(() =>\n activeValue.value !== null ? optionDomId(String(activeValue.value)) : \"\",\n);\n\nconst {\n triggerRef,\n panelRef,\n isOpen,\n panelStyle,\n open: openPopover,\n close: closePopover,\n} = usePopover({\n placement: \"bottom-start\",\n matchTriggerWidth: true,\n onOpen: () => {\n emit(\"open\");\n const initial =\n matchedOption.value ?? flatOptions.value.find((o) => !o.disabled);\n activeValue.value = initial ? initial.value : null;\n nextTick(scrollActiveIntoView);\n },\n onClose: () => {\n emit(\"close\");\n },\n});\n\nwatch(wrapperEl, (el) => (triggerRef.value = el));\n\nfunction setActive(v: string | number) {\n activeValue.value = v;\n}\n\nfunction scrollActiveIntoView() {\n if (activeValue.value === null) return;\n const el = document.getElementById(optionDomId(String(activeValue.value)));\n el?.scrollIntoView({ block: \"nearest\" });\n}\n\n/* ---------- Actions ---------- */\n\nfunction onInput(e: Event) {\n const next = (e.target as HTMLInputElement).value;\n emit(\"update:modelValue\", next);\n if (!isOpen.value) openPopover();\n // Activar la primera opción tras filtrar\n nextTick(() => {\n const first = flatOptions.value.find((o) => !o.disabled);\n activeValue.value = first ? first.value : null;\n });\n}\n\nfunction onFocus() {\n if (isDisabled.value || props.readonly) return;\n if (!isOpen.value) openPopover();\n}\n\nfunction onBlur() {\n // Delay para permitir el click en la opción (mousedown.prevent también ayuda).\n setTimeout(() => {\n // Si no es freeSolo y no hay match, resetea al último match válido (o vacío)\n if (!props.freeSolo) {\n const current = (props.modelValue ?? \"\").trim();\n if (current && !matchedOption.value) {\n // Revertir al label de la opción previa si había una\n emit(\"update:modelValue\", lastCommittedValue.value);\n }\n }\n closePopover();\n }, 120);\n}\n\nfunction onToggleClick() {\n if (isDisabled.value || props.readonly) return;\n if (isOpen.value) {\n closePopover();\n inputEl.value?.blur();\n } else {\n inputEl.value?.focus();\n }\n}\n\nconst lastCommittedValue = ref<string>(props.modelValue ?? \"\");\n\nfunction commit(value: string, opt: SelectOption | null) {\n lastCommittedValue.value = value;\n emit(\"update:modelValue\", value);\n emit(\"change\", value, opt);\n}\n\nfunction selectOption(opt: SelectOption) {\n if (opt.disabled) return;\n commit(opt.label, opt);\n emit(\"select\", opt);\n closePopover();\n inputEl.value?.blur();\n}\n\nfunction clear() {\n commit(\"\", null);\n emit(\"clear\");\n inputEl.value?.focus();\n}\n\n/* ---------- Keyboard ---------- */\n\nfunction moveActive(direction: 1 | -1) {\n const list = flatOptions.value.filter((o) => !o.disabled);\n if (list.length === 0) return;\n const currentIdx = list.findIndex((o) => o.value === activeValue.value);\n let nextIdx: number;\n if (currentIdx === -1) {\n nextIdx = direction > 0 ? 0 : list.length - 1;\n } else {\n nextIdx = (currentIdx + direction + list.length) % list.length;\n }\n activeValue.value = list[nextIdx].value;\n scrollActiveIntoView();\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (isDisabled.value || props.readonly) return;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(-1);\n break;\n case \"Enter\": {\n if (!isOpen.value) return;\n const opt = flatOptions.value.find((o) => o.value === activeValue.value);\n if (opt && !opt.disabled) {\n e.preventDefault();\n selectOption(opt);\n } else if (props.freeSolo) {\n e.preventDefault();\n commit(props.modelValue ?? \"\", null);\n // Keep panel open so the user sees the new value added to the list.\n // closePopover();\n }\n break;\n }\n case \"Escape\":\n if (isOpen.value) {\n e.preventDefault();\n closePopover();\n }\n break;\n case \"Tab\":\n // Dejar que Tab cierre naturalmente vía blur.\n break;\n }\n}\n\n/* ---------- Size maps ---------- */\n\nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\nconst inputTextClasses = computed(() => sz.value.text);\nconst iconSizeClasses = computed(() => sz.value.icon);\n\n/* ---------- Inline highlight helper ---------- */\nconst Highlight = defineComponent({\n name: \"ComboboxHighlight\",\n props: {\n text: { type: String, required: true },\n query: { type: String, required: true },\n },\n setup(p) {\n return () => {\n const q = (p.query ?? \"\").trim();\n if (!q) return h(\"span\", p.text);\n const idx = p.text.toLowerCase().indexOf(q.toLowerCase());\n if (idx === -1) return h(\"span\", p.text);\n const before = p.text.slice(0, idx);\n const match = p.text.slice(idx, idx + q.length);\n const after = p.text.slice(idx + q.length);\n return h(\"span\", [\n before,\n h(\n \"span\",\n {\n class:\n \"font-semibold text-foreground bg-primary/10 rounded-sm px-0.5\",\n },\n match,\n ),\n after,\n ]);\n };\n },\n});\n\n/* ---------- Sync committed value when controlling v-model externally ---------- */\nwatch(\n () => props.modelValue,\n (v) => {\n if (matchedOption.value) lastCommittedValue.value = v ?? \"\";\n },\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuQA,MAAM,MAAM,eAAe;EAE3B,MAAM,QAAQ;EAoBd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_true_lang.mjs","names":[],"sources":["../../../src/components/forms/Combobox.vue"],"sourcesContent":["<template>\n <div :class=\"['flex flex-col gap-1.5', fullWidth ? 'w-full' : 'inline-flex']\">\n <label\n v-if=\"label\"\n :for=\"fieldId\"\n class=\"text-caption font-medium text-foreground\"\n >\n {{ label }}\n <span v-if=\"required\" aria-hidden=\"true\" class=\"text-destructive ml-0.5\"\n >*</span\n >\n </label>\n\n <div\n ref=\"wrapperEl\"\n :class=\"[\n 'modo-field-wrapper flex items-center gap-2',\n wrapperVariantClasses,\n wrapperSizeClasses,\n radiusClasses,\n fullWidth ? 'w-full' : '',\n isDisabled ? 'opacity-60 cursor-not-allowed' : '',\n ]\"\n role=\"combobox\"\n :aria-haspopup=\"'listbox'\"\n :aria-expanded=\"isOpen\"\n :aria-controls=\"listboxId\"\n :aria-owns=\"listboxId\"\n >\n <component\n :is=\"iconLeft\"\n v-if=\"iconLeft\"\n aria-hidden=\"true\"\n :class=\"['shrink-0', affordanceIconClass, iconSizeClasses]\"\n />\n\n <input\n :id=\"fieldId\"\n ref=\"inputEl\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n :value=\"modelValue ?? ''\"\n :placeholder=\"placeholder\"\n :disabled=\"isDisabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :maxlength=\"maxLength\"\n :aria-label=\"!label ? ariaLabel : undefined\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"describedBy\"\n :aria-required=\"required || undefined\"\n :aria-autocomplete=\"'list'\"\n :aria-controls=\"listboxId\"\n :aria-expanded=\"isOpen\"\n :aria-activedescendant=\"isOpen && activeId ? activeId : undefined\"\n :class=\"[\n 'modo-field-native flex-1 min-w-0 bg-transparent p-0',\n 'text-foreground placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n inputTextClasses,\n ]\"\n @input=\"onInput\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"onKeydown\"\n />\n\n <Loader\n v-if=\"loading || isLoadingAsync\"\n :size=\"size === 'large' ? 'medium' : 'small'\"\n :class=\"['shrink-0', affordanceIconClass]\"\n />\n\n <Button\n v-else-if=\"clearable && hasValue && !isDisabled && !readonly\"\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"XMarkIcon\"\n :ariaLabel=\"loc.combobox.clear\"\n tabindex=\"-1\"\n :class=\"['shrink-0', affordanceActionClass]\"\n @click=\"clear\"\n />\n\n <Button\n variant=\"text\"\n size=\"xs\"\n radius=\"full\"\n :icon=\"ChevronDownIcon\"\n :ariaLabel=\"loc.combobox.toggleOptions\"\n tabindex=\"-1\"\n :class=\"[\n 'shrink-0',\n affordanceActionClass,\n 'transition-transform duration-base ease-standard',\n isOpen ? 'rotate-180' : '',\n ]\"\n @mousedown.prevent\n @click=\"onToggleClick\"\n />\n </div>\n\n <PopoverPanel\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"radius\"\n role=\"listbox\"\n :labelledBy=\"label ? fieldId : undefined\"\n @update:panelRef=\"panelRef = $event\"\n >\n <div class=\"flex flex-col max-h-72\">\n <ul\n :id=\"listboxId\"\n role=\"listbox\"\n class=\"modo-stagger flex-1 overflow-y-auto\"\n tabindex=\"-1\"\n >\n <li\n v-if=\"isLoadingAsync && displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ loadingText }}\n </li>\n <li\n v-else-if=\"displayedOptions.length === 0\"\n class=\"px-3 py-4 text-caption text-muted-foreground text-center\"\n >\n {{ emptyText }}\n </li>\n\n <template\n v-for=\"(group, gi) in groupedOptions\"\n :key=\"group.name ?? gi\"\n >\n <li\n v-if=\"group.name\"\n class=\"px-3 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground\"\n role=\"presentation\"\n >\n {{ group.name }}\n </li>\n <!--\n `mousedown.prevent` keeps focus in the input while an option is\n picked. There is deliberately no `touchstart.prevent` alongside\n it: cancelling touchstart tells the browser to suppress the\n compatibility mouse events *and* the click for that tap, so on a\n touch device the option became impossible to select at all.\n -->\n <li\n v-for=\"opt in group.items\"\n :id=\"optionDomId(String(opt.value))\"\n :key=\"String(opt.value)\"\n role=\"option\"\n :aria-selected=\"matchedOption?.value === opt.value\"\n :aria-disabled=\"opt.disabled || undefined\"\n :class=\"[\n 'flex items-center gap-2 px-3 py-2 text-body cursor-pointer select-none',\n 'transition-colors duration-fast ease-standard',\n opt.disabled\n ? 'text-muted-foreground/60 cursor-not-allowed'\n : ['text-foreground', optionHover],\n activeValue === opt.value && !opt.disabled ? optionSurface : '',\n matchedOption?.value === opt.value ? 'font-medium' : '',\n ]\"\n @pointerenter=\"setActive(opt.value)\"\n @mousedown.prevent\n @click=\"selectOption(opt)\"\n >\n <component\n :is=\"opt.icon\"\n v-if=\"opt.icon\"\n aria-hidden=\"true\"\n :class=\"['w-4 h-4 shrink-0', affordanceIconClass]\"\n />\n <div class=\"flex-1 min-w-0\">\n <div class=\"truncate\">\n <Highlight :text=\"opt.label\" :query=\"modelValue ?? ''\" />\n </div>\n <div\n v-if=\"opt.description\"\n class=\"text-caption text-muted-foreground truncate\"\n >\n {{ opt.description }}\n </div>\n </div>\n <CheckIcon\n v-if=\"matchedOption?.value === opt.value\"\n :class=\"['w-4 h-4 shrink-0', checkColorClass]\"\n aria-hidden=\"true\"\n />\n </li>\n </template>\n </ul>\n <slot name=\"footer\" />\n </div>\n </PopoverPanel>\n\n <div\n v-if=\"errorText || helperText || showCounterEffective\"\n class=\"flex items-start gap-2\"\n >\n <Typography\n v-if=\"errorText\"\n :id=\"errorId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"danger\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ errorText }}\n </Typography>\n <Typography\n v-else-if=\"helperText\"\n :id=\"helperId\"\n variant=\"caption\"\n size=\"medium\"\n color=\"muted\"\n as=\"p\"\n class=\"flex-1\"\n >\n {{ helperText }}\n </Typography>\n <p\n v-if=\"showCounterEffective\"\n :id=\"counterId\"\n :class=\"[\n 'text-caption ml-auto tabular-nums',\n counterOverflow ? 'text-destructive' : 'text-muted-foreground',\n ]\"\n >\n {{ currentLength }}/{{ maxLength }}\n </p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, defineComponent, h, nextTick, ref, useId, watch } from \"vue\";\nimport type {\n Combobox as ComboboxProps,\n SelectOption,\n} from \"../../interfaces/forms/Combobox.interface\";\nimport {\n useFieldState,\n useFieldClasses,\n FIELD_AFFORDANCE_ACTION_BY_COLOR,\n FIELD_AFFORDANCE_ICON_BY_COLOR,\n} from \"../../composables/useField\";\nimport { usePopover } from \"../../composables/usePopover\";\nimport PopoverPanel from \"../layout/PopoverPanel.vue\";\nimport Typography from \"../data-display/Typography.vue\";\nimport Loader from \"../feedback/Loader.vue\";\nimport {\n ChevronDownIcon,\n XMarkIcon,\n CheckIcon,\n} from \"@heroicons/vue/24/outline\";\nimport Button from \"./Button.vue\";\nimport {\n useModoLocale,\n useSizeTokens,\n} from \"../../composables/useModoConfig\";\n\nconst loc = useModoLocale();\n\nconst props = withDefaults(defineProps<ComboboxProps>(), {\n modelValue: \"\",\n options: () => [],\n debounce: 250,\n minChars: 0,\n freeSolo: false,\n variant: \"outline\",\n color: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n loading: false,\n fullWidth: false,\n clearable: false,\n placeholder: \"Type to search…\",\n emptyText: \"No results.\",\n loadingText: \"Loading…\",\n autofocus: false,\n});\n\nconst sz = useSizeTokens(() => props.size);\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n change: [value: string, option: SelectOption | null];\n select: [option: SelectOption];\n open: [];\n close: [];\n clear: [];\n search: [query: string];\n}>();\n\nconst {\n fieldId,\n radius,\n stateColor,\n hasError,\n hasValue,\n isDisabled,\n currentLength,\n showCounterEffective,\n counterOverflow,\n errorId,\n helperId,\n counterId,\n describedBy,\n} = useFieldState(props, {\n componentName: \"Combobox\",\n idPrefix: \"modo-combobox\",\n});\n\nconst { wrapperVariantClasses, radiusClasses } = useFieldClasses({\n variant: () => props.variant,\n stateColor,\n hasError,\n radius,\n forceFocus: () => isOpen.value,\n halo: () => props.halo,\n});\n\n/* ---------- IDs ---------- */\nconst autoListboxId = useId();\nconst listboxId = computed(() => `modo-combobox-listbox-${autoListboxId}`);\nconst optionDomId = (v: string) => `${listboxId.value}-opt-${v}`;\n\n/* ---------- Options source (sync or async) ---------- */\n\nconst asyncOptions = ref<SelectOption[]>([]);\nconst isLoadingAsync = ref(false);\nlet loadTimer: number | null = null;\nlet loadRequestId = 0;\n\nwatch(\n () => props.modelValue,\n (q) => {\n if (!props.loadOptions) return;\n if (!isOpen.value) return;\n if ((q ?? \"\").length < props.minChars) {\n asyncOptions.value = [];\n return;\n }\n if (loadTimer !== null) clearTimeout(loadTimer);\n isLoadingAsync.value = true;\n const reqId = ++loadRequestId;\n loadTimer = window.setTimeout(async () => {\n try {\n const result = await props.loadOptions!(q ?? \"\");\n if (reqId === loadRequestId) asyncOptions.value = result;\n } finally {\n if (reqId === loadRequestId) isLoadingAsync.value = false;\n }\n emit(\"search\", q ?? \"\");\n }, props.debounce);\n },\n);\n\nconst sourceOptions = computed(() =>\n props.loadOptions ? asyncOptions.value : props.options,\n);\n\nconst displayedOptions = computed(() => {\n const q = (props.modelValue ?? \"\").trim().toLowerCase();\n // Si hay loadOptions, no filtramos localmente (confiamos en el backend).\n if (props.loadOptions) return sourceOptions.value;\n if (!q) return sourceOptions.value;\n return sourceOptions.value.filter(\n (o) =>\n o.label.toLowerCase().includes(q) ||\n (o.description ? o.description.toLowerCase().includes(q) : false),\n );\n});\n\ninterface OptionGroup {\n name?: string;\n items: SelectOption[];\n}\n\nconst groupedOptions = computed<OptionGroup[]>(() => {\n const list = displayedOptions.value;\n if (!list.some((o) => o.group)) {\n return list.length ? [{ items: list }] : [];\n }\n const map = new Map<string | undefined, SelectOption[]>();\n for (const opt of list) {\n const key = opt.group;\n if (!map.has(key)) map.set(key, []);\n map.get(key)!.push(opt);\n }\n const groups: OptionGroup[] = [];\n for (const [name, items] of map) groups.push({ name, items });\n return groups;\n});\n\nconst flatOptions = computed<SelectOption[]>(() =>\n groupedOptions.value.flatMap((g) => g.items),\n);\n\n/** Si el texto actual coincide exactamente (case-insensitive) con alguna opción, la devuelve. */\nconst matchedOption = computed<SelectOption | null>(() => {\n const v = (props.modelValue ?? \"\").trim().toLowerCase();\n if (!v) return null;\n return sourceOptions.value.find((o) => o.label.toLowerCase() === v) ?? null;\n});\n\n/* ---------- Color ---------- */\nconst CHECK_COLOR_BY_STATE: Record<string, string> = {\n default: \"text-foreground\",\n primary: \"text-primary\",\n danger: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n};\nconst checkColorClass = computed(\n () => CHECK_COLOR_BY_STATE[stateColor.value] ?? \"text-foreground\",\n);\nconst affordanceIconClass = computed(\n () =>\n FIELD_AFFORDANCE_ICON_BY_COLOR[stateColor.value] ?? \"text-muted-foreground\",\n);\nconst affordanceActionClass = computed(\n () =>\n FIELD_AFFORDANCE_ACTION_BY_COLOR[stateColor.value] ??\n \"text-muted-foreground hover:text-foreground\",\n);\n\nconst OPTION_SURFACE: Record<string, string> = {\n default: \"bg-muted\",\n primary: \"bg-primary/10\",\n danger: \"bg-destructive/10\",\n success: \"bg-success/10\",\n warning: \"bg-warning/10\",\n};\nconst OPTION_HOVER: Record<string, string> = {\n default: \"hover:bg-muted\",\n primary: \"hover:bg-primary/10\",\n danger: \"hover:bg-destructive/10\",\n success: \"hover:bg-success/10\",\n warning: \"hover:bg-warning/10\",\n};\nconst optionSurface = computed(\n () => OPTION_SURFACE[stateColor.value] ?? \"bg-muted\",\n);\nconst optionHover = computed(\n () => OPTION_HOVER[stateColor.value] ?? \"hover:bg-muted\",\n);\n\n/* ---------- Popover ---------- */\n\nconst inputEl = ref<HTMLInputElement | null>(null);\nconst wrapperEl = ref<HTMLElement | null>(null);\nconst activeValue = ref<string | number | null>(null);\nconst activeId = computed(() =>\n activeValue.value !== null ? optionDomId(String(activeValue.value)) : \"\",\n);\n\nconst {\n triggerRef,\n panelRef,\n isOpen,\n panelStyle,\n open: openPopover,\n close: closePopover,\n} = usePopover({\n placement: \"bottom-start\",\n matchTriggerWidth: true,\n // Reposition on scroll instead of closing. Focus is what opens this panel,\n // and focusing a text field is itself a scroll trigger: on mobile the virtual\n // keyboard appears and the browser scrolls the field into view a few frames\n // after the panel opened, which closed the dropdown before the user could\n // ever see it. Typing reopened it — by then the keyboard was already up and\n // no further scroll followed — which is why the list only appeared after the\n // first keystroke. Same reasoning as SearchInput.\n closeOnScroll: false,\n onOpen: () => {\n emit(\"open\");\n const initial =\n matchedOption.value ?? flatOptions.value.find((o) => !o.disabled);\n activeValue.value = initial ? initial.value : null;\n nextTick(scrollActiveIntoView);\n },\n onClose: () => {\n emit(\"close\");\n },\n});\n\nwatch(wrapperEl, (el) => (triggerRef.value = el));\n\nfunction setActive(v: string | number) {\n activeValue.value = v;\n}\n\nfunction scrollActiveIntoView() {\n if (activeValue.value === null) return;\n const el = document.getElementById(optionDomId(String(activeValue.value)));\n el?.scrollIntoView({ block: \"nearest\" });\n}\n\n/* ---------- Actions ---------- */\n\nfunction onInput(e: Event) {\n const next = (e.target as HTMLInputElement).value;\n emit(\"update:modelValue\", next);\n if (!isOpen.value) openPopover();\n // Activar la primera opción tras filtrar\n nextTick(() => {\n const first = flatOptions.value.find((o) => !o.disabled);\n activeValue.value = first ? first.value : null;\n });\n}\n\nfunction onFocus() {\n if (isDisabled.value || props.readonly) return;\n if (!isOpen.value) openPopover();\n}\n\nfunction onBlur() {\n // Delay para permitir el click en la opción (mousedown.prevent también ayuda).\n setTimeout(() => {\n // Si no es freeSolo y no hay match, resetea al último match válido (o vacío)\n if (!props.freeSolo) {\n const current = (props.modelValue ?? \"\").trim();\n if (current && !matchedOption.value) {\n // Revertir al label de la opción previa si había una\n emit(\"update:modelValue\", lastCommittedValue.value);\n }\n }\n closePopover();\n }, 120);\n}\n\nfunction onToggleClick() {\n if (isDisabled.value || props.readonly) return;\n if (isOpen.value) {\n closePopover();\n inputEl.value?.blur();\n } else {\n inputEl.value?.focus();\n }\n}\n\nconst lastCommittedValue = ref<string>(props.modelValue ?? \"\");\n\nfunction commit(value: string, opt: SelectOption | null) {\n lastCommittedValue.value = value;\n emit(\"update:modelValue\", value);\n emit(\"change\", value, opt);\n}\n\nfunction selectOption(opt: SelectOption) {\n if (opt.disabled) return;\n commit(opt.label, opt);\n emit(\"select\", opt);\n closePopover();\n inputEl.value?.blur();\n}\n\nfunction clear() {\n commit(\"\", null);\n emit(\"clear\");\n inputEl.value?.focus();\n}\n\n/* ---------- Keyboard ---------- */\n\nfunction moveActive(direction: 1 | -1) {\n const list = flatOptions.value.filter((o) => !o.disabled);\n if (list.length === 0) return;\n const currentIdx = list.findIndex((o) => o.value === activeValue.value);\n let nextIdx: number;\n if (currentIdx === -1) {\n nextIdx = direction > 0 ? 0 : list.length - 1;\n } else {\n nextIdx = (currentIdx + direction + list.length) % list.length;\n }\n activeValue.value = list[nextIdx].value;\n scrollActiveIntoView();\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (isDisabled.value || props.readonly) return;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (!isOpen.value) openPopover();\n moveActive(-1);\n break;\n case \"Enter\": {\n if (!isOpen.value) return;\n const opt = flatOptions.value.find((o) => o.value === activeValue.value);\n if (opt && !opt.disabled) {\n e.preventDefault();\n selectOption(opt);\n } else if (props.freeSolo) {\n e.preventDefault();\n commit(props.modelValue ?? \"\", null);\n // Keep panel open so the user sees the new value added to the list.\n // closePopover();\n }\n break;\n }\n case \"Escape\":\n if (isOpen.value) {\n e.preventDefault();\n closePopover();\n }\n break;\n case \"Tab\":\n // Dejar que Tab cierre naturalmente vía blur.\n break;\n }\n}\n\n/* ---------- Size maps ---------- */\n\nconst wrapperSizeClasses = computed(() => `${sz.value.control} ${sz.value.padX}`);\nconst inputTextClasses = computed(() => sz.value.text);\nconst iconSizeClasses = computed(() => sz.value.icon);\n\n/* ---------- Inline highlight helper ---------- */\nconst Highlight = defineComponent({\n name: \"ComboboxHighlight\",\n props: {\n text: { type: String, required: true },\n query: { type: String, required: true },\n },\n setup(p) {\n return () => {\n const q = (p.query ?? \"\").trim();\n if (!q) return h(\"span\", p.text);\n const idx = p.text.toLowerCase().indexOf(q.toLowerCase());\n if (idx === -1) return h(\"span\", p.text);\n const before = p.text.slice(0, idx);\n const match = p.text.slice(idx, idx + q.length);\n const after = p.text.slice(idx + q.length);\n return h(\"span\", [\n before,\n h(\n \"span\",\n {\n class:\n \"font-semibold text-foreground bg-primary/10 rounded-sm px-0.5\",\n },\n match,\n ),\n after,\n ]);\n };\n },\n});\n\n/* ---------- Sync committed value when controlling v-model externally ---------- */\nwatch(\n () => props.modelValue,\n (v) => {\n if (matchedOption.value) lastCommittedValue.value = v ?? \"\";\n },\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6QA,MAAM,MAAM,eAAe;EAE3B,MAAM,QAAQ;EAoBd,MAAM,KAAK,oBAAoB,MAAM,KAAK;EAE1C,MAAM,OAAO;EAUb,MAAM,EACJ,SACA,QACA,YACA,UACA,UACA,YACA,eACA,sBACA,iBACA,SACA,UACA,WACA,gBACE,cAAc,OAAO;GACvB,eAAe;GACf,UAAU;GACX,CAAC;EAEF,MAAM,EAAE,uBAAuB,kBAAkB,gBAAgB;GAC/D,eAAe,MAAM;GACrB;GACA;GACA;GACA,kBAAkB,OAAO;GACzB,YAAY,MAAM;GACnB,CAAC;EAGF,MAAM,gBAAgB,OAAO;EAC7B,MAAM,YAAY,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AA,CAAA,CAAA;;;;;;;;IAKlB,QAAA,aAAa,QAAA,cAAc,MAAA,qBAAoB,IAAA,WAAA,EADvD,mBAoCM,OApCN,aAoCM,CA/BI,QAAA,aAAA,WAAA,EADR,YAUa,oBAAA;;KARV,IAAI,MAAA,QAAO;KACZ,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;KACH,OAAM;;4BAES,CAAA,gBAAA,gBAAZ,QAAA,UAAS,EAAA,EAAA,CAAA,CAAA;;qBAGD,QAAA,cAAA,WAAA,EADb,YAUa,oBAAA;;KARV,IAAI,MAAA,SAAQ;KACb,SAAQ;KACR,MAAK;KACL,OAAM;KACN,IAAG;KACH,OAAM;;4BAEU,CAAA,gBAAA,gBAAb,QAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;mDAGP,MAAA,qBAAoB,IAAA,WAAA,EAD5B,mBASI,KAAA;;KAPD,IAAI,MAAA,UAAS;KACb,OAAK,eAAA,CAAA,qCAA6D,MAAA,gBAAe,GAAA,qBAAA,wBAAA,CAAA;uBAK/E,MAAA,cAAa,CAAA,GAAG,MAAC,gBAAG,QAAA,UAAS,EAAA,IAAA,YAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1,11 +1,11 @@
1
1
  require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_useModoConfig = require("../../composables/useModoConfig.cjs");
3
3
  const require_usePopover = require("../../composables/usePopover.cjs");
4
+ const require_useField = require("../../composables/useField.cjs");
4
5
  const require_Loader = require("../feedback/Loader.cjs");
5
6
  const require_Button = require("./Button.cjs");
6
- const require_Typography = require("../data-display/Typography.cjs");
7
- const require_useField = require("../../composables/useField.cjs");
8
7
  const require_PopoverPanel = require("../layout/PopoverPanel.cjs");
8
+ const require_Typography = require("../data-display/Typography.cjs");
9
9
  const require_Calendar = require("../data-display/calendar/Calendar.cjs");
10
10
  let vue = require("vue");
11
11
  let _heroicons_vue_24_outline = require("@heroicons/vue/24/outline");
@@ -1,10 +1,10 @@
1
1
  import { useModoLocale, useSizeTokens } from "../../composables/useModoConfig.mjs";
2
2
  import { usePopover } from "../../composables/usePopover.mjs";
3
+ import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
3
4
  import Loader_default from "../feedback/Loader.mjs";
4
5
  import Button_default from "./Button.mjs";
5
- import Typography_default from "../data-display/Typography.mjs";
6
- import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
7
6
  import PopoverPanel_default from "../layout/PopoverPanel.mjs";
7
+ import Typography_default from "../data-display/Typography.mjs";
8
8
  import Calendar_default from "../data-display/calendar/Calendar.mjs";
9
9
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, resolveDynamicComponent, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
10
10
  import { CalendarIcon, ChevronDownIcon, XMarkIcon } from "@heroicons/vue/24/outline";
@@ -1,11 +1,11 @@
1
1
  require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_useModoConfig = require("../../composables/useModoConfig.cjs");
3
3
  const require_usePopover = require("../../composables/usePopover.cjs");
4
+ const require_useField = require("../../composables/useField.cjs");
4
5
  const require_Loader = require("../feedback/Loader.cjs");
5
6
  const require_Button = require("./Button.cjs");
6
- const require_Typography = require("../data-display/Typography.cjs");
7
- const require_useField = require("../../composables/useField.cjs");
8
7
  const require_PopoverPanel = require("../layout/PopoverPanel.cjs");
8
+ const require_Typography = require("../data-display/Typography.cjs");
9
9
  const require_DateRangePicker = require("../data-display/date-picker/DateRangePicker.cjs");
10
10
  let vue = require("vue");
11
11
  let _heroicons_vue_24_outline = require("@heroicons/vue/24/outline");
@@ -1,10 +1,10 @@
1
1
  import { useModoLocale, useSizeTokens } from "../../composables/useModoConfig.mjs";
2
2
  import { usePopover } from "../../composables/usePopover.mjs";
3
+ import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
3
4
  import Loader_default from "../feedback/Loader.mjs";
4
5
  import Button_default from "./Button.mjs";
5
- import Typography_default from "../data-display/Typography.mjs";
6
- import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
7
6
  import PopoverPanel_default from "../layout/PopoverPanel.mjs";
7
+ import Typography_default from "../data-display/Typography.mjs";
8
8
  import DateRangePicker_default from "../data-display/date-picker/DateRangePicker.mjs";
9
9
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, resolveDynamicComponent, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
10
10
  import { CalendarDaysIcon, ChevronDownIcon, XMarkIcon } from "@heroicons/vue/24/outline";
@@ -1,11 +1,11 @@
1
1
  require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_useModoConfig = require("../../composables/useModoConfig.cjs");
3
3
  const require_usePopover = require("../../composables/usePopover.cjs");
4
+ const require_useField = require("../../composables/useField.cjs");
4
5
  const require_Loader = require("../feedback/Loader.cjs");
5
6
  const require_Button = require("./Button.cjs");
6
- const require_Typography = require("../data-display/Typography.cjs");
7
- const require_useField = require("../../composables/useField.cjs");
8
7
  const require_PopoverPanel = require("../layout/PopoverPanel.cjs");
8
+ const require_Typography = require("../data-display/Typography.cjs");
9
9
  const require_DateTimePicker = require("../data-display/date-picker/DateTimePicker.cjs");
10
10
  let vue = require("vue");
11
11
  let _heroicons_vue_24_outline = require("@heroicons/vue/24/outline");
@@ -1,10 +1,10 @@
1
1
  import { useModoLocale, useSizeTokens } from "../../composables/useModoConfig.mjs";
2
2
  import { usePopover } from "../../composables/usePopover.mjs";
3
+ import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
3
4
  import Loader_default from "../feedback/Loader.mjs";
4
5
  import Button_default from "./Button.mjs";
5
- import Typography_default from "../data-display/Typography.mjs";
6
- import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
7
6
  import PopoverPanel_default from "../layout/PopoverPanel.mjs";
7
+ import Typography_default from "../data-display/Typography.mjs";
8
8
  import DateTimePicker_default from "../data-display/date-picker/DateTimePicker.mjs";
9
9
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, resolveDynamicComponent, toDisplayString, unref, watch, withCtx, withModifiers } from "vue";
10
10
  import { ChevronDownIcon, ClockIcon, XMarkIcon } from "@heroicons/vue/24/outline";
@@ -1,9 +1,9 @@
1
1
  require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_ModoLocale = require("../../config/ModoLocale.cjs");
3
3
  const require_useModoConfig = require("../../composables/useModoConfig.cjs");
4
+ const require_useField = require("../../composables/useField.cjs");
4
5
  const require_Button = require("./Button.cjs");
5
6
  const require_Typography = require("../data-display/Typography.cjs");
6
- const require_useField = require("../../composables/useField.cjs");
7
7
  let vue = require("vue");
8
8
  let _heroicons_vue_24_outline = require("@heroicons/vue/24/outline");
9
9
  //#region src/components/forms/FileInput.vue?vue&type=script&setup=true&lang.ts
@@ -1,8 +1,8 @@
1
1
  import { interpolate } from "../../config/ModoLocale.mjs";
2
2
  import { useModoLocale, useResolvedSize, useSizeTokens } from "../../composables/useModoConfig.mjs";
3
+ import { useFieldClasses, useFieldState } from "../../composables/useField.mjs";
3
4
  import Button_default from "./Button.mjs";
4
5
  import Typography_default from "../data-display/Typography.mjs";
5
- import { useFieldClasses, useFieldState } from "../../composables/useField.mjs";
6
6
  import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, useId, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
7
7
  import { ArrowUpTrayIcon, DocumentIcon, PhotoIcon, XMarkIcon } from "@heroicons/vue/24/outline";
8
8
  //#region src/components/forms/FileInput.vue?vue&type=script&setup=true&lang.ts
@@ -1,6 +1,6 @@
1
1
  require("../../_virtual/_rolldown/runtime.cjs");
2
- const require_Typography = require("../data-display/Typography.cjs");
3
2
  const require_useField = require("../../composables/useField.cjs");
3
+ const require_Typography = require("../data-display/Typography.cjs");
4
4
  let vue = require("vue");
5
5
  //#region src/components/forms/FormField.vue?vue&type=script&setup=true&lang.ts
6
6
  var _hoisted_1 = ["for"];
@@ -1,5 +1,5 @@
1
- import Typography_default from "../data-display/Typography.mjs";
2
1
  import { FORM_FIELD_ID_KEY } from "../../composables/useField.mjs";
2
+ import Typography_default from "../data-display/Typography.mjs";
3
3
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, renderSlot, resolveDynamicComponent, toDisplayString, useId, useSlots, withCtx } from "vue";
4
4
  //#region src/components/forms/FormField.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = ["for"];
@@ -1,9 +1,9 @@
1
1
  require("../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_useModoConfig = require("../../composables/useModoConfig.cjs");
3
+ const require_useField = require("../../composables/useField.cjs");
3
4
  const require_Loader = require("../feedback/Loader.cjs");
4
5
  const require_Button = require("./Button.cjs");
5
6
  const require_Typography = require("../data-display/Typography.cjs");
6
- const require_useField = require("../../composables/useField.cjs");
7
7
  let vue = require("vue");
8
8
  let _heroicons_vue_24_outline = require("@heroicons/vue/24/outline");
9
9
  //#region src/components/forms/Input.vue?vue&type=script&setup=true&lang.ts
@@ -1,8 +1,8 @@
1
1
  import { useModoLocale, useResolvedSize, useSizeTokens } from "../../composables/useModoConfig.mjs";
2
+ import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
2
3
  import Loader_default from "../feedback/Loader.mjs";
3
4
  import Button_default from "./Button.mjs";
4
5
  import Typography_default from "../data-display/Typography.mjs";
5
- import { FIELD_AFFORDANCE_ACTION_BY_COLOR, FIELD_AFFORDANCE_ICON_BY_COLOR, useFieldClasses, useFieldState } from "../../composables/useField.mjs";
6
6
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, openBlock, ref, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
7
7
  import { XMarkIcon } from "@heroicons/vue/24/outline";
8
8
  //#region src/components/forms/Input.vue?vue&type=script&setup=true&lang.ts
@@ -0,0 +1,6 @@
1
+ //#region src/components/forms/MenuButton.vue
2
+ var MenuButton_default = require("./MenuButton.vue_vue_type_script_setup_true_lang.cjs").default;
3
+ //#endregion
4
+ exports.default = MenuButton_default;
5
+
6
+ //# sourceMappingURL=MenuButton.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButton.cjs","names":[],"sources":["../../../src/components/forms/MenuButton.vue"],"sourcesContent":["<template>\n <!-- Root IS the trigger button so ButtonGroup's border-collapse reaches it. -->\n <Button\n ref=\"btnRef\"\n :variant=\"variant\"\n :color=\"color\"\n :size=\"size\"\n :radius=\"radius\"\n :disabled=\"disabled\"\n :ariaLabel=\"ariaLabel\"\n aria-haspopup=\"menu\"\n :aria-expanded=\"isOpen\"\n :aria-activedescendant=\"isOpen && activeIndex >= 0 ? `${menuId}-opt-${activeIndex}` : undefined\"\n @click=\"toggle\"\n @keydown=\"onTriggerKeydown\"\n >\n <component :is=\"icon\" v-if=\"icon\" :class=\"[iconSizeClass, 'shrink-0']\" aria-hidden=\"true\" />\n <span v-if=\"label\">{{ label }}</span>\n <ChevronDownIcon\n v-if=\"chevron\"\n :class=\"[iconSizeClass, 'shrink-0 transition-transform duration-fast', isOpen ? 'rotate-180' : '']\"\n aria-hidden=\"true\"\n />\n </Button>\n\n <PopoverPanel\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"resolvedRadius\"\n role=\"menu\"\n :aria-label=\"ariaLabel || label || 'Menu'\"\n @update:panelRef=\"panelRef = $event\"\n >\n <ul :id=\"menuId\" class=\"flex flex-col\" :style=\"{ minWidth }\" @mousedown.prevent>\n <template v-for=\"(entry, idx) in entries\" :key=\"idx\">\n <li v-if=\"isDivider(entry)\" role=\"separator\" class=\"my-1 h-px bg-border\" />\n <li\n v-else-if=\"isHeader(entry)\"\n role=\"presentation\"\n class=\"px-3 pt-2 pb-1 text-caption font-semibold uppercase tracking-wider text-muted-foreground select-none\"\n >\n {{ entry.label }}\n </li>\n <li v-else role=\"none\">\n <component\n :is=\"entry.href && !entry.disabled ? 'a' : 'button'\"\n :id=\"`${menuId}-opt-${idx}`\"\n :type=\"entry.href ? undefined : 'button'\"\n :href=\"entry.href && !entry.disabled ? entry.href : undefined\"\n :target=\"entry.external ? '_blank' : undefined\"\n :rel=\"entry.external ? 'noopener noreferrer' : undefined\"\n role=\"menuitem\"\n tabindex=\"-1\"\n :aria-disabled=\"entry.disabled || undefined\"\n :class=\"[\n 'w-full flex items-center gap-2.5 px-3 py-2 text-left text-body transition-colors duration-fast ease-standard',\n entry.disabled\n ? 'opacity-50 cursor-not-allowed'\n : entry.danger\n ? 'text-destructive cursor-pointer'\n : 'text-foreground cursor-pointer',\n !entry.disabled && idx === activeIndex\n ? (entry.danger ? 'bg-destructive/10' : 'bg-accent')\n : '',\n ]\"\n @mouseenter=\"entry.disabled ? null : (activeIndex = idx)\"\n @click=\"onItemClick(entry)\"\n >\n <component\n :is=\"entry.icon\"\n v-if=\"entry.icon\"\n :class=\"[iconSizeClass, 'shrink-0', entry.danger ? 'text-destructive' : 'text-muted-foreground']\"\n aria-hidden=\"true\"\n />\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"truncate\">{{ entry.label }}</span>\n <span v-if=\"entry.description\" class=\"text-caption text-muted-foreground truncate\">{{ entry.description }}</span>\n </span>\n <span v-if=\"entry.shortcut\" class=\"ml-2 text-caption text-muted-foreground tabular-nums shrink-0\" aria-hidden=\"true\">{{ entry.shortcut }}</span>\n </component>\n </li>\n </template>\n </ul>\n </PopoverPanel>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useId, watch, type ComponentPublicInstance } from 'vue';\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline';\nimport Button from './Button.vue';\nimport PopoverPanel from '../layout/PopoverPanel.vue';\nimport { usePopover } from '../../composables/usePopover';\nimport { useResolvedRadius, useResolvedSize } from '../../composables/useModoConfig';\nimport type { MenuButton, MenuButtonEmits } from '../../interfaces/forms/MenuButton.interface';\nimport type {\n DropdownMenuEntry,\n DropdownMenuItem,\n DropdownMenuDivider,\n DropdownMenuHeader,\n} from '../../interfaces/navigation/DropdownMenu.interface';\n\nconst props = withDefaults(defineProps<MenuButton>(), {\n variant: 'outline',\n color: 'default',\n chevron: true,\n placement: 'bottom-start',\n minWidth: '12rem',\n disabled: false,\n closeOnSelect: true,\n});\n\nconst emit = defineEmits<MenuButtonEmits>();\n\nconst menuId = useId();\nconst resolvedRadius = useResolvedRadius(() => props.radius);\nconst resolvedSize = useResolvedSize(() => props.size);\n\nconst entries = computed<DropdownMenuEntry[]>(() => props.items ?? []);\nfunction isDivider(e: DropdownMenuEntry): e is DropdownMenuDivider { return (e as { type?: string }).type === 'divider'; }\nfunction isHeader(e: DropdownMenuEntry): e is DropdownMenuHeader { return (e as { type?: string }).type === 'header'; }\nfunction isItem(e: DropdownMenuEntry): e is DropdownMenuItem { return !isDivider(e) && !isHeader(e); }\n\nconst iconSizeClass = computed(() => {\n switch (resolvedSize.value) {\n case 'xsmall':\n case 'small': return 'size-4';\n case 'large': return 'size-5';\n default: return 'size-[18px]';\n }\n});\n\n/* ---------- Popover ---------- */\nconst {\n triggerRef,\n panelRef,\n isOpen,\n panelStyle,\n open,\n close,\n toggle,\n} = usePopover({\n placement: () => props.placement,\n onOpen: () => { emit('update:open', true); primeActive(); },\n onClose: () => { emit('update:open', false); activeIndex.value = -1; },\n});\n\n// The trigger element for positioning is the Button's root <button>.\nconst btnRef = ref<ComponentPublicInstance | null>(null);\nwatch(btnRef, (inst) => { triggerRef.value = (inst?.$el as HTMLElement) ?? null; }, { immediate: true });\n\n/* ---------- Active item + keyboard ---------- */\nconst activeIndex = ref(-1);\nconst itemIndices = computed(() =>\n entries.value.map((e, i) => (isItem(e) && !e.disabled ? i : -1)).filter((i) => i !== -1),\n);\nfunction primeActive() {\n const order = itemIndices.value;\n activeIndex.value = order.length ? order[0] : -1;\n}\nfunction moveActive(delta: 1 | -1) {\n const order = itemIndices.value;\n if (!order.length) return;\n const cur = order.indexOf(activeIndex.value);\n activeIndex.value = cur === -1\n ? (delta > 0 ? order[0] : order[order.length - 1])\n : order[(cur + delta + order.length) % order.length];\n}\n\nfunction onTriggerKeydown(e: KeyboardEvent) {\n if (props.disabled) return;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!isOpen.value) open(); else moveActive(1);\n break;\n case 'ArrowUp':\n e.preventDefault();\n if (!isOpen.value) open(); else moveActive(-1);\n break;\n case 'Enter':\n case ' ':\n if (isOpen.value && activeIndex.value >= 0) {\n const entry = entries.value[activeIndex.value];\n if (entry && isItem(entry) && !entry.disabled) {\n e.preventDefault();\n onItemClick(entry);\n }\n }\n break;\n case 'Escape':\n if (isOpen.value) { e.preventDefault(); close(); }\n break;\n }\n}\n\nfunction onItemClick(entry: DropdownMenuItem) {\n if (entry.disabled) return;\n entry.onClick?.(entry);\n emit('select', entry);\n if (props.closeOnSelect) close();\n}\n\ndefineExpose({ open, close, toggle });\n</script>\n"],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import MenuButton_vue_vue_type_script_setup_true_lang_default from "./MenuButton.vue_vue_type_script_setup_true_lang.mjs";
2
+ //#region src/components/forms/MenuButton.vue
3
+ var MenuButton_default = MenuButton_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { MenuButton_default as default };
6
+
7
+ //# sourceMappingURL=MenuButton.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButton.mjs","names":[],"sources":["../../../src/components/forms/MenuButton.vue"],"sourcesContent":["<template>\n <!-- Root IS the trigger button so ButtonGroup's border-collapse reaches it. -->\n <Button\n ref=\"btnRef\"\n :variant=\"variant\"\n :color=\"color\"\n :size=\"size\"\n :radius=\"radius\"\n :disabled=\"disabled\"\n :ariaLabel=\"ariaLabel\"\n aria-haspopup=\"menu\"\n :aria-expanded=\"isOpen\"\n :aria-activedescendant=\"isOpen && activeIndex >= 0 ? `${menuId}-opt-${activeIndex}` : undefined\"\n @click=\"toggle\"\n @keydown=\"onTriggerKeydown\"\n >\n <component :is=\"icon\" v-if=\"icon\" :class=\"[iconSizeClass, 'shrink-0']\" aria-hidden=\"true\" />\n <span v-if=\"label\">{{ label }}</span>\n <ChevronDownIcon\n v-if=\"chevron\"\n :class=\"[iconSizeClass, 'shrink-0 transition-transform duration-fast', isOpen ? 'rotate-180' : '']\"\n aria-hidden=\"true\"\n />\n </Button>\n\n <PopoverPanel\n :open=\"isOpen\"\n :style=\"panelStyle\"\n :radius=\"resolvedRadius\"\n role=\"menu\"\n :aria-label=\"ariaLabel || label || 'Menu'\"\n @update:panelRef=\"panelRef = $event\"\n >\n <ul :id=\"menuId\" class=\"flex flex-col\" :style=\"{ minWidth }\" @mousedown.prevent>\n <template v-for=\"(entry, idx) in entries\" :key=\"idx\">\n <li v-if=\"isDivider(entry)\" role=\"separator\" class=\"my-1 h-px bg-border\" />\n <li\n v-else-if=\"isHeader(entry)\"\n role=\"presentation\"\n class=\"px-3 pt-2 pb-1 text-caption font-semibold uppercase tracking-wider text-muted-foreground select-none\"\n >\n {{ entry.label }}\n </li>\n <li v-else role=\"none\">\n <component\n :is=\"entry.href && !entry.disabled ? 'a' : 'button'\"\n :id=\"`${menuId}-opt-${idx}`\"\n :type=\"entry.href ? undefined : 'button'\"\n :href=\"entry.href && !entry.disabled ? entry.href : undefined\"\n :target=\"entry.external ? '_blank' : undefined\"\n :rel=\"entry.external ? 'noopener noreferrer' : undefined\"\n role=\"menuitem\"\n tabindex=\"-1\"\n :aria-disabled=\"entry.disabled || undefined\"\n :class=\"[\n 'w-full flex items-center gap-2.5 px-3 py-2 text-left text-body transition-colors duration-fast ease-standard',\n entry.disabled\n ? 'opacity-50 cursor-not-allowed'\n : entry.danger\n ? 'text-destructive cursor-pointer'\n : 'text-foreground cursor-pointer',\n !entry.disabled && idx === activeIndex\n ? (entry.danger ? 'bg-destructive/10' : 'bg-accent')\n : '',\n ]\"\n @mouseenter=\"entry.disabled ? null : (activeIndex = idx)\"\n @click=\"onItemClick(entry)\"\n >\n <component\n :is=\"entry.icon\"\n v-if=\"entry.icon\"\n :class=\"[iconSizeClass, 'shrink-0', entry.danger ? 'text-destructive' : 'text-muted-foreground']\"\n aria-hidden=\"true\"\n />\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"truncate\">{{ entry.label }}</span>\n <span v-if=\"entry.description\" class=\"text-caption text-muted-foreground truncate\">{{ entry.description }}</span>\n </span>\n <span v-if=\"entry.shortcut\" class=\"ml-2 text-caption text-muted-foreground tabular-nums shrink-0\" aria-hidden=\"true\">{{ entry.shortcut }}</span>\n </component>\n </li>\n </template>\n </ul>\n </PopoverPanel>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useId, watch, type ComponentPublicInstance } from 'vue';\nimport { ChevronDownIcon } from '@heroicons/vue/24/outline';\nimport Button from './Button.vue';\nimport PopoverPanel from '../layout/PopoverPanel.vue';\nimport { usePopover } from '../../composables/usePopover';\nimport { useResolvedRadius, useResolvedSize } from '../../composables/useModoConfig';\nimport type { MenuButton, MenuButtonEmits } from '../../interfaces/forms/MenuButton.interface';\nimport type {\n DropdownMenuEntry,\n DropdownMenuItem,\n DropdownMenuDivider,\n DropdownMenuHeader,\n} from '../../interfaces/navigation/DropdownMenu.interface';\n\nconst props = withDefaults(defineProps<MenuButton>(), {\n variant: 'outline',\n color: 'default',\n chevron: true,\n placement: 'bottom-start',\n minWidth: '12rem',\n disabled: false,\n closeOnSelect: true,\n});\n\nconst emit = defineEmits<MenuButtonEmits>();\n\nconst menuId = useId();\nconst resolvedRadius = useResolvedRadius(() => props.radius);\nconst resolvedSize = useResolvedSize(() => props.size);\n\nconst entries = computed<DropdownMenuEntry[]>(() => props.items ?? []);\nfunction isDivider(e: DropdownMenuEntry): e is DropdownMenuDivider { return (e as { type?: string }).type === 'divider'; }\nfunction isHeader(e: DropdownMenuEntry): e is DropdownMenuHeader { return (e as { type?: string }).type === 'header'; }\nfunction isItem(e: DropdownMenuEntry): e is DropdownMenuItem { return !isDivider(e) && !isHeader(e); }\n\nconst iconSizeClass = computed(() => {\n switch (resolvedSize.value) {\n case 'xsmall':\n case 'small': return 'size-4';\n case 'large': return 'size-5';\n default: return 'size-[18px]';\n }\n});\n\n/* ---------- Popover ---------- */\nconst {\n triggerRef,\n panelRef,\n isOpen,\n panelStyle,\n open,\n close,\n toggle,\n} = usePopover({\n placement: () => props.placement,\n onOpen: () => { emit('update:open', true); primeActive(); },\n onClose: () => { emit('update:open', false); activeIndex.value = -1; },\n});\n\n// The trigger element for positioning is the Button's root <button>.\nconst btnRef = ref<ComponentPublicInstance | null>(null);\nwatch(btnRef, (inst) => { triggerRef.value = (inst?.$el as HTMLElement) ?? null; }, { immediate: true });\n\n/* ---------- Active item + keyboard ---------- */\nconst activeIndex = ref(-1);\nconst itemIndices = computed(() =>\n entries.value.map((e, i) => (isItem(e) && !e.disabled ? i : -1)).filter((i) => i !== -1),\n);\nfunction primeActive() {\n const order = itemIndices.value;\n activeIndex.value = order.length ? order[0] : -1;\n}\nfunction moveActive(delta: 1 | -1) {\n const order = itemIndices.value;\n if (!order.length) return;\n const cur = order.indexOf(activeIndex.value);\n activeIndex.value = cur === -1\n ? (delta > 0 ? order[0] : order[order.length - 1])\n : order[(cur + delta + order.length) % order.length];\n}\n\nfunction onTriggerKeydown(e: KeyboardEvent) {\n if (props.disabled) return;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!isOpen.value) open(); else moveActive(1);\n break;\n case 'ArrowUp':\n e.preventDefault();\n if (!isOpen.value) open(); else moveActive(-1);\n break;\n case 'Enter':\n case ' ':\n if (isOpen.value && activeIndex.value >= 0) {\n const entry = entries.value[activeIndex.value];\n if (entry && isItem(entry) && !entry.disabled) {\n e.preventDefault();\n onItemClick(entry);\n }\n }\n break;\n case 'Escape':\n if (isOpen.value) { e.preventDefault(); close(); }\n break;\n }\n}\n\nfunction onItemClick(entry: DropdownMenuItem) {\n if (entry.disabled) return;\n entry.onClick?.(entry);\n emit('select', entry);\n if (props.closeOnSelect) close();\n}\n\ndefineExpose({ open, close, toggle });\n</script>\n"],"mappings":""}