@effect-app/vue-components 2.7.10 → 2.8.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 (58) hide show
  1. package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +3 -1
  2. package/dist/types/components/OmegaForm/defaultAST.d.ts +4 -0
  3. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +1 -0
  4. package/dist/vue-components.es10.js +150 -240
  5. package/dist/vue-components.es11.js +2 -2
  6. package/dist/vue-components.es16.js +11 -10
  7. package/dist/vue-components.es17.js +10 -5
  8. package/dist/vue-components.es18.js +95 -53
  9. package/dist/vue-components.es19.js +50 -63
  10. package/dist/vue-components.es20.js +68 -6
  11. package/dist/vue-components.es21.js +5 -5
  12. package/dist/vue-components.es22.js +6 -3
  13. package/dist/vue-components.es23.js +3 -3
  14. package/dist/vue-components.es24.js +3 -2
  15. package/dist/vue-components.es25.js +1 -1
  16. package/dist/vue-components.es26.js +1 -1
  17. package/dist/vue-components.es27.js +1 -1
  18. package/dist/vue-components.es28.js +2 -17
  19. package/dist/vue-components.es29.js +16 -10
  20. package/dist/vue-components.es31.js +4 -2
  21. package/dist/vue-components.es33.js +2 -109
  22. package/dist/vue-components.es34.js +113 -0
  23. package/dist/vue-components.es36.js +7 -32
  24. package/dist/vue-components.es37.js +34 -0
  25. package/dist/vue-components.es41.js +10 -22
  26. package/dist/vue-components.es42.js +4 -5
  27. package/dist/vue-components.es43.js +20 -18
  28. package/dist/vue-components.es44.js +5 -30
  29. package/dist/vue-components.es45.js +16 -17
  30. package/dist/vue-components.es46.js +25 -7
  31. package/dist/vue-components.es47.js +22 -5
  32. package/dist/vue-components.es48.js +12 -19
  33. package/dist/vue-components.es49.js +5 -9
  34. package/dist/vue-components.es5.js +1 -1
  35. package/dist/vue-components.es50.js +19 -31
  36. package/dist/vue-components.es51.js +9 -48
  37. package/dist/vue-components.es52.js +25 -20
  38. package/dist/vue-components.es53.js +48 -11
  39. package/dist/vue-components.es54.js +21 -60
  40. package/dist/vue-components.es55.js +54 -45
  41. package/dist/vue-components.es56.js +54 -15
  42. package/dist/vue-components.es57.js +15 -31
  43. package/dist/vue-components.es58.js +30 -26
  44. package/dist/vue-components.es59.js +29 -42
  45. package/dist/vue-components.es60.js +42 -2
  46. package/dist/vue-components.es61.js +2 -44
  47. package/dist/vue-components.es62.js +44 -2
  48. package/dist/vue-components.es63.js +4 -0
  49. package/dist/vue-components.es7.js +1 -1
  50. package/dist/vue-components.es9.js +33 -10
  51. package/package.json +1 -1
  52. package/src/components/OmegaForm/OmegaErrorsInternal.vue +45 -33
  53. package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +50 -1
  54. package/src/components/OmegaForm/defaultAST.ts +191 -0
  55. package/src/components/OmegaForm/useOmegaForm.ts +5 -187
  56. package/dist/vue-components.es35.js +0 -9
  57. package/dist/vue-components.es40.js +0 -6
  58. /package/dist/{vue-components.es38.js → vue-components.es39.js} +0 -0
@@ -8,9 +8,11 @@ type __VLS_Props = {
8
8
  declare var __VLS_6: {
9
9
  errors: OmegaError[];
10
10
  showedGeneralErrors: string[];
11
- };
11
+ }, __VLS_13: {};
12
12
  type __VLS_Slots = {} & {
13
13
  default?: (props: typeof __VLS_6) => any;
14
+ } & {
15
+ icon?: (props: typeof __VLS_13) => any;
14
16
  };
15
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
18
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -0,0 +1,4 @@
1
+ import { S } from "effect-app";
2
+ export declare function deepMerge(target: any, source: any): any;
3
+ export declare const extractDefaultsFromAST: (schemaObj: any) => any;
4
+ export declare const extractSchemaDefaults: <From, To>(schema: S.Schema<To, From, never>, defaultValues?: Partial<From>) => any;
@@ -81,6 +81,7 @@ type CachedFieldState<From, To, TypeProps = DefaultTypeProps> = import("@tanstac
81
81
  export interface OmegaFormReturn<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, TypeProps = DefaultTypeProps> extends OF<From, To> {
82
82
  _paths: FieldPath<From>;
83
83
  _keys: DeepKeys<From>;
84
+ _schema: S.Schema<To, From, never>;
84
85
  Input: <Name extends OmegaFormReturn<From, To, TypeProps>["_paths"]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
85
86
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & TypeProps & Partial<{}>> & BaseProps<From, Name> & import("vue").PublicProps;
86
87
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
@@ -1,318 +1,228 @@
1
- import { useForm as K } from "@tanstack/vue-form";
2
- import { Data as G, S as p, Effect as b, Array as A, Fiber as x, Option as O } from "effect-app";
3
- import { runtimeFiberAsPromise as z } from "./vue-components.es16.js";
4
- import { isObject as Q } from "./vue-components.es17.js";
5
- import { computed as V, onUnmounted as N, onMounted as X, onBeforeUnmount as Y, watch as W, ref as Z, h as J } from "vue";
6
- import C from "./vue-components.es18.js";
7
- import ee from "./vue-components.es19.js";
8
- import te from "./vue-components.es20.js";
9
- import { generateMetaFromSchema as re, isNullableOrUndefined as ne } from "./vue-components.es12.js";
10
- import se from "./vue-components.es6.js";
11
- import oe from "./vue-components.es8.js";
12
- import ie from "./vue-components.es21.js";
13
- import { trace as H } from "./vue-components.es22.js";
14
- import { context as L } from "./vue-components.es23.js";
15
- const g = (c) => {
16
- const i = c.ast;
17
- if (i._tag === "Refinement") {
18
- const n = i, u = p.make(n.from);
19
- return g(u);
20
- }
21
- if (i._tag === "Union") {
22
- const n = i.types.map((f) => {
23
- const l = p.make(f);
24
- return g(l).ast;
25
- }), u = {
26
- ...i,
27
- types: n
28
- };
29
- return p.make(u);
30
- }
31
- if (i._tag === "Transformation") {
32
- const n = i;
33
- if (n.to._tag === "Declaration") {
34
- const h = p.make(n.from);
35
- return g(h);
36
- }
37
- const u = p.make(n.from), f = p.make(n.to), l = g(u), d = g(f), w = {
38
- ...i,
39
- from: l.ast,
40
- to: d.ast
41
- };
42
- return p.make(w);
43
- }
44
- if (i._tag === "TypeLiteral") {
45
- const n = i.propertySignatures.map((f) => {
46
- const l = f.type;
47
- let d = l;
48
- if (l._tag === "TypeLiteral" || l._tag === "Union" || l._tag === "Transformation" || l._tag === "Refinement") {
49
- const w = p.make(l);
50
- d = g(w).ast;
51
- }
52
- return {
53
- ...f,
54
- type: d,
55
- isOptional: !0
56
- };
57
- }), u = {
58
- ...i,
59
- propertySignatures: n
60
- };
61
- return p.make(u);
62
- }
63
- return c;
64
- };
65
- class ae extends G.TaggedError("FormErrors") {
1
+ import { useForm as q } from "@tanstack/vue-form";
2
+ import { Data as B, S as D, Effect as c, Fiber as A, Option as P, Array as g } from "effect-app";
3
+ import { runtimeFiberAsPromise as K } from "./vue-components.es17.js";
4
+ import { computed as U, onUnmounted as N, onMounted as T, onBeforeUnmount as G, watch as W, ref as z, h as k } from "vue";
5
+ import { deepMerge as O, extractSchemaDefaults as Q } from "./vue-components.es18.js";
6
+ import X from "./vue-components.es19.js";
7
+ import Y from "./vue-components.es20.js";
8
+ import Z from "./vue-components.es21.js";
9
+ import { generateMetaFromSchema as C } from "./vue-components.es12.js";
10
+ import ee from "./vue-components.es6.js";
11
+ import re from "./vue-components.es8.js";
12
+ import te from "./vue-components.es22.js";
13
+ import { trace as R } from "./vue-components.es23.js";
14
+ import { context as L } from "./vue-components.es24.js";
15
+ class se extends B.TaggedError("FormErrors") {
66
16
  }
67
- const k = (c) => function(n) {
17
+ const E = (l) => function(n) {
68
18
  return {
69
19
  render() {
70
- return J(n, {
71
- form: c,
20
+ return k(n, {
21
+ form: l,
72
22
  ...this.$attrs
73
23
  }, this.$slots);
74
24
  }
75
25
  };
76
- }, le = (c) => function(n) {
26
+ }, ne = (l) => function(n) {
77
27
  return {
78
28
  setup() {
79
- const { fieldMap: u, form: f } = c, l = f.useStore((S) => S.errors), d = f.useStore((S) => S.fieldMeta), w = f.useStore((S) => S.errorMap), h = V(() => {
80
- const S = A.filterMap(
81
- Object.entries(d.value),
82
- ([M, y]) => {
83
- const a = y.errors ?? [];
84
- if (!a.length) return O.none();
85
- const v = u.value.get(M);
86
- return v ? O.some({
87
- label: v.label,
88
- inputId: v.id,
29
+ const { fieldMap: w, form: v } = l, b = v.useStore((u) => u.errors), m = v.useStore((u) => u.fieldMeta), F = v.useStore((u) => u.errorMap), _ = U(() => {
30
+ const u = g.filterMap(
31
+ Object.entries(m.value),
32
+ ([M, f]) => {
33
+ const S = f.errors ?? [];
34
+ if (!S.length) return P.none();
35
+ const a = w.value.get(M);
36
+ return a ? P.some({
37
+ label: a.label,
38
+ inputId: a.id,
89
39
  // Only show the first error
90
- errors: [a[0]?.message].filter(Boolean)
91
- }) : O.none();
40
+ errors: [S[0]?.message].filter(Boolean)
41
+ }) : P.none();
92
42
  }
93
- ), F = [];
94
- if (w.value.onSubmit) {
95
- for (const [M, y] of Object.entries(w.value.onSubmit))
96
- if (A.isArray(y) && y.length)
97
- for (const a of y) {
98
- const v = a;
99
- if (v?.path && A.isArray(v.path) && v.path.length) {
100
- const _ = v.path.join(".");
101
- if (!u.value.has(_)) {
102
- F.push({
103
- label: _,
104
- inputId: _,
105
- errors: [v.message].filter(Boolean)
43
+ ), o = [];
44
+ if (F.value.onSubmit) {
45
+ for (const [M, f] of Object.entries(F.value.onSubmit))
46
+ if (g.isArray(f) && f.length)
47
+ for (const S of f) {
48
+ const a = S;
49
+ if (a?.path && g.isArray(a.path) && a.path.length) {
50
+ const y = a.path.join(".");
51
+ if (!w.value.has(y)) {
52
+ o.push({
53
+ label: y,
54
+ inputId: y,
55
+ errors: [a.message].filter(Boolean)
106
56
  });
107
57
  break;
108
58
  }
109
59
  }
110
60
  }
111
61
  }
112
- return [...S, ...F];
62
+ return [...u, ...o];
113
63
  });
114
64
  return {
115
- generalErrors: l,
116
- errors: h
65
+ generalErrors: b,
66
+ errors: _
117
67
  };
118
68
  },
119
- render({ errors: u, generalErrors: f }) {
120
- return J(n, {
121
- errors: u,
122
- generalErrors: f,
69
+ render({ errors: w, generalErrors: v }) {
70
+ return k(n, {
71
+ errors: w,
72
+ generalErrors: v,
123
73
  ...this.$attrs
124
74
  }, this.$slots);
125
75
  }
126
76
  };
127
- }, _e = (c, i, n) => {
128
- if (!c) throw new Error("Schema is required");
129
- const u = p.standardSchemaV1(c), f = p.decode(c), { meta: l } = re(c), d = V(() => {
77
+ }, be = (l, d, n) => {
78
+ if (!l) throw new Error("Schema is required");
79
+ const w = D.standardSchemaV1(l), v = D.decode(l), { meta: b } = C(l), m = U(() => {
130
80
  if (n?.persistency?.id)
131
81
  return n.persistency.id;
132
- const e = window.location.pathname, t = Object.keys(l);
133
- return `${e}-${t.join("-")}`;
134
- }), w = () => {
82
+ const e = window.location.pathname, r = Object.keys(b);
83
+ return `${e}-${r.join("-")}`;
84
+ }), F = () => {
135
85
  const e = new URLSearchParams(window.location.search);
136
- e.delete(d.value);
137
- const t = new URL(window.location.href);
138
- t.search = e.toString(), window.history.replaceState({}, "", t.toString());
139
- };
140
- function h(e, t) {
141
- for (const r in t)
142
- A.isArray(t[r]) ? e[r] = t[r] : t[r] && Q(t[r]) ? (e[r] || (e[r] = {}), h(e[r], t[r])) : e[r] = t[r];
143
- return e;
144
- }
145
- const S = (e) => {
146
- const t = {};
147
- if (e?.fields && typeof e.fields == "object")
148
- for (const [r, o] of Object.entries(e.fields)) {
149
- if (o?.ast?.defaultValue)
150
- try {
151
- const m = o.ast.defaultValue();
152
- t[r] = m;
153
- } catch {
154
- }
155
- else {
156
- const m = o?.ast;
157
- switch (ne(m)) {
158
- case "null":
159
- t[r] = null;
160
- break;
161
- case "undefined":
162
- t[r] = void 0;
163
- break;
164
- }
165
- }
166
- const s = S(o);
167
- Object.keys(s).length > 0 && (t[r] && typeof t[r] == "object" ? Object.assign(t[r], s) : t[r] || (t[r] = s));
168
- }
169
- else if (e?.from?.fields && typeof e?.from?.fields == "object")
170
- return S(e.from);
171
- return t;
172
- }, F = (e = {}) => {
173
- let t = {};
174
- try {
175
- const r = S(c);
176
- t = p.encodeSync(g(c))(r);
177
- } catch (r) {
178
- window.location.hostname === "localhost" && console.warn("Could not extract defaults from AST:", r);
179
- }
180
- return h(t, e);
181
- }, M = V(() => {
86
+ e.delete(m.value);
87
+ const r = new URL(window.location.href);
88
+ r.search = e.toString(), window.history.replaceState({}, "", r.toString());
89
+ }, _ = U(() => {
182
90
  let e;
183
- const t = n?.persistency;
91
+ const r = n?.persistency;
184
92
  if (
185
93
  // query string has higher priority than local/session storage
186
- t?.policies && !e && (t.policies.includes("local") || t.policies.includes("session"))
94
+ r?.policies && !e && (r.policies.includes("local") || r.policies.includes("session"))
187
95
  ) {
188
- const r = t.policies.includes("local") ? localStorage : sessionStorage;
189
- if (r)
96
+ const s = r.policies.includes("local") ? localStorage : sessionStorage;
97
+ if (s)
190
98
  try {
191
- const o = JSON.parse(
192
- r.getItem(d.value) || "{}"
99
+ const i = JSON.parse(
100
+ s.getItem(m.value) || "{}"
193
101
  );
194
- r.removeItem(d.value), e = o;
195
- } catch (o) {
196
- console.error(o);
102
+ s.removeItem(m.value), e = i;
103
+ } catch (i) {
104
+ console.error(i);
197
105
  }
198
106
  }
199
- if (t?.policies && t.policies.includes("querystring"))
107
+ if (r?.policies && r.policies.includes("querystring"))
200
108
  try {
201
- const o = new URLSearchParams(window.location.search).get(d.value);
202
- w(), o && (e = h(e || {}, JSON.parse(o)));
203
- } catch (r) {
204
- console.error(r);
109
+ const i = new URLSearchParams(window.location.search).get(m.value);
110
+ F(), i && (e = O(e || {}, JSON.parse(i)));
111
+ } catch (s) {
112
+ console.error(s);
205
113
  }
206
- return e ??= {}, F(
207
- n?.persistency?.overrideDefaultValues ? h(i?.defaultValues || {}, e) : h(e, i?.defaultValues || {})
114
+ return e ??= {}, Q(
115
+ l,
116
+ n?.persistency?.overrideDefaultValues ? O(d?.defaultValues || {}, e) : O(e, d?.defaultValues || {})
208
117
  );
209
- }), y = (e, t) => e ? L.with(H.setSpan(L.active(), e), t) : t(), a = K({
210
- ...i,
118
+ }), u = (e, r) => e ? L.with(R.setSpan(L.active(), e), r) : r(), o = q({
119
+ ...d,
211
120
  validators: {
212
- onSubmit: u,
213
- ...i?.validators || {}
121
+ onSubmit: w,
122
+ ...d?.validators || {}
214
123
  },
215
- onSubmit: i?.onSubmit ? ({ formApi: e, meta: t, value: r }) => y(t?.currentSpan, async () => {
216
- const o = await b.runPromise(f(r)), s = i.onSubmit({
124
+ onSubmit: d?.onSubmit ? ({ formApi: e, meta: r, value: s }) => u(r?.currentSpan, async () => {
125
+ const i = await c.runPromise(v(s)), t = d.onSubmit({
217
126
  formApi: e,
218
- meta: t,
219
- value: o
127
+ meta: r,
128
+ value: i
220
129
  });
221
- return x.isFiber(s) && x.isRuntimeFiber(s) ? await z(s) : b.isEffect(s) ? await b.runPromise(
222
- s.pipe(
130
+ return A.isFiber(t) && A.isRuntimeFiber(t) ? await K(t) : c.isEffect(t) ? await c.runPromise(
131
+ t.pipe(
223
132
  // meta?.currentSpan
224
133
  // ? Effect.withParentSpan(meta.currentSpan)
225
134
  // : (_) => _,
226
- b.flatMap((m) => x.join(m))
135
+ c.flatMap((p) => A.join(p))
227
136
  )
228
- ) : s;
137
+ ) : t;
229
138
  }) : void 0,
230
- defaultValues: M.value
231
- }), v = () => {
232
- Object.keys(l).forEach((e) => {
233
- a.setFieldValue(e, void 0);
139
+ defaultValues: _.value
140
+ }), M = () => {
141
+ Object.keys(b).forEach((e) => {
142
+ o.setFieldValue(e, void 0);
234
143
  });
235
- }, _ = (e) => e.reduce((t, r) => {
236
- const o = r.split(".");
237
- return o.reduce((s, m, U) => (U === o.length - 1 ? s[m] = a.getFieldValue(r) : s[m] = s[m] ?? {}, s[m]), t), t;
238
- }, {}), D = (e) => {
144
+ }, f = (e) => e.reduce((r, s) => {
145
+ const i = s.split(".");
146
+ return i.reduce((t, p, x) => (x === i.length - 1 ? t[p] = o.getFieldValue(s) : t[p] = t[p] ?? {}, t[p]), r), r;
147
+ }, {}), S = (e) => {
239
148
  if (e) {
240
- if (A.isArray(e.keys))
241
- return _(e.keys);
242
- if (A.isArray(e.banKeys)) {
243
- const t = Object.keys(l).filter((r) => e.banKeys?.includes(r));
244
- return _(t);
149
+ if (g.isArray(e.keys))
150
+ return f(e.keys);
151
+ if (g.isArray(e.banKeys)) {
152
+ const r = Object.keys(b).filter((s) => e.banKeys?.includes(s));
153
+ return f(r);
245
154
  }
246
- return a.store.state.values;
155
+ return o.store.state.values;
247
156
  }
248
- }, P = () => {
157
+ }, a = () => {
249
158
  const e = n?.persistency;
250
159
  if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
251
- const t = e.policies.includes("local") ? localStorage : sessionStorage;
252
- if (!t) return;
253
- const r = D(e);
254
- return t.setItem(d.value, JSON.stringify(r));
160
+ const r = e.policies.includes("local") ? localStorage : sessionStorage;
161
+ if (!r) return;
162
+ const s = S(e);
163
+ return r.setItem(m.value, JSON.stringify(s));
255
164
  }
256
- }, T = () => {
165
+ }, y = () => {
257
166
  const e = n?.persistency;
258
167
  if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
259
- const t = D(e), r = new URLSearchParams(window.location.search);
260
- r.set(d.value, JSON.stringify(t));
261
- const o = new URL(window.location.href);
262
- o.search = r.toString(), window.history.replaceState({}, "", o.toString());
168
+ const r = S(e), s = new URLSearchParams(window.location.search);
169
+ s.set(m.value, JSON.stringify(r));
170
+ const i = new URL(window.location.href);
171
+ i.search = s.toString(), window.history.replaceState({}, "", i.toString());
263
172
  }
264
- }, I = (e) => {
265
- a.store.state.isDirty && e.preventDefault();
173
+ }, V = (e) => {
174
+ o.store.state.isDirty && e.preventDefault();
266
175
  };
267
- if (N(P), X(() => {
268
- window.addEventListener("beforeunload", P), window.addEventListener("blur", T), n?.preventWindowExit && n.preventWindowExit !== "nope" && window.addEventListener("beforeunload", I);
269
- }), Y(() => {
270
- window.removeEventListener("beforeunload", P), window.removeEventListener("blur", T), n?.preventWindowExit && n.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", I);
176
+ if (N(a), T(() => {
177
+ window.addEventListener("beforeunload", a), window.addEventListener("blur", y), n?.preventWindowExit && n.preventWindowExit !== "nope" && window.addEventListener("beforeunload", V);
178
+ }), G(() => {
179
+ window.removeEventListener("beforeunload", a), window.removeEventListener("blur", y), n?.preventWindowExit && n.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", V);
271
180
  }), n?.preventWindowExit === "prevent-and-reset") {
272
- const e = a.useStore((s) => s.isSubmitting), t = a.useStore((s) => s.submissionAttempts), r = a.useStore((s) => s.canSubmit), o = a.useStore((s) => s.values);
273
- W([e, t], ([s, m], [U]) => {
274
- U && !s && m > 0 && r.value && a.reset(o.value);
181
+ const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts), s = o.useStore((t) => t.canSubmit), i = o.useStore((t) => t.values);
182
+ W([e, r], ([t, p], [x]) => {
183
+ x && !t && p > 0 && s.value && o.reset(i.value);
275
184
  });
276
185
  }
277
- const R = (e) => b.currentSpan.pipe(
278
- b.option,
279
- b.flatMap(
280
- (t) => b.promise(() => a.handleSubmit(O.isSome(t) ? { currentSpan: t.value, ...e } : e))
186
+ const I = (e) => c.currentSpan.pipe(
187
+ c.option,
188
+ c.flatMap(
189
+ (r) => c.promise(() => o.handleSubmit(P.isSome(r) ? { currentSpan: r.value, ...e } : e))
281
190
  )
282
- ), q = (e) => e?.checkErrors ? R(e?.meta).pipe(b.flatMap(b.fnUntraced(function* () {
283
- const t = a.getAllErrors();
284
- if (Object.keys(t.fields).length || t.form.errors.length)
285
- return yield* new ae({ form: t.form, fields: t.fields });
286
- }))) : R(e?.meta), B = a.handleSubmit, j = Z(/* @__PURE__ */ new Map()), E = Object.assign(a, {
191
+ ), H = (e) => e?.checkErrors ? I(e?.meta).pipe(c.flatMap(c.fnUntraced(function* () {
192
+ const r = o.getAllErrors();
193
+ if (Object.keys(r.fields).length || r.form.errors.length)
194
+ return yield* new se({ form: r.form, fields: r.fields });
195
+ }))) : I(e?.meta), J = o.handleSubmit, j = z(/* @__PURE__ */ new Map()), h = Object.assign(o, {
287
196
  i18nNamespace: n?.i18nNamespace,
288
197
  ignorePreventCloseEvents: n?.ignorePreventCloseEvents,
289
- meta: l,
290
- clear: v,
198
+ meta: b,
199
+ clear: M,
291
200
  handleSubmit: (e) => {
292
- const t = H.getSpan(L.active());
293
- return B({ currentSpan: t, ...e });
201
+ const r = R.getSpan(L.active());
202
+ return J({ currentSpan: r, ...e });
294
203
  },
295
204
  // /** @experimental */
296
- handleSubmitEffect: q,
205
+ handleSubmitEffect: H,
297
206
  registerField: (e) => {
298
- W(e, (t) => j.value.set(t.name, { label: t.label, id: t.id }), { immediate: !0 }), N(() => j.value.delete(e.value.name));
207
+ W(e, (r) => j.value.set(r.name, { label: r.label, id: r.id }), { immediate: !0 }), N(() => j.value.delete(e.value.name));
299
208
  }
300
- }), $ = { form: E, fieldMap: j };
301
- return Object.assign(E, {
209
+ }), $ = { form: h, fieldMap: j };
210
+ return Object.assign(h, {
302
211
  // Type-level properties for performance optimization (not used at runtime)
303
212
  _paths: void 0,
304
213
  _keys: void 0,
214
+ _schema: l,
305
215
  errorContext: $,
306
- Form: k(E)(ie),
307
- Input: k(E)(n?.input ?? se),
308
- TaggedUnion: k(E)(oe),
309
- Field: a.Field,
310
- Errors: le($)(te),
311
- Array: k(E)(C),
312
- AutoGen: k(E)(ee)
216
+ Form: E(h)(te),
217
+ Input: E(h)(n?.input ?? ee),
218
+ TaggedUnion: E(h)(re),
219
+ Field: o.Field,
220
+ Errors: ne($)(Z),
221
+ Array: E(h)(X),
222
+ AutoGen: E(h)(Y)
313
223
  });
314
224
  };
315
225
  export {
316
- ae as FormErrors,
317
- _e as useOmegaForm
226
+ se as FormErrors,
227
+ be as useOmegaForm
318
228
  };
@@ -1,6 +1,6 @@
1
- import l from "./vue-components.es28.js";
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.es29.js";
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,12 +1,13 @@
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 { 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
- a as clone,
10
- i as cloneTrait,
11
- p as runtimeFiberAsPromise
12
+ p as onMountedWithCleanup
12
13
  };
@@ -1,7 +1,12 @@
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);
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
- s as isFunction,
5
- i as isObject,
6
- t as isRecordOrArray
9
+ a as clone,
10
+ i as cloneTrait,
11
+ p as runtimeFiberAsPromise
7
12
  };