Skip to content

Commit a2ffc22

Browse files
anth12mckaragoz
andauthored
Updated MudBlazor to 9.0.0-preview.2 (#589)
* Updated MudBlazor to 9.0.0-preview.2 * Implementing GetDefaultConverter in MudCodeInput * Removed custom Identifier to use MudBlazors * Updated preview version no. * Fix MudWheel --------- Co-authored-by: Mehmet Can Karagöz <m.cankaragoz@outlook.com>
1 parent 6708197 commit a2ffc22

File tree

8 files changed

+22
-81
lines changed

8 files changed

+22
-81
lines changed

docs/CodeBeam.MudBlazor.Extensions.Docs.Wasm/wwwroot/CodeBeam.MudBlazor.Extensions.xml

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/CodeBeam.MudBlazor.Extensions.Docs/CodeBeam.MudBlazor.Extensions.Docs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.*" />
17-
<PackageReference Include="MudBlazor" Version="9.0.0-preview.1" />
17+
<PackageReference Include="MudBlazor" Version="9.0.0-preview.2" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/CodeBeam.MudBlazor.Extensions/Base/Identifier.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/CodeBeam.MudBlazor.Extensions/Base/MudBaseInputExtended.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using Microsoft.AspNetCore.Components;
2-
using Microsoft.AspNetCore.Components.Web;
32
using Microsoft.JSInterop;
43
using MudBlazor;
5-
using MudExtensions.Base;
64

75
namespace MudExtensions
86
{

src/CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
88
<PackageReadmeFile>README.md</PackageReadmeFile>
9-
<Version>9.0.0-preview.3</Version>
9+
<Version>9.0.0-preview.4</Version>
1010
<Title>CodeBeam.MudBlazor.Extensions</Title>
1111
<PackageId>CodeBeam.MudBlazor.Extensions</PackageId>
1212
<Authors>CodeBeam</Authors>
@@ -41,7 +41,7 @@
4141
</ItemGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="MudBlazor" Version="9.0.0-preview.1" />
44+
<PackageReference Include="MudBlazor" Version="9.0.0-preview.2" />
4545
</ItemGroup>
4646

4747
<Target Name="MinifyMudExtensionsJs" AfterTargets="Build" Condition="'$(CI)' != 'true'

src/CodeBeam.MudBlazor.Extensions/Components/CodeInput/MudCodeInput.razor.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.AspNetCore.Components.Web;
33
using MudBlazor;
44
using MudBlazor.Extensions;
5-
using MudBlazor.Interfaces;
65
using MudBlazor.State;
76
using MudBlazor.Utilities;
87

@@ -19,12 +18,6 @@ public partial class MudCodeInput<T> : MudFormComponent<T, string>
1918
/// </summary>
2019
public MudCodeInput()
2120
{
22-
Converter = new DefaultConverter<T>
23-
{
24-
Culture = GetCulture,
25-
Format = GetFormat
26-
};
27-
2821
using var registerScope = CreateRegisterScope();
2922
_theValue = registerScope.RegisterParameter<T?>(nameof(Value))
3023
.WithParameter(() => Value)
@@ -319,10 +312,22 @@ public async Task SetValueFromOutside(T? value)
319312
}
320313
else
321314
{
322-
await _elementReferences[i].SetText(null);
315+
await _elementReferences[i].SetText(string.Empty);
323316
}
324317
}
325318
}
326319

320+
/// <summary>
321+
///
322+
/// </summary>
323+
/// <returns></returns>
324+
protected override IConverter<T?, string?> GetDefaultConverter()
325+
{
326+
return new DefaultConverter<T>
327+
{
328+
Culture = GetCulture,
329+
Format = GetFormat
330+
};
331+
}
327332
}
328333
}

src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
if (0 <= index - a)
2020
{
2121
<div class="@OuterItemClassname(index - a)" @onclick="@(async() => await ChangeWheel(-a))">
22-
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index - a]) : Converter.Convert(ItemCollection[index - a]))</MudText>
22+
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index - a]) : ConvertSet(ItemCollection[index - a]))</MudText>
2323
</div>
2424
}
2525
else
@@ -31,7 +31,7 @@
3131
<span class="@BorderClassname" />
3232

3333
<div class="@MiddleItemClassname">
34-
<MudText Class="@($"mud-wheel-ani-{_animateGuid} my-2)")" Typo="@(Dense ? Typo.body1 : Typo.h6)" Color="@Color" Style="font-weight: 900">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index]) : Converter.Convert(ItemCollection[index]))</MudText>
34+
<MudText Class="@($"mud-wheel-ani-{_animateGuid} my-2)")" Typo="@(Dense ? Typo.body1 : Typo.h6)" Color="@Color" Style="font-weight: 900">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index]) : ConvertSet(ItemCollection[index]))</MudText>
3535
</div>
3636

3737
<div class="@BorderClassname" />
@@ -42,7 +42,7 @@
4242
if (index + a < ItemCollection?.Count)
4343
{
4444
<div class="@OuterItemClassname(index + a)" @onclick="@(async() => await ChangeWheel(a))">
45-
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index + a]) : Converter.Convert(ItemCollection[index + a]))</MudText>
45+
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index + a]) : ConvertSet(ItemCollection[index + a]))</MudText>
4646
</div>
4747
}
4848
else

src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public partial class MudWheel<T> : MudBaseInput<T>
7575
///
7676
/// </summary>
7777
[Parameter]
78-
public List<T?>? ItemCollection { get; set; }
78+
public List<T?> ItemCollection { get; set; } = new();
7979

8080
/// <summary>
8181
/// Determines how many items will show before and after the middle one.
@@ -282,5 +282,7 @@ public async Task RefreshAnimate()
282282
/// </summary>
283283
/// <returns></returns>
284284
protected int GetAnimateValue() => Dense ? 24 : 42;
285+
286+
285287
}
286288
}

0 commit comments

Comments
 (0)