fix(FormField): added a utility type to fix some type errors (#81)

Co-authored-by: Mauro Erta <mauro.erta@sap.com>
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Mauro Erta
2024-04-29 18:12:09 +02:00
committed by GitHub
parent 46bd407b91
commit 559a8cba58
3 changed files with 9 additions and 6 deletions

View File

@@ -1,14 +1,13 @@
import { inject, ref, computed } from 'vue'
import { type UseEventBusReturn, useDebounceFn } from '@vueuse/core'
import type { FormEvent, FormInputEvents, FormFieldInjectedOptions, FormInjectedOptions } from '#ui/types/form'
import type { GetObjectField } from '#ui/types/utils'
type Props<T> = {
id?: string
name?: string
// @ts-expect-error FIXME: TS doesn't like this
size?: T['size']
// @ts-expect-error FIXME: TS doesn't like this
color?: T['color']
size?: GetObjectField<T, 'size'>
color?: GetObjectField<T, 'color'>
eagerValidation?: boolean
legend?: string
disabled?: boolean