@effect-app/vue-components 2.6.2 → 2.7.1
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/InputProps.d.ts +10 -4
- package/dist/types/components/OmegaForm/OmegaTaggedUnion.vue.d.ts +16 -9
- package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +2 -9
- package/dist/types/components/OmegaForm/useOmegaForm.d.ts +2 -1
- package/dist/vue-components.es10.js +231 -170
- package/dist/vue-components.es11.js +2 -2
- package/dist/vue-components.es12.js +137 -115
- package/dist/vue-components.es16.js +11 -10
- package/dist/vue-components.es17.js +10 -5
- package/dist/vue-components.es18.js +5 -55
- package/dist/vue-components.es19.js +50 -63
- package/dist/vue-components.es20.js +68 -6
- package/dist/vue-components.es21.js +4 -4
- 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.es31.js +1 -1
- package/dist/vue-components.es32.js +1 -1
- package/dist/vue-components.es36.js +1 -1
- 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.es58.js +3 -3
- package/dist/vue-components.es59.js +1 -1
- package/dist/vue-components.es8.js +33 -41
- package/dist/vue-components.es9.js +7 -6
- package/package.json +3 -3
- package/src/components/OmegaForm/InputProps.ts +17 -8
- package/src/components/OmegaForm/OmegaFormStuff.ts +52 -0
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +27 -39
- package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +4 -3
- package/src/components/OmegaForm/useOmegaForm.ts +139 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import l from "./vue-components.
|
|
1
|
+
import l from "./vue-components.es29.js";
|
|
2
2
|
import { inject as c, provide as u } from "vue";
|
|
3
|
-
import { onMountedWithCleanup as f } from "./vue-components.
|
|
3
|
+
import { onMountedWithCleanup as f } from "./vue-components.es16.js";
|
|
4
4
|
const p = () => l(), i = Symbol("DialogBus"), r = () => c(i, null), g = () => {
|
|
5
5
|
const n = p();
|
|
6
6
|
return u(i, n), n;
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
import { S as n, Option as
|
|
2
|
-
import { getMetadataFromSchema as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === n.Null.ast), d = (e) => !e || !n.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === n.Null.ast) ? "null" : !1,
|
|
1
|
+
import { S as n, Option as L } from "effect-app";
|
|
2
|
+
import { getMetadataFromSchema as w } from "@effect-app/vue/form";
|
|
3
|
+
import { useIntl as N, getTransformationFrom as M } from "./vue-components.es3.js";
|
|
4
|
+
const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === n.Null.ast), d = (e) => !e || !n.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === n.Null.ast) ? "null" : !1, _ = (e) => {
|
|
5
5
|
const i = [];
|
|
6
6
|
for (const t of e)
|
|
7
7
|
if (n.AST.isUnion(t)) {
|
|
8
|
-
const
|
|
9
|
-
i.push(...
|
|
8
|
+
const c = _(t.types);
|
|
9
|
+
i.push(...c);
|
|
10
10
|
} else
|
|
11
11
|
i.push(t);
|
|
12
12
|
return i;
|
|
13
|
-
},
|
|
13
|
+
}, u = ({ meta: e = {}, parent: i = "", property: t, propertySignatures: c }, o = {}) => {
|
|
14
14
|
if (t && t._tag === "Transformation")
|
|
15
|
-
return
|
|
15
|
+
return u({
|
|
16
16
|
parent: i,
|
|
17
17
|
meta: e,
|
|
18
18
|
property: t.from
|
|
19
19
|
});
|
|
20
20
|
if (t?._tag === "TypeLiteral" && "propertySignatures" in t)
|
|
21
|
-
return
|
|
21
|
+
return u({
|
|
22
22
|
meta: e,
|
|
23
23
|
propertySignatures: t.propertySignatures
|
|
24
24
|
});
|
|
25
|
-
if (
|
|
26
|
-
for (const r of
|
|
27
|
-
const
|
|
28
|
-
let
|
|
29
|
-
e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ?
|
|
30
|
-
const
|
|
25
|
+
if (c) {
|
|
26
|
+
for (const r of c) {
|
|
27
|
+
const p = i ? `${i}.${r.name.toString()}` : r.name.toString(), s = d(r.type);
|
|
28
|
+
let a;
|
|
29
|
+
e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ? a = !1 : a = !s;
|
|
30
|
+
const f = r.type;
|
|
31
31
|
if (n.AST.isUnion(r.type)) {
|
|
32
|
-
const
|
|
33
|
-
(
|
|
34
|
-
).map(
|
|
35
|
-
if (
|
|
36
|
-
(
|
|
32
|
+
const S = _(r.type.types).filter(
|
|
33
|
+
(l) => l._tag !== "UndefinedKeyword" && l !== n.Null.ast
|
|
34
|
+
).map(M);
|
|
35
|
+
if (S.some(
|
|
36
|
+
(l) => "propertySignatures" in l
|
|
37
37
|
)) {
|
|
38
38
|
if (!s) {
|
|
39
|
-
const
|
|
40
|
-
parent:
|
|
39
|
+
const l = u({
|
|
40
|
+
parent: p,
|
|
41
41
|
property: r.type,
|
|
42
|
-
meta: { required:
|
|
42
|
+
meta: { required: a, nullableOrUndefined: s }
|
|
43
43
|
});
|
|
44
|
-
|
|
44
|
+
o[p] = l;
|
|
45
45
|
}
|
|
46
|
-
for (const
|
|
47
|
-
if ("propertySignatures" in
|
|
48
|
-
const
|
|
46
|
+
for (const l of S)
|
|
47
|
+
if ("propertySignatures" in l) {
|
|
48
|
+
const m = s && S.length > 1;
|
|
49
49
|
Object.assign(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
parent:
|
|
53
|
-
propertySignatures:
|
|
54
|
-
meta:
|
|
50
|
+
o,
|
|
51
|
+
u({
|
|
52
|
+
parent: p,
|
|
53
|
+
propertySignatures: l.propertySignatures,
|
|
54
|
+
meta: m ? { _isNullableDiscriminatedUnion: !0 } : {}
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
} else {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
59
|
+
const l = S.filter(n.AST.isTupleType);
|
|
60
|
+
if (l.length > 0) {
|
|
61
|
+
const m = l[0];
|
|
62
|
+
if (o[p] = {
|
|
63
63
|
type: "multiple",
|
|
64
|
-
members:
|
|
65
|
-
rest:
|
|
66
|
-
required:
|
|
64
|
+
members: m.elements,
|
|
65
|
+
rest: m.rest,
|
|
66
|
+
required: a,
|
|
67
67
|
nullableOrUndefined: s
|
|
68
|
-
},
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
for (const
|
|
72
|
-
const
|
|
73
|
-
parent:
|
|
74
|
-
property:
|
|
68
|
+
}, m.rest && m.rest.length > 0) {
|
|
69
|
+
const T = m.rest[0];
|
|
70
|
+
if (T.type._tag === "TypeLiteral" && "propertySignatures" in T.type)
|
|
71
|
+
for (const g of T.type.propertySignatures) {
|
|
72
|
+
const h = `${p}.${g.name.toString()}`, v = u({
|
|
73
|
+
parent: h,
|
|
74
|
+
property: g.type,
|
|
75
75
|
meta: {
|
|
76
|
-
required: !d(
|
|
77
|
-
nullableOrUndefined: d(
|
|
76
|
+
required: !d(g.type),
|
|
77
|
+
nullableOrUndefined: d(g.type)
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
|
-
if (
|
|
81
|
-
const U =
|
|
80
|
+
if (v && typeof v == "object" && "type" in v && (o[h] = v, v.type === "multiple" && n.AST.isTupleType(g.type) && g.type.rest && g.type.rest.length > 0)) {
|
|
81
|
+
const U = g.type.rest[0];
|
|
82
82
|
if (U.type._tag === "TypeLiteral" && "propertySignatures" in U.type)
|
|
83
|
-
for (const
|
|
84
|
-
const A = `${
|
|
83
|
+
for (const x of U.type.propertySignatures) {
|
|
84
|
+
const A = `${h}.${x.name.toString()}`, O = u({
|
|
85
85
|
parent: A,
|
|
86
|
-
property:
|
|
86
|
+
property: x.type,
|
|
87
87
|
meta: {
|
|
88
|
-
required: !d(
|
|
89
|
-
nullableOrUndefined: d(
|
|
88
|
+
required: !d(x.type),
|
|
89
|
+
nullableOrUndefined: d(x.type)
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
O && typeof O == "object" && "type" in O && (o[A] = O);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
} else {
|
|
98
|
-
const
|
|
99
|
-
parent:
|
|
98
|
+
const m = u({
|
|
99
|
+
parent: p,
|
|
100
100
|
property: r.type,
|
|
101
|
-
meta: { required:
|
|
101
|
+
meta: { required: a, nullableOrUndefined: s }
|
|
102
102
|
});
|
|
103
|
-
|
|
103
|
+
o[p] = m;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
} else if ("propertySignatures" in
|
|
106
|
+
} else if ("propertySignatures" in f)
|
|
107
107
|
Object.assign(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
parent:
|
|
111
|
-
propertySignatures:
|
|
112
|
-
meta: { required:
|
|
108
|
+
o,
|
|
109
|
+
u({
|
|
110
|
+
parent: p,
|
|
111
|
+
propertySignatures: f.propertySignatures,
|
|
112
|
+
meta: { required: a, nullableOrUndefined: s }
|
|
113
113
|
})
|
|
114
114
|
);
|
|
115
115
|
else if (n.AST.isTupleType(r.type))
|
|
116
116
|
if (r.type.rest.length > 0 && r.type.rest[0].type._tag === "TypeLiteral" && "propertySignatures" in r.type.rest[0].type) {
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
for (const y of
|
|
120
|
-
const
|
|
117
|
+
const S = r.type.rest[0].type;
|
|
118
|
+
if (S._tag === "TypeLiteral" && "propertySignatures" in S)
|
|
119
|
+
for (const y of S.propertySignatures) {
|
|
120
|
+
const l = `${p}.${y.name.toString()}`;
|
|
121
121
|
if (n.AST.isTupleType(y.type) && y.type.rest.length > 0) {
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
for (const
|
|
125
|
-
const
|
|
126
|
-
parent:
|
|
127
|
-
property:
|
|
122
|
+
const m = y.type.rest[0].type;
|
|
123
|
+
if (m._tag === "TypeLiteral" && "propertySignatures" in m)
|
|
124
|
+
for (const T of m.propertySignatures) {
|
|
125
|
+
const g = `${l}.${T.name.toString()}`, h = u({
|
|
126
|
+
parent: g,
|
|
127
|
+
property: T.type,
|
|
128
128
|
meta: {
|
|
129
|
-
required: !d(
|
|
130
|
-
nullableOrUndefined: d(
|
|
129
|
+
required: !d(T.type),
|
|
130
|
+
nullableOrUndefined: d(T.type)
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
|
|
133
|
+
o[g] = h;
|
|
134
134
|
}
|
|
135
135
|
else
|
|
136
|
-
|
|
136
|
+
o[l] = {
|
|
137
137
|
type: "multiple",
|
|
138
138
|
members: y.type.elements,
|
|
139
139
|
rest: y.type.rest,
|
|
@@ -141,61 +141,61 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
141
141
|
nullableOrUndefined: d(y.type)
|
|
142
142
|
};
|
|
143
143
|
} else {
|
|
144
|
-
const
|
|
145
|
-
parent:
|
|
144
|
+
const m = u({
|
|
145
|
+
parent: l,
|
|
146
146
|
property: y.type,
|
|
147
147
|
meta: {
|
|
148
148
|
required: !d(y.type),
|
|
149
149
|
nullableOrUndefined: d(y.type)
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
|
-
|
|
152
|
+
o[l] = m;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
} else
|
|
156
|
-
|
|
156
|
+
o[p] = {
|
|
157
157
|
type: "multiple",
|
|
158
158
|
members: r.type.elements,
|
|
159
159
|
rest: r.type.rest,
|
|
160
|
-
required:
|
|
160
|
+
required: a,
|
|
161
161
|
nullableOrUndefined: s
|
|
162
162
|
};
|
|
163
163
|
else {
|
|
164
|
-
const
|
|
165
|
-
parent:
|
|
164
|
+
const b = u({
|
|
165
|
+
parent: p,
|
|
166
166
|
property: r.type,
|
|
167
167
|
meta: {
|
|
168
168
|
// an empty string is valid for a S.String field, so we should not mark it as required
|
|
169
169
|
// TODO: handle this better via the createMeta minLength parsing
|
|
170
|
-
required:
|
|
170
|
+
required: a && (r.type._tag !== "StringKeyword" || w(r.type).minLength),
|
|
171
171
|
nullableOrUndefined: s
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
|
|
174
|
+
o[p] = b;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
return
|
|
177
|
+
return o;
|
|
178
178
|
}
|
|
179
179
|
if (t) {
|
|
180
180
|
const r = E(t);
|
|
181
181
|
if (Object.hasOwnProperty.call(e, "required") || (e.required = !r), n.AST.isUnion(t)) {
|
|
182
|
-
const s =
|
|
183
|
-
(
|
|
182
|
+
const s = _(t.types), a = s.find(
|
|
183
|
+
(f) => f._tag !== "UndefinedKeyword" && f !== n.Null.ast
|
|
184
184
|
);
|
|
185
|
-
return "propertySignatures" in
|
|
186
|
-
propertySignatures:
|
|
185
|
+
return "propertySignatures" in a ? u({
|
|
186
|
+
propertySignatures: a.propertySignatures,
|
|
187
187
|
parent: i,
|
|
188
188
|
meta: e
|
|
189
189
|
}) : s.every(n.AST.isLiteral) ? {
|
|
190
190
|
...e,
|
|
191
191
|
type: "select",
|
|
192
|
-
members: s.map((
|
|
192
|
+
members: s.map((f) => f.literal)
|
|
193
193
|
} : {
|
|
194
194
|
...e,
|
|
195
|
-
...
|
|
195
|
+
...u({
|
|
196
196
|
parent: i,
|
|
197
197
|
meta: e,
|
|
198
|
-
property:
|
|
198
|
+
property: a
|
|
199
199
|
})
|
|
200
200
|
};
|
|
201
201
|
}
|
|
@@ -206,11 +206,11 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
206
206
|
members: t.elements,
|
|
207
207
|
rest: t.rest
|
|
208
208
|
};
|
|
209
|
-
const
|
|
209
|
+
const p = n.AST.getAnnotation(
|
|
210
210
|
t,
|
|
211
211
|
n.AST.JSONSchemaAnnotationId
|
|
212
|
-
).pipe(
|
|
213
|
-
return e = { ...e, ...
|
|
212
|
+
).pipe(L.getOrElse(() => ({})));
|
|
213
|
+
return e = { ...e, ...p }, "from" in t ? u({
|
|
214
214
|
parent: i,
|
|
215
215
|
meta: e,
|
|
216
216
|
property: t.from
|
|
@@ -218,34 +218,56 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
218
218
|
t,
|
|
219
219
|
n.AST.TitleAnnotationId
|
|
220
220
|
).pipe(
|
|
221
|
-
|
|
221
|
+
L.getOrElse(() => "unknown")
|
|
222
222
|
), e);
|
|
223
223
|
}
|
|
224
|
-
return
|
|
224
|
+
return o;
|
|
225
225
|
}, q = (e) => {
|
|
226
226
|
const i = e.ast, t = {};
|
|
227
227
|
if (i._tag === "Transformation" || i._tag === "Refinement")
|
|
228
228
|
return q(n.make(i.from));
|
|
229
|
+
if (i._tag === "Union") {
|
|
230
|
+
const r = (i.types || []).filter((s) => s._tag !== "UndefinedKeyword" && s !== n.Null.ast).map(M);
|
|
231
|
+
if (r.every((s) => s._tag === "TypeLiteral" && "propertySignatures" in s) && r.length > 0) {
|
|
232
|
+
const s = [];
|
|
233
|
+
for (const a of r)
|
|
234
|
+
if ("propertySignatures" in a) {
|
|
235
|
+
const f = a.propertySignatures.find(
|
|
236
|
+
(S) => S.name.toString() === "_tag"
|
|
237
|
+
);
|
|
238
|
+
f && n.AST.isLiteral(f.type) && s.push(f.type.literal);
|
|
239
|
+
const b = u({
|
|
240
|
+
propertySignatures: a.propertySignatures
|
|
241
|
+
});
|
|
242
|
+
Object.assign(t, b);
|
|
243
|
+
}
|
|
244
|
+
return s.length > 0 && (t._tag = {
|
|
245
|
+
type: "select",
|
|
246
|
+
members: s,
|
|
247
|
+
required: !0
|
|
248
|
+
}), t;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
229
251
|
if ("propertySignatures" in i) {
|
|
230
|
-
const
|
|
252
|
+
const c = u({
|
|
231
253
|
propertySignatures: i.propertySignatures
|
|
232
254
|
});
|
|
233
|
-
if (Object.values(
|
|
234
|
-
return
|
|
235
|
-
const
|
|
255
|
+
if (Object.values(c).every((r) => r && "type" in r))
|
|
256
|
+
return c;
|
|
257
|
+
const o = (r, p = "") => {
|
|
236
258
|
for (const s in r) {
|
|
237
|
-
const
|
|
238
|
-
r[s] && typeof r[s] == "object" && "type" in r[s] ? t[
|
|
259
|
+
const a = p ? `${p}.${s}` : s;
|
|
260
|
+
r[s] && typeof r[s] == "object" && "type" in r[s] ? t[a] = r[s] : r[s] && typeof r[s] == "object" && o(r[s], a);
|
|
239
261
|
}
|
|
240
262
|
};
|
|
241
|
-
|
|
263
|
+
o(c);
|
|
242
264
|
}
|
|
243
265
|
return t;
|
|
244
|
-
}, P = (e) => n.extend(e, n.Struct({})),
|
|
266
|
+
}, P = (e) => n.extend(e, n.Struct({})), j = (e) => {
|
|
245
267
|
const i = q(e);
|
|
246
268
|
return { schema: e, meta: i };
|
|
247
|
-
},
|
|
248
|
-
const { trans: i } =
|
|
269
|
+
}, F = (e) => {
|
|
270
|
+
const { trans: i } = N();
|
|
249
271
|
let t;
|
|
250
272
|
switch (e.type) {
|
|
251
273
|
case "string":
|
|
@@ -352,10 +374,10 @@ const E = (e) => n.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKe
|
|
|
352
374
|
"url"
|
|
353
375
|
], R = (e) => k.includes(e) ? e : "text";
|
|
354
376
|
export {
|
|
355
|
-
|
|
377
|
+
u as createMeta,
|
|
356
378
|
P as duplicateSchema,
|
|
357
|
-
|
|
358
|
-
|
|
379
|
+
F as generateInputStandardSchemaFromFieldMeta,
|
|
380
|
+
j as generateMetaFromSchema,
|
|
359
381
|
R as getInputType,
|
|
360
382
|
D as nullableInput
|
|
361
383
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
}))
|
|
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
|
+
}
|
|
8
11
|
export {
|
|
9
|
-
|
|
10
|
-
i as cloneTrait,
|
|
11
|
-
p as runtimeFiberAsPromise
|
|
12
|
+
p as onMountedWithCleanup
|
|
12
13
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Exit as c, Runtime as u } from "effect";
|
|
2
|
+
import { dual as n, isFunction as m } from "./vue-components.es30.js";
|
|
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
|
+
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
|
+
}));
|
|
3
8
|
export {
|
|
4
|
-
|
|
5
|
-
i as
|
|
6
|
-
|
|
9
|
+
a as clone,
|
|
10
|
+
i as cloneTrait,
|
|
11
|
+
p as runtimeFiberAsPromise
|
|
7
12
|
};
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
inheritAttrs: !1,
|
|
4
|
-
__name: "OmegaArray",
|
|
5
|
-
props: {
|
|
6
|
-
form: {},
|
|
7
|
-
inputClass: {},
|
|
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 { isFunction as c } from "./vue-components.es30.js";
|
|
2
|
+
const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
|
|
55
3
|
export {
|
|
56
|
-
|
|
4
|
+
s as isFunction,
|
|
5
|
+
i as isObject,
|
|
6
|
+
t as isRecordOrArray
|
|
57
7
|
};
|
|
@@ -1,70 +1,57 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__name: "
|
|
1
|
+
import { defineComponent as F, computed as f, onMounted as M, provide as P, createBlock as c, openBlock as s, resolveDynamicComponent as p, withCtx as g, renderSlot as o, createElementBlock as k, normalizeProps as l, guardReactiveProps as u, Fragment as A, renderList as C, mergeProps as b } from "vue";
|
|
2
|
+
const N = /* @__PURE__ */ F({
|
|
3
|
+
inheritAttrs: !1,
|
|
4
|
+
__name: "OmegaArray",
|
|
5
5
|
props: {
|
|
6
6
|
form: {},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
order: {},
|
|
12
|
-
sort: {}
|
|
7
|
+
inputClass: {},
|
|
8
|
+
name: {},
|
|
9
|
+
defaultItems: {},
|
|
10
|
+
items: {}
|
|
13
11
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
n.form.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
(e
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
n.sort ? u.sort(n.sort) : (e) => e
|
|
56
|
-
)
|
|
57
|
-
);
|
|
58
|
-
return (e, r) => (_(!0), M(E, null, A(b.value, ({ name: t, label: o, ...c }) => F(e.$slots, "default", {
|
|
59
|
-
child: { name: t, label: o, ...c }
|
|
60
|
-
}, () => [
|
|
61
|
-
g(h(i.form).Input, k({
|
|
62
|
-
name: t,
|
|
63
|
-
label: o
|
|
64
|
-
}, { ref_for: !0 }, c), null, 16, ["name", "label"])
|
|
65
|
-
])), 256));
|
|
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"]));
|
|
66
53
|
}
|
|
67
54
|
});
|
|
68
55
|
export {
|
|
69
|
-
|
|
56
|
+
N as default
|
|
70
57
|
};
|