CaMa: present diagnostic pathway and biopsy results
This commit is contained in:
@@ -8,9 +8,12 @@ import { Reading } from './measures';
|
||||
/** A card read one mode at a time: its title, its headline, the toggle and the bars. */
|
||||
@Component({
|
||||
selector: 'app-readings',
|
||||
host: { '[class.cama]': 'camaStyle()' },
|
||||
imports: [Loading, MatButtonToggleModule, Plot],
|
||||
template: `
|
||||
<h3 class="title">{{ title() }}</h3>
|
||||
@if (!hideTitle()) {
|
||||
<h3 class="title">{{ title() }}</h3>
|
||||
}
|
||||
@if (headline()) {
|
||||
<p class="headline">{{ headline() }}</p>
|
||||
}
|
||||
@@ -28,6 +31,9 @@ import { Reading } from './measures';
|
||||
}
|
||||
</mat-button-toggle-group>
|
||||
}
|
||||
@if (mode().heading) {
|
||||
<h4 class="heading">{{ mode().heading }}</h4>
|
||||
}
|
||||
@if (mode().caption) {
|
||||
<p class="state">{{ mode().caption }}</p>
|
||||
}
|
||||
@@ -50,16 +56,31 @@ import { Reading } from './measures';
|
||||
<tr>
|
||||
<th scope="row">
|
||||
{{ row.label }}
|
||||
<span class="track" aria-hidden="true">
|
||||
<span
|
||||
class="bar"
|
||||
[style.width.%]="row.width"
|
||||
[style.background]="row.color"
|
||||
></span>
|
||||
@for (m of row.marks; track $index) {
|
||||
<span class="mark" [style.left.%]="m"></span>
|
||||
}
|
||||
</span>
|
||||
@if (row.none) {
|
||||
<span class="none">{{ row.none }}</span>
|
||||
} @else {
|
||||
<span class="track" [class.parts]="!!row.segments" aria-hidden="true">
|
||||
@if (row.segments; as parts) {
|
||||
@for (p of parts; track $index) {
|
||||
<span
|
||||
class="bar"
|
||||
[style.width.%]="p.width"
|
||||
[style.background]="p.color"
|
||||
[attr.title]="p.title"
|
||||
></span>
|
||||
}
|
||||
} @else {
|
||||
<span
|
||||
class="bar"
|
||||
[style.width.%]="row.width"
|
||||
[style.background]="row.color"
|
||||
></span>
|
||||
}
|
||||
@for (m of row.marks; track $index) {
|
||||
<span class="mark" [style.left.%]="m"></span>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
</th>
|
||||
@for (c of row.cells; track $index) {
|
||||
<td>{{ c }}</td>
|
||||
@@ -68,6 +89,13 @@ import { Reading } from './measures';
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@if (t.legend; as legend) {
|
||||
<p class="legend">
|
||||
@for (l of legend; track l.label) {
|
||||
<span><i [style.background]="l.color"></i>{{ l.label }}</span>
|
||||
}
|
||||
</p>
|
||||
}
|
||||
} @else {
|
||||
<p class="state">Sin datos en el periodo.</p>
|
||||
}
|
||||
@@ -77,12 +105,32 @@ import { Reading } from './measures';
|
||||
display: block;
|
||||
min-width: 0;
|
||||
}
|
||||
:host(.cama) {
|
||||
overflow-x: auto;
|
||||
}
|
||||
.title {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
:host(.cama) .title {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.heading {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin: 12px 0 4px;
|
||||
}
|
||||
.headline {
|
||||
font-weight: 500;
|
||||
}
|
||||
:host(.cama) .headline {
|
||||
margin: 8px 0;
|
||||
}
|
||||
:host(.cama) .state {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 13px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
mat-button-toggle-group {
|
||||
flex-wrap: wrap;
|
||||
margin: 4px 0;
|
||||
@@ -91,6 +139,12 @@ import { Reading } from './measures';
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
:host(.cama) table {
|
||||
font-size: 13px;
|
||||
}
|
||||
:host(.cama) thead th {
|
||||
font-weight: 500;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
font-weight: 400;
|
||||
@@ -114,6 +168,28 @@ import { Reading } from './measures';
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
.parts {
|
||||
display: flex;
|
||||
}
|
||||
.none {
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.legend {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-size: 12px;
|
||||
gap: 4px 16px;
|
||||
margin: 8px 0 0;
|
||||
}
|
||||
.legend i {
|
||||
display: inline-block;
|
||||
height: 10px;
|
||||
margin-right: 6px;
|
||||
width: 10px;
|
||||
}
|
||||
.mark {
|
||||
background: #333;
|
||||
height: 12px;
|
||||
@@ -127,6 +203,9 @@ export class Readings {
|
||||
readonly title = input.required<string>();
|
||||
readonly headline = input('');
|
||||
readonly note = input('');
|
||||
/** the card around it names it already (tabs inside one card) */
|
||||
readonly hideTitle = input(false);
|
||||
readonly camaStyle = input(false);
|
||||
readonly modes = input.required<Mode[]>();
|
||||
readonly loading = input(false);
|
||||
/** A measure's reading in the applied period, and the figure of a mode that has one. */
|
||||
|
||||
Reference in New Issue
Block a user