From 8273284c54ca040dac457b9ee943c29c57f6ac83 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Sat, 15 Jan 2022 17:21:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20dialog=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Dialog/DialogOption.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BootstrapBlazor/Components/Dialog/DialogOption.cs b/src/BootstrapBlazor/Components/Dialog/DialogOption.cs index 025f1dfb7..36e495ec3 100644 --- a/src/BootstrapBlazor/Components/Dialog/DialogOption.cs +++ b/src/BootstrapBlazor/Components/Dialog/DialogOption.cs @@ -36,6 +36,11 @@ public class DialogOption /// public Size Size { get; set; } = Size.Large; + /// + /// 获得/设置 全屏弹窗 默认 None + /// + public FullScreenSize FullScreenSize { get; set; } = FullScreenSize.None; + /// /// 获得/设置 是否垂直居中 默认为 true /// @@ -140,6 +145,7 @@ public class DialogOption var ret = new Dictionary { [nameof(Size)] = Size, + [nameof(FullScreenSize)] = FullScreenSize, [nameof(IsCentered)] = IsCentered, [nameof(IsScrolling)] = IsScrolling, [nameof(ShowCloseButton)] = ShowCloseButton, -- Gitee From e4b05b7c5ee2e635148d210e0ab3ef712adebd51 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Sat, 15 Jan 2022 17:22:00 +0800 Subject: [PATCH 2/4] chore: bump version beta09 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index be41c7a41..e6705b0b7 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 6.2.7-beta08 + 6.2.7-beta09 -- Gitee From bda44a22169154ca600409849b1baff1753c9f32 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Sat, 15 Jan 2022 17:22:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20Dialog=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/Dialogs.razor | 4 + .../Samples/Dialogs.razor.cs | 231 +++++++++--------- 2 files changed, 125 insertions(+), 110 deletions(-) diff --git a/src/BootstrapBlazor.Shared/Samples/Dialogs.razor b/src/BootstrapBlazor.Shared/Samples/Dialogs.razor index 692365724..ff8f6c17a 100644 --- a/src/BootstrapBlazor.Shared/Samples/Dialogs.razor +++ b/src/BootstrapBlazor.Shared/Samples/Dialogs.razor @@ -100,6 +100,10 @@ + + + +

通过设置 @nameof(DialogOption.PrintButtonText) 更改 打印预览 按钮文字

diff --git a/src/BootstrapBlazor.Shared/Samples/Dialogs.razor.cs b/src/BootstrapBlazor.Shared/Samples/Dialogs.razor.cs index db273d3f1..373fc65b0 100644 --- a/src/BootstrapBlazor.Shared/Samples/Dialogs.razor.cs +++ b/src/BootstrapBlazor.Shared/Samples/Dialogs.razor.cs @@ -164,6 +164,13 @@ public sealed partial class Dialogs Trace.Log($"弹窗返回值为: {result} 组件返回值为: {DemoValue1}"); } + private Task OnSizeDialogClick() => DialogService.Show(new DialogOption() + { + Title = "全屏窗口", + FullScreenSize = FullScreenSize.ExtraLarge, + BodyTemplate = builder => builder.AddContent(0, "屏幕小于 1200px 时全屏显示") + }); + private async Task OnPrintDialogClick() { var op = new DialogOption() @@ -221,115 +228,119 @@ public sealed partial class Dialogs /// 获得属性方法 /// /// - private static IEnumerable GetAttributes() + private static IEnumerable GetAttributes() => new AttributeItem[] { - return new AttributeItem[] - { - new AttributeItem() { - Name = "Component", - Description = "对话框 Body 中引用的组件的参数", - Type = "DynamicComponent", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "BodyContext", - Description = "弹窗传参", - Type = "object", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "HeaderTemplate", - Description = "模态主体 ModalHeader 模板", - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "BodyTemplate", - Description = "模态主体 ModalBody 组件", - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "FooterTemplate", - Description = "模态底部 ModalFooter 组件", - Type = "RenderFragment", - ValueList = " — ", - DefaultValue = " — " - }, - new AttributeItem() { - Name = "IsCentered", - Description = "是否垂直居中", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "IsScrolling", - Description = "是否弹窗正文超长时滚动", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "false" - }, - new AttributeItem() { - Name = "ShowCloseButton", - Description = "是否显示关闭按钮", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "ShowHeaderCloseButton", - Description = "是否显示标题栏右侧关闭按钮", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = "ShowFooter", - Description = "是否显示 Footer", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "true" - }, - new AttributeItem() { - Name = nameof(DialogOption.ShowPrintButton), - Description = "是否显示打印按钮", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "false" - }, - new AttributeItem() { - Name = nameof(DialogOption.ShowPrintButtonInHeader), - Description = "打印按钮是否显示在 Header 中", - Type = "boolean", - ValueList = "true|false", - DefaultValue = "false" - }, - new AttributeItem() { - Name = "Size", - Description = "尺寸", - Type = "Size", - ValueList = "None / ExtraSmall / Small / Medium / Large / ExtraLarge", - DefaultValue = "Large" - }, - new AttributeItem() { - Name = "Title", - Description = "弹窗标题", - Type = "string", - ValueList = " — ", - DefaultValue = " 未设置 " - }, - new AttributeItem() { - Name = nameof(DialogOption.PrintButtonText), - Description = "打印按钮显示文字", - Type = "string", - ValueList = " — ", - DefaultValue = "资源文件中设定值" - } - }; - } + new AttributeItem() { + Name = "Component", + Description = "对话框 Body 中引用的组件的参数", + Type = "DynamicComponent", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "BodyContext", + Description = "弹窗传参", + Type = "object", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "HeaderTemplate", + Description = "模态主体 ModalHeader 模板", + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "BodyTemplate", + Description = "模态主体 ModalBody 组件", + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "FooterTemplate", + Description = "模态底部 ModalFooter 组件", + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new AttributeItem() { + Name = "IsCentered", + Description = "是否垂直居中", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "IsScrolling", + Description = "是否弹窗正文超长时滚动", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "false" + }, + new AttributeItem() { + Name = "ShowCloseButton", + Description = "是否显示关闭按钮", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "ShowHeaderCloseButton", + Description = "是否显示标题栏右侧关闭按钮", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = "ShowFooter", + Description = "是否显示 Footer", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "true" + }, + new AttributeItem() { + Name = nameof(DialogOption.ShowPrintButton), + Description = "是否显示打印按钮", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "false" + }, + new AttributeItem() { + Name = nameof(DialogOption.ShowPrintButtonInHeader), + Description = "打印按钮是否显示在 Header 中", + Type = "boolean", + ValueList = "true|false", + DefaultValue = "false" + }, + new AttributeItem() { + Name = "Size", + Description = "尺寸", + Type = "Size", + ValueList = "None / ExtraSmall / Small / Medium / Large / ExtraLarge", + DefaultValue = "Large" + }, + new AttributeItem() { + Name = nameof(DialogOption.FullScreenSize), + Description = "小于特定尺寸时全屏", + Type = "Size", + ValueList = "None / Always / Small / Medium / Large / ExtraLarge", + DefaultValue = "None" + }, + new AttributeItem() { + Name = "Title", + Description = "弹窗标题", + Type = "string", + ValueList = " — ", + DefaultValue = " 未设置 " + }, + new AttributeItem() { + Name = nameof(DialogOption.PrintButtonText), + Description = "打印按钮显示文字", + Type = "string", + ValueList = " — ", + DefaultValue = "资源文件中设定值" + } + }; } -- Gitee From ffc9ca49af18c784b5660c530fc9cfb3386094f6 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Sat, 15 Jan 2022 17:22:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20Modal=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Shared/Samples/Modals.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor.Shared/Samples/Modals.razor.cs b/src/BootstrapBlazor.Shared/Samples/Modals.razor.cs index a1dc4f2f7..75f29a5f2 100644 --- a/src/BootstrapBlazor.Shared/Samples/Modals.razor.cs +++ b/src/BootstrapBlazor.Shared/Samples/Modals.razor.cs @@ -158,7 +158,7 @@ public sealed partial class Modals Name = nameof(ModalDialog.FullScreenSize), Description = "小于特定尺寸时全屏", Type = "Size", - ValueList = "None / Always / ExtraSmall / Small / Medium / Large / ExtraLarge", + ValueList = "None / Always / Small / Medium / Large / ExtraLarge", DefaultValue = "None" }, new AttributeItem() { -- Gitee