feat(indicadores): implementar catalogo expandible UX-05B
This commit is contained in:
@@ -37,14 +37,16 @@ export function pending(state: FilterState): boolean {
|
||||
}
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class IndicadoresMemory {
|
||||
private readonly domains = new Map<Dominio, { indicador: string; tema: Tema }>();
|
||||
private readonly figures = new Map<string, string>();
|
||||
private readonly themes = new Map<Dominio, Tema>();
|
||||
private readonly expansions = new Map<string, boolean>();
|
||||
private readonly filters = new Map<string, FilterState>();
|
||||
navigation(domain: Dominio) { return this.domains.get(domain); }
|
||||
selectedFigure(domain: Dominio, indicador: string) { return this.figures.get(JSON.stringify([domain, indicador])); }
|
||||
remember(domain: Dominio, indicador: string, figura: string, tema: Tema) {
|
||||
this.domains.set(domain, { indicador, tema });
|
||||
this.figures.set(JSON.stringify([domain, indicador]), figura);
|
||||
theme(domain: Dominio): Tema { return this.themes.get(domain) ?? 'claro'; }
|
||||
rememberTheme(domain: Dominio, tema: Tema) { this.themes.set(domain, tema); }
|
||||
expanded(domain: Dominio, indicador: string): boolean | undefined {
|
||||
return this.expansions.get(JSON.stringify([domain, indicador]));
|
||||
}
|
||||
rememberExpansion(domain: Dominio, indicador: string, expanded: boolean) {
|
||||
this.expansions.set(JSON.stringify([domain, indicador]), expanded);
|
||||
}
|
||||
private key(domain: Dominio, indicador: string, figura: string) {
|
||||
return JSON.stringify([domain, indicador, figura]);
|
||||
|
||||
Reference in New Issue
Block a user