@trudb/tru-common-lib 0.2.529 → 0.2.533
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/fesm2022/trudb-tru-common-lib.mjs +81 -117
- package/fesm2022/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/base-views/detail/tru-detail-view-base.d.ts +0 -1
- package/lib/components/data-grid/tru-data-grid.d.ts +0 -1
- package/lib/components/login/classes/tru-auth-strategy-provider.d.ts +1 -2
- package/lib/components/login/services/tru-auth.d.ts +1 -1
- package/lib/components/login/tru-login.d.ts +2 -6
- package/lib/services/tru-app-environment.d.ts +2 -2
- package/package.json +1 -1
- package/lib/components/login/classes/tru-auth-windows-strategy.d.ts +0 -9
|
@@ -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') {
|
|
4072
4072
|
return this.http
|
|
4073
4073
|
.get(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/userClaims`)
|
|
4074
4074
|
.pipe(tap((userClaims) => {
|
|
@@ -4824,35 +4824,6 @@ 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
|
-
};
|
|
4856
4827
|
calculateNextIndex = () => {
|
|
4857
4828
|
let nextIndex = 0;
|
|
4858
4829
|
var removedRecords = this.recordsBeforeRevert - this.entities.length;
|
|
@@ -4954,7 +4925,38 @@ class TruDetailViewBase {
|
|
|
4954
4925
|
if (this.active)
|
|
4955
4926
|
this.setEntityDisplayValues(this.tableName);
|
|
4956
4927
|
}));
|
|
4957
|
-
this.subs.push(fromEvent(document, 'keydown').subscribe(
|
|
4928
|
+
this.subs.push(fromEvent(document, 'keydown').subscribe((event) => {
|
|
4929
|
+
if (this.view.active && this.view.window.active) {
|
|
4930
|
+
let keySequence = this.util.getKeySequence(event);
|
|
4931
|
+
if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
|
|
4932
|
+
//this.onAddEntity();
|
|
4933
|
+
event.preventDefault();
|
|
4934
|
+
}
|
|
4935
|
+
if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
|
|
4936
|
+
this.onDeleteEntity();
|
|
4937
|
+
event.preventDefault();
|
|
4938
|
+
}
|
|
4939
|
+
if (keySequence === 'ctrl+up' || keySequence === 'meta+up') {
|
|
4940
|
+
this.onFirstEntity();
|
|
4941
|
+
event.preventDefault();
|
|
4942
|
+
}
|
|
4943
|
+
if (keySequence === 'ctrl+left' || keySequence === 'meta+left') {
|
|
4944
|
+
this.onPreviousEntity();
|
|
4945
|
+
event.preventDefault();
|
|
4946
|
+
}
|
|
4947
|
+
if (keySequence === 'ctrl+right' || keySequence === 'meta+right') {
|
|
4948
|
+
this.onNextEntity();
|
|
4949
|
+
event.preventDefault();
|
|
4950
|
+
}
|
|
4951
|
+
if (keySequence === 'ctrl+down' || keySequence === 'meta+down') {
|
|
4952
|
+
this.onLastEntity();
|
|
4953
|
+
event.preventDefault();
|
|
4954
|
+
}
|
|
4955
|
+
var targetIsControl = this.util.targetIsControl(event.target);
|
|
4956
|
+
if (!targetIsControl && event.ctrlKey || event.altKey)
|
|
4957
|
+
event.preventDefault();
|
|
4958
|
+
}
|
|
4959
|
+
}));
|
|
4958
4960
|
}
|
|
4959
4961
|
setNavigationIndex(index) {
|
|
4960
4962
|
this.navigationIndex = index;
|
|
@@ -6099,11 +6101,11 @@ class TruCardColumn {
|
|
|
6099
6101
|
this.columnFilterChoices = [];
|
|
6100
6102
|
this.columnFilterRefs = [];
|
|
6101
6103
|
this.cardFilterStr = null;
|
|
6102
|
-
if (!newEntities.length) {
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
}
|
|
6104
|
+
//if (!newEntities.length) {
|
|
6105
|
+
// this.lockedColumns = [];
|
|
6106
|
+
// this.columns = [];
|
|
6107
|
+
// return;
|
|
6108
|
+
//}
|
|
6107
6109
|
let lockedColumns = [];
|
|
6108
6110
|
let emptyParents = [];
|
|
6109
6111
|
let columns = [];
|
|
@@ -8639,30 +8641,6 @@ class TruDataGrid {
|
|
|
8639
8641
|
this.desktopViewEventNotifier = desktopViewEventNotifier;
|
|
8640
8642
|
this.tabGroupEventNotifier = tabGroupEventNotifier;
|
|
8641
8643
|
}
|
|
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
|
-
};
|
|
8666
8644
|
enhanceRowDataForEntity = (entity) => {
|
|
8667
8645
|
let rowData = this.config.resultConfig.rowDataEnhancer(entity);
|
|
8668
8646
|
rowData.$entity = entity;
|
|
@@ -8794,7 +8772,33 @@ class TruDataGrid {
|
|
|
8794
8772
|
}
|
|
8795
8773
|
this.api.refreshCells({ force: true });
|
|
8796
8774
|
}));
|
|
8797
|
-
this.subs.push(fromEvent(document, 'keydown').subscribe(
|
|
8775
|
+
this.subs.push(fromEvent(document, 'keydown').subscribe((event) => {
|
|
8776
|
+
if (this.config.view.active && this.config.view.window.active) {
|
|
8777
|
+
if (event.code === 'Space' && event.target.classList.contains('ag-cell-value')) {
|
|
8778
|
+
event.preventDefault();
|
|
8779
|
+
}
|
|
8780
|
+
let keySequence = this.util.getKeySequence(event);
|
|
8781
|
+
if (keySequence === 'ctrl+i' || keySequence === 'meta+i') {
|
|
8782
|
+
this.onAdd();
|
|
8783
|
+
event.preventDefault();
|
|
8784
|
+
}
|
|
8785
|
+
if (keySequence === 'ctrl+d' || keySequence === 'meta+d') {
|
|
8786
|
+
this.onDelete();
|
|
8787
|
+
event.preventDefault();
|
|
8788
|
+
}
|
|
8789
|
+
if (keySequence === 'ctrl+k' || keySequence === 'meta+k') {
|
|
8790
|
+
this.onKeep();
|
|
8791
|
+
event.preventDefault();
|
|
8792
|
+
}
|
|
8793
|
+
if (keySequence === 'ctrl+r' || keySequence === 'meta+r') {
|
|
8794
|
+
this.onRemove();
|
|
8795
|
+
event.preventDefault();
|
|
8796
|
+
}
|
|
8797
|
+
var targetIsControl = this.util.targetIsControl(event.target);
|
|
8798
|
+
if (!targetIsControl && event.ctrlKey || event.altKey)
|
|
8799
|
+
event.preventDefault();
|
|
8800
|
+
}
|
|
8801
|
+
}));
|
|
8798
8802
|
this.subs.push(fromEvent(document, 'mousedown').subscribe((event) => {
|
|
8799
8803
|
if (this.config.view.active &&
|
|
8800
8804
|
this.config.view.window.active &&
|
|
@@ -9115,10 +9119,9 @@ class TruDataGrid {
|
|
|
9115
9119
|
this.firstSearchRan = true;
|
|
9116
9120
|
this.api?.hideOverlay();
|
|
9117
9121
|
this.api?.showLoadingOverlay();
|
|
9118
|
-
let
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
let searchLocally = parentIsUnsaved || (canSearchLocally && parentWasLoaded);
|
|
9122
|
+
let searchLocally = this.entity && this.entity['Ref'] < 0 || this.loadedEntities.some((ref) => {
|
|
9123
|
+
return ref === this.entity['Ref'];
|
|
9124
|
+
});
|
|
9122
9125
|
let joins = [];
|
|
9123
9126
|
if (searchLocally) {
|
|
9124
9127
|
joins.push(this.dataContext.entityAccess().searchCacheOnly(this.config.resultConfig.entityType, setupQuery, this.config.resultConfig.expands));
|
|
@@ -9141,7 +9144,7 @@ class TruDataGrid {
|
|
|
9141
9144
|
},
|
|
9142
9145
|
complete: () => {
|
|
9143
9146
|
if (this.gridType !== TruDataGridTypes.Search)
|
|
9144
|
-
this.loadedEntities.push(this.entity.Ref);
|
|
9147
|
+
this.loadedEntities.push(this.entity[this.entity.constructor.name + 'Ref']);
|
|
9145
9148
|
this.api.hideOverlay();
|
|
9146
9149
|
if (this.rowData === null || !this.rowData.length) {
|
|
9147
9150
|
this.api.showNoRowsOverlay();
|
|
@@ -10654,6 +10657,9 @@ class TruDesktopWindow {
|
|
|
10654
10657
|
this.lastView();
|
|
10655
10658
|
event.preventDefault();
|
|
10656
10659
|
}
|
|
10660
|
+
var targetIsControl = this.util.targetIsControl(event.target);
|
|
10661
|
+
if (!targetIsControl && event.ctrlKey || event.altKey)
|
|
10662
|
+
event.preventDefault();
|
|
10657
10663
|
};
|
|
10658
10664
|
/**
|
|
10659
10665
|
* @tru.doc watch
|
|
@@ -11525,6 +11531,8 @@ class TruDesktop {
|
|
|
11525
11531
|
onKeyDown = (event) => {
|
|
11526
11532
|
if (event.key === 'Control' || event.key === 'Shift')
|
|
11527
11533
|
return;
|
|
11534
|
+
if (event.altKey)
|
|
11535
|
+
event.preventDefault();
|
|
11528
11536
|
var keySequence = this.util.getKeySequence(event);
|
|
11529
11537
|
if (keySequence === 'alt+m') { //Maximize
|
|
11530
11538
|
var activeWindow = this.getActiveWindow();
|
|
@@ -11588,6 +11596,10 @@ class TruDesktop {
|
|
|
11588
11596
|
this.restoreSavedPosition(activeWindow);
|
|
11589
11597
|
event.preventDefault();
|
|
11590
11598
|
}
|
|
11599
|
+
if (keySequence === 'alt+d') { //Toggle Desktop
|
|
11600
|
+
//this.desktopShown = this.hideShowAll();
|
|
11601
|
+
event.preventDefault();
|
|
11602
|
+
}
|
|
11591
11603
|
if (event.shiftKey)
|
|
11592
11604
|
this.shiftPressed = true;
|
|
11593
11605
|
if (event.altKey)
|
|
@@ -12048,26 +12060,13 @@ class TruLogin {
|
|
|
12048
12060
|
this.appEnvironment = appEnvironment;
|
|
12049
12061
|
this.title = appEnvironment.loginFormTitle;
|
|
12050
12062
|
}
|
|
12051
|
-
ngOnInit() {
|
|
12052
|
-
if (this.isWindowsAuth)
|
|
12053
|
-
this.loginWithWindows();
|
|
12054
|
-
}
|
|
12055
12063
|
get f() {
|
|
12056
12064
|
return this.loginForm.controls;
|
|
12057
12065
|
}
|
|
12058
|
-
get isWindowsAuth() {
|
|
12059
|
-
return this.appEnvironment.authType === 'windows';
|
|
12060
|
-
}
|
|
12061
12066
|
isDisabled = () => {
|
|
12062
|
-
if (this.isWindowsAuth)
|
|
12063
|
-
return this.isLoggingIn;
|
|
12064
12067
|
return !this.f.username.value || !this.f.password.value || this.isLoggingIn;
|
|
12065
12068
|
};
|
|
12066
12069
|
onSubmit() {
|
|
12067
|
-
if (this.isWindowsAuth) {
|
|
12068
|
-
this.loginWithWindows();
|
|
12069
|
-
return;
|
|
12070
|
-
}
|
|
12071
12070
|
const loginRequest = {
|
|
12072
12071
|
username: this.f.username.value,
|
|
12073
12072
|
password: this.f.password.value
|
|
@@ -12090,32 +12089,12 @@ class TruLogin {
|
|
|
12090
12089
|
});
|
|
12091
12090
|
}
|
|
12092
12091
|
}
|
|
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
|
-
}
|
|
12113
12092
|
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 });
|
|
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 <
|
|
12093
|
+
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"] }] });
|
|
12115
12094
|
}
|
|
12116
12095
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TruLogin, decorators: [{
|
|
12117
12096
|
type: Component,
|
|
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 <
|
|
12097
|
+
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"] }]
|
|
12119
12098
|
}], ctorParameters: () => [{ type: TruAuth }, { type: TruAppEnvironment }] });
|
|
12120
12099
|
|
|
12121
12100
|
class TruAuthJwtStrategy {
|
|
@@ -12192,7 +12171,7 @@ class TruAuthInterceptor {
|
|
|
12192
12171
|
intercept(request, next) {
|
|
12193
12172
|
if (this.appEnvironment.authType === 'jwt')
|
|
12194
12173
|
request = this.addToken(request, String(this.jwt.getToken()));
|
|
12195
|
-
if (this.appEnvironment.authType === 'session'
|
|
12174
|
+
if (this.appEnvironment.authType === 'session')
|
|
12196
12175
|
request = request.clone({
|
|
12197
12176
|
withCredentials: true
|
|
12198
12177
|
});
|
|
@@ -12275,19 +12254,6 @@ class TruAuthSessionStrategy {
|
|
|
12275
12254
|
}
|
|
12276
12255
|
}
|
|
12277
12256
|
|
|
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
|
-
|
|
12291
12257
|
const TruAuthStrategyProvider = {
|
|
12292
12258
|
provide: TRU_AUTH_STRATEGY,
|
|
12293
12259
|
deps: [HttpClient, TruAppEnvironment],
|
|
@@ -12297,8 +12263,6 @@ const TruAuthStrategyProvider = {
|
|
|
12297
12263
|
return new TruAuthSessionStrategy(http);
|
|
12298
12264
|
case "jwt":
|
|
12299
12265
|
return new TruAuthJwtStrategy();
|
|
12300
|
-
case "windows":
|
|
12301
|
-
return new TruAuthWindowsStrategy();
|
|
12302
12266
|
default:
|
|
12303
12267
|
throw new Error("Invalid auth strategy");
|
|
12304
12268
|
}
|