Skip to content

Commit c043a9f

Browse files
authored
DateWheelPicker Refactor (#399)
1 parent 941c1d1 commit c043a9f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

CodeBeam.MudBlazor.Extensions.Docs/Pages/Components/DateWheelPicker/Examples/DateWheelPickerExample1.razor

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
1717
}
1818
</MudSelect>
19-
<MudSwitch @bind-Value="_editable" Color="Color.Primary" Label="Editable" />
20-
<MudSwitch @bind-Value="_showToolbar" Color="Color.Primary" Label="Show Toolbar" />
21-
<MudSwitch @bind-Value="_showHeader" Color="Color.Primary" Label="Show Header" />
22-
<MudSwitch @bind-Value="_submitOnClose" Color="Color.Primary" Label="Submit On Close" />
19+
<MudSwitchM3 @bind-Value="_editable" Color="Color.Secondary" Label="Editable" />
20+
<MudSwitchM3 @bind-Value="_showToolbar" Color="Color.Secondary" Label="Show Toolbar" />
21+
<MudSwitchM3 @bind-Value="_showHeader" Color="Color.Secondary" Label="Show Header" />
22+
<MudSwitchM3 @bind-Value="_submitOnClose" Color="Color.Secondary" Label="Submit On Close" />
2323
<MudSelect @bind-Value="_color" Variant="Variant.Outlined" Label="Color">
2424
@foreach (Color item in Enum.GetValues<Color>())
2525
{
@@ -33,12 +33,12 @@
3333
}
3434
</MudSelect>
3535
<div class="d-flex flex-wrap">
36-
<MudCheckBox @bind-Value="_fixDay" Label="Fix Day" />
37-
<MudCheckBox @bind-Value="_fixMonth" Label="Fix Month" />
38-
<MudCheckBox @bind-Value="_fixYear" Label="Fix Year" />
39-
<MudCheckBox @bind-Value="_fixHour" Label="Fix Hour" />
40-
<MudCheckBox @bind-Value="_fixMinute" Label="Fix Minute" />
41-
<MudCheckBox @bind-Value="_fixSecond" Label="Fix Second" />
36+
<MudCheckBox @bind-Value="_fixDay" Label="Fix Day" Color="Color.Secondary" />
37+
<MudCheckBox @bind-Value="_fixMonth" Label="Fix Month" Color="Color.Secondary" />
38+
<MudCheckBox @bind-Value="_fixYear" Label="Fix Year" Color="Color.Secondary" />
39+
<MudCheckBox @bind-Value="_fixHour" Label="Fix Hour" Color="Color.Secondary" />
40+
<MudCheckBox @bind-Value="_fixMinute" Label="Fix Minute" Color="Color.Secondary" />
41+
<MudCheckBox @bind-Value="_fixSecond" Label="Fix Second" Color="Color.Secondary" />
4242
</div>
4343
<MudTextField @bind-Value="_dateFormat" Variant="Variant.Outlined" Label="Date Format" />
4444
<MudButton OnClick="@(() => _date = DateTime.Now)">Set Today</MudButton>

CodeBeam.MudBlazor.Extensions/Components/DateWheelPicker/MudDateWheelPicker.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<MudInputControl Label="@Label" Variant="@Variant" HelperText="@HelperText" HelperTextOnFocus="@HelperTextOnFocus" FullWidth="@FullWidth" Margin="@Margin" Class="@Classname" Style="@Style"
77
Error="@Error" ErrorText="@ErrorText" ErrorId="@ErrorId" Disabled="@Disabled" @onclick="@(Editable ? null : ToggleMenu)" Required="@Required" ForId="@FieldId">
88
<InputContent>
9-
<MudInput @ref="InputReference" Margin="@Margin" Placeholder="@Placeholder"
9+
<MudInput @ref="InputReference" Margin="@Margin" Placeholder="@Placeholder" Label="@Label"
1010
Variant="@Variant" InputType="InputType.Text"
1111
TextUpdateSuppression="false"
1212
Value="@(Text)" Underline="@Underline"
@@ -72,4 +72,4 @@
7272

7373
</CascadingValue>
7474
<!-- mousedown instead of click needed to close the menu before OnLostFocus runs -->
75-
<MudOverlay Visible="_isOpen" @onmousedown="@(() => CloseMenu(SubmitOnClose))" LockScroll="@LockScroll" />
75+
<MudOverlay Visible="_isOpen" @onpointerdown="@(() => CloseMenu(SubmitOnClose))" LockScroll="@LockScroll" />

CodeBeam.MudBlazor.Extensions/Components/DateWheelPicker/MudDateWheelPicker.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected override void OnInitialized()
3434
/// <summary>
3535
///
3636
/// </summary>
37-
public MudInput<string?> InputReference { get; private set; }
37+
public MudInput<string?> InputReference { get; private set; } = new();
3838

3939
[CascadingParameter(Name = "Standalone")]
4040
internal bool StandaloneEx { get; set; } = true;

0 commit comments

Comments
 (0)