mirror of https://github.com/abpframework/abp.git
7 changed files with 112 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility.EntityActions |
|||
{ |
|||
public class EntityAction |
|||
{ |
|||
public string Text { get; set; } |
|||
public Func<object, Task> Clicked { get; set; } |
|||
public string RequiredPolicy { get; set; } |
|||
public Func<object, string> ConfirmationMessage { get; set; } |
|||
public bool Primary { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility.EntityActions |
|||
{ |
|||
public class EntityActionDictionary : Dictionary<string, List<EntityAction>> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility.EntityActions |
|||
{ |
|||
public class EntityActionsConfiguration |
|||
{ |
|||
protected EntityActionDictionary EntityActions { get; set; } |
|||
|
|||
public EntityActionsConfiguration() |
|||
{ |
|||
EntityActions = new EntityActionDictionary(); |
|||
} |
|||
|
|||
public List<EntityAction> Get<T>() |
|||
{ |
|||
return EntityActions.GetOrAdd(typeof(T).FullName, () => new List<EntityAction>()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using JetBrains.Annotations; |
|||
using Microsoft.AspNetCore.Components; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Components.Extensibility.EntityActions; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility.TableColumns |
|||
{ |
|||
public class TableColumn |
|||
{ |
|||
public string Title { get; set; } |
|||
public string Data { get; set; } |
|||
[CanBeNull] |
|||
public Func<object, RenderFragment> Render { get; set; } |
|||
public List<EntityAction> Actions { get; set; } |
|||
|
|||
public TableColumn() |
|||
{ |
|||
Actions = new List<EntityAction>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility.TableColumns |
|||
{ |
|||
public class TableColumnDictionary : Dictionary<string, List<TableColumn>> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility.TableColumns |
|||
{ |
|||
public class TableColumnsConfiguration |
|||
{ |
|||
protected TableColumnDictionary TableColumns { get; set; } |
|||
|
|||
public TableColumnsConfiguration() |
|||
{ |
|||
TableColumns = new TableColumnDictionary(); |
|||
} |
|||
|
|||
public List<TableColumn> Get<T>() |
|||
{ |
|||
return TableColumns.GetOrAdd(typeof(T).FullName, () => new List<TableColumn>()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using Volo.Abp.AspNetCore.Components.Extensibility.EntityActions; |
|||
using Volo.Abp.AspNetCore.Components.Extensibility.TableColumns; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Extensibility |
|||
{ |
|||
public class UIExtensions |
|||
{ |
|||
public static UIExtensions Instance { get; protected set; } = new UIExtensions(); |
|||
|
|||
public EntityActionsConfiguration EntityActions { get; set; } |
|||
|
|||
public TableColumnsConfiguration TableColumns { get; set; } |
|||
|
|||
public UIExtensions() |
|||
{ |
|||
EntityActions = new EntityActionsConfiguration(); |
|||
TableColumns = new TableColumnsConfiguration(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue