@progress/kendo-angular-upload 21.4.1 → 22.0.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/common/base.d.ts +1 -1
  2. package/dropzone-base.d.ts +1 -1
  3. package/fesm2022/progress-kendo-angular-upload.mjs +89 -89
  4. package/localization/messages.d.ts +1 -1
  5. package/package.json +13 -21
  6. package/rendering/file-list-item-base.d.ts +1 -1
  7. package/schematics/ngAdd/index.js +3 -3
  8. package/esm2022/common/action-buttons-layout.mjs +0 -5
  9. package/esm2022/common/base.mjs +0 -280
  10. package/esm2022/common/fileselect-settings.mjs +0 -5
  11. package/esm2022/common/util.mjs +0 -253
  12. package/esm2022/common/validation-util.mjs +0 -60
  13. package/esm2022/directives.mjs +0 -89
  14. package/esm2022/dropzone-base.mjs +0 -69
  15. package/esm2022/dropzone-external.directive.mjs +0 -111
  16. package/esm2022/dropzone-internal.directive.mjs +0 -109
  17. package/esm2022/dropzone.component.mjs +0 -169
  18. package/esm2022/dropzone.service.mjs +0 -37
  19. package/esm2022/events/cancel-event.mjs +0 -35
  20. package/esm2022/events/clear-event.mjs +0 -29
  21. package/esm2022/events/error-event.mjs +0 -48
  22. package/esm2022/events/pause-event.mjs +0 -38
  23. package/esm2022/events/preventable-event.mjs +0 -25
  24. package/esm2022/events/remove-event.mjs +0 -49
  25. package/esm2022/events/resume-event.mjs +0 -38
  26. package/esm2022/events/select-event.mjs +0 -37
  27. package/esm2022/events/success-event.mjs +0 -49
  28. package/esm2022/events/upload-event.mjs +0 -49
  29. package/esm2022/events/upload-progress-event.mjs +0 -41
  30. package/esm2022/events.mjs +0 -14
  31. package/esm2022/file-select.directive.mjs +0 -136
  32. package/esm2022/fileselect.component.mjs +0 -452
  33. package/esm2022/fileselect.module.mjs +0 -41
  34. package/esm2022/index.mjs +0 -31
  35. package/esm2022/localization/custom-messages.component.mjs +0 -70
  36. package/esm2022/localization/localized-messages.directive.mjs +0 -43
  37. package/esm2022/localization/messages.mjs +0 -185
  38. package/esm2022/navigation.service.mjs +0 -151
  39. package/esm2022/package-metadata.mjs +0 -16
  40. package/esm2022/progress-kendo-angular-upload.mjs +0 -8
  41. package/esm2022/rendering/file-list-item-action-button.component.mjs +0 -230
  42. package/esm2022/rendering/file-list-item-base.mjs +0 -52
  43. package/esm2022/rendering/file-list-item.mjs +0 -115
  44. package/esm2022/rendering/file-list-multiple-items.component.mjs +0 -201
  45. package/esm2022/rendering/file-list-single-item.component.mjs +0 -181
  46. package/esm2022/rendering/file-list.component.mjs +0 -189
  47. package/esm2022/rendering/upload-action-buttons.component.mjs +0 -126
  48. package/esm2022/rendering/upload-status-total.component.mjs +0 -97
  49. package/esm2022/templates/file-info-template.directive.mjs +0 -39
  50. package/esm2022/templates/file-template.directive.mjs +0 -39
  51. package/esm2022/types/async-settings.mjs +0 -5
  52. package/esm2022/types/chunk-info.mjs +0 -5
  53. package/esm2022/types/chunk-map.mjs +0 -35
  54. package/esm2022/types/chunk-metadata.mjs +0 -5
  55. package/esm2022/types/chunk-settings.mjs +0 -5
  56. package/esm2022/types/direction.mjs +0 -5
  57. package/esm2022/types/file-groups.mjs +0 -60
  58. package/esm2022/types/file-info.mjs +0 -5
  59. package/esm2022/types/file-map.mjs +0 -144
  60. package/esm2022/types/file-restrictions.mjs +0 -5
  61. package/esm2022/types/file-state.mjs +0 -34
  62. package/esm2022/types/operation-type.mjs +0 -5
  63. package/esm2022/types.mjs +0 -6
  64. package/esm2022/upload.component.mjs +0 -901
  65. package/esm2022/upload.module.mjs +0 -43
  66. package/esm2022/upload.service.mjs +0 -431
  67. package/esm2022/uploads.module.mjs +0 -66
@@ -1,901 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /* eslint-disable @typescript-eslint/no-unused-vars */
6
- /* eslint-disable @typescript-eslint/no-explicit-any */
7
- import { HttpHeaders } from '@angular/common/http';
8
- import { Component, ElementRef, EventEmitter, forwardRef, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, isDevMode, ChangeDetectorRef, Injector } from '@angular/core';
9
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
10
- import { isDocumentAvailable, KendoInput, Keys, isChanged } from '@progress/kendo-angular-common';
11
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
12
- import { fromEvent, merge } from 'rxjs';
13
- import { filter } from 'rxjs/operators';
14
- import { validatePackage } from '@progress/kendo-licensing';
15
- import { packageMetadata } from './package-metadata';
16
- import { FileState } from './types';
17
- import { NavigationService } from './navigation.service';
18
- import { UploadService } from './upload.service';
19
- import { hasClasses, IGNORE_TARGET_CLASSES, isFocusable, UPLOAD_CLASSES, validateInitialFileInfo } from './common/util';
20
- import { DropZoneService } from './dropzone.service';
21
- import { UploadFileSelectBase } from './common/base';
22
- import { UploadActionButtonsComponent } from './rendering/upload-action-buttons.component';
23
- import { FileListComponent } from './rendering/file-list.component';
24
- import { UploadStatusTotalComponent } from './rendering/upload-status-total.component';
25
- import { FileSelectDirective } from './file-select.directive';
26
- import { ButtonComponent } from '@progress/kendo-angular-buttons';
27
- import { DropZoneInternalDirective } from './dropzone-internal.directive';
28
- import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
29
- import * as i0 from "@angular/core";
30
- import * as i1 from "./upload.service";
31
- import * as i2 from "@progress/kendo-angular-l10n";
32
- import * as i3 from "./navigation.service";
33
- import * as i4 from "./dropzone.service";
34
- /**
35
- * @hidden
36
- */
37
- export const UPLOAD_VALUE_ACCESSOR = {
38
- multi: true,
39
- provide: NG_VALUE_ACCESSOR,
40
- useExisting: forwardRef(() => UploadComponent)
41
- };
42
- let idx = 0;
43
- /**
44
- * Represents the [Kendo UI Upload component for Angular]({% slug overview_upload %}).
45
- *
46
- * @example
47
- * ```html
48
- * <kendo-upload
49
- * [saveUrl]="uploadSaveUrl"
50
- * [removeUrl]="uploadRemoveUrl">
51
- * </kendo-upload>
52
- * ```
53
- *
54
- * @remarks
55
- * Supported children components are: {@link CustomMessagesComponent}
56
- */
57
- export class UploadComponent extends UploadFileSelectBase {
58
- uploadService;
59
- localization;
60
- navigation;
61
- dropZoneService;
62
- zone;
63
- renderer;
64
- cdr;
65
- injector;
66
- /**
67
- * Specifies whether selected files upload automatically
68
- * ([see example]({% slug fileprocessing_upload %}#toc-automatic-upload-of-files)).
69
- * Set `autoUpload` to `false` to change this behavior.
70
- *
71
- * @default true
72
- */
73
- set autoUpload(autoUpload) {
74
- this.uploadService.async.autoUpload = autoUpload;
75
- }
76
- get autoUpload() {
77
- return this.uploadService.async.autoUpload;
78
- }
79
- /**
80
- * Specifies whether all files in the selection upload in a single request
81
- * ([see example]({% slug fileprocessing_upload %}#toc-upload-of-batches-of-files)).
82
- * Files selected one after the other upload in separate requests.
83
- *
84
- * @default false
85
- */
86
- set batch(batch) {
87
- this.uploadService.async.batch = batch;
88
- }
89
- get batch() {
90
- return this.uploadService.async.batch;
91
- }
92
- /**
93
- * Specifies whether credentials (cookies, headers) are sent for cross-site requests
94
- * ([see example]({% slug credentials_upload %}#toc-attaching-credentials-to-requests)).
95
- * Set `withCredentials` has no effect on same-site requests.
96
- * Use the `saveHeaders` or `removeHeaders` property to add credentials to the request.
97
- * You can also use the [`upload`]({% slug api_upload_uploadevent %}) event.
98
- *
99
- * @default true
100
- */
101
- set withCredentials(withCredentials) {
102
- this.uploadService.async.withCredentials = withCredentials;
103
- }
104
- get withCredentials() {
105
- return this.uploadService.async.withCredentials;
106
- }
107
- /**
108
- * Specifies the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which contains the files submitted to `saveUrl`.
109
- *
110
- */
111
- set saveField(saveField) {
112
- this.uploadService.async.saveField = saveField;
113
- }
114
- get saveField() {
115
- return this.uploadService.async.saveField;
116
- }
117
- /**
118
- * Specifies the [`HttpHeaders`](https://angular.io/api/common/http/HttpHeaders) attached to each upload request.
119
- */
120
- set saveHeaders(saveHeaders) {
121
- this.uploadService.async.saveHeaders = saveHeaders;
122
- }
123
- get saveHeaders() {
124
- return this.uploadService.async.saveHeaders;
125
- }
126
- /**
127
- * Specifies the [`RequestMethod`](https://angular.io/api/http/RequestMethod) of the upload request.
128
- *
129
- */
130
- set saveMethod(saveMethod) {
131
- this.uploadService.async.saveMethod = saveMethod;
132
- }
133
- get saveMethod() {
134
- return this.uploadService.async.saveMethod;
135
- }
136
- /**
137
- * Specifies the URL of the endpoint for the upload request.
138
- * The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key uses the name from the `saveField` property.
139
- * This key contains the list of files to be uploaded.
140
- */
141
- set saveUrl(saveUrl) {
142
- this.uploadService.async.saveUrl = saveUrl;
143
- }
144
- get saveUrl() {
145
- return this.uploadService.async.saveUrl;
146
- }
147
- /**
148
- * Specifies the expected [`response type`](https://angular.io/api/common/http/HttpRequest#responseType) of the server.
149
- * The response type determines how the response is parsed.
150
- *
151
- * @default 'json'
152
- */
153
- set responseType(responseType) {
154
- this.uploadService.async.responseType = responseType;
155
- }
156
- get responseType() {
157
- return this.uploadService.async.responseType;
158
- }
159
- /**
160
- * Specifies the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which contains the list of file names submitted to `removeUrl`.
161
- *
162
- */
163
- set removeField(removeField) { this.uploadService.async.removeField = removeField; }
164
- get removeField() { return this.uploadService.async.removeField; }
165
- /**
166
- * Specifies the [`HttpHeaders`](https://angular.io/api/common/http/HttpHeaders) attached to each `remove` request.
167
- */
168
- set removeHeaders(removeHeaders) {
169
- this.uploadService.async.removeHeaders = removeHeaders;
170
- }
171
- get removeHeaders() {
172
- return this.uploadService.async.removeHeaders;
173
- }
174
- /**
175
- * Specifies the [`RequestMethod`](https://angular.io/api/http/RequestMethod) of the `remove` request.
176
- *
177
- */
178
- set removeMethod(removeMethod) {
179
- this.uploadService.async.removeMethod = removeMethod;
180
- }
181
- get removeMethod() {
182
- return this.uploadService.async.removeMethod;
183
- }
184
- /**
185
- * Specifies the URL of the endpoint for the `remove` request.
186
- * The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key uses the name from the `removeField` property.
187
- * This key contains the list of file names to be removed.
188
- */
189
- set removeUrl(removeUrl) {
190
- this.uploadService.async.removeUrl = removeUrl;
191
- }
192
- get removeUrl() {
193
- return this.uploadService.async.removeUrl;
194
- }
195
- /**
196
- * Specifies whether the chunk functionality of the Upload is enabled.
197
- *
198
- * @default false
199
- */
200
- chunkable = false;
201
- /**
202
- * Specifies whether selected files upload simultaneously or one by one.
203
- *
204
- * @default true
205
- */
206
- set concurrent(concurrent) {
207
- this.uploadService.async.concurrent = concurrent;
208
- }
209
- get concurrent() {
210
- return this.uploadService.async.concurrent;
211
- }
212
- /**
213
- * Specifies whether the file list is visible.
214
- *
215
- * @default true
216
- */
217
- showFileList = true;
218
- /**
219
- * @hidden
220
- */
221
- set tabIndex(tabIndex) {
222
- this.tabindex = tabIndex;
223
- }
224
- get tabIndex() {
225
- return this.tabindex;
226
- }
227
- /**
228
- * Specifies the layout of the action buttons.
229
- *
230
- * @default 'end'
231
- */
232
- actionsLayout = 'end';
233
- fileSelectInput;
234
- /**
235
- * Fires when the upload is canceled while in progress.
236
- */
237
- cancel = new EventEmitter();
238
- /**
239
- * Fires when the file list is about to be cleared.
240
- * Prevent this event to keep the files in the list.
241
- */
242
- clear = new EventEmitter();
243
- /**
244
- * Fires when all active uploads complete successfully or with errors.
245
- */
246
- complete = new EventEmitter();
247
- /**
248
- * Fires when an `upload` or `remove` operation fails.
249
- */
250
- error = new EventEmitter();
251
- /**
252
- * Fires when the upload of a file is paused.
253
- */
254
- pause = new EventEmitter();
255
- /**
256
- * Fires when the upload of a file is resumed.
257
- */
258
- resume = new EventEmitter();
259
- /**
260
- * Fires when an `upload` or `remove` operation completes successfully.
261
- */
262
- success = new EventEmitter();
263
- /**
264
- * Fires when one or more files are about to be uploaded.
265
- * Prevent this event to stop the files from uploading and being added to the file list.
266
- */
267
- upload = new EventEmitter();
268
- /**
269
- * Fires when one or more files are uploading.
270
- */
271
- uploadProgress = new EventEmitter();
272
- /**
273
- * Fires when the component value changes after a successful `upload`, `remove`, or `clear` operation.
274
- */
275
- valueChange = new EventEmitter();
276
- get dir() {
277
- return this.direction;
278
- }
279
- direction;
280
- wrapper;
281
- fileListId;
282
- documentClick;
283
- blurSubscription;
284
- wrapperFocusSubscription;
285
- selectButtonFocusSubscription;
286
- localizationChangeSubscription;
287
- subs;
288
- constructor(uploadService, localization, navigation, dropZoneService, zone, renderer, cdr, wrapper, injector) {
289
- super(uploadService, navigation, cdr, injector, zone);
290
- this.uploadService = uploadService;
291
- this.localization = localization;
292
- this.navigation = navigation;
293
- this.dropZoneService = dropZoneService;
294
- this.zone = zone;
295
- this.renderer = renderer;
296
- this.cdr = cdr;
297
- this.injector = injector;
298
- validatePackage(packageMetadata);
299
- this.fileList = this.uploadService.files;
300
- this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
301
- this.direction = rtl ? 'rtl' : 'ltr';
302
- });
303
- this.direction = localization.rtl ? 'rtl' : 'ltr';
304
- this.navigation.computeKeys();
305
- this.wrapper = wrapper.nativeElement;
306
- this.subscribeBlur();
307
- this.subscribeFocus();
308
- this.attachEventHandlers();
309
- }
310
- ngOnInit() {
311
- this.verifySettings();
312
- const { buttonId, fileListId } = this.getIds();
313
- this.focusableId = buttonId;
314
- this.fileListId = fileListId;
315
- this.uploadService.setChunkSettings(this.chunkable);
316
- if (this.zoneId) {
317
- this.dropZoneService.addComponent(this, this.zoneId);
318
- }
319
- this.zone.runOutsideAngular(() => {
320
- this.subs.add(this.renderer.listen(this.wrapper, 'keydown', event => this.handleKeydown(event)));
321
- });
322
- }
323
- ngOnChanges(changes) {
324
- if (isChanged("chunkable", changes)) {
325
- const newChunkable = changes.chunkable.currentValue;
326
- if (typeof newChunkable === 'boolean') {
327
- this.uploadService.async.chunk = newChunkable;
328
- }
329
- if (typeof newChunkable === "object" && newChunkable !== null) {
330
- this.uploadService.async.chunk = true;
331
- this.uploadService.chunk = Object.assign({}, this.uploadService.chunk, newChunkable);
332
- }
333
- }
334
- }
335
- ngOnDestroy() {
336
- this.fileList.clear();
337
- if (this.zoneId) {
338
- this.dropZoneService.clearComponent(this, this.zoneId);
339
- }
340
- if (this.blurSubscription) {
341
- this.blurSubscription.unsubscribe();
342
- }
343
- if (this.wrapperFocusSubscription) {
344
- this.wrapperFocusSubscription.unsubscribe();
345
- }
346
- if (this.selectButtonFocusSubscription) {
347
- this.selectButtonFocusSubscription.unsubscribe();
348
- }
349
- if (this.localizationChangeSubscription) {
350
- this.localizationChangeSubscription.unsubscribe();
351
- }
352
- if (this.subs) {
353
- this.subs.unsubscribe();
354
- }
355
- }
356
- /**
357
- * @hidden
358
- */
359
- writeValue(newValue) {
360
- super.writeValue(newValue, validateInitialFileInfo, 'addInitialFiles');
361
- }
362
- /**
363
- * @hidden
364
- */
365
- get showActionButtons() {
366
- let areVisible = false;
367
- if (!this.autoUpload) {
368
- const hasFilesToUpload = this.fileList.filesToUpload.length > 0;
369
- const uploadingFiles = this.fileList.hasFileWithState([FileState.Uploading]);
370
- if (this.concurrent && hasFilesToUpload) {
371
- areVisible = true;
372
- }
373
- if (!this.concurrent && hasFilesToUpload && !uploadingFiles) {
374
- areVisible = true;
375
- }
376
- }
377
- this.navigation.actionButtonsVisible = areVisible;
378
- return areVisible;
379
- }
380
- /**
381
- * @hidden
382
- */
383
- get showTotalStatus() {
384
- const states = [
385
- FileState.Uploaded,
386
- FileState.Uploading,
387
- FileState.Failed,
388
- FileState.Paused
389
- ];
390
- if (this.fileList.hasFileWithState(states)) {
391
- return true;
392
- }
393
- return false;
394
- }
395
- /**
396
- * @hidden
397
- */
398
- textFor(key) {
399
- return this.localization.get(key);
400
- }
401
- /**
402
- * @hidden
403
- */
404
- getIds() {
405
- const id = ++idx;
406
- const buttonId = `k-upload-button-${id}`;
407
- const fileListId = `k-upload-file-list-${id}`;
408
- return { buttonId, fileListId };
409
- }
410
- /**
411
- * Pauses the upload process of a file that is currently uploading.
412
- * This method requires the `chunkable` option of the Upload to be enabled.
413
- *
414
- * @param uid The `uid` of the file that will be paused.
415
- */
416
- pauseFileByUid(uid) {
417
- this.uploadService.pauseFile(uid);
418
- }
419
- /**
420
- * Resumes the upload process for a file that was previously paused.
421
- * This method requires the `chunkable` option of the Upload to be enabled.
422
- *
423
- * @param uid The `uid` of the file that will be resumed.
424
- */
425
- resumeFileByUid(uid) {
426
- this.uploadService.resumeFile(uid);
427
- }
428
- /**
429
- * Removes a file or a batch of files.
430
- *
431
- * @param uid The `uid` of the file or a batch of files that will be removed.
432
- */
433
- removeFilesByUid(uid) {
434
- this.uploadService.removeFiles(uid);
435
- }
436
- /**
437
- * Retries the upload of a file or batch of files that failed to upload.
438
- *
439
- * @param uid The `uid` of the file or a batch of files to be retried.
440
- */
441
- retryUploadByUid(uid) {
442
- this.uploadService.retryFiles(uid);
443
- }
444
- /**
445
- * Cancels the upload of a file or a batch of files.
446
- *
447
- * @param uid The `uid` of the file or a batch of files that will be canceled.
448
- */
449
- cancelUploadByUid(uid) {
450
- this.uploadService.cancelFiles(uid);
451
- }
452
- /**
453
- * Uploads the currently selected files that pass the set restrictions.
454
- */
455
- uploadFiles() {
456
- if (this.fileList.filesToUpload.length) {
457
- this.uploadService.uploadFiles();
458
- }
459
- }
460
- /**
461
- * Clears all files from the UI without sending requests to the remove handler.
462
- */
463
- clearFiles() {
464
- this.uploadService.clearFiles();
465
- }
466
- /**
467
- * @hidden
468
- * Used by the external dropzone to add files to the Upload
469
- */
470
- addFiles(files) {
471
- this.uploadService.addFiles(files);
472
- }
473
- /**
474
- * @hidden
475
- * Used to determine if the component is empty.
476
- */
477
- isEmpty() {
478
- return false;
479
- }
480
- verifySettings() {
481
- if (isDevMode()) {
482
- if (this.batch && this.chunkable !== false) {
483
- throw new Error('The file chunking functionality requires the batch setting to be disabled.');
484
- }
485
- }
486
- }
487
- subscribeBlur() {
488
- if (!isDocumentAvailable()) {
489
- return;
490
- }
491
- this.zone.runOutsideAngular(() => {
492
- this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
493
- return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
494
- }));
495
- this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
496
- if (this.navigation.focused) {
497
- this.zone.run(() => {
498
- this.navigation.focused = false;
499
- this.onTouchedCallback();
500
- this.onBlur.emit();
501
- });
502
- }
503
- });
504
- });
505
- }
506
- handleKeydown(event) {
507
- if (this.disabled) {
508
- return;
509
- }
510
- if (event.target === this.fileSelectButton.nativeElement && (event.code === Keys.Enter || event.code === Keys.Space)) {
511
- event.preventDefault();
512
- this.fileSelectInput.nativeElement.click();
513
- return;
514
- }
515
- if (hasClasses(event.target, UPLOAD_CLASSES) ||
516
- (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
517
- this.navigation.process(event);
518
- }
519
- }
520
- subscribeFocus() {
521
- this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(() => {
522
- this.onFocus.emit();
523
- });
524
- this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(() => {
525
- this.fileSelectButton.nativeElement.focus();
526
- });
527
- }
528
- attachEventHandlers() {
529
- this.subs = this.uploadService.cancelEvent.subscribe((args) => {
530
- this.cancel.emit(args);
531
- });
532
- this.subs.add(this.uploadService.changeEvent.subscribe((files) => {
533
- this.onChangeCallback(files);
534
- this.valueChange.emit(files);
535
- }));
536
- this.subs.add(this.uploadService.clearEvent.subscribe((args) => {
537
- this.clear.emit(args);
538
- }));
539
- this.subs.add(this.uploadService.completeEvent.subscribe(() => {
540
- this.complete.emit();
541
- }));
542
- this.subs.add(this.uploadService.errorEvent.subscribe((args) => {
543
- this.error.emit(args);
544
- }));
545
- this.subs.add(this.uploadService.pauseEvent.subscribe((args) => {
546
- this.pause.emit(args);
547
- }));
548
- this.subs.add(this.uploadService.removeEvent.subscribe((args) => {
549
- this.remove.emit(args);
550
- }));
551
- this.subs.add(this.uploadService.resumeEvent.subscribe((args) => {
552
- this.resume.emit(args);
553
- }));
554
- this.subs.add(this.uploadService.selectEvent.subscribe((args) => {
555
- this.select.emit(args);
556
- }));
557
- this.subs.add(this.uploadService.successEvent.subscribe((args) => {
558
- this.success.emit(args);
559
- }));
560
- this.subs.add(this.uploadService.uploadEvent.subscribe((args) => {
561
- this.upload.emit(args);
562
- }));
563
- this.subs.add(this.uploadService.uploadProgressEvent.subscribe((args) => {
564
- this.uploadProgress.emit(args);
565
- }));
566
- }
567
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: UploadComponent, deps: [{ token: i1.UploadService }, { token: i2.LocalizationService }, { token: i3.NavigationService }, { token: i4.DropZoneService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
568
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: UploadComponent, isStandalone: true, selector: "kendo-upload", inputs: { autoUpload: "autoUpload", batch: "batch", withCredentials: "withCredentials", saveField: "saveField", saveHeaders: "saveHeaders", saveMethod: "saveMethod", saveUrl: "saveUrl", responseType: "responseType", removeField: "removeField", removeHeaders: "removeHeaders", removeMethod: "removeMethod", removeUrl: "removeUrl", chunkable: "chunkable", concurrent: "concurrent", showFileList: "showFileList", tabIndex: "tabIndex", actionsLayout: "actionsLayout" }, outputs: { cancel: "cancel", clear: "clear", complete: "complete", error: "error", pause: "pause", resume: "resume", success: "success", upload: "upload", uploadProgress: "uploadProgress", valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.dir" } }, providers: [
569
- LocalizationService,
570
- NavigationService,
571
- UploadService,
572
- DropZoneService,
573
- UPLOAD_VALUE_ACCESSOR,
574
- {
575
- provide: L10N_PREFIX,
576
- useValue: 'kendo.upload'
577
- },
578
- {
579
- provide: KendoInput,
580
- useExisting: forwardRef(() => UploadComponent)
581
- }
582
- ], viewQueries: [{ propertyName: "fileSelectInput", first: true, predicate: ["fileSelectInput"], descendants: true, static: true }], exportAs: ["kendoUpload"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
583
- <ng-container kendoUploadLocalizedMessages
584
- i18n-cancel="kendo.upload.cancel|The text for the Cancel button"
585
- cancel="Cancel"
586
-
587
- i18n-clearSelectedFiles="kendo.upload.clearSelectedFiles|The text for the Clear button"
588
- clearSelectedFiles="Clear"
589
-
590
- i18n-dropFilesHere="kendo.upload.dropFilesHere|The drop zone hint"
591
- dropFilesHere="Drop files here to upload"
592
-
593
- i18n-filesBatchStatus="kendo.upload.filesBatchStatus|The status message for a batch of files"
594
- filesBatchStatus="files"
595
-
596
- i18n-filesBatchStatusFailed="kendo.upload.filesBatchStatusFailed|The status message for a batch of files after failed upload"
597
- filesBatchStatusFailed="files failed to upload."
598
-
599
- i18n-filesBatchStatusUploaded="kendo.upload.filesBatchStatusUploaded|The status message for a batch of files after successful upload"
600
- filesBatchStatusUploaded="files successfully uploaded."
601
-
602
- i18n-fileStatusFailed="kendo.upload.fileStatusFailed|The file status message after failed upload"
603
- fileStatusFailed="File failed to upload."
604
-
605
- i18n-fileStatusUploaded="kendo.upload.fileStatusUploaded|The file status message after successful upload"
606
- fileStatusUploaded="File successfully uploaded."
607
-
608
- i18n-headerStatusPaused="kendo.upload.headerStatusPaused|The header status message when the file upload is paused"
609
- headerStatusPaused="Paused"
610
-
611
- i18n-headerStatusUploaded="kendo.upload.headerStatusUploaded|The header status message after file upload completion"
612
- headerStatusUploaded="Done"
613
-
614
- i18n-headerStatusUploading="kendo.upload.headerStatusUploading|The header status message during file upload"
615
- headerStatusUploading="Uploading..."
616
-
617
- i18n-invalidFileExtension="kendo.upload.invalidFileExtension|The text for the invalid allowed extensions restriction message"
618
- invalidFileExtension="File type not allowed."
619
-
620
- i18n-invalidMaxFileSize="kendo.upload.invalidMaxFileSize|The text for the invalid max file size restriction message"
621
- invalidMaxFileSize="File size too large."
622
-
623
- i18n-invalidMinFileSize="kendo.upload.invalidMinFileSize|The text for the invalid min file size restriction message"
624
- invalidMinFileSize="File size too small."
625
-
626
- i18n-pause="kendo.upload.pause|The text for the Pause button"
627
- pause="Pause"
628
-
629
- i18n-remove="kendo.upload.remove|The text for the Remove button"
630
- remove="Remove"
631
-
632
- i18n-resume="kendo.upload.resume|The text for the Resume button"
633
- resume="Resume"
634
-
635
- i18n-retry="kendo.upload.retry|The text for the Retry button"
636
- retry="Retry"
637
-
638
- i18n-select="kendo.upload.select|The text for the Select button"
639
- select="Select files..."
640
-
641
- i18n-uploadSelectedFiles="kendo.upload.uploadSelectedFiles|The text for the Upload files button"
642
- uploadSelectedFiles="Upload"
643
- >
644
- </ng-container>
645
- <div kendoUploadInternalDropZone
646
- [restrictions]="restrictions"
647
- [multiple]="multiple"
648
- [disabled]="disabled"
649
- >
650
- <div class="k-upload-button-wrap">
651
- <button
652
- kendoButton
653
- #fileSelectButton
654
- class="k-upload-button"
655
- type="button"
656
- (click)="fileSelectInput.click()"
657
- (focus)="onFileSelectButtonFocus()"
658
- [id]="focusableId"
659
- [attr.aria-label]="textFor('select')"
660
- [attr.tabindex]="tabindex"
661
- [attr.aria-expanded]="hasFileList"
662
- [attr.aria-controls]="hasFileList ? fileListId : undefined"
663
- >
664
- {{textFor('select')}}
665
- </button>
666
- <input kendoFileSelect #fileSelectInput
667
- [dir]="direction"
668
- [accept]="accept"
669
- [restrictions]="restrictions"
670
- [multiple]="multiple"
671
- [disabled]="disabled"
672
- [required]="isControlRequired" />
673
- </div>
674
- @if (showTotalStatus) {
675
- <kendo-upload-status-total
676
- class="k-upload-status"
677
- [fileList]="fileList">
678
- </kendo-upload-status-total>
679
- }
680
- <div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
681
- </div>
682
- @if (hasFileList) {
683
- <ul kendo-upload-file-list
684
- class="k-upload-files k-reset"
685
- [disabled]="disabled"
686
- [fileList]="fileList.files"
687
- [fileTemplate]="fileTemplate"
688
- [fileInfoTemplate]="fileInfoTemplate"
689
- [id]="fileListId">
690
- </ul>
691
- }
692
- @if (showActionButtons) {
693
- <kendo-upload-action-buttons
694
- [disabled]="disabled"
695
- [actionsLayout]="actionsLayout">
696
- </kendo-upload-action-buttons>
697
- }
698
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { kind: "directive", type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept", "required"] }, { kind: "component", type: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { kind: "component", type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { kind: "component", type: UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }] });
699
- }
700
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: UploadComponent, decorators: [{
701
- type: Component,
702
- args: [{
703
- exportAs: 'kendoUpload',
704
- providers: [
705
- LocalizationService,
706
- NavigationService,
707
- UploadService,
708
- DropZoneService,
709
- UPLOAD_VALUE_ACCESSOR,
710
- {
711
- provide: L10N_PREFIX,
712
- useValue: 'kendo.upload'
713
- },
714
- {
715
- provide: KendoInput,
716
- useExisting: forwardRef(() => UploadComponent)
717
- }
718
- ],
719
- selector: 'kendo-upload',
720
- template: `
721
- <ng-container kendoUploadLocalizedMessages
722
- i18n-cancel="kendo.upload.cancel|The text for the Cancel button"
723
- cancel="Cancel"
724
-
725
- i18n-clearSelectedFiles="kendo.upload.clearSelectedFiles|The text for the Clear button"
726
- clearSelectedFiles="Clear"
727
-
728
- i18n-dropFilesHere="kendo.upload.dropFilesHere|The drop zone hint"
729
- dropFilesHere="Drop files here to upload"
730
-
731
- i18n-filesBatchStatus="kendo.upload.filesBatchStatus|The status message for a batch of files"
732
- filesBatchStatus="files"
733
-
734
- i18n-filesBatchStatusFailed="kendo.upload.filesBatchStatusFailed|The status message for a batch of files after failed upload"
735
- filesBatchStatusFailed="files failed to upload."
736
-
737
- i18n-filesBatchStatusUploaded="kendo.upload.filesBatchStatusUploaded|The status message for a batch of files after successful upload"
738
- filesBatchStatusUploaded="files successfully uploaded."
739
-
740
- i18n-fileStatusFailed="kendo.upload.fileStatusFailed|The file status message after failed upload"
741
- fileStatusFailed="File failed to upload."
742
-
743
- i18n-fileStatusUploaded="kendo.upload.fileStatusUploaded|The file status message after successful upload"
744
- fileStatusUploaded="File successfully uploaded."
745
-
746
- i18n-headerStatusPaused="kendo.upload.headerStatusPaused|The header status message when the file upload is paused"
747
- headerStatusPaused="Paused"
748
-
749
- i18n-headerStatusUploaded="kendo.upload.headerStatusUploaded|The header status message after file upload completion"
750
- headerStatusUploaded="Done"
751
-
752
- i18n-headerStatusUploading="kendo.upload.headerStatusUploading|The header status message during file upload"
753
- headerStatusUploading="Uploading..."
754
-
755
- i18n-invalidFileExtension="kendo.upload.invalidFileExtension|The text for the invalid allowed extensions restriction message"
756
- invalidFileExtension="File type not allowed."
757
-
758
- i18n-invalidMaxFileSize="kendo.upload.invalidMaxFileSize|The text for the invalid max file size restriction message"
759
- invalidMaxFileSize="File size too large."
760
-
761
- i18n-invalidMinFileSize="kendo.upload.invalidMinFileSize|The text for the invalid min file size restriction message"
762
- invalidMinFileSize="File size too small."
763
-
764
- i18n-pause="kendo.upload.pause|The text for the Pause button"
765
- pause="Pause"
766
-
767
- i18n-remove="kendo.upload.remove|The text for the Remove button"
768
- remove="Remove"
769
-
770
- i18n-resume="kendo.upload.resume|The text for the Resume button"
771
- resume="Resume"
772
-
773
- i18n-retry="kendo.upload.retry|The text for the Retry button"
774
- retry="Retry"
775
-
776
- i18n-select="kendo.upload.select|The text for the Select button"
777
- select="Select files..."
778
-
779
- i18n-uploadSelectedFiles="kendo.upload.uploadSelectedFiles|The text for the Upload files button"
780
- uploadSelectedFiles="Upload"
781
- >
782
- </ng-container>
783
- <div kendoUploadInternalDropZone
784
- [restrictions]="restrictions"
785
- [multiple]="multiple"
786
- [disabled]="disabled"
787
- >
788
- <div class="k-upload-button-wrap">
789
- <button
790
- kendoButton
791
- #fileSelectButton
792
- class="k-upload-button"
793
- type="button"
794
- (click)="fileSelectInput.click()"
795
- (focus)="onFileSelectButtonFocus()"
796
- [id]="focusableId"
797
- [attr.aria-label]="textFor('select')"
798
- [attr.tabindex]="tabindex"
799
- [attr.aria-expanded]="hasFileList"
800
- [attr.aria-controls]="hasFileList ? fileListId : undefined"
801
- >
802
- {{textFor('select')}}
803
- </button>
804
- <input kendoFileSelect #fileSelectInput
805
- [dir]="direction"
806
- [accept]="accept"
807
- [restrictions]="restrictions"
808
- [multiple]="multiple"
809
- [disabled]="disabled"
810
- [required]="isControlRequired" />
811
- </div>
812
- @if (showTotalStatus) {
813
- <kendo-upload-status-total
814
- class="k-upload-status"
815
- [fileList]="fileList">
816
- </kendo-upload-status-total>
817
- }
818
- <div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
819
- </div>
820
- @if (hasFileList) {
821
- <ul kendo-upload-file-list
822
- class="k-upload-files k-reset"
823
- [disabled]="disabled"
824
- [fileList]="fileList.files"
825
- [fileTemplate]="fileTemplate"
826
- [fileInfoTemplate]="fileInfoTemplate"
827
- [id]="fileListId">
828
- </ul>
829
- }
830
- @if (showActionButtons) {
831
- <kendo-upload-action-buttons
832
- [disabled]="disabled"
833
- [actionsLayout]="actionsLayout">
834
- </kendo-upload-action-buttons>
835
- }
836
- `,
837
- standalone: true,
838
- imports: [LocalizedMessagesDirective, DropZoneInternalDirective, ButtonComponent, FileSelectDirective, UploadStatusTotalComponent, FileListComponent, UploadActionButtonsComponent]
839
- }]
840
- }], ctorParameters: () => [{ type: i1.UploadService }, { type: i2.LocalizationService }, { type: i3.NavigationService }, { type: i4.DropZoneService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Injector }], propDecorators: { autoUpload: [{
841
- type: Input
842
- }], batch: [{
843
- type: Input
844
- }], withCredentials: [{
845
- type: Input
846
- }], saveField: [{
847
- type: Input
848
- }], saveHeaders: [{
849
- type: Input
850
- }], saveMethod: [{
851
- type: Input
852
- }], saveUrl: [{
853
- type: Input
854
- }], responseType: [{
855
- type: Input
856
- }], removeField: [{
857
- type: Input
858
- }], removeHeaders: [{
859
- type: Input
860
- }], removeMethod: [{
861
- type: Input
862
- }], removeUrl: [{
863
- type: Input
864
- }], chunkable: [{
865
- type: Input
866
- }], concurrent: [{
867
- type: Input
868
- }], showFileList: [{
869
- type: Input
870
- }], tabIndex: [{
871
- type: Input,
872
- args: ['tabIndex']
873
- }], actionsLayout: [{
874
- type: Input
875
- }], fileSelectInput: [{
876
- type: ViewChild,
877
- args: ['fileSelectInput', { static: true }]
878
- }], cancel: [{
879
- type: Output
880
- }], clear: [{
881
- type: Output
882
- }], complete: [{
883
- type: Output
884
- }], error: [{
885
- type: Output
886
- }], pause: [{
887
- type: Output
888
- }], resume: [{
889
- type: Output
890
- }], success: [{
891
- type: Output
892
- }], upload: [{
893
- type: Output
894
- }], uploadProgress: [{
895
- type: Output
896
- }], valueChange: [{
897
- type: Output
898
- }], dir: [{
899
- type: HostBinding,
900
- args: ['attr.dir']
901
- }] } });