c32d2b6012
CaCu and TEA use the same menu labels and compact summary layout as cáncer de mama. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import { Component, Input, output } from '@angular/core';
|
|
import { MatButtonModule } from '@angular/material/button';
|
|
import { Dominio, Indicador, TipoPeriodo } from './indicadores.models';
|
|
import { figureDisplayName } from './indicadores-figure-labels';
|
|
import { PERIOD_INTERPRETATION } from './indicadores-methodology';
|
|
import { IndicadorMetadata } from './indicador-metadata';
|
|
|
|
@Component({
|
|
selector: 'app-indicadores-definitions',
|
|
imports: [MatButtonModule, IndicadorMetadata],
|
|
templateUrl: './indicadores-definitions.html',
|
|
styleUrl: './indicadores-definitions.scss',
|
|
})
|
|
export class IndicadoresDefinitions {
|
|
readonly opened = new Set<string>();
|
|
open(id: string, event: Event) { if ((event.target as HTMLDetailsElement).open) this.opened.add(this.dominio + ':' + id); }
|
|
@Input({ required: true }) dominio!: Dominio;
|
|
@Input({ required: true }) catalog: readonly Indicador[] = [];
|
|
@Input() loading = false;
|
|
@Input() error = '';
|
|
readonly retry = output<void>();
|
|
readonly domainNames: Record<Dominio, string> = {
|
|
tea: 'trastorno del espectro autista', cacu: 'cáncer cervicouterino', cama: 'cáncer de mama',
|
|
};
|
|
readonly periodNames: Record<TipoPeriodo, string> = { semestre: 'Semestral', mes: 'Mensual' };
|
|
readonly figureDisplayName = figureDisplayName;
|
|
readonly periodInterpretation = PERIOD_INTERPRETATION;
|
|
get periodTypes() { return [...new Set(this.catalog.flatMap(item => item.tipos_periodo))]; }
|
|
}
|