From 0f4d118069e0030a8de698d9a07ed95f31d8700e Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 14 Dec 2018 11:30:42 +0300 Subject: [PATCH] added outline option for abp-button tag helper --- .../TagHelpers/Button/AbpButtonTagHelper.cs | 1 + .../Button/AbpButtonTagHelperServiceBase.cs | 2 +- .../TagHelpers/Button/AbpButtonType.cs | 8 ++++++ .../Pages/Components/Buttons.cshtml | 27 +++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelper.cs index 1be9524800..afd718da8f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelper.cs @@ -26,3 +26,4 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button } } } + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelperServiceBase.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelperServiceBase.cs index 3d8a3bf4e8..b6f2e8f3d1 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelperServiceBase.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonTagHelperServiceBase.cs @@ -26,7 +26,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button if (TagHelper.ButtonType != AbpButtonType.Default) { - output.Attributes.AddClass("btn-" + TagHelper.ButtonType.ToString().ToLowerInvariant()); + output.Attributes.AddClass("btn-" + TagHelper.ButtonType.ToString().ToLowerInvariant().Replace("_","-")); } if (TagHelper.Size != AbpButtonSize.Default) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonType.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonType.cs index 07d7e0a50b..a6ced457e0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonType.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Button/AbpButtonType.cs @@ -11,6 +11,14 @@ Info, Light, Dark, + Outline_Primary, + Outline_Secondary, + Outline_Success, + Outline_Danger, + Outline_Warning, + Outline_Info, + Outline_Light, + Outline_Dark, Link } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml index dc34aa32a9..6fe8f26395 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml @@ -47,6 +47,33 @@

# Example

+
+
+ Primary + Secondary + Success + Danger + Warning + Info + Light + Dark +
+
+
+<abp-button button-type="Outline_Primary">Primary</abp-button>
+<abp-button button-type="Outline_Secondary">Secondary</abp-button>
+<abp-button button-type="Outline_Success">Success</abp-button>
+<abp-button button-type="Outline_Danger">Danger</abp-button>
+<abp-button button-type="Outline_Warning">Warning</abp-button>
+<abp-button button-type="Outline_Info">Info</abp-button>
+<abp-button button-type="Outline_Light">Light</abp-button>
+<abp-button button-type="Outline_Dark">Dark</abp-button>
+
+
+
+ +

# Example

+