@eqproject/eqp-attachments 0.1.16 → 2.0.0

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.
Files changed (48) hide show
  1. package/README.md +0 -1
  2. package/esm2020/eqproject-eqp-attachments.mjs +5 -0
  3. package/esm2020/lib/eqp-attachments.component.mjs +830 -0
  4. package/esm2020/lib/eqp-attachments.module.mjs +39 -0
  5. package/esm2020/lib/helpers/attachment.helper.mjs +61 -0
  6. package/esm2020/lib/interfaces/IAttachment.mjs +6 -0
  7. package/esm2020/lib/interfaces/IOptions.mjs +2 -0
  8. package/esm2020/lib/modules/material.module.mjs +231 -0
  9. package/esm2020/lib/services/eqp-attachment-dialog.service.mjs +103 -0
  10. package/esm2020/public-api.mjs +10 -0
  11. package/fesm2015/eqproject-eqp-attachments.mjs +1275 -0
  12. package/fesm2015/eqproject-eqp-attachments.mjs.map +1 -0
  13. package/fesm2020/eqproject-eqp-attachments.mjs +1264 -0
  14. package/fesm2020/eqproject-eqp-attachments.mjs.map +1 -0
  15. package/{eqproject-eqp-attachments.d.ts → index.d.ts} +1 -1
  16. package/lib/eqp-attachments.component.d.ts +5 -11
  17. package/lib/eqp-attachments.module.d.ts +10 -0
  18. package/lib/helpers/attachment.helper.d.ts +3 -0
  19. package/lib/modules/material.module.d.ts +35 -0
  20. package/lib/services/eqp-attachment-dialog.service.d.ts +3 -0
  21. package/package.json +29 -16
  22. package/bundles/eqproject-eqp-attachments.umd.js +0 -1409
  23. package/bundles/eqproject-eqp-attachments.umd.js.map +0 -1
  24. package/bundles/eqproject-eqp-attachments.umd.min.js +0 -2
  25. package/bundles/eqproject-eqp-attachments.umd.min.js.map +0 -1
  26. package/eqproject-eqp-attachments.metadata.json +0 -1
  27. package/esm2015/eqproject-eqp-attachments.js +0 -6
  28. package/esm2015/lib/eqp-attachments.component.js +0 -857
  29. package/esm2015/lib/eqp-attachments.module.js +0 -26
  30. package/esm2015/lib/helpers/attachment.helper.js +0 -62
  31. package/esm2015/lib/interfaces/IAttachment.js +0 -6
  32. package/esm2015/lib/interfaces/IOptions.js +0 -1
  33. package/esm2015/lib/modules/material.module.js +0 -108
  34. package/esm2015/lib/services/eqp-attachment-dialog.service.js +0 -104
  35. package/esm2015/public-api.js +0 -9
  36. package/esm5/eqproject-eqp-attachments.js +0 -6
  37. package/esm5/lib/eqp-attachments.component.js +0 -916
  38. package/esm5/lib/eqp-attachments.module.js +0 -29
  39. package/esm5/lib/helpers/attachment.helper.js +0 -63
  40. package/esm5/lib/interfaces/IAttachment.js +0 -6
  41. package/esm5/lib/interfaces/IOptions.js +0 -1
  42. package/esm5/lib/modules/material.module.js +0 -111
  43. package/esm5/lib/services/eqp-attachment-dialog.service.js +0 -113
  44. package/esm5/public-api.js +0 -9
  45. package/fesm2015/eqproject-eqp-attachments.js +0 -1148
  46. package/fesm2015/eqproject-eqp-attachments.js.map +0 -1
  47. package/fesm5/eqproject-eqp-attachments.js +0 -1223
  48. package/fesm5/eqproject-eqp-attachments.js.map +0 -1
@@ -0,0 +1,1275 @@
1
+ import { __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable, EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
4
+ import * as i2 from '@angular/forms';
5
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
6
+ import * as i12 from 'ngx-image-cropper';
7
+ import { base64ToFile, ImageCropperComponent, ImageCropperModule } from 'ngx-image-cropper';
8
+ import imageCompression from 'browser-image-compression';
9
+ import * as i13 from '@eqproject/eqp-table';
10
+ import { TooltipPositionType, TypeColumn, EqpTableModule } from '@eqproject/eqp-table';
11
+ import Swal from 'sweetalert2';
12
+ import * as i1 from '@angular/material/dialog';
13
+ import { MatDialogModule } from '@angular/material/dialog';
14
+ import * as i3 from '@angular/platform-browser';
15
+ import * as i4 from '@angular/common/http';
16
+ import * as i5 from '@angular/material/button';
17
+ import { MatButtonModule } from '@angular/material/button';
18
+ import * as i6 from '@angular/material/form-field';
19
+ import { MatFormFieldModule } from '@angular/material/form-field';
20
+ import * as i7 from '@angular/material/input';
21
+ import { MatInputModule } from '@angular/material/input';
22
+ import * as i8 from '@angular/material/menu';
23
+ import { MatMenuModule } from '@angular/material/menu';
24
+ import * as i9 from '@angular/material/card';
25
+ import { MatCardModule } from '@angular/material/card';
26
+ import * as i10 from '@angular/material/icon';
27
+ import { MatIconModule } from '@angular/material/icon';
28
+ import * as i11 from '@angular/common';
29
+ import { CommonModule } from '@angular/common';
30
+ import { MatCheckboxModule } from '@angular/material/checkbox';
31
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
32
+ import { MatDatepickerModule } from '@angular/material/datepicker';
33
+ import { MatRadioModule } from '@angular/material/radio';
34
+ import { MatSelectModule } from '@angular/material/select';
35
+ import { MatSliderModule } from '@angular/material/slider';
36
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
37
+ import { MatSidenavModule } from '@angular/material/sidenav';
38
+ import { MatToolbarModule } from '@angular/material/toolbar';
39
+ import { MatListModule } from '@angular/material/list';
40
+ import { MatGridListModule } from '@angular/material/grid-list';
41
+ import { MatStepperModule } from '@angular/material/stepper';
42
+ import { MatTabsModule } from '@angular/material/tabs';
43
+ import { MatExpansionModule } from '@angular/material/expansion';
44
+ import { MatButtonToggleModule } from '@angular/material/button-toggle';
45
+ import { MatChipsModule } from '@angular/material/chips';
46
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
47
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
48
+ import { MatTooltipModule } from '@angular/material/tooltip';
49
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
50
+ import { MatTableModule } from '@angular/material/table';
51
+ import { MatSortModule } from '@angular/material/sort';
52
+ import { MatPaginatorModule } from '@angular/material/paginator';
53
+ import { MatNativeDateModule } from '@angular/material/core';
54
+
55
+ var AttachmentType;
56
+ (function (AttachmentType) {
57
+ AttachmentType[AttachmentType["FILE"] = 1] = "FILE";
58
+ AttachmentType[AttachmentType["LINK"] = 2] = "LINK";
59
+ })(AttachmentType || (AttachmentType = {}));
60
+
61
+ class AttachmentHelperService {
62
+ constructor() { }
63
+ /**
64
+ * Restituisce TRUE se il mime type passato nel parametro corrisponde ad un mime type di un'immagine
65
+ * @param mimeType Mime Type da verificare
66
+ */
67
+ static checkImageFromMimeType(mimeType) {
68
+ return this.imageMimeTypes.find(s => s == mimeType) != null;
69
+ }
70
+ /**
71
+ * In base all'estensione passata come parametro, restituisce la FontAwesome corretta da utilizzare.
72
+ * Se l'estensione non viene trovata nella costante riportata dentro common.model.ts restituisce un icona standard
73
+ * @param extension Estensione del file per cui restituire l'icona corretta
74
+ */
75
+ static getIconFromFileExtensione(extension) {
76
+ let fileIcon = this.fileExtensionIcon[extension];
77
+ return fileIcon !== null && fileIcon !== void 0 ? fileIcon : "fas fa-file";
78
+ }
79
+ }
80
+ AttachmentHelperService.imageMimeTypes = ["image/bmp", "image/gif", "image/jpeg", "image/tiff", "image/png"];
81
+ AttachmentHelperService.fileExtensionIcon = {
82
+ "txt": "fas fa-file-text",
83
+ "pdf": "fas fa-file-pdf",
84
+ "doc": "fas fa-file-word",
85
+ "docx": "fas fa-file-word",
86
+ "xls": "fas fa-file-excel",
87
+ "xlsx": "fas fa-file-excel",
88
+ "jpg": "fas fa-file-image",
89
+ "jpeg": "fas fa-file-image",
90
+ "png": "fas fa-file-image",
91
+ "bmp": "fas fa-file-image",
92
+ "mkv": "fas fa-file-video",
93
+ "flv": "fas fa-file-video",
94
+ "gif": "fas fa-file-video",
95
+ "gifv": "fas fa-file-video",
96
+ "avi": "fas fa-file-video",
97
+ "wmv": "fas fa-file-video",
98
+ "mp4": "fas fa-file-video",
99
+ "m4p": "fas fa-file-video",
100
+ "m4v": "fas fa-file-video",
101
+ "mpg": "fas fa-file-video",
102
+ "mp2": "fas fa-file-video",
103
+ "mpeg": "fas fa-file-video",
104
+ "mpe": "fas fa-file-video",
105
+ "mpv": "fas fa-file-video",
106
+ "m2v": "fas fa-file-video",
107
+ "3gp": "fas fa-file-video",
108
+ "3g2": "fas fa-file-video",
109
+ "mp3": "fas fa-file-audio",
110
+ };
111
+ AttachmentHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AttachmentHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
112
+ AttachmentHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AttachmentHelperService, providedIn: 'root' });
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AttachmentHelperService, decorators: [{
114
+ type: Injectable,
115
+ args: [{
116
+ providedIn: 'root'
117
+ }]
118
+ }], ctorParameters: function () { return []; } });
119
+
120
+ class EqpAttachmentDialogService {
121
+ constructor() { }
122
+ /**
123
+ * Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
124
+ * @param message Messaggio d'errore da mostrare nello sweetalert
125
+ * @param title Titolo dello sweetalert (di default mostra 'Errore')
126
+ */
127
+ static Error(message, title = null) {
128
+ let currentTitle = title != null ? title : 'Errore';
129
+ if (Array.isArray(message)) {
130
+ currentTitle = title != null ? title : 'Errore';
131
+ let htmlErrors = message.join("<br>");
132
+ Swal.fire({
133
+ title: currentTitle,
134
+ html: htmlErrors,
135
+ icon: 'error'
136
+ });
137
+ }
138
+ else {
139
+ Swal.fire(currentTitle, message, 'error');
140
+ }
141
+ }
142
+ /**
143
+ * Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
144
+ * CONFERMA lancia la funzione di callback passata come parametro
145
+ * @param message Messaggio da mostrare nello sweetalert
146
+ * @param title Titolo dello sweetalert (di default mostra 'Info')
147
+ */
148
+ static Confirm(message, confirmCallback, isWarning = false, title = null, customWidth = null) {
149
+ let currentTitle = title != null ? title : 'Sei sicuro di voler procedere?';
150
+ if (Array.isArray(message)) {
151
+ let htmlErrors = message.join("<br>");
152
+ Swal.fire({
153
+ title: currentTitle,
154
+ html: htmlErrors,
155
+ width: customWidth ? customWidth : '32rem',
156
+ icon: !isWarning ? 'question' : 'warning',
157
+ showCancelButton: true,
158
+ allowOutsideClick: false,
159
+ allowEscapeKey: false
160
+ }).then((result) => {
161
+ if (result.value && confirmCallback) {
162
+ confirmCallback();
163
+ }
164
+ });
165
+ }
166
+ else {
167
+ Swal.fire({
168
+ title: currentTitle,
169
+ text: message,
170
+ width: customWidth ? customWidth : '32rem',
171
+ icon: !isWarning ? 'question' : 'warning',
172
+ showCancelButton: true,
173
+ allowOutsideClick: false,
174
+ allowEscapeKey: false
175
+ }).then((result) => {
176
+ if (result.value && confirmCallback) {
177
+ confirmCallback();
178
+ }
179
+ });
180
+ }
181
+ }
182
+ /**
183
+ * Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
184
+ * @param message Messaggio da mostrare nello sweetalert
185
+ * @param title Titolo dello sweetalert (di default mostra 'Info')
186
+ */
187
+ static Info(message, title = null, isToast = null) {
188
+ let currentTitle = title != null ? title : "Informazione:";
189
+ Swal.fire(currentTitle, message, 'info');
190
+ }
191
+ /**
192
+ * Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
193
+ * @param message Messaggio da mostrare nello sweetalert
194
+ * @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
195
+ */
196
+ static Warning(message, title = null, isToast = null) {
197
+ let currentTitle = title != null ? title : "Attenzione!";
198
+ if (Array.isArray(message)) {
199
+ let htmlWarnings = message.join("<br>");
200
+ Swal.fire({
201
+ title: currentTitle,
202
+ html: htmlWarnings,
203
+ icon: 'warning'
204
+ });
205
+ }
206
+ else {
207
+ Swal.fire(currentTitle, message, 'warning');
208
+ }
209
+ }
210
+ }
211
+ EqpAttachmentDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
212
+ EqpAttachmentDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentDialogService, providedIn: 'root' });
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentDialogService, decorators: [{
214
+ type: Injectable,
215
+ args: [{
216
+ providedIn: 'root'
217
+ }]
218
+ }], ctorParameters: function () { return []; } });
219
+
220
+ const toBase64 = file => new Promise((resolve, reject) => {
221
+ const reader = new FileReader();
222
+ reader.readAsDataURL(file);
223
+ reader.onload = () => resolve(reader.result.toString());
224
+ reader.onerror = error => reject(error);
225
+ });
226
+ class EqpAttachmentsComponent {
227
+ constructor(dialog, formBuilder, sanitizer, http, cd) {
228
+ this.dialog = dialog;
229
+ this.formBuilder = formBuilder;
230
+ this.sanitizer = sanitizer;
231
+ this.http = http;
232
+ this.cd = cd;
233
+ //#region @Input del componente
234
+ /**
235
+ * Se TRUE allora nasconde la colonna per le azioni sull'allegato (nel caso "multipleAttachment" è TRUE).
236
+ */
237
+ this.disableAction = false;
238
+ /**
239
+ * Se TRUE mostra il titolo nell'header nel caso in cui "multipleAttachment" è TRUE ("Elenco allegati" di default).
240
+ */
241
+ this.showHeader = true;
242
+ /**
243
+ * Titolo da visualizzare se il parametro "showHeader" è TRUE. Di devault viene visualizzato "Elenco allegati".
244
+ */
245
+ this.headerTitle = "Elenco allegati";
246
+ /**
247
+ * Sorgente dati da visualizzare. Nel caso si vuole gestire un singolo allegato va passato in ogni caso come Array.
248
+ */
249
+ this.attachmentsList = null;
250
+ /**
251
+ * Se TRUE non mostra la MatCard (nel caso in cui "multipleAttachment" è TRUE).
252
+ */
253
+ this.showMatCard = true;
254
+ /**
255
+ * 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".
256
+ * Se TRUE allora il componente mostra l'elenco di tutti gli allegati ricevuto nel parametro "attachmentsList".
257
+ */
258
+ this.multipleAttachment = true;
259
+ /**
260
+ * Se assume il valore TRUE allora sarà possibile caricare più file per volta. Questa funzionalità è attiva
261
+ * SOLO se si gestiscono allegati multipli, quindi se l'input 'multipleAttachment' assume il valore TRUE, altrimenti è sempre disabilitata.
262
+ */
263
+ this.loadMultipleFiles = false;
264
+ /**
265
+ * Configurazione delle colonne della eqp-table per la visualizzazione degli allegati (caso "multipleAttachment" è TRUE).
266
+ */
267
+ this.attachmentsColumns = null;
268
+ /**
269
+ * Imposta il messaggio da visualizzare nel caso in cui la tabella degli allegati (nel caso in cui "multipleAttachment" è TRUE) è vuota.
270
+ */
271
+ this.emptyTableMessage = "Nessun dato trovato";
272
+ /**
273
+ * Se TRUE allora permette di selezionare soltanto file di tipo immagine, avente uno dei mimetype
274
+ * specificati dentro AttachmentHelperService.
275
+ * Se FALSE permette di selezionare qualsiasi tipo di file
276
+ */
277
+ this.allowOnlyImages = false;
278
+ /**
279
+ * Se TRUE disabilita il pulsante di Aggiunta allegato (a prescindere dal valore del parametro "multipleAttachment").
280
+ */
281
+ this.isDisabled = false;
282
+ /**
283
+ * Mostra/nasconde la colonna per visualizzare l'anteprima dei file nella tabella (caso multipleAtatchments = true).
284
+ */
285
+ this.showInlinePreview = false;
286
+ /**
287
+ * Endpoint da chiamare per recueprare l'IAttachmentDTO completo da vedere nell'anteprima. La chiamata sarà in POST e nel body
288
+ * conterrà l'IAttachmentDTO selezionato dall'utente.
289
+ * La chiamata viene eseguita solo per l'anteprima delle immagini essendo necessario il base64 completo dell'immagine a dimensione reale.
290
+ * Per documenti/link basta che sia popolata la proprietà FilePath di IAttachmentDTO.
291
+ */
292
+ this.getAttachmentEndpoint = null;
293
+ /**
294
+ * Hostname dell'ambiente di produzione dell'applicativo. Necessario per visualizzare l'anteprima dei documenti
295
+ * tramite il viewer di google.
296
+ * NOTA: Per visualizzare l'anteprima è necessario che la prorietà FilePath dell'IAttachmentDTO sia popolata e che
297
+ * sia abilitato l'accesso alla cartella sul server tramite hostname.
298
+ */
299
+ this.productionBaseUrl = null;
300
+ /**
301
+ * Opzioni per la compressione delle immagini caricate.
302
+ */
303
+ this.compressionOptions = { maxSizeMB: 0.5, maxWidthOrHeight: 1920, useWebWorker: true };
304
+ /**
305
+ * Array di AttachmentType che si possono aggiungere
306
+ */
307
+ this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK];
308
+ /**
309
+ * Permette di stabilire se la eqp-table contenente l'elenco degli allegati utilizza
310
+ * il multilingua oppure no
311
+ */
312
+ this.isEqpTableMultiLanguage = false;
313
+ /**
314
+ * Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco
315
+ * degli allegati deve essere paginata oppure no
316
+ */
317
+ this.tablePaginatorVisible = true;
318
+ /**
319
+ * In caso di gestione allegati multipli, permette di stabilire la dimensione pagina di default
320
+ * per la tabella contenente l'elenco degli allegati
321
+ */
322
+ this.tablePaginatorSize = null;
323
+ /**
324
+ * Input per definire le label da usare nel componente
325
+ */
326
+ this.downloadTooltipPosition = TooltipPositionType.Below;
327
+ this.openLinkLabel = "Apri link";
328
+ this.addButtonLabel = "Aggiungi";
329
+ this.downloadLabel = "Download";
330
+ this.deleteLabel = "Elimina";
331
+ this.fileNameLabel = "Nome file";
332
+ this.previewLabel = "Anteprima";
333
+ this.uploadFileLabel = "Carica file";
334
+ this.confirmLabel = "Conferma";
335
+ this.abortLabel = "Annulla";
336
+ this.saveLabel = "Salva";
337
+ this.exitLabel = "Esci";
338
+ this.eqpTableSearchText = "Cerca";
339
+ this.deleteDialogTitle = null;
340
+ this.deleteDialogMessage = "Sei sicuro di voler cancellare quest'allegato?";
341
+ this.noImageSelectedErrorMessage = "Non è possibile selezionare un file che non sia un'immagine.";
342
+ this.wrongTypeSelectedErrorMessage = "Non è possibile caricare il file selezionato.";
343
+ this.videoPreviewErrorMessage = "Impossibile aprire l'anteprima di un file video.";
344
+ this.audioPreviewErrorMessage = "Impossibile aprire l'anteprima di un file audio.";
345
+ //#endregion
346
+ //#region @Output del componente
347
+ /**
348
+ * Restituisce la lista aggiornata degli allegati.
349
+ */
350
+ this.localEditedAttachments = new EventEmitter();
351
+ /**
352
+ * Evento scatenato alla pressione del pulsante ESCI della modale di caricamento file.
353
+ */
354
+ this.abortAddAttachment = new EventEmitter();
355
+ /**
356
+ * Evento di output che restituisce l'IAttachmentDTO selezionato per il download nel caso FileDataBase64, FileContentType o FileName non fossero specificati.
357
+ */
358
+ this.downloadAttachment = new EventEmitter();
359
+ /**
360
+ * Evento di output che restituisce l'elemento eliminato prima che questo venga effettivamente rismosso dalla lista.
361
+ */
362
+ this.onDeleteAttachment = new EventEmitter();
363
+ //#endregion
364
+ //#region Proprietà per gestione caricamento nuovo allegato
365
+ this.newAttachment = {};
366
+ this.newMultipleAttachments = [];
367
+ this.attachmentType = AttachmentType;
368
+ this.selectedFile = null;
369
+ this.selectedFiles = null;
370
+ this.showCropImage = false;
371
+ //#endregion
372
+ //#region Proprietà per gestione ridimensionamento file di tipo image
373
+ this.imageChangedEvent = '';
374
+ this.croppedImage = '';
375
+ this.transform = {};
376
+ //#endregion
377
+ this.AttachmentType = AttachmentType;
378
+ }
379
+ ngOnInit() {
380
+ //Se è stata richiesta la gestione delle sole immagini allora imposta il filtro per le estensioni possibili da caricare
381
+ if (!this.acceptedFileTypes)
382
+ if (this.allowOnlyImages == true)
383
+ this.acceptedFileTypes = "image/*";
384
+ else
385
+ this.acceptedFileTypes = "*";
386
+ // Se non sono stati specificati i tipi da gestire ma è stato passato null o un array vuoto imposto i tipi di default.
387
+ if (!this.allowedTypes || this.allowedTypes.length == 0)
388
+ this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK];
389
+ else if (this.allowedTypes.find(t => t != AttachmentType.FILE && t != AttachmentType.LINK)) {
390
+ EqpAttachmentDialogService.Warning("Almeno uno degli AttachmentType selezionati nel parametro \"allowedTypes\" non esiste.");
391
+ this.allowedTypes = [AttachmentType.FILE, AttachmentType.LINK];
392
+ }
393
+ //Se è stata richiesta la gestione multipla degli allegati allora configura l'eqp-table
394
+ if (this.multipleAttachment == true && (!this.attachmentsColumns || this.attachmentsColumns.length == 0)) {
395
+ this.configureColumns();
396
+ }
397
+ if (this.attachmentsList == null)
398
+ this.attachmentsList = new Array();
399
+ this.checkAttachmentImage();
400
+ }
401
+ reloadData() {
402
+ if (this.attachmentTable)
403
+ this.attachmentTable.reloadDatatable();
404
+ }
405
+ checkAttachmentImage() {
406
+ this.attachmentsList.forEach(a => {
407
+ a.IsImage = AttachmentHelperService.checkImageFromMimeType(a.FileContentType);
408
+ });
409
+ }
410
+ //#region Gestione elenco allegati
411
+ /**
412
+ * Configura le colonne per l'eqp-table nel caso in cui il parametro "multipleAttachments" è TRUE.
413
+ */
414
+ configureColumns() {
415
+ this.attachmentsColumns = [];
416
+ if (this.disableAction != true) {
417
+ this.attachmentsColumns.push({
418
+ key: "action", display: "",
419
+ type: TypeColumn.MenuAction, buttonMenuIcon: "more_vert", styles: { flex: "0 0 6%" },
420
+ actions: [
421
+ { name: this.deleteLabel, icon: "delete", fn: (element, index, col) => this.deleteAttachment(element) },
422
+ ],
423
+ });
424
+ }
425
+ let downloadColumn = {
426
+ key: "attachment", display: "",
427
+ type: TypeColumn.SimpleAction, styles: { flex: "0 0 6%" },
428
+ actions: [
429
+ {
430
+ name: '', fontawesome: true,
431
+ icon: (element) => { return this.showInlinePreview ? (element.AttachmentType == AttachmentType.FILE ? "fas fa-cloud-download-alt" : "fas fa-external-link-alt") : this.getAttachmentIcon(element); },
432
+ fn: (element, col, elementIndex) => this.viewAttachment(element),
433
+ tooltip: { tooltipText: (element) => { return element.AttachmentType == AttachmentType.FILE ? this.downloadLabel : this.openLinkLabel; }, tooltipPosition: this.downloadTooltipPosition }
434
+ },
435
+ ]
436
+ };
437
+ let inlinePreviewColumn = {
438
+ key: "InlinePreview", display: this.previewLabel,
439
+ type: TypeColumn.ExternalTemplate,
440
+ externalTemplate: this.inlinePreviewTemplate,
441
+ styles: { flex: "0 0 10%" }
442
+ };
443
+ let fileNameColumn = { key: "FileName", display: this.fileNameLabel };
444
+ if (this.showInlinePreview) {
445
+ this.attachmentsColumns.push(inlinePreviewColumn);
446
+ this.attachmentsColumns.push(fileNameColumn);
447
+ this.attachmentsColumns.push(downloadColumn);
448
+ }
449
+ else {
450
+ this.attachmentsColumns.push(downloadColumn);
451
+ this.attachmentsColumns.push(fileNameColumn);
452
+ }
453
+ }
454
+ /**
455
+ * Elimina un allegato eliminando anche il file presente nello storage di archiviazione utilizzato (AWS o cartella progetto)
456
+ * @param element IAttachmentDTO da cancellare
457
+ */
458
+ deleteAttachment(element) {
459
+ EqpAttachmentDialogService.Confirm(this.deleteDialogMessage, () => {
460
+ this.removeAttachmentFromList(this.attachmentsList.indexOf(element));
461
+ }, true, this.deleteDialogTitle);
462
+ }
463
+ /**
464
+ * Rimuove l'allegato selezionato dalla lista "attachmentsList" e invoca l'evento di output che restituisce la lista aggiornata.
465
+ * @param attachmentIndex Indice dell'attachment da rimuovere
466
+ */
467
+ removeAttachmentFromList(attachmentIndex) {
468
+ this.onDeleteAttachment.emit(this.attachmentsList[attachmentIndex]);
469
+ this.attachmentsList.splice(attachmentIndex, 1);
470
+ if (this.attachmentTable)
471
+ this.attachmentTable.reloadDatatable();
472
+ this.localEditedAttachments.emit(this.attachmentsList);
473
+ }
474
+ /**
475
+ * Scarica l'allegato o apre il link
476
+ * @param element Allegato da mostrare
477
+ */
478
+ viewAttachment(attachment) {
479
+ if (attachment.AttachmentType == AttachmentType.LINK) {
480
+ window.open(attachment.FilePath, '_blank');
481
+ return;
482
+ }
483
+ if (attachment.FileDataBase64 && attachment.FileContentType && attachment.FileName) {
484
+ let source = `data:${attachment.FileContentType};base64,${attachment.FileDataBase64}`;
485
+ const link = document.createElement("a");
486
+ link.href = source;
487
+ link.download = `${attachment.FileName}`;
488
+ link.click();
489
+ }
490
+ else {
491
+ this.downloadAttachment.emit(attachment);
492
+ }
493
+ }
494
+ /**
495
+ * Ridefinisce l'icona da mostrare nella colonna dell'eqp-table per ogni file.
496
+ * L'icona varia in base all'estensione del file
497
+ * @param attachment
498
+ */
499
+ getAttachmentIcon(attachment) {
500
+ if (attachment.AttachmentType == AttachmentType.LINK)
501
+ return "fas fa-link";
502
+ else
503
+ return AttachmentHelperService.getIconFromFileExtensione(attachment.FileExtension);
504
+ }
505
+ //#endregion
506
+ /**
507
+ * Apre la modale per la definizione dei parametri del nuovo file
508
+ */
509
+ openModalAddAttachment(attachmentType) {
510
+ //Se è stato richiesto il caricamento di un LINK o è impostato il caricamento di FILE SINGOLO allora apre la modale per
511
+ //il caricamento singolo del file altrimenti apre quella per il caricamento multiplo
512
+ // if (attachmentType == AttachmentType.LINK || (attachmentType == AttachmentType.FILE && this.loadMultipleFiles != true)) {
513
+ this.newAttachment = {};
514
+ this.newAttachment.IsImage = false;
515
+ this.newAttachment.AttachmentType = attachmentType;
516
+ this.newMultipleAttachments = new Array();
517
+ if (attachmentType == AttachmentType.LINK)
518
+ this.newMultipleAttachments.push(this.newAttachment);
519
+ this.createAttachmentForm();
520
+ //Apre la modale
521
+ this.dialofRefAddAttachment = this.dialog.open(this.dialogAddAttachment, {
522
+ disableClose: true,
523
+ hasBackdrop: true,
524
+ width: '60%',
525
+ maxHeight: '80%'
526
+ });
527
+ }
528
+ createAttachmentForm() {
529
+ //Crea la form per la validazione dei campi
530
+ this.newAttachmentForm = this.formBuilder.group({
531
+ type: [this.newAttachment.AttachmentType, Validators.required],
532
+ name: [this.newAttachment.FileName],
533
+ path: [this.newAttachment.FilePath],
534
+ customHeight: [this.customHeight],
535
+ customWidth: [this.customWidth]
536
+ });
537
+ }
538
+ close(emitCloseEvent = true) {
539
+ this.newAttachment = {};
540
+ this.newMultipleAttachments = new Array();
541
+ this.abortFile();
542
+ if (this.newAttachmentForm)
543
+ this.newAttachmentForm.reset();
544
+ this.dialofRefAddAttachment.close();
545
+ if (emitCloseEvent == true && this.abortAddAttachment)
546
+ this.abortAddAttachment.emit();
547
+ }
548
+ /**
549
+ * In base al tipo di allegato controlla se disabilitare o meno il pulsante per salvare.
550
+ * Funzione usata nel [disable] del pulsante "Salva" del dialog per l'aggiunta di un allegato.
551
+ * @returns
552
+ */
553
+ disableSave() {
554
+ if (this.loadMultipleFiles != true) {
555
+ if (this.newAttachment.AttachmentType == AttachmentType.FILE) {
556
+ return !this.newAttachment.FileDataBase64;
557
+ }
558
+ else {
559
+ return !this.newAttachment.FilePath;
560
+ }
561
+ }
562
+ else {
563
+ return this.newMultipleAttachments.filter(p => (p.AttachmentType == AttachmentType.FILE && !p.FileDataBase64) || (p.AttachmentType == AttachmentType.LINK && !p.FilePath)).length > 0;
564
+ }
565
+ }
566
+ confirmAddAttachment() {
567
+ if (this.loadMultipleFiles != true) {
568
+ if (this.newAttachment.AttachmentType == AttachmentType.LINK && !this.newAttachment.FileName)
569
+ this.newAttachment.FileName = this.newAttachment.FilePath;
570
+ if (this.attachmentsList == null)
571
+ this.attachmentsList = new Array();
572
+ this.attachmentsList.push(this.newAttachment);
573
+ }
574
+ else {
575
+ if (this.newMultipleAttachments == null || this.newMultipleAttachments.length == 0)
576
+ return;
577
+ if (this.attachmentsList == null)
578
+ this.attachmentsList = new Array();
579
+ this.attachmentsList = this.attachmentsList.concat(this.newMultipleAttachments);
580
+ }
581
+ if (this.attachmentTable)
582
+ this.attachmentTable.reloadDatatable();
583
+ this.localEditedAttachments.emit(this.attachmentsList);
584
+ this.close(false);
585
+ }
586
+ /**
587
+ * Apre il dialog per l'anteprima dell'allegato selezionato.
588
+ * @param row
589
+ * @returns
590
+ */
591
+ openPreviewDialog(row) {
592
+ return __awaiter(this, void 0, void 0, function* () {
593
+ this.selectedAttachment = JSON.parse(JSON.stringify(row));
594
+ if (this.selectedAttachment.AttachmentType == AttachmentType.FILE) {
595
+ if (this.selectedAttachment.FileContentType.startsWith("video")) {
596
+ EqpAttachmentDialogService.Warning(this.videoPreviewErrorMessage);
597
+ return;
598
+ }
599
+ else if (this.selectedAttachment.FileContentType.startsWith("audio")) {
600
+ EqpAttachmentDialogService.Warning(this.audioPreviewErrorMessage);
601
+ return;
602
+ }
603
+ }
604
+ if (this.getAttachmentEndpoint && this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64) {
605
+ yield this.getAttachmentByID()
606
+ .then((res) => { this.selectedAttachment.FileDataBase64 = res.FileDataBase64; })
607
+ .catch((err) => { EqpAttachmentDialogService.Error(err); });
608
+ }
609
+ if (this.selectedAttachment.AttachmentType == AttachmentType.LINK) {
610
+ this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.selectedAttachment.FilePath);
611
+ }
612
+ else if (this.selectedAttachment.IsImage && !this.selectedAttachment.FileDataBase64 && !this.selectedAttachment.FileThumbnailBase64) {
613
+ EqpAttachmentDialogService.Info("Impossibile aprire l'anteprima dell'allegato, file mancante.");
614
+ return;
615
+ }
616
+ else if (!this.selectedAttachment.IsImage) {
617
+ if (this.selectedAttachment.FilePath && this.productionBaseUrl) {
618
+ this.selectedAttachment.TrustedUrl = this.sanitizer.bypassSecurityTrustResourceUrl("https://docs.google.com/gview?url=" +
619
+ this.productionBaseUrl +
620
+ "/" +
621
+ this.selectedAttachment.FilePath +
622
+ "&embedded=true");
623
+ }
624
+ else {
625
+ EqpAttachmentDialogService.Info("Impossibile aprire l'anteprima del documento!");
626
+ return;
627
+ }
628
+ }
629
+ this.dialog.open(this.dialogPreview, {
630
+ disableClose: true,
631
+ hasBackdrop: true,
632
+ });
633
+ });
634
+ }
635
+ getAttachmentByID() {
636
+ return __awaiter(this, void 0, void 0, function* () {
637
+ return this.http.post(this.getAttachmentEndpoint, this.selectedAttachment).toPromise();
638
+ });
639
+ }
640
+ //#region Gestione caricamento file
641
+ /**
642
+ * Evento scatenato alla selezione del file (o dei file).
643
+ * 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
644
+ * mostrare le funzionalità del croppie (per ritagliare l'immagine) oppure no.
645
+ * Se il file caricato non è un immagine allora genera direttamente il base64 e lo associa all'allegato da salvare.
646
+ * Se invece il caricamento dei file è MULTIPLO e sono presenti più file allora esegue le stesse operazioni ignorando però il contrllo
647
+ * immagine per il croppie (in caso di caricamento multiplo le funzionalità del croppie sono disabilitate).
648
+ */
649
+ onFileInputChange(event) {
650
+ return __awaiter(this, void 0, void 0, function* () {
651
+ this.showCropImage = false;
652
+ //Se è stato richiesto il caricamento SINGOLO oppure se il caricamento è MULTIPLO ma è stato selezionato un solo file
653
+ //allora verifica se il file è un immagine (per mostrare il CROPPIE)
654
+ if ([...event.target.files].length == 1 || this.loadMultipleFiles != true) {
655
+ this.selectedFile = event.target.files[0];
656
+ this.selectedFiles = event.target.files;
657
+ if (!this.selectedFile)
658
+ return;
659
+ //Memorizza i dati per l'allegato
660
+ this.newAttachment = yield this.createAttachmentFromUploadedFile(this.selectedFile, false);
661
+ this.newMultipleAttachments = new Array();
662
+ this.newMultipleAttachments.push(this.newAttachment);
663
+ //Se è stata richiesta la gestione delle sole immagini ma per errore è stato selezionato un file che non è un immagine
664
+ let checkOnlyImage = this.checkAllowOnlyImageFile(this.newAttachment);
665
+ if (checkOnlyImage == false)
666
+ return;
667
+ if (this.loadMultipleFiles == true && [...event.target.files].length == 1)
668
+ this.createAttachmentForm();
669
+ //Verifica se il file caricato è un'immagine oppure no. Se è un immagine, prima di caricarla mostra il croppie per il resize.
670
+ //Se non è un immagine allora genera il Base64
671
+ if (this.newAttachment.IsImage == true) {
672
+ this.getImageDimensions(event.target.files[0]);
673
+ //Mostra il croppie e disabilita la form finchè non termina la modifica dell'immagine
674
+ this.newAttachmentForm.disable();
675
+ this.newAttachmentForm.controls["customWidth"].enable();
676
+ this.newAttachmentForm.controls["customHeight"].enable();
677
+ this.showCropImage = true;
678
+ this.imageChangedEvent = event;
679
+ }
680
+ else {
681
+ this.showCropImage = false;
682
+ let base64Result = yield this.getBase64FromFile(this.selectedFile);
683
+ this.newAttachment.FileDataBase64 = base64Result.Base64File;
684
+ this.newAttachment.FileContentType = base64Result.ContentType;
685
+ }
686
+ }
687
+ else {
688
+ this.selectedFiles = event.target.files;
689
+ if (!this.selectedFiles || this.selectedFiles.length == 0)
690
+ return;
691
+ this.newMultipleAttachments = new Array();
692
+ for (let i = 0; i < this.selectedFiles.length; i++) {
693
+ let newAttachment = yield this.createAttachmentFromUploadedFile(this.selectedFiles[i], true);
694
+ //Se è stata richiesta la gestione delle sole immagini ma per errore è stato selezionato un file che non è un immagine
695
+ let checkOnlyImage = this.checkAllowOnlyImageFile(newAttachment);
696
+ if (checkOnlyImage == false)
697
+ return;
698
+ this.newMultipleAttachments.push(newAttachment);
699
+ }
700
+ }
701
+ });
702
+ }
703
+ /**
704
+ * A partire dal FILE ricevuto in input ricostruisce l'oggetto IAttachmentDTO e lo restituisce.
705
+ * Se il parametro getBase64 viene passato a TRUE allora, sempre a partire dal file,genera il base64 e
706
+ * ricava il ContentType da associare all'oggetto IAttachmentDTO da restituire
707
+ * @param currentFile Oggetto FILE da processare
708
+ * @param getBase64 Se TRUE allora calcola base64 e ContentType del file passato in input
709
+ * @returns Restituisce un oggetto di tipo IAttachmentDTO
710
+ */
711
+ createAttachmentFromUploadedFile(currentFile, getBase64 = true) {
712
+ return __awaiter(this, void 0, void 0, function* () {
713
+ let newAttachment = {};
714
+ //Memorizza i dati per l'allegato
715
+ newAttachment.AttachmentType = AttachmentType.FILE;
716
+ newAttachment.FileContentType = currentFile.type;
717
+ newAttachment.FileName = currentFile.name;
718
+ newAttachment.FileExtension = currentFile.name.substr(currentFile.name.lastIndexOf('.') + 1);
719
+ newAttachment.IsImage = AttachmentHelperService.checkImageFromMimeType(currentFile.type);
720
+ if (getBase64 == true) {
721
+ let base64Result = yield this.getBase64FromFile(currentFile);
722
+ newAttachment.FileDataBase64 = base64Result.Base64File;
723
+ newAttachment.FileContentType = base64Result.ContentType;
724
+ }
725
+ return newAttachment;
726
+ });
727
+ }
728
+ /**
729
+ * A partire dal file passato in input restituisce un oggetto
730
+ * contenente il base64 del file e il suo contentType
731
+ * @param currentFile Oggetto File da cui estrapolare base64 e contentType
732
+ * @returns Restituisce un oggetto avente le proprietà Base64File e ContentType
733
+ */
734
+ getBase64FromFile(currentFile) {
735
+ return __awaiter(this, void 0, void 0, function* () {
736
+ let base64File = yield toBase64(currentFile);
737
+ let contentType = null;
738
+ if (base64File) {
739
+ // Loris 20/01/2022: PROBLEMA - Quando eseguo l'upload di un file .sql non viene salvato/scaricato correttamente.
740
+ // Questo succede perchè non viene popolato il FileContentType. Per risolvere il problema
741
+ // faccio un controllo e se non esiste il FileContentType allora lo recupero dal base64 ottenuto.
742
+ contentType = base64File.split(",")[0].split(":")[1].split(";")[0];
743
+ // Un altro metodo per leggere il ccontent type del file è tramite una regular expression:
744
+ base64File = base64File.split(",")[1];
745
+ }
746
+ let result = {
747
+ Base64File: base64File,
748
+ ContentType: contentType
749
+ };
750
+ return result;
751
+ });
752
+ }
753
+ /**
754
+ * Controlla se il file che si sta caricando è supportato dal sistema.
755
+ * @returns
756
+ */
757
+ checkAcceptedFiles() {
758
+ if ((this.loadMultipleFiles != true && this.selectedFile.type.startsWith("video"))
759
+ || (this.loadMultipleFiles == true && [...this.selectedFiles].filter(p => p.type.startsWith("video")).length > 0))
760
+ return false;
761
+ if (this.acceptedFileTypes == "*")
762
+ return true;
763
+ //Verifica che i tipi del file (o dei file) caricati siano coerenti con quelli accettati dalla direttiva
764
+ let accepted = true;
765
+ if (this.loadMultipleFiles != true)
766
+ accepted = this.acceptedFileTypes.includes(this.selectedFile.type);
767
+ else {
768
+ let uploadedFileTypes = [...this.selectedFiles].map(p => p.type);
769
+ uploadedFileTypes.forEach(type => {
770
+ if (!this.acceptedFileTypes.includes(type))
771
+ accepted = false;
772
+ });
773
+ }
774
+ //Questo controllo permette di gestire le casistiche per cui vengono indicati come tipi validi, ad esempio, 'image/*'
775
+ if (!accepted && this.loadMultipleFiles != true) {
776
+ for (let t of this.acceptedFileTypes.split(",").filter(t => t.includes("*"))) {
777
+ accepted = this.selectedFile.type.startsWith(t.split("*")[0]);
778
+ if (accepted)
779
+ break;
780
+ }
781
+ }
782
+ return accepted;
783
+ }
784
+ /**
785
+ * Se eqp-attachments è stata configurata per il caricamento delle sole immagini allora verifica che il file passato in
786
+ * input sia effettivamente un immagine o no.
787
+ * Se il controllo va a buon fine restituisce TRUE altrimenti mostra un messaggio d'errore e restituisce FALSE
788
+ */
789
+ checkAllowOnlyImageFile(newAttachment) {
790
+ if (this.allowOnlyImages == true && newAttachment.IsImage != true) {
791
+ EqpAttachmentDialogService.Error(this.noImageSelectedErrorMessage);
792
+ this.abortFile();
793
+ return false;
794
+ }
795
+ else if (!this.checkAcceptedFiles()) {
796
+ EqpAttachmentDialogService.Error(this.wrongTypeSelectedErrorMessage);
797
+ this.abortFile();
798
+ return false;
799
+ }
800
+ return true;
801
+ }
802
+ getImageDimensions(img) {
803
+ const reader = new FileReader();
804
+ reader.onload = (e) => {
805
+ const image = new Image();
806
+ image.src = e.target.result;
807
+ image.onload = rs => {
808
+ this.originalHeight = rs.currentTarget['height'];
809
+ this.originalWidth = rs.currentTarget['width'];
810
+ if (this.originalWidth > 1280) {
811
+ this.customWidth = 1280;
812
+ this.customHeight = Math.round((1280 * this.originalHeight) / this.originalWidth);
813
+ }
814
+ else {
815
+ this.customHeight = rs.currentTarget['height'];
816
+ this.customWidth = rs.currentTarget['width'];
817
+ }
818
+ };
819
+ };
820
+ reader.readAsDataURL(img);
821
+ }
822
+ restoreOriginalDimensions() {
823
+ this.customWidth = this.originalWidth;
824
+ this.customHeight = this.originalHeight;
825
+ }
826
+ onDimensionsChange(dimension) {
827
+ if (dimension == "H") {
828
+ this.customWidth = Math.round((this.customHeight * this.originalWidth) / this.originalHeight);
829
+ }
830
+ else if (dimension == "W") {
831
+ this.customHeight = Math.round((this.customWidth * this.originalHeight) / this.originalWidth);
832
+ }
833
+ }
834
+ imageCropped(event) {
835
+ this.croppedImage = event.base64;
836
+ this.getCroppedAndUpload(this.croppedImage);
837
+ }
838
+ getCroppedAndUpload(file) {
839
+ var self = this;
840
+ var file = base64ToFile(file);
841
+ const options = this.compressionOptions;
842
+ /**
843
+ * Comprime l'immagine passando come parametri le options create nell'oggetto sopra, e il file dal reader principale
844
+ */
845
+ imageCompression(file, options).then((fileCompressed => {
846
+ let fileReader = new FileReader();
847
+ //Faccio la push di ogni file all'interno dell'array di file dell'item da mandare al server
848
+ fileReader.onload = function () {
849
+ let resultReader = fileReader.result;
850
+ var marker = ';base64,';
851
+ self.newAttachment.FileDataBase64 = resultReader.substring(resultReader.indexOf(marker) + marker.length);
852
+ self.showCropImage = false;
853
+ self.newAttachmentForm.enable();
854
+ };
855
+ fileReader.readAsDataURL(fileCompressed);
856
+ }));
857
+ }
858
+ confirmCrop() {
859
+ this.imageCropper.crop();
860
+ }
861
+ /**
862
+ * Annulla la selezione del file, svuotando l'input e resettando tutte le proprietà dell'IAttachmentDTO
863
+ */
864
+ abortFile() {
865
+ this.imageChangedEvent = '';
866
+ if (this.imageInput)
867
+ this.imageInput.nativeElement.value = '';
868
+ this.selectedFile = null;
869
+ this.selectedFiles = null;
870
+ this.showCropImage = false;
871
+ this.newAttachment.IsImage = false;
872
+ this.newAttachment.FileDataBase64 = null;
873
+ this.newAttachment.FileName = null;
874
+ this.newAttachment.FileExtension = null;
875
+ this.newAttachment.FileContentType = null;
876
+ this.newMultipleAttachments = new Array();
877
+ this.customHeight = null;
878
+ this.customWidth = null;
879
+ this.originalHeight = null;
880
+ this.originalWidth = null;
881
+ }
882
+ }
883
+ EqpAttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentsComponent, deps: [{ token: i1.MatDialog }, { token: i2.FormBuilder }, { token: i3.DomSanitizer }, { token: i4.HttpClient }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
884
+ EqpAttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: EqpAttachmentsComponent, selector: "eqp-attachments", inputs: { disableAction: "disableAction", showHeader: "showHeader", headerTitle: "headerTitle", attachmentsList: "attachmentsList", showMatCard: "showMatCard", multipleAttachment: "multipleAttachment", loadMultipleFiles: "loadMultipleFiles", attachmentsColumns: "attachmentsColumns", emptyTableMessage: "emptyTableMessage", allowOnlyImages: "allowOnlyImages", acceptedFileTypes: "acceptedFileTypes", isDisabled: "isDisabled", showInlinePreview: "showInlinePreview", getAttachmentEndpoint: "getAttachmentEndpoint", productionBaseUrl: "productionBaseUrl", compressionOptions: "compressionOptions", allowedTypes: "allowedTypes", isEqpTableMultiLanguage: "isEqpTableMultiLanguage", tablePaginatorVisible: "tablePaginatorVisible", tablePaginatorSize: "tablePaginatorSize", downloadTooltipPosition: "downloadTooltipPosition", openLinkLabel: "openLinkLabel", addButtonLabel: "addButtonLabel", downloadLabel: "downloadLabel", deleteLabel: "deleteLabel", fileNameLabel: "fileNameLabel", previewLabel: "previewLabel", uploadFileLabel: "uploadFileLabel", confirmLabel: "confirmLabel", abortLabel: "abortLabel", saveLabel: "saveLabel", exitLabel: "exitLabel", eqpTableSearchText: "eqpTableSearchText", deleteDialogTitle: "deleteDialogTitle", deleteDialogMessage: "deleteDialogMessage", noImageSelectedErrorMessage: "noImageSelectedErrorMessage", wrongTypeSelectedErrorMessage: "wrongTypeSelectedErrorMessage", videoPreviewErrorMessage: "videoPreviewErrorMessage", audioPreviewErrorMessage: ["videoPreviewErrorMessage", "audioPreviewErrorMessage"] }, outputs: { localEditedAttachments: "localEditedAttachments", abortAddAttachment: "abortAddAttachment", downloadAttachment: "downloadAttachment", onDeleteAttachment: "onDeleteAttachment" }, viewQueries: [{ propertyName: "dialogAddAttachment", first: true, predicate: ["dialogAddAttachment"], descendants: true, static: true }, { propertyName: "dialogAddMultipleAttachment", first: true, predicate: ["dialogAddMultipleAttachment"], descendants: true, static: true }, { propertyName: "imageCropper", first: true, predicate: ImageCropperComponent, descendants: true }, { propertyName: "imageInput", first: true, predicate: ["imageInput"], descendants: true }, { propertyName: "attachmentTable", first: true, predicate: ["attachmentTable"], descendants: true }, { propertyName: "inlinePreviewTemplate", first: true, predicate: ["inlinePreviewTemplate"], descendants: true, static: true }, { propertyName: "dialogPreview", first: true, predicate: ["dialogPreview"], descendants: true, static: true }], ngImport: i0, template: "<!-- Se richiesta la gestione multipla mostra il pulsante di aggiunta e la tabella con l'elenco allegati -->\r\n<div *ngIf=\"multipleAttachment == true\">\r\n <mat-card [ngStyle]=\"{ 'box-shadow': showMatCard == false ? 'none' : null }\">\r\n <mat-card-header>\r\n <div class=\"col-md-6\">\r\n <div class=\"text-nowrap eqp-attachments-header-title\" *ngIf=\"showHeader == true\">\r\n {{headerTitle}}\r\n </div>\r\n </div>\r\n <div class=\"col-md-6 text-right\">\r\n <div class=\"row justify-content-end\">\r\n <!-- Template del button per l'aggiunta di un allegato -->\r\n <ng-container *ngTemplateOutlet=\"addAttachmentButton\"></ng-container>\r\n </div>\r\n </div>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <eqp-table #attachmentTable [createMatCard]=\"false\" #table [columns]=\"attachmentsColumns\"\r\n [isMultiLanguage]=\"isEqpTableMultiLanguage\" [data]=\"attachmentsList\"\r\n [paginatorVisible]=\"tablePaginatorVisible\" [matPaginatorSize]=\"tablePaginatorSize\"\r\n [emptyTableMessage]=\"emptyTableMessage\" [searchText]=\"eqpTableSearchText\">\r\n </eqp-table>\r\n </mat-card-content>\r\n </mat-card>\r\n</div>\r\n\r\n<!-- Se richiesta la gestione singola mostra il pulsante di caricamento di un singolo file -->\r\n<div *ngIf=\"multipleAttachment != true\">\r\n <!-- Template del button per l'aggiunta di un allegato -->\r\n <ng-container *ngTemplateOutlet=\"addAttachmentButton\"></ng-container>\r\n\r\n <button class=\"mb-2 mr-2 eqp-attachments-download-btn\" (click)=\"viewAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\" color=\"primary\">\r\n <mat-icon *ngIf=\"attachmentsList[0].AttachmentType == AttachmentType.FILE\">download</mat-icon>\r\n <mat-icon *ngIf=\"attachmentsList[0].AttachmentType != AttachmentType.FILE\">open_in_new</mat-icon>\r\n {{attachmentsList[0].AttachmentType == AttachmentType.FILE ? downloadLabel : openLinkLabel}}\r\n </button>\r\n <button class=\"mb-2 mr-2 eqp-attachments-preview-btn\" (click)=\"openPreviewDialog(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\"\r\n *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0] && (!attachmentsList[0].FileContentType || (!attachmentsList[0].FileContentType.startsWith('video') && !attachmentsList[0].FileContentType.startsWith('audio')))\">\r\n <mat-icon>visibility</mat-icon> {{previewLabel}}\r\n </button>\r\n <button class=\"mb-2 eqp-attachments-delete-btn\" (click)=\"deleteAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\"\r\n [disabled]=\"isDisabled\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n\r\n <div class=\"row\" style=\"margin-top: 10px;\"\r\n *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].FileDataBase64 && attachmentsList[0].IsImage == true\">\r\n <div class=\"col-sm-12\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{attachmentsList[0].FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].IsImage != true\">\r\n <div class=\"col-sm-12\">\r\n <mat-form-field>\r\n <mat-label>{{fileNameLabel}}</mat-label>\r\n <input readonly matInput [(ngModel)]=\"attachmentsList[0].FileName\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n<ng-template #dialogAddAttachment>\r\n <div class=\"container-fluid eqp-attachments-dialog-add-container\"\r\n style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"newAttachmentForm\" (ngSubmit)=\"confirmAddAttachment()\" *ngIf=\"newAttachmentForm\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\"> {{addButtonLabel}} {{ newAttachment.AttachmentType ==\r\n attachmentType.FILE ?\r\n 'File' : 'Link'}} </div>\r\n </div>\r\n <div class=\"row\" style=\"margin-top: 20px;\">\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == attachmentType.FILE\">\r\n <input #imageInput style=\"display:none;\" id=\"file_attachment\"\r\n name=\"file_attachment\" type=\"file\" (change)=\"onFileInputChange($event)\"\r\n [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\"/>\r\n <button (click)=\"imageInput.click()\" type=\"button\" style=\"margin-left: 10px;\" id=\"file_attachment\"\r\n mat-raised-button color=\"primary\" [disabled]=\"showCropImage == true\"\r\n class=\"mb-2 btn btn-primary eqp-attachments-upload-btn\" *ngIf=\"(loadMultipleFiles != true && !newAttachment.FileDataBase64) || (loadMultipleFiles == true && newMultipleAttachments && newMultipleAttachments.length == 0)\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n {{uploadFileLabel}}\r\n </button>\r\n <button (click)=\"abortFile()\" type=\"button\" style=\"margin-left: 10px;\" mat-raised-button\r\n *ngIf=\"(loadMultipleFiles != true && newAttachment.FileDataBase64) || (loadMultipleFiles == true && newMultipleAttachments && newMultipleAttachments.length > 0)\" class=\"mb-2 eqp-attachments-delete-btn\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2 || (selectedFile && loadMultipleFiles != true)\">\r\n <mat-form-field style=\"width: 100%;\">\r\n <mat-label> {{fileNameLabel}} </mat-label>\r\n <input formControlName=\"name\" matInput [(ngModel)]=\"newAttachment.FileName\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2\">\r\n <mat-form-field style=\"width: 100%;\">\r\n <mat-label> Link </mat-label>\r\n <input formControlName=\"path\" required matInput [(ngModel)]=\"newAttachment.FilePath\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <!-- Riporta l'elenco dei nomi dei file caricati contemporaneamente (visibile solo se loadMultipleFiles = TRUE e se ci sono realmente pi\u00F9 file senza link) -->\r\n <div class=\"row\" *ngIf=\"loadMultipleFiles == true && newMultipleAttachments && newMultipleAttachments.length > 0 && newMultipleAttachments[0].AttachmentType != attachmentType.LINK\">\r\n <div class=\"col-12\" *ngFor=\"let attach of newMultipleAttachments\">\r\n <mat-form-field style=\"width: 100%\">\r\n <mat-label> {{fileNameLabel}} </mat-label>\r\n <input disabled matInput [(ngModel)]=\"attach.FileName\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <!-- Riporta la preview dell'immagine quando \u00E8 richiesto il caricamento MULTIPLO ma \u00E8 stata selezionata una sola immagine (quindi \u00E8 entrato in gioco anche il croppie) -->\r\n <div class=\"row\" *ngIf=\"loadMultipleFiles == true && showCropImage != true && newMultipleAttachments && newMultipleAttachments.length == 1 && newMultipleAttachments[0].IsImage == true\" style=\"margin-top: 10px;\">\r\n <div class=\"col-4\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{newMultipleAttachments[0].FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Riporta la preview dell'immagine quando \u00E8 richiesto il caricamento SINGOLO ed \u00E8 stata selezionata un'immagine -->\r\n <div class=\"row\" *ngIf=\"loadMultipleFiles != true && showCropImage != true && newAttachment.FileDataBase64 && newAttachment.IsImage == true\" style=\"margin-top: 10px;\">\r\n <div class=\"col-4\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{newAttachment.FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Richiama il template per le funzionalit\u00E0 del CROPPIE -->\r\n <ng-container [ngTemplateOutlet]=\"croppieTemplate\" [ngTemplateOutletContext]=\"{form: newAttachmentForm}\" *ngIf=\"showCropImage == true\"></ng-container>\r\n\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n [disabled]=\"showCropImage == true || (loadMultipleFiles != true && newAttachmentForm?.disabled == true) || disableSave()\">\r\n {{saveLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" (click)=\"close()\"\r\n [disabled]=\"showCropImage == true\" type=\"button\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #inlinePreviewTemplate let-row=\"row\">\r\n <div class=\"inline-preview-container\" *ngIf=\"row.AttachmentType != AttachmentType.LINK && row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <img src=\"data:image/png;base64,{{row.FileThumbnailBase64 ? row.FileThumbnailBase64 : row.FileDataBase64}}\">\r\n </div>\r\n <div class=\"inline-preview-container\" *ngIf=\"row.AttachmentType != AttachmentType.LINK && !row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <i [ngClass]=\"getAttachmentIcon(row)\"></i>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<ng-template #dialogPreview>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important;\" *ngIf=\"selectedAttachment\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">\r\n {{previewLabel}} {{ selectedAttachment?.AttachmentType == attachmentType.FILE ? 'File' : 'Link'}}\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <!-- ANTEPRIMA IMMAGINE -->\r\n <div class=\"col-12 text-center preview-container\" *ngIf=\"selectedAttachment.IsImage\">\r\n <img class=\"image-preview\"\r\n src=\"data:image/png;base64,{{selectedAttachment.FileDataBase64 ? selectedAttachment.FileDataBase64 : selectedAttachment.FileThumbnailBase64}}\">\r\n </div>\r\n\r\n <!-- ANTEPRIMA LINK -->\r\n <div class=\"col-12 preview-container\" *ngIf=\"!selectedAttachment.IsImage\">\r\n <iframe class=\"link-preview\" [src]=\"selectedAttachment.TrustedUrl\"\r\n [title]=\"selectedAttachment.FileName\"></iframe>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-3\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n (click)=\"viewAttachment(selectedAttachment)\"\r\n *ngIf=\"selectedAttachment.AttachmentType != AttachmentType.LINK\">\r\n {{downloadLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" mat-dialog-close type=\"button\"\r\n (click)=\"selectedAttachment = null\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<!-- TEMPLATE PER IL PULSANTE DI AGGIUNTA NUOVO ALLEGATO -->\r\n<ng-template #addAttachmentButton>\r\n\r\n <!-- \r\n Pulsanti per l'aggiunta di un file o un link. Ne viene visualizzato uno se:\r\n - gli allowedTypes sono stati specificati, nell'array ne \u00E8 presente uno solo, quello inserito \u00E8 AttachmentType.FILE (o AttachmentType.LINK) \r\n e sono nella gestione di pi\u00F9 allegati (multipleAttachment == true)\r\n OPPURE\r\n - gli allowedTypes sono stati specificati, nell'array ne \u00E8 presente uno solo, quello inserito \u00E8 AttachmentType.FILE (o AttachmentType.LINK) \r\n e sono nella gestione di un singolo allegato (multipleAttachment == true) e non ne \u00E8 ancora stato selezionato uno (ovvero attachmentsList non esiste o non ha elementi)\r\n -->\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n *ngIf=\"allowedTypes && allowedTypes.length == 1 && (multipleAttachment == true || (!attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0])))\"\r\n (click)=\"openModalAddAttachment(allowedTypes[0])\" [disabled]=\"isDisabled\">\r\n <!-- Per l'aggiunta dei file mostro un'icona diversa dall'aggiunta dei link -->\r\n <mat-icon *ngIf=\"allowedTypes[0] == 1\">cloud_upload</mat-icon>\r\n <i class=\"fas fa-link\" *ngIf=\"allowedTypes[0] == 2\"></i>\r\n <span style=\"margin-left: 10px;\">{{addButtonLabel}} {{allowedTypes[0] == 1 ? \"file\" : \"link\"}}</span>\r\n </button>\r\n\r\n\r\n <!-- Pulsante per aprire il menu per la scelta del tipo di Attachment da creare -->\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\"\r\n *ngIf=\"allowedTypes && allowedTypes.length > 1 && (multipleAttachment == true || (!attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0])))\">\r\n <mat-icon *ngIf=\"multipleAttachment != true\">cloud_upload</mat-icon>\r\n <mat-icon *ngIf=\"multipleAttachment == true\">add</mat-icon>\r\n <span style=\"margin-left: 0px;\"> {{addButtonLabel}} </span>\r\n </button>\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"openModalAddAttachment(1)\" class=\"eqp-attachments-file-btn\">\r\n <i class=\"fas fa-file\"></i>\r\n <span style=\"margin-left: 10px;\">File</span>\r\n </button>\r\n <button mat-menu-item (click)=\"openModalAddAttachment(2)\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px;\">Link</span>\r\n </button>\r\n </mat-menu>\r\n</ng-template>\r\n\r\n\r\n<ng-template #croppieTemplate let-form=\"form\">\r\n <div class=\"row mt-2 mb-2\" [formGroup]=\"form\">\r\n <div class=\"col-md-12 d-flex align-items-center justify-content-center\">\r\n <span class=\"mr-1\">Max H(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customHeight\" type=\"number\" matInput [(ngModel)]=\"customHeight\"\r\n (change)=\"onDimensionsChange('H')\">\r\n </mat-form-field>\r\n\r\n <span class=\"ml-2 mr-1\">Max W(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customWidth\" type=\"number\" matInput [(ngModel)]=\"customWidth\"\r\n (change)=\"onDimensionsChange('W')\">\r\n </mat-form-field>\r\n\r\n <button class=\"btn btn-primary mat-raised-button ml-2\" (click)=\"restoreOriginalDimensions()\"\r\n [disabled]=\"customWidth == originalWidth && customHeight == originalHeight\">\r\n <mat-icon style=\"vertical-align: middle;\">replay</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\" [maintainAspectRatio]=\"false\"\r\n [autoCrop]=\"false\" [containWithinAspectRatio]=\"false\" [aspectRatio]=\"4/3\"\r\n [cropperMinWidth]=\"128\" [onlyScaleDown]=\"true\" [roundCropper]=\"false\" [canvasRotation]=\"0\"\r\n [transform]=\"transform\" [alignImage]=\"'left'\" format=\"png\" (imageCropped)=\"imageCropped($event)\"\r\n [resizeToWidth]=\"customWidth\" [resizeToHeight]=\"customHeight\">\r\n </image-cropper>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center mt-2\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-confirm-btn mr-2\" type=\"button\"\r\n (click)=\"confirmCrop()\">\r\n {{confirmLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-abort-btn\" type=\"button\" (click)=\"abortFile()\">\r\n {{abortLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".eqp-attachments-header-title{font-weight:700;font-size:19px;line-height:24px;margin-bottom:auto}.single-attachment-inline-preview-container{max-height:400px;max-width:400px;display:flex;align-items:center}.single-attachment-inline-preview-container img{max-width:100%;max-height:120px}.inline-preview-container{max-height:100px;max-width:100px;display:flex;align-items:center;justify-content:center;width:100%;cursor:pointer}.inline-preview-container img{max-width:100%;max-height:100px}.inline-preview-container i{font-size:25px;margin:auto}.preview-container{max-height:60vh;max-width:100%}.preview-container .image-preview{max-width:100%;max-height:100%}.preview-container .link-preview{width:70vw;height:55vh}\n"], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i9.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i9.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i9.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "component", type: i10.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i11.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i11.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i12.ImageCropperComponent, selector: "image-cropper", inputs: ["format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "cropper", "alignImage", "disabled", "imageChangedEvent", "imageURL", "imageBase64", "imageFile"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed"] }, { kind: "component", type: i13.EqpTableComponent, selector: "eqp-table" }] });
885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentsComponent, decorators: [{
886
+ type: Component,
887
+ args: [{ selector: 'eqp-attachments', template: "<!-- Se richiesta la gestione multipla mostra il pulsante di aggiunta e la tabella con l'elenco allegati -->\r\n<div *ngIf=\"multipleAttachment == true\">\r\n <mat-card [ngStyle]=\"{ 'box-shadow': showMatCard == false ? 'none' : null }\">\r\n <mat-card-header>\r\n <div class=\"col-md-6\">\r\n <div class=\"text-nowrap eqp-attachments-header-title\" *ngIf=\"showHeader == true\">\r\n {{headerTitle}}\r\n </div>\r\n </div>\r\n <div class=\"col-md-6 text-right\">\r\n <div class=\"row justify-content-end\">\r\n <!-- Template del button per l'aggiunta di un allegato -->\r\n <ng-container *ngTemplateOutlet=\"addAttachmentButton\"></ng-container>\r\n </div>\r\n </div>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <eqp-table #attachmentTable [createMatCard]=\"false\" #table [columns]=\"attachmentsColumns\"\r\n [isMultiLanguage]=\"isEqpTableMultiLanguage\" [data]=\"attachmentsList\"\r\n [paginatorVisible]=\"tablePaginatorVisible\" [matPaginatorSize]=\"tablePaginatorSize\"\r\n [emptyTableMessage]=\"emptyTableMessage\" [searchText]=\"eqpTableSearchText\">\r\n </eqp-table>\r\n </mat-card-content>\r\n </mat-card>\r\n</div>\r\n\r\n<!-- Se richiesta la gestione singola mostra il pulsante di caricamento di un singolo file -->\r\n<div *ngIf=\"multipleAttachment != true\">\r\n <!-- Template del button per l'aggiunta di un allegato -->\r\n <ng-container *ngTemplateOutlet=\"addAttachmentButton\"></ng-container>\r\n\r\n <button class=\"mb-2 mr-2 eqp-attachments-download-btn\" (click)=\"viewAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\" color=\"primary\">\r\n <mat-icon *ngIf=\"attachmentsList[0].AttachmentType == AttachmentType.FILE\">download</mat-icon>\r\n <mat-icon *ngIf=\"attachmentsList[0].AttachmentType != AttachmentType.FILE\">open_in_new</mat-icon>\r\n {{attachmentsList[0].AttachmentType == AttachmentType.FILE ? downloadLabel : openLinkLabel}}\r\n </button>\r\n <button class=\"mb-2 mr-2 eqp-attachments-preview-btn\" (click)=\"openPreviewDialog(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button color=\"primary\"\r\n *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0] && (!attachmentsList[0].FileContentType || (!attachmentsList[0].FileContentType.startsWith('video') && !attachmentsList[0].FileContentType.startsWith('audio')))\">\r\n <mat-icon>visibility</mat-icon> {{previewLabel}}\r\n </button>\r\n <button class=\"mb-2 eqp-attachments-delete-btn\" (click)=\"deleteAttachment(attachmentsList[0])\" type=\"button\"\r\n mat-raised-button *ngIf=\"attachmentsList && attachmentsList.length > 0 && attachmentsList[0]\"\r\n [disabled]=\"isDisabled\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n\r\n <div class=\"row\" style=\"margin-top: 10px;\"\r\n *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].FileDataBase64 && attachmentsList[0].IsImage == true\">\r\n <div class=\"col-sm-12\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{attachmentsList[0].FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"attachmentsList.length > 0 && attachmentsList[0] && attachmentsList[0].IsImage != true\">\r\n <div class=\"col-sm-12\">\r\n <mat-form-field>\r\n <mat-label>{{fileNameLabel}}</mat-label>\r\n <input readonly matInput [(ngModel)]=\"attachmentsList[0].FileName\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n<ng-template #dialogAddAttachment>\r\n <div class=\"container-fluid eqp-attachments-dialog-add-container\"\r\n style=\"max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;\">\r\n <form [formGroup]=\"newAttachmentForm\" (ngSubmit)=\"confirmAddAttachment()\" *ngIf=\"newAttachmentForm\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\"> {{addButtonLabel}} {{ newAttachment.AttachmentType ==\r\n attachmentType.FILE ?\r\n 'File' : 'Link'}} </div>\r\n </div>\r\n <div class=\"row\" style=\"margin-top: 20px;\">\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == attachmentType.FILE\">\r\n <input #imageInput style=\"display:none;\" id=\"file_attachment\"\r\n name=\"file_attachment\" type=\"file\" (change)=\"onFileInputChange($event)\"\r\n [accept]=\"acceptedFileTypes\" [multiple]=\"loadMultipleFiles\"/>\r\n <button (click)=\"imageInput.click()\" type=\"button\" style=\"margin-left: 10px;\" id=\"file_attachment\"\r\n mat-raised-button color=\"primary\" [disabled]=\"showCropImage == true\"\r\n class=\"mb-2 btn btn-primary eqp-attachments-upload-btn\" *ngIf=\"(loadMultipleFiles != true && !newAttachment.FileDataBase64) || (loadMultipleFiles == true && newMultipleAttachments && newMultipleAttachments.length == 0)\">\r\n <mat-icon>cloud_upload</mat-icon>\r\n {{uploadFileLabel}}\r\n </button>\r\n <button (click)=\"abortFile()\" type=\"button\" style=\"margin-left: 10px;\" mat-raised-button\r\n *ngIf=\"(loadMultipleFiles != true && newAttachment.FileDataBase64) || (loadMultipleFiles == true && newMultipleAttachments && newMultipleAttachments.length > 0)\" class=\"mb-2 eqp-attachments-delete-btn\">\r\n <mat-icon>delete</mat-icon> {{deleteLabel}}\r\n </button>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2 || (selectedFile && loadMultipleFiles != true)\">\r\n <mat-form-field style=\"width: 100%;\">\r\n <mat-label> {{fileNameLabel}} </mat-label>\r\n <input formControlName=\"name\" matInput [(ngModel)]=\"newAttachment.FileName\">\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-sm-12\" *ngIf=\"newAttachment.AttachmentType == 2\">\r\n <mat-form-field style=\"width: 100%;\">\r\n <mat-label> Link </mat-label>\r\n <input formControlName=\"path\" required matInput [(ngModel)]=\"newAttachment.FilePath\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <!-- Riporta l'elenco dei nomi dei file caricati contemporaneamente (visibile solo se loadMultipleFiles = TRUE e se ci sono realmente pi\u00F9 file senza link) -->\r\n <div class=\"row\" *ngIf=\"loadMultipleFiles == true && newMultipleAttachments && newMultipleAttachments.length > 0 && newMultipleAttachments[0].AttachmentType != attachmentType.LINK\">\r\n <div class=\"col-12\" *ngFor=\"let attach of newMultipleAttachments\">\r\n <mat-form-field style=\"width: 100%\">\r\n <mat-label> {{fileNameLabel}} </mat-label>\r\n <input disabled matInput [(ngModel)]=\"attach.FileName\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <!-- Riporta la preview dell'immagine quando \u00E8 richiesto il caricamento MULTIPLO ma \u00E8 stata selezionata una sola immagine (quindi \u00E8 entrato in gioco anche il croppie) -->\r\n <div class=\"row\" *ngIf=\"loadMultipleFiles == true && showCropImage != true && newMultipleAttachments && newMultipleAttachments.length == 1 && newMultipleAttachments[0].IsImage == true\" style=\"margin-top: 10px;\">\r\n <div class=\"col-4\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{newMultipleAttachments[0].FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Riporta la preview dell'immagine quando \u00E8 richiesto il caricamento SINGOLO ed \u00E8 stata selezionata un'immagine -->\r\n <div class=\"row\" *ngIf=\"loadMultipleFiles != true && showCropImage != true && newAttachment.FileDataBase64 && newAttachment.IsImage == true\" style=\"margin-top: 10px;\">\r\n <div class=\"col-4\">\r\n <div class=\"single-attachment-inline-preview-container\">\r\n <img src=\"data:image/png;base64,{{newAttachment.FileDataBase64}}\">\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Richiama il template per le funzionalit\u00E0 del CROPPIE -->\r\n <ng-container [ngTemplateOutlet]=\"croppieTemplate\" [ngTemplateOutletContext]=\"{form: newAttachmentForm}\" *ngIf=\"showCropImage == true\"></ng-container>\r\n\r\n <div class=\"row mt-2\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n [disabled]=\"showCropImage == true || (loadMultipleFiles != true && newAttachmentForm?.disabled == true) || disableSave()\">\r\n {{saveLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" (click)=\"close()\"\r\n [disabled]=\"showCropImage == true\" type=\"button\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #inlinePreviewTemplate let-row=\"row\">\r\n <div class=\"inline-preview-container\" *ngIf=\"row.AttachmentType != AttachmentType.LINK && row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <img src=\"data:image/png;base64,{{row.FileThumbnailBase64 ? row.FileThumbnailBase64 : row.FileDataBase64}}\">\r\n </div>\r\n <div class=\"inline-preview-container\" *ngIf=\"row.AttachmentType != AttachmentType.LINK && !row.IsImage\" (click)=\"openPreviewDialog(row)\">\r\n <i [ngClass]=\"getAttachmentIcon(row)\"></i>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<ng-template #dialogPreview>\r\n <div class=\"container-fluid\" style=\"max-height: 70vh !important;\" *ngIf=\"selectedAttachment\">\r\n <div class=\"row\">\r\n <div class=\"header-title-standard\">\r\n {{previewLabel}} {{ selectedAttachment?.AttachmentType == attachmentType.FILE ? 'File' : 'Link'}}\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-2\">\r\n <!-- ANTEPRIMA IMMAGINE -->\r\n <div class=\"col-12 text-center preview-container\" *ngIf=\"selectedAttachment.IsImage\">\r\n <img class=\"image-preview\"\r\n src=\"data:image/png;base64,{{selectedAttachment.FileDataBase64 ? selectedAttachment.FileDataBase64 : selectedAttachment.FileThumbnailBase64}}\">\r\n </div>\r\n\r\n <!-- ANTEPRIMA LINK -->\r\n <div class=\"col-12 preview-container\" *ngIf=\"!selectedAttachment.IsImage\">\r\n <iframe class=\"link-preview\" [src]=\"selectedAttachment.TrustedUrl\"\r\n [title]=\"selectedAttachment.FileName\"></iframe>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-3\">\r\n <div class=\"col-sm-12 text-right\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-save-btn mr-2\" type=\"submit\"\r\n (click)=\"viewAttachment(selectedAttachment)\"\r\n *ngIf=\"selectedAttachment.AttachmentType != AttachmentType.LINK\">\r\n {{downloadLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-exit-btn\" mat-dialog-close type=\"button\"\r\n (click)=\"selectedAttachment = null\">\r\n {{exitLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n<!-- TEMPLATE PER IL PULSANTE DI AGGIUNTA NUOVO ALLEGATO -->\r\n<ng-template #addAttachmentButton>\r\n\r\n <!-- \r\n Pulsanti per l'aggiunta di un file o un link. Ne viene visualizzato uno se:\r\n - gli allowedTypes sono stati specificati, nell'array ne \u00E8 presente uno solo, quello inserito \u00E8 AttachmentType.FILE (o AttachmentType.LINK) \r\n e sono nella gestione di pi\u00F9 allegati (multipleAttachment == true)\r\n OPPURE\r\n - gli allowedTypes sono stati specificati, nell'array ne \u00E8 presente uno solo, quello inserito \u00E8 AttachmentType.FILE (o AttachmentType.LINK) \r\n e sono nella gestione di un singolo allegato (multipleAttachment == true) e non ne \u00E8 ancora stato selezionato uno (ovvero attachmentsList non esiste o non ha elementi)\r\n -->\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n *ngIf=\"allowedTypes && allowedTypes.length == 1 && (multipleAttachment == true || (!attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0])))\"\r\n (click)=\"openModalAddAttachment(allowedTypes[0])\" [disabled]=\"isDisabled\">\r\n <!-- Per l'aggiunta dei file mostro un'icona diversa dall'aggiunta dei link -->\r\n <mat-icon *ngIf=\"allowedTypes[0] == 1\">cloud_upload</mat-icon>\r\n <i class=\"fas fa-link\" *ngIf=\"allowedTypes[0] == 2\"></i>\r\n <span style=\"margin-left: 10px;\">{{addButtonLabel}} {{allowedTypes[0] == 1 ? \"file\" : \"link\"}}</span>\r\n </button>\r\n\r\n\r\n <!-- Pulsante per aprire il menu per la scelta del tipo di Attachment da creare -->\r\n <button class=\"btn btn-primary mb-4 mr-5 eqp-attachments-add-btn\" mat-raised-button color=\"primary\" type=\"button\"\r\n [matMenuTriggerFor]=\"attachmentTypeMenu\" [disabled]=\"isDisabled\"\r\n *ngIf=\"allowedTypes && allowedTypes.length > 1 && (multipleAttachment == true || (!attachmentsList || attachmentsList.length == 0 || (attachmentsList.length > 0 && !attachmentsList[0])))\">\r\n <mat-icon *ngIf=\"multipleAttachment != true\">cloud_upload</mat-icon>\r\n <mat-icon *ngIf=\"multipleAttachment == true\">add</mat-icon>\r\n <span style=\"margin-left: 0px;\"> {{addButtonLabel}} </span>\r\n </button>\r\n <mat-menu #attachmentTypeMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"openModalAddAttachment(1)\" class=\"eqp-attachments-file-btn\">\r\n <i class=\"fas fa-file\"></i>\r\n <span style=\"margin-left: 10px;\">File</span>\r\n </button>\r\n <button mat-menu-item (click)=\"openModalAddAttachment(2)\" class=\"eqp-attachments-link-btn\">\r\n <i class=\"fas fa-link\"></i>\r\n <span style=\"margin-left: 10px;\">Link</span>\r\n </button>\r\n </mat-menu>\r\n</ng-template>\r\n\r\n\r\n<ng-template #croppieTemplate let-form=\"form\">\r\n <div class=\"row mt-2 mb-2\" [formGroup]=\"form\">\r\n <div class=\"col-md-12 d-flex align-items-center justify-content-center\">\r\n <span class=\"mr-1\">Max H(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customHeight\" type=\"number\" matInput [(ngModel)]=\"customHeight\"\r\n (change)=\"onDimensionsChange('H')\">\r\n </mat-form-field>\r\n\r\n <span class=\"ml-2 mr-1\">Max W(px):</span>\r\n <mat-form-field>\r\n <input formControlName=\"customWidth\" type=\"number\" matInput [(ngModel)]=\"customWidth\"\r\n (change)=\"onDimensionsChange('W')\">\r\n </mat-form-field>\r\n\r\n <button class=\"btn btn-primary mat-raised-button ml-2\" (click)=\"restoreOriginalDimensions()\"\r\n [disabled]=\"customWidth == originalWidth && customHeight == originalHeight\">\r\n <mat-icon style=\"vertical-align: middle;\">replay</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <image-cropper [imageChangedEvent]=\"imageChangedEvent\" [maintainAspectRatio]=\"false\"\r\n [autoCrop]=\"false\" [containWithinAspectRatio]=\"false\" [aspectRatio]=\"4/3\"\r\n [cropperMinWidth]=\"128\" [onlyScaleDown]=\"true\" [roundCropper]=\"false\" [canvasRotation]=\"0\"\r\n [transform]=\"transform\" [alignImage]=\"'left'\" format=\"png\" (imageCropped)=\"imageCropped($event)\"\r\n [resizeToWidth]=\"customWidth\" [resizeToHeight]=\"customHeight\">\r\n </image-cropper>\r\n </div>\r\n </div>\r\n <div class=\"row justify-content-center mt-2\">\r\n <div style=\"max-height: 450px; max-width: 450px;\">\r\n <button class=\"btn btn-primary mat-raised-button eqp-attachments-confirm-btn mr-2\" type=\"button\"\r\n (click)=\"confirmCrop()\">\r\n {{confirmLabel}}\r\n </button>\r\n <button class=\"btn mat-raised-button eqp-attachments-abort-btn\" type=\"button\" (click)=\"abortFile()\">\r\n {{abortLabel}}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".eqp-attachments-header-title{font-weight:700;font-size:19px;line-height:24px;margin-bottom:auto}.single-attachment-inline-preview-container{max-height:400px;max-width:400px;display:flex;align-items:center}.single-attachment-inline-preview-container img{max-width:100%;max-height:120px}.inline-preview-container{max-height:100px;max-width:100px;display:flex;align-items:center;justify-content:center;width:100%;cursor:pointer}.inline-preview-container img{max-width:100%;max-height:100px}.inline-preview-container i{font-size:25px;margin:auto}.preview-container{max-height:60vh;max-width:100%}.preview-container .image-preview{max-width:100%;max-height:100%}.preview-container .link-preview{width:70vw;height:55vh}\n"] }]
888
+ }], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i2.FormBuilder }, { type: i3.DomSanitizer }, { type: i4.HttpClient }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { disableAction: [{
889
+ type: Input,
890
+ args: ["disableAction"]
891
+ }], showHeader: [{
892
+ type: Input,
893
+ args: ["showHeader"]
894
+ }], headerTitle: [{
895
+ type: Input,
896
+ args: ["headerTitle"]
897
+ }], attachmentsList: [{
898
+ type: Input,
899
+ args: ["attachmentsList"]
900
+ }], showMatCard: [{
901
+ type: Input,
902
+ args: ["showMatCard"]
903
+ }], multipleAttachment: [{
904
+ type: Input,
905
+ args: ["multipleAttachment"]
906
+ }], loadMultipleFiles: [{
907
+ type: Input,
908
+ args: ["loadMultipleFiles"]
909
+ }], attachmentsColumns: [{
910
+ type: Input,
911
+ args: ["attachmentsColumns"]
912
+ }], emptyTableMessage: [{
913
+ type: Input,
914
+ args: ["emptyTableMessage"]
915
+ }], allowOnlyImages: [{
916
+ type: Input,
917
+ args: ["allowOnlyImages"]
918
+ }], acceptedFileTypes: [{
919
+ type: Input,
920
+ args: ["acceptedFileTypes"]
921
+ }], isDisabled: [{
922
+ type: Input,
923
+ args: ["isDisabled"]
924
+ }], showInlinePreview: [{
925
+ type: Input,
926
+ args: ["showInlinePreview"]
927
+ }], getAttachmentEndpoint: [{
928
+ type: Input,
929
+ args: ["getAttachmentEndpoint"]
930
+ }], productionBaseUrl: [{
931
+ type: Input,
932
+ args: ["productionBaseUrl"]
933
+ }], compressionOptions: [{
934
+ type: Input,
935
+ args: ["compressionOptions"]
936
+ }], allowedTypes: [{
937
+ type: Input,
938
+ args: ["allowedTypes"]
939
+ }], isEqpTableMultiLanguage: [{
940
+ type: Input,
941
+ args: ["isEqpTableMultiLanguage"]
942
+ }], tablePaginatorVisible: [{
943
+ type: Input,
944
+ args: ["tablePaginatorVisible"]
945
+ }], tablePaginatorSize: [{
946
+ type: Input,
947
+ args: ["tablePaginatorSize"]
948
+ }], downloadTooltipPosition: [{
949
+ type: Input,
950
+ args: ["downloadTooltipPosition"]
951
+ }], openLinkLabel: [{
952
+ type: Input,
953
+ args: ["openLinkLabel"]
954
+ }], addButtonLabel: [{
955
+ type: Input,
956
+ args: ["addButtonLabel"]
957
+ }], downloadLabel: [{
958
+ type: Input,
959
+ args: ["downloadLabel"]
960
+ }], deleteLabel: [{
961
+ type: Input,
962
+ args: ["deleteLabel"]
963
+ }], fileNameLabel: [{
964
+ type: Input,
965
+ args: ["fileNameLabel"]
966
+ }], previewLabel: [{
967
+ type: Input,
968
+ args: ["previewLabel"]
969
+ }], uploadFileLabel: [{
970
+ type: Input,
971
+ args: ["uploadFileLabel"]
972
+ }], confirmLabel: [{
973
+ type: Input,
974
+ args: ["confirmLabel"]
975
+ }], abortLabel: [{
976
+ type: Input,
977
+ args: ["abortLabel"]
978
+ }], saveLabel: [{
979
+ type: Input,
980
+ args: ["saveLabel"]
981
+ }], exitLabel: [{
982
+ type: Input,
983
+ args: ["exitLabel"]
984
+ }], eqpTableSearchText: [{
985
+ type: Input,
986
+ args: ["eqpTableSearchText"]
987
+ }], deleteDialogTitle: [{
988
+ type: Input,
989
+ args: ["deleteDialogTitle"]
990
+ }], deleteDialogMessage: [{
991
+ type: Input,
992
+ args: ["deleteDialogMessage"]
993
+ }], noImageSelectedErrorMessage: [{
994
+ type: Input,
995
+ args: ["noImageSelectedErrorMessage"]
996
+ }], wrongTypeSelectedErrorMessage: [{
997
+ type: Input,
998
+ args: ["wrongTypeSelectedErrorMessage"]
999
+ }], videoPreviewErrorMessage: [{
1000
+ type: Input,
1001
+ args: ["videoPreviewErrorMessage"]
1002
+ }], audioPreviewErrorMessage: [{
1003
+ type: Input,
1004
+ args: ["videoPreviewErrorMessage"]
1005
+ }], localEditedAttachments: [{
1006
+ type: Output
1007
+ }], abortAddAttachment: [{
1008
+ type: Output
1009
+ }], downloadAttachment: [{
1010
+ type: Output,
1011
+ args: ["downloadAttachment"]
1012
+ }], onDeleteAttachment: [{
1013
+ type: Output,
1014
+ args: ["onDeleteAttachment"]
1015
+ }], dialogAddAttachment: [{
1016
+ type: ViewChild,
1017
+ args: ['dialogAddAttachment', { static: true }]
1018
+ }], dialogAddMultipleAttachment: [{
1019
+ type: ViewChild,
1020
+ args: ['dialogAddMultipleAttachment', { static: true }]
1021
+ }], imageCropper: [{
1022
+ type: ViewChild,
1023
+ args: [ImageCropperComponent]
1024
+ }], imageInput: [{
1025
+ type: ViewChild,
1026
+ args: ['imageInput']
1027
+ }], attachmentTable: [{
1028
+ type: ViewChild,
1029
+ args: ['attachmentTable', { static: false }]
1030
+ }], inlinePreviewTemplate: [{
1031
+ type: ViewChild,
1032
+ args: ['inlinePreviewTemplate', { static: true }]
1033
+ }], dialogPreview: [{
1034
+ type: ViewChild,
1035
+ args: ['dialogPreview', { static: true }]
1036
+ }] } });
1037
+
1038
+ class MaterialModule {
1039
+ }
1040
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1041
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: MaterialModule, imports: [MatCheckboxModule,
1042
+ MatButtonModule,
1043
+ MatInputModule,
1044
+ MatAutocompleteModule,
1045
+ MatDatepickerModule,
1046
+ MatFormFieldModule,
1047
+ MatRadioModule,
1048
+ MatSelectModule,
1049
+ MatSliderModule,
1050
+ MatSlideToggleModule,
1051
+ MatMenuModule,
1052
+ MatSidenavModule,
1053
+ MatToolbarModule,
1054
+ MatListModule,
1055
+ MatGridListModule,
1056
+ MatCardModule,
1057
+ MatStepperModule,
1058
+ MatTabsModule,
1059
+ MatExpansionModule,
1060
+ MatButtonToggleModule,
1061
+ MatChipsModule,
1062
+ MatIconModule,
1063
+ MatProgressSpinnerModule,
1064
+ MatProgressBarModule,
1065
+ MatDialogModule,
1066
+ MatTooltipModule,
1067
+ MatSnackBarModule,
1068
+ MatTableModule,
1069
+ MatSortModule,
1070
+ MatPaginatorModule,
1071
+ MatDatepickerModule,
1072
+ MatNativeDateModule], exports: [MatCheckboxModule,
1073
+ MatButtonModule,
1074
+ MatInputModule,
1075
+ MatAutocompleteModule,
1076
+ MatDatepickerModule,
1077
+ MatFormFieldModule,
1078
+ MatRadioModule,
1079
+ MatSelectModule,
1080
+ MatSliderModule,
1081
+ MatSlideToggleModule,
1082
+ MatMenuModule,
1083
+ MatSidenavModule,
1084
+ MatToolbarModule,
1085
+ MatListModule,
1086
+ MatGridListModule,
1087
+ MatCardModule,
1088
+ MatStepperModule,
1089
+ MatTabsModule,
1090
+ MatExpansionModule,
1091
+ MatButtonToggleModule,
1092
+ MatChipsModule,
1093
+ MatIconModule,
1094
+ MatProgressSpinnerModule,
1095
+ MatProgressBarModule,
1096
+ MatDialogModule,
1097
+ MatTooltipModule,
1098
+ MatSnackBarModule,
1099
+ MatTableModule,
1100
+ MatSortModule,
1101
+ MatPaginatorModule] });
1102
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MaterialModule, imports: [MatCheckboxModule,
1103
+ MatButtonModule,
1104
+ MatInputModule,
1105
+ MatAutocompleteModule,
1106
+ MatDatepickerModule,
1107
+ MatFormFieldModule,
1108
+ MatRadioModule,
1109
+ MatSelectModule,
1110
+ MatSliderModule,
1111
+ MatSlideToggleModule,
1112
+ MatMenuModule,
1113
+ MatSidenavModule,
1114
+ MatToolbarModule,
1115
+ MatListModule,
1116
+ MatGridListModule,
1117
+ MatCardModule,
1118
+ MatStepperModule,
1119
+ MatTabsModule,
1120
+ MatExpansionModule,
1121
+ MatButtonToggleModule,
1122
+ MatChipsModule,
1123
+ MatIconModule,
1124
+ MatProgressSpinnerModule,
1125
+ MatProgressBarModule,
1126
+ MatDialogModule,
1127
+ MatTooltipModule,
1128
+ MatSnackBarModule,
1129
+ MatTableModule,
1130
+ MatSortModule,
1131
+ MatPaginatorModule,
1132
+ MatDatepickerModule,
1133
+ MatNativeDateModule, MatCheckboxModule,
1134
+ MatButtonModule,
1135
+ MatInputModule,
1136
+ MatAutocompleteModule,
1137
+ MatDatepickerModule,
1138
+ MatFormFieldModule,
1139
+ MatRadioModule,
1140
+ MatSelectModule,
1141
+ MatSliderModule,
1142
+ MatSlideToggleModule,
1143
+ MatMenuModule,
1144
+ MatSidenavModule,
1145
+ MatToolbarModule,
1146
+ MatListModule,
1147
+ MatGridListModule,
1148
+ MatCardModule,
1149
+ MatStepperModule,
1150
+ MatTabsModule,
1151
+ MatExpansionModule,
1152
+ MatButtonToggleModule,
1153
+ MatChipsModule,
1154
+ MatIconModule,
1155
+ MatProgressSpinnerModule,
1156
+ MatProgressBarModule,
1157
+ MatDialogModule,
1158
+ MatTooltipModule,
1159
+ MatSnackBarModule,
1160
+ MatTableModule,
1161
+ MatSortModule,
1162
+ MatPaginatorModule] });
1163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MaterialModule, decorators: [{
1164
+ type: NgModule,
1165
+ args: [{
1166
+ imports: [
1167
+ MatCheckboxModule,
1168
+ MatButtonModule,
1169
+ MatInputModule,
1170
+ MatAutocompleteModule,
1171
+ MatDatepickerModule,
1172
+ MatFormFieldModule,
1173
+ MatRadioModule,
1174
+ MatSelectModule,
1175
+ MatSliderModule,
1176
+ MatSlideToggleModule,
1177
+ MatMenuModule,
1178
+ MatSidenavModule,
1179
+ MatToolbarModule,
1180
+ MatListModule,
1181
+ MatGridListModule,
1182
+ MatCardModule,
1183
+ MatStepperModule,
1184
+ MatTabsModule,
1185
+ MatExpansionModule,
1186
+ MatButtonToggleModule,
1187
+ MatChipsModule,
1188
+ MatIconModule,
1189
+ MatProgressSpinnerModule,
1190
+ MatProgressBarModule,
1191
+ MatDialogModule,
1192
+ MatTooltipModule,
1193
+ MatSnackBarModule,
1194
+ MatTableModule,
1195
+ MatSortModule,
1196
+ MatPaginatorModule,
1197
+ MatDatepickerModule,
1198
+ MatNativeDateModule
1199
+ ],
1200
+ exports: [
1201
+ MatCheckboxModule,
1202
+ MatButtonModule,
1203
+ MatInputModule,
1204
+ MatAutocompleteModule,
1205
+ MatDatepickerModule,
1206
+ MatFormFieldModule,
1207
+ MatRadioModule,
1208
+ MatSelectModule,
1209
+ MatSliderModule,
1210
+ MatSlideToggleModule,
1211
+ MatMenuModule,
1212
+ MatSidenavModule,
1213
+ MatToolbarModule,
1214
+ MatListModule,
1215
+ MatGridListModule,
1216
+ MatCardModule,
1217
+ MatStepperModule,
1218
+ MatTabsModule,
1219
+ MatExpansionModule,
1220
+ MatButtonToggleModule,
1221
+ MatChipsModule,
1222
+ MatIconModule,
1223
+ MatProgressSpinnerModule,
1224
+ MatProgressBarModule,
1225
+ MatDialogModule,
1226
+ MatTooltipModule,
1227
+ MatSnackBarModule,
1228
+ MatTableModule,
1229
+ MatSortModule,
1230
+ MatPaginatorModule
1231
+ ],
1232
+ }]
1233
+ }] });
1234
+
1235
+ class EqpAttachmentsModule {
1236
+ }
1237
+ EqpAttachmentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1238
+ EqpAttachmentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentsModule, declarations: [EqpAttachmentsComponent], imports: [MaterialModule,
1239
+ FormsModule,
1240
+ CommonModule,
1241
+ ReactiveFormsModule,
1242
+ ImageCropperModule,
1243
+ EqpTableModule], exports: [EqpAttachmentsComponent] });
1244
+ EqpAttachmentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentsModule, imports: [MaterialModule,
1245
+ FormsModule,
1246
+ CommonModule,
1247
+ ReactiveFormsModule,
1248
+ ImageCropperModule,
1249
+ EqpTableModule] });
1250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: EqpAttachmentsModule, decorators: [{
1251
+ type: NgModule,
1252
+ args: [{
1253
+ declarations: [EqpAttachmentsComponent],
1254
+ imports: [
1255
+ MaterialModule,
1256
+ FormsModule,
1257
+ CommonModule,
1258
+ ReactiveFormsModule,
1259
+ ImageCropperModule,
1260
+ EqpTableModule
1261
+ ],
1262
+ exports: [EqpAttachmentsComponent]
1263
+ }]
1264
+ }] });
1265
+
1266
+ /*
1267
+ * Public API Surface of eqp-attachments
1268
+ */
1269
+
1270
+ /**
1271
+ * Generated bundle index. Do not edit.
1272
+ */
1273
+
1274
+ export { AttachmentHelperService, AttachmentType, EqpAttachmentDialogService, EqpAttachmentsComponent, EqpAttachmentsModule };
1275
+ //# sourceMappingURL=eqproject-eqp-attachments.mjs.map