@@ -4,18 +4,20 @@ import { FormKitSchema } from '@formkit/vue'
44import { ref } from ' vue'
55import { useFormKitRepeater , useInputEditor , useInputEditorSchema } from ' my-library'
66import { blueprint , formkitPreset } from ' ../../utils/presets'
7+ import { useFormKitSection } from ' ../../../src/composables'
78
89const { editorSchema } = useInputEditorSchema ()
9- const { generateSchemaItemId, schemaToEditorData, editorDataToSchema } = useInputEditor ()
10+ const { schemaToEditorData, editorDataToSchema } = useInputEditor ()
1011const { addListGroupFunctions } = useFormKitRepeater ()
12+ const { generateId } = useFormKitSection ()
1113
1214const formSchema = ref (editorSchema )
1315const formData = ref (null )
1416
1517function enhanceValuesForInputList(values : any []): any [] {
1618 const result = []
1719 values .forEach ((value ) => {
18- result .push ({ ... value , editableItemId: generateSchemaItemId (), selectButton: ' showBasic' })
20+ result .push ({ ... value , editableItemId: generateId (), selectButton: ' showBasic' })
1921 })
2022 return result
2123}
@@ -34,13 +36,13 @@ function actionEdit(schema: any) {
3436
3537function actionInsert(schema : any ) {
3638 const index = formInputList .value .indexOf (schema ) + 1
37- const schemaToInsert = { ... blueprint , editableItemId: generateSchemaItemId (), selectButton: ' showBasic' }
39+ const schemaToInsert = { ... blueprint , editableItemId: generateId (), selectButton: ' showBasic' }
3840 formInputList .value .splice (index , 0 , schemaToInsert )
3941}
4042
4143function actionCopy(schema : any ) {
4244 const index = formInputList .value .indexOf (schema ) + 1
43- const copyOfSchema = { ... schema , editableItemId: generateSchemaItemId () }
45+ const copyOfSchema = { ... schema , editableItemId: generateId () }
4446 formInputList .value .splice (index , 0 , copyOfSchema )
4547}
4648
0 commit comments