Skip to content

Commit 8988a96

Browse files
committed
fix types and test
1 parent 00146a9 commit 8988a96

File tree

7 files changed

+32
-63
lines changed

7 files changed

+32
-63
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"zod": "^4.1.13"
9090
},
9191
"resolutions": {
92-
"@nuxt/content": "https://pkg.pr.new/@nuxt/content@c5cc00c",
92+
"@nuxt/content": "https://pkg.pr.new/@nuxt/content@9b4b4f2",
9393
"nuxt-component-meta": "^0.15.0",
9494
"@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@049b182"
9595
},

pnpm-lock.yaml

Lines changed: 23 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/src/components/form/FormPanelInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ function computeValue(formItem: FormItem): unknown {
9191
>
9292
<FormInputArray
9393
v-if="isArrayType"
94-
v-model="model"
94+
v-model="(model as unknown[])"
9595
:form-item="formItem.arrayItemForm"
9696
/>
9797
<UInput
9898
v-else
9999
:id="formItem.id"
100-
v-model="model"
100+
v-model="(model as string | number)"
101101
:placeholder="placeholder"
102102
:type="inputType"
103103
class="w-full"

src/app/src/components/form/input/FormInputArray.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function updateObjectItem(index: number, value: Record<string, unknown>) {
9494
</template>
9595

9696
<FormInputObject
97-
:model-value="item.value"
97+
v-model="(item.value as Record<string, unknown>)"
9898
:children="formItem.children"
9999
@update:model-value="updateObjectItem(item.index, $event)"
100100
/>

src/app/src/components/form/input/FormInputObject.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function updateValue(key: string, value: string | number) {
4646
}"
4747
>
4848
<UInput
49-
:model-value="entry.value"
49+
v-model="(entry.value as string | number)"
5050
:placeholder="entry.placeholder"
5151
:type="entry.type"
5252
class="w-full"

src/app/src/utils/form.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const buildFormTreeFromSchema = (treeKey: string, schema: Draft07): FormT
5151
}
5252

5353
// Handle multiple types with boolean
54-
if (item?.type !== 'boolean' && booleanDef) {
54+
if (item!.type !== 'boolean' && booleanDef) {
5555
item!.toggleable = true
5656
}
5757

src/app/test/unit/utils/form.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('buildFormTreeFromSchema', () => {
6767
id: '#posts/array',
6868
type: 'array',
6969
title: 'Array',
70-
items: {
70+
arrayItemForm: {
7171
id: '#array/items',
7272
type: 'object',
7373
title: 'Items',
@@ -167,7 +167,7 @@ describe('buildFormTreeFromSchema', () => {
167167
id: '#pricing/plans/solo/features',
168168
title: 'Features',
169169
type: 'array',
170-
items: {
170+
arrayItemForm: {
171171
id: '#features/items',
172172
title: 'Items',
173173
type: 'string',
@@ -707,7 +707,7 @@ describe('applyValuesToFormTree', () => {
707707
type: 'array',
708708
title: 'Authors',
709709
value: ['alexia-wong'],
710-
items: {
710+
arrayItemForm: {
711711
id: '#authors/items',
712712
title: 'Items',
713713
type: 'object',

0 commit comments

Comments
 (0)