@trudb/tru-common-lib 0.2.520 → 0.2.529

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.
@@ -4068,7 +4068,7 @@ class TruAuth {
4068
4068
  });
4069
4069
  }
4070
4070
  userClaims() {
4071
- if (this.appEnvironment.authType === 'session') {
4071
+ if (this.appEnvironment.authType === 'session' || this.appEnvironment.authType === 'windows') {
4072
4072
  return this.http
4073
4073
  .get(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/userClaims`)
4074
4074
  .pipe(tap((userClaims) => {
@@ -4824,6 +4824,35 @@ class TruDetailViewBase {
4824
4824
  this.desktopViewEventNotifier = desktopViewEventNotifier;
4825
4825
  this.util = util;
4826
4826
  }
4827
+ onDocumentKeydown = (event) => {
4828
+ if (this.view.active && this.view.window.active) {
4829
+ let keySequence = this.util.getKeySequence(event);
4830
+ if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
4831
+ //this.onAddEntity();
4832
+ event.preventDefault();
4833
+ }
4834
+ if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
4835
+ this.onDeleteEntity();
4836
+ event.preventDefault();
4837
+ }
4838
+ if (keySequence === 'ctrl+up' || keySequence === 'meta+up') {
4839
+ this.onFirstEntity();
4840
+ event.preventDefault();
4841
+ }
4842
+ if (keySequence === 'ctrl+left' || keySequence === 'meta+left') {
4843
+ this.onPreviousEntity();
4844
+ event.preventDefault();
4845
+ }
4846
+ if (keySequence === 'ctrl+right' || keySequence === 'meta+right') {
4847
+ this.onNextEntity();
4848
+ event.preventDefault();
4849
+ }
4850
+ if (keySequence === 'ctrl+down' || keySequence === 'meta+down') {
4851
+ this.onLastEntity();
4852
+ event.preventDefault();
4853
+ }
4854
+ }
4855
+ };
4827
4856
  calculateNextIndex = () => {
4828
4857
  let nextIndex = 0;
4829
4858
  var removedRecords = this.recordsBeforeRevert - this.entities.length;
@@ -4860,7 +4889,6 @@ class TruDetailViewBase {
4860
4889
  }
4861
4890
  else {
4862
4891
  this.entities.push(newEntity);
4863
- this.setEntityDisplayValues(this.tableName, newEntity);
4864
4892
  }
4865
4893
  };
4866
4894
  onCloneEntity = () => {
@@ -4926,38 +4954,7 @@ class TruDetailViewBase {
4926
4954
  if (this.active)
4927
4955
  this.setEntityDisplayValues(this.tableName);
4928
4956
  }));
4929
- this.subs.push(fromEvent(document, 'keydown').subscribe((event) => {
4930
- if (this.view.active && this.view.window.active) {
4931
- let keySequence = this.util.getKeySequence(event);
4932
- if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
4933
- //this.onAddEntity();
4934
- event.preventDefault();
4935
- }
4936
- if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
4937
- this.onDeleteEntity();
4938
- event.preventDefault();
4939
- }
4940
- if (keySequence === 'ctrl+up' || keySequence === 'meta+up') {
4941
- this.onFirstEntity();
4942
- event.preventDefault();
4943
- }
4944
- if (keySequence === 'ctrl+left' || keySequence === 'meta+left') {
4945
- this.onPreviousEntity();
4946
- event.preventDefault();
4947
- }
4948
- if (keySequence === 'ctrl+right' || keySequence === 'meta+right') {
4949
- this.onNextEntity();
4950
- event.preventDefault();
4951
- }
4952
- if (keySequence === 'ctrl+down' || keySequence === 'meta+down') {
4953
- this.onLastEntity();
4954
- event.preventDefault();
4955
- }
4956
- var targetIsControl = this.util.targetIsControl(event.target);
4957
- if (!targetIsControl && event.ctrlKey || event.altKey)
4958
- event.preventDefault();
4959
- }
4960
- }));
4957
+ this.subs.push(fromEvent(document, 'keydown').subscribe(this.onDocumentKeydown));
4961
4958
  }
4962
4959
  setNavigationIndex(index) {
4963
4960
  this.navigationIndex = index;
@@ -8642,6 +8639,30 @@ class TruDataGrid {
8642
8639
  this.desktopViewEventNotifier = desktopViewEventNotifier;
8643
8640
  this.tabGroupEventNotifier = tabGroupEventNotifier;
8644
8641
  }
8642
+ onDocumentKeydown = (event) => {
8643
+ if (this.config.view.active && this.config.view.window.active) {
8644
+ if (event.code === 'Space' && event.target.classList.contains('ag-cell-value')) {
8645
+ event.preventDefault();
8646
+ }
8647
+ let keySequence = this.util.getKeySequence(event);
8648
+ if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
8649
+ this.onAdd();
8650
+ event.preventDefault();
8651
+ }
8652
+ if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
8653
+ this.onDelete();
8654
+ event.preventDefault();
8655
+ }
8656
+ if (keySequence === 'ctrl+k' || keySequence === 'meta+k') {
8657
+ this.onKeep();
8658
+ event.preventDefault();
8659
+ }
8660
+ if (keySequence === 'ctrl+r' || keySequence === 'meta+r') {
8661
+ this.onRemove();
8662
+ event.preventDefault();
8663
+ }
8664
+ }
8665
+ };
8645
8666
  enhanceRowDataForEntity = (entity) => {
8646
8667
  let rowData = this.config.resultConfig.rowDataEnhancer(entity);
8647
8668
  rowData.$entity = entity;
@@ -8773,33 +8794,7 @@ class TruDataGrid {
8773
8794
  }
8774
8795
  this.api.refreshCells({ force: true });
8775
8796
  }));
8776
- this.subs.push(fromEvent(document, 'keydown').subscribe((event) => {
8777
- if (this.config.view.active && this.config.view.window.active) {
8778
- if (event.code === 'Space' && event.target.classList.contains('ag-cell-value')) {
8779
- event.preventDefault();
8780
- }
8781
- let keySequence = this.util.getKeySequence(event);
8782
- if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
8783
- this.onAdd();
8784
- event.preventDefault();
8785
- }
8786
- if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
8787
- this.onDelete();
8788
- event.preventDefault();
8789
- }
8790
- if (keySequence === 'ctrl+k' || keySequence === 'meta+k') {
8791
- this.onKeep();
8792
- event.preventDefault();
8793
- }
8794
- if (keySequence === 'ctrl+r' || keySequence === 'meta+r') {
8795
- this.onRemove();
8796
- event.preventDefault();
8797
- }
8798
- var targetIsControl = this.util.targetIsControl(event.target);
8799
- if (!targetIsControl && event.ctrlKey || event.altKey)
8800
- event.preventDefault();
8801
- }
8802
- }));
8797
+ this.subs.push(fromEvent(document, 'keydown').subscribe(this.onDocumentKeydown));
8803
8798
  this.subs.push(fromEvent(document, 'mousedown').subscribe((event) => {
8804
8799
  if (this.config.view.active &&
8805
8800
  this.config.view.window.active &&
@@ -9120,9 +9115,10 @@ class TruDataGrid {
9120
9115
  this.firstSearchRan = true;
9121
9116
  this.api?.hideOverlay();
9122
9117
  this.api?.showLoadingOverlay();
9123
- let searchLocally = this.entity && this.entity['Ref'] < 0 || this.loadedEntities.some((ref) => {
9124
- return ref === this.entity['Ref'];
9125
- });
9118
+ let parentIsUnsaved = !!this.entity && this.entity.Ref < 0;
9119
+ let parentWasLoaded = !!this.entity && this.loadedEntities.indexOf(this.entity.Ref) > -1;
9120
+ let canSearchLocally = this.config.resultConfig.canSearchLocally !== false;
9121
+ let searchLocally = parentIsUnsaved || (canSearchLocally && parentWasLoaded);
9126
9122
  let joins = [];
9127
9123
  if (searchLocally) {
9128
9124
  joins.push(this.dataContext.entityAccess().searchCacheOnly(this.config.resultConfig.entityType, setupQuery, this.config.resultConfig.expands));
@@ -9145,7 +9141,7 @@ class TruDataGrid {
9145
9141
  },
9146
9142
  complete: () => {
9147
9143
  if (this.gridType !== TruDataGridTypes.Search)
9148
- this.loadedEntities.push(this.entity[this.entity.constructor.name + 'Ref']);
9144
+ this.loadedEntities.push(this.entity.Ref);
9149
9145
  this.api.hideOverlay();
9150
9146
  if (this.rowData === null || !this.rowData.length) {
9151
9147
  this.api.showNoRowsOverlay();
@@ -10658,9 +10654,6 @@ class TruDesktopWindow {
10658
10654
  this.lastView();
10659
10655
  event.preventDefault();
10660
10656
  }
10661
- var targetIsControl = this.util.targetIsControl(event.target);
10662
- if (!targetIsControl && event.ctrlKey || event.altKey)
10663
- event.preventDefault();
10664
10657
  };
10665
10658
  /**
10666
10659
  * @tru.doc watch
@@ -11532,8 +11525,6 @@ class TruDesktop {
11532
11525
  onKeyDown = (event) => {
11533
11526
  if (event.key === 'Control' || event.key === 'Shift')
11534
11527
  return;
11535
- if (event.altKey)
11536
- event.preventDefault();
11537
11528
  var keySequence = this.util.getKeySequence(event);
11538
11529
  if (keySequence === 'alt+m') { //Maximize
11539
11530
  var activeWindow = this.getActiveWindow();
@@ -11597,10 +11588,6 @@ class TruDesktop {
11597
11588
  this.restoreSavedPosition(activeWindow);
11598
11589
  event.preventDefault();
11599
11590
  }
11600
- if (keySequence === 'alt+d') { //Toggle Desktop
11601
- //this.desktopShown = this.hideShowAll();
11602
- event.preventDefault();
11603
- }
11604
11591
  if (event.shiftKey)
11605
11592
  this.shiftPressed = true;
11606
11593
  if (event.altKey)
@@ -12061,13 +12048,26 @@ class TruLogin {
12061
12048
  this.appEnvironment = appEnvironment;
12062
12049
  this.title = appEnvironment.loginFormTitle;
12063
12050
  }
12051
+ ngOnInit() {
12052
+ if (this.isWindowsAuth)
12053
+ this.loginWithWindows();
12054
+ }
12064
12055
  get f() {
12065
12056
  return this.loginForm.controls;
12066
12057
  }
12058
+ get isWindowsAuth() {
12059
+ return this.appEnvironment.authType === 'windows';
12060
+ }
12067
12061
  isDisabled = () => {
12062
+ if (this.isWindowsAuth)
12063
+ return this.isLoggingIn;
12068
12064
  return !this.f.username.value || !this.f.password.value || this.isLoggingIn;
12069
12065
  };
12070
12066
  onSubmit() {
12067
+ if (this.isWindowsAuth) {
12068
+ this.loginWithWindows();
12069
+ return;
12070
+ }
12071
12071
  const loginRequest = {
12072
12072
  username: this.f.username.value,
12073
12073
  password: this.f.password.value
@@ -12090,12 +12090,32 @@ class TruLogin {
12090
12090
  });
12091
12091
  }
12092
12092
  }
12093
+ loginWithWindows() {
12094
+ this.isLoggingIn = true;
12095
+ this.auth
12096
+ .login(null).pipe(finalize(() => {
12097
+ this.isLoggingIn = false;
12098
+ }))
12099
+ .subscribe(() => {
12100
+ this.isLoggingIn = false;
12101
+ }, (error) => {
12102
+ if (error.status === 401) {
12103
+ this.loginError = "Windows authentication failed";
12104
+ }
12105
+ else if (error.status === 403) {
12106
+ this.loginError = error.error || "Your Windows account is not authorized for this application";
12107
+ }
12108
+ else {
12109
+ this.loginError = "Invalid Login - Error: " + error.status;
12110
+ }
12111
+ });
12112
+ }
12093
12113
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TruLogin, deps: [{ token: TruAuth }, { token: TruAppEnvironment }], target: i0.ɵɵFactoryTarget.Component });
12094
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TruLogin, isStandalone: false, 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> {{title}} </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\" [type]=\"passwordVisible ? 'text' : 'password'\">\r\n <button class=\"visibility-button\" [disableRipple]=\"true\" type=\"button\" mat-icon-button matSuffix (click)=\"passwordVisible = !passwordVisible\">\r\n <mat-icon class=\"visibility\" *ngIf=\"passwordVisible\" [svgIcon]=\"'visibility-icon'\">visibility-icon</mat-icon>\r\n <mat-icon class=\"visibility-off\" *ngIf=\"!passwordVisible\" [svgIcon]=\"'visibility-off-icon'\">visibility-off-icon</mat-icon>\r\n </button>\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}::ng-deep .login-wrapper .mat-mdc-icon-button.mat-mdc-button-base{height:20px;width:20px;padding:0!important}::ng-deep .login-wrapper .mat-icon{height:20px;width:30px;vertical-align:middle}::ng-deep .login-wrapper .material-icons{font-size:18px}::ng-deep .login-wrapper .visibility svg{fill:#006dcc;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-off svg{fill:#787878;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-button{--mat-text-button-state-layer-color: none}::ng-deep .login-wrapper button:focus{outline:none!important}::ng-deep .login-wrapper .mat-button-focus-overlay{display:none!important}::ng-deep .login-wrapper .mat-mdc-button-persistent-ripple{display:none!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] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i5$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.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: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
12114
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TruLogin, isStandalone: false, 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> {{title}} </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <ng-container *ngIf=\"isWindowsAuth; else passwordLogin\"></ng-container>\r\n <ng-template #passwordLogin>\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\" [type]=\"passwordVisible ? 'text' : 'password'\">\r\n <button class=\"visibility-button\" [disableRipple]=\"true\" type=\"button\" mat-icon-button matSuffix (click)=\"passwordVisible = !passwordVisible\">\r\n <mat-icon class=\"visibility\" *ngIf=\"passwordVisible\" [svgIcon]=\"'visibility-icon'\">visibility-icon</mat-icon>\r\n <mat-icon class=\"visibility-off\" *ngIf=\"!passwordVisible\" [svgIcon]=\"'visibility-off-icon'\">visibility-off-icon</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </ng-template>\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 *ngIf=\"!isWindowsAuth\">\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}::ng-deep .login-wrapper .mat-mdc-icon-button.mat-mdc-button-base{height:20px;width:20px;padding:0!important}::ng-deep .login-wrapper .mat-icon{height:20px;width:30px;vertical-align:middle}::ng-deep .login-wrapper .material-icons{font-size:18px}::ng-deep .login-wrapper .visibility svg{fill:#006dcc;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-off svg{fill:#787878;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-button{--mat-text-button-state-layer-color: none}::ng-deep .login-wrapper button:focus{outline:none!important}::ng-deep .login-wrapper .mat-button-focus-overlay{display:none!important}::ng-deep .login-wrapper .mat-mdc-button-persistent-ripple{display:none!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] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i5$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i5$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i5$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i8.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: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
12095
12115
  }
12096
12116
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TruLogin, decorators: [{
12097
12117
  type: Component,
12098
- args: [{ selector: 'tru-login', standalone: false, 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> {{title}} </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\" [type]=\"passwordVisible ? 'text' : 'password'\">\r\n <button class=\"visibility-button\" [disableRipple]=\"true\" type=\"button\" mat-icon-button matSuffix (click)=\"passwordVisible = !passwordVisible\">\r\n <mat-icon class=\"visibility\" *ngIf=\"passwordVisible\" [svgIcon]=\"'visibility-icon'\">visibility-icon</mat-icon>\r\n <mat-icon class=\"visibility-off\" *ngIf=\"!passwordVisible\" [svgIcon]=\"'visibility-off-icon'\">visibility-off-icon</mat-icon>\r\n </button>\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}::ng-deep .login-wrapper .mat-mdc-icon-button.mat-mdc-button-base{height:20px;width:20px;padding:0!important}::ng-deep .login-wrapper .mat-icon{height:20px;width:30px;vertical-align:middle}::ng-deep .login-wrapper .material-icons{font-size:18px}::ng-deep .login-wrapper .visibility svg{fill:#006dcc;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-off svg{fill:#787878;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-button{--mat-text-button-state-layer-color: none}::ng-deep .login-wrapper button:focus{outline:none!important}::ng-deep .login-wrapper .mat-button-focus-overlay{display:none!important}::ng-deep .login-wrapper .mat-mdc-button-persistent-ripple{display:none!important}\n"] }]
12118
+ args: [{ selector: 'tru-login', standalone: false, 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> {{title}} </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <ng-container *ngIf=\"isWindowsAuth; else passwordLogin\"></ng-container>\r\n <ng-template #passwordLogin>\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\" [type]=\"passwordVisible ? 'text' : 'password'\">\r\n <button class=\"visibility-button\" [disableRipple]=\"true\" type=\"button\" mat-icon-button matSuffix (click)=\"passwordVisible = !passwordVisible\">\r\n <mat-icon class=\"visibility\" *ngIf=\"passwordVisible\" [svgIcon]=\"'visibility-icon'\">visibility-icon</mat-icon>\r\n <mat-icon class=\"visibility-off\" *ngIf=\"!passwordVisible\" [svgIcon]=\"'visibility-off-icon'\">visibility-off-icon</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </ng-template>\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 *ngIf=\"!isWindowsAuth\">\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}::ng-deep .login-wrapper .mat-mdc-icon-button.mat-mdc-button-base{height:20px;width:20px;padding:0!important}::ng-deep .login-wrapper .mat-icon{height:20px;width:30px;vertical-align:middle}::ng-deep .login-wrapper .material-icons{font-size:18px}::ng-deep .login-wrapper .visibility svg{fill:#006dcc;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-off svg{fill:#787878;height:18px;width:18px;margin-top:5px}::ng-deep .login-wrapper .visibility-button{--mat-text-button-state-layer-color: none}::ng-deep .login-wrapper button:focus{outline:none!important}::ng-deep .login-wrapper .mat-button-focus-overlay{display:none!important}::ng-deep .login-wrapper .mat-mdc-button-persistent-ripple{display:none!important}\n"] }]
12099
12119
  }], ctorParameters: () => [{ type: TruAuth }, { type: TruAppEnvironment }] });
12100
12120
 
12101
12121
  class TruAuthJwtStrategy {
@@ -12172,7 +12192,7 @@ class TruAuthInterceptor {
12172
12192
  intercept(request, next) {
12173
12193
  if (this.appEnvironment.authType === 'jwt')
12174
12194
  request = this.addToken(request, String(this.jwt.getToken()));
12175
- if (this.appEnvironment.authType === 'session')
12195
+ if (this.appEnvironment.authType === 'session' || this.appEnvironment.authType === 'windows')
12176
12196
  request = request.clone({
12177
12197
  withCredentials: true
12178
12198
  });
@@ -12255,6 +12275,19 @@ class TruAuthSessionStrategy {
12255
12275
  }
12256
12276
  }
12257
12277
 
12278
+ class TruAuthWindowsStrategy {
12279
+ doLoginUser(user) {
12280
+ }
12281
+ doLogoutUser() {
12282
+ }
12283
+ createUser(user) {
12284
+ return of({});
12285
+ }
12286
+ isLoggedIn() {
12287
+ return false;
12288
+ }
12289
+ }
12290
+
12258
12291
  const TruAuthStrategyProvider = {
12259
12292
  provide: TRU_AUTH_STRATEGY,
12260
12293
  deps: [HttpClient, TruAppEnvironment],
@@ -12264,6 +12297,8 @@ const TruAuthStrategyProvider = {
12264
12297
  return new TruAuthSessionStrategy(http);
12265
12298
  case "jwt":
12266
12299
  return new TruAuthJwtStrategy();
12300
+ case "windows":
12301
+ return new TruAuthWindowsStrategy();
12267
12302
  default:
12268
12303
  throw new Error("Invalid auth strategy");
12269
12304
  }