Skip to content

Commit 4a129a9

Browse files
committed
feat: replace FormKit components with custom FormKitDataEdit and FormKitDataView
1 parent ee3e0f7 commit 4a129a9

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

dev/components/demo/PrimeInput.vue

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<script setup lang='ts'>
2-
import { FormKit, FormKitSchema } from '@formkit/vue'
32
import JsonEditorVue from 'json-editor-vue'
3+
import { FormKitDataEdit } from 'my-library'
44
import { ref } from 'vue'
5-
import FormKitDebug from '../../../src/components/FormKitDebug.vue'
65
import { useMessages } from '../../composables/messages'
76
87
const props = defineProps<{
@@ -36,21 +35,8 @@ async function submitHandler() {
3635
<slot />
3736
<div class="flex gap-8 flex-wrap">
3837
<div class="min-w-32rem basis-1/2 xl:basis-1/3">
39-
<div class="p-formkit-data-edit">
40-
<FormKit
41-
id="form"
42-
v-model="formData"
43-
:form-class="formClass"
44-
type="form"
45-
submit-label="Save"
46-
:submit-attrs="{
47-
inputClass,
48-
}"
49-
@submit="submitHandler"
50-
>
51-
<FormKitSchema :schema="formSchema" :data="formData" />
52-
</FormKit>
53-
<FormKitDebug :data="formData" header="Data" />
38+
<div>
39+
<FormKitDataEdit :data="formData" :schema="formSchema" debug-data @data-saved="submitHandler" />
5440
</div>
5541
</div>
5642
<div class="basis-1/2 xl:basis-1/3">

dev/components/demo/PrimeOutput.vue

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang='ts'>
2-
import { FormKit, FormKitSchema } from '@formkit/vue'
32
import JsonEditorVue from 'json-editor-vue'
3+
import { FormKitDataView } from 'my-library'
4+
45
import { ref } from 'vue'
5-
import FormKitDebug from '../../../src/components/FormKitDebug.vue'
66
77
const props = defineProps<{
88
header: string
@@ -24,15 +24,8 @@ const formData = ref(props.data)
2424
<slot />
2525
<div class="flex flex-wrap gap-8">
2626
<div class="min-w-30rem basis-1/3 md:basis-1/4">
27-
<div class="p-formkit-data-view">
28-
<FormKit
29-
v-model="formData"
30-
type="form"
31-
:actions="false"
32-
>
33-
<FormKitSchema :schema="formSchema" :data="formData" />
34-
</FormKit>
35-
<FormKitDebug :data="formData" header="Data" />
27+
<div>
28+
<FormKitDataView :data="formData" :schema="formSchema" debug-data />
3629
</div>
3730
</div>
3831
<div class="">

0 commit comments

Comments
 (0)