@effect-app/vue-components 0.27.16 → 1.0.0-next.1
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 +2 -3
- package/dist/types/components/OmegaForm/OmegaErrorsContext.d.ts +4 -4
- package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +22 -0
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +1 -2
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +7 -37
- package/dist/types/components/OmegaForm/index.d.ts +1 -7
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +65 -1
- package/dist/types/utils/index.d.ts +9 -0
- package/dist/vue-components.es.js +16 -25
- package/dist/vue-components.es10.js +5 -333
- package/dist/vue-components.es11.js +54 -6
- package/dist/vue-components.es12.js +71 -6
- package/dist/vue-components.es13.js +6 -2
- package/dist/vue-components.es14.js +6 -2
- package/dist/vue-components.es15.js +3 -86
- package/dist/vue-components.es16.js +5 -0
- package/dist/vue-components.es17.js +89 -7
- package/dist/vue-components.es18.js +42 -2
- package/dist/vue-components.es19.js +1 -1
- package/dist/vue-components.es2.js +10 -20
- package/dist/vue-components.es20.js +2 -126
- package/dist/vue-components.es21.js +92 -0
- package/dist/vue-components.es23.js +7 -5
- package/dist/vue-components.es24.js +31 -3
- package/dist/vue-components.es26.js +2 -11
- package/dist/vue-components.es27.js +23 -90
- package/dist/vue-components.es28.js +5 -42
- package/dist/vue-components.es29.js +21 -2
- package/dist/vue-components.es3.js +12 -8
- package/dist/vue-components.es30.js +27 -20
- package/dist/vue-components.es31.js +22 -5
- package/dist/vue-components.es32.js +6 -15
- package/dist/vue-components.es33.js +5 -30
- package/dist/vue-components.es34.js +19 -22
- package/dist/vue-components.es35.js +9 -12
- package/dist/vue-components.es36.js +31 -5
- package/dist/vue-components.es37.js +48 -19
- package/dist/vue-components.es38.js +26 -9
- package/dist/vue-components.es39.js +11 -31
- package/dist/vue-components.es4.js +47 -47
- package/dist/vue-components.es40.js +114 -47
- package/dist/vue-components.es42.js +1 -1
- package/dist/vue-components.es44.js +1 -1
- package/dist/vue-components.es45.js +3 -3
- package/dist/vue-components.es46.js +3 -3
- package/dist/vue-components.es47.js +1 -1
- package/dist/vue-components.es48.js +4 -115
- package/dist/vue-components.es49.js +4 -0
- package/dist/vue-components.es5.js +29 -70
- package/dist/vue-components.es50.js +44 -2
- package/dist/vue-components.es51.js +2 -44
- package/dist/vue-components.es6.js +209 -31
- package/dist/vue-components.es7.js +331 -49
- package/dist/vue-components.es8.js +2 -29
- package/dist/vue-components.es9.js +10 -148
- package/package.json +2 -2
- package/src/components/OmegaForm/OmegaArray.vue +4 -2
- package/src/components/OmegaForm/OmegaAutoGen.vue +5 -5
- package/src/components/OmegaForm/OmegaErrorsContext.ts +10 -8
- package/src/components/OmegaForm/{OmegaErrors.vue → OmegaErrorsInternal.vue} +11 -5
- package/src/components/OmegaForm/OmegaFormInput.vue +4 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +5 -6
- package/src/components/OmegaForm/OmegaInput.vue +6 -5
- package/src/components/OmegaForm/OmegaInternalInput.vue +1 -2
- package/src/components/OmegaForm/OmegaWrapper.vue +23 -247
- package/src/components/OmegaForm/index.ts +1 -7
- package/src/components/OmegaForm/useOmegaForm.ts +239 -7
- package/src/utils/index.ts +16 -0
- package/dist/types/components/OmegaForm/OmegaErrors.vue.d.ts +0 -15
- package/dist/vue-components.es22.js +0 -12
- package/dist/vue-components.es25.js +0 -5
- package/dist/vue-components.es41.js +0 -28
- package/dist/vue-components.es52.js +0 -4
- package/dist/vue-components.es53.js +0 -6
|
@@ -1,72 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const t = r?.indexOf(e) ?? -1;
|
|
28
|
-
return t === -1 ? Number.MAX_SAFE_INTEGER : t;
|
|
29
|
-
}, d = s.mapInput(
|
|
30
|
-
s.number,
|
|
31
|
-
(e) => f(e.name, o.order || [])
|
|
32
|
-
), b = O(
|
|
33
|
-
() => k(
|
|
34
|
-
o.form.meta,
|
|
35
|
-
// include / exclude
|
|
36
|
-
u(
|
|
37
|
-
(e, r) => o.pick ? o.pick.includes(r) && !o.omit?.includes(r) : !o.omit?.includes(r)
|
|
38
|
-
),
|
|
39
|
-
(e) => e,
|
|
40
|
-
// labelMap and adding name
|
|
41
|
-
m((e, r) => ({
|
|
42
|
-
name: r,
|
|
43
|
-
label: o.labelMap?.(r) || r,
|
|
44
|
-
...e
|
|
45
|
-
})),
|
|
46
|
-
// filterMap
|
|
47
|
-
o.filterMap ? a((e) => {
|
|
48
|
-
const r = o.filterMap?.(e.name, e);
|
|
49
|
-
return r === void 0 || r === !0 ? e : r;
|
|
50
|
-
}) : (e) => e,
|
|
51
|
-
// transform to array
|
|
52
|
-
(e) => Object.values(e),
|
|
53
|
-
// order
|
|
54
|
-
l.sort(d),
|
|
55
|
-
// sort
|
|
56
|
-
o.sort ? l.sort(o.sort) : (e) => e
|
|
57
|
-
)
|
|
58
|
-
);
|
|
59
|
-
return (e, r) => (M(!0), j(E, null, A(b.value, ({ name: t, label: n, ...c }) => F(e.$slots, "default", {
|
|
60
|
-
child: { name: t, label: n, ...c }
|
|
61
|
-
}, () => [
|
|
62
|
-
g(v, h({
|
|
63
|
-
form: o.form,
|
|
64
|
-
name: t,
|
|
65
|
-
label: n
|
|
66
|
-
}, { ref_for: !0 }, c), null, 16, ["form", "name", "label"])
|
|
67
|
-
])), 256));
|
|
68
|
-
}
|
|
69
|
-
});
|
|
1
|
+
import { ref as a, computed as l, readonly as d, inject as E } from "vue";
|
|
2
|
+
const f = Symbol();
|
|
3
|
+
function b(o, u, t = "onSubmit") {
|
|
4
|
+
const r = a([]), n = (e) => {
|
|
5
|
+
r.value = r.value.filter((m) => m.inputId !== e);
|
|
6
|
+
}, s = (e) => {
|
|
7
|
+
n(e.inputId), r.value.push(e);
|
|
8
|
+
}, c = () => {
|
|
9
|
+
r.value = [];
|
|
10
|
+
}, i = l(() => t === "onSubmit" ? o.value > 0 : !0);
|
|
11
|
+
return {
|
|
12
|
+
errors: d(r),
|
|
13
|
+
addError: s,
|
|
14
|
+
removeError: n,
|
|
15
|
+
clearErrors: c,
|
|
16
|
+
showErrors: i,
|
|
17
|
+
generalErrors: u,
|
|
18
|
+
showErrorsOn: t ?? "onSubmit"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function g() {
|
|
22
|
+
const o = E(f);
|
|
23
|
+
if (!o)
|
|
24
|
+
throw new Error("useOmegaErrors must be used within an OmegaForm provider");
|
|
25
|
+
return o;
|
|
26
|
+
}
|
|
70
27
|
export {
|
|
71
|
-
|
|
28
|
+
f as OmegaErrorsKey,
|
|
29
|
+
b as buildOmegaErrors,
|
|
30
|
+
g as useOmegaErrors
|
|
72
31
|
};
|
|
@@ -1,4 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { VERSION as d } from "./vue-components.es49.js";
|
|
2
|
+
var h = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
3
|
+
function s(c) {
|
|
4
|
+
var m = /* @__PURE__ */ new Set([c]), f = /* @__PURE__ */ new Set(), t = c.match(h);
|
|
5
|
+
if (!t)
|
|
6
|
+
return function() {
|
|
7
|
+
return !1;
|
|
8
|
+
};
|
|
9
|
+
var e = {
|
|
10
|
+
major: +t[1],
|
|
11
|
+
minor: +t[2],
|
|
12
|
+
patch: +t[3],
|
|
13
|
+
prerelease: t[4]
|
|
14
|
+
};
|
|
15
|
+
if (e.prerelease != null)
|
|
16
|
+
return function(r) {
|
|
17
|
+
return r === c;
|
|
18
|
+
};
|
|
19
|
+
function a(n) {
|
|
20
|
+
return f.add(n), !1;
|
|
21
|
+
}
|
|
22
|
+
function p(n) {
|
|
23
|
+
return m.add(n), !0;
|
|
24
|
+
}
|
|
25
|
+
return function(r) {
|
|
26
|
+
if (m.has(r))
|
|
27
|
+
return !0;
|
|
28
|
+
if (f.has(r))
|
|
29
|
+
return !1;
|
|
30
|
+
var i = r.match(h);
|
|
31
|
+
if (!i)
|
|
32
|
+
return a(r);
|
|
33
|
+
var u = {
|
|
34
|
+
major: +i[1],
|
|
35
|
+
minor: +i[2],
|
|
36
|
+
patch: +i[3],
|
|
37
|
+
prerelease: i[4]
|
|
38
|
+
};
|
|
39
|
+
return u.prerelease != null || e.major !== u.major ? a(r) : e.major === 0 ? e.minor === u.minor && e.patch <= u.patch ? p(r) : a(r) : e.minor <= u.minor ? p(r) : a(r);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
var v = s(d);
|
|
2
43
|
export {
|
|
3
|
-
|
|
44
|
+
s as _makeCompatibilityCheck,
|
|
45
|
+
v as isCompatible
|
|
4
46
|
};
|
|
@@ -1,46 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var h = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
3
|
-
function s(c) {
|
|
4
|
-
var m = /* @__PURE__ */ new Set([c]), f = /* @__PURE__ */ new Set(), t = c.match(h);
|
|
5
|
-
if (!t)
|
|
6
|
-
return function() {
|
|
7
|
-
return !1;
|
|
8
|
-
};
|
|
9
|
-
var e = {
|
|
10
|
-
major: +t[1],
|
|
11
|
-
minor: +t[2],
|
|
12
|
-
patch: +t[3],
|
|
13
|
-
prerelease: t[4]
|
|
14
|
-
};
|
|
15
|
-
if (e.prerelease != null)
|
|
16
|
-
return function(r) {
|
|
17
|
-
return r === c;
|
|
18
|
-
};
|
|
19
|
-
function a(n) {
|
|
20
|
-
return f.add(n), !1;
|
|
21
|
-
}
|
|
22
|
-
function p(n) {
|
|
23
|
-
return m.add(n), !0;
|
|
24
|
-
}
|
|
25
|
-
return function(r) {
|
|
26
|
-
if (m.has(r))
|
|
27
|
-
return !0;
|
|
28
|
-
if (f.has(r))
|
|
29
|
-
return !1;
|
|
30
|
-
var i = r.match(h);
|
|
31
|
-
if (!i)
|
|
32
|
-
return a(r);
|
|
33
|
-
var u = {
|
|
34
|
-
major: +i[1],
|
|
35
|
-
minor: +i[2],
|
|
36
|
-
patch: +i[3],
|
|
37
|
-
prerelease: i[4]
|
|
38
|
-
};
|
|
39
|
-
return u.prerelease != null || e.major !== u.major ? a(r) : e.major === 0 ? e.minor === u.minor && e.patch <= u.patch ? p(r) : a(r) : e.minor <= u.minor ? p(r) : a(r);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
var v = s(d);
|
|
1
|
+
var o = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof global == "object" ? global : {};
|
|
43
2
|
export {
|
|
44
|
-
|
|
45
|
-
v as isCompatible
|
|
3
|
+
o as _globalThis
|
|
46
4
|
};
|
|
@@ -1,34 +1,212 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
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
|
-
|
|
1
|
+
import { useForm as D, useStore as H } from "@tanstack/vue-form";
|
|
2
|
+
import { S as O, Effect as f, Fiber as y } from "effect-app";
|
|
3
|
+
import { runtimeFiberAsPromise as J } from "./vue-components.es9.js";
|
|
4
|
+
import { isObject as q } from "./vue-components.es10.js";
|
|
5
|
+
import { computed as I, onUnmounted as K, onMounted as B, onBeforeUnmount as G, watch as W, h as $ } from "vue";
|
|
6
|
+
import k from "./vue-components.es11.js";
|
|
7
|
+
import z from "./vue-components.es12.js";
|
|
8
|
+
import { buildOmegaErrors as Q } from "./vue-components.es5.js";
|
|
9
|
+
import T from "./vue-components.es13.js";
|
|
10
|
+
import { generateMetaFromSchema as X } from "./vue-components.es7.js";
|
|
11
|
+
import Y from "./vue-components.es4.js";
|
|
12
|
+
import Z from "./vue-components.es14.js";
|
|
13
|
+
import { trace as P } from "./vue-components.es15.js";
|
|
14
|
+
import { context as E } from "./vue-components.es16.js";
|
|
15
|
+
const p = (c) => function(o) {
|
|
16
|
+
return {
|
|
17
|
+
render() {
|
|
18
|
+
return $(o, {
|
|
19
|
+
form: c,
|
|
20
|
+
on: this.$listeners,
|
|
21
|
+
attrs: this.$attrs
|
|
22
|
+
}, this.$slots);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}, C = (c) => function(o) {
|
|
26
|
+
return {
|
|
27
|
+
setup() {
|
|
28
|
+
return {
|
|
29
|
+
...c
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
render({ errors: h, generalErrors: S, showErrors: w }) {
|
|
33
|
+
return $(o, {
|
|
34
|
+
errors: h,
|
|
35
|
+
generalErrors: S,
|
|
36
|
+
showErrors: w,
|
|
37
|
+
on: this.$listeners,
|
|
38
|
+
attrs: this.$attrs,
|
|
39
|
+
scopedSlots: this.$scopedSlots
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, pe = (c, a, o) => {
|
|
44
|
+
if (!c) throw new Error("Schema is required");
|
|
45
|
+
const h = O.standardSchemaV1(c), S = O.decode(c), { filterItems: w, meta: d } = X(c), l = I(() => {
|
|
46
|
+
if (o?.persistency?.id)
|
|
47
|
+
return o.persistency.id;
|
|
48
|
+
const e = window.location.pathname, r = Object.keys(d);
|
|
49
|
+
return `${e}-${r.join("-")}`;
|
|
50
|
+
}), A = () => {
|
|
51
|
+
const e = new URLSearchParams(window.location.search);
|
|
52
|
+
e.delete(l.value);
|
|
53
|
+
const r = new URL(window.location.href);
|
|
54
|
+
r.search = e.toString(), window.history.replaceState({}, "", r.toString());
|
|
55
|
+
};
|
|
56
|
+
function g(e, r) {
|
|
57
|
+
for (const t in r)
|
|
58
|
+
r[t] && q(r[t]) ? (e[t] || (e[t] = {}), g(e[t], r[t])) : e[t] = r[t];
|
|
59
|
+
return e;
|
|
30
60
|
}
|
|
31
|
-
|
|
61
|
+
const U = I(() => {
|
|
62
|
+
if (a?.defaultValues && !o?.persistency?.overrideDefaultValues)
|
|
63
|
+
return a?.defaultValues;
|
|
64
|
+
let e;
|
|
65
|
+
const r = o?.persistency;
|
|
66
|
+
if (!r?.policies || r.policies.length === 0) return {};
|
|
67
|
+
if (r.policies.includes("querystring"))
|
|
68
|
+
try {
|
|
69
|
+
const s = new URLSearchParams(window.location.search).get(l.value);
|
|
70
|
+
A(), s && (e = JSON.parse(s));
|
|
71
|
+
} catch (t) {
|
|
72
|
+
console.error(t);
|
|
73
|
+
}
|
|
74
|
+
if (
|
|
75
|
+
// query string has higher priority than local/session storage
|
|
76
|
+
!e && (r.policies.includes("local") || r.policies.includes("session"))
|
|
77
|
+
) {
|
|
78
|
+
const t = r.policies.includes("local") ? localStorage : sessionStorage;
|
|
79
|
+
if (t)
|
|
80
|
+
try {
|
|
81
|
+
const s = JSON.parse(
|
|
82
|
+
t.getItem(l.value) || "{}"
|
|
83
|
+
);
|
|
84
|
+
t.removeItem(l.value), e = s;
|
|
85
|
+
} catch (s) {
|
|
86
|
+
console.error(s);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (e ??= {}, a?.defaultValues == null)
|
|
90
|
+
return e;
|
|
91
|
+
{
|
|
92
|
+
const t = a?.defaultValues;
|
|
93
|
+
return g(t, e);
|
|
94
|
+
}
|
|
95
|
+
}), M = (e, r) => e ? E.with(P.setSpan(E.active(), e), r) : r(), u = D({
|
|
96
|
+
...a,
|
|
97
|
+
validators: {
|
|
98
|
+
onSubmit: h,
|
|
99
|
+
...a?.validators || {}
|
|
100
|
+
},
|
|
101
|
+
onSubmit: a?.onSubmit ? ({ formApi: e, meta: r, value: t }) => M(r?.currentSpan, async () => {
|
|
102
|
+
const s = await f.runPromise(S(t)), n = a.onSubmit({
|
|
103
|
+
formApi: e,
|
|
104
|
+
meta: r,
|
|
105
|
+
value: s
|
|
106
|
+
});
|
|
107
|
+
return y.isFiber(n) && y.isRuntimeFiber(n) ? await J(n) : f.isEffect(n) ? await f.runPromise(
|
|
108
|
+
n.pipe(
|
|
109
|
+
// meta?.currentSpan
|
|
110
|
+
// ? Effect.withParentSpan(meta.currentSpan)
|
|
111
|
+
// : (_) => _,
|
|
112
|
+
f.flatMap((m) => y.join(m))
|
|
113
|
+
)
|
|
114
|
+
) : n;
|
|
115
|
+
}) : void 0,
|
|
116
|
+
defaultValues: U.value
|
|
117
|
+
}), N = () => {
|
|
118
|
+
Object.keys(d).forEach((e) => {
|
|
119
|
+
u.setFieldValue(e, void 0);
|
|
120
|
+
});
|
|
121
|
+
}, V = (e) => e.reduce((r, t) => {
|
|
122
|
+
const s = t.split(".");
|
|
123
|
+
return s.reduce((n, m, x) => (x === s.length - 1 ? n[m] = u.getFieldValue(t) : n[m] = n[m] ?? {}, n[m]), r), r;
|
|
124
|
+
}, {}), F = (e) => {
|
|
125
|
+
if (e) {
|
|
126
|
+
if (Array.isArray(e.keys))
|
|
127
|
+
return V(e.keys);
|
|
128
|
+
if (Array.isArray(e.banKeys)) {
|
|
129
|
+
const r = Object.keys(d).filter((t) => e.banKeys?.includes(t));
|
|
130
|
+
return V(r);
|
|
131
|
+
}
|
|
132
|
+
return u.store.state.values;
|
|
133
|
+
}
|
|
134
|
+
}, v = () => {
|
|
135
|
+
const e = o?.persistency;
|
|
136
|
+
if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
137
|
+
const r = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
138
|
+
if (!r) return;
|
|
139
|
+
const t = F(e);
|
|
140
|
+
return r.setItem(l.value, JSON.stringify(t));
|
|
141
|
+
}
|
|
142
|
+
}, j = () => {
|
|
143
|
+
const e = o?.persistency;
|
|
144
|
+
if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
145
|
+
const r = F(e), t = new URLSearchParams(window.location.search);
|
|
146
|
+
t.set(l.value, JSON.stringify(r));
|
|
147
|
+
const s = new URL(window.location.href);
|
|
148
|
+
s.search = t.toString(), window.history.replaceState({}, "", s.toString());
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
K(v), B(() => {
|
|
152
|
+
window.addEventListener("beforeunload", v), window.addEventListener("blur", j);
|
|
153
|
+
}), G(() => {
|
|
154
|
+
window.removeEventListener("beforeunload", v), window.removeEventListener("blur", j);
|
|
155
|
+
});
|
|
156
|
+
const R = u.handleSubmit, i = Object.assign(u, {
|
|
157
|
+
i18nNamespace: o?.i18nNamespace,
|
|
158
|
+
meta: d,
|
|
159
|
+
filterItems: w,
|
|
160
|
+
clear: N,
|
|
161
|
+
handleSubmit: (e) => {
|
|
162
|
+
const r = P.getSpan(E.active());
|
|
163
|
+
return R({ currentSpan: r, ...e });
|
|
164
|
+
}
|
|
165
|
+
// /** @experimental */
|
|
166
|
+
// handleSubmitEffect: (meta?: Record<string, any>) =>
|
|
167
|
+
// Effect.currentSpan.pipe(
|
|
168
|
+
// Effect.option,
|
|
169
|
+
// Effect
|
|
170
|
+
// .flatMap((span) =>
|
|
171
|
+
// Effect.promise(() => form.handleSubmit(Option.isSome(span) ? { currentSpan: span.value, ...meta } : meta))
|
|
172
|
+
// )
|
|
173
|
+
// )
|
|
174
|
+
}), _ = H(
|
|
175
|
+
i.store,
|
|
176
|
+
(e) => e.submissionAttempts
|
|
177
|
+
), b = i.useStore((e) => e.errors);
|
|
178
|
+
W(
|
|
179
|
+
() => [i.filterItems, b.value],
|
|
180
|
+
() => {
|
|
181
|
+
const e = i.filterItems, r = b.value;
|
|
182
|
+
return e ? r ? (Object.values(r).filter(
|
|
183
|
+
(s) => !!s
|
|
184
|
+
).flatMap(
|
|
185
|
+
(s) => Object.values(s).flat().map((n) => n.message)
|
|
186
|
+
).some((s) => s === e.message) && e.items.forEach((s) => {
|
|
187
|
+
const n = i.getFieldMeta(s);
|
|
188
|
+
n && i.setFieldMeta(s, {
|
|
189
|
+
...n,
|
|
190
|
+
errorMap: {
|
|
191
|
+
onSubmit: [
|
|
192
|
+
{ path: [s], message: e.message }
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}), {}) : {} : {};
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
const L = Q(_, b, o?.showErrorsOn);
|
|
200
|
+
return Object.assign(i, {
|
|
201
|
+
errorContext: L,
|
|
202
|
+
Form: p(i)(Z),
|
|
203
|
+
Input: o?.input ? o.input(i) : p(i)(Y),
|
|
204
|
+
Field: u.Field,
|
|
205
|
+
Errors: C(L)(T),
|
|
206
|
+
Array: p(i)(k),
|
|
207
|
+
AutoGen: p(i)(z)
|
|
208
|
+
});
|
|
209
|
+
};
|
|
32
210
|
export {
|
|
33
|
-
|
|
211
|
+
pe as useOmegaForm
|
|
34
212
|
};
|