@progress/kendo-react-upload 13.3.0 → 13.4.0-develop.2
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/ExternalDropZone.d.ts +91 -0
- package/ExternalDropZone.mjs +3 -3
- package/Upload.d.ts +162 -0
- package/UploadActionButtons.d.ts +33 -0
- package/UploadActionButtons.js +1 -1
- package/UploadActionButtons.mjs +9 -9
- package/UploadAddButton.d.ts +45 -0
- package/UploadAddButton.js +1 -1
- package/UploadAddButton.mjs +7 -8
- package/UploadDropZone.d.ts +43 -0
- package/UploadInput.d.ts +34 -0
- package/UploadInput.mjs +1 -1
- package/UploadList.d.ts +33 -0
- package/UploadListActionButton.d.ts +47 -0
- package/UploadListActionButton.js +1 -1
- package/UploadListActionButton.mjs +4 -6
- package/UploadListGroup.d.ts +35 -0
- package/UploadListMultiItem.d.ts +28 -0
- package/UploadListSingleItem.d.ts +35 -0
- package/UploadNavigation.d.ts +35 -0
- package/UploadStatus.d.ts +22 -0
- package/UploadUI.d.ts +111 -0
- package/UploadUI.mjs +3 -3
- package/dist/cdn/js/kendo-react-upload.js +1 -1
- package/index.d.mts +34 -1212
- package/index.d.ts +34 -1212
- package/interfaces/BaseUploadEvent.d.ts +16 -0
- package/interfaces/FileGroup.d.ts +14 -0
- package/interfaces/UploadActionsLayout.d.ts +11 -0
- package/interfaces/UploadAdditionalData.d.ts +13 -0
- package/interfaces/UploadAsyncProps.d.ts +89 -0
- package/interfaces/UploadFileInfo.d.ts +48 -0
- package/interfaces/UploadFileRestrictions.d.ts +26 -0
- package/interfaces/UploadFileStatus.d.ts +40 -0
- package/interfaces/UploadHttpHeaders.d.ts +13 -0
- package/interfaces/UploadListItemProps.d.ts +38 -0
- package/interfaces/UploadOnAddEvent.d.ts +23 -0
- package/interfaces/UploadOnBeforeRemoveEvent.d.ts +29 -0
- package/interfaces/UploadOnBeforeUploadEvent.d.ts +29 -0
- package/interfaces/UploadOnCancelEvent.d.ts +18 -0
- package/interfaces/UploadOnProgressEvent.d.ts +23 -0
- package/interfaces/UploadOnRemoveEvent.d.ts +28 -0
- package/interfaces/UploadOnStatusChangeEvent.d.ts +28 -0
- package/interfaces/UploadProps.d.ts +242 -0
- package/interfaces/UploadResponse.d.ts +32 -0
- package/interfaces/UploadSelectMessageProps.d.ts +16 -0
- package/messages/index.d.ts +122 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +6 -6
- package/utils/connectionUtils.d.ts +21 -0
- package/utils/stateUtils.d.ts +30 -0
- package/utils/utils.d.ts +21 -0
- package/utils/validationUtils.d.ts +11 -0
package/index.d.mts
CHANGED
|
@@ -5,1215 +5,37 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The focus event callback.
|
|
44
|
-
*/
|
|
45
|
-
focus: () => void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Represents the properties of the [ExternalDropZone](https://www.telerik.com/kendo-react-ui/components/upload/api/externaldropzone) component.
|
|
50
|
-
*/
|
|
51
|
-
declare interface ExternalDropZoneProps {
|
|
52
|
-
/**
|
|
53
|
-
* Sets the `id` property of the top div element of the ExternalDropZone.
|
|
54
|
-
*/
|
|
55
|
-
id?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Sets additional CSS styles to the ExternalDropZone.
|
|
58
|
-
*/
|
|
59
|
-
style?: React_2.CSSProperties;
|
|
60
|
-
/**
|
|
61
|
-
* Sets additional classes to the ExternalDropZone.
|
|
62
|
-
*/
|
|
63
|
-
className?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Sets the `tabIndex` attribute.
|
|
66
|
-
*/
|
|
67
|
-
tabIndex?: number;
|
|
68
|
-
/**
|
|
69
|
-
* Represents the ref of the linked Upload.
|
|
70
|
-
*/
|
|
71
|
-
uploadRef: any;
|
|
72
|
-
/**
|
|
73
|
-
* Determines the disabled mode of the ExternalDropZone.
|
|
74
|
-
*/
|
|
75
|
-
disabled?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Sets different hint node.
|
|
78
|
-
*/
|
|
79
|
-
customHint?: React_2.ReactNode;
|
|
80
|
-
/**
|
|
81
|
-
* Sets different note node.
|
|
82
|
-
*/
|
|
83
|
-
customNote?: React_2.ReactNode;
|
|
84
|
-
/**
|
|
85
|
-
* Triggered after a file is dropped into the ExternalDropZone area.
|
|
86
|
-
*/
|
|
87
|
-
onDrop?: (event: React_2.DragEvent<HTMLDivElement>) => void;
|
|
88
|
-
/**
|
|
89
|
-
* Triggered after a file is dragged inside the ExternalDropZone area.
|
|
90
|
-
*/
|
|
91
|
-
onElementDragEnter?: (event: React_2.DragEvent<HTMLDivElement>) => void;
|
|
92
|
-
/**
|
|
93
|
-
* Triggered after a file dragging is over.
|
|
94
|
-
*/
|
|
95
|
-
onElementDragOver?: (event: React_2.DragEvent<HTMLDivElement>) => void;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @hidden
|
|
100
|
-
*/
|
|
101
|
-
declare interface GroupedFiles {
|
|
102
|
-
[uid: string]: Array<UploadFileInfo>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @hidden
|
|
107
|
-
*/
|
|
108
|
-
export declare const headerStatusUploaded = "upload.headerStatusUploaded";
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @hidden
|
|
112
|
-
*/
|
|
113
|
-
export declare const headerStatusUploading = "upload.headerStatusUploading";
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @hidden
|
|
117
|
-
*/
|
|
118
|
-
export declare const invalidMaxFileSize = "upload.invalidMaxFileSize";
|
|
119
|
-
|
|
120
|
-
export declare class Upload extends React_2.Component<UploadProps, UploadState> {
|
|
121
|
-
/**
|
|
122
|
-
* @hidden
|
|
123
|
-
*/
|
|
124
|
-
static defaultProps: UploadProps;
|
|
125
|
-
/**
|
|
126
|
-
* @hidden
|
|
127
|
-
*/
|
|
128
|
-
static propTypes: {
|
|
129
|
-
autoUpload: default_2.Requireable<boolean>;
|
|
130
|
-
batch: default_2.Requireable<boolean>;
|
|
131
|
-
withCredentials: default_2.Requireable<boolean>;
|
|
132
|
-
saveField: default_2.Requireable<string>;
|
|
133
|
-
saveHeaders: default_2.Requireable<object>;
|
|
134
|
-
saveMethod: default_2.Requireable<string>;
|
|
135
|
-
saveUrl: default_2.Requireable<NonNullable<string | ((...args: any[]) => any) | null | undefined>>;
|
|
136
|
-
responseType: default_2.Requireable<string>;
|
|
137
|
-
removeField: default_2.Requireable<string>;
|
|
138
|
-
removeHeaders: default_2.Requireable<object>;
|
|
139
|
-
removeMethod: default_2.Requireable<string>;
|
|
140
|
-
removeUrl: default_2.Requireable<NonNullable<string | ((...args: any[]) => any) | null | undefined>>;
|
|
141
|
-
multiple: default_2.Requireable<boolean>;
|
|
142
|
-
disabled: default_2.Requireable<boolean>;
|
|
143
|
-
showFileList: default_2.Requireable<boolean>;
|
|
144
|
-
showActionButtons: default_2.Requireable<boolean>;
|
|
145
|
-
actionsLayout: default_2.Requireable<string>;
|
|
146
|
-
tabIndex: default_2.Requireable<number>;
|
|
147
|
-
accept: default_2.Requireable<string>;
|
|
148
|
-
listItemUI: default_2.Requireable<NonNullable<string | ((...args: any[]) => any) | default_2.InferProps<{
|
|
149
|
-
render: default_2.Validator<(...args: any[]) => any>;
|
|
150
|
-
}> | null | undefined>>;
|
|
151
|
-
restrictions: default_2.Requireable<default_2.InferProps<{
|
|
152
|
-
allowedExtensions: default_2.Requireable<(string | null | undefined)[]>;
|
|
153
|
-
maxFileSize: default_2.Requireable<number>;
|
|
154
|
-
minFileSize: default_2.Requireable<number>;
|
|
155
|
-
}>>;
|
|
156
|
-
files: default_2.Requireable<(default_2.InferProps<{
|
|
157
|
-
uid: default_2.Requireable<string>;
|
|
158
|
-
name: default_2.Requireable<string>;
|
|
159
|
-
extension: default_2.Requireable<string>;
|
|
160
|
-
size: default_2.Requireable<number>;
|
|
161
|
-
validationErrors: default_2.Requireable<(string | null | undefined)[]>;
|
|
162
|
-
status: default_2.Requireable<UploadFileStatus>;
|
|
163
|
-
progress: default_2.Requireable<number>;
|
|
164
|
-
getRawFile: default_2.Requireable<(...args: any[]) => any>;
|
|
165
|
-
}> | null | undefined)[]>;
|
|
166
|
-
defaultFiles: default_2.Requireable<(default_2.InferProps<{
|
|
167
|
-
uid: default_2.Requireable<string>;
|
|
168
|
-
name: default_2.Requireable<string>;
|
|
169
|
-
extension: default_2.Requireable<string>;
|
|
170
|
-
size: default_2.Requireable<number>;
|
|
171
|
-
validationErrors: default_2.Requireable<(string | null | undefined)[]>;
|
|
172
|
-
status: default_2.Requireable<UploadFileStatus>;
|
|
173
|
-
progress: default_2.Requireable<number>;
|
|
174
|
-
getRawFile: default_2.Requireable<(...args: any[]) => any>;
|
|
175
|
-
}> | null | undefined)[]>;
|
|
176
|
-
};
|
|
177
|
-
private _httpSubscriptions;
|
|
178
|
-
private get async();
|
|
179
|
-
private _uploadNavigation;
|
|
180
|
-
private get files();
|
|
181
|
-
private get isControlled();
|
|
182
|
-
private get isCustomSave();
|
|
183
|
-
private get isCustomRemove();
|
|
184
|
-
private get fileStateCopy();
|
|
185
|
-
private readonly showLicenseWatermark;
|
|
186
|
-
private readonly licenseMessage?;
|
|
187
|
-
constructor(props: UploadProps);
|
|
188
|
-
/**
|
|
189
|
-
* @hidden
|
|
190
|
-
*/
|
|
191
|
-
get actionElement(): HTMLInputElement | null | undefined;
|
|
192
|
-
/**
|
|
193
|
-
* @hidden
|
|
194
|
-
*/
|
|
195
|
-
focus: () => void;
|
|
196
|
-
/**
|
|
197
|
-
* Upload the selected files. Usable when the upload action is triggered by external code.
|
|
198
|
-
*/
|
|
199
|
-
triggerUpload: () => void;
|
|
200
|
-
/**
|
|
201
|
-
* @hidden
|
|
202
|
-
*/
|
|
203
|
-
uploadFiles: (filesForUpload: GroupedFiles) => void;
|
|
204
|
-
/**
|
|
205
|
-
* @hidden
|
|
206
|
-
*/
|
|
207
|
-
removeFiles: (filesForRemove: GroupedFiles) => void;
|
|
208
|
-
/**
|
|
209
|
-
* @hidden
|
|
210
|
-
*/
|
|
211
|
-
onUpload: () => void;
|
|
212
|
-
/**
|
|
213
|
-
* @hidden
|
|
214
|
-
*/
|
|
215
|
-
onAdd: (files: FileList) => void;
|
|
216
|
-
/**
|
|
217
|
-
* @hidden
|
|
218
|
-
*/
|
|
219
|
-
setFilesProgress(filesWithProgress: UploadFileInfo[], percentComplete: number): void;
|
|
220
|
-
/**
|
|
221
|
-
* @hidden
|
|
222
|
-
*/
|
|
223
|
-
onUploadProgress: (uid: string, event: ProgressEvent | AxiosProgressEvent) => void;
|
|
224
|
-
/**
|
|
225
|
-
* @hidden
|
|
226
|
-
*/
|
|
227
|
-
onUploadSuccess: (uid: string, event?: AxiosResponse) => void;
|
|
228
|
-
/**
|
|
229
|
-
* @hidden
|
|
230
|
-
*/
|
|
231
|
-
onUploadError: (uid: string, event?: AxiosResponse) => void;
|
|
232
|
-
/**
|
|
233
|
-
* @hidden
|
|
234
|
-
*/
|
|
235
|
-
onRemove: (uid: string) => void;
|
|
236
|
-
/**
|
|
237
|
-
* @hidden
|
|
238
|
-
*/
|
|
239
|
-
onRemoveSuccess: (uid: string, event?: AxiosResponse) => void;
|
|
240
|
-
/**
|
|
241
|
-
* @hidden
|
|
242
|
-
*/
|
|
243
|
-
onRemoveError: (uid: string, event?: AxiosResponse) => void;
|
|
244
|
-
/**
|
|
245
|
-
* @hidden
|
|
246
|
-
*/
|
|
247
|
-
onRetry: (uid: string) => void;
|
|
248
|
-
/**
|
|
249
|
-
* @hidden
|
|
250
|
-
*/
|
|
251
|
-
onCancel: (uid: string) => void;
|
|
252
|
-
/**
|
|
253
|
-
* @hidden
|
|
254
|
-
*/
|
|
255
|
-
onClear: () => void;
|
|
256
|
-
/**
|
|
257
|
-
* @hidden
|
|
258
|
-
*/
|
|
259
|
-
render(): JSX.Element;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* @hidden
|
|
264
|
-
*/
|
|
265
|
-
export declare class UploadActionButtons extends React_2.Component<UploadActionButtonsProps, {}> {
|
|
266
|
-
private _uploadElement;
|
|
267
|
-
private _clearElement;
|
|
268
|
-
componentDidUpdate(prevProps: UploadActionButtonsProps): void;
|
|
269
|
-
onClearClick: () => void;
|
|
270
|
-
checkEnterKey: (e: React_2.KeyboardEvent) => boolean;
|
|
271
|
-
onUploadClick: () => void;
|
|
272
|
-
render(): JSX.Element;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @hidden
|
|
277
|
-
*/
|
|
278
|
-
declare interface UploadActionButtonsProps {
|
|
279
|
-
disabled: boolean;
|
|
280
|
-
navigationIndex?: number;
|
|
281
|
-
clearButtonIndex: number;
|
|
282
|
-
uploadButtonIndex: number;
|
|
283
|
-
actionsLayout: string;
|
|
284
|
-
onUpload: () => void;
|
|
285
|
-
onClear: () => void;
|
|
286
|
-
onClick: (navIndex: number | undefined) => void;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Lists the possible layout of the Upload action buttons.
|
|
291
|
-
*/
|
|
292
|
-
export declare type UploadActionsLayout = 'start' | 'center' | 'end' | 'stretched';
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* @hidden
|
|
296
|
-
*/
|
|
297
|
-
export declare class UploadAddButton extends React_2.Component<UploadAddButtonProps, {}> {
|
|
298
|
-
private _element;
|
|
299
|
-
private _uploadInput;
|
|
300
|
-
get actionElement(): HTMLInputElement | null | undefined;
|
|
301
|
-
componentDidUpdate(prevProps: UploadAddButtonProps): void;
|
|
302
|
-
focus: () => void;
|
|
303
|
-
onClick: () => void;
|
|
304
|
-
onInputMouseDown: (e: React_2.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
305
|
-
render(): JSX.Element;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* @hidden
|
|
310
|
-
*/
|
|
311
|
-
declare interface UploadAddButtonProps {
|
|
312
|
-
addButtonIndex: number;
|
|
313
|
-
navigationIndex: number | undefined;
|
|
314
|
-
notFocusedIndex: number | undefined;
|
|
315
|
-
tabIndex?: number;
|
|
316
|
-
async: UploadAsyncProps;
|
|
317
|
-
multiple?: boolean;
|
|
318
|
-
disabled?: boolean;
|
|
319
|
-
accept?: string;
|
|
320
|
-
id?: string;
|
|
321
|
-
ariaLabelledBy?: string;
|
|
322
|
-
ariaDescribedBy?: string;
|
|
323
|
-
ariaControls?: string;
|
|
324
|
-
ariaExpanded?: boolean;
|
|
325
|
-
hasFiles?: boolean;
|
|
326
|
-
onAdd: (files: FileList) => void;
|
|
327
|
-
onClick: (navIndex: number | undefined) => void;
|
|
328
|
-
selectMessageUI?: React_2.ComponentType<UploadSelectMessageProps>;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Represents the additional data that is sent as a key-value pair.
|
|
333
|
-
*/
|
|
334
|
-
export declare interface UploadAdditionalData {
|
|
335
|
-
[name: string]: any;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Represents the async properties of the Upload component.
|
|
340
|
-
*/
|
|
341
|
-
export declare interface UploadAsyncProps {
|
|
342
|
-
/**
|
|
343
|
-
* By default, the selected files are immediately uploaded.
|
|
344
|
-
* To change this behavior, set `autoUpload` to `false`.
|
|
345
|
-
*/
|
|
346
|
-
autoUpload?: boolean;
|
|
347
|
-
/**
|
|
348
|
-
* When enabled, all files in the selection are uploaded in one request.
|
|
349
|
-
* Any files that are selected one after the other are uploaded in separate requests.
|
|
350
|
-
*/
|
|
351
|
-
batch?: boolean;
|
|
352
|
-
/**
|
|
353
|
-
* Configures whether credentials (cookies, headers) will be sent for cross-site requests.
|
|
354
|
-
* Defaults to `true`. Setting `withCredentials` has no effect on same-site requests.
|
|
355
|
-
* To add credentials to the request, use the `saveHeaders` or `removeHeaders` property.
|
|
356
|
-
*/
|
|
357
|
-
withCredentials?: boolean;
|
|
358
|
-
/**
|
|
359
|
-
* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which
|
|
360
|
-
* contains the files submitted to `saveUrl`. Defaults to `files`.
|
|
361
|
-
*/
|
|
362
|
-
saveField?: string;
|
|
363
|
-
/**
|
|
364
|
-
* Configures the `HttpHeaders` that are attached to each upload request.
|
|
365
|
-
*/
|
|
366
|
-
saveHeaders?: UploadHttpHeaders;
|
|
367
|
-
/**
|
|
368
|
-
* Sets the [`request`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) method of the upload request.
|
|
369
|
-
* Defaults to `POST`.
|
|
370
|
-
*/
|
|
371
|
-
saveMethod?: string;
|
|
372
|
-
/**
|
|
373
|
-
* Sets the URL of the endpoint for the upload request.
|
|
374
|
-
* The requested [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key is named after
|
|
375
|
-
* the `saveField` property and contains the list of files that will be uploaded.
|
|
376
|
-
*/
|
|
377
|
-
saveUrl?: string | ((files: UploadFileInfo[], options: {
|
|
378
|
-
formData: FormData;
|
|
379
|
-
requestOptions: any;
|
|
380
|
-
}, onProgress: (uid: string, event: ProgressEvent) => void) => Promise<{
|
|
381
|
-
uid: string;
|
|
382
|
-
}>);
|
|
383
|
-
/**
|
|
384
|
-
* Sets the expected [response type](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType)
|
|
385
|
-
* of the server.
|
|
386
|
-
* Used to parse the response appropriately.
|
|
387
|
-
* Defaults to `json`.
|
|
388
|
-
*/
|
|
389
|
-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
390
|
-
/**
|
|
391
|
-
* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
|
|
392
|
-
* which contains the list of file names that are submitted to `removeUrl`.
|
|
393
|
-
* Defaults to `fileNames`.
|
|
394
|
-
*/
|
|
395
|
-
removeField?: string;
|
|
396
|
-
/**
|
|
397
|
-
* Configures the `HttpHeaders` that are attached to each `remove` request.
|
|
398
|
-
*/
|
|
399
|
-
removeHeaders?: UploadHttpHeaders;
|
|
400
|
-
/**
|
|
401
|
-
* Sets the [request method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the `remove` request.
|
|
402
|
-
* Defaults to `POST`.
|
|
403
|
-
*/
|
|
404
|
-
removeMethod?: string;
|
|
405
|
-
/**
|
|
406
|
-
* Sets the URL of the endpoint for the `remove` request.
|
|
407
|
-
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request
|
|
408
|
-
* key is named after the `removeField` property.
|
|
409
|
-
* It contains the list of file names which will be removed.
|
|
410
|
-
*/
|
|
411
|
-
removeUrl?: string | ((files: UploadFileInfo[], options: {
|
|
412
|
-
formData: FormData;
|
|
413
|
-
requestOptions: any;
|
|
414
|
-
}) => Promise<{
|
|
415
|
-
uid: string;
|
|
416
|
-
}>);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* @hidden
|
|
421
|
-
*/
|
|
422
|
-
export declare class UploadDropZone extends React_2.Component<UploadDropZoneProps, {}> {
|
|
423
|
-
private _documentInterval;
|
|
424
|
-
private _elementInterval;
|
|
425
|
-
private _lastDocumentDragOver;
|
|
426
|
-
private _lastElementDragOver;
|
|
427
|
-
private _documentActive;
|
|
428
|
-
private _elementActive;
|
|
429
|
-
private get documentActive();
|
|
430
|
-
private set documentActive(value);
|
|
431
|
-
private get elementActive();
|
|
432
|
-
private set elementActive(value);
|
|
433
|
-
componentDidMount(): void;
|
|
434
|
-
componentWillUnmount(): void;
|
|
435
|
-
onDocumentDragEnter: () => void;
|
|
436
|
-
onDocumentDragOver: () => void;
|
|
437
|
-
onElementDragEnter: () => void;
|
|
438
|
-
onElementDragOver: (event: any) => void;
|
|
439
|
-
onDrop: (event: any) => void;
|
|
440
|
-
isDragOver: (prevDate: Date | null) => boolean;
|
|
441
|
-
render(): JSX.Element;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* @hidden
|
|
446
|
-
*/
|
|
447
|
-
declare interface UploadDropZoneProps {
|
|
448
|
-
addButtonComponent: any;
|
|
449
|
-
fileGroup: GroupedFiles;
|
|
450
|
-
disabled: boolean | undefined;
|
|
451
|
-
multiple: boolean;
|
|
452
|
-
onAdd: (files: FileList) => void;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Contains information which is related to the selected file.
|
|
457
|
-
*/
|
|
458
|
-
export declare interface UploadFileInfo {
|
|
459
|
-
/**
|
|
460
|
-
* The unique identifier of the group (batch) with one or more files.
|
|
461
|
-
* Has to be set for the initial list of files.
|
|
462
|
-
*/
|
|
463
|
-
uid: string;
|
|
464
|
-
/**
|
|
465
|
-
* The file name.
|
|
466
|
-
*/
|
|
467
|
-
name: string;
|
|
468
|
-
/**
|
|
469
|
-
* The file extension including the leading dot—for example, `.jpg`, `.png`, or other.
|
|
470
|
-
*/
|
|
471
|
-
extension?: string;
|
|
472
|
-
/**
|
|
473
|
-
* The file size in bytes.
|
|
474
|
-
*/
|
|
475
|
-
size?: number;
|
|
476
|
-
/**
|
|
477
|
-
* A list which contains the validation errors (if any).
|
|
478
|
-
*/
|
|
479
|
-
validationErrors?: Array<string>;
|
|
480
|
-
/**
|
|
481
|
-
* The current state of the file—`Failed`, `Selected`, `Uploaded`, or `Uploading`.
|
|
482
|
-
* `Initial` is a special value for `FileState` and is
|
|
483
|
-
* automatically applied to initial files without you having to explicitly set their state.
|
|
484
|
-
*/
|
|
485
|
-
status: UploadFileStatus;
|
|
486
|
-
/**
|
|
487
|
-
* The current upload progress.
|
|
488
|
-
*/
|
|
489
|
-
progress: number;
|
|
490
|
-
/**
|
|
491
|
-
* Gets the raw file instance.
|
|
492
|
-
*/
|
|
493
|
-
getRawFile?: () => File;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Configures the restrictions for the files that can be uploaded.
|
|
498
|
-
*/
|
|
499
|
-
export declare interface UploadFileRestrictions {
|
|
500
|
-
/**
|
|
501
|
-
* The list of the allowed file extensions.
|
|
502
|
-
* Recognizes entries of both `.type` (for example, `.docx`, `.png`, `.svg`, `.xls`, and others)
|
|
503
|
-
* and `type` (for example, `docx`, `png`, `svg`, `xls`, and others) values.
|
|
504
|
-
*/
|
|
505
|
-
allowedExtensions?: Array<string>;
|
|
506
|
-
/**
|
|
507
|
-
* Defines the maximum file size in bytes.
|
|
508
|
-
*/
|
|
509
|
-
maxFileSize?: number;
|
|
510
|
-
/**
|
|
511
|
-
* Defines the minimum file size in bytes.
|
|
512
|
-
*/
|
|
513
|
-
minFileSize?: number;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* Lists the possible states of a file.
|
|
518
|
-
*/
|
|
519
|
-
export declare enum UploadFileStatus {
|
|
520
|
-
/**
|
|
521
|
-
* Indicates that the file upload process has failed.
|
|
522
|
-
*/
|
|
523
|
-
UploadFailed = 0,
|
|
524
|
-
/**
|
|
525
|
-
* An initially selected fake file without a set state.
|
|
526
|
-
*/
|
|
527
|
-
Initial = 1,
|
|
528
|
-
/**
|
|
529
|
-
* The file is selected.
|
|
530
|
-
*/
|
|
531
|
-
Selected = 2,
|
|
532
|
-
/**
|
|
533
|
-
* The file is in the process of uploading.
|
|
534
|
-
*/
|
|
535
|
-
Uploading = 3,
|
|
536
|
-
/**
|
|
537
|
-
* The file is successfully uploaded.
|
|
538
|
-
*/
|
|
539
|
-
Uploaded = 4,
|
|
540
|
-
/**
|
|
541
|
-
* The remove process has failed.
|
|
542
|
-
*/
|
|
543
|
-
RemoveFailed = 5,
|
|
544
|
-
/**
|
|
545
|
-
* The file is in the process of removing.
|
|
546
|
-
*/
|
|
547
|
-
Removing = 6
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Represents the HttpHeaders as a key-value pair.
|
|
552
|
-
*/
|
|
553
|
-
export declare interface UploadHttpHeaders {
|
|
554
|
-
[name: string]: string | string[];
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* @hidden
|
|
559
|
-
*/
|
|
560
|
-
export declare class UploadInput extends React_2.Component<UploadInputProps, {}> {
|
|
561
|
-
private _input;
|
|
562
|
-
get actionElement(): HTMLInputElement | null;
|
|
563
|
-
onMouseDown: (e: any) => void;
|
|
564
|
-
onAdd: () => void;
|
|
565
|
-
render(): JSX.Element;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* @hidden
|
|
570
|
-
*/
|
|
571
|
-
declare interface UploadInputProps {
|
|
572
|
-
async: UploadAsyncProps;
|
|
573
|
-
multiple?: boolean;
|
|
574
|
-
disabled?: boolean;
|
|
575
|
-
accept?: string;
|
|
576
|
-
hasFiles?: boolean;
|
|
577
|
-
ariaLabelledBy?: string;
|
|
578
|
-
ariaDescribedBy?: string;
|
|
579
|
-
id?: string;
|
|
580
|
-
onAdd?: (files: FileList) => void;
|
|
581
|
-
onMouseDown?: (e: React_2.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* @hidden
|
|
586
|
-
*/
|
|
587
|
-
export declare class UploadList extends React_2.Component<UploadListProps, {}> {
|
|
588
|
-
mapListGroups(): JSX.Element[];
|
|
589
|
-
render(): JSX.Element;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* @hidden
|
|
594
|
-
*/
|
|
595
|
-
export declare class UploadListActionButton extends React_2.Component<UploadListActionButtonProps, UploadListActionButtonState> {
|
|
596
|
-
constructor(props: UploadListActionButtonProps);
|
|
597
|
-
actionButtonTitle(status: UploadFileStatus, localizationService: LocalizationService): string;
|
|
598
|
-
retryButtonTitle(localizationService: LocalizationService): string;
|
|
599
|
-
buttonClassNames: (type: string) => string;
|
|
600
|
-
onRetryFocus: () => void;
|
|
601
|
-
onRetryBlur: () => void;
|
|
602
|
-
onActionFocus: () => void;
|
|
603
|
-
onActionBlur: () => void;
|
|
604
|
-
onActionClick: () => void;
|
|
605
|
-
onRetryClick: () => void;
|
|
606
|
-
render(): JSX.Element;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* @hidden
|
|
611
|
-
*/
|
|
612
|
-
declare interface UploadListActionButtonProps {
|
|
613
|
-
progress: number;
|
|
614
|
-
uid: string;
|
|
615
|
-
status: UploadFileStatus;
|
|
616
|
-
async: UploadAsyncProps;
|
|
617
|
-
disabled: boolean;
|
|
618
|
-
onCancel: (uid: string) => void;
|
|
619
|
-
onRemove: (uid: string) => void;
|
|
620
|
-
onRetry: (uid: string) => void;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* @hidden
|
|
625
|
-
*/
|
|
626
|
-
declare interface UploadListActionButtonState {
|
|
627
|
-
retryFocused: boolean;
|
|
628
|
-
actionFocused: boolean;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* @hidden
|
|
633
|
-
*/
|
|
634
|
-
export declare class UploadListGroup extends React_2.Component<UploadListGroupProps, {}> {
|
|
635
|
-
private _element;
|
|
636
|
-
componentDidUpdate(): void;
|
|
637
|
-
onClick: () => void;
|
|
638
|
-
render(): JSX.Element;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
/**
|
|
642
|
-
* @hidden
|
|
643
|
-
*/
|
|
644
|
-
declare interface UploadListGroupProps {
|
|
645
|
-
files: Array<UploadFileInfo>;
|
|
646
|
-
async: UploadAsyncProps;
|
|
647
|
-
disabled: boolean;
|
|
648
|
-
navigationIndex: number | undefined;
|
|
649
|
-
listItemUI?: React_2.ComponentType<UploadListItemProps>;
|
|
650
|
-
index: number;
|
|
651
|
-
onCancel: (uid: string) => void;
|
|
652
|
-
onRemove: (uid: string) => void;
|
|
653
|
-
onRetry: (uid: string) => void;
|
|
654
|
-
onClick: (navIndex: number | undefined) => void;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* Represents the properties of the KendoReact UploadList Item component.
|
|
659
|
-
*/
|
|
660
|
-
export declare interface UploadListItemProps {
|
|
661
|
-
/**
|
|
662
|
-
* One or more files for the current item.
|
|
663
|
-
*/
|
|
664
|
-
files: Array<UploadFileInfo>;
|
|
665
|
-
/**
|
|
666
|
-
* The `disabled` property of the Upload.
|
|
667
|
-
*/
|
|
668
|
-
disabled: boolean;
|
|
669
|
-
/**
|
|
670
|
-
* The asynchronous properties of the Upload.
|
|
671
|
-
*/
|
|
672
|
-
async: UploadAsyncProps;
|
|
673
|
-
/**
|
|
674
|
-
* Fires when the user clicks the **Cancel** button.
|
|
675
|
-
*/
|
|
676
|
-
onCancel: (uid: string) => void;
|
|
677
|
-
/**
|
|
678
|
-
* Fires when the user clicks the **Remove** button.
|
|
679
|
-
*/
|
|
680
|
-
onRemove: (uid: string) => void;
|
|
681
|
-
/**
|
|
682
|
-
* Fires when the user clicks the **Retry** button.
|
|
683
|
-
*/
|
|
684
|
-
onRetry: (uid: string) => void;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* @hidden
|
|
689
|
-
*/
|
|
690
|
-
export declare class UploadListMultiItem extends React_2.Component<UploadListItemProps, {}> {
|
|
691
|
-
/**
|
|
692
|
-
* @hidden
|
|
693
|
-
*/
|
|
694
|
-
getFileValidationMessage(file: UploadFileInfo): string;
|
|
695
|
-
/**
|
|
696
|
-
* @hidden
|
|
697
|
-
*/
|
|
698
|
-
mapFiles: () => JSX.Element[];
|
|
699
|
-
/**
|
|
700
|
-
* @hidden
|
|
701
|
-
*/
|
|
702
|
-
progress: () => number;
|
|
703
|
-
render(): JSX.Element;
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
* @hidden
|
|
708
|
-
*/
|
|
709
|
-
declare interface UploadListProps {
|
|
710
|
-
groupedFiles: GroupedFiles;
|
|
711
|
-
async: UploadAsyncProps;
|
|
712
|
-
disabled: boolean;
|
|
713
|
-
navigationIndex?: number;
|
|
714
|
-
listId?: string;
|
|
715
|
-
listItemUI?: React_2.ComponentType<UploadListItemProps>;
|
|
716
|
-
onCancel: (uid: string) => void;
|
|
717
|
-
onRemove: (uid: string) => void;
|
|
718
|
-
onRetry: (uid: string) => void;
|
|
719
|
-
onClick: (navIndex: number | undefined) => void;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* @hidden
|
|
724
|
-
*/
|
|
725
|
-
export declare class UploadListSingleItem extends React_2.Component<UploadListItemProps, {}> {
|
|
726
|
-
/**
|
|
727
|
-
* @hidden
|
|
728
|
-
*/
|
|
729
|
-
getFileExtension(file: UploadFileInfo): string;
|
|
730
|
-
/**
|
|
731
|
-
* @hidden
|
|
732
|
-
*/
|
|
733
|
-
getFileValidationMessage(file: UploadFileInfo, isUploadFailed: boolean): string;
|
|
734
|
-
/**
|
|
735
|
-
* @hidden
|
|
736
|
-
*/
|
|
737
|
-
renderValidationError(file: UploadFileInfo, isUploadFailed: boolean): JSX.Element;
|
|
738
|
-
/**
|
|
739
|
-
* @hidden
|
|
740
|
-
*/
|
|
741
|
-
renderFileDetails(file: UploadFileInfo): JSX.Element;
|
|
742
|
-
/**
|
|
743
|
-
* @hidden
|
|
744
|
-
*/
|
|
745
|
-
render(): JSX.Element;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
/**
|
|
749
|
-
* @hidden
|
|
750
|
-
*/
|
|
751
|
-
export declare const uploadMessages: {
|
|
752
|
-
"upload.cancel": string;
|
|
753
|
-
"upload.clearSelectedFiles": string;
|
|
754
|
-
"upload.dropFilesHere": string;
|
|
755
|
-
"upload.headerStatusUploaded": string;
|
|
756
|
-
"upload.headerStatusUploading": string;
|
|
757
|
-
"upload.invalidFileExtension": string;
|
|
758
|
-
"upload.invalidFiles": string;
|
|
759
|
-
"upload.invalidMaxFileSize": string;
|
|
760
|
-
"upload.invalidMinFileSize": string;
|
|
761
|
-
"upload.remove": string;
|
|
762
|
-
"upload.retry": string;
|
|
763
|
-
"upload.select": string;
|
|
764
|
-
"upload.selectTitle": string;
|
|
765
|
-
"upload.selectNoFilesTitle": string;
|
|
766
|
-
"upload.uploadSelectedFiles": string;
|
|
767
|
-
"upload.total": string;
|
|
768
|
-
"upload.files": string;
|
|
769
|
-
"upload.statusUploaded": string;
|
|
770
|
-
"upload.statusUploadFailed": string;
|
|
771
|
-
"upload.dropZoneHint": string;
|
|
772
|
-
"upload.defaultDropZoneNote": string;
|
|
773
|
-
"upload.dropZoneNote": string;
|
|
774
|
-
};
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* The `onAdd` event.
|
|
778
|
-
*/
|
|
779
|
-
export declare interface UploadOnAddEvent extends BaseUploadEvent<Upload> {
|
|
780
|
-
/**
|
|
781
|
-
* The new updated state candidate.
|
|
782
|
-
*/
|
|
783
|
-
newState: Array<UploadFileInfo>;
|
|
784
|
-
/**
|
|
785
|
-
* The list of affected files.
|
|
786
|
-
*/
|
|
787
|
-
affectedFiles: Array<UploadFileInfo>;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
* The `onBeforeRemove` event.
|
|
792
|
-
*/
|
|
793
|
-
export declare interface UploadOnBeforeRemoveEvent extends BaseUploadEvent<Upload> {
|
|
794
|
-
/**
|
|
795
|
-
* The files that will be sent with the request.
|
|
796
|
-
*/
|
|
797
|
-
files: Array<UploadFileInfo>;
|
|
798
|
-
/**
|
|
799
|
-
* The headers that will be sent with the request. Can be modified.
|
|
800
|
-
*/
|
|
801
|
-
headers: UploadHttpHeaders;
|
|
802
|
-
/**
|
|
803
|
-
* The additional data that will be sent with the request. Can be modified.
|
|
804
|
-
*/
|
|
805
|
-
additionalData: UploadAdditionalData;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* The `onBeforeUpload` event.
|
|
810
|
-
*/
|
|
811
|
-
export declare interface UploadOnBeforeUploadEvent extends BaseUploadEvent<Upload> {
|
|
812
|
-
/**
|
|
813
|
-
* The files that will be sent with the request.
|
|
814
|
-
*/
|
|
815
|
-
files: Array<UploadFileInfo>;
|
|
816
|
-
/**
|
|
817
|
-
* The headers that will be sent with the request. Can be modified.
|
|
818
|
-
*/
|
|
819
|
-
headers: UploadHttpHeaders;
|
|
820
|
-
/**
|
|
821
|
-
* The additional data that will be sent with the request. Can be modified.
|
|
822
|
-
*/
|
|
823
|
-
additionalData: UploadAdditionalData;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* The `onCancel` event.
|
|
828
|
-
*/
|
|
829
|
-
export declare interface UploadOnCancelEvent extends BaseUploadEvent<Upload> {
|
|
830
|
-
/**
|
|
831
|
-
* The unique identifier of the group (batch) of one or more files that is cancelled.
|
|
832
|
-
*/
|
|
833
|
-
uid: string;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* The `onProgress` event.
|
|
838
|
-
*/
|
|
839
|
-
export declare interface UploadOnProgressEvent extends BaseUploadEvent<Upload> {
|
|
840
|
-
/**
|
|
841
|
-
* The new updated state candidate.
|
|
842
|
-
*/
|
|
843
|
-
newState: Array<UploadFileInfo>;
|
|
844
|
-
/**
|
|
845
|
-
* The list of the affected files.
|
|
846
|
-
*/
|
|
847
|
-
affectedFiles: Array<UploadFileInfo>;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* The `onRemove` event.
|
|
852
|
-
*/
|
|
853
|
-
export declare interface UploadOnRemoveEvent extends BaseUploadEvent<Upload> {
|
|
854
|
-
/**
|
|
855
|
-
* The new updated state candidate.
|
|
856
|
-
*/
|
|
857
|
-
newState: Array<UploadFileInfo>;
|
|
858
|
-
/**
|
|
859
|
-
* The list of the affected files.
|
|
860
|
-
*/
|
|
861
|
-
affectedFiles: Array<UploadFileInfo>;
|
|
862
|
-
/**
|
|
863
|
-
* The server response (if available).
|
|
864
|
-
*/
|
|
865
|
-
response?: UploadResponse;
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* The `onStatusChange` event.
|
|
870
|
-
*/
|
|
871
|
-
export declare interface UploadOnStatusChangeEvent extends BaseUploadEvent<Upload> {
|
|
872
|
-
/**
|
|
873
|
-
* The new updated state candidate.
|
|
874
|
-
*/
|
|
875
|
-
newState: Array<UploadFileInfo>;
|
|
876
|
-
/**
|
|
877
|
-
* The list of the affected files.
|
|
878
|
-
*/
|
|
879
|
-
affectedFiles: Array<UploadFileInfo>;
|
|
880
|
-
/**
|
|
881
|
-
* The server response (if available).
|
|
882
|
-
*/
|
|
883
|
-
response?: UploadResponse;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
/**
|
|
887
|
-
* Represents the props of the [KendoReact Upload component](https://www.telerik.com/kendo-react-ui/components/upload).
|
|
888
|
-
*/
|
|
889
|
-
export declare interface UploadProps extends UploadAsyncProps {
|
|
890
|
-
/**
|
|
891
|
-
* Adds a custom CSS class to the Upload container element.
|
|
892
|
-
*
|
|
893
|
-
* Example:
|
|
894
|
-
* ```jsx
|
|
895
|
-
* <Upload className="custom-upload-class" />
|
|
896
|
-
* ```
|
|
897
|
-
*/
|
|
898
|
-
className?: string;
|
|
899
|
-
/**
|
|
900
|
-
* Enables or disables the selection of multiple files. Defaults to `true`.
|
|
901
|
-
*
|
|
902
|
-
* @default true
|
|
903
|
-
*
|
|
904
|
-
* @example
|
|
905
|
-
* ```jsx
|
|
906
|
-
* <Upload multiple={false} />
|
|
907
|
-
* ```
|
|
908
|
-
*/
|
|
909
|
-
multiple?: boolean;
|
|
910
|
-
/**
|
|
911
|
-
* Disables the Upload component. Defaults to `false`.
|
|
912
|
-
*
|
|
913
|
-
* @default false
|
|
914
|
-
*
|
|
915
|
-
* @example
|
|
916
|
-
* ```jsx
|
|
917
|
-
* <Upload disabled={true} />
|
|
918
|
-
* ```
|
|
919
|
-
*/
|
|
920
|
-
disabled?: boolean;
|
|
921
|
-
/**
|
|
922
|
-
* Toggles the visibility of the file list in the Upload component.
|
|
923
|
-
*
|
|
924
|
-
* @default true
|
|
925
|
-
*
|
|
926
|
-
* @example
|
|
927
|
-
* ```jsx
|
|
928
|
-
* <Upload showFileList={false} />
|
|
929
|
-
* ```
|
|
930
|
-
*/
|
|
931
|
-
showFileList?: boolean;
|
|
932
|
-
/**
|
|
933
|
-
* Toggles the visibility of action buttons when `autoUpload` is set to `false`.
|
|
934
|
-
*
|
|
935
|
-
* @default true
|
|
936
|
-
*
|
|
937
|
-
* @example
|
|
938
|
-
* ```jsx
|
|
939
|
-
* <Upload autoUpload={false} showActionButtons={true} />
|
|
940
|
-
* ```
|
|
941
|
-
*/
|
|
942
|
-
showActionButtons?: boolean;
|
|
943
|
-
/**
|
|
944
|
-
* Specifies the layout of the action buttons. Defaults to `end`.
|
|
945
|
-
*
|
|
946
|
-
* @default "end"
|
|
947
|
-
*
|
|
948
|
-
* @example
|
|
949
|
-
* ```jsx
|
|
950
|
-
* <Upload actionsLayout="start" />
|
|
951
|
-
* ```
|
|
952
|
-
*/
|
|
953
|
-
actionsLayout?: UploadActionsLayout;
|
|
954
|
-
/**
|
|
955
|
-
* Sets the `tabIndex` attribute of the Upload component.
|
|
956
|
-
*
|
|
957
|
-
* Example:
|
|
958
|
-
* ```jsx
|
|
959
|
-
* <Upload tabIndex={0} />
|
|
960
|
-
* ```
|
|
961
|
-
*/
|
|
962
|
-
tabIndex?: number | string;
|
|
963
|
-
/**
|
|
964
|
-
* Specifies the `id` attribute of the Upload component.
|
|
965
|
-
*
|
|
966
|
-
* Example:
|
|
967
|
-
* ```jsx
|
|
968
|
-
* <Upload id="upload-component" />
|
|
969
|
-
* ```
|
|
970
|
-
*/
|
|
971
|
-
id?: string;
|
|
972
|
-
/**
|
|
973
|
-
* Identifies elements that describe the Upload component, similar to the `aria-describedby` attribute.
|
|
974
|
-
*
|
|
975
|
-
* Example:
|
|
976
|
-
* ```jsx
|
|
977
|
-
* <Upload ariaDescribedBy="upload-description" />
|
|
978
|
-
* ```
|
|
979
|
-
*/
|
|
980
|
-
ariaDescribedBy?: string;
|
|
981
|
-
/**
|
|
982
|
-
* Identifies elements that label the Upload component, similar to the `aria-labelledby` attribute.
|
|
983
|
-
*
|
|
984
|
-
* Example:
|
|
985
|
-
* ```jsx
|
|
986
|
-
* <Upload ariaLabelledBy="upload-label" />
|
|
987
|
-
* ```
|
|
988
|
-
*/
|
|
989
|
-
ariaLabelledBy?: string;
|
|
990
|
-
/**
|
|
991
|
-
* Sets the `accept` attribute of the file input element to specify allowed file types.
|
|
992
|
-
*
|
|
993
|
-
* Example:
|
|
994
|
-
* ```jsx
|
|
995
|
-
* <Upload accept=".jpg,.png" />
|
|
996
|
-
* ```
|
|
997
|
-
*/
|
|
998
|
-
accept?: string;
|
|
999
|
-
/**
|
|
1000
|
-
* Configures file restrictions such as allowed extensions and maximum file size.
|
|
1001
|
-
*
|
|
1002
|
-
* Example:
|
|
1003
|
-
* ```jsx
|
|
1004
|
-
* <Upload restrictions={{ allowedExtensions: ['.jpg', '.png'], maxFileSize: 1048576 }} />
|
|
1005
|
-
* ```
|
|
1006
|
-
*/
|
|
1007
|
-
restrictions?: UploadFileRestrictions;
|
|
1008
|
-
/**
|
|
1009
|
-
* Provides the list of files to be displayed in controlled mode.
|
|
1010
|
-
*
|
|
1011
|
-
* Example:
|
|
1012
|
-
* ```jsx
|
|
1013
|
-
* <Upload files={[{ name: 'file1.jpg', size: 1024 }]} />
|
|
1014
|
-
* ```
|
|
1015
|
-
*/
|
|
1016
|
-
files?: Array<UploadFileInfo>;
|
|
1017
|
-
/**
|
|
1018
|
-
* Provides the initial list of files to be displayed in uncontrolled mode.
|
|
1019
|
-
*
|
|
1020
|
-
* Example:
|
|
1021
|
-
* ```jsx
|
|
1022
|
-
* <Upload defaultFiles={[{ name: 'file1.jpg', size: 1024 }]} />
|
|
1023
|
-
* ```
|
|
1024
|
-
*/
|
|
1025
|
-
defaultFiles?: Array<UploadFileInfo>;
|
|
1026
|
-
/**
|
|
1027
|
-
* Customizes the rendering of list items in the file list.
|
|
1028
|
-
*
|
|
1029
|
-
* Example:
|
|
1030
|
-
* ```jsx
|
|
1031
|
-
* <Upload listItemUI={(props) => <CustomListItem {...props} />} />
|
|
1032
|
-
* ```
|
|
1033
|
-
*/
|
|
1034
|
-
listItemUI?: React.ComponentType<UploadListItemProps>;
|
|
1035
|
-
/**
|
|
1036
|
-
* Customizes the content of the add button in the Upload component.
|
|
1037
|
-
*
|
|
1038
|
-
* Example:
|
|
1039
|
-
* ```jsx
|
|
1040
|
-
* <Upload selectMessageUI={(props) => <CustomSelectMessage {...props} />} />
|
|
1041
|
-
* ```
|
|
1042
|
-
*/
|
|
1043
|
-
selectMessageUI?: React.ComponentType<UploadSelectMessageProps>;
|
|
1044
|
-
/**
|
|
1045
|
-
* Triggered when new files are selected for upload.
|
|
1046
|
-
*
|
|
1047
|
-
* Example:
|
|
1048
|
-
* ```jsx
|
|
1049
|
-
* <Upload onAdd={(event) => console.log(event.files)} />
|
|
1050
|
-
* ```
|
|
1051
|
-
*/
|
|
1052
|
-
onAdd?: (event: UploadOnAddEvent) => void;
|
|
1053
|
-
/**
|
|
1054
|
-
* Triggered when files are removed. May include a server response if applicable.
|
|
1055
|
-
*
|
|
1056
|
-
* Example:
|
|
1057
|
-
* ```jsx
|
|
1058
|
-
* <Upload onRemove={(event) => console.log(event.files)} />
|
|
1059
|
-
* ```
|
|
1060
|
-
*/
|
|
1061
|
-
onRemove?: (event: UploadOnRemoveEvent) => void;
|
|
1062
|
-
/**
|
|
1063
|
-
* Triggered when the status of files changes. May include a server response if applicable.
|
|
1064
|
-
*
|
|
1065
|
-
* Example:
|
|
1066
|
-
* ```jsx
|
|
1067
|
-
* <Upload onStatusChange={(event) => console.log(event.files)} />
|
|
1068
|
-
* ```
|
|
1069
|
-
*/
|
|
1070
|
-
onStatusChange?: (event: UploadOnStatusChangeEvent) => void;
|
|
1071
|
-
/**
|
|
1072
|
-
* Triggered when the upload progress of a file changes.
|
|
1073
|
-
*
|
|
1074
|
-
* Example:
|
|
1075
|
-
* ```jsx
|
|
1076
|
-
* <Upload onProgress={(event) => console.log(event.percentComplete)} />
|
|
1077
|
-
* ```
|
|
1078
|
-
*/
|
|
1079
|
-
onProgress?: (event: UploadOnProgressEvent) => void;
|
|
1080
|
-
/**
|
|
1081
|
-
* Triggered before a file upload request is made. Can be used to add extra data to the request.
|
|
1082
|
-
*
|
|
1083
|
-
* Example:
|
|
1084
|
-
* ```jsx
|
|
1085
|
-
* <Upload onBeforeUpload={(event) => console.log(event.additionalData)} />
|
|
1086
|
-
* ```
|
|
1087
|
-
*/
|
|
1088
|
-
onBeforeUpload?: (event: UploadOnBeforeUploadEvent) => void;
|
|
1089
|
-
/**
|
|
1090
|
-
* Triggered before a file removal request is made. Can be used to add extra data to the request.
|
|
1091
|
-
*
|
|
1092
|
-
* Example:
|
|
1093
|
-
* ```jsx
|
|
1094
|
-
* <Upload onBeforeRemove={(event) => console.log(event.additionalData)} />
|
|
1095
|
-
* ```
|
|
1096
|
-
*/
|
|
1097
|
-
onBeforeRemove?: (event: UploadOnBeforeRemoveEvent) => void;
|
|
1098
|
-
/**
|
|
1099
|
-
* Triggered when the user cancels an upload in progress. Useful for custom cancellation logic.
|
|
1100
|
-
*
|
|
1101
|
-
* Example:
|
|
1102
|
-
* ```jsx
|
|
1103
|
-
* <Upload onCancel={(event) => console.log('Upload canceled')} />
|
|
1104
|
-
* ```
|
|
1105
|
-
*/
|
|
1106
|
-
onCancel?: (event: UploadOnCancelEvent) => void;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
/**
|
|
1110
|
-
* Represents the response type of the Upload.
|
|
1111
|
-
*/
|
|
1112
|
-
export declare interface UploadResponse {
|
|
1113
|
-
/**
|
|
1114
|
-
* The response that was provided by the server.
|
|
1115
|
-
*/
|
|
1116
|
-
response: any;
|
|
1117
|
-
/**
|
|
1118
|
-
* The HTTP status code from the server response.
|
|
1119
|
-
*/
|
|
1120
|
-
status: number;
|
|
1121
|
-
/**
|
|
1122
|
-
* The HTTP status message from the server response.
|
|
1123
|
-
*/
|
|
1124
|
-
statusText: string;
|
|
1125
|
-
/**
|
|
1126
|
-
* The headers with which the server responded.
|
|
1127
|
-
*/
|
|
1128
|
-
headers: any;
|
|
1129
|
-
/**
|
|
1130
|
-
* The XMLHttpRequest instance of the browser.
|
|
1131
|
-
*/
|
|
1132
|
-
request?: XMLHttpRequest;
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
/**
|
|
1136
|
-
* @hidden
|
|
1137
|
-
*/
|
|
1138
|
-
export declare const uploadSelect = "upload.select";
|
|
1139
|
-
|
|
1140
|
-
/**
|
|
1141
|
-
* Represents the props of the UI component that is inside the Upload add button.
|
|
1142
|
-
*/
|
|
1143
|
-
export declare interface UploadSelectMessageProps {
|
|
1144
|
-
/**
|
|
1145
|
-
* The `select` localized message.
|
|
1146
|
-
*/
|
|
1147
|
-
message: any;
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
/**
|
|
1151
|
-
* @hidden
|
|
1152
|
-
*/
|
|
1153
|
-
declare interface UploadState {
|
|
1154
|
-
files: Array<UploadFileInfo>;
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
/**
|
|
1158
|
-
* @hidden
|
|
1159
|
-
*/
|
|
1160
|
-
export declare class UploadStatus extends React_2.Component<UploadStatusProps, {}> {
|
|
1161
|
-
render(): JSX.Element;
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
/**
|
|
1165
|
-
* @hidden
|
|
1166
|
-
*/
|
|
1167
|
-
declare interface UploadStatusProps {
|
|
1168
|
-
isUploading: boolean;
|
|
1169
|
-
isUploaded: boolean;
|
|
1170
|
-
isUploadFailed: boolean;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
export declare const UploadUI: React_2.ForwardRefExoticComponent<UploadUIProps & React_2.RefAttributes<any>>;
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* @hidden
|
|
1177
|
-
*/
|
|
1178
|
-
export declare interface UploadUIProps extends UploadAsyncProps {
|
|
1179
|
-
className?: string;
|
|
1180
|
-
multiple?: boolean;
|
|
1181
|
-
disabled?: boolean;
|
|
1182
|
-
showFileList?: boolean;
|
|
1183
|
-
showActionButtons?: boolean;
|
|
1184
|
-
actionsLayout?: string;
|
|
1185
|
-
tabIndex?: number;
|
|
1186
|
-
accept?: string;
|
|
1187
|
-
groupedFiles: GroupedFiles;
|
|
1188
|
-
navigationIndex?: number;
|
|
1189
|
-
notFocusedIndex?: number;
|
|
1190
|
-
listItemUI?: React_2.ComponentType<UploadListItemProps>;
|
|
1191
|
-
selectMessageUI?: React_2.ComponentType<UploadSelectMessageProps>;
|
|
1192
|
-
id?: string;
|
|
1193
|
-
ariaLabelledBy?: string;
|
|
1194
|
-
ariaDescribedBy?: string;
|
|
1195
|
-
onAdd?: (files: FileList) => void;
|
|
1196
|
-
onCancel?: (uid: string) => void;
|
|
1197
|
-
onRemove?: (uid: string) => void;
|
|
1198
|
-
onRetry?: (uid: string) => void;
|
|
1199
|
-
onUpload?: () => void;
|
|
1200
|
-
onClear?: () => void;
|
|
1201
|
-
onFocus?: (event: React_2.FocusEvent<HTMLDivElement>) => void;
|
|
1202
|
-
onBlur?: (event: React_2.FocusEvent<HTMLDivElement>) => void;
|
|
1203
|
-
onKeyDown?: (event: React_2.KeyboardEvent, isRtl: boolean) => void;
|
|
1204
|
-
onClick?: (navIndex: number) => void;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
export declare const uploadUtils: {
|
|
1208
|
-
fileHasValidationErrors: Function;
|
|
1209
|
-
filesHaveValidationErrors: Function;
|
|
1210
|
-
getTotalFilesSizeMessage: Function;
|
|
1211
|
-
getAllFileInfo: Function;
|
|
1212
|
-
getFileInfo: Function;
|
|
1213
|
-
getFileExtension: Function;
|
|
1214
|
-
htmlEncode: Function;
|
|
1215
|
-
assignGuidToFiles: Function;
|
|
1216
|
-
getFileStatus: (currentFiles: GroupedFiles | UploadFileInfo[]) => boolean[];
|
|
1217
|
-
};
|
|
1218
|
-
|
|
1219
|
-
export { }
|
|
8
|
+
import { UploadUI, UploadUIProps } from './UploadUI.js';
|
|
9
|
+
import { Upload } from './Upload.js';
|
|
10
|
+
import { UploadOnAddEvent } from './interfaces/UploadOnAddEvent.js';
|
|
11
|
+
import { UploadOnBeforeRemoveEvent } from './interfaces/UploadOnBeforeRemoveEvent.js';
|
|
12
|
+
import { UploadOnBeforeUploadEvent } from './interfaces/UploadOnBeforeUploadEvent.js';
|
|
13
|
+
import { UploadOnProgressEvent } from './interfaces/UploadOnProgressEvent.js';
|
|
14
|
+
import { UploadOnRemoveEvent } from './interfaces/UploadOnRemoveEvent.js';
|
|
15
|
+
import { UploadOnStatusChangeEvent } from './interfaces/UploadOnStatusChangeEvent.js';
|
|
16
|
+
import { UploadAdditionalData } from './interfaces/UploadAdditionalData.js';
|
|
17
|
+
import { UploadAsyncProps } from './interfaces/UploadAsyncProps.js';
|
|
18
|
+
import { UploadFileInfo } from './interfaces/UploadFileInfo.js';
|
|
19
|
+
import { UploadFileRestrictions } from './interfaces/UploadFileRestrictions.js';
|
|
20
|
+
import { UploadFileStatus } from './interfaces/UploadFileStatus.js';
|
|
21
|
+
import { UploadHttpHeaders } from './interfaces/UploadHttpHeaders.js';
|
|
22
|
+
import { UploadResponse } from './interfaces/UploadResponse.js';
|
|
23
|
+
import { UploadListItemProps } from './interfaces/UploadListItemProps.js';
|
|
24
|
+
import { UploadProps } from './interfaces/UploadProps.js';
|
|
25
|
+
import { UploadOnCancelEvent } from './interfaces/UploadOnCancelEvent.js';
|
|
26
|
+
import { UploadActionsLayout } from './interfaces/UploadActionsLayout.js';
|
|
27
|
+
import { ExternalDropZone } from './ExternalDropZone.js';
|
|
28
|
+
import { UploadSelectMessageProps } from './interfaces/UploadSelectMessageProps.js';
|
|
29
|
+
import { UploadActionButtons } from './UploadActionButtons.js';
|
|
30
|
+
import { messages as uploadMessages, select as uploadSelect, invalidMaxFileSize, headerStatusUploaded, headerStatusUploading } from './messages/index.js';
|
|
31
|
+
import { UploadListSingleItem } from './UploadListSingleItem.js';
|
|
32
|
+
import { UploadAddButton } from './UploadAddButton.js';
|
|
33
|
+
import { UploadListActionButton } from './UploadListActionButton.js';
|
|
34
|
+
import { UploadListMultiItem } from './UploadListMultiItem.js';
|
|
35
|
+
import { UploadListGroup } from './UploadListGroup.js';
|
|
36
|
+
import { UploadDropZone } from './UploadDropZone.js';
|
|
37
|
+
import { UploadInput } from './UploadInput.js';
|
|
38
|
+
import { UploadList } from './UploadList.js';
|
|
39
|
+
import { UploadStatus } from './UploadStatus.js';
|
|
40
|
+
import { default as utils } from './utils/utils.js';
|
|
41
|
+
export { UploadUI, UploadUIProps, UploadFileRestrictions, Upload, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadOnCancelEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps, UploadActionsLayout, ExternalDropZone, UploadSelectMessageProps, UploadActionButtons, UploadListSingleItem, UploadAddButton, UploadListActionButton, UploadListGroup, UploadDropZone, UploadListMultiItem, UploadInput, UploadList, UploadStatus, uploadMessages, uploadSelect, invalidMaxFileSize, headerStatusUploaded, headerStatusUploading, utils as uploadUtils };
|