Added default button removal feature

This commit is contained in:
2025-02-05 17:56:08 +01:00
parent 23c5115c99
commit 43fda30a01
4 changed files with 34 additions and 17 deletions

View File

@@ -4,8 +4,9 @@ using Microsoft.FluentUI.AspNetCore.Components;
namespace HopFrame.Web.Plugins.Events;
public class PageInitializedEvent(HopFrameTablePage sender) : HopFrameTablePageEventArgs(sender) {
public class TableInitializedEvent(HopFrameTablePage sender) : HopFrameTablePageEventArgs(sender) {
public List<PluginButton> PluginButtons { get; } = new();
public DefaultButtonToggles DefaultButtons { get; set; } = new();
public void AddPageButton(string title, Func<Task> callback, bool pushRight = false, IconInfo? icon = null) {
PluginButtons.Add(new() {
@@ -91,3 +92,10 @@ public enum PluginButtonPosition {
TopRight = 1,
OnEntry = 2
}
public struct DefaultButtonToggles() {
public bool ShowRefreshButton { get; set; } = true;
public bool ShowAddEntityButton { get; set; } = true;
public bool ShowDeleteButton { get; set; } = true;
public bool ShowEditButton { get; set; } = true;
}

View File

@@ -54,5 +54,4 @@ internal sealed class PluginOrchestrator(IServiceProvider services) : IPluginOrc
return @event;
}
}