@eqproject/eqp-attachments 2.10.0 → 3.0.1
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 +1 -0
- package/{esm2020 → esm2022}/eqproject-eqp-attachments.mjs +4 -4
- package/esm2022/lib/eqp-attachments.component.mjs +1096 -0
- package/{esm2020 → esm2022}/lib/eqp-attachments.module.mjs +43 -43
- package/esm2022/lib/helpers/attachment.helper.mjs +66 -0
- package/{esm2020 → esm2022}/lib/interfaces/IAttachment.mjs +11 -11
- package/{esm2020 → esm2022}/lib/interfaces/IOptions.mjs +1 -1
- package/{esm2020 → esm2022}/lib/modules/material.module.mjs +231 -231
- package/{esm2020 → esm2022}/lib/services/eqp-attachment-dialog.service.mjs +103 -103
- package/{esm2020 → esm2022}/lib/services/eqp-attachment.service.mjs +23 -23
- package/{esm2020 → esm2022}/public-api.mjs +9 -9
- package/fesm2022/eqproject-eqp-attachments.mjs +1565 -0
- package/fesm2022/eqproject-eqp-attachments.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/eqp-attachments.component.d.ts +319 -314
- package/lib/eqp-attachments.module.d.ts +13 -13
- package/lib/helpers/attachment.helper.d.ts +20 -20
- package/lib/interfaces/IAttachment.d.ts +21 -21
- package/lib/interfaces/IOptions.d.ts +11 -11
- package/lib/modules/material.module.d.ts +37 -37
- package/lib/services/eqp-attachment-dialog.service.d.ts +31 -31
- package/lib/services/eqp-attachment.service.d.ts +7 -7
- package/package.json +15 -20
- package/public-api.d.ts +6 -6
- package/esm2020/lib/eqp-attachments.component.mjs +0 -1060
- package/esm2020/lib/helpers/attachment.helper.mjs +0 -66
- package/fesm2015/eqproject-eqp-attachments.mjs +0 -1531
- package/fesm2015/eqproject-eqp-attachments.mjs.map +0 -1
- package/fesm2020/eqproject-eqp-attachments.mjs +0 -1528
- package/fesm2020/eqproject-eqp-attachments.mjs.map +0 -1
|
@@ -1,314 +1,319 @@
|
|
|
1
|
-
import { HttpClient } from "@angular/common/http";
|
|
2
|
-
import { ChangeDetectorRef, 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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* Se
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
*
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
*
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* @param
|
|
225
|
-
*/
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
*
|
|
229
|
-
* @param
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
*
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
*
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
*
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
*
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
*
|
|
285
|
-
* @returns
|
|
286
|
-
*/
|
|
287
|
-
private
|
|
288
|
-
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
|
2
|
+
import { ChangeDetectorRef, 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 { EqpTableComponent } from "@eqproject/eqp-table";
|
|
7
|
+
import { TableColumnField, TooltipPositionType } from "@eqproject/eqp-common";
|
|
8
|
+
import { ImageCroppedEvent, ImageCropperComponent, ImageTransform } from "ngx-image-cropper";
|
|
9
|
+
import { AttachmentType, CropOptionEnum, IAttachmentDTO } from "./interfaces/IAttachment";
|
|
10
|
+
import { IOptions } from "./interfaces/IOptions";
|
|
11
|
+
import { EqpAttachmentService } from "./services/eqp-attachment.service";
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
export declare class EqpAttachmentsComponent implements OnInit {
|
|
14
|
+
private dialog;
|
|
15
|
+
private formBuilder;
|
|
16
|
+
private sanitizer;
|
|
17
|
+
private http;
|
|
18
|
+
private cd;
|
|
19
|
+
private eqpAttachmentService;
|
|
20
|
+
/**
|
|
21
|
+
* Se TRUE allora nasconde la colonna per le azioni sull'allegato (nel caso "multipleAttachment" è TRUE).
|
|
22
|
+
*/
|
|
23
|
+
disableAction: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Se TRUE mostra il titolo nell'header nel caso in cui "multipleAttachment" è TRUE ("Elenco allegati" di default).
|
|
26
|
+
*/
|
|
27
|
+
showHeader: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Titolo da visualizzare se il parametro "showHeader" è TRUE. Di devault viene visualizzato "Elenco allegati".
|
|
30
|
+
*/
|
|
31
|
+
headerTitle: string;
|
|
32
|
+
/**
|
|
33
|
+
* Sorgente dati da visualizzare. Nel caso si vuole gestire un singolo allegato va passato in ogni caso come Array.
|
|
34
|
+
*/
|
|
35
|
+
attachmentsList: Array<IAttachmentDTO>;
|
|
36
|
+
/**
|
|
37
|
+
* Se TRUE non mostra la MatCard (nel caso in cui "multipleAttachment" è TRUE).
|
|
38
|
+
*/
|
|
39
|
+
showMatCard: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 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".
|
|
42
|
+
* Se TRUE allora il componente mostra l'elenco di tutti gli allegati ricevuto nel parametro "attachmentsList".
|
|
43
|
+
*/
|
|
44
|
+
multipleAttachment: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Se assume il valore TRUE allora sarà possibile caricare più file per volta. Questa funzionalità è attiva
|
|
47
|
+
* SOLO se si gestiscono allegati multipli, quindi se l'input 'multipleAttachment' assume il valore TRUE, altrimenti è sempre disabilitata.
|
|
48
|
+
*/
|
|
49
|
+
loadMultipleFiles: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Configurazione delle colonne della eqp-table per la visualizzazione degli allegati (caso "multipleAttachment" è TRUE).
|
|
52
|
+
*/
|
|
53
|
+
attachmentsColumns: Array<TableColumnField>;
|
|
54
|
+
/**
|
|
55
|
+
* Imposta il messaggio da visualizzare nel caso in cui la tabella degli allegati (nel caso in cui "multipleAttachment" è TRUE) è vuota.
|
|
56
|
+
*/
|
|
57
|
+
emptyTableMessage: string;
|
|
58
|
+
/**
|
|
59
|
+
* Se TRUE allora permette di selezionare soltanto file di tipo immagine, avente uno dei mimetype
|
|
60
|
+
* specificati dentro AttachmentHelperService.
|
|
61
|
+
* Se FALSE permette di selezionare qualsiasi tipo di file
|
|
62
|
+
*/
|
|
63
|
+
allowOnlyImages: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Specifica i tipi di file che è possibile caricare
|
|
66
|
+
*/
|
|
67
|
+
acceptedFileTypes: string;
|
|
68
|
+
/**
|
|
69
|
+
* Se TRUE disabilita il pulsante di Aggiunta allegato (a prescindere dal valore del parametro "multipleAttachment").
|
|
70
|
+
*/
|
|
71
|
+
isDisabled: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Mostra/nasconde la colonna per visualizzare l'anteprima dei file nella tabella (caso multipleAtatchments = true).
|
|
74
|
+
*/
|
|
75
|
+
showInlinePreview: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Endpoint da chiamare per recueprare l'IAttachmentDTO completo da vedere nell'anteprima. La chiamata sarà in POST e nel body
|
|
78
|
+
* conterrà l'IAttachmentDTO selezionato dall'utente.
|
|
79
|
+
* La chiamata viene eseguita solo per l'anteprima delle immagini essendo necessario il base64 completo dell'immagine a dimensione reale.
|
|
80
|
+
* Per documenti/link basta che sia popolata la proprietà FilePath di IAttachmentDTO.
|
|
81
|
+
*/
|
|
82
|
+
getAttachmentEndpoint: string;
|
|
83
|
+
/**
|
|
84
|
+
* Hostname dell'ambiente di produzione dell'applicativo. Necessario per visualizzare l'anteprima dei documenti
|
|
85
|
+
* tramite il viewer di google.
|
|
86
|
+
* NOTA: Per visualizzare l'anteprima è necessario che la prorietà FilePath dell'IAttachmentDTO sia popolata e che
|
|
87
|
+
* sia abilitato l'accesso alla cartella sul server tramite hostname.
|
|
88
|
+
*/
|
|
89
|
+
productionBaseUrl: string;
|
|
90
|
+
/**
|
|
91
|
+
* Opzioni per la compressione delle immagini caricate.
|
|
92
|
+
*/
|
|
93
|
+
compressionOptions: IOptions;
|
|
94
|
+
/**
|
|
95
|
+
* Array di AttachmentType che si possono aggiungere
|
|
96
|
+
*/
|
|
97
|
+
allowedTypes: Array<AttachmentType>;
|
|
98
|
+
/**
|
|
99
|
+
* Permette di stabilire se la eqp-table contenente l'elenco degli allegati utilizza
|
|
100
|
+
* il multilingua oppure no
|
|
101
|
+
*/
|
|
102
|
+
isEqpTableMultiLanguage: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco
|
|
105
|
+
* degli allegati deve essere paginata oppure no
|
|
106
|
+
*/
|
|
107
|
+
tablePaginatorVisible: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Permette di stabilire, in caso di gestione allegati multipli, se la tabella contenente l'elenco
|
|
110
|
+
* degli allegati deve contenere il campo di ricerca oppure no
|
|
111
|
+
*/
|
|
112
|
+
isTableSearcheable: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* In caso di gestione allegati multipli, permette di stabilire la dimensione pagina di default
|
|
115
|
+
* per la tabella contenente l'elenco degli allegati
|
|
116
|
+
*/
|
|
117
|
+
tablePaginatorSize: number;
|
|
118
|
+
/**
|
|
119
|
+
* Permette di scegliere il modo in cui i file devono essere caricati
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Permette di stabilire se i pulsanti per il caricamento dei file sono separati o in un menù a tendina
|
|
123
|
+
*/
|
|
124
|
+
separatedUploadButtons: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Permette di scegliere se dare la possibilità di vedere o no l'anteprima
|
|
127
|
+
*/
|
|
128
|
+
showPreview: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* In caso di allegato singolo, permette di scegliere se aggiungere file tramite drag and drop
|
|
131
|
+
*/
|
|
132
|
+
singleAttachmentDragAndDrop: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Array di opzioni che si possono utilizzare per il crop
|
|
135
|
+
*/
|
|
136
|
+
cropOptions: Array<CropOptionEnum>;
|
|
137
|
+
/**
|
|
138
|
+
* Classe custom da assegnare al dialog del crop immagini
|
|
139
|
+
*/
|
|
140
|
+
cropDialogClass: string;
|
|
141
|
+
/**
|
|
142
|
+
* Input per definire le label da usare nel componente
|
|
143
|
+
*/
|
|
144
|
+
downloadTooltipPosition: TooltipPositionType;
|
|
145
|
+
openLinkLabel: string;
|
|
146
|
+
addButtonLabel: string;
|
|
147
|
+
downloadLabel: string;
|
|
148
|
+
deleteLabel: string;
|
|
149
|
+
fileNameLabel: string;
|
|
150
|
+
previewLabel: string;
|
|
151
|
+
uploadFileLabel: string;
|
|
152
|
+
confirmLabel: string;
|
|
153
|
+
abortLabel: string;
|
|
154
|
+
saveLabel: string;
|
|
155
|
+
exitLabel: string;
|
|
156
|
+
uploadWithDropboxLabel: string;
|
|
157
|
+
cropLabel: string;
|
|
158
|
+
eqpTableSearchText: string;
|
|
159
|
+
deleteDialogTitle: string;
|
|
160
|
+
deleteDialogMessage: string;
|
|
161
|
+
noImageSelectedErrorMessage: string;
|
|
162
|
+
wrongTypeSelectedErrorMessage: string;
|
|
163
|
+
videoPreviewErrorMessage: string;
|
|
164
|
+
audioPreviewErrorMessage: string;
|
|
165
|
+
flipHorinzontalLabel: string;
|
|
166
|
+
flipVerticalLabel: string;
|
|
167
|
+
rotateRightLabel: string;
|
|
168
|
+
rotateLeftLabel: string;
|
|
169
|
+
/**
|
|
170
|
+
* Restituisce la lista aggiornata degli allegati.
|
|
171
|
+
*/
|
|
172
|
+
localEditedAttachments: EventEmitter<Array<IAttachmentDTO>>;
|
|
173
|
+
/**
|
|
174
|
+
* Evento scatenato alla pressione del pulsante ESCI della modale di caricamento file.
|
|
175
|
+
*/
|
|
176
|
+
abortAddAttachment: EventEmitter<any>;
|
|
177
|
+
/**
|
|
178
|
+
* Evento di output che restituisce l'IAttachmentDTO selezionato per il download nel caso FileDataBase64, FileContentType o FileName non fossero specificati.
|
|
179
|
+
*/
|
|
180
|
+
downloadAttachment: EventEmitter<IAttachmentDTO>;
|
|
181
|
+
/**
|
|
182
|
+
* Evento di output che restituisce l'elemento eliminato prima che questo venga effettivamente rismosso dalla lista.
|
|
183
|
+
*/
|
|
184
|
+
onDeleteAttachment: EventEmitter<IAttachmentDTO>;
|
|
185
|
+
newAttachment: IAttachmentDTO;
|
|
186
|
+
newMultipleAttachments: Array<IAttachmentDTO>;
|
|
187
|
+
attachmentType: typeof AttachmentType;
|
|
188
|
+
newAttachmentForm: FormGroup;
|
|
189
|
+
selectedFile: File;
|
|
190
|
+
selectedFiles: Array<File>;
|
|
191
|
+
showCropImage: boolean;
|
|
192
|
+
dialogAddAttachment: TemplateRef<any>;
|
|
193
|
+
dialogRefAddAttachment: MatDialogRef<TemplateRef<any>>;
|
|
194
|
+
dialogAddMultipleAttachment: TemplateRef<any>;
|
|
195
|
+
dialogRefCropImage: MatDialogRef<TemplateRef<any>>;
|
|
196
|
+
dialogCropImage: TemplateRef<any>;
|
|
197
|
+
imageChangedEvent: any;
|
|
198
|
+
croppedImage: any;
|
|
199
|
+
transform: ImageTransform;
|
|
200
|
+
canvasRotation: number;
|
|
201
|
+
imageCropper: ImageCropperComponent;
|
|
202
|
+
imageInput: any;
|
|
203
|
+
AttachmentType: typeof AttachmentType;
|
|
204
|
+
selectedAttachment: IAttachmentDTO;
|
|
205
|
+
originalWidth: number;
|
|
206
|
+
originalHeight: number;
|
|
207
|
+
customWidth: number;
|
|
208
|
+
customHeight: number;
|
|
209
|
+
attachmentTable: EqpTableComponent;
|
|
210
|
+
inlinePreviewTemplate: TemplateRef<any>;
|
|
211
|
+
dialogPreview: TemplateRef<any>;
|
|
212
|
+
imageFile: File;
|
|
213
|
+
addingLinkMode: boolean;
|
|
214
|
+
constructor(dialog: MatDialog, formBuilder: FormBuilder, sanitizer: DomSanitizer, http: HttpClient, cd: ChangeDetectorRef, eqpAttachmentService: EqpAttachmentService);
|
|
215
|
+
ngOnInit(): Promise<void>;
|
|
216
|
+
reloadData(): void;
|
|
217
|
+
checkAttachmentImage(): void;
|
|
218
|
+
/**
|
|
219
|
+
* Configura le colonne per l'eqp-table nel caso in cui il parametro "multipleAttachments" è TRUE.
|
|
220
|
+
*/
|
|
221
|
+
configureColumns(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Elimina un allegato eliminando anche il file presente nello storage di archiviazione utilizzato (AWS o cartella progetto)
|
|
224
|
+
* @param element IAttachmentDTO da cancellare
|
|
225
|
+
*/
|
|
226
|
+
deleteAttachment(element: IAttachmentDTO): void;
|
|
227
|
+
/**
|
|
228
|
+
* Rimuove l'allegato selezionato dalla lista "attachmentsList" e invoca l'evento di output che restituisce la lista aggiornata.
|
|
229
|
+
* @param attachmentIndex Indice dell'attachment da rimuovere
|
|
230
|
+
*/
|
|
231
|
+
removeAttachmentFromList(attachmentIndex: number): void;
|
|
232
|
+
/**
|
|
233
|
+
* Scarica l'allegato o apre il link
|
|
234
|
+
* @param element Allegato da mostrare
|
|
235
|
+
*/
|
|
236
|
+
viewAttachment(attachment: IAttachmentDTO): void;
|
|
237
|
+
/**
|
|
238
|
+
* Ridefinisce l'icona da mostrare nella colonna dell'eqp-table per ogni file.
|
|
239
|
+
* L'icona varia in base all'estensione del file
|
|
240
|
+
* @param attachment
|
|
241
|
+
*/
|
|
242
|
+
getAttachmentIcon(attachment: IAttachmentDTO): string;
|
|
243
|
+
/**
|
|
244
|
+
* In caso di allegato singolo, sceglie quale metodo richiamare in base al tipo di allegato
|
|
245
|
+
*/
|
|
246
|
+
addFile(attachmentType: AttachmentType, imageInput?: any): void;
|
|
247
|
+
createAttachmentForm(): void;
|
|
248
|
+
close(emitCloseEvent?: boolean): void;
|
|
249
|
+
/**
|
|
250
|
+
* In base al tipo di allegato controlla se disabilitare o meno il pulsante per salvare.
|
|
251
|
+
* Funzione usata nel [disable] del pulsante "Salva" del dialog per l'aggiunta di un allegato.
|
|
252
|
+
* @returns
|
|
253
|
+
*/
|
|
254
|
+
disableSave(): boolean;
|
|
255
|
+
confirmAddAttachment(): void;
|
|
256
|
+
/**
|
|
257
|
+
* Apre il dialog per l'anteprima dell'allegato selezionato.
|
|
258
|
+
* @param row
|
|
259
|
+
* @returns
|
|
260
|
+
*/
|
|
261
|
+
openPreviewDialog(row: IAttachmentDTO): Promise<void>;
|
|
262
|
+
getAttachmentByID(): Promise<IAttachmentDTO>;
|
|
263
|
+
/**
|
|
264
|
+
* Evento scatenato alla selezione del file (o dei file).
|
|
265
|
+
* 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
|
|
266
|
+
* mostrare le funzionalità del croppie (per ritagliare l'immagine) oppure no.
|
|
267
|
+
* Se il file caricato non è un immagine allora genera direttamente il base64 e lo associa all'allegato da salvare.
|
|
268
|
+
* Se invece il caricamento dei file è MULTIPLO e sono presenti più file allora esegue le stesse operazioni ignorando però il contrllo
|
|
269
|
+
* immagine per il croppie (in caso di caricamento multiplo le funzionalità del croppie sono disabilitate).
|
|
270
|
+
*/
|
|
271
|
+
onFileAdded(event: any, isFileDropped?: boolean): Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* A partire dal FILE ricevuto in input ricostruisce l'oggetto IAttachmentDTO e lo restituisce.
|
|
274
|
+
* Se il parametro getBase64 viene passato a TRUE allora, sempre a partire dal file,genera il base64 e
|
|
275
|
+
* ricava il ContentType da associare all'oggetto IAttachmentDTO da restituire
|
|
276
|
+
* @param currentFile Oggetto FILE da processare
|
|
277
|
+
* @param getBase64 Se TRUE allora calcola base64 e ContentType del file passato in input
|
|
278
|
+
* @returns Restituisce un oggetto di tipo IAttachmentDTO
|
|
279
|
+
*/
|
|
280
|
+
private createAttachmentFromUploadedFile;
|
|
281
|
+
/**
|
|
282
|
+
* A partire dal file passato in input restituisce un oggetto
|
|
283
|
+
* contenente il base64 del file e il suo contentType
|
|
284
|
+
* @param currentFile Oggetto File da cui estrapolare base64 e contentType
|
|
285
|
+
* @returns Restituisce un oggetto avente le proprietà Base64File e ContentType
|
|
286
|
+
*/
|
|
287
|
+
private getBase64FromFile;
|
|
288
|
+
/**
|
|
289
|
+
* Controlla se il file che si sta caricando è supportato dal sistema.
|
|
290
|
+
* @returns
|
|
291
|
+
*/
|
|
292
|
+
private checkAcceptedFiles;
|
|
293
|
+
/**
|
|
294
|
+
* Se eqp-attachments è stata configurata per il caricamento delle sole immagini allora verifica che il file passato in
|
|
295
|
+
* input sia effettivamente un immagine o no.
|
|
296
|
+
* Se il controllo va a buon fine restituisce TRUE altrimenti mostra un messaggio d'errore e restituisce FALSE
|
|
297
|
+
*/
|
|
298
|
+
private checkAllowOnlyImageFile;
|
|
299
|
+
getImageDimensions(img: any): void;
|
|
300
|
+
restoreOriginalDimensions(): void;
|
|
301
|
+
onDimensionsChange(dimension: string): void;
|
|
302
|
+
imageCropped(event: ImageCroppedEvent): void;
|
|
303
|
+
getCroppedAndUpload(file: any, newAttachment: IAttachmentDTO): void;
|
|
304
|
+
rotateLeft(): void;
|
|
305
|
+
rotateRight(): void;
|
|
306
|
+
private flipAfterRotate;
|
|
307
|
+
flipHorizontal(): void;
|
|
308
|
+
flipVertical(): void;
|
|
309
|
+
/**
|
|
310
|
+
* Annulla la selezione del file, svuotando l'input e resettando tutte le proprietà dell'IAttachmentDTO
|
|
311
|
+
*/
|
|
312
|
+
abortFile(): void;
|
|
313
|
+
fileDropped(files: any): void;
|
|
314
|
+
chooseDropboxFile(): void;
|
|
315
|
+
onSelectFile(event: any, fileInput: any): void;
|
|
316
|
+
switchToAddingLinkMode(): void;
|
|
317
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EqpAttachmentsComponent, never>;
|
|
318
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EqpAttachmentsComponent, "eqp-attachments", never, { "disableAction": { "alias": "disableAction"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "headerTitle": { "alias": "headerTitle"; "required": false; }; "attachmentsList": { "alias": "attachmentsList"; "required": false; }; "showMatCard": { "alias": "showMatCard"; "required": false; }; "multipleAttachment": { "alias": "multipleAttachment"; "required": false; }; "loadMultipleFiles": { "alias": "loadMultipleFiles"; "required": false; }; "attachmentsColumns": { "alias": "attachmentsColumns"; "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; }; "downloadTooltipPosition": { "alias": "downloadTooltipPosition"; "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; }; "eqpTableSearchText": { "alias": "eqpTableSearchText"; "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; }; }, { "localEditedAttachments": "localEditedAttachments"; "abortAddAttachment": "abortAddAttachment"; "downloadAttachment": "downloadAttachment"; "onDeleteAttachment": "onDeleteAttachment"; }, never, never, false, never>;
|
|
319
|
+
}
|