@auronui/vue 1.3.0 → 1.4.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 (285) hide show
  1. package/ai-rules.md +139 -1
  2. package/dist/cjs/index.cjs +1815 -932
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/components/_shared/FieldLabel.js +7 -0
  5. package/dist/components/_shared/FieldLabel.js.map +1 -0
  6. package/dist/components/_shared/FieldLabel.vue_vue_type_script_setup_true_lang.js +38 -0
  7. package/dist/components/_shared/FieldLabel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  8. package/dist/components/_shared/FormFieldHelper.js +7 -0
  9. package/dist/components/_shared/FormFieldHelper.js.map +1 -0
  10. package/dist/components/_shared/FormFieldHelper.vue_vue_type_script_setup_true_lang.js +59 -0
  11. package/dist/components/_shared/FormFieldHelper.vue_vue_type_script_setup_true_lang.js.map +1 -0
  12. package/dist/components/_shared/TimeScroller.js +7 -0
  13. package/dist/components/_shared/TimeScroller.js.map +1 -0
  14. package/dist/components/{date-time-picker/DateTimePickerTimeScroller.vue_vue_type_script_setup_true_lang.js → _shared/TimeScroller.vue_vue_type_script_setup_true_lang.js} +5 -6
  15. package/dist/components/_shared/TimeScroller.vue_vue_type_script_setup_true_lang.js.map +1 -0
  16. package/dist/components/accordion/Accordion.js.map +1 -1
  17. package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js +10 -4
  18. package/dist/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/accordion/AccordionItem.js.map +1 -1
  20. package/dist/components/accordion/AccordionItem.vue_vue_type_script_setup_true_lang.js +11 -2
  21. package/dist/components/accordion/AccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/alert-dialog/AlertDialogAction.js.map +1 -1
  23. package/dist/components/alert-dialog/AlertDialogAction.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/alert-dialog/AlertDialogCancel.js.map +1 -1
  25. package/dist/components/alert-dialog/AlertDialogCancel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/components/autocomplete/Autocomplete.js.map +1 -1
  27. package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +56 -52
  28. package/dist/components/autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  29. package/dist/components/autocomplete/AutocompleteCreateItem.js.map +1 -1
  30. package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js +8 -2
  31. package/dist/components/autocomplete/AutocompleteCreateItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/components/autocomplete/AutocompleteInput.js.map +1 -1
  33. package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js +17 -8
  34. package/dist/components/autocomplete/AutocompleteInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/autocomplete/AutocompleteItem.js.map +1 -1
  36. package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js +4 -2
  37. package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/components/avatar/AvatarGroup.js.map +1 -1
  39. package/dist/components/avatar/AvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/button/Button.js.map +1 -1
  41. package/dist/components/button/Button.vue_vue_type_script_setup_true_lang.js +10 -4
  42. package/dist/components/button/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/button/ButtonGroup.js.map +1 -1
  44. package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js +10 -4
  45. package/dist/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/button/CloseButton.js.map +1 -1
  47. package/dist/components/button/CloseButton.vue_vue_type_script_setup_true_lang.js +10 -4
  48. package/dist/components/button/CloseButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/button/ToggleButton.js.map +1 -1
  50. package/dist/components/button/ToggleButton.vue_vue_type_script_setup_true_lang.js +17 -6
  51. package/dist/components/button/ToggleButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  52. package/dist/components/button/ToggleButtonGroup.js.map +1 -1
  53. package/dist/components/button/ToggleButtonGroup.vue_vue_type_script_setup_true_lang.js +10 -4
  54. package/dist/components/button/ToggleButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/components/calendar/Calendar.js.map +1 -1
  56. package/dist/components/calendar/Calendar.vue_vue_type_script_setup_true_lang.js +21 -10
  57. package/dist/components/calendar/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/calendar-year-picker/CalendarYearPicker.js.map +1 -1
  59. package/dist/components/calendar-year-picker/CalendarYearPicker.vue_vue_type_script_setup_true_lang.js +15 -4
  60. package/dist/components/calendar-year-picker/CalendarYearPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/components/checkbox/Checkbox.js.map +1 -1
  62. package/dist/components/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +16 -5
  63. package/dist/components/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  64. package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
  65. package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js +10 -4
  66. package/dist/components/checkbox/CheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/chip/Chip.js.map +1 -1
  68. package/dist/components/chip/Chip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/collapsible/Collapsible.js.map +1 -1
  70. package/dist/components/collapsible/Collapsible.vue_vue_type_script_setup_true_lang.js +8 -2
  71. package/dist/components/collapsible/Collapsible.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/collapsible/CollapsibleGroup.js.map +1 -1
  73. package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  74. package/dist/components/collapsible/CollapsibleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  75. package/dist/components/color-area/ColorArea.js.map +1 -1
  76. package/dist/components/color-area/ColorArea.vue_vue_type_script_setup_true_lang.js +15 -4
  77. package/dist/components/color-area/ColorArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/components/color-field/ColorField.js.map +1 -1
  79. package/dist/components/color-field/ColorField.vue_vue_type_script_setup_true_lang.js +22 -6
  80. package/dist/components/color-field/ColorField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  81. package/dist/components/color-input-group/ColorInputGroup.js.map +1 -1
  82. package/dist/components/color-input-group/ColorInputGroup.vue_vue_type_script_setup_true_lang.js +22 -6
  83. package/dist/components/color-input-group/ColorInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/components/color-picker/ColorPicker.js.map +1 -1
  85. package/dist/components/color-picker/ColorPicker.vue_vue_type_script_setup_true_lang.js +15 -9
  86. package/dist/components/color-picker/ColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  87. package/dist/components/color-slider/ColorSlider.js.map +1 -1
  88. package/dist/components/color-slider/ColorSlider.vue_vue_type_script_setup_true_lang.js +15 -4
  89. package/dist/components/color-slider/ColorSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/color-swatch-picker/ColorSwatchPicker.js.map +1 -1
  91. package/dist/components/color-swatch-picker/ColorSwatchPicker.vue_vue_type_script_setup_true_lang.js +15 -4
  92. package/dist/components/color-swatch-picker/ColorSwatchPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/combo-box/ComboBoxInput.js.map +1 -1
  94. package/dist/components/combo-box/ComboBoxInput.vue_vue_type_script_setup_true_lang.js +7 -1
  95. package/dist/components/combo-box/ComboBoxInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  96. package/dist/components/combo-box/ComboBoxItem.js.map +1 -1
  97. package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js +4 -2
  98. package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  99. package/dist/components/context-menu/ContextMenuCheckboxItem.js.map +1 -1
  100. package/dist/components/context-menu/ContextMenuCheckboxItem.vue_vue_type_script_setup_true_lang.js +4 -2
  101. package/dist/components/context-menu/ContextMenuCheckboxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/context-menu/ContextMenuItem.js.map +1 -1
  103. package/dist/components/context-menu/ContextMenuItem.vue_vue_type_script_setup_true_lang.js +4 -2
  104. package/dist/components/context-menu/ContextMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/context-menu/ContextMenuRadioItem.js.map +1 -1
  106. package/dist/components/context-menu/ContextMenuRadioItem.vue_vue_type_script_setup_true_lang.js +4 -2
  107. package/dist/components/context-menu/ContextMenuRadioItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/components/context-menu/ContextMenuSubTrigger.js.map +1 -1
  109. package/dist/components/context-menu/ContextMenuSubTrigger.vue_vue_type_script_setup_true_lang.js +4 -2
  110. package/dist/components/context-menu/ContextMenuSubTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  111. package/dist/components/context-menu/ContextMenuTrigger.js.map +1 -1
  112. package/dist/components/context-menu/ContextMenuTrigger.vue_vue_type_script_setup_true_lang.js +7 -1
  113. package/dist/components/context-menu/ContextMenuTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/date-input/DateInput.js.map +1 -1
  115. package/dist/components/date-input/DateInput.vue_vue_type_script_setup_true_lang.js +61 -60
  116. package/dist/components/date-input/DateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/components/date-range-field/DateRangeField.js.map +1 -1
  118. package/dist/components/date-range-field/DateRangeField.vue_vue_type_script_setup_true_lang.js +61 -61
  119. package/dist/components/date-range-field/DateRangeField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/date-time-picker/DateTimePicker.js.map +1 -1
  121. package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +13 -13
  122. package/dist/components/date-time-picker/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  123. package/dist/components/dropdown/DropdownCheckboxItem.js.map +1 -1
  124. package/dist/components/dropdown/DropdownCheckboxItem.vue_vue_type_script_setup_true_lang.js +4 -2
  125. package/dist/components/dropdown/DropdownCheckboxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  126. package/dist/components/dropdown/DropdownItem.js.map +1 -1
  127. package/dist/components/dropdown/DropdownItem.vue_vue_type_script_setup_true_lang.js +4 -2
  128. package/dist/components/dropdown/DropdownItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  129. package/dist/components/dropdown/DropdownRadioItem.js.map +1 -1
  130. package/dist/components/dropdown/DropdownRadioItem.vue_vue_type_script_setup_true_lang.js +4 -2
  131. package/dist/components/dropdown/DropdownRadioItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  132. package/dist/components/dropdown/DropdownSubTrigger.js.map +1 -1
  133. package/dist/components/dropdown/DropdownSubTrigger.vue_vue_type_script_setup_true_lang.js +4 -2
  134. package/dist/components/dropdown/DropdownSubTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  135. package/dist/components/dropdown/DropdownTrigger.js.map +1 -1
  136. package/dist/components/dropdown/DropdownTrigger.vue_vue_type_script_setup_true_lang.js +7 -1
  137. package/dist/components/dropdown/DropdownTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/components/editable/Editable.js.map +1 -1
  139. package/dist/components/editable/Editable.vue_vue_type_script_setup_true_lang.js +28 -6
  140. package/dist/components/editable/Editable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  141. package/dist/components/fieldset/Fieldset.js.map +1 -1
  142. package/dist/components/fieldset/Fieldset.vue_vue_type_script_setup_true_lang.js +8 -2
  143. package/dist/components/fieldset/Fieldset.vue_vue_type_script_setup_true_lang.js.map +1 -1
  144. package/dist/components/input/Input.js.map +1 -1
  145. package/dist/components/input/Input.vue_vue_type_script_setup_true_lang.js +76 -71
  146. package/dist/components/input/Input.vue_vue_type_script_setup_true_lang.js.map +1 -1
  147. package/dist/components/input-otp/InputOTP.js.map +1 -1
  148. package/dist/components/input-otp/InputOTP.vue_vue_type_script_setup_true_lang.js +15 -4
  149. package/dist/components/input-otp/InputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  150. package/dist/components/link/Link.js.map +1 -1
  151. package/dist/components/link/Link.vue_vue_type_script_setup_true_lang.js +8 -2
  152. package/dist/components/link/Link.vue_vue_type_script_setup_true_lang.js.map +1 -1
  153. package/dist/components/list-box/ListBox.js.map +1 -1
  154. package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js +7 -1
  155. package/dist/components/list-box/ListBox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  156. package/dist/components/menubar/MenubarCheckboxItem.js.map +1 -1
  157. package/dist/components/menubar/MenubarCheckboxItem.vue_vue_type_script_setup_true_lang.js +4 -2
  158. package/dist/components/menubar/MenubarCheckboxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  159. package/dist/components/menubar/MenubarItem.js.map +1 -1
  160. package/dist/components/menubar/MenubarItem.vue_vue_type_script_setup_true_lang.js +4 -2
  161. package/dist/components/menubar/MenubarItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/menubar/MenubarRadioItem.js.map +1 -1
  163. package/dist/components/menubar/MenubarRadioItem.vue_vue_type_script_setup_true_lang.js +4 -2
  164. package/dist/components/menubar/MenubarRadioItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/menubar/MenubarSubTrigger.js.map +1 -1
  166. package/dist/components/menubar/MenubarSubTrigger.vue_vue_type_script_setup_true_lang.js +4 -2
  167. package/dist/components/menubar/MenubarSubTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/components/menubar/MenubarTrigger.js.map +1 -1
  169. package/dist/components/menubar/MenubarTrigger.vue_vue_type_script_setup_true_lang.js +7 -1
  170. package/dist/components/menubar/MenubarTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/meter/Meter.js.map +1 -1
  172. package/dist/components/meter/Meter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  173. package/dist/components/month-picker/MonthPicker.js.map +1 -1
  174. package/dist/components/month-picker/MonthPicker.vue_vue_type_script_setup_true_lang.js +15 -4
  175. package/dist/components/month-picker/MonthPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  176. package/dist/components/month-range-picker/MonthRangePicker.js.map +1 -1
  177. package/dist/components/month-range-picker/MonthRangePicker.vue_vue_type_script_setup_true_lang.js +15 -4
  178. package/dist/components/month-range-picker/MonthRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/components/navigation-menu/NavigationMenuTrigger.js.map +1 -1
  180. package/dist/components/navigation-menu/NavigationMenuTrigger.vue_vue_type_script_setup_true_lang.js +7 -1
  181. package/dist/components/navigation-menu/NavigationMenuTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  182. package/dist/components/number-field/NumberField.js.map +1 -1
  183. package/dist/components/number-field/NumberField.vue_vue_type_script_setup_true_lang.js +19 -5
  184. package/dist/components/number-field/NumberField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  185. package/dist/components/pagination/Pagination.js.map +1 -1
  186. package/dist/components/pagination/Pagination.vue_vue_type_script_setup_true_lang.js +9 -3
  187. package/dist/components/pagination/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  188. package/dist/components/popover/PopoverClose.js.map +1 -1
  189. package/dist/components/popover/PopoverClose.vue_vue_type_script_setup_true_lang.js +11 -2
  190. package/dist/components/popover/PopoverClose.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/components/progress-bar/ProgressBar.js.map +1 -1
  192. package/dist/components/progress-bar/ProgressBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  193. package/dist/components/progress-circle/ProgressCircle.js.map +1 -1
  194. package/dist/components/progress-circle/ProgressCircle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/components/radio/Radio.js.map +1 -1
  196. package/dist/components/radio/Radio.vue_vue_type_script_setup_true_lang.js +16 -5
  197. package/dist/components/radio/Radio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/components/radio/RadioGroup.js.map +1 -1
  199. package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js +18 -7
  200. package/dist/components/radio/RadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  201. package/dist/components/range-calendar/RangeCalendar.js.map +1 -1
  202. package/dist/components/range-calendar/RangeCalendar.vue_vue_type_script_setup_true_lang.js +19 -8
  203. package/dist/components/range-calendar/RangeCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  204. package/dist/components/select/Select.js.map +1 -1
  205. package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js +55 -51
  206. package/dist/components/select/Select.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/select/SelectItem.js.map +1 -1
  208. package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js +4 -2
  209. package/dist/components/select/SelectItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  210. package/dist/components/select/SelectTrigger.js.map +1 -1
  211. package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js +18 -9
  212. package/dist/components/select/SelectTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  213. package/dist/components/slider/Slider.js.map +1 -1
  214. package/dist/components/slider/Slider.vue_vue_type_script_setup_true_lang.js +16 -5
  215. package/dist/components/slider/Slider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/components/splitter/SplitterResizeHandle.js.map +1 -1
  217. package/dist/components/splitter/SplitterResizeHandle.vue_vue_type_script_setup_true_lang.js +8 -2
  218. package/dist/components/splitter/SplitterResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  219. package/dist/components/switch/Switch.js.map +1 -1
  220. package/dist/components/switch/Switch.vue_vue_type_script_setup_true_lang.js +16 -5
  221. package/dist/components/switch/Switch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  222. package/dist/components/switch/SwitchGroup.js.map +1 -1
  223. package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js +10 -4
  224. package/dist/components/switch/SwitchGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  225. package/dist/components/table/Table.js.map +1 -1
  226. package/dist/components/table/Table.vue_vue_type_script_setup_true_lang.js.map +1 -1
  227. package/dist/components/table/TableBody.js.map +1 -1
  228. package/dist/components/table/TableBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
  229. package/dist/components/table/TableCheckboxCell.js.map +1 -1
  230. package/dist/components/table/TableCheckboxCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/components/table/TableVirtualBody.js.map +1 -1
  232. package/dist/components/table/TableVirtualBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/table/table.context.js.map +1 -1
  234. package/dist/components/tabs/Tab.js.map +1 -1
  235. package/dist/components/tabs/Tab.vue_vue_type_script_setup_true_lang.js +11 -2
  236. package/dist/components/tabs/Tab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  237. package/dist/components/tabs/TabList.js.map +1 -1
  238. package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js +2 -2
  239. package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  240. package/dist/components/tabs/Tabs.js.map +1 -1
  241. package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js +2 -2
  242. package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  243. package/dist/components/textarea/Textarea.js.map +1 -1
  244. package/dist/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js +70 -65
  245. package/dist/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  246. package/dist/components/time-field/TimeField.js.map +1 -1
  247. package/dist/components/time-field/TimeField.vue_vue_type_script_setup_true_lang.js +61 -60
  248. package/dist/components/time-field/TimeField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  249. package/dist/components/time-picker/TimePicker.js +7 -0
  250. package/dist/components/time-picker/TimePicker.js.map +1 -0
  251. package/dist/components/time-picker/TimePicker.vue_vue_type_script_setup_true_lang.js +320 -0
  252. package/dist/components/time-picker/TimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  253. package/dist/components/time-range-field/TimeRangeField.js.map +1 -1
  254. package/dist/components/time-range-field/TimeRangeField.vue_vue_type_script_setup_true_lang.js +61 -61
  255. package/dist/components/time-range-field/TimeRangeField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/components/toolbar/ToolbarButton.js.map +1 -1
  257. package/dist/components/toolbar/ToolbarButton.vue_vue_type_script_setup_true_lang.js +11 -2
  258. package/dist/components/toolbar/ToolbarButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  259. package/dist/components/toolbar/ToolbarToggleGroup.js.map +1 -1
  260. package/dist/components/toolbar/ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js +23 -6
  261. package/dist/components/toolbar/ToolbarToggleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  262. package/dist/components/toolbar/ToolbarToggleItem.js.map +1 -1
  263. package/dist/components/toolbar/ToolbarToggleItem.vue_vue_type_script_setup_true_lang.js +11 -2
  264. package/dist/components/toolbar/ToolbarToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  265. package/dist/components/tooltip/TooltipProvider.js.map +1 -1
  266. package/dist/components/tooltip/TooltipProvider.vue_vue_type_script_setup_true_lang.js +8 -2
  267. package/dist/components/tooltip/TooltipProvider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  268. package/dist/components/tree/Tree.js.map +1 -1
  269. package/dist/components/tree/Tree.vue_vue_type_script_setup_true_lang.js +11 -2
  270. package/dist/components/tree/Tree.vue_vue_type_script_setup_true_lang.js.map +1 -1
  271. package/dist/components/year-range-picker/YearRangePicker.js.map +1 -1
  272. package/dist/components/year-range-picker/YearRangePicker.vue_vue_type_script_setup_true_lang.js +15 -4
  273. package/dist/components/year-range-picker/YearRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  274. package/dist/composables/useDeprecatedBooleanProp.js +43 -0
  275. package/dist/composables/useDeprecatedBooleanProp.js.map +1 -0
  276. package/dist/composables/useFormField.js +50 -0
  277. package/dist/composables/useFormField.js.map +1 -0
  278. package/dist/index.d.ts +845 -580
  279. package/dist/index.js +2 -1
  280. package/dist/utils/warnDeprecated.js +2 -1
  281. package/dist/utils/warnDeprecated.js.map +1 -1
  282. package/package.json +2 -2
  283. package/dist/components/date-time-picker/DateTimePickerTimeScroller.js +0 -7
  284. package/dist/components/date-time-picker/DateTimePickerTimeScroller.js.map +0 -1
  285. package/dist/components/date-time-picker/DateTimePickerTimeScroller.vue_vue_type_script_setup_true_lang.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/slider/Slider.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { SliderRoot, SliderTrack, SliderRange, SliderThumb } from 'reka-ui'\nimport { sliderVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\n\nconst props = withDefaults(defineProps<{\n modelValue?: number | number[]\n defaultValue?: number | number[]\n min?: number\n max?: number\n step?: number\n minStepsBetweenThumbs?: number\n orientation?: 'horizontal' | 'vertical'\n size?: 'sm' | 'md' | 'lg'\n color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger'\n radius?: 'none' | 'sm' | 'md' | 'lg' | 'full'\n label?: string\n showSteps?: boolean\n marks?: Array<{ value: number; label?: string }>\n formatOptions?: Intl.NumberFormatOptions\n hideValue?: boolean\n hideThumb?: boolean\n disabled?: boolean\n inverted?: boolean\n /** Text direction forwarded to SliderRoot. */\n dir?: 'ltr' | 'rtl'\n /** How the thumbs align relative to the track ends. */\n thumbAlignment?: 'contain' | 'overflow'\n /** Whether SliderRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SliderRoot as. */\n as?: string\n /** HTML name attribute forwarded to SliderRoot. */\n name?: string\n /** Whether the slider is required. */\n required?: boolean\n /** Whether SliderTrack renders as a child element. */\n trackAsChild?: boolean\n /** Element or component to render SliderTrack as. */\n trackAs?: string\n /** Whether SliderRange renders as a child element. */\n rangeAsChild?: boolean\n /** Element or component to render SliderRange as. */\n rangeAs?: string\n /** Whether SliderThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SliderThumb as. */\n thumbAs?: string\n class?: ClassValue\n /**\n * Per-slot class overrides. Keys map to internal slot names (base, output, track, fill, marks, thumb).\n */\n classNames?: Partial<{\n base: ClassValue\n output: ClassValue\n track: ClassValue\n fill: ClassValue\n marks: ClassValue\n thumb: ClassValue\n }>\n}>(), {\n min: 0,\n max: 100,\n step: 1,\n minStepsBetweenThumbs: 0,\n orientation: 'horizontal',\n showSteps: false,\n hideValue: false,\n hideThumb: false,\n disabled: false,\n inverted: false,\n dir: undefined,\n thumbAlignment: 'overflow',\n asChild: false,\n as: undefined,\n name: undefined,\n required: false,\n trackAsChild: false,\n trackAs: undefined,\n rangeAsChild: false,\n rangeAs: undefined,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: number | number[]): void\n (e: 'value-commit', value: number | number[]): void\n}>()\n\n// FIX: Also check defaultValue so uncontrolled range mode is detected correctly.\nconst isRange = computed(() =>\n Array.isArray(props.modelValue) || Array.isArray(props.defaultValue)\n)\n\n// Reka UI SliderRoot always uses number[]. Wrap scalar -> [v] for Reka.\nconst internalValue = computed({\n get(): number[] {\n if (props.modelValue === undefined) {\n return props.defaultValue !== undefined\n ? Array.isArray(props.defaultValue)\n ? props.defaultValue\n : [props.defaultValue]\n : [Math.round((props.min + props.max) / 2)]\n }\n return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue]\n },\n set(val: number[]) {\n // Unwrap: if original prop was scalar, emit scalar; otherwise emit array\n if (isRange.value) {\n emit('update:modelValue', val)\n } else {\n emit('update:modelValue', val[0])\n }\n },\n})\n\n// FIX: Pass size, color, radius so variants are applied.\nconst slotFns = computed(() =>\n sliderVariants({ size: props.size, color: props.color, radius: props.radius })\n)\n\n// Show the label/output wrapper if label prop is provided or hideValue is false\nconst showLabelWrapper = computed(() =>\n !!props.label || !props.hideValue\n)\n\n// Format a single value\nfunction formatValue(v: number): string {\n if (props.formatOptions) {\n return new Intl.NumberFormat(undefined, props.formatOptions).format(v)\n }\n return String(v)\n}\n\n// Formatted output string: joined with \" - \" for ranges\nconst formatted = computed(() => {\n return internalValue.value.map(formatValue).join(' \\u2013 ')\n})\n\n// Compute % position for a value within [min, max]\nfunction toPercent(v: number): number {\n const range = props.max - props.min\n if (range === 0) return 0\n return ((v - props.min) / range) * 100\n}\n\n// Tick positions (percentages) for showSteps\nconst tickPositions = computed<number[]>(() => {\n if (!props.showSteps) return []\n const positions: number[] = []\n let v = props.min\n while (v <= props.max) {\n positions.push(toPercent(v))\n v = Math.round((v + props.step) * 1e10) / 1e10 // avoid floating-point drift\n }\n return positions\n})\n\n// Determine which axis to use for positioning (left/bottom)\nconst positionAxis = computed(() =>\n props.orientation === 'vertical' ? 'bottom' : 'left'\n)\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"orientation\"\n :data-disabled=\"disabled || undefined\"\n >\n <!-- Label + output row -->\n <template v-if=\"showLabelWrapper\">\n <!--\n FIX: label does NOT get a class from slotFns.\n The CSS rule `.slider [data-slot=\"label\"]` targets it via data-slot attribute.\n Previously used :class=\"slotFns.base()\" which returned \"slider\" (root class) — wrong.\n -->\n <label\n v-if=\"label\"\n data-slot=\"label\"\n >{{ label }}</label>\n <output\n v-if=\"!hideValue\"\n :class=\"composeClassName(slotFns.output(), props.classNames?.output)\"\n >{{ formatted }}</output>\n </template>\n\n <!-- Slider body -->\n <div class=\"relative flex items-center gap-2\">\n <!-- Start content slot -->\n <slot name=\"startContent\" />\n\n <SliderRoot\n v-model=\"internalValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :min-steps-between-thumbs=\"minStepsBetweenThumbs\"\n :orientation=\"orientation\"\n :disabled=\"disabled\"\n :inverted=\"inverted\"\n :dir=\"props.dir\"\n :thumb-alignment=\"props.thumbAlignment\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :name=\"props.name\"\n :required=\"props.required\"\n class=\"relative flex items-center select-none touch-none w-full\"\n :data-orientation=\"orientation\"\n @value-commit=\"emit('value-commit', isRange ? $event : $event[0])\"\n >\n <SliderTrack\n :as-child=\"props.trackAsChild\"\n :as=\"props.trackAs\"\n :class=\"composeClassName(slotFns.track(), props.classNames?.track)\"\n >\n <SliderRange\n :as-child=\"props.rangeAsChild\"\n :as=\"props.rangeAs\"\n :class=\"composeClassName(slotFns.fill(), props.classNames?.fill)\"\n />\n\n <!--\n FIX: tick spans have NO class from slotFns (was :class=\"slotFns.base()\" = \"slider\" — wrong).\n Ticks are purely positional; identified by data-slider-tick attribute only.\n -->\n <span\n v-for=\"(pct, i) in tickPositions\"\n :key=\"`tick-${i}`\"\n :style=\"{ [positionAxis]: pct + '%' }\"\n aria-hidden=\"true\"\n data-slider-tick\n class=\"absolute pointer-events-none\"\n />\n\n <!-- Labeled marks -->\n <span\n v-for=\"mark in (marks || [])\"\n :key=\"`mark-${mark.value}`\"\n :class=\"composeClassName(slotFns.marks(), props.classNames?.marks)\"\n :style=\"{ [positionAxis]: toPercent(mark.value) + '%' }\"\n data-slider-mark\n class=\"absolute\"\n >{{ mark.label }}</span>\n </SliderTrack>\n\n <!-- Thumbs -->\n <SliderThumb\n v-for=\"(_, idx) in internalValue\"\n :key=\"idx\"\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n :aria-label=\"label || 'Value'\"\n />\n </SliderRoot>\n\n <!-- End content slot -->\n <slot name=\"endContent\" />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAgFd,MAAM,OAAO;EAMb,MAAM,UAAU,eACd,MAAM,QAAQ,MAAM,WAAW,IAAI,MAAM,QAAQ,MAAM,aAAY,CACrE;EAGA,MAAM,gBAAgB,SAAS;GAC7B,MAAgB;AACd,QAAI,MAAM,eAAe,KAAA,EACvB,QAAO,MAAM,iBAAiB,KAAA,IAC1B,MAAM,QAAQ,MAAM,aAAY,GAC9B,MAAM,eACN,CAAC,MAAM,aAAY,GACrB,CAAC,KAAK,OAAO,MAAM,MAAM,MAAM,OAAO,EAAE,CAAA;AAE9C,WAAO,MAAM,QAAQ,MAAM,WAAW,GAAG,MAAM,aAAa,CAAC,MAAM,WAAU;;GAE/E,IAAI,KAAe;AAEjB,QAAI,QAAQ,MACV,MAAK,qBAAqB,IAAG;QAE7B,MAAK,qBAAqB,IAAI,GAAE;;GAGrC,CAAA;EAGD,MAAM,UAAU,eACd,eAAe;GAAE,MAAM,MAAM;GAAM,OAAO,MAAM;GAAO,QAAQ,MAAM;GAAQ,CAAA,CAC/E;EAGA,MAAM,mBAAmB,eACvB,CAAC,CAAC,MAAM,SAAS,CAAC,MAAM,UAC1B;EAGA,SAAS,YAAY,GAAmB;AACtC,OAAI,MAAM,cACR,QAAO,IAAI,KAAK,aAAa,KAAA,GAAW,MAAM,cAAc,CAAC,OAAO,EAAC;AAEvE,UAAO,OAAO,EAAC;;EAIjB,MAAM,YAAY,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,UAAA,MAAA,WANmB,cAAA,QAAX,GAAG,QAAG;0BADhB,YAOE,MAAA,YAAA,EAAA;OALC,KAAK;OACL,YAAU,MAAM;OAChB,IAAI,MAAM;OACV,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,OAAK,EAAI,MAAM,YAAY,MAAK,CAAA;OAChE,cAAY,QAAA,SAAK;;;;;;;;;;;;;;;;;;;;;;;;;;IAKtB,WAA0B,KAAA,QAAA,aAAA"}
1
+ {"version":3,"file":"Slider.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/slider/Slider.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { SliderRoot, SliderTrack, SliderRange, SliderThumb } from 'reka-ui'\nimport { sliderVariants, type SliderVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n modelValue?: number | number[]\n defaultValue?: number | number[]\n min?: number\n max?: number\n step?: number\n minStepsBetweenThumbs?: number\n orientation?: 'horizontal' | 'vertical'\n size?: SliderVariants['size']\n color?: SliderVariants['color']\n radius?: SliderVariants['radius']\n label?: string\n showSteps?: boolean\n marks?: Array<{ value: number; label?: string }>\n formatOptions?: Intl.NumberFormatOptions\n hideValue?: boolean\n hideThumb?: boolean\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n inverted?: boolean\n /** Text direction forwarded to SliderRoot. */\n dir?: 'ltr' | 'rtl'\n /** How the thumbs align relative to the track ends. */\n thumbAlignment?: 'contain' | 'overflow'\n /** Whether SliderRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SliderRoot as. */\n as?: string\n /** HTML name attribute forwarded to SliderRoot. */\n name?: string\n isRequired?: boolean\n /**\n * Whether the slider is required.\n * @deprecated Use isRequired instead.\n */\n required?: boolean\n /** Whether SliderTrack renders as a child element. */\n trackAsChild?: boolean\n /** Element or component to render SliderTrack as. */\n trackAs?: string\n /** Whether SliderRange renders as a child element. */\n rangeAsChild?: boolean\n /** Element or component to render SliderRange as. */\n rangeAs?: string\n /** Whether SliderThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SliderThumb as. */\n thumbAs?: string\n class?: ClassValue\n /**\n * Per-slot class overrides. Keys map to internal slot names (base, output, track, fill, marks, thumb).\n */\n classNames?: Partial<{\n base: ClassValue\n output: ClassValue\n track: ClassValue\n fill: ClassValue\n marks: ClassValue\n thumb: ClassValue\n }>\n}>(), {\n min: 0,\n max: 100,\n step: 1,\n minStepsBetweenThumbs: 0,\n orientation: 'horizontal',\n showSteps: false,\n hideValue: false,\n hideThumb: false,\n isDisabled: undefined,\n disabled: undefined,\n inverted: false,\n dir: undefined,\n thumbAlignment: 'overflow',\n asChild: false,\n as: undefined,\n name: undefined,\n isRequired: undefined,\n required: undefined,\n trackAsChild: false,\n trackAs: undefined,\n rangeAsChild: false,\n rangeAs: undefined,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: number | number[]): void\n (e: 'value-commit', value: number | number[]): void\n}>()\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'Slider', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst isRequired = useDeprecatedBooleanProp(\n 'Slider', 'isRequired', () => props.isRequired, 'required', () => props.required,\n)\n\n// FIX: Also check defaultValue so uncontrolled range mode is detected correctly.\nconst isRange = computed(() =>\n Array.isArray(props.modelValue) || Array.isArray(props.defaultValue)\n)\n\n// Reka UI SliderRoot always uses number[]. Wrap scalar -> [v] for Reka.\nconst internalValue = computed({\n get(): number[] {\n if (props.modelValue === undefined) {\n return props.defaultValue !== undefined\n ? Array.isArray(props.defaultValue)\n ? props.defaultValue\n : [props.defaultValue]\n : [Math.round((props.min + props.max) / 2)]\n }\n return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue]\n },\n set(val: number[]) {\n // Unwrap: if original prop was scalar, emit scalar; otherwise emit array\n if (isRange.value) {\n emit('update:modelValue', val)\n } else {\n emit('update:modelValue', val[0])\n }\n },\n})\n\n// FIX: Pass size, color, radius so variants are applied.\nconst slotFns = computed(() =>\n sliderVariants({ size: props.size, color: props.color, radius: props.radius })\n)\n\n// Show the label/output wrapper if label prop is provided or hideValue is false\nconst showLabelWrapper = computed(() =>\n !!props.label || !props.hideValue\n)\n\n// Format a single value\nfunction formatValue(v: number): string {\n if (props.formatOptions) {\n return new Intl.NumberFormat(undefined, props.formatOptions).format(v)\n }\n return String(v)\n}\n\n// Formatted output string: joined with \" - \" for ranges\nconst formatted = computed(() => {\n return internalValue.value.map(formatValue).join(' \\u2013 ')\n})\n\n// Compute % position for a value within [min, max]\nfunction toPercent(v: number): number {\n const range = props.max - props.min\n if (range === 0) return 0\n return ((v - props.min) / range) * 100\n}\n\n// Tick positions (percentages) for showSteps\nconst tickPositions = computed<number[]>(() => {\n if (!props.showSteps) return []\n const positions: number[] = []\n let v = props.min\n while (v <= props.max) {\n positions.push(toPercent(v))\n v = Math.round((v + props.step) * 1e10) / 1e10 // avoid floating-point drift\n }\n return positions\n})\n\n// Determine which axis to use for positioning (left/bottom)\nconst positionAxis = computed(() =>\n props.orientation === 'vertical' ? 'bottom' : 'left'\n)\n</script>\n\n<template>\n <div\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n :data-orientation=\"orientation\"\n :data-disabled=\"isDisabled || undefined\"\n >\n <!-- Label + output row -->\n <template v-if=\"showLabelWrapper\">\n <!--\n FIX: label does NOT get a class from slotFns.\n The CSS rule `.slider [data-slot=\"label\"]` targets it via data-slot attribute.\n Previously used :class=\"slotFns.base()\" which returned \"slider\" (root class) — wrong.\n -->\n <label\n v-if=\"label\"\n data-slot=\"label\"\n >{{ label }}</label>\n <output\n v-if=\"!hideValue\"\n :class=\"composeClassName(slotFns.output(), props.classNames?.output)\"\n >{{ formatted }}</output>\n </template>\n\n <!-- Slider body -->\n <div class=\"relative flex items-center gap-2\">\n <!-- Start content slot -->\n <slot name=\"startContent\" />\n\n <SliderRoot\n v-model=\"internalValue\"\n :min=\"min\"\n :max=\"max\"\n :step=\"step\"\n :min-steps-between-thumbs=\"minStepsBetweenThumbs\"\n :orientation=\"orientation\"\n :disabled=\"isDisabled\"\n :inverted=\"inverted\"\n :dir=\"props.dir\"\n :thumb-alignment=\"props.thumbAlignment\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :name=\"props.name\"\n :required=\"isRequired\"\n class=\"relative flex items-center select-none touch-none w-full\"\n :data-orientation=\"orientation\"\n @value-commit=\"emit('value-commit', isRange ? $event : $event[0])\"\n >\n <SliderTrack\n :as-child=\"props.trackAsChild\"\n :as=\"props.trackAs\"\n :class=\"composeClassName(slotFns.track(), props.classNames?.track)\"\n >\n <SliderRange\n :as-child=\"props.rangeAsChild\"\n :as=\"props.rangeAs\"\n :class=\"composeClassName(slotFns.fill(), props.classNames?.fill)\"\n />\n\n <!--\n FIX: tick spans have NO class from slotFns (was :class=\"slotFns.base()\" = \"slider\" — wrong).\n Ticks are purely positional; identified by data-slider-tick attribute only.\n -->\n <span\n v-for=\"(pct, i) in tickPositions\"\n :key=\"`tick-${i}`\"\n :style=\"{ [positionAxis]: pct + '%' }\"\n aria-hidden=\"true\"\n data-slider-tick\n class=\"absolute pointer-events-none\"\n />\n\n <!-- Labeled marks -->\n <span\n v-for=\"mark in (marks || [])\"\n :key=\"`mark-${mark.value}`\"\n :class=\"composeClassName(slotFns.marks(), props.classNames?.marks)\"\n :style=\"{ [positionAxis]: toPercent(mark.value) + '%' }\"\n data-slider-mark\n class=\"absolute\"\n >{{ mark.label }}</span>\n </SliderTrack>\n\n <!-- Thumbs -->\n <SliderThumb\n v-for=\"(_, idx) in internalValue\"\n :key=\"idx\"\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n :aria-label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;;;2BAIhB,mBAOE,UAAA,MAAA,WANmB,cAAA,QAAX,GAAG,QAAG;0BADhB,YAOE,MAAA,YAAA,EAAA;OALC,KAAK;OACL,YAAU,MAAM;OAChB,IAAI,MAAM;OACV,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,OAAK,EAAI,MAAM,YAAY,MAAK,CAAA;OAChE,cAAY,QAAA,SAAK;;;;;;;;;;;;;;;;;;;;;;;;;;IAKtB,WAA0B,KAAA,QAAA,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SplitterResizeHandle.js","names":[],"sources":["../../../src/components/splitter/SplitterResizeHandle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { SplitterResizeHandle } from 'reka-ui'\nimport { splitterVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { splitterContextKey } from './Splitter.context'\n\nconst props = withDefaults(defineProps<{\n id?: string\n disabled?: boolean\n class?: ClassValue\n /** Per-slot class overrides */\n classNames?: Partial<{\n handle: ClassValue\n handleBar: ClassValue\n }>\n /** Hit area margins for easier grabbing */\n hitAreaMargins?: object\n /** Tab index for keyboard focus */\n tabindex?: number\n /** Nonce for inline styles */\n nonce?: string\n /** Render as a different element */\n as?: string\n /** Merge props onto child element */\n asChild?: boolean\n}>(), {\n id: undefined,\n disabled: false,\n class: undefined,\n classNames: undefined,\n hitAreaMargins: undefined,\n tabindex: undefined,\n nonce: undefined,\n})\n\ndefineEmits<{\n dragging: [isDragging: boolean]\n}>()\n\nconst groupCtx = inject(splitterContextKey, null)\nconst slotFns = computed(() =>\n splitterVariants({ direction: groupCtx?.direction.value ?? 'horizontal' }),\n)\n</script>\n\n<template>\n <SplitterResizeHandle\n :id=\"id\"\n :disabled=\"disabled\"\n :hit-area-margins=\"(props.hitAreaMargins as any)\"\n :tabindex=\"props.tabindex\"\n :nonce=\"props.nonce\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.handle(), props.class, props.classNames?.handle)\"\n data-slot=\"splitter-handle\"\n @dragging=\"$emit('dragging', $event)\"\n >\n <slot>\n <div :class=\"composeClassName(slotFns.handleBar(), props.classNames?.handleBar)\" />\n </slot>\n </SplitterResizeHandle>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SplitterResizeHandle.js","names":[],"sources":["../../../src/components/splitter/SplitterResizeHandle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { SplitterResizeHandle } from 'reka-ui'\nimport { splitterVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { splitterContextKey } from './Splitter.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n id?: string\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n class?: ClassValue\n /** Per-slot class overrides */\n classNames?: Partial<{\n handle: ClassValue\n handleBar: ClassValue\n }>\n /** Hit area margins for easier grabbing */\n hitAreaMargins?: object\n /** Tab index for keyboard focus */\n tabindex?: number\n /** Nonce for inline styles */\n nonce?: string\n /** Render as a different element */\n as?: string\n /** Merge props onto child element */\n asChild?: boolean\n}>(), {\n id: undefined,\n isDisabled: undefined,\n disabled: undefined,\n class: undefined,\n classNames: undefined,\n hitAreaMargins: undefined,\n tabindex: undefined,\n nonce: undefined,\n})\n\ndefineEmits<{\n dragging: [isDragging: boolean]\n}>()\n\nconst groupCtx = inject(splitterContextKey, null)\nconst slotFns = computed(() =>\n splitterVariants({ direction: groupCtx?.direction.value ?? 'horizontal' }),\n)\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SplitterResizeHandle', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n</script>\n\n<template>\n <SplitterResizeHandle\n :id=\"id\"\n :disabled=\"isDisabled\"\n :hit-area-margins=\"(props.hitAreaMargins as any)\"\n :tabindex=\"props.tabindex\"\n :nonce=\"props.nonce\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.handle(), props.class, props.classNames?.handle)\"\n data-slot=\"splitter-handle\"\n @dragging=\"$emit('dragging', $event)\"\n >\n <slot>\n <div :class=\"composeClassName(slotFns.handleBar(), props.classNames?.handleBar)\" />\n </slot>\n </SplitterResizeHandle>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { composeClassName } from "../../utils/composeClassName.js";
2
+ import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
2
3
  import { splitterContextKey } from "./Splitter.context.js";
3
4
  import { computed, createBlock, createElementVNode, defineComponent, inject, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
4
5
  import { splitterVariants } from "@auronui/styles";
@@ -8,9 +9,13 @@ var SplitterResizeHandle_vue_vue_type_script_setup_true_lang_default = /* @__PUR
8
9
  __name: "SplitterResizeHandle",
9
10
  props: {
10
11
  id: { default: void 0 },
12
+ isDisabled: {
13
+ type: Boolean,
14
+ default: void 0
15
+ },
11
16
  disabled: {
12
17
  type: Boolean,
13
- default: false
18
+ default: void 0
14
19
  },
15
20
  class: {
16
21
  type: [
@@ -34,10 +39,11 @@ var SplitterResizeHandle_vue_vue_type_script_setup_true_lang_default = /* @__PUR
34
39
  const props = __props;
35
40
  const groupCtx = inject(splitterContextKey, null);
36
41
  const slotFns = computed(() => splitterVariants({ direction: groupCtx?.direction.value ?? "horizontal" }));
42
+ const isDisabled = useDeprecatedBooleanProp("SplitterResizeHandle", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
37
43
  return (_ctx, _cache) => {
38
44
  return openBlock(), createBlock(unref(SplitterResizeHandle), {
39
45
  id: __props.id,
40
- disabled: __props.disabled,
46
+ disabled: unref(isDisabled),
41
47
  "hit-area-margins": props.hitAreaMargins,
42
48
  tabindex: props.tabindex,
43
49
  nonce: props.nonce,
@@ -1 +1 @@
1
- {"version":3,"file":"SplitterResizeHandle.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/components/splitter/SplitterResizeHandle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { SplitterResizeHandle } from 'reka-ui'\nimport { splitterVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { splitterContextKey } from './Splitter.context'\n\nconst props = withDefaults(defineProps<{\n id?: string\n disabled?: boolean\n class?: ClassValue\n /** Per-slot class overrides */\n classNames?: Partial<{\n handle: ClassValue\n handleBar: ClassValue\n }>\n /** Hit area margins for easier grabbing */\n hitAreaMargins?: object\n /** Tab index for keyboard focus */\n tabindex?: number\n /** Nonce for inline styles */\n nonce?: string\n /** Render as a different element */\n as?: string\n /** Merge props onto child element */\n asChild?: boolean\n}>(), {\n id: undefined,\n disabled: false,\n class: undefined,\n classNames: undefined,\n hitAreaMargins: undefined,\n tabindex: undefined,\n nonce: undefined,\n})\n\ndefineEmits<{\n dragging: [isDragging: boolean]\n}>()\n\nconst groupCtx = inject(splitterContextKey, null)\nconst slotFns = computed(() =>\n splitterVariants({ direction: groupCtx?.direction.value ?? 'horizontal' }),\n)\n</script>\n\n<template>\n <SplitterResizeHandle\n :id=\"id\"\n :disabled=\"disabled\"\n :hit-area-margins=\"(props.hitAreaMargins as any)\"\n :tabindex=\"props.tabindex\"\n :nonce=\"props.nonce\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.handle(), props.class, props.classNames?.handle)\"\n data-slot=\"splitter-handle\"\n @dragging=\"$emit('dragging', $event)\"\n >\n <slot>\n <div :class=\"composeClassName(slotFns.handleBar(), props.classNames?.handleBar)\" />\n </slot>\n </SplitterResizeHandle>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA,MAAM,QAAQ;EAiCd,MAAM,WAAW,OAAO,oBAAoB,KAAI;EAChD,MAAM,UAAU,eACd,iBAAiB,EAAE,WAAW,UAAU,UAAU,SAAS,cAAc,CAAC,CAC5E;;uBAIE,YAeuB,MAAA,qBAAA,EAAA;IAdpB,IAAI,QAAA;IACJ,UAAU,QAAA;IACV,oBAAmB,MAAM;IACzB,UAAU,MAAM;IAChB,OAAO,MAAM;IACb,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,QAAM,EAAI,MAAM,OAAO,MAAM,YAAY,OAAM,CAAA;IAChF,aAAU;IACT,YAAQ,OAAA,OAAA,OAAA,MAAA,WAAEA,KAAAA,MAAK,YAAa,OAAM;;2BAI5B,CAFP,WAEO,KAAA,QAAA,WAAA,EAAA,QAAA,CADL,mBAAmF,OAAA,EAA7E,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,WAAS,EAAI,MAAM,YAAY,UAAS,CAAA,EAAA,EAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"SplitterResizeHandle.vue_vue_type_script_setup_true_lang.js","names":["$emit"],"sources":["../../../src/components/splitter/SplitterResizeHandle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport { SplitterResizeHandle } from 'reka-ui'\nimport { splitterVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { splitterContextKey } from './Splitter.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\nconst props = withDefaults(defineProps<{\n id?: string\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n class?: ClassValue\n /** Per-slot class overrides */\n classNames?: Partial<{\n handle: ClassValue\n handleBar: ClassValue\n }>\n /** Hit area margins for easier grabbing */\n hitAreaMargins?: object\n /** Tab index for keyboard focus */\n tabindex?: number\n /** Nonce for inline styles */\n nonce?: string\n /** Render as a different element */\n as?: string\n /** Merge props onto child element */\n asChild?: boolean\n}>(), {\n id: undefined,\n isDisabled: undefined,\n disabled: undefined,\n class: undefined,\n classNames: undefined,\n hitAreaMargins: undefined,\n tabindex: undefined,\n nonce: undefined,\n})\n\ndefineEmits<{\n dragging: [isDragging: boolean]\n}>()\n\nconst groupCtx = inject(splitterContextKey, null)\nconst slotFns = computed(() =>\n splitterVariants({ direction: groupCtx?.direction.value ?? 'horizontal' }),\n)\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SplitterResizeHandle', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n</script>\n\n<template>\n <SplitterResizeHandle\n :id=\"id\"\n :disabled=\"isDisabled\"\n :hit-area-margins=\"(props.hitAreaMargins as any)\"\n :tabindex=\"props.tabindex\"\n :nonce=\"props.nonce\"\n :as=\"props.as\"\n :as-child=\"props.asChild\"\n :class=\"composeClassName(slotFns.handle(), props.class, props.classNames?.handle)\"\n data-slot=\"splitter-handle\"\n @dragging=\"$emit('dragging', $event)\"\n >\n <slot>\n <div :class=\"composeClassName(slotFns.handleBar(), props.classNames?.handleBar)\" />\n </slot>\n </SplitterResizeHandle>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EAoCd,MAAM,WAAW,OAAO,oBAAoB,KAAI;EAChD,MAAM,UAAU,eACd,iBAAiB,EAAE,WAAW,UAAU,UAAU,SAAS,cAAc,CAAC,CAC5E;EAEA,MAAM,aAAa,yBACjB,wBAAwB,oBAAoB,MAAM,YAAY,kBAAkB,MAAM,SACxF;;uBAIE,YAeuB,MAAA,qBAAA,EAAA;IAdpB,IAAI,QAAA;IACJ,UAAU,MAAA,WAAU;IACpB,oBAAmB,MAAM;IACzB,UAAU,MAAM;IAChB,OAAO,MAAM;IACb,IAAI,MAAM;IACV,YAAU,MAAM;IAChB,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,QAAM,EAAI,MAAM,OAAO,MAAM,YAAY,OAAM,CAAA;IAChF,aAAU;IACT,YAAQ,OAAA,OAAA,OAAA,MAAA,WAAEA,KAAAA,MAAK,YAAa,OAAM;;2BAI5B,CAFP,WAEO,KAAA,QAAA,WAAA,EAAA,QAAA,CADL,mBAAmF,OAAA,EAA7E,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,WAAS,EAAI,MAAM,YAAY,UAAS,CAAA,EAAA,EAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":[],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isInvalid?: boolean\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n /** Whether the switch is required. */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n disabled: false,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n isInvalid: false,\n asChild: false,\n as: undefined,\n required: false,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n isInvalid: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"isDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Switch.js","names":[],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isInvalid?: boolean\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n isRequired?: boolean\n /**\n * Whether the switch is required.\n * @deprecated Use isRequired instead.\n */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n isDisabled: undefined,\n disabled: undefined,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n isInvalid: false,\n asChild: false,\n as: undefined,\n isRequired: undefined,\n required: undefined,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n isInvalid: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Resolve this switch's own isDisabled/disabled prop pair before combining with group state.\nconst resolvedDisabled = useDeprecatedBooleanProp(\n 'Switch', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst isRequired = useDeprecatedBooleanProp(\n 'Switch', 'isRequired', () => props.isRequired, 'required', () => props.required,\n)\n\n// Prop precedence: group disabled wins (D-02)\nconst effectiveDisabled = computed(() => groupCtx.disabled.value || resolvedDisabled.value)\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"effectiveDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"isRequired\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { composeClassName } from "../../utils/composeClassName.js";
2
+ import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
2
3
  import { useSwitchGroupInject } from "./switch-group.context.js";
3
4
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, ref, renderSlot, unref, useAttrs, withCtx } from "vue";
4
5
  import { switchVariants } from "@auronui/styles";
@@ -22,9 +23,13 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
22
23
  type: Boolean,
23
24
  default: false
24
25
  },
26
+ isDisabled: {
27
+ type: Boolean,
28
+ default: void 0
29
+ },
25
30
  disabled: {
26
31
  type: Boolean,
27
- default: false
32
+ default: void 0
28
33
  },
29
34
  name: { default: void 0 },
30
35
  id: { default: void 0 },
@@ -49,9 +54,13 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
49
54
  default: false
50
55
  },
51
56
  as: { default: void 0 },
57
+ isRequired: {
58
+ type: Boolean,
59
+ default: void 0
60
+ },
52
61
  required: {
53
62
  type: Boolean,
54
- default: false
63
+ default: void 0
55
64
  },
56
65
  thumbAsChild: {
57
66
  type: Boolean,
@@ -80,7 +89,9 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
80
89
  toggleValue: () => {},
81
90
  name: ref(void 0)
82
91
  });
83
- const isDisabled = computed(() => groupCtx.disabled.value || props.disabled);
92
+ const resolvedDisabled = useDeprecatedBooleanProp("Switch", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
93
+ const isRequired = useDeprecatedBooleanProp("Switch", "isRequired", () => props.isRequired, "required", () => props.required);
94
+ const effectiveDisabled = computed(() => groupCtx.disabled.value || resolvedDisabled.value);
84
95
  const effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid);
85
96
  const finalSize = computed(() => props.size ?? groupCtx.size.value);
86
97
  const isInGroup = computed(() => props.value !== void 0);
@@ -96,7 +107,7 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
96
107
  return (_ctx, _cache) => {
97
108
  return openBlock(), createBlock(unref(SwitchRoot), mergeProps(unref(attrs), {
98
109
  "model-value": checked.value,
99
- disabled: isDisabled.value,
110
+ disabled: effectiveDisabled.value,
100
111
  "aria-invalid": effectiveInvalid.value || void 0,
101
112
  name: props.name ?? unref(groupCtx).name.value,
102
113
  value: props.value,
@@ -105,7 +116,7 @@ var Switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
105
116
  "false-value": props.falseValue,
106
117
  "as-child": props.asChild,
107
118
  as: props.as,
108
- required: props.required,
119
+ required: unref(isRequired),
109
120
  class: unref(composeClassName)(slotFns.value.base(), props.class, props.classNames?.base),
110
121
  "onUpdate:modelValue": handleUpdate
111
122
  }), {
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isInvalid?: boolean\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n /** Whether the switch is required. */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n disabled: false,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n isInvalid: false,\n asChild: false,\n as: undefined,\n required: false,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n isInvalid: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Prop precedence: group disabled wins (D-02)\nconst isDisabled = computed(() => groupCtx.disabled.value || props.disabled)\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"isDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"props.required\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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QAAA,EANA,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA,EAAA,EAAA,CACzE,YAIE,MAAA,YAAA,EAAA;KAHC,YAAU,MAAM;KAChB,IAAI,MAAM;KACV,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,OAAK,EAAI,MAAM,YAAY,MAAK,CAAA;;;;;aAI7DA,KAAAA,OAAO,WAAA,WAAA,EADf,mBAKO,QAAA;;KAHJ,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA;QAErE,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Switch.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/switch/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SwitchRoot, SwitchThumb } from 'reka-ui'\nimport { switchVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useSwitchGroupInject } from './switch-group.context'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\n// Disable Vue attribute fallthrough — we manually forward $attrs to SwitchRoot\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isInvalid?: boolean\n value?: string\n modelValue?: boolean\n defaultValue?: boolean\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n name?: string\n /** HTML id attribute forwarded to SwitchRoot. */\n id?: string\n /** The value for the checked state. */\n trueValue?: boolean | string | number\n /** The value for the unchecked state. */\n falseValue?: boolean | string | number\n /** Whether SwitchRoot renders as a child element. */\n asChild?: boolean\n /** Element or component to render SwitchRoot as. */\n as?: string\n isRequired?: boolean\n /**\n * Whether the switch is required.\n * @deprecated Use isRequired instead.\n */\n required?: boolean\n /** Whether SwitchThumb renders as a child element. */\n thumbAsChild?: boolean\n /** Element or component to render SwitchThumb as. */\n thumbAs?: string\n class?: ClassValue\n /** Per-slot class overrides. Each key is a slot name (e.g. 'base', 'control', 'thumb', 'content'). */\n classNames?: Partial<{\n base: ClassValue\n control: ClassValue\n thumb: ClassValue\n content: ClassValue\n }>\n}>(), {\n size: undefined,\n value: undefined,\n modelValue: undefined,\n defaultValue: false,\n isDisabled: undefined,\n disabled: undefined,\n name: undefined,\n id: undefined,\n trueValue: undefined,\n falseValue: undefined,\n isInvalid: false,\n asChild: false,\n as: undefined,\n isRequired: undefined,\n required: undefined,\n thumbAsChild: false,\n thumbAs: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean]\n}>()\n\nconst attrs = useAttrs()\n\n// Inject SwitchGroup context with fallback defaults (standalone mode)\nconst groupCtx = useSwitchGroupInject({\n size: ref('md'),\n disabled: ref(false),\n isInvalid: ref(false),\n selectedValues: ref([]),\n toggleValue: () => {},\n name: ref(undefined),\n})\n\n// Resolve this switch's own isDisabled/disabled prop pair before combining with group state.\nconst resolvedDisabled = useDeprecatedBooleanProp(\n 'Switch', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\nconst isRequired = useDeprecatedBooleanProp(\n 'Switch', 'isRequired', () => props.isRequired, 'required', () => props.required,\n)\n\n// Prop precedence: group disabled wins (D-02)\nconst effectiveDisabled = computed(() => groupCtx.disabled.value || resolvedDisabled.value)\nconst effectiveInvalid = computed(() => groupCtx.isInvalid.value || props.isInvalid)\n\n// Child size wins over group size\nconst finalSize = computed(() => props.size ?? groupCtx.size.value)\n\n// Determine if inside a group (value prop is the signal)\nconst isInGroup = computed(() => props.value !== undefined)\n\n// Compute checked state\nconst checked = computed<boolean>(() => {\n if (isInGroup.value) {\n return groupCtx.selectedValues.value.includes(props.value!)\n }\n return props.modelValue ?? false\n})\n\n// Handle Reka UI's update:checked event\nfunction handleUpdate(val: string | number | boolean) {\n if (isInGroup.value) {\n groupCtx.toggleValue(props.value!)\n } else {\n emit('update:modelValue', Boolean(val))\n }\n}\n\nconst slotFns = computed(() =>\n switchVariants({ size: finalSize.value })\n)\n</script>\n\n<template>\n <!--\n v-bind=\"attrs\" forwards aria-label and other HTML attributes through to Reka UI's\n SwitchRoot, which then applies them to the inner <button> element.\n inheritAttrs: false prevents double-application on SwitchRoot's root.\n -->\n <SwitchRoot\n v-bind=\"attrs\"\n :model-value=\"checked\"\n :disabled=\"effectiveDisabled\"\n :aria-invalid=\"effectiveInvalid || undefined\"\n :name=\"props.name ?? groupCtx.name.value\"\n :value=\"props.value\"\n :id=\"props.id\"\n :true-value=\"props.trueValue\"\n :false-value=\"props.falseValue\"\n :as-child=\"props.asChild\"\n :as=\"props.as\"\n :required=\"isRequired\"\n :class=\"composeClassName(slotFns.base(), props.class, props.classNames?.base)\"\n @update:model-value=\"handleUpdate\"\n >\n <span :class=\"composeClassName(slotFns.control(), props.classNames?.control)\">\n <SwitchThumb\n :as-child=\"props.thumbAsChild\"\n :as=\"props.thumbAs\"\n :class=\"composeClassName(slotFns.thumb(), props.classNames?.thumb)\"\n />\n </span>\n <span\n v-if=\"$slots.default\"\n :class=\"composeClassName(slotFns.content(), props.classNames?.content)\"\n >\n <slot />\n </span>\n </SwitchRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EA0Dd,MAAM,OAAO;EAIb,MAAM,QAAQ,UAAS;EAGvB,MAAM,WAAW,qBAAqB;GACpC,MAAM,IAAI,KAAK;GACf,UAAU,IAAI,MAAM;GACpB,WAAW,IAAI,MAAM;GACrB,gBAAgB,IAAI,EAAE,CAAC;GACvB,mBAAmB;GACnB,MAAM,IAAI,KAAA,EAAU;GACrB,CAAA;EAGD,MAAM,mBA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KAHC,YAAU,MAAM;KAChB,IAAI,MAAM;KACV,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,OAAK,EAAI,MAAM,YAAY,MAAK,CAAA;;;;;aAI7DA,KAAAA,OAAO,WAAA,WAAA,EADf,mBAKO,QAAA;;KAHJ,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,SAAO,EAAI,MAAM,YAAY,QAAO,CAAA;QAErE,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchGroup.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n isInvalid?: boolean\n errorMessage?: string\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\n disabled: false,\n isInvalid: false,\n errorMessage: undefined,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\n// Provide context to child Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n isInvalid: toRef(props, 'isInvalid'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n class=\"switch-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SwitchGroup.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n isInvalid?: boolean\n errorMessage?: string\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\n isDisabled: undefined,\n disabled: undefined,\n isInvalid: false,\n errorMessage: undefined,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SwitchGroup', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\n// Provide context to child Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: isDisabled,\n isInvalid: toRef(props, 'isInvalid'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n class=\"switch-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import { composeClassName } from "../../utils/composeClassName.js";
2
+ import { useDeprecatedBooleanProp } from "../../composables/useDeprecatedBooleanProp.js";
2
3
  import { useSwitchGroupProvide } from "./switch-group.context.js";
3
4
  import Switch_default from "./Switch.js";
4
5
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, withCtx } from "vue";
@@ -21,9 +22,13 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
21
22
  __name: "SwitchGroup",
22
23
  props: {
23
24
  size: { default: "md" },
25
+ isDisabled: {
26
+ type: Boolean,
27
+ default: void 0
28
+ },
24
29
  disabled: {
25
30
  type: Boolean,
26
- default: false
31
+ default: void 0
27
32
  },
28
33
  modelValue: { default: void 0 },
29
34
  defaultValue: { default: void 0 },
@@ -50,9 +55,10 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
50
55
  internalValues.value = next;
51
56
  emit("update:modelValue", next);
52
57
  }
58
+ const isDisabled = useDeprecatedBooleanProp("SwitchGroup", "isDisabled", () => props.isDisabled, "disabled", () => props.disabled);
53
59
  useSwitchGroupProvide({
54
60
  size: toRef(props, "size"),
55
- disabled: toRef(props, "disabled"),
61
+ disabled: isDisabled,
56
62
  isInvalid: toRef(props, "isInvalid"),
57
63
  selectedValues: currentValues,
58
64
  toggleValue,
@@ -77,11 +83,11 @@ var SwitchGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
77
83
  return openBlock(), createBlock(Switch_default, {
78
84
  key: item.value,
79
85
  value: item.value,
80
- disabled: item.disabled
86
+ "is-disabled": item.disabled
81
87
  }, {
82
88
  default: withCtx(() => [createTextVNode(toDisplayString(item.label ?? item.value), 1)]),
83
89
  _: 2
84
- }, 1032, ["value", "disabled"]);
90
+ }, 1032, ["value", "is-disabled"]);
85
91
  }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 })], 2),
86
92
  props.isInvalid && props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(props.errorMessage), 1)) : props.description ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(props.description), 1)) : createCommentVNode("", true)
87
93
  ], 10, _hoisted_1);
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n isInvalid?: boolean\n errorMessage?: string\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\n disabled: false,\n isInvalid: false,\n errorMessage: undefined,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\n// Provide context to child Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n isInvalid: toRef(props, 'isInvalid'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n class=\"switch-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EA2Bd,MAAM,OAAO;EAKb,MAAM,iBAAiB,IAA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,EAAA,EAAA,CAAA,CAAA;;;gBAE9B,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,EAAA,EAAA;IAGT,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAGgC,QAHhC,YAGgC,gBAA5B,MAAM,aAAY,EAAA,EAAA,IAET,MAAM,eAAA,WAAA,EADnB,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"SwitchGroup.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/switch/SwitchGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef } from 'vue'\nimport { switchGroupVariants, type SwitchGroupVariants, type SwitchVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useSwitchGroupProvide } from './switch-group.context'\nimport SwitchInput from './Switch.vue'\nimport { useDeprecatedBooleanProp } from '../../composables/useDeprecatedBooleanProp'\n\ntype SwitchShorthandItem = { value: string; label?: string; disabled?: boolean }\n\nconst props = withDefaults(defineProps<{\n size?: SwitchVariants['size']\n isDisabled?: boolean\n /** @deprecated Use isDisabled instead. */\n disabled?: boolean\n modelValue?: string[]\n defaultValue?: string[]\n name?: string\n orientation?: SwitchGroupVariants['orientation']\n isInvalid?: boolean\n errorMessage?: string\n label?: string\n description?: string\n class?: string\n /** Shorthand API: render switches from an array instead of the compound slot API */\n items?: SwitchShorthandItem[]\n}>(), {\n size: 'md',\n isDisabled: undefined,\n disabled: undefined,\n isInvalid: false,\n errorMessage: undefined,\n modelValue: undefined,\n defaultValue: undefined,\n name: undefined,\n orientation: 'vertical',\n label: undefined,\n description: undefined,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string[]]\n}>()\n\n// Internal state for uncontrolled mode\nconst internalValues = ref<string[]>(props.defaultValue ?? [])\n\n// Current values: controlled (modelValue) or uncontrolled (internalValues)\nconst currentValues = computed(() => props.modelValue ?? internalValues.value)\n\n// Toggle value in the selection list\nfunction toggleValue(value: string) {\n const next = currentValues.value.includes(value)\n ? currentValues.value.filter(v => v !== value)\n : [...currentValues.value, value]\n internalValues.value = next\n emit('update:modelValue', next)\n}\n\nconst isDisabled = useDeprecatedBooleanProp(\n 'SwitchGroup', 'isDisabled', () => props.isDisabled, 'disabled', () => props.disabled,\n)\n\n// Provide context to child Switches\nuseSwitchGroupProvide({\n size: toRef(props, 'size'),\n disabled: isDisabled,\n isInvalid: toRef(props, 'isInvalid'),\n selectedValues: currentValues,\n toggleValue,\n name: toRef(props, 'name'),\n})\n\nconst labelId = `switch-group-label-${Math.random().toString(36).slice(2, 8)}`\n\nconst groupSlots = computed(() =>\n switchGroupVariants({ orientation: props.orientation })\n)\n</script>\n\n<template>\n <div\n role=\"group\"\n :aria-labelledby=\"props.label ? labelId : undefined\"\n :aria-invalid=\"props.isInvalid || undefined\"\n :data-orientation=\"props.orientation\"\n :class=\"composeClassName(groupSlots.base(), props.class)\"\n >\n <span\n v-if=\"props.label\"\n :id=\"labelId\"\n class=\"switch-group__label\"\n >{{ props.label }}</span>\n <div :class=\"groupSlots.items()\">\n <template v-if=\"props.items\">\n <SwitchInput\n v-for=\"item in props.items\"\n :key=\"item.value\"\n :value=\"item.value\"\n :is-disabled=\"item.disabled\"\n >{{ item.label ?? item.value }}</SwitchInput>\n </template>\n <slot v-else />\n </div>\n <span\n v-if=\"props.isInvalid && props.errorMessage\"\n class=\"switch-group__error-message\"\n >{{ props.errorMessage }}</span>\n <span\n v-else-if=\"props.description\"\n class=\"switch-group__description\"\n >{{ props.description }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;EA8Bd,MAAM,OAAO;EAKb,MAAM,iBAAiB,IAAc,MAAM,gBAAgB,EAAE,CAAA;EAG7D,MAAM,gBAAgB,eAAe,MAAM,cAAc,eAAe,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AAA;;;gBAE9B,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,EAAA,EAAA;IAGT,MAAM,aAAa,MAAM,gBAAA,WAAA,EADjC,mBAGgC,QAHhC,YAGgC,gBAA5B,MAAM,aAAY,EAAA,EAAA,IAET,MAAM,eAAA,WAAA,EADnB,mBAG+B,QAH/B,YAG+B,gBAA3B,MAAM,YAAW,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","names":[],"sources":["../../../src/components/table/Table.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// Note: Vue 3.5 generic SFCs do not propagate generic type parameters across\n// component boundaries when used via JSX/mount() in tests. We use ColumnDef<any, any>\n// for props to avoid TS2322 errors while keeping internal TanStack reactivity correct.\nimport { computed, ref, watch, useTemplateRef, h } from 'vue'\nimport {\n useVueTable,\n getCoreRowModel,\n getSortedRowModel,\n type ColumnDef,\n type SortingState,\n type RowSelectionState,\n type Table as TableInstance,\n type RowData,\n type Row,\n} from '@tanstack/vue-table'\nimport { tableVariants, type TableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableProvide } from './table.context'\nimport { useTableKeyboardNav } from './useTableKeyboardNav'\nimport TableHeader from './TableHeader.vue'\nimport TableBody from './TableBody.vue'\nimport TableVirtualBody from './TableVirtualBody.vue'\nimport TableFooter from './TableFooter.vue'\nimport TableCheckboxCell from './TableCheckboxCell.vue'\n\ntype SelectionMode = 'none' | 'single' | 'multiple'\n\nconst props = withDefaults(\n defineProps<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columns: ColumnDef<any, any>[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any[]\n variant?: TableVariants['variant']\n ariaLabel?: string\n /** Row selection mode. 'single' = radio-style; 'multiple' = checkbox + shift+click; 'none' = disabled */\n selection?: SelectionMode\n /** Controlled row selection state (Record<rowId, boolean>). Use v-model:rowSelection */\n rowSelection?: RowSelectionState\n /**\n * Opt-in row virtualization via @tanstack/vue-virtual.\n * - false (default): all rows render in a standard <tbody>\n * - true: always render via TableVirtualBody (only visible rows in DOM)\n * - number N: auto-enable virtualization when data.length > N\n */\n virtualRows?: boolean | number\n /** Estimated row height in px used by the virtualizer (default: 44) */\n estimatedRowHeight?: number\n /** Extra rows to render outside the visible viewport (default: 8) */\n virtualizerOverscan?: number\n /** Per-slot CSS class overrides */\n classNames?: Partial<{\n base: ClassValue\n scrollContainer: ClassValue\n }>\n }>(),\n {\n variant: 'primary',\n ariaLabel: undefined,\n selection: 'none',\n rowSelection: undefined,\n virtualRows: false,\n estimatedRowHeight: 44,\n virtualizerOverscan: 8,\n }\n)\n\nconst emit = defineEmits<{\n 'update:rowSelection': [value: RowSelectionState]\n}>()\n\n// --- Sorting state ----------------------------------------------------\nconst sorting = ref<SortingState>([])\n\n// --- Row selection state (controlled/uncontrolled) -------------------\nconst internalRowSelection = ref<RowSelectionState>(props.rowSelection ?? {})\nwatch(\n () => props.rowSelection,\n (next) => {\n if (next !== undefined) internalRowSelection.value = next\n },\n { deep: true }\n)\n\nfunction updateRowSelection(\n updater: RowSelectionState | ((old: RowSelectionState) => RowSelectionState)\n) {\n const next = typeof updater === 'function' ? updater(internalRowSelection.value) : updater\n internalRowSelection.value = next\n emit('update:rowSelection', next)\n}\n\n// --- Selection column injected at position 0 when enabled -----------\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst selectionColumn: ColumnDef<any, any> = {\n id: '__select__',\n size: 44,\n enableSorting: false,\n header: ({ table: t }) =>\n props.selection === 'multiple'\n ? h(TableCheckboxCell, { table: t as unknown as TableInstance<RowData> })\n : '',\n cell: ({ row: r }) => h(TableCheckboxCell, { row: r as unknown as Row<RowData> }),\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst effectiveColumns = computed<ColumnDef<any, any>[]>(() => {\n if (props.selection === 'none') return props.columns\n return [selectionColumn, ...props.columns]\n})\n\n// --- useVueTable instance ---------------------------------------------\n// Use getters so @tanstack/vue-table tracks prop reactivity.\nconst table = useVueTable({\n get data() {\n return props.data\n },\n get columns() {\n return effectiveColumns.value as ColumnDef<RowData, unknown>[]\n },\n state: {\n get sorting() {\n return sorting.value\n },\n get rowSelection() {\n return internalRowSelection.value\n },\n },\n onSortingChange: (updater) => {\n sorting.value = typeof updater === 'function' ? updater(sorting.value) : updater\n },\n onRowSelectionChange: updateRowSelection,\n get enableRowSelection() {\n return props.selection !== 'none'\n },\n get enableMultiRowSelection() {\n return props.selection === 'multiple'\n },\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n}) as unknown as TableInstance<RowData>\n\n// --- Virtualization ---------------------------------------------------\n/** Whether to use TableVirtualBody instead of TableBody */\nconst useVirtual = computed<boolean>(() => {\n if (props.virtualRows === false) return false\n if (props.virtualRows === true) return true\n if (typeof props.virtualRows === 'number') return props.data.length > props.virtualRows\n return false\n})\n\n// The scroll container wrapping the <table> — passed to the virtualizer\nconst scrollContainerRef = useTemplateRef<HTMLElement>('scrollContainerRef')\n\n// Ref to TableVirtualBody instance so keyboard nav can call scrollToIndex\nconst virtualBodyRef = ref<InstanceType<typeof TableVirtualBody> | null>(null)\n\n// --- Keyboard navigation ----------------------------------------------\nconst rootRef = useTemplateRef<HTMLElement>('rootRef')\n\nconst rowCount = computed(() => props.data.length)\nconst columnCount = computed(() => {\n const firstGroup = table.getHeaderGroups()[0]\n return firstGroup ? firstGroup.headers.length : 0\n})\n\nfunction getCellElement(rowIndex: number, columnIndex: number): HTMLElement | null {\n const root = rootRef.value\n if (!root) return null\n // In virtualized mode, scroll the row into view first so the DOM node exists.\n // The queueMicrotask in useTableKeyboardNav.move() gives Vue one tick to\n // flush the virtualizer's render before focus is attempted.\n if (useVirtual.value && virtualBodyRef.value) {\n virtualBodyRef.value.scrollToIndex(rowIndex)\n }\n return root.querySelector<HTMLElement>(\n `[data-row-index=\"${rowIndex}\"][data-col-index=\"${columnIndex}\"]`\n )\n}\n\nconst keyboardNav = useTableKeyboardNav({ rowCount, columnCount, getCellElement })\n\n// --- Selection context helpers ----------------------------------------\nconst selectionEnabled = computed(() => props.selection !== 'none')\nconst selectionMode = computed(() => props.selection ?? 'none')\n\n// Track last-clicked row index for Shift+Click range selection\nconst lastClickedRowIndex = ref<number | null>(null)\n\nfunction handleRowClick(rowIndex: number, event: MouseEvent) {\n if (props.selection === 'none') return\n const rows = table.getRowModel().rows\n if (props.selection === 'multiple' && event.shiftKey && lastClickedRowIndex.value !== null) {\n const [start, end] = [lastClickedRowIndex.value, rowIndex].sort((a, b) => a - b)\n const next: RowSelectionState = { ...internalRowSelection.value }\n for (let i = start; i <= end; i++) {\n const r = rows[i]\n if (r) next[r.id] = true\n }\n updateRowSelection(next)\n }\n lastClickedRowIndex.value = rowIndex\n}\n\n// --- Context provision -------------------------------------------------\nconst variantRef = computed(() => props.variant ?? 'primary')\nconst activeCell = keyboardNav.activeCell\n\nuseTableProvide({\n table,\n activeCell,\n selectionEnabled,\n selectionMode,\n variant: variantRef,\n handleRowClick,\n})\n\n// --- Slot class derivation -------------------------------------------\nconst slotFns = computed(() => tableVariants({ variant: variantRef.value }))\n\ndefineExpose({ table, keyboardNav, handleRowClick })\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), $attrs.class as string, props.classNames?.base)\">\n <!--\n scroll container: when virtualized, needs a fixed height + overflow:auto\n so the virtualizer can measure the viewport. Consumers should override\n the inline height via a wrapping container or CSS for production use.\n -->\n <div\n ref=\"scrollContainerRef\"\n :class=\"composeClassName(slotFns.scrollContainer(), props.classNames?.scrollContainer)\"\n :style=\"useVirtual ? { height: '400px', overflow: 'auto' } : undefined\"\n >\n <table\n ref=\"rootRef\"\n role=\"grid\"\n :aria-label=\"ariaLabel\"\n :aria-rowcount=\"rowCount\"\n :aria-colcount=\"columnCount\"\n @keydown=\"keyboardNav.onKeydown\"\n >\n <TableHeader />\n <TableBody v-if=\"!useVirtual\">\n <template #cell=\"slotProps\">\n <slot\n name=\"cell\"\n v-bind=\"slotProps\"\n />\n </template>\n </TableBody>\n <TableVirtualBody\n v-else\n ref=\"virtualBodyRef\"\n :scroll-element=\"scrollContainerRef\"\n :estimated-row-height=\"estimatedRowHeight\"\n :overscan=\"virtualizerOverscan\"\n />\n <TableFooter v-if=\"$slots.footer\">\n <slot name=\"footer\" />\n </TableFooter>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Table.js","names":[],"sources":["../../../src/components/table/Table.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TData extends RowData = RowData\">\nimport { computed, ref, watch, useTemplateRef, h } from 'vue'\nimport {\n useVueTable,\n getCoreRowModel,\n getSortedRowModel,\n type ColumnDef,\n type SortingState,\n type RowSelectionState,\n type Table as TableInstance,\n type RowData,\n type Row,\n} from '@tanstack/vue-table'\nimport { tableVariants, type TableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableProvide } from './table.context'\nimport { useTableKeyboardNav } from './useTableKeyboardNav'\nimport TableHeader from './TableHeader.vue'\nimport TableBody from './TableBody.vue'\nimport TableVirtualBody from './TableVirtualBody.vue'\nimport TableFooter from './TableFooter.vue'\nimport TableCheckboxCell from './TableCheckboxCell.vue'\n\ntype SelectionMode = 'none' | 'single' | 'multiple'\n\nconst props = withDefaults(\n defineProps<{\n columns: ColumnDef<TData, any>[]\n data: TData[]\n variant?: TableVariants['variant']\n ariaLabel?: string\n /** Row selection mode. 'single' = radio-style; 'multiple' = checkbox + shift+click; 'none' = disabled */\n selection?: SelectionMode\n /** Controlled row selection state (Record<rowId, boolean>). Use v-model:rowSelection */\n rowSelection?: RowSelectionState\n /**\n * Opt-in row virtualization via @tanstack/vue-virtual.\n * - false (default): all rows render in a standard <tbody>\n * - true: always render via TableVirtualBody (only visible rows in DOM)\n * - number N: auto-enable virtualization when data.length > N\n */\n virtualRows?: boolean | number\n /** Estimated row height in px used by the virtualizer (default: 44) */\n estimatedRowHeight?: number\n /** Extra rows to render outside the visible viewport (default: 8) */\n virtualizerOverscan?: number\n /** Per-slot CSS class overrides */\n classNames?: Partial<{\n base: ClassValue\n scrollContainer: ClassValue\n }>\n }>(),\n {\n variant: 'primary',\n ariaLabel: undefined,\n selection: 'none',\n rowSelection: undefined,\n virtualRows: false,\n estimatedRowHeight: 44,\n virtualizerOverscan: 8,\n }\n)\n\nconst emit = defineEmits<{\n 'update:rowSelection': [value: RowSelectionState]\n}>()\n\n// --- Sorting state ----------------------------------------------------\nconst sorting = ref<SortingState>([])\n\n// --- Row selection state (controlled/uncontrolled) -------------------\nconst internalRowSelection = ref<RowSelectionState>(props.rowSelection ?? {})\nwatch(\n () => props.rowSelection,\n (next) => {\n if (next !== undefined) internalRowSelection.value = next\n },\n { deep: true }\n)\n\nfunction updateRowSelection(\n updater: RowSelectionState | ((old: RowSelectionState) => RowSelectionState)\n) {\n const next = typeof updater === 'function' ? updater(internalRowSelection.value) : updater\n internalRowSelection.value = next\n emit('update:rowSelection', next)\n}\n\n// --- Selection column injected at position 0 when enabled -----------\nconst selectionColumn: ColumnDef<TData, any> = {\n id: '__select__',\n size: 44,\n enableSorting: false,\n // TableCheckboxCell is invoked here via h() (a runtime call, not a compiled\n // template), which — like @vue/test-utils' mount() — does not infer a generic\n // SFC's type parameter from the props passed. It always resolves to the\n // component's default (RowData). Casting through RowData (not TData) here\n // matches what h() actually expects; this is the one narrower assertion the\n // design spec anticipated keeping.\n header: ({ table: t }) =>\n props.selection === 'multiple'\n ? h(TableCheckboxCell, { table: t as unknown as TableInstance<RowData> })\n : '',\n cell: ({ row: r }) => h(TableCheckboxCell, { row: r as unknown as Row<RowData> }),\n}\n\nconst effectiveColumns = computed<ColumnDef<TData, any>[]>(() => {\n if (props.selection === 'none') return props.columns\n return [selectionColumn, ...props.columns]\n})\n\n// --- useVueTable instance ---------------------------------------------\n// Use getters so @tanstack/vue-table tracks prop reactivity.\nconst table = useVueTable({\n get data() {\n return props.data\n },\n get columns() {\n return effectiveColumns.value as ColumnDef<TData, unknown>[]\n },\n state: {\n get sorting() {\n return sorting.value\n },\n get rowSelection() {\n return internalRowSelection.value\n },\n },\n onSortingChange: (updater) => {\n sorting.value = typeof updater === 'function' ? updater(sorting.value) : updater\n },\n onRowSelectionChange: updateRowSelection,\n get enableRowSelection() {\n return props.selection !== 'none'\n },\n get enableMultiRowSelection() {\n return props.selection === 'multiple'\n },\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n})\n\n// --- Virtualization ---------------------------------------------------\n/** Whether to use TableVirtualBody instead of TableBody */\nconst useVirtual = computed<boolean>(() => {\n if (props.virtualRows === false) return false\n if (props.virtualRows === true) return true\n if (typeof props.virtualRows === 'number') return props.data.length > props.virtualRows\n return false\n})\n\n// The scroll container wrapping the <table> — passed to the virtualizer\nconst scrollContainerRef = useTemplateRef<HTMLElement>('scrollContainerRef')\n\n// Ref to TableVirtualBody instance so keyboard nav can call scrollToIndex.\n// InstanceType<typeof TableVirtualBody> no longer resolves now that\n// TableVirtualBody is a generic SFC (its exported type is a generic factory\n// function, not a plain constructor) — declare the exposed shape by hand\n// instead, matching what TableVirtualBody.vue's defineExpose actually provides.\ninterface TableVirtualBodyExpose {\n scrollToIndex: (index: number) => void\n}\nconst virtualBodyRef = ref<TableVirtualBodyExpose | null>(null)\n\n// --- Keyboard navigation ----------------------------------------------\nconst rootRef = useTemplateRef<HTMLElement>('rootRef')\n\nconst rowCount = computed(() => props.data.length)\nconst columnCount = computed(() => {\n const firstGroup = table.getHeaderGroups()[0]\n return firstGroup ? firstGroup.headers.length : 0\n})\n\nfunction getCellElement(rowIndex: number, columnIndex: number): HTMLElement | null {\n const root = rootRef.value\n if (!root) return null\n // In virtualized mode, scroll the row into view first so the DOM node exists.\n // The queueMicrotask in useTableKeyboardNav.move() gives Vue one tick to\n // flush the virtualizer's render before focus is attempted.\n if (useVirtual.value && virtualBodyRef.value) {\n virtualBodyRef.value.scrollToIndex(rowIndex)\n }\n return root.querySelector<HTMLElement>(\n `[data-row-index=\"${rowIndex}\"][data-col-index=\"${columnIndex}\"]`\n )\n}\n\nconst keyboardNav = useTableKeyboardNav({ rowCount, columnCount, getCellElement })\n\n// --- Selection context helpers ----------------------------------------\nconst selectionEnabled = computed(() => props.selection !== 'none')\nconst selectionMode = computed(() => props.selection ?? 'none')\n\n// Track last-clicked row index for Shift+Click range selection\nconst lastClickedRowIndex = ref<number | null>(null)\n\nfunction handleRowClick(rowIndex: number, event: MouseEvent) {\n if (props.selection === 'none') return\n const rows = table.getRowModel().rows\n if (props.selection === 'multiple' && event.shiftKey && lastClickedRowIndex.value !== null) {\n const [start, end] = [lastClickedRowIndex.value, rowIndex].sort((a, b) => a - b)\n const next: RowSelectionState = { ...internalRowSelection.value }\n for (let i = start; i <= end; i++) {\n const r = rows[i]\n if (r) next[r.id] = true\n }\n updateRowSelection(next)\n }\n lastClickedRowIndex.value = rowIndex\n}\n\n// --- Context provision -------------------------------------------------\nconst variantRef = computed(() => props.variant ?? 'primary')\nconst activeCell = keyboardNav.activeCell\n\nuseTableProvide({\n table,\n activeCell,\n selectionEnabled,\n selectionMode,\n variant: variantRef,\n handleRowClick,\n})\n\n// --- Slot class derivation -------------------------------------------\nconst slotFns = computed(() => tableVariants({ variant: variantRef.value }))\n\ndefineExpose({ table, keyboardNav, handleRowClick })\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), $attrs.class as string, props.classNames?.base)\">\n <!--\n scroll container: when virtualized, needs a fixed height + overflow:auto\n so the virtualizer can measure the viewport. Consumers should override\n the inline height via a wrapping container or CSS for production use.\n -->\n <div\n ref=\"scrollContainerRef\"\n :class=\"composeClassName(slotFns.scrollContainer(), props.classNames?.scrollContainer)\"\n :style=\"useVirtual ? { height: '400px', overflow: 'auto' } : undefined\"\n >\n <table\n ref=\"rootRef\"\n role=\"grid\"\n :aria-label=\"ariaLabel\"\n :aria-rowcount=\"rowCount\"\n :aria-colcount=\"columnCount\"\n @keydown=\"keyboardNav.onKeydown\"\n >\n <TableHeader />\n <TableBody v-if=\"!useVirtual\">\n <template #cell=\"slotProps\">\n <slot\n name=\"cell\"\n v-bind=\"slotProps\"\n />\n </template>\n </TableBody>\n <TableVirtualBody\n v-else\n ref=\"virtualBodyRef\"\n :scroll-element=\"scrollContainerRef\"\n :estimated-row-height=\"estimatedRowHeight\"\n :overscan=\"virtualizerOverscan\"\n />\n <TableFooter v-if=\"$slots.footer\">\n <slot name=\"footer\" />\n </TableFooter>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots"],"sources":["../../../src/components/table/Table.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// Note: Vue 3.5 generic SFCs do not propagate generic type parameters across\n// component boundaries when used via JSX/mount() in tests. We use ColumnDef<any, any>\n// for props to avoid TS2322 errors while keeping internal TanStack reactivity correct.\nimport { computed, ref, watch, useTemplateRef, h } from 'vue'\nimport {\n useVueTable,\n getCoreRowModel,\n getSortedRowModel,\n type ColumnDef,\n type SortingState,\n type RowSelectionState,\n type Table as TableInstance,\n type RowData,\n type Row,\n} from '@tanstack/vue-table'\nimport { tableVariants, type TableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableProvide } from './table.context'\nimport { useTableKeyboardNav } from './useTableKeyboardNav'\nimport TableHeader from './TableHeader.vue'\nimport TableBody from './TableBody.vue'\nimport TableVirtualBody from './TableVirtualBody.vue'\nimport TableFooter from './TableFooter.vue'\nimport TableCheckboxCell from './TableCheckboxCell.vue'\n\ntype SelectionMode = 'none' | 'single' | 'multiple'\n\nconst props = withDefaults(\n defineProps<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columns: ColumnDef<any, any>[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: any[]\n variant?: TableVariants['variant']\n ariaLabel?: string\n /** Row selection mode. 'single' = radio-style; 'multiple' = checkbox + shift+click; 'none' = disabled */\n selection?: SelectionMode\n /** Controlled row selection state (Record<rowId, boolean>). Use v-model:rowSelection */\n rowSelection?: RowSelectionState\n /**\n * Opt-in row virtualization via @tanstack/vue-virtual.\n * - false (default): all rows render in a standard <tbody>\n * - true: always render via TableVirtualBody (only visible rows in DOM)\n * - number N: auto-enable virtualization when data.length > N\n */\n virtualRows?: boolean | number\n /** Estimated row height in px used by the virtualizer (default: 44) */\n estimatedRowHeight?: number\n /** Extra rows to render outside the visible viewport (default: 8) */\n virtualizerOverscan?: number\n /** Per-slot CSS class overrides */\n classNames?: Partial<{\n base: ClassValue\n scrollContainer: ClassValue\n }>\n }>(),\n {\n variant: 'primary',\n ariaLabel: undefined,\n selection: 'none',\n rowSelection: undefined,\n virtualRows: false,\n estimatedRowHeight: 44,\n virtualizerOverscan: 8,\n }\n)\n\nconst emit = defineEmits<{\n 'update:rowSelection': [value: RowSelectionState]\n}>()\n\n// --- Sorting state ----------------------------------------------------\nconst sorting = ref<SortingState>([])\n\n// --- Row selection state (controlled/uncontrolled) -------------------\nconst internalRowSelection = ref<RowSelectionState>(props.rowSelection ?? {})\nwatch(\n () => props.rowSelection,\n (next) => {\n if (next !== undefined) internalRowSelection.value = next\n },\n { deep: true }\n)\n\nfunction updateRowSelection(\n updater: RowSelectionState | ((old: RowSelectionState) => RowSelectionState)\n) {\n const next = typeof updater === 'function' ? updater(internalRowSelection.value) : updater\n internalRowSelection.value = next\n emit('update:rowSelection', next)\n}\n\n// --- Selection column injected at position 0 when enabled -----------\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst selectionColumn: ColumnDef<any, any> = {\n id: '__select__',\n size: 44,\n enableSorting: false,\n header: ({ table: t }) =>\n props.selection === 'multiple'\n ? h(TableCheckboxCell, { table: t as unknown as TableInstance<RowData> })\n : '',\n cell: ({ row: r }) => h(TableCheckboxCell, { row: r as unknown as Row<RowData> }),\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst effectiveColumns = computed<ColumnDef<any, any>[]>(() => {\n if (props.selection === 'none') return props.columns\n return [selectionColumn, ...props.columns]\n})\n\n// --- useVueTable instance ---------------------------------------------\n// Use getters so @tanstack/vue-table tracks prop reactivity.\nconst table = useVueTable({\n get data() {\n return props.data\n },\n get columns() {\n return effectiveColumns.value as ColumnDef<RowData, unknown>[]\n },\n state: {\n get sorting() {\n return sorting.value\n },\n get rowSelection() {\n return internalRowSelection.value\n },\n },\n onSortingChange: (updater) => {\n sorting.value = typeof updater === 'function' ? updater(sorting.value) : updater\n },\n onRowSelectionChange: updateRowSelection,\n get enableRowSelection() {\n return props.selection !== 'none'\n },\n get enableMultiRowSelection() {\n return props.selection === 'multiple'\n },\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n}) as unknown as TableInstance<RowData>\n\n// --- Virtualization ---------------------------------------------------\n/** Whether to use TableVirtualBody instead of TableBody */\nconst useVirtual = computed<boolean>(() => {\n if (props.virtualRows === false) return false\n if (props.virtualRows === true) return true\n if (typeof props.virtualRows === 'number') return props.data.length > props.virtualRows\n return false\n})\n\n// The scroll container wrapping the <table> — passed to the virtualizer\nconst scrollContainerRef = useTemplateRef<HTMLElement>('scrollContainerRef')\n\n// Ref to TableVirtualBody instance so keyboard nav can call scrollToIndex\nconst virtualBodyRef = ref<InstanceType<typeof TableVirtualBody> | null>(null)\n\n// --- Keyboard navigation ----------------------------------------------\nconst rootRef = useTemplateRef<HTMLElement>('rootRef')\n\nconst rowCount = computed(() => props.data.length)\nconst columnCount = computed(() => {\n const firstGroup = table.getHeaderGroups()[0]\n return firstGroup ? firstGroup.headers.length : 0\n})\n\nfunction getCellElement(rowIndex: number, columnIndex: number): HTMLElement | null {\n const root = rootRef.value\n if (!root) return null\n // In virtualized mode, scroll the row into view first so the DOM node exists.\n // The queueMicrotask in useTableKeyboardNav.move() gives Vue one tick to\n // flush the virtualizer's render before focus is attempted.\n if (useVirtual.value && virtualBodyRef.value) {\n virtualBodyRef.value.scrollToIndex(rowIndex)\n }\n return root.querySelector<HTMLElement>(\n `[data-row-index=\"${rowIndex}\"][data-col-index=\"${columnIndex}\"]`\n )\n}\n\nconst keyboardNav = useTableKeyboardNav({ rowCount, columnCount, getCellElement })\n\n// --- Selection context helpers ----------------------------------------\nconst selectionEnabled = computed(() => props.selection !== 'none')\nconst selectionMode = computed(() => props.selection ?? 'none')\n\n// Track last-clicked row index for Shift+Click range selection\nconst lastClickedRowIndex = ref<number | null>(null)\n\nfunction handleRowClick(rowIndex: number, event: MouseEvent) {\n if (props.selection === 'none') return\n const rows = table.getRowModel().rows\n if (props.selection === 'multiple' && event.shiftKey && lastClickedRowIndex.value !== null) {\n const [start, end] = [lastClickedRowIndex.value, rowIndex].sort((a, b) => a - b)\n const next: RowSelectionState = { ...internalRowSelection.value }\n for (let i = start; i <= end; i++) {\n const r = rows[i]\n if (r) next[r.id] = true\n }\n updateRowSelection(next)\n }\n lastClickedRowIndex.value = rowIndex\n}\n\n// --- Context provision -------------------------------------------------\nconst variantRef = computed(() => props.variant ?? 'primary')\nconst activeCell = keyboardNav.activeCell\n\nuseTableProvide({\n table,\n activeCell,\n selectionEnabled,\n selectionMode,\n variant: variantRef,\n handleRowClick,\n})\n\n// --- Slot class derivation -------------------------------------------\nconst slotFns = computed(() => tableVariants({ variant: variantRef.value }))\n\ndefineExpose({ table, keyboardNav, handleRowClick })\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), $attrs.class as string, props.classNames?.base)\">\n <!--\n scroll container: when virtualized, needs a fixed height + overflow:auto\n so the virtualizer can measure the viewport. Consumers should override\n the inline height via a wrapping container or CSS for production use.\n -->\n <div\n ref=\"scrollContainerRef\"\n :class=\"composeClassName(slotFns.scrollContainer(), props.classNames?.scrollContainer)\"\n :style=\"useVirtual ? { height: '400px', overflow: 'auto' } : undefined\"\n >\n <table\n ref=\"rootRef\"\n role=\"grid\"\n :aria-label=\"ariaLabel\"\n :aria-rowcount=\"rowCount\"\n :aria-colcount=\"columnCount\"\n @keydown=\"keyboardNav.onKeydown\"\n >\n <TableHeader />\n <TableBody v-if=\"!useVirtual\">\n <template #cell=\"slotProps\">\n <slot\n name=\"cell\"\n v-bind=\"slotProps\"\n />\n </template>\n </TableBody>\n <TableVirtualBody\n v-else\n ref=\"virtualBodyRef\"\n :scroll-element=\"scrollContainerRef\"\n :estimated-row-height=\"estimatedRowHeight\"\n :overscan=\"virtualizerOverscan\"\n />\n <TableFooter v-if=\"$slots.footer\">\n <slot name=\"footer\" />\n </TableFooter>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,MAAM,QAAQ;EAwCd,MAAM,OAAO;EAKb,MAAM,UAAU,IAAkB,EAAE,CAAA;EAGpC,MAAM,uBAAuB,IAAuB,MAAM,gBAAgB,EAAE,CAAA;AAC5E,cACQ,MAAM,eACX,SAAS;AACR,OAAI,SAAS,KAAA,EAAW,sBAAqB,QAAQ;KAEvD,EAAE,MAAM,MAAK,CACf;EAEA,SAAS,mBACP,SACA;GACA,MAAM,OAAO,OAAO,YAAY,aAAa,QAAQ,qBAAqB,MAAM,GAAG;AACnF,wBAAqB,QAAQ;AAC7B,QAAK,uBAAuB,KAAI;;EAKlC,MAAM,kBAAuC;GAC3C,IAAI;GACJ,MAAM;GACN,eAAe;GACf,SAAS,EAAE,OAAO,QAChB,MAAM,cAAc,aAChB,EAAE,2BAAmB,EAAE,OAAO,GAAwC,CAAA,GACtE;GACN,OAAO,EAAE,KAAK,QAAQ,EAAE,2BAAmB,EAAE,KAAK,GAA8B,CAAC;GACnF;EAGA,MAAM,mBAAmB,eAAsC;AAC7D,OAAI,MAAM,cAAc,OAAQ,QAAO,MAAM;AAC7C,UAAO,CAAC,iBAAiB,GAAG,MAAM,QAAO;IAC1C;EAID,MAAM,QAAQ,YAAY;GACxB,IAAI,OAAO;AACT,WAAO,MAAM;;GAEf,IAAI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A,YAAW,CAAC,UAAS,GAAA,KAAA;;IAE/B,YAAe,oBAAA;KACG,WAAA,SAAA,WAAA,EAAlB,YAOY,mBAAA,EAAA,KAAA,GAAA,EAAA;KANC,MAAI,SAAE,cAAS,CACxB,WAGE,KAAA,QAAA,QAAA,eAAA,mBADQ,UAAS,CAAA,CAAA,CAAA,CAAA;;wBAIvB,YAME,0BAAA;;cAJI;KAAJ,KAAI;KACH,kBAAgB,mBAAA;KAChB,wBAAsB,QAAA;KACtB,UAAU,QAAA;;;;;;IAEMC,KAAAA,OAAO,UAAA,WAAA,EAA1B,YAEc,qBAAA,EAAA,KAAA,GAAA,EAAA;4BADU,CAAtB,WAAsB,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"Table.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots"],"sources":["../../../src/components/table/Table.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TData extends RowData = RowData\">\nimport { computed, ref, watch, useTemplateRef, h } from 'vue'\nimport {\n useVueTable,\n getCoreRowModel,\n getSortedRowModel,\n type ColumnDef,\n type SortingState,\n type RowSelectionState,\n type Table as TableInstance,\n type RowData,\n type Row,\n} from '@tanstack/vue-table'\nimport { tableVariants, type TableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableProvide } from './table.context'\nimport { useTableKeyboardNav } from './useTableKeyboardNav'\nimport TableHeader from './TableHeader.vue'\nimport TableBody from './TableBody.vue'\nimport TableVirtualBody from './TableVirtualBody.vue'\nimport TableFooter from './TableFooter.vue'\nimport TableCheckboxCell from './TableCheckboxCell.vue'\n\ntype SelectionMode = 'none' | 'single' | 'multiple'\n\nconst props = withDefaults(\n defineProps<{\n columns: ColumnDef<TData, any>[]\n data: TData[]\n variant?: TableVariants['variant']\n ariaLabel?: string\n /** Row selection mode. 'single' = radio-style; 'multiple' = checkbox + shift+click; 'none' = disabled */\n selection?: SelectionMode\n /** Controlled row selection state (Record<rowId, boolean>). Use v-model:rowSelection */\n rowSelection?: RowSelectionState\n /**\n * Opt-in row virtualization via @tanstack/vue-virtual.\n * - false (default): all rows render in a standard <tbody>\n * - true: always render via TableVirtualBody (only visible rows in DOM)\n * - number N: auto-enable virtualization when data.length > N\n */\n virtualRows?: boolean | number\n /** Estimated row height in px used by the virtualizer (default: 44) */\n estimatedRowHeight?: number\n /** Extra rows to render outside the visible viewport (default: 8) */\n virtualizerOverscan?: number\n /** Per-slot CSS class overrides */\n classNames?: Partial<{\n base: ClassValue\n scrollContainer: ClassValue\n }>\n }>(),\n {\n variant: 'primary',\n ariaLabel: undefined,\n selection: 'none',\n rowSelection: undefined,\n virtualRows: false,\n estimatedRowHeight: 44,\n virtualizerOverscan: 8,\n }\n)\n\nconst emit = defineEmits<{\n 'update:rowSelection': [value: RowSelectionState]\n}>()\n\n// --- Sorting state ----------------------------------------------------\nconst sorting = ref<SortingState>([])\n\n// --- Row selection state (controlled/uncontrolled) -------------------\nconst internalRowSelection = ref<RowSelectionState>(props.rowSelection ?? {})\nwatch(\n () => props.rowSelection,\n (next) => {\n if (next !== undefined) internalRowSelection.value = next\n },\n { deep: true }\n)\n\nfunction updateRowSelection(\n updater: RowSelectionState | ((old: RowSelectionState) => RowSelectionState)\n) {\n const next = typeof updater === 'function' ? updater(internalRowSelection.value) : updater\n internalRowSelection.value = next\n emit('update:rowSelection', next)\n}\n\n// --- Selection column injected at position 0 when enabled -----------\nconst selectionColumn: ColumnDef<TData, any> = {\n id: '__select__',\n size: 44,\n enableSorting: false,\n // TableCheckboxCell is invoked here via h() (a runtime call, not a compiled\n // template), which — like @vue/test-utils' mount() — does not infer a generic\n // SFC's type parameter from the props passed. It always resolves to the\n // component's default (RowData). Casting through RowData (not TData) here\n // matches what h() actually expects; this is the one narrower assertion the\n // design spec anticipated keeping.\n header: ({ table: t }) =>\n props.selection === 'multiple'\n ? h(TableCheckboxCell, { table: t as unknown as TableInstance<RowData> })\n : '',\n cell: ({ row: r }) => h(TableCheckboxCell, { row: r as unknown as Row<RowData> }),\n}\n\nconst effectiveColumns = computed<ColumnDef<TData, any>[]>(() => {\n if (props.selection === 'none') return props.columns\n return [selectionColumn, ...props.columns]\n})\n\n// --- useVueTable instance ---------------------------------------------\n// Use getters so @tanstack/vue-table tracks prop reactivity.\nconst table = useVueTable({\n get data() {\n return props.data\n },\n get columns() {\n return effectiveColumns.value as ColumnDef<TData, unknown>[]\n },\n state: {\n get sorting() {\n return sorting.value\n },\n get rowSelection() {\n return internalRowSelection.value\n },\n },\n onSortingChange: (updater) => {\n sorting.value = typeof updater === 'function' ? updater(sorting.value) : updater\n },\n onRowSelectionChange: updateRowSelection,\n get enableRowSelection() {\n return props.selection !== 'none'\n },\n get enableMultiRowSelection() {\n return props.selection === 'multiple'\n },\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n})\n\n// --- Virtualization ---------------------------------------------------\n/** Whether to use TableVirtualBody instead of TableBody */\nconst useVirtual = computed<boolean>(() => {\n if (props.virtualRows === false) return false\n if (props.virtualRows === true) return true\n if (typeof props.virtualRows === 'number') return props.data.length > props.virtualRows\n return false\n})\n\n// The scroll container wrapping the <table> — passed to the virtualizer\nconst scrollContainerRef = useTemplateRef<HTMLElement>('scrollContainerRef')\n\n// Ref to TableVirtualBody instance so keyboard nav can call scrollToIndex.\n// InstanceType<typeof TableVirtualBody> no longer resolves now that\n// TableVirtualBody is a generic SFC (its exported type is a generic factory\n// function, not a plain constructor) — declare the exposed shape by hand\n// instead, matching what TableVirtualBody.vue's defineExpose actually provides.\ninterface TableVirtualBodyExpose {\n scrollToIndex: (index: number) => void\n}\nconst virtualBodyRef = ref<TableVirtualBodyExpose | null>(null)\n\n// --- Keyboard navigation ----------------------------------------------\nconst rootRef = useTemplateRef<HTMLElement>('rootRef')\n\nconst rowCount = computed(() => props.data.length)\nconst columnCount = computed(() => {\n const firstGroup = table.getHeaderGroups()[0]\n return firstGroup ? firstGroup.headers.length : 0\n})\n\nfunction getCellElement(rowIndex: number, columnIndex: number): HTMLElement | null {\n const root = rootRef.value\n if (!root) return null\n // In virtualized mode, scroll the row into view first so the DOM node exists.\n // The queueMicrotask in useTableKeyboardNav.move() gives Vue one tick to\n // flush the virtualizer's render before focus is attempted.\n if (useVirtual.value && virtualBodyRef.value) {\n virtualBodyRef.value.scrollToIndex(rowIndex)\n }\n return root.querySelector<HTMLElement>(\n `[data-row-index=\"${rowIndex}\"][data-col-index=\"${columnIndex}\"]`\n )\n}\n\nconst keyboardNav = useTableKeyboardNav({ rowCount, columnCount, getCellElement })\n\n// --- Selection context helpers ----------------------------------------\nconst selectionEnabled = computed(() => props.selection !== 'none')\nconst selectionMode = computed(() => props.selection ?? 'none')\n\n// Track last-clicked row index for Shift+Click range selection\nconst lastClickedRowIndex = ref<number | null>(null)\n\nfunction handleRowClick(rowIndex: number, event: MouseEvent) {\n if (props.selection === 'none') return\n const rows = table.getRowModel().rows\n if (props.selection === 'multiple' && event.shiftKey && lastClickedRowIndex.value !== null) {\n const [start, end] = [lastClickedRowIndex.value, rowIndex].sort((a, b) => a - b)\n const next: RowSelectionState = { ...internalRowSelection.value }\n for (let i = start; i <= end; i++) {\n const r = rows[i]\n if (r) next[r.id] = true\n }\n updateRowSelection(next)\n }\n lastClickedRowIndex.value = rowIndex\n}\n\n// --- Context provision -------------------------------------------------\nconst variantRef = computed(() => props.variant ?? 'primary')\nconst activeCell = keyboardNav.activeCell\n\nuseTableProvide({\n table,\n activeCell,\n selectionEnabled,\n selectionMode,\n variant: variantRef,\n handleRowClick,\n})\n\n// --- Slot class derivation -------------------------------------------\nconst slotFns = computed(() => tableVariants({ variant: variantRef.value }))\n\ndefineExpose({ table, keyboardNav, handleRowClick })\n</script>\n\n<template>\n <div :class=\"composeClassName(slotFns.base(), $attrs.class as string, props.classNames?.base)\">\n <!--\n scroll container: when virtualized, needs a fixed height + overflow:auto\n so the virtualizer can measure the viewport. Consumers should override\n the inline height via a wrapping container or CSS for production use.\n -->\n <div\n ref=\"scrollContainerRef\"\n :class=\"composeClassName(slotFns.scrollContainer(), props.classNames?.scrollContainer)\"\n :style=\"useVirtual ? { height: '400px', overflow: 'auto' } : undefined\"\n >\n <table\n ref=\"rootRef\"\n role=\"grid\"\n :aria-label=\"ariaLabel\"\n :aria-rowcount=\"rowCount\"\n :aria-colcount=\"columnCount\"\n @keydown=\"keyboardNav.onKeydown\"\n >\n <TableHeader />\n <TableBody v-if=\"!useVirtual\">\n <template #cell=\"slotProps\">\n <slot\n name=\"cell\"\n v-bind=\"slotProps\"\n />\n </template>\n </TableBody>\n <TableVirtualBody\n v-else\n ref=\"virtualBodyRef\"\n :scroll-element=\"scrollContainerRef\"\n :estimated-row-height=\"estimatedRowHeight\"\n :overscan=\"virtualizerOverscan\"\n />\n <TableFooter v-if=\"$slots.footer\">\n <slot name=\"footer\" />\n </TableFooter>\n </table>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBA,MAAM,QAAQ;EAsCd,MAAM,OAAO;EAKb,MAAM,UAAU,IAAkB,EAAE,CAAA;EAGpC,MAAM,uBAAuB,IAAuB,MAAM,gBAAgB,EAAE,CAAA;AAC5E,cACQ,MAAM,eACX,SAAS;AACR,OAAI,SAAS,KAAA,EAAW,sBAAqB,QAAQ;KAEvD,EAAE,MAAM,MAAK,CACf;EAEA,SAAS,mBACP,SACA;GACA,MAAM,OAAO,OAAO,YAAY,aAAa,QAAQ,qBAAqB,MAAM,GAAG;AACnF,wBAAqB,QAAQ;AAC7B,QAAK,uBAAuB,KAAI;;EAIlC,MAAM,kBAAyC;GAC7C,IAAI;GACJ,MAAM;GACN,eAAe;GAOf,SAAS,EAAE,OAAO,QAChB,MAAM,cAAc,aAChB,EAAE,2BAAmB,EAAE,OAAO,GAAwC,CAAA,GACtE;GACN,OAAO,EAAE,KAAK,QAAQ,EAAE,2BAAmB,EAAE,KAAK,GAA8B,CAAC;GACnF;EAEA,MAAM,mBAAmB,eA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,SAAA;aA1BF;IAAJ,KAAI;IACJ,MAAK;IACJ,cAAY,QAAA;IACZ,iBAAe,SAAA;IACf,iBAAe,YAAA;IACf,WAAO,OAAA,OAAA,OAAA,MAAA,GAAA,SAAE,MAAA,YAAW,CAAC,aAAZ,MAAA,YAAW,CAAC,UAAS,GAAA,KAAA;;IAE/B,YAAe,oBAAA;KACG,WAAA,SAAA,WAAA,EAAlB,YAOY,mBAAA,EAAA,KAAA,GAAA,EAAA;KANC,MAAI,SAAE,cAAS,CACxB,WAGE,KAAA,QAAA,QAAA,eAAA,mBADQ,UAAS,CAAA,CAAA,CAAA,CAAA;;wBAIvB,YAME,0BAAA;;cAJI;KAAJ,KAAI;KACH,kBAAgB,mBAAA;KAChB,wBAAsB,QAAA;KACtB,UAAU,QAAA;;;;;;IAEMC,KAAAA,OAAO,UAAA,WAAA,EAA1B,YAEc,qBAAA,EAAA,KAAA,GAAA,EAAA;4BADU,CAAtB,WAAsB,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","names":[],"sources":["../../../src/components/table/TableBody.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { FlexRender, type Row, type RowData } from '@tanstack/vue-table'\nimport { tableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableInject } from './table.context'\n\ninterface Props {\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n *\n * @example\n * ```vue\n * <TableBody :class-names=\"{ row: 'bg-blue-50', cell: 'border-blue-200' }\" />\n * ```\n *\n * Available slots: `body`, `row`, `cell`.\n */\n classNames?: Partial<{\n body: ClassValue\n row: ClassValue\n cell: ClassValue\n }>\n}\n\nconst props = defineProps<Props>()\n\nconst ctx = useTableInject()\nconst slotFns = computed(() => tableVariants({ variant: ctx.variant.value }))\n\nfunction onRowKeydown(row: Row<RowData>, event: KeyboardEvent) {\n // Space on a gridcell toggles row selection\n if (event.key !== ' ') return\n if (ctx.selectionMode.value === 'none') return\n // Do NOT handle Space when target is inside a checkbox element (it handles its own Space)\n const target = event.target as HTMLElement\n if (target.tagName === 'INPUT' || target.closest('[role=\"checkbox\"]')) return\n event.preventDefault()\n if (ctx.selectionMode.value === 'single') {\n // Single-select: clear all, select just this one\n ctx.table.setRowSelection({ [row.id]: true })\n } else {\n row.toggleSelected()\n }\n}\n</script>\n\n<template>\n <tbody :class=\"composeClassName(slotFns.body(), props.classNames?.body)\">\n <tr\n v-for=\"(row, rowIndex) in ctx.table.getRowModel().rows\"\n :key=\"row.id\"\n role=\"row\"\n :class=\"composeClassName(slotFns.row(), props.classNames?.row)\"\n :aria-rowindex=\"rowIndex + 1\"\n :aria-selected=\"ctx.selectionMode.value !== 'none' ? row.getIsSelected() : undefined\"\n :data-state=\"row.getIsSelected() ? 'checked' : undefined\"\n @click=\"(e: MouseEvent) => ctx.handleRowClick(rowIndex, e)\"\n @keydown=\"(e: KeyboardEvent) => onRowKeydown(row, e)\"\n >\n <td\n v-for=\"(cell, colIndex) in row.getVisibleCells()\"\n :key=\"cell.id\"\n role=\"gridcell\"\n :class=\"composeClassName(slotFns.cell(), props.classNames?.cell)\"\n :data-row-index=\"rowIndex\"\n :data-col-index=\"colIndex\"\n :tabindex=\"ctx.activeCell.value && ctx.activeCell.value.rowIndex === rowIndex && ctx.activeCell.value.columnIndex === colIndex ? 0 : (ctx.activeCell.value === null && rowIndex === 0 && colIndex === 0 ? 0 : -1)\"\n >\n <slot\n name=\"cell\"\n :row=\"row\"\n :cell=\"cell\"\n :column=\"cell.column\"\n :value=\"cell.getValue()\"\n >\n <FlexRender\n :render=\"cell.column.columnDef.cell\"\n :props=\"cell.getContext()\"\n />\n </slot>\n </td>\n </tr>\n </tbody>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"TableBody.js","names":[],"sources":["../../../src/components/table/TableBody.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TData extends RowData = RowData\">\nimport { computed } from 'vue'\nimport { FlexRender, type Row, type RowData } from '@tanstack/vue-table'\nimport { tableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableInject, type TableContext } from './table.context'\n\ninterface Props {\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n *\n * @example\n * ```vue\n * <TableBody :class-names=\"{ row: 'bg-blue-50', cell: 'border-blue-200' }\" />\n * ```\n *\n * Available slots: `body`, `row`, `cell`.\n */\n classNames?: Partial<{\n body: ClassValue\n row: ClassValue\n cell: ClassValue\n }>\n}\n\nconst props = defineProps<Props>()\n\nconst ctx = useTableInject() as TableContext<TData>\nconst slotFns = computed(() => tableVariants({ variant: ctx.variant.value }))\n\nfunction onRowKeydown(row: Row<TData>, event: KeyboardEvent) {\n // Space on a gridcell toggles row selection\n if (event.key !== ' ') return\n if (ctx.selectionMode.value === 'none') return\n // Do NOT handle Space when target is inside a checkbox element (it handles its own Space)\n const target = event.target as HTMLElement\n if (target.tagName === 'INPUT' || target.closest('[role=\"checkbox\"]')) return\n event.preventDefault()\n if (ctx.selectionMode.value === 'single') {\n // Single-select: clear all, select just this one\n ctx.table.setRowSelection({ [row.id]: true })\n } else {\n row.toggleSelected()\n }\n}\n</script>\n\n<template>\n <tbody :class=\"composeClassName(slotFns.body(), props.classNames?.body)\">\n <tr\n v-for=\"(row, rowIndex) in ctx.table.getRowModel().rows\"\n :key=\"row.id\"\n role=\"row\"\n :class=\"composeClassName(slotFns.row(), props.classNames?.row)\"\n :aria-rowindex=\"rowIndex + 1\"\n :aria-selected=\"ctx.selectionMode.value !== 'none' ? row.getIsSelected() : undefined\"\n :data-state=\"row.getIsSelected() ? 'checked' : undefined\"\n @click=\"(e: MouseEvent) => ctx.handleRowClick(rowIndex, e)\"\n @keydown=\"(e: KeyboardEvent) => onRowKeydown(row, e)\"\n >\n <td\n v-for=\"(cell, colIndex) in row.getVisibleCells()\"\n :key=\"cell.id\"\n role=\"gridcell\"\n :class=\"composeClassName(slotFns.cell(), props.classNames?.cell)\"\n :data-row-index=\"rowIndex\"\n :data-col-index=\"colIndex\"\n :tabindex=\"ctx.activeCell.value && ctx.activeCell.value.rowIndex === rowIndex && ctx.activeCell.value.columnIndex === colIndex ? 0 : (ctx.activeCell.value === null && rowIndex === 0 && colIndex === 0 ? 0 : -1)\"\n >\n <slot\n name=\"cell\"\n :row=\"row\"\n :cell=\"cell\"\n :column=\"cell.column\"\n :value=\"cell.getValue()\"\n >\n <FlexRender\n :render=\"cell.column.columnDef.cell\"\n :props=\"cell.getContext()\"\n />\n </slot>\n </td>\n </tr>\n </tbody>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/table/TableBody.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { FlexRender, type Row, type RowData } from '@tanstack/vue-table'\nimport { tableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableInject } from './table.context'\n\ninterface Props {\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n *\n * @example\n * ```vue\n * <TableBody :class-names=\"{ row: 'bg-blue-50', cell: 'border-blue-200' }\" />\n * ```\n *\n * Available slots: `body`, `row`, `cell`.\n */\n classNames?: Partial<{\n body: ClassValue\n row: ClassValue\n cell: ClassValue\n }>\n}\n\nconst props = defineProps<Props>()\n\nconst ctx = useTableInject()\nconst slotFns = computed(() => tableVariants({ variant: ctx.variant.value }))\n\nfunction onRowKeydown(row: Row<RowData>, event: KeyboardEvent) {\n // Space on a gridcell toggles row selection\n if (event.key !== ' ') return\n if (ctx.selectionMode.value === 'none') return\n // Do NOT handle Space when target is inside a checkbox element (it handles its own Space)\n const target = event.target as HTMLElement\n if (target.tagName === 'INPUT' || target.closest('[role=\"checkbox\"]')) return\n event.preventDefault()\n if (ctx.selectionMode.value === 'single') {\n // Single-select: clear all, select just this one\n ctx.table.setRowSelection({ [row.id]: true })\n } else {\n row.toggleSelected()\n }\n}\n</script>\n\n<template>\n <tbody :class=\"composeClassName(slotFns.body(), props.classNames?.body)\">\n <tr\n v-for=\"(row, rowIndex) in ctx.table.getRowModel().rows\"\n :key=\"row.id\"\n role=\"row\"\n :class=\"composeClassName(slotFns.row(), props.classNames?.row)\"\n :aria-rowindex=\"rowIndex + 1\"\n :aria-selected=\"ctx.selectionMode.value !== 'none' ? row.getIsSelected() : undefined\"\n :data-state=\"row.getIsSelected() ? 'checked' : undefined\"\n @click=\"(e: MouseEvent) => ctx.handleRowClick(rowIndex, e)\"\n @keydown=\"(e: KeyboardEvent) => onRowKeydown(row, e)\"\n >\n <td\n v-for=\"(cell, colIndex) in row.getVisibleCells()\"\n :key=\"cell.id\"\n role=\"gridcell\"\n :class=\"composeClassName(slotFns.cell(), props.classNames?.cell)\"\n :data-row-index=\"rowIndex\"\n :data-col-index=\"colIndex\"\n :tabindex=\"ctx.activeCell.value && ctx.activeCell.value.rowIndex === rowIndex && ctx.activeCell.value.columnIndex === colIndex ? 0 : (ctx.activeCell.value === null && rowIndex === 0 && colIndex === 0 ? 0 : -1)\"\n >\n <slot\n name=\"cell\"\n :row=\"row\"\n :cell=\"cell\"\n :column=\"cell.column\"\n :value=\"cell.getValue()\"\n >\n <FlexRender\n :render=\"cell.column.columnDef.cell\"\n :props=\"cell.getContext()\"\n />\n </slot>\n </td>\n </tr>\n </tbody>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,QAAQ;EAEd,MAAM,MAAM,gBAAe;EAC3B,MAAM,UAAU,eAAe,cAAc,EAAE,SAAS,IAAI,QAAQ,OAAO,CAAC,CAAA;EAE5E,SAAS,aAAa,KAAmB,OAAsB;AAE7D,OAAI,MAAM,QAAQ,IAAK;AACvB,OAAI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AG,CAAC,WAAW,UAAK,QAAa,aAAQ,KAAU,aAAQ,IAAA,IAAA;SAEjM,WAWO,KAAA,QAAA,QAAA;MATC;MACC;MACN,QAAQ,KAAK;MACb,OAAO,KAAK,UAAQ;cAMhB,CAJL,YAGE,MAAA,WAAA,EAAA;MAFC,QAAQ,KAAK,OAAO,UAAU;MAC9B,OAAO,KAAK,YAAU"}
1
+ {"version":3,"file":"TableBody.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/table/TableBody.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TData extends RowData = RowData\">\nimport { computed } from 'vue'\nimport { FlexRender, type Row, type RowData } from '@tanstack/vue-table'\nimport { tableVariants } from '@auronui/styles'\nimport { composeClassName , type ClassValue} from '../../utils/composeClassName'\nimport { useTableInject, type TableContext } from './table.context'\n\ninterface Props {\n /**\n * Per-slot class overrides. Each key maps to a named slot in the anatomy;\n * the value is merged with the generated variant classes via `composeClassName`.\n *\n * @example\n * ```vue\n * <TableBody :class-names=\"{ row: 'bg-blue-50', cell: 'border-blue-200' }\" />\n * ```\n *\n * Available slots: `body`, `row`, `cell`.\n */\n classNames?: Partial<{\n body: ClassValue\n row: ClassValue\n cell: ClassValue\n }>\n}\n\nconst props = defineProps<Props>()\n\nconst ctx = useTableInject() as TableContext<TData>\nconst slotFns = computed(() => tableVariants({ variant: ctx.variant.value }))\n\nfunction onRowKeydown(row: Row<TData>, event: KeyboardEvent) {\n // Space on a gridcell toggles row selection\n if (event.key !== ' ') return\n if (ctx.selectionMode.value === 'none') return\n // Do NOT handle Space when target is inside a checkbox element (it handles its own Space)\n const target = event.target as HTMLElement\n if (target.tagName === 'INPUT' || target.closest('[role=\"checkbox\"]')) return\n event.preventDefault()\n if (ctx.selectionMode.value === 'single') {\n // Single-select: clear all, select just this one\n ctx.table.setRowSelection({ [row.id]: true })\n } else {\n row.toggleSelected()\n }\n}\n</script>\n\n<template>\n <tbody :class=\"composeClassName(slotFns.body(), props.classNames?.body)\">\n <tr\n v-for=\"(row, rowIndex) in ctx.table.getRowModel().rows\"\n :key=\"row.id\"\n role=\"row\"\n :class=\"composeClassName(slotFns.row(), props.classNames?.row)\"\n :aria-rowindex=\"rowIndex + 1\"\n :aria-selected=\"ctx.selectionMode.value !== 'none' ? row.getIsSelected() : undefined\"\n :data-state=\"row.getIsSelected() ? 'checked' : undefined\"\n @click=\"(e: MouseEvent) => ctx.handleRowClick(rowIndex, e)\"\n @keydown=\"(e: KeyboardEvent) => onRowKeydown(row, e)\"\n >\n <td\n v-for=\"(cell, colIndex) in row.getVisibleCells()\"\n :key=\"cell.id\"\n role=\"gridcell\"\n :class=\"composeClassName(slotFns.cell(), props.classNames?.cell)\"\n :data-row-index=\"rowIndex\"\n :data-col-index=\"colIndex\"\n :tabindex=\"ctx.activeCell.value && ctx.activeCell.value.rowIndex === rowIndex && ctx.activeCell.value.columnIndex === colIndex ? 0 : (ctx.activeCell.value === null && rowIndex === 0 && colIndex === 0 ? 0 : -1)\"\n >\n <slot\n name=\"cell\"\n :row=\"row\"\n :cell=\"cell\"\n :column=\"cell.column\"\n :value=\"cell.getValue()\"\n >\n <FlexRender\n :render=\"cell.column.columnDef.cell\"\n :props=\"cell.getContext()\"\n />\n </slot>\n </td>\n </tr>\n </tbody>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,QAAQ;EAEd,MAAM,MAAM,gBAAgB;EAC5B,MAAM,UAAU,eAAe,cAAc,EAAE,SAAS,IAAI,QAAQ,OAAO,CAAC,CAAA;EAE5E,SAAS,aAAa,KAAiB,OAAsB;AAE3D,OAAI,MAAM,QAAQ,IAAK;AACvB,OAAI,IAAI,cAAc,UAAU,OAAQ;GAExC,MAAM,SAAS,MAAM;AACrB,OAAI,OAAO,YAAY,WAAW,OAAO,QAAQ,sBAAoB,CAAE;AACvE,SAAM,gBAAe;AACrB,OAAI,IAAI,cAAc,UAAU,SAE9B,KAAI,MAAM,gBAAgB,GAAG,IAAI,KAA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AAO,UAAU;MAC9B,OAAO,KAAK,YAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableCheckboxCell.js","names":[],"sources":["../../../src/components/table/TableCheckboxCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { Checkbox } from '../checkbox'\nimport type { Row, Table as TableInstance, RowData } from '@tanstack/vue-table'\n\nconst props = defineProps<{\n /** When row is provided, this cell is a body row checkbox. When absent, it's the header select-all. */\n row?: Row<RowData>\n /** Required for the header select-all variant */\n table?: TableInstance<RowData>\n ariaLabel?: string\n}>()\n\nconst isIndeterminate = computed<boolean>(() => {\n if (!props.row && props.table) {\n return props.table.getIsSomeRowsSelected() && !props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst modelValue = computed<boolean>(() => {\n if (props.row) {\n return props.row.getIsSelected()\n }\n if (props.table) {\n return props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst disabled = computed(() => {\n if (props.row) return !props.row.getCanSelect()\n return false\n})\n\nfunction onToggle(nextChecked: boolean) {\n if (props.row) {\n props.row.toggleSelected(nextChecked)\n } else if (props.table) {\n props.table.toggleAllRowsSelected(nextChecked)\n }\n}\n</script>\n\n<template>\n <Checkbox\n :model-value=\"modelValue\"\n :is-indeterminate=\"isIndeterminate\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel ?? (row ? 'Select row' : 'Select all rows')\"\n @update:model-value=\"onToggle\"\n @click.stop\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"TableCheckboxCell.js","names":[],"sources":["../../../src/components/table/TableCheckboxCell.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TData extends RowData = RowData\">\nimport { computed } from 'vue'\nimport { Checkbox } from '../checkbox'\nimport type { Row, Table as TableInstance, RowData } from '@tanstack/vue-table'\n\nconst props = defineProps<{\n /** When row is provided, this cell is a body row checkbox. When absent, it's the header select-all. */\n row?: Row<TData>\n /** Required for the header select-all variant */\n table?: TableInstance<TData>\n ariaLabel?: string\n}>()\n\nconst isIndeterminate = computed<boolean>(() => {\n if (!props.row && props.table) {\n return props.table.getIsSomeRowsSelected() && !props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst modelValue = computed<boolean>(() => {\n if (props.row) {\n return props.row.getIsSelected()\n }\n if (props.table) {\n return props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst disabled = computed(() => {\n if (props.row) return !props.row.getCanSelect()\n return false\n})\n\nfunction onToggle(nextChecked: boolean) {\n if (props.row) {\n props.row.toggleSelected(nextChecked)\n } else if (props.table) {\n props.table.toggleAllRowsSelected(nextChecked)\n }\n}\n</script>\n\n<template>\n <Checkbox\n :model-value=\"modelValue\"\n :is-indeterminate=\"isIndeterminate\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel ?? (row ? 'Select row' : 'Select all rows')\"\n @update:model-value=\"onToggle\"\n @click.stop\n />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"TableCheckboxCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/table/TableCheckboxCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { Checkbox } from '../checkbox'\nimport type { Row, Table as TableInstance, RowData } from '@tanstack/vue-table'\n\nconst props = defineProps<{\n /** When row is provided, this cell is a body row checkbox. When absent, it's the header select-all. */\n row?: Row<RowData>\n /** Required for the header select-all variant */\n table?: TableInstance<RowData>\n ariaLabel?: string\n}>()\n\nconst isIndeterminate = computed<boolean>(() => {\n if (!props.row && props.table) {\n return props.table.getIsSomeRowsSelected() && !props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst modelValue = computed<boolean>(() => {\n if (props.row) {\n return props.row.getIsSelected()\n }\n if (props.table) {\n return props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst disabled = computed(() => {\n if (props.row) return !props.row.getCanSelect()\n return false\n})\n\nfunction onToggle(nextChecked: boolean) {\n if (props.row) {\n props.row.toggleSelected(nextChecked)\n } else if (props.table) {\n props.table.toggleAllRowsSelected(nextChecked)\n }\n}\n</script>\n\n<template>\n <Checkbox\n :model-value=\"modelValue\"\n :is-indeterminate=\"isIndeterminate\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel ?? (row ? 'Select row' : 'Select all rows')\"\n @update:model-value=\"onToggle\"\n @click.stop\n />\n</template>\n"],"mappings":";;;;;;;;;;;EAKA,MAAM,QAAQ;EAQd,MAAM,kBAAkB,eAAwB;AAC9C,OAAI,CAAC,MAAM,OAAO,MAAM,MACtB,QAAO,MAAM,MAAM,uBAAuB,IAAI,CAAC,MAAM,MAAM,sBAAqB;AAElF,UAAO;IACR;EAED,MAAM,aAAa,eAAwB;AACzC,OAAI,MAAM,IACR,QAAO,MAAM,IAAI,eAAc;AAEjC,OAAI,MAAM,MACR,QAAO,MAAM,MAAM,sBAAqB;AAE1C,UAAO;IACR;EAED,MAAM,WAAW,eAAe;AAC9B,OAAI,MAAM,IAAK,QAAO,CAAC,MAAM,IAAI,cAAa;AAC9C,UAAO;IACR;EAED,SAAS,SAAS,aAAsB;AACtC,OAAI,MAAM,IACR,OAAM,IAAI,eAAe,YAAW;YAC3B,MAAM,MACf,OAAM,MAAM,sBAAsB,YAAW;;;uBAM/C,YAOE,MAAA,iBAAA,EAAA;IANC,eAAa,WAAA;IACb,oBAAkB,gBAAA;IAClB,UAAU,SAAA;IACV,cAAY,QAAA,cAAc,QAAA,MAAG,eAAA;IAC7B,uBAAoB;IACpB,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAN,IAAW,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"TableCheckboxCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/table/TableCheckboxCell.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TData extends RowData = RowData\">\nimport { computed } from 'vue'\nimport { Checkbox } from '../checkbox'\nimport type { Row, Table as TableInstance, RowData } from '@tanstack/vue-table'\n\nconst props = defineProps<{\n /** When row is provided, this cell is a body row checkbox. When absent, it's the header select-all. */\n row?: Row<TData>\n /** Required for the header select-all variant */\n table?: TableInstance<TData>\n ariaLabel?: string\n}>()\n\nconst isIndeterminate = computed<boolean>(() => {\n if (!props.row && props.table) {\n return props.table.getIsSomeRowsSelected() && !props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst modelValue = computed<boolean>(() => {\n if (props.row) {\n return props.row.getIsSelected()\n }\n if (props.table) {\n return props.table.getIsAllRowsSelected()\n }\n return false\n})\n\nconst disabled = computed(() => {\n if (props.row) return !props.row.getCanSelect()\n return false\n})\n\nfunction onToggle(nextChecked: boolean) {\n if (props.row) {\n props.row.toggleSelected(nextChecked)\n } else if (props.table) {\n props.table.toggleAllRowsSelected(nextChecked)\n }\n}\n</script>\n\n<template>\n <Checkbox\n :model-value=\"modelValue\"\n :is-indeterminate=\"isIndeterminate\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel ?? (row ? 'Select row' : 'Select all rows')\"\n @update:model-value=\"onToggle\"\n @click.stop\n />\n</template>\n"],"mappings":";;;;;;;;;;;EAKA,MAAM,QAAQ;EAQd,MAAM,kBAAkB,eAAwB;AAC9C,OAAI,CAAC,MAAM,OAAO,MAAM,MACtB,QAAO,MAAM,MAAM,uBAAuB,IAAI,CAAC,MAAM,MAAM,sBAAqB;AAElF,UAAO;IACR;EAED,MAAM,aAAa,eAAwB;AACzC,OAAI,MAAM,IACR,QAAO,MAAM,IAAI,eAAc;AAEjC,OAAI,MAAM,MACR,QAAO,MAAM,MAAM,sBAAqB;AAE1C,UAAO;IACR;EAED,MAAM,WAAW,eAAe;AAC9B,OAAI,MAAM,IAAK,QAAO,CAAC,MAAM,IAAI,cAAa;AAC9C,UAAO;IACR;EAED,SAAS,SAAS,aAAsB;AACtC,OAAI,MAAM,IACR,OAAM,IAAI,eAAe,YAAW;YAC3B,MAAM,MACf,OAAM,MAAM,sBAAsB,YAAW;;;uBAM/C,YAOE,MAAA,iBAAA,EAAA;IANC,eAAa,WAAA;IACb,oBAAkB,gBAAA;IAClB,UAAU,SAAA;IACV,cAAY,QAAA,cAAc,QAAA,MAAG,eAAA;IAC7B,uBAAoB;IACpB,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAN,IAAW,CAAA,OAAA,CAAA"}