@effect-app/vue-components 2.7.2 → 2.7.3
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.
- package/dist/types/components/OmegaForm/OmegaTaggedUnion.vue.d.ts +6 -6
- package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +2 -0
- package/dist/vue-components.es10.js +8 -8
- package/dist/vue-components.es11.js +2 -2
- package/dist/vue-components.es16.js +11 -10
- package/dist/vue-components.es17.js +10 -5
- package/dist/vue-components.es18.js +5 -55
- package/dist/vue-components.es19.js +50 -63
- package/dist/vue-components.es20.js +68 -6
- package/dist/vue-components.es21.js +4 -4
- package/dist/vue-components.es22.js +6 -3
- package/dist/vue-components.es23.js +3 -3
- package/dist/vue-components.es24.js +3 -2
- package/dist/vue-components.es25.js +1 -1
- package/dist/vue-components.es26.js +1 -1
- package/dist/vue-components.es27.js +1 -1
- package/dist/vue-components.es28.js +2 -17
- package/dist/vue-components.es29.js +16 -10
- package/dist/vue-components.es33.js +1 -1
- package/dist/vue-components.es34.js +1 -1
- package/dist/vue-components.es5.js +1 -1
- package/dist/vue-components.es8.js +8 -7
- package/dist/vue-components.es9.js +10 -9
- package/package.json +1 -1
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +2 -1
- package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +5 -0
|
@@ -13,17 +13,17 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends R
|
|
|
13
13
|
attrs: any;
|
|
14
14
|
slots: {
|
|
15
15
|
[x: string]: ((props: {
|
|
16
|
-
field: import("./InputProps").OmegaFieldInternalApi<From,
|
|
17
|
-
state: NonNullable<import("@tanstack/vue-form").DeepValue<From,
|
|
16
|
+
field: import("./InputProps").OmegaFieldInternalApi<From, `${NonNullable<Name>}._tag` | "_tag">;
|
|
17
|
+
state: NonNullable<import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">>;
|
|
18
18
|
}) => any) | undefined;
|
|
19
19
|
[x: number]: ((props: {
|
|
20
|
-
field: import("./InputProps").OmegaFieldInternalApi<From,
|
|
21
|
-
state: NonNullable<import("@tanstack/vue-form").DeepValue<From,
|
|
20
|
+
field: import("./InputProps").OmegaFieldInternalApi<From, `${NonNullable<Name>}._tag` | "_tag">;
|
|
21
|
+
state: NonNullable<import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">>;
|
|
22
22
|
}) => any) | undefined;
|
|
23
23
|
} & {
|
|
24
24
|
OmegaCustomInput?: (props: {
|
|
25
|
-
field: import("@tanstack/vue-form").FieldApi<From,
|
|
26
|
-
state: import("@tanstack/vue-form").FieldState<From,
|
|
25
|
+
field: import("@tanstack/vue-form").FieldApi<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").StandardSchemaV1<From, To>, 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, import("@tanstack/vue-form").FormAsyncValidateOrFn<From> | undefined, Record<string, any> | undefined>;
|
|
26
|
+
state: import("@tanstack/vue-form").FieldState<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FieldAsyncValidateOrFn<From, `${NonNullable<Name>}._tag` | "_tag", import("@tanstack/vue-form").DeepValue<From, `${NonNullable<Name>}._tag` | "_tag">> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").FormValidateOrFn<From> | undefined, import("@tanstack/vue-form").StandardSchemaV1<From, To>, 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
27
|
}) => any;
|
|
28
28
|
} & {
|
|
29
29
|
default?: (props: {}) => any;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type DeepKeys, type DeepValue } from "@tanstack/vue-form";
|
|
2
2
|
import { type OmegaFieldInternalApi } from "./InputProps";
|
|
3
|
+
import { type useOmegaForm } from "./useOmegaForm";
|
|
3
4
|
declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, Name extends DeepKeys<From>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
5
|
props: __VLS_PrettifyLocal<{
|
|
5
6
|
state: DeepValue<From, Name>;
|
|
6
7
|
field: OmegaFieldInternalApi<From, Name>;
|
|
7
8
|
name?: DeepKeys<From>;
|
|
9
|
+
form: ReturnType<typeof useOmegaForm<From, To>>;
|
|
8
10
|
}> & import("vue").PublicProps;
|
|
9
11
|
expose: (exposed: {}) => void;
|
|
10
12
|
attrs: any;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useForm as Y } from "@tanstack/vue-form";
|
|
2
2
|
import { Data as C, S as v, Effect as S, Fiber as j, Option as V, Array as A } from "effect-app";
|
|
3
|
-
import { runtimeFiberAsPromise as ee } from "./vue-components.
|
|
4
|
-
import { isObject as te } from "./vue-components.
|
|
3
|
+
import { runtimeFiberAsPromise as ee } from "./vue-components.es17.js";
|
|
4
|
+
import { isObject as te } from "./vue-components.es18.js";
|
|
5
5
|
import { computed as I, onUnmounted as J, onMounted as re, onBeforeUnmount as ne, watch as K, ref as se, h as Z } from "vue";
|
|
6
|
-
import oe from "./vue-components.
|
|
7
|
-
import ie from "./vue-components.
|
|
8
|
-
import ae from "./vue-components.
|
|
6
|
+
import oe from "./vue-components.es19.js";
|
|
7
|
+
import ie from "./vue-components.es20.js";
|
|
8
|
+
import ae from "./vue-components.es21.js";
|
|
9
9
|
import { generateMetaFromSchema as le } from "./vue-components.es12.js";
|
|
10
10
|
import ce from "./vue-components.es6.js";
|
|
11
11
|
import ue from "./vue-components.es8.js";
|
|
12
|
-
import fe from "./vue-components.
|
|
13
|
-
import { trace as z } from "./vue-components.
|
|
14
|
-
import { context as T } from "./vue-components.
|
|
12
|
+
import fe from "./vue-components.es22.js";
|
|
13
|
+
import { trace as z } from "./vue-components.es23.js";
|
|
14
|
+
import { context as T } from "./vue-components.es24.js";
|
|
15
15
|
const k = (f) => {
|
|
16
16
|
const c = f.ast;
|
|
17
17
|
if (c._tag === "Union") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import l from "./vue-components.
|
|
1
|
+
import l from "./vue-components.es29.js";
|
|
2
2
|
import { inject as c, provide as u } from "vue";
|
|
3
|
-
import { onMountedWithCleanup as f } from "./vue-components.
|
|
3
|
+
import { onMountedWithCleanup as f } from "./vue-components.es16.js";
|
|
4
4
|
const p = () => l(), i = Symbol("DialogBus"), r = () => c(i, null), g = () => {
|
|
5
5
|
const n = p();
|
|
6
6
|
return u(i, n), n;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
}))
|
|
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
|
+
}
|
|
8
11
|
export {
|
|
9
|
-
|
|
10
|
-
i as cloneTrait,
|
|
11
|
-
p as runtimeFiberAsPromise
|
|
12
|
+
p as onMountedWithCleanup
|
|
12
13
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Exit as c, Runtime as u } from "effect";
|
|
2
|
+
import { dual as n, isFunction as m } from "./vue-components.es32.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
|
+
}));
|
|
3
8
|
export {
|
|
4
|
-
|
|
5
|
-
i as
|
|
6
|
-
|
|
9
|
+
a as clone,
|
|
10
|
+
i as cloneTrait,
|
|
11
|
+
p as runtimeFiberAsPromise
|
|
7
12
|
};
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
inheritAttrs: !1,
|
|
4
|
-
__name: "OmegaArray",
|
|
5
|
-
props: {
|
|
6
|
-
form: {},
|
|
7
|
-
inputClass: {},
|
|
8
|
-
name: {},
|
|
9
|
-
defaultItems: {},
|
|
10
|
-
items: {}
|
|
11
|
-
},
|
|
12
|
-
setup(n) {
|
|
13
|
-
const a = n, y = a.form.useStore((e) => e.values), i = f(() => {
|
|
14
|
-
const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
|
|
15
|
-
try {
|
|
16
|
-
return e.split(".").reduce((r, t) => r && r[t], y.value);
|
|
17
|
-
} catch (r) {
|
|
18
|
-
return console.error(r), [];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
M(async () => {
|
|
22
|
-
a.defaultItems && !i.value && a.form.setFieldValue(a.name, a.defaultItems);
|
|
23
|
-
});
|
|
24
|
-
const $ = f(() => (r) => {
|
|
25
|
-
const t = r.replace(/\[\d+\]/g, "");
|
|
26
|
-
return a.form.meta[t];
|
|
27
|
-
});
|
|
28
|
-
return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
|
|
29
|
-
default: g(({ field: t, state: d }) => [
|
|
30
|
-
o(e.$slots, "pre-array", l(u({ field: t, state: d }))),
|
|
31
|
-
(s(!0), k(A, null, C(i.value, (B, m) => (s(), c(p(n.form.Field), {
|
|
32
|
-
key: `${n.name}[${Number(m)}]`,
|
|
33
|
-
name: (
|
|
34
|
-
// eslint-disable-next-line
|
|
35
|
-
`${n.name}[${Number(m)}]`
|
|
36
|
-
)
|
|
37
|
-
}, {
|
|
38
|
-
default: g(({ field: v, state: h }) => [
|
|
39
|
-
o(e.$slots, "default", b({ ref_for: !0 }, {
|
|
40
|
-
subField: v,
|
|
41
|
-
subState: h,
|
|
42
|
-
index: Number(m),
|
|
43
|
-
field: t
|
|
44
|
-
}))
|
|
45
|
-
]),
|
|
46
|
-
_: 2
|
|
47
|
-
}, 1032, ["name"]))), 128)),
|
|
48
|
-
o(e.$slots, "post-array", l(u({ field: t, state: d }))),
|
|
49
|
-
o(e.$slots, "field", l(u({ field: t })))
|
|
50
|
-
]),
|
|
51
|
-
_: 3
|
|
52
|
-
}, 8, ["name"]));
|
|
53
|
-
}
|
|
54
|
-
});
|
|
1
|
+
import { isFunction as c } from "./vue-components.es32.js";
|
|
2
|
+
const s = c, t = (o) => typeof o == "object" && o !== null, i = (o) => t(o) || s(o);
|
|
55
3
|
export {
|
|
56
|
-
|
|
4
|
+
s as isFunction,
|
|
5
|
+
i as isObject,
|
|
6
|
+
t as isRecordOrArray
|
|
57
7
|
};
|
|
@@ -1,70 +1,57 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__name: "
|
|
1
|
+
import { defineComponent as F, computed as f, 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 C, mergeProps as b } from "vue";
|
|
2
|
+
const N = /* @__PURE__ */ F({
|
|
3
|
+
inheritAttrs: !1,
|
|
4
|
+
__name: "OmegaArray",
|
|
5
5
|
props: {
|
|
6
6
|
form: {},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
order: {},
|
|
12
|
-
sort: {}
|
|
7
|
+
inputClass: {},
|
|
8
|
+
name: {},
|
|
9
|
+
defaultItems: {},
|
|
10
|
+
items: {}
|
|
13
11
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
n.form.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
(e
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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));
|
|
12
|
+
setup(n) {
|
|
13
|
+
const a = n, y = a.form.useStore((e) => e.values), i = f(() => {
|
|
14
|
+
const e = a.name.replace(/\[/g, ".").replace(/\]/g, "");
|
|
15
|
+
try {
|
|
16
|
+
return e.split(".").reduce((r, t) => r && r[t], y.value);
|
|
17
|
+
} catch (r) {
|
|
18
|
+
return console.error(r), [];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
M(async () => {
|
|
22
|
+
a.defaultItems && !i.value && a.form.setFieldValue(a.name, a.defaultItems);
|
|
23
|
+
});
|
|
24
|
+
const $ = f(() => (r) => {
|
|
25
|
+
const t = r.replace(/\[\d+\]/g, "");
|
|
26
|
+
return a.form.meta[t];
|
|
27
|
+
});
|
|
28
|
+
return P("getMetaFromArray", $), (e, r) => (s(), c(p(n.form.Field), { name: n.name }, {
|
|
29
|
+
default: g(({ field: t, state: d }) => [
|
|
30
|
+
o(e.$slots, "pre-array", l(u({ field: t, state: d }))),
|
|
31
|
+
(s(!0), k(A, null, C(i.value, (B, m) => (s(), c(p(n.form.Field), {
|
|
32
|
+
key: `${n.name}[${Number(m)}]`,
|
|
33
|
+
name: (
|
|
34
|
+
// eslint-disable-next-line
|
|
35
|
+
`${n.name}[${Number(m)}]`
|
|
36
|
+
)
|
|
37
|
+
}, {
|
|
38
|
+
default: g(({ field: v, state: h }) => [
|
|
39
|
+
o(e.$slots, "default", b({ ref_for: !0 }, {
|
|
40
|
+
subField: v,
|
|
41
|
+
subState: h,
|
|
42
|
+
index: Number(m),
|
|
43
|
+
field: t
|
|
44
|
+
}))
|
|
45
|
+
]),
|
|
46
|
+
_: 2
|
|
47
|
+
}, 1032, ["name"]))), 128)),
|
|
48
|
+
o(e.$slots, "post-array", l(u({ field: t, state: d }))),
|
|
49
|
+
o(e.$slots, "field", l(u({ field: t })))
|
|
50
|
+
]),
|
|
51
|
+
_: 3
|
|
52
|
+
}, 8, ["name"]));
|
|
66
53
|
}
|
|
67
54
|
});
|
|
68
55
|
export {
|
|
69
|
-
|
|
56
|
+
N as default
|
|
70
57
|
};
|
|
@@ -1,8 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
});
|
|
6
68
|
export {
|
|
7
|
-
|
|
69
|
+
I as default
|
|
8
70
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import
|
|
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.es35.js";
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
const e = /* @__PURE__ */
|
|
4
|
+
import o from "./vue-components.es37.js";
|
|
5
|
+
const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-d4ffe76f"]]);
|
|
6
6
|
export {
|
|
7
7
|
e as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var n=document.createElement("style");if(n.appendChild(document.createTextNode("fieldset[data-v-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{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-05e510ab]{display:contents}fieldset[disabled][data-v-05e510ab]>*{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.es38.js";
|
|
3
|
+
|
|
4
|
+
import m from "./vue-components.es37.js";
|
|
5
|
+
const e = /* @__PURE__ */ m(o, [["__scopeId", "data-v-05e510ab"]]);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
e as default
|
|
5
8
|
};
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
1
|
+
import f from "./vue-components.es9.js";
|
|
17
2
|
export {
|
|
18
|
-
|
|
3
|
+
f as default
|
|
19
4
|
};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
} };
|
|
10
16
|
}
|
|
11
17
|
export {
|
|
12
|
-
|
|
18
|
+
c as default
|
|
13
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as v, mergeModels as C, useModel as k, useSlots as V, computed as _, resolveComponent as g, createBlock as y, openBlock as B, unref as a, createSlots as E, withCtx as u, renderSlot as d, renderList as M, normalizeProps as S, guardReactiveProps as w } from "vue";
|
|
2
2
|
import { useOnClose as L } from "./vue-components.es11.js";
|
|
3
|
-
import { onMountedWithCleanup as h } from "./vue-components.
|
|
3
|
+
import { onMountedWithCleanup as h } from "./vue-components.es16.js";
|
|
4
4
|
const z = /* @__PURE__ */ v({
|
|
5
5
|
__name: "Dialog",
|
|
6
6
|
props: /* @__PURE__ */ C({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as d, createBlock as u, openBlock as g, unref as l, withCtx as o, renderSlot as n, createVNode as
|
|
1
|
+
import { defineComponent as d, createBlock as u, openBlock as g, unref as l, withCtx as o, renderSlot as n, createVNode as f, createCommentVNode as c, normalizeProps as r, guardReactiveProps as s, createSlots as $, renderList as y } from "vue";
|
|
2
2
|
import C from "./vue-components.es9.js";
|
|
3
3
|
const h = /* @__PURE__ */ d({
|
|
4
4
|
__name: "OmegaTaggedUnion",
|
|
@@ -14,8 +14,8 @@ const h = /* @__PURE__ */ d({
|
|
|
14
14
|
name: e.name ? `${e.name}._tag` : "_tag"
|
|
15
15
|
}, {
|
|
16
16
|
default: o((t) => [
|
|
17
|
-
n(a.$slots, "OmegaCustomInput", s(
|
|
18
|
-
|
|
17
|
+
n(a.$slots, "OmegaCustomInput", r(s(t)), () => [
|
|
18
|
+
f(l(e.form).Input, {
|
|
19
19
|
name: e.name ? `${e.name}._tag` : "_tag",
|
|
20
20
|
label: e.label,
|
|
21
21
|
type: e.type ?? "select",
|
|
@@ -23,18 +23,19 @@ const h = /* @__PURE__ */ d({
|
|
|
23
23
|
}, null, 8, ["name", "label", "type", "options"])
|
|
24
24
|
]),
|
|
25
25
|
n(a.$slots, "default"),
|
|
26
|
-
|
|
26
|
+
f(C, {
|
|
27
27
|
field: t.field,
|
|
28
28
|
state: t.state.value,
|
|
29
|
-
name: e.name
|
|
29
|
+
name: e.name,
|
|
30
|
+
form: e.form
|
|
30
31
|
}, $({ _: 2 }, [
|
|
31
32
|
y(a.$slots, (k, m) => ({
|
|
32
33
|
name: m,
|
|
33
34
|
fn: o((i) => [
|
|
34
|
-
n(a.$slots, m, s(
|
|
35
|
+
n(a.$slots, m, r(s(i)))
|
|
35
36
|
])
|
|
36
37
|
}))
|
|
37
|
-
]), 1032, ["field", "state", "name"]),
|
|
38
|
+
]), 1032, ["field", "state", "name", "form"]),
|
|
38
39
|
t.state.value ? n(a.$slots, "OmegaCommon", { key: 0 }) : c("", !0)
|
|
39
40
|
]),
|
|
40
41
|
_: 3
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as s, watch as m, renderSlot as o, createCommentVNode as r, normalizeProps as f, mergeProps as i } from "vue";
|
|
2
|
+
const d = /* @__PURE__ */ s({
|
|
3
3
|
__name: "OmegaTaggedUnionInternal",
|
|
4
4
|
props: {
|
|
5
5
|
state: {},
|
|
6
6
|
field: {},
|
|
7
|
-
name: {}
|
|
7
|
+
name: {},
|
|
8
|
+
form: {}
|
|
8
9
|
},
|
|
9
10
|
setup(e) {
|
|
10
|
-
const a = e;
|
|
11
|
-
return
|
|
12
|
-
t === null && a.field.setValue(null), t !== n && setTimeout(() => {
|
|
11
|
+
const a = e, l = a.form.useStore(({ values: t }) => t);
|
|
12
|
+
return m(() => a.state, (t, n) => {
|
|
13
|
+
t === null && a.field.setValue(null), t !== n && (a.form.reset(l.value), setTimeout(() => {
|
|
13
14
|
a.field.validate("change");
|
|
14
|
-
}, 0);
|
|
15
|
-
}), (t, n) => e.state ?
|
|
15
|
+
}, 0));
|
|
16
|
+
}), (t, n) => e.state ? o(t.$slots, `${e.name ? `${e.name}.` : ""}${e.state}`, f(i({ key: 0 }, { field: e.field, state: e.state }))) : r("", !0);
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
d as default
|
|
20
21
|
};
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ defineProps<{
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<template>
|
|
26
|
-
<form.Field :name="
|
|
26
|
+
<form.Field :name="name ? `${name}._tag` : '_tag'">
|
|
27
27
|
<template #default="inputProps">
|
|
28
28
|
<slot
|
|
29
29
|
name="OmegaCustomInput"
|
|
@@ -41,6 +41,7 @@ defineProps<{
|
|
|
41
41
|
:field="inputProps.field as any"
|
|
42
42
|
:state="inputProps.state.value"
|
|
43
43
|
:name="name"
|
|
44
|
+
:form="form"
|
|
44
45
|
>
|
|
45
46
|
<template
|
|
46
47
|
v-for="(_, slotname) in $slots"
|
|
@@ -18,19 +18,24 @@
|
|
|
18
18
|
import { type DeepKeys, type DeepValue } from "@tanstack/vue-form"
|
|
19
19
|
import { watch } from "vue"
|
|
20
20
|
import { type OmegaFieldInternalApi } from "./InputProps"
|
|
21
|
+
import { type useOmegaForm } from "./useOmegaForm"
|
|
21
22
|
|
|
22
23
|
const props = defineProps<{
|
|
23
24
|
state: DeepValue<From, Name>
|
|
24
25
|
field: OmegaFieldInternalApi<From, Name>
|
|
25
26
|
name?: DeepKeys<From>
|
|
27
|
+
form: ReturnType<typeof useOmegaForm<From, To>>
|
|
26
28
|
}>()
|
|
27
29
|
|
|
30
|
+
const values = props.form.useStore(({ values }) => values)
|
|
31
|
+
|
|
28
32
|
// Watch for _tag changes
|
|
29
33
|
watch(() => props.state, (newTag, oldTag) => {
|
|
30
34
|
if (newTag === null) {
|
|
31
35
|
props.field.setValue(null as DeepValue<From, Name>)
|
|
32
36
|
}
|
|
33
37
|
if (newTag !== oldTag) {
|
|
38
|
+
props.form.reset(values.value)
|
|
34
39
|
setTimeout(() => {
|
|
35
40
|
props.field.validate("change")
|
|
36
41
|
}, 0)
|