@effect-app/vue-components 0.4.6 → 0.6.1

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 (48) hide show
  1. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +30 -0
  2. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +1 -1
  3. package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +5 -5
  4. package/dist/types/components/OmegaForm/index.d.ts +2 -6
  5. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +1 -1
  6. package/dist/vue-components.es.js +24 -27
  7. package/dist/vue-components.es10.js +6 -23
  8. package/dist/vue-components.es11.js +76 -43
  9. package/dist/vue-components.es15.js +1 -1
  10. package/dist/vue-components.es17.js +2 -5
  11. package/dist/vue-components.es18.js +5 -32
  12. package/dist/vue-components.es19.js +32 -2
  13. package/dist/vue-components.es2.js +16 -19
  14. package/dist/vue-components.es20.js +98 -2
  15. package/dist/vue-components.es21.js +11 -96
  16. package/dist/vue-components.es22.js +2 -11
  17. package/dist/vue-components.es23.js +1 -1
  18. package/dist/vue-components.es24.js +2 -115
  19. package/dist/vue-components.es25.js +117 -0
  20. package/dist/{vue-components.es26.js → vue-components.es27.js} +1 -1
  21. package/dist/vue-components.es3.js +3 -3
  22. package/dist/vue-components.es4.js +2 -2
  23. package/dist/vue-components.es5.js +78 -36
  24. package/dist/vue-components.es6.js +34 -131
  25. package/dist/vue-components.es7.js +128 -211
  26. package/dist/vue-components.es8.js +216 -6
  27. package/dist/vue-components.es9.js +4 -4
  28. package/package.json +9 -3
  29. package/src/components/OmegaForm/OmegaAutoGen.vue +110 -0
  30. package/src/components/OmegaForm/OmegaErrors.vue +3 -3
  31. package/src/components/OmegaForm/OmegaFormStuff.ts +1 -1
  32. package/src/components/OmegaForm/OmegaInternalInput.vue +9 -6
  33. package/src/components/OmegaForm/OmegaWrapper.vue +59 -12
  34. package/src/components/OmegaForm/index.ts +2 -19
  35. package/src/components/OmegaForm/useOmegaForm.ts +1 -1
  36. package/src/env.d.ts +0 -8
  37. package/src/stories/OmegaForm/ComplexForm.vue +0 -87
  38. package/src/stories/OmegaForm/EmailForm.vue +0 -48
  39. package/src/stories/OmegaForm/Meta.vue +0 -47
  40. package/src/stories/OmegaForm/OneHundredWaysToWriteAForm.vue +0 -188
  41. package/src/stories/OmegaForm/PersistencyForm.vue +0 -58
  42. package/src/stories/OmegaForm/SimpleForm.vue +0 -30
  43. package/src/stories/OmegaForm/SimpleFormVuetifyDefault.vue +0 -15
  44. package/src/stories/OmegaForm/SumExample.vue +0 -37
  45. package/src/stories/OmegaForm/form.Input.vue +0 -98
  46. package/src/stories/OmegaForm.stories.ts +0 -106
  47. package/src/stories/README.md +0 -29
  48. package/src/stories/tsconfig.json +0 -4
@@ -0,0 +1,30 @@
1
+ import { type NestedKeyOf, type MetaRecord, type FormType, type OmegaInputProps } from "./OmegaFormStuff";
2
+ import { Order } from "effect-app";
3
+ export type OmegaAutoGenMeta<From, To> = Omit<OmegaInputProps<From, To>, "form">;
4
+ declare const _default: <From, To>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & {
6
+ form: FormType<From, To> & {
7
+ meta: MetaRecord<To>;
8
+ };
9
+ pick?: NestedKeyOf<To>[];
10
+ omit?: NestedKeyOf<To>[];
11
+ labelMap?: (key: NestedKeyOf<To>) => string | undefined;
12
+ filterMap?: <M extends OmegaAutoGenMeta<From, To>>(key: NestedKeyOf<To>, meta: M) => boolean | M;
13
+ order?: NestedKeyOf<To>[];
14
+ sort?: Order.Order<OmegaAutoGenMeta<From, To>>;
15
+ } & Partial<{}>> & import("vue").PublicProps;
16
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
17
+ attrs: any;
18
+ slots: {
19
+ default(props: {
20
+ child: OmegaAutoGenMeta<From, To>;
21
+ }): void;
22
+ };
23
+ emit: {};
24
+ }>) => import("vue").VNode & {
25
+ __ctx?: Awaited<typeof __VLS_setup>;
26
+ };
27
+ export default _default;
28
+ type __VLS_PrettifyLocal<T> = {
29
+ [K in keyof T]: T[K];
30
+ } & {};
@@ -32,7 +32,7 @@ export type OmegaFormParams<To, From> = FormApi<To, FormValidateOrFn<To> | undef
32
32
  export type OmegaFormState<To, From> = FormState<To, FormValidateOrFn<To> | undefined, FormValidateOrFn<To> | undefined, StandardSchemaV1<To, From>, FormValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined, FormValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined>;
33
33
  export type OmegaFormApi<To, From> = OmegaFormParams<To, From> & VueFormApi<To, FormValidateOrFn<To> | undefined, FormValidateOrFn<To> | undefined, StandardSchemaV1<To, From>, FormValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined, FormValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined, FormAsyncValidateOrFn<To> | undefined>;
34
34
  export type FormComponent<T, S> = FieldComponent<T, FormValidateOrFn<T> | undefined, FormValidateOrFn<T> | undefined, StandardSchemaV1<T, S>, FormValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, FormValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined, FormAsyncValidateOrFn<T> | undefined> & Component;
35
- export type FormType<T, S> = OmegaFormApi<T, S> & {
35
+ export type FormType<T, S = unknown> = OmegaFormApi<T, S> & {
36
36
  Field: Component;
37
37
  };
38
38
  export type PrefixFromDepth<K extends string | number, _TDepth extends any[]> = K;
@@ -6,16 +6,16 @@ declare const _default: <From extends Record<PropertyKey, any>, To extends Recor
6
6
  omegaConfig?: OmegaConfig<From>;
7
7
  subscribe?: K[];
8
8
  showErrorsOn?: ShowErrorsOn;
9
- } & ({
10
- form: OmegaFormReturn<To, From>;
11
- schema?: undefined;
12
- } | (Omit<import("@tanstack/vue-form").FormOptions<To, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").StandardSchemaV1<To, From>, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined>, "onSubmit"> & {
9
+ } & Omit<import("@tanstack/vue-form").FormOptions<To, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").StandardSchemaV1<To, From>, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<To> | undefined>, "onSubmit"> & ({
13
10
  onSubmit?: ((props: {
14
11
  formApi: import("./OmegaFormStuff").OmegaFormParams<To, From>;
15
12
  meta: any;
16
13
  value: From;
17
14
  }) => Promise<any> | any) | undefined;
18
- } & {
15
+ } & ({
16
+ form: OmegaFormReturn<To, From>;
17
+ schema?: undefined;
18
+ } | {
19
19
  form?: undefined;
20
20
  schema: S.Schema<From, To, never>;
21
21
  }))) & Partial<{}>> & import("vue").PublicProps;
@@ -1,13 +1,9 @@
1
1
  import { default as OmegaForm } from "./OmegaWrapper.vue";
2
2
  import { default as OmegaInput } from "./OmegaInput.vue";
3
3
  import { default as OmegaErrors } from "./OmegaErrors.vue";
4
+ import { default as OmegaAutoGen } from "./OmegaAutoGen.vue";
4
5
  export * as OmegaErrorsContext from "./OmegaErrorsContext";
5
6
  export * from "./OmegaFormStuff";
6
7
  export { useOmegaForm } from "./useOmegaForm";
7
8
  export { default } from "./OmegaWrapper.vue";
8
- export { OmegaForm, OmegaInput, OmegaErrors };
9
- declare const OmegaFormCE: import("vue").VueElementConstructor<unknown>;
10
- declare const OmegaInputCE: import("vue").VueElementConstructor<unknown>;
11
- declare const OmegaErrorsCE: import("vue").VueElementConstructor<unknown>;
12
- export { OmegaFormCE, OmegaInputCE, OmegaErrorsCE };
13
- export declare function registerOmegaForm(): void;
9
+ export { OmegaForm, OmegaInput, OmegaErrors, OmegaAutoGen };
@@ -27,7 +27,7 @@ interface OF<To, From> extends OmegaFormApi<To, From> {
27
27
  }
28
28
  export declare const OmegaFormKey: InjectionKey<OF<any, any>>;
29
29
  export interface OmegaFormReturn<To extends Record<PropertyKey, any>, From> extends OF<To, From> {
30
- Input: typeof OmegaFormInput<From, To>;
30
+ Input: typeof OmegaFormInput;
31
31
  }
32
32
  export declare const useOmegaForm: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>>(schema: S.Schema<From, To, never>, tanstackFormOptions?: NoInfer<FormProps<To, From>>, omegaConfig?: OmegaConfig<From>) => OmegaFormReturn<To, From>;
33
33
  export {};
@@ -1,35 +1,32 @@
1
- import * as r from "./vue-components.es2.js";
2
- import { provideIntl as s, useIntl as l } from "./vue-components.es3.js";
3
- import { default as i } from "./vue-components.es4.js";
4
- import * as m from "./vue-components.es5.js";
5
- import { useOmegaForm as g } from "./vue-components.es6.js";
6
- import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as F, nullableInput as E } from "./vue-components.es7.js";
7
- import { default as h } from "./vue-components.es8.js";
8
- import { default as C } from "./vue-components.es9.js";
9
- import { OmegaErrorsCE as b, OmegaFormCE as j, OmegaInputCE as M, registerOmegaForm as k } from "./vue-components.es10.js";
10
- function a(t) {
11
- for (const e in r)
12
- if (Object.prototype.hasOwnProperty.call(r, e)) {
13
- const o = r[e];
14
- o && typeof o == "object" && t.component(e, o);
1
+ import * as t from "./vue-components.es2.js";
2
+ import { provideIntl as l, useIntl as s } from "./vue-components.es3.js";
3
+ import { default as c } from "./vue-components.es4.js";
4
+ import { default as i } from "./vue-components.es5.js";
5
+ import * as m from "./vue-components.es6.js";
6
+ import { useOmegaForm as g } from "./vue-components.es7.js";
7
+ import { duplicateSchema as F, generateInputStandardSchemaFromFieldMeta as I, generateMetaFromSchema as h, nullableInput as y } from "./vue-components.es8.js";
8
+ import { default as b } from "./vue-components.es9.js";
9
+ import { default as E } from "./vue-components.es10.js";
10
+ function a(r) {
11
+ for (const e in t)
12
+ if (Object.prototype.hasOwnProperty.call(t, e)) {
13
+ const o = t[e];
14
+ o && typeof o == "object" && r.component(e, o);
15
15
  }
16
16
  }
17
17
  const n = { install: a };
18
18
  export {
19
- C as OmegaErrors,
20
- b as OmegaErrorsCE,
19
+ i as OmegaAutoGen,
20
+ E as OmegaErrors,
21
21
  m as OmegaErrorsContext,
22
- h as OmegaForm,
23
- j as OmegaFormCE,
24
- i as OmegaInput,
25
- M as OmegaInputCE,
22
+ b as OmegaForm,
23
+ c as OmegaInput,
26
24
  n as default,
27
- d as duplicateSchema,
28
- O as generateInputStandardSchemaFromFieldMeta,
29
- F as generateMetaFromSchema,
30
- E as nullableInput,
31
- s as provideIntl,
32
- k as registerOmegaForm,
33
- l as useIntl,
25
+ F as duplicateSchema,
26
+ I as generateInputStandardSchemaFromFieldMeta,
27
+ h as generateMetaFromSchema,
28
+ y as nullableInput,
29
+ l as provideIntl,
30
+ s as useIntl,
34
31
  g as useOmegaForm
35
32
  };
@@ -1,25 +1,8 @@
1
- import { defineCustomElement as e } from "vue";
2
- import m from "./vue-components.es8.js";
3
- import t from "./vue-components.es4.js";
4
- import o from "./vue-components.es9.js";
5
- import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as O, generateMetaFromSchema as F, nullableInput as C } from "./vue-components.es7.js";
6
- import "@tanstack/vue-form";
7
- import "effect-app";
8
- const r = e(m), a = e(t), n = e(o);
9
- function p() {
10
- customElements.get("omega-form") || customElements.define("omega-form", r), customElements.get("omega-input") || customElements.define("omega-input", a), customElements.get("omega-errors") || customElements.define("omega-errors", n);
11
- }
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-31f11e27],.v-leave-to[data-v-31f11e27]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-31f11e27],.v-leave-active[data-v-31f11e27]{display:grid;transition:all .15s}.v-enter-to[data-v-31f11e27],.v-leave-from[data-v-31f11e27]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-31f11e27]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-31f11e27]{min-height:0}div.error-list[data-v-31f11e27]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:.5em;align-items:start}@container (max-width: 28.125rem){div.error-list[data-v-31f11e27]{grid-template-columns:auto 1fr}.error-link[data-v-31f11e27]{grid-column:1 / -1;justify-self:end}}@container (max-width: 18.75rem){div.error-list[data-v-31f11e27]{grid-template-columns:1fr}.error-message[data-v-31f11e27]{grid-column:1 / -1}}.error-item[data-v-31f11e27]{display:contents}a[data-v-31f11e27]{min-width:min-content}.error-link[data-v-31f11e27]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),document.head.appendChild(a),window.customElements){const e=window.customElements.define;window.customElements.define=function(n,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const r=document.createElement("style");r.appendChild(document.createTextNode(".v-enter-from[data-v-31f11e27],.v-leave-to[data-v-31f11e27]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-31f11e27],.v-leave-active[data-v-31f11e27]{display:grid;transition:all .15s}.v-enter-to[data-v-31f11e27],.v-leave-from[data-v-31f11e27]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-31f11e27]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-31f11e27]{min-height:0}div.error-list[data-v-31f11e27]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:.5em;align-items:start}@container (max-width: 28.125rem){div.error-list[data-v-31f11e27]{grid-template-columns:auto 1fr}.error-link[data-v-31f11e27]{grid-column:1 / -1;justify-self:end}}@container (max-width: 18.75rem){div.error-list[data-v-31f11e27]{grid-template-columns:1fr}.error-message[data-v-31f11e27]{grid-column:1 / -1}}.error-item[data-v-31f11e27]{display:contents}a[data-v-31f11e27]{min-width:min-content}.error-link[data-v-31f11e27]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(r)}},e.call(window.customElements,n,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import o from "./vue-components.es15.js";
3
+
4
+ import r from "./vue-components.es13.js";
5
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-31f11e27"]]);
12
6
  export {
13
- o as OmegaErrors,
14
- n as OmegaErrorsCE,
15
- m as OmegaForm,
16
- r as OmegaFormCE,
17
- t as OmegaInput,
18
- a as OmegaInputCE,
19
- m as default,
20
- d as duplicateSchema,
21
- O as generateInputStandardSchemaFromFieldMeta,
22
- F as generateMetaFromSchema,
23
- C as nullableInput,
24
- p as registerOmegaForm
7
+ e as default
25
8
  };
@@ -1,16 +1,14 @@
1
- import { defineComponent as h, computed as u, watch as F, createElementBlock as c, openBlock as d, withModifiers as y, createElementVNode as O, unref as i, renderSlot as l, createCommentVNode as E, Fragment as M } from "vue";
2
- import { useStore as v } from "@tanstack/vue-form";
3
- import { getOmegaStore as V } from "./vue-components.es22.js";
4
- import { provideOmegaErrors as w } from "./vue-components.es5.js";
5
- import { useOmegaForm as I } from "./vue-components.es6.js";
6
- const k = ["disabled"], j = /* @__PURE__ */ h({
1
+ import { defineComponent as w, computed as f, onBeforeMount as E, watch as j, createElementBlock as v, openBlock as b, withModifiers as F, createElementVNode as M, unref as c, renderSlot as p, createCommentVNode as k, Fragment as V } from "vue";
2
+ import { useStore as g } from "@tanstack/vue-form";
3
+ import { getOmegaStore as B } from "./vue-components.es21.js";
4
+ import { provideOmegaErrors as C } from "./vue-components.es6.js";
5
+ import { useOmegaForm as I } from "./vue-components.es7.js";
6
+ const $ = ["disabled"], N = /* @__PURE__ */ w({
7
7
  __name: "OmegaWrapper",
8
8
  props: {
9
9
  omegaConfig: {},
10
10
  subscribe: {},
11
11
  showErrorsOn: {},
12
- form: {},
13
- schema: {},
14
12
  defaultValues: {},
15
13
  defaultState: {},
16
14
  asyncAlways: { type: Boolean },
@@ -19,59 +17,94 @@ const k = ["disabled"], j = /* @__PURE__ */ h({
19
17
  onSubmitMeta: {},
20
18
  onSubmitInvalid: { type: Function },
21
19
  transform: {},
22
- onSubmit: { type: Function }
20
+ onSubmit: { type: Function },
21
+ form: {},
22
+ schema: {}
23
23
  },
24
- setup(p) {
25
- const t = p, n = u(() => {
26
- if (!(t.form || !t.schema))
27
- return I(t.schema, t, t.omegaConfig);
28
- }), r = u(() => t.form ?? n.value), b = v(
29
- r.value.store,
24
+ setup(O) {
25
+ const o = O, m = f(() => {
26
+ if (!(o.form || !o.schema))
27
+ return I(o.schema, o, o.omegaConfig);
28
+ }), t = f(() => o.form ?? m.value);
29
+ E(() => {
30
+ if (!o.form) return;
31
+ const e = Object.keys(o.form.options || {}), s = /* @__PURE__ */ new Set([
32
+ "omegaConfig",
33
+ "subscribe",
34
+ "showErrorsOn",
35
+ "asyncAlways",
36
+ "form",
37
+ "schema"
38
+ ]), i = Object.fromEntries(
39
+ Object.entries(o).filter(
40
+ ([a, u]) => !s.has(a) && u !== void 0
41
+ )
42
+ ), r = Object.keys(i), n = e.filter(
43
+ (a) => r.includes(a) && i[a] !== void 0
44
+ );
45
+ n.length > 0 && console.warn(
46
+ `[OmegaWrapper] Overlapping keys found between form options and filtered props:
47
+ ${n.join(
48
+ `,
49
+ `
50
+ )}.
51
+ Props will overwrite existing form options. This might indicate a configuration issue.`
52
+ );
53
+ const S = {
54
+ ...t.value.options,
55
+ ...i
56
+ };
57
+ t.value.options = Object.fromEntries(
58
+ Object.entries(S).filter(([a, u]) => u !== void 0)
59
+ );
60
+ });
61
+ const h = g(
62
+ t.value.store,
30
63
  (e) => e.isSubmitting
31
- ), f = V(
32
- r.value,
33
- t.subscribe
34
- ), g = v(
35
- r.value.store,
64
+ ), d = B(
65
+ t.value,
66
+ o.subscribe
67
+ ), y = g(
68
+ t.value.store,
36
69
  (e) => e.submissionAttempts
37
- ), m = u(() => r.value.useStore((e) => e.errors));
38
- return F(
39
- () => [r.value.filterItems, m.value.value],
70
+ ), l = f(() => t.value.useStore((e) => e.errors));
71
+ return j(
72
+ () => [t.value.filterItems, l.value.value],
40
73
  () => {
41
- const e = r.value.filterItems, s = m.value.value;
74
+ const e = t.value.filterItems, s = l.value.value;
42
75
  return e ? s ? (Object.values(s).filter(
43
- (o) => !!o
76
+ (r) => !!r
44
77
  ).flatMap(
45
- (o) => Object.values(o).flat().map((a) => a.message)
46
- ).some((o) => o === e.message) && e.items.forEach((o) => {
47
- const a = r.value.getFieldMeta(o);
48
- a && r.value.setFieldMeta(o, {
49
- ...a,
78
+ (r) => Object.values(r).flat().map((n) => n.message)
79
+ ).some((r) => r === e.message) && e.items.forEach((r) => {
80
+ const n = t.value.getFieldMeta(r);
81
+ n && t.value.setFieldMeta(r, {
82
+ ...n,
50
83
  errorMap: {
51
84
  onSubmit: [
52
- { path: [o], message: e.message }
85
+ { path: [r], message: e.message }
53
86
  ]
54
87
  }
55
88
  });
56
89
  }), {}) : {} : {};
57
90
  }
58
- ), w(g, m.value, t.showErrorsOn), (e, s) => (d(), c("form", {
91
+ ), C(y, l.value, o.showErrorsOn), (e, s) => (b(), v("form", {
59
92
  novalidate: "",
60
- onSubmit: s[0] || (s[0] = y((S) => r.value.handleSubmit(), ["prevent", "stop"]))
93
+ onSubmit: s[0] || (s[0] = F((i) => t.value.handleSubmit(), ["prevent", "stop"]))
61
94
  }, [
62
- O("fieldset", { disabled: i(b) }, [
63
- t.form ? (d(), c(M, { key: 0 }, [
64
- l(e.$slots, "externalForm", { subscribedValues: i(f) }, void 0, !0),
65
- l(e.$slots, "default", {}, void 0, !0)
66
- ], 64)) : n.value ? l(e.$slots, "internalForm", {
95
+ M("fieldset", { disabled: c(h) }, [
96
+ o.form ? (b(), v(V, { key: 0 }, [
97
+ p(e.$slots, "externalForm", { subscribedValues: c(d) }, void 0, !0),
98
+ p(e.$slots, "default", {}, void 0, !0)
99
+ ], 64)) : m.value ? p(e.$slots, "internalForm", {
67
100
  key: 1,
68
- form: n.value,
69
- subscribedValues: i(f)
70
- }, void 0, !0) : E("", !0)
71
- ], 8, k)
101
+ form: m.value,
102
+ subscribedValues: c(d)
103
+ }, void 0, !0) : k("", !0)
104
+ ], 8, $)
72
105
  ], 32));
73
106
  }
74
107
  });
75
108
  export {
76
- j as default
109
+ N as default
77
110
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as C, getCurrentInstance as x, computed as B, createBlock as o, openBlock as t, Transition as b, withCtx as l, createElementBlock as c, createCommentVNode as w, unref as e, renderSlot as I, normalizeProps as V, guardReactiveProps as N, resolveDynamicComponent as s, normalizeClass as O, createElementVNode as d, toDisplayString as u, Fragment as g, renderList as k, createTextVNode as y } from "vue";
2
- import { useOmegaErrors as z } from "./vue-components.es5.js";
2
+ import { useOmegaErrors as z } from "./vue-components.es6.js";
3
3
  import { mdiLink as D } from "@mdi/js";
4
4
  import { useIntl as G } from "./vue-components.es3.js";
5
5
  const L = {
@@ -1,7 +1,4 @@
1
- import { isFunction as c } from "./vue-components.es19.js";
2
- const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
1
+ import f from "./vue-components.es5.js";
3
2
  export {
4
- s as isFunction,
5
- i as isObject,
6
- t as isRecordOrArray
3
+ f as default
7
4
  };
@@ -1,34 +1,7 @@
1
- import { defineComponent as a, inject as t, createBlock as n, openBlock as m, mergeProps as p, unref as s, withCtx as i, renderSlot as l, normalizeProps as f, guardReactiveProps as u } from "vue";
2
- import d from "./vue-components.es4.js";
3
- import { OmegaFormKey as c } from "./vue-components.es6.js";
4
- const w = /* @__PURE__ */ a({
5
- __name: "OmegaFormInput",
6
- props: {
7
- name: {},
8
- label: {},
9
- validators: {},
10
- options: {},
11
- type: {}
12
- },
13
- setup(g) {
14
- const o = t(c);
15
- if (!o)
16
- throw new Error("OmegaFormInput must be used within an OmegaForm context");
17
- return (e, b) => (m(), n(d, p(e.$props, {
18
- form: s(o),
19
- name: e.name,
20
- label: e.label,
21
- validators: e.validators,
22
- options: e.options,
23
- type: e.type
24
- }), {
25
- default: i((r) => [
26
- l(e.$slots, "default", f(u(r)))
27
- ]),
28
- _: 3
29
- }, 16, ["form", "name", "label", "validators", "options", "type"]));
30
- }
31
- });
1
+ import { isFunction as c } from "./vue-components.es22.js";
2
+ const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
32
3
  export {
33
- w as default
4
+ s as isFunction,
5
+ i as isObject,
6
+ t as isRecordOrArray
34
7
  };
@@ -1,4 +1,34 @@
1
- const o = (n) => typeof n == "function";
1
+ import { defineComponent as a, inject as t, createBlock as n, openBlock as m, mergeProps as p, unref as s, withCtx as i, renderSlot as l, normalizeProps as f, guardReactiveProps as u } from "vue";
2
+ import d from "./vue-components.es4.js";
3
+ import { OmegaFormKey as c } from "./vue-components.es7.js";
4
+ const w = /* @__PURE__ */ a({
5
+ __name: "OmegaFormInput",
6
+ props: {
7
+ name: {},
8
+ label: {},
9
+ validators: {},
10
+ options: {},
11
+ type: {}
12
+ },
13
+ setup(g) {
14
+ const o = t(c);
15
+ if (!o)
16
+ throw new Error("OmegaFormInput must be used within an OmegaForm context");
17
+ return (e, b) => (m(), n(d, p(e.$props, {
18
+ form: s(o),
19
+ name: e.name,
20
+ label: e.label,
21
+ validators: e.validators,
22
+ options: e.options,
23
+ type: e.type
24
+ }), {
25
+ default: i((r) => [
26
+ l(e.$slots, "default", f(u(r)))
27
+ ]),
28
+ _: 3
29
+ }, 16, ["form", "name", "label", "validators", "options", "type"]));
30
+ }
31
+ });
2
32
  export {
3
- o as isFunction
33
+ w as default
4
34
  };
@@ -1,22 +1,19 @@
1
- import { OmegaErrorsCE as m, OmegaFormCE as o, OmegaInputCE as t, registerOmegaForm as p } from "./vue-components.es10.js";
2
- import { default as f } from "./vue-components.es4.js";
3
- import * as e from "./vue-components.es5.js";
4
- import { useOmegaForm as n } from "./vue-components.es6.js";
5
- import { duplicateSchema as O, generateInputStandardSchemaFromFieldMeta as l, generateMetaFromSchema as x, nullableInput as d } from "./vue-components.es7.js";
6
- import { default as E } from "./vue-components.es8.js";
7
- import { default as i } from "./vue-components.es9.js";
1
+ import { default as t } from "./vue-components.es9.js";
2
+ import { default as m } from "./vue-components.es4.js";
3
+ import { default as f } from "./vue-components.es10.js";
4
+ import { default as l } from "./vue-components.es5.js";
5
+ import * as e from "./vue-components.es6.js";
6
+ import { duplicateSchema as d, generateInputStandardSchemaFromFieldMeta as g, generateMetaFromSchema as s, nullableInput as x } from "./vue-components.es8.js";
7
+ import { useOmegaForm as F } from "./vue-components.es7.js";
8
8
  export {
9
- i as OmegaErrors,
10
- m as OmegaErrorsCE,
9
+ l as OmegaAutoGen,
10
+ f as OmegaErrors,
11
11
  e as OmegaErrorsContext,
12
- E as OmegaForm,
13
- o as OmegaFormCE,
14
- f as OmegaInput,
15
- t as OmegaInputCE,
16
- O as duplicateSchema,
17
- l as generateInputStandardSchemaFromFieldMeta,
18
- x as generateMetaFromSchema,
19
- d as nullableInput,
20
- p as registerOmegaForm,
21
- n as useOmegaForm
12
+ t as OmegaForm,
13
+ m as OmegaInput,
14
+ d as duplicateSchema,
15
+ g as generateInputStandardSchemaFromFieldMeta,
16
+ s as generateMetaFromSchema,
17
+ x as nullableInput,
18
+ F as useOmegaForm
22
19
  };
@@ -1,4 +1,100 @@
1
- import f from "./vue-components.es18.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(o,t){const a=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(a&&a.call(this),this.shadowRoot){const i=document.createElement("style");i.appendChild(document.createTextNode(".omega-input .v-input__details:has(.v-messages:empty){grid-template-rows:0fr;transition:all .2s}.omega-input .v-messages:empty{min-height:0}.omega-input .v-input__details:has(.v-messages){transition:all .2s;overflow:hidden;min-height:0;display:grid;grid-template-rows:1fr}.omega-input .v-messages{transition:all .2s}.omega-input .v-messages>*{transition-duration:0s!important}.omega-input [role=alert]:has(.v-messages:empty){padding:0}.omega-input .v-btn{cursor:pointer;width:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(i)}},e.call(window.customElements,o,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { defineComponent as B, getCurrentInstance as L, useId as P, computed as l, watch as w, nextTick as S, onMounted as x, ref as T, watchEffect as z, renderSlot as A, normalizeProps as D, guardReactiveProps as F, createElementVNode as M, normalizeClass as N, createBlock as R, createCommentVNode as U, unref as j, openBlock as G, mergeProps as H } from "vue";
3
+ import { useStore as J } from "@tanstack/vue-form";
4
+ import { useOmegaErrors as K } from "./vue-components.es6.js";
5
+ import Q from "./vue-components.es25.js";
6
+
7
+ const te = /* @__PURE__ */ B({
8
+ inheritAttrs: !1,
9
+ __name: "OmegaInternalInput",
10
+ props: {
11
+ field: {},
12
+ meta: {},
13
+ label: {},
14
+ options: {},
15
+ type: {},
16
+ validators: {}
17
+ },
18
+ setup(C) {
19
+ const e = C, n = L(), $ = n == null ? void 0 : n.appContext.components.VTextField, o = P(), s = e.field, a = J(s.store, (t) => t), f = l(() => {
20
+ var t, r;
21
+ return e.type ? e.type : ((t = e.meta) == null ? void 0 : t.type) === "string" ? e.meta.format === "email" ? "email" : "string" : ((r = e.meta) == null ? void 0 : r.type) || "unknown";
22
+ }), u = l(() => a.value.value), k = l(
23
+ () => (
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ a.value.meta.errors.map((t) => t == null ? void 0 : t.message).filter(Boolean)
26
+ )
27
+ );
28
+ w(
29
+ () => !!u.value,
30
+ (t) => {
31
+ t || S(() => {
32
+ var r;
33
+ s.setValue(
34
+ ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
35
+ );
36
+ });
37
+ }
38
+ ), x(() => {
39
+ var t, r;
40
+ !u.value && !((t = e.meta) != null && t.required) && ((r = e.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && s.setValue(null);
41
+ });
42
+ const { addError: I, removeError: O, showErrors: _, showErrorsOn: q } = K(), i = T(!1);
43
+ z(() => {
44
+ (_.value || q === "onChange") && (i.value = !0);
45
+ });
46
+ const m = () => {
47
+ i.value = !0;
48
+ };
49
+ x(() => {
50
+ u.value && m();
51
+ });
52
+ const d = l(() => !i.value && f.value !== "select" ? [] : k.value);
53
+ w(
54
+ () => a.value.meta.errors,
55
+ () => {
56
+ a.value.meta.errors.length ? I({
57
+ inputId: o,
58
+ errors: a.value.meta.errors.map((t) => t.message).filter(Boolean),
59
+ label: e.label
60
+ }) : O(o);
61
+ }
62
+ );
63
+ const p = l(() => {
64
+ var t, r, c, v, g, y, h, b, E, V;
65
+ return {
66
+ id: o,
67
+ required: (t = e.meta) == null ? void 0 : t.required,
68
+ minLength: ((r = e.meta) == null ? void 0 : r.type) === "string" && ((c = e.meta) == null ? void 0 : c.minLength),
69
+ maxLength: ((v = e.meta) == null ? void 0 : v.type) === "string" && ((g = e.meta) == null ? void 0 : g.maxLength),
70
+ max: ((y = e.meta) == null ? void 0 : y.type) === "number" && ((h = e.meta) == null ? void 0 : h.maximum),
71
+ min: ((b = e.meta) == null ? void 0 : b.type) === "number" && ((E = e.meta) == null ? void 0 : E.minimum),
72
+ name: e.field.name,
73
+ modelValue: e.field.state.value,
74
+ errorMessages: d.value,
75
+ error: !!d.value.length,
76
+ field: e.field,
77
+ setRealDirty: m,
78
+ type: f.value,
79
+ label: `${e.label}${(V = e.meta) != null && V.required ? " *" : ""}`,
80
+ options: e.options
81
+ };
82
+ });
83
+ return (t, r) => A(t.$slots, "default", D(F(p.value)), () => [
84
+ M("div", {
85
+ class: N(t.$attrs.class),
86
+ onFocusout: m
87
+ }, [
88
+ j($) ? (G(), R(Q, H({
89
+ key: 0,
90
+ "input-props": p.value
91
+ }, t.$attrs, {
92
+ "vuetify-value": p.value.field.state.value
93
+ }), null, 16, ["input-props", "vuetify-value"])) : U("", !0)
94
+ ], 34)
95
+ ]);
96
+ }
97
+ });
2
98
  export {
3
- f as default
99
+ te as default
4
100
  };