@@ -3,6 +3,7 @@ import { NButton, NIcon } from 'naive-ui'
33import { computed } from ' vue'
44import { useRowEditorModal } from ' @/composables/useRowEditorModal'
55import { Pencil , Trash } from ' @/lib/icons'
6+ import { buildEditorFieldsFromValue } from ' @/lib/rowEditor'
67import JsonNode from ' ./JsonNode.vue'
78import RowEditorModal from ' ./RowEditorModal.vue'
89
@@ -47,6 +48,8 @@ const {
4748 editorRow: editorDoc ,
4849 editorFilter ,
4950 editorSource ,
51+ editorFields ,
52+ editorFocusField ,
5053 openEditor ,
5154 closeEditor ,
5255 performMutation ,
@@ -79,14 +82,14 @@ const docs = computed(() => {
7982 class =" doc-row"
8083 >
8184 <div v-if =" showEdit || showDelete" class =" flex justify-end gap-2 mb-1" >
82- <NButton v-if =" showEdit " size="small" tertiary title="Edit document" @click .stop .prevent =" openEditor (' update' , doc )" >
85+ <NButton v-if =" showEdit " size="small" tertiary title="Edit document" @click .stop .prevent =" openEditor (' update' , doc , ' ' , ' ' , buildEditorFieldsFromValue ( doc ) )" >
8386 <template #icon >
8487 <NIcon :size =" 16 " >
8588 <Pencil />
8689 </NIcon >
8790 </template >
8891 </NButton >
89- <NButton v-if =" showDelete " size="small" tertiary title="Delete document" @click .stop .prevent =" openEditor (' delete' , doc )" >
92+ <NButton v-if =" showDelete " size="small" tertiary title="Delete document" @click .stop .prevent =" openEditor (' delete' , doc , ' ' , ' ' , buildEditorFieldsFromValue ( doc ) )" >
9093 <template #icon >
9194 <NIcon :size =" 16 " >
9295 <Trash />
@@ -104,6 +107,8 @@ const docs = computed(() => {
104107 v-model :show =" showEditor "
105108 :operation =" editorOperation "
106109 :row =" editorDoc "
110+ :fields =" editorFields "
111+ :focus-field =" editorFocusField "
107112 :filter =" editorFilter "
108113 :source =" editorSource "
109114 @submit =" handleMutation "
0 commit comments