From fb805d9f495fb844c882d6176770ae33a6556c32 Mon Sep 17 00:00:00 2001
From: Ivan Josipovic <9521987+IvanJosipovic@users.noreply.github.com>
Date: Tue, 22 Oct 2019 21:52:16 -0700
Subject: [PATCH 1/3] Added nuget download count
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 347f1210..ae86d326 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# BlazorTable
[![Demo](https://img.shields.io/badge/Live-Demo-Blue?style=flat-square)](https://BlazorTable.netlify.com/)
[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/BlazorTable.svg?style=flat-square)](https://www.nuget.org/packages/BlazorTable)
+[![Nuget (with prereleases)](https://img.shields.io/nuget/dt/BlazorTable.svg?style=flat-square)](https://www.nuget.org/packages/BlazorTable)
![](https://github.com/IvanJosipovic/BlazorTable/workflows/CI/CD/badge.svg)
**Work in progress!**
From 95a4422639a1b9309d3b04582197013a2ed5921e Mon Sep 17 00:00:00 2001
From: Ivan Josipovic <9521987+IvanJosipovic@users.noreply.github.com>
Date: Wed, 23 Oct 2019 08:26:23 -0700
Subject: [PATCH 2/3] removed IFilterManager
---
src/BlazorTable/Components/Column.razor | 5 +-
src/BlazorTable/Components/Column.razor.cs | 3 +-
.../Components/FilterManager.razor | 2 +-
.../Components/FilterManager.razor.cs | 5 +-
src/BlazorTable/Filters/BooleanFilter.razor | 2 +-
.../Filters/BooleanFilter.razor.cs | 51 ++++-----
src/BlazorTable/Filters/NumberFilter.razor | 2 +-
src/BlazorTable/Filters/NumberFilter.razor.cs | 100 +++++++++---------
src/BlazorTable/Filters/StringFilter.razor | 2 +-
src/BlazorTable/Filters/StringFilter.razor.cs | 74 ++++++-------
src/BlazorTable/Interfaces/IColumn.cs | 13 ++-
src/BlazorTable/Interfaces/IFilter.cs | 3 +-
src/BlazorTable/Interfaces/IFilterManager.cs | 13 ---
13 files changed, 133 insertions(+), 142 deletions(-)
delete mode 100644 src/BlazorTable/Interfaces/IFilterManager.cs
diff --git a/src/BlazorTable/Components/Column.razor b/src/BlazorTable/Components/Column.razor
index 64d40abc..f3cdfc74 100644
--- a/src/BlazorTable/Components/Column.razor
+++ b/src/BlazorTable/Components/Column.razor
@@ -10,7 +10,10 @@
- @*@this.CustomIFilters(this)*@
+ @if (this.CustomIFilters != null)
+ {
+ this.CustomIFilters(this);
+ }
diff --git a/src/BlazorTable/Components/Column.razor.cs b/src/BlazorTable/Components/Column.razor.cs
index a9610122..cc175207 100644
--- a/src/BlazorTable/Components/Column.razor.cs
+++ b/src/BlazorTable/Components/Column.razor.cs
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Components;
using System;
-using System.Linq;
using System.Linq.Expressions;
namespace BlazorTable
@@ -50,7 +49,7 @@ public string Title
public Type Type { get; private set; }
- public IFilterManager FilterManager { get; set; }
+ public IFilter FilterControl { get; set; }
public void Dispose()
{
diff --git a/src/BlazorTable/Components/FilterManager.razor b/src/BlazorTable/Components/FilterManager.razor
index ffa83bff..5e161d5b 100644
--- a/src/BlazorTable/Components/FilterManager.razor
+++ b/src/BlazorTable/Components/FilterManager.razor
@@ -1,7 +1,7 @@
@namespace BlazorTable
@typeparam TableItem
-
+
@ChildContent
diff --git a/src/BlazorTable/Components/FilterManager.razor.cs b/src/BlazorTable/Components/FilterManager.razor.cs
index 0f47abec..6fc0a02d 100644
--- a/src/BlazorTable/Components/FilterManager.razor.cs
+++ b/src/BlazorTable/Components/FilterManager.razor.cs
@@ -3,7 +3,7 @@
namespace BlazorTable
{
- public partial class FilterManager : IFilterManager
+ public partial class FilterManager
{
[CascadingParameter(Name = "Column")] public IColumn Column { get; set; }
@@ -15,7 +15,6 @@ public partial class FilterManager : IFilterManager
protected override void OnInitialized()
{
- Column.FilterManager = this;
}
private void ApplyFilter()
@@ -23,7 +22,7 @@ private void ApplyFilter()
Column.ToggleFilter();
if (Filter != null)
{
- Filter.ApplyFilter();
+ Column.Filter = Filter.GetFilter();
Column.Table.Update();
Column.Table.FirstPage();
}
diff --git a/src/BlazorTable/Filters/BooleanFilter.razor b/src/BlazorTable/Filters/BooleanFilter.razor
index 96bd214d..d9ef07ae 100644
--- a/src/BlazorTable/Filters/BooleanFilter.razor
+++ b/src/BlazorTable/Filters/BooleanFilter.razor
@@ -1,7 +1,7 @@
@namespace BlazorTable
@typeparam TableItem
-@if (FilterTypes.Contains(FilterManager.Column.Type.GetNonNullableType()))
+@if (FilterTypes.Contains(Column.Type.GetNonNullableType()))
{