attaform 0.20.1 → 0.20.2

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/devtools.cjs +2 -2
  3. package/dist/chunks/devtools.cjs.map +1 -1
  4. package/dist/chunks/devtools.mjs +2 -2
  5. package/dist/chunks/devtools.mjs.map +1 -1
  6. package/dist/chunks/indexeddb.cjs +1 -1
  7. package/dist/chunks/indexeddb.mjs +1 -1
  8. package/dist/chunks/local-storage.cjs +1 -1
  9. package/dist/chunks/local-storage.mjs +1 -1
  10. package/dist/chunks/session-storage.cjs +1 -1
  11. package/dist/chunks/session-storage.mjs +1 -1
  12. package/dist/index.cjs +3 -3
  13. package/dist/index.d.cts +4 -4
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.mjs +5 -5
  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 +2 -2
  21. package/dist/runtime/plugins/attaform.mjs +2 -2
  22. package/dist/shared/{attaform.SfhU0OEY.d.cts → attaform.99cfHcIt.d.cts} +26 -9
  23. package/dist/shared/{attaform.SfhU0OEY.d.mts → attaform.99cfHcIt.d.mts} +26 -9
  24. package/dist/shared/{attaform.SfhU0OEY.d.ts → attaform.99cfHcIt.d.ts} +26 -9
  25. package/dist/shared/{attaform.tVkmQh5w.mjs → attaform.BGk8cfw2.mjs} +3 -3
  26. package/dist/shared/{attaform.tVkmQh5w.mjs.map → attaform.BGk8cfw2.mjs.map} +1 -1
  27. package/dist/shared/{attaform.GbDo_lJi.d.cts → attaform.BXinSW2T.d.mts} +1 -1
  28. package/dist/shared/{attaform.DHRWn-cu.cjs → attaform.B_hph5AE.cjs} +3 -3
  29. package/dist/shared/{attaform.DHRWn-cu.cjs.map → attaform.B_hph5AE.cjs.map} +1 -1
  30. package/dist/shared/{attaform.iWo9soNX.mjs → attaform.C5aYC_T8.mjs} +4 -4
  31. package/dist/shared/{attaform.iWo9soNX.mjs.map → attaform.C5aYC_T8.mjs.map} +1 -1
  32. package/dist/shared/{attaform.BrrXNmfK.cjs → attaform.Cd4AOfwu.cjs} +4 -4
  33. package/dist/shared/{attaform.BrrXNmfK.cjs.map → attaform.Cd4AOfwu.cjs.map} +1 -1
  34. package/dist/shared/{attaform.EZG6fOFb.mjs → attaform.CnrxbkB6.mjs} +2 -2
  35. package/dist/shared/{attaform.EZG6fOFb.mjs.map → attaform.CnrxbkB6.mjs.map} +1 -1
  36. package/dist/shared/{attaform.DLnE5bZa.cjs → attaform.CwLjUqmQ.cjs} +7 -3
  37. package/dist/shared/attaform.CwLjUqmQ.cjs.map +1 -0
  38. package/dist/shared/{attaform.DoKXru-a.d.mts → attaform.CywE4y8x.d.cts} +1 -1
  39. package/dist/shared/{attaform.BPxsYtTe.cjs → attaform.D2SCCd4O.cjs} +2 -2
  40. package/dist/shared/{attaform.BPxsYtTe.cjs.map → attaform.D2SCCd4O.cjs.map} +1 -1
  41. package/dist/shared/{attaform.BCBxTyMC.cjs → attaform.DAKrGhxc.cjs} +4 -4
  42. package/dist/shared/{attaform.BCBxTyMC.cjs.map → attaform.DAKrGhxc.cjs.map} +1 -1
  43. package/dist/shared/{attaform.Dl5kDY-A.d.ts → attaform.DN5CvZrg.d.ts} +1 -1
  44. package/dist/shared/{attaform.D5-1XGQU.d.cts → attaform.DbRgDFa7.d.cts} +1 -1
  45. package/dist/shared/{attaform.D6CwqkPx.mjs → attaform.Dt7dEcHk.mjs} +4 -4
  46. package/dist/shared/{attaform.D6CwqkPx.mjs.map → attaform.Dt7dEcHk.mjs.map} +1 -1
  47. package/dist/shared/{attaform.BKozEdTr.mjs → attaform.QG5TG8lB.mjs} +51 -35
  48. package/dist/shared/attaform.QG5TG8lB.mjs.map +1 -0
  49. package/dist/shared/{attaform.EMzJcQci.d.mts → attaform.ceGEAEMk.d.ts} +1 -1
  50. package/dist/shared/{attaform.Bh3ACtts.d.ts → attaform.sWm8B15V.d.mts} +1 -1
  51. package/dist/shared/{attaform.BqZuwLTK.mjs → attaform.tiWEVznj.mjs} +7 -3
  52. package/dist/shared/attaform.tiWEVznj.mjs.map +1 -0
  53. package/dist/shared/{attaform.BPy-4qRx.cjs → attaform.z5j3LwJz.cjs} +51 -34
  54. package/dist/shared/attaform.z5j3LwJz.cjs.map +1 -0
  55. package/dist/zod-v3.cjs +3 -3
  56. package/dist/zod-v3.d.cts +3 -3
  57. package/dist/zod-v3.d.mts +3 -3
  58. package/dist/zod-v3.d.ts +3 -3
  59. package/dist/zod-v3.mjs +3 -3
  60. package/dist/zod-v4.cjs +3 -3
  61. package/dist/zod-v4.d.cts +4 -4
  62. package/dist/zod-v4.d.mts +4 -4
  63. package/dist/zod-v4.d.ts +4 -4
  64. package/dist/zod-v4.mjs +3 -3
  65. package/dist/zod.cjs +5 -5
  66. package/dist/zod.d.cts +5 -5
  67. package/dist/zod.d.mts +5 -5
  68. package/dist/zod.d.ts +5 -5
  69. package/dist/zod.mjs +6 -6
  70. package/package.json +3 -3
  71. package/dist/shared/attaform.BKozEdTr.mjs.map +0 -1
  72. package/dist/shared/attaform.BPy-4qRx.cjs.map +0 -1
  73. package/dist/shared/attaform.BqZuwLTK.mjs.map +0 -1
  74. package/dist/shared/attaform.DLnE5bZa.cjs.map +0 -1
@@ -1,4 +1,4 @@
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, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.SfhU0OEY.mjs';
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, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.99cfHcIt.js';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
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, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.SfhU0OEY.js';
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, f as AttaformDefaults, aj as UseFormReturnType, a8 as RegisterValue } from './attaform.99cfHcIt.mjs';
2
2
  import { Ref, ComputedRef, App, InjectionKey } from 'vue';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { computed, ref, watchEffect, getCurrentScope, onScopeDispose, shallowReadonly, readonly, reactive, toRaw, watch, markRaw, shallowRef, getCurrentInstance, onServerPrefetch, provide, useId, inject, effectScope, nextTick } from 'vue';
2
- import { _ as __DEV__, j as canonicalizePath, E as segmentsForPathKey, s as isPathPrefix, b as FORM_ERRORS_PATH_KEY, S as SubmitErrorHandlerError, A as AnonPersistError, k as captureUserCallSite, I as INTERACTIVE_TAG_NAMES, e as ROOT_PATH_KEY, R as ROOT_PATH, h as allowSensitivePersist, F as FORM_ERRORS_PATH, l as coerceToPathKey, u as isSensitivePath, o as createPersistOptInRegistry, d as InvalidUseFormConfigError, q as ensureAttaformInstalled, H as useRegistry, y as kFormContext, z as kFormInstanceId, g as ReservedFormKeyError, n as createIsSensitivePath, x as kAttaformWizardActiveStepResolver, v as kAttaformAncestorWizard } from './attaform.BKozEdTr.mjs';
2
+ import { _ as __DEV__, j as canonicalizePath, G as segmentsForPathKey, t as isPathPrefix, b as FORM_ERRORS_PATH_KEY, S as SubmitErrorHandlerError, A as AnonPersistError, k as captureUserCallSite, I as INTERACTIVE_TAG_NAMES, r as getOrAssignElementId, e as ROOT_PATH_KEY, R as ROOT_PATH, h as allowSensitivePersist, F as FORM_ERRORS_PATH, l as coerceToPathKey, v as isSensitivePath, o as createPersistOptInRegistry, d as InvalidUseFormConfigError, q as ensureAttaformInstalled, J as useRegistry, z as kFormContext, B as kFormInstanceId, g as ReservedFormKeyError, n as createIsSensitivePath, y as kAttaformWizardActiveStepResolver, w as kAttaformAncestorWizard } from './attaform.QG5TG8lB.mjs';
3
3
 
4
4
  function safeAssign(target, key, value) {
5
5
  if (key === "__proto__") {
@@ -2306,6 +2306,7 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2306
2306
  const isRequired = state.schema.isRequiredAtPath(segments);
2307
2307
  const ariaEnabled = options?.autoAria ?? formAutoAria;
2308
2308
  const ariaDisplayState = getDisplayStateAt !== void 0 ? computed(() => getDisplayStateAt(segments)) : void 0;
2309
+ let boundElement = null;
2309
2310
  const internalRv = {
2310
2311
  innerRef,
2311
2312
  displayValue,
@@ -2324,6 +2325,7 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2324
2325
  state.markInteracted(segments);
2325
2326
  },
2326
2327
  registerElement: (element) => {
2328
+ boundElement = element;
2327
2329
  if (!INTERACTIVE_TAG_NAMES.has(element.tagName)) return;
2328
2330
  const added = state.registerElement(segments, element, formInstanceId);
2329
2331
  if (added) attachFocusListeners(state, segments, element, instanceMeta);
@@ -2331,9 +2333,11 @@ function buildRegister(state, formInstanceId, instanceConfig) {
2331
2333
  deregisterElement: (element) => {
2332
2334
  detachFocusListeners(element);
2333
2335
  state.deregisterElement(segments, element);
2336
+ if (boundElement === element) boundElement = null;
2334
2337
  },
2335
2338
  setValueWithInternalPath: (value, meta) => {
2336
- return state.setValueAtPath(segments, value, withInstanceMeta(meta));
2339
+ const resolvedMeta = meta === void 0 && boundElement !== null ? { persist: state.persistOptIns.hasOptIn(getOrAssignElementId(boundElement), pathKey) } : meta;
2340
+ return state.setValueAtPath(segments, value, withInstanceMeta(resolvedMeta));
2337
2341
  },
2338
2342
  // Called by the `vRegisterHint` compile-time transform's wrapping
2339
2343
  // IIFE on every server-side render of `<element v-register="…">`.
@@ -7203,4 +7207,4 @@ function warnIfAmbientWizardProviderHadDuplicates() {
7203
7207
  }
7204
7208
 
7205
7209
  export { AttaformErrorCode as A, defaultDisplayState as a, defineCoercion as b, injectWizard as c, defaultCoercionRules as d, isPlainRecord as e, isUnset as f, getAtPath as g, humanize as h, injectForm as i, safeOwnRead as j, setAtPath as k, lazy as l, slimKindOf as m, normalizeNumericOption as n, useAbstractForm as o, useWizard as p, safeAssign as s, unset as u };
7206
- //# sourceMappingURL=attaform.BqZuwLTK.mjs.map
7210
+ //# sourceMappingURL=attaform.tiWEVznj.mjs.map