@progress/kendo-angular-upload 9.0.4 → 11.0.0-develop.101

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 (136) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +4 -4
  3. package/README.md +1 -1
  4. package/common/action-buttons-layout.d.ts +1 -1
  5. package/common/util.d.ts +1 -1
  6. package/common/validation-util.d.ts +1 -1
  7. package/dropzone-base.d.ts +2 -2
  8. package/dropzone-external.directive.d.ts +1 -1
  9. package/dropzone-internal.directive.d.ts +1 -1
  10. package/dropzone.component.d.ts +11 -3
  11. package/dropzone.service.d.ts +1 -1
  12. package/{esm2015/types/chunk-metadata.js → esm2020/common/action-buttons-layout.mjs} +1 -1
  13. package/{esm2015/common/util.js → esm2020/common/util.mjs} +13 -10
  14. package/{esm2015/common/validation-util.js → esm2020/common/validation-util.mjs} +2 -2
  15. package/{esm2015/dropzone-base.js → esm2020/dropzone-base.mjs} +5 -5
  16. package/{esm2015/dropzone-external.directive.js → esm2020/dropzone-external.directive.mjs} +5 -5
  17. package/{esm2015/dropzone-internal.directive.js → esm2020/dropzone-internal.directive.mjs} +11 -7
  18. package/esm2020/dropzone.component.mjs +134 -0
  19. package/{esm2015/dropzone.service.js → esm2020/dropzone.service.mjs} +5 -5
  20. package/{esm2015/events/cancel-event.js → esm2020/events/cancel-event.mjs} +1 -1
  21. package/{esm2015/events/clear-event.js → esm2020/events/clear-event.mjs} +1 -1
  22. package/{esm2015/events/error-event.js → esm2020/events/error-event.mjs} +1 -1
  23. package/{esm2015/events/pause-event.js → esm2020/events/pause-event.mjs} +1 -1
  24. package/{esm2015/events/preventable-event.js → esm2020/events/preventable-event.mjs} +1 -1
  25. package/{esm2015/events/remove-event.js → esm2020/events/remove-event.mjs} +1 -1
  26. package/{esm2015/events/resume-event.js → esm2020/events/resume-event.mjs} +1 -1
  27. package/{esm2015/events/select-event.js → esm2020/events/select-event.mjs} +1 -1
  28. package/{esm2015/events/success-event.js → esm2020/events/success-event.mjs} +1 -1
  29. package/{esm2015/events/upload-event.js → esm2020/events/upload-event.mjs} +1 -1
  30. package/{esm2015/events/upload-progress-event.js → esm2020/events/upload-progress-event.mjs} +1 -1
  31. package/{esm2015/events.js → esm2020/events.mjs} +1 -1
  32. package/{esm2015/file-select.directive.js → esm2020/file-select.directive.mjs} +7 -5
  33. package/{esm2015/fileselect.component.js → esm2020/fileselect.component.mjs} +100 -60
  34. package/{esm2015/fileselect.module.js → esm2020/fileselect.module.mjs} +7 -6
  35. package/{esm2015/main.js → esm2020/index.mjs} +2 -1
  36. package/{esm2015/localization/custom-messages.component.js → esm2020/localization/custom-messages.component.mjs} +5 -4
  37. package/{esm2015/localization/localized-messages.directive.js → esm2020/localization/localized-messages.directive.mjs} +5 -4
  38. package/{esm2015/localization/messages.js → esm2020/localization/messages.mjs} +4 -4
  39. package/{esm2015/navigation.service.js → esm2020/navigation.service.mjs} +56 -40
  40. package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
  41. package/{esm2015/kendo-angular-upload.js → esm2020/progress-kendo-angular-upload.mjs} +2 -2
  42. package/esm2020/rendering/file-list-item-action-button.component.mjs +262 -0
  43. package/{esm2015/rendering/file-list-item-base.js → esm2020/rendering/file-list-item-base.mjs} +5 -4
  44. package/{esm2015/rendering/file-list-item.js → esm2020/rendering/file-list-item.mjs} +7 -5
  45. package/esm2020/rendering/file-list-multiple-items.component.mjs +186 -0
  46. package/esm2020/rendering/file-list-single-item.component.mjs +185 -0
  47. package/{esm2015/rendering/file-list.component.js → esm2020/rendering/file-list.component.mjs} +16 -11
  48. package/{esm2015/rendering/upload-action-buttons.component.js → esm2020/rendering/upload-action-buttons.component.mjs} +8 -5
  49. package/{esm2015/rendering/upload-status-total.component.js → esm2020/rendering/upload-status-total.component.mjs} +51 -22
  50. package/{esm2015/shared.module.js → esm2020/shared.module.mjs} +15 -9
  51. package/{esm2015/templates/file-info-template.directive.js → esm2020/templates/file-info-template.directive.mjs} +5 -5
  52. package/{esm2015/templates/file-template.directive.js → esm2020/templates/file-template.directive.mjs} +5 -5
  53. package/{esm2015/templates/template-context.directive.js → esm2020/templates/template-context.directive.mjs} +5 -5
  54. package/{esm2015/common/action-buttons-layout.js → esm2020/types/async-settings.mjs} +1 -1
  55. package/{esm2015/types/chunk-info.js → esm2020/types/chunk-info.mjs} +1 -1
  56. package/{esm2015/types/chunk-map.js → esm2020/types/chunk-map.mjs} +1 -1
  57. package/{esm2015/types/async-settings.js → esm2020/types/chunk-metadata.mjs} +1 -1
  58. package/esm2020/types/chunk-settings.mjs +5 -0
  59. package/esm2020/types/direction.mjs +5 -0
  60. package/{esm2015/types/file-groups.js → esm2020/types/file-groups.mjs} +19 -1
  61. package/esm2020/types/file-info.mjs +5 -0
  62. package/{esm2015/types/file-map.js → esm2020/types/file-map.mjs} +26 -26
  63. package/esm2020/types/file-restrictions.mjs +5 -0
  64. package/{esm2015/types/file-state.js → esm2020/types/file-state.mjs} +1 -1
  65. package/esm2020/types/operation-type.mjs +5 -0
  66. package/{esm2015/types.js → esm2020/types.mjs} +1 -1
  67. package/{esm2015/upload.component.js → esm2020/upload.component.mjs} +125 -80
  68. package/{esm2015/upload.module.js → esm2020/upload.module.mjs} +8 -7
  69. package/{esm2015/upload.service.js → esm2020/upload.service.mjs} +35 -35
  70. package/{esm2015/uploads.module.js → esm2020/uploads.module.mjs} +5 -5
  71. package/events/cancel-event.d.ts +1 -1
  72. package/events/clear-event.d.ts +1 -1
  73. package/events/error-event.d.ts +1 -1
  74. package/events/pause-event.d.ts +1 -1
  75. package/events/preventable-event.d.ts +1 -1
  76. package/events/remove-event.d.ts +1 -1
  77. package/events/resume-event.d.ts +1 -1
  78. package/events/select-event.d.ts +1 -1
  79. package/events/success-event.d.ts +1 -1
  80. package/events/upload-event.d.ts +1 -1
  81. package/events/upload-progress-event.d.ts +3 -3
  82. package/events.d.ts +1 -1
  83. package/fesm2015/progress-kendo-angular-upload.mjs +4997 -0
  84. package/{fesm2015/kendo-angular-upload.js → fesm2020/progress-kendo-angular-upload.mjs} +829 -592
  85. package/file-select.directive.d.ts +1 -1
  86. package/fileselect.component.d.ts +13 -8
  87. package/fileselect.module.d.ts +8 -7
  88. package/{main.d.ts → index.d.ts} +2 -1
  89. package/localization/custom-messages.component.d.ts +1 -1
  90. package/localization/localized-messages.directive.d.ts +1 -1
  91. package/localization/messages.d.ts +1 -1
  92. package/navigation.service.d.ts +4 -3
  93. package/package-metadata.d.ts +1 -1
  94. package/package.json +30 -55
  95. package/{kendo-angular-upload.d.ts → progress-kendo-angular-upload.d.ts} +2 -2
  96. package/rendering/file-list-item-action-button.component.d.ts +8 -2
  97. package/rendering/file-list-item-base.d.ts +2 -2
  98. package/rendering/file-list-item.d.ts +1 -1
  99. package/rendering/file-list-multiple-items.component.d.ts +3 -1
  100. package/rendering/file-list-single-item.component.d.ts +3 -1
  101. package/rendering/file-list.component.d.ts +1 -1
  102. package/rendering/upload-action-buttons.component.d.ts +1 -1
  103. package/rendering/upload-status-total.component.d.ts +8 -1
  104. package/schematics/ngAdd/index.js +8 -6
  105. package/shared.module.d.ts +5 -2
  106. package/templates/file-info-template.directive.d.ts +1 -1
  107. package/templates/file-template.directive.d.ts +1 -1
  108. package/templates/template-context.directive.d.ts +1 -1
  109. package/types/async-settings.d.ts +1 -1
  110. package/types/chunk-info.d.ts +1 -1
  111. package/types/chunk-map.d.ts +1 -1
  112. package/types/chunk-metadata.d.ts +1 -1
  113. package/types/chunk-settings.d.ts +1 -1
  114. package/types/direction.d.ts +1 -1
  115. package/types/file-groups.d.ts +22 -1
  116. package/types/file-info.d.ts +1 -1
  117. package/types/file-map.d.ts +1 -1
  118. package/types/file-restrictions.d.ts +1 -1
  119. package/types/file-state.d.ts +1 -1
  120. package/types/operation-type.d.ts +1 -1
  121. package/types.d.ts +1 -1
  122. package/upload.component.d.ts +15 -10
  123. package/upload.module.d.ts +8 -7
  124. package/upload.service.d.ts +1 -1
  125. package/uploads.module.d.ts +1 -1
  126. package/bundles/kendo-angular-upload.umd.js +0 -5
  127. package/esm2015/dropzone.component.js +0 -112
  128. package/esm2015/rendering/file-list-item-action-button.component.js +0 -226
  129. package/esm2015/rendering/file-list-multiple-items.component.js +0 -172
  130. package/esm2015/rendering/file-list-single-item.component.js +0 -154
  131. package/esm2015/types/chunk-settings.js +0 -5
  132. package/esm2015/types/direction.js +0 -5
  133. package/esm2015/types/file-info.js +0 -5
  134. package/esm2015/types/file-restrictions.js +0 -5
  135. package/esm2015/types/operation-type.js +0 -5
  136. package/schematics/ngAdd/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { FileState } from '../types';
@@ -11,7 +11,7 @@ export class FileMap {
11
11
  this._files = {};
12
12
  }
13
13
  add(file) {
14
- let uid = file.uid;
14
+ const uid = file.uid;
15
15
  if (this.has(uid)) {
16
16
  if (file.validationErrors && file.validationErrors.length > 0) {
17
17
  this._files[uid].unshift(file);
@@ -31,10 +31,10 @@ export class FileMap {
31
31
  }
32
32
  }
33
33
  clear() {
34
- let allFiles = this._files;
35
- for (let uid in allFiles) {
34
+ const allFiles = this._files;
35
+ for (const uid in allFiles) {
36
36
  if (allFiles.hasOwnProperty(uid)) {
37
- for (let file of allFiles[uid]) {
37
+ for (const file of allFiles[uid]) {
38
38
  if (file.httpSubscription) {
39
39
  file.httpSubscription.unsubscribe();
40
40
  }
@@ -51,7 +51,7 @@ export class FileMap {
51
51
  return this._files[uid];
52
52
  }
53
53
  setFilesState(files, state) {
54
- for (let file of files) {
54
+ for (const file of files) {
55
55
  this.setFilesStateByUid(file.uid, state);
56
56
  }
57
57
  }
@@ -64,9 +64,9 @@ export class FileMap {
64
64
  return Object.getOwnPropertyNames(this._files).length;
65
65
  }
66
66
  get files() {
67
- let initial = this._files;
68
- let transformed = [];
69
- for (let uid in initial) {
67
+ const initial = this._files;
68
+ const transformed = [];
69
+ for (const uid in initial) {
70
70
  if (initial.hasOwnProperty(uid)) {
71
71
  transformed.push(initial[uid]);
72
72
  }
@@ -74,11 +74,11 @@ export class FileMap {
74
74
  return transformed;
75
75
  }
76
76
  get filesFlat() {
77
- let initial = this._files;
78
- let transformed = [];
79
- for (let uid in initial) {
77
+ const initial = this._files;
78
+ const transformed = [];
79
+ for (const uid in initial) {
80
80
  if (initial.hasOwnProperty(uid)) {
81
- let current = initial[uid];
81
+ const current = initial[uid];
82
82
  current.forEach((file) => {
83
83
  transformed.push(file);
84
84
  });
@@ -87,13 +87,13 @@ export class FileMap {
87
87
  return transformed;
88
88
  }
89
89
  get filesToUpload() {
90
- let files = this._files;
91
- let notUploaded = [];
92
- for (let uid in files) {
90
+ const files = this._files;
91
+ const notUploaded = [];
92
+ for (const uid in files) {
93
93
  if (files.hasOwnProperty(uid)) {
94
- let currentFiles = files[uid];
94
+ const currentFiles = files[uid];
95
95
  let currentFilesValid = true;
96
- for (let file of currentFiles) {
96
+ for (const file of currentFiles) {
97
97
  if (file.state !== FileState.Selected || (file.validationErrors && file.validationErrors.length > 0)) {
98
98
  currentFilesValid = false;
99
99
  }
@@ -106,12 +106,12 @@ export class FileMap {
106
106
  return notUploaded;
107
107
  }
108
108
  get firstFileToUpload() {
109
- let files = this._files;
110
- for (let uid in files) {
109
+ const files = this._files;
110
+ for (const uid in files) {
111
111
  if (files.hasOwnProperty(uid)) {
112
- let currentFiles = files[uid];
112
+ const currentFiles = files[uid];
113
113
  let currentFilesValid = true;
114
- for (let file of currentFiles) {
114
+ for (const file of currentFiles) {
115
115
  if (file.state !== FileState.Selected || (file.validationErrors && file.validationErrors.length > 0)) {
116
116
  currentFilesValid = false;
117
117
  }
@@ -127,11 +127,11 @@ export class FileMap {
127
127
  return this.filesFlat.filter(file => file.state === state);
128
128
  }
129
129
  hasFileWithState(fileStates) {
130
- let files = this._files;
131
- for (let uid in files) {
130
+ const files = this._files;
131
+ for (const uid in files) {
132
132
  if (files.hasOwnProperty(uid)) {
133
- let currentFiles = files[uid];
134
- for (let file of currentFiles) {
133
+ const currentFiles = files[uid];
134
+ for (const file of currentFiles) {
135
135
  if (fileStates.indexOf(file.state) >= 0) {
136
136
  return true;
137
137
  }
@@ -0,0 +1,5 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ export {};
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  /**
@@ -0,0 +1,5 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ export {};
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  export { FileState } from './types/file-state';
@@ -1,8 +1,11 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { Component, ContentChild, EventEmitter, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, isDevMode } from '@angular/core';
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, ContentChild, ElementRef, EventEmitter, forwardRef, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, isDevMode, ChangeDetectorRef } from '@angular/core';
6
9
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
10
  import { guid, isDocumentAvailable, KendoInput, Keys, isChanged } from '@progress/kendo-angular-common';
8
11
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
@@ -22,13 +25,14 @@ import * as i1 from "./upload.service";
22
25
  import * as i2 from "@progress/kendo-angular-l10n";
23
26
  import * as i3 from "./navigation.service";
24
27
  import * as i4 from "./dropzone.service";
25
- import * as i5 from "./rendering/upload-status-total.component";
26
- import * as i6 from "./rendering/file-list.component";
27
- import * as i7 from "./rendering/upload-action-buttons.component";
28
- import * as i8 from "./localization/localized-messages.directive";
29
- import * as i9 from "./dropzone-internal.directive";
30
- import * as i10 from "./file-select.directive";
31
- import * as i11 from "@angular/common";
28
+ import * as i5 from "@progress/kendo-angular-buttons";
29
+ import * as i6 from "./rendering/upload-status-total.component";
30
+ import * as i7 from "./rendering/file-list.component";
31
+ import * as i8 from "./rendering/upload-action-buttons.component";
32
+ import * as i9 from "./localization/localized-messages.directive";
33
+ import * as i10 from "./dropzone-internal.directive";
34
+ import * as i11 from "./file-select.directive";
35
+ import * as i12 from "@angular/common";
32
36
  /**
33
37
  * @hidden
34
38
  */
@@ -37,16 +41,17 @@ export const UPLOAD_VALUE_ACCESSOR = {
37
41
  provide: NG_VALUE_ACCESSOR,
38
42
  useExisting: forwardRef(() => UploadComponent)
39
43
  };
44
+ let idx = 0;
40
45
  /**
41
46
  * Represents the [Kendo UI Upload component for Angular]({% slug overview_upload %}).
42
47
  */
43
48
  export class UploadComponent {
44
- constructor(uploadService, localization, navigation, dropZoneService, _ngZone, renderer, cdr, wrapper) {
49
+ constructor(uploadService, localization, navigation, dropZoneService, zone, renderer, cdr, wrapper) {
45
50
  this.uploadService = uploadService;
46
51
  this.localization = localization;
47
52
  this.navigation = navigation;
48
53
  this.dropZoneService = dropZoneService;
49
- this._ngZone = _ngZone;
54
+ this.zone = zone;
50
55
  this.renderer = renderer;
51
56
  this.cdr = cdr;
52
57
  /**
@@ -311,7 +316,7 @@ export class UploadComponent {
311
316
  * Sets the restrictions for selected files ([see example]({% slug api_upload_filerestrictions %})).
312
317
  */
313
318
  set restrictions(restrictions) {
314
- let parsedRestrictions = Object.assign({}, this._restrictions, restrictions);
319
+ const parsedRestrictions = Object.assign({}, this._restrictions, restrictions);
315
320
  this._restrictions = parsedRestrictions;
316
321
  }
317
322
  get restrictions() {
@@ -330,6 +335,25 @@ export class UploadComponent {
330
335
  if (this.zoneId) {
331
336
  this.dropZoneService.addComponent(this, this.zoneId);
332
337
  }
338
+ const button = this.fileSelectButton.nativeElement;
339
+ const input = this.fileSelectInput.nativeElement;
340
+ this.subs.add(this.renderer.listen(input, 'mouseenter', () => {
341
+ this.renderer.addClass(button, 'k-hover');
342
+ }));
343
+ this.subs.add(this.renderer.listen(input, 'mouseleave', () => {
344
+ this.renderer.removeClass(button, 'k-hover');
345
+ }));
346
+ this.zone.runOutsideAngular(() => {
347
+ this.subs.add(this.renderer.listen(this.wrapper, 'keydown', event => this.handleKeydown(event)));
348
+ });
349
+ }
350
+ ngAfterViewInit() {
351
+ const { buttonId, inputId } = this.getIds();
352
+ const button = this.fileSelectButton.nativeElement;
353
+ const input = this.fileSelectInput.nativeElement;
354
+ this.renderer.setAttribute(button, 'id', buttonId);
355
+ this.renderer.setAttribute(button, 'aria-controls', inputId);
356
+ this.renderer.setAttribute(input, 'id', inputId);
333
357
  }
334
358
  ngOnChanges(changes) {
335
359
  if (isChanged("chunkable", changes)) {
@@ -361,24 +385,6 @@ export class UploadComponent {
361
385
  this.subs.unsubscribe();
362
386
  }
363
387
  }
364
- /**
365
- * @hidden
366
- */
367
- handleKeydown(event) {
368
- if (this.disabled) {
369
- return;
370
- }
371
- if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space) &&
372
- event.target === this.fileSelectButton.nativeElement) {
373
- event.preventDefault();
374
- this.fileSelect.nativeElement.click();
375
- return;
376
- }
377
- if (hasClasses(event.target, UPLOAD_CLASSES) ||
378
- (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
379
- this.navigation.process(event);
380
- }
381
- }
382
388
  /**
383
389
  * @hidden
384
390
  */
@@ -477,6 +483,16 @@ export class UploadComponent {
477
483
  textFor(key) {
478
484
  return this.localization.get(key);
479
485
  }
486
+ /**
487
+ * @hidden
488
+ */
489
+ getIds() {
490
+ const id = ++idx;
491
+ const buttonId = `k-upload-button-${id}`;
492
+ const inputId = `k-upload-input-${id}`;
493
+ return { buttonId, inputId };
494
+ }
495
+ ;
480
496
  /**
481
497
  * Focuses the underlying input element.
482
498
  */
@@ -587,13 +603,13 @@ export class UploadComponent {
587
603
  if (!isDocumentAvailable()) {
588
604
  return;
589
605
  }
590
- this._ngZone.runOutsideAngular(() => {
606
+ this.zone.runOutsideAngular(() => {
591
607
  this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
592
608
  return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
593
609
  }));
594
610
  this.blurSubscription = merge(this.documentClick, this.navigation.onTab).subscribe(() => {
595
611
  if (this.navigation.focused) {
596
- this._ngZone.run(() => {
612
+ this.zone.run(() => {
597
613
  this.navigation.focused = false;
598
614
  this.onTouchedCallback();
599
615
  this.onBlur.emit();
@@ -602,6 +618,21 @@ export class UploadComponent {
602
618
  });
603
619
  });
604
620
  }
621
+ handleKeydown(event) {
622
+ if (this.disabled) {
623
+ return;
624
+ }
625
+ if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space) &&
626
+ event.target === this.fileSelectButton.nativeElement) {
627
+ event.preventDefault();
628
+ this.fileSelectInput.nativeElement.click();
629
+ return;
630
+ }
631
+ if (hasClasses(event.target, UPLOAD_CLASSES) ||
632
+ (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
633
+ this.navigation.process(event);
634
+ }
635
+ }
605
636
  subscribeFocus() {
606
637
  this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(() => {
607
638
  this.onFocus.emit();
@@ -650,8 +681,8 @@ export class UploadComponent {
650
681
  }));
651
682
  }
652
683
  }
653
- UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", 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 }], target: i0.ɵɵFactoryTarget.Component });
654
- UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UploadComponent, 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", multiple: "multiple", disabled: "disabled", showFileList: "showFileList", tabindex: "tabindex", zoneId: "zoneId", tabIndex: "tabIndex", accept: "accept", restrictions: "restrictions", focusableId: "focusableId", actionsLayout: "actionsLayout" }, outputs: { onBlur: "blur", cancel: "cancel", clear: "clear", complete: "complete", error: "error", onFocus: "focus", pause: "pause", remove: "remove", resume: "resume", select: "select", success: "success", upload: "upload", uploadProgress: "uploadProgress", valueChange: "valueChange" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "class.k-widget": "this.hostDefaultClasses", "class.k-upload": "this.hostDefaultClasses", "class.k-disabled": "this.hostDisabledClass", "attr.dir": "this.dir" } }, providers: [
684
+ UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", 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 }], target: i0.ɵɵFactoryTarget.Component });
685
+ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: UploadComponent, 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", multiple: "multiple", disabled: "disabled", showFileList: "showFileList", tabindex: "tabindex", zoneId: "zoneId", tabIndex: "tabIndex", accept: "accept", restrictions: "restrictions", focusableId: "focusableId", actionsLayout: "actionsLayout" }, outputs: { onBlur: "blur", cancel: "cancel", clear: "clear", complete: "complete", error: "error", onFocus: "focus", pause: "pause", remove: "remove", resume: "resume", select: "select", success: "success", upload: "upload", uploadProgress: "uploadProgress", valueChange: "valueChange" }, host: { properties: { "class.k-upload": "this.hostDefaultClasses", "class.k-disabled": "this.hostDisabledClass", "attr.dir": "this.dir" } }, providers: [
655
686
  LocalizationService,
656
687
  NavigationService,
657
688
  UploadService,
@@ -665,7 +696,7 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
665
696
  provide: KendoInput,
666
697
  useExisting: forwardRef(() => UploadComponent)
667
698
  }
668
- ], queries: [{ propertyName: "fileTemplate", first: true, predicate: FileTemplateDirective, descendants: true }, { propertyName: "fileInfoTemplate", first: true, predicate: FileInfoTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "fileSelect", first: true, predicate: ["fileSelect"], descendants: true, static: true }, { propertyName: "fileSelectButton", first: true, predicate: ["fileSelectButton"], descendants: true, static: true }], exportAs: ["kendoUpload"], usesOnChanges: true, ngImport: i0, template: `
699
+ ], queries: [{ propertyName: "fileTemplate", first: true, predicate: FileTemplateDirective, descendants: true }, { propertyName: "fileInfoTemplate", first: true, predicate: FileInfoTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "fileSelectInput", first: true, predicate: ["fileSelectInput"], descendants: true, static: true }, { propertyName: "fileSelectButton", first: true, predicate: ["fileSelectButton"], descendants: true, read: ElementRef, static: true }], exportAs: ["kendoUpload"], usesOnChanges: true, ngImport: i0, template: `
669
700
  <ng-container kendoUploadLocalizedMessages
670
701
  i18n-cancel="kendo.upload.cancel|The text for the Cancel button"
671
702
  cancel="Cancel"
@@ -731,25 +762,35 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
731
762
  <div kendoUploadInternalDropZone
732
763
  [restrictions]="restrictions"
733
764
  [multiple]="multiple"
734
- [disabled]="disabled">
735
- <div role="button" #fileSelectButton
736
- [id]="focusableId"
737
- [attr.aria-label]="textFor('select')"
738
- [attr.tabindex]="selectButtonTabIndex"
739
- (focus)="onFileSelectButtonFocus($event)"
740
- (blur)="onFileSelectButtonBlur($event)"
741
- class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-upload-button">
742
- <input #fileSelect kendoFileSelect
743
- [attr.accept]="accept ? accept : null"
744
- [attr.aria-hidden]="true"
745
- [dir]="direction"
746
- [restrictions]="restrictions"
747
- [multiple]="multiple"
748
- [disabled]="disabled" />
749
- <span>{{textFor('select')}}</span>
765
+ [disabled]="disabled"
766
+ >
767
+ <div class="k-upload-button-wrap">
768
+ <button
769
+ kendoButton
770
+ #fileSelectButton
771
+ class="k-upload-button"
772
+ role="button"
773
+ [id]="focusableId"
774
+ [attr.aria-label]="textFor('select')"
775
+ [attr.tabindex]="selectButtonTabIndex"
776
+ (focus)="onFileSelectButtonFocus($event)"
777
+ (blur)="onFileSelectButtonBlur($event)"
778
+ >
779
+ {{textFor('select')}}
780
+ </button>
781
+ <input
782
+ #fileSelectInput
783
+ kendoFileSelect
784
+ [attr.accept]="accept ? accept : null"
785
+ [attr.aria-hidden]="true"
786
+ [dir]="direction"
787
+ [restrictions]="restrictions"
788
+ [multiple]="multiple"
789
+ [disabled]="disabled"
790
+ />
750
791
  </div>
751
792
  <kendo-upload-status-total *ngIf="showTotalStatus"
752
- class="k-upload-status k-upload-status-total"
793
+ class="k-upload-status"
753
794
  [fileList]="fileList">
754
795
  </kendo-upload-status-total>
755
796
  <div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
@@ -766,8 +807,8 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
766
807
  [disabled]="disabled"
767
808
  [actionsLayout]="actionsLayout">
768
809
  </kendo-upload-action-buttons>
769
- `, isInline: true, components: [{ type: i5.UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: i6.FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: i7.UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: i8.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i9.DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: i10.FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
770
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadComponent, decorators: [{
810
+ `, isInline: true, components: [{ type: i5.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i6.UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: i7.FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: i8.UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: i9.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i10.DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: i11.FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
811
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadComponent, decorators: [{
771
812
  type: Component,
772
813
  args: [{
773
814
  exportAs: 'kendoUpload',
@@ -853,25 +894,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
853
894
  <div kendoUploadInternalDropZone
854
895
  [restrictions]="restrictions"
855
896
  [multiple]="multiple"
856
- [disabled]="disabled">
857
- <div role="button" #fileSelectButton
858
- [id]="focusableId"
859
- [attr.aria-label]="textFor('select')"
860
- [attr.tabindex]="selectButtonTabIndex"
861
- (focus)="onFileSelectButtonFocus($event)"
862
- (blur)="onFileSelectButtonBlur($event)"
863
- class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-upload-button">
864
- <input #fileSelect kendoFileSelect
865
- [attr.accept]="accept ? accept : null"
866
- [attr.aria-hidden]="true"
867
- [dir]="direction"
868
- [restrictions]="restrictions"
869
- [multiple]="multiple"
870
- [disabled]="disabled" />
871
- <span>{{textFor('select')}}</span>
897
+ [disabled]="disabled"
898
+ >
899
+ <div class="k-upload-button-wrap">
900
+ <button
901
+ kendoButton
902
+ #fileSelectButton
903
+ class="k-upload-button"
904
+ role="button"
905
+ [id]="focusableId"
906
+ [attr.aria-label]="textFor('select')"
907
+ [attr.tabindex]="selectButtonTabIndex"
908
+ (focus)="onFileSelectButtonFocus($event)"
909
+ (blur)="onFileSelectButtonBlur($event)"
910
+ >
911
+ {{textFor('select')}}
912
+ </button>
913
+ <input
914
+ #fileSelectInput
915
+ kendoFileSelect
916
+ [attr.accept]="accept ? accept : null"
917
+ [attr.aria-hidden]="true"
918
+ [dir]="direction"
919
+ [restrictions]="restrictions"
920
+ [multiple]="multiple"
921
+ [disabled]="disabled"
922
+ />
872
923
  </div>
873
924
  <kendo-upload-status-total *ngIf="showTotalStatus"
874
- class="k-upload-status k-upload-status-total"
925
+ class="k-upload-status"
875
926
  [fileList]="fileList">
876
927
  </kendo-upload-status-total>
877
928
  <div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
@@ -945,12 +996,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
945
996
  }], fileInfoTemplate: [{
946
997
  type: ContentChild,
947
998
  args: [FileInfoTemplateDirective, { static: false }]
948
- }], fileSelect: [{
999
+ }], fileSelectInput: [{
949
1000
  type: ViewChild,
950
- args: ['fileSelect', { static: true }]
1001
+ args: ['fileSelectInput', { static: true }]
951
1002
  }], fileSelectButton: [{
952
1003
  type: ViewChild,
953
- args: ['fileSelectButton', { static: true }]
1004
+ args: ['fileSelectButton', { static: true, read: ElementRef }]
954
1005
  }], onBlur: [{
955
1006
  type: Output,
956
1007
  args: ['blur']
@@ -982,9 +1033,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
982
1033
  }], valueChange: [{
983
1034
  type: Output
984
1035
  }], hostDefaultClasses: [{
985
- type: HostBinding,
986
- args: ['class.k-widget']
987
- }, {
988
1036
  type: HostBinding,
989
1037
  args: ['class.k-upload']
990
1038
  }], hostDisabledClass: [{
@@ -993,7 +1041,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
993
1041
  }], dir: [{
994
1042
  type: HostBinding,
995
1043
  args: ['attr.dir']
996
- }], handleKeydown: [{
997
- type: HostListener,
998
- args: ['keydown', ['$event']]
999
1044
  }] } });
@@ -1,11 +1,12 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { NgModule } from '@angular/core';
6
6
  import { UploadComponent } from './upload.component';
7
7
  import { UploadActionButtonsComponent } from './rendering/upload-action-buttons.component';
8
8
  import { UploadStatusTotalComponent } from './rendering/upload-status-total.component';
9
+ import { IconsModule } from '@progress/kendo-angular-icons';
9
10
  import { SharedModule, PUBLIC_DIRECTIVES } from './shared.module';
10
11
  import * as i0 from "@angular/core";
11
12
  import * as i1 from "./templates/file-template.directive";
@@ -23,14 +24,14 @@ const UPLOAD_DECLARATIONS = [
23
24
  */
24
25
  export class UploadModule {
25
26
  }
26
- UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27
- UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
27
+ UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
28
+ UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
28
29
  UploadActionButtonsComponent,
29
- UploadStatusTotalComponent], imports: [SharedModule], exports: [i1.FileTemplateDirective, i2.FileInfoTemplateDirective, i3.CustomMessagesComponent, i4.UploadDropZoneDirective, i5.UploadDropZoneComponent, UploadComponent,
30
+ UploadStatusTotalComponent], imports: [SharedModule, IconsModule], exports: [i1.FileTemplateDirective, i2.FileInfoTemplateDirective, i3.CustomMessagesComponent, i4.UploadDropZoneDirective, i5.UploadDropZoneComponent, UploadComponent,
30
31
  UploadActionButtonsComponent,
31
32
  UploadStatusTotalComponent] });
32
- UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, imports: [[SharedModule]] });
33
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, decorators: [{
33
+ UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, imports: [[SharedModule, IconsModule]] });
34
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, decorators: [{
34
35
  type: NgModule,
35
36
  args: [{
36
37
  declarations: [UPLOAD_DECLARATIONS],
@@ -38,6 +39,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
38
39
  PUBLIC_DIRECTIVES,
39
40
  UPLOAD_DECLARATIONS
40
41
  ],
41
- imports: [SharedModule]
42
+ imports: [SharedModule, IconsModule]
42
43
  }]
43
44
  }] });