@effect-app/vue-components 4.0.0-beta.31 → 4.0.0-beta.33
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as i, Effect as P, Option as
|
|
1
|
+
import { S as i, Effect as P, Option as N } 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
4
|
const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV !== "production", S = (e) => {
|
|
@@ -6,7 +6,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
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), F = (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,14 +15,14 @@ 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
|
+
}, _ = (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
21
|
}, D = (e) => {
|
|
22
22
|
if (e?.transformation?.decode?.run)
|
|
23
23
|
try {
|
|
24
|
-
const t = P.runSync(e.transformation.decode.run(
|
|
25
|
-
return
|
|
24
|
+
const t = P.runSync(e.transformation.decode.run(N.none()));
|
|
25
|
+
return N.isSome(t) ? t.value : void 0;
|
|
26
26
|
} catch {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
@@ -94,7 +94,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
94
94
|
e._isNullableDiscriminatedUnion && s.name.toString() === "_tag" || e.required === !1 ? m = !1 : m = !o;
|
|
95
95
|
const c = S(s.type);
|
|
96
96
|
if (i.AST.isUnion(s.type)) {
|
|
97
|
-
const u =
|
|
97
|
+
const u = _(s.type.types);
|
|
98
98
|
if (u.some(i.AST.isObjects)) {
|
|
99
99
|
if (!o) {
|
|
100
100
|
const f = y({
|
|
@@ -147,15 +147,15 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
147
147
|
const x = S(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 w = `${T}.${O.name.toString()}`, k = y({
|
|
151
|
+
parent: w,
|
|
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 && (a[
|
|
158
|
+
k && typeof k == "object" && "type" in k && (a[w] = k);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -255,7 +255,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
255
255
|
parent: t,
|
|
256
256
|
meta: e
|
|
257
257
|
});
|
|
258
|
-
const c = l.map(
|
|
258
|
+
const c = l.map(F);
|
|
259
259
|
return c.every((u) => j(u) || i.AST.isLiteral(u)) ? {
|
|
260
260
|
...e,
|
|
261
261
|
type: "select",
|
|
@@ -287,7 +287,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
287
287
|
}, J = (e) => {
|
|
288
288
|
const t = S(e.ast), n = {}, r = {}, a = {};
|
|
289
289
|
if (i.AST.isUnion(t)) {
|
|
290
|
-
const s =
|
|
290
|
+
const s = _(t.types);
|
|
291
291
|
if (s.every(i.AST.isObjects) && s.length > 0) {
|
|
292
292
|
const o = [];
|
|
293
293
|
for (const m of s)
|
|
@@ -296,7 +296,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
296
296
|
(p) => p.name.toString() === "_tag"
|
|
297
297
|
);
|
|
298
298
|
let u = null;
|
|
299
|
-
const v = c ?
|
|
299
|
+
const v = c ? F(c.type) : null;
|
|
300
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
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
|
)));
|
|
@@ -356,7 +356,7 @@ const E = /* @__PURE__ */ new Set(), K = () => globalThis.process?.env?.NODE_ENV
|
|
|
356
356
|
message: t("validation.empty")
|
|
357
357
|
}).check(i.isInt({
|
|
358
358
|
message: t("validation.integer.expected", { actualValue: "NaN" })
|
|
359
|
-
})) : (n = i.
|
|
359
|
+
})) : (n = i.Finite.annotate({
|
|
360
360
|
message: t("validation.number.expected", { actualValue: "NaN" })
|
|
361
361
|
}), e.required && (n = n.annotate({
|
|
362
362
|
message: t("validation.empty")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.33",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.37",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"highlight.js": "^11.11.1",
|
|
58
58
|
"mitt": "^3.0.1",
|
|
59
59
|
"vue3-highlightjs": "^1.0.5",
|
|
60
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
61
|
-
"effect-app": "4.0.0-beta.
|
|
60
|
+
"@effect-app/vue": "4.0.0-beta.33",
|
|
61
|
+
"effect-app": "4.0.0-beta.33"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"check": "vue-tsc",
|
|
@@ -1006,7 +1006,7 @@ export const generateInputStandardSchemaFromFieldMeta = (
|
|
|
1006
1006
|
message: trans("validation.integer.expected", { actualValue: "NaN" })
|
|
1007
1007
|
}))
|
|
1008
1008
|
} else {
|
|
1009
|
-
schema = S.
|
|
1009
|
+
schema = S.Finite.annotate({
|
|
1010
1010
|
message: trans("validation.number.expected", { actualValue: "NaN" })
|
|
1011
1011
|
})
|
|
1012
1012
|
|