@dbg-riskit/angular-login 12.3.0 → 13.0.3

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.
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
+ /// <amd-module name="@dbg-riskit/angular-login" />
4
5
  export * from './public_api';
package/docs/README.md CHANGED
@@ -2,24 +2,14 @@
2
2
  ![lint-bash](https://github.deutsche-boerse.de/dev/risk-angular-common/workflows/lint-bash/badge.svg?event=push)
3
3
  ![lint-docker](https://github.deutsche-boerse.de/dev/risk-angular-common/workflows/lint-docker/badge.svg?event=push)
4
4
 
5
- # risk-angular-common (Angular 12 and @angular/material based library for RiskIT applications)
5
+ # risk-angular-common (Angular 13 and @angular/material based library for RiskIT applications)
6
6
 
7
7
  Used by:
8
8
  - [dev/DAVe-UI](https://github.deutsche-boerse.de/dev/DAVe-UI)
9
9
  - [dev/DAVe-MarginEstimator-UI](https://github.deutsche-boerse.de/dev/DAVe-MarginEstimator-UI)
10
- - [dev/prisma-gui](https://github.deutsche-boerse.de/dev/prisma-gui)
11
10
  - [dev/MDH-UI](https://github.deutsche-boerse.de/dev/MDH-UI)
12
11
  - [RiskIT/openid-k8s-token-generator](https://github.deutsche-boerse.de/RiskIT/openid-k8s-token-generator)
13
12
 
14
- ## Browser support (tested via [BrowserStack](https://www.browserstack.com))
15
- | ![Chrome](https://cdn1.iconfinder.com/data/icons/google_jfk_icons_by_carlosjj/32/chrome.png) Chrome | ![Firefox](https://cdn2.iconfinder.com/data/icons/humano2/32x32/apps/firefox-icon.png) Firefox | ![Edge](https://cdn4.iconfinder.com/data/icons/picons-social/57/56-edge-2-32.png) Edge | ![IE](https://cdn4.iconfinder.com/data/icons/iconsimple-logotypes/512/internet_explorer-32.png) IE | ![Safari](https://cdn1.iconfinder.com/data/icons/logotypes/32/safari-32.png) Safari | ![iOS](https://cdn1.iconfinder.com/data/icons/system-shade-circles/512/iOS-32.png) iOS |
16
- |:------:|:-------:|:----:|:------:|:------:|:-------:|
17
- | Latest | Latest | 16 | 11 | 11.1 | 9.1+\* |
18
- | 50 | 50 | 15 | 10\* | 10.1 | |
19
- | | | | | 9.1 | |
20
-
21
- \* In IE 10 and iOS the application is working, but with layout issues.
22
-
23
13
  ## Packages
24
14
 
25
15
  To use in your application add the following packages into your app:
@@ -0,0 +1,80 @@
1
+ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
2
+ import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
3
+ import { toErrorMessage } from '@dbg-riskit/angular-error';
4
+ import { BaseComponent } from '@dbg-riskit/angular-view';
5
+ import { first, takeUntil } from 'rxjs/operators';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@dbg-riskit/angular-auth";
8
+ import * as i2 from "@dbg-riskit/angular-view";
9
+ import * as i3 from "@angular/material/card";
10
+ import * as i4 from "@angular/material/form-field";
11
+ import * as i5 from "@angular/material/button";
12
+ import * as i6 from "@angular/material/progress-spinner";
13
+ import * as i7 from "@angular/material/icon";
14
+ import * as i8 from "@angular/common";
15
+ import * as i9 from "@angular/forms";
16
+ import * as i10 from "@angular/material/input";
17
+ export class LoginComponent extends BaseComponent {
18
+ constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
19
+ super();
20
+ this.authProvider = authProvider;
21
+ this.changeDetectorRef = changeDetectorRef;
22
+ this.authRoutingFlowService = authRoutingFlowService;
23
+ this.secondaryLogo = secondaryLogo;
24
+ /**
25
+ * Control for "login button-to-spinner".
26
+ */
27
+ this.loggingIn = false;
28
+ // Update component state on login status change
29
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
30
+ }
31
+ ngAfterViewInit() {
32
+ this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
33
+ this.changeDetectorRef.markForCheck();
34
+ }, (err) => {
35
+ this.errorMessage = toErrorMessage(err).message;
36
+ this.changeDetectorRef.markForCheck();
37
+ });
38
+ }
39
+ get isDirectFlow() {
40
+ return this.authRoutingFlowService.directFlow;
41
+ }
42
+ get authStatus() {
43
+ return this.authProvider.loggedIn;
44
+ }
45
+ get userProfile() {
46
+ return this.authProvider.userProfile;
47
+ }
48
+ login() {
49
+ this.loggingIn = true;
50
+ this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
51
+ if (!res) {
52
+ this.errorMessage = 'Authentication failed. Server did not generate a token.';
53
+ }
54
+ this.loggingIn = false;
55
+ this.changeDetectorRef.markForCheck();
56
+ }, () => {
57
+ this.loggingIn = false;
58
+ this.errorMessage = 'Authentication failed. Is the username and password correct?';
59
+ this.changeDetectorRef.markForCheck();
60
+ });
61
+ }
62
+ get logo() {
63
+ return this.secondaryLogo;
64
+ }
65
+ }
66
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component });
67
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-card-title-group{margin:0}.mat-card-title-group .mat-card-title{font-weight:500}.mat-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], components: [{ type: i2.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { type: i2.FlexSpacerComponent, selector: "risk-flex-spacer" }, { type: i2.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { type: i3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i3.MatCardTitleGroup, selector: "mat-card-title-group" }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i3.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }], pipes: { "async": i8.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginComponent, decorators: [{
69
+ type: Component,
70
+ args: [{ host: {
71
+ '[class.risk-login-form]': 'true'
72
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-card-title-group{margin:0}.mat-card-title-group .mat-card-title{font-weight:500}.mat-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
73
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
74
+ type: Inject,
75
+ args: [AUTH_PROVIDER]
76
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
77
+ type: Inject,
78
+ args: [SECONDARY_LOGO]
79
+ }] }]; } });
80
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3BrZy9kYmctcmlza2l0L2FuZ3VsYXItbG9naW4vc3JjL2xpYi9sb2dpbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWdCLHVCQUF1QixFQUFxQixTQUFTLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRzNHLE9BQU8sRUFBQyxhQUFhLEVBQUUsY0FBYyxFQUFDLE1BQU0sNEJBQTRCLENBQUM7QUFDekUsT0FBTyxFQUFhLGNBQWMsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQU8sRUFBQyxhQUFhLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUl2RCxPQUFPLEVBQUMsS0FBSyxFQUFFLFNBQVMsRUFBQyxNQUFNLGdCQUFnQixDQUFDOzs7Ozs7Ozs7Ozs7QUFjaEQsTUFBTSxPQUFPLGNBQWUsU0FBUSxhQ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ICAgICAgICAgICAgIHByaXZhdGUgcmVhZG9ubHkgYXV0aFJvdXRpbmdGbG93U2VydmljZTogQXV0aFJvdXRpbmdGbG93U2VydmljZSxcbiAgICAgICAgICAgICAgICAgICAgICAgQEluamVjdChTRUNPTkRBUllfTE9HTykgcHJpdmF0ZSByZWFkb25seSBzZWNvbmRhcnlMb2dvOiBzdHJpbmcpIHtcbiAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgLy8gVXBkYXRlIGNvbXBvbmVudCBzdGF0ZSBvbiBsb2dpbiBzdGF0dXMgY2hhbmdlXG4gICAgICAgIHRoaXMuYXV0aFByb3ZpZGVyLmxvZ2dlZEluU3RyZWFtLnBpcGUoXG4gICAgICAgICAgICB0YWtlVW50aWwodGhpcy5kZXN0cm95ZWQpXG4gICAgICAgICkuc3Vic2NyaWJlKCgpID0+IHRoaXMuY2hhbmdlRGV0ZWN0b3JSZWYubWFya0ZvckNoZWNrKCkpO1xuICAgIH1cblxuICAgIHB1YmxpYyBuZ0FmdGVyVmlld0luaXQoKTogdm9pZCB7XG4gICAgICAgIHRoaXMuYXV0aFJvdXRpbmdGbG93U2VydmljZS5sb2dpblZpYVNlcnZpY2UoKS5waXBlKFxuICAgICAgICAgICAgdGFrZVVudGlsKHRoaXMuZGVzdHJveWVkKVxuICAgICAgICApLnN1YnNjcmliZShcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIChlcnI6IEVycm9yVHlwZXMpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9yTWVzc2FnZSA9IHRvRXJyb3JNZXNzYWdlKGVycikubWVzc2FnZTtcbiAgICAgICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuIC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gICAgICAgICAgIHRoaXMubG9nZ2luZ0luID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgdGhpcy5lcnJvck1lc3NhZ2UgPSAnQXV0aGVudGljYXRpb24gZmFpbGVkLiBJcyB0aGUgdXNlcm5hbWUgYW5kIHBhc3N3b3JkIGNvcnJlY3Q/JztcbiAgICAgICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXQgbG9nbygpOiBzdHJpbmcge1xuICAgICAgICByZXR1cm4gdGhpcy5zZWNvbmRhcnlMb2dvO1xuICAgIH1cbn1cbiIsIjxyaXNrLWZsZXg+XG4gICAgPHJpc2stZmxleC1zcGFjZXI+PC9yaXNrLWZsZXgtc3BhY2VyPlxuXG4gICAgPGRpdiAqbmdJZj1cImlzRGlyZWN0Rmxvd1wiPlxuICAgICAgICA8bmctdGVtcGxhdGUgI2xvZ2dlZE91dD5cbiAgICAgICAgICAgIDxyaXNrLWVycm9yICpuZ0lmPVwiZXJyb3JNZXNzYWdlXCIgW21lc3NhZ2VdPVwiZXJyb3JNZXNzYWdlXCI+PC9yaXNrLWVycm9yPlxuXG4gICAgICAgICAgICA8Zm9ybSAobmdTdWJtaXQpPVwibG9naW4oKVwiIHJvbGU9XCJmb3JtXCI+XG4gICAgICAgICAgICAgICAgPG1hdC1jYXJkPlxuICAgICAgICAgICAgICAgICAgICA8bWF0LWNhcmQtdGl0bGUtZ3JvdXA+XG4gICAgICAgICAgICAgICAgICAgICAgICA8bWF0LWNhcmQtdGl0bGU+UGxlYXNlIFNpZ24gSW48L21hdC1jYXJkLXRpdGxlPlxuICAgICAgICAgICAgICAgICAgICA8L21hdC1jYXJkLXRpdGxlLWdyb3VwPlxuICAgICAgICAgICAgICAgICAgICA8bWF0LWNhcmQtY29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBjbGFzcz1cInJpc2stZnVsbC13aWR0aFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwidGV4dFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiVXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwidXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbKG5nTW9kZWwpXT1cInVzZXJuYW1lXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b2ZvY3VzPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBjbGFzcz1cInJpc2stZnVsbC13aWR0aFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwicGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIlBhc3N3b3JkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZT1cInBhc3N3b3JkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyhuZ01vZGVsKV09XCJwYXNzd29yZFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgPC9tYXQtY2FyZC1jb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8bWF0LWNhcmQtYWN0aW9ucz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gKm5nSWY9XCIhbG9nZ2luZ0luXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0LXJhaXNlZC1idXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I9XCJwcmltYXJ5XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInN1Ym1pdFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNpZ24gaW5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGltZyBbc3JjXT1cImxvZ29cIiBhbHQ9XCJDb21wYW55IGxvZ29cIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtc3Bpbm5lciAqbmdJZj1cImxvZ2dpbmdJblwiIFtkaWFtZXRlcl09XCIzNlwiPjwvbWF0LXNwaW5uZXI+XG4gICAgICAgICAgICAgICAgICAgIDwvbWF0LWNhcmQtYWN0aW9ucz5cbiAgICAgICAgICAgICAgICA8L21hdC1jYXJkPlxuICAgICAgICAgICAgPC9mb3JtPlxuICAgICAgICA8L25nLXRlbXBsYXRlPlxuXG4gICAgICAgIDxuZy10ZW1wbGF0ZSBbbmdJZl09XCJhdXRoU3RhdHVzIHwgYXN5bmNcIiBbbmdJZkVsc2VdPVwibG9nZ2VkT3V0XCI+XG4gICAgICAgICAgICA8bmctdGVtcGxhdGUgW25nSWZdPVwidXNlclByb2ZpbGUgfCBhc3luY1wiIGxldC11c2VyPVwibmdJZlwiPlxuICAgICAgICAgICAgICAgIDxyaXNrLWdvb2QgKm5nSWY9XCJ1c2VyPy5uYW1lXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFttZXNzYWdlXT1cIidTdWNjZXNzZnVsbHkgbG9nZ2VkIGluIGFzICcgKyB1c2VyLm5hbWUgKyAnLidcIj48L3Jpc2stZ29vZD5cbiAgICAgICAgICAgICAgICA8cmlzay1nb29kICpuZ0lmPVwiIXVzZXIgJiYgIXV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ck1lc3NhZ2V9fTwvaDM+XG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwicmlzay1sb2dpbi1mb3JtLWZsZXgtd3JhcHBlclwiPlxuICAgICAgICAgICAgICAgIDxkaXY+PC9kaXY+XG4gICAgICAgICAgICAgICAgPGJ1dHRvbiBtYXQtYnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICAoY2xpY2spPVwibG9naW4oKVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xvcj1cInByaW1hcnlcIlxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiPlxuICAgICAgICAgICAgICAgICAgICA8bWF0LWljb24+YXV0b3JlbmV3PC9tYXQtaWNvbj5cbiAgICAgICAgICAgICAgICAgICAgUmV0cnlcbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8ZGl2PjwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvbmctdGVtcGxhdGU+XG4gICAgPC9kaXY+XG5cbiAgICA8cmlzay1mbGV4LXNwYWNlcj48L3Jpc2stZmxleC1zcGFjZXI+XG48L3Jpc2stZmxleD5cbiJdfQ==
@@ -0,0 +1,83 @@
1
+ import { ChangeDetectionStrategy, Component, Directive, HostBinding, Inject, Input } from '@angular/core';
2
+ import { AUTH_PROVIDER } from '@dbg-riskit/angular-common';
3
+ import { BaseComponent } from '@dbg-riskit/angular-view';
4
+ import { first, takeUntil } from 'rxjs/operators';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@dbg-riskit/angular-auth";
7
+ import * as i2 from "@angular/material/menu";
8
+ import * as i3 from "@angular/material/icon";
9
+ import * as i4 from "@angular/material/button";
10
+ import * as i5 from "@angular/common";
11
+ export class LoginMenuComponentTitleDirective {
12
+ }
13
+ LoginMenuComponentTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
14
+ LoginMenuComponentTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
16
+ type: Directive,
17
+ args: [{
18
+ selector: 'risk-login-menu-title-horizontal, '
19
+ + 'risk-login-menu-title-vertical',
20
+ host: {
21
+ '[class.risk-login-menu-title]': 'true'
22
+ }
23
+ }]
24
+ }] });
25
+ export class LoginMenuItemsDirective {
26
+ }
27
+ LoginMenuItemsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
+ LoginMenuItemsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 });
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
30
+ type: Directive,
31
+ args: [{
32
+ selector: 'risk-login-menu-before-items-horizontal,'
33
+ + ' risk-login-menu-before-items-vertical,'
34
+ + 'risk-login-menu-after-items-horizontal,'
35
+ + 'risk-login-menu-after-items-vertical'
36
+ }]
37
+ }] });
38
+ export class LoginMenuComponent extends BaseComponent {
39
+ constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
40
+ super();
41
+ this.authProvider = authProvider;
42
+ this.authRoutingFlowService = authRoutingFlowService;
43
+ this.changeDetectorRef = changeDetectorRef;
44
+ this.orientation = 'row';
45
+ // Update menu state on login status change
46
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
47
+ }
48
+ get isRow() {
49
+ return this.orientation === 'row';
50
+ }
51
+ get isColumn() {
52
+ return this.orientation === 'column';
53
+ }
54
+ menuClosed() {
55
+ this.changeDetectorRef.markForCheck();
56
+ }
57
+ get authStatus() {
58
+ return this.authProvider.loggedIn;
59
+ }
60
+ logout() {
61
+ this.authRoutingFlowService.logout().pipe(first()).subscribe();
62
+ }
63
+ }
64
+ LoginMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
65
+ LoginMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:bold;margin:0 5px}\n"], components: [{ type: i2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], pipes: { "async": i5.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponent, decorators: [{
67
+ type: Component,
68
+ args: [{ selector: 'risk-login-menu', host: {
69
+ '[class.risk-login-menu]': 'true'
70
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:bold;margin:0 5px}\n"] }]
71
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
72
+ type: Inject,
73
+ args: [AUTH_PROVIDER]
74
+ }] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orientation: [{
75
+ type: Input
76
+ }], isRow: [{
77
+ type: HostBinding,
78
+ args: ['class.risk-login-menu-flex-row']
79
+ }], isColumn: [{
80
+ type: HostBinding,
81
+ args: ['class.risk-login-menu-flex-column']
82
+ }] } });
83
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4ubWVudS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wa2cvZGJnLXJpc2tpdC9hbmd1bGFyLWxvZ2luL3NyYy9saWIvbG9naW4ubWVudS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wa2cvZGJnLXJpc2tpdC9hbmd1bGFyLWxvZ2luL3NyYy9saWIvbG9naW4ubWVudS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0gsdUJBQXVCLEVBRXZCLFNBQVMsRUFDVCxTQUFTLEVBQ1QsV0FBVyxFQUNYLE1BQU0sRUFDTixLQUFLLEVBQ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Txib29sZWFuPiB7XG4gICAgICAgIHJldHVybiB0aGlzLmF1dGhQcm92aWRlci5sb2dnZWRJbjtcbiAgICB9XG5cbiAgICBwdWJsaWMgbG9nb3V0KCk6IHZvaWQge1xuICAgICAgICB0aGlzLmF1dGhSb3V0aW5nRmxvd1NlcnZpY2UubG9nb3V0KCkucGlwZShcbiAgICAgICAgICAgIGZpcnN0KClcbiAgICAgICAgKS5zdWJzY3JpYmUoKTtcbiAgICB9XG59XG4iLCI8bmctdGVtcGxhdGUgW25nSWZdPVwib3JpZW50YXRpb24gPT09ICdyb3cnXCI+XG4gICAgPG1hdC1tZW51ICNsb2dpbk1lbnU9XCJtYXRNZW51XCJcbiAgICAgICAgICAgICAgW292ZXJsYXBUcmlnZ2VyXT1cImZhbHNlXCI+XG4gICAgICAgIDxuZy1jb250ZW50IHNlbGVjdD1cInJpc2stbG9naW4tbWVudS1iZWZvcmUtaXRlbXMtaG9yaXpvbnRhbFwiPjwvbmctY29udGVudD5cbiAgICAgICAgPG5nLXRlbXBsYXRlIFtuZ0lmXT1cImF1dGhTdGF0dXMgfCBhc3luY1wiIFtuZ0lmRWxzZV09XCJsb2dnZWRPdXRcIj5cbiAgICAgICAgICAgIDxidXR0b24gbWF0LW1lbnUtaXRlbVxuICAgICAgICAgICAgICAgICAgICAoY2xpY2spPVwibG9nb3V0KClcIlxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCI+XG4gICAgICAgICAgICAgICAgPG1hdC1pY29uPmV4aXRfdG9fYXBwPC9tYXQtaWNvbj5cbiAgICAgICAgICAgICAgICBMb2dvdXRcbiAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICA8L25nLXRlbXBsYXRlPlxuICAgICAgICA8bmctdGVtcGxhdGUgI2xvZ2dlZE91dD5cbiAgICAgICAgICAgIDxidXR0b24gbWF0LW1lbnUtaXRlbVxuICAgICAgICAgICAgICAgICAgICAoY2xpY2spPVwibG9nb3V0KClcIlxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCI+XG4gICAgICAgICAgICAgICAgPG1hdC1pY29uPmxhdW5jaDwvbWF0LWljb24+XG4gICAgICAgICAgICAgICAgTG9naW5cbiAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICA8L25nLXRlbXBsYXRlPlxuICAgICAgICA8bmctY29udGVudCBzZWxlY3Q9XCJyaXNrLWxvZ2luLW1lbnUtYWZ0ZXItaXRlbXMtaG9yaXpvbnRhbFwiPjwvbmctY29udGVudD5cbiAgICA8L21hdC1tZW51PlxuICAgIDxidXR0b24gbWF0LWJ1dHRvblxuICAgICAgICAgICAgI21lbnU9XCJtYXRNZW51VHJpZ2dlclwiXG4gICAgICAgICAgICBbbWF0TWVudVRyaWdnZXJGb3JdPVwibG9naW5NZW51XCJcbiAgICAgICAgICAgIFtjbGFzcy5yaXNrLW1lbnUtb3Blbl09XCJtZW51Lm1lbnVPcGVuXCJcbiAgICAgICAgICAgIChvbk1lbnVDbG9zZSk9XCJtZW51Q2xvc2VkKClcIlxuICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiPlxuICAgICAgICA8bmctY29udGVudCBzZWxlY3Q9XCJyaXNrLWxvZ2luLW1lbnUtdGl0bGUtaG9yaXpvbnRhbFwiPjwvbmctY29udGVudD5cbiAgICAgICAgPG1hdC1pY29uPnBlcnNvbjwvbWF0LWljb24+XG4gICAgPC9idXR0b24+XG48L25nLXRlbXBsYXRlPlxuXG48bmctdGVtcGxhdGUgW25nSWZdPVwib3JpZW50YXRpb24gPT09ICdjb2x1bW4nXCI+XG4gICAgPG5nLWNvbnRlbnQgc2VsZWN0PVwicmlzay1sb2dpbi1tZW51LXRpdGxlLXZlcnRpY2FsXCI+PC9uZy1jb250ZW50PlxuICAgIDxuZy1jb250ZW50IHNlbGVjdD1cInJpc2stbG9naW4tbWVudS1iZWZvcmUtaXRlbXMtdmVydGljYWxcIj48L25nLWNvbnRlbnQ+XG4gICAgPG5nLXRlbXBsYXRlIFtuZ0lmXT1cImF1dGhTdGF0dXMgfCBhc3luY1wiIFtuZ0lmRWxzZV09XCJsb2dnZWRPdXQyXCI+XG4gICAgICAgIDxhIG1hdC1idXR0b25cbiAgICAgICAgICAgKGNsaWNrKT1cImxvZ291dCgpXCI+XG4gICAgICAgICAgICA8bWF0LWljb24+ZXhpdF90b19hcHA8L21hdC1pY29uPlxuICAgICAgICAgICAgTG9nb3V0XG4gICAgICAgIDwvYT5cbiAgICA8L25nLXRlbXBsYXRlPlxuICAgIDxuZy10ZW1wbGF0ZSAjbG9nZ2VkT3V0Mj5cbiAgICAgICAgPGEgbWF0LWJ1dHRvblxuICAgICAgICAgICAoY2xpY2spPVwibG9nb3V0KClcIj5cbiAgICAgICAgICAgIDxtYXQtaWNvbj5sYXVuY2g8L21hdC1pY29uPlxuICAgICAgICAgICAgTG9naW5cbiAgICAgICAgPC9hPlxuICAgIDwvbmctdGVtcGxhdGU+XG4gICAgPG5nLWNvbnRlbnQgc2VsZWN0PVwicmlzay1sb2dpbi1tZW51LWFmdGVyLWl0ZW1zLXZlcnRpY2FsXCI+PC9uZy1jb250ZW50PlxuPC9uZy10ZW1wbGF0ZT5cbiJdfQ==
@@ -0,0 +1,53 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { RouterModule } from '@angular/router';
5
+ import { AuthModule } from '@dbg-riskit/angular-auth';
6
+ import { CommonViewModule } from '@dbg-riskit/angular-view';
7
+ import { LoginComponent } from './login.component';
8
+ import { LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective } from './login.menu.component';
9
+ import * as i0 from "@angular/core";
10
+ export class LoginModule {
11
+ }
12
+ LoginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13
+ LoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
14
+ LoginComponent,
15
+ LoginMenuComponentTitleDirective,
16
+ LoginMenuItemsDirective], imports: [CommonModule,
17
+ FormsModule,
18
+ RouterModule,
19
+ AuthModule,
20
+ CommonViewModule], exports: [LoginMenuComponent,
21
+ LoginMenuComponentTitleDirective,
22
+ LoginMenuItemsDirective] });
23
+ LoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, imports: [[
24
+ CommonModule,
25
+ FormsModule,
26
+ RouterModule,
27
+ AuthModule,
28
+ CommonViewModule
29
+ ]] });
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, decorators: [{
31
+ type: NgModule,
32
+ args: [{
33
+ imports: [
34
+ CommonModule,
35
+ FormsModule,
36
+ RouterModule,
37
+ AuthModule,
38
+ CommonViewModule
39
+ ],
40
+ declarations: [
41
+ LoginMenuComponent,
42
+ LoginComponent,
43
+ LoginMenuComponentTitleDirective,
44
+ LoginMenuItemsDirective
45
+ ],
46
+ exports: [
47
+ LoginMenuComponent,
48
+ LoginMenuComponentTitleDirective,
49
+ LoginMenuItemsDirective
50
+ ]
51
+ }]
52
+ }] });
53
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4ubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUN2Qyx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N0aXZlXG4gICAgXSxcbiAgICBleHBvcnRzICAgICA6IFtcbiAgICAgICAgTG9naW5NZW51Q29tcG9uZW50LFxuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnRUaXRsZURpcmVjdGl2ZSxcbiAgICAgICAgTG9naW5NZW51SXRlbXNEaXJlY3RpdmVcbiAgICBdXG59KVxuZXhwb3J0IGNsYXNzIExvZ2luTW9kdWxlIHtcbn1cbiJdfQ==
@@ -0,0 +1,212 @@
1
+ import * as i8 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, Inject, Directive, Input, HostBinding, NgModule } from '@angular/core';
5
+ import * as i9 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i1 from '@dbg-riskit/angular-auth';
9
+ import { AuthModule } from '@dbg-riskit/angular-auth';
10
+ import * as i2 from '@dbg-riskit/angular-view';
11
+ import { BaseComponent, CommonViewModule } from '@dbg-riskit/angular-view';
12
+ import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
13
+ import { toErrorMessage } from '@dbg-riskit/angular-error';
14
+ import { takeUntil, first } from 'rxjs/operators';
15
+ import * as i3 from '@angular/material/card';
16
+ import * as i4 from '@angular/material/form-field';
17
+ import * as i4$1 from '@angular/material/button';
18
+ import * as i6 from '@angular/material/progress-spinner';
19
+ import * as i7 from '@angular/material/icon';
20
+ import * as i10 from '@angular/material/input';
21
+ import * as i2$1 from '@angular/material/menu';
22
+
23
+ class LoginComponent extends BaseComponent {
24
+ constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
25
+ super();
26
+ this.authProvider = authProvider;
27
+ this.changeDetectorRef = changeDetectorRef;
28
+ this.authRoutingFlowService = authRoutingFlowService;
29
+ this.secondaryLogo = secondaryLogo;
30
+ /**
31
+ * Control for "login button-to-spinner".
32
+ */
33
+ this.loggingIn = false;
34
+ // Update component state on login status change
35
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
36
+ }
37
+ ngAfterViewInit() {
38
+ this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
39
+ this.changeDetectorRef.markForCheck();
40
+ }, (err) => {
41
+ this.errorMessage = toErrorMessage(err).message;
42
+ this.changeDetectorRef.markForCheck();
43
+ });
44
+ }
45
+ get isDirectFlow() {
46
+ return this.authRoutingFlowService.directFlow;
47
+ }
48
+ get authStatus() {
49
+ return this.authProvider.loggedIn;
50
+ }
51
+ get userProfile() {
52
+ return this.authProvider.userProfile;
53
+ }
54
+ login() {
55
+ this.loggingIn = true;
56
+ this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
57
+ if (!res) {
58
+ this.errorMessage = 'Authentication failed. Server did not generate a token.';
59
+ }
60
+ this.loggingIn = false;
61
+ this.changeDetectorRef.markForCheck();
62
+ }, () => {
63
+ this.loggingIn = false;
64
+ this.errorMessage = 'Authentication failed. Is the username and password correct?';
65
+ this.changeDetectorRef.markForCheck();
66
+ });
67
+ }
68
+ get logo() {
69
+ return this.secondaryLogo;
70
+ }
71
+ }
72
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component });
73
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-card-title-group{margin:0}.mat-card-title-group .mat-card-title{font-weight:500}.mat-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], components: [{ type: i2.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { type: i2.FlexSpacerComponent, selector: "risk-flex-spacer" }, { type: i2.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { type: i3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i3.MatCardTitleGroup, selector: "mat-card-title-group" }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i3.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }], pipes: { "async": i8.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginComponent, decorators: [{
75
+ type: Component,
76
+ args: [{ host: {
77
+ '[class.risk-login-form]': 'true'
78
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-card-title-group{margin:0}.mat-card-title-group .mat-card-title{font-weight:500}.mat-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
79
+ }], ctorParameters: function () {
80
+ return [{ type: undefined, decorators: [{
81
+ type: Inject,
82
+ args: [AUTH_PROVIDER]
83
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
84
+ type: Inject,
85
+ args: [SECONDARY_LOGO]
86
+ }] }];
87
+ } });
88
+
89
+ class LoginMenuComponentTitleDirective {
90
+ }
91
+ LoginMenuComponentTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
92
+ LoginMenuComponentTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 });
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
94
+ type: Directive,
95
+ args: [{
96
+ selector: 'risk-login-menu-title-horizontal, '
97
+ + 'risk-login-menu-title-vertical',
98
+ host: {
99
+ '[class.risk-login-menu-title]': 'true'
100
+ }
101
+ }]
102
+ }] });
103
+ class LoginMenuItemsDirective {
104
+ }
105
+ LoginMenuItemsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
106
+ LoginMenuItemsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 });
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
108
+ type: Directive,
109
+ args: [{
110
+ selector: 'risk-login-menu-before-items-horizontal,'
111
+ + ' risk-login-menu-before-items-vertical,'
112
+ + 'risk-login-menu-after-items-horizontal,'
113
+ + 'risk-login-menu-after-items-vertical'
114
+ }]
115
+ }] });
116
+ class LoginMenuComponent extends BaseComponent {
117
+ constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
118
+ super();
119
+ this.authProvider = authProvider;
120
+ this.authRoutingFlowService = authRoutingFlowService;
121
+ this.changeDetectorRef = changeDetectorRef;
122
+ this.orientation = 'row';
123
+ // Update menu state on login status change
124
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
125
+ }
126
+ get isRow() {
127
+ return this.orientation === 'row';
128
+ }
129
+ get isColumn() {
130
+ return this.orientation === 'column';
131
+ }
132
+ menuClosed() {
133
+ this.changeDetectorRef.markForCheck();
134
+ }
135
+ get authStatus() {
136
+ return this.authProvider.loggedIn;
137
+ }
138
+ logout() {
139
+ this.authRoutingFlowService.logout().pipe(first()).subscribe();
140
+ }
141
+ }
142
+ LoginMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
143
+ LoginMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:bold;margin:0 5px}\n"], components: [{ type: i2$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i2$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], pipes: { "async": i8.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponent, decorators: [{
145
+ type: Component,
146
+ args: [{ selector: 'risk-login-menu', host: {
147
+ '[class.risk-login-menu]': 'true'
148
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:bold;margin:0 5px}\n"] }]
149
+ }], ctorParameters: function () {
150
+ return [{ type: undefined, decorators: [{
151
+ type: Inject,
152
+ args: [AUTH_PROVIDER]
153
+ }] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }];
154
+ }, propDecorators: { orientation: [{
155
+ type: Input
156
+ }], isRow: [{
157
+ type: HostBinding,
158
+ args: ['class.risk-login-menu-flex-row']
159
+ }], isColumn: [{
160
+ type: HostBinding,
161
+ args: ['class.risk-login-menu-flex-column']
162
+ }] } });
163
+
164
+ class LoginModule {
165
+ }
166
+ LoginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
167
+ LoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
168
+ LoginComponent,
169
+ LoginMenuComponentTitleDirective,
170
+ LoginMenuItemsDirective], imports: [CommonModule,
171
+ FormsModule,
172
+ RouterModule,
173
+ AuthModule,
174
+ CommonViewModule], exports: [LoginMenuComponent,
175
+ LoginMenuComponentTitleDirective,
176
+ LoginMenuItemsDirective] });
177
+ LoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, imports: [[
178
+ CommonModule,
179
+ FormsModule,
180
+ RouterModule,
181
+ AuthModule,
182
+ CommonViewModule
183
+ ]] });
184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, decorators: [{
185
+ type: NgModule,
186
+ args: [{
187
+ imports: [
188
+ CommonModule,
189
+ FormsModule,
190
+ RouterModule,
191
+ AuthModule,
192
+ CommonViewModule
193
+ ],
194
+ declarations: [
195
+ LoginMenuComponent,
196
+ LoginComponent,
197
+ LoginMenuComponentTitleDirective,
198
+ LoginMenuItemsDirective
199
+ ],
200
+ exports: [
201
+ LoginMenuComponent,
202
+ LoginMenuComponentTitleDirective,
203
+ LoginMenuItemsDirective
204
+ ]
205
+ }]
206
+ }] });
207
+
208
+ /**
209
+ * Generated bundle index. Do not edit.
210
+ */
211
+
212
+ export { LoginComponent, LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective, LoginModule };