Files
webwindowconfigurator/WebWindowComplex/Compo/CardTree.razor
T
Annamaria Sassi a898ccced5 - Possibilità di nascondere figli multipli nella pagina con la gerarchia
- Gestione bottom rail del frame
2026-02-10 12:17:00 +01:00

90 lines
5.1 KiB
Plaintext

@using static WebWindowComplex.LayoutConst
<table class="table table-sm table-hover align-middle shadow">
<tbody>
@for (int i = 0; i < ItemTableList.Count; i++)
{
<tr>
@for (int j = 0; j < maxCol - 1; j++)
{
var index = RowCollapsedDict.Keys.Where(k => k <= i).LastOrDefault();
@if ((RowCollapsedDict.ContainsValue(true) && RowCollapsedDict.GetValueOrDefault(index))
&& i - 1 > 0 && ItemTableList.ElementAt(i).Col > ItemTableList.ElementAt(index-1).Col){
continue;
}
else
{
CompileStep cs = CompileStep.Frame;
int row = i;
int ind = -1;
string s = "Vai a step ";
@if (j + 1 == ItemTableList[i].Col)
{
@if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME)
{
cs = CompileStep.Frame;
s = s + cs.ToString();
}
else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT)
{
cs = CompileStep.Split;
ind = ItemTableList[i].IndexItem;
s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1): "");
}
else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH)
{
cs = CompileStep.Sash;
ind = ItemTableList[i].IndexItem;
s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : "");
}
else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL)
{
cs = CompileStep.Fill;
ind = ItemTableList[i].IndexItem;
s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : "");
}
<td>
<div class="d-flex flex-row align-items-center justify-content-center">
<div class="card text-center p-1 shadow-sm hover-shadow" >
<button class="btn btn-sm btn-rounded" @onclick="() => RaiseNextStep(cs, ind)" title="@(s)"
style="font-size: 1rem;">
@ItemTableList[i].Desc
</button>
</div>
@if (ItemTableList[row].NumChild > 4)
{
<div class="card border-light text-center">
<button class="btn btn-sm" @onclick="() => ChangeCollapsed(ItemTableList[row].Row)"
style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;">
<i class="@hwIcon(ItemTableList[i].Row)" style="width:0.5rem;"></i>
</button>
</div>
@* <button class="btn btn-xs btn-light btn-rounded" style="width:2rem;"
@onclick="() => changeCollapsed(ItemTableList[row].Row)">
<i class="@hwIcon(ItemTableList[i].Row)" style="width:0.5rem;"></i>
</button> *@
}
@* <div class="card text-center m-1 p-1 shadow-sm hover-shadow">
<button class="btn btn-sm btn-danger btn-rounded"
style="font-size: 1rem;">
<i class="bi bi-trash3-fill"></i>
</button>
</div> *@
</div>
@* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH ||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT)
{
<button class="btn btn-sm btn-secondary" style="font-size: 1rem;" @onclick="() => Remove(cs, ind)" title="Remove">Canc</button>
} *@
</td>
}
else
{
<td>@FillTable(i, j)</td>
}
}
}
</tr>
}
</tbody>
</table>