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