diff --git a/CodeBeam.MudBlazor.Extensions.Docs/Pages/ApiPage.razor b/CodeBeam.MudBlazor.Extensions.Docs/Pages/ApiPage.razor index 47ea724e..92afbc09 100644 --- a/CodeBeam.MudBlazor.Extensions.Docs/Pages/ApiPage.razor +++ b/CodeBeam.MudBlazor.Extensions.Docs/Pages/ApiPage.razor @@ -56,8 +56,8 @@ typeof(MudSignaturePad), typeof(MudSpeedDial), typeof(MudSplitter), - typeof(MudStepper), - typeof(MudStep), + typeof(MudStepperExtended), + typeof(MudStepExtended), typeof(MudSwitchM3), typeof(MudTeleport), typeof(MudTextFieldExtended), diff --git a/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample1.razor b/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample1.razor index 7682e328..184f9064 100644 --- a/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample1.razor +++ b/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample1.razor @@ -5,7 +5,7 @@ - - + @@ -31,15 +31,15 @@ - - + + - - + + @@ -51,18 +51,18 @@ - + @if (_addResultStep) { - +
Your reservation successfully completed.
-
+ }
@@ -72,7 +72,7 @@ } @* *@ -
+
@@ -129,9 +129,9 @@
@code { - MudStepper? _stepper = new(); - MudForm? _form; - MudForm? _form2; + MudStepperExtended? _stepper = new(); + MudForm? _form = new(); + MudForm? _form2 = new(); bool _checkValidationBeforeComplete = false; bool _linear; bool _mobileView; diff --git a/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample2.razor b/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample2.razor index 1bc67da3..76abe747 100644 --- a/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample2.razor +++ b/CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/Stepper/Examples/StepperExample2.razor @@ -5,11 +5,11 @@ - - + @@ -19,15 +19,15 @@ - - + + - - + + @@ -39,21 +39,21 @@ - + @if (_addResultStep) { - +
Your reservation successfully completed.
-
+ }
-
+
@@ -71,7 +71,7 @@
@code { - MudStepper? _stepper; + MudStepperExtended? _stepper = new(); MudForm _form = new(); MudForm _form2 = new(); bool _checkValidationBeforeComplete = false; diff --git a/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/StepperTest1.razor b/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/StepperTest1.razor index 5e8473f3..9eec8eb6 100644 --- a/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/StepperTest1.razor +++ b/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/StepperTest1.razor @@ -6,7 +6,7 @@ - - + @@ -29,13 +29,13 @@ - - + + - - + + @@ -45,16 +45,16 @@ - + @if (_addResultStep) { - +
Your reservation successfully completed.
-
+ }
@@ -64,7 +64,7 @@ } -
+
@@ -100,7 +100,7 @@
@code { - MudStepper _stepper = new(); + MudStepperExtended _stepper = new(); MudForm _form = new(); MudForm _form2 = new(); bool _checkValidationBeforeComplete = false; diff --git a/CodeBeam.MudBlazor.Extensions.UnitTests/Components/StepperTests.cs b/CodeBeam.MudBlazor.Extensions.UnitTests/Components/StepperTests.cs index 9c829be4..7eb140e8 100644 --- a/CodeBeam.MudBlazor.Extensions.UnitTests/Components/StepperTests.cs +++ b/CodeBeam.MudBlazor.Extensions.UnitTests/Components/StepperTests.cs @@ -12,7 +12,7 @@ public class StepperTests : BunitTest [Test] public void StepperRenderTest() { - var comp = Context.RenderComponent(); + var comp = Context.RenderComponent(); comp.Instance.Steps.Count.Should().Be(0); } @@ -22,9 +22,9 @@ public async Task StepperPreventStepChangeDirectionIsForwardWhenCompletingStepOn // Arrange var lastStepChangeDirection = StepChangeDirection.None; int _targetIndex = 0; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { lastStepChangeDirection = direction; @@ -33,7 +33,7 @@ public async Task StepperPreventStepChangeDirectionIsForwardWhenCompletingStepOn }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); @@ -50,9 +50,9 @@ public async Task StepperPreventStepChangeDirectionIsForwardWhenSkippingStepOneO // Arrange var lastStepChangeDirection = StepChangeDirection.None; int _targetIndex = 0; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { lastStepChangeDirection = direction; @@ -61,7 +61,7 @@ public async Task StepperPreventStepChangeDirectionIsForwardWhenSkippingStepOneO }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); @@ -78,9 +78,9 @@ public async Task StepperPreventStepChangeDirectionIsForwardWhenChangingFromStep // Arrange var lastStepChangeDirection = StepChangeDirection.None; int _targetIndex = 0; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { lastStepChangeDirection = direction; @@ -89,10 +89,10 @@ public async Task StepperPreventStepChangeDirectionIsForwardWhenChangingFromStep }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step0.Instance); @@ -110,9 +110,9 @@ public async Task StepperPreventStepChangeDirectionIsBackwardWhenChangingFromSte // Arrange var lastStepChangeDirection = StepChangeDirection.None; int _targetIndex = 0; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { lastStepChangeDirection = direction; @@ -121,10 +121,10 @@ public async Task StepperPreventStepChangeDirectionIsBackwardWhenChangingFromSte }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step1.Instance); @@ -141,9 +141,9 @@ public async Task StepperPreventStepChangeDirectionIsNoneWhenChangingToTheSameSt { // Arrange var lastStepChangeDirection = StepChangeDirection.None; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { lastStepChangeDirection = direction; @@ -151,7 +151,7 @@ public async Task StepperPreventStepChangeDirectionIsNoneWhenChangingToTheSameSt }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step0.Instance); @@ -168,9 +168,9 @@ public async Task StepperPreventStepChangeIsInvokedWhenCompletingActiveStepTest( { // Arrange var preventStepChangeWasInvoked = false; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { preventStepChangeWasInvoked = true; @@ -178,10 +178,10 @@ public async Task StepperPreventStepChangeIsInvokedWhenCompletingActiveStepTest( }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step0.Instance); @@ -198,9 +198,9 @@ public async Task StepperPreventStepChangeIsInvokedWhenSkippingActiveStepTest() { // Arrange var preventStepChangeWasInvoked = false; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { preventStepChangeWasInvoked = true; @@ -208,10 +208,10 @@ public async Task StepperPreventStepChangeIsInvokedWhenSkippingActiveStepTest() }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step0.Instance); @@ -228,9 +228,9 @@ public async Task StepperPreventStepChangeIsNotInvokedWhenCompletingNonActiveSte { // Arrange var preventStepChangeWasInvoked = false; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { preventStepChangeWasInvoked = true; @@ -238,10 +238,10 @@ public async Task StepperPreventStepChangeIsNotInvokedWhenCompletingNonActiveSte }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step0.Instance, skipPreventProcess: true); @@ -258,9 +258,9 @@ public async Task StepperPreventStepChangeIsNotInvokedWhenSkippingNonActiveStepT { // Arrange var preventStepChangeWasInvoked = false; - var stepper = Context.RenderComponent( + var stepper = Context.RenderComponent( ComponentParameterFactory.Parameter( - nameof(MudStepper.PreventStepChangeAsync), + nameof(MudStepperExtended.PreventStepChangeAsync), new Func>((direction, targetIndex) => { preventStepChangeWasInvoked = true; @@ -268,10 +268,10 @@ public async Task StepperPreventStepChangeIsNotInvokedWhenSkippingNonActiveStepT }) ) ); - var step0 = Context.RenderComponent( + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(step0.Instance, true); @@ -287,11 +287,11 @@ public async Task StepperPreventStepChangeIsNotInvokedWhenSkippingNonActiveStepT public async Task StepperActiveIndexIsNotChangedWhenCompletingNonActiveStepTest() { // Arrange - var stepper = Context.RenderComponent(); - var step0 = Context.RenderComponent( + var stepper = Context.RenderComponent(); + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(stepper.Instance.Steps.IndexOf(step0.Instance)); @@ -307,11 +307,11 @@ public async Task StepperActiveIndexIsNotChangedWhenCompletingNonActiveStepTest( public async Task StepperActiveIndexIsNotChangedWhenSkippingNonActiveStepTest() { // Arrange - var stepper = Context.RenderComponent(); - var step0 = Context.RenderComponent( + var stepper = Context.RenderComponent(); + var step0 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); - var step1 = Context.RenderComponent( + var step1 = Context.RenderComponent( ComponentParameterFactory.CascadingValue(stepper.Instance) ); await stepper.Instance.SetActiveIndex(stepper.Instance.Steps.IndexOf(step0.Instance)); @@ -328,7 +328,7 @@ public async Task StepperCheckChangeCountTest() { // Arrange var comp = Context.RenderComponent(); - var stepper = comp.FindComponent(); + var stepper = comp.FindComponent(); comp.Instance.CheckChangeCount.Should().Be(0); await comp.InvokeAsync(() => stepper.Instance.SetActiveIndex(1)); diff --git a/CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor b/CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor index 27bab553..c3c8b8f6 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor +++ b/CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor @@ -21,7 +21,7 @@ ShowVisualiser="@((MultiSelection && SelectedValues?.Any() == true) || !Editable)" DataVisualiserStyle="min-height: 1.1876em" @bind-Value="@_searchString" Underline="@Underline" - Disabled="@Disabled" ReadOnly="@ReadOnly" Error="@Error" ErrorId="@ErrorId" + Disabled="@GetDisabledState()" ReadOnly="@GetReadOnlyState()" Error="@Error" ErrorId="@ErrorId" Clearable="@Clearable" ForceClearable="@(Clearable && HasValue(Value))" OnClearButtonClick="@ClearButtonClickHandlerAsync" @attributes="UserAttributes" OnBlur="@HandleOnBlur" ShrinkLabel="@(HasValue(Value) || _isOpen || ShrinkLabel)"> diff --git a/CodeBeam.MudBlazor.Extensions/Components/SelectExtended/MudSelectExtended.razor b/CodeBeam.MudBlazor.Extensions/Components/SelectExtended/MudSelectExtended.razor index 275408fc..f29cab43 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/SelectExtended/MudSelectExtended.razor +++ b/CodeBeam.MudBlazor.Extensions/Components/SelectExtended/MudSelectExtended.razor @@ -13,7 +13,7 @@ Variant="@Variant" TextUpdateSuppression="false" Value="@(Strict && !IsValueInList ? null : Text)" Underline="@Underline" - Disabled="@Disabled" ReadOnly="true" Error="@Error" ErrorId="@ErrorId" + Disabled="@GetDisabledState()" ReadOnly="true" Error="@Error" ErrorId="@ErrorId" Clearable="@Clearable" OnClearButtonClick="(async (e) => await SelectClearButtonClickHandlerAsync(e))" @attributes="UserAttributes" OnBlur="@OnLostFocus" ShrinkLabel="@ShrinkLabel" ShowVisualiser="true" DataVisualiserStyle="min-height: 1.1876em"> @@ -47,14 +47,14 @@ @if (ItemCollection != null) { - foreach (var item in ItemCollection.Where(x => SelectedValues.Contains(x))) + foreach (var item in ItemCollection.Where(x => SelectedValues?.Contains(x) == true)) { } } else { - foreach (var item in Items?.Where(x => SelectedValues.Contains(x.Value)) ?? new List>()) + foreach (var item in Items?.Where(x => SelectedValues?.Contains(x.Value) == true) ?? new List>()) { } diff --git a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStep.razor b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepExtended.razor similarity index 100% rename from CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStep.razor rename to CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepExtended.razor diff --git a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStep.razor.cs b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepExtended.razor.cs similarity index 81% rename from CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStep.razor.cs rename to CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepExtended.razor.cs index 48ce81d6..759b29d6 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStep.razor.cs +++ b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepExtended.razor.cs @@ -7,13 +7,13 @@ namespace MudExtensions /// /// /// - public partial class MudStep : MudComponentBase, IDisposable + public partial class MudStepExtended : MudComponentBase, IDisposable { /// /// /// protected string? Classname => new CssBuilder() - .AddClass("d-none", ((MudStepper.ActiveIndex < MudStepper.Steps.Count && MudStepper.Steps[MudStepper.ActiveIndex] != this) || (MudStepper.ShowResultStep() && !IsResultStep)) || (IsResultStep && !MudStepper.ShowResultStep())) + .AddClass("d-none", ((MudStepperExtended.ActiveIndex < MudStepperExtended.Steps.Count && MudStepperExtended.Steps[MudStepperExtended.ActiveIndex] != this) || (MudStepperExtended.ShowResultStep() && !IsResultStep)) || (IsResultStep && !MudStepperExtended.ShowResultStep())) .AddClass(Class) .Build(); @@ -21,7 +21,7 @@ public partial class MudStep : MudComponentBase, IDisposable /// /// [CascadingParameter] - public MudStepper MudStepper { get; set; } = new(); + public MudStepperExtended MudStepperExtended { get; set; } = new(); /// /// Step text to show on header. @@ -40,7 +40,7 @@ public int Order set { _order = value; - MudStepper?.ReorderSteps(); + MudStepperExtended?.ReorderSteps(); } } @@ -51,7 +51,7 @@ public bool IsActive { get { - return MudStepper?.ActiveIndex == this.Number; + return MudStepperExtended?.ActiveIndex == this.Number; } } @@ -109,7 +109,7 @@ public StepStatus Status /// /// [Parameter] - public RenderFragment? Template { get; set; } + public RenderFragment? Template { get; set; } /// /// @@ -124,7 +124,7 @@ protected override void OnInitialized() { base.OnInitialized(); - MudStepper.AddStep(this); + MudStepperExtended.AddStep(this); } /// @@ -143,7 +143,7 @@ public void Dispose() { try { - MudStepper?.RemoveStep(this); + MudStepperExtended?.RemoveStep(this); } catch (Exception) { } } diff --git a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepTemplate.razor b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepTemplate.razor similarity index 84% rename from CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepTemplate.razor rename to CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepTemplate.razor index f8b3e6ce..b77695d8 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepTemplate.razor +++ b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepTemplate.razor @@ -15,7 +15,7 @@ - @if (Step.MudStepper.GetActiveIndex() == @Step.MudStepper.Steps.IndexOf(@Step)) + @if (Step.MudStepperExtended.GetActiveIndex() == @Step.MudStepperExtended.Steps.IndexOf(@Step)) { @Step.Title @@ -33,7 +33,7 @@ - @if (Step.MudStepper.GetActiveIndex() == @Step.MudStepper.Steps.IndexOf(@Step)) + @if (Step.MudStepperExtended.GetActiveIndex() == @Step.MudStepperExtended.Steps.IndexOf(@Step)) { @Step.Title } diff --git a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepTemplate.razor.cs b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepTemplate.razor.cs similarity index 52% rename from CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepTemplate.razor.cs rename to CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepTemplate.razor.cs index 0b2bb83c..fb22a845 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepTemplate.razor.cs +++ b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepTemplate.razor.cs @@ -2,10 +2,20 @@ namespace MudExtensions { + /// + /// + /// public partial class MudStepTemplate : ComponentBase { + /// + /// + /// [Parameter] - public MudStep? Step { get; set; } + public MudStepExtended? Step { get; set; } + + /// + /// + /// public MudStepTemplate() : base() { diff --git a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepperExtended.razor similarity index 92% rename from CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor rename to CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepperExtended.razor index 49fe5126..fc318430 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor +++ b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepperExtended.razor @@ -6,9 +6,9 @@
@{ - MudStep? currentStep = null; + MudStepExtended? currentStep = null; } - @foreach (MudStep step in _steps) + @foreach (MudStepExtended step in _steps) { if (IsStepActive(step)) { @@ -51,7 +51,7 @@ @if (HeaderTextView == HeaderTextView.All || HeaderTextView == HeaderTextView.OnlyActiveText) { - @if (step.MudStepper.GetActiveIndex() == @step.MudStepper.Steps.IndexOf(@step)) + @if (step.MudStepperExtended.GetActiveIndex() == @step.MudStepperExtended.Steps.IndexOf(@step)) { @step.Title } @@ -82,7 +82,7 @@
@ChildContent
- @if (DisablePreviousButton == false || DisableNextButton == false || DisableSkipButton) + @if (ShowPreviousButton == true || ShowNextButton == true || ShowSkipButton == false) {
@@ -99,7 +99,7 @@ } } - @if (!DisablePreviousButton && ActiveIndex != 0) + @if (ShowPreviousButton && ActiveIndex != 0) { if (IconActionButtons || MobileView) { @@ -127,14 +127,14 @@ { if ((ActiveIndex < Steps.Count && Steps[ActiveIndex].Status != StepStatus.Continued) || (ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) { - if (!DisableStepResultIndicator && MobileView == false) + if (ShowStepResultIndicator && MobileView == false) { @(Steps[ActiveIndex].Status == StepStatus.Completed ? LocalizedStrings.Completed : LocalizedStrings.Skipped) } } else if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Optional == true) { - if (!DisableSkipButton) + if (ShowSkipButton) { if (IconActionButtons || MobileView) { @@ -151,7 +151,7 @@ } } - @if (showResultStep == false && !DisableNextButton && !(ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) + @if (showResultStep == false && ShowNextButton && !(ActiveIndex == Steps.Count - 1 && HasResultStep() == false && IsAllStepsCompleted())) { if (ActiveIndex < Steps.Count && Steps[ActiveIndex].Status != StepStatus.Continued) { @@ -187,7 +187,7 @@ -@if (DisableAnimation == false) +@if (Animation == true) { } diff --git a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor.cs b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepperExtended.razor.cs similarity index 96% rename from CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor.cs rename to CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepperExtended.razor.cs index 4baeba1f..e5ace384 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/Stepper/MudStepper.razor.cs +++ b/CodeBeam.MudBlazor.Extensions/Components/StepperExtended/MudStepperExtended.razor.cs @@ -9,7 +9,7 @@ namespace MudExtensions /// /// Stepper component with extended features. /// - public partial class MudStepper : MudComponentBase + public partial class MudStepperExtended : MudComponentBase { MudAnimate _animate = new(); Guid _animateGuid = Guid.NewGuid(); @@ -198,31 +198,31 @@ internal int ActiveIndex /// If true, disables the default animation on step changing. ///
[Parameter] - public bool DisableAnimation { get; set; } + public bool Animation { get; set; } = true; /// /// If true, disables built-in "previous" step action button. /// [Parameter] - public bool DisablePreviousButton { get; set; } + public bool ShowPreviousButton { get; set; } = true; /// /// If true, disables built-in "next" step action button. /// [Parameter] - public bool DisableNextButton { get; set; } + public bool ShowNextButton { get; set; } = true; /// /// If true, disables built-in "skip" step action button. /// [Parameter] - public bool DisableSkipButton { get; set; } + public bool ShowSkipButton { get; set; } = true; /// /// If true, disables built-in "completed"/"skipped" step result indictors shown in the actions panel. /// [Parameter] - public bool DisableStepResultIndicator { get; set; } + public bool ShowStepResultIndicator { get; set; } = true; /// /// @@ -318,12 +318,12 @@ internal int ActiveIndex [Parameter] public Func>? PreventStepChangeAsync { get; set; } - List _steps = new(); - List _allSteps = new(); + List _steps = new(); + List _allSteps = new(); /// /// /// - public List Steps + public List Steps { get => _steps; protected set @@ -340,7 +340,7 @@ protected set } } - internal void AddStep(MudStep step) + internal void AddStep(MudStepExtended step) { _allSteps.Add(step); if (!step.IsResultStep) @@ -360,7 +360,7 @@ public void ReorderSteps() Steps = Steps.OrderBy(x => x.Order).ToList(); } - internal void RemoveStep(MudStep step) + internal void RemoveStep(MudStepExtended step) { Steps.Remove(step); _allSteps.Remove(step); @@ -373,7 +373,7 @@ internal void RemoveStep(MudStep step) /// /// /// - protected internal async Task SetActiveIndex(MudStep step, bool skipPreventProcess = false) + protected internal async Task SetActiveIndex(MudStepExtended step, bool skipPreventProcess = false) { await SetActiveStepByIndex(Steps.IndexOf(step), skipPreventProcess: skipPreventProcess); } @@ -549,7 +549,7 @@ public async Task SkipStep(int index, bool moveToNextStep = true) /// /// /// - protected bool IsStepActive(MudStep step) + protected bool IsStepActive(MudStepExtended step) { return Steps.IndexOf(step) == ActiveIndex; } diff --git a/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor b/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor index 3835ebe5..46f27d4c 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor +++ b/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor @@ -33,9 +33,9 @@ Value="@Text" ValueChanged="(s) => SetTextAsync(s)" Placeholder="@Placeholder" - Disabled=@Disabled + Disabled="@GetDisabledState()" Underline="@Underline" - ReadOnly="@ReadOnly" + ReadOnly="@GetReadOnlyState()" MaxLength="@MaxLength" IconSize="@IconSize" Error="@Error"