@ts-core/angular 11.0.84 → 11.0.88

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.
@@ -28,7 +28,7 @@ import { MatButtonModule } from '@angular/material/button';
28
28
  import { MatBottomSheet, MatBottomSheetModule } from '@angular/material/bottom-sheet';
29
29
  import { RemoveFilterableCondition, GetFilterableCondition } from '@ts-core/common/dto';
30
30
  import { DomSanitizer } from '@angular/platform-browser';
31
- import { ThemeService } from '@ts-core/frontend/theme';
31
+ import { ThemeService, ThemeAssetService } from '@ts-core/frontend/theme';
32
32
  import { MatTabsModule } from '@angular/material/tabs';
33
33
  import { MatListModule } from '@angular/material/list';
34
34
  import { MatMenuModule } from '@angular/material/menu';
@@ -6258,15 +6258,17 @@ class ThemeAssetDirective extends Destroyable {
6258
6258
  // Constructor
6259
6259
  //
6260
6260
  // --------------------------------------------------------------------------
6261
- constructor(element, theme) {
6261
+ constructor(element, theme, themeAsset) {
6262
6262
  super();
6263
6263
  this.theme = theme;
6264
+ this.themeAsset = themeAsset;
6264
6265
  this._extension = 'png';
6265
6266
  this._isFile = false;
6266
6267
  this._isImage = false;
6267
6268
  this._isVideo = false;
6268
6269
  this._isSound = false;
6269
6270
  this._isBackground = false;
6271
+ this._isIgnoreTheme = true;
6270
6272
  this.element = ViewUtil.parseElement(element.nativeElement);
6271
6273
  this.theme.changed.pipe(takeUntil(this.destroyed)).subscribe(() => {
6272
6274
  this.isTriedThemeDefault = false;
@@ -6283,21 +6285,21 @@ class ThemeAssetDirective extends Destroyable {
6283
6285
  return null;
6284
6286
  }
6285
6287
  if (this.isImage) {
6286
- return Assets.getImage(id, this.extension);
6288
+ return this.themeAsset.getImage(id, this.extension, this.isIgnoreTheme);
6287
6289
  }
6288
6290
  if (this.isBackground) {
6289
- return Assets.getBackground(id, this.extension);
6291
+ return this.themeAsset.getBackground(id, this.extension, this.isIgnoreTheme);
6290
6292
  }
6291
6293
  if (this.isSound) {
6292
- return Assets.getSound(id, this.extension);
6294
+ return this.themeAsset.getSound(id, this.extension, this.isIgnoreTheme);
6293
6295
  }
6294
6296
  if (this.isVideo) {
6295
- return Assets.getVideo(id, this.extension);
6297
+ return this.themeAsset.getVideo(id, this.extension, this.isIgnoreTheme);
6296
6298
  }
6297
6299
  if (this.isFile) {
6298
- return Assets.getFile(id, this.extension);
6300
+ return this.themeAsset.getFile(id, this.extension, this.isIgnoreTheme);
6299
6301
  }
6300
- return Assets.getIcon(id, this.extension);
6302
+ return this.themeAsset.getIcon(id, this.extension, this.isIgnoreTheme);
6301
6303
  }
6302
6304
  // --------------------------------------------------------------------------
6303
6305
  //
@@ -6312,7 +6314,7 @@ class ThemeAssetDirective extends Destroyable {
6312
6314
  return;
6313
6315
  }
6314
6316
  this.isTriedThemeDefault = true;
6315
- this.source = this.getSource(this.getDefaultSourceId(this.theme.theme));
6317
+ this.source = this.getSource(this.getDefaultSourceId());
6316
6318
  this.commitSourceProperties();
6317
6319
  }
6318
6320
  // --------------------------------------------------------------------------
@@ -6327,10 +6329,8 @@ class ThemeAssetDirective extends Destroyable {
6327
6329
  getSourceId(theme) {
6328
6330
  return !isNil(theme) ? this.name + capitalize(theme.name) : null;
6329
6331
  }
6330
- getDefaultSourceId(theme) {
6331
- let value = this.name;
6332
- value += theme.isDark ? 'Dark' : 'Light';
6333
- return value;
6332
+ getDefaultSourceId() {
6333
+ return this.themeAsset.getName(this.name, this.isIgnoreTheme);
6334
6334
  }
6335
6335
  // --------------------------------------------------------------------------
6336
6336
  //
@@ -6401,6 +6401,16 @@ class ThemeAssetDirective extends Destroyable {
6401
6401
  get isBackground() {
6402
6402
  return this._isBackground;
6403
6403
  }
6404
+ set isIgnoreTheme(value) {
6405
+ if (value === this._isIgnoreTheme) {
6406
+ return;
6407
+ }
6408
+ this._isIgnoreTheme = value;
6409
+ this.setSourceProperties();
6410
+ }
6411
+ get isIgnoreTheme() {
6412
+ return this._isIgnoreTheme;
6413
+ }
6404
6414
  get name() {
6405
6415
  return this._name;
6406
6416
  }
@@ -6436,6 +6446,7 @@ ThemeAssetDirective.propDecorators = {
6436
6446
  isFile: [{ type: Input }],
6437
6447
  isImage: [{ type: Input }],
6438
6448
  isBackground: [{ type: Input }],
6449
+ isIgnoreTheme: [{ type: Input }],
6439
6450
  name: [{ type: Input }],
6440
6451
  extension: [{ type: Input }]
6441
6452
  };
@@ -6446,8 +6457,8 @@ class ThemeAssetBackgroundDirective extends ThemeAssetDirective {
6446
6457
  // Constructor
6447
6458
  //
6448
6459
  // --------------------------------------------------------------------------
6449
- constructor(element, theme) {
6450
- super(element, theme);
6460
+ constructor(element, theme, themeAsset) {
6461
+ super(element, theme, themeAsset);
6451
6462
  }
6452
6463
  // --------------------------------------------------------------------------
6453
6464
  //
@@ -6469,7 +6480,8 @@ ThemeAssetBackgroundDirective.decorators = [
6469
6480
  ];
6470
6481
  ThemeAssetBackgroundDirective.ctorParameters = () => [
6471
6482
  { type: ElementRef },
6472
- { type: ThemeService }
6483
+ { type: ThemeService },
6484
+ { type: ThemeAssetService }
6473
6485
  ];
6474
6486
 
6475
6487
  class ThemeAssetImageDirective extends ThemeAssetDirective {
@@ -6478,8 +6490,8 @@ class ThemeAssetImageDirective extends ThemeAssetDirective {
6478
6490
  // Constructor
6479
6491
  //
6480
6492
  // --------------------------------------------------------------------------
6481
- constructor(element, theme) {
6482
- super(element, theme);
6493
+ constructor(element, theme, themeAsset) {
6494
+ super(element, theme, themeAsset);
6483
6495
  }
6484
6496
  // --------------------------------------------------------------------------
6485
6497
  //
@@ -6500,7 +6512,8 @@ ThemeAssetImageDirective.decorators = [
6500
6512
  ];
6501
6513
  ThemeAssetImageDirective.ctorParameters = () => [
6502
6514
  { type: ElementRef },
6503
- { type: ThemeService }
6515
+ { type: ThemeService },
6516
+ { type: ThemeAssetService }
6504
6517
  ];
6505
6518
 
6506
6519
  class ThemeToggleDirective extends Destroyable {
@@ -6789,6 +6802,11 @@ class ThemeModule {
6789
6802
  provide: ThemeService,
6790
6803
  deps: [CookieService, THEME_OPTIONS],
6791
6804
  useFactory: themeServiceFactory
6805
+ },
6806
+ {
6807
+ provide: ThemeAssetService,
6808
+ deps: [ThemeService],
6809
+ useFactory: themeAssetServiceFactory
6792
6810
  }
6793
6811
  ]
6794
6812
  };
@@ -6807,6 +6825,9 @@ function themeServiceFactory(cookie, options) {
6807
6825
  }
6808
6826
  return new ThemeService(options);
6809
6827
  }
6828
+ function themeAssetServiceFactory(theme) {
6829
+ return new ThemeAssetService(theme);
6830
+ }
6810
6831
  const THEME_OPTIONS = new InjectionToken(`THEME_OPTIONS`);
6811
6832
 
6812
6833
  class WindowDragAreaDirective extends Destroyable {
@@ -7697,36 +7718,6 @@ class LoginBaseService extends Loadable {
7697
7718
  // Protected Methods
7698
7719
  //
7699
7720
  // --------------------------------------------------------------------------
7700
- /*
7701
- protected async loginByParam(param?: any): Promise<void> {
7702
- if (this.isLoggedIn || this.isLoading) {
7703
- return;
7704
- }
7705
-
7706
- this.status = LoadableStatus.LOADING;
7707
- this.observer.next(new ObservableData(LoadableEvent.STARTED));
7708
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_STARTED));
7709
-
7710
- try {
7711
- this.parseLoginResponse(await this.loginRequest(param));
7712
- this.status = !this.isCanLoginWithSid() ? LoadableStatus.LOADED : LoadableStatus.LOADING;
7713
- if (this.isLoading) {
7714
- this.loginBySid();
7715
- }
7716
- } catch (error) {
7717
- error = ExtendedError.create(error);
7718
-
7719
- this.status = LoadableStatus.ERROR;
7720
- this.parseLoginErrorResponse(error);
7721
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_ERROR, null, error));
7722
- }
7723
-
7724
- if (!this.isLoading) {
7725
- this.observer.next(new ObservableData(LoadableEvent.FINISHED));
7726
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_FINISHED));
7727
- }
7728
- }
7729
- */
7730
7721
  loginByParam(param) {
7731
7722
  return __awaiter(this, void 0, void 0, function* () {
7732
7723
  return this.loginByFunction(() => this.loginRequest(param));
@@ -7795,6 +7786,7 @@ class LoginBaseService extends Loadable {
7795
7786
  this._loginData = null;
7796
7787
  }
7797
7788
  parseLoginErrorResponse(error) { }
7789
+ parseLogoutErrorResponse(error) { }
7798
7790
  parseLoginSidResponse(response) {
7799
7791
  this._loginData = response;
7800
7792
  }
@@ -7824,6 +7816,7 @@ class LoginBaseService extends Loadable {
7824
7816
  return false;
7825
7817
  }
7826
7818
  if (!this.isLoggedIn && !this.isLoading) {
7819
+ this.status = LoadableStatus.LOADING;
7827
7820
  this.observer.next(new ObservableData(LoadableEvent.STARTED));
7828
7821
  this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_STARTED));
7829
7822
  this.loginBySid();
@@ -7831,17 +7824,26 @@ class LoginBaseService extends Loadable {
7831
7824
  return true;
7832
7825
  }
7833
7826
  logout() {
7834
- if (!this.isLoggedIn) {
7835
- return;
7836
- }
7837
- this.observer.next(new ObservableData(LoadableEvent.STARTED));
7838
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGOUT_STARTED));
7839
- this.logoutRequest();
7840
- this.reset();
7841
- this._isLoggedIn = false;
7842
- this.status = LoadableStatus.NOT_LOADED;
7843
- this.observer.next(new ObservableData(LoadableEvent.FINISHED));
7844
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGOUT_FINISHED));
7827
+ return __awaiter(this, void 0, void 0, function* () {
7828
+ if (!this.isLoggedIn) {
7829
+ return;
7830
+ }
7831
+ this.observer.next(new ObservableData(LoadableEvent.STARTED));
7832
+ this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGOUT_STARTED));
7833
+ try {
7834
+ yield this.logoutRequest();
7835
+ }
7836
+ catch (error) {
7837
+ this.parseLogoutErrorResponse(ExtendedError.create(error));
7838
+ }
7839
+ finally {
7840
+ this.reset();
7841
+ this._isLoggedIn = false;
7842
+ this.status = LoadableStatus.NOT_LOADED;
7843
+ this.observer.next(new ObservableData(LoadableEvent.FINISHED));
7844
+ this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGOUT_FINISHED));
7845
+ }
7846
+ });
7845
7847
  }
7846
7848
  isCanLoginWithSid() {
7847
7849
  return this.sid != null || this.getSavedSid() != null;
@@ -7891,32 +7893,6 @@ var LoginBaseServiceEvent;
7891
7893
  LoginBaseServiceEvent["REGISTRATION_FINISHED"] = "REGISTRATION_FINISHED";
7892
7894
  })(LoginBaseServiceEvent || (LoginBaseServiceEvent = {}));
7893
7895
 
7894
- class LoginGuard {
7895
- // --------------------------------------------------------------------------
7896
- //
7897
- // Constructor
7898
- //
7899
- // --------------------------------------------------------------------------
7900
- constructor(login) {
7901
- this.login = login;
7902
- }
7903
- // --------------------------------------------------------------------------
7904
- //
7905
- // Public Methods
7906
- //
7907
- // --------------------------------------------------------------------------
7908
- canActivate(route, state) {
7909
- return this.login.isLoggedIn;
7910
- }
7911
- }
7912
- LoginGuard.ɵprov = ɵɵdefineInjectable({ factory: function LoginGuard_Factory() { return new LoginGuard(ɵɵinject(LoginBaseService)); }, token: LoginGuard, providedIn: "root" });
7913
- LoginGuard.decorators = [
7914
- { type: Injectable, args: [{ providedIn: 'root' },] }
7915
- ];
7916
- LoginGuard.ctorParameters = () => [
7917
- { type: LoginBaseService }
7918
- ];
7919
-
7920
7896
  class LoginRequireResolver {
7921
7897
  // --------------------------------------------------------------------------
7922
7898
  //
@@ -7931,7 +7907,7 @@ class LoginRequireResolver {
7931
7907
  // Public Methods
7932
7908
  //
7933
7909
  // --------------------------------------------------------------------------
7934
- resolve(route, state) {
7910
+ resolve() {
7935
7911
  if (this.login.isLoggedIn) {
7936
7912
  return Promise.resolve();
7937
7913
  }
@@ -7951,6 +7927,32 @@ class LoginRequireResolver {
7951
7927
  }
7952
7928
  }
7953
7929
 
7930
+ class LoginGuard extends LoginRequireResolver {
7931
+ // --------------------------------------------------------------------------
7932
+ //
7933
+ // Constructor
7934
+ //
7935
+ // --------------------------------------------------------------------------
7936
+ constructor(login) {
7937
+ super(login);
7938
+ }
7939
+ // --------------------------------------------------------------------------
7940
+ //
7941
+ // Public Methods
7942
+ //
7943
+ // --------------------------------------------------------------------------
7944
+ canActivate() {
7945
+ return this.login.isLoggedIn;
7946
+ }
7947
+ }
7948
+ LoginGuard.ɵprov = ɵɵdefineInjectable({ factory: function LoginGuard_Factory() { return new LoginGuard(ɵɵinject(LoginBaseService)); }, token: LoginGuard, providedIn: "root" });
7949
+ LoginGuard.decorators = [
7950
+ { type: Injectable, args: [{ providedIn: 'root' },] }
7951
+ ];
7952
+ LoginGuard.ctorParameters = () => [
7953
+ { type: LoginBaseService }
7954
+ ];
7955
+
7954
7956
  class LoginResolver extends LoginRequireResolver {
7955
7957
  // --------------------------------------------------------------------------
7956
7958
  //
@@ -9076,7 +9078,7 @@ class UserBaseService {
9076
9078
  }
9077
9079
  return this.user.id === value;
9078
9080
  }
9079
- updateUser(data) {
9081
+ userUpdate(data) {
9080
9082
  if (!this.hasUser) {
9081
9083
  return;
9082
9084
  }
@@ -9126,5 +9128,5 @@ var UserBaseServiceEvent;
9126
9128
  * Generated bundle index. Do not edit.
9127
9129
  */
9128
9130
 
9129
- export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, ApplicationComponent2, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetIconPipe, AssetImagePipe, AssetModule, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableDataSource, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableMapCollection, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, INotification, INotificationContent, IUser, IVICommonOptions, IWindow, IWindowContent, InfiniteScrollDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageMatPaginatorIntl, LanguageModule, LanguageMomentDateAdapter, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LanguageSelectorComponent, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginRedirectResolver, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VI_ANGULAR_OPTIONS, ViewUtil, WindowAlign, WindowBase, WindowConfig, WindowEvent, WindowFactory, WindowImpl, WindowModule, WindowService, WindowServiceEvent, cookieServiceFactory, languageServiceFactory, loggerServiceFactory, themeServiceFactory, AssetFilePipe as ɵa, AssetSoundPipe as ɵb, AssetVideoPipe as ɵc, WindowDragAreaDirective as ɵd, WindowQuestionComponent as ɵe, WindowQuestionBaseComponent as ɵf, WindowCloseElementComponent as ɵg, WindowElement as ɵh, WindowResizeElementComponent as ɵi, WindowMinimizeElementComponent as ɵj, NotificationComponent as ɵk, NotificationQuestionBaseComponent as ɵl, BottomSheetModule as ɵm, BottomSheetCloseElementComponent as ɵn, CdkTableColumnValuePipe as ɵo, CdkTableColumnClassNamePipe as ɵp, CdkTableColumnStyleNamePipe as ɵq, CdkTableRowStyleNamePipe as ɵr, CdkTableRowClassNamePipe as ɵs, CdkTableCellClassNamePipe as ɵt, CdkTablePaginableComponent as ɵu, CdkTableFilterableComponent as ɵv, ValueAccessor as ɵw };
9131
+ export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, ApplicationComponent2, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetIconPipe, AssetImagePipe, AssetModule, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableDataSource, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableMapCollection, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, INotification, INotificationContent, IUser, IVICommonOptions, IWindow, IWindowContent, InfiniteScrollDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageMatPaginatorIntl, LanguageModule, LanguageMomentDateAdapter, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LanguageSelectorComponent, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginRedirectResolver, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VI_ANGULAR_OPTIONS, ViewUtil, WindowAlign, WindowBase, WindowConfig, WindowEvent, WindowFactory, WindowImpl, WindowModule, WindowService, WindowServiceEvent, cookieServiceFactory, languageServiceFactory, loggerServiceFactory, themeAssetServiceFactory, themeServiceFactory, AssetFilePipe as ɵa, AssetSoundPipe as ɵb, AssetVideoPipe as ɵc, WindowDragAreaDirective as ɵd, WindowQuestionComponent as ɵe, WindowQuestionBaseComponent as ɵf, WindowCloseElementComponent as ɵg, WindowElement as ɵh, WindowResizeElementComponent as ɵi, WindowMinimizeElementComponent as ɵj, NotificationComponent as ɵk, NotificationQuestionBaseComponent as ɵl, BottomSheetModule as ɵm, BottomSheetCloseElementComponent as ɵn, CdkTableColumnValuePipe as ɵo, CdkTableColumnClassNamePipe as ɵp, CdkTableColumnStyleNamePipe as ɵq, CdkTableRowStyleNamePipe as ɵr, CdkTableRowClassNamePipe as ɵs, CdkTableCellClassNamePipe as ɵt, CdkTablePaginableComponent as ɵu, CdkTableFilterableComponent as ɵv, ValueAccessor as ɵw };
9130
9132
  //# sourceMappingURL=ts-core-angular.js.map