Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/BootstrapBlazor.Server/Components/Samples/Layouts.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
3 changes: 3 additions & 0 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "是否开启多标签模式",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.3.1-beta36</Version>
<Version>9.3.1-beta38</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/Layout/Layout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
{
@Side
}
@if (ShowSplitBar)
@if (ShowSplitebar)
{
<LayoutSplitebar></LayoutSplitebar>
<LayoutSplitebar Min="SidebarMinWidth" Max="SidebarMaxWidth"></LayoutSplitebar>
}
@if (Menus != null)
{
Expand Down
14 changes: 13 additions & 1 deletion src/BootstrapBlazor/Components/Layout/Layout.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,19 @@ public partial class Layout : IHandlerException
/// 仅在 左右布局时有效
/// </summary>
[Parameter]
public bool ShowSplitBar { get; set; }
public bool ShowSplitebar { get; set; }

/// <summary>
/// 获得/设置 侧边栏最小宽度 默认 null 未设置
/// </summary>
[Parameter]
public int? SidebarMinWidth { get; set; }

/// <summary>
/// 获得/设置 侧边栏最大宽度 默认 null 未设置
/// </summary>
[Parameter]
public int? SidebarMaxWidth { get; set; }

/// <summary>
/// 获得/设置 NotAuthorized 模板 默认 null NET6.0/7.0 有效
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{
<CascadingValue Value="this" IsFixed="true">
<EditForm @attributes="@AdditionalAttributes" id="@Id" Model="@Model"
data-bb-dissubmit="@DisableAutoSubmitString" data-bb-invalid-result="@ShowAllInvalidResultString"
style="@StyleString"
OnValidSubmit="@OnValidSubmitForm" OnInvalidSubmit="@OnInvalidSubmitForm">
data-bb-dissubmit="@DisableAutoSubmitString" data-bb-invalid-result="@ShowAllInvalidResultString"
style="@StyleString"
OnValidSubmit="@OnValidSubmitForm" OnInvalidSubmit="@OnInvalidSubmitForm">
<BootstrapBlazorDataAnnotationsValidator @ref="Validator" />
@ChildContent
</EditForm>
Expand Down
6 changes: 5 additions & 1 deletion test/UnitTest/Components/LayoutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down