@eqproject/eqp-attachments 3.1.0 → 3.1.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eqproject-eqp-attachments.mjs","sources":["../../../projects/eqp-attachments/src/lib/helpers/attachment.helper.ts","../../../projects/eqp-attachments/src/lib/interfaces/IAttachment.ts","../../../projects/eqp-attachments/src/lib/services/eqp-attachment-dialog.service.ts","../../../projects/eqp-attachments/src/lib/services/eqp-attachment.service.ts","../../../projects/eqp-attachments/src/lib/eqp-attachments.component.ts","../../../projects/eqp-attachments/src/lib/eqp-attachments.component.html","../../../projects/eqp-attachments/src/lib/modules/material.module.ts","../../../projects/eqp-attachments/src/lib/eqp-attachments.module.ts","../../../projects/eqp-attachments/src/public-api.ts","../../../projects/eqp-attachments/src/eqproject-eqp-attachments.ts"],"sourcesContent":["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 static readonly dropboxCredentials: any = { \r\n url: 'https://www.dropbox.com/static/api/2/dropins.js', \r\n apiKey: \"aj2xjzms4dl1sch\",\r\n accessToken: \"l.BbasuuUFe42u-fXvpmDEteNkGMH-yPTxD79JhRjkBcR94Fm2QLgIjEETvx8TY36HsQQsIe24ofcNjYlg9IhSB7Fguqbi7wH-Jg6bW_3Q8VemsH4pC7Iakat643EzRcw7OMObPSs\"\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","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 isUploading?: boolean;\r\n}\r\n\r\nexport enum AttachmentType {\r\n FILE = 1,\r\n LINK = 2,\r\n DROPBOX = 3\r\n}\r\n\r\nexport enum CropOptionEnum {\r\n ROTATE = 1,\r\n FLIP = 2\r\n}\r\n\r\nexport type AttachmentCardSize = 'small' | 'medium' | 'large' | 'custom';\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 { Injectable } from \"@angular/core\";\r\nimport { AttachmentHelperService } from \"../helpers/attachment.helper\";\r\n\r\n@Injectable({\r\n providedIn: \"root\"\r\n})\r\nexport class EqpAttachmentService {\r\n constructor() {}\r\n\r\n loadDropboxScript() {\r\n const script = document.createElement(\"script\");\r\n script.type = \"text/javascript\";\r\n script.src = AttachmentHelperService.dropboxCredentials.url;\r\n script.id = \"dropboxjs\";\r\n script.dataset.appKey = AttachmentHelperService.dropboxCredentials.apiKey;\r\n document.body.appendChild(script);\r\n }\r\n}\r\n","import { HttpClient } from \"@angular/common/http\";\r\nimport {\r\n ChangeDetectorRef,\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n TemplateRef,\r\n ViewChild\r\n} from \"@angular/core\";\r\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\r\nimport { MatDialog, MatDialogRef } from \"@angular/material/dialog\";\r\nimport { DomSanitizer } from \"@angular/platform-browser\";\r\nimport imageCompression from \"browser-image-compression\";\r\nimport { base64ToFile, ImageCroppedEvent, ImageCropperComponent, ImageTransform } from \"ngx-image-cropper\";\r\nimport { AttachmentHelperService } from \"./helpers/attachment.helper\";\r\nimport { AttachmentCardSize, AttachmentType, CropOptionEnum, IAttachmentDTO } from \"./interfaces/IAttachment\";\r\nimport { IOptions } from \"./interfaces/IOptions\";\r\nimport { EqpAttachmentDialogService } from \"./services/eqp-attachment-dialog.service\";\r\nimport { EqpAttachmentService } from \"./services/eqp-attachment.service\";\r\n\r\ndeclare var Dropbox: any;\r\n\r\nconst toBase64 = (file) =>\r\n 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 //#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 * Nel caso si vuole gestire un solo elemento senza passarlo come array, lo passo come singolo allegato e gestisco nella libreria l'array.\r\n */\r\n @Input(\"singleAttachment\") singleAttachment: 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 * Se assume il valore TRUE allora sarà possibile caricare più file per volta. Questa funzionalità è attiva\r\n * SOLO se si gestiscono allegati multipli, quindi se l'input 'multipleAttachment' assume il valore TRUE, altrimenti è sempre disabilitata.\r\n */\r\n @Input(\"loadMultipleFiles\") loadMultipleFiles: boolean = false;\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 = {\r\n maxSizeMB: 0.5,\r\n maxWidthOrHeight: 1920,\r\n useWebWorker: true\r\n };\r\n\r\n /**\r\n * Array di AttachmentType che si possono aggiungere\r\n */\r\n @Input(\"allowedTypes\") allowedTypes: Array<AttachmentType> = [AttachmentType.FILE, AttachmentType.LINK];\r\n\r\n /**\r\n * Permette di stabilire se la eqp-table contenente l'elenco degli allegati utilizza\r\n * il multilingua oppure no\r\n */\r\n @Input(\"isEqpTableMultiLanguage\") isEqpTableMultiLanguage: boolean = false;\r\n\r\n /**\r\n * Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco\r\n * degli allegati deve essere paginata oppure no\r\n */\r\n @Input(\"tablePaginatorVisible\") tablePaginatorVisible: boolean = true;\r\n\r\n /**\r\n * Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco\r\n * degli allegati deve contenere il campo di ricerca oppure no\r\n */\r\n @Input(\"isTableSearcheable\") isTableSearcheable: boolean = true;\r\n\r\n /**\r\n * In caso di gestione allegati multipli, permette di stabilire la dimensione pagina di default\r\n * per la tabella contenente l'elenco degli allegati\r\n */\r\n @Input(\"tablePaginatorSize\") tablePaginatorSize: number = null;\r\n\r\n /**\r\n * Permette di scegliere il modo in cui i file devono essere caricati\r\n */\r\n // @Input(\"uploadType\") uploadType: UploadTypeEnum = UploadTypeEnum.FILE_AND_LINK;\r\n\r\n /**\r\n * Permette di stabilire se i pulsanti per il caricamento dei file sono separati o in un menù a tendina\r\n */\r\n @Input(\"separatedUploadButtons\") separatedUploadButtons: boolean = false;\r\n\r\n /**\r\n * Permette di scegliere se dare la possibilità di vedere o no l'anteprima\r\n */\r\n @Input(\"showPreview\") showPreview: boolean = true;\r\n\r\n /**\r\n * In caso di allegato singolo, permette di scegliere se aggiungere file tramite drag and drop\r\n */\r\n @Input(\"singleAttachmentDragAndDrop\") singleAttachmentDragAndDrop: boolean = false;\r\n\r\n /**\r\n * Array di opzioni che si possono utilizzare per il crop\r\n */\r\n @Input(\"cropOptions\") cropOptions: Array<CropOptionEnum> = [];\r\n\r\n /**\r\n * Classe custom da assegnare al dialog del crop immagini\r\n */\r\n @Input(\"cropDialogClass\") cropDialogClass: string;\r\n\r\n @Input() maxFileSizeMB: number = 100; // Default max size of 100 MB\r\n @Input() cardSize: AttachmentCardSize = 'small'; // Default\r\n @Input() customCardWidthPx: number = 200; // Larghezza custom in px\r\n @Input() customCardHeightPx: number = 180; // Altezza custom in px\r\n\r\n /**\r\n * Input per definire le label da usare nel componente\r\n */\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(\"uploadWithDropboxLabel\") uploadWithDropboxLabel: string = \"Carica con Dropbox\";\r\n @Input(\"cropLabel\") cropLabel: string = \"Scegli le dimensioni dell'immagine\";\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 =\r\n \"Non è possibile selezionare un file che non sia un'immagine.\";\r\n @Input(\"wrongTypeSelectedErrorMessage\") wrongTypeSelectedErrorMessage: string =\r\n \"Non è possibile caricare il file selezionato.\";\r\n @Input(\"videoPreviewErrorMessage\") videoPreviewErrorMessage: string =\r\n \"Impossibile aprire l'anteprima di un file video.\";\r\n @Input(\"videoPreviewErrorMessage\") audioPreviewErrorMessage: string =\r\n \"Impossibile aprire l'anteprima di un file audio.\";\r\n @Input(\"flipHorinzontalLabel\") flipHorinzontalLabel: string = \"Capovolgi orizzontalmente\";\r\n @Input(\"flipVerticalLabel\") flipVerticalLabel: string = \"Capovolgi verticalmente\";\r\n @Input(\"rotateRightLabel\") rotateRightLabel: string = \"Ruota a destra\";\r\n @Input(\"rotateLeftLabel\") rotateLeftLabel: string = \"Ruota a sinistra\";\r\n @Input() uploadTitle = 'Upload file';\r\n @Input() uploadSubtitle = 'Drag & drop files o click';\r\n @Input() dropHereLabel = 'Rilascia i file qui';\r\n @Input() supportedFormatsLabel = 'Formati supportati: JPEG, PNG, PDF (Max 100MB)';\r\n @Input() browseFilesLabel = 'Cerca i file';\r\n @Input() uploadSummaryLabel = 'Lista allegati';\r\n @Input() filesLabel = 'Files';\r\n @Input() totalSizeLabel = 'Dimensione totale';\r\n @Input() emptyStateLabel = 'Non sono presenti file caricati';\r\n @Input() addedSuccessfullyLabel = 'file(s) caricati con successo.';\r\n @Input() removedLabel = 'File rimosso';\r\n // @Input() removeLabel = 'Rimuovi file';\r\n @Input() chooseView = true;\r\n @Input() showSummary = false;\r\n @Input(\"viewMode\") viewMode: 'card' | 'table' = 'table';\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 scatenato alla pressione del pulsante ESCI della modale di caricamento file.\r\n */\r\n @Output() abortAddAttachment: EventEmitter<any> = new EventEmitter<any>();\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 newMultipleAttachments: Array<IAttachmentDTO> = [];\r\n attachmentType = AttachmentType;\r\n // uploadTypeEnum = UploadTypeEnum;\r\n newAttachmentForm: FormGroup;\r\n selectedFile: File = null;\r\n selectedFiles: Array<File> = null;\r\n showCropImage: boolean = false;\r\n @ViewChild(\"dialogAddAttachment\", { static: true }) dialogAddAttachment: TemplateRef<any>;\r\n dialogRefAddAttachment: MatDialogRef<TemplateRef<any>>;\r\n @ViewChild(\"dialogAddMultipleAttachment\", { static: true }) dialogAddMultipleAttachment: TemplateRef<any>;\r\n dialogRefCropImage: MatDialogRef<TemplateRef<any>>;\r\n @ViewChild(\"dialogCropImage\", { static: true }) dialogCropImage: TemplateRef<any>;\r\n\r\n @ViewChild('addingLinkTemplate') addingLinkTemplate: 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 canvasRotation = 0;\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(\"inlinePreviewTemplate\", { static: true }) inlinePreviewTemplate: TemplateRef<any>;\r\n @ViewChild(\"dialogPreview\", { static: true }) dialogPreview: TemplateRef<any>;\r\n\r\n imageFile: File;\r\n\r\n addingLinkMode: boolean = false;\r\n\r\n //#region Sezione nuova refactoring\r\n // Stato drag & drop e toast\r\n dragOver = false;\r\n toast = {\r\n visible: false as boolean,\r\n type: 'success' as 'success' | 'error',\r\n text: '' as string,\r\n timeoutId: 0 as any\r\n };\r\n\r\n progressPercent = 0;\r\n totalSizeBytes = 0;\r\n get totalSizeFormatted(): string { return this.formatFileSize(this.totalSizeBytes); }\r\n\r\n // Utility per formattare bytes (2 decimali)\r\n formatFileSize(bytes: number): string {\r\n if (!bytes || bytes <= 0) return '0 Bytes';\r\n const k = 1024;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;\r\n }\r\n\r\n // Mostra toast con auto‑hide e reset progress bar CSS\r\n showToast(message: string, type: 'success' | 'error' = 'success', durationMs = 3000) {\r\n if (this.toast.visible && this.toast.text === message) {\r\n return;\r\n }\r\n\r\n // Cancella il timeout precedente se esiste\r\n if (this.toast.timeoutId) {\r\n clearTimeout(this.toast.timeoutId);\r\n }\r\n\r\n // Calcola una durata dinamica\r\n const duration = durationMs || Math.max(4000, message.length * 100);\r\n\r\n this.toast.text = message;\r\n this.toast.type = type;\r\n this.toast.visible = true;\r\n\r\n // Imposta il nuovo timeout per nascondere automaticamente il toast\r\n this.toast.timeoutId = setTimeout(() => {\r\n this.toast.visible = false;\r\n }, duration);\r\n }\r\n\r\n #endregion\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 private cd: ChangeDetectorRef,\r\n private eqpAttachmentService: EqpAttachmentService\r\n ) { }\r\n\r\n ngOnInit() {\r\n\r\n // Inizializza metriche e progress in base allo stato iniziale\r\n this.recomputeTotalsAndProgress();\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) this.acceptedFileTypes = \"image/*\";\r\n else this.acceptedFileTypes = \"*\";\r\n\r\n // Se non sono stati specificati i tipi da gestire ma è stato passato null o un array vuoto imposto i tipi di default.\r\n if (!this.allowedTypes || this.allowedTypes.length == 0)\r\n this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK, AttachmentType.DROPBOX];\r\n else if (\r\n this.allowedTypes.find((t) => t != AttachmentType.FILE && t != AttachmentType.LINK && t != AttachmentType.DROPBOX)\r\n ) {\r\n EqpAttachmentDialogService.Warning(\r\n 'Almeno uno degli AttachmentType selezionati nel parametro \"allowedTypes\" non esiste.'\r\n );\r\n this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK, AttachmentType.DROPBOX];\r\n }\r\n\r\n if (this.attachmentsList == null) this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n // Se è stato passato un singolo allegato lo aggiungo alla lista\r\n if (this.singleAttachment != null && this.attachmentsList.length == 0) {\r\n this.attachmentsList.push(this.singleAttachment);\r\n }\r\n\r\n this.checkAttachmentImage();\r\n\r\n if (this.allowedTypes.includes(3)) {\r\n this.eqpAttachmentService.loadDropboxScript();\r\n }\r\n }\r\n\r\n setViewMode(mode: 'card' | 'table'): void {\r\n this.viewMode = mode;\r\n }\r\n\r\n // Ricalcola la somma pesata sugli allegati presenti\r\n private recomputeTotalsAndProgress() {\r\n this.totalSizeBytes = (this.attachmentsList || [])\r\n .filter(a => !!a)\r\n .reduce((sum, a) => sum + this.bytesFromBase64(a.FileDataBase64 || a.FileThumbnailBase64 || ''), 0);\r\n\r\n // Progress fittizio: 100% se presenti file, 0 se vuoto\r\n this.progressPercent = (this.attachmentsList && this.attachmentsList.length > 0) ? 100 : 0;\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this.toast.timeoutId) clearTimeout(this.toast.timeoutId);\r\n }\r\n\r\n // Calcola i byte da una stringa Base64 pura (senza prefisso data:...)\r\n public bytesFromBase64(base64: string): number {\r\n if (!base64) return 0;\r\n // Rimuovi eventuale prefisso data URL\r\n const commaIdx = base64.indexOf(',');\r\n const b64 = commaIdx >= 0 ? base64.substring(commaIdx + 1) : base64;\r\n // Conta padding\r\n let padding = 0;\r\n if (b64.endsWith('==')) padding = 2;\r\n else if (b64.endsWith('=')) padding = 1;\r\n // Formula esatta: (3 * (len / 4)) - padding\r\n const len = b64.length;\r\n return Math.max(0, (3 * Math.floor(len / 4)) - padding);\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 * 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(\r\n this.deleteDialogMessage,\r\n () => {\r\n this.removeAttachmentFromList(this.attachmentsList.indexOf(element));\r\n },\r\n true,\r\n this.deleteDialogTitle\r\n );\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 this.localEditedAttachments.emit(this.attachmentsList);\r\n\r\n this.recomputeTotalsAndProgress();\r\n this.showToast(this.removedLabel || 'File removed', 'success');\r\n\r\n }\r\n\r\n private simulateProgress() {\r\n this.progressPercent = 0;\r\n setTimeout(() => {\r\n this.progressPercent = 30;\r\n setTimeout(() => {\r\n this.progressPercent = 60;\r\n setTimeout(() => {\r\n this.progressPercent = 100;\r\n }, 200);\r\n }, 200);\r\n }, 100);\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 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 * 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) return \"fas fa-link\";\r\n else return AttachmentHelperService.getIconFromFileExtensione(attachment.FileExtension);\r\n }\r\n\r\n //#endregion\r\n\r\n /**\r\n * In caso di allegato singolo, sceglie quale metodo richiamare in base al tipo di allegato\r\n */\r\n addFile(attachmentType: AttachmentType, imageInput = null) {\r\n if (attachmentType == AttachmentType.LINK) {\r\n this.switchToAddingLinkMode();\r\n } else if (attachmentType == AttachmentType.FILE) {\r\n imageInput.click();\r\n } else {\r\n this.chooseDropboxFile();\r\n }\r\n }\r\n\r\n createAttachmentForm() {\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\r\n close(emitCloseEvent = true) {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n this.newMultipleAttachments = new Array<IAttachmentDTO>();\r\n this.abortFile();\r\n if (this.newAttachmentForm) this.newAttachmentForm.reset();\r\n\r\n this.dialogRefCropImage.close();\r\n this.restoreOriginalDimensions();\r\n\r\n if (emitCloseEvent == true && this.abortAddAttachment) this.abortAddAttachment.emit();\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.loadMultipleFiles != true) {\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 } else {\r\n return (\r\n this.newMultipleAttachments.filter(\r\n (p) =>\r\n (p.AttachmentType == AttachmentType.FILE && !p.FileDataBase64) ||\r\n (p.AttachmentType == AttachmentType.LINK && !p.FilePath)\r\n ).length > 0\r\n );\r\n }\r\n }\r\n\r\n confirmAddAttachment() {\r\n if (this.newAttachment.IsImage && this.imageCropper) {\r\n this.newAttachment.FileDataBase64 = this.imageCropper.crop().base64.split(\";base64,\")[1];\r\n }\r\n\r\n if (this.loadMultipleFiles != true) {\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) this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.attachmentsList.push(this.newAttachment);\r\n } else {\r\n if (this.newMultipleAttachments == null || this.newMultipleAttachments.length == 0) return;\r\n\r\n if (this.attachmentsList == null) this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.attachmentsList = this.attachmentsList.concat(this.newMultipleAttachments);\r\n }\r\n\r\n // if (this.attachmentTable) this.attachmentTable.reloadDatatable();\r\n\r\n this.localEditedAttachments.emit(this.attachmentsList);\r\n\r\n if (this.newAttachment.IsImage) {\r\n this.dialogRefCropImage.close();\r\n this.restoreOriginalDimensions();\r\n }\r\n\r\n if (this.newAttachment.AttachmentType === AttachmentType.LINK) {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n if (this.newAttachmentForm) this.newAttachmentForm.reset();\r\n }\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) => {\r\n this.selectedAttachment.FileDataBase64 = res.FileDataBase64;\r\n })\r\n .catch((err) => {\r\n EqpAttachmentDialogService.Error(err);\r\n });\r\n }\r\n\r\n if (this.selectedAttachment.AttachmentType == AttachmentType.LINK) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(\r\n this.selectedAttachment.FilePath\r\n );\r\n } else if (\r\n this.selectedAttachment.IsImage &&\r\n !this.selectedAttachment.FileDataBase64 &&\r\n !this.selectedAttachment.FileThumbnailBase64\r\n ) {\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 * Evento scatenato alla selezione del file (o dei file).\r\n * Se il caricamento è SINGOLO o se comunque è stato selezionato un solo file allora si occupa di controllare se si tratta di un immagine in modo da\r\n * mostrare le funzionalità del croppie (per ritagliare l'immagine) oppure no.\r\n * Se il file caricato non è un immagine allora genera direttamente il base64 e lo associa all'allegato da salvare.\r\n * Se invece il caricamento dei file è MULTIPLO e sono presenti più file allora esegue le stesse operazioni ignorando però il contrllo\r\n * immagine per il croppie (in caso di caricamento multiplo le funzionalità del croppie sono disabilitate).\r\n */\r\n async onFileAdded(event, isFileDropped: boolean = false) {\r\n this.showCropImage = false;\r\n // let filesOnInput = isFileDropped ? event : event.target.files;\r\n const filesOnInput: File[] = isFileDropped\r\n ? (event as File[])\r\n : Array.from((event.target as HTMLInputElement)?.files || []);\r\n\r\n const { validFiles, oversizedFiles } = this.validationFile(filesOnInput, isFileDropped);\r\n\r\n //Se è stato richiesto il caricamento SINGOLO oppure se il caricamento è MULTIPLO ma è stato selezionato un solo file\r\n //allora verifica se il file è un immagine (per mostrare il CROPPIE)\r\n if ([...validFiles].length == 1 || this.loadMultipleFiles != true) {\r\n this.selectedFile = validFiles[0];\r\n this.selectedFiles = validFiles;\r\n if (!this.selectedFile) return;\r\n\r\n //Memorizza i dati per l'allegato\r\n this.newAttachment = await this.createAttachmentFromUploadedFile(this.selectedFile, false);\r\n this.newMultipleAttachments = new Array<IAttachmentDTO>();\r\n this.newMultipleAttachments.push(this.newAttachment);\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 let checkOnlyImage = this.checkAllowOnlyImageFile(this.newAttachment);\r\n if (checkOnlyImage == false) return;\r\n\r\n this.createAttachmentForm();\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(validFiles[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.imageFile = event;\r\n\r\n this.dialogRefCropImage = this.dialog.open(this.dialogCropImage, {\r\n disableClose: true,\r\n hasBackdrop: true,\r\n width: \"60%\",\r\n maxHeight: \"80%\",\r\n maxWidth: \"70vh\"\r\n });\r\n } else {\r\n this.showCropImage = false;\r\n let base64Result = await this.getBase64FromFile(this.selectedFile);\r\n this.newAttachment.FileDataBase64 = base64Result.Base64File;\r\n this.newAttachment.FileContentType = base64Result.ContentType;\r\n this.confirmAddAttachment();\r\n }\r\n } else {\r\n this.selectedFiles = validFiles;\r\n if (!this.selectedFiles || this.selectedFiles.length == 0) return;\r\n\r\n if (!this.newMultipleAttachments) this.newMultipleAttachments = [];\r\n for (let i = 0; i < this.selectedFiles.length; i++) {\r\n let newAttachment: IAttachmentDTO = await this.createAttachmentFromUploadedFile(\r\n this.selectedFiles[i],\r\n true,\r\n true\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 let checkOnlyImage = this.checkAllowOnlyImageFile(newAttachment);\r\n if (checkOnlyImage == false) return;\r\n\r\n this.newMultipleAttachments.push(newAttachment);\r\n }\r\n this.confirmAddAttachment();\r\n }\r\n\r\n this.recomputeTotalsAndProgress();\r\n this.simulateProgress();\r\n // Caso 1: Successo Parziale (alcuni file validi, altri no)\r\n if (oversizedFiles.length > 0 && validFiles.length > 0) {\r\n const fileNames = oversizedFiles.join(', ');\r\n this.showToast(\r\n `${validFiles.length} file aggiunti. ${oversizedFiles.length} non caricati perché troppo grandi (${fileNames}).`,\r\n 'error'\r\n );\r\n }\r\n // Caso 2: Nessun file valido\r\n else if (oversizedFiles.length > 0 && validFiles.length === 0) {\r\n }\r\n // Caso 3: Tutti i file validi\r\n else if (oversizedFiles.length === 0 && validFiles.length > 0) {\r\n this.showToast(\r\n `${validFiles.length} ${this.addedSuccessfullyLabel || 'file(s) aggiunti con successo.'}`,\r\n 'success'\r\n );\r\n }\r\n\r\n //Resetto il valore del file input in modo da scatenare il change anche se si dovesse caricare lo stesso file\r\n if (!isFileDropped) event.target.value = \"\";\r\n }\r\n\r\n private validationFile(filesOnInput: File[], isFileDropped: boolean) {\r\n const validFiles: File[] = [];\r\n const oversizedFiles: string[] = [];\r\n\r\n for (const file of filesOnInput) {\r\n const fileSizeMB = file.size / 1024 / 1024;\r\n if (fileSizeMB > this.maxFileSizeMB) {\r\n oversizedFiles.push(file.name);\r\n } else {\r\n validFiles.push(file);\r\n }\r\n }\r\n\r\n // Show a single error message for all oversized files\r\n if (oversizedFiles.length > 0) {\r\n const fileNames = oversizedFiles.join(', ');\r\n this.showToast(`File(s) troppo grandi: ${fileNames}. Limite: ${this.maxFileSizeMB}MB`, 'error');\r\n }\r\n\r\n // Abort if no files are valid\r\n if (validFiles.length === 0) {\r\n if (!isFileDropped) { (event.target as HTMLInputElement).value = ''; }\r\n return;\r\n }\r\n\r\n return { validFiles, oversizedFiles };\r\n }\r\n\r\n /**\r\n * A partire dal FILE ricevuto in input ricostruisce l'oggetto IAttachmentDTO e lo restituisce.\r\n * Se il parametro getBase64 viene passato a TRUE allora, sempre a partire dal file,genera il base64 e\r\n * ricava il ContentType da associare all'oggetto IAttachmentDTO da restituire\r\n * @param currentFile Oggetto FILE da processare\r\n * @param getBase64 Se TRUE allora calcola base64 e ContentType del file passato in input\r\n * @returns Restituisce un oggetto di tipo IAttachmentDTO\r\n */\r\n private async createAttachmentFromUploadedFile(\r\n currentFile: File,\r\n getBase64: boolean = true,\r\n cropFile: boolean = false\r\n ): Promise<IAttachmentDTO> {\r\n let newAttachment: IAttachmentDTO = {} as IAttachmentDTO;\r\n //Memorizza i dati per l'allegato\r\n newAttachment.AttachmentType = AttachmentType.FILE;\r\n newAttachment.FileContentType = currentFile.type;\r\n newAttachment.FileName = currentFile.name;\r\n newAttachment.FileExtension = currentFile.name.substr(currentFile.name.lastIndexOf(\".\") + 1);\r\n newAttachment.IsImage = AttachmentHelperService.checkImageFromMimeType(currentFile.type);\r\n\r\n if (getBase64 == true) {\r\n let base64Result = await this.getBase64FromFile(currentFile);\r\n newAttachment.FileDataBase64 = base64Result.Base64File;\r\n newAttachment.FileContentType = base64Result.ContentType;\r\n\r\n if (newAttachment.IsImage && newAttachment.FileDataBase64 && cropFile) {\r\n this.getCroppedAndUpload(`data:${base64Result.ContentType};base64,${base64Result.Base64File}`, newAttachment);\r\n }\r\n }\r\n\r\n return newAttachment;\r\n }\r\n\r\n /**\r\n * A partire dal file passato in input restituisce un oggetto\r\n * contenente il base64 del file e il suo contentType\r\n * @param currentFile Oggetto File da cui estrapolare base64 e contentType\r\n * @returns Restituisce un oggetto avente le proprietà Base64File e ContentType\r\n */\r\n private async getBase64FromFile(currentFile: File): Promise<any> {\r\n let base64File = await toBase64(currentFile);\r\n let contentType: string = null;\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 contentType = base64File.split(\",\")[0].split(\":\")[1].split(\";\")[0];\r\n // Un altro metodo per leggere il ccontent type del file è tramite una regular expression:\r\n base64File = base64File.split(\",\")[1];\r\n }\r\n\r\n let result = {\r\n Base64File: base64File,\r\n ContentType: contentType\r\n };\r\n\r\n return result;\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 private checkAcceptedFiles(): boolean {\r\n if (\r\n (this.loadMultipleFiles != true && this.selectedFile.type.startsWith(\"video\")) ||\r\n (this.loadMultipleFiles == true && [...this.selectedFiles].filter((p) => p.type.startsWith(\"video\")).length > 0)\r\n )\r\n return false;\r\n\r\n if (this.acceptedFileTypes == \"*\") return true;\r\n\r\n //Verifica che i tipi del file (o dei file) caricati siano coerenti con quelli accettati dalla direttiva\r\n let accepted: boolean = true;\r\n if (this.loadMultipleFiles != true) accepted = this.acceptedFileTypes.includes(this.selectedFile.type);\r\n else {\r\n let uploadedFileTypes: string[] = [...this.selectedFiles].map((p) => p.type);\r\n uploadedFileTypes.forEach((type) => {\r\n if (!this.acceptedFileTypes.includes(type)) accepted = false;\r\n });\r\n }\r\n\r\n //Questo controllo permette di gestire le casistiche per cui vengono indicati come tipi validi, ad esempio, 'image/*'\r\n if (!accepted && this.loadMultipleFiles != true) {\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) break;\r\n }\r\n }\r\n return accepted;\r\n }\r\n\r\n /**\r\n * Se eqp-attachments è stata configurata per il caricamento delle sole immagini allora verifica che il file passato in\r\n * input sia effettivamente un immagine o no.\r\n * Se il controllo va a buon fine restituisce TRUE altrimenti mostra un messaggio d'errore e restituisce FALSE\r\n */\r\n private checkAllowOnlyImageFile(newAttachment): boolean {\r\n if (this.allowOnlyImages == true && newAttachment.IsImage != true) {\r\n EqpAttachmentDialogService.Error(this.noImageSelectedErrorMessage);\r\n this.abortFile();\r\n return false;\r\n } else if (!this.checkAcceptedFiles()) {\r\n EqpAttachmentDialogService.Error(this.wrongTypeSelectedErrorMessage);\r\n this.abortFile();\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n //#region Gestione crop file\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 this.canvasRotation = 0;\r\n this.transform = {};\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, this.newAttachment);\r\n }\r\n\r\n getCroppedAndUpload(file, newAttachment: IAttachmentDTO) {\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 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 newAttachment.FileDataBase64 = resultReader.substring(resultReader.indexOf(marker) + marker.length);\r\n self.showCropImage = false;\r\n if (self.newAttachmentForm) {\r\n self.newAttachmentForm.enable();\r\n }\r\n };\r\n\r\n fileReader.readAsDataURL(fileCompressed);\r\n });\r\n }\r\n\r\n // confirmCrop() {\r\n // this.imageCropper.crop();\r\n // this.dialogRefCropImage.close();\r\n // this.restoreOriginalDimensions();\r\n // }\r\n\r\n rotateLeft() {\r\n this.canvasRotation--;\r\n this.flipAfterRotate();\r\n }\r\n\r\n rotateRight() {\r\n this.canvasRotation++;\r\n this.flipAfterRotate();\r\n }\r\n\r\n private flipAfterRotate() {\r\n const flippedH = this.transform.flipH;\r\n const flippedV = this.transform.flipV;\r\n this.transform = {\r\n ...this.transform,\r\n flipH: flippedV,\r\n flipV: flippedH\r\n };\r\n }\r\n\r\n flipHorizontal() {\r\n this.transform = {\r\n ...this.transform,\r\n flipH: !this.transform.flipH\r\n };\r\n }\r\n\r\n flipVertical() {\r\n this.transform = {\r\n ...this.transform,\r\n flipV: !this.transform.flipV\r\n };\r\n }\r\n\r\n //#endregion\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 if (this.imageInput) this.imageInput.nativeElement.value = \"\";\r\n\r\n this.selectedFile = null;\r\n this.selectedFiles = 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.newMultipleAttachments = new Array<IAttachmentDTO>();\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 this.dialogRefCropImage.close();\r\n this.restoreOriginalDimensions();\r\n }\r\n\r\n //#endregion\r\n\r\n fileDropped(event: DragEvent): void {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.dragOver = false;\r\n\r\n const files = event.dataTransfer?.files;\r\n\r\n if (files && files.length > 0) {\r\n this.onFileAdded({ target: { files: files } });\r\n }\r\n }\r\n\r\n // Se il caricamento del file dropbox va a buon fine, la funzione di callback restituisce un array di oggetti.\r\n // Viene poi fatta una XMLHttpRequest con responseType 'blob' per convertire il primo elemento della response in un Blob.\r\n chooseDropboxFile() {\r\n var options = {\r\n success: (files: any[]) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", files[0].link);\r\n xhr.setRequestHeader(\"Authorization\", `Bearer ${AttachmentHelperService.dropboxCredentials.accessToken}`);\r\n xhr.responseType = \"blob\";\r\n\r\n xhr.onload = () => {\r\n const blob = xhr.response;\r\n const file = new File([blob], files[0].name, { type: blob.type });\r\n let filesAdded = [file];\r\n this.onFileAdded(filesAdded, true);\r\n };\r\n\r\n xhr.send();\r\n },\r\n linkType: \"direct\",\r\n multiselect: false,\r\n extensions: [\".jpg\", \".png\", \".pdf\", \".doc\", \".docx\", \".txt\"]\r\n };\r\n Dropbox.choose(options);\r\n }\r\n\r\n // Workaround dropzone: disabilito il click degli elementi inclusi nella dropzone per evitare di cliccare due volte\r\n onSelectFile(event, fileInput) {\r\n if (\r\n (event.target as HTMLButtonElement).tagName === \"BUTTON\" ||\r\n (event.target as HTMLButtonElement).tagName === \"INPUT\" ||\r\n this.addingLinkMode == true\r\n ) {\r\n return;\r\n }\r\n fileInput.click();\r\n }\r\n\r\n // Metodo per visualizzare la form di aggiunta di un link\r\n // switchToAddingLinkMode() {\r\n // this.addingLinkMode = true;\r\n // this.newAttachment = {} as IAttachmentDTO;\r\n // this.newAttachment.IsImage = false;\r\n // this.newAttachment.AttachmentType = this.attachmentType.LINK;\r\n // this.newMultipleAttachments = new Array<IAttachmentDTO>();\r\n // this.newMultipleAttachments.push(this.newAttachment);\r\n\r\n // this.createAttachmentForm();\r\n // }\r\n\r\n /**\r\n * Apre il dialogo per l'inserimento del link.\r\n */\r\n switchToAddingLinkMode(): void {\r\n // 1. Crea il form per il dialogo\r\n this.newAttachmentForm = this.formBuilder.group({\r\n fileName: [''],\r\n filePath: ['', [Validators.required, Validators.pattern('https?://.+')]]\r\n });\r\n\r\n // 2. Apri il dialogo\r\n const dialogRef = this.dialog.open(this.addingLinkTemplate, {\r\n width: '500px',\r\n });\r\n\r\n // 3. Gestisci il risultato alla chiusura\r\n dialogRef.afterClosed().subscribe(result => {\r\n if (result) {\r\n // A. Crea l'oggetto per il nuovo link dai dati del form\r\n const newLinkObject: IAttachmentDTO = {\r\n ID: 0,\r\n AttachmentType: AttachmentType.LINK,\r\n FileName: result.fileName,\r\n FilePath: result.filePath,\r\n IsImage: false\r\n };\r\n\r\n // B. Prepara l'oggetto `newAttachment` che `confirmAddAttachment` si aspetta\r\n this.newAttachment = newLinkObject;\r\n this.newMultipleAttachments = [newLinkObject];\r\n\r\n\r\n // C. Chiama la tua funzione di conferma centrale!\r\n this.confirmAddAttachment();\r\n }\r\n });\r\n }\r\n\r\n\r\n\r\n // Metodo per ottenere le classi CSS dinamiche\r\n getCardClass(att: IAttachmentDTO): { [key: string]: boolean } {\r\n return {\r\n 'file-preview': true,\r\n 'uploading': !!att.isUploading,\r\n 'card-small': this.cardSize === 'small',\r\n 'card-medium': this.cardSize === 'medium',\r\n 'card-large': this.cardSize === 'large',\r\n // Nessuna classe specifica per 'custom', useremo style.cssText\r\n };\r\n }\r\n\r\n // Questa funzione ora si applica al contenitore, non alla singola card.\r\n getPreviewsContainerStyle(): { [key: string]: string } {\r\n let minWidth = '200px'; // Dimensione di default per 'medium'\r\n\r\n if (this.cardSize === 'small') {\r\n minWidth = '140px';\r\n } else if (this.cardSize === 'large') {\r\n minWidth = '280px';\r\n } else if (this.cardSize === 'custom') {\r\n minWidth = `${this.customCardWidthPx}px`;\r\n }\r\n\r\n return { '--card-min-width': minWidth };\r\n }\r\n}\r\n","<!-- Se richiesta la gestione singola mostra il pulsante di caricamento di un singolo file -->\r\n<div class=\"header\">\r\n <h1>{{ uploadTitle }}</h1>\r\n @if(chooseView == true){\r\n <mat-button-toggle-group [value]=\"viewMode\" (change)=\"setViewMode($event.value)\"\r\n aria-label=\"Modalità di visualizzazione\">\r\n <mat-button-toggle value=\"card\"><mat-icon>grid_view</mat-icon></mat-button-toggle>\r\n <mat-button-toggle value=\"table\"><mat-icon>view_list</mat-icon></mat-button-toggle>\r\n </mat-button-toggle-group>\r\n }\r\n</div>\r\n\r\n<!-- Gestione singolo -->\r\n@if (multipleAttachment != true) {\r\n@if (!singleAttachmentDragAndDrop) {\r\n@if (!addingLinkMode) {\r\n<div class=\"text-center\">\r\n <ng-container [ngTemplateOutlet]=\"addAttachmentButton\"></ng-container>\r\n</div>\r\n} @else {\r\n<div class=\"text-center\">\r\n <ng-container [ngTemplateOutlet]=\"addingLinkTemplate\"></ng-container>\r\n</div>\r\n}\r\n} @else {\r\n<input #fileInput id=\"file_attachment\" name=\"file_attachment\" type=\"file\" hidden (change)=\"onFileAdded($event)\"\r\n [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n\r\n@if (allowedTypes && allowedTypes.includes(1) && (!attachmentsList || attachmentsList.length == 0 ||\r\n(attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n<div class=\"dropbox\" [class.dragover]=\"dragOver\" (dragover)=\"dragOver = true; $event.preventDefault()\"\r\n (dragleave)=\"dragOver = false\" (drop)=\"dragOver = false; fileDropped($event)\"\r\n (click)=\"onSelectFile($event, fileInput)\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"fileInput.click()\"\r\n (keydown.space)=\"fileInput.click()\">\r\n <div class=\"dropbox-icon\">📁</div>\r\n <div class=\"dropbox-text\">{{ dropHereLabel }}</div>\r\n <div class=\"dropbox-subtext\">\r\n {{ supportedFormatsLabel }}\r\n </div>\r\n <button class=\"browse-btn\" type=\"button\" (click)=\"$event.stopPropagation(); fileInput.click()\">\r\n {{ browseFilesLabel }}\r\n </button>\r\n <div class=\"secondary-action\">\r\n @if (allowedTypes.includes(2) || allowedTypes.includes(3)) {\r\n @if (allowedTypes.includes(2) && allowedTypes.includes(3)) {\r\n <a class=\"secondary-action-link\" [matMenuTriggerFor]=\"linkMenu\" (click)=\"$event.stopPropagation()\">\r\n o aggiungi da web\r\n </a>\r\n <mat-menu #linkMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"switchToAddingLinkMode()\">\r\n <mat-icon>link</mat-icon>\r\n <span>Aggiungi da link</span>\r\n </button>\r\n <button mat-menu-item (click)=\"chooseDropboxFile()\">\r\n <mat-icon>cloud_queue</mat-icon>\r\n <span>Carica da Dropbox</span>\r\n </button>\r\n </mat-menu>\r\n }\r\n\r\n @else if (allowedTypes.includes(2)) {\r\n <a class=\"secondary-action-link\" (click)=\"$event.stopPropagation(); switchToAddingLinkMode()\">\r\n aggiungi un link\r\n </a>\r\n }\r\n\r\n @else if (allowedTypes.includes(3)) {\r\n <a class=\"secondary-action-link\" (click)=\"$event.stopPropagation(); chooseDropboxFile()\">\r\n carica da Dropbox\r\n </a>\r\n }\r\n }\r\n </div>\r\n</div>\r\n}\r\n}\r\n\r\n<!-- Azioni singolo elemento (come prima) -->\r\n<div class=\"text-center\">\r\n @if (attachmentsList && attachmentsList.length > 0 && attachmentsList[0]) {\r\n <button class=\"mb-2 me-2 eqp-attachments-download-btn\" (click)=\"viewAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\">\r\n @if (attachmentsList[0].AttachmentType == AttachmentType.FILE) {\r\n <mat-icon>download</mat-icon>\r\n } @else {\r\n <mat-icon>open_in_new</mat-icon>\r\n }\r\n {{ attachmentsList[0].AttachmentType == AttachmentType.FILE ? downloadLabel : openLinkLabel }}\r\n </button>\r\n\r\n @if (showPreview && (!attachmentsList[0].FileContentType || (!attachmentsList[0].FileContentType.startsWith('video')\r\n && !attachmentsList[0].FileContentType.startsWith('audio'))) && attachmentsList[0].IsImage == true) {\r\n <button class=\"mb-2 me-2 eqp-attachments-preview-btn\" (click)=\"openPreviewDialog(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\">\r\n <mat-icon>visibility</mat-icon> {{ previewLabel }}\r\n </button>\r\n }\r\n\r\n <button [disabled]=\"disableAction\" class=\"mb-2 eqp-attachments-delete-btn\"\r\n (click)=\"deleteAttachment(attachmentsList[0])\" type=\"button\" mat-raised-button [disabled]=\"isDisabled\">\r\n <mat-icon>delete</mat-icon> {{ deleteLabel }}\r\n </button>\r\n }\r\n</div>\r\n}\r\n\r\n<!-- Gestione multipla -->\r\n@if (multipleAttachment == true) {\r\n<input #fileInput id=\"file_attachment_multi\" name=\"file_attachment_multi\" type=\"file\" hidden\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n\r\n<div class=\"dropbox\" [class.dragover]=\"dragOver\" (dragover)=\"dragOver = true; $event.preventDefault()\"\r\n (dragleave)=\"dragOver = false\" (drop)=\"dragOver = false; fileDropped($event)\"\r\n (click)=\"onSelectFile($event, fileInput)\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"fileInput.click()\"\r\n (keydown.space)=\"fileInput.click()\">\r\n <div class=\"dropbox-icon\">📁</div>\r\n <div class=\"dropbox-text\">{{ dropHereLabel }}</div>\r\n <div class=\"dropbox-subtext\">\r\n {{ supportedFormatsLabel }}\r\n </div>\r\n <button class=\"browse-btn\" type=\"button\" (click)=\"$event.stopPropagation(); fileInput.click()\">\r\n {{ browseFilesLabel }}\r\n </button>\r\n <div class=\"secondary-action-link\">\r\n o <a (click)=\"$event.stopPropagation(); switchToAddingLinkMode()\">aggiungi un link</a>\r\n </div>\r\n</div>\r\n}\r\n\r\n@if (attachmentsList?.length > 0 && showSummary) {\r\n<div class=\"upload-stats\">\r\n\r\n <div class=\"stats-info\">\r\n <div class=\"stat-item\">\r\n <div class=\"stat-value\">{{ attachmentsList?.length }}</div>\r\n <div class=\"stat-label\">{{ filesLabel }}</div>\r\n </div>\r\n <div class=\"stat-item\">\r\n <div class=\"stat-value\">{{ totalSizeFormatted }}</div>\r\n <div class=\"stat-label\">{{ totalSizeLabel }}</div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"progress-bar\">\r\n <div class=\"progress-fill\" [style.width.%]=\"progressPercent\"></div>\r\n </div>\r\n\r\n</div>\r\n} @else if(attachmentsList?.length == 0){\r\n<div class=\"empty-state\">{{ emptyStateLabel }}</div>\r\n}\r\n\r\n<!-- Griglia anteprime card (vale per singolo e multiplo) -->\r\n@if (viewMode === 'card') {\r\n\r\n<div class=\"file-previews\" [ngStyle]=\"getPreviewsContainerStyle()\">\r\n @for (att of attachmentsList; track att.ID) {\r\n <div [ngClass]=\"getCardClass(att)\">\r\n\r\n <div class=\"preview-img-container\" (click)=\"!att.isUploading && openPreviewDialog(att)\">\r\n @if (att.IsImage) {\r\n <img class=\"preview-img\" [src]=\"'data:image/png;base64,' + (att.FileThumbnailBase64 || att.FileDataBase64)\"\r\n [alt]=\"att.FileName\" />\r\n } @else {\r\n <div class=\"file-icon\">\r\n <i [ngClass]=\"getAttachmentIcon(att)\"></i>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"file-info\">\r\n <div class=\"file-name\" [title]=\"att.FileName\">{{ att.FileName }}</div>\r\n </div>\r\n\r\n @if(!disableAction){\r\n <button mat-icon-button class=\"remove-btn\" type=\"button\" aria-label=\"Rimuovi allegato\"\r\n (click)=\"deleteAttachment(att)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (att.isUploading) {\r\n <div class=\"upload-spinner\"></div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n} @else {\r\n\r\n<div class=\"table-view-container\">\r\n <div class=\"table-header\">\r\n <div class=\"table-cell name-col\">File</div>\r\n <div class=\"table-cell actions-col\">Azioni</div>\r\n </div>\r\n\r\n @for (att of attachmentsList; track att.ID) {\r\n <div class=\"table-row\">\r\n <div class=\"table-cell name-col\">\r\n <i class=\"file-icon-small\" [ngClass]=\"getAttachmentIcon(att)\"></i>\r\n <div class=\"file-info-text\">\r\n <span class=\"file-name-table\">{{ att.FileName }}</span>\r\n <span class=\"file-type-table\">{{ att.FileExtension || 'Link' }}</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-cell actions-col\">\r\n <button mat-icon-button (click)=\"viewAttachment(att)\" matTooltip=\"Visualizza/Scarica\">\r\n <mat-icon>{{ att.AttachmentType === attachmentType.FILE ? 'download' : 'open_in_new' }}</mat-icon>\r\n </button>\r\n <button mat-icon-button [matMenuTriggerFor]=\"actionsMenu\" matTooltip=\"Altre opzioni\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #actionsMenu=\"matMenu\">\r\n <button mat-menu-item\r\n (click)=\"openPreviewDialog(att)\"><mat-icon>visibility</mat-icon><span>Anteprima</span></button>\r\n <button [disabled]=\"disableAction\" mat-menu-item (click)=\"deleteAttachment(att)\" matTooltip=\"Elimina\">\r\n <mat-icon color=\"warn\">delete</mat-icon>\r\n <span>Elimina</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n}\r\n\r\n<!-- Notifica toast -->\r\n<div class=\"upload-notification\" [class.show]=\"toast?.visible\" [class.success]=\"toast?.type === 'success'\"\r\n [class.error]=\"toast?.type === 'error'\">\r\n <span>{{ toast?.text }}</span>\r\n <div class=\"notification-progress\"></div>\r\n</div>\r\n\r\n\r\n<ng-template #dialogCropImage>\r\n <div style=\"overflow-x: hidden\" [ngClass]=\"cropDialogClass\">\r\n @if (showCropImage == true) {\r\n <ng-container [ngTemplateOutlet]=\"croppieTemplate\" [ngTemplateOutletContext]=\"{ form: newAttachmentForm }\">\r\n </ng-container>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<ng-template #inlinePreviewTemplate let-row=\"row\">\r\n @if (row.AttachmentType != AttachmentType.LINK && row.IsImage) {\r\n <div class=\"inline-preview-container\" (click)=\"openPreviewDialog(row)\">\r\n <img [src]=\"'data:image/png;base64,' + (row.FileThumbnailBase64 ? row.FileThumbnailBase64 : row.FileDataBase64)\" />\r\n </div>\r\n } @else if (row.AttachmentType != AttachmentType.LINK && !row.IsImage) {\r\n <div class=\"inline-preview-container\" (click)=\"openPreviewDialog(row)\">\r\n <i [ngClass]=\"getAttachmentIcon(row)\"></i>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n<ng-template #dialogPreview>\r\n @if (selectedAttachment) {\r\n <h2 mat-dialog-title class=\"dialog-header\">\r\n <span>\r\n {{ previewLabel }} {{ selectedAttachment!.AttachmentType === attachmentType.FILE ? \"File\" : \"Link\" }}\r\n </span>\r\n <button mat-icon-button mat-dialog-close aria-label=\"Chiudi anteprima\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </h2>\r\n\r\n <mat-dialog-content class=\"dialog-content\">\r\n @if (selectedAttachment!.IsImage) {\r\n <img class=\"preview-image\"\r\n [src]=\"'data:image/png;base64,' + (selectedAttachment!.FileDataBase64 || selectedAttachment!.FileThumbnailBase64)\"\r\n alt=\"Anteprima allegato\" />\r\n } @else {\r\n <iframe class=\"preview-iframe\" [src]=\"selectedAttachment!.TrustedUrl\" [title]=\"selectedAttachment!.FileName\">\r\n </iframe>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions [align]=\"'center'\">\r\n @if (selectedAttachment!.AttachmentType !== AttachmentType.LINK) {\r\n <button mat-raised-button color=\"primary\" (click)=\"viewAttachment(selectedAttachment!)\">\r\n <mat-icon>download</mat-icon>\r\n <span>{{ downloadLabel }}</span>\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n }\r\n</ng-template>\r\n\r\n\r\n<!-- TEMPLATE PER IL PULSANTE DI AGGIUNTA NUOVO ALLEGATO -->\r\n<ng-template #addAttachmentButton>\r\n <input #fileInput style=\"display: none\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n\r\n @if (allowedTypes && allowedTypes.length == 1 && (multipleAttachment == true || !attachmentsList ||\r\n attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n <button class=\"btn btn-primary mb-4 me-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"addFile(allowedTypes[0], fileInput)\" [disabled]=\"isDisabled\">\r\n @if (allowedTypes[0] == 1) { <mat-icon>cloud_upload</mat-icon> }\r\n @if (allowedTypes[0] == 2) { <i class=\"fas fa-link\"></i> }\r\n @if (allowedTypes[0] == 3) { <i class=\"fa-brands fa-dropbox\"></i> }\r\n <span style=\"margin-left: 10px\">\r\n {{ allowedTypes[0] == 1 ? (addButtonLabel + \" file\") : allowedTypes[0] == 2 ? (addButtonLabel + \" link\") :\r\n uploadWithDropboxLabel }}\r\n </span>\r\n </button>\r\n }\r\n\r\n @if (!separatedUploadButtons && allowedTypes && allowedTypes.length > 1 && (multipleAttachment == true ||\r\n !attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n <button class=\"btn btn-primary mb-4 me-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\">\r\n @if (multipleAttachment != true) { <mat-icon>cloud_upload</mat-icon> } @else { <mat-icon>add</mat-icon> }\r\n <span style=\"margin-left: 0px\">{{ addButtonLabel }}</span>\r\n </button>\r\n\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <input #imageInput style=\"display: none\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n @if (allowedTypes.includes(1)) {\r\n <button mat-menu-item (click)=\"imageInput.click()\" 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 }\r\n @if (allowedTypes.includes(2)) {\r\n <button mat-menu-item (click)=\"switchToAddingLinkMode()\" 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 }\r\n @if (allowedTypes.includes(3)) {\r\n <button mat-menu-item (click)=\"chooseDropboxFile()\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fa-brands fa-dropbox\"></i>\r\n <span style=\"margin-left: 10px\">Dropbox</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n }\r\n\r\n @if (separatedUploadButtons && allowedTypes && allowedTypes.length > 1 && (multipleAttachment == true ||\r\n !attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n <div class=\"btn-group\">\r\n @if (allowedTypes.includes(1)) {\r\n <button (click)=\"imageInput.click()\" class=\"btn btn-secondary eqp-attachments-add-btn\" mat-raised-button\r\n color=\"secondary\" type=\"button\">\r\n <i class=\"fa-solid fa-cloud-upload\"></i>\r\n <span style=\"margin-left: 10px\">File</span>\r\n </button>\r\n }\r\n <input #imageInput style=\"display: none\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n @if (allowedTypes.includes(2)) {\r\n <button (click)=\"switchToAddingLinkMode()\" class=\"btn btn-secondary eqp-attachments-add-btn\" mat-raised-button\r\n color=\"secondary\" type=\"button\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px\">Link</span>\r\n </button>\r\n }\r\n @if (allowedTypes.includes(3)) {\r\n <button (click)=\"chooseDropboxFile()\" class=\"btn btn-secondary eqp-attachments-add-btn\" mat-raised-button\r\n color=\"secondary\" type=\"button\">\r\n <i class=\"fa-brands fa-dropbox\"></i>\r\n <span style=\"margin-left: 10px\">Dropbox</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n<ng-template #croppieTemplate>\r\n <!-- Header compatto -->\r\n <h2 class=\"dialog-header m-3\">\r\n <span>{{ cropLabel }}</span>\r\n <button mat-icon-button type=\"button\" aria-label=\"Chiudi\" (click)=\"abortFile()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </h2>\r\n\r\n <!-- Contenuto scrollabile con griglia responsive -->\r\n <div class=\"dialog-content\">\r\n <!-- Toolbar controlli (large) -->\r\n <div class=\"controls-row crop-large\">\r\n @if (cropOptions.includes(1)) {\r\n <button [matTooltip]=\"rotateLeftLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"rotateLeft()\">\r\n <mat-icon>rotate_left</mat-icon>\r\n </button>\r\n <button [matTooltip]=\"rotateRightLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"rotateRight()\">\r\n <mat-icon>rotate_right</mat-icon>\r\n </button>\r\n }\r\n @if (cropOptions.includes(2)) {\r\n <button [matTooltip]=\"flipHorinzontalLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"flipHorizontal()\">\r\n <mat-icon>flip_horizontal</mat-icon>\r\n </button>\r\n <button [matTooltip]=\"flipVerticalLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"flipVertical()\">\r\n <mat-icon>flip_vertical</mat-icon>\r\n </button>\r\n }\r\n <button [matTooltip]=\"'Reset'\" class=\"btn btn-primary mat-raised-button\" (click)=\"restoreOriginalDimensions()\">\r\n <mat-icon>replay</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <!-- Toolbar controlli (small) -->\r\n <div class=\"controls-row crop-small\">\r\n @if (cropOptions.includes(1)) {\r\n <mat-icon class=\"control-icon\" (click)=\"rotateLeft()\">rotate_left</mat-icon>\r\n <mat-icon class=\"control-icon\" (click)=\"rotateRight()\">rotate_right</mat-icon>\r\n }\r\n @if (cropOptions.includes(2)) {\r\n <mat-icon class=\"control-icon\" (click)=\"flipHorizontal()\">flip_horizontal</mat-icon>\r\n <mat-icon class=\"control-icon\" (click)=\"flipVertical()\">flip_vertical</mat-icon>\r\n }\r\n <mat-icon class=\"control-icon\" (click)=\"restoreOriginalDimensions()\">replay</mat-icon>\r\n </div>\r\n\r\n <!-- Area crop con contenimento -->\r\n <div class=\"crop-area\">\r\n <div class=\"crop-container\">\r\n <image-cropper [imageFile]=\"selectedFile\" [maintainAspectRatio]=\"false\" [autoCrop]=\"false\"\r\n [containWithinAspectRatio]=\"false\" [aspectRatio]=\"4 / 3\" [cropperMinWidth]=\"128\" [onlyScaleDown]=\"true\"\r\n [roundCropper]=\"false\" [canvasRotation]=\"0\" [transform]=\"transform\" [alignImage]=\"'left'\" format=\"png\"\r\n (imageCropped)=\"imageCropped($event)\" [resizeToWidth]=\"customWidth\" [resizeToHeight]=\"customHeight\"\r\n [canvasRotation]=\"canvasRotation\" [output]=\"'base64'\">\r\n </image-cropper>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Azioni -->\r\n <div class=\"dialog-actions crop-large\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-confirm-btn\" type=\"button\"\r\n (click)=\"confirmAddAttachment()\">\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\r\n <div class=\"dialog-actions crop-small\">\r\n <button class=\"icon-action\" type=\"button\" (click)=\"abortFile()\" aria-label=\"Abort\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n <button class=\"icon-action\" type=\"button\" (click)=\"confirmAddAttachment()\" aria-label=\"Confirm\">\r\n <i class=\"fa fa-check\"></i>\r\n </button>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<!-- TEMPLATE PER FORM DI AGGIUNTA DI UN LINK -->\r\n<ng-template #addingLinkTemplate>\r\n <h2 mat-dialog-title>Aggiungi un link</h2>\r\n <mat-dialog-content class=\"add-link-dialog-content\">\r\n <form [formGroup]=\"newAttachmentForm\" class=\"add-link-form\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>URL *</mat-label>\r\n <input matInput formControlName=\"filePath\" placeholder=\"https://...\" required>\r\n @if (newAttachmentForm.get('filePath')?.hasError('pattern')) {\r\n <mat-error>L'URL non sembra valido.</mat-error>\r\n }\r\n </mat-form-field>\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Nome (opzionale)</mat-label>\r\n <input matInput formControlName=\"fileName\" placeholder=\"Es. Documento Progetto\">\r\n </mat-form-field>\r\n </form>\r\n </mat-dialog-content>\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-button mat-dialog-close>Annulla</button>\r\n <button mat-raised-button color=\"primary\" [mat-dialog-close]=\"newAttachmentForm.value\"\r\n [disabled]=\"newAttachmentForm.invalid\">\r\n Aggiungi\r\n </button>\r\n </mat-dialog-actions>\r\n</ng-template>","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 { ImageCropperComponent } from 'ngx-image-cropper';\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 ImageCropperComponent\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"],"names":["i5.EqpAttachmentService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMa,uBAAuB,CAAA;AAEhC,IAAA,OAAgB,cAAc,GAAa,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,CAAC;IAE9G,OAAgB,iBAAiB,GAAQ;AACrC,QAAA,KAAK,EAAE,kBAAkB;AACzB,QAAA,KAAK,EAAE,iBAAiB;AACxB,QAAA,KAAK,EAAE,kBAAkB;AACzB,QAAA,MAAM,EAAE,kBAAkB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAE1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAA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AXhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;AACvC,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd,WAAW;wBACX,YAAY;wBACZ,mBAAmB;wBACnB;AACD,qBAAA;oBACD,OAAO,EAAE,CAAC,uBAAuB;AAClC,iBAAA;;;ACjBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"eqproject-eqp-attachments.mjs","sources":["../../../projects/eqp-attachments/src/lib/helpers/attachment.helper.ts","../../../projects/eqp-attachments/src/lib/interfaces/IAttachment.ts","../../../projects/eqp-attachments/src/lib/services/eqp-attachment-dialog.service.ts","../../../projects/eqp-attachments/src/lib/services/eqp-attachment.service.ts","../../../projects/eqp-attachments/src/lib/eqp-attachments.component.ts","../../../projects/eqp-attachments/src/lib/eqp-attachments.component.html","../../../projects/eqp-attachments/src/lib/modules/material.module.ts","../../../projects/eqp-attachments/src/lib/eqp-attachments.module.ts","../../../projects/eqp-attachments/src/public-api.ts","../../../projects/eqp-attachments/src/eqproject-eqp-attachments.ts"],"sourcesContent":["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 static readonly dropboxCredentials: any = { \r\n url: 'https://www.dropbox.com/static/api/2/dropins.js', \r\n apiKey: \"aj2xjzms4dl1sch\",\r\n accessToken: \"l.BbasuuUFe42u-fXvpmDEteNkGMH-yPTxD79JhRjkBcR94Fm2QLgIjEETvx8TY36HsQQsIe24ofcNjYlg9IhSB7Fguqbi7wH-Jg6bW_3Q8VemsH4pC7Iakat643EzRcw7OMObPSs\"\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","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 isUploading?: boolean;\r\n}\r\n\r\nexport enum AttachmentType {\r\n FILE = 1,\r\n LINK = 2,\r\n DROPBOX = 3\r\n}\r\n\r\nexport enum CropOptionEnum {\r\n ROTATE = 1,\r\n FLIP = 2\r\n}\r\n\r\nexport type AttachmentCardSize = 'small' | 'medium' | 'large' | 'custom';\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 { Injectable } from \"@angular/core\";\r\nimport { AttachmentHelperService } from \"../helpers/attachment.helper\";\r\n\r\n@Injectable({\r\n providedIn: \"root\"\r\n})\r\nexport class EqpAttachmentService {\r\n constructor() {}\r\n\r\n loadDropboxScript() {\r\n const script = document.createElement(\"script\");\r\n script.type = \"text/javascript\";\r\n script.src = AttachmentHelperService.dropboxCredentials.url;\r\n script.id = \"dropboxjs\";\r\n script.dataset.appKey = AttachmentHelperService.dropboxCredentials.apiKey;\r\n document.body.appendChild(script);\r\n }\r\n}\r\n","import { HttpClient } from \"@angular/common/http\";\r\nimport {\r\n ChangeDetectorRef,\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n TemplateRef,\r\n ViewChild\r\n} from \"@angular/core\";\r\nimport { FormBuilder, FormGroup, Validators } from \"@angular/forms\";\r\nimport { MatDialog, MatDialogRef } from \"@angular/material/dialog\";\r\nimport { DomSanitizer } from \"@angular/platform-browser\";\r\nimport imageCompression from \"browser-image-compression\";\r\nimport { base64ToFile, ImageCroppedEvent, ImageCropperComponent, ImageTransform } from \"ngx-image-cropper\";\r\nimport { AttachmentHelperService } from \"./helpers/attachment.helper\";\r\nimport { AttachmentCardSize, AttachmentType, CropOptionEnum, IAttachmentDTO } from \"./interfaces/IAttachment\";\r\nimport { IOptions } from \"./interfaces/IOptions\";\r\nimport { EqpAttachmentDialogService } from \"./services/eqp-attachment-dialog.service\";\r\nimport { EqpAttachmentService } from \"./services/eqp-attachment.service\";\r\n\r\ndeclare var Dropbox: any;\r\n\r\nconst toBase64 = (file) =>\r\n 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 //#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 * 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 * Nel caso si vuole gestire un solo elemento senza passarlo come array, lo passo come singolo allegato e gestisco nella libreria l'array.\r\n */\r\n @Input(\"singleAttachment\") singleAttachment: 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 * Se assume il valore TRUE allora sarà possibile caricare più file per volta. Questa funzionalità è attiva\r\n * SOLO se si gestiscono allegati multipli, quindi se l'input 'multipleAttachment' assume il valore TRUE, altrimenti è sempre disabilitata.\r\n */\r\n @Input(\"loadMultipleFiles\") loadMultipleFiles: boolean = false;\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 = {\r\n maxSizeMB: 0.5,\r\n maxWidthOrHeight: 1920,\r\n useWebWorker: true\r\n };\r\n\r\n /**\r\n * Array di AttachmentType che si possono aggiungere\r\n */\r\n @Input(\"allowedTypes\") allowedTypes: Array<AttachmentType> = [AttachmentType.FILE, AttachmentType.LINK];\r\n\r\n /**\r\n * Permette di stabilire se la eqp-table contenente l'elenco degli allegati utilizza\r\n * il multilingua oppure no\r\n */\r\n @Input(\"isEqpTableMultiLanguage\") isEqpTableMultiLanguage: boolean = false;\r\n\r\n /**\r\n * Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco\r\n * degli allegati deve essere paginata oppure no\r\n */\r\n @Input(\"tablePaginatorVisible\") tablePaginatorVisible: boolean = true;\r\n\r\n /**\r\n * Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco\r\n * degli allegati deve contenere il campo di ricerca oppure no\r\n */\r\n @Input(\"isTableSearcheable\") isTableSearcheable: boolean = true;\r\n\r\n /**\r\n * In caso di gestione allegati multipli, permette di stabilire la dimensione pagina di default\r\n * per la tabella contenente l'elenco degli allegati\r\n */\r\n @Input(\"tablePaginatorSize\") tablePaginatorSize: number = null;\r\n\r\n /**\r\n * Permette di scegliere il modo in cui i file devono essere caricati\r\n */\r\n // @Input(\"uploadType\") uploadType: UploadTypeEnum = UploadTypeEnum.FILE_AND_LINK;\r\n\r\n /**\r\n * Permette di stabilire se i pulsanti per il caricamento dei file sono separati o in un menù a tendina\r\n */\r\n @Input(\"separatedUploadButtons\") separatedUploadButtons: boolean = false;\r\n\r\n /**\r\n * Permette di scegliere se dare la possibilità di vedere o no l'anteprima\r\n */\r\n @Input(\"showPreview\") showPreview: boolean = true;\r\n\r\n /**\r\n * In caso di allegato singolo, permette di scegliere se aggiungere file tramite drag and drop\r\n */\r\n @Input(\"singleAttachmentDragAndDrop\") singleAttachmentDragAndDrop: boolean = false;\r\n\r\n /**\r\n * Array di opzioni che si possono utilizzare per il crop\r\n */\r\n @Input(\"cropOptions\") cropOptions: Array<CropOptionEnum> = [];\r\n\r\n /**\r\n * Classe custom da assegnare al dialog del crop immagini\r\n */\r\n @Input(\"cropDialogClass\") cropDialogClass: string;\r\n\r\n @Input() maxFileSizeMB: number = 100; // Default max size of 100 MB\r\n @Input() cardSize: AttachmentCardSize = 'small'; // Default\r\n @Input() customCardWidthPx: number = 200; // Larghezza custom in px\r\n @Input() customCardHeightPx: number = 180; // Altezza custom in px\r\n\r\n /**\r\n * Input per definire le label da usare nel componente\r\n */\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(\"uploadWithDropboxLabel\") uploadWithDropboxLabel: string = \"Carica con Dropbox\";\r\n @Input(\"cropLabel\") cropLabel: string = \"Scegli le dimensioni dell'immagine\";\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 =\r\n \"Non è possibile selezionare un file che non sia un'immagine.\";\r\n @Input(\"wrongTypeSelectedErrorMessage\") wrongTypeSelectedErrorMessage: string =\r\n \"Non è possibile caricare il file selezionato.\";\r\n @Input(\"videoPreviewErrorMessage\") videoPreviewErrorMessage: string =\r\n \"Impossibile aprire l'anteprima di un file video.\";\r\n @Input(\"videoPreviewErrorMessage\") audioPreviewErrorMessage: string =\r\n \"Impossibile aprire l'anteprima di un file audio.\";\r\n @Input(\"flipHorinzontalLabel\") flipHorinzontalLabel: string = \"Capovolgi orizzontalmente\";\r\n @Input(\"flipVerticalLabel\") flipVerticalLabel: string = \"Capovolgi verticalmente\";\r\n @Input(\"rotateRightLabel\") rotateRightLabel: string = \"Ruota a destra\";\r\n @Input(\"rotateLeftLabel\") rotateLeftLabel: string = \"Ruota a sinistra\";\r\n @Input() uploadTitle = 'Upload file';\r\n @Input() uploadSubtitle = 'Drag & drop files o click';\r\n @Input() dropHereLabel = 'Rilascia i file qui';\r\n @Input() supportedFormatsLabel = 'Formati supportati: JPEG, PNG, PDF (Max 100MB)';\r\n @Input() browseFilesLabel = 'Cerca i file';\r\n @Input() uploadSummaryLabel = 'Lista allegati';\r\n @Input() filesLabel = 'Files';\r\n @Input() totalSizeLabel = 'Dimensione totale';\r\n @Input() emptyStateLabel = 'Non sono presenti file caricati';\r\n @Input() addedSuccessfullyLabel = 'file(s) caricati con successo.';\r\n @Input() removedLabel = 'File rimosso';\r\n // @Input() removeLabel = 'Rimuovi file';\r\n @Input() chooseView = true;\r\n @Input() showSummary = false;\r\n @Input(\"viewMode\") viewMode: 'card' | 'table' = 'table';\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 scatenato alla pressione del pulsante ESCI della modale di caricamento file.\r\n */\r\n @Output() abortAddAttachment: EventEmitter<any> = new EventEmitter<any>();\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 newMultipleAttachments: Array<IAttachmentDTO> = [];\r\n attachmentType = AttachmentType;\r\n // uploadTypeEnum = UploadTypeEnum;\r\n newAttachmentForm: FormGroup;\r\n selectedFile: File = null;\r\n selectedFiles: Array<File> = null;\r\n showCropImage: boolean = false;\r\n @ViewChild(\"dialogAddAttachment\", { static: true }) dialogAddAttachment: TemplateRef<any>;\r\n dialogRefAddAttachment: MatDialogRef<TemplateRef<any>>;\r\n @ViewChild(\"dialogAddMultipleAttachment\", { static: true }) dialogAddMultipleAttachment: TemplateRef<any>;\r\n dialogRefCropImage: MatDialogRef<TemplateRef<any>>;\r\n @ViewChild(\"dialogCropImage\", { static: true }) dialogCropImage: TemplateRef<any>;\r\n\r\n @ViewChild('addingLinkTemplate') addingLinkTemplate: 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 canvasRotation = 0;\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(\"inlinePreviewTemplate\", { static: true }) inlinePreviewTemplate: TemplateRef<any>;\r\n @ViewChild(\"dialogPreview\", { static: true }) dialogPreview: TemplateRef<any>;\r\n\r\n imageFile: File;\r\n\r\n addingLinkMode: boolean = false;\r\n\r\n //#region Sezione nuova refactoring\r\n // Stato drag & drop e toast\r\n dragOver = false;\r\n toast = {\r\n visible: false as boolean,\r\n type: 'success' as 'success' | 'error',\r\n text: '' as string,\r\n timeoutId: 0 as any\r\n };\r\n\r\n progressPercent = 0;\r\n totalSizeBytes = 0;\r\n get totalSizeFormatted(): string { return this.formatFileSize(this.totalSizeBytes); }\r\n\r\n // Utility per formattare bytes (2 decimali)\r\n formatFileSize(bytes: number): string {\r\n if (!bytes || bytes <= 0) return '0 Bytes';\r\n const k = 1024;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;\r\n }\r\n\r\n // Mostra toast con auto‑hide e reset progress bar CSS\r\n showToast(message: string, type: 'success' | 'error' = 'success', durationMs = 3000) {\r\n if (this.toast.visible && this.toast.text === message) {\r\n return;\r\n }\r\n\r\n // Cancella il timeout precedente se esiste\r\n if (this.toast.timeoutId) {\r\n clearTimeout(this.toast.timeoutId);\r\n }\r\n\r\n // Calcola una durata dinamica\r\n const duration = durationMs || Math.max(4000, message.length * 100);\r\n\r\n this.toast.text = message;\r\n this.toast.type = type;\r\n this.toast.visible = true;\r\n\r\n // Imposta il nuovo timeout per nascondere automaticamente il toast\r\n this.toast.timeoutId = setTimeout(() => {\r\n this.toast.visible = false;\r\n }, duration);\r\n }\r\n\r\n #endregion\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 private cd: ChangeDetectorRef,\r\n private eqpAttachmentService: EqpAttachmentService\r\n ) { }\r\n\r\n ngOnInit() {\r\n\r\n // Inizializza metriche e progress in base allo stato iniziale\r\n this.recomputeTotalsAndProgress();\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) this.acceptedFileTypes = \"image/*\";\r\n else this.acceptedFileTypes = \"*\";\r\n\r\n // Se non sono stati specificati i tipi da gestire ma è stato passato null o un array vuoto imposto i tipi di default.\r\n if (!this.allowedTypes || this.allowedTypes.length == 0)\r\n this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK, AttachmentType.DROPBOX];\r\n else if (\r\n this.allowedTypes.find((t) => t != AttachmentType.FILE && t != AttachmentType.LINK && t != AttachmentType.DROPBOX)\r\n ) {\r\n EqpAttachmentDialogService.Warning(\r\n 'Almeno uno degli AttachmentType selezionati nel parametro \"allowedTypes\" non esiste.'\r\n );\r\n this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK, AttachmentType.DROPBOX];\r\n }\r\n\r\n if (this.attachmentsList == null) this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n // Se è stato passato un singolo allegato lo aggiungo alla lista\r\n if (this.singleAttachment != null && this.attachmentsList.length == 0) {\r\n this.attachmentsList.push(this.singleAttachment);\r\n }\r\n\r\n this.checkAttachmentImage();\r\n\r\n if (this.allowedTypes.includes(3)) {\r\n this.eqpAttachmentService.loadDropboxScript();\r\n }\r\n }\r\n\r\n setViewMode(mode: 'card' | 'table'): void {\r\n this.viewMode = mode;\r\n }\r\n\r\n // Ricalcola la somma pesata sugli allegati presenti\r\n private recomputeTotalsAndProgress() {\r\n this.totalSizeBytes = (this.attachmentsList || [])\r\n .filter(a => !!a)\r\n .reduce((sum, a) => sum + this.bytesFromBase64(a.FileDataBase64 || a.FileThumbnailBase64 || ''), 0);\r\n\r\n // Progress fittizio: 100% se presenti file, 0 se vuoto\r\n this.progressPercent = (this.attachmentsList && this.attachmentsList.length > 0) ? 100 : 0;\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this.toast.timeoutId) clearTimeout(this.toast.timeoutId);\r\n }\r\n\r\n // Calcola i byte da una stringa Base64 pura (senza prefisso data:...)\r\n public bytesFromBase64(base64: string): number {\r\n if (!base64) return 0;\r\n // Rimuovi eventuale prefisso data URL\r\n const commaIdx = base64.indexOf(',');\r\n const b64 = commaIdx >= 0 ? base64.substring(commaIdx + 1) : base64;\r\n // Conta padding\r\n let padding = 0;\r\n if (b64.endsWith('==')) padding = 2;\r\n else if (b64.endsWith('=')) padding = 1;\r\n // Formula esatta: (3 * (len / 4)) - padding\r\n const len = b64.length;\r\n return Math.max(0, (3 * Math.floor(len / 4)) - padding);\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 * 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(\r\n this.deleteDialogMessage,\r\n () => {\r\n this.removeAttachmentFromList(this.attachmentsList.indexOf(element));\r\n },\r\n true,\r\n this.deleteDialogTitle\r\n );\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 this.localEditedAttachments.emit(this.attachmentsList);\r\n\r\n this.recomputeTotalsAndProgress();\r\n this.showToast(this.removedLabel || 'File removed', 'success');\r\n\r\n }\r\n\r\n private simulateProgress() {\r\n this.progressPercent = 0;\r\n setTimeout(() => {\r\n this.progressPercent = 30;\r\n setTimeout(() => {\r\n this.progressPercent = 60;\r\n setTimeout(() => {\r\n this.progressPercent = 100;\r\n }, 200);\r\n }, 200);\r\n }, 100);\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 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 * 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) return \"fas fa-link\";\r\n else return AttachmentHelperService.getIconFromFileExtensione(attachment.FileExtension);\r\n }\r\n\r\n //#endregion\r\n\r\n /**\r\n * In caso di allegato singolo, sceglie quale metodo richiamare in base al tipo di allegato\r\n */\r\n addFile(attachmentType: AttachmentType, imageInput = null) {\r\n if (attachmentType == AttachmentType.LINK) {\r\n this.switchToAddingLinkMode();\r\n } else if (attachmentType == AttachmentType.FILE) {\r\n imageInput.click();\r\n } else {\r\n this.chooseDropboxFile();\r\n }\r\n }\r\n\r\n createAttachmentForm() {\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\r\n close(emitCloseEvent = true) {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n this.newMultipleAttachments = new Array<IAttachmentDTO>();\r\n this.abortFile();\r\n if (this.newAttachmentForm) this.newAttachmentForm.reset();\r\n\r\n this.dialogRefCropImage.close();\r\n this.restoreOriginalDimensions();\r\n\r\n if (emitCloseEvent == true && this.abortAddAttachment) this.abortAddAttachment.emit();\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.loadMultipleFiles != true) {\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 } else {\r\n return (\r\n this.newMultipleAttachments.filter(\r\n (p) =>\r\n (p.AttachmentType == AttachmentType.FILE && !p.FileDataBase64) ||\r\n (p.AttachmentType == AttachmentType.LINK && !p.FilePath)\r\n ).length > 0\r\n );\r\n }\r\n }\r\n\r\n confirmAddAttachment() {\r\n if (this.newAttachment.IsImage && this.imageCropper) {\r\n this.newAttachment.FileDataBase64 = this.imageCropper.crop().base64.split(\";base64,\")[1];\r\n }\r\n\r\n if (this.loadMultipleFiles != true) {\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) this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.attachmentsList.push(this.newAttachment);\r\n } else {\r\n if (this.newMultipleAttachments == null || this.newMultipleAttachments.length == 0) return;\r\n\r\n if (this.attachmentsList == null) this.attachmentsList = new Array<IAttachmentDTO>();\r\n\r\n this.attachmentsList = this.attachmentsList.concat(this.newMultipleAttachments);\r\n }\r\n\r\n // if (this.attachmentTable) this.attachmentTable.reloadDatatable();\r\n\r\n this.localEditedAttachments.emit(this.attachmentsList);\r\n\r\n if (this.newAttachment.IsImage) {\r\n this.dialogRefCropImage.close();\r\n this.restoreOriginalDimensions();\r\n }\r\n\r\n if (this.newAttachment.AttachmentType === AttachmentType.LINK) {\r\n this.newAttachment = {} as IAttachmentDTO;\r\n if (this.newAttachmentForm) this.newAttachmentForm.reset();\r\n }\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) => {\r\n this.selectedAttachment.FileDataBase64 = res.FileDataBase64;\r\n })\r\n .catch((err) => {\r\n EqpAttachmentDialogService.Error(err);\r\n });\r\n }\r\n\r\n if (this.selectedAttachment.AttachmentType == AttachmentType.LINK) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(\r\n this.selectedAttachment.FilePath\r\n );\r\n } else if (\r\n this.selectedAttachment.IsImage &&\r\n !this.selectedAttachment.FileDataBase64 &&\r\n !this.selectedAttachment.FileThumbnailBase64\r\n ) {\r\n EqpAttachmentDialogService.Info(\"Impossibile aprire l'anteprima dell'allegato, file mancante.\");\r\n return;\r\n }\r\n else if (this.selectedAttachment.FileContentType === 'application/pdf' && this.selectedAttachment.FileDataBase64) {\r\n this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(\r\n `data:application/pdf;base64,${this.selectedAttachment.FileDataBase64}`\r\n );\r\n }\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 * Evento scatenato alla selezione del file (o dei file).\r\n * Se il caricamento è SINGOLO o se comunque è stato selezionato un solo file allora si occupa di controllare se si tratta di un immagine in modo da\r\n * mostrare le funzionalità del croppie (per ritagliare l'immagine) oppure no.\r\n * Se il file caricato non è un immagine allora genera direttamente il base64 e lo associa all'allegato da salvare.\r\n * Se invece il caricamento dei file è MULTIPLO e sono presenti più file allora esegue le stesse operazioni ignorando però il contrllo\r\n * immagine per il croppie (in caso di caricamento multiplo le funzionalità del croppie sono disabilitate).\r\n */\r\n async onFileAdded(event, isFileDropped: boolean = false) {\r\n\r\n if (this.isDisabled) {\r\n EqpAttachmentDialogService.Info(\"Caricamento allegati non disponibile.\");\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n this.showCropImage = false;\r\n // let filesOnInput = isFileDropped ? event : event.target.files;\r\n const filesOnInput: File[] = isFileDropped\r\n ? (event as File[])\r\n : Array.from((event.target as HTMLInputElement)?.files || []);\r\n\r\n const { validFiles, oversizedFiles } = this.validationFile(filesOnInput, isFileDropped);\r\n\r\n //Se è stato richiesto il caricamento SINGOLO oppure se il caricamento è MULTIPLO ma è stato selezionato un solo file\r\n //allora verifica se il file è un immagine (per mostrare il CROPPIE)\r\n if ([...validFiles].length == 1 || this.loadMultipleFiles != true) {\r\n this.selectedFile = validFiles[0];\r\n this.selectedFiles = validFiles;\r\n if (!this.selectedFile) return;\r\n\r\n //Memorizza i dati per l'allegato\r\n this.newAttachment = await this.createAttachmentFromUploadedFile(this.selectedFile, false);\r\n this.newMultipleAttachments = new Array<IAttachmentDTO>();\r\n this.newMultipleAttachments.push(this.newAttachment);\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 let checkOnlyImage = this.checkAllowOnlyImageFile(this.newAttachment);\r\n if (checkOnlyImage == false) return;\r\n\r\n this.createAttachmentForm();\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(validFiles[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.imageFile = event;\r\n\r\n this.dialogRefCropImage = this.dialog.open(this.dialogCropImage, {\r\n disableClose: true,\r\n hasBackdrop: true,\r\n width: \"60%\",\r\n maxHeight: \"80%\",\r\n maxWidth: \"70vh\",\r\n panelClass: 'eqp-attachments-dialog'\r\n });\r\n } else {\r\n this.showCropImage = false;\r\n let base64Result = await this.getBase64FromFile(this.selectedFile);\r\n this.newAttachment.FileDataBase64 = base64Result.Base64File;\r\n this.newAttachment.FileContentType = base64Result.ContentType;\r\n this.confirmAddAttachment();\r\n }\r\n } else {\r\n this.selectedFiles = validFiles;\r\n if (!this.selectedFiles || this.selectedFiles.length == 0) return;\r\n\r\n if (!this.newMultipleAttachments) this.newMultipleAttachments = [];\r\n for (let i = 0; i < this.selectedFiles.length; i++) {\r\n let newAttachment: IAttachmentDTO = await this.createAttachmentFromUploadedFile(\r\n this.selectedFiles[i],\r\n true,\r\n true\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 let checkOnlyImage = this.checkAllowOnlyImageFile(newAttachment);\r\n if (checkOnlyImage == false) return;\r\n\r\n this.newMultipleAttachments.push(newAttachment);\r\n }\r\n this.confirmAddAttachment();\r\n }\r\n\r\n this.recomputeTotalsAndProgress();\r\n this.simulateProgress();\r\n // Caso 1: Successo Parziale (alcuni file validi, altri no)\r\n if (oversizedFiles.length > 0 && validFiles.length > 0) {\r\n const fileNames = oversizedFiles.join(', ');\r\n this.showToast(\r\n `${validFiles.length} file aggiunti. ${oversizedFiles.length} non caricati perché troppo grandi (${fileNames}).`,\r\n 'error'\r\n );\r\n }\r\n // Caso 2: Nessun file valido\r\n else if (oversizedFiles.length > 0 && validFiles.length === 0) {\r\n }\r\n // Caso 3: Tutti i file validi\r\n else if (oversizedFiles.length === 0 && validFiles.length > 0) {\r\n this.showToast(\r\n `${validFiles.length} ${this.addedSuccessfullyLabel || 'file(s) aggiunti con successo.'}`,\r\n 'success'\r\n );\r\n }\r\n\r\n //Resetto il valore del file input in modo da scatenare il change anche se si dovesse caricare lo stesso file\r\n if (!isFileDropped) event.target.value = \"\";\r\n }\r\n\r\n private validationFile(filesOnInput: File[], isFileDropped: boolean) {\r\n const validFiles: File[] = [];\r\n const oversizedFiles: string[] = [];\r\n\r\n for (const file of filesOnInput) {\r\n const fileSizeMB = file.size / 1024 / 1024;\r\n if (fileSizeMB > this.maxFileSizeMB) {\r\n oversizedFiles.push(file.name);\r\n } else {\r\n validFiles.push(file);\r\n }\r\n }\r\n\r\n // Show a single error message for all oversized files\r\n if (oversizedFiles.length > 0) {\r\n const fileNames = oversizedFiles.join(', ');\r\n this.showToast(`File(s) troppo grandi: ${fileNames}. Limite: ${this.maxFileSizeMB}MB`, 'error');\r\n }\r\n\r\n // Abort if no files are valid\r\n if (validFiles.length === 0) {\r\n if (!isFileDropped) { (event.target as HTMLInputElement).value = ''; }\r\n return;\r\n }\r\n\r\n return { validFiles, oversizedFiles };\r\n }\r\n\r\n /**\r\n * A partire dal FILE ricevuto in input ricostruisce l'oggetto IAttachmentDTO e lo restituisce.\r\n * Se il parametro getBase64 viene passato a TRUE allora, sempre a partire dal file,genera il base64 e\r\n * ricava il ContentType da associare all'oggetto IAttachmentDTO da restituire\r\n * @param currentFile Oggetto FILE da processare\r\n * @param getBase64 Se TRUE allora calcola base64 e ContentType del file passato in input\r\n * @returns Restituisce un oggetto di tipo IAttachmentDTO\r\n */\r\n private async createAttachmentFromUploadedFile(\r\n currentFile: File,\r\n getBase64: boolean = true,\r\n cropFile: boolean = false\r\n ): Promise<IAttachmentDTO> {\r\n let newAttachment: IAttachmentDTO = {} as IAttachmentDTO;\r\n //Memorizza i dati per l'allegato\r\n newAttachment.AttachmentType = AttachmentType.FILE;\r\n newAttachment.FileContentType = currentFile.type;\r\n newAttachment.FileName = currentFile.name;\r\n newAttachment.FileExtension = currentFile.name.substr(currentFile.name.lastIndexOf(\".\") + 1);\r\n newAttachment.IsImage = AttachmentHelperService.checkImageFromMimeType(currentFile.type);\r\n\r\n if (getBase64 == true) {\r\n let base64Result = await this.getBase64FromFile(currentFile);\r\n newAttachment.FileDataBase64 = base64Result.Base64File;\r\n newAttachment.FileContentType = base64Result.ContentType;\r\n\r\n if (newAttachment.IsImage && newAttachment.FileDataBase64 && cropFile) {\r\n this.getCroppedAndUpload(`data:${base64Result.ContentType};base64,${base64Result.Base64File}`, newAttachment);\r\n }\r\n }\r\n\r\n return newAttachment;\r\n }\r\n\r\n /**\r\n * A partire dal file passato in input restituisce un oggetto\r\n * contenente il base64 del file e il suo contentType\r\n * @param currentFile Oggetto File da cui estrapolare base64 e contentType\r\n * @returns Restituisce un oggetto avente le proprietà Base64File e ContentType\r\n */\r\n private async getBase64FromFile(currentFile: File): Promise<any> {\r\n let base64File = await toBase64(currentFile);\r\n let contentType: string = null;\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 contentType = base64File.split(\",\")[0].split(\":\")[1].split(\";\")[0];\r\n // Un altro metodo per leggere il ccontent type del file è tramite una regular expression:\r\n base64File = base64File.split(\",\")[1];\r\n }\r\n\r\n let result = {\r\n Base64File: base64File,\r\n ContentType: contentType\r\n };\r\n\r\n return result;\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 private checkAcceptedFiles(): boolean {\r\n if (\r\n (this.loadMultipleFiles != true && this.selectedFile.type.startsWith(\"video\")) ||\r\n (this.loadMultipleFiles == true && [...this.selectedFiles].filter((p) => p.type.startsWith(\"video\")).length > 0)\r\n )\r\n return false;\r\n\r\n if (this.acceptedFileTypes == \"*\") return true;\r\n\r\n //Verifica che i tipi del file (o dei file) caricati siano coerenti con quelli accettati dalla direttiva\r\n let accepted: boolean = true;\r\n if (this.loadMultipleFiles != true) accepted = this.acceptedFileTypes.includes(this.selectedFile.type);\r\n else {\r\n let uploadedFileTypes: string[] = [...this.selectedFiles].map((p) => p.type);\r\n uploadedFileTypes.forEach((type) => {\r\n if (!this.acceptedFileTypes.includes(type)) accepted = false;\r\n });\r\n }\r\n\r\n //Questo controllo permette di gestire le casistiche per cui vengono indicati come tipi validi, ad esempio, 'image/*'\r\n if (!accepted && this.loadMultipleFiles != true) {\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) break;\r\n }\r\n }\r\n return accepted;\r\n }\r\n\r\n /**\r\n * Se eqp-attachments è stata configurata per il caricamento delle sole immagini allora verifica che il file passato in\r\n * input sia effettivamente un immagine o no.\r\n * Se il controllo va a buon fine restituisce TRUE altrimenti mostra un messaggio d'errore e restituisce FALSE\r\n */\r\n private checkAllowOnlyImageFile(newAttachment): boolean {\r\n if (this.allowOnlyImages == true && newAttachment.IsImage != true) {\r\n EqpAttachmentDialogService.Error(this.noImageSelectedErrorMessage);\r\n this.abortFile();\r\n return false;\r\n } else if (!this.checkAcceptedFiles()) {\r\n EqpAttachmentDialogService.Error(this.wrongTypeSelectedErrorMessage);\r\n this.abortFile();\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n //#region Gestione crop file\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 this.canvasRotation = 0;\r\n this.transform = {};\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, this.newAttachment);\r\n }\r\n\r\n getCroppedAndUpload(file, newAttachment: IAttachmentDTO) {\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 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 newAttachment.FileDataBase64 = resultReader.substring(resultReader.indexOf(marker) + marker.length);\r\n self.showCropImage = false;\r\n if (self.newAttachmentForm) {\r\n self.newAttachmentForm.enable();\r\n }\r\n };\r\n\r\n fileReader.readAsDataURL(fileCompressed);\r\n });\r\n }\r\n\r\n // confirmCrop() {\r\n // this.imageCropper.crop();\r\n // this.dialogRefCropImage.close();\r\n // this.restoreOriginalDimensions();\r\n // }\r\n\r\n rotateLeft() {\r\n this.canvasRotation--;\r\n this.flipAfterRotate();\r\n }\r\n\r\n rotateRight() {\r\n this.canvasRotation++;\r\n this.flipAfterRotate();\r\n }\r\n\r\n private flipAfterRotate() {\r\n const flippedH = this.transform.flipH;\r\n const flippedV = this.transform.flipV;\r\n this.transform = {\r\n ...this.transform,\r\n flipH: flippedV,\r\n flipV: flippedH\r\n };\r\n }\r\n\r\n flipHorizontal() {\r\n this.transform = {\r\n ...this.transform,\r\n flipH: !this.transform.flipH\r\n };\r\n }\r\n\r\n flipVertical() {\r\n this.transform = {\r\n ...this.transform,\r\n flipV: !this.transform.flipV\r\n };\r\n }\r\n\r\n //#endregion\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 if (this.imageInput) this.imageInput.nativeElement.value = \"\";\r\n\r\n this.selectedFile = null;\r\n this.selectedFiles = 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.newMultipleAttachments = new Array<IAttachmentDTO>();\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 this.dialogRefCropImage.close();\r\n this.restoreOriginalDimensions();\r\n }\r\n\r\n //#endregion\r\n\r\n fileDropped(event: DragEvent): void {\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.dragOver = false;\r\n\r\n const files = event.dataTransfer?.files;\r\n\r\n if (files && files.length > 0) {\r\n this.onFileAdded({ target: { files: files } });\r\n }\r\n }\r\n\r\n // Se il caricamento del file dropbox va a buon fine, la funzione di callback restituisce un array di oggetti.\r\n // Viene poi fatta una XMLHttpRequest con responseType 'blob' per convertire il primo elemento della response in un Blob.\r\n chooseDropboxFile() {\r\n var options = {\r\n success: (files: any[]) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", files[0].link);\r\n xhr.setRequestHeader(\"Authorization\", `Bearer ${AttachmentHelperService.dropboxCredentials.accessToken}`);\r\n xhr.responseType = \"blob\";\r\n\r\n xhr.onload = () => {\r\n const blob = xhr.response;\r\n const file = new File([blob], files[0].name, { type: blob.type });\r\n let filesAdded = [file];\r\n this.onFileAdded(filesAdded, true);\r\n };\r\n\r\n xhr.send();\r\n },\r\n linkType: \"direct\",\r\n multiselect: false,\r\n extensions: [\".jpg\", \".png\", \".pdf\", \".doc\", \".docx\", \".txt\"]\r\n };\r\n Dropbox.choose(options);\r\n }\r\n\r\n // Workaround dropzone: disabilito il click degli elementi inclusi nella dropzone per evitare di cliccare due volte\r\n onSelectFile(event, fileInput) {\r\n if (\r\n (event.target as HTMLButtonElement).tagName === \"BUTTON\" ||\r\n (event.target as HTMLButtonElement).tagName === \"INPUT\" ||\r\n this.addingLinkMode == true\r\n ) {\r\n return;\r\n }\r\n fileInput.click();\r\n }\r\n\r\n // Metodo per visualizzare la form di aggiunta di un link\r\n // switchToAddingLinkMode() {\r\n // this.addingLinkMode = true;\r\n // this.newAttachment = {} as IAttachmentDTO;\r\n // this.newAttachment.IsImage = false;\r\n // this.newAttachment.AttachmentType = this.attachmentType.LINK;\r\n // this.newMultipleAttachments = new Array<IAttachmentDTO>();\r\n // this.newMultipleAttachments.push(this.newAttachment);\r\n\r\n // this.createAttachmentForm();\r\n // }\r\n\r\n /**\r\n * Apre il dialogo per l'inserimento del link.\r\n */\r\n switchToAddingLinkMode(): void {\r\n // 1. Crea il form per il dialogo\r\n this.newAttachmentForm = this.formBuilder.group({\r\n fileName: [''],\r\n filePath: ['', [Validators.required, Validators.pattern('https?://.+')]]\r\n });\r\n\r\n // 2. Apri il dialogo\r\n const dialogRef = this.dialog.open(this.addingLinkTemplate, {\r\n width: '500px',\r\n panelClass: 'eqp-attachments-dialog'\r\n });\r\n\r\n // 3. Gestisci il risultato alla chiusura\r\n dialogRef.afterClosed().subscribe(result => {\r\n if (result) {\r\n // A. Crea l'oggetto per il nuovo link dai dati del form\r\n const newLinkObject: IAttachmentDTO = {\r\n ID: 0,\r\n AttachmentType: AttachmentType.LINK,\r\n FileName: result.fileName,\r\n FilePath: result.filePath,\r\n IsImage: false\r\n };\r\n\r\n // B. Prepara l'oggetto `newAttachment` che `confirmAddAttachment` si aspetta\r\n this.newAttachment = newLinkObject;\r\n this.newMultipleAttachments = [newLinkObject];\r\n\r\n\r\n // C. Chiama la tua funzione di conferma centrale!\r\n this.confirmAddAttachment();\r\n }\r\n });\r\n }\r\n\r\n\r\n\r\n // Metodo per ottenere le classi CSS dinamiche\r\n getCardClass(att: IAttachmentDTO): { [key: string]: boolean } {\r\n return {\r\n 'file-preview': true,\r\n 'uploading': !!att.isUploading,\r\n 'card-small': this.cardSize === 'small',\r\n 'card-medium': this.cardSize === 'medium',\r\n 'card-large': this.cardSize === 'large',\r\n // Nessuna classe specifica per 'custom', useremo style.cssText\r\n };\r\n }\r\n\r\n // Questa funzione ora si applica al contenitore, non alla singola card.\r\n getPreviewsContainerStyle(): { [key: string]: string } {\r\n let minWidth = '200px'; // Dimensione di default per 'medium'\r\n\r\n if (this.cardSize === 'small') {\r\n minWidth = '140px';\r\n } else if (this.cardSize === 'large') {\r\n minWidth = '280px';\r\n } else if (this.cardSize === 'custom') {\r\n minWidth = `${this.customCardWidthPx}px`;\r\n }\r\n\r\n return { '--card-min-width': minWidth };\r\n }\r\n\r\n handlePrimaryAction(attachment: IAttachmentDTO): void {\r\n // Se il file può essere visualizzato in anteprima, apri il dialog\r\n if (this.canBePreviewed(attachment)) {\r\n this.openPreviewDialog(attachment);\r\n }\r\n // Altrimenti, esegui l'azione di default (download per file, apri per link)\r\n else {\r\n this.viewAttachment(attachment);\r\n }\r\n }\r\n\r\n /**\r\n * Determines if an attachment can be previewed in the dialog.\r\n * @param att The attachment to check.\r\n * @returns `true` if a preview is available, otherwise `false`.\r\n */\r\n canBePreviewed(att: IAttachmentDTO): boolean {\r\n if (!att) {\r\n return false;\r\n }\r\n\r\n // Case 1: It's an image with Base64 data.\r\n const isPreviewableImage = att.IsImage && !!att.FileDataBase64;\r\n\r\n // Case 2: It's a PDF with Base64 data.\r\n const isPreviewablePdf = att.FileContentType === 'application/pdf' && !!att.FileDataBase64;\r\n\r\n // Case 3: It's a remote document with a URL (for Google Viewer).\r\n const isRemoteDocument = !att.IsImage && !!att.FilePath && !!this.productionBaseUrl;\r\n\r\n // A preview is possible if any of these conditions are true.\r\n return isPreviewableImage || isPreviewablePdf || isRemoteDocument;\r\n }\r\n}\r\n","<!-- Se richiesta la gestione singola mostra il pulsante di caricamento di un singolo file -->\r\n<div class=\"header\">\r\n <h1>{{ uploadTitle }}</h1>\r\n @if(chooseView == true){\r\n <mat-button-toggle-group [value]=\"viewMode\" (change)=\"setViewMode($event.value)\"\r\n aria-label=\"Modalità di visualizzazione\">\r\n <mat-button-toggle value=\"card\"><mat-icon>grid_view</mat-icon></mat-button-toggle>\r\n <mat-button-toggle value=\"table\"><mat-icon>view_list</mat-icon></mat-button-toggle>\r\n </mat-button-toggle-group>\r\n }\r\n</div>\r\n\r\n<!-- Gestione singolo -->\r\n@if (multipleAttachment != true) {\r\n@if (!singleAttachmentDragAndDrop) {\r\n@if (!addingLinkMode) {\r\n<div class=\"text-center\">\r\n <ng-container [ngTemplateOutlet]=\"addAttachmentButton\"></ng-container>\r\n</div>\r\n} @else {\r\n<div class=\"text-center\">\r\n <ng-container [ngTemplateOutlet]=\"addingLinkTemplate\"></ng-container>\r\n</div>\r\n}\r\n} @else {\r\n<input #fileInput id=\"file_attachment\" name=\"file_attachment\" type=\"file\" hidden (change)=\"onFileAdded($event)\"\r\n [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n\r\n@if (allowedTypes && allowedTypes.includes(1) && (!attachmentsList || attachmentsList.length == 0 ||\r\n(attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n<div class=\"dropbox\" [class.dragover]=\"dragOver\" (dragover)=\"dragOver = true; $event.preventDefault()\"\r\n (dragleave)=\"dragOver = false\" (drop)=\"dragOver = false; fileDropped($event)\"\r\n (click)=\"onSelectFile($event, fileInput)\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"fileInput.click()\"\r\n (keydown.space)=\"fileInput.click()\">\r\n <div class=\"dropbox-icon\">📁</div>\r\n <div class=\"dropbox-text\">{{ dropHereLabel }}</div>\r\n <div class=\"dropbox-subtext\">\r\n {{ supportedFormatsLabel }}\r\n </div>\r\n <button class=\"browse-btn\" type=\"button\" (click)=\"$event.stopPropagation(); fileInput.click()\">\r\n {{ browseFilesLabel }}\r\n </button>\r\n <div class=\"secondary-action\">\r\n @if (allowedTypes.includes(2) || allowedTypes.includes(3)) {\r\n @if (allowedTypes.includes(2) && allowedTypes.includes(3)) {\r\n <a class=\"secondary-action-link\" [matMenuTriggerFor]=\"isDisabled ? null : linkMenu\"\r\n [class.disabled-link]=\"isDisabled\" (click)=\"$event.stopPropagation()\">\r\n o aggiungi da web\r\n </a>\r\n <mat-menu #linkMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"switchToAddingLinkMode()\">\r\n <mat-icon>link</mat-icon>\r\n <span>Aggiungi da link</span>\r\n </button>\r\n <button mat-menu-item (click)=\"chooseDropboxFile()\">\r\n <mat-icon>cloud_queue</mat-icon>\r\n <span>Carica da Dropbox</span>\r\n </button>\r\n </mat-menu>\r\n }\r\n\r\n @else if (allowedTypes.includes(2)) {\r\n <a [class.disabled-link]=\"isDisabled\" class=\"secondary-action-link\"\r\n (click)=\"$event.stopPropagation(); switchToAddingLinkMode()\">\r\n aggiungi un link\r\n </a>\r\n }\r\n\r\n @else if (allowedTypes.includes(3)) {\r\n <a [class.disabled-link]=\"isDisabled\" class=\"secondary-action-link\"\r\n (click)=\"$event.stopPropagation(); chooseDropboxFile()\">\r\n carica da Dropbox\r\n </a>\r\n }\r\n }\r\n </div>\r\n</div>\r\n}\r\n}\r\n\r\n<!-- Azioni singolo elemento (come prima) -->\r\n<div class=\"text-center\">\r\n @if (attachmentsList && attachmentsList.length > 0 && attachmentsList[0]) {\r\n <button class=\"mb-2 me-2 eqp-attachments-download-btn\" (click)=\"viewAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\">\r\n @if (attachmentsList[0].AttachmentType == AttachmentType.FILE) {\r\n <mat-icon>download</mat-icon>\r\n } @else {\r\n <mat-icon>open_in_new</mat-icon>\r\n }\r\n {{ attachmentsList[0].AttachmentType == AttachmentType.FILE ? downloadLabel : openLinkLabel }}\r\n </button>\r\n\r\n @if (showPreview && (!attachmentsList[0].FileContentType || (!attachmentsList[0].FileContentType.startsWith('video')\r\n && !attachmentsList[0].FileContentType.startsWith('audio'))) && attachmentsList[0].IsImage == true) {\r\n <button class=\"mb-2 me-2 eqp-attachments-preview-btn\" (click)=\"openPreviewDialog(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\">\r\n <mat-icon>visibility</mat-icon> {{ previewLabel }}\r\n </button>\r\n }\r\n\r\n <button [disabled]=\"disableAction\" class=\"mb-2 eqp-attachments-delete-btn\"\r\n (click)=\"deleteAttachment(attachmentsList[0])\" type=\"button\" mat-raised-button [disabled]=\"isDisabled\">\r\n <mat-icon>delete</mat-icon> {{ deleteLabel }}\r\n </button>\r\n }\r\n</div>\r\n}\r\n\r\n<!-- Gestione multipla -->\r\n@if (multipleAttachment == true) {\r\n<input #fileInput id=\"file_attachment_multi\" name=\"file_attachment_multi\" type=\"file\" hidden\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n\r\n<div class=\"dropbox\" [class.dragover]=\"dragOver\" (dragover)=\"dragOver = true; $event.preventDefault()\"\r\n (dragleave)=\"dragOver = false\" (drop)=\"dragOver = false; fileDropped($event)\"\r\n (click)=\"onSelectFile($event, fileInput)\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"fileInput.click()\"\r\n (keydown.space)=\"fileInput.click()\">\r\n <div class=\"dropbox-icon\">📁</div>\r\n <div class=\"dropbox-text\">{{ dropHereLabel }}</div>\r\n <div class=\"dropbox-subtext\">\r\n {{ supportedFormatsLabel }}\r\n </div>\r\n <button class=\"browse-btn\" type=\"button\" (click)=\"$event.stopPropagation(); fileInput.click()\">\r\n {{ browseFilesLabel }}\r\n </button>\r\n @if (allowedTypes.includes(2)) {\r\n <div class=\"secondary-action-link\">\r\n o <a (click)=\"$event.stopPropagation(); switchToAddingLinkMode()\">aggiungi un link</a>\r\n </div>\r\n }\r\n</div>\r\n}\r\n\r\n@if (attachmentsList?.length > 0 && showSummary) {\r\n<div class=\"upload-stats\">\r\n\r\n <div class=\"stats-info\">\r\n <div class=\"stat-item\">\r\n <div class=\"stat-value\">{{ attachmentsList?.length }}</div>\r\n <div class=\"stat-label\">{{ filesLabel }}</div>\r\n </div>\r\n <div class=\"stat-item\">\r\n <div class=\"stat-value\">{{ totalSizeFormatted }}</div>\r\n <div class=\"stat-label\">{{ totalSizeLabel }}</div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"progress-bar\">\r\n <div class=\"progress-fill\" [style.width.%]=\"progressPercent\"></div>\r\n </div>\r\n\r\n</div>\r\n} @else if(attachmentsList?.length == 0){\r\n<div class=\"empty-state\">{{ emptyStateLabel }}</div>\r\n}\r\n\r\n<!-- Griglia anteprime card (vale per singolo e multiplo) -->\r\n@if (viewMode === 'card') {\r\n\r\n<div class=\"file-previews\" [ngStyle]=\"getPreviewsContainerStyle()\">\r\n @for (att of attachmentsList; track att.ID) {\r\n <div [ngClass]=\"getCardClass(att)\">\r\n <div class=\"preview-img-container\" (click)=\"!att.isUploading && handlePrimaryAction(att)\">\r\n\r\n @if (att.IsImage) {\r\n <img class=\"preview-img\"\r\n [src]=\"'data:' + att.FileContentType + ';base64,' + (att.FileThumbnailBase64 || att.FileDataBase64)\"\r\n [alt]=\"att.FileName\" /> } @else {\r\n <div class=\"file-icon\"><i [ngClass]=\"getAttachmentIcon(att)\"></i></div>\r\n }\r\n\r\n <div class=\"preview-action-overlay\">\r\n @if (att.IsImage && canBePreviewed(att)) {\r\n } @else if (att.FileContentType === 'application/pdf' && canBePreviewed(att)) {\r\n <mat-icon>open_in_new</mat-icon>\r\n } @else if (att.AttachmentType === AttachmentType.FILE) {\r\n <mat-icon>download</mat-icon>\r\n } @else {\r\n <mat-icon>open_in_new</mat-icon>\r\n }\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"file-info\">\r\n <div class=\"file-name\" [title]=\"att.FileName\">{{ att.FileName }}</div>\r\n </div>\r\n\r\n @if(!disableAction){\r\n <button mat-icon-button class=\"remove-btn\" type=\"button\" aria-label=\"Rimuovi allegato\"\r\n (click)=\"deleteAttachment(att)\" [disabled]=\"att.isUploading\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (att.isUploading) {\r\n <div class=\"upload-spinner\"></div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n} @else if(viewMode === 'table' && attachmentsList?.length > 0) {\r\n\r\n<div class=\"table-view-container\">\r\n <div class=\"table-header\">\r\n <div class=\"table-cell name-col\">File</div>\r\n <div class=\"table-cell actions-col\">Azioni</div>\r\n </div>\r\n\r\n @for (att of attachmentsList; track att.ID) {\r\n <div class=\"table-row\">\r\n <div class=\"table-cell name-col\">\r\n <i class=\"file-icon-small\" [ngClass]=\"getAttachmentIcon(att)\"></i>\r\n <div class=\"file-info-text\">\r\n <span class=\"file-name-table\">{{ att.FileName }}</span>\r\n <span class=\"file-type-table\">{{ att.FileExtension || 'Link' }}</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-cell actions-col\">\r\n <button mat-icon-button (click)=\"viewAttachment(att)\" matTooltip=\"Visualizza/Scarica\">\r\n <mat-icon>{{ att.AttachmentType === attachmentType.FILE ? 'download' : 'open_in_new' }}</mat-icon>\r\n </button>\r\n <button mat-icon-button [matMenuTriggerFor]=\"actionsMenu\" matTooltip=\"Altre opzioni\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #actionsMenu=\"matMenu\">\r\n <button mat-menu-item\r\n (click)=\"openPreviewDialog(att)\"><mat-icon>visibility</mat-icon><span>Anteprima</span></button>\r\n <button [disabled]=\"disableAction\" mat-menu-item (click)=\"deleteAttachment(att)\" matTooltip=\"Elimina\">\r\n <mat-icon color=\"warn\">delete</mat-icon>\r\n <span>Elimina</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n}\r\n\r\n<!-- Notifica toast -->\r\n<div class=\"upload-notification\" [class.show]=\"toast?.visible\" [class.success]=\"toast?.type === 'success'\"\r\n [class.error]=\"toast?.type === 'error'\">\r\n <span>{{ toast?.text }}</span>\r\n <div class=\"notification-progress\"></div>\r\n</div>\r\n\r\n\r\n<ng-template #dialogCropImage>\r\n <div style=\"overflow-x: hidden\" [ngClass]=\"cropDialogClass\">\r\n @if (showCropImage == true) {\r\n <ng-container [ngTemplateOutlet]=\"croppieTemplate\" [ngTemplateOutletContext]=\"{ form: newAttachmentForm }\">\r\n </ng-container>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<ng-template #inlinePreviewTemplate let-row=\"row\">\r\n @if (row.AttachmentType != AttachmentType.LINK && row.IsImage) {\r\n <div class=\"inline-preview-container\" (click)=\"openPreviewDialog(row)\">\r\n <img [src]=\"'data:image/png;base64,' + (row.FileThumbnailBase64 ? row.FileThumbnailBase64 : row.FileDataBase64)\" />\r\n </div>\r\n } @else if (row.AttachmentType != AttachmentType.LINK && !row.IsImage) {\r\n <div class=\"inline-preview-container\" (click)=\"openPreviewDialog(row)\">\r\n <i [ngClass]=\"getAttachmentIcon(row)\"></i>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n<ng-template #dialogPreview>\r\n @if (selectedAttachment) {\r\n <h2 mat-dialog-title class=\"dialog-header\">\r\n <span>\r\n {{ previewLabel }} {{ selectedAttachment!.AttachmentType === attachmentType.FILE ? \"File\" : \"Link\" }}\r\n </span>\r\n <button mat-icon-button mat-dialog-close aria-label=\"Chiudi anteprima\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </h2>\r\n\r\n <mat-dialog-content class=\"dialog-content\">\r\n @if (selectedAttachment!.IsImage) {\r\n <img class=\"preview-image\"\r\n [src]=\"'data:image/png;base64,' + (selectedAttachment!.FileDataBase64 || selectedAttachment!.FileThumbnailBase64)\"\r\n alt=\"Anteprima allegato\" />\r\n } @else {\r\n <iframe class=\"preview-iframe\" [src]=\"selectedAttachment!.TrustedUrl\" [title]=\"selectedAttachment!.FileName\">\r\n </iframe>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions [align]=\"'center'\">\r\n @if (selectedAttachment!.AttachmentType !== AttachmentType.LINK) {\r\n <button mat-raised-button color=\"primary\" (click)=\"viewAttachment(selectedAttachment!)\">\r\n <mat-icon>download</mat-icon>\r\n <span>{{ downloadLabel }}</span>\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n }\r\n</ng-template>\r\n\r\n\r\n<!-- TEMPLATE PER IL PULSANTE DI AGGIUNTA NUOVO ALLEGATO -->\r\n<ng-template #addAttachmentButton>\r\n <input #fileInput style=\"display: none\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n\r\n @if (allowedTypes && allowedTypes.length == 1 && (multipleAttachment == true || !attachmentsList ||\r\n attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n <button class=\"btn btn-primary mb-4 me-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n (click)=\"addFile(allowedTypes[0], fileInput)\" [disabled]=\"isDisabled\">\r\n @if (allowedTypes[0] == 1) { <mat-icon>cloud_upload</mat-icon> }\r\n @if (allowedTypes[0] == 2) { <i class=\"fas fa-link\"></i> }\r\n @if (allowedTypes[0] == 3) { <i class=\"fa-brands fa-dropbox\"></i> }\r\n <span style=\"margin-left: 10px\">\r\n {{ allowedTypes[0] == 1 ? (addButtonLabel + \" file\") : allowedTypes[0] == 2 ? (addButtonLabel + \" link\") :\r\n uploadWithDropboxLabel }}\r\n </span>\r\n </button>\r\n }\r\n\r\n @if (!separatedUploadButtons && allowedTypes && allowedTypes.length > 1 && (multipleAttachment == true ||\r\n !attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n <button class=\"btn btn-primary mb-4 me-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\">\r\n @if (multipleAttachment != true) { <mat-icon>cloud_upload</mat-icon> } @else { <mat-icon>add</mat-icon> }\r\n <span style=\"margin-left: 0px\">{{ addButtonLabel }}</span>\r\n </button>\r\n\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <input #imageInput style=\"display: none\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n @if (allowedTypes.includes(1)) {\r\n <button mat-menu-item (click)=\"imageInput.click()\" 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 }\r\n @if (allowedTypes.includes(2)) {\r\n <button mat-menu-item (click)=\"switchToAddingLinkMode()\" 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 }\r\n @if (allowedTypes.includes(3)) {\r\n <button mat-menu-item (click)=\"chooseDropboxFile()\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fa-brands fa-dropbox\"></i>\r\n <span style=\"margin-left: 10px\">Dropbox</span>\r\n </button>\r\n }\r\n </mat-menu>\r\n }\r\n\r\n @if (separatedUploadButtons && allowedTypes && allowedTypes.length > 1 && (multipleAttachment == true ||\r\n !attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0]))) {\r\n <div class=\"btn-group\">\r\n @if (allowedTypes.includes(1)) {\r\n <button (click)=\"imageInput.click()\" class=\"btn btn-secondary eqp-attachments-add-btn\" mat-raised-button\r\n color=\"secondary\" type=\"button\">\r\n <i class=\"fa-solid fa-cloud-upload\"></i>\r\n <span style=\"margin-left: 10px\">File</span>\r\n </button>\r\n }\r\n <input #imageInput style=\"display: none\" id=\"file_attachment\" name=\"file_attachment\" type=\"file\"\r\n (change)=\"onFileAdded($event)\" [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\" />\r\n @if (allowedTypes.includes(2)) {\r\n <button (click)=\"switchToAddingLinkMode()\" class=\"btn btn-secondary eqp-attachments-add-btn\" mat-raised-button\r\n color=\"secondary\" type=\"button\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px\">Link</span>\r\n </button>\r\n }\r\n @if (allowedTypes.includes(3)) {\r\n <button (click)=\"chooseDropboxFile()\" class=\"btn btn-secondary eqp-attachments-add-btn\" mat-raised-button\r\n color=\"secondary\" type=\"button\">\r\n <i class=\"fa-brands fa-dropbox\"></i>\r\n <span style=\"margin-left: 10px\">Dropbox</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n<ng-template #croppieTemplate>\r\n <!-- Header compatto -->\r\n <h2 class=\"dialog-header m-3\">\r\n <span>{{ cropLabel }}</span>\r\n <button mat-icon-button type=\"button\" aria-label=\"Chiudi\" (click)=\"abortFile()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </h2>\r\n\r\n <!-- Contenuto scrollabile con griglia responsive -->\r\n <div class=\"dialog-content\">\r\n <!-- Toolbar controlli (large) -->\r\n <div class=\"controls-row crop-large\">\r\n @if (cropOptions.includes(1)) {\r\n <button [matTooltip]=\"rotateLeftLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"rotateLeft()\">\r\n <mat-icon>rotate_left</mat-icon>\r\n </button>\r\n <button [matTooltip]=\"rotateRightLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"rotateRight()\">\r\n <mat-icon>rotate_right</mat-icon>\r\n </button>\r\n }\r\n @if (cropOptions.includes(2)) {\r\n <button [matTooltip]=\"flipHorinzontalLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"flipHorizontal()\">\r\n <mat-icon>flip_horizontal</mat-icon>\r\n </button>\r\n <button [matTooltip]=\"flipVerticalLabel\" class=\"btn btn-primary mat-raised-button\" (click)=\"flipVertical()\">\r\n <mat-icon>flip_vertical</mat-icon>\r\n </button>\r\n }\r\n <button [matTooltip]=\"'Reset'\" class=\"btn btn-primary mat-raised-button\" (click)=\"restoreOriginalDimensions()\">\r\n <mat-icon>replay</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <!-- Toolbar controlli (small) -->\r\n <div class=\"controls-row crop-small\">\r\n @if (cropOptions.includes(1)) {\r\n <mat-icon class=\"control-icon\" (click)=\"rotateLeft()\">rotate_left</mat-icon>\r\n <mat-icon class=\"control-icon\" (click)=\"rotateRight()\">rotate_right</mat-icon>\r\n }\r\n @if (cropOptions.includes(2)) {\r\n <mat-icon class=\"control-icon\" (click)=\"flipHorizontal()\">flip_horizontal</mat-icon>\r\n <mat-icon class=\"control-icon\" (click)=\"flipVertical()\">flip_vertical</mat-icon>\r\n }\r\n <mat-icon class=\"control-icon\" (click)=\"restoreOriginalDimensions()\">replay</mat-icon>\r\n </div>\r\n\r\n <!-- Area crop con contenimento -->\r\n <div class=\"crop-area\">\r\n <div class=\"crop-container\">\r\n <image-cropper [imageFile]=\"selectedFile\" [maintainAspectRatio]=\"false\" [autoCrop]=\"false\"\r\n [containWithinAspectRatio]=\"false\" [aspectRatio]=\"4 / 3\" [cropperMinWidth]=\"128\" [onlyScaleDown]=\"true\"\r\n [roundCropper]=\"false\" [canvasRotation]=\"0\" [transform]=\"transform\" [alignImage]=\"'left'\" format=\"png\"\r\n (imageCropped)=\"imageCropped($event)\" [resizeToWidth]=\"customWidth\" [resizeToHeight]=\"customHeight\"\r\n [canvasRotation]=\"canvasRotation\" [output]=\"'base64'\">\r\n </image-cropper>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Azioni -->\r\n <div class=\"dialog-actions crop-large\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-confirm-btn\" type=\"button\"\r\n (click)=\"confirmAddAttachment()\">\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\r\n <div class=\"dialog-actions crop-small\">\r\n <button class=\"icon-action\" type=\"button\" (click)=\"abortFile()\" aria-label=\"Abort\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n <button class=\"icon-action\" type=\"button\" (click)=\"confirmAddAttachment()\" aria-label=\"Confirm\">\r\n <i class=\"fa fa-check\"></i>\r\n </button>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<!-- TEMPLATE PER FORM DI AGGIUNTA DI UN LINK -->\r\n<ng-template #addingLinkTemplate>\r\n <h2 mat-dialog-title>Aggiungi un link</h2>\r\n <mat-dialog-content class=\"add-link-dialog-content\">\r\n <form [formGroup]=\"newAttachmentForm\" class=\"add-link-form\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>URL *</mat-label>\r\n <input matInput formControlName=\"filePath\" placeholder=\"https://...\" required>\r\n @if (newAttachmentForm.get('filePath')?.hasError('pattern')) {\r\n <mat-error>L'URL non sembra valido.</mat-error>\r\n }\r\n </mat-form-field>\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>Nome (opzionale)</mat-label>\r\n <input matInput formControlName=\"fileName\" placeholder=\"Es. Documento Progetto\">\r\n </mat-form-field>\r\n </form>\r\n </mat-dialog-content>\r\n <mat-dialog-actions align=\"end\">\r\n <button mat-button mat-dialog-close>Annulla</button>\r\n <button mat-raised-button color=\"primary\" [mat-dialog-close]=\"newAttachmentForm.value\"\r\n [disabled]=\"newAttachmentForm.invalid\">\r\n Aggiungi\r\n </button>\r\n </mat-dialog-actions>\r\n</ng-template>","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 { ImageCropperComponent } from 'ngx-image-cropper';\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 ImageCropperComponent\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"],"names":["i5.EqpAttachmentService"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMa,uBAAuB,CAAA;AAEhC,IAAA,OAAgB,cAAc,GAAa,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,CAAC;IAE9G,OAAgB,iBAAiB,GAAQ;AACrC,QAAA,KAAK,EAAE,kBAAkB;AACzB,QAAA,KAAK,EAAE,iBAAiB;AACxB,QAAA,KAAK,EAAE,kBAAkB;AACzB,QAAA,MAAM,EAAE,kBAAkB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAE1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,QAAA,KAAK,EAAE,mBAAmB;AAC1B,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