mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
chore(components): use {} for empty props
This commit is contained in:
@@ -50,7 +50,7 @@ export interface ${upperName}Props {
|
||||
}
|
||||
|
||||
export interface ${upperName}Slots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface AvatarGroupProps {
|
||||
}
|
||||
|
||||
export interface AvatarGroupSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface BadgeProps {
|
||||
}
|
||||
|
||||
export interface BadgeSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export interface ButtonGroupProps {
|
||||
}
|
||||
|
||||
export interface ButtonGroupSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -18,7 +18,7 @@ export interface ContainerProps {
|
||||
}
|
||||
|
||||
export interface ContainerSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface FormEmits<T extends object> {
|
||||
}
|
||||
|
||||
export interface FormSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface KbdProps {
|
||||
}
|
||||
|
||||
export interface KbdSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
||||
}
|
||||
|
||||
export interface SeparatorSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface TextareaEmits {
|
||||
}
|
||||
|
||||
export interface TextareaSlots {
|
||||
default(props?: any): any
|
||||
default(props?: {}): any
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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<{
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user