Files
webwindowconfigurator/WebWindowComplex/Compo/AreaSash.razor
T
Annamaria Sassi 809ff5a237 Aggiornamento
2026-08-13 14:48:23 +02:00

392 lines
22 KiB
Plaintext

@using EgwCoreLib.Razor
<div class="col-lg-12 col-md-12">
@if (!SashDimEditList.Contains(IndexSash))
{
<div class="d-flex justify-content-start align-items-center">
<div class="col-md-12 col-lg-8 px-0 d-grid justify-content-start">
<h6 class="fw-bold text-nowrap">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
</div>
<div class="col-md-12 col-lg-3 px-0">
@if(!BaseUser && CurrSashGroup.SashList.Count > 1)
{
<div class="dropdown px-4 w-100">
<button class="btn btn-outline-secondary dropdown-toggle btn-sm w-100"
type="button"
@onclick="ToggleDropdown"
aria-expanded="@isOpen">
Copy content
</button>
<ul class="dropdown-menu w-100 @(isOpen ? "show" : "")"
style="min-width:0rem; max-width:10rem">
@for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++)
{
@if (k != IndexSash)
{
int IndexCopy = k;
int IndexModify = IndexSash;
<li>
<button class="dropdown-item" @onclick="() => CopyContentSash(IndexCopy, IndexModify)">
Sash @(k + 1)
</button>
</li>
}
}
</ul>
</div>
}
</div>
<div class="col-md-12 col-lg-1 px-0 align-items-center">
<button class="btn btn-outline-secondary btn-sm" type="button" @onclick="() => doEdit(IndexSash)">
<i class="fa-solid fa-pen"></i>
</button>
</div>
</div>
<div class="row align-items-center justify-content-start">
<div class="col-lg-2 col-md-12 my-2">
<div class="input-group mb-2">
@if (BaseUser)
{
<button class="btn btn-outline-secondary d-flex align-items-center gap-2"
type="button"
style="background-color: @(isOpenDropdown ? "#f8f9fa" : "#ffffff"); color: @(isOpenDropdown ? "#333333" : "");" >
<span class="d-flex align-items-center">
<img class="img-fluid" src="@GetImageOpeningPath(CurrOpening)" title="@(CurrOpening)" width="50" />
</span>
</button>
}
else
{
<div class="dropdown" @onfocusout="HandleFocusOut" tabindex="0">
<button class="btn btn-outline-secondary dropdown-toggle d-flex align-items-center gap-2"
type="button"
style="background-color: @(isOpenDropdown ? "#f8f9fa" : "#ffffff"); color: @(isOpenDropdown ? "#333333" : "");"
@onclick="ToggleDropdownOpening"
aria-expanded="@isOpenDropdown">
<span class="d-flex align-items-center">
<img class="img-fluid" src="@GetImageOpeningPath(CurrOpening)" title="@(CurrOpening)" width="50" />
</span>
</button>
<ul class="dropdown-menu p-2 @(isOpenDropdown ? "show" : "")"
style="position: absolute; min-width: 20em;">
<div class="row g-2 row-cols-4 m-0">
@foreach (var openingType in CurrSashDim.OpeningTypeList)
{
<div class="col p-0">
<button type="button"
class="dropdown-item d-flex flex-column align-items-center justify-content-center p-2 rounded text-center h-100 @ButtonOpeningCss(openingType.Id)"
style="background-color: @(OpeningTypeIndex == openingType.Id ? "#d4e6fa" : "#f8f9fa");"
@onclick="() => SelOpeningSash(openingType.Id, openingType.Name)">
<img class="img-fluid" src="@GetImageOpeningPath(openingType.Name)"
title="@(openingType.Name)" width="100" />
</button>
</div>
}
</div>
</ul>
</div>
}
</div>
</div>
<div class="col-lg-5 col-md-12 my-2">
<div class="input-group mb-2">
<span class="input-group-text">Dimension</span>
@if(BaseUser)
{
<input type="number" readonly class="form-control" value="@Dimension">
@switch (CurrSashDim.SelMeasureType.ToString())
{
case "ABSOLUTE":
{
<span class="input-group-text" style="width:6rem; background-color:#e9ecef">mm</span>
break;
}
case "PROPORTIONAL":
{
<span class="input-group-text" style="width:6rem; background-color:#e9ecef">*</span>
break;
}
case "PERCENTAGE":
{
<span class="input-group-text" style="width:6rem; background-color:#e9ecef">%</span>
break;
}
}
}
else
{
<input type="number" class="form-control" @bind="@Dimension">
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@MeasureTypeIndex">
@foreach (var mType in CurrSashDim.MeasureTypeList)
{
<option value=@(mType.Id)>
@switch (mType.Name)
{
case "Absolute":
{
<span class="input-group-text">mm</span>
break;
}
case "Proportional":
{
<span class="input-group-text">*</span>
break;
}
case "Percentage":
{
<span class="input-group-text">%</span>
break;
}
}
</option>
}
</select>
}
</div>
</div>
<div class="col-lg-2 col-md-12 my-2">
<div class="d-flex justify-content-start fs-5 mb-2">
@if (BaseUser)
{
<div class="px-1">
<input class="form-check-input ml-auto" disabled="disabled" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle">
</div>
}
else
{
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => ChangeHandle()">
</div>
}
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
</div>
</div>
}
else
{
<div class="d-flex justify-content-start align-items-center mb-2">
<div class="col-md-12 col-lg-7 d-grid px-0 justify-content-md-start">
<h6 class="fw-bold text-nowrap">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
</div>
<div class="col-md-12 col-lg-2 px-0">
@if (!BaseUser && !(CurrAnta.AreaList[0] is Split))
{
<div class="col-md-4">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddSplitToSash()">Split</button>
</div>
}
</div>
<div class="col-md-12 col-lg-2 px-0">
@if (!BaseUser && CurrAnta.AreaList[0].AreaList.Count == 0)
{
<div class="col-md-4 px-2">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddInglesinaToSash()">Inglesina</button>
</div>
}
</div>
<div class="col-md-12 col-lg-1 px-0">
<button type="button" class="btn-close" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
</div>
</div>
<div class="row align-items-center justify-content-start">
<div class="col-lg-2 col-md-12 my-2">
<div class="input-group mb-2">
@if (BaseUser)
{
<button class="btn btn-outline-secondary d-flex align-items-center gap-2"
type="button"
style="background-color: @(isOpenDropdown ? "#f8f9fa" : "#ffffff"); color: @(isOpenDropdown ? "#333333" : "");">
<span class="d-flex align-items-center">
<img class="img-fluid" src="@GetImageOpeningPath(CurrOpening)" title="@(CurrOpening)" width="50" />
</span>
</button>
}
else
{
<div class="dropdown" @onfocusout="HandleFocusOut" tabindex="0">
<button class="btn btn-outline-secondary dropdown-toggle d-flex align-items-center gap-2"
type="button"
@onclick="ToggleDropdownOpening"
aria-expanded="@isOpenDropdown">
<span class="d-flex align-items-center">
<img class="img-fluid" src="@GetImageOpeningPath(CurrOpening)" title="@(CurrOpening)" width="50" />
</span>
</button>
<ul class="dropdown-menu p-2 @(isOpenDropdown ? "show" : "")"
style="position: absolute; min-width: 20em;">
<div class="row g-2 row-cols-4 m-0">
@foreach (var openingType in CurrSashDim.OpeningTypeList)
{
<div class="col p-0">
<button type="button"
class="dropdown-item d-flex flex-column align-items-center justify-content-center p-2 rounded text-center h-100 @ButtonOpeningCss(openingType.Id)"
@onclick="() => SelOpeningSash(openingType.Id, openingType.Name)">
<img class="img-fluid" src="@GetImageOpeningPath(openingType.Name)"
title="@(openingType.Name)" width="100" />
</button>
</div>
}
</div>
</ul>
</div>
}
</div>
</div>
<div class="col-lg-5 col-md-12 my-2">
<div class="input-group mb-2">
<span class="input-group-text">Dimension</span>
@if(BaseUser)
{
<input type="number" readonly class="form-control" value="@Dimension">
@switch (CurrSashDim.SelMeasureType.ToString())
{
case "ABSOLUTE":
{
<span class="input-group-text" style="width:6rem; background-color:#e9ecef">mm</span>
break;
}
case "PROPORTIONAL":
{
<span class="input-group-text" style="width:6rem; background-color:#e9ecef">*</span>
break;
}
case "PERCENTAGE":
{
<span class="input-group-text" style="width:6rem; background-color:#e9ecef">%</span>
break;
}
}
}
else
{
<input type="number" class="form-control" @bind="@Dimension">
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@MeasureTypeIndex">
@foreach (var mType in CurrSashDim.MeasureTypeList)
{
<option value=@(mType.Id)>
@switch (mType.Name)
{
case "Absolute":
{
<span class="input-group-text">mm</span>
break;
}
case "Proportional":
{
<span class="input-group-text">*</span>
break;
}
case "Percentage":
{
<span class="input-group-text">%</span>
break;
}
}
</option>
}
</select>
}
</div>
</div>
<div class="col-lg-2 col-md-12 my-2">
<div class="d-flex justify-content-start fs-5 mb-2">
@if(BaseUser)
{
<div class="px-1">
<input class="form-check-input ml-auto" disabled="disabled" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle">
</div>
}
else
{
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => ChangeHandle()">
</div>
}
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-12">
<div class="row justify-content-between align-items-center pb-2" style="min-height: 2.5rem;">
<div class="col-md-4 d-flex justify-content-start align-items-center">
<h6>Joints</h6>
</div>
@if (BaseUser)
{
<div class="col-md-8 d-flex justify-content-end align-items-center">
<button type="button" class="btn-icone @ButtonJointCss(Json.WindowConst.Joints.ANGLED) mx-1 px-1 py-1">
<img class="img-fluid" src="@GetImageJointShapePath("Angled")" title="Angled" width="40" />
</button>
<button type="button" class="btn-icone @ButtonJointCss(Json.WindowConst.Joints.FULL_H) mx-1 px-1 py-1">
<img class="img-fluid" src="@GetImageJointShapePath("Full H")" title="Angled" width="40" />
</button>
<button type="button" class="btn-icone @ButtonJointCss(Json.WindowConst.Joints.FULL_V) mx-1 px-1 py-1">
<img class="img-fluid" src="@GetImageJointShapePath("Full V")" title="Angled" width="40" />
</button>
</div>
}
else
{
<div class="col-md-8 d-flex justify-content-end align-items-center">
<button type="button" class="btn-icone @ButtonJointCss(Json.WindowConst.Joints.ANGLED) mx-1 px-1 py-1" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED)">
<img class="img-fluid" src="@GetImageJointShapePath("Angled")" title="Angled" width="40" />
</button>
<button type="button" class="btn-icone @ButtonJointCss(Json.WindowConst.Joints.FULL_H) mx-1 px-1 py-1" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H)">
<img class="img-fluid" src="@GetImageJointShapePath("Full H")" title="Angled" width="40" />
</button>
<button type="button" class="btn-icone @ButtonJointCss(Json.WindowConst.Joints.FULL_V) mx-1 px-1 py-1" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">
<img class="img-fluid" src="@GetImageJointShapePath("Full V")" title="Angled" width="40" />
</button>
</div>
}
</div>
<div class="row g-3">
@* Joint top left e joint top right *@
@for (int i = CurrSashDim.JointList.Count - 1; i >= 2; i--)
{
<div class="col-6">
<EditJoint CurrRec="CurrSashDim.JointList.ElementAt(i)" EC_Update="UpdateJoint"></EditJoint>
</div>
}
@* Joint bottom left e joint bottom right *@
<div class="col-6">
<EditJoint CurrRec="CurrSashDim.JointList.ElementAt(0)" EC_Update="UpdateJoint"></EditJoint>
</div>
<div class="col-6">
<EditJoint CurrRec="CurrSashDim.JointList.ElementAt(1)" EC_Update="UpdateJoint"></EditJoint>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12">
<div class="row justify-content-between align-items-center mb-4" style="min-height: 2.5rem;">
<div class="col d-flex justify-content-start align-items-center">
<h6>Element</h6>
</div>
</div>
<div class="row g-3">
@foreach (var element in CurrSashDim.ElementDimensionList)
{
if ((CurrSashDim.ElementDimensionList.Count == 5 && element.nIndex == 4) ||
(CurrSashDim.ElementDimensionList.Count == 6 &&
(element.nIndex == 4 || element.nIndex == 5)))
{
continue;
}
else
{
<div class="col-6">
<EditElement CurrRec="element" EC_Update="UpdateElement"></EditElement>
</div>
}
}
</div>
</div>
</div>
}
</div>