@eqproject/eqp-dynamic-module 2.4.10 → 2.4.11

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.
@@ -2945,7 +2945,7 @@ class ImageFieldTemplateComponent {
2945
2945
  if (this.record[this.field.Name] == null || this.record[this.field.Name] == 0) {
2946
2946
  this.FileDataBase64 = this.field.DynAttachment.FileDataBase64;
2947
2947
  this.imageWidth = (this.field.DynAttachment.ResizedImageHeightPx / this.field.DynAttachment.ImageHeightPx * this.field.DynAttachment.ImageWidthPx) + 50;
2948
- this.record[this.field.Name] = this.field.DynAttachmentID;
2948
+ this.record[this.field.Name] = this.field.DynAttachment;
2949
2949
  this.imageDrawAttachment = JSON.parse(JSON.stringify(this.field.DynAttachment));
2950
2950
  this.imageDrawAttachment.ID = 0;
2951
2951
  this.AttachmentID = this.field.DynAttachment.ID;
@@ -3181,6 +3181,7 @@ class ImageFieldSelectorTemplateComponent {
3181
3181
  this.recordChange = new EventEmitter();
3182
3182
  }
3183
3183
  ngOnInit() {
3184
+ console.log("RECORD ngOnInit()", this.record[this.field.Name], this.field);
3184
3185
  this.initStyles();
3185
3186
  this.initializeAttachments();
3186
3187
  }
@@ -3213,19 +3214,42 @@ class ImageFieldSelectorTemplateComponent {
3213
3214
  attachment.objectToSelect.ButtonKey = attachment.ButtonKey;
3214
3215
  attachment.objectToSelect.ButtonValue = attachment.ButtonValue;
3215
3216
  });
3217
+ if (this.record[this.field.Name] != null) {
3218
+ if (!this.field.IsMultiChoiche) {
3219
+ this.transformedRecord = this.record[this.field.Name].ID;
3220
+ }
3221
+ else {
3222
+ this.record[this.field.Name].forEach((element) => {
3223
+ this.transformedRecord.push(Number(element.ID));
3224
+ });
3225
+ }
3226
+ }
3216
3227
  }
3217
3228
  /**
3218
3229
  * Metodo per emettere l'evento che il valore del record è cambiato.
3219
3230
  */
3220
3231
  onRecordValueChange(event) {
3221
- //this.recordChange.emit(this.record);
3232
+ this.record[this.field.Name] = new Array();
3233
+ if (!this.field.IsMultiChoiche) {
3234
+ var dynAttachment = JSON.parse(JSON.stringify(this.field.AttachmentList.find(x => x.ID == event)));
3235
+ dynAttachment.FileDataBase64 = null;
3236
+ this.record[this.field.Name] = dynAttachment;
3237
+ }
3238
+ else {
3239
+ this.transformedRecord.forEach((element) => {
3240
+ var dynAttachment = JSON.parse(JSON.stringify(this.field.AttachmentList.find(x => x.ID == element)));
3241
+ dynAttachment.FileDataBase64 = null;
3242
+ this.record[this.field.Name].push(dynAttachment);
3243
+ });
3244
+ }
3245
+ this.recordChange.emit(this.record);
3222
3246
  }
3223
3247
  }
3224
3248
  ImageFieldSelectorTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageFieldSelectorTemplateComponent, deps: [{ token: i1$2.MatDialog }, { token: UtilityHelperService }], target: i0.ɵɵFactoryTarget.Component });
3225
- ImageFieldSelectorTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageFieldSelectorTemplateComponent, selector: "image-field-selector-template", inputs: { record: "record", field: "field" }, outputs: { recordChange: "recordChange" }, usesOnChanges: true, ngImport: i0, template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label class=\"pt-1 ps-3\" [ngStyle]=\"LabelstyleObj\">{{field.Description}}</mat-label>\r\n\r\n <!-- Mat-Select SINGOLA -->\r\n <mat-select *ngIf=\"!field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange($event)\">\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.objectToSelect.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n <!-- Mat-Select MULTIPLA -->\r\n <mat-select *ngIf=\"field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange($event)\" multiple>\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.objectToSelect.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n</mat-form-field>", styles: [".mdc-list-item__primary-text{margin-right:50px}\n"], dependencies: [{ kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
3249
+ ImageFieldSelectorTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImageFieldSelectorTemplateComponent, selector: "image-field-selector-template", inputs: { record: "record", field: "field" }, outputs: { recordChange: "recordChange" }, usesOnChanges: true, ngImport: i0, template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label class=\"pt-1 ps-3\" [ngStyle]=\"LabelstyleObj\">{{field.Description}}</mat-label>\r\n\r\n <!-- Mat-Select SINGOLA -->\r\n <mat-select *ngIf=\"!field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"transformedRecord\" (ngModelChange)=\"onRecordValueChange($event)\">\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n <!-- Mat-Select MULTIPLA -->\r\n <mat-select *ngIf=\"field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"transformedRecord\" (ngModelChange)=\"onRecordValueChange($event)\" multiple>\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n</mat-form-field>", styles: [".mdc-list-item__primary-text{margin-right:50px}\n"], dependencies: [{ kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
3226
3250
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageFieldSelectorTemplateComponent, decorators: [{
3227
3251
  type: Component,
3228
- args: [{ selector: 'image-field-selector-template', template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label class=\"pt-1 ps-3\" [ngStyle]=\"LabelstyleObj\">{{field.Description}}</mat-label>\r\n\r\n <!-- Mat-Select SINGOLA -->\r\n <mat-select *ngIf=\"!field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange($event)\">\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.objectToSelect.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n <!-- Mat-Select MULTIPLA -->\r\n <mat-select *ngIf=\"field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"record[field.Name]\" (ngModelChange)=\"onRecordValueChange($event)\" multiple>\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.objectToSelect.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n</mat-form-field>", styles: [".mdc-list-item__primary-text{margin-right:50px}\n"] }]
3252
+ args: [{ selector: 'image-field-selector-template', template: "<mat-form-field [formGroup]=\"field.FormFormGroup\">\r\n <mat-label class=\"pt-1 ps-3\" [ngStyle]=\"LabelstyleObj\">{{field.Description}}</mat-label>\r\n\r\n <!-- Mat-Select SINGOLA -->\r\n <mat-select *ngIf=\"!field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"transformedRecord\" (ngModelChange)=\"onRecordValueChange($event)\">\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n <!-- Mat-Select MULTIPLA -->\r\n <mat-select *ngIf=\"field.IsMultiChoiche\" class=\"imageFieldSelectorImages\" [formControlName]=\"field.Name\"\r\n [required]=\"field.Required\" [(ngModel)]=\"transformedRecord\" (ngModelChange)=\"onRecordValueChange($event)\" multiple>\r\n <mat-option *ngFor=\"let attachment of field.AttachmentList\" [value]=\"attachment.ID\">\r\n <img src='data:image/{{ToLowerCase(attachment.FileExtension)}};base64,{{attachment.FileDataBase64}}' [height]=\"attachment.ResizedImageHeightPx != null ? attachment.ResizedImageHeightPx : 128\"> \r\n <span>{{ attachment.ButtonKey }}</span>\r\n </mat-option>\r\n </mat-select>\r\n\r\n</mat-form-field>", styles: [".mdc-list-item__primary-text{margin-right:50px}\n"] }]
3229
3253
  }], ctorParameters: function () { return [{ type: i1$2.MatDialog }, { type: UtilityHelperService }]; }, propDecorators: { record: [{
3230
3254
  type: Input
3231
3255
  }], field: [{
@@ -3666,7 +3690,7 @@ class ImageWithMarkersFieldTemplateComponent {
3666
3690
  if (this.record[this.field.Name] == null || this.record[this.field.Name] == 0) {
3667
3691
  this.FileDataBase64 = this.field.DynAttachment.FileDataBase64;
3668
3692
  this.imageWidth = (this.field.DynAttachment.ResizedImageHeightPx / this.field.DynAttachment.ImageHeightPx * this.field.DynAttachment.ImageWidthPx) + 50;
3669
- this.record[this.field.Name] = this.field.DynAttachmentID;
3693
+ this.record[this.field.Name] = this.field.DynAttachment;
3670
3694
  this.imageMarkAttachment = JSON.parse(JSON.stringify(this.field.DynAttachment));
3671
3695
  this.imageMarkAttachment.ID = 0;
3672
3696
  this.AttachmentID = this.field.DynAttachment.ID;