@effect-app/vue-components 4.0.0-beta.307 → 4.0.0-beta.308
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/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.308",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/effect-app/libs.git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"vue-toastification": "^2.0.0-rc.5",
|
|
40
40
|
"vue-tsc": "^3.3.3",
|
|
41
41
|
"vuetify": "^4.0.8",
|
|
42
|
-
"@effect-app/eslint-shared-config": "0.6.0-beta.
|
|
42
|
+
"@effect-app/eslint-shared-config": "0.6.0-beta.36"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"src",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"highlight.js": "^11.11.1",
|
|
63
63
|
"mitt": "^3.0.1",
|
|
64
64
|
"vue3-highlightjs": "^1.0.5",
|
|
65
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
66
|
-
"effect-app": "4.0.0-beta.
|
|
65
|
+
"@effect-app/vue": "4.0.0-beta.308",
|
|
66
|
+
"effect-app": "4.0.0-beta.308"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"check": "vue-tsc",
|
|
@@ -31,7 +31,7 @@ export const usePreventClose = (mkIsDirty: () => Ref<boolean>) => {
|
|
|
31
31
|
const message = formatMessage
|
|
32
32
|
? formatMessage({ id: "form.unsaved_changes_confirm", defaultMessage })
|
|
33
33
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- key may not be registered in the locale catalog
|
|
34
|
-
: trans?.("form.unsaved_changes_confirm"
|
|
34
|
+
: trans?.("form.unsaved_changes_confirm") ?? defaultMessage
|
|
35
35
|
if (!confirm(message)) {
|
|
36
36
|
evt.prevent = true
|
|
37
37
|
}
|
|
@@ -115,16 +115,16 @@ export const metadataFromAst = <From, To>(
|
|
|
115
115
|
// Root-level discriminated union
|
|
116
116
|
classifyAndWalkUnion(ast, "", { required: true, nullableOrUndefined: false }, ctx)
|
|
117
117
|
|
|
118
|
-
return { meta: newMeta
|
|
118
|
+
return { meta: newMeta, defaultValues, unionMeta }
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
if (S.AST.isObjects(ast)) {
|
|
122
122
|
walkStruct(ast.propertySignatures, "", { required: true, nullableOrUndefined: false }, ctx)
|
|
123
123
|
|
|
124
|
-
return { meta: newMeta
|
|
124
|
+
return { meta: newMeta, defaultValues, unionMeta }
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
return { meta: newMeta
|
|
127
|
+
return { meta: newMeta, defaultValues, unionMeta }
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export const generateMetaFromSchema = <From, To>(
|
|
@@ -7,6 +7,7 @@ import { isNullableOrUndefined, unwrapDeclaration } from "./createMeta"
|
|
|
7
7
|
const extractDefaultFromLink = (link: any): unknown | undefined => {
|
|
8
8
|
if (!link?.transformation?.decode?.run) return undefined
|
|
9
9
|
try {
|
|
10
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- vue-tsc needs the decoded value narrowed at this boundary
|
|
10
11
|
const result = Effect.runSync(link.transformation.decode.run(Option.none())) as Option.Option<unknown>
|
|
11
12
|
return Option.isSome(result) ? result.value : undefined
|
|
12
13
|
} catch {
|
|
@@ -52,7 +52,7 @@ export const leafMetaForAst = (
|
|
|
52
52
|
nullableOrUndefined,
|
|
53
53
|
type: "select",
|
|
54
54
|
members: [ast.literal]
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
return {
|
|
@@ -143,7 +143,7 @@ export const classifyAndWalkUnion = <T>(
|
|
|
143
143
|
if (tagValue) {
|
|
144
144
|
const existing = ctx.unionMeta[tagValue]
|
|
145
145
|
if (existing) Object.assign(existing, branchCtx.acc as MetaRecord<T>)
|
|
146
|
-
else ctx.unionMeta[tagValue] = branchCtx.acc
|
|
146
|
+
else ctx.unionMeta[tagValue] = branchCtx.acc
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
for (const [metaKey, metaValue] of Object.entries(branchCtx.acc)) {
|
|
@@ -171,7 +171,7 @@ export const classifyAndWalkUnion = <T>(
|
|
|
171
171
|
type: "select",
|
|
172
172
|
members: discriminatorValues,
|
|
173
173
|
required: !isNullableDiscriminatedUnion
|
|
174
|
-
}
|
|
174
|
+
}
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
return
|
|
@@ -192,7 +192,7 @@ export const classifyAndWalkUnion = <T>(
|
|
|
192
192
|
nullableOrUndefined,
|
|
193
193
|
type: "select",
|
|
194
194
|
members: resolvedTypes.filter(S.AST.isLiteral).map((t) => t.literal)
|
|
195
|
-
}
|
|
195
|
+
}
|
|
196
196
|
if (isOptionalKey) leaf.isOptionalKey = true
|
|
197
197
|
acc[key as NestedKeyOf<T>] = leaf
|
|
198
198
|
return
|
|
@@ -65,7 +65,7 @@ export const wrapOnSubmit = <From, To>(
|
|
|
65
65
|
// validators only validate, they don't actually transform, so we have to do that manually here.
|
|
66
66
|
const parsedValue = await runPromise(decode(value))
|
|
67
67
|
const r = userOnSubmit({
|
|
68
|
-
formApi
|
|
68
|
+
formApi,
|
|
69
69
|
meta,
|
|
70
70
|
value: parsedValue
|
|
71
71
|
})
|