@effect-app/vue-components 2.11.4 → 3.0.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/OmegaFormStuff.d.ts +0 -1
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +0 -1
- package/dist/vue-components.es10.js +101 -106
- package/dist/vue-components.es12.js +147 -154
- 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.es30.js +41 -191
- package/dist/vue-components.es31.js +4 -0
- package/dist/vue-components.es32.js +2 -42
- package/dist/vue-components.es33.js +111 -2
- package/dist/vue-components.es35.js +7 -111
- package/dist/vue-components.es36.js +34 -0
- package/dist/vue-components.es38.js +187 -27
- package/dist/vue-components.es40.js +1 -1
- package/dist/vue-components.es6.js +31 -28
- package/dist/vue-components.es7.js +1 -1
- package/dist/vue-components.es8.js +13 -13
- package/dist/vue-components.es9.js +9 -15
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaFormStuff.ts +7 -24
- package/src/components/OmegaForm/OmegaInput.vue +16 -5
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +0 -1
- package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +8 -16
- package/src/components/OmegaForm/useOmegaForm.ts +3 -16
- package/src/components/OmegaForm/useRegisterField.ts +1 -3
- package/dist/vue-components.es34.js +0 -4
- package/dist/vue-components.es37.js +0 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as i, Option as
|
|
1
|
+
import { S as i, Option as q } from "effect-app";
|
|
2
2
|
import { getMetadataFromSchema as V } from "@effect-app/vue/form";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { isObject as
|
|
5
|
-
const
|
|
3
|
+
import { useIntl as E, getTransformationFrom as U } from "./vue-components.es3.js";
|
|
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), g = (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, _ = (e) => {
|
|
6
6
|
const n = [];
|
|
7
7
|
for (const t of e)
|
|
8
8
|
if (i.AST.isUnion(t)) {
|
|
@@ -20,76 +20,74 @@ const $ = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
20
20
|
});
|
|
21
21
|
if (t?._tag === "TypeLiteral" && "propertySignatures" in t)
|
|
22
22
|
return y({
|
|
23
|
-
parent: n,
|
|
24
|
-
// Pass parent to maintain the key prefix for nested structures
|
|
25
23
|
meta: e,
|
|
26
24
|
propertySignatures: t.propertySignatures
|
|
27
25
|
});
|
|
28
26
|
if (o) {
|
|
29
27
|
for (const s of o) {
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ?
|
|
33
|
-
const
|
|
28
|
+
const l = n ? `${n}.${s.name.toString()}` : s.name.toString(), a = g(s.type);
|
|
29
|
+
let f;
|
|
30
|
+
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ? f = !1 : f = !a;
|
|
31
|
+
const p = s.type;
|
|
34
32
|
if (i.AST.isUnion(s.type)) {
|
|
35
|
-
const
|
|
36
|
-
(
|
|
33
|
+
const c = _(s.type.types).filter(
|
|
34
|
+
(u) => u._tag !== "UndefinedKeyword" && u !== i.Null.ast
|
|
37
35
|
).map(U);
|
|
38
|
-
if (
|
|
39
|
-
(
|
|
36
|
+
if (c.some(
|
|
37
|
+
(u) => "propertySignatures" in u
|
|
40
38
|
)) {
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
parent:
|
|
39
|
+
if (!a) {
|
|
40
|
+
const u = y({
|
|
41
|
+
parent: l,
|
|
44
42
|
property: s.type,
|
|
45
|
-
meta: { required:
|
|
43
|
+
meta: { required: f, nullableOrUndefined: a }
|
|
46
44
|
});
|
|
47
|
-
|
|
45
|
+
r[l] = u;
|
|
48
46
|
}
|
|
49
|
-
for (const
|
|
50
|
-
if ("propertySignatures" in
|
|
51
|
-
const m =
|
|
47
|
+
for (const u of c)
|
|
48
|
+
if ("propertySignatures" in u) {
|
|
49
|
+
const m = a && c.length > 1;
|
|
52
50
|
Object.assign(
|
|
53
51
|
r,
|
|
54
52
|
y({
|
|
55
|
-
parent:
|
|
56
|
-
propertySignatures:
|
|
53
|
+
parent: l,
|
|
54
|
+
propertySignatures: u.propertySignatures,
|
|
57
55
|
meta: m ? { _isNullableDiscriminatedUnion: !0 } : {}
|
|
58
56
|
})
|
|
59
57
|
);
|
|
60
58
|
}
|
|
61
59
|
} else {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const m =
|
|
65
|
-
if (r[
|
|
60
|
+
const u = c.filter(i.AST.isTupleType);
|
|
61
|
+
if (u.length > 0) {
|
|
62
|
+
const m = u[0];
|
|
63
|
+
if (r[l] = {
|
|
66
64
|
type: "multiple",
|
|
67
65
|
members: m.elements,
|
|
68
66
|
rest: m.rest,
|
|
69
|
-
required:
|
|
70
|
-
nullableOrUndefined:
|
|
67
|
+
required: f,
|
|
68
|
+
nullableOrUndefined: a
|
|
71
69
|
}, m.rest && m.rest.length > 0) {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
for (const
|
|
75
|
-
const
|
|
76
|
-
parent:
|
|
77
|
-
property:
|
|
70
|
+
const T = m.rest[0];
|
|
71
|
+
if (T.type._tag === "TypeLiteral" && "propertySignatures" in T.type)
|
|
72
|
+
for (const d of T.type.propertySignatures) {
|
|
73
|
+
const h = `${l}.${d.name.toString()}`, v = y({
|
|
74
|
+
parent: h,
|
|
75
|
+
property: d.type,
|
|
78
76
|
meta: {
|
|
79
|
-
required: !
|
|
80
|
-
nullableOrUndefined:
|
|
77
|
+
required: !g(d.type),
|
|
78
|
+
nullableOrUndefined: g(d.type)
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
|
-
if (v && typeof v == "object" && "type" in v && (r[
|
|
84
|
-
const w =
|
|
81
|
+
if (v && typeof v == "object" && "type" in v && (r[h] = v, v.type === "multiple" && i.AST.isTupleType(d.type) && d.type.rest && d.type.rest.length > 0)) {
|
|
82
|
+
const w = d.type.rest[0];
|
|
85
83
|
if (w.type._tag === "TypeLiteral" && "propertySignatures" in w.type)
|
|
86
84
|
for (const A of w.type.propertySignatures) {
|
|
87
|
-
const L = `${
|
|
85
|
+
const L = `${h}.${A.name.toString()}`, O = y({
|
|
88
86
|
parent: L,
|
|
89
87
|
property: A.type,
|
|
90
88
|
meta: {
|
|
91
|
-
required: !
|
|
92
|
-
nullableOrUndefined:
|
|
89
|
+
required: !g(A.type),
|
|
90
|
+
nullableOrUndefined: g(A.type)
|
|
93
91
|
}
|
|
94
92
|
});
|
|
95
93
|
O && typeof O == "object" && "type" in O && (r[L] = O);
|
|
@@ -99,109 +97,109 @@ const $ = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
99
97
|
}
|
|
100
98
|
} else {
|
|
101
99
|
const m = y({
|
|
102
|
-
parent:
|
|
100
|
+
parent: l,
|
|
103
101
|
property: s.type,
|
|
104
|
-
meta: { required:
|
|
102
|
+
meta: { required: f, nullableOrUndefined: a }
|
|
105
103
|
});
|
|
106
|
-
r[
|
|
104
|
+
r[l] = m;
|
|
107
105
|
}
|
|
108
106
|
}
|
|
109
107
|
} else {
|
|
110
|
-
const
|
|
111
|
-
if ("propertySignatures" in
|
|
108
|
+
const S = U(p);
|
|
109
|
+
if ("propertySignatures" in S)
|
|
112
110
|
Object.assign(
|
|
113
111
|
r,
|
|
114
112
|
y({
|
|
115
|
-
parent:
|
|
116
|
-
propertySignatures:
|
|
117
|
-
meta: { required:
|
|
113
|
+
parent: l,
|
|
114
|
+
propertySignatures: S.propertySignatures,
|
|
115
|
+
meta: { required: f, nullableOrUndefined: a }
|
|
118
116
|
})
|
|
119
117
|
);
|
|
120
118
|
else if (i.AST.isTupleType(s.type))
|
|
121
119
|
if (s.type.rest.length > 0 && s.type.rest[0].type._tag === "TypeLiteral" && "propertySignatures" in s.type.rest[0].type) {
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
for (const
|
|
125
|
-
const m = `${
|
|
126
|
-
if (i.AST.isTupleType(
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
for (const
|
|
130
|
-
const
|
|
131
|
-
parent:
|
|
132
|
-
property:
|
|
120
|
+
const b = s.type.rest[0].type;
|
|
121
|
+
if (b._tag === "TypeLiteral" && "propertySignatures" in b)
|
|
122
|
+
for (const u of b.propertySignatures) {
|
|
123
|
+
const m = `${l}.${u.name.toString()}`;
|
|
124
|
+
if (i.AST.isTupleType(u.type) && u.type.rest.length > 0) {
|
|
125
|
+
const T = u.type.rest[0].type;
|
|
126
|
+
if (T._tag === "TypeLiteral" && "propertySignatures" in T)
|
|
127
|
+
for (const d of T.propertySignatures) {
|
|
128
|
+
const h = `${m}.${d.name.toString()}`, v = y({
|
|
129
|
+
parent: h,
|
|
130
|
+
property: d.type,
|
|
133
131
|
meta: {
|
|
134
|
-
required: !
|
|
135
|
-
nullableOrUndefined:
|
|
132
|
+
required: !g(d.type),
|
|
133
|
+
nullableOrUndefined: g(d.type)
|
|
136
134
|
}
|
|
137
135
|
});
|
|
138
|
-
r[
|
|
136
|
+
r[h] = v;
|
|
139
137
|
}
|
|
140
138
|
else
|
|
141
139
|
r[m] = {
|
|
142
140
|
type: "multiple",
|
|
143
|
-
members:
|
|
144
|
-
rest:
|
|
145
|
-
required: !
|
|
146
|
-
nullableOrUndefined:
|
|
141
|
+
members: u.type.elements,
|
|
142
|
+
rest: u.type.rest,
|
|
143
|
+
required: !g(u.type),
|
|
144
|
+
nullableOrUndefined: g(u.type)
|
|
147
145
|
};
|
|
148
146
|
} else {
|
|
149
|
-
const
|
|
147
|
+
const T = y({
|
|
150
148
|
parent: m,
|
|
151
|
-
property:
|
|
149
|
+
property: u.type,
|
|
152
150
|
meta: {
|
|
153
|
-
required: !
|
|
154
|
-
nullableOrUndefined:
|
|
151
|
+
required: !g(u.type),
|
|
152
|
+
nullableOrUndefined: g(u.type)
|
|
155
153
|
}
|
|
156
154
|
});
|
|
157
|
-
r[m] =
|
|
155
|
+
r[m] = T;
|
|
158
156
|
}
|
|
159
157
|
}
|
|
160
158
|
} else
|
|
161
|
-
r[
|
|
159
|
+
r[l] = {
|
|
162
160
|
type: "multiple",
|
|
163
161
|
members: s.type.elements,
|
|
164
162
|
rest: s.type.rest,
|
|
165
|
-
required:
|
|
166
|
-
nullableOrUndefined:
|
|
163
|
+
required: f,
|
|
164
|
+
nullableOrUndefined: a
|
|
167
165
|
};
|
|
168
166
|
else {
|
|
169
|
-
const
|
|
170
|
-
parent:
|
|
167
|
+
const c = y({
|
|
168
|
+
parent: l,
|
|
171
169
|
property: s.type,
|
|
172
170
|
meta: {
|
|
173
171
|
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
174
172
|
// TODO: handle this better via the createMeta minLength parsing
|
|
175
|
-
required:
|
|
176
|
-
nullableOrUndefined:
|
|
173
|
+
required: f && (s.type._tag !== "StringKeyword" || V(s.type).minLength),
|
|
174
|
+
nullableOrUndefined: a
|
|
177
175
|
}
|
|
178
176
|
});
|
|
179
|
-
r[
|
|
177
|
+
r[l] = c;
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
180
|
}
|
|
183
181
|
return r;
|
|
184
182
|
}
|
|
185
183
|
if (t) {
|
|
186
|
-
const s =
|
|
184
|
+
const s = j(t);
|
|
187
185
|
if (Object.hasOwnProperty.call(e, "required") || (e.required = !s), i.AST.isUnion(t)) {
|
|
188
|
-
const
|
|
189
|
-
(
|
|
186
|
+
const a = _(t.types), f = a.find(
|
|
187
|
+
(p) => p._tag !== "UndefinedKeyword" && p !== i.Null.ast
|
|
190
188
|
);
|
|
191
|
-
return "propertySignatures" in
|
|
192
|
-
propertySignatures:
|
|
189
|
+
return "propertySignatures" in f ? y({
|
|
190
|
+
propertySignatures: f.propertySignatures,
|
|
193
191
|
parent: n,
|
|
194
192
|
meta: e
|
|
195
|
-
}) :
|
|
193
|
+
}) : a.every(i.AST.isLiteral) ? {
|
|
196
194
|
...e,
|
|
197
195
|
type: "select",
|
|
198
|
-
members:
|
|
196
|
+
members: a.map((p) => p.literal)
|
|
199
197
|
} : {
|
|
200
198
|
...e,
|
|
201
199
|
...y({
|
|
202
200
|
parent: n,
|
|
203
201
|
meta: e,
|
|
204
|
-
property:
|
|
202
|
+
property: f
|
|
205
203
|
})
|
|
206
204
|
};
|
|
207
205
|
}
|
|
@@ -213,7 +211,7 @@ const $ = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
213
211
|
} : (e = { ...i.AST.getAnnotation(
|
|
214
212
|
t,
|
|
215
213
|
i.AST.JSONSchemaAnnotationId
|
|
216
|
-
).pipe(
|
|
214
|
+
).pipe(q.getOrElse(() => ({}))), ...e }, "from" in t ? y({
|
|
217
215
|
parent: n,
|
|
218
216
|
meta: e,
|
|
219
217
|
property: t.from
|
|
@@ -221,69 +219,64 @@ const $ = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
221
219
|
t,
|
|
222
220
|
i.AST.TitleAnnotationId
|
|
223
221
|
).pipe(
|
|
224
|
-
|
|
222
|
+
q.getOrElse(() => "unknown")
|
|
225
223
|
), e));
|
|
226
224
|
}
|
|
227
225
|
return r;
|
|
228
|
-
},
|
|
226
|
+
}, N = (e, n = "") => {
|
|
229
227
|
const t = {};
|
|
230
228
|
for (const o in e) {
|
|
231
229
|
const r = e[o], s = n ? `${n}.${o}` : o;
|
|
232
|
-
r && typeof r == "object" && "type" in r ? t[s] = r : r && typeof r == "object" && Object.assign(t,
|
|
230
|
+
r && typeof r == "object" && "type" in r ? t[s] = r : r && typeof r == "object" && Object.assign(t, N(r, s));
|
|
233
231
|
}
|
|
234
232
|
return t;
|
|
235
|
-
},
|
|
236
|
-
const n = e.ast, t = {}, o = {}, r = {}
|
|
233
|
+
}, k = (e) => {
|
|
234
|
+
const n = e.ast, t = {}, o = {}, r = {};
|
|
237
235
|
if (n._tag === "Transformation" || n._tag === "Refinement")
|
|
238
|
-
return
|
|
236
|
+
return k(i.make(n.from));
|
|
239
237
|
if (n._tag === "Union") {
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
const
|
|
243
|
-
for (const
|
|
244
|
-
if ("propertySignatures" in
|
|
245
|
-
const
|
|
246
|
-
(
|
|
238
|
+
const a = (n.types || []).filter((p) => p._tag !== "UndefinedKeyword" && p !== i.Null.ast).map(U);
|
|
239
|
+
if (a.every((p) => p._tag === "TypeLiteral" && "propertySignatures" in p) && a.length > 0) {
|
|
240
|
+
const p = [];
|
|
241
|
+
for (const S of a)
|
|
242
|
+
if ("propertySignatures" in S) {
|
|
243
|
+
const c = S.propertySignatures.find(
|
|
244
|
+
(m) => m.name.toString() === "_tag"
|
|
247
245
|
);
|
|
248
|
-
let
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
propertySignatures:
|
|
246
|
+
let b = null;
|
|
247
|
+
c && i.AST.isLiteral(c.type) && (b = c.type.literal, p.push(b));
|
|
248
|
+
const u = y({
|
|
249
|
+
propertySignatures: S.propertySignatures
|
|
252
250
|
});
|
|
253
|
-
|
|
254
|
-
r[p] = q(m);
|
|
255
|
-
const g = i.make(d);
|
|
256
|
-
s[p] = h(g);
|
|
257
|
-
}
|
|
258
|
-
Object.assign(t, m);
|
|
251
|
+
b && (r[b] = N(u)), Object.assign(t, u);
|
|
259
252
|
}
|
|
260
|
-
return
|
|
253
|
+
return p.length > 0 && (t._tag = {
|
|
261
254
|
type: "select",
|
|
262
|
-
members:
|
|
255
|
+
members: p,
|
|
263
256
|
required: !0
|
|
264
|
-
}), { meta: t, defaultValues: o, unionMeta: r
|
|
257
|
+
}), { meta: t, defaultValues: o, unionMeta: r };
|
|
265
258
|
}
|
|
266
259
|
}
|
|
267
260
|
if ("propertySignatures" in n) {
|
|
268
|
-
const
|
|
261
|
+
const s = y({
|
|
269
262
|
propertySignatures: n.propertySignatures
|
|
270
263
|
});
|
|
271
|
-
if (Object.values(
|
|
272
|
-
return { meta:
|
|
273
|
-
const
|
|
274
|
-
for (const
|
|
275
|
-
const
|
|
276
|
-
|
|
264
|
+
if (Object.values(s).every((a) => a && "type" in a))
|
|
265
|
+
return { meta: s, defaultValues: o, unionMeta: r };
|
|
266
|
+
const l = (a, f = "") => {
|
|
267
|
+
for (const p in a) {
|
|
268
|
+
const S = f ? `${f}.${p}` : p;
|
|
269
|
+
a[p] && typeof a[p] == "object" && "type" in a[p] ? t[S] = a[p] : a[p] && typeof a[p] == "object" && l(a[p], S);
|
|
277
270
|
}
|
|
278
271
|
};
|
|
279
|
-
|
|
272
|
+
l(s);
|
|
280
273
|
}
|
|
281
|
-
return { meta: t, defaultValues: o, unionMeta: r
|
|
274
|
+
return { meta: t, defaultValues: o, unionMeta: r };
|
|
282
275
|
}, B = (e) => i.extend(e, i.Struct({})), z = (e) => {
|
|
283
|
-
const { meta: n,
|
|
284
|
-
return { schema: e, meta: n, unionMeta:
|
|
276
|
+
const { meta: n, unionMeta: t } = k(e);
|
|
277
|
+
return { schema: e, meta: n, unionMeta: t };
|
|
285
278
|
}, C = (e, n) => {
|
|
286
|
-
n || (n =
|
|
279
|
+
n || (n = E().trans);
|
|
287
280
|
let t;
|
|
288
281
|
switch (e.type) {
|
|
289
282
|
case "string":
|
|
@@ -394,7 +387,7 @@ const $ = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
394
387
|
function F(e, n) {
|
|
395
388
|
const t = { ...e };
|
|
396
389
|
for (const o in n)
|
|
397
|
-
Array.isArray(n[o]) ? t[o] = n[o] : n[o] &&
|
|
390
|
+
Array.isArray(n[o]) ? t[o] = n[o] : n[o] && $(n[o]) ? t[o] = F(t[o], n[o]) : t[o] = n[o];
|
|
398
391
|
return t;
|
|
399
392
|
}
|
|
400
393
|
function M(e) {
|
|
@@ -403,59 +396,59 @@ function M(e) {
|
|
|
403
396
|
function P(e) {
|
|
404
397
|
return e && "members" in e && Array.isArray(e.members);
|
|
405
398
|
}
|
|
406
|
-
const
|
|
399
|
+
const x = (e, n = {}) => {
|
|
407
400
|
const t = e.ast;
|
|
408
401
|
if (t?.defaultValue)
|
|
409
402
|
return t.defaultValue();
|
|
410
|
-
if (
|
|
403
|
+
if (g(e.ast) === "null")
|
|
411
404
|
return null;
|
|
412
|
-
if (
|
|
405
|
+
if (g(e.ast) !== "undefined") {
|
|
413
406
|
if (M(e)) {
|
|
414
407
|
const o = {};
|
|
415
408
|
for (const [r, s] of Object.entries(e.fields)) {
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
409
|
+
const l = s?.ast;
|
|
410
|
+
if (l?.defaultValue)
|
|
418
411
|
try {
|
|
419
|
-
o[r] =
|
|
412
|
+
o[r] = l.defaultValue();
|
|
420
413
|
continue;
|
|
421
414
|
} catch {
|
|
422
415
|
}
|
|
423
|
-
const
|
|
424
|
-
|
|
416
|
+
const a = x(s, n[r] || {});
|
|
417
|
+
a !== void 0 && (o[r] = a);
|
|
425
418
|
}
|
|
426
419
|
return { ...o, ...n };
|
|
427
420
|
}
|
|
428
421
|
if (e?.from && M(e.from))
|
|
429
|
-
return
|
|
422
|
+
return x(e.from, n);
|
|
430
423
|
if (P(e)) {
|
|
431
|
-
const o = e.members.reduce((r, s) => (M(s) && Object.entries(s.fields).forEach(([
|
|
432
|
-
const
|
|
433
|
-
(!r[
|
|
424
|
+
const o = e.members.reduce((r, s) => (M(s) && Object.entries(s.fields).forEach(([l, a]) => {
|
|
425
|
+
const f = a.ast, p = r[l]?.ast;
|
|
426
|
+
(!r[l] || f?.defaultValue && !p?.defaultValue) && (r[l] = a);
|
|
434
427
|
}), r), {});
|
|
435
|
-
return Object.entries(o).reduce((r, [s,
|
|
428
|
+
return Object.entries(o).reduce((r, [s, l]) => (r[s] = x(l, n[s] || {}), r), n);
|
|
436
429
|
}
|
|
437
430
|
if (Object.keys(n).length === 0)
|
|
438
431
|
switch (e.ast._tag) {
|
|
439
432
|
case "Refinement":
|
|
440
|
-
return
|
|
433
|
+
return x(i.make(e.ast.from), n);
|
|
441
434
|
case "Transformation": {
|
|
442
435
|
const o = i.make(e.ast.from);
|
|
443
|
-
return
|
|
436
|
+
return x(o, n);
|
|
444
437
|
}
|
|
445
438
|
case "TypeLiteral": {
|
|
446
439
|
const o = { ...n };
|
|
447
440
|
for (const r of t.propertySignatures) {
|
|
448
|
-
const s = r.name.toString(),
|
|
449
|
-
if (
|
|
450
|
-
o[s] =
|
|
441
|
+
const s = r.name.toString(), l = r.type;
|
|
442
|
+
if (l._tag === "Transformation" && l.defaultValue) {
|
|
443
|
+
o[s] = l.defaultValue();
|
|
451
444
|
continue;
|
|
452
445
|
}
|
|
453
|
-
if (
|
|
454
|
-
o[s] =
|
|
446
|
+
if (l.defaultValue) {
|
|
447
|
+
o[s] = l.defaultValue();
|
|
455
448
|
continue;
|
|
456
449
|
}
|
|
457
|
-
const
|
|
458
|
-
|
|
450
|
+
const a = i.make(l), f = x(a, n[s] || {});
|
|
451
|
+
f !== void 0 && (o[s] = f);
|
|
459
452
|
}
|
|
460
453
|
return o;
|
|
461
454
|
}
|
|
@@ -469,11 +462,11 @@ const h = (e, n = {}) => {
|
|
|
469
462
|
export {
|
|
470
463
|
y as createMeta,
|
|
471
464
|
F as deepMerge,
|
|
472
|
-
|
|
465
|
+
x as defaultsValueFromSchema,
|
|
473
466
|
B as duplicateSchema,
|
|
474
467
|
C as generateInputStandardSchemaFromFieldMeta,
|
|
475
468
|
z as generateMetaFromSchema,
|
|
476
469
|
H as getInputType,
|
|
477
|
-
|
|
470
|
+
g as isNullableOrUndefined,
|
|
478
471
|
G as nullableInput
|
|
479
472
|
};
|
|
@@ -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.es30.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-6b2bf87e],.v-leave-to[data-v-6b2bf87e]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-6b2bf87e],.v-leave-active[data-v-6b2bf87e]{display:grid;transition:all .15s}.v-enter-to[data-v-6b2bf87e],.v-leave-from[data-v-6b2bf87e]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-6b2bf87e]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-6b2bf87e]{min-height:0}.error-list[data-v-6b2bf87e]{list-style-position:inside}.error-list [data-v-6b2bf87e]::marker{margin:0;padding:0}.error-alert-content[data-v-6b2bf87e]{background-color:var(--error-background, #fff5f5);color:var(--error-color, #c92a2a);padding:1em}.error-link[data-v-6b2bf87e]{font-weight:700;position:relative;color:var(--error-color, #c92a2a);cursor:pointer}.error-link[data-v-6b2bf87e]:after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:rgba(from var(--error-color, #c92a2a) r g b / .5)}.text-h6[data-v-6b2bf87e]{font-weight:700;font-size:1.25em}.error-message[data-v-6b2bf87e]{font-style:italic}.error-item[data-v-6b2bf87e]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-6b2bf87e]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-6b2bf87e]{display:flex;gap:1.5em}.container svg[data-v-6b2bf87e]{width:3em}.container .single-error[data-v-6b2bf87e]{display:inline-block}')),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(i,t){const r=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(r&&r.call(this),this.shadowRoot){const o=document.createElement("style");o.appendChild(document.createTextNode('.v-enter-from[data-v-6b2bf87e],.v-leave-to[data-v-6b2bf87e]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-6b2bf87e],.v-leave-active[data-v-6b2bf87e]{display:grid;transition:all .15s}.v-enter-to[data-v-6b2bf87e],.v-leave-from[data-v-6b2bf87e]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-6b2bf87e]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-6b2bf87e]{min-height:0}.error-list[data-v-6b2bf87e]{list-style-position:inside}.error-list [data-v-6b2bf87e]::marker{margin:0;padding:0}.error-alert-content[data-v-6b2bf87e]{background-color:var(--error-background, #fff5f5);color:var(--error-color, #c92a2a);padding:1em}.error-link[data-v-6b2bf87e]{font-weight:700;position:relative;color:var(--error-color, #c92a2a);cursor:pointer}.error-link[data-v-6b2bf87e]:after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:rgba(from var(--error-color, #c92a2a) r g b / .5)}.text-h6[data-v-6b2bf87e]{font-weight:700;font-size:1.25em}.error-message[data-v-6b2bf87e]{font-style:italic}.error-item[data-v-6b2bf87e]{margin-bottom:.5em;overflow:hidden}.error-item>div[data-v-6b2bf87e]{float:right;width:100%;max-width:calc(100% - 1.5em)}.container[data-v-6b2bf87e]{display:flex;gap:1.5em}.container svg[data-v-6b2bf87e]{width:3em}.container .single-error[data-v-6b2bf87e]{display:inline-block}')),this.shadowRoot.appendChild(o)}},e.call(window.customElements,i,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import r from "./vue-components.
|
|
2
|
+
import r from "./vue-components.es33.js";
|
|
3
3
|
|
|
4
|
-
import o from "./vue-components.
|
|
4
|
+
import o from "./vue-components.es35.js";
|
|
5
5
|
const m = /* @__PURE__ */ o(r, [["__scopeId", "data-v-6b2bf87e"]]);
|
|
6
6
|
export {
|
|
7
7
|
m 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-8c9cb27c]{display:contents}fieldset[disabled][data-v-8c9cb27c]>*{pointer-events:none}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(o,t){const d=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(d&&d.call(this),this.shadowRoot){const c=document.createElement("style");c.appendChild(document.createTextNode("fieldset[data-v-8c9cb27c]{display:contents}fieldset[disabled][data-v-8c9cb27c]>*{pointer-events:none}")),this.shadowRoot.appendChild(c)}},e.call(window.customElements,o,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import o from "./vue-components.
|
|
2
|
+
import o from "./vue-components.es36.js";
|
|
3
3
|
|
|
4
|
-
import m from "./vue-components.
|
|
4
|
+
import m from "./vue-components.es35.js";
|
|
5
5
|
const a = /* @__PURE__ */ m(o, [["__scopeId", "data-v-8c9cb27c"]]);
|
|
6
6
|
export {
|
|
7
7
|
a as default
|