From 369e0b195206277dbd8b39514f1bcb4a833512f3 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 28 Jun 2024 11:45:14 +0200 Subject: [PATCH] fix: define empty props in slots for `nuxt-component-meta` parsing --- cli/templates.mjs | 2 +- src/runtime/components/Alert.vue | 8 ++++---- src/runtime/components/AvatarGroup.vue | 2 +- src/runtime/components/Badge.vue | 2 +- src/runtime/components/Breadcrumb.vue | 2 +- src/runtime/components/Button.vue | 6 +++--- src/runtime/components/ButtonGroup.vue | 2 +- src/runtime/components/Card.vue | 6 +++--- src/runtime/components/Chip.vue | 4 ++-- src/runtime/components/Collapsible.vue | 2 +- src/runtime/components/CommandPalette.vue | 2 +- src/runtime/components/Container.vue | 2 +- src/runtime/components/ContextMenu.vue | 2 +- src/runtime/components/Drawer.vue | 16 ++++++++-------- src/runtime/components/DropdownMenuContent.vue | 2 +- src/runtime/components/Form.vue | 2 +- src/runtime/components/Input.vue | 6 +++--- src/runtime/components/Kbd.vue | 2 +- src/runtime/components/Modal.vue | 12 ++++++------ src/runtime/components/Pagination.vue | 10 +++++----- src/runtime/components/Popover.vue | 2 +- src/runtime/components/RadioGroup.vue | 2 +- src/runtime/components/Separator.vue | 2 +- src/runtime/components/Slideover.vue | 12 ++++++------ src/runtime/components/Textarea.vue | 2 +- src/runtime/components/Toast.vue | 8 ++++---- src/runtime/components/Toaster.vue | 2 +- src/runtime/components/Tooltip.vue | 2 +- 28 files changed, 62 insertions(+), 62 deletions(-) diff --git a/cli/templates.mjs b/cli/templates.mjs index 548f0846..41236638 100644 --- a/cli/templates.mjs +++ b/cli/templates.mjs @@ -46,7 +46,7 @@ export interface ${upperName}Props extends Omit { } export interface ${upperName}Slots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Alert.vue b/src/runtime/components/Alert.vue index 2886a8d6..6f188887 100644 --- a/src/runtime/components/Alert.vue +++ b/src/runtime/components/Alert.vue @@ -46,10 +46,10 @@ export interface AlertEmits { } export interface AlertSlots { - leading(): any - title(): any - description(): any - actions(): any + leading(props?: any): any + title(props?: any): any + description(props?: any): any + actions(props?: any): any close(props: { class: string }): any } diff --git a/src/runtime/components/AvatarGroup.vue b/src/runtime/components/AvatarGroup.vue index fbb5829d..6f5acbd6 100644 --- a/src/runtime/components/AvatarGroup.vue +++ b/src/runtime/components/AvatarGroup.vue @@ -22,7 +22,7 @@ export interface AvatarGroupProps extends Omit { } export interface AvatarGroupSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Badge.vue b/src/runtime/components/Badge.vue index 7344cd94..f039de28 100644 --- a/src/runtime/components/Badge.vue +++ b/src/runtime/components/Badge.vue @@ -20,7 +20,7 @@ export interface BadgeProps extends Omit { } export interface BadgeSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Breadcrumb.vue b/src/runtime/components/Breadcrumb.vue index a80c1a4f..ba6064f0 100644 --- a/src/runtime/components/Breadcrumb.vue +++ b/src/runtime/components/Breadcrumb.vue @@ -36,7 +36,7 @@ export type BreadcrumbSlots = { 'item-leading': SlotProps 'item-label': SlotProps 'item-trailing': SlotProps - 'separator'(): any + 'separator'(props?: any): any } & DynamicSlots> diff --git a/src/runtime/components/Button.vue b/src/runtime/components/Button.vue index 60a58783..689e2235 100644 --- a/src/runtime/components/Button.vue +++ b/src/runtime/components/Button.vue @@ -26,9 +26,9 @@ export interface ButtonProps extends UseComponentIconsProps, Omit diff --git a/src/runtime/components/ButtonGroup.vue b/src/runtime/components/ButtonGroup.vue index 52657b91..d47200b3 100644 --- a/src/runtime/components/ButtonGroup.vue +++ b/src/runtime/components/ButtonGroup.vue @@ -23,7 +23,7 @@ export interface ButtonGroupProps extends Omit { } export interface ButtonGroupSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Card.vue b/src/runtime/components/Card.vue index 3588bb76..c8c1c58b 100644 --- a/src/runtime/components/Card.vue +++ b/src/runtime/components/Card.vue @@ -15,9 +15,9 @@ export interface CardProps extends Omit { } export interface CardSlots { - header(): any - default(): any - footer(): any + header(props?: any): any + default(props?: any): any + footer(props?: any): any } diff --git a/src/runtime/components/Chip.vue b/src/runtime/components/Chip.vue index 5be7b2ca..9f0063a9 100644 --- a/src/runtime/components/Chip.vue +++ b/src/runtime/components/Chip.vue @@ -26,8 +26,8 @@ export interface ChipProps extends Omit { } export interface ChipSlots { - default(): any - content(): any + default(props?: any): any + content(props?: any): any } diff --git a/src/runtime/components/Collapsible.vue b/src/runtime/components/Collapsible.vue index ca872954..36badf7c 100644 --- a/src/runtime/components/Collapsible.vue +++ b/src/runtime/components/Collapsible.vue @@ -18,7 +18,7 @@ export interface CollapsibleEmits extends CollapsibleRootEmits {} export interface CollapsibleSlots { default(props: { open: boolean }): any - content(): any + content(props?: any): any } diff --git a/src/runtime/components/CommandPalette.vue b/src/runtime/components/CommandPalette.vue index a25a412b..93e930d1 100644 --- a/src/runtime/components/CommandPalette.vue +++ b/src/runtime/components/CommandPalette.vue @@ -78,7 +78,7 @@ type SlotProps = (props: { item: T, index: number }) => any export type CommandPaletteSlots = { 'empty'(props: { searchTerm?: string }): any - 'close'(): any + 'close'(props?: any): any 'item': SlotProps 'item-leading': SlotProps 'item-label': SlotProps diff --git a/src/runtime/components/Container.vue b/src/runtime/components/Container.vue index ff28a3f0..ff39c3fc 100644 --- a/src/runtime/components/Container.vue +++ b/src/runtime/components/Container.vue @@ -14,7 +14,7 @@ export interface ContainerProps extends Omit { } export interface ContainerSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/ContextMenu.vue b/src/runtime/components/ContextMenu.vue index 152e3d68..dc31160f 100644 --- a/src/runtime/components/ContextMenu.vue +++ b/src/runtime/components/ContextMenu.vue @@ -47,7 +47,7 @@ export interface ContextMenuEmits extends ContextMenuRootEmits {} type SlotProps = (props: { item: T, active?: boolean, index: number }) => any export type ContextMenuSlots = { - 'default'(): any + 'default'(props?: any): any 'item': SlotProps 'item-leading': SlotProps 'item-label': SlotProps diff --git a/src/runtime/components/Drawer.vue b/src/runtime/components/Drawer.vue index 5bcdc1bb..27840c6a 100644 --- a/src/runtime/components/Drawer.vue +++ b/src/runtime/components/Drawer.vue @@ -28,14 +28,14 @@ export interface DrawerProps extends Omit { export interface DrawerEmits extends DrawerRootEmits {} export interface DrawerSlots { - default(): any - handle(): any - content(): any - header(): any - title(): any - description(): any - body(): any - footer(): any + default(props?: any): any + handle(props?: any): any + content(props?: any): any + header(props?: any): any + title(props?: any): any + description(props?: any): any + body(props?: any): any + footer(props?: any): any } diff --git a/src/runtime/components/DropdownMenuContent.vue b/src/runtime/components/DropdownMenuContent.vue index cdf60ebc..bfb71dc9 100644 --- a/src/runtime/components/DropdownMenuContent.vue +++ b/src/runtime/components/DropdownMenuContent.vue @@ -17,7 +17,7 @@ interface DropdownMenuContentProps extends Omit = Omit, 'default'> & { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Form.vue b/src/runtime/components/Form.vue index d4e5297e..8b9799f9 100644 --- a/src/runtime/components/Form.vue +++ b/src/runtime/components/Form.vue @@ -29,7 +29,7 @@ export interface FormEmits { } export interface FormSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Input.vue b/src/runtime/components/Input.vue index 4c971577..87aaa985 100644 --- a/src/runtime/components/Input.vue +++ b/src/runtime/components/Input.vue @@ -35,9 +35,9 @@ export interface InputEmits { } export interface InputSlots { - leading(): any - default(): any - trailing(): any + leading(props?: any): any + default(props?: any): any + trailing(props?: any): any } diff --git a/src/runtime/components/Kbd.vue b/src/runtime/components/Kbd.vue index 8a94a5d1..a4b35297 100644 --- a/src/runtime/components/Kbd.vue +++ b/src/runtime/components/Kbd.vue @@ -20,7 +20,7 @@ export interface KbdProps extends Omit { } export interface KbdSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Modal.vue b/src/runtime/components/Modal.vue index d06c5dae..c773c26c 100644 --- a/src/runtime/components/Modal.vue +++ b/src/runtime/components/Modal.vue @@ -43,13 +43,13 @@ export interface ModalEmits extends DialogRootEmits {} export interface ModalSlots { default(props: { open: boolean }): any - content(): any - header(): any - title(): any - description(): any + content(props?: any): any + header(props?: any): any + title(props?: any): any + description(props?: any): any close(props: { class: string }): any - body(): any - footer(): any + body(props?: any): any + footer(props?: any): any } diff --git a/src/runtime/components/Pagination.vue b/src/runtime/components/Pagination.vue index bdfa71b4..5c1161fb 100644 --- a/src/runtime/components/Pagination.vue +++ b/src/runtime/components/Pagination.vue @@ -75,11 +75,11 @@ export interface PaginationProps extends Omit { export interface PaginationEmits extends PaginationRootEmits {} export interface PaginationSlots { - first(): any - prev(): any - next(): any - last(): any - ellipsis(): any + first(props?: any): any + prev(props?: any): any + next(props?: any): any + last(props?: any): any + ellipsis(props?: any): any item(props: { page: number pageCount: number diff --git a/src/runtime/components/Popover.vue b/src/runtime/components/Popover.vue index f62862d5..10e326b8 100644 --- a/src/runtime/components/Popover.vue +++ b/src/runtime/components/Popover.vue @@ -38,7 +38,7 @@ export interface PopoverEmits extends PopoverRootEmits {} export interface PopoverSlots { default(props: { open: boolean }): any - content(): any + content(props?: any): any } diff --git a/src/runtime/components/RadioGroup.vue b/src/runtime/components/RadioGroup.vue index 6b394078..310ddf4a 100644 --- a/src/runtime/components/RadioGroup.vue +++ b/src/runtime/components/RadioGroup.vue @@ -36,7 +36,7 @@ export interface RadioGroupEmits extends RadioGroupRootEmits {} type SlotProps = (props: { item: T, modelValue?: string }) => any export interface RadioGroupSlots { - legend(): any + legend(props?: any): any label: SlotProps description: SlotProps } diff --git a/src/runtime/components/Separator.vue b/src/runtime/components/Separator.vue index d0c38c09..6eb48f08 100644 --- a/src/runtime/components/Separator.vue +++ b/src/runtime/components/Separator.vue @@ -32,7 +32,7 @@ export interface SeparatorProps extends Omit<_SeparatorProps, 'asChild' | 'orien } export interface SeparatorSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Slideover.vue b/src/runtime/components/Slideover.vue index f47a6bc1..e22a83bb 100644 --- a/src/runtime/components/Slideover.vue +++ b/src/runtime/components/Slideover.vue @@ -53,13 +53,13 @@ export interface SlideoverEmits extends DialogRootEmits {} export interface SlideoverSlots { default(props: { open: boolean }): any - content(): any - header(): any - title(): any - description(): any + content(props?: any): any + header(props?: any): any + title(props?: any): any + description(props?: any): any close(props: { class: string }): any - body(): any - footer(): any + body(props?: any): any + footer(props?: any): any } diff --git a/src/runtime/components/Textarea.vue b/src/runtime/components/Textarea.vue index d303424e..3b09efbb 100644 --- a/src/runtime/components/Textarea.vue +++ b/src/runtime/components/Textarea.vue @@ -35,7 +35,7 @@ export interface TextareaEmits { } export interface TextareaSlots { - default(): any + default(props?: any): any } diff --git a/src/runtime/components/Toast.vue b/src/runtime/components/Toast.vue index 3d153f8c..be1b2ce2 100644 --- a/src/runtime/components/Toast.vue +++ b/src/runtime/components/Toast.vue @@ -42,10 +42,10 @@ export interface ToastProps extends Omit diff --git a/src/runtime/components/Toaster.vue b/src/runtime/components/Toaster.vue index 0ad51e40..d482f5b4 100644 --- a/src/runtime/components/Toaster.vue +++ b/src/runtime/components/Toaster.vue @@ -24,7 +24,7 @@ export interface ToasterProps extends Omit } export interface ToasterSlots { - default(): any + default(props?: any): any } export type ToasterContext = ComputedRef<{ diff --git a/src/runtime/components/Tooltip.vue b/src/runtime/components/Tooltip.vue index 7ad4caaf..19e9acb3 100644 --- a/src/runtime/components/Tooltip.vue +++ b/src/runtime/components/Tooltip.vue @@ -38,7 +38,7 @@ export interface TooltipEmits extends TooltipRootEmits {} export interface TooltipSlots { default(props: { open: boolean }): any - content(): any + content(props?: any): any }