2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/ui/components/Indicator.vue

61 lines
1.2 KiB
Vue
Raw Normal View History

2018-06-27 14:38:27 +00:00
<template>
<span :class="['indicator', 'indicator-' + color]"></span>
</template>
<script>
import indicatorColor from 'frappejs/ui/constants/indicators';
2018-06-27 14:38:27 +00:00
export default {
props: {
color: {
type: String,
required: true,
default: indicatorColor.GREY,
validator(value) {
const validColors = Object.values(indicatorColor);
const valid = validColors.includes(value);
if (!valid) {
console.warn(`color must be one of `, validColors);
}
return valid;
}
}
}
2018-06-27 14:38:27 +00:00
}
</script>
<style lang="scss">
@import "../styles/variables";
.indicator {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
}
.indicator-grey {
background-color: $gray-300;
}
2018-06-27 14:38:27 +00:00
.indicator-blue {
background-color: $blue;
}
.indicator-red {
background-color: $red;
}
.indicator-green {
background-color: $green;
}
.indicator-orange {
background-color: $orange;
}
.indicator-purple {
background-color: $purple;
}
.indicator-yellow {
background-color: $yellow;
}
.indicator-black {
background-color: $gray-800;
2018-06-27 14:38:27 +00:00
}
</style>