diff --git a/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.css b/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.css index 2668c343191b56e46db2a17d61f025456195fa6c..9bd10ebdb7f92164cd3e59478557a572aef83d8a 100644 --- a/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.css +++ b/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.css @@ -114,6 +114,10 @@ line-height: 30px; } +.popover .picker-panel { + box-shadow: none; +} + .picker-panel-body-wrapper:after, .picker-panel-body:after { content: ""; display: table; diff --git a/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor b/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor index 31454644387e245c4c76e5dd93eb91e80f1cc12a..0621931f85b24ab5f8ba93640fe6020f2dda393a 100644 --- a/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor +++ b/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor @@ -1,13 +1,13 @@ @namespace BootstrapBlazor.Components @typeparam TValue -@inherits ValidateBase +@inherits PopoverDropdownBase @if (IsShowLabel) { }
- + .AddClass(Icon) .Build(); - /// - /// 获得 组件弹窗位置 - /// - private string? PlacementString => CssBuilder.Default() - .AddClass(Placement.ToDescriptionString(), Placement != Placement.Auto) - .Build(); - private string? TabIndexString => ValidateForm != null ? "0" : null; private string? AutoCloseString => AutoClose ? "true" : null; @@ -99,12 +92,6 @@ public sealed partial class DateTimePicker [NotNull] public string? Icon { get; set; } - /// - /// 获得/设置 弹窗位置 默认为 Auto - /// - [Parameter] - public Placement Placement { get; set; } = Placement.Auto; - /// /// 获得/设置 组件显示模式 默认为显示年月日模式 /// diff --git a/src/BootstrapBlazor/Components/DateTimePicker/PopoverDropdownBase.cs b/src/BootstrapBlazor/Components/DateTimePicker/PopoverDropdownBase.cs new file mode 100644 index 0000000000000000000000000000000000000000..e1d09300aa4a588ab55459cba08bd150710fc9be --- /dev/null +++ b/src/BootstrapBlazor/Components/DateTimePicker/PopoverDropdownBase.cs @@ -0,0 +1,43 @@ +// 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 abstract class PopoverDropdownBase : ValidateBase +{ + /// + /// 获得/设置 弹窗位置 默认为 Bottom + /// + [Parameter] + public Placement Placement { get; set; } + + /// + /// 获得/设置 自定义样式 参数 默认 null + /// + /// 由 data-bs-custom-class 实现 + [Parameter] + public string? CustomClass { get; set; } + + /// + /// 获得/设置 是否显示阴影 默认 true + /// + [Parameter] + public bool ShowShadow { get; set; } = true; + + /// + /// 弹窗位置字符串 + /// + protected string? PlacementString => Placement == Placement.Auto ? null : Placement.ToDescriptionString(); + + /// + /// 获得 CustomClass 字符串 + /// + protected virtual string? CustomClassString => CssBuilder.Default(CustomClass) + .AddClass("shadow", ShowShadow) + .Build(); +} diff --git a/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.css b/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.css index 7f0f4adc462ea17d0965addd48b6c1ff825b2a28..675424923fe80bd75b2cb1f8dd827101c597c33f 100644 --- a/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.css +++ b/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.css @@ -49,7 +49,6 @@ } .range-panel-body .picker-panel { - box-shadow: none; border: none; } diff --git a/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor b/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor index f447bfa5a42c67afcd208b9f3d4d3061518ff26e..62959a1ec87df82277e4dd684d013818be4204d6 100644 --- a/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor +++ b/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor @@ -1,12 +1,12 @@ @namespace BootstrapBlazor.Components -@inherits ValidateBase +@inherits PopoverDropdownBase @if (IsShowLabel) { }
-