@effect-app/vue-components 0.10.3 → 0.10.4

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.
@@ -1,6 +1,6 @@
1
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
2
  import { useStore as g } from "@tanstack/vue-form";
3
- import { getOmegaStore as B } from "./vue-components.es25.js";
3
+ import { getOmegaStore as B } from "./vue-components.es24.js";
4
4
  import { provideOmegaErrors as C } from "./vue-components.es7.js";
5
5
  import { useOmegaForm as I } from "./vue-components.es8.js";
6
6
  const $ = ["disabled"], N = /* @__PURE__ */ w({
@@ -1,52 +1,52 @@
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.es7.js";
3
- import { mdiLink as D } from "@mdi/js";
4
- import { useIntl as G } from "./vue-components.es3.js";
5
- const L = {
1
+ import { defineComponent as E, getCurrentInstance as C, computed as x, createBlock as o, openBlock as r, Transition as B, withCtx as n, createElementBlock as d, createCommentVNode as b, unref as e, renderSlot as w, normalizeProps as I, guardReactiveProps as V, resolveDynamicComponent as a, normalizeClass as N, createElementVNode as u, toDisplayString as c, Fragment as v, renderList as g, createTextVNode as k } from "vue";
2
+ import { useOmegaErrors as O } from "./vue-components.es7.js";
3
+ import { mdiLink as z } from "@mdi/js";
4
+ import { useIntl as D } from "./vue-components.es3.js";
5
+ const G = {
6
6
  key: 0,
7
7
  class: "error-alert"
8
- }, M = { class: "text-h6 mb-3" }, P = { class: "font-weight-medium" }, S = { class: "error-message" }, T = ["href"], $ = { key: 1 }, H = /* @__PURE__ */ C({
8
+ }, L = { class: "text-h6 mb-3" }, M = { class: "font-weight-medium" }, P = { class: "error-message" }, S = ["href"], T = { key: 1 }, H = /* @__PURE__ */ E({
9
9
  __name: "OmegaErrors",
10
- setup(j) {
11
- const m = x(), f = m == null ? void 0 : m.appContext.components.VAlert, { errors: n, generalErrors: _, showErrors: E } = z(), { trans: h } = G(), p = B(() => _.value ? _.value.filter(
10
+ setup($) {
11
+ const m = C()?.appContext.components.VAlert, { errors: s, generalErrors: p, showErrors: y } = O(), { trans: _ } = D(), f = x(() => p.value ? p.value.filter(
12
12
  (i) => !!i
13
13
  ).flatMap(
14
- (i) => Object.values(i).filter((a) => !!a).flatMap(
15
- (a) => a.filter(
16
- (r) => !!(r != null && r.message)
17
- ).map((r) => r.message)
14
+ (i) => Object.values(i).filter((l) => !!l).flatMap(
15
+ (l) => l.filter(
16
+ (t) => !!t?.message
17
+ ).map((t) => t.message)
18
18
  )
19
19
  ) : []);
20
- return (i, a) => (t(), o(b, null, {
21
- default: l(() => [
22
- e(E) && (e(n).length || p.value.length) ? (t(), c("div", L, [
23
- I(i.$slots, "default", V(N({ errors: e(n), showedGeneralErrors: p.value })), () => [
24
- (t(), o(s(e(f) ? "v-alert" : "div"), {
25
- class: O([e(f) ? "mb-4" : "error-alert-content", "mb-4"]),
20
+ return (i, l) => (r(), o(B, null, {
21
+ default: n(() => [
22
+ e(y) && (e(s).length || f.value.length) ? (r(), d("div", G, [
23
+ w(i.$slots, "default", I(V({ errors: e(s), showedGeneralErrors: f.value })), () => [
24
+ (r(), o(a(e(m) ? "v-alert" : "div"), {
25
+ class: N([e(m) ? "mb-4" : "error-alert-content", "mb-4"]),
26
26
  type: "error",
27
27
  variant: "tonal",
28
28
  role: "alert",
29
29
  "aria-live": "polite"
30
30
  }, {
31
- default: l(() => [
32
- d("div", M, u(e(h)("form.includes_error")) + ":", 1),
33
- e(n).length ? (t(), o(s(e(n).length > 1 ? "ul" : "div"), {
31
+ default: n(() => [
32
+ u("div", L, c(e(_)("form.includes_error")) + ":", 1),
33
+ e(s).length ? (r(), o(a(e(s).length > 1 ? "ul" : "div"), {
34
34
  key: 0,
35
35
  class: "error-list"
36
36
  }, {
37
- default: l(() => [
38
- (t(!0), c(g, null, k(e(n), (r) => (t(), o(s(e(n).length > 1 ? "li" : "div"), {
39
- key: r.inputId,
37
+ default: n(() => [
38
+ (r(!0), d(v, null, g(e(s), (t) => (r(), o(a(e(s).length > 1 ? "li" : "div"), {
39
+ key: t.inputId,
40
40
  class: "error-item"
41
41
  }, {
42
- default: l(() => [
43
- d("div", P, u(r.label), 1),
44
- d("div", S, [
45
- (t(), o(s(r.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
46
- default: l(() => [
47
- (t(!0), c(g, null, k(r.errors, (v) => (t(), o(s(r.errors.length > 1 ? "li" : "span"), { key: v }, {
48
- default: l(() => [
49
- y(u(v), 1)
42
+ default: n(() => [
43
+ u("div", M, c(t.label), 1),
44
+ u("div", P, [
45
+ (r(), o(a(t.errors.length > 1 ? "ul" : "div"), { class: "error-list" }, {
46
+ default: n(() => [
47
+ (r(!0), d(v, null, g(t.errors, (h) => (r(), o(a(t.errors.length > 1 ? "li" : "span"), { key: h }, {
48
+ default: n(() => [
49
+ k(c(h), 1)
50
50
  ]),
51
51
  _: 2
52
52
  }, 1024))), 128))
@@ -54,33 +54,33 @@ const L = {
54
54
  _: 2
55
55
  }, 1024))
56
56
  ]),
57
- d("a", {
58
- href: `#${r.inputId}`,
57
+ u("a", {
58
+ href: `#${t.inputId}`,
59
59
  class: "error-link"
60
60
  }, [
61
- (t(), o(s(e(f) ? "v-icon" : "i"), {
62
- icon: e(D),
61
+ (r(), o(a(e(m) ? "v-icon" : "i"), {
62
+ icon: e(z),
63
63
  "aria-hidden": "true"
64
64
  }, {
65
- default: l(() => a[0] || (a[0] = [
66
- d("i", null, "🔗", -1)
65
+ default: n(() => l[0] || (l[0] = [
66
+ u("i", null, "🔗", -1)
67
67
  ])),
68
68
  _: 1,
69
69
  __: [0]
70
70
  }, 8, ["icon"])),
71
- y(" " + u(e(h)("form.fix_input")), 1)
72
- ], 8, T)
71
+ k(" " + c(e(_)("form.fix_input")), 1)
72
+ ], 8, S)
73
73
  ]),
74
74
  _: 2
75
75
  }, 1024))), 128))
76
76
  ]),
77
77
  _: 1
78
- })) : (t(), c("span", $, u(p.value[0]), 1))
78
+ })) : (r(), d("span", T, c(f.value[0]), 1))
79
79
  ]),
80
80
  _: 1
81
81
  }, 8, ["class"]))
82
82
  ], !0)
83
- ])) : w("", !0)
83
+ ])) : b("", !0)
84
84
  ]),
85
85
  _: 3
86
86
  }));
@@ -1,101 +1,13 @@
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 q, getCurrentInstance as L, useId as P, computed as l, watch as w, nextTick as F, onMounted as x, ref as S, watchEffect as T, renderSlot as z, normalizeProps as A, guardReactiveProps as D, createElementVNode as M, normalizeClass as R, createBlock as U, createCommentVNode as Z, 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.es7.js";
5
- import Q from "./vue-components.es27.js";
6
-
7
- const re = /* @__PURE__ */ q({
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 t = C, o = L(), N = o == null ? void 0 : o.appContext.components.VTextField, s = P(), u = t.field, a = J(u.store, (e) => e), f = l(() => {
20
- var e, r;
21
- return t.type ? t.type : ((e = t.meta) == null ? void 0 : e.type) === "string" ? t.meta.format === "email" ? "email" : "string" : ((r = t.meta) == null ? void 0 : r.type) || "unknown";
22
- }), n = l(() => a.value.value), $ = l(
23
- () => (
24
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
- a.value.meta.errors.map((e) => e == null ? void 0 : e.message).filter(Boolean)
26
- )
27
- ), k = (e) => e == null || e === !1 || e === "" || Number.isNaN(e);
28
- w(
29
- () => !!n.value,
30
- () => {
31
- var e;
32
- k(n.value) && ((e = t.meta) == null ? void 0 : e.type) !== "boolean" && F(() => {
33
- var r;
34
- u.setValue(
35
- ((r = t.meta) == null ? void 0 : r.nullableOrUndefined) === "undefined" ? void 0 : null
36
- );
37
- });
38
- }
39
- ), x(() => {
40
- var e, r;
41
- !n.value && !((e = t.meta) != null && e.required) && ((r = t.meta) == null ? void 0 : r.nullableOrUndefined) === "null" && u.setValue(null);
42
- });
43
- const { addError: B, removeError: I, showErrors: O, showErrorsOn: _ } = K(), i = S(!1);
44
- T(() => {
45
- (O.value || _ === "onChange") && (i.value = !0);
46
- });
47
- const m = () => {
48
- i.value = !0;
49
- };
50
- x(() => {
51
- n.value && m();
52
- });
53
- const d = l(() => !i.value && f.value !== "select" ? [] : $.value);
54
- w(
55
- () => a.value.meta.errors,
56
- () => {
57
- a.value.meta.errors.length ? B({
58
- inputId: s,
59
- errors: a.value.meta.errors.map((e) => e.message).filter(Boolean),
60
- label: t.label
61
- }) : I(s);
62
- }
63
- );
64
- const p = l(() => {
65
- var e, r, c, v, g, y, h, b, E, V;
66
- return {
67
- id: s,
68
- required: (e = t.meta) == null ? void 0 : e.required,
69
- minLength: ((r = t.meta) == null ? void 0 : r.type) === "string" && ((c = t.meta) == null ? void 0 : c.minLength),
70
- maxLength: ((v = t.meta) == null ? void 0 : v.type) === "string" && ((g = t.meta) == null ? void 0 : g.maxLength),
71
- max: ((y = t.meta) == null ? void 0 : y.type) === "number" && ((h = t.meta) == null ? void 0 : h.maximum),
72
- min: ((b = t.meta) == null ? void 0 : b.type) === "number" && ((E = t.meta) == null ? void 0 : E.minimum),
73
- name: t.field.name,
74
- modelValue: t.field.state.value,
75
- errorMessages: d.value,
76
- error: !!d.value.length,
77
- field: t.field,
78
- setRealDirty: m,
79
- type: f.value,
80
- label: `${t.label}${(V = t.meta) != null && V.required ? " *" : ""}`,
81
- options: t.options
82
- };
83
- });
84
- return (e, r) => z(e.$slots, "default", A(D(p.value)), () => [
85
- M("div", {
86
- class: R(e.$attrs.class),
87
- onFocusout: m
88
- }, [
89
- j(N) ? (G(), U(Q, H({
90
- key: 0,
91
- "input-props": p.value
92
- }, e.$attrs, {
93
- "vuetify-value": p.value.field.state.value
94
- }), null, 16, ["input-props", "vuetify-value"])) : Z("", !0)
95
- ], 34)
96
- ]);
97
- }
98
- });
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
+ }
99
11
  export {
100
- re as default
12
+ c as getOmegaStore
101
13
  };
@@ -1,13 +1,92 @@
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
- }
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.es7.js";
5
+ import D from "./vue-components.es27.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
+ });
11
90
  export {
12
- c as getOmegaStore
91
+ J as default
13
92
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es24.js";
1
+ import f from "./vue-components.es25.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
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)}})();
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
2
  import o from "./vue-components.es27.js";
3
3
 
4
4
  export {
@@ -1,7 +1,7 @@
1
- import { defineComponent as d, inject as f, computed as r, createBlock as n, openBlock as l, resolveDynamicComponent as v, withCtx as m, createCommentVNode as c, mergeProps as h, renderSlot as y, normalizeProps as g, guardReactiveProps as C } from "vue";
2
- import { generateInputStandardSchemaFromFieldMeta as b } from "./vue-components.es9.js";
3
- import k from "./vue-components.es24.js";
4
- const $ = /* @__PURE__ */ d({
1
+ import { defineComponent as d, inject as f, computed as o, createBlock as n, openBlock as m, resolveDynamicComponent as v, withCtx as l, createCommentVNode as c, mergeProps as y, renderSlot as g, normalizeProps as h, guardReactiveProps as C } from "vue";
2
+ import { generateInputStandardSchemaFromFieldMeta as F } from "./vue-components.es9.js";
3
+ import b from "./vue-components.es25.js";
4
+ const P = /* @__PURE__ */ d({
5
5
  inheritAttrs: !1,
6
6
  __name: "OmegaInput",
7
7
  props: {
@@ -13,32 +13,32 @@ const $ = /* @__PURE__ */ d({
13
13
  type: {}
14
14
  },
15
15
  setup(s) {
16
- const t = s, a = f(
16
+ const a = s, r = f(
17
17
  "getMetaFromArray",
18
18
  null
19
- ), o = r(() => a != null && a.value && a.value(t.name) ? a.value(t.name) : t.form.meta[t.name]), i = r(() => {
20
- if (!o.value)
19
+ ), t = o(() => r?.value && r.value(a.name) ? r.value(a.name) : a.form.meta[a.name]), i = o(() => {
20
+ if (!t.value)
21
21
  throw new Error("Meta is undefined");
22
- return b(o.value);
22
+ return F(t.value);
23
23
  });
24
- return (e, w) => (l(), n(v(e.form.Field), {
24
+ return (e, M) => (m(), n(v(e.form.Field), {
25
25
  name: e.name,
26
26
  validators: {
27
27
  onChange: i.value,
28
28
  ...e.validators
29
29
  }
30
30
  }, {
31
- default: m(({ field: p }) => [
32
- o.value ? (l(), n(k, h({
31
+ default: l(({ field: p }) => [
32
+ t.value ? (m(), n(b, y({
33
33
  key: 0,
34
34
  field: p,
35
35
  label: e.label,
36
36
  options: e.options,
37
- meta: o.value,
37
+ meta: t.value,
38
38
  type: e.type
39
39
  }, e.$attrs), {
40
- default: m((u) => [
41
- y(e.$slots, "default", g(C(u)))
40
+ default: l((u) => [
41
+ g(e.$slots, "default", h(C(u)))
42
42
  ]),
43
43
  _: 2
44
44
  }, 1040, ["field", "label", "options", "meta", "type"])) : c("", !0)
@@ -48,5 +48,5 @@ const $ = /* @__PURE__ */ d({
48
48
  }
49
49
  });
50
50
  export {
51
- $ as default
51
+ P as default
52
52
  };
@@ -12,64 +12,57 @@ const R = /* @__PURE__ */ _({
12
12
  order: {},
13
13
  sort: {}
14
14
  },
15
- setup(m) {
16
- const u = (e) => (t) => Object.fromEntries(
17
- Object.entries(t).map(([r, o]) => [r, e(o, r)])
18
- ), a = (e) => (t) => Object.fromEntries(
19
- Object.entries(t).filter(([r, o]) => e(o, r))
20
- ), f = (e) => (t) => Object.entries(t).reduce(
21
- (r, [o, c]) => {
22
- const i = e(c, o);
23
- return i !== !1 && (r[o] = i), r;
15
+ setup(p) {
16
+ const m = (e) => (r) => Object.fromEntries(
17
+ Object.entries(r).map(([t, n]) => [t, e(n, t)])
18
+ ), u = (e) => (r) => Object.fromEntries(
19
+ Object.entries(r).filter(([t, n]) => e(n, t))
20
+ ), a = (e) => (r) => Object.entries(r).reduce(
21
+ (t, [n, c]) => {
22
+ const i = e(c, n);
23
+ return i !== !1 && (t[n] = i), t;
24
24
  },
25
25
  {}
26
- ), n = m, p = (e, t) => {
27
- const r = (t == null ? void 0 : t.indexOf(e)) ?? -1;
28
- return r === -1 ? Number.MAX_SAFE_INTEGER : r;
26
+ ), o = p, f = (e, r) => {
27
+ const t = r?.indexOf(e) ?? -1;
28
+ return t === -1 ? Number.MAX_SAFE_INTEGER : t;
29
29
  }, d = s.mapInput(
30
30
  s.number,
31
- (e) => p(e.name, n.order || [])
31
+ (e) => f(e.name, o.order || [])
32
32
  ), b = O(
33
33
  () => k(
34
- n.form.meta,
34
+ o.form.meta,
35
35
  // include / exclude
36
- a(
37
- (e, t) => {
38
- var r, o;
39
- return n.pick ? n.pick.includes(t) && !((r = n.omit) != null && r.includes(t)) : !((o = n.omit) != null && o.includes(t));
40
- }
36
+ u(
37
+ (e, r) => o.pick ? o.pick.includes(r) && !o.omit?.includes(r) : !o.omit?.includes(r)
41
38
  ),
42
39
  (e) => e,
43
40
  // labelMap and adding name
44
- u((e, t) => {
45
- var r;
46
- return {
47
- name: t,
48
- label: ((r = n.labelMap) == null ? void 0 : r.call(n, t)) || t,
49
- ...e
50
- };
51
- }),
41
+ m((e, r) => ({
42
+ name: r,
43
+ label: o.labelMap?.(r) || r,
44
+ ...e
45
+ })),
52
46
  // filterMap
53
- n.filterMap ? f((e) => {
54
- var r;
55
- const t = (r = n.filterMap) == null ? void 0 : r.call(n, e.name, e);
56
- return t === void 0 || t === !0 ? e : t;
47
+ o.filterMap ? a((e) => {
48
+ const r = o.filterMap?.(e.name, e);
49
+ return r === void 0 || r === !0 ? e : r;
57
50
  }) : (e) => e,
58
51
  // transform to array
59
52
  (e) => Object.values(e),
60
53
  // order
61
54
  l.sort(d),
62
55
  // sort
63
- n.sort ? l.sort(n.sort) : (e) => e
56
+ o.sort ? l.sort(o.sort) : (e) => e
64
57
  )
65
58
  );
66
- return (e, t) => (M(!0), j(E, null, A(b.value, ({ name: r, label: o, ...c }) => F(e.$slots, "default", {
67
- child: { name: r, label: o, ...c }
59
+ return (e, r) => (M(!0), j(E, null, A(b.value, ({ name: t, label: n, ...c }) => F(e.$slots, "default", {
60
+ child: { name: t, label: n, ...c }
68
61
  }, () => [
69
62
  g(v, h({
70
- form: n.form,
71
- name: r,
72
- label: o
63
+ form: o.form,
64
+ name: t,
65
+ label: n
73
66
  }, { ref_for: !0 }, c), null, 16, ["form", "name", "label"])
74
67
  ])), 256));
75
68
  }
@@ -1,135 +1,127 @@
1
- import { useForm as I } from "@tanstack/vue-form";
2
- import { S as N } from "effect-app";
3
- import { generateMetaFromSchema as R } from "./vue-components.es9.js";
4
- import { computed as b, onUnmounted as A, onMounted as D, onBeforeUnmount as J, provide as K } from "vue";
5
- import { isObject as q } from "./vue-components.es20.js";
6
- import M from "./vue-components.es21.js";
7
- const x = Symbol("OmegaForm"), H = (w, s, i) => {
8
- if (!w) throw new Error("Schema is required");
9
- const V = N.standardSchemaV1(w), { filterItems: L, meta: t } = R(w), d = b(() => {
10
- var l;
11
- if ((l = i == null ? void 0 : i.persistency) != null && l.id)
12
- return i.persistency.id;
13
- const e = window.location.pathname, r = Object.keys(t);
1
+ import { useForm as j } from "@tanstack/vue-form";
2
+ import { S as E } from "effect-app";
3
+ import { generateMetaFromSchema as O } from "./vue-components.es9.js";
4
+ import { computed as v, onUnmounted as P, onMounted as I, onBeforeUnmount as N, provide as R } from "vue";
5
+ import { isObject as A } from "./vue-components.es20.js";
6
+ import D from "./vue-components.es21.js";
7
+ const J = Symbol("OmegaForm"), $ = (d, i, o) => {
8
+ if (!d) throw new Error("Schema is required");
9
+ const S = E.standardSchemaV1(d), { filterItems: b, meta: l } = O(d), n = v(() => {
10
+ if (o?.persistency?.id)
11
+ return o.persistency.id;
12
+ const e = window.location.pathname, r = Object.keys(l);
14
13
  return `${e}-${r.join("-")}`;
15
- }), U = () => {
14
+ }), g = () => {
16
15
  const e = new URLSearchParams(window.location.search);
17
- e.delete(d.value);
16
+ e.delete(n.value);
18
17
  const r = new URL(window.location.href);
19
18
  r.search = e.toString(), window.history.replaceState({}, "", r.toString());
20
19
  };
21
- function v(e, r) {
22
- for (const l in r)
23
- r[l] && q(r[l]) ? (e[l] || (e[l] = {}), v(e[l], r[l])) : e[l] = r[l];
20
+ function m(e, r) {
21
+ for (const s in r)
22
+ r[s] && A(r[s]) ? (e[s] || (e[s] = {}), m(e[s], r[s])) : e[s] = r[s];
24
23
  return e;
25
24
  }
26
- const j = b(() => {
27
- var l;
28
- if (s != null && s.defaultValues && !((l = i == null ? void 0 : i.persistency) != null && l.overrideDefaultValues))
29
- return s == null ? void 0 : s.defaultValues;
25
+ const V = v(() => {
26
+ if (i?.defaultValues && !o?.persistency?.overrideDefaultValues)
27
+ return i?.defaultValues;
30
28
  let e;
31
- const r = i == null ? void 0 : i.persistency;
32
- if (!(r != null && r.policies) || r.policies.length === 0) return {};
29
+ const r = o?.persistency;
30
+ if (!r?.policies || r.policies.length === 0) return {};
33
31
  if (r.policies.includes("querystring"))
34
32
  try {
35
- const c = new URLSearchParams(window.location.search).get(d.value);
36
- U(), c && (e = JSON.parse(c));
37
- } catch (u) {
38
- console.error(u);
33
+ const t = new URLSearchParams(window.location.search).get(n.value);
34
+ g(), t && (e = JSON.parse(t));
35
+ } catch (s) {
36
+ console.error(s);
39
37
  }
40
38
  if (
41
39
  // query string has higher priority than local/session storage
42
40
  !e && (r.policies.includes("local") || r.policies.includes("session"))
43
41
  ) {
44
- const u = r.policies.includes("local") ? localStorage : sessionStorage;
45
- if (u)
42
+ const s = r.policies.includes("local") ? localStorage : sessionStorage;
43
+ if (s)
46
44
  try {
47
- const c = JSON.parse(
48
- u.getItem(d.value) || "{}"
45
+ const t = JSON.parse(
46
+ s.getItem(n.value) || "{}"
49
47
  );
50
- u.removeItem(d.value), e = c;
51
- } catch (c) {
52
- console.error(c);
48
+ s.removeItem(n.value), e = t;
49
+ } catch (t) {
50
+ console.error(t);
53
51
  }
54
52
  }
55
- if (e ?? (e = {}), (s == null ? void 0 : s.defaultValues) == null)
53
+ if (e ??= {}, i?.defaultValues == null)
56
54
  return e;
57
55
  {
58
- const u = s == null ? void 0 : s.defaultValues;
59
- return v(u, e);
56
+ const s = i?.defaultValues;
57
+ return m(s, e);
60
58
  }
61
- }), n = I({
62
- ...s,
59
+ }), a = j({
60
+ ...i,
63
61
  validators: {
64
- onSubmit: V,
65
- ...(s == null ? void 0 : s.validators) || {}
62
+ onSubmit: S,
63
+ ...i?.validators || {}
66
64
  },
67
- onSubmit: s != null && s.onSubmit ? ({ formApi: e, meta: r, value: l }) => {
68
- var u;
69
- return (u = s.onSubmit) == null ? void 0 : u.call(s, {
70
- formApi: e,
71
- meta: r,
72
- value: l
73
- });
74
- } : void 0,
75
- defaultValues: j.value
76
- }), E = () => {
77
- Object.keys(t).forEach((e) => {
78
- n.setFieldValue(e, void 0);
65
+ onSubmit: i?.onSubmit ? ({ formApi: e, meta: r, value: s }) => i.onSubmit?.({
66
+ formApi: e,
67
+ meta: r,
68
+ value: s
69
+ }) : void 0,
70
+ defaultValues: V.value
71
+ }), L = () => {
72
+ Object.keys(l).forEach((e) => {
73
+ a.setFieldValue(e, void 0);
79
74
  });
80
- }, S = (e) => e.reduce(
81
- (r, l) => {
82
- const u = l.split(".");
83
- return u.reduce((c, o, P) => (P === u.length - 1 ? c[o] = n.getFieldValue(l) : c[o] = c[o] ?? {}, c[o]), r), r;
75
+ }, p = (e) => e.reduce(
76
+ (r, s) => {
77
+ const t = s.split(".");
78
+ return t.reduce((c, u, U) => (U === t.length - 1 ? c[u] = a.getFieldValue(s) : c[u] = c[u] ?? {}, c[u]), r), r;
84
79
  },
85
80
  {}
86
- ), f = (e) => {
81
+ ), w = (e) => {
87
82
  if (e) {
88
83
  if (Array.isArray(e.keys))
89
- return S(e.keys);
84
+ return p(e.keys);
90
85
  if (Array.isArray(e.banKeys)) {
91
- const r = Object.keys(t).filter(
92
- (l) => {
93
- var u;
94
- return (u = e.banKeys) == null ? void 0 : u.includes(l);
95
- }
86
+ const r = Object.keys(l).filter(
87
+ (s) => e.banKeys?.includes(s)
96
88
  );
97
- return S(r);
89
+ return p(r);
98
90
  }
99
- return n.store.state.values;
91
+ return a.store.state.values;
100
92
  }
101
- }, h = () => {
102
- const e = i == null ? void 0 : i.persistency;
103
- if (!(!(e != null && e.policies) || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
93
+ }, f = () => {
94
+ const e = o?.persistency;
95
+ if (!(!e?.policies || e.policies.length === 0) && (e.policies.includes("local") || e.policies.includes("session"))) {
104
96
  const r = e.policies.includes("local") ? localStorage : sessionStorage;
105
97
  if (!r) return;
106
- const l = f(e);
107
- return r.setItem(d.value, JSON.stringify(l));
98
+ const s = w(e);
99
+ return r.setItem(n.value, JSON.stringify(s));
108
100
  }
109
- }, a = () => {
110
- const e = i == null ? void 0 : i.persistency;
111
- if (!(!(e != null && e.policies) || e.policies.length === 0) && e.policies.includes("querystring")) {
112
- const r = f(e), l = new URLSearchParams(window.location.search);
113
- l.set(d.value, JSON.stringify(r));
114
- const u = new URL(window.location.href);
115
- u.search = l.toString(), window.history.replaceState({}, "", u.toString());
101
+ }, y = () => {
102
+ const e = o?.persistency;
103
+ if (!(!e?.policies || e.policies.length === 0) && e.policies.includes("querystring")) {
104
+ const r = w(e), s = new URLSearchParams(window.location.search);
105
+ s.set(n.value, JSON.stringify(r));
106
+ const t = new URL(window.location.href);
107
+ t.search = s.toString(), window.history.replaceState({}, "", t.toString());
116
108
  }
117
109
  };
118
- A(h), D(() => {
119
- window.addEventListener("beforeunload", h), window.addEventListener("blur", a);
120
- }), J(() => {
121
- window.removeEventListener("beforeunload", h), window.removeEventListener("blur", a);
110
+ P(f), I(() => {
111
+ window.addEventListener("beforeunload", f), window.addEventListener("blur", y);
112
+ }), N(() => {
113
+ window.removeEventListener("beforeunload", f), window.removeEventListener("blur", y);
122
114
  });
123
- const y = Object.assign(n, {
124
- meta: t,
125
- filterItems: L,
126
- clear: E
115
+ const h = Object.assign(a, {
116
+ meta: l,
117
+ filterItems: b,
118
+ clear: L
127
119
  });
128
- return K(x, y), Object.assign(y, {
129
- Input: M
120
+ return R(J, h), Object.assign(h, {
121
+ Input: D
130
122
  });
131
123
  };
132
124
  export {
133
- x as OmegaFormKey,
134
- H as useOmegaForm
125
+ J as OmegaFormKey,
126
+ $ as useOmegaForm
135
127
  };
@@ -1,210 +1,210 @@
1
- import { S as i, Option as g, pipe as y } from "effect-app";
1
+ import { S as t, Option as g, pipe as S } from "effect-app";
2
2
  import { useIntl as v } from "./vue-components.es3.js";
3
- const x = i.NonEmptyArray(i.String), T = (e) => i.AST.isUnion(e) && e.types.find((t) => t._tag === "UndefinedKeyword" || t === i.Null.ast), h = (e) => !e || !i.AST.isUnion(e) ? !1 : e.types.find((t) => t._tag === "UndefinedKeyword") ? "undefined" : e.types.find((t) => t === i.Null.ast) ? "null" : !1, m = ({ meta: e = {}, parent: t = "", property: n, propertySignatures: r }, u = {}) => {
3
+ const x = t.NonEmptyArray(t.String), T = (e) => t.AST.isUnion(e) && e.types.find((i) => i._tag === "UndefinedKeyword" || i === t.Null.ast), h = (e) => !e || !t.AST.isUnion(e) ? !1 : e.types.find((i) => i._tag === "UndefinedKeyword") ? "undefined" : e.types.find((i) => i === t.Null.ast) ? "null" : !1, m = ({ meta: e = {}, parent: i = "", property: n, propertySignatures: a }, u = {}) => {
4
4
  if (n && n._tag === "Transformation")
5
5
  return m({
6
- parent: t,
6
+ parent: i,
7
7
  meta: e,
8
8
  property: n.from
9
9
  });
10
- if ((n == null ? void 0 : n._tag) === "TypeLiteral" && "propertySignatures" in n)
10
+ if (n?._tag === "TypeLiteral" && "propertySignatures" in n)
11
11
  return m({
12
12
  meta: e,
13
13
  propertySignatures: n.propertySignatures
14
14
  });
15
- if (r) {
16
- for (const s of r) {
17
- const o = t ? `${t}.${s.name.toString()}` : s.name.toString(), a = h(s.type), l = !a, p = s.type;
18
- if (i.AST.isUnion(s.type)) {
19
- const d = s.type.types.filter(
20
- (f) => f._tag !== "UndefinedKeyword" && f !== i.Null.ast
15
+ if (a) {
16
+ for (const s of a) {
17
+ const o = i ? `${i}.${s.name.toString()}` : s.name.toString(), r = h(s.type), l = !r, d = s.type;
18
+ if (t.AST.isUnion(s.type)) {
19
+ const p = s.type.types.filter(
20
+ (f) => f._tag !== "UndefinedKeyword" && f !== t.Null.ast
21
21
  );
22
- if (d.some(
22
+ if (p.some(
23
23
  (f) => "propertySignatures" in f
24
24
  )) {
25
25
  const f = m({
26
26
  parent: o,
27
27
  property: s.type,
28
- meta: { required: l, nullableOrUndefined: a }
28
+ meta: { required: l, nullableOrUndefined: r }
29
29
  });
30
30
  u[o] = f;
31
- for (const c of d)
31
+ for (const c of p)
32
32
  "propertySignatures" in c && Object.assign(
33
33
  u,
34
34
  m({
35
35
  parent: o,
36
36
  propertySignatures: c.propertySignatures,
37
- meta: { required: l, nullableOrUndefined: a }
37
+ meta: { required: l, nullableOrUndefined: r }
38
38
  })
39
39
  );
40
40
  } else {
41
41
  const f = m({
42
42
  parent: o,
43
43
  property: s.type,
44
- meta: { required: l, nullableOrUndefined: a }
44
+ meta: { required: l, nullableOrUndefined: r }
45
45
  });
46
46
  u[o] = f;
47
47
  }
48
48
  }
49
- if ("propertySignatures" in p)
49
+ if ("propertySignatures" in d)
50
50
  Object.assign(
51
51
  u,
52
52
  m({
53
53
  parent: o,
54
- propertySignatures: p.propertySignatures,
55
- meta: { required: l, nullableOrUndefined: a }
54
+ propertySignatures: d.propertySignatures,
55
+ meta: { required: l, nullableOrUndefined: r }
56
56
  })
57
57
  );
58
58
  else {
59
- const d = m({
59
+ const p = m({
60
60
  parent: o,
61
61
  property: s.type,
62
- meta: { required: l, nullableOrUndefined: a }
62
+ meta: { required: l, nullableOrUndefined: r }
63
63
  });
64
- u[o] = d;
64
+ u[o] = p;
65
65
  }
66
66
  }
67
67
  return u;
68
68
  }
69
69
  if (n) {
70
70
  const s = T(n);
71
- if (Object.hasOwnProperty.call(e, "required") || (e.required = !s), i.AST.isUnion(n)) {
72
- const a = n.types.find(
73
- (l) => l._tag !== "UndefinedKeyword" && l !== i.Null.ast
71
+ if (Object.hasOwnProperty.call(e, "required") || (e.required = !s), t.AST.isUnion(n)) {
72
+ const r = n.types.find(
73
+ (l) => l._tag !== "UndefinedKeyword" && l !== t.Null.ast
74
74
  );
75
- return "propertySignatures" in a ? m({
76
- propertySignatures: a.propertySignatures,
77
- parent: t,
75
+ return "propertySignatures" in r ? m({
76
+ propertySignatures: r.propertySignatures,
77
+ parent: i,
78
78
  meta: e
79
- }) : n.types.every(i.AST.isLiteral) ? {
79
+ }) : n.types.every(t.AST.isLiteral) ? {
80
80
  ...e,
81
81
  type: "select",
82
82
  members: n.types.map((l) => l.literal)
83
83
  } : {
84
84
  ...e,
85
85
  ...m({
86
- parent: t,
86
+ parent: i,
87
87
  meta: e,
88
- property: a
88
+ property: r
89
89
  })
90
90
  };
91
91
  }
92
- if (i.AST.isTupleType(n))
92
+ if (t.AST.isTupleType(n))
93
93
  return {
94
94
  ...e,
95
95
  type: "multiple",
96
96
  members: n.elements,
97
97
  rest: n.rest
98
98
  };
99
- const o = i.AST.getAnnotation(
99
+ const o = t.AST.getAnnotation(
100
100
  n,
101
- i.AST.JSONSchemaAnnotationId
101
+ t.AST.JSONSchemaAnnotationId
102
102
  ).pipe(g.getOrElse(() => ({})));
103
103
  return e = { ...e, ...o }, "from" in n ? m({
104
- parent: t,
104
+ parent: i,
105
105
  meta: e,
106
106
  property: n.from
107
- }) : (e.type = i.AST.getAnnotation(
107
+ }) : (e.type = t.AST.getAnnotation(
108
108
  n,
109
- i.AST.TitleAnnotationId
109
+ t.AST.TitleAnnotationId
110
110
  ).pipe(
111
111
  g.getOrElse(() => "unknown")
112
112
  ), e);
113
113
  }
114
114
  return u;
115
- }, S = (e) => {
116
- const t = e.ast, n = {};
117
- if (t._tag === "Transformation" || t._tag === "Refinement")
118
- return S(i.make(t.from));
119
- if ("propertySignatures" in t) {
120
- const r = m({
121
- propertySignatures: t.propertySignatures
115
+ }, y = (e) => {
116
+ const i = e.ast, n = {};
117
+ if (i._tag === "Transformation" || i._tag === "Refinement")
118
+ return y(t.make(i.from));
119
+ if ("propertySignatures" in i) {
120
+ const a = m({
121
+ propertySignatures: i.propertySignatures
122
122
  });
123
- if (Object.values(r).every((s) => s && "type" in s))
124
- return r;
123
+ if (Object.values(a).every((s) => s && "type" in s))
124
+ return a;
125
125
  const u = (s, o = "") => {
126
- for (const a in s) {
127
- const l = o ? `${o}.${a}` : a;
128
- s[a] && typeof s[a] == "object" && "type" in s[a] ? n[l] = s[a] : s[a] && typeof s[a] == "object" && u(s[a], l);
126
+ for (const r in s) {
127
+ const l = o ? `${o}.${r}` : r;
128
+ s[r] && typeof s[r] == "object" && "type" in s[r] ? n[l] = s[r] : s[r] && typeof s[r] == "object" && u(s[r], l);
129
129
  }
130
130
  };
131
- u(r);
131
+ u(a);
132
132
  }
133
133
  return n;
134
- }, M = (e) => i.extend(e, i.Struct({})), N = (e) => {
135
- const t = S(e), n = y(
134
+ }, M = (e) => t.extend(e, t.Struct({})), N = (e) => {
135
+ const i = y(e), n = S(
136
136
  e.ast,
137
- g.liftPredicate((r) => r._tag === "Refinement" && "filter" in r),
138
- g.flatMap((r) => i.AST.getJSONSchemaAnnotation(r)),
139
- g.filter((r) => "items" in r),
137
+ g.liftPredicate((a) => a._tag === "Refinement" && "filter" in a),
138
+ g.flatMap((a) => t.AST.getJSONSchemaAnnotation(a)),
139
+ g.filter((a) => "items" in a),
140
140
  g.filterMap(
141
- ({ items: r }) => i.decodeUnknownOption(x)(r)
141
+ ({ items: a }) => t.decodeUnknownOption(x)(a)
142
142
  ),
143
143
  g.zipWith(
144
- i.AST.getMessageAnnotation(e.ast),
145
- (r, u) => ({
146
- items: r,
144
+ t.AST.getMessageAnnotation(e.ast),
145
+ (a, u) => ({
146
+ items: a,
147
147
  message: u("")
148
148
  })
149
149
  ),
150
150
  g.getOrUndefined
151
151
  );
152
- return { schema: e, meta: t, filterItems: n };
152
+ return { schema: e, meta: i, filterItems: n };
153
153
  }, L = (e) => {
154
- const { trans: t } = v();
154
+ const { trans: i } = v();
155
155
  let n;
156
156
  switch (e.type) {
157
157
  case "string":
158
- n = i.String.annotations({
159
- message: () => t("validation.empty")
160
- }), e.format === "email" && (n = i.compose(
158
+ n = t.String.annotations({
159
+ message: () => i("validation.empty")
160
+ }), e.format === "email" && (n = t.compose(
161
161
  n,
162
- i.Email.annotations({
163
- message: () => t("validation.email.invalid")
162
+ t.Email.annotations({
163
+ message: () => i("validation.email.invalid")
164
164
  })
165
165
  )), e.required && n.annotations({
166
- message: () => t("validation.empty")
167
- }), e.maxLength && (n = n.pipe(i.maxLength(e.maxLength)).annotations({
168
- message: () => t("validation.string.maxLength", {
166
+ message: () => i("validation.empty")
167
+ }), e.maxLength && (n = n.pipe(t.maxLength(e.maxLength)).annotations({
168
+ message: () => i("validation.string.maxLength", {
169
169
  maxLength: e.maxLength
170
170
  })
171
- })), e.minLength && (n = n.pipe(i.minLength(e.minLength)).annotations({
172
- message: () => t("validation.string.minLength", {
171
+ })), e.minLength && (n = n.pipe(t.minLength(e.minLength)).annotations({
172
+ message: () => i("validation.string.minLength", {
173
173
  minLength: e.minLength
174
174
  })
175
175
  }));
176
176
  break;
177
177
  case "number":
178
- n = i.Number.annotations({
179
- message: () => t("validation.empty")
178
+ n = t.Number.annotations({
179
+ message: () => i("validation.empty")
180
180
  }), e.required && n.annotations({
181
- message: () => t("validation.empty")
182
- }), e.minimum && (n = n.pipe(i.greaterThanOrEqualTo(e.minimum)).annotations({
183
- message: () => t("validation.number.min", {
181
+ message: () => i("validation.empty")
182
+ }), e.minimum && (n = n.pipe(t.greaterThanOrEqualTo(e.minimum)).annotations({
183
+ message: () => i("validation.number.min", {
184
184
  minimum: e.minimum,
185
185
  isExclusive: !0
186
186
  })
187
- })), e.maximum && (n = n.pipe(i.lessThanOrEqualTo(e.maximum)).annotations({
188
- message: () => t("validation.number.max", {
187
+ })), e.maximum && (n = n.pipe(t.lessThanOrEqualTo(e.maximum)).annotations({
188
+ message: () => i("validation.number.max", {
189
189
  maximum: e.maximum,
190
190
  isExclusive: !0
191
191
  })
192
- })), e.exclusiveMinimum && (n = n.pipe(i.greaterThan(e.exclusiveMinimum)).annotations({
193
- message: () => t("validation.number.min", {
192
+ })), e.exclusiveMinimum && (n = n.pipe(t.greaterThan(e.exclusiveMinimum)).annotations({
193
+ message: () => i("validation.number.min", {
194
194
  minimum: e.exclusiveMinimum,
195
195
  isExclusive: !1
196
196
  })
197
- })), e.exclusiveMaximum && (n = n.pipe(i.lessThan(e.exclusiveMaximum)).annotations({
198
- message: () => t("validation.number.max", {
197
+ })), e.exclusiveMaximum && (n = n.pipe(t.lessThan(e.exclusiveMaximum)).annotations({
198
+ message: () => i("validation.number.max", {
199
199
  maximum: e.exclusiveMaximum,
200
200
  isExclusive: !1
201
201
  })
202
202
  }));
203
203
  break;
204
204
  case "select":
205
- n = i.Literal(...e.members).annotations({
205
+ n = t.Literal(...e.members).annotations({
206
206
  message: () => ({
207
- message: t("validation.not_a_valid", {
207
+ message: i("validation.not_a_valid", {
208
208
  type: "select",
209
209
  message: e.members.join(", ")
210
210
  }),
@@ -213,29 +213,29 @@ const x = i.NonEmptyArray(i.String), T = (e) => i.AST.isUnion(e) && e.types.find
213
213
  });
214
214
  break;
215
215
  case "multiple":
216
- n = i.Array(i.String).annotations({
217
- message: () => t("validation.not_a_valid", {
216
+ n = t.Array(t.String).annotations({
217
+ message: () => i("validation.not_a_valid", {
218
218
  type: "multiple",
219
219
  message: e.members.join(", ")
220
220
  })
221
221
  });
222
222
  break;
223
223
  case "boolean":
224
- n = i.Boolean;
224
+ n = t.Boolean;
225
225
  break;
226
226
  // todo: switch must be exhaustive or have default case, otherwise falls through with schema undefined.
227
227
  case "unknown":
228
- n = i.Unknown;
228
+ n = t.Unknown;
229
229
  break;
230
230
  }
231
231
  return e.required ? n.pipe(
232
- i.annotations({
233
- message: () => t("validation.empty")
232
+ t.annotations({
233
+ message: () => i("validation.empty")
234
234
  })
235
- ) : n = i.NullishOr(n), i.standardSchemaV1(n);
236
- }, U = (e, t) => i.NullOr(e).pipe(
237
- i.transform(i.typeSchema(e), {
238
- decode: (n) => n ?? t(),
235
+ ) : n = t.NullishOr(n), t.standardSchemaV1(n);
236
+ }, U = (e, i) => t.NullOr(e).pipe(
237
+ t.transform(t.typeSchema(e), {
238
+ decode: (n) => n ?? i(),
239
239
  encode: (n) => n
240
240
  })
241
241
  );
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
1
  {
2
2
  "name": "@effect-app/vue-components",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "@tanstack/vue-form": "^1.2.4",
7
- "effect": "^3.17.4",
7
+ "effect": "^3.17.5",
8
8
  "intl-messageformat": "^10.7.16",
9
9
  "mdi-js": "^1.0.1",
10
10
  "primeflex": "^4.0.0",
11
11
  "primeicons": "^7.0.0",
12
- "primevue": "^4.3.3",
13
- "vue": "^3.5.13",
14
- "vuetify": "^3.7.19"
12
+ "primevue": "^4.3.7",
13
+ "vue": "^3.5.18",
14
+ "vuetify": "^3.9.3"
15
15
  },
16
16
  "devDependencies": {
17
- "@storybook/addon-essentials": "^8.6.12",
18
- "@storybook/addon-interactions": "^8.6.12",
19
- "@storybook/blocks": "^8.6.12",
17
+ "@storybook/addon-essentials": "^8.6.14",
18
+ "@storybook/addon-interactions": "^8.6.14",
19
+ "@storybook/blocks": "^8.6.14",
20
20
  "@storybook/testing-library": "^0.2.2",
21
- "@storybook/vue3": "^8.6.12",
22
- "@storybook/vue3-vite": "^8.6.12",
23
- "@types/node": "^22.13.14",
24
- "@typescript-eslint/eslint-plugin": "8.29.0",
25
- "@typescript-eslint/parser": "8.29.0",
26
- "@vitejs/plugin-vue": "^5.2.3",
21
+ "@storybook/vue3": "^9.1.0",
22
+ "@storybook/vue3-vite": "^9.1.0",
23
+ "@types/node": "^24.1.0",
24
+ "@typescript-eslint/eslint-plugin": "8.38.0",
25
+ "@typescript-eslint/parser": "8.38.0",
26
+ "@vitejs/plugin-vue": "^6.0.1",
27
27
  "@vue/eslint-config-prettier": "^10.2.0",
28
- "@vue/eslint-config-typescript": "^14.5.0",
28
+ "@vue/eslint-config-typescript": "^14.6.0",
29
29
  "@vue/test-utils": "^2.4.6",
30
- "eslint-plugin-prettier": "^5.2.6",
31
- "eslint-plugin-vue": "^10.0.0",
30
+ "eslint-plugin-prettier": "^5.5.3",
31
+ "eslint-plugin-vue": "^10.4.0",
32
32
  "jsdom": "^26.1.0",
33
33
  "rimraf": "^6.0.1",
34
- "sass": "^1.86.0",
35
- "storybook": "^8.6.12",
36
- "typescript": "^5.8.2",
37
- "vite": "^6.2.3",
34
+ "sass": "^1.89.2",
35
+ "storybook": "^9.1.0",
36
+ "typescript": "^5.8.3",
37
+ "vite": "^7.0.6",
38
38
  "vite-plugin-css-injected-by-js": "^3.5.2",
39
39
  "vitepress": "^1.6.3",
40
40
  "vue-tsc": "^2.2.8"
@@ -54,8 +54,8 @@
54
54
  "dependencies": {
55
55
  "highlight.js": "^11.11.1",
56
56
  "vue3-highlightjs": "^1.0.5",
57
- "@effect-app/vue": "2.46.3",
58
- "effect-app": "2.50.2"
57
+ "@effect-app/vue": "2.46.4",
58
+ "effect-app": "2.51.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "pnpm build:run",