diff --git a/src/BootstrapBlazor/Components/Button/Button.razor.scss b/src/BootstrapBlazor/Components/Button/Button.razor.scss index 338e75a954e..8d69a79be6e 100644 --- a/src/BootstrapBlazor/Components/Button/Button.razor.scss +++ b/src/BootstrapBlazor/Components/Button/Button.razor.scss @@ -1,4 +1,4 @@ -@use "../../wwwroot/scss/variables" as *; +@use "../../wwwroot/scss/variables" as *; .btn { --bs-btn-font-size: #{$bs-btn-font-size}; @@ -91,4 +91,14 @@ display: block; } } + + > .input-group-text:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + + > .input-group-text:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } } diff --git a/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.cs b/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.cs index b85fe8a7ef5..2b001a45630 100644 --- a/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.cs +++ b/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// 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(argo@live.ca) Website: https://www.blazor.zone @@ -51,9 +51,15 @@ public sealed class BootstrapInputGroupLabel : DisplayBase [Parameter] public RenderFragment? ChildContent { get; set; } + /// + /// 获得/设置 是否为 InputGroup 或 TableToolbar 内的标签 默认 null 未设置 + /// + [Parameter] + public bool? IsGroupLabel { get; set; } + private string? Required => ShowRequiredMark ? "true" : null; - private bool IsInputGroupLabel => InputGroup != null; + private bool IsInputGroupLabel => IsGroupLabel ?? InputGroup != null; /// /// diff --git a/test/UnitTest/Components/InputTest.cs b/test/UnitTest/Components/InputTest.cs index 66c35169899..bf9b7844c9e 100644 --- a/test/UnitTest/Components/InputTest.cs +++ b/test/UnitTest/Components/InputTest.cs @@ -282,6 +282,19 @@ public void GroupLabel_Ok() cut.DoesNotContain("DisplayText"); } + [Fact] + public void IsGroupLabel_Ok() + { + var cut = Context.Render(); + cut.DoesNotContain("input-group-text"); + + cut.Render(pb => + { + pb.Add(a => a.IsGroupLabel, true); + }); + cut.Contains("input-group-text"); + } + [Fact] public void ShowRequiredMark_Ok() {