mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
* chore(deps): update Iconoir to 7.12.2 * test: update grid visibility selector for Iconoir 7 * fix: restore open and slashed eye icons * docs: document Iconoir 7 plugin changes
54 lines
1.2 KiB
Vue
54 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
|
|
? 'baserow-icon-eye-off'
|
|
: 'baserow-icon-eye'
|
|
},
|
|
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>
|