@ts-core/angular 13.0.16 → 13.0.19

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.
@@ -56,10 +56,10 @@ import * as i3$1 from '@angular/material/progress-bar';
56
56
  import { MatProgressBarModule } from '@angular/material/progress-bar';
57
57
  import { MomentDateAdapter } from '@angular/material-moment-adapter';
58
58
  import { TransportTimeoutError, TransportNoConnectionError, TransportEvent } from '@ts-core/common/transport';
59
- import * as i2$4 from '@angular/router';
59
+ import * as i1$9 from '@angular/router';
60
60
  import { NavigationStart, NavigationEnd, NavigationCancel, NavigationError, ActivatedRoute } from '@angular/router';
61
61
  import { FilterableMapCollection, MapCollection } from '@ts-core/common/map';
62
- import * as i1$9 from '@angular/cdk/layout';
62
+ import * as i1$a from '@angular/cdk/layout';
63
63
  import { TransportLocal } from '@ts-core/common/transport/local';
64
64
 
65
65
  class ApplicationBaseComponent extends DestroyableContainer {
@@ -8132,16 +8132,17 @@ class LoginBaseService extends Loadable {
8132
8132
  await this.loginBySid();
8133
8133
  }
8134
8134
  }
8135
- tryLoginBySid() {
8135
+ loginBySidIfCan() {
8136
8136
  if (!this.isCanLoginWithSid()) {
8137
8137
  return false;
8138
8138
  }
8139
- if (!this.isLoggedIn && !this.isLoading) {
8140
- this.status = LoadableStatus.LOADING;
8141
- this.observer.next(new ObservableData(LoadableEvent.STARTED));
8142
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_STARTED));
8143
- this.loginBySid();
8139
+ if (this.isLoggedIn || this.isLoading) {
8140
+ return true;
8144
8141
  }
8142
+ this.status = LoadableStatus.LOADING;
8143
+ this.observer.next(new ObservableData(LoadableEvent.STARTED));
8144
+ this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_STARTED));
8145
+ this.loginBySid();
8145
8146
  return true;
8146
8147
  }
8147
8148
  async logout() {
@@ -8229,7 +8230,7 @@ class LoginRequireResolver {
8229
8230
  // --------------------------------------------------------------------------
8230
8231
  resolve() {
8231
8232
  if (this.isLoggedIn()) {
8232
- return Promise.resolve(this.login.loginData);
8233
+ return Promise.resolve();
8233
8234
  }
8234
8235
  let promise = PromiseHandler.create();
8235
8236
  let subscription = this.login.events.subscribe(data => {
@@ -8237,7 +8238,7 @@ class LoginRequireResolver {
8237
8238
  promise.reject(data.error.toString());
8238
8239
  }
8239
8240
  else if (data.type === LoginBaseServiceEvent.LOGIN_COMPLETE) {
8240
- promise.resolve(data.data);
8241
+ promise.resolve();
8241
8242
  }
8242
8243
  else if (data.type === LoginBaseServiceEvent.LOGIN_FINISHED) {
8243
8244
  subscription.unsubscribe();
@@ -8265,7 +8266,7 @@ class LoginGuard extends LoginRequireResolver {
8265
8266
  // Public Methods
8266
8267
  //
8267
8268
  // --------------------------------------------------------------------------
8268
- canActivate() {
8269
+ canActivate(route, state) {
8269
8270
  return this.isLoggedIn() ? true : this.router.parseUrl(LoginGuard.redirectUrl);
8270
8271
  }
8271
8272
  }
@@ -8275,12 +8276,15 @@ class LoginGuard extends LoginRequireResolver {
8275
8276
  //
8276
8277
  // --------------------------------------------------------------------------
8277
8278
  LoginGuard.redirectUrl = '/login';
8278
- LoginGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginGuard, deps: [{ token: LoginBaseService }, { token: i2$4.Router }], target: i0.ɵɵFactoryTarget.Injectable });
8279
+ LoginGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginGuard, deps: [{ token: LoginBaseService }, { token: i1$9.Router }], target: i0.ɵɵFactoryTarget.Injectable });
8279
8280
  LoginGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginGuard, providedIn: 'root' });
8280
8281
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginGuard, decorators: [{
8281
8282
  type: Injectable,
8282
8283
  args: [{ providedIn: 'root' }]
8283
- }], ctorParameters: function () { return [{ type: LoginBaseService }, { type: i2$4.Router }]; } });
8284
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
8285
+ type: Inject,
8286
+ args: [LoginBaseService]
8287
+ }] }, { type: i1$9.Router }]; } });
8284
8288
 
8285
8289
  class LoginNotGuard extends LoginRequireResolver {
8286
8290
  // --------------------------------------------------------------------------
@@ -8297,7 +8301,7 @@ class LoginNotGuard extends LoginRequireResolver {
8297
8301
  // Public Methods
8298
8302
  //
8299
8303
  // --------------------------------------------------------------------------
8300
- canActivate() {
8304
+ canActivate(route, state) {
8301
8305
  return !this.isLoggedIn() ? true : this.router.parseUrl(LoginNotGuard.redirectUrl);
8302
8306
  }
8303
8307
  }
@@ -8307,12 +8311,83 @@ class LoginNotGuard extends LoginRequireResolver {
8307
8311
  //
8308
8312
  // --------------------------------------------------------------------------
8309
8313
  LoginNotGuard.redirectUrl = '/';
8310
- LoginNotGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginNotGuard, deps: [{ token: LoginBaseService }, { token: i2$4.Router }], target: i0.ɵɵFactoryTarget.Injectable });
8314
+ LoginNotGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginNotGuard, deps: [{ token: LoginBaseService }, { token: i1$9.Router }], target: i0.ɵɵFactoryTarget.Injectable });
8311
8315
  LoginNotGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginNotGuard, providedIn: 'root' });
8312
8316
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginNotGuard, decorators: [{
8313
8317
  type: Injectable,
8314
8318
  args: [{ providedIn: 'root' }]
8315
- }], ctorParameters: function () { return [{ type: LoginBaseService }, { type: i2$4.Router }]; } });
8319
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
8320
+ type: Inject,
8321
+ args: [LoginBaseService]
8322
+ }] }, { type: i1$9.Router }]; } });
8323
+
8324
+ class LoginIfCanGuard extends LoginGuard {
8325
+ // --------------------------------------------------------------------------
8326
+ //
8327
+ // Constructor
8328
+ //
8329
+ // --------------------------------------------------------------------------
8330
+ constructor(login, router) {
8331
+ super(login, router);
8332
+ this.router = router;
8333
+ }
8334
+ // --------------------------------------------------------------------------
8335
+ //
8336
+ // Private Methods
8337
+ //
8338
+ // --------------------------------------------------------------------------
8339
+ async loginIfCan() {
8340
+ if (this.login.loginBySidIfCan()) {
8341
+ try {
8342
+ await this.resolve();
8343
+ }
8344
+ catch (error) { }
8345
+ }
8346
+ }
8347
+ // --------------------------------------------------------------------------
8348
+ //
8349
+ // Public Methods
8350
+ //
8351
+ // --------------------------------------------------------------------------
8352
+ async canActivate(route, state) {
8353
+ if (state.url !== LoginGuard.redirectUrl) {
8354
+ LoginNotGuard.redirectUrl = state.url;
8355
+ }
8356
+ if (!this.isLoggedIn()) {
8357
+ await this.loginIfCan();
8358
+ }
8359
+ return super.canActivate(route, state);
8360
+ }
8361
+ }
8362
+ LoginIfCanGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginIfCanGuard, deps: [{ token: LoginBaseService }, { token: i1$9.Router }], target: i0.ɵɵFactoryTarget.Injectable });
8363
+ LoginIfCanGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginIfCanGuard, providedIn: 'root' });
8364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginIfCanGuard, decorators: [{
8365
+ type: Injectable,
8366
+ args: [{ providedIn: 'root' }]
8367
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
8368
+ type: Inject,
8369
+ args: [LoginBaseService]
8370
+ }] }, { type: i1$9.Router }]; } });
8371
+
8372
+ class LoginResolver extends LoginRequireResolver {
8373
+ // --------------------------------------------------------------------------
8374
+ //
8375
+ // Constructor
8376
+ //
8377
+ // --------------------------------------------------------------------------
8378
+ constructor(login) {
8379
+ super(login);
8380
+ }
8381
+ }
8382
+ LoginResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginResolver, deps: [{ token: LoginBaseService }], target: i0.ɵɵFactoryTarget.Injectable });
8383
+ LoginResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginResolver, providedIn: 'root' });
8384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginResolver, decorators: [{
8385
+ type: Injectable,
8386
+ args: [{ providedIn: 'root' }]
8387
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
8388
+ type: Inject,
8389
+ args: [LoginBaseService]
8390
+ }] }]; } });
8316
8391
 
8317
8392
  class MenuItemBase {
8318
8393
  // --------------------------------------------------------------------------
@@ -9092,12 +9167,12 @@ BootstrapBreakpointService.DEFAULT_MD = 768;
9092
9167
  BootstrapBreakpointService.DEFAULT_LG = 992;
9093
9168
  BootstrapBreakpointService.DEFAULT_XL = 1200;
9094
9169
  BootstrapBreakpointService.DEFAULT_XXL = 1400;
9095
- BootstrapBreakpointService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BootstrapBreakpointService, deps: [{ token: i1$9.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
9170
+ BootstrapBreakpointService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BootstrapBreakpointService, deps: [{ token: i1$a.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
9096
9171
  BootstrapBreakpointService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BootstrapBreakpointService, providedIn: 'root' });
9097
9172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BootstrapBreakpointService, decorators: [{
9098
9173
  type: Injectable,
9099
9174
  args: [{ providedIn: 'root' }]
9100
- }], ctorParameters: function () { return [{ type: i1$9.BreakpointObserver }]; } });
9175
+ }], ctorParameters: function () { return [{ type: i1$a.BreakpointObserver }]; } });
9101
9176
  var BootstrapBreakpointServiceEvent;
9102
9177
  (function (BootstrapBreakpointServiceEvent) {
9103
9178
  BootstrapBreakpointServiceEvent["CHANGED"] = "CHANGED";
@@ -9653,5 +9728,5 @@ class TransportLazyModule {
9653
9728
  * Generated bundle index. Do not edit.
9654
9729
  */
9655
9730
 
9656
- export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableCellClassNamePipe, CdkTableColumnClassNamePipe, CdkTableColumnStyleNamePipe, CdkTableColumnValuePipe, CdkTableDataSource, CdkTableFilterableComponent, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkComponent, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableComponent, CdkTablePaginableMapCollection, CdkTableRowClassNamePipe, CdkTableRowStyleNamePipe, 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, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginNotGuard, LoginRequireResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MenuTriggerForDirective, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationBaseComponent, NotificationComponent, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowBaseComponent, WindowCloseElementComponent, WindowConfig, WindowDragAreaDirective, WindowEvent, WindowFactory, WindowImpl, WindowMinimizeElementComponent, WindowModule, WindowQuestionBaseComponent, WindowQuestionComponent, WindowResizeElementComponent, WindowService, WindowServiceEvent, cookieServiceFactory, languageServiceFactory, loggerServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory, windowServiceFactory };
9731
+ export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BootstrapBreakpoint, BootstrapBreakpointService, BootstrapBreakpointServiceEvent, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, CdkTableBaseComponent, CdkTableCellClassNamePipe, CdkTableColumnClassNamePipe, CdkTableColumnStyleNamePipe, CdkTableColumnValuePipe, CdkTableDataSource, CdkTableFilterableComponent, CdkTableFilterableMapCollection, CdkTablePaginableBookmarkComponent, CdkTablePaginableBookmarkMapCollection, CdkTablePaginableComponent, CdkTablePaginableMapCollection, CdkTableRowClassNamePipe, CdkTableRowStyleNamePipe, 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, LazyModuleLoader, ListItem, ListItems, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, MenuItem, MenuItemBase, MenuItems, MenuListComponent, MenuTriggerForDirective, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationBaseComponent, NotificationComponent, NotificationConfig, NotificationEvent, NotificationFactory, NotificationModule, NotificationService, NotificationServiceEvent, PipeBaseService, PrettifyPipe, PropertiesManager, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListComponent, SelectListItem, SelectListItems, SelectOnFocusDirective, ShellBaseComponent, StartCasePipe, THEME_OPTIONS, TabGroupComponent, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VICommonModule, VIComponentModule, VI_ANGULAR_OPTIONS, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowBaseComponent, WindowCloseElementComponent, WindowConfig, WindowDragAreaDirective, WindowEvent, WindowFactory, WindowImpl, WindowMinimizeElementComponent, WindowModule, WindowQuestionBaseComponent, WindowQuestionComponent, WindowResizeElementComponent, WindowService, WindowServiceEvent, cookieServiceFactory, languageServiceFactory, loggerServiceFactory, notificationServiceFactory, themeAssetServiceFactory, themeServiceFactory, windowServiceFactory };
9657
9732
  //# sourceMappingURL=ts-core-angular.mjs.map