@dbg-riskit/angular-login 9999.9999.9999-rc.12148 → 9999.9999.9999-rc.1582647
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.
- package/esm2022/lib/login.component.mjs +80 -0
- package/esm2022/lib/login.menu.component.mjs +83 -0
- package/esm2022/lib/login.module.mjs +51 -0
- package/fesm2022/dbg-riskit-angular-login.mjs +207 -0
- package/fesm2022/dbg-riskit-angular-login.mjs.map +1 -0
- package/lib/login.component.d.ts +1 -1
- package/lib/login.menu.component.d.ts +3 -3
- package/package.json +17 -23
- package/esm2020/lib/login.component.mjs +0 -80
- package/esm2020/lib/login.menu.component.mjs +0 -83
- package/esm2020/lib/login.module.mjs +0 -53
- package/fesm2015/dbg-riskit-angular-login.mjs +0 -212
- package/fesm2015/dbg-riskit-angular-login.mjs.map +0 -1
- package/fesm2020/dbg-riskit-angular-login.mjs +0 -208
- package/fesm2020/dbg-riskit-angular-login.mjs.map +0 -1
- /package/{esm2020 → esm2022}/dbg-riskit-angular-login.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{dbg-riskit-angular-login.d.ts → index.d.ts} +0 -0
|
@@ -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 "@angular/common";
|
|
9
|
+
import * as i3 from "@angular/forms";
|
|
10
|
+
import * as i4 from "@dbg-riskit/angular-view";
|
|
11
|
+
import * as i5 from "@angular/material/button";
|
|
12
|
+
import * as i6 from "@angular/material/card";
|
|
13
|
+
import * as i7 from "@angular/material/form-field";
|
|
14
|
+
import * as i8 from "@angular/material/icon";
|
|
15
|
+
import * as i9 from "@angular/material/input";
|
|
16
|
+
import * as i10 from "@angular/material/progress-spinner";
|
|
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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
66
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\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 <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\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-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{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"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { kind: "component", type: i4.FlexSpacerComponent, selector: "risk-flex-spacer" }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\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 <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\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-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{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: () => [{ 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3BrZy9kYmctcmlza2l0L2FuZ3VsYXItbG9naW4vc3JjL2xpYi9sb2dpbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWdCLHVCQUF1QixFQUFxQixTQUFTLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRzNHLE9BQU8sRUFBQyxhQUFhLEVBQUUsY0FBYyxFQUFDLE1BQU0sNEJBQTRCLENBQUM7QUFDekUsT0FBTyxFQUFhLGNBQWMsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQU8sRUFBQyxhQUFhLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUl2RCxPQUFPLEVBQUMsS0FBSyxFQUFFLFNBQVMsRUFBQyxNQUFNLGdCQUFnQixDQUFDOzs7Ozs7Ozs7Ozs7QUFjaEQsTUFBTSxPQUFPLGNBQWUsU0FBUSxhQUFhO0lBc0I3QyxZQUEyRCxZQUEwQixFQUNqRCxpQkFBb0MsRUFDcEMsc0JBQThDLEVBQ3RCLGFBQXFCO1FBQzdFLEtBQUssRUFBRSxDQUFDO1FBSitDLGlCQUFZL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XRpbmdGbG93U2VydmljZS5kaXJlY3RGbG93O1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXQgYXV0aFN0YXR1cygpOiBPYnNlcnZhYmxlPGJvb2xlYW4+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYXV0aFByb3ZpZGVyLmxvZ2dlZEluO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXQgdXNlclByb2ZpbGUoKTogT2JzZXJ2YWJsZTxVc2VySW5mbyB8IHVuZGVmaW5lZD4ge1xuICAgICAgICByZXR1cm4gdGhpcy5hdXRoUHJvdmlkZXIudXNlclByb2ZpbGU7XG4gICAgfVxuXG4gICAgcHVibGljIGxvZ2luKCk6IHZvaWQge1xuICAgICAgICB0aGlzLmxvZ2dpbmdJbiA9IHRydWU7XG4gICAgICAgIHRoaXMuYXV0aFJvdXRpbmdGbG93U2VydmljZS5sb2dpbih0aGlzLnVzZXJuYW1lLCB0aGlzLnBhc3N3b3JkKS5waXBlKFxuICAgICAgICAgICAgZmlyc3QoKVxuICAgICAgICApLnN1YnNjcmliZShcbiAgICAgICAgICAgIChyZXM6IGJvb2xlYW4pID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlcykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmVycm9yTWVzc2FnZSA9ICdBdXRoZW50aWNhdGlvbiBmYWlsZWQuIFNlcnZlciBkaWQgbm90IGdlbmVyYXRlIGEgdG9rZW4uJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5sb2dnaW5nSW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dpbmdJbiA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHRoaXMuZXJyb3JNZXNzYWdlID0gJ0F1dGhlbnR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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwidGV4dFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiVXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwidXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbKG5nTW9kZWwpXT1cInVzZXJuYW1lXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b2ZvY3VzPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtZm9ybS1maWVsZCBjbGFzcz1cInJpc2stZnVsbC13aWR0aFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBtYXRJbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwicGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIlBhc3N3b3JkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZT1cInBhc3N3b3JkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyhuZ01vZGVsKV09XCJwYXNzd29yZFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgICAgICAgICAgICAgPC9tYXQtY2FyZC1jb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8bWF0LWNhcmQtYWN0aW9ucz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gKm5nSWY9XCIhbG9nZ2luZ0luXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0LXJhaXNlZC1idXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I9XCJwcmltYXJ5XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cInN1Ym1pdFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNpZ24gaW5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1zcGlubmVyICpuZ0lmPVwibG9nZ2luZ0luXCIgW2RpYW1ldGVyXT1cIjM2XCI+PC9tYXQtc3Bpbm5lcj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxyaXNrLWZsZXgtc3BhY2VyPjwvcmlzay1mbGV4LXNwYWNlcj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxpbWcgW3NyY109XCJsb2dvXCIgYWx0PVwiQ29tcGFueSBsb2dvXCI+XG4gICAgICAgICAgICAgICAgICAgIDwvbWF0LWNhcmQtYWN0aW9ucz5cbiAgICAgICAgICAgICAgICA8L21hdC1jYXJkPlxuICAgICAgICAgICAgPC9mb3JtPlxuICAgICAgICA8L25nLXRlbXBsYXRlPlxuXG4gICAgICAgIDxuZy10ZW1wbGF0ZSBbbmdJZl09XCJhdXRoU3RhdHVzIHwgYXN5bmNcIiBbbmdJZkVsc2VdPVwibG9nZ2VkT3V0XCI+XG4gICAgICAgICAgICA8bmctdGVtcGxhdGUgW25nSWZdPVwidXNlclByb2ZpbGUgfCBhc3luY1wiIGxldC11c2VyPVwibmdJZlwiPlxuICAgICAgICAgICAgICAgIDxyaXNrLWdvb2QgKm5nSWY9XCJ1c2VyPy5uYW1lXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFttZXNzYWdlXT1cIidTdWNjZXNzZnVsbHkgbG9nZ2VkIGluIGFzICcgKyB1c2VyLm5hbWUgKyAnLidcIj48L3Jpc2stZ29vZD5cbiAgICAgICAgICAgICAgICA8cmlzay1nb29kICpuZ0lmPVwiIXVzZXIgJiYgIXVzZXIubmFtZVwiXG4gICAgICAgICAg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AgICAgICAgICA8ZGl2IGNsYXNzPVwicmlzay1sb2dpbi1mb3JtLWZsZXgtd3JhcHBlclwiPlxuICAgICAgICAgICAgICAgIDxkaXY+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/common";
|
|
8
|
+
import * as i3 from "@angular/material/button";
|
|
9
|
+
import * as i4 from "@angular/material/icon";
|
|
10
|
+
import * as i5 from "@angular/material/menu";
|
|
11
|
+
export class LoginMenuComponentTitleDirective {
|
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
13
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 }); }
|
|
14
|
+
}
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
27
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", 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 }); }
|
|
28
|
+
}
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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
|
+
get isRow() {
|
|
40
|
+
return this.orientation === 'row';
|
|
41
|
+
}
|
|
42
|
+
get isColumn() {
|
|
43
|
+
return this.orientation === 'column';
|
|
44
|
+
}
|
|
45
|
+
constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
|
|
46
|
+
super();
|
|
47
|
+
this.authProvider = authProvider;
|
|
48
|
+
this.authRoutingFlowService = authRoutingFlowService;
|
|
49
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
50
|
+
this.orientation = 'row';
|
|
51
|
+
// Update menu state on login status change
|
|
52
|
+
this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
|
|
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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
64
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"] }]
|
|
71
|
+
}], ctorParameters: () => [{ 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
|
+
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iYXV0aFN0YXR1cyB8IGFzeW5jXCIgW25nSWZFbHNlXT1cImxvZ2dlZE91dFwiPlxuICAgICAgICAgICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtXG4gICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJsb2dvdXQoKVwiXG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIj5cbiAgICAgICAgICAgICAgICA8bWF0LWljb24+ZXhpdF90b19hcHA8L21hdC1pY29uPlxuICAgICAgICAgICAgICAgIExvZ291dFxuICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgIDwvbmctdGVtcGxhdGU+XG4gICAgICAgIDxuZy10ZW1wbGF0ZSAjbG9nZ2VkT3V0PlxuICAgICAgICAgICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtXG4gICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJsb2dvdXQoKVwiXG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIj5cbiAgICAgICAgICAgICAgICA8bWF0LWljb24+bGF1bmNoPC9tYXQtaWNvbj5cbiAgICAgICAgICAgICAgICBMb2dpblxuICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgIDwvbmctdGVtcGxhdGU+XG4gICAgICAgIDxuZy1jb250ZW50IHNlbGVjdD1cInJpc2stbG9naW4tbWVudS1hZnRlci1pdGVtcy1ob3Jpem9udGFsXCI+PC9uZy1jb250ZW50PlxuICAgIDwvbWF0LW1lbnU+XG4gICAgPGJ1dHRvbiBtYXQtYnV0dG9uXG4gICAgICAgICAgICAjbWVudT1cIm1hdE1lbnVUcmlnZ2VyXCJcbiAgICAgICAgICAgIFttYXRNZW51VHJpZ2dlckZvcl09XCJsb2dpbk1lbnVcIlxuICAgICAgICAgICAgW2NsYXNzLnJpc2stbWVudS1vcGVuXT1cIm1lbnUubWVudU9wZW5cIlxuICAgICAgICAgICAgKG9uTWVudUNsb3NlKT1cIm1lbnVDbG9zZWQoKVwiXG4gICAgICAgIC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lbXMtdmVydGljYWxcIj48L25nLWNvbnRlbnQ+XG48L25nLXRlbXBsYXRlPlxuIl19
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
12
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
|
|
13
|
+
LoginComponent,
|
|
14
|
+
LoginMenuComponentTitleDirective,
|
|
15
|
+
LoginMenuItemsDirective], imports: [CommonModule,
|
|
16
|
+
FormsModule,
|
|
17
|
+
RouterModule,
|
|
18
|
+
AuthModule,
|
|
19
|
+
CommonViewModule], exports: [LoginMenuComponent,
|
|
20
|
+
LoginMenuComponentTitleDirective,
|
|
21
|
+
LoginMenuItemsDirective] }); }
|
|
22
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, imports: [CommonModule,
|
|
23
|
+
FormsModule,
|
|
24
|
+
RouterModule,
|
|
25
|
+
AuthModule,
|
|
26
|
+
CommonViewModule] }); }
|
|
27
|
+
}
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, decorators: [{
|
|
29
|
+
type: NgModule,
|
|
30
|
+
args: [{
|
|
31
|
+
imports: [
|
|
32
|
+
CommonModule,
|
|
33
|
+
FormsModule,
|
|
34
|
+
RouterModule,
|
|
35
|
+
AuthModule,
|
|
36
|
+
CommonViewModule
|
|
37
|
+
],
|
|
38
|
+
declarations: [
|
|
39
|
+
LoginMenuComponent,
|
|
40
|
+
LoginComponent,
|
|
41
|
+
LoginMenuComponentTitleDirective,
|
|
42
|
+
LoginMenuItemsDirective
|
|
43
|
+
],
|
|
44
|
+
exports: [
|
|
45
|
+
LoginMenuComponent,
|
|
46
|
+
LoginMenuComponentTitleDirective,
|
|
47
|
+
LoginMenuItemsDirective
|
|
48
|
+
]
|
|
49
|
+
}]
|
|
50
|
+
}] });
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4ubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUN2QyxPQUFPLEVBQUMsV0FBVyxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0MsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQzdDLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUNwRCxPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUMxRCxPQUFPLEVBQUMsY0FBYyxFQUFD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cm91dGVyJztcbmltcG9ydCB7QXV0aE1vZHVsZX0gZnJvbSAnQGRiZy1yaXNraXQvYW5ndWxhci1hdXRoJztcbmltcG9ydCB7Q29tbW9uVmlld01vZHVsZX0gZnJvbSAnQGRiZy1yaXNraXQvYW5ndWxhci12aWV3JztcbmltcG9ydCB7TG9naW5Db21wb25lbnR9IGZyb20gJy4vbG9naW4uY29tcG9uZW50JztcbmltcG9ydCB7TG9naW5NZW51Q29tcG9uZW50LCBMb2dpbk1lbnVDb21wb25lbnRUaXRsZURpcmVjdGl2ZSwgTG9naW5NZW51SXRlbXNEaXJlY3RpdmV9IGZyb20gJy4vbG9naW4ubWVudS5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICAgIGltcG9ydHMgICAgIDogW1xuICAgICAgICBDb21tb25Nb2R1bGUsXG4gICAgICAgIEZvcm1zTW9kdWxlLFxuICAgICAgICBSb3V0ZXJNb2R1bGUsXG4gICAgICAgIEF1dGhNb2R1bGUsXG4gICAgICAgIENvbW1vblZpZXdNb2R1bGVcbiAgICBdLFxuICAgIGRlY2xhcmF0aW9uczogW1xuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnQsXG4gICAgICAgIExvZ2luQ29tcG9uZW50LFxuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnRUaXRsZURpcmVjdGl2ZSxcbiAgICAgICAgTG9naW5NZW51SXRlbXNEaXJlY3RpdmVcbiAgICBdLFxuICAgIGV4cG9ydHMgICAgIDogW1xuICAgICAgICBMb2dpbk1lbnVDb21wb25lbnQsXG4gICAgICAgIExvZ2luTWVudUNvbXBvbmVudFRpdGxlRGlyZWN0aXZlLFxuICAgICAgICBMb2dpbk1lbnVJdGVtc0RpcmVjdGl2ZVxuICAgIF1cbn0pXG5leHBvcnQgY2xhc3MgTG9naW5Nb2R1bGUge1xufVxuIl19
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import * as i2 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 i3 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 i4 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$1 from '@angular/material/button';
|
|
16
|
+
import * as i6 from '@angular/material/card';
|
|
17
|
+
import * as i7 from '@angular/material/form-field';
|
|
18
|
+
import * as i8 from '@angular/material/icon';
|
|
19
|
+
import * as i9 from '@angular/material/input';
|
|
20
|
+
import * as i10 from '@angular/material/progress-spinner';
|
|
21
|
+
import * as i5 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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\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 <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\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-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{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"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { kind: "component", type: i4.FlexSpacerComponent, selector: "risk-flex-spacer" }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
73
|
+
}
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", 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-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\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 <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\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-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{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: () => [{ type: undefined, decorators: [{
|
|
80
|
+
type: Inject,
|
|
81
|
+
args: [AUTH_PROVIDER]
|
|
82
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
|
|
83
|
+
type: Inject,
|
|
84
|
+
args: [SECONDARY_LOGO]
|
|
85
|
+
}] }] });
|
|
86
|
+
|
|
87
|
+
class LoginMenuComponentTitleDirective {
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
89
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 }); }
|
|
90
|
+
}
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
|
|
92
|
+
type: Directive,
|
|
93
|
+
args: [{
|
|
94
|
+
selector: 'risk-login-menu-title-horizontal, '
|
|
95
|
+
+ 'risk-login-menu-title-vertical',
|
|
96
|
+
host: {
|
|
97
|
+
'[class.risk-login-menu-title]': 'true'
|
|
98
|
+
}
|
|
99
|
+
}]
|
|
100
|
+
}] });
|
|
101
|
+
class LoginMenuItemsDirective {
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
103
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", 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 }); }
|
|
104
|
+
}
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
|
|
106
|
+
type: Directive,
|
|
107
|
+
args: [{
|
|
108
|
+
selector: 'risk-login-menu-before-items-horizontal,'
|
|
109
|
+
+ ' risk-login-menu-before-items-vertical,'
|
|
110
|
+
+ 'risk-login-menu-after-items-horizontal,'
|
|
111
|
+
+ 'risk-login-menu-after-items-vertical'
|
|
112
|
+
}]
|
|
113
|
+
}] });
|
|
114
|
+
class LoginMenuComponent extends BaseComponent {
|
|
115
|
+
get isRow() {
|
|
116
|
+
return this.orientation === 'row';
|
|
117
|
+
}
|
|
118
|
+
get isColumn() {
|
|
119
|
+
return this.orientation === 'column';
|
|
120
|
+
}
|
|
121
|
+
constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
|
|
122
|
+
super();
|
|
123
|
+
this.authProvider = authProvider;
|
|
124
|
+
this.authRoutingFlowService = authRoutingFlowService;
|
|
125
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
126
|
+
this.orientation = 'row';
|
|
127
|
+
// Update menu state on login status change
|
|
128
|
+
this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
|
|
129
|
+
}
|
|
130
|
+
menuClosed() {
|
|
131
|
+
this.changeDetectorRef.markForCheck();
|
|
132
|
+
}
|
|
133
|
+
get authStatus() {
|
|
134
|
+
return this.authProvider.loggedIn;
|
|
135
|
+
}
|
|
136
|
+
logout() {
|
|
137
|
+
this.authRoutingFlowService.logout().pipe(first()).subscribe();
|
|
138
|
+
}
|
|
139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
141
|
+
}
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginMenuComponent, decorators: [{
|
|
143
|
+
type: Component,
|
|
144
|
+
args: [{ selector: 'risk-login-menu', host: {
|
|
145
|
+
'[class.risk-login-menu]': 'true'
|
|
146
|
+
}, 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:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"] }]
|
|
147
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
148
|
+
type: Inject,
|
|
149
|
+
args: [AUTH_PROVIDER]
|
|
150
|
+
}] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }], propDecorators: { orientation: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], isRow: [{
|
|
153
|
+
type: HostBinding,
|
|
154
|
+
args: ['class.risk-login-menu-flex-row']
|
|
155
|
+
}], isColumn: [{
|
|
156
|
+
type: HostBinding,
|
|
157
|
+
args: ['class.risk-login-menu-flex-column']
|
|
158
|
+
}] } });
|
|
159
|
+
|
|
160
|
+
class LoginModule {
|
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
162
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
|
|
163
|
+
LoginComponent,
|
|
164
|
+
LoginMenuComponentTitleDirective,
|
|
165
|
+
LoginMenuItemsDirective], imports: [CommonModule,
|
|
166
|
+
FormsModule,
|
|
167
|
+
RouterModule,
|
|
168
|
+
AuthModule,
|
|
169
|
+
CommonViewModule], exports: [LoginMenuComponent,
|
|
170
|
+
LoginMenuComponentTitleDirective,
|
|
171
|
+
LoginMenuItemsDirective] }); }
|
|
172
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, imports: [CommonModule,
|
|
173
|
+
FormsModule,
|
|
174
|
+
RouterModule,
|
|
175
|
+
AuthModule,
|
|
176
|
+
CommonViewModule] }); }
|
|
177
|
+
}
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginModule, decorators: [{
|
|
179
|
+
type: NgModule,
|
|
180
|
+
args: [{
|
|
181
|
+
imports: [
|
|
182
|
+
CommonModule,
|
|
183
|
+
FormsModule,
|
|
184
|
+
RouterModule,
|
|
185
|
+
AuthModule,
|
|
186
|
+
CommonViewModule
|
|
187
|
+
],
|
|
188
|
+
declarations: [
|
|
189
|
+
LoginMenuComponent,
|
|
190
|
+
LoginComponent,
|
|
191
|
+
LoginMenuComponentTitleDirective,
|
|
192
|
+
LoginMenuItemsDirective
|
|
193
|
+
],
|
|
194
|
+
exports: [
|
|
195
|
+
LoginMenuComponent,
|
|
196
|
+
LoginMenuComponentTitleDirective,
|
|
197
|
+
LoginMenuItemsDirective
|
|
198
|
+
]
|
|
199
|
+
}]
|
|
200
|
+
}] });
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Generated bundle index. Do not edit.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
export { LoginComponent, LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective, LoginModule };
|
|
207
|
+
//# sourceMappingURL=dbg-riskit-angular-login.mjs.map
|