Browse Source

refactor(gui-v2): saving logic for duration

pull/2716/head
Wing-Kam Wong 2 years ago committed by Pranav C
parent
commit
c0988fac6a
  1. 10
      packages/nc-gui-v2/components/cell/Duration.vue

10
packages/nc-gui-v2/components/cell/Duration.vue

@ -21,7 +21,7 @@ const { modelValue } = defineProps<Props>()
// ------------ // ------------
// emit // emit
// ------------ // ------------
const emit = defineEmits(['update:input']) const emit = defineEmits(['update:modelValue'])
// ------------ // ------------
// data // data
@ -67,9 +67,9 @@ const checkDurationFormat = (evt: any) => {
} }
} }
const onBlur = () => { const submitDuration = () => {
if (isEdited.value) { if (isEdited.value) {
emit('update:input', durationInMS.value) emit('update:modelValue', durationInMS.value)
} }
isEdited.value = false isEdited.value = false
} }
@ -81,9 +81,9 @@ const onBlur = () => {
ref="durationInput" ref="durationInput"
v-model="localState" v-model="localState"
:placeholder="durationPlaceholder" :placeholder="durationPlaceholder"
@blur="onBlur" @blur="submitDuration"
@keypress="checkDurationFormat($event)" @keypress="checkDurationFormat($event)"
@keydown.enter="isEdited && emit('update:input', durationInMS.value)" @keydown.enter="submitDuration"
/> />
<div v-if="showWarningMessage == true" class="duration-warning"> <div v-if="showWarningMessage == true" class="duration-warning">
<!-- TODO: i18n --> <!-- TODO: i18n -->

Loading…
Cancel
Save