diff --git a/src/BootstrapBlazor.Shared/Locales/en.json b/src/BootstrapBlazor.Shared/Locales/en.json index de9ced53f50f0d1efba3e42597a9dfeeb7ab0f74..57c3e3a641bd973c34fd26d72bd429c40a0808a2 100644 --- a/src/BootstrapBlazor.Shared/Locales/en.json +++ b/src/BootstrapBlazor.Shared/Locales/en.json @@ -1139,7 +1139,8 @@ "Att12": "Whether to read only", "Att13": "Edit the column's front label name", "Att14": "Column editing template", - "IsDisplay": "Shown as Display component" + "IsDisplay": "Shown as Display component", + "ShowLabelTooltip": "Show complete information when mouse hover over the label" }, "BootstrapBlazor.Shared.Samples.FloatingLabels": { "Title": "FloatingLabel", @@ -1222,6 +1223,7 @@ "Block11Intro": "Use the BootstrapPassword component", "IsTrimTitle": "Trim", "IsTrimIntro": "Use IsTrim=\"true\" to automatically trim white space when entering content", + "TrimDescription": "The front and back spaces in the component will be trimmed when set IsTrim to true", "PlaceHolder": "Please enter ...", "TestName": "Tom", "Log": "The key triggers the current text box value", @@ -1780,7 +1782,7 @@ "BasicUsageLi7": "Set the asynchronous submission form by setting the value of the Button Button property IsAsync", "BasicUsageLi8": "Components within a form are typically used to bind the property values of Model in both directions using bidirectional binding techniques, causing the component to refresh and re-render when its value changes StateHasChanged, and the method is called, i.e. its component or page is refreshed and re-rendered", "BasicUsageLi9": "After the value of the component control in the form is modified, the OnFieldChanged method is called", - "FormLabelWidth": "The default width of component front label is 120px. If you need more, please change the style variable --bs-row-label-width in the project style file", + "FormLabelWidth": "The default width of component front label is 120px. If you need more, please change the style variable --bs-row-label-width in the project style file or remove RowType.Inline", "BasicUsageP2": "Note:", "InnerComponentTitle": "Built-in components", "InnerComponentIntro": "Place the support form components into the ValidateForm", @@ -1826,7 +1828,10 @@ "OnValidSubmitDoneLog": "OnValidSubmit callback delegate: Done!", "OnInvalidSubmitCallBackLog": "OnInvalidSubmit callback delegate", "OnValidSubmitCallBackLog": "OnValidSubmit callback delegate", - "DatabaseExistLog": "Exists in the database" + "DatabaseExistLog": "Exists in the database", + "LongDisplayText": "I am very long display text", + "LongDisplayDescription": "In this example, set the ShowLabelTooltip in the form-inline style to true to make the mouse hover over the cropped label to display the complete information", + "ShowLabelTooltip": "Show complete information when mouse hover over the label" }, "BootstrapBlazor.Shared.Samples.Avatars": { "Title": "Avatar", diff --git a/src/BootstrapBlazor.Shared/Locales/zh.json b/src/BootstrapBlazor.Shared/Locales/zh.json index 720df626c95175a4eab3042cb3be08a597d9c9aa..1b0e868535738e7ef6539a3c85ce36df89fe79c7 100644 --- a/src/BootstrapBlazor.Shared/Locales/zh.json +++ b/src/BootstrapBlazor.Shared/Locales/zh.json @@ -1141,7 +1141,8 @@ "Att12": "是否只读", "Att13": "编辑列前置标签名", "Att14": "列编辑模板", - "IsDisplay": "是否显示为 Display 组件" + "IsDisplay": "是否显示为 Display 组件", + "ShowLabelTooltip": "鼠标悬停标签时显示完整信息" }, "BootstrapBlazor.Shared.Samples.FloatingLabels": { "Title": "FloatingLabel 输入框", @@ -1224,6 +1225,7 @@ "Block11Intro": "使用 BootstrapPassword 组件", "IsTrimTitle": "修剪空白", "IsTrimIntro": "使用 IsTrim=\"true\" 可在输入内容的时候自动修剪空白", + "TrimDescription": "设置参数 IsTrim 值为 true 后,组件内的前后空格将会被裁减", "PlaceHolder": "请输入 ...", "TestName": "张三", "Log": "按键触发 当前文本框值", @@ -1783,7 +1785,7 @@ "BasicUsageLi7": "通过设置提交按钮 Button 属性 IsAsync 值,设置异步提交表单", "BasicUsageLi8": "表单内组件通常用法都是使用双向绑定技术对 Model 的属性值进行双向绑定,当其值改变时会导致所在组件 StateHasChanged 方法被调用,即其所在组件或者页面进行刷新重新渲染", "BasicUsageLi9": "表单内组件控件的值修改后 OnFieldChanged 方法被调用", - "FormLabelWidth": "组件前置标签默认宽度为 120px 六个汉字,如需要更多汉字请在项目样式文件中更改样式变量 --bs-row-label-width 即可", + "FormLabelWidth": "组件前置标签默认宽度为 120px 六个汉字,如需要更多汉字请在项目样式文件中更改样式变量 --bs-row-label-width 即可,或者设置表单显示标签在组件上方", "BasicUsageP2": "注意事项:", "InnerComponentTitle": "内置组件", "InnerComponentIntro": "放置支持表单组件到 ValidateForm 中", @@ -1829,7 +1831,10 @@ "OnValidSubmitDoneLog": "OnValidSubmit 回调委托: Done!", "OnInvalidSubmitCallBackLog": "OnInvalidSubmit 回调委托", "OnValidSubmitCallBackLog": "OnValidSubmit 回调委托", - "DatabaseExistLog": "数据库中已存在" + "DatabaseExistLog": "数据库中已存在", + "LongDisplayText": "我是特别长的显示标签", + "LongDisplayDescription": "本例中通过设置 form-inline 样式内的 BootstrapInput 组件 ShowLabelTooltiptrue 使鼠标悬停在被裁剪的 label 时显示完整信息", + "ShowLabelTooltip": "鼠标悬停标签时显示完整信息" }, "BootstrapBlazor.Shared.Samples.Avatars": { "Title": "Avatar 头像", diff --git a/src/BootstrapBlazor.Shared/Samples/Displays.razor b/src/BootstrapBlazor.Shared/Samples/Displays.razor index 971b8c65a2b7653dfc833a4fbe06193bf4723b10..2fcdd4e51c073ee75a3c68ea5d7d666f952e05ca 100644 --- a/src/BootstrapBlazor.Shared/Samples/Displays.razor +++ b/src/BootstrapBlazor.Shared/Samples/Displays.razor @@ -91,7 +91,7 @@ -

@Localizer["FormatStringP"]

+

@((MarkupString)Localizer["FormatStringP"].Value)

@Localizer["FormatStringettingText"] Formatter
diff --git a/src/BootstrapBlazor.Shared/Samples/EditorForms.razor.cs b/src/BootstrapBlazor.Shared/Samples/EditorForms.razor.cs index 1c0c305b81f0b2aed7c40cc22bb91aa05ccd4b29..9ed2c008f433105757633c29bdc05ef4dd635628 100644 --- a/src/BootstrapBlazor.Shared/Samples/EditorForms.razor.cs +++ b/src/BootstrapBlazor.Shared/Samples/EditorForms.razor.cs @@ -67,116 +67,123 @@ public sealed partial class EditorForms private IEnumerable GetAttributes() => new AttributeItem[] { - // TODO: 移动到数据库中 - new AttributeItem() { - Name = "Model", - Description = Localizer["Att1"], - Type = "TModel", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "FieldItems", - Description = Localizer["Att2"], - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "Buttons", - Description = Localizer["Att3"], - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = nameof(EditorForm.IsDisplay), - Description = Localizer["IsDisplay"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "false" - }, - new AttributeItem() { - Name = "ShowLabel", - Description = Localizer["Att4"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "AutoGenerateAllItem", - Description = Localizer["Att5"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "ItemsPerRow", - Description = Localizer["Att6"], - Type = "int?", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "RowType", - Description = Localizer["Att7"], - Type = "RowType", - ValueList = "Row|Inline", - DefaultValue = "Row" - }, - new AttributeItem() { - Name = "LabelAlign", - Description = Localizer["Att8"], - Type = "Alignment", - ValueList = "None|Left|Center|Right", - DefaultValue = "None" - } + // TODO: 移动到数据库中 + new AttributeItem() { + Name = "Model", + Description = Localizer["Att1"], + Type = "TModel", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "FieldItems", + Description = Localizer["Att2"], + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "Buttons", + Description = Localizer["Att3"], + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = nameof(EditorForm.IsDisplay), + Description = Localizer["IsDisplay"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "false" + }, + new AttributeItem() { + Name = "ShowLabel", + Description = Localizer["Att4"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "ShowLabelTooltip", + Description = Localizer["ShowLabelTooltip"], + Type = "bool?", + ValueList = "true/false/null", + DefaultValue = "null" + }, + new AttributeItem() { + Name = "AutoGenerateAllItem", + Description = Localizer["Att5"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "ItemsPerRow", + Description = Localizer["Att6"], + Type = "int?", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "RowType", + Description = Localizer["Att7"], + Type = "RowType", + ValueList = "Row|Inline", + DefaultValue = "Row" + }, + new AttributeItem() { + Name = "LabelAlign", + Description = Localizer["Att8"], + Type = "Alignment", + ValueList = "None|Left|Center|Right", + DefaultValue = "None" + } }; private IEnumerable GetEditorItemAttributes() => new AttributeItem[] { - // TODO: 移动到数据库中 - new AttributeItem() { - Name = "Field", - Description = Localizer["Att9"], - Type = "TValue", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "FieldType", - Description = Localizer["Att10"], - Type = "Type", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "Editable", - Description = Localizer["Att11"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "Readonly", - Description = Localizer["Att12"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "false" - }, - new AttributeItem() { - Name = "Text", - Description = Localizer["Att13"], - Type = "string", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "EditTemplate", - Description = Localizer["Att14"], - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - } + // TODO: 移动到数据库中 + new AttributeItem() { + Name = "Field", + Description = Localizer["Att9"], + Type = "TValue", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "FieldType", + Description = Localizer["Att10"], + Type = "Type", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "Editable", + Description = Localizer["Att11"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "Readonly", + Description = Localizer["Att12"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "false" + }, + new AttributeItem() { + Name = "Text", + Description = Localizer["Att13"], + Type = "string", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "EditTemplate", + Description = Localizer["Att14"], + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + } }; } diff --git a/src/BootstrapBlazor.Shared/Samples/Inputs.razor b/src/BootstrapBlazor.Shared/Samples/Inputs.razor index 3f602dfec2c3c523961ec7b038bd5ff963574ef0..0bffc95ce7bb8880468c653af9b89328c7afda19 100644 --- a/src/BootstrapBlazor.Shared/Samples/Inputs.razor +++ b/src/BootstrapBlazor.Shared/Samples/Inputs.razor @@ -12,7 +12,7 @@ @Localizer["Span1"]
- +
@@ -46,7 +46,7 @@ @Localizer["Span1"]
- +
@((MarkupString)Localizer["Div1"].Value)
@@ -61,7 +61,7 @@ @Localizer["Span2"]
- +
@@ -74,21 +74,21 @@

@((MarkupString)Localizer["P3"].Value)

- +

@((MarkupString)Localizer["P4"].Value)

- +

@((MarkupString)Localizer["P5"].Value)

- +
@@ -102,13 +102,13 @@

@((MarkupString)Localizer["P6"].Value)

- +
- +
@Localizer["Div2"]: @Model.Count.ToString("000")
@@ -146,19 +146,20 @@ @Localizer["Span1"]
- +
+

@((MarkupString)Localizer["TrimDescription"].Value)

@Localizer["Span1"]
- - 123@Model.Name456 + +
123@Model.Name456
diff --git a/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor b/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor index e5034edd218a369ec247f6ce4d403afa80391116..994114ef6da14dc3cd57fd90d5a33eca333686c8 100644 --- a/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor +++ b/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor @@ -22,63 +22,65 @@
  • @((MarkupString)Localizer["BasicUsageLi8"].Value)
  • @((MarkupString)Localizer["FormLabelWidth"].Value)
  • -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    +

    @((MarkupString)Localizer["LongDisplayDescription"].Value)

    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + -
    -

    @Localizer["InnerComponentLabel"]

    -

    @Localizer["InnerComponentP1"]

    -
      -
    • @Localizer["InnerComponentLi1"]
    • -
    • @Localizer["InnerComponentLi2"]
    • -
    • @Localizer["InnerComponentLi3"]
    • -
    • @Localizer["InnerComponentLi4"]
    • -
    • @Localizer["InnerComponentLi5"]
    • -
    -

    @((MarkupString)Localizer["InnerComponentP2"].Value)

    - -
    -
    - - - - - -
    -
    - -
    -
    - -
    -
    - +
    +
    + +
    +
    +
    +
    +
    + diff --git a/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor.cs b/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor.cs index 03c43c0fe481a480d8cb1b51d57d2ee10f71aa90..733f133585bc623567bb7295025043329a99d496 100644 --- a/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor.cs +++ b/src/BootstrapBlazor.Shared/Samples/ValidateForms.razor.cs @@ -191,49 +191,56 @@ public partial class ValidateForms #region 参数说明 private IEnumerable GetAttributes() => new AttributeItem[] { - // TODO: 移动到数据库中 - new AttributeItem() { - Name = "Model", - Description = Localizer["Model"], - Type = "object", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "ValidateAllProperties", - Description = Localizer["ValidateAllProperties"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "false" - }, - new AttributeItem() { - Name = "ShowRequiredMark", - Description = Localizer["ShowRequiredMark"], - Type = "bool", - ValueList = "true/false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "ChildContent", - Description = Localizer["ChildContent"], - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "OnValidSubmit", - Description = Localizer["OnValidSubmit"], - Type = "EventCallback", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "OnInvalidSubmit", - Description = Localizer["OnInvalidSubmit"], - Type = "EventCallback", - ValueList = " — ", - DefaultValue = " — " - } + // TODO: 移动到数据库中 + new AttributeItem() { + Name = "Model", + Description = Localizer["Model"], + Type = "object", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "ValidateAllProperties", + Description = Localizer["ValidateAllProperties"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "false" + }, + new AttributeItem() { + Name = "ShowRequiredMark", + Description = Localizer["ShowRequiredMark"], + Type = "bool", + ValueList = "true/false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "ShowLabelTooltip", + Description = Localizer["ShowLabelTooltip"], + Type = "bool?", + ValueList = "true/false/null", + DefaultValue = "null" + }, + new AttributeItem() { + Name = "ChildContent", + Description = Localizer["ChildContent"], + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "OnValidSubmit", + Description = Localizer["OnValidSubmit"], + Type = "EventCallback", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "OnInvalidSubmit", + Description = Localizer["OnInvalidSubmit"], + Type = "EventCallback", + ValueList = " — ", + DefaultValue = " — " + } }; /// @@ -242,13 +249,13 @@ public partial class ValidateForms /// private IEnumerable GetMethods() => new MethodItem[] { - new MethodItem() - { - Name = "SetError", - Description = Localizer["SetError"], - Parameters = "PropertyName, ErrorMessage", - ReturnValue = " — " - } + new MethodItem() + { + Name = "SetError", + Description = Localizer["SetError"], + Parameters = "PropertyName, ErrorMessage", + ReturnValue = " — " + } }; #endregion } diff --git a/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs b/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs index 254def1546281a2dcc2162e8a57e69658128cd38..8621245218bd2c9532c2db3899a872cc411d3923 100644 --- a/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs +++ b/src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs @@ -48,6 +48,12 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu /// public bool IsReadonlyWhenEdit { get; set; } + /// + /// 获得/设置 是否显示标签 Tooltip 多用于标签文字过长导致裁减时使用 默认 null + /// + [Parameter] + public bool? ShowLabelTooltip { get; set; } + /// /// 获得/设置 是否为默认排序规则 默认为 SortOrder.Unset /// diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index a9fe83986be17c985a39882586ab9d6d42fc1b5f..a43fdab5c9f9eb75f24f4dd8ec7face212fa5bfd 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 6.4.6-beta01 + 6.4.6 diff --git a/src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor b/src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor index 64fe01781f04286a4ca0fda2d5515f6ae914a306..dda58ee5a35c78d9b3ccdc2d2eeb21c039769980 100644 --- a/src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor +++ b/src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor @@ -3,7 +3,7 @@ @if (IsShowLabel) { - + }
    diff --git a/src/BootstrapBlazor/Components/AutoFill/AutoFill.razor b/src/BootstrapBlazor/Components/AutoFill/AutoFill.razor index ab7ee6060772836ebd2eb475154173734946ec2b..2a4d0308f5962bdec19251d95d7949ea82e06ae4 100644 --- a/src/BootstrapBlazor/Components/AutoFill/AutoFill.razor +++ b/src/BootstrapBlazor/Components/AutoFill/AutoFill.razor @@ -4,7 +4,7 @@ @if (IsShowLabel) { - + }
    diff --git a/src/BootstrapBlazor/Components/Cascader/Cascader.razor b/src/BootstrapBlazor/Components/Cascader/Cascader.razor index dcb4b8c3ec340ac905a6757b937a4e8876d9c7d4..8b85cad664af1078cdba0d9093842ac5f3c53b6b 100644 --- a/src/BootstrapBlazor/Components/Cascader/Cascader.razor +++ b/src/BootstrapBlazor/Components/Cascader/Cascader.razor @@ -4,7 +4,7 @@ @if (IsShowLabel) { - + }