Skip to content

Commit 953d78d

Browse files
committed
fix(samples): Some minor fixes
1 parent d166f6d commit 953d78d

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

dev/components/app/AppTopbar.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,17 @@ const items = ref([
100100
{ label: 'Basic', icon: 'pi pi-fw pi-user-edit', route: '/styling/base' },
101101
{ label: 'Pass Through', icon: 'pi pi-fw pi-user-edit', route: '/styling/passThrough' },
102102
{ label: 'FormKit Class', icon: 'pi pi-fw pi-user-edit', route: '/styling/class' },
103-
{ label: 'Grid based Form', icon: 'pi pi-fw pi-user-edit', route: '/styling/grid' },
103+
{ label: 'Grid', icon: 'pi pi-fw pi-user-edit', route: '/styling/grid' },
104104
],
105105
},
106106
],
107107
[
108108
{
109109
label: 'Samples',
110110
items: [
111+
{ label: 'Repeater', icon: 'pi pi-fw pi-user-edit', route: '/samples/repeater' },
111112
{ label: 'Input Editor', icon: 'pi pi-fw pi-user-edit', route: '/samples/inputEditor' },
112113
{ label: 'Form Editor', icon: 'pi pi-fw pi-user-edit', route: '/samples/formEditor' },
113-
{ label: 'Grid', icon: 'pi pi-fw pi-user-edit', route: '/samples/grid' },
114-
{ label: 'Repeater', icon: 'pi pi-fw pi-user-edit', route: '/samples/repeater' },
115114
],
116115
},
117116
],

dev/components/demo/PrimeInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function submitHandler() {
3838
</h2>
3939
<slot />
4040
<div class="flex flex-wrap gap-8">
41-
<div class="min-w-35rem basis-1/3 md:basis-1/4">
41+
<div class="min-w-30rem basis-1/3 xl:basis-1/4">
4242
<FormKitDataEdit :form-class="formClass" :schema="formSchema" :data="formData" :debug-schema="false" :debug-data="true" form-class="data-edit" @data-saved="submitHandler" />
4343
</div>
4444
<div class="">

dev/pages/samples/FormEditor.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
import { useDragAndDrop } from '@formkit/drag-and-drop/vue'
33
import { FormKitSchema } from '@formkit/vue'
44
import { ref } from 'vue'
5-
import { useInputEditor, useInputEditorSchema } from 'my-library'
5+
import { useFormKitRepeater, useInputEditor, useInputEditorSchema } from 'my-library'
66
import { blueprint, formkitPreset } from '../../utils/presets'
77
88
const { editorSchema } = useInputEditorSchema()
99
const { generateSchemaItemId, schemaToEditorData, editorDataToSchema } = useInputEditor()
10+
const { addListGroupFunctions } = useFormKitRepeater()
1011
1112
const formSchema = ref(editorSchema)
1213
const formData = ref(null)
@@ -26,7 +27,9 @@ function actionDelete(schema: any) {
2627
}
2728
2829
function actionEdit(schema: any) {
29-
formData.value = schemaToEditorData({ ...schema })
30+
const data = schemaToEditorData({ ...schema })
31+
addListGroupFunctions(data)
32+
formData.value = data
3033
}
3134
3235
function actionInsert(schema: any) {
@@ -66,7 +69,7 @@ const schemaResult = computed(() => editorDataToSchema(formData.value))
6669
<div class="grid grid-cols-2 xl:grid-cols-3 gap-10">
6770
<div>
6871
<ul ref="formInputRef" class="list-none">
69-
<li v-for="formInput in formInputList" :key="formInput" class="mb-1">
72+
<li v-for="formInput in formInputList" :key="formInput" class="mt-4">
7073
<div class="" style="box-sizing: border-box;">
7174
<div class="min-w-100 mr-4 flex gap-2">
7275
<span class="block p-drag-handle"><i class="pi pi-bars text-[color:var(--primary-color)]" /></span>

src/composables/useFormKitRepeater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function useFormKitRepeater() {
3939
}
4040
}
4141

42-
function addGroupButtons(innerClass: string = '', outerClass: string = 'col-6', label: string = 'Actions', help: string = '', render: string = 'true') {
42+
function addGroupButtons(innerClass: string = '', outerClass: string = 'col-4', label: string = 'Actions', help: string = '', render: string = 'true') {
4343
const addButtonComponent = (onClick: string = '', label: string = '', icon: string = '', severity: string = '', render: string = 'true', styleClass: string = 'p-button-sm'): object => {
4444
return addComponent('Button', { onClick, label, icon, class: styleClass, severity }, render)
4545
}

src/composables/useInputEditorSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export function useInputEditorSchema() {
315315
[
316316
{
317317
$formkit: 'primeInputText',
318-
label: 'PrimeVue Property',
318+
label: 'PrimeVue Key',
319319
name: 'prime_key',
320320
outerClass: 'col-3',
321321
},

0 commit comments

Comments
 (0)