abp框架

This commit is contained in:
zhangzhuo 2025-06-04 09:42:48 +08:00 committed by 15060
commit 6a8eccd884
7540 changed files with 706630 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
bin/
obj/
/packages/
riderModule.iml
/_ReSharper.Caches/

13
.idea/.idea.Seyounth.Auto.Hs/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,13 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# Rider 忽略的文件
/projectSettingsUpdater.xml
/.idea.Seyounth.Auto.Hs.iml
/modules.xml
/contentModel.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

16
Seyounth.Auto.Hs.sln Normal file
View File

@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Seyounth.Auto.Hs.Runtime", "Seyounth.Auto.Hs.Runtime\Seyounth.Auto.Hs.Runtime.csproj", "{6966BCFD-A22C-4C83-8171-96BB005F38D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6966BCFD-A22C-4C83-8171-96BB005F38D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6966BCFD-A22C-4C83-8171-96BB005F38D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6966BCFD-A22C-4C83-8171-96BB005F38D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6966BCFD-A22C-4C83-8171-96BB005F38D4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,5 @@
{
"version": 1,
"isRoot": true,
"tools": {}
}

View File

@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace Syc.Basic.Web.WMS.Controllers;
public class HomeController : AbpController
{
public ActionResult Index()
{
return Redirect("~/swagger");
}
}

View File

@ -0,0 +1,57 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
namespace Syc.Basic.Web.WMS;
public class Program
{
public static async Task<int> Main(string[] args)
{
string logPath = AppDomain.CurrentDomain.BaseDirectory + "logs/log-.txt";
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File(logPath, rollingInterval: RollingInterval.Day, restrictedToMinimumLevel: LogEventLevel.Information))
.WriteTo.Async(c => c.Console())
.CreateLogger();
try
{
if (!HslCommunication.Authorization.SetAuthorizationCode("2fb771c7-4c29-445d-bddd-a7b8a75de397"))
{
Log.Information("HslCommunication active failed");
}
Log.Information("Starting Syc.Basic.Web.WMS.HttpApi.Host.");
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog(Log.Logger);
await builder.AddApplicationAsync<WMSHttpApiHostModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ProjectGuid>d3b021e9-97fd-4f90-817a-24ec873e547b</ProjectGuid>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\盛原成\骏马二期\MES\backend\code\apps\Syc.Basic.Web.WMS.HttpApi.Host\bin\Release\net6.0\publish\</_PublishTargetUrl>
<History>True|2024-10-17T08:48:40.2516489Z;True|2024-10-11T16:31:58.0638668+08:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -0,0 +1,27 @@
{
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Syc.Basic.Web.WMS.HttpApi.Host": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://*:9100",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44386",
"sslPort": 44386
}
}
}

View File

@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Syc.Basic.Web.WMS</RootNamespace>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>Syc.Basic.Web.WMS-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
<PackageReference Include="Volo.Abp.Autofac" Version="6.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="6.0.0" />
<PackageReference Include="Volo.Abp.Swashbuckle" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\services\Syc.Basic.Web.WMS.Application\Syc.Basic.Web.WMS.Application.csproj" />
<ProjectReference Include="..\..\services\Syc.Basic.Web.WMS.EntityFrameworkCore\Syc.Basic.Web.WMS.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\services\Syc.Basic.Web.WMS.HttpApi\Syc.Basic.Web.WMS.HttpApi.csproj" />
<ProjectReference Include="..\..\share\Seyounth.Auto.Hs.Runtime\Seyounth.Auto.Hs.Runtime.csproj" />
<ProjectReference Include="..\..\share\Seyounth.Auto.Plc\Seyounth.Auto.Plc.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="HostedServices\" />
</ItemGroup>
<ItemGroup>
<Reference Include="HslCommunication">
<HintPath>..\..\share\Seyounth.Auto.Plc\DLLFile\HslCommunication.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>Syc.Basic.Web.WMS.HttpApi.Host</ActiveDebugProfile>
<NameOfLastUsedPublishProfile>D:\盛原成\骏马二期\MES\backend\code\apps\Syc.Basic.Web.WMS.HttpApi.Host\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,10 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding;
namespace Syc.Basic.Web.WMS;
[Dependency(ReplaceServices = true)]
public class WMSBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "WMS";
}

View File

@ -0,0 +1,192 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Syc.Basic.Web.WMS.EntityFrameworkCore;
using Microsoft.OpenApi.Models;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Swashbuckle;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem;
using Syc.Abp.Application.Contracts;
using Volo.Abp.Caching;
using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using System.Net;
using StackExchange.Redis;
namespace Syc.Basic.Web.WMS;
[DependsOn(
typeof(WMSHttpApiModule),
typeof(AbpAutofacModule),
typeof(WMSApplicationModule),
typeof(WMSEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
)]
public class WMSHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
ConfigureRedis();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment();
ConfigureUrls(configuration);
ConfigureLocalization();
ConfigureVirtualFileSystem(context);
ConfigureCors(context, configuration);
ConfigureSwaggerServices(context, configuration);
}
private void ConfigureRedis()
{
Configure<AbpDistributedCacheOptions>(options =>
{
options.KeyPrefix = "WMS.";
});
PreConfigure<ConfigurationOptions>(options =>
{
options.DefaultDatabase = 1;
});
Configure<ConfigurationOptions>(options =>
{
options.DefaultDatabase = 1;
});
}
private void ConfigureUrls(IConfiguration configuration)
{
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"].Split(','));
});
Configure<AbpAntiForgeryOptions>(options => options.AutoValidate = false);
}
private void ConfigureVirtualFileSystem(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<WMSDomainSharedModule>(
Path.Combine(hostingEnvironment.ContentRootPath,
$"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}services{Path.DirectorySeparatorChar}Syc.Basic.Web.WMS.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<WMSDomainModule>(
Path.Combine(hostingEnvironment.ContentRootPath,
$"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}services{Path.DirectorySeparatorChar}Syc.Basic.Web.WMS.Domain"));
options.FileSets.ReplaceEmbeddedByPhysical<WMSApplicationContractsModule>(
Path.Combine(hostingEnvironment.ContentRootPath,
$"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}services{Path.DirectorySeparatorChar}Syc.Basic.Web.WMS.Application.Contracts"));
options.FileSets.ReplaceEmbeddedByPhysical<WMSApplicationModule>(
Path.Combine(hostingEnvironment.ContentRootPath,
$"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}services{Path.DirectorySeparatorChar}Syc.Basic.Web.WMS.Application"));
});
}
}
private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddSwaggerGen(
options =>
{
options.ResolveConflictingActions(t => t.First());
options.SwaggerDoc("v1", new OpenApiInfo { Title = "WMS API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location);//获取应用程序所在目录(绝对,不受工作目录影响,建议采用此方法获取路径)
var xmlPath = Path.Combine(basePath, "Syc.Basic.Web.WMS.Application.xml"); // 添加 swagger xml 注释 这个xml文件开始是不存在的写上项目名.xml即可
});
}
private void ConfigureLocalization()
{
Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("ar", "ar", "العربية"));
options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština"));
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)"));
options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish"));
options.Languages.Add(new LanguageInfo("fr", "fr", "Français"));
options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in"));
options.Languages.Add(new LanguageInfo("is", "is", "Icelandic", "is"));
options.Languages.Add(new LanguageInfo("it", "it", "Italiano", "it"));
options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar"));
options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português"));
options.Languages.Add(new LanguageInfo("ro-RO", "ro-RO", "Română"));
options.Languages.Add(new LanguageInfo("ru", "ru", "Русский"));
options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文"));
options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch", "de"));
options.Languages.Add(new LanguageInfo("es", "es", "Español", "es"));
options.Languages.Add(new LanguageInfo("el", "el", "Ελληνικά"));
});
}
private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseCors();
app.UseSpecificationException();
app.UseSwagger();
app.UseAppAuthentication();
app.UseUnitOfWork();
app.UseAbpSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "WMS API");
});
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
}
}

View File

@ -0,0 +1,11 @@
module.exports = {
aliases: {
},
clean: [
],
mappings: {
}
};

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,62 @@
{
"App": {
"SelfUrl": "https://localhost:44386",
"CorsOrigins": "https://*.WMS.com",
"RedirectAllowedUrls": "http://localhost:4200,https://localhost:44396"
},
"ConnectionStrings": {
//"WMSDb": "Server=113.141.94.252,51197;Database=syc_wms_DB; User ID=syc; Password=syc@123456;TrustServerCertificate=True",
"WMSDb": "Server=.;Database=Hyosung_VietNamTY; User ID=sa; Password=seyounth@2025;TrustServerCertificate=True",
},
"AuthServer": {
"Authority": "https://localhost:44386",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "WMS_Swagger"
},
"StringEncryption": {
"DefaultPassPhrase": "nkxeH0GZ7oStykJT"
},
"JwtSetting": {
"Algorithms": "HS256",
"ValidateIssuerSigningKey": true,
"SecurityKey": "phqmowczmbdblwlycdl==sywodcgediwnfuszz156gwsf7r8e9s5gw61ffe8-dw9++dgw6e46f5a1s36W51",
"ValidateIssuer": true,
"Issuer": "www.phqmo.com",
"ValidateAudience": true,
"Audience": "www.phqmo.blog.com",
"ValidateLifetime": true,
"ExpiredTime": 120,
"ClockSkew": 2
},
"CAP": {
"DefaultGroupName": "syc.wms.queue",
"FailedRetryInterval": 60, //
"UseStorageLock": true, //
"ConsumerThreadCount": 1, //线线1
"CollectorCleaningInterval": 300, //
"FailedRetryCount": 50, //
"FallbackWindowLookbackSeconds": 240, // Scheduled Failed 退
"SucceedMessageExpiredAfter": 86400, //
"FailedMessageExpiredAfter": 1296000, //
"EnableSubscriberParallelExecute": false, //
"EnablePublishParallelSend": false,
"RabbitMQ": {
"HostName": "113.141.94.252", //"192.168.35.10",
"Port": 5672,
"UserName": "wms",
"Password": "wms@123",
"VirtualHost": "/",
"ExchangeName": "amq.topic",
"PublishConfirms": true,
"BasicQosOptions": 10
},
"SqlServerOptions": {
"Schema": "dbo",
"ConnectionString": "WMSDb"
}
},
"Redis": {
"IsEnabled": true,
"Configuration": "127.0.0.1:6379,defaultDatabase=0"
}
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../atob/bin/atob.js" "$@"
else
exec node "$basedir/../atob/bin/atob.js" "$@"
fi

View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\atob\bin\atob.js" %*

View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
} else {
& "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../atob/bin/atob.js" $args
} else {
& "node$exe" "$basedir/../atob/bin/atob.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../color-support/bin.js" "$@"
else
exec node "$basedir/../color-support/bin.js" "$@"
fi

View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\color-support\bin.js" %*

View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../color-support/bin.js" $args
} else {
& "$basedir/node$exe" "$basedir/../color-support/bin.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../color-support/bin.js" $args
} else {
& "node$exe" "$basedir/../color-support/bin.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../gulp/bin/gulp.js" "$@"
else
exec node "$basedir/../gulp/bin/gulp.js" "$@"
fi

View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\gulp\bin\gulp.js" %*

View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../gulp/bin/gulp.js" $args
} else {
& "$basedir/node$exe" "$basedir/../gulp/bin/gulp.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../gulp/bin/gulp.js" $args
} else {
& "node$exe" "$basedir/../gulp/bin/gulp.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@"
else
exec node "$basedir/../resolve/bin/resolve" "$@"
fi

View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %*

View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
} else {
& "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../resolve/bin/resolve" $args
} else {
& "node$exe" "$basedir/../resolve/bin/resolve" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../semver/bin/semver" "$@"
else
exec node "$basedir/../semver/bin/semver" "$@"
fi

View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %*

View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
} else {
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../semver/bin/semver" $args
} else {
& "node$exe" "$basedir/../semver/bin/semver" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../which/bin/which" "$@"
else
exec node "$basedir/../which/bin/which" "$@"
fi

View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\which" %*

View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../which/bin/which" $args
} else {
& "$basedir/node$exe" "$basedir/../which/bin/which" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../which/bin/which" $args
} else {
& "node$exe" "$basedir/../which/bin/which" $args
}
$ret=$LASTEXITCODE
}
exit $ret

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
{
"version": "1.0.5",
"name": "@abp/aspnetcore.mvc.ui.theme.leptonxlite",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.shared": "~6.0.2"
}
}

View File

@ -0,0 +1,29 @@
{
"version": "6.0.3",
"name": "@abp/aspnetcore.mvc.ui.theme.shared",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/aspnetcore.mvc.ui.theme.shared"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/aspnetcore.mvc.ui": "~6.0.3",
"@abp/bootstrap": "~6.0.3",
"@abp/bootstrap-datepicker": "~6.0.3",
"@abp/datatables.net-bs5": "~6.0.3",
"@abp/font-awesome": "~6.0.3",
"@abp/jquery-form": "~6.0.3",
"@abp/jquery-validation-unobtrusive": "~6.0.3",
"@abp/lodash": "~6.0.3",
"@abp/luxon": "~6.0.3",
"@abp/malihu-custom-scrollbar-plugin": "~6.0.3",
"@abp/select2": "~6.0.3",
"@abp/sweetalert2": "~6.0.3",
"@abp/timeago": "~6.0.3",
"@abp/toastr": "~6.0.3"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,172 @@
"use strict";
(function () {
var gulp = require("gulp"),
merge = require("merge-stream"),
fs = require('fs'),
glob = require('glob'),
micromatch = require('micromatch'),
path = require("path"),
extendObject = require('extend-object');
var investigatedPackagePaths = {};
var resourceMapping;
var rootPath;
function replaceAliases(text) {
if (!resourceMapping.aliases) {
return text;
}
for (var alias in resourceMapping.aliases) {
if (!resourceMapping.aliases.hasOwnProperty(alias)) {
continue;
}
text = replaceAll(text, alias, resourceMapping.aliases[alias]);
}
return text;
}
function replaceAll(text, search, replacement) {
return text.replace(new RegExp(search, 'g'), replacement);
}
function requireOptional(filePath) {
//TODO: Implement this using a library instead of try-catch!
try {
return require(filePath);
} catch (e) {
return undefined;
}
}
function cleanDirsAndFiles(patterns) {
const { dirs, files } = findDirsAndFiles(patterns);
files.forEach(file => {
try {
fs.unlinkSync(file);
} catch (_) {}
});
dirs.sort((a, b) => a < b ? 1 : -1);
dirs.forEach(dir => {
if (fs.readdirSync(dir).length) return;
try {
fs.rmdirSync(dir, {});
} catch (_) {}
});
}
function findDirsAndFiles(patterns) {
const dirs = [];
const files = [];
const list = glob.sync('**/*', { dot: true });
const matches = micromatch(list, normalizeGlob(patterns), {
dot: true,
});
matches.forEach(match => {
if (!fs.existsSync(match)) return;
(fs.statSync(match).isDirectory() ? dirs : files).push(match);
});
return { dirs, files };
}
function normalizeGlob(patterns) {
return patterns.map(pattern => {
const prefix = /\*$/.test(pattern) ? '' : '/**';
return replaceAliases(pattern).replace(/(!?)\.\//, '$1') + prefix;
});
}
function normalizeResourceMapping(resourcemapping) {
var defaultSettings = {
aliases: {
"@node_modules": "./node_modules",
"@libs": "./wwwroot/libs"
},
clean: [
"@libs"
]
};
extendObject(defaultSettings.aliases, resourcemapping.aliases);
resourcemapping.aliases = defaultSettings.aliases;
resourcemapping.clean = resourcemapping.clean || defaultSettings.clean;
return resourcemapping;
}
function buildResourceMapping(packagePath) {
if (investigatedPackagePaths[packagePath]) {
return {};
}
investigatedPackagePaths[packagePath] = 'OK';
var packageJson = requireOptional(path.join(packagePath, 'package.json'));
var resourcemapping = requireOptional(path.join(packagePath, 'abp.resourcemapping.js')) || { };
if (packageJson && packageJson.dependencies) {
var aliases = {};
var mappings = {};
for (var dependency in packageJson.dependencies) {
if (packageJson.dependencies.hasOwnProperty(dependency)) {
var dependedPackagePath = path.join(rootPath, 'node_modules', dependency);
var importedResourceMapping = buildResourceMapping(dependedPackagePath);
extendObject(aliases, importedResourceMapping.aliases);
extendObject(mappings, importedResourceMapping.mappings);
}
}
extendObject(aliases, resourcemapping.aliases);
extendObject(mappings, resourcemapping.mappings);
resourcemapping.aliases = aliases;
resourcemapping.mappings = mappings;
}
return resourcemapping;
}
function copyResourcesTask (path) {
rootPath = path;
resourceMapping = normalizeResourceMapping(buildResourceMapping(rootPath));
cleanDirsAndFiles(resourceMapping.clean);
var tasks = [];
if (resourceMapping.mappings) {
for (var mapping in resourceMapping.mappings) {
if (resourceMapping.mappings.hasOwnProperty(mapping)) {
var destination = replaceAliases(resourceMapping.mappings[mapping]);
if (fs.existsSync(destination)) continue;
var source = replaceAliases(mapping);
tasks.push(
gulp.src(source).pipe(gulp.dest(destination))
);
}
}
}
return merge(tasks);
}
module.exports = copyResourcesTask;
})();

View File

@ -0,0 +1,21 @@
{
"version": "6.0.3",
"name": "@abp/aspnetcore.mvc.ui",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/aspnetcore.mvc.ui"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"ansi-colors": "^4.1.1",
"extend-object": "^1.0.0",
"glob": "^7.1.6",
"gulp": "^4.0.2",
"merge-stream": "^2.0.0",
"micromatch": "^4.0.2"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,8 @@
module.exports = {
mappings: {
"@node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js": "@libs/bootstrap-datepicker/",
"@node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css": "@libs/bootstrap-datepicker/",
"@node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css.map": "@libs/bootstrap-datepicker/",
"@node_modules/bootstrap-datepicker/dist/locales/*.*": "@libs/bootstrap-datepicker/locales/"
}
}

View File

@ -0,0 +1,16 @@
{
"version": "6.0.3",
"name": "@abp/bootstrap-datepicker",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/bootstrap-datepicker"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"bootstrap-datepicker": "^1.9.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,10 @@
module.exports = {
mappings: {
"@node_modules/bootstrap/dist/css/bootstrap.css*": "@libs/bootstrap/css/",
"@node_modules/bootstrap/dist/css/bootstrap.min.css*": "@libs/bootstrap/css/",
"@node_modules/bootstrap/dist/css/bootstrap.rtl.css*": "@libs/bootstrap/css/",
"@node_modules/bootstrap/dist/css/bootstrap.rtl.min.css*": "@libs/bootstrap/css/",
"@node_modules/bootstrap/dist/js/bootstrap.bundle*": "@libs/bootstrap/js/",
"@node_modules/@abp/bootstrap/src/*.*": "@libs/bootstrap/js/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/bootstrap",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/bootstrap"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"bootstrap": "^5.1.3"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,5 @@
(function () {
[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
})();

View File

@ -0,0 +1,5 @@
(function () {
[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
});
})();

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/@abp/core/src/*": "@libs/abp/core/"
}
}

View File

@ -0,0 +1,16 @@
{
"version": "6.0.3",
"name": "@abp/core",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/core"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/utils": "~6.0.3"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,56 @@
@keyframes spin {
0% {
transform: translateZ(0) rotate(0deg);
}
100% {
transform: translateZ(0) rotate(360deg);
}
}
.abp-block-area {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 102;
background-color: #fff;
opacity: .8;
transition: opacity .25s;
}
.abp-block-area.abp-block-area-disappearing {
opacity: 0;
}
.abp-block-area.abp-block-area-busy:after {
content: attr(data-text);
display: block;
max-width: 125px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
font-family: sans-serif;
color: #343a40;
text-align: center;
text-transform: uppercase;
}
.abp-block-area.abp-block-area-busy:before {
content: "";
display: block;
width: 150px;
height: 150px;
border-radius: 50%;
border-width: 2px;
border-style: solid;
border-color: transparent #228ae6 #228ae6 #228ae6;
position: absolute;
top: calc(50% - 75px);
left: calc(50% - 75px);
will-change: transform;
animation: spin .75s infinite ease-in-out;
}

View File

@ -0,0 +1,788 @@
var abp = abp || {};
(function () {
/* Application paths *****************************************/
//Current application root path (including virtual directory if exists).
abp.appPath = abp.appPath || '/';
abp.pageLoadTime = new Date();
//Converts given path to absolute path using abp.appPath variable.
abp.toAbsAppPath = function (path) {
if (path.indexOf('/') == 0) {
path = path.substring(1);
}
return abp.appPath + path;
};
/* LOGGING ***************************************************/
//Implements Logging API that provides secure & controlled usage of console.log
abp.log = abp.log || {};
abp.log.levels = {
DEBUG: 1,
INFO: 2,
WARN: 3,
ERROR: 4,
FATAL: 5
};
abp.log.level = abp.log.levels.DEBUG;
abp.log.log = function (logObject, logLevel) {
if (!window.console || !window.console.log) {
return;
}
if (logLevel != undefined && logLevel < abp.log.level) {
return;
}
console.log(logObject);
};
abp.log.debug = function (logObject) {
abp.log.log("DEBUG: ", abp.log.levels.DEBUG);
abp.log.log(logObject, abp.log.levels.DEBUG);
};
abp.log.info = function (logObject) {
abp.log.log("INFO: ", abp.log.levels.INFO);
abp.log.log(logObject, abp.log.levels.INFO);
};
abp.log.warn = function (logObject) {
abp.log.log("WARN: ", abp.log.levels.WARN);
abp.log.log(logObject, abp.log.levels.WARN);
};
abp.log.error = function (logObject) {
abp.log.log("ERROR: ", abp.log.levels.ERROR);
abp.log.log(logObject, abp.log.levels.ERROR);
};
abp.log.fatal = function (logObject) {
abp.log.log("FATAL: ", abp.log.levels.FATAL);
abp.log.log(logObject, abp.log.levels.FATAL);
};
/* LOCALIZATION ***********************************************/
abp.localization = abp.localization || {};
abp.localization.values = abp.localization.values || {};
abp.localization.localize = function (key, sourceName) {
if (sourceName === '_') { //A convention to suppress the localization
return key;
}
sourceName = sourceName || abp.localization.defaultResourceName;
if (!sourceName) {
abp.log.warn('Localization source name is not specified and the defaultResourceName was not defined!');
return key;
}
var source = abp.localization.values[sourceName];
if (!source) {
abp.log.warn('Could not find localization source: ' + sourceName);
return key;
}
var value = source[key];
if (value == undefined) {
return key;
}
var copiedArguments = Array.prototype.slice.call(arguments, 0);
copiedArguments.splice(1, 1);
copiedArguments[0] = value;
return abp.utils.formatString.apply(this, copiedArguments);
};
abp.localization.isLocalized = function (key, sourceName) {
if (sourceName === '_') { //A convention to suppress the localization
return true;
}
sourceName = sourceName || abp.localization.defaultResourceName;
if (!sourceName) {
return false;
}
var source = abp.localization.values[sourceName];
if (!source) {
return false;
}
var value = source[key];
if (value === undefined) {
return false;
}
return true;
};
abp.localization.getResource = function (name) {
return function () {
var copiedArguments = Array.prototype.slice.call(arguments, 0);
copiedArguments.splice(1, 0, name);
return abp.localization.localize.apply(this, copiedArguments);
};
};
abp.localization.defaultResourceName = undefined;
abp.localization.currentCulture = {
cultureName: undefined
};
var getMapValue = function (packageMaps, packageName, language) {
language = language || abp.localization.currentCulture.name;
if (!packageMaps || !packageName || !language) {
return language;
}
var packageMap = packageMaps[packageName];
if (!packageMap) {
return language;
}
for (var i = 0; i < packageMap.length; i++) {
var map = packageMap[i];
if (map.name === language){
return map.value;
}
}
return language;
};
abp.localization.getLanguagesMap = function (packageName, language) {
return getMapValue(abp.localization.languagesMap, packageName, language);
};
abp.localization.getLanguageFilesMap = function (packageName, language) {
return getMapValue(abp.localization.languageFilesMap, packageName, language);
};
/* AUTHORIZATION **********************************************/
abp.auth = abp.auth || {};
abp.auth.policies = abp.auth.policies || {};
abp.auth.grantedPolicies = abp.auth.grantedPolicies || {};
abp.auth.isGranted = function (policyName) {
return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined;
};
abp.auth.isAnyGranted = function () {
if (!arguments || arguments.length <= 0) {
return true;
}
for (var i = 0; i < arguments.length; i++) {
if (abp.auth.isGranted(arguments[i])) {
return true;
}
}
return false;
};
abp.auth.areAllGranted = function () {
if (!arguments || arguments.length <= 0) {
return true;
}
for (var i = 0; i < arguments.length; i++) {
if (!abp.auth.isGranted(arguments[i])) {
return false;
}
}
return true;
};
abp.auth.tokenCookieName = 'Abp.AuthToken';
abp.auth.setToken = function (authToken, expireDate) {
abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain);
};
abp.auth.getToken = function () {
return abp.utils.getCookieValue(abp.auth.tokenCookieName);
}
abp.auth.clearToken = function () {
abp.auth.setToken();
}
/* SETTINGS *************************************************/
abp.setting = abp.setting || {};
abp.setting.values = abp.setting.values || {};
abp.setting.get = function (name) {
return abp.setting.values[name];
};
abp.setting.getBoolean = function (name) {
var value = abp.setting.get(name);
return value == 'true' || value == 'True';
};
abp.setting.getInt = function (name) {
return parseInt(abp.setting.values[name]);
};
/* NOTIFICATION *********************************************/
//Defines Notification API, not implements it
abp.notify = abp.notify || {};
abp.notify.success = function (message, title, options) {
abp.log.warn('abp.notify.success is not implemented!');
};
abp.notify.info = function (message, title, options) {
abp.log.warn('abp.notify.info is not implemented!');
};
abp.notify.warn = function (message, title, options) {
abp.log.warn('abp.notify.warn is not implemented!');
};
abp.notify.error = function (message, title, options) {
abp.log.warn('abp.notify.error is not implemented!');
};
/* MESSAGE **************************************************/
//Defines Message API, not implements it
abp.message = abp.message || {};
abp.message._showMessage = function (message, title) {
alert((title || '') + ' ' + message);
};
abp.message.info = function (message, title) {
abp.log.warn('abp.message.info is not implemented!');
return abp.message._showMessage(message, title);
};
abp.message.success = function (message, title) {
abp.log.warn('abp.message.success is not implemented!');
return abp.message._showMessage(message, title);
};
abp.message.warn = function (message, title) {
abp.log.warn('abp.message.warn is not implemented!');
return abp.message._showMessage(message, title);
};
abp.message.error = function (message, title) {
abp.log.warn('abp.message.error is not implemented!');
return abp.message._showMessage(message, title);
};
abp.message.confirm = function (message, titleOrCallback, callback) {
abp.log.warn('abp.message.confirm is not properly implemented!');
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
callback = titleOrCallback;
}
var result = confirm(message);
callback && callback(result);
};
/* UI *******************************************************/
abp.ui = abp.ui || {};
/* UI BLOCK */
//Defines UI Block API and implements basically
var $abpBlockArea = document.createElement('div');
$abpBlockArea.classList.add('abp-block-area');
/* opts: { //Can be an object with options or a string for query a selector
* elm: a query selector (optional - default: document.body)
* busy: boolean (optional - default: false)
* promise: A promise with always or finally handler (optional - auto unblocks the ui if provided)
* }
*/
abp.ui.block = function (opts) {
if (!opts) {
opts = {};
} else if (typeof opts == 'string') {
opts = {
elm: opts
};
}
var $elm = document.querySelector(opts.elm) || document.body;
if (opts.busy) {
$abpBlockArea.classList.add('abp-block-area-busy');
} else {
$abpBlockArea.classList.remove('abp-block-area-busy');
}
if (document.querySelector(opts.elm)) {
$abpBlockArea.style.position = 'absolute';
} else {
$abpBlockArea.style.position = 'fixed';
}
$elm.appendChild($abpBlockArea);
if (opts.promise) {
if (opts.promise.always) { //jQuery.Deferred style
opts.promise.always(function () {
abp.ui.unblock({
$elm: opts.elm
});
});
} else if (opts.promise['finally']) { //Q style
opts.promise['finally'](function () {
abp.ui.unblock({
$elm: opts.elm
});
});
}
}
};
/* opts: {
*
* }
*/
abp.ui.unblock = function (opts) {
var element = document.querySelector('.abp-block-area');
if (element) {
element.classList.add('abp-block-area-disappearing');
setTimeout(function () {
if (element) {
element.classList.remove('abp-block-area-disappearing');
if (element.parentElement) {
element.parentElement.removeChild(element);
}
}
}, 250);
}
};
/* UI BUSY */
//Defines UI Busy API, not implements it
abp.ui.setBusy = function (opts) {
if (!opts) {
opts = {
busy: true
};
} else if (typeof opts == 'string') {
opts = {
elm: opts,
busy: true
};
}
abp.ui.block(opts);
};
abp.ui.clearBusy = function (opts) {
abp.ui.unblock(opts);
};
/* SIMPLE EVENT BUS *****************************************/
abp.event = (function () {
var _callbacks = {};
var on = function (eventName, callback) {
if (!_callbacks[eventName]) {
_callbacks[eventName] = [];
}
_callbacks[eventName].push(callback);
};
var off = function (eventName, callback) {
var callbacks = _callbacks[eventName];
if (!callbacks) {
return;
}
var index = -1;
for (var i = 0; i < callbacks.length; i++) {
if (callbacks[i] === callback) {
index = i;
break;
}
}
if (index < 0) {
return;
}
_callbacks[eventName].splice(index, 1);
};
var trigger = function (eventName) {
var callbacks = _callbacks[eventName];
if (!callbacks || !callbacks.length) {
return;
}
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].apply(this, args);
}
};
// Public interface ///////////////////////////////////////////////////
return {
on: on,
off: off,
trigger: trigger
};
})();
/* UTILS ***************************************************/
abp.utils = abp.utils || {};
/* Creates a name namespace.
* Example:
* var taskService = abp.utils.createNamespace(abp, 'services.task');
* taskService will be equal to abp.services.task
* first argument (root) must be defined first
************************************************************/
abp.utils.createNamespace = function (root, ns) {
var parts = ns.split('.');
for (var i = 0; i < parts.length; i++) {
if (typeof root[parts[i]] == 'undefined') {
root[parts[i]] = {};
}
root = root[parts[i]];
}
return root;
};
/* Find and replaces a string (search) to another string (replacement) in
* given string (str).
* Example:
* abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string'
************************************************************/
abp.utils.replaceAll = function (str, search, replacement) {
var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
return str.replace(new RegExp(fix, 'g'), replacement);
};
/* Formats a string just like string.format in C#.
* Example:
* abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana'
************************************************************/
abp.utils.formatString = function () {
if (arguments.length < 1) {
return null;
}
var str = arguments[0];
for (var i = 1; i < arguments.length; i++) {
var placeHolder = '{' + (i - 1) + '}';
str = abp.utils.replaceAll(str, placeHolder, arguments[i]);
}
return str;
};
abp.utils.toPascalCase = function (str) {
if (!str || !str.length) {
return str;
}
if (str.length === 1) {
return str.charAt(0).toUpperCase();
}
return str.charAt(0).toUpperCase() + str.substr(1);
}
abp.utils.toCamelCase = function (str) {
if (!str || !str.length) {
return str;
}
if (str.length === 1) {
return str.charAt(0).toLowerCase();
}
return str.charAt(0).toLowerCase() + str.substr(1);
}
abp.utils.truncateString = function (str, maxLength) {
if (!str || !str.length || str.length <= maxLength) {
return str;
}
return str.substr(0, maxLength);
};
abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) {
postfix = postfix || '...';
if (!str || !str.length || str.length <= maxLength) {
return str;
}
if (maxLength <= postfix.length) {
return postfix.substr(0, maxLength);
}
return str.substr(0, maxLength - postfix.length) + postfix;
};
abp.utils.isFunction = function (obj) {
return !!(obj && obj.constructor && obj.call && obj.apply);
};
/**
* parameterInfos should be an array of { name, value } objects
* where name is query string parameter name and value is it's value.
* includeQuestionMark is true by default.
*/
abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) {
if (includeQuestionMark === undefined) {
includeQuestionMark = true;
}
var qs = '';
function addSeperator() {
if (!qs.length) {
if (includeQuestionMark) {
qs = qs + '?';
}
} else {
qs = qs + '&';
}
}
for (var i = 0; i < parameterInfos.length; ++i) {
var parameterInfo = parameterInfos[i];
if (parameterInfo.value === undefined) {
continue;
}
if (parameterInfo.value === null) {
parameterInfo.value = '';
}
addSeperator();
if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") {
qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON());
} else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) {
for (var j = 0; j < parameterInfo.value.length; j++) {
if (j > 0) {
addSeperator();
}
qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]);
}
} else {
qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value);
}
}
return qs;
}
/**
* Sets a cookie value for given key.
* This is a simple implementation created to be used by ABP.
* Please use a complete cookie library if you need.
* @param {string} key
* @param {string} value
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
* @param {string} path (optional)
*/
abp.utils.setCookieValue = function (key, value, expireDate, path) {
var cookieValue = encodeURIComponent(key) + '=';
if (value) {
cookieValue = cookieValue + encodeURIComponent(value);
}
if (expireDate) {
cookieValue = cookieValue + "; expires=" + expireDate.toUTCString();
}
if (path) {
cookieValue = cookieValue + "; path=" + path;
}
document.cookie = cookieValue;
};
/**
* Gets a cookie with given key.
* This is a simple implementation created to be used by ABP.
* Please use a complete cookie library if you need.
* @param {string} key
* @returns {string} Cookie value or null
*/
abp.utils.getCookieValue = function (key) {
var equalities = document.cookie.split('; ');
for (var i = 0; i < equalities.length; i++) {
if (!equalities[i]) {
continue;
}
var splitted = equalities[i].split('=');
if (splitted.length != 2) {
continue;
}
if (decodeURIComponent(splitted[0]) === key) {
return decodeURIComponent(splitted[1] || '');
}
}
return null;
};
/**
* Deletes cookie for given key.
* This is a simple implementation created to be used by ABP.
* Please use a complete cookie library if you need.
* @param {string} key
* @param {string} path (optional)
*/
abp.utils.deleteCookie = function (key, path) {
var cookieValue = encodeURIComponent(key) + '=';
cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString();
if (path) {
cookieValue = cookieValue + "; path=" + path;
}
document.cookie = cookieValue;
}
/**
* Escape HTML to help prevent XSS attacks.
*/
abp.utils.htmlEscape = function (html) {
return typeof html === 'string' ? html.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;') : html;
}
/* SECURITY ***************************************/
abp.security = abp.security || {};
abp.security.antiForgery = abp.security.antiForgery || {};
abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN';
abp.security.antiForgery.tokenHeaderName = 'RequestVerificationToken';
abp.security.antiForgery.getToken = function () {
return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName);
};
/* CLOCK *****************************************/
abp.clock = abp.clock || {};
abp.clock.kind = 'Unspecified';
abp.clock.supportsMultipleTimezone = function () {
return abp.clock.kind === 'Utc';
};
var toLocal = function (date) {
return new Date(
date.getFullYear(),
date.getMonth(),
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
date.getMilliseconds()
);
};
var toUtc = function (date) {
return Date.UTC(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
date.getUTCMilliseconds()
);
};
abp.clock.now = function () {
if (abp.clock.kind === 'Utc') {
return toUtc(new Date());
}
return new Date();
};
abp.clock.normalize = function (date) {
var kind = abp.clock.kind;
if (kind === 'Unspecified') {
return date;
}
if (kind === 'Local') {
return toLocal(date);
}
if (kind === 'Utc') {
return toUtc(date);
}
};
/* FEATURES *************************************************/
abp.features = abp.features || {};
abp.features.values = abp.features.values || {};
abp.features.isEnabled = function(name){
var value = abp.features.get(name);
return value == 'true' || value == 'True';
}
abp.features.get = function (name) {
return abp.features.values[name];
};
/* GLOBAL FEATURES *************************************************/
abp.globalFeatures = abp.globalFeatures || {};
abp.globalFeatures.enabledFeatures = abp.globalFeatures.enabledFeatures || [];
abp.globalFeatures.isEnabled = function(name){
return abp.globalFeatures.enabledFeatures.indexOf(name) != -1;
}
})();

View File

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/datatables.net-bs5/css/dataTables.bootstrap5.css": "@libs/datatables.net-bs5/css/",
"@node_modules/datatables.net-bs5/js/dataTables.bootstrap5.js": "@libs/datatables.net-bs5/js/"
}
}

View File

@ -0,0 +1,12 @@
{
"version": "6.0.3",
"name": "@abp/datatables.net-bs5",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/datatables.net": "~6.0.3",
"datatables.net-bs5": "^1.11.4"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/datatables.net/js/jquery.dataTables.js": "@libs/datatables.net/js/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/datatables.net",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/datatables.net"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery": "~6.0.3",
"datatables.net": "^1.11.4"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,7 @@
module.exports = {
mappings: {
"@node_modules/@fortawesome/fontawesome-free/css/all.css": "@libs/@fortawesome/fontawesome-free/css/",
"@node_modules/@fortawesome/fontawesome-free/css/v4-shims.css": "@libs/@fortawesome/fontawesome-free/css/",
"@node_modules/@fortawesome/fontawesome-free/webfonts/*.*": "@libs/@fortawesome/fontawesome-free/webfonts/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/font-awesome",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/font-awesome"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"@fortawesome/fontawesome-free": "^5.15.4"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/@abp/jquery-form/src/jquery.form.min.js": "@libs/jquery-form/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/jquery-form",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/jquery-form"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery": "~6.0.3",
"jquery-form": "^4.3.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js": "@libs/jquery-validation-unobtrusive/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/jquery-validation-unobtrusive",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/jquery-validation-unobtrusive"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery-validation": "~6.0.3",
"jquery-validation-unobtrusive": "^3.2.12"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/jquery-validation/dist/jquery.validate.js": "@libs/jquery-validation/",
"@node_modules/jquery-validation/dist/localization/*.*": "@libs/jquery-validation/localization/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/jquery-validation",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/jquery-validation"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery": "~6.0.3",
"jquery-validation": "^1.19.3"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/jquery/dist/jquery.js": "@libs/jquery/",
"@node_modules/@abp/jquery/src/*.*": "@libs/abp/jquery/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/jquery",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/jquery"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"jquery": "~3.6.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,406 @@
var abp = abp || {};
(function($) {
if (!$) {
throw "abp/jquery library requires the jquery library included to the page!";
}
// ABP CORE OVERRIDES /////////////////////////////////////////////////////
abp.message._showMessage = function (message, title) {
alert((title || '') + ' ' + message);
return $.Deferred(function ($dfd) {
$dfd.resolve();
});
};
abp.message.confirm = function (message, titleOrCallback, callback) {
if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
callback = titleOrCallback;
}
var result = confirm(message);
callback && callback(result);
return $.Deferred(function ($dfd) {
$dfd.resolve(result);
});
};
abp.utils.isFunction = function (obj) {
return $.isFunction(obj);
};
// JQUERY EXTENSIONS //////////////////////////////////////////////////////
$.fn.findWithSelf = function (selector) {
return this.filter(selector).add(this.find(selector));
};
// DOM ////////////////////////////////////////////////////////////////////
abp.dom = abp.dom || {};
abp.dom.onNodeAdded = function (callback) {
abp.event.on('abp.dom.nodeAdded', callback);
};
abp.dom.onNodeRemoved = function (callback) {
abp.event.on('abp.dom.nodeRemoved', callback);
};
var mutationObserverCallback = function (mutationsList) {
for (var i = 0; i < mutationsList.length; i++) {
var mutation = mutationsList[i];
if (mutation.type === 'childList') {
if (mutation.addedNodes && mutation.removedNodes.length) {
for (var k = 0; k < mutation.removedNodes.length; k++) {
abp.event.trigger(
'abp.dom.nodeRemoved',
{
$el: $(mutation.removedNodes[k])
}
);
}
}
if (mutation.addedNodes && mutation.addedNodes.length) {
for (var j = 0; j < mutation.addedNodes.length; j++) {
abp.event.trigger(
'abp.dom.nodeAdded',
{
$el: $(mutation.addedNodes[j])
}
);
}
}
}
}
};
$(function(){
new MutationObserver(mutationObserverCallback).observe(
$('body')[0],
{
subtree: true,
childList: true
}
);
});
// AJAX ///////////////////////////////////////////////////////////////////
abp.ajax = function (userOptions) {
userOptions = userOptions || {};
var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);
options.success = undefined;
options.error = undefined;
var xhr = null;
var promise = $.Deferred(function ($dfd) {
xhr = $.ajax(options)
.done(function (data, textStatus, jqXHR) {
$dfd.resolve(data);
userOptions.success && userOptions.success(data);
}).fail(function (jqXHR) {
if(jqXHR.statusText === 'abort') {
//ajax request is abort, ignore error handle.
return;
}
if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') {
abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd);
} else {
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
}
});
}).promise();
promise['jqXHR'] = xhr;
return promise;
};
$.extend(abp.ajax, {
defaultOpts: {
dataType: 'json',
type: 'POST',
contentType: 'application/json',
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
},
defaultError: {
message: 'An error has occurred!',
details: 'Error detail not sent by server.'
},
defaultError401: {
message: 'You are not authenticated!',
details: 'You should be authenticated (sign in) in order to perform this operation.'
},
defaultError403: {
message: 'You are not authorized!',
details: 'You are not allowed to perform this operation.'
},
defaultError404: {
message: 'Resource not found!',
details: 'The resource requested could not found on the server.'
},
logError: function (error) {
abp.log.error(error);
},
showError: function (error) {
if (error.details) {
return abp.message.error(error.details, error.message);
} else {
return abp.message.error(error.message || abp.ajax.defaultError.message);
}
},
handleTargetUrl: function (targetUrl) {
if (!targetUrl) {
location.href = abp.appPath;
} else {
location.href = targetUrl;
}
},
handleErrorStatusCode: function (status) {
switch (status) {
case 401:
abp.ajax.handleUnAuthorizedRequest(
abp.ajax.showError(abp.ajax.defaultError401),
abp.appPath
);
break;
case 403:
abp.ajax.showError(abp.ajax.defaultError403);
break;
case 404:
abp.ajax.showError(abp.ajax.defaultError404);
break;
default:
abp.ajax.showError(abp.ajax.defaultError);
break;
}
},
handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
if (userOptions.abpHandleError !== false) {
abp.ajax.handleErrorStatusCode(jqXHR.status);
}
$dfd.reject.apply(this, arguments);
userOptions.error && userOptions.error.apply(this, arguments);
},
handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) {
var messagePromise = null;
var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText);
if (userOptions.abpHandleError !== false) {
messagePromise = abp.ajax.showError(responseJSON.error);
}
abp.ajax.logError(responseJSON.error);
$dfd && $dfd.reject(responseJSON.error, jqXHR);
userOptions.error && userOptions.error(responseJSON.error, jqXHR);
if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {
abp.ajax.handleUnAuthorizedRequest(messagePromise);
}
},
handleUnAuthorizedRequest: function (messagePromise, targetUrl) {
if (messagePromise) {
messagePromise.done(function () {
abp.ajax.handleTargetUrl(targetUrl);
});
} else {
abp.ajax.handleTargetUrl(targetUrl);
}
},
blockUI: function (options) {
if (options.blockUI) {
if (options.blockUI === true) { //block whole page
abp.ui.setBusy();
} else { //block an element
abp.ui.setBusy(options.blockUI);
}
}
},
unblockUI: function (options) {
if (options.blockUI) {
if (options.blockUI === true) { //unblock whole page
abp.ui.clearBusy();
} else { //unblock an element
abp.ui.clearBusy(options.blockUI);
}
}
},
ajaxSendHandler: function (event, request, settings) {
var token = abp.security.antiForgery.getToken();
if (!token) {
return;
}
if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {
request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);
}
}
});
$(document).ajaxSend(function (event, request, settings) {
return abp.ajax.ajaxSendHandler(event, request, settings);
});
abp.event.on('abp.configurationInitialized', function () {
var l = abp.localization.getResource('AbpUi');
abp.ajax.defaultError.message = l('DefaultErrorMessage');
abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
});
// RESOURCE LOADER ////////////////////////////////////////////////////////
/* UrlStates enum */
var UrlStates = {
LOADING: 'LOADING',
LOADED: 'LOADED',
FAILED: 'FAILED'
};
/* UrlInfo class */
function UrlInfo(url) {
this.url = url;
this.state = UrlStates.LOADING;
this.loadCallbacks = [];
this.failCallbacks = [];
}
UrlInfo.prototype.succeed = function () {
this.state = UrlStates.LOADED;
for (var i = 0; i < this.loadCallbacks.length; i++) {
this.loadCallbacks[i]();
}
};
UrlInfo.prototype.failed = function () {
this.state = UrlStates.FAILED;
for (var i = 0; i < this.failCallbacks.length; i++) {
this.failCallbacks[i]();
}
};
UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) {
switch (this.state) {
case UrlStates.LOADED:
loadCallback && loadCallback();
break;
case UrlStates.FAILED:
failCallback && failCallback();
break;
case UrlStates.LOADING:
this.addCallbacks(loadCallback, failCallback);
break;
}
};
UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) {
loadCallback && this.loadCallbacks.push(loadCallback);
failCallback && this.failCallbacks.push(failCallback);
};
/* ResourceLoader API */
abp.ResourceLoader = (function () {
var _urlInfos = {};
function getCacheKey(url) {
return url;
}
function appendTimeToUrl(url) {
if (url.indexOf('?') < 0) {
url += '?';
} else {
url += '&';
}
url += '_=' + new Date().getTime();
return url;
}
var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) {
var cacheKey = getCacheKey(url);
var urlInfo = _urlInfos[cacheKey];
if (urlInfo) {
urlInfo.handleCallbacks(loadCallback, failCallback);
return;
}
_urlInfos[cacheKey] = urlInfo = new UrlInfo(url);
urlInfo.addCallbacks(loadCallback, failCallback);
serverLoader(urlInfo);
};
var _loadScript = function (url, loadCallback, failCallback) {
_loadFromUrl(url, loadCallback, failCallback, function (urlInfo) {
$.get({
url: url,
dataType: 'text'
})
.done(function (script) {
$.globalEval(script);
urlInfo.succeed();
})
.fail(function () {
urlInfo.failed();
});
});
};
var _loadStyle = function (url) {
_loadFromUrl(url, undefined, undefined, function (urlInfo) {
$('<link/>', {
rel: 'stylesheet',
type: 'text/css',
href: appendTimeToUrl(url)
}).appendTo('head');
});
};
return {
loadScript: _loadScript,
loadStyle: _loadStyle
}
})();
})(jQuery);

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/lodash/lodash.min.js": "@libs/lodash/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/lodash",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/lodash"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"lodash": "^4.17.21"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/luxon/build/global/*.*": "@libs/luxon/",
"@node_modules/@abp/luxon/src/*.*": "@libs/abp/luxon/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/luxon",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/luxon"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"luxon": "^2.3.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,46 @@
var abp = abp || {};
(function () {
if (!luxon) {
throw "abp/luxon library requires the luxon library included to the page!";
}
/* TIMING *************************************************/
abp.timing = abp.timing || {};
var setObjectValue = function (obj, property, value) {
if (typeof property === "string") {
property = property.split('.');
}
if (property.length > 1) {
var p = property.shift();
setObjectValue(obj[p], property, value);
} else {
obj[property[0]] = value;
}
}
var getObjectValue = function (obj, property) {
return property.split('.').reduce((a, v) => a[v], obj)
}
abp.timing.convertFieldsToIsoDate = function (form, fields) {
for (var field of fields) {
var dateTime = luxon.DateTime
.fromFormat(
getObjectValue(form, field),
abp.localization.currentCulture.dateTimeFormat.shortDatePattern,
{locale: abp.localization.currentCulture.cultureName}
);
if (!dateTime.invalid) {
setObjectValue(form, field, dateTime.toFormat("yyyy-MM-dd HH:mm:ss"))
}
}
return form;
}
})(jQuery);

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/malihu-custom-scrollbar-plugin/*.*": "@libs/malihu-custom-scrollbar-plugin/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/malihu-custom-scrollbar-plugin",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/malihu-custom-scrollbar-plugin"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"malihu-custom-scrollbar-plugin": "^3.1.5"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,8 @@
module.exports = {
mappings: {
"@node_modules/select2/dist/css/select2.min.css": "@libs/select2/css/",
"@node_modules/select2/dist/js/select2.min.js": "@libs/select2/js/",
"@node_modules/select2/dist/js/select2.full.min.js": "@libs/select2/js/",
"@node_modules/select2/dist/js/i18n/*.js": "@libs/select2/js/i18n/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/select2",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/select2"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~6.0.3",
"select2": "^4.0.13"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/sweetalert2/dist/*.*": "@libs/sweetalert2/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/sweetalert2",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/sweetalert2"
},
"dependencies": {
"@abp/core": "~6.0.3",
"sweetalert2": "^11.3.6"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/timeago/jquery.timeago.js": "@libs/timeago/",
"@node_modules/timeago/locales/*.*": "@libs/timeago/locales/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/timeago",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/timeago"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery": "~6.0.3",
"timeago": "^1.6.7"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
"@node_modules/toastr/build/*.*": "@libs/toastr/"
}
}

View File

@ -0,0 +1,17 @@
{
"version": "6.0.3",
"name": "@abp/toastr",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/toastr"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery": "~6.0.3",
"toastr": "^2.1.4"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1 @@
# @abp/utils

View File

@ -0,0 +1,5 @@
module.exports = {
mappings: {
'@node_modules/@abp/utils/dist/bundles/*.*': '@libs/abp/utils/',
},
};

View File

@ -0,0 +1 @@
# @abp/utils

View File

@ -0,0 +1,4 @@
/**
* Generated bundle index. Do not edit.
*/
export * from './public-api';

View File

@ -0,0 +1 @@
{"__symbolic":"module","version":4,"metadata":{"ListNode":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":7,"character":37,"context":{"typeName":"T"},"module":"./lib/linked-list"}]}]}},"LinkedList":{"__symbolic":"class","arity":1,"members":{"attach":[{"__symbolic":"method"}],"attachMany":[{"__symbolic":"method"}],"detach":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"addMany":[{"__symbolic":"method"}],"addAfter":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addBefore":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addByIndex":[{"__symbolic":"method"}],"addHead":[{"__symbolic":"method"}],"addTail":[{"__symbolic":"method"}],"addManyAfter":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addManyBefore":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addManyByIndex":[{"__symbolic":"method"}],"addManyHead":[{"__symbolic":"method"}],"addManyTail":[{"__symbolic":"method"}],"drop":[{"__symbolic":"method"}],"dropMany":[{"__symbolic":"method"}],"dropByIndex":[{"__symbolic":"method"}],"dropByValue":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"dropByValueAll":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"dropHead":[{"__symbolic":"method"}],"dropTail":[{"__symbolic":"method"}],"dropManyByIndex":[{"__symbolic":"method"}],"dropManyHead":[{"__symbolic":"method"}],"dropManyTail":[{"__symbolic":"method"}],"find":[{"__symbolic":"method"}],"findIndex":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"indexOf":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}],"toNodeArray":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}]}},"ListMapperFn":{"__symbolic":"interface"},"ListComparisonFn":{"__symbolic":"interface"},"ListIteratorFn":{"__symbolic":"interface"}},"origins":{"ListNode":"./lib/linked-list","LinkedList":"./lib/linked-list","ListMapperFn":"./lib/linked-list","ListComparisonFn":"./lib/linked-list","ListIteratorFn":"./lib/linked-list"},"importAs":"@abp/utils"}

View File

@ -0,0 +1,694 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('just-compare')) :
typeof define === 'function' && define.amd ? define('@abp/utils', ['exports', 'just-compare'], factory) :
(global = global || self, factory((global.abp = global.abp || {}, global.abp.utils = global.abp.utils || {}, global.abp.utils.common = {}), global.compare));
}(this, (function (exports, compare) { 'use strict';
compare = compare && Object.prototype.hasOwnProperty.call(compare, 'default') ? compare['default'] : compare;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); };
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try {
step(generator.next(value));
}
catch (e) {
reject(e);
} }
function rejected(value) { try {
step(generator["throw"](value));
}
catch (e) {
reject(e);
} }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function () { if (t[0] & 1)
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f)
throw new TypeError("Generator is already executing.");
while (_)
try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
return t;
if (y = 0, t)
op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2])
_.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) {
op = [6, e];
y = 0;
}
finally {
f = t = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function (o, m, k, k2) {
if (k2 === undefined)
k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
}) : (function (o, m, k, k2) {
if (k2 === undefined)
k2 = k;
o[k2] = m[k];
});
function __exportStar(m, exports) {
for (var p in m)
if (p !== "default" && !exports.hasOwnProperty(p))
__createBinding(exports, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m)
return m.call(o);
if (o && typeof o.length === "number")
return {
next: function () {
if (o && i >= o.length)
o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m)
return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
}
catch (error) {
e = { error: error };
}
finally {
try {
if (r && !r.done && (m = i["return"]))
m.call(i);
}
finally {
if (e)
throw e.error;
}
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
;
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n])
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try {
step(g[n](v));
}
catch (e) {
settle(q[0][3], e);
} }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length)
resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) {
Object.defineProperty(cooked, "raw", { value: raw });
}
else {
cooked.raw = raw;
}
return cooked;
}
;
var __setModuleDefault = Object.create ? (function (o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function (o, v) {
o["default"] = v;
};
function __importStar(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null)
for (var k in mod)
if (Object.hasOwnProperty.call(mod, k))
__createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
}
function __classPrivateFieldSet(receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
}
var ListNode = /** @class */ (function () {
function ListNode(value) {
this.value = value;
}
return ListNode;
}());
var LinkedList = /** @class */ (function () {
function LinkedList() {
this.size = 0;
}
Object.defineProperty(LinkedList.prototype, "head", {
get: function () {
return this.first;
},
enumerable: false,
configurable: true
});
Object.defineProperty(LinkedList.prototype, "tail", {
get: function () {
return this.last;
},
enumerable: false,
configurable: true
});
Object.defineProperty(LinkedList.prototype, "length", {
get: function () {
return this.size;
},
enumerable: false,
configurable: true
});
LinkedList.prototype.attach = function (value, previousNode, nextNode) {
if (!previousNode)
return this.addHead(value);
if (!nextNode)
return this.addTail(value);
var node = new ListNode(value);
node.previous = previousNode;
previousNode.next = node;
node.next = nextNode;
nextNode.previous = node;
this.size++;
return node;
};
LinkedList.prototype.attachMany = function (values, previousNode, nextNode) {
if (!values.length)
return [];
if (!previousNode)
return this.addManyHead(values);
if (!nextNode)
return this.addManyTail(values);
var list = new LinkedList();
list.addManyTail(values);
list.first.previous = previousNode;
previousNode.next = list.first;
list.last.next = nextNode;
nextNode.previous = list.last;
this.size += values.length;
return list.toNodeArray();
};
LinkedList.prototype.detach = function (node) {
if (!node.previous)
return this.dropHead();
if (!node.next)
return this.dropTail();
node.previous.next = node.next;
node.next.previous = node.previous;
this.size--;
return node;
};
LinkedList.prototype.add = function (value) {
var _this = this;
return {
after: function () {
var _a;
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return (_a = _this.addAfter).call.apply(_a, __spread([_this, value], params));
},
before: function () {
var _a;
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return (_a = _this.addBefore).call.apply(_a, __spread([_this, value], params));
},
byIndex: function (position) { return _this.addByIndex(value, position); },
head: function () { return _this.addHead(value); },
tail: function () { return _this.addTail(value); },
};
};
LinkedList.prototype.addMany = function (values) {
var _this = this;
return {
after: function () {
var _a;
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return (_a = _this.addManyAfter).call.apply(_a, __spread([_this, values], params));
},
before: function () {
var _a;
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return (_a = _this.addManyBefore).call.apply(_a, __spread([_this, values], params));
},
byIndex: function (position) { return _this.addManyByIndex(values, position); },
head: function () { return _this.addManyHead(values); },
tail: function () { return _this.addManyTail(values); },
};
};
LinkedList.prototype.addAfter = function (value, previousValue, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
var previous = this.find(function (node) { return compareFn(node.value, previousValue); });
return previous ? this.attach(value, previous, previous.next) : this.addTail(value);
};
LinkedList.prototype.addBefore = function (value, nextValue, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
var next = this.find(function (node) { return compareFn(node.value, nextValue); });
return next ? this.attach(value, next.previous, next) : this.addHead(value);
};
LinkedList.prototype.addByIndex = function (value, position) {
if (position < 0)
position += this.size;
else if (position >= this.size)
return this.addTail(value);
if (position <= 0)
return this.addHead(value);
var next = this.get(position);
return this.attach(value, next.previous, next);
};
LinkedList.prototype.addHead = function (value) {
var node = new ListNode(value);
node.next = this.first;
if (this.first)
this.first.previous = node;
else
this.last = node;
this.first = node;
this.size++;
return node;
};
LinkedList.prototype.addTail = function (value) {
var node = new ListNode(value);
if (this.first) {
node.previous = this.last;
this.last.next = node;
this.last = node;
}
else {
this.first = node;
this.last = node;
}
this.size++;
return node;
};
LinkedList.prototype.addManyAfter = function (values, previousValue, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
var previous = this.find(function (node) { return compareFn(node.value, previousValue); });
return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);
};
LinkedList.prototype.addManyBefore = function (values, nextValue, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
var next = this.find(function (node) { return compareFn(node.value, nextValue); });
return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);
};
LinkedList.prototype.addManyByIndex = function (values, position) {
if (position < 0)
position += this.size;
if (position <= 0)
return this.addManyHead(values);
if (position >= this.size)
return this.addManyTail(values);
var next = this.get(position);
return this.attachMany(values, next.previous, next);
};
LinkedList.prototype.addManyHead = function (values) {
var _this = this;
return values.reduceRight(function (nodes, value) {
nodes.unshift(_this.addHead(value));
return nodes;
}, []);
};
LinkedList.prototype.addManyTail = function (values) {
var _this = this;
return values.map(function (value) { return _this.addTail(value); });
};
LinkedList.prototype.drop = function () {
var _this = this;
return {
byIndex: function (position) { return _this.dropByIndex(position); },
byValue: function () {
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return _this.dropByValue.apply(_this, params);
},
byValueAll: function () {
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return _this.dropByValueAll.apply(_this, params);
},
head: function () { return _this.dropHead(); },
tail: function () { return _this.dropTail(); },
};
};
LinkedList.prototype.dropMany = function (count) {
var _this = this;
return {
byIndex: function (position) { return _this.dropManyByIndex(count, position); },
head: function () { return _this.dropManyHead(count); },
tail: function () { return _this.dropManyTail(count); },
};
};
LinkedList.prototype.dropByIndex = function (position) {
if (position < 0)
position += this.size;
var current = this.get(position);
return current ? this.detach(current) : undefined;
};
LinkedList.prototype.dropByValue = function (value, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
var position = this.findIndex(function (node) { return compareFn(node.value, value); });
return position < 0 ? undefined : this.dropByIndex(position);
};
LinkedList.prototype.dropByValueAll = function (value, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
var dropped = [];
for (var current = this.first, position = 0; current; position++, current = current.next) {
if (compareFn(current.value, value)) {
dropped.push(this.dropByIndex(position - dropped.length));
}
}
return dropped;
};
LinkedList.prototype.dropHead = function () {
var head = this.first;
if (head) {
this.first = head.next;
if (this.first)
this.first.previous = undefined;
else
this.last = undefined;
this.size--;
return head;
}
return undefined;
};
LinkedList.prototype.dropTail = function () {
var tail = this.last;
if (tail) {
this.last = tail.previous;
if (this.last)
this.last.next = undefined;
else
this.first = undefined;
this.size--;
return tail;
}
return undefined;
};
LinkedList.prototype.dropManyByIndex = function (count, position) {
if (count <= 0)
return [];
if (position < 0)
position = Math.max(position + this.size, 0);
else if (position >= this.size)
return [];
count = Math.min(count, this.size - position);
var dropped = [];
while (count--) {
var current = this.get(position);
dropped.push(this.detach(current));
}
return dropped;
};
LinkedList.prototype.dropManyHead = function (count) {
if (count <= 0)
return [];
count = Math.min(count, this.size);
var dropped = [];
while (count--)
dropped.unshift(this.dropHead());
return dropped;
};
LinkedList.prototype.dropManyTail = function (count) {
if (count <= 0)
return [];
count = Math.min(count, this.size);
var dropped = [];
while (count--)
dropped.push(this.dropTail());
return dropped;
};
LinkedList.prototype.find = function (predicate) {
for (var current = this.first, position = 0; current; position++, current = current.next) {
if (predicate(current, position, this))
return current;
}
return undefined;
};
LinkedList.prototype.findIndex = function (predicate) {
for (var current = this.first, position = 0; current; position++, current = current.next) {
if (predicate(current, position, this))
return position;
}
return -1;
};
LinkedList.prototype.forEach = function (iteratorFn) {
for (var node = this.first, position = 0; node; position++, node = node.next) {
iteratorFn(node, position, this);
}
};
LinkedList.prototype.get = function (position) {
return this.find(function (_, index) { return position === index; });
};
LinkedList.prototype.indexOf = function (value, compareFn) {
if (compareFn === void 0) { compareFn = compare; }
return this.findIndex(function (node) { return compareFn(node.value, value); });
};
LinkedList.prototype.toArray = function () {
var array = new Array(this.size);
this.forEach(function (node, index) { return (array[index] = node.value); });
return array;
};
LinkedList.prototype.toNodeArray = function () {
var array = new Array(this.size);
this.forEach(function (node, index) { return (array[index] = node); });
return array;
};
LinkedList.prototype.toString = function (mapperFn) {
if (mapperFn === void 0) { mapperFn = JSON.stringify; }
return this.toArray()
.map(function (value) { return mapperFn(value); })
.join(' <-> ');
};
// Cannot use Generator type because of ng-packagr
LinkedList.prototype[Symbol.iterator] = function () {
var node, position;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
node = this.first, position = 0;
_a.label = 1;
case 1:
if (!node) return [3 /*break*/, 4];
return [4 /*yield*/, node.value];
case 2:
_a.sent();
_a.label = 3;
case 3:
position++, node = node.next;
return [3 /*break*/, 1];
case 4: return [2 /*return*/];
}
});
};
return LinkedList;
}());
/*
* Public API Surface of utils
*/
/**
* Generated bundle index. Do not edit.
*/
exports.LinkedList = LinkedList;
exports.ListNode = ListNode;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=abp-utils.umd.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
/**
* Generated bundle index. Do not edit.
*/
export * from './public-api';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJwLXV0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vcHJvamVjdHMvdXRpbHMvc3JjL2FicC11dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
/*
* Public API Surface of utils
*/
export * from './lib/linked-list';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3Byb2plY3RzL3V0aWxzL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxtQkFBbUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiB1dGlsc1xyXG4gKi9cclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2xpbmtlZC1saXN0JztcclxuIl19

View File

@ -0,0 +1,300 @@
import compare from 'just-compare';
/* tslint:disable:no-non-null-assertion */
class ListNode {
constructor(value) {
this.value = value;
}
}
class LinkedList {
constructor() {
this.size = 0;
}
get head() {
return this.first;
}
get tail() {
return this.last;
}
get length() {
return this.size;
}
attach(value, previousNode, nextNode) {
if (!previousNode)
return this.addHead(value);
if (!nextNode)
return this.addTail(value);
const node = new ListNode(value);
node.previous = previousNode;
previousNode.next = node;
node.next = nextNode;
nextNode.previous = node;
this.size++;
return node;
}
attachMany(values, previousNode, nextNode) {
if (!values.length)
return [];
if (!previousNode)
return this.addManyHead(values);
if (!nextNode)
return this.addManyTail(values);
const list = new LinkedList();
list.addManyTail(values);
list.first.previous = previousNode;
previousNode.next = list.first;
list.last.next = nextNode;
nextNode.previous = list.last;
this.size += values.length;
return list.toNodeArray();
}
detach(node) {
if (!node.previous)
return this.dropHead();
if (!node.next)
return this.dropTail();
node.previous.next = node.next;
node.next.previous = node.previous;
this.size--;
return node;
}
add(value) {
return {
after: (...params) => this.addAfter.call(this, value, ...params),
before: (...params) => this.addBefore.call(this, value, ...params),
byIndex: (position) => this.addByIndex(value, position),
head: () => this.addHead(value),
tail: () => this.addTail(value),
};
}
addMany(values) {
return {
after: (...params) => this.addManyAfter.call(this, values, ...params),
before: (...params) => this.addManyBefore.call(this, values, ...params),
byIndex: (position) => this.addManyByIndex(values, position),
head: () => this.addManyHead(values),
tail: () => this.addManyTail(values),
};
}
addAfter(value, previousValue, compareFn = compare) {
const previous = this.find(node => compareFn(node.value, previousValue));
return previous ? this.attach(value, previous, previous.next) : this.addTail(value);
}
addBefore(value, nextValue, compareFn = compare) {
const next = this.find(node => compareFn(node.value, nextValue));
return next ? this.attach(value, next.previous, next) : this.addHead(value);
}
addByIndex(value, position) {
if (position < 0)
position += this.size;
else if (position >= this.size)
return this.addTail(value);
if (position <= 0)
return this.addHead(value);
const next = this.get(position);
return this.attach(value, next.previous, next);
}
addHead(value) {
const node = new ListNode(value);
node.next = this.first;
if (this.first)
this.first.previous = node;
else
this.last = node;
this.first = node;
this.size++;
return node;
}
addTail(value) {
const node = new ListNode(value);
if (this.first) {
node.previous = this.last;
this.last.next = node;
this.last = node;
}
else {
this.first = node;
this.last = node;
}
this.size++;
return node;
}
addManyAfter(values, previousValue, compareFn = compare) {
const previous = this.find(node => compareFn(node.value, previousValue));
return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);
}
addManyBefore(values, nextValue, compareFn = compare) {
const next = this.find(node => compareFn(node.value, nextValue));
return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);
}
addManyByIndex(values, position) {
if (position < 0)
position += this.size;
if (position <= 0)
return this.addManyHead(values);
if (position >= this.size)
return this.addManyTail(values);
const next = this.get(position);
return this.attachMany(values, next.previous, next);
}
addManyHead(values) {
return values.reduceRight((nodes, value) => {
nodes.unshift(this.addHead(value));
return nodes;
}, []);
}
addManyTail(values) {
return values.map(value => this.addTail(value));
}
drop() {
return {
byIndex: (position) => this.dropByIndex(position),
byValue: (...params) => this.dropByValue.apply(this, params),
byValueAll: (...params) => this.dropByValueAll.apply(this, params),
head: () => this.dropHead(),
tail: () => this.dropTail(),
};
}
dropMany(count) {
return {
byIndex: (position) => this.dropManyByIndex(count, position),
head: () => this.dropManyHead(count),
tail: () => this.dropManyTail(count),
};
}
dropByIndex(position) {
if (position < 0)
position += this.size;
const current = this.get(position);
return current ? this.detach(current) : undefined;
}
dropByValue(value, compareFn = compare) {
const position = this.findIndex(node => compareFn(node.value, value));
return position < 0 ? undefined : this.dropByIndex(position);
}
dropByValueAll(value, compareFn = compare) {
const dropped = [];
for (let current = this.first, position = 0; current; position++, current = current.next) {
if (compareFn(current.value, value)) {
dropped.push(this.dropByIndex(position - dropped.length));
}
}
return dropped;
}
dropHead() {
const head = this.first;
if (head) {
this.first = head.next;
if (this.first)
this.first.previous = undefined;
else
this.last = undefined;
this.size--;
return head;
}
return undefined;
}
dropTail() {
const tail = this.last;
if (tail) {
this.last = tail.previous;
if (this.last)
this.last.next = undefined;
else
this.first = undefined;
this.size--;
return tail;
}
return undefined;
}
dropManyByIndex(count, position) {
if (count <= 0)
return [];
if (position < 0)
position = Math.max(position + this.size, 0);
else if (position >= this.size)
return [];
count = Math.min(count, this.size - position);
const dropped = [];
while (count--) {
const current = this.get(position);
dropped.push(this.detach(current));
}
return dropped;
}
dropManyHead(count) {
if (count <= 0)
return [];
count = Math.min(count, this.size);
const dropped = [];
while (count--)
dropped.unshift(this.dropHead());
return dropped;
}
dropManyTail(count) {
if (count <= 0)
return [];
count = Math.min(count, this.size);
const dropped = [];
while (count--)
dropped.push(this.dropTail());
return dropped;
}
find(predicate) {
for (let current = this.first, position = 0; current; position++, current = current.next) {
if (predicate(current, position, this))
return current;
}
return undefined;
}
findIndex(predicate) {
for (let current = this.first, position = 0; current; position++, current = current.next) {
if (predicate(current, position, this))
return position;
}
return -1;
}
forEach(iteratorFn) {
for (let node = this.first, position = 0; node; position++, node = node.next) {
iteratorFn(node, position, this);
}
}
get(position) {
return this.find((_, index) => position === index);
}
indexOf(value, compareFn = compare) {
return this.findIndex(node => compareFn(node.value, value));
}
toArray() {
const array = new Array(this.size);
this.forEach((node, index) => (array[index] = node.value));
return array;
}
toNodeArray() {
const array = new Array(this.size);
this.forEach((node, index) => (array[index] = node));
return array;
}
toString(mapperFn = JSON.stringify) {
return this.toArray()
.map(value => mapperFn(value))
.join(' <-> ');
}
// Cannot use Generator type because of ng-packagr
*[Symbol.iterator]() {
for (let node = this.first, position = 0; node; position++, node = node.next) {
yield node.value;
}
}
}
/*
* Public API Surface of utils
*/
/**
* Generated bundle index. Do not edit.
*/
export { LinkedList, ListNode };
//# sourceMappingURL=abp-utils.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,80 @@
export declare class ListNode<T = any> {
readonly value: T;
next: ListNode | undefined;
previous: ListNode | undefined;
constructor(value: T);
}
export declare class LinkedList<T = any> {
private first;
private last;
private size;
get head(): ListNode<T> | undefined;
get tail(): ListNode<T> | undefined;
get length(): number;
private attach;
private attachMany;
private detach;
add(value: T): {
after: (...params: [T] | [any, ListComparisonFn<T>]) => ListNode<T>;
before: (...params: [T] | [any, ListComparisonFn<T>]) => ListNode<T>;
byIndex: (position: number) => ListNode<T>;
head: () => ListNode<T>;
tail: () => ListNode<T>;
};
addMany(values: T[]): {
after: (...params: [T] | [any, ListComparisonFn<T>]) => ListNode<T>[];
before: (...params: [T] | [any, ListComparisonFn<T>]) => ListNode<T>[];
byIndex: (position: number) => ListNode<T>[];
head: () => ListNode<T>[];
tail: () => ListNode<T>[];
};
addAfter(value: T, previousValue: T): ListNode<T>;
addAfter(value: T, previousValue: any, compareFn: ListComparisonFn<T>): ListNode<T>;
addBefore(value: T, nextValue: T): ListNode<T>;
addBefore(value: T, nextValue: any, compareFn: ListComparisonFn<T>): ListNode<T>;
addByIndex(value: T, position: number): ListNode<T>;
addHead(value: T): ListNode<T>;
addTail(value: T): ListNode<T>;
addManyAfter(values: T[], previousValue: T): ListNode<T>[];
addManyAfter(values: T[], previousValue: any, compareFn: ListComparisonFn<T>): ListNode<T>[];
addManyBefore(values: T[], nextValue: T): ListNode<T>[];
addManyBefore(values: T[], nextValue: any, compareFn: ListComparisonFn<T>): ListNode<T>[];
addManyByIndex(values: T[], position: number): ListNode<T>[];
addManyHead(values: T[]): ListNode<T>[];
addManyTail(values: T[]): ListNode<T>[];
drop(): {
byIndex: (position: number) => ListNode<T>;
byValue: (...params: [T] | [any, ListComparisonFn<T>]) => ListNode<T>;
byValueAll: (...params: [T] | [any, ListComparisonFn<T>]) => ListNode<T>[];
head: () => ListNode<T>;
tail: () => ListNode<T>;
};
dropMany(count: number): {
byIndex: (position: number) => ListNode<T>[];
head: () => ListNode<T>[];
tail: () => ListNode<T>[];
};
dropByIndex(position: number): ListNode<T> | undefined;
dropByValue(value: T): ListNode<T> | undefined;
dropByValue(value: any, compareFn: ListComparisonFn<T>): ListNode<T> | undefined;
dropByValueAll(value: T): ListNode<T>[];
dropByValueAll(value: any, compareFn: ListComparisonFn<T>): ListNode<T>[];
dropHead(): ListNode<T> | undefined;
dropTail(): ListNode<T> | undefined;
dropManyByIndex(count: number, position: number): ListNode<T>[];
dropManyHead(count: Exclude<number, 0>): ListNode<T>[];
dropManyTail(count: Exclude<number, 0>): ListNode<T>[];
find(predicate: ListIteratorFn<T>): ListNode<T> | undefined;
findIndex(predicate: ListIteratorFn<T>): number;
forEach<R = boolean>(iteratorFn: ListIteratorFn<T, R>): void;
get(position: number): ListNode<T> | undefined;
indexOf(value: T): number;
indexOf(value: any, compareFn: ListComparisonFn<T>): number;
toArray(): T[];
toNodeArray(): ListNode<T>[];
toString(mapperFn?: ListMapperFn<T>): string;
[Symbol.iterator](): any;
}
export declare type ListMapperFn<T = any> = (value: T) => any;
export declare type ListComparisonFn<T = any> = (value1: T, value2: any) => boolean;
export declare type ListIteratorFn<T = any, R = boolean> = (node: ListNode<T>, index?: number, list?: LinkedList) => R;

View File

@ -0,0 +1,27 @@
{
"name": "@abp/utils",
"version": "6.0.3",
"publishConfig": {
"access": "public"
},
"main": "bundles/abp-utils.umd.js",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git",
"directory": "npm/packs/utils"
},
"module": "fesm2015/abp-utils.js",
"es2015_ivy_ngcc": "__ivy_ngcc__/dist/fesm2015/abp-utils.js",
"es2015": "fesm2015/abp-utils.js",
"esm2015": "esm2015/abp-utils.js",
"fesm2015_ivy_ngcc": "__ivy_ngcc__/dist/fesm2015/abp-utils.js",
"fesm2015": "fesm2015/abp-utils.js",
"typings": "abp-utils.d.ts",
"metadata": "abp-utils.metadata.json",
"sideEffects": false,
"dependencies": {
"just-compare": "^1.3.0",
"tslib": "^2.0.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

View File

@ -0,0 +1 @@
export * from './lib/linked-list';

Some files were not shown because too many files have changed in this diff Show More