attaform 0.18.1 → 0.19.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 +3 -0
- package/dist/chunks/devtools.cjs +1 -1
- package/dist/chunks/devtools.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/session-storage.cjs +1 -1
- package/dist/chunks/session-storage.mjs +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +68 -75
- package/dist/index.d.mts +68 -75
- package/dist/index.d.ts +68 -75
- 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.DsC3rZHG.mjs → attaform.BTi-PsHr.mjs} +544 -134
- package/dist/shared/attaform.BTi-PsHr.mjs.map +1 -0
- package/dist/shared/{attaform.iTqxvl-P.d.mts → attaform.BTpuvGec.d.ts} +46 -13
- package/dist/shared/{attaform.BqK_L4gK.cjs → attaform.BqEfHpVB.cjs} +119 -1
- package/dist/shared/attaform.BqEfHpVB.cjs.map +1 -0
- package/dist/shared/{attaform.DK9aj0N8.d.ts → attaform.BtBmfLQN.d.mts} +46 -13
- package/dist/shared/{attaform.Dj9mwbaV.d.mts → attaform.C0uGZQ4M.d.cts} +365 -86
- package/dist/shared/{attaform.Dj9mwbaV.d.ts → attaform.C0uGZQ4M.d.mts} +365 -86
- package/dist/shared/{attaform.Dj9mwbaV.d.cts → attaform.C0uGZQ4M.d.ts} +365 -86
- package/dist/shared/{attaform.II89Pcf4.cjs → attaform.C1msmO2v.cjs} +544 -134
- package/dist/shared/attaform.C1msmO2v.cjs.map +1 -0
- package/dist/shared/{attaform.tts_OM7j.d.cts → attaform.CBjmobqk.d.cts} +1 -1
- package/dist/shared/{attaform.2b7M2mww.d.mts → attaform.CJ-e9gYI.d.ts} +1 -1
- package/dist/shared/{attaform.tsNFcEW7.d.ts → attaform.CRNA0vrd.d.mts} +1 -1
- package/dist/shared/{attaform.BDdFdjeX.mjs → attaform.Cghpuav8.mjs} +3 -3
- package/dist/shared/{attaform.BDdFdjeX.mjs.map → attaform.Cghpuav8.mjs.map} +1 -1
- package/dist/shared/{attaform.CtNUB9nf.mjs → attaform.CiMqJHDm.mjs} +3 -3
- package/dist/shared/{attaform.CtNUB9nf.mjs.map → attaform.CiMqJHDm.mjs.map} +1 -1
- package/dist/shared/{attaform.5UhpSVFI.cjs → attaform.CoxJ8Qm8.cjs} +2 -2
- package/dist/shared/{attaform.5UhpSVFI.cjs.map → attaform.CoxJ8Qm8.cjs.map} +1 -1
- package/dist/shared/{attaform.Xhg0AYNa.mjs → attaform.CrpjyXdO.mjs} +120 -2
- package/dist/shared/attaform.CrpjyXdO.mjs.map +1 -0
- package/dist/shared/{attaform.DF8wo-ry.d.ts → attaform.D4I63aBV.d.ts} +1 -1
- package/dist/shared/{attaform.DVLB6CAn.d.mts → attaform.DXYHL99q.d.mts} +1 -1
- package/dist/shared/{attaform.Dlk1jMuv.cjs → attaform.JBx8cfMA.cjs} +3 -3
- package/dist/shared/{attaform.Dlk1jMuv.cjs.map → attaform.JBx8cfMA.cjs.map} +1 -1
- package/dist/shared/{attaform.DUHru0OF.cjs → attaform.OznWyOPy.cjs} +3 -3
- package/dist/shared/{attaform.DUHru0OF.cjs.map → attaform.OznWyOPy.cjs.map} +1 -1
- package/dist/shared/{attaform.M33WKVV4.d.cts → attaform.QvygsFGh.d.cts} +1 -1
- package/dist/shared/{attaform.Xt0A3QUd.mjs → attaform.a3uBo-gw.mjs} +3 -3
- package/dist/shared/{attaform.Xt0A3QUd.mjs.map → attaform.a3uBo-gw.mjs.map} +1 -1
- package/dist/shared/{attaform.DoSuaKMd.d.cts → attaform.ePUcKxId.d.cts} +46 -13
- package/dist/zod-v3.cjs +3 -3
- package/dist/zod-v3.d.cts +4 -4
- package/dist/zod-v3.d.mts +4 -4
- package/dist/zod-v3.d.ts +4 -4
- 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 +4 -4
- package/dist/zod.d.cts +6 -6
- package/dist/zod.d.mts +6 -6
- package/dist/zod.d.ts +6 -6
- package/dist/zod.mjs +5 -5
- package/package.json +5 -5
- package/dist/shared/attaform.BqK_L4gK.cjs.map +0 -1
- package/dist/shared/attaform.DsC3rZHG.mjs.map +0 -1
- package/dist/shared/attaform.II89Pcf4.cjs.map +0 -1
- package/dist/shared/attaform.Xhg0AYNa.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as FormKey, ae as SlimPrimitiveKind, C as CoercionEntry, g as CoercionRegistry, G as GenericForm, T as PathKey, S as Path, am as ValidationError, A as AbstractSchema, x as GetDisplayState, aq as WriteMeta, D as DeepPartial, ar as WriteShape, ak as ValidateOn, Y as PersistOptInRegistry, aa as Segment, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.C0uGZQ4M.mjs';
|
|
2
2
|
import { Ref, ComputedRef, App, InjectionKey } from 'vue';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -517,19 +517,29 @@ declare const defaultCoercionRules: CoercionRegistry;
|
|
|
517
517
|
*/
|
|
518
518
|
/**
|
|
519
519
|
* Per-path field status. Replaced wholesale (not mutated in place) on
|
|
520
|
-
* every change.
|
|
520
|
+
* every change. Five semantic groups:
|
|
521
521
|
*
|
|
522
522
|
* - `connected` — is a DOM element registered for this path?
|
|
523
523
|
* - `focused` / `blurred` — DOM-state flags. `null` while no element
|
|
524
524
|
* is connected (no DOM means the concepts don't apply); plain
|
|
525
525
|
* booleans once connected, with the invariant `blurred === !focused`
|
|
526
526
|
* enforced by `markFocused`.
|
|
527
|
-
* - `touched` —
|
|
527
|
+
* - `touched` — focus/blur history, not DOM state. Always a plain
|
|
528
528
|
* boolean: `false` at registration, sticky `true` after first blur,
|
|
529
529
|
* cleared only by `form.reset()` / `form.resetField(path)`. Persists
|
|
530
530
|
* across disconnects so v-if'd-away fields don't lose their touched
|
|
531
531
|
* state on rehide (wizard "show review of touched fields" patterns
|
|
532
532
|
* rely on this).
|
|
533
|
+
* - `interacted` — value-mutation history, not DOM state. Plain
|
|
534
|
+
* boolean: `false` at registration, sticky `true` once the user
|
|
535
|
+
* issues a value edit through the directive's input listeners
|
|
536
|
+
* (never on hydration, default seeding, or programmatic setValue);
|
|
537
|
+
* cleared with `touched` by `form.reset()` / `form.resetField(path)`.
|
|
538
|
+
* - `blurredAfterInteraction` — the first blur that follows a value
|
|
539
|
+
* edit (the field has been edited and then left). Plain boolean,
|
|
540
|
+
* sticky `true`. A tab-through blur with no prior edit does NOT set
|
|
541
|
+
* it (`interacted` is still false at that blur). Composes
|
|
542
|
+
* `interacted` with the departure; drives the default display gate.
|
|
533
543
|
*/
|
|
534
544
|
type FieldRecord = {
|
|
535
545
|
readonly path: Path;
|
|
@@ -538,6 +548,8 @@ type FieldRecord = {
|
|
|
538
548
|
readonly focused: boolean | null;
|
|
539
549
|
readonly blurred: boolean | null;
|
|
540
550
|
readonly touched: boolean;
|
|
551
|
+
readonly interacted: boolean;
|
|
552
|
+
readonly blurredAfterInteraction: boolean;
|
|
541
553
|
};
|
|
542
554
|
/** Per-path DOM element tracking. Client-only. */
|
|
543
555
|
type ElementRecord = {
|
|
@@ -649,15 +661,14 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
649
661
|
*/
|
|
650
662
|
readonly ssr: boolean;
|
|
651
663
|
/**
|
|
652
|
-
* Resolved `
|
|
653
|
-
* and `form.meta.
|
|
654
|
-
* `
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
* config falls through to `defaultShouldShowErrors`.
|
|
664
|
+
* Resolved `getDisplayState` predicate driving `field.displayState`,
|
|
665
|
+
* the `show*` booleans, and their `form.meta` rollups. Resolved once
|
|
666
|
+
* at construction via `resolveGetDisplayState(options.getDisplayState)`;
|
|
667
|
+
* `undefined` config falls through to `defaultDisplayState`. The
|
|
668
|
+
* field-state computeds read the resolved function directly on every
|
|
669
|
+
* read.
|
|
659
670
|
*/
|
|
660
|
-
readonly
|
|
671
|
+
readonly getDisplayState: GetDisplayState;
|
|
661
672
|
readonly submitting: Ref<boolean>;
|
|
662
673
|
readonly activeSubmissions: Ref<number>;
|
|
663
674
|
readonly submissionAttempts: Ref<number>;
|
|
@@ -831,6 +842,14 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
831
842
|
*/
|
|
832
843
|
setValueAtPath(path: Path, value: unknown, meta?: WriteMeta): boolean;
|
|
833
844
|
getValueAtPath(path: Path): unknown;
|
|
845
|
+
/**
|
|
846
|
+
* Stable identity for the array element at `path`. An array element
|
|
847
|
+
* (numeric last segment) carries its allocated identity token,
|
|
848
|
+
* maintained by `array-identity.ts` across structural mutations.
|
|
849
|
+
* Empty for any non-array-element path: a record entry, a
|
|
850
|
+
* fixed-object field, a container, or the root. Backs `FieldState.key`.
|
|
851
|
+
*/
|
|
852
|
+
arrayElementKey(path: Path): string;
|
|
834
853
|
reset(nextDefaultValues?: DeepPartial<WriteShape<F>>): void;
|
|
835
854
|
resetField(path: Path): void;
|
|
836
855
|
/**
|
|
@@ -894,6 +913,12 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
894
913
|
readonly instance?: WriteMeta['instance'];
|
|
895
914
|
}): void;
|
|
896
915
|
markTouched(path: Path): void;
|
|
916
|
+
/**
|
|
917
|
+
* Flip `interacted: true` on a leaf — the sticky value-mutation flag.
|
|
918
|
+
* Driven by the directive's input listeners (via the RegisterValue's
|
|
919
|
+
* `markInteracted`); idempotent, never set by programmatic writes.
|
|
920
|
+
*/
|
|
921
|
+
markInteracted(path: Path): void;
|
|
897
922
|
/**
|
|
898
923
|
* Walk every active-variant leaf under `segments` and flip
|
|
899
924
|
* `touched: true`. Powers `form.touch(path?)`. Idempotent;
|
|
@@ -920,6 +945,14 @@ type FormStore<F extends GenericForm, G extends GenericForm = F> = {
|
|
|
920
945
|
* isn't exposed to consumers.
|
|
921
946
|
*/
|
|
922
947
|
isPristineAtPath(path: Path): boolean;
|
|
948
|
+
/**
|
|
949
|
+
* Whether any tracked array under `path` has changed shape — a reorder,
|
|
950
|
+
* insert, or removal — relative to its construction/reset baseline. The
|
|
951
|
+
* structural half of `dirty`: per-element baselines travel with their
|
|
952
|
+
* element across a mutation, so a positional value comparison alone can
|
|
953
|
+
* no longer see the shape change.
|
|
954
|
+
*/
|
|
955
|
+
hasStructuralChangeUnder(path: Path): boolean;
|
|
923
956
|
getFieldRecord(path: Path): FieldRecord | undefined;
|
|
924
957
|
getOriginalAtPath(path: Path): unknown;
|
|
925
958
|
/**
|
|
@@ -1647,5 +1680,5 @@ declare const AttaformErrorCode: {
|
|
|
1647
1680
|
};
|
|
1648
1681
|
type AttaformErrorCode = (typeof AttaformErrorCode)[keyof typeof AttaformErrorCode];
|
|
1649
1682
|
|
|
1650
|
-
export { AttaformErrorCode as
|
|
1651
|
-
export type {
|
|
1683
|
+
export { AttaformErrorCode as b, createRegistry as p, defaultCoercionRules as q, defineCoercion as r, getRegistryFromApp as s, injectForm as t, injectWizard as u, kAttaformRegistry as v, lazy as w, useRegister as x, useRegistry as y, useWizard as z };
|
|
1684
|
+
export type { AggregateError as A, CompiledStep as C, FormStatus as F, InjectWizardInput as I, LazyMarker as L, SSRDetectOptions as S, UseRegisterReturn as U, WizardCtx as W, AnyForm as a, AttaformRegistry as c, SerializedFormData as d, StepSlot as e, UseWizardReturnType as f, WizardCtxForm as g, WizardOnError as h, WizardOnSubmit as i, WizardOptions as j, WizardPersistFn as k, WizardRestoreFn as l, WizardRestoreState as m, WizardStatusesProxy as n, WizardSubmitContext as o };
|