@effect-app/vue-components 4.0.0-beta.34 → 4.0.0-beta.36
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 +8 -3
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +1 -1
- package/dist/vue-components.es.js +8 -7
- package/dist/vue-components.es10.js +120 -120
- package/dist/vue-components.es12.js +160 -138
- package/dist/vue-components.es17.js +2 -2
- package/dist/vue-components.es2.js +15 -14
- 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.es45.js +1 -1
- package/dist/vue-components.es52.js +2 -2
- package/dist/vue-components.es53.js +3 -3
- package/dist/vue-components.es55.js +29 -65
- package/dist/vue-components.es56.js +54 -45
- package/dist/vue-components.es57.js +54 -15
- package/dist/vue-components.es58.js +15 -31
- package/dist/vue-components.es59.js +30 -26
- package/dist/vue-components.es7.js +1 -1
- package/package.json +3 -3
- package/src/components/OmegaForm/OmegaFormStuff.ts +75 -4
- package/src/components/OmegaForm/useOmegaForm.ts +5 -4
- package/dist/vue-components.es31.js +0 -6
- package/dist/vue-components.es37.js +0 -34
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { S as i, Effect as
|
|
1
|
+
import { S as i, Effect as R, Option as w } from "effect-app";
|
|
2
2
|
import { useIntl as I, getTransformationFrom as q } from "./vue-components.es3.js";
|
|
3
3
|
import { isObject as G } from "./vue-components.es16.js";
|
|
4
|
-
const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV !== "production",
|
|
4
|
+
const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV !== "production", T = (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
|
-
}, j = (e) => i.AST.isUndefined(e) || i.AST.isNull(e),
|
|
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)) {
|
|
@@ -15,35 +15,35 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
15
15
|
} else
|
|
16
16
|
t.push(n);
|
|
17
17
|
return t;
|
|
18
|
-
},
|
|
18
|
+
}, V = (e) => U(e).map(T).filter((t) => !j(t)), C = (e) => {
|
|
19
19
|
const t = i.AST.resolve(e)?.jsonSchema;
|
|
20
20
|
return t && typeof t == "object" ? t : {};
|
|
21
21
|
}, D = (e) => {
|
|
22
22
|
if (e?.transformation?.decode?.run)
|
|
23
23
|
try {
|
|
24
|
-
const t =
|
|
25
|
-
return
|
|
24
|
+
const t = R.runSync(e.transformation.decode.run(w.none()));
|
|
25
|
+
return w.isSome(t) ? t.value : void 0;
|
|
26
26
|
} catch {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
},
|
|
29
|
+
}, v = (e) => {
|
|
30
30
|
const t = e.context?.defaultValue?.[0], n = D(t);
|
|
31
31
|
if (n !== void 0) return n;
|
|
32
32
|
const r = e.encoding?.[0];
|
|
33
33
|
if (r && e.context?.isOptional)
|
|
34
34
|
return D(r);
|
|
35
|
-
},
|
|
35
|
+
}, W = (e) => (e.checks ?? []).flatMap((n) => {
|
|
36
36
|
if (n._tag === "FilterGroup")
|
|
37
|
-
return n.checks.flatMap((
|
|
38
|
-
const s =
|
|
37
|
+
return n.checks.flatMap((o) => {
|
|
38
|
+
const s = o.annotations?.meta;
|
|
39
39
|
return s && typeof s == "object" ? [s] : [];
|
|
40
40
|
});
|
|
41
41
|
const r = n.annotations?.meta;
|
|
42
42
|
return r && typeof r == "object" ? [r] : [];
|
|
43
|
-
}),
|
|
43
|
+
}), F = (e) => {
|
|
44
44
|
const t = {
|
|
45
45
|
description: i.AST.resolveDescription(e)
|
|
46
|
-
}, n =
|
|
46
|
+
}, n = W(e);
|
|
47
47
|
if (i.AST.isString(e)) {
|
|
48
48
|
t.type = "string";
|
|
49
49
|
for (const r of n)
|
|
@@ -81,81 +81,81 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
81
81
|
}
|
|
82
82
|
} else i.AST.isBoolean(e) ? t.type = "boolean" : i.AST.isDeclaration(e) && e.annotations?.typeConstructor?._tag === "Date" ? t.type = "date" : t.type = "unknown";
|
|
83
83
|
return t;
|
|
84
|
-
}, y = ({ meta: e = {}, parent: t = "", property: n, propertySignatures: r },
|
|
85
|
-
if (n && (n =
|
|
84
|
+
}, y = ({ meta: e = {}, parent: t = "", property: n, propertySignatures: r }, o = {}) => {
|
|
85
|
+
if (n && (n = T(n)), n && i.AST.isObjects(n))
|
|
86
86
|
return y({
|
|
87
87
|
meta: e,
|
|
88
88
|
propertySignatures: n.propertySignatures
|
|
89
89
|
});
|
|
90
90
|
if (r) {
|
|
91
91
|
for (const s of r) {
|
|
92
|
-
const l = t ? `${t}.${s.name.toString()}` : s.name.toString(),
|
|
93
|
-
let
|
|
94
|
-
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ?
|
|
95
|
-
const
|
|
92
|
+
const l = t ? `${t}.${s.name.toString()}` : s.name.toString(), a = g(s.type);
|
|
93
|
+
let c;
|
|
94
|
+
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ? c = !1 : c = !a;
|
|
95
|
+
const m = T(s.type);
|
|
96
96
|
if (i.AST.isUnion(s.type)) {
|
|
97
|
-
const u =
|
|
97
|
+
const u = V(s.type.types);
|
|
98
98
|
if (u.some(i.AST.isObjects)) {
|
|
99
|
-
if (!
|
|
99
|
+
if (!a) {
|
|
100
100
|
const f = y({
|
|
101
101
|
parent: l,
|
|
102
102
|
property: s.type,
|
|
103
|
-
meta: { required:
|
|
103
|
+
meta: { required: c, nullableOrUndefined: a }
|
|
104
104
|
});
|
|
105
|
-
|
|
105
|
+
o[l] = f;
|
|
106
106
|
}
|
|
107
107
|
for (const f of u)
|
|
108
108
|
if (i.AST.isObjects(f)) {
|
|
109
|
-
const p =
|
|
109
|
+
const p = a && u.length > 1, A = y({
|
|
110
110
|
parent: l,
|
|
111
111
|
propertySignatures: f.propertySignatures,
|
|
112
112
|
meta: p ? { _isNullableDiscriminatedUnion: !0 } : {}
|
|
113
113
|
});
|
|
114
|
-
for (const [d,
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
...
|
|
118
|
-
...
|
|
119
|
-
(x) => !
|
|
114
|
+
for (const [d, h] of Object.entries(A)) {
|
|
115
|
+
const S = o[d];
|
|
116
|
+
S && S.type === "select" && h?.type === "select" ? S.members = [
|
|
117
|
+
...S.members,
|
|
118
|
+
...h.members.filter(
|
|
119
|
+
(x) => !S.members.includes(x)
|
|
120
120
|
)
|
|
121
|
-
] :
|
|
121
|
+
] : o[d] = h;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
} else {
|
|
125
125
|
const f = u.filter(i.AST.isArrays);
|
|
126
126
|
if (f.length > 0) {
|
|
127
127
|
const p = f[0];
|
|
128
|
-
if (
|
|
128
|
+
if (o[l] = {
|
|
129
129
|
type: "multiple",
|
|
130
130
|
members: p.elements,
|
|
131
131
|
rest: p.rest,
|
|
132
|
-
required:
|
|
133
|
-
nullableOrUndefined:
|
|
132
|
+
required: c,
|
|
133
|
+
nullableOrUndefined: a
|
|
134
134
|
}, p.rest && p.rest.length > 0) {
|
|
135
|
-
const
|
|
136
|
-
if (i.AST.isObjects(
|
|
137
|
-
for (const d of
|
|
138
|
-
const
|
|
139
|
-
parent:
|
|
135
|
+
const A = T(p.rest[0]);
|
|
136
|
+
if (i.AST.isObjects(A))
|
|
137
|
+
for (const d of A.propertySignatures) {
|
|
138
|
+
const h = `${l}.${d.name.toString()}`, S = y({
|
|
139
|
+
parent: h,
|
|
140
140
|
property: d.type,
|
|
141
141
|
meta: {
|
|
142
142
|
required: !g(d.type),
|
|
143
143
|
nullableOrUndefined: g(d.type)
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
|
-
if (
|
|
147
|
-
const x =
|
|
146
|
+
if (S && typeof S == "object" && "type" in S && (o[h] = S, S.type === "multiple" && i.AST.isArrays(d.type) && d.type.rest && d.type.rest.length > 0)) {
|
|
147
|
+
const x = T(d.type.rest[0]);
|
|
148
148
|
if (i.AST.isObjects(x))
|
|
149
149
|
for (const O of x.propertySignatures) {
|
|
150
|
-
const
|
|
151
|
-
parent:
|
|
150
|
+
const N = `${h}.${O.name.toString()}`, k = y({
|
|
151
|
+
parent: N,
|
|
152
152
|
property: O.type,
|
|
153
153
|
meta: {
|
|
154
154
|
required: !g(O.type),
|
|
155
155
|
nullableOrUndefined: g(O.type)
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
-
k && typeof k == "object" && "type" in k && (
|
|
158
|
+
k && typeof k == "object" && "type" in k && (o[N] = k);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -164,42 +164,42 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
164
164
|
const p = y({
|
|
165
165
|
parent: l,
|
|
166
166
|
property: s.type,
|
|
167
|
-
meta: { required:
|
|
167
|
+
meta: { required: c, nullableOrUndefined: a }
|
|
168
168
|
});
|
|
169
|
-
|
|
169
|
+
o[l] = p;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
} else if (i.AST.isObjects(
|
|
172
|
+
} else if (i.AST.isObjects(m))
|
|
173
173
|
Object.assign(
|
|
174
|
-
|
|
174
|
+
o,
|
|
175
175
|
y({
|
|
176
176
|
parent: l,
|
|
177
|
-
propertySignatures:
|
|
178
|
-
meta: { required:
|
|
177
|
+
propertySignatures: m.propertySignatures,
|
|
178
|
+
meta: { required: c, nullableOrUndefined: a }
|
|
179
179
|
})
|
|
180
180
|
);
|
|
181
181
|
else if (i.AST.isArrays(s.type))
|
|
182
|
-
if (s.type.rest.length > 0 && i.AST.isObjects(
|
|
183
|
-
const
|
|
184
|
-
if (i.AST.isObjects(
|
|
185
|
-
for (const f of
|
|
182
|
+
if (s.type.rest.length > 0 && i.AST.isObjects(T(s.type.rest[0]))) {
|
|
183
|
+
const b = T(s.type.rest[0]);
|
|
184
|
+
if (i.AST.isObjects(b))
|
|
185
|
+
for (const f of b.propertySignatures) {
|
|
186
186
|
const p = `${l}.${f.name.toString()}`;
|
|
187
187
|
if (i.AST.isArrays(f.type) && f.type.rest.length > 0) {
|
|
188
|
-
const
|
|
189
|
-
if (i.AST.isObjects(
|
|
190
|
-
for (const d of
|
|
191
|
-
const
|
|
192
|
-
parent:
|
|
188
|
+
const A = T(f.type.rest[0]);
|
|
189
|
+
if (i.AST.isObjects(A))
|
|
190
|
+
for (const d of A.propertySignatures) {
|
|
191
|
+
const h = `${p}.${d.name.toString()}`, S = y({
|
|
192
|
+
parent: h,
|
|
193
193
|
property: d.type,
|
|
194
194
|
meta: {
|
|
195
195
|
required: !g(d.type),
|
|
196
196
|
nullableOrUndefined: g(d.type)
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
|
-
|
|
199
|
+
o[h] = S;
|
|
200
200
|
}
|
|
201
201
|
else
|
|
202
|
-
|
|
202
|
+
o[p] = {
|
|
203
203
|
type: "multiple",
|
|
204
204
|
members: f.type.elements,
|
|
205
205
|
rest: f.type.rest,
|
|
@@ -207,7 +207,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
207
207
|
nullableOrUndefined: g(f.type)
|
|
208
208
|
};
|
|
209
209
|
} else {
|
|
210
|
-
const
|
|
210
|
+
const A = y({
|
|
211
211
|
parent: p,
|
|
212
212
|
property: f.type,
|
|
213
213
|
meta: {
|
|
@@ -215,16 +215,16 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
215
215
|
nullableOrUndefined: g(f.type)
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
|
-
|
|
218
|
+
o[p] = A;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
} else
|
|
222
|
-
|
|
222
|
+
o[l] = {
|
|
223
223
|
type: "multiple",
|
|
224
224
|
members: s.type.elements,
|
|
225
225
|
rest: s.type.rest,
|
|
226
|
-
required:
|
|
227
|
-
nullableOrUndefined:
|
|
226
|
+
required: c,
|
|
227
|
+
nullableOrUndefined: a
|
|
228
228
|
};
|
|
229
229
|
else {
|
|
230
230
|
const u = y({
|
|
@@ -233,39 +233,39 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
233
233
|
meta: {
|
|
234
234
|
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
235
235
|
// TODO: handle this better via the createMeta minLength parsing
|
|
236
|
-
required:
|
|
237
|
-
nullableOrUndefined:
|
|
236
|
+
required: c && (!i.AST.isString(m) || !!F(m).minLength),
|
|
237
|
+
nullableOrUndefined: a
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
|
-
|
|
240
|
+
o[l] = u;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
return
|
|
243
|
+
return o;
|
|
244
244
|
}
|
|
245
245
|
if (n) {
|
|
246
246
|
const s = B(n);
|
|
247
|
-
if (n =
|
|
248
|
-
const l = U(n.types).map(
|
|
249
|
-
if (
|
|
250
|
-
return y({ parent: t, meta: e, property:
|
|
251
|
-
const
|
|
252
|
-
if (i.AST.isObjects(
|
|
247
|
+
if (n = T(n), Object.hasOwnProperty.call(e, "required") || (e.required = !s), i.AST.isUnion(n)) {
|
|
248
|
+
const l = U(n.types).map(T), a = l.filter((u) => !j(u));
|
|
249
|
+
if (a.length === 1 && i.AST.isLiteral(a[0]) && typeof a[0].literal == "boolean")
|
|
250
|
+
return y({ parent: t, meta: e, property: a[0] });
|
|
251
|
+
const c = a[0];
|
|
252
|
+
if (i.AST.isObjects(c))
|
|
253
253
|
return y({
|
|
254
|
-
propertySignatures:
|
|
254
|
+
propertySignatures: c.propertySignatures,
|
|
255
255
|
parent: t,
|
|
256
256
|
meta: e
|
|
257
257
|
});
|
|
258
|
-
const
|
|
259
|
-
return
|
|
258
|
+
const m = l.map(_);
|
|
259
|
+
return m.every((u) => j(u) || i.AST.isLiteral(u)) ? {
|
|
260
260
|
...e,
|
|
261
261
|
type: "select",
|
|
262
|
-
members:
|
|
262
|
+
members: m.filter(i.AST.isLiteral).map((u) => u.literal)
|
|
263
263
|
} : {
|
|
264
264
|
...e,
|
|
265
265
|
...y({
|
|
266
266
|
parent: t,
|
|
267
267
|
meta: e,
|
|
268
|
-
property:
|
|
268
|
+
property: c
|
|
269
269
|
})
|
|
270
270
|
};
|
|
271
271
|
}
|
|
@@ -274,63 +274,84 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
274
274
|
type: "multiple",
|
|
275
275
|
members: n.elements,
|
|
276
276
|
rest: n.rest
|
|
277
|
-
} : (e = { ...C(n),
|
|
277
|
+
} : (e = { ...C(n), ...F(n), ...e }, e);
|
|
278
278
|
}
|
|
279
|
-
return
|
|
280
|
-
},
|
|
279
|
+
return o;
|
|
280
|
+
}, P = (e, t = "") => {
|
|
281
281
|
const n = {};
|
|
282
282
|
for (const r in e) {
|
|
283
|
-
const
|
|
284
|
-
|
|
283
|
+
const o = e[r], s = t ? `${t}.${r}` : r;
|
|
284
|
+
o && typeof o == "object" && "type" in o ? n[s] = o : o && typeof o == "object" && Object.assign(n, P(o, s));
|
|
285
285
|
}
|
|
286
286
|
return n;
|
|
287
287
|
}, J = (e) => {
|
|
288
|
-
const t =
|
|
288
|
+
const t = T(e.ast), n = {}, r = {}, o = {};
|
|
289
289
|
if (i.AST.isUnion(t)) {
|
|
290
|
-
const s =
|
|
290
|
+
const s = V(t.types);
|
|
291
291
|
if (s.every(i.AST.isObjects) && s.length > 0) {
|
|
292
|
-
const
|
|
293
|
-
for (const
|
|
294
|
-
if (i.AST.isObjects(
|
|
295
|
-
const
|
|
292
|
+
const a = [];
|
|
293
|
+
for (const c of s)
|
|
294
|
+
if (i.AST.isObjects(c)) {
|
|
295
|
+
const m = c.propertySignatures.find(
|
|
296
296
|
(p) => p.name.toString() === "_tag"
|
|
297
297
|
);
|
|
298
298
|
let u = null;
|
|
299
|
-
const
|
|
300
|
-
|
|
299
|
+
const b = m ? _(m.type) : null;
|
|
300
|
+
b && i.AST.isLiteral(b) && (u = b.literal, a.push(u), m && i.AST.isUnion(m.type) && K() && u != null && !E.has(u) && (E.add(u), console.warn(
|
|
301
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
302
|
)));
|
|
303
303
|
const f = y({
|
|
304
|
-
propertySignatures:
|
|
304
|
+
propertySignatures: c.propertySignatures
|
|
305
305
|
});
|
|
306
|
-
u && (
|
|
306
|
+
u && (o[u] = P(f)), Object.assign(n, f);
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return a.length > 0 && (n._tag = {
|
|
309
309
|
type: "select",
|
|
310
|
-
members:
|
|
310
|
+
members: a,
|
|
311
311
|
required: !0
|
|
312
|
-
}), { meta: n, defaultValues: r, unionMeta:
|
|
312
|
+
}), { meta: n, defaultValues: r, unionMeta: o };
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
if (i.AST.isObjects(t)) {
|
|
316
316
|
const s = y({
|
|
317
317
|
propertySignatures: t.propertySignatures
|
|
318
318
|
});
|
|
319
|
-
if (Object.values(s).every((
|
|
320
|
-
return { meta: s, defaultValues: r, unionMeta:
|
|
321
|
-
const l = (
|
|
322
|
-
for (const
|
|
323
|
-
const u =
|
|
324
|
-
|
|
319
|
+
if (Object.values(s).every((a) => a && "type" in a))
|
|
320
|
+
return { meta: s, defaultValues: r, unionMeta: o };
|
|
321
|
+
const l = (a, c = "") => {
|
|
322
|
+
for (const m in a) {
|
|
323
|
+
const u = c ? `${c}.${m}` : m;
|
|
324
|
+
a[m] && typeof a[m] == "object" && "type" in a[m] ? n[u] = a[m] : a[m] && typeof a[m] == "object" && l(a[m], u);
|
|
325
325
|
}
|
|
326
326
|
};
|
|
327
327
|
l(s);
|
|
328
328
|
}
|
|
329
|
-
return { meta: n, defaultValues: r, unionMeta:
|
|
330
|
-
},
|
|
329
|
+
return { meta: n, defaultValues: r, unionMeta: o };
|
|
330
|
+
}, $ = (e) => i.AST.isDeclaration(e) && e.annotations?.typeConstructor?._tag === "effect/Redacted" && !e.encoding, ee = (e) => {
|
|
331
|
+
const t = e.ast, n = i.AST.isObjects(t) ? t : i.AST.isDeclaration(t) ? i.AST.toEncoded(t) : null;
|
|
332
|
+
if (!n || !("propertySignatures" in n)) return e;
|
|
333
|
+
let r = !1;
|
|
334
|
+
const o = {};
|
|
335
|
+
for (const s of n.propertySignatures)
|
|
336
|
+
if ($(s.type)) {
|
|
337
|
+
r = !0;
|
|
338
|
+
const l = i.make(s.type.typeParameters[0]);
|
|
339
|
+
o[s.name] = i.RedactedFromValue(l);
|
|
340
|
+
} else if (i.AST.isUnion(s.type)) {
|
|
341
|
+
const l = s.type.types, a = l.find($);
|
|
342
|
+
if (a) {
|
|
343
|
+
r = !0;
|
|
344
|
+
const c = i.make(a.typeParameters[0]), m = l.some(i.AST.isNull), u = l.some(i.AST.isUndefined), b = i.RedactedFromValue(c);
|
|
345
|
+
o[s.name] = m && u ? i.NullishOr(b) : m ? i.NullOr(b) : u ? i.UndefinedOr(b) : b;
|
|
346
|
+
} else
|
|
347
|
+
o[s.name] = i.make(s.type);
|
|
348
|
+
} else
|
|
349
|
+
o[s.name] = i.make(s.type);
|
|
350
|
+
return r ? i.Struct(o) : e;
|
|
351
|
+
}, te = (e) => e, ne = (e) => {
|
|
331
352
|
const { meta: t, unionMeta: n } = J(e);
|
|
332
353
|
return { schema: e, meta: t, unionMeta: n };
|
|
333
|
-
},
|
|
354
|
+
}, ie = (e, t) => {
|
|
334
355
|
t || (t = I().trans);
|
|
335
356
|
let n;
|
|
336
357
|
switch (e.type) {
|
|
@@ -412,7 +433,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
412
433
|
break;
|
|
413
434
|
}
|
|
414
435
|
return e.required || (n = i.NullishOr(n)), i.toStandardSchemaV1(n);
|
|
415
|
-
},
|
|
436
|
+
}, z = [
|
|
416
437
|
"button",
|
|
417
438
|
"checkbox",
|
|
418
439
|
"color",
|
|
@@ -428,61 +449,61 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
428
449
|
"text",
|
|
429
450
|
"time",
|
|
430
451
|
"url"
|
|
431
|
-
],
|
|
432
|
-
function
|
|
452
|
+
], se = (e) => z.includes(e) ? e : "text";
|
|
453
|
+
function H(e, t) {
|
|
433
454
|
const n = { ...e };
|
|
434
455
|
for (const r in t)
|
|
435
|
-
Array.isArray(t[r]) ? n[r] = t[r] : t[r] && G(t[r]) ? n[r] =
|
|
456
|
+
Array.isArray(t[r]) ? n[r] = t[r] : t[r] && G(t[r]) ? n[r] = H(n[r], t[r]) : n[r] = t[r];
|
|
436
457
|
return n;
|
|
437
458
|
}
|
|
438
459
|
function L(e) {
|
|
439
460
|
return e && "fields" in e && typeof e.fields == "object";
|
|
440
461
|
}
|
|
441
|
-
function
|
|
462
|
+
function Q(e) {
|
|
442
463
|
return e && "members" in e && Array.isArray(e.members);
|
|
443
464
|
}
|
|
444
465
|
const M = (e, t = {}) => {
|
|
445
|
-
const n = e.ast, r =
|
|
466
|
+
const n = e.ast, r = v(n);
|
|
446
467
|
if (r !== void 0)
|
|
447
468
|
return r;
|
|
448
469
|
if (g(e.ast) === "null")
|
|
449
470
|
return null;
|
|
450
471
|
if (g(e.ast) !== "undefined") {
|
|
451
472
|
if (L(e)) {
|
|
452
|
-
const
|
|
473
|
+
const o = {};
|
|
453
474
|
for (const [s, l] of Object.entries(e.fields)) {
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
456
|
-
|
|
475
|
+
const a = v(l?.ast);
|
|
476
|
+
if (a !== void 0) {
|
|
477
|
+
o[s] = a;
|
|
457
478
|
continue;
|
|
458
479
|
}
|
|
459
|
-
const
|
|
460
|
-
|
|
480
|
+
const c = M(l, t[s] || {});
|
|
481
|
+
c !== void 0 ? o[s] = c : g(l.ast) === "undefined" && (o[s] = void 0);
|
|
461
482
|
}
|
|
462
|
-
return { ...
|
|
483
|
+
return { ...o, ...t };
|
|
463
484
|
}
|
|
464
485
|
if (e?.from && L(e.from))
|
|
465
486
|
return M(e.from, t);
|
|
466
|
-
if (
|
|
467
|
-
const
|
|
468
|
-
const
|
|
469
|
-
(!s[
|
|
487
|
+
if (Q(e)) {
|
|
488
|
+
const o = e.members.reduce((s, l) => (L(l) && Object.entries(l.fields).forEach(([a, c]) => {
|
|
489
|
+
const m = v(c.ast), u = s[a] ? v(s[a].ast) : void 0;
|
|
490
|
+
(!s[a] || m !== void 0 && u === void 0) && (s[a] = c);
|
|
470
491
|
}), s), {});
|
|
471
|
-
return Object.keys(
|
|
492
|
+
return Object.keys(o).length === 0 ? Object.keys(t).length > 0 ? t : void 0 : Object.entries(o).reduce((s, [l, a]) => (s[l] = M(a, t[l] || {}), s), t);
|
|
472
493
|
}
|
|
473
494
|
if (Object.keys(t).length === 0) {
|
|
474
495
|
if (i.AST.isObjects(n)) {
|
|
475
|
-
const
|
|
496
|
+
const o = { ...t };
|
|
476
497
|
for (const s of n.propertySignatures) {
|
|
477
|
-
const l = s.name.toString(),
|
|
478
|
-
if (
|
|
479
|
-
|
|
498
|
+
const l = s.name.toString(), a = s.type, c = v(a);
|
|
499
|
+
if (c !== void 0) {
|
|
500
|
+
o[l] = c;
|
|
480
501
|
continue;
|
|
481
502
|
}
|
|
482
|
-
const
|
|
483
|
-
u !== void 0 ?
|
|
503
|
+
const m = i.make(a), u = M(m, t[l] || {});
|
|
504
|
+
u !== void 0 ? o[l] = u : g(a) === "undefined" && (o[l] = void 0);
|
|
484
505
|
}
|
|
485
|
-
return
|
|
506
|
+
return o;
|
|
486
507
|
}
|
|
487
508
|
if (i.AST.isString(n))
|
|
488
509
|
return "";
|
|
@@ -493,11 +514,12 @@ const M = (e, t = {}) => {
|
|
|
493
514
|
};
|
|
494
515
|
export {
|
|
495
516
|
y as createMeta,
|
|
496
|
-
|
|
517
|
+
H as deepMerge,
|
|
497
518
|
M as defaultsValueFromSchema,
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
g as isNullableOrUndefined
|
|
519
|
+
te as duplicateSchema,
|
|
520
|
+
ie as generateInputStandardSchemaFromFieldMeta,
|
|
521
|
+
ne as generateMetaFromSchema,
|
|
522
|
+
se as getInputType,
|
|
523
|
+
g as isNullableOrUndefined,
|
|
524
|
+
ee as toFormSchema
|
|
503
525
|
};
|
|
@@ -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,22 +1,22 @@
|
|
|
1
1
|
import { default as t } from "./vue-components.es4.js";
|
|
2
|
-
import { default 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
|
|
2
|
+
import { default as r } from "./vue-components.es5.js";
|
|
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, toFormSchema as x } from "./vue-components.es12.js";
|
|
4
|
+
import { useOmegaForm as c } from "./vue-components.es10.js";
|
|
5
5
|
import { default as O } from "./vue-components.es6.js";
|
|
6
6
|
import { default as I } from "./vue-components.es7.js";
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { useOnClose as
|
|
10
|
-
import { createUseFormWithCustomInput as
|
|
7
|
+
import { default as C } from "./vue-components.es8.js";
|
|
8
|
+
import { default as U } from "./vue-components.es9.js";
|
|
9
|
+
import { useOnClose as y, usePreventClose as V } from "./vue-components.es11.js";
|
|
10
|
+
import { createUseFormWithCustomInput as v } from "./vue-components.es13.js";
|
|
11
11
|
export {
|
|
12
12
|
t as CommandButton,
|
|
13
|
-
|
|
13
|
+
r as Dialog,
|
|
14
14
|
O as OmegaInput,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
C as OmegaTaggedUnion,
|
|
16
|
+
U as OmegaTaggedUnionInternal,
|
|
17
17
|
I as OmegaVuetifyInput,
|
|
18
18
|
u as createMeta,
|
|
19
|
-
|
|
19
|
+
v as createUseFormWithCustomInput,
|
|
20
20
|
n as deepMerge,
|
|
21
21
|
f as defaultsValueFromSchema,
|
|
22
22
|
p as duplicateSchema,
|
|
@@ -24,7 +24,8 @@ export {
|
|
|
24
24
|
l as generateMetaFromSchema,
|
|
25
25
|
s as getInputType,
|
|
26
26
|
g as isNullableOrUndefined,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
y as
|
|
27
|
+
x as toFormSchema,
|
|
28
|
+
c as useOmegaForm,
|
|
29
|
+
y as useOnClose,
|
|
30
|
+
V as usePreventClose
|
|
30
31
|
};
|
|
@@ -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.es36.js";
|
|
3
3
|
|
|
4
|
-
import o from "./vue-components.
|
|
4
|
+
import o from "./vue-components.es38.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.es39.js";
|
|
3
3
|
|
|
4
|
-
import m from "./vue-components.
|
|
4
|
+
import m from "./vue-components.es38.js";
|
|
5
5
|
const a = /* @__PURE__ */ m(o, [["__scopeId", "data-v-8c9cb27c"]]);
|
|
6
6
|
export {
|
|
7
7
|
a as default
|