@ts-core/angular 15.0.34 → 15.0.36

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.
@@ -3342,36 +3342,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3342
3342
  args: [LoginBaseService]
3343
3343
  }] }]; } });
3344
3344
 
3345
- class LoginTokenStorage extends DestroyableContainer {
3345
+ class ValueStorage extends DestroyableContainer {
3346
3346
  //--------------------------------------------------------------------------
3347
3347
  //
3348
3348
  // Constructor
3349
3349
  //
3350
3350
  //--------------------------------------------------------------------------
3351
- constructor(storage, cookies) {
3351
+ constructor(localStorage, cookies, name) {
3352
3352
  super();
3353
- this.storage = storage;
3353
+ this.localStorage = localStorage;
3354
3354
  this.cookies = cookies;
3355
+ this.name = name;
3355
3356
  }
3356
3357
  //--------------------------------------------------------------------------
3357
3358
  //
3358
3359
  // Public Methods
3359
3360
  //
3360
3361
  //--------------------------------------------------------------------------
3361
- get() {
3362
- return this.storage.has(LoginTokenStorage.TOKEN_KEY) ? this.storage.get(LoginTokenStorage.TOKEN_KEY) : this.cookies.get(LoginTokenStorage.TOKEN_KEY);
3362
+ get(defaultValue) {
3363
+ if (this.localStorage.has(this.name)) {
3364
+ return this.localStorage.get(this.name);
3365
+ }
3366
+ if (this.cookies.has(this.name)) {
3367
+ return this.cookies.get(this.name);
3368
+ }
3369
+ return defaultValue;
3370
+ }
3371
+ has() {
3372
+ return this.localStorage.has(this.name) || this.cookies.has(this.name);
3363
3373
  }
3364
3374
  set(value) {
3365
- this.storage.set(LoginTokenStorage.TOKEN_KEY, value);
3366
- this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
3375
+ this.cookies.put(this.name, value);
3376
+ this.localStorage.set(this.name, value);
3367
3377
  }
3368
3378
  destroy() {
3369
3379
  if (this.isDestroyed) {
3370
3380
  return;
3371
3381
  }
3372
3382
  super.destroy();
3373
- this.storage = null;
3374
3383
  this.cookies = null;
3384
+ this.localStorage = null;
3385
+ }
3386
+ }
3387
+
3388
+ class LoginTokenStorage extends ValueStorage {
3389
+ //--------------------------------------------------------------------------
3390
+ //
3391
+ // Constructor
3392
+ //
3393
+ //--------------------------------------------------------------------------
3394
+ constructor(localStorage, cookies) {
3395
+ super(localStorage, cookies, LoginTokenStorage.TOKEN_KEY);
3375
3396
  }
3376
3397
  }
3377
3398
  //--------------------------------------------------------------------------
@@ -6356,7 +6377,7 @@ var NotificationServiceEvent;
6356
6377
  class BottomSheetService extends Destroyable {
6357
6378
  }
6358
6379
 
6359
- class StorageService extends DestroyableContainer {
6380
+ class LocalStorageService extends DestroyableContainer {
6360
6381
  //--------------------------------------------------------------------------
6361
6382
  //
6362
6383
  // Constructor
@@ -6677,8 +6698,8 @@ class VIModule {
6677
6698
  { provide: VI_ANGULAR_OPTIONS, useValue: options || {} },
6678
6699
  { provide: Logger, deps: [VI_ANGULAR_OPTIONS], useFactory: loggerServiceFactory },
6679
6700
  { provide: NativeWindowService, deps: [DOCUMENT], useFactory: nativeWindowServiceFactory },
6680
- { provide: StorageService, deps: [NativeWindowService], useFactory: storageServiceFactory },
6681
- { provide: LoginTokenStorage, deps: [StorageService, CookieService], useFactory: loginTokenStorageServiceFactory },
6701
+ { provide: LocalStorageService, deps: [NativeWindowService], useFactory: localStorageServiceFactory },
6702
+ { provide: LoginTokenStorage, deps: [LocalStorageService, CookieService], useFactory: loginTokenStorageServiceFactory },
6682
6703
  ...CookieModule.forRoot(options).providers,
6683
6704
  ...ThemeModule.forRoot(options ? options.themeOptions : null).providers,
6684
6705
  ...LanguageModule.forRoot(options ? options.languageOptions : null).providers
@@ -6760,8 +6781,8 @@ function loggerServiceFactory(options) {
6760
6781
  function nativeWindowServiceFactory(document) {
6761
6782
  return new NativeWindowService(document);
6762
6783
  }
6763
- function storageServiceFactory(nativeWindow) {
6764
- return new StorageService(nativeWindow);
6784
+ function localStorageServiceFactory(nativeWindow) {
6785
+ return new LocalStorageService(nativeWindow);
6765
6786
  }
6766
6787
  function loginTokenStorageServiceFactory(storage, cookies) {
6767
6788
  return new LoginTokenStorage(storage, cookies);
@@ -6774,5 +6795,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6774
6795
  * Generated bundle index. Do not edit.
6775
6796
  */
6776
6797
 
6777
- export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, LoginTokenStorage, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, StorageService, StructureDirective, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowConfig, WindowEvent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, loggerServiceFactory, loginTokenStorageServiceFactory, nativeWindowServiceFactory, storageServiceFactory, themeAssetServiceFactory, themeServiceFactory };
6798
+ export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LocalStorageService, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, LoginTokenStorage, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, StructureDirective, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ValueStorage, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowConfig, WindowEvent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, localStorageServiceFactory, loggerServiceFactory, loginTokenStorageServiceFactory, nativeWindowServiceFactory, themeAssetServiceFactory, themeServiceFactory };
6778
6799
  //# sourceMappingURL=ts-core-angular.mjs.map