| |
| |
| |
| |
| |
| |
| |
| <template> |
| <div class="metricValue"> |
| <div |
| class="metricValue__title" |
| :class="{ 'metricValue__title--documented': !!documentation }" |
| :title="documentation || title" |
| v-tooltips="{ duration: 200, delay: 200 }" |
| >{{ title }}</div> |
| <div class="metricValue__primary"> |
| <span class="metricValue__number">{{ value }}</span> |
| <slot name="evolution" /> |
| </div> |
| <div |
| v-if="hasSecondary" |
| class="metricValue__secondary" |
| > |
| <span class="metricValue__secondaryValue">{{ secondaryValue }}</span> |
| <span |
| v-if="secondaryLabel" |
| class="metricValue__secondaryLabel" |
| >{{ secondaryLabel }}</span> |
| </div> |
| </div> |
| </template> |
| |
| <script lang="ts"> |
| import { defineComponent } from 'vue'; |
| import { Tooltips } from 'CoreHome'; |
| |
| export default defineComponent({ |
| name: 'MetricValue', |
| directives: { |
| Tooltips, |
| }, |
| props: { |
| title: { |
| type: String, |
| required: true, |
| }, |
| |
| value: { |
| type: [String, Number], |
| required: true, |
| }, |
| |
| |
| |
| secondaryValue: [String, Number], |
| secondaryLabel: String, |
| |
| |
| documentation: String, |
| }, |
| computed: { |
| hasSecondary(): boolean { |
| return this.secondaryValue !== undefined |
| && this.secondaryValue !== null |
| && this.secondaryValue !== ''; |
| }, |
| }, |
| }); |
| </script> |
| |