mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com>
92 lines
1.9 KiB
Vue
92 lines
1.9 KiB
Vue
<template>
|
|
<form @submit.prevent="submit">
|
|
<FormGroup :error="fieldHasErrors('name')" required small-label>
|
|
<template #label>
|
|
<i class="iconoir-text"></i>
|
|
{{ $t('applicationForm.nameLabel') }}
|
|
</template>
|
|
|
|
<FormInput
|
|
ref="name"
|
|
v-model="v$.values.name.$model"
|
|
:error="fieldHasErrors('name')"
|
|
type="text"
|
|
size="large"
|
|
:placeholder="$t('applicationForm.namePlaceholder')"
|
|
@focus.once="$event.target.select()"
|
|
@blur="v$.values.name.$touch"
|
|
></FormInput>
|
|
|
|
<template #error>
|
|
{{ v$.values.name.$errors[0]?.$message }}
|
|
</template>
|
|
</FormGroup>
|
|
|
|
<div class="actions">
|
|
<div class="align-right">
|
|
<Button
|
|
type="primary"
|
|
size="large"
|
|
:loading="loading"
|
|
:disabled="loading"
|
|
>
|
|
{{ $t('action.add') }}
|
|
{{ $filters.lowercase(databaseApplicationType.getName()) }}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</template>
|
|
|
|
<script>
|
|
import { useVuelidate } from '@vuelidate/core'
|
|
import form from '@baserow/modules/core/mixins/form'
|
|
import { required, helpers } from '@vuelidate/validators'
|
|
|
|
export default {
|
|
name: 'BlankDatabaseForm',
|
|
mixins: [form],
|
|
props: {
|
|
defaultName: {
|
|
type: String,
|
|
required: false,
|
|
default: '',
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
required: true,
|
|
},
|
|
},
|
|
setup() {
|
|
return { v$: useVuelidate({ $lazy: true }) }
|
|
},
|
|
data() {
|
|
return {
|
|
values: {
|
|
name: this.defaultName,
|
|
},
|
|
}
|
|
},
|
|
computed: {
|
|
databaseApplicationType() {
|
|
return this.$registry.get('application', 'database')
|
|
},
|
|
},
|
|
mounted() {
|
|
this.$refs.name.focus()
|
|
},
|
|
validations() {
|
|
return {
|
|
values: {
|
|
name: {
|
|
required: helpers.withMessage(
|
|
this.$t('error.requiredField'),
|
|
required
|
|
),
|
|
},
|
|
},
|
|
}
|
|
},
|
|
}
|
|
</script>
|