Adds the building blocks every later screen uses, so modules are built from one set of components instead of ad hoc markup: - Form components (KhForm, KhTextBox, KhNumberBox, KhDateBox, KhSelect, KhCheck, KhSwitch, KhHotlink) with Italian number and date input, inline calculation (=10*3), field messages plus a summary that focuses the field, and service errors added by field name. - Display and window components (panels, tiles, badges, chips, money, tabs with Alt+1..9, steps, dialog, side drawer and DrawerService). - KhIconToolbar that keeps one line and moves less used commands into the "..." menu, KhDocHead, and the RecordPage/DocumentPage/MasterDataPage bases with standard commands, shortcuts and save/cancel/delete flow (#27, #29). - Development-only component catalog and sample document page. - Profile: personal data, password change that ends other sessions, TOTP enable/disable and recovery codes through ProfileService (#31). Refs #27 #29 #31 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
2.0 KiB
Plaintext
63 lines
2.0 KiB
Plaintext
@* The steps of a procedure (SPEC §10.7): horizontal over a wizard, or vertical (KhVSteps style) beside it. Steps
|
|
before Current are done. *@
|
|
@if (Vertical)
|
|
{
|
|
<ol class="vsteps kh-steps" aria-label="@Label">
|
|
@for (var i = 0; i < Items.Count; i++)
|
|
{
|
|
var step = Items[i];
|
|
<li class="vstep @StateOf(i)" aria-current="@(i == Current ? "step" : null)">
|
|
<span class="n">@NumberOf(i)</span>
|
|
<span>
|
|
@step.Title
|
|
@if (step.Detail is not null)
|
|
{
|
|
<span class="vs">@step.Detail</span>
|
|
}
|
|
</span>
|
|
</li>
|
|
}
|
|
</ol>
|
|
}
|
|
else
|
|
{
|
|
<ol class="steps kh-steps" aria-label="@Label">
|
|
@for (var i = 0; i < Items.Count; i++)
|
|
{
|
|
var step = Items[i];
|
|
<li class="step @StateOf(i)" aria-current="@(i == Current ? "step" : null)">
|
|
<span class="n">@NumberOf(i)</span>
|
|
@step.Title
|
|
@if (i < Items.Count - 1)
|
|
{
|
|
<span class="ln" aria-hidden="true"></span>
|
|
}
|
|
</li>
|
|
}
|
|
</ol>
|
|
}
|
|
|
|
@code {
|
|
private RenderFragment NumberOf(int index) => index < Current
|
|
? builder => { builder.OpenComponent<KhIcon>(0); builder.AddAttribute(1, nameof(KhIcon.Name), "check"); builder.AddAttribute(2, nameof(KhIcon.Class), "sm"); builder.CloseComponent(); }
|
|
: builder => builder.AddContent(0, index + 1);
|
|
|
|
/// <summary>The steps.</summary>
|
|
[Parameter, EditorRequired]
|
|
public IReadOnlyList<KhStep> Items { get; set; } = [];
|
|
|
|
/// <summary>The index of the current step.</summary>
|
|
[Parameter]
|
|
public int Current { get; set; }
|
|
|
|
/// <summary>Vertical layout.</summary>
|
|
[Parameter]
|
|
public bool Vertical { get; set; }
|
|
|
|
/// <summary>The accessible name.</summary>
|
|
[Parameter]
|
|
public string? Label { get; set; }
|
|
|
|
private string? StateOf(int index) => index < Current ? "done" : index == Current ? "on" : null;
|
|
}
|