|
83 | 83 | <div class="@ContentClassname" style="@ContentStyle"> |
84 | 84 | @ChildContent |
85 | 85 | </div> |
| 86 | + @if (DisablePreviousButton == false || DisableNextButton == false || DisableSkipButton) |
| 87 | + { |
| 88 | + <div class="@ActionClassname"> |
86 | 89 |
|
87 | | - <div class="d-flex gap-4"> |
88 | | - |
89 | | - @{ |
90 | | - bool showResultStep = ShowResultStep(); |
91 | | - } |
| 90 | + @{ |
| 91 | + bool showResultStep = ShowResultStep(); |
| 92 | + } |
92 | 93 |
|
93 | | - @if (!DisablePreviousButton && ActiveIndex != 0) |
94 | | - { |
95 | | - if (IconActionButtons || MobileView) |
| 94 | + @if (StepperActionsJustify == StepperActionsJustify.End) |
96 | 95 | { |
97 | | - <MudTooltip Text="@LocalizedStrings.Previous" Delay="300"> |
98 | | - <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronLeft" OnClick="@(() => SetActiveIndex(-1))" /> |
99 | | - </MudTooltip> |
| 96 | + @if (ActionContent != null) |
| 97 | + { |
| 98 | + <MudSpacer /> |
| 99 | + @ActionContent |
| 100 | + } |
100 | 101 | } |
101 | | - else |
| 102 | + |
| 103 | + @if (!DisablePreviousButton && ActiveIndex != 0) |
102 | 104 | { |
103 | | - <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SetActiveIndex(-1))">@LocalizedStrings.Previous</MudButton> |
| 105 | + if (IconActionButtons || MobileView) |
| 106 | + { |
| 107 | + <MudTooltip Text="@LocalizedStrings.Previous" Delay="300"> |
| 108 | + <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronLeft" OnClick="@(() => SetActiveIndex(-1))" /> |
| 109 | + </MudTooltip> |
| 110 | + } |
| 111 | + else |
| 112 | + { |
| 113 | + <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SetActiveIndex(-1))">@LocalizedStrings.Previous</MudButton> |
| 114 | + } |
104 | 115 | } |
105 | | - } |
106 | 116 |
|
107 | | - @if (ActionContent != null) |
108 | | - { |
109 | | - @* The user will provide their own MudSpacer in this render fragment *@ |
110 | | - @ActionContent |
111 | | - } |
112 | | - else |
113 | | - { |
114 | | - <MudSpacer /> |
115 | | - } |
| 117 | + @if (ActionContent != null && StepperActionsJustify != StepperActionsJustify.End) |
| 118 | + { |
| 119 | + @* The user will provide their own MudSpacer in this render fragment *@ |
| 120 | + @ActionContent |
| 121 | + } |
| 122 | + @if (StepperActionsJustify == StepperActionsJustify.SpaceBetween) |
| 123 | + { |
| 124 | + <MudSpacer /> |
| 125 | + } |
116 | 126 |
|
117 | | - @if (showResultStep == false) |
118 | | - { |
119 | | - if ((ActiveIndex < Steps.Count && Steps[ActiveIndex].Status != StepStatus.Continued) || (ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) |
| 127 | + @if (showResultStep == false) |
120 | 128 | { |
121 | | - if (!DisableStepResultIndicator && MobileView == false) |
| 129 | + if ((ActiveIndex < Steps.Count && Steps[ActiveIndex].Status != StepStatus.Continued) || (ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) |
122 | 130 | { |
123 | | - <MudButton Color="@Color" Variant="Variant.Text" Disabled="true">@(Steps[ActiveIndex].Status == StepStatus.Completed ? LocalizedStrings.Completed : LocalizedStrings.Skipped)</MudButton> |
| 131 | + if (!DisableStepResultIndicator && MobileView == false) |
| 132 | + { |
| 133 | + <MudButton Color="@Color" Variant="Variant.Text" Disabled="true">@(Steps[ActiveIndex].Status == StepStatus.Completed ? LocalizedStrings.Completed : LocalizedStrings.Skipped)</MudButton> |
| 134 | + } |
| 135 | + } |
| 136 | + else if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Optional == true) |
| 137 | + { |
| 138 | + if (!DisableSkipButton) |
| 139 | + { |
| 140 | + if (IconActionButtons || MobileView) |
| 141 | + { |
| 142 | + <MudTooltip Text="@LocalizedStrings.Skip" Delay="300"> |
| 143 | + <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.SkipNext" OnClick="@(() => SkipStep(ActiveIndex))" /> |
| 144 | + </MudTooltip> |
| 145 | + } |
| 146 | + else |
| 147 | + { |
| 148 | + <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SkipStep(ActiveIndex))">@LocalizedStrings.Skip</MudButton> |
| 149 | + } |
| 150 | + |
| 151 | + } |
124 | 152 | } |
125 | 153 | } |
126 | | - else if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Optional == true) |
| 154 | + |
| 155 | + @if (showResultStep == false && !DisableNextButton && !(ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) |
127 | 156 | { |
128 | | - if (!DisableSkipButton) |
| 157 | + if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Status != StepStatus.Continued) |
129 | 158 | { |
130 | 159 | if (IconActionButtons || MobileView) |
131 | 160 | { |
132 | | - <MudTooltip Text="@LocalizedStrings.Skip" Delay="300"> |
133 | | - <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.SkipNext" OnClick="@(() => SkipStep(ActiveIndex))" /> |
| 161 | + <MudTooltip Text="@GetNextButtonString()" Delay="300"> |
| 162 | + <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronRight" OnClick="@(() => SetActiveIndex(1))" /> |
134 | 163 | </MudTooltip> |
135 | 164 | } |
136 | 165 | else |
137 | 166 | { |
138 | | - <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SkipStep(ActiveIndex))">@LocalizedStrings.Skip</MudButton> |
| 167 | + <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SetActiveIndex(1))">@GetNextButtonString()</MudButton> |
139 | 168 | } |
140 | | - |
141 | | - } |
142 | | - } |
143 | | - } |
144 | | - |
145 | | - @if (showResultStep == false && !DisableNextButton && !(ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) |
146 | | - { |
147 | | - if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Status != StepStatus.Continued) |
148 | | - { |
149 | | - if (IconActionButtons || MobileView) |
150 | | - { |
151 | | - <MudTooltip Text="@GetNextButtonString()" Delay="300"> |
152 | | - <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronRight" OnClick="@(() => SetActiveIndex(1))" /> |
153 | | - </MudTooltip> |
154 | 169 | } |
155 | 170 | else |
156 | 171 | { |
157 | | - <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => SetActiveIndex(1))">@GetNextButtonString()</MudButton> |
158 | | - } |
159 | | - } |
160 | | - else |
161 | | - { |
162 | | - if (IconActionButtons || MobileView) |
163 | | - { |
164 | | - <MudTooltip Text="@GetNextButtonString()" Delay="300"> |
165 | | - <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronRight" OnClick="@(() => CompleteStep(ActiveIndex))" /> |
166 | | - </MudTooltip> |
167 | | - } |
168 | | - else |
169 | | - { |
170 | | - <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => CompleteStep(ActiveIndex))">@GetNextButtonString()</MudButton> |
171 | | - } |
| 172 | + if (IconActionButtons || MobileView) |
| 173 | + { |
| 174 | + <MudTooltip Text="@GetNextButtonString()" Delay="300"> |
| 175 | + <MudIconButton Color="@Color" Variant="@Variant" Icon="@Icons.Material.Filled.ChevronRight" OnClick="@(() => CompleteStep(ActiveIndex))" /> |
| 176 | + </MudTooltip> |
| 177 | + } |
| 178 | + else |
| 179 | + { |
| 180 | + <MudButton Color="@Color" Variant="@Variant" OnClick="@(() => CompleteStep(ActiveIndex))">@GetNextButtonString()</MudButton> |
| 181 | + } |
172 | 182 |
|
| 183 | + } |
173 | 184 | } |
174 | | - } |
175 | | - |
176 | | - </div> |
| 185 | + </div> |
| 186 | + } |
177 | 187 | </MudStack> |
178 | 188 | </MudStack> |
179 | 189 | </CascadingValue> |
|
0 commit comments