|
3 | 3 | @using MudExtensions.Enums |
4 | 4 |
|
5 | 5 | <CascadingValue Value="this" IsFixed="true"> |
6 | | - <MudStack Class="@Class" Style="@Style"> @*Row="Vertical"*@ |
7 | | - <MudStack Row="true" AlignItems="@(HeaderTextView == HeaderTextView.NewLine ? AlignItems.Start : AlignItems.Center)"> @*Row="!Vertical"*@ |
8 | | - |
9 | | - @foreach (MudStep step in _steps) |
10 | | - { |
11 | | - if (step.IsResultStep || (MobileView == true && IsStepActive(step) == false)) |
12 | | - { |
13 | | - continue; |
| 6 | + <MudStack Row="@Vertical" Class="@Class" Style="@Style"> |
| 7 | + <div style="@GetStepperStyle()"> |
| 8 | + <div style=@GetStepperSubStyle()> |
| 9 | + @{ |
| 10 | + MudStep currentStep = null; |
14 | 11 | } |
15 | | - bool active = IsStepActive(step); |
16 | | - <div @onclick="@(Linear ? null : () => SetActiveIndex(step))" Class="@HeaderClassname"> |
17 | | - <MudAvatar Class="@((active || step.Status != StepStatus.Continued) ? $"mud-theme-{Color.ToDescriptionString()}" : null)" Variant="@Variant" Size="Size.Small"> |
18 | | - @if (step.Status == Enums.StepStatus.Completed) |
19 | | - { |
20 | | - <MudIcon Icon="@Icons.Material.Filled.Done" Size="Size.Small" /> |
| 12 | + @foreach (MudStep step in _steps) |
| 13 | + { |
| 14 | + if (IsStepActive(step)) |
| 15 | + { |
| 16 | + currentStep = step; |
| 17 | + } |
| 18 | + if (step.IsResultStep || (MobileView == true && IsStepActive(step) == false)) |
| 19 | + { |
| 20 | + continue; |
| 21 | + } |
| 22 | + |
| 23 | + <div style="@GetStepPercent()"> |
| 24 | + <div @onclick="@(Linear ? null : () => SetActiveIndex(step))" class="@HeaderClassname"> |
| 25 | + @{ |
| 26 | + bool active = IsStepActive(step); |
21 | 27 | } |
22 | | - else if (step.Status == StepStatus.Skipped) |
| 28 | + @if (step.Template != null) |
23 | 29 | { |
24 | | - <MudIcon Icon="@Icons.Material.Filled.Remove" Size="Size.Small" /> |
| 30 | + @step.Template(step) |
25 | 31 | } |
26 | 32 | else |
27 | 33 | { |
28 | | - @(Steps.IndexOf(step) + 1) |
29 | | - } |
30 | | - </MudAvatar> |
31 | | - @if (HeaderTextView == HeaderTextView.All || HeaderTextView == HeaderTextView.NewLine || (HeaderTextView == HeaderTextView.OnlyActiveText && active)) |
32 | | - { |
33 | | - <div> |
34 | | - <MudText Align="Align.Center" Color="@(active ? Color : Color.Default)" Style="@(active ? "font-weight: 900" : null)">@step.Title</MudText> |
35 | | - @if (step.Optional == true) |
36 | | - { |
37 | | - <MudText Align="@(HeaderTextView == HeaderTextView.NewLine ? Align.Center : Align.Start)" Typo="Typo.subtitle2" Color="@(active ? Color : Color.Default)" Style="@(active ? "font-weight: 500" : null)">@LocalizedStrings.Optional</MudText> |
| 34 | + @if (step.Status == MudExtensions.Enums.StepStatus.Completed) |
| 35 | + { |
| 36 | + <MudBadge BadgeClass="mud-stepper-badge" Overlap="true" Bordered="true" Color="@Color" Icon="@Icons.Material.Filled.Done"> |
| 37 | + <MudAvatar Style="@AvatarStylename" Color="@Color" Variant="@Variant" Size="@HeaderSize"> |
| 38 | + @if (!string.IsNullOrWhiteSpace(step.Icon)) |
| 39 | + { |
| 40 | + <MudIcon Class="pa-1" Icon="@step.Icon" Size="@HeaderSize" /> |
| 41 | + } |
| 42 | + </MudAvatar> |
| 43 | + </MudBadge> |
| 44 | + } |
| 45 | + else |
| 46 | + { |
| 47 | + <MudAvatar Style="@AvatarStylename" Color="@Color" Variant="@Variant" Size="@HeaderSize"> |
| 48 | + <MudIcon Class="pa-1" Icon="@step.Icon" Size="@HeaderSize" /> |
| 49 | + </MudAvatar> |
| 50 | + } |
| 51 | + @if (HeaderTextView == HeaderTextView.All || HeaderTextView == HeaderTextView.OnlyActiveText) |
| 52 | + { |
| 53 | + <MudText Class="mt-n1"> |
| 54 | + @if (step.MudStepper.GetActiveIndex() == @step.MudStepper.Steps.IndexOf(@step)) |
| 55 | + { |
| 56 | + <MudText Color="@(step.Status != StepStatus.Continued ? Color : Color.Inherit)"><b>@step.Title</b></MudText> |
| 57 | + } |
| 58 | + else if (HeaderTextView != HeaderTextView.OnlyActiveText) |
| 59 | + { |
| 60 | + <MudText Color="@(step.Status != StepStatus.Continued ? Color : Color.Inherit)">@step.Title</MudText> |
| 61 | + } |
| 62 | + </MudText> |
| 63 | + } |
38 | 64 | } |
39 | 65 | </div> |
40 | | - } |
41 | | - </div> |
42 | | - |
43 | | - if (_steps.Count - 1 != _steps.IndexOf(step) || MobileView == true) |
44 | | - { |
45 | | - <span class="@GetDashClassname(step)"></span> |
46 | | - } |
47 | | - |
48 | | - @if (MobileView == true) |
49 | | - { |
50 | | - <MudText Typo="Typo.body2" Color="@Color">@(_steps?.IndexOf(step) + 1) / @(_steps?.Count)</MudText> |
| 66 | + </div> |
51 | 67 | } |
| 68 | + </div> |
| 69 | + @if (MobileView == true) |
| 70 | + { |
| 71 | + <MudText Style="@GetMobileStyle()" Typo="Typo.body2" Color="@Color">@(_steps?.IndexOf(currentStep) + 1) / @(_steps?.Count)</MudText> |
52 | 72 | } |
53 | | - |
54 | | - |
55 | | - </MudStack> |
| 73 | + <MudProgressLinear Vertical="@Vertical" Color="@Color" Value="@ProgressValue" Min="0" Max="100" Style="@GetProgressLinearStyle()" /> |
| 74 | + |
| 75 | + </div> |
56 | 76 | @if (Loading) |
57 | 77 | { |
58 | 78 | <MudProgressLinear Indeterminate="true" Color="@Color" /> |
|
62 | 82 | <div class="@ContentClassname" style="@ContentStyle"> |
63 | 83 | @ChildContent |
64 | 84 | </div> |
65 | | - |
| 85 | + |
66 | 86 | <div class="d-flex gap-4"> |
67 | | - |
| 87 | + |
68 | 88 | @{ |
69 | 89 | bool showResultStep = ShowResultStep(); |
70 | 90 | } |
|
99 | 119 | { |
100 | 120 | if (!DisableStepResultIndicator && MobileView == false) |
101 | 121 | { |
102 | | - <MudButton Color="@Color" Variant="@Variant" Disabled="true">@(Steps[ActiveIndex].Status == StepStatus.Completed ? LocalizedStrings.Completed : LocalizedStrings.Skipped)</MudButton> |
| 122 | + <MudButton Color="@Color" Variant="Variant.Text" Disabled="true">@(Steps[ActiveIndex].Status == StepStatus.Completed ? LocalizedStrings.Completed : LocalizedStrings.Skipped)</MudButton> |
103 | 123 | } |
104 | 124 | } |
105 | 125 | else if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Optional == true) |
|
116 | 136 | { |
117 | 137 | <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SkipStep(ActiveIndex))">@LocalizedStrings.Skip</MudButton> |
118 | 138 | } |
119 | | - |
| 139 | + |
120 | 140 | } |
121 | 141 | } |
122 | 142 | } |
|
128 | 148 | if (IconActionButtons || MobileView) |
129 | 149 | { |
130 | 150 | <MudTooltip Text="@GetNextButtonString()" Delay="300"> |
131 | | - <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronRight" OnClick="@(() => SetActiveIndex(1))"/> |
| 151 | + <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronRight" OnClick="@(() => SetActiveIndex(1))" /> |
132 | 152 | </MudTooltip> |
133 | 153 | } |
134 | 154 | else |
|
148 | 168 | { |
149 | 169 | <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => CompleteStep(ActiveIndex))">@GetNextButtonString()</MudButton> |
150 | 170 | } |
151 | | - |
| 171 | + |
152 | 172 | } |
153 | 173 | } |
154 | 174 |
|
|
0 commit comments