2021-05-06 14:31:26 +00:00
|
|
|
<template>
|
|
|
|
<woot-dropdown-item>
|
|
|
|
<div class="item-wrap">
|
|
|
|
<woot-button variant="clear" @click="onClick">
|
|
|
|
<div class="button-wrap">
|
|
|
|
<div class="name-label-wrap">
|
|
|
|
<div
|
|
|
|
v-if="color"
|
|
|
|
class="label-color--display"
|
|
|
|
:style="{ backgroundColor: color }"
|
|
|
|
/>
|
2021-06-14 05:06:00 +00:00
|
|
|
<span class="label-text" :title="title">{{ title }}</span>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<i v-if="selected" class="icon ion-checkmark-round" />
|
2021-05-06 14:31:26 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</woot-button>
|
|
|
|
</div>
|
|
|
|
</woot-dropdown-item>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
color: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
selected: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onClick() {
|
|
|
|
this.$emit('click', this.title);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.item-wrap {
|
|
|
|
display: flex;
|
|
|
|
|
2021-06-14 05:06:00 +00:00
|
|
|
::v-deep .button__content {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2021-05-06 14:31:26 +00:00
|
|
|
.button-wrap {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
2021-06-14 05:06:00 +00:00
|
|
|
width: 100%;
|
2021-05-06 14:31:26 +00:00
|
|
|
|
|
|
|
&.active {
|
|
|
|
display: flex;
|
|
|
|
font-weight: var(--font-weight-bold);
|
|
|
|
color: var(--w-700);
|
|
|
|
}
|
|
|
|
|
|
|
|
.name-label-wrap {
|
|
|
|
display: flex;
|
2021-06-14 05:06:00 +00:00
|
|
|
min-width: 0;
|
|
|
|
width: 100%;
|
2021-05-06 14:31:26 +00:00
|
|
|
|
2021-06-14 05:06:00 +00:00
|
|
|
.label-color--display {
|
|
|
|
margin-right: var(--space-small);
|
|
|
|
}
|
|
|
|
|
|
|
|
.label-text {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
line-height: 1.1;
|
|
|
|
padding-right: var(--space-small);
|
|
|
|
}
|
2021-05-06 14:31:26 +00:00
|
|
|
|
2021-06-14 05:06:00 +00:00
|
|
|
.icon {
|
|
|
|
font-size: var(--font-size-small);
|
|
|
|
}
|
2021-05-06 14:31:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.label-color--display {
|
|
|
|
border-radius: var(--border-radius-normal);
|
|
|
|
height: var(--space-slab);
|
|
|
|
margin-right: var(--space-smaller);
|
|
|
|
margin-top: var(--space-micro);
|
|
|
|
min-width: var(--space-slab);
|
|
|
|
width: var(--space-slab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|