@@ -23,8 +23,8 @@ import { createTrinity } from '#v0/composables/createTrinity'
2323import { createRegistry } from '#v0/composables/createRegistry'
2424
2525// Utilities
26- import { isNull , isNullOrUndefined } from '#v0/utilities'
27- import { computed , shallowRef , toValue } from 'vue'
26+ import { isNull } from '#v0/utilities'
27+ import { computed } from 'vue'
2828
2929// Transformers
3030import { toArray } from '#v0/composables/toArray'
@@ -34,7 +34,7 @@ import type { RegistryContext, RegistryOptions, RegistryTicket, RegistryTicketIn
3434import type { ContextTrinity } from '#v0/composables/createTrinity'
3535import type { ValidationContext } from '#v0/composables/createValidation'
3636import type { ID } from '#v0/types'
37- import type { App , ComputedRef , MaybeRefOrGetter , ShallowRef } from 'vue'
37+ import type { App , ComputedRef , MaybeRefOrGetter } from 'vue'
3838
3939export type FormValidationResult = string | boolean | Promise < string | boolean >
4040
@@ -71,9 +71,9 @@ export interface FormContext<
7171 /** Reset all registered validations. */
7272 reset : ( ) => void
7373 /** Whether the form is disabled. Components can read this to conditionally disable inputs. */
74- disabled : ShallowRef < boolean >
74+ disabled : MaybeRefOrGetter < boolean >
7575 /** Whether the form is readonly. Components can read this to conditionally disable inputs. */
76- readonly : ShallowRef < boolean >
76+ readonly : MaybeRefOrGetter < boolean >
7777 /** Aggregate: true if all validations valid, false if any invalid, null if any unvalidated. */
7878 isValid : ComputedRef < boolean | null >
7979 /** Aggregate: true if any validation is in progress. */
@@ -127,13 +127,14 @@ export function createForm<
127127 Z extends FormTicketInput = FormTicketInput ,
128128 E extends FormTicket < Z > = FormTicket < Z > ,
129129 R extends FormContext < Z , E > = FormContext < Z , E > ,
130- > ( options ?: FormOptions ) : R {
131- const registry = createRegistry < E > ( options )
132- const disabled = shallowRef ( false )
133- const readonly = shallowRef ( false )
134-
135- if ( ! isNullOrUndefined ( options ?. disabled ) ) disabled . value = toValue ( options . disabled ) ?? false
136- if ( ! isNullOrUndefined ( options ?. readonly ) ) readonly . value = toValue ( options . readonly ) ?? false
130+ > ( options : FormOptions = { } ) : R {
131+ const {
132+ disabled = false ,
133+ readonly = false ,
134+ ..._options
135+ } = options
136+
137+ const registry = createRegistry < E > ( { ..._options , reactive : true } )
137138
138139 const isValidating = computed ( ( ) => {
139140 for ( const ticket of registry . values ( ) ) {
0 commit comments