@effect-app/vue-components 4.0.0-beta.3 → 4.0.0-beta.31

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 (102) hide show
  1. package/README.md +24 -0
  2. package/dist/reset.css +51 -0
  3. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +1 -1
  4. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +14 -12
  5. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +2 -4
  6. package/dist/types/utils/index.d.ts +3 -4
  7. package/dist/vue-components.es10.js +131 -129
  8. package/dist/vue-components.es11.js +2 -2
  9. package/dist/vue-components.es12.js +407 -343
  10. package/dist/vue-components.es16.js +4 -723
  11. package/dist/vue-components.es17.js +10 -140
  12. package/dist/vue-components.es18.js +55 -4
  13. package/dist/vue-components.es19.js +54 -11
  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 +192 -2
  26. package/dist/vue-components.es32.js +29 -2
  27. package/dist/vue-components.es33.js +4 -2
  28. package/dist/vue-components.es34.js +2 -17
  29. package/dist/vue-components.es35.js +2 -11
  30. package/dist/vue-components.es36.js +109 -36
  31. package/dist/vue-components.es38.js +7 -83
  32. package/dist/vue-components.es39.js +31 -51
  33. package/dist/vue-components.es41.js +4 -41
  34. package/dist/vue-components.es42.js +22 -26
  35. package/dist/vue-components.es43.js +5 -5
  36. package/dist/vue-components.es44.js +21 -40
  37. package/dist/vue-components.es45.js +27 -311
  38. package/dist/vue-components.es46.js +22 -31
  39. package/dist/vue-components.es47.js +12 -4
  40. package/dist/vue-components.es48.js +5 -24
  41. package/dist/vue-components.es49.js +17 -73
  42. package/dist/vue-components.es5.js +1 -1
  43. package/dist/vue-components.es50.js +9 -99
  44. package/dist/vue-components.es51.js +31 -2
  45. package/dist/vue-components.es52.js +45 -315
  46. package/dist/vue-components.es53.js +26 -64
  47. package/dist/vue-components.es54.js +11 -2
  48. package/dist/vue-components.es55.js +65 -2
  49. package/dist/vue-components.es56.js +55 -110
  50. package/dist/{vue-components.es94.js → vue-components.es57.js} +1 -1
  51. package/dist/vue-components.es58.js +33 -7
  52. package/dist/vue-components.es59.js +29 -32
  53. package/dist/{vue-components.es97.js → vue-components.es60.js} +1 -1
  54. package/dist/vue-components.es61.js +2 -192
  55. package/dist/{vue-components.es99.js → vue-components.es62.js} +1 -1
  56. package/dist/vue-components.es63.js +2 -4
  57. package/dist/vue-components.es7.js +37 -37
  58. package/package.json +16 -12
  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 +425 -323
  62. package/src/components/OmegaForm/OmegaInternalInput.vue +9 -5
  63. package/src/components/OmegaForm/useOmegaForm.ts +30 -32
  64. package/src/reset.css +51 -0
  65. package/src/utils/index.ts +4 -8
  66. package/dist/vue-components.es100.js +0 -4
  67. package/dist/vue-components.es31.js +0 -4
  68. package/dist/vue-components.es37.js +0 -6
  69. package/dist/vue-components.es40.js +0 -563
  70. package/dist/vue-components.es64.js +0 -103
  71. package/dist/vue-components.es65.js +0 -84
  72. package/dist/vue-components.es66.js +0 -17
  73. package/dist/vue-components.es67.js +0 -34
  74. package/dist/vue-components.es68.js +0 -4
  75. package/dist/vue-components.es69.js +0 -23
  76. package/dist/vue-components.es70.js +0 -14
  77. package/dist/vue-components.es71.js +0 -115
  78. package/dist/vue-components.es72.js +0 -5
  79. package/dist/vue-components.es73.js +0 -4
  80. package/dist/vue-components.es74.js +0 -4
  81. package/dist/vue-components.es75.js +0 -17
  82. package/dist/vue-components.es76.js +0 -72
  83. package/dist/vue-components.es77.js +0 -25
  84. package/dist/vue-components.es78.js +0 -7
  85. package/dist/vue-components.es79.js +0 -23
  86. package/dist/vue-components.es80.js +0 -32
  87. package/dist/vue-components.es81.js +0 -24
  88. package/dist/vue-components.es82.js +0 -14
  89. package/dist/vue-components.es83.js +0 -7
  90. package/dist/vue-components.es84.js +0 -21
  91. package/dist/vue-components.es85.js +0 -11
  92. package/dist/vue-components.es86.js +0 -33
  93. package/dist/vue-components.es87.js +0 -50
  94. package/dist/vue-components.es88.js +0 -28
  95. package/dist/vue-components.es89.js +0 -18
  96. package/dist/vue-components.es90.js +0 -10
  97. package/dist/vue-components.es91.js +0 -13
  98. package/dist/vue-components.es92.js +0 -67
  99. package/dist/vue-components.es93.js +0 -58
  100. package/dist/vue-components.es95.js +0 -35
  101. package/dist/vue-components.es96.js +0 -31
  102. package/dist/vue-components.es98.js +0 -4
package/README.md CHANGED
@@ -183,6 +183,30 @@ In [tsconfig.json](tsconfig.js), set the following to address [Issue #32](https:
183
183
  }
184
184
  ```
185
185
 
186
+ ## v4 Breaking Changes (from v3)
187
+
188
+ ### 1. Vuetify 4 CSS Reset Removed
189
+
190
+ Vuetify 4 removed the aggressive global CSS reset that v3 included (universal `margin: 0; padding: 0`, list/heading/input resets, etc.). If your app relied on these defaults, opt in to the supplemental reset:
191
+
192
+ ```ts
193
+ import '@effect-app/vue-components/reset.css'
194
+ ```
195
+
196
+ ### 2. Nested union `_tag` handling
197
+
198
+ `S.TaggedStruct` produces a bare `Literal` AST node, while legacy `S.Struct({ _tag: S.Literal("X") })` produces `Union([Literal("X")])` after `AST.toType`. Both patterns now correctly produce `"select"` metadata thanks to the `unwrapSingleLiteralUnion` helper. A `console.warn` is emitted for the legacy pattern to encourage migration to `TaggedStruct`.
199
+
200
+ ### 3. `UndefinedOr` defaults include the key with explicit `undefined`
201
+
202
+ - **v3**: `defaultsValueFromSchema` skipped keys where the recursive call returned `undefined`, so `UndefinedOr` fields were omitted from the result object entirely.
203
+ - **v4**: The key is present in the result with an explicit `undefined` value.
204
+
205
+ ### 4. `S.optionalKey(X).pipe(S.withDecodingDefault(...))` support
206
+
207
+ - **v3**: Not supported. The v3 equivalent `S.optionalWith` encoded defaults inside a `PropertySignatureTransformation`, opaque to AST inspection.
208
+ - **v4**: `defaultsValueFromSchema` detects `PropertySignatureTransformation` and extracts defaults, enabling `withDecodingDefault` as a new pattern for declaring field defaults directly on the schema.
209
+
186
210
  ### On Submit event
187
211
  The :on-submit event could be tricky in `<OmegaForm />` component.
188
212
  This is a prop that is basically a map of Tanstack Form `onSubmit` option and accept a function that return a Promise. If you want to use it as an event, you have to manage the state of loading yourself with `@submit` with a function returning `void`
package/dist/reset.css ADDED
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Supplemental CSS reset for Vuetify 4.
3
+ * Vuetify 4 removed the aggressive global reset that v3 included.
4
+ * Import this file to restore equivalent behavior:
5
+ * import '@effect-app/vue-components/reset.css'
6
+ */
7
+
8
+ body {
9
+ margin: 0;
10
+ }
11
+
12
+ ul,
13
+ ol {
14
+ margin: 0;
15
+ padding: 0;
16
+ list-style: none;
17
+ }
18
+
19
+ h1,
20
+ h2,
21
+ h3,
22
+ h4,
23
+ h5,
24
+ h6 {
25
+ margin: 0;
26
+ font-size: inherit;
27
+ font-weight: inherit;
28
+ }
29
+
30
+ p {
31
+ margin: 0;
32
+ }
33
+
34
+ input,
35
+ textarea,
36
+ select {
37
+ border: 0;
38
+ background: transparent;
39
+ }
40
+
41
+ a {
42
+ text-decoration: none;
43
+ color: inherit;
44
+ }
45
+
46
+ figure,
47
+ details,
48
+ summary {
49
+ margin: 0;
50
+ padding: 0;
51
+ }
@@ -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 { Fiber as EffectFiber } 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> | EffectFiber<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,15 +109,18 @@ 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";
117
116
  };
117
+ export type DateFieldMeta = BaseFieldMeta & {
118
+ type: "date";
119
+ };
118
120
  export type UnknownFieldMeta = BaseFieldMeta & {
119
121
  type: "unknown";
120
122
  };
121
- export type FieldMeta = StringFieldMeta | NumberFieldMeta | SelectFieldMeta | MultipleFieldMeta | BooleanFieldMeta | UnknownFieldMeta;
123
+ export type FieldMeta = StringFieldMeta | NumberFieldMeta | SelectFieldMeta | MultipleFieldMeta | BooleanFieldMeta | DateFieldMeta | UnknownFieldMeta;
122
124
  export type MetaRecord<T = string> = {
123
125
  [K in NestedKeyOf<T>]?: FieldMeta;
124
126
  };
@@ -133,17 +135,17 @@ export type CreateMeta = {
133
135
  meta?: Record<string, any>;
134
136
  nullableOrUndefined?: false | "undefined" | "null";
135
137
  } & ({
136
- propertySignatures: readonly AST.PropertySignature[];
138
+ propertySignatures: readonly S.AST.PropertySignature[];
137
139
  property?: never;
138
140
  } | {
139
141
  propertySignatures?: never;
140
- property: AST.AST;
142
+ property: S.AST.AST;
141
143
  });
142
- export declare const isNullableOrUndefined: (property: false | AST.AST | undefined) => false | "undefined" | "null";
144
+ export declare const isNullableOrUndefined: (property: false | S.AST.AST | undefined) => false | "undefined" | "null";
143
145
  export declare const createMeta: <T = any>({ meta, parent, property, propertySignatures }: CreateMeta, acc?: Partial<MetaRecord<T>>) => MetaRecord<T> | FieldMeta;
144
146
  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;
147
+ export declare const generateMetaFromSchema: <From, To>(schema: S.Codec<To, From, never>) => {
148
+ schema: S.Codec<To, From, never>;
147
149
  meta: MetaRecord<To>;
148
150
  unionMeta: Record<string, MetaRecord<To>>;
149
151
  };
@@ -153,5 +155,5 @@ declare const supportedInputs: readonly ["button", "checkbox", "color", "date",
153
155
  export type SupportedInputs = typeof supportedInputs[number];
154
156
  export declare const getInputType: (input: string) => SupportedInputs;
155
157
  export declare function deepMerge(target: any, source: any): any;
156
- export declare const defaultsValueFromSchema: (schema: S.Codec<any>, record?: Record<string, any>) => any;
158
+ export declare const defaultsValueFromSchema: (schema: S.Schema<any>, record?: Record<string, any>) => any;
157
159
  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,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;