@effect-app/vue-components 4.0.0-beta.21 → 4.0.0-beta.23
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/README.md +24 -0
- package/dist/reset.css +51 -0
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +6 -4
- package/dist/vue-components.es.js +13 -14
- package/dist/vue-components.es12.js +203 -181
- package/dist/vue-components.es17.js +2 -2
- package/dist/vue-components.es2.js +17 -18
- package/dist/vue-components.es20.js +2 -2
- package/dist/vue-components.es21.js +2 -2
- package/dist/vue-components.es30.js +191 -28
- package/dist/vue-components.es32.js +29 -2
- package/dist/vue-components.es33.js +4 -2
- package/dist/vue-components.es34.js +2 -111
- package/dist/vue-components.es35.js +4 -0
- package/dist/vue-components.es36.js +111 -7
- package/dist/vue-components.es38.js +9 -0
- package/dist/vue-components.es39.js +27 -187
- package/dist/vue-components.es41.js +1 -1
- package/dist/vue-components.es7.js +6 -6
- package/package.json +9 -5
- package/src/components/OmegaForm/OmegaFormStuff.ts +131 -39
- package/src/components/OmegaForm/OmegaInternalInput.vue +6 -4
- package/src/reset.css +51 -0
- package/dist/vue-components.es31.js +0 -6
- package/dist/vue-components.es37.js +0 -34
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
import { S as i, Effect as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import { isObject as
|
|
4
|
-
const
|
|
1
|
+
import { S as i, Effect as P, Option as w } from "effect-app";
|
|
2
|
+
import { useIntl as I, getTransformationFrom as q } from "./vue-components.es3.js";
|
|
3
|
+
import { isObject as G } from "./vue-components.es16.js";
|
|
4
|
+
const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV !== "production", S = (e) => {
|
|
5
5
|
let t = q(e);
|
|
6
6
|
for (; i.AST.isDeclaration(t) && t.typeParameters.length > 0; )
|
|
7
7
|
t = q(t.typeParameters[0]);
|
|
8
8
|
return t;
|
|
9
|
-
},
|
|
9
|
+
}, j = (e) => i.AST.isUndefined(e) || i.AST.isNull(e), _ = (e) => i.AST.isUnion(e) && e.types.length === 1 && i.AST.isLiteral(e.types[0]) ? e.types[0] : e, B = (e) => i.AST.isUnion(e) ? e.types.find((t) => j(t)) : !1, g = (e) => !e || !i.AST.isUnion(e) ? !1 : e.types.find((t) => i.AST.isUndefined(t)) ? "undefined" : e.types.find((t) => i.AST.isNull(t)) ? "null" : !1, U = (e) => {
|
|
10
10
|
const t = [];
|
|
11
11
|
for (const n of e)
|
|
12
12
|
if (i.AST.isUnion(n)) {
|
|
13
|
-
const r =
|
|
13
|
+
const r = U(n.types);
|
|
14
14
|
t.push(...r);
|
|
15
15
|
} else
|
|
16
16
|
t.push(n);
|
|
17
17
|
return t;
|
|
18
|
-
},
|
|
18
|
+
}, F = (e) => U(e).map(S).filter((t) => !j(t)), C = (e) => {
|
|
19
19
|
const t = i.AST.resolve(e)?.jsonSchema;
|
|
20
20
|
return t && typeof t == "object" ? t : {};
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
if (t?.transformation?.decode?.run)
|
|
21
|
+
}, D = (e) => {
|
|
22
|
+
if (e?.transformation?.decode?.run)
|
|
24
23
|
try {
|
|
25
|
-
const
|
|
26
|
-
return
|
|
24
|
+
const t = P.runSync(e.transformation.decode.run(w.none()));
|
|
25
|
+
return w.isSome(t) ? t.value : void 0;
|
|
27
26
|
} catch {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
},
|
|
29
|
+
}, A = (e) => {
|
|
30
|
+
const t = e.context?.defaultValue?.[0], n = D(t);
|
|
31
|
+
if (n !== void 0) return n;
|
|
32
|
+
const r = e.encoding?.[0];
|
|
33
|
+
if (r && e.context?.isOptional)
|
|
34
|
+
return D(r);
|
|
35
|
+
}, R = (e) => (e.checks ?? []).flatMap((n) => {
|
|
31
36
|
if (n._tag === "FilterGroup")
|
|
32
|
-
return n.checks.flatMap((
|
|
33
|
-
const s =
|
|
37
|
+
return n.checks.flatMap((a) => {
|
|
38
|
+
const s = a.annotations?.meta;
|
|
34
39
|
return s && typeof s == "object" ? [s] : [];
|
|
35
40
|
});
|
|
36
41
|
const r = n.annotations?.meta;
|
|
37
42
|
return r && typeof r == "object" ? [r] : [];
|
|
38
|
-
}),
|
|
43
|
+
}), $ = (e) => {
|
|
39
44
|
const t = {
|
|
40
45
|
description: i.AST.resolveDescription(e)
|
|
41
|
-
}, n =
|
|
46
|
+
}, n = R(e);
|
|
42
47
|
if (i.AST.isString(e)) {
|
|
43
48
|
t.type = "string";
|
|
44
49
|
for (const r of n)
|
|
@@ -64,6 +69,9 @@ const b = (e) => {
|
|
|
64
69
|
case "isLessThanOrEqualTo":
|
|
65
70
|
t.maximum = r.maximum;
|
|
66
71
|
break;
|
|
72
|
+
case "isBetween":
|
|
73
|
+
t.minimum = r.minimum, t.maximum = r.maximum;
|
|
74
|
+
break;
|
|
67
75
|
case "isGreaterThan":
|
|
68
76
|
t.exclusiveMinimum = r.exclusiveMinimum;
|
|
69
77
|
break;
|
|
@@ -71,122 +79,127 @@ const b = (e) => {
|
|
|
71
79
|
t.exclusiveMaximum = r.exclusiveMaximum;
|
|
72
80
|
break;
|
|
73
81
|
}
|
|
74
|
-
} else i.AST.isBoolean(e) ? t.type = "boolean" : t.type = "unknown";
|
|
82
|
+
} else i.AST.isBoolean(e) ? t.type = "boolean" : i.AST.isDeclaration(e) && e.annotations?.typeConstructor?._tag === "Date" ? t.type = "date" : t.type = "unknown";
|
|
75
83
|
return t;
|
|
76
|
-
},
|
|
77
|
-
if (n && (n =
|
|
78
|
-
return
|
|
84
|
+
}, y = ({ meta: e = {}, parent: t = "", property: n, propertySignatures: r }, a = {}) => {
|
|
85
|
+
if (n && (n = S(n)), n && i.AST.isObjects(n))
|
|
86
|
+
return y({
|
|
79
87
|
meta: e,
|
|
80
88
|
propertySignatures: n.propertySignatures
|
|
81
89
|
});
|
|
82
90
|
if (r) {
|
|
83
91
|
for (const s of r) {
|
|
84
|
-
const l = t ? `${t}.${s.name.toString()}` : s.name.toString(),
|
|
85
|
-
let
|
|
86
|
-
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ?
|
|
87
|
-
const
|
|
92
|
+
const l = t ? `${t}.${s.name.toString()}` : s.name.toString(), o = g(s.type);
|
|
93
|
+
let m;
|
|
94
|
+
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ? m = !1 : m = !o;
|
|
95
|
+
const c = S(s.type);
|
|
88
96
|
if (i.AST.isUnion(s.type)) {
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
if (!
|
|
92
|
-
const f =
|
|
97
|
+
const u = F(s.type.types);
|
|
98
|
+
if (u.some(i.AST.isObjects)) {
|
|
99
|
+
if (!o) {
|
|
100
|
+
const f = y({
|
|
93
101
|
parent: l,
|
|
94
102
|
property: s.type,
|
|
95
|
-
meta: { required:
|
|
103
|
+
meta: { required: m, nullableOrUndefined: o }
|
|
96
104
|
});
|
|
97
|
-
|
|
105
|
+
a[l] = f;
|
|
98
106
|
}
|
|
99
|
-
for (const f of
|
|
107
|
+
for (const f of u)
|
|
100
108
|
if (i.AST.isObjects(f)) {
|
|
101
|
-
const p =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
const p = o && u.length > 1, h = y({
|
|
110
|
+
parent: l,
|
|
111
|
+
propertySignatures: f.propertySignatures,
|
|
112
|
+
meta: p ? { _isNullableDiscriminatedUnion: !0 } : {}
|
|
113
|
+
});
|
|
114
|
+
for (const [d, T] of Object.entries(h)) {
|
|
115
|
+
const b = a[d];
|
|
116
|
+
b && b.type === "select" && T?.type === "select" ? b.members = [
|
|
117
|
+
...b.members,
|
|
118
|
+
...T.members.filter(
|
|
119
|
+
(x) => !b.members.includes(x)
|
|
120
|
+
)
|
|
121
|
+
] : a[d] = T;
|
|
122
|
+
}
|
|
110
123
|
}
|
|
111
124
|
} else {
|
|
112
|
-
const f =
|
|
125
|
+
const f = u.filter(i.AST.isArrays);
|
|
113
126
|
if (f.length > 0) {
|
|
114
127
|
const p = f[0];
|
|
115
|
-
if (
|
|
128
|
+
if (a[l] = {
|
|
116
129
|
type: "multiple",
|
|
117
130
|
members: p.elements,
|
|
118
131
|
rest: p.rest,
|
|
119
|
-
required:
|
|
120
|
-
nullableOrUndefined:
|
|
132
|
+
required: m,
|
|
133
|
+
nullableOrUndefined: o
|
|
121
134
|
}, p.rest && p.rest.length > 0) {
|
|
122
|
-
const
|
|
123
|
-
if (i.AST.isObjects(
|
|
124
|
-
for (const
|
|
125
|
-
const
|
|
126
|
-
parent:
|
|
127
|
-
property:
|
|
135
|
+
const h = S(p.rest[0]);
|
|
136
|
+
if (i.AST.isObjects(h))
|
|
137
|
+
for (const d of h.propertySignatures) {
|
|
138
|
+
const T = `${l}.${d.name.toString()}`, b = y({
|
|
139
|
+
parent: T,
|
|
140
|
+
property: d.type,
|
|
128
141
|
meta: {
|
|
129
|
-
required: !g(
|
|
130
|
-
nullableOrUndefined: g(
|
|
142
|
+
required: !g(d.type),
|
|
143
|
+
nullableOrUndefined: g(d.type)
|
|
131
144
|
}
|
|
132
145
|
});
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
if (i.AST.isObjects(
|
|
136
|
-
for (const
|
|
137
|
-
const N = `${
|
|
146
|
+
if (b && typeof b == "object" && "type" in b && (a[T] = b, b.type === "multiple" && i.AST.isArrays(d.type) && d.type.rest && d.type.rest.length > 0)) {
|
|
147
|
+
const x = S(d.type.rest[0]);
|
|
148
|
+
if (i.AST.isObjects(x))
|
|
149
|
+
for (const O of x.propertySignatures) {
|
|
150
|
+
const N = `${T}.${O.name.toString()}`, k = y({
|
|
138
151
|
parent: N,
|
|
139
|
-
property:
|
|
152
|
+
property: O.type,
|
|
140
153
|
meta: {
|
|
141
|
-
required: !g(
|
|
142
|
-
nullableOrUndefined: g(
|
|
154
|
+
required: !g(O.type),
|
|
155
|
+
nullableOrUndefined: g(O.type)
|
|
143
156
|
}
|
|
144
157
|
});
|
|
145
|
-
|
|
158
|
+
k && typeof k == "object" && "type" in k && (a[N] = k);
|
|
146
159
|
}
|
|
147
160
|
}
|
|
148
161
|
}
|
|
149
162
|
}
|
|
150
163
|
} else {
|
|
151
|
-
const p =
|
|
164
|
+
const p = y({
|
|
152
165
|
parent: l,
|
|
153
166
|
property: s.type,
|
|
154
|
-
meta: { required:
|
|
167
|
+
meta: { required: m, nullableOrUndefined: o }
|
|
155
168
|
});
|
|
156
|
-
|
|
169
|
+
a[l] = p;
|
|
157
170
|
}
|
|
158
171
|
}
|
|
159
|
-
} else if (i.AST.isObjects(
|
|
172
|
+
} else if (i.AST.isObjects(c))
|
|
160
173
|
Object.assign(
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
a,
|
|
175
|
+
y({
|
|
163
176
|
parent: l,
|
|
164
|
-
propertySignatures:
|
|
165
|
-
meta: { required:
|
|
177
|
+
propertySignatures: c.propertySignatures,
|
|
178
|
+
meta: { required: m, nullableOrUndefined: o }
|
|
166
179
|
})
|
|
167
180
|
);
|
|
168
181
|
else if (i.AST.isArrays(s.type))
|
|
169
|
-
if (s.type.rest.length > 0 && i.AST.isObjects(
|
|
170
|
-
const
|
|
171
|
-
if (i.AST.isObjects(
|
|
172
|
-
for (const f of
|
|
182
|
+
if (s.type.rest.length > 0 && i.AST.isObjects(S(s.type.rest[0]))) {
|
|
183
|
+
const v = S(s.type.rest[0]);
|
|
184
|
+
if (i.AST.isObjects(v))
|
|
185
|
+
for (const f of v.propertySignatures) {
|
|
173
186
|
const p = `${l}.${f.name.toString()}`;
|
|
174
187
|
if (i.AST.isArrays(f.type) && f.type.rest.length > 0) {
|
|
175
|
-
const
|
|
176
|
-
if (i.AST.isObjects(
|
|
177
|
-
for (const
|
|
178
|
-
const
|
|
179
|
-
parent:
|
|
180
|
-
property:
|
|
188
|
+
const h = S(f.type.rest[0]);
|
|
189
|
+
if (i.AST.isObjects(h))
|
|
190
|
+
for (const d of h.propertySignatures) {
|
|
191
|
+
const T = `${p}.${d.name.toString()}`, b = y({
|
|
192
|
+
parent: T,
|
|
193
|
+
property: d.type,
|
|
181
194
|
meta: {
|
|
182
|
-
required: !g(
|
|
183
|
-
nullableOrUndefined: g(
|
|
195
|
+
required: !g(d.type),
|
|
196
|
+
nullableOrUndefined: g(d.type)
|
|
184
197
|
}
|
|
185
198
|
});
|
|
186
|
-
|
|
199
|
+
a[T] = b;
|
|
187
200
|
}
|
|
188
201
|
else
|
|
189
|
-
|
|
202
|
+
a[p] = {
|
|
190
203
|
type: "multiple",
|
|
191
204
|
members: f.type.elements,
|
|
192
205
|
rest: f.type.rest,
|
|
@@ -194,7 +207,7 @@ const b = (e) => {
|
|
|
194
207
|
nullableOrUndefined: g(f.type)
|
|
195
208
|
};
|
|
196
209
|
} else {
|
|
197
|
-
const
|
|
210
|
+
const h = y({
|
|
198
211
|
parent: p,
|
|
199
212
|
property: f.type,
|
|
200
213
|
meta: {
|
|
@@ -202,51 +215,57 @@ const b = (e) => {
|
|
|
202
215
|
nullableOrUndefined: g(f.type)
|
|
203
216
|
}
|
|
204
217
|
});
|
|
205
|
-
|
|
218
|
+
a[p] = h;
|
|
206
219
|
}
|
|
207
220
|
}
|
|
208
221
|
} else
|
|
209
|
-
|
|
222
|
+
a[l] = {
|
|
210
223
|
type: "multiple",
|
|
211
224
|
members: s.type.elements,
|
|
212
225
|
rest: s.type.rest,
|
|
213
|
-
required:
|
|
214
|
-
nullableOrUndefined:
|
|
226
|
+
required: m,
|
|
227
|
+
nullableOrUndefined: o
|
|
215
228
|
};
|
|
216
229
|
else {
|
|
217
|
-
const
|
|
230
|
+
const u = y({
|
|
218
231
|
parent: l,
|
|
219
232
|
property: s.type,
|
|
220
233
|
meta: {
|
|
221
234
|
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
222
235
|
// TODO: handle this better via the createMeta minLength parsing
|
|
223
|
-
required:
|
|
224
|
-
nullableOrUndefined:
|
|
236
|
+
required: m && (!i.AST.isString(c) || !!$(s.type).minLength),
|
|
237
|
+
nullableOrUndefined: o
|
|
225
238
|
}
|
|
226
239
|
});
|
|
227
|
-
|
|
240
|
+
a[l] = u;
|
|
228
241
|
}
|
|
229
242
|
}
|
|
230
|
-
return
|
|
243
|
+
return a;
|
|
231
244
|
}
|
|
232
245
|
if (n) {
|
|
233
|
-
const s =
|
|
234
|
-
if (n =
|
|
235
|
-
const l =
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
246
|
+
const s = B(n);
|
|
247
|
+
if (n = S(n), Object.hasOwnProperty.call(e, "required") || (e.required = !s), i.AST.isUnion(n)) {
|
|
248
|
+
const l = U(n.types).map(S), o = l.filter((u) => !j(u));
|
|
249
|
+
if (o.length === 1 && i.AST.isLiteral(o[0]) && typeof o[0].literal == "boolean")
|
|
250
|
+
return y({ parent: t, meta: e, property: o[0] });
|
|
251
|
+
const m = o[0];
|
|
252
|
+
if (i.AST.isObjects(m))
|
|
253
|
+
return y({
|
|
254
|
+
propertySignatures: m.propertySignatures,
|
|
255
|
+
parent: t,
|
|
256
|
+
meta: e
|
|
257
|
+
});
|
|
258
|
+
const c = l.map(_);
|
|
259
|
+
return c.every((u) => j(u) || i.AST.isLiteral(u)) ? {
|
|
241
260
|
...e,
|
|
242
261
|
type: "select",
|
|
243
|
-
members:
|
|
262
|
+
members: c.filter(i.AST.isLiteral).map((u) => u.literal)
|
|
244
263
|
} : {
|
|
245
264
|
...e,
|
|
246
|
-
...
|
|
265
|
+
...y({
|
|
247
266
|
parent: t,
|
|
248
267
|
meta: e,
|
|
249
|
-
property:
|
|
268
|
+
property: m
|
|
250
269
|
})
|
|
251
270
|
};
|
|
252
271
|
}
|
|
@@ -255,61 +274,64 @@ const b = (e) => {
|
|
|
255
274
|
type: "multiple",
|
|
256
275
|
members: n.elements,
|
|
257
276
|
rest: n.rest
|
|
258
|
-
} : (e = { ...
|
|
277
|
+
} : (e = { ...C(n), ...$(n), ...e }, e);
|
|
259
278
|
}
|
|
260
|
-
return
|
|
261
|
-
},
|
|
279
|
+
return a;
|
|
280
|
+
}, V = (e, t = "") => {
|
|
262
281
|
const n = {};
|
|
263
282
|
for (const r in e) {
|
|
264
|
-
const
|
|
265
|
-
|
|
283
|
+
const a = e[r], s = t ? `${t}.${r}` : r;
|
|
284
|
+
a && typeof a == "object" && "type" in a ? n[s] = a : a && typeof a == "object" && Object.assign(n, V(a, s));
|
|
266
285
|
}
|
|
267
286
|
return n;
|
|
268
|
-
},
|
|
269
|
-
const t =
|
|
287
|
+
}, J = (e) => {
|
|
288
|
+
const t = S(e.ast), n = {}, r = {}, a = {};
|
|
270
289
|
if (i.AST.isUnion(t)) {
|
|
271
|
-
const s =
|
|
290
|
+
const s = F(t.types);
|
|
272
291
|
if (s.every(i.AST.isObjects) && s.length > 0) {
|
|
273
|
-
const
|
|
274
|
-
for (const
|
|
275
|
-
if (i.AST.isObjects(
|
|
276
|
-
const
|
|
277
|
-
(
|
|
292
|
+
const o = [];
|
|
293
|
+
for (const m of s)
|
|
294
|
+
if (i.AST.isObjects(m)) {
|
|
295
|
+
const c = m.propertySignatures.find(
|
|
296
|
+
(p) => p.name.toString() === "_tag"
|
|
278
297
|
);
|
|
279
|
-
let
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
298
|
+
let u = null;
|
|
299
|
+
const v = c ? _(c.type) : null;
|
|
300
|
+
v && i.AST.isLiteral(v) && (u = v.literal, o.push(u), c && i.AST.isUnion(c.type) && K() && u != null && !E.has(u) && (E.add(u), console.warn(
|
|
301
|
+
`[OmegaForm] Union member with _tag "${u}" uses S.Struct({ _tag: S.Literal("${u}"), ... }). Please migrate to S.TaggedStruct("${u}", { ... }) for cleaner AST handling.`
|
|
302
|
+
)));
|
|
303
|
+
const f = y({
|
|
304
|
+
propertySignatures: m.propertySignatures
|
|
283
305
|
});
|
|
284
|
-
|
|
306
|
+
u && (a[u] = V(f)), Object.assign(n, f);
|
|
285
307
|
}
|
|
286
|
-
return
|
|
308
|
+
return o.length > 0 && (n._tag = {
|
|
287
309
|
type: "select",
|
|
288
|
-
members:
|
|
310
|
+
members: o,
|
|
289
311
|
required: !0
|
|
290
|
-
}), { meta: n, defaultValues: r, unionMeta:
|
|
312
|
+
}), { meta: n, defaultValues: r, unionMeta: a };
|
|
291
313
|
}
|
|
292
314
|
}
|
|
293
315
|
if (i.AST.isObjects(t)) {
|
|
294
|
-
const s =
|
|
316
|
+
const s = y({
|
|
295
317
|
propertySignatures: t.propertySignatures
|
|
296
318
|
});
|
|
297
|
-
if (Object.values(s).every((
|
|
298
|
-
return { meta: s, defaultValues: r, unionMeta:
|
|
299
|
-
const l = (
|
|
300
|
-
for (const
|
|
301
|
-
const
|
|
302
|
-
|
|
319
|
+
if (Object.values(s).every((o) => o && "type" in o))
|
|
320
|
+
return { meta: s, defaultValues: r, unionMeta: a };
|
|
321
|
+
const l = (o, m = "") => {
|
|
322
|
+
for (const c in o) {
|
|
323
|
+
const u = m ? `${m}.${c}` : c;
|
|
324
|
+
o[c] && typeof o[c] == "object" && "type" in o[c] ? n[u] = o[c] : o[c] && typeof o[c] == "object" && l(o[c], u);
|
|
303
325
|
}
|
|
304
326
|
};
|
|
305
327
|
l(s);
|
|
306
328
|
}
|
|
307
|
-
return { meta: n, defaultValues: r, unionMeta:
|
|
308
|
-
},
|
|
309
|
-
const { meta: t, unionMeta: n } =
|
|
329
|
+
return { meta: n, defaultValues: r, unionMeta: a };
|
|
330
|
+
}, Z = (e) => e, ee = (e) => {
|
|
331
|
+
const { meta: t, unionMeta: n } = J(e);
|
|
310
332
|
return { schema: e, meta: t, unionMeta: n };
|
|
311
|
-
},
|
|
312
|
-
t || (t =
|
|
333
|
+
}, te = (e, t) => {
|
|
334
|
+
t || (t = I().trans);
|
|
313
335
|
let n;
|
|
314
336
|
switch (e.type) {
|
|
315
337
|
case "string":
|
|
@@ -379,6 +401,9 @@ const b = (e) => {
|
|
|
379
401
|
case "boolean":
|
|
380
402
|
n = i.Boolean;
|
|
381
403
|
break;
|
|
404
|
+
case "date":
|
|
405
|
+
n = i.Date;
|
|
406
|
+
break;
|
|
382
407
|
case "unknown":
|
|
383
408
|
n = i.Unknown;
|
|
384
409
|
break;
|
|
@@ -387,7 +412,7 @@ const b = (e) => {
|
|
|
387
412
|
break;
|
|
388
413
|
}
|
|
389
414
|
return e.required || (n = i.NullishOr(n)), i.toStandardSchemaV1(n);
|
|
390
|
-
},
|
|
415
|
+
}, W = [
|
|
391
416
|
"button",
|
|
392
417
|
"checkbox",
|
|
393
418
|
"color",
|
|
@@ -403,63 +428,61 @@ const b = (e) => {
|
|
|
403
428
|
"text",
|
|
404
429
|
"time",
|
|
405
430
|
"url"
|
|
406
|
-
],
|
|
407
|
-
function
|
|
431
|
+
], ne = (e) => W.includes(e) ? e : "text";
|
|
432
|
+
function z(e, t) {
|
|
408
433
|
const n = { ...e };
|
|
409
434
|
for (const r in t)
|
|
410
|
-
Array.isArray(t[r]) ? n[r] = t[r] : t[r] &&
|
|
435
|
+
Array.isArray(t[r]) ? n[r] = t[r] : t[r] && G(t[r]) ? n[r] = z(n[r], t[r]) : n[r] = t[r];
|
|
411
436
|
return n;
|
|
412
437
|
}
|
|
413
|
-
function
|
|
438
|
+
function L(e) {
|
|
414
439
|
return e && "fields" in e && typeof e.fields == "object";
|
|
415
440
|
}
|
|
416
|
-
function
|
|
441
|
+
function H(e) {
|
|
417
442
|
return e && "members" in e && Array.isArray(e.members);
|
|
418
443
|
}
|
|
419
|
-
const
|
|
420
|
-
const n = e.ast, r =
|
|
444
|
+
const M = (e, t = {}) => {
|
|
445
|
+
const n = e.ast, r = A(n);
|
|
421
446
|
if (r !== void 0)
|
|
422
447
|
return r;
|
|
423
448
|
if (g(e.ast) === "null")
|
|
424
449
|
return null;
|
|
425
450
|
if (g(e.ast) !== "undefined") {
|
|
426
|
-
if (
|
|
427
|
-
const
|
|
451
|
+
if (L(e)) {
|
|
452
|
+
const a = {};
|
|
428
453
|
for (const [s, l] of Object.entries(e.fields)) {
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
const u = O(l, t[s] || {});
|
|
437
|
-
u !== void 0 && (o[s] = u);
|
|
454
|
+
const o = A(l?.ast);
|
|
455
|
+
if (o !== void 0) {
|
|
456
|
+
a[s] = o;
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
const m = M(l, t[s] || {});
|
|
460
|
+
m !== void 0 ? a[s] = m : g(l.ast) === "undefined" && (a[s] = void 0);
|
|
438
461
|
}
|
|
439
|
-
return { ...
|
|
462
|
+
return { ...a, ...t };
|
|
440
463
|
}
|
|
441
|
-
if (e?.from &&
|
|
442
|
-
return
|
|
443
|
-
if (
|
|
444
|
-
const
|
|
445
|
-
const
|
|
446
|
-
(!s[
|
|
464
|
+
if (e?.from && L(e.from))
|
|
465
|
+
return M(e.from, t);
|
|
466
|
+
if (H(e)) {
|
|
467
|
+
const a = e.members.reduce((s, l) => (L(l) && Object.entries(l.fields).forEach(([o, m]) => {
|
|
468
|
+
const c = A(m.ast), u = s[o] ? A(s[o].ast) : void 0;
|
|
469
|
+
(!s[o] || c !== void 0 && u === void 0) && (s[o] = m);
|
|
447
470
|
}), s), {});
|
|
448
|
-
return Object.keys(
|
|
471
|
+
return Object.keys(a).length === 0 ? Object.keys(t).length > 0 ? t : void 0 : Object.entries(a).reduce((s, [l, o]) => (s[l] = M(o, t[l] || {}), s), t);
|
|
449
472
|
}
|
|
450
473
|
if (Object.keys(t).length === 0) {
|
|
451
474
|
if (i.AST.isObjects(n)) {
|
|
452
|
-
const
|
|
475
|
+
const a = { ...t };
|
|
453
476
|
for (const s of n.propertySignatures) {
|
|
454
|
-
const l = s.name.toString(),
|
|
455
|
-
if (
|
|
456
|
-
|
|
477
|
+
const l = s.name.toString(), o = s.type, m = A(o);
|
|
478
|
+
if (m !== void 0) {
|
|
479
|
+
a[l] = m;
|
|
457
480
|
continue;
|
|
458
481
|
}
|
|
459
|
-
const
|
|
460
|
-
|
|
482
|
+
const c = i.make(o), u = M(c, t[l] || {});
|
|
483
|
+
u !== void 0 ? a[l] = u : g(o) === "undefined" && (a[l] = void 0);
|
|
461
484
|
}
|
|
462
|
-
return
|
|
485
|
+
return a;
|
|
463
486
|
}
|
|
464
487
|
if (i.AST.isString(n))
|
|
465
488
|
return "";
|
|
@@ -469,13 +492,12 @@ const O = (e, t = {}) => {
|
|
|
469
492
|
}
|
|
470
493
|
};
|
|
471
494
|
export {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
g as isNullableOrUndefined
|
|
480
|
-
Y as nullableInput
|
|
495
|
+
y as createMeta,
|
|
496
|
+
z as deepMerge,
|
|
497
|
+
M as defaultsValueFromSchema,
|
|
498
|
+
Z as duplicateSchema,
|
|
499
|
+
te as generateInputStandardSchemaFromFieldMeta,
|
|
500
|
+
ee as generateMetaFromSchema,
|
|
501
|
+
ne as getInputType,
|
|
502
|
+
g as isNullableOrUndefined
|
|
481
503
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Exit as c, Cause as u } from "effect";
|
|
2
|
-
import { dual as i } from "./vue-components.
|
|
3
|
-
import { isFunction as m } from "./vue-components.
|
|
2
|
+
import { dual as i } from "./vue-components.es32.js";
|
|
3
|
+
import { isFunction as m } from "./vue-components.es33.js";
|
|
4
4
|
const n = /* @__PURE__ */ Symbol.for("clone-trait"), a = i(2, (o, t) => n in o ? o[n](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(o)));
|
|
5
5
|
i(2, (o, t) => a(o, { ...o, ...m(t) ? t(o) : t }));
|
|
6
6
|
const O = (o, t) => new Promise((r, s) => o.addObserver((e) => {
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { default as t } from "./vue-components.es4.js";
|
|
2
2
|
import { default as o } from "./vue-components.es5.js";
|
|
3
|
-
import { createMeta as u, deepMerge as n, defaultsValueFromSchema as
|
|
4
|
-
import { useOmegaForm as
|
|
3
|
+
import { createMeta as u, deepMerge as n, defaultsValueFromSchema as f, duplicateSchema as p, generateInputStandardSchemaFromFieldMeta as d, generateMetaFromSchema as l, getInputType as s, isNullableOrUndefined as g } from "./vue-components.es12.js";
|
|
4
|
+
import { useOmegaForm as i } from "./vue-components.es10.js";
|
|
5
5
|
import { default as O } from "./vue-components.es6.js";
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { useOnClose as
|
|
10
|
-
import { createUseFormWithCustomInput as
|
|
6
|
+
import { default as I } from "./vue-components.es7.js";
|
|
7
|
+
import { default as S } from "./vue-components.es8.js";
|
|
8
|
+
import { default as M } from "./vue-components.es9.js";
|
|
9
|
+
import { useOnClose as T, usePreventClose as y } from "./vue-components.es11.js";
|
|
10
|
+
import { createUseFormWithCustomInput as b } from "./vue-components.es13.js";
|
|
11
11
|
export {
|
|
12
12
|
t as CommandButton,
|
|
13
13
|
o as Dialog,
|
|
14
14
|
O as OmegaInput,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
S as OmegaTaggedUnion,
|
|
16
|
+
M as OmegaTaggedUnionInternal,
|
|
17
|
+
I as OmegaVuetifyInput,
|
|
18
18
|
u as createMeta,
|
|
19
|
-
|
|
19
|
+
b as createUseFormWithCustomInput,
|
|
20
20
|
n as deepMerge,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
f as defaultsValueFromSchema,
|
|
22
|
+
p as duplicateSchema,
|
|
23
|
+
d as generateInputStandardSchemaFromFieldMeta,
|
|
24
|
+
l as generateMetaFromSchema,
|
|
25
25
|
s as getInputType,
|
|
26
26
|
g as isNullableOrUndefined,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
b as useOnClose,
|
|
27
|
+
i as useOmegaForm,
|
|
28
|
+
T as useOnClose,
|
|
30
29
|
y as usePreventClose
|
|
31
30
|
};
|