diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index aeab3ac3ae9..551a79507ac 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 8.1.6 + 8.1.7-beta01 diff --git a/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss b/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss index bea85ab71b6..23364f95d42 100644 --- a/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss +++ b/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss @@ -1,15 +1,3 @@ -@mixin direction($var, $child) { - > .datetime-picker:not(:#{$child}-child) .form-control, - > .select:not(:#{$child}-child) .form-control, - > .switch:not(:#{$child}-child), - > .multi-select:not(:#{$child}-child) .dropdown-toggle, - > [data-bs-toggle]:not(:#{$child}-child) > .form-control, - > .auto-complete:not(:#{$child}-child) .form-control { - border-top-#{$var}-radius: 0; - border-bottom-#{$var}-radius: 0; - } -} - .input-group { > .datetime-picker, > .select, @@ -35,7 +23,4 @@ > .segmented { border: 1px solid var(--bs-border-color); } - - @include direction(right,last); - @include direction(left,first) } diff --git a/src/BootstrapBlazor/Components/Table/ITableToolbarButton.cs b/src/BootstrapBlazor/Components/Table/ITableToolbarButton.cs index 8388244ace5..e9de4f966a8 100644 --- a/src/BootstrapBlazor/Components/Table/ITableToolbarButton.cs +++ b/src/BootstrapBlazor/Components/Table/ITableToolbarButton.cs @@ -7,7 +7,7 @@ namespace BootstrapBlazor.Components; /// /// ITableToolbarButton 接口 /// -public interface ITableToolbarButton +public interface ITableToolbarButton : IToolbarComponent { /// /// 获得/设置 选中一行时启用按钮 默认 false 均可用 @@ -18,9 +18,4 @@ public interface ITableToolbarButton /// 获得/设置 按钮是否被禁用回调方法 /// Func, bool>? IsDisabledCallback { get; set; } - - /// - /// 获得/设置 是否显示 默认 true 显示 - /// - bool IsShow { get; set; } } diff --git a/src/BootstrapBlazor/Components/Table/IToolbarComponent.cs b/src/BootstrapBlazor/Components/Table/IToolbarComponent.cs new file mode 100644 index 00000000000..69e452a2efd --- /dev/null +++ b/src/BootstrapBlazor/Components/Table/IToolbarComponent.cs @@ -0,0 +1,16 @@ +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// 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/ + +namespace BootstrapBlazor.Components; + +/// +/// 工具栏按钮接口 +/// +public interface IToolbarComponent +{ + /// + /// 获得/设置 是否显示 默认 true 显示 + /// + bool IsShow { get; set; } +} diff --git a/src/BootstrapBlazor/Components/Table/TableToolbar.razor b/src/BootstrapBlazor/Components/Table/TableToolbar.razor index aa501f8f482..44687e8973c 100644 --- a/src/BootstrapBlazor/Components/Table/TableToolbar.razor +++ b/src/BootstrapBlazor/Components/Table/TableToolbar.razor @@ -6,10 +6,10 @@ @ChildContent - @if (Buttons.Count > 0) + @if (_buttons.Count > 0) {
- @foreach (var button in Buttons) + @foreach (var button in _buttons) { @if (button is TableToolbarButton b && b.IsShow) { @@ -31,6 +31,12 @@ CloseButtonText="@pb.CloseButtonText" Content="@pb.Content"> } + else if (button is TableToolbarComponent cb && cb.IsShow) + { + + @cb.ChildContent + + } }
@if (IsAutoCollapsedToolbarButton) @@ -40,7 +46,7 @@