@trudb/tru-common-lib 0.0.675 → 0.0.677
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/toolbar/user-profile/tru-toolbar-user-profile.mjs +13 -6
- package/fesm2015/trudb-tru-common-lib.mjs +13 -6
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +12 -6
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/toolbar/user-profile/tru-toolbar-user-profile.d.ts +3 -0
- package/package.json +1 -1
|
@@ -3,14 +3,18 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
import * as i1 from "../../desktop/services/tru-desktop-manager";
|
|
4
4
|
import * as i2 from "../../../services/tru-app-environment";
|
|
5
5
|
import * as i3 from "../../login/services/tru-auth";
|
|
6
|
-
import * as i4 from "@angular/
|
|
7
|
-
import * as i5 from "@angular/material/
|
|
8
|
-
import * as i6 from "@angular/material/
|
|
6
|
+
import * as i4 from "@angular/common";
|
|
7
|
+
import * as i5 from "@angular/material/menu";
|
|
8
|
+
import * as i6 from "@angular/material/button";
|
|
9
|
+
import * as i7 from "@angular/material/icon";
|
|
9
10
|
export class TruToolbarUserProfile {
|
|
10
11
|
constructor(desktopManager, appEnvironment, auth) {
|
|
11
12
|
this.desktopManager = desktopManager;
|
|
12
13
|
this.appEnvironment = appEnvironment;
|
|
13
14
|
this.auth = auth;
|
|
15
|
+
this.initial = null;
|
|
16
|
+
this.name = null;
|
|
17
|
+
this.email = null;
|
|
14
18
|
this.onChangePasswordButtonClicked = () => {
|
|
15
19
|
let entity = this.appEnvironment.globalDataContext?.entityAccess().searchUserByRefCacheOnly(this.appEnvironment.activeUserRef);
|
|
16
20
|
this.desktopManager.addWindow('TruDbUser', 'TruDbUsers', 'Users', 'TruDbUserDetailView', [entity], true);
|
|
@@ -18,12 +22,15 @@ export class TruToolbarUserProfile {
|
|
|
18
22
|
this.onLogoutButtonClicked = () => {
|
|
19
23
|
this.auth.doLogoutAndRedirectToLogin();
|
|
20
24
|
};
|
|
25
|
+
let user = this.appEnvironment.user;
|
|
26
|
+
this.initial = user?.firstName ? user?.firstName.slice(0, 1).toUpperCase() : user?.username?.slice(0, 1).toUpperCase();
|
|
27
|
+
this.name = user?.firstName && user?.lastName ? user?.firstName + ' ' + user?.lastName : user?.username;
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
TruToolbarUserProfile.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, deps: [{ token: i1.TruDesktopManager }, { token: i2.TruAppEnvironment }, { token: i3.TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
-
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
|
|
31
|
+
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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i6.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
25
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
|
|
26
33
|
type: Component,
|
|
27
|
-
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
|
|
34
|
+
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"] }]
|
|
28
35
|
}], ctorParameters: function () { return [{ type: i1.TruDesktopManager }, { type: i2.TruAppEnvironment }, { type: i3.TruAuth }]; } });
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJ1LXRvb2xiYXItdXNlci1wcm9maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHJ1LWNvbW1vbi1saWIvc3JjL2xpYi9jb21wb25lbnRzL3Rvb2xiYXIvdXNlci1wcm9maWxlL3RydS10b29sYmFyLXVzZXItcHJvZmlsZS50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3RydS1jb21tb24tbGliL3NyYy9saWIvY29tcG9uZW50cy90b29sYmFyL3VzZXItcHJvZmlsZS90cnUtdG9vbGJhci11c2VyLXByb2ZpbGUuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sZUFBZSxDQUFDOzs7Ozs7Ozs7QUFZN0QsTUFBTSxPQUFPLHFCQUFxQjtJQUtoQyxZQUNVLGNBQWlDLEVBQ2pDLGNBQWlDLEVBQ2pDLElBQWE7UUFGYixtQkFBYyxHQUFkLGNBQWMsQ0FBbUI7UUFDakMsbUJBQWMsR0FBZCxjQUFjLENBQW1CO1FBQ2pDLFNBQUksR0FBSixJQUFJLENBQVM7UUFQdkI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2xpY2spPVwib25DaGFuZ2VQYXNzd29yZEJ1dHRvbkNsaWNrZWQoKVwiXHJcbiAgICAgICAgICAgIGNsYXNzPVwidHJ1LXRvb2xiYXItdXNlci1wcm9maWxlLW1lbnUtbG9nb3V0LWJ1dHRvblwiPlxyXG4gICAgICBDaGFuZ2UgUGFzc3dvcmRcclxuICAgIDwvYnV0dG9uPlxyXG4gICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtXHJcbiAgICAgICAgICAgIChjbGljayk9XCJvbkxvZ291dEJ1dHRvbkNsaWNrZWQoKVwiXHJcbiAgICAgICAgICAgIGNsYXNzPVwidHJ1LXRvb2xiYXItdXNlci1wcm9maWxlLW1lbnUtbG9nb3V0LWJ1dHRvblwiPlxyXG4gICAgICBMb2dvdXRcclxuICAgIDwvYnV0dG9uPlxyXG4gIDwvZGl2PlxyXG48L21hdC1tZW51PlxyXG4iXX0=
|
|
@@ -30,7 +30,7 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
|
30
30
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
31
31
|
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
|
32
32
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
33
|
-
import * as i4
|
|
33
|
+
import * as i4 from '@angular/material/card';
|
|
34
34
|
import { MatCardModule } from '@angular/material/card';
|
|
35
35
|
import { MatChipsModule } from '@angular/material/chips';
|
|
36
36
|
import { MatStepperModule } from '@angular/material/stepper';
|
|
@@ -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$2 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 i5$1 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';
|
|
@@ -3672,9 +3672,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
|
|
|
3672
3672
|
|
|
3673
3673
|
class TruToolbarUserProfile {
|
|
3674
3674
|
constructor(desktopManager, appEnvironment, auth) {
|
|
3675
|
+
var _a;
|
|
3675
3676
|
this.desktopManager = desktopManager;
|
|
3676
3677
|
this.appEnvironment = appEnvironment;
|
|
3677
3678
|
this.auth = auth;
|
|
3679
|
+
this.initial = null;
|
|
3680
|
+
this.name = null;
|
|
3681
|
+
this.email = null;
|
|
3678
3682
|
this.onChangePasswordButtonClicked = () => {
|
|
3679
3683
|
var _a;
|
|
3680
3684
|
let entity = (_a = this.appEnvironment.globalDataContext) === null || _a === void 0 ? void 0 : _a.entityAccess().searchUserByRefCacheOnly(this.appEnvironment.activeUserRef);
|
|
@@ -3683,13 +3687,16 @@ class TruToolbarUserProfile {
|
|
|
3683
3687
|
this.onLogoutButtonClicked = () => {
|
|
3684
3688
|
this.auth.doLogoutAndRedirectToLogin();
|
|
3685
3689
|
};
|
|
3690
|
+
let user = this.appEnvironment.user;
|
|
3691
|
+
this.initial = (user === null || user === void 0 ? void 0 : user.firstName) ? user === null || user === void 0 ? void 0 : user.firstName.slice(0, 1).toUpperCase() : (_a = user === null || user === void 0 ? void 0 : user.username) === null || _a === void 0 ? void 0 : _a.slice(0, 1).toUpperCase();
|
|
3692
|
+
this.name = (user === null || user === void 0 ? void 0 : user.firstName) && (user === null || user === void 0 ? void 0 : user.lastName) ? (user === null || user === void 0 ? void 0 : user.firstName) + ' ' + (user === null || user === void 0 ? void 0 : user.lastName) : user === null || user === void 0 ? void 0 : user.username;
|
|
3686
3693
|
}
|
|
3687
3694
|
}
|
|
3688
3695
|
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 });
|
|
3689
|
-
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
|
|
3696
|
+
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: i5$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.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 });
|
|
3690
3697
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
|
|
3691
3698
|
type: Component,
|
|
3692
|
-
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
|
|
3699
|
+
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"] }]
|
|
3693
3700
|
}], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruAuth }]; } });
|
|
3694
3701
|
|
|
3695
3702
|
class TruToolbarUserProfileModule {
|
|
@@ -5856,7 +5863,7 @@ class TruLogin {
|
|
|
5856
5863
|
}
|
|
5857
5864
|
}
|
|
5858
5865
|
TruLogin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, deps: [{ token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
|
|
5859
|
-
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
|
|
5866
|
+
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$2.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"] }] });
|
|
5860
5867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, decorators: [{
|
|
5861
5868
|
type: Component,
|
|
5862
5869
|
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"] }]
|