@exhaustive-ui/core 22.1.0 → 22.2.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/fesm2022/exhaustive-ui-core-fileinput.mjs +1504 -0
- package/fesm2022/exhaustive-ui-core-fileinput.mjs.map +1 -0
- package/fesm2022/exhaustive-ui-core-types-fileinput.mjs +4 -0
- package/fesm2022/exhaustive-ui-core-types-fileinput.mjs.map +1 -0
- package/package.json +13 -5
- package/schematics/utils/versions.json +8 -8
- package/types/exhaustive-ui-core-config.d.ts +2 -0
- package/types/exhaustive-ui-core-fileinput.d.ts +512 -0
- package/types/exhaustive-ui-core-types-fileinput.d.ts +429 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
import { FileInputLabels, FileInputPassThrough, FileInputVariant, FileInputUploadHandler, FileInputExistingFile, FileInputSelectEvent, FileInputItemEvent, FileInputUploadEvent, FileInputErrorEvent, FileInputCompleteEvent, FileInputRemoveExistingEvent, FileInputDropzoneTemplateContext, FileInputItemTemplateContext, FileInputItem } from '@exhaustive-ui/core/types/fileinput';
|
|
2
|
+
export * from '@exhaustive-ui/core/types/fileinput';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { TemplateRef, ElementRef } from '@angular/core';
|
|
5
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
6
|
+
import { BaseEditableHolder } from '@exhaustive-ui/core/baseeditableholder';
|
|
7
|
+
import * as i1 from '@exhaustive-ui/core/bind';
|
|
8
|
+
import { Bind } from '@exhaustive-ui/core/bind';
|
|
9
|
+
import * as _exhaustive_ui_styled from '@exhaustive-ui/styled';
|
|
10
|
+
import { BaseStyle } from '@exhaustive-ui/core/base';
|
|
11
|
+
import * as i2 from '@exhaustive-ui/core/api';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* FileInput selects files by drag and drop, paste or the file picker, validates them and uploads them with a progress per file.
|
|
16
|
+
*
|
|
17
|
+
* [Live Demo](https://exhaustive-ui.com/fileinput/)
|
|
18
|
+
*
|
|
19
|
+
* @module fileinputstyle
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
declare enum FileInputClasses {
|
|
23
|
+
/**
|
|
24
|
+
* Class name of the root element
|
|
25
|
+
*/
|
|
26
|
+
root = "p-fileinput",
|
|
27
|
+
/**
|
|
28
|
+
* Class name of the hidden file input
|
|
29
|
+
*/
|
|
30
|
+
input = "p-fileinput-input",
|
|
31
|
+
/**
|
|
32
|
+
* Class name of the dropzone
|
|
33
|
+
*/
|
|
34
|
+
dropzone = "p-fileinput-dropzone",
|
|
35
|
+
/**
|
|
36
|
+
* Class name of the dropzone icon
|
|
37
|
+
*/
|
|
38
|
+
dropzoneIcon = "p-fileinput-dropzone-icon",
|
|
39
|
+
/**
|
|
40
|
+
* Class name of the dropzone label
|
|
41
|
+
*/
|
|
42
|
+
label = "p-fileinput-label",
|
|
43
|
+
/**
|
|
44
|
+
* Class name of the hint
|
|
45
|
+
*/
|
|
46
|
+
hint = "p-fileinput-hint",
|
|
47
|
+
/**
|
|
48
|
+
* Class name of the upload summary
|
|
49
|
+
*/
|
|
50
|
+
summary = "p-fileinput-summary",
|
|
51
|
+
/**
|
|
52
|
+
* Class name of a progress bar
|
|
53
|
+
*/
|
|
54
|
+
progress = "p-fileinput-progress",
|
|
55
|
+
/**
|
|
56
|
+
* Class name of the file list
|
|
57
|
+
*/
|
|
58
|
+
list = "p-fileinput-list",
|
|
59
|
+
/**
|
|
60
|
+
* Class name of a file row
|
|
61
|
+
*/
|
|
62
|
+
item = "p-fileinput-item",
|
|
63
|
+
/**
|
|
64
|
+
* Class name of a thumbnail
|
|
65
|
+
*/
|
|
66
|
+
thumbnail = "p-fileinput-thumbnail",
|
|
67
|
+
/**
|
|
68
|
+
* Class name of a file name
|
|
69
|
+
*/
|
|
70
|
+
name = "p-fileinput-name",
|
|
71
|
+
/**
|
|
72
|
+
* Class name of the size and status line
|
|
73
|
+
*/
|
|
74
|
+
meta = "p-fileinput-meta",
|
|
75
|
+
/**
|
|
76
|
+
* Class name of an action button
|
|
77
|
+
*/
|
|
78
|
+
action = "p-fileinput-action",
|
|
79
|
+
/**
|
|
80
|
+
* Class name of the image grid
|
|
81
|
+
*/
|
|
82
|
+
grid = "p-fileinput-grid",
|
|
83
|
+
/**
|
|
84
|
+
* Class name of an image tile
|
|
85
|
+
*/
|
|
86
|
+
tile = "p-fileinput-tile",
|
|
87
|
+
/**
|
|
88
|
+
* Class name of the add tile
|
|
89
|
+
*/
|
|
90
|
+
add = "p-fileinput-add",
|
|
91
|
+
/**
|
|
92
|
+
* Class name of the avatar
|
|
93
|
+
*/
|
|
94
|
+
avatar = "p-fileinput-avatar"
|
|
95
|
+
}
|
|
96
|
+
declare class FileInputStyle extends BaseStyle {
|
|
97
|
+
name: string;
|
|
98
|
+
style: _exhaustive_ui_styled.StyleType;
|
|
99
|
+
classes: {
|
|
100
|
+
root: ({ instance }: {
|
|
101
|
+
instance: any;
|
|
102
|
+
}) => (string | {
|
|
103
|
+
'p-fileinput-images': boolean;
|
|
104
|
+
'p-fileinput-avatar-variant': boolean;
|
|
105
|
+
'p-fileinput-sm': boolean;
|
|
106
|
+
'p-fileinput-lg': boolean;
|
|
107
|
+
'p-fileinput-invalid': any;
|
|
108
|
+
'p-fileinput-disabled': any;
|
|
109
|
+
})[];
|
|
110
|
+
input: string;
|
|
111
|
+
dropzone: ({ instance }: {
|
|
112
|
+
instance: any;
|
|
113
|
+
}) => (string | {
|
|
114
|
+
'p-fileinput-dropzone-active': any;
|
|
115
|
+
})[];
|
|
116
|
+
dropzoneIcon: string;
|
|
117
|
+
label: string;
|
|
118
|
+
browse: string;
|
|
119
|
+
hint: string;
|
|
120
|
+
summary: string;
|
|
121
|
+
progress: string;
|
|
122
|
+
progressValue: string;
|
|
123
|
+
list: string;
|
|
124
|
+
item: ({ item }: {
|
|
125
|
+
item: any;
|
|
126
|
+
}) => (string | {
|
|
127
|
+
'p-fileinput-item-error': boolean;
|
|
128
|
+
})[];
|
|
129
|
+
thumbnail: string;
|
|
130
|
+
info: string;
|
|
131
|
+
name: string;
|
|
132
|
+
path: string;
|
|
133
|
+
meta: string;
|
|
134
|
+
status: ({ item }: {
|
|
135
|
+
item: any;
|
|
136
|
+
}) => (string | {
|
|
137
|
+
'p-fileinput-status-done': boolean;
|
|
138
|
+
'p-fileinput-error': boolean;
|
|
139
|
+
})[];
|
|
140
|
+
actions: string;
|
|
141
|
+
action: string;
|
|
142
|
+
actionIcon: string;
|
|
143
|
+
grid: string;
|
|
144
|
+
tile: ({ item }: {
|
|
145
|
+
item: any;
|
|
146
|
+
}) => (string | {
|
|
147
|
+
'p-fileinput-tile-error': boolean;
|
|
148
|
+
})[];
|
|
149
|
+
tileOverlay: string;
|
|
150
|
+
tileActions: string;
|
|
151
|
+
tileDone: string;
|
|
152
|
+
cover: string;
|
|
153
|
+
add: ({ instance }: {
|
|
154
|
+
instance: any;
|
|
155
|
+
}) => (string | {
|
|
156
|
+
'p-fileinput-dropzone-active': any;
|
|
157
|
+
})[];
|
|
158
|
+
avatar: ({ instance }: {
|
|
159
|
+
instance: any;
|
|
160
|
+
}) => (string | {
|
|
161
|
+
'p-fileinput-avatar-square': boolean;
|
|
162
|
+
'p-fileinput-avatar-filled': boolean;
|
|
163
|
+
'p-fileinput-avatar-uploading': boolean;
|
|
164
|
+
})[];
|
|
165
|
+
avatarIcon: string;
|
|
166
|
+
avatarOverlay: string;
|
|
167
|
+
avatarError: string;
|
|
168
|
+
};
|
|
169
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileInputStyle, never>;
|
|
170
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
171
|
+
}
|
|
172
|
+
interface FileInputStyle extends BaseStyle {
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare const FILEINPUT_VALUE_ACCESSOR: any;
|
|
176
|
+
/**
|
|
177
|
+
* Default texts of FileInput.
|
|
178
|
+
* @group Constants
|
|
179
|
+
*/
|
|
180
|
+
declare const FILEINPUT_DEFAULT_LABELS: FileInputLabels;
|
|
181
|
+
/**
|
|
182
|
+
* FileInput selects files by drag and drop, paste or the file picker, validates each file and uploads it with its own progress. It works with template-driven forms, reactive forms and Signal Forms.
|
|
183
|
+
* @group Components
|
|
184
|
+
*/
|
|
185
|
+
declare class FileInput extends BaseEditableHolder<FileInputPassThrough> {
|
|
186
|
+
componentName: string;
|
|
187
|
+
bindDirectiveInstance: Bind;
|
|
188
|
+
_componentStyle: FileInputStyle;
|
|
189
|
+
private http;
|
|
190
|
+
constructor();
|
|
191
|
+
/******************** Inputs ********************/
|
|
192
|
+
/**
|
|
193
|
+
* Layout of the component: a dropzone with a list, a grid of images, or a single avatar.
|
|
194
|
+
* @defaultValue 'list'
|
|
195
|
+
* @group Props
|
|
196
|
+
*/
|
|
197
|
+
readonly variant: _angular_core.InputSignal<FileInputVariant>;
|
|
198
|
+
/**
|
|
199
|
+
* Shape of the avatar variant.
|
|
200
|
+
* @defaultValue 'circle'
|
|
201
|
+
* @group Props
|
|
202
|
+
*/
|
|
203
|
+
readonly avatarShape: _angular_core.InputSignal<"square" | "circle">;
|
|
204
|
+
/**
|
|
205
|
+
* Whether several files can be selected. The value is then an array of files, otherwise a single file or null. Always false in the avatar variant.
|
|
206
|
+
* @defaultValue true
|
|
207
|
+
* @group Props
|
|
208
|
+
*/
|
|
209
|
+
readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
210
|
+
/**
|
|
211
|
+
* Accepted file types, as in the accept attribute of a file input: extensions such as `.pdf` and MIME types such as `image/*`.
|
|
212
|
+
* @group Props
|
|
213
|
+
*/
|
|
214
|
+
readonly accept: _angular_core.InputSignal<string | undefined>;
|
|
215
|
+
/**
|
|
216
|
+
* On mobile devices, opens the camera directly: `user` for the front camera, `environment` for the back camera.
|
|
217
|
+
* @group Props
|
|
218
|
+
*/
|
|
219
|
+
readonly capture: _angular_core.InputSignal<"user" | "environment" | undefined>;
|
|
220
|
+
/**
|
|
221
|
+
* Makes the file picker select a whole folder. Dropped folders are always accepted.
|
|
222
|
+
* @defaultValue false
|
|
223
|
+
* @group Props
|
|
224
|
+
*/
|
|
225
|
+
readonly directory: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
226
|
+
/**
|
|
227
|
+
* Maximum size of a file, in bytes.
|
|
228
|
+
* @group Props
|
|
229
|
+
*/
|
|
230
|
+
readonly maxFileSize: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
231
|
+
/**
|
|
232
|
+
* Minimum size of a file, in bytes.
|
|
233
|
+
* @group Props
|
|
234
|
+
*/
|
|
235
|
+
readonly minFileSize: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
236
|
+
/**
|
|
237
|
+
* Maximum number of files, existing files included.
|
|
238
|
+
* @group Props
|
|
239
|
+
*/
|
|
240
|
+
readonly maxFiles: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
241
|
+
/**
|
|
242
|
+
* Maximum size of all the files together, in bytes.
|
|
243
|
+
* @group Props
|
|
244
|
+
*/
|
|
245
|
+
readonly maxTotalSize: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
246
|
+
/**
|
|
247
|
+
* URL to upload each file to, in its own request. Requires provideHttpClient().
|
|
248
|
+
* @group Props
|
|
249
|
+
*/
|
|
250
|
+
readonly url: _angular_core.InputSignal<string | undefined>;
|
|
251
|
+
/**
|
|
252
|
+
* HTTP method of the upload requests.
|
|
253
|
+
* @defaultValue 'post'
|
|
254
|
+
* @group Props
|
|
255
|
+
*/
|
|
256
|
+
readonly method: _angular_core.InputSignal<"post" | "put">;
|
|
257
|
+
/**
|
|
258
|
+
* Headers of the upload requests.
|
|
259
|
+
* @group Props
|
|
260
|
+
*/
|
|
261
|
+
readonly headers: _angular_core.InputSignal<HttpHeaders | undefined>;
|
|
262
|
+
/**
|
|
263
|
+
* Whether the upload requests send cookies and credentials.
|
|
264
|
+
* @defaultValue false
|
|
265
|
+
* @group Props
|
|
266
|
+
*/
|
|
267
|
+
readonly withCredentials: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
268
|
+
/**
|
|
269
|
+
* Name of the form data field that holds the file in an upload request.
|
|
270
|
+
* @defaultValue 'file'
|
|
271
|
+
* @group Props
|
|
272
|
+
*/
|
|
273
|
+
readonly fieldName: _angular_core.InputSignal<string>;
|
|
274
|
+
/**
|
|
275
|
+
* Function that uploads one file, used instead of url: to upload straight to cloud storage, or through your own service.
|
|
276
|
+
* @group Props
|
|
277
|
+
*/
|
|
278
|
+
readonly uploadHandler: _angular_core.InputSignal<FileInputUploadHandler | undefined>;
|
|
279
|
+
/**
|
|
280
|
+
* Whether files start uploading as soon as they are added. When false, call upload().
|
|
281
|
+
* @defaultValue true
|
|
282
|
+
* @group Props
|
|
283
|
+
*/
|
|
284
|
+
readonly auto: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
285
|
+
/**
|
|
286
|
+
* Maximum number of files uploaded at the same time.
|
|
287
|
+
* @defaultValue 3
|
|
288
|
+
* @group Props
|
|
289
|
+
*/
|
|
290
|
+
readonly concurrency: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
291
|
+
/**
|
|
292
|
+
* Files already stored on the server, shown with a download and a delete button.
|
|
293
|
+
* @group Props
|
|
294
|
+
*/
|
|
295
|
+
readonly existing: _angular_core.InputSignal<FileInputExistingFile[] | undefined>;
|
|
296
|
+
/**
|
|
297
|
+
* Text under the dropzone label, such as the accepted types and sizes.
|
|
298
|
+
* @group Props
|
|
299
|
+
*/
|
|
300
|
+
readonly hint: _angular_core.InputSignal<string | undefined>;
|
|
301
|
+
/**
|
|
302
|
+
* Texts of the component, merged with the English defaults.
|
|
303
|
+
* @group Props
|
|
304
|
+
*/
|
|
305
|
+
readonly labels: _angular_core.InputSignal<Partial<FileInputLabels> | undefined>;
|
|
306
|
+
/**
|
|
307
|
+
* Whether to show the summary of the uploads in progress.
|
|
308
|
+
* @defaultValue true
|
|
309
|
+
* @group Props
|
|
310
|
+
*/
|
|
311
|
+
readonly showSummary: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
312
|
+
/**
|
|
313
|
+
* Size of the component.
|
|
314
|
+
* @group Props
|
|
315
|
+
*/
|
|
316
|
+
readonly size: _angular_core.InputSignal<"small" | "large" | undefined>;
|
|
317
|
+
/**
|
|
318
|
+
* Identifier of the hidden file input.
|
|
319
|
+
* @group Props
|
|
320
|
+
*/
|
|
321
|
+
readonly inputId: _angular_core.InputSignal<string | undefined>;
|
|
322
|
+
/**
|
|
323
|
+
* Accessible label of the dropzone, the add tile or the avatar.
|
|
324
|
+
* @group Props
|
|
325
|
+
*/
|
|
326
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
327
|
+
/**
|
|
328
|
+
* Identifier of the element that labels the dropzone, the add tile or the avatar.
|
|
329
|
+
* @group Props
|
|
330
|
+
*/
|
|
331
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
332
|
+
/******************** Outputs ********************/
|
|
333
|
+
/**
|
|
334
|
+
* Callback to invoke when files are added, including the ones rejected by validation.
|
|
335
|
+
* @param {FileInputSelectEvent} event - Custom select event.
|
|
336
|
+
* @group Emits
|
|
337
|
+
*/
|
|
338
|
+
readonly onSelect: _angular_core.OutputEmitterRef<FileInputSelectEvent>;
|
|
339
|
+
/**
|
|
340
|
+
* Callback to invoke when the user removes a file.
|
|
341
|
+
* @param {FileInputItemEvent} event - Custom item event.
|
|
342
|
+
* @group Emits
|
|
343
|
+
*/
|
|
344
|
+
readonly onRemove: _angular_core.OutputEmitterRef<FileInputItemEvent>;
|
|
345
|
+
/**
|
|
346
|
+
* Callback to invoke when the user cancels an upload.
|
|
347
|
+
* @param {FileInputItemEvent} event - Custom item event.
|
|
348
|
+
* @group Emits
|
|
349
|
+
*/
|
|
350
|
+
readonly onCancel: _angular_core.OutputEmitterRef<FileInputItemEvent>;
|
|
351
|
+
/**
|
|
352
|
+
* Callback to invoke when a file is uploaded.
|
|
353
|
+
* @param {FileInputUploadEvent} event - Custom upload event.
|
|
354
|
+
* @group Emits
|
|
355
|
+
*/
|
|
356
|
+
readonly onUpload: _angular_core.OutputEmitterRef<FileInputUploadEvent>;
|
|
357
|
+
/**
|
|
358
|
+
* Callback to invoke when an upload fails.
|
|
359
|
+
* @param {FileInputErrorEvent} event - Custom error event.
|
|
360
|
+
* @group Emits
|
|
361
|
+
*/
|
|
362
|
+
readonly onError: _angular_core.OutputEmitterRef<FileInputErrorEvent>;
|
|
363
|
+
/**
|
|
364
|
+
* Callback to invoke when the last upload in progress ends.
|
|
365
|
+
* @param {FileInputCompleteEvent} event - Custom complete event.
|
|
366
|
+
* @group Emits
|
|
367
|
+
*/
|
|
368
|
+
readonly onComplete: _angular_core.OutputEmitterRef<FileInputCompleteEvent>;
|
|
369
|
+
/**
|
|
370
|
+
* Callback to invoke when the user deletes an existing file. Delete it on the server from this callback.
|
|
371
|
+
* @param {FileInputRemoveExistingEvent} event - Custom remove existing event.
|
|
372
|
+
* @group Emits
|
|
373
|
+
*/
|
|
374
|
+
readonly onRemoveExisting: _angular_core.OutputEmitterRef<FileInputRemoveExistingEvent>;
|
|
375
|
+
/******************** Templates ********************/
|
|
376
|
+
/**
|
|
377
|
+
* Custom content of the dropzone.
|
|
378
|
+
* @param {FileInputDropzoneTemplateContext} context - dropzone context.
|
|
379
|
+
* @group Templates
|
|
380
|
+
*/
|
|
381
|
+
readonly dropzoneTemplate: _angular_core.Signal<TemplateRef<FileInputDropzoneTemplateContext> | undefined>;
|
|
382
|
+
/**
|
|
383
|
+
* Custom row of the list variant.
|
|
384
|
+
* @param {FileInputItemTemplateContext} context - item context.
|
|
385
|
+
* @group Templates
|
|
386
|
+
*/
|
|
387
|
+
readonly itemTemplate: _angular_core.Signal<TemplateRef<FileInputItemTemplateContext> | undefined>;
|
|
388
|
+
readonly fileInput: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
389
|
+
/******************** State ********************/
|
|
390
|
+
/**
|
|
391
|
+
* Files selected in this session, uploaded or not, including the invalid ones.
|
|
392
|
+
*/
|
|
393
|
+
readonly items: _angular_core.WritableSignal<FileInputItem[]>;
|
|
394
|
+
readonly removedExisting: _angular_core.WritableSignal<Set<any>>;
|
|
395
|
+
readonly dragActive: _angular_core.WritableSignal<boolean>;
|
|
396
|
+
readonly announcement: _angular_core.WritableSignal<string>;
|
|
397
|
+
readonly uid: string;
|
|
398
|
+
readonly hintId: string;
|
|
399
|
+
readonly openFn: () => void;
|
|
400
|
+
private dragDepth;
|
|
401
|
+
private uploads;
|
|
402
|
+
private batch;
|
|
403
|
+
readonly isMultiple: _angular_core.Signal<boolean>;
|
|
404
|
+
readonly $invalid: _angular_core.Signal<boolean>;
|
|
405
|
+
readonly mergedLabels: _angular_core.Signal<FileInputLabels>;
|
|
406
|
+
readonly existingItems: _angular_core.Signal<FileInputItem[]>;
|
|
407
|
+
readonly displayItems: _angular_core.Signal<FileInputItem[]>;
|
|
408
|
+
readonly countedItems: _angular_core.Signal<FileInputItem[]>;
|
|
409
|
+
readonly coverId: _angular_core.Signal<string>;
|
|
410
|
+
readonly canAdd: _angular_core.Signal<boolean>;
|
|
411
|
+
readonly avatarItem: _angular_core.Signal<FileInputItem | undefined>;
|
|
412
|
+
readonly avatarSrc: _angular_core.Signal<string | undefined>;
|
|
413
|
+
readonly summary: _angular_core.Signal<{
|
|
414
|
+
percent: number;
|
|
415
|
+
text: string;
|
|
416
|
+
} | null>;
|
|
417
|
+
readonly dataP: _angular_core.Signal<string | undefined>;
|
|
418
|
+
/******************** Public methods ********************/
|
|
419
|
+
/**
|
|
420
|
+
* Opens the file picker.
|
|
421
|
+
* @group Method
|
|
422
|
+
*/
|
|
423
|
+
open(): void;
|
|
424
|
+
/**
|
|
425
|
+
* Adds files as if the user had selected them.
|
|
426
|
+
* @param {File[]} files - Files to add.
|
|
427
|
+
* @group Method
|
|
428
|
+
*/
|
|
429
|
+
addFiles(files: File[], event?: Event): void;
|
|
430
|
+
/**
|
|
431
|
+
* Uploads the selected files that are not uploaded yet. Only needed when auto is false.
|
|
432
|
+
* @group Method
|
|
433
|
+
*/
|
|
434
|
+
upload(): void;
|
|
435
|
+
/**
|
|
436
|
+
* Removes a file. For an existing file, emits onRemoveExisting.
|
|
437
|
+
* @param {FileInputItem} item - The item to remove.
|
|
438
|
+
* @group Method
|
|
439
|
+
*/
|
|
440
|
+
remove(item: FileInputItem): void;
|
|
441
|
+
/**
|
|
442
|
+
* Cancels the upload of a file.
|
|
443
|
+
* @param {FileInputItem} item - The item to cancel.
|
|
444
|
+
* @group Method
|
|
445
|
+
*/
|
|
446
|
+
cancel(item: FileInputItem): void;
|
|
447
|
+
/**
|
|
448
|
+
* Retries the upload of a failed or canceled file.
|
|
449
|
+
* @param {FileInputItem} item - The item to retry.
|
|
450
|
+
* @group Method
|
|
451
|
+
*/
|
|
452
|
+
retry(item: FileInputItem): void;
|
|
453
|
+
/**
|
|
454
|
+
* Removes all the selected files and cancels their uploads. Existing files are kept.
|
|
455
|
+
* @group Method
|
|
456
|
+
*/
|
|
457
|
+
clear(): void;
|
|
458
|
+
/******************** Template helpers ********************/
|
|
459
|
+
labelOf(key: keyof FileInputLabels): string;
|
|
460
|
+
/**
|
|
461
|
+
* Formats a size in bytes with decimal units, so that 5000000 reads 5 MB.
|
|
462
|
+
*/
|
|
463
|
+
formatSize(bytes: number): string;
|
|
464
|
+
extensionOf(item: FileInputItem): string;
|
|
465
|
+
thumbnailOf(item: FileInputItem): string | undefined;
|
|
466
|
+
statusLabel(item: FileInputItem): string | undefined;
|
|
467
|
+
itemContext(item: FileInputItem): FileInputItemTemplateContext;
|
|
468
|
+
/******************** Event handlers ********************/
|
|
469
|
+
onFileInputChange(event: Event): void;
|
|
470
|
+
onTriggerKeydown(event: KeyboardEvent): void;
|
|
471
|
+
onDragEnter(event: DragEvent): void;
|
|
472
|
+
onDragOver(event: DragEvent): void;
|
|
473
|
+
onDragLeave(event: DragEvent): void;
|
|
474
|
+
onDrop(event: DragEvent): Promise<void>;
|
|
475
|
+
onPaste(event: ClipboardEvent): void;
|
|
476
|
+
/******************** Forms ********************/
|
|
477
|
+
writeControlValue(value: any, setModelValue: (value: any) => void): void;
|
|
478
|
+
onDestroy(): void;
|
|
479
|
+
/******************** Internals ********************/
|
|
480
|
+
private add;
|
|
481
|
+
private validate;
|
|
482
|
+
private errorMessage;
|
|
483
|
+
private isAccepted;
|
|
484
|
+
private isImage;
|
|
485
|
+
private createItem;
|
|
486
|
+
private revoke;
|
|
487
|
+
private valueFiles;
|
|
488
|
+
private emitValue;
|
|
489
|
+
private canUpload;
|
|
490
|
+
private pump;
|
|
491
|
+
private start;
|
|
492
|
+
private progress;
|
|
493
|
+
private succeed;
|
|
494
|
+
private fail;
|
|
495
|
+
private afterUpload;
|
|
496
|
+
private abort;
|
|
497
|
+
private patch;
|
|
498
|
+
private announce;
|
|
499
|
+
private restoreFocus;
|
|
500
|
+
private hasFiles;
|
|
501
|
+
private relativeFolder;
|
|
502
|
+
private walk;
|
|
503
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileInput, never>;
|
|
504
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileInput, "p-file, p-fileinput, p-file-input", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "avatarShape": { "alias": "avatarShape"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "capture": { "alias": "capture"; "required": false; "isSignal": true; }; "directory": { "alias": "directory"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "minFileSize": { "alias": "minFileSize"; "required": false; "isSignal": true; }; "maxFiles": { "alias": "maxFiles"; "required": false; "isSignal": true; }; "maxTotalSize": { "alias": "maxTotalSize"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; "method": { "alias": "method"; "required": false; "isSignal": true; }; "headers": { "alias": "headers"; "required": false; "isSignal": true; }; "withCredentials": { "alias": "withCredentials"; "required": false; "isSignal": true; }; "fieldName": { "alias": "fieldName"; "required": false; "isSignal": true; }; "uploadHandler": { "alias": "uploadHandler"; "required": false; "isSignal": true; }; "auto": { "alias": "auto"; "required": false; "isSignal": true; }; "concurrency": { "alias": "concurrency"; "required": false; "isSignal": true; }; "existing": { "alias": "existing"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "showSummary": { "alias": "showSummary"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; }, { "onSelect": "onSelect"; "onRemove": "onRemove"; "onCancel": "onCancel"; "onUpload": "onUpload"; "onError": "onError"; "onComplete": "onComplete"; "onRemoveExisting": "onRemoveExisting"; }, ["dropzoneTemplate", "itemTemplate"], never, true, [{ directive: typeof i1.Bind; inputs: {}; outputs: {}; }]>;
|
|
505
|
+
}
|
|
506
|
+
declare class FileInputModule {
|
|
507
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileInputModule, never>;
|
|
508
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<FileInputModule, never, [typeof FileInput, typeof i2.SharedModule], [typeof FileInput, typeof i2.SharedModule]>;
|
|
509
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<FileInputModule>;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export { FILEINPUT_DEFAULT_LABELS, FILEINPUT_VALUE_ACCESSOR, FileInput, FileInputClasses, FileInputModule, FileInputStyle };
|