@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.
Files changed (64) hide show
  1. package/dist/types/components/CommandButton.vue.d.ts +12 -8
  2. package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +8 -4
  3. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +9 -5
  4. package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +4 -4
  5. package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +8 -4
  6. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +2 -1
  7. package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +8 -4
  8. package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +9 -5
  9. package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +9 -5
  10. package/dist/types/components/OmegaForm/OmegaTaggedUnion.vue.d.ts +9 -9
  11. package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +9 -5
  12. package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +9 -5
  13. package/dist/vue-components.es10.js +7 -7
  14. package/dist/vue-components.es11.js +3 -3
  15. package/dist/vue-components.es12.js +120 -144
  16. package/dist/vue-components.es16.js +11 -4
  17. package/dist/vue-components.es17.js +4 -10
  18. package/dist/vue-components.es18.js +10 -55
  19. package/dist/vue-components.es19.js +50 -63
  20. package/dist/vue-components.es20.js +68 -6
  21. package/dist/vue-components.es21.js +5 -5
  22. package/dist/vue-components.es22.js +6 -3
  23. package/dist/vue-components.es23.js +3 -3
  24. package/dist/vue-components.es24.js +3 -2
  25. package/dist/vue-components.es25.js +1 -1
  26. package/dist/vue-components.es26.js +1 -1
  27. package/dist/vue-components.es27.js +1 -1
  28. package/dist/vue-components.es28.js +2 -17
  29. package/dist/vue-components.es29.js +16 -10
  30. package/dist/vue-components.es3.js +1 -1
  31. package/dist/vue-components.es30.js +191 -41
  32. package/dist/vue-components.es32.js +42 -2
  33. package/dist/vue-components.es33.js +2 -111
  34. package/dist/vue-components.es34.js +4 -0
  35. package/dist/vue-components.es35.js +111 -7
  36. package/dist/vue-components.es37.js +9 -0
  37. package/dist/vue-components.es38.js +27 -187
  38. package/dist/vue-components.es40.js +4 -23
  39. package/dist/vue-components.es41.js +23 -5
  40. package/dist/vue-components.es42.js +5 -21
  41. package/dist/vue-components.es43.js +16 -25
  42. package/dist/vue-components.es44.js +23 -15
  43. package/dist/vue-components.es45.js +17 -7
  44. package/dist/vue-components.es46.js +12 -5
  45. package/dist/vue-components.es47.js +5 -19
  46. package/dist/vue-components.es48.js +19 -9
  47. package/dist/vue-components.es49.js +9 -31
  48. package/dist/vue-components.es5.js +1 -1
  49. package/dist/vue-components.es50.js +25 -42
  50. package/dist/vue-components.es51.js +38 -16
  51. package/dist/vue-components.es52.js +26 -11
  52. package/dist/vue-components.es53.js +11 -4
  53. package/dist/vue-components.es54.js +1 -1
  54. package/dist/vue-components.es56.js +1 -1
  55. package/dist/vue-components.es57.js +1 -1
  56. package/dist/vue-components.es58.js +3 -3
  57. package/dist/vue-components.es59.js +1 -1
  58. package/dist/vue-components.es7.js +3 -3
  59. package/package.json +24 -24
  60. package/src/components/OmegaForm/OmegaFormStuff.ts +23 -59
  61. package/src/components/OmegaForm/OmegaInputVuetify.vue +2 -2
  62. package/src/components/OmegaForm/OmegaInternalInput.vue +2 -2
  63. package/dist/vue-components.es31.js +0 -4
  64. package/dist/vue-components.es36.js +0 -34
@@ -1,7 +1,7 @@
1
- import { S as i, Option as w } from "effect-app";
2
- import { getMetadataFromSchema as k } from "@effect-app/vue/form";
3
- import { useIntl as V, getTransformationFrom as _ } from "./vue-components.es3.js";
4
- import { isObject as $ } from "./vue-components.es16.js";
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(w.getOrElse(() => ""));
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 u = n ? `${n}.${r.name.toString()}` : r.name.toString(), a = c(r.type);
32
- let m;
33
- e._isNullableDiscriminatedUnion && r.name.toString() === "_tag" || e.required === !1 ? m = !1 : m = !a;
34
- const l = r.type;
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
- (p) => p._tag !== "UndefinedKeyword" && p !== i.Null.ast
37
+ (u) => u._tag !== "UndefinedKeyword" && u !== i.Null.ast
38
38
  ).map(_);
39
39
  if (S.some(
40
- (p) => "propertySignatures" in p
40
+ (u) => "propertySignatures" in u
41
41
  )) {
42
42
  if (!a) {
43
- const p = y({
44
- parent: u,
43
+ const u = y({
44
+ parent: l,
45
45
  property: r.type,
46
- meta: { required: m, nullableOrUndefined: a }
46
+ meta: { required: f, nullableOrUndefined: a }
47
47
  });
48
- s[u] = p;
48
+ s[l] = u;
49
49
  }
50
- for (const p of S)
51
- if ("propertySignatures" in p) {
52
- const f = a && S.length > 1;
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: u,
57
- propertySignatures: p.propertySignatures,
58
- meta: f ? { _isNullableDiscriminatedUnion: !0 } : {}
56
+ parent: l,
57
+ propertySignatures: u.propertySignatures,
58
+ meta: m ? { _isNullableDiscriminatedUnion: !0 } : {}
59
59
  })
60
60
  );
61
61
  }
62
62
  } else {
63
- const p = S.filter(i.AST.isTupleType);
64
- if (p.length > 0) {
65
- const f = p[0];
66
- if (s[u] = {
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: f.elements,
69
- rest: f.rest,
70
- required: m,
68
+ members: m.elements,
69
+ rest: m.rest,
70
+ required: f,
71
71
  nullableOrUndefined: a
72
- }, f.rest && f.rest.length > 0) {
73
- const T = f.rest[0];
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 x = `${u}.${g.name.toString()}`, v = y({
77
- parent: x,
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[x] = v, v.type === "multiple" && i.AST.isTupleType(g.type) && g.type.rest && g.type.rest.length > 0)) {
85
- const M = g.type.rest[0];
86
- if (M.type._tag === "TypeLiteral" && "propertySignatures" in M.type)
87
- for (const A of M.type.propertySignatures) {
88
- const N = `${x}.${A.name.toString()}`, O = y({
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: A.type,
90
+ property: x.type,
91
91
  meta: {
92
- required: !c(A.type),
93
- nullableOrUndefined: c(A.type)
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 f = y({
103
- parent: u,
102
+ const m = y({
103
+ parent: l,
104
104
  property: r.type,
105
- meta: { required: m, nullableOrUndefined: a }
105
+ meta: { required: f, nullableOrUndefined: a }
106
106
  });
107
- s[u] = f;
107
+ s[l] = m;
108
108
  }
109
109
  }
110
110
  } else {
111
- const d = _(l);
111
+ const d = _(p);
112
112
  if ("propertySignatures" in d)
113
113
  Object.assign(
114
114
  s,
115
115
  y({
116
- parent: u,
116
+ parent: l,
117
117
  propertySignatures: d.propertySignatures,
118
- meta: { required: m, nullableOrUndefined: a }
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 p of b.propertySignatures) {
126
- const f = `${u}.${p.name.toString()}`;
127
- if (i.AST.isTupleType(p.type) && p.type.rest.length > 0) {
128
- const T = p.type.rest[0].type;
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 x = `${f}.${g.name.toString()}`, v = y({
132
- parent: x,
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[x] = v;
139
+ s[h] = v;
140
140
  }
141
141
  else
142
- s[f] = {
142
+ s[m] = {
143
143
  type: "multiple",
144
- members: p.type.elements,
145
- rest: p.type.rest,
146
- required: !c(p.type),
147
- nullableOrUndefined: c(p.type)
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: f,
152
- property: p.type,
151
+ parent: m,
152
+ property: u.type,
153
153
  meta: {
154
- required: !c(p.type),
155
- nullableOrUndefined: c(p.type)
154
+ required: !c(u.type),
155
+ nullableOrUndefined: c(u.type)
156
156
  }
157
157
  });
158
- s[f] = T;
158
+ s[m] = T;
159
159
  }
160
160
  }
161
161
  } else
162
- s[u] = {
162
+ s[l] = {
163
163
  type: "multiple",
164
164
  members: r.type.elements,
165
165
  rest: r.type.rest,
166
- required: m,
166
+ required: f,
167
167
  nullableOrUndefined: a
168
168
  };
169
169
  else {
170
170
  const S = y({
171
- parent: u,
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: m && (r.type._tag !== "StringKeyword" || k(r.type).minLength),
176
+ required: f && (r.type._tag !== "StringKeyword" || V(r.type).minLength),
177
177
  nullableOrUndefined: a
178
178
  }
179
179
  });
180
- s[u] = 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 m = L(t.types), l = m.find(
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 l ? y({
193
- propertySignatures: l.propertySignatures,
192
+ return "propertySignatures" in p ? y({
193
+ propertySignatures: p.propertySignatures,
194
194
  parent: n,
195
195
  meta: e
196
- }) : m.every(i.AST.isLiteral) ? {
196
+ }) : f.every(i.AST.isLiteral) ? {
197
197
  ...e,
198
198
  type: "select",
199
- members: m.map((d) => d.literal)
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: l
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(w.getOrElse(() => ({}))), ...e };
219
+ ).pipe(M.getOrElse(() => ({}))), ...e };
220
220
  const a = i.AST.getAnnotation(
221
221
  t,
222
222
  i.AST.TitleAnnotationId
223
223
  ).pipe(
224
- w.getOrElse(() => "unknown")
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
- }, E = (e) => {
247
+ }, k = (e) => {
248
248
  const n = e.ast, t = {}, o = {}, s = {};
249
249
  if (n._tag === "Transformation" || n._tag === "Refinement")
250
- return E(i.make(n.from));
250
+ return k(i.make(n.from));
251
251
  if (n._tag === "Union") {
252
- const a = (n.types || []).filter((l) => l._tag !== "UndefinedKeyword" && l !== i.Null.ast).map(_);
253
- if (a.every((l) => l._tag === "TypeLiteral" && "propertySignatures" in l) && a.length > 0) {
254
- const l = [];
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
- (f) => f.name.toString() === "_tag"
258
+ (m) => m.name.toString() === "_tag"
259
259
  );
260
260
  let b = null;
261
- S && i.AST.isLiteral(S.type) && (b = S.type.literal, l.push(b));
262
- const p = y({
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(p)), Object.assign(t, p);
265
+ b && (s[b] = q(u)), Object.assign(t, u);
266
266
  }
267
- return l.length > 0 && (t._tag = {
267
+ return p.length > 0 && (t._tag = {
268
268
  type: "select",
269
- members: l,
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 u = (a, m = "") => {
281
- for (const l in a) {
282
- const d = m ? `${m}.${l}` : l;
283
- a[l] && typeof a[l] == "object" && "type" in a[l] ? t[d] = a[l] : a[l] && typeof a[l] == "object" && u(a[l], d);
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
- u(r);
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 } = E(e);
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 = V().trans);
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 "int": {
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
- ), typeof e.minimum == "number" && (t = t.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
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 h = (e, n = {}) => {
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 u = r?.ast;
452
- if (u?.defaultValue)
427
+ const l = r?.ast;
428
+ if (l?.defaultValue)
453
429
  try {
454
- o[s] = u.defaultValue();
430
+ o[s] = l.defaultValue();
455
431
  continue;
456
432
  } catch {
457
433
  }
458
- const a = h(r, n[s] || {});
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 h(e.from, n);
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(([u, a]) => {
467
- const m = a.ast, l = s[u]?.ast;
468
- (!s[u] || m?.defaultValue && !l?.defaultValue) && (s[u] = a);
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, u]) => (s[r] = h(u, n[r] || {}), s), n);
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 h(i.make(e.ast.from), n);
451
+ return A(i.make(e.ast.from), n);
476
452
  case "Transformation": {
477
453
  const o = i.make(e.ast.from);
478
- return h(o, n);
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(), u = s.type;
484
- if (u._tag === "Transformation" && u.defaultValue) {
485
- o[r] = u.defaultValue();
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 (u.defaultValue) {
489
- o[r] = u.defaultValue();
464
+ if (l.defaultValue) {
465
+ o[r] = l.defaultValue();
490
466
  continue;
491
467
  }
492
- const a = i.make(u), m = h(a, n[r] || {});
493
- m !== void 0 && (o[r] = m);
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
- h as defaultsValueFromSchema,
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
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
3
- const t = Object.prototype.toString, c = (o) => t.call(o) === "[object Object]";
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
- c as isObject
12
+ p as onMountedWithCleanup
6
13
  };
@@ -1,12 +1,6 @@
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
- }));
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
- a as clone,
10
- i as cloneTrait,
11
- p as runtimeFiberAsPromise
5
+ c as isObject
12
6
  };
@@ -1,57 +1,12 @@
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
- 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 { 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
- N as default
9
+ a as clone,
10
+ i as cloneTrait,
11
+ p as runtimeFiberAsPromise
57
12
  };