@trudb/tru-common-lib 0.0.679 → 0.0.681
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/esm2020/lib/components/login/tru-login.mjs +6 -3
- package/esm2020/lib/components/toolbar/user-profile/tru-toolbar-user-profile.mjs +13 -12
- package/esm2020/lib/services/tru-app-environment.mjs +1 -11
- package/esm2020/lib/services/tru-user.mjs +18 -19
- package/fesm2015/trudb-tru-common-lib.mjs +31 -41
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +31 -40
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/toolbar/user-profile/tru-toolbar-user-profile.d.ts +3 -1
- package/lib/services/tru-app-environment.d.ts +0 -4
- package/lib/services/tru-user.d.ts +3 -6
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, Input, Injectable, Component, Inject, HostListener, NgModule, EventEmitter, ViewEncapsulation, Output, InjectionToken, APP_INITIALIZER, ViewChildren, ViewChild } from '@angular/core';
|
|
3
3
|
import { EntityAspect, MetadataStore, EntityManager, DataService, EntityQuery, Predicate, FetchStrategy, EntityState, EntityAction, BinaryPredicate, AndOrPredicate, breeze } from 'breeze-client';
|
|
4
|
-
import { BehaviorSubject, defer, from, of, Subject, Observable, skip, forkJoin, throwError } from 'rxjs';
|
|
4
|
+
import { BehaviorSubject, defer, from, of, Subject, Observable, skip, forkJoin, finalize, throwError } from 'rxjs';
|
|
5
5
|
import * as _ from 'underscore';
|
|
6
6
|
import * as i1$3 from '@angular/common/http';
|
|
7
7
|
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
@@ -40,10 +40,10 @@ import { MatExpansionModule } from '@angular/material/expansion';
|
|
|
40
40
|
import { MatGridListModule } from '@angular/material/grid-list';
|
|
41
41
|
import * as i2 from '@angular/material/icon';
|
|
42
42
|
import { MatIconModule } from '@angular/material/icon';
|
|
43
|
-
import * as i5$
|
|
43
|
+
import * as i5$1 from '@angular/material/input';
|
|
44
44
|
import { MatInputModule } from '@angular/material/input';
|
|
45
45
|
import { MatListModule } from '@angular/material/list';
|
|
46
|
-
import * as
|
|
46
|
+
import * as i6 from '@angular/material/menu';
|
|
47
47
|
import { MatMenuModule } from '@angular/material/menu';
|
|
48
48
|
import * as i5 from '@angular/material/core';
|
|
49
49
|
import { MatNativeDateModule, MatRippleModule, MatOptionModule } from '@angular/material/core';
|
|
@@ -282,47 +282,46 @@ class TruUser {
|
|
|
282
282
|
this._lastName = null;
|
|
283
283
|
this._email = null;
|
|
284
284
|
this._roles = null;
|
|
285
|
+
this._userSet = false;
|
|
285
286
|
this.hasRoles = (roles) => {
|
|
286
287
|
if (this._roles === null)
|
|
287
288
|
return true;
|
|
288
289
|
return _.intersection(roles, this._roles).length > 0;
|
|
289
290
|
};
|
|
291
|
+
this.create = (user) => {
|
|
292
|
+
if (!this._userSet) {
|
|
293
|
+
this._ref = user.activeUserRef;
|
|
294
|
+
this._username = user.username;
|
|
295
|
+
this._firstName = user.firstName;
|
|
296
|
+
this._lastName = user.lastName;
|
|
297
|
+
this._email = user.email;
|
|
298
|
+
this._roles = user.roles;
|
|
299
|
+
this._userSet = true;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
throw new Error('User has already been set for this session.');
|
|
303
|
+
}
|
|
304
|
+
};
|
|
290
305
|
}
|
|
291
306
|
get activeUserRef() {
|
|
292
307
|
if (this._ref < 0)
|
|
293
308
|
throw new Error('Inavlid User.');
|
|
294
309
|
return this._ref;
|
|
295
310
|
}
|
|
296
|
-
set activeUserRef(ref) {
|
|
297
|
-
this._ref = ref;
|
|
298
|
-
}
|
|
299
311
|
get username() {
|
|
300
312
|
return this._username;
|
|
301
313
|
}
|
|
302
|
-
set username(username) {
|
|
303
|
-
this._username = username;
|
|
304
|
-
}
|
|
305
314
|
get firstName() {
|
|
306
315
|
return this._firstName;
|
|
307
316
|
}
|
|
308
|
-
set firstName(firstName) {
|
|
309
|
-
this._firstName = firstName;
|
|
310
|
-
}
|
|
311
317
|
get lastName() {
|
|
312
318
|
return this._lastName;
|
|
313
319
|
}
|
|
314
|
-
set lastName(lastName) {
|
|
315
|
-
this._lastName = lastName;
|
|
316
|
-
}
|
|
317
320
|
get email() {
|
|
318
321
|
return this._email;
|
|
319
322
|
}
|
|
320
|
-
|
|
321
|
-
this.
|
|
322
|
-
;
|
|
323
|
-
}
|
|
324
|
-
set roles(roles) {
|
|
325
|
-
this._roles = roles;
|
|
323
|
+
get roles() {
|
|
324
|
+
return this._roles;
|
|
326
325
|
}
|
|
327
326
|
}
|
|
328
327
|
TruUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -364,7 +363,6 @@ class TruAppEnvironment {
|
|
|
364
363
|
};
|
|
365
364
|
this._appUri = '';
|
|
366
365
|
this._maxRecordCount = 0;
|
|
367
|
-
this._user = truUser;
|
|
368
366
|
this.msgModifierKeyLabel = this.isMac ? 'Cmd' : 'Ctrl';
|
|
369
367
|
this.msgConfirmExitWithChangesPending = 'You have unsaved changes that will be lost.';
|
|
370
368
|
this.msgDeleteSuccessful = 'Delete succeeded';
|
|
@@ -387,15 +385,6 @@ class TruAppEnvironment {
|
|
|
387
385
|
set appUri(uri) {
|
|
388
386
|
this._appUri = uri;
|
|
389
387
|
}
|
|
390
|
-
get user() {
|
|
391
|
-
return this._user;
|
|
392
|
-
}
|
|
393
|
-
set user(user) {
|
|
394
|
-
this._user = user;
|
|
395
|
-
}
|
|
396
|
-
get activeUserRef() {
|
|
397
|
-
return this._user?.activeUserRef;
|
|
398
|
-
}
|
|
399
388
|
get isSaving() {
|
|
400
389
|
return this._isSaving.getValue();
|
|
401
390
|
}
|
|
@@ -3720,32 +3709,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
|
3720
3709
|
}] }]; } });
|
|
3721
3710
|
|
|
3722
3711
|
class TruToolbarUserProfile {
|
|
3723
|
-
constructor(desktopManager, appEnvironment, auth) {
|
|
3712
|
+
constructor(desktopManager, appEnvironment, user, auth) {
|
|
3724
3713
|
this.desktopManager = desktopManager;
|
|
3725
3714
|
this.appEnvironment = appEnvironment;
|
|
3715
|
+
this.user = user;
|
|
3726
3716
|
this.auth = auth;
|
|
3727
3717
|
this.initial = null;
|
|
3728
3718
|
this.name = null;
|
|
3729
3719
|
this.email = null;
|
|
3730
3720
|
this.onChangePasswordButtonClicked = () => {
|
|
3731
|
-
let entity = this.appEnvironment.globalDataContext?.entityAccess().searchUserByRefCacheOnly(this.
|
|
3721
|
+
let entity = this.appEnvironment.globalDataContext?.entityAccess().searchUserByRefCacheOnly(this.user.activeUserRef);
|
|
3732
3722
|
this.desktopManager.addWindow('TruDbUser', 'TruDbUsers', 'Users', 'TruDbUserDetailView', [entity], true);
|
|
3733
3723
|
};
|
|
3734
3724
|
this.onLogoutButtonClicked = () => {
|
|
3735
3725
|
this.auth.doLogoutAndRedirectToLogin();
|
|
3736
3726
|
};
|
|
3737
|
-
let user = this.appEnvironment.user;
|
|
3738
3727
|
this.initial = user?.firstName ? user?.firstName.slice(0, 1).toUpperCase() : user?.username?.slice(0, 1).toUpperCase();
|
|
3739
3728
|
this.name = user?.firstName && user?.lastName ? user?.firstName + ' ' + user?.lastName : user?.username;
|
|
3740
3729
|
this.email = user?.email;
|
|
3741
3730
|
}
|
|
3742
3731
|
}
|
|
3743
|
-
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: TruDesktopManager }, { token: TruAppEnvironment }, { token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
3744
|
-
TruToolbarUserProfile.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruToolbarUserProfile, selector: "tru-toolbar-user-profile", ngImport: i0, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n {{initial}}\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\"></mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">{{initial}}</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>{{name}}</p>\r\n <p *ngIf=\"email\">{{email}}</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type:
|
|
3732
|
+
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: TruDesktopManager }, { token: TruAppEnvironment }, { token: TruUser }, { token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
3733
|
+
TruToolbarUserProfile.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruToolbarUserProfile, selector: "tru-toolbar-user-profile", ngImport: i0, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n {{initial}}\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\"></mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">{{initial}}</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>{{name}}</p>\r\n <p *ngIf=\"email\">{{email}}</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i3.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3745
3734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
|
|
3746
3735
|
type: Component,
|
|
3747
3736
|
args: [{ selector: 'tru-toolbar-user-profile', encapsulation: ViewEncapsulation.None, template: "<div class=\"tru-toolbar-user-profile\">\r\n <button mat-mini-fab color=\"primary\" class=\"tru-toolbar-user-profile-user-button\" [matMenuTriggerFor]=\"userMenu\">\r\n {{initial}}\r\n </button>\r\n</div>\r\n<mat-menu #userMenu=\"matMenu\">\r\n <div class=\"tru-toolbar-user-profile-menu-container\">\r\n <mat-icon class=\"tru-toolbar-user-profile-menu-circle-icon\" [svgIcon]=\"'circle-icon'\"></mat-icon>\r\n <span class=\"tru-toolbar-user-profile-menu-circle-icon-text\">{{initial}}</span>\r\n <div class=\"tru-toolbar-user-profile-menu-text-container\">\r\n <p>{{name}}</p>\r\n <p *ngIf=\"email\">{{email}}</p>\r\n </div>\r\n <button mat-menu-item\r\n (click)=\"onChangePasswordButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Change Password\r\n </button>\r\n <button mat-menu-item\r\n (click)=\"onLogoutButtonClicked()\"\r\n class=\"tru-toolbar-user-profile-menu-logout-button\">\r\n Logout\r\n </button>\r\n </div>\r\n</mat-menu>\r\n", styles: [".tru-toolbar-user-profile{height:25px;float:right}.tru-toolbar-user-profile button{height:23px;width:23px;margin-right:10px;margin-top:1px;font-size:12px;box-shadow:none}.tru-toolbar-user-profile-menu-container{width:250px}.tru-toolbar-user-profile-menu-container mat-icon{height:50px;width:50px;margin:auto;display:flex;justify-content:center;color:#006dcc}.tru-toolbar-user-profile-menu-container p{margin:5px;font-size:14px;text-align:center}.tru-toolbar-user-profile-menu-container .tru-toolbar-user-profile-menu-logout-button{display:flex;justify-content:center}.tru-toolbar-user-profile-menu-text-container{margin-top:-15px}.tru-toolbar-user-profile-menu-circle-icon-text{color:#fff;font-weight:200;font-size:30px;margin-right:12px;display:block;margin-left:12px;display:flex;justify-content:center;position:relative;z-index:100;top:-35px}\n"] }]
|
|
3748
|
-
}], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruAuth }]; } });
|
|
3737
|
+
}], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruUser }, { type: TruAuth }]; } });
|
|
3749
3738
|
|
|
3750
3739
|
class TruToolbarUserProfileModule {
|
|
3751
3740
|
}
|
|
@@ -5895,8 +5884,10 @@ class TruLogin {
|
|
|
5895
5884
|
if (loginRequest.username && loginRequest.password) {
|
|
5896
5885
|
this.isLoggingIn = true;
|
|
5897
5886
|
this.auth
|
|
5898
|
-
.login(loginRequest)
|
|
5899
|
-
.
|
|
5887
|
+
.login(loginRequest).pipe(finalize(() => {
|
|
5888
|
+
this.isLoggingIn = false;
|
|
5889
|
+
}))
|
|
5890
|
+
.subscribe(() => {
|
|
5900
5891
|
this.isLoggingIn = false;
|
|
5901
5892
|
}, (error) => {
|
|
5902
5893
|
if (error.status === 401) {
|
|
@@ -5910,7 +5901,7 @@ class TruLogin {
|
|
|
5910
5901
|
}
|
|
5911
5902
|
}
|
|
5912
5903
|
TruLogin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, deps: [{ token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
5913
|
-
TruLogin.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruLogin, selector: "tru-login", ngImport: i0, template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> loginFormTitle </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-form-field>\r\n <mat-label>Username</mat-label>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <mat-label>Password</mat-label>\r\n <input matInput type=\"password\" formControlName=\"password\" placeholder=\"Password\">\r\n </mat-form-field>\r\n <div *ngIf=\"loginError\" class=\"animate-login-error animated rubberBand\">\r\n <p style=\"color: red; font-weight: bold;\"> {{ loginError }}</p>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isDisabled()\">Login</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n</div>\r\n", styles: [".login-container{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;padding:0}.login-input{margin-bottom:20px}.animate-login{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;margin-top:50px}.wrapper{display:flex;justify-content:center;align-items:center;height:100vh}mat-card{max-width:300px;width:100%;max-height:300px;padding:20px}.form-group{width:100%;max-width:400px;margin-bottom:20px}.login-wrapper{display:flex;justify-content:center;align-items:center;height:100vh}::ng-deep .login-wrapper .mat-mdc-text-field-wrapper{padding:0 16px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i4.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i5$
|
|
5904
|
+
TruLogin.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.1", type: TruLogin, selector: "tru-login", ngImport: i0, template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> loginFormTitle </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-form-field>\r\n <mat-label>Username</mat-label>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <mat-label>Password</mat-label>\r\n <input matInput type=\"password\" formControlName=\"password\" placeholder=\"Password\">\r\n </mat-form-field>\r\n <div *ngIf=\"loginError\" class=\"animate-login-error animated rubberBand\">\r\n <p style=\"color: red; font-weight: bold;\"> {{ loginError }}</p>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isDisabled()\">Login</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n</div>\r\n", styles: [".login-container{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;padding:0}.login-input{margin-bottom:20px}.animate-login{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;margin-top:50px}.wrapper{display:flex;justify-content:center;align-items:center;height:100vh}mat-card{max-width:300px;width:100%;max-height:300px;padding:20px}.form-group{width:100%;max-width:400px;margin-bottom:20px}.login-wrapper{display:flex;justify-content:center;align-items:center;height:100vh}::ng-deep .login-wrapper .mat-mdc-text-field-wrapper{padding:0 16px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i4.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i5$1.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: i3$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
5914
5905
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, decorators: [{
|
|
5915
5906
|
type: Component,
|
|
5916
5907
|
args: [{ selector: 'tru-login', template: "<div class=\"login-wrapper\">\r\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\">\r\n <mat-card class=\"animate-login\">\r\n <mat-card-header>\r\n <mat-card-title> loginFormTitle </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-form-field>\r\n <mat-label>Username</mat-label>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <mat-label>Password</mat-label>\r\n <input matInput type=\"password\" formControlName=\"password\" placeholder=\"Password\">\r\n </mat-form-field>\r\n <div *ngIf=\"loginError\" class=\"animate-login-error animated rubberBand\">\r\n <p style=\"color: red; font-weight: bold;\"> {{ loginError }}</p>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"isDisabled()\">Login</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n</div>\r\n", styles: [".login-container{display:flex;justify-content:center;align-items:center;height:100vh;margin:0;padding:0}.login-input{margin-bottom:20px}.animate-login{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;margin-top:50px}.wrapper{display:flex;justify-content:center;align-items:center;height:100vh}mat-card{max-width:300px;width:100%;max-height:300px;padding:20px}.form-group{width:100%;max-width:400px;margin-bottom:20px}.login-wrapper{display:flex;justify-content:center;align-items:center;height:100vh}::ng-deep .login-wrapper .mat-mdc-text-field-wrapper{padding:0 16px!important}\n"] }]
|