Skip to content

Commit

Permalink
feat(blazorui): add missing ClassBuilder resets to date pickers #6086 (
Browse files Browse the repository at this point in the history
  • Loading branch information
msynk authored Nov 21, 2023
1 parent a753acd commit fe818d7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public partial class BitDatePicker
private bool IsOpenHasBeenSet;

private bool isOpen;
private bool isUnderlined;
private bool hasBorder = true;
private CultureInfo culture = CultureInfo.CurrentUICulture;
private BitIconLocation iconLocation = BitIconLocation.Right;

Expand Down Expand Up @@ -121,8 +123,6 @@ private int _minuteView
private ElementReference _inputTimeHourRef = default!;
private ElementReference _inputTimeMinuteRef = default!;



[Inject] private IJSRuntime _js { get; set; } = default!;


Expand Down Expand Up @@ -231,8 +231,18 @@ public CultureInfo Culture
/// <summary>
/// Determines if the DatePicker has a border.
/// </summary>
[Parameter] public bool HasBorder { get; set; } = true;
[Parameter]
public bool HasBorder
{
get => hasBorder;
set
{
if (value == hasBorder) return;

hasBorder = value;
ClassBuilder.Reset();
}
}
/// <summary>
/// Whether the month picker should highlight the current month.
/// </summary>
Expand Down Expand Up @@ -306,7 +316,18 @@ public bool IsOpen
/// <summary>
/// Whether or not the text field of the DatePicker is underlined.
/// </summary>
[Parameter] public bool IsUnderlined { get; set; }
[Parameter]
public bool IsUnderlined
{
get => isUnderlined;
set
{
if (value == isUnderlined) return;

isUnderlined = value;
ClassBuilder.Reset();
}
}

/// <summary>
/// The text of the DatePicker's label.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public partial class BitDateRangePicker
private bool IsOpenHasBeenSet;

private bool isOpen;
private bool isUnderlined;
private bool hasBorder = true;
private CultureInfo culture = CultureInfo.CurrentUICulture;
private BitIconLocation iconLocation = BitIconLocation.Right;

Expand Down Expand Up @@ -279,8 +281,18 @@ public CultureInfo Culture
/// <summary>
/// Determines if the DateRangePicker has a border.
/// </summary>
[Parameter] public bool HasBorder { get; set; } = true;
[Parameter]
public bool HasBorder
{
get => hasBorder;
set
{
if (value == hasBorder) return;

hasBorder = value;
ClassBuilder.Reset();
}
}
/// <summary>
/// Whether the month picker should highlight the current month.
/// </summary>
Expand Down Expand Up @@ -354,7 +366,18 @@ public bool IsOpen
/// <summary>
/// Whether or not the Text field of the DateRangePicker is underlined.
/// </summary>
[Parameter] public bool IsUnderlined { get; set; }
[Parameter]
public bool IsUnderlined
{
get => isUnderlined;
set
{
if (value == isUnderlined) return;

isUnderlined = value;
ClassBuilder.Reset();
}
}

/// <summary>
/// The text of the DateRangePicker's label.
Expand Down

0 comments on commit fe818d7

Please sign in to comment.