Skip to content

Commit ba0f276

Browse files
authored
v8 Preparation (#484)
* v8 Preparation * Liitle Change
1 parent 848c36d commit ba0f276

32 files changed

+398
-448
lines changed

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="8.0.*" />
17-
<PackageReference Include="MudBlazor" Version="7.15.0" />
17+
<PackageReference Include="MudBlazor" Version="8.0.0-preview.4" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

CodeBeam.MudBlazor.Extensions.Docs/Pages/Index.razor

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

5252
<div class="d-flex justify-center my-4">
5353
<MudAutocomplete @bind-Value="_searchedComponent" @bind-Value:after="NavigateSelectedComponent" SearchFunc="@ComponentSearch" Class="search-style" Style="width: calc(50px + 50vw)" MinCharacters="1"
54-
Color="Color.Secondary" Variant="Variant.Outlined" Placeholder="What are you looking for?" Clearable="true" AdornmentIcon="@Icons.Material.Filled.Search"
54+
ProgressIndicatorColor="Color.Secondary" Variant="Variant.Outlined" Placeholder="What are you looking for?" Clearable="true" AdornmentIcon="@Icons.Material.Filled.Search"
5555
Adornment="Adornment.Start" AdornmentColor="Color.Secondary" ToStringFunc="@(e => e?.Component?.Name.Replace("`1", null))" MaxItems="null"
5656
HelperText='Write "mud" to see all. Also can search from labels - write "utility".'>
5757
<ItemTemplate>

CodeBeam.MudBlazor.Extensions.Docs/Shared/MainLayout.razor

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

127127
Typography = new Typography()
128128
{
129-
Default = new Default()
129+
Default = new DefaultTypography()
130130
{
131131
FontFamily = new[] { font, "Roboto", "Poppins", "Helvetica", "sans-serif" }
132132
},

CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithCustomComparerTest.razor

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

4747
class CoffeeComparer : IEqualityComparer<Coffee>
4848
{
49-
public bool Equals(Coffee a, Coffee b) => a.Key == b.Key;
49+
public bool Equals(Coffee? a, Coffee? b) => a?.Key == b?.Key;
5050
public int GetHashCode(Coffee x) => HashCode.Combine(x.Key);
5151
}
5252
}

CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/ReselectValueTest.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
string fruit = "Apple";
2020
public int ChangeCount { get; private set; }
2121

22-
void FruitChanged(IEnumerable<string> fruits)
22+
void FruitChanged(IEnumerable<string>? fruits)
2323
{
2424
ChangeCount++;
2525
}

CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectInitialValueTest.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
public static string __description__ = "Click should open the Menu and selecting a value should update the bindable value.";
1313

1414
[Parameter]
15-
public string SelectedValue { get; set; }
15+
public string? SelectedValue { get; set; }
1616
[Parameter]
17-
public IEnumerable<string> SelectedValues { get; set; }
17+
public IEnumerable<string?>? SelectedValues { get; set; }
1818
[Parameter]
1919
public bool MultiSelection { get; set; }
2020
}

CodeBeam.MudBlazor.Extensions.UnitTests/CodeBeam.MudBlazor.Extensions.UnitTests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="bunit" Version="1.27.17" />
12+
<PackageReference Include="bunit" Version="1.36.0" />
1313
<PackageReference Include="CodecovUploader" Version="0.7.2" />
14-
<PackageReference Include="FluentAssertions" Version="6.12.0" />
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
16-
<PackageReference Include="Moq" Version="4.20.70" />
17-
<PackageReference Include="NUnit" Version="4.1.0" />
18-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
19-
<PackageReference Include="NUnit.Analyzers" Version="4.1.0">
14+
<PackageReference Include="FluentAssertions" Version="6.12.2" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
16+
<PackageReference Include="Moq" Version="4.20.72" />
17+
<PackageReference Include="NUnit" Version="4.2.2" />
18+
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
19+
<PackageReference Include="NUnit.Analyzers" Version="4.4.0">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>

CodeBeam.MudBlazor.Extensions.UnitTests/Components/ComboboxTests.cs

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

CodeBeam.MudBlazor.Extensions.UnitTests/Components/ListExtendedTests.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -260,60 +260,60 @@ public async Task List_KeyboardNavigationTest()
260260
//Console.WriteLine(comp.Markup);
261261
var list = comp.FindComponent<MudListExtended<int>>().Instance;
262262

263-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "ArrowDown" }));
263+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "ArrowDown" }));
264264
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[0].Instance.IsActive.Should().BeTrue());
265265
comp.WaitForAssertion(() => list.SelectedValues.Should().BeNullOrEmpty());
266266

267-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "Enter" }));
267+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "Enter" }));
268268
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[0].Instance.IsActive.Should().BeTrue());
269269
comp.WaitForAssertion(() => list.SelectedValues.Should().ContainSingle());
270270
//Second item is functional, should skip.
271-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "ArrowDown" }));
271+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "ArrowDown" }));
272272
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[0].Instance.IsActive.Should().BeFalse());
273273
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[2].Instance.IsActive.Should().BeTrue());
274274
comp.WaitForAssertion(() => list.SelectedValues.Should().ContainSingle());
275275

276-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "NumpadEnter" }));
276+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "NumpadEnter" }));
277277
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[2].Instance.IsActive.Should().BeTrue());
278278
comp.WaitForAssertion(() => list.SelectedValues.Should().ContainInOrder(new int[] { 1, 3 }));
279279

280-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "ArrowDown" }));
281-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "ArrowDown" }));
282-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "Enter" }));
280+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "ArrowDown" }));
281+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "ArrowDown" }));
282+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "Enter" }));
283283
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[2].Instance.IsActive.Should().BeFalse());
284284
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[5].Instance.IsActive.Should().BeTrue());
285285
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(3));
286286
comp.WaitForAssertion(() => list.SelectedValues.Should().Contain(5));
287287

288-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "Enter" }));
288+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "Enter" }));
289289
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[5].Instance.IsActive.Should().BeTrue());
290290
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(2));
291291
comp.WaitForAssertion(() => list.SelectedValues.Should().Contain(3));
292292
//Last disabled item should not be active
293-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "End" }));
293+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "End" }));
294294
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[9].Instance.IsActive.Should().BeTrue());
295295

296-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "Home" }));
297-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "Enter" }));
296+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "Home" }));
297+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "Enter" }));
298298
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[0].Instance.IsActive.Should().BeTrue());
299299
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(1));
300300
comp.WaitForAssertion(() => list.SelectedValues.Should().NotContain(1));
301301

302-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "a", CtrlKey = true }));
302+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "a", CtrlKey = true }));
303303
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[0].Instance.IsActive.Should().BeTrue());
304304
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(7));
305305
comp.WaitForAssertion(() => list.SelectedValues.Should().NotContain(2));
306306

307-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "A", CtrlKey = true }));
307+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "A", CtrlKey = true }));
308308
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[0].Instance.IsActive.Should().BeTrue());
309309
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(0));
310310

311311
await comp.InvokeAsync(() => comp.FindAll("div.mud-list-item-extended")[5].Click());
312312
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(1));
313313
comp.WaitForAssertion(() => list.SelectedValues.Should().Contain(5));
314314

315-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "ArrowDown" }));
316-
await comp.InvokeAsync(() => list.HandleKeyDown(new KeyboardEventArgs() { Key = "Enter" }));
315+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "ArrowDown" }));
316+
await comp.InvokeAsync(() => list.HandleKeyDownAsync(new KeyboardEventArgs() { Key = "Enter" }));
317317
comp.WaitForAssertion(() => comp.FindComponents<MudListItemExtended<int>>()[6].Instance.IsActive.Should().BeTrue());
318318
comp.WaitForAssertion(() => list.SelectedValues.Should().HaveCount(2));
319319
comp.WaitForAssertion(() => list.SelectedValues.Should().Contain(6));

0 commit comments

Comments
 (0)