Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@namespace BootstrapBlazor.Components
@inherits MultipleFilterBase
@inherits FilterBase

@if (IsHeaderRow)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace BootstrapBlazor.Components;

/// <summary>
///
/// DataTime filter component
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Typo in summary: 'DataTime' should be 'DateTime'

Suggested change
/// DataTime filter component
/// DateTime filter component

/// </summary>
public partial class DateTimeFilter
{
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Filters/EnumFilter.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@namespace BootstrapBlazor.Components
@inherits MultipleFilterBase
@inherits FilterBase

@if (IsHeaderRow)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Filters/EnumFilter.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// 枚举类型过滤组件
/// Enum filter component
/// </summary>
public partial class EnumFilter
{
Expand Down
12 changes: 12 additions & 0 deletions src/BootstrapBlazor/Components/Filters/FilterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ public abstract class FilterBase : BootstrapModuleComponentBase, IFilterAction
[Parameter]
public bool IsHeaderRow { get; set; }

/// <summary>
/// 获得/设置 条件数量
/// </summary>
[Parameter]
public int Count { get; set; }

/// <summary>
/// 获得/设置 多个条件逻辑关系符号
/// </summary>
protected FilterLogic Logic { get; set; }

/// <summary>
/// 获得/设置 所属 TableFilter 实例
/// </summary>
Expand Down Expand Up @@ -68,6 +79,7 @@ protected override void OnParametersSet()
{
FieldKey = FilterContext.FieldKey;
IsHeaderRow = FilterContext.IsHeaderRow;
Count = FilterContext.Count;
}
}

Expand Down
26 changes: 3 additions & 23 deletions src/BootstrapBlazor/Components/Filters/MultipleFilterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,11 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// 多条件过滤器基类
/// Multiple filter base class
/// </summary>
[Obsolete("Deprecated. Please use FilterBase class. 已弃用 请使用 FilterBase 类")]
[ExcludeFromCodeCoverage]
public abstract class MultipleFilterBase : FilterBase
{
/// <summary>
/// 获得/设置 条件数量
/// </summary>
[Parameter]
public int Count { get; set; }

/// <summary>
/// 获得/设置 多个条件逻辑关系符号
/// </summary>
protected FilterLogic Logic { get; set; }

/// <summary>
/// <inheritdoc/>
/// </summary>
protected override void OnParametersSet()
{
base.OnParametersSet();

if (FilterContext != null)
{
Count = FilterContext.Count;
}
}
}
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Filters/NumberFilter.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@namespace BootstrapBlazor.Components
@typeparam TType
@inherits MultipleFilterBase
@inherits FilterBase

@if (IsHeaderRow)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// NumberFilter 组件
/// NumberFilter component
/// </summary>
public partial class NumberFilter<TType>
{
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Filters/StringFilter.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@namespace BootstrapBlazor.Components
@inherits MultipleFilterBase
@inherits FilterBase

@if (IsHeaderRow)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace BootstrapBlazor.Components;

/// <summary>
/// StringFilter 组件
/// StringFilter component
/// </summary>
public partial class StringFilter
{
Expand Down