@ilokesto/form 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/RegisterBinding.ts","../../src/react/useFieldSchemaRegistration.ts","../../src/react/useFormSnapshot.ts","../../src/react/useField.ts","../../src/react/useFieldState.ts","../../src/react/useFormState.ts","../../src/react/useRegister.ts","../../src/react/useForm.ts"],"names":["useMemo","useEffect"],"mappings":";;;;;AAMO,SAAS,mBAAA,CACd,IAAA,EACA,OAAA,EACA,KAAA,EACA,OAAA,EACmC;AACnC,EAAA,MAAM,UAAU,gBAAA,CAAiB,IAAA,EAAM,OAAA,EAAS,MAAM,OAAO,OAAO,CAAA;AACpE,EAAA,MAAM,KAAA,GAAQ;AAAA,IACZ,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,OAAO,OAAA,CAAQ,KAAA;AAAA,IACf,SAAS,OAAA,CAAQ,OAAA;AAAA,IACjB,QAAA,EAAU,CAAC,KAAA,KAAoC;AAC7C,MAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,aAAiC,CAAA;AAAA,IACxD,CAAA;AAAA,IACA,QAAQ,MAAM;AACZ,MAAA,OAAA,CAAQ,IAAA,EAAK;AAAA,IACf,CAAA;AAAA,IACA,SAAS,MAAM;AACb,MAAA,OAAA,CAAQ,KAAA,EAAM;AAAA,IAChB;AAAA,GACF;AAEA,EAAA,OAAO,KAAA;AACT;ACxBO,SAAS,0BAAA,CAAoC,MAAqB,OAAA,EAAgC;AACvG,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,aAAA,EAAc,GAAI,OAAA;AAExC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,MAAA,EAAQ;AACX,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,OAAO,KAAK,mBAAA,CAAoB,IAAA,EA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ent } from 'react';\nimport type { FieldState, Form } from '../core/index';\nimport { createDomBinding, type FieldEventTarget, type RegisterOptions, fieldPathToDomName } from '../adapters/dom';\nimport type { RegisterElement, RegisterPropsForElement } from './types';\n\n/** binding props를 생성한다. 이벤트 handler는 DOM event에서 값을 읽어 core form에 전달한다. */\nexport function createRegisterProps<TValues, TElement extends RegisterElement>(\n form: Form<TValues>,\n options: RegisterOptions,\n field: Readonly<FieldState>,\n domName: string,\n): RegisterPropsForElement<TElement> {\n const binding = createDomBinding(form, options, () => field, domName);\n const props = {\n name: binding.name,\n type: binding.type,\n value: binding.value,\n checked: binding.checked,\n onChange: (event: ChangeEvent<HTMLElement>) => {\n binding.change(event.currentTarget as FieldEventTarget);\n },\n onBlur: () => {\n binding.blur();\n },\n onFocus: () => {\n binding.focus();\n },\n };\n\n return props as unknown as RegisterPropsForElement<TElement>;\n}\n\nexport { fieldPathToDomName };\n","import { useEffect } from 'react';\nimport type { Form } from '../core/index';\nimport type { RegisterOptions } from './types';\nimport { fieldPathToDomName } from './RegisterBinding';\n\n/** field-local schema 하나를 effect lifecycle에 맞춰 등록한다. */\nexport function useFieldSchemaRegistration<TValues>(form: Form<TValues>, options: RegisterOptions): void {\n const { name, schema, schemaOptions } = options;\n\n useEffect(() => {\n if (!schema) {\n return undefined;\n }\n\n return form.registerFieldSchema(name, { schema, schemaOptions });\n }, [form, name, schema, schemaOptions]);\n}\n\n/** bulk register에서도 hook 호출 수가 옵션 길이에 의존하지 않도록 한 effect에서 모두 등록한다. */\nexport function useFieldSchemaRegistrations<TValues>(form: Form<TValues>, options: readonly RegisterOptions[]): void {\n const schemaSignature = options.map(option => `${fieldPathToDomName(option.name)}:${option.schema ? 'schema' : 'none'}`).join('|');\n\n useEffect(() => {\n const cleanups = options.flatMap(option => {\n if (!option.schema) {\n return [];\n }\n\n return [form.registerFieldSchema(option.name, { schema: option.schema, schemaOptions: option.schemaOptions })];\n });\n\n return () => {\n cleanups.forEach(cleanup => cleanup());\n };\n }, [form, options, schemaSignature]);\n}\n","import { useSyncExternalStore } from 'react';\nimport type { Form, FormState } from '../core/index';\n\n/** React 18+ 외부 store 구독 API로 core form snapshot을 구독한다. */\nexport function useFormSnapshot<TValues>(form: Form<TValues>): Readonly<FormState<TValues>> {\n return useSyncExternalStore(\n listener => form.subscribe(listener),\n () => form.getState(),\n () => form.getState(),\n );\n}\n","import { useCallback, useMemo } from 'react';\nimport type { Form } from '../core/index';\nimport type { RegisterElement, RegisterOptions, RegisterPropsForElement, UseFieldReturn } from './types';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport { getFieldState } from '../adapters/dom';\nimport { useFieldSchemaRegistration } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/** 한 field의 binding, value, meta, setter를 함께 반환한다. */\nexport function useFieldWithForm<TValues, TElement extends RegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): UseFieldReturn<RegisterPropsForElement<TElement>> {\n useFieldSchemaRegistration(form, options);\n\n const state = useFormSnapshot(form);\n const field = getFieldState(form, state, options.name);\n const domName = fieldPathToDomName(options.name);\n const props = useMemo(() => createRegisterProps<TValues, TElement>(form, options, field, domName), [form, options, field, domName]);\n\n const setValue = useCallback((value: unknown) => {\n form.setValue(options.name, value, { source: 'program' });\n }, [form, options.name]);\n\n return useMemo(() => ({\n props,\n value: field.value,\n setValue,\n errors: [...field.errors],\n dirty: field.dirty,\n touched: field.touched,\n }), [field, props, setValue]);\n}\n","import type { FieldPathInput, Form } from '../core/index';\nimport { getFieldState } from '../adapters/dom';\nimport type { UseFieldStateReturn } from './types';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/** 한 field의 value와 meta를 typed path 기준으로 반환한다. */\nexport function useFieldStateWithForm<TValues, const TName extends FieldPathInput>(form: Form<TValues>, name: TName): UseFieldStateReturn<TValues, TName> {\n const state = useFormSnapshot(form);\n\n return getFieldState(form, state, name) as UseFieldStateReturn<TValues, TName>;\n}\n","import { useMemo } from 'react';\nimport type { Form } from '../core/index';\nimport { createFormStateSummary } from '../adapters/FormStateSummary';\nimport type { UseFormStateReturn } from './types';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/** form 전체 aggregate state를 반환한다. */\nexport function useFormStateWithForm<TValues>(form: Form<TValues>): UseFormStateReturn<TValues> {\n const state = useFormSnapshot(form);\n\n return useMemo(() => createFormStateSummary(state), [state]);\n}\n","import { useMemo } from 'react';\nimport type { Form } from '../core/index';\nimport type { RegisterElement, RegisterOptions, RegisterPropsForElement, RegisterPropsList } from './types';\nimport { getFieldState } from '../adapters/dom';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport { useFieldSchemaRegistrations } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\nexport function useRegisterWithForm<TValues, TElement extends RegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): RegisterPropsForElement<TElement>;\nexport function useRegisterWithForm<TValues, TElement extends RegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, options: TOptions): RegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues, TElement extends RegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, ...options: TOptions): RegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues>(form: Form<TValues>, first: RegisterOptions | readonly RegisterOptions[], ...rest: readonly RegisterOptions[]): RegisterPropsForElement<RegisterElement> | RegisterPropsForElement<RegisterElement>[];\n\n/** 단일 또는 여러 field의 DOM binding props를 만든다. */\nexport function useRegisterWithForm<TValues>(\n form: Form<TValues>,\n first: RegisterOptions | readonly RegisterOptions[],\n ...rest: readonly RegisterOptions[]\n): RegisterPropsForElement<RegisterElement> | RegisterPropsForElement<RegisterElement>[] {\n const shouldReturnList = Array.isArray(first) || rest.length > 0;\n const options = normalizeRegisterOptions(first, rest);\n\n useFieldSchemaRegistrations(form, options);\n\n const state = useFormSnapshot(form);\n const bindings = useMemo(\n () => options.map(option => {\n const field = getFieldState(form, state, option.name);\n const domName = fieldPathToDomName(option.name);\n\n return createRegisterProps(form, option, field, domName);\n }),\n [form, options, state],\n );\n\n return shouldReturnList ? bindings : bindings[0];\n}\n\nfunction normalizeRegisterOptions(first: RegisterOptions | readonly RegisterOptions[], rest: readonly RegisterOptions[]): readonly RegisterOptions[] {\n if (Array.isArray(first)) {\n return first as readonly RegisterOptions[];\n }\n\n if (rest.length > 0) {\n return [first as RegisterOptions, ...rest];\n }\n\n return [first as RegisterOptions];\n}\n","import { useEffect, useMemo, useRef } from 'react';\nimport { createSubmitHandler } from '../adapters/dom';\nimport {\n createExternalValuesSynchronizer,\n createFormFromOptions,\n isFormInstance,\n type FormInput,\n} from '../adapters/FormInput';\nimport type { FieldPathInput, Form } from '../core/index';\nimport type { ReactForm, ReactFormOptions, RegisterOptions } from './types';\nimport { useFieldWithForm } from './useField';\nimport { useFieldStateWithForm } from './useFieldState';\nimport { useFormStateWithForm } from './useFormState';\nimport { useRegisterWithForm } from './useRegister';\n\n/** React hook surface를 core Form 인스턴스에 바인딩한다. */\nexport function useForm<TValues>(form: Form<TValues>): ReactForm<TValues>;\nexport function useForm<TValues>(options: ReactFormOptions<TValues>): ReactForm<TValues>;\nexport function useForm<TValues>(input: FormInput<TValues, ReactFormOptions<TValues>>): ReactForm<TValues> {\n const optionsFormRef = useRef<Form<TValues> | undefined>(undefined);\n const isForm = isFormInstance(input);\n const form = isForm\n ? input\n : (optionsFormRef.current ??= createFormFromOptions(input));\n const values = isForm ? undefined : input.values;\n const resetOptions = isForm ? undefined : input.resetOptions;\n const synchronizeValues = useMemo(() => createExternalValuesSynchronizer(form), [form]);\n\n useEffect(() => {\n synchronizeValues(values, resetOptions);\n }, [resetOptions, synchronizeValues, values]);\n\n const useRegister = ((\n first: RegisterOptions | readonly RegisterOptions[],\n ...rest: readonly RegisterOptions[]\n ) => useRegisterWithForm(form, first, ...rest)) as ReactForm<TValues>['useRegister'];\n const useField = ((options: RegisterOptions) =>\n useFieldWithForm(form, options)) as ReactForm<TValues>['useField'];\n const useFieldState = ((name: FieldPathInput) =>\n useFieldStateWithForm(form, name)) as ReactForm<TValues>['useFieldState'];\n const useFormState = (): ReturnType<ReactForm<TValues>['useFormState']> =>\n useFormStateWithForm(form);\n const handleSubmit = ((onValid, onInvalid) =>\n createSubmitHandler(form, onValid, onInvalid)) as ReactForm<TValues>['handleSubmit'];\n\n return useMemo(() => ({ form, useRegister, useField, useFieldState, useFormState, handleSubmit }), [form]);\n}\n"]}
1
+ {"version":3,"sources":["../../src/react/RegisterBinding.ts","../../src/react/useFieldSchemaRegistration.ts","../../src/react/useFormSnapshot.ts","../../src/react/useField.ts","../../src/react/useFieldState.ts","../../src/react/useFormState.ts","../../src/react/useRegister.ts","../../src/react/useForm.ts"],"names":["useMemo","useEffect"],"mappings":";;;;;AAqDO,SAAS,mBAAA,CACd,IAAA,EACA,OAAA,EACA,KAAA,EACA,OAAA,EACmC;AACnC,EAAA,MAAM,UAAU,gBAAA,CAAiB,IAAA,EAAM,OAAA,EAAS,MAAM,OAAO,OAAO,CAAA;AACpE,EAAA,MAAM,KAAA,GAAQ;AAAA,IACZ,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,MAAM,OAAA,CAAQ,IAAA;AAAA,IACd,OAAO,OAAA,CAAQ,KAAA;AAAA,IACf,SAAS,OAAA,CAAQ,OAAA;AAAA,IACjB,QAAA,EAAU,CAAC,KAAA,KAAoC;AAC7C,MAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,aAAiC,CAAA;AAAA,IACxD,CAAA;AAAA,IACA,QAAQ,MAAM;AACZ,MAAA,OAAA,CAAQ,IAAA,EAAK;AAAA,IACf,CAAA;AAAA,IACA,SAAS,MAAM;AACb,MAAA,OAAA,CAAQ,KAAA,EAAM;AAAA,IAChB;AAAA,GACF;AAEA,EAAA,OAAO,KAAA;AACT;ACjCO,SAAS,0BAA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AS,cAC9B,mBAAA,CAAoB,IAAA,EAAM,SAAS,SAAS,CAAA,CAAA;AAE9C,EAAA,OAAOD,OAAAA,CAAQ,OAAO,EAAE,IAAA,EAAM,WAAA,EAAa,QAAA,EAAU,aAAA,EAAe,YAAA,EAAc,YAAA,EAAa,CAAA,EAAI,CAAC,IAAI,CAAC,CAAA;AAC3G","file":"index.js","sourcesContent":["import type { ChangeEvent } from 'react';\nimport type { FieldState, Form } from '../core/index';\nimport { createDomBinding, type FieldEventTarget, type RegisterOptions, fieldPathToDomName } from '../adapters/dom';\nimport type { RegisterElement, RegisterPropsForElement } from './types';\n\n/**\n * @description Create framework-specific DOM bindings that forward value, checked, change, blur, and focus behavior to the core form.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions} options - Field schema and DOM binding options.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @param {Readonly<FieldState>} field - Field snapshot used to build binding properties.\n * @param {unknown} field.value - Current field value.\n * @param {FormError[]} field.errors - Current validation errors for the field.\n * @param {boolean} field.touched - Whether the field has blurred at least once.\n * @param {boolean} field.dirty - Whether the current value differs from its default by Object.is.\n * @param {boolean} field.modified - Whether a user-originated write has changed this field.\n * @param {boolean} field.isFocused - Whether focus has been recorded without a subsequent blur.\n * @param {string} domName - Name string assigned to the DOM control.\n * @returns {RegisterPropsForElement<TElement>} Binding properties suitable for the selected framework and element type.\n * @example\n * ```ts\n * createRegisterProps(form, { name: \"email\" }, form.getFieldState(\"email\"), \"email\");\n * ```\n */\nexport function createRegisterProps<TValues, TElement extends RegisterElement>(\n form: Form<TValues>,\n options: RegisterOptions,\n field: Readonly<FieldState>,\n domName: string,\n): RegisterPropsForElement<TElement> {\n const binding = createDomBinding(form, options, () => field, domName);\n const props = {\n name: binding.name,\n type: binding.type,\n value: binding.value,\n checked: binding.checked,\n onChange: (event: ChangeEvent<HTMLElement>) => {\n binding.change(event.currentTarget as FieldEventTarget);\n },\n onBlur: () => {\n binding.blur();\n },\n onFocus: () => {\n binding.focus();\n },\n };\n\n return props as unknown as RegisterPropsForElement<TElement>;\n}\n\nexport { fieldPathToDomName };\n","import { useEffect } from 'react';\nimport type { Form } from '../core/index';\nimport type { RegisterOptions } from './types';\nimport { fieldPathToDomName } from './RegisterBinding';\n\n/**\n * @description Register one field-local schema after the React commit and clean it up when options change or the component unmounts.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions} options - Field schema and DOM binding options.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @example\n * ```ts\n * useFieldSchemaRegistration(form, { name: \"email\", schema });\n * ```\n */\nexport function useFieldSchemaRegistration<TValues>(form: Form<TValues>, options: RegisterOptions): void {\n const { name, schema, schemaOptions } = options;\n\n useEffect(() => {\n if (!schema) {\n return undefined;\n }\n\n return form.registerFieldSchema(name, { schema, schemaOptions });\n }, [form, name, schema, schemaOptions]);\n}\n\n/**\n * @description Register field-local schemas together and release them with the framework lifecycle.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {readonly RegisterOptions[]} options - Field schema and DOM binding options.\n * @example\n * ```ts\n * useFieldSchemaRegistrations(form, [{ name: \"email\", schema }]);\n * ```\n */\nexport function useFieldSchemaRegistrations<TValues>(form: Form<TValues>, options: readonly RegisterOptions[]): void {\n const schemaSignature = options.map(option => `${fieldPathToDomName(option.name)}:${option.schema ? 'schema' : 'none'}`).join('|');\n\n useEffect(() => {\n const cleanups = options.flatMap(option => {\n if (!option.schema) {\n return [];\n }\n\n return [form.registerFieldSchema(option.name, { schema: option.schema, schemaOptions: option.schemaOptions })];\n });\n\n return () => {\n cleanups.forEach(cleanup => cleanup());\n };\n }, [form, options, schemaSignature]);\n}\n","import { useSyncExternalStore } from 'react';\nimport type { Form, FormState } from '../core/index';\n\n/**\n * @description Subscribe the framework view to core form snapshots and release the subscription through its lifecycle.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @returns {Readonly<FormState<TValues>>} Framework subscription to current immutable snapshots.\n * - defaultValues `TValues` - Initial values and the baseline used for dirty checks and reset.\n * - fields `Record<string, FieldState<unknown>>` - Field snapshots indexed by normalized path keys.\n * - submitCount `number` - Number of submission attempts started by the form.\n * - isSubmitting `boolean` - Whether queued validation or a submit callback is still pending.\n * - isSubmitted `boolean` - Whether a submission has completed at least once.\n * - isSubmitSuccessful `boolean` - Whether the latest completed submission reached a successful valid callback.\n * - arrayKeys `ArrayKeys` - Stable rendering keys indexed by array path.\n * @example\n * ```ts\n * useFormSnapshot(form);\n * ```\n */\nexport function useFormSnapshot<TValues>(form: Form<TValues>): Readonly<FormState<TValues>> {\n return useSyncExternalStore(\n listener => form.subscribe(listener),\n () => form.getState(),\n () => form.getState(),\n );\n}\n","import { useCallback, useMemo } from 'react';\nimport type { Form } from '../core/index';\nimport type { RegisterElement, RegisterOptions, RegisterPropsForElement, UseFieldReturn } from './types';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport { getFieldState } from '../adapters/dom';\nimport { useFieldSchemaRegistration } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Bind one field to its framework view, exposing reactive bindings, copied errors, metadata, and a programmatic setter.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions} options - Field schema and DOM binding options.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @returns {UseFieldReturn<RegisterPropsForElement<TElement>>} Reactive field bindings, value, copied errors, flags, and programmatic setter.\n * - props `RegisterPropsForElement<TElement>` - Binding properties to spread onto the matching DOM control.\n * - value `unknown` - Current field value.\n * - setValue `(value: unknown) => void` - Replace the field value as a programmatic write.\n * - errors `FormError[]` - Current validation errors for the field.\n * - dirty `boolean` - Whether the current value differs from its default by Object.is.\n * - touched `boolean` - Whether the field has blurred at least once.\n * @example\n * ```ts\n * useFieldWithForm(form, { name: \"email\", schema });\n * ```\n */\nexport function useFieldWithForm<TValues, TElement extends RegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): UseFieldReturn<RegisterPropsForElement<TElement>> {\n useFieldSchemaRegistration(form, options);\n\n const state = useFormSnapshot(form);\n const field = getFieldState(form, state, options.name);\n const domName = fieldPathToDomName(options.name);\n const props = useMemo(() => createRegisterProps<TValues, TElement>(form, options, field, domName), [form, options, field, domName]);\n\n const setValue = useCallback((value: unknown) => {\n form.setValue(options.name, value, { source: 'program' });\n }, [form, options.name]);\n\n return useMemo(() => ({\n props,\n value: field.value,\n setValue,\n errors: [...field.errors],\n dirty: field.dirty,\n touched: field.touched,\n }), [field, props, setValue]);\n}\n","import type { FieldPathInput, Form } from '../core/index';\nimport { getFieldState } from '../adapters/dom';\nimport type { UseFieldStateReturn } from './types';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Subscribe to one field snapshot with its value type inferred from the form values and literal or tuple path.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {TName} name - Literal field name or tuple path; strings are not split on dots.\n * @returns {Readonly<FieldState<FieldPathValue<TValues, TName>>>} Read-only field snapshot whose value follows the supplied path type.\n * - value `FieldPathValue<TValues, TName>` - Current field value.\n * - errors `FormError[]` - Current validation errors for the field.\n * - touched `boolean` - Whether the field has blurred at least once.\n * - dirty `boolean` - Whether the current value differs from its default by Object.is.\n * - modified `boolean` - Whether a user-originated write has changed this field.\n * - isFocused `boolean` - Whether focus has been recorded without a subsequent blur.\n * @example\n * ```ts\n * useFieldStateWithForm(form, \"email\");\n * ```\n */\nexport function useFieldStateWithForm<TValues, const TName extends FieldPathInput>(form: Form<TValues>, name: TName): UseFieldStateReturn<TValues, TName> {\n const state = useFormSnapshot(form);\n\n return getFieldState(form, state, name) as UseFieldStateReturn<TValues, TName>;\n}\n","import { useMemo } from 'react';\nimport type { Form } from '../core/index';\nimport { createFormStateSummary } from '../adapters/FormStateSummary';\nimport type { UseFormStateReturn } from './types';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Subscribe to form-wide aggregates derived from the current core snapshot.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @returns {UseFormStateReturn<TValues>} Reactive form-wide aggregates and submission flags.\n * - state `Readonly<FormState<TValues>>` - Current immutable form snapshot.\n * : state.defaultValues `TValues` - Initial values and the baseline used for dirty checks and reset.\n * : state.fields `Record<string, FieldState<unknown>>` - Field snapshots indexed by normalized path keys.\n * : state.submitCount `number` - Number of submission attempts started by the form.\n * : state.isSubmitting `boolean` - Whether queued validation or a submit callback is still pending.\n * : state.isSubmitted `boolean` - Whether a submission has completed at least once.\n * : state.isSubmitSuccessful `boolean` - Whether the latest completed submission reached a successful valid callback.\n * : state.arrayKeys `ArrayKeys` - Stable rendering keys indexed by array path.\n * - errors `Record<string, FormError[]>` - Nonempty validation error lists indexed by normalized field path.\n * - dirtyFields `Record<string, true>` - Normalized paths whose fields are dirty.\n * - touchedFields `Record<string, true>` - Normalized paths whose fields are touched.\n * - focusedField `string | null` - First focused field in entry order, or null; not necessarily the last focused field.\n * - isDirty `boolean` - Whether at least one field is dirty.\n * - isValid `boolean` - Whether no field currently has recorded errors.\n * - isSubmitting `boolean` - Whether queued validation or a submit callback is still pending.\n * - isSubmitted `boolean` - Whether a submission has completed at least once.\n * - isSubmitSuccessful `boolean` - Whether the latest completed submission reached a successful valid callback.\n * - submitCount `number` - Number of submission attempts started by the form.\n * @example\n * ```ts\n * useFormStateWithForm(form);\n * ```\n */\nexport function useFormStateWithForm<TValues>(form: Form<TValues>): UseFormStateReturn<TValues> {\n const state = useFormSnapshot(form);\n\n return useMemo(() => createFormStateSummary(state), [state]);\n}\n","import { useMemo } from 'react';\nimport type { Form } from '../core/index';\nimport type { RegisterElement, RegisterOptions, RegisterPropsForElement, RegisterPropsList } from './types';\nimport { getFieldState } from '../adapters/dom';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport { useFieldSchemaRegistrations } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Create a single binding or ordered binding list for single, array, or variadic registration options.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions | TOptions} options - Single registration options or an ordered list; variadic calls use the same options order.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @param {RegisterOptions | readonly RegisterOptions[]} first - First single registration or ordered registration list.\n * @param {FieldPathInput} first.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [first.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [first.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [first.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [first.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [first.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [first.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [first.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [first.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [first.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [first.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [first.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [first.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [first.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [first.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @param {readonly RegisterOptions[]} rest - Additional registration options for variadic binding creation.\n * @returns {RegisterPropsForElement<TElement> | RegisterPropsList<TElement, TOptions> | RegisterPropsForElement<RegisterElement> | RegisterPropsForElement<RegisterElement>[]} One binding for a single options object, otherwise bindings in supplied order.\n * - onChange `React.ChangeEventHandler<HTMLSelectElement> | React.ChangeEventHandler<HTMLElement> | React.ChangeEventHandler<HTMLInputElement> | React.ChangeEventHandler<HTMLTextAreaElement>` - Forward change events, including checked and selection state, into the form.\n * - onBlur `React.FocusEventHandler<HTMLSelectElement> | React.FocusEventHandler<HTMLElement> | React.FocusEventHandler<HTMLInputElement> | React.FocusEventHandler<HTMLTextAreaElement>` - Clear focus and mark the field touched.\n * - onFocus `React.FocusEventHandler<HTMLSelectElement> | React.FocusEventHandler<HTMLElement> | React.FocusEventHandler<HTMLInputElement> | React.FocusEventHandler<HTMLTextAreaElement>` - Record focus for this field.\n * - name `string` - DOM name string; tuple paths are JSON-serialized.\n * - value `string | number | readonly string[] | undefined | unknown` - Current field value.\n * - checked `boolean | undefined` - Whether this checkbox or radio represents the current field value.\n * - type `React.HTMLInputTypeAttribute | undefined` - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @example\n * ```ts\n * const email = useRegisterWithForm(form, { name: \"email\" });\n * const fields = useRegisterWithForm(form, [{ name: \"email\" }, { name: \"name\" }]);\n * ```\n */\nexport function useRegisterWithForm<TValues, TElement extends RegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): RegisterPropsForElement<TElement>;\nexport function useRegisterWithForm<TValues, TElement extends RegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, options: TOptions): RegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues, TElement extends RegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, ...options: TOptions): RegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues>(form: Form<TValues>, first: RegisterOptions | readonly RegisterOptions[], ...rest: readonly RegisterOptions[]): RegisterPropsForElement<RegisterElement> | RegisterPropsForElement<RegisterElement>[];\n\nexport function useRegisterWithForm<TValues>(\n form: Form<TValues>,\n first: RegisterOptions | readonly RegisterOptions[],\n ...rest: readonly RegisterOptions[]\n): RegisterPropsForElement<RegisterElement> | RegisterPropsForElement<RegisterElement>[] {\n const shouldReturnList = Array.isArray(first) || rest.length > 0;\n const options = normalizeRegisterOptions(first, rest);\n\n useFieldSchemaRegistrations(form, options);\n\n const state = useFormSnapshot(form);\n const bindings = useMemo(\n () => options.map(option => {\n const field = getFieldState(form, state, option.name);\n const domName = fieldPathToDomName(option.name);\n\n return createRegisterProps(form, option, field, domName);\n }),\n [form, options, state],\n );\n\n return shouldReturnList ? bindings : bindings[0];\n}\n\nfunction normalizeRegisterOptions(first: RegisterOptions | readonly RegisterOptions[], rest: readonly RegisterOptions[]): readonly RegisterOptions[] {\n if (Array.isArray(first)) {\n return first as readonly RegisterOptions[];\n }\n\n if (rest.length > 0) {\n return [first as RegisterOptions, ...rest];\n }\n\n return [first as RegisterOptions];\n}\n","import { useEffect, useMemo, useRef } from 'react';\nimport { createSubmitHandler } from '../adapters/dom';\nimport {\n createExternalValuesSynchronizer,\n createFormFromOptions,\n isFormInstance,\n type FormInput,\n} from '../adapters/FormInput';\nimport type { FieldPathInput, Form } from '../core/index';\nimport type { ReactForm, ReactFormOptions, RegisterOptions } from './types';\nimport { useFieldWithForm } from './useField';\nimport { useFieldStateWithForm } from './useFieldState';\nimport { useFormStateWithForm } from './useFormState';\nimport { useRegisterWithForm } from './useRegister';\n\n/**\n * @description Bind framework helpers to an existing form or create one from options; defined external-value reference changes reset it.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {ReactFormOptions<TValues>} options - Default values, optional form schema, and automatic validation triggers.\n * @param {TValues} options.defaultValues - Initial values and the baseline used for dirty checks and reset.\n * @param {StandardSchemaV1<unknown, TValues> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, TValues>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, TValues> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {TValues} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<TValues> | Promise<StandardSchemaV1.Result<TValues>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {readonly ValidationTrigger[] | undefined} [options.validateOn] - Triggers that run automatic validation; defaults to submit.\n * @param {TValues | undefined} [options.values] - Replacement values; defined reference changes reset the form.\n * @param {ResetOptions | undefined} [options.resetOptions] - State preservation policy for external-value resets.\n * @param {boolean | undefined} [options.resetOptions.keepDirtyValues] - Preserve current values and modified flags of dirty fields.\n * @param {boolean | undefined} [options.resetOptions.keepErrors] - Preserve errors on surviving field paths.\n * @param {boolean | undefined} [options.resetOptions.keepTouched] - Preserve touched flags on surviving field paths.\n * @param {boolean | undefined} [options.resetOptions.keepSubmitState] - Preserve submission counters and lifecycle flags.\n * @returns {ReactForm<TValues>} Core form and bound framework helpers sharing its state and lifecycle.\n * - form `Form<TValues>` - Core form instance shared by all bound helpers.\n * : form.getState `() => Readonly<FormState<TValues>>` - Read the current immutable form snapshot.\n * : form.subscribe `(listener: () => void) => () => void` - Subscribe to state changes and return an unsubscribe callback.\n * : form.registerFieldSchema `(path: FieldPathInput, options: FieldSchemaOptions) => () => void` - Register an overriding field-local validator and return its guarded cleanup.\n * : form.getFieldState `(path: FieldPathInput) => Readonly<FieldState>` - Read field metadata, using a default snapshot for an unknown field.\n * : form.getValue `(path: FieldPathInput) => unknown` - Read the current value of one field.\n * : form.getValues `() => TValues` - Reconstruct nested values from fields and array containers.\n * : form.setValue `(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void` - Write a field with configurable user or program origin and optional immediate validation.\n * : form.blur `(path: FieldPathInput) => Promise<boolean>` - Clear focus, mark touched, and run configured blur validation.\n * : form.focus `(path: FieldPathInput) => void` - Record focus for the selected field.\n * : form.setErrors `(path: FieldPathInput, errors: readonly FormError[]) => void` - Replace all errors for the selected field.\n * : form.clearErrors `(...paths: FieldPathInput[]) => void` - Clear selected fields, or all field errors when no paths are supplied.\n * : form.trigger `(...paths: FieldPathInput[]) => Promise<boolean>` - Run manual validation for selected paths or the entire form.\n * : form.array `(path: FieldPathInput) => FormArray` - Return commands that keep array values, keys, and child metadata aligned.\n * : form.reset `(values?: TValues | undefined, options?: ResetOptions) => void` - Reinitialize from default or replacement values with optional preservation flags.\n * : form.submit `<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>` - Queue validation and dispatch the valid or invalid callback.\n * - useRegister `{ <TElement extends RegisterElement = HTMLInputElement>(options: RegisterOptions): RegisterPropsForElement<TElement>; <TElement extends RegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(options: TOptions): RegisterPropsList<TElement, TOptions>; <TElement extends RegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(...options: TOptions): RegisterPropsList<TElement, TOptions>; }` - Create one binding or an ordered list from single, array, or variadic options.\n * - useField `<TElement extends RegisterElement = HTMLInputElement>(options: RegisterOptions) => UseFieldReturn<RegisterPropsForElement<TElement>>` - Create field bindings, reactive value and metadata, and a setter.\n * - useFieldState `<const TName extends FieldPathInput>(name: TName) => Readonly<FieldState<FieldPathValue<TValues, TName>>>` - Subscribe to a path-typed field snapshot.\n * - useFormState `() => UseFormStateReturn<TValues>` - Subscribe to form-wide errors and lifecycle aggregates.\n * - handleSubmit `<TResult>(onValid: SubmitValidHandler<TValues, TResult>, onInvalid?: SubmitInvalidHandler) => SubmitHandler<React.FormEvent<HTMLFormElement>, TResult>` - Create an event handler that prevents default submission before validating.\n * @example\n * ```ts\n * const { form, handleSubmit } = useForm({ defaultValues: { email: \"\" } });\n * ```\n */\nexport function useForm<TValues>(form: Form<TValues>): ReactForm<TValues>;\nexport function useForm<TValues>(options: ReactFormOptions<TValues>): ReactForm<TValues>;\nexport function useForm<TValues>(input: FormInput<TValues, ReactFormOptions<TValues>>): ReactForm<TValues> {\n const optionsFormRef = useRef<Form<TValues> | undefined>(undefined);\n const isForm = isFormInstance(input);\n const form = isForm\n ? input\n : (optionsFormRef.current ??= createFormFromOptions(input));\n const values = isForm ? undefined : input.values;\n const resetOptions = isForm ? undefined : input.resetOptions;\n const synchronizeValues = useMemo(() => createExternalValuesSynchronizer(form), [form]);\n\n useEffect(() => {\n synchronizeValues(values, resetOptions);\n }, [resetOptions, synchronizeValues, values]);\n\n const useRegister = ((\n first: RegisterOptions | readonly RegisterOptions[],\n ...rest: readonly RegisterOptions[]\n ) => useRegisterWithForm(form, first, ...rest)) as ReactForm<TValues>['useRegister'];\n const useField = ((options: RegisterOptions) =>\n useFieldWithForm(form, options)) as ReactForm<TValues>['useField'];\n const useFieldState = ((name: FieldPathInput) =>\n useFieldStateWithForm(form, name)) as ReactForm<TValues>['useFieldState'];\n const useFormState = (): ReturnType<ReactForm<TValues>['useFormState']> =>\n useFormStateWithForm(form);\n const handleSubmit = ((onValid, onInvalid) =>\n createSubmitHandler(form, onValid, onInvalid)) as ReactForm<TValues>['handleSubmit'];\n\n return useMemo(() => ({ form, useRegister, useField, useFieldState, useFormState, handleSubmit }), [form]);\n}\n"]}
@@ -1,44 +1,59 @@
1
1
  import { F as Form, e as FormError, a as FormState } from '../types-DBlvL6AC.js';
2
2
  import { Accessor } from 'solid-js';
3
- import { R as ReactiveFormOptions, a as RegisterOptions, D as DomValue, S as SubmitValidHandler, b as SubmitInvalidHandler, c as SubmitHandler } from '../FormInput-DuT7QFe-.js';
3
+ import { R as ReactiveFormOptions, a as RegisterOptions, D as DomValue, S as SubmitValidHandler, b as SubmitInvalidHandler, c as SubmitHandler } from '../FormInput-BpDWf4hF.js';
4
4
 
5
5
  /** Solid owner가 외부 values accessor와 함께 form을 만들 때 쓰는 옵션이다. */
6
6
  type SolidFormOptions<TValues> = ReactiveFormOptions<TValues, Accessor<TValues | undefined>>;
7
7
  type SolidBindingHandlers<TElement extends HTMLElement> = {
8
+ /** Forward text input events into the form. */
8
9
  onInput: (event: InputEvent & {
9
10
  currentTarget: TElement;
10
11
  }) => void;
12
+ /** Forward change events, including checked and selection state, into the form. */
11
13
  onChange: (event: Event & {
12
14
  currentTarget: TElement;
13
15
  }) => void;
16
+ /** Clear focus and mark the field touched. */
14
17
  onBlur: (event: FocusEvent & {
15
18
  currentTarget: TElement;
16
19
  }) => void;
20
+ /** Record focus for this field. */
17
21
  onFocus: (event: FocusEvent & {
18
22
  currentTarget: TElement;
19
23
  }) => void;
20
24
  };
21
25
  /** `<input {...useRegister(...)} />`에 바로 spread할 수 있는 기본 binding props다. */
22
26
  type SolidInputRegisterProps = SolidBindingHandlers<HTMLInputElement> & {
27
+ /** DOM name string; tuple paths are JSON-serialized. */
23
28
  readonly name: string;
29
+ /** Input kind; checkbox and radio use checked semantics, otherwise defaults to text. */
24
30
  readonly type: string;
31
+ /** Current field value. */
25
32
  readonly value?: DomValue;
33
+ /** Whether this checkbox or radio represents the current field value. */
26
34
  readonly checked?: boolean;
27
35
  };
28
36
  /** `useRegister<HTMLSelectElement>(...)`로 좁혀 `<select>`에 spread할 수 있는 binding props다. */
29
37
  type SolidSelectRegisterProps = SolidBindingHandlers<HTMLSelectElement> & {
38
+ /** DOM name string; tuple paths are JSON-serialized. */
30
39
  readonly name: string;
40
+ /** Current field value. */
31
41
  readonly value?: DomValue;
32
42
  };
33
43
  /** `useRegister<HTMLTextAreaElement>(...)`로 좁혀 `<textarea>`에 spread할 수 있는 binding props다. */
34
44
  type SolidTextareaRegisterProps = SolidBindingHandlers<HTMLTextAreaElement> & {
45
+ /** DOM name string; tuple paths are JSON-serialized. */
35
46
  readonly name: string;
47
+ /** Current field value. */
36
48
  readonly value?: string | number;
37
49
  };
38
50
  /** DOM-compatible custom component용 escape-hatch binding props다. */
39
51
  type SolidCustomRegisterProps<TElement extends HTMLElement = HTMLElement> = SolidBindingHandlers<TElement> & {
52
+ /** DOM name string; tuple paths are JSON-serialized. */
40
53
  readonly name: string;
54
+ /** Current field value. */
41
55
  readonly value?: unknown;
56
+ /** Whether this checkbox or radio represents the current field value. */
42
57
  readonly checked?: boolean;
43
58
  };
44
59
  type SolidRegisterElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLElement;
@@ -50,39 +65,125 @@ type SolidRegisterPropsList<TElement extends SolidRegisterElement, TOptions exte
50
65
  };
51
66
  /** 한 field의 binding, value, meta, setter를 함께 제공한다. */
52
67
  type SolidFieldReturn<TProps extends SolidRegisterProps = SolidInputRegisterProps> = {
68
+ /** Binding properties to spread onto the matching DOM control. */
53
69
  readonly props: TProps;
70
+ /** Current field value. */
54
71
  readonly value: unknown;
72
+ /** Replace the field value as a programmatic write. */
55
73
  setValue(value: unknown): void;
74
+ /** Current validation errors for the field. */
56
75
  readonly errors: FormError[];
76
+ /** Whether the current value differs from its default by Object.is. */
57
77
  readonly dirty: boolean;
78
+ /** Whether the field has blurred at least once. */
58
79
  readonly touched: boolean;
59
80
  };
60
81
  /** form 전체 상태에서 Solid UI가 자주 쓰는 aggregate state다. */
61
82
  type SolidFormStateReturn<TValues> = {
83
+ /** Current immutable form snapshot. */
62
84
  readonly state: Readonly<FormState<TValues>>;
85
+ /** Nonempty validation error lists indexed by normalized field path. */
63
86
  readonly errors: Record<string, FormError[]>;
87
+ /** Normalized paths whose fields are dirty. */
64
88
  readonly dirtyFields: Record<string, true>;
89
+ /** Normalized paths whose fields are touched. */
65
90
  readonly touchedFields: Record<string, true>;
91
+ /** First focused field in entry order, or null; not necessarily the last focused field. */
66
92
  readonly focusedField: string | null;
93
+ /** Whether at least one field is dirty. */
67
94
  readonly isDirty: boolean;
95
+ /** Whether no field currently has recorded errors. */
68
96
  readonly isValid: boolean;
97
+ /** Whether queued validation or a submit callback is still pending. */
69
98
  readonly isSubmitting: boolean;
99
+ /** Whether a submission has completed at least once. */
70
100
  readonly isSubmitted: boolean;
101
+ /** Whether the latest completed submission reached a successful valid callback. */
71
102
  readonly isSubmitSuccessful: boolean;
103
+ /** Number of submission attempts started by the form. */
72
104
  readonly submitCount: number;
73
105
  };
74
106
  /** `useForm(form)`이 반환하는 form-bound helper 모음이다. */
75
107
  type SolidForm<TValues> = {
108
+ /** Core form instance shared by all bound helpers. */
76
109
  form: Form<TValues>;
110
+ /** Create one binding or an ordered list from single, array, or variadic options. */
77
111
  useRegister<TElement extends SolidRegisterElement = HTMLInputElement>(options: RegisterOptions): SolidRegisterPropsForElement<TElement>;
112
+ /** Create one binding or an ordered list from single, array, or variadic options. */
78
113
  useRegister<TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(options: TOptions): SolidRegisterPropsList<TElement, TOptions>;
114
+ /** Create one binding or an ordered list from single, array, or variadic options. */
79
115
  useRegister<TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(...options: TOptions): SolidRegisterPropsList<TElement, TOptions>;
116
+ /** Create field bindings, reactive value and metadata, and a setter. */
80
117
  useField<TElement extends SolidRegisterElement = HTMLInputElement>(options: RegisterOptions): SolidFieldReturn<SolidRegisterPropsForElement<TElement>>;
118
+ /** Subscribe to form-wide errors and lifecycle aggregates. */
81
119
  useFormState(): SolidFormStateReturn<TValues>;
120
+ /** Create an event handler that prevents default submission before validating. */
82
121
  handleSubmit<TResult>(onValid: SubmitValidHandler<TValues, TResult>, onInvalid?: SubmitInvalidHandler): SubmitHandler<Event, TResult>;
83
122
  };
84
123
 
85
- /** Solid helper surface를 core Form 인스턴스에 바인딩한다. */
124
+ /**
125
+ * @description Bind framework helpers to an existing form or create one from options; defined external-value reference changes reset it.
126
+ * @param {Form<TValues>} form - Core form instance shared by all bound helpers.
127
+ * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.
128
+ * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.
129
+ * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.
130
+ * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.
131
+ * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.
132
+ * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.
133
+ * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.
134
+ * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.
135
+ * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.
136
+ * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.
137
+ * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.
138
+ * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.
139
+ * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.
140
+ * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.
141
+ * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.
142
+ * @param {SolidFormOptions<TValues>} options - Default values, optional form schema, and automatic validation triggers.
143
+ * @param {TValues} options.defaultValues - Initial values and the baseline used for dirty checks and reset.
144
+ * @param {StandardSchemaV1<unknown, TValues> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.
145
+ * @param {StandardSchemaV1.Props<unknown, TValues>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.
146
+ * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.
147
+ * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.
148
+ * @param {StandardSchemaV1.Types<unknown, TValues> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.
149
+ * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.
150
+ * @param {TValues} [options.schema.~standard.types.output] - Schema output type metadata.
151
+ * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<TValues> | Promise<StandardSchemaV1.Result<TValues>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.
152
+ * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.
153
+ * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.
154
+ * @param {readonly ValidationTrigger[] | undefined} [options.validateOn] - Triggers that run automatic validation; defaults to submit.
155
+ * @param {Accessor<TValues | undefined> | undefined} [options.values] - Replacement values; defined reference changes reset the form.
156
+ * @param {ResetOptions | undefined} [options.resetOptions] - State preservation policy for external-value resets.
157
+ * @param {boolean | undefined} [options.resetOptions.keepDirtyValues] - Preserve current values and modified flags of dirty fields.
158
+ * @param {boolean | undefined} [options.resetOptions.keepErrors] - Preserve errors on surviving field paths.
159
+ * @param {boolean | undefined} [options.resetOptions.keepTouched] - Preserve touched flags on surviving field paths.
160
+ * @param {boolean | undefined} [options.resetOptions.keepSubmitState] - Preserve submission counters and lifecycle flags.
161
+ * @returns {SolidForm<TValues>} Core form and bound framework helpers sharing its state and lifecycle.
162
+ * - form `Form<TValues>` - Core form instance shared by all bound helpers.
163
+ * : form.getState `() => Readonly<FormState<TValues>>` - Read the current immutable form snapshot.
164
+ * : form.subscribe `(listener: () => void) => () => void` - Subscribe to state changes and return an unsubscribe callback.
165
+ * : form.registerFieldSchema `(path: FieldPathInput, options: FieldSchemaOptions) => () => void` - Register an overriding field-local validator and return its guarded cleanup.
166
+ * : form.getFieldState `(path: FieldPathInput) => Readonly<FieldState>` - Read field metadata, using a default snapshot for an unknown field.
167
+ * : form.getValue `(path: FieldPathInput) => unknown` - Read the current value of one field.
168
+ * : form.getValues `() => TValues` - Reconstruct nested values from fields and array containers.
169
+ * : form.setValue `(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void` - Write a field with configurable user or program origin and optional immediate validation.
170
+ * : form.blur `(path: FieldPathInput) => Promise<boolean>` - Clear focus, mark touched, and run configured blur validation.
171
+ * : form.focus `(path: FieldPathInput) => void` - Record focus for the selected field.
172
+ * : form.setErrors `(path: FieldPathInput, errors: readonly FormError[]) => void` - Replace all errors for the selected field.
173
+ * : form.clearErrors `(...paths: FieldPathInput[]) => void` - Clear selected fields, or all field errors when no paths are supplied.
174
+ * : form.trigger `(...paths: FieldPathInput[]) => Promise<boolean>` - Run manual validation for selected paths or the entire form.
175
+ * : form.array `(path: FieldPathInput) => FormArray` - Return commands that keep array values, keys, and child metadata aligned.
176
+ * : form.reset `(values?: TValues | undefined, options?: ResetOptions) => void` - Reinitialize from default or replacement values with optional preservation flags.
177
+ * : form.submit `<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>` - Queue validation and dispatch the valid or invalid callback.
178
+ * - useRegister `{ <TElement extends SolidRegisterElement = HTMLInputElement>(options: RegisterOptions): SolidRegisterPropsForElement<TElement>; <TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(options: TOptions): SolidRegisterPropsList<TElement, TOptions>; <TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(...options: TOptions): SolidRegisterPropsList<TElement, TOptions>; }` - Create one binding or an ordered list from single, array, or variadic options.
179
+ * - useField `<TElement extends SolidRegisterElement = HTMLInputElement>(options: RegisterOptions) => SolidFieldReturn<SolidRegisterPropsForElement<TElement>>` - Create field bindings, reactive value and metadata, and a setter.
180
+ * - useFormState `() => SolidFormStateReturn<TValues>` - Subscribe to form-wide errors and lifecycle aggregates.
181
+ * - handleSubmit `<TResult>(onValid: SubmitValidHandler<TValues, TResult>, onInvalid?: SubmitInvalidHandler) => SubmitHandler<Event, TResult>` - Create an event handler that prevents default submission before validating.
182
+ * @example
183
+ * ```ts
184
+ * const { form, handleSubmit } = useForm({ defaultValues: { email: "" } });
185
+ * ```
186
+ */
86
187
  declare function useForm<TValues>(form: Form<TValues>): SolidForm<TValues>;
87
188
  declare function useForm<TValues>(options: SolidFormOptions<TValues>): SolidForm<TValues>;
88
189
 
@@ -1,5 +1,5 @@
1
- import { isFormInstance, createFormFromOptions, createExternalValuesSynchronizer, createSubmitHandler, fieldPathToDomName, getFieldState, createDomBinding, createFormStateSummary } from '../chunk-JK644RR7.js';
2
- import '../chunk-4F4SAGQ5.js';
1
+ import { isFormInstance, createFormFromOptions, createExternalValuesSynchronizer, createSubmitHandler, fieldPathToDomName, getFieldState, createDomBinding, createFormStateSummary } from '../chunk-WO5TIXCR.js';
2
+ import '../chunk-M7Y4OJPP.js';
3
3
  import { getOwner, createRenderEffect, onCleanup, createSignal } from 'solid-js';
4
4
 
5
5
  // src/solid/RegisterBinding.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/solid/RegisterBinding.ts","../../src/solid/useFieldSchemaRegistration.ts","../../src/solid/useFormSnapshot.ts","../../src/solid/useField.ts","../../src/solid/useFormState.ts","../../src/solid/useRegister.ts","../../src/solid/useForm.ts"],"names":["onCleanup"],"mappings":";;;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AA,OAAe,IAAA,EAAM;AAChE,IAAA,MAAM,IAAI,UAAU,qDAAqD,CAAA;AAAA,EAC3E;AAEA,EAAA,MAAM,IAAA,GAAO,MAAA,GAAS,KAAA,GAAQ,qBAAA,CAAsB,KAAK,CAAA;AACzD,EAAA,IAAI,CAAC,MAAA,IAAU,KAAA,CAAM,MAAA,KAAW,MAAA,EAAW;AACzC,IAAA,MAAM,iBAAA,GAAoB,iCAAiC,IAAI,CAAA;AAC/D,IAAA,MAAM,SAAS,KAAA,CAAM,MAAA;AACrB,IAAA,MAAM,eAAe,KAAA,CAAM,YAAA;AAC3B,IAAA,kBAAA,CAAmB,MAAM;AACvB,MAAA,iBAAA,CAAkB,MAAA,IAAU,YAAY,CAAA;AAAA,IAC1C,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,WAAA,IAAe,CAAC,KAAA,EAAA,GAAwD,IAAA,KAAqC,oBAAoB,IAAA,EAAM,KAAA,EAAO,GAAG,IAAI,CAAA,CAAA;AAC3J,EAAA,MAAM,QAAA,IAAY,CAAC,OAAA,KAA6B,gBAAA,CAAiB,MAAM,OAAO,CAAA,CAAA;AAC9E,EAAA,MAAM,YAAA,GAAe,MAAsD,oBAAA,CAAqB,IAAI,CAAA;AACpG,EAAA,MAAM,gBAAgB,CAAC,OAAA,EAAS,cAAc,mBAAA,CAAoB,IAAA,EAAM,SAAS,SAAS,CAAA,CAAA;AAE1F,EAAA,OAAO,EAAE,IAAA,EAAM,WAAA,EAAa,QAAA,EAAU,cAAc,YAAA,EAAa;AACnE","file":"index.js","sourcesContent":["import type { FieldState, Form } from '../core/index';\nimport { createDomBinding, type FieldEventTarget, type RegisterOptions, fieldPathToDomName } from '../adapters/dom';\nimport type { SolidRegisterElement, SolidRegisterPropsForElement } from './types';\n\n/** Solid JSX spread용 binding props를 생성한다. */\nexport function createRegisterProps<TValues, TElement extends SolidRegisterElement>(\n form: Form<TValues>,\n options: RegisterOptions,\n getField: () => Readonly<FieldState>,\n domName: string,\n): SolidRegisterPropsForElement<TElement> {\n const binding = createDomBinding(form, options, getField, domName);\n const props = {\n name: binding.name,\n type: binding.type,\n get value() {\n return binding.value;\n },\n get checked() {\n return binding.checked;\n },\n onInput: (event: InputEvent & { currentTarget: HTMLElement }) => {\n binding.input(event.currentTarget as FieldEventTarget);\n },\n onChange: (event: Event & { currentTarget: HTMLElement }) => {\n binding.change(event.currentTarget as FieldEventTarget);\n },\n onBlur: () => {\n binding.blur();\n },\n onFocus: () => {\n binding.focus();\n },\n };\n\n return props as unknown as SolidRegisterPropsForElement<TElement>;\n}\n\nexport { fieldPathToDomName };\n","import { onCleanup } from 'solid-js';\nimport type { Form } from '../core/index';\nimport type { RegisterOptions } from './types';\n\n/** field-local schema를 Solid owner lifecycle에 맞춰 등록한다. */\nexport function useFieldSchemaRegistrations<TValues>(form: Form<TValues>, options: readonly RegisterOptions[]): void {\n const cleanups = options.flatMap(option => {\n if (!option.schema) {\n return [];\n }\n\n return [form.registerFieldSchema(option.name, { schema: option.schema, schemaOptions: option.schemaOptions })];\n });\n\n if (cleanups.length === 0) {\n return;\n }\n\n onCleanup(() => {\n cleanups.forEach(cleanup => cleanup());\n });\n}\n","import { createSignal, onCleanup, type Accessor } from 'solid-js';\nimport type { Form, FormState } from '../core/index';\n\n/** core form snapshot을 Solid signal로 연결한다. */\nexport function useFormSnapshot<TValues>(form: Form<TValues>): Accessor<Readonly<FormState<TValues>>> {\n const [snapshot, setSnapshot] = createSignal<Readonly<FormState<TValues>>>(form.getState(), { equals: false });\n const unsubscribe = form.subscribe(() => {\n setSnapshot(form.getState());\n });\n\n onCleanup(unsubscribe);\n\n return snapshot;\n}\n","import type { Form } from '../core/index';\nimport { getFieldState } from '../adapters/dom';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport type { RegisterOptions, SolidFieldReturn, SolidRegisterElement, SolidRegisterPropsForElement } from './types';\nimport { useFieldSchemaRegistrations } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/** 한 field의 binding, value, meta, setter를 함께 반환한다. */\nexport function useFieldWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): SolidFieldReturn<SolidRegisterPropsForElement<TElement>> {\n useFieldSchemaRegistrations(form, [options]);\n\n const snapshot = useFormSnapshot(form);\n const getField = () => getFieldState(form, snapshot(), options.name);\n const props = createRegisterProps<TValues, TElement>(form, options, getField, fieldPathToDomName(options.name));\n\n return {\n props,\n get value() {\n return getField().value;\n },\n setValue(value: unknown) {\n form.setValue(options.name, value, { source: 'program' });\n },\n get errors() {\n return [...getField().errors];\n },\n get dirty() {\n return getField().dirty;\n },\n get touched() {\n return getField().touched;\n },\n };\n}\n","import type { Form } from '../core/index';\nimport { createFormStateSummary } from '../adapters/FormStateSummary';\nimport type { SolidFormStateReturn } from './types';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/** form 전체 상태에서 Solid UI가 자주 쓰는 aggregate state를 반환한다. */\nexport function useFormStateWithForm<TValues>(form: Form<TValues>): SolidFormStateReturn<TValues> {\n const snapshot = useFormSnapshot(form);\n const getSummary = () => createFormStateSummary(snapshot());\n\n return {\n get state() {\n return snapshot();\n },\n get errors() {\n return getSummary().errors;\n },\n get dirtyFields() {\n return getSummary().dirtyFields;\n },\n get touchedFields() {\n return getSummary().touchedFields;\n },\n get focusedField() {\n return getSummary().focusedField;\n },\n get isDirty() {\n return getSummary().isDirty;\n },\n get isValid() {\n return getSummary().isValid;\n },\n get isSubmitting() {\n return getSummary().isSubmitting;\n },\n get isSubmitted() {\n return getSummary().isSubmitted;\n },\n get isSubmitSuccessful() {\n return getSummary().isSubmitSuccessful;\n },\n get submitCount() {\n return getSummary().submitCount;\n },\n };\n}\n","import type { Form } from '../core/index';\nimport { getFieldState } from '../adapters/dom';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport type { RegisterOptions, SolidRegisterElement, SolidRegisterPropsForElement, SolidRegisterPropsList } from './types';\nimport { useFieldSchemaRegistrations } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\nexport function useRegisterWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): SolidRegisterPropsForElement<TElement>;\nexport function useRegisterWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, options: TOptions): SolidRegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, ...options: TOptions): SolidRegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues>(form: Form<TValues>, first: RegisterOptions | readonly RegisterOptions[], ...rest: readonly RegisterOptions[]): SolidRegisterPropsForElement<SolidRegisterElement> | SolidRegisterPropsForElement<SolidRegisterElement>[];\n\n/** 단일 또는 여러 field의 Solid binding props를 만든다. */\nexport function useRegisterWithForm<TValues>(\n form: Form<TValues>,\n first: RegisterOptions | readonly RegisterOptions[],\n ...rest: readonly RegisterOptions[]\n): SolidRegisterPropsForElement<SolidRegisterElement> | SolidRegisterPropsForElement<SolidRegisterElement>[] {\n const shouldReturnList = Array.isArray(first) || rest.length > 0;\n const options = normalizeRegisterOptions(first, rest);\n\n useFieldSchemaRegistrations(form, options);\n\n const snapshot = useFormSnapshot(form);\n const bindings = options.map(option => createRegisterProps(\n form,\n option,\n () => getFieldState(form, snapshot(), option.name),\n fieldPathToDomName(option.name),\n ));\n\n return shouldReturnList ? bindings : bindings[0];\n}\n\nfunction normalizeRegisterOptions(first: RegisterOptions | readonly RegisterOptions[], rest: readonly RegisterOptions[]): readonly RegisterOptions[] {\n if (Array.isArray(first)) {\n return first as readonly RegisterOptions[];\n }\n\n if (rest.length > 0) {\n return [first as RegisterOptions, ...rest];\n }\n\n return [first as RegisterOptions];\n}\n","import { createRenderEffect, getOwner } from 'solid-js';\nimport { createSubmitHandler } from '../adapters/dom';\nimport {\n createExternalValuesSynchronizer,\n createFormFromOptions,\n isFormInstance,\n type FormInput,\n} from '../adapters/FormInput';\nimport type { Form } from '../core/index';\nimport type { RegisterOptions, SolidForm, SolidFormOptions } from './types';\nimport { useFieldWithForm } from './useField';\nimport { useFormStateWithForm } from './useFormState';\nimport { useRegisterWithForm } from './useRegister';\n\n/** Solid helper surface를 core Form 인스턴스에 바인딩한다. */\nexport function useForm<TValues>(form: Form<TValues>): SolidForm<TValues>;\nexport function useForm<TValues>(options: SolidFormOptions<TValues>): SolidForm<TValues>;\nexport function useForm<TValues>(input: FormInput<TValues, SolidFormOptions<TValues>>): SolidForm<TValues> {\n const isForm = isFormInstance(input);\n if (!isForm && input.values !== undefined && getOwner() === null) {\n throw new TypeError('Reactive Solid form options require an active owner');\n }\n\n const form = isForm ? input : createFormFromOptions(input);\n if (!isForm && input.values !== undefined) {\n const synchronizeValues = createExternalValuesSynchronizer(form);\n const values = input.values;\n const resetOptions = input.resetOptions;\n createRenderEffect(() => {\n synchronizeValues(values(), resetOptions);\n });\n }\n\n const useRegister = ((first: RegisterOptions | readonly RegisterOptions[], ...rest: readonly RegisterOptions[]) => useRegisterWithForm(form, first, ...rest)) as SolidForm<TValues>['useRegister'];\n const useField = ((options: RegisterOptions) => useFieldWithForm(form, options)) as SolidForm<TValues>['useField'];\n const useFormState = (): ReturnType<SolidForm<TValues>['useFormState']> => useFormStateWithForm(form);\n const handleSubmit = ((onValid, onInvalid) => createSubmitHandler(form, onValid, onInvalid)) as SolidForm<TValues>['handleSubmit'];\n\n return { form, useRegister, useField, useFormState, handleSubmit };\n}\n"]}
1
+ {"version":3,"sources":["../../src/solid/RegisterBinding.ts","../../src/solid/useFieldSchemaRegistration.ts","../../src/solid/useFormSnapshot.ts","../../src/solid/useField.ts","../../src/solid/useFormState.ts","../../src/solid/useRegister.ts","../../src/solid/useForm.ts"],"names":["onCleanup"],"mappings":";;;;;AA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AAe,IAAA,EAAM;AAChE,IAAA,MAAM,IAAI,UAAU,qDAAqD,CAAA;AAAA,EAC3E;AAEA,EAAA,MAAM,IAAA,GAAO,MAAA,GAAS,KAAA,GAAQ,qBAAA,CAAsB,KAAK,CAAA;AACzD,EAAA,IAAI,CAAC,MAAA,IAAU,KAAA,CAAM,MAAA,KAAW,MAAA,EAAW;AACzC,IAAA,MAAM,iBAAA,GAAoB,iCAAiC,IAAI,CAAA;AAC/D,IAAA,MAAM,SAAS,KAAA,CAAM,MAAA;AACrB,IAAA,MAAM,eAAe,KAAA,CAAM,YAAA;AAC3B,IAAA,kBAAA,CAAmB,MAAM;AACvB,MAAA,iBAAA,CAAkB,MAAA,IAAU,YAAY,CAAA;AAAA,IAC1C,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,WAAA,IAAe,CAAC,KAAA,EAAA,GAAwD,IAAA,KAAqC,oBAAoB,IAAA,EAAM,KAAA,EAAO,GAAG,IAAI,CAAA,CAAA;AAC3J,EAAA,MAAM,QAAA,IAAY,CAAC,OAAA,KAA6B,gBAAA,CAAiB,MAAM,OAAO,CAAA,CAAA;AAC9E,EAAA,MAAM,YAAA,GAAe,MAAsD,oBAAA,CAAqB,IAAI,CAAA;AACpG,EAAA,MAAM,gBAAgB,CAAC,OAAA,EAAS,cAAc,mBAAA,CAAoB,IAAA,EAAM,SAAS,SAAS,CAAA,CAAA;AAE1F,EAAA,OAAO,EAAE,IAAA,EAAM,WAAA,EAAa,QAAA,EAAU,cAAc,YAAA,EAAa;AACnE","file":"index.js","sourcesContent":["import type { FieldState, Form } from '../core/index';\nimport { createDomBinding, type FieldEventTarget, type RegisterOptions, fieldPathToDomName } from '../adapters/dom';\nimport type { SolidRegisterElement, SolidRegisterPropsForElement } from './types';\n\n/**\n * @description Create framework-specific DOM bindings that forward value, checked, change, blur, and focus behavior to the core form.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions} options - Field schema and DOM binding options.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @param {() => Readonly<FieldState>} getField - Read the latest field snapshot when a binding is accessed.\n * @param {string} domName - Name string assigned to the DOM control.\n * @returns {SolidRegisterPropsForElement<TElement>} Binding properties suitable for the selected framework and element type.\n * @example\n * ```ts\n * createRegisterProps(form, { name: \"email\" }, () => form.getFieldState(\"email\"), \"email\");\n * ```\n */\nexport function createRegisterProps<TValues, TElement extends SolidRegisterElement>(\n form: Form<TValues>,\n options: RegisterOptions,\n getField: () => Readonly<FieldState>,\n domName: string,\n): SolidRegisterPropsForElement<TElement> {\n const binding = createDomBinding(form, options, getField, domName);\n const props = {\n name: binding.name,\n type: binding.type,\n get value() {\n return binding.value;\n },\n get checked() {\n return binding.checked;\n },\n onInput: (event: InputEvent & { /** DOM element that owns the event listener. */\n currentTarget: HTMLElement }) => {\n binding.input(event.currentTarget as FieldEventTarget);\n },\n onChange: (event: Event & { /** DOM element that owns the event listener. */\n currentTarget: HTMLElement }) => {\n binding.change(event.currentTarget as FieldEventTarget);\n },\n onBlur: () => {\n binding.blur();\n },\n onFocus: () => {\n binding.focus();\n },\n };\n\n return props as unknown as SolidRegisterPropsForElement<TElement>;\n}\n\nexport { fieldPathToDomName };\n","import { onCleanup } from 'solid-js';\nimport type { Form } from '../core/index';\nimport type { RegisterOptions } from './types';\n\n/**\n * @description Register field-local schemas together and release them with the framework lifecycle.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {readonly RegisterOptions[]} options - Field schema and DOM binding options.\n * @example\n * ```ts\n * useFieldSchemaRegistrations(form, [{ name: \"email\", schema }]);\n * ```\n */\nexport function useFieldSchemaRegistrations<TValues>(form: Form<TValues>, options: readonly RegisterOptions[]): void {\n const cleanups = options.flatMap(option => {\n if (!option.schema) {\n return [];\n }\n\n return [form.registerFieldSchema(option.name, { schema: option.schema, schemaOptions: option.schemaOptions })];\n });\n\n if (cleanups.length === 0) {\n return;\n }\n\n onCleanup(() => {\n cleanups.forEach(cleanup => cleanup());\n });\n}\n","import { createSignal, onCleanup, type Accessor } from 'solid-js';\nimport type { Form, FormState } from '../core/index';\n\n/**\n * @description Subscribe the framework view to core form snapshots and release the subscription through its lifecycle.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @returns {Accessor<Readonly<FormState<TValues>>>} Framework subscription to current immutable snapshots.\n * @example\n * ```ts\n * useFormSnapshot(form);\n * ```\n */\nexport function useFormSnapshot<TValues>(form: Form<TValues>): Accessor<Readonly<FormState<TValues>>> {\n const [snapshot, setSnapshot] = createSignal<Readonly<FormState<TValues>>>(form.getState(), { equals: false });\n const unsubscribe = form.subscribe(() => {\n setSnapshot(form.getState());\n });\n\n onCleanup(unsubscribe);\n\n return snapshot;\n}\n","import type { Form } from '../core/index';\nimport { getFieldState } from '../adapters/dom';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport type { RegisterOptions, SolidFieldReturn, SolidRegisterElement, SolidRegisterPropsForElement } from './types';\nimport { useFieldSchemaRegistrations } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Bind one field to its framework view, exposing reactive bindings, copied errors, metadata, and a programmatic setter.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions} options - Field schema and DOM binding options.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @returns {SolidFieldReturn<SolidRegisterPropsForElement<TElement>>} Reactive field bindings, value, copied errors, flags, and programmatic setter.\n * - props `SolidRegisterPropsForElement<TElement>` - Binding properties to spread onto the matching DOM control.\n * - value `unknown` - Current field value.\n * - setValue `(value: unknown) => void` - Replace the field value as a programmatic write.\n * - errors `FormError[]` - Current validation errors for the field.\n * - dirty `boolean` - Whether the current value differs from its default by Object.is.\n * - touched `boolean` - Whether the field has blurred at least once.\n * @example\n * ```ts\n * useFieldWithForm(form, { name: \"email\", schema });\n * ```\n */\nexport function useFieldWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): SolidFieldReturn<SolidRegisterPropsForElement<TElement>> {\n useFieldSchemaRegistrations(form, [options]);\n\n const snapshot = useFormSnapshot(form);\n const getField = () => getFieldState(form, snapshot(), options.name);\n const props = createRegisterProps<TValues, TElement>(form, options, getField, fieldPathToDomName(options.name));\n\n return {\n props,\n get value() {\n return getField().value;\n },\n setValue(value: unknown) {\n form.setValue(options.name, value, { source: 'program' });\n },\n get errors() {\n return [...getField().errors];\n },\n get dirty() {\n return getField().dirty;\n },\n get touched() {\n return getField().touched;\n },\n };\n}\n","import type { Form } from '../core/index';\nimport { createFormStateSummary } from '../adapters/FormStateSummary';\nimport type { SolidFormStateReturn } from './types';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Subscribe to form-wide aggregates derived from the current core snapshot.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @returns {SolidFormStateReturn<TValues>} Reactive form-wide aggregates and submission flags.\n * - state `Readonly<FormState<TValues>>` - Current immutable form snapshot.\n * : state.defaultValues `TValues` - Initial values and the baseline used for dirty checks and reset.\n * : state.fields `Record<string, FieldState<unknown>>` - Field snapshots indexed by normalized path keys.\n * : state.submitCount `number` - Number of submission attempts started by the form.\n * : state.isSubmitting `boolean` - Whether queued validation or a submit callback is still pending.\n * : state.isSubmitted `boolean` - Whether a submission has completed at least once.\n * : state.isSubmitSuccessful `boolean` - Whether the latest completed submission reached a successful valid callback.\n * : state.arrayKeys `ArrayKeys` - Stable rendering keys indexed by array path.\n * - errors `Record<string, FormError[]>` - Nonempty validation error lists indexed by normalized field path.\n * - dirtyFields `Record<string, true>` - Normalized paths whose fields are dirty.\n * - touchedFields `Record<string, true>` - Normalized paths whose fields are touched.\n * - focusedField `string | null` - First focused field in entry order, or null; not necessarily the last focused field.\n * - isDirty `boolean` - Whether at least one field is dirty.\n * - isValid `boolean` - Whether no field currently has recorded errors.\n * - isSubmitting `boolean` - Whether queued validation or a submit callback is still pending.\n * - isSubmitted `boolean` - Whether a submission has completed at least once.\n * - isSubmitSuccessful `boolean` - Whether the latest completed submission reached a successful valid callback.\n * - submitCount `number` - Number of submission attempts started by the form.\n * @example\n * ```ts\n * useFormStateWithForm(form);\n * ```\n */\nexport function useFormStateWithForm<TValues>(form: Form<TValues>): SolidFormStateReturn<TValues> {\n const snapshot = useFormSnapshot(form);\n const getSummary = () => createFormStateSummary(snapshot());\n\n return {\n get state() {\n return snapshot();\n },\n get errors() {\n return getSummary().errors;\n },\n get dirtyFields() {\n return getSummary().dirtyFields;\n },\n get touchedFields() {\n return getSummary().touchedFields;\n },\n get focusedField() {\n return getSummary().focusedField;\n },\n get isDirty() {\n return getSummary().isDirty;\n },\n get isValid() {\n return getSummary().isValid;\n },\n get isSubmitting() {\n return getSummary().isSubmitting;\n },\n get isSubmitted() {\n return getSummary().isSubmitted;\n },\n get isSubmitSuccessful() {\n return getSummary().isSubmitSuccessful;\n },\n get submitCount() {\n return getSummary().submitCount;\n },\n };\n}\n","import type { Form } from '../core/index';\nimport { getFieldState } from '../adapters/dom';\nimport { createRegisterProps, fieldPathToDomName } from './RegisterBinding';\nimport type { RegisterOptions, SolidRegisterElement, SolidRegisterPropsForElement, SolidRegisterPropsList } from './types';\nimport { useFieldSchemaRegistrations } from './useFieldSchemaRegistration';\nimport { useFormSnapshot } from './useFormSnapshot';\n\n/**\n * @description Create a single binding or ordered binding list for single, array, or variadic registration options.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {RegisterOptions | TOptions} options - Single registration options or an ordered list; variadic calls use the same options order.\n * @param {FieldPathInput} options.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [options.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [options.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [options.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [options.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @param {RegisterOptions | readonly RegisterOptions[]} first - First single registration or ordered registration list.\n * @param {FieldPathInput} first.name - Literal field name or tuple path; strings are not split on dots.\n * @param {StandardSchemaV1<unknown, unknown> | undefined} [first.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, unknown>} [first.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [first.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [first.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, unknown> | undefined} [first.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [first.schema.~standard.types.input] - Schema input type metadata.\n * @param {unknown} [first.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<unknown> | Promise<StandardSchemaV1.Result<unknown>>} [first.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [first.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [first.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {string | undefined} [first.type] - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @param {unknown} [first.value] - Explicit option value used by checkbox and radio bindings.\n * @param {unknown} [first.checkedValue] - Value written by a checked checkbox; omitted for a boolean checkbox.\n * @param {unknown} [first.uncheckedValue] - Value written by an unchecked checkbox; defaults to false.\n * @param {readonly RegisterOptions[]} rest - Additional registration options for variadic binding creation.\n * @returns {SolidRegisterPropsForElement<TElement> | SolidRegisterPropsList<TElement, TOptions> | SolidRegisterPropsForElement<SolidRegisterElement> | SolidRegisterPropsForElement<SolidRegisterElement>[]} One binding for a single options object, otherwise bindings in supplied order.\n * - onInput `((event: InputEvent & { currentTarget: HTMLSelectElement; }) => void) | ((event: InputEvent & { currentTarget: HTMLElement; }) => void) | ((event: InputEvent & { currentTarget: HTMLInputElement; }) => void) | ((event: InputEvent & { currentTarget: HTMLTextAreaElement; }) => void)` - Forward text input events into the form.\n * - onChange `((event: Event & { currentTarget: HTMLSelectElement; }) => void) | ((event: Event & { currentTarget: HTMLElement; }) => void) | ((event: Event & { currentTarget: HTMLInputElement; }) => void) | ((event: Event & { currentTarget: HTMLTextAreaElement; }) => void)` - Forward change events, including checked and selection state, into the form.\n * - onBlur `((event: FocusEvent & { currentTarget: HTMLSelectElement; }) => void) | ((event: FocusEvent & { currentTarget: HTMLElement; }) => void) | ((event: FocusEvent & { currentTarget: HTMLInputElement; }) => void) | ((event: FocusEvent & { currentTarget: HTMLTextAreaElement; }) => void)` - Clear focus and mark the field touched.\n * - onFocus `((event: FocusEvent & { currentTarget: HTMLSelectElement; }) => void) | ((event: FocusEvent & { currentTarget: HTMLElement; }) => void) | ((event: FocusEvent & { currentTarget: HTMLInputElement; }) => void) | ((event: FocusEvent & { currentTarget: HTMLTextAreaElement; }) => void)` - Record focus for this field.\n * - name `string` - DOM name string; tuple paths are JSON-serialized.\n * - value `DomValue | undefined | unknown | string | number | undefined` - Current field value.\n * - checked `boolean | undefined` - Whether this checkbox or radio represents the current field value.\n * - type `string` - Input kind; checkbox and radio use checked semantics, otherwise defaults to text.\n * @example\n * ```ts\n * const email = useRegisterWithForm(form, { name: \"email\" });\n * const fields = useRegisterWithForm(form, [{ name: \"email\" }, { name: \"name\" }]);\n * ```\n */\nexport function useRegisterWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement>(form: Form<TValues>, options: RegisterOptions): SolidRegisterPropsForElement<TElement>;\nexport function useRegisterWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, options: TOptions): SolidRegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues, TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(form: Form<TValues>, ...options: TOptions): SolidRegisterPropsList<TElement, TOptions>;\nexport function useRegisterWithForm<TValues>(form: Form<TValues>, first: RegisterOptions | readonly RegisterOptions[], ...rest: readonly RegisterOptions[]): SolidRegisterPropsForElement<SolidRegisterElement> | SolidRegisterPropsForElement<SolidRegisterElement>[];\n\nexport function useRegisterWithForm<TValues>(\n form: Form<TValues>,\n first: RegisterOptions | readonly RegisterOptions[],\n ...rest: readonly RegisterOptions[]\n): SolidRegisterPropsForElement<SolidRegisterElement> | SolidRegisterPropsForElement<SolidRegisterElement>[] {\n const shouldReturnList = Array.isArray(first) || rest.length > 0;\n const options = normalizeRegisterOptions(first, rest);\n\n useFieldSchemaRegistrations(form, options);\n\n const snapshot = useFormSnapshot(form);\n const bindings = options.map(option => createRegisterProps(\n form,\n option,\n () => getFieldState(form, snapshot(), option.name),\n fieldPathToDomName(option.name),\n ));\n\n return shouldReturnList ? bindings : bindings[0];\n}\n\nfunction normalizeRegisterOptions(first: RegisterOptions | readonly RegisterOptions[], rest: readonly RegisterOptions[]): readonly RegisterOptions[] {\n if (Array.isArray(first)) {\n return first as readonly RegisterOptions[];\n }\n\n if (rest.length > 0) {\n return [first as RegisterOptions, ...rest];\n }\n\n return [first as RegisterOptions];\n}\n","import { createRenderEffect, getOwner } from 'solid-js';\nimport { createSubmitHandler } from '../adapters/dom';\nimport {\n createExternalValuesSynchronizer,\n createFormFromOptions,\n isFormInstance,\n type FormInput,\n} from '../adapters/FormInput';\nimport type { Form } from '../core/index';\nimport type { RegisterOptions, SolidForm, SolidFormOptions } from './types';\nimport { useFieldWithForm } from './useField';\nimport { useFormStateWithForm } from './useFormState';\nimport { useRegisterWithForm } from './useRegister';\n\n/**\n * @description Bind framework helpers to an existing form or create one from options; defined external-value reference changes reset it.\n * @param {Form<TValues>} form - Core form instance shared by all bound helpers.\n * @param {() => Readonly<FormState<TValues>>} form.getState - Read the current immutable form snapshot.\n * @param {(listener: () => void) => () => void} form.subscribe - Subscribe to state changes and return an unsubscribe callback.\n * @param {(path: FieldPathInput, options: FieldSchemaOptions) => () => void} form.registerFieldSchema - Register an overriding field-local validator and return its guarded cleanup.\n * @param {(path: FieldPathInput) => Readonly<FieldState>} form.getFieldState - Read field metadata, using a default snapshot for an unknown field.\n * @param {(path: FieldPathInput) => unknown} form.getValue - Read the current value of one field.\n * @param {() => TValues} form.getValues - Reconstruct nested values from fields and array containers.\n * @param {(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void} form.setValue - Write a field with configurable user or program origin and optional immediate validation.\n * @param {(path: FieldPathInput) => Promise<boolean>} form.blur - Clear focus, mark touched, and run configured blur validation.\n * @param {(path: FieldPathInput) => void} form.focus - Record focus for the selected field.\n * @param {(path: FieldPathInput, errors: readonly FormError[]) => void} form.setErrors - Replace all errors for the selected field.\n * @param {(...paths: FieldPathInput[]) => void} form.clearErrors - Clear selected fields, or all field errors when no paths are supplied.\n * @param {(...paths: FieldPathInput[]) => Promise<boolean>} form.trigger - Run manual validation for selected paths or the entire form.\n * @param {(path: FieldPathInput) => FormArray} form.array - Return commands that keep array values, keys, and child metadata aligned.\n * @param {(values?: TValues | undefined, options?: ResetOptions) => void} form.reset - Reinitialize from default or replacement values with optional preservation flags.\n * @param {<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>} form.submit - Queue validation and dispatch the valid or invalid callback.\n * @param {SolidFormOptions<TValues>} options - Default values, optional form schema, and automatic validation triggers.\n * @param {TValues} options.defaultValues - Initial values and the baseline used for dirty checks and reset.\n * @param {StandardSchemaV1<unknown, TValues> | undefined} [options.schema] - Standard Schema validator; a field-local schema takes precedence over the form schema.\n * @param {StandardSchemaV1.Props<unknown, TValues>} [options.schema.~standard] - Standard Schema version, vendor, type metadata, and validation entry point.\n * @param {1} [options.schema.~standard.version] - Standard Schema major version, which must be 1.\n * @param {string} [options.schema.~standard.vendor] - Name of the schema library implementation.\n * @param {StandardSchemaV1.Types<unknown, TValues> | undefined} [options.schema.~standard.types] - Optional compile-time input and output metadata.\n * @param {unknown} [options.schema.~standard.types.input] - Schema input type metadata.\n * @param {TValues} [options.schema.~standard.types.output] - Schema output type metadata.\n * @param {(value: unknown, options?: StandardSchemaV1.Options | undefined) => StandardSchemaV1.Result<TValues> | Promise<StandardSchemaV1.Result<TValues>>} [options.schema.~standard.validate] - Validate unknown input and return accepted values or issues, synchronously or asynchronously.\n * @param {StandardSchemaV1.Options | undefined} [options.schemaOptions] - Options forwarded to the Standard Schema validator.\n * @param {Record<string, unknown> | undefined} [options.schemaOptions.libraryOptions] - Library-specific validation options; keys are defined by the schema library.\n * @param {readonly ValidationTrigger[] | undefined} [options.validateOn] - Triggers that run automatic validation; defaults to submit.\n * @param {Accessor<TValues | undefined> | undefined} [options.values] - Replacement values; defined reference changes reset the form.\n * @param {ResetOptions | undefined} [options.resetOptions] - State preservation policy for external-value resets.\n * @param {boolean | undefined} [options.resetOptions.keepDirtyValues] - Preserve current values and modified flags of dirty fields.\n * @param {boolean | undefined} [options.resetOptions.keepErrors] - Preserve errors on surviving field paths.\n * @param {boolean | undefined} [options.resetOptions.keepTouched] - Preserve touched flags on surviving field paths.\n * @param {boolean | undefined} [options.resetOptions.keepSubmitState] - Preserve submission counters and lifecycle flags.\n * @returns {SolidForm<TValues>} Core form and bound framework helpers sharing its state and lifecycle.\n * - form `Form<TValues>` - Core form instance shared by all bound helpers.\n * : form.getState `() => Readonly<FormState<TValues>>` - Read the current immutable form snapshot.\n * : form.subscribe `(listener: () => void) => () => void` - Subscribe to state changes and return an unsubscribe callback.\n * : form.registerFieldSchema `(path: FieldPathInput, options: FieldSchemaOptions) => () => void` - Register an overriding field-local validator and return its guarded cleanup.\n * : form.getFieldState `(path: FieldPathInput) => Readonly<FieldState>` - Read field metadata, using a default snapshot for an unknown field.\n * : form.getValue `(path: FieldPathInput) => unknown` - Read the current value of one field.\n * : form.getValues `() => TValues` - Reconstruct nested values from fields and array containers.\n * : form.setValue `(path: FieldPathInput, value: unknown, options?: SetValueOptions) => void` - Write a field with configurable user or program origin and optional immediate validation.\n * : form.blur `(path: FieldPathInput) => Promise<boolean>` - Clear focus, mark touched, and run configured blur validation.\n * : form.focus `(path: FieldPathInput) => void` - Record focus for the selected field.\n * : form.setErrors `(path: FieldPathInput, errors: readonly FormError[]) => void` - Replace all errors for the selected field.\n * : form.clearErrors `(...paths: FieldPathInput[]) => void` - Clear selected fields, or all field errors when no paths are supplied.\n * : form.trigger `(...paths: FieldPathInput[]) => Promise<boolean>` - Run manual validation for selected paths or the entire form.\n * : form.array `(path: FieldPathInput) => FormArray` - Return commands that keep array values, keys, and child metadata aligned.\n * : form.reset `(values?: TValues | undefined, options?: ResetOptions) => void` - Reinitialize from default or replacement values with optional preservation flags.\n * : form.submit `<TResult>(onValid: (values: TValues) => TResult | Promise<TResult>, onInvalid?: (fields: Readonly<Record<PathKey, FieldState>>) => void) => Promise<TResult | undefined>` - Queue validation and dispatch the valid or invalid callback.\n * - useRegister `{ <TElement extends SolidRegisterElement = HTMLInputElement>(options: RegisterOptions): SolidRegisterPropsForElement<TElement>; <TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(options: TOptions): SolidRegisterPropsList<TElement, TOptions>; <TElement extends SolidRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(...options: TOptions): SolidRegisterPropsList<TElement, TOptions>; }` - Create one binding or an ordered list from single, array, or variadic options.\n * - useField `<TElement extends SolidRegisterElement = HTMLInputElement>(options: RegisterOptions) => SolidFieldReturn<SolidRegisterPropsForElement<TElement>>` - Create field bindings, reactive value and metadata, and a setter.\n * - useFormState `() => SolidFormStateReturn<TValues>` - Subscribe to form-wide errors and lifecycle aggregates.\n * - handleSubmit `<TResult>(onValid: SubmitValidHandler<TValues, TResult>, onInvalid?: SubmitInvalidHandler) => SubmitHandler<Event, TResult>` - Create an event handler that prevents default submission before validating.\n * @example\n * ```ts\n * const { form, handleSubmit } = useForm({ defaultValues: { email: \"\" } });\n * ```\n */\nexport function useForm<TValues>(form: Form<TValues>): SolidForm<TValues>;\nexport function useForm<TValues>(options: SolidFormOptions<TValues>): SolidForm<TValues>;\nexport function useForm<TValues>(input: FormInput<TValues, SolidFormOptions<TValues>>): SolidForm<TValues> {\n const isForm = isFormInstance(input);\n if (!isForm && input.values !== undefined && getOwner() === null) {\n throw new TypeError('Reactive Solid form options require an active owner');\n }\n\n const form = isForm ? input : createFormFromOptions(input);\n if (!isForm && input.values !== undefined) {\n const synchronizeValues = createExternalValuesSynchronizer(form);\n const values = input.values;\n const resetOptions = input.resetOptions;\n createRenderEffect(() => {\n synchronizeValues(values(), resetOptions);\n });\n }\n\n const useRegister = ((first: RegisterOptions | readonly RegisterOptions[], ...rest: readonly RegisterOptions[]) => useRegisterWithForm(form, first, ...rest)) as SolidForm<TValues>['useRegister'];\n const useField = ((options: RegisterOptions) => useFieldWithForm(form, options)) as SolidForm<TValues>['useField'];\n const useFormState = (): ReturnType<SolidForm<TValues>['useFormState']> => useFormStateWithForm(form);\n const handleSubmit = ((onValid, onInvalid) => createSubmitHandler(form, onValid, onInvalid)) as SolidForm<TValues>['handleSubmit'];\n\n return { form, useRegister, useField, useFormState, handleSubmit };\n}\n"]}