@abp/ng.core 7.1.0-rc.2 → 7.1.0

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.
@@ -1,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ChangeDetectorRef, Component, Input, Injectable, InjectionToken, Inject, isDevMode, Optional, SkipSelf, Directive, EventEmitter, Output, Self, Injector, Pipe, NgModule, APP_INITIALIZER, LOCALE_ID, NgModuleFactory, Compiler, ComponentFactoryResolver, ApplicationRef } from '@angular/core';
2
+ import { ChangeDetectorRef, Component, Input, Injectable, InjectionToken, Inject, inject, isDevMode, Optional, SkipSelf, Directive, EventEmitter, Output, Self, Injector, Pipe, NgModule, APP_INITIALIZER, LOCALE_ID, NgModuleFactory, Compiler, ComponentFactoryResolver, ApplicationRef } from '@angular/core';
3
3
  import { of, BehaviorSubject, Subject, throwError, Subscription, combineLatest, from, fromEvent, ReplaySubject, lastValueFrom, Observable, timer, pipe, concat } from 'rxjs';
4
4
  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, delay, retryWhen, shareReplay, finalize } from 'rxjs/operators';
7
- import compare from 'just-compare';
8
7
  import { __rest, __awaiter, __classPrivateFieldGet } from 'tslib';
9
8
  import * as i1 from '@angular/common/http';
10
9
  import { HttpParams, HttpClient, HttpClientModule, HttpClientXsrfModule, HttpContextToken, HttpHeaders, HttpContext } from '@angular/common/http';
10
+ import compare from 'just-compare';
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';
@@ -90,7 +90,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
90
90
  * Abstract service for Authentication.
91
91
  */
92
92
  class AuthService {
93
- constructor() { }
94
93
  warningMessage() {
95
94
  console.error('You should add @abp/ng-oauth packages or create your own auth packages.');
96
95
  }
@@ -115,6 +114,10 @@ class AuthService {
115
114
  this.warningMessage();
116
115
  return false;
117
116
  }
117
+ loginUsingGrant(grantType, parameters, headers) {
118
+ console.log({ grantType, parameters, headers });
119
+ return Promise.reject(new Error('not implemented'));
120
+ }
118
121
  }
119
122
  AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
120
123
  AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AuthService, providedIn: 'root' });
@@ -123,7 +126,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
123
126
  args: [{
124
127
  providedIn: 'root',
125
128
  }]
126
- }], ctorParameters: function () { return []; } });
129
+ }] });
127
130
 
128
131
  function pushValueTo(array) {
129
132
  return (element) => {
@@ -186,7 +189,11 @@ function createTreeNodeFilterCreator(key, mapperFn) {
186
189
  };
187
190
  }
188
191
 
189
- const INCUDE_LOCALIZATION_RESOURCES_TOKEN = new InjectionToken('INCUDE_LOCALIZATION_RESOURCES_TOKEN');
192
+ const CORE_OPTIONS = new InjectionToken('CORE_OPTIONS');
193
+ function coreOptionsFactory(_a) {
194
+ var options = __rest(_a, []);
195
+ return Object.assign({}, options);
196
+ }
190
197
 
191
198
  function noop() {
192
199
  const fn = function () { };
@@ -292,12 +299,6 @@ class InternalStore {
292
299
  }
293
300
  }
294
301
 
295
- const CORE_OPTIONS = new InjectionToken('CORE_OPTIONS');
296
- function coreOptionsFactory(_a) {
297
- var options = __rest(_a, []);
298
- return Object.assign({}, options);
299
- }
300
-
301
302
  const mapToApiUrl = (key) => (apis) => ((key && apis[key]) || apis.default).url || apis.default.url;
302
303
  const mapToIssuer = (issuer) => {
303
304
  if (!issuer) {
@@ -467,12 +468,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
467
468
  }]
468
469
  }], ctorParameters: function () { return [{ type: RestService }]; } });
469
470
 
471
+ const INCUDE_LOCALIZATION_RESOURCES_TOKEN = new InjectionToken('INCUDE_LOCALIZATION_RESOURCES_TOKEN');
472
+
470
473
  class ConfigStateService {
471
- constructor(abpConfigService, abpApplicationLocalizationService, includeLocalizationResources) {
472
- this.abpConfigService = abpConfigService;
473
- this.abpApplicationLocalizationService = abpApplicationLocalizationService;
474
- this.includeLocalizationResources = includeLocalizationResources;
474
+ constructor() {
475
475
  this.store = new InternalStore({});
476
+ this.includeLocalizationResources = inject(INCUDE_LOCALIZATION_RESOURCES_TOKEN);
477
+ this.abpConfigService = inject(AbpApplicationConfigurationService);
478
+ this.abpApplicationLocalizationService = inject(AbpApplicationLocalizationService);
476
479
  this.updateSubject = new Subject();
477
480
  this.initUpdateStream();
478
481
  }
@@ -615,19 +618,14 @@ class ConfigStateService {
615
618
  return this.store.sliceState(state => this.isGlobalFeatureEnabled(key, state.globalFeatures));
616
619
  }
617
620
  }
618
- ConfigStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ConfigStateService, deps: [{ token: AbpApplicationConfigurationService }, { token: AbpApplicationLocalizationService }, { token: INCUDE_LOCALIZATION_RESOURCES_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
621
+ ConfigStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ConfigStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
619
622
  ConfigStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ConfigStateService, providedIn: 'root' });
620
623
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ConfigStateService, decorators: [{
621
624
  type: Injectable,
622
625
  args: [{
623
626
  providedIn: 'root',
624
627
  }]
625
- }], ctorParameters: function () {
626
- return [{ type: AbpApplicationConfigurationService }, { type: AbpApplicationLocalizationService }, { type: undefined, decorators: [{
627
- type: Inject,
628
- args: [INCUDE_LOCALIZATION_RESOURCES_TOKEN]
629
- }] }];
630
- } });
628
+ }], ctorParameters: function () { return []; } });
631
629
  function splitKeys(keys) {
632
630
  if (typeof keys === 'string') {
633
631
  keys = keys.split('.');
@@ -989,18 +987,49 @@ function escapeHtmlChars(value) {
989
987
  : value;
990
988
  }
991
989
 
990
+ class AbpLocalStorageService {
991
+ constructor() { }
992
+ get length() {
993
+ return localStorage.length;
994
+ }
995
+ clear() {
996
+ localStorage.clear();
997
+ }
998
+ getItem(key) {
999
+ return localStorage.getItem(key);
1000
+ }
1001
+ key(index) {
1002
+ return localStorage.key(index);
1003
+ }
1004
+ removeItem(key) {
1005
+ localStorage.removeItem(key);
1006
+ }
1007
+ setItem(key, value) {
1008
+ localStorage.setItem(key, value);
1009
+ }
1010
+ }
1011
+ AbpLocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbpLocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1012
+ AbpLocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbpLocalStorageService, providedIn: 'root' });
1013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AbpLocalStorageService, decorators: [{
1014
+ type: Injectable,
1015
+ args: [{
1016
+ providedIn: 'root',
1017
+ }]
1018
+ }], ctorParameters: function () { return []; } });
1019
+
992
1020
  class SessionStateService {
993
- constructor(configState) {
1021
+ constructor(configState, localStorageService) {
994
1022
  this.configState = configState;
1023
+ this.localStorageService = localStorageService;
995
1024
  this.store = new InternalStore({});
996
1025
  this.updateLocalStorage = () => {
997
- localStorage.setItem('abpSession', JSON.stringify(this.store.state));
1026
+ this.localStorageService.setItem('abpSession', JSON.stringify(this.store.state));
998
1027
  };
999
1028
  this.init();
1000
1029
  this.setInitialLanguage();
1001
1030
  }
1002
1031
  init() {
1003
- const session = localStorage.getItem('abpSession');
1032
+ const session = this.localStorageService.getItem('abpSession');
1004
1033
  if (session) {
1005
1034
  this.store.set(JSON.parse(session));
1006
1035
  }
@@ -1050,14 +1079,14 @@ class SessionStateService {
1050
1079
  document.documentElement.setAttribute('lang', language);
1051
1080
  }
1052
1081
  }
1053
- SessionStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SessionStateService, deps: [{ token: ConfigStateService }], target: i0.ɵɵFactoryTarget.Injectable });
1082
+ SessionStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SessionStateService, deps: [{ token: ConfigStateService }, { token: AbpLocalStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1054
1083
  SessionStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SessionStateService, providedIn: 'root' });
1055
1084
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SessionStateService, decorators: [{
1056
1085
  type: Injectable,
1057
1086
  args: [{
1058
1087
  providedIn: 'root',
1059
1088
  }]
1060
- }], ctorParameters: function () { return [{ type: ConfigStateService }]; } });
1089
+ }], ctorParameters: function () { return [{ type: ConfigStateService }, { type: AbpLocalStorageService }]; } });
1061
1090
 
1062
1091
  class LocalizationService {
1063
1092
  constructor(sessionState, injector, otherInstance, configState) {
@@ -4336,5 +4365,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
4336
4365
  * Generated bundle index. Do not edit.
4337
4366
  */
4338
4367
 
4339
- 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, checkHasProp, 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 };
4368
+ export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpLocalStorageService, 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, checkHasProp, 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 };
4340
4369
  //# sourceMappingURL=abp-ng.core.mjs.map