@effect-app/vue-components 0.18.20 → 0.19.0

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 (40) hide show
  1. package/dist/types/components/OmegaForm/OmegaWrapper.vue.d.ts +6 -2
  2. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +1 -0
  3. package/dist/vue-components.es12.js +2 -2
  4. package/dist/vue-components.es20.js +35 -35
  5. package/dist/vue-components.es22.js +1 -1
  6. package/dist/vue-components.es23.js +1 -1
  7. package/dist/vue-components.es24.js +1 -1
  8. package/dist/vue-components.es25.js +1 -1
  9. package/dist/vue-components.es26.js +89 -41
  10. package/dist/vue-components.es27.js +11 -90
  11. package/dist/vue-components.es28.js +41 -22
  12. package/dist/vue-components.es29.js +2 -5
  13. package/dist/vue-components.es30.js +20 -18
  14. package/dist/vue-components.es31.js +5 -30
  15. package/dist/vue-components.es32.js +16 -17
  16. package/dist/vue-components.es33.js +25 -7
  17. package/dist/vue-components.es34.js +22 -5
  18. package/dist/vue-components.es35.js +12 -19
  19. package/dist/vue-components.es36.js +5 -9
  20. package/dist/vue-components.es37.js +19 -31
  21. package/dist/vue-components.es38.js +9 -48
  22. package/dist/vue-components.es39.js +25 -20
  23. package/dist/vue-components.es40.js +48 -11
  24. package/dist/vue-components.es41.js +21 -60
  25. package/dist/vue-components.es42.js +114 -55
  26. package/dist/vue-components.es44.js +64 -32
  27. package/dist/vue-components.es45.js +55 -28
  28. package/dist/vue-components.es46.js +16 -41
  29. package/dist/vue-components.es47.js +33 -2
  30. package/dist/vue-components.es48.js +29 -2
  31. package/dist/vue-components.es49.js +41 -43
  32. package/dist/vue-components.es50.js +4 -2
  33. package/dist/vue-components.es51.js +2 -115
  34. package/dist/vue-components.es52.js +46 -0
  35. package/dist/vue-components.es53.js +2 -4
  36. package/dist/vue-components.es7.js +1 -1
  37. package/package.json +1 -1
  38. package/src/components/OmegaForm/OmegaWrapper.vue +9 -3
  39. package/src/components/OmegaForm/useOmegaForm.ts +1 -0
  40. package/dist/vue-components.es43.js +0 -19
@@ -1,5 +1,5 @@
1
1
  import { type S } from "effect-app";
2
- import { type FormProps, type OmegaFormState, type ShowErrorsOn } from "./OmegaFormStuff";
2
+ import { type FormProps, type OmegaFormApi, type OmegaFormState, type ShowErrorsOn } from "./OmegaFormStuff";
3
3
  import { type OmegaConfig, type OmegaFormReturn } from "./useOmegaForm";
4
4
  declare const _default: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, K extends keyof OmegaFormState<From, To> = keyof OmegaFormState<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
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & ({
@@ -14,7 +14,11 @@ declare const _default: <From extends Record<PropertyKey, any>, To extends Recor
14
14
  schema: S.Schema<To, From, never>;
15
15
  }) & ({
16
16
  isLoading: boolean;
17
- onSubmit: (data: To) => void;
17
+ onSubmit: (data: {
18
+ formApi: OmegaFormApi<From, To>;
19
+ meta: any;
20
+ value: To;
21
+ }) => void;
18
22
  } | {
19
23
  isLoading?: undefined;
20
24
  onSubmit?: FormProps<From, To>["onSubmit"];
@@ -24,6 +24,7 @@ export type OmegaConfig<T> = {
24
24
  interface OF<From, To> extends OmegaFormApi<From, To> {
25
25
  meta: MetaRecord<From>;
26
26
  filterItems?: FilterItems;
27
+ clear: () => void;
27
28
  }
28
29
  export declare const OmegaFormKey: InjectionKey<OF<any, any>>;
29
30
  type __VLS_PrettifyLocal<T> = {
@@ -1,8 +1,8 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-63452e71]{display:contents}fieldset[disabled][data-v-63452e71]>*{pointer-events:none}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(i,t){const d=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(d&&d.call(this),this.shadowRoot){const o=document.createElement("style");o.appendChild(document.createTextNode("fieldset[data-v-63452e71]{display:contents}fieldset[disabled][data-v-63452e71]>*{pointer-events:none}")),this.shadowRoot.appendChild(o)}},e.call(window.customElements,i,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-6de985c1]{display:contents}fieldset[disabled][data-v-6de985c1]>*{pointer-events:none}")),document.head.appendChild(n),window.customElements){const e=window.customElements.define;window.customElements.define=function(i,t){const d=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(d&&d.call(this),this.shadowRoot){const o=document.createElement("style");o.appendChild(document.createTextNode("fieldset[data-v-6de985c1]{display:contents}fieldset[disabled][data-v-6de985c1]>*{pointer-events:none}")),this.shadowRoot.appendChild(o)}},e.call(window.customElements,i,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  import o from "./vue-components.es20.js";
3
3
 
4
4
  import r from "./vue-components.es17.js";
5
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-63452e71"]]);
5
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-6de985c1"]]);
6
6
  export {
7
7
  e as default
8
8
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as F, getCurrentInstance as B, computed as v, onBeforeMount as C, watch as g, createElementBlock as O, openBlock as S, withModifiers as I, createElementVNode as L, unref as m, renderSlot as d, createCommentVNode as V, Fragment as k } from "vue";
1
+ import { defineComponent as F, getCurrentInstance as B, computed as v, onBeforeMount as C, watch as g, createElementBlock as O, openBlock as S, withModifiers as I, createElementVNode as L, unref as m, renderSlot as p, createCommentVNode as V, Fragment as k } from "vue";
2
2
  import { useStore as h } from "@tanstack/vue-form";
3
- import { getOmegaStore as $ } from "./vue-components.es40.js";
3
+ import { getOmegaStore as $ } from "./vue-components.es27.js";
4
4
  import { provideOmegaErrors as A } from "./vue-components.es8.js";
5
5
  import { useOmegaForm as K } from "./vue-components.es9.js";
6
6
  const _ = ["disabled"], D = /* @__PURE__ */ F({
@@ -23,19 +23,19 @@ const _ = ["disabled"], D = /* @__PURE__ */ F({
23
23
  onSubmit: {}
24
24
  },
25
25
  setup(y) {
26
- const o = y, w = B(), E = ({ value: e }) => new Promise((r) => {
27
- w.emit("submit", e);
28
- const n = g(() => o.isLoading, (t) => {
29
- t || (r(), n.stop());
26
+ const o = y, w = B(), E = ({ formApi: e, meta: r, value: i }) => new Promise((t) => {
27
+ w.emit("submit", { formApi: e, meta: r, value: i });
28
+ const n = g(() => o.isLoading, (u) => {
29
+ u || (t(), n.stop());
30
30
  });
31
- }), u = typeof o.isLoading < "u" ? E : typeof o.onSubmit < "u" ? o.onSubmit : void 0, l = o.form || !o.schema ? void 0 : K(
31
+ }), l = typeof o.isLoading < "u" ? E : typeof o.onSubmit < "u" ? o.onSubmit : void 0, f = o.form || !o.schema ? void 0 : K(
32
32
  o.schema,
33
33
  {
34
34
  ...o,
35
- onSubmit: u
35
+ onSubmit: l
36
36
  },
37
37
  o.omegaConfig
38
- ), s = v(() => o.form ?? l);
38
+ ), s = v(() => o.form ?? f);
39
39
  C(() => {
40
40
  if (!o.form) return;
41
41
  const e = Object.keys(o.form.options || {}), r = /* @__PURE__ */ new Set([
@@ -45,54 +45,54 @@ const _ = ["disabled"], D = /* @__PURE__ */ F({
45
45
  "asyncAlways",
46
46
  "form",
47
47
  "schema"
48
- ]), n = Object.fromEntries(
48
+ ]), i = Object.fromEntries(
49
49
  Object.entries(o).filter(
50
- ([a, c]) => a === "isLoading" ? !1 : !r.has(a) && c !== void 0
50
+ ([a, d]) => a === "isLoading" ? !1 : !r.has(a) && d !== void 0
51
51
  )
52
- ), t = Object.keys(n), i = e.filter(
53
- (a) => t.includes(a) && n[a] !== void 0
52
+ ), t = Object.keys(i), n = e.filter(
53
+ (a) => t.includes(a) && i[a] !== void 0
54
54
  );
55
- i.length > 0 && console.warn(
55
+ n.length > 0 && console.warn(
56
56
  `[OmegaWrapper] Overlapping keys found between form options and filtered props:
57
- ${i.join(
57
+ ${n.join(
58
58
  `,
59
59
  `
60
60
  )}.
61
61
  Props will overwrite existing form options. This might indicate a configuration issue.`
62
62
  );
63
- const b = {
63
+ const u = {
64
64
  ...s.value.options,
65
- ...n
65
+ ...i
66
66
  };
67
- u && (b.onSubmit = u), s.value.options = Object.fromEntries(
67
+ l && (u.onSubmit = l), s.value.options = Object.fromEntries(
68
68
  // TODO
69
- Object.entries(b).filter(
70
- ([a, c]) => c !== void 0
69
+ Object.entries(u).filter(
70
+ ([a, d]) => d !== void 0
71
71
  )
72
72
  );
73
73
  });
74
74
  const j = h(
75
75
  s.value.store,
76
76
  (e) => e.isSubmitting
77
- ), p = $(
77
+ ), b = $(
78
78
  s.value,
79
79
  o.subscribe
80
80
  ), M = h(
81
81
  s.value.store,
82
82
  (e) => e.submissionAttempts
83
- ), f = v(() => s.value.useStore((e) => e.errors));
83
+ ), c = v(() => s.value.useStore((e) => e.errors));
84
84
  return g(
85
- () => [s.value.filterItems, f.value.value],
85
+ () => [s.value.filterItems, c.value.value],
86
86
  () => {
87
- const e = s.value.filterItems, r = f.value.value;
87
+ const e = s.value.filterItems, r = c.value.value;
88
88
  return e ? r ? (Object.values(r).filter(
89
89
  (t) => !!t
90
90
  ).flatMap(
91
- (t) => Object.values(t).flat().map((i) => i.message)
91
+ (t) => Object.values(t).flat().map((n) => n.message)
92
92
  ).some((t) => t === e.message) && e.items.forEach((t) => {
93
- const i = s.value.getFieldMeta(t);
94
- i && s.value.setFieldMeta(t, {
95
- ...i,
93
+ const n = s.value.getFieldMeta(t);
94
+ n && s.value.setFieldMeta(t, {
95
+ ...n,
96
96
  errorMap: {
97
97
  onSubmit: [
98
98
  { path: [t], message: e.message }
@@ -101,18 +101,18 @@ Props will overwrite existing form options. This might indicate a configuration
101
101
  });
102
102
  }), {}) : {} : {};
103
103
  }
104
- ), A(M, f.value, o.showErrorsOn), (e, r) => (S(), O("form", {
104
+ ), A(M, c.value, o.showErrorsOn), (e, r) => (S(), O("form", {
105
105
  novalidate: "",
106
- onSubmit: r[0] || (r[0] = I((n) => s.value.handleSubmit(), ["prevent", "stop"]))
106
+ onSubmit: r[0] || (r[0] = I((i) => s.value.handleSubmit(), ["prevent", "stop"]))
107
107
  }, [
108
108
  L("fieldset", { disabled: m(j) }, [
109
109
  o.form ? (S(), O(k, { key: 0 }, [
110
- d(e.$slots, "externalForm", { subscribedValues: m(p) }, void 0, !0),
111
- d(e.$slots, "default", {}, void 0, !0)
112
- ], 64)) : m(l) ? d(e.$slots, "internalForm", {
110
+ p(e.$slots, "externalForm", { subscribedValues: m(b) }, void 0, !0),
111
+ p(e.$slots, "default", {}, void 0, !0)
112
+ ], 64)) : m(f) ? p(e.$slots, "internalForm", {
113
113
  key: 1,
114
- form: m(l),
115
- subscribedValues: m(p)
114
+ form: m(f),
115
+ subscribedValues: m(b)
116
116
  }, void 0, !0) : V("", !0)
117
117
  ], 8, _)
118
118
  ], 32));
@@ -1,5 +1,5 @@
1
1
  import { Exit as c, Runtime as s } from "effect";
2
- import { dual as n, isFunction as m } from "./vue-components.es26.js";
2
+ import { dual as n, isFunction as m } from "./vue-components.es28.js";
3
3
  const i = Symbol.for("clone-trait"), u = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
4
4
  n(2, (e, t) => u(e, { ...e, ...m(t) ? t(e) : t }));
5
5
  const b = (e) => new Promise((t, r) => e.addObserver((o) => {
@@ -1,4 +1,4 @@
1
- import { isFunction as c } from "./vue-components.es26.js";
1
+ import { isFunction as c } from "./vue-components.es28.js";
2
2
  const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
3
3
  export {
4
4
  s as isFunction,
@@ -1,4 +1,4 @@
1
- import { TraceAPI as r } from "./vue-components.es39.js";
1
+ import { TraceAPI as r } from "./vue-components.es41.js";
2
2
  var t = r.getInstance();
3
3
  export {
4
4
  t as trace
@@ -1,4 +1,4 @@
1
- import { ContextAPI as t } from "./vue-components.es38.js";
1
+ import { ContextAPI as t } from "./vue-components.es40.js";
2
2
  var o = t.getInstance();
3
3
  export {
4
4
  o as context
@@ -1,44 +1,92 @@
1
- const f = (c) => typeof c == "function", a = function(c, r) {
2
- switch (c) {
3
- case 0:
4
- case 1:
5
- throw new RangeError(`Invalid arity ${c}`);
6
- case 2:
7
- return function(n, t) {
8
- return arguments.length >= 2 ? r(n, t) : function(e) {
9
- return r(e, n);
10
- };
11
- };
12
- case 3:
13
- return function(n, t, e) {
14
- return arguments.length >= 3 ? r(n, t, e) : function(u) {
15
- return r(u, n, t);
16
- };
17
- };
18
- case 4:
19
- return function(n, t, e, u) {
20
- return arguments.length >= 4 ? r(n, t, e, u) : function(i) {
21
- return r(i, n, t, e);
22
- };
23
- };
24
- case 5:
25
- return function(n, t, e, u, i) {
26
- return arguments.length >= 5 ? r(n, t, e, u, i) : function(s) {
27
- return r(s, n, t, e, u);
28
- };
29
- };
30
- default:
31
- return function() {
32
- if (arguments.length >= c)
33
- return r.apply(this, arguments);
34
- const n = arguments;
35
- return function(t) {
36
- return r(t, ...n);
37
- };
38
- };
1
+ (function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(s,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const a=document.createElement("style");a.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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(a)}},e.call(window.customElements,s,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { defineComponent as w, getCurrentInstance as x, useId as C, computed as a, watch as f, nextTick as N, onMounted as d, ref as $, watchEffect as k, renderSlot as B, normalizeProps as I, guardReactiveProps as O, createElementVNode as _, normalizeClass as q, createBlock as L, createCommentVNode as P, unref as F, openBlock as S, mergeProps as T } from "vue";
3
+ import { useStore as z } from "@tanstack/vue-form";
4
+ import { useOmegaErrors as A } from "./vue-components.es8.js";
5
+ import D from "./vue-components.es42.js";
6
+
7
+ const J = /* @__PURE__ */ w({
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, v = x()?.appContext.components.VTextField, l = C(), o = e.field, r = z(o.store, (t) => t), m = a(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown"), n = a(() => r.value.value), g = a(
20
+ () => (
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+ r.value.meta.errors.map((t) => t?.message).filter(Boolean)
23
+ )
24
+ ), y = (t) => t == null || t === !1 || t === "" || Number.isNaN(t);
25
+ f(
26
+ () => !!n.value,
27
+ () => {
28
+ y(n.value) && e.meta?.type !== "boolean" && N(() => {
29
+ o.setValue(
30
+ e.meta?.nullableOrUndefined === "undefined" ? void 0 : null
31
+ );
32
+ });
33
+ }
34
+ ), d(() => {
35
+ !n.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null" && o.setValue(null);
36
+ });
37
+ const { addError: h, removeError: b, showErrors: E, showErrorsOn: V } = A(), s = $(!1);
38
+ k(() => {
39
+ (E.value || V === "onChange") && (s.value = !0);
40
+ });
41
+ const u = () => {
42
+ s.value = !0;
43
+ };
44
+ d(() => {
45
+ n.value && u();
46
+ });
47
+ const p = a(() => !s.value && m.value !== "select" ? [] : g.value);
48
+ f(
49
+ () => r.value.meta.errors,
50
+ () => {
51
+ r.value.meta.errors.length ? h({
52
+ inputId: l,
53
+ errors: r.value.meta.errors.map((t) => t.message).filter(Boolean),
54
+ label: e.label
55
+ }) : b(l);
56
+ }
57
+ );
58
+ const i = a(() => ({
59
+ id: l,
60
+ required: e.meta?.required,
61
+ minLength: e.meta?.type === "string" && e.meta?.minLength,
62
+ maxLength: e.meta?.type === "string" && e.meta?.maxLength,
63
+ max: e.meta?.type === "number" && e.meta?.maximum,
64
+ min: e.meta?.type === "number" && e.meta?.minimum,
65
+ name: e.field.name,
66
+ modelValue: e.field.state.value,
67
+ errorMessages: p.value,
68
+ error: !!p.value.length,
69
+ field: e.field,
70
+ setRealDirty: u,
71
+ type: m.value,
72
+ label: `${e.label}${e.meta?.required ? " *" : ""}`,
73
+ options: e.options
74
+ }));
75
+ return (t, R) => B(t.$slots, "default", I(O(i.value)), () => [
76
+ _("div", {
77
+ class: q(t.$attrs.class),
78
+ onFocusout: u
79
+ }, [
80
+ F(v) ? (S(), L(D, T({
81
+ key: 0,
82
+ "input-props": i.value
83
+ }, t.$attrs, {
84
+ "vuetify-value": i.value.field.state.value
85
+ }), null, 16, ["input-props", "vuetify-value"])) : P("", !0)
86
+ ], 34)
87
+ ]);
39
88
  }
40
- };
89
+ });
41
90
  export {
42
- a as dual,
43
- f as isFunction
91
+ J as default
44
92
  };
@@ -1,92 +1,13 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");if(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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),document.head.appendChild(i),window.customElements){const e=window.customElements.define;window.customElements.define=function(s,t){const n=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(n&&n.call(this),this.shadowRoot){const a=document.createElement("style");a.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;appearance:none;box-shadow:none;display:block;min-width:auto;height:auto;padding:.5em .5em .5em 1em}")),this.shadowRoot.appendChild(a)}},e.call(window.customElements,s,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { defineComponent as w, getCurrentInstance as x, useId as C, computed as a, watch as f, nextTick as N, onMounted as d, ref as $, watchEffect as k, renderSlot as B, normalizeProps as I, guardReactiveProps as O, createElementVNode as _, normalizeClass as q, createBlock as L, createCommentVNode as P, unref as F, openBlock as S, mergeProps as T } from "vue";
3
- import { useStore as z } from "@tanstack/vue-form";
4
- import { useOmegaErrors as A } from "./vue-components.es8.js";
5
- import D from "./vue-components.es51.js";
6
-
7
- const J = /* @__PURE__ */ w({
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, v = x()?.appContext.components.VTextField, l = C(), o = e.field, r = z(o.store, (t) => t), m = a(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown"), n = a(() => r.value.value), g = a(
20
- () => (
21
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
- r.value.meta.errors.map((t) => t?.message).filter(Boolean)
23
- )
24
- ), y = (t) => t == null || t === !1 || t === "" || Number.isNaN(t);
25
- f(
26
- () => !!n.value,
27
- () => {
28
- y(n.value) && e.meta?.type !== "boolean" && N(() => {
29
- o.setValue(
30
- e.meta?.nullableOrUndefined === "undefined" ? void 0 : null
31
- );
32
- });
33
- }
34
- ), d(() => {
35
- !n.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null" && o.setValue(null);
36
- });
37
- const { addError: h, removeError: b, showErrors: E, showErrorsOn: V } = A(), s = $(!1);
38
- k(() => {
39
- (E.value || V === "onChange") && (s.value = !0);
40
- });
41
- const u = () => {
42
- s.value = !0;
43
- };
44
- d(() => {
45
- n.value && u();
46
- });
47
- const p = a(() => !s.value && m.value !== "select" ? [] : g.value);
48
- f(
49
- () => r.value.meta.errors,
50
- () => {
51
- r.value.meta.errors.length ? h({
52
- inputId: l,
53
- errors: r.value.meta.errors.map((t) => t.message).filter(Boolean),
54
- label: e.label
55
- }) : b(l);
56
- }
57
- );
58
- const i = a(() => ({
59
- id: l,
60
- required: e.meta?.required,
61
- minLength: e.meta?.type === "string" && e.meta?.minLength,
62
- maxLength: e.meta?.type === "string" && e.meta?.maxLength,
63
- max: e.meta?.type === "number" && e.meta?.maximum,
64
- min: e.meta?.type === "number" && e.meta?.minimum,
65
- name: e.field.name,
66
- modelValue: e.field.state.value,
67
- errorMessages: p.value,
68
- error: !!p.value.length,
69
- field: e.field,
70
- setRealDirty: u,
71
- type: m.value,
72
- label: `${e.label}${e.meta?.required ? " *" : ""}`,
73
- options: e.options
74
- }));
75
- return (t, R) => B(t.$slots, "default", I(O(i.value)), () => [
76
- _("div", {
77
- class: q(t.$attrs.class),
78
- onFocusout: u
79
- }, [
80
- F(v) ? (S(), L(D, T({
81
- key: 0,
82
- "input-props": i.value
83
- }, t.$attrs, {
84
- "vuetify-value": i.value.field.state.value
85
- }), null, 16, ["input-props", "vuetify-value"])) : P("", !0)
86
- ], 34)
87
- ]);
88
- }
89
- });
1
+ import { useStore as u } from "@tanstack/vue-form";
2
+ import { computed as f } from "vue";
3
+ function c(o, t) {
4
+ return f(() => t ? u(o.store, (n) => {
5
+ const r = {};
6
+ for (const e of t)
7
+ r[e] = n[e];
8
+ return r;
9
+ }).value : {});
10
+ }
90
11
  export {
91
- J as default
12
+ c as getOmegaStore
92
13
  };
@@ -1,25 +1,44 @@
1
- function a(t) {
2
- return Symbol.for(t);
3
- }
4
- var c = (
5
- /** @class */
6
- /* @__PURE__ */ (function() {
7
- function t(u) {
8
- var e = this;
9
- e._currentContext = u ? new Map(u) : /* @__PURE__ */ new Map(), e.getValue = function(n) {
10
- return e._currentContext.get(n);
11
- }, e.setValue = function(n, r) {
12
- var o = new t(e._currentContext);
13
- return o._currentContext.set(n, r), o;
14
- }, e.deleteValue = function(n) {
15
- var r = new t(e._currentContext);
16
- return r._currentContext.delete(n), r;
1
+ const f = (c) => typeof c == "function", a = function(c, r) {
2
+ switch (c) {
3
+ case 0:
4
+ case 1:
5
+ throw new RangeError(`Invalid arity ${c}`);
6
+ case 2:
7
+ return function(n, t) {
8
+ return arguments.length >= 2 ? r(n, t) : function(e) {
9
+ return r(e, n);
10
+ };
17
11
  };
18
- }
19
- return t;
20
- })()
21
- ), x = new c();
12
+ case 3:
13
+ return function(n, t, e) {
14
+ return arguments.length >= 3 ? r(n, t, e) : function(u) {
15
+ return r(u, n, t);
16
+ };
17
+ };
18
+ case 4:
19
+ return function(n, t, e, u) {
20
+ return arguments.length >= 4 ? r(n, t, e, u) : function(i) {
21
+ return r(i, n, t, e);
22
+ };
23
+ };
24
+ case 5:
25
+ return function(n, t, e, u, i) {
26
+ return arguments.length >= 5 ? r(n, t, e, u, i) : function(s) {
27
+ return r(s, n, t, e, u);
28
+ };
29
+ };
30
+ default:
31
+ return function() {
32
+ if (arguments.length >= c)
33
+ return r.apply(this, arguments);
34
+ const n = arguments;
35
+ return function(t) {
36
+ return r(t, ...n);
37
+ };
38
+ };
39
+ }
40
+ };
22
41
  export {
23
- x as ROOT_CONTEXT,
24
- a as createContextKey
42
+ a as dual,
43
+ f as isFunction
25
44
  };
@@ -1,7 +1,4 @@
1
- var R;
2
- (function(E) {
3
- E[E.NONE = 0] = "NONE", E[E.ERROR = 30] = "ERROR", E[E.WARN = 50] = "WARN", E[E.INFO = 60] = "INFO", E[E.DEBUG = 70] = "DEBUG", E[E.VERBOSE = 80] = "VERBOSE", E[E.ALL = 9999] = "ALL";
4
- })(R || (R = {}));
1
+ import f from "./vue-components.es26.js";
5
2
  export {
6
- R as DiagLogLevel
3
+ f as default
7
4
  };
@@ -1,23 +1,25 @@
1
- import { NoopTracer as o } from "./vue-components.es31.js";
2
- var s = new o(), c = (
1
+ function a(t) {
2
+ return Symbol.for(t);
3
+ }
4
+ var c = (
3
5
  /** @class */
4
- (function() {
5
- function r(t, e, n, a) {
6
- this._provider = t, this.name = e, this.version = n, this.options = a;
6
+ /* @__PURE__ */ (function() {
7
+ function t(u) {
8
+ var e = this;
9
+ e._currentContext = u ? new Map(u) : /* @__PURE__ */ new Map(), e.getValue = function(n) {
10
+ return e._currentContext.get(n);
11
+ }, e.setValue = function(n, r) {
12
+ var o = new t(e._currentContext);
13
+ return o._currentContext.set(n, r), o;
14
+ }, e.deleteValue = function(n) {
15
+ var r = new t(e._currentContext);
16
+ return r._currentContext.delete(n), r;
17
+ };
7
18
  }
8
- return r.prototype.startSpan = function(t, e, n) {
9
- return this._getTracer().startSpan(t, e, n);
10
- }, r.prototype.startActiveSpan = function(t, e, n, a) {
11
- var i = this._getTracer();
12
- return Reflect.apply(i.startActiveSpan, i, arguments);
13
- }, r.prototype._getTracer = function() {
14
- if (this._delegate)
15
- return this._delegate;
16
- var t = this._provider.getDelegateTracer(this.name, this.version, this.options);
17
- return t ? (this._delegate = t, this._delegate) : s;
18
- }, r;
19
+ return t;
19
20
  })()
20
- );
21
+ ), x = new c();
21
22
  export {
22
- c as ProxyTracer
23
+ x as ROOT_CONTEXT,
24
+ a as createContextKey
23
25
  };
@@ -1,32 +1,7 @@
1
- import { ContextAPI as l } from "./vue-components.es38.js";
2
- import { getSpanContext as m, setSpan as d } from "./vue-components.es45.js";
3
- import { NonRecordingSpan as p } from "./vue-components.es37.js";
4
- import { isSpanContextValid as S } from "./vue-components.es35.js";
5
- var f = l.getInstance(), I = (
6
- /** @class */
7
- (function() {
8
- function t() {
9
- }
10
- return t.prototype.startSpan = function(u, e, r) {
11
- r === void 0 && (r = f.active());
12
- var i = !!e?.root;
13
- if (i)
14
- return new p();
15
- var n = r && m(r);
16
- return g(n) && S(n) ? new p(n) : new p();
17
- }, t.prototype.startActiveSpan = function(u, e, r, i) {
18
- var n, o, a;
19
- if (!(arguments.length < 2)) {
20
- arguments.length === 2 ? a = e : arguments.length === 3 ? (n = e, a = r) : (n = e, o = r, a = i);
21
- var v = o ?? f.active(), s = this.startSpan(u, n, v), c = d(v, s);
22
- return f.with(c, a, void 0, s);
23
- }
24
- }, t;
25
- })()
26
- );
27
- function g(t) {
28
- return typeof t == "object" && typeof t.spanId == "string" && typeof t.traceId == "string" && typeof t.traceFlags == "number";
29
- }
1
+ var R;
2
+ (function(E) {
3
+ E[E.NONE = 0] = "NONE", E[E.ERROR = 30] = "ERROR", E[E.WARN = 50] = "WARN", E[E.INFO = 60] = "INFO", E[E.DEBUG = 70] = "DEBUG", E[E.VERBOSE = 80] = "VERBOSE", E[E.ALL = 9999] = "ALL";
4
+ })(R || (R = {}));
30
5
  export {
31
- I as NoopTracer
6
+ R as DiagLogLevel
32
7
  };