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>
56 lines
1.3 KiB
Vue
56 lines
1.3 KiB
Vue
<template>
|
|
<ul class="formula-field__item-group">
|
|
<li class="formula-field__item-group-title">
|
|
{{ title }}
|
|
{{ getFilterIndicator(unfilteredItems, filteredItems) }}
|
|
</li>
|
|
<li
|
|
v-for="item in filteredItems"
|
|
:key="item.value"
|
|
class="formula-field__item"
|
|
>
|
|
<a
|
|
href="#"
|
|
class="formula-field__item-link"
|
|
@mouseover="$emit('hover-item', item)"
|
|
@mousedown.prevent
|
|
@click.stop="$emit('click-item', item)"
|
|
>
|
|
<i class="formula-field__item-icon" :class="[item.icon]" />
|
|
{{ showOperator && item.operator ? item.operator : item.value }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
name: 'FormulaFieldItemGroup',
|
|
props: {
|
|
title: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
unfilteredItems: {
|
|
type: Array,
|
|
required: true,
|
|
},
|
|
filteredItems: {
|
|
type: Array,
|
|
required: true,
|
|
},
|
|
showOperator: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
},
|
|
emits: ['click-item', 'hover-item'],
|
|
methods: {
|
|
getFilterIndicator(unfilteredList, filteredList) {
|
|
const numFiltered = unfilteredList.length - filteredList.length
|
|
return numFiltered === 0 ? '' : `(${numFiltered} filtered)`
|
|
},
|
|
},
|
|
}
|
|
</script>
|