diff --git a/src/BootstrapBlazor.Server/Components/Samples/Dialogs.razor b/src/BootstrapBlazor.Server/Components/Samples/Dialogs.razor index 9baab79e5c4..e4bb7ae41a2 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Dialogs.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Dialogs.razor @@ -6,14 +6,14 @@
@Localizer["Tip1"]:
-@((MarkupString)Localizer["Tip2"].Value)
-@@inject DialogService DialogService-
[Inject] +@((MarkupString)Localizer["Tip2"].Value)
+@@inject DialogService DialogService+[Inject] [NotNull] private DialogService? DialogService { get; set; }-@((MarkupString)Localizer["Tip3"].Value)
-var op = new DialogOption() +@((MarkupString)Localizer["Tip3"].Value)
+var op = new DialogOption() { Title = @Localizer["DialogTitle"], ShowFooter = false, @@ -24,8 +24,8 @@ op.Component = BootstrapDynamicComponent.CreateComponent<DataDialogComponent& [nameof(DataDialogComponent.OnCloseAsync)] = new Action(() => op.CloseDialogAsync()) }); await DialogService.Show(op);-@((MarkupString)Localizer["Tip4"].Value)
-[CascadingParameter] +@((MarkupString)Localizer["Tip4"].Value)
+[CascadingParameter] private Func<Task>? OnCloseAsync { get; set; } private async Task OnClick() @@ -36,13 +36,13 @@ private async Task OnClick() } }-@((MarkupString)Localizer["Tip5"].Value)
+@((MarkupString)Localizer["Tip5"].Value)
<DialogCloseButton />- @((MarkupString)Localizer["KeyboardTip"].Value)
+@((MarkupString)Localizer["KeyboardTip"].Value) - +@@ -58,12 +58,12 @@ private async Task OnClick() - @((MarkupString)Localizer["ComponentTip"].Value)+@((MarkupString)Localizer["ComponentTip"].Value) - @@ -92,67 +92,76 @@ private async Task OnClick()@((MarkupString)Localizer["BodyContextTip"].Value)
+@((MarkupString)Localizer["BodyContextTip"].Value) - @((MarkupString)Localizer["CloseDialogByCodeTip"].Value)+@((MarkupString)Localizer["CloseDialogByCodeTip"].Value) - @((MarkupString)Localizer["DisableHeaderCloseButtonTip"].Value)+@((MarkupString)Localizer["DisableHeaderCloseButtonTip"].Value) - @Localizer["MultipleDialogTip1"]--
-- @Localizer["MultipleDialogTip2"]
-- @((MarkupString)Localizer["MultipleDialogTip3"].Value)
-- @Localizer["MultipleDialogTip4"]
-- @((MarkupString)Localizer["MultipleDialogTip5"].Value)
-@((MarkupString)Localizer["MultipleDialogDesc"].Value)++ @Localizer["MultipleDialogTip1"]++
+- @Localizer["MultipleDialogTip2"]
+- @((MarkupString)Localizer["MultipleDialogTip3"].Value)
+- @Localizer["MultipleDialogTip4"]
+- @((MarkupString)Localizer["MultipleDialogTip5"].Value)
+@((MarkupString)Localizer["MultipleDialogDesc"].Value)+- @Localizer["ModalDialogTip1"]--
+- @Localizer["ModalDialogTip2"]
-- @((MarkupString)Localizer["ModalDialogTip3"].Value)
-- @((MarkupString)Localizer["ModalDialogTip4"].Value)
-- @Localizer["ModalDialogTip5"]
-+ @Localizer["ModalDialogTip1"]++
+- @Localizer["ModalDialogTip2"]
+- @((MarkupString)Localizer["ModalDialogTip3"].Value)
+- @((MarkupString)Localizer["ModalDialogTip4"].Value)
+- @Localizer["ModalDialogTip5"]
+- @Localizer["EditDialogTip1"]--
+- @Localizer["EditDialogTip2"]
-- @((MarkupString)Localizer["EditDialogTip3"].Value)
-- @((MarkupString)Localizer["EditDialogTip4"].Value)
-+ @Localizer["EditDialogTip1"]++
+- @Localizer["EditDialogTip2"]
+- @((MarkupString)Localizer["EditDialogTip3"].Value)
+- @((MarkupString)Localizer["EditDialogTip4"].Value)
+- @Localizer["SearchDialogTip1"]--
+- @Localizer["SearchDialogTip2"]
-- @((MarkupString)Localizer["SearchDialogTip3"].Value)
-- @((MarkupString)Localizer["SearchDialogTip4"].Value)
-+ @Localizer["SearchDialogTip1"]++
+- @Localizer["SearchDialogTip2"]
+- @((MarkupString)Localizer["SearchDialogTip3"].Value)
+- @((MarkupString)Localizer["SearchDialogTip4"].Value)
+- @@ -174,17 +183,19 @@ private async Task OnClick()@Localizer["SaveDialogTip1"]--
- +- @Localizer["SaveDialogTip2"]
-- @((MarkupString)Localizer["SaveDialogTip3"].Value)
-+ @Localizer["SaveDialogTip1"]++
+- @Localizer["SaveDialogTip2"]
+- @((MarkupString)Localizer["SaveDialogTip3"].Value)
+- @Localizer["EmailTip1"]--
- +- @((MarkupString)Localizer["EmailTip2"].Value)
-- @((MarkupString)Localizer["EmailTip3"].Value)
-- @((MarkupString)Localizer["EmailTip4"].Value)
-- @((MarkupString)Localizer["EmailTip5"].Value)
-- @((MarkupString)Localizer["EmailTip6"].Value)
-- @((MarkupString)Localizer["EmailTip7"].Value)
-- @((MarkupString)Localizer["EmailTip8"].Value)
-+ @Localizer["EmailTip1"]++
+ +- @((MarkupString)Localizer["EmailTip2"].Value)
+- @((MarkupString)Localizer["EmailTip3"].Value)
+- @((MarkupString)Localizer["EmailTip4"].Value)
+- @((MarkupString)Localizer["EmailTip5"].Value)
+- @((MarkupString)Localizer["EmailTip6"].Value)
+- @((MarkupString)Localizer["EmailTip7"].Value)
+- @((MarkupString)Localizer["EmailTip8"].Value)
+diff --git a/src/BootstrapBlazor/Components/Dialog/Dialog.razor.cs b/src/BootstrapBlazor/Components/Dialog/Dialog.razor.cs index 82d912830dd..4e84fc2e3a0 100644 --- a/src/BootstrapBlazor/Components/Dialog/Dialog.razor.cs +++ b/src/BootstrapBlazor/Components/Dialog/Dialog.razor.cs @@ -18,7 +18,7 @@ public partial class Dialog : IDisposable /// /// 获得/设置 弹出对话框实例集合 /// - private Dictionary, (bool IsKeyboard, bool IsBackdrop)> DialogParameters { get; } = new(); + private Dictionary , (bool IsKeyboard, bool IsBackdrop)> DialogParameters { get; } = []; private bool IsKeyboard { get; set; } diff --git a/src/BootstrapBlazor/Components/Drawer/Drawer.razor.scss b/src/BootstrapBlazor/Components/Drawer/Drawer.razor.scss index 6af831e7523..42d616be586 100644 --- a/src/BootstrapBlazor/Components/Drawer/Drawer.razor.scss +++ b/src/BootstrapBlazor/Components/Drawer/Drawer.razor.scss @@ -2,6 +2,7 @@ --bb-drawer-bg: var(--bs-body-bg); --bb-drawer-zindex: #{$bb-drawer-zindex}; --bb-drawer-body-shadow: #{$bb-drawer-body-shadow}; + --bb-drawer-body-padding: #{$bb-drawer-body-padding}; --bb-drawer-bar-bg: #{$bb-drawer-bar-bg}; --bb-drawer-bar-hover-color: #{$bb-drawer-bar-hover-color}; --bb-drawer-bar-drag-color: #{$bb-drawer-bar-drag-color}; @@ -38,6 +39,7 @@ z-index: 2; pointer-events: auto; display: flex; + padding: var(--bb-drawer-padding); .drawer-content { overflow: auto; diff --git a/src/BootstrapBlazor/Components/Modal/Modal.razor.cs b/src/BootstrapBlazor/Components/Modal/Modal.razor.cs index 6e4cc7b1d68..20296f66620 100644 --- a/src/BootstrapBlazor/Components/Modal/Modal.razor.cs +++ b/src/BootstrapBlazor/Components/Modal/Modal.razor.cs @@ -110,7 +110,7 @@ internal void RemoveDialog(ModalDialog dialog) // 移除当前弹窗 Dialogs.Remove(dialog); - if (Dialogs.Any()) + if (Dialogs.Count > 0) { ResetShownDialog(Dialogs.Last()); } @@ -153,7 +153,7 @@ public async Task CloseCallback() } // 多级弹窗支持 - if (Dialogs.Any()) + if (Dialogs.Count > 0) { ResetShownDialog(Dialogs.Last()); } diff --git a/src/BootstrapBlazor/Components/Toggle/Toggle.razor.scss b/src/BootstrapBlazor/Components/Toggle/Toggle.razor.scss index 2fbf61af8ef..c44980c05b3 100644 --- a/src/BootstrapBlazor/Components/Toggle/Toggle.razor.scss +++ b/src/BootstrapBlazor/Components/Toggle/Toggle.razor.scss @@ -1,16 +1,16 @@ -.btn-toggle { - --bb-toggle-min-width: 70px; +.btn-toggle { + --bb-toggle-min-width: #{$bb-toggle-min-width}; + --bb-toggle-bg-color: #{$bb-toggle-bg-color}; + --bb-toggle-color: #{$bb-toggle-color}; + --bb-toggle-off-color: #{$bb-toggle-off-color}; + --bs-btn-hover-color: #fff; --bs-btn-border-color: #c0c4cc; --bs-btn-disabled-border-color: var(--bs-btn-border-color); --bs-btn-hover-border-color: var(--bs-btn-border-color); --bs-btn-active-border-color: var(--bs-btn-border-color); - --bs-btn-hover-color: #fff; - --bb-toggle-bg-color: #e0e0e0; - --bb-toggle-color: #fff; - --bb-toggle-off-color: #000; position: relative; overflow: hidden; - border: 1px solid #c0c4cc; + border: 1px solid var(--bs-btn-border-color); border-radius: var(--bs-border-radius); min-width: var(--bb-toggle-min-width); min-height: var(--bb-height); diff --git a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss index b3e530aa88c..c3fe843628b 100644 --- a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss +++ b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrap.blazor.scss @@ -234,6 +234,7 @@ $bb-divider-text-padding: 0 20px; // Drawer $bb-drawer-zindex: 1050; $bb-drawer-body-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12); +$bb-drawer-body-padding: 1rem; $bb-drawer-bar-bg: #d0d7de; $bb-drawer-bar-hover-color: #409eff; $bb-drawer-bar-drag-color: #0969da; @@ -589,4 +590,10 @@ $bb-timer-button-height: 66px; $bb-timer-button-padding: 0; $bb-timer-button-font-size: .75rem; +// Toggle +$bb-toggle-min-width: 70px; +$bb-toggle-bg-color: #e0e0e0; +$bb-toggle-color: #fff; +$bb-toggle-off-color: #000; + @import "../components.scss";