Skip to content

form-field

This requires the following types to be installed:

form-field

ts
import type { FormFieldProps } from '@/ui/components/FormField.vue'
import type { GetObjectField } from '@/ui/utils/utils'
import type { ComputedRef, InjectionKey, Ref } from 'vue'

export const inputIdInjectionKey: InjectionKey<Ref<string | undefined>> = Symbol('vue-ui.input-id')

export interface FormFieldInjectedOptions<T> {
  name?: string
  size?: GetObjectField<T, 'size'>
  error?: string | boolean
  eagerValidation?: boolean
  validateOnInputDelay?: number
  errorPattern?: RegExp
  hint?: string
  description?: string
  help?: string
  ariaId: string
}

export const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>> = Symbol('vue-ui.form-field')
ts
import type { FormFieldProps } from '@/UI/Components/FormField.vue'
import type { GetObjectField } from '@/UI/Utils/utils'
import type { ComputedRef, InjectionKey, Ref } from 'vue'

export const inputIdInjectionKey: InjectionKey<Ref<string | undefined>> = Symbol('vue-ui.input-id')

export interface FormFieldInjectedOptions<T> {
  name?: string
  size?: GetObjectField<T, 'size'>
  error?: string | boolean
  eagerValidation?: boolean
  validateOnInputDelay?: number
  errorPattern?: RegExp
  hint?: string
  description?: string
  help?: string
  ariaId: string
}

export const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>> = Symbol('vue-ui.form-field')