@eslamdevui/ui 3.3.1 → 3.3.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/.nuxt/ui/button.ts +42 -42
  2. package/.nuxt/ui/command-palette.ts +2 -1
  3. package/.nuxt/ui/file-upload.ts +295 -0
  4. package/.nuxt/ui/index.ts +2 -0
  5. package/.nuxt/ui/kbd.ts +167 -3
  6. package/.nuxt/ui/scroll-to-section.ts +3 -0
  7. package/.nuxt/ui/table.ts +14 -0
  8. package/.nuxt/ui/tabs.ts +4 -2
  9. package/.nuxt/ui/toast.ts +8 -15
  10. package/.nuxt/ui/tooltip.ts +1 -1
  11. package/cli/templates.mjs +4 -3
  12. package/dist/module.d.mts +15 -1
  13. package/dist/module.json +2 -2
  14. package/dist/module.mjs +3 -3
  15. package/dist/runtime/components/Accordion.vue.d.ts +1 -1
  16. package/dist/runtime/components/Alert.vue.d.ts +2 -2
  17. package/dist/runtime/components/App.vue.d.ts +1 -1
  18. package/dist/runtime/components/Avatar.vue.d.ts +1 -1
  19. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  20. package/dist/runtime/components/Badge.vue.d.ts +1 -1
  21. package/dist/runtime/components/Banner.vue.d.ts +1 -5
  22. package/dist/runtime/components/BlogPost.vue.d.ts +1 -1
  23. package/dist/runtime/components/BlogPosts.vue.d.ts +1 -1
  24. package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
  25. package/dist/runtime/components/Button.vue +6 -6
  26. package/dist/runtime/components/Button.vue.d.ts +1 -5
  27. package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
  28. package/dist/runtime/components/Calendar.vue.d.ts +1 -1
  29. package/dist/runtime/components/Card.vue.d.ts +1 -1
  30. package/dist/runtime/components/Carousel.vue +18 -14
  31. package/dist/runtime/components/Carousel.vue.d.ts +1 -1
  32. package/dist/runtime/components/ChangelogVersion.vue.d.ts +1 -1
  33. package/dist/runtime/components/ChangelogVersions.vue.d.ts +1 -1
  34. package/dist/runtime/components/ChatMessage.vue.d.ts +4 -8
  35. package/dist/runtime/components/ChatMessages.vue.d.ts +1 -1
  36. package/dist/runtime/components/ChatPalette.vue.d.ts +1 -1
  37. package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
  38. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +1 -1
  39. package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
  40. package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
  41. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  42. package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
  43. package/dist/runtime/components/ColorPicker.vue +1 -2
  44. package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
  45. package/dist/runtime/components/CommandPalette.vue +4 -0
  46. package/dist/runtime/components/CommandPalette.vue.d.ts +9 -4
  47. package/dist/runtime/components/Container.vue.d.ts +1 -1
  48. package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
  49. package/dist/runtime/components/ContextMenuContent.vue.d.ts +1 -1
  50. package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
  51. package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
  52. package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
  53. package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +1 -1
  54. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +1 -1
  55. package/dist/runtime/components/DashboardSidebar.vue.d.ts +1 -1
  56. package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
  57. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
  58. package/dist/runtime/components/DashboardToolbar.vue.d.ts +1 -1
  59. package/dist/runtime/components/Drawer.vue +4 -4
  60. package/dist/runtime/components/Drawer.vue.d.ts +6 -1
  61. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
  62. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +8 -5
  63. package/dist/runtime/components/Error.vue.d.ts +1 -1
  64. package/dist/runtime/components/FileUpload.vue +242 -0
  65. package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
  66. package/dist/runtime/components/Footer.vue.d.ts +1 -1
  67. package/dist/runtime/components/FooterColumns.vue.d.ts +1 -1
  68. package/dist/runtime/components/Form.vue.d.ts +5 -4
  69. package/dist/runtime/components/FormField.vue +2 -2
  70. package/dist/runtime/components/FormField.vue.d.ts +4 -4
  71. package/dist/runtime/components/Header.vue.d.ts +1 -1
  72. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  73. package/dist/runtime/components/Input.vue +10 -7
  74. package/dist/runtime/components/Input.vue.d.ts +9 -9
  75. package/dist/runtime/components/InputMenu.vue +17 -10
  76. package/dist/runtime/components/InputMenu.vue.d.ts +17 -14
  77. package/dist/runtime/components/InputNumber.vue.d.ts +4 -4
  78. package/dist/runtime/components/InputTags.vue +2 -0
  79. package/dist/runtime/components/InputTags.vue.d.ts +5 -3
  80. package/dist/runtime/components/Kbd.vue +2 -1
  81. package/dist/runtime/components/Kbd.vue.d.ts +5 -1
  82. package/dist/runtime/components/Link.vue +6 -5
  83. package/dist/runtime/components/Link.vue.d.ts +1 -3
  84. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  85. package/dist/runtime/components/Main.vue.d.ts +1 -1
  86. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  87. package/dist/runtime/components/NavigationMenu.vue +3 -2
  88. package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
  89. package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
  90. package/dist/runtime/components/Page.vue.d.ts +1 -1
  91. package/dist/runtime/components/PageAccordion.vue.d.ts +1 -1
  92. package/dist/runtime/components/PageAnchors.vue.d.ts +1 -1
  93. package/dist/runtime/components/PageAside.vue.d.ts +1 -1
  94. package/dist/runtime/components/PageBody.vue.d.ts +1 -1
  95. package/dist/runtime/components/PageCTA.vue.d.ts +1 -1
  96. package/dist/runtime/components/PageCard.vue.d.ts +1 -1
  97. package/dist/runtime/components/PageColumns.vue.d.ts +1 -1
  98. package/dist/runtime/components/PageFeature.vue.d.ts +1 -1
  99. package/dist/runtime/components/PageGrid.vue.d.ts +1 -1
  100. package/dist/runtime/components/PageHeader.vue.d.ts +1 -1
  101. package/dist/runtime/components/PageHero.vue.d.ts +1 -1
  102. package/dist/runtime/components/PageLinks.vue.d.ts +1 -1
  103. package/dist/runtime/components/PageList.vue.d.ts +1 -1
  104. package/dist/runtime/components/PageLogos.vue.d.ts +1 -1
  105. package/dist/runtime/components/PageMarquee.vue.d.ts +1 -1
  106. package/dist/runtime/components/PageSection.vue.d.ts +1 -1
  107. package/dist/runtime/components/Pagination.vue.d.ts +1 -1
  108. package/dist/runtime/components/PinInput.vue.d.ts +1 -1
  109. package/dist/runtime/components/Popover.vue +2 -1
  110. package/dist/runtime/components/Popover.vue.d.ts +8 -2
  111. package/dist/runtime/components/PricingPlan.vue.d.ts +1 -1
  112. package/dist/runtime/components/PricingPlans.vue.d.ts +1 -1
  113. package/dist/runtime/components/PricingTable.vue +14 -2
  114. package/dist/runtime/components/PricingTable.vue.d.ts +1 -1
  115. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  116. package/dist/runtime/components/RadioGroup.vue +1 -1
  117. package/dist/runtime/components/RadioGroup.vue.d.ts +5 -4
  118. package/dist/runtime/components/ScrollToSection.vue +62 -0
  119. package/dist/runtime/components/ScrollToSection.vue.d.ts +36 -0
  120. package/dist/runtime/components/Select.vue.d.ts +1 -1
  121. package/dist/runtime/components/SelectMenu.vue +9 -6
  122. package/dist/runtime/components/SelectMenu.vue.d.ts +4 -4
  123. package/dist/runtime/components/Separator.vue.d.ts +1 -1
  124. package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
  125. package/dist/runtime/components/Slideover.vue.d.ts +2 -2
  126. package/dist/runtime/components/Slider.vue.d.ts +5 -5
  127. package/dist/runtime/components/Stepper.vue.d.ts +1 -1
  128. package/dist/runtime/components/Switch.vue.d.ts +1 -1
  129. package/dist/runtime/components/Table.vue +83 -8
  130. package/dist/runtime/components/Table.vue.d.ts +20 -4
  131. package/dist/runtime/components/Tabs.vue +36 -16
  132. package/dist/runtime/components/Tabs.vue.d.ts +8 -3
  133. package/dist/runtime/components/Textarea.vue +10 -7
  134. package/dist/runtime/components/Textarea.vue.d.ts +10 -9
  135. package/dist/runtime/components/Timeline.vue.d.ts +1 -1
  136. package/dist/runtime/components/Toast.vue +12 -4
  137. package/dist/runtime/components/Toast.vue.d.ts +14 -13
  138. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  139. package/dist/runtime/components/Tooltip.vue +2 -1
  140. package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
  141. package/dist/runtime/components/Tree.vue +3 -2
  142. package/dist/runtime/components/Tree.vue.d.ts +1 -1
  143. package/dist/runtime/components/User.vue.d.ts +1 -1
  144. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +1 -1
  145. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +1 -1
  146. package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +1 -1
  147. package/dist/runtime/components/color-mode/ColorModeSelect.vue +1 -1
  148. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  149. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  150. package/dist/runtime/components/content/ContentNavigation.vue.d.ts +1 -1
  151. package/dist/runtime/components/content/ContentSearch.vue +1 -2
  152. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +1 -1
  153. package/dist/runtime/components/content/ContentSurround.vue.d.ts +1 -1
  154. package/dist/runtime/components/content/ContentToc.vue.d.ts +1 -1
  155. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
  156. package/dist/runtime/components/prose/A.vue.d.ts +1 -1
  157. package/dist/runtime/components/prose/Accordion.vue.d.ts +1 -1
  158. package/dist/runtime/components/prose/AccordionItem.vue.d.ts +1 -1
  159. package/dist/runtime/components/prose/Badge.vue.d.ts +1 -1
  160. package/dist/runtime/components/prose/Blockquote.vue.d.ts +1 -1
  161. package/dist/runtime/components/prose/Callout.vue.d.ts +1 -1
  162. package/dist/runtime/components/prose/Card.vue.d.ts +1 -1
  163. package/dist/runtime/components/prose/CardGroup.vue.d.ts +1 -1
  164. package/dist/runtime/components/prose/Code.vue.d.ts +1 -1
  165. package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +1 -1
  166. package/dist/runtime/components/prose/CodeGroup.vue.d.ts +1 -1
  167. package/dist/runtime/components/prose/CodeIcon.vue.d.ts +1 -1
  168. package/dist/runtime/components/prose/CodePreview.vue.d.ts +1 -1
  169. package/dist/runtime/components/prose/CodeTree.vue.d.ts +1 -1
  170. package/dist/runtime/components/prose/Collapsible.vue.d.ts +1 -1
  171. package/dist/runtime/components/prose/Em.vue.d.ts +1 -1
  172. package/dist/runtime/components/prose/Field.vue.d.ts +1 -1
  173. package/dist/runtime/components/prose/FieldGroup.vue.d.ts +1 -1
  174. package/dist/runtime/components/prose/H1.vue.d.ts +1 -1
  175. package/dist/runtime/components/prose/H2.vue.d.ts +1 -1
  176. package/dist/runtime/components/prose/H3.vue.d.ts +1 -1
  177. package/dist/runtime/components/prose/H4.vue.d.ts +1 -1
  178. package/dist/runtime/components/prose/Hr.vue.d.ts +1 -1
  179. package/dist/runtime/components/prose/Icon.vue.d.ts +1 -1
  180. package/dist/runtime/components/prose/Img.vue.d.ts +1 -1
  181. package/dist/runtime/components/prose/Kbd.vue.d.ts +1 -1
  182. package/dist/runtime/components/prose/Li.vue.d.ts +1 -1
  183. package/dist/runtime/components/prose/Ol.vue.d.ts +1 -1
  184. package/dist/runtime/components/prose/P.vue.d.ts +1 -1
  185. package/dist/runtime/components/prose/Pre.vue.d.ts +1 -1
  186. package/dist/runtime/components/prose/Script.vue.d.ts +1 -1
  187. package/dist/runtime/components/prose/Steps.vue.d.ts +1 -1
  188. package/dist/runtime/components/prose/Strong.vue.d.ts +1 -1
  189. package/dist/runtime/components/prose/Table.vue.d.ts +1 -1
  190. package/dist/runtime/components/prose/Tabs.vue.d.ts +1 -1
  191. package/dist/runtime/components/prose/TabsItem.vue.d.ts +1 -1
  192. package/dist/runtime/components/prose/Tbody.vue.d.ts +1 -1
  193. package/dist/runtime/components/prose/Td.vue.d.ts +1 -1
  194. package/dist/runtime/components/prose/Th.vue.d.ts +1 -1
  195. package/dist/runtime/components/prose/Thead.vue.d.ts +1 -1
  196. package/dist/runtime/components/prose/Tr.vue.d.ts +1 -1
  197. package/dist/runtime/components/prose/Ul.vue.d.ts +1 -1
  198. package/dist/runtime/components/prose/callout/Caution.vue.d.ts +3 -3
  199. package/dist/runtime/components/prose/callout/Note.vue.d.ts +3 -3
  200. package/dist/runtime/components/prose/callout/Tip.vue.d.ts +3 -3
  201. package/dist/runtime/components/prose/callout/Warning.vue.d.ts +3 -3
  202. package/dist/runtime/composables/defineShortcuts.js +5 -3
  203. package/dist/runtime/composables/useFileUpload.d.ts +19 -0
  204. package/dist/runtime/composables/useFileUpload.js +63 -0
  205. package/dist/runtime/composables/useFormField.d.ts +1 -4
  206. package/dist/runtime/composables/useFormField.js +5 -2
  207. package/dist/runtime/composables/useKbd.d.ts +1 -1
  208. package/dist/runtime/composables/useLocale.js +2 -2
  209. package/dist/runtime/composables/useOverlay.d.ts +28 -1
  210. package/dist/runtime/composables/useOverlay.js +4 -4
  211. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  212. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
  213. package/dist/runtime/inertia/stubs.d.ts +1 -0
  214. package/dist/runtime/inertia/stubs.js +4 -2
  215. package/dist/runtime/locale/ar.js +2 -1
  216. package/dist/runtime/locale/az.js +1 -0
  217. package/dist/runtime/locale/bg.js +1 -0
  218. package/dist/runtime/locale/bn.js +1 -0
  219. package/dist/runtime/locale/ca.js +1 -0
  220. package/dist/runtime/locale/ckb.js +2 -1
  221. package/dist/runtime/locale/cs.js +1 -0
  222. package/dist/runtime/locale/da.js +1 -0
  223. package/dist/runtime/locale/de.js +1 -0
  224. package/dist/runtime/locale/el.js +1 -0
  225. package/dist/runtime/locale/en.js +1 -0
  226. package/dist/runtime/locale/es.js +1 -0
  227. package/dist/runtime/locale/et.js +1 -0
  228. package/dist/runtime/locale/fa_ir.js +1 -0
  229. package/dist/runtime/locale/fi.js +1 -0
  230. package/dist/runtime/locale/fr.js +1 -0
  231. package/dist/runtime/locale/he.js +1 -0
  232. package/dist/runtime/locale/hi.js +2 -1
  233. package/dist/runtime/locale/hu.js +1 -0
  234. package/dist/runtime/locale/hy.js +1 -0
  235. package/dist/runtime/locale/id.js +1 -0
  236. package/dist/runtime/locale/it.js +1 -0
  237. package/dist/runtime/locale/ja.js +1 -0
  238. package/dist/runtime/locale/kk.js +1 -0
  239. package/dist/runtime/locale/km.js +2 -1
  240. package/dist/runtime/locale/ko.js +1 -0
  241. package/dist/runtime/locale/ky.js +1 -0
  242. package/dist/runtime/locale/lb.js +1 -0
  243. package/dist/runtime/locale/lt.js +1 -0
  244. package/dist/runtime/locale/mn.js +1 -0
  245. package/dist/runtime/locale/ms.js +1 -0
  246. package/dist/runtime/locale/nb_no.js +1 -0
  247. package/dist/runtime/locale/nl.js +1 -0
  248. package/dist/runtime/locale/pl.js +1 -0
  249. package/dist/runtime/locale/pt.js +1 -0
  250. package/dist/runtime/locale/pt_br.js +1 -0
  251. package/dist/runtime/locale/ro.js +1 -0
  252. package/dist/runtime/locale/ru.js +1 -0
  253. package/dist/runtime/locale/sk.js +1 -0
  254. package/dist/runtime/locale/sl.js +1 -0
  255. package/dist/runtime/locale/sv.js +1 -0
  256. package/dist/runtime/locale/th.js +1 -0
  257. package/dist/runtime/locale/tj.js +1 -0
  258. package/dist/runtime/locale/tr.js +1 -0
  259. package/dist/runtime/locale/ug_cn.js +1 -0
  260. package/dist/runtime/locale/uk.js +1 -0
  261. package/dist/runtime/locale/ur.js +1 -0
  262. package/dist/runtime/locale/uz.js +1 -0
  263. package/dist/runtime/locale/vi.js +1 -0
  264. package/dist/runtime/locale/zh_cn.js +1 -0
  265. package/dist/runtime/locale/zh_tw.js +1 -0
  266. package/dist/runtime/types/index.d.ts +2 -0
  267. package/dist/runtime/types/index.js +2 -0
  268. package/dist/runtime/types/locale.d.ts +1 -0
  269. package/dist/runtime/utils/content.d.ts +18 -6
  270. package/dist/runtime/utils/content.js +51 -25
  271. package/dist/runtime/utils/index.d.ts +1 -0
  272. package/dist/runtime/utils/index.js +9 -0
  273. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  274. package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
  275. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +1 -1
  276. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +1 -1
  277. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
  278. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  279. package/dist/runtime/vue/stubs.d.ts +1 -0
  280. package/dist/runtime/vue/stubs.js +3 -1
  281. package/dist/shared/{ui.i6pGHFq6.mjs → ui.CgUuvRXi.mjs} +282 -29
  282. package/dist/unplugin.d.mts +2 -1
  283. package/dist/unplugin.mjs +6 -3
  284. package/dist/vite.mjs +1 -1
  285. package/package.json +57 -41
  286. package/dist/runtime/composables/useQuerySection.d.ts +0 -14
  287. package/dist/runtime/composables/useQuerySection.js +0 -44
@@ -52,7 +52,7 @@ export interface PageSectionSlots {
52
52
  links(props?: {}): any;
53
53
  features(props?: {}): any;
54
54
  }
55
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PageSectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSectionProps> & Readonly<{}>, {
55
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PageSectionProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSectionProps> & Readonly<{}>, {
56
56
  as: any;
57
57
  orientation: PageSection["variants"]["orientation"];
58
58
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PageSectionSlots>;
@@ -95,7 +95,7 @@ export interface PaginationSlots {
95
95
  index: number;
96
96
  }): any;
97
97
  }
98
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PaginationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
98
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PaginationProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
99
99
  "update:page": (value: number) => any;
100
100
  }, string, import("vue").PublicProps, Readonly<PaginationProps> & Readonly<{
101
101
  "onUpdate:page"?: ((value: number) => any) | undefined;
@@ -56,5 +56,5 @@ declare const _default: <T extends PinInputType = "text">(__VLS_props: NonNullab
56
56
  };
57
57
  export default _default;
58
58
  type __VLS_PrettifyLocal<T> = {
59
- [K in keyof T]: T[K];
59
+ [K in keyof T as K]: T[K];
60
60
  } & {};
@@ -16,6 +16,7 @@ const props = defineProps({
16
16
  content: { type: Object, required: false },
17
17
  arrow: { type: [Boolean, Object], required: false },
18
18
  portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
19
+ reference: { type: null, required: false },
19
20
  dismissible: { type: Boolean, required: false, default: true },
20
21
  class: { type: null, required: false },
21
22
  ui: { type: null, required: false },
@@ -54,7 +55,7 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
54
55
 
55
56
  <template>
56
57
  <Component.Root v-slot="{ open }" v-bind="rootProps">
57
- <Component.Trigger v-if="!!slots.default" as-child :class="props.class">
58
+ <Component.Trigger v-if="!!slots.default || !!reference" as-child :reference="reference" :class="props.class">
58
59
  <slot :open="open" />
59
60
  </Component.Trigger>
60
61
 
@@ -1,5 +1,5 @@
1
1
  import { Popover } from 'reka-ui/namespaced';
2
- import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui';
2
+ import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps, HoverCardTriggerProps } from 'reka-ui';
3
3
  import type { AppConfig } from '@nuxt/schema';
4
4
  import theme from '#build/ui/popover';
5
5
  import type { EmitsToProps, ComponentConfig } from '../types/utils';
@@ -25,6 +25,12 @@ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps,
25
25
  * @defaultValue true
26
26
  */
27
27
  portal?: boolean | string | HTMLElement;
28
+ /**
29
+ * The reference (or anchor) element that is being referred to for positioning.
30
+ *
31
+ * If not provided will use the current component as anchor.
32
+ */
33
+ reference?: HoverCardTriggerProps['reference'];
28
34
  /**
29
35
  * When `false`, the popover will not close when clicking outside or pressing escape.
30
36
  * @defaultValue true
@@ -43,7 +49,7 @@ export interface PopoverSlots {
43
49
  content(props?: {}): any;
44
50
  anchor(props?: {}): any;
45
51
  }
46
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
52
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
53
  "update:open": (value: boolean) => any;
48
54
  "close:prevent": () => any;
49
55
  }, string, import("vue").PublicProps, Readonly<PopoverProps> & Readonly<{
@@ -98,7 +98,7 @@ export interface PricingPlanSlots {
98
98
  body(props?: {}): any;
99
99
  footer(props?: {}): any;
100
100
  }
101
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingPlanProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingPlanProps> & Readonly<{}>, {
101
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingPlanProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingPlanProps> & Readonly<{}>, {
102
102
  orientation: PricingPlan["variants"]["orientation"];
103
103
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingPlanSlots>;
104
104
  export default _default;
@@ -30,7 +30,7 @@ export interface PricingPlansProps {
30
30
  export interface PricingPlansSlots {
31
31
  default(props?: {}): any;
32
32
  }
33
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingPlansProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingPlansProps> & Readonly<{}>, {
33
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingPlansProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingPlansProps> & Readonly<{}>, {
34
34
  orientation: PricingPlans["variants"]["orientation"];
35
35
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingPlansSlots>;
36
36
  export default _default;
@@ -197,7 +197,13 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
197
197
  <tr v-for="(feature, featureIndex) in section.features" :key="`${sectionIndex}-feature-${featureIndex}`">
198
198
  <th scope="row" :class="ui.th({ class: props.ui?.th })">
199
199
  <div :class="ui.featureTitle({ class: props.ui?.featureTitle })">
200
- <slot :name="`feature-${formatSlotName(feature)}-title`" :feature="feature" :section="section">
200
+ <!-- Fixed: Added tier parameter to match FeatureDynamicSlots type -->
201
+ <slot
202
+ :name="`feature-${formatSlotName(feature)}-title`"
203
+ :feature="feature"
204
+ :tier="tiers[0]"
205
+ :section="section"
206
+ >
201
207
  <slot name="feature-title" :feature="feature" :section="section">
202
208
  {{ feature.title }}
203
209
  </slot>
@@ -255,7 +261,13 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
255
261
  :class="ui.feature({ class: props.ui?.feature })"
256
262
  >
257
263
  <div :class="ui.featureTitle({ class: props.ui?.featureTitle })">
258
- <slot :name="`feature-${formatSlotName(feature)}-title`" :feature="feature" :section="section">
264
+ <!-- Fixed: Added tier parameter to match FeatureDynamicSlots type -->
265
+ <slot
266
+ :name="`feature-${formatSlotName(feature)}-title`"
267
+ :feature="feature"
268
+ :tier="tier"
269
+ :section="section"
270
+ >
259
271
  <slot name="feature-title" :feature="feature" :section="section">
260
272
  {{ feature.title }}
261
273
  </slot>
@@ -89,7 +89,7 @@ export type PricingTableSlots<T extends PricingTableTier = PricingTableTier> = {
89
89
  section: PricingTableSection<T>;
90
90
  }) => any;
91
91
  } & DynamicSlots<T, 'title' | 'description' | 'badge' | 'button' | 'billing' | 'discount' | 'price'> & FeatureDynamicSlots<PricingTableSectionFeature<T>, 'title' | 'value'> & SectionDynamicSlots<PricingTableSection<T>, 'title'>;
92
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingTableProps<PricingTableTier>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingTableProps<PricingTableTier>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingTableSlots<PricingTableTier>>;
92
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingTableProps<PricingTableTier>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingTableProps<PricingTableTier>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingTableSlots<PricingTableTier>>;
93
93
  export default _default;
94
94
  type __VLS_WithSlots<T, S> = T & {
95
95
  new (): {
@@ -47,7 +47,7 @@ export type ProgressSlots = {
47
47
  step: number;
48
48
  }) => any;
49
49
  };
50
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
50
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
51
51
  "update:modelValue": (value: string[] | undefined) => any;
52
52
  "update:max": (value: number) => any;
53
53
  }, string, import("vue").PublicProps, Readonly<ProgressProps> & Readonly<{
@@ -54,7 +54,7 @@ function normalizeItem(item) {
54
54
  label: void 0
55
55
  };
56
56
  }
57
- if (typeof item === "string" || typeof item === "number") {
57
+ if (typeof item === "string" || typeof item === "number" || typeof item === "bigint") {
58
58
  return {
59
59
  id: `${id}:${item}`,
60
60
  value: String(item),
@@ -64,10 +64,11 @@ export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> exte
64
64
  export type RadioGroupEmits = RadioGroupRootEmits & {
65
65
  change: [payload: Event];
66
66
  };
67
+ type NormalizeItem<T extends RadioGroupItem> = Exclude<T & {
68
+ id: string;
69
+ }, RadioGroupValue>;
67
70
  type SlotProps<T extends RadioGroupItem> = (props: {
68
- item: T & {
69
- id: string;
70
- };
71
+ item: NormalizeItem<T>;
71
72
  modelValue?: RadioGroupValue;
72
73
  }) => any;
73
74
  export interface RadioGroupSlots<T extends RadioGroupItem = RadioGroupItem> {
@@ -89,5 +90,5 @@ declare const _default: <T extends RadioGroupItem>(__VLS_props: NonNullable<Awai
89
90
  };
90
91
  export default _default;
91
92
  type __VLS_PrettifyLocal<T> = {
92
- [K in keyof T]: T[K];
93
+ [K in keyof T as K]: T[K];
93
94
  } & {};
@@ -0,0 +1,62 @@
1
+ <script>
2
+ import theme from "#build/ui/scroll-to-section";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { Primitive } from "reka-ui";
7
+ import { computed, onMounted, watch } from "vue";
8
+ import { useAppConfig, useRoute, useRouter } from "#imports";
9
+ import { tv } from "../utils/tv";
10
+ const props = defineProps({
11
+ as: { type: null, required: false, default: "div" },
12
+ class: { type: null, required: false },
13
+ offset: { type: Number, required: false, default: 0 },
14
+ autoScroll: { type: Boolean, required: false, default: true },
15
+ clearQuery: { type: Boolean, required: false, default: false },
16
+ param: { type: String, required: false, default: "section" }
17
+ });
18
+ const route = useRoute();
19
+ const router = useRouter();
20
+ const appConfig = useAppConfig();
21
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.scrollToSection || {} }));
22
+ const scrollToSection = (id) => {
23
+ const el = document.getElementById(id);
24
+ if (!el) return;
25
+ const top = el.getBoundingClientRect().top + window.scrollY - props.offset;
26
+ window.scrollTo({ top, behavior: "smooth" });
27
+ };
28
+ const maybeScroll = () => {
29
+ const sectionId = route.query[props.param];
30
+ if (!sectionId) return;
31
+ scrollToSection(sectionId);
32
+ if (props.clearQuery) {
33
+ const { [props.param]: _, ...rest } = route.query;
34
+ router.replace({ query: rest });
35
+ }
36
+ };
37
+ onMounted(() => {
38
+ if (props.autoScroll) maybeScroll();
39
+ });
40
+ watch(() => route.query[props.param], () => {
41
+ if (props.autoScroll) maybeScroll();
42
+ });
43
+ const scrollToQuery = (id, replace = true) => {
44
+ router[replace ? "replace" : "push"]({
45
+ query: {
46
+ ...route.query,
47
+ [props.param]: id
48
+ }
49
+ });
50
+ };
51
+ </script>
52
+
53
+ <template>
54
+ <Primitive :as="as" :class="ui({ class: props.class })">
55
+ <slot />
56
+
57
+ <!-- Named slot for internal scroll links -->
58
+ <slot name="link" :scroll-to-query="scrollToQuery" :param="props.param">
59
+ <!-- Default behavior: render nothing unless used -->
60
+ </slot>
61
+ </Primitive>
62
+ </template>
@@ -0,0 +1,36 @@
1
+ export interface UScrollToSectionProps {
2
+ as?: any;
3
+ class?: any;
4
+ offset?: number;
5
+ autoScroll?: boolean;
6
+ clearQuery?: boolean;
7
+ param?: string;
8
+ }
9
+ export interface UScrollToSectionSlots {
10
+ default(props?: {}): any;
11
+ link(props: {
12
+ to: string;
13
+ replace: boolean;
14
+ param: string;
15
+ }): any;
16
+ }
17
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<UScrollToSectionProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<UScrollToSectionProps> & Readonly<{}>, {
18
+ as: any;
19
+ autoScroll: boolean;
20
+ offset: number;
21
+ clearQuery: boolean;
22
+ param: string;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
24
+ default?: (props: {}) => any;
25
+ } & {
26
+ link?: (props: {
27
+ scrollToQuery: any;
28
+ param: string;
29
+ }) => any;
30
+ }>;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -249,5 +249,5 @@ declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItem
249
249
  };
250
250
  export default _default;
251
251
  type __VLS_PrettifyLocal<T> = {
252
- [K in keyof T]: T[K];
252
+ [K in keyof T as K]: T[K];
253
253
  } & {};
@@ -93,10 +93,7 @@ function displayValue(value) {
93
93
  const values = value.map((v) => displayValue(v)).filter(Boolean);
94
94
  return values?.length ? values.join(", ") : void 0;
95
95
  }
96
- if (!props.valueKey) {
97
- return value && (typeof value === "object" ? get(value, props.labelKey) : value);
98
- }
99
- const item = items.value.find((item2) => compare(typeof item2 === "object" ? get(item2, props.valueKey) : item2, value));
96
+ const item = items.value.find((item2) => compare(typeof item2 === "object" && props.valueKey ? get(item2, props.valueKey) : item2, value));
100
97
  return item && (typeof item === "object" ? get(item, props.labelKey) : item);
101
98
  }
102
99
  const groups = computed(
@@ -109,13 +106,19 @@ const filteredGroups = computed(() => {
109
106
  }
110
107
  const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey];
111
108
  return groups.value.map((items2) => items2.filter((item) => {
112
- if (typeof item !== "object" || item === null) {
109
+ if (item === void 0 || item === null) {
110
+ return false;
111
+ }
112
+ if (typeof item !== "object") {
113
113
  return contains(String(item), searchTerm.value);
114
114
  }
115
115
  if (item.type && ["label", "separator"].includes(item.type)) {
116
116
  return true;
117
117
  }
118
- return fields.some((field) => contains(get(item, field), searchTerm.value));
118
+ return fields.some((field) => {
119
+ const value = get(item, field);
120
+ return value !== void 0 && value !== null && contains(String(value), searchTerm.value);
121
+ });
119
122
  })).filter((group) => group.filter(
120
123
  (item) => !isSelectItem(item) || (!item.type || !["label", "separator"].includes(item.type))
121
124
  ).length > 0);
@@ -175,11 +175,11 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
175
175
  readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
176
176
  readonly onCreate?: ((item: string) => any) | undefined;
177
177
  readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
178
+ readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
178
179
  readonly onHighlight?: ((payload: {
179
180
  ref: HTMLElement;
180
181
  value: GetModelValue<T, VK, M>;
181
182
  } | undefined) => any) | undefined;
182
- readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
183
183
  readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
184
184
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate"> & (SelectMenuProps<T, VK, M> & {
185
185
  searchTerm?: string;
@@ -289,14 +289,14 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
289
289
  }>): void;
290
290
  attrs: any;
291
291
  slots: SelectMenuSlots<T, VK, M, NestedItem<T>>;
292
- emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "highlight", payload: {
292
+ emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
293
293
  ref: HTMLElement;
294
294
  value: GetModelValue<T, VK, M>;
295
- } | undefined) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
295
+ } | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
296
296
  }>) => import("vue").VNode & {
297
297
  __ctx?: Awaited<typeof __VLS_setup>;
298
298
  };
299
299
  export default _default;
300
300
  type __VLS_PrettifyLocal<T> = {
301
- [K in keyof T]: T[K];
301
+ [K in keyof T as K]: T[K];
302
302
  } & {};
@@ -43,7 +43,7 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
43
43
  export interface SeparatorSlots {
44
44
  default(props?: {}): any;
45
45
  }
46
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
46
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
47
47
  orientation: "horizontal" | "vertical";
48
48
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
49
49
  export default _default;
@@ -6,7 +6,7 @@ export interface SkeletonProps {
6
6
  as?: any;
7
7
  class?: any;
8
8
  }
9
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
9
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
10
10
  default?: (props: {}) => any;
11
11
  }>;
12
12
  export default _default;
@@ -80,7 +80,7 @@ export interface SlideoverSlots {
80
80
  close: () => void;
81
81
  }): any;
82
82
  }
83
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
83
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
84
84
  "update:open": (value: boolean) => any;
85
85
  "after:leave": () => any;
86
86
  "after:enter": () => any;
@@ -93,9 +93,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverP
93
93
  }>, {
94
94
  close: boolean | Partial<ButtonProps>;
95
95
  modal: boolean;
96
- transition: boolean;
97
96
  portal: boolean | string | HTMLElement;
98
97
  overlay: boolean;
98
+ transition: boolean;
99
99
  side: Slideover["variants"]["side"];
100
100
  dismissible: boolean;
101
101
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
@@ -35,24 +35,24 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
35
35
  ui?: Slider['slots'];
36
36
  }
37
37
  export interface SliderEmits<T extends number | number[] = number | number[]> {
38
- (e: 'update:modelValue', payload: T): void;
39
- (e: 'change', payload: Event): void;
38
+ 'update:modelValue': [payload: T];
39
+ 'change': [payload: Event];
40
40
  }
41
41
  declare const _default: <T extends number | number[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
42
42
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
43
43
  readonly onChange?: ((payload: Event) => any) | undefined;
44
- readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
44
+ readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
45
45
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (SliderProps & {
46
46
  modelValue?: T;
47
47
  }) & Partial<{}>> & import("vue").PublicProps;
48
48
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
49
49
  attrs: any;
50
50
  slots: {};
51
- emit: SliderEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
51
+ emit: (((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", payload: T) => void)) & ((evt: "update:modelValue", value: T | undefined) => void);
52
52
  }>) => import("vue").VNode & {
53
53
  __ctx?: Awaited<typeof __VLS_setup>;
54
54
  };
55
55
  export default _default;
56
56
  type __VLS_PrettifyLocal<T> = {
57
- [K in keyof T]: T[K];
57
+ [K in keyof T as K]: T[K];
58
58
  } & {};
@@ -81,5 +81,5 @@ declare const _default: <T extends StepperItem>(__VLS_props: NonNullable<Awaited
81
81
  };
82
82
  export default _default;
83
83
  type __VLS_PrettifyLocal<T> = {
84
- [K in keyof T]: T[K];
84
+ [K in keyof T as K]: T[K];
85
85
  } & {};
@@ -53,7 +53,7 @@ export interface SwitchSlots {
53
53
  }
54
54
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SwitchProps & {
55
55
  modelValue?: boolean;
56
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
56
+ }, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
57
  change: (payload: Event) => any;
58
58
  "update:modelValue": (value: boolean) => any;
59
59
  }, string, import("vue").PublicProps, Readonly<SwitchProps & {
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  caption: { type: String, required: false },
19
19
  meta: { type: Object, required: false },
20
20
  empty: { type: String, required: false },
21
- sticky: { type: Boolean, required: false },
21
+ sticky: { type: [Boolean, String], required: false },
22
22
  loading: { type: Boolean, required: false },
23
23
  loadingColor: { type: null, required: false },
24
24
  loadingAnimation: { type: null, required: false },
@@ -38,6 +38,8 @@ const props = defineProps({
38
38
  paginationOptions: { type: Object, required: false },
39
39
  facetedOptions: { type: Object, required: false },
40
40
  onSelect: { type: Function, required: false },
41
+ onHover: { type: Function, required: false },
42
+ onContextmenu: { type: [Function, Array], required: false },
41
43
  class: { type: null, required: false },
42
44
  ui: { type: null, required: false },
43
45
  state: { type: Object, required: false },
@@ -69,6 +71,20 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.table || {} }
69
71
  loadingColor: props.loadingColor,
70
72
  loadingAnimation: props.loadingAnimation
71
73
  }));
74
+ const hasFooter = computed(() => {
75
+ function hasFooterRecursive(columns2) {
76
+ for (const column of columns2) {
77
+ if ("footer" in column) {
78
+ return true;
79
+ }
80
+ if ("columns" in column && hasFooterRecursive(column.columns)) {
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+ return hasFooterRecursive(columns.value);
87
+ });
72
88
  const globalFilterState = defineModel("globalFilter", { type: String, ...{ default: void 0 } });
73
89
  const columnFiltersState = defineModel("columnFilters", { type: Array, ...{ default: [] } });
74
90
  const columnOrderState = defineModel("columnOrder", { type: Array, ...{ default: [] } });
@@ -86,7 +102,9 @@ const tableRef = ref(null);
86
102
  const tableApi = useVueTable({
87
103
  ...reactiveOmit(props, "as", "data", "columns", "caption", "sticky", "loading", "loadingColor", "loadingAnimation", "class", "ui"),
88
104
  data,
89
- columns: columns.value,
105
+ get columns() {
106
+ return columns.value;
107
+ },
90
108
  meta: meta.value,
91
109
  getCoreRowModel: getCoreRowModel(),
92
110
  ...props.globalFilterOptions || {},
@@ -162,7 +180,7 @@ const tableApi = useVueTable({
162
180
  function valueUpdater(updaterOrValue, ref2) {
163
181
  ref2.value = typeof updaterOrValue === "function" ? updaterOrValue(ref2.value) : updaterOrValue;
164
182
  }
165
- function handleRowSelect(row, e) {
183
+ function onRowSelect(e, row) {
166
184
  if (!props.onSelect) {
167
185
  return;
168
186
  }
@@ -175,6 +193,28 @@ function handleRowSelect(row, e) {
175
193
  e.stopPropagation();
176
194
  props.onSelect(row, e);
177
195
  }
196
+ function onRowHover(e, row) {
197
+ if (!props.onHover) {
198
+ return;
199
+ }
200
+ props.onHover(e, row);
201
+ }
202
+ function onRowContextmenu(e, row) {
203
+ if (!props.onContextmenu) {
204
+ return;
205
+ }
206
+ if (Array.isArray(props.onContextmenu)) {
207
+ props.onContextmenu.forEach((fn) => fn(e, row));
208
+ } else {
209
+ props.onContextmenu(e, row);
210
+ }
211
+ }
212
+ function resolveValue(prop, arg) {
213
+ if (typeof prop === "function") {
214
+ return prop(arg);
215
+ }
216
+ return prop;
217
+ }
178
218
  watch(
179
219
  () => props.data,
180
220
  () => {
@@ -203,11 +243,13 @@ defineExpose({
203
243
  v-for="header in headerGroup.headers"
204
244
  :key="header.id"
205
245
  :data-pinned="header.column.getIsPinned()"
246
+ :scope="header.colSpan > 1 ? 'colgroup' : 'col'"
206
247
  :colspan="header.colSpan > 1 ? header.colSpan : void 0"
248
+ :rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
207
249
  :class="ui.th({
208
250
  class: [
209
251
  props.ui?.th,
210
- typeof header.column.columnDef.meta?.class?.th === 'function' ? header.column.columnDef.meta.class.th(header) : header.column.columnDef.meta?.class?.th
252
+ resolveValue(header.column.columnDef.meta?.class?.th, header)
211
253
  ],
212
254
  pinned: !!header.column.getIsPinned()
213
255
  })"
@@ -228,29 +270,36 @@ defineExpose({
228
270
  <template v-for="row in tableApi.getRowModel().rows" :key="row.id">
229
271
  <tr
230
272
  :data-selected="row.getIsSelected()"
231
- :data-selectable="!!props.onSelect"
273
+ :data-selectable="!!props.onSelect || !!props.onHover || !!props.onContextmenu"
232
274
  :data-expanded="row.getIsExpanded()"
233
275
  :role="props.onSelect ? 'button' : void 0"
234
276
  :tabindex="props.onSelect ? 0 : void 0"
235
277
  :class="ui.tr({
236
278
  class: [
237
279
  props.ui?.tr,
238
- typeof tableApi.options.meta?.class?.tr === 'function' ? tableApi.options.meta.class.tr(row) : tableApi.options.meta?.class?.tr
280
+ resolveValue(tableApi.options.meta?.class?.tr, row)
239
281
  ]
240
282
  })"
241
- @click="handleRowSelect(row, $event)"
283
+ :style="resolveValue(tableApi.options.meta?.style?.tr, row)"
284
+ @click="onRowSelect($event, row)"
285
+ @pointerenter="onRowHover($event, row)"
286
+ @pointerleave="onRowHover($event, null)"
287
+ @contextmenu="onRowContextmenu($event, row)"
242
288
  >
243
289
  <td
244
290
  v-for="cell in row.getVisibleCells()"
245
291
  :key="cell.id"
246
292
  :data-pinned="cell.column.getIsPinned()"
293
+ :colspan="resolveValue(cell.column.columnDef.meta?.colspan?.td, cell)"
294
+ :rowspan="resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell)"
247
295
  :class="ui.td({
248
296
  class: [
249
297
  props.ui?.td,
250
- typeof cell.column.columnDef.meta?.class?.td === 'function' ? cell.column.columnDef.meta.class.td(cell) : cell.column.columnDef.meta?.class?.td
298
+ resolveValue(cell.column.columnDef.meta?.class?.td, cell)
251
299
  ],
252
300
  pinned: !!cell.column.getIsPinned()
253
301
  })"
302
+ :style="resolveValue(cell.column.columnDef.meta?.style?.td, cell)"
254
303
  >
255
304
  <slot :name="`${cell.column.id}-cell`" v-bind="cell.getContext()">
256
305
  <FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
@@ -281,6 +330,32 @@ defineExpose({
281
330
 
282
331
  <slot name="body-bottom" />
283
332
  </tbody>
333
+
334
+ <tfoot v-if="hasFooter" :class="ui.tfoot({ class: [props.ui?.tfoot] })">
335
+ <tr :class="ui.separator({ class: [props.ui?.separator] })" />
336
+
337
+ <tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" :class="ui.tr({ class: [props.ui?.tr] })">
338
+ <th
339
+ v-for="header in footerGroup.headers"
340
+ :key="header.id"
341
+ :data-pinned="header.column.getIsPinned()"
342
+ :colspan="header.colSpan > 1 ? header.colSpan : void 0"
343
+ :rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
344
+ :class="ui.th({
345
+ class: [
346
+ props.ui?.th,
347
+ resolveValue(header.column.columnDef.meta?.class?.th, header)
348
+ ],
349
+ pinned: !!header.column.getIsPinned()
350
+ })"
351
+ :style="resolveValue(header.column.columnDef.meta?.style?.th, header)"
352
+ >
353
+ <slot :name="`${header.id}-footer`" v-bind="header.getContext()">
354
+ <FlexRender v-if="!header.isPlaceholder" :render="header.column.columnDef.footer" :props="header.getContext()" />
355
+ </slot>
356
+ </th>
357
+ </tr>
358
+ </tfoot>
284
359
  </table>
285
360
  </Primitive>
286
361
  </template>