@trudb/tru-common-lib 0.0.678 → 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.
@@ -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$2 from '@angular/material/input';
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 i5$1 from '@angular/material/menu';
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';
@@ -275,9 +275,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
275
275
  }]
276
276
  }], ctorParameters: function () { return []; } });
277
277
 
278
- class TruAppEnvironment {
278
+ class TruUser {
279
279
  constructor() {
280
- this._user = null;
280
+ this._ref = -1;
281
+ this._username = null;
282
+ this._firstName = null;
283
+ this._lastName = null;
284
+ this._email = null;
285
+ this._roles = null;
286
+ this._userSet = false;
287
+ this.hasRoles = (roles) => {
288
+ if (this._roles === null)
289
+ return true;
290
+ return _.intersection(roles, this._roles).length > 0;
291
+ };
292
+ this.create = (user) => {
293
+ if (!this._userSet) {
294
+ this._ref = user.activeUserRef;
295
+ this._username = user.username;
296
+ this._firstName = user.firstName;
297
+ this._lastName = user.lastName;
298
+ this._email = user.email;
299
+ this._roles = user.roles;
300
+ this._userSet = true;
301
+ }
302
+ else {
303
+ throw new Error('User has already been set for this session.');
304
+ }
305
+ };
306
+ }
307
+ get activeUserRef() {
308
+ if (this._ref < 0)
309
+ throw new Error('Inavlid User.');
310
+ return this._ref;
311
+ }
312
+ get username() {
313
+ return this._username;
314
+ }
315
+ get firstName() {
316
+ return this._firstName;
317
+ }
318
+ get lastName() {
319
+ return this._lastName;
320
+ }
321
+ get email() {
322
+ return this._email;
323
+ }
324
+ get roles() {
325
+ return this._roles;
326
+ }
327
+ }
328
+ TruUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
329
+ TruUser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, providedIn: 'root' });
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, decorators: [{
331
+ type: Injectable,
332
+ args: [{
333
+ providedIn: 'root',
334
+ }]
335
+ }], ctorParameters: function () { return []; } });
336
+
337
+ class TruAppEnvironment {
338
+ constructor(truUser) {
339
+ this.truUser = truUser;
281
340
  this._isSaving = new BehaviorSubject(false);
282
341
  this._saveComplete = new BehaviorSubject(null);
283
342
  this._revertComplete = new BehaviorSubject(null);
@@ -327,16 +386,6 @@ class TruAppEnvironment {
327
386
  set appUri(uri) {
328
387
  this._appUri = uri;
329
388
  }
330
- get user() {
331
- return this._user;
332
- }
333
- set user(user) {
334
- this._user = user;
335
- }
336
- get activeUserRef() {
337
- var _a;
338
- return (_a = this._user) === null || _a === void 0 ? void 0 : _a.activeUserRef;
339
- }
340
389
  get isSaving() {
341
390
  return this._isSaving.getValue();
342
391
  }
@@ -359,11 +408,14 @@ class TruAppEnvironment {
359
408
  return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
360
409
  }
361
410
  }
362
- TruAppEnvironment.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
363
- TruAppEnvironment.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment });
411
+ TruAppEnvironment.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, deps: [{ token: TruUser }], target: i0.ɵɵFactoryTarget.Injectable });
412
+ TruAppEnvironment.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, providedIn: 'root' });
364
413
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, decorators: [{
365
- type: Injectable
366
- }], ctorParameters: function () { return []; } });
414
+ type: Injectable,
415
+ args: [{
416
+ providedIn: 'root',
417
+ }]
418
+ }], ctorParameters: function () { return [{ type: TruUser }]; } });
367
419
 
368
420
  class TruBreezeContextFactory {
369
421
  constructor(breezeMetadataProvider, environment) {
@@ -3671,34 +3723,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
3671
3723
  } });
3672
3724
 
3673
3725
  class TruToolbarUserProfile {
3674
- constructor(desktopManager, appEnvironment, auth) {
3726
+ constructor(desktopManager, appEnvironment, user, auth) {
3675
3727
  var _a;
3676
3728
  this.desktopManager = desktopManager;
3677
3729
  this.appEnvironment = appEnvironment;
3730
+ this.user = user;
3678
3731
  this.auth = auth;
3679
3732
  this.initial = null;
3680
3733
  this.name = null;
3681
3734
  this.email = null;
3682
3735
  this.onChangePasswordButtonClicked = () => {
3683
3736
  var _a;
3684
- let entity = (_a = this.appEnvironment.globalDataContext) === null || _a === void 0 ? void 0 : _a.entityAccess().searchUserByRefCacheOnly(this.appEnvironment.activeUserRef);
3737
+ let entity = (_a = this.appEnvironment.globalDataContext) === null || _a === void 0 ? void 0 : _a.entityAccess().searchUserByRefCacheOnly(this.user.activeUserRef);
3685
3738
  this.desktopManager.addWindow('TruDbUser', 'TruDbUsers', 'Users', 'TruDbUserDetailView', [entity], true);
3686
3739
  };
3687
3740
  this.onLogoutButtonClicked = () => {
3688
3741
  this.auth.doLogoutAndRedirectToLogin();
3689
3742
  };
3690
- let user = this.appEnvironment.user;
3691
3743
  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
3744
  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;
3693
3745
  this.email = user === null || user === void 0 ? void 0 : user.email;
3694
3746
  }
3695
3747
  }
3696
- 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 });
3697
- 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 });
3748
+ 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 });
3749
+ 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 });
3698
3750
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
3699
3751
  type: Component,
3700
3752
  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"] }]
3701
- }], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruAuth }]; } });
3753
+ }], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruUser }, { type: TruAuth }]; } });
3702
3754
 
3703
3755
  class TruToolbarUserProfileModule {
3704
3756
  }
@@ -5849,8 +5901,10 @@ class TruLogin {
5849
5901
  if (loginRequest.username && loginRequest.password) {
5850
5902
  this.isLoggingIn = true;
5851
5903
  this.auth
5852
- .login(loginRequest)
5853
- .subscribe((user) => {
5904
+ .login(loginRequest).pipe(finalize(() => {
5905
+ this.isLoggingIn = false;
5906
+ }))
5907
+ .subscribe(() => {
5854
5908
  this.isLoggingIn = false;
5855
5909
  }, (error) => {
5856
5910
  if (error.status === 401) {
@@ -5864,7 +5918,7 @@ class TruLogin {
5864
5918
  }
5865
5919
  }
5866
5920
  TruLogin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, deps: [{ token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
5867
- 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"] }] });
5921
+ 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"] }] });
5868
5922
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, decorators: [{
5869
5923
  type: Component,
5870
5924
  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"] }]
@@ -6540,66 +6594,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
6540
6594
  }]
6541
6595
  }], ctorParameters: function () { return []; } });
6542
6596
 
6543
- class TruUser {
6544
- constructor() {
6545
- this._ref = -1;
6546
- this._username = null;
6547
- this._firstName = null;
6548
- this._lastName = null;
6549
- this._email = null;
6550
- this._roles = null;
6551
- this.hasRoles = (roles) => {
6552
- if (this._roles === null)
6553
- return true;
6554
- return true; //_.intersection(roles, this._roles).length > 0;
6555
- };
6556
- }
6557
- get activeUserRef() {
6558
- if (this._ref < 0)
6559
- throw new Error('Inavlid User.');
6560
- return this._ref;
6561
- }
6562
- set activeUserRef(ref) {
6563
- this._ref = ref;
6564
- }
6565
- get username() {
6566
- return this._username;
6567
- }
6568
- set username(username) {
6569
- this._username = username;
6570
- }
6571
- get firstName() {
6572
- return this._firstName;
6573
- }
6574
- set firstName(firstName) {
6575
- this._firstName = firstName;
6576
- }
6577
- get lastName() {
6578
- return this._lastName;
6579
- }
6580
- set lastName(lastName) {
6581
- this._lastName = lastName;
6582
- }
6583
- get email() {
6584
- return this._email;
6585
- }
6586
- set email(email) {
6587
- this._email = email;
6588
- ;
6589
- }
6590
- set roles(roles) {
6591
- this._roles = roles;
6592
- }
6593
- }
6594
- TruUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6595
- TruUser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, providedIn: 'root' });
6596
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, decorators: [{
6597
- type: Injectable,
6598
- args: [{
6599
- providedIn: 'root',
6600
- }]
6601
- }], ctorParameters: function () { return []; } });
6602
-
6603
6597
  const GO_TO_ICON = `
6604
6598
  <svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M216-144q-29.7 0-50.85-21.15Q144-186.3 144-216v-528q0-29.7 21.15-50.85Q186.3-816 216-816h264v72H216v528h528v-264h72v264q0 29.7-21.15 50.85Q773.7-144 744-144H216Zm171-192-51-51 357-357H576v-72h240v240h-72v-117L387-336Z"/></svg>
6605
6599
  `;