Files
nocodb/packages/nc-gui/components/project/appStore/FormInput.vue
WK WONG c6d81498f5 enhancement(ui): add checkbox field to app store input (#959)
* init: checkboxField.vue

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* enhancement(gui): use <checkbox-field/> for Checkbox type

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>

* fix: use to boolean instead of string

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
2022-01-19 20:22:01 +05:30

54 lines
1.4 KiB
Vue

<template>
<text-area-cell
v-if="inputDetails.type === 'LongText'"
v-model="localState"
:input-details="inputDetails"
/>
<password-field
v-else-if="inputDetails.type === 'Password'"
v-model="localState"
:input-details="inputDetails"
/>
<attachment
v-else-if="inputDetails.type === 'Attachment'"
v-model="localState"
:input-details="inputDetails"
/>
<checkbox-field
v-else-if="inputDetails.type === 'Checkbox'"
v-model="localState"
:input-details="inputDetails"
/>
<text-field v-else v-model="localState" :input-details="inputDetails" />
</template>
<script>
import TextField from '@/components/project/appStore/inputs/textField'
import Attachment from '@/components/project/appStore/inputs/attachment'
import PasswordField from '@/components/project/appStore/inputs/passwordField'
import TextAreaCell from '@/components/project/spreadsheet/components/editableCell/textAreaCell'
import CheckboxField from '@/components/project/appStore/inputs/checkboxField'
export default {
name: 'FormInput',
components: { PasswordField, TextAreaCell, Attachment, TextField, CheckboxField },
props: {
value: String,
inputDetails: Object
},
computed: {
localState: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
}
}
}
}
</script>
<style scoped>
</style>