Skip to content

Commit

Permalink
Upgrade Mud Core 7.0.0-preview.3 (#397)
Browse files Browse the repository at this point in the history
* Upgrade Mud Core 7.0.0-preview.3

* More Fixes

* Fix Tests
  • Loading branch information
mckaragoz authored May 16, 2024
1 parent 51d5adc commit 4de4602
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.*" />
<PackageReference Include="MudBlazor" Version="7.0.0-preview.1" />
<PackageReference Include="MudBlazor" Version="7.0.0-preview.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@inherits MudComponentBase
@namespace MudExtensions.Docs.Components

<MudText Inline="true" Class="px-2" Typo="Typo.body2" Style="background-color: #ff4081; color: white; border-radius: 20px">@ChildContent</MudText>
<MudText HtmlTag="span" Class="px-2" Typo="Typo.body2" Style="background-color: #ff4081; color: white; border-radius: 20px">@ChildContent</MudText>

@code{
[Parameter]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<MudText>Values:
@foreach (var item in _values ?? new List<string>())
{
<MudText Inline="true"> @(" " + item + " ") </MudText>
<MudText HtmlTag="span"> @(" " + item + " ") </MudText>
}
</MudText>
<MudTextField @bind-Value="@_delimiter" Immediate="true" Label="Delimiter" Variant="Variant.Outlined" Margin="Margin.Dense" />
Expand Down
6 changes: 3 additions & 3 deletions CodeBeam.MudBlazor.Extensions/Base/MudBaseInputExtended.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ protected override bool SetConverter(MudBlazor.Converter<T, string> value)
{
var changed = base.SetConverter(value);
if (changed)
UpdateTextPropertyAsync(false).AndForget(); // refresh only Text property from current Value
UpdateTextPropertyAsync(false).CatchAndLog(); // refresh only Text property from current Value

return changed;
}
Expand All @@ -490,7 +490,7 @@ protected override bool SetCulture(CultureInfo value)
{
var changed = base.SetCulture(value);
if (changed)
UpdateTextPropertyAsync(false).AndForget(); // refresh only Text property from current Value
UpdateTextPropertyAsync(false).CatchAndLog(); // refresh only Text property from current Value

return changed;
}
Expand All @@ -517,7 +517,7 @@ protected virtual bool SetFormat(string? value)
if (changed)
{
((Converter<T>)Converter).Format = value;
UpdateTextPropertyAsync(false).AndForget(); // refresh only Text property from current Value
UpdateTextPropertyAsync(false).CatchAndLog(); // refresh only Text property from current Value
}
return changed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageReference Include="CsvHelper" Version="31.0.3" />
<PackageReference Include="MudBlazor" Version="7.0.0-preview.1" />
<PackageReference Include="MudBlazor" Version="7.0.0-preview.3" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public T? Value
return;
}
_theValue = value;
SetValueFromOutside(_theValue).AndForget();
SetValueFromOutside(_theValue).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ public IEnumerable<T?> SelectedValues

_selectedValues = new HashSet<T?>(set, _comparer);

SelectedValuesChanged.InvokeAsync(new HashSet<T?>(SelectedValues, _comparer)).AndForget();
ForceUpdateItems().AndForget();
SelectedValuesChanged.InvokeAsync(new HashSet<T?>(SelectedValues, _comparer)).CatchAndLog();
ForceUpdateItems().CatchAndLog();
//Console.WriteLine("SelectedValues setter ended");
}
}
Expand Down Expand Up @@ -775,7 +775,7 @@ protected override void OnInitialized()
else if (MultiSelection && SelectedValues != null)
{
// TODO: Check this line again
SetValueAsync(SelectedValues.FirstOrDefault()).AndForget();
SetValueAsync(SelectedValues.FirstOrDefault()).CatchAndLog();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void SetTimer()

private void OnTimerTick(object? sender, ElapsedEventArgs e)
{
InvokeAsync(OnTimerTickGuiThread).AndForget();
InvokeAsync(OnTimerTickGuiThread).CatchAndLog();
}

private async Task OnTimerTickGuiThread()
Expand All @@ -127,7 +127,7 @@ private void ClearTimer(bool suppressTick = false)
_timer.Dispose();
_timer = null;
if (wasEnabled && !suppressTick)
OnTimerTickGuiThread().AndForget();
OnTimerTickGuiThread().CatchAndLog();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public T? SelectedValue

_selectedValue = value;
HandleCentralValueCommander(nameof(SelectedValue));
SelectedValueChanged.InvokeAsync(_selectedValue).AndForget();
SelectedValueChanged.InvokeAsync(_selectedValue).CatchAndLog();
}
}

Expand Down Expand Up @@ -588,7 +588,7 @@ public IEnumerable<T?>? SelectedValues
return;
}
HandleCentralValueCommander(nameof(SelectedValues));
SelectedValuesChanged.InvokeAsync(SelectedValues == null ? null : new HashSet<T?>(SelectedValues, _comparer)).AndForget();
SelectedValuesChanged.InvokeAsync(SelectedValues == null ? null : new HashSet<T?>(SelectedValues, _comparer)).CatchAndLog();
}
}

Expand Down Expand Up @@ -617,7 +617,7 @@ public MudListItemExtended<T?>? SelectedItem
return;
}
HandleCentralValueCommander(nameof(SelectedItem));
SelectedItemChanged.InvokeAsync(_selectedItem).AndForget();
SelectedItemChanged.InvokeAsync(_selectedItem).CatchAndLog();
}
}

Expand Down Expand Up @@ -652,7 +652,7 @@ public IEnumerable<MudListItemExtended<T?>>? SelectedItems
return;
}
HandleCentralValueCommander(nameof(SelectedItems));
SelectedItemsChanged.InvokeAsync(_selectedItems).AndForget();
SelectedItemsChanged.InvokeAsync(_selectedItems).CatchAndLog();
}
}

Expand Down Expand Up @@ -716,7 +716,7 @@ public override Task SetParametersAsync(ParameterView parameters)
return Task.CompletedTask;
}

base.SetParametersAsync(parameters).AndForget();
base.SetParametersAsync(parameters).CatchAndLog();

_setParametersDone = true;
return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ protected void OnClickHandler(MouseEventArgs ev)

if (OnClickHandlerPreventDefault)
{
OnClick.InvokeAsync(ev).AndForget();
OnClick.InvokeAsync(ev).CatchAndLog();
return;
}

Expand All @@ -410,13 +410,13 @@ protected void OnClickHandler(MouseEventArgs ev)
else if (Href != null)
{
MudListExtended?.SetSelectedValue(this);
OnClick.InvokeAsync(ev).AndForget();
OnClick.InvokeAsync(ev).CatchAndLog();
NavigationManager?.NavigateTo(Href, ForceLoad);
}
else if (MudListExtended?.Clickable == true || MudListExtended?.MultiSelection == true)
{
MudListExtended?.SetSelectedValue(this);
OnClick.InvokeAsync(ev).AndForget();
OnClick.InvokeAsync(ev).CatchAndLog();
}
}

Expand All @@ -426,7 +426,7 @@ protected void OnClickHandler(MouseEventArgs ev)
/// <param name="ev"></param>
protected void OnlyOnClick(MouseEventArgs ev)
{
OnClick.InvokeAsync(ev).AndForget();
OnClick.InvokeAsync(ev).CatchAndLog();
}

private Typo _textTypo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public bool Loading
return;
}
_loading = value;
LoadingChanged.InvokeAsync(_loading).AndForget();
LoadingChanged.InvokeAsync(_loading).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public bool Loading
return;
}
_loading = value;
LoadingChanged.InvokeAsync(_loading).AndForget();
LoadingChanged.InvokeAsync(_loading).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public bool PasswordMode
_passwordIcon = Icons.Material.Filled.Visibility;
}

PasswordModeChanged.InvokeAsync(value).AndForget();
PasswordModeChanged.InvokeAsync(value).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public bool Open
return;
}
_open = value;
OpenChanged.InvokeAsync(_open).AndForget();
OpenChanged.InvokeAsync(_open).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public bool MultiSelection
if (value != _multiSelection)
{
_multiSelection = value;
UpdateTextPropertyAsync(false).AndForget();
UpdateTextPropertyAsync(false).CatchAndLog();
}
}
}
Expand Down Expand Up @@ -544,15 +544,15 @@ public IEnumerable<T?>? SelectedValues
SelectionChangedFromOutside?.Invoke(new HashSet<T?>(_selectedValues, _comparer));
if (!MultiSelection)
{
SetValueAsync(_selectedValues.FirstOrDefault()).AndForget();
SetValueAsync(_selectedValues.FirstOrDefault()).CatchAndLog();
}
else
{
SetValueAsync(_selectedValues.LastOrDefault(), false).AndForget();
UpdateTextPropertyAsync(false).AndForget();
SetValueAsync(_selectedValues.LastOrDefault(), false).CatchAndLog();
UpdateTextPropertyAsync(false).CatchAndLog();
}

SelectedValuesChanged.InvokeAsync(new HashSet<T?>(SelectedValues, _comparer)).AndForget();
SelectedValuesChanged.InvokeAsync(new HashSet<T?>(SelectedValues, _comparer)).CatchAndLog();
_selectedValuesSetterStarted = false;
//Console.WriteLine("SelectedValues setter ended");
}
Expand Down Expand Up @@ -646,7 +646,7 @@ protected override Task UpdateValuePropertyAsync(bool updateText)
{
// For MultiSelection of non-string T's we don't update the Value!!!
//if (typeof(T) == typeof(string) || !MultiSelection)
base.UpdateValuePropertyAsync(updateText).AndForget();
base.UpdateValuePropertyAsync(updateText).CatchAndLog();
return Task.CompletedTask;
}

Expand Down Expand Up @@ -739,7 +739,7 @@ protected override void OnInitialized()
else if (MultiSelection && SelectedValues != null)
{
// TODO: Check this line again
SetValueAsync(SelectedValues.FirstOrDefault()).AndForget();
SetValueAsync(SelectedValues.FirstOrDefault()).CatchAndLog();
}
}

Expand Down Expand Up @@ -1073,7 +1073,7 @@ public async Task SelectOption(object? obj)

await SetValueAsync(value);
//await UpdateTextPropertyAsync(false);
_elementReference.SetText(Text).AndForget();
_elementReference.SetText(Text).CatchAndLog();
//_selectedValues.Clear();
//_selectedValues.Add(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ protected string? DisplayString
protected void HandleOnClick()
{
// Selection works on list. We arrange only popover state and some minor arrangements on click.
MudSelectExtended?.SelectOption(Value).AndForget();
MudSelectExtended?.SelectOption(Value).CatchAndLog();
InvokeAsync(StateHasChanged);
if (!MultiSelection)
{
MudSelectExtended?.CloseMenu().AndForget();
MudSelectExtended?.CloseMenu().CatchAndLog();
}
else
{
MudSelectExtended?.FocusAsync().AndForget();
MudSelectExtended?.FocusAsync().CatchAndLog();
}
OnClick.InvokeAsync().AndForget();
OnClick.InvokeAsync().CatchAndLog();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public StepStatus Status
return;
}
_status = value;
StatusChanged.InvokeAsync(_status).AndForget();
StatusChanged.InvokeAsync(_status).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public bool Toggled
return;
}
_toggled = value;
ToggledChanged.InvokeAsync().AndForget();
ToggledChanged.InvokeAsync().CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
else
{
<MudText Typo="@Typo" Color="@Color" Align="Align.Center">@GetWatchText() <MudText Inline="true" Typo="@TypoMillisecond">@($"{(ShowMillisecond ? _milliSecond.ToString("D3") : null)}")</MudText></MudText>
<MudText Typo="@Typo" Color="@Color" Align="Align.Center">@GetWatchText() <MudText HtmlTag="span" Typo="@TypoMillisecond">@($"{(ShowMillisecond ? _milliSecond.ToString("D3") : null)}")</MudText></MudText>
}
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected override void OnInitialized()

if (Mode == WatchMode.Watch)
{
SetWatchMode(Mode).AndForget();
SetWatchMode(Mode).CatchAndLog();
Start();
}
if (Mode == WatchMode.StopWatch)
Expand All @@ -69,7 +69,7 @@ public TimeSpan Value
return;
}
_value = value;
InvokeAsync(() => ValueChanged.InvokeAsync(_value)).AndForget();
InvokeAsync(() => ValueChanged.InvokeAsync(_value)).CatchAndLog();
SetInternalValues();
}
}
Expand Down Expand Up @@ -110,7 +110,7 @@ public WatchMode Mode
return;
}
_watchMode = value;
SetWatchMode(_watchMode).AndForget();
SetWatchMode(_watchMode).CatchAndLog();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ $typography-sizes: ("large", "medium", "small");
}
}
}

.mud-typography-display-inline {
display: inline;
}
3 changes: 3 additions & 0 deletions CodeBeam.MudBlazor.Extensions/Styles/MudExtensions.css
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,9 @@
letter-spacing: var(--mud-typographym3-label-small-tracking);
font-weight: var(--mud-typographym3-label-small-weight); }

.mud-typography-display-inline {
display: inline; }

/*@import '../abstracts/variables';*/
.mud-list-extended {
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion CodeBeam.MudBlazor.Extensions/Styles/MudExtensions.min.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 4de4602

Please sign in to comment.