@trudb/tru-common-lib 0.1.3 → 0.1.5
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 +10 -6
- package/esm2022/lib/components/validation-dialog/tru-validation-dialog.mjs +37 -14
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/trudb-tru-common-lib.mjs +160 -160
- package/fesm2022/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/validation-dialog/tru-validation-dialog.d.ts +5 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -2822,28 +2822,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
2822
2822
|
}]
|
|
2823
2823
|
}] });
|
|
2824
2824
|
|
|
2825
|
-
|
|
2825
|
+
var TruValidationDialogContext;
|
|
2826
|
+
(function (TruValidationDialogContext) {
|
|
2827
|
+
TruValidationDialogContext[TruValidationDialogContext["Control"] = 0] = "Control";
|
|
2828
|
+
TruValidationDialogContext[TruValidationDialogContext["Grid"] = 1] = "Grid";
|
|
2829
|
+
TruValidationDialogContext[TruValidationDialogContext["Card"] = 2] = "Card";
|
|
2830
|
+
})(TruValidationDialogContext || (TruValidationDialogContext = {}));
|
|
2831
|
+
|
|
2832
|
+
class TruValidationDialogConfig {
|
|
2826
2833
|
_entity;
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2834
|
+
_propertyConfig;
|
|
2835
|
+
_context;
|
|
2836
|
+
_isSubProperty;
|
|
2837
|
+
_ignore;
|
|
2838
|
+
_propertyName = '';
|
|
2839
|
+
_errorMsg = '';
|
|
2840
|
+
_mergeData = null;
|
|
2830
2841
|
get entity() {
|
|
2831
2842
|
return this._entity;
|
|
2832
2843
|
}
|
|
2844
|
+
get propertyConfig() {
|
|
2845
|
+
return this._propertyConfig;
|
|
2846
|
+
}
|
|
2847
|
+
get context() {
|
|
2848
|
+
return this._context;
|
|
2849
|
+
}
|
|
2850
|
+
get isSubProperty() {
|
|
2851
|
+
return this._isSubProperty;
|
|
2852
|
+
}
|
|
2853
|
+
get ignore() {
|
|
2854
|
+
return this._ignore;
|
|
2855
|
+
}
|
|
2833
2856
|
get propertyName() {
|
|
2834
2857
|
return this._propertyName;
|
|
2835
2858
|
}
|
|
2859
|
+
set propertyName(value) {
|
|
2860
|
+
this._propertyName = value;
|
|
2861
|
+
}
|
|
2836
2862
|
get errorMsg() {
|
|
2837
2863
|
return this._errorMsg;
|
|
2838
2864
|
}
|
|
2865
|
+
set errorMsg(value) {
|
|
2866
|
+
this._errorMsg = value;
|
|
2867
|
+
}
|
|
2839
2868
|
get mergeData() {
|
|
2840
2869
|
return this._mergeData;
|
|
2841
2870
|
}
|
|
2842
|
-
|
|
2871
|
+
set mergeData(value) {
|
|
2872
|
+
this._mergeData = value;
|
|
2873
|
+
}
|
|
2874
|
+
constructor(entity, propertyConfig, context = TruValidationDialogContext.Control, isSubProperty = false, ignore = false) {
|
|
2843
2875
|
this._entity = entity;
|
|
2844
|
-
this.
|
|
2845
|
-
this.
|
|
2846
|
-
this.
|
|
2876
|
+
this._propertyConfig = propertyConfig;
|
|
2877
|
+
this._context = context;
|
|
2878
|
+
this._isSubProperty = isSubProperty;
|
|
2879
|
+
this._ignore = ignore;
|
|
2847
2880
|
}
|
|
2848
2881
|
}
|
|
2849
2882
|
|
|
@@ -2943,7 +2976,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
2943
2976
|
}]
|
|
2944
2977
|
}], ctorParameters: () => [] });
|
|
2945
2978
|
|
|
2946
|
-
class
|
|
2979
|
+
class TruValidationDialog {
|
|
2947
2980
|
renderer;
|
|
2948
2981
|
elementRef;
|
|
2949
2982
|
util;
|
|
@@ -2971,7 +3004,6 @@ class TruGridValidationDialog {
|
|
|
2971
3004
|
entity.entityAspect.setUnchanged();
|
|
2972
3005
|
entity.Merge_Data_Set.clearAll();
|
|
2973
3006
|
entity.entityAspect.validateEntity();
|
|
2974
|
-
this.close.emit();
|
|
2975
3007
|
};
|
|
2976
3008
|
onAccept = () => {
|
|
2977
3009
|
let entity = this.config.entity;
|
|
@@ -2984,35 +3016,54 @@ class TruGridValidationDialog {
|
|
|
2984
3016
|
if (this.config.mergeData?.isEmpty())
|
|
2985
3017
|
entity.entityAspect.setUnchanged();
|
|
2986
3018
|
entity.entityAspect.validateEntity();
|
|
2987
|
-
this.close.emit();
|
|
2988
3019
|
};
|
|
2989
3020
|
onDecline = () => {
|
|
2990
3021
|
let entity = this.config.entity;
|
|
2991
3022
|
this.config.mergeData?.clearAll();
|
|
2992
3023
|
entity.entityAspect.validateEntity();
|
|
2993
|
-
this.close.emit();
|
|
2994
3024
|
};
|
|
2995
|
-
ngOnInit() {
|
|
2996
|
-
ngAfterViewInit() {
|
|
2997
|
-
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
2998
|
-
this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
|
|
2999
|
-
this.rowElement.style.zIndex = '10000000000';
|
|
3000
|
-
this.cellElement.classList.add('show');
|
|
3025
|
+
ngOnInit() {
|
|
3001
3026
|
this.errorMsg = this.config.errorMsg;
|
|
3027
|
+
if (this.config.context === TruValidationDialogContext.Control) {
|
|
3028
|
+
var invalidTarget = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.invalid-target');
|
|
3029
|
+
this.listeners.push(this.renderer.listen(invalidTarget, 'mouseenter', (event) => {
|
|
3030
|
+
this.elementRef.nativeElement.childNodes[0].classList.remove('hide');
|
|
3031
|
+
this.elementRef.nativeElement.childNodes[0].classList.add('show');
|
|
3032
|
+
}));
|
|
3033
|
+
this.listeners.push(this.renderer.listen(invalidTarget, 'mouseleave', (event) => {
|
|
3034
|
+
this.elementRef.nativeElement.childNodes[0].classList.remove('show');
|
|
3035
|
+
this.elementRef.nativeElement.childNodes[0].classList.add('hide');
|
|
3036
|
+
}));
|
|
3037
|
+
}
|
|
3038
|
+
else if (this.config.context === TruValidationDialogContext.Grid) {
|
|
3039
|
+
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
3040
|
+
this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
|
|
3041
|
+
this.rowElement.style.zIndex = '10000000000';
|
|
3042
|
+
this.cellElement.classList.add('show');
|
|
3043
|
+
this.errorMsg = this.config.errorMsg;
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
ngAfterViewInit() {
|
|
3047
|
+
if (this.config.context === TruValidationDialogContext.Control)
|
|
3048
|
+
this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.invalid-target').classList.add('invalid');
|
|
3002
3049
|
}
|
|
3003
3050
|
ngOnDestroy() {
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
this.
|
|
3007
|
-
|
|
3051
|
+
if (this.config.context === TruValidationDialogContext.Control)
|
|
3052
|
+
this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.invalid-target').classList.remove('invalid');
|
|
3053
|
+
else if (this.config.context === TruValidationDialogContext.Grid) {
|
|
3054
|
+
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
3055
|
+
this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
|
|
3056
|
+
this.rowElement.style.zIndex = 'auto';
|
|
3057
|
+
this.cellElement.classList.remove('show');
|
|
3058
|
+
}
|
|
3008
3059
|
this.listeners.forEach(l => l());
|
|
3009
3060
|
}
|
|
3010
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type:
|
|
3011
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type:
|
|
3061
|
+
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 });
|
|
3062
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: TruValidationDialog, selector: "tru-validation-dialog", inputs: { config: "config" }, outputs: { close: "close" }, 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"] }] });
|
|
3012
3063
|
}
|
|
3013
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type:
|
|
3064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialog, decorators: [{
|
|
3014
3065
|
type: Component,
|
|
3015
|
-
args: [{ selector: 'tru-
|
|
3066
|
+
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"] }]
|
|
3016
3067
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
|
|
3017
3068
|
type: Input
|
|
3018
3069
|
}], close: [{
|
|
@@ -3872,7 +3923,7 @@ class TruDataGrid {
|
|
|
3872
3923
|
if (targetProperty && targetProperty.Merge_Data) {
|
|
3873
3924
|
return targetProperty.Merge_Data_Set;
|
|
3874
3925
|
}
|
|
3875
|
-
return
|
|
3926
|
+
return null;
|
|
3876
3927
|
}
|
|
3877
3928
|
else {
|
|
3878
3929
|
return entityToValidate.Merge_Data_Set?.get(config.propertyName) ? entityToValidate.Merge_Data_Set : undefined;
|
|
@@ -3884,7 +3935,7 @@ class TruDataGrid {
|
|
|
3884
3935
|
let dialogElement = document.createElement('div');
|
|
3885
3936
|
dialogElement.classList.add('invalid');
|
|
3886
3937
|
target.appendChild(dialogElement);
|
|
3887
|
-
let componentRef = createComponent(
|
|
3938
|
+
let componentRef = createComponent(TruValidationDialog, {
|
|
3888
3939
|
environmentInjector: this.app.injector,
|
|
3889
3940
|
hostElement: dialogElement,
|
|
3890
3941
|
});
|
|
@@ -3907,7 +3958,10 @@ class TruDataGrid {
|
|
|
3907
3958
|
let entityToValidate = e.data.$entity;
|
|
3908
3959
|
let validationErrorsForProperty = this.dataContext.getValidationErrorsForProperty(e.data.$entity, fieldName);
|
|
3909
3960
|
let validationErrorsMessagesForProperty = this.dataContext.parseErrorMessages(validationErrorsForProperty);
|
|
3910
|
-
|
|
3961
|
+
let validationDialogConfig = new TruValidationDialogConfig(entityToValidate, propertyConfig, TruValidationDialogContext.Grid, false);
|
|
3962
|
+
validationDialogConfig.errorMsg = validationErrorsMessagesForProperty;
|
|
3963
|
+
validationDialogConfig.mergeData = this.getMergeData(propertyConfig, entityToValidate);
|
|
3964
|
+
this.addValidationDialog(validationDialogConfig, targetElement);
|
|
3911
3965
|
}
|
|
3912
3966
|
}
|
|
3913
3967
|
onCellMouseOut(e) {
|
|
@@ -6514,6 +6568,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
6514
6568
|
}]
|
|
6515
6569
|
}] });
|
|
6516
6570
|
|
|
6571
|
+
class TruGridValidationDialog {
|
|
6572
|
+
renderer;
|
|
6573
|
+
elementRef;
|
|
6574
|
+
util;
|
|
6575
|
+
config;
|
|
6576
|
+
close = new EventEmitter();
|
|
6577
|
+
errorMsg = '';
|
|
6578
|
+
rowElement;
|
|
6579
|
+
cellElement;
|
|
6580
|
+
listeners = [];
|
|
6581
|
+
constructor(renderer, elementRef, util) {
|
|
6582
|
+
this.renderer = renderer;
|
|
6583
|
+
this.elementRef = elementRef;
|
|
6584
|
+
this.util = util;
|
|
6585
|
+
}
|
|
6586
|
+
onAcceptAll = () => {
|
|
6587
|
+
let entity = this.config.entity;
|
|
6588
|
+
let originalValues = entity.entityAspect.originalValues;
|
|
6589
|
+
for (const key in this.config.mergeData?.getAll()) {
|
|
6590
|
+
entity[key] = this.config.mergeData?.get(key).value;
|
|
6591
|
+
if (originalValues.hasOwnProperty(key))
|
|
6592
|
+
delete originalValues[key];
|
|
6593
|
+
}
|
|
6594
|
+
;
|
|
6595
|
+
if (Object.keys(originalValues).length === 0 && originalValues.constructor === Object)
|
|
6596
|
+
entity.entityAspect.setUnchanged();
|
|
6597
|
+
entity.Merge_Data_Set.clearAll();
|
|
6598
|
+
entity.entityAspect.validateEntity();
|
|
6599
|
+
this.close.emit();
|
|
6600
|
+
};
|
|
6601
|
+
onAccept = () => {
|
|
6602
|
+
let entity = this.config.entity;
|
|
6603
|
+
let originalValues = entity.entityAspect.originalValues;
|
|
6604
|
+
let propertyName = this.config.propertyName;
|
|
6605
|
+
entity[propertyName] = this.config.mergeData?.get(propertyName).value;
|
|
6606
|
+
this.config.mergeData?.clear(propertyName);
|
|
6607
|
+
if (originalValues.hasOwnProperty(propertyName) && (Object.keys(originalValues).length === 0 && originalValues.constructor === Object))
|
|
6608
|
+
delete originalValues[propertyName];
|
|
6609
|
+
if (this.config.mergeData?.isEmpty())
|
|
6610
|
+
entity.entityAspect.setUnchanged();
|
|
6611
|
+
entity.entityAspect.validateEntity();
|
|
6612
|
+
this.close.emit();
|
|
6613
|
+
};
|
|
6614
|
+
onDecline = () => {
|
|
6615
|
+
let entity = this.config.entity;
|
|
6616
|
+
this.config.mergeData?.clearAll();
|
|
6617
|
+
entity.entityAspect.validateEntity();
|
|
6618
|
+
this.close.emit();
|
|
6619
|
+
};
|
|
6620
|
+
ngOnInit() { }
|
|
6621
|
+
ngAfterViewInit() {
|
|
6622
|
+
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
6623
|
+
this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
|
|
6624
|
+
this.rowElement.style.zIndex = '10000000000';
|
|
6625
|
+
this.cellElement.classList.add('show');
|
|
6626
|
+
this.errorMsg = this.config.errorMsg;
|
|
6627
|
+
}
|
|
6628
|
+
ngOnDestroy() {
|
|
6629
|
+
this.rowElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-row');
|
|
6630
|
+
this.cellElement = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.ag-cell-value');
|
|
6631
|
+
this.rowElement.style.zIndex = 'auto';
|
|
6632
|
+
this.cellElement.classList.remove('show');
|
|
6633
|
+
this.listeners.forEach(l => l());
|
|
6634
|
+
}
|
|
6635
|
+
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 });
|
|
6636
|
+
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:22px;-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"] }] });
|
|
6637
|
+
}
|
|
6638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialog, decorators: [{
|
|
6639
|
+
type: Component,
|
|
6640
|
+
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:22px;-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"] }]
|
|
6641
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
|
|
6642
|
+
type: Input
|
|
6643
|
+
}], close: [{
|
|
6644
|
+
type: Output
|
|
6645
|
+
}] } });
|
|
6646
|
+
|
|
6517
6647
|
class TruGridValidationDialogModule {
|
|
6518
6648
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6519
6649
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.2", ngImport: i0, type: TruGridValidationDialogModule, declarations: [TruGridValidationDialog], imports: [CommonModule, FormsModule], exports: [TruGridValidationDialog] });
|
|
@@ -6879,136 +7009,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
6879
7009
|
}]
|
|
6880
7010
|
}] });
|
|
6881
7011
|
|
|
6882
|
-
class TruValidationDialog {
|
|
6883
|
-
renderer;
|
|
6884
|
-
elementRef;
|
|
6885
|
-
util;
|
|
6886
|
-
config;
|
|
6887
|
-
errorMsg = '';
|
|
6888
|
-
listeners = [];
|
|
6889
|
-
constructor(renderer, elementRef, util) {
|
|
6890
|
-
this.renderer = renderer;
|
|
6891
|
-
this.elementRef = elementRef;
|
|
6892
|
-
this.util = util;
|
|
6893
|
-
}
|
|
6894
|
-
onAcceptAll = () => {
|
|
6895
|
-
let entity = this.config.entity;
|
|
6896
|
-
let originalValues = entity.entityAspect.originalValues;
|
|
6897
|
-
for (const key in this.config.mergeData?.getAll()) {
|
|
6898
|
-
entity[key] = this.config.mergeData?.get(key).value;
|
|
6899
|
-
if (originalValues.hasOwnProperty(key))
|
|
6900
|
-
delete originalValues[key];
|
|
6901
|
-
}
|
|
6902
|
-
;
|
|
6903
|
-
if (Object.keys(originalValues).length === 0 && originalValues.constructor === Object)
|
|
6904
|
-
entity.entityAspect.setUnchanged();
|
|
6905
|
-
entity.Merge_Data_Set.clearAll();
|
|
6906
|
-
entity.entityAspect.validateEntity();
|
|
6907
|
-
};
|
|
6908
|
-
onAccept = () => {
|
|
6909
|
-
let entity = this.config.entity;
|
|
6910
|
-
let originalValues = entity.entityAspect.originalValues;
|
|
6911
|
-
let propertyName = this.config.propertyName;
|
|
6912
|
-
entity[propertyName] = this.config.mergeData?.get(propertyName).value;
|
|
6913
|
-
this.config.mergeData?.clear(propertyName);
|
|
6914
|
-
if (originalValues.hasOwnProperty(propertyName) && (Object.keys(originalValues).length === 0 && originalValues.constructor === Object))
|
|
6915
|
-
delete originalValues[propertyName];
|
|
6916
|
-
if (this.config.mergeData?.isEmpty())
|
|
6917
|
-
entity.entityAspect.setUnchanged();
|
|
6918
|
-
entity.entityAspect.validateEntity();
|
|
6919
|
-
};
|
|
6920
|
-
onDecline = () => {
|
|
6921
|
-
let entity = this.config.entity;
|
|
6922
|
-
this.config.mergeData?.clearAll();
|
|
6923
|
-
entity.entityAspect.validateEntity();
|
|
6924
|
-
};
|
|
6925
|
-
ngOnInit() {
|
|
6926
|
-
this.errorMsg = this.config.errorMsg;
|
|
6927
|
-
var invalidTarget = this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.invalid-target');
|
|
6928
|
-
this.listeners.push(this.renderer.listen(invalidTarget, 'mouseenter', (event) => {
|
|
6929
|
-
this.elementRef.nativeElement.childNodes[0].classList.remove('hide');
|
|
6930
|
-
this.elementRef.nativeElement.childNodes[0].classList.add('show');
|
|
6931
|
-
}));
|
|
6932
|
-
this.listeners.push(this.renderer.listen(invalidTarget, 'mouseleave', (event) => {
|
|
6933
|
-
this.elementRef.nativeElement.childNodes[0].classList.remove('show');
|
|
6934
|
-
this.elementRef.nativeElement.childNodes[0].classList.add('hide');
|
|
6935
|
-
}));
|
|
6936
|
-
}
|
|
6937
|
-
ngAfterViewInit() {
|
|
6938
|
-
this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.invalid-target').classList.add('invalid');
|
|
6939
|
-
}
|
|
6940
|
-
ngOnDestroy() {
|
|
6941
|
-
this.util.findClosestAncestorByClass(this.elementRef.nativeElement, '.invalid-target').classList.remove('invalid');
|
|
6942
|
-
this.listeners.forEach(l => l());
|
|
6943
|
-
}
|
|
6944
|
-
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 });
|
|
6945
|
-
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"] }] });
|
|
6946
|
-
}
|
|
6947
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialog, decorators: [{
|
|
6948
|
-
type: Component,
|
|
6949
|
-
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"] }]
|
|
6950
|
-
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: TruUtil }], propDecorators: { config: [{
|
|
6951
|
-
type: Input
|
|
6952
|
-
}] } });
|
|
6953
|
-
|
|
6954
|
-
var TruValidationDialogContext;
|
|
6955
|
-
(function (TruValidationDialogContext) {
|
|
6956
|
-
TruValidationDialogContext[TruValidationDialogContext["Control"] = 0] = "Control";
|
|
6957
|
-
TruValidationDialogContext[TruValidationDialogContext["Grid"] = 1] = "Grid";
|
|
6958
|
-
TruValidationDialogContext[TruValidationDialogContext["Card"] = 2] = "Card";
|
|
6959
|
-
})(TruValidationDialogContext || (TruValidationDialogContext = {}));
|
|
6960
|
-
|
|
6961
|
-
class TruValidationDialogConfig {
|
|
6962
|
-
_entity;
|
|
6963
|
-
_propertyConfig;
|
|
6964
|
-
_context;
|
|
6965
|
-
_isSubProperty;
|
|
6966
|
-
_ignore;
|
|
6967
|
-
_propertyName = '';
|
|
6968
|
-
_errorMsg = '';
|
|
6969
|
-
_mergeData = null;
|
|
6970
|
-
get entity() {
|
|
6971
|
-
return this._entity;
|
|
6972
|
-
}
|
|
6973
|
-
get propertyConfig() {
|
|
6974
|
-
return this._propertyConfig;
|
|
6975
|
-
}
|
|
6976
|
-
get context() {
|
|
6977
|
-
return this._context;
|
|
6978
|
-
}
|
|
6979
|
-
get isSubProperty() {
|
|
6980
|
-
return this._isSubProperty;
|
|
6981
|
-
}
|
|
6982
|
-
get ignore() {
|
|
6983
|
-
return this._ignore;
|
|
6984
|
-
}
|
|
6985
|
-
get propertyName() {
|
|
6986
|
-
return this._propertyName;
|
|
6987
|
-
}
|
|
6988
|
-
set propertyName(value) {
|
|
6989
|
-
this._propertyName = value;
|
|
6990
|
-
}
|
|
6991
|
-
get errorMsg() {
|
|
6992
|
-
return this._errorMsg;
|
|
6993
|
-
}
|
|
6994
|
-
set errorMsg(value) {
|
|
6995
|
-
this._errorMsg = value;
|
|
6996
|
-
}
|
|
6997
|
-
get mergeData() {
|
|
6998
|
-
return this._mergeData;
|
|
6999
|
-
}
|
|
7000
|
-
set mergeData(value) {
|
|
7001
|
-
this._mergeData = value;
|
|
7002
|
-
}
|
|
7003
|
-
constructor(entity, propertyConfig, context = TruValidationDialogContext.Control, isSubProperty = false, ignore = false) {
|
|
7004
|
-
this._entity = entity;
|
|
7005
|
-
this._propertyConfig = propertyConfig;
|
|
7006
|
-
this._context = context;
|
|
7007
|
-
this._isSubProperty = isSubProperty;
|
|
7008
|
-
this._ignore = ignore;
|
|
7009
|
-
}
|
|
7010
|
-
}
|
|
7011
|
-
|
|
7012
7012
|
class TruValidationDialogModule {
|
|
7013
7013
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7014
7014
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.2", ngImport: i0, type: TruValidationDialogModule, declarations: [TruValidationDialog], imports: [CommonModule, FormsModule], exports: [TruValidationDialog] });
|
|
@@ -7881,5 +7881,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
|
|
|
7881
7881
|
* Generated bundle index. Do not edit.
|
|
7882
7882
|
*/
|
|
7883
7883
|
|
|
7884
|
-
export { DetailViewModule, TruAppEnvironment, TruAuth, TruAuthInterceptor, TruBreezeContext, TruBreezeContextFactory, TruBreezeGridValidator, TruBreezeGridValidatorModule, TruBreezeMetadataProvider, TruBreezeValidator, TruBreezeValidatorModule, TruChoice, TruCloudFileManager, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruConnectionHub, TruContextFilter, TruContextFilterChoice, TruContextFilters, TruControlComponentConfigBase, TruDataChange, TruDataContext, TruDataGrid, TruDataGridCellRenderer, TruDataGridModule, TruDataGridTypes, TruDataGridUtil, TruDesktop, TruDesktopManager, TruDesktopModule, TruDesktopViewConfig, TruDetailViewBase, TruEditControlBase, TruEditControlConfigBase, TruEditParentControlConfigBase, TruEditPkeyControlConfigBase, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGridValidationDialog, TruGridValidationDialogModule, TruGroupBox, TruGroupBoxModule, TruIconModule, TruListControlConfigBase, TruLogin, TruLoginModule, TruMatSelectPanel, TruMatSelectPanelModule, TruModelPropertyLookup, TruModelTypeLookup, TruNameValue, TruPasswordDialog, TruPasswordDialogModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDate, TruPropertyConfigDecimal, TruPropertyConfigFile, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchConfigBase, TruSearchControlBase, TruSearchControlConfigBase, TruSearchControlRangeBase, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchResultViewBase, TruSearchResultViewBaseModule, TruSearchResultViewManager, TruSearchViewBase, TruSearchViewBaseModule, TruSearchViewControlEventHandler, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTableRegistry, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruToolbarUserProfile, TruToolbarUserProfileModule, TruUiNotification, TruUser, TruUtil, TruValidationDialog, TruValidationDialogConfig, TruValidationDialogModule, TruValidatorFactory, TruWindowActionEventHandler, TruWindowEventArgs, TruWindowEventHandler };
|
|
7884
|
+
export { DetailViewModule, TruAppEnvironment, TruAuth, TruAuthInterceptor, TruBreezeContext, TruBreezeContextFactory, TruBreezeGridValidator, TruBreezeGridValidatorModule, TruBreezeMetadataProvider, TruBreezeValidator, TruBreezeValidatorModule, TruChoice, TruCloudFileManager, TruColumn, TruColumnModule, TruCommonModule, TruComponentConfigBase, TruComponentLookup, TruConfirmDialog, TruConfirmDialogConfig, TruConfirmDialogModule, TruConnectionHub, TruContextFilter, TruContextFilterChoice, TruContextFilters, TruControlComponentConfigBase, TruDataChange, TruDataContext, TruDataGrid, TruDataGridCellRenderer, TruDataGridModule, TruDataGridTypes, TruDataGridUtil, TruDesktop, TruDesktopManager, TruDesktopModule, TruDesktopViewConfig, TruDetailViewBase, TruEditControlBase, TruEditControlConfigBase, TruEditParentControlConfigBase, TruEditPkeyControlConfigBase, TruEntityAccessor, TruEntityBase, TruExportDialog, TruExportDialogConfig, TruExportDialogModule, TruForm, TruFormModule, TruFormulaEval, TruGridValidationDialog, TruGridValidationDialogModule, TruGroupBox, TruGroupBoxModule, TruIconModule, TruListControlConfigBase, TruLogin, TruLoginModule, TruMatSelectPanel, TruMatSelectPanelModule, TruModelPropertyLookup, TruModelTypeLookup, TruNameValue, TruPasswordDialog, TruPasswordDialogModule, TruPredicate, TruPredicateMap, TruPropertyConfigBase, TruPropertyConfigCloudFile, TruPropertyConfigDate, TruPropertyConfigDecimal, TruPropertyConfigFile, TruPropertyConfigForeignKey, TruPropertyConfigInteger, TruPropertyConfigPassword, TruPropertyConfigPercentage, TruPropertyConfigScientific, TruPropertyConfigText, TruPropertyConfigTextChoices, TruPropertyConfigUsaAddress, TruPropertyConfigZipCode, TruQueryPredicateManager, TruRow, TruRowModule, TruSearchConfigBase, TruSearchControlBase, TruSearchControlConfigBase, TruSearchControlRangeBase, TruSearchIconModule, TruSearchPanelPositionManager, TruSearchPanelPositionManagerModule, TruSearchResultViewBase, TruSearchResultViewBaseModule, TruSearchResultViewManager, TruSearchViewBase, TruSearchViewBaseModule, TruSearchViewControlEventHandler, TruSearchViewEventHandler, TruSort, TruTableConfigBase, TruTableRegistry, TruTextManager, TruToolbar, TruToolbarButton, TruToolbarButtonModule, TruToolbarContextFilter, TruToolbarContextFilterModule, TruToolbarDropdown, TruToolbarDropdownModule, TruToolbarMenu, TruToolbarMenuModule, TruToolbarModule, TruToolbarSeparator, TruToolbarSeparatorModule, TruToolbarText, TruToolbarTextModule, TruToolbarUserProfile, TruToolbarUserProfileModule, TruUiNotification, TruUser, TruUtil, TruValidationDialog, TruValidationDialogConfig, TruValidationDialogContext, TruValidationDialogModule, TruValidatorFactory, TruWindowActionEventHandler, TruWindowEventArgs, TruWindowEventHandler };
|
|
7885
7885
|
//# sourceMappingURL=trudb-tru-common-lib.mjs.map
|