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>
55 lines
1.3 KiB
Vue
55 lines
1.3 KiB
Vue
<template>
|
|
<div
|
|
v-tooltip="!compatible ? 'Field is incompatible with form view' : false"
|
|
class="form-view__sidebar-fields-item-wrapper"
|
|
>
|
|
<a
|
|
class="form-view__sidebar-fields-item"
|
|
:class="{
|
|
'form-view__sidebar-fields-item--disabled': readOnly,
|
|
'form-view__sidebar-fields-item--incompatible': !compatible,
|
|
}"
|
|
@click="
|
|
!readOnly &&
|
|
compatible &&
|
|
$emit('updated-field-options', { enabled: true })
|
|
"
|
|
>
|
|
<i
|
|
class="form-view__sidebar-fields-icon"
|
|
:class="field._.type.iconClass"
|
|
></i>
|
|
<div class="form-view__sidebar-fields-name">
|
|
{{ field.name }}
|
|
</div>
|
|
<i class="form-view__sidebar-fields-hover-arrow iconoir-arrow-right"></i>
|
|
</a>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'FormViewSidebarField',
|
|
props: {
|
|
field: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
readOnly: {
|
|
type: Boolean,
|
|
required: true,
|
|
},
|
|
},
|
|
emits: ['updated-field-options'],
|
|
computed: {
|
|
compatible() {
|
|
const fieldType = this.$registry.get('field', this.field.type)
|
|
return (
|
|
Object.keys(fieldType.getFormViewFieldComponents(this.field, this))
|
|
.length > 0 && !fieldType.isReadOnlyField(this.field)
|
|
)
|
|
},
|
|
},
|
|
}
|
|
</script>
|