attaform 0.27.1 → 0.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/abstract.cjs +3 -2
  2. package/dist/abstract.cjs.map +1 -1
  3. package/dist/abstract.d.cts +4 -4
  4. package/dist/abstract.d.mts +4 -4
  5. package/dist/abstract.d.ts +4 -4
  6. package/dist/abstract.mjs +2 -2
  7. package/dist/chunks/devtools.cjs +1 -1
  8. package/dist/chunks/devtools.mjs +1 -1
  9. package/dist/chunks/fingerprint2.cjs +1 -1
  10. package/dist/chunks/fingerprint2.mjs +1 -1
  11. package/dist/index.cjs +4 -3
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +5 -5
  14. package/dist/index.d.mts +5 -5
  15. package/dist/index.d.ts +5 -5
  16. package/dist/index.mjs +3 -3
  17. package/dist/nuxt.d.cts +1 -1
  18. package/dist/nuxt.d.mts +1 -1
  19. package/dist/nuxt.d.ts +1 -1
  20. package/dist/runtime/plugins/attaform.cjs +1 -1
  21. package/dist/runtime/plugins/attaform.mjs +1 -1
  22. package/dist/shared/{attaform.Co5LNRnv.cjs → attaform.BBaMFa-k.cjs} +31 -5
  23. package/dist/shared/attaform.BBaMFa-k.cjs.map +1 -0
  24. package/dist/shared/{attaform.C3WnCDXz.d.cts → attaform.BIPSHY5U.d.cts} +55 -1
  25. package/dist/shared/{attaform.C3WnCDXz.d.mts → attaform.BIPSHY5U.d.mts} +55 -1
  26. package/dist/shared/{attaform.C3WnCDXz.d.ts → attaform.BIPSHY5U.d.ts} +55 -1
  27. package/dist/shared/{attaform.DDAmSFnl.mjs → attaform.BKxpBJVF.mjs} +3 -3
  28. package/dist/shared/{attaform.DDAmSFnl.mjs.map → attaform.BKxpBJVF.mjs.map} +1 -1
  29. package/dist/shared/{attaform.C__F01CE.cjs → attaform.BOIpRdeG.cjs} +4 -4
  30. package/dist/shared/{attaform.C__F01CE.cjs.map → attaform.BOIpRdeG.cjs.map} +1 -1
  31. package/dist/shared/{attaform.D99pd7JG.d.cts → attaform.BjGedLx2.d.cts} +181 -24
  32. package/dist/shared/{attaform.8tFZu1Ub.cjs → attaform.Bn0IzhD_.cjs} +50 -2
  33. package/dist/shared/attaform.Bn0IzhD_.cjs.map +1 -0
  34. package/dist/shared/{attaform.CyQxTOdX.mjs → attaform.BqkFQ2B9.mjs} +332 -84
  35. package/dist/shared/attaform.BqkFQ2B9.mjs.map +1 -0
  36. package/dist/shared/{attaform.CC_y1_Ej.d.ts → attaform.C8zVmank.d.ts} +1 -1
  37. package/dist/shared/{attaform.CpXHK60W.d.cts → attaform.C925L0WA.d.mts} +1 -1
  38. package/dist/shared/{attaform.kBkYlKP_.d.mts → attaform.CEZP3i3I.d.mts} +181 -24
  39. package/dist/shared/{attaform.Da8EdI2t.mjs → attaform.CgsQZdy1.mjs} +31 -5
  40. package/dist/shared/attaform.CgsQZdy1.mjs.map +1 -0
  41. package/dist/shared/{attaform.CvVYOvZF.d.mts → attaform.CnvbLiIO.d.cts} +1 -1
  42. package/dist/shared/{attaform.BERt5YMU.mjs → attaform.Cs2Rbdlo.mjs} +50 -2
  43. package/dist/shared/attaform.Cs2Rbdlo.mjs.map +1 -0
  44. package/dist/shared/{attaform.BceJrhQ7.mjs → attaform.DDIn4fv-.mjs} +4 -4
  45. package/dist/shared/{attaform.BceJrhQ7.mjs.map → attaform.DDIn4fv-.mjs.map} +1 -1
  46. package/dist/shared/{attaform.DkD0DR7R.mjs → attaform.DHQjaGMP.mjs} +5 -5
  47. package/dist/shared/{attaform.DkD0DR7R.mjs.map → attaform.DHQjaGMP.mjs.map} +1 -1
  48. package/dist/shared/{attaform.DhVgG2jh.cjs → attaform.DeHCOlC8.cjs} +4 -4
  49. package/dist/shared/{attaform.DhVgG2jh.cjs.map → attaform.DeHCOlC8.cjs.map} +1 -1
  50. package/dist/shared/{attaform.DlSu08F5.mjs → attaform.DuVCclwv.mjs} +4 -4
  51. package/dist/shared/{attaform.DlSu08F5.mjs.map → attaform.DuVCclwv.mjs.map} +1 -1
  52. package/dist/shared/{attaform.K6Thc6By.cjs → attaform.Mg4g-J0z.cjs} +5 -5
  53. package/dist/shared/{attaform.K6Thc6By.cjs.map → attaform.Mg4g-J0z.cjs.map} +1 -1
  54. package/dist/shared/{attaform.Drsi43GG.cjs → attaform.dX58Auwf.cjs} +3 -3
  55. package/dist/shared/{attaform.Drsi43GG.cjs.map → attaform.dX58Auwf.cjs.map} +1 -1
  56. package/dist/shared/{attaform.CEXUlUkc.d.ts → attaform.gqOCvpSB.d.ts} +181 -24
  57. package/dist/shared/{attaform.DQT7_-FO.cjs → attaform.ij2W7VTw.cjs} +331 -82
  58. package/dist/shared/attaform.ij2W7VTw.cjs.map +1 -0
  59. package/dist/transforms.cjs +1 -1
  60. package/dist/transforms.mjs +1 -1
  61. package/dist/vite.cjs +3 -2
  62. package/dist/vite.cjs.map +1 -1
  63. package/dist/vite.mjs +3 -2
  64. package/dist/vite.mjs.map +1 -1
  65. package/dist/zod-v3.cjs +4 -3
  66. package/dist/zod-v3.cjs.map +1 -1
  67. package/dist/zod-v3.d.cts +3 -3
  68. package/dist/zod-v3.d.mts +3 -3
  69. package/dist/zod-v3.d.ts +3 -3
  70. package/dist/zod-v3.mjs +3 -3
  71. package/dist/zod-v4.cjs +4 -3
  72. package/dist/zod-v4.cjs.map +1 -1
  73. package/dist/zod-v4.d.cts +6 -6
  74. package/dist/zod-v4.d.mts +6 -6
  75. package/dist/zod-v4.d.ts +6 -6
  76. package/dist/zod-v4.mjs +3 -3
  77. package/dist/zod.cjs +4 -3
  78. package/dist/zod.cjs.map +1 -1
  79. package/dist/zod.d.cts +3 -3
  80. package/dist/zod.d.mts +3 -3
  81. package/dist/zod.d.ts +3 -3
  82. package/dist/zod.mjs +3 -3
  83. package/package.json +3 -2
  84. package/dist/shared/attaform.8tFZu1Ub.cjs.map +0 -1
  85. package/dist/shared/attaform.BERt5YMU.mjs.map +0 -1
  86. package/dist/shared/attaform.Co5LNRnv.cjs.map +0 -1
  87. package/dist/shared/attaform.CyQxTOdX.mjs.map +0 -1
  88. package/dist/shared/attaform.DQT7_-FO.cjs.map +0 -1
  89. package/dist/shared/attaform.Da8EdI2t.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { ObjectDirective, Ref, ComputedRef } from 'vue';
1
+ import { ObjectDirective, Ref, ComputedRef, MaybeRefOrGetter } from 'vue';
2
2
 
3
3
  /**
4
4
  * Schema-attached field metadata — the shared types used by both Zod
@@ -1733,6 +1733,29 @@ type UseFormConfiguration<Form extends GenericForm, GetValueFormType, Schema ext
1733
1733
  * the policy silently no-ops.
1734
1734
  */
1735
1735
  onInvalidSubmit?: OnInvalidSubmitPolicy;
1736
+ /**
1737
+ * Freeze the form's data. When this resolves truthy every value write
1738
+ * no-ops at the store's write chokepoint (programmatic `setValue`, the
1739
+ * `v-register` directive, and host-model events alike), native
1740
+ * registered inputs render the HTML `disabled` attribute, component
1741
+ * hosts receive a `disabled` flag on their register value, and every
1742
+ * field's `displayState` drops to `'idle'` so error, pending, and
1743
+ * success signals stand down. The first blocked write logs a one-time
1744
+ * dev warning; writes never throw.
1745
+ *
1746
+ * `reset()` and `defaultValues` hydration still apply while frozen, so
1747
+ * a disabled form can be populated or cleared programmatically. This is
1748
+ * a data freeze only: a disabled form stays navigable, which is what a
1749
+ * read-only review page wants.
1750
+ *
1751
+ * Accepts a boolean, a ref, a computed, or a getter, read live so the
1752
+ * freeze tracks a reactive source. `undefined` resolves to `false`.
1753
+ * Falls back to `AttaformDefaults.disabled`.
1754
+ *
1755
+ * A shared FormStore resolves `disabled` from its first `useForm({ key })`
1756
+ * call; a later caller passing a different value is ignored.
1757
+ */
1758
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
1736
1759
  /**
1737
1760
  * When per-field VALIDATION runs (the directive's listener controls
1738
1761
  * how often storage commits — per keystroke by default, per blur
@@ -1917,6 +1940,8 @@ type AttaformDefaults = {
1917
1940
  history?: HistoryConfig;
1918
1941
  /** Default for `useForm({ rememberVariants })`. */
1919
1942
  rememberVariants?: boolean;
1943
+ /** Default for `useForm({ disabled })` — freeze the form's data. */
1944
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
1920
1945
  /**
1921
1946
  * Default for `useForm({ coerce })`. Schema-driven coercion of
1922
1947
  * user-typed DOM values at the v-register directive layer.
@@ -2583,6 +2608,26 @@ type RegisterValue<Value = unknown> = Readonly<{
2583
2608
  * patching `el.value` back to `'0'` (the slim default).
2584
2609
  */
2585
2610
  displayValue: Readonly<Ref<string>>;
2611
+ /**
2612
+ * Blank-aware model presentation for a `v-register` component host's
2613
+ * `:modelValue`. Returns `undefined` when the path is in the form's
2614
+ * `blankPaths` set (the typed-model analog of `displayValue`'s `''`),
2615
+ * otherwise the raw typed storage. Lets a cleared numeric field read
2616
+ * empty in a v-model-bound component the way it does in a native
2617
+ * input. Read only by the compile-time component-bridge transform's
2618
+ * `:modelValue` injection.
2619
+ * @internal
2620
+ */
2621
+ hostModelValue: Readonly<Ref<Value | undefined>>;
2622
+ /**
2623
+ * Live `true` when this binding's form is frozen via
2624
+ * `useForm({ disabled })`. The compile-time transforms bind it to the
2625
+ * host's `:disabled`, so a native `<input v-register>` renders the
2626
+ * HTML `disabled` attribute (SSR and client) and a component host
2627
+ * receives a `disabled` prop. Read it directly from a custom
2628
+ * `useRegister` integration to drive your own disabled affordance.
2629
+ */
2630
+ disabled: Readonly<Ref<boolean>>;
2586
2631
  /**
2587
2632
  * Add this field's path to the form's `blankPaths` set,
2588
2633
  * writing the slim default to storage. Returns the `setValueAtPath`
@@ -3341,6 +3386,15 @@ type FieldState<Value = unknown> = {
3341
3386
  */
3342
3387
  readonly key: string;
3343
3388
  readonly blank: boolean;
3389
+ /**
3390
+ * `true` when this field's form is frozen via `useForm({ disabled })`.
3391
+ * While disabled, value writes no-op and this field's `displayState`
3392
+ * is forced to `'idle'` so error, pending, and success signals stand
3393
+ * down. A form-level flag: every field of a disabled form reads
3394
+ * `true`, and the form root exposes it as `form.meta.disabled`. Bind
3395
+ * read-only or styling affordances off this.
3396
+ */
3397
+ readonly disabled: boolean;
3344
3398
  /**
3345
3399
  * Presentational label for this field. Resolves through the
3346
3400
  * shared cross-adapter field-meta store — written via
@@ -1,4 +1,4 @@
1
- import { ObjectDirective, Ref, ComputedRef } from 'vue';
1
+ import { ObjectDirective, Ref, ComputedRef, MaybeRefOrGetter } from 'vue';
2
2
 
3
3
  /**
4
4
  * Schema-attached field metadata — the shared types used by both Zod
@@ -1733,6 +1733,29 @@ type UseFormConfiguration<Form extends GenericForm, GetValueFormType, Schema ext
1733
1733
  * the policy silently no-ops.
1734
1734
  */
1735
1735
  onInvalidSubmit?: OnInvalidSubmitPolicy;
1736
+ /**
1737
+ * Freeze the form's data. When this resolves truthy every value write
1738
+ * no-ops at the store's write chokepoint (programmatic `setValue`, the
1739
+ * `v-register` directive, and host-model events alike), native
1740
+ * registered inputs render the HTML `disabled` attribute, component
1741
+ * hosts receive a `disabled` flag on their register value, and every
1742
+ * field's `displayState` drops to `'idle'` so error, pending, and
1743
+ * success signals stand down. The first blocked write logs a one-time
1744
+ * dev warning; writes never throw.
1745
+ *
1746
+ * `reset()` and `defaultValues` hydration still apply while frozen, so
1747
+ * a disabled form can be populated or cleared programmatically. This is
1748
+ * a data freeze only: a disabled form stays navigable, which is what a
1749
+ * read-only review page wants.
1750
+ *
1751
+ * Accepts a boolean, a ref, a computed, or a getter, read live so the
1752
+ * freeze tracks a reactive source. `undefined` resolves to `false`.
1753
+ * Falls back to `AttaformDefaults.disabled`.
1754
+ *
1755
+ * A shared FormStore resolves `disabled` from its first `useForm({ key })`
1756
+ * call; a later caller passing a different value is ignored.
1757
+ */
1758
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
1736
1759
  /**
1737
1760
  * When per-field VALIDATION runs (the directive's listener controls
1738
1761
  * how often storage commits — per keystroke by default, per blur
@@ -1917,6 +1940,8 @@ type AttaformDefaults = {
1917
1940
  history?: HistoryConfig;
1918
1941
  /** Default for `useForm({ rememberVariants })`. */
1919
1942
  rememberVariants?: boolean;
1943
+ /** Default for `useForm({ disabled })` — freeze the form's data. */
1944
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
1920
1945
  /**
1921
1946
  * Default for `useForm({ coerce })`. Schema-driven coercion of
1922
1947
  * user-typed DOM values at the v-register directive layer.
@@ -2583,6 +2608,26 @@ type RegisterValue<Value = unknown> = Readonly<{
2583
2608
  * patching `el.value` back to `'0'` (the slim default).
2584
2609
  */
2585
2610
  displayValue: Readonly<Ref<string>>;
2611
+ /**
2612
+ * Blank-aware model presentation for a `v-register` component host's
2613
+ * `:modelValue`. Returns `undefined` when the path is in the form's
2614
+ * `blankPaths` set (the typed-model analog of `displayValue`'s `''`),
2615
+ * otherwise the raw typed storage. Lets a cleared numeric field read
2616
+ * empty in a v-model-bound component the way it does in a native
2617
+ * input. Read only by the compile-time component-bridge transform's
2618
+ * `:modelValue` injection.
2619
+ * @internal
2620
+ */
2621
+ hostModelValue: Readonly<Ref<Value | undefined>>;
2622
+ /**
2623
+ * Live `true` when this binding's form is frozen via
2624
+ * `useForm({ disabled })`. The compile-time transforms bind it to the
2625
+ * host's `:disabled`, so a native `<input v-register>` renders the
2626
+ * HTML `disabled` attribute (SSR and client) and a component host
2627
+ * receives a `disabled` prop. Read it directly from a custom
2628
+ * `useRegister` integration to drive your own disabled affordance.
2629
+ */
2630
+ disabled: Readonly<Ref<boolean>>;
2586
2631
  /**
2587
2632
  * Add this field's path to the form's `blankPaths` set,
2588
2633
  * writing the slim default to storage. Returns the `setValueAtPath`
@@ -3341,6 +3386,15 @@ type FieldState<Value = unknown> = {
3341
3386
  */
3342
3387
  readonly key: string;
3343
3388
  readonly blank: boolean;
3389
+ /**
3390
+ * `true` when this field's form is frozen via `useForm({ disabled })`.
3391
+ * While disabled, value writes no-op and this field's `displayState`
3392
+ * is forced to `'idle'` so error, pending, and success signals stand
3393
+ * down. A form-level flag: every field of a disabled form reads
3394
+ * `true`, and the form root exposes it as `form.meta.disabled`. Bind
3395
+ * read-only or styling affordances off this.
3396
+ */
3397
+ readonly disabled: boolean;
3344
3398
  /**
3345
3399
  * Presentational label for this field. Resolves through the
3346
3400
  * shared cross-adapter field-meta store — written via
@@ -1,4 +1,4 @@
1
- import { ObjectDirective, Ref, ComputedRef } from 'vue';
1
+ import { ObjectDirective, Ref, ComputedRef, MaybeRefOrGetter } from 'vue';
2
2
 
3
3
  /**
4
4
  * Schema-attached field metadata — the shared types used by both Zod
@@ -1733,6 +1733,29 @@ type UseFormConfiguration<Form extends GenericForm, GetValueFormType, Schema ext
1733
1733
  * the policy silently no-ops.
1734
1734
  */
1735
1735
  onInvalidSubmit?: OnInvalidSubmitPolicy;
1736
+ /**
1737
+ * Freeze the form's data. When this resolves truthy every value write
1738
+ * no-ops at the store's write chokepoint (programmatic `setValue`, the
1739
+ * `v-register` directive, and host-model events alike), native
1740
+ * registered inputs render the HTML `disabled` attribute, component
1741
+ * hosts receive a `disabled` flag on their register value, and every
1742
+ * field's `displayState` drops to `'idle'` so error, pending, and
1743
+ * success signals stand down. The first blocked write logs a one-time
1744
+ * dev warning; writes never throw.
1745
+ *
1746
+ * `reset()` and `defaultValues` hydration still apply while frozen, so
1747
+ * a disabled form can be populated or cleared programmatically. This is
1748
+ * a data freeze only: a disabled form stays navigable, which is what a
1749
+ * read-only review page wants.
1750
+ *
1751
+ * Accepts a boolean, a ref, a computed, or a getter, read live so the
1752
+ * freeze tracks a reactive source. `undefined` resolves to `false`.
1753
+ * Falls back to `AttaformDefaults.disabled`.
1754
+ *
1755
+ * A shared FormStore resolves `disabled` from its first `useForm({ key })`
1756
+ * call; a later caller passing a different value is ignored.
1757
+ */
1758
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
1736
1759
  /**
1737
1760
  * When per-field VALIDATION runs (the directive's listener controls
1738
1761
  * how often storage commits — per keystroke by default, per blur
@@ -1917,6 +1940,8 @@ type AttaformDefaults = {
1917
1940
  history?: HistoryConfig;
1918
1941
  /** Default for `useForm({ rememberVariants })`. */
1919
1942
  rememberVariants?: boolean;
1943
+ /** Default for `useForm({ disabled })` — freeze the form's data. */
1944
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
1920
1945
  /**
1921
1946
  * Default for `useForm({ coerce })`. Schema-driven coercion of
1922
1947
  * user-typed DOM values at the v-register directive layer.
@@ -2583,6 +2608,26 @@ type RegisterValue<Value = unknown> = Readonly<{
2583
2608
  * patching `el.value` back to `'0'` (the slim default).
2584
2609
  */
2585
2610
  displayValue: Readonly<Ref<string>>;
2611
+ /**
2612
+ * Blank-aware model presentation for a `v-register` component host's
2613
+ * `:modelValue`. Returns `undefined` when the path is in the form's
2614
+ * `blankPaths` set (the typed-model analog of `displayValue`'s `''`),
2615
+ * otherwise the raw typed storage. Lets a cleared numeric field read
2616
+ * empty in a v-model-bound component the way it does in a native
2617
+ * input. Read only by the compile-time component-bridge transform's
2618
+ * `:modelValue` injection.
2619
+ * @internal
2620
+ */
2621
+ hostModelValue: Readonly<Ref<Value | undefined>>;
2622
+ /**
2623
+ * Live `true` when this binding's form is frozen via
2624
+ * `useForm({ disabled })`. The compile-time transforms bind it to the
2625
+ * host's `:disabled`, so a native `<input v-register>` renders the
2626
+ * HTML `disabled` attribute (SSR and client) and a component host
2627
+ * receives a `disabled` prop. Read it directly from a custom
2628
+ * `useRegister` integration to drive your own disabled affordance.
2629
+ */
2630
+ disabled: Readonly<Ref<boolean>>;
2586
2631
  /**
2587
2632
  * Add this field's path to the form's `blankPaths` set,
2588
2633
  * writing the slim default to storage. Returns the `setValueAtPath`
@@ -3341,6 +3386,15 @@ type FieldState<Value = unknown> = {
3341
3386
  */
3342
3387
  readonly key: string;
3343
3388
  readonly blank: boolean;
3389
+ /**
3390
+ * `true` when this field's form is frozen via `useForm({ disabled })`.
3391
+ * While disabled, value writes no-op and this field's `displayState`
3392
+ * is forced to `'idle'` so error, pending, and success signals stand
3393
+ * down. A form-level flag: every field of a disabled form reads
3394
+ * `true`, and the form root exposes it as `form.meta.disabled`. Bind
3395
+ * read-only or styling affordances off this.
3396
+ */
3397
+ readonly disabled: boolean;
3344
3398
  /**
3345
3399
  * Presentational label for this field. Resolves through the
3346
3400
  * shared cross-adapter field-meta store — written via
@@ -1,5 +1,5 @@
1
- import { A as AttaformErrorCode, k as isPlainRecord, s as safeOwnRead, n as safeAssign, o as slimKindOf } from './attaform.CyQxTOdX.mjs';
2
- import { f as canonicalizePath } from './attaform.Da8EdI2t.mjs';
1
+ import { A as AttaformErrorCode, n as isPlainRecord, s as safeOwnRead, o as safeAssign, p as slimKindOf } from './attaform.BqkFQ2B9.mjs';
2
+ import { f as canonicalizePath } from './attaform.CgsQZdy1.mjs';
3
3
 
4
4
  const PATH_SEPARATOR = ".";
5
5
  function createAbstractSchema(rootSchema, intro, services, formKey, options) {
@@ -904,4 +904,4 @@ function walkForMeta(schema, path, map, counters, lastPathPerSchema, inProgress,
904
904
  }
905
905
 
906
906
  export { NO_EMBEDDED_DEFAULT as N, getFieldMetaListForSchema as a, getFieldMetaPathMap as b, createAbstractSchema as c, deriveDefaultWalk as d, fieldMetaStore as f, getFieldMetaForSchema as g, mergeDeep as m, peelEmbeddedDefault as p, slimPrimitivesWalk as s, walkPathSegments as w };
907
- //# sourceMappingURL=attaform.DDAmSFnl.mjs.map
907
+ //# sourceMappingURL=attaform.BKxpBJVF.mjs.map