@abp/ng.core 6.0.1 → 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.
- package/esm2020/lib/core.module.mjs +7 -1
- package/esm2020/lib/directives/permission.directive.mjs +11 -6
- package/esm2020/lib/services/session-state.service.mjs +5 -4
- package/esm2020/lib/tokens/index.mjs +2 -1
- package/esm2020/lib/tokens/queue.token.mjs +3 -0
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/queue.mjs +41 -0
- package/fesm2015/abp-ng.core.mjs +60 -8
- package/fesm2015/abp-ng.core.mjs.map +1 -1
- package/fesm2020/abp-ng.core.mjs +60 -8
- package/fesm2020/abp-ng.core.mjs.map +1 -1
- package/lib/directives/permission.directive.d.ts +4 -2
- package/lib/tokens/index.d.ts +1 -0
- package/lib/tokens/queue.token.d.ts +3 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/queue.d.ts +14 -0
- package/package.json +3 -3
package/fesm2020/abp-ng.core.mjs
CHANGED
|
@@ -569,8 +569,7 @@ class SessionStateService {
|
|
|
569
569
|
this.store.sliceUpdate(state => state).subscribe(this.updateLocalStorage);
|
|
570
570
|
}
|
|
571
571
|
setInitialLanguage() {
|
|
572
|
-
|
|
573
|
-
return;
|
|
572
|
+
const appLanguage = this.getLanguage();
|
|
574
573
|
this.configState
|
|
575
574
|
.getDeep$('localization.currentCulture.cultureName')
|
|
576
575
|
.pipe(filter(cultureName => !!cultureName), take(1))
|
|
@@ -578,7 +577,9 @@ class SessionStateService {
|
|
|
578
577
|
if (lang.includes(';')) {
|
|
579
578
|
lang = lang.split(';')[0];
|
|
580
579
|
}
|
|
581
|
-
|
|
580
|
+
if (appLanguage !== lang) {
|
|
581
|
+
this.setLanguage(lang);
|
|
582
|
+
}
|
|
582
583
|
});
|
|
583
584
|
}
|
|
584
585
|
onLanguageChange$() {
|
|
@@ -1947,12 +1948,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
1947
1948
|
args: ['abpInit']
|
|
1948
1949
|
}] } });
|
|
1949
1950
|
|
|
1951
|
+
const QUEUE_MANAGER = new InjectionToken("QUEUE_MANAGER");
|
|
1952
|
+
|
|
1950
1953
|
class PermissionDirective {
|
|
1951
|
-
constructor(templateRef, vcRef, permissionService, cdRef) {
|
|
1954
|
+
constructor(templateRef, vcRef, permissionService, cdRef, queue) {
|
|
1952
1955
|
this.templateRef = templateRef;
|
|
1953
1956
|
this.vcRef = vcRef;
|
|
1954
1957
|
this.permissionService = permissionService;
|
|
1955
1958
|
this.cdRef = cdRef;
|
|
1959
|
+
this.queue = queue;
|
|
1956
1960
|
this.runChangeDetection = true;
|
|
1957
1961
|
this.cdrSubject = new ReplaySubject();
|
|
1958
1962
|
this.rendered = false;
|
|
@@ -1989,11 +1993,11 @@ class PermissionDirective {
|
|
|
1989
1993
|
this.check();
|
|
1990
1994
|
}
|
|
1991
1995
|
ngAfterViewInit() {
|
|
1992
|
-
this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
|
|
1996
|
+
this.cdrSubject.pipe(take(1)).subscribe(() => this.queue.add(() => this.cdRef.detectChanges()));
|
|
1993
1997
|
this.rendered = true;
|
|
1994
1998
|
}
|
|
1995
1999
|
}
|
|
1996
|
-
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 });
|
|
1997
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 });
|
|
1998
2002
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PermissionDirective, decorators: [{
|
|
1999
2003
|
type: Directive,
|
|
@@ -2002,7 +2006,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
2002
2006
|
}]
|
|
2003
2007
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
2004
2008
|
type: Optional
|
|
2005
|
-
}] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }
|
|
2009
|
+
}] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
2010
|
+
type: Inject,
|
|
2011
|
+
args: [QUEUE_MANAGER]
|
|
2012
|
+
}] }]; }, propDecorators: { condition: [{
|
|
2006
2013
|
type: Input,
|
|
2007
2014
|
args: ['abpPermission']
|
|
2008
2015
|
}], runChangeDetection: [{
|
|
@@ -3191,6 +3198,47 @@ function clearCallbacks(element) {
|
|
|
3191
3198
|
element.onsuspend = null;
|
|
3192
3199
|
}
|
|
3193
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
|
+
|
|
3194
3242
|
class DomInsertionService {
|
|
3195
3243
|
constructor() {
|
|
3196
3244
|
this.inserted = new Set();
|
|
@@ -3768,6 +3816,10 @@ class CoreModule {
|
|
|
3768
3816
|
useValue: localizationContributor(options.localizations),
|
|
3769
3817
|
deps: [LocalizationService],
|
|
3770
3818
|
},
|
|
3819
|
+
{
|
|
3820
|
+
provide: QUEUE_MANAGER,
|
|
3821
|
+
useClass: DefaultQueueManager,
|
|
3822
|
+
},
|
|
3771
3823
|
],
|
|
3772
3824
|
};
|
|
3773
3825
|
}
|
|
@@ -4407,5 +4459,5 @@ const AbpValidators = {
|
|
|
4407
4459
|
* Generated bundle index. Do not edit.
|
|
4408
4460
|
*/
|
|
4409
4461
|
|
|
4410
|
-
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 };
|
|
4411
4463
|
//# sourceMappingURL=abp-ng.core.mjs.map
|