fix(indicadores): opportunity cards fill the height of their grid row

How: the grid rows were already equal (grid-auto-rows: 1fr), but the card kept
its content height inside the stretched panel: mat-card's height: 100% had no
definite parent height to resolve against. The KPI panel and the KPI card host
are now flex columns, and the card and mat-card grow (flex: 1 1 auto) to fill
them, so every card is as tall as its row.

Implications: applies to every domain's cards. A panel showing "Reintentar
consulta" keeps the button under its card, and the card takes the remaining
height.
This commit is contained in:
rockdrigo
2026-11-09 19:30:25 -06:00
parent 987bce0d93
commit 739bf9613c
2 changed files with 4 additions and 3 deletions
@@ -34,8 +34,8 @@ import { KpiIntervalo } from './indicadores-kpi';
</mat-card>
`,
styles: `
:host { display: block; min-width: 0; }
mat-card { box-sizing: border-box; height: 100%; padding: var(--issste-space-6);
:host { display: flex; flex-direction: column; min-width: 0; }
mat-card { box-sizing: border-box; flex: 1 1 auto; padding: var(--issste-space-6);
background: var(--issste-surface); color: var(--issste-text); border: 1px solid var(--issste-border);
border-radius: var(--issste-radius); box-shadow: none; }
h3 { margin: 0; font-family: var(--issste-font-heading); font-size: 1rem; font-weight: 500; line-height: 1.3; }
@@ -23,7 +23,8 @@ interface KpiDisplay extends KpiResult { period?: string; earlier?: boolean; ver
@if (result().state === 'Error de consulta') {
<button type="button" mat-stroked-button (click)="retry()" [attr.aria-label]="'Reintentar ' + definition.title">Reintentar consulta</button>
}`,
styles: ':host { display: block; min-width: 0; }',
// The card fills the panel, so cards in one grid row are as tall as the row.
styles: ':host { display: flex; flex-direction: column; min-width: 0; } app-indicador-kpi-card { flex: 1 1 auto; }',
})
export class IndicadorKpiPanel implements OnChanges {
@Input({ required: true }) dominio!: Dominio;