attaform 0.26.0 → 0.27.0
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.
- package/README.md +21 -11
- package/bin/attaform.mjs +78 -0
- package/dist/abstract.cjs +47 -0
- package/dist/abstract.cjs.map +1 -0
- package/dist/abstract.d.cts +42 -0
- package/dist/abstract.d.mts +42 -0
- package/dist/abstract.d.ts +42 -0
- package/dist/abstract.mjs +4 -0
- package/dist/abstract.mjs.map +1 -0
- package/dist/chunks/devtools.cjs +2 -2
- package/dist/chunks/devtools.cjs.map +1 -1
- package/dist/chunks/devtools.mjs +1 -1
- package/dist/chunks/fingerprint2.cjs +1 -1
- package/dist/chunks/fingerprint2.mjs +1 -1
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.cjs.map +1 -1
- package/dist/esbuild.d.cts +3 -3
- package/dist/esbuild.d.mts +3 -3
- package/dist/esbuild.d.ts +3 -3
- package/dist/esbuild.mjs +2 -2
- package/dist/esbuild.mjs.map +1 -1
- package/dist/index.cjs +41 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +194 -282
- package/dist/index.d.mts +194 -282
- package/dist/index.d.ts +194 -282
- package/dist/index.mjs +4 -25
- package/dist/index.mjs.map +1 -1
- package/dist/nuxt.cjs +3 -1
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.d.cts +17 -4
- package/dist/nuxt.d.mts +17 -4
- package/dist/nuxt.d.ts +17 -4
- package/dist/nuxt.mjs +4 -2
- package/dist/nuxt.mjs.map +1 -1
- package/dist/rollup.cjs +2 -2
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.cts +3 -3
- package/dist/rollup.d.mts +3 -3
- package/dist/rollup.d.ts +3 -3
- package/dist/rollup.mjs +2 -2
- package/dist/rollup.mjs.map +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.mts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/runtime/plugins/attaform.cjs +4 -5
- package/dist/runtime/plugins/attaform.cjs.map +1 -1
- package/dist/runtime/plugins/attaform.mjs +1 -2
- package/dist/runtime/plugins/attaform.mjs.map +1 -1
- package/dist/shared/{attaform.BRzKBj2g.cjs → attaform.8tFZu1Ub.cjs} +2 -2
- package/dist/shared/{attaform.BRzKBj2g.cjs.map → attaform.8tFZu1Ub.cjs.map} +1 -1
- package/dist/shared/{attaform.k9V0py0s.mjs → attaform.BERt5YMU.mjs} +2 -2
- package/dist/shared/{attaform.k9V0py0s.mjs.map → attaform.BERt5YMU.mjs.map} +1 -1
- package/dist/shared/{attaform.DSOIz08n.mjs → attaform.BceJrhQ7.mjs} +5 -5
- package/dist/shared/{attaform.DSOIz08n.mjs.map → attaform.BceJrhQ7.mjs.map} +1 -1
- package/dist/shared/{attaform.DBNjHgNj.d.cts → attaform.C3WnCDXz.d.cts} +11 -9
- package/dist/shared/{attaform.DBNjHgNj.d.mts → attaform.C3WnCDXz.d.mts} +11 -9
- package/dist/shared/{attaform.DBNjHgNj.d.ts → attaform.C3WnCDXz.d.ts} +11 -9
- package/dist/shared/{attaform.DuzQYscR.d.mts → attaform.C9fPTxjB.d.cts} +5 -5
- package/dist/shared/{attaform.DuzQYscR.d.ts → attaform.C9fPTxjB.d.mts} +5 -5
- package/dist/shared/{attaform.DuzQYscR.d.cts → attaform.C9fPTxjB.d.ts} +5 -5
- package/dist/shared/{attaform.Be5otUVw.d.ts → attaform.CC_y1_Ej.d.ts} +33 -33
- package/dist/shared/{attaform.ceYeVkjn.d.ts → attaform.CEXUlUkc.d.ts} +1579 -1192
- package/dist/shared/{attaform.tZ0YKisf.cjs → attaform.C__F01CE.cjs} +15 -15
- package/dist/shared/{attaform.tZ0YKisf.cjs.map → attaform.C__F01CE.cjs.map} +1 -1
- package/dist/shared/{attaform.BPl-ECRT.cjs → attaform.Co5LNRnv.cjs} +162 -129
- package/dist/shared/attaform.Co5LNRnv.cjs.map +1 -0
- package/dist/shared/{attaform.B71rfNL5.d.mts → attaform.CpXHK60W.d.cts} +33 -33
- package/dist/shared/{attaform.BFfY7HRI.d.cts → attaform.CvVYOvZF.d.mts} +33 -33
- package/dist/shared/{attaform.BoYqnIPI.mjs → attaform.CyQxTOdX.mjs} +55 -36
- package/dist/shared/attaform.CyQxTOdX.mjs.map +1 -0
- package/dist/shared/{attaform.CEY_WLRJ.d.mts → attaform.D99pd7JG.d.cts} +1579 -1192
- package/dist/shared/{attaform.CXVmZtFq.mjs → attaform.DDAmSFnl.mjs} +4 -4
- package/dist/shared/{attaform.CXVmZtFq.mjs.map → attaform.DDAmSFnl.mjs.map} +1 -1
- package/dist/shared/{attaform.Du9RZp8m.cjs → attaform.DQT7_-FO.cjs} +272 -252
- package/dist/shared/attaform.DQT7_-FO.cjs.map +1 -0
- package/dist/shared/{attaform.DGhIix5D.mjs → attaform.Da8EdI2t.mjs} +160 -129
- package/dist/shared/attaform.Da8EdI2t.mjs.map +1 -0
- package/dist/shared/{attaform.Cs0UZ7q6.cjs → attaform.DhVgG2jh.cjs} +16 -16
- package/dist/shared/{attaform.Cs0UZ7q6.cjs.map → attaform.DhVgG2jh.cjs.map} +1 -1
- package/dist/shared/{attaform.sHkHv_98.mjs → attaform.DhnPb6nK.mjs} +6 -3
- package/dist/shared/attaform.DhnPb6nK.mjs.map +1 -0
- package/dist/shared/attaform.DkD0DR7R.mjs +42 -0
- package/dist/shared/attaform.DkD0DR7R.mjs.map +1 -0
- package/dist/shared/{attaform.CSXDW2tO.mjs → attaform.DlSu08F5.mjs} +4 -4
- package/dist/shared/{attaform.CSXDW2tO.mjs.map → attaform.DlSu08F5.mjs.map} +1 -1
- package/dist/shared/{attaform.LEWUFqUw.cjs → attaform.DoQm_Vkd.cjs} +7 -3
- package/dist/shared/attaform.DoQm_Vkd.cjs.map +1 -0
- package/dist/shared/{attaform.BQflyVOL.cjs → attaform.Drsi43GG.cjs} +19 -19
- package/dist/shared/{attaform.BQflyVOL.cjs.map → attaform.Drsi43GG.cjs.map} +1 -1
- package/dist/shared/attaform.K6Thc6By.cjs +46 -0
- package/dist/shared/attaform.K6Thc6By.cjs.map +1 -0
- package/dist/shared/{attaform.Vp2-CWZB.mjs → attaform.KvlEedlF.mjs} +3 -3
- package/dist/shared/{attaform.Vp2-CWZB.mjs.map → attaform.KvlEedlF.mjs.map} +1 -1
- package/dist/shared/{attaform.BRGIpZo4.cjs → attaform.RaTzp1WF.cjs} +3 -3
- package/dist/shared/attaform.RaTzp1WF.cjs.map +1 -0
- package/dist/shared/{attaform.MgaYKlPP.d.cts → attaform.kBkYlKP_.d.mts} +1579 -1192
- package/dist/shared/{attaform.C3Doa9Pt.mjs → attaform.v0fQtWyA.mjs} +3 -3
- package/dist/shared/attaform.v0fQtWyA.mjs.map +1 -0
- package/dist/shared/{attaform.ZXZ6dH72.cjs → attaform.yUrz7C2z.cjs} +3 -3
- package/dist/shared/{attaform.ZXZ6dH72.cjs.map → attaform.yUrz7C2z.cjs.map} +1 -1
- package/dist/transforms.cjs +1 -1
- package/dist/transforms.mjs +1 -1
- package/dist/vite.cjs +21 -3
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +70 -17
- package/dist/vite.d.mts +70 -17
- package/dist/vite.d.ts +70 -17
- package/dist/vite.mjs +20 -4
- package/dist/vite.mjs.map +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.mjs +1 -1
- package/dist/zod-v3.cjs +41 -10
- package/dist/zod-v3.cjs.map +1 -1
- package/dist/zod-v3.d.cts +5 -5
- package/dist/zod-v3.d.mts +5 -5
- package/dist/zod-v3.d.ts +5 -5
- package/dist/zod-v3.mjs +4 -2
- package/dist/zod-v3.mjs.map +1 -1
- package/dist/zod-v4.cjs +41 -10
- package/dist/zod-v4.cjs.map +1 -1
- package/dist/zod-v4.d.cts +7 -7
- package/dist/zod-v4.d.mts +7 -7
- package/dist/zod-v4.d.ts +7 -7
- package/dist/zod-v4.mjs +4 -2
- package/dist/zod-v4.mjs.map +1 -1
- package/dist/zod.cjs +44 -49
- package/dist/zod.cjs.map +1 -1
- package/dist/zod.d.cts +6 -248
- package/dist/zod.d.mts +6 -248
- package/dist/zod.d.ts +6 -248
- package/dist/zod.mjs +4 -42
- package/dist/zod.mjs.map +1 -1
- package/package.json +12 -2
- package/skills/attaform/SKILL.md +128 -0
- package/skills/attaform/references/custom-components.md +72 -0
- package/skills/attaform/references/errors.md +62 -0
- package/skills/attaform/references/ssr.md +26 -0
- package/skills/attaform/references/validation.md +40 -0
- package/skills/attaform/references/wizards.md +104 -0
- package/dist/shared/attaform.55hFR_cl.d.ts +0 -97
- package/dist/shared/attaform.BPl-ECRT.cjs.map +0 -1
- package/dist/shared/attaform.BRGIpZo4.cjs.map +0 -1
- package/dist/shared/attaform.BoYqnIPI.mjs.map +0 -1
- package/dist/shared/attaform.C3Doa9Pt.mjs.map +0 -1
- package/dist/shared/attaform.D51IwDtP.cjs +0 -39
- package/dist/shared/attaform.D51IwDtP.cjs.map +0 -1
- package/dist/shared/attaform.DGhIix5D.mjs.map +0 -1
- package/dist/shared/attaform.DJRz_bzM.d.cts +0 -97
- package/dist/shared/attaform.Du9RZp8m.cjs.map +0 -1
- package/dist/shared/attaform.JPsaqjLl.d.mts +0 -97
- package/dist/shared/attaform.LEWUFqUw.cjs.map +0 -1
- package/dist/shared/attaform.NqYEzRcM.mjs +0 -35
- package/dist/shared/attaform.NqYEzRcM.mjs.map +0 -1
- package/dist/shared/attaform.sHkHv_98.mjs.map +0 -1
- package/dist/shared/{attaform.DdjDqTah.d.ts → attaform.DRUT703x.d.cts} +14 -14
- package/dist/shared/{attaform.DdjDqTah.d.cts → attaform.DRUT703x.d.mts} +14 -14
- package/dist/shared/{attaform.DdjDqTah.d.mts → attaform.DRUT703x.d.ts} +14 -14
|
@@ -2164,12 +2164,13 @@ type GetDisplayState = (prev: DisplayMachine, ctx: DisplayCtx) => DisplayMachine
|
|
|
2164
2164
|
* it to a `<form>`:
|
|
2165
2165
|
*
|
|
2166
2166
|
* ```vue
|
|
2167
|
-
* <form @submit
|
|
2167
|
+
* <form @submit="onSubmit">…</form>
|
|
2168
2168
|
* ```
|
|
2169
2169
|
*
|
|
2170
|
-
* It
|
|
2171
|
-
*
|
|
2172
|
-
*
|
|
2170
|
+
* It accepts the originating `Event` and calls `event.preventDefault()`
|
|
2171
|
+
* itself, so bind it with `@submit`, not `@submit.prevent` (the
|
|
2172
|
+
* modifier would only prevent the default a second time). Called
|
|
2173
|
+
* imperatively with no event, the `preventDefault` step is skipped.
|
|
2173
2174
|
*/
|
|
2174
2175
|
type SubmitHandler = (event?: Event) => Promise<void>;
|
|
2175
2176
|
/**
|
|
@@ -3787,7 +3788,7 @@ type FormMeta<F = unknown> = FieldState<F> & {
|
|
|
3787
3788
|
* of each new submission attempt; stays `null` on success.
|
|
3788
3789
|
*
|
|
3789
3790
|
* The submit handler does NOT re-throw — its returned promise always
|
|
3790
|
-
* resolves, so binding it to `@submit
|
|
3791
|
+
* resolves, so binding it to `@submit` never manufactures a
|
|
3791
3792
|
* `window` unhandledrejection. This is the channel for an UNEXPECTED
|
|
3792
3793
|
* submit failure (a thrown exception or rejected promise), read the
|
|
3793
3794
|
* same way in templates and after an imperative `await submit()`. An
|
|
@@ -3948,10 +3949,11 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
3948
3949
|
* Wraps your submit logic with validation and error routing.
|
|
3949
3950
|
*
|
|
3950
3951
|
* ```ts
|
|
3951
|
-
*
|
|
3952
|
+
* const onSubmit = form.handleSubmit(
|
|
3952
3953
|
* (data) => api.signup(data),
|
|
3953
3954
|
* (errors) => console.log(errors),
|
|
3954
|
-
* )
|
|
3955
|
+
* )
|
|
3956
|
+
* // Bind the returned handler: <form @submit="onSubmit">
|
|
3955
3957
|
* ```
|
|
3956
3958
|
*
|
|
3957
3959
|
* `data` is the strictly-typed parsed value — refinements have
|
|
@@ -4646,5 +4648,5 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
4646
4648
|
blankPaths: ComputedRef<BlankPathsView>;
|
|
4647
4649
|
};
|
|
4648
4650
|
|
|
4649
|
-
export { ROOT_PATH as
|
|
4650
|
-
export type {
|
|
4651
|
+
export { ROOT_PATH as X, ROOT_PATH_KEY as Y, canonicalizePath as al, isPathPrefix as am, isUnset as an, parseDottedPath as ao, unset as ap };
|
|
4652
|
+
export type { RegisterFlatPath as $, AbstractSchema as A, NestedType as B, CoercionEntry as C, DefaultValuesInput as D, ErrorInput as E, FormKey as F, GenericForm as G, HandleSubmit as H, IsTuple as I, JoinSegments as J, KeyofUnion as K, LiftedValueShape as L, MetaTrackerValue as M, NestedReadType as N, OnError as O, OnInvalidSubmitPolicy as P, OnSubmit as Q, PartialFlatPath as R, Path as S, PathKey as T, UseFormConfiguration as U, PendingValidationStatus as V, Primitive as W, ReactiveValidationStatus as Z, RegisterDirective as _, UseFormReturnType as a, RegisterOptions as a0, RegisterSelectModifier as a1, RegisterTextModifier as a2, RegisterTransform as a3, RegisterValue as a4, Segment as a5, SetValueCallback as a6, SetValuePayload as a7, SettledValidationStatus as a8, SlimPrimitiveKind as a9, SlimRuntimeOf as aa, SubmitHandler as ab, Unset as ac, ValidateOn as ad, ValidateOnConfig as ae, ValidationError as af, ValidationResponse as ag, ValidationResponseWithoutValue as ah, ValueOfUnion as ai, WriteMeta as aj, WriteShape as ak, AcceptableDefaults as aq, SchemaFactoryOptions as ar, TransformAbortHolder as as, RegisterModelDynamicCustomDirective as at, ArrayItem as b, ArrayPath as c, AttaformDefaults as d, CoercionRegistry as e, CoercionResult as f, CustomDirectiveRegisterAssignerFn as g, DeepPartial as h, DefaultValuesResponse as i, DefaultValuesShape as j, DisplayCtx as k, DisplayMachine as l, DisplayState as m, ErrorsProxyShape as n, FieldMetaPayload as o, FieldState as p, FieldStateMap as q, FieldStateMapEntry as r, FlatPath as s, FormErrorRecord as t, FormErrorsSurface as u, FormMeta as v, GetDisplayState as w, HistoryConfig as x, IsUnion as y, Json as z };
|
|
@@ -2164,12 +2164,13 @@ type GetDisplayState = (prev: DisplayMachine, ctx: DisplayCtx) => DisplayMachine
|
|
|
2164
2164
|
* it to a `<form>`:
|
|
2165
2165
|
*
|
|
2166
2166
|
* ```vue
|
|
2167
|
-
* <form @submit
|
|
2167
|
+
* <form @submit="onSubmit">…</form>
|
|
2168
2168
|
* ```
|
|
2169
2169
|
*
|
|
2170
|
-
* It
|
|
2171
|
-
*
|
|
2172
|
-
*
|
|
2170
|
+
* It accepts the originating `Event` and calls `event.preventDefault()`
|
|
2171
|
+
* itself, so bind it with `@submit`, not `@submit.prevent` (the
|
|
2172
|
+
* modifier would only prevent the default a second time). Called
|
|
2173
|
+
* imperatively with no event, the `preventDefault` step is skipped.
|
|
2173
2174
|
*/
|
|
2174
2175
|
type SubmitHandler = (event?: Event) => Promise<void>;
|
|
2175
2176
|
/**
|
|
@@ -3787,7 +3788,7 @@ type FormMeta<F = unknown> = FieldState<F> & {
|
|
|
3787
3788
|
* of each new submission attempt; stays `null` on success.
|
|
3788
3789
|
*
|
|
3789
3790
|
* The submit handler does NOT re-throw — its returned promise always
|
|
3790
|
-
* resolves, so binding it to `@submit
|
|
3791
|
+
* resolves, so binding it to `@submit` never manufactures a
|
|
3791
3792
|
* `window` unhandledrejection. This is the channel for an UNEXPECTED
|
|
3792
3793
|
* submit failure (a thrown exception or rejected promise), read the
|
|
3793
3794
|
* same way in templates and after an imperative `await submit()`. An
|
|
@@ -3948,10 +3949,11 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
3948
3949
|
* Wraps your submit logic with validation and error routing.
|
|
3949
3950
|
*
|
|
3950
3951
|
* ```ts
|
|
3951
|
-
*
|
|
3952
|
+
* const onSubmit = form.handleSubmit(
|
|
3952
3953
|
* (data) => api.signup(data),
|
|
3953
3954
|
* (errors) => console.log(errors),
|
|
3954
|
-
* )
|
|
3955
|
+
* )
|
|
3956
|
+
* // Bind the returned handler: <form @submit="onSubmit">
|
|
3955
3957
|
* ```
|
|
3956
3958
|
*
|
|
3957
3959
|
* `data` is the strictly-typed parsed value — refinements have
|
|
@@ -4646,5 +4648,5 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
4646
4648
|
blankPaths: ComputedRef<BlankPathsView>;
|
|
4647
4649
|
};
|
|
4648
4650
|
|
|
4649
|
-
export { ROOT_PATH as
|
|
4650
|
-
export type {
|
|
4651
|
+
export { ROOT_PATH as X, ROOT_PATH_KEY as Y, canonicalizePath as al, isPathPrefix as am, isUnset as an, parseDottedPath as ao, unset as ap };
|
|
4652
|
+
export type { RegisterFlatPath as $, AbstractSchema as A, NestedType as B, CoercionEntry as C, DefaultValuesInput as D, ErrorInput as E, FormKey as F, GenericForm as G, HandleSubmit as H, IsTuple as I, JoinSegments as J, KeyofUnion as K, LiftedValueShape as L, MetaTrackerValue as M, NestedReadType as N, OnError as O, OnInvalidSubmitPolicy as P, OnSubmit as Q, PartialFlatPath as R, Path as S, PathKey as T, UseFormConfiguration as U, PendingValidationStatus as V, Primitive as W, ReactiveValidationStatus as Z, RegisterDirective as _, UseFormReturnType as a, RegisterOptions as a0, RegisterSelectModifier as a1, RegisterTextModifier as a2, RegisterTransform as a3, RegisterValue as a4, Segment as a5, SetValueCallback as a6, SetValuePayload as a7, SettledValidationStatus as a8, SlimPrimitiveKind as a9, SlimRuntimeOf as aa, SubmitHandler as ab, Unset as ac, ValidateOn as ad, ValidateOnConfig as ae, ValidationError as af, ValidationResponse as ag, ValidationResponseWithoutValue as ah, ValueOfUnion as ai, WriteMeta as aj, WriteShape as ak, AcceptableDefaults as aq, SchemaFactoryOptions as ar, TransformAbortHolder as as, RegisterModelDynamicCustomDirective as at, ArrayItem as b, ArrayPath as c, AttaformDefaults as d, CoercionRegistry as e, CoercionResult as f, CustomDirectiveRegisterAssignerFn as g, DeepPartial as h, DefaultValuesResponse as i, DefaultValuesShape as j, DisplayCtx as k, DisplayMachine as l, DisplayState as m, ErrorsProxyShape as n, FieldMetaPayload as o, FieldState as p, FieldStateMap as q, FieldStateMapEntry as r, FlatPath as s, FormErrorRecord as t, FormErrorsSurface as u, FormMeta as v, GetDisplayState as w, HistoryConfig as x, IsUnion as y, Json as z };
|
|
@@ -2164,12 +2164,13 @@ type GetDisplayState = (prev: DisplayMachine, ctx: DisplayCtx) => DisplayMachine
|
|
|
2164
2164
|
* it to a `<form>`:
|
|
2165
2165
|
*
|
|
2166
2166
|
* ```vue
|
|
2167
|
-
* <form @submit
|
|
2167
|
+
* <form @submit="onSubmit">…</form>
|
|
2168
2168
|
* ```
|
|
2169
2169
|
*
|
|
2170
|
-
* It
|
|
2171
|
-
*
|
|
2172
|
-
*
|
|
2170
|
+
* It accepts the originating `Event` and calls `event.preventDefault()`
|
|
2171
|
+
* itself, so bind it with `@submit`, not `@submit.prevent` (the
|
|
2172
|
+
* modifier would only prevent the default a second time). Called
|
|
2173
|
+
* imperatively with no event, the `preventDefault` step is skipped.
|
|
2173
2174
|
*/
|
|
2174
2175
|
type SubmitHandler = (event?: Event) => Promise<void>;
|
|
2175
2176
|
/**
|
|
@@ -3787,7 +3788,7 @@ type FormMeta<F = unknown> = FieldState<F> & {
|
|
|
3787
3788
|
* of each new submission attempt; stays `null` on success.
|
|
3788
3789
|
*
|
|
3789
3790
|
* The submit handler does NOT re-throw — its returned promise always
|
|
3790
|
-
* resolves, so binding it to `@submit
|
|
3791
|
+
* resolves, so binding it to `@submit` never manufactures a
|
|
3791
3792
|
* `window` unhandledrejection. This is the channel for an UNEXPECTED
|
|
3792
3793
|
* submit failure (a thrown exception or rejected promise), read the
|
|
3793
3794
|
* same way in templates and after an imperative `await submit()`. An
|
|
@@ -3948,10 +3949,11 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
3948
3949
|
* Wraps your submit logic with validation and error routing.
|
|
3949
3950
|
*
|
|
3950
3951
|
* ```ts
|
|
3951
|
-
*
|
|
3952
|
+
* const onSubmit = form.handleSubmit(
|
|
3952
3953
|
* (data) => api.signup(data),
|
|
3953
3954
|
* (errors) => console.log(errors),
|
|
3954
|
-
* )
|
|
3955
|
+
* )
|
|
3956
|
+
* // Bind the returned handler: <form @submit="onSubmit">
|
|
3955
3957
|
* ```
|
|
3956
3958
|
*
|
|
3957
3959
|
* `data` is the strictly-typed parsed value — refinements have
|
|
@@ -4646,5 +4648,5 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
4646
4648
|
blankPaths: ComputedRef<BlankPathsView>;
|
|
4647
4649
|
};
|
|
4648
4650
|
|
|
4649
|
-
export { ROOT_PATH as
|
|
4650
|
-
export type {
|
|
4651
|
+
export { ROOT_PATH as X, ROOT_PATH_KEY as Y, canonicalizePath as al, isPathPrefix as am, isUnset as an, parseDottedPath as ao, unset as ap };
|
|
4652
|
+
export type { RegisterFlatPath as $, AbstractSchema as A, NestedType as B, CoercionEntry as C, DefaultValuesInput as D, ErrorInput as E, FormKey as F, GenericForm as G, HandleSubmit as H, IsTuple as I, JoinSegments as J, KeyofUnion as K, LiftedValueShape as L, MetaTrackerValue as M, NestedReadType as N, OnError as O, OnInvalidSubmitPolicy as P, OnSubmit as Q, PartialFlatPath as R, Path as S, PathKey as T, UseFormConfiguration as U, PendingValidationStatus as V, Primitive as W, ReactiveValidationStatus as Z, RegisterDirective as _, UseFormReturnType as a, RegisterOptions as a0, RegisterSelectModifier as a1, RegisterTextModifier as a2, RegisterTransform as a3, RegisterValue as a4, Segment as a5, SetValueCallback as a6, SetValuePayload as a7, SettledValidationStatus as a8, SlimPrimitiveKind as a9, SlimRuntimeOf as aa, SubmitHandler as ab, Unset as ac, ValidateOn as ad, ValidateOnConfig as ae, ValidationError as af, ValidationResponse as ag, ValidationResponseWithoutValue as ah, ValueOfUnion as ai, WriteMeta as aj, WriteShape as ak, AcceptableDefaults as aq, SchemaFactoryOptions as ar, TransformAbortHolder as as, RegisterModelDynamicCustomDirective as at, ArrayItem as b, ArrayPath as c, AttaformDefaults as d, CoercionRegistry as e, CoercionResult as f, CustomDirectiveRegisterAssignerFn as g, DeepPartial as h, DefaultValuesResponse as i, DefaultValuesShape as j, DisplayCtx as k, DisplayMachine as l, DisplayState as m, ErrorsProxyShape as n, FieldMetaPayload as o, FieldState as p, FieldStateMap as q, FieldStateMapEntry as r, FlatPath as s, FormErrorRecord as t, FormErrorsSurface as u, FormMeta as v, GetDisplayState as w, HistoryConfig as x, IsUnion as y, Json as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
interface WebpackFamilyPluginOptions {
|
|
2
2
|
/**
|
|
3
|
-
* Rewrite `attaform/zod` imports at build time to the
|
|
4
|
-
* subpath, based on the consumer's installed Zod major.
|
|
5
|
-
* Set to `false` to keep the runtime-dispatch unified
|
|
6
|
-
* adapters) when a project intentionally mixes Zod
|
|
7
|
-
* Zod in a non-standard way.
|
|
3
|
+
* Rewrite `attaform` and `attaform/zod` imports at build time to the
|
|
4
|
+
* matching adapter subpath, based on the consumer's installed Zod major.
|
|
5
|
+
* Default `true`. Set to `false` to keep the runtime-dispatch unified
|
|
6
|
+
* entry (ships both adapters) when a project intentionally mixes Zod
|
|
7
|
+
* versions or resolves Zod in a non-standard way.
|
|
8
8
|
*/
|
|
9
9
|
resolveZodAlias?: boolean;
|
|
10
10
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
interface WebpackFamilyPluginOptions {
|
|
2
2
|
/**
|
|
3
|
-
* Rewrite `attaform/zod` imports at build time to the
|
|
4
|
-
* subpath, based on the consumer's installed Zod major.
|
|
5
|
-
* Set to `false` to keep the runtime-dispatch unified
|
|
6
|
-
* adapters) when a project intentionally mixes Zod
|
|
7
|
-
* Zod in a non-standard way.
|
|
3
|
+
* Rewrite `attaform` and `attaform/zod` imports at build time to the
|
|
4
|
+
* matching adapter subpath, based on the consumer's installed Zod major.
|
|
5
|
+
* Default `true`. Set to `false` to keep the runtime-dispatch unified
|
|
6
|
+
* entry (ships both adapters) when a project intentionally mixes Zod
|
|
7
|
+
* versions or resolves Zod in a non-standard way.
|
|
8
8
|
*/
|
|
9
9
|
resolveZodAlias?: boolean;
|
|
10
10
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
interface WebpackFamilyPluginOptions {
|
|
2
2
|
/**
|
|
3
|
-
* Rewrite `attaform/zod` imports at build time to the
|
|
4
|
-
* subpath, based on the consumer's installed Zod major.
|
|
5
|
-
* Set to `false` to keep the runtime-dispatch unified
|
|
6
|
-
* adapters) when a project intentionally mixes Zod
|
|
7
|
-
* Zod in a non-standard way.
|
|
3
|
+
* Rewrite `attaform` and `attaform/zod` imports at build time to the
|
|
4
|
+
* matching adapter subpath, based on the consumer's installed Zod major.
|
|
5
|
+
* Default `true`. Set to `false` to keep the runtime-dispatch unified
|
|
6
|
+
* entry (ships both adapters) when a project intentionally mixes Zod
|
|
7
|
+
* versions or resolves Zod in a non-standard way.
|
|
8
8
|
*/
|
|
9
9
|
resolveZodAlias?: boolean;
|
|
10
10
|
/**
|
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GenericForm,
|
|
2
|
+
import { G as GenericForm, s as FlatPath, B as NestedType, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, aq as AcceptableDefaults, ae as ValidateOnConfig, a as UseFormReturnType } from './attaform.C3WnCDXz.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The Zod v4 schema roots `useForm` accepts. A fixed-shape
|
|
6
|
+
* `z.object({ … })` is the common case; `z.record(K, V)` admits a
|
|
7
|
+
* dictionary form (a homogeneous map with runtime-known keys);
|
|
8
|
+
* `z.discriminatedUnion(disc, [...])` admits a variant form (one of
|
|
9
|
+
* several object shapes, picked by a discriminator). Each projects to
|
|
10
|
+
* a `GenericForm`-shaped value the form engine drives: an object root
|
|
11
|
+
* descends into its fixed keys, a record root treats its entries as an
|
|
12
|
+
* open live-keyed container, a variant root lifts the active variant's
|
|
13
|
+
* keys into one addressable surface.
|
|
14
|
+
*
|
|
15
|
+
* Other roots (a bare `z.union`, a root `z.array`, primitives,
|
|
16
|
+
* `z.map` / `z.set`) are not form roots; wrap them under a key. The
|
|
17
|
+
* adapter's runtime construction rejects them with a legible error.
|
|
18
|
+
*
|
|
19
|
+
* `z.ZodObject` MUST keep its `z.ZodRawShape` argument, and the
|
|
20
|
+
* discriminated-union arm MUST stay fully applied. The unified entry's
|
|
21
|
+
* v4 overload constrains on `SupportedRootSchema & ZodV4Internals` to
|
|
22
|
+
* keep v3 schemas out (see `../unified/types-zod-major.ts`). In a
|
|
23
|
+
* single-major (v3-only) consumer install, the published `.d.mts`
|
|
24
|
+
* resolves this `z` to v3, where a bare or under-applied Zod class is
|
|
25
|
+
* missing its required arguments and degrades to an `any`-like error
|
|
26
|
+
* type; `any` then absorbs the union and `any & ZodV4Internals`
|
|
27
|
+
* collapses back to `any`, so the marker stops excluding v3 schemas and
|
|
28
|
+
* the read slot poisons to `never`. `z.ZodRecord` carries defaults for
|
|
29
|
+
* both arguments, so it stays concrete in either major.
|
|
30
|
+
* `z.ZodDiscriminatedUnion` does NOT (v3 requires both arguments, and
|
|
31
|
+
* its parameter order is the reverse of v4's), so the arm is written
|
|
32
|
+
* fully applied; the v3-only bundled-types fixture guards it.
|
|
33
|
+
*/
|
|
34
|
+
type SupportedRootSchema = z.ZodObject<z.ZodRawShape> | z.ZodRecord | z.ZodDiscriminatedUnion<readonly z.ZodObject<z.ZodRawShape>[], string>;
|
|
3
35
|
|
|
4
36
|
/**
|
|
5
37
|
* The shape `form.values.<key>` returns at runtime.
|
|
@@ -120,38 +152,6 @@ type StorageLeaf<L> = InputIsUnknown<L> extends true ? unknown : L extends {
|
|
|
120
152
|
};
|
|
121
153
|
} ? Out : never;
|
|
122
154
|
|
|
123
|
-
/**
|
|
124
|
-
* The Zod v4 schema roots `useForm` accepts. A fixed-shape
|
|
125
|
-
* `z.object({ … })` is the common case; `z.record(K, V)` admits a
|
|
126
|
-
* dictionary form (a homogeneous map with runtime-known keys);
|
|
127
|
-
* `z.discriminatedUnion(disc, [...])` admits a variant form (one of
|
|
128
|
-
* several object shapes, picked by a discriminator). Each projects to
|
|
129
|
-
* a `GenericForm`-shaped value the form engine drives: an object root
|
|
130
|
-
* descends into its fixed keys, a record root treats its entries as an
|
|
131
|
-
* open live-keyed container, a variant root lifts the active variant's
|
|
132
|
-
* keys into one addressable surface.
|
|
133
|
-
*
|
|
134
|
-
* Other roots (a bare `z.union`, a root `z.array`, primitives,
|
|
135
|
-
* `z.map` / `z.set`) are not form roots; wrap them under a key. The
|
|
136
|
-
* adapter's runtime construction rejects them with a legible error.
|
|
137
|
-
*
|
|
138
|
-
* `z.ZodObject` MUST keep its `z.ZodRawShape` argument, and the
|
|
139
|
-
* discriminated-union arm MUST stay fully applied. The unified entry's
|
|
140
|
-
* v4 overload constrains on `SupportedRootSchema & ZodV4Internals` to
|
|
141
|
-
* keep v3 schemas out (see `../unified/types-zod-major.ts`). In a
|
|
142
|
-
* single-major (v3-only) consumer install, the published `.d.mts`
|
|
143
|
-
* resolves this `z` to v3, where a bare or under-applied Zod class is
|
|
144
|
-
* missing its required arguments and degrades to an `any`-like error
|
|
145
|
-
* type; `any` then absorbs the union and `any & ZodV4Internals`
|
|
146
|
-
* collapses back to `any`, so the marker stops excluding v3 schemas and
|
|
147
|
-
* the read slot poisons to `never`. `z.ZodRecord` carries defaults for
|
|
148
|
-
* both arguments, so it stays concrete in either major.
|
|
149
|
-
* `z.ZodDiscriminatedUnion` does NOT (v3 requires both arguments, and
|
|
150
|
-
* its parameter order is the reverse of v4's), so the arm is written
|
|
151
|
-
* fully applied; the v3-only bundled-types fixture guards it.
|
|
152
|
-
*/
|
|
153
|
-
type SupportedRootSchema = z.ZodObject<z.ZodRawShape> | z.ZodRecord | z.ZodDiscriminatedUnion<readonly z.ZodObject<z.ZodRawShape>[], string>;
|
|
154
|
-
|
|
155
155
|
/**
|
|
156
156
|
* Zod v4 adapter entry point. Re-exports the adapter + the useForm
|
|
157
157
|
* wrapper that threads zod-v4-specific schema types through
|