@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.
@@ -57,10 +57,10 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
57
57
  import { MomentDateAdapter } from '@angular/material-moment-adapter';
58
58
  import { __awaiter } from 'tslib';
59
59
  import { TransportTimeoutError, TransportNoConnectionError, TransportEvent } from '@ts-core/common/transport';
60
- import * as i2$4 from '@angular/router';
60
+ import * as i1$9 from '@angular/router';
61
61
  import { NavigationStart, NavigationEnd, NavigationCancel, NavigationError, ActivatedRoute } from '@angular/router';
62
62
  import { FilterableMapCollection, MapCollection } from '@ts-core/common/map';
63
- import * as i1$9 from '@angular/cdk/layout';
63
+ import * as i1$a from '@angular/cdk/layout';
64
64
  import { TransportLocal } from '@ts-core/common/transport/local';
65
65
 
66
66
  class ApplicationBaseComponent extends DestroyableContainer {
@@ -8143,16 +8143,17 @@ class LoginBaseService extends Loadable {
8143
8143
  }
8144
8144
  });
8145
8145
  }
8146
- tryLoginBySid() {
8146
+ loginBySidIfCan() {
8147
8147
  if (!this.isCanLoginWithSid()) {
8148
8148
  return false;
8149
8149
  }
8150
- if (!this.isLoggedIn && !this.isLoading) {
8151
- this.status = LoadableStatus.LOADING;
8152
- this.observer.next(new ObservableData(LoadableEvent.STARTED));
8153
- this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_STARTED));
8154
- this.loginBySid();
8150
+ if (this.isLoggedIn || this.isLoading) {
8151
+ return true;
8155
8152
  }
8153
+ this.status = LoadableStatus.LOADING;
8154
+ this.observer.next(new ObservableData(LoadableEvent.STARTED));
8155
+ this.observer.next(new ObservableData(LoginBaseServiceEvent.LOGIN_STARTED));
8156
+ this.loginBySid();
8156
8157
  return true;
8157
8158
  }
8158
8159
  logout() {
@@ -8242,7 +8243,7 @@ class LoginRequireResolver {
8242
8243
  // --------------------------------------------------------------------------
8243
8244
  resolve() {
8244
8245
  if (this.isLoggedIn()) {
8245
- return Promise.resolve(this.login.loginData);
8246
+ return Promise.resolve();
8246
8247
  }
8247
8248
  let promise = PromiseHandler.create();
8248
8249
  let subscription = this.login.events.subscribe(data => {
@@ -8250,7 +8251,7 @@ class LoginRequireResolver {
8250
8251
  promise.reject(data.error.toString());
8251
8252
  }
8252
8253
  else if (data.type === LoginBaseServiceEvent.LOGIN_COMPLETE) {
8253
- promise.resolve(data.data);
8254
+ promise.resolve();
8254
8255
  }
8255
8256
  else if (data.type === LoginBaseServiceEvent.LOGIN_FINISHED) {
8256
8257
  subscription.unsubscribe();
@@ -8278,7 +8279,7 @@ class LoginGuard extends LoginRequireResolver {
8278
8279
  // Public Methods
8279
8280
  //
8280
8281
  // --------------------------------------------------------------------------
8281
- canActivate() {
8282
+ canActivate(route, state) {
8282
8283
  return this.isLoggedIn() ? true : this.router.parseUrl(LoginGuard.redirectUrl);
8283
8284
  }
8284
8285
  }
@@ -8288,12 +8289,17 @@ class LoginGuard extends LoginRequireResolver {
8288
8289
  //
8289
8290
  // --------------------------------------------------------------------------
8290
8291
  LoginGuard.redirectUrl = '/login';
8291
- 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 });
8292
+ 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 });
8292
8293
  LoginGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginGuard, providedIn: 'root' });
8293
8294
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginGuard, decorators: [{
8294
8295
  type: Injectable,
8295
8296
  args: [{ providedIn: 'root' }]
8296
- }], ctorParameters: function () { return [{ type: LoginBaseService }, { type: i2$4.Router }]; } });
8297
+ }], ctorParameters: function () {
8298
+ return [{ type: undefined, decorators: [{
8299
+ type: Inject,
8300
+ args: [LoginBaseService]
8301
+ }] }, { type: i1$9.Router }];
8302
+ } });
8297
8303
 
8298
8304
  class LoginNotGuard extends LoginRequireResolver {
8299
8305
  // --------------------------------------------------------------------------
@@ -8310,7 +8316,7 @@ class LoginNotGuard extends LoginRequireResolver {
8310
8316
  // Public Methods
8311
8317
  //
8312
8318
  // --------------------------------------------------------------------------
8313
- canActivate() {
8319
+ canActivate(route, state) {
8314
8320
  return !this.isLoggedIn() ? true : this.router.parseUrl(LoginNotGuard.redirectUrl);
8315
8321
  }
8316
8322
  }
@@ -8320,12 +8326,96 @@ class LoginNotGuard extends LoginRequireResolver {
8320
8326
  //
8321
8327
  // --------------------------------------------------------------------------
8322
8328
  LoginNotGuard.redirectUrl = '/';
8323
- 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 });
8329
+ 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 });
8324
8330
  LoginNotGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginNotGuard, providedIn: 'root' });
8325
8331
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginNotGuard, decorators: [{
8326
8332
  type: Injectable,
8327
8333
  args: [{ providedIn: 'root' }]
8328
- }], ctorParameters: function () { return [{ type: LoginBaseService }, { type: i2$4.Router }]; } });
8334
+ }], ctorParameters: function () {
8335
+ return [{ type: undefined, decorators: [{
8336
+ type: Inject,
8337
+ args: [LoginBaseService]
8338
+ }] }, { type: i1$9.Router }];
8339
+ } });
8340
+
8341
+ class LoginIfCanGuard extends LoginGuard {
8342
+ // --------------------------------------------------------------------------
8343
+ //
8344
+ // Constructor
8345
+ //
8346
+ // --------------------------------------------------------------------------
8347
+ constructor(login, router) {
8348
+ super(login, router);
8349
+ this.router = router;
8350
+ }
8351
+ // --------------------------------------------------------------------------
8352
+ //
8353
+ // Private Methods
8354
+ //
8355
+ // --------------------------------------------------------------------------
8356
+ loginIfCan() {
8357
+ return __awaiter(this, void 0, void 0, function* () {
8358
+ if (this.login.loginBySidIfCan()) {
8359
+ try {
8360
+ yield this.resolve();
8361
+ }
8362
+ catch (error) { }
8363
+ }
8364
+ });
8365
+ }
8366
+ // --------------------------------------------------------------------------
8367
+ //
8368
+ // Public Methods
8369
+ //
8370
+ // --------------------------------------------------------------------------
8371
+ canActivate(route, state) {
8372
+ const _super = Object.create(null, {
8373
+ canActivate: { get: () => super.canActivate }
8374
+ });
8375
+ return __awaiter(this, void 0, void 0, function* () {
8376
+ if (state.url !== LoginGuard.redirectUrl) {
8377
+ LoginNotGuard.redirectUrl = state.url;
8378
+ }
8379
+ if (!this.isLoggedIn()) {
8380
+ yield this.loginIfCan();
8381
+ }
8382
+ return _super.canActivate.call(this, route, state);
8383
+ });
8384
+ }
8385
+ }
8386
+ 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 });
8387
+ LoginIfCanGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginIfCanGuard, providedIn: 'root' });
8388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginIfCanGuard, decorators: [{
8389
+ type: Injectable,
8390
+ args: [{ providedIn: 'root' }]
8391
+ }], ctorParameters: function () {
8392
+ return [{ type: undefined, decorators: [{
8393
+ type: Inject,
8394
+ args: [LoginBaseService]
8395
+ }] }, { type: i1$9.Router }];
8396
+ } });
8397
+
8398
+ class LoginResolver extends LoginRequireResolver {
8399
+ // --------------------------------------------------------------------------
8400
+ //
8401
+ // Constructor
8402
+ //
8403
+ // --------------------------------------------------------------------------
8404
+ constructor(login) {
8405
+ super(login);
8406
+ }
8407
+ }
8408
+ LoginResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginResolver, deps: [{ token: LoginBaseService }], target: i0.ɵɵFactoryTarget.Injectable });
8409
+ LoginResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginResolver, providedIn: 'root' });
8410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: LoginResolver, decorators: [{
8411
+ type: Injectable,
8412
+ args: [{ providedIn: 'root' }]
8413
+ }], ctorParameters: function () {
8414
+ return [{ type: undefined, decorators: [{
8415
+ type: Inject,
8416
+ args: [LoginBaseService]
8417
+ }] }];
8418
+ } });
8329
8419
 
8330
8420
  class MenuItemBase {
8331
8421
  // --------------------------------------------------------------------------
@@ -9105,12 +9195,12 @@ BootstrapBreakpointService.DEFAULT_MD = 768;
9105
9195
  BootstrapBreakpointService.DEFAULT_LG = 992;
9106
9196
  BootstrapBreakpointService.DEFAULT_XL = 1200;
9107
9197
  BootstrapBreakpointService.DEFAULT_XXL = 1400;
9108
- 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 });
9198
+ 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 });
9109
9199
  BootstrapBreakpointService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BootstrapBreakpointService, providedIn: 'root' });
9110
9200
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.5", ngImport: i0, type: BootstrapBreakpointService, decorators: [{
9111
9201
  type: Injectable,
9112
9202
  args: [{ providedIn: 'root' }]
9113
- }], ctorParameters: function () { return [{ type: i1$9.BreakpointObserver }]; } });
9203
+ }], ctorParameters: function () { return [{ type: i1$a.BreakpointObserver }]; } });
9114
9204
  var BootstrapBreakpointServiceEvent;
9115
9205
  (function (BootstrapBreakpointServiceEvent) {
9116
9206
  BootstrapBreakpointServiceEvent["CHANGED"] = "CHANGED";
@@ -9685,5 +9775,5 @@ class TransportLazyModule {
9685
9775
  * Generated bundle index. Do not edit.
9686
9776
  */
9687
9777
 
9688
- 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 };
9778
+ 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 };
9689
9779
  //# sourceMappingURL=ts-core-angular.mjs.map