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: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.4.9</Version>
<Version>9.5.0-beta01</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@inherits ComponentBase

<div class="tree-node-toolbar-edit" @onclick:preventDefault @onclick:stopPropagation>
<PopConfirmButton Icon="fa-solid fa-gear" Title="@Title" OnConfirm="OnConfirm">
<PopConfirmButton Icon="@Icon" Title="@Title" OnConfirm="OnConfirm">
<BodyTemplate>
<div class="tree-view-edit-form">
<span>@Text</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@ public partial class TreeViewToolbarEditButton<TItem> : ComponentBase
public string? Title { get; set; }

/// <summary>
/// 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.
/// </summary>
[Parameter]
public string? Text { get; set; }

/// <summary>
/// Gets or sets the icon of the edit button. Default is null.
/// </summary>
[Parameter]
public string? Icon { get; set; }

[Inject]
[NotNull]
private IIconTheme? IconTheme { get; set; }

private string? _text;

/// <summary>
Expand All @@ -52,6 +62,7 @@ protected override void OnParametersSet()
base.OnParametersSet();

_text = Item.Text;
Icon ??= IconTheme.GetIconByKey(ComponentIcons.TreeViewToolbarEditButton);
}

private async Task OnConfirm()
Expand Down
5 changes: 5 additions & 0 deletions src/BootstrapBlazor/Enums/ComponentIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,11 @@ public enum ComponentIcons
/// </summary>
TreeViewLoadingIcon,

/// <summary>
/// TreeView 组件 ToolbarEditButton 属性图标
/// </summary>
TreeViewToolbarEditButton,

/// <summary>
/// TreeView 组件 NodeIcon 属性图标
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor/Icons/BootstrapIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor/Icons/FontAwesomeIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapBlazor/Icons/MaterialDesignIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down