@effect-app/vue-components 0.6.2 → 0.7.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/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +24 -0
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +16 -2
- package/dist/types/components/OmegaForm/index.d.ts +2 -1
- package/dist/vue-components.es.js +22 -19
- package/dist/vue-components.es10.js +5 -5
- package/dist/vue-components.es11.js +6 -108
- package/dist/vue-components.es12.js +110 -0
- package/dist/vue-components.es14.js +7 -2
- package/dist/vue-components.es15.js +2 -88
- package/dist/vue-components.es16.js +90 -0
- package/dist/vue-components.es18.js +2 -5
- package/dist/vue-components.es19.js +2 -32
- package/dist/vue-components.es2.js +14 -11
- package/dist/vue-components.es20.js +5 -2
- package/dist/vue-components.es21.js +32 -2
- package/dist/vue-components.es22.js +32 -31
- package/dist/vue-components.es24.js +2 -2
- package/dist/vue-components.es25.js +2 -115
- package/dist/vue-components.es26.js +4 -0
- package/dist/vue-components.es27.js +115 -4
- package/dist/vue-components.es29.js +6 -0
- package/dist/vue-components.es4.js +19 -18
- package/dist/vue-components.es6.js +50 -36
- package/dist/vue-components.es7.js +34 -131
- package/dist/vue-components.es8.js +128 -211
- package/dist/vue-components.es9.js +218 -6
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaArray.vue +67 -0
- package/src/components/OmegaForm/OmegaErrors.vue +7 -3
- package/src/components/OmegaForm/OmegaFormInput.vue +6 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +5 -1
- package/src/components/OmegaForm/OmegaInput.vue +9 -1
- package/src/components/OmegaForm/OmegaInputVuetify.vue +3 -2
- package/src/components/OmegaForm/OmegaInternalInput.vue +1 -1
- package/src/components/OmegaForm/index.ts +2 -1
- package/dist/vue-components.es13.js +0 -9
- package/dist/vue-components.es17.js +0 -4
|
@@ -1,135 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const e = new URLSearchParams(window.location.search);
|
|
17
|
-
e.delete(d.value);
|
|
18
|
-
const r = new URL(window.location.href);
|
|
19
|
-
r.search = e.toString(), window.history.replaceState({}, "", r.toString());
|
|
20
|
-
};
|
|
21
|
-
function v(e, r) {
|
|
22
|
-
for (const l in r)
|
|
23
|
-
r[l] && q(r[l]) ? (e[l] || (e[l] = {}), v(e[l], r[l])) : e[l] = r[l];
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
const j = b(() => {
|
|
27
|
-
var l;
|
|
28
|
-
if (s != null && s.defaultValues && !((l = i == null ? void 0 : i.persistency) != null && l.overrideDefaultValues))
|
|
29
|
-
return s == null ? void 0 : s.defaultValues;
|
|
30
|
-
let e;
|
|
31
|
-
const r = i == null ? void 0 : i.persistency;
|
|
32
|
-
if (!(r != null && r.policies) || r.policies.length === 0) return {};
|
|
33
|
-
if (r.policies.includes("querystring"))
|
|
34
|
-
try {
|
|
35
|
-
const c = new URLSearchParams(window.location.search).get(d.value);
|
|
36
|
-
U(), c && (e = JSON.parse(c));
|
|
37
|
-
} catch (u) {
|
|
38
|
-
console.error(u);
|
|
39
|
-
}
|
|
40
|
-
if (
|
|
41
|
-
// query string has higher priority than local/session storage
|
|
42
|
-
!e && (r.policies.includes("local") || r.policies.includes("session"))
|
|
43
|
-
) {
|
|
44
|
-
const u = r.policies.includes("local") ? localStorage : sessionStorage;
|
|
45
|
-
if (u)
|
|
46
|
-
try {
|
|
47
|
-
const c = JSON.parse(
|
|
48
|
-
u.getItem(d.value) || "{}"
|
|
49
|
-
);
|
|
50
|
-
u.removeItem(d.value), e = c;
|
|
51
|
-
} catch (c) {
|
|
52
|
-
console.error(c);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (e ?? (e = {}), (s == null ? void 0 : s.defaultValues) == null)
|
|
56
|
-
return e;
|
|
57
|
-
{
|
|
58
|
-
const u = s == null ? void 0 : s.defaultValues;
|
|
59
|
-
return v(u, e);
|
|
60
|
-
}
|
|
61
|
-
}), n = I({
|
|
62
|
-
...s,
|
|
63
|
-
validators: {
|
|
64
|
-
onSubmit: V,
|
|
65
|
-
...(s == null ? void 0 : s.validators) || {}
|
|
66
|
-
},
|
|
67
|
-
onSubmit: s != null && s.onSubmit ? ({ formApi: e, meta: r, value: l }) => {
|
|
68
|
-
var u;
|
|
69
|
-
return (u = s.onSubmit) == null ? void 0 : u.call(s, {
|
|
70
|
-
formApi: e,
|
|
71
|
-
meta: r,
|
|
72
|
-
value: l
|
|
73
|
-
});
|
|
74
|
-
} : void 0,
|
|
75
|
-
defaultValues: j.value
|
|
76
|
-
}), E = () => {
|
|
77
|
-
Object.keys(t).forEach((e) => {
|
|
78
|
-
n.setFieldValue(e, void 0);
|
|
79
|
-
});
|
|
80
|
-
}, S = (e) => e.reduce(
|
|
81
|
-
(r, l) => {
|
|
82
|
-
const u = l.split(".");
|
|
83
|
-
return u.reduce((c, o, P) => (P === u.length - 1 ? c[o] = n.getFieldValue(l) : c[o] = c[o] ?? {}, c[o]), r), r;
|
|
84
|
-
},
|
|
85
|
-
{}
|
|
86
|
-
), f = (e) => {
|
|
87
|
-
if (e) {
|
|
88
|
-
if (Array.isArray(e.keys))
|
|
89
|
-
return S(e.keys);
|
|
90
|
-
if (Array.isArray(e.banKeys)) {
|
|
91
|
-
const r = Object.keys(t).filter(
|
|
92
|
-
(l) => {
|
|
93
|
-
var u;
|
|
94
|
-
return (u = e.banKeys) == null ? void 0 : u.includes(l);
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
return S(r);
|
|
98
|
-
}
|
|
99
|
-
return n.store.state.values;
|
|
100
|
-
}
|
|
101
|
-
}, h = () => {
|
|
102
|
-
const e = i == null ? void 0 : i.persistency;
|
|
103
|
-
if (!(!(e != null && e.policies) || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
104
|
-
const r = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
105
|
-
if (!r) return;
|
|
106
|
-
const l = f(e);
|
|
107
|
-
return r.setItem(d.value, JSON.stringify(l));
|
|
108
|
-
}
|
|
109
|
-
}, a = () => {
|
|
110
|
-
const e = i == null ? void 0 : i.persistency;
|
|
111
|
-
if (!(!(e != null && e.policies) || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
112
|
-
const r = f(e), l = new URLSearchParams(window.location.search);
|
|
113
|
-
l.set(d.value, JSON.stringify(r));
|
|
114
|
-
const u = new URL(window.location.href);
|
|
115
|
-
u.search = l.toString(), window.history.replaceState({}, "", u.toString());
|
|
1
|
+
import { ref as l, computed as p, readonly as v, provide as E, inject as f } from "vue";
|
|
2
|
+
const u = Symbol();
|
|
3
|
+
function h(e, a, t = "onSubmit") {
|
|
4
|
+
const r = l([]), n = (o) => {
|
|
5
|
+
r.value = r.value.filter((d) => d.inputId !== o);
|
|
6
|
+
}, c = (o) => {
|
|
7
|
+
n(o.inputId), r.value.push(o);
|
|
8
|
+
}, i = () => {
|
|
9
|
+
r.value = [];
|
|
10
|
+
}, m = p(() => {
|
|
11
|
+
switch (t) {
|
|
12
|
+
case "onChange":
|
|
13
|
+
return !0;
|
|
14
|
+
default:
|
|
15
|
+
return e.value > 0;
|
|
116
16
|
}
|
|
17
|
+
}), s = {
|
|
18
|
+
errors: v(r),
|
|
19
|
+
addError: c,
|
|
20
|
+
removeError: n,
|
|
21
|
+
clearErrors: i,
|
|
22
|
+
showErrors: m,
|
|
23
|
+
generalErrors: a,
|
|
24
|
+
showErrorsOn: t ?? "onSubmit"
|
|
117
25
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
clear: E
|
|
127
|
-
});
|
|
128
|
-
return K(x, y), Object.assign(y, {
|
|
129
|
-
Input: M
|
|
130
|
-
});
|
|
131
|
-
};
|
|
26
|
+
return E(u, s), s;
|
|
27
|
+
}
|
|
28
|
+
function w() {
|
|
29
|
+
const e = f(u);
|
|
30
|
+
if (!e)
|
|
31
|
+
throw new Error("useOmegaErrors must be used within an OmegaForm provider");
|
|
32
|
+
return e;
|
|
33
|
+
}
|
|
132
34
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
35
|
+
u as OmegaErrorsKey,
|
|
36
|
+
h as provideOmegaErrors,
|
|
37
|
+
w as useOmegaErrors
|
|
135
38
|
};
|
|
@@ -1,218 +1,135 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { useForm as I } from "@tanstack/vue-form";
|
|
2
|
+
import { S as N } from "effect-app";
|
|
3
|
+
import { generateMetaFromSchema as R } from "./vue-components.es9.js";
|
|
4
|
+
import { computed as b, onUnmounted as A, onMounted as D, onBeforeUnmount as J, provide as K } from "vue";
|
|
5
|
+
import { isObject as q } from "./vue-components.es20.js";
|
|
6
|
+
import M from "./vue-components.es21.js";
|
|
7
|
+
const x = Symbol("OmegaForm"), H = (w, s, i) => {
|
|
8
|
+
if (!w) throw new Error("Schema is required");
|
|
9
|
+
const V = N.standardSchemaV1(w), { filterItems: L, meta: t } = R(w), d = b(() => {
|
|
10
|
+
var l;
|
|
11
|
+
if ((l = i == null ? void 0 : i.persistency) != null && l.id)
|
|
12
|
+
return i.persistency.id;
|
|
13
|
+
const e = window.location.pathname, r = Object.keys(t);
|
|
14
|
+
return `${e}-${r.join("-")}`;
|
|
15
|
+
}), U = () => {
|
|
16
|
+
const e = new URLSearchParams(window.location.search);
|
|
17
|
+
e.delete(d.value);
|
|
18
|
+
const r = new URL(window.location.href);
|
|
19
|
+
r.search = e.toString(), window.history.replaceState({}, "", r.toString());
|
|
20
|
+
};
|
|
21
|
+
function v(e, r) {
|
|
22
|
+
for (const l in r)
|
|
23
|
+
r[l] && q(r[l]) ? (e[l] || (e[l] = {}), v(e[l], r[l])) : e[l] = r[l];
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
const j = b(() => {
|
|
27
|
+
var l;
|
|
28
|
+
if (s != null && s.defaultValues && !((l = i == null ? void 0 : i.persistency) != null && l.overrideDefaultValues))
|
|
29
|
+
return s == null ? void 0 : s.defaultValues;
|
|
30
|
+
let e;
|
|
31
|
+
const r = i == null ? void 0 : i.persistency;
|
|
32
|
+
if (!(r != null && r.policies) || r.policies.length === 0) return {};
|
|
33
|
+
if (r.policies.includes("querystring"))
|
|
34
|
+
try {
|
|
35
|
+
const c = new URLSearchParams(window.location.search).get(d.value);
|
|
36
|
+
U(), c && (e = JSON.parse(c));
|
|
37
|
+
} catch (u) {
|
|
38
|
+
console.error(u);
|
|
37
39
|
}
|
|
40
|
+
if (
|
|
41
|
+
// query string has higher priority than local/session storage
|
|
42
|
+
!e && (r.policies.includes("local") || r.policies.includes("session"))
|
|
43
|
+
) {
|
|
44
|
+
const u = r.policies.includes("local") ? localStorage : sessionStorage;
|
|
45
|
+
if (u)
|
|
46
|
+
try {
|
|
47
|
+
const c = JSON.parse(
|
|
48
|
+
u.getItem(d.value) || "{}"
|
|
49
|
+
);
|
|
50
|
+
u.removeItem(d.value), e = c;
|
|
51
|
+
} catch (c) {
|
|
52
|
+
console.error(c);
|
|
53
|
+
}
|
|
38
54
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const r = n.types.find(
|
|
45
|
-
(o) => o._tag !== "UndefinedKeyword" && o !== i.Null.ast
|
|
46
|
-
);
|
|
47
|
-
return "propertySignatures" in r ? m({
|
|
48
|
-
propertySignatures: r.propertySignatures,
|
|
49
|
-
parent: t,
|
|
50
|
-
meta: e
|
|
51
|
-
}) : n.types.every(i.AST.isLiteral) ? {
|
|
52
|
-
...e,
|
|
53
|
-
type: "select",
|
|
54
|
-
members: n.types.map((o) => o.literal)
|
|
55
|
-
} : {
|
|
56
|
-
...e,
|
|
57
|
-
...m({
|
|
58
|
-
parent: t,
|
|
59
|
-
meta: e,
|
|
60
|
-
property: r
|
|
61
|
-
})
|
|
62
|
-
};
|
|
55
|
+
if (e ?? (e = {}), (s == null ? void 0 : s.defaultValues) == null)
|
|
56
|
+
return e;
|
|
57
|
+
{
|
|
58
|
+
const u = s == null ? void 0 : s.defaultValues;
|
|
59
|
+
return v(u, e);
|
|
63
60
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
f.getOrElse(() => "unknown")
|
|
83
|
-
), e);
|
|
84
|
-
}
|
|
85
|
-
return l;
|
|
86
|
-
}, c = (e) => {
|
|
87
|
-
const t = e.ast, n = {};
|
|
88
|
-
if (t._tag === "Transformation" || t._tag === "Refinement")
|
|
89
|
-
return c(i.make(t.from));
|
|
90
|
-
if ("propertySignatures" in t) {
|
|
91
|
-
const a = m({
|
|
92
|
-
propertySignatures: t.propertySignatures
|
|
61
|
+
}), n = I({
|
|
62
|
+
...s,
|
|
63
|
+
validators: {
|
|
64
|
+
onSubmit: V,
|
|
65
|
+
...(s == null ? void 0 : s.validators) || {}
|
|
66
|
+
},
|
|
67
|
+
onSubmit: s != null && s.onSubmit ? ({ formApi: e, meta: r, value: l }) => {
|
|
68
|
+
var u;
|
|
69
|
+
return (u = s.onSubmit) == null ? void 0 : u.call(s, {
|
|
70
|
+
formApi: e,
|
|
71
|
+
meta: r,
|
|
72
|
+
value: l
|
|
73
|
+
});
|
|
74
|
+
} : void 0,
|
|
75
|
+
defaultValues: j.value
|
|
76
|
+
}), E = () => {
|
|
77
|
+
Object.keys(t).forEach((e) => {
|
|
78
|
+
n.setFieldValue(e, void 0);
|
|
93
79
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
}, S = (e) => e.reduce(
|
|
81
|
+
(r, l) => {
|
|
82
|
+
const u = l.split(".");
|
|
83
|
+
return u.reduce((c, o, P) => (P === u.length - 1 ? c[o] = n.getFieldValue(l) : c[o] = c[o] ?? {}, c[o]), r), r;
|
|
84
|
+
},
|
|
85
|
+
{}
|
|
86
|
+
), f = (e) => {
|
|
87
|
+
if (e) {
|
|
88
|
+
if (Array.isArray(e.keys))
|
|
89
|
+
return S(e.keys);
|
|
90
|
+
if (Array.isArray(e.banKeys)) {
|
|
91
|
+
const r = Object.keys(t).filter(
|
|
92
|
+
(l) => {
|
|
93
|
+
var u;
|
|
94
|
+
return (u = e.banKeys) == null ? void 0 : u.includes(l);
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
return S(r);
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
message: () => t("validation.email.invalid")
|
|
135
|
-
})
|
|
136
|
-
)), e.required && n.annotations({
|
|
137
|
-
message: () => t("validation.empty")
|
|
138
|
-
}), e.maxLength && (n = n.pipe(i.maxLength(e.maxLength)).annotations({
|
|
139
|
-
message: () => t("validation.string.maxLength", {
|
|
140
|
-
maxLength: e.maxLength
|
|
141
|
-
})
|
|
142
|
-
})), e.minLength && (n = n.pipe(i.minLength(e.minLength)).annotations({
|
|
143
|
-
message: () => t("validation.string.minLength", {
|
|
144
|
-
minLength: e.minLength
|
|
145
|
-
})
|
|
146
|
-
}));
|
|
147
|
-
break;
|
|
148
|
-
case "number":
|
|
149
|
-
n = i.Number.annotations({
|
|
150
|
-
message: () => t("validation.empty")
|
|
151
|
-
}), e.required && n.annotations({
|
|
152
|
-
message: () => t("validation.empty")
|
|
153
|
-
}), e.minimum && (n = n.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
|
|
154
|
-
message: () => t("validation.number.min", {
|
|
155
|
-
minimum: e.minimum,
|
|
156
|
-
isExclusive: !0
|
|
157
|
-
})
|
|
158
|
-
})), e.maximum && (n = n.pipe(i.lessThanOrEqualTo(e.maximum)).annotations({
|
|
159
|
-
message: () => t("validation.number.max", {
|
|
160
|
-
maximum: e.maximum,
|
|
161
|
-
isExclusive: !0
|
|
162
|
-
})
|
|
163
|
-
})), e.exclusiveMinimum && (n = n.pipe(i.greaterThan(e.exclusiveMinimum)).annotations({
|
|
164
|
-
message: () => t("validation.number.min", {
|
|
165
|
-
minimum: e.exclusiveMinimum,
|
|
166
|
-
isExclusive: !1
|
|
167
|
-
})
|
|
168
|
-
})), e.exclusiveMaximum && (n = n.pipe(i.lessThan(e.exclusiveMaximum)).annotations({
|
|
169
|
-
message: () => t("validation.number.max", {
|
|
170
|
-
maximum: e.exclusiveMaximum,
|
|
171
|
-
isExclusive: !1
|
|
172
|
-
})
|
|
173
|
-
}));
|
|
174
|
-
break;
|
|
175
|
-
case "select":
|
|
176
|
-
n = i.Literal(...e.members).annotations({
|
|
177
|
-
message: () => ({
|
|
178
|
-
message: t("validation.not_a_valid", {
|
|
179
|
-
type: "select",
|
|
180
|
-
message: e.members.join(", ")
|
|
181
|
-
}),
|
|
182
|
-
override: !0
|
|
183
|
-
})
|
|
184
|
-
});
|
|
185
|
-
break;
|
|
186
|
-
case "multiple":
|
|
187
|
-
n = i.Array(i.String).annotations({
|
|
188
|
-
message: () => t("validation.not_a_valid", {
|
|
189
|
-
type: "multiple",
|
|
190
|
-
message: e.members.join(", ")
|
|
191
|
-
})
|
|
192
|
-
});
|
|
193
|
-
break;
|
|
194
|
-
case "boolean":
|
|
195
|
-
n = i.Boolean;
|
|
196
|
-
break;
|
|
197
|
-
// todo: switch must be exhaustive or have default case, otherwise falls through with schema undefined.
|
|
198
|
-
case "unknown":
|
|
199
|
-
n = i.Unknown;
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
return e.required ? n.pipe(
|
|
203
|
-
i.annotations({
|
|
204
|
-
message: () => t("validation.empty")
|
|
205
|
-
})
|
|
206
|
-
) : n = i.NullishOr(n), i.standardSchemaV1(n);
|
|
207
|
-
}, L = (e, t) => i.NullOr(e).pipe(
|
|
208
|
-
i.transform(i.typeSchema(e), {
|
|
209
|
-
decode: (n) => n ?? t(),
|
|
210
|
-
encode: (n) => n
|
|
211
|
-
})
|
|
212
|
-
);
|
|
99
|
+
return n.store.state.values;
|
|
100
|
+
}
|
|
101
|
+
}, h = () => {
|
|
102
|
+
const e = i == null ? void 0 : i.persistency;
|
|
103
|
+
if (!(!(e != null && e.policies) || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
104
|
+
const r = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
105
|
+
if (!r) return;
|
|
106
|
+
const l = f(e);
|
|
107
|
+
return r.setItem(d.value, JSON.stringify(l));
|
|
108
|
+
}
|
|
109
|
+
}, a = () => {
|
|
110
|
+
const e = i == null ? void 0 : i.persistency;
|
|
111
|
+
if (!(!(e != null && e.policies) || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
112
|
+
const r = f(e), l = new URLSearchParams(window.location.search);
|
|
113
|
+
l.set(d.value, JSON.stringify(r));
|
|
114
|
+
const u = new URL(window.location.href);
|
|
115
|
+
u.search = l.toString(), window.history.replaceState({}, "", u.toString());
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
A(h), D(() => {
|
|
119
|
+
window.addEventListener("beforeunload", h), window.addEventListener("blur", a);
|
|
120
|
+
}), J(() => {
|
|
121
|
+
window.removeEventListener("beforeunload", h), window.removeEventListener("blur", a);
|
|
122
|
+
});
|
|
123
|
+
const y = Object.assign(n, {
|
|
124
|
+
meta: t,
|
|
125
|
+
filterItems: L,
|
|
126
|
+
clear: E
|
|
127
|
+
});
|
|
128
|
+
return K(x, y), Object.assign(y, {
|
|
129
|
+
Input: M
|
|
130
|
+
});
|
|
131
|
+
};
|
|
213
132
|
export {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
A as generateMetaFromSchema,
|
|
217
|
-
L as nullableInput
|
|
133
|
+
x as OmegaFormKey,
|
|
134
|
+
H as useOmegaForm
|
|
218
135
|
};
|