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
2 changes: 2 additions & 0 deletions src/BootstrapBlazor/Components/Dialog/DialogOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public class DialogOption
/// <summary>
/// 获得/设置 全屏弹窗 默认 None
/// </summary>
/// <remarks>为保证功能正常,设置值后 <see cref="ShowMaximizeButton"/> <seealso cref="ShowResize"/> <seealso cref="IsDraggable"/> 均不可用</remarks>
public FullScreenSize FullScreenSize { get; set; } = FullScreenSize.None;

/// <summary>
/// 获得/设置 是否显示最大化按钮 默认 false 不显示
/// </summary>
/// <remarks>为保证功能正常,设置值为 true 后 <seealso cref="ShowResize"/> <seealso cref="IsDraggable"/> 均不可用</remarks>
public bool ShowMaximizeButton { get; set; }

/// <summary>
Expand Down
14 changes: 14 additions & 0 deletions src/BootstrapBlazor/Components/Modal/ModalDialog.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public partial class ModalDialog : IHandlerException
/// <summary>
/// 获得/设置 弹窗大小 默认为 <see cref="FullScreenSize.None"/>
/// </summary>
/// <remarks>为保证功能正常,设置值后 <see cref="ShowMaximizeButton"/> <seealso cref="ShowResize"/> <seealso cref="IsDraggable"/> 均不可用</remarks>
[Parameter]
public FullScreenSize FullScreenSize { get; set; }

Expand All @@ -85,6 +86,7 @@ public partial class ModalDialog : IHandlerException
/// <summary>
/// 获得/设置 是否显示最大化按钮 默认为 false
/// </summary>
/// <remarks>为保证功能正常,设置值为 true 后 <seealso cref="ShowResize"/> <seealso cref="IsDraggable"/> 均不可用</remarks>
[Parameter]
public bool ShowMaximizeButton { get; set; }

Expand Down Expand Up @@ -329,6 +331,18 @@ protected override void OnParametersSet()
ExportPdfButtonOptions.Icon ??= IconTheme.GetIconByKey(ComponentIcons.TableExportPdfIcon);

MaximizeIconString = MaximizeWindowIcon;

if (FullScreenSize != FullScreenSize.None)
{
ShowMaximizeButton = false;
ShowResize = false;
IsDraggable = false;
}
else if (ShowMaximizeButton)
{
ShowResize = false;
IsDraggable = false;
}
}

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion test/UnitTest/Components/DialogTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ await cut.InvokeAsync(() => dialog.Show(new DialogOption()
return Task.CompletedTask;
}
}));
Assert.Contains("<svg", cut.Markup);

// 由于设置了 ShowMaximizeButton 导致 ShowResize 参数失效
Assert.DoesNotContain("<svg", cut.Markup);
Assert.Contains("data-bs-backdrop=\"static\"", cut.Markup);

// 全屏按钮
Expand Down