Browse Source

UI extensions initial implementation.

pull/7686/head
Ilkay Ilknur 6 years ago
parent
commit
98c17468ae
  1. 14
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityAction.cs
  2. 9
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityActionDictionary.cs
  3. 19
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityActionsConfiguration.cs
  4. 22
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/TableColumns/TableColumn.cs
  5. 9
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/TableColumns/TableColumnDictionary.cs
  6. 19
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/TableColumns/TableColumnsConfiguration.cs
  7. 20
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/UIExtensions.cs

14
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityAction.cs

@ -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; }
}
}

9
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityActionDictionary.cs

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Components.Extensibility.EntityActions
{
public class EntityActionDictionary : Dictionary<string, List<EntityAction>>
{
}
}

19
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/EntityActions/EntityActionsConfiguration.cs

@ -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>());
}
}
}

22
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/TableColumns/TableColumn.cs

@ -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>();
}
}
}

9
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/TableColumns/TableColumnDictionary.cs

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Components.Extensibility.TableColumns
{
public class TableColumnDictionary : Dictionary<string, List<TableColumn>>
{
}
}

19
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/TableColumns/TableColumnsConfiguration.cs

@ -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>());
}
}
}

20
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/Extensibility/UIExtensions.cs

@ -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…
Cancel
Save