From 5ad9c3eca330220c48979c33700fbea727b50b3f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 11 Jan 2025 20:15:52 +0800 Subject: [PATCH 1/4] chore: bump version 9.2.7-beta04 Co-Authored-By: szpeak <17529220+szpeak@users.noreply.github.com> --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index ed6980a6efb..9d897ba8143 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.2.7-beta03 + 9.2.7-beta04 From 7ae0f149848bac02a997610fb87b0b8134b09e74 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 11 Jan 2025 20:35:15 +0800 Subject: [PATCH 2/4] feat: add Height parameter --- .../Components/Transfer/Transfer.razor | 2 +- .../Components/Transfer/Transfer.razor.cs | 19 ++++++++++++++++--- .../Components/Transfer/Transfer.razor.scss | 12 ++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor/Components/Transfer/Transfer.razor b/src/BootstrapBlazor/Components/Transfer/Transfer.razor index 5b6d6547c75..31385aa2b50 100644 --- a/src/BootstrapBlazor/Components/Transfer/Transfer.razor +++ b/src/BootstrapBlazor/Components/Transfer/Transfer.razor @@ -6,7 +6,7 @@ { } -
+
/// [Parameter] [NotNull] -#if NET6_0_OR_GREATER [EditorRequired] -#endif public IEnumerable? Items { get; set; } /// @@ -188,10 +185,26 @@ public partial class Transfer [Parameter] public RenderFragment? RightItemTemplate { get; set; } + /// + /// 获得/设置 组件高度 默认值 null 未设置 + /// + [Parameter] + public string? Height { get; set; } + [Inject] [NotNull] private IIconTheme? IconTheme { get; set; } + private string? ClassString => CssBuilder.Default("transfer") + .AddClass("has-height", !string.IsNullOrEmpty(Height)) + .AddClassFromAttributes(AdditionalAttributes) + .Build(); + + private string? StyleString => CssBuilder.Default() + .AddClass($"--bb-transfer-height: {Height};", !string.IsNullOrEmpty(Height)) + .AddStyleFromAttributes(AdditionalAttributes) + .Build(); + /// /// OnInitialized 方法 /// diff --git a/src/BootstrapBlazor/Components/Transfer/Transfer.razor.scss b/src/BootstrapBlazor/Components/Transfer/Transfer.razor.scss index 86fbed83070..2aaa3cb2c5c 100644 --- a/src/BootstrapBlazor/Components/Transfer/Transfer.razor.scss +++ b/src/BootstrapBlazor/Components/Transfer/Transfer.razor.scss @@ -13,6 +13,18 @@ display: flex; flex-direction: row; flex-wrap: nowrap; + + &.has-height { + height: var(--bb-transfer-height); + + .transfer-panel { + height: 100%; + + .transfer-panel-body { + height: calc(100% - var(--bb-transfer-panel-header-height)); + } + } + } } .transfer-panel { From 925e178f6e82297f933fc996b35c28e104409974 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 11 Jan 2025 20:38:38 +0800 Subject: [PATCH 3/4] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/TransferTest.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/UnitTest/Components/TransferTest.cs b/test/UnitTest/Components/TransferTest.cs index 4271443a32a..a7982c9afcc 100644 --- a/test/UnitTest/Components/TransferTest.cs +++ b/test/UnitTest/Components/TransferTest.cs @@ -28,6 +28,16 @@ public void Items_Ok() cut.Contains("transfer-panel"); } + [Fact] + public void Height_Ok() + { + var cut = Context.RenderComponent>(pb => + { + pb.Add(a => a.Height, "200px"); + }); + cut.Contains("--bb-transfer-height: 200px;"); + } + [Fact] public async Task EnumerableString_Value() { From c1938f62be5ffa5c83f39eef958c474ef3565fd9 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 11 Jan 2025 20:40:25 +0800 Subject: [PATCH 4/4] chore: bump version 9.2.7-beta05 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index ed6980a6efb..3dbb728cb92 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.2.7-beta03 + 9.2.7-beta05