mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
49 lines
1.3 KiB
Vue
49 lines
1.3 KiB
Vue
<template>
|
|
<FormGroup class="margin-bottom-2" :error="touched && !valid">
|
|
<FormInput
|
|
ref="input"
|
|
v-model="formattedValue"
|
|
size="large"
|
|
:placeholder="field.duration_format"
|
|
:error="touched && !valid"
|
|
:disabled="readOnly"
|
|
class="field-duration"
|
|
@keypress="onKeyPress(field, $event)"
|
|
@keyup.enter="$refs.input.blur()"
|
|
@update:model-value="updateCopy(field, $event)"
|
|
@focus="select()"
|
|
@blur="unselect()"
|
|
></FormInput>
|
|
|
|
<template #error>
|
|
<span v-show="touched && !valid">
|
|
{{ error }}
|
|
</span>
|
|
</template>
|
|
</FormGroup>
|
|
</template>
|
|
|
|
<script>
|
|
import rowEditField from '@baserow/modules/database/mixins/rowEditField'
|
|
import rowEditFieldInput from '@baserow/modules/database/mixins/rowEditFieldInput'
|
|
import durationField from '@baserow/modules/database/mixins/durationField'
|
|
|
|
export default {
|
|
mixins: [rowEditField, rowEditFieldInput, durationField],
|
|
watch: {
|
|
'field.duration_format': {
|
|
handler() {
|
|
this.updateCopy(this.field, this.value)
|
|
this.updateFormattedValue(this.field, this.copy)
|
|
},
|
|
},
|
|
value: {
|
|
handler(newValue) {
|
|
this.updateCopy(this.field, newValue)
|
|
this.updateFormattedValue(this.field, this.copy)
|
|
},
|
|
},
|
|
},
|
|
}
|
|
</script>
|