@abp/ng.core 6.0.2 → 6.0.3

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.
@@ -1948,12 +1948,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
1948
1948
  args: ['abpInit']
1949
1949
  }] } });
1950
1950
 
1951
+ const QUEUE_MANAGER = new InjectionToken("QUEUE_MANAGER");
1952
+
1951
1953
  class PermissionDirective {
1952
- constructor(templateRef, vcRef, permissionService, cdRef) {
1954
+ constructor(templateRef, vcRef, permissionService, cdRef, queue) {
1953
1955
  this.templateRef = templateRef;
1954
1956
  this.vcRef = vcRef;
1955
1957
  this.permissionService = permissionService;
1956
1958
  this.cdRef = cdRef;
1959
+ this.queue = queue;
1957
1960
  this.runChangeDetection = true;
1958
1961
  this.cdrSubject = new ReplaySubject();
1959
1962
  this.rendered = false;
@@ -1990,11 +1993,11 @@ class PermissionDirective {
1990
1993
  this.check();
1991
1994
  }
1992
1995
  ngAfterViewInit() {
1993
- this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
1996
+ this.cdrSubject.pipe(take(1)).subscribe(() => this.queue.add(() => this.cdRef.detectChanges()));
1994
1997
  this.rendered = true;
1995
1998
  }
1996
1999
  }
1997
- PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: PermissionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2000
+ PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", 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 });
1998
2001
  PermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.1", type: PermissionDirective, selector: "[abpPermission]", inputs: { condition: ["abpPermission", "condition"], runChangeDetection: ["abpPermissionRunChangeDetection", "runChangeDetection"] }, usesOnChanges: true, ngImport: i0 });
1999
2002
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PermissionDirective, decorators: [{
2000
2003
  type: Directive,
@@ -2003,7 +2006,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
2003
2006
  }]
2004
2007
  }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
2005
2008
  type: Optional
2006
- }] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { condition: [{
2009
+ }] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
2010
+ type: Inject,
2011
+ args: [QUEUE_MANAGER]
2012
+ }] }]; }, propDecorators: { condition: [{
2007
2013
  type: Input,
2008
2014
  args: ['abpPermission']
2009
2015
  }], runChangeDetection: [{
@@ -3192,6 +3198,47 @@ function clearCallbacks(element) {
3192
3198
  element.onsuspend = null;
3193
3199
  }
3194
3200
 
3201
+ class DefaultQueueManager {
3202
+ constructor() {
3203
+ this.queue = [];
3204
+ this.isRunning = false;
3205
+ this.stack = 0;
3206
+ this.interval = 0;
3207
+ this.stackSize = 100;
3208
+ }
3209
+ init(interval, stackSize) {
3210
+ this.interval = interval;
3211
+ this.stackSize = stackSize;
3212
+ }
3213
+ add(fn) {
3214
+ this.queue.push(fn);
3215
+ this.run();
3216
+ }
3217
+ run() {
3218
+ if (this.isRunning)
3219
+ return;
3220
+ this.stack++;
3221
+ this.isRunning = true;
3222
+ const fn = this.queue.shift();
3223
+ if (!fn) {
3224
+ this.isRunning = false;
3225
+ return;
3226
+ }
3227
+ fn();
3228
+ if (this.stack > this.stackSize) {
3229
+ setTimeout(() => {
3230
+ this.isRunning = false;
3231
+ this.run();
3232
+ this.stack = 0;
3233
+ }, this.interval);
3234
+ }
3235
+ else {
3236
+ this.isRunning = false;
3237
+ this.run();
3238
+ }
3239
+ }
3240
+ }
3241
+
3195
3242
  class DomInsertionService {
3196
3243
  constructor() {
3197
3244
  this.inserted = new Set();
@@ -3769,6 +3816,10 @@ class CoreModule {
3769
3816
  useValue: localizationContributor(options.localizations),
3770
3817
  deps: [LocalizationService],
3771
3818
  },
3819
+ {
3820
+ provide: QUEUE_MANAGER,
3821
+ useClass: DefaultQueueManager,
3822
+ },
3772
3823
  ],
3773
3824
  };
3774
3825
  }
@@ -4408,5 +4459,5 @@ const AbpValidators = {
4408
4459
  * Generated bundle index. Do not edit.
4409
4460
  */
4410
4461
 
4411
- export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpTenantService, AbpValidators, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AuditedEntityDto, AuditedEntityWithUserDto, AuthGuard, AuthService, AutofocusDirective, BaseCoreModule, BaseTreeNode, 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, 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, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TemplateContextStrategy, TemplateProjectionStrategy, TimeoutLimitedOAuthService, ToInjectorPipe, TrackByService, WebHttpUrlEncodingCodec, checkAccessToken, 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, pipeToLogin, pushValueTo, reloadRoute, removeRememberMe, setRememberMe, setTokenResponseToStorage, storageFactory, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUrl };
4462
+ export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpTenantService, AbpValidators, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AuditedEntityDto, AuditedEntityWithUserDto, AuthGuard, AuthService, AutofocusDirective, BaseCoreModule, BaseTreeNode, 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, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HttpErrorReporterService, HttpWaitService, 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, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, QUEUE_MANAGER, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TemplateContextStrategy, TemplateProjectionStrategy, TimeoutLimitedOAuthService, ToInjectorPipe, TrackByService, WebHttpUrlEncodingCodec, checkAccessToken, 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, pipeToLogin, pushValueTo, reloadRoute, removeRememberMe, setRememberMe, setTokenResponseToStorage, storageFactory, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUrl };
4412
4463
  //# sourceMappingURL=abp-ng.core.mjs.map