!2375 doc(#I4SKWG): update AutoComplete sample code

* doc: 更新 AutoComplete 示例文档
* doc: 更新 AutoCompletes 组件资源文件
This commit is contained in:
Argo 2022-02-01 06:30:06 +00:00
parent 4818346b64
commit abbdc4b931
3 changed files with 99 additions and 78 deletions

View File

@ -789,9 +789,11 @@
"Att4DefaultValue": "No matching data",
"Att5": "The number of data displayed when the data is matched",
"Att6": "Call back the delegate method when the text box value changes",
"Att7": "whether to turn on fuzzy matching",
"Att8": "whether case is ignored when matching",
"Att9": "custom collection filtering rules"
"Att7": "Whether to turn on fuzzy matching",
"Att8": "Whether case is ignored when matching",
"Att9": "Custom collection filtering rules",
"SkipEnter": "Skip Enter key processing",
"SkipEsc": "Skip Esc key processing"
},
"BootstrapBlazor.Shared.Samples.FullScreens": {
"Title": "FullScreen",

View File

@ -792,7 +792,9 @@
"Att7": "是否开启模糊匹配",
"Att8": "匹配时是否忽略大小写",
"Att9": "自定义集合过滤规则",
"Att10": "js防抖时间毫秒"
"Att10": "js 防抖时间,毫秒",
"SkipEnter": "是否跳过 Enter 按键处理",
"SkipEsc": "是否跳过 Esc 按键处理"
},
"BootstrapBlazor.Shared.Samples.FullScreens": {
"Title": "FullScreen 全屏",

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Common;
using System.Collections.Generic;
using System.Threading.Tasks;
@ -37,79 +38,95 @@ public sealed partial class AutoCompletes
/// <returns></returns>
private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
{
// TODO: 移动到数据库中
new AttributeItem() {
Name = "ShowLabel",
Description = Localizer["Att1"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem() {
Name = "ChildContent",
Description = Localizer["Att2"],
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "Items",
Description = Localizer["Att3"],
Type = "IEnumerable<string>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "NoDataTip",
Description = Localizer["Att4"],
Type = "string",
ValueList = " — ",
DefaultValue = Localizer["Att4DefaultValue"]!
},
new AttributeItem() {
Name = "DisplayCount",
Description = Localizer["Att5"],
Type = "int?",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ValueChanged",
Description = Localizer["Att6"],
Type = "Action<string>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "IsLikeMatch",
Description = Localizer["Att7"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
},
new AttributeItem()
{
Name = "IgnoreCase",
Description = Localizer["Att8"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem()
{
Name = "CustomFilter",
Description = Localizer["Att9"],
Type = "Func<Task<IEnumerable<string>>>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem()
{
Name = "Debounce",
Description = Localizer["Att10"],
Type = "int",
ValueList = " — ",
DefaultValue = "0"
}
// TODO: 移动到数据库中
new AttributeItem() {
Name = "ShowLabel",
Description = Localizer["Att1"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem() {
Name = "ChildContent",
Description = Localizer["Att2"],
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "Items",
Description = Localizer["Att3"],
Type = "IEnumerable<string>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "NoDataTip",
Description = Localizer["Att4"],
Type = "string",
ValueList = " — ",
DefaultValue = Localizer["Att4DefaultValue"]!
},
new AttributeItem() {
Name = "DisplayCount",
Description = Localizer["Att5"],
Type = "int?",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ValueChanged",
Description = Localizer["Att6"],
Type = "Action<string>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "IsLikeMatch",
Description = Localizer["Att7"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
},
new AttributeItem()
{
Name = "IgnoreCase",
Description = Localizer["Att8"],
Type = "bool",
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem()
{
Name = "CustomFilter",
Description = Localizer["Att9"],
Type = "Func<Task<IEnumerable<string>>>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem()
{
Name = "Debounce",
Description = Localizer["Att10"],
Type = "int",
ValueList = " — ",
DefaultValue = "0"
},
new AttributeItem()
{
Name = nameof(AutoComplete.SkipEnter),
Description = Localizer[nameof(AutoComplete.SkipEnter)],
Type = "bool",
ValueList = "true/false",
DefaultValue = "false"
},
new AttributeItem()
{
Name = nameof(AutoComplete.SkipEsc),
Description = Localizer[nameof(AutoComplete.SkipEsc)],
Type = "bool",
ValueList = "true/false",
DefaultValue = "false"
}
};
}