@effect-app/vue-components 2.7.4 → 2.7.6

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 (42) hide show
  1. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +1 -0
  2. package/dist/vue-components.es.js +12 -11
  3. package/dist/vue-components.es10.js +177 -179
  4. package/dist/vue-components.es12.js +1 -0
  5. package/dist/vue-components.es16.js +1 -1
  6. package/dist/vue-components.es17.js +1 -1
  7. package/dist/vue-components.es2.js +14 -13
  8. package/dist/vue-components.es20.js +2 -2
  9. package/dist/vue-components.es21.js +2 -2
  10. package/dist/vue-components.es22.js +1 -1
  11. package/dist/vue-components.es23.js +1 -1
  12. package/dist/vue-components.es30.js +41 -191
  13. package/dist/vue-components.es31.js +4 -0
  14. package/dist/vue-components.es32.js +2 -42
  15. package/dist/vue-components.es33.js +89 -2
  16. package/dist/vue-components.es35.js +7 -89
  17. package/dist/vue-components.es36.js +34 -0
  18. package/dist/vue-components.es38.js +187 -27
  19. package/dist/vue-components.es40.js +23 -4
  20. package/dist/vue-components.es41.js +5 -23
  21. package/dist/vue-components.es42.js +21 -5
  22. package/dist/vue-components.es43.js +25 -16
  23. package/dist/vue-components.es44.js +15 -23
  24. package/dist/vue-components.es45.js +7 -17
  25. package/dist/vue-components.es46.js +5 -12
  26. package/dist/vue-components.es47.js +19 -5
  27. package/dist/vue-components.es48.js +9 -19
  28. package/dist/vue-components.es49.js +31 -9
  29. package/dist/vue-components.es50.js +42 -25
  30. package/dist/vue-components.es51.js +16 -38
  31. package/dist/vue-components.es52.js +11 -26
  32. package/dist/vue-components.es53.js +4 -11
  33. package/dist/vue-components.es54.js +1 -1
  34. package/dist/vue-components.es56.js +1 -1
  35. package/dist/vue-components.es58.js +3 -3
  36. package/dist/vue-components.es59.js +1 -1
  37. package/dist/vue-components.es7.js +1 -1
  38. package/package.json +1 -1
  39. package/src/components/OmegaForm/OmegaFormStuff.ts +1 -1
  40. package/src/components/OmegaForm/useOmegaForm.ts +17 -57
  41. package/dist/vue-components.es34.js +0 -4
  42. package/dist/vue-components.es37.js +0 -9
@@ -136,6 +136,7 @@ export type CreateMeta = {
136
136
  propertySignatures?: never;
137
137
  property: S.AST.AST;
138
138
  });
139
+ export declare const isNullableOrUndefined: (property: false | S.AST.AST | undefined) => false | "undefined" | "null";
139
140
  export declare const createMeta: <T = any>({ meta, parent, property, propertySignatures }: CreateMeta, acc?: Partial<MetaRecord<T>>) => MetaRecord<T> | FieldMeta;
140
141
  export declare const duplicateSchema: <From, To>(schema: S.Schema<To, From, never>) => S.extend<S.Schema<To, From, never>, S.Struct<{}>>;
141
142
  export declare const generateMetaFromSchema: <From, To>(schema: S.Schema<To, From, never>) => {
@@ -1,14 +1,14 @@
1
1
  import * as o from "./vue-components.es2.js";
2
- import { getTransformationFrom as f, provideIntl as u, useIntl as l, useIntlKey as s } from "./vue-components.es3.js";
2
+ import { getTransformationFrom as f, provideIntl as l, useIntl as u, useIntlKey as s } from "./vue-components.es3.js";
3
3
  import { default as i } from "./vue-components.es4.js";
4
4
  import { default as g } from "./vue-components.es5.js";
5
5
  import { default as I } from "./vue-components.es6.js";
6
6
  import { default as y } from "./vue-components.es7.js";
7
7
  import { default as h } from "./vue-components.es8.js";
8
- import { default as S } from "./vue-components.es9.js";
9
- import { useOmegaForm as b } from "./vue-components.es10.js";
10
- import { useOnClose as U, usePreventClose as j } from "./vue-components.es11.js";
11
- import { createMeta as P, duplicateSchema as k, generateInputStandardSchemaFromFieldMeta as w, generateMetaFromSchema as B, getInputType as D, nullableInput as K } from "./vue-components.es12.js";
8
+ import { default as C } from "./vue-components.es9.js";
9
+ import { useOmegaForm as T } from "./vue-components.es10.js";
10
+ import { useOnClose as M, usePreventClose as j } from "./vue-components.es11.js";
11
+ import { createMeta as P, duplicateSchema as k, generateInputStandardSchemaFromFieldMeta as w, generateMetaFromSchema as B, getInputType as D, isNullableOrUndefined as K, nullableInput as N } from "./vue-components.es12.js";
12
12
  import { createUseFormWithCustomInput as W } from "./vue-components.es13.js";
13
13
  function r(a) {
14
14
  for (const e in o)
@@ -23,7 +23,7 @@ export {
23
23
  g as Dialog,
24
24
  I as OmegaInput,
25
25
  h as OmegaTaggedUnion,
26
- S as OmegaTaggedUnionInternal,
26
+ C as OmegaTaggedUnionInternal,
27
27
  y as OmegaVuetifyInput,
28
28
  P as createMeta,
29
29
  W as createUseFormWithCustomInput,
@@ -33,11 +33,12 @@ export {
33
33
  B as generateMetaFromSchema,
34
34
  D as getInputType,
35
35
  f as getTransformationFrom,
36
- K as nullableInput,
37
- u as provideIntl,
38
- l as useIntl,
36
+ K as isNullableOrUndefined,
37
+ N as nullableInput,
38
+ l as provideIntl,
39
+ u as useIntl,
39
40
  s as useIntlKey,
40
- b as useOmegaForm,
41
- U as useOnClose,
41
+ T as useOmegaForm,
42
+ M as useOnClose,
42
43
  j as usePreventClose
43
44
  };
@@ -1,162 +1,151 @@
1
- import { useForm as Y } from "@tanstack/vue-form";
2
- import { Data as C, S as v, Effect as S, Array as g, Fiber as j, Option as V } from "effect-app";
3
- import { runtimeFiberAsPromise as ee } from "./vue-components.es16.js";
4
- import { isObject as te } from "./vue-components.es17.js";
5
- import { computed as I, onUnmounted as J, onMounted as re, onBeforeUnmount as ne, watch as K, ref as se, h as Z } from "vue";
6
- import oe from "./vue-components.es18.js";
7
- import ie from "./vue-components.es19.js";
8
- import ae from "./vue-components.es20.js";
9
- import { generateMetaFromSchema as le } from "./vue-components.es12.js";
10
- import ce from "./vue-components.es6.js";
11
- import ue from "./vue-components.es8.js";
12
- import fe from "./vue-components.es21.js";
13
- import { trace as z } from "./vue-components.es22.js";
14
- import { context as T } from "./vue-components.es23.js";
15
- const k = (f) => {
16
- const c = f.ast;
17
- if (c._tag === "Union") {
18
- const o = c.types.map((d) => {
19
- const u = v.make(d);
20
- return k(u).ast;
21
- }), p = {
22
- ...c,
1
+ import { useForm as G } from "@tanstack/vue-form";
2
+ import { Data as z, S as p, Effect as b, Array as g, Fiber as O, Option as x } from "effect-app";
3
+ import { runtimeFiberAsPromise as Q } from "./vue-components.es16.js";
4
+ import { isObject as X } from "./vue-components.es17.js";
5
+ import { computed as V, onUnmounted as W, onMounted as Y, onBeforeUnmount as Z, watch as H, ref as C, h as q } from "vue";
6
+ import ee from "./vue-components.es18.js";
7
+ import te from "./vue-components.es19.js";
8
+ import re from "./vue-components.es20.js";
9
+ import { generateMetaFromSchema as ne, isNullableOrUndefined as se } from "./vue-components.es12.js";
10
+ import oe from "./vue-components.es6.js";
11
+ import ie from "./vue-components.es8.js";
12
+ import ae from "./vue-components.es21.js";
13
+ import { trace as J } from "./vue-components.es22.js";
14
+ import { context as L } from "./vue-components.es23.js";
15
+ const _ = (l) => {
16
+ const i = l.ast;
17
+ if (i._tag === "Union") {
18
+ const o = i.types.map((u) => {
19
+ const c = p.make(u);
20
+ return _(c).ast;
21
+ }), m = {
22
+ ...i,
23
23
  types: o
24
24
  };
25
- return v.make(p);
25
+ return p.make(m);
26
26
  }
27
- if (c._tag === "Transformation") {
28
- const o = v.make(c.from), p = v.make(c.to), d = k(o), u = k(p), m = {
29
- ...c,
30
- from: d.ast,
31
- to: u.ast
27
+ if (i._tag === "Transformation") {
28
+ const o = p.make(i.from), m = p.make(i.to), u = _(o), c = _(m), f = {
29
+ ...i,
30
+ from: u.ast,
31
+ to: c.ast
32
32
  };
33
- return v.make(m);
33
+ return p.make(f);
34
34
  }
35
- if (c._tag === "TypeLiteral") {
36
- const o = c.propertySignatures.map((d) => {
37
- const u = d.type;
38
- let m = u;
39
- if (u._tag === "TypeLiteral" || u._tag === "Union" || u._tag === "Transformation") {
40
- const A = v.make(u);
41
- m = k(A).ast;
35
+ if (i._tag === "TypeLiteral") {
36
+ const o = i.propertySignatures.map((u) => {
37
+ const c = u.type;
38
+ let f = c;
39
+ if (c._tag === "TypeLiteral" || c._tag === "Union" || c._tag === "Transformation") {
40
+ const k = p.make(c);
41
+ f = _(k).ast;
42
42
  }
43
43
  return {
44
- ...d,
45
- type: m,
44
+ ...u,
45
+ type: f,
46
46
  isOptional: !0
47
47
  };
48
- }), p = {
49
- ...c,
48
+ }), m = {
49
+ ...i,
50
50
  propertySignatures: o
51
51
  };
52
- return v.make(p);
52
+ return p.make(m);
53
53
  }
54
- return f;
54
+ return l;
55
55
  };
56
- class de extends C.TaggedError("FormErrors") {
56
+ class le extends z.TaggedError("FormErrors") {
57
57
  }
58
- const D = (f) => function(o) {
58
+ const M = (l) => function(o) {
59
59
  return {
60
60
  render() {
61
- return Z(o, {
62
- form: f,
61
+ return q(o, {
62
+ form: l,
63
63
  ...this.$attrs
64
64
  }, this.$slots);
65
65
  }
66
66
  };
67
- }, me = (f) => function(o) {
67
+ }, ce = (l) => function(o) {
68
68
  return {
69
69
  setup() {
70
- const { fieldMap: p, form: d } = f, u = d.useStore((y) => y.errors), m = d.useStore((y) => y.fieldMeta), A = d.useStore((y) => y.errorMap), b = I(() => {
71
- const y = g.filterMap(
72
- Object.entries(m.value),
73
- ([U, h]) => {
74
- const _ = h.errors ?? [];
75
- if (!_.length) return V.none();
76
- const i = p.value.get(U);
77
- return i ? V.some({
78
- label: i.label,
79
- inputId: i.id,
70
+ const { fieldMap: m, form: u } = l, c = u.useStore((S) => S.errors), f = u.useStore((S) => S.fieldMeta), k = u.useStore((S) => S.errorMap), h = V(() => {
71
+ const S = g.filterMap(
72
+ Object.entries(f.value),
73
+ ([U, w]) => {
74
+ const a = w.errors ?? [];
75
+ if (!a.length) return x.none();
76
+ const v = m.value.get(U);
77
+ return v ? x.some({
78
+ label: v.label,
79
+ inputId: v.id,
80
80
  // Only show the first error
81
- errors: [_[0]?.message].filter(Boolean)
82
- }) : V.none();
81
+ errors: [a[0]?.message].filter(Boolean)
82
+ }) : x.none();
83
83
  }
84
84
  ), F = [];
85
- if (A.value.onSubmit) {
86
- for (const [U, h] of Object.entries(A.value.onSubmit))
87
- if (g.isArray(h) && h.length)
88
- for (const _ of h) {
89
- const i = _;
90
- if (i?.path && g.isArray(i.path) && i.path.length) {
91
- const M = i.path.join(".");
92
- if (!p.value.has(M)) {
85
+ if (k.value.onSubmit) {
86
+ for (const [U, w] of Object.entries(k.value.onSubmit))
87
+ if (g.isArray(w) && w.length)
88
+ for (const a of w) {
89
+ const v = a;
90
+ if (v?.path && g.isArray(v.path) && v.path.length) {
91
+ const A = v.path.join(".");
92
+ if (!m.value.has(A)) {
93
93
  F.push({
94
- label: M,
95
- inputId: M,
96
- errors: [i.message].filter(Boolean)
94
+ label: A,
95
+ inputId: A,
96
+ errors: [v.message].filter(Boolean)
97
97
  });
98
98
  break;
99
99
  }
100
100
  }
101
101
  }
102
102
  }
103
- return [...y, ...F];
103
+ return [...S, ...F];
104
104
  });
105
105
  return {
106
- generalErrors: u,
107
- errors: b
106
+ generalErrors: c,
107
+ errors: h
108
108
  };
109
109
  },
110
- render({ errors: p, generalErrors: d }) {
111
- return Z(o, {
112
- errors: p,
113
- generalErrors: d,
110
+ render({ errors: m, generalErrors: u }) {
111
+ return q(o, {
112
+ errors: m,
113
+ generalErrors: u,
114
114
  ...this.$attrs
115
115
  }, this.$slots);
116
116
  }
117
117
  };
118
- }, De = (f, c, o) => {
119
- if (!f) throw new Error("Schema is required");
120
- const p = v.standardSchemaV1(f), d = v.decode(f), { meta: u } = le(f), m = I(() => {
118
+ }, Ae = (l, i, o) => {
119
+ if (!l) throw new Error("Schema is required");
120
+ const m = p.standardSchemaV1(l), u = p.decode(l), { meta: c } = ne(l), f = V(() => {
121
121
  if (o?.persistency?.id)
122
122
  return o.persistency.id;
123
- const e = window.location.pathname, t = Object.keys(u);
123
+ const e = window.location.pathname, t = Object.keys(c);
124
124
  return `${e}-${t.join("-")}`;
125
- }), A = () => {
125
+ }), k = () => {
126
126
  const e = new URLSearchParams(window.location.search);
127
- e.delete(m.value);
127
+ e.delete(f.value);
128
128
  const t = new URL(window.location.href);
129
129
  t.search = e.toString(), window.history.replaceState({}, "", t.toString());
130
130
  };
131
- function b(e, t) {
131
+ function h(e, t) {
132
132
  for (const r in t)
133
- g.isArray(t[r]) ? e[r] = t[r] : t[r] && te(t[r]) ? (e[r] || (e[r] = {}), b(e[r], t[r])) : e[r] = t[r];
133
+ g.isArray(t[r]) ? e[r] = t[r] : t[r] && X(t[r]) ? (e[r] || (e[r] = {}), h(e[r], t[r])) : e[r] = t[r];
134
134
  return e;
135
135
  }
136
- const y = (e) => {
137
- if (!e) return;
138
- const t = { ...e }, r = (s, a) => a.split(".").reduce((l, E) => l?.[E], s), n = (s, a, l) => {
139
- const E = a.split("."), N = E.pop(), X = E.reduce((L, O) => (L[O] || (L[O] = {}), L[O]), s);
140
- X[N] = l;
141
- };
142
- for (const s in u) {
143
- const a = u[s], l = r(t, s), N = (l == null || l === !1 || l === "" || Number.isNaN(l)) && l !== !1 && l !== 0;
144
- a && !a.required && a.nullableOrUndefined && a.type !== "boolean" && (l === void 0 || N) && n(t, s, a.nullableOrUndefined === "undefined" ? void 0 : null);
145
- }
146
- return t;
147
- }, F = (e) => {
136
+ const S = (e) => {
148
137
  const t = {};
149
138
  if (typeof e?.make == "function")
150
139
  try {
151
140
  return e.make({});
152
141
  } catch {
153
142
  }
154
- const r = e?.members || (e?.ast?._tag === "Union" && e.ast.types ? e.ast.types.map((n) => v.make(n)) : null);
143
+ const r = e?.members || (e?.ast?._tag === "Union" && e.ast.types ? e.ast.types.map((n) => p.make(n)) : null);
155
144
  if (r && g.isArray(r)) {
156
145
  for (const n of r) {
157
- const s = F(n);
146
+ const s = S(n);
158
147
  if (Object.keys(s).length > 0 && n?.fields && Object.entries(n.fields).some(
159
- ([l, E]) => l === "_tag" || l === "type" || l === "kind" ? E?.ast?.defaultValue !== void 0 : !1
148
+ ([y, R]) => y === "_tag" || y === "type" || y === "kind" ? R?.ast?.defaultValue !== void 0 : !1
160
149
  ))
161
150
  return s;
162
151
  }
@@ -166,30 +155,41 @@ const D = (f) => function(o) {
166
155
  for (const [n, s] of Object.entries(e.fields)) {
167
156
  if (s?.ast?.defaultValue)
168
157
  try {
169
- const l = s.ast.defaultValue();
170
- l !== void 0 && (t[n] = l);
158
+ const y = s.ast.defaultValue();
159
+ t[n] = y;
171
160
  } catch {
172
161
  }
173
- const a = F(s);
174
- Object.keys(a).length > 0 && (t[n] && typeof t[n] == "object" ? Object.assign(t[n], a) : t[n] || (t[n] = a));
162
+ else {
163
+ const y = s.ast;
164
+ switch (se(y)) {
165
+ case "null":
166
+ t[n] = null;
167
+ break;
168
+ case "undefined":
169
+ t[n] = void 0;
170
+ break;
171
+ }
172
+ }
173
+ const d = S(s);
174
+ Object.keys(d).length > 0 && (t[n] && typeof t[n] == "object" ? Object.assign(t[n], d) : t[n] || (t[n] = d));
175
175
  }
176
176
  return t;
177
- }, U = (e = {}) => {
177
+ }, F = (e = {}) => {
178
178
  let t = {};
179
179
  try {
180
- const r = f.make(e);
181
- t = v.encodeSync(k(f))(r);
180
+ const r = l.make(e);
181
+ t = p.encodeSync(_(l))(r);
182
182
  } catch (r) {
183
183
  window.location.hostname === "localhost" && console.warn("schema.make() failed, extracting defaults from AST:", r);
184
184
  try {
185
- const n = F(f);
186
- t = v.encodeSync(k(f))(n);
185
+ const n = S(l);
186
+ t = p.encodeSync(_(l))(n);
187
187
  } catch (n) {
188
188
  window.location.hostname === "localhost" && console.warn("Could not extract defaults from AST:", n);
189
189
  }
190
190
  }
191
- return b(t, e);
192
- }, h = I(() => {
191
+ return h(t, e);
192
+ }, U = V(() => {
193
193
  let e;
194
194
  const t = o?.persistency;
195
195
  if (
@@ -200,132 +200,130 @@ const D = (f) => function(o) {
200
200
  if (r)
201
201
  try {
202
202
  const n = JSON.parse(
203
- r.getItem(m.value) || "{}"
203
+ r.getItem(f.value) || "{}"
204
204
  );
205
- r.removeItem(m.value), e = n;
205
+ r.removeItem(f.value), e = n;
206
206
  } catch (n) {
207
207
  console.error(n);
208
208
  }
209
209
  }
210
210
  if (t?.policies && t.policies.includes("querystring"))
211
211
  try {
212
- const n = new URLSearchParams(window.location.search).get(m.value);
213
- A(), n && (e = b(e || {}, JSON.parse(n)));
212
+ const n = new URLSearchParams(window.location.search).get(f.value);
213
+ k(), n && (e = h(e || {}, JSON.parse(n)));
214
214
  } catch (r) {
215
215
  console.error(r);
216
216
  }
217
- return e ??= {}, U(
218
- y(
219
- o?.persistency?.overrideDefaultValues ? b(c?.defaultValues || {}, e) : b(e, c?.defaultValues || {})
220
- )
217
+ return e ??= {}, F(
218
+ o?.persistency?.overrideDefaultValues ? h(i?.defaultValues || {}, e) : h(e, i?.defaultValues || {})
221
219
  );
222
- }), _ = (e, t) => e ? T.with(z.setSpan(T.active(), e), t) : t(), i = Y({
223
- ...c,
220
+ }), w = (e, t) => e ? L.with(J.setSpan(L.active(), e), t) : t(), a = G({
221
+ ...i,
224
222
  validators: {
225
- onSubmit: p,
226
- ...c?.validators || {}
223
+ onSubmit: m,
224
+ ...i?.validators || {}
227
225
  },
228
- onSubmit: c?.onSubmit ? ({ formApi: e, meta: t, value: r }) => _(t?.currentSpan, async () => {
229
- const n = await S.runPromise(d(r)), s = c.onSubmit({
226
+ onSubmit: i?.onSubmit ? ({ formApi: e, meta: t, value: r }) => w(t?.currentSpan, async () => {
227
+ const n = await b.runPromise(u(r)), s = i.onSubmit({
230
228
  formApi: e,
231
229
  meta: t,
232
230
  value: n
233
231
  });
234
- return j.isFiber(s) && j.isRuntimeFiber(s) ? await ee(s) : S.isEffect(s) ? await S.runPromise(
232
+ return O.isFiber(s) && O.isRuntimeFiber(s) ? await Q(s) : b.isEffect(s) ? await b.runPromise(
235
233
  s.pipe(
236
234
  // meta?.currentSpan
237
235
  // ? Effect.withParentSpan(meta.currentSpan)
238
236
  // : (_) => _,
239
- S.flatMap((a) => j.join(a))
237
+ b.flatMap((d) => O.join(d))
240
238
  )
241
239
  ) : s;
242
240
  }) : void 0,
243
- defaultValues: h.value
244
- }), M = () => {
245
- Object.keys(u).forEach((e) => {
246
- i.setFieldValue(e, void 0);
241
+ defaultValues: U.value
242
+ }), v = () => {
243
+ Object.keys(c).forEach((e) => {
244
+ a.setFieldValue(e, void 0);
247
245
  });
248
- }, $ = (e) => e.reduce((t, r) => {
246
+ }, A = (e) => e.reduce((t, r) => {
249
247
  const n = r.split(".");
250
- return n.reduce((s, a, l) => (l === n.length - 1 ? s[a] = i.getFieldValue(r) : s[a] = s[a] ?? {}, s[a]), t), t;
251
- }, {}), R = (e) => {
248
+ return n.reduce((s, d, y) => (y === n.length - 1 ? s[d] = a.getFieldValue(r) : s[d] = s[d] ?? {}, s[d]), t), t;
249
+ }, {}), j = (e) => {
252
250
  if (e) {
253
251
  if (g.isArray(e.keys))
254
- return $(e.keys);
252
+ return A(e.keys);
255
253
  if (g.isArray(e.banKeys)) {
256
- const t = Object.keys(u).filter((r) => e.banKeys?.includes(r));
257
- return $(t);
254
+ const t = Object.keys(c).filter((r) => e.banKeys?.includes(r));
255
+ return A(t);
258
256
  }
259
- return i.store.state.values;
257
+ return a.store.state.values;
260
258
  }
261
- }, x = () => {
259
+ }, D = () => {
262
260
  const e = o?.persistency;
263
261
  if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
264
262
  const t = e.policies.includes("local") ? localStorage : sessionStorage;
265
263
  if (!t) return;
266
- const r = R(e);
267
- return t.setItem(m.value, JSON.stringify(r));
264
+ const r = j(e);
265
+ return t.setItem(f.value, JSON.stringify(r));
268
266
  }
269
- }, W = () => {
267
+ }, T = () => {
270
268
  const e = o?.persistency;
271
269
  if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
272
- const t = R(e), r = new URLSearchParams(window.location.search);
273
- r.set(m.value, JSON.stringify(t));
270
+ const t = j(e), r = new URLSearchParams(window.location.search);
271
+ r.set(f.value, JSON.stringify(t));
274
272
  const n = new URL(window.location.href);
275
273
  n.search = r.toString(), window.history.replaceState({}, "", n.toString());
276
274
  }
277
- }, B = (e) => {
278
- i.store.state.isDirty && e.preventDefault();
275
+ }, I = (e) => {
276
+ a.store.state.isDirty && e.preventDefault();
279
277
  };
280
- if (J(x), re(() => {
281
- window.addEventListener("beforeunload", x), window.addEventListener("blur", W), o?.preventWindowExit && o.preventWindowExit !== "nope" && window.addEventListener("beforeunload", B);
282
- }), ne(() => {
283
- window.removeEventListener("beforeunload", x), window.removeEventListener("blur", W), o?.preventWindowExit && o.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", B);
278
+ if (W(D), Y(() => {
279
+ window.addEventListener("beforeunload", D), window.addEventListener("blur", T), o?.preventWindowExit && o.preventWindowExit !== "nope" && window.addEventListener("beforeunload", I);
280
+ }), Z(() => {
281
+ window.removeEventListener("beforeunload", D), window.removeEventListener("blur", T), o?.preventWindowExit && o.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", I);
284
282
  }), o?.preventWindowExit === "prevent-and-reset") {
285
- const e = i.useStore((s) => s.isSubmitting), t = i.useStore((s) => s.submissionAttempts), r = i.useStore((s) => s.canSubmit), n = i.useStore((s) => s.values);
286
- K([e, t], ([s, a], [l]) => {
287
- l && !s && a > 0 && r.value && i.reset(n.value);
283
+ const e = a.useStore((s) => s.isSubmitting), t = a.useStore((s) => s.submissionAttempts), r = a.useStore((s) => s.canSubmit), n = a.useStore((s) => s.values);
284
+ H([e, t], ([s, d], [y]) => {
285
+ y && !s && d > 0 && r.value && a.reset(n.value);
288
286
  });
289
287
  }
290
- const q = (e) => S.currentSpan.pipe(
291
- S.option,
292
- S.flatMap(
293
- (t) => S.promise(() => i.handleSubmit(V.isSome(t) ? { currentSpan: t.value, ...e } : e))
288
+ const $ = (e) => b.currentSpan.pipe(
289
+ b.option,
290
+ b.flatMap(
291
+ (t) => b.promise(() => a.handleSubmit(x.isSome(t) ? { currentSpan: t.value, ...e } : e))
294
292
  )
295
- ), G = (e) => e?.checkErrors ? q(e?.meta).pipe(S.flatMap(S.fnUntraced(function* () {
296
- const t = i.getAllErrors();
293
+ ), B = (e) => e?.checkErrors ? $(e?.meta).pipe(b.flatMap(b.fnUntraced(function* () {
294
+ const t = a.getAllErrors();
297
295
  if (Object.keys(t.fields).length || t.form.errors.length)
298
- return yield* new de({ form: t.form, fields: t.fields });
299
- }))) : q(e?.meta), Q = i.handleSubmit, P = se(/* @__PURE__ */ new Map()), w = Object.assign(i, {
296
+ return yield* new le({ form: t.form, fields: t.fields });
297
+ }))) : $(e?.meta), K = a.handleSubmit, P = C(/* @__PURE__ */ new Map()), E = Object.assign(a, {
300
298
  i18nNamespace: o?.i18nNamespace,
301
299
  ignorePreventCloseEvents: o?.ignorePreventCloseEvents,
302
- meta: u,
303
- clear: M,
300
+ meta: c,
301
+ clear: v,
304
302
  handleSubmit: (e) => {
305
- const t = z.getSpan(T.active());
306
- return Q({ currentSpan: t, ...e });
303
+ const t = J.getSpan(L.active());
304
+ return K({ currentSpan: t, ...e });
307
305
  },
308
306
  // /** @experimental */
309
- handleSubmitEffect: G,
307
+ handleSubmitEffect: B,
310
308
  registerField: (e) => {
311
- K(e, (t) => P.value.set(t.name, { label: t.label, id: t.id }), { immediate: !0 }), J(() => P.value.delete(e.value.name));
309
+ H(e, (t) => P.value.set(t.name, { label: t.label, id: t.id }), { immediate: !0 }), W(() => P.value.delete(e.value.name));
312
310
  }
313
- }), H = { form: w, fieldMap: P };
314
- return Object.assign(w, {
311
+ }), N = { form: E, fieldMap: P };
312
+ return Object.assign(E, {
315
313
  // Type-level properties for performance optimization (not used at runtime)
316
314
  _paths: void 0,
317
315
  _keys: void 0,
318
- errorContext: H,
319
- Form: D(w)(fe),
320
- Input: D(w)(o?.input ?? ce),
321
- TaggedUnion: D(w)(ue),
322
- Field: i.Field,
323
- Errors: me(H)(ae),
324
- Array: D(w)(oe),
325
- AutoGen: D(w)(ie)
316
+ errorContext: N,
317
+ Form: M(E)(ae),
318
+ Input: M(E)(o?.input ?? oe),
319
+ TaggedUnion: M(E)(ie),
320
+ Field: a.Field,
321
+ Errors: ce(N)(re),
322
+ Array: M(E)(ee),
323
+ AutoGen: M(E)(te)
326
324
  });
327
325
  };
328
326
  export {
329
- de as FormErrors,
330
- De as useOmegaForm
327
+ le as FormErrors,
328
+ Ae as useOmegaForm
331
329
  };
@@ -379,5 +379,6 @@ export {
379
379
  F as generateInputStandardSchemaFromFieldMeta,
380
380
  j as generateMetaFromSchema,
381
381
  R as getInputType,
382
+ d as isNullableOrUndefined,
382
383
  D as nullableInput
383
384
  };
@@ -1,5 +1,5 @@
1
1
  import { Exit as c, Runtime as u } from "effect";
2
- import { dual as n, isFunction as m } from "./vue-components.es32.js";
2
+ import { dual as n, isFunction as m } from "./vue-components.es30.js";
3
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
4
  n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
5
5
  const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
@@ -1,4 +1,4 @@
1
- import { isFunction as c } from "./vue-components.es32.js";
1
+ import { isFunction as c } from "./vue-components.es30.js";
2
2
  const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
3
3
  export {
4
4
  s as isFunction,
@@ -1,28 +1,29 @@
1
1
  import { default as a } from "./vue-components.es4.js";
2
2
  import { default as r } from "./vue-components.es5.js";
3
- import { createMeta as n, duplicateSchema as u, generateInputStandardSchemaFromFieldMeta as p, generateMetaFromSchema as f, getInputType as l, nullableInput as d } from "./vue-components.es12.js";
4
- import { useOmegaForm as s } from "./vue-components.es10.js";
5
- import { default as i } from "./vue-components.es6.js";
3
+ import { createMeta as n, duplicateSchema as u, generateInputStandardSchemaFromFieldMeta as f, generateMetaFromSchema as l, getInputType as p, isNullableOrUndefined as d, nullableInput as s } from "./vue-components.es12.js";
4
+ import { useOmegaForm as x } from "./vue-components.es10.js";
5
+ import { default as I } from "./vue-components.es6.js";
6
6
  import { default as c } from "./vue-components.es7.js";
7
- import { default as F } from "./vue-components.es8.js";
8
- import { default as C } from "./vue-components.es9.js";
7
+ import { default as h } from "./vue-components.es8.js";
8
+ import { default as S } from "./vue-components.es9.js";
9
9
  import { useOnClose as M, usePreventClose as T } from "./vue-components.es11.js";
10
10
  import { createUseFormWithCustomInput as y } from "./vue-components.es13.js";
11
11
  export {
12
12
  a as CommandButton,
13
13
  r as Dialog,
14
- i as OmegaInput,
15
- F as OmegaTaggedUnion,
16
- C as OmegaTaggedUnionInternal,
14
+ I as OmegaInput,
15
+ h as OmegaTaggedUnion,
16
+ S as OmegaTaggedUnionInternal,
17
17
  c as OmegaVuetifyInput,
18
18
  n as createMeta,
19
19
  y as createUseFormWithCustomInput,
20
20
  u as duplicateSchema,
21
- p as generateInputStandardSchemaFromFieldMeta,
22
- f as generateMetaFromSchema,
23
- l as getInputType,
24
- d as nullableInput,
25
- s as useOmegaForm,
21
+ f as generateInputStandardSchemaFromFieldMeta,
22
+ l as generateMetaFromSchema,
23
+ p as getInputType,
24
+ d as isNullableOrUndefined,
25
+ s as nullableInput,
26
+ x as useOmegaForm,
26
27
  M as useOnClose,
27
28
  T as usePreventClose
28
29
  };
@@ -1,7 +1,7 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(r,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const d=document.createElement("style");d.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(d)}},e.call(window.customElements,r,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import r from "./vue-components.es35.js";
2
+ import r from "./vue-components.es33.js";
3
3
 
4
- import o from "./vue-components.es37.js";
4
+ import o from "./vue-components.es35.js";
5
5
  const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d4ffe76f"]]);
6
6
  export {
7
7
  e as default