attaform 0.22.0 → 0.23.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 +7 -10
- package/dist/chunks/dev-key-collision-warnings.cjs +0 -33
- package/dist/chunks/dev-key-collision-warnings.cjs.map +1 -1
- package/dist/chunks/dev-key-collision-warnings.mjs +1 -33
- package/dist/chunks/dev-key-collision-warnings.mjs.map +1 -1
- package/dist/chunks/devtools.cjs +3 -5
- package/dist/chunks/devtools.cjs.map +1 -1
- package/dist/chunks/devtools.mjs +3 -5
- package/dist/chunks/devtools.mjs.map +1 -1
- package/dist/chunks/fingerprint2.cjs +1 -1
- package/dist/chunks/fingerprint2.mjs +1 -1
- package/dist/index.cjs +3 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -41
- package/dist/index.d.mts +6 -41
- package/dist/index.d.ts +6 -41
- 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/components/AttaformDevtoolsPanel.vue +3 -11
- package/dist/runtime/plugins/attaform.cjs +2 -2
- package/dist/runtime/plugins/attaform.mjs +2 -2
- package/dist/shared/{attaform.BGwNZ9GV.d.cts → attaform.BGMRvckW.d.ts} +10 -77
- package/dist/shared/{attaform.DvUH4a3o.d.ts → attaform.BJnNK75Y.d.cts} +45 -670
- package/dist/shared/{attaform.DvUH4a3o.d.mts → attaform.BJnNK75Y.d.mts} +45 -670
- package/dist/shared/{attaform.DvUH4a3o.d.cts → attaform.BJnNK75Y.d.ts} +45 -670
- package/dist/shared/{attaform.BKFwekY2.mjs → attaform.BhI9Icek.mjs} +3 -287
- package/dist/shared/attaform.BhI9Icek.mjs.map +1 -0
- package/dist/shared/{attaform.CRzpFCjV.cjs → attaform.BibT5AS_.cjs} +2 -2
- package/dist/shared/{attaform.CRzpFCjV.cjs.map → attaform.BibT5AS_.cjs.map} +1 -1
- package/dist/shared/{attaform.DkA5J8NW.d.cts → attaform.CO0e7YVY.d.cts} +1 -46
- package/dist/shared/{attaform.DkA5J8NW.d.ts → attaform.CO0e7YVY.d.mts} +1 -46
- package/dist/shared/{attaform.DkA5J8NW.d.mts → attaform.CO0e7YVY.d.ts} +1 -46
- package/dist/shared/{attaform.Q3eAD2wD.cjs → attaform.CaYj3ZfY.cjs} +3 -3
- package/dist/shared/{attaform.Q3eAD2wD.cjs.map → attaform.CaYj3ZfY.cjs.map} +1 -1
- package/dist/shared/{attaform.AyujQoHp.cjs → attaform.Cmb_LCie.cjs} +4 -4
- package/dist/shared/{attaform.DNuiFCXG.mjs.map → attaform.Cmb_LCie.cjs.map} +1 -1
- package/dist/shared/{attaform.CsB-iKbU.mjs → attaform.CtJOd7ox.mjs} +81 -591
- package/dist/shared/attaform.CtJOd7ox.mjs.map +1 -0
- package/dist/shared/{attaform.DgCfLqay.mjs → attaform.CzVta5o2.mjs} +4 -4
- package/dist/shared/attaform.CzVta5o2.mjs.map +1 -0
- package/dist/shared/{attaform.FN0vaQAg.d.mts → attaform.D52oJiYC.d.cts} +1 -1
- package/dist/shared/{attaform.aekT7mMx.d.cts → attaform.DCkSNnPr.d.mts} +1 -1
- package/dist/shared/{attaform.01iKS_lz.cjs → attaform.Db4E4IW6.cjs} +2 -294
- package/dist/shared/attaform.Db4E4IW6.cjs.map +1 -0
- package/dist/shared/{attaform.C-RtnCJM.cjs → attaform.DbyTD8N2.cjs} +4 -4
- package/dist/shared/attaform.DbyTD8N2.cjs.map +1 -0
- package/dist/shared/{attaform.DCjgGir_.mjs → attaform.Dd1Kmmaj.mjs} +3 -3
- package/dist/shared/{attaform.DCjgGir_.mjs.map → attaform.Dd1Kmmaj.mjs.map} +1 -1
- package/dist/shared/{attaform.D4XYaasQ.d.ts → attaform.DrY8srOp.d.mts} +10 -77
- package/dist/shared/{attaform.CjMcwV7W.cjs → attaform.DsQkXE3o.cjs} +79 -599
- package/dist/shared/attaform.DsQkXE3o.cjs.map +1 -0
- package/dist/shared/{attaform.CCCeEPwa.d.mts → attaform.DuPneYR0.d.cts} +10 -77
- package/dist/shared/{attaform.6xE0Lcfd.mjs → attaform.Dx9-QQE2.mjs} +2 -2
- package/dist/shared/{attaform.6xE0Lcfd.mjs.map → attaform.Dx9-QQE2.mjs.map} +1 -1
- package/dist/shared/{attaform.DUMWQefY.d.ts → attaform.WEwfXcHq.d.ts} +1 -1
- package/dist/shared/{attaform.DNuiFCXG.mjs → attaform.alpG7rT7.mjs} +4 -4
- package/dist/shared/{attaform.AyujQoHp.cjs.map → attaform.alpG7rT7.mjs.map} +1 -1
- package/dist/zod-v3.cjs +2 -2
- 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 +2 -2
- package/dist/zod-v4.cjs +2 -2
- package/dist/zod-v4.d.cts +5 -5
- package/dist/zod-v4.d.mts +5 -5
- package/dist/zod-v4.d.ts +5 -5
- package/dist/zod-v4.mjs +2 -2
- package/dist/zod.cjs +5 -5
- package/dist/zod.d.cts +5 -5
- package/dist/zod.d.mts +5 -5
- package/dist/zod.d.ts +5 -5
- package/dist/zod.mjs +5 -5
- package/package.json +1 -1
- package/dist/chunks/indexeddb.cjs +0 -119
- package/dist/chunks/indexeddb.cjs.map +0 -1
- package/dist/chunks/indexeddb.mjs +0 -117
- package/dist/chunks/indexeddb.mjs.map +0 -1
- package/dist/chunks/local-storage.cjs +0 -58
- package/dist/chunks/local-storage.cjs.map +0 -1
- package/dist/chunks/local-storage.mjs +0 -56
- package/dist/chunks/local-storage.mjs.map +0 -1
- package/dist/chunks/multi-tab-sync.cjs +0 -367
- package/dist/chunks/multi-tab-sync.cjs.map +0 -1
- package/dist/chunks/multi-tab-sync.mjs +0 -364
- package/dist/chunks/multi-tab-sync.mjs.map +0 -1
- package/dist/chunks/session-storage.cjs +0 -58
- package/dist/chunks/session-storage.cjs.map +0 -1
- package/dist/chunks/session-storage.mjs +0 -56
- package/dist/chunks/session-storage.mjs.map +0 -1
- package/dist/chunks/wire-persistence.cjs +0 -396
- package/dist/chunks/wire-persistence.cjs.map +0 -1
- package/dist/chunks/wire-persistence.mjs +0 -394
- package/dist/chunks/wire-persistence.mjs.map +0 -1
- package/dist/shared/attaform.01iKS_lz.cjs.map +0 -1
- package/dist/shared/attaform.BKFwekY2.mjs.map +0 -1
- package/dist/shared/attaform.C-RtnCJM.cjs.map +0 -1
- package/dist/shared/attaform.CjMcwV7W.cjs.map +0 -1
- package/dist/shared/attaform.CsB-iKbU.mjs.map +0 -1
- package/dist/shared/attaform.DgCfLqay.mjs.map +0 -1
|
@@ -2,9 +2,6 @@ import { shallowReactive, getCurrentInstance, inject, isRef, effectScope, watch,
|
|
|
2
2
|
|
|
3
3
|
const __DEV__ = (typeof process !== "undefined" ? process.env.NODE_ENV : "production") !== "production";
|
|
4
4
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
5
|
class AttaformError extends Error {
|
|
9
6
|
constructor(message, options) {
|
|
10
7
|
super(message, options);
|
|
@@ -48,24 +45,6 @@ class ReservedFormKeyError extends AttaformError {
|
|
|
48
45
|
);
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
class AnonPersistError extends AttaformError {
|
|
52
|
-
constructor(opts) {
|
|
53
|
-
super(formatAnonPersistMessage(opts));
|
|
54
|
-
__publicField(this, "schemaFields");
|
|
55
|
-
__publicField(this, "callSite");
|
|
56
|
-
__publicField(this, "cause");
|
|
57
|
-
this.schemaFields = opts.schemaFields;
|
|
58
|
-
this.callSite = opts.callSite;
|
|
59
|
-
this.cause = opts.cause;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function formatAnonPersistMessage(opts) {
|
|
63
|
-
const head = opts.cause === "no-key" ? `useForm({ persist: ... }) requires an explicit \`key:\`. Anonymous synthetic keys (\`__atta:anon:*\`) drift across mounts and can collide between unrelated forms \u2014 refusing to persist to a non-deterministic location.` : `register(_, { persist: true }) declared on a form whose useForm() options have no \`persist:\` configured. The opt-in is recorded but nothing would ever land in storage.`;
|
|
64
|
-
const fields = opts.schemaFields !== void 0 && opts.schemaFields.length > 0 ? ` Form fields: { ${opts.schemaFields.join(", ")} }.` : "";
|
|
65
|
-
const fix = opts.cause === "no-key" ? ` Fix: add \`key: '<stable-id>'\` to useForm().` : ` Fix: add \`persist: 'session'\` (or 'local') and \`key:\` to useForm(), or remove \`{ persist: true }\` from this register() call.`;
|
|
66
|
-
const where = opts.callSite !== void 0 ? ` ${opts.callSite}` : "";
|
|
67
|
-
return `[attaform] ${head}${fields}${fix}${where}`;
|
|
68
|
-
}
|
|
69
48
|
|
|
70
49
|
function detectSSR(options = {}) {
|
|
71
50
|
if (options.ssr !== void 0) return options.ssr;
|
|
@@ -617,21 +596,6 @@ function readFilesFromInput(el) {
|
|
|
617
596
|
if (files === null || files.length === 0) return null;
|
|
618
597
|
return files.item(0);
|
|
619
598
|
}
|
|
620
|
-
const warnedPersistedFileForms = __DEV__ ? /* @__PURE__ */ new WeakMap() : null;
|
|
621
|
-
function maybeWarnPersistedFile(value) {
|
|
622
|
-
if (!__DEV__ || warnedPersistedFileForms === null) return;
|
|
623
|
-
if (value.persist !== true) return;
|
|
624
|
-
let warnedPaths = warnedPersistedFileForms.get(value.persistOptIns);
|
|
625
|
-
if (warnedPaths === void 0) {
|
|
626
|
-
warnedPaths = /* @__PURE__ */ new Set();
|
|
627
|
-
warnedPersistedFileForms.set(value.persistOptIns, warnedPaths);
|
|
628
|
-
}
|
|
629
|
-
if (warnedPaths.has(value.path)) return;
|
|
630
|
-
warnedPaths.add(value.path);
|
|
631
|
-
warn(
|
|
632
|
-
`[attaform] register('${value.path}', { persist: true }) on <input type="file"> \u2014 files can't ride a refresh (browsers block programmatic writes to <input type="file">), so this path won't be saved. For long-lived flows, upload on selection and persist the resulting URL or ID in a sibling string field.`
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
599
|
const fileScopeKey = Symbol.for("attaform:file-scope");
|
|
636
600
|
const vRegisterFile = {
|
|
637
601
|
created(el, { value }, vnode) {
|
|
@@ -639,7 +603,6 @@ const vRegisterFile = {
|
|
|
639
603
|
const input = el;
|
|
640
604
|
value.registerElement(input);
|
|
641
605
|
setAssignFunction(input, vnode, value);
|
|
642
|
-
maybeWarnPersistedFile(value);
|
|
643
606
|
const currentRaw = value.innerRef.value;
|
|
644
607
|
if (isBlankFileValue(currentRaw)) {
|
|
645
608
|
const blankShape = isMultipleInput(input, vnode) ? [] : null;
|
|
@@ -689,250 +652,11 @@ const vRegisterFile = {
|
|
|
689
652
|
}
|
|
690
653
|
};
|
|
691
654
|
|
|
692
|
-
const idGenerator = /* @__PURE__ */ (() => {
|
|
693
|
-
let counter = 0;
|
|
694
|
-
return () => `el-${++counter}`;
|
|
695
|
-
})();
|
|
696
|
-
const elementIds = /* @__PURE__ */ new WeakMap();
|
|
697
|
-
function getOrAssignElementId(el) {
|
|
698
|
-
let id = elementIds.get(el);
|
|
699
|
-
if (id === void 0) {
|
|
700
|
-
id = idGenerator();
|
|
701
|
-
elementIds.set(el, id);
|
|
702
|
-
}
|
|
703
|
-
return id;
|
|
704
|
-
}
|
|
705
|
-
function createPersistOptInRegistry() {
|
|
706
|
-
const byPath = /* @__PURE__ */ new Map();
|
|
707
|
-
function add(elementId, path) {
|
|
708
|
-
const existing = byPath.get(path);
|
|
709
|
-
if (existing === void 0) {
|
|
710
|
-
byPath.set(path, /* @__PURE__ */ new Set([elementId]));
|
|
711
|
-
return;
|
|
712
|
-
}
|
|
713
|
-
existing.add(elementId);
|
|
714
|
-
}
|
|
715
|
-
function remove(elementId, path) {
|
|
716
|
-
const existing = byPath.get(path);
|
|
717
|
-
if (existing === void 0) return;
|
|
718
|
-
existing.delete(elementId);
|
|
719
|
-
if (existing.size === 0) byPath.delete(path);
|
|
720
|
-
}
|
|
721
|
-
function removeAllFor(elementId) {
|
|
722
|
-
for (const [path, ids] of byPath) {
|
|
723
|
-
if (!ids.delete(elementId)) continue;
|
|
724
|
-
if (ids.size === 0) byPath.delete(path);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
function hasOptIn(elementId, path) {
|
|
728
|
-
return byPath.get(path)?.has(elementId) ?? false;
|
|
729
|
-
}
|
|
730
|
-
function hasAnyOptInForPath(path) {
|
|
731
|
-
const ids = byPath.get(path);
|
|
732
|
-
return ids !== void 0 && ids.size > 0;
|
|
733
|
-
}
|
|
734
|
-
function optedInPaths() {
|
|
735
|
-
return byPath.keys();
|
|
736
|
-
}
|
|
737
|
-
function isEmpty() {
|
|
738
|
-
return byPath.size === 0;
|
|
739
|
-
}
|
|
740
|
-
function clear() {
|
|
741
|
-
byPath.clear();
|
|
742
|
-
}
|
|
743
|
-
return {
|
|
744
|
-
add,
|
|
745
|
-
remove,
|
|
746
|
-
removeAllFor,
|
|
747
|
-
hasOptIn,
|
|
748
|
-
hasAnyOptInForPath,
|
|
749
|
-
optedInPaths,
|
|
750
|
-
isEmpty,
|
|
751
|
-
clear
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
const DEFAULT_SENSITIVE_NAMES = Object.freeze([
|
|
756
|
-
// Passwords + PIN-like
|
|
757
|
-
"password",
|
|
758
|
-
"passwd",
|
|
759
|
-
"pwd",
|
|
760
|
-
"pin",
|
|
761
|
-
// Card / payment
|
|
762
|
-
"cvv",
|
|
763
|
-
"cvc",
|
|
764
|
-
"card_number",
|
|
765
|
-
"card_num",
|
|
766
|
-
"card",
|
|
767
|
-
"iban",
|
|
768
|
-
"routing_number",
|
|
769
|
-
"account_number",
|
|
770
|
-
// Government / identity
|
|
771
|
-
"ssn",
|
|
772
|
-
"social_security",
|
|
773
|
-
"dob",
|
|
774
|
-
"date_of_birth",
|
|
775
|
-
"passport",
|
|
776
|
-
"driver_license",
|
|
777
|
-
// Tax IDs
|
|
778
|
-
"tin",
|
|
779
|
-
"ein",
|
|
780
|
-
"itin",
|
|
781
|
-
"tax_id",
|
|
782
|
-
// Tokens / secrets / API auth
|
|
783
|
-
"token",
|
|
784
|
-
"tokens",
|
|
785
|
-
"secret",
|
|
786
|
-
"secrets",
|
|
787
|
-
"api_key",
|
|
788
|
-
"api_secret",
|
|
789
|
-
"api_token",
|
|
790
|
-
"private_key",
|
|
791
|
-
"bearer",
|
|
792
|
-
"oauth",
|
|
793
|
-
"auth_token",
|
|
794
|
-
"access_token",
|
|
795
|
-
"refresh_token",
|
|
796
|
-
"session_id",
|
|
797
|
-
"session_key",
|
|
798
|
-
"session_token",
|
|
799
|
-
// MFA / OTP
|
|
800
|
-
"otp",
|
|
801
|
-
"one_time_password",
|
|
802
|
-
"one_time_code",
|
|
803
|
-
"mfa_secret",
|
|
804
|
-
"mfa_seed",
|
|
805
|
-
"mfa_code",
|
|
806
|
-
"mfa_token",
|
|
807
|
-
"two_factor_code",
|
|
808
|
-
"two_factor_token",
|
|
809
|
-
"2fa",
|
|
810
|
-
"2fa_code",
|
|
811
|
-
"2fa_token",
|
|
812
|
-
"recovery_code",
|
|
813
|
-
"backup_code"
|
|
814
|
-
]);
|
|
815
|
-
const WORD_BOUNDARY_THRESHOLD = 5;
|
|
816
|
-
function escapeRegex(s) {
|
|
817
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
818
|
-
}
|
|
819
|
-
function nameToRegex(name) {
|
|
820
|
-
const parts = name.split(/[_\s-]/).filter((p) => p.length > 0);
|
|
821
|
-
if (parts.length === 0) {
|
|
822
|
-
return /(?!)/;
|
|
823
|
-
}
|
|
824
|
-
const escaped = parts.map(escapeRegex).join("[_\\s-]?");
|
|
825
|
-
const compactLength = parts.reduce((sum, p) => sum + p.length, 0);
|
|
826
|
-
const useBoundary = compactLength <= WORD_BOUNDARY_THRESHOLD;
|
|
827
|
-
const source = useBoundary ? `\\b${escaped}\\b` : escaped;
|
|
828
|
-
return new RegExp(source, "i");
|
|
829
|
-
}
|
|
830
|
-
function namesToPatterns(names) {
|
|
831
|
-
const patterns = [];
|
|
832
|
-
for (const name of names) {
|
|
833
|
-
if (typeof name !== "string" || name.length === 0) continue;
|
|
834
|
-
patterns.push(nameToRegex(name));
|
|
835
|
-
}
|
|
836
|
-
return patterns;
|
|
837
|
-
}
|
|
838
|
-
const DEFAULT_PATTERNS = namesToPatterns(DEFAULT_SENSITIVE_NAMES);
|
|
839
|
-
function createSegmentMatchesSensitive(names = DEFAULT_SENSITIVE_NAMES) {
|
|
840
|
-
const patterns = names === DEFAULT_SENSITIVE_NAMES ? DEFAULT_PATTERNS : namesToPatterns(names);
|
|
841
|
-
return (segment) => {
|
|
842
|
-
if (typeof segment !== "string") return false;
|
|
843
|
-
for (const p of patterns) {
|
|
844
|
-
if (p.test(segment)) return true;
|
|
845
|
-
}
|
|
846
|
-
return false;
|
|
847
|
-
};
|
|
848
|
-
}
|
|
849
|
-
function createIsSensitivePath(names = DEFAULT_SENSITIVE_NAMES) {
|
|
850
|
-
const segmentMatches = createSegmentMatchesSensitive(names);
|
|
851
|
-
return (path) => {
|
|
852
|
-
if (typeof path !== "string") {
|
|
853
|
-
for (const segment of path) {
|
|
854
|
-
if (segmentMatches(segment)) return true;
|
|
855
|
-
}
|
|
856
|
-
return false;
|
|
857
|
-
}
|
|
858
|
-
if (path.startsWith("[")) {
|
|
859
|
-
try {
|
|
860
|
-
const parsed = JSON.parse(path);
|
|
861
|
-
if (Array.isArray(parsed)) {
|
|
862
|
-
for (const segment of parsed) {
|
|
863
|
-
if (segmentMatches(segment)) return true;
|
|
864
|
-
}
|
|
865
|
-
return false;
|
|
866
|
-
}
|
|
867
|
-
} catch {
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
for (const segment of path.split(".")) {
|
|
871
|
-
if (segmentMatches(segment)) return true;
|
|
872
|
-
}
|
|
873
|
-
return false;
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
const defaultIsSensitivePath = createIsSensitivePath();
|
|
877
|
-
function isSensitivePath(path) {
|
|
878
|
-
return defaultIsSensitivePath(path);
|
|
879
|
-
}
|
|
880
|
-
const warnedSensitivePersist = __DEV__ ? /* @__PURE__ */ new Set() : null;
|
|
881
|
-
function allowSensitivePersist(path, acknowledged, isSensitive = defaultIsSensitivePath) {
|
|
882
|
-
if (acknowledged) return true;
|
|
883
|
-
if (!isSensitive(path)) return true;
|
|
884
|
-
if (warnedSensitivePersist !== null) {
|
|
885
|
-
const display = Array.isArray(path) ? path.join(".") : String(path);
|
|
886
|
-
if (!warnedSensitivePersist.has(display)) {
|
|
887
|
-
warnedSensitivePersist.add(display);
|
|
888
|
-
console.warn(
|
|
889
|
-
`[attaform] Not persisting "${display}" \u2014 it matches a sensitive-name pattern (password / cvv / ssn / token / etc.) and was opted into persistence without \`acknowledgeSensitive: true\`. Storing sensitive data in client-side storage is a compliance risk (PII / PCI-DSS / HIPAA / SOC2). Persist it server-side, or pass \`acknowledgeSensitive: true\` to register() / form.persist() if this is intentional.`
|
|
890
|
-
);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
return false;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
function syncPersistOptIn(el, value, oldValue, vnodeType) {
|
|
897
|
-
const wasOptedIn = isRegisterValue(oldValue) && oldValue.persist === true;
|
|
898
|
-
const isFileInput = el.tagName === "INPUT" && (vnodeType === "file" || el.type === "file");
|
|
899
|
-
const wantsOptIn = !isFileInput && isRegisterValue(value) && value.persist === true;
|
|
900
|
-
if (!wasOptedIn && !wantsOptIn) return;
|
|
901
|
-
const elementId = getOrAssignElementId(el);
|
|
902
|
-
if (wasOptedIn) {
|
|
903
|
-
const old = oldValue;
|
|
904
|
-
const samePathAndRegistry = wantsOptIn && value.path === old.path && value.persistOptIns === old.persistOptIns;
|
|
905
|
-
if (!samePathAndRegistry) {
|
|
906
|
-
old.persistOptIns.remove(elementId, old.path);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
if (wantsOptIn) {
|
|
910
|
-
const v = value;
|
|
911
|
-
if (allowSensitivePersist(v.path, v.acknowledgeSensitive, v.isSensitivePath)) {
|
|
912
|
-
v.persistOptIns.add(elementId, v.path);
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
function syncMultiTabOptOut(value, oldValue) {
|
|
917
|
-
const wasOptedOut = isRegisterValue(oldValue) && oldValue.unmarkNoSync !== void 0;
|
|
918
|
-
const wantsOptOut = isRegisterValue(value) && value.markNoSync !== void 0;
|
|
919
|
-
if (!wasOptedOut && !wantsOptOut) return;
|
|
920
|
-
if (wasOptedOut) {
|
|
921
|
-
const old = oldValue;
|
|
922
|
-
const samePath = wantsOptOut && value.path === old.path;
|
|
923
|
-
if (!samePath) old.unmarkNoSync?.();
|
|
924
|
-
}
|
|
925
|
-
if (wantsOptOut) {
|
|
926
|
-
const v = value;
|
|
927
|
-
const samePathOld = wasOptedOut && oldValue.path === v.path;
|
|
928
|
-
if (!samePathOld) v.markNoSync?.();
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
655
|
function syncElementRegistration(el, value, oldValue) {
|
|
932
656
|
const wasRegistered = isRegisterValue(oldValue);
|
|
933
657
|
const isRegistered = isRegisterValue(value);
|
|
934
658
|
if (!wasRegistered && !isRegistered) return;
|
|
935
|
-
const samePathAndStore = wasRegistered && isRegistered && oldValue.path === value.path && oldValue.
|
|
659
|
+
const samePathAndStore = wasRegistered && isRegistered && oldValue.path === value.path && oldValue.formKey === value.formKey;
|
|
936
660
|
if (wasRegistered && !samePathAndStore) {
|
|
937
661
|
oldValue.deregisterElement(el);
|
|
938
662
|
}
|
|
@@ -1453,8 +1177,6 @@ function getCheckboxValue(el, checked) {
|
|
|
1453
1177
|
const warnedUnsupportedElements = __DEV__ ? /* @__PURE__ */ new WeakSet() : null;
|
|
1454
1178
|
const vRegisterDynamic = {
|
|
1455
1179
|
created(el, binding, vnode) {
|
|
1456
|
-
syncPersistOptIn(el, binding.value, void 0, vnode.props?.["type"]);
|
|
1457
|
-
syncMultiTabOptOut(binding.value, void 0);
|
|
1458
1180
|
callModelHook(el, binding, vnode, null, "created");
|
|
1459
1181
|
if (isRegisterValue(binding.value)) setupAria(el, binding.value, vnode);
|
|
1460
1182
|
},
|
|
@@ -1476,8 +1198,6 @@ const vRegisterDynamic = {
|
|
|
1476
1198
|
}
|
|
1477
1199
|
},
|
|
1478
1200
|
beforeUpdate(el, binding, vnode, prevVNode) {
|
|
1479
|
-
syncPersistOptIn(el, binding.value, binding.oldValue, vnode.props?.["type"]);
|
|
1480
|
-
syncMultiTabOptOut(binding.value, binding.oldValue);
|
|
1481
1201
|
syncElementRegistration(el, binding.value, binding.oldValue);
|
|
1482
1202
|
callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
|
|
1483
1203
|
const ariaEl = el;
|
|
@@ -1503,10 +1223,6 @@ const vRegisterDynamic = {
|
|
|
1503
1223
|
removeTrackedListeners(el);
|
|
1504
1224
|
teardownAria(el);
|
|
1505
1225
|
teardownValueSync(el);
|
|
1506
|
-
if (isRegisterValue(value)) {
|
|
1507
|
-
value.persistOptIns.removeAllFor(getOrAssignElementId(el));
|
|
1508
|
-
value.unmarkNoSync?.();
|
|
1509
|
-
}
|
|
1510
1226
|
if (!isRegisterValue(value)) return;
|
|
1511
1227
|
value.deregisterElement(el);
|
|
1512
1228
|
delete el.composing;
|
|
@@ -1728,5 +1444,5 @@ function pathsEqual(a, b) {
|
|
|
1728
1444
|
return true;
|
|
1729
1445
|
}
|
|
1730
1446
|
|
|
1731
|
-
export {
|
|
1732
|
-
//# sourceMappingURL=attaform.
|
|
1447
|
+
export { AttaformError as A, kFormInstanceId as B, REGISTER_OWNER_MARKER as C, kAttaformAncestorWizard as D, FORM_ERRORS_PATH_KEY as F, InvalidPathError as I, OutsideSetupError as O, ROOT_PATH as R, SubmitErrorHandlerError as S, V_REGISTER_MARKER as V, __DEV__ as _, canonicalizePath as a, InvalidUseFormConfigError as b, createAttaform as c, ROOT_PATH_KEY as d, RegistryNotInstalledError as e, ReservedFormKeyError as f, getRegistryFromApp as g, assignKey as h, createRegistry as i, isPathPrefix as j, kAttaformWizardActiveStepResolver as k, isRegisterValue as l, kAttaformRegistry as m, pathKeyToDotted as n, pathsEqual as o, parseDottedPath as p, keyForSegments as q, INTERACTIVE_TAG_NAMES as r, segmentsForPathKey as s, toError as t, useRegistry as u, vRegister as v, FORM_ERRORS_PATH as w, coerceToPathKey as x, ensureAttaformInstalled as y, kFormContext as z };
|
|
1448
|
+
//# sourceMappingURL=attaform.BhI9Icek.mjs.map
|