Show label colors when searching for labels
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2021-01-14 22:06:22 +01:00
parent 6db151d57a
commit 526eee361f
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 21 additions and 4 deletions

View File

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

View File

@ -20,6 +20,19 @@
<a @click="removeLabel(props.item)" class="delete is-small"></a>
</span>
</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>
</template>

View File

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