mirror of
https://github.com/frappe/books.git
synced 2024-12-26 20:30:25 +00:00
5375f21d30
- Replace hardcoded color values with constants - Add remaining color styles in Indicator component - Show Indicator in List View
61 lines
1.2 KiB
Vue
61 lines
1.2 KiB
Vue
<template>
|
|
<span :class="['indicator', 'indicator-' + color]"></span>
|
|
</template>
|
|
<script>
|
|
import indicatorColor from 'frappejs/ui/constants/indicators';
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</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;
|
|
}
|
|
.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;
|
|
}
|
|
</style>
|