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 { export interface ${upperName}Slots {
default(props?: any): any default(props?: {}): any
} }
</script> </script>

View File

@@ -13,5 +13,6 @@ export default createConfigForNuxt({
'import/order': 'off', 'import/order': 'off',
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': ['error', { singleline: 5 }], '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 { export interface AlertSlots {
leading(props?: any): any leading(props?: {}): any
title(props?: any): any title(props?: {}): any
description(props?: any): any description(props?: {}): any
actions(props?: any): any actions(props?: {}): any
close(props: { class: string }): any close(props: { class: string }): any
} }
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -23,7 +23,7 @@ export interface CollapsibleEmits extends CollapsibleRootEmits {}
export interface CollapsibleSlots { export interface CollapsibleSlots {
default(props: { open: boolean }): any default(props: { open: boolean }): any
content(props?: any): any content(props?: {}): any
} }
</script> </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 }> = { export type CommandPaletteSlots<G extends { slot?: string }, T extends { slot?: string }> = {
'empty'(props: { searchTerm?: string }): any 'empty'(props: { searchTerm?: string }): any
'close'(props?: any): any 'close'(props?: {}): any
'item': SlotProps<T> 'item': SlotProps<T>
'item-leading': SlotProps<T> 'item-leading': SlotProps<T>
'item-label': SlotProps<T> 'item-label': SlotProps<T>

View File

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

View File

@@ -47,7 +47,7 @@ export interface ContextMenuEmits extends ContextMenuRootEmits {}
type SlotProps<T> = (props: { item: T, active?: boolean, index: number }) => any type SlotProps<T> = (props: { item: T, active?: boolean, index: number }) => any
export type ContextMenuSlots<T extends { slot?: string }> = { export type ContextMenuSlots<T extends { slot?: string }> = {
'default'(props?: any): any 'default'(props?: {}): any
'item': SlotProps<T> 'item': SlotProps<T>
'item-leading': SlotProps<T> 'item-leading': SlotProps<T>
'item-label': 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 DrawerEmits extends DrawerRootEmits {}
export interface DrawerSlots { export interface DrawerSlots {
default(props?: any): any default(props?: {}): any
handle(props?: any): any handle(props?: {}): any
content(props?: any): any content(props?: {}): any
header(props?: any): any header(props?: {}): any
title(props?: any): any title(props?: {}): any
description(props?: any): any description(props?: {}): any
body(props?: any): any body(props?: {}): any
footer(props?: any): any footer(props?: {}): any
} }
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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