// @ts-nocheck import { Component, Input, OnInit, ElementRef } from "@angular/core"; import { initKpiCards } from "mayvio-ui/scripts/components/kpi-card.js"; /** * KpiCardComponent * Angular wrapper component representing the Mayvio UI KPI Card. */ @Component({ selector: "mayvio-kpi-card", template: `
{{ title }} {{ icon }}
{{ prefix }}0{{ suffix }} {{ trendDirection === "up" ? "↑" : "↓" }} {{ trend }}
` }) export class KpiCardComponent implements OnInit { @Input() title = ""; @Input() value = 0; @Input() icon = ""; @Input() trend = ""; @Input() trendDirection: "up" | "down" = "up"; @Input() footer = ""; @Input() duration = 1500; @Input() decimals = 0; @Input() prefix = ""; @Input() suffix = ""; @Input() className = ""; constructor(private el: ElementRef) {} ngOnInit() { const valNode = this.el.nativeElement.querySelector(".kpi-card-value"); if (valNode) { initKpiCards(valNode); } } }