@eqproject/eqp-attachments 0.1.3 → 0.1.7
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/bundles/eqproject-eqp-attachments.umd.js +34 -12
- package/bundles/eqproject-eqp-attachments.umd.js.map +1 -1
- package/bundles/eqproject-eqp-attachments.umd.min.js +1 -1
- package/bundles/eqproject-eqp-attachments.umd.min.js.map +1 -1
- package/eqproject-eqp-attachments.metadata.json +1 -1
- package/esm2015/lib/eqp-attachments.component.js +35 -13
- package/esm5/lib/eqp-attachments.component.js +35 -13
- package/fesm2015/eqproject-eqp-attachments.js +34 -12
- package/fesm2015/eqproject-eqp-attachments.js.map +1 -1
- package/fesm5/eqproject-eqp-attachments.js +34 -12
- package/fesm5/eqproject-eqp-attachments.js.map +1 -1
- package/lib/eqp-attachments.component.d.ts +6 -0
- package/package.json +1 -1
|
@@ -273,7 +273,7 @@ var EqpAttachmentsComponent = /** @class */ (function () {
|
|
|
273
273
|
/**
|
|
274
274
|
* Mostra/nasconde la colonna per visualizzare l'anteprima dei file nella tabella (caso multipleAtatchments = true).
|
|
275
275
|
*/
|
|
276
|
-
this.showInlinePreview =
|
|
276
|
+
this.showInlinePreview = false;
|
|
277
277
|
/**
|
|
278
278
|
* Endpoint da chiamare per recueprare l'IAttachmentDTO completo da vedere nell'anteprima. La chiamata sarà in POST e nel body
|
|
279
279
|
* conterrà l'IAttachmentDTO selezionato dall'utente.
|
|
@@ -447,7 +447,7 @@ var EqpAttachmentsComponent = /** @class */ (function () {
|
|
|
447
447
|
var source = "data:" + attachment.FileContentType + ";base64," + attachment.FileDataBase64;
|
|
448
448
|
var link = document.createElement("a");
|
|
449
449
|
link.href = source;
|
|
450
|
-
link.download =
|
|
450
|
+
link.download = "" + attachment.FileName;
|
|
451
451
|
link.click();
|
|
452
452
|
}
|
|
453
453
|
else {
|
|
@@ -495,6 +495,19 @@ var EqpAttachmentsComponent = /** @class */ (function () {
|
|
|
495
495
|
this.newAttachmentForm.reset();
|
|
496
496
|
this.dialofRefAddAttachment.close();
|
|
497
497
|
};
|
|
498
|
+
/**
|
|
499
|
+
* In base al tipo di allegato controlla se disabilitare o meno il pulsante per salvare.
|
|
500
|
+
* Funzione usata nel [disable] del pulsante "Salva" del dialog per l'aggiunta di un allegato.
|
|
501
|
+
* @returns
|
|
502
|
+
*/
|
|
503
|
+
EqpAttachmentsComponent.prototype.disableSave = function () {
|
|
504
|
+
if (this.newAttachment.AttachmentType == AttachmentType.FILE) {
|
|
505
|
+
return !this.newAttachment.FileDataBase64;
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
return !this.newAttachment.FilePath;
|
|
509
|
+
}
|
|
510
|
+
};
|
|
498
511
|
EqpAttachmentsComponent.prototype.confirmAddAttachment = function () {
|
|
499
512
|
if (this.newAttachment.AttachmentType == AttachmentType.LINK && !this.newAttachment.FileName)
|
|
500
513
|
this.newAttachment.FileName = this.newAttachment.FilePath;
|
|
@@ -517,15 +530,17 @@ var EqpAttachmentsComponent = /** @class */ (function () {
|
|
|
517
530
|
return __generator(this, function (_a) {
|
|
518
531
|
switch (_a.label) {
|
|
519
532
|
case 0:
|
|
520
|
-
if (row.FileContentType.startsWith("video")) {
|
|
521
|
-
EqpAttachmentDialogService.Warning(this.videoPreviewErrorMessage);
|
|
522
|
-
return [2 /*return*/];
|
|
523
|
-
}
|
|
524
|
-
else if (row.FileContentType.startsWith("audio")) {
|
|
525
|
-
EqpAttachmentDialogService.Warning(this.audioPreviewErrorMessage);
|
|
526
|
-
return [2 /*return*/];
|
|
527
|
-
}
|
|
528
533
|
this.selectedAttachment = JSON.parse(JSON.stringify(row));
|
|
534
|
+
if (this.selectedAttachment.AttachmentType == AttachmentType.FILE) {
|
|
535
|
+
if (this.selectedAttachment.FileContentType.startsWith("video")) {
|
|
536
|
+
EqpAttachmentDialogService.Warning(this.videoPreviewErrorMessage);
|
|
537
|
+
return [2 /*return*/];
|
|
538
|
+
}
|
|
539
|
+
else if (this.selectedAttachment.FileContentType.startsWith("audio")) {
|
|
540
|
+
EqpAttachmentDialogService.Warning(this.audioPreviewErrorMessage);
|
|
541
|
+
return [2 /*return*/];
|
|
542
|
+
}
|
|
543
|
+
}
|
|
529
544
|
if (!(this.getAttachmentEndpoint && this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64)) return [3 /*break*/, 2];
|
|
530
545
|
return [4 /*yield*/, this.getAttachmentByID()
|
|
531
546
|
.then(function (res) { _this.selectedAttachment.FileDataBase64 = res.FileDataBase64; })
|
|
@@ -615,8 +630,15 @@ var EqpAttachmentsComponent = /** @class */ (function () {
|
|
|
615
630
|
return [4 /*yield*/, toBase64(this.selectedFile)];
|
|
616
631
|
case 2:
|
|
617
632
|
base64File = _a.sent();
|
|
618
|
-
if (base64File)
|
|
633
|
+
if (base64File) {
|
|
634
|
+
// Loris 20/01/2022: PROBLEMA - Quando eseguo l'upload di un file .sql non viene salvato/scaricato correttamente.
|
|
635
|
+
// Questo succede perchè non viene popolato il FileContentType. Per risolvere il problema
|
|
636
|
+
// faccio un controllo e se non esiste il FileContentType allora lo recupero dal base64 ottenuto.
|
|
637
|
+
this.newAttachment.FileContentType = !this.newAttachment.FileContentType ? base64File.split(",")[0].split(":")[1].split(";")[0] : this.newAttachment.FileContentType;
|
|
638
|
+
// Un altro metodo per leggere il ccontent type del file è tramite una regular expression:
|
|
639
|
+
// this.newAttachment.FileContentType = !this.newAttachment.FileContentType ? base64File.match(/[^:]\w+\/[\w-+\d.]+(?=;|,)/)[0] : this.newAttachment.FileContentType;
|
|
619
640
|
this.newAttachment.FileDataBase64 = base64File.split(",")[1];
|
|
641
|
+
}
|
|
620
642
|
_a.label = 3;
|
|
621
643
|
case 3: return [2 /*return*/];
|
|
622
644
|
}
|
|
@@ -870,7 +892,7 @@ var EqpAttachmentsComponent = /** @class */ (function () {
|
|
|
870
892
|
EqpAttachmentsComponent = __decorate([
|
|
871
893
|
Component({
|
|
872
894
|
selector: 'eqp-attachments',
|
|
873
|
-
template: "<!-- Se richiesta la gestione multipla mostra il pulsante di aggiunta e la tabella con l'elenco allegati -->\r\n<div *ngIf=\"multipleAttachment == true\">\r\n <mat-card [ngStyle]=\"{ 'box-shadow': showMatCard == false ? 'none' : null }\">\r\n <mat-card-header>\r\n <div class=\"col-md-6\">\r\n <div class=\"text-nowrap eqp-attachments-header-title\" *ngIf=\"showHeader == true\">\r\n {{headerTitle}}\r\n </div>\r\n </div>\r\n <div class=\"col-md-6 text-right\">\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\"\r\n type=\"button\" [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\">\r\n <mat-icon>add</mat-icon><span> {{addButtonLabel}} </span>\r\n </button>\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"openModalAddAttachment(1)\" class=\"eqp-attachments-file-btn\">\r\n <i class=\"fas fa-file\"></i>\r\n <span style=\"margin-left: 10px;\">File</span>\r\n </button>\r\n <button mat-menu-item (click)=\"openModalAddAttachment(2)\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px;\">Link</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </div>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <eqp-table #attachmentTable [createMatCard]=\"false\" #table [columns]=\"attachmentsColumns\"\r\n [data]=\"attachmentsList\" [emptyTableMessage]=\"emptyTableMessage\" [searchText]=\"eqpTableSearchText\">\r\n </eqp-table>\r\n </mat-card-content>\r\n </mat-card>\r\n</div>\r\n\r\n<!-- Se richiesta la gestione singola mostra il pulsante di caricamento di un singolo file -->\r\n<div *ngIf=\"multipleAttachment != true\">\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\"\r\n *ngIf=\"!attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0])\">\r\n <mat-icon>cloud_upload</mat-icon><span> {{addButtonLabel}} </span>\r\n </button>\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"openModalAddAttachment(1)\" class=\"eqp-attachments-file-btn\">\r\n <i class=\"fas fa-file\"></i>\r\n <span style=\"margin-left: 10px;\">File</span>\r\n </button>\r\n <button mat-menu-item (click)=\"openModalAddAttachment(2)\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px;\">Link</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button class=\"mb-2 mr-2 eqp-attachments-download-btn\" (click)=\"viewAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\" color=\"primary\">\r\n <mat-icon>download</mat-icon>\r\n {{attachmentsList[0].AttachmentType == AttachmentType.FILE ? downloadLabel : openLinkLabel}}\r\n </button>\r\n <button class=\"mb-2 mr-2 eqp-attachments-preview-btn\" (click)=\"openPreviewDialog(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\"\r\n *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0] && !attachmentsList[0].FileContentType.startsWith('video') && !attachmentsList[0].FileContentType.startsWith('audio')\">\r\n <mat-icon>visibility</mat-icon> {{previewLabel}}\r\n </button>\r\n <button class=\"mb-2 eqp-attachments-delete-btn\" (click)=\"deleteAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\"\r\n [disabled]=\"isDisabled\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n\r\n <div class=\"row\" style=\"margin-top: 10px;\"\r\n *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].FileDataBase64 && attachmentsList[0].IsImage == true\">\r\n <div class=\"col-sm-12\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{attachmentsList[0].FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].IsImage != true\">\r\n <div class=\"col-sm-12\">\r\n <mat-form-field>\r\n <mat-label>{{fileNameLabel}}</mat-label>\r\n <input readonly matInput [(ngModel)]=\"attachmentsList[0].FileName\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n<ng-template #dialogAddAttachment>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important;\">\r\n <form [formGroup]=\"newAttachmentForm\" (ngSubmit)=\"confirmAddAttachment()\" *ngIf=\"newAttachmentForm\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\"> {{addButtonLabel}} {{ newAttachment.AttachmentType ==\r\n attachmentType.FILE ?\r\n 'File' : 'Link'}} </div>\r\n </div>\r\n <div class=\"row\" style=\"margin-top: 20px;\">\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == attachmentType.FILE\">\r\n <input #imageInput style=\"display:none;\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileInputChange($event)\" [accept]=\"acceptedFileTypes\" />\r\n <button (click)=\"imageInput.click()\" type=\"button\" style=\"margin-left: 10px;\" id=\"file_attachment\"\r\n mat-raised-button color=\"primary\" [disabled]=\"showCropImage == true\"\r\n class=\"mb-2 btn btn-primary eqp-attachments-upload-btn\" *ngIf=\"!newAttachment.FileDataBase64\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n {{uploadFileLabel}}\r\n </button>\r\n <button (click)=\"abortFile()\" type=\"button\" style=\"margin-left: 10px;\" mat-raised-button\r\n *ngIf=\"newAttachment.FileDataBase64\" class=\"mb-2 eqp-attachments-delete-btn\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2 || selectedFile\">\r\n <mat-form-field>\r\n <mat-label> {{fileNameLabel}} </mat-label>\r\n <input formControlName=\"name\" matInput [(ngModel)]=\"newAttachment.FileName\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2\">\r\n <mat-form-field>\r\n <mat-label> Link </mat-label>\r\n <input formControlName=\"path\" required matInput [(ngModel)]=\"newAttachment.FilePath\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"row\"\r\n *ngIf=\"showCropImage != true && newAttachment.FileDataBase64 && newAttachment.IsImage == true\"\r\n style=\"margin-top: 10px;\">\r\n <div class=\"col-4\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{newAttachment.FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-2 mb-2\" *ngIf=\"showCropImage == true\">\r\n <div class=\"col-md-12 d-flex align-items-center justify-content-center\">\r\n <span class=\"mr-1\">Max H(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customHeight\" type=\"number\" matInput [(ngModel)]=\"customHeight\"\r\n (change)=\"onDimensionsChange('H')\">\r\n </mat-form-field>\r\n\r\n <span class=\"ml-2 mr-1\">Max W(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customWidth\" type=\"number\" matInput [(ngModel)]=\"customWidth\"\r\n (change)=\"onDimensionsChange('W')\">\r\n </mat-form-field>\r\n\r\n <button class=\"btn btn-primary mat-raised-button ml-2\" (click)=\"restoreOriginalDimensions()\"\r\n [disabled]=\"customWidth == originalWidth && customHeight == originalHeight\">\r\n <mat-icon style=\"vertical-align: middle;\">replay</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center\" *ngIf=\"showCropImage == true\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\" [maintainAspectRatio]=\"false\"\r\n [autoCrop]=\"false\" [containWithinAspectRatio]=\"false\" [aspectRatio]=\"4/3\"\r\n [cropperMinWidth]=\"128\" [onlyScaleDown]=\"true\" [roundCropper]=\"false\" [canvasRotation]=\"0\"\r\n [transform]=\"transform\" [alignImage]=\"'left'\" format=\"png\" (imageCropped)=\"imageCropped($event)\"\r\n [resizeToWidth]=\"customWidth\" [resizeToHeight]=\"customHeight\">\r\n </image-cropper>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center mt-2\" *ngIf=\"showCropImage == true\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-confirm-btn mr-2\" type=\"button\"\r\n (click)=\"confirmCrop()\">\r\n {{confirmLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-abort-btn\" type=\"button\" (click)=\"abortFile()\">\r\n {{abortLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n [disabled]=\"showCropImage == true || newAttachmentForm?.disabled == true\">\r\n {{saveLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" (click)=\"close()\"\r\n [disabled]=\"showCropImage == true\" type=\"button\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #inlinePreviewTemplate let-row=\"row\">\r\n <div class=\"inline-preview-container\" *ngIf=\"row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <img src=\"data:image/png;base64,{{row.FileThumbnailBase64 ? row.FileThumbnailBase64 : row.FileDataBase64}}\">\r\n </div>\r\n <div class=\"inline-preview-container\" *ngIf=\"!row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <i [ngClass]=\"getAttachmentIcon(row)\"></i>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<ng-template #dialogPreview>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important;\" *ngIf=\"selectedAttachment\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">\r\n {{previewLabel}} {{ selectedAttachment?.AttachmentType == attachmentType.FILE ? 'File' : 'Link'}}\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <!-- ANTEPRIMA IMMAGINE -->\r\n <div class=\"col-12 text-center preview-container\" *ngIf=\"selectedAttachment.IsImage\">\r\n <img class=\"image-preview\"\r\n src=\"data:image/png;base64,{{selectedAttachment.FileDataBase64 ? selectedAttachment.FileDataBase64 : selectedAttachment.FileThumbnailBase64}}\">\r\n </div>\r\n\r\n <!-- ANTEPRIMA LINK -->\r\n <div class=\"col-12 preview-container\" *ngIf=\"!selectedAttachment.IsImage\">\r\n <iframe class=\"link-preview\" [src]=\"selectedAttachment.TrustedUrl\"\r\n [title]=\"selectedAttachment.FileName\"></iframe>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-3\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n (click)=\"viewAttachment(selectedAttachment)\"\r\n *ngIf=\"selectedAttachment.AttachmentType != AttachmentType.LINK\">\r\n {{downloadLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" mat-dialog-close type=\"button\"\r\n (click)=\"selectedAttachment = null\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
895
|
+
template: "<!-- Se richiesta la gestione multipla mostra il pulsante di aggiunta e la tabella con l'elenco allegati -->\r\n<div *ngIf=\"multipleAttachment == true\">\r\n <mat-card [ngStyle]=\"{ 'box-shadow': showMatCard == false ? 'none' : null }\">\r\n <mat-card-header>\r\n <div class=\"col-md-6\">\r\n <div class=\"text-nowrap eqp-attachments-header-title\" *ngIf=\"showHeader == true\">\r\n {{headerTitle}}\r\n </div>\r\n </div>\r\n <div class=\"col-md-6 text-right\">\r\n <div class=\"row justify-content-end\">\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\"\r\n type=\"button\" [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\">\r\n <mat-icon>add</mat-icon><span> {{addButtonLabel}} </span>\r\n </button>\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"openModalAddAttachment(1)\" class=\"eqp-attachments-file-btn\">\r\n <i class=\"fas fa-file\"></i>\r\n <span style=\"margin-left: 10px;\">File</span>\r\n </button>\r\n <button mat-menu-item (click)=\"openModalAddAttachment(2)\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px;\">Link</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </div>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <eqp-table #attachmentTable [createMatCard]=\"false\" #table [columns]=\"attachmentsColumns\"\r\n [data]=\"attachmentsList\" [emptyTableMessage]=\"emptyTableMessage\" [searchText]=\"eqpTableSearchText\">\r\n </eqp-table>\r\n </mat-card-content>\r\n </mat-card>\r\n</div>\r\n\r\n<!-- Se richiesta la gestione singola mostra il pulsante di caricamento di un singolo file -->\r\n<div *ngIf=\"multipleAttachment != true\">\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\"\r\n *ngIf=\"!attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0])\">\r\n <mat-icon>cloud_upload</mat-icon><span> {{addButtonLabel}} </span>\r\n </button>\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"openModalAddAttachment(1)\" class=\"eqp-attachments-file-btn\">\r\n <i class=\"fas fa-file\"></i>\r\n <span style=\"margin-left: 10px;\">File</span>\r\n </button>\r\n <button mat-menu-item (click)=\"openModalAddAttachment(2)\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px;\">Link</span>\r\n </button>\r\n </mat-menu>\r\n\r\n <button class=\"mb-2 mr-2 eqp-attachments-download-btn\" (click)=\"viewAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\" color=\"primary\">\r\n <mat-icon *ngIf=\"attachmentsList[0].AttachmentType == AttachmentType.FILE\">download</mat-icon>\r\n <mat-icon *ngIf=\"attachmentsList[0].AttachmentType != AttachmentType.FILE\">open_in_new</mat-icon>\r\n {{attachmentsList[0].AttachmentType == AttachmentType.FILE ? downloadLabel : openLinkLabel}}\r\n </button>\r\n <button class=\"mb-2 mr-2 eqp-attachments-preview-btn\" (click)=\"openPreviewDialog(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\"\r\n *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0] && (!attachmentsList[0].FileContentType || (!attachmentsList[0].FileContentType.startsWith('video') && !attachmentsList[0].FileContentType.startsWith('audio')))\">\r\n <mat-icon>visibility</mat-icon> {{previewLabel}}\r\n </button>\r\n <button class=\"mb-2 eqp-attachments-delete-btn\" (click)=\"deleteAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\"\r\n [disabled]=\"isDisabled\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n\r\n <div class=\"row\" style=\"margin-top: 10px;\"\r\n *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].FileDataBase64 && attachmentsList[0].IsImage == true\">\r\n <div class=\"col-sm-12\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{attachmentsList[0].FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].IsImage != true\">\r\n <div class=\"col-sm-12\">\r\n <mat-form-field>\r\n <mat-label>{{fileNameLabel}}</mat-label>\r\n <input readonly matInput [(ngModel)]=\"attachmentsList[0].FileName\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n<ng-template #dialogAddAttachment>\r\n <div class=\"container-fluid eqp-attachments-dialog-add-container\" style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"newAttachmentForm\" (ngSubmit)=\"confirmAddAttachment()\" *ngIf=\"newAttachmentForm\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\"> {{addButtonLabel}} {{ newAttachment.AttachmentType ==\r\n attachmentType.FILE ?\r\n 'File' : 'Link'}} </div>\r\n </div>\r\n <div class=\"row\" style=\"margin-top: 20px;\">\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == attachmentType.FILE\">\r\n <input #imageInput style=\"display:none;\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileInputChange($event)\" [accept]=\"acceptedFileTypes\" />\r\n <button (click)=\"imageInput.click()\" type=\"button\" style=\"margin-left: 10px;\" id=\"file_attachment\"\r\n mat-raised-button color=\"primary\" [disabled]=\"showCropImage == true\"\r\n class=\"mb-2 btn btn-primary eqp-attachments-upload-btn\" *ngIf=\"!newAttachment.FileDataBase64\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n {{uploadFileLabel}}\r\n </button>\r\n <button (click)=\"abortFile()\" type=\"button\" style=\"margin-left: 10px;\" mat-raised-button\r\n *ngIf=\"newAttachment.FileDataBase64\" class=\"mb-2 eqp-attachments-delete-btn\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2 || selectedFile\">\r\n <mat-form-field>\r\n <mat-label> {{fileNameLabel}} </mat-label>\r\n <input formControlName=\"name\" matInput [(ngModel)]=\"newAttachment.FileName\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2\">\r\n <mat-form-field>\r\n <mat-label> Link </mat-label>\r\n <input formControlName=\"path\" required matInput [(ngModel)]=\"newAttachment.FilePath\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class=\"row\"\r\n *ngIf=\"showCropImage != true && newAttachment.FileDataBase64 && newAttachment.IsImage == true\"\r\n style=\"margin-top: 10px;\">\r\n <div class=\"col-4\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{newAttachment.FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-2 mb-2\" *ngIf=\"showCropImage == true\">\r\n <div class=\"col-md-12 d-flex align-items-center justify-content-center\">\r\n <span class=\"mr-1\">Max H(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customHeight\" type=\"number\" matInput [(ngModel)]=\"customHeight\"\r\n (change)=\"onDimensionsChange('H')\">\r\n </mat-form-field>\r\n\r\n <span class=\"ml-2 mr-1\">Max W(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customWidth\" type=\"number\" matInput [(ngModel)]=\"customWidth\"\r\n (change)=\"onDimensionsChange('W')\">\r\n </mat-form-field>\r\n\r\n <button class=\"btn btn-primary mat-raised-button ml-2\" (click)=\"restoreOriginalDimensions()\"\r\n [disabled]=\"customWidth == originalWidth && customHeight == originalHeight\">\r\n <mat-icon style=\"vertical-align: middle;\">replay</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center\" *ngIf=\"showCropImage == true\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\" [maintainAspectRatio]=\"false\"\r\n [autoCrop]=\"false\" [containWithinAspectRatio]=\"false\" [aspectRatio]=\"4/3\"\r\n [cropperMinWidth]=\"128\" [onlyScaleDown]=\"true\" [roundCropper]=\"false\" [canvasRotation]=\"0\"\r\n [transform]=\"transform\" [alignImage]=\"'left'\" format=\"png\" (imageCropped)=\"imageCropped($event)\"\r\n [resizeToWidth]=\"customWidth\" [resizeToHeight]=\"customHeight\">\r\n </image-cropper>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center mt-2\" *ngIf=\"showCropImage == true\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-confirm-btn mr-2\" type=\"button\"\r\n (click)=\"confirmCrop()\">\r\n {{confirmLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-abort-btn\" type=\"button\" (click)=\"abortFile()\">\r\n {{abortLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n [disabled]=\"showCropImage == true || newAttachmentForm?.disabled == true || disableSave()\">\r\n {{saveLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" (click)=\"close()\"\r\n [disabled]=\"showCropImage == true\" type=\"button\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #inlinePreviewTemplate let-row=\"row\">\r\n <div class=\"inline-preview-container\" *ngIf=\"row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <img src=\"data:image/png;base64,{{row.FileThumbnailBase64 ? row.FileThumbnailBase64 : row.FileDataBase64}}\">\r\n </div>\r\n <div class=\"inline-preview-container\" *ngIf=\"!row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <i [ngClass]=\"getAttachmentIcon(row)\"></i>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<ng-template #dialogPreview>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important;\" *ngIf=\"selectedAttachment\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">\r\n {{previewLabel}} {{ selectedAttachment?.AttachmentType == attachmentType.FILE ? 'File' : 'Link'}}\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <!-- ANTEPRIMA IMMAGINE -->\r\n <div class=\"col-12 text-center preview-container\" *ngIf=\"selectedAttachment.IsImage\">\r\n <img class=\"image-preview\"\r\n src=\"data:image/png;base64,{{selectedAttachment.FileDataBase64 ? selectedAttachment.FileDataBase64 : selectedAttachment.FileThumbnailBase64}}\">\r\n </div>\r\n\r\n <!-- ANTEPRIMA LINK -->\r\n <div class=\"col-12 preview-container\" *ngIf=\"!selectedAttachment.IsImage\">\r\n <iframe class=\"link-preview\" [src]=\"selectedAttachment.TrustedUrl\"\r\n [title]=\"selectedAttachment.FileName\"></iframe>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-3\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n (click)=\"viewAttachment(selectedAttachment)\"\r\n *ngIf=\"selectedAttachment.AttachmentType != AttachmentType.LINK\">\r\n {{downloadLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" mat-dialog-close type=\"button\"\r\n (click)=\"selectedAttachment = null\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
874
896
|
styles: [".eqp-attachments-header-title{font-weight:700;font-size:19px;line-height:24px;margin-bottom:auto}.single-attachment-inline-preview-container{max-height:400px;max-width:400px;display:flex;align-items:center}.single-attachment-inline-preview-container img{max-width:100%;max-height:120px}.inline-preview-container{max-height:100px;max-width:100px;display:flex;align-items:center;justify-content:center;width:100%;cursor:pointer}.inline-preview-container img{max-width:100%;max-height:100px}.inline-preview-container i{font-size:25px;margin:auto}.preview-container{max-height:60vh;max-width:100%}.preview-container .image-preview{max-width:100%;max-height:100%}.preview-container .link-preview{width:70vw;height:55vh}"]
|
|
875
897
|
})
|
|
876
898
|
], EqpAttachmentsComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eqproject-eqp-attachments.js","sources":["ng://@eqproject/eqp-attachments/lib/interfaces/IAttachment.ts","ng://@eqproject/eqp-attachments/lib/helpers/attachment.helper.ts","ng://@eqproject/eqp-attachments/lib/services/eqp-attachment-dialog.service.ts","ng://@eqproject/eqp-attachments/lib/eqp-attachments.component.ts","ng://@eqproject/eqp-attachments/lib/modules/material.module.ts","ng://@eqproject/eqp-attachments/lib/eqp-attachments.module.ts","ng://@eqproject/eqp-attachments/public-api.ts","ng://@eqproject/eqp-attachments/eqproject-eqp-attachments.ts"],"sourcesContent":["export interface IAttachmentDTO {\r\n ID: number | string;\r\n FileName?: string;\r\n FileContentType?: string;\r\n FileExtension?: string;\r\n FilePath?: string;\r\n AttachmentType?: AttachmentType;\r\n FileDataBase64?: string;\r\n IsImage?: boolean;\r\n FileThumbnailBase64?: string;\r\n TrustedUrl?: any;\r\n}\r\n\r\nexport enum AttachmentType {\r\n FILE = 1,\r\n LINK = 2\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AttachmentHelperService {\r\n\r\n static readonly imageMimeTypes: string[] = [\"image/bmp\", \"image/gif\", \"image/jpeg\", \"image/tiff\", \"image/png\"];\r\n\r\n static readonly fileExtensionIcon: any = {\r\n \"txt\": \"fas fa-file-text\",\r\n \"pdf\": \"fas fa-file-pdf\",\r\n \"doc\": \"fas fa-file-word\",\r\n \"docx\": \"fas fa-file-word\",\r\n \"xls\": \"fas fa-file-excel\",\r\n \"xlsx\": \"fas fa-file-excel\",\r\n \"jpg\": \"fas fa-file-image\",\r\n \"jpeg\": \"fas fa-file-image\",\r\n \"png\": \"fas fa-file-image\",\r\n \"bmp\": \"fas fa-file-image\",\r\n\r\n \"mkv\": \"fas fa-file-video\",\r\n \"flv\": \"fas fa-file-video\",\r\n \"gif\": \"fas fa-file-video\",\r\n \"gifv\": \"fas fa-file-video\",\r\n \"avi\": \"fas fa-file-video\",\r\n \"wmv\": \"fas fa-file-video\",\r\n \"mp4\": \"fas fa-file-video\",\r\n \"m4p\": \"fas fa-file-video\",\r\n \"m4v\": \"fas fa-file-video\",\r\n \"mpg\": \"fas fa-file-video\",\r\n \"mp2\": \"fas fa-file-video\",\r\n \"mpeg\": \"fas fa-file-video\",\r\n \"mpe\": \"fas fa-file-video\",\r\n \"mpv\": \"fas fa-file-video\",\r\n \"m2v\": \"fas fa-file-video\",\r\n \"3gp\": \"fas fa-file-video\",\r\n \"3g2\": \"fas fa-file-video\",\r\n\r\n \"mp3\": \"fas fa-file-audio\",\r\n };\r\n\r\n constructor() { }\r\n\r\n /**\r\n * Restituisce TRUE se il mime type passato nel parametro corrisponde ad un mime type di un'immagine\r\n * @param mimeType Mime Type da verificare\r\n */\r\n static checkImageFromMimeType(mimeType: string): boolean {\r\n return this.imageMimeTypes.find(s => s == mimeType) != null;\r\n }\r\n\r\n /**\r\n * In base all'estensione passata come parametro, restituisce la FontAwesome corretta da utilizzare.\r\n * Se l'estensione non viene trovata nella costante riportata dentro common.model.ts restituisce un icona standard\r\n * @param extension Estensione del file per cui restituire l'icona corretta\r\n */\r\n static getIconFromFileExtensione(extension: string): string {\r\n let fileIcon = this.fileExtensionIcon[extension];\r\n return fileIcon ?? \"fas fa-file\";\r\n }\r\n\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport Swal from 'sweetalert2';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class EqpAttachmentDialogService {\r\n\r\n constructor() { }\r\n\r\n /**\r\n * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.\r\n * @param message Messaggio d'errore da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Errore')\r\n */\r\n static Error(message: string | string[], title: string = null) {\r\n let currentTitle = title != null ? title : 'Errore';\r\n if (Array.isArray(message)) {\r\n currentTitle = title != null ? title : 'Errore';\r\n let htmlErrors: string = message.join(\"<br>\");\r\n Swal.fire({\r\n title: currentTitle,\r\n html: htmlErrors,\r\n icon: 'error'\r\n });\r\n }\r\n else {\r\n Swal.fire(currentTitle, message, 'error');\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto\r\n * CONFERMA lancia la funzione di callback passata come parametro\r\n * @param message Messaggio da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Info')\r\n */\r\n static Confirm(message: string | string[], confirmCallback: any, isWarning: boolean = false, title: string = null, customWidth: string = null) {\r\n\r\n let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';\r\n if (Array.isArray(message)) {\r\n let htmlErrors: string = message.join(\"<br>\");\r\n Swal.fire({\r\n title: currentTitle,\r\n html: htmlErrors,\r\n width: customWidth ? customWidth : '32rem',\r\n icon: !isWarning ? 'question' : 'warning',\r\n showCancelButton: true,\r\n allowOutsideClick: false,\r\n allowEscapeKey: false\r\n }).then((result) => {\r\n if (result.value && confirmCallback) {\r\n confirmCallback();\r\n }\r\n });\r\n }\r\n else {\r\n Swal.fire({\r\n title: currentTitle,\r\n text: message,\r\n width: customWidth ? customWidth : '32rem',\r\n icon: !isWarning ? 'question' : 'warning',\r\n showCancelButton: true,\r\n allowOutsideClick: false,\r\n allowEscapeKey: false\r\n }).then((result) => {\r\n if (result.value && confirmCallback) {\r\n confirmCallback();\r\n }\r\n })\r\n }\r\n }\r\n\r\n /**\r\n * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro\r\n * @param message Messaggio da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Info')\r\n */\r\n static Info(message: string, title: string = null, isToast: boolean = null) {\r\n let currentTitle = title != null ? title : \"Informazione:\";\r\n Swal.fire(currentTitle, message, 'info');\r\n }\r\n\r\n /**\r\n * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro\r\n * @param message Messaggio da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')\r\n */\r\n static Warning(message: string | string[], title: string = null, isToast: boolean = null) {\r\n let currentTitle = title != null ? title : \"Attenzione!\";\r\n\r\n if (Array.isArray(message)) {\r\n let htmlWarnings: string = message.join(\"<br>\");\r\n Swal.fire({\r\n title: currentTitle,\r\n html: htmlWarnings,\r\n icon: 'warning'\r\n });\r\n } else {\r\n Swal.fire(currentTitle, message, 'warning');\r\n }\r\n }\r\n}\r\n","import { Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core';\r\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\r\nimport { base64ToFile, ImageCroppedEvent, ImageCropperComponent, ImageTransform } from 'ngx-image-cropper';\r\nimport imageCompression from 'browser-image-compression'\r\nimport { AttachmentType, IAttachmentDTO } from './interfaces/IAttachment';\r\nimport { ConfigColumn, EqpTableComponent, TooltipPositionType, TypeColumn } from '@eqproject/eqp-table';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { AttachmentHelperService } from './helpers/attachment.helper';\r\nimport { EqpAttachmentDialogService } from './services/eqp-attachment-dialog.service';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { IOptions } from './interfaces/IOptions';\r\n\r\nconst toBase64 = file => new Promise<string>((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => resolve(reader.result.toString());\r\n reader.onerror = error => reject(error);\r\n});\r\n\r\n@Component({\r\n selector: 'eqp-attachments',\r\n templateUrl: './eqp-attachments.component.html',\r\n styleUrls: ['./eqp-attachments.component.scss']\r\n})\r\nexport class EqpAttachmentsComponent implements OnInit {\r\n\r\n //#region @Input del componente\r\n\r\n /**\r\n * Se TRUE allora nasconde la colonna per le azioni sull'allegato (nel caso \"multipleAttachment\" è TRUE).\r\n */\r\n @Input(\"disableAction\") disableAction: boolean = false;\r\n\r\n /**\r\n * Se TRUE mostra il titolo nell'header nel caso in cui \"multipleAttachment\" è TRUE (\"Elenco allegati\" di default).\r\n */\r\n @Input(\"showHeader\") showHeader: boolean = true;\r\n\r\n /**\r\n * Titolo da visualizzare se il parametro \"showHeader\" è TRUE. Di devault viene visualizzato \"Elenco allegati\".\r\n */\r\n @Input(\"headerTitle\") headerTitle: string = \"Elenco allegati\";\r\n\r\n /**\r\n * Sorgente dati da visualizzare. Nel caso si vuole gestire un singolo allegato va passato in ogni caso come Array.\r\n */\r\n @Input(\"attachmentsList\") attachmentsList: Array<IAttachmentDTO> = null;\r\n\r\n /**\r\n * Se TRUE non mostra la MatCard (nel caso in cui \"multipleAttachment\" è TRUE).\r\n */\r\n @Input(\"showMatCard\") showMatCard: boolean = true;\r\n\r\n /**\r\n * Se FALSE allora il componente mostra solo il pulsante di caricamento di un singolo file, una volta caricato il file invoca l'evento di output \"localEditedAttachments\".\r\n * Se TRUE allora il componente mostra l'elenco di tutti gli allegati ricevuto nel parametro \"attachmentsList\".\r\n */\r\n @Input(\"multipleAttachment\") multipleAttachment: boolean = true;\r\n\r\n /**\r\n * Configurazione delle colonne della eqp-table per la visualizzazione degli allegati (caso \"multipleAttachment\" è TRUE).\r\n */\r\n @Input(\"attachmentsColumns\") attachmentsColumns: Array<ConfigColumn> = null;\r\n\r\n /**\r\n * Imposta il messaggio da visualizzare nel caso in cui la tabella degli allegati (nel caso in cui \"multipleAttachment\" è TRUE) è vuota.\r\n */\r\n @Input(\"emptyTableMessage\") emptyTableMessage: string = \"Nessun dato trovato\";\r\n\r\n /**\r\n * Se TRUE allora permette di selezionare soltanto file di tipo immagine, avente uno dei mimetype\r\n * specificati dentro AttachmentHelperService.\r\n * Se FALSE permette di selezionare qualsiasi tipo di file\r\n */\r\n @Input(\"allowOnlyImages\") allowOnlyImages: boolean = false;\r\n\r\n /**\r\n * Specifica i tipi di file che è possibile caricare\r\n */\r\n @Input(\"acceptedFileTypes\") acceptedFileTypes: string;\r\n\r\n /**\r\n * Se TRUE disabilita il pulsante di Aggiunta allegato (a prescindere dal valore del parametro \"multipleAttachment\").\r\n */\r\n @Input(\"isDisabled\") isDisabled: boolean = false;\r\n\r\n /**\r\n * Mostra/nasconde la colonna per visualizzare l'anteprima dei file nella tabella (caso multipleAtatchments = true).\r\n */\r\n @Input(\"showInlinePreview\") showInlinePreview: boolean = true;\r\n\r\n /**\r\n * Endpoint da chiamare per recueprare l'IAttachmentDTO completo da vedere nell'anteprima. La chiamata sarà in POST e nel body\r\n * conterrà l'IAttachmentDTO selezionato dall'utente.\r\n * La chiamata viene eseguita solo per l'anteprima delle immagini essendo necessario il base64 completo dell'immagine a dimensione reale.\r\n * Per documenti/link basta che sia popolata la proprietà FilePath di IAttachmentDTO.\r\n */\r\n @Input(\"getAttachmentEndpoint\") getAttachmentEndpoint: string = null;\r\n\r\n /**\r\n * Hostname dell'ambiente di produzione dell'applicativo. Necessario per visualizzare l'anteprima dei documenti\r\n * tramite il viewer di google.\r\n * NOTA: Per visualizzare l'anteprima è necessario che la prorietà FilePath dell'IAttachmentDTO sia popolata e che\r\n * sia abilitato l'accesso alla cartella sul server tramite hostname.\r\n */\r\n @Input(\"productionBaseUrl\") productionBaseUrl: string = null;\r\n\r\n /**\r\n * Opzioni per la compressione delle immagini caricate.\r\n */\r\n @Input(\"compressionOptions\") compressionOptions: IOptions = { maxSizeMB: 0.5, maxWidthOrHeight: 1920, useWebWorker: true };\r\n\r\n /**\r\n * Input per definire le label da usare nel componente\r\n */\r\n @Input(\"downloadTooltipPosition\") downloadTooltipPosition: TooltipPositionType = TooltipPositionType.Below;\r\n @Input(\"openLinkLabel\") openLinkLabel: string = \"Apri link\";\r\n @Input(\"addButtonLabel\") addButtonLabel: string = \"Aggiungi\";\r\n @Input(\"downloadLabel\") downloadLabel: string = \"Download\";\r\n @Input(\"deleteLabel\") deleteLabel: string = \"Elimina\";\r\n @Input(\"fileNameLabel\") fileNameLabel: string = \"Nome file\";\r\n @Input(\"previewLabel\") previewLabel: string = \"Anteprima\";\r\n @Input(\"uploadFileLabel\") uploadFileLabel: string = \"Carica file\";\r\n @Input(\"confirmLabel\") confirmLabel: string = \"Conferma\";\r\n @Input(\"abortLabel\") abortLabel: string = \"Annulla\";\r\n @Input(\"saveLabel\") saveLabel: string = \"Salva\";\r\n @Input(\"exitLabel\") exitLabel: string = \"Esci\";\r\n @Input(\"eqpTableSearchText\") eqpTableSearchText: string = \"Cerca\";\r\n @Input(\"deleteDialogTitle\") deleteDialogTitle: string = null;\r\n @Input(\"deleteDialogMessage\") deleteDialogMessage: string = \"Sei sicuro di voler cancellare quest'allegato?\";\r\n @Input(\"noImageSelectedErrorMessage\") noImageSelectedErrorMessage: string = \"Non è possibile selezionare un file che non sia un'immagine.\";\r\n @Input(\"wrongTypeSelectedErrorMessage\") wrongTypeSelectedErrorMessage: string = \"Non è possibile caricare il file selezionato.\";\r\n @Input(\"videoPreviewErrorMessage\") videoPreviewErrorMessage: string = \"Impossibile aprire l'anteprima di un file video.\";\r\n @Input(\"videoPreviewErrorMessage\") audioPreviewErrorMessage: string = \"Impossibile aprire l'anteprima di un file audio.\";\r\n //#endregion\r\n\r\n //#region @Output del componente\r\n\r\n /**\r\n * Restituisce la lista aggiornata degli allegati.\r\n */\r\n @Output() localEditedAttachments: EventEmitter<Array<IAttachmentDTO>> = new EventEmitter<Array<IAttachmentDTO>>();\r\n\r\n /**\r\n * Evento di output che restituisce l'IAttachmentDTO selezionato per il download nel caso FileDataBase64, FileContentType o FileName non fossero specificati.\r\n */\r\n @Output(\"downloadAttachment\") downloadAttachment: EventEmitter<IAttachmentDTO> = new EventEmitter<IAttachmentDTO>();\r\n\r\n /**\r\n * Evento di output che restituisce l'elemento eliminato prima che questo venga effettivamente rismosso dalla lista.\r\n */\r\n @Output(\"onDeleteAttachment\") onDeleteAttachment: EventEmitter<IAttachmentDTO> = new EventEmitter<IAttachmentDTO>();\r\n\r\n //#endregion\r\n\r\n //#region Proprietà per gestione caricamento nuovo allegato\r\n newAttachment: IAttachmentDTO = {} as IAttachmentDTO;\r\n dialofRefAddAttachment: MatDialogRef<TemplateRef<any>>;\r\n attachmentType = AttachmentType;\r\n newAttachmentForm: FormGroup;\r\n selectedFile: File = null;\r\n showCropImage: boolean = false;\r\n @ViewChild('dialogAddAttachment', { static: true }) dialogAddAttachment: TemplateRef<any>;\r\n //#endregion\r\n\r\n //#region Proprietà per gestione ridimensionamento file di tipo image\r\n imageChangedEvent: any = '';\r\n croppedImage: any = '';\r\n transform: ImageTransform = {};\r\n @ViewChild(ImageCropperComponent) imageCropper: ImageCropperComponent;\r\n @ViewChild('imageInput') imageInput: any;\r\n //#endregion\r\n\r\n AttachmentType = AttachmentType;\r\n selectedAttachment: IAttachmentDTO;\r\n\r\n originalWidth: number;\r\n originalHeight: number;\r\n customWidth: number;\r\n customHeight: number;\r\n\r\n @ViewChild('attachmentTable', { static: false }) attachmentTable: EqpTableComponent;\r\n @ViewChild('inlinePreviewTemplate', { static: true }) inlinePreviewTemplate: TemplateRef<any>;\r\n @ViewChild('dialogPreview', { static: true }) dialogPreview: TemplateRef<any>;\r\n\r\n constructor(\r\n private dialog: MatDialog,\r\n private formBuilder: FormBuilder,\r\n private sanitizer: DomSanitizer,\r\n private http: HttpClient\r\n ) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n //Se è stata richiesta la gestione delle sole immagini allora imposta il filtro per le estensioni possibili da caricare\r\n if (!this.acceptedFileTypes)\r\n if (this.allowOnlyImages == true)\r\n this.acceptedFileTypes = \"image/*\";\r\n else\r\n this.acceptedFileTypes = \"*\";\r\n\r\n //Se è stata richiesta la gestione multipla degli allegati allora configura l'eqp-table\r\n if (this.multipleAttachment == true && (!this.attachmentsColumns || this.attachmentsColumns.length == 0)) {\r\n this.configureColumns();\r\n }\r\n\r\n if (this.attachmentsList == null)\r\n this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.checkAttachmentImage();\r\n\r\n // if (!this.compressionOptions || !this.compressionOptions.maxSizeMB || !this.compressionOptions.maxWidthOrHeight)\r\n // this.compressionOptions = { maxSizeMB: 0.5, maxWidthOrHeight: 1920, useWebWorker: true };\r\n }\r\n\r\n public reloadData() {\r\n if (this.attachmentTable)\r\n this.attachmentTable.reloadDatatable();\r\n }\r\n\r\n checkAttachmentImage() {\r\n this.attachmentsList.forEach(a => {\r\n a.IsImage = AttachmentHelperService.checkImageFromMimeType(a.FileContentType);\r\n });\r\n }\r\n\r\n //#region Gestione elenco allegati\r\n\r\n /**\r\n * Configura le colonne per l'eqp-table nel caso in cui il parametro \"multipleAttachments\" è TRUE.\r\n */\r\n configureColumns() {\r\n this.attachmentsColumns = [];\r\n if (this.disableAction != true) {\r\n this.attachmentsColumns.push({\r\n key: \"action\", display: \"\",\r\n type: TypeColumn.MenuAction, buttonMenuIcon: \"more_vert\", styles: { flex: \"0 0 6%\" },\r\n actions: [\r\n { name: this.deleteLabel, icon: \"delete\", fn: (element, index, col) => this.deleteAttachment(element) },\r\n ],\r\n })\r\n }\r\n\r\n let downloadColumn = {\r\n key: \"attachment\", display: \"\",\r\n type: TypeColumn.SimpleAction, styles: { flex: \"0 0 6%\" },\r\n actions: [\r\n {\r\n name: '', fontawesome: true,\r\n icon: (element) => { return this.showInlinePreview ? (element.AttachmentType == AttachmentType.FILE ? \"fas fa-cloud-download-alt\" : \"fas fa-external-link-alt\") : this.getAttachmentIcon(element); },\r\n fn: (element, col, elementIndex) => this.viewAttachment(element),\r\n tooltip: { tooltipText: (element) => { return element.AttachmentType == AttachmentType.FILE ? this.downloadLabel : this.openLinkLabel; }, tooltipPosition: this.downloadTooltipPosition }\r\n },\r\n ]\r\n };\r\n\r\n let inlinePreviewColumn = {\r\n key: \"InlinePreview\", display: this.previewLabel,\r\n type: TypeColumn.ExternalTemplate,\r\n externalTemplate: this.inlinePreviewTemplate,\r\n styles: { flex: \"0 0 10%\" }\r\n };\r\n\r\n let fileNameColumn = { key: \"FileName\", display: this.fileNameLabel };\r\n\r\n if (this.showInlinePreview) {\r\n this.attachmentsColumns.push(inlinePreviewColumn);\r\n this.attachmentsColumns.push(fileNameColumn);\r\n this.attachmentsColumns.push(downloadColumn);\r\n } else {\r\n this.attachmentsColumns.push(downloadColumn);\r\n this.attachmentsColumns.push(fileNameColumn);\r\n }\r\n }\r\n\r\n /**\r\n * Elimina un allegato eliminando anche il file presente nello storage di archiviazione utilizzato (AWS o cartella progetto)\r\n * @param element IAttachmentDTO da cancellare\r\n */\r\n deleteAttachment(element: IAttachmentDTO) {\r\n EqpAttachmentDialogService.Confirm(this.deleteDialogMessage, () => {\r\n this.removeAttachmentFromList(this.attachmentsList.indexOf(element));\r\n }, true, this.deleteDialogTitle);\r\n }\r\n\r\n /**\r\n * Rimuove l'allegato selezionato dalla lista \"attachmentsList\" e invoca l'evento di output che restituisce la lista aggiornata.\r\n * @param attachmentIndex Indice dell'attachment da rimuovere\r\n */\r\n removeAttachmentFromList(attachmentIndex: number) {\r\n this.onDeleteAttachment.emit(this.attachmentsList[attachmentIndex]);\r\n\r\n this.attachmentsList.splice(attachmentIndex, 1);\r\n if (this.attachmentTable)\r\n this.attachmentTable.reloadDatatable();\r\n this.localEditedAttachments.emit(this.attachmentsList);\r\n }\r\n\r\n\r\n /**\r\n * Scarica l'allegato o apre il link\r\n * @param element Allegato da mostrare\r\n */\r\n viewAttachment(attachment: IAttachmentDTO) {\r\n\r\n if (attachment.AttachmentType == AttachmentType.LINK) {\r\n window.open(attachment.FilePath, '_blank');\r\n return;\r\n }\r\n\r\n if (attachment.FileDataBase64 && attachment.FileContentType && attachment.FileName) {\r\n let source = `data:${attachment.FileContentType};base64,${attachment.FileDataBase64}`;\r\n const link = document.createElement(\"a\");\r\n link.href = source;\r\n link.download = `${attachment.FileName}.${attachment.FileExtension}`\r\n link.click();\r\n } else {\r\n this.downloadAttachment.emit(attachment);\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Ridefinisce l'icona da mostrare nella colonna dell'eqp-table per ogni file.\r\n * L'icona varia in base all'estensione del file\r\n * @param attachment \r\n */\r\n getAttachmentIcon(attachment: IAttachmentDTO) {\r\n if (attachment.AttachmentType == AttachmentType.LINK)\r\n return \"fas fa-link\";\r\n else\r\n return AttachmentHelperService.getIconFromFileExtensione(attachment.FileExtension);\r\n }\r\n\r\n //#endregion\r\n\r\n /**\r\n * Apre la modale per la definizione dei parametri del nuovo file\r\n */\r\n openModalAddAttachment(attachmentType: AttachmentType) {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n this.newAttachment.IsImage = false;\r\n this.newAttachment.AttachmentType = attachmentType;\r\n\r\n //Crea la form per la validazione dei campi\r\n this.newAttachmentForm = this.formBuilder.group({\r\n type: [this.newAttachment.AttachmentType, Validators.required],\r\n name: [this.newAttachment.FileName],\r\n path: [this.newAttachment.FilePath],\r\n customHeight: [this.customHeight],\r\n customWidth: [this.customWidth]\r\n });\r\n\r\n //Apre la modale\r\n this.dialofRefAddAttachment = this.dialog.open(this.dialogAddAttachment, {\r\n disableClose: true,\r\n hasBackdrop: true,\r\n width: '60%',\r\n maxHeight: '80%'\r\n });\r\n }\r\n\r\n close() {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n this.abortFile();\r\n this.newAttachmentForm.reset();\r\n this.dialofRefAddAttachment.close();\r\n }\r\n\r\n confirmAddAttachment() {\r\n if (this.newAttachment.AttachmentType == AttachmentType.LINK && !this.newAttachment.FileName)\r\n this.newAttachment.FileName = this.newAttachment.FilePath;\r\n\r\n if (this.attachmentsList == null)\r\n this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.attachmentsList.push(this.newAttachment);\r\n if (this.attachmentTable)\r\n this.attachmentTable.reloadDatatable();\r\n this.localEditedAttachments.emit(this.attachmentsList);\r\n this.dialofRefAddAttachment.close();\r\n }\r\n\r\n /**\r\n * Apre il dialog per l'anteprima dell'allegato selezionato.\r\n * @param row \r\n * @returns \r\n */\r\n async openPreviewDialog(row: IAttachmentDTO) {\r\n if (row.FileContentType.startsWith(\"video\")) {\r\n EqpAttachmentDialogService.Warning(this.videoPreviewErrorMessage);\r\n return;\r\n } else if (row.FileContentType.startsWith(\"audio\")) {\r\n EqpAttachmentDialogService.Warning(this.audioPreviewErrorMessage);\r\n return;\r\n }\r\n\r\n this.selectedAttachment = JSON.parse(JSON.stringify(row));\r\n\r\n if (this.getAttachmentEndpoint && this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64) {\r\n await this.getAttachmentByID()\r\n .then((res) => { this.selectedAttachment.FileDataBase64 = res.FileDataBase64; })\r\n .catch((err) => { EqpAttachmentDialogService.Error(err); });\r\n }\r\n\r\n if (this.selectedAttachment.AttachmentType == AttachmentType.LINK) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.selectedAttachment.FilePath);\r\n } else if (this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64 && !this.selectedAttachment.FileThumbnailBase64) {\r\n EqpAttachmentDialogService.Info(\"Impossibile aprire l'anteprima dell'allegato, file mancante.\")\r\n return;\r\n } else if (!this.selectedAttachment.IsImage) {\r\n if (this.selectedAttachment.FilePath && this.productionBaseUrl) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(\r\n \"https://docs.google.com/gview?url=\" +\r\n this.productionBaseUrl +\r\n \"/\" +\r\n this.selectedAttachment.FilePath +\r\n \"&embedded=true\"\r\n );\r\n } else {\r\n EqpAttachmentDialogService.Info(\"Impossibile aprire l'anteprima del documento!\");\r\n return;\r\n }\r\n }\r\n\r\n this.dialog.open(this.dialogPreview, {\r\n disableClose: true,\r\n hasBackdrop: true,\r\n });\r\n }\r\n\r\n async getAttachmentByID() {\r\n return this.http.post<IAttachmentDTO>(this.getAttachmentEndpoint, this.selectedAttachment).toPromise();\r\n }\r\n\r\n //#region Gestione caricamento file\r\n\r\n /** \r\n * Se il file caricato è un immagine allora mostra le funzionalità del croppie per ritagliare l'immagine altrimenti\r\n * converte il file in base64 e lo associa all'allegato da salvare\r\n */\r\n async onFileInputChange(event) {\r\n this.showCropImage = false;\r\n this.selectedFile = event.target.files[0];\r\n if (!this.selectedFile)\r\n return;\r\n\r\n //Memorizza i dati per l'allegato \r\n this.newAttachment.FileContentType = this.selectedFile.type;\r\n this.newAttachment.FileName = this.selectedFile.name;\r\n this.newAttachment.FileExtension = this.selectedFile.name.substr(this.selectedFile.name.lastIndexOf('.') + 1);\r\n this.newAttachment.IsImage = AttachmentHelperService.checkImageFromMimeType(this.selectedFile.type);\r\n\r\n //Se è stata richiesta la gestione delle sole immagini ma per errore è stato selezionato un file che non è un immagine\r\n if (this.allowOnlyImages == true && this.newAttachment.IsImage != true) {\r\n EqpAttachmentDialogService.Error(this.noImageSelectedErrorMessage);\r\n this.abortFile();\r\n return;\r\n } else if (!this.checkAcceptedFiles()) {\r\n EqpAttachmentDialogService.Error(this.wrongTypeSelectedErrorMessage);\r\n this.abortFile();\r\n return;\r\n }\r\n\r\n\r\n\r\n //Verifica se il file caricato è un'immagine oppure no. Se è un immagine, prima di caricarla mostra il croppie per il resize.\r\n //Se non è un immagine allora genera il Base64 \r\n if (this.newAttachment.IsImage == true) {\r\n this.getImageDimensions(event.target.files[0])\r\n\r\n //Mostra il croppie e disabilita la form finchè non termina la modifica dell'immagine\r\n this.newAttachmentForm.disable();\r\n this.newAttachmentForm.controls[\"customWidth\"].enable();\r\n this.newAttachmentForm.controls[\"customHeight\"].enable();\r\n this.showCropImage = true;\r\n this.imageChangedEvent = event;\r\n }\r\n else {\r\n this.showCropImage = false;\r\n let base64File = await toBase64(this.selectedFile);\r\n if (base64File)\r\n this.newAttachment.FileDataBase64 = base64File.split(\",\")[1];\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Controlla se il file che si sta caricando è supportato dal sistema.\r\n * @returns \r\n */\r\n checkAcceptedFiles(): boolean {\r\n if (this.selectedFile.type.startsWith(\"video\"))\r\n return false;\r\n\r\n if (this.acceptedFileTypes == \"*\")\r\n return true;\r\n let accepted: boolean = this.acceptedFileTypes.includes(this.selectedFile.type);\r\n if (!accepted) {\r\n for (let t of this.acceptedFileTypes.split(\",\").filter(t => t.includes(\"*\"))) {\r\n accepted = this.selectedFile.type.startsWith(t.split(\"*\")[0]);\r\n if (accepted)\r\n break;\r\n }\r\n }\r\n return accepted;\r\n }\r\n\r\n getImageDimensions(img: any) {\r\n const reader = new FileReader();\r\n reader.onload = (e: any) => {\r\n const image = new Image();\r\n image.src = e.target.result;\r\n image.onload = rs => {\r\n this.originalHeight = rs.currentTarget['height'];\r\n this.originalWidth = rs.currentTarget['width'];\r\n\r\n if (this.originalWidth > 1280) {\r\n this.customWidth = 1280;\r\n this.customHeight = Math.round((1280 * this.originalHeight) / this.originalWidth);\r\n } else {\r\n this.customHeight = rs.currentTarget['height'];\r\n this.customWidth = rs.currentTarget['width'];\r\n }\r\n };\r\n };\r\n reader.readAsDataURL(img);\r\n }\r\n\r\n restoreOriginalDimensions() {\r\n this.customWidth = this.originalWidth;\r\n this.customHeight = this.originalHeight;\r\n }\r\n\r\n onDimensionsChange(dimension: string) {\r\n if (dimension == \"H\") {\r\n this.customWidth = Math.round((this.customHeight * this.originalWidth) / this.originalHeight);\r\n } else if (dimension == \"W\") {\r\n this.customHeight = Math.round((this.customWidth * this.originalHeight) / this.originalWidth);\r\n }\r\n }\r\n\r\n imageCropped(event: ImageCroppedEvent) {\r\n this.croppedImage = event.base64;\r\n this.getCroppedAndUpload(this.croppedImage);\r\n }\r\n\r\n getCroppedAndUpload(file) {\r\n var self = this;\r\n\r\n var file: any = base64ToFile(file);\r\n\r\n const options = this.compressionOptions;\r\n\r\n /**\r\n * Comprime l'immagine passando come parametri le options create nell'oggetto sopra, e il file dal reader principale\r\n */\r\n imageCompression(file, options).then((fileCompressed => {\r\n\r\n let fileReader = new FileReader();\r\n\r\n //Faccio la push di ogni file all'interno dell'array di file dell'item da mandare al server\r\n fileReader.onload = function () {\r\n let resultReader = <string>fileReader.result;\r\n var marker = ';base64,';\r\n self.newAttachment.FileDataBase64 = resultReader.substring(resultReader.indexOf(marker) + marker.length);\r\n self.showCropImage = false;\r\n self.newAttachmentForm.enable();\r\n };\r\n\r\n fileReader.readAsDataURL(fileCompressed);\r\n\r\n }));\r\n\r\n }\r\n\r\n confirmCrop() {\r\n this.imageCropper.crop();\r\n }\r\n\r\n /**\r\n * Annulla la selezione del file, svuotando l'input e resettando tutte le proprietà dell'IAttachmentDTO\r\n */\r\n abortFile() {\r\n this.imageChangedEvent = '';\r\n if (this.imageInput)\r\n this.imageInput.nativeElement.value = '';\r\n\r\n this.selectedFile = null;\r\n this.showCropImage = false;\r\n\r\n this.newAttachment.IsImage = false;\r\n this.newAttachment.FileDataBase64 = null;\r\n this.newAttachment.FileName = null;\r\n this.newAttachment.FileExtension = null;\r\n this.newAttachment.FileContentType = null;\r\n\r\n this.customHeight = null;\r\n this.customWidth = null;\r\n this.originalHeight = null;\r\n this.originalWidth = null;\r\n }\r\n\r\n //#endregion\r\n}","import { NgModule } from '@angular/core';\r\n\r\n//Angular Material Components\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatRadioModule } from '@angular/material/radio';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatSliderModule } from '@angular/material/slider';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\nimport { MatMenuModule } from '@angular/material/menu';\r\nimport { MatSidenavModule } from '@angular/material/sidenav';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatGridListModule } from '@angular/material/grid-list';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatStepperModule } from '@angular/material/stepper';\r\nimport { MatTabsModule } from '@angular/material/tabs';\r\nimport { MatExpansionModule } from '@angular/material/expansion';\r\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\r\nimport { MatTableModule } from '@angular/material/table';\r\nimport { MatSortModule } from '@angular/material/sort';\r\nimport { MatPaginatorModule } from '@angular/material/paginator';\r\nimport { MatNativeDateModule } from '@angular/material/core';\r\n\r\n\r\n@NgModule({\r\n imports: [\r\n MatCheckboxModule,\r\n MatButtonModule,\r\n MatInputModule,\r\n MatAutocompleteModule,\r\n MatDatepickerModule,\r\n MatFormFieldModule,\r\n MatRadioModule,\r\n MatSelectModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatMenuModule,\r\n MatSidenavModule,\r\n MatToolbarModule,\r\n MatListModule,\r\n MatGridListModule,\r\n MatCardModule,\r\n MatStepperModule,\r\n MatTabsModule,\r\n MatExpansionModule,\r\n MatButtonToggleModule,\r\n MatChipsModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatProgressBarModule,\r\n MatDialogModule,\r\n MatTooltipModule,\r\n MatSnackBarModule,\r\n MatTableModule,\r\n MatSortModule,\r\n MatPaginatorModule,\r\n MatDatepickerModule,\r\n MatNativeDateModule\r\n ],\r\n exports: [\r\n MatCheckboxModule,\r\n MatButtonModule,\r\n MatInputModule,\r\n MatAutocompleteModule,\r\n MatDatepickerModule,\r\n MatFormFieldModule,\r\n MatRadioModule,\r\n MatSelectModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatMenuModule,\r\n MatSidenavModule,\r\n MatToolbarModule,\r\n MatListModule,\r\n MatGridListModule,\r\n MatCardModule,\r\n MatStepperModule,\r\n MatTabsModule,\r\n MatExpansionModule,\r\n MatButtonToggleModule,\r\n MatChipsModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatProgressBarModule,\r\n MatDialogModule,\r\n MatTooltipModule,\r\n MatSnackBarModule,\r\n MatTableModule,\r\n MatSortModule,\r\n MatPaginatorModule],\r\n})\r\nexport class MaterialModule { }","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { EqpAttachmentsComponent } from './eqp-attachments.component';\r\nimport { MaterialModule } from './modules/material.module';\r\nimport { ImageCropperModule } from 'ngx-image-cropper';\r\nimport { EqpTableModule } from '@eqproject/eqp-table';\r\n\r\n\r\n@NgModule({\r\n declarations: [EqpAttachmentsComponent],\r\n imports: [\r\n MaterialModule,\r\n FormsModule,\r\n CommonModule,\r\n ReactiveFormsModule,\r\n ImageCropperModule,\r\n EqpTableModule\r\n ],\r\n exports: [EqpAttachmentsComponent]\r\n})\r\nexport class EqpAttachmentsModule { }\r\n","/*\r\n * Public API Surface of eqp-attachments\r\n */\r\n\r\nexport * from './lib/eqp-attachments.component';\r\nexport * from './lib/eqp-attachments.module';\r\nexport * from './lib/interfaces/IAttachment';\r\nexport * from './lib/interfaces/IOptions';\r\nexport * from './lib/helpers/attachment.helper';\r\nexport * from './lib/services/eqp-attachment-dialog.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {MaterialModule as ɵa} from './lib/modules/material.module';"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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kBAAkB;gBAClB,qBAAqB;gBACrB,cAAc;gBACd,aAAa;gBACb,wBAAwB;gBACxB,oBAAoB;gBACpB,eAAe;gBACf,gBAAgB;gBAChB,iBAAiB;gBACjB,cAAc;gBACd,aAAa;gBACb,kBAAkB;aAAC;SACtB,CAAC;OACW,cAAc,CAAI;IAAD,qBAAC;CAA/B;;;IClFA;KAAqC;IAAxB,oBAAoB;QAZhC,QAAQ,CAAC;YACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;YACvC,OAAO,EAAE;gBACP,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,mBAAmB;gBACnB,kBAAkB;gBAClB,cAAc;aACf;YACD,OAAO,EAAE,CAAC,uBAAuB,CAAC;SACnC,CAAC;OACW,oBAAoB,CAAI;IAAD,2BAAC;CAArC;;ACrBA;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"eqproject-eqp-attachments.js","sources":["ng://@eqproject/eqp-attachments/lib/interfaces/IAttachment.ts","ng://@eqproject/eqp-attachments/lib/helpers/attachment.helper.ts","ng://@eqproject/eqp-attachments/lib/services/eqp-attachment-dialog.service.ts","ng://@eqproject/eqp-attachments/lib/eqp-attachments.component.ts","ng://@eqproject/eqp-attachments/lib/modules/material.module.ts","ng://@eqproject/eqp-attachments/lib/eqp-attachments.module.ts","ng://@eqproject/eqp-attachments/public-api.ts","ng://@eqproject/eqp-attachments/eqproject-eqp-attachments.ts"],"sourcesContent":["export interface IAttachmentDTO {\r\n ID: number | string;\r\n FileName?: string;\r\n FileContentType?: string;\r\n FileExtension?: string;\r\n FilePath?: string;\r\n AttachmentType?: AttachmentType;\r\n FileDataBase64?: string;\r\n IsImage?: boolean;\r\n FileThumbnailBase64?: string;\r\n TrustedUrl?: any;\r\n}\r\n\r\nexport enum AttachmentType {\r\n FILE = 1,\r\n LINK = 2\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AttachmentHelperService {\r\n\r\n static readonly imageMimeTypes: string[] = [\"image/bmp\", \"image/gif\", \"image/jpeg\", \"image/tiff\", \"image/png\"];\r\n\r\n static readonly fileExtensionIcon: any = {\r\n \"txt\": \"fas fa-file-text\",\r\n \"pdf\": \"fas fa-file-pdf\",\r\n \"doc\": \"fas fa-file-word\",\r\n \"docx\": \"fas fa-file-word\",\r\n \"xls\": \"fas fa-file-excel\",\r\n \"xlsx\": \"fas fa-file-excel\",\r\n \"jpg\": \"fas fa-file-image\",\r\n \"jpeg\": \"fas fa-file-image\",\r\n \"png\": \"fas fa-file-image\",\r\n \"bmp\": \"fas fa-file-image\",\r\n\r\n \"mkv\": \"fas fa-file-video\",\r\n \"flv\": \"fas fa-file-video\",\r\n \"gif\": \"fas fa-file-video\",\r\n \"gifv\": \"fas fa-file-video\",\r\n \"avi\": \"fas fa-file-video\",\r\n \"wmv\": \"fas fa-file-video\",\r\n \"mp4\": \"fas fa-file-video\",\r\n \"m4p\": \"fas fa-file-video\",\r\n \"m4v\": \"fas fa-file-video\",\r\n \"mpg\": \"fas fa-file-video\",\r\n \"mp2\": \"fas fa-file-video\",\r\n \"mpeg\": \"fas fa-file-video\",\r\n \"mpe\": \"fas fa-file-video\",\r\n \"mpv\": \"fas fa-file-video\",\r\n \"m2v\": \"fas fa-file-video\",\r\n \"3gp\": \"fas fa-file-video\",\r\n \"3g2\": \"fas fa-file-video\",\r\n\r\n \"mp3\": \"fas fa-file-audio\",\r\n };\r\n\r\n constructor() { }\r\n\r\n /**\r\n * Restituisce TRUE se il mime type passato nel parametro corrisponde ad un mime type di un'immagine\r\n * @param mimeType Mime Type da verificare\r\n */\r\n static checkImageFromMimeType(mimeType: string): boolean {\r\n return this.imageMimeTypes.find(s => s == mimeType) != null;\r\n }\r\n\r\n /**\r\n * In base all'estensione passata come parametro, restituisce la FontAwesome corretta da utilizzare.\r\n * Se l'estensione non viene trovata nella costante riportata dentro common.model.ts restituisce un icona standard\r\n * @param extension Estensione del file per cui restituire l'icona corretta\r\n */\r\n static getIconFromFileExtensione(extension: string): string {\r\n let fileIcon = this.fileExtensionIcon[extension];\r\n return fileIcon ?? \"fas fa-file\";\r\n }\r\n\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport Swal from 'sweetalert2';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class EqpAttachmentDialogService {\r\n\r\n constructor() { }\r\n\r\n /**\r\n * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.\r\n * @param message Messaggio d'errore da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Errore')\r\n */\r\n static Error(message: string | string[], title: string = null) {\r\n let currentTitle = title != null ? title : 'Errore';\r\n if (Array.isArray(message)) {\r\n currentTitle = title != null ? title : 'Errore';\r\n let htmlErrors: string = message.join(\"<br>\");\r\n Swal.fire({\r\n title: currentTitle,\r\n html: htmlErrors,\r\n icon: 'error'\r\n });\r\n }\r\n else {\r\n Swal.fire(currentTitle, message, 'error');\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto\r\n * CONFERMA lancia la funzione di callback passata come parametro\r\n * @param message Messaggio da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Info')\r\n */\r\n static Confirm(message: string | string[], confirmCallback: any, isWarning: boolean = false, title: string = null, customWidth: string = null) {\r\n\r\n let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';\r\n if (Array.isArray(message)) {\r\n let htmlErrors: string = message.join(\"<br>\");\r\n Swal.fire({\r\n title: currentTitle,\r\n html: htmlErrors,\r\n width: customWidth ? customWidth : '32rem',\r\n icon: !isWarning ? 'question' : 'warning',\r\n showCancelButton: true,\r\n allowOutsideClick: false,\r\n allowEscapeKey: false\r\n }).then((result) => {\r\n if (result.value && confirmCallback) {\r\n confirmCallback();\r\n }\r\n });\r\n }\r\n else {\r\n Swal.fire({\r\n title: currentTitle,\r\n text: message,\r\n width: customWidth ? customWidth : '32rem',\r\n icon: !isWarning ? 'question' : 'warning',\r\n showCancelButton: true,\r\n allowOutsideClick: false,\r\n allowEscapeKey: false\r\n }).then((result) => {\r\n if (result.value && confirmCallback) {\r\n confirmCallback();\r\n }\r\n })\r\n }\r\n }\r\n\r\n /**\r\n * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro\r\n * @param message Messaggio da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Info')\r\n */\r\n static Info(message: string, title: string = null, isToast: boolean = null) {\r\n let currentTitle = title != null ? title : \"Informazione:\";\r\n Swal.fire(currentTitle, message, 'info');\r\n }\r\n\r\n /**\r\n * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro\r\n * @param message Messaggio da mostrare nello sweetalert\r\n * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')\r\n */\r\n static Warning(message: string | string[], title: string = null, isToast: boolean = null) {\r\n let currentTitle = title != null ? title : \"Attenzione!\";\r\n\r\n if (Array.isArray(message)) {\r\n let htmlWarnings: string = message.join(\"<br>\");\r\n Swal.fire({\r\n title: currentTitle,\r\n html: htmlWarnings,\r\n icon: 'warning'\r\n });\r\n } else {\r\n Swal.fire(currentTitle, message, 'warning');\r\n }\r\n }\r\n}\r\n","import { Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core';\r\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\r\nimport { base64ToFile, ImageCroppedEvent, ImageCropperComponent, ImageTransform } from 'ngx-image-cropper';\r\nimport imageCompression from 'browser-image-compression'\r\nimport { AttachmentType, IAttachmentDTO } from './interfaces/IAttachment';\r\nimport { ConfigColumn, EqpTableComponent, TooltipPositionType, TypeColumn } from '@eqproject/eqp-table';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { AttachmentHelperService } from './helpers/attachment.helper';\r\nimport { EqpAttachmentDialogService } from './services/eqp-attachment-dialog.service';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { IOptions } from './interfaces/IOptions';\r\n\r\nconst toBase64 = file => new Promise<string>((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => resolve(reader.result.toString());\r\n reader.onerror = error => reject(error);\r\n});\r\n\r\n@Component({\r\n selector: 'eqp-attachments',\r\n templateUrl: './eqp-attachments.component.html',\r\n styleUrls: ['./eqp-attachments.component.scss']\r\n})\r\nexport class EqpAttachmentsComponent implements OnInit {\r\n\r\n //#region @Input del componente\r\n\r\n /**\r\n * Se TRUE allora nasconde la colonna per le azioni sull'allegato (nel caso \"multipleAttachment\" è TRUE).\r\n */\r\n @Input(\"disableAction\") disableAction: boolean = false;\r\n\r\n /**\r\n * Se TRUE mostra il titolo nell'header nel caso in cui \"multipleAttachment\" è TRUE (\"Elenco allegati\" di default).\r\n */\r\n @Input(\"showHeader\") showHeader: boolean = true;\r\n\r\n /**\r\n * Titolo da visualizzare se il parametro \"showHeader\" è TRUE. Di devault viene visualizzato \"Elenco allegati\".\r\n */\r\n @Input(\"headerTitle\") headerTitle: string = \"Elenco allegati\";\r\n\r\n /**\r\n * Sorgente dati da visualizzare. Nel caso si vuole gestire un singolo allegato va passato in ogni caso come Array.\r\n */\r\n @Input(\"attachmentsList\") attachmentsList: Array<IAttachmentDTO> = null;\r\n\r\n /**\r\n * Se TRUE non mostra la MatCard (nel caso in cui \"multipleAttachment\" è TRUE).\r\n */\r\n @Input(\"showMatCard\") showMatCard: boolean = true;\r\n\r\n /**\r\n * Se FALSE allora il componente mostra solo il pulsante di caricamento di un singolo file, una volta caricato il file invoca l'evento di output \"localEditedAttachments\".\r\n * Se TRUE allora il componente mostra l'elenco di tutti gli allegati ricevuto nel parametro \"attachmentsList\".\r\n */\r\n @Input(\"multipleAttachment\") multipleAttachment: boolean = true;\r\n\r\n /**\r\n * Configurazione delle colonne della eqp-table per la visualizzazione degli allegati (caso \"multipleAttachment\" è TRUE).\r\n */\r\n @Input(\"attachmentsColumns\") attachmentsColumns: Array<ConfigColumn> = null;\r\n\r\n /**\r\n * Imposta il messaggio da visualizzare nel caso in cui la tabella degli allegati (nel caso in cui \"multipleAttachment\" è TRUE) è vuota.\r\n */\r\n @Input(\"emptyTableMessage\") emptyTableMessage: string = \"Nessun dato trovato\";\r\n\r\n /**\r\n * Se TRUE allora permette di selezionare soltanto file di tipo immagine, avente uno dei mimetype\r\n * specificati dentro AttachmentHelperService.\r\n * Se FALSE permette di selezionare qualsiasi tipo di file\r\n */\r\n @Input(\"allowOnlyImages\") allowOnlyImages: boolean = false;\r\n\r\n /**\r\n * Specifica i tipi di file che è possibile caricare\r\n */\r\n @Input(\"acceptedFileTypes\") acceptedFileTypes: string;\r\n\r\n /**\r\n * Se TRUE disabilita il pulsante di Aggiunta allegato (a prescindere dal valore del parametro \"multipleAttachment\").\r\n */\r\n @Input(\"isDisabled\") isDisabled: boolean = false;\r\n\r\n /**\r\n * Mostra/nasconde la colonna per visualizzare l'anteprima dei file nella tabella (caso multipleAtatchments = true).\r\n */\r\n @Input(\"showInlinePreview\") showInlinePreview: boolean = false;\r\n\r\n /**\r\n * Endpoint da chiamare per recueprare l'IAttachmentDTO completo da vedere nell'anteprima. La chiamata sarà in POST e nel body\r\n * conterrà l'IAttachmentDTO selezionato dall'utente.\r\n * La chiamata viene eseguita solo per l'anteprima delle immagini essendo necessario il base64 completo dell'immagine a dimensione reale.\r\n * Per documenti/link basta che sia popolata la proprietà FilePath di IAttachmentDTO.\r\n */\r\n @Input(\"getAttachmentEndpoint\") getAttachmentEndpoint: string = null;\r\n\r\n /**\r\n * Hostname dell'ambiente di produzione dell'applicativo. Necessario per visualizzare l'anteprima dei documenti\r\n * tramite il viewer di google.\r\n * NOTA: Per visualizzare l'anteprima è necessario che la prorietà FilePath dell'IAttachmentDTO sia popolata e che\r\n * sia abilitato l'accesso alla cartella sul server tramite hostname.\r\n */\r\n @Input(\"productionBaseUrl\") productionBaseUrl: string = null;\r\n\r\n /**\r\n * Opzioni per la compressione delle immagini caricate.\r\n */\r\n @Input(\"compressionOptions\") compressionOptions: IOptions = { maxSizeMB: 0.5, maxWidthOrHeight: 1920, useWebWorker: true };\r\n\r\n /**\r\n * Input per definire le label da usare nel componente\r\n */\r\n @Input(\"downloadTooltipPosition\") downloadTooltipPosition: TooltipPositionType = TooltipPositionType.Below;\r\n @Input(\"openLinkLabel\") openLinkLabel: string = \"Apri link\";\r\n @Input(\"addButtonLabel\") addButtonLabel: string = \"Aggiungi\";\r\n @Input(\"downloadLabel\") downloadLabel: string = \"Download\";\r\n @Input(\"deleteLabel\") deleteLabel: string = \"Elimina\";\r\n @Input(\"fileNameLabel\") fileNameLabel: string = \"Nome file\";\r\n @Input(\"previewLabel\") previewLabel: string = \"Anteprima\";\r\n @Input(\"uploadFileLabel\") uploadFileLabel: string = \"Carica file\";\r\n @Input(\"confirmLabel\") confirmLabel: string = \"Conferma\";\r\n @Input(\"abortLabel\") abortLabel: string = \"Annulla\";\r\n @Input(\"saveLabel\") saveLabel: string = \"Salva\";\r\n @Input(\"exitLabel\") exitLabel: string = \"Esci\";\r\n @Input(\"eqpTableSearchText\") eqpTableSearchText: string = \"Cerca\";\r\n @Input(\"deleteDialogTitle\") deleteDialogTitle: string = null;\r\n @Input(\"deleteDialogMessage\") deleteDialogMessage: string = \"Sei sicuro di voler cancellare quest'allegato?\";\r\n @Input(\"noImageSelectedErrorMessage\") noImageSelectedErrorMessage: string = \"Non è possibile selezionare un file che non sia un'immagine.\";\r\n @Input(\"wrongTypeSelectedErrorMessage\") wrongTypeSelectedErrorMessage: string = \"Non è possibile caricare il file selezionato.\";\r\n @Input(\"videoPreviewErrorMessage\") videoPreviewErrorMessage: string = \"Impossibile aprire l'anteprima di un file video.\";\r\n @Input(\"videoPreviewErrorMessage\") audioPreviewErrorMessage: string = \"Impossibile aprire l'anteprima di un file audio.\";\r\n //#endregion\r\n\r\n //#region @Output del componente\r\n\r\n /**\r\n * Restituisce la lista aggiornata degli allegati.\r\n */\r\n @Output() localEditedAttachments: EventEmitter<Array<IAttachmentDTO>> = new EventEmitter<Array<IAttachmentDTO>>();\r\n\r\n /**\r\n * Evento di output che restituisce l'IAttachmentDTO selezionato per il download nel caso FileDataBase64, FileContentType o FileName non fossero specificati.\r\n */\r\n @Output(\"downloadAttachment\") downloadAttachment: EventEmitter<IAttachmentDTO> = new EventEmitter<IAttachmentDTO>();\r\n\r\n /**\r\n * Evento di output che restituisce l'elemento eliminato prima che questo venga effettivamente rismosso dalla lista.\r\n */\r\n @Output(\"onDeleteAttachment\") onDeleteAttachment: EventEmitter<IAttachmentDTO> = new EventEmitter<IAttachmentDTO>();\r\n\r\n //#endregion\r\n\r\n //#region Proprietà per gestione caricamento nuovo allegato\r\n newAttachment: IAttachmentDTO = {} as IAttachmentDTO;\r\n dialofRefAddAttachment: MatDialogRef<TemplateRef<any>>;\r\n attachmentType = AttachmentType;\r\n newAttachmentForm: FormGroup;\r\n selectedFile: File = null;\r\n showCropImage: boolean = false;\r\n @ViewChild('dialogAddAttachment', { static: true }) dialogAddAttachment: TemplateRef<any>;\r\n //#endregion\r\n\r\n //#region Proprietà per gestione ridimensionamento file di tipo image\r\n imageChangedEvent: any = '';\r\n croppedImage: any = '';\r\n transform: ImageTransform = {};\r\n @ViewChild(ImageCropperComponent) imageCropper: ImageCropperComponent;\r\n @ViewChild('imageInput') imageInput: any;\r\n //#endregion\r\n\r\n AttachmentType = AttachmentType;\r\n selectedAttachment: IAttachmentDTO;\r\n\r\n originalWidth: number;\r\n originalHeight: number;\r\n customWidth: number;\r\n customHeight: number;\r\n\r\n @ViewChild('attachmentTable', { static: false }) attachmentTable: EqpTableComponent;\r\n @ViewChild('inlinePreviewTemplate', { static: true }) inlinePreviewTemplate: TemplateRef<any>;\r\n @ViewChild('dialogPreview', { static: true }) dialogPreview: TemplateRef<any>;\r\n\r\n constructor(\r\n private dialog: MatDialog,\r\n private formBuilder: FormBuilder,\r\n private sanitizer: DomSanitizer,\r\n private http: HttpClient\r\n ) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n //Se è stata richiesta la gestione delle sole immagini allora imposta il filtro per le estensioni possibili da caricare\r\n if (!this.acceptedFileTypes)\r\n if (this.allowOnlyImages == true)\r\n this.acceptedFileTypes = \"image/*\";\r\n else\r\n this.acceptedFileTypes = \"*\";\r\n\r\n //Se è stata richiesta la gestione multipla degli allegati allora configura l'eqp-table\r\n if (this.multipleAttachment == true && (!this.attachmentsColumns || this.attachmentsColumns.length == 0)) {\r\n this.configureColumns();\r\n }\r\n\r\n if (this.attachmentsList == null)\r\n this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.checkAttachmentImage();\r\n\r\n // if (!this.compressionOptions || !this.compressionOptions.maxSizeMB || !this.compressionOptions.maxWidthOrHeight)\r\n // this.compressionOptions = { maxSizeMB: 0.5, maxWidthOrHeight: 1920, useWebWorker: true };\r\n }\r\n\r\n public reloadData() {\r\n if (this.attachmentTable)\r\n this.attachmentTable.reloadDatatable();\r\n }\r\n\r\n checkAttachmentImage() {\r\n this.attachmentsList.forEach(a => {\r\n a.IsImage = AttachmentHelperService.checkImageFromMimeType(a.FileContentType);\r\n });\r\n }\r\n\r\n //#region Gestione elenco allegati\r\n\r\n /**\r\n * Configura le colonne per l'eqp-table nel caso in cui il parametro \"multipleAttachments\" è TRUE.\r\n */\r\n configureColumns() {\r\n this.attachmentsColumns = [];\r\n if (this.disableAction != true) {\r\n this.attachmentsColumns.push({\r\n key: \"action\", display: \"\",\r\n type: TypeColumn.MenuAction, buttonMenuIcon: \"more_vert\", styles: { flex: \"0 0 6%\" },\r\n actions: [\r\n { name: this.deleteLabel, icon: \"delete\", fn: (element, index, col) => this.deleteAttachment(element) },\r\n ],\r\n })\r\n }\r\n\r\n let downloadColumn = {\r\n key: \"attachment\", display: \"\",\r\n type: TypeColumn.SimpleAction, styles: { flex: \"0 0 6%\" },\r\n actions: [\r\n {\r\n name: '', fontawesome: true,\r\n icon: (element) => { return this.showInlinePreview ? (element.AttachmentType == AttachmentType.FILE ? \"fas fa-cloud-download-alt\" : \"fas fa-external-link-alt\") : this.getAttachmentIcon(element); },\r\n fn: (element, col, elementIndex) => this.viewAttachment(element),\r\n tooltip: { tooltipText: (element) => { return element.AttachmentType == AttachmentType.FILE ? this.downloadLabel : this.openLinkLabel; }, tooltipPosition: this.downloadTooltipPosition }\r\n },\r\n ]\r\n };\r\n\r\n let inlinePreviewColumn = {\r\n key: \"InlinePreview\", display: this.previewLabel,\r\n type: TypeColumn.ExternalTemplate,\r\n externalTemplate: this.inlinePreviewTemplate,\r\n styles: { flex: \"0 0 10%\" }\r\n };\r\n\r\n let fileNameColumn = { key: \"FileName\", display: this.fileNameLabel };\r\n\r\n if (this.showInlinePreview) {\r\n this.attachmentsColumns.push(inlinePreviewColumn);\r\n this.attachmentsColumns.push(fileNameColumn);\r\n this.attachmentsColumns.push(downloadColumn);\r\n } else {\r\n this.attachmentsColumns.push(downloadColumn);\r\n this.attachmentsColumns.push(fileNameColumn);\r\n }\r\n }\r\n\r\n /**\r\n * Elimina un allegato eliminando anche il file presente nello storage di archiviazione utilizzato (AWS o cartella progetto)\r\n * @param element IAttachmentDTO da cancellare\r\n */\r\n deleteAttachment(element: IAttachmentDTO) {\r\n EqpAttachmentDialogService.Confirm(this.deleteDialogMessage, () => {\r\n this.removeAttachmentFromList(this.attachmentsList.indexOf(element));\r\n }, true, this.deleteDialogTitle);\r\n }\r\n\r\n /**\r\n * Rimuove l'allegato selezionato dalla lista \"attachmentsList\" e invoca l'evento di output che restituisce la lista aggiornata.\r\n * @param attachmentIndex Indice dell'attachment da rimuovere\r\n */\r\n removeAttachmentFromList(attachmentIndex: number) {\r\n this.onDeleteAttachment.emit(this.attachmentsList[attachmentIndex]);\r\n\r\n this.attachmentsList.splice(attachmentIndex, 1);\r\n if (this.attachmentTable)\r\n this.attachmentTable.reloadDatatable();\r\n this.localEditedAttachments.emit(this.attachmentsList);\r\n }\r\n\r\n\r\n /**\r\n * Scarica l'allegato o apre il link\r\n * @param element Allegato da mostrare\r\n */\r\n viewAttachment(attachment: IAttachmentDTO) {\r\n\r\n if (attachment.AttachmentType == AttachmentType.LINK) {\r\n window.open(attachment.FilePath, '_blank');\r\n return;\r\n }\r\n\r\n if (attachment.FileDataBase64 && attachment.FileContentType && attachment.FileName) {\r\n let source = `data:${attachment.FileContentType};base64,${attachment.FileDataBase64}`;\r\n const link = document.createElement(\"a\");\r\n link.href = source;\r\n link.download = `${attachment.FileName}`\r\n link.click();\r\n } else {\r\n this.downloadAttachment.emit(attachment);\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Ridefinisce l'icona da mostrare nella colonna dell'eqp-table per ogni file.\r\n * L'icona varia in base all'estensione del file\r\n * @param attachment \r\n */\r\n getAttachmentIcon(attachment: IAttachmentDTO) {\r\n if (attachment.AttachmentType == AttachmentType.LINK)\r\n return \"fas fa-link\";\r\n else\r\n return AttachmentHelperService.getIconFromFileExtensione(attachment.FileExtension);\r\n }\r\n\r\n //#endregion\r\n\r\n /**\r\n * Apre la modale per la definizione dei parametri del nuovo file\r\n */\r\n openModalAddAttachment(attachmentType: AttachmentType) {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n this.newAttachment.IsImage = false;\r\n this.newAttachment.AttachmentType = attachmentType;\r\n\r\n //Crea la form per la validazione dei campi\r\n this.newAttachmentForm = this.formBuilder.group({\r\n type: [this.newAttachment.AttachmentType, Validators.required],\r\n name: [this.newAttachment.FileName],\r\n path: [this.newAttachment.FilePath],\r\n customHeight: [this.customHeight],\r\n customWidth: [this.customWidth]\r\n });\r\n\r\n //Apre la modale\r\n this.dialofRefAddAttachment = this.dialog.open(this.dialogAddAttachment, {\r\n disableClose: true,\r\n hasBackdrop: true,\r\n width: '60%',\r\n maxHeight: '80%'\r\n });\r\n }\r\n\r\n close() {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n this.abortFile();\r\n this.newAttachmentForm.reset();\r\n this.dialofRefAddAttachment.close();\r\n }\r\n\r\n /**\r\n * In base al tipo di allegato controlla se disabilitare o meno il pulsante per salvare.\r\n * Funzione usata nel [disable] del pulsante \"Salva\" del dialog per l'aggiunta di un allegato.\r\n * @returns \r\n */\r\n disableSave() {\r\n if (this.newAttachment.AttachmentType == AttachmentType.FILE) {\r\n return !this.newAttachment.FileDataBase64;\r\n } else {\r\n return !this.newAttachment.FilePath;\r\n }\r\n }\r\n\r\n confirmAddAttachment() {\r\n if (this.newAttachment.AttachmentType == AttachmentType.LINK && !this.newAttachment.FileName)\r\n this.newAttachment.FileName = this.newAttachment.FilePath;\r\n\r\n if (this.attachmentsList == null)\r\n this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.attachmentsList.push(this.newAttachment);\r\n if (this.attachmentTable)\r\n this.attachmentTable.reloadDatatable();\r\n this.localEditedAttachments.emit(this.attachmentsList);\r\n this.dialofRefAddAttachment.close();\r\n }\r\n\r\n /**\r\n * Apre il dialog per l'anteprima dell'allegato selezionato.\r\n * @param row \r\n * @returns \r\n */\r\n async openPreviewDialog(row: IAttachmentDTO) {\r\n this.selectedAttachment = JSON.parse(JSON.stringify(row));\r\n\r\n if (this.selectedAttachment.AttachmentType == AttachmentType.FILE) {\r\n if (this.selectedAttachment.FileContentType.startsWith(\"video\")) {\r\n EqpAttachmentDialogService.Warning(this.videoPreviewErrorMessage);\r\n return;\r\n } else if (this.selectedAttachment.FileContentType.startsWith(\"audio\")) {\r\n EqpAttachmentDialogService.Warning(this.audioPreviewErrorMessage);\r\n return;\r\n }\r\n }\r\n\r\n if (this.getAttachmentEndpoint && this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64) {\r\n await this.getAttachmentByID()\r\n .then((res) => { this.selectedAttachment.FileDataBase64 = res.FileDataBase64; })\r\n .catch((err) => { EqpAttachmentDialogService.Error(err); });\r\n }\r\n\r\n if (this.selectedAttachment.AttachmentType == AttachmentType.LINK) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.selectedAttachment.FilePath);\r\n } else if (this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64 && !this.selectedAttachment.FileThumbnailBase64) {\r\n EqpAttachmentDialogService.Info(\"Impossibile aprire l'anteprima dell'allegato, file mancante.\")\r\n return;\r\n } else if (!this.selectedAttachment.IsImage) {\r\n if (this.selectedAttachment.FilePath && this.productionBaseUrl) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(\r\n \"https://docs.google.com/gview?url=\" +\r\n this.productionBaseUrl +\r\n \"/\" +\r\n this.selectedAttachment.FilePath +\r\n \"&embedded=true\"\r\n );\r\n } else {\r\n EqpAttachmentDialogService.Info(\"Impossibile aprire l'anteprima del documento!\");\r\n return;\r\n }\r\n }\r\n\r\n this.dialog.open(this.dialogPreview, {\r\n disableClose: true,\r\n hasBackdrop: true,\r\n });\r\n }\r\n\r\n async getAttachmentByID() {\r\n return this.http.post<IAttachmentDTO>(this.getAttachmentEndpoint, this.selectedAttachment).toPromise();\r\n }\r\n\r\n //#region Gestione caricamento file\r\n\r\n /** \r\n * Se il file caricato è un immagine allora mostra le funzionalità del croppie per ritagliare l'immagine altrimenti\r\n * converte il file in base64 e lo associa all'allegato da salvare\r\n */\r\n async onFileInputChange(event) {\r\n this.showCropImage = false;\r\n this.selectedFile = event.target.files[0];\r\n if (!this.selectedFile)\r\n return;\r\n\r\n //Memorizza i dati per l'allegato \r\n this.newAttachment.FileContentType = this.selectedFile.type;\r\n this.newAttachment.FileName = this.selectedFile.name;\r\n this.newAttachment.FileExtension = this.selectedFile.name.substr(this.selectedFile.name.lastIndexOf('.') + 1);\r\n this.newAttachment.IsImage = AttachmentHelperService.checkImageFromMimeType(this.selectedFile.type);\r\n\r\n //Se è stata richiesta la gestione delle sole immagini ma per errore è stato selezionato un file che non è un immagine\r\n if (this.allowOnlyImages == true && this.newAttachment.IsImage != true) {\r\n EqpAttachmentDialogService.Error(this.noImageSelectedErrorMessage);\r\n this.abortFile();\r\n return;\r\n } else if (!this.checkAcceptedFiles()) {\r\n EqpAttachmentDialogService.Error(this.wrongTypeSelectedErrorMessage);\r\n this.abortFile();\r\n return;\r\n }\r\n\r\n\r\n\r\n //Verifica se il file caricato è un'immagine oppure no. Se è un immagine, prima di caricarla mostra il croppie per il resize.\r\n //Se non è un immagine allora genera il Base64 \r\n if (this.newAttachment.IsImage == true) {\r\n this.getImageDimensions(event.target.files[0])\r\n\r\n //Mostra il croppie e disabilita la form finchè non termina la modifica dell'immagine\r\n this.newAttachmentForm.disable();\r\n this.newAttachmentForm.controls[\"customWidth\"].enable();\r\n this.newAttachmentForm.controls[\"customHeight\"].enable();\r\n this.showCropImage = true;\r\n this.imageChangedEvent = event;\r\n }\r\n else {\r\n this.showCropImage = false;\r\n let base64File = await toBase64(this.selectedFile);\r\n if (base64File) {\r\n // Loris 20/01/2022: PROBLEMA - Quando eseguo l'upload di un file .sql non viene salvato/scaricato correttamente.\r\n // Questo succede perchè non viene popolato il FileContentType. Per risolvere il problema\r\n // faccio un controllo e se non esiste il FileContentType allora lo recupero dal base64 ottenuto.\r\n this.newAttachment.FileContentType = !this.newAttachment.FileContentType ? base64File.split(\",\")[0].split(\":\")[1].split(\";\")[0] : this.newAttachment.FileContentType;\r\n // Un altro metodo per leggere il ccontent type del file è tramite una regular expression:\r\n // this.newAttachment.FileContentType = !this.newAttachment.FileContentType ? base64File.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)[0] : this.newAttachment.FileContentType;\r\n \r\n this.newAttachment.FileDataBase64 = base64File.split(\",\")[1];\r\n }\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Controlla se il file che si sta caricando è supportato dal sistema.\r\n * @returns \r\n */\r\n checkAcceptedFiles(): boolean {\r\n if (this.selectedFile.type.startsWith(\"video\"))\r\n return false;\r\n\r\n if (this.acceptedFileTypes == \"*\")\r\n return true;\r\n let accepted: boolean = this.acceptedFileTypes.includes(this.selectedFile.type);\r\n if (!accepted) {\r\n for (let t of this.acceptedFileTypes.split(\",\").filter(t => t.includes(\"*\"))) {\r\n accepted = this.selectedFile.type.startsWith(t.split(\"*\")[0]);\r\n if (accepted)\r\n break;\r\n }\r\n }\r\n return accepted;\r\n }\r\n\r\n getImageDimensions(img: any) {\r\n const reader = new FileReader();\r\n reader.onload = (e: any) => {\r\n const image = new Image();\r\n image.src = e.target.result;\r\n image.onload = rs => {\r\n this.originalHeight = rs.currentTarget['height'];\r\n this.originalWidth = rs.currentTarget['width'];\r\n\r\n if (this.originalWidth > 1280) {\r\n this.customWidth = 1280;\r\n this.customHeight = Math.round((1280 * this.originalHeight) / this.originalWidth);\r\n } else {\r\n this.customHeight = rs.currentTarget['height'];\r\n this.customWidth = rs.currentTarget['width'];\r\n }\r\n };\r\n };\r\n reader.readAsDataURL(img);\r\n }\r\n\r\n restoreOriginalDimensions() {\r\n this.customWidth = this.originalWidth;\r\n this.customHeight = this.originalHeight;\r\n }\r\n\r\n onDimensionsChange(dimension: string) {\r\n if (dimension == \"H\") {\r\n this.customWidth = Math.round((this.customHeight * this.originalWidth) / this.originalHeight);\r\n } else if (dimension == \"W\") {\r\n this.customHeight = Math.round((this.customWidth * this.originalHeight) / this.originalWidth);\r\n }\r\n }\r\n\r\n imageCropped(event: ImageCroppedEvent) {\r\n this.croppedImage = event.base64;\r\n this.getCroppedAndUpload(this.croppedImage);\r\n }\r\n\r\n getCroppedAndUpload(file) {\r\n var self = this;\r\n\r\n var file: any = base64ToFile(file);\r\n\r\n const options = this.compressionOptions;\r\n\r\n /**\r\n * Comprime l'immagine passando come parametri le options create nell'oggetto sopra, e il file dal reader principale\r\n */\r\n imageCompression(file, options).then((fileCompressed => {\r\n\r\n let fileReader = new FileReader();\r\n\r\n //Faccio la push di ogni file all'interno dell'array di file dell'item da mandare al server\r\n fileReader.onload = function () {\r\n let resultReader = <string>fileReader.result;\r\n var marker = ';base64,';\r\n self.newAttachment.FileDataBase64 = resultReader.substring(resultReader.indexOf(marker) + marker.length);\r\n self.showCropImage = false;\r\n self.newAttachmentForm.enable();\r\n };\r\n\r\n fileReader.readAsDataURL(fileCompressed);\r\n\r\n }));\r\n\r\n }\r\n\r\n confirmCrop() {\r\n this.imageCropper.crop();\r\n }\r\n\r\n /**\r\n * Annulla la selezione del file, svuotando l'input e resettando tutte le proprietà dell'IAttachmentDTO\r\n */\r\n abortFile() {\r\n this.imageChangedEvent = '';\r\n if (this.imageInput)\r\n this.imageInput.nativeElement.value = '';\r\n\r\n this.selectedFile = null;\r\n this.showCropImage = false;\r\n\r\n this.newAttachment.IsImage = false;\r\n this.newAttachment.FileDataBase64 = null;\r\n this.newAttachment.FileName = null;\r\n this.newAttachment.FileExtension = null;\r\n this.newAttachment.FileContentType = null;\r\n\r\n this.customHeight = null;\r\n this.customWidth = null;\r\n this.originalHeight = null;\r\n this.originalWidth = null;\r\n }\r\n\r\n //#endregion\r\n}","import { NgModule } from '@angular/core';\r\n\r\n//Angular Material Components\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatRadioModule } from '@angular/material/radio';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { MatSliderModule } from '@angular/material/slider';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\nimport { MatMenuModule } from '@angular/material/menu';\r\nimport { MatSidenavModule } from '@angular/material/sidenav';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatGridListModule } from '@angular/material/grid-list';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatStepperModule } from '@angular/material/stepper';\r\nimport { MatTabsModule } from '@angular/material/tabs';\r\nimport { MatExpansionModule } from '@angular/material/expansion';\r\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\r\nimport { MatTableModule } from '@angular/material/table';\r\nimport { MatSortModule } from '@angular/material/sort';\r\nimport { MatPaginatorModule } from '@angular/material/paginator';\r\nimport { MatNativeDateModule } from '@angular/material/core';\r\n\r\n\r\n@NgModule({\r\n imports: [\r\n MatCheckboxModule,\r\n MatButtonModule,\r\n MatInputModule,\r\n MatAutocompleteModule,\r\n MatDatepickerModule,\r\n MatFormFieldModule,\r\n MatRadioModule,\r\n MatSelectModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatMenuModule,\r\n MatSidenavModule,\r\n MatToolbarModule,\r\n MatListModule,\r\n MatGridListModule,\r\n MatCardModule,\r\n MatStepperModule,\r\n MatTabsModule,\r\n MatExpansionModule,\r\n MatButtonToggleModule,\r\n MatChipsModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatProgressBarModule,\r\n MatDialogModule,\r\n MatTooltipModule,\r\n MatSnackBarModule,\r\n MatTableModule,\r\n MatSortModule,\r\n MatPaginatorModule,\r\n MatDatepickerModule,\r\n MatNativeDateModule\r\n ],\r\n exports: [\r\n MatCheckboxModule,\r\n MatButtonModule,\r\n MatInputModule,\r\n MatAutocompleteModule,\r\n MatDatepickerModule,\r\n MatFormFieldModule,\r\n MatRadioModule,\r\n MatSelectModule,\r\n MatSliderModule,\r\n MatSlideToggleModule,\r\n MatMenuModule,\r\n MatSidenavModule,\r\n MatToolbarModule,\r\n MatListModule,\r\n MatGridListModule,\r\n MatCardModule,\r\n MatStepperModule,\r\n MatTabsModule,\r\n MatExpansionModule,\r\n MatButtonToggleModule,\r\n MatChipsModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatProgressBarModule,\r\n MatDialogModule,\r\n MatTooltipModule,\r\n MatSnackBarModule,\r\n MatTableModule,\r\n MatSortModule,\r\n MatPaginatorModule],\r\n})\r\nexport class MaterialModule { }","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { EqpAttachmentsComponent } from './eqp-attachments.component';\r\nimport { MaterialModule } from './modules/material.module';\r\nimport { ImageCropperModule } from 'ngx-image-cropper';\r\nimport { EqpTableModule } from '@eqproject/eqp-table';\r\n\r\n\r\n@NgModule({\r\n declarations: [EqpAttachmentsComponent],\r\n imports: [\r\n MaterialModule,\r\n FormsModule,\r\n CommonModule,\r\n ReactiveFormsModule,\r\n ImageCropperModule,\r\n EqpTableModule\r\n ],\r\n exports: [EqpAttachmentsComponent]\r\n})\r\nexport class EqpAttachmentsModule { }\r\n","/*\r\n * Public API Surface of eqp-attachments\r\n */\r\n\r\nexport * from './lib/eqp-attachments.component';\r\nexport * from './lib/eqp-attachments.module';\r\nexport * from './lib/interfaces/IAttachment';\r\nexport * from './lib/interfaces/IOptions';\r\nexport * from './lib/helpers/attachment.helper';\r\nexport * from './lib/services/eqp-attachment-dialog.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {MaterialModule as ɵa} from './lib/modules/material.module';"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAaY;AAAZ,WAAY,cAAc;IACtB,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACZ,CAAC,EAHW,cAAc,KAAd,cAAc;;;IC8BtB;KAAiB;;;;;IAMV,8CAAsB,GAA7B,UAA8B,QAAgB;QAC1C,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,IAAI,QAAQ,GAAA,CAAC,IAAI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c;gBACd,aAAa;gBACb,kBAAkB;gBAClB,mBAAmB;gBACnB,mBAAmB;aACpB;YACD,OAAO,EAAE;gBACP,iBAAiB;gBACjB,eAAe;gBACf,cAAc;gBACd,qBAAqB;gBACrB,mBAAmB;gBACnB,kBAAkB;gBAClB,cAAc;gBACd,eAAe;gBACf,eAAe;gBACf,oBAAoB;gBACpB,aAAa;gBACb,gBAAgB;gBAChB,gBAAgB;gBAChB,aAAa;gBACb,iBAAiB;gBACjB,aAAa;gBACb,gBAAgB;gBAChB,aAAa;gBACb,kBAAkB;gBAClB,qBAAqB;gBACrB,cAAc;gBACd,aAAa;gBACb,wBAAwB;gBACxB,oBAAoB;gBACpB,eAAe;gBACf,gBAAgB;gBAChB,iBAAiB;gBACjB,cAAc;gBACd,aAAa;gBACb,kBAAkB;aAAC;SACtB,CAAC;OACW,cAAc,CAAI;IAAD,qBAAC;CAA/B;;;IClFA;KAAqC;IAAxB,oBAAoB;QAZhC,QAAQ,CAAC;YACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;YACvC,OAAO,EAAE;gBACP,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,mBAAmB;gBACnB,kBAAkB;gBAClB,cAAc;aACf;YACD,OAAO,EAAE,CAAC,uBAAuB,CAAC;SACnC,CAAC;OACW,oBAAoB,CAAI;IAAD,2BAAC;CAArC;;ACrBA;;;;ACAA;;;;;;"}
|
|
@@ -170,6 +170,12 @@ export declare class EqpAttachmentsComponent implements OnInit {
|
|
|
170
170
|
*/
|
|
171
171
|
openModalAddAttachment(attachmentType: AttachmentType): void;
|
|
172
172
|
close(): void;
|
|
173
|
+
/**
|
|
174
|
+
* In base al tipo di allegato controlla se disabilitare o meno il pulsante per salvare.
|
|
175
|
+
* Funzione usata nel [disable] del pulsante "Salva" del dialog per l'aggiunta di un allegato.
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
disableSave(): boolean;
|
|
173
179
|
confirmAddAttachment(): void;
|
|
174
180
|
/**
|
|
175
181
|
* Apre il dialog per l'anteprima dell'allegato selezionato.
|