From 860c66ba5c7700acb9dcaf336fc7b2ea0ba283e2 Mon Sep 17 00:00:00 2001 From: Angel Capetillo Zavala Date: Mon, 23 Nov 2026 18:23:35 -0600 Subject: [PATCH] =?UTF-8?q?Actualiza=20los=20filtros=20de=20las=20gr=C3=A1?= =?UTF-8?q?ficas=20CaCu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicador-confirmacion-citologia.html | 19 ++++++++++++------- .../indicador-confirmacion-citologia.scss | 13 +++++++++++++ .../indicadores/indicador-eu7-escenario.html | 19 ++++++++++++------- .../indicadores/indicador-eu7-escenario.scss | 1 + .../indicador-eu7-escenario.spec.ts | 6 +++--- .../indicadores/indicadores-cacu-botones.scss | 12 ++++++++++++ ...indicadores-confirmacion-citologia.spec.ts | 2 +- 7 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 src/app/features/indicadores/indicadores-cacu-botones.scss diff --git a/src/app/features/indicadores/indicador-confirmacion-citologia.html b/src/app/features/indicadores/indicador-confirmacion-citologia.html index a089cd1..a0b7330 100644 --- a/src/app/features/indicadores/indicador-confirmacion-citologia.html +++ b/src/app/features/indicadores/indicador-confirmacion-citologia.html @@ -33,15 +33,20 @@ @if (status() === 'empty') {

No hay citologías de alto grado publicadas para este periodo.

} @else {
- -
+
@for (g of m.grupos; track g.id; let i = $index) { - + } -
-
- @for (c of m.grados; track c.id; let i = $index) { - +
+
+ @for (g of m.grupos; track g.id) { +
+ @for (c of m.grados; track c.id; let i = $index) { + @if (c.grupo === g.id) { + + } + } +
}
diff --git a/src/app/features/indicadores/indicador-confirmacion-citologia.scss b/src/app/features/indicadores/indicador-confirmacion-citologia.scss index da1f1ba..61f9815 100644 --- a/src/app/features/indicadores/indicador-confirmacion-citologia.scss +++ b/src/app/features/indicadores/indicador-confirmacion-citologia.scss @@ -64,3 +64,16 @@ app-plotly-chart { --plot-height: 360px; } .figures { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } .histo .figure + .figure { border-top: 0; border-inline-start: 1px solid var(--issste-border); padding-top: 0; padding-inline-start: 1rem; } } + + +.confirmacion:not(.histo) .legend { display: flex; flex-direction: column; gap: 0; margin-block: .15rem 1rem; } +.confirmacion:not(.histo) .legend > button { align-self: flex-start; margin-bottom: .4rem; } +.confirmacion:not(.histo) .tab-bar { display: flex; align-items: flex-end; border-bottom: 1px solid var(--issste-border); } +.confirmacion:not(.histo) .tabs { display: flex; flex-wrap: wrap; gap: .2rem; min-width: 0; } +.confirmacion:not(.histo) .tabs .tab { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid transparent; border-bottom: 0; border-radius: .75rem .75rem 0 0; background: transparent; box-shadow: none; } +.confirmacion:not(.histo) .tabs .tab[aria-pressed=true] { background: color-mix(in srgb, var(--swatch) 18%, var(--issste-surface)); border-color: var(--issste-border); box-shadow: inset 0 -3px 0 var(--swatch); font-weight: 700; } +.confirmacion:not(.histo) .child-groups { display: flex; flex-wrap: wrap; align-items: center; column-gap: 2rem; row-gap: .45rem; padding: .65rem .1rem .1rem; } +.confirmacion:not(.histo) .tab-panel { display: flex; flex-wrap: wrap; gap: .45rem; } +.confirmacion:not(.histo) .tab-panel .child { display: inline-flex; align-items: center; gap: .45rem; border-radius: .75rem; border-color: color-mix(in srgb, var(--swatch) 55%, var(--issste-border)); background: var(--issste-surface); text-align: start; overflow-wrap: anywhere; } +.confirmacion:not(.histo) .tab-panel .child[aria-pressed=true] { background: color-mix(in srgb, var(--swatch) 16%, var(--issste-surface)); border-color: var(--swatch); box-shadow: inset 0 0 0 1px var(--swatch); } +.confirmacion:not(.histo) .tab .swatch, .confirmacion:not(.histo) .tab-panel .swatch { display: block; width: .35rem; height: 1em; margin: 0; border: 0; border-radius: .2rem; background: var(--swatch); align-self: center; } diff --git a/src/app/features/indicadores/indicador-eu7-escenario.html b/src/app/features/indicadores/indicador-eu7-escenario.html index 26db2f9..3452b60 100644 --- a/src/app/features/indicadores/indicador-eu7-escenario.html +++ b/src/app/features/indicadores/indicador-eu7-escenario.html @@ -33,15 +33,20 @@ @if (status() === 'empty') {

No hay pacientes publicados para este periodo.

} @else {
- -
+
@for (g of m.grupos; track g.id; let i = $index) { - + } -
-
- @for (c of m.categorias; track c.id; let i = $index) { - +
+
+ @for (g of m.grupos; track g.id) { +
+ @for (c of m.categorias; track c.id; let i = $index) { + @if (c.grupo === g.id) { + + } + } +
}
diff --git a/src/app/features/indicadores/indicador-eu7-escenario.scss b/src/app/features/indicadores/indicador-eu7-escenario.scss index d197919..9a784ff 100644 --- a/src/app/features/indicadores/indicador-eu7-escenario.scss +++ b/src/app/features/indicadores/indicador-eu7-escenario.scss @@ -1,3 +1,4 @@ +@use './indicadores-cacu-botones'; :host { display: block; min-width: 0; } .eu7 { min-width: 0; padding-top: var(--issste-space-3); } p, h3, summary { overflow-wrap: anywhere; } diff --git a/src/app/features/indicadores/indicador-eu7-escenario.spec.ts b/src/app/features/indicadores/indicador-eu7-escenario.spec.ts index 15387fb..7d31d96 100644 --- a/src/app/features/indicadores/indicador-eu7-escenario.spec.ts +++ b/src/app/features/indicadores/indicador-eu7-escenario.spec.ts @@ -67,15 +67,15 @@ describe('EU7 integración Angular y caché compartida', () => { f.detectChanges(); flush(); const button = (name: string) => Array.from(f.nativeElement.querySelectorAll('button') as NodeListOf) .find(item => item.textContent?.trim() === name)!; - const child = button('LIEAG'), parent = button('Anormal'), back = button('Volver'); + const child = button('LIEAG'), parent = button('Anormal'); expect(parent.getAttribute('aria-pressed')).toBe('false'); child.click(); f.detectChanges(); expect(f.componentInstance.selection).toEqual({ grupo: 'ANORMAL', categoria: 'LIEAG' }); expect(parent.getAttribute('aria-pressed')).toBe('true'); expect(child.getAttribute('aria-pressed')).toBe('true'); expect((f.componentInstance.donutFigure!.data[2]['values'] as number[])[0]).toBe(0); - back.click(); f.detectChanges(); expect(f.componentInstance.selection).toEqual({ grupo: 'ANORMAL' }); - back.click(); f.detectChanges(); expect(f.componentInstance.selection).toEqual({}); + child.click(); f.detectChanges(); expect(f.componentInstance.selection).toEqual({ grupo: 'ANORMAL' }); + parent.click(); f.detectChanges(); expect(f.componentInstance.selection).toEqual({}); http.expectNone(() => true); }); it('dos periodos en una petición por alcance; navegación coordinada limpia selección sin GET', () => { diff --git a/src/app/features/indicadores/indicadores-cacu-botones.scss b/src/app/features/indicadores/indicadores-cacu-botones.scss new file mode 100644 index 0000000..b5ea904 --- /dev/null +++ b/src/app/features/indicadores/indicadores-cacu-botones.scss @@ -0,0 +1,12 @@ + +.legend { display: flex; flex-direction: column; gap: 0; margin-block: .15rem 1rem; } +.legend > button { align-self: flex-start; margin-bottom: .4rem; } +.tab-bar { display: flex; align-items: flex-end; border-bottom: 1px solid var(--issste-border); } +.tabs { display: flex; flex-wrap: wrap; gap: .2rem; min-width: 0; } +.tabs .tab { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid transparent; border-bottom: 0; border-radius: .75rem .75rem 0 0; background: transparent; box-shadow: none; } +.tabs .tab[aria-pressed=true] { background: color-mix(in srgb, var(--swatch) 18%, var(--issste-surface)); border-color: var(--issste-border); box-shadow: inset 0 -3px 0 var(--swatch); font-weight: 700; } +.child-groups { display: flex; flex-wrap: wrap; align-items: center; column-gap: 2rem; row-gap: .45rem; padding: .65rem .1rem .1rem; } +.tab-panel { display: flex; flex-wrap: wrap; gap: .45rem; } +.tab-panel .child { display: inline-flex; align-items: center; gap: .45rem; border-radius: .75rem; border-color: color-mix(in srgb, var(--swatch) 55%, var(--issste-border)); background: var(--issste-surface); text-align: start; overflow-wrap: anywhere; } +.tab-panel .child[aria-pressed=true] { background: color-mix(in srgb, var(--swatch) 16%, var(--issste-surface)); border-color: var(--swatch); box-shadow: inset 0 0 0 1px var(--swatch); } +.tab .swatch, .tab-panel .swatch { display: block; width: .35rem; height: 1em; margin: 0; border: 0; border-radius: .2rem; background: var(--swatch); align-self: center; } \ No newline at end of file diff --git a/src/app/features/indicadores/indicadores-confirmacion-citologia.spec.ts b/src/app/features/indicadores/indicadores-confirmacion-citologia.spec.ts index 80b43a7..c609412 100644 --- a/src/app/features/indicadores/indicadores-confirmacion-citologia.spec.ts +++ b/src/app/features/indicadores/indicadores-confirmacion-citologia.spec.ts @@ -179,7 +179,7 @@ describe('Confirmación histopatológica: componente', () => { const figures = [...f.nativeElement.querySelectorAll('.figures > .figure')] as HTMLElement[]; expect(figures.map(s => s.classList.contains('rates') ? 'tasas' : 'dona')).toEqual(['tasas', 'dona']); const charts = f.debugElement.queryAll(By.directive(ChartStub)).map(c => c.componentInstance as ChartStub); - const normal = [...f.nativeElement.querySelectorAll('.keys button')].find((b: Element) => b.textContent!.trim() === 'NORMAL') as HTMLButtonElement; + const normal = [...f.nativeElement.querySelectorAll('.legend .child, .legend .tab')].find((b: Element) => b.textContent!.trim() === 'NORMAL') as HTMLButtonElement; normal.click(); f.detectChanges(); expect(f.componentInstance.selection).toEqual({ grupo: 'NO_ANORMAL', categoria: 'NORMAL' }); expect(normal.getAttribute('aria-pressed')).toBe('true');