This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve component accessibility with aria attributes (#106) @LeonarddeR Fix for colspan with DetailTemplate (#105) @smokedlinq Fix for Filtering nullable inner object throws NRE [WASM] (#104) Updated Sample to Blazor 3.2.0 Preview 4
- Loading branch information
1 parent
60c070c
commit 879b5f2
Showing
13 changed files
with
242 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@page "/104" | ||
|
||
@using BlazorTable | ||
|
||
<h1>Issue #104</h1> | ||
|
||
<Table TableItem="Parent" Items="items"> | ||
<Column TableItem="Parent" Title="Inner value" Field="@(x => x.Child.Name)" Sortable="true" Filterable="true"> | ||
<Template> | ||
@if (@context?.Child?.Name == null) | ||
{ | ||
<text>N/A</text> | ||
} | ||
else | ||
{ | ||
@context.Child.Name | ||
} | ||
</Template> | ||
</Column> | ||
</Table> | ||
|
||
@code | ||
{ | ||
private List<Parent> items = new List<Parent>(); | ||
|
||
protected override void OnInitialized() | ||
{ | ||
for (int i = 0; i < 5; i++) | ||
{ | ||
items.Add(new Parent() { Name = i.ToString(), Child = new Child() { Name = i.ToString() } }); | ||
items.Add(new Parent() { Name = i.ToString() }); | ||
} | ||
} | ||
|
||
private class Parent | ||
{ | ||
public string Name { get; set; } | ||
|
||
public Child Child { get; set; } | ||
} | ||
|
||
private class Child | ||
{ | ||
public string Name { get; set; } | ||
|
||
public GrandChild GrandChild { get; set; } | ||
} | ||
|
||
private class GrandChild | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" /> | ||
<PackageReference Include="Shouldly" Version="3.0.2" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector" Version="1.2.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\BlazorTable\BlazorTable.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using Shouldly; | ||
using System; | ||
using System.Linq.Expressions; | ||
using Xunit; | ||
|
||
namespace BlazorTable.Tests | ||
{ | ||
public class Bug104 | ||
{ | ||
[Fact] | ||
public void AddToExisting() | ||
{ | ||
Expression<Func<Parent, bool>> query = x => ((x.Child.Name != null) && (x.Child.Name == "bob")); | ||
|
||
Expression<Func<Parent, bool>> queryfixed = x => ((x.Child != null) &&((x.Child.Name != null) && (x.Child.Name == "bob"))); | ||
|
||
query.AddNullChecks().ToString().ShouldBe(queryfixed.ToString()); | ||
} | ||
|
||
|
||
[Fact] | ||
public void NoParent() | ||
{ | ||
Expression<Func<Parent, bool>> query = x => x.Name != null; | ||
|
||
Expression<Func<Parent, bool>> queryfixed = x => x.Name != null; | ||
|
||
query.AddNullChecks().ToString().ShouldBe(queryfixed.ToString()); | ||
} | ||
|
||
[Fact] | ||
public void SingleParent() | ||
{ | ||
Expression<Func<Parent, bool>> query = x => x.Child.Name != null; | ||
|
||
Expression<Func<Parent, bool>> queryfixed = x => x.Child != null | ||
&& x.Child.Name != null; | ||
|
||
query.AddNullChecks().ToString().ShouldBe(queryfixed.ToString()); | ||
} | ||
|
||
[Fact] | ||
public void MultiParent() | ||
{ | ||
Expression<Func<Parent, bool>> query1 = x => x.Child.GrandChild.Name != null; | ||
|
||
Expression<Func<Parent, bool>> query1fixed = x => ((x.Child != null) | ||
&& ((x.Child.GrandChild != null) && (x.Child.GrandChild.Name != null))); | ||
|
||
query1.AddNullChecks().ToString().ShouldBe("x => ((x.Child != null) AndAlso ((x.Child.GrandChild != null) AndAlso (x.Child.GrandChild.Name != null)))"); | ||
} | ||
|
||
private class Parent | ||
{ | ||
public string Name { get; set; } | ||
|
||
public Child Child { get; set; } | ||
} | ||
|
||
private class Child | ||
{ | ||
public string Name { get; set; } | ||
|
||
public GrandChild GrandChild { get; set; } | ||
} | ||
|
||
private class GrandChild | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters