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

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 (208) hide show
  1. package/README.md +13 -9
  2. package/dist/reset.css +39 -38
  3. package/dist/types/components/CommandButton.vue.d.ts +24 -5
  4. package/dist/types/components/Dialog.vue.d.ts +3 -1
  5. package/dist/types/components/FixedNuxtErrorBoundary.vue.d.ts +39 -0
  6. package/dist/types/components/OmegaForm/InputProps.d.ts +1 -1
  7. package/dist/types/components/OmegaForm/OmegaArray.vue.d.ts +1 -1
  8. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +2 -2
  9. package/dist/types/components/OmegaForm/OmegaErrorsInternal.vue.d.ts +1 -1
  10. package/dist/types/components/OmegaForm/OmegaFormInput.vue.d.ts +1 -1
  11. package/dist/types/components/OmegaForm/OmegaInput.vue.d.ts +1 -1
  12. package/dist/types/components/OmegaForm/OmegaInputVuetify.vue.d.ts +6 -0
  13. package/dist/types/components/OmegaForm/OmegaInternalInput.vue.d.ts +6 -9
  14. package/dist/types/components/OmegaForm/OmegaTaggedUnion.vue.d.ts +2 -2
  15. package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +3 -3
  16. package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +1 -1
  17. package/dist/types/components/OmegaForm/createUseFormWithCustomInput.d.ts +4 -2
  18. package/dist/types/components/OmegaForm/errors.d.ts +33 -0
  19. package/dist/types/components/OmegaForm/getOmegaStore.d.ts +1 -1
  20. package/dist/types/components/OmegaForm/hocs.d.ts +3 -0
  21. package/dist/types/components/OmegaForm/index.d.ts +14 -3
  22. package/dist/types/components/OmegaForm/inputs.d.ts +4 -0
  23. package/dist/types/components/OmegaForm/meta/checks.d.ts +4 -0
  24. package/dist/types/components/OmegaForm/meta/createMeta.d.ts +33 -0
  25. package/dist/types/components/OmegaForm/meta/defaults.d.ts +21 -0
  26. package/dist/types/components/OmegaForm/meta/redacted.d.ts +2 -0
  27. package/dist/types/components/OmegaForm/meta/types.d.ts +56 -0
  28. package/dist/types/components/OmegaForm/meta/walker.d.ts +18 -0
  29. package/dist/types/components/OmegaForm/persistency.d.ts +58 -0
  30. package/dist/types/components/OmegaForm/submit.d.ts +60 -0
  31. package/dist/types/components/OmegaForm/types.d.ts +312 -0
  32. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +9 -213
  33. package/dist/types/components/OmegaForm/validation/localized.d.ts +10 -0
  34. package/dist/types/components/index.d.ts +1 -0
  35. package/dist/types/index.d.ts +0 -1
  36. package/dist/types/utils/index.d.ts +8 -8
  37. package/dist/vue-components.es.js +30 -44
  38. package/dist/vue-components10.es.js +5 -0
  39. package/dist/vue-components11.es.js +56 -0
  40. package/dist/vue-components12.es.js +5 -0
  41. package/dist/vue-components13.es.js +20 -0
  42. package/dist/vue-components14.es.js +50 -0
  43. package/dist/vue-components15.es.js +128 -0
  44. package/dist/vue-components16.es.js +65 -0
  45. package/dist/vue-components17.es.js +114 -0
  46. package/dist/vue-components18.es.js +26 -0
  47. package/dist/vue-components19.es.js +5 -0
  48. package/dist/vue-components2.es.js +11 -0
  49. package/dist/vue-components20.es.js +80 -0
  50. package/dist/vue-components21.es.js +105 -0
  51. package/dist/vue-components22.es.js +73 -0
  52. package/dist/vue-components23.es.js +12 -0
  53. package/dist/vue-components24.es.js +57 -0
  54. package/dist/vue-components25.es.js +5 -0
  55. package/dist/vue-components26.es.js +44 -0
  56. package/dist/vue-components27.es.js +5 -0
  57. package/dist/vue-components28.es.js +84 -0
  58. package/dist/vue-components3.es.js +98 -0
  59. package/dist/vue-components30.es.js +8 -0
  60. package/dist/vue-components31.es.js +9 -0
  61. package/dist/vue-components32.es.js +24 -0
  62. package/dist/vue-components33.es.js +300 -0
  63. package/dist/vue-components35.es.js +8 -0
  64. package/dist/vue-components36.es.js +73 -0
  65. package/dist/vue-components37.es.js +5 -0
  66. package/dist/vue-components38.es.js +64 -0
  67. package/dist/vue-components39.es.js +5 -0
  68. package/dist/vue-components4.es.js +5 -0
  69. package/dist/vue-components40.es.js +24 -0
  70. package/dist/vue-components41.es.js +5 -0
  71. package/dist/vue-components42.es.js +59 -0
  72. package/dist/vue-components43.es.js +5 -0
  73. package/dist/vue-components44.es.js +12 -0
  74. package/dist/vue-components45.es.js +22 -0
  75. package/dist/vue-components47.es.js +9 -0
  76. package/dist/vue-components48.es.js +4 -0
  77. package/dist/vue-components49.es.js +38 -0
  78. package/dist/vue-components5.es.js +24 -0
  79. package/dist/vue-components50.es.js +27 -0
  80. package/dist/vue-components51.es.js +28 -0
  81. package/dist/vue-components52.es.js +7 -0
  82. package/dist/vue-components53.es.js +18 -0
  83. package/dist/vue-components54.es.js +36 -0
  84. package/dist/vue-components55.es.js +18 -0
  85. package/dist/vue-components56.es.js +21 -0
  86. package/dist/vue-components57.es.js +30 -0
  87. package/dist/vue-components58.es.js +7 -0
  88. package/dist/vue-components59.es.js +9 -0
  89. package/dist/vue-components6.es.js +13 -0
  90. package/dist/vue-components60.es.js +38 -0
  91. package/dist/vue-components61.es.js +25 -0
  92. package/dist/vue-components62.es.js +128 -0
  93. package/dist/vue-components63.es.js +24 -0
  94. package/dist/vue-components64.es.js +21 -0
  95. package/dist/vue-components65.es.js +9 -0
  96. package/dist/vue-components66.es.js +19 -0
  97. package/dist/vue-components67.es.js +5 -0
  98. package/dist/vue-components68.es.js +29 -0
  99. package/dist/vue-components69.es.js +5 -0
  100. package/dist/vue-components7.es.js +13 -0
  101. package/dist/vue-components70.es.js +43 -0
  102. package/dist/vue-components71.es.js +101 -0
  103. package/dist/vue-components72.es.js +36 -0
  104. package/dist/vue-components73.es.js +19 -0
  105. package/dist/vue-components74.es.js +50 -0
  106. package/dist/vue-components8.es.js +35 -0
  107. package/dist/vue-components9.es.js +47 -0
  108. package/package.json +39 -33
  109. package/src/components/CommandButton.vue +96 -16
  110. package/src/components/Dialog.vue +0 -1
  111. package/src/components/FixedNuxtErrorBoundary.vue +112 -0
  112. package/src/components/OmegaForm/InputProps.ts +1 -1
  113. package/src/components/OmegaForm/OmegaArray.vue +8 -9
  114. package/src/components/OmegaForm/OmegaAutoGen.vue +3 -2
  115. package/src/components/OmegaForm/OmegaErrorsInternal.vue +1 -1
  116. package/src/components/OmegaForm/OmegaFormInput.vue +1 -1
  117. package/src/components/OmegaForm/OmegaInput.vue +26 -40
  118. package/src/components/OmegaForm/OmegaInputVuetify.vue +58 -8
  119. package/src/components/OmegaForm/OmegaInternalInput.vue +32 -13
  120. package/src/components/OmegaForm/OmegaTaggedUnion.vue +10 -3
  121. package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +6 -6
  122. package/src/components/OmegaForm/OmegaWrapper.vue +1 -1
  123. package/src/components/OmegaForm/blockDialog.ts +18 -6
  124. package/src/components/OmegaForm/createUseFormWithCustomInput.ts +16 -14
  125. package/src/components/OmegaForm/errors.ts +136 -0
  126. package/src/components/OmegaForm/getOmegaStore.ts +1 -1
  127. package/src/components/OmegaForm/hocs.ts +19 -0
  128. package/src/components/OmegaForm/index.ts +17 -4
  129. package/src/components/OmegaForm/inputs.ts +22 -0
  130. package/src/components/OmegaForm/meta/checks.ts +104 -0
  131. package/src/components/OmegaForm/meta/createMeta.ts +140 -0
  132. package/src/components/OmegaForm/meta/defaults.ts +263 -0
  133. package/src/components/OmegaForm/meta/redacted.ts +71 -0
  134. package/src/components/OmegaForm/meta/types.ts +78 -0
  135. package/src/components/OmegaForm/meta/walker.ts +248 -0
  136. package/src/components/OmegaForm/persistency.ts +247 -0
  137. package/src/components/OmegaForm/submit.ts +131 -0
  138. package/src/components/OmegaForm/types.ts +801 -0
  139. package/src/components/OmegaForm/useOmegaForm.ts +103 -896
  140. package/src/components/OmegaForm/useRegisterField.ts +1 -1
  141. package/src/components/OmegaForm/validation/localized.ts +227 -0
  142. package/src/components/index.ts +1 -0
  143. package/src/index.ts +0 -1
  144. package/src/reset.css +39 -38
  145. package/src/utils/index.ts +11 -8
  146. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +0 -159
  147. package/dist/types/constants/index.d.ts +0 -1
  148. package/dist/vue-components.es10.js +0 -239
  149. package/dist/vue-components.es11.js +0 -32
  150. package/dist/vue-components.es12.js +0 -503
  151. package/dist/vue-components.es13.js +0 -49
  152. package/dist/vue-components.es14.js +0 -4
  153. package/dist/vue-components.es15.js +0 -4
  154. package/dist/vue-components.es16.js +0 -6
  155. package/dist/vue-components.es17.js +0 -13
  156. package/dist/vue-components.es18.js +0 -57
  157. package/dist/vue-components.es19.js +0 -56
  158. package/dist/vue-components.es2.js +0 -30
  159. package/dist/vue-components.es20.js +0 -8
  160. package/dist/vue-components.es21.js +0 -8
  161. package/dist/vue-components.es22.js +0 -5
  162. package/dist/vue-components.es23.js +0 -5
  163. package/dist/vue-components.es24.js +0 -4
  164. package/dist/vue-components.es25.js +0 -4
  165. package/dist/vue-components.es26.js +0 -4
  166. package/dist/vue-components.es27.js +0 -4
  167. package/dist/vue-components.es28.js +0 -19
  168. package/dist/vue-components.es29.js +0 -13
  169. package/dist/vue-components.es3.js +0 -17
  170. package/dist/vue-components.es30.js +0 -194
  171. package/dist/vue-components.es32.js +0 -31
  172. package/dist/vue-components.es33.js +0 -6
  173. package/dist/vue-components.es34.js +0 -4
  174. package/dist/vue-components.es35.js +0 -4
  175. package/dist/vue-components.es36.js +0 -113
  176. package/dist/vue-components.es38.js +0 -9
  177. package/dist/vue-components.es39.js +0 -34
  178. package/dist/vue-components.es4.js +0 -52
  179. package/dist/vue-components.es41.js +0 -6
  180. package/dist/vue-components.es42.js +0 -25
  181. package/dist/vue-components.es43.js +0 -7
  182. package/dist/vue-components.es44.js +0 -23
  183. package/dist/vue-components.es45.js +0 -32
  184. package/dist/vue-components.es46.js +0 -24
  185. package/dist/vue-components.es47.js +0 -14
  186. package/dist/vue-components.es48.js +0 -7
  187. package/dist/vue-components.es49.js +0 -21
  188. package/dist/vue-components.es5.js +0 -52
  189. package/dist/vue-components.es50.js +0 -11
  190. package/dist/vue-components.es51.js +0 -33
  191. package/dist/vue-components.es52.js +0 -50
  192. package/dist/vue-components.es53.js +0 -28
  193. package/dist/vue-components.es54.js +0 -13
  194. package/dist/vue-components.es55.js +0 -67
  195. package/dist/vue-components.es56.js +0 -58
  196. package/dist/vue-components.es57.js +0 -19
  197. package/dist/vue-components.es58.js +0 -35
  198. package/dist/vue-components.es59.js +0 -31
  199. package/dist/vue-components.es6.js +0 -69
  200. package/dist/vue-components.es60.js +0 -44
  201. package/dist/vue-components.es61.js +0 -4
  202. package/dist/vue-components.es62.js +0 -46
  203. package/dist/vue-components.es63.js +0 -4
  204. package/dist/vue-components.es7.js +0 -83
  205. package/dist/vue-components.es8.js +0 -63
  206. package/dist/vue-components.es9.js +0 -21
  207. package/src/components/OmegaForm/OmegaFormStuff.ts +0 -1276
  208. package/src/constants/index.ts +0 -1
package/README.md CHANGED
@@ -61,9 +61,9 @@ The doc app itself is a client app of the libary, therefore PrimeVue is imported
61
61
  module.exports = {
62
62
  vite: {
63
63
  resolve: {
64
- dedupe: ['vue', /primevue\/.+/],
65
- },
66
- },
64
+ dedupe: ["vue", /primevue\/.+/]
65
+ }
66
+ }
67
67
  }
68
68
  ```
69
69
 
@@ -103,7 +103,7 @@ If you have your own special set of SVG icons, you may create a font file (`.wof
103
103
  The client app shall import `style.css`, usually in the entry file:
104
104
 
105
105
  ```js
106
- import 'my-lib/dist/style.css'
106
+ import "my-lib/dist/style.css"
107
107
  ```
108
108
 
109
109
  ### Third-party dependencies
@@ -132,7 +132,7 @@ The dependency to be externalized may be declared as peer dependency in your lib
132
132
  If you don't expect the client app of your library also needing the same dependency, you may embed cherry-picked functions. For example, to embed the `fill` function of popular library [lodash](https://lodash.com), import the `fill` function like the following:
133
133
 
134
134
  ```js
135
- import fill from 'lodash/fill'
135
+ import fill from "lodash/fill"
136
136
  ```
137
137
 
138
138
  Even with tree-shaking, the codes being brought into your library may still be large, as the function may have its own dependencies.
@@ -190,7 +190,7 @@ In [tsconfig.json](tsconfig.js), set the following to address [Issue #32](https:
190
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
191
 
192
192
  ```ts
193
- import '@effect-app/vue-components/reset.css'
193
+ import "@effect-app/vue-components/reset.css"
194
194
  ```
195
195
 
196
196
  ### 2. Nested union `_tag` handling
@@ -208,22 +208,26 @@ import '@effect-app/vue-components/reset.css'
208
208
  - **v4**: `defaultsValueFromSchema` detects `PropertySignatureTransformation` and extracts defaults, enabling `withDecodingDefault` as a new pattern for declaring field defaults directly on the schema.
209
209
 
210
210
  ### On Submit event
211
- The :on-submit event could be tricky in `<OmegaForm />` component.
211
+
212
+ The :on-submit event could be tricky in `<OmegaForm />` component.
212
213
  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`
213
214
 
214
215
  E.g.
215
216
 
216
217
  to use it as a Promise based Tanstack way:
218
+
217
219
  ```html
218
- <OmegaForm :schema="schema" :on-submit="onSubmit" :subscribe="['values']">
220
+ <OmegaForm :schema="schema" :on-submit="onSubmit" :subscribe="['values']">
219
221
  ```
220
222
 
221
223
  to use it as an event:
224
+
222
225
  ```html
223
226
  <OmegaForm :schema="schema" @submit="onSubmit" :is-loading="false" :subscribe="['values']">
224
227
  ```
225
228
 
226
229
  this will give you a type error instead, because `:is-loading` is only accepted in event mode
230
+
227
231
  ```html
228
- <OmegaForm :schema="schema" :on-submit="onSubmit" :is-loading="false" :subscribe="['values']">
232
+ <OmegaForm :schema="schema" :on-submit="onSubmit" :is-loading="false" :subscribe="['values']">
229
233
  ```
package/dist/reset.css CHANGED
@@ -4,48 +4,49 @@
4
4
  * Import this file to restore equivalent behavior:
5
5
  * import '@effect-app/vue-components/reset.css'
6
6
  */
7
+ @layer vuetify-reset {
8
+ body {
9
+ margin: 0;
10
+ }
7
11
 
8
- body {
9
- margin: 0;
10
- }
12
+ ul,
13
+ ol {
14
+ margin: 0;
15
+ padding: 0;
16
+ list-style: none;
17
+ }
11
18
 
12
- ul,
13
- ol {
14
- margin: 0;
15
- padding: 0;
16
- list-style: none;
17
- }
19
+ h1,
20
+ h2,
21
+ h3,
22
+ h4,
23
+ h5,
24
+ h6 {
25
+ margin: 0;
26
+ font-size: inherit;
27
+ font-weight: inherit;
28
+ }
18
29
 
19
- h1,
20
- h2,
21
- h3,
22
- h4,
23
- h5,
24
- h6 {
25
- margin: 0;
26
- font-size: inherit;
27
- font-weight: inherit;
28
- }
30
+ p {
31
+ margin: 0;
32
+ }
29
33
 
30
- p {
31
- margin: 0;
32
- }
34
+ input,
35
+ textarea,
36
+ select {
37
+ border: 0;
38
+ background: transparent;
39
+ }
33
40
 
34
- input,
35
- textarea,
36
- select {
37
- border: 0;
38
- background: transparent;
39
- }
40
-
41
- a {
42
- text-decoration: none;
43
- color: inherit;
44
- }
41
+ a {
42
+ text-decoration: none;
43
+ color: inherit;
44
+ }
45
45
 
46
- figure,
47
- details,
48
- summary {
49
- margin: 0;
50
- padding: 0;
46
+ figure,
47
+ details,
48
+ summary {
49
+ margin: 0;
50
+ padding: 0;
51
+ }
51
52
  }
@@ -1,23 +1,42 @@
1
- import type { CommandBase } from "@effect-app/vue";
1
+ import type { CommandBase, Progress } from "@effect-app/vue/makeClient";
2
+ import * as Option from "effect-app/Option";
3
+ import type * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
2
4
  import type { VBtn } from "vuetify/components";
3
5
  export type VBtnProps = VBtn["$props"];
4
6
  export interface ButtonProps extends /* @vue-ignore */ VBtnProps {
5
7
  }
6
- /** Command Button is an easy way to connect commands and have it execute on click, while keeping track of disabled/loading states automatically */
8
+ /**
9
+ * CommandButton connects a command to a button and tracks disabled / loading state.
10
+ *
11
+ * Input variants:
12
+ * - `input`: pass a validated value; button enabled when command + disabled allow it.
13
+ * - `optionalInput`: pass an `Option<I>`. `Some` → enabled, click fires with the value.
14
+ * `None` → disabled. Use this when the input is gated by a `computed` instead of
15
+ * a `v-if` on the button itself.
16
+ * - neither: command takes no input.
17
+ */
7
18
  declare const _default: typeof __VLS_export;
8
19
  export default _default;
9
- declare const __VLS_export: <I = never>(__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<{
20
+ declare const __VLS_export: <I = never, RA = unknown, RE = unknown>(__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<{
10
21
  props: import("vue").PublicProps & __VLS_PrettifyLocal<({
11
22
  input: NoInfer<I>;
12
- command: CommandBase<I>;
23
+ optionalInput?: undefined;
24
+ command: CommandBase<I, any, RA, RE>;
13
25
  empty?: boolean;
14
26
  } | {
15
- command: CommandBase;
27
+ optionalInput: Option.Option<NoInfer<I>>;
16
28
  input?: undefined;
29
+ command: CommandBase<I, any, RA, RE>;
30
+ empty?: boolean;
31
+ } | {
32
+ command: CommandBase<any, any, RA, RE>;
33
+ input?: undefined;
34
+ optionalInput?: undefined;
17
35
  empty?: boolean;
18
36
  }) & {
19
37
  disabled?: ButtonProps["disabled"];
20
38
  title?: string;
39
+ mapProgress?: (result: AsyncResult.AsyncResult<RA, RE>) => Progress | undefined;
21
40
  } & ButtonProps> & (typeof globalThis extends {
22
41
  __VLS_PROPS_FALLBACK: infer P;
23
42
  } ? P : {});
@@ -9,8 +9,10 @@ declare var __VLS_11: {
9
9
  open: boolean;
10
10
  cancel: () => void;
11
11
  isActive: any;
12
- };
12
+ }, __VLS_15: string, __VLS_16: any;
13
13
  type __VLS_Slots = {} & {
14
+ [K in NonNullable<typeof __VLS_15>]?: (props: typeof __VLS_16) => any;
15
+ } & {
14
16
  default?: (props: typeof __VLS_11) => any;
15
17
  };
16
18
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -0,0 +1,39 @@
1
+ type __VLS_Props = {
2
+ captureException: (err: Error, hint?: {
3
+ extra?: Record<string, unknown>;
4
+ }) => void;
5
+ toastError: (message: string) => void;
6
+ debug: boolean;
7
+ /** register the boundary only when true (backend passes import.meta.client; frontend omits → true) */
8
+ enabled?: boolean;
9
+ /** defer handling until app ready (backend: onNuxtReady while hydrating; frontend: omit → run now) */
10
+ scheduleAfterReady?: (fn: () => void) => void;
11
+ /** extra side-effect after emit, before error.value is set (backend: nuxtApp vue:error hook) */
12
+ onHandled?: (err: Error, instance: unknown, info: string) => void;
13
+ };
14
+ type __VLS_Slots = {
15
+ error(props: {
16
+ error: Error;
17
+ clearError: () => void;
18
+ }): any;
19
+ default(): any;
20
+ };
21
+ declare function clearError(): void;
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
23
+ error: import("vue").ShallowRef<Error | null, Error | null>;
24
+ clearError: typeof clearError;
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ error: (error: Error) => any;
27
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
+ onError?: ((error: Error) => any) | undefined;
29
+ }>, {
30
+ enabled: boolean;
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -16,7 +16,7 @@ export type InputProps<From extends Record<PropertyKey, any>, TName extends Deep
16
16
  inputClass: string | undefined | null;
17
17
  };
18
18
  field: OmegaFieldInternalApi<From, TName>;
19
- /** be sure to use this state and not `field.state` as it is not reactive */
19
+ /** reactive field state, sourced from `field.state` (the Field slot's own `state` prop is a stale snapshot since @tanstack/vue-form 1.32) */
20
20
  state: OmegaFieldInternalApi<From, TName>["state"];
21
21
  };
22
22
  export type MergedInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> = InputProps<From, TName>["inputProps"] & Pick<InputProps<From, TName>, "field" | "state">;
@@ -1,5 +1,5 @@
1
1
  import { type DeepKeys } from "@tanstack/vue-form";
2
- import { type OmegaArrayProps } from "./OmegaFormStuff";
2
+ import { type OmegaArrayProps } from "./types";
3
3
  declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, 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<{
4
4
  props: import("vue").PublicProps & __VLS_PrettifyLocal<OmegaArrayProps<From, To, Name>> & (typeof globalThis extends {
5
5
  __VLS_PROPS_FALLBACK: infer P;
@@ -1,6 +1,6 @@
1
1
  import { type DeepKeys } from "@tanstack/vue-form";
2
- import { Order } from "effect-app";
3
- import { type OmegaAutoGenMeta, type OmegaInputProps } from "./OmegaFormStuff";
2
+ import * as Order from "effect/Order";
3
+ import { type OmegaAutoGenMeta, type OmegaInputProps } from "./types";
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<{
6
6
  props: import("vue").PublicProps & __VLS_PrettifyLocal<{
@@ -1,5 +1,5 @@
1
1
  import type { StandardSchemaV1Issue } from "@tanstack/vue-form";
2
- import { type OmegaError } from "./OmegaFormStuff";
2
+ import { type OmegaError } from "./types";
3
3
  type __VLS_Props = {
4
4
  generalErrors: (Record<string, StandardSchemaV1Issue[]> | undefined)[];
5
5
  errors: OmegaError[];
@@ -1,6 +1,6 @@
1
1
  import { type DeepKeys } from "@tanstack/vue-form";
2
2
  import type { MergedInputProps } from "./InputProps";
3
- import type { BaseProps, DefaultTypeProps } from "./OmegaFormStuff";
3
+ import type { BaseProps, DefaultTypeProps } from "./types";
4
4
  declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, 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<{
5
5
  props: import("vue").PublicProps & __VLS_PrettifyLocal<BaseProps<From, Name> & DefaultTypeProps> & (typeof globalThis extends {
6
6
  __VLS_PROPS_FALLBACK: infer P;
@@ -1,5 +1,5 @@
1
1
  import { type DeepKeys } from "@tanstack/vue-form";
2
- import { type OmegaInputPropsBase } from "./OmegaFormStuff";
2
+ import { type OmegaInputPropsBase } from "./types";
3
3
  declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, 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<{
4
4
  props: import("vue").PublicProps & __VLS_PrettifyLocal<OmegaInputPropsBase<From, To, Name>> & (typeof globalThis extends {
5
5
  __VLS_PROPS_FALLBACK: infer P;
@@ -51,6 +51,12 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
51
51
  id: string;
52
52
  label: string;
53
53
  }) => any;
54
+ } & {
55
+ label?: (props: {
56
+ required: boolean | undefined;
57
+ id: string;
58
+ label: string;
59
+ }) => any;
54
60
  };
55
61
  emit: {
56
62
  (e: "focus", event: Event): void;
@@ -1,7 +1,8 @@
1
1
  import { type DeepKeys } from "@tanstack/vue-form";
2
- import { type ComputedRef } from "vue";
2
+ import { type Component, type ComputedRef } from "vue";
3
3
  import type { OmegaFieldInternalApi } from "./InputProps";
4
- import type { FieldValidators, MetaRecord, NestedKeyOf, TypeOverride } from "./OmegaFormStuff";
4
+ import type { MetaRecord, NestedKeyOf } from "./meta/types";
5
+ import type { TypeOverride } from "./types";
5
6
  declare const __VLS_export: <From extends Record<PropertyKey, any>, 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<{
6
7
  props: import("vue").PublicProps & __VLS_PrettifyLocal<{
7
8
  field: OmegaFieldInternalApi<From, Name>;
@@ -9,7 +10,6 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
9
10
  meta: MetaRecord<From>[NestedKeyOf<From>];
10
11
  label: string;
11
12
  type?: TypeOverride;
12
- validators?: FieldValidators<From>;
13
13
  required?: boolean;
14
14
  inputClass?: string | null;
15
15
  register: (field: ComputedRef<{
@@ -19,8 +19,9 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
19
19
  }>) => void;
20
20
  options?: {
21
21
  title: string;
22
- value: string;
22
+ value: unknown;
23
23
  }[];
24
+ inputs?: Record<string, Component>;
24
25
  }> & (typeof globalThis extends {
25
26
  __VLS_PROPS_FALLBACK: infer P;
26
27
  } ? P : {});
@@ -43,11 +44,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
43
44
  inputClass: string | undefined | null;
44
45
  }) => any;
45
46
  } & {
46
- label?: (props: {
47
- required: boolean | undefined;
48
- id: string;
49
- label: string;
50
- }) => any;
47
+ label?: (props: any) => any;
51
48
  };
52
49
  emit: {};
53
50
  }>) => import("vue").VNode & {
@@ -15,8 +15,8 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends R
15
15
  attrs: any;
16
16
  slots: {
17
17
  [x: string]: ((props: {
18
- field: import("./InputProps").OmegaFieldInternalApi<From, "_tag" | `${NonNullable<Name>}._tag`>;
19
- state: NonNullable<import("@tanstack/vue-form").DeepValue<From, "_tag" | `${NonNullable<Name>}._tag`>>;
18
+ field: import("./InputProps").OmegaFieldInternalApi<From, DeepKeys<From>>;
19
+ tag: string;
20
20
  }) => any) | undefined;
21
21
  } & {
22
22
  OmegaCustomInput?: (props: {
@@ -1,9 +1,9 @@
1
- import { type DeepKeys, type DeepValue } from "@tanstack/vue-form";
1
+ import { type DeepKeys } from "@tanstack/vue-form";
2
2
  import { type OmegaFieldInternalApi } from "./InputProps";
3
3
  import { type useOmegaForm } from "./useOmegaForm";
4
4
  declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, 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<{
5
5
  props: import("vue").PublicProps & __VLS_PrettifyLocal<{
6
- state: DeepValue<From, Name>;
6
+ tag: string | null;
7
7
  field: OmegaFieldInternalApi<From, Name>;
8
8
  name?: DeepKeys<From>;
9
9
  form: ReturnType<typeof useOmegaForm<From, To>>;
@@ -15,7 +15,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends R
15
15
  slots: {
16
16
  [x: string]: ((props: {
17
17
  field: OmegaFieldInternalApi<From, Name>;
18
- state: NonNullable<DeepValue<From, Name>>;
18
+ tag: string;
19
19
  }) => any) | undefined;
20
20
  };
21
21
  emit: {};
@@ -1,4 +1,4 @@
1
- import { type DefaultTypeProps, type OmegaFormState } from "./OmegaFormStuff";
1
+ import { type DefaultTypeProps, type OmegaFormState } from "./types";
2
2
  import { type OmegaFormReturn } from "./useOmegaForm";
3
3
  declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, K extends keyof OmegaFormState<From, To> = keyof OmegaFormState<From, To>, Props = DefaultTypeProps>(__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<{
4
4
  props: import("vue").PublicProps & __VLS_PrettifyLocal<{
@@ -1,4 +1,6 @@
1
1
  import { type Component } from "vue";
2
- import { type DefaultTypeProps } from "./OmegaFormStuff";
2
+ import type { OmegaConfig } from "./types";
3
3
  import { useOmegaForm } from "./useOmegaForm";
4
- export declare const createUseFormWithCustomInput: <TypeProps = DefaultTypeProps>(CustomInputComponent: Component) => <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>>(...args: Parameters<typeof useOmegaForm<From, To>>) => import("./useOmegaForm").OmegaFormReturn<From, To, TypeProps>;
4
+ export declare const createUseFormWithCustomInput: (CustomInputComponent: Component) => <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, const Cfg extends OmegaConfig<To> = OmegaConfig<To>>(schema: Parameters<typeof useOmegaForm<From, To>>[0], tanstackFormOptions?: Parameters<typeof useOmegaForm<From, To>>[1], omegaConfig?: Cfg) => import("./types").OmegaFormReturn<From, To, import("./types").TypePropsFor<Cfg extends {
5
+ inputs?: infer I;
6
+ } ? I : {}>>;
@@ -0,0 +1,33 @@
1
+ import { type Component, type ComputedRef, type ConcreteComponent, type Ref } from "vue";
2
+ import type { OF } from "./useOmegaForm";
3
+ export declare const useErrorLabel: (form: OF<any, any>) => (propsName: string) => string;
4
+ export declare const eHoc: (errorProps: {
5
+ form: OF<any, any>;
6
+ fieldMap: Ref<Map<string, {
7
+ id: string;
8
+ label: string;
9
+ }>>;
10
+ }) => <P>(WrappedComponent: Component<P>) => ConcreteComponent<P>;
11
+ export declare const makeFieldMap: () => {
12
+ fieldMap: Ref<Map<string, {
13
+ label: string;
14
+ id: string;
15
+ }> & Omit<Map<string, {
16
+ label: string;
17
+ id: string;
18
+ }>, keyof Map<any, any>>, Map<string, {
19
+ label: string;
20
+ id: string;
21
+ }> | (Map<string, {
22
+ label: string;
23
+ id: string;
24
+ }> & Omit<Map<string, {
25
+ label: string;
26
+ id: string;
27
+ }>, keyof Map<any, any>>)>;
28
+ registerField: (field: ComputedRef<{
29
+ name: string;
30
+ label: string;
31
+ id: string;
32
+ }>) => void;
33
+ };
@@ -1,3 +1,3 @@
1
1
  import { type Ref } from "vue";
2
- import type { OmegaFormApi, OmegaFormState } from "./OmegaFormStuff";
2
+ import type { OmegaFormApi, OmegaFormState } from "./types";
3
3
  export declare function getOmegaStore<To, From, K extends keyof OmegaFormState<To, From> = keyof OmegaFormState<To, From>>(form: OmegaFormApi<To, From>, subscribe?: K[]): Ref<K[] extends undefined[] ? Record<string, never> : Pick<OmegaFormState<To, From>, K>>;
@@ -0,0 +1,3 @@
1
+ import { type Component, type ConcreteComponent } from "vue";
2
+ import type { OF } from "./useOmegaForm";
3
+ export declare const fHoc: (form: OF<any, any>) => <P>(WrappedComponent: Component<P>) => ConcreteComponent<P>;
@@ -1,10 +1,21 @@
1
- export * from "./OmegaFormStuff";
2
- export { type OmegaConfig, type OmegaFormReturn, useOmegaForm } from "./useOmegaForm";
1
+ import type * as S from "effect-app/Schema";
2
+ export { getInputType, type SupportedInputs } from "./inputs";
3
+ export { createMeta, generateMetaFromSchema, isNullableOrUndefined, metadataFromAst } from "./meta/createMeta";
4
+ export type { CreateMeta, FilterItems } from "./meta/createMeta";
5
+ export { defaultsValueFromSchema } from "./meta/defaults";
6
+ export { toFormSchema } from "./meta/redacted";
7
+ export type { BaseFieldMeta, BooleanFieldMeta, DateFieldMeta, FieldMeta, MetaRecord, MultipleFieldMeta, NestedKeyOf, NumberFieldMeta, SelectFieldMeta, StringFieldMeta, UnknownFieldMeta } from "./meta/types";
8
+ export { deepMerge } from "./persistency";
9
+ export type { BaseProps, DefaultTypeProps, FieldPath, FieldPath_, FieldValidators, FormComponent, FormProps, FormType, OmegaArrayProps, OmegaAutoGenMeta, OmegaError, OmegaFormApi, OmegaFormParams, OmegaFormState, OmegaInputProps, OmegaInputPropsBase, PrefixFromDepth, TypeOverride, TypesWithOptions } from "./types";
10
+ export { makeStandardSchemaV1Hooks, toLocalizedStandardSchemaV1 } from "./validation/localized";
11
+ export { FormErrors, OmegaFormKey, useErrorLabel, useOmegaForm } from "./useOmegaForm";
12
+ export type { defaultValuesPriorityUnion, OF, OmegaConfig, OmegaFormReturn, Policies } from "./useOmegaForm";
3
13
  export { type ExtractTagValue, type ExtractUnionBranch, type InputProps, type MergedInputProps, type TaggedUnionOption, type TaggedUnionOptionsArray, type TaggedUnionProps } from "./InputProps";
14
+ export type { VuetifyInputProps, VuetifyInputProps as OmegaRendererProps } from "./InputProps";
4
15
  export { default as OmegaInput } from "./OmegaInput.vue";
5
16
  export { default as OmegaVuetifyInput } from "./OmegaInternalInput.vue";
6
17
  export { default as OmegaTaggedUnion } from "./OmegaTaggedUnion.vue";
7
18
  export { default as OmegaTaggedUnionInternal } from "./OmegaTaggedUnionInternal.vue";
8
19
  export { useOnClose, usePreventClose } from "./blockDialog";
9
- export { getInputType } from "./OmegaFormStuff";
10
20
  export { createUseFormWithCustomInput } from "./createUseFormWithCustomInput";
21
+ export declare const duplicateSchema: <From, To>(schema: S.Codec<To, From>) => S.Codec<To, From, never, never>;
@@ -0,0 +1,4 @@
1
+ declare const supportedInputs: readonly ["button", "checkbox", "color", "date", "email", "number", "password", "radio", "range", "search", "submit", "tel", "text", "time", "url"];
2
+ export type SupportedInputs = typeof supportedInputs[number];
3
+ export declare const getInputType: (input: string) => SupportedInputs;
4
+ export {};
@@ -0,0 +1,4 @@
1
+ import * as S from "effect-app/Schema";
2
+ import type { FieldMeta } from "./types";
3
+ export declare const getCheckMetas: (property: S.AST.AST) => Array<Record<string, any>>;
4
+ export declare const getFieldMetadataFromAst: (property: S.AST.AST) => Partial<FieldMeta> & Record<string, unknown>;
@@ -0,0 +1,33 @@
1
+ import type * as Effect from "effect-app/Effect";
2
+ import * as S from "effect-app/Schema";
3
+ import type { FieldMeta, MetaRecord } from "./types";
4
+ export type FilterItems = {
5
+ items: readonly [string, ...string[]];
6
+ message: string | Effect.Effect<string> | {
7
+ readonly message: string | Effect.Effect<string>;
8
+ };
9
+ };
10
+ export type CreateMeta = {
11
+ parent?: string;
12
+ meta?: Record<string, any>;
13
+ nullableOrUndefined?: false | "undefined" | "null";
14
+ } & ({
15
+ propertySignatures: readonly S.AST.PropertySignature[];
16
+ property?: never;
17
+ } | {
18
+ propertySignatures?: never;
19
+ property: S.AST.AST;
20
+ });
21
+ export declare const unwrapDeclaration: (property: S.AST.AST) => S.AST.AST;
22
+ export declare const isNullableOrUndefined: (property: false | S.AST.AST | undefined) => false | "undefined" | "null";
23
+ export declare const createMeta: <T = any>({ meta, parent, property, propertySignatures }: CreateMeta, acc?: Partial<MetaRecord<T>>) => MetaRecord<T> | FieldMeta;
24
+ export declare const metadataFromAst: <From, To>(schema: S.Codec<To, From>) => {
25
+ meta: MetaRecord<To>;
26
+ defaultValues: Record<string, any>;
27
+ unionMeta: Record<string, MetaRecord<To>>;
28
+ };
29
+ export declare const generateMetaFromSchema: <From, To>(schema: S.Codec<To, From>) => {
30
+ schema: S.Codec<To, From>;
31
+ meta: MetaRecord<To>;
32
+ unionMeta: Record<string, MetaRecord<To>>;
33
+ };
@@ -0,0 +1,21 @@
1
+ import * as S from "effect-app/Schema";
2
+ export declare const defaultsValueFromSchema: (schema: S.Schema<any>, record?: Record<string, any>) => any;
3
+ /**
4
+ * Deep-fills a partial form value with schema defaults for any nullable
5
+ * struct that has **materialised**.
6
+ *
7
+ * A nullable struct (`S.NullOr(S.Struct(...))`) left `null` stays `null`, but
8
+ * once it materialises — e.g. the user filled a single child — its untouched
9
+ * children are filled with their schema default (or `null` when nullable).
10
+ * Without this, strict `S.NullOr(...)` children reject the leftover
11
+ * `undefined` with a spurious "field must not be empty" error.
12
+ *
13
+ * Only children of a struct reached *through a nullable union* are filled;
14
+ * the always-present root struct keeps whatever fields it already has, so the
15
+ * form's own default-value priority is left untouched.
16
+ *
17
+ * Reference-preserving: returns `value` unchanged (same reference) when there
18
+ * is nothing to fill, so callers can detect a no-op with `===` and the result
19
+ * is idempotent (`fill(fill(v)) === fill(v)`).
20
+ */
21
+ export declare const fillNestedDefaults: (ast: S.AST.AST, value: unknown, fillMissing?: boolean) => unknown;
@@ -0,0 +1,2 @@
1
+ import * as S from "effect-app/Schema";
2
+ export declare const toFormSchema: <From, To>(schema: S.Codec<To, From>) => S.Codec<To, From>;
@@ -0,0 +1,56 @@
1
+ import type { DeepKeys } from "@tanstack/vue-form";
2
+ import type * as S from "effect-app/Schema";
3
+ import type { Redacted } from "effect/Redacted";
4
+ type StripRedacted<T> = T extends Redacted<any> ? string : T extends ReadonlyArray<infer U> ? ReadonlyArray<StripRedacted<U>> : T extends Record<string, any> ? {
5
+ [K in keyof T]: StripRedacted<T[K]>;
6
+ } : T;
7
+ export type NestedKeyOf<T> = DeepKeys<StripRedacted<T>>;
8
+ export type BaseFieldMeta = {
9
+ required: boolean;
10
+ nullableOrUndefined?: false | "undefined" | "null";
11
+ /**
12
+ * True when the schema property is `S.optionalKey` (AST
13
+ * `context.isOptional`) — i.e. the key should be ABSENT from the submitted
14
+ * object when empty, not present with `undefined`. Distinct from
15
+ * `required: false`, which may also mean "empty string is valid" for
16
+ * unconstrained `S.String` fields.
17
+ */
18
+ isOptionalKey?: boolean;
19
+ };
20
+ export type StringFieldMeta = BaseFieldMeta & {
21
+ type: "string";
22
+ maxLength?: number;
23
+ minLength?: number;
24
+ format?: string;
25
+ };
26
+ export type NumberFieldMeta = BaseFieldMeta & {
27
+ type: "number";
28
+ minimum?: number;
29
+ maximum?: number;
30
+ exclusiveMinimum?: number;
31
+ exclusiveMaximum?: number;
32
+ refinement?: "int";
33
+ };
34
+ export type SelectFieldMeta = BaseFieldMeta & {
35
+ type: "select";
36
+ members: any[];
37
+ };
38
+ export type MultipleFieldMeta = BaseFieldMeta & {
39
+ type: "multiple";
40
+ members: any[];
41
+ rest: readonly S.AST.AST[];
42
+ };
43
+ export type BooleanFieldMeta = BaseFieldMeta & {
44
+ type: "boolean";
45
+ };
46
+ export type DateFieldMeta = BaseFieldMeta & {
47
+ type: "date";
48
+ };
49
+ export type UnknownFieldMeta = BaseFieldMeta & {
50
+ type: "unknown";
51
+ };
52
+ export type FieldMeta = StringFieldMeta | NumberFieldMeta | SelectFieldMeta | MultipleFieldMeta | BooleanFieldMeta | DateFieldMeta | UnknownFieldMeta;
53
+ export type MetaRecord<T = string> = {
54
+ [K in NestedKeyOf<T>]?: FieldMeta;
55
+ };
56
+ export {};