-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Search): add IsClearable parameter (#5296)
* chore: 更新 OctIcon 支持 Color 参数 * doc: 更新图标示例 * chore: 更新依赖包 * feat: 增加 SearchContext 精简代码逻辑 减少级联参数 * style: 增加样式 * doc: 更新示例代码 * doc: 更新示例文档 * test: 增加单元测试 * test: 更新单元测试 * chore: bump version 9.3.1-beta07 * test: 更新单元测试 * feat: 增加 ButtonTemplate 参数 * feat: 增加 ShowClearIcon 参数 * refactor: 增加 form-control-group 节点 * style: 更新样式 * feat: 增加 PrefixButtonTemplate 参数 * refactor: 增加 PrefixButtonTemplate 逻辑 * style: 增加 bb-search-icon-input-padding-right 变量 * doc: 增加示例 * refactor: 更改 IsClearable 参数 * refactor: 调整 ButtonTemplate 位置 * doc: 增加示例代码 * doc: 更新示例 * doc: 增加文档注释 * doc: 增加注释文档多语言 * test: 更新单元测试 * refactor: 重构 DOM 结构精简样式
- Loading branch information
Showing
15 changed files
with
399 additions
and
51 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
4 changes: 4 additions & 0 deletions
4
src/BootstrapBlazor.Server/Components/Components/SearchButtonTemplateDemo.razor
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,4 @@ | ||
@typeparam TValue | ||
|
||
<Button Text="Clear1" OnClick="OnClickClear"></Button> | ||
<Button Text="Search1" OnClick="OnClickSearch"></Button> |
35 changes: 35 additions & 0 deletions
35
src/BootstrapBlazor.Server/Components/Components/SearchButtonTemplateDemo.razor.cs
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,35 @@ | ||
// 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 | ||
|
||
namespace BootstrapBlazor.Server.Components.Components; | ||
|
||
/// <summary> | ||
/// SearchButtonTemplateDemo 示例组件 | ||
/// </summary> | ||
public partial class SearchButtonTemplateDemo<TValue> | ||
{ | ||
/// <summary> | ||
/// 获得/设置 <see cref="SearchContext{TValue}"/> 实例"/> | ||
/// </summary> | ||
[Parameter, EditorRequired, NotNull] | ||
public SearchContext<TValue>? Context { get; set; } | ||
|
||
[Inject, NotNull] | ||
private ToastService? ToastService { get; set; } | ||
|
||
private async Task OnClickSearch() | ||
{ | ||
await Context.OnSearchAsync(); | ||
|
||
await ToastService.Information("Search-ButtonTemplate", "Click Search1 Button"); | ||
} | ||
|
||
private async Task OnClickClear() | ||
{ | ||
await Context.OnClearAsync(); | ||
|
||
await ToastService.Information("Search-ButtonTemplate", "Click Clear1 Button"); | ||
} | ||
} |
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
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
Oops, something went wrong.