@abp/ng.core 7.0.0 → 7.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/esm2020/lib/clients/http.client.mjs +34 -0
  2. package/esm2020/lib/clients/index.mjs +2 -0
  3. package/esm2020/lib/core.module.mjs +7 -1
  4. package/esm2020/lib/directives/permission.directive.mjs +11 -6
  5. package/esm2020/lib/providers/include-localization-resources.provider.mjs +2 -2
  6. package/esm2020/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.mjs +1 -1
  7. package/esm2020/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.mjs +1 -1
  8. package/esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.mjs +1 -1
  9. package/esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service.mjs +2 -2
  10. package/esm2020/lib/proxy/volo/abp/http/modeling/models.mjs +1 -1
  11. package/esm2020/lib/proxy/volo/abp/localization/models.mjs +1 -1
  12. package/esm2020/lib/services/localization.service.mjs +2 -2
  13. package/esm2020/lib/tokens/http-context.token.mjs +3 -0
  14. package/esm2020/lib/tokens/include-localization-resources.token.mjs +2 -2
  15. package/esm2020/lib/tokens/index.mjs +3 -1
  16. package/esm2020/lib/tokens/queue.token.mjs +3 -0
  17. package/esm2020/lib/utils/index.mjs +2 -1
  18. package/esm2020/lib/utils/queue.mjs +41 -0
  19. package/esm2020/public-api.mjs +2 -1
  20. package/fesm2015/abp-ng.core.mjs +91 -8
  21. package/fesm2015/abp-ng.core.mjs.map +1 -1
  22. package/fesm2020/abp-ng.core.mjs +90 -7
  23. package/fesm2020/abp-ng.core.mjs.map +1 -1
  24. package/lib/clients/http.client.d.ts +11 -0
  25. package/lib/clients/index.d.ts +1 -0
  26. package/lib/directives/permission.directive.d.ts +4 -2
  27. package/lib/providers/include-localization-resources.provider.d.ts +1 -1
  28. package/lib/proxy/volo/abp/http/modeling/models.d.ts +1 -1
  29. package/lib/proxy/volo/abp/localization/models.d.ts +1 -0
  30. package/lib/tokens/http-context.token.d.ts +2 -0
  31. package/lib/tokens/include-localization-resources.token.d.ts +1 -1
  32. package/lib/tokens/index.d.ts +2 -0
  33. package/lib/tokens/queue.token.d.ts +3 -0
  34. package/lib/utils/index.d.ts +1 -0
  35. package/lib/utils/queue.d.ts +14 -0
  36. package/package.json +2 -2
  37. package/public-api.d.ts +1 -0
@@ -5,9 +5,9 @@ import * as i1$1 from '@angular/router';
5
5
  import { PRIMARY_OUTLET, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, ActivatedRoute, Router, RouterModule } from '@angular/router';
6
6
  import { map, distinctUntilChanged, filter, catchError, switchMap, take, tap, debounceTime, mapTo, takeUntil, retryWhen, delay, shareReplay, finalize } from 'rxjs/operators';
7
7
  import compare from 'just-compare';
8
- import { __rest, __awaiter } from 'tslib';
8
+ import { __rest, __awaiter, __classPrivateFieldGet } from 'tslib';
9
9
  import * as i1 from '@angular/common/http';
10
- import { HttpParams, HttpClient, HttpClientModule, HttpClientXsrfModule } from '@angular/common/http';
10
+ import { HttpParams, HttpClient, HttpClientModule, HttpClientXsrfModule, HttpContextToken, HttpContext } from '@angular/common/http';
11
11
  import * as i5 from '@angular/common';
12
12
  import { registerLocaleData, DOCUMENT, DatePipe, DATE_PIPE_DEFAULT_TIMEZONE, CommonModule } from '@angular/common';
13
13
  import * as i1$2 from '@angular/forms';
@@ -1124,7 +1124,7 @@ class LocalizationService {
1124
1124
  listenToSetLanguage() {
1125
1125
  this.sessionState
1126
1126
  .onLanguageChange$()
1127
- .pipe(filter(lang => this.configState.getDeep('localization.currentCulture.cultureName') !== lang), switchMap(lang => this.configState.refreshLocalization(lang).pipe(map(() => lang))), switchMap(lang => from(this.registerLocale(lang).then(() => lang))))
1127
+ .pipe(filter(lang => this.configState.getDeep('localization.currentCulture.cultureName') !== lang), switchMap(lang => this.configState.refreshAppState().pipe(map(() => lang))), switchMap(lang => from(this.registerLocale(lang).then(() => lang))))
1128
1128
  .subscribe(lang => this._languageChange$.next(lang));
1129
1129
  }
1130
1130
  registerLocale(locale) {
@@ -2093,12 +2093,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
2093
2093
  args: ['abpInit']
2094
2094
  }] } });
2095
2095
 
2096
+ const QUEUE_MANAGER = new InjectionToken("QUEUE_MANAGER");
2097
+
2096
2098
  class PermissionDirective {
2097
- constructor(templateRef, vcRef, permissionService, cdRef) {
2099
+ constructor(templateRef, vcRef, permissionService, cdRef, queue) {
2098
2100
  this.templateRef = templateRef;
2099
2101
  this.vcRef = vcRef;
2100
2102
  this.permissionService = permissionService;
2101
2103
  this.cdRef = cdRef;
2104
+ this.queue = queue;
2102
2105
  this.runChangeDetection = true;
2103
2106
  this.cdrSubject = new ReplaySubject();
2104
2107
  this.rendered = false;
@@ -2135,11 +2138,11 @@ class PermissionDirective {
2135
2138
  this.check();
2136
2139
  }
2137
2140
  ngAfterViewInit() {
2138
- this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
2141
+ this.cdrSubject.pipe(take(1)).subscribe(() => this.queue.add(() => this.cdRef.detectChanges()));
2139
2142
  this.rendered = true;
2140
2143
  }
2141
2144
  }
2142
- PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: PermissionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2145
+ PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: PermissionService }, { token: i0.ChangeDetectorRef }, { token: QUEUE_MANAGER }], target: i0.ɵɵFactoryTarget.Directive });
2143
2146
  PermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: PermissionDirective, selector: "[abpPermission]", inputs: { condition: ["abpPermission", "condition"], runChangeDetection: ["abpPermissionRunChangeDetection", "runChangeDetection"] }, usesOnChanges: true, ngImport: i0 });
2144
2147
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, decorators: [{
2145
2148
  type: Directive,
@@ -2149,7 +2152,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
2149
2152
  }], ctorParameters: function () {
2150
2153
  return [{ type: i0.TemplateRef, decorators: [{
2151
2154
  type: Optional
2152
- }] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }];
2155
+ }] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
2156
+ type: Inject,
2157
+ args: [QUEUE_MANAGER]
2158
+ }] }];
2153
2159
  }, propDecorators: { condition: [{
2154
2160
  type: Input,
2155
2161
  args: ['abpPermission']
@@ -2947,6 +2953,47 @@ function clearCallbacks(element) {
2947
2953
  element.onsuspend = null;
2948
2954
  }
2949
2955
 
2956
+ class DefaultQueueManager {
2957
+ constructor() {
2958
+ this.queue = [];
2959
+ this.isRunning = false;
2960
+ this.stack = 0;
2961
+ this.interval = 0;
2962
+ this.stackSize = 100;
2963
+ }
2964
+ init(interval, stackSize) {
2965
+ this.interval = interval;
2966
+ this.stackSize = stackSize;
2967
+ }
2968
+ add(fn) {
2969
+ this.queue.push(fn);
2970
+ this.run();
2971
+ }
2972
+ run() {
2973
+ if (this.isRunning)
2974
+ return;
2975
+ this.stack++;
2976
+ this.isRunning = true;
2977
+ const fn = this.queue.shift();
2978
+ if (!fn) {
2979
+ this.isRunning = false;
2980
+ return;
2981
+ }
2982
+ fn();
2983
+ if (this.stack > this.stackSize) {
2984
+ setTimeout(() => {
2985
+ this.isRunning = false;
2986
+ this.run();
2987
+ this.stack = 0;
2988
+ }, this.interval);
2989
+ }
2990
+ else {
2991
+ this.isRunning = false;
2992
+ this.run();
2993
+ }
2994
+ }
2995
+ }
2996
+
2950
2997
  class DomInsertionService {
2951
2998
  constructor() {
2952
2999
  this.inserted = new Set();
@@ -3566,6 +3613,10 @@ class CoreModule {
3566
3613
  useValue: localizationContributor(options.localizations),
3567
3614
  deps: [LocalizationService],
3568
3615
  },
3616
+ {
3617
+ provide: QUEUE_MANAGER,
3618
+ useClass: DefaultQueueManager,
3619
+ },
3569
3620
  IncludeLocalizationResourcesProvider,
3570
3621
  ],
3571
3622
  };
@@ -4053,6 +4104,8 @@ const PIPE_TO_LOGIN_FN_KEY = new InjectionToken('PIPE_TO_LOGIN_FN_KEY');
4053
4104
 
4054
4105
  const SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY = new InjectionToken('SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY');
4055
4106
 
4107
+ const IS_EXTERNAL_REQUEST = new HttpContextToken(() => false);
4108
+
4056
4109
  function validateMinAge({ age = 18 } = {}) {
4057
4110
  return (control) => {
4058
4111
  if (['', null, undefined].indexOf(control.value) > -1)
@@ -4194,11 +4247,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
4194
4247
  }]
4195
4248
  }], ctorParameters: function () { return [{ type: HttpWaitService }]; } });
4196
4249
 
4250
+ var _ExternalHttpClient_instances, _ExternalHttpClient_setPlaceholderContext;
4251
+ // source : https://github.com/armanozak/demo-angular-server-specific-interceptors
4252
+ class ExternalHttpClient extends HttpClient {
4253
+ constructor() {
4254
+ super(...arguments);
4255
+ _ExternalHttpClient_instances.add(this);
4256
+ }
4257
+ request(first, url, options = {}) {
4258
+ if (typeof first === 'string') {
4259
+ __classPrivateFieldGet(this, _ExternalHttpClient_instances, "m", _ExternalHttpClient_setPlaceholderContext).call(this, options);
4260
+ return super.request(first, url, options);
4261
+ }
4262
+ __classPrivateFieldGet(this, _ExternalHttpClient_instances, "m", _ExternalHttpClient_setPlaceholderContext).call(this, first);
4263
+ return super.request(first);
4264
+ }
4265
+ }
4266
+ _ExternalHttpClient_instances = new WeakSet(), _ExternalHttpClient_setPlaceholderContext = function _ExternalHttpClient_setPlaceholderContext(optionsOrRequest) {
4267
+ var _a;
4268
+ (_a = optionsOrRequest.context) !== null && _a !== void 0 ? _a : (optionsOrRequest.context = new HttpContext());
4269
+ optionsOrRequest.context.set(IS_EXTERNAL_REQUEST, true);
4270
+ };
4271
+ ExternalHttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExternalHttpClient, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
4272
+ ExternalHttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExternalHttpClient, providedIn: 'root' });
4273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExternalHttpClient, decorators: [{
4274
+ type: Injectable,
4275
+ args: [{
4276
+ providedIn: 'root',
4277
+ }]
4278
+ }] });
4279
+
4197
4280
  // export * from './lib/handlers';
4198
4281
 
4199
4282
  /**
4200
4283
  * Generated bundle index. Do not edit.
4201
4284
  */
4202
4285
 
4203
- export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpTenantService, AbpValidators, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AuditedEntityDto, AuditedEntityWithUserDto, AuthGuard, AuthService, AutofocusDirective, BaseCoreModule, BaseTreeNode, CHECK_AUTHENTICATION_STATE_FN_KEY, CONTAINER_STRATEGY, CONTENT_SECURITY_STRATEGY, CONTENT_STRATEGY, CONTEXT_STRATEGY, COOKIE_LANGUAGE_KEY, CORE_OPTIONS, CROSS_ORIGIN_STRATEGY, ClearContainerStrategy, ComponentContextStrategy, ComponentProjectionStrategy, ConfigStateService, ContainerStrategy, ContentProjectionService, ContentSecurityStrategy, ContentStrategy, ContextStrategy, CoreModule, CreationAuditedEntityDto, CreationAuditedEntityWithUserDto, CrossOriginStrategy, DOM_STRATEGY, DomInsertionService, DomStrategy, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleObject, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HttpErrorReporterService, HttpWaitService, INCUDE_LOCALIZATION_RESOURCES_TOKEN, INJECTOR_PIPE_DATA_TOKEN, InitDirective, InputEventDebounceDirective, InsertIntoContainerStrategy, InternalStore, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, LOADING_STRATEGY, LOCALIZATIONS, LazyLoadService, LazyModuleFactory, LimitedResultRequestDto, ListResultDto, ListService, LoadingStrategy, LocalizationModule, LocalizationPipe, LocalizationService, LooseContentSecurityStrategy, MultiTenancyService, NAVIGATE_TO_MANAGE_PROFILE, NavigationEvent, NoContentSecurityStrategy, NoContextStrategy, NoCrossOriginStrategy, index as ObjectExtending, PIPE_TO_LOGIN_FN_KEY, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TemplateContextStrategy, TemplateProjectionStrategy, ToInjectorPipe, TrackByService, WebHttpUrlEncodingCodec, coreOptionsFactory, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, getInitialData, getLocaleDirection, getPathName, getRemoteEnv, getRoutePath, getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat, interpolate, isArray, isNode, isNullOrEmpty, isNullOrUndefined, isNumber, isObject, isObjectAndNotArray, isObjectAndNotArrayNotNode, isUndefinedOrEmptyString, localeInitializer, localizationContributor, localizations$, mapEnumToOptions, noop, parseTenantFromUrl, pushValueTo, reloadRoute, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUrl };
4286
+ export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpTenantService, AbpValidators, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AuditedEntityDto, AuditedEntityWithUserDto, AuthGuard, AuthService, AutofocusDirective, BaseCoreModule, BaseTreeNode, CHECK_AUTHENTICATION_STATE_FN_KEY, CONTAINER_STRATEGY, CONTENT_SECURITY_STRATEGY, CONTENT_STRATEGY, CONTEXT_STRATEGY, COOKIE_LANGUAGE_KEY, CORE_OPTIONS, CROSS_ORIGIN_STRATEGY, ClearContainerStrategy, ComponentContextStrategy, ComponentProjectionStrategy, ConfigStateService, ContainerStrategy, ContentProjectionService, ContentSecurityStrategy, ContentStrategy, ContextStrategy, CoreModule, CreationAuditedEntityDto, CreationAuditedEntityWithUserDto, CrossOriginStrategy, DOM_STRATEGY, DefaultQueueManager, DomInsertionService, DomStrategy, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleObject, ExternalHttpClient, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HttpErrorReporterService, HttpWaitService, INCUDE_LOCALIZATION_RESOURCES_TOKEN, INJECTOR_PIPE_DATA_TOKEN, IS_EXTERNAL_REQUEST, InitDirective, InputEventDebounceDirective, InsertIntoContainerStrategy, InternalStore, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, LOADING_STRATEGY, LOCALIZATIONS, LazyLoadService, LazyModuleFactory, LimitedResultRequestDto, ListResultDto, ListService, LoadingStrategy, LocalizationModule, LocalizationPipe, LocalizationService, LooseContentSecurityStrategy, MultiTenancyService, NAVIGATE_TO_MANAGE_PROFILE, NavigationEvent, NoContentSecurityStrategy, NoContextStrategy, NoCrossOriginStrategy, index as ObjectExtending, PIPE_TO_LOGIN_FN_KEY, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, QUEUE_MANAGER, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TemplateContextStrategy, TemplateProjectionStrategy, ToInjectorPipe, TrackByService, WebHttpUrlEncodingCodec, coreOptionsFactory, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, getInitialData, getLocaleDirection, getPathName, getRemoteEnv, getRoutePath, getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat, interpolate, isArray, isNode, isNullOrEmpty, isNullOrUndefined, isNumber, isObject, isObjectAndNotArray, isObjectAndNotArrayNotNode, isUndefinedOrEmptyString, localeInitializer, localizationContributor, localizations$, mapEnumToOptions, noop, parseTenantFromUrl, pushValueTo, reloadRoute, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUrl };
4204
4287
  //# sourceMappingURL=abp-ng.core.mjs.map