!2356 doc(#I4S1KP): add ValidateRules doc of BootstrapInput

* doc: 增加 ValidateRules 文档
* doc: 更新资源文件
This commit is contained in:
知足常乐 2022-01-24 09:22:15 +00:00 committed by Argo-Tianyi
parent 2f10e9b55d
commit 7b02a81683
4 changed files with 110 additions and 100 deletions

View File

@ -1230,7 +1230,8 @@
"Att9": "The user presses the Esc key to call back the delegate", "Att9": "The user presses the Esc key to call back the delegate",
"Att10": "Whether to disable Fasle by default", "Att10": "Whether to disable Fasle by default",
"Att11": "Whether to get the focus automatically Default is fasle", "Att11": "Whether to get the focus automatically Default is fasle",
"IsSelectAllTextOnFocus": "Whether auto select the all text after focus" "IsSelectAllTextOnFocus": "Whether auto select the all text after focus",
"ValidateRules": "Customer validation collection"
}, },
"BootstrapBlazor.Shared.Samples.InputNumbers": { "BootstrapBlazor.Shared.Samples.InputNumbers": {
"Title": "InputNumber", "Title": "InputNumber",

View File

@ -1231,7 +1231,8 @@
"Att9": "用户按下 Esc 键回调委托", "Att9": "用户按下 Esc 键回调委托",
"Att10": "是否禁用", "Att10": "是否禁用",
"Att11": "是否自动获取焦点", "Att11": "是否自动获取焦点",
"IsSelectAllTextOnFocus": "获得焦点后自动选择输入框内所有字符串" "IsSelectAllTextOnFocus": "获得焦点后自动选择输入框内所有字符串",
"ValidateRules": "自定义验证集合"
}, },
"BootstrapBlazor.Shared.Samples.InputNumbers": { "BootstrapBlazor.Shared.Samples.InputNumbers": {
"Title": "InputNumber 组件", "Title": "InputNumber 组件",

View File

@ -56,101 +56,109 @@ public partial class Inputs
private IEnumerable<AttributeItem> GetAttributes() => new[] private IEnumerable<AttributeItem> GetAttributes() => new[]
{ {
new AttributeItem() { new AttributeItem() {
Name = "ChildContent", Name = "ChildContent",
Description = Localizer["Att1"], Description = Localizer["Att1"],
Type = "RenderFragment", Type = "RenderFragment",
ValueList = " — ", ValueList = " — ",
DefaultValue = " — " DefaultValue = " — "
}, },
new AttributeItem() { new AttributeItem() {
Name = "ShowLabel", Name = "ShowLabel",
Description = Localizer["Att2"], Description = Localizer["Att2"],
Type = "bool", Type = "bool",
ValueList = "true|false", ValueList = "true|false",
DefaultValue = "false" DefaultValue = "false"
}, },
new AttributeItem() { new AttributeItem() {
Name = "DisplayText", Name = "DisplayText",
Description = Localizer["Att3"], Description = Localizer["Att3"],
Type = "string", Type = "string",
ValueList = " — ", ValueList = " — ",
DefaultValue = " — " DefaultValue = " — "
}, },
new AttributeItem() { new AttributeItem() {
Name = "Color", Name = "Color",
Description = Localizer["Att4"], Description = Localizer["Att4"],
Type = "Color", Type = "Color",
ValueList = "Primary / Secondary / Success / Danger / Warning / Info / Dark", ValueList = "Primary / Secondary / Success / Danger / Warning / Info / Dark",
DefaultValue = "Primary" DefaultValue = "Primary"
}, },
new AttributeItem() { new AttributeItem() {
Name = "FormatString", Name = "FormatString",
Description = Localizer["Att5"], Description = Localizer["Att5"],
Type = "string", Type = "string",
ValueList = " — ", ValueList = " — ",
DefaultValue = " — " DefaultValue = " — "
}, },
new AttributeItem() { new AttributeItem() {
Name = "Formatter", Name = "Formatter",
Description = Localizer["Att6"], Description = Localizer["Att6"],
Type = "RenderFragment<TItem>", Type = "RenderFragment<TItem>",
ValueList = " — ", ValueList = " — ",
DefaultValue = " — " DefaultValue = " — "
}, },
new AttributeItem() new AttributeItem()
{ {
Name = "type", Name = "type",
Description = Localizer["Att7"], Description = Localizer["Att7"],
Type = "string", Type = "string",
ValueList = "text / number / email / url / password", ValueList = "text / number / email / url / password",
DefaultValue = "text" DefaultValue = "text"
}, },
new AttributeItem() { new AttributeItem() {
Name = "OnEnterAsync", Name = "OnEnterAsync",
Description = Localizer["Att8"], Description = Localizer["Att8"],
Type = "Func<TValue, Task>", Type = "Func<TValue, Task>",
ValueList = " — ", ValueList = " — ",
DefaultValue = " — " DefaultValue = " — "
}, },
new AttributeItem() { new AttributeItem() {
Name = "OnEscAsync", Name = "OnEscAsync",
Description = Localizer["Att9"], Description = Localizer["Att9"],
Type = "Func<TValue, Task>", Type = "Func<TValue, Task>",
ValueList = " — ", ValueList = " — ",
DefaultValue = " — " DefaultValue = " — "
}, },
new AttributeItem() new AttributeItem()
{ {
Name = "IsDisabled", Name = "IsDisabled",
Description = Localizer["Att10"], Description = Localizer["Att10"],
Type = "bool", Type = "bool",
ValueList = "true|false", ValueList = "true|false",
DefaultValue = "false" DefaultValue = "false"
}, },
new AttributeItem() new AttributeItem()
{ {
Name = "IsAutoFocus", Name = "IsAutoFocus",
Description = Localizer["Att11"], Description = Localizer["Att11"],
Type = "bool", Type = "bool",
ValueList = "true|false", ValueList = "true|false",
DefaultValue = "false" DefaultValue = "false"
}, },
new AttributeItem() new AttributeItem()
{ {
Name = nameof(BootstrapInput<string>.IsSelectAllTextOnFocus), Name = nameof(BootstrapInput<string>.IsSelectAllTextOnFocus),
Description = Localizer[nameof(BootstrapInput<string>.IsSelectAllTextOnFocus)].Value, Description = Localizer[nameof(BootstrapInput<string>.IsSelectAllTextOnFocus)].Value,
Type = "bool", Type = "bool",
ValueList = "true|false", ValueList = "true|false",
DefaultValue = "false" DefaultValue = "false"
}, },
new AttributeItem() new AttributeItem()
{ {
Name = nameof(BootstrapInput<string>.IsTrim), Name = nameof(BootstrapInput<string>.IsTrim),
Description = Localizer[nameof(BootstrapInput<string>.IsTrim)].Value, Description = Localizer[nameof(BootstrapInput<string>.IsTrim)].Value,
Type = "bool", Type = "bool",
ValueList = "true|false", ValueList = "true|false",
DefaultValue = "false" DefaultValue = "false"
} },
}; new AttributeItem()
{
Name = nameof(BootstrapInput<string>.ValidateRules),
Description = Localizer[nameof(BootstrapInput<string>.ValidateRules)].Value,
Type = "List<IValidator>",
ValueList = " — ",
DefaultValue = " — "
}
};
} }

File diff suppressed because one or more lines are too long