mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +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>
52 lines
1.2 KiB
Vue
52 lines
1.2 KiB
Vue
<template>
|
|
<Context
|
|
ref="context"
|
|
:overflow-scroll="true"
|
|
:max-height-if-outside-viewport="true"
|
|
>
|
|
<ul class="context__menu">
|
|
<li class="context__menu-item">
|
|
<a class="context__menu-item-link" @click.prevent="handleEditClick()">
|
|
<i class="context__menu-item-icon" :class="enabledClass"></i>
|
|
{{ toggleEnabledText }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</Context>
|
|
</template>
|
|
|
|
<script>
|
|
import context from '@baserow/modules/core/mixins/context'
|
|
|
|
export default {
|
|
name: 'FieldMappingContext',
|
|
mixins: [context],
|
|
props: {
|
|
fieldMapping: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
},
|
|
emits: ['edit'],
|
|
computed: {
|
|
enabledClass() {
|
|
return this.fieldMapping.enabled ? 'iconoir-eye-off' : 'iconoir-eye-empty'
|
|
},
|
|
toggleEnabledText() {
|
|
return this.fieldMapping.enabled
|
|
? this.$t('fieldMappingContext.disableField')
|
|
: this.$t('fieldMappingContext.enableField')
|
|
},
|
|
},
|
|
methods: {
|
|
handleEditClick() {
|
|
this.$emit(
|
|
'edit',
|
|
this.fieldMapping.enabled ? undefined : { enabled: true, formula: '' }
|
|
)
|
|
this.hide()
|
|
},
|
|
},
|
|
}
|
|
</script>
|