@eqproject/eqp-dynamic-module 2.10.85 → 2.10.86
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/README.md +14 -0
- package/esm2020/lib/components/private/add-form-field/add-form-field.component.mjs +4 -2
- package/esm2020/lib/components/private/field-templates/image-field-template/image-field-template.component.mjs +3 -3
- package/esm2020/lib/components/private/field-templates/image-with-markers-field-template/image-with-markers-field-template.component.mjs +3 -3
- package/esm2020/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.mjs +32 -10
- package/esm2020/lib/components/private/form-records/add-form-record/add-form-record.component.mjs +23 -12
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +63 -28
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +59 -25
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/components/private/form-records/add-form-record/add-form-record.component.d.ts +3 -0
- package/package.json +1 -1
|
@@ -5020,12 +5020,24 @@ class ListValueFieldTemplateComponent {
|
|
|
5020
5020
|
GlobalService.debugLog("list-value-field updateField", this.field);
|
|
5021
5021
|
if (this.field.Formula) {
|
|
5022
5022
|
GlobalService.debugLog("list-value-field - updateField - Formula", "formula");
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5023
|
+
if (this.field.DataGetter?.DataGetterType === DataGetterTypeEnum.Formula) {
|
|
5024
|
+
// La formula calcola il VALORE SELEZIONATO (non le opzioni): comportamento analogo al campo numerico.
|
|
5025
|
+
// Le opzioni vengono da ValueString/ValuePairs. Non si chiama resetArrayData() per evitare loop.
|
|
5026
|
+
const newValue = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, this.formulaObject);
|
|
5027
|
+
if (this.record[this.field.Name] !== newValue) {
|
|
5028
|
+
this.record[this.field.Name] = newValue;
|
|
5029
|
+
this.setFormControlValue();
|
|
5030
|
+
}
|
|
5031
|
+
}
|
|
5032
|
+
else {
|
|
5033
|
+
// La formula calcola le OPZIONI (ValuePairs) — caso d'uso originale
|
|
5034
|
+
const tempValuePairs = this.field.ValuePairs;
|
|
5035
|
+
this.field.ValuePairs = {};
|
|
5036
|
+
const temp = UtilityHelperService.EvaluateFieldFormula(this.field.Formula, this.record, this.formulaObject);
|
|
5037
|
+
this.field.ValuePairs = GlobalService.stringToValuePairs(temp);
|
|
5038
|
+
if (!(JSON.stringify(tempValuePairs) === JSON.stringify(this.field.ValuePairs))) {
|
|
5039
|
+
this.resetArrayData();
|
|
5040
|
+
}
|
|
5029
5041
|
}
|
|
5030
5042
|
}
|
|
5031
5043
|
else if (this.field.ValuePairs != null && this.field.ValuePairs.lenght > 0) {
|
|
@@ -5059,7 +5071,13 @@ class ListValueFieldTemplateComponent {
|
|
|
5059
5071
|
this.onRecordValueChange();
|
|
5060
5072
|
}
|
|
5061
5073
|
updateSelected(emitChange = true) {
|
|
5062
|
-
|
|
5074
|
+
const selectedValues = this.arrayData.filter(data => data.Selected).map(data => data.Value);
|
|
5075
|
+
// Single-choice: usa null (non []) quando nessun valore è selezionato.
|
|
5076
|
+
// [] !== [] in JS (confronto per referenza): mat-select._assignValue vede sempre un "cambio"
|
|
5077
|
+
// su ogni cycle di CD e scatena _onChange → ngModelChange → loop infinito.
|
|
5078
|
+
this.record[this.field.Name] = this.field.IsMultiChoiche
|
|
5079
|
+
? selectedValues
|
|
5080
|
+
: (selectedValues.length > 0 ? selectedValues[0] : null);
|
|
5063
5081
|
this.setFormControlValue();
|
|
5064
5082
|
if (emitChange) {
|
|
5065
5083
|
this.onRecordValueChange();
|
|
@@ -5070,7 +5088,7 @@ class ListValueFieldTemplateComponent {
|
|
|
5070
5088
|
}
|
|
5071
5089
|
resetArrayData() {
|
|
5072
5090
|
this.arrayData = [];
|
|
5073
|
-
this.updateSelected(
|
|
5091
|
+
this.updateSelected(false);
|
|
5074
5092
|
this.setArrayData();
|
|
5075
5093
|
}
|
|
5076
5094
|
reloadArrayData() {
|
|
@@ -5108,7 +5126,10 @@ class ListValueFieldTemplateComponent {
|
|
|
5108
5126
|
this.arrayData.push({ Key: key, Value: value, Selected: isOptionSelected, ImgUrl: imgUrl });
|
|
5109
5127
|
}
|
|
5110
5128
|
setFormControlValue() {
|
|
5111
|
-
|
|
5129
|
+
// emitModelToViewChange:false impedisce che FormControl.setValue() notifichi i callback
|
|
5130
|
+
// _onChange registrati da NgModel (via [formControlName] sul mat-checkbox), evitando che
|
|
5131
|
+
// NgModel emetta ngModelChange → updateSelected() → setFormControlValue() ricorsivamente.
|
|
5132
|
+
this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name], { emitEvent: false, emitModelToViewChange: false });
|
|
5112
5133
|
}
|
|
5113
5134
|
}
|
|
5114
5135
|
ListValueFieldTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ListValueFieldTemplateComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -6053,10 +6074,10 @@ class ImageFieldTemplateComponent {
|
|
|
6053
6074
|
}
|
|
6054
6075
|
}
|
|
6055
6076
|
ImageFieldTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageFieldTemplateComponent, deps: [{ token: i1$3.MatDialog }, { token: UtilityHelperService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
6056
|
-
ImageFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageFieldTemplateComponent, selector: "image-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageDraw: "imageDraw" }, viewQueries: [{ propertyName: "dialogImageDrawing", first: true, predicate: ["dialogImageDrawing"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
6077
|
+
ImageFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageFieldTemplateComponent, selector: "image-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageDraw: "imageDraw" }, viewQueries: [{ propertyName: "dialogImageDrawing", first: true, predicate: ["dialogImageDrawing"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\"\r\n class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div>\r\n <div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\"\r\n class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\r\n<ng-template #dialogImageDrawing>\r\n <div class=\"padder\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12\">\r\n <tmw-image-drawer *ngIf=\"drawingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\" [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\"\r\n [enableRemoveImage]=\"false\" [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\" [i18n]=\"i18n\" [showCancelButton]=\"true\"\r\n (save)=\"saveDraw($event)\" (loadOriginal)=\"loadOriginal()\"\r\n (closeDialog)=\"closeImageDrowingDialog()\">\r\n </tmw-image-drawer>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TmwImageDrawerComponent, selector: "tmw-image-drawer", inputs: ["src", "width", "height", "forceSizeCanvas", "forceSizeExport", "enableRemoveImage", "enableLoadAnotherImage", "enableTooltip", "showCancelButton", "inConfig", "i18n", "locale", "loadingTemplate", "errorTemplate", "outputMimeType", "outputQuality", "borderCss", "drawingSizes", "colors"], outputs: ["closeDialog", "save", "loadOriginal"] }] });
|
|
6057
6078
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageFieldTemplateComponent, decorators: [{
|
|
6058
6079
|
type: Component,
|
|
6059
|
-
args: [{ selector: 'image-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
6080
|
+
args: [{ selector: 'image-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\">\r\n </div>\r\n <div *ngIf=\"field.EnableDrawing\" class=\"col-12 drawButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openDraw()\">Disegna</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\"\r\n class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div>\r\n <div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\"\r\n class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO -->\r\n<ng-template #dialogImageDrawing>\r\n <div class=\"padder\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-12 col-md-12\">\r\n <tmw-image-drawer *ngIf=\"drawingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\" [showCancelButton]=\"false\" [enableLoadAnotherImage]=\"false\"\r\n [enableRemoveImage]=\"false\" [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\" [i18n]=\"i18n\" [showCancelButton]=\"true\"\r\n (save)=\"saveDraw($event)\" (loadOriginal)=\"loadOriginal()\"\r\n (closeDialog)=\"closeImageDrowingDialog()\">\r\n </tmw-image-drawer>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"] }]
|
|
6060
6081
|
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }, { type: UtilityHelperService }, { type: i0.Renderer2 }]; }, propDecorators: { endPointConfiguration: [{
|
|
6061
6082
|
type: Input
|
|
6062
6083
|
}], record: [{
|
|
@@ -7066,10 +7087,10 @@ class ImageWithMarkersFieldTemplateComponent {
|
|
|
7066
7087
|
}
|
|
7067
7088
|
}
|
|
7068
7089
|
ImageWithMarkersFieldTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageWithMarkersFieldTemplateComponent, deps: [{ token: i1$3.MatDialog }, { token: UtilityHelperService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
7069
|
-
ImageWithMarkersFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageWithMarkersFieldTemplateComponent, selector: "image-with-markers-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageMark: "imageMark" }, viewQueries: [{ propertyName: "dialogImageMarking", first: true, predicate: ["dialogImageMarking"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
7090
|
+
ImageWithMarkersFieldTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageWithMarkersFieldTemplateComponent, selector: "image-with-markers-field-template", inputs: { endPointConfiguration: "endPointConfiguration", record: "record", formulaObject: "formulaObject", field: "field", inConfig: "inConfig", styleVersion: "styleVersion", forceState: "forceState" }, outputs: { recordChange: "recordChange", imageMark: "imageMark" }, viewQueries: [{ propertyName: "dialogImageMarking", first: true, predicate: ["dialogImageMarking"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\" class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div><div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\" class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER MARCATURA -->\r\n<ng-template #dialogImageMarking>\r\n <tmw-image-marker *ngIf=\"MarkingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\"\r\n [savedMarkers]=\"extraJSON\"\r\n (save)=\"saveMark($event)\"\r\n (closeDialog)=\"closeDialog()\"\r\n [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\"\r\n >\r\n </tmw-image-marker>\r\n</ng-template>\r\n", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TmwImageMarkerComponent, selector: "tmw-image-marker", inputs: ["src", "width", "height", "inConfig", "savedMarkers", "outputMimeType", "outputQuality", "forceSizeCanvas"], outputs: ["closeDialog", "save"] }] });
|
|
7070
7091
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageWithMarkersFieldTemplateComponent, decorators: [{
|
|
7071
7092
|
type: Component,
|
|
7072
|
-
args: [{ selector: 'image-with-markers-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment
|
|
7093
|
+
args: [{ selector: 'image-with-markers-field-template', template: "<div id=\"{{fieldUid}}\">\r\n <div class=\"row imageContainer\">\r\n <div class=\"row\">\r\n <div class=\"col-12 image-label\">{{field.Description}}</div>\r\n <div class=\"col-12\">\r\n <img *ngIf=\"field.DynAttachment\"\r\n src=\"data:{{field.DynAttachment.FileContentType}};base64,{{FileDataBase64}}\"\r\n [height]=\"field.DynAttachment.ResizedImageHeightPx != null ? field.DynAttachment.ResizedImageHeightPx : 128\"\r\n class=\"singleImage\"\r\n >\r\n </div>\r\n <div class=\"col-12 markButton\">\r\n <button class=\"btn btn-primary btn-w100\" (click)=\"openMark()\">Marca</button>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonKey != null && field.DynAttachment?.ButtonKey != ''\" class=\"col-12 flex justify-content-around buttonkey\">\r\n <div>Etichetta</div><div>{{field.DynAttachment.ButtonKey}}</div>\r\n </div>\r\n <div *ngIf=\"field.DynAttachment?.ButtonValue != null && field.DynAttachment?.ButtonValue != ''\" class=\"col-12 flex justify-content-around buttonvalue\">\r\n <div>Valore</div>\r\n <div>{{field.DynAttachment.ButtonValue}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- DIALOG PER MARCATURA -->\r\n<ng-template #dialogImageMarking>\r\n <tmw-image-marker *ngIf=\"MarkingLoaded\"\r\n [src]=\"'data:'+ field.DynAttachment.FileContentType + ';base64,'+ FileBase64\"\r\n [inConfig]=\"inConfig\"\r\n [savedMarkers]=\"extraJSON\"\r\n (save)=\"saveMark($event)\"\r\n (closeDialog)=\"closeDialog()\"\r\n [width]=\"field.DynAttachment.ImageWidthPx\"\r\n [height]=\"field.DynAttachment.ImageHeightPx\"\r\n >\r\n </tmw-image-marker>\r\n</ng-template>\r\n", styles: ["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}.imageContainer .singleImage{margin-top:5px;display:block}.drawButton{margin:5px 0}.buttonkey{border-top:1px solid black;padding-top:10px}\n"] }]
|
|
7073
7094
|
}], ctorParameters: function () { return [{ type: i1$3.MatDialog }, { type: UtilityHelperService }, { type: i0.Renderer2 }]; }, propDecorators: { endPointConfiguration: [{
|
|
7074
7095
|
type: Input
|
|
7075
7096
|
}], record: [{
|
|
@@ -8245,6 +8266,7 @@ class AddFormRecordComponent {
|
|
|
8245
8266
|
this.loader = false;
|
|
8246
8267
|
this.isSaving = false;
|
|
8247
8268
|
this.formloaded = false;
|
|
8269
|
+
this._recordChanging = false;
|
|
8248
8270
|
this.fieldGroups = {};
|
|
8249
8271
|
this.FormScalarTypeEnum = FormScalarTypeEnum;
|
|
8250
8272
|
this.FieldTypeEnum = FieldTypeEnum;
|
|
@@ -8298,20 +8320,30 @@ class AddFormRecordComponent {
|
|
|
8298
8320
|
/**
|
|
8299
8321
|
* Metodo invocato al cambio del valore di ogni proprietà dell'oggetto record.
|
|
8300
8322
|
* Serve ad aggiornare il valore di tutti i campi che hanno una formula.
|
|
8323
|
+
* Il guard _recordChanging previene la rientranza: i campi formula aggiornano
|
|
8324
|
+
* record[name] e ciò riemette recordChange; senza guard si genera un loop infinito.
|
|
8301
8325
|
*/
|
|
8302
8326
|
onRecordChange() {
|
|
8303
|
-
if (this.
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8327
|
+
if (this._recordChanging)
|
|
8328
|
+
return;
|
|
8329
|
+
this._recordChanging = true;
|
|
8330
|
+
try {
|
|
8331
|
+
if (this.fieldTemplate && this.fieldTemplate.length > 0) {
|
|
8332
|
+
this.fieldTemplate.forEach((f) => { if (f != null && typeof f.updateField === 'function') {
|
|
8333
|
+
f.updateField();
|
|
8334
|
+
} });
|
|
8335
|
+
}
|
|
8336
|
+
// I validator required leggono da record[field.Name] (closure su record), quindi basta
|
|
8337
|
+
// chiamare updateValueAndValidity per far rileggere il valore aggiornato dalla formula/ActionButton.
|
|
8338
|
+
// Non si usa setValue per evitare che writeValue sui ControlValueAccessor scateni eventi → loop.
|
|
8339
|
+
if (this.form?.Fields) {
|
|
8340
|
+
this.form.Fields.forEach(field => {
|
|
8341
|
+
field.FormFormGroup?.get(field.Name)?.updateValueAndValidity({ emitEvent: false });
|
|
8342
|
+
});
|
|
8343
|
+
}
|
|
8307
8344
|
}
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
// Non si usa setValue per evitare che writeValue sui ControlValueAccessor scateni eventi → loop.
|
|
8311
|
-
if (this.form?.Fields) {
|
|
8312
|
-
this.form.Fields.forEach(field => {
|
|
8313
|
-
field.FormFormGroup?.get(field.Name)?.updateValueAndValidity({ emitEvent: false });
|
|
8314
|
-
});
|
|
8345
|
+
finally {
|
|
8346
|
+
this._recordChanging = false;
|
|
8315
8347
|
}
|
|
8316
8348
|
}
|
|
8317
8349
|
//#endregion onRecordChange
|
|
@@ -15770,7 +15802,9 @@ class AddFormFieldComponent {
|
|
|
15770
15802
|
disableClose: true,
|
|
15771
15803
|
hasBackdrop: true,
|
|
15772
15804
|
panelClass: 'query-editor-modal',
|
|
15773
|
-
width: '90%'
|
|
15805
|
+
width: '90%',
|
|
15806
|
+
maxHeight: '90vh',
|
|
15807
|
+
position: { top: '20px' },
|
|
15774
15808
|
});
|
|
15775
15809
|
}
|
|
15776
15810
|
else {
|