@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.
- package/VIModule.d.ts +3 -3
- package/bottomSheet/BottomSheetService.d.ts +2 -1
- package/esm2020/VIModule.mjs +6 -6
- package/esm2020/bottomSheet/BottomSheetService.mjs +1 -1
- package/esm2020/login/LoginTokenStorage.mjs +5 -27
- package/esm2020/public-api.mjs +3 -2
- package/esm2020/storage/LocalStorageService.mjs +57 -0
- package/esm2020/storage/ValueStorage.mjs +44 -0
- package/esm2020/window/WindowService.mjs +1 -1
- package/fesm2015/ts-core-angular.mjs +35 -14
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +35 -14
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/login/LoginTokenStorage.d.ts +4 -9
- package/package.json +1 -1
- package/public-api.d.ts +2 -1
- package/storage/{StorageService.d.ts → LocalStorageService.d.ts} +1 -1
- package/storage/ValueStorage.d.ts +13 -0
- package/window/WindowService.d.ts +1 -1
- package/esm2020/storage/StorageService.mjs +0 -57
|
@@ -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
|
|
3345
|
+
class ValueStorage extends DestroyableContainer {
|
|
3346
3346
|
//--------------------------------------------------------------------------
|
|
3347
3347
|
//
|
|
3348
3348
|
// Constructor
|
|
3349
3349
|
//
|
|
3350
3350
|
//--------------------------------------------------------------------------
|
|
3351
|
-
constructor(
|
|
3351
|
+
constructor(localStorage, cookies, name) {
|
|
3352
3352
|
super();
|
|
3353
|
-
this.
|
|
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
|
-
|
|
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.
|
|
3366
|
-
this.
|
|
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
|
|
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:
|
|
6681
|
-
{ provide: LoginTokenStorage, deps: [
|
|
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
|
|
6764
|
-
return new
|
|
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,
|
|
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
|