@effect-app/vue-components 4.0.0-beta.231 → 4.0.0-beta.232
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 +2 -2
- package/dist/types/components/OmegaForm/OmegaTaggedUnionInternal.vue.d.ts +3 -3
- package/dist/vue-components37.es.js +4 -4
- package/dist/vue-components39.es.js +3 -3
- package/package.json +4 -4
- package/src/components/OmegaForm/OmegaTaggedUnion.vue +8 -2
- package/src/components/OmegaForm/OmegaTaggedUnionInternal.vue +5 -5
|
@@ -15,8 +15,8 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends R
|
|
|
15
15
|
attrs: any;
|
|
16
16
|
slots: {
|
|
17
17
|
[x: string]: ((props: {
|
|
18
|
-
field: import("./InputProps").OmegaFieldInternalApi<From,
|
|
19
|
-
|
|
18
|
+
field: import("./InputProps").OmegaFieldInternalApi<From, DeepKeys<From>>;
|
|
19
|
+
tag: string;
|
|
20
20
|
}) => any) | undefined;
|
|
21
21
|
} & {
|
|
22
22
|
OmegaCustomInput?: (props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type DeepKeys
|
|
1
|
+
import { type DeepKeys } from "@tanstack/vue-form";
|
|
2
2
|
import { type OmegaFieldInternalApi } from "./InputProps";
|
|
3
3
|
import { type useOmegaForm } from "./useOmegaForm";
|
|
4
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_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
6
|
-
|
|
6
|
+
tag: string | null;
|
|
7
7
|
field: OmegaFieldInternalApi<From, Name>;
|
|
8
8
|
name?: DeepKeys<From>;
|
|
9
9
|
form: ReturnType<typeof useOmegaForm<From, To>>;
|
|
@@ -15,7 +15,7 @@ declare const __VLS_export: <From extends Record<PropertyKey, any>, To extends R
|
|
|
15
15
|
slots: {
|
|
16
16
|
[x: string]: ((props: {
|
|
17
17
|
field: OmegaFieldInternalApi<From, Name>;
|
|
18
|
-
|
|
18
|
+
tag: string;
|
|
19
19
|
}) => any) | undefined;
|
|
20
20
|
};
|
|
21
21
|
emit: {};
|
|
@@ -3,20 +3,20 @@ import { createCommentVNode as e, defineComponent as t, mergeProps as n, normali
|
|
|
3
3
|
var o = /* @__PURE__ */ t({
|
|
4
4
|
__name: "OmegaTaggedUnionInternal",
|
|
5
5
|
props: {
|
|
6
|
-
|
|
6
|
+
tag: {},
|
|
7
7
|
field: {},
|
|
8
8
|
name: {},
|
|
9
9
|
form: {}
|
|
10
10
|
},
|
|
11
11
|
setup(t) {
|
|
12
12
|
let o = t, s = o.form.useStore(({ values: e }) => e);
|
|
13
|
-
return a(() => o.
|
|
13
|
+
return a(() => o.tag, (e, t) => {
|
|
14
14
|
e === null && o.field.setValue(null), e !== t && (o.form.reset(s.value), setTimeout(() => {
|
|
15
15
|
o.field.validate("change");
|
|
16
16
|
}, 0));
|
|
17
|
-
}, { immediate: !0 }), (a, o) => t.
|
|
17
|
+
}, { immediate: !0 }), (a, o) => t.tag ? i(a.$slots, `${t.name ? `${t.name}.` : ""}${t.tag}`, r(n({ key: 0 }, {
|
|
18
18
|
field: t.field,
|
|
19
|
-
|
|
19
|
+
tag: t.tag
|
|
20
20
|
}))) : e("", !0);
|
|
21
21
|
}
|
|
22
22
|
});
|
|
@@ -37,7 +37,7 @@ var _ = /* @__PURE__ */ o({
|
|
|
37
37
|
p(t.$slots, "default"),
|
|
38
38
|
a(e, {
|
|
39
39
|
field: n.field,
|
|
40
|
-
|
|
40
|
+
tag: v.value,
|
|
41
41
|
name: o.name,
|
|
42
42
|
form: o.form
|
|
43
43
|
}, i({ _: 2 }, [f(t.$slots, (e, n) => ({
|
|
@@ -45,11 +45,11 @@ var _ = /* @__PURE__ */ o({
|
|
|
45
45
|
fn: g((e) => [p(t.$slots, n, c(s(e)))])
|
|
46
46
|
}))]), 1032, [
|
|
47
47
|
"field",
|
|
48
|
-
"
|
|
48
|
+
"tag",
|
|
49
49
|
"name",
|
|
50
50
|
"form"
|
|
51
51
|
]),
|
|
52
|
-
|
|
52
|
+
v.value ? p(t.$slots, "OmegaCommon", { key: 0 }) : r("", !0)
|
|
53
53
|
]),
|
|
54
54
|
_: 3
|
|
55
55
|
}, 8, ["name"]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.232",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.66",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@opentelemetry/api": "^1.9.1",
|
|
56
|
-
"@tanstack/vue-form": "^1.
|
|
56
|
+
"@tanstack/vue-form": "^1.32.0",
|
|
57
57
|
"highlight.js": "^11.11.1",
|
|
58
58
|
"mitt": "^3.0.1",
|
|
59
59
|
"vue3-highlightjs": "^1.0.5",
|
|
60
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
61
|
-
"effect-app": "4.0.0-beta.
|
|
60
|
+
"@effect-app/vue": "4.0.0-beta.232",
|
|
61
|
+
"effect-app": "4.0.0-beta.232"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"check": "vue-tsc",
|
|
@@ -75,9 +75,15 @@ provide("getMetaFromArray", getMetaFromArray)
|
|
|
75
75
|
/>
|
|
76
76
|
</slot>
|
|
77
77
|
<slot />
|
|
78
|
+
<!--
|
|
79
|
+
Drive the branch off `currentTag`: the tag is read from the form store
|
|
80
|
+
(the canonical state), the same single source of truth that feeds
|
|
81
|
+
`getMetaFromArray` above — rather than the `Field` slot's `state`,
|
|
82
|
+
which is only a projection of it.
|
|
83
|
+
-->
|
|
78
84
|
<OmegaTaggedUnionInternal
|
|
79
85
|
:field="inputProps.field as any"
|
|
80
|
-
:
|
|
86
|
+
:tag="currentTag"
|
|
81
87
|
:name="name"
|
|
82
88
|
:form="form"
|
|
83
89
|
>
|
|
@@ -92,7 +98,7 @@ provide("getMetaFromArray", getMetaFromArray)
|
|
|
92
98
|
</template>
|
|
93
99
|
</OmegaTaggedUnionInternal>
|
|
94
100
|
<slot
|
|
95
|
-
v-if="
|
|
101
|
+
v-if="currentTag"
|
|
96
102
|
name="OmegaCommon"
|
|
97
103
|
/>
|
|
98
104
|
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<slot
|
|
3
|
-
v-if="
|
|
4
|
-
:name="`${name ? `${name}.` : ''}${
|
|
5
|
-
v-bind="{ field,
|
|
3
|
+
v-if="tag"
|
|
4
|
+
:name="`${name ? `${name}.` : ''}${tag}`"
|
|
5
|
+
v-bind="{ field, tag }"
|
|
6
6
|
/>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ import { type OmegaFieldInternalApi } from "./InputProps"
|
|
|
17
17
|
import { type useOmegaForm } from "./useOmegaForm"
|
|
18
18
|
|
|
19
19
|
const props = defineProps<{
|
|
20
|
-
|
|
20
|
+
tag: string | null
|
|
21
21
|
field: OmegaFieldInternalApi<From, Name>
|
|
22
22
|
name?: DeepKeys<From>
|
|
23
23
|
form: ReturnType<typeof useOmegaForm<From, To>>
|
|
@@ -26,7 +26,7 @@ const props = defineProps<{
|
|
|
26
26
|
const values = props.form.useStore(({ values }) => values)
|
|
27
27
|
|
|
28
28
|
// Watch for _tag changes
|
|
29
|
-
watch(() => props.
|
|
29
|
+
watch(() => props.tag, (newTag, oldTag) => {
|
|
30
30
|
if (newTag === null) {
|
|
31
31
|
props.field.setValue(null as DeepValue<From, Name>)
|
|
32
32
|
}
|