Skip to content

Commit

Permalink
refactor: 更新参数名称
Browse files Browse the repository at this point in the history
  • Loading branch information
ArgoZhang committed Dec 31, 2024
1 parent 2e8a2a8 commit e210f83
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Components/Pages/Coms.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="coms-search">
<div class="row">
<div class="col-12">
<Search @bind-Value="@SearchText" PlaceHolder="@Localizer["Search"]" IsOnInputTrigger="true" IsAutoFocus="true" OnSearch="@OnSearch"></Search>
<Search @bind-Value="@SearchText" PlaceHolder="@Localizer["Search"]" IsTriggerSearchByInput="true" IsAutoFocus="true" OnSearch="@OnSearch"></Search>
</div>
</div>
<div class="coms-search-filter">
Expand Down
33 changes: 2 additions & 31 deletions src/BootstrapBlazor.Server/Components/Samples/Searches.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ private async Task<IEnumerable<Foo>> OnSearchFoo(string searchText)
/// <returns></returns>
private AttributeItem[] GetAttributes() =>
[
new() {
Name = "ChildContent",
Description = Localizer["SearchesChildContent"],
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
},
new() {
Name = "Items",
Description = Localizer["SearchesItems"],
Type = "IEnumerable<string>",
ValueList = " — ",
DefaultValue = " — "
},
new() {
Name = "NoDataTip",
Description = Localizer["SearchesNoDataTip"],
Expand Down Expand Up @@ -132,13 +118,6 @@ private AttributeItem[] GetAttributes() =>
ValueList = " — ",
DefaultValue = "Primary"
},
new() {
Name = "IsLikeMatch",
Description = Localizer["SearchesIsLikeMatch"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
},
new() {
Name = "IsAutoFocus",
Description = Localizer["SearchesIsAutoFocus"],
Expand All @@ -154,21 +133,13 @@ private AttributeItem[] GetAttributes() =>
DefaultValue = "false"
},
new() {
Name = "IsOnInputTrigger",
Description = Localizer["SearchesIsOnInputTrigger"],
Name = "IsTriggerSearchByInput",
Description = Localizer["SearchesIsTriggerSearchByInput"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
},
new()
{
Name = "IgnoreCase",
Description = Localizer["SearchesIgnoreCase"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "true"
},
new()
{
Name = "ShowClearButton",
Description = Localizer["SearchesShowClearButton"],
Expand Down
8 changes: 2 additions & 6 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -4182,23 +4182,19 @@
"SearchesDisplayButtonTitle": "The Empty button is displayed",
"SearchesDisplayButtonIntro": "Control whether the Empty button is displayed by setting the <code>ShowClearButton</code> parameter",
"SearchesKeyboardsTitle": "Keyboard input instant search",
"SearchesKeyboardsIntro": "Control whether search operations are performed in real time by setting <code>the IsOnInputTrigger</code> parameter",
"SearchesKeyboardsIntro": "Control whether search operations are performed in real time by setting <code>IsTriggerSearchByInput</code> parameter",
"SearchesValidateFormTitle": "ValidateForm",
"SearchesValidateFormIntro": "Inside <code>ValidateForm</code>",
"SearchesChildContent": "Content",
"SearchesItems": "Data source",
"SearchesNoDataTip": "Auto-complete data prompts when there is no match",
"SearchesNoDataTipDefaultValue": "No matching data",
"SearchesButtonLoadingIcon": "Searching for button icon",
"SearchesClearButtonIcon": "Clear the button color",
"SearchesClearButtonText": "Empty the button text",
"SearchesClearButtonColor": "Clear the button color",
"SearchesButtonColor": "Search for button color",
"SearchesIsLikeMatch": "Whether fuzzy matching is turned on",
"SearchesIsAutoFocus": "Whether to get the focus automatically",
"SearchesIsAutoClearAfterSearch": "Click Search to automatically empty the search box",
"SearchesIsOnInputTrigger": "Whether the search mode is triggered by input, it is triggered by clicking the search button by default",
"SearchesIgnoreCase": "Whether case is ignored when matching",
"SearchesIsTriggerSearchByInput": "Whether the search mode is triggered by input, it is triggered by clicking the search button by default",
"SearchesShowClearButton": "Whether the Clear button is displayed",
"SearchesOnSearch": "Call back this delegate when you click Search",
"SearchesOnClear": "Click Recall this order when emptying",
Expand Down
8 changes: 2 additions & 6 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4182,23 +4182,19 @@
"SearchesDisplayButtonTitle": "显示清空按钮",
"SearchesDisplayButtonIntro": "通过设置 <code>ShowClearButton</code> 参数控制是否显示清空按钮",
"SearchesKeyboardsTitle": "键盘输入即时搜索",
"SearchesKeyboardsIntro": "通过设置 <code>IsOnInputTrigger</code> 参数控制是否实时进行搜索操作",
"SearchesKeyboardsIntro": "通过设置 <code>IsTriggerSearchByInput</code> 参数控制是否实时进行搜索操作",
"SearchesValidateFormTitle": "验证表单内使用",
"SearchesValidateFormIntro": "内置于 <code>ValidateForm</code> 使用,输入中文时不会多次触发搜索功能",
"SearchesChildContent": "内容",
"SearchesItems": "数据源",
"SearchesNoDataTip": "自动完成数据无匹配项时提示信息",
"SearchesNoDataTipDefaultValue": "无匹配数据",
"SearchesButtonLoadingIcon": "正在搜索按钮图标",
"SearchesClearButtonIcon": "清空按钮颜色",
"SearchesClearButtonText": "清空按钮文本",
"SearchesClearButtonColor": "清空按钮颜色",
"SearchesButtonColor": "搜索按钮颜色",
"SearchesIsLikeMatch": "是否开启模糊匹配",
"SearchesIsAutoFocus": "是否自动获得焦点",
"SearchesIsAutoClearAfterSearch": "点击搜索后是否自动清空搜索框",
"SearchesIsOnInputTrigger": "搜索模式是否为输入即触发,默认点击搜索按钮触发",
"SearchesIgnoreCase": "匹配时是否忽略大小写",
"SearchesIsTriggerSearchByInput": "搜索模式是否为输入即触发,默认点击搜索按钮触发",
"SearchesShowClearButton": "是否显示清除按钮",
"SearchesOnSearch": "点击搜索时回调此委托",
"SearchesOnClear": "点击清空时回调此委托",
Expand Down
2 changes: 1 addition & 1 deletion test/UnitTest/Components/SearchTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task OnGetDisplayText_Ok()
}

[Fact]
public void IsOnInputTrigger_Ok()
public void IsTriggerSearchByInput_Ok()
{
var cut = Context.RenderComponent<Search<string>>(builder =>
{
Expand Down

0 comments on commit e210f83

Please sign in to comment.