@effect-app/vue-components 2.4.9 → 2.4.11
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 -2
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +5 -5
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +11 -14
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +3 -2
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +94 -71
- package/dist/vue-components.es10.js +126 -140
- package/dist/vue-components.es12.js +15 -13
- package/dist/vue-components.es16.js +1 -1
- package/dist/vue-components.es17.js +1 -1
- package/dist/vue-components.es20.js +2 -2
- package/dist/vue-components.es21.js +2 -2
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es30.js +191 -41
- package/dist/vue-components.es32.js +42 -2
- package/dist/vue-components.es33.js +2 -89
- package/dist/vue-components.es34.js +4 -0
- package/dist/vue-components.es35.js +89 -7
- package/dist/vue-components.es37.js +9 -0
- package/dist/vue-components.es38.js +27 -187
- package/dist/vue-components.es40.js +4 -23
- package/dist/vue-components.es41.js +23 -5
- package/dist/vue-components.es42.js +5 -21
- package/dist/vue-components.es43.js +16 -25
- package/dist/vue-components.es44.js +23 -15
- package/dist/vue-components.es45.js +17 -7
- package/dist/vue-components.es46.js +12 -5
- package/dist/vue-components.es47.js +5 -19
- package/dist/vue-components.es48.js +19 -9
- package/dist/vue-components.es49.js +9 -31
- package/dist/vue-components.es50.js +25 -42
- package/dist/vue-components.es51.js +38 -16
- package/dist/vue-components.es52.js +26 -4
- package/dist/vue-components.es54.js +1 -1
- package/dist/vue-components.es56.js +1 -1
- package/dist/vue-components.es58.js +3 -3
- package/dist/vue-components.es59.js +1 -1
- package/dist/vue-components.es7.js +1 -1
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaArray.vue +3 -2
- package/src/components/OmegaForm/OmegaAutoGen.vue +6 -5
- package/src/components/OmegaForm/OmegaFormInput.vue +3 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +24 -15
- package/src/components/OmegaForm/OmegaInput.vue +3 -2
- package/src/components/OmegaForm/useOmegaForm.ts +362 -225
- package/dist/vue-components.es31.js +0 -4
- package/dist/vue-components.es36.js +0 -34
|
@@ -1,48 +1,57 @@
|
|
|
1
|
-
import { useForm as
|
|
2
|
-
import { Data as
|
|
3
|
-
import { runtimeFiberAsPromise as
|
|
4
|
-
import { isObject as
|
|
5
|
-
import { computed as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { generateMetaFromSchema as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { trace as
|
|
14
|
-
import { context as
|
|
15
|
-
class
|
|
1
|
+
import { useForm as J } from "@tanstack/vue-form";
|
|
2
|
+
import { Data as z, S as k, Effect as l, Fiber as N, Option as P, Array as g } from "effect-app";
|
|
3
|
+
import { runtimeFiberAsPromise as K } from "./vue-components.es16.js";
|
|
4
|
+
import { isObject as T } from "./vue-components.es17.js";
|
|
5
|
+
import { computed as x, onUnmounted as D, onMounted as Z, onBeforeUnmount as G, watch as W, ref as Q, h as B } from "vue";
|
|
6
|
+
import X from "./vue-components.es18.js";
|
|
7
|
+
import Y from "./vue-components.es19.js";
|
|
8
|
+
import C from "./vue-components.es20.js";
|
|
9
|
+
import { generateMetaFromSchema as ee } from "./vue-components.es12.js";
|
|
10
|
+
import re from "./vue-components.es6.js";
|
|
11
|
+
import te from "./vue-components.es8.js";
|
|
12
|
+
import ne from "./vue-components.es21.js";
|
|
13
|
+
import { trace as R } from "./vue-components.es22.js";
|
|
14
|
+
import { context as _ } from "./vue-components.es23.js";
|
|
15
|
+
class se extends z.TaggedError("FormErrors") {
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const E = (c) => function(i) {
|
|
18
|
+
return {
|
|
19
|
+
render() {
|
|
20
|
+
return B(i, {
|
|
21
|
+
form: c,
|
|
22
|
+
...this.$attrs
|
|
23
|
+
}, this.$slots);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}, oe = (c) => function(i) {
|
|
18
27
|
return {
|
|
19
28
|
setup() {
|
|
20
|
-
const { fieldMap:
|
|
21
|
-
const
|
|
22
|
-
Object.entries(
|
|
29
|
+
const { fieldMap: S, form: v } = c, m = v.useStore((u) => u.errors), p = v.useStore((u) => u.fieldMeta), F = v.useStore((u) => u.errorMap), M = x(() => {
|
|
30
|
+
const u = g.filterMap(
|
|
31
|
+
Object.entries(p.value),
|
|
23
32
|
([j, o]) => {
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
const a =
|
|
27
|
-
return a ?
|
|
33
|
+
const b = o.errors ?? [];
|
|
34
|
+
if (!b.length) return P.none();
|
|
35
|
+
const a = S.value.get(j);
|
|
36
|
+
return a ? P.some({
|
|
28
37
|
label: a.label,
|
|
29
38
|
inputId: a.id,
|
|
30
39
|
// Only show the first error
|
|
31
|
-
errors: [
|
|
32
|
-
}) :
|
|
40
|
+
errors: [b[0]?.message].filter(Boolean)
|
|
41
|
+
}) : P.none();
|
|
33
42
|
}
|
|
34
43
|
), O = [];
|
|
35
44
|
if (F.value.onSubmit) {
|
|
36
45
|
for (const [j, o] of Object.entries(F.value.onSubmit))
|
|
37
46
|
if (g.isArray(o) && o.length)
|
|
38
|
-
for (const
|
|
39
|
-
const a =
|
|
47
|
+
for (const b of o) {
|
|
48
|
+
const a = b;
|
|
40
49
|
if (a?.path && g.isArray(a.path) && a.path.length) {
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
50
|
+
const w = a.path.join(".");
|
|
51
|
+
if (!S.value.has(w)) {
|
|
43
52
|
O.push({
|
|
44
|
-
label:
|
|
45
|
-
inputId:
|
|
53
|
+
label: w,
|
|
54
|
+
inputId: w,
|
|
46
55
|
errors: [a.message].filter(Boolean)
|
|
47
56
|
});
|
|
48
57
|
break;
|
|
@@ -50,206 +59,183 @@ const ce = (m) => function(i) {
|
|
|
50
59
|
}
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
|
-
return [...
|
|
62
|
+
return [...u, ...O];
|
|
54
63
|
});
|
|
55
64
|
return {
|
|
56
|
-
generalErrors:
|
|
65
|
+
generalErrors: m,
|
|
57
66
|
errors: M
|
|
58
67
|
};
|
|
59
68
|
},
|
|
60
|
-
render({ errors:
|
|
61
|
-
return
|
|
62
|
-
errors:
|
|
69
|
+
render({ errors: S, generalErrors: v }) {
|
|
70
|
+
return B(i, {
|
|
71
|
+
errors: S,
|
|
63
72
|
generalErrors: v,
|
|
64
73
|
...this.$attrs
|
|
65
74
|
}, this.$slots);
|
|
66
75
|
}
|
|
67
76
|
};
|
|
68
|
-
},
|
|
69
|
-
if (!
|
|
70
|
-
const
|
|
77
|
+
}, ye = (c, f, i) => {
|
|
78
|
+
if (!c) throw new Error("Schema is required");
|
|
79
|
+
const S = k.standardSchemaV1(c), v = k.decode(c), { meta: m } = ee(c), p = x(() => {
|
|
71
80
|
if (i?.persistency?.id)
|
|
72
81
|
return i.persistency.id;
|
|
73
|
-
const e = window.location.pathname, r = Object.keys(
|
|
82
|
+
const e = window.location.pathname, r = Object.keys(m);
|
|
74
83
|
return `${e}-${r.join("-")}`;
|
|
75
84
|
}), F = () => {
|
|
76
85
|
const e = new URLSearchParams(window.location.search);
|
|
77
|
-
e.delete(
|
|
86
|
+
e.delete(p.value);
|
|
78
87
|
const r = new URL(window.location.href);
|
|
79
88
|
r.search = e.toString(), window.history.replaceState({}, "", r.toString());
|
|
80
89
|
};
|
|
81
90
|
function M(e, r) {
|
|
82
|
-
for (const
|
|
83
|
-
r[
|
|
91
|
+
for (const n in r)
|
|
92
|
+
r[n] && T(r[n]) ? (e[n] || (e[n] = {}), M(e[n], r[n])) : e[n] = r[n];
|
|
84
93
|
return e;
|
|
85
94
|
}
|
|
86
|
-
const
|
|
95
|
+
const u = (e) => {
|
|
87
96
|
const r = { ...e };
|
|
88
|
-
for (const
|
|
89
|
-
const
|
|
90
|
-
|
|
97
|
+
for (const n in m) {
|
|
98
|
+
const s = m[n], t = r[n], y = (t == null || t === !1 || t === "" || Number.isNaN(t)) && t !== !1 && t !== 0;
|
|
99
|
+
s && !s.required && s.nullableOrUndefined && s.type !== "boolean" && (t === void 0 || y) && (r[n] = s.nullableOrUndefined === "undefined" ? void 0 : null);
|
|
91
100
|
}
|
|
92
101
|
return r;
|
|
93
|
-
}, O =
|
|
94
|
-
const e =
|
|
102
|
+
}, O = x(() => {
|
|
103
|
+
const e = f?.defaultValues ? u(f.defaultValues) : void 0;
|
|
95
104
|
if (e && !i?.persistency?.overrideDefaultValues)
|
|
96
105
|
return e;
|
|
97
106
|
let r;
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
if (
|
|
107
|
+
const n = i?.persistency;
|
|
108
|
+
if (!n?.policies || n.policies.length === 0) return {};
|
|
109
|
+
if (n.policies.includes("querystring"))
|
|
101
110
|
try {
|
|
102
|
-
const t = new URLSearchParams(window.location.search).get(
|
|
111
|
+
const t = new URLSearchParams(window.location.search).get(p.value);
|
|
103
112
|
F(), t && (r = JSON.parse(t));
|
|
104
|
-
} catch (
|
|
105
|
-
console.error(
|
|
113
|
+
} catch (s) {
|
|
114
|
+
console.error(s);
|
|
106
115
|
}
|
|
107
116
|
if (
|
|
108
117
|
// query string has higher priority than local/session storage
|
|
109
|
-
!r && (
|
|
118
|
+
!r && (n.policies.includes("local") || n.policies.includes("session"))
|
|
110
119
|
) {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
120
|
+
const s = n.policies.includes("local") ? localStorage : sessionStorage;
|
|
121
|
+
if (s)
|
|
113
122
|
try {
|
|
114
123
|
const t = JSON.parse(
|
|
115
|
-
|
|
124
|
+
s.getItem(p.value) || "{}"
|
|
116
125
|
);
|
|
117
|
-
|
|
126
|
+
s.removeItem(p.value), r = t;
|
|
118
127
|
} catch (t) {
|
|
119
128
|
console.error(t);
|
|
120
129
|
}
|
|
121
130
|
}
|
|
122
131
|
return r ??= {}, e ? M(e, r) : r;
|
|
123
|
-
}), j = (e, r) => e ?
|
|
124
|
-
...
|
|
132
|
+
}), j = (e, r) => e ? _.with(R.setSpan(_.active(), e), r) : r(), o = J({
|
|
133
|
+
...f,
|
|
125
134
|
validators: {
|
|
126
|
-
onSubmit:
|
|
127
|
-
...
|
|
135
|
+
onSubmit: S,
|
|
136
|
+
...f?.validators || {}
|
|
128
137
|
},
|
|
129
|
-
onSubmit:
|
|
130
|
-
const
|
|
138
|
+
onSubmit: f?.onSubmit ? ({ formApi: e, meta: r, value: n }) => j(r?.currentSpan, async () => {
|
|
139
|
+
const s = await l.runPromise(v(n)), t = f.onSubmit({
|
|
131
140
|
formApi: e,
|
|
132
141
|
meta: r,
|
|
133
|
-
value:
|
|
142
|
+
value: s
|
|
134
143
|
});
|
|
135
|
-
return N.isFiber(t) && N.isRuntimeFiber(t) ? await
|
|
144
|
+
return N.isFiber(t) && N.isRuntimeFiber(t) ? await K(t) : l.isEffect(t) ? await l.runPromise(
|
|
136
145
|
t.pipe(
|
|
137
146
|
// meta?.currentSpan
|
|
138
147
|
// ? Effect.withParentSpan(meta.currentSpan)
|
|
139
148
|
// : (_) => _,
|
|
140
|
-
l.flatMap((
|
|
149
|
+
l.flatMap((d) => N.join(d))
|
|
141
150
|
)
|
|
142
151
|
) : t;
|
|
143
152
|
}) : void 0,
|
|
144
153
|
defaultValues: O.value
|
|
145
|
-
}),
|
|
146
|
-
Object.keys(
|
|
154
|
+
}), b = () => {
|
|
155
|
+
Object.keys(m).forEach((e) => {
|
|
147
156
|
o.setFieldValue(e, void 0);
|
|
148
157
|
});
|
|
149
|
-
}, a = (e) => e.reduce((r,
|
|
150
|
-
const
|
|
151
|
-
return
|
|
152
|
-
}, {}),
|
|
158
|
+
}, a = (e) => e.reduce((r, n) => {
|
|
159
|
+
const s = n.split(".");
|
|
160
|
+
return s.reduce((t, d, y) => (y === s.length - 1 ? t[d] = o.getFieldValue(n) : t[d] = t[d] ?? {}, t[d]), r), r;
|
|
161
|
+
}, {}), w = (e) => {
|
|
153
162
|
if (e) {
|
|
154
163
|
if (g.isArray(e.keys))
|
|
155
164
|
return a(e.keys);
|
|
156
165
|
if (g.isArray(e.banKeys)) {
|
|
157
|
-
const r = Object.keys(
|
|
166
|
+
const r = Object.keys(m).filter((n) => e.banKeys?.includes(n));
|
|
158
167
|
return a(r);
|
|
159
168
|
}
|
|
160
169
|
return o.store.state.values;
|
|
161
170
|
}
|
|
162
|
-
},
|
|
171
|
+
}, U = () => {
|
|
163
172
|
const e = i?.persistency;
|
|
164
173
|
if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
|
|
165
174
|
const r = e.policies.includes("local") ? localStorage : sessionStorage;
|
|
166
175
|
if (!r) return;
|
|
167
|
-
const
|
|
168
|
-
return r.setItem(
|
|
176
|
+
const n = w(e);
|
|
177
|
+
return r.setItem(p.value, JSON.stringify(n));
|
|
169
178
|
}
|
|
170
|
-
},
|
|
179
|
+
}, L = () => {
|
|
171
180
|
const e = i?.persistency;
|
|
172
181
|
if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
|
|
173
|
-
const r =
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
182
|
+
const r = w(e), n = new URLSearchParams(window.location.search);
|
|
183
|
+
n.set(p.value, JSON.stringify(r));
|
|
184
|
+
const s = new URL(window.location.href);
|
|
185
|
+
s.search = n.toString(), window.history.replaceState({}, "", s.toString());
|
|
177
186
|
}
|
|
178
|
-
},
|
|
187
|
+
}, V = (e) => {
|
|
179
188
|
o.store.state.isDirty && e.preventDefault();
|
|
180
189
|
};
|
|
181
|
-
if (
|
|
182
|
-
window.addEventListener("beforeunload",
|
|
183
|
-
}),
|
|
184
|
-
window.removeEventListener("beforeunload",
|
|
190
|
+
if (D(U), Z(() => {
|
|
191
|
+
window.addEventListener("beforeunload", U), window.addEventListener("blur", L), i?.preventWindowExit && i.preventWindowExit !== "nope" && window.addEventListener("beforeunload", V);
|
|
192
|
+
}), G(() => {
|
|
193
|
+
window.removeEventListener("beforeunload", U), window.removeEventListener("blur", L), i?.preventWindowExit && i.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", V);
|
|
185
194
|
}), i?.preventWindowExit === "prevent-and-reset") {
|
|
186
|
-
const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts),
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts), n = o.useStore((t) => t.canSubmit), s = o.useStore((t) => t.values);
|
|
196
|
+
W([e, r], ([t, d], [y]) => {
|
|
197
|
+
y && !t && d > 0 && n.value && o.reset(s.value);
|
|
189
198
|
});
|
|
190
199
|
}
|
|
191
|
-
const
|
|
200
|
+
const I = (e) => l.currentSpan.pipe(
|
|
192
201
|
l.option,
|
|
193
202
|
l.flatMap(
|
|
194
|
-
(r) => l.promise(() => o.handleSubmit(
|
|
203
|
+
(r) => l.promise(() => o.handleSubmit(P.isSome(r) ? { currentSpan: r.value, ...e } : e))
|
|
195
204
|
)
|
|
196
|
-
),
|
|
205
|
+
), q = (e) => e?.checkErrors ? I(e?.meta).pipe(l.flatMap(l.fnUntraced(function* () {
|
|
197
206
|
const r = o.getAllErrors();
|
|
198
207
|
if (Object.keys(r.fields).length || r.form.errors.length)
|
|
199
|
-
return yield* new
|
|
200
|
-
}))) :
|
|
208
|
+
return yield* new se({ form: r.form, fields: r.fields });
|
|
209
|
+
}))) : I(e?.meta), H = o.handleSubmit, A = Q(/* @__PURE__ */ new Map()), h = Object.assign(o, {
|
|
201
210
|
i18nNamespace: i?.i18nNamespace,
|
|
202
211
|
ignorePreventCloseEvents: i?.ignorePreventCloseEvents,
|
|
203
|
-
meta:
|
|
204
|
-
clear:
|
|
212
|
+
meta: m,
|
|
213
|
+
clear: b,
|
|
205
214
|
handleSubmit: (e) => {
|
|
206
|
-
const r =
|
|
207
|
-
return
|
|
215
|
+
const r = R.getSpan(_.active());
|
|
216
|
+
return H({ currentSpan: r, ...e });
|
|
208
217
|
},
|
|
209
218
|
// /** @experimental */
|
|
210
|
-
handleSubmitEffect:
|
|
219
|
+
handleSubmitEffect: q,
|
|
211
220
|
registerField: (e) => {
|
|
212
|
-
|
|
221
|
+
W(e, (r) => A.value.set(r.name, { label: r.label, id: r.id }), { immediate: !0 }), D(() => A.value.delete(e.value.name));
|
|
213
222
|
}
|
|
214
|
-
}),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
...r?.attrs
|
|
224
|
-
}, r?.slots), K = (e, r) => b(ie, {
|
|
225
|
-
...e,
|
|
226
|
-
form: S,
|
|
227
|
-
...r?.attrs
|
|
228
|
-
}, r?.slots), T = (e, r) => b(re, {
|
|
229
|
-
...e,
|
|
230
|
-
form: S,
|
|
231
|
-
...r?.attrs
|
|
232
|
-
}, r?.slots), H = (e, r) => b(te, {
|
|
233
|
-
...e,
|
|
234
|
-
form: S,
|
|
235
|
-
...r?.attrs
|
|
236
|
-
}, r?.slots);
|
|
237
|
-
return Object.assign(S, {
|
|
238
|
-
errorContext: k,
|
|
239
|
-
Form: (e, r) => b(ae, {
|
|
240
|
-
...e,
|
|
241
|
-
form: S,
|
|
242
|
-
...r?.attrs
|
|
243
|
-
}, r?.slots),
|
|
244
|
-
Input: J,
|
|
245
|
-
TaggedUnion: K,
|
|
223
|
+
}), $ = { form: h, fieldMap: A };
|
|
224
|
+
return Object.assign(h, {
|
|
225
|
+
// Type-level properties for performance optimization (not used at runtime)
|
|
226
|
+
_paths: void 0,
|
|
227
|
+
_keys: void 0,
|
|
228
|
+
errorContext: $,
|
|
229
|
+
Form: E(h)(ne),
|
|
230
|
+
Input: E(h)(i?.input ?? re),
|
|
231
|
+
TaggedUnion: E(h)(te),
|
|
246
232
|
Field: o.Field,
|
|
247
|
-
Errors:
|
|
248
|
-
Array:
|
|
249
|
-
AutoGen:
|
|
233
|
+
Errors: oe($)(C),
|
|
234
|
+
Array: E(h)(X),
|
|
235
|
+
AutoGen: E(h)(Y)
|
|
250
236
|
});
|
|
251
237
|
};
|
|
252
238
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
239
|
+
se as FormErrors,
|
|
240
|
+
ye as useOmegaForm
|
|
255
241
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { S as n, Option as q } from "effect-app";
|
|
2
2
|
import { getMetadataFromSchema as _ } from "@effect-app/vue/form";
|
|
3
3
|
import { useIntl as w, getTransformationFrom as N } from "./vue-components.es3.js";
|
|
4
|
-
const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === n.Null.ast), d = (e) => !e || !n.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === n.Null.ast) ? "null" : !1,
|
|
4
|
+
const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === n.Null.ast), d = (e) => !e || !n.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === n.Null.ast) ? "null" : !1, L = (e) => {
|
|
5
5
|
const i = [];
|
|
6
6
|
for (const t of e)
|
|
7
7
|
if (n.AST.isUnion(t)) {
|
|
8
|
-
const g =
|
|
8
|
+
const g = L(t.types);
|
|
9
9
|
i.push(...g);
|
|
10
10
|
} else
|
|
11
11
|
i.push(t);
|
|
@@ -29,7 +29,7 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
29
29
|
e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ? l = !1 : l = !s;
|
|
30
30
|
const T = r.type;
|
|
31
31
|
if (n.AST.isUnion(r.type)) {
|
|
32
|
-
const c =
|
|
32
|
+
const c = L(r.type.types).filter(
|
|
33
33
|
(p) => p._tag !== "UndefinedKeyword" && p !== n.Null.ast
|
|
34
34
|
).map(N);
|
|
35
35
|
if (c.some(
|
|
@@ -80,16 +80,16 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
80
80
|
if (h && typeof h == "object" && "type" in h && (a[b] = h, h.type === "multiple" && n.AST.isTupleType(f.type) && f.type.rest && f.type.rest.length > 0)) {
|
|
81
81
|
const U = f.type.rest[0];
|
|
82
82
|
if (U.type._tag === "TypeLiteral" && "propertySignatures" in U.type)
|
|
83
|
-
for (const
|
|
84
|
-
const
|
|
85
|
-
parent:
|
|
86
|
-
property:
|
|
83
|
+
for (const v of U.type.propertySignatures) {
|
|
84
|
+
const A = `${b}.${v.name.toString()}`, x = m({
|
|
85
|
+
parent: A,
|
|
86
|
+
property: v.type,
|
|
87
87
|
meta: {
|
|
88
|
-
required: !d(
|
|
89
|
-
nullableOrUndefined: d(
|
|
88
|
+
required: !d(v.type),
|
|
89
|
+
nullableOrUndefined: d(v.type)
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
x && typeof x == "object" && "type" in x && (a[A] = x);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -179,7 +179,7 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
179
179
|
if (t) {
|
|
180
180
|
const r = E(t);
|
|
181
181
|
if (Object.hasOwnProperty.call(e, "required") || (e.required = !r), n.AST.isUnion(t)) {
|
|
182
|
-
const s =
|
|
182
|
+
const s = L(t.types), l = s.find(
|
|
183
183
|
(T) => T._tag !== "UndefinedKeyword" && T !== n.Null.ast
|
|
184
184
|
);
|
|
185
185
|
return "propertySignatures" in l ? m({
|
|
@@ -256,9 +256,11 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
256
256
|
n.Email.annotations({
|
|
257
257
|
message: () => i("validation.email.invalid")
|
|
258
258
|
})
|
|
259
|
-
)), e.required && t.annotations({
|
|
259
|
+
)), e.required && (t = t.annotations({
|
|
260
260
|
message: () => i("validation.empty")
|
|
261
|
-
})
|
|
261
|
+
}).pipe(n.minLength(1)).annotations({
|
|
262
|
+
message: () => i("validation.empty")
|
|
263
|
+
})), e.maxLength && (t = t.pipe(n.maxLength(e.maxLength)).annotations({
|
|
262
264
|
message: () => i("validation.string.maxLength", {
|
|
263
265
|
maxLength: e.maxLength
|
|
264
266
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Exit as c, Runtime as u } from "effect";
|
|
2
|
-
import { dual as n, isFunction as m } from "./vue-components.
|
|
2
|
+
import { dual as n, isFunction as m } from "./vue-components.es32.js";
|
|
3
3
|
const i = Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
|
|
4
4
|
n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
|
|
5
5
|
const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(r,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const d=document.createElement("style");d.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(d)}},e.call(window.customElements,r,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import r from "./vue-components.
|
|
2
|
+
import r from "./vue-components.es35.js";
|
|
3
3
|
|
|
4
|
-
import o from "./vue-components.
|
|
4
|
+
import o from "./vue-components.es37.js";
|
|
5
5
|
const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d4ffe76f"]]);
|
|
6
6
|
export {
|
|
7
7
|
e as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{pointer-events:none}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(i,t){const d=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(d&&d.call(this),this.shadowRoot){const o=document.createElement("style");o.appendChild(document.createTextNode("fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{pointer-events:none}")),this.shadowRoot.appendChild(o)}},e.call(window.customElements,i,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import o from "./vue-components.
|
|
2
|
+
import o from "./vue-components.es38.js";
|
|
3
3
|
|
|
4
|
-
import m from "./vue-components.
|
|
4
|
+
import m from "./vue-components.es37.js";
|
|
5
5
|
const e = /* @__PURE__ */ m(o, [["__scopeId", "data-v-05e510ab"]]);
|
|
6
6
|
export {
|
|
7
7
|
e as default
|