mirror of https://github.com/abpframework/abp.git
14 changed files with 120 additions and 55 deletions
@ -0,0 +1,34 @@ |
|||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpAspNetCoreMvcUiBundlingAbstractionsModule) |
||||
|
)] |
||||
|
public class AbpAspNetCoreComponentsMauiBlazorThemingBundlingModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
Configure<AbpBundlingOptions>(options => |
||||
|
{ |
||||
|
options.GlobalAssets.Enabled = true; |
||||
|
options.GlobalAssets.GlobalStyleBundleName = MauiBlazorStandardBundles.Styles.Global; |
||||
|
options.GlobalAssets.GlobalScriptBundleName = MauiBlazorStandardBundles.Scripts.Global; |
||||
|
|
||||
|
options |
||||
|
.StyleBundles |
||||
|
.Add(MauiBlazorStandardBundles.Styles.Global, bundle => |
||||
|
{ |
||||
|
bundle.AddContributors(typeof(MauiStyleContributor)); |
||||
|
}); |
||||
|
|
||||
|
options |
||||
|
.ScriptBundles |
||||
|
.Add(MauiBlazorStandardBundles.Scripts.Global, bundle => |
||||
|
{ |
||||
|
bundle.AddContributors(typeof(MauiScriptContributor)); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling; |
||||
|
|
||||
|
public class MauiBlazorStandardBundles |
||||
|
{ |
||||
|
public static class Styles |
||||
|
{ |
||||
|
public static string Global = "MauiBlazor.Global"; |
||||
|
} |
||||
|
|
||||
|
public static class Scripts |
||||
|
{ |
||||
|
public static string Global = "MauiBlazor.Global"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling; |
||||
|
|
||||
|
public class MauiScriptContributor : BundleContributor |
||||
|
{ |
||||
|
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
|
{ |
||||
|
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"); |
||||
|
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/lang-utils.js"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.Bundling; |
||||
|
|
||||
|
public class MauiStyleContributor : BundleContributor |
||||
|
{ |
||||
|
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
|
{ |
||||
|
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/bootstrap/css/bootstrap.min.css"); |
||||
|
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/fontawesome/css/all.css"); |
||||
|
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/css/abp.css"); |
||||
|
context.Files.AddIfNotContains("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/flag-icon/css/flag-icon.css"); |
||||
|
context.Files.AddIfNotContains("_content/Blazorise/blazorise.css"); |
||||
|
context.Files.AddIfNotContains("_content/Blazorise.Bootstrap5/blazorise.bootstrap5.css"); |
||||
|
context.Files.AddIfNotContains("_content/Blazorise.Snackbar/blazorise.snackbar.css"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.Razor"> |
||||
|
|
||||
|
<Import Project="..\..\..\configureawait.props" /> |
||||
|
<Import Project="..\..\..\common.props" /> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net8.0</TargetFramework> |
||||
|
<Nullable>enable</Nullable> |
||||
|
<WarningsAsErrors>Nullable</WarningsAsErrors> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions\Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -1,32 +0,0 @@ |
|||||
using Volo.Abp.Bundling; |
|
||||
|
|
||||
namespace Volo.Abp.AspNetCore.Components.MauiBlazor.Theming; |
|
||||
|
|
||||
public class ComponentsComponentsBundleContributor : IBundleContributor |
|
||||
{ |
|
||||
public void AddScripts(BundleContext context) |
|
||||
{ |
|
||||
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"); |
|
||||
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/lang-utils.js"); |
|
||||
} |
|
||||
|
|
||||
public void AddStyles(BundleContext context) |
|
||||
{ |
|
||||
if (!context.InteractiveAuto) |
|
||||
{ |
|
||||
context.BundleDefinitions.Insert(0, new BundleDefinition |
|
||||
{ |
|
||||
Source = "_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/bootstrap/css/bootstrap.min.css" |
|
||||
}); |
|
||||
context.BundleDefinitions.Insert(1, new BundleDefinition |
|
||||
{ |
|
||||
Source = "_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/fontawesome/css/all.css" |
|
||||
}); |
|
||||
} |
|
||||
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/css/abp.css"); |
|
||||
context.Add("_content/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/libs/flag-icon/css/flag-icon.css"); |
|
||||
context.Add("_content/Blazorise/blazorise.css"); |
|
||||
context.Add("_content/Blazorise.Bootstrap5/blazorise.bootstrap5.css"); |
|
||||
context.Add("_content/Blazorise.Snackbar/blazorise.snackbar.css"); |
|
||||
} |
|
||||
} |
|
||||
@ -1,19 +1,14 @@ |
|||||
using Volo.Abp.Bundling; |
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName; |
namespace MyCompanyName.MyProjectName; |
||||
|
|
||||
/* Add your global styles/scripts here. |
/* Add your global styles/scripts here. |
||||
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it
|
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it
|
||||
*/ |
*/ |
||||
public class MyProjectNameBundleContributor : IBundleContributor |
public class MyProjectNameBundleContributor : BundleContributor |
||||
{ |
{ |
||||
public void AddScripts(BundleContext context) |
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
{ |
{ |
||||
|
context.Files.Add(new BundleFile("main.css", true)); |
||||
} |
|
||||
|
|
||||
public void AddStyles(BundleContext context) |
|
||||
{ |
|
||||
context.Add("main.css", true); |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,16 +1,14 @@ |
|||||
using Volo.Abp.Bundling; |
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
||||
|
|
||||
namespace MyCompanyName.MyProjectName.Blazor.Host.Client; |
namespace MyCompanyName.MyProjectName.Blazor.Host.Client; |
||||
|
|
||||
public class MyProjectNameBlazorHostBundleContributor : IBundleContributor |
/* Add your global styles/scripts here. |
||||
|
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it
|
||||
|
*/ |
||||
|
public class MyProjectNameBlazorHostBundleContributor : BundleContributor |
||||
{ |
{ |
||||
public void AddScripts(BundleContext context) |
public override void ConfigureBundle(BundleConfigurationContext context) |
||||
{ |
{ |
||||
|
context.Files.Add(new BundleFile("main.css", true)); |
||||
} |
|
||||
|
|
||||
public void AddStyles(BundleContext context) |
|
||||
{ |
|
||||
context.Add("main.css", true); |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue