diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JQueryFormScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JQueryFormScriptContributor.cs new file mode 100644 index 0000000000..ca131c8aac --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JQueryFormScriptContributor.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.JsTree +{ + [DependsOn(typeof(JQueryScriptContributor))] + public class JsTreeScriptContributor : BundleContributor + { + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("/libs/jstree/jstree.min.js"); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JsTreeOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JsTreeOptions.cs new file mode 100644 index 0000000000..d1dbe812bf --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JsTreeOptions.cs @@ -0,0 +1,13 @@ +namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.JsTree +{ + public class JsTreeOptions + { + /// + /// Path of the style file for the JsTree library. + /// Setting to null ignores the style file. + /// + /// Default value: "/libs/jstree/themes/default/style.min.css". + /// + public string StylePath { get; set; } = "/libs/jstree/themes/default/style.min.css"; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JsTreeStyleContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JsTreeStyleContributor.cs new file mode 100644 index 0000000000..5944310c2c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/JsTree/JsTreeStyleContributor.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.JsTree +{ + public class JsTreeStyleContributor : BundleContributor + { + public override void ConfigureBundle(BundleConfigurationContext context) + { + var options = context + .ServiceProvider + .GetRequiredService>() + .Value; + + if (options.StylePath.IsNullOrEmpty()) + { + return; + } + + context.Files.AddIfNotContains(options.StylePath); + } + } +} \ No newline at end of file diff --git a/npm/packs/jstree/abp.resourcemapping.js b/npm/packs/jstree/abp.resourcemapping.js new file mode 100644 index 0000000000..89b3e09d64 --- /dev/null +++ b/npm/packs/jstree/abp.resourcemapping.js @@ -0,0 +1,5 @@ +module.exports = { + mappings: { + "@node_modules/jstree/dist/**/*.*": "@libs/jstree/" + } +} \ No newline at end of file diff --git a/npm/packs/jstree/package.json b/npm/packs/jstree/package.json new file mode 100644 index 0000000000..feee4a81e2 --- /dev/null +++ b/npm/packs/jstree/package.json @@ -0,0 +1,12 @@ +{ + "version": "2.7.0", + "name": "@abp/jstree", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@abp/jquery": "^2.7.0", + "jstree": "^3.3.9" + }, + "gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd" +}