@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';
@@ -274,9 +274,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
274
274
  }]
275
275
  }], ctorParameters: function () { return []; } });
276
276
 
277
- class TruAppEnvironment {
277
+ class TruUser {
278
278
  constructor() {
279
- this._user = null;
279
+ this._ref = -1;
280
+ this._username = null;
281
+ this._firstName = null;
282
+ this._lastName = null;
283
+ this._email = null;
284
+ this._roles = null;
285
+ this._userSet = false;
286
+ this.hasRoles = (roles) => {
287
+ if (this._roles === null)
288
+ return true;
289
+ return _.intersection(roles, this._roles).length > 0;
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
+ };
305
+ }
306
+ get activeUserRef() {
307
+ if (this._ref < 0)
308
+ throw new Error('Inavlid User.');
309
+ return this._ref;
310
+ }
311
+ get username() {
312
+ return this._username;
313
+ }
314
+ get firstName() {
315
+ return this._firstName;
316
+ }
317
+ get lastName() {
318
+ return this._lastName;
319
+ }
320
+ get email() {
321
+ return this._email;
322
+ }
323
+ get roles() {
324
+ return this._roles;
325
+ }
326
+ }
327
+ TruUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
328
+ TruUser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, providedIn: 'root' });
329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, decorators: [{
330
+ type: Injectable,
331
+ args: [{
332
+ providedIn: 'root',
333
+ }]
334
+ }], ctorParameters: function () { return []; } });
335
+
336
+ class TruAppEnvironment {
337
+ constructor(truUser) {
338
+ this.truUser = truUser;
280
339
  this._isSaving = new BehaviorSubject(false);
281
340
  this._saveComplete = new BehaviorSubject(null);
282
341
  this._revertComplete = new BehaviorSubject(null);
@@ -326,15 +385,6 @@ class TruAppEnvironment {
326
385
  set appUri(uri) {
327
386
  this._appUri = uri;
328
387
  }
329
- get user() {
330
- return this._user;
331
- }
332
- set user(user) {
333
- this._user = user;
334
- }
335
- get activeUserRef() {
336
- return this._user?.activeUserRef;
337
- }
338
388
  get isSaving() {
339
389
  return this._isSaving.getValue();
340
390
  }
@@ -357,11 +407,14 @@ class TruAppEnvironment {
357
407
  return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
358
408
  }
359
409
  }
360
- TruAppEnvironment.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
361
- TruAppEnvironment.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment });
410
+ TruAppEnvironment.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, deps: [{ token: TruUser }], target: i0.ɵɵFactoryTarget.Injectable });
411
+ TruAppEnvironment.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, providedIn: 'root' });
362
412
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruAppEnvironment, decorators: [{
363
- type: Injectable
364
- }], ctorParameters: function () { return []; } });
413
+ type: Injectable,
414
+ args: [{
415
+ providedIn: 'root',
416
+ }]
417
+ }], ctorParameters: function () { return [{ type: TruUser }]; } });
365
418
 
366
419
  class TruBreezeContextFactory {
367
420
  constructor(breezeMetadataProvider, environment) {
@@ -3656,32 +3709,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
3656
3709
  }] }]; } });
3657
3710
 
3658
3711
  class TruToolbarUserProfile {
3659
- constructor(desktopManager, appEnvironment, auth) {
3712
+ constructor(desktopManager, appEnvironment, user, auth) {
3660
3713
  this.desktopManager = desktopManager;
3661
3714
  this.appEnvironment = appEnvironment;
3715
+ this.user = user;
3662
3716
  this.auth = auth;
3663
3717
  this.initial = null;
3664
3718
  this.name = null;
3665
3719
  this.email = null;
3666
3720
  this.onChangePasswordButtonClicked = () => {
3667
- let entity = this.appEnvironment.globalDataContext?.entityAccess().searchUserByRefCacheOnly(this.appEnvironment.activeUserRef);
3721
+ let entity = this.appEnvironment.globalDataContext?.entityAccess().searchUserByRefCacheOnly(this.user.activeUserRef);
3668
3722
  this.desktopManager.addWindow('TruDbUser', 'TruDbUsers', 'Users', 'TruDbUserDetailView', [entity], true);
3669
3723
  };
3670
3724
  this.onLogoutButtonClicked = () => {
3671
3725
  this.auth.doLogoutAndRedirectToLogin();
3672
3726
  };
3673
- let user = this.appEnvironment.user;
3674
3727
  this.initial = user?.firstName ? user?.firstName.slice(0, 1).toUpperCase() : user?.username?.slice(0, 1).toUpperCase();
3675
3728
  this.name = user?.firstName && user?.lastName ? user?.firstName + ' ' + user?.lastName : user?.username;
3676
3729
  this.email = user?.email;
3677
3730
  }
3678
3731
  }
3679
- 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 });
3680
- 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 });
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 });
3681
3734
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruToolbarUserProfile, decorators: [{
3682
3735
  type: Component,
3683
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"] }]
3684
- }], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruAuth }]; } });
3737
+ }], ctorParameters: function () { return [{ type: TruDesktopManager }, { type: TruAppEnvironment }, { type: TruUser }, { type: TruAuth }]; } });
3685
3738
 
3686
3739
  class TruToolbarUserProfileModule {
3687
3740
  }
@@ -5831,8 +5884,10 @@ class TruLogin {
5831
5884
  if (loginRequest.username && loginRequest.password) {
5832
5885
  this.isLoggingIn = true;
5833
5886
  this.auth
5834
- .login(loginRequest)
5835
- .subscribe((user) => {
5887
+ .login(loginRequest).pipe(finalize(() => {
5888
+ this.isLoggingIn = false;
5889
+ }))
5890
+ .subscribe(() => {
5836
5891
  this.isLoggingIn = false;
5837
5892
  }, (error) => {
5838
5893
  if (error.status === 401) {
@@ -5846,7 +5901,7 @@ class TruLogin {
5846
5901
  }
5847
5902
  }
5848
5903
  TruLogin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, deps: [{ token: TruAuth }], target: i0.ɵɵFactoryTarget.Component });
5849
- 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"] }] });
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"] }] });
5850
5905
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruLogin, decorators: [{
5851
5906
  type: Component,
5852
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"] }]
@@ -6514,66 +6569,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImpor
6514
6569
  }]
6515
6570
  }], ctorParameters: function () { return []; } });
6516
6571
 
6517
- class TruUser {
6518
- constructor() {
6519
- this._ref = -1;
6520
- this._username = null;
6521
- this._firstName = null;
6522
- this._lastName = null;
6523
- this._email = null;
6524
- this._roles = null;
6525
- this.hasRoles = (roles) => {
6526
- if (this._roles === null)
6527
- return true;
6528
- return true; //_.intersection(roles, this._roles).length > 0;
6529
- };
6530
- }
6531
- get activeUserRef() {
6532
- if (this._ref < 0)
6533
- throw new Error('Inavlid User.');
6534
- return this._ref;
6535
- }
6536
- set activeUserRef(ref) {
6537
- this._ref = ref;
6538
- }
6539
- get username() {
6540
- return this._username;
6541
- }
6542
- set username(username) {
6543
- this._username = username;
6544
- }
6545
- get firstName() {
6546
- return this._firstName;
6547
- }
6548
- set firstName(firstName) {
6549
- this._firstName = firstName;
6550
- }
6551
- get lastName() {
6552
- return this._lastName;
6553
- }
6554
- set lastName(lastName) {
6555
- this._lastName = lastName;
6556
- }
6557
- get email() {
6558
- return this._email;
6559
- }
6560
- set email(email) {
6561
- this._email = email;
6562
- ;
6563
- }
6564
- set roles(roles) {
6565
- this._roles = roles;
6566
- }
6567
- }
6568
- TruUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6569
- TruUser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, providedIn: 'root' });
6570
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruUser, decorators: [{
6571
- type: Injectable,
6572
- args: [{
6573
- providedIn: 'root',
6574
- }]
6575
- }], ctorParameters: function () { return []; } });
6576
-
6577
6572
  const GO_TO_ICON = `
6578
6573
  <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>
6579
6574
  `;