@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.
@@ -519,7 +519,7 @@ class ViewUtil {
519
519
  //
520
520
  // --------------------------------------------------------------------------
521
521
  static addClass(container, name) {
522
- if (_.isNil(name)) {
522
+ if (_.isEmpty(name)) {
523
523
  return;
524
524
  }
525
525
  container = ViewUtil.parseElement(container);
@@ -534,7 +534,7 @@ class ViewUtil {
534
534
  names.split(' ').forEach(name => ViewUtil.addClass(container, name));
535
535
  }
536
536
  static removeClass(container, name) {
537
- if (_.isNil(name)) {
537
+ if (_.isEmpty(name)) {
538
538
  return;
539
539
  }
540
540
  container = ViewUtil.parseElement(container);
@@ -6265,6 +6265,61 @@ var NotificationServiceEvent;
6265
6265
  class BottomSheetService extends Destroyable {
6266
6266
  }
6267
6267
 
6268
+ class StorageService extends DestroyableContainer {
6269
+ //--------------------------------------------------------------------------
6270
+ //
6271
+ // Constructor
6272
+ //
6273
+ //--------------------------------------------------------------------------
6274
+ constructor(nativeWindow) {
6275
+ super();
6276
+ this.nativeWindow = nativeWindow;
6277
+ }
6278
+ //--------------------------------------------------------------------------
6279
+ //
6280
+ // Public Methods
6281
+ //
6282
+ //--------------------------------------------------------------------------
6283
+ get(key, defaultValue) {
6284
+ return this.has(key) ? this.storage.get(key) : defaultValue;
6285
+ }
6286
+ has(key) {
6287
+ return !_.isNil(this.storage.getItem(key));
6288
+ }
6289
+ set(key, value) {
6290
+ if (!_.isNil(value)) {
6291
+ this.storage.setItem(key, value);
6292
+ }
6293
+ else {
6294
+ this.remove(key);
6295
+ }
6296
+ }
6297
+ remove(key) {
6298
+ this.storage.removeItem(key);
6299
+ }
6300
+ clear() {
6301
+ this.storage.clear();
6302
+ }
6303
+ destroy() {
6304
+ if (this.isDestroyed) {
6305
+ return;
6306
+ }
6307
+ super.destroy();
6308
+ this.nativeWindow = null;
6309
+ }
6310
+ //--------------------------------------------------------------------------
6311
+ //
6312
+ // Protected Properties
6313
+ //
6314
+ //--------------------------------------------------------------------------
6315
+ get length() {
6316
+ return this.storage.length;
6317
+ }
6318
+ get storage() {
6319
+ return this.nativeWindow.window.localStorage;
6320
+ }
6321
+ }
6322
+
6268
6323
  class LazyModuleLoader extends Loadable {
6269
6324
  //--------------------------------------------------------------------------
6270
6325
  //
@@ -6531,6 +6586,7 @@ class VIModule {
6531
6586
  { provide: VI_ANGULAR_OPTIONS, useValue: options || {} },
6532
6587
  { provide: Logger, deps: [VI_ANGULAR_OPTIONS], useFactory: loggerServiceFactory },
6533
6588
  { provide: NativeWindowService, deps: [DOCUMENT], useFactory: nativeWindowServiceFactory },
6589
+ { provide: StorageService, deps: [NativeWindowService], useFactory: storageServiceFactory },
6534
6590
  ...CookieModule.forRoot(options).providers,
6535
6591
  ...ThemeModule.forRoot(options ? options.themeOptions : null).providers,
6536
6592
  ...LanguageModule.forRoot(options ? options.languageOptions : null).providers
@@ -6612,6 +6668,9 @@ function loggerServiceFactory(options) {
6612
6668
  function nativeWindowServiceFactory(document) {
6613
6669
  return new NativeWindowService(document);
6614
6670
  }
6671
+ function storageServiceFactory(nativeWindow) {
6672
+ return new StorageService(nativeWindow);
6673
+ }
6615
6674
  const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6616
6675
 
6617
6676
  //
@@ -6620,5 +6679,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6620
6679
  * Generated bundle index. Do not edit.
6621
6680
  */
6622
6681
 
6623
- 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 };
6682
+ 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 };
6624
6683
  //# sourceMappingURL=ts-core-angular.mjs.map