@if (message.Role == ChatRole.User)
{
-

+

}
else
{
diff --git a/src/BootstrapBlazor.Server/Components/Pages/Index.razor b/src/BootstrapBlazor.Server/Components/Pages/Index.razor
index b108059f8e9..af0e0b7d23f 100644
--- a/src/BootstrapBlazor.Server/Components/Pages/Index.razor
+++ b/src/BootstrapBlazor.Server/Components/Pages/Index.razor
@@ -7,13 +7,14 @@
diff --git a/src/BootstrapBlazor.Server/Components/Pages/Index.razor.css b/src/BootstrapBlazor.Server/Components/Pages/Index.razor.css
index 52f83a19bad..8ee3049ac6a 100644
--- a/src/BootstrapBlazor.Server/Components/Pages/Index.razor.css
+++ b/src/BootstrapBlazor.Server/Components/Pages/Index.razor.css
@@ -38,6 +38,11 @@
border-radius: 30px;
}
+ .bd-masthead .bb-logo .holder {
+ background-color: var(--bb-primary-color);
+ }
+
+ .bd-masthead .bb-logo .holder,
.bd-masthead .bb-logo img {
width: calc(100% - 2 * var(--bb-btn-space));
height: calc(100% - 2 * var(--bb-btn-space));
diff --git a/src/BootstrapBlazor.Server/Components/Routes.razor b/src/BootstrapBlazor.Server/Components/Routes.razor
index f90a06ec137..bb2e405ae65 100644
--- a/src/BootstrapBlazor.Server/Components/Routes.razor
+++ b/src/BootstrapBlazor.Server/Components/Routes.razor
@@ -1,5 +1,6 @@
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/BootstrapBlazorIcons.razor b/src/BootstrapBlazor.Server/Components/Samples/BootstrapBlazorIcons.razor
index 3e4935cc602..63baa245905 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/BootstrapBlazorIcons.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/BootstrapBlazorIcons.razor
@@ -1,5 +1,6 @@
@page "/icon"
@inject IStringLocalizer
Localizer
+@inject IOptions WebsiteOption
@Localizer["IconsTitle"]
@@ -24,6 +25,6 @@
-
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor b/src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor
new file mode 100644
index 00000000000..42dc629903c
--- /dev/null
+++ b/src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor
@@ -0,0 +1,32 @@
+@page "/dom2image"
+
+@Localizer["Dom2ImageTitle"]
+
+@Localizer["Dom2ImageIntro"]
+
+
+
+
+
+ @((MarkupString)Localizer["Dom2ImageDesc"].Value)
+
+
+
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(_imageData))
+ {
+
+ }
+
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor.cs
new file mode 100644
index 00000000000..733cf684830
--- /dev/null
+++ b/src/BootstrapBlazor.Server/Components/Samples/Dom2Images.razor.cs
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License
+// See the LICENSE file in the project root for more information.
+// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
+
+namespace BootstrapBlazor.Server.Components.Samples;
+
+///
+/// Dom2Image 组件
+///
+public partial class Dom2Images
+{
+ [Inject]
+ [NotNull]
+ private IStringLocalizer? LocalizerFoo { get; set; }
+
+ [Inject]
+ [NotNull]
+ private IDom2ImageService? Dom2ImageService { get; set; }
+
+ [Inject]
+ [NotNull]
+ private IStringLocalizer? Localizer { get; set; }
+
+ [NotNull]
+ private List? Items { get; set; }
+
+ private string? _imageData;
+
+ ///
+ ///
+ ///
+ protected override void OnInitialized()
+ {
+ base.OnInitialized();
+
+ Items = Foo.GenerateFoo(LocalizerFoo);
+ }
+
+ private async Task OnGetUrlAsync()
+ {
+ _imageData = await Dom2ImageService.GetUrlAsync("#table-9527");
+ }
+
+ private async Task OnDownloadAsync()
+ {
+ var fileName = $"table-9527-{DateTime.Now:HHmmss}";
+ await Dom2ImageService.DownloadAsync("#table-9527", fileName);
+ }
+
+ private async Task OnFullAsync()
+ {
+ var fileName = $"full-{DateTime.Now:HHmmss}";
+ await Dom2ImageService.DownloadAsync(".tabs-body-content:not(.d-none)", fileName);
+ }
+}
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Editors.razor b/src/BootstrapBlazor.Server/Components/Samples/Editors.razor
index b296e9a3330..9158f8c4dd0 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Editors.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/Editors.razor
@@ -1,7 +1,9 @@
@page "/editor"
+
@inject SwalService SwalService
@inject PackageVersionService VersionManager
@inject IStringLocalizer Localizer
+@inject IOptionsMonitor WebsiteOption
@Localizer["EditorsTitle"]
@@ -38,7 +40,7 @@
-
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Editors.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Editors.razor.cs
index cd97b1d1478..2c340824e87 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Editors.razor.cs
+++ b/src/BootstrapBlazor.Server/Components/Samples/Editors.razor.cs
@@ -111,6 +111,17 @@ private async Task InsertHtmlAsync()
await Editor.DoMethodAsync("pasteHTML", $"{Localizer["DoMethodAsyncPasteHTML"]}
");
}
+ private async Task OnFileUpload(EditorUploadFile uploadFile)
+ {
+ var url = Path.Combine("images", "uploader", $"{Path.GetFileNameWithoutExtension(uploadFile.FileName)}-{DateTimeOffset.Now:yyyyMMddHHmmss}{Path.GetExtension(uploadFile.FileName)}");
+ var fileName = Path.Combine(WebsiteOption.CurrentValue.WebRootPath, url);
+ await uploadFile.SaveToFileAsync(fileName);
+
+ // 此处返回空字符串底层使用 URL.createObjectURL 方法创建 Blob 对象地址
+ // 实战中可以返回 SSO 地址或者 base64 字符串等
+ return "";
+ }
+
private string? _editorCode;
private async Task OnGetCode()
@@ -167,6 +178,14 @@ private AttributeItem[] GetAttributes() =>
Type = "IEnumerable",
ValueList = " — ",
DefaultValue = " — "
+ },
+ new()
+ {
+ Name = "OnFileUpload",
+ Description = Localizer["OnFileUploadAttribute"],
+ Type = "Func",
+ ValueList = " — ",
+ DefaultValue = " — "
}
];
}
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Html2Images.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Html2Images.razor.cs
index 9ebe519aecc..f50a2aaa437 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Html2Images.razor.cs
+++ b/src/BootstrapBlazor.Server/Components/Samples/Html2Images.razor.cs
@@ -10,13 +10,6 @@ namespace BootstrapBlazor.Server.Components.Samples;
///
public partial class Html2Images
{
- ///
- /// 获得 IconTheme 实例
- ///
- [Inject]
- [NotNull]
- private IIconTheme? IconTheme { get; set; }
-
[Inject]
[NotNull]
private IStringLocalizer? LocalizerFoo { get; set; }
@@ -29,10 +22,6 @@ public partial class Html2Images
[NotNull]
private IStringLocalizer? Localizer { get; set; }
- [Inject]
- [NotNull]
- private NavigationManager? NavigationManager { get; set; }
-
[NotNull]
private List? Items { get; set; }
diff --git a/src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor.cs
index 1c0c7ce673a..175db17dd0d 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor.cs
+++ b/src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor.cs
@@ -3,8 +3,6 @@
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
-using System.ComponentModel;
-
namespace BootstrapBlazor.Server.Components.Samples;
///
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor b/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor
index 3196a4cc376..90a8c2f40dc 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor
@@ -66,4 +66,19 @@
+
+
+
+ - @((MarkupString)Localizer["PopoversManualDescLI1"].Value)
+ - @((MarkupString)Localizer["PopoversManualDescLI2"].Value)
+
+
+
+
+
+
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor.cs
index 40c694123cd..c9a32d7ca07 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor.cs
+++ b/src/BootstrapBlazor.Server/Components/Samples/Popovers.razor.cs
@@ -18,6 +18,16 @@ public sealed partial class Popovers
private string? _templateTitle;
+ private Popover? _popover;
+
+ private async Task ToggleShow()
+ {
+ if (_popover != null)
+ {
+ await _popover.Toggle();
+ }
+ }
+
///
///
///
diff --git a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs
index cf0dd455f5c..fcdca1de2c0 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs
+++ b/src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor.cs
@@ -99,14 +99,6 @@ class SelectTableMode
///
private AttributeItem[] GetAttributes() =>
[
- new()
- {
- Name = "Items",
- Description = Localizer["AttributeItems"],
- Type = "IEnumerable",
- ValueList = " — ",
- DefaultValue = " — "
- },
new()
{
Name = "TableColumns",
diff --git a/src/BootstrapBlazor.Server/Components/Samples/SvgEditors.razor b/src/BootstrapBlazor.Server/Components/Samples/SvgEditors.razor
index 8d8c0ad844a..9948dad8f30 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/SvgEditors.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/SvgEditors.razor
@@ -3,6 +3,8 @@
@Localizer["SvgEditorTitle"]
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesFilter.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesFilter.razor
index 215cd90e2c3..997fe95c8f4 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesFilter.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesFilter.razor
@@ -88,7 +88,13 @@
-
+
+
+
+
+
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor b/src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor
new file mode 100644
index 00000000000..3dda0358228
--- /dev/null
+++ b/src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor
@@ -0,0 +1,16 @@
+@page "/task-board"
+@using BootstrapBlazor.Components.Tasks
+
+@inject IStringLocalizer Localizer
+
+@Localizer["TaskBoardTitle"]
+
+@Localizer["TaskBoardIntro"]
+
+
+
+
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor.cs
new file mode 100644
index 00000000000..ca232a02e09
--- /dev/null
+++ b/src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor.cs
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License
+// See the LICENSE file in the project root for more information.
+// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
+
+namespace BootstrapBlazor.Server.Components.Samples;
+
+///
+/// TaskBoard 组件示例
+///
+public partial class TaskBoard
+{
+
+}
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor b/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor
index 73434013139..0f4bfad44a5 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor
@@ -88,4 +88,19 @@
+
+
+
+ - @((MarkupString)Localizer["TooltipsManualDescLI1"].Value)
+ - @((MarkupString)Localizer["TooltipsManualDescLI2"].Value)
+
+
+
+
+
+
+
+
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor.cs
index f6392484fa3..ca0274194e4 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor.cs
+++ b/src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor.cs
@@ -20,6 +20,16 @@ public partial class Tooltips
private static string HtmlString => "This is Blazor tooltip";
+ private Tooltip? _tooltip;
+
+ private async Task ToggleShow()
+ {
+ if (_tooltip != null)
+ {
+ await _tooltip.Toggle();
+ }
+ }
+
///
/// 获得属性方法
///
diff --git a/src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor b/src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor
index a51b377624f..f7633160bbb 100644
--- a/src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor
+++ b/src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor
@@ -1,6 +1,7 @@
@page "/tutorials/template5"
@layout TutorialsLayout
@inherits WebSiteModuleComponentBase
+@inject IOptions WebsiteOption
@attribute [JSModuleAutoLoader("Samples/Tutorials/LoginAndRegister/Template5.razor.js", AutoInvokeDispose = false)]
@@ -57,7 +58,7 @@
-
+