@ts-core/angular 15.0.27 → 15.0.28

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.
@@ -520,7 +520,7 @@ class ViewUtil {
520
520
  //
521
521
  // --------------------------------------------------------------------------
522
522
  static addClass(container, name) {
523
- if (_.isNil(name)) {
523
+ if (_.isEmpty(name)) {
524
524
  return;
525
525
  }
526
526
  container = ViewUtil.parseElement(container);
@@ -535,7 +535,7 @@ class ViewUtil {
535
535
  names.split(' ').forEach(name => ViewUtil.addClass(container, name));
536
536
  }
537
537
  static removeClass(container, name) {
538
- if (_.isNil(name)) {
538
+ if (_.isEmpty(name)) {
539
539
  return;
540
540
  }
541
541
  container = ViewUtil.parseElement(container);
@@ -6303,6 +6303,61 @@ var NotificationServiceEvent;
6303
6303
  class BottomSheetService extends Destroyable {
6304
6304
  }
6305
6305
 
6306
+ class StorageService extends DestroyableContainer {
6307
+ //--------------------------------------------------------------------------
6308
+ //
6309
+ // Constructor
6310
+ //
6311
+ //--------------------------------------------------------------------------
6312
+ constructor(nativeWindow) {
6313
+ super();
6314
+ this.nativeWindow = nativeWindow;
6315
+ }
6316
+ //--------------------------------------------------------------------------
6317
+ //
6318
+ // Public Methods
6319
+ //
6320
+ //--------------------------------------------------------------------------
6321
+ get(key, defaultValue) {
6322
+ return this.has(key) ? this.storage.get(key) : defaultValue;
6323
+ }
6324
+ has(key) {
6325
+ return !_.isNil(this.storage.getItem(key));
6326
+ }
6327
+ set(key, value) {
6328
+ if (!_.isNil(value)) {
6329
+ this.storage.setItem(key, value);
6330
+ }
6331
+ else {
6332
+ this.remove(key);
6333
+ }
6334
+ }
6335
+ remove(key) {
6336
+ this.storage.removeItem(key);
6337
+ }
6338
+ clear() {
6339
+ this.storage.clear();
6340
+ }
6341
+ destroy() {
6342
+ if (this.isDestroyed) {
6343
+ return;
6344
+ }
6345
+ super.destroy();
6346
+ this.nativeWindow = null;
6347
+ }
6348
+ //--------------------------------------------------------------------------
6349
+ //
6350
+ // Protected Properties
6351
+ //
6352
+ //--------------------------------------------------------------------------
6353
+ get length() {
6354
+ return this.storage.length;
6355
+ }
6356
+ get storage() {
6357
+ return this.nativeWindow.window.localStorage;
6358
+ }
6359
+ }
6360
+
6306
6361
  class LazyModuleLoader extends Loadable {
6307
6362
  //--------------------------------------------------------------------------
6308
6363
  //
@@ -6585,6 +6640,7 @@ class VIModule {
6585
6640
  { provide: VI_ANGULAR_OPTIONS, useValue: options || {} },
6586
6641
  { provide: Logger, deps: [VI_ANGULAR_OPTIONS], useFactory: loggerServiceFactory },
6587
6642
  { provide: NativeWindowService, deps: [DOCUMENT], useFactory: nativeWindowServiceFactory },
6643
+ { provide: StorageService, deps: [NativeWindowService], useFactory: storageServiceFactory },
6588
6644
  ...CookieModule.forRoot(options).providers,
6589
6645
  ...ThemeModule.forRoot(options ? options.themeOptions : null).providers,
6590
6646
  ...LanguageModule.forRoot(options ? options.languageOptions : null).providers
@@ -6666,6 +6722,9 @@ function loggerServiceFactory(options) {
6666
6722
  function nativeWindowServiceFactory(document) {
6667
6723
  return new NativeWindowService(document);
6668
6724
  }
6725
+ function storageServiceFactory(nativeWindow) {
6726
+ return new StorageService(nativeWindow);
6727
+ }
6669
6728
  const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6670
6729
 
6671
6730
  //
@@ -6674,5 +6733,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6674
6733
  * Generated bundle index. Do not edit.
6675
6734
  */
6676
6735
 
6677
- 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, 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, 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, nativeWindowServiceFactory, themeAssetServiceFactory, themeServiceFactory };
6736
+ 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, 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, 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, nativeWindowServiceFactory, storageServiceFactory, themeAssetServiceFactory, themeServiceFactory };
6678
6737
  //# sourceMappingURL=ts-core-angular.mjs.map