2018-06-27 14:38:27 +00:00
|
|
|
<template>
|
|
|
|
<span :class="['indicator', 'indicator-' + color]"></span>
|
|
|
|
</template>
|
|
|
|
<script>
|
2018-07-09 14:55:24 +00:00
|
|
|
import indicatorColor from 'frappejs/ui/constants/indicators';
|
|
|
|
|
2018-06-27 14:38:27 +00:00
|
|
|
export default {
|
2018-07-09 14:55:24 +00:00
|
|
|
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%;
|
|
|
|
}
|
|
|
|
|
2018-07-09 14:55:24 +00:00
|
|
|
.indicator-grey {
|
|
|
|
background-color: $gray-300;
|
|
|
|
}
|
2018-06-27 14:38:27 +00:00
|
|
|
.indicator-blue {
|
2018-07-09 14:55:24 +00:00
|
|
|
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>
|