32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
@inherits DComponentBase
|
|||
|
|
|
||
|
|
@* One step of a DSteps: <li class="step">. A Color marks it (usually the completed steps); Marker replaces the number
|
||
|
|
in its circle (data-content) and Icon replaces the circle's content with a step-icon. *@
|
||
|
|
<li @attributes="AdditionalAttributes" class="@Cx("step", ColorClass, Class)" data-content="@Marker">
|
||
|
|
@if (Icon is not null)
|
||
|
|
{
|
||
|
|
<span class="step-icon">@Icon</span>
|
||
|
|
}
|
||
|
|
@ChildContent
|
||
|
|
</li>
|
||
|
|
|
||
|
|
@code {
|
||
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
||
|
|
[Parameter] public DColor Color { get; set; }
|
||
|
|
/// <summary>Text shown in the step's circle instead of its number, e.g. "✓" or "?" (data-content).</summary>
|
||
|
|
[Parameter] public string Marker { get; set; }
|
||
|
|
[Parameter] public RenderFragment Icon { get; set; }
|
||
|
|
|
||
|
|
string ColorClass => Color switch
|
||
|
|
{
|
||
|
|
DColor.Neutral => "step-neutral",
|
||
|
|
DColor.Primary => "step-primary",
|
||
|
|
DColor.Secondary => "step-secondary",
|
||
|
|
DColor.Accent => "step-accent",
|
||
|
|
DColor.Info => "step-info",
|
||
|
|
DColor.Success => "step-success",
|
||
|
|
DColor.Warning => "step-warning",
|
||
|
|
DColor.Error => "step-error",
|
||
|
|
_ => null
|
||
|
|
};
|
||
|
|
}
|