mirror of https://github.com/abpframework/abp.git
12 changed files with 169 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
[HtmlTargetElement("abp-card", Attributes = "background")] |
||||
|
[HtmlTargetElement("abp-card-header", Attributes = "background")] |
||||
|
[HtmlTargetElement("abp-card-body", Attributes = "background")] |
||||
|
[HtmlTargetElement("abp-card-footer", Attributes = "background")] |
||||
|
public class AbpCardBackgroundTagHelper : AbpTagHelper<AbpCardBackgroundTagHelper, AbpCardBackgroundTagHelperService> |
||||
|
{ |
||||
|
public AbpCardBackgroundType Background { get; set; } = AbpCardBackgroundType.Default; |
||||
|
|
||||
|
public AbpCardBackgroundTagHelper(AbpCardBackgroundTagHelperService tagHelperService) |
||||
|
: base(tagHelperService) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardBackgroundTagHelperService : AbpTagHelperService<AbpCardBackgroundTagHelper> |
||||
|
{ |
||||
|
public override void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
SetBackground(context, output); |
||||
|
} |
||||
|
|
||||
|
protected virtual void SetBackground(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
if (TagHelper.Background == AbpCardBackgroundType.Default) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
output.Attributes.AddClass("bg-" + TagHelper.Background.ToString().ToLowerInvariant()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public enum AbpCardBackgroundType |
||||
|
{ |
||||
|
Default, |
||||
|
Primary, |
||||
|
Secondary, |
||||
|
Success, |
||||
|
Danger, |
||||
|
Warning, |
||||
|
Info, |
||||
|
Light, |
||||
|
Dark, |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public enum AbpCardBorderColorType |
||||
|
{ |
||||
|
Default, |
||||
|
Primary, |
||||
|
Secondary, |
||||
|
Success, |
||||
|
Danger, |
||||
|
Warning, |
||||
|
Info, |
||||
|
Light, |
||||
|
Dark, |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardFooterTagHelper : AbpTagHelper<AbpCardFooterTagHelper, AbpCardFooterTagHelperService> |
||||
|
{ |
||||
|
public AbpCardFooterTagHelper(AbpCardFooterTagHelperService tagHelperService) |
||||
|
: base(tagHelperService) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardFooterTagHelperService : AbpTagHelperService<AbpCardFooterTagHelper> |
||||
|
{ |
||||
|
public override void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
output.Attributes.AddClass("card-footer"); |
||||
|
output.TagName = "div"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
[HtmlTargetElement("abp-card", Attributes = "text-color")] |
||||
|
[HtmlTargetElement("abp-card-header", Attributes = "text-color")] |
||||
|
[HtmlTargetElement("abp-card-body", Attributes = "text-color")] |
||||
|
[HtmlTargetElement("abp-card-footer", Attributes = "text-color")] |
||||
|
public class AbpCardTextColorTagHelper : AbpTagHelper<AbpCardTextColorTagHelper, AbpCardTextColorTagHelperService> |
||||
|
{ |
||||
|
public AbpCardTextColorType TextColor { get; set; } = AbpCardTextColorType.Default; |
||||
|
|
||||
|
public AbpCardTextColorTagHelper(AbpCardTextColorTagHelperService tagHelperService) |
||||
|
: base(tagHelperService) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Microsoft.AspNetCore.Razor.TagHelpers; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public class AbpCardTextColorTagHelperService : AbpTagHelperService<AbpCardTextColorTagHelper> |
||||
|
{ |
||||
|
public override void Process(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
SetTextColor(context, output); |
||||
|
} |
||||
|
|
||||
|
protected virtual void SetTextColor(TagHelperContext context, TagHelperOutput output) |
||||
|
{ |
||||
|
if (TagHelper.TextColor == AbpCardTextColorType.Default) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
output.Attributes.AddClass("text-" + TagHelper.TextColor.ToString().ToLowerInvariant()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card |
||||
|
{ |
||||
|
public enum AbpCardTextColorType |
||||
|
{ |
||||
|
Default, |
||||
|
White, |
||||
|
Primary, |
||||
|
Secondary, |
||||
|
Success, |
||||
|
Danger, |
||||
|
Warning, |
||||
|
Info, |
||||
|
Light, |
||||
|
Dark |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue