Strom: align labels and inputs in the bill dialog
The dialog field grid of Wasser & Heizung moves to app.css (.dialog-fields/.dialog-field) and is used by the Strom dialog too, which is now as wide (760px). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f94380b548
commit
5457bd74b8
5 changed files with 56 additions and 60 deletions
|
|
@ -13,21 +13,15 @@
|
||||||
<FluentDialogBody>
|
<FluentDialogBody>
|
||||||
<EditForm EditContext="@editContext">
|
<EditForm EditContext="@editContext">
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<FluentStack Orientation="Orientation.Horizontal">
|
<div class="dialog-fields">
|
||||||
<FluentDatePicker @bind-Value="@periodFrom" Label="Von" Style="width: 170px;" />
|
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodFrom" Label="Von" /></div>
|
||||||
<FluentDatePicker @bind-Value="@periodTo" Label="Bis" Style="width: 170px;" />
|
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodTo" Label="Bis" /></div>
|
||||||
</FluentStack>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.GridKwh" Label="Netzbezug (kWh)" /></div>
|
||||||
<FluentStack Orientation="Orientation.Horizontal">
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.PvKwh" Label="PV-Produktion (kWh)" /></div>
|
||||||
<FluentNumberField @bind-Value="@Content.GridKwh" Label="Netzbezug (kWh)" Style="width: 170px;" />
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.GridChf" Label="Netzbezug (CHF)" /></div>
|
||||||
<FluentNumberField @bind-Value="@Content.PvKwh" Label="PV-Produktion (kWh)" Style="width: 170px;" />
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.PvChf" Label="PV (CHF)" /></div>
|
||||||
</FluentStack>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.SideCostsChf" Label="Nebenkosten (CHF)" /></div>
|
||||||
<FluentStack Orientation="Orientation.Horizontal">
|
</div>
|
||||||
<FluentNumberField @bind-Value="@Content.GridChf" Label="Netzbezug (CHF)" Style="width: 170px;" />
|
|
||||||
<FluentNumberField @bind-Value="@Content.PvChf" Label="PV (CHF)" Style="width: 170px;" />
|
|
||||||
</FluentStack>
|
|
||||||
<FluentStack Orientation="Orientation.Horizontal">
|
|
||||||
<FluentNumberField @bind-Value="@Content.SideCostsChf" Label="Nebenkosten (CHF)" Style="width: 170px;" />
|
|
||||||
</FluentStack>
|
|
||||||
<div>
|
<div>
|
||||||
<FluentValidationSummary />
|
<FluentValidationSummary />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,32 +14,32 @@
|
||||||
<FluentDialogBody>
|
<FluentDialogBody>
|
||||||
<EditForm EditContext="@editContext">
|
<EditForm EditContext="@editContext">
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<div class="fields">
|
<div class="dialog-fields">
|
||||||
<div class="field"><FluentDatePicker @bind-Value="@periodFrom" @bind-Value:after="SyncPeriod" Label="Von" /></div>
|
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodFrom" @bind-Value:after="SyncPeriod" Label="Von" /></div>
|
||||||
<div class="field"><FluentDatePicker @bind-Value="@periodTo" @bind-Value:after="SyncPeriod" Label="Bis" /></div>
|
<div class="dialog-field"><FluentDatePicker @bind-Value="@periodTo" @bind-Value:after="SyncPeriod" Label="Bis" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="@SectionStyle">NeoVac – Ablesequittung</div>
|
<div style="@SectionStyle">NeoVac – Ablesequittung</div>
|
||||||
<div class="fields">
|
<div class="dialog-fields">
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.WarmWaterM3" @bind-Value:after="Content.CalculateCosts" Label="Warmwasser (m³)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WarmWaterM3" @bind-Value:after="Content.CalculateCosts" Label="Warmwasser (m³)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.ColdWaterM3" @bind-Value:after="Content.CalculateCosts" Label="Kaltwasser (m³)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.ColdWaterM3" @bind-Value:after="Content.CalculateCosts" Label="Kaltwasser (m³)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.HeatingMwh" Label="Wärme (MWh)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.HeatingMwh" Label="Wärme (MWh)" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="@SectionStyle">NeoVac – Anteil (‰)</div>
|
<div style="@SectionStyle">NeoVac – Anteil (‰)</div>
|
||||||
<div class="fields">
|
<div class="dialog-fields">
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.WaterBasePermille" @bind-Value:after="Content.CalculateCosts" Label="Wasser Grund (‰)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WaterBasePermille" @bind-Value:after="Content.CalculateCosts" Label="Wasser Grund (‰)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.WaterConsumptionPermille" @bind-Value:after="Content.CalculateCosts" Label="Wasser Verbrauch (‰)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WaterConsumptionPermille" @bind-Value:after="Content.CalculateCosts" Label="Wasser Verbrauch (‰)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.HeatingPermille" @bind-Value:after="Content.CalculateCosts" Label="Heizung total (‰)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.HeatingPermille" @bind-Value:after="Content.CalculateCosts" Label="Heizung total (‰)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.WarmWaterHeatingPermille" @bind-Value:after="Content.CalculateCosts" Label="Heizung WW (‰)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WarmWaterHeatingPermille" @bind-Value:after="Content.CalculateCosts" Label="Heizung WW (‰)" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="@SectionStyle">Verwaltung – Ihr Anteil</div>
|
<div style="@SectionStyle">Verwaltung – Ihr Anteil</div>
|
||||||
<div class="fields">
|
<div class="dialog-fields">
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.WaterCostsChf" @bind-Value:after="Content.CalculateCosts" Label="Wasserkosten (CHF)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.WaterCostsChf" @bind-Value:after="Content.CalculateCosts" Label="Wasserkosten (CHF)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.HeatingCostsChf" @bind-Value:after="Content.CalculateCosts" Label="Heizkosten (CHF)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.HeatingCostsChf" @bind-Value:after="Content.CalculateCosts" Label="Heizkosten (CHF)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.ManagerWaterPermille" Label="Wasser (‰, optional)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.ManagerWaterPermille" Label="Wasser (‰, optional)" /></div>
|
||||||
<div class="field"><FluentNumberField @bind-Value="@Content.ManagerHeatingPermille" Label="Heizung (‰, optional)" /></div>
|
<div class="dialog-field"><FluentNumberField @bind-Value="@Content.ManagerHeatingPermille" Label="Heizung (‰, optional)" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<FluentValidationSummary />
|
<FluentValidationSummary />
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/* Two columns of fields; each field is a fixed-width label left of an input that fills the rest,
|
|
||||||
so labels and inputs line up across rows and sections. */
|
|
||||||
.fields {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
||||||
column-gap: 24px;
|
|
||||||
row-gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field ::deep .fluent-input-label {
|
|
||||||
flex: 0 0 140px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field ::deep fluent-number-field,
|
|
||||||
.field ::deep fluent-text-field {
|
|
||||||
flex: 1 1 auto;
|
|
||||||
min-width: 0;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
@ -104,7 +104,7 @@ public partial class Electricity : ComponentBase
|
||||||
var data = new ElectricityBill();
|
var data = new ElectricityBill();
|
||||||
var dialog = await dialogService.ShowDialogAsync<ElectricityBillDialog>(data, new DialogParameters()
|
var dialog = await dialogService.ShowDialogAsync<ElectricityBillDialog>(data, new DialogParameters()
|
||||||
{
|
{
|
||||||
Width = "560px",
|
Width = "760px",
|
||||||
Height = "460px",
|
Height = "460px",
|
||||||
Title = "Abrechnung hinzufügen",
|
Title = "Abrechnung hinzufügen",
|
||||||
PreventDismissOnOverlayClick = true,
|
PreventDismissOnOverlayClick = true,
|
||||||
|
|
@ -124,7 +124,7 @@ public partial class Electricity : ComponentBase
|
||||||
var data = await electricityBillRepository.GetElectricityBillAsync(id);
|
var data = await electricityBillRepository.GetElectricityBillAsync(id);
|
||||||
var dialog = await dialogService.ShowDialogAsync<ElectricityBillDialog>(data, new DialogParameters()
|
var dialog = await dialogService.ShowDialogAsync<ElectricityBillDialog>(data, new DialogParameters()
|
||||||
{
|
{
|
||||||
Width = "560px",
|
Width = "760px",
|
||||||
Height = "460px",
|
Height = "460px",
|
||||||
Title = "Abrechnung bearbeiten",
|
Title = "Abrechnung bearbeiten",
|
||||||
PreventDismissOnOverlayClick = true,
|
PreventDismissOnOverlayClick = true,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,34 @@ a {
|
||||||
min-height: calc(100vh - 96px);
|
min-height: calc(100vh - 96px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fields in dialogs: two columns, each field a fixed-width label left of an input that fills the
|
||||||
|
rest, so labels and inputs line up across rows and sections. Fluent renders the label and the
|
||||||
|
input as siblings, so each field needs its own .dialog-field wrapper. */
|
||||||
|
.dialog-fields {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||||
|
column-gap: 24px;
|
||||||
|
row-gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-field {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-field .fluent-input-label {
|
||||||
|
flex: 0 0 140px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-field fluent-number-field,
|
||||||
|
.dialog-field fluent-text-field {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
h1:focus {
|
h1:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue