diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableHeaderTagHelper.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableHeaderTagHelper.cs new file mode 100644 index 0000000000..39dee5ffb9 --- /dev/null +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableHeaderTagHelper.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Razor.TagHelpers; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +{ + [HtmlTargetElement("thead")] + public class AbpTableHeaderTagHelper : AbpTagHelper + { + public AbpTableHeaderTheme Theme { get; set; } = AbpTableHeaderTheme.Default; + + public AbpTableHeaderTagHelper(AbpTableHeaderTagHelperService tagHelperService) + : base(tagHelperService) + { + + } + } +} diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableHeaderTagHelperService.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableHeaderTagHelperService.cs new file mode 100644 index 0000000000..9a632f50dd --- /dev/null +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableHeaderTagHelperService.cs @@ -0,0 +1,28 @@ +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 AbpTableHeaderTagHelperService : AbpTagHelperService + { + public override void Process(TagHelperContext context, TagHelperOutput output) + { + SetTheme(context, output); + } + + protected virtual void SetTheme(TagHelperContext context, TagHelperOutput output) + { + switch (TagHelper.Theme) + { + case AbpTableHeaderTheme.Default: + return; + case AbpTableHeaderTheme.Dark: + output.Attributes.AddClass("thead-dark"); + return; + case AbpTableHeaderTheme.Light: + output.Attributes.AddClass("thead-light"); + return; + } + } + } +} \ No newline at end of file diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableTagHelperService.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableTagHelperService.cs index 63fec5ee92..86bfd43744 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableTagHelperService.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Table/AbpTableTagHelperService.cs @@ -16,7 +16,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table SetBorderStyle(context, output); SetSmall(context, output); SetStripedRows(context, output); - } protected virtual void SetResponsiveness(TagHelperContext context, TagHelperOutput output)