@effect-app/vue-components 1.8.11 → 1.8.13

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.
@@ -14,8 +14,10 @@ export type InputProps<From extends Record<PropertyKey, any>, TName extends Deep
14
14
  type: string;
15
15
  };
16
16
  field: OmegaFieldInternalApi<From, TName>;
17
+ /** be sure to use this state and not `field.state` as it is not reactive */
18
+ state: OmegaFieldInternalApi<From, TName>["state"];
17
19
  };
18
- export type MergedInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> = InputProps<From, TName>["inputProps"] & Pick<InputProps<From, TName>, "field">;
20
+ export type MergedInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> = InputProps<From, TName>["inputProps"] & Pick<InputProps<From, TName>, "field" | "state">;
19
21
  export type VuetifyInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> = {
20
22
  inputProps: InputProps<From, TName>["inputProps"] & {
21
23
  type: string;
@@ -24,5 +26,4 @@ export type VuetifyInputProps<From extends Record<PropertyKey, any>, TName exten
24
26
  value: string;
25
27
  }[];
26
28
  };
27
- field: InputProps<From, TName>["field"];
28
- };
29
+ } & Pick<InputProps<From, TName>, "field" | "state">;
@@ -6,6 +6,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends R
6
6
  slots: {
7
7
  default?: (props: {
8
8
  field: import("./InputProps").OmegaFieldInternalApi<From, any>;
9
+ state: import("@tanstack/vue-form").FieldState<From, any, import("@tanstack/vue-form").DeepValue<From, any>, import("@tanstack/vue-form").FieldValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>> | undefined, import("@tanstack/vue-form").StandardSchemaV1<import("@tanstack/vue-form").DeepValue<From, any>, unknown> | import("@tanstack/vue-form").FieldValidateFn<From, any>, import("@tanstack/vue-form").StandardSchemaV1<import("@tanstack/vue-form").DeepValue<From, any>, unknown> | import("@tanstack/vue-form").FieldValidateAsyncFn<From, any>, import("@tanstack/vue-form").FieldValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>>, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>>, import("@tanstack/vue-form").FieldValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, any, import("@tanstack/vue-form").DeepValue<From, any>> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, any, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined>;
9
10
  id: string;
10
11
  required?: boolean;
11
12
  minLength?: number | false;
@@ -5,6 +5,7 @@ import type { FieldValidators, MetaRecord, NestedKeyOf, TypeOverride } from "./O
5
5
  declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends DeepKeys<From>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6
6
  props: __VLS_PrettifyLocal<{
7
7
  field: OmegaFieldInternalApi<From, Name>;
8
+ state: OmegaFieldInternalApi<From, Name>["state"];
8
9
  meta: MetaRecord<From>[NestedKeyOf<From>];
9
10
  label: string;
10
11
  type?: TypeOverride;
@@ -24,6 +25,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, Name extends
24
25
  slots: {
25
26
  default?: (props: {
26
27
  field: OmegaFieldInternalApi<From, Name>;
28
+ state: import("@tanstack/vue-form").FieldState<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").StandardSchemaV1<import("@tanstack/vue-form").DeepValue<From, Name>, unknown> | import("@tanstack/vue-form").FieldValidateFn<From, Name>, import("@tanstack/vue-form").StandardSchemaV1<import("@tanstack/vue-form").DeepValue<From, Name>, unknown> | import("@tanstack/vue-form").FieldValidateAsyncFn<From, Name>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>>, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>>, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, Name, import("@tanstack/vue-form").DeepValue<From, Name>> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, any, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined>;
27
29
  id: string;
28
30
  required?: boolean;
29
31
  minLength?: number | false;
@@ -1,23 +1,30 @@
1
- import { h as r } from "vue";
2
- import i from "./vue-components.es5.js";
3
- import { useOmegaForm as f } from "./vue-components.es7.js";
4
- const g = (e) => (...o) => {
5
- const [n, m, p] = o;
6
- return f(
7
- n,
8
- m,
1
+ import { h as o } from "vue";
2
+ import l from "./vue-components.es5.js";
3
+ import { useOmegaForm as O } from "./vue-components.es7.js";
4
+ const g = (n) => (...m) => {
5
+ const [p, s, a] = m;
6
+ return O(
7
+ p,
8
+ s,
9
9
  {
10
- ...p,
10
+ ...a,
11
11
  input: {
12
12
  name: "WrappedInput",
13
13
  inheritAttrs: !1,
14
- setup(s, { attrs: t }) {
15
- return () => r(i, {
16
- ...s,
14
+ setup(c, { attrs: t }) {
15
+ return () => o(l, {
16
+ ...c,
17
17
  ...t
18
18
  }, {
19
19
  // Override the default slot that OmegaInternalInput provides
20
- default: ({ field: u, ...a }) => r(e, { ...t, field: u, inputProps: a })
20
+ default: ({ field: f, state: i, ...r }) => {
21
+ const u = Object.fromEntries(
22
+ Object.entries(t).filter(
23
+ ([e]) => !Object.prototype.hasOwnProperty.call(r, e) && e !== "form"
24
+ )
25
+ );
26
+ return o(n, { ...u, field: f, state: i, inputProps: r });
27
+ }
21
28
  });
22
29
  }
23
30
  }
@@ -1,13 +1,12 @@
1
- import { onMounted as e, onUnmounted as u } from "vue";
2
- function p(t) {
3
- let n;
4
- e(() => {
5
- const o = t();
6
- o && (n = o);
7
- }), u(() => {
8
- n && n();
9
- });
10
- }
1
+ import { Exit as c, Runtime as u } from "effect";
2
+ import { dual as n, isFunction as m } from "./vue-components.es26.js";
3
+ const i = Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
4
+ n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
5
+ const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
6
+ c.isSuccess(r) ? o(r.value) : s(u.makeFiberFailure(r.cause));
7
+ }));
11
8
  export {
12
- p as onMountedWithCleanup
9
+ a as clone,
10
+ i as cloneTrait,
11
+ p as runtimeFiberAsPromise
13
12
  };
@@ -1,12 +1,7 @@
1
- import { Exit as c, Runtime as u } from "effect";
2
- import { dual as n, isFunction as m } from "./vue-components.es26.js";
3
- const i = Symbol.for("clone-trait"), a = n(2, (e, t) => i in e ? e[i](t) : Object.setPrototypeOf(t, Object.getPrototypeOf(e)));
4
- n(2, (e, t) => a(e, { ...e, ...m(t) ? t(e) : t }));
5
- const p = (e, t) => new Promise((o, s) => e.addObserver((r) => {
6
- c.isSuccess(r) ? o(r.value) : s(u.makeFiberFailure(r.cause));
7
- }));
1
+ import { isFunction as c } from "./vue-components.es26.js";
2
+ const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
8
3
  export {
9
- a as clone,
10
- i as cloneTrait,
11
- p as runtimeFiberAsPromise
4
+ s as isFunction,
5
+ i as isObject,
6
+ t as isRecordOrArray
12
7
  };
@@ -1,7 +1,56 @@
1
- import { isFunction as c } from "./vue-components.es26.js";
2
- const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
1
+ import { defineComponent as F, computed as i, onMounted as M, provide as P, createBlock as c, openBlock as s, resolveDynamicComponent as p, withCtx as g, renderSlot as o, createElementBlock as k, normalizeProps as l, guardReactiveProps as u, Fragment as A, renderList as b, mergeProps as B } from "vue";
2
+ const N = /* @__PURE__ */ F({
3
+ inheritAttrs: !1,
4
+ __name: "OmegaArray",
5
+ props: {
6
+ form: {},
7
+ name: {},
8
+ defaultItems: {},
9
+ items: {}
10
+ },
11
+ setup(n) {
12
+ const a = n, y = a.form.useStore((e) => e.values), d = i(() => {
13
+ const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
14
+ try {
15
+ return e.split(".").reduce((r, t) => r && r[t], y.value);
16
+ } catch (r) {
17
+ return console.error(r), [];
18
+ }
19
+ });
20
+ M(async () => {
21
+ a.defaultItems && !d.value && a.form.setFieldValue(a.name, a.defaultItems);
22
+ });
23
+ const $ = i(() => (r) => {
24
+ const t = r.replace(/\[\d+\]/g, "");
25
+ return a.form.meta[t];
26
+ });
27
+ return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
28
+ default: g(({ field: t, state: f }) => [
29
+ o(e.$slots, "pre-array", l(u({ field: t, state: f }))),
30
+ (s(!0), k(A, null, b(d.value, (C, m) => (s(), c(p(n.form.Field), {
31
+ key: `${n.name}[${Number(m)}]`,
32
+ name: (
33
+ // eslint-disable-next-line
34
+ `${n.name}[${Number(m)}]`
35
+ )
36
+ }, {
37
+ default: g(({ field: v, state: h }) => [
38
+ o(e.$slots, "default", B({ ref_for: !0 }, {
39
+ subField: v,
40
+ subState: h,
41
+ index: Number(m),
42
+ field: t
43
+ }))
44
+ ]),
45
+ _: 2
46
+ }, 1032, ["name"]))), 128)),
47
+ o(e.$slots, "post-array", l(u({ field: t, state: f }))),
48
+ o(e.$slots, "field", l(u({ field: t })))
49
+ ]),
50
+ _: 3
51
+ }, 8, ["name"]));
52
+ }
53
+ });
3
54
  export {
4
- s as isFunction,
5
- i as isObject,
6
- t as isRecordOrArray
55
+ N as default
7
56
  };
@@ -1,56 +1,70 @@
1
- import { defineComponent as F, computed as i, onMounted as M, provide as P, createBlock as c, openBlock as s, resolveDynamicComponent as p, withCtx as g, renderSlot as o, createElementBlock as k, normalizeProps as l, guardReactiveProps as u, Fragment as A, renderList as b, mergeProps as B } from "vue";
2
- const N = /* @__PURE__ */ F({
3
- inheritAttrs: !1,
4
- __name: "OmegaArray",
1
+ import { defineComponent as O, computed as j, createElementBlock as M, openBlock as _, Fragment as E, renderList as A, renderSlot as F, createVNode as g, unref as h, mergeProps as k } from "vue";
2
+ import { Order as l, pipe as v, Array as u } from "effect-app";
3
+ const I = /* @__PURE__ */ O({
4
+ __name: "OmegaAutoGen",
5
5
  props: {
6
6
  form: {},
7
- name: {},
8
- defaultItems: {},
9
- items: {}
7
+ pick: {},
8
+ omit: {},
9
+ labelMap: { type: Function },
10
+ filterMap: { type: Function },
11
+ order: {},
12
+ sort: {}
10
13
  },
11
- setup(n) {
12
- const a = n, y = a.form.useStore((e) => e.values), d = i(() => {
13
- const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
14
- try {
15
- return e.split(".").reduce((r, t) => r && r[t], y.value);
16
- } catch (r) {
17
- return console.error(r), [];
18
- }
19
- });
20
- M(async () => {
21
- a.defaultItems && !d.value && a.form.setFieldValue(a.name, a.defaultItems);
22
- });
23
- const $ = i(() => (r) => {
24
- const t = r.replace(/\[\d+\]/g, "");
25
- return a.form.meta[t];
26
- });
27
- return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
28
- default: g(({ field: t, state: f }) => [
29
- o(e.$slots, "pre-array", l(u({ field: t, state: f }))),
30
- (s(!0), k(A, null, b(d.value, (C, m) => (s(), c(p(n.form.Field), {
31
- key: `${n.name}[${Number(m)}]`,
32
- name: (
33
- // eslint-disable-next-line
34
- `${n.name}[${Number(m)}]`
35
- )
36
- }, {
37
- default: g(({ field: v, state: h }) => [
38
- o(e.$slots, "default", B({ ref_for: !0 }, {
39
- subField: v,
40
- subState: h,
41
- index: Number(m),
42
- field: t
43
- }))
44
- ]),
45
- _: 2
46
- }, 1032, ["name"]))), 128)),
47
- o(e.$slots, "post-array", l(u({ field: t, state: f }))),
48
- o(e.$slots, "field", l(u({ field: t })))
49
- ]),
50
- _: 3
51
- }, 8, ["name"]));
14
+ setup(i) {
15
+ const p = (e) => (r) => Object.fromEntries(
16
+ Object.entries(r).map(([t, o]) => [t, e(o, t)])
17
+ ), a = (e) => (r) => Object.fromEntries(
18
+ Object.entries(r).filter(([t, o]) => e(o, t))
19
+ ), m = (e) => (r) => Object.entries(r).reduce(
20
+ (t, [o, c]) => {
21
+ const s = e(c, o);
22
+ return s !== !1 && (t[o] = s), t;
23
+ },
24
+ {}
25
+ ), n = i, f = (e, r) => {
26
+ const t = r?.indexOf(e) ?? -1;
27
+ return t === -1 ? Number.MAX_SAFE_INTEGER : t;
28
+ }, d = l.mapInput(
29
+ l.number,
30
+ (e) => f(e.name, n.order || [])
31
+ ), b = j(
32
+ () => v(
33
+ n.form.meta,
34
+ // include / exclude
35
+ a(
36
+ (e, r) => n.pick ? n.pick.includes(r) && !n.omit?.includes(r) : !n.omit?.includes(r)
37
+ ),
38
+ (e) => e,
39
+ // labelMap and adding name
40
+ p((e, r) => ({
41
+ name: r,
42
+ label: n.labelMap?.(r) || r,
43
+ ...e
44
+ })),
45
+ // filterMap
46
+ n.filterMap ? m((e) => {
47
+ const r = n.filterMap?.(e.name, e);
48
+ return r === void 0 || r === !0 ? e : r;
49
+ }) : (e) => e,
50
+ // transform to array
51
+ (e) => Object.values(e),
52
+ // order
53
+ u.sort(d),
54
+ // sort
55
+ n.sort ? u.sort(n.sort) : (e) => e
56
+ )
57
+ );
58
+ return (e, r) => (_(!0), M(E, null, A(b.value, ({ name: t, label: o, ...c }) => F(e.$slots, "default", {
59
+ child: { name: t, label: o, ...c }
60
+ }, () => [
61
+ g(h(i.form).Input, k({
62
+ name: t,
63
+ label: o
64
+ }, { ref_for: !0 }, c), null, 16, ["name", "label"])
65
+ ])), 256));
52
66
  }
53
67
  });
54
68
  export {
55
- N as default
69
+ I as default
56
70
  };
@@ -1,70 +1,8 @@
1
- import { defineComponent as O, computed as j, createElementBlock as M, openBlock as _, Fragment as E, renderList as A, renderSlot as F, createVNode as g, unref as h, mergeProps as k } from "vue";
2
- import { Order as l, pipe as v, Array as u } from "effect-app";
3
- const I = /* @__PURE__ */ O({
4
- __name: "OmegaAutoGen",
5
- props: {
6
- form: {},
7
- pick: {},
8
- omit: {},
9
- labelMap: { type: Function },
10
- filterMap: { type: Function },
11
- order: {},
12
- sort: {}
13
- },
14
- setup(i) {
15
- const p = (e) => (r) => Object.fromEntries(
16
- Object.entries(r).map(([t, o]) => [t, e(o, t)])
17
- ), a = (e) => (r) => Object.fromEntries(
18
- Object.entries(r).filter(([t, o]) => e(o, t))
19
- ), m = (e) => (r) => Object.entries(r).reduce(
20
- (t, [o, c]) => {
21
- const s = e(c, o);
22
- return s !== !1 && (t[o] = s), t;
23
- },
24
- {}
25
- ), n = i, f = (e, r) => {
26
- const t = r?.indexOf(e) ?? -1;
27
- return t === -1 ? Number.MAX_SAFE_INTEGER : t;
28
- }, d = l.mapInput(
29
- l.number,
30
- (e) => f(e.name, n.order || [])
31
- ), b = j(
32
- () => v(
33
- n.form.meta,
34
- // include / exclude
35
- a(
36
- (e, r) => n.pick ? n.pick.includes(r) && !n.omit?.includes(r) : !n.omit?.includes(r)
37
- ),
38
- (e) => e,
39
- // labelMap and adding name
40
- p((e, r) => ({
41
- name: r,
42
- label: n.labelMap?.(r) || r,
43
- ...e
44
- })),
45
- // filterMap
46
- n.filterMap ? m((e) => {
47
- const r = n.filterMap?.(e.name, e);
48
- return r === void 0 || r === !0 ? e : r;
49
- }) : (e) => e,
50
- // transform to array
51
- (e) => Object.values(e),
52
- // order
53
- u.sort(d),
54
- // sort
55
- n.sort ? u.sort(n.sort) : (e) => e
56
- )
57
- );
58
- return (e, r) => (_(!0), M(E, null, A(b.value, ({ name: t, label: o, ...c }) => F(e.$slots, "default", {
59
- child: { name: t, label: o, ...c }
60
- }, () => [
61
- g(h(i.form).Input, k({
62
- name: t,
63
- label: o
64
- }, { ref_for: !0 }, c), null, 16, ["name", "label"])
65
- ])), 256));
66
- }
67
- });
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{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(r,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const d=document.createElement("style");d.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(d)}},e.call(window.customElements,r,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import r from "./vue-components.es29.js";
3
+
4
+ import o from "./vue-components.es31.js";
5
+ const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d4ffe76f"]]);
68
6
  export {
69
- I as default
7
+ e as default
70
8
  };
@@ -1,8 +1,8 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");if(a.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{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(r,t){const i=t.prototype.connectedCallback;return t.prototype.connectedCallback=function(){if(i&&i.call(this),this.shadowRoot){const d=document.createElement("style");d.appendChild(document.createTextNode(".v-enter-from[data-v-d4ffe76f],.v-leave-to[data-v-d4ffe76f]{max-height:0px;grid-template-rows:0fr;opacity:0}.v-enter-active[data-v-d4ffe76f],.v-leave-active[data-v-d4ffe76f]{display:grid;transition:all .15s}.v-enter-to[data-v-d4ffe76f],.v-leave-from[data-v-d4ffe76f]{grid-template-rows:1fr;max-height:50vh;opacity:1}.error-alert[data-v-d4ffe76f]{transition-behavior:allow-discrete;display:grid;overflow:hidden;min-height:0}.error-alert>*[data-v-d4ffe76f]{min-height:0}.error-list[data-v-d4ffe76f]{list-style-position:inside}div.error-list[data-v-d4ffe76f]{container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;gap:1.5em;align-items:start}@container (max-width: 27.125rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:auto 1fr}.error-link[data-v-d4ffe76f]{grid-column:1 / -1;justify-self:end}}@container (max-width: 17.75rem){div.error-list[data-v-d4ffe76f]{grid-template-columns:1fr}.error-message[data-v-d4ffe76f]{grid-column:1 / -1}}.error-item[data-v-d4ffe76f]{display:contents}a[data-v-d4ffe76f]{min-width:min-content}.error-link[data-v-d4ffe76f]{align-items:center;color:inherit;display:inline-flex;flex-wrap:wrap;gap:.25em;padding-bottom:1em;text-decoration:none}")),this.shadowRoot.appendChild(d)}},e.call(window.customElements,r,t)}}}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import r from "./vue-components.es29.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-8fe92df3]{display:contents}fieldset[disabled][data-v-8fe92df3]>*{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-8fe92df3]{display:contents}fieldset[disabled][data-v-8fe92df3]>*{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
+ import o from "./vue-components.es32.js";
3
3
 
4
- import o from "./vue-components.es31.js";
5
- const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d4ffe76f"]]);
4
+ import m from "./vue-components.es31.js";
5
+ const a = /* @__PURE__ */ m(o, [["__scopeId", "data-v-8fe92df3"]]);
6
6
  export {
7
- e as default
7
+ a as default
8
8
  };
@@ -1,8 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-8fe92df3]{display:contents}fieldset[disabled][data-v-8fe92df3]>*{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-8fe92df3]{display:contents}fieldset[disabled][data-v-8fe92df3]>*{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
- import o from "./vue-components.es32.js";
3
-
4
- import m from "./vue-components.es31.js";
5
- const a = /* @__PURE__ */ m(o, [["__scopeId", "data-v-8fe92df3"]]);
1
+ import { TraceAPI as r } from "./vue-components.es46.js";
2
+ var t = r.getInstance();
6
3
  export {
7
- a as default
4
+ t as trace
8
5
  };
@@ -1,5 +1,5 @@
1
- import { TraceAPI as r } from "./vue-components.es46.js";
2
- var t = r.getInstance();
1
+ import { ContextAPI as t } from "./vue-components.es45.js";
2
+ var o = t.getInstance();
3
3
  export {
4
- t as trace
4
+ o as context
5
5
  };
@@ -1,5 +1,4 @@
1
- import { ContextAPI as t } from "./vue-components.es45.js";
2
- var o = t.getInstance();
1
+ import f from "./vue-components.es5.js";
3
2
  export {
4
- o as context
3
+ f as default
5
4
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es5.js";
1
+ import f from "./vue-components.es6.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,19 @@
1
- import f from "./vue-components.es6.js";
1
+ function c(t) {
2
+ return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, f) {
3
+ var i = t.get(e);
4
+ i ? i.push(f) : t.set(e, [f]);
5
+ }, off: function(e, f) {
6
+ var i = t.get(e);
7
+ i && (f ? i.splice(i.indexOf(f) >>> 0, 1) : t.set(e, []));
8
+ }, emit: function(e, f) {
9
+ var i = t.get(e);
10
+ i && i.slice().map(function(a) {
11
+ a(f);
12
+ }), (i = t.get("*")) && i.slice().map(function(a) {
13
+ a(e, f);
14
+ });
15
+ } };
16
+ }
2
17
  export {
3
- f as default
18
+ c as default
4
19
  };
@@ -1,19 +1,13 @@
1
- function c(t) {
2
- return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, f) {
3
- var i = t.get(e);
4
- i ? i.push(f) : t.set(e, [f]);
5
- }, off: function(e, f) {
6
- var i = t.get(e);
7
- i && (f ? i.splice(i.indexOf(f) >>> 0, 1) : t.set(e, []));
8
- }, emit: function(e, f) {
9
- var i = t.get(e);
10
- i && i.slice().map(function(a) {
11
- a(f);
12
- }), (i = t.get("*")) && i.slice().map(function(a) {
13
- a(e, f);
14
- });
15
- } };
1
+ import { onMounted as e, onUnmounted as u } from "vue";
2
+ function p(t) {
3
+ let n;
4
+ e(() => {
5
+ const o = t();
6
+ o && (n = o);
7
+ }), u(() => {
8
+ n && n();
9
+ });
16
10
  }
17
11
  export {
18
- c as default
12
+ p as onMountedWithCleanup
19
13
  };
@@ -1,16 +1,17 @@
1
- import { defineComponent as y, resolveComponent as o, createElementBlock as m, openBlock as n, createBlock as a, createCommentVNode as i, resolveDynamicComponent as d, mergeProps as u, unref as b, withCtx as h, Fragment as c, renderList as C } from "vue";
1
+ import { defineComponent as b, resolveComponent as o, createElementBlock as m, openBlock as n, createBlock as a, createCommentVNode as i, resolveDynamicComponent as d, mergeProps as u, unref as f, withCtx as h, Fragment as c, renderList as C } from "vue";
2
2
  import { getInputType as q } from "./vue-components.es9.js";
3
- const U = /* @__PURE__ */ y({
3
+ const U = /* @__PURE__ */ b({
4
4
  inheritAttrs: !1,
5
5
  __name: "OmegaInputVuetify",
6
6
  props: {
7
7
  inputProps: {},
8
- field: {}
8
+ field: {},
9
+ state: {}
9
10
  },
10
11
  emits: ["focus", "blur"],
11
12
  setup(e) {
12
13
  return (r, l) => {
13
- const s = o("v-text-field"), P = o("v-textarea"), g = o("v-radio"), v = o("v-radio-group"), p = o("v-select"), f = o("v-autocomplete");
14
+ const s = o("v-text-field"), P = o("v-textarea"), g = o("v-radio"), v = o("v-radio-group"), p = o("v-select"), y = o("v-autocomplete");
14
15
  return n(), m("div", {
15
16
  class: "omega-input",
16
17
  onFocusout: l[4] || (l[4] = (t) => r.$emit("blur", t)),
@@ -25,7 +26,7 @@ const U = /* @__PURE__ */ y({
25
26
  error: e.inputProps.error,
26
27
  ripple: ""
27
28
  }, r.$attrs, {
28
- "model-value": e.field.state.value,
29
+ "model-value": e.state.value,
29
30
  onChange: l[0] || (l[0] = (t) => e.field.handleChange(t.target.checked))
30
31
  }), null, 16, ["id", "name", "label", "error-messages", "error", "model-value"])) : i("", !0),
31
32
  e.inputProps.type === "email" || e.inputProps.type === "string" || e.inputProps.type === "password" ? (n(), a(s, u({
@@ -34,13 +35,13 @@ const U = /* @__PURE__ */ y({
34
35
  required: e.inputProps.required,
35
36
  "min-length": e.inputProps.minLength,
36
37
  "max-length": e.inputProps.maxLength,
37
- type: b(q)(e.inputProps.type),
38
+ type: f(q)(e.inputProps.type),
38
39
  name: e.field.name,
39
40
  label: e.inputProps.label,
40
41
  "error-messages": e.inputProps.errorMessages,
41
42
  error: e.inputProps.error
42
43
  }, r.$attrs, {
43
- "model-value": e.field.state.value,
44
+ "model-value": e.state.value,
44
45
  "onUpdate:modelValue": e.field.handleChange
45
46
  }), null, 16, ["id", "required", "min-length", "max-length", "type", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : i("", !0),
46
47
  e.inputProps.type === "text" ? (n(), a(P, u({
@@ -54,7 +55,7 @@ const U = /* @__PURE__ */ y({
54
55
  "error-messages": e.inputProps.errorMessages,
55
56
  error: e.inputProps.error
56
57
  }, r.$attrs, {
57
- "model-value": e.field.state.value,
58
+ "model-value": e.state.value,
58
59
  "onUpdate:modelValue": e.field.handleChange
59
60
  }), null, 16, ["id", "required", "min-length", "max-length", "name", "label", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : i("", !0),
60
61
  e.inputProps.type === "number" || e.inputProps.type === "range" ? (n(), a(d(e.inputProps.type === "range" ? "v-slider" : "v-text-field"), u({
@@ -69,7 +70,7 @@ const U = /* @__PURE__ */ y({
69
70
  "error-messages": e.inputProps.errorMessages,
70
71
  error: e.inputProps.error
71
72
  }, r.$attrs, {
72
- "model-value": e.field.state.value,
73
+ "model-value": e.state.value,
73
74
  "onUpdate:modelValue": l[1] || (l[1] = (t) => {
74
75
  t || t === 0 ? e.field.handleChange(Number(t)) : e.field.handleChange(void 0);
75
76
  })
@@ -82,7 +83,7 @@ const U = /* @__PURE__ */ y({
82
83
  "error-messages": e.inputProps.errorMessages,
83
84
  error: e.inputProps.error
84
85
  }, r.$attrs, {
85
- "model-value": e.field.state.value,
86
+ "model-value": e.state.value,
86
87
  "onUpdate:modelValue": e.field.handleChange
87
88
  }), {
88
89
  default: h(() => [
@@ -107,11 +108,11 @@ const U = /* @__PURE__ */ y({
107
108
  "error-messages": e.inputProps.errorMessages,
108
109
  error: e.inputProps.error
109
110
  }, r.$attrs, {
110
- "model-value": e.field.state.value,
111
+ "model-value": e.state.value,
111
112
  onClear: l[2] || (l[2] = (t) => e.field.handleChange(void 0)),
112
113
  "onUpdate:modelValue": e.field.handleChange
113
114
  }), null, 16, ["id", "clearable", "required", "multiple", "chips", "name", "label", "items", "error-messages", "error", "model-value", "onUpdate:modelValue"])) : i("", !0),
114
- e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (n(), a(f, u({
115
+ e.inputProps.type === "autocomplete" || e.inputProps.type === "autocompletemultiple" ? (n(), a(y, u({
115
116
  key: 6,
116
117
  id: e.inputProps.id,
117
118
  clearable: e.inputProps.type === "autocomplete",
@@ -124,7 +125,7 @@ const U = /* @__PURE__ */ y({
124
125
  error: e.inputProps.error,
125
126
  chips: e.inputProps.type === "autocompletemultiple"
126
127
  }, r.$attrs, {
127
- "model-value": e.field.state.value,
128
+ "model-value": e.state.value,
128
129
  onClear: l[3] || (l[3] = (t) => e.field.handleChange(void 0)),
129
130
  "onUpdate:modelValue": e.field.handleChange
130
131
  }), null, 16, ["id", "clearable", "multiple", "required", "name", "label", "items", "error-messages", "error", "chips", "model-value", "onUpdate:modelValue"])) : i("", !0)
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es15.js";
1
+ import f from "./vue-components.es14.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import f from "./vue-components.es16.js";
1
+ import f from "./vue-components.es15.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as c, mergeModels as f, useModel as v, resolveComponent as C, createBlock as k, openBlock as V, unref as r, createSlots as g, withCtx as d, renderSlot as u, renderList as y, normalizeProps as B, guardReactiveProps as E } from "vue";
2
2
  import { useOnClose as M } from "./vue-components.es8.js";
3
- import { onMountedWithCleanup as _ } from "./vue-components.es12.js";
3
+ import { onMountedWithCleanup as _ } from "./vue-components.es23.js";
4
4
  const P = /* @__PURE__ */ c({
5
5
  __name: "Dialog",
6
6
  props: /* @__PURE__ */ f({
@@ -1,8 +1,8 @@
1
- import { defineComponent as h, inject as $, computed as s, createBlock as i, openBlock as f, resolveDynamicComponent as M, withCtx as u, createCommentVNode as b, mergeProps as C, renderSlot as F, normalizeProps as k, guardReactiveProps as y } from "vue";
2
- import { useIntl as A } from "./vue-components.es3.js";
3
- import { generateInputStandardSchemaFromFieldMeta as w } from "./vue-components.es9.js";
4
- import I from "./vue-components.es6.js";
5
- const z = /* @__PURE__ */ h({
1
+ import { defineComponent as $, inject as M, computed as s, createBlock as i, openBlock as f, resolveDynamicComponent as b, withCtx as u, createCommentVNode as C, mergeProps as F, renderSlot as k, normalizeProps as y, guardReactiveProps as A } from "vue";
2
+ import { useIntl as w } from "./vue-components.es3.js";
3
+ import { generateInputStandardSchemaFromFieldMeta as I } from "./vue-components.es9.js";
4
+ import N from "./vue-components.es6.js";
5
+ const B = /* @__PURE__ */ $({
6
6
  inheritAttrs: !1,
7
7
  __name: "OmegaInput",
8
8
  props: {
@@ -12,38 +12,39 @@ const z = /* @__PURE__ */ h({
12
12
  name: {}
13
13
  },
14
14
  setup(a) {
15
- const e = a, n = $(
15
+ const e = a, n = M(
16
16
  "getMetaFromArray",
17
17
  null
18
18
  ), r = s(() => n?.value && n.value(e.name) ? n.value(e.name) : e.form.meta[e.name]), c = s(() => {
19
19
  if (!r.value)
20
20
  throw console.log(e.name, Object.keys(e.form.meta), e.form.meta), new Error("Meta is undefined");
21
- return w(r.value);
22
- }), { formatMessage: o } = A(), d = (t) => t.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).trim(), m = () => o({ id: `general.fields.${e.name}`, defaultMessage: d(e.name) }), p = () => e.form.i18nNamespace ? o({ id: `${e.form.i18nNamespace}.fields.${e.name}`, defaultMessage: m() }) : m();
23
- return (t, l) => (f(), i(M(a.form.Field), {
21
+ return I(r.value);
22
+ }), { formatMessage: o } = w(), d = (t) => t.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).trim(), m = () => o({ id: `general.fields.${e.name}`, defaultMessage: d(e.name) }), p = () => e.form.i18nNamespace ? o({ id: `${e.form.i18nNamespace}.fields.${e.name}`, defaultMessage: m() }) : m();
23
+ return (t, l) => (f(), i(b(a.form.Field), {
24
24
  name: a.name,
25
25
  validators: {
26
26
  onChange: c.value,
27
27
  ...a.validators
28
28
  }
29
29
  }, {
30
- default: u(({ field: g }) => [
31
- r.value ? (f(), i(I, C({ key: 0 }, { ...t.$attrs, ...t.$props }, {
30
+ default: u(({ field: g, state: v }) => [
31
+ r.value ? (f(), i(N, F({ key: 0 }, { ...t.$attrs, ...t.$props }, {
32
32
  field: g,
33
+ state: v,
33
34
  register: a.form.registerField,
34
35
  label: a.label ?? p(),
35
36
  meta: r.value
36
37
  }), {
37
- default: u((v) => [
38
- F(t.$slots, "default", k(y(v)))
38
+ default: u((h) => [
39
+ k(t.$slots, "default", y(A(h)))
39
40
  ]),
40
41
  _: 3
41
- }, 16, ["field", "register", "label", "meta"])) : b("", !0)
42
+ }, 16, ["field", "state", "register", "label", "meta"])) : C("", !0)
42
43
  ]),
43
44
  _: 3
44
45
  }, 8, ["name", "validators"]));
45
46
  }
46
47
  });
47
48
  export {
48
- z as default
49
+ B as default
49
50
  };
@@ -8,6 +8,7 @@ const U = /* @__PURE__ */ b({
8
8
  __name: "OmegaInternalInput",
9
9
  props: {
10
10
  field: {},
11
+ state: {},
11
12
  meta: {},
12
13
  label: {},
13
14
  type: {},
@@ -16,9 +17,9 @@ const U = /* @__PURE__ */ b({
16
17
  options: {}
17
18
  },
18
19
  setup(u) {
19
- const e = u, p = C()?.appContext.components.VTextField, i = x(), a = e.field, o = I(a.store, (t) => t), d = n(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown");
20
- e.register(n(() => ({ name: e.field.name, label: e.label, id: i })));
21
- const f = n(() => o.value.value), c = n(() => o.value.meta.errors ?? []), s = n(
20
+ const e = u, p = C()?.appContext.components.VTextField, s = x(), l = e.field, o = I(l.store, (t) => t), d = n(() => e.type ? e.type : e.meta?.type === "string" ? e.meta.format === "email" ? "email" : "string" : e.meta?.type || "unknown");
21
+ e.register(n(() => ({ name: e.field.name, label: e.label, id: s })));
22
+ const f = n(() => o.value.value), c = n(() => o.value.meta.errors ?? []), i = n(
22
23
  () => (
23
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
25
  c.value.map((t) => t?.message).filter(Boolean)
@@ -31,7 +32,7 @@ const U = /* @__PURE__ */ b({
31
32
  _(() => {
32
33
  if (!f.value && !e.meta?.required && e.meta?.nullableOrUndefined === "null") {
33
34
  const t = o.value.meta.isDirty;
34
- a.setValue(null), a.setMeta((r) => ({ ...r, isDirty: t }));
35
+ l.setValue(null), l.setMeta((r) => ({ ...r, isDirty: t }));
35
36
  }
36
37
  });
37
38
  const h = (t) => {
@@ -41,27 +42,28 @@ const U = /* @__PURE__ */ b({
41
42
  }
42
43
  };
43
44
  return new Proxy(t, r);
44
- }, l = n(() => ({
45
+ }, a = n(() => ({
45
46
  inputProps: {
46
- id: i,
47
+ id: s,
47
48
  required: e.meta?.required,
48
49
  minLength: e.meta?.type === "string" && e.meta?.minLength,
49
50
  maxLength: e.meta?.type === "string" && e.meta?.maxLength,
50
51
  max: e.meta?.type === "number" && e.meta?.maximum,
51
52
  min: e.meta?.type === "number" && e.meta?.minimum,
52
- errorMessages: s.value,
53
- error: !!s.value.length,
53
+ errorMessages: i.value,
54
+ error: !!i.value.length,
54
55
  type: d.value,
55
56
  label: `${e.label}${e.meta?.required ? " *" : ""}`,
56
57
  options: e.options
57
58
  },
59
+ state: e.state,
58
60
  field: h(e.field)
59
61
  }));
60
- return (t, r) => P(t.$slots, "default", m(M({ ...l.value.inputProps, field: l.value.field })), () => [
62
+ return (t, r) => P(t.$slots, "default", m(M({ ...a.value.inputProps, field: a.value.field, state: a.value.state })), () => [
61
63
  N("div", {
62
64
  class: $(t.$attrs.class)
63
65
  }, [
64
- q(p) ? (B(), V(L, m(F({ key: 0 }, { ...t.$attrs, ...l.value })), null, 16)) : k("", !0)
66
+ q(p) ? (B(), V(L, m(F({ key: 0 }, { ...t.$attrs, ...a.value })), null, 16)) : k("", !0)
65
67
  ], 2)
66
68
  ]);
67
69
  }
@@ -1,17 +1,17 @@
1
1
  import { useForm as q } from "@tanstack/vue-form";
2
2
  import { Data as K, S as I, Effect as l, Fiber as F, Option as M, Array as P } from "effect-app";
3
- import { runtimeFiberAsPromise as B } from "./vue-components.es13.js";
4
- import { isObject as G } from "./vue-components.es14.js";
3
+ import { runtimeFiberAsPromise as B } from "./vue-components.es12.js";
4
+ import { isObject as G } from "./vue-components.es13.js";
5
5
  import { computed as j, onUnmounted as N, onMounted as T, onBeforeUnmount as W, ref as k, watch as z, h as D } from "vue";
6
6
  import { usePreventClose as Q } from "./vue-components.es8.js";
7
- import X from "./vue-components.es15.js";
8
- import Y from "./vue-components.es16.js";
9
- import Z from "./vue-components.es17.js";
7
+ import X from "./vue-components.es14.js";
8
+ import Y from "./vue-components.es15.js";
9
+ import Z from "./vue-components.es16.js";
10
10
  import { generateMetaFromSchema as C } from "./vue-components.es9.js";
11
11
  import ee from "./vue-components.es5.js";
12
- import re from "./vue-components.es18.js";
13
- import { trace as _ } from "./vue-components.es19.js";
14
- import { context as V } from "./vue-components.es20.js";
12
+ import re from "./vue-components.es17.js";
13
+ import { trace as _ } from "./vue-components.es18.js";
14
+ import { context as V } from "./vue-components.es19.js";
15
15
  class te extends K.TaggedError("FormErrors") {
16
16
  }
17
17
  const w = (c) => function(n) {
@@ -1,6 +1,6 @@
1
- import r from "./vue-components.es23.js";
1
+ import r from "./vue-components.es22.js";
2
2
  import { inject as c, provide as l } from "vue";
3
- import { onMountedWithCleanup as u } from "./vue-components.es12.js";
3
+ import { onMountedWithCleanup as u } from "./vue-components.es23.js";
4
4
  const f = () => r(), i = Symbol("DialogBus"), p = () => c(i, null), g = () => {
5
5
  const e = f();
6
6
  return l(i, e), e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/vue-components",
3
- "version": "1.8.11",
3
+ "version": "1.8.13",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "effect": "^3.18.0",
@@ -51,8 +51,8 @@
51
51
  "highlight.js": "^11.11.1",
52
52
  "mitt": "^3.0.1",
53
53
  "vue3-highlightjs": "^1.0.5",
54
- "effect-app": "3.10.2",
55
- "@effect-app/vue": "2.84.3"
54
+ "@effect-app/vue": "2.84.3",
55
+ "effect-app": "3.10.2"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "pnpm build:run",
@@ -41,16 +41,17 @@ export type InputProps<From extends Record<PropertyKey, any>, TName extends Deep
41
41
  type: string
42
42
  }
43
43
  field: OmegaFieldInternalApi<From, TName>
44
+ /** be sure to use this state and not `field.state` as it is not reactive */
45
+ state: OmegaFieldInternalApi<From, TName>["state"]
44
46
  }
45
47
 
46
48
  export type MergedInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> =
47
49
  & InputProps<From, TName>["inputProps"]
48
- & Pick<InputProps<From, TName>, "field">
50
+ & Pick<InputProps<From, TName>, "field" | "state">
49
51
 
50
52
  export type VuetifyInputProps<From extends Record<PropertyKey, any>, TName extends DeepKeys<From>> = {
51
53
  inputProps: InputProps<From, TName>["inputProps"] & {
52
54
  type: string
53
55
  options?: { title: string; value: string }[]
54
56
  }
55
- field: InputProps<From, TName>["field"]
56
- }
57
+ } & Pick<InputProps<From, TName>, "field" | "state">
@@ -7,11 +7,12 @@
7
7
  ...validators
8
8
  }"
9
9
  >
10
- <template #default="{ field }">
10
+ <template #default="{ field, state }">
11
11
  <OmegaInternalInput
12
12
  v-if="meta"
13
13
  v-bind="{ ...$attrs, ...$props }"
14
14
  :field="field"
15
+ :state="state"
15
16
  :register="form.registerField"
16
17
  :label="label ?? i18n()"
17
18
  :meta="meta"
@@ -14,7 +14,7 @@
14
14
  :error="inputProps.error"
15
15
  ripple
16
16
  v-bind="$attrs"
17
- :model-value="field.state.value"
17
+ :model-value="state.value"
18
18
  @change="(e: any) => field.handleChange(e.target.checked)"
19
19
  />
20
20
  <v-text-field
@@ -29,7 +29,7 @@
29
29
  :error-messages="inputProps.errorMessages"
30
30
  :error="inputProps.error"
31
31
  v-bind="$attrs"
32
- :model-value="field.state.value"
32
+ :model-value="state.value"
33
33
  @update:model-value="field.handleChange"
34
34
  />
35
35
  <v-textarea
@@ -43,7 +43,7 @@
43
43
  :error-messages="inputProps.errorMessages"
44
44
  :error="inputProps.error"
45
45
  v-bind="$attrs"
46
- :model-value="field.state.value"
46
+ :model-value="state.value"
47
47
  @update:model-value="field.handleChange"
48
48
  />
49
49
  <component
@@ -59,7 +59,7 @@
59
59
  :error-messages="inputProps.errorMessages"
60
60
  :error="inputProps.error"
61
61
  v-bind="$attrs"
62
- :model-value="field.state.value"
62
+ :model-value="state.value"
63
63
  @update:model-value="(e: any) => {
64
64
  if (e || e === 0) {
65
65
  field.handleChange(Number(e) as any)
@@ -76,7 +76,7 @@
76
76
  :error-messages="inputProps.errorMessages"
77
77
  :error="inputProps.error"
78
78
  v-bind="$attrs"
79
- :model-value="field.state.value"
79
+ :model-value="state.value"
80
80
  @update:model-value="field.handleChange"
81
81
  >
82
82
  <v-radio
@@ -100,7 +100,7 @@
100
100
  :error-messages="inputProps.errorMessages"
101
101
  :error="inputProps.error"
102
102
  v-bind="$attrs"
103
- :model-value="field.state.value"
103
+ :model-value="state.value"
104
104
  @clear="field.handleChange(undefined as any)"
105
105
  @update:model-value="field.handleChange"
106
106
  />
@@ -119,7 +119,7 @@
119
119
  :error="inputProps.error"
120
120
  :chips="inputProps.type === 'autocompletemultiple'"
121
121
  v-bind="$attrs"
122
- :model-value="field.state.value"
122
+ :model-value="state.value"
123
123
  @clear="field.handleChange(undefined as any)"
124
124
  @update:model-value="field.handleChange"
125
125
  />
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <slot v-bind="{ ...inputProps.inputProps, field: inputProps.field }">
2
+ <slot v-bind="{ ...inputProps.inputProps, field: inputProps.field, state: inputProps.state }">
3
3
  <div :class="$attrs.class">
4
4
  <OmegaInputVuetify
5
5
  v-if="vuetified"
@@ -26,6 +26,7 @@ defineOptions({
26
26
 
27
27
  const props = defineProps<{
28
28
  field: OmegaFieldInternalApi<From, Name>
29
+ state: OmegaFieldInternalApi<From, Name>["state"]
29
30
  meta: MetaRecord<From>[NestedKeyOf<From>]
30
31
  label: string
31
32
  type?: TypeOverride
@@ -137,6 +138,7 @@ const inputProps: ComputedRef<InputProps<From, Name>> = computed(() => ({
137
138
  options: props.options
138
139
  },
139
140
 
141
+ state: props.state,
140
142
  field: wrapField(props.field)
141
143
  }))
142
144
  </script>
@@ -27,8 +27,15 @@ export const createUseFormWithCustomInput = <
27
27
  ...attrs
28
28
  }, {
29
29
  // Override the default slot that OmegaInternalInput provides
30
- default: <TName extends DeepKeys<From>>({ field, ...inputProps }: MergedInputProps<From, TName>) => {
31
- return h(CustomInputComponent, { ...attrs, field, inputProps })
30
+ default: <TName extends DeepKeys<From>>({ field, state, ...inputProps }: MergedInputProps<From, TName>) => {
31
+ // Filter out attrs that are already in inputProps or are special like 'form'
32
+ const filteredAttrs = Object.fromEntries(
33
+ Object.entries(attrs).filter(([key]) =>
34
+ !Object.prototype.hasOwnProperty.call(inputProps, key)
35
+ && key !== "form"
36
+ )
37
+ )
38
+ return h(CustomInputComponent, { ...filteredAttrs, field, state, inputProps })
32
39
  }
33
40
  })
34
41
  }