Ajout lot dans catalogue
This commit is contained in:
@@ -43,7 +43,8 @@
|
||||
<ul class="liste-livres">
|
||||
@foreach (var sous in Entree.SousEntrees)
|
||||
{
|
||||
<GroupeCatalogue Entree="sous" Ouverts="Ouverts" Totaux="Totaux" />
|
||||
<GroupeCatalogue Entree="sous" Ouverts="Ouverts" Totaux="Totaux"
|
||||
LotActif="LotActif" SelectionLot="SelectionLot" OnSelectionner="OnSelectionner" />
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -53,9 +54,24 @@
|
||||
<ul class="liste-livres">
|
||||
@foreach (var livre in Entree.Livres)
|
||||
{
|
||||
<li @key="livre.Id">
|
||||
<CarteLivre Livre="livre" />
|
||||
</li>
|
||||
@if (LotActif)
|
||||
{
|
||||
<li class="carte-oeuvre" @key="livre.Id">
|
||||
<label class="oeuvre-case">
|
||||
<input type="checkbox"
|
||||
checked="@(SelectionLot?.Contains(livre.Id) ?? false)"
|
||||
@onchange="e => OnSelectionner.InvokeAsync((livre.Id, e.Value is true))" />
|
||||
<span class="lecture-ecran">Sélectionner « @livre.Titre »</span>
|
||||
</label>
|
||||
<CarteLivre Livre="livre" />
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li @key="livre.Id">
|
||||
<CarteLivre Livre="livre" />
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
@@ -85,6 +101,19 @@
|
||||
/// </remarks>
|
||||
[Parameter] public IReadOnlyDictionary<int, (int Possedes, int Total)>? Totaux { get; set; }
|
||||
|
||||
/// <summary>Modification en lot du catalogue : voir la remarque équivalente sur Catalogue.razor.</summary>
|
||||
[Parameter] public bool LotActif { get; set; }
|
||||
|
||||
[Parameter] public ISet<int>? SelectionLot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ⚠️ EventCallback, et non un Action brut : coché depuis un tome niché dans ce bloc, l'écran
|
||||
/// du catalogue (le VRAI propriétaire de la sélection) ne serait sinon jamais prévenu du
|
||||
/// changement, et sa barre de sélection resterait figée sur l'état d'avant — le second piège
|
||||
/// Blazor de CLAUDE.md.
|
||||
/// </summary>
|
||||
[Parameter] public EventCallback<(int LivreId, bool Coche)> OnSelectionner { get; set; }
|
||||
|
||||
private (int Possedes, int Total) Compte =>
|
||||
Totaux is not null && Totaux.TryGetValue(Entree.Serie!.Id, out var connu)
|
||||
? connu
|
||||
|
||||
Reference in New Issue
Block a user