@effect-app/vue-components 3.0.4 → 3.0.6
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/OmegaFormStuff.d.ts +1 -1
- package/dist/vue-components.es12.js +236 -194
- package/dist/vue-components.es22.js +1 -1
- package/dist/vue-components.es23.js +1 -1
- package/dist/vue-components.es36.js +1 -1
- package/dist/vue-components.es38.js +11 -11
- 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 -11
- package/dist/vue-components.es53.js +11 -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/package.json +2 -2
- package/src/components/OmegaForm/OmegaFormStuff.ts +88 -19
- package/src/components/OmegaForm/OmegaInputVuetify.vue +2 -2
|
@@ -1,282 +1,296 @@
|
|
|
1
|
-
import { S as i, Option as
|
|
2
|
-
import { getMetadataFromSchema as
|
|
3
|
-
import { useIntl as
|
|
1
|
+
import { S as i, Option as w } from "effect-app";
|
|
2
|
+
import { getMetadataFromSchema as k } from "@effect-app/vue/form";
|
|
3
|
+
import { useIntl as V, getTransformationFrom as _ } from "./vue-components.es3.js";
|
|
4
4
|
import { isObject as $ } from "./vue-components.es16.js";
|
|
5
|
-
const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKeyword" || n === i.Null.ast),
|
|
5
|
+
const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKeyword" || n === i.Null.ast), c = (e) => !e || !i.AST.isUnion(e) ? !1 : e.types.find((n) => n._tag === "UndefinedKeyword") ? "undefined" : e.types.find((n) => n === i.Null.ast) ? "null" : !1, L = (e) => {
|
|
6
6
|
const n = [];
|
|
7
7
|
for (const t of e)
|
|
8
8
|
if (i.AST.isUnion(t)) {
|
|
9
|
-
const o =
|
|
9
|
+
const o = L(t.types);
|
|
10
10
|
n.push(...o);
|
|
11
11
|
} else
|
|
12
12
|
n.push(t);
|
|
13
13
|
return n;
|
|
14
|
-
}, y = ({ meta: e = {}, parent: n = "", property: t, propertySignatures: o },
|
|
15
|
-
if (t && t._tag === "Transformation")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
}, y = ({ meta: e = {}, parent: n = "", property: t, propertySignatures: o }, s = {}) => {
|
|
15
|
+
if (t && t._tag === "Transformation") {
|
|
16
|
+
const r = i.AST.getAnnotation(t, i.AST.TitleAnnotationId).pipe(w.getOrElse(() => ""));
|
|
17
|
+
if (r !== "Int" && r !== "int")
|
|
18
|
+
return y({
|
|
19
|
+
parent: n,
|
|
20
|
+
meta: e,
|
|
21
|
+
property: t.from
|
|
22
|
+
});
|
|
23
|
+
}
|
|
21
24
|
if (t?._tag === "TypeLiteral" && "propertySignatures" in t)
|
|
22
25
|
return y({
|
|
23
26
|
meta: e,
|
|
24
27
|
propertySignatures: t.propertySignatures
|
|
25
28
|
});
|
|
26
29
|
if (o) {
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
e._isNullableDiscriminatedUnion &&
|
|
31
|
-
const
|
|
32
|
-
if (i.AST.isUnion(
|
|
33
|
-
const
|
|
34
|
-
(
|
|
35
|
-
).map(
|
|
36
|
-
if (
|
|
37
|
-
(
|
|
30
|
+
for (const r of o) {
|
|
31
|
+
const u = n ? `${n}.${r.name.toString()}` : r.name.toString(), a = c(r.type);
|
|
32
|
+
let m;
|
|
33
|
+
e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ? m = !1 : m = !a;
|
|
34
|
+
const l = r.type;
|
|
35
|
+
if (i.AST.isUnion(r.type)) {
|
|
36
|
+
const S = L(r.type.types).filter(
|
|
37
|
+
(p) => p._tag !== "UndefinedKeyword" && p !== i.Null.ast
|
|
38
|
+
).map(_);
|
|
39
|
+
if (S.some(
|
|
40
|
+
(p) => "propertySignatures" in p
|
|
38
41
|
)) {
|
|
39
42
|
if (!a) {
|
|
40
|
-
const
|
|
41
|
-
parent:
|
|
42
|
-
property:
|
|
43
|
-
meta: { required:
|
|
43
|
+
const p = y({
|
|
44
|
+
parent: u,
|
|
45
|
+
property: r.type,
|
|
46
|
+
meta: { required: m, nullableOrUndefined: a }
|
|
44
47
|
});
|
|
45
|
-
|
|
48
|
+
s[u] = p;
|
|
46
49
|
}
|
|
47
|
-
for (const
|
|
48
|
-
if ("propertySignatures" in
|
|
49
|
-
const
|
|
50
|
+
for (const p of S)
|
|
51
|
+
if ("propertySignatures" in p) {
|
|
52
|
+
const f = a && S.length > 1;
|
|
50
53
|
Object.assign(
|
|
51
|
-
|
|
54
|
+
s,
|
|
52
55
|
y({
|
|
53
|
-
parent:
|
|
54
|
-
propertySignatures:
|
|
55
|
-
meta:
|
|
56
|
+
parent: u,
|
|
57
|
+
propertySignatures: p.propertySignatures,
|
|
58
|
+
meta: f ? { _isNullableDiscriminatedUnion: !0 } : {}
|
|
56
59
|
})
|
|
57
60
|
);
|
|
58
61
|
}
|
|
59
62
|
} else {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
63
|
+
const p = S.filter(i.AST.isTupleType);
|
|
64
|
+
if (p.length > 0) {
|
|
65
|
+
const f = p[0];
|
|
66
|
+
if (s[u] = {
|
|
64
67
|
type: "multiple",
|
|
65
|
-
members:
|
|
66
|
-
rest:
|
|
67
|
-
required:
|
|
68
|
+
members: f.elements,
|
|
69
|
+
rest: f.rest,
|
|
70
|
+
required: m,
|
|
68
71
|
nullableOrUndefined: a
|
|
69
|
-
},
|
|
70
|
-
const T =
|
|
72
|
+
}, f.rest && f.rest.length > 0) {
|
|
73
|
+
const T = f.rest[0];
|
|
71
74
|
if (T.type._tag === "TypeLiteral" && "propertySignatures" in T.type)
|
|
72
|
-
for (const
|
|
73
|
-
const
|
|
74
|
-
parent:
|
|
75
|
-
property:
|
|
75
|
+
for (const g of T.type.propertySignatures) {
|
|
76
|
+
const x = `${u}.${g.name.toString()}`, v = y({
|
|
77
|
+
parent: x,
|
|
78
|
+
property: g.type,
|
|
76
79
|
meta: {
|
|
77
|
-
required: !g
|
|
78
|
-
nullableOrUndefined: g
|
|
80
|
+
required: !c(g.type),
|
|
81
|
+
nullableOrUndefined: c(g.type)
|
|
79
82
|
}
|
|
80
83
|
});
|
|
81
|
-
if (v && typeof v == "object" && "type" in v && (
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
for (const A of
|
|
85
|
-
const
|
|
86
|
-
parent:
|
|
84
|
+
if (v && typeof v == "object" && "type" in v && (s[x] = v, v.type === "multiple" && i.AST.isTupleType(g.type) && g.type.rest && g.type.rest.length > 0)) {
|
|
85
|
+
const M = g.type.rest[0];
|
|
86
|
+
if (M.type._tag === "TypeLiteral" && "propertySignatures" in M.type)
|
|
87
|
+
for (const A of M.type.propertySignatures) {
|
|
88
|
+
const N = `${x}.${A.name.toString()}`, O = y({
|
|
89
|
+
parent: N,
|
|
87
90
|
property: A.type,
|
|
88
91
|
meta: {
|
|
89
|
-
required: !
|
|
90
|
-
nullableOrUndefined:
|
|
92
|
+
required: !c(A.type),
|
|
93
|
+
nullableOrUndefined: c(A.type)
|
|
91
94
|
}
|
|
92
95
|
});
|
|
93
|
-
O && typeof O == "object" && "type" in O && (
|
|
96
|
+
O && typeof O == "object" && "type" in O && (s[N] = O);
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
} else {
|
|
99
|
-
const
|
|
100
|
-
parent:
|
|
101
|
-
property:
|
|
102
|
-
meta: { required:
|
|
102
|
+
const f = y({
|
|
103
|
+
parent: u,
|
|
104
|
+
property: r.type,
|
|
105
|
+
meta: { required: m, nullableOrUndefined: a }
|
|
103
106
|
});
|
|
104
|
-
|
|
107
|
+
s[u] = f;
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
} else {
|
|
108
|
-
const
|
|
109
|
-
if ("propertySignatures" in
|
|
111
|
+
const d = _(l);
|
|
112
|
+
if ("propertySignatures" in d)
|
|
110
113
|
Object.assign(
|
|
111
|
-
|
|
114
|
+
s,
|
|
112
115
|
y({
|
|
113
|
-
parent:
|
|
114
|
-
propertySignatures:
|
|
115
|
-
meta: { required:
|
|
116
|
+
parent: u,
|
|
117
|
+
propertySignatures: d.propertySignatures,
|
|
118
|
+
meta: { required: m, nullableOrUndefined: a }
|
|
116
119
|
})
|
|
117
120
|
);
|
|
118
|
-
else if (i.AST.isTupleType(
|
|
119
|
-
if (
|
|
120
|
-
const b =
|
|
121
|
+
else if (i.AST.isTupleType(r.type))
|
|
122
|
+
if (r.type.rest.length > 0 && r.type.rest[0].type._tag === "TypeLiteral" && "propertySignatures" in r.type.rest[0].type) {
|
|
123
|
+
const b = r.type.rest[0].type;
|
|
121
124
|
if (b._tag === "TypeLiteral" && "propertySignatures" in b)
|
|
122
|
-
for (const
|
|
123
|
-
const
|
|
124
|
-
if (i.AST.isTupleType(
|
|
125
|
-
const T =
|
|
125
|
+
for (const p of b.propertySignatures) {
|
|
126
|
+
const f = `${u}.${p.name.toString()}`;
|
|
127
|
+
if (i.AST.isTupleType(p.type) && p.type.rest.length > 0) {
|
|
128
|
+
const T = p.type.rest[0].type;
|
|
126
129
|
if (T._tag === "TypeLiteral" && "propertySignatures" in T)
|
|
127
|
-
for (const
|
|
128
|
-
const
|
|
129
|
-
parent:
|
|
130
|
-
property:
|
|
130
|
+
for (const g of T.propertySignatures) {
|
|
131
|
+
const x = `${f}.${g.name.toString()}`, v = y({
|
|
132
|
+
parent: x,
|
|
133
|
+
property: g.type,
|
|
131
134
|
meta: {
|
|
132
|
-
required: !g
|
|
133
|
-
nullableOrUndefined: g
|
|
135
|
+
required: !c(g.type),
|
|
136
|
+
nullableOrUndefined: c(g.type)
|
|
134
137
|
}
|
|
135
138
|
});
|
|
136
|
-
|
|
139
|
+
s[x] = v;
|
|
137
140
|
}
|
|
138
141
|
else
|
|
139
|
-
|
|
142
|
+
s[f] = {
|
|
140
143
|
type: "multiple",
|
|
141
|
-
members:
|
|
142
|
-
rest:
|
|
143
|
-
required: !
|
|
144
|
-
nullableOrUndefined:
|
|
144
|
+
members: p.type.elements,
|
|
145
|
+
rest: p.type.rest,
|
|
146
|
+
required: !c(p.type),
|
|
147
|
+
nullableOrUndefined: c(p.type)
|
|
145
148
|
};
|
|
146
149
|
} else {
|
|
147
150
|
const T = y({
|
|
148
|
-
parent:
|
|
149
|
-
property:
|
|
151
|
+
parent: f,
|
|
152
|
+
property: p.type,
|
|
150
153
|
meta: {
|
|
151
|
-
required: !
|
|
152
|
-
nullableOrUndefined:
|
|
154
|
+
required: !c(p.type),
|
|
155
|
+
nullableOrUndefined: c(p.type)
|
|
153
156
|
}
|
|
154
157
|
});
|
|
155
|
-
|
|
158
|
+
s[f] = T;
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
} else
|
|
159
|
-
|
|
162
|
+
s[u] = {
|
|
160
163
|
type: "multiple",
|
|
161
|
-
members:
|
|
162
|
-
rest:
|
|
163
|
-
required:
|
|
164
|
+
members: r.type.elements,
|
|
165
|
+
rest: r.type.rest,
|
|
166
|
+
required: m,
|
|
164
167
|
nullableOrUndefined: a
|
|
165
168
|
};
|
|
166
169
|
else {
|
|
167
|
-
const
|
|
168
|
-
parent:
|
|
169
|
-
property:
|
|
170
|
+
const S = y({
|
|
171
|
+
parent: u,
|
|
172
|
+
property: r.type,
|
|
170
173
|
meta: {
|
|
171
174
|
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
172
175
|
// TODO: handle this better via the createMeta minLength parsing
|
|
173
|
-
required:
|
|
176
|
+
required: m && (r.type._tag !== "StringKeyword" || k(r.type).minLength),
|
|
174
177
|
nullableOrUndefined: a
|
|
175
178
|
}
|
|
176
179
|
});
|
|
177
|
-
|
|
180
|
+
s[u] = S;
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
|
-
return
|
|
184
|
+
return s;
|
|
182
185
|
}
|
|
183
186
|
if (t) {
|
|
184
|
-
const
|
|
185
|
-
if (Object.hasOwnProperty.call(e, "required") || (e.required = !
|
|
186
|
-
const
|
|
187
|
-
(
|
|
187
|
+
const r = j(t);
|
|
188
|
+
if (Object.hasOwnProperty.call(e, "required") || (e.required = !r), i.AST.isUnion(t)) {
|
|
189
|
+
const m = L(t.types), l = m.find(
|
|
190
|
+
(d) => d._tag !== "UndefinedKeyword" && d !== i.Null.ast
|
|
188
191
|
);
|
|
189
|
-
return "propertySignatures" in
|
|
190
|
-
propertySignatures:
|
|
192
|
+
return "propertySignatures" in l ? y({
|
|
193
|
+
propertySignatures: l.propertySignatures,
|
|
191
194
|
parent: n,
|
|
192
195
|
meta: e
|
|
193
|
-
}) :
|
|
196
|
+
}) : m.every(i.AST.isLiteral) ? {
|
|
194
197
|
...e,
|
|
195
198
|
type: "select",
|
|
196
|
-
members:
|
|
199
|
+
members: m.map((d) => d.literal)
|
|
197
200
|
} : {
|
|
198
201
|
...e,
|
|
199
202
|
...y({
|
|
200
203
|
parent: n,
|
|
201
204
|
meta: e,
|
|
202
|
-
property:
|
|
205
|
+
property: l
|
|
203
206
|
})
|
|
204
207
|
};
|
|
205
208
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
if (i.AST.isTupleType(t))
|
|
210
|
+
return {
|
|
211
|
+
...e,
|
|
212
|
+
type: "multiple",
|
|
213
|
+
members: t.elements,
|
|
214
|
+
rest: t.rest
|
|
215
|
+
};
|
|
216
|
+
e = { ...i.AST.getAnnotation(
|
|
212
217
|
t,
|
|
213
218
|
i.AST.JSONSchemaAnnotationId
|
|
214
|
-
).pipe(
|
|
215
|
-
|
|
216
|
-
meta: e,
|
|
217
|
-
property: t.from
|
|
218
|
-
}) : (e.type = i.AST.getAnnotation(
|
|
219
|
+
).pipe(w.getOrElse(() => ({}))), ...e };
|
|
220
|
+
const a = i.AST.getAnnotation(
|
|
219
221
|
t,
|
|
220
222
|
i.AST.TitleAnnotationId
|
|
221
223
|
).pipe(
|
|
222
|
-
|
|
223
|
-
)
|
|
224
|
+
w.getOrElse(() => "unknown")
|
|
225
|
+
);
|
|
226
|
+
if (a === "Int" || a === "int")
|
|
227
|
+
e.type = "int";
|
|
228
|
+
else {
|
|
229
|
+
if ("from" in t)
|
|
230
|
+
return y({
|
|
231
|
+
parent: n,
|
|
232
|
+
meta: e,
|
|
233
|
+
property: t.from
|
|
234
|
+
});
|
|
235
|
+
e.type = a;
|
|
236
|
+
}
|
|
237
|
+
return e;
|
|
224
238
|
}
|
|
225
|
-
return
|
|
226
|
-
},
|
|
239
|
+
return s;
|
|
240
|
+
}, q = (e, n = "") => {
|
|
227
241
|
const t = {};
|
|
228
242
|
for (const o in e) {
|
|
229
|
-
const
|
|
230
|
-
|
|
243
|
+
const s = e[o], r = n ? `${n}.${o}` : o;
|
|
244
|
+
s && typeof s == "object" && "type" in s ? t[r] = s : s && typeof s == "object" && Object.assign(t, q(s, r));
|
|
231
245
|
}
|
|
232
246
|
return t;
|
|
233
|
-
},
|
|
234
|
-
const n = e.ast, t = {}, o = {},
|
|
247
|
+
}, E = (e) => {
|
|
248
|
+
const n = e.ast, t = {}, o = {}, s = {};
|
|
235
249
|
if (n._tag === "Transformation" || n._tag === "Refinement")
|
|
236
|
-
return
|
|
250
|
+
return E(i.make(n.from));
|
|
237
251
|
if (n._tag === "Union") {
|
|
238
|
-
const a = (n.types || []).filter((
|
|
239
|
-
if (a.every((
|
|
240
|
-
const
|
|
241
|
-
for (const
|
|
242
|
-
if ("propertySignatures" in
|
|
243
|
-
const
|
|
244
|
-
(
|
|
252
|
+
const a = (n.types || []).filter((l) => l._tag !== "UndefinedKeyword" && l !== i.Null.ast).map(_);
|
|
253
|
+
if (a.every((l) => l._tag === "TypeLiteral" && "propertySignatures" in l) && a.length > 0) {
|
|
254
|
+
const l = [];
|
|
255
|
+
for (const d of a)
|
|
256
|
+
if ("propertySignatures" in d) {
|
|
257
|
+
const S = d.propertySignatures.find(
|
|
258
|
+
(f) => f.name.toString() === "_tag"
|
|
245
259
|
);
|
|
246
260
|
let b = null;
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
propertySignatures:
|
|
261
|
+
S && i.AST.isLiteral(S.type) && (b = S.type.literal, l.push(b));
|
|
262
|
+
const p = y({
|
|
263
|
+
propertySignatures: d.propertySignatures
|
|
250
264
|
});
|
|
251
|
-
b && (
|
|
265
|
+
b && (s[b] = q(p)), Object.assign(t, p);
|
|
252
266
|
}
|
|
253
|
-
return
|
|
267
|
+
return l.length > 0 && (t._tag = {
|
|
254
268
|
type: "select",
|
|
255
|
-
members:
|
|
269
|
+
members: l,
|
|
256
270
|
required: !0
|
|
257
|
-
}), { meta: t, defaultValues: o, unionMeta:
|
|
271
|
+
}), { meta: t, defaultValues: o, unionMeta: s };
|
|
258
272
|
}
|
|
259
273
|
}
|
|
260
274
|
if ("propertySignatures" in n) {
|
|
261
|
-
const
|
|
275
|
+
const r = y({
|
|
262
276
|
propertySignatures: n.propertySignatures
|
|
263
277
|
});
|
|
264
|
-
if (Object.values(
|
|
265
|
-
return { meta:
|
|
266
|
-
const
|
|
267
|
-
for (const
|
|
268
|
-
const
|
|
269
|
-
a[
|
|
278
|
+
if (Object.values(r).every((a) => a && "type" in a))
|
|
279
|
+
return { meta: r, defaultValues: o, unionMeta: s };
|
|
280
|
+
const u = (a, m = "") => {
|
|
281
|
+
for (const l in a) {
|
|
282
|
+
const d = m ? `${m}.${l}` : l;
|
|
283
|
+
a[l] && typeof a[l] == "object" && "type" in a[l] ? t[d] = a[l] : a[l] && typeof a[l] == "object" && u(a[l], d);
|
|
270
284
|
}
|
|
271
285
|
};
|
|
272
|
-
|
|
286
|
+
u(r);
|
|
273
287
|
}
|
|
274
|
-
return { meta: t, defaultValues: o, unionMeta:
|
|
288
|
+
return { meta: t, defaultValues: o, unionMeta: s };
|
|
275
289
|
}, B = (e) => i.extend(e, i.Struct({})), z = (e) => {
|
|
276
|
-
const { meta: n, unionMeta: t } =
|
|
290
|
+
const { meta: n, unionMeta: t } = E(e);
|
|
277
291
|
return { schema: e, meta: n, unionMeta: t };
|
|
278
292
|
}, C = (e, n) => {
|
|
279
|
-
n || (n =
|
|
293
|
+
n || (n = V().trans);
|
|
280
294
|
let t;
|
|
281
295
|
switch (e.type) {
|
|
282
296
|
case "string":
|
|
@@ -301,9 +315,37 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
301
315
|
})
|
|
302
316
|
}));
|
|
303
317
|
break;
|
|
304
|
-
case "
|
|
318
|
+
case "int": {
|
|
305
319
|
t = i.Number.annotations({
|
|
306
320
|
message: () => n("validation.empty")
|
|
321
|
+
}).pipe(
|
|
322
|
+
i.int({ message: (s) => n("validation.integer.expected", { actualValue: String(s.actual) }) })
|
|
323
|
+
), typeof e.minimum == "number" && (t = t.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
|
|
324
|
+
message: () => n(e.minimum === 0 ? "validation.number.positive" : "validation.number.min", {
|
|
325
|
+
minimum: e.minimum,
|
|
326
|
+
isExclusive: !0
|
|
327
|
+
})
|
|
328
|
+
})), typeof e.maximum == "number" && (t = t.pipe(i.lessThanOrEqualTo(e.maximum)).annotations({
|
|
329
|
+
message: () => n("validation.number.max", {
|
|
330
|
+
maximum: e.maximum,
|
|
331
|
+
isExclusive: !0
|
|
332
|
+
})
|
|
333
|
+
})), typeof e.exclusiveMinimum == "number" && (t = t.pipe(i.greaterThan(e.exclusiveMinimum)).annotations({
|
|
334
|
+
message: () => n(e.exclusiveMinimum === 0 ? "validation.number.positive" : "validation.number.min", {
|
|
335
|
+
minimum: e.exclusiveMinimum,
|
|
336
|
+
isExclusive: !1
|
|
337
|
+
})
|
|
338
|
+
})), typeof e.exclusiveMaximum == "number" && (t = t.pipe(i.lessThan(e.exclusiveMaximum)).annotations({
|
|
339
|
+
message: () => n("validation.number.max", {
|
|
340
|
+
maximum: e.exclusiveMaximum,
|
|
341
|
+
isExclusive: !1
|
|
342
|
+
})
|
|
343
|
+
}));
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
case "number":
|
|
347
|
+
t = i.Number.annotations({
|
|
348
|
+
message: () => n("validation.number.expected", { actualValue: "NaN" })
|
|
307
349
|
}), e.required && t.annotations({
|
|
308
350
|
message: () => n("validation.empty")
|
|
309
351
|
}), typeof e.minimum == "number" && (t = t.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
|
|
@@ -384,71 +426,71 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
384
426
|
"time",
|
|
385
427
|
"url"
|
|
386
428
|
], H = (e) => K.includes(e) ? e : "text";
|
|
387
|
-
function
|
|
429
|
+
function I(e, n) {
|
|
388
430
|
const t = { ...e };
|
|
389
431
|
for (const o in n)
|
|
390
|
-
Array.isArray(n[o]) ? t[o] = n[o] : n[o] && $(n[o]) ? t[o] =
|
|
432
|
+
Array.isArray(n[o]) ? t[o] = n[o] : n[o] && $(n[o]) ? t[o] = I(t[o], n[o]) : t[o] = n[o];
|
|
391
433
|
return t;
|
|
392
434
|
}
|
|
393
|
-
function
|
|
435
|
+
function U(e) {
|
|
394
436
|
return e && "fields" in e && typeof e.fields == "object";
|
|
395
437
|
}
|
|
396
|
-
function
|
|
438
|
+
function F(e) {
|
|
397
439
|
return e && "members" in e && Array.isArray(e.members);
|
|
398
440
|
}
|
|
399
|
-
const
|
|
441
|
+
const h = (e, n = {}) => {
|
|
400
442
|
const t = e.ast;
|
|
401
443
|
if (t?.defaultValue)
|
|
402
444
|
return t.defaultValue();
|
|
403
|
-
if (
|
|
445
|
+
if (c(e.ast) === "null")
|
|
404
446
|
return null;
|
|
405
|
-
if (
|
|
406
|
-
if (
|
|
447
|
+
if (c(e.ast) !== "undefined") {
|
|
448
|
+
if (U(e)) {
|
|
407
449
|
const o = {};
|
|
408
|
-
for (const [
|
|
409
|
-
const
|
|
410
|
-
if (
|
|
450
|
+
for (const [s, r] of Object.entries(e.fields)) {
|
|
451
|
+
const u = r?.ast;
|
|
452
|
+
if (u?.defaultValue)
|
|
411
453
|
try {
|
|
412
|
-
o[
|
|
454
|
+
o[s] = u.defaultValue();
|
|
413
455
|
continue;
|
|
414
456
|
} catch {
|
|
415
457
|
}
|
|
416
|
-
const a =
|
|
417
|
-
a !== void 0 && (o[
|
|
458
|
+
const a = h(r, n[s] || {});
|
|
459
|
+
a !== void 0 && (o[s] = a);
|
|
418
460
|
}
|
|
419
461
|
return { ...o, ...n };
|
|
420
462
|
}
|
|
421
|
-
if (e?.from &&
|
|
422
|
-
return
|
|
423
|
-
if (
|
|
424
|
-
const o = e.members.reduce((
|
|
425
|
-
const
|
|
426
|
-
(!
|
|
427
|
-
}),
|
|
428
|
-
return Object.entries(o).reduce((
|
|
463
|
+
if (e?.from && U(e.from))
|
|
464
|
+
return h(e.from, n);
|
|
465
|
+
if (F(e)) {
|
|
466
|
+
const o = e.members.reduce((s, r) => (U(r) && Object.entries(r.fields).forEach(([u, a]) => {
|
|
467
|
+
const m = a.ast, l = s[u]?.ast;
|
|
468
|
+
(!s[u] || m?.defaultValue && !l?.defaultValue) && (s[u] = a);
|
|
469
|
+
}), s), {});
|
|
470
|
+
return Object.entries(o).reduce((s, [r, u]) => (s[r] = h(u, n[r] || {}), s), n);
|
|
429
471
|
}
|
|
430
472
|
if (Object.keys(n).length === 0)
|
|
431
473
|
switch (e.ast._tag) {
|
|
432
474
|
case "Refinement":
|
|
433
|
-
return
|
|
475
|
+
return h(i.make(e.ast.from), n);
|
|
434
476
|
case "Transformation": {
|
|
435
477
|
const o = i.make(e.ast.from);
|
|
436
|
-
return
|
|
478
|
+
return h(o, n);
|
|
437
479
|
}
|
|
438
480
|
case "TypeLiteral": {
|
|
439
481
|
const o = { ...n };
|
|
440
|
-
for (const
|
|
441
|
-
const
|
|
442
|
-
if (
|
|
443
|
-
o[
|
|
482
|
+
for (const s of t.propertySignatures) {
|
|
483
|
+
const r = s.name.toString(), u = s.type;
|
|
484
|
+
if (u._tag === "Transformation" && u.defaultValue) {
|
|
485
|
+
o[r] = u.defaultValue();
|
|
444
486
|
continue;
|
|
445
487
|
}
|
|
446
|
-
if (
|
|
447
|
-
o[
|
|
488
|
+
if (u.defaultValue) {
|
|
489
|
+
o[r] = u.defaultValue();
|
|
448
490
|
continue;
|
|
449
491
|
}
|
|
450
|
-
const a = i.make(
|
|
451
|
-
|
|
492
|
+
const a = i.make(u), m = h(a, n[r] || {});
|
|
493
|
+
m !== void 0 && (o[r] = m);
|
|
452
494
|
}
|
|
453
495
|
return o;
|
|
454
496
|
}
|
|
@@ -461,12 +503,12 @@ const x = (e, n = {}) => {
|
|
|
461
503
|
};
|
|
462
504
|
export {
|
|
463
505
|
y as createMeta,
|
|
464
|
-
|
|
465
|
-
|
|
506
|
+
I as deepMerge,
|
|
507
|
+
h as defaultsValueFromSchema,
|
|
466
508
|
B as duplicateSchema,
|
|
467
509
|
C as generateInputStandardSchemaFromFieldMeta,
|
|
468
510
|
z as generateMetaFromSchema,
|
|
469
511
|
H as getInputType,
|
|
470
|
-
|
|
512
|
+
c as isNullableOrUndefined,
|
|
471
513
|
G as nullableInput
|
|
472
514
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as m, createElementBlock as d, openBlock as u, withModifiers as f, createElementVNode as l, unref as s, renderSlot as a } from "vue";
|
|
2
2
|
import { useStore as b } from "@tanstack/vue-form";
|
|
3
3
|
import { usePreventClose as p } from "./vue-components.es11.js";
|
|
4
|
-
import { getOmegaStore as c } from "./vue-components.
|
|
4
|
+
import { getOmegaStore as c } from "./vue-components.es53.js";
|
|
5
5
|
const S = ["disabled"], V = /* @__PURE__ */ m({
|
|
6
6
|
__name: "OmegaWrapper",
|
|
7
7
|
props: {
|