From f97395342622c74af1874afc86250b2f17f0873a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 17 Mar 2025 10:22:24 +0800 Subject: [PATCH 1/2] feat(TreeViewToolbarEditButton): add Icon parameter --- .../TreeView/TreeViewToolbarEditButton.razor | 2 +- .../TreeView/TreeViewToolbarEditButton.razor.cs | 13 ++++++++++++- src/BootstrapBlazor/Enums/ComponentIcons.cs | 5 +++++ src/BootstrapBlazor/Icons/BootstrapIcons.cs | 1 + src/BootstrapBlazor/Icons/FontAwesomeIcons.cs | 1 + src/BootstrapBlazor/Icons/MaterialDesignIcons.cs | 1 + 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor b/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor index 8ab219092fb..28db0e8051a 100644 --- a/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor +++ b/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor @@ -3,7 +3,7 @@ @inherits ComponentBase
- +
@Text diff --git a/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor.cs b/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor.cs index 247c48e207e..015b1356dae 100644 --- a/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor.cs +++ b/src/BootstrapBlazor/Components/TreeView/TreeViewToolbarEditButton.razor.cs @@ -37,11 +37,21 @@ public partial class TreeViewToolbarEditButton : ComponentBase public string? Title { get; set; } /// - /// Gets or sets the title of the popup-window. Default is null. + /// Gets or sets the text of the popup-window label. Default is null. /// [Parameter] public string? Text { get; set; } + /// + /// Gets or sets the icon of the edit button. Default is null. + /// + [Parameter] + public string? Icon { get; set; } + + [Inject] + [NotNull] + private IIconTheme? IconTheme { get; set; } + private string? _text; /// @@ -52,6 +62,7 @@ protected override void OnParametersSet() base.OnParametersSet(); _text = Item.Text; + Icon ??= IconTheme.GetIconByKey(ComponentIcons.TreeViewToolbarEditButton); } private async Task OnConfirm() diff --git a/src/BootstrapBlazor/Enums/ComponentIcons.cs b/src/BootstrapBlazor/Enums/ComponentIcons.cs index 471c07d4846..1d1d7b2177d 100644 --- a/src/BootstrapBlazor/Enums/ComponentIcons.cs +++ b/src/BootstrapBlazor/Enums/ComponentIcons.cs @@ -740,6 +740,11 @@ public enum ComponentIcons /// TreeViewLoadingIcon, + /// + /// TreeView 组件 ToolbarEditButton 属性图标 + /// + TreeViewToolbarEditButton, + /// /// TreeView 组件 NodeIcon 属性图标 /// diff --git a/src/BootstrapBlazor/Icons/BootstrapIcons.cs b/src/BootstrapBlazor/Icons/BootstrapIcons.cs index fa16c111a57..d06483d5f5b 100644 --- a/src/BootstrapBlazor/Icons/BootstrapIcons.cs +++ b/src/BootstrapBlazor/Icons/BootstrapIcons.cs @@ -178,6 +178,7 @@ internal static class BootstrapIcons { ComponentIcons.TreeViewSearchIcon, "bi bi-search" }, { ComponentIcons.TreeViewResetSearchIcon, "bi bi-backspace" }, { ComponentIcons.TreeViewLoadingIcon, "bi bi-arrow-clockwise bi-spin" }, + { ComponentIcons.TreeViewToolbarEditButton, "bi bi-check2-square" }, // Upload { ComponentIcons.AvatarUploadDeleteIcon, "bi bi-trash3" }, diff --git a/src/BootstrapBlazor/Icons/FontAwesomeIcons.cs b/src/BootstrapBlazor/Icons/FontAwesomeIcons.cs index c317e33e9fa..9503d061a45 100644 --- a/src/BootstrapBlazor/Icons/FontAwesomeIcons.cs +++ b/src/BootstrapBlazor/Icons/FontAwesomeIcons.cs @@ -176,6 +176,7 @@ internal static class FontAwesomeIcons { ComponentIcons.TreeViewSearchIcon, "fa-solid fa-magnifying-glass" }, { ComponentIcons.TreeViewResetSearchIcon, "fa-solid fa-delete-left" }, { ComponentIcons.TreeViewLoadingIcon, "fa-solid fa-spinner fa-spin" }, + { ComponentIcons.TreeViewToolbarEditButton, "fa-regular fa-pen-to-square" }, // Upload { ComponentIcons.AvatarUploadDeleteIcon, "fa-regular fa-trash-can" }, diff --git a/src/BootstrapBlazor/Icons/MaterialDesignIcons.cs b/src/BootstrapBlazor/Icons/MaterialDesignIcons.cs index b9691d768cd..7cc019d8d30 100644 --- a/src/BootstrapBlazor/Icons/MaterialDesignIcons.cs +++ b/src/BootstrapBlazor/Icons/MaterialDesignIcons.cs @@ -178,6 +178,7 @@ internal static class MaterialDesignIcons { ComponentIcons.TreeViewSearchIcon, "mdi mdi-magnify" }, { ComponentIcons.TreeViewResetSearchIcon, "mdi mdi-backspace" }, { ComponentIcons.TreeViewLoadingIcon, "mdi mdi-loading mdi-spin" }, + { ComponentIcons.TreeViewToolbarEditButton, "mdi mdi-file-edit-outline" }, // Upload { ComponentIcons.AvatarUploadDeleteIcon, "mdi mdi-trash-can-outline" }, From 2f3a63b6cc8c7eab2d51f441182181a3fbee709f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 17 Mar 2025 10:23:11 +0800 Subject: [PATCH 2/2] chore: bump version 9.5.0-beta01 --- 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 fb8f9b3c739..96f50b58957 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.4.9 + 9.5.0-beta01