@eqproject/eqp-attachments 3.1.14 → 21.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.
- package/README.md +591 -433
- package/fesm2022/eqproject-eqp-attachments.mjs +371 -562
- package/fesm2022/eqproject-eqp-attachments.mjs.map +1 -1
- package/package.json +6 -8
- package/types/eqproject-eqp-attachments.d.ts +581 -0
- package/esm2022/eqproject-eqp-attachments.mjs +0 -5
- package/esm2022/lib/eqp-attachments.component.mjs +0 -1602
- package/esm2022/lib/eqp-attachments.module.mjs +0 -35
- package/esm2022/lib/helpers/attachment.helper.mjs +0 -66
- package/esm2022/lib/interfaces/IAttachment.mjs +0 -18
- package/esm2022/lib/interfaces/IOptions.mjs +0 -2
- package/esm2022/lib/modules/material.module.mjs +0 -231
- package/esm2022/lib/services/eqp-attachment-dialog.service.mjs +0 -103
- package/esm2022/lib/services/eqp-attachment.service.mjs +0 -23
- package/esm2022/public-api.mjs +0 -10
- package/index.d.ts +0 -5
- package/lib/eqp-attachments.component.d.ts +0 -415
- package/lib/eqp-attachments.module.d.ts +0 -11
- package/lib/helpers/attachment.helper.d.ts +0 -20
- package/lib/interfaces/IAttachment.d.ts +0 -53
- package/lib/interfaces/IOptions.d.ts +0 -11
- package/lib/modules/material.module.d.ts +0 -37
- package/lib/services/eqp-attachment-dialog.service.d.ts +0 -31
- package/lib/services/eqp-attachment.service.d.ts +0 -7
- package/public-api.d.ts +0 -6
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from "@angular/common/http";
|
|
2
|
-
import { EventEmitter, OnInit, TemplateRef } from "@angular/core";
|
|
3
|
-
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
4
|
-
import { MatDialog, MatDialogRef } from "@angular/material/dialog";
|
|
5
|
-
import { DomSanitizer } from "@angular/platform-browser";
|
|
6
|
-
import { ImageCroppedEvent, ImageCropperComponent, ImageTransform } from "ngx-image-cropper";
|
|
7
|
-
import { AttachmentCardSize, AttachmentFieldColumn, AttachmentMenuAction, AttachmentType, CropOptionEnum, IAttachmentDTO } from "./interfaces/IAttachment";
|
|
8
|
-
import { IOptions } from "./interfaces/IOptions";
|
|
9
|
-
import { EqpAttachmentService } from "./services/eqp-attachment.service";
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
export declare class EqpAttachmentsComponent implements OnInit {
|
|
12
|
-
#private;
|
|
13
|
-
private dialog;
|
|
14
|
-
private formBuilder;
|
|
15
|
-
private sanitizer;
|
|
16
|
-
private http;
|
|
17
|
-
private eqpAttachmentService;
|
|
18
|
-
/**
|
|
19
|
-
* Se TRUE allora nasconde la colonna per le azioni sull'allegato (nel caso "multipleAttachment" è TRUE).
|
|
20
|
-
*/
|
|
21
|
-
disableAction: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Se TRUE mostra il titolo nell'header nel caso in cui "multipleAttachment" è TRUE ("Elenco allegati" di default).
|
|
24
|
-
*/
|
|
25
|
-
showHeader: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Sorgente dati da visualizzare. Nel caso si vuole gestire un singolo allegato va passato in ogni caso come Array.
|
|
28
|
-
*/
|
|
29
|
-
attachmentsList: Array<IAttachmentDTO>;
|
|
30
|
-
/**
|
|
31
|
-
* Nel caso si vuole gestire un solo elemento senza passarlo come array, lo passo come singolo allegato e gestisco nella libreria l'array.
|
|
32
|
-
*/
|
|
33
|
-
singleAttachment: IAttachmentDTO;
|
|
34
|
-
/**
|
|
35
|
-
* Se TRUE non mostra la MatCard (nel caso in cui "multipleAttachment" è TRUE).
|
|
36
|
-
*/
|
|
37
|
-
showMatCard: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 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".
|
|
40
|
-
* Se TRUE allora il componente mostra l'elenco di tutti gli allegati ricevuto nel parametro "attachmentsList".
|
|
41
|
-
*/
|
|
42
|
-
multipleAttachment: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Se assume il valore TRUE allora sarà possibile caricare più file per volta. Questa funzionalità è attiva
|
|
45
|
-
* SOLO se si gestiscono allegati multipli, quindi se l'input 'multipleAttachment' assume il valore TRUE, altrimenti è sempre disabilitata.
|
|
46
|
-
*/
|
|
47
|
-
loadMultipleFiles: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Imposta il messaggio da visualizzare nel caso in cui la tabella degli allegati (nel caso in cui "multipleAttachment" è TRUE) è vuota.
|
|
50
|
-
*/
|
|
51
|
-
emptyTableMessage: string;
|
|
52
|
-
/**
|
|
53
|
-
* Se TRUE allora permette di selezionare soltanto file di tipo immagine, avente uno dei mimetype
|
|
54
|
-
* specificati dentro AttachmentHelperService.
|
|
55
|
-
* Se FALSE permette di selezionare qualsiasi tipo di file
|
|
56
|
-
*/
|
|
57
|
-
allowOnlyImages: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Specifica i tipi di file che è possibile caricare
|
|
60
|
-
*/
|
|
61
|
-
acceptedFileTypes: string;
|
|
62
|
-
/**
|
|
63
|
-
* Se TRUE disabilita il pulsante di Aggiunta allegato (a prescindere dal valore del parametro "multipleAttachment").
|
|
64
|
-
*/
|
|
65
|
-
isDisabled: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Mostra/nasconde la colonna per visualizzare l'anteprima dei file nella tabella (caso multipleAtatchments = true).
|
|
68
|
-
*/
|
|
69
|
-
showInlinePreview: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Endpoint da chiamare per recueprare l'IAttachmentDTO completo da vedere nell'anteprima. La chiamata sarà in POST e nel body
|
|
72
|
-
* conterrà l'IAttachmentDTO selezionato dall'utente.
|
|
73
|
-
* La chiamata viene eseguita solo per l'anteprima delle immagini essendo necessario il base64 completo dell'immagine a dimensione reale.
|
|
74
|
-
* Per documenti/link basta che sia popolata la proprietà FilePath di IAttachmentDTO.
|
|
75
|
-
*/
|
|
76
|
-
getAttachmentEndpoint: string;
|
|
77
|
-
/**
|
|
78
|
-
* Hostname dell'ambiente di produzione dell'applicativo. Necessario per visualizzare l'anteprima dei documenti
|
|
79
|
-
* tramite il viewer di google.
|
|
80
|
-
* NOTA: Per visualizzare l'anteprima è necessario che la prorietà FilePath dell'IAttachmentDTO sia popolata e che
|
|
81
|
-
* sia abilitato l'accesso alla cartella sul server tramite hostname.
|
|
82
|
-
*/
|
|
83
|
-
productionBaseUrl: string;
|
|
84
|
-
/**
|
|
85
|
-
* Opzioni per la compressione delle immagini caricate.
|
|
86
|
-
*/
|
|
87
|
-
compressionOptions: IOptions;
|
|
88
|
-
/**
|
|
89
|
-
* Array di AttachmentType che si possono aggiungere
|
|
90
|
-
*/
|
|
91
|
-
allowedTypes: Array<AttachmentType>;
|
|
92
|
-
/**
|
|
93
|
-
* Permette di stabilire se la eqp-table contenente l'elenco degli allegati utilizza
|
|
94
|
-
* il multilingua oppure no
|
|
95
|
-
*/
|
|
96
|
-
isEqpTableMultiLanguage: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco
|
|
99
|
-
* degli allegati deve essere paginata oppure no
|
|
100
|
-
*/
|
|
101
|
-
tablePaginatorVisible: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco
|
|
104
|
-
* degli allegati deve contenere il campo di ricerca oppure no
|
|
105
|
-
*/
|
|
106
|
-
isTableSearcheable: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* In caso di gestione allegati multipli, permette di stabilire la dimensione pagina di default
|
|
109
|
-
* per la tabella contenente l'elenco degli allegati
|
|
110
|
-
*/
|
|
111
|
-
tablePaginatorSize: number;
|
|
112
|
-
/**
|
|
113
|
-
* Permette di scegliere il modo in cui i file devono essere caricati
|
|
114
|
-
*/
|
|
115
|
-
/**
|
|
116
|
-
* Permette di stabilire se i pulsanti per il caricamento dei file sono separati o in un menù a tendina
|
|
117
|
-
*/
|
|
118
|
-
separatedUploadButtons: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Permette di scegliere se dare la possibilità di vedere o no l'anteprima
|
|
121
|
-
*/
|
|
122
|
-
showPreview: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* In caso di allegato singolo, permette di scegliere se aggiungere file tramite drag and drop
|
|
125
|
-
*/
|
|
126
|
-
singleAttachmentDragAndDrop: boolean;
|
|
127
|
-
/**
|
|
128
|
-
* Array di opzioni che si possono utilizzare per il crop
|
|
129
|
-
*/
|
|
130
|
-
cropOptions: Array<CropOptionEnum>;
|
|
131
|
-
/**
|
|
132
|
-
* Classe custom da assegnare al dialog del crop immagini
|
|
133
|
-
*/
|
|
134
|
-
cropDialogClass: string;
|
|
135
|
-
maxFileSizeMB: number;
|
|
136
|
-
cardSize: AttachmentCardSize;
|
|
137
|
-
customCardWidthPx: number;
|
|
138
|
-
customCardHeightPx: number;
|
|
139
|
-
layout: 'full' | 'compact';
|
|
140
|
-
/**
|
|
141
|
-
* Input per definire le label da usare nel componente
|
|
142
|
-
*/
|
|
143
|
-
openLinkLabel: string;
|
|
144
|
-
addButtonLabel: string;
|
|
145
|
-
downloadLabel: string;
|
|
146
|
-
deleteLabel: string;
|
|
147
|
-
fileNameLabel: string;
|
|
148
|
-
previewLabel: string;
|
|
149
|
-
uploadFileLabel: string;
|
|
150
|
-
confirmLabel: string;
|
|
151
|
-
abortLabel: string;
|
|
152
|
-
saveLabel: string;
|
|
153
|
-
exitLabel: string;
|
|
154
|
-
uploadWithDropboxLabel: string;
|
|
155
|
-
cropLabel: string;
|
|
156
|
-
deleteDialogTitle: string;
|
|
157
|
-
deleteDialogMessage: string;
|
|
158
|
-
noImageSelectedErrorMessage: string;
|
|
159
|
-
wrongTypeSelectedErrorMessage: string;
|
|
160
|
-
videoPreviewErrorMessage: string;
|
|
161
|
-
audioPreviewErrorMessage: string;
|
|
162
|
-
flipHorinzontalLabel: string;
|
|
163
|
-
flipVerticalLabel: string;
|
|
164
|
-
rotateRightLabel: string;
|
|
165
|
-
rotateLeftLabel: string;
|
|
166
|
-
base64LimitMB: number;
|
|
167
|
-
uploadTitle: string;
|
|
168
|
-
uploadSubtitle: string;
|
|
169
|
-
dropHereLabel: string;
|
|
170
|
-
supportedFormatsLabel: string;
|
|
171
|
-
browseFilesLabel: string;
|
|
172
|
-
uploadSummaryLabel: string;
|
|
173
|
-
filesLabel: string;
|
|
174
|
-
totalSizeLabel: string;
|
|
175
|
-
emptyStateLabel: string;
|
|
176
|
-
addedSuccessfullyLabel: string;
|
|
177
|
-
removedLabel: string;
|
|
178
|
-
chooseView: boolean;
|
|
179
|
-
showSummary: boolean;
|
|
180
|
-
viewMode: 'card' | 'table';
|
|
181
|
-
showUploadTitle: boolean;
|
|
182
|
-
showDropArea: boolean;
|
|
183
|
-
hiddenColumns: string[];
|
|
184
|
-
hiddenActions: string[];
|
|
185
|
-
showActionButtons: boolean;
|
|
186
|
-
/**
|
|
187
|
-
* Se TRUE allora mostra il dialog di crop per le immagini singole.
|
|
188
|
-
* Se FALSE carica l'immagine direttamente (applicando comunque la compressione se attiva).
|
|
189
|
-
*/
|
|
190
|
-
enableImageCrop: boolean;
|
|
191
|
-
/**
|
|
192
|
-
* Hook globale: decide se nascondere un’azione per quello specifico allegato.
|
|
193
|
-
*/
|
|
194
|
-
actionHiddenFn?: (actionKey: string, att?: IAttachmentDTO) => boolean;
|
|
195
|
-
/**
|
|
196
|
-
* Hook globale: decide se disabilitare un’azione per quello specifico allegato.
|
|
197
|
-
*/
|
|
198
|
-
actionDisabledFn?: (actionKey: string, att?: IAttachmentDTO) => boolean;
|
|
199
|
-
videoCompression: {
|
|
200
|
-
enabled: boolean;
|
|
201
|
-
maxWidth?: number;
|
|
202
|
-
bitrate?: number;
|
|
203
|
-
crf?: number;
|
|
204
|
-
preset?: string;
|
|
205
|
-
maxFps?: number;
|
|
206
|
-
audioBitrate?: number;
|
|
207
|
-
};
|
|
208
|
-
private _customMenuActions;
|
|
209
|
-
_sortedMenuActions: AttachmentMenuAction[];
|
|
210
|
-
set customMenuActions(value: AttachmentMenuAction[]);
|
|
211
|
-
get customMenuActions(): AttachmentMenuAction[];
|
|
212
|
-
private _customColumns;
|
|
213
|
-
/**
|
|
214
|
-
* SOLO quando [customColumns]="..." cambia.
|
|
215
|
-
*/
|
|
216
|
-
set customColumns(value: AttachmentFieldColumn[]);
|
|
217
|
-
get customColumns(): AttachmentFieldColumn[];
|
|
218
|
-
/**
|
|
219
|
-
* Restituisce la lista aggiornata degli allegati.
|
|
220
|
-
*/
|
|
221
|
-
localEditedAttachments: EventEmitter<Array<IAttachmentDTO>>;
|
|
222
|
-
/**
|
|
223
|
-
* Evento scatenato alla pressione del pulsante ESCI della modale di caricamento file.
|
|
224
|
-
*/
|
|
225
|
-
abortAddAttachment: EventEmitter<any>;
|
|
226
|
-
/**
|
|
227
|
-
* Evento di output che restituisce l'IAttachmentDTO selezionato per il download nel caso FileDataBase64, FileContentType o FileName non fossero specificati.
|
|
228
|
-
*/
|
|
229
|
-
downloadAttachment: EventEmitter<IAttachmentDTO>;
|
|
230
|
-
/**
|
|
231
|
-
* Evento di output che restituisce l'elemento eliminato prima che questo venga effettivamente rismosso dalla lista.
|
|
232
|
-
*/
|
|
233
|
-
onDeleteAttachment: EventEmitter<IAttachmentDTO>;
|
|
234
|
-
newAttachment: IAttachmentDTO;
|
|
235
|
-
newMultipleAttachments: Array<IAttachmentDTO>;
|
|
236
|
-
attachmentType: typeof AttachmentType;
|
|
237
|
-
newAttachmentForm: FormGroup;
|
|
238
|
-
selectedFile: File;
|
|
239
|
-
selectedFiles: Array<File>;
|
|
240
|
-
showCropImage: boolean;
|
|
241
|
-
dialogAddAttachment: TemplateRef<any>;
|
|
242
|
-
dialogRefAddAttachment: MatDialogRef<TemplateRef<any>>;
|
|
243
|
-
dialogAddMultipleAttachment: TemplateRef<any>;
|
|
244
|
-
dialogRefCropImage: MatDialogRef<TemplateRef<any>>;
|
|
245
|
-
dialogCropImage: TemplateRef<any>;
|
|
246
|
-
addingLinkTemplate: TemplateRef<any>;
|
|
247
|
-
imageChangedEvent: any;
|
|
248
|
-
croppedImage: any;
|
|
249
|
-
transform: ImageTransform;
|
|
250
|
-
canvasRotation: number;
|
|
251
|
-
imageCropper: ImageCropperComponent;
|
|
252
|
-
imageInput: any;
|
|
253
|
-
AttachmentType: typeof AttachmentType;
|
|
254
|
-
selectedAttachment: IAttachmentDTO;
|
|
255
|
-
originalWidth: number;
|
|
256
|
-
originalHeight: number;
|
|
257
|
-
customWidth: number;
|
|
258
|
-
customHeight: number;
|
|
259
|
-
inlinePreviewTemplate: TemplateRef<any>;
|
|
260
|
-
dialogPreview: TemplateRef<any>;
|
|
261
|
-
imageFile: File;
|
|
262
|
-
addingLinkMode: boolean;
|
|
263
|
-
_tableColumns: AttachmentFieldColumn[];
|
|
264
|
-
defaultFileTemplate: TemplateRef<any>;
|
|
265
|
-
defaultActionsTemplate: TemplateRef<any>;
|
|
266
|
-
dragOver: boolean;
|
|
267
|
-
toast: {
|
|
268
|
-
visible: boolean;
|
|
269
|
-
type: "error" | "success" | "info";
|
|
270
|
-
text: string;
|
|
271
|
-
timeoutId: any;
|
|
272
|
-
};
|
|
273
|
-
progressPercent: number;
|
|
274
|
-
totalSizeBytes: number;
|
|
275
|
-
get totalSizeFormatted(): string;
|
|
276
|
-
formatFileSize(bytes: number): string;
|
|
277
|
-
showToast(message: string, type?: 'success' | 'error' | 'info', durationMs?: number): void;
|
|
278
|
-
constructor(dialog: MatDialog, formBuilder: FormBuilder, sanitizer: DomSanitizer, http: HttpClient, eqpAttachmentService: EqpAttachmentService);
|
|
279
|
-
ngOnInit(): void;
|
|
280
|
-
setViewMode(mode: 'card' | 'table'): void;
|
|
281
|
-
private recomputeTotalsAndProgress;
|
|
282
|
-
ngOnDestroy(): void;
|
|
283
|
-
bytesFromBase64(base64: string): number;
|
|
284
|
-
checkAttachmentImage(): void;
|
|
285
|
-
/**
|
|
286
|
-
* Elimina un allegato eliminando anche il file presente nello storage di archiviazione utilizzato (AWS o cartella progetto)
|
|
287
|
-
* @param element IAttachmentDTO da cancellare
|
|
288
|
-
*/
|
|
289
|
-
deleteAttachment(element: IAttachmentDTO): void;
|
|
290
|
-
/**
|
|
291
|
-
* Rimuove l'allegato selezionato dalla lista "attachmentsList" e invoca l'evento di output che restituisce la lista aggiornata.
|
|
292
|
-
* @param attachmentIndex Indice dell'attachment da rimuovere
|
|
293
|
-
*/
|
|
294
|
-
removeAttachmentFromList(attachmentIndex: number): void;
|
|
295
|
-
private simulateProgress;
|
|
296
|
-
/**
|
|
297
|
-
* Scarica l'allegato o apre il link
|
|
298
|
-
* @param element Allegato da mostrare
|
|
299
|
-
*/
|
|
300
|
-
viewAttachment(attachment: IAttachmentDTO): void;
|
|
301
|
-
/**
|
|
302
|
-
* Ridefinisce l'icona da mostrare nella colonna dell'eqp-table per ogni file.
|
|
303
|
-
* L'icona varia in base all'estensione del file
|
|
304
|
-
* @param attachment
|
|
305
|
-
*/
|
|
306
|
-
getAttachmentIcon(attachment: IAttachmentDTO): string;
|
|
307
|
-
/**
|
|
308
|
-
* In caso di allegato singolo, sceglie quale metodo richiamare in base al tipo di allegato
|
|
309
|
-
*/
|
|
310
|
-
addFile(attachmentType: AttachmentType, imageInput?: any): void;
|
|
311
|
-
createAttachmentForm(): void;
|
|
312
|
-
close(emitCloseEvent?: boolean): void;
|
|
313
|
-
/**
|
|
314
|
-
* In base al tipo di allegato controlla se disabilitare o meno il pulsante per salvare.
|
|
315
|
-
* Funzione usata nel [disable] del pulsante "Salva" del dialog per l'aggiunta di un allegato.
|
|
316
|
-
* @returns
|
|
317
|
-
*/
|
|
318
|
-
disableSave(): boolean;
|
|
319
|
-
confirmAddAttachment(): void;
|
|
320
|
-
private resetSelectedFiles;
|
|
321
|
-
/**
|
|
322
|
-
* Apre il dialog per l'anteprima dell'allegato selezionato.
|
|
323
|
-
* @param row
|
|
324
|
-
* @returns
|
|
325
|
-
*/
|
|
326
|
-
openPreviewDialog(row: IAttachmentDTO): Promise<void>;
|
|
327
|
-
getAttachmentByID(): Promise<IAttachmentDTO>;
|
|
328
|
-
/**
|
|
329
|
-
* Evento scatenato alla selezione del file (o dei file).
|
|
330
|
-
* 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
|
|
331
|
-
* mostrare le funzionalità del croppie (per ritagliare l'immagine) oppure no.
|
|
332
|
-
* Se il file caricato non è un immagine allora genera direttamente il base64 e lo associa all'allegato da salvare.
|
|
333
|
-
* Se invece il caricamento dei file è MULTIPLO e sono presenti più file allora esegue le stesse operazioni ignorando però il contrllo
|
|
334
|
-
* immagine per il croppie (in caso di caricamento multiplo le funzionalità del croppie sono disabilitate).
|
|
335
|
-
*/
|
|
336
|
-
onFileAdded(event: any, isFileDropped?: boolean): Promise<void>;
|
|
337
|
-
private validationFile;
|
|
338
|
-
/**
|
|
339
|
-
* A partire dal FILE ricevuto in input ricostruisce l'oggetto IAttachmentDTO e lo restituisce.
|
|
340
|
-
* Se il parametro getBase64 viene passato a TRUE allora, sempre a partire dal file,genera il base64 e
|
|
341
|
-
* ricava il ContentType da associare all'oggetto IAttachmentDTO da restituire
|
|
342
|
-
* @param currentFile Oggetto FILE da processare
|
|
343
|
-
* @param getBase64 Se TRUE allora calcola base64 e ContentType del file passato in input
|
|
344
|
-
* @returns Restituisce un oggetto di tipo IAttachmentDTO
|
|
345
|
-
*/
|
|
346
|
-
private createAttachmentFromUploadedFile;
|
|
347
|
-
/**
|
|
348
|
-
* A partire dal file passato in input restituisce un oggetto
|
|
349
|
-
* contenente il base64 del file e il suo contentType
|
|
350
|
-
* @param currentFile Oggetto File da cui estrapolare base64 e contentType
|
|
351
|
-
* @returns Restituisce un oggetto avente le proprietà Base64File e ContentType
|
|
352
|
-
*/
|
|
353
|
-
private getBase64FromFile;
|
|
354
|
-
/**
|
|
355
|
-
* Controlla se il file che si sta caricando è supportato dal sistema.
|
|
356
|
-
* @returns
|
|
357
|
-
*/
|
|
358
|
-
private checkAcceptedFiles;
|
|
359
|
-
/**
|
|
360
|
-
* Se eqp-attachments è stata configurata per il caricamento delle sole immagini allora verifica che il file passato in
|
|
361
|
-
* input sia effettivamente un immagine o no.
|
|
362
|
-
* Se il controllo va a buon fine restituisce TRUE altrimenti mostra un messaggio d'errore e restituisce FALSE
|
|
363
|
-
*/
|
|
364
|
-
private checkAllowOnlyImageFile;
|
|
365
|
-
getImageDimensions(img: any): void;
|
|
366
|
-
restoreOriginalDimensions(): void;
|
|
367
|
-
onDimensionsChange(dimension: string): void;
|
|
368
|
-
imageCropped(event: ImageCroppedEvent): void;
|
|
369
|
-
getCroppedAndUpload(file: any, newAttachment: IAttachmentDTO): void;
|
|
370
|
-
rotateLeft(): void;
|
|
371
|
-
rotateRight(): void;
|
|
372
|
-
private flipAfterRotate;
|
|
373
|
-
flipHorizontal(): void;
|
|
374
|
-
flipVertical(): void;
|
|
375
|
-
/**
|
|
376
|
-
* Annulla la selezione del file, svuotando l'input e resettando tutte le proprietà dell'IAttachmentDTO
|
|
377
|
-
*/
|
|
378
|
-
abortFile(): void;
|
|
379
|
-
fileDropped(event: DragEvent): void;
|
|
380
|
-
chooseDropboxFile(): void;
|
|
381
|
-
onSelectFile(event: any, fileInput: any): void;
|
|
382
|
-
/**
|
|
383
|
-
* Apre il dialogo per l'inserimento del link.
|
|
384
|
-
*/
|
|
385
|
-
switchToAddingLinkMode(): void;
|
|
386
|
-
getCardClass(att: IAttachmentDTO): {
|
|
387
|
-
[key: string]: boolean;
|
|
388
|
-
};
|
|
389
|
-
getPreviewsContainerStyle(): {
|
|
390
|
-
[key: string]: string;
|
|
391
|
-
};
|
|
392
|
-
handlePrimaryAction(attachment: IAttachmentDTO): void;
|
|
393
|
-
/**
|
|
394
|
-
* Determines if an attachment can be previewed in the dialog.
|
|
395
|
-
* @param att The attachment to check.
|
|
396
|
-
* @returns `true` if a preview is available, otherwise `false`.
|
|
397
|
-
*/
|
|
398
|
-
canBePreviewed(att: IAttachmentDTO): boolean;
|
|
399
|
-
private isColumnHidden;
|
|
400
|
-
isActionHidden(action: AttachmentMenuAction, att?: IAttachmentDTO): boolean;
|
|
401
|
-
isActionDisabled(action: AttachmentMenuAction, att?: IAttachmentDTO): boolean;
|
|
402
|
-
isDeleteHidden(att: IAttachmentDTO): boolean;
|
|
403
|
-
isDeleteDisabled(att: IAttachmentDTO): boolean;
|
|
404
|
-
isPrimaryActionHidden(att: IAttachmentDTO): boolean;
|
|
405
|
-
isPrimaryActionDisabled(att: IAttachmentDTO): boolean;
|
|
406
|
-
/**
|
|
407
|
-
* Unisce le colonne di default con quelle custom e le ordina.
|
|
408
|
-
*/
|
|
409
|
-
private setupTableColumns;
|
|
410
|
-
private setupMenuActions;
|
|
411
|
-
private generateVideoThumbnail;
|
|
412
|
-
private compressVideoApi;
|
|
413
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EqpAttachmentsComponent, never>;
|
|
414
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EqpAttachmentsComponent, "eqp-attachments", never, { "disableAction": { "alias": "disableAction"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "attachmentsList": { "alias": "attachmentsList"; "required": false; }; "singleAttachment": { "alias": "singleAttachment"; "required": false; }; "showMatCard": { "alias": "showMatCard"; "required": false; }; "multipleAttachment": { "alias": "multipleAttachment"; "required": false; }; "loadMultipleFiles": { "alias": "loadMultipleFiles"; "required": false; }; "emptyTableMessage": { "alias": "emptyTableMessage"; "required": false; }; "allowOnlyImages": { "alias": "allowOnlyImages"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "showInlinePreview": { "alias": "showInlinePreview"; "required": false; }; "getAttachmentEndpoint": { "alias": "getAttachmentEndpoint"; "required": false; }; "productionBaseUrl": { "alias": "productionBaseUrl"; "required": false; }; "compressionOptions": { "alias": "compressionOptions"; "required": false; }; "allowedTypes": { "alias": "allowedTypes"; "required": false; }; "isEqpTableMultiLanguage": { "alias": "isEqpTableMultiLanguage"; "required": false; }; "tablePaginatorVisible": { "alias": "tablePaginatorVisible"; "required": false; }; "isTableSearcheable": { "alias": "isTableSearcheable"; "required": false; }; "tablePaginatorSize": { "alias": "tablePaginatorSize"; "required": false; }; "separatedUploadButtons": { "alias": "separatedUploadButtons"; "required": false; }; "showPreview": { "alias": "showPreview"; "required": false; }; "singleAttachmentDragAndDrop": { "alias": "singleAttachmentDragAndDrop"; "required": false; }; "cropOptions": { "alias": "cropOptions"; "required": false; }; "cropDialogClass": { "alias": "cropDialogClass"; "required": false; }; "maxFileSizeMB": { "alias": "maxFileSizeMB"; "required": false; }; "cardSize": { "alias": "cardSize"; "required": false; }; "customCardWidthPx": { "alias": "customCardWidthPx"; "required": false; }; "customCardHeightPx": { "alias": "customCardHeightPx"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "openLinkLabel": { "alias": "openLinkLabel"; "required": false; }; "addButtonLabel": { "alias": "addButtonLabel"; "required": false; }; "downloadLabel": { "alias": "downloadLabel"; "required": false; }; "deleteLabel": { "alias": "deleteLabel"; "required": false; }; "fileNameLabel": { "alias": "fileNameLabel"; "required": false; }; "previewLabel": { "alias": "previewLabel"; "required": false; }; "uploadFileLabel": { "alias": "uploadFileLabel"; "required": false; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; }; "abortLabel": { "alias": "abortLabel"; "required": false; }; "saveLabel": { "alias": "saveLabel"; "required": false; }; "exitLabel": { "alias": "exitLabel"; "required": false; }; "uploadWithDropboxLabel": { "alias": "uploadWithDropboxLabel"; "required": false; }; "cropLabel": { "alias": "cropLabel"; "required": false; }; "deleteDialogTitle": { "alias": "deleteDialogTitle"; "required": false; }; "deleteDialogMessage": { "alias": "deleteDialogMessage"; "required": false; }; "noImageSelectedErrorMessage": { "alias": "noImageSelectedErrorMessage"; "required": false; }; "wrongTypeSelectedErrorMessage": { "alias": "wrongTypeSelectedErrorMessage"; "required": false; }; "videoPreviewErrorMessage": { "alias": "videoPreviewErrorMessage"; "required": false; }; "audioPreviewErrorMessage": { "alias": "videoPreviewErrorMessage"; "required": false; }; "flipHorinzontalLabel": { "alias": "flipHorinzontalLabel"; "required": false; }; "flipVerticalLabel": { "alias": "flipVerticalLabel"; "required": false; }; "rotateRightLabel": { "alias": "rotateRightLabel"; "required": false; }; "rotateLeftLabel": { "alias": "rotateLeftLabel"; "required": false; }; "base64LimitMB": { "alias": "base64LimitMB"; "required": false; }; "uploadTitle": { "alias": "uploadTitle"; "required": false; }; "uploadSubtitle": { "alias": "uploadSubtitle"; "required": false; }; "dropHereLabel": { "alias": "dropHereLabel"; "required": false; }; "supportedFormatsLabel": { "alias": "supportedFormatsLabel"; "required": false; }; "browseFilesLabel": { "alias": "browseFilesLabel"; "required": false; }; "uploadSummaryLabel": { "alias": "uploadSummaryLabel"; "required": false; }; "filesLabel": { "alias": "filesLabel"; "required": false; }; "totalSizeLabel": { "alias": "totalSizeLabel"; "required": false; }; "emptyStateLabel": { "alias": "emptyStateLabel"; "required": false; }; "addedSuccessfullyLabel": { "alias": "addedSuccessfullyLabel"; "required": false; }; "removedLabel": { "alias": "removedLabel"; "required": false; }; "chooseView": { "alias": "chooseView"; "required": false; }; "showSummary": { "alias": "showSummary"; "required": false; }; "viewMode": { "alias": "viewMode"; "required": false; }; "showUploadTitle": { "alias": "showUploadTitle"; "required": false; }; "showDropArea": { "alias": "showDropArea"; "required": false; }; "hiddenColumns": { "alias": "hiddenColumns"; "required": false; }; "hiddenActions": { "alias": "hiddenActions"; "required": false; }; "showActionButtons": { "alias": "showActionButtons"; "required": false; }; "enableImageCrop": { "alias": "enableImageCrop"; "required": false; }; "actionHiddenFn": { "alias": "actionHiddenFn"; "required": false; }; "actionDisabledFn": { "alias": "actionDisabledFn"; "required": false; }; "videoCompression": { "alias": "videoCompression"; "required": false; }; "customMenuActions": { "alias": "customMenuActions"; "required": false; }; "customColumns": { "alias": "customColumns"; "required": false; }; }, { "localEditedAttachments": "localEditedAttachments"; "abortAddAttachment": "abortAddAttachment"; "downloadAttachment": "downloadAttachment"; "onDeleteAttachment": "onDeleteAttachment"; }, never, never, false, never>;
|
|
415
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./eqp-attachments.component";
|
|
3
|
-
import * as i2 from "./modules/material.module";
|
|
4
|
-
import * as i3 from "@angular/forms";
|
|
5
|
-
import * as i4 from "@angular/common";
|
|
6
|
-
import * as i5 from "ngx-image-cropper";
|
|
7
|
-
export declare class EqpAttachmentsModule {
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EqpAttachmentsModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<EqpAttachmentsModule, [typeof i1.EqpAttachmentsComponent], [typeof i2.MaterialModule, typeof i3.FormsModule, typeof i4.CommonModule, typeof i3.ReactiveFormsModule, typeof i5.ImageCropperComponent], [typeof i1.EqpAttachmentsComponent]>;
|
|
10
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<EqpAttachmentsModule>;
|
|
11
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class AttachmentHelperService {
|
|
3
|
-
static readonly imageMimeTypes: string[];
|
|
4
|
-
static readonly fileExtensionIcon: any;
|
|
5
|
-
static readonly dropboxCredentials: any;
|
|
6
|
-
constructor();
|
|
7
|
-
/**
|
|
8
|
-
* Restituisce TRUE se il mime type passato nel parametro corrisponde ad un mime type di un'immagine
|
|
9
|
-
* @param mimeType Mime Type da verificare
|
|
10
|
-
*/
|
|
11
|
-
static checkImageFromMimeType(mimeType: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* In base all'estensione passata come parametro, restituisce la FontAwesome corretta da utilizzare.
|
|
14
|
-
* Se l'estensione non viene trovata nella costante riportata dentro common.model.ts restituisce un icona standard
|
|
15
|
-
* @param extension Estensione del file per cui restituire l'icona corretta
|
|
16
|
-
*/
|
|
17
|
-
static getIconFromFileExtensione(extension: string): string;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentHelperService, never>;
|
|
19
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AttachmentHelperService>;
|
|
20
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from "@angular/core";
|
|
2
|
-
export interface IAttachmentDTO {
|
|
3
|
-
ID: number | string;
|
|
4
|
-
FileName?: string;
|
|
5
|
-
FileContentType?: string;
|
|
6
|
-
FileExtension?: string;
|
|
7
|
-
FilePath?: string;
|
|
8
|
-
AttachmentType?: AttachmentType;
|
|
9
|
-
FileDataBase64?: string;
|
|
10
|
-
IsImage?: boolean;
|
|
11
|
-
FileThumbnailBase64?: string;
|
|
12
|
-
TrustedUrl?: any;
|
|
13
|
-
isUploading?: boolean;
|
|
14
|
-
LargeFile?: File;
|
|
15
|
-
IsLargeFile?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare enum AttachmentType {
|
|
18
|
-
FILE = 1,
|
|
19
|
-
LINK = 2,
|
|
20
|
-
DROPBOX = 3
|
|
21
|
-
}
|
|
22
|
-
export declare enum CropOptionEnum {
|
|
23
|
-
ROTATE = 1,
|
|
24
|
-
FLIP = 2
|
|
25
|
-
}
|
|
26
|
-
export type AttachmentCardSize = 'small' | 'medium' | 'large' | 'custom';
|
|
27
|
-
export type Layout = 'full' | 'compact';
|
|
28
|
-
export interface AttachmentFieldColumn {
|
|
29
|
-
key: string;
|
|
30
|
-
display: string;
|
|
31
|
-
type?: TypeAttachmentColumn;
|
|
32
|
-
styles?: {
|
|
33
|
-
flex: string;
|
|
34
|
-
};
|
|
35
|
-
externalTemplate?: TemplateRef<any>;
|
|
36
|
-
position?: number;
|
|
37
|
-
class?: string;
|
|
38
|
-
hidden?: boolean | (() => boolean);
|
|
39
|
-
}
|
|
40
|
-
export interface AttachmentMenuAction {
|
|
41
|
-
key?: string;
|
|
42
|
-
name: string;
|
|
43
|
-
icon: string;
|
|
44
|
-
fn: (attachment: IAttachmentDTO) => void;
|
|
45
|
-
disabled?: (attachment: IAttachmentDTO) => boolean;
|
|
46
|
-
hidden?: (attachment: IAttachmentDTO) => boolean;
|
|
47
|
-
position?: number;
|
|
48
|
-
}
|
|
49
|
-
export declare enum TypeAttachmentColumn {
|
|
50
|
-
DATE = "date",
|
|
51
|
-
TEMPLATE = "template",
|
|
52
|
-
TEXT = "text"
|
|
53
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interfaccia presa dal pacchetto "browser-image-compression" per specificare le opzioni di compressione
|
|
3
|
-
*/
|
|
4
|
-
export interface IOptions {
|
|
5
|
-
/** @default Number.POSITIVE_INFINITY */
|
|
6
|
-
maxSizeMB?: number;
|
|
7
|
-
/** @default undefined */
|
|
8
|
-
maxWidthOrHeight?: number;
|
|
9
|
-
/** @default false */
|
|
10
|
-
useWebWorker?: boolean;
|
|
11
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "@angular/material/checkbox";
|
|
3
|
-
import * as i2 from "@angular/material/button";
|
|
4
|
-
import * as i3 from "@angular/material/input";
|
|
5
|
-
import * as i4 from "@angular/material/autocomplete";
|
|
6
|
-
import * as i5 from "@angular/material/datepicker";
|
|
7
|
-
import * as i6 from "@angular/material/form-field";
|
|
8
|
-
import * as i7 from "@angular/material/radio";
|
|
9
|
-
import * as i8 from "@angular/material/select";
|
|
10
|
-
import * as i9 from "@angular/material/slider";
|
|
11
|
-
import * as i10 from "@angular/material/slide-toggle";
|
|
12
|
-
import * as i11 from "@angular/material/menu";
|
|
13
|
-
import * as i12 from "@angular/material/sidenav";
|
|
14
|
-
import * as i13 from "@angular/material/toolbar";
|
|
15
|
-
import * as i14 from "@angular/material/list";
|
|
16
|
-
import * as i15 from "@angular/material/grid-list";
|
|
17
|
-
import * as i16 from "@angular/material/card";
|
|
18
|
-
import * as i17 from "@angular/material/stepper";
|
|
19
|
-
import * as i18 from "@angular/material/tabs";
|
|
20
|
-
import * as i19 from "@angular/material/expansion";
|
|
21
|
-
import * as i20 from "@angular/material/button-toggle";
|
|
22
|
-
import * as i21 from "@angular/material/chips";
|
|
23
|
-
import * as i22 from "@angular/material/icon";
|
|
24
|
-
import * as i23 from "@angular/material/progress-spinner";
|
|
25
|
-
import * as i24 from "@angular/material/progress-bar";
|
|
26
|
-
import * as i25 from "@angular/material/dialog";
|
|
27
|
-
import * as i26 from "@angular/material/tooltip";
|
|
28
|
-
import * as i27 from "@angular/material/snack-bar";
|
|
29
|
-
import * as i28 from "@angular/material/table";
|
|
30
|
-
import * as i29 from "@angular/material/sort";
|
|
31
|
-
import * as i30 from "@angular/material/paginator";
|
|
32
|
-
import * as i31 from "@angular/material/core";
|
|
33
|
-
export declare class MaterialModule {
|
|
34
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialModule, never>;
|
|
35
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, [typeof i1.MatCheckboxModule, typeof i2.MatButtonModule, typeof i3.MatInputModule, typeof i4.MatAutocompleteModule, typeof i5.MatDatepickerModule, typeof i6.MatFormFieldModule, typeof i7.MatRadioModule, typeof i8.MatSelectModule, typeof i9.MatSliderModule, typeof i10.MatSlideToggleModule, typeof i11.MatMenuModule, typeof i12.MatSidenavModule, typeof i13.MatToolbarModule, typeof i14.MatListModule, typeof i15.MatGridListModule, typeof i16.MatCardModule, typeof i17.MatStepperModule, typeof i18.MatTabsModule, typeof i19.MatExpansionModule, typeof i20.MatButtonToggleModule, typeof i21.MatChipsModule, typeof i22.MatIconModule, typeof i23.MatProgressSpinnerModule, typeof i24.MatProgressBarModule, typeof i25.MatDialogModule, typeof i26.MatTooltipModule, typeof i27.MatSnackBarModule, typeof i28.MatTableModule, typeof i29.MatSortModule, typeof i30.MatPaginatorModule, typeof i5.MatDatepickerModule, typeof i31.MatNativeDateModule], [typeof i1.MatCheckboxModule, typeof i2.MatButtonModule, typeof i3.MatInputModule, typeof i4.MatAutocompleteModule, typeof i5.MatDatepickerModule, typeof i6.MatFormFieldModule, typeof i7.MatRadioModule, typeof i8.MatSelectModule, typeof i9.MatSliderModule, typeof i10.MatSlideToggleModule, typeof i11.MatMenuModule, typeof i12.MatSidenavModule, typeof i13.MatToolbarModule, typeof i14.MatListModule, typeof i15.MatGridListModule, typeof i16.MatCardModule, typeof i17.MatStepperModule, typeof i18.MatTabsModule, typeof i19.MatExpansionModule, typeof i20.MatButtonToggleModule, typeof i21.MatChipsModule, typeof i22.MatIconModule, typeof i23.MatProgressSpinnerModule, typeof i24.MatProgressBarModule, typeof i25.MatDialogModule, typeof i26.MatTooltipModule, typeof i27.MatSnackBarModule, typeof i28.MatTableModule, typeof i29.MatSortModule, typeof i30.MatPaginatorModule]>;
|
|
36
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<MaterialModule>;
|
|
37
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class EqpAttachmentDialogService {
|
|
3
|
-
constructor();
|
|
4
|
-
/**
|
|
5
|
-
* Mostra uno sweet alert di tipo ERROR con il messaggio passato come parametro.
|
|
6
|
-
* @param message Messaggio d'errore da mostrare nello sweetalert
|
|
7
|
-
* @param title Titolo dello sweetalert (di default mostra 'Errore')
|
|
8
|
-
*/
|
|
9
|
-
static Error(message: string | string[], title?: string): void;
|
|
10
|
-
/**
|
|
11
|
-
* Mostra uno sweetalert di tipo CONFIRM con il messaggio passato come parametro e se viene premuto
|
|
12
|
-
* CONFERMA lancia la funzione di callback passata come parametro
|
|
13
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
14
|
-
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
15
|
-
*/
|
|
16
|
-
static Confirm(message: string | string[], confirmCallback: any, isWarning?: boolean, title?: string, customWidth?: string): void;
|
|
17
|
-
/**
|
|
18
|
-
* Mostra uno sweetalert di tipo INFO con il messaggio passato come parametro
|
|
19
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
20
|
-
* @param title Titolo dello sweetalert (di default mostra 'Info')
|
|
21
|
-
*/
|
|
22
|
-
static Info(message: string, title?: string, isToast?: boolean): void;
|
|
23
|
-
/**
|
|
24
|
-
* Mostra uno sweetalert di tipo WARNING con il messaggio passato come parametro
|
|
25
|
-
* @param message Messaggio da mostrare nello sweetalert
|
|
26
|
-
* @param title Titolo dello sweetalert (di default mostra 'Attenzione!')
|
|
27
|
-
*/
|
|
28
|
-
static Warning(message: string | string[], title?: string, isToast?: boolean): void;
|
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EqpAttachmentDialogService, never>;
|
|
30
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<EqpAttachmentDialogService>;
|
|
31
|
-
}
|
package/public-api.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './lib/eqp-attachments.component';
|
|
2
|
-
export * from './lib/eqp-attachments.module';
|
|
3
|
-
export * from './lib/interfaces/IAttachment';
|
|
4
|
-
export * from './lib/interfaces/IOptions';
|
|
5
|
-
export * from './lib/helpers/attachment.helper';
|
|
6
|
-
export * from './lib/services/eqp-attachment-dialog.service';
|