attaform 0.25.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.CN4ZEGo6.mjs → attaform.BceJrhQ7.mjs} +5 -5
- package/dist/shared/{attaform.CN4ZEGo6.mjs.map → attaform.BceJrhQ7.mjs.map} +1 -1
- package/dist/shared/{attaform.i_LA3X9o.d.cts → attaform.C3WnCDXz.d.cts} +81 -24
- package/dist/shared/{attaform.i_LA3X9o.d.ts → attaform.C3WnCDXz.d.mts} +81 -24
- package/dist/shared/{attaform.i_LA3X9o.d.mts → attaform.C3WnCDXz.d.ts} +81 -24
- package/dist/shared/{attaform.DuzQYscR.d.ts → attaform.C9fPTxjB.d.cts} +5 -5
- package/dist/shared/{attaform.DuzQYscR.d.cts → attaform.C9fPTxjB.d.mts} +5 -5
- package/dist/shared/{attaform.DuzQYscR.d.mts → attaform.C9fPTxjB.d.ts} +5 -5
- package/dist/shared/{attaform.B3cgZE3c.d.ts → attaform.CC_y1_Ej.d.ts} +33 -33
- package/dist/shared/{attaform.DS_zBcdr.d.ts → attaform.CEXUlUkc.d.ts} +1588 -1190
- package/dist/shared/{attaform.Xe8dATED.cjs → attaform.C__F01CE.cjs} +15 -15
- package/dist/shared/{attaform.Xe8dATED.cjs.map → attaform.C__F01CE.cjs.map} +1 -1
- package/dist/shared/{attaform.3heDHayA.cjs → attaform.Co5LNRnv.cjs} +186 -129
- package/dist/shared/attaform.Co5LNRnv.cjs.map +1 -0
- package/dist/shared/{attaform.BJt4ZCkM.d.mts → attaform.CpXHK60W.d.cts} +33 -33
- package/dist/shared/{attaform.DmKLa4tL.d.cts → attaform.CvVYOvZF.d.mts} +33 -33
- package/dist/shared/{attaform.DK3xUBkj.mjs → attaform.CyQxTOdX.mjs} +162 -79
- package/dist/shared/attaform.CyQxTOdX.mjs.map +1 -0
- package/dist/shared/{attaform.B5GFS3Su.d.cts → attaform.D99pd7JG.d.cts} +1588 -1190
- package/dist/shared/{attaform.CwXXbZIQ.mjs → attaform.DDAmSFnl.mjs} +4 -4
- package/dist/shared/{attaform.CwXXbZIQ.mjs.map → attaform.DDAmSFnl.mjs.map} +1 -1
- package/dist/shared/{attaform.BkUzunyB.cjs → attaform.DQT7_-FO.cjs} +371 -287
- package/dist/shared/attaform.DQT7_-FO.cjs.map +1 -0
- package/dist/shared/{attaform.CqwcTExO.mjs → attaform.Da8EdI2t.mjs} +182 -129
- package/dist/shared/attaform.Da8EdI2t.mjs.map +1 -0
- package/dist/shared/{attaform.sks1MFVO.cjs → attaform.DhVgG2jh.cjs} +16 -16
- package/dist/shared/{attaform.sks1MFVO.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.DMNnfQq_.mjs → attaform.DlSu08F5.mjs} +4 -4
- package/dist/shared/{attaform.DMNnfQq_.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.B5YcWrKi.cjs → attaform.Drsi43GG.cjs} +19 -19
- package/dist/shared/{attaform.B5YcWrKi.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.8vmdOURQ.d.mts → attaform.kBkYlKP_.d.mts} +1588 -1190
- 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.3heDHayA.cjs.map +0 -1
- package/dist/shared/attaform.BRGIpZo4.cjs.map +0 -1
- package/dist/shared/attaform.BkUzunyB.cjs.map +0 -1
- package/dist/shared/attaform.C3Doa9Pt.mjs.map +0 -1
- package/dist/shared/attaform.CO0e7YVY.d.cts +0 -94
- package/dist/shared/attaform.CO0e7YVY.d.mts +0 -94
- package/dist/shared/attaform.CO0e7YVY.d.ts +0 -94
- package/dist/shared/attaform.CqwcTExO.mjs.map +0 -1
- package/dist/shared/attaform.DK3xUBkj.mjs.map +0 -1
- package/dist/shared/attaform.LEWUFqUw.cjs.map +0 -1
- package/dist/shared/attaform.OLtKd9gM.mjs +0 -35
- package/dist/shared/attaform.OLtKd9gM.mjs.map +0 -1
- package/dist/shared/attaform.sHkHv_98.mjs.map +0 -1
- package/dist/shared/attaform.xBDo0Ko0.cjs +0 -39
- package/dist/shared/attaform.xBDo0Ko0.cjs.map +0 -1
- package/dist/shared/{attaform.DdjDqTah.d.mts → attaform.DRUT703x.d.cts} +14 -14
- package/dist/shared/{attaform.DdjDqTah.d.ts → attaform.DRUT703x.d.mts} +14 -14
- package/dist/shared/{attaform.DdjDqTah.d.cts → attaform.DRUT703x.d.ts} +14 -14
|
@@ -137,8 +137,8 @@ declare function canonicalizePath(input: string | Path): {
|
|
|
137
137
|
* `Path` to address the form value as a whole, and the home for
|
|
138
138
|
* form-level (global) errors: root `.refine()` messages, hydration
|
|
139
139
|
* failures, and `setErrors` entries with no path all live at `[]`. Aggregate
|
|
140
|
-
* reads (`errors()`, `meta.errors`) surface them alongside
|
|
141
|
-
* errors; `
|
|
140
|
+
* reads (`errors()`, `errors([])`, `meta.errors`) surface them alongside
|
|
141
|
+
* field errors; `meta.ownErrors` returns the root bucket alone.
|
|
142
142
|
*
|
|
143
143
|
* The empty SEGMENT tuple `[]` is structurally unconstructible as a
|
|
144
144
|
* field path, so it can never collide with a schema key, unlike the
|
|
@@ -2074,14 +2074,15 @@ type OnError = (error: ValidationError[]) => void | Promise<void>;
|
|
|
2074
2074
|
type DisplayState = 'idle' | 'pending' | 'error' | 'success';
|
|
2075
2075
|
/**
|
|
2076
2076
|
* Keys on `FieldState` layered on FROM the display-state predicate
|
|
2077
|
-
* (plus `firstError`, computed alongside them).
|
|
2078
|
-
* predicate's arguments so a predicate cannot read
|
|
2079
|
-
* form a cycle — enforced at the type level AND at
|
|
2080
|
-
* objects passed in literally lack these keys, so an
|
|
2081
|
-
* or a vanilla-JS caller still can't reach them.
|
|
2082
|
-
* `FormMetaBase` (field-state-api.ts) omit the same
|
|
2077
|
+
* (plus `firstError` / `firstOwnError`, computed alongside them).
|
|
2078
|
+
* `Omit`'d from the predicate's arguments so a predicate cannot read
|
|
2079
|
+
* its own output and form a cycle — enforced at the type level AND at
|
|
2080
|
+
* runtime: the base objects passed in literally lack these keys, so an
|
|
2081
|
+
* `as` cast in TS or a vanilla-JS caller still can't reach them.
|
|
2082
|
+
* `FieldStateBase` / `FormMetaBase` (field-state-api.ts) omit the same
|
|
2083
|
+
* set in lockstep.
|
|
2083
2084
|
*/
|
|
2084
|
-
type FieldStateDerivedKey = 'displayState' | 'showErrors' | 'showPending' | 'showSuccess' | 'showIdle' | 'firstError';
|
|
2085
|
+
type FieldStateDerivedKey = 'displayState' | 'showErrors' | 'showPending' | 'showSuccess' | 'showIdle' | 'firstError' | 'firstOwnError';
|
|
2085
2086
|
/**
|
|
2086
2087
|
* One step of the display state machine: the verdict the field should
|
|
2087
2088
|
* render right now (`display`, projected to `displayState` and the
|
|
@@ -2163,12 +2164,13 @@ type GetDisplayState = (prev: DisplayMachine, ctx: DisplayCtx) => DisplayMachine
|
|
|
2163
2164
|
* it to a `<form>`:
|
|
2164
2165
|
*
|
|
2165
2166
|
* ```vue
|
|
2166
|
-
* <form @submit
|
|
2167
|
+
* <form @submit="onSubmit">…</form>
|
|
2167
2168
|
* ```
|
|
2168
2169
|
*
|
|
2169
|
-
* It
|
|
2170
|
-
*
|
|
2171
|
-
*
|
|
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.
|
|
2172
2174
|
*/
|
|
2173
2175
|
type SubmitHandler = (event?: Event) => Promise<void>;
|
|
2174
2176
|
/**
|
|
@@ -3114,7 +3116,40 @@ type FieldState<Value = unknown> = {
|
|
|
3114
3116
|
*/
|
|
3115
3117
|
readonly elements: readonly HTMLElement[];
|
|
3116
3118
|
readonly updatedAt: string | null;
|
|
3119
|
+
/**
|
|
3120
|
+
* Every `ValidationError` in this path's SUBTREE: the node's own
|
|
3121
|
+
* bucket plus every descendant's, sorted by schema-declaration order.
|
|
3122
|
+
* On a leaf (no descendants) this equals `ownErrors`. On a container
|
|
3123
|
+
* it rolls up the whole fieldset, so a parent's `errors` is non-empty
|
|
3124
|
+
* whenever any child is invalid.
|
|
3125
|
+
*
|
|
3126
|
+
* For the errors pinned at THIS path alone (a container's own
|
|
3127
|
+
* cross-field `.refine()`, or `setErrors` at this path), read
|
|
3128
|
+
* `ownErrors`.
|
|
3129
|
+
*/
|
|
3117
3130
|
readonly errors: readonly ValidationError[];
|
|
3131
|
+
/**
|
|
3132
|
+
* Every `ValidationError` at THIS exact path's own bucket, excluding
|
|
3133
|
+
* descendants: schema errors, blank-required errors, and `setErrors`
|
|
3134
|
+
* pinned here, in `schema`, `blank`, `user` order. The exact-path
|
|
3135
|
+
* counterpart to the subtree-scoped `errors`.
|
|
3136
|
+
*
|
|
3137
|
+
* On a leaf this is the same array as `errors` (a leaf has no
|
|
3138
|
+
* descendants). On a container it holds only the container's OWN
|
|
3139
|
+
* errors, a cross-field `.refine()` on the fieldset or a path-less
|
|
3140
|
+
* `setErrors` at this node, without dragging in any child error:
|
|
3141
|
+
*
|
|
3142
|
+
* ```vue
|
|
3143
|
+
* <p v-if="form.fields.address.firstOwnError">
|
|
3144
|
+
* {{ form.fields.address.firstOwnError.message }}
|
|
3145
|
+
* </p>
|
|
3146
|
+
* ```
|
|
3147
|
+
*
|
|
3148
|
+
* On `form.meta` this is the root `[]` bucket: form-level errors from
|
|
3149
|
+
* a root `.refine()` or a path-less `setErrors`. `form.meta.ownErrors`
|
|
3150
|
+
* (with `firstOwnError`) is the banner accessor for those.
|
|
3151
|
+
*/
|
|
3152
|
+
readonly ownErrors: readonly ValidationError[];
|
|
3118
3153
|
/**
|
|
3119
3154
|
* `true` while a per-field validation run is in flight at this path.
|
|
3120
3155
|
* Reflects field-level debounced runs (`validate-on-change`) and
|
|
@@ -3235,9 +3270,28 @@ type FieldState<Value = unknown> = {
|
|
|
3235
3270
|
* decides when to render it.
|
|
3236
3271
|
*
|
|
3237
3272
|
* On container paths, the first error in the aggregated subtree
|
|
3238
|
-
* (descendants sorted by `pathOrdinal`).
|
|
3273
|
+
* (descendants sorted by `pathOrdinal`). For the container's OWN
|
|
3274
|
+
* first error only, read `firstOwnError`.
|
|
3239
3275
|
*/
|
|
3240
3276
|
readonly firstError: ValidationError | undefined;
|
|
3277
|
+
/**
|
|
3278
|
+
* The first `ValidationError` in `ownErrors` (this exact path's own
|
|
3279
|
+
* bucket), or `undefined` when that bucket is empty. Equivalent to
|
|
3280
|
+
* `ownErrors[0]`, the exact-path counterpart to `firstError`.
|
|
3281
|
+
*
|
|
3282
|
+
* On a leaf this equals `firstError`. On a container it is the
|
|
3283
|
+
* container's own cross-field error (a fieldset `.refine()`), never a
|
|
3284
|
+
* child's. `form.meta.firstOwnError` is the form-level banner: the
|
|
3285
|
+
* first root `[]` error from a root `.refine()` or a path-less
|
|
3286
|
+
* `setErrors`:
|
|
3287
|
+
*
|
|
3288
|
+
* ```vue
|
|
3289
|
+
* <p v-if="form.meta.firstOwnError" role="alert">
|
|
3290
|
+
* {{ form.meta.firstOwnError.message }}
|
|
3291
|
+
* </p>
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
readonly firstOwnError: ValidationError | undefined;
|
|
3241
3295
|
readonly path: ReadonlyArray<string | number>;
|
|
3242
3296
|
/**
|
|
3243
3297
|
* Stable, SSR-safe DOM id for this field, unique across every mount
|
|
@@ -3601,11 +3655,13 @@ type FormErrorsSurface<Form> = ErrorsProxyShape<Form> & {
|
|
|
3601
3655
|
<const S extends ReadonlyArray<string | number>>(segments: S & ([JoinSegments<S>] extends [FlatPath<Form>] ? unknown : never)): readonly ValidationError[];
|
|
3602
3656
|
(segments: ReadonlyArray<string | number>): readonly ValidationError[];
|
|
3603
3657
|
/**
|
|
3604
|
-
* No-arg call returns the whole-form error aggregate
|
|
3605
|
-
* `form.meta.errors`: every field error plus
|
|
3606
|
-
*
|
|
3607
|
-
*
|
|
3608
|
-
*
|
|
3658
|
+
* No-arg call returns the whole-form error aggregate, the same as
|
|
3659
|
+
* `form.meta.errors` and `form.errors([])`: every field error plus
|
|
3660
|
+
* the root bucket. `form.errors(path)` is uniform at every depth,
|
|
3661
|
+
* including `[]`, so the root is no exception. For the root bucket
|
|
3662
|
+
* alone (a root `.refine()`, a path-less `setErrors`), read
|
|
3663
|
+
* `form.meta.ownErrors`. Always a readonly array; empty when the form
|
|
3664
|
+
* has no errors.
|
|
3609
3665
|
*/
|
|
3610
3666
|
(): readonly ValidationError[];
|
|
3611
3667
|
};
|
|
@@ -3732,7 +3788,7 @@ type FormMeta<F = unknown> = FieldState<F> & {
|
|
|
3732
3788
|
* of each new submission attempt; stays `null` on success.
|
|
3733
3789
|
*
|
|
3734
3790
|
* The submit handler does NOT re-throw — its returned promise always
|
|
3735
|
-
* resolves, so binding it to `@submit
|
|
3791
|
+
* resolves, so binding it to `@submit` never manufactures a
|
|
3736
3792
|
* `window` unhandledrejection. This is the channel for an UNEXPECTED
|
|
3737
3793
|
* submit failure (a thrown exception or rejected promise), read the
|
|
3738
3794
|
* same way in templates and after an imperative `await submit()`. An
|
|
@@ -3893,10 +3949,11 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
3893
3949
|
* Wraps your submit logic with validation and error routing.
|
|
3894
3950
|
*
|
|
3895
3951
|
* ```ts
|
|
3896
|
-
*
|
|
3952
|
+
* const onSubmit = form.handleSubmit(
|
|
3897
3953
|
* (data) => api.signup(data),
|
|
3898
3954
|
* (errors) => console.log(errors),
|
|
3899
|
-
* )
|
|
3955
|
+
* )
|
|
3956
|
+
* // Bind the returned handler: <form @submit="onSubmit">
|
|
3900
3957
|
* ```
|
|
3901
3958
|
*
|
|
3902
3959
|
* `data` is the strictly-typed parsed value — refinements have
|
|
@@ -4591,5 +4648,5 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
4591
4648
|
blankPaths: ComputedRef<BlankPathsView>;
|
|
4592
4649
|
};
|
|
4593
4650
|
|
|
4594
|
-
export { ROOT_PATH as
|
|
4595
|
-
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 };
|
|
@@ -137,8 +137,8 @@ declare function canonicalizePath(input: string | Path): {
|
|
|
137
137
|
* `Path` to address the form value as a whole, and the home for
|
|
138
138
|
* form-level (global) errors: root `.refine()` messages, hydration
|
|
139
139
|
* failures, and `setErrors` entries with no path all live at `[]`. Aggregate
|
|
140
|
-
* reads (`errors()`, `meta.errors`) surface them alongside
|
|
141
|
-
* errors; `
|
|
140
|
+
* reads (`errors()`, `errors([])`, `meta.errors`) surface them alongside
|
|
141
|
+
* field errors; `meta.ownErrors` returns the root bucket alone.
|
|
142
142
|
*
|
|
143
143
|
* The empty SEGMENT tuple `[]` is structurally unconstructible as a
|
|
144
144
|
* field path, so it can never collide with a schema key, unlike the
|
|
@@ -2074,14 +2074,15 @@ type OnError = (error: ValidationError[]) => void | Promise<void>;
|
|
|
2074
2074
|
type DisplayState = 'idle' | 'pending' | 'error' | 'success';
|
|
2075
2075
|
/**
|
|
2076
2076
|
* Keys on `FieldState` layered on FROM the display-state predicate
|
|
2077
|
-
* (plus `firstError`, computed alongside them).
|
|
2078
|
-
* predicate's arguments so a predicate cannot read
|
|
2079
|
-
* form a cycle — enforced at the type level AND at
|
|
2080
|
-
* objects passed in literally lack these keys, so an
|
|
2081
|
-
* or a vanilla-JS caller still can't reach them.
|
|
2082
|
-
* `FormMetaBase` (field-state-api.ts) omit the same
|
|
2077
|
+
* (plus `firstError` / `firstOwnError`, computed alongside them).
|
|
2078
|
+
* `Omit`'d from the predicate's arguments so a predicate cannot read
|
|
2079
|
+
* its own output and form a cycle — enforced at the type level AND at
|
|
2080
|
+
* runtime: the base objects passed in literally lack these keys, so an
|
|
2081
|
+
* `as` cast in TS or a vanilla-JS caller still can't reach them.
|
|
2082
|
+
* `FieldStateBase` / `FormMetaBase` (field-state-api.ts) omit the same
|
|
2083
|
+
* set in lockstep.
|
|
2083
2084
|
*/
|
|
2084
|
-
type FieldStateDerivedKey = 'displayState' | 'showErrors' | 'showPending' | 'showSuccess' | 'showIdle' | 'firstError';
|
|
2085
|
+
type FieldStateDerivedKey = 'displayState' | 'showErrors' | 'showPending' | 'showSuccess' | 'showIdle' | 'firstError' | 'firstOwnError';
|
|
2085
2086
|
/**
|
|
2086
2087
|
* One step of the display state machine: the verdict the field should
|
|
2087
2088
|
* render right now (`display`, projected to `displayState` and the
|
|
@@ -2163,12 +2164,13 @@ type GetDisplayState = (prev: DisplayMachine, ctx: DisplayCtx) => DisplayMachine
|
|
|
2163
2164
|
* it to a `<form>`:
|
|
2164
2165
|
*
|
|
2165
2166
|
* ```vue
|
|
2166
|
-
* <form @submit
|
|
2167
|
+
* <form @submit="onSubmit">…</form>
|
|
2167
2168
|
* ```
|
|
2168
2169
|
*
|
|
2169
|
-
* It
|
|
2170
|
-
*
|
|
2171
|
-
*
|
|
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.
|
|
2172
2174
|
*/
|
|
2173
2175
|
type SubmitHandler = (event?: Event) => Promise<void>;
|
|
2174
2176
|
/**
|
|
@@ -3114,7 +3116,40 @@ type FieldState<Value = unknown> = {
|
|
|
3114
3116
|
*/
|
|
3115
3117
|
readonly elements: readonly HTMLElement[];
|
|
3116
3118
|
readonly updatedAt: string | null;
|
|
3119
|
+
/**
|
|
3120
|
+
* Every `ValidationError` in this path's SUBTREE: the node's own
|
|
3121
|
+
* bucket plus every descendant's, sorted by schema-declaration order.
|
|
3122
|
+
* On a leaf (no descendants) this equals `ownErrors`. On a container
|
|
3123
|
+
* it rolls up the whole fieldset, so a parent's `errors` is non-empty
|
|
3124
|
+
* whenever any child is invalid.
|
|
3125
|
+
*
|
|
3126
|
+
* For the errors pinned at THIS path alone (a container's own
|
|
3127
|
+
* cross-field `.refine()`, or `setErrors` at this path), read
|
|
3128
|
+
* `ownErrors`.
|
|
3129
|
+
*/
|
|
3117
3130
|
readonly errors: readonly ValidationError[];
|
|
3131
|
+
/**
|
|
3132
|
+
* Every `ValidationError` at THIS exact path's own bucket, excluding
|
|
3133
|
+
* descendants: schema errors, blank-required errors, and `setErrors`
|
|
3134
|
+
* pinned here, in `schema`, `blank`, `user` order. The exact-path
|
|
3135
|
+
* counterpart to the subtree-scoped `errors`.
|
|
3136
|
+
*
|
|
3137
|
+
* On a leaf this is the same array as `errors` (a leaf has no
|
|
3138
|
+
* descendants). On a container it holds only the container's OWN
|
|
3139
|
+
* errors, a cross-field `.refine()` on the fieldset or a path-less
|
|
3140
|
+
* `setErrors` at this node, without dragging in any child error:
|
|
3141
|
+
*
|
|
3142
|
+
* ```vue
|
|
3143
|
+
* <p v-if="form.fields.address.firstOwnError">
|
|
3144
|
+
* {{ form.fields.address.firstOwnError.message }}
|
|
3145
|
+
* </p>
|
|
3146
|
+
* ```
|
|
3147
|
+
*
|
|
3148
|
+
* On `form.meta` this is the root `[]` bucket: form-level errors from
|
|
3149
|
+
* a root `.refine()` or a path-less `setErrors`. `form.meta.ownErrors`
|
|
3150
|
+
* (with `firstOwnError`) is the banner accessor for those.
|
|
3151
|
+
*/
|
|
3152
|
+
readonly ownErrors: readonly ValidationError[];
|
|
3118
3153
|
/**
|
|
3119
3154
|
* `true` while a per-field validation run is in flight at this path.
|
|
3120
3155
|
* Reflects field-level debounced runs (`validate-on-change`) and
|
|
@@ -3235,9 +3270,28 @@ type FieldState<Value = unknown> = {
|
|
|
3235
3270
|
* decides when to render it.
|
|
3236
3271
|
*
|
|
3237
3272
|
* On container paths, the first error in the aggregated subtree
|
|
3238
|
-
* (descendants sorted by `pathOrdinal`).
|
|
3273
|
+
* (descendants sorted by `pathOrdinal`). For the container's OWN
|
|
3274
|
+
* first error only, read `firstOwnError`.
|
|
3239
3275
|
*/
|
|
3240
3276
|
readonly firstError: ValidationError | undefined;
|
|
3277
|
+
/**
|
|
3278
|
+
* The first `ValidationError` in `ownErrors` (this exact path's own
|
|
3279
|
+
* bucket), or `undefined` when that bucket is empty. Equivalent to
|
|
3280
|
+
* `ownErrors[0]`, the exact-path counterpart to `firstError`.
|
|
3281
|
+
*
|
|
3282
|
+
* On a leaf this equals `firstError`. On a container it is the
|
|
3283
|
+
* container's own cross-field error (a fieldset `.refine()`), never a
|
|
3284
|
+
* child's. `form.meta.firstOwnError` is the form-level banner: the
|
|
3285
|
+
* first root `[]` error from a root `.refine()` or a path-less
|
|
3286
|
+
* `setErrors`:
|
|
3287
|
+
*
|
|
3288
|
+
* ```vue
|
|
3289
|
+
* <p v-if="form.meta.firstOwnError" role="alert">
|
|
3290
|
+
* {{ form.meta.firstOwnError.message }}
|
|
3291
|
+
* </p>
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
readonly firstOwnError: ValidationError | undefined;
|
|
3241
3295
|
readonly path: ReadonlyArray<string | number>;
|
|
3242
3296
|
/**
|
|
3243
3297
|
* Stable, SSR-safe DOM id for this field, unique across every mount
|
|
@@ -3601,11 +3655,13 @@ type FormErrorsSurface<Form> = ErrorsProxyShape<Form> & {
|
|
|
3601
3655
|
<const S extends ReadonlyArray<string | number>>(segments: S & ([JoinSegments<S>] extends [FlatPath<Form>] ? unknown : never)): readonly ValidationError[];
|
|
3602
3656
|
(segments: ReadonlyArray<string | number>): readonly ValidationError[];
|
|
3603
3657
|
/**
|
|
3604
|
-
* No-arg call returns the whole-form error aggregate
|
|
3605
|
-
* `form.meta.errors`: every field error plus
|
|
3606
|
-
*
|
|
3607
|
-
*
|
|
3608
|
-
*
|
|
3658
|
+
* No-arg call returns the whole-form error aggregate, the same as
|
|
3659
|
+
* `form.meta.errors` and `form.errors([])`: every field error plus
|
|
3660
|
+
* the root bucket. `form.errors(path)` is uniform at every depth,
|
|
3661
|
+
* including `[]`, so the root is no exception. For the root bucket
|
|
3662
|
+
* alone (a root `.refine()`, a path-less `setErrors`), read
|
|
3663
|
+
* `form.meta.ownErrors`. Always a readonly array; empty when the form
|
|
3664
|
+
* has no errors.
|
|
3609
3665
|
*/
|
|
3610
3666
|
(): readonly ValidationError[];
|
|
3611
3667
|
};
|
|
@@ -3732,7 +3788,7 @@ type FormMeta<F = unknown> = FieldState<F> & {
|
|
|
3732
3788
|
* of each new submission attempt; stays `null` on success.
|
|
3733
3789
|
*
|
|
3734
3790
|
* The submit handler does NOT re-throw — its returned promise always
|
|
3735
|
-
* resolves, so binding it to `@submit
|
|
3791
|
+
* resolves, so binding it to `@submit` never manufactures a
|
|
3736
3792
|
* `window` unhandledrejection. This is the channel for an UNEXPECTED
|
|
3737
3793
|
* submit failure (a thrown exception or rejected promise), read the
|
|
3738
3794
|
* same way in templates and after an imperative `await submit()`. An
|
|
@@ -3893,10 +3949,11 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
3893
3949
|
* Wraps your submit logic with validation and error routing.
|
|
3894
3950
|
*
|
|
3895
3951
|
* ```ts
|
|
3896
|
-
*
|
|
3952
|
+
* const onSubmit = form.handleSubmit(
|
|
3897
3953
|
* (data) => api.signup(data),
|
|
3898
3954
|
* (errors) => console.log(errors),
|
|
3899
|
-
* )
|
|
3955
|
+
* )
|
|
3956
|
+
* // Bind the returned handler: <form @submit="onSubmit">
|
|
3900
3957
|
* ```
|
|
3901
3958
|
*
|
|
3902
3959
|
* `data` is the strictly-typed parsed value — refinements have
|
|
@@ -4591,5 +4648,5 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
4591
4648
|
blankPaths: ComputedRef<BlankPathsView>;
|
|
4592
4649
|
};
|
|
4593
4650
|
|
|
4594
|
-
export { ROOT_PATH as
|
|
4595
|
-
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 };
|
|
@@ -137,8 +137,8 @@ declare function canonicalizePath(input: string | Path): {
|
|
|
137
137
|
* `Path` to address the form value as a whole, and the home for
|
|
138
138
|
* form-level (global) errors: root `.refine()` messages, hydration
|
|
139
139
|
* failures, and `setErrors` entries with no path all live at `[]`. Aggregate
|
|
140
|
-
* reads (`errors()`, `meta.errors`) surface them alongside
|
|
141
|
-
* errors; `
|
|
140
|
+
* reads (`errors()`, `errors([])`, `meta.errors`) surface them alongside
|
|
141
|
+
* field errors; `meta.ownErrors` returns the root bucket alone.
|
|
142
142
|
*
|
|
143
143
|
* The empty SEGMENT tuple `[]` is structurally unconstructible as a
|
|
144
144
|
* field path, so it can never collide with a schema key, unlike the
|
|
@@ -2074,14 +2074,15 @@ type OnError = (error: ValidationError[]) => void | Promise<void>;
|
|
|
2074
2074
|
type DisplayState = 'idle' | 'pending' | 'error' | 'success';
|
|
2075
2075
|
/**
|
|
2076
2076
|
* Keys on `FieldState` layered on FROM the display-state predicate
|
|
2077
|
-
* (plus `firstError`, computed alongside them).
|
|
2078
|
-
* predicate's arguments so a predicate cannot read
|
|
2079
|
-
* form a cycle — enforced at the type level AND at
|
|
2080
|
-
* objects passed in literally lack these keys, so an
|
|
2081
|
-
* or a vanilla-JS caller still can't reach them.
|
|
2082
|
-
* `FormMetaBase` (field-state-api.ts) omit the same
|
|
2077
|
+
* (plus `firstError` / `firstOwnError`, computed alongside them).
|
|
2078
|
+
* `Omit`'d from the predicate's arguments so a predicate cannot read
|
|
2079
|
+
* its own output and form a cycle — enforced at the type level AND at
|
|
2080
|
+
* runtime: the base objects passed in literally lack these keys, so an
|
|
2081
|
+
* `as` cast in TS or a vanilla-JS caller still can't reach them.
|
|
2082
|
+
* `FieldStateBase` / `FormMetaBase` (field-state-api.ts) omit the same
|
|
2083
|
+
* set in lockstep.
|
|
2083
2084
|
*/
|
|
2084
|
-
type FieldStateDerivedKey = 'displayState' | 'showErrors' | 'showPending' | 'showSuccess' | 'showIdle' | 'firstError';
|
|
2085
|
+
type FieldStateDerivedKey = 'displayState' | 'showErrors' | 'showPending' | 'showSuccess' | 'showIdle' | 'firstError' | 'firstOwnError';
|
|
2085
2086
|
/**
|
|
2086
2087
|
* One step of the display state machine: the verdict the field should
|
|
2087
2088
|
* render right now (`display`, projected to `displayState` and the
|
|
@@ -2163,12 +2164,13 @@ type GetDisplayState = (prev: DisplayMachine, ctx: DisplayCtx) => DisplayMachine
|
|
|
2163
2164
|
* it to a `<form>`:
|
|
2164
2165
|
*
|
|
2165
2166
|
* ```vue
|
|
2166
|
-
* <form @submit
|
|
2167
|
+
* <form @submit="onSubmit">…</form>
|
|
2167
2168
|
* ```
|
|
2168
2169
|
*
|
|
2169
|
-
* It
|
|
2170
|
-
*
|
|
2171
|
-
*
|
|
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.
|
|
2172
2174
|
*/
|
|
2173
2175
|
type SubmitHandler = (event?: Event) => Promise<void>;
|
|
2174
2176
|
/**
|
|
@@ -3114,7 +3116,40 @@ type FieldState<Value = unknown> = {
|
|
|
3114
3116
|
*/
|
|
3115
3117
|
readonly elements: readonly HTMLElement[];
|
|
3116
3118
|
readonly updatedAt: string | null;
|
|
3119
|
+
/**
|
|
3120
|
+
* Every `ValidationError` in this path's SUBTREE: the node's own
|
|
3121
|
+
* bucket plus every descendant's, sorted by schema-declaration order.
|
|
3122
|
+
* On a leaf (no descendants) this equals `ownErrors`. On a container
|
|
3123
|
+
* it rolls up the whole fieldset, so a parent's `errors` is non-empty
|
|
3124
|
+
* whenever any child is invalid.
|
|
3125
|
+
*
|
|
3126
|
+
* For the errors pinned at THIS path alone (a container's own
|
|
3127
|
+
* cross-field `.refine()`, or `setErrors` at this path), read
|
|
3128
|
+
* `ownErrors`.
|
|
3129
|
+
*/
|
|
3117
3130
|
readonly errors: readonly ValidationError[];
|
|
3131
|
+
/**
|
|
3132
|
+
* Every `ValidationError` at THIS exact path's own bucket, excluding
|
|
3133
|
+
* descendants: schema errors, blank-required errors, and `setErrors`
|
|
3134
|
+
* pinned here, in `schema`, `blank`, `user` order. The exact-path
|
|
3135
|
+
* counterpart to the subtree-scoped `errors`.
|
|
3136
|
+
*
|
|
3137
|
+
* On a leaf this is the same array as `errors` (a leaf has no
|
|
3138
|
+
* descendants). On a container it holds only the container's OWN
|
|
3139
|
+
* errors, a cross-field `.refine()` on the fieldset or a path-less
|
|
3140
|
+
* `setErrors` at this node, without dragging in any child error:
|
|
3141
|
+
*
|
|
3142
|
+
* ```vue
|
|
3143
|
+
* <p v-if="form.fields.address.firstOwnError">
|
|
3144
|
+
* {{ form.fields.address.firstOwnError.message }}
|
|
3145
|
+
* </p>
|
|
3146
|
+
* ```
|
|
3147
|
+
*
|
|
3148
|
+
* On `form.meta` this is the root `[]` bucket: form-level errors from
|
|
3149
|
+
* a root `.refine()` or a path-less `setErrors`. `form.meta.ownErrors`
|
|
3150
|
+
* (with `firstOwnError`) is the banner accessor for those.
|
|
3151
|
+
*/
|
|
3152
|
+
readonly ownErrors: readonly ValidationError[];
|
|
3118
3153
|
/**
|
|
3119
3154
|
* `true` while a per-field validation run is in flight at this path.
|
|
3120
3155
|
* Reflects field-level debounced runs (`validate-on-change`) and
|
|
@@ -3235,9 +3270,28 @@ type FieldState<Value = unknown> = {
|
|
|
3235
3270
|
* decides when to render it.
|
|
3236
3271
|
*
|
|
3237
3272
|
* On container paths, the first error in the aggregated subtree
|
|
3238
|
-
* (descendants sorted by `pathOrdinal`).
|
|
3273
|
+
* (descendants sorted by `pathOrdinal`). For the container's OWN
|
|
3274
|
+
* first error only, read `firstOwnError`.
|
|
3239
3275
|
*/
|
|
3240
3276
|
readonly firstError: ValidationError | undefined;
|
|
3277
|
+
/**
|
|
3278
|
+
* The first `ValidationError` in `ownErrors` (this exact path's own
|
|
3279
|
+
* bucket), or `undefined` when that bucket is empty. Equivalent to
|
|
3280
|
+
* `ownErrors[0]`, the exact-path counterpart to `firstError`.
|
|
3281
|
+
*
|
|
3282
|
+
* On a leaf this equals `firstError`. On a container it is the
|
|
3283
|
+
* container's own cross-field error (a fieldset `.refine()`), never a
|
|
3284
|
+
* child's. `form.meta.firstOwnError` is the form-level banner: the
|
|
3285
|
+
* first root `[]` error from a root `.refine()` or a path-less
|
|
3286
|
+
* `setErrors`:
|
|
3287
|
+
*
|
|
3288
|
+
* ```vue
|
|
3289
|
+
* <p v-if="form.meta.firstOwnError" role="alert">
|
|
3290
|
+
* {{ form.meta.firstOwnError.message }}
|
|
3291
|
+
* </p>
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
readonly firstOwnError: ValidationError | undefined;
|
|
3241
3295
|
readonly path: ReadonlyArray<string | number>;
|
|
3242
3296
|
/**
|
|
3243
3297
|
* Stable, SSR-safe DOM id for this field, unique across every mount
|
|
@@ -3601,11 +3655,13 @@ type FormErrorsSurface<Form> = ErrorsProxyShape<Form> & {
|
|
|
3601
3655
|
<const S extends ReadonlyArray<string | number>>(segments: S & ([JoinSegments<S>] extends [FlatPath<Form>] ? unknown : never)): readonly ValidationError[];
|
|
3602
3656
|
(segments: ReadonlyArray<string | number>): readonly ValidationError[];
|
|
3603
3657
|
/**
|
|
3604
|
-
* No-arg call returns the whole-form error aggregate
|
|
3605
|
-
* `form.meta.errors`: every field error plus
|
|
3606
|
-
*
|
|
3607
|
-
*
|
|
3608
|
-
*
|
|
3658
|
+
* No-arg call returns the whole-form error aggregate, the same as
|
|
3659
|
+
* `form.meta.errors` and `form.errors([])`: every field error plus
|
|
3660
|
+
* the root bucket. `form.errors(path)` is uniform at every depth,
|
|
3661
|
+
* including `[]`, so the root is no exception. For the root bucket
|
|
3662
|
+
* alone (a root `.refine()`, a path-less `setErrors`), read
|
|
3663
|
+
* `form.meta.ownErrors`. Always a readonly array; empty when the form
|
|
3664
|
+
* has no errors.
|
|
3609
3665
|
*/
|
|
3610
3666
|
(): readonly ValidationError[];
|
|
3611
3667
|
};
|
|
@@ -3732,7 +3788,7 @@ type FormMeta<F = unknown> = FieldState<F> & {
|
|
|
3732
3788
|
* of each new submission attempt; stays `null` on success.
|
|
3733
3789
|
*
|
|
3734
3790
|
* The submit handler does NOT re-throw — its returned promise always
|
|
3735
|
-
* resolves, so binding it to `@submit
|
|
3791
|
+
* resolves, so binding it to `@submit` never manufactures a
|
|
3736
3792
|
* `window` unhandledrejection. This is the channel for an UNEXPECTED
|
|
3737
3793
|
* submit failure (a thrown exception or rejected promise), read the
|
|
3738
3794
|
* same way in templates and after an imperative `await submit()`. An
|
|
@@ -3893,10 +3949,11 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
3893
3949
|
* Wraps your submit logic with validation and error routing.
|
|
3894
3950
|
*
|
|
3895
3951
|
* ```ts
|
|
3896
|
-
*
|
|
3952
|
+
* const onSubmit = form.handleSubmit(
|
|
3897
3953
|
* (data) => api.signup(data),
|
|
3898
3954
|
* (errors) => console.log(errors),
|
|
3899
|
-
* )
|
|
3955
|
+
* )
|
|
3956
|
+
* // Bind the returned handler: <form @submit="onSubmit">
|
|
3900
3957
|
* ```
|
|
3901
3958
|
*
|
|
3902
3959
|
* `data` is the strictly-typed parsed value — refinements have
|
|
@@ -4591,5 +4648,5 @@ type UseFormReturnType<Form extends GenericForm, GetValueFormType extends Generi
|
|
|
4591
4648
|
blankPaths: ComputedRef<BlankPathsView>;
|
|
4592
4649
|
};
|
|
4593
4650
|
|
|
4594
|
-
export { ROOT_PATH as
|
|
4595
|
-
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
|
/**
|