1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-22 15:52:34 +00:00
bramw_baserow/web-frontend/modules/integrations/localBaserow/components/services/FieldMapping.vue
2024-10-17 15:49:51 +00:00

60 lines
1.3 KiB
Vue

<template>
<FormGroup required class="margin-bottom-2">
<InjectedFormulaInput
v-model="fieldValue"
:disabled="!fieldMapping.enabled"
v-bind="$attrs"
/>
<template #after-input>
<div ref="editFieldMappingOpener">
<ButtonIcon
type="secondary"
icon="iconoir-more-vert"
@click="openContext"
/>
</div>
<FieldMappingContext
ref="fieldMappingContext"
:field-mapping="fieldMapping"
@edit="$emit('change', $event)"
/>
</template>
</FormGroup>
</template>
<script>
import InjectedFormulaInput from '@baserow/modules/core/components/formula/InjectedFormulaInput'
import FieldMappingContext from '@baserow/modules/integrations/localBaserow/components/services/FieldMappingContext'
export default {
name: 'FieldMapping',
components: { FieldMappingContext, InjectedFormulaInput },
props: {
fieldMapping: {
type: Object,
required: true,
},
},
computed: {
fieldValue: {
get() {
return this.fieldMapping.value
},
set(value) {
this.$emit('change', { value })
},
},
},
methods: {
openContext() {
this.$refs.fieldMappingContext.toggle(
this.$refs.editFieldMappingOpener,
'bottom',
'left',
4
)
},
},
}
</script>