@eqproject/eqp-dynamic-module 2.4.7 → 2.4.9

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.
@@ -3095,6 +3095,7 @@ class ImageFieldTemplateComponent {
3095
3095
  this.dialogImageDrawingRef = this.dialog.open(this.dialogImageDrawing, {
3096
3096
  disableClose: true,
3097
3097
  hasBackdrop: true,
3098
+ panelClass: 'image-modal',
3098
3099
  width: '75%'
3099
3100
  });
3100
3101
  if (this.AttachmentID != null && Number(this.AttachmentID) > 0) {
@@ -3818,6 +3819,7 @@ class ImageWithMarkersFieldTemplateComponent {
3818
3819
  this.dialogImageMarkingRef = this.dialog.open(this.dialogImageMarking, {
3819
3820
  disableClose: true,
3820
3821
  hasBackdrop: true,
3822
+ panelClass: 'image-modal',
3821
3823
  width: '75%'
3822
3824
  });
3823
3825
  if (this.AttachmentID != null && Number(this.AttachmentID) > 0) {
@@ -8695,7 +8697,9 @@ class AddFormFieldComponent {
8695
8697
  attachment.ImageWidthPx = img.width;
8696
8698
  attachment.ImageHeightPx = img.height;
8697
8699
  attachment.AttachmentFieldType = AttachmentFieldTypeEnum.ELENCO_IMMAGINI;
8698
- self.imageSelectorAttachments.reloadData();
8700
+ if (self.imageSelectorAttachments) {
8701
+ self.imageSelectorAttachments.reloadData();
8702
+ }
8699
8703
  });
8700
8704
  }
8701
8705
  });
@@ -8954,6 +8958,10 @@ class AddFormFieldComponent {
8954
8958
  */
8955
8959
  saveAndExitAddField(save) {
8956
8960
  this.setResizedImagesHeightPx();
8961
+ this.setFieldOrdinalPosition();
8962
+ if (this.imageSelectorAttachments) {
8963
+ this.imageSelectorAttachments.reloadData();
8964
+ }
8957
8965
  if (save) {
8958
8966
  // retrocompatibilità con valuepairs per Elenco Generico
8959
8967
  if (this.field.FieldType == FieldTypeEnum["Elenco generico"]) {
@@ -9023,6 +9031,18 @@ class AddFormFieldComponent {
9023
9031
  key: 'action', display: '', type: TypeColumn.MenuAction, buttonMenuIcon: 'more_vert', styles: { flex: '0 0 6%' },
9024
9032
  actions: [
9025
9033
  { name: 'Elimina', icon: 'delete', fn: (element, index, col) => this.deleteListImage(element, index, col) },
9034
+ {
9035
+ name: "Sposta su",
9036
+ icon: "arrow_upward",
9037
+ fn: (element, index, col) => this.moveElement(element, true),
9038
+ disabled: (element) => this.field.AttachmentList.indexOf(element) === 0,
9039
+ },
9040
+ {
9041
+ name: "Sposta giù",
9042
+ icon: "arrow_downward",
9043
+ fn: (element, index, col) => this.moveElement(element, false),
9044
+ disabled: (element) => this.field.AttachmentList.indexOf(element) >= this.field.AttachmentList.length - 1,
9045
+ },
9026
9046
  ]
9027
9047
  });
9028
9048
  this.configColumnListImages.push({
@@ -9052,13 +9072,32 @@ class AddFormFieldComponent {
9052
9072
  display: "Altezza"
9053
9073
  });
9054
9074
  }
9075
+ moveElement(element, moveUp) {
9076
+ const startingIndex = this.field.AttachmentList.indexOf(element);
9077
+ const endingIndex = startingIndex + (moveUp ? -1 : 1);
9078
+ this.field.AttachmentList.splice(startingIndex, 1);
9079
+ this.field.AttachmentList.splice(endingIndex, 0, element);
9080
+ this.setFieldOrdinalPosition();
9081
+ if (this.imageSelectorAttachments) {
9082
+ this.imageSelectorAttachments.reloadData();
9083
+ }
9084
+ }
9085
+ setFieldOrdinalPosition() {
9086
+ if (this.field.AttachmentList) {
9087
+ this.field.AttachmentList.forEach((field) => {
9088
+ field.OrdinalPosition = this.field.AttachmentList.indexOf(field);
9089
+ });
9090
+ }
9091
+ }
9055
9092
  setResizedImagesHeightPx() {
9056
9093
  this.resizedImagesHeightPx = this.field.ResizedImagesHeightPx;
9057
9094
  }
9058
9095
  deleteListImage(el, i, col) {
9059
9096
  EqpDynamicModuleDialogService.Confirm('Eliminare questa immagine?', () => {
9060
9097
  this.field.AttachmentList.splice(el.originalIndex, 1);
9061
- this.imageSelectorAttachments.reloadData();
9098
+ if (this.imageSelectorAttachments) {
9099
+ this.imageSelectorAttachments.reloadData();
9100
+ }
9062
9101
  }, false, 'Richiesta conferma');
9063
9102
  }
9064
9103
  deleteImage(el) {