attaform 0.21.0 → 0.21.1
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/dist/chunks/dev-key-collision-warnings.cjs +1 -1
- package/dist/chunks/dev-key-collision-warnings.mjs +1 -1
- package/dist/chunks/devtools.cjs +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/chunks/indexeddb.cjs +1 -1
- package/dist/chunks/indexeddb.mjs +1 -1
- package/dist/chunks/local-storage.cjs +1 -1
- package/dist/chunks/local-storage.mjs +1 -1
- package/dist/chunks/multi-tab-sync.cjs +2 -2
- package/dist/chunks/multi-tab-sync.mjs +2 -2
- package/dist/chunks/session-storage.cjs +1 -1
- package/dist/chunks/session-storage.mjs +1 -1
- package/dist/chunks/wire-persistence.cjs +2 -2
- package/dist/chunks/wire-persistence.mjs +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +15 -14
- package/dist/index.d.mts +15 -14
- package/dist/index.d.ts +15 -14
- package/dist/index.mjs +5 -5
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.mts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/runtime/plugins/attaform.cjs +2 -2
- package/dist/runtime/plugins/attaform.mjs +2 -2
- package/dist/shared/{attaform.BzvOdiSI.cjs → attaform.BSkvn43g.cjs} +4 -4
- package/dist/shared/{attaform.BzvOdiSI.cjs.map → attaform.BSkvn43g.cjs.map} +1 -1
- package/dist/shared/{attaform.F8LMHHWV.d.cts → attaform.BWfliRIK.d.cts} +78 -2
- package/dist/shared/{attaform.r3PePkDR.mjs → attaform.Be8NZG9M.mjs} +9 -3
- package/dist/shared/attaform.Be8NZG9M.mjs.map +1 -0
- package/dist/shared/{attaform.CEf6wYfD.cjs → attaform.Bq5sX7TF.cjs} +2 -2
- package/dist/shared/{attaform.CEf6wYfD.cjs.map → attaform.Bq5sX7TF.cjs.map} +1 -1
- package/dist/shared/{attaform.7lzO9pdM.d.mts → attaform.Bv7dRDWK.d.ts} +78 -2
- package/dist/shared/{attaform._rsCZy2j.cjs → attaform.CICFZ1iS.cjs} +9 -3
- package/dist/shared/attaform.CICFZ1iS.cjs.map +1 -0
- package/dist/shared/{attaform.BUszFoKq.cjs → attaform.ClXwitZj.cjs} +366 -63
- package/dist/shared/attaform.ClXwitZj.cjs.map +1 -0
- package/dist/shared/{attaform.B1nyO4ec.d.cts → attaform.D0dWZsJt.d.cts} +269 -49
- package/dist/shared/{attaform.B1nyO4ec.d.mts → attaform.D0dWZsJt.d.mts} +269 -49
- package/dist/shared/{attaform.B1nyO4ec.d.ts → attaform.D0dWZsJt.d.ts} +269 -49
- package/dist/shared/{attaform.BA3vRDos.cjs → attaform.D32WwKk6.cjs} +214 -33
- package/dist/shared/attaform.D32WwKk6.cjs.map +1 -0
- package/dist/shared/{attaform.BnK_bfcb.mjs → attaform.DMEP_ENr.mjs} +4 -4
- package/dist/shared/{attaform.PnqML3xW.cjs.map → attaform.DMEP_ENr.mjs.map} +1 -1
- package/dist/shared/{attaform.DSqO6Db7.mjs → attaform.DR6RmxWZ.mjs} +367 -64
- package/dist/shared/attaform.DR6RmxWZ.mjs.map +1 -0
- package/dist/shared/{attaform.CkjTapyq.mjs → attaform.DozgVlCE.mjs} +4 -4
- package/dist/shared/{attaform.CkjTapyq.mjs.map → attaform.DozgVlCE.mjs.map} +1 -1
- package/dist/shared/{attaform.BK1RE2ha.d.ts → attaform.Duecg2NO.d.mts} +2 -2
- package/dist/shared/{attaform.BDIEq9qP.d.cts → attaform.FudOcHaa.d.cts} +2 -2
- package/dist/shared/{attaform.BQ6drorq.d.mts → attaform.MtrpT6Ki.d.ts} +2 -2
- package/dist/shared/{attaform.CRsXyy-Y.d.ts → attaform.NQ8mybyW.d.mts} +78 -2
- package/dist/shared/{attaform.PnqML3xW.cjs → attaform.S-pYLSo4.cjs} +4 -4
- package/dist/shared/{attaform.BnK_bfcb.mjs.map → attaform.S-pYLSo4.cjs.map} +1 -1
- package/dist/shared/{attaform.ezb5Nh2t.mjs → attaform.Y1ZGhM4k.mjs} +2 -2
- package/dist/shared/{attaform.ezb5Nh2t.mjs.map → attaform.Y1ZGhM4k.mjs.map} +1 -1
- package/dist/shared/{attaform.Y_Mgg0Yp.mjs → attaform.pmtahXKy.mjs} +214 -34
- package/dist/shared/attaform.pmtahXKy.mjs.map +1 -0
- package/dist/zod-v3.cjs +3 -3
- package/dist/zod-v3.d.cts +3 -3
- package/dist/zod-v3.d.mts +3 -3
- package/dist/zod-v3.d.ts +3 -3
- package/dist/zod-v3.mjs +3 -3
- package/dist/zod-v4.cjs +3 -3
- package/dist/zod-v4.d.cts +4 -4
- package/dist/zod-v4.d.mts +4 -4
- package/dist/zod-v4.d.ts +4 -4
- package/dist/zod-v4.mjs +3 -3
- package/dist/zod.cjs +5 -5
- package/dist/zod.cjs.map +1 -1
- package/dist/zod.d.cts +52 -10
- package/dist/zod.d.mts +52 -10
- package/dist/zod.d.ts +52 -10
- package/dist/zod.mjs +6 -6
- package/dist/zod.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/shared/attaform.BA3vRDos.cjs.map +0 -1
- package/dist/shared/attaform.BUszFoKq.cjs.map +0 -1
- package/dist/shared/attaform.DSqO6Db7.mjs.map +0 -1
- package/dist/shared/attaform.Y_Mgg0Yp.mjs.map +0 -1
- package/dist/shared/attaform._rsCZy2j.cjs.map +0 -1
- package/dist/shared/attaform.r3PePkDR.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GenericForm, s as FlatPath, P as NestedType, v as FormKey,
|
|
2
|
+
import { G as GenericForm, s as FlatPath, P as NestedType, v as FormKey, al as UseFormConfiguration, A as AbstractSchema, j as DefaultValuesInput, ao as ValidateOnConfig, am as UseFormReturnType } from './attaform.D0dWZsJt.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The shape `form.values.<key>` returns at runtime.
|
|
@@ -143,7 +143,7 @@ type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema>
|
|
|
143
143
|
/**
|
|
144
144
|
* Type produced at `Path` after the full parse pipeline — the schema's
|
|
145
145
|
* `z.output<Schema>` shape at that path. Matches the `data` payload of
|
|
146
|
-
* `form.
|
|
146
|
+
* `form.parse()` and the value handed to `handleSubmit`'s callback.
|
|
147
147
|
*
|
|
148
148
|
* ```ts
|
|
149
149
|
* const schema = z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GenericForm, s as FlatPath, P as NestedType, v as FormKey,
|
|
2
|
+
import { G as GenericForm, s as FlatPath, P as NestedType, v as FormKey, al as UseFormConfiguration, A as AbstractSchema, j as DefaultValuesInput, ao as ValidateOnConfig, am as UseFormReturnType } from './attaform.D0dWZsJt.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The shape `form.values.<key>` returns at runtime.
|
|
@@ -143,7 +143,7 @@ type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema>
|
|
|
143
143
|
/**
|
|
144
144
|
* Type produced at `Path` after the full parse pipeline — the schema's
|
|
145
145
|
* `z.output<Schema>` shape at that path. Matches the `data` payload of
|
|
146
|
-
* `form.
|
|
146
|
+
* `form.parse()` and the value handed to `handleSubmit`'s callback.
|
|
147
147
|
*
|
|
148
148
|
* ```ts
|
|
149
149
|
* const schema = z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GenericForm, s as FlatPath, P as NestedType, v as FormKey,
|
|
2
|
+
import { G as GenericForm, s as FlatPath, P as NestedType, v as FormKey, al as UseFormConfiguration, A as AbstractSchema, j as DefaultValuesInput, ao as ValidateOnConfig, am as UseFormReturnType } from './attaform.D0dWZsJt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The shape `form.values.<key>` returns at runtime.
|
|
@@ -143,7 +143,7 @@ type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema>
|
|
|
143
143
|
/**
|
|
144
144
|
* Type produced at `Path` after the full parse pipeline — the schema's
|
|
145
145
|
* `z.output<Schema>` shape at that path. Matches the `data` payload of
|
|
146
|
-
* `form.
|
|
146
|
+
* `form.parse()` and the value handed to `handleSubmit`'s callback.
|
|
147
147
|
*
|
|
148
148
|
* ```ts
|
|
149
149
|
* const schema = z.object({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as FormKey, V as PathKey, m as DisplayCtx, z as GetDisplayState, n as DisplayMachine, ag as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, U as Path,
|
|
1
|
+
import { v as FormKey, V as PathKey, m as DisplayCtx, z as GetDisplayState, n as DisplayMachine, ag as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, U as Path, ap as ValidationError, A as AbstractSchema, at as WriteMeta, D as DeepPartial, au as WriteShape, aj as TransformAbortHolder, an as ValidateOn, _ as PersistOptInRegistry, f as AttaformDefaults, am as UseFormReturnType, aa as RegisterValue } from './attaform.D0dWZsJt.mjs';
|
|
2
2
|
import { Ref, ComputedRef, App, InjectionKey } from 'vue';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -414,6 +414,13 @@ type WizardForms<S> = FormsRecordOf<S> & Readonly<Record<FormKey, AnyForm>>;
|
|
|
414
414
|
* - `submissionAttempts` — count of `wizard.handleSubmit` invocations
|
|
415
415
|
* (success or failure). Always bumps, including on
|
|
416
416
|
* noop-form steps.
|
|
417
|
+
* - `submitError` — the error thrown by the most recent
|
|
418
|
+
* `wizard.handleSubmit` callback (or its `onError`),
|
|
419
|
+
* coerced to a real `Error`. Mirrors
|
|
420
|
+
* `form.meta.submitError`: cleared at submit entry and
|
|
421
|
+
* by `reset()`, parked here rather than re-thrown, so
|
|
422
|
+
* the handler resolves and never manufactures a
|
|
423
|
+
* `window` unhandledrejection. `null` on success.
|
|
417
424
|
* - `visited` — append-only breadcrumb of navigated step keys.
|
|
418
425
|
* `back()` does not pop; the trail is the audit
|
|
419
426
|
* log, not the back-stack.
|
|
@@ -447,6 +454,7 @@ type UseWizardReturnType<S extends ReadonlyArray<StepSlot> = ReadonlyArray<StepS
|
|
|
447
454
|
readonly done: boolean;
|
|
448
455
|
readonly submitting: boolean;
|
|
449
456
|
readonly submissionAttempts: number;
|
|
457
|
+
readonly submitError: Error | null;
|
|
450
458
|
readonly visited: readonly FormKey[];
|
|
451
459
|
readonly next: () => Promise<void>;
|
|
452
460
|
readonly back: () => void;
|
|
@@ -751,7 +759,7 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
751
759
|
* alongside the rest of the submission surface.
|
|
752
760
|
*/
|
|
753
761
|
readonly submitted: Ref<boolean>;
|
|
754
|
-
readonly submitError: Ref<
|
|
762
|
+
readonly submitError: Ref<Error | null>;
|
|
755
763
|
readonly departAttempts: Ref<number>;
|
|
756
764
|
/**
|
|
757
765
|
* `true` while a function-form `defaultValues` factory is in flight.
|
|
@@ -932,6 +940,39 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
932
940
|
* the computed to both the streak start (set) and end (delete).
|
|
933
941
|
*/
|
|
934
942
|
readonly fieldValidatingSince: Map<PathKey, number>;
|
|
943
|
+
/**
|
|
944
|
+
* Per-path counter of in-flight async-transform runs (the async
|
|
945
|
+
* branch of the `register({ transforms })` pipeline). `> 0` drives
|
|
946
|
+
* `field.transforming` / `field.busy`. Counter, not flag, for the
|
|
947
|
+
* same overlap reason as `fieldValidationCounts`, except a superseding
|
|
948
|
+
* input releases the prior run synchronously before incrementing the
|
|
949
|
+
* new one — so the count is the live in-flight depth at the path
|
|
950
|
+
* (effectively 0 or 1). Reactive Map, like the validation counters.
|
|
951
|
+
*/
|
|
952
|
+
readonly fieldTransformCounts: Map<PathKey, number>;
|
|
953
|
+
/**
|
|
954
|
+
* Per-path `ssr ? 0 : Date.now()` stamp marking when the path's latest
|
|
955
|
+
* async transform opened; the display reducer reads it (as
|
|
956
|
+
* `ctx.transformingSince`) to time the gated busy spinner. Mirrors
|
|
957
|
+
* `fieldValidatingSince` exactly: re-anchored on each run start,
|
|
958
|
+
* deleted on the `→ 0` edge, reactive for the held-spinner reason.
|
|
959
|
+
*/
|
|
960
|
+
readonly fieldTransformingSince: Map<PathKey, number>;
|
|
961
|
+
/**
|
|
962
|
+
* Per-path latest async-transform failure (a rejected transform, or a
|
|
963
|
+
* resolved value the write gate refused), surfaced as
|
|
964
|
+
* `field.transformError`. Cleared when a fresh run opens at the path
|
|
965
|
+
* and on `reset()`. A channel separate from validation `errors`.
|
|
966
|
+
*/
|
|
967
|
+
readonly transformErrors: Map<PathKey, Error | null>;
|
|
968
|
+
/**
|
|
969
|
+
* Form-wide count of in-flight async-transform runs. Drives the
|
|
970
|
+
* `settleTransforms` quiescence guard and the `handleSubmit` drain
|
|
971
|
+
* barrier. `Math.max(0, …)`-clamped on release so a doubled decrement
|
|
972
|
+
* (a run's own `endTransform` after a synchronous cancel release)
|
|
973
|
+
* can't drive it negative.
|
|
974
|
+
*/
|
|
975
|
+
readonly activeTransforms: Ref<number>;
|
|
935
976
|
/**
|
|
936
977
|
* Replace the form value wholesale. Optional `meta` is forwarded to
|
|
937
978
|
* every `onFormChange` listener so they can decide whether THIS write
|
|
@@ -1099,6 +1140,41 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
1099
1140
|
* at entry (submit validation is authoritative) and by `reset()`.
|
|
1100
1141
|
*/
|
|
1101
1142
|
cancelFieldValidation(): void;
|
|
1143
|
+
/**
|
|
1144
|
+
* Open an async-transform run at `key` — bump the run token, increment
|
|
1145
|
+
* the in-flight counters, stamp `transformingSince`, clear any prior
|
|
1146
|
+
* `transformError`, register `holder` for later abort. Returns the run
|
|
1147
|
+
* token. See `InternalRegisterValue.beginTransform`.
|
|
1148
|
+
*/
|
|
1149
|
+
beginTransform(key: PathKey, holder: TransformAbortHolder): number;
|
|
1150
|
+
/** `true` while `token` is the live async-transform run at `key`. */
|
|
1151
|
+
isCurrentTransform(key: PathKey, token: number): boolean;
|
|
1152
|
+
/**
|
|
1153
|
+
* Close the run `token` at `key`: release the counters (no-op if the
|
|
1154
|
+
* run was already released by a supersede / cancel) and flush settled
|
|
1155
|
+
* `settleTransforms` waiters.
|
|
1156
|
+
*/
|
|
1157
|
+
endTransform(key: PathKey, token: number): void;
|
|
1158
|
+
/** Record a per-field normalization failure at `key` (`field.transformError`). */
|
|
1159
|
+
setTransformError(key: PathKey, err: Error): void;
|
|
1160
|
+
/**
|
|
1161
|
+
* Abort + release every in-flight async-transform run (all paths) and
|
|
1162
|
+
* clear `transformErrors`. Mirrors `cancelFieldValidation`; called by
|
|
1163
|
+
* `reset()` and store teardown.
|
|
1164
|
+
*/
|
|
1165
|
+
cancelTransforms(): void;
|
|
1166
|
+
/**
|
|
1167
|
+
* Path-scoped counterpart to `cancelTransforms`: abort + release only
|
|
1168
|
+
* the runs at-or-under `prefix`, clearing their `transformError`.
|
|
1169
|
+
* Called by `resetField`.
|
|
1170
|
+
*/
|
|
1171
|
+
cancelTransformsUnder(prefix: Path): void;
|
|
1172
|
+
/**
|
|
1173
|
+
* Resolve once async transforms are quiescent — globally (`path`
|
|
1174
|
+
* omitted) or at-or-under `path`. Resolve-never-reject. See
|
|
1175
|
+
* `UseFormReturnType.settleTransforms`.
|
|
1176
|
+
*/
|
|
1177
|
+
settleTransforms(path?: string | Path): Promise<void>;
|
|
1102
1178
|
/**
|
|
1103
1179
|
* Kick off (or schedule) a field-level validation run for `path`. Pass
|
|
1104
1180
|
* `path = []` to cover the whole form; `applySchemaErrorsForSubtree`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const injectWizard = require('./attaform.
|
|
4
|
-
const paths = require('./attaform.
|
|
5
|
-
const walkFieldMeta = require('./attaform.
|
|
3
|
+
const injectWizard = require('./attaform.ClXwitZj.cjs');
|
|
4
|
+
const paths = require('./attaform.D32WwKk6.cjs');
|
|
5
|
+
const walkFieldMeta = require('./attaform.CICFZ1iS.cjs');
|
|
6
6
|
const zod = require('zod');
|
|
7
7
|
|
|
8
8
|
const fieldMeta = walkFieldMeta.fieldMetaStore;
|
|
@@ -1302,4 +1302,4 @@ exports.unwrapPipe = unwrapPipe;
|
|
|
1302
1302
|
exports.useForm = useForm;
|
|
1303
1303
|
exports.withMeta = withMeta;
|
|
1304
1304
|
exports.zodV4Adapter = zodV4Adapter;
|
|
1305
|
-
//# sourceMappingURL=attaform.
|
|
1305
|
+
//# sourceMappingURL=attaform.S-pYLSo4.cjs.map
|