Browse Source
Merge pull request #14461 from abpframework/Add-DateRangePicker-Package
Add Date Range Picker Packages
pull/14467/head
Engincan VESKE
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with
105 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/BootstrapDaterangepicker/BootstrapDaterangepickerScriptContributor.cs
-
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/BootstrapDaterangepicker/BootstrapDaterangepickerStyleContributor.cs
-
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Moment/MomentScriptContributor.cs
-
npm/packs/bootstrap-daterangepicker/abp.resourcemapping.js
-
npm/packs/bootstrap-daterangepicker/package.json
-
npm/packs/moment/abp.resourcemapping.js
-
npm/packs/moment/package.json
|
|
|
@ -0,0 +1,21 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Moment; |
|
|
|
using Volo.Abp.Localization; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.BootstrapDaterangepicker; |
|
|
|
|
|
|
|
[DependsOn(typeof(JQueryScriptContributor))] |
|
|
|
[DependsOn(typeof(MomentScriptContributor))] |
|
|
|
public class BootstrapDaterangepickerScriptContributor : BundleContributor |
|
|
|
{ |
|
|
|
public const string PackageName = "bootstrap-daterangepicker"; |
|
|
|
|
|
|
|
public override void ConfigureBundle(BundleConfigurationContext context) |
|
|
|
{ |
|
|
|
context.Files.AddIfNotContains("/libs/bootstrap-daterangepicker/daterangepicker.js"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -0,0 +1,12 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.BootstrapDaterangepicker; |
|
|
|
|
|
|
|
public class BootstrapDaterangepickerStyleContributor : BundleContributor |
|
|
|
{ |
|
|
|
public override void ConfigureBundle(BundleConfigurationContext context) |
|
|
|
{ |
|
|
|
context.Files.AddIfNotContains("/libs/bootstrap-daterangepicker/daterangepicker.css"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -0,0 +1,28 @@ |
|
|
|
using System.Collections.Generic; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery; |
|
|
|
using Volo.Abp.Localization; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Moment; |
|
|
|
|
|
|
|
public class MomentScriptContributor : BundleContributor |
|
|
|
{ |
|
|
|
public const string PackageName = "moment"; |
|
|
|
|
|
|
|
public override void ConfigureBundle(BundleConfigurationContext context) |
|
|
|
{ |
|
|
|
context.Files.AddIfNotContains("/libs/moment/moment.min.js"); |
|
|
|
} |
|
|
|
|
|
|
|
public override void ConfigureDynamicResources(BundleConfigurationContext context) |
|
|
|
{ |
|
|
|
var fileName = context.LazyServiceProvider.LazyGetRequiredService<IOptions<AbpLocalizationOptions>>().Value.GetCurrentUICultureLanguageFilesMap(PackageName); |
|
|
|
var filePath = $"/libs/moment/locale/{fileName}.js"; |
|
|
|
if (context.FileProvider.GetFileInfo(filePath).Exists) |
|
|
|
{ |
|
|
|
context.Files.AddIfNotContains(filePath); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -0,0 +1,6 @@ |
|
|
|
module.exports = { |
|
|
|
mappings: { |
|
|
|
"@node_modules/bootstrap-daterangepicker/daterangepicker.js": "@libs/bootstrap-daterangepicker/", |
|
|
|
"@node_modules/bootstrap-daterangepicker/daterangepicker.css": "@libs/bootstrap-daterangepicker/", |
|
|
|
} |
|
|
|
} |
|
|
|
@ -0,0 +1,16 @@ |
|
|
|
{ |
|
|
|
"version": "6.0.0", |
|
|
|
"name": "@abp/bootstrap-daterangepicker", |
|
|
|
"repository": { |
|
|
|
"type": "git", |
|
|
|
"url": "https://github.com/abpframework/abp.git", |
|
|
|
"directory": "npm/packs/bootstrap-daterangepicker" |
|
|
|
}, |
|
|
|
"publishConfig": { |
|
|
|
"access": "public" |
|
|
|
}, |
|
|
|
"dependencies": { |
|
|
|
"bootstrap-daterangepicker": "^3.1.0" |
|
|
|
}, |
|
|
|
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" |
|
|
|
} |
|
|
|
@ -0,0 +1,6 @@ |
|
|
|
module.exports = { |
|
|
|
mappings: { |
|
|
|
"@node_modules/moment/min/moment.min.js": "@libs/moment/", |
|
|
|
"@node_modules/moment/locale/*.*": "@libs/moment/locale/", |
|
|
|
} |
|
|
|
} |
|
|
|
@ -0,0 +1,16 @@ |
|
|
|
{ |
|
|
|
"version": "6.0.0", |
|
|
|
"name": "@abp/moment", |
|
|
|
"repository": { |
|
|
|
"type": "git", |
|
|
|
"url": "https://github.com/abpframework/abp.git", |
|
|
|
"directory": "npm/packs/moment" |
|
|
|
}, |
|
|
|
"publishConfig": { |
|
|
|
"access": "public" |
|
|
|
}, |
|
|
|
"dependencies": { |
|
|
|
"moment": "^2.9.0" |
|
|
|
}, |
|
|
|
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" |
|
|
|
} |