Files
baserow/web-frontend/modules/integrations/localBaserow/components/services/FieldMappingContext.vue
716d43a9a8 Nuxt 3 migration (#4342)
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>
2026-01-22 10:27:19 +01:00

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>