diff --git a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css
index 72f1d1fe17a..14e158574b7 100644
--- a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css
+++ b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css
@@ -59,8 +59,6 @@
--bs-btn-hover-bg: var(--bb-layout-button-hover-bg);
--bs-btn-active-bg: var(--bb-layout-button-active-bg);
box-shadow: var(--bb-layout-button-shadow);
- right: 1rem;
- bottom: 9rem;
}
::deep .btn-theme img {
diff --git a/src/BootstrapBlazor.Server/Components/Layout/BaseLayout.razor.css b/src/BootstrapBlazor.Server/Components/Layout/BaseLayout.razor.css
index fdda5614f14..0cd9a6f5bfe 100644
--- a/src/BootstrapBlazor.Server/Components/Layout/BaseLayout.razor.css
+++ b/src/BootstrapBlazor.Server/Components/Layout/BaseLayout.razor.css
@@ -1,60 +1,4 @@
-::deep .btn-fade {
- opacity: 0.7;
- box-shadow: var(--bb-layout-button-shadow);
- transition: opacity .3s linear;
- position: fixed;
- z-index: 1001;
-}
-
- ::deep .btn-fade:hover {
- opacity: 1;
- }
-
-::deep .btn-update {
- --bs-btn-bg: var(--bb-layout-button-update-bg);
- --bs-btn-hover-bg: var(--bs-btn-bg);
- --bs-btn-active-bg: var(--bs-btn-bg);
- bottom: 5rem;
- right: 1rem;
- overflow: hidden;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-
- ::deep .btn-update img {
- width: 55%;
- margin-inline-start: 2px;
- }
-
-::deep .btn-chat {
- --bs-btn-bg: var(--bb-layout-button-bg);
- --bs-btn-hover-bg: var(--bb-layout-button-hover-bg);
- --bs-btn-active-bg: var(--bb-layout-button-active-bg);
- box-shadow: var(--bb-layout-button-shadow);
- right: 1rem;
- bottom: 13rem;
- display: flex;
- align-items: center;
- justify-content: center;
- color: var(--bb-button-chat-color);
-}
-
-::deep .btn-theme-mode {
- --bs-btn-bg: var(--bb-layout-button-bg);
- --bs-btn-hover-bg: var(--bb-layout-button-hover-bg);
- --bs-btn-active-bg: var(--bb-layout-button-active-bg);
- box-shadow: var(--bb-layout-button-shadow);
- bottom: 17rem;
- right: 1rem;
- overflow: hidden;
- display: flex;
- justify-content: center;
- align-items: center;
- color: var(--bb-button-chat-color);
-}
-
-::deep pre {
+::deep pre {
color: #e83e8c;
margin-bottom: 0;
max-height: 260px;
diff --git a/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor b/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor
index 3f631c316e7..1bf3a7b6482 100644
--- a/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor
+++ b/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor
@@ -18,11 +18,25 @@
@Body
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ @*
+
+ *@
+
+
+
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css b/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css
index ba65bb28d5f..1c30fb850ea 100644
--- a/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css
+++ b/src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor.css
@@ -72,6 +72,70 @@
background-color: var(--bb-sidebar-body-drag-hover-bg);
}
+::deep .dial-button {
+ display: none;
+ position: fixed;
+ right: 1rem;
+ bottom: 1rem;
+}
+
+::deep .btn-fade {
+ opacity: 0.7;
+ box-shadow: var(--bb-layout-button-shadow);
+ transition: opacity .3s linear;
+}
+
+ ::deep .btn-fade:hover {
+ opacity: 1;
+ }
+
+::deep .btn-update {
+ --bs-btn-bg: var(--bb-layout-button-update-bg);
+ --bs-btn-hover-bg: var(--bs-btn-bg);
+ --bs-btn-active-bg: var(--bs-btn-bg);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+ ::deep .btn-update img {
+ width: 55%;
+ margin-inline-start: 2px;
+ }
+
+::deep .btn-chat {
+ --bs-btn-bg: var(--bb-layout-button-bg);
+ --bs-btn-hover-bg: var(--bb-layout-button-hover-bg);
+ --bs-btn-active-bg: var(--bb-layout-button-active-bg);
+ box-shadow: var(--bb-layout-button-shadow);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--bb-button-chat-color);
+}
+
+::deep .btn-theme-mode {
+ --bs-btn-bg: var(--bb-layout-button-bg);
+ --bs-btn-hover-bg: var(--bb-layout-button-hover-bg);
+ --bs-btn-active-bg: var(--bb-layout-button-active-bg);
+ box-shadow: var(--bb-layout-button-shadow);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: var(--bb-button-chat-color);
+}
+
+.dial-button-gear {
+ background-color: var(--bb-primary-color);
+ border-radius: 50%;
+ padding: 4px;
+ cursor: pointer;
+}
+
+ .dial-button-gear img {
+ width: 100%;
+ }
+
@media (min-width: 768px) {
.section {
--bb-layout-sidebar-width: 300px;
@@ -102,4 +166,8 @@
.sidebar-bar {
display: block;
}
+
+ ::deep .dial-button {
+ display: block;
+ }
}
diff --git a/src/BootstrapBlazor/Components/Button/DialButton.razor b/src/BootstrapBlazor/Components/Button/DialButton.razor
index b541822422a..29192cbeb48 100644
--- a/src/BootstrapBlazor/Components/Button/DialButton.razor
+++ b/src/BootstrapBlazor/Components/Button/DialButton.razor
@@ -29,7 +29,14 @@
OnClickItem(item))">
@if (ItemTemplate == null)
{
-
+ if(item.ChildContent != null)
+ {
+ @item.ChildContent
+ }
+ else
+ {
+
+ }
}
else
{
diff --git a/src/BootstrapBlazor/Components/Button/DialButtonItem.cs b/src/BootstrapBlazor/Components/Button/DialButtonItem.cs
index e871015f1b2..9c6c31ed3ff 100644
--- a/src/BootstrapBlazor/Components/Button/DialButtonItem.cs
+++ b/src/BootstrapBlazor/Components/Button/DialButtonItem.cs
@@ -11,25 +11,25 @@ namespace BootstrapBlazor.Components;
public class DialButtonItem : ComponentBase, IDisposable
{
///
- /// 显示图标
+ /// 获得/设置 显示图标
///
[Parameter]
[NotNull]
-#if NET6_0_OR_GREATER
- [EditorRequired]
-#endif
public string? Icon { get; set; }
///
- /// 选项值
+ /// 获得/设置 选项值
///
[Parameter]
[NotNull]
-#if NET6_0_OR_GREATER
- [EditorRequired]
-#endif
public string? Value { get; set; }
+ ///
+ /// 获得/设置 组件内容
+ ///
+ [Parameter]
+ public RenderFragment? ChildContent { get; set; }
+
[CascadingParameter]
private List? Items { get; set; }
diff --git a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss
index f52ebcf2aa1..cd444608d53 100644
--- a/src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss
+++ b/src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss
@@ -60,7 +60,7 @@ $bb-button-circle-height: 45px;
// Button DialogButton
$bb-dial-list-zindex: 5;
-$bb-dial-item-padding: 0.25rem 1rem;
+$bb-dial-item-padding: 0;
$bb-dial-item-hover-bg: #e9ecef;
$bb-dial-item-margin: 6px;
$bb-dial-item-width: 40px;
diff --git a/test/UnitTest/Components/DialButtonTest.cs b/test/UnitTest/Components/DialButtonTest.cs
index a942f8bdcd8..fb2c2683b4c 100644
--- a/test/UnitTest/Components/DialButtonTest.cs
+++ b/test/UnitTest/Components/DialButtonTest.cs
@@ -222,6 +222,24 @@ public void ItemTemplate_Ok()
cut.Contains("test-fa-solid fa-cut-cut");
}
+ [Fact]
+ public void Item_ChildContent_Ok()
+ {
+ var cut = Context.RenderComponent(pb =>
+ {
+ pb.Add(i => i.ChildContent, new RenderFragment(pb =>
+ {
+ pb.OpenComponent(0);
+ pb.AddAttribute(1, "ChildContent", new RenderFragment(pb =>
+ {
+ pb.AddContent(0, "test-ChildContent");
+ }));
+ pb.CloseComponent();
+ }));
+ });
+ cut.Contains("test-ChildContent");
+ }
+
[Fact]
public void DialButtonItem_Ok()
{