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/Cell.vue b/packages/nc-gui-v2/components/smartsheet/Cell.vue index b103ca1842..8fb5d05bf8 100644 --- a/packages/nc-gui-v2/components/smartsheet/Cell.vue +++ b/packages/nc-gui-v2/components/smartsheet/Cell.vue @@ -18,11 +18,21 @@ interface Emits { const { column, ...props } = defineProps() -const emit = defineEmits(['update:modelValue', 'save', 'navigate']) +const emit = defineEmits(['update:modelValue', 'save', 'navigate', 'cancel']) provide(ColumnInj, column) -provide(EditModeInj, toRef(props, 'editEnabled')) +provide( + EditModeInj, + computed({ + get() { + return props?.editEnabled + }, + set() { + return emit('cancel') + }, + }), +) let changed = $ref(false) const syncValue = useDebounceFn(function () { diff --git a/packages/nc-gui-v2/components/smartsheet/Grid.vue b/packages/nc-gui-v2/components/smartsheet/Grid.vue index ecff0198e1..ad60b6d0fd 100644 --- a/packages/nc-gui-v2/components/smartsheet/Grid.vue +++ b/packages/nc-gui-v2/components/smartsheet/Grid.vue @@ -208,115 +208,117 @@ const onNavigate = (dir: NavigateDir) => { - - + - - - - + + + + + - - + - - + + + + - - + - + + + + +
-
-
#
-
- - +
+
+
#
+
+ + +
- -
- - - - -
- -
- -
-
+ + + + +
+ +
+ +
+
-
-
{{ rowIndex + 1 }}
-
- - -
+
+
{{ rowIndex + 1 }}
+
+ + +
- -
-
- + :data-col="columnObj.id" + @click="selectCell(rowIndex, colIndex)" + @dblclick="editEnabled = true" + @contextmenu="contextMenuTarget = { row: rowIndex, col: colIndex }" + > +
+ - -
-
- -
- - +
+ +
+ + {{ $t('activity.addRow') }} -
- -
-