@abp/ng.core 7.0.0-rc.6 → 7.0.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.
- package/esm2020/lib/core.module.mjs +7 -1
- package/esm2020/lib/directives/permission.directive.mjs +11 -6
- package/esm2020/lib/services/localization.service.mjs +2 -2
- 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 +57 -6
- package/fesm2015/abp-ng.core.mjs.map +1 -1
- package/fesm2020/abp-ng.core.mjs +57 -6
- 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 +2 -2
package/fesm2020/abp-ng.core.mjs
CHANGED
|
@@ -798,7 +798,7 @@ class LocalizationService {
|
|
|
798
798
|
listenToSetLanguage() {
|
|
799
799
|
this.sessionState
|
|
800
800
|
.onLanguageChange$()
|
|
801
|
-
.pipe(filter(lang => this.configState.getDeep('localization.currentCulture.cultureName') !== lang), switchMap(lang => this.configState.
|
|
801
|
+
.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))))
|
|
802
802
|
.subscribe(lang => this._languageChange$.next(lang));
|
|
803
803
|
}
|
|
804
804
|
registerLocale(locale) {
|
|
@@ -2079,12 +2079,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
2079
2079
|
args: ['abpInit']
|
|
2080
2080
|
}] } });
|
|
2081
2081
|
|
|
2082
|
+
const QUEUE_MANAGER = new InjectionToken("QUEUE_MANAGER");
|
|
2083
|
+
|
|
2082
2084
|
class PermissionDirective {
|
|
2083
|
-
constructor(templateRef, vcRef, permissionService, cdRef) {
|
|
2085
|
+
constructor(templateRef, vcRef, permissionService, cdRef, queue) {
|
|
2084
2086
|
this.templateRef = templateRef;
|
|
2085
2087
|
this.vcRef = vcRef;
|
|
2086
2088
|
this.permissionService = permissionService;
|
|
2087
2089
|
this.cdRef = cdRef;
|
|
2090
|
+
this.queue = queue;
|
|
2088
2091
|
this.runChangeDetection = true;
|
|
2089
2092
|
this.cdrSubject = new ReplaySubject();
|
|
2090
2093
|
this.rendered = false;
|
|
@@ -2121,11 +2124,11 @@ class PermissionDirective {
|
|
|
2121
2124
|
this.check();
|
|
2122
2125
|
}
|
|
2123
2126
|
ngAfterViewInit() {
|
|
2124
|
-
this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
|
|
2127
|
+
this.cdrSubject.pipe(take(1)).subscribe(() => this.queue.add(() => this.cdRef.detectChanges()));
|
|
2125
2128
|
this.rendered = true;
|
|
2126
2129
|
}
|
|
2127
2130
|
}
|
|
2128
|
-
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 });
|
|
2131
|
+
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 });
|
|
2129
2132
|
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 });
|
|
2130
2133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, decorators: [{
|
|
2131
2134
|
type: Directive,
|
|
@@ -2134,7 +2137,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
2134
2137
|
}]
|
|
2135
2138
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
2136
2139
|
type: Optional
|
|
2137
|
-
}] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }
|
|
2140
|
+
}] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
2141
|
+
type: Inject,
|
|
2142
|
+
args: [QUEUE_MANAGER]
|
|
2143
|
+
}] }]; }, propDecorators: { condition: [{
|
|
2138
2144
|
type: Input,
|
|
2139
2145
|
args: ['abpPermission']
|
|
2140
2146
|
}], runChangeDetection: [{
|
|
@@ -2931,6 +2937,47 @@ function clearCallbacks(element) {
|
|
|
2931
2937
|
element.onsuspend = null;
|
|
2932
2938
|
}
|
|
2933
2939
|
|
|
2940
|
+
class DefaultQueueManager {
|
|
2941
|
+
constructor() {
|
|
2942
|
+
this.queue = [];
|
|
2943
|
+
this.isRunning = false;
|
|
2944
|
+
this.stack = 0;
|
|
2945
|
+
this.interval = 0;
|
|
2946
|
+
this.stackSize = 100;
|
|
2947
|
+
}
|
|
2948
|
+
init(interval, stackSize) {
|
|
2949
|
+
this.interval = interval;
|
|
2950
|
+
this.stackSize = stackSize;
|
|
2951
|
+
}
|
|
2952
|
+
add(fn) {
|
|
2953
|
+
this.queue.push(fn);
|
|
2954
|
+
this.run();
|
|
2955
|
+
}
|
|
2956
|
+
run() {
|
|
2957
|
+
if (this.isRunning)
|
|
2958
|
+
return;
|
|
2959
|
+
this.stack++;
|
|
2960
|
+
this.isRunning = true;
|
|
2961
|
+
const fn = this.queue.shift();
|
|
2962
|
+
if (!fn) {
|
|
2963
|
+
this.isRunning = false;
|
|
2964
|
+
return;
|
|
2965
|
+
}
|
|
2966
|
+
fn();
|
|
2967
|
+
if (this.stack > this.stackSize) {
|
|
2968
|
+
setTimeout(() => {
|
|
2969
|
+
this.isRunning = false;
|
|
2970
|
+
this.run();
|
|
2971
|
+
this.stack = 0;
|
|
2972
|
+
}, this.interval);
|
|
2973
|
+
}
|
|
2974
|
+
else {
|
|
2975
|
+
this.isRunning = false;
|
|
2976
|
+
this.run();
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2934
2981
|
class DomInsertionService {
|
|
2935
2982
|
constructor() {
|
|
2936
2983
|
this.inserted = new Set();
|
|
@@ -3544,6 +3591,10 @@ class CoreModule {
|
|
|
3544
3591
|
useValue: localizationContributor(options.localizations),
|
|
3545
3592
|
deps: [LocalizationService],
|
|
3546
3593
|
},
|
|
3594
|
+
{
|
|
3595
|
+
provide: QUEUE_MANAGER,
|
|
3596
|
+
useClass: DefaultQueueManager,
|
|
3597
|
+
},
|
|
3547
3598
|
IncludeLocalizationResourcesProvider,
|
|
3548
3599
|
],
|
|
3549
3600
|
};
|
|
@@ -4178,5 +4229,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
4178
4229
|
* Generated bundle index. Do not edit.
|
|
4179
4230
|
*/
|
|
4180
4231
|
|
|
4181
|
-
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 };
|
|
4232
|
+
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, 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, 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 };
|
|
4182
4233
|
//# sourceMappingURL=abp-ng.core.mjs.map
|