chore(components): use {} for empty props

This commit is contained in:
Benjamin Canac
2024-06-28 22:03:14 +02:00
parent 8113c2163c
commit f9c69a7837
30 changed files with 69 additions and 63 deletions

View File

@@ -50,7 +50,7 @@ export interface ${upperName}Props {
}
export interface ${upperName}Slots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -13,5 +13,6 @@ export default createConfigForNuxt({
'import/order': 'off',
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': ['error', { singleline: 5 }],
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off'
})

View File

@@ -50,10 +50,10 @@ export interface AlertEmits {
}
export interface AlertSlots {
leading(props?: any): any
title(props?: any): any
description(props?: any): any
actions(props?: any): any
leading(props?: {}): any
title(props?: {}): any
description(props?: {}): any
actions(props?: {}): any
close(props: { class: string }): any
}
</script>

View File

@@ -6,6 +6,10 @@ export interface ProviderProps extends ConfigProviderProps {
tooltip?: TooltipProviderProps
toaster?: ToasterProps | null
}
export interface ProviderSlors {
default(props?: {}): any
}
</script>
<script setup lang="ts">
@@ -18,6 +22,7 @@ import { UToaster, UModalProvider, USlideoverProvider } from '#components'
const props = withDefaults(defineProps<ProviderProps>(), {
useId: () => useId()
})
defineSlots<ProviderSlors>()
const configProviderProps = useForwardProps(reactivePick(props, 'dir', 'scrollBody', 'useId'))
const tooltipProps = toRef(() => props.tooltip)

View File

@@ -26,7 +26,7 @@ export interface AvatarGroupProps {
}
export interface AvatarGroupSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -24,7 +24,7 @@ export interface BadgeProps {
}
export interface BadgeSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -40,7 +40,7 @@ export type BreadcrumbSlots<T extends { slot?: string }> = {
'item-leading': SlotProps<T>
'item-label': SlotProps<T>
'item-trailing': SlotProps<T>
'separator'(props?: any): any
'separator'(props?: {}): any
} & DynamicSlots<T, SlotProps<T>>
</script>

View File

@@ -26,9 +26,9 @@ export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'ra
}
export interface ButtonSlots {
leading(props?: any): any
default(props?: any): any
trailing(props?: any): any
leading(props?: {}): any
default(props?: {}): any
trailing(props?: {}): any
}
</script>

View File

@@ -27,7 +27,7 @@ export interface ButtonGroupProps {
}
export interface ButtonGroupSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -19,9 +19,9 @@ export interface CardProps {
}
export interface CardSlots {
header(props?: any): any
default(props?: any): any
footer(props?: any): any
header(props?: {}): any
default(props?: {}): any
footer(props?: {}): any
}
</script>

View File

@@ -30,8 +30,8 @@ export interface ChipProps {
}
export interface ChipSlots {
default(props?: any): any
content(props?: any): any
default(props?: {}): any
content(props?: {}): any
}
export interface ChipEmits {

View File

@@ -23,7 +23,7 @@ export interface CollapsibleEmits extends CollapsibleRootEmits {}
export interface CollapsibleSlots {
default(props: { open: boolean }): any
content(props?: any): any
content(props?: {}): any
}
</script>

View File

@@ -79,7 +79,7 @@ type SlotProps<T> = (props: { item: T, index: number }) => any
export type CommandPaletteSlots<G extends { slot?: string }, T extends { slot?: string }> = {
'empty'(props: { searchTerm?: string }): any
'close'(props?: any): any
'close'(props?: {}): any
'item': SlotProps<T>
'item-leading': SlotProps<T>
'item-label': SlotProps<T>

View File

@@ -18,7 +18,7 @@ export interface ContainerProps {
}
export interface ContainerSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -47,7 +47,7 @@ export interface ContextMenuEmits extends ContextMenuRootEmits {}
type SlotProps<T> = (props: { item: T, active?: boolean, index: number }) => any
export type ContextMenuSlots<T extends { slot?: string }> = {
'default'(props?: any): any
'default'(props?: {}): any
'item': SlotProps<T>
'item-leading': SlotProps<T>
'item-label': SlotProps<T>

View File

@@ -33,14 +33,14 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
export interface DrawerEmits extends DrawerRootEmits {}
export interface DrawerSlots {
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
default(props?: {}): any
handle(props?: {}): any
content(props?: {}): any
header(props?: {}): any
title(props?: {}): any
description(props?: {}): any
body(props?: {}): any
footer(props?: {}): any
}
</script>

View File

@@ -17,7 +17,7 @@ interface DropdownMenuContentProps<T> extends Omit<RadixDropdownMenuContentProps
interface DropdownMenuContentEmits extends RadixDropdownMenuContentEmits {}
type DropdownMenuContentSlots<T extends { slot?: string }> = Omit<DropdownMenuSlots<T>, 'default'> & {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -29,7 +29,7 @@ export interface FormEmits<T extends object> {
}
export interface FormSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -36,9 +36,9 @@ export interface InputEmits {
}
export interface InputSlots {
leading(props?: any): any
default(props?: any): any
trailing(props?: any): any
leading(props?: {}): any
default(props?: {}): any
trailing(props?: {}): any
}
</script>

View File

@@ -24,7 +24,7 @@ export interface KbdProps {
}
export interface KbdSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -44,13 +44,13 @@ export interface ModalEmits extends DialogRootEmits {}
export interface ModalSlots {
default(props: { open: boolean }): any
content(props?: any): any
header(props?: any): any
title(props?: any): any
description(props?: any): any
content(props?: {}): any
header(props?: {}): any
title(props?: {}): any
description(props?: {}): any
close(props: { class: string }): any
body(props?: any): any
footer(props?: any): any
body(props?: {}): any
footer(props?: {}): any
}
</script>

View File

@@ -80,11 +80,11 @@ export interface PaginationProps extends Pick<PaginationRootProps, 'defaultPage'
export interface PaginationEmits extends PaginationRootEmits {}
export interface PaginationSlots {
first(props?: any): any
prev(props?: any): any
next(props?: any): any
last(props?: any): any
ellipsis(props?: any): any
first(props?: {}): any
prev(props?: {}): any
next(props?: {}): any
last(props?: {}): any
ellipsis(props?: {}): any
item(props: {
page: number
pageCount: number

View File

@@ -38,7 +38,7 @@ export interface PopoverEmits extends PopoverRootEmits {}
export interface PopoverSlots {
default(props: { open: boolean }): any
content(props?: any): any
content(props?: {}): any
}
</script>

View File

@@ -41,7 +41,7 @@ export interface RadioGroupEmits extends RadioGroupRootEmits {}
type SlotProps<T> = (props: { item: T, modelValue?: string }) => any
export interface RadioGroupSlots<T> {
legend(props?: any): any
legend(props?: {}): any
label: SlotProps<T>
description: SlotProps<T>
}

View File

@@ -37,7 +37,7 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
}
export interface SeparatorSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -54,13 +54,13 @@ export interface SlideoverEmits extends DialogRootEmits {}
export interface SlideoverSlots {
default(props: { open: boolean }): any
content(props?: any): any
header(props?: any): any
title(props?: any): any
description(props?: any): any
content(props?: {}): any
header(props?: {}): any
title(props?: {}): any
description(props?: {}): any
close(props: { class: string }): any
body(props?: any): any
footer(props?: any): any
body(props?: {}): any
footer(props?: {}): any
}
</script>

View File

@@ -36,7 +36,7 @@ export interface TextareaEmits {
}
export interface TextareaSlots {
default(props?: any): any
default(props?: {}): any
}
</script>

View File

@@ -47,10 +47,10 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
export interface ToastEmits extends ToastRootEmits {}
export interface ToastSlots {
leading(props?: any): any
title(props?: any): any
description(props?: any): any
actions(props?: any): any
leading(props?: {}): any
title(props?: {}): any
description(props?: {}): any
actions(props?: {}): any
close(props: { class: string }): any
}
</script>

View File

@@ -24,7 +24,7 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
}
export interface ToasterSlots {
default(props?: any): any
default(props?: {}): any
}
export type ToasterContext = ComputedRef<{

View File

@@ -38,7 +38,7 @@ export interface TooltipEmits extends TooltipRootEmits {}
export interface TooltipSlots {
default(props: { open: boolean }): any
content(props?: any): any
content(props?: {}): any
}
</script>