@effect-app/vue-components 3.0.7 → 3.2.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/CommandButton.vue.d.ts +12 -8
- package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +8 -4
- package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +9 -5
- package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +4 -4
- package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +8 -4
- package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +2 -1
- package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +8 -4
- package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +9 -5
- package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +9 -5
- package/dist/types/components/OmegaForm/OmegaTaggedUnion.vue.d.ts +9 -9
- package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +9 -5
- package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +9 -5
- package/dist/vue-components.es10.js +7 -7
- package/dist/vue-components.es11.js +3 -3
- package/dist/vue-components.es12.js +120 -144
- package/dist/vue-components.es16.js +11 -4
- package/dist/vue-components.es17.js +4 -10
- package/dist/vue-components.es18.js +10 -55
- package/dist/vue-components.es19.js +50 -63
- package/dist/vue-components.es20.js +68 -6
- package/dist/vue-components.es21.js +5 -5
- package/dist/vue-components.es22.js +6 -3
- package/dist/vue-components.es23.js +3 -3
- package/dist/vue-components.es24.js +3 -2
- package/dist/vue-components.es25.js +1 -1
- package/dist/vue-components.es26.js +1 -1
- package/dist/vue-components.es27.js +1 -1
- package/dist/vue-components.es28.js +2 -17
- package/dist/vue-components.es29.js +16 -10
- package/dist/vue-components.es3.js +1 -1
- package/dist/vue-components.es30.js +191 -41
- package/dist/vue-components.es32.js +42 -2
- package/dist/vue-components.es33.js +2 -111
- package/dist/vue-components.es34.js +4 -0
- package/dist/vue-components.es35.js +111 -7
- package/dist/vue-components.es37.js +9 -0
- package/dist/vue-components.es38.js +27 -187
- 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.es5.js +1 -1
- 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.es57.js +1 -1
- package/dist/vue-components.es58.js +3 -3
- package/dist/vue-components.es59.js +1 -1
- package/dist/vue-components.es7.js +3 -3
- package/package.json +24 -24
- package/src/components/OmegaForm/OmegaFormStuff.ts +23 -59
- package/src/components/OmegaForm/OmegaInputVuetify.vue +2 -2
- package/src/components/OmegaForm/OmegaInternalInput.vue +2 -2
- package/dist/vue-components.es31.js +0 -4
- package/dist/vue-components.es36.js +0 -34
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as i, Option as
|
|
2
|
-
import { getMetadataFromSchema as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { isObject as $ } from "./vue-components.
|
|
1
|
+
import { S as i, Option as M } from "effect-app";
|
|
2
|
+
import { getMetadataFromSchema as V } from "@effect-app/vue/form";
|
|
3
|
+
import { useIntl as E, getTransformationFrom as _ } from "./vue-components.es3.js";
|
|
4
|
+
import { isObject as $ } from "./vue-components.es17.js";
|
|
5
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)
|
|
@@ -13,7 +13,7 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
13
13
|
return n;
|
|
14
14
|
}, y = ({ meta: e = {}, parent: n = "", property: t, propertySignatures: o }, s = {}) => {
|
|
15
15
|
if (t && t._tag === "Transformation") {
|
|
16
|
-
const r = i.AST.getAnnotation(t, i.AST.TitleAnnotationId).pipe(
|
|
16
|
+
const r = i.AST.getAnnotation(t, i.AST.TitleAnnotationId).pipe(M.getOrElse(() => ""));
|
|
17
17
|
if (r !== "Int" && r !== "int")
|
|
18
18
|
return y({
|
|
19
19
|
parent: n,
|
|
@@ -28,69 +28,69 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
28
28
|
});
|
|
29
29
|
if (o) {
|
|
30
30
|
for (const r of o) {
|
|
31
|
-
const
|
|
32
|
-
let
|
|
33
|
-
e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ?
|
|
34
|
-
const
|
|
31
|
+
const l = n ? `${n}.${r.name.toString()}` : r.name.toString(), a = c(r.type);
|
|
32
|
+
let f;
|
|
33
|
+
e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ? f = !1 : f = !a;
|
|
34
|
+
const p = r.type;
|
|
35
35
|
if (i.AST.isUnion(r.type)) {
|
|
36
36
|
const S = L(r.type.types).filter(
|
|
37
|
-
(
|
|
37
|
+
(u) => u._tag !== "UndefinedKeyword" && u !== i.Null.ast
|
|
38
38
|
).map(_);
|
|
39
39
|
if (S.some(
|
|
40
|
-
(
|
|
40
|
+
(u) => "propertySignatures" in u
|
|
41
41
|
)) {
|
|
42
42
|
if (!a) {
|
|
43
|
-
const
|
|
44
|
-
parent:
|
|
43
|
+
const u = y({
|
|
44
|
+
parent: l,
|
|
45
45
|
property: r.type,
|
|
46
|
-
meta: { required:
|
|
46
|
+
meta: { required: f, nullableOrUndefined: a }
|
|
47
47
|
});
|
|
48
|
-
s[
|
|
48
|
+
s[l] = u;
|
|
49
49
|
}
|
|
50
|
-
for (const
|
|
51
|
-
if ("propertySignatures" in
|
|
52
|
-
const
|
|
50
|
+
for (const u of S)
|
|
51
|
+
if ("propertySignatures" in u) {
|
|
52
|
+
const m = a && S.length > 1;
|
|
53
53
|
Object.assign(
|
|
54
54
|
s,
|
|
55
55
|
y({
|
|
56
|
-
parent:
|
|
57
|
-
propertySignatures:
|
|
58
|
-
meta:
|
|
56
|
+
parent: l,
|
|
57
|
+
propertySignatures: u.propertySignatures,
|
|
58
|
+
meta: m ? { _isNullableDiscriminatedUnion: !0 } : {}
|
|
59
59
|
})
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
} else {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
if (s[
|
|
63
|
+
const u = S.filter(i.AST.isTupleType);
|
|
64
|
+
if (u.length > 0) {
|
|
65
|
+
const m = u[0];
|
|
66
|
+
if (s[l] = {
|
|
67
67
|
type: "multiple",
|
|
68
|
-
members:
|
|
69
|
-
rest:
|
|
70
|
-
required:
|
|
68
|
+
members: m.elements,
|
|
69
|
+
rest: m.rest,
|
|
70
|
+
required: f,
|
|
71
71
|
nullableOrUndefined: a
|
|
72
|
-
},
|
|
73
|
-
const T =
|
|
72
|
+
}, m.rest && m.rest.length > 0) {
|
|
73
|
+
const T = m.rest[0];
|
|
74
74
|
if (T.type._tag === "TypeLiteral" && "propertySignatures" in T.type)
|
|
75
75
|
for (const g of T.type.propertySignatures) {
|
|
76
|
-
const
|
|
77
|
-
parent:
|
|
76
|
+
const h = `${l}.${g.name.toString()}`, v = y({
|
|
77
|
+
parent: h,
|
|
78
78
|
property: g.type,
|
|
79
79
|
meta: {
|
|
80
80
|
required: !c(g.type),
|
|
81
81
|
nullableOrUndefined: c(g.type)
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
if (v && typeof v == "object" && "type" in v && (s[
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
for (const
|
|
88
|
-
const N = `${
|
|
84
|
+
if (v && typeof v == "object" && "type" in v && (s[h] = v, v.type === "multiple" && i.AST.isTupleType(g.type) && g.type.rest && g.type.rest.length > 0)) {
|
|
85
|
+
const w = g.type.rest[0];
|
|
86
|
+
if (w.type._tag === "TypeLiteral" && "propertySignatures" in w.type)
|
|
87
|
+
for (const x of w.type.propertySignatures) {
|
|
88
|
+
const N = `${h}.${x.name.toString()}`, O = y({
|
|
89
89
|
parent: N,
|
|
90
|
-
property:
|
|
90
|
+
property: x.type,
|
|
91
91
|
meta: {
|
|
92
|
-
required: !c(
|
|
93
|
-
nullableOrUndefined: c(
|
|
92
|
+
required: !c(x.type),
|
|
93
|
+
nullableOrUndefined: c(x.type)
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
O && typeof O == "object" && "type" in O && (s[N] = O);
|
|
@@ -99,85 +99,85 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
} else {
|
|
102
|
-
const
|
|
103
|
-
parent:
|
|
102
|
+
const m = y({
|
|
103
|
+
parent: l,
|
|
104
104
|
property: r.type,
|
|
105
|
-
meta: { required:
|
|
105
|
+
meta: { required: f, nullableOrUndefined: a }
|
|
106
106
|
});
|
|
107
|
-
s[
|
|
107
|
+
s[l] = m;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
} else {
|
|
111
|
-
const d = _(
|
|
111
|
+
const d = _(p);
|
|
112
112
|
if ("propertySignatures" in d)
|
|
113
113
|
Object.assign(
|
|
114
114
|
s,
|
|
115
115
|
y({
|
|
116
|
-
parent:
|
|
116
|
+
parent: l,
|
|
117
117
|
propertySignatures: d.propertySignatures,
|
|
118
|
-
meta: { required:
|
|
118
|
+
meta: { required: f, nullableOrUndefined: a }
|
|
119
119
|
})
|
|
120
120
|
);
|
|
121
121
|
else if (i.AST.isTupleType(r.type))
|
|
122
122
|
if (r.type.rest.length > 0 && r.type.rest[0].type._tag === "TypeLiteral" && "propertySignatures" in r.type.rest[0].type) {
|
|
123
123
|
const b = r.type.rest[0].type;
|
|
124
124
|
if (b._tag === "TypeLiteral" && "propertySignatures" in b)
|
|
125
|
-
for (const
|
|
126
|
-
const
|
|
127
|
-
if (i.AST.isTupleType(
|
|
128
|
-
const T =
|
|
125
|
+
for (const u of b.propertySignatures) {
|
|
126
|
+
const m = `${l}.${u.name.toString()}`;
|
|
127
|
+
if (i.AST.isTupleType(u.type) && u.type.rest.length > 0) {
|
|
128
|
+
const T = u.type.rest[0].type;
|
|
129
129
|
if (T._tag === "TypeLiteral" && "propertySignatures" in T)
|
|
130
130
|
for (const g of T.propertySignatures) {
|
|
131
|
-
const
|
|
132
|
-
parent:
|
|
131
|
+
const h = `${m}.${g.name.toString()}`, v = y({
|
|
132
|
+
parent: h,
|
|
133
133
|
property: g.type,
|
|
134
134
|
meta: {
|
|
135
135
|
required: !c(g.type),
|
|
136
136
|
nullableOrUndefined: c(g.type)
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
s[
|
|
139
|
+
s[h] = v;
|
|
140
140
|
}
|
|
141
141
|
else
|
|
142
|
-
s[
|
|
142
|
+
s[m] = {
|
|
143
143
|
type: "multiple",
|
|
144
|
-
members:
|
|
145
|
-
rest:
|
|
146
|
-
required: !c(
|
|
147
|
-
nullableOrUndefined: c(
|
|
144
|
+
members: u.type.elements,
|
|
145
|
+
rest: u.type.rest,
|
|
146
|
+
required: !c(u.type),
|
|
147
|
+
nullableOrUndefined: c(u.type)
|
|
148
148
|
};
|
|
149
149
|
} else {
|
|
150
150
|
const T = y({
|
|
151
|
-
parent:
|
|
152
|
-
property:
|
|
151
|
+
parent: m,
|
|
152
|
+
property: u.type,
|
|
153
153
|
meta: {
|
|
154
|
-
required: !c(
|
|
155
|
-
nullableOrUndefined: c(
|
|
154
|
+
required: !c(u.type),
|
|
155
|
+
nullableOrUndefined: c(u.type)
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
-
s[
|
|
158
|
+
s[m] = T;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
} else
|
|
162
|
-
s[
|
|
162
|
+
s[l] = {
|
|
163
163
|
type: "multiple",
|
|
164
164
|
members: r.type.elements,
|
|
165
165
|
rest: r.type.rest,
|
|
166
|
-
required:
|
|
166
|
+
required: f,
|
|
167
167
|
nullableOrUndefined: a
|
|
168
168
|
};
|
|
169
169
|
else {
|
|
170
170
|
const S = y({
|
|
171
|
-
parent:
|
|
171
|
+
parent: l,
|
|
172
172
|
property: r.type,
|
|
173
173
|
meta: {
|
|
174
174
|
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
175
175
|
// TODO: handle this better via the createMeta minLength parsing
|
|
176
|
-
required:
|
|
176
|
+
required: f && (r.type._tag !== "StringKeyword" || V(r.type).minLength),
|
|
177
177
|
nullableOrUndefined: a
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
s[
|
|
180
|
+
s[l] = S;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -186,23 +186,23 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
186
186
|
if (t) {
|
|
187
187
|
const r = j(t);
|
|
188
188
|
if (Object.hasOwnProperty.call(e, "required") || (e.required = !r), i.AST.isUnion(t)) {
|
|
189
|
-
const
|
|
189
|
+
const f = L(t.types), p = f.find(
|
|
190
190
|
(d) => d._tag !== "UndefinedKeyword" && d !== i.Null.ast
|
|
191
191
|
);
|
|
192
|
-
return "propertySignatures" in
|
|
193
|
-
propertySignatures:
|
|
192
|
+
return "propertySignatures" in p ? y({
|
|
193
|
+
propertySignatures: p.propertySignatures,
|
|
194
194
|
parent: n,
|
|
195
195
|
meta: e
|
|
196
|
-
}) :
|
|
196
|
+
}) : f.every(i.AST.isLiteral) ? {
|
|
197
197
|
...e,
|
|
198
198
|
type: "select",
|
|
199
|
-
members:
|
|
199
|
+
members: f.map((d) => d.literal)
|
|
200
200
|
} : {
|
|
201
201
|
...e,
|
|
202
202
|
...y({
|
|
203
203
|
parent: n,
|
|
204
204
|
meta: e,
|
|
205
|
-
property:
|
|
205
|
+
property: p
|
|
206
206
|
})
|
|
207
207
|
};
|
|
208
208
|
}
|
|
@@ -216,15 +216,15 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
216
216
|
e = { ...i.AST.getAnnotation(
|
|
217
217
|
t,
|
|
218
218
|
i.AST.JSONSchemaAnnotationId
|
|
219
|
-
).pipe(
|
|
219
|
+
).pipe(M.getOrElse(() => ({}))), ...e };
|
|
220
220
|
const a = i.AST.getAnnotation(
|
|
221
221
|
t,
|
|
222
222
|
i.AST.TitleAnnotationId
|
|
223
223
|
).pipe(
|
|
224
|
-
|
|
224
|
+
M.getOrElse(() => "unknown")
|
|
225
225
|
);
|
|
226
226
|
if (a === "Int" || a === "int")
|
|
227
|
-
e.type = "int";
|
|
227
|
+
e.type = "number", e.refinement = "int";
|
|
228
228
|
else {
|
|
229
229
|
if ("from" in t)
|
|
230
230
|
return y({
|
|
@@ -244,29 +244,29 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
244
244
|
s && typeof s == "object" && "type" in s ? t[r] = s : s && typeof s == "object" && Object.assign(t, q(s, r));
|
|
245
245
|
}
|
|
246
246
|
return t;
|
|
247
|
-
},
|
|
247
|
+
}, k = (e) => {
|
|
248
248
|
const n = e.ast, t = {}, o = {}, s = {};
|
|
249
249
|
if (n._tag === "Transformation" || n._tag === "Refinement")
|
|
250
|
-
return
|
|
250
|
+
return k(i.make(n.from));
|
|
251
251
|
if (n._tag === "Union") {
|
|
252
|
-
const a = (n.types || []).filter((
|
|
253
|
-
if (a.every((
|
|
254
|
-
const
|
|
252
|
+
const a = (n.types || []).filter((p) => p._tag !== "UndefinedKeyword" && p !== i.Null.ast).map(_);
|
|
253
|
+
if (a.every((p) => p._tag === "TypeLiteral" && "propertySignatures" in p) && a.length > 0) {
|
|
254
|
+
const p = [];
|
|
255
255
|
for (const d of a)
|
|
256
256
|
if ("propertySignatures" in d) {
|
|
257
257
|
const S = d.propertySignatures.find(
|
|
258
|
-
(
|
|
258
|
+
(m) => m.name.toString() === "_tag"
|
|
259
259
|
);
|
|
260
260
|
let b = null;
|
|
261
|
-
S && i.AST.isLiteral(S.type) && (b = S.type.literal,
|
|
262
|
-
const
|
|
261
|
+
S && i.AST.isLiteral(S.type) && (b = S.type.literal, p.push(b));
|
|
262
|
+
const u = y({
|
|
263
263
|
propertySignatures: d.propertySignatures
|
|
264
264
|
});
|
|
265
|
-
b && (s[b] = q(
|
|
265
|
+
b && (s[b] = q(u)), Object.assign(t, u);
|
|
266
266
|
}
|
|
267
|
-
return
|
|
267
|
+
return p.length > 0 && (t._tag = {
|
|
268
268
|
type: "select",
|
|
269
|
-
members:
|
|
269
|
+
members: p,
|
|
270
270
|
required: !0
|
|
271
271
|
}), { meta: t, defaultValues: o, unionMeta: s };
|
|
272
272
|
}
|
|
@@ -277,20 +277,20 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
277
277
|
});
|
|
278
278
|
if (Object.values(r).every((a) => a && "type" in a))
|
|
279
279
|
return { meta: r, defaultValues: o, unionMeta: s };
|
|
280
|
-
const
|
|
281
|
-
for (const
|
|
282
|
-
const d =
|
|
283
|
-
a[
|
|
280
|
+
const l = (a, f = "") => {
|
|
281
|
+
for (const p in a) {
|
|
282
|
+
const d = f ? `${f}.${p}` : p;
|
|
283
|
+
a[p] && typeof a[p] == "object" && "type" in a[p] ? t[d] = a[p] : a[p] && typeof a[p] == "object" && l(a[p], d);
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
|
-
|
|
286
|
+
l(r);
|
|
287
287
|
}
|
|
288
288
|
return { meta: t, defaultValues: o, unionMeta: s };
|
|
289
289
|
}, B = (e) => i.extend(e, i.Struct({})), z = (e) => {
|
|
290
|
-
const { meta: n, unionMeta: t } =
|
|
290
|
+
const { meta: n, unionMeta: t } = k(e);
|
|
291
291
|
return { schema: e, meta: n, unionMeta: t };
|
|
292
292
|
}, C = (e, n) => {
|
|
293
|
-
n || (n =
|
|
293
|
+
n || (n = E().trans);
|
|
294
294
|
let t;
|
|
295
295
|
switch (e.type) {
|
|
296
296
|
case "string":
|
|
@@ -315,40 +315,16 @@ const j = (e) => i.AST.isUnion(e) && e.types.find((n) => n._tag === "UndefinedKe
|
|
|
315
315
|
})
|
|
316
316
|
}));
|
|
317
317
|
break;
|
|
318
|
-
case "
|
|
319
|
-
t = i.Number.annotations({
|
|
318
|
+
case "number":
|
|
319
|
+
e.refinement === "int" ? t = i.Number.annotations({
|
|
320
320
|
message: () => n("validation.empty")
|
|
321
321
|
}).pipe(
|
|
322
322
|
i.int({ message: (s) => n("validation.integer.expected", { actualValue: String(s.actual) }) })
|
|
323
|
-
)
|
|
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({
|
|
323
|
+
) : (t = i.Number.annotations({
|
|
348
324
|
message: () => n("validation.number.expected", { actualValue: "NaN" })
|
|
349
325
|
}), e.required && t.annotations({
|
|
350
326
|
message: () => n("validation.empty")
|
|
351
|
-
}), typeof e.minimum == "number" && (t = t.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
|
|
327
|
+
})), typeof e.minimum == "number" && (t = t.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
|
|
352
328
|
message: () => n(e.minimum === 0 ? "validation.number.positive" : "validation.number.min", {
|
|
353
329
|
minimum: e.minimum,
|
|
354
330
|
isExclusive: !0
|
|
@@ -438,7 +414,7 @@ function U(e) {
|
|
|
438
414
|
function F(e) {
|
|
439
415
|
return e && "members" in e && Array.isArray(e.members);
|
|
440
416
|
}
|
|
441
|
-
const
|
|
417
|
+
const A = (e, n = {}) => {
|
|
442
418
|
const t = e.ast;
|
|
443
419
|
if (t?.defaultValue)
|
|
444
420
|
return t.defaultValue();
|
|
@@ -448,49 +424,49 @@ const h = (e, n = {}) => {
|
|
|
448
424
|
if (U(e)) {
|
|
449
425
|
const o = {};
|
|
450
426
|
for (const [s, r] of Object.entries(e.fields)) {
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
427
|
+
const l = r?.ast;
|
|
428
|
+
if (l?.defaultValue)
|
|
453
429
|
try {
|
|
454
|
-
o[s] =
|
|
430
|
+
o[s] = l.defaultValue();
|
|
455
431
|
continue;
|
|
456
432
|
} catch {
|
|
457
433
|
}
|
|
458
|
-
const a =
|
|
434
|
+
const a = A(r, n[s] || {});
|
|
459
435
|
a !== void 0 && (o[s] = a);
|
|
460
436
|
}
|
|
461
437
|
return { ...o, ...n };
|
|
462
438
|
}
|
|
463
439
|
if (e?.from && U(e.from))
|
|
464
|
-
return
|
|
440
|
+
return A(e.from, n);
|
|
465
441
|
if (F(e)) {
|
|
466
|
-
const o = e.members.reduce((s, r) => (U(r) && Object.entries(r.fields).forEach(([
|
|
467
|
-
const
|
|
468
|
-
(!s[
|
|
442
|
+
const o = e.members.reduce((s, r) => (U(r) && Object.entries(r.fields).forEach(([l, a]) => {
|
|
443
|
+
const f = a.ast, p = s[l]?.ast;
|
|
444
|
+
(!s[l] || f?.defaultValue && !p?.defaultValue) && (s[l] = a);
|
|
469
445
|
}), s), {});
|
|
470
|
-
return Object.entries(o).reduce((s, [r,
|
|
446
|
+
return Object.entries(o).reduce((s, [r, l]) => (s[r] = A(l, n[r] || {}), s), n);
|
|
471
447
|
}
|
|
472
448
|
if (Object.keys(n).length === 0)
|
|
473
449
|
switch (e.ast._tag) {
|
|
474
450
|
case "Refinement":
|
|
475
|
-
return
|
|
451
|
+
return A(i.make(e.ast.from), n);
|
|
476
452
|
case "Transformation": {
|
|
477
453
|
const o = i.make(e.ast.from);
|
|
478
|
-
return
|
|
454
|
+
return A(o, n);
|
|
479
455
|
}
|
|
480
456
|
case "TypeLiteral": {
|
|
481
457
|
const o = { ...n };
|
|
482
458
|
for (const s of t.propertySignatures) {
|
|
483
|
-
const r = s.name.toString(),
|
|
484
|
-
if (
|
|
485
|
-
o[r] =
|
|
459
|
+
const r = s.name.toString(), l = s.type;
|
|
460
|
+
if (l._tag === "Transformation" && l.defaultValue) {
|
|
461
|
+
o[r] = l.defaultValue();
|
|
486
462
|
continue;
|
|
487
463
|
}
|
|
488
|
-
if (
|
|
489
|
-
o[r] =
|
|
464
|
+
if (l.defaultValue) {
|
|
465
|
+
o[r] = l.defaultValue();
|
|
490
466
|
continue;
|
|
491
467
|
}
|
|
492
|
-
const a = i.make(
|
|
493
|
-
|
|
468
|
+
const a = i.make(l), f = A(a, n[r] || {});
|
|
469
|
+
f !== void 0 && (o[r] = f);
|
|
494
470
|
}
|
|
495
471
|
return o;
|
|
496
472
|
}
|
|
@@ -504,7 +480,7 @@ const h = (e, n = {}) => {
|
|
|
504
480
|
export {
|
|
505
481
|
y as createMeta,
|
|
506
482
|
I as deepMerge,
|
|
507
|
-
|
|
483
|
+
A as defaultsValueFromSchema,
|
|
508
484
|
B as duplicateSchema,
|
|
509
485
|
C as generateInputStandardSchemaFromFieldMeta,
|
|
510
486
|
z as generateMetaFromSchema,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import "vue";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { onMounted as e, onUnmounted as u } from "vue";
|
|
2
|
+
function p(t) {
|
|
3
|
+
let n;
|
|
4
|
+
e(() => {
|
|
5
|
+
const o = t();
|
|
6
|
+
o && (n = o);
|
|
7
|
+
}), u(() => {
|
|
8
|
+
n && n();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
4
11
|
export {
|
|
5
|
-
|
|
12
|
+
p as onMountedWithCleanup
|
|
6
13
|
};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
|
|
5
|
-
const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
|
|
6
|
-
c.isSuccess(r) ? o(r.value) : s(u.makeFiberFailure(r.cause));
|
|
7
|
-
}));
|
|
1
|
+
import "vue";
|
|
2
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
3
|
+
const t = Object.prototype.toString, c = (o) => t.call(o) === "[object Object]";
|
|
8
4
|
export {
|
|
9
|
-
|
|
10
|
-
i as cloneTrait,
|
|
11
|
-
p as runtimeFiberAsPromise
|
|
5
|
+
c as isObject
|
|
12
6
|
};
|
|
@@ -1,57 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
name: {},
|
|
9
|
-
defaultItems: {},
|
|
10
|
-
items: {}
|
|
11
|
-
},
|
|
12
|
-
setup(n) {
|
|
13
|
-
const a = n, y = a.form.useStore((e) => e.values), i = f(() => {
|
|
14
|
-
const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
|
|
15
|
-
try {
|
|
16
|
-
return e.split(".").reduce((r, t) => r && r[t], y.value);
|
|
17
|
-
} catch (r) {
|
|
18
|
-
return console.error(r), [];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
M(async () => {
|
|
22
|
-
a.defaultItems && !i.value && a.form.setFieldValue(a.name, a.defaultItems);
|
|
23
|
-
});
|
|
24
|
-
const $ = f(() => (r) => {
|
|
25
|
-
const t = r.replace(/\[\d+\]/g, "");
|
|
26
|
-
return a.form.meta[t];
|
|
27
|
-
});
|
|
28
|
-
return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
|
|
29
|
-
default: g(({ field: t, state: d }) => [
|
|
30
|
-
o(e.$slots, "pre-array", l(u({ field: t, state: d }))),
|
|
31
|
-
(s(!0), k(A, null, C(i.value, (B, m) => (s(), c(p(n.form.Field), {
|
|
32
|
-
key: `${n.name}[${Number(m)}]`,
|
|
33
|
-
name: (
|
|
34
|
-
// eslint-disable-next-line
|
|
35
|
-
`${n.name}[${Number(m)}]`
|
|
36
|
-
)
|
|
37
|
-
}, {
|
|
38
|
-
default: g(({ field: v, state: h }) => [
|
|
39
|
-
o(e.$slots, "default", b({ ref_for: !0 }, {
|
|
40
|
-
subField: v,
|
|
41
|
-
subState: h,
|
|
42
|
-
index: Number(m),
|
|
43
|
-
field: t
|
|
44
|
-
}))
|
|
45
|
-
]),
|
|
46
|
-
_: 2
|
|
47
|
-
}, 1032, ["name"]))), 128)),
|
|
48
|
-
o(e.$slots, "post-array", l(u({ field: t, state: d }))),
|
|
49
|
-
o(e.$slots, "field", l(u({ field: t })))
|
|
50
|
-
]),
|
|
51
|
-
_: 3
|
|
52
|
-
}, 8, ["name"]));
|
|
53
|
-
}
|
|
54
|
-
});
|
|
1
|
+
import { Exit as c, Runtime as u } from "effect";
|
|
2
|
+
import { dual as n, isFunction as m } from "./vue-components.es32.js";
|
|
3
|
+
const i = /* @__PURE__ */ Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
|
|
4
|
+
n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
|
|
5
|
+
const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
|
|
6
|
+
c.isSuccess(r) ? o(r.value) : s(u.makeFiberFailure(r.cause));
|
|
7
|
+
}));
|
|
55
8
|
export {
|
|
56
|
-
|
|
9
|
+
a as clone,
|
|
10
|
+
i as cloneTrait,
|
|
11
|
+
p as runtimeFiberAsPromise
|
|
57
12
|
};
|