@ts-core/angular 15.0.31 → 15.0.33

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.
@@ -2004,6 +2004,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2004
2004
  type: Input
2005
2005
  }] } });
2006
2006
 
2007
+ class StructureDirective extends DestroyableContainer {
2008
+ // --------------------------------------------------------------------------
2009
+ //
2010
+ // Constructor
2011
+ //
2012
+ // --------------------------------------------------------------------------
2013
+ constructor(template, container) {
2014
+ super();
2015
+ this.template = template;
2016
+ this.container = container;
2017
+ }
2018
+ commitIsNeedAddProperties() {
2019
+ if (this.isDestroyed) {
2020
+ return;
2021
+ }
2022
+ let isNeedAdd = false;
2023
+ let isNeedRemove = false;
2024
+ if (this.isNeedAdd) {
2025
+ if (_.isNil(this.view)) {
2026
+ isNeedAdd = true;
2027
+ }
2028
+ }
2029
+ else {
2030
+ if (!_.isNil(this.view)) {
2031
+ isNeedRemove = true;
2032
+ }
2033
+ }
2034
+ if (isNeedAdd) {
2035
+ this.view = this.container.createEmbeddedView(this.template);
2036
+ }
2037
+ else if (isNeedRemove) {
2038
+ let index = this.container.indexOf(this.view);
2039
+ if (index >= 0) {
2040
+ this.container.remove(index);
2041
+ this.view = null;
2042
+ }
2043
+ }
2044
+ }
2045
+ // --------------------------------------------------------------------------
2046
+ //
2047
+ // Public Methods
2048
+ //
2049
+ // --------------------------------------------------------------------------
2050
+ destroy() {
2051
+ if (this.isDestroyed) {
2052
+ return;
2053
+ }
2054
+ super.destroy();
2055
+ this.view = null;
2056
+ this.template = null;
2057
+ this.container = null;
2058
+ }
2059
+ //--------------------------------------------------------------------------
2060
+ //
2061
+ // Protected Properties
2062
+ //
2063
+ //--------------------------------------------------------------------------
2064
+ set isNeedAdd(value) {
2065
+ if (value == this._isNeedAdd) {
2066
+ return;
2067
+ }
2068
+ this._isNeedAdd = value;
2069
+ this.commitIsNeedAddProperties();
2070
+ }
2071
+ get isNeedAdd() {
2072
+ return this._isNeedAdd;
2073
+ }
2074
+ }
2075
+
2007
2076
  class ScrollCheckDirective extends DestroyableContainer {
2008
2077
  //--------------------------------------------------------------------------
2009
2078
  //
@@ -2799,16 +2868,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2799
2868
  }]
2800
2869
  }], ctorParameters: function () { return [{ type: i1.LanguageService }]; } });
2801
2870
 
2802
- class LanguageHasDirective extends Destroyable {
2871
+ class LanguageHasDirective extends StructureDirective {
2803
2872
  // --------------------------------------------------------------------------
2804
2873
  //
2805
2874
  // Constructor
2806
2875
  //
2807
2876
  // --------------------------------------------------------------------------
2808
2877
  constructor(template, container, language) {
2809
- super();
2810
- this.template = template;
2811
- this.container = container;
2878
+ super(template, container);
2812
2879
  this.language = language;
2813
2880
  this._isOnlyIfNotEmpty = true;
2814
2881
  language.completed.pipe(takeUntil(this.destroyed)).subscribe(() => this.check());
@@ -2819,29 +2886,7 @@ class LanguageHasDirective extends Destroyable {
2819
2886
  //
2820
2887
  // --------------------------------------------------------------------------
2821
2888
  check() {
2822
- let isNeedAdd = false;
2823
- let isNeedRemove = false;
2824
- let isHasTranslation = !_.isNil(this.viTranslateHas) && this.language.isHasTranslation(this.viTranslateHas, this.viTranslateHasIsOnlyIfNotEmpty);
2825
- if (isHasTranslation) {
2826
- if (_.isNil(this.view)) {
2827
- isNeedAdd = true;
2828
- }
2829
- }
2830
- else {
2831
- if (!_.isNil(this.view)) {
2832
- isNeedRemove = true;
2833
- }
2834
- }
2835
- if (isNeedAdd) {
2836
- this.view = this.container.createEmbeddedView(this.template);
2837
- }
2838
- else if (isNeedRemove) {
2839
- let index = this.container.indexOf(this.view);
2840
- if (index >= 0) {
2841
- this.container.remove(index);
2842
- this.view = null;
2843
- }
2844
- }
2889
+ this.isNeedAdd = !_.isNil(this.viTranslateHas) && this.language.isHasTranslation(this.viTranslateHas, this.viTranslateHasIsOnlyIfNotEmpty);
2845
2890
  }
2846
2891
  // --------------------------------------------------------------------------
2847
2892
  //
@@ -2853,7 +2898,6 @@ class LanguageHasDirective extends Destroyable {
2853
2898
  return;
2854
2899
  }
2855
2900
  super.destroy();
2856
- this.view = null;
2857
2901
  this.language = null;
2858
2902
  this._viTranslateHas = null;
2859
2903
  }
@@ -3317,7 +3361,7 @@ class LoginTokenStorage extends DestroyableContainer {
3317
3361
  get() {
3318
3362
  return this.storage.has(LoginTokenStorage.TOKEN_KEY) ? this.storage.get(LoginTokenStorage.TOKEN_KEY) : this.cookies.get(LoginTokenStorage.TOKEN_KEY);
3319
3363
  }
3320
- save(value) {
3364
+ set(value) {
3321
3365
  this.storage.set(LoginTokenStorage.TOKEN_KEY, value);
3322
3366
  this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
3323
3367
  }
@@ -4305,7 +4349,7 @@ class TimePipe {
4305
4349
  if (_.isNil(format)) {
4306
4350
  format = TimePipe.DEFAULT_FORMAT;
4307
4351
  }
4308
- return FinancePipe.format(milliseconds / DateUtil.MILISECONDS_SECOND, format);
4352
+ return FinancePipe.format(milliseconds / DateUtil.MILLISECONDS_SECOND, format);
4309
4353
  }
4310
4354
  }
4311
4355
  // --------------------------------------------------------------------------
@@ -6730,5 +6774,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
6730
6774
  * Generated bundle index. Do not edit.
6731
6775
  */
6732
6776
 
6733
- 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, 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 };
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 };
6734
6778
  //# sourceMappingURL=ts-core-angular.mjs.map