diff --git a/src/BootstrapBlazor.Server/Components/Samples/Layouts.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Layouts.razor.cs index fa34f814ee0..96d296b3fbf 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Layouts.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Layouts.razor.cs @@ -124,6 +124,30 @@ private AttributeItem[] GetAttributes() => DefaultValue = "false" }, new() + { + Name = "SidebarMinWidth", + Description = Localizer["Layouts_SidebarMinWidth_Description"], + Type = "int?", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "SidebarMaxWidth", + Description = Localizer["Layouts_SidebarMaxWidth_Description"], + Type = "int?", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "ShowSplitebar", + Description = Localizer["Layouts_ShowSplitebar_Description"], + Type = "bool", + ValueList = "true|false", + DefaultValue = "false" + }, + new() { Name = "ShowFooter", Description = Localizer["Layouts_ShowFooter_Description"], diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index b8172bbe0cb..ba0a648598f 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -1432,6 +1432,9 @@ "Layouts_IsFixedFooter_Description": "Whether to fix the Footer component", "Layouts_IsFixedHeader_Description": "Whether to fix the Header component", "Layouts_ShowCollapseBar_Description": "Whether to show contraction and expansion Bar", + "Layouts_ShowSplitebar_Description": "Whether to display the left and right split bar", + "Layouts_SidebarMinWidth_Description": "Minimum sidebar width", + "Layouts_SidebarMaxWidth_Description": "Maximum sidebar width", "Layouts_ShowFooter_Description": "Whether to show Footer template", "Layouts_ShowGotoTop_Description": "Whether to display the back to top button", "Layouts_UseTabSet_Description": "Whether to open multi-label mode", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index faa7b275927..ec38247ee4d 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -1432,6 +1432,9 @@ "Layouts_IsFixedFooter_Description": "是否固定 Footer 组件", "Layouts_IsFixedHeader_Description": "是否固定 Header 组件", "Layouts_ShowCollapseBar_Description": "是否显示收缩展开 Bar", + "Layouts_ShowSplitebar_Description": "是否显示左右分割栏", + "Layouts_SidebarMinWidth_Description": "侧边栏最小宽度", + "Layouts_SidebarMaxWidth_Description": "侧边栏最大宽度", "Layouts_ShowFooter_Description": "是否显示 Footer 模板", "Layouts_ShowGotoTop_Description": "是否显示返回顶端按钮", "Layouts_UseTabSet_Description": "是否开启多标签模式", diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 67c57d3e006..128510531f7 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 9.3.1-beta36 + 9.3.1-beta38 diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor b/src/BootstrapBlazor/Components/Layout/Layout.razor index c0beaaddaca..6c6a9aaec5e 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor @@ -88,9 +88,9 @@ { @Side } - @if (ShowSplitBar) + @if (ShowSplitebar) { - + } @if (Menus != null) { diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs index 2e59a3738f8..ccdcc04446c 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs @@ -70,7 +70,19 @@ public partial class Layout : IHandlerException /// 仅在 左右布局时有效 /// [Parameter] - public bool ShowSplitBar { get; set; } + public bool ShowSplitebar { get; set; } + + /// + /// 获得/设置 侧边栏最小宽度 默认 null 未设置 + /// + [Parameter] + public int? SidebarMinWidth { get; set; } + + /// + /// 获得/设置 侧边栏最大宽度 默认 null 未设置 + /// + [Parameter] + public int? SidebarMaxWidth { get; set; } /// /// 获得/设置 NotAuthorized 模板 默认 null NET6.0/7.0 有效 diff --git a/src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor b/src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor index 3d77eff7a09..9b5ae3d6e45 100644 --- a/src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor +++ b/src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor @@ -6,9 +6,9 @@ { + data-bb-dissubmit="@DisableAutoSubmitString" data-bb-invalid-result="@ShowAllInvalidResultString" + style="@StyleString" + OnValidSubmit="@OnValidSubmitForm" OnInvalidSubmit="@OnInvalidSubmitForm"> @ChildContent diff --git a/test/UnitTest/Components/LayoutTest.cs b/test/UnitTest/Components/LayoutTest.cs index 71ed5141cf6..1b915fa9702 100644 --- a/test/UnitTest/Components/LayoutTest.cs +++ b/test/UnitTest/Components/LayoutTest.cs @@ -245,13 +245,17 @@ public void ShowLayouSidebar_Ok() pb.Add(a => a.UseTabSet, true); pb.Add(a => a.AdditionalAssemblies, new Assembly[] { GetType().Assembly }); pb.Add(a => a.IsFullSide, true); - pb.Add(a => a.ShowSplitBar, true); + pb.Add(a => a.ShowSplitebar, true); + pb.Add(a => a.SidebarMinWidth, 100); + pb.Add(a => a.SidebarMaxWidth, 300); pb.Add(a => a.Side, new RenderFragment(builder => { builder.AddContent(0, "test"); })); }); cut.Contains("layout-splitebar"); + cut.Contains("data-bb-min=\"100\""); + cut.Contains("data-bb-max=\"300\""); } [Fact]