@progress/kendo-angular-upload 19.1.2-develop.2 → 19.1.2-develop.3
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/common/action-buttons-layout.d.ts +1 -1
- package/common/base.d.ts +15 -11
- package/directives.d.ts +3 -3
- package/dropzone-external.directive.d.ts +12 -4
- package/dropzone.component.d.ts +16 -9
- package/esm2022/common/base.mjs +15 -11
- package/esm2022/directives.mjs +3 -3
- package/esm2022/dropzone-external.directive.mjs +12 -4
- package/esm2022/dropzone.component.mjs +16 -9
- package/esm2022/events/cancel-event.mjs +7 -16
- package/esm2022/events/clear-event.mjs +5 -12
- package/esm2022/events/error-event.mjs +7 -13
- package/esm2022/events/pause-event.mjs +5 -12
- package/esm2022/events/remove-event.mjs +8 -12
- package/esm2022/events/resume-event.mjs +5 -12
- package/esm2022/events/select-event.mjs +5 -11
- package/esm2022/events/success-event.mjs +6 -12
- package/esm2022/events/upload-event.mjs +7 -34
- package/esm2022/events/upload-progress-event.mjs +5 -11
- package/esm2022/fileselect.component.mjs +16 -6
- package/esm2022/localization/messages.mjs +42 -0
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/templates/file-info-template.directive.mjs +5 -6
- package/esm2022/templates/file-template.directive.mjs +5 -6
- package/esm2022/types/file-state.mjs +5 -5
- package/esm2022/upload.component.mjs +73 -56
- package/events/cancel-event.d.ts +7 -16
- package/events/clear-event.d.ts +5 -12
- package/events/error-event.d.ts +7 -13
- package/events/pause-event.d.ts +5 -12
- package/events/remove-event.d.ts +8 -12
- package/events/resume-event.d.ts +5 -12
- package/events/select-event.d.ts +5 -11
- package/events/success-event.d.ts +6 -12
- package/events/upload-event.d.ts +7 -34
- package/events/upload-progress-event.d.ts +5 -11
- package/fesm2022/progress-kendo-angular-upload.mjs +254 -253
- package/fileselect.component.d.ts +14 -4
- package/localization/messages.d.ts +42 -0
- package/package.json +8 -8
- package/schematics/ngAdd/index.js +3 -3
- package/templates/file-info-template.directive.d.ts +5 -6
- package/templates/file-template.directive.d.ts +5 -6
- package/types/chunk-metadata.d.ts +3 -3
- package/types/chunk-settings.d.ts +4 -4
- package/types/file-restrictions.d.ts +4 -5
- package/types/file-state.d.ts +5 -5
- package/types/operation-type.d.ts +1 -1
- package/upload.component.d.ts +71 -54
@@ -43,6 +43,11 @@ export const UPLOAD_VALUE_ACCESSOR = {
|
|
43
43
|
let idx = 0;
|
44
44
|
/**
|
45
45
|
* Represents the [Kendo UI Upload component for Angular]({% slug overview_upload %}).
|
46
|
+
*
|
47
|
+
* @example
|
48
|
+
* ```html
|
49
|
+
* <kendo-upload> </kendo-upload>
|
50
|
+
* ```
|
46
51
|
*/
|
47
52
|
export class UploadComponent extends UploadFileSelectBase {
|
48
53
|
uploadService;
|
@@ -54,9 +59,11 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
54
59
|
cdr;
|
55
60
|
injector;
|
56
61
|
/**
|
57
|
-
*
|
62
|
+
* Specifies whether selected files upload automatically
|
58
63
|
* ([see example]({% slug fileprocessing_upload %}#toc-automatic-upload-of-files)).
|
59
|
-
*
|
64
|
+
* Set `autoUpload` to `false` to change this behavior.
|
65
|
+
*
|
66
|
+
* @default true
|
60
67
|
*/
|
61
68
|
set autoUpload(autoUpload) {
|
62
69
|
this.uploadService.async.autoUpload = autoUpload;
|
@@ -65,9 +72,11 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
65
72
|
return this.uploadService.async.autoUpload;
|
66
73
|
}
|
67
74
|
/**
|
68
|
-
*
|
75
|
+
* Specifies whether all files in the selection upload in a single request
|
69
76
|
* ([see example]({% slug fileprocessing_upload %}#toc-upload-of-batches-of-files)).
|
70
|
-
*
|
77
|
+
* Files selected one after the other upload in separate requests.
|
78
|
+
*
|
79
|
+
* @default false
|
71
80
|
*/
|
72
81
|
set batch(batch) {
|
73
82
|
this.uploadService.async.batch = batch;
|
@@ -76,11 +85,13 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
76
85
|
return this.uploadService.async.batch;
|
77
86
|
}
|
78
87
|
/**
|
79
|
-
*
|
88
|
+
* Specifies whether credentials (cookies, headers) are sent for cross-site requests
|
80
89
|
* ([see example]({% slug credentials_upload %}#toc-attaching-credentials-to-requests)).
|
81
|
-
*
|
82
|
-
*
|
83
|
-
*
|
90
|
+
* Set `withCredentials` has no effect on same-site requests.
|
91
|
+
* Use the `saveHeaders` or `removeHeaders` property to add credentials to the request.
|
92
|
+
* You can also use the [`upload`]({% slug api_upload_uploadevent %}) event.
|
93
|
+
*
|
94
|
+
* @default true
|
84
95
|
*/
|
85
96
|
set withCredentials(withCredentials) {
|
86
97
|
this.uploadService.async.withCredentials = withCredentials;
|
@@ -89,8 +100,8 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
89
100
|
return this.uploadService.async.withCredentials;
|
90
101
|
}
|
91
102
|
/**
|
92
|
-
*
|
93
|
-
*
|
103
|
+
* Specifies the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which contains the files submitted to `saveUrl`.
|
104
|
+
*
|
94
105
|
*/
|
95
106
|
set saveField(saveField) {
|
96
107
|
this.uploadService.async.saveField = saveField;
|
@@ -99,8 +110,7 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
99
110
|
return this.uploadService.async.saveField;
|
100
111
|
}
|
101
112
|
/**
|
102
|
-
*
|
103
|
-
* that are attached to each upload request.
|
113
|
+
* Specifies the [`HttpHeaders`](https://angular.io/api/common/http/HttpHeaders) attached to each upload request.
|
104
114
|
*/
|
105
115
|
set saveHeaders(saveHeaders) {
|
106
116
|
this.uploadService.async.saveHeaders = saveHeaders;
|
@@ -109,8 +119,8 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
109
119
|
return this.uploadService.async.saveHeaders;
|
110
120
|
}
|
111
121
|
/**
|
112
|
-
*
|
113
|
-
*
|
122
|
+
* Specifies the [`RequestMethod`](https://angular.io/api/http/RequestMethod) of the upload request.
|
123
|
+
*
|
114
124
|
*/
|
115
125
|
set saveMethod(saveMethod) {
|
116
126
|
this.uploadService.async.saveMethod = saveMethod;
|
@@ -119,9 +129,9 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
119
129
|
return this.uploadService.async.saveMethod;
|
120
130
|
}
|
121
131
|
/**
|
122
|
-
*
|
123
|
-
* The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
|
124
|
-
*
|
132
|
+
* Specifies the URL of the endpoint for the upload request.
|
133
|
+
* The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key uses the name from the `saveField` property.
|
134
|
+
* This key contains the list of files to be uploaded.
|
125
135
|
*/
|
126
136
|
set saveUrl(saveUrl) {
|
127
137
|
this.uploadService.async.saveUrl = saveUrl;
|
@@ -130,8 +140,9 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
130
140
|
return this.uploadService.async.saveUrl;
|
131
141
|
}
|
132
142
|
/**
|
133
|
-
*
|
134
|
-
*
|
143
|
+
* Specifies the expected [`response type`](https://angular.io/api/common/http/HttpRequest#responseType) of the server.
|
144
|
+
* The response type determines how the response is parsed.
|
145
|
+
*
|
135
146
|
* @default 'json'
|
136
147
|
*/
|
137
148
|
set responseType(responseType) {
|
@@ -141,15 +152,13 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
141
152
|
return this.uploadService.async.responseType;
|
142
153
|
}
|
143
154
|
/**
|
144
|
-
*
|
145
|
-
*
|
146
|
-
* The default value is `fileNames`.
|
155
|
+
* Specifies the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which contains the list of file names submitted to `removeUrl`.
|
156
|
+
*
|
147
157
|
*/
|
148
158
|
set removeField(removeField) { this.uploadService.async.removeField = removeField; }
|
149
159
|
get removeField() { return this.uploadService.async.removeField; }
|
150
160
|
/**
|
151
|
-
*
|
152
|
-
* that are attached to each `remove` request.
|
161
|
+
* Specifies the [`HttpHeaders`](https://angular.io/api/common/http/HttpHeaders) attached to each `remove` request.
|
153
162
|
*/
|
154
163
|
set removeHeaders(removeHeaders) {
|
155
164
|
this.uploadService.async.removeHeaders = removeHeaders;
|
@@ -158,8 +167,8 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
158
167
|
return this.uploadService.async.removeHeaders;
|
159
168
|
}
|
160
169
|
/**
|
161
|
-
*
|
162
|
-
*
|
170
|
+
* Specifies the [`RequestMethod`](https://angular.io/api/http/RequestMethod) of the `remove` request.
|
171
|
+
*
|
163
172
|
*/
|
164
173
|
set removeMethod(removeMethod) {
|
165
174
|
this.uploadService.async.removeMethod = removeMethod;
|
@@ -168,9 +177,9 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
168
177
|
return this.uploadService.async.removeMethod;
|
169
178
|
}
|
170
179
|
/**
|
171
|
-
*
|
172
|
-
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key
|
173
|
-
*
|
180
|
+
* Specifies the URL of the endpoint for the `remove` request.
|
181
|
+
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key uses the name from the `removeField` property.
|
182
|
+
* This key contains the list of file names to be removed.
|
174
183
|
*/
|
175
184
|
set removeUrl(removeUrl) {
|
176
185
|
this.uploadService.async.removeUrl = removeUrl;
|
@@ -179,13 +188,13 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
179
188
|
return this.uploadService.async.removeUrl;
|
180
189
|
}
|
181
190
|
/**
|
182
|
-
*
|
191
|
+
* Specifies whether the chunk functionality of the Upload is enabled.
|
183
192
|
*
|
184
193
|
* @default false
|
185
194
|
*/
|
186
195
|
chunkable = false;
|
187
196
|
/**
|
188
|
-
* Specifies
|
197
|
+
* Specifies whether selected files upload simultaneously or one by one.
|
189
198
|
*
|
190
199
|
* @default true
|
191
200
|
*/
|
@@ -196,7 +205,8 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
196
205
|
return this.uploadService.async.concurrent;
|
197
206
|
}
|
198
207
|
/**
|
199
|
-
*
|
208
|
+
* Specifies whether the file list is visible.
|
209
|
+
*
|
200
210
|
* @default true
|
201
211
|
*/
|
202
212
|
showFileList = true;
|
@@ -210,7 +220,9 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
210
220
|
return this.tabindex;
|
211
221
|
}
|
212
222
|
/**
|
213
|
-
* Specifies the
|
223
|
+
* Specifies the layout of the action buttons.
|
224
|
+
*
|
225
|
+
* @default 'end'
|
214
226
|
*/
|
215
227
|
actionsLayout = 'end';
|
216
228
|
fileSelectInput;
|
@@ -219,39 +231,41 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
219
231
|
*/
|
220
232
|
cancel = new EventEmitter();
|
221
233
|
/**
|
222
|
-
* Fires when the file list is about to be cleared.
|
234
|
+
* Fires when the file list is about to be cleared.
|
235
|
+
* Prevent this event to keep the files in the list.
|
223
236
|
*/
|
224
237
|
clear = new EventEmitter();
|
225
238
|
/**
|
226
|
-
* Fires when all active uploads
|
239
|
+
* Fires when all active uploads complete successfully or with errors.
|
227
240
|
*/
|
228
241
|
complete = new EventEmitter();
|
229
242
|
/**
|
230
|
-
* Fires when an `upload` or `remove` operation
|
243
|
+
* Fires when an `upload` or `remove` operation fails.
|
231
244
|
*/
|
232
245
|
error = new EventEmitter();
|
233
246
|
/**
|
234
|
-
* Fires when the upload of a file
|
247
|
+
* Fires when the upload of a file is paused.
|
235
248
|
*/
|
236
249
|
pause = new EventEmitter();
|
237
250
|
/**
|
238
|
-
* Fires when the upload of a file
|
251
|
+
* Fires when the upload of a file is resumed.
|
239
252
|
*/
|
240
253
|
resume = new EventEmitter();
|
241
254
|
/**
|
242
|
-
* Fires when an `upload` or `remove` operation
|
255
|
+
* Fires when an `upload` or `remove` operation completes successfully.
|
243
256
|
*/
|
244
257
|
success = new EventEmitter();
|
245
258
|
/**
|
246
|
-
* Fires when one or more files are about to be uploaded.
|
259
|
+
* Fires when one or more files are about to be uploaded.
|
260
|
+
* Prevent this event to stop the files from uploading and being added to the file list.
|
247
261
|
*/
|
248
262
|
upload = new EventEmitter();
|
249
263
|
/**
|
250
|
-
* Fires when one or more files are
|
264
|
+
* Fires when one or more files are uploading.
|
251
265
|
*/
|
252
266
|
uploadProgress = new EventEmitter();
|
253
267
|
/**
|
254
|
-
* Fires when the
|
268
|
+
* Fires when the component value changes after a successful `upload`, `remove`, or `clear` operation.
|
255
269
|
*/
|
256
270
|
valueChange = new EventEmitter();
|
257
271
|
get dir() {
|
@@ -390,45 +404,48 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
390
404
|
}
|
391
405
|
/**
|
392
406
|
* Pauses the upload process of a file that is currently uploading.
|
393
|
-
*
|
407
|
+
* This method requires the `chunkable` option of the Upload to be enabled.
|
394
408
|
*
|
395
|
-
* @param uid
|
409
|
+
* @param uid The `uid` of the file that will be paused.
|
396
410
|
*/
|
397
411
|
pauseFileByUid(uid) {
|
398
412
|
this.uploadService.pauseFile(uid);
|
399
413
|
}
|
400
414
|
/**
|
401
|
-
* Resumes the upload process for a file that
|
402
|
-
*
|
415
|
+
* Resumes the upload process for a file that was previously paused.
|
416
|
+
* This method requires the `chunkable` option of the Upload to be enabled.
|
403
417
|
*
|
404
|
-
* @param uid
|
418
|
+
* @param uid The `uid` of the file that will be resumed.
|
405
419
|
*/
|
406
420
|
resumeFileByUid(uid) {
|
407
421
|
this.uploadService.resumeFile(uid);
|
408
422
|
}
|
409
423
|
/**
|
410
|
-
*
|
411
|
-
*
|
424
|
+
* Removes a file or a batch of files.
|
425
|
+
*
|
426
|
+
* @param uid The `uid` of the file or a batch of files that will be removed.
|
412
427
|
*/
|
413
428
|
removeFilesByUid(uid) {
|
414
429
|
this.uploadService.removeFiles(uid);
|
415
430
|
}
|
416
431
|
/**
|
417
|
-
*
|
418
|
-
*
|
432
|
+
* Retries the upload of a file or batch of files that failed to upload.
|
433
|
+
*
|
434
|
+
* @param uid The `uid` of the file or a batch of files to be retried.
|
419
435
|
*/
|
420
436
|
retryUploadByUid(uid) {
|
421
437
|
this.uploadService.retryFiles(uid);
|
422
438
|
}
|
423
439
|
/**
|
424
440
|
* Cancels the upload of a file or a batch of files.
|
425
|
-
*
|
441
|
+
*
|
442
|
+
* @param uid The `uid` of the file or a batch of files that will be canceled.
|
426
443
|
*/
|
427
444
|
cancelUploadByUid(uid) {
|
428
445
|
this.uploadService.cancelFiles(uid);
|
429
446
|
}
|
430
447
|
/**
|
431
|
-
* Uploads the currently selected files
|
448
|
+
* Uploads the currently selected files that pass the set restrictions.
|
432
449
|
*/
|
433
450
|
uploadFiles() {
|
434
451
|
if (this.fileList.filesToUpload.length) {
|
@@ -436,7 +453,7 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
436
453
|
}
|
437
454
|
}
|
438
455
|
/**
|
439
|
-
*
|
456
|
+
* Clears all files from the UI without sending requests to the remove handler.
|
440
457
|
*/
|
441
458
|
clearFiles() {
|
442
459
|
this.uploadService.clearFiles();
|
@@ -626,7 +643,7 @@ export class UploadComponent extends UploadFileSelectBase {
|
|
626
643
|
[disabled]="disabled"
|
627
644
|
>
|
628
645
|
<div class="k-upload-button-wrap">
|
629
|
-
<button
|
646
|
+
<button
|
630
647
|
kendoButton
|
631
648
|
#fileSelectButton
|
632
649
|
class="k-upload-button"
|
@@ -759,7 +776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
759
776
|
[disabled]="disabled"
|
760
777
|
>
|
761
778
|
<div class="k-upload-button-wrap">
|
762
|
-
<button
|
779
|
+
<button
|
763
780
|
kendoButton
|
764
781
|
#fileSelectButton
|
765
782
|
class="k-upload-button"
|
package/events/cancel-event.d.ts
CHANGED
@@ -5,33 +5,24 @@
|
|
5
5
|
import { FileInfo } from '../types';
|
6
6
|
/**
|
7
7
|
* Arguments for the `cancel` event. The `cancel` event fires when
|
8
|
-
*
|
8
|
+
* you cancel the upload of a file or batch of files.
|
9
9
|
*
|
10
|
-
* ```
|
11
|
-
*
|
12
|
-
* selector: 'my-upload',
|
10
|
+
* ```typescript
|
11
|
+
* @Component({
|
13
12
|
* template: `
|
14
|
-
* <
|
15
|
-
* <kendo-upload
|
16
|
-
* [saveUrl]="uploadSaveUrl"
|
17
|
-
* [removeUrl]="uploadRemoveUrl"
|
18
|
-
* (cancel)="cancelEventHandler($event)">
|
19
|
-
* </kendo-upload>
|
13
|
+
* <kendo-upload (cancel)="cancelEventHandler($event)"> </kendo-upload>
|
20
14
|
* `
|
21
15
|
* })
|
22
16
|
* export class UploadComponent {
|
23
|
-
*
|
24
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
25
|
-
*
|
26
|
-
* cancelEventHandler(e: CancelEvent) {
|
17
|
+
* public cancelEventHandler(e: CancelEvent) {
|
27
18
|
* console.log('Canceling file upload', e.files);
|
28
19
|
* }
|
29
|
-
*
|
20
|
+
* }
|
30
21
|
* ```
|
31
22
|
*/
|
32
23
|
export declare class CancelEvent {
|
33
24
|
/**
|
34
|
-
* The
|
25
|
+
* The files that you canceled during the upload process.
|
35
26
|
*/
|
36
27
|
files: Array<FileInfo>;
|
37
28
|
/**
|
package/events/clear-event.d.ts
CHANGED
@@ -5,28 +5,21 @@
|
|
5
5
|
import { PreventableEvent } from './preventable-event';
|
6
6
|
/**
|
7
7
|
* Arguments for the `clear` event. The `clear` event fires when
|
8
|
-
* the **Clear** button is clicked
|
8
|
+
* the **Clear** button is clicked and selected files are about to be cleared.
|
9
9
|
*
|
10
|
-
* ```
|
11
|
-
*
|
12
|
-
* selector: 'my-upload',
|
10
|
+
* ```typescript
|
11
|
+
* @Component({
|
13
12
|
* template: `
|
14
13
|
* <kendo-upload
|
15
|
-
* [autoUpload]="false"
|
16
|
-
* [saveUrl]="uploadSaveUrl"
|
17
|
-
* [removeUrl]="uploadRemoveUrl"
|
18
14
|
* (clear)="clearEventHandler($event)">
|
19
15
|
* </kendo-upload>
|
20
16
|
* `
|
21
17
|
* })
|
22
18
|
* export class UploadComponent {
|
23
|
-
*
|
24
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
25
|
-
*
|
26
|
-
* clearEventHandler(e: ClearEvent) {
|
19
|
+
* public clearEventHandler(e: ClearEvent) {
|
27
20
|
* console.log('Clearing the file upload');
|
28
21
|
* }
|
29
|
-
*
|
22
|
+
* }
|
30
23
|
* ```
|
31
24
|
*/
|
32
25
|
export declare class ClearEvent extends PreventableEvent {
|
package/events/error-event.d.ts
CHANGED
@@ -8,38 +8,32 @@ import { FileInfo, OperationType } from '../types';
|
|
8
8
|
* Arguments for the `error` event. The `error` event fires when
|
9
9
|
* an `upload` or `remove` operation fails.
|
10
10
|
*
|
11
|
-
* ```
|
12
|
-
*
|
13
|
-
* selector: 'my-upload',
|
11
|
+
* ```typescript
|
12
|
+
* @Component({
|
14
13
|
* template: `
|
15
14
|
* <kendo-upload
|
16
|
-
* [saveUrl]="uploadSaveUrl"
|
17
|
-
* [removeUrl]="uploadRemoveUrl"
|
18
15
|
* (error)="errorEventHandler($event)">
|
19
16
|
* </kendo-upload>
|
20
17
|
* `
|
21
18
|
* })
|
22
19
|
* export class UploadComponent {
|
23
|
-
*
|
24
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
25
|
-
*
|
26
|
-
* errorEventHandler(e: ErrorEvent) {
|
20
|
+
* public errorEventHandler(e: ErrorEvent) {
|
27
21
|
* console.log('An error occurred');
|
28
22
|
* }
|
29
|
-
*
|
23
|
+
* }
|
30
24
|
* ```
|
31
25
|
*/
|
32
26
|
export declare class ErrorEvent {
|
33
27
|
/**
|
34
|
-
* The
|
28
|
+
* The array of files that failed to be uploaded or removed.
|
35
29
|
*/
|
36
30
|
files: Array<FileInfo>;
|
37
31
|
/**
|
38
|
-
* The operation type (`upload` or `remove`).
|
32
|
+
* The operation type that failed (`upload` or `remove`).
|
39
33
|
*/
|
40
34
|
operation: OperationType;
|
41
35
|
/**
|
42
|
-
* The response
|
36
|
+
* The HTTP response returned by the server containing error details.
|
43
37
|
*/
|
44
38
|
response: HttpResponse<any>;
|
45
39
|
/**
|
package/events/pause-event.d.ts
CHANGED
@@ -4,35 +4,28 @@
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
5
|
import { FileInfo } from '../types';
|
6
6
|
/**
|
7
|
-
* Arguments for the `pause` event. The `pause` event fires when
|
8
|
-
*
|
7
|
+
* Arguments for the `pause` event. The `pause` event fires when
|
8
|
+
* you pause a file that is currently uploading.
|
9
9
|
*
|
10
|
-
* ```
|
10
|
+
* ```typescript
|
11
11
|
* @Component({
|
12
|
-
* selector: 'my-upload',
|
13
12
|
* template: `
|
14
13
|
* <kendo-upload
|
15
14
|
* [chunkable]="true"
|
16
|
-
* [saveUrl]="uploadSaveUrl"
|
17
|
-
* [removeUrl]="uploadRemoveUrl"
|
18
15
|
* (pause)="pauseEventHandler($event)">
|
19
16
|
* </kendo-upload>
|
20
17
|
* `
|
21
18
|
* })
|
22
19
|
* export class UploadComponent {
|
23
|
-
*
|
24
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
25
|
-
*
|
26
|
-
* pauseEventHandler(ev: PauseEvent) {
|
20
|
+
* public pauseEventHandler(ev: PauseEvent) {
|
27
21
|
* console.log('File paused');
|
28
22
|
* }
|
29
23
|
* }
|
30
24
|
* ```
|
31
|
-
*
|
32
25
|
*/
|
33
26
|
export declare class PauseEvent {
|
34
27
|
/**
|
35
|
-
* The file that
|
28
|
+
* The file that you paused during the upload process.
|
36
29
|
*/
|
37
30
|
file: FileInfo;
|
38
31
|
/**
|
package/events/remove-event.d.ts
CHANGED
@@ -6,25 +6,19 @@ import { HttpHeaders } from '@angular/common/http';
|
|
6
6
|
import { PreventableEvent } from './preventable-event';
|
7
7
|
import { FileInfo } from '../types';
|
8
8
|
/**
|
9
|
-
* Arguments for the `remove` event. The `remove` event fires when an uploaded
|
10
|
-
* or selected file
|
9
|
+
* Arguments for the `remove` event. The `remove` event fires when you are about to remove an uploaded
|
10
|
+
* or selected file. You can cancel this event to prevent removal.
|
11
11
|
*
|
12
|
-
* ```
|
12
|
+
* ```typescript
|
13
13
|
* @Component({
|
14
|
-
* selector: 'my-upload',
|
15
14
|
* template: `
|
16
15
|
* <kendo-upload
|
17
|
-
* [saveUrl]="uploadSaveUrl"
|
18
|
-
* [removeUrl]="uploadRemoveUrl"
|
19
16
|
* (remove)="removeEventHandler($event)">
|
20
17
|
* </kendo-upload>
|
21
18
|
* `
|
22
19
|
* })
|
23
20
|
* export class UploadComponent {
|
24
|
-
*
|
25
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
26
|
-
*
|
27
|
-
* removeEventHandler(e: RemoveEvent) {
|
21
|
+
* public removeEventHandler(e: RemoveEvent) {
|
28
22
|
* console.log('Removing a file');
|
29
23
|
* }
|
30
24
|
* }
|
@@ -32,15 +26,17 @@ import { FileInfo } from '../types';
|
|
32
26
|
*/
|
33
27
|
export declare class RemoveEvent extends PreventableEvent {
|
34
28
|
/**
|
35
|
-
* An optional object that
|
29
|
+
* An optional object that you send to the `remove` handler as key/value pairs.
|
30
|
+
*
|
36
31
|
*/
|
37
32
|
data: Object;
|
38
33
|
/**
|
39
|
-
* The
|
34
|
+
* The files that you will remove from the server.
|
40
35
|
*/
|
41
36
|
files: Array<FileInfo>;
|
42
37
|
/**
|
43
38
|
* The headers of the request.
|
39
|
+
* You can use this to add custom headers to the remove request.
|
44
40
|
*/
|
45
41
|
headers: HttpHeaders;
|
46
42
|
/**
|
package/events/resume-event.d.ts
CHANGED
@@ -4,35 +4,28 @@
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
5
5
|
import { FileInfo } from '../types';
|
6
6
|
/**
|
7
|
-
* Arguments for the `resume` event. The `resume` event fires when
|
8
|
-
*
|
7
|
+
* Arguments for the `resume` event. The `resume` event fires when
|
8
|
+
* you resume a previously paused file upload.
|
9
9
|
*
|
10
|
-
* ```
|
10
|
+
* ```typescript
|
11
11
|
* @Component({
|
12
|
-
* selector: 'my-upload',
|
13
12
|
* template: `
|
14
13
|
* <kendo-upload
|
15
14
|
* [chunkable]="true"
|
16
|
-
* [saveUrl]="uploadSaveUrl"
|
17
|
-
* [removeUrl]="uploadRemoveUrl"
|
18
15
|
* (resume)="resumeEventHandler($event)">
|
19
16
|
* </kendo-upload>
|
20
17
|
* `
|
21
18
|
* })
|
22
19
|
* export class UploadComponent {
|
23
|
-
*
|
24
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
25
|
-
*
|
26
|
-
* resumeEventHandler(ev: ResumeEvent) {
|
20
|
+
* public resumeEventHandler(ev: ResumeEvent) {
|
27
21
|
* console.log('File resumed');
|
28
22
|
* }
|
29
23
|
* }
|
30
24
|
* ```
|
31
|
-
*
|
32
25
|
*/
|
33
26
|
export declare class ResumeEvent {
|
34
27
|
/**
|
35
|
-
* The file that
|
28
|
+
* The file that you resumed during the upload process.
|
36
29
|
*/
|
37
30
|
file: FileInfo;
|
38
31
|
/**
|
package/events/select-event.d.ts
CHANGED
@@ -5,25 +5,19 @@
|
|
5
5
|
import { PreventableEvent } from './preventable-event';
|
6
6
|
import { FileInfo } from '../types';
|
7
7
|
/**
|
8
|
-
* Arguments for the `select` event. The `select` event fires when
|
9
|
-
*
|
8
|
+
* Arguments for the `select` event. The `select` event fires when
|
9
|
+
* a file or multiple files are selected for upload. The event can be canceled to prevent selection.
|
10
10
|
*
|
11
|
-
* ```
|
11
|
+
* ```typescript
|
12
12
|
* @Component({
|
13
|
-
* selector: 'my-upload',
|
14
13
|
* template: `
|
15
14
|
* <kendo-upload
|
16
|
-
* [saveUrl]="uploadSaveUrl"
|
17
|
-
* [removeUrl]="uploadRemoveUrl"
|
18
15
|
* (select)="selectEventHandler($event)">
|
19
16
|
* </kendo-upload>
|
20
17
|
* `
|
21
18
|
* })
|
22
19
|
* export class UploadComponent {
|
23
|
-
*
|
24
|
-
* uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
|
25
|
-
*
|
26
|
-
* selectEventHandler(e: SelectEvent) {
|
20
|
+
* public selectEventHandler(e: SelectEvent) {
|
27
21
|
* console.log('File selected');
|
28
22
|
* }
|
29
23
|
* }
|
@@ -31,7 +25,7 @@ import { FileInfo } from '../types';
|
|
31
25
|
*/
|
32
26
|
export declare class SelectEvent extends PreventableEvent {
|
33
27
|
/**
|
34
|
-
* The
|
28
|
+
* The files that are selected for upload.
|
35
29
|
*/
|
36
30
|
files: Array<FileInfo>;
|
37
31
|
/**
|