Skip to content
Merged
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.8.0-beta02</Version>
<Version>9.8.0-beta03</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/BootstrapBlazor/Components/Filters/NotSupportFilter.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@namespace BootstrapBlazor.Components
@inherits FilterBase

<div>@NotSupportedMessage</div>
51 changes: 51 additions & 0 deletions src/BootstrapBlazor/Components/Filters/NotSupportFilter.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone

using Microsoft.Extensions.Localization;

namespace BootstrapBlazor.Components;

/// <summary>
/// NotSupportFilter component
/// </summary>
public partial class NotSupportFilter
{
[Inject]
[NotNull]
private IStringLocalizer<TableColumnFilter>? Localizer { get; set; }

Check warning on line 17 in src/BootstrapBlazor/Components/Filters/NotSupportFilter.razor.cs

View workflow job for this annotation

GitHub Actions / run test

'NotSupportFilter.Localizer' hides inherited member 'FilterBase.Localizer'. Use the new keyword if hiding was intended.

/// <summary>
/// 获得/设置 不支持过滤类型提示信息 默认 null 读取资源文件内容
/// </summary>
[Parameter]
public string? NotSupportedMessage { get; set; }

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

NotSupportedMessage ??= Localizer[nameof(NotSupportedMessage)];
}

/// <summary>
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
public override FilterKeyValueAction GetFilterConditions()
{
return new();
}

/// <summary>
/// <inheritdoc/>
/// </summary>
public override void Reset()
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ else
</FilterProvider>
break;
default:
<div>@NotSupportedMessage</div>
<FilterProvider>
<NotSupportFilter NotSupportedMessage="@NotSupportedMessage"></NotSupportFilter>
</FilterProvider>
break;
}
}
Expand Down
10 changes: 0 additions & 10 deletions src/BootstrapBlazor/Components/Filters/TableColumnFilter.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ protected override void OnInitialized()
_fieldKey = Column.GetFieldName();
}

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

NotSupportedMessage ??= Localizer[nameof(NotSupportedMessage)];
}

/// <summary>
/// <inheritdoc/>
/// </summary>
Expand Down
Loading