@rotki/ui-library 3.0.0-beta.3 → 3.0.0-beta.5

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 (248) hide show
  1. package/README.md +27 -14
  2. package/dist/components/accordions/accordion/RuiAccordion.js.map +1 -1
  3. package/dist/components/accordions/accordion/RuiAccordion.vue.d.ts +1 -1
  4. package/dist/components/accordions/accordion/RuiAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  5. package/dist/components/accordions/accordions/RuiAccordions.js.map +1 -1
  6. package/dist/components/accordions/accordions/RuiAccordions.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/alerts/RuiAlert.js.map +1 -1
  8. package/dist/components/alerts/RuiAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/avatars/RuiAvatar.js.map +1 -1
  10. package/dist/components/avatars/RuiAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/components/avatars/RuiAvatarGroup.js.map +1 -1
  12. package/dist/components/avatars/RuiAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/buttons/button/RuiButton.js.map +1 -1
  14. package/dist/components/buttons/button/RuiButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  15. package/dist/components/buttons/button-group/RuiButtonGroup.js.map +1 -1
  16. package/dist/components/buttons/button-group/RuiButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/calendar/RuiCalendar.js.map +1 -1
  18. package/dist/components/calendar/RuiCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/calendar/RuiCalendarGrid.js.map +1 -1
  20. package/dist/components/calendar/RuiCalendarGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/calendar/RuiCalendarHeader.js.map +1 -1
  22. package/dist/components/calendar/RuiCalendarHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/calendar/RuiCalendarMenu.js.map +1 -1
  24. package/dist/components/calendar/RuiCalendarMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/cards/RuiCard.js.map +1 -1
  26. package/dist/components/cards/RuiCard.vue.d.ts +1 -1
  27. package/dist/components/cards/RuiCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/cards/RuiCardHeader.js.map +1 -1
  29. package/dist/components/cards/RuiCardHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/chips/RuiChip.js.map +1 -1
  31. package/dist/components/chips/RuiChip.vue.d.ts +1 -1
  32. package/dist/components/chips/RuiChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/color-picker/RuiColorBoard.js.map +1 -1
  34. package/dist/components/color-picker/RuiColorBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/color-picker/RuiColorDisplay.js.map +1 -1
  36. package/dist/components/color-picker/RuiColorDisplay.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/components/color-picker/RuiColorHue.js.map +1 -1
  38. package/dist/components/color-picker/RuiColorHue.vue_vue_type_script_setup_true_lang.js.map +1 -1
  39. package/dist/components/color-picker/RuiColorInput.js.map +1 -1
  40. package/dist/components/color-picker/RuiColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/components/color-picker/RuiColorPicker.js.map +1 -1
  42. package/dist/components/color-picker/RuiColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/date-time-picker/RuiDateTimePicker.js.map +1 -1
  44. package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/date-time-picker/RuiDateTimePickerMenu.js.map +1 -1
  46. package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue.d.ts +1 -1
  47. package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/components/date-time-picker/RuiTimezoneSelect.js.map +1 -1
  49. package/dist/components/date-time-picker/RuiTimezoneSelect.vue.d.ts +2 -2
  50. package/dist/components/date-time-picker/RuiTimezoneSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/components/divider/RuiDivider.js.map +1 -1
  52. package/dist/components/divider/RuiDivider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/forms/auto-complete/RuiAutoComplete.js.map +1 -1
  54. package/dist/components/forms/auto-complete/RuiAutoComplete.vue.d.ts +1 -1
  55. package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  56. package/dist/components/forms/auto-complete/RuiAutoCompleteOption.js.map +1 -1
  57. package/dist/components/forms/auto-complete/RuiAutoCompleteOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/forms/auto-complete/RuiAutoCompleteOptionList.js.map +1 -1
  59. package/dist/components/forms/auto-complete/RuiAutoCompleteOptionList.vue.d.ts +1 -1
  60. package/dist/components/forms/auto-complete/RuiAutoCompleteOptionList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/components/forms/auto-complete/RuiAutoCompleteSelection.js.map +1 -1
  62. package/dist/components/forms/auto-complete/RuiAutoCompleteSelection.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/forms/auto-complete/auto-complete-props.d.ts +2 -2
  64. package/dist/components/forms/category-picker/RuiCategoryPicker.js.map +1 -1
  65. package/dist/components/forms/category-picker/RuiCategoryPicker.vue.d.ts +2 -2
  66. package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js +6 -2
  67. package/dist/components/forms/category-picker/RuiCategoryPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/forms/checkbox/RuiCheckbox.js.map +1 -1
  69. package/dist/components/forms/checkbox/RuiCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.js.map +1 -1
  71. package/dist/components/forms/checkbox/checkbox-group/RuiCheckboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/forms/field-defaults/RuiFieldDefaults.js.map +1 -1
  73. package/dist/components/forms/field-defaults/RuiFieldDefaults.vue_vue_type_script_setup_true_lang.js.map +1 -1
  74. package/dist/components/forms/field-label/RuiFieldLabel.js.map +1 -1
  75. package/dist/components/forms/field-label/RuiFieldLabel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/components/forms/file-upload/RuiFileUpload.js.map +1 -1
  77. package/dist/components/forms/file-upload/RuiFileUpload.vue.d.ts +4 -1
  78. package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js +17 -8
  79. package/dist/components/forms/file-upload/RuiFileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/components/forms/radio-button/radio/RuiRadio.js.map +1 -1
  81. package/dist/components/forms/radio-button/radio/RuiRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.js.map +1 -1
  83. package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/components/forms/revealable-text-field/RuiRevealableTextField.js.map +1 -1
  85. package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue.d.ts +1 -1
  86. package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  87. package/dist/components/forms/select/RuiMenuSelect.js.map +1 -1
  88. package/dist/components/forms/select/RuiMenuSelect.vue.d.ts +2 -2
  89. package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/forms/select/RuiSimpleSelect.js.map +1 -1
  91. package/dist/components/forms/select/RuiSimpleSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/components/forms/slider/RuiSlider.js.map +1 -1
  93. package/dist/components/forms/slider/RuiSlider.vue.d.ts +1 -1
  94. package/dist/components/forms/slider/RuiSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  95. package/dist/components/forms/slider/RuiSliderTicks.js.map +1 -1
  96. package/dist/components/forms/slider/RuiSliderTicks.vue_vue_type_script_setup_true_lang.js.map +1 -1
  97. package/dist/components/forms/switch/RuiSwitch.js.map +1 -1
  98. package/dist/components/forms/switch/RuiSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  99. package/dist/components/forms/text-area/RuiTextArea.js.map +1 -1
  100. package/dist/components/forms/text-area/RuiTextArea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  101. package/dist/components/forms/text-field/RuiTextField.js.map +1 -1
  102. package/dist/components/forms/text-field/RuiTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  103. package/dist/components/helpers/RuiFormTextDetail.js.map +1 -1
  104. package/dist/components/helpers/RuiFormTextDetail.vue_vue_type_script_setup_true_lang.js +1 -2
  105. package/dist/components/helpers/RuiFormTextDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/components/icons/RuiIcon.js.map +1 -1
  107. package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js +11 -10
  108. package/dist/components/icons/RuiIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  109. package/dist/components/index.d.ts +57 -57
  110. package/dist/components/loaders/RuiSkeletonBase.js.map +1 -1
  111. package/dist/components/loaders/RuiSkeletonBase.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/components/loaders/RuiSkeletonLoader.js.map +1 -1
  113. package/dist/components/loaders/RuiSkeletonLoader.vue.d.ts +1 -1
  114. package/dist/components/loaders/RuiSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/logos/RuiLogo.js.map +1 -1
  116. package/dist/components/logos/RuiLogo.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/components/overlays/badge/RuiBadge.js.map +1 -1
  118. package/dist/components/overlays/badge/RuiBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/components/overlays/bottom-sheet/RuiBottomSheet.js.map +1 -1
  120. package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue_vue_type_script_setup_true_lang.js.map +1 -1
  121. package/dist/components/overlays/dialog/RuiDialog.js.map +1 -1
  122. package/dist/components/overlays/dialog/RuiDialog.vue.d.ts +1 -1
  123. package/dist/components/overlays/dialog/RuiDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  124. package/dist/components/overlays/menu/RuiMenu.js.map +1 -1
  125. package/dist/components/overlays/menu/RuiMenu.vue.d.ts +1 -1
  126. package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.js.map +1 -1
  128. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue.d.ts +1 -1
  129. package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  130. package/dist/components/overlays/notification/RuiNotification.js.map +1 -1
  131. package/dist/components/overlays/notification/RuiNotification.vue_vue_type_script_setup_true_lang.js.map +1 -1
  132. package/dist/components/overlays/tooltip/RuiTooltip.js.map +1 -1
  133. package/dist/components/overlays/tooltip/RuiTooltip.vue.d.ts +1 -1
  134. package/dist/components/overlays/tooltip/RuiTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  135. package/dist/components/progress/RuiProgress.js.map +1 -1
  136. package/dist/components/progress/RuiProgress.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/components/steppers/RuiFooterStepper.js.map +1 -1
  138. package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js +6 -2
  139. package/dist/components/steppers/RuiFooterStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/components/steppers/RuiStepper.js.map +1 -1
  141. package/dist/components/steppers/RuiStepper.vue.d.ts +1 -1
  142. package/dist/components/steppers/RuiStepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/steppers/RuiStepperIcon.js.map +1 -1
  144. package/dist/components/steppers/RuiStepperIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  145. package/dist/components/tables/RuiDataTable.js.map +1 -1
  146. package/dist/components/tables/RuiDataTable.vue.d.ts +11 -2
  147. package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js +8 -3
  148. package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  149. package/dist/components/tables/RuiExpandButton.js.map +1 -1
  150. package/dist/components/tables/RuiExpandButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  151. package/dist/components/tables/RuiTable.js.map +1 -1
  152. package/dist/components/tables/RuiTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  153. package/dist/components/tables/RuiTableEmptyState.js.map +1 -1
  154. package/dist/components/tables/RuiTableEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/tables/RuiTableErrorState.js.map +1 -1
  156. package/dist/components/tables/RuiTableErrorState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/components/tables/RuiTableHead.js.map +1 -1
  158. package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js.map +1 -1
  159. package/dist/components/tables/RuiTableLoadingState.js.map +1 -1
  160. package/dist/components/tables/RuiTableLoadingState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  161. package/dist/components/tables/RuiTablePagination.js.map +1 -1
  162. package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  163. package/dist/components/tables/data-table/RuiDataTableAppendRow.js +7 -0
  164. package/dist/components/tables/data-table/RuiDataTableAppendRow.js.map +1 -0
  165. package/dist/components/tables/data-table/RuiDataTableAppendRow.vue.d.ts +26 -0
  166. package/dist/components/tables/data-table/RuiDataTableAppendRow.vue_vue_type_script_setup_true_lang.js +29 -0
  167. package/dist/components/tables/data-table/RuiDataTableAppendRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
  168. package/dist/components/tables/data-table/RuiDataTableBody.js.map +1 -1
  169. package/dist/components/tables/data-table/RuiDataTableBody.vue.d.ts +5 -1
  170. package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js +18 -10
  171. package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
  172. package/dist/components/tables/data-table/RuiDataTableCell.js.map +1 -1
  173. package/dist/components/tables/data-table/RuiDataTableCell.vue.d.ts +1 -1
  174. package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/tables/data-table/RuiDataTableEmptyRow.js.map +1 -1
  176. package/dist/components/tables/data-table/RuiDataTableEmptyRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  177. package/dist/components/tables/data-table/RuiDataTableErrorRow.js.map +1 -1
  178. package/dist/components/tables/data-table/RuiDataTableErrorRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/components/tables/data-table/RuiDataTableExpandedRow.js.map +1 -1
  180. package/dist/components/tables/data-table/RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/components/tables/data-table/RuiDataTableGroupRow.js.map +1 -1
  182. package/dist/components/tables/data-table/RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  183. package/dist/components/tables/data-table/RuiDataTableLoadingRow.js.map +1 -1
  184. package/dist/components/tables/data-table/RuiDataTableLoadingRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  185. package/dist/components/tables/data-table/RuiDataTableMobileSort.js.map +1 -1
  186. package/dist/components/tables/data-table/RuiDataTableMobileSort.vue.d.ts +1 -1
  187. package/dist/components/tables/data-table/RuiDataTableMobileSort.vue_vue_type_script_setup_true_lang.js.map +1 -1
  188. package/dist/components/tables/data-table/RuiDataTableRow.js.map +1 -1
  189. package/dist/components/tables/data-table/RuiDataTableRow.vue.d.ts +5 -1
  190. package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js +144 -88
  191. package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  192. package/dist/components/tables/data-table/context.d.ts +1 -1
  193. package/dist/components/tables/data-table-styles.js +1 -1
  194. package/dist/components/tables/data-table-styles.js.map +1 -1
  195. package/dist/components/tabs/tab/RuiTab.js.map +1 -1
  196. package/dist/components/tabs/tab/RuiTab.vue.d.ts +1 -1
  197. package/dist/components/tabs/tab/RuiTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/components/tabs/tab-item/RuiTabItem.js.map +1 -1
  199. package/dist/components/tabs/tab-item/RuiTabItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/components/tabs/tab-items/RuiTabItems.js.map +1 -1
  201. package/dist/components/tabs/tab-items/RuiTabItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
  202. package/dist/components/tabs/tabs/RuiTabs.js.map +1 -1
  203. package/dist/components/tabs/tabs/RuiTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  204. package/dist/components/time-picker/RuiTimePicker.js.map +1 -1
  205. package/dist/components/time-picker/RuiTimePicker.vue_vue_type_script_setup_true_lang.js +12 -8
  206. package/dist/components/time-picker/RuiTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/composables/floating.d.ts +1 -1
  208. package/dist/composables/icons.d.ts +1 -1
  209. package/dist/composables/icons.js +1 -7
  210. package/dist/composables/icons.js.map +1 -1
  211. package/dist/composables/tables/data-table/columns.d.ts +1 -1
  212. package/dist/composables/tables/data-table/grouping.d.ts +1 -1
  213. package/dist/composables/tables/data-table/page-scroll.d.ts +1 -1
  214. package/dist/composables/tables/data-table/pagination.d.ts +2 -2
  215. package/dist/composables/tables/data-table/sort.d.ts +2 -2
  216. package/dist/composables/tables/data-table/types.d.ts +2 -2
  217. package/dist/i18n/keys.d.ts +9 -0
  218. package/dist/i18n/keys.js +9 -0
  219. package/dist/i18n/keys.js.map +1 -1
  220. package/dist/icons/icons_1.d.ts +26 -26
  221. package/dist/icons/icons_1.js +348 -365
  222. package/dist/icons/icons_1.js.map +1 -1
  223. package/dist/icons/icons_2.d.ts +28 -28
  224. package/dist/icons/icons_2.js +434 -323
  225. package/dist/icons/icons_2.js.map +1 -1
  226. package/dist/icons/icons_3.d.ts +32 -32
  227. package/dist/icons/icons_3.js +334 -364
  228. package/dist/icons/icons_3.js.map +1 -1
  229. package/dist/icons/icons_4.d.ts +64 -64
  230. package/dist/icons/icons_4.js +769 -669
  231. package/dist/icons/icons_4.js.map +1 -1
  232. package/dist/icons/icons_5.d.ts +66 -9
  233. package/dist/icons/icons_5.js +693 -83
  234. package/dist/icons/icons_5.js.map +1 -1
  235. package/dist/icons/index.d.ts +1 -1
  236. package/dist/icons/index.js +108 -51
  237. package/dist/icons/index.js.map +1 -1
  238. package/dist/index.d.ts +1 -1
  239. package/dist/index.js +6 -6
  240. package/dist/style.css +22 -4
  241. package/dist/types/theme.d.ts +1 -1
  242. package/dist/utils/tv.d.ts +1 -1
  243. package/dist/vendor/@vueuse/core/dist/index.js +63 -55
  244. package/dist/vendor/@vueuse/core/dist/index.js.map +1 -1
  245. package/dist/vendor/@vueuse/shared/dist/index.js +4 -4
  246. package/dist/vendor/@vueuse/shared/dist/index.js.map +1 -1
  247. package/dist/web-types.json +88 -4
  248. package/package.json +26 -26
@@ -3,11 +3,12 @@ import { usePreferredReducedMotion } from "../../../vendor/@vueuse/core/dist/ind
3
3
  import RuiCheckbox_default from "../../forms/checkbox/RuiCheckbox.js";
4
4
  import { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from "./context.js";
5
5
  import RuiExpandButton_default from "../RuiExpandButton.js";
6
+ import RuiDataTableAppendRow_default from "./RuiDataTableAppendRow.js";
6
7
  import RuiDataTableCell_default from "./RuiDataTableCell.js";
7
8
  import RuiDataTableExpandedRow_default from "./RuiDataTableExpandedRow.js";
8
9
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
9
10
  //#region src/components/tables/data-table/RuiDataTableRow.vue?vue&type=script&setup=true&lang.ts
10
- var _hoisted_1 = ["aria-selected"];
11
+ var _hoisted_1 = ["aria-selected", "data-stripe"];
11
12
  var _hoisted_2 = { key: 1 };
12
13
  var _hoisted_3 = {
13
14
  key: 2,
@@ -68,6 +69,34 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
68
69
  if (get(expanded)) return get(classes).trExpandedParent;
69
70
  return get(classes).tr;
70
71
  });
72
+ /** Whether the row has a follow-up row, which reads as the second half of the same item. */
73
+ const appended = computed(() => !!slots["row-append"]);
74
+ /**
75
+ * The stripe follows the item, not the `<tr>`: counting rows would shade an item and its follow-up
76
+ * differently, and an open panel would flip every stripe below it. The table's `striped` variant
77
+ * shades the marked rows.
78
+ */
79
+ const stripe = computed(() => __props.index % 2 === 1 ? "" : void 0);
80
+ /**
81
+ * The two rows of an item highlight together, whichever one the pointer is over. An open row keeps
82
+ * its band rather than taking the hover, as it does without a follow-up.
83
+ */
84
+ const pairHoverClass = computed(() => {
85
+ if (!get(appended) || get(expanded) || get(isMobile)) return "";
86
+ return "has-[+[data-id=row-append]:hover]:bg-rui-hover";
87
+ });
88
+ const appendHoverClass = computed(() => {
89
+ if (get(expanded) || get(isMobile)) return "";
90
+ return "[[data-id=row]:hover+&]:bg-rui-hover";
91
+ });
92
+ /**
93
+ * On mobile the follow-up is the bottom of the item's card: square on top, against the card, and
94
+ * rounded below unless an open panel follows it.
95
+ */
96
+ const mobileAppendClass = computed(() => {
97
+ const shared = "block border-x border-b! border-rui-divider overflow-hidden";
98
+ return get(expanded) ? shared : `${shared} rounded-b-rui-card mb-3`;
99
+ });
71
100
  /**
72
101
  * A column is pinned to the mobile card header when it is flagged
73
102
  * `mobileHeader`, typically an action column, or when it is the
@@ -108,109 +137,136 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
108
137
  * `border-y!` defeats the `divide-y-0` on the mobile tbody, which otherwise
109
138
  * zeroes the top and bottom border on every card except the first. An expanded
110
139
  * card flattens its bottom edge so the expanded panel attaches flush beneath
111
- * it.
140
+ * it. A card with a follow-up row drops its bottom border too, so the
141
+ * follow-up continues it with no line between them, as on desktop.
112
142
  *
113
143
  * These bindings do not run through the class merger, so each state picks its
114
144
  * own utilities rather than emitting conflicting ones.
115
145
  */
116
146
  const mobileCardClass = computed(() => {
147
+ if (get(appended)) return "relative flex flex-col border-x border-t! border-rui-divider overflow-hidden rounded-t-rui-card mb-0";
117
148
  const shared = "relative flex flex-col border border-y! border-rui-divider overflow-hidden";
118
149
  return get(expanded) ? `${shared} rounded-t-rui-card mb-0` : `${shared} rounded-rui-card mb-3 last:mb-0`;
119
150
  });
120
151
  return (_ctx, _cache) => {
121
- return openBlock(), createElementBlock(Fragment, null, [createElementVNode("tr", {
122
- class: normalizeClass([
123
- unref(stateClass),
124
- unref(rowClass),
125
- unref(isMobile) ? unref(mobileCardClass) : ""
126
- ]),
127
- "aria-selected": unref(selectedData) ? unref(selected) : void 0,
128
- "data-id": "row"
129
- }, [unref(showMobileHeader) ? (openBlock(), createElementBlock("td", {
130
- key: 0,
131
- class: normalizeClass(unref(compactMobileHeader) ? "absolute top-0 right-0 z-1 flex items-center gap-1 px-2 py-1" : "flex items-center justify-between gap-2 px-4 py-2 border-b border-rui-divider"),
132
- "data-id": "mobile-card-header"
133
- }, [unref(selectedData) ? (openBlock(), createBlock(RuiCheckbox_default, {
134
- key: 0,
135
- "data-id": `table-toggle-check-${__props.index}`,
136
- "aria-label": "Select row",
137
- "model-value": unref(selected),
138
- disabled: unref(disabled),
139
- size: unref(dense) ? "sm" : void 0,
140
- color: "primary",
141
- class: "select-none",
142
- "hide-details": "",
143
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(onSelect)($event, unref(rowId), true)),
144
- onClick: _cache[1] || (_cache[1] = ($event) => unref(onCheckboxClick)($event, unref(rowId), __props.index))
145
- }, null, 8, [
146
- "data-id",
147
- "model-value",
148
- "disabled",
149
- "size"
150
- ])) : !unref(compactMobileHeader) ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true), unref(mobileHeaderColumns).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(mobileHeaderColumns), (column, headerIndex) => {
151
- return openBlock(), createElementBlock(Fragment, { key: `header-${headerIndex}` }, [unref(itemSlotKeys).has(column.key.toString()) ? renderSlot(_ctx.$slots, `item.${column.key.toString()}`, {
152
- column,
152
+ return openBlock(), createElementBlock(Fragment, null, [
153
+ createElementVNode("tr", {
154
+ class: normalizeClass([
155
+ unref(stateClass),
156
+ unref(rowClass),
157
+ unref(pairHoverClass),
158
+ unref(isMobile) ? unref(mobileCardClass) : ""
159
+ ]),
160
+ "aria-selected": unref(selectedData) ? unref(selected) : void 0,
161
+ "data-stripe": unref(stripe),
162
+ "data-id": "row"
163
+ }, [unref(showMobileHeader) ? (openBlock(), createElementBlock("td", {
164
+ key: 0,
165
+ class: normalizeClass(unref(compactMobileHeader) ? "absolute top-0 right-0 z-1 flex items-center gap-1 px-2 py-1" : "flex items-center justify-between gap-2 px-4 py-2 border-b border-rui-divider"),
166
+ "data-id": "mobile-card-header"
167
+ }, [unref(selectedData) ? (openBlock(), createBlock(RuiCheckbox_default, {
168
+ key: 0,
169
+ "data-id": `table-toggle-check-${__props.index}`,
170
+ "aria-label": "Select row",
171
+ "model-value": unref(selected),
172
+ disabled: unref(disabled),
173
+ size: unref(dense) ? "sm" : void 0,
174
+ color: "primary",
175
+ class: "select-none",
176
+ "hide-details": "",
177
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(onSelect)($event, unref(rowId), true)),
178
+ onClick: _cache[1] || (_cache[1] = ($event) => unref(onCheckboxClick)($event, unref(rowId), __props.index))
179
+ }, null, 8, [
180
+ "data-id",
181
+ "model-value",
182
+ "disabled",
183
+ "size"
184
+ ])) : !unref(compactMobileHeader) ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true), unref(mobileHeaderColumns).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(mobileHeaderColumns), (column, headerIndex) => {
185
+ return openBlock(), createElementBlock(Fragment, { key: `header-${headerIndex}` }, [unref(itemSlotKeys).has(column.key.toString()) ? renderSlot(_ctx.$slots, `item.${column.key.toString()}`, {
186
+ column,
187
+ row: __props.row,
188
+ index: __props.index
189
+ }, void 0, void 0, 0) : column.key === "expand" ? (openBlock(), createBlock(RuiExpandButton_default, {
190
+ key: 1,
191
+ expanded: unref(isExpanded)(unref(rowId)),
192
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(onToggleExpand)(__props.row))
193
+ }, null, 8, ["expanded"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(unref(cellValue)(__props.row, column.key)), 1)], 64))], 64);
194
+ }), 128))])) : createCommentVNode("", true)], 2)) : unref(selectedData) && !unref(isMobile) ? (openBlock(), createElementBlock("td", {
195
+ key: 1,
196
+ class: normalizeClass(unref(classes).checkbox),
197
+ colspan: "1",
198
+ rowspan: "1"
199
+ }, [createVNode(RuiCheckbox_default, {
200
+ "data-id": `table-toggle-check-${__props.index}`,
201
+ "aria-label": "Select row",
202
+ "model-value": unref(selected),
203
+ disabled: unref(disabled),
204
+ size: unref(dense) ? "sm" : void 0,
205
+ color: "primary",
206
+ class: "select-none",
207
+ "hide-details": "",
208
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(onSelect)($event, unref(rowId), true)),
209
+ onClick: _cache[4] || (_cache[4] = ($event) => unref(onCheckboxClick)($event, unref(rowId), __props.index))
210
+ }, null, 8, [
211
+ "data-id",
212
+ "model-value",
213
+ "disabled",
214
+ "size"
215
+ ])], 2)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bodyColumns), (column, subIndex) => {
216
+ return openBlock(), createBlock(RuiDataTableCell_default, {
217
+ key: subIndex,
218
+ column,
219
+ row: __props.row,
220
+ index: __props.index,
221
+ "row-id": unref(rowId),
222
+ style: normalizeStyle(subIndex === 0 ? unref(firstRowInset) : void 0)
223
+ }, createSlots({ _: 2 }, [unref(itemSlotKeys).has(column.key.toString()) ? {
224
+ name: "default",
225
+ fn: withCtx((slotData) => [renderSlot(_ctx.$slots, `item.${column.key.toString()}`, mergeProps({ ref_for: true }, slotData))]),
226
+ key: "0"
227
+ } : void 0]), 1032, [
228
+ "column",
229
+ "row",
230
+ "index",
231
+ "row-id",
232
+ "style"
233
+ ]);
234
+ }), 128))], 10, _hoisted_1),
235
+ slots["row-append"] ? (openBlock(), createBlock(RuiDataTableAppendRow_default, {
236
+ key: 0,
237
+ class: normalizeClass(["border-t-0!", [
238
+ unref(stateClass),
239
+ unref(rowClass),
240
+ unref(appendHoverClass),
241
+ unref(isMobile) ? unref(mobileAppendClass) : ""
242
+ ]]),
243
+ "data-stripe": unref(stripe),
153
244
  row: __props.row,
154
245
  index: __props.index
155
- }, void 0, void 0, 0) : column.key === "expand" ? (openBlock(), createBlock(RuiExpandButton_default, {
246
+ }, {
247
+ "row-append": withCtx((slotData) => [renderSlot(_ctx.$slots, "row-append", normalizeProps(guardReactiveProps(slotData)))]),
248
+ _: 3
249
+ }, 8, [
250
+ "class",
251
+ "data-stripe",
252
+ "row",
253
+ "index"
254
+ ])) : createCommentVNode("", true),
255
+ unref(panelShown) ? (openBlock(), createBlock(RuiDataTableExpandedRow_default, {
156
256
  key: 1,
157
- expanded: unref(isExpanded)(unref(rowId)),
158
- onClick: _cache[2] || (_cache[2] = ($event) => unref(onToggleExpand)(__props.row))
159
- }, null, 8, ["expanded"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(unref(cellValue)(__props.row, column.key)), 1)], 64))], 64);
160
- }), 128))])) : createCommentVNode("", true)], 2)) : unref(selectedData) && !unref(isMobile) ? (openBlock(), createElementBlock("td", {
161
- key: 1,
162
- class: normalizeClass(unref(classes).checkbox),
163
- colspan: "1",
164
- rowspan: "1"
165
- }, [createVNode(RuiCheckbox_default, {
166
- "data-id": `table-toggle-check-${__props.index}`,
167
- "aria-label": "Select row",
168
- "model-value": unref(selected),
169
- disabled: unref(disabled),
170
- size: unref(dense) ? "sm" : void 0,
171
- color: "primary",
172
- class: "select-none",
173
- "hide-details": "",
174
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(onSelect)($event, unref(rowId), true)),
175
- onClick: _cache[4] || (_cache[4] = ($event) => unref(onCheckboxClick)($event, unref(rowId), __props.index))
176
- }, null, 8, [
177
- "data-id",
178
- "model-value",
179
- "disabled",
180
- "size"
181
- ])], 2)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bodyColumns), (column, subIndex) => {
182
- return openBlock(), createBlock(RuiDataTableCell_default, {
183
- key: subIndex,
184
- column,
257
+ class: normalizeClass(["transition-opacity starting:opacity-0 motion-reduce:transition-none", unref(panelClosing) ? "opacity-0 duration-100 ease-in" : "duration-150 ease-out"]),
185
258
  row: __props.row,
186
- index: __props.index,
187
- "row-id": unref(rowId),
188
- style: normalizeStyle(subIndex === 0 ? unref(firstRowInset) : void 0)
189
- }, createSlots({ _: 2 }, [unref(itemSlotKeys).has(column.key.toString()) ? {
190
- name: "default",
191
- fn: withCtx((slotData) => [renderSlot(_ctx.$slots, `item.${column.key.toString()}`, mergeProps({ ref_for: true }, slotData))]),
259
+ index: __props.index
260
+ }, createSlots({ _: 2 }, [slots["expanded-item"] ? {
261
+ name: "expanded-item",
262
+ fn: withCtx((slotData) => [renderSlot(_ctx.$slots, "expanded-item", normalizeProps(guardReactiveProps(slotData)))]),
192
263
  key: "0"
193
264
  } : void 0]), 1032, [
194
- "column",
265
+ "class",
195
266
  "row",
196
- "index",
197
- "row-id",
198
- "style"
199
- ]);
200
- }), 128))], 10, _hoisted_1), unref(panelShown) ? (openBlock(), createBlock(RuiDataTableExpandedRow_default, {
201
- key: 0,
202
- class: normalizeClass(["transition-opacity starting:opacity-0 motion-reduce:transition-none", unref(panelClosing) ? "opacity-0 duration-100 ease-in" : "duration-150 ease-out"]),
203
- row: __props.row,
204
- index: __props.index
205
- }, createSlots({ _: 2 }, [slots["expanded-item"] ? {
206
- name: "expanded-item",
207
- fn: withCtx((slotData) => [renderSlot(_ctx.$slots, "expanded-item", normalizeProps(guardReactiveProps(slotData)))]),
208
- key: "0"
209
- } : void 0]), 1032, [
210
- "class",
211
- "row",
212
- "index"
213
- ])) : createCommentVNode("", true)], 64);
267
+ "index"
268
+ ])) : createCommentVNode("", true)
269
+ ], 64);
214
270
  };
215
271
  }
216
272
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RuiDataTableRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport RuiCheckbox from '@/components/forms/checkbox/RuiCheckbox.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableCell from '@/components/tables/data-table/RuiDataTableCell.vue';\nimport RuiDataTableExpandedRow from '@/components/tables/data-table/RuiDataTableExpandedRow.vue';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst {\n row,\n index,\n} = defineProps<{\n row: T;\n index: number;\n}>();\n\nconst slots = defineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n }\n>>();\n\nconst { classes, dense, isMobile } = useDataTableStyling();\nconst { cellValue, columns, itemSlotKeys } = useDataTableColumns<T>();\nconst { isDisabledRow, isSelected, onCheckboxClick, onSelect, selectedData } = useDataTableSelection<T>();\nconst { expandable, isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { getRowId, itemClass } = useDataTableRowIdentity<T>();\n\nconst rowId = computed<T[keyof T]>(() => getRowId(row));\nconst selected = computed<boolean>(() => isSelected(get(rowId)));\nconst disabled = computed<boolean>(() => isDisabledRow(get(rowId)));\nconst expanded = computed<boolean>(() => get(expandable) && !!slots['expanded-item'] && isExpanded(get(rowId)));\n\n/** How long a closing panel stays to fade out; matches its `duration-100`. */\nconst PANEL_LEAVE_MS = 100;\n\nconst reducedMotion = usePreferredReducedMotion();\n\n/**\n * Whether the panel is in the DOM, which outlasts `expanded` by its fade-out.\n *\n * @remarks\n * Not a `<Transition>`: test utilities stub that with an element, which lands inside the consumer's\n * `<tbody>` and shifts every `tr:nth-child` its specs count. The fade-in is CSS `@starting-style`.\n */\nconst panelShown = ref<boolean>(get(expanded));\nconst panelClosing = ref<boolean>(false);\n\nconst { start: finishClosing, stop: cancelClosing } = useTimeoutFn(() => {\n set(panelShown, false);\n set(panelClosing, false);\n}, PANEL_LEAVE_MS, { immediate: false });\n\nwatch(expanded, (open) => {\n if (open) {\n cancelClosing();\n set(panelClosing, false);\n set(panelShown, true);\n return;\n }\n if (!get(panelShown))\n return;\n if (get(reducedMotion) === 'reduce') {\n set(panelShown, false);\n return;\n }\n set(panelClosing, true);\n finishClosing();\n});\n\nconst rowClass = computed<string>(() => typeof itemClass === 'string' ? itemClass : itemClass(row));\n\n/** Selection wins over the open-panel shade, so a selected row still reads as selected. */\nconst stateClass = computed<string>(() => {\n if (get(selected))\n return get(classes).trSelected;\n if (get(expanded))\n return get(classes).trExpandedParent;\n return get(classes).tr;\n});\n\n/**\n * A column is pinned to the mobile card header when it is flagged\n * `mobileHeader`, typically an action column, or when it is the\n * auto-generated expand column.\n */\nfunction isMobileHeaderColumn(column: TableColumn<T>): boolean {\n return !!column.mobileHeader || column.key === 'expand';\n}\n\n/**\n * A pinned column only earns a spot in the header if it renders something: the\n * expand toggle, a provided item slot, or a non-empty cell value. Without this,\n * a pinned column with no content, such as an action column whose\n * `#item.action` slot a nested table does not provide, leaves an empty header\n * bar with just its divider line.\n */\nfunction mobileHeaderColumnHasContent(column: TableColumn<T>): boolean {\n if (column.key === 'expand')\n return true;\n if (itemSlotKeys.has(column.key.toString()))\n return true;\n const value = cellValue(row, column.key);\n return value !== undefined && value !== null && value !== '';\n}\n\n/**\n * In the stacked mobile layout, header columns render in the card header row\n * instead of as a label/value pair. Everything else stacks below in the body.\n */\nconst mobileHeaderColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => isMobileHeaderColumn(column) && mobileHeaderColumnHasContent(column)) : [],\n);\nconst bodyColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => !isMobileHeaderColumn(column)) : get(columns),\n);\nconst showMobileHeader = computed<boolean>(() =>\n get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0),\n);\n\n/**\n * Without a selection checkbox the header bar would hold only the pinned\n * actions, so they float in the card's top-right corner instead and the first\n * field row makes room for them.\n */\nconst compactMobileHeader = computed<boolean>(() =>\n get(showMobileHeader) && !get(selectedData) && get(bodyColumns).length > 0,\n);\n\n/** Room for each floating action, about one small icon button wide. */\nconst firstRowInset = computed<Record<string, string> | undefined>(() =>\n get(compactMobileHeader) ? { paddingRight: `${get(mobileHeaderColumns).length * 2 + 1}rem` } : undefined,\n);\n\n/**\n * `border-y!` defeats the `divide-y-0` on the mobile tbody, which otherwise\n * zeroes the top and bottom border on every card except the first. An expanded\n * card flattens its bottom edge so the expanded panel attaches flush beneath\n * it.\n *\n * These bindings do not run through the class merger, so each state picks its\n * own utilities rather than emitting conflicting ones.\n */\nconst mobileCardClass = computed<string>(() => {\n const shared = 'relative flex flex-col border border-y! border-rui-divider overflow-hidden';\n return get(expanded)\n ? `${shared} rounded-t-rui-card mb-0`\n : `${shared} rounded-rui-card mb-3 last:mb-0`;\n});\n</script>\n\n<template>\n <tr\n :class=\"[stateClass, rowClass, isMobile ? mobileCardClass : '']\"\n :aria-selected=\"selectedData ? selected : undefined\"\n data-id=\"row\"\n >\n <!-- Mobile card header: checkbox on the left, pinned action columns on the right -->\n <td\n v-if=\"showMobileHeader\"\n :class=\"compactMobileHeader\n ? 'absolute top-0 right-0 z-1 flex items-center gap-1 px-2 py-1'\n : 'flex items-center justify-between gap-2 px-4 py-2 border-b border-rui-divider'\"\n data-id=\"mobile-card-header\"\n >\n <RuiCheckbox\n v-if=\"selectedData\"\n :data-id=\"`table-toggle-check-${index}`\"\n aria-label=\"Select row\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n <span v-else-if=\"!compactMobileHeader\" />\n\n <div\n v-if=\"mobileHeaderColumns.length > 0\"\n class=\"flex items-center gap-1 min-w-0\"\n >\n <template\n v-for=\"(column, headerIndex) in mobileHeaderColumns\"\n :key=\"`header-${headerIndex}`\"\n >\n <slot\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n :name=\"`item.${column.key.toString()}`\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n />\n <RuiExpandButton\n v-else-if=\"column.key === 'expand'\"\n :expanded=\"isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <template v-else>\n {{ cellValue(row, column.key) }}\n </template>\n </template>\n </div>\n </td>\n\n <!-- Desktop checkbox cell -->\n <td\n v-else-if=\"selectedData && !isMobile\"\n :class=\"classes.checkbox\"\n colspan=\"1\"\n rowspan=\"1\"\n >\n <RuiCheckbox\n :data-id=\"`table-toggle-check-${index}`\"\n aria-label=\"Select row\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n </td>\n\n <RuiDataTableCell\n v-for=\"(column, subIndex) in bodyColumns\"\n :key=\"subIndex\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n :row-id=\"rowId\"\n :style=\"subIndex === 0 ? firstRowInset : undefined\"\n >\n <template\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n #default=\"slotData\"\n >\n <slot\n :name=\"`item.${column.key.toString()}`\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableCell>\n </tr>\n\n <!-- opacity only: the rows below move once, at once, rather than sliding with a growing height -->\n <RuiDataTableExpandedRow\n v-if=\"panelShown\"\n class=\"transition-opacity starting:opacity-0 motion-reduce:transition-none\"\n :class=\"panelClosing ? 'opacity-0 duration-100 ease-in' : 'duration-150 ease-out'\"\n :row=\"row\"\n :index=\"index\"\n >\n <template\n v-if=\"slots['expanded-item']\"\n #expanded-item=\"slotData\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"expanded-item\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableExpandedRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,IAAM,iBAAiB;;;;;;;;EAlBvB,MAAM,QAAQ,SAAA;EAMd,MAAM,EAAE,SAAS,OAAO,aAAa,oBAAoB;EACzD,MAAM,EAAE,WAAW,SAAS,iBAAiB,oBAAuB;EACpE,MAAM,EAAE,eAAe,YAAY,iBAAiB,UAAU,iBAAiB,sBAAyB;EACxG,MAAM,EAAE,YAAY,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GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAA,YAAA,CAAY,CAAC,IAAI,OAAO,IAAI,SAAQ,CAAA,IAAA;KACzC,MAAA;KAED,IAAA,SAFU,aAAQ,CAElB,WAGE,KAAA,QAAA,QAFe,OAAO,IAAI,SAAQ,KADpC,WAGE,EAAA,SAAA,KAAA,GADQ,QAAQ,CAAA,CAAA,CAAA;;;;;;;;;GAQhB,CAAA,GAAA,GAAA,EAAA,GAAA,IAAA,UAAA,GAAA,MAAA,UAAA,KADR,UAAA,GAAA,YAiB0B,iCAAA;;IAfxB,OAAK,eAAA,CAAC,uEACE,MAAA,YAAA,IAAY,mCAAA,uBAAA,CAAA;IACnB,KAAK,QAAA;IACL,OAAO,QAAA;GAGA,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAK,mBAAA;IACV,MAAA;IAGD,IAAA,SAHgB,aAAQ,CAGxB,WAGE,KAAA,QAAA,iBAAA,eAAA,mBADQ,QAAQ,CAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"RuiDataTableRow.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_normalizeClass","_unref","_createBlock","RuiCheckbox","_createCommentVNode","_renderList","_renderSlot","RuiExpandButton","_createTextVNode","_toDisplayString","_createVNode","RuiDataTableCell","_normalizeStyle","_createSlots","_withCtx","_mergeProps","RuiDataTableAppendRow","_normalizeProps","_guardReactiveProps","RuiDataTableExpandedRow"],"sources":["../../../../src/components/tables/data-table/RuiDataTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport RuiCheckbox from '@/components/forms/checkbox/RuiCheckbox.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableAppendRow from '@/components/tables/data-table/RuiDataTableAppendRow.vue';\nimport RuiDataTableCell from '@/components/tables/data-table/RuiDataTableCell.vue';\nimport RuiDataTableExpandedRow from '@/components/tables/data-table/RuiDataTableExpandedRow.vue';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst {\n row,\n index,\n} = defineProps<{\n row: T;\n index: number;\n}>();\n\nconst slots = defineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n 'row-append'?: (props: { row: T; index: number }) => any;\n }\n>>();\n\nconst { classes, dense, isMobile } = useDataTableStyling();\nconst { cellValue, columns, itemSlotKeys } = useDataTableColumns<T>();\nconst { isDisabledRow, isSelected, onCheckboxClick, onSelect, selectedData } = useDataTableSelection<T>();\nconst { expandable, isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { getRowId, itemClass } = useDataTableRowIdentity<T>();\n\nconst rowId = computed<T[keyof T]>(() => getRowId(row));\nconst selected = computed<boolean>(() => isSelected(get(rowId)));\nconst disabled = computed<boolean>(() => isDisabledRow(get(rowId)));\nconst expanded = computed<boolean>(() => get(expandable) && !!slots['expanded-item'] && isExpanded(get(rowId)));\n\n/** How long a closing panel stays to fade out; matches its `duration-100`. */\nconst PANEL_LEAVE_MS = 100;\n\nconst reducedMotion = usePreferredReducedMotion();\n\n/**\n * Whether the panel is in the DOM, which outlasts `expanded` by its fade-out.\n *\n * @remarks\n * Not a `<Transition>`: test utilities stub that with an element, which lands inside the consumer's\n * `<tbody>` and shifts every `tr:nth-child` its specs count. The fade-in is CSS `@starting-style`.\n */\nconst panelShown = ref<boolean>(get(expanded));\nconst panelClosing = ref<boolean>(false);\n\nconst { start: finishClosing, stop: cancelClosing } = useTimeoutFn(() => {\n set(panelShown, false);\n set(panelClosing, false);\n}, PANEL_LEAVE_MS, { immediate: false });\n\nwatch(expanded, (open) => {\n if (open) {\n cancelClosing();\n set(panelClosing, false);\n set(panelShown, true);\n return;\n }\n if (!get(panelShown))\n return;\n if (get(reducedMotion) === 'reduce') {\n set(panelShown, false);\n return;\n }\n set(panelClosing, true);\n finishClosing();\n});\n\nconst rowClass = computed<string>(() => typeof itemClass === 'string' ? itemClass : itemClass(row));\n\n/** Selection wins over the open-panel shade, so a selected row still reads as selected. */\nconst stateClass = computed<string>(() => {\n if (get(selected))\n return get(classes).trSelected;\n if (get(expanded))\n return get(classes).trExpandedParent;\n return get(classes).tr;\n});\n\n/** Whether the row has a follow-up row, which reads as the second half of the same item. */\nconst appended = computed<boolean>(() => !!slots['row-append']);\n\n/**\n * The stripe follows the item, not the `<tr>`: counting rows would shade an item and its follow-up\n * differently, and an open panel would flip every stripe below it. The table's `striped` variant\n * shades the marked rows.\n */\nconst stripe = computed<'' | undefined>(() => (index % 2 === 1 ? '' : undefined));\n\n/**\n * The two rows of an item highlight together, whichever one the pointer is over. An open row keeps\n * its band rather than taking the hover, as it does without a follow-up.\n */\nconst pairHoverClass = computed<string>(() => {\n if (!get(appended) || get(expanded) || get(isMobile))\n return '';\n return 'has-[+[data-id=row-append]:hover]:bg-rui-hover';\n});\nconst appendHoverClass = computed<string>(() => {\n if (get(expanded) || get(isMobile))\n return '';\n return '[[data-id=row]:hover+&]:bg-rui-hover';\n});\n\n/**\n * On mobile the follow-up is the bottom of the item's card: square on top, against the card, and\n * rounded below unless an open panel follows it.\n */\nconst mobileAppendClass = computed<string>(() => {\n const shared = 'block border-x border-b! border-rui-divider overflow-hidden';\n return get(expanded) ? shared : `${shared} rounded-b-rui-card mb-3`;\n});\n\n/**\n * A column is pinned to the mobile card header when it is flagged\n * `mobileHeader`, typically an action column, or when it is the\n * auto-generated expand column.\n */\nfunction isMobileHeaderColumn(column: TableColumn<T>): boolean {\n return !!column.mobileHeader || column.key === 'expand';\n}\n\n/**\n * A pinned column only earns a spot in the header if it renders something: the\n * expand toggle, a provided item slot, or a non-empty cell value. Without this,\n * a pinned column with no content, such as an action column whose\n * `#item.action` slot a nested table does not provide, leaves an empty header\n * bar with just its divider line.\n */\nfunction mobileHeaderColumnHasContent(column: TableColumn<T>): boolean {\n if (column.key === 'expand')\n return true;\n if (itemSlotKeys.has(column.key.toString()))\n return true;\n const value = cellValue(row, column.key);\n return value !== undefined && value !== null && value !== '';\n}\n\n/**\n * In the stacked mobile layout, header columns render in the card header row\n * instead of as a label/value pair. Everything else stacks below in the body.\n */\nconst mobileHeaderColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => isMobileHeaderColumn(column) && mobileHeaderColumnHasContent(column)) : [],\n);\nconst bodyColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => !isMobileHeaderColumn(column)) : get(columns),\n);\nconst showMobileHeader = computed<boolean>(() =>\n get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0),\n);\n\n/**\n * Without a selection checkbox the header bar would hold only the pinned\n * actions, so they float in the card's top-right corner instead and the first\n * field row makes room for them.\n */\nconst compactMobileHeader = computed<boolean>(() =>\n get(showMobileHeader) && !get(selectedData) && get(bodyColumns).length > 0,\n);\n\n/** Room for each floating action, about one small icon button wide. */\nconst firstRowInset = computed<Record<string, string> | undefined>(() =>\n get(compactMobileHeader) ? { paddingRight: `${get(mobileHeaderColumns).length * 2 + 1}rem` } : undefined,\n);\n\n/**\n * `border-y!` defeats the `divide-y-0` on the mobile tbody, which otherwise\n * zeroes the top and bottom border on every card except the first. An expanded\n * card flattens its bottom edge so the expanded panel attaches flush beneath\n * it. A card with a follow-up row drops its bottom border too, so the\n * follow-up continues it with no line between them, as on desktop.\n *\n * These bindings do not run through the class merger, so each state picks its\n * own utilities rather than emitting conflicting ones.\n */\nconst mobileCardClass = computed<string>(() => {\n if (get(appended))\n return 'relative flex flex-col border-x border-t! border-rui-divider overflow-hidden rounded-t-rui-card mb-0';\n const shared = 'relative flex flex-col border border-y! border-rui-divider overflow-hidden';\n return get(expanded)\n ? `${shared} rounded-t-rui-card mb-0`\n : `${shared} rounded-rui-card mb-3 last:mb-0`;\n});\n</script>\n\n<template>\n <tr\n :class=\"[stateClass, rowClass, pairHoverClass, isMobile ? mobileCardClass : '']\"\n :aria-selected=\"selectedData ? selected : undefined\"\n :data-stripe=\"stripe\"\n data-id=\"row\"\n >\n <!-- Mobile card header: checkbox on the left, pinned action columns on the right -->\n <td\n v-if=\"showMobileHeader\"\n :class=\"compactMobileHeader\n ? 'absolute top-0 right-0 z-1 flex items-center gap-1 px-2 py-1'\n : 'flex items-center justify-between gap-2 px-4 py-2 border-b border-rui-divider'\"\n data-id=\"mobile-card-header\"\n >\n <RuiCheckbox\n v-if=\"selectedData\"\n :data-id=\"`table-toggle-check-${index}`\"\n aria-label=\"Select row\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n <span v-else-if=\"!compactMobileHeader\" />\n\n <div\n v-if=\"mobileHeaderColumns.length > 0\"\n class=\"flex items-center gap-1 min-w-0\"\n >\n <template\n v-for=\"(column, headerIndex) in mobileHeaderColumns\"\n :key=\"`header-${headerIndex}`\"\n >\n <slot\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n :name=\"`item.${column.key.toString()}`\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n />\n <RuiExpandButton\n v-else-if=\"column.key === 'expand'\"\n :expanded=\"isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <template v-else>\n {{ cellValue(row, column.key) }}\n </template>\n </template>\n </div>\n </td>\n\n <!-- Desktop checkbox cell -->\n <td\n v-else-if=\"selectedData && !isMobile\"\n :class=\"classes.checkbox\"\n colspan=\"1\"\n rowspan=\"1\"\n >\n <RuiCheckbox\n :data-id=\"`table-toggle-check-${index}`\"\n aria-label=\"Select row\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n </td>\n\n <RuiDataTableCell\n v-for=\"(column, subIndex) in bodyColumns\"\n :key=\"subIndex\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n :row-id=\"rowId\"\n :style=\"subIndex === 0 ? firstRowInset : undefined\"\n >\n <template\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n #default=\"slotData\"\n >\n <slot\n :name=\"`item.${column.key.toString()}`\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableCell>\n </tr>\n\n <!-- no divider above: with its row it is one item, sharing the row's state, stripe and hover -->\n <RuiDataTableAppendRow\n v-if=\"slots['row-append']\"\n class=\"border-t-0!\"\n :class=\"[stateClass, rowClass, appendHoverClass, isMobile ? mobileAppendClass : '']\"\n :data-stripe=\"stripe\"\n :row=\"row\"\n :index=\"index\"\n >\n <template #row-append=\"slotData\">\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"row-append\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableAppendRow>\n\n <!-- opacity only: the rows below move once, at once, rather than sliding with a growing height -->\n <RuiDataTableExpandedRow\n v-if=\"panelShown\"\n class=\"transition-opacity starting:opacity-0 motion-reduce:transition-none\"\n :class=\"panelClosing ? 'opacity-0 duration-100 ease-in' : 'duration-150 ease-out'\"\n :row=\"row\"\n :index=\"index\"\n >\n <template\n v-if=\"slots['expanded-item']\"\n #expanded-item=\"slotData\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"expanded-item\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableExpandedRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,IAAM,iBAAiB;;;;;;;;EAnBvB,MAAM,QAAQA,SAAA;EAOd,MAAM,EAAE,S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A,QAAA,IAAWA,MAAA,iBAAA,IAAiB;KAAA,CAAA,CAAA;KAC5E,eAAaA,MAAA,MAAA;KACb,KAAK,QAAA;KACL,OAAO,QAAA;;KAEG,cAAUa,SAAE,aAAQ,CAE7BR,WAGE,KAAA,QAAA,cAAAW,eAAAC,mBADQ,QAAQ,CAAA,CAAA,CAAA,CAAA;;;;;;;;IAOdjB,MAAA,UAAA,KADRL,UAAA,GAAAM,YAiB0BiB,iCAAA;;KAfxB,OAAKnB,eAAA,CAAC,uEACEC,MAAA,YAAA,IAAY,mCAAA,uBAAA,CAAA;KACnB,KAAK,QAAA;KACL,OAAO,QAAA;IAGA,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAK,mBAAA;KACV,MAAA;KAGD,IAAAa,SAHgB,aAAQ,CAGxBR,WAGE,KAAA,QAAA,iBAAAW,eAAAC,mBADQ,QAAQ,CAAA,CAAA,CAAA,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { ComputedRef, Ref } from 'vue';
2
- import type { TableColumn } from '../RuiTableHead.vue';
2
+ import type { TableColumn } from '../RuiTableHead.vue.js';
3
3
  import type { GroupExpandButtonPosition } from '../table-props.js';
4
4
  import type { GroupHeader } from '../../../composables/tables/data-table/types.js';
5
5
  export interface DataTableClasses {
@@ -37,7 +37,7 @@ var dataTableStyles = tv({
37
37
  true: {},
38
38
  false: {}
39
39
  },
40
- striped: { true: { tbody: "[:where(&>tr:nth-child(even))]:bg-rui-neutral-950/[0.03] dark:[:where(&>tr:nth-child(even))]:bg-white/[0.04]" } },
40
+ striped: { true: { tbody: "[:where(&>tr[data-stripe])]:bg-rui-neutral-950/[0.03] dark:[:where(&>tr[data-stripe])]:bg-white/[0.04]" } },
41
41
  rowVariant: {
42
42
  selected: { tr: "bg-rui-primary-soft" },
43
43
  empty: { tr: "hover:bg-transparent" },
@@ -1 +1 @@
1
- {"version":3,"file":"data-table-styles.js","names":[],"sources":["../../../src/components/tables/data-table-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\n/** A 2px primary rail down the left edge of an open row and its panel; out of flow, so the cell keeps its padding. */\nconst OPEN_ROW_RAIL = '[&>td:first-child]:relative [&>td:first-child]:before:absolute [&>td:first-child]:before:inset-y-0 [&>td:first-child]:before:left-0 [&>td:first-child]:before:w-0.5 [&>td:first-child]:before:bg-rui-primary';\n\n/**\n * The band of an open row inside another table's panel: a step darker than the outer band, so the two\n * levels never share a grey while the rows between them keep the plain surface.\n */\nconst NESTED_BAND = '[[data-id=row-expanded]_&]:bg-rui-neutral-950/[0.11] dark:[[data-id=row-expanded]_&]:bg-white/[0.14]';\n\n/**\n * Header and pagination of a nested table, stepped by depth to stand off the band around them (about\n * 1.12:1 or more) as well as their own rows: past the lighter band one panel deep, short of the darker\n * band two deep. Nested bars never stick, so the tint can be translucent over the table's own surface.\n */\nexport const NESTED_BAR = '[[data-id=row-expanded]_&]:bg-rui-neutral-950/[0.13] dark:[[data-id=row-expanded]_&]:bg-white/[0.16] [[data-id=row-expanded]_[data-id=row-expanded]_&]:bg-rui-neutral-950/[0.06] dark:[[data-id=row-expanded]_[data-id=row-expanded]_&]:bg-white/[0.07]';\n\nexport const dataTableStyles = tv({\n slots: {\n // `clip`, not `hidden`, which may shrink the item below its rows; its own surface reads the same anywhere\n wrapper: 'relative between:border-t between:border-b-0 between:border-rui-divider overflow-clip bg-rui-surface',\n // focusable only while it scrolls with nothing to tab to (useKeyboardScroll), ring drawn inside\n scroller: 'overflow-x-auto overflow-y-hidden [clip-path:inset(0_0_0_0)] outline-hidden focus-visible:focus-ring focus-visible:-outline-offset-2',\n table: 'min-w-full table-fixed between:border-t between:border-b-0 between:border-rui-divider whitespace-nowrap mx-auto my-0 max-w-fit relative border-rui-divider',\n tbody: 'between:border-t between:border-b-0 between:border-rui-divider',\n tr: 'hover:bg-rui-hover',\n // numbers line up in columns; no slashed zero, which in Inter reads as a second, monospace font beside zero-free values\n td: '[:where(&)]:px-4 text-rui-text text-body-2 tabular-nums [text-wrap:initial]',\n checkbox: 'px-2 w-[3.625rem] max-w-[3.625rem] [&_label]:ml-0',\n tbodyLoader: 'text-center',\n // tinted like the column header, the pair framing the body; opaque, so rows scroll behind a stuck bar\n pagination: `bg-rui-surface-muted ${NESTED_BAR}`,\n },\n variants: {\n sticky: {\n true: { pagination: 'sticky bottom-0 z-rui-raised' },\n },\n outlined: {\n true: { wrapper: 'border border-rui-divider' },\n },\n rounded: {\n sm: { wrapper: 'rounded-rui-sm' },\n md: { wrapper: 'rounded-rui-card' },\n lg: { wrapper: 'rounded-rui-lg' },\n },\n dense: {\n true: {},\n false: {},\n },\n // a translucent tint under the hover one; `:where()` keeps it below every row state (selected, hover, expanded, group)\n striped: {\n true: { tbody: '[:where(&>tr:nth-child(even))]:bg-rui-neutral-950/[0.03] dark:[:where(&>tr:nth-child(even))]:bg-white/[0.04]' },\n },\n rowVariant: {\n selected: { tr: 'bg-rui-primary-soft' },\n empty: { tr: 'hover:bg-transparent' },\n // a grey band darker than the header so the two never match, a step darker again inside another panel\n expandable: { tr: `bg-rui-neutral-950/[0.07] hover:bg-rui-neutral-950/[0.07] dark:bg-white/[0.09] dark:hover:bg-white/[0.09] ${NESTED_BAND} [[data-id=row-expanded]_&]:hover:bg-rui-neutral-950/[0.11] dark:[[data-id=row-expanded]_&]:hover:bg-white/[0.14] ${OPEN_ROW_RAIL} !border-t-0` },\n expandedParent: { tr: `bg-rui-neutral-950/[0.07] dark:bg-white/[0.09] ${NESTED_BAND} ${OPEN_ROW_RAIL}` },\n group: { tr: 'bg-rui-neutral-100 dark:bg-white/[0.05]' },\n },\n mobile: {\n true: {\n wrapper: 'between:border-t-0 border-0 rounded-none overflow-visible',\n scroller: 'overflow-visible [clip-path:none]',\n table: 'block min-w-0 max-w-none w-full whitespace-normal between:border-t-0 border-0',\n tbody: 'block between:border-t-0',\n tr: 'block',\n td: 'block px-4 py-2',\n },\n },\n },\n /**\n * A fixed row height keeps a row of plain text as tall as one holding an\n * icon button. Padding and floor sit in `:where()` so a consumer's `cellClass`\n * (`py-0` is common) still wins at any stylesheet order, and each density\n * sets its own because the class merger cannot dedupe these.\n */\n compoundVariants: [\n // a 4px inset under the height floor fits a 36px button in a 44px row (a 28px one in a dense 36px row)\n { dense: false, mobile: false, class: { td: '[:where(&)]:py-1 [:where(&)]:h-11' } },\n { dense: true, mobile: false, class: { td: '[:where(&)]:py-1 [:where(&)]:h-9' } },\n ],\n defaultVariants: {\n dense: false,\n mobile: false,\n },\n});\n"],"mappings":";;;AAGA,IAAM,gBAAgB;;;;;AAMtB,IAAM,cAAc;;;;;;AAOpB,IAAa,aAAa;AAE1B,IAAa,kBAAkB,GAAG;CAChC,OAAO;EAEL,SAAS;EAET,UAAU;EACV,OAAO;EACP,OAAO;EACP,IAAI;EAEJ,IAAI;EACJ,UAAU;EACV,aAAa;EAEb,YAAY,wBAAwB;CACtC;CACA,UAAU;EACR,QAAQ,EACN,MAAM,EAAE,YAAY,+BAA+B,EACrD;EACA,UAAU,EACR,MAAM,EAAE,SAAS,4BAA4B,EAC/C;EACA,SAAS;GACP,IAAI,EAAE,SAAS,iBAAiB;GAChC,IAAI,EAAE,SAAS,mBAAmB;GAClC,IAAI,EAAE,SAAS,iBAAiB;EAClC;EACA,OAAO;GACL,MAAM,CAAC;GACP,OAAO,CAAC;EACV;EAEA,SAAS,EACP,MAAM,EAAE,OAAO,+GAA+G,EAChI;EACA,YAAY;GACV,UAAU,EAAE,IAAI,sBAAsB;GACtC,OAAO,EAAE,IAAI,uBAAuB;GAEpC,YAAY,EAAE,IAAI,6GAA6G,YAAY,oHAAoH,cAAc,cAAc;GAC3R,gBAAgB,EAAE,IAAI,kDAAkD,YAAY,GAAG,gBAAgB;GACvG,OAAO,EAAE,IAAI,0CAA0C;EACzD;EACA,QAAQ,EACN,MAAM;GACJ,SAAS;GACT,UAAU;GACV,OAAO;GACP,OAAO;GACP,IAAI;GACJ,IAAI;EACN,EACF;CACF;;;;;;;CAOA,kBAAkB,CAEhB;EAAE,OAAO;EAAO,QAAQ;EAAO,OAAO,EAAE,IAAI,oCAAoC;CAAE,GAClF;EAAE,OAAO;EAAM,QAAQ;EAAO,OAAO,EAAE,IAAI,mCAAmC;CAAE,CAClF;CACA,iBAAiB;EACf,OAAO;EACP,QAAQ;CACV;AACF,CAAC"}
1
+ {"version":3,"file":"data-table-styles.js","names":[],"sources":["../../../src/components/tables/data-table-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\n/** A 2px primary rail down the left edge of an open row and its panel; out of flow, so the cell keeps its padding. */\nconst OPEN_ROW_RAIL = '[&>td:first-child]:relative [&>td:first-child]:before:absolute [&>td:first-child]:before:inset-y-0 [&>td:first-child]:before:left-0 [&>td:first-child]:before:w-0.5 [&>td:first-child]:before:bg-rui-primary';\n\n/**\n * The band of an open row inside another table's panel: a step darker than the outer band, so the two\n * levels never share a grey while the rows between them keep the plain surface.\n */\nconst NESTED_BAND = '[[data-id=row-expanded]_&]:bg-rui-neutral-950/[0.11] dark:[[data-id=row-expanded]_&]:bg-white/[0.14]';\n\n/**\n * Header and pagination of a nested table, stepped by depth to stand off the band around them (about\n * 1.12:1 or more) as well as their own rows: past the lighter band one panel deep, short of the darker\n * band two deep. Nested bars never stick, so the tint can be translucent over the table's own surface.\n */\nexport const NESTED_BAR = '[[data-id=row-expanded]_&]:bg-rui-neutral-950/[0.13] dark:[[data-id=row-expanded]_&]:bg-white/[0.16] [[data-id=row-expanded]_[data-id=row-expanded]_&]:bg-rui-neutral-950/[0.06] dark:[[data-id=row-expanded]_[data-id=row-expanded]_&]:bg-white/[0.07]';\n\nexport const dataTableStyles = tv({\n slots: {\n // `clip`, not `hidden`, which may shrink the item below its rows; its own surface reads the same anywhere\n wrapper: 'relative between:border-t between:border-b-0 between:border-rui-divider overflow-clip bg-rui-surface',\n // focusable only while it scrolls with nothing to tab to (useKeyboardScroll), ring drawn inside\n scroller: 'overflow-x-auto overflow-y-hidden [clip-path:inset(0_0_0_0)] outline-hidden focus-visible:focus-ring focus-visible:-outline-offset-2',\n table: 'min-w-full table-fixed between:border-t between:border-b-0 between:border-rui-divider whitespace-nowrap mx-auto my-0 max-w-fit relative border-rui-divider',\n tbody: 'between:border-t between:border-b-0 between:border-rui-divider',\n tr: 'hover:bg-rui-hover',\n // numbers line up in columns; no slashed zero, which in Inter reads as a second, monospace font beside zero-free values\n td: '[:where(&)]:px-4 text-rui-text text-body-2 tabular-nums [text-wrap:initial]',\n checkbox: 'px-2 w-[3.625rem] max-w-[3.625rem] [&_label]:ml-0',\n tbodyLoader: 'text-center',\n // tinted like the column header, the pair framing the body; opaque, so rows scroll behind a stuck bar\n pagination: `bg-rui-surface-muted ${NESTED_BAR}`,\n },\n variants: {\n sticky: {\n true: { pagination: 'sticky bottom-0 z-rui-raised' },\n },\n outlined: {\n true: { wrapper: 'border border-rui-divider' },\n },\n rounded: {\n sm: { wrapper: 'rounded-rui-sm' },\n md: { wrapper: 'rounded-rui-card' },\n lg: { wrapper: 'rounded-rui-lg' },\n },\n dense: {\n true: {},\n false: {},\n },\n // under every row state through `:where()`; set per item (`data-stripe`), so a follow-up row or open panel shifts none\n striped: {\n true: { tbody: '[:where(&>tr[data-stripe])]:bg-rui-neutral-950/[0.03] dark:[:where(&>tr[data-stripe])]:bg-white/[0.04]' },\n },\n rowVariant: {\n selected: { tr: 'bg-rui-primary-soft' },\n empty: { tr: 'hover:bg-transparent' },\n // a grey band darker than the header so the two never match, a step darker again inside another panel\n expandable: { tr: `bg-rui-neutral-950/[0.07] hover:bg-rui-neutral-950/[0.07] dark:bg-white/[0.09] dark:hover:bg-white/[0.09] ${NESTED_BAND} [[data-id=row-expanded]_&]:hover:bg-rui-neutral-950/[0.11] dark:[[data-id=row-expanded]_&]:hover:bg-white/[0.14] ${OPEN_ROW_RAIL} !border-t-0` },\n expandedParent: { tr: `bg-rui-neutral-950/[0.07] dark:bg-white/[0.09] ${NESTED_BAND} ${OPEN_ROW_RAIL}` },\n group: { tr: 'bg-rui-neutral-100 dark:bg-white/[0.05]' },\n },\n mobile: {\n true: {\n wrapper: 'between:border-t-0 border-0 rounded-none overflow-visible',\n scroller: 'overflow-visible [clip-path:none]',\n table: 'block min-w-0 max-w-none w-full whitespace-normal between:border-t-0 border-0',\n tbody: 'block between:border-t-0',\n tr: 'block',\n td: 'block px-4 py-2',\n },\n },\n },\n /**\n * A fixed row height keeps a row of plain text as tall as one holding an\n * icon button. Padding and floor sit in `:where()` so a consumer's `cellClass`\n * (`py-0` is common) still wins at any stylesheet order, and each density\n * sets its own because the class merger cannot dedupe these.\n */\n compoundVariants: [\n // a 4px inset under the height floor fits a 36px button in a 44px row (a 28px one in a dense 36px row)\n { dense: false, mobile: false, class: { td: '[:where(&)]:py-1 [:where(&)]:h-11' } },\n { dense: true, mobile: false, class: { td: '[:where(&)]:py-1 [:where(&)]:h-9' } },\n ],\n defaultVariants: {\n dense: false,\n mobile: false,\n },\n});\n"],"mappings":";;;AAGA,IAAM,gBAAgB;;;;;AAMtB,IAAM,cAAc;;;;;;AAOpB,IAAa,aAAa;AAE1B,IAAa,kBAAkB,GAAG;CAChC,OAAO;EAEL,SAAS;EAET,UAAU;EACV,OAAO;EACP,OAAO;EACP,IAAI;EAEJ,IAAI;EACJ,UAAU;EACV,aAAa;EAEb,YAAY,wBAAwB;CACtC;CACA,UAAU;EACR,QAAQ,EACN,MAAM,EAAE,YAAY,+BAA+B,EACrD;EACA,UAAU,EACR,MAAM,EAAE,SAAS,4BAA4B,EAC/C;EACA,SAAS;GACP,IAAI,EAAE,SAAS,iBAAiB;GAChC,IAAI,EAAE,SAAS,mBAAmB;GAClC,IAAI,EAAE,SAAS,iBAAiB;EAClC;EACA,OAAO;GACL,MAAM,CAAC;GACP,OAAO,CAAC;EACV;EAEA,SAAS,EACP,MAAM,EAAE,OAAO,yGAAyG,EAC1H;EACA,YAAY;GACV,UAAU,EAAE,IAAI,sBAAsB;GACtC,OAAO,EAAE,IAAI,uBAAuB;GAEpC,YAAY,EAAE,IAAI,6GAA6G,YAAY,oHAAoH,cAAc,cAAc;GAC3R,gBAAgB,EAAE,IAAI,kDAAkD,YAAY,GAAG,gBAAgB;GACvG,OAAO,EAAE,IAAI,0CAA0C;EACzD;EACA,QAAQ,EACN,MAAM;GACJ,SAAS;GACT,UAAU;GACV,OAAO;GACP,OAAO;GACP,IAAI;GACJ,IAAI;EACN,EACF;CACF;;;;;;;CAOA,kBAAkB,CAEhB;EAAE,OAAO;EAAO,QAAQ;EAAO,OAAO,EAAE,IAAI,oCAAoC;CAAE,GAClF;EAAE,OAAO;EAAM,QAAQ;EAAO,OAAO,EAAE,IAAI,mCAAmC;CAAE,CAClF;CACA,iBAAiB;EACf,OAAO;EACP,QAAQ;CACV;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTab.js","names":[],"sources":["../../../../src/components/tabs/tab/RuiTab.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RouteLocationRaw } from 'vue-router';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { VueClassValue } from '@/types/class-value';\nimport { TabAlignment, TabIndicatorPosition, TabLayout, TabVariant } from '@/components/tabs/tab-props';\nimport { useTabLink } from '@/components/tabs/tab/use-tab-link';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface RuiTabClassNames {\n root?: VueClassValue;\n active?: VueClassValue;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n disabled?: boolean;\n grow?: boolean;\n value?: number | string;\n active?: boolean;\n classNames?: RuiTabClassNames;\n link?: boolean;\n target?: string;\n to?: RouteLocationRaw;\n exact?: boolean;\n vertical?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n variant?: TabVariant;\n}\n\ndefineOptions({\n name: 'RuiTab',\n inheritAttrs: false,\n});\n\nconst {\n color,\n disabled = false,\n grow = false,\n value = useId(),\n active = false,\n classNames,\n link = false,\n to = '',\n target = '_self',\n exact = false,\n vertical = false,\n align = TabAlignment.center,\n indicatorPosition = TabIndicatorPosition.end,\n variant = TabVariant.underline,\n} = defineProps<Props>();\n\nconst emit = defineEmits<{\n click: [value: string | number];\n}>();\n\nconst slots = defineSlots<{\n default?: (props?: object) => any;\n prepend?: (props?: object) => any;\n append?: (props?: object) => any;\n}>();\n\n/**\n * A tab is a plain button or link: RuiTabs draws the active indicator, so a tab\n * only sets its label color, and its hover fill. On the underline bar the fill\n * hugs the label rather than the 40px cell, so the bar stays calm.\n */\nconst tab = tv({\n slots: {\n root: [\n 'group relative inline-flex shrink-0 items-center whitespace-nowrap rounded-rui-control',\n 'text-sm font-medium text-rui-text-secondary transition-colors duration-150 [--rui-icon-size:1rem]',\n // inset, since the scrolling bar would clip a ring drawn outside the tab\n 'outline-hidden focus-visible:focus-ring focus-visible:-outline-offset-2',\n ].join(' '),\n content: 'inline-flex items-center gap-2 rounded-rui-control transition-colors duration-150',\n },\n variants: {\n variant: {\n [TabVariant.underline]: { root: 'px-1', content: 'h-8 px-2' },\n // above the sliding pill, which RuiTabs renders behind the tabs\n [TabVariant.segmented]: { root: 'z-1 h-8 px-3' },\n },\n layout: {\n [TabLayout.horizontal]: {},\n [TabLayout.vertical]: { root: 'w-full' },\n },\n align: {\n start: { root: 'justify-start text-left rtl:justify-end rtl:text-right' },\n center: { root: 'justify-center text-center' },\n end: { root: 'justify-end text-right rtl:justify-start rtl:text-left' },\n },\n grow: {\n true: { root: 'grow' },\n },\n active: {\n true: { root: 'text-rui-text' },\n false: {},\n },\n disabled: {\n true: { root: 'cursor-not-allowed text-rui-text-disabled' },\n false: { root: 'cursor-pointer hover:text-rui-text' },\n },\n },\n compoundVariants: [\n { variant: TabVariant.underline, layout: TabLayout.horizontal, class: { root: 'h-10' } },\n { variant: TabVariant.underline, layout: TabLayout.horizontal, disabled: false, class: { content: 'group-hover:bg-rui-hover' } },\n // a vertical list fills the whole row on hover and keeps that fill on the selected row\n { variant: TabVariant.underline, layout: TabLayout.vertical, class: { root: 'min-h-9 px-3', content: 'h-auto px-0 py-2' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, disabled: false, class: { root: 'hover:bg-rui-hover' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, active: true, class: { root: 'bg-rui-hover' } },\n ],\n defaultVariants: {\n variant: TabVariant.underline,\n layout: TabLayout.horizontal,\n align: 'center',\n active: false,\n disabled: false,\n },\n});\n\nconst { isRouteActive, href: linkHref, navigate, isLink } = useTabLink({\n link: () => link,\n to: () => to,\n exact: () => exact,\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst isSelf = computed<boolean>(() => target === '_self');\nconst isEffectivelyActive = computed<boolean>(() => active || get(isRouteActive));\nconst ui = computed<ReturnType<typeof tab>>(() => tab({\n variant,\n layout: get(layout),\n align,\n grow,\n disabled,\n active: get(isEffectivelyActive),\n}));\n\nfunction onClick(event: MouseEvent): void {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n emit('click', value);\n if (navigate && get(isSelf))\n navigate(event);\n}\n</script>\n\n<template>\n <component\n :is=\"isLink ? 'a' : 'button'\"\n :type=\"isLink ? undefined : 'button'\"\n :class=\"[\n ui.root({ class: cn(classNames?.root) }),\n isEffectivelyActive && classNames?.active,\n ]\"\n :data-active-tab=\"isEffectivelyActive || undefined\"\n :data-align=\"align\"\n :data-indicator-position=\"indicatorPosition\"\n :data-vertical=\"vertical || undefined\"\n :data-variant=\"variant\"\n :data-color=\"isEffectivelyActive ? color : undefined\"\n :disabled=\"isLink ? undefined : disabled\"\n :aria-disabled=\"isLink && disabled ? 'true' : undefined\"\n :href=\"isLink && !isSelf && !disabled ? linkHref : undefined\"\n :target=\"isLink ? target : undefined\"\n role=\"tab\"\n :aria-selected=\"isEffectivelyActive\"\n :tabindex=\"isEffectivelyActive && !disabled ? 0 : -1\"\n v-bind=\"$attrs\"\n @click=\"onClick($event)\"\n >\n <span :class=\"ui.content()\">\n <slot\n v-if=\"slots.prepend\"\n name=\"prepend\"\n />\n <slot />\n <slot\n v-if=\"slots.append\"\n name=\"append\"\n />\n </span>\n </component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiTab.js","names":["_sfc_main"],"sources":["../../../../src/components/tabs/tab/RuiTab.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RouteLocationRaw } from 'vue-router';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { VueClassValue } from '@/types/class-value';\nimport { TabAlignment, TabIndicatorPosition, TabLayout, TabVariant } from '@/components/tabs/tab-props';\nimport { useTabLink } from '@/components/tabs/tab/use-tab-link';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface RuiTabClassNames {\n root?: VueClassValue;\n active?: VueClassValue;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n disabled?: boolean;\n grow?: boolean;\n value?: number | string;\n active?: boolean;\n classNames?: RuiTabClassNames;\n link?: boolean;\n target?: string;\n to?: RouteLocationRaw;\n exact?: boolean;\n vertical?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n variant?: TabVariant;\n}\n\ndefineOptions({\n name: 'RuiTab',\n inheritAttrs: false,\n});\n\nconst {\n color,\n disabled = false,\n grow = false,\n value = useId(),\n active = false,\n classNames,\n link = false,\n to = '',\n target = '_self',\n exact = false,\n vertical = false,\n align = TabAlignment.center,\n indicatorPosition = TabIndicatorPosition.end,\n variant = TabVariant.underline,\n} = defineProps<Props>();\n\nconst emit = defineEmits<{\n click: [value: string | number];\n}>();\n\nconst slots = defineSlots<{\n default?: (props?: object) => any;\n prepend?: (props?: object) => any;\n append?: (props?: object) => any;\n}>();\n\n/**\n * A tab is a plain button or link: RuiTabs draws the active indicator, so a tab\n * only sets its label color, and its hover fill. On the underline bar the fill\n * hugs the label rather than the 40px cell, so the bar stays calm.\n */\nconst tab = tv({\n slots: {\n root: [\n 'group relative inline-flex shrink-0 items-center whitespace-nowrap rounded-rui-control',\n 'text-sm font-medium text-rui-text-secondary transition-colors duration-150 [--rui-icon-size:1rem]',\n // inset, since the scrolling bar would clip a ring drawn outside the tab\n 'outline-hidden focus-visible:focus-ring focus-visible:-outline-offset-2',\n ].join(' '),\n content: 'inline-flex items-center gap-2 rounded-rui-control transition-colors duration-150',\n },\n variants: {\n variant: {\n [TabVariant.underline]: { root: 'px-1', content: 'h-8 px-2' },\n // above the sliding pill, which RuiTabs renders behind the tabs\n [TabVariant.segmented]: { root: 'z-1 h-8 px-3' },\n },\n layout: {\n [TabLayout.horizontal]: {},\n [TabLayout.vertical]: { root: 'w-full' },\n },\n align: {\n start: { root: 'justify-start text-left rtl:justify-end rtl:text-right' },\n center: { root: 'justify-center text-center' },\n end: { root: 'justify-end text-right rtl:justify-start rtl:text-left' },\n },\n grow: {\n true: { root: 'grow' },\n },\n active: {\n true: { root: 'text-rui-text' },\n false: {},\n },\n disabled: {\n true: { root: 'cursor-not-allowed text-rui-text-disabled' },\n false: { root: 'cursor-pointer hover:text-rui-text' },\n },\n },\n compoundVariants: [\n { variant: TabVariant.underline, layout: TabLayout.horizontal, class: { root: 'h-10' } },\n { variant: TabVariant.underline, layout: TabLayout.horizontal, disabled: false, class: { content: 'group-hover:bg-rui-hover' } },\n // a vertical list fills the whole row on hover and keeps that fill on the selected row\n { variant: TabVariant.underline, layout: TabLayout.vertical, class: { root: 'min-h-9 px-3', content: 'h-auto px-0 py-2' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, disabled: false, class: { root: 'hover:bg-rui-hover' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, active: true, class: { root: 'bg-rui-hover' } },\n ],\n defaultVariants: {\n variant: TabVariant.underline,\n layout: TabLayout.horizontal,\n align: 'center',\n active: false,\n disabled: false,\n },\n});\n\nconst { isRouteActive, href: linkHref, navigate, isLink } = useTabLink({\n link: () => link,\n to: () => to,\n exact: () => exact,\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst isSelf = computed<boolean>(() => target === '_self');\nconst isEffectivelyActive = computed<boolean>(() => active || get(isRouteActive));\nconst ui = computed<ReturnType<typeof tab>>(() => tab({\n variant,\n layout: get(layout),\n align,\n grow,\n disabled,\n active: get(isEffectivelyActive),\n}));\n\nfunction onClick(event: MouseEvent): void {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n emit('click', value);\n if (navigate && get(isSelf))\n navigate(event);\n}\n</script>\n\n<template>\n <component\n :is=\"isLink ? 'a' : 'button'\"\n :type=\"isLink ? undefined : 'button'\"\n :class=\"[\n ui.root({ class: cn(classNames?.root) }),\n isEffectivelyActive && classNames?.active,\n ]\"\n :data-active-tab=\"isEffectivelyActive || undefined\"\n :data-align=\"align\"\n :data-indicator-position=\"indicatorPosition\"\n :data-vertical=\"vertical || undefined\"\n :data-variant=\"variant\"\n :data-color=\"isEffectivelyActive ? color : undefined\"\n :disabled=\"isLink ? undefined : disabled\"\n :aria-disabled=\"isLink && disabled ? 'true' : undefined\"\n :href=\"isLink && !isSelf && !disabled ? linkHref : undefined\"\n :target=\"isLink ? target : undefined\"\n role=\"tab\"\n :aria-selected=\"isEffectivelyActive\"\n :tabindex=\"isEffectivelyActive && !disabled ? 0 : -1\"\n v-bind=\"$attrs\"\n @click=\"onClick($event)\"\n >\n <span :class=\"ui.content()\">\n <slot\n v-if=\"slots.prepend\"\n name=\"prepend\"\n />\n <slot />\n <slot\n v-if=\"slots.append\"\n name=\"append\"\n />\n </span>\n </component>\n</template>\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import type { RouteLocationRaw } from 'vue-router';
2
2
  import type { ContextColorsType } from '../../../consts/colors.js';
3
- import type { VueClassValue } from '../../../types/class-value';
3
+ import type { VueClassValue } from '../../../types/class-value.js';
4
4
  import { TabAlignment, TabIndicatorPosition, TabVariant } from '../tab-props.js';
5
5
  export interface RuiTabClassNames {
6
6
  root?: VueClassValue;
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTab.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../src/components/tabs/tab/RuiTab.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RouteLocationRaw } from 'vue-router';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { VueClassValue } from '@/types/class-value';\nimport { TabAlignment, TabIndicatorPosition, TabLayout, TabVariant } from '@/components/tabs/tab-props';\nimport { useTabLink } from '@/components/tabs/tab/use-tab-link';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface RuiTabClassNames {\n root?: VueClassValue;\n active?: VueClassValue;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n disabled?: boolean;\n grow?: boolean;\n value?: number | string;\n active?: boolean;\n classNames?: RuiTabClassNames;\n link?: boolean;\n target?: string;\n to?: RouteLocationRaw;\n exact?: boolean;\n vertical?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n variant?: TabVariant;\n}\n\ndefineOptions({\n name: 'RuiTab',\n inheritAttrs: false,\n});\n\nconst {\n color,\n disabled = false,\n grow = false,\n value = useId(),\n active = false,\n classNames,\n link = false,\n to = '',\n target = '_self',\n exact = false,\n vertical = false,\n align = TabAlignment.center,\n indicatorPosition = TabIndicatorPosition.end,\n variant = TabVariant.underline,\n} = defineProps<Props>();\n\nconst emit = defineEmits<{\n click: [value: string | number];\n}>();\n\nconst slots = defineSlots<{\n default?: (props?: object) => any;\n prepend?: (props?: object) => any;\n append?: (props?: object) => any;\n}>();\n\n/**\n * A tab is a plain button or link: RuiTabs draws the active indicator, so a tab\n * only sets its label color, and its hover fill. On the underline bar the fill\n * hugs the label rather than the 40px cell, so the bar stays calm.\n */\nconst tab = tv({\n slots: {\n root: [\n 'group relative inline-flex shrink-0 items-center whitespace-nowrap rounded-rui-control',\n 'text-sm font-medium text-rui-text-secondary transition-colors duration-150 [--rui-icon-size:1rem]',\n // inset, since the scrolling bar would clip a ring drawn outside the tab\n 'outline-hidden focus-visible:focus-ring focus-visible:-outline-offset-2',\n ].join(' '),\n content: 'inline-flex items-center gap-2 rounded-rui-control transition-colors duration-150',\n },\n variants: {\n variant: {\n [TabVariant.underline]: { root: 'px-1', content: 'h-8 px-2' },\n // above the sliding pill, which RuiTabs renders behind the tabs\n [TabVariant.segmented]: { root: 'z-1 h-8 px-3' },\n },\n layout: {\n [TabLayout.horizontal]: {},\n [TabLayout.vertical]: { root: 'w-full' },\n },\n align: {\n start: { root: 'justify-start text-left rtl:justify-end rtl:text-right' },\n center: { root: 'justify-center text-center' },\n end: { root: 'justify-end text-right rtl:justify-start rtl:text-left' },\n },\n grow: {\n true: { root: 'grow' },\n },\n active: {\n true: { root: 'text-rui-text' },\n false: {},\n },\n disabled: {\n true: { root: 'cursor-not-allowed text-rui-text-disabled' },\n false: { root: 'cursor-pointer hover:text-rui-text' },\n },\n },\n compoundVariants: [\n { variant: TabVariant.underline, layout: TabLayout.horizontal, class: { root: 'h-10' } },\n { variant: TabVariant.underline, layout: TabLayout.horizontal, disabled: false, class: { content: 'group-hover:bg-rui-hover' } },\n // a vertical list fills the whole row on hover and keeps that fill on the selected row\n { variant: TabVariant.underline, layout: TabLayout.vertical, class: { root: 'min-h-9 px-3', content: 'h-auto px-0 py-2' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, disabled: false, class: { root: 'hover:bg-rui-hover' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, active: true, class: { root: 'bg-rui-hover' } },\n ],\n defaultVariants: {\n variant: TabVariant.underline,\n layout: TabLayout.horizontal,\n align: 'center',\n active: false,\n disabled: false,\n },\n});\n\nconst { isRouteActive, href: linkHref, navigate, isLink } = useTabLink({\n link: () => link,\n to: () => to,\n exact: () => exact,\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst isSelf = computed<boolean>(() => target === '_self');\nconst isEffectivelyActive = computed<boolean>(() => active || get(isRouteActive));\nconst ui = computed<ReturnType<typeof tab>>(() => tab({\n variant,\n layout: get(layout),\n align,\n grow,\n disabled,\n active: get(isEffectivelyActive),\n}));\n\nfunction onClick(event: MouseEvent): void {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n emit('click', value);\n if (navigate && get(isSelf))\n navigate(event);\n}\n</script>\n\n<template>\n <component\n :is=\"isLink ? 'a' : 'button'\"\n :type=\"isLink ? undefined : 'button'\"\n :class=\"[\n ui.root({ class: cn(classNames?.root) }),\n isEffectivelyActive && classNames?.active,\n ]\"\n :data-active-tab=\"isEffectivelyActive || undefined\"\n :data-align=\"align\"\n :data-indicator-position=\"indicatorPosition\"\n :data-vertical=\"vertical || undefined\"\n :data-variant=\"variant\"\n :data-color=\"isEffectivelyActive ? color : undefined\"\n :disabled=\"isLink ? undefined : disabled\"\n :aria-disabled=\"isLink && disabled ? 'true' : undefined\"\n :href=\"isLink && !isSelf && !disabled ? linkHref : undefined\"\n :target=\"isLink ? target : undefined\"\n role=\"tab\"\n :aria-selected=\"isEffectivelyActive\"\n :tabindex=\"isEffectivelyActive && !disabled ? 0 : -1\"\n v-bind=\"$attrs\"\n @click=\"onClick($event)\"\n >\n <span :class=\"ui.content()\">\n <slot\n v-if=\"slots.prepend\"\n name=\"prepend\"\n />\n <slot />\n <slot\n v-if=\"slots.append\"\n name=\"append\"\n />\n </span>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDA,MAAM,OAAO;EAIb,MAAM,QAAQ,SAAA;;;;;;EAWd,MAAM,MAAM,GAAG;GACb,OAAO;IACL,MAAM;KACJ;KACA;KAEA;IACF,CAAC,CAAC,KAAK,GAAG;IACV,SAAS;GACX;GACA,UAAU;IACR,SAAS;MACN,WAAW,YAAY;MAAE,MAAM;MAAQ,SAAS;KAAW;MAE3D,WAAW,YAAY,EAAE,MAAM,eAAe;IACjD;IACA,QAAQ;MACL,UAAU,aAAa,CAAC;MACxB,UAAU,WAAW,EAAE,MAAM,SAAS;IACzC;IACA,OAAO;KACL,OAAO,EAAE,MAAM,yDAAyD;KACxE,QAAQ,EAAE,MAAM,6BAA6B;KAC7C,KAAK,EAAE,MAAM,yDAAyD;IACxE;IACA,MAAM,EACJ,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AAA,GAAA,CAAA,IAAA,mBAAA,IAAA,IAAA;KACF,WAAQ,KAAA,QAAA,SAAA;KAEA,MAAM,SADd,WAGE,KAAA,QAAA,UAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,IAAA,mBAAA,IAAA,IAAA"}
1
+ {"version":3,"file":"RuiTab.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useSlots","_openBlock","_createBlock","_resolveDynamicComponent","_unref","_mergeProps","_withCtx","_createElementVNode","_normalizeClass","_renderSlot","_createCommentVNode"],"sources":["../../../../src/components/tabs/tab/RuiTab.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RouteLocationRaw } from 'vue-router';\nimport type { ContextColorsType } from '@/consts/colors';\nimport type { VueClassValue } from '@/types/class-value';\nimport { TabAlignment, TabIndicatorPosition, TabLayout, TabVariant } from '@/components/tabs/tab-props';\nimport { useTabLink } from '@/components/tabs/tab/use-tab-link';\nimport { cn, tv } from '@/utils/tv';\n\nexport interface RuiTabClassNames {\n root?: VueClassValue;\n active?: VueClassValue;\n}\n\nexport interface Props {\n color?: ContextColorsType;\n disabled?: boolean;\n grow?: boolean;\n value?: number | string;\n active?: boolean;\n classNames?: RuiTabClassNames;\n link?: boolean;\n target?: string;\n to?: RouteLocationRaw;\n exact?: boolean;\n vertical?: boolean;\n align?: TabAlignment;\n indicatorPosition?: TabIndicatorPosition;\n variant?: TabVariant;\n}\n\ndefineOptions({\n name: 'RuiTab',\n inheritAttrs: false,\n});\n\nconst {\n color,\n disabled = false,\n grow = false,\n value = useId(),\n active = false,\n classNames,\n link = false,\n to = '',\n target = '_self',\n exact = false,\n vertical = false,\n align = TabAlignment.center,\n indicatorPosition = TabIndicatorPosition.end,\n variant = TabVariant.underline,\n} = defineProps<Props>();\n\nconst emit = defineEmits<{\n click: [value: string | number];\n}>();\n\nconst slots = defineSlots<{\n default?: (props?: object) => any;\n prepend?: (props?: object) => any;\n append?: (props?: object) => any;\n}>();\n\n/**\n * A tab is a plain button or link: RuiTabs draws the active indicator, so a tab\n * only sets its label color, and its hover fill. On the underline bar the fill\n * hugs the label rather than the 40px cell, so the bar stays calm.\n */\nconst tab = tv({\n slots: {\n root: [\n 'group relative inline-flex shrink-0 items-center whitespace-nowrap rounded-rui-control',\n 'text-sm font-medium text-rui-text-secondary transition-colors duration-150 [--rui-icon-size:1rem]',\n // inset, since the scrolling bar would clip a ring drawn outside the tab\n 'outline-hidden focus-visible:focus-ring focus-visible:-outline-offset-2',\n ].join(' '),\n content: 'inline-flex items-center gap-2 rounded-rui-control transition-colors duration-150',\n },\n variants: {\n variant: {\n [TabVariant.underline]: { root: 'px-1', content: 'h-8 px-2' },\n // above the sliding pill, which RuiTabs renders behind the tabs\n [TabVariant.segmented]: { root: 'z-1 h-8 px-3' },\n },\n layout: {\n [TabLayout.horizontal]: {},\n [TabLayout.vertical]: { root: 'w-full' },\n },\n align: {\n start: { root: 'justify-start text-left rtl:justify-end rtl:text-right' },\n center: { root: 'justify-center text-center' },\n end: { root: 'justify-end text-right rtl:justify-start rtl:text-left' },\n },\n grow: {\n true: { root: 'grow' },\n },\n active: {\n true: { root: 'text-rui-text' },\n false: {},\n },\n disabled: {\n true: { root: 'cursor-not-allowed text-rui-text-disabled' },\n false: { root: 'cursor-pointer hover:text-rui-text' },\n },\n },\n compoundVariants: [\n { variant: TabVariant.underline, layout: TabLayout.horizontal, class: { root: 'h-10' } },\n { variant: TabVariant.underline, layout: TabLayout.horizontal, disabled: false, class: { content: 'group-hover:bg-rui-hover' } },\n // a vertical list fills the whole row on hover and keeps that fill on the selected row\n { variant: TabVariant.underline, layout: TabLayout.vertical, class: { root: 'min-h-9 px-3', content: 'h-auto px-0 py-2' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, disabled: false, class: { root: 'hover:bg-rui-hover' } },\n { variant: TabVariant.underline, layout: TabLayout.vertical, active: true, class: { root: 'bg-rui-hover' } },\n ],\n defaultVariants: {\n variant: TabVariant.underline,\n layout: TabLayout.horizontal,\n align: 'center',\n active: false,\n disabled: false,\n },\n});\n\nconst { isRouteActive, href: linkHref, navigate, isLink } = useTabLink({\n link: () => link,\n to: () => to,\n exact: () => exact,\n});\n\nconst layout = computed<TabLayout>(() => vertical ? TabLayout.vertical : TabLayout.horizontal);\nconst isSelf = computed<boolean>(() => target === '_self');\nconst isEffectivelyActive = computed<boolean>(() => active || get(isRouteActive));\nconst ui = computed<ReturnType<typeof tab>>(() => tab({\n variant,\n layout: get(layout),\n align,\n grow,\n disabled,\n active: get(isEffectivelyActive),\n}));\n\nfunction onClick(event: MouseEvent): void {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n emit('click', value);\n if (navigate && get(isSelf))\n navigate(event);\n}\n</script>\n\n<template>\n <component\n :is=\"isLink ? 'a' : 'button'\"\n :type=\"isLink ? undefined : 'button'\"\n :class=\"[\n ui.root({ class: cn(classNames?.root) }),\n isEffectivelyActive && classNames?.active,\n ]\"\n :data-active-tab=\"isEffectivelyActive || undefined\"\n :data-align=\"align\"\n :data-indicator-position=\"indicatorPosition\"\n :data-vertical=\"vertical || undefined\"\n :data-variant=\"variant\"\n :data-color=\"isEffectivelyActive ? color : undefined\"\n :disabled=\"isLink ? undefined : disabled\"\n :aria-disabled=\"isLink && disabled ? 'true' : undefined\"\n :href=\"isLink && !isSelf && !disabled ? linkHref : undefined\"\n :target=\"isLink ? target : undefined\"\n role=\"tab\"\n :aria-selected=\"isEffectivelyActive\"\n :tabindex=\"isEffectivelyActive && !disabled ? 0 : -1\"\n v-bind=\"$attrs\"\n @click=\"onClick($event)\"\n >\n <span :class=\"ui.content()\">\n <slot\n v-if=\"slots.prepend\"\n name=\"prepend\"\n />\n <slot />\n <slot\n v-if=\"slots.append\"\n name=\"append\"\n />\n </span>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDA,MAAM,OAAO;EAIb,MAAM,QAAQC,SAAA;;;;;;EAWd,MAAM,MAAM,G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,IAAW,KAAA;IAClD,QAAQA,MAAA,MAAA,IAAS,QAAA,SAAS,KAAA;IAC3B,MAAK;IACJ,iBAAeA,MAAA,mBAAA;IACf,UAAUA,MAAA,mBAAA,KAAmB,CAAK,QAAA,WAAQ,IAAA;GACnCL,GAAAA,KAAAA,QAAM,EACb,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,QAAQ,MAAM,GAAA,CAAA,GAAA;IAEtB,SAAAO,cAUO,CAVPC,mBAUO,QAAA,EAVA,OAAKC,eAAEJ,MAAA,EAAA,CAAE,CAAC,QAAO,CAAA,EAAA,GAAA;KAEd,MAAM,UADdK,WAGE,KAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,IAAA,mBAAA,IAAA,IAAA;KACFA,WAAQ,KAAA,QAAA,SAAA;KAEA,MAAM,SADdA,WAGE,KAAA,QAAA,UAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,IAAA,mBAAA,IAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTabItem.js","names":[],"sources":["../../../../src/components/tabs/tab-item/RuiTabItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nexport interface Props {\n active?: boolean;\n value?: number | string;\n eager?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTabItem',\n});\n\nconst { active = false, value, eager = false } = defineProps<Props>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n</script>\n\n<template>\n <div\n role=\"tabpanel\"\n class=\"w-full\"\n :data-value=\"value\"\n :data-active=\"active || undefined\"\n >\n <!-- the new panel fades in while the old one collapses at once, rather than Material's sideways swipe -->\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"w-full transition-opacity duration-150 ease-out motion-reduce:transition-none\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"w-full h-0! overflow-hidden\"\n >\n <div\n v-if=\"active\"\n class=\"w-full\"\n >\n <slot />\n </div>\n </Transition>\n <div\n v-if=\"eager && !active\"\n class=\"hidden\"\n >\n <slot />\n </div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiTabItem.js","names":["_sfc_main"],"sources":["../../../../src/components/tabs/tab-item/RuiTabItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nexport interface Props {\n active?: boolean;\n value?: number | string;\n eager?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTabItem',\n});\n\nconst { active = false, value, eager = false } = defineProps<Props>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n</script>\n\n<template>\n <div\n role=\"tabpanel\"\n class=\"w-full\"\n :data-value=\"value\"\n :data-active=\"active || undefined\"\n >\n <!-- the new panel fades in while the old one collapses at once, rather than Material's sideways swipe -->\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"w-full transition-opacity duration-150 ease-out motion-reduce:transition-none\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"w-full h-0! overflow-hidden\"\n >\n <div\n v-if=\"active\"\n class=\"w-full\"\n >\n <slot />\n </div>\n </Transition>\n <div\n v-if=\"eager && !active\"\n class=\"hidden\"\n >\n <slot />\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTabItem.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tabs/tab-item/RuiTabItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nexport interface Props {\n active?: boolean;\n value?: number | string;\n eager?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTabItem',\n});\n\nconst { active = false, value, eager = false } = defineProps<Props>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n</script>\n\n<template>\n <div\n role=\"tabpanel\"\n class=\"w-full\"\n :data-value=\"value\"\n :data-active=\"active || undefined\"\n >\n <!-- the new panel fades in while the old one collapses at once, rather than Material's sideways swipe -->\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"w-full transition-opacity duration-150 ease-out motion-reduce:transition-none\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"w-full h-0! overflow-hidden\"\n >\n <div\n v-if=\"active\"\n class=\"w-full\"\n >\n <slot />\n </div>\n </Transition>\n <div\n v-if=\"eager && !active\"\n class=\"hidden\"\n >\n <slot />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;GAmBE,OAAA,UAAA,GAAA,mBA0BM,OAAA;IAzBJ,MAAK;IACL,OAAM;IACL,cAAY,QAAA;IACZ,eAAa,QAAA,UAAU,KAAA;GAGxB,GAAA,CAAA,YAYa,YAAA;IAXX,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;IACf,sBAAmB;;IAEnB,SAAA,cAKM,CAJE,QAAA,UADR,UAAA,GAAA,mBAKM,OALN,YAKM,CADJ,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;;GAIJ,CAAA,GAAA,QAAA,SAAK,CAAK,QAAA,UADlB,UAAA,GAAA,mBAKM,OALN,YAKM,CADJ,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,GAAA,UAAA"}
1
+ {"version":3,"file":"RuiTabItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createVNode","_Transition","_withCtx","_renderSlot","_createCommentVNode"],"sources":["../../../../src/components/tabs/tab-item/RuiTabItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nexport interface Props {\n active?: boolean;\n value?: number | string;\n eager?: boolean;\n}\n\ndefineOptions({\n name: 'RuiTabItem',\n});\n\nconst { active = false, value, eager = false } = defineProps<Props>();\n\ndefineSlots<{\n default?: () => any;\n}>();\n</script>\n\n<template>\n <div\n role=\"tabpanel\"\n class=\"w-full\"\n :data-value=\"value\"\n :data-active=\"active || undefined\"\n >\n <!-- the new panel fades in while the old one collapses at once, rather than Material's sideways swipe -->\n <Transition\n enter-from-class=\"opacity-0\"\n enter-active-class=\"w-full transition-opacity duration-150 ease-out motion-reduce:transition-none\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"w-full h-0! overflow-hidden\"\n >\n <div\n v-if=\"active\"\n class=\"w-full\"\n >\n <slot />\n </div>\n </Transition>\n <div\n v-if=\"eager && !active\"\n class=\"hidden\"\n >\n <slot />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;GAmBE,OAAAA,UAAA,GAAAC,mBA0BM,OAAA;IAzBJ,MAAK;IACL,OAAM;IACL,cAAY,QAAA;IACZ,eAAa,QAAA,UAAU,KAAA;GAGxBC,GAAAA,CAAAA,YAYaC,YAAA;IAXX,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;IACf,sBAAmB;;IAEnB,SAAAC,cAKM,CAJE,QAAA,UADRJ,UAAA,GAAAC,mBAKM,OALN,YAKM,CADJI,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA;;GAIJ,CAAA,GAAA,QAAA,SAAK,CAAK,QAAA,UADlBL,UAAA,GAAAC,mBAKM,OALN,YAKM,CADJI,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,GAAA,GAAA,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTabItems.js","names":[],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n/**\n * The tab whose panel is showing.\n *\n * The default matches RuiTabs. Without one, binding both components to the\n * same ref that starts as `undefined` leaves this component with\n * `modelValue === undefined`, so the `active = modelValue === value` check\n * fails for every tab: the panel renders but stays at height 0, which reads as\n * an element with no content.\n */\nconst modelValue = defineModel<T>({ default: () => 0 as T });\n\nconst slots = useSlots();\n\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex))\n set(currIndex, index);\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n/**\n * Unwraps the fragments a `v-for` in the slot produces, so only tab items come\n * back.\n *\n * @param children - the slot's vnodes\n * @returns the tab items among them\n */\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-[height] duration-200 ease-out overflow-hidden motion-reduce:transition-none\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiTabItems.js","names":["_sfc_main"],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n/**\n * The tab whose panel is showing.\n *\n * The default matches RuiTabs. Without one, binding both components to the\n * same ref that starts as `undefined` leaves this component with\n * `modelValue === undefined`, so the `active = modelValue === value` check\n * fails for every tab: the panel renders but stays at height 0, which reads as\n * an element with no content.\n */\nconst modelValue = defineModel<T>({ default: () => 0 as T });\n\nconst slots = useSlots();\n\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex))\n set(currIndex, index);\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n/**\n * Unwraps the fragments a `v-for` in the slot produces, so only tab items come\n * back.\n *\n * @param children - the slot's vnodes\n * @returns the tab items among them\n */\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-[height] duration-200 ease-out overflow-hidden motion-reduce:transition-none\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiTabItems.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n/**\n * The tab whose panel is showing.\n *\n * The default matches RuiTabs. Without one, binding both components to the\n * same ref that starts as `undefined` leaves this component with\n * `modelValue === undefined`, so the `active = modelValue === value` check\n * fails for every tab: the panel renders but stays at height 0, which reads as\n * an element with no content.\n */\nconst modelValue = defineModel<T>({ default: () => 0 as T });\n\nconst slots = useSlots();\n\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex))\n set(currIndex, index);\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n/**\n * Unwraps the fragments a `v-for` in the slot produces, so only tab items come\n * back.\n *\n * @param children - the slot's vnodes\n * @returns the tab items among them\n */\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-[height] duration-200 ease-out overflow-hidden motion-reduce:transition-none\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,aAAa,SAAc,SAA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,UAAA,GAAA,YAKE,wBAJK,KAAK,GAAA;KAET,KAAK;KACL,QAAQ,MAAM,MAAA,WAAA"}
1
+ {"version":3,"file":"RuiTabItems.vue_vue_type_script_setup_true_lang.js","names":["$attrs","_useModel","_openBlock","_createElementBlock","_mergeProps","_unref","_createElementVNode","_Fragment","_renderList","_createBlock","_resolveDynamicComponent"],"sources":["../../../../src/components/tabs/tab-items/RuiTabItems.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends string | number\">\nimport { Fragment, isVNode } from 'vue';\n\ndefineOptions({\n name: 'RuiTabItems',\n inheritAttrs: false,\n});\n\n/**\n * The tab whose panel is showing.\n *\n * The default matches RuiTabs. Without one, binding both components to the\n * same ref that starts as `undefined` leaves this component with\n * `modelValue === undefined`, so the `active = modelValue === value` check\n * fails for every tab: the panel renders but stays at height 0, which reads as\n * an element with no content.\n */\nconst modelValue = defineModel<T>({ default: () => 0 as T });\n\nconst slots = useSlots();\n\nconst currIndex = ref<number>(-1);\nconst activeIndex = ref<number>(-1);\nconst inner = useTemplateRef<HTMLDivElement>('inner');\n\nconst { height: innerHeight } = useElementSize(inner);\n\nconst children = computed<VNode[]>(() => {\n const slotContent = slots.default?.() ?? [];\n\n const tabs = getChildrenTabs(slotContent);\n\n let anyActive = false;\n const children = tabs.map((tab, index) => {\n const value = tab.props?.value ?? index;\n const active = get(modelValue) === value;\n if (active) {\n anyActive = true;\n if (index !== get(currIndex))\n set(currIndex, index);\n }\n\n return {\n ...tab,\n props: {\n value,\n ...tab.props,\n },\n };\n });\n\n if (!anyActive)\n set(currIndex, -1);\n\n return children;\n});\n\n/**\n * Unwraps the fragments a `v-for` in the slot produces, so only tab items come\n * back.\n *\n * @param children - the slot's vnodes\n * @returns the tab items among them\n */\nfunction getChildrenTabs(children: VNode[]): VNode[] {\n return children\n .flatMap((item) => {\n if (item.type === Fragment && Array.isArray(item.children) && item.children.length > 0)\n return getChildrenTabs(item.children.filter(isVNode));\n\n return [item];\n })\n .flat();\n}\n\nwatch(currIndex, (index) => {\n nextTick(() => {\n set(activeIndex, index);\n });\n});\n</script>\n\n<template>\n <div\n class=\"grow transition-[height] duration-200 ease-out overflow-hidden motion-reduce:transition-none\"\n :style=\"{ height: `${innerHeight}px` }\"\n v-bind=\"$attrs\"\n >\n <div ref=\"inner\">\n <Component\n :is=\"child\"\n v-for=\"(child, i) in children\"\n :key=\"i\"\n :active=\"i === activeIndex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,aAAaC,SAAc,SAAA,YAA0B;EAE3D,MAAM,QAAQ,SAAS;EAEvB,MAAM,YAAY,IAAY,EAAE;EAChC,MAAM,cAAc,IAAY,EAAE;EAClC,MAAM,QAAQ,eAA+B,OAAO;EAEpD,MAAM,EAAE,QAAQ,gBAAgB,eAAe,KAAK;EAEpD,MAAM,WAAW,eAAwB;GAGvC,MAAM,OAAO,gBAFO,MAAM,UAAU,KAAK,CAAC,CAEF;GAExC,IAAI,YAAY;GAChB,MAAM,WAAW,KAAK,KAAK,KAAK,UAAU;IACxC,MAAM,QAAQ,IAAI,OAAO,SAAS;IAElC,IADe,IAAI,UAAU,MAAM,OACvB;KACV,YAAY;KACZ,IAAI,UAAU,IAAI,SAAS,GACzB,IAAI,WAAW,KAAK;IACxB;IAEA,OAAO;KACL,GAAG;KACH,OAAO;MACL;MACA,GAAG,IAAI;KACT;IACF;GACF,CAAC;GAED,IAAI,CAAC,WACH,IAAI,WAAW,EAAE;GAEnB,OAAO;EACT,CAAC;;;;;;;;EASD,SAAS,gBAAgB,UAA4B;GACnD,OAAO,SACJ,SAAS,SAAS;IACjB,IAAI,KAAK,SAAS,YAAY,MAAM,QAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,SAAS,GACnF,OAAO,gBAAgB,KAAK,SAAS,OAAO,OAAO,CAAC;IAEtD,OAAO,CAAC,IAAI;GACd,CAAC,CAAA,CACA,KAAK;EACV;EAEA,MAAM,YAAY,UAA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