Files
LoreMind/web/src/app/campaigns/random-table/random-table-view/random-table-view.component.html
IETM_FIXE\ietm6 23878f1c63 Migration Angular 20 -> 21 : fin de la migration securite (0 vulnerabilite npm)
- ng update @angular/core@21 @angular/cli@21 (corrige GHSA-jrmj-c5cx-3cw6, XSS SVG)
- Migration automatique des templates vers le control flow natif (@if/@for, 138 fichiers)
- Correction des 5 `track` invalides generes par la migration (trackBy a 1 argument
  -> track $index) + suppression des fonctions trackBy mortes
- TypeScript 5.9, zone.js 0.15 ; npm audit : 0 vulnerabilite

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 14:55:36 +02:00

76 lines
2.4 KiB
HTML

@if (table) {
<div class="rt-page">
<div class="rt-toolbar">
<button class="btn-back" (click)="back()">
<lucide-icon [img]="ArrowLeft" [size]="14"></lucide-icon>
Retour
</button>
<span class="spacer"></span>
<button class="btn-edit" (click)="edit()">
<lucide-icon [img]="Edit3" [size]="14"></lucide-icon>
Éditer
</button>
</div>
<header class="rt-header">
<h1><lucide-icon [img]="Dices" [size]="22"></lucide-icon> {{ table.name }}</h1>
@if (table.description) {
<p class="rt-desc">{{ table.description }}</p>
}
<span class="rt-formula">Dé : <code>{{ table.diceFormula }}</code></span>
</header>
<!-- Zone de jet -->
<section class="rt-roll">
<button class="btn-roll" (click)="roll()">
<lucide-icon [img]="Dices" [size]="18"></lucide-icon>
Lancer {{ table.diceFormula }}
</button>
@if (lastRoll) {
<div class="rt-result">
<span class="rt-total">{{ lastRoll.total }}</span>
@if (lastRoll.rolls.length > 1) {
<span class="rt-rolls">({{ lastRoll.rolls.join(' + ') }})</span>
}
<span class="rt-arrow"></span>
@if (matched) {
<span class="rt-matched">{{ matched.label }}</span>
}
@if (!matched) {
<span class="rt-nomatch">Aucune entrée pour ce résultat</span>
}
</div>
}
</section>
@if (matched?.detail) {
<div class="rt-detail">{{ matched?.detail }}</div>
}
<!-- Liste des entrées -->
<section class="rt-entries">
@if (table.entries.length === 0) {
<div class="rt-empty">
Aucune entrée — édite la table pour en ajouter.
</div>
}
@if (table.entries.length > 0) {
<table>
<thead>
<tr><th class="col-range">Jet</th><th>Résultat</th></tr>
</thead>
<tbody>
@for (e of table.entries; track e) {
<tr [class.matched]="isMatched(e)">
<td class="col-range">{{ rangeLabel(e) }}</td>
<td>
<div class="entry-label">{{ e.label }}</div>
@if (e.detail) {
<div class="entry-detail">{{ e.detail }}</div>
}
</td>
</tr>
}
</tbody>
</table>
}
</section>
</div>
}