abp rounded tag helper

pull/301/head
yekalkan 7 years ago
parent 419cd5c352
commit 0a81c22b7e

@ -5,7 +5,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Border
[HtmlTargetElement(Attributes = "abp-border")]
public class AbpBorderTagHelper : AbpTagHelper<AbpBorderTagHelper, AbpBorderTagHelperService>
{
public AbpBorderType AbpBorder { get; set; } = AbpBorderType._;
public AbpBorderType AbpBorder { get; set; } = AbpBorderType.Default;
public AbpBorderTagHelper(AbpBorderTagHelperService tagHelperService)
: base(tagHelperService)

@ -2,7 +2,7 @@
{
public enum AbpBorderType
{
_,
Default,
_0,
Primary,
Secondary,

@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Border
{
[HtmlTargetElement(Attributes = "abp-rounded")]
public class AbpRoundedTagHelper : AbpTagHelper<AbpRoundedTagHelper, AbpRoundedTagHelperService>
{
public AbpRoundedType AbpRounded { get; set; } = AbpRoundedType.Default;
public AbpRoundedTagHelper(AbpRoundedTagHelperService tagHelperService)
: base(tagHelperService)
{
}
}
}

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Razor.TagHelpers;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHelpers;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Border
{
public class AbpRoundedTagHelperService : AbpTagHelperService<AbpRoundedTagHelper>
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
var roundedClass = "rounded";
if (TagHelper.AbpRounded != AbpRoundedType.Default)
{
roundedClass += "-" + TagHelper.AbpRounded.ToString().ToLowerInvariant().Replace("_","");
}
output.Attributes.AddClass(roundedClass);
}
}
}

@ -0,0 +1,12 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Border
{
public enum AbpRoundedType
{
Default,
_0,
Top,
Right,
Left,
Bottom
}
}
Loading…
Cancel
Save