From 3101394350c53aaacc3bdb9c8f57763d3ed41bc2 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 28 Nov 2023 09:55:31 +0800 Subject: [PATCH] Compatible with `Font Awesome`. --- .../Form/AbpInputTagHelperService.cs | 22 +++++++++++++++++-- .../AbpDatePickerBaseTagHelperService.cs | 22 +++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs index 455848db84..877fe05e37 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs @@ -289,7 +289,16 @@ public class AbpInputTagHelperService : AbpTagHelperService label.Attributes.Add("data-bs-html", "true"); } label.Attributes.Add("title", TagHelper.LabelTooltip); - label.InnerHtml.AppendHtml($" "); + var iconClass = TagHelper.LabelTooltipIcon; + if (iconClass.StartsWith("bi-")) + { + iconClass = "bi " + iconClass; + } + else if (iconClass.StartsWith("fa-")) + { + iconClass = "fa " + iconClass; + } + label.InnerHtml.AppendHtml($" "); } return label.ToHtmlString(); @@ -372,7 +381,16 @@ public class AbpInputTagHelperService : AbpTagHelperService var innerOutput = await labelTagHelper.ProcessAndGetOutputAsync(attributeList, context, "label", TagMode.StartTagAndEndTag); if (!TagHelper.LabelTooltip.IsNullOrEmpty()) { - innerOutput.Content.AppendHtml($" "); + var iconClass = TagHelper.LabelTooltipIcon; + if (iconClass.StartsWith("bi-")) + { + iconClass = "bi " + iconClass; + } + else if (iconClass.StartsWith("fa-")) + { + iconClass = "fa " + iconClass; + } + innerOutput.Content.AppendHtml($" "); } return innerOutput.Render(_encoder); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs index 54e8720b17..d55c08b161 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs @@ -547,7 +547,16 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp } label.Attributes.Add("title", TagHelper.LabelTooltip); - label.InnerHtml.AppendHtml($" "); + var iconClass = TagHelper.LabelTooltipIcon; + if (iconClass.StartsWith("bi-")) + { + iconClass = "bi " + iconClass; + } + else if (iconClass.StartsWith("fa-")) + { + iconClass = "fa " + iconClass; + } + label.InnerHtml.AppendHtml($" "); } return label.ToHtmlString(); @@ -607,7 +616,16 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp await labelTagHelper.ProcessAndGetOutputAsync(attributeList, context, "label", TagMode.StartTagAndEndTag); if (!TagHelper.LabelTooltip.IsNullOrEmpty()) { - innerOutput.Content.AppendHtml($" "); + var iconClass = TagHelper.LabelTooltipIcon; + if (iconClass.StartsWith("bi-")) + { + iconClass = "bi " + iconClass; + } + else if (iconClass.StartsWith("fa-")) + { + iconClass = "fa " + iconClass; + } + innerOutput.Content.AppendHtml($" "); } return innerOutput.Render(Encoder);