chore: cleanup, log on the docs
This commit is contained in:
parent
0d868693e0
commit
ed054e0736
|
|
@ -161,13 +161,14 @@ const onSubmit = handleSubmit((values) => {
|
|||
@submit="onSubmit"
|
||||
>
|
||||
<template #username="componentField">
|
||||
<div class="w-1/3">
|
||||
<div class="border p-4 rounded-lg shadow-sm">
|
||||
<AutoFormField v-bind="{ ...componentField, name: 'username' }" />
|
||||
</div>
|
||||
</template>
|
||||
<template #password="componentField">
|
||||
<div class="w-1/3">
|
||||
<AutoFormField v-bind="{ ...componentField, name: 'password' }" />
|
||||
<template #customParent="componentField">
|
||||
<div class="flex items-end space-x-4">
|
||||
<AutoFormField class="w-full" v-bind="{ ...componentField, name: 'customParent' }" />
|
||||
<Button>Check</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ const shapes = computed(() => {
|
|||
:shape="shape"
|
||||
/>
|
||||
</slot>
|
||||
|
||||
{{ shape.schema }}
|
||||
</template>
|
||||
|
||||
<slot :shapes="shapes" />
|
||||
|
|
|
|||
|
|
@ -26,37 +26,4 @@ defineProps<{
|
|||
>
|
||||
<slot />
|
||||
</component>
|
||||
|
||||
<!-- <FieldInput
|
||||
v-if="shape.type === ZodFirstPartyTypeKind.ZodString"
|
||||
:name="name"
|
||||
:required="shape.required"
|
||||
:config="config"
|
||||
/>
|
||||
<FieldInput
|
||||
v-else-if="shape.type === ZodFirstPartyTypeKind.ZodNumber"
|
||||
:name="name"
|
||||
:required="shape.required"
|
||||
type="number"
|
||||
:config="config"
|
||||
/>
|
||||
<FieldBoolean
|
||||
v-else-if="shape.type === ZodFirstPartyTypeKind.ZodBoolean"
|
||||
:name="name"
|
||||
:required="shape.required"
|
||||
:config="config"
|
||||
/>
|
||||
<FieldDate
|
||||
v-else-if="shape.type === ZodFirstPartyTypeKind.ZodDate"
|
||||
:name="name"
|
||||
:required="shape.required"
|
||||
:config="config"
|
||||
/>
|
||||
<FieldEnum
|
||||
v-else-if="shape.type === ZodFirstPartyTypeKind.ZodEnum"
|
||||
:name="name"
|
||||
:required="shape.required"
|
||||
:config="config"
|
||||
:options="shape.options"
|
||||
/> -->
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@ import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessa
|
|||
import { Input } from '@/lib/registry/new-york/ui/input'
|
||||
import { Textarea } from '@/lib/registry/new-york/ui/textarea'
|
||||
|
||||
defineOptions({
|
||||
inheritAttrs: false,
|
||||
})
|
||||
|
||||
defineProps<{
|
||||
name: string
|
||||
required?: boolean
|
||||
|
|
@ -19,13 +15,13 @@ defineProps<{
|
|||
|
||||
<template>
|
||||
<FormField v-slot="{ componentField }" :name="name">
|
||||
<FormItem>
|
||||
<FormItem v-bind="$attrs">
|
||||
<AutoFormLabel :required="required">
|
||||
{{ config?.label || beautifyObjectName(name) }}
|
||||
</AutoFormLabel>
|
||||
<FormControl>
|
||||
<Textarea v-if="config?.component === 'textarea'" type="text" v-bind="{ ...$attrs, ...componentField, ...config?.inputProps }" />
|
||||
<Input v-else type="text" v-bind="{ ...$attrs, ...componentField, ...config?.inputProps }" />
|
||||
<Textarea v-if="config?.component === 'textarea'" type="text" v-bind="{ ...componentField, ...config?.inputProps }" />
|
||||
<Input v-else type="text" v-bind="{ ...componentField, ...config?.inputProps }" />
|
||||
</FormControl>
|
||||
<FormDescription v-if="config?.description">
|
||||
{{ config.description }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user