@effect-app/vue-components 4.0.0-beta.2 → 4.0.0-beta.21

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 (101) hide show
  1. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +1 -1
  2. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +11 -11
  3. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +2 -4
  4. package/dist/types/utils/index.d.ts +3 -4
  5. package/dist/vue-components.es.js +14 -13
  6. package/dist/vue-components.es10.js +131 -129
  7. package/dist/vue-components.es11.js +2 -2
  8. package/dist/vue-components.es12.js +382 -340
  9. package/dist/vue-components.es16.js +4 -723
  10. package/dist/vue-components.es17.js +10 -140
  11. package/dist/vue-components.es18.js +55 -4
  12. package/dist/vue-components.es19.js +54 -11
  13. package/dist/vue-components.es2.js +18 -17
  14. package/dist/vue-components.es20.js +6 -3
  15. package/dist/vue-components.es21.js +6 -24
  16. package/dist/vue-components.es22.js +3 -4
  17. package/dist/vue-components.es23.js +3 -8
  18. package/dist/vue-components.es24.js +2 -55
  19. package/dist/vue-components.es25.js +2 -69
  20. package/dist/vue-components.es26.js +2 -6
  21. package/dist/vue-components.es27.js +2 -6
  22. package/dist/vue-components.es28.js +17 -3
  23. package/dist/vue-components.es29.js +11 -3
  24. package/dist/vue-components.es3.js +11 -10
  25. package/dist/vue-components.es30.js +29 -2
  26. package/dist/vue-components.es31.js +4 -2
  27. package/dist/vue-components.es32.js +1 -1
  28. package/dist/vue-components.es33.js +1 -1
  29. package/dist/vue-components.es34.js +111 -17
  30. package/dist/vue-components.es36.js +7 -318
  31. package/dist/vue-components.es37.js +31 -560
  32. package/dist/vue-components.es39.js +190 -50
  33. package/dist/vue-components.es41.js +4 -4
  34. package/dist/vue-components.es42.js +23 -4
  35. package/dist/vue-components.es43.js +5 -24
  36. package/dist/vue-components.es44.js +20 -74
  37. package/dist/vue-components.es45.js +29 -39
  38. package/dist/vue-components.es46.js +21 -313
  39. package/dist/vue-components.es47.js +11 -98
  40. package/dist/vue-components.es48.js +5 -31
  41. package/dist/vue-components.es49.js +19 -2
  42. package/dist/vue-components.es5.js +1 -1
  43. package/dist/vue-components.es50.js +9 -2
  44. package/dist/vue-components.es51.js +31 -2
  45. package/dist/vue-components.es52.js +47 -110
  46. package/dist/{vue-components.es75.js → vue-components.es53.js} +5 -5
  47. package/dist/vue-components.es54.js +11 -7
  48. package/dist/vue-components.es55.js +64 -31
  49. package/dist/{vue-components.es93.js → vue-components.es56.js} +1 -1
  50. package/dist/vue-components.es57.js +15 -190
  51. package/dist/{vue-components.es95.js → vue-components.es58.js} +3 -3
  52. package/dist/vue-components.es59.js +28 -37
  53. package/dist/vue-components.es60.js +39 -80
  54. package/dist/vue-components.es61.js +2 -41
  55. package/dist/vue-components.es62.js +44 -5
  56. package/dist/vue-components.es63.js +2 -4
  57. package/dist/vue-components.es7.js +35 -35
  58. package/package.json +10 -10
  59. package/src/components/OmegaForm/OmegaAutoGen.vue +25 -30
  60. package/src/components/OmegaForm/OmegaErrorsInternal.vue +2 -3
  61. package/src/components/OmegaForm/OmegaFormStuff.ts +311 -301
  62. package/src/components/OmegaForm/OmegaInternalInput.vue +3 -1
  63. package/src/components/OmegaForm/useOmegaForm.ts +30 -32
  64. package/src/utils/index.ts +4 -8
  65. package/dist/vue-components.es100.js +0 -4
  66. package/dist/vue-components.es35.js +0 -13
  67. package/dist/vue-components.es38.js +0 -29
  68. package/dist/vue-components.es40.js +0 -66
  69. package/dist/vue-components.es64.js +0 -25
  70. package/dist/vue-components.es65.js +0 -7
  71. package/dist/vue-components.es66.js +0 -23
  72. package/dist/vue-components.es67.js +0 -32
  73. package/dist/vue-components.es68.js +0 -24
  74. package/dist/vue-components.es69.js +0 -14
  75. package/dist/vue-components.es70.js +0 -7
  76. package/dist/vue-components.es71.js +0 -21
  77. package/dist/vue-components.es72.js +0 -11
  78. package/dist/vue-components.es73.js +0 -33
  79. package/dist/vue-components.es74.js +0 -50
  80. package/dist/vue-components.es76.js +0 -103
  81. package/dist/vue-components.es77.js +0 -84
  82. package/dist/vue-components.es78.js +0 -23
  83. package/dist/vue-components.es79.js +0 -14
  84. package/dist/vue-components.es80.js +0 -115
  85. package/dist/vue-components.es81.js +0 -5
  86. package/dist/vue-components.es82.js +0 -34
  87. package/dist/vue-components.es83.js +0 -4
  88. package/dist/vue-components.es84.js +0 -4
  89. package/dist/vue-components.es85.js +0 -18
  90. package/dist/vue-components.es86.js +0 -17
  91. package/dist/vue-components.es87.js +0 -72
  92. package/dist/vue-components.es88.js +0 -10
  93. package/dist/vue-components.es89.js +0 -4
  94. package/dist/vue-components.es90.js +0 -17
  95. package/dist/vue-components.es91.js +0 -13
  96. package/dist/vue-components.es92.js +0 -67
  97. package/dist/vue-components.es94.js +0 -19
  98. package/dist/vue-components.es96.js +0 -31
  99. package/dist/vue-components.es97.js +0 -44
  100. package/dist/vue-components.es98.js +0 -4
  101. package/dist/vue-components.es99.js +0 -46
@@ -1,5 +1,5 @@
1
1
  import { type DeepKeys } from "@tanstack/vue-form";
2
- import * as Order from "effect/Order";
2
+ import { Order } from "effect-app";
3
3
  import { type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff";
4
4
  declare const __VLS_export: <// dprint-ignore
5
5
  From extends Record<PropertyKey, string>, To extends Record<PropertyKey, string>, Name extends DeepKeys<From>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -1,7 +1,6 @@
1
- import type * as Effect from "effect/Effect";
2
- import * as AST from "effect/SchemaAST";
1
+ import { Effect, S } from "effect-app";
3
2
  import { type DeepKeys, type DeepValue, type FieldAsyncValidateOrFn, type FieldValidateOrFn, type FormApi, type FormAsyncValidateOrFn, type FormOptions, type FormState, type FormValidateOrFn, type StandardSchemaV1, type VueFormApi } from "@tanstack/vue-form";
4
- import * as S from "effect/Schema";
3
+ import type * as Fiber from "effect/Fiber";
5
4
  import { useIntl } from "../../utils";
6
5
  import { type OmegaFieldInternalApi } from "./InputProps";
7
6
  import { type OF, type OmegaFormReturn } from "./useOmegaForm";
@@ -68,7 +67,7 @@ export type FormProps<From, To> = Omit<FormOptions<From, FormValidateOrFn<From>
68
67
  formApi: OmegaFormParams<From, To>;
69
68
  meta: any;
70
69
  value: To;
71
- }) => Promise<any> | Effect.Effect<unknown, any, never>;
70
+ }) => Promise<any> | Fiber.Fiber<any, any> | Effect.Effect<unknown, any, never>;
72
71
  };
73
72
  export type OmegaFormParams<From, To> = FormApi<From, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, Record<string, any> | undefined>;
74
73
  export type OmegaFormState<From, To> = FormState<From, FormValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, StandardSchemaV1<From, To>, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined, FormAsyncValidateOrFn<From> | undefined>;
@@ -110,7 +109,7 @@ export type SelectFieldMeta = BaseFieldMeta & {
110
109
  export type MultipleFieldMeta = BaseFieldMeta & {
111
110
  type: "multiple";
112
111
  members: any[];
113
- rest: readonly AST.AST[];
112
+ rest: readonly S.AST.AST[];
114
113
  };
115
114
  export type BooleanFieldMeta = BaseFieldMeta & {
116
115
  type: "boolean";
@@ -133,25 +132,26 @@ export type CreateMeta = {
133
132
  meta?: Record<string, any>;
134
133
  nullableOrUndefined?: false | "undefined" | "null";
135
134
  } & ({
136
- propertySignatures: readonly AST.PropertySignature[];
135
+ propertySignatures: readonly S.AST.PropertySignature[];
137
136
  property?: never;
138
137
  } | {
139
138
  propertySignatures?: never;
140
- property: AST.AST;
139
+ property: S.AST.AST;
141
140
  });
142
- export declare const isNullableOrUndefined: (property: false | AST.AST | undefined) => false | "undefined" | "null";
141
+ export declare const isNullableOrUndefined: (property: false | S.AST.AST | undefined) => false | "undefined" | "null";
143
142
  export declare const createMeta: <T = any>({ meta, parent, property, propertySignatures }: CreateMeta, acc?: Partial<MetaRecord<T>>) => MetaRecord<T> | FieldMeta;
144
143
  export declare const duplicateSchema: <From, To>(schema: S.Codec<To, From, never>) => S.Codec<To, From, never, never>;
145
- export declare const generateMetaFromSchema: <_From, To>(schema: any) => {
146
- schema: any;
144
+ export declare const generateMetaFromSchema: <From, To>(schema: S.Codec<To, From, never>) => {
145
+ schema: S.Codec<To, From, never>;
147
146
  meta: MetaRecord<To>;
148
147
  unionMeta: Record<string, MetaRecord<To>>;
149
148
  };
150
149
  export declare const generateInputStandardSchemaFromFieldMeta: (meta: FieldMeta, trans?: ReturnType<typeof useIntl>["trans"]) => StandardSchemaV1<any, any>;
150
+ export declare const nullableInput: <A, I, R>(schema: S.Codec<A, I, R>, _defaultValue: () => A) => any;
151
151
  export type OmegaAutoGenMeta<From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>> = Omit<OmegaInputProps<From, To, Name>, "form">;
152
152
  declare const supportedInputs: readonly ["button", "checkbox", "color", "date", "email", "number", "password", "radio", "range", "search", "submit", "tel", "text", "time", "url"];
153
153
  export type SupportedInputs = typeof supportedInputs[number];
154
154
  export declare const getInputType: (input: string) => SupportedInputs;
155
155
  export declare function deepMerge(target: any, source: any): any;
156
- export declare const defaultsValueFromSchema: (schema: S.Codec<any>, record?: Record<string, any>) => any;
156
+ export declare const defaultsValueFromSchema: (schema: S.Schema<any>, record?: Record<string, any>) => any;
157
157
  export {};
@@ -1,8 +1,6 @@
1
1
  import { type DeepKeys, DeepValue, StandardSchemaV1Issue, ValidationError, ValidationErrorMap } from "@tanstack/vue-form";
2
+ import { Effect, Order, S } from "effect-app";
2
3
  import { UnionToTuples } from "effect-app/utils";
3
- import * as Effect from "effect/Effect";
4
- import * as Order from "effect/Order";
5
- import * as S from "effect/Schema";
6
4
  import { ComputedRef, type InjectionKey } from "vue";
7
5
  import { MergedInputProps } from "./InputProps";
8
6
  import { BaseProps, DefaultTypeProps, FieldPath, type FormProps, type MetaRecord, type NestedKeyOf, OmegaArrayProps, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState } from "./OmegaFormStuff";
@@ -13,7 +11,7 @@ type keysRule<T> = {
13
11
  keys?: "You should only use one of banKeys or keys, not both, moron";
14
12
  banKeys?: NestedKeyOf<T>[];
15
13
  };
16
- declare const FormErrors_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").MatchRecord<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }, void, { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
14
+ declare const FormErrors_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
17
15
  readonly _tag: "FormErrors";
18
16
  } & Readonly<A>;
19
17
  export declare class FormErrors<From> extends FormErrors_base<{
@@ -1,5 +1,5 @@
1
1
  import { type makeIntl } from "@effect-app/vue";
2
- import { type S } from "effect-app";
2
+ import { S } from "effect-app";
3
3
  import { type InjectionKey } from "vue";
4
4
  export declare const useIntlKey: InjectionKey<ReturnType<typeof makeIntl>["useIntl"]>;
5
5
  export declare const useIntl: () => {
@@ -11,10 +11,9 @@ export declare const useIntl: () => {
11
11
  export declare const provideIntl: (intl: ReturnType<typeof makeIntl>["useIntl"]) => void;
12
12
  /**
13
13
  * Recursively extracts the source AST from a transformation chain.
14
- * In v4, transformations are stored in the `encoding` property, not as wrapped AST nodes.
15
- * This function returns the encoded form if an encoding chain exists, otherwise returns the AST itself.
14
+ * If the provided AST is a transformation, it follows the chain to find the original source AST.
16
15
  *
17
16
  * @param ast - The AST node to extract the transformation source from
18
- * @returns The source AST (the decoded/type form, which is the AST itself in v4)
17
+ * @returns The source AST at the end of the transformation chain
19
18
  */
20
19
  export declare function getTransformationFrom(ast: S.AST.AST): S.AST.AST;
@@ -1,15 +1,15 @@
1
1
  import * as o from "./vue-components.es2.js";
2
- import { getTransformationFrom as p, provideIntl as l, useIntl as s, useIntlKey as u } 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 C } from "./vue-components.es9.js";
9
- import { useOmegaForm as T } from "./vue-components.es10.js";
10
- import { useOnClose as b, usePreventClose as j } from "./vue-components.es11.js";
11
- import { createMeta as P, deepMerge as V, defaultsValueFromSchema as k, duplicateSchema as w, generateInputStandardSchemaFromFieldMeta as B, generateMetaFromSchema as D, getInputType as K, isNullableOrUndefined as N } from "./vue-components.es12.js";
12
- import { createUseFormWithCustomInput as $ } from "./vue-components.es13.js";
8
+ import { default as b } from "./vue-components.es9.js";
9
+ import { useOmegaForm as M } from "./vue-components.es10.js";
10
+ import { useOnClose as U, usePreventClose as j } from "./vue-components.es11.js";
11
+ import { createMeta as P, deepMerge as V, defaultsValueFromSchema as k, duplicateSchema as w, generateInputStandardSchemaFromFieldMeta as B, generateMetaFromSchema as D, getInputType as K, isNullableOrUndefined as N, nullableInput as W } from "./vue-components.es12.js";
12
+ import { createUseFormWithCustomInput as q } from "./vue-components.es13.js";
13
13
  function r(a) {
14
14
  for (const e in o)
15
15
  if (Object.prototype.hasOwnProperty.call(o, e)) {
@@ -23,10 +23,10 @@ export {
23
23
  g as Dialog,
24
24
  I as OmegaInput,
25
25
  h as OmegaTaggedUnion,
26
- C as OmegaTaggedUnionInternal,
26
+ b as OmegaTaggedUnionInternal,
27
27
  y as OmegaVuetifyInput,
28
28
  P as createMeta,
29
- $ as createUseFormWithCustomInput,
29
+ q as createUseFormWithCustomInput,
30
30
  V as deepMerge,
31
31
  n as default,
32
32
  k as defaultsValueFromSchema,
@@ -34,12 +34,13 @@ export {
34
34
  B as generateInputStandardSchemaFromFieldMeta,
35
35
  D as generateMetaFromSchema,
36
36
  K as getInputType,
37
- p as getTransformationFrom,
37
+ f as getTransformationFrom,
38
38
  N as isNullableOrUndefined,
39
+ W as nullableInput,
39
40
  l as provideIntl,
40
- s as useIntl,
41
- u as useIntlKey,
42
- T as useOmegaForm,
43
- b as useOnClose,
41
+ u as useIntl,
42
+ s as useIntlKey,
43
+ M as useOmegaForm,
44
+ U as useOnClose,
44
45
  j as usePreventClose
45
46
  };
@@ -1,60 +1,56 @@
1
- import { useForm as J } from "@tanstack/vue-form";
2
- import { runtimeFiberAsPromise as q } from "./vue-components.es19.js";
3
- import { TaggedError as B } from "./vue-components.es20.js";
4
- import { currentSpan as K, runPromise as x, isEffect as T, flatMap as k, fnUntraced as z, option as G, promise as Z } from "./vue-components.es21.js";
5
- import { isFiber as Q } from "./vue-components.es22.js";
6
- import { isSome as X } from "./vue-components.es23.js";
7
- import { toStandardSchemaV1 as Y, decodeEffect as C } from "./vue-components.es17.js";
8
- import { computed as _, onUnmounted as I, onMounted as ee, onBeforeUnmount as re, watch as V, ref as te, h as N } from "vue";
9
- import { useIntl as se } from "./vue-components.es3.js";
10
- import ne from "./vue-components.es24.js";
11
- import oe from "./vue-components.es25.js";
12
- import ie from "./vue-components.es26.js";
13
- import { generateMetaFromSchema as ae, deepMerge as W, defaultsValueFromSchema as ce } from "./vue-components.es12.js";
14
- import le from "./vue-components.es6.js";
15
- import ue from "./vue-components.es8.js";
16
- import de from "./vue-components.es27.js";
17
- import { trace as D } from "./vue-components.es28.js";
18
- import { context as P } from "./vue-components.es29.js";
19
- class me extends B("FormErrors") {
1
+ import { useForm as K } from "@tanstack/vue-form";
2
+ import { Data as T, S as I, Effect as m, Fiber as V, Option as z, Array as P } from "effect-app";
3
+ import { runtimeFiberAsPromise as W } from "./vue-components.es17.js";
4
+ import { computed as $, onUnmounted as D, onMounted as G, onBeforeUnmount as Z, watch as R, ref as Q, h as J } from "vue";
5
+ import { useIntl as X } from "./vue-components.es3.js";
6
+ import Y from "./vue-components.es18.js";
7
+ import C from "./vue-components.es19.js";
8
+ import ee from "./vue-components.es20.js";
9
+ import { generateMetaFromSchema as re, deepMerge as N, defaultsValueFromSchema as te } from "./vue-components.es12.js";
10
+ import se from "./vue-components.es6.js";
11
+ import ne from "./vue-components.es8.js";
12
+ import oe from "./vue-components.es21.js";
13
+ import { trace as H } from "./vue-components.es22.js";
14
+ import { context as _ } from "./vue-components.es23.js";
15
+ class ie extends T.TaggedError("FormErrors") {
20
16
  }
21
- const A = (i) => function(s) {
17
+ const M = (a) => function(s) {
22
18
  return {
23
19
  render() {
24
- return N(s, {
25
- form: i,
20
+ return J(s, {
21
+ form: a,
26
22
  ...this.$attrs
27
23
  }, this.$slots);
28
24
  }
29
25
  };
30
- }, fe = (i) => {
31
- const { formatMessage: l } = se(), s = (a) => a.replace(/([A-Z])/g, " $1").replace(/^./, (g) => g.toUpperCase()).trim(), m = (a) => l ? l({ id: `general.fields.${a}`, defaultMessage: s(a) }) : s(a);
32
- return (a) => i.i18nNamespace ? l({ id: `${i.i18nNamespace}.fields.${a}`, defaultMessage: m(a) }) : m(a);
33
- }, pe = (i) => function(s) {
26
+ }, ae = (a) => {
27
+ const { formatMessage: l } = X(), s = (c) => c.replace(/([A-Z])/g, " $1").replace(/^./, (F) => F.toUpperCase()).trim(), p = (c) => l ? l({ id: `general.fields.${c}`, defaultMessage: s(c) }) : s(c);
28
+ return (c) => a.i18nNamespace ? l({ id: `${a.i18nNamespace}.fields.${c}`, defaultMessage: p(c) }) : p(c);
29
+ }, ce = (a) => function(s) {
34
30
  return {
35
31
  setup() {
36
- const { fieldMap: m, form: f } = i, a = f.useStore((v) => v.errors), g = f.useStore((v) => v.fieldMeta), p = f.useStore((v) => v.errorMap), M = fe(f), L = _(() => {
37
- const v = Object.entries(g.value).reduce((b, [h, y]) => {
38
- const u = y?.errors ?? [];
32
+ const { fieldMap: p, form: v } = a, c = v.useStore((S) => S.errors), F = v.useStore((S) => S.fieldMeta), h = v.useStore((S) => S.errorMap), A = ae(v), L = $(() => {
33
+ const S = Object.entries(F.value).reduce((y, [w, g]) => {
34
+ const u = g?.errors ?? [];
39
35
  if (!u.length)
40
- return b;
41
- const d = m.value.get(h);
42
- return d && b.push({
36
+ return y;
37
+ const d = p.value.get(w);
38
+ return d && y.push({
43
39
  label: d.label,
44
40
  inputId: d.id,
45
41
  errors: [u[0]?.message].filter(Boolean)
46
- }), b;
42
+ }), y;
47
43
  }, []), o = [];
48
- if (p.value.onSubmit) {
49
- for (const [b, h] of Object.entries(p.value.onSubmit))
50
- if (Array.isArray(h) && h.length)
51
- for (const y of h) {
52
- const u = y;
53
- if (u?.path && Array.isArray(u.path) && u.path.length) {
44
+ if (h.value.onSubmit) {
45
+ for (const [y, w] of Object.entries(h.value.onSubmit))
46
+ if (P.isArray(w) && w.length)
47
+ for (const g of w) {
48
+ const u = g;
49
+ if (u?.path && P.isArray(u.path) && u.path.length) {
54
50
  const d = u.path.join(".");
55
- if (!m.value.has(d)) {
51
+ if (!p.value.has(d)) {
56
52
  o.push({
57
- label: M(d),
53
+ label: A(d),
58
54
  inputId: d,
59
55
  errors: [u.message].filter(Boolean)
60
56
  });
@@ -63,175 +59,181 @@ const A = (i) => function(s) {
63
59
  }
64
60
  }
65
61
  }
66
- return [...v, ...o];
62
+ return [...S, ...o];
67
63
  });
68
64
  return {
69
- generalErrors: a,
65
+ generalErrors: c,
70
66
  errors: L
71
67
  };
72
68
  },
73
- render({ errors: m, generalErrors: f }) {
74
- return N(s, {
75
- errors: m,
76
- generalErrors: f,
69
+ render({ errors: p, generalErrors: v }) {
70
+ return J(s, {
71
+ errors: p,
72
+ generalErrors: v,
77
73
  ...this.$attrs
78
74
  }, this.$slots);
79
75
  }
80
76
  };
81
- }, S = (i, l) => i.includes(l), xe = (i, l, s) => {
82
- if (!i) throw new Error("Schema is required");
83
- const m = Y(i), f = C(i), { meta: a, unionMeta: g } = ae(i), p = _(() => {
77
+ }, b = (a, l) => a.includes(l), Fe = (a, l, s) => {
78
+ if (!a) throw new Error("Schema is required");
79
+ const p = I.toStandardSchemaV1(a), v = I.decodeUnknownEffect(a), { meta: c, unionMeta: F } = re(a), h = $(() => {
84
80
  if (s?.persistency?.id)
85
81
  return s.persistency.id;
86
- const e = window.location.pathname, r = Object.keys(a);
82
+ const e = window.location.pathname, r = Object.keys(c);
87
83
  return `${e}-${r.join("-")}`;
88
- }), M = () => {
84
+ }), A = () => {
89
85
  const e = new URLSearchParams(window.location.search);
90
- e.delete(p.value);
86
+ e.delete(h.value);
91
87
  const r = new URL(window.location.href);
92
88
  r.search = e.toString(), window.history.replaceState({}, "", r.toString());
93
- }, L = _(() => {
89
+ }, L = $(() => {
94
90
  let e;
95
91
  const r = s?.persistency;
96
92
  if (
97
93
  // query string has higher priority than local/session storage
98
- r?.policies && !e && (S(r.policies, "local") || S(r.policies, "session"))
94
+ r?.policies && !e && (b(r.policies, "local") || b(r.policies, "session"))
99
95
  ) {
100
- const n = S(r.policies, "local") ? localStorage : sessionStorage;
96
+ const n = b(r.policies, "local") ? localStorage : sessionStorage;
101
97
  if (n)
102
98
  try {
103
99
  const t = JSON.parse(
104
- n.getItem(p.value) || "{}"
100
+ n.getItem(h.value) || "{}"
105
101
  );
106
- n.removeItem(p.value), e = t;
102
+ n.removeItem(h.value), e = t;
107
103
  } catch (t) {
108
104
  console.error(t);
109
105
  }
110
106
  }
111
- if (r?.policies && S(r.policies, "querystring"))
107
+ if (r?.policies && b(r.policies, "querystring"))
112
108
  try {
113
- const t = new URLSearchParams(window.location.search).get(p.value);
114
- M(), t && (e = W(e || {}, JSON.parse(t)));
109
+ const t = new URLSearchParams(window.location.search).get(h.value);
110
+ A(), t && (e = N(e || {}, JSON.parse(t)));
115
111
  } catch (n) {
116
112
  console.error(n);
117
113
  }
118
114
  e ??= {};
119
- const c = {
115
+ const i = {
120
116
  tanstack: l?.defaultValues || {},
121
117
  persistency: e,
122
- schema: ce(i)
118
+ schema: te(a)
123
119
  };
124
120
  return (s?.defaultValuesPriority || ["tanstack", "persistency", "schema"]).reverse().reduce(
125
- (n, t) => Object.keys(n).length ? W(n, c[t]) : c[t],
121
+ (n, t) => Object.keys(n).length ? N(n, i[t]) : i[t],
126
122
  {}
127
123
  );
128
- }), v = (e, r) => e ? P.with(D.setSpan(P.active(), e), r) : r(), o = J({
124
+ }), S = (e, r) => e ? _.with(H.setSpan(_.active(), e), r) : r(), o = K({
129
125
  ...l,
130
126
  validators: {
131
- onSubmit: m,
127
+ onSubmit: p,
132
128
  ...l?.validators || {}
133
129
  },
134
- onSubmit: l?.onSubmit ? ({ formApi: e, meta: r, value: c }) => v(r?.currentSpan, async () => {
135
- const n = await x(f(c)), t = l.onSubmit({
130
+ onSubmit: l?.onSubmit ? ({ formApi: e, meta: r, value: i }) => S(r?.currentSpan, async () => {
131
+ const n = await m.runPromise(v(i)), t = l.onSubmit({
136
132
  formApi: e,
137
133
  meta: r,
138
134
  value: n
139
135
  });
140
- return Q(t) ? await q(t) : T(t) ? await x(t) : t;
136
+ if (V.isFiber(t))
137
+ return await W(t);
138
+ if (m.isEffect(t)) {
139
+ const f = await m.runPromise(t);
140
+ return V.isFiber(f) ? await W(f) : f;
141
+ }
142
+ return t;
141
143
  }) : void 0,
142
144
  defaultValues: L.value
143
- }), b = () => {
144
- Object.keys(a).forEach((e) => {
145
+ }), y = () => {
146
+ Object.keys(c).forEach((e) => {
145
147
  o.setFieldValue(e, void 0);
146
148
  });
147
- }, h = (e) => e.reduce((r, c) => {
148
- const n = c.split(".");
149
- return n.reduce((t, E, O) => (O === n.length - 1 ? t[E] = o.getFieldValue(c) : t[E] = t[E] ?? {}, t[E]), r), r;
150
- }, {}), y = (e) => {
151
- if (e) {
152
- if (Array.isArray(e.keys))
153
- return h(e.keys);
154
- if (Array.isArray(e.banKeys)) {
155
- const r = Object.keys(a).filter((c) => e.banKeys?.includes(c));
156
- return h(r);
157
- }
158
- return o.store.state.values;
149
+ }, w = (e) => e.reduce((r, i) => {
150
+ const n = i.split(".");
151
+ return n.reduce((t, f, U) => (U === n.length - 1 ? t[f] = o.getFieldValue(i) : t[f] = t[f] ?? {}, t[f]), r), r;
152
+ }, {}), g = (e) => {
153
+ if (!e) return;
154
+ const { banKeys: r, keys: i } = e;
155
+ if (P.isArray(i))
156
+ return w(i);
157
+ if (P.isArray(r)) {
158
+ const n = Object.keys(c).filter((t) => r.includes(t));
159
+ return w(n);
159
160
  }
161
+ return o.store.state.values;
160
162
  }, u = () => {
161
163
  const e = s?.persistency;
162
- if (!(!e?.policies || e.policies.length === 0) && (S(e.policies, "local") || S(e.policies, "session"))) {
163
- const r = S(e.policies, "local") ? localStorage : sessionStorage;
164
+ if (!(!e?.policies || e.policies.length === 0) && (b(e.policies, "local") || b(e.policies, "session"))) {
165
+ const r = b(e.policies, "local") ? localStorage : sessionStorage;
164
166
  if (!r) return;
165
- const c = y(e);
166
- return r.setItem(p.value, JSON.stringify(c));
167
+ const i = g(e);
168
+ return r.setItem(h.value, JSON.stringify(i));
167
169
  }
168
170
  }, d = () => {
169
171
  const e = s?.persistency;
170
- if (!(!e?.policies || e.policies.length === 0) && S(e.policies, "querystring")) {
171
- const r = y(e), c = new URLSearchParams(window.location.search);
172
- c.set(p.value, JSON.stringify(r));
172
+ if (!(!e?.policies || e.policies.length === 0) && b(e.policies, "querystring")) {
173
+ const r = g(e), i = new URLSearchParams(window.location.search);
174
+ i.set(h.value, JSON.stringify(r));
173
175
  const n = new URL(window.location.href);
174
- n.search = c.toString(), window.history.replaceState({}, "", n.toString());
176
+ n.search = i.toString(), window.history.replaceState({}, "", n.toString());
175
177
  }
176
- }, $ = (e) => {
178
+ }, j = (e) => {
177
179
  o.store.state.isDirty && e.preventDefault();
178
180
  };
179
- if (I(u), ee(() => {
180
- window.addEventListener("beforeunload", u), window.addEventListener("blur", d), s?.preventWindowExit && s.preventWindowExit !== "nope" && window.addEventListener("beforeunload", $);
181
- }), re(() => {
182
- window.removeEventListener("beforeunload", u), window.removeEventListener("blur", d), s?.preventWindowExit && s.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", $);
181
+ if (D(u), G(() => {
182
+ window.addEventListener("beforeunload", u), window.addEventListener("blur", d), s?.preventWindowExit && s.preventWindowExit !== "nope" && window.addEventListener("beforeunload", j);
183
+ }), Z(() => {
184
+ window.removeEventListener("beforeunload", u), window.removeEventListener("blur", d), s?.preventWindowExit && s.preventWindowExit !== "nope" && window.removeEventListener("beforeunload", j);
183
185
  }), s?.preventWindowExit === "prevent-and-reset") {
184
- const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts), c = o.useStore((t) => t.canSubmit), n = o.useStore((t) => t.values);
185
- V([e, r], ([t, E], [O]) => {
186
- O && !t && E > 0 && c.value && o.reset(n.value);
186
+ const e = o.useStore((t) => t.isSubmitting), r = o.useStore((t) => t.submissionAttempts), i = o.useStore((t) => t.canSubmit), n = o.useStore((t) => t.values);
187
+ R([e, r], ([t, f], [U]) => {
188
+ U && !t && f > 0 && i.value && o.reset(n.value);
187
189
  });
188
190
  }
189
- const j = (e) => K.pipe(
190
- G,
191
- k(
192
- (r) => Z(() => o.handleSubmit(X(r) ? { currentSpan: r.value, ...e } : e))
191
+ const x = (e) => m.currentSpan.pipe(
192
+ m.option,
193
+ m.flatMap(
194
+ (r) => m.promise(() => o.handleSubmit(z.isSome(r) ? { currentSpan: r.value, ...e } : e))
193
195
  )
194
- ), R = (e) => e?.checkErrors ? j(e?.meta).pipe(k(z(function* () {
196
+ ), q = (e) => e?.checkErrors ? x(e?.meta).pipe(m.flatMap(m.fnUntraced(function* () {
195
197
  const r = o.getAllErrors();
196
198
  if (Object.keys(r.fields).length || r.form.errors.length)
197
- return yield* new me({ form: r.form, fields: r.fields });
198
- }))) : j(e?.meta), H = o.handleSubmit, F = te(/* @__PURE__ */ new Map()), w = Object.assign(o, {
199
+ return yield* m.fail(new ie({ form: r.form, fields: r.fields }));
200
+ }))) : x(e?.meta), B = o.handleSubmit, O = Q(/* @__PURE__ */ new Map()), E = Object.assign(o, {
199
201
  i18nNamespace: s?.i18nNamespace,
200
202
  ignorePreventCloseEvents: s?.ignorePreventCloseEvents,
201
- meta: a,
202
- unionMeta: g,
203
- clear: b,
203
+ meta: c,
204
+ unionMeta: F,
205
+ clear: y,
204
206
  handleSubmit: (e) => {
205
- const r = D.getSpan(P.active());
206
- return H({ currentSpan: r, ...e });
207
+ const r = H.getSpan(_.active());
208
+ return B({ currentSpan: r, ...e });
207
209
  },
208
210
  // /** @experimental */
209
- handleSubmitEffect: R,
211
+ handleSubmitEffect: q,
210
212
  registerField: (e) => {
211
- V(e, (r) => {
212
- F.value.set(r.name, { label: r.label, id: r.id });
213
- }, { immediate: !0 }), I(() => {
214
- F.value.get(e.value.name)?.id === e.value.id && F.value.delete(e.value.name);
213
+ R(e, (r) => {
214
+ O.value.set(r.name, { label: r.label, id: r.id });
215
+ }, { immediate: !0 }), D(() => {
216
+ O.value.get(e.value.name)?.id === e.value.id && O.value.delete(e.value.name);
215
217
  });
216
218
  }
217
- }), U = { form: w, fieldMap: F };
218
- return Object.assign(w, {
219
+ }), k = { form: E, fieldMap: O };
220
+ return Object.assign(E, {
219
221
  // Type-level properties for performance optimization (not used at runtime)
220
222
  _paths: void 0,
221
223
  _keys: void 0,
222
- _schema: i,
223
- errorContext: U,
224
- Form: A(w)(de),
225
- Input: A(w)(s?.input ?? le),
226
- TaggedUnion: A(w)(ue),
224
+ _schema: a,
225
+ errorContext: k,
226
+ Form: M(E)(oe),
227
+ Input: M(E)(s?.input ?? se),
228
+ TaggedUnion: M(E)(ne),
227
229
  Field: o.Field,
228
- Errors: pe(U)(ie),
229
- Array: A(w)(ne),
230
- AutoGen: A(w)(oe)
230
+ Errors: ce(k)(ee),
231
+ Array: M(E)(Y),
232
+ AutoGen: M(E)(C)
231
233
  });
232
234
  };
233
235
  export {
234
- me as FormErrors,
235
- fe as useErrorLabel,
236
- xe as useOmegaForm
236
+ ie as FormErrors,
237
+ ae as useErrorLabel,
238
+ Fe as useOmegaForm
237
239
  };
@@ -1,6 +1,6 @@
1
- import l from "./vue-components.es34.js";
1
+ import l from "./vue-components.es28.js";
2
2
  import { inject as c, provide as u } from "vue";
3
- import { onMountedWithCleanup as f } from "./vue-components.es35.js";
3
+ import { onMountedWithCleanup as f } from "./vue-components.es29.js";
4
4
  const p = () => l(), i = /* @__PURE__ */ Symbol("DialogBus"), r = () => c(i, null), g = () => {
5
5
  const n = p();
6
6
  return u(i, n), n;