-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(WinBox): add ShowModal method (#4132)
* feat: 增加 ShowModal 方法 * style: 更新样式名称 * feat: 增加级联参数 * feat: 增加关闭弹窗按钮 * chore: 增加字典 * style: 增加内置样式 * feat: 增加 Stack 方法 * feat: 增加最大化最小化恢复窗口方法 * doc: 更新示例 * feat: 增加 Overflow 参数 * style: 增加不换行样式 * feat: 增加设置标题图标方法 * doc: 更新文档 * doc: 更新示例增加功能按钮 * feat: 更正OnShow 回调 * refactor: 删除冗余变量 * doc: 增加 Modal 示例 * refactor: 增加 modal 样式 * test: 更新 DateTimePicker 单元测试 * test: 增加 Root 单元测试 * test: 更新 Button 单元测试 * Revert "test: 更新 DateTimePicker 单元测试" This reverts commit b6a9875. * Revert "test: 更新 Button 单元测试" This reverts commit b82fe2a. * chore: bump version 8.0.0-beta04 * chore: bump version 8.0.0-beta04
- Loading branch information
Showing
16 changed files
with
441 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,3 +93,4 @@ webp | |
Pdfi | ||
simhei | ||
Hmmss | ||
winbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/BootstrapBlazor.Server/Components/Components/CustomWinBoxContent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="bb-winbox-body"> | ||
<h3>Custom WinBox Content Create @DateTime.Now</h3> | ||
</div> | ||
|
||
<div class="bb-winbox-footer"> | ||
<Button Text="Stack" OnClickWithoutRender="StackWinBox"></Button> | ||
<Button Text="Minimize" OnClickWithoutRender="MinWinBox"></Button> | ||
<Button Text="Maximize" OnClickWithoutRender="MaxWinBox"></Button> | ||
<Button Text="Restore" OnClickWithoutRender="RestoreWinBox"></Button> | ||
<Button Text="SetTitle" OnClickWithoutRender="SetTitleWinBox"></Button> | ||
<Button Text="SetIcon" OnClickWithoutRender="SetIconWinBox"></Button> | ||
<WinBoxCloseButton /> | ||
</div> |
64 changes: 64 additions & 0 deletions
64
src/BootstrapBlazor.Server/Components/Components/CustomWinBoxContent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) Argo Zhang ([email protected]). All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
// Website: https://www.blazor.zone or https://argozhang.github.io/ | ||
|
||
namespace BootstrapBlazor.Server.Components.Components; | ||
|
||
/// <summary> | ||
/// CustomWinBoxContent 组件 | ||
/// </summary> | ||
public partial class CustomWinBoxContent | ||
{ | ||
[Inject, NotNull] | ||
private WinBoxService? WinBoxService { get; set; } | ||
|
||
/// <summary> | ||
/// WinBoxOption 实例 | ||
/// </summary> | ||
[Parameter, NotNull] | ||
public WinBoxOption? Option { get; set; } | ||
|
||
private Task StackWinBox() => WinBoxService.Stack(); | ||
|
||
private async Task MinWinBox() | ||
{ | ||
if (Option != null) | ||
{ | ||
await WinBoxService.Minimize(Option); | ||
} | ||
} | ||
|
||
private async Task MaxWinBox() | ||
{ | ||
if (Option != null) | ||
{ | ||
await WinBoxService.Maximize(Option); | ||
} | ||
} | ||
|
||
private async Task RestoreWinBox() | ||
{ | ||
if (Option != null) | ||
{ | ||
await WinBoxService.Restore(Option); | ||
} | ||
} | ||
|
||
private async Task SetIconWinBox() | ||
{ | ||
if (Option != null) | ||
{ | ||
Option.Icon = "./images/Argo-C.png"; | ||
await WinBoxService.SetIcon(Option); | ||
} | ||
} | ||
|
||
private async Task SetTitleWinBox() | ||
{ | ||
if (Option != null) | ||
{ | ||
Option.Title = $"{DateTime.Now}"; | ||
await WinBoxService.SetTitle(Option); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Extensions/Components/BootstrapBlazor.WinBox/BootstrapBlazor.WinBox.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.