mirror of https://github.com/abpframework/abp.git
3 changed files with 64 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table |
|||
{ |
|||
public enum AbpTableStyle |
|||
{ |
|||
Default, |
|||
Primary, |
|||
Secondary, |
|||
Success, |
|||
Danger, |
|||
Warning, |
|||
Info, |
|||
Light, |
|||
Dark, |
|||
Active, |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table |
|||
{ |
|||
[HtmlTargetElement("tr")] |
|||
[HtmlTargetElement("td")] |
|||
public class AbpTableStyleTagHelper : AbpTagHelper<AbpTableStyleTagHelper, AbpTableStyleTagHelperService> |
|||
{ |
|||
public AbpTableStyle AbpTableStyle { get; set; } = AbpTableStyle.Default; |
|||
|
|||
public AbpTableStyle AbpDarkTableStyle { get; set; } = AbpTableStyle.Default; |
|||
|
|||
public AbpTableStyleTagHelper(AbpTableStyleTagHelperService tagHelperService) |
|||
: base(tagHelperService) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHelpers; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table |
|||
{ |
|||
public class AbpTableStyleTagHelperService : AbpTagHelperService<AbpTableStyleTagHelper> |
|||
{ |
|||
public override void Process(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
SetStyle(context,output); |
|||
} |
|||
|
|||
protected virtual void SetStyle(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
if (TagHelper.AbpTableStyle != AbpTableStyle.Default) |
|||
{ |
|||
output.Attributes.AddClass("table-" + TagHelper.AbpTableStyle.ToString().ToLowerInvariant()); |
|||
} |
|||
} |
|||
|
|||
protected virtual void SetDarkTableStyle(TagHelperContext context, TagHelperOutput output) |
|||
{ |
|||
if (TagHelper.AbpDarkTableStyle != AbpTableStyle.Default) |
|||
{ |
|||
output.Attributes.AddClass("bg-" + TagHelper.AbpDarkTableStyle.ToString().ToLowerInvariant()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue