@trudb/tru-common-lib 0.0.984 → 0.0.986
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/esm2022/lib/components/data-grid/tru-data-grid.mjs +2 -1
- package/esm2022/lib/components/grid-validation-dialog/tru-grid-validation-dialog.mjs +11 -16
- package/esm2022/lib/components/validation-dialog/tru-validation-dialog.mjs +2 -2
- package/esm2022/lib/services/tru-data-context.mjs +3 -9
- package/fesm2022/trudb-tru-common-lib.mjs +15 -25
- package/fesm2022/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/grid-validation-dialog/tru-grid-validation-dialog.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, Injectable, Component, Inject, HostListener, InjectionToken, NgModule, EventEmitter,
|
|
2
|
+
import { Directive, Input, Injectable, Component, Inject, HostListener, InjectionToken, NgModule, EventEmitter, Output, ViewEncapsulation, createComponent, APP_INITIALIZER, ViewChildren, ViewChild } from '@angular/core';
|
|
3
3
|
import { EntityAspect, MetadataStore, DataService, EntityManager, EntityQuery, Predicate, FetchStrategy, EntityState, breeze, BinaryPredicate, AndOrPredicate } from 'breeze-client';
|
|
4
4
|
import { BehaviorSubject, from, defer, of, Subject, Observable, skip, forkJoin, finalize, throwError } from 'rxjs';
|
|
5
5
|
import * as _ from 'underscore';
|
|
@@ -1196,14 +1196,8 @@ class TruDataContext {
|
|
|
1196
1196
|
};
|
|
1197
1197
|
getValidationErrorsForProperty = (entity, propertyName) => {
|
|
1198
1198
|
var errors = entity.entityAspect.getValidationErrors();
|
|
1199
|
-
errors = errors.
|
|
1200
|
-
|
|
1201
|
-
return {
|
|
1202
|
-
entity: entity,
|
|
1203
|
-
errorMessage: err.errorMessage,
|
|
1204
|
-
property: err.property
|
|
1205
|
-
};
|
|
1206
|
-
}
|
|
1199
|
+
errors = errors.filter((err) => {
|
|
1200
|
+
return err.propertyName === propertyName;
|
|
1207
1201
|
});
|
|
1208
1202
|
return errors;
|
|
1209
1203
|
};
|
|
@@ -2950,6 +2944,7 @@ class TruGridValidationDialog {
|
|
|
2950
2944
|
elementRef;
|
|
2951
2945
|
util;
|
|
2952
2946
|
config;
|
|
2947
|
+
close = new EventEmitter();
|
|
2953
2948
|
errorMsg = '';
|
|
2954
2949
|
rowElement;
|
|
2955
2950
|
cellElement;
|
|
@@ -2972,6 +2967,7 @@ class TruGridValidationDialog {
|
|
|
2972
2967
|
entity.entityAspect.setUnchanged();
|
|
2973
2968
|
entity.Merge_Data_Set.clearAll();
|
|
2974
2969
|
entity.entityAspect.validateEntity();
|
|
2970
|
+
this.close.emit();
|
|
2975
2971
|
};
|
|
2976
2972
|
onAccept = () => {
|
|
2977
2973
|
let entity = this.config.entity;
|
|
@@ -2984,42 +2980,35 @@ class TruGridValidationDialog {
|
|
|
2984
2980
|
if (this.config.mergeData?.isEmpty())
|
|
2985
2981
|
entity.entityAspect.setUnchanged();
|
|
2986
2982
|
entity.entityAspect.validateEntity();
|
|
2983
|
+
this.close.emit();
|
|
2987
2984
|
};
|
|
2988
2985
|
onDecline = () => {
|
|
2989
2986
|
let entity = this.config.entity;
|
|
2990
2987
|
this.config.mergeData?.clearAll();
|
|
2991
2988
|
entity.entityAspect.validateEntity();
|
|
2989
|
+
this.close.emit();
|
|
2992
2990
|
};
|
|
2993
2991
|
ngOnInit() { }
|
|
2994
2992
|
ngAfterViewInit() {
|
|
2995
2993
|
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
2996
|
-
this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
|
|
2997
2994
|
this.rowElement.style.zIndex = '10000000000';
|
|
2998
|
-
this.cellElement.classList.remove('hide');
|
|
2999
|
-
this.cellElement.classList.add('show');
|
|
3000
2995
|
this.errorMsg = this.config.errorMsg;
|
|
3001
|
-
//this.listeners.push(this.renderer.listen(this.cellElement, 'mouseenter', (event: MouseEvent) => {
|
|
3002
|
-
// this.rowElement.style.zIndex = '10000000000';
|
|
3003
|
-
// this.cellElement.classList.remove('hide');
|
|
3004
|
-
// this.cellElement.classList.add('show');
|
|
3005
|
-
//}));
|
|
3006
|
-
//this.listeners.push(this.renderer.listen(this.cellElement, 'mouseleave', (event: MouseEvent) => {
|
|
3007
|
-
// this.rowElement.style.zIndex = 'auto';
|
|
3008
|
-
// this.cellElement.classList.remove('show');
|
|
3009
|
-
// this.cellElement.classList.add('hide');
|
|
3010
|
-
//}));
|
|
3011
2996
|
}
|
|
3012
2997
|
ngOnDestroy() {
|
|
2998
|
+
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
2999
|
+
this.rowElement.style.zIndex = 'auto';
|
|
3013
3000
|
this.listeners.forEach(l => l());
|
|
3014
3001
|
}
|
|
3015
3002
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: TruUtil }], target: i0.ɵɵFactoryTarget.Component });
|
|
3016
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruGridValidationDialog, selector: "tru-grid-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n<div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n</div>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3003
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruGridValidationDialog, selector: "tru-grid-validation-dialog", inputs: { config: "config" }, outputs: { close: "close" }, ngImport: i0, template: "<i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n<div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n</div>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3017
3004
|
}
|
|
3018
3005
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, decorators: [{
|
|
3019
3006
|
type: Component,
|
|
3020
3007
|
args: [{ selector: 'tru-grid-validation-dialog', template: "<i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n<div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n</div>\r\n", styles: ["::ng-deep .ag-row .ag-cell-value .invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px}::ng-deep .ag-row .ag-cell-value.hide .invalid{display:none!important}::ng-deep .ag-row .ag-cell-value.show .invalid{display:inline-block!important}::ng-deep .ag-row .ag-cell-value.invalid.show{overflow:visible!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}::ng-deep .ag-row .ag-cell-value .invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"] }]
|
|
3021
3008
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
|
|
3022
3009
|
type: Input
|
|
3010
|
+
}], close: [{
|
|
3011
|
+
type: Output
|
|
3023
3012
|
}] } });
|
|
3024
3013
|
|
|
3025
3014
|
class TruSearchResultViewManager {
|
|
@@ -3892,6 +3881,7 @@ class TruDataGrid {
|
|
|
3892
3881
|
hostElement: dialogElement,
|
|
3893
3882
|
});
|
|
3894
3883
|
componentRef.instance.config = config;
|
|
3884
|
+
componentRef.instance.close.subscribe(() => { componentRef.destroy(); });
|
|
3895
3885
|
this.validationDialog = componentRef;
|
|
3896
3886
|
this.app.attachView(componentRef.hostView);
|
|
3897
3887
|
componentRef.changeDetectorRef.detectChanges();
|
|
@@ -6939,11 +6929,11 @@ class TruValidationDialog {
|
|
|
6939
6929
|
this.listeners.forEach(l => l());
|
|
6940
6930
|
}
|
|
6941
6931
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialog, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: TruUtil }], target: i0.ɵɵFactoryTarget.Component });
|
|
6942
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruValidationDialog, selector: "tru-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"invalid hide\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: [".invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px!important
|
|
6932
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruValidationDialog, selector: "tru-validation-dialog", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"invalid hide\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: [".invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px!important;display:inline-block!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}.invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
6943
6933
|
}
|
|
6944
6934
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialog, decorators: [{
|
|
6945
6935
|
type: Component,
|
|
6946
|
-
args: [{ selector: 'tru-validation-dialog', template: "<div class=\"invalid hide\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: [".invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px!important
|
|
6936
|
+
args: [{ selector: 'tru-validation-dialog', template: "<div class=\"invalid hide\">\r\n <i class=\"icon-warning-sign icon-white\"></i>{{config.errorMsg}}\r\n <div *ngIf=\"config.mergeData\">\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAcceptAll()\">Accept All</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onAccept()\">Accept</button>\r\n <button class=\"md-primary md-button ng-scope md-ink-ripple merge-button\" (click)=\"onDecline()\">Decline</button>\r\n </div>\r\n</div>\r\n<span class=\"invalid-flag\"></span>\r\n", styles: [".invalid{position:absolute;left:0;top:24px;-moz-min-width:200px;-ms-min-width:200px;-o-min-width:200px;-webkit-min-width:200px;min-width:200px;min-height:20px;max-width:500px;max-height:500px;font-size:12px!important;display:inline-block!important}.invalid-flag{box-sizing:border-box;position:absolute;left:0;top:0;width:8px;height:8px;border-bottom:solid 4px transparent;border-right:solid 4px transparent;border-left:solid 4px red;border-top:solid 4px red}.invalid-triangle:after{box-sizing:border-box}.invalid{background-color:#bd362f;margin:2px 0 0;padding:4px 10px;border-radius:3px!important;background-position:15px center;background-repeat:no-repeat;-ms-box-shadow:0 0 12px #999999;box-shadow:0 0 12px #999;color:#fff;-ms-opacity:.9;opacity:.9;z-index:1000}.merge-button{margin:5px;background-color:#fff}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:before{border-bottom-color:red!important}::ng-deep .mat-mdc-form-field.invalid .mdc-line-ripple:after{border-bottom-color:red!important}.invalid{font-family:Calibri,Helvetica,Arial,sans-serif!important}i{line-height:24px!important}\n"] }]
|
|
6947
6937
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
|
|
6948
6938
|
type: Input
|
|
6949
6939
|
}] } });
|