|
1 | 1 | @inject ISnackbar Snackbar |
| 2 | +@inject NavigationManager NavigationManager |
2 | 3 | @using MudBlazor.Extensions |
3 | 4 | @using MudExtensions.Utilities |
4 | 5 |
|
5 | 6 | <MudGrid Class="cursor-default"> |
6 | 7 | <MudItem xs="12" sm="8"> |
7 | | - <MudStepper @ref="_stepper" ContentStyle="min-height: 400px" Linear="_linear" Vertical="_vertical" Color="_color" Variant="_variant" DisableAnimation="_disableAnimation" HeaderTextView="_headerTextView" |
| 8 | + <MudStepper @ref="_stepper" ContentStyle="min-height: 400px" Linear="_linear" Vertical="_vertical" Color="_color" Variant="_variant" |
| 9 | + DisableAnimation="_disableAnimation" DisablePreviousButton="_disablePreviousButton" DisableNextButton="_disableNextButton" |
| 10 | + DisableSkipButton="_disableSkipButton" DisableStepResultIndicator="_disableStepResultIndicator" HeaderTextView="_headerTextView" |
8 | 11 | PreventStepChange="new Func<bool>(CheckChange)" LocalizedStrings="GetLocalizedStrings()"> |
9 | | - |
10 | | - <MudStep Title="Customer Info" StatusChanged="StatusChanged"> |
11 | | - <MudForm @ref="_form"> |
12 | | - <MudStack> |
13 | | - <MudTextField T="string" Label="Name" Variant="_variant" Required="true" /> |
14 | | - <MudTextField T="string" Label="Last Name" Variant="_variant" /> |
15 | | - <MudTextField T="string" Label="Adress" Variant="_variant" /> |
16 | | - </MudStack> |
17 | | - </MudForm> |
18 | | - </MudStep> |
19 | | - <MudStep Title="Booking Spec." Optional="true"> |
20 | | - <MudCheckBox T="bool" Label="Early Check-in" Color="_color" /> |
21 | | - <MudCheckBox T="bool" Label="Late Check-out" Color="_color" /> |
22 | | - <MudCheckBox T="bool" Label="Twin Bed" Color="_color" /> |
23 | | - </MudStep> |
24 | | - <MudStep Title="Payment"> |
25 | | - <MudForm @ref="_form2"> |
26 | | - <MudStack> |
27 | | - <MudTextField T="string" Label="Card Number" Variant="_variant" Required="true" /> |
28 | | - <MudStack Row="true"> |
29 | | - <MudTextField T="string" Label="Expire Date" Variant="_variant" Required="true" /> |
30 | | - <MudTextField T="string" Label="CVC" Variant="_variant" Required="true" /> |
| 12 | + <ChildContent> |
| 13 | + <MudStep Title="Customer Info" StatusChanged="StatusChanged"> |
| 14 | + <MudForm @ref="_form"> |
| 15 | + <MudStack> |
| 16 | + <MudTextField T="string" Label="Name" Variant="_variant" Required="true" /> |
| 17 | + <MudTextField T="string" Label="Last Name" Variant="_variant" /> |
| 18 | + <MudTextField T="string" Label="Adress" Variant="_variant" /> |
31 | 19 | </MudStack> |
32 | | - </MudStack> |
33 | | - </MudForm> |
34 | | - </MudStep> |
35 | | - |
36 | | - @if (_addResultStep) |
37 | | - { |
38 | | - <MudStep Title="Result Step" IsResultStep="true"> |
39 | | - <div class="d-flex flex-column align-center justify-center" style="height: 200px"> |
40 | | - <MudIconButton Icon="@Icons.Filled.DoneAll" Size="Size.Large" Variant="Variant.Filled" Color="Color.Success" /> |
41 | | - <MudText>Your reservation succesfully completed.</MudText> |
42 | | - </div> |
| 20 | + </MudForm> |
43 | 21 | </MudStep> |
44 | | - } |
| 22 | + <MudStep Title="Booking Spec." Optional="true"> |
| 23 | + <MudCheckBox T="bool" Label="Early Check-in" Color="_color" /> |
| 24 | + <MudCheckBox T="bool" Label="Late Check-out" Color="_color" /> |
| 25 | + <MudCheckBox T="bool" Label="Twin Bed" Color="_color" /> |
| 26 | + </MudStep> |
| 27 | + <MudStep Title="Payment"> |
| 28 | + <MudForm @ref="_form2"> |
| 29 | + <MudStack> |
| 30 | + <MudTextField T="string" Label="Card Number" Variant="_variant" Required="true" /> |
| 31 | + <MudStack Row="true"> |
| 32 | + <MudTextField T="string" Label="Expire Date" Variant="_variant" Required="true" /> |
| 33 | + <MudTextField T="string" Label="CVC" Variant="_variant" Required="true" /> |
| 34 | + </MudStack> |
| 35 | + </MudStack> |
| 36 | + </MudForm> |
| 37 | + </MudStep> |
| 38 | + |
| 39 | + @if (_addResultStep) |
| 40 | + { |
| 41 | + <MudStep Title="Result Step" IsResultStep="true"> |
| 42 | + <div class="d-flex flex-column align-center justify-center" style="height: 200px"> |
| 43 | + <MudIconButton Icon="@Icons.Filled.DoneAll" Size="Size.Large" Variant="Variant.Filled" Color="Color.Success" /> |
| 44 | + <MudText>Your reservation succesfully completed.</MudText> |
| 45 | + </div> |
| 46 | + </MudStep> |
| 47 | + } |
| 48 | + </ChildContent> |
| 49 | + <ActionContent> |
| 50 | + @if (!_stepper.IsAllStepsCompleted()) |
| 51 | + { |
| 52 | + <MudButton Color="Color.Secondary" Variant="_variant" OnClick="@(() => NavigationManager.NavigateTo("/"))">Cancel</MudButton> |
| 53 | + } |
| 54 | + <MudSpacer /> |
| 55 | + </ActionContent> |
45 | 56 | </MudStepper> |
46 | 57 | </MudItem> |
47 | 58 |
|
48 | 59 | <MudItem xs="12" sm="4" Style="box-shadow: rgba(240, 46, 170, 0.4) -3px 3px;"> |
49 | 60 | <MudStack Spacing="4"> |
50 | 61 | <MudCheckBox @bind-Checked="_linear" Color="Color.Primary" Label="Linear" Dense="true" /> |
51 | 62 | <MudCheckBox @bind-Checked="_disableAnimation" Color="Color.Primary" Label="Disable Animation" Dense="true" /> |
| 63 | + <MudCheckBox @bind-Checked="_disablePreviousButton" Color="Color.Primary" Label="Disable Previous Step Action Button" Dense="true" /> |
| 64 | + <MudCheckBox @bind-Checked="_disableNextButton" Color="Color.Primary" Label="Disable Next Step Action Button" Dense="true" /> |
| 65 | + <MudCheckBox @bind-Checked="_disableSkipButton" Color="Color.Primary" Label="Disable Skip Step Action Button" Dense="true" /> |
| 66 | + <MudCheckBox @bind-Checked="_disableStepResultIndicator" Color="Color.Primary" Label="Disable Step Result Indicator" Dense="true" /> |
52 | 67 | <MudSwitch @bind-Checked="_addResultStep" Color="Color.Primary" Label="Has Result Step" /> |
53 | 68 | <MudSwitch @bind-Checked="_checkValidationBeforeComplete" Color="Color.Primary" Label="Check Validation Before Complete Step" /> |
54 | 69 | <MudSwitch @bind-Checked="_customLocalization" Color="Color.Primary" Label="Custom Localization (German)" /> |
|
84 | 99 | Variant _variant = Variant.Filled; |
85 | 100 | HeaderTextView _headerTextView = HeaderTextView.All; |
86 | 101 | bool _disableAnimation = false; |
| 102 | + bool _disablePreviousButton = false; |
| 103 | + bool _disableNextButton = false; |
| 104 | + bool _disableSkipButton = false; |
| 105 | + bool _disableStepResultIndicator = false; |
87 | 106 | bool _addResultStep = true; |
88 | 107 | bool _customLocalization = false; |
89 | 108 | Color _color = Color.Primary; |
|
0 commit comments