Browse Source

refactor(gui-v2): replace with use

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2992/head
Pranav C 2 years ago
parent
commit
9e9053d212
  1. 14
      packages/nc-gui-v2/components/smartsheet/Cell.vue
  2. 1
      packages/nc-gui-v2/components/smartsheet/Grid.vue

14
packages/nc-gui-v2/components/smartsheet/Cell.vue

@ -18,21 +18,11 @@ interface Emits {
const { column, ...props } = defineProps<Props>()
const emit = defineEmits(['update:modelValue', 'save', 'navigate', 'cancel'])
const emit = defineEmits(['update:modelValue', 'save', 'navigate', 'update:editEnabled'])
provide(ColumnInj, column)
provide(
EditModeInj,
computed({
get() {
return props?.editEnabled
},
set() {
return emit('cancel')
},
}),
)
provide(EditModeInj, useVModel(props, 'editEnabled', emit))
let changed = $ref(false)
const syncValue = useDebounceFn(function () {

1
packages/nc-gui-v2/components/smartsheet/Grid.vue

@ -286,6 +286,7 @@ const onNavigate = (dir: NavigateDir) => {
v-model="row.row[columnObj.title]"
:column="columnObj"
:edit-enabled="editEnabled && selected.col === colIndex && selected.row === rowIndex"
@update:edit-enabled="editEnabled = false"
@save="updateOrSaveRow(row, columnObj.title)"
@navigate="onNavigate"
@cancel="editEnabled = false"

Loading…
Cancel
Save