diff --git a/packages/nc-gui-v2/components/cell/Text.vue b/packages/nc-gui-v2/components/cell/Text.vue index 2b530448d3..ccd0bca0c7 100644 --- a/packages/nc-gui-v2/components/cell/Text.vue +++ b/packages/nc-gui-v2/components/cell/Text.vue @@ -18,6 +18,6 @@ const focus = (el: HTMLInputElement) => el?.focus() diff --git a/packages/nc-gui-v2/components/cell/TextArea.vue b/packages/nc-gui-v2/components/cell/TextArea.vue index a6d50e9efc..c27933fe56 100644 --- a/packages/nc-gui-v2/components/cell/TextArea.vue +++ b/packages/nc-gui-v2/components/cell/TextArea.vue @@ -24,6 +24,7 @@ const focus = (el: HTMLTextAreaElement) => el?.focus() v-model="vModel" rows="4" class="h-full w-full min-h-[60px] outline-none" + @blur="editEnabled = false" @keydown.alt.enter.stop @keydown.shift.enter.stop /> diff --git a/packages/nc-gui-v2/components/smartsheet-column/CheckboxOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/CheckboxOptions.vue new file mode 100644 index 0000000000..dd1e2743ac --- /dev/null +++ b/packages/nc-gui-v2/components/smartsheet-column/CheckboxOptions.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index bd14e23eab..949cb1ecb5 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -91,6 +91,7 @@ watchEffect(() => { +
() -const emit = defineEmits(['update:modelValue', 'save']) +const emit = defineEmits(['update:modelValue', 'save', 'navigate', 'update:editEnabled']) provide(ColumnInj, column) -provide(EditModeInj, toRef(props, 'editEnabled')) +provide(EditModeInj, useVModel(props, 'editEnabled', emit)) let changed = $ref(false) const syncValue = useDebounceFn(function () { + changed = false emit('save') }, 1000) @@ -59,6 +61,7 @@ const vModel = computed({ syncValue() } else if (!isManualSaved) { emit('save') + changed = true } } }, @@ -87,10 +90,26 @@ const { isPercent, isPhoneNumber, } = useColumn(column) + +const syncAndNavigate = (dir: NavigateDir) => { + if (changed) { + emit('save') + changed = false + } + emit('navigate', dir) +}