Show label colors when searching for labels

This commit is contained in:
kolaente 2021-01-14 22:06:22 +01:00
parent 6db151d57a
commit 526eee361f
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
3 changed files with 21 additions and 4 deletions

View file

@ -44,7 +44,9 @@
> >
<span> <span>
<slot name="searchResult" :option="query"> <slot name="searchResult" :option="query">
{{ query }} <span class="search-result">
{{ query }}
</span>
</slot> </slot>
</span> </span>
<span class="hint-text"> <span class="hint-text">
@ -63,7 +65,7 @@
> >
<span> <span>
<slot name="searchResult" :option="data"> <slot name="searchResult" :option="data">
{{ label !== '' ? data[label] : data }} <span class="search-result">{{ label !== '' ? data[label] : data }}</span>
</slot> </slot>
</span> </span>
<span class="hint-text"> <span class="hint-text">

View file

@ -20,6 +20,19 @@
<a @click="removeLabel(props.item)" class="delete is-small"></a> <a @click="removeLabel(props.item)" class="delete is-small"></a>
</span> </span>
</template> </template>
<template v-slot:searchResult="props">
<span
v-if="typeof props.option === 'string'"
class="tag ml-2">
<span>{{ props.option }}</span>
</span>
<span
v-else
:style="{'background': props.option.hexColor, 'color': props.option.textColor}"
class="tag ml-2">
<span>{{ props.option.title }}</span>
</span>
</template>
</multiselect> </multiselect>
</template> </template>

View file

@ -80,23 +80,25 @@
text-transform: none; text-transform: none;
font-family: $family-sans-serif; font-family: $family-sans-serif;
font-weight: normal; font-weight: normal;
padding: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
span:first-child { .search-result {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
padding: .5rem 1rem;
} }
.hint-text { .hint-text {
font-size: .75rem; font-size: .75rem;
color: transparent; color: transparent;
transition: color $transition; transition: color $transition;
padding-left: .5rem; padding: 0 .5rem;
} }
&:focus, &:hover { &:focus, &:hover {