diff --git a/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue b/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue index 1133acde..c0d3cf55 100644 --- a/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue +++ b/apps/www/src/lib/registry/default/example/PinInputFormDemo.vue @@ -23,7 +23,7 @@ const formSchema = toTypedSchema(z.object({ pin: z.array(z.coerce.string()).length(5, { message: 'Invalid input' }), })) -const { handleSubmit, setValues } = useForm({ +const { handleSubmit, setFieldValue } = useForm({ validationSchema: formSchema, initialValues: { pin: ['1', '2', '3'], @@ -56,9 +56,7 @@ const handleComplete = (e: string[]) => console.log(e.join('')) :name="componentField.name" @complete="handleComplete" @update:model-value="(arrStr) => { - setValues({ - pin: arrStr.filter(Boolean), - }) + setFieldValue('pin', arrStr.filter(Boolean)) }" > diff --git a/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue b/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue index 9a5edb97..a79c3af5 100644 --- a/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue +++ b/apps/www/src/lib/registry/default/ui/pin-input/PinInput.vue @@ -3,7 +3,9 @@ import { type HTMLAttributes, computed } from 'vue' import { PinInputRoot, type PinInputRootEmits, type PinInputRootProps, useForwardPropsEmits } from 'radix-vue' import { cn } from '@/lib/utils' -const props = defineProps() +const props = withDefaults(defineProps(), { + modelValue: () => [], +}) const emits = defineEmits() const delegatedProps = computed(() => { diff --git a/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue b/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue index 4c267b84..2ac9080c 100644 --- a/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue +++ b/apps/www/src/lib/registry/new-york/example/PinInputFormDemo.vue @@ -23,7 +23,7 @@ const formSchema = toTypedSchema(z.object({ pin: z.array(z.coerce.string()).length(5, { message: 'Invalid input' }), })) -const { handleSubmit, setValues } = useForm({ +const { handleSubmit, setFieldValue } = useForm({ validationSchema: formSchema, initialValues: { pin: ['1', '2', '3'], @@ -56,9 +56,7 @@ const handleComplete = (e: string[]) => console.log(e.join('')) :name="componentField.name" @complete="handleComplete" @update:model-value="(arrStr) => { - setValues({ - pin: arrStr.filter(Boolean), - }) + setFieldValue('pin', arrStr.filter(Boolean)) }" > diff --git a/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue b/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue index 9a5edb97..a79c3af5 100644 --- a/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue +++ b/apps/www/src/lib/registry/new-york/ui/pin-input/PinInput.vue @@ -3,7 +3,9 @@ import { type HTMLAttributes, computed } from 'vue' import { PinInputRoot, type PinInputRootEmits, type PinInputRootProps, useForwardPropsEmits } from 'radix-vue' import { cn } from '@/lib/utils' -const props = defineProps() +const props = withDefaults(defineProps(), { + modelValue: () => [], +}) const emits = defineEmits() const delegatedProps = computed(() => { diff --git a/apps/www/src/public/registry/styles/default/auto-form.json b/apps/www/src/public/registry/styles/default/auto-form.json index 19f1099f..3ff151d0 100644 --- a/apps/www/src/public/registry/styles/default/auto-form.json +++ b/apps/www/src/public/registry/styles/default/auto-form.json @@ -60,7 +60,7 @@ }, { "name": "AutoFormFieldObject.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "AutoFormLabel.vue", diff --git a/apps/www/src/public/registry/styles/default/pin-input.json b/apps/www/src/public/registry/styles/default/pin-input.json index 654672e8..973615dc 100644 --- a/apps/www/src/public/registry/styles/default/pin-input.json +++ b/apps/www/src/public/registry/styles/default/pin-input.json @@ -7,7 +7,7 @@ "files": [ { "name": "PinInput.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "PinInputGroup.vue", diff --git a/apps/www/src/public/registry/styles/new-york/auto-form.json b/apps/www/src/public/registry/styles/new-york/auto-form.json index f1454115..f32084dc 100644 --- a/apps/www/src/public/registry/styles/new-york/auto-form.json +++ b/apps/www/src/public/registry/styles/new-york/auto-form.json @@ -60,7 +60,7 @@ }, { "name": "AutoFormFieldObject.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "AutoFormLabel.vue", diff --git a/apps/www/src/public/registry/styles/new-york/pin-input.json b/apps/www/src/public/registry/styles/new-york/pin-input.json index 617f41a3..ee5e8c58 100644 --- a/apps/www/src/public/registry/styles/new-york/pin-input.json +++ b/apps/www/src/public/registry/styles/new-york/pin-input.json @@ -7,7 +7,7 @@ "files": [ { "name": "PinInput.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "PinInputGroup.vue",