@progress/kendo-angular-upload 8.0.2-dev.202203071504 → 9.0.0-dev.202204131914

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 (265) hide show
  1. package/bundles/kendo-angular-upload.umd.js +5 -0
  2. package/{dist/es2015/common → common}/action-buttons-layout.d.ts +0 -0
  3. package/{dist/es2015/common → common}/util.d.ts +0 -0
  4. package/{dist/es2015/common → common}/validation-util.d.ts +0 -0
  5. package/{dist/es2015/dropzone-base.d.ts → dropzone-base.d.ts} +4 -1
  6. package/{dist/es2015/dropzone-external.directive.d.ts → dropzone-external.directive.d.ts} +4 -1
  7. package/{dist/es2015/dropzone-internal.directive.d.ts → dropzone-internal.directive.d.ts} +3 -0
  8. package/{dist/es2015/dropzone.component.d.ts → dropzone.component.d.ts} +5 -2
  9. package/{dist/es2015/dropzone.service.d.ts → dropzone.service.d.ts} +3 -0
  10. package/{dist/es2015 → esm2015}/common/action-buttons-layout.js +1 -0
  11. package/{dist/es2015 → esm2015}/common/util.js +1 -7
  12. package/{dist/es2015 → esm2015}/common/validation-util.js +0 -4
  13. package/{dist/es2015 → esm2015}/dropzone-base.js +18 -16
  14. package/{dist/es2015 → esm2015}/dropzone-external.directive.js +29 -35
  15. package/{dist/es2015 → esm2015}/dropzone-internal.directive.js +25 -37
  16. package/esm2015/dropzone.component.js +112 -0
  17. package/{dist/es2015 → esm2015}/dropzone.service.js +8 -7
  18. package/{dist/es2015 → esm2015}/events/cancel-event.js +1 -0
  19. package/{dist/es2015 → esm2015}/events/clear-event.js +1 -0
  20. package/{dist/es2015 → esm2015}/events/error-event.js +1 -0
  21. package/{dist/es2015 → esm2015}/events/pause-event.js +1 -0
  22. package/{dist/es2015 → esm2015}/events/preventable-event.js +0 -0
  23. package/{dist/es2015 → esm2015}/events/remove-event.js +1 -0
  24. package/{dist/es2015 → esm2015}/events/resume-event.js +1 -0
  25. package/{dist/es2015 → esm2015}/events/select-event.js +1 -0
  26. package/{dist/es2015 → esm2015}/events/success-event.js +1 -0
  27. package/{dist/es2015 → esm2015}/events/upload-event.js +1 -0
  28. package/{dist/es2015 → esm2015}/events/upload-progress-event.js +1 -0
  29. package/{dist/es → esm2015}/events.js +0 -0
  30. package/esm2015/file-select.directive.js +100 -0
  31. package/{dist/es2015 → esm2015}/fileselect.component.js +160 -132
  32. package/esm2015/fileselect.module.js +35 -0
  33. package/{dist/es/types/chunk-info.js → esm2015/kendo-angular-upload.js} +4 -0
  34. package/esm2015/localization/custom-messages.component.js +50 -0
  35. package/esm2015/localization/localized-messages.directive.js +40 -0
  36. package/esm2015/localization/messages.js +59 -0
  37. package/{dist/es → esm2015}/main.js +0 -0
  38. package/{dist/es2015 → esm2015}/navigation.service.js +9 -9
  39. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  40. package/{dist/es2015 → esm2015}/rendering/file-list-item-action-button.component.js +70 -28
  41. package/{dist/es2015 → esm2015}/rendering/file-list-item-base.js +9 -0
  42. package/esm2015/rendering/file-list-item.js +107 -0
  43. package/esm2015/rendering/file-list-multiple-items.component.js +172 -0
  44. package/esm2015/rendering/file-list-single-item.component.js +154 -0
  45. package/esm2015/rendering/file-list.component.js +145 -0
  46. package/esm2015/rendering/upload-action-buttons.component.js +136 -0
  47. package/esm2015/rendering/upload-status-total.component.js +60 -0
  48. package/{dist/es2015 → esm2015}/shared.module.js +45 -18
  49. package/esm2015/templates/file-info-template.directive.js +22 -0
  50. package/esm2015/templates/file-template.directive.js +22 -0
  51. package/esm2015/templates/template-context.directive.js +34 -0
  52. package/{dist/es2015 → esm2015}/types/async-settings.js +1 -0
  53. package/{dist/es2015 → esm2015}/types/chunk-info.js +1 -0
  54. package/{dist/es2015 → esm2015}/types/chunk-map.js +0 -0
  55. package/{dist/es → esm2015}/types/chunk-metadata.js +1 -0
  56. package/{dist/es → esm2015}/types/chunk-settings.js +1 -0
  57. package/{dist/es → esm2015}/types/direction.js +1 -0
  58. package/{dist/es2015 → esm2015}/types/file-groups.js +3 -5
  59. package/{dist/es → esm2015}/types/file-info.js +1 -0
  60. package/{dist/es2015 → esm2015}/types/file-map.js +0 -0
  61. package/{dist/es → esm2015}/types/file-restrictions.js +1 -0
  62. package/{dist/es → esm2015}/types/file-state.js +0 -0
  63. package/{dist/es → esm2015}/types/operation-type.js +1 -0
  64. package/{dist/es → esm2015}/types.js +0 -0
  65. package/{dist/es2015 → esm2015}/upload.component.js +262 -243
  66. package/esm2015/upload.module.js +43 -0
  67. package/{dist/es2015 → esm2015}/upload.service.js +10 -9
  68. package/{dist/es2015 → esm2015}/uploads.module.js +17 -12
  69. package/{dist/es2015/events → events}/cancel-event.d.ts +4 -0
  70. package/{dist/es2015/events → events}/clear-event.d.ts +1 -0
  71. package/{dist/es2015/events → events}/error-event.d.ts +10 -0
  72. package/{dist/es2015/events → events}/pause-event.d.ts +4 -0
  73. package/{dist/es2015/events → events}/preventable-event.d.ts +0 -0
  74. package/{dist/es2015/events → events}/remove-event.d.ts +9 -2
  75. package/{dist/es2015/events → events}/resume-event.d.ts +4 -0
  76. package/{dist/es2015/events → events}/select-event.d.ts +4 -0
  77. package/{dist/es2015/events → events}/success-event.d.ts +10 -0
  78. package/{dist/es2015/events → events}/upload-event.d.ts +9 -2
  79. package/{dist/es2015/events → events}/upload-progress-event.d.ts +7 -0
  80. package/{dist/es2015/events.d.ts → events.d.ts} +0 -0
  81. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-upload.js} +2192 -2010
  82. package/{dist/es2015/file-select.directive.d.ts → file-select.directive.d.ts} +7 -4
  83. package/{dist/es2015/fileselect.component.d.ts → fileselect.component.d.ts} +14 -6
  84. package/fileselect.module.d.ts +20 -0
  85. package/{dist/es/common/action-buttons-layout.js → kendo-angular-upload.d.ts} +5 -0
  86. package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
  87. package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
  88. package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
  89. package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
  90. package/{dist/es2015/navigation.service.d.ts → navigation.service.d.ts} +7 -3
  91. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  92. package/package.json +36 -104
  93. package/{dist/es2015/rendering → rendering}/file-list-item-action-button.component.d.ts +11 -8
  94. package/{dist/es2015/rendering → rendering}/file-list-item-base.d.ts +3 -0
  95. package/{dist/es2015/rendering → rendering}/file-list-item.d.ts +10 -7
  96. package/{dist/es2015/rendering → rendering}/file-list-multiple-items.component.d.ts +7 -4
  97. package/{dist/es2015/rendering → rendering}/file-list-single-item.component.d.ts +9 -6
  98. package/{dist/es2015/rendering → rendering}/file-list.component.d.ts +3 -0
  99. package/{dist/es2015/rendering → rendering}/upload-action-buttons.component.d.ts +7 -4
  100. package/{dist/es2015/rendering → rendering}/upload-status-total.component.d.ts +3 -0
  101. package/schematics/ngAdd/index.js +5 -2
  102. package/schematics/ngAdd/index.js.map +1 -1
  103. package/shared.module.d.ts +36 -0
  104. package/{dist/es2015/templates → templates}/file-info-template.directive.d.ts +3 -0
  105. package/{dist/es2015/templates → templates}/file-template.directive.d.ts +3 -0
  106. package/{dist/es2015/templates → templates}/template-context.directive.d.ts +4 -1
  107. package/{dist/es2015/types → types}/async-settings.d.ts +0 -0
  108. package/{dist/es2015/types → types}/chunk-info.d.ts +0 -0
  109. package/{dist/es2015/types → types}/chunk-map.d.ts +0 -0
  110. package/{dist/es2015/types → types}/chunk-metadata.d.ts +0 -0
  111. package/{dist/es2015/types → types}/chunk-settings.d.ts +0 -0
  112. package/{dist/es2015/types → types}/direction.d.ts +0 -0
  113. package/{dist/es2015/types → types}/file-groups.d.ts +0 -0
  114. package/{dist/es2015/types → types}/file-info.d.ts +0 -0
  115. package/{dist/es2015/types → types}/file-map.d.ts +5 -5
  116. package/{dist/es2015/types → types}/file-restrictions.d.ts +0 -0
  117. package/{dist/es2015/types → types}/file-state.d.ts +0 -0
  118. package/{dist/es2015/types → types}/operation-type.d.ts +0 -0
  119. package/{dist/es2015/types.d.ts → types.d.ts} +0 -0
  120. package/{dist/es2015/upload.component.d.ts → upload.component.d.ts} +42 -21
  121. package/upload.module.d.ts +22 -0
  122. package/{dist/es2015/upload.service.d.ts → upload.service.d.ts} +4 -1
  123. package/{dist/es2015/uploads.module.d.ts → uploads.module.d.ts} +6 -0
  124. package/dist/cdn/js/kendo-angular-upload.js +0 -20
  125. package/dist/cdn/main.js +0 -5
  126. package/dist/es/common/util.js +0 -234
  127. package/dist/es/common/validation-util.js +0 -64
  128. package/dist/es/dropzone-base.js +0 -66
  129. package/dist/es/dropzone-external.directive.js +0 -98
  130. package/dist/es/dropzone-internal.directive.js +0 -110
  131. package/dist/es/dropzone.component.js +0 -99
  132. package/dist/es/dropzone.service.js +0 -33
  133. package/dist/es/events/cancel-event.js +0 -41
  134. package/dist/es/events/clear-event.js +0 -43
  135. package/dist/es/events/error-event.js +0 -45
  136. package/dist/es/events/pause-event.js +0 -42
  137. package/dist/es/events/preventable-event.js +0 -29
  138. package/dist/es/events/remove-event.js +0 -47
  139. package/dist/es/events/resume-event.js +0 -42
  140. package/dist/es/events/select-event.js +0 -45
  141. package/dist/es/events/success-event.js +0 -49
  142. package/dist/es/events/upload-event.js +0 -47
  143. package/dist/es/events/upload-progress-event.js +0 -42
  144. package/dist/es/file-select.directive.js +0 -141
  145. package/dist/es/fileselect.component.js +0 -484
  146. package/dist/es/fileselect.module.js +0 -30
  147. package/dist/es/index.js +0 -21
  148. package/dist/es/localization/custom-messages.component.js +0 -53
  149. package/dist/es/localization/localized-messages.directive.js +0 -35
  150. package/dist/es/localization/messages.js +0 -102
  151. package/dist/es/navigation.service.js +0 -166
  152. package/dist/es/package-metadata.js +0 -15
  153. package/dist/es/rendering/file-list-item-action-button.component.js +0 -169
  154. package/dist/es/rendering/file-list-item-base.js +0 -41
  155. package/dist/es/rendering/file-list-item.js +0 -165
  156. package/dist/es/rendering/file-list-multiple-items.component.js +0 -107
  157. package/dist/es/rendering/file-list-single-item.component.js +0 -112
  158. package/dist/es/rendering/file-list.component.js +0 -98
  159. package/dist/es/rendering/upload-action-buttons.component.js +0 -149
  160. package/dist/es/rendering/upload-status-total.component.js +0 -42
  161. package/dist/es/shared.module.js +0 -68
  162. package/dist/es/templates/file-info-template.directive.js +0 -22
  163. package/dist/es/templates/file-template.directive.js +0 -22
  164. package/dist/es/templates/template-context.directive.js +0 -40
  165. package/dist/es/types/async-settings.js +0 -4
  166. package/dist/es/types/chunk-map.js +0 -36
  167. package/dist/es/types/file-groups.js +0 -45
  168. package/dist/es/types/file-map.js +0 -170
  169. package/dist/es/upload.component.js +0 -967
  170. package/dist/es/upload.module.js +0 -34
  171. package/dist/es/upload.service.js +0 -448
  172. package/dist/es/uploads.module.js +0 -47
  173. package/dist/es2015/dropzone.component.js +0 -100
  174. package/dist/es2015/events.js +0 -14
  175. package/dist/es2015/file-select.directive.js +0 -123
  176. package/dist/es2015/fileselect.module.d.ts +0 -9
  177. package/dist/es2015/fileselect.module.js +0 -27
  178. package/dist/es2015/index.d.ts +0 -21
  179. package/dist/es2015/index.js +0 -21
  180. package/dist/es2015/index.metadata.json +0 -1
  181. package/dist/es2015/localization/custom-messages.component.js +0 -45
  182. package/dist/es2015/localization/localized-messages.directive.js +0 -35
  183. package/dist/es2015/localization/messages.js +0 -96
  184. package/dist/es2015/main.js +0 -24
  185. package/dist/es2015/rendering/file-list-item.js +0 -136
  186. package/dist/es2015/rendering/file-list-multiple-items.component.js +0 -128
  187. package/dist/es2015/rendering/file-list-single-item.component.js +0 -117
  188. package/dist/es2015/rendering/file-list.component.js +0 -123
  189. package/dist/es2015/rendering/upload-action-buttons.component.js +0 -141
  190. package/dist/es2015/rendering/upload-status-total.component.js +0 -51
  191. package/dist/es2015/shared.module.d.ts +0 -17
  192. package/dist/es2015/templates/file-info-template.directive.js +0 -21
  193. package/dist/es2015/templates/file-template.directive.js +0 -21
  194. package/dist/es2015/templates/template-context.directive.js +0 -35
  195. package/dist/es2015/types/chunk-metadata.js +0 -4
  196. package/dist/es2015/types/chunk-settings.js +0 -4
  197. package/dist/es2015/types/direction.js +0 -4
  198. package/dist/es2015/types/file-info.js +0 -4
  199. package/dist/es2015/types/file-restrictions.js +0 -4
  200. package/dist/es2015/types/file-state.js +0 -34
  201. package/dist/es2015/types/operation-type.js +0 -4
  202. package/dist/es2015/types.js +0 -5
  203. package/dist/es2015/upload.module.d.ts +0 -9
  204. package/dist/es2015/upload.module.js +0 -31
  205. package/dist/fesm5/index.js +0 -4653
  206. package/dist/npm/common/action-buttons-layout.js +0 -6
  207. package/dist/npm/common/util.js +0 -240
  208. package/dist/npm/common/validation-util.js +0 -68
  209. package/dist/npm/dropzone-base.js +0 -68
  210. package/dist/npm/dropzone-external.directive.js +0 -100
  211. package/dist/npm/dropzone-internal.directive.js +0 -112
  212. package/dist/npm/dropzone.component.js +0 -101
  213. package/dist/npm/dropzone.service.js +0 -35
  214. package/dist/npm/events/cancel-event.js +0 -43
  215. package/dist/npm/events/clear-event.js +0 -45
  216. package/dist/npm/events/error-event.js +0 -47
  217. package/dist/npm/events/pause-event.js +0 -44
  218. package/dist/npm/events/preventable-event.js +0 -31
  219. package/dist/npm/events/remove-event.js +0 -49
  220. package/dist/npm/events/resume-event.js +0 -44
  221. package/dist/npm/events/select-event.js +0 -47
  222. package/dist/npm/events/success-event.js +0 -51
  223. package/dist/npm/events/upload-event.js +0 -49
  224. package/dist/npm/events/upload-progress-event.js +0 -44
  225. package/dist/npm/events.js +0 -26
  226. package/dist/npm/file-select.directive.js +0 -143
  227. package/dist/npm/fileselect.component.js +0 -486
  228. package/dist/npm/fileselect.module.js +0 -32
  229. package/dist/npm/index.js +0 -39
  230. package/dist/npm/localization/custom-messages.component.js +0 -55
  231. package/dist/npm/localization/localized-messages.directive.js +0 -37
  232. package/dist/npm/localization/messages.js +0 -104
  233. package/dist/npm/main.js +0 -45
  234. package/dist/npm/navigation.service.js +0 -168
  235. package/dist/npm/package-metadata.js +0 -17
  236. package/dist/npm/rendering/file-list-item-action-button.component.js +0 -171
  237. package/dist/npm/rendering/file-list-item-base.js +0 -43
  238. package/dist/npm/rendering/file-list-item.js +0 -167
  239. package/dist/npm/rendering/file-list-multiple-items.component.js +0 -109
  240. package/dist/npm/rendering/file-list-single-item.component.js +0 -114
  241. package/dist/npm/rendering/file-list.component.js +0 -100
  242. package/dist/npm/rendering/upload-action-buttons.component.js +0 -151
  243. package/dist/npm/rendering/upload-status-total.component.js +0 -44
  244. package/dist/npm/shared.module.js +0 -70
  245. package/dist/npm/templates/file-info-template.directive.js +0 -24
  246. package/dist/npm/templates/file-template.directive.js +0 -24
  247. package/dist/npm/templates/template-context.directive.js +0 -42
  248. package/dist/npm/types/async-settings.js +0 -6
  249. package/dist/npm/types/chunk-info.js +0 -6
  250. package/dist/npm/types/chunk-map.js +0 -38
  251. package/dist/npm/types/chunk-metadata.js +0 -6
  252. package/dist/npm/types/chunk-settings.js +0 -6
  253. package/dist/npm/types/direction.js +0 -6
  254. package/dist/npm/types/file-groups.js +0 -47
  255. package/dist/npm/types/file-info.js +0 -6
  256. package/dist/npm/types/file-map.js +0 -172
  257. package/dist/npm/types/file-restrictions.js +0 -6
  258. package/dist/npm/types/file-state.js +0 -36
  259. package/dist/npm/types/operation-type.js +0 -6
  260. package/dist/npm/types.js +0 -8
  261. package/dist/npm/upload.component.js +0 -969
  262. package/dist/npm/upload.module.js +0 -36
  263. package/dist/npm/upload.service.js +0 -450
  264. package/dist/npm/uploads.module.js +0 -49
  265. package/dist/systemjs/kendo-angular-upload.js +0 -5
@@ -1,967 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { HttpHeaders } from '@angular/common/http';
7
- import { Component, ContentChild, ElementRef, EventEmitter, forwardRef, HostBinding, HostListener, Input, NgZone, Output, Renderer2, ViewChild, isDevMode, ChangeDetectorRef } from '@angular/core';
8
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
- import { guid, isDocumentAvailable, KendoInput, Keys, isChanged } from '@progress/kendo-angular-common';
10
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
11
- import { fromEvent, merge } from 'rxjs';
12
- import { filter } from 'rxjs/operators';
13
- import { validatePackage } from '@progress/kendo-licensing';
14
- import { packageMetadata } from './package-metadata';
15
- import { FileState } from './types';
16
- import { NavigationService } from './navigation.service';
17
- import { FileTemplateDirective } from './templates/file-template.directive';
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 { FileInfoTemplateDirective } from './templates/file-info-template.directive';
22
- /* tslint:disable: no-use-before-declare */
23
- /**
24
- * @hidden
25
- */
26
- export var UPLOAD_VALUE_ACCESSOR = {
27
- multi: true,
28
- provide: NG_VALUE_ACCESSOR,
29
- useExisting: forwardRef(function () { return UploadComponent; }) // tslint:disable-line:no-forward-ref
30
- };
31
- /**
32
- * Represents the [Kendo UI Upload component for Angular]({% slug overview_upload %}).
33
- */
34
- var UploadComponent = /** @class */ (function () {
35
- function UploadComponent(uploadService, localization, navigation, dropZoneService, _ngZone, renderer, cdr, wrapper) {
36
- var _this = this;
37
- this.uploadService = uploadService;
38
- this.localization = localization;
39
- this.navigation = navigation;
40
- this.dropZoneService = dropZoneService;
41
- this._ngZone = _ngZone;
42
- this.renderer = renderer;
43
- this.cdr = cdr;
44
- /**
45
- * Enables the chunk functionality of the Upload.
46
- *
47
- * The default value is `false`.
48
- */
49
- this.chunkable = false;
50
- /**
51
- * Enables the selection of multiple files
52
- * ([see example]({% slug fileprocessing_upload %}#toc-upload-of-sinlge-or-multiple-files)).
53
- * If set to `false`, only one file can be selected at a time.
54
- */
55
- this.multiple = true;
56
- /**
57
- * Disables the Upload ([see example]({% slug disabledstate_upload %})).
58
- * The default value is `false`.
59
- */
60
- this.disabled = false;
61
- /**
62
- * Toggles the visibility of the file list.
63
- */
64
- this.showFileList = true;
65
- /**
66
- * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
67
- */
68
- this.tabindex = 0;
69
- /**
70
- * @hidden
71
- */
72
- this.focusableId = "k-" + guid();
73
- /**
74
- * Specifies the possible layout of the action buttons.
75
- */
76
- this.actionsLayout = 'end';
77
- /**
78
- * Fires when the user navigates outside the component.
79
- */
80
- this.onBlur = new EventEmitter();
81
- /**
82
- * Fires when the upload is canceled while in progress.
83
- */
84
- this.cancel = new EventEmitter();
85
- /**
86
- * Fires when the file list is about to be cleared. If prevented, the files will not be cleared.
87
- */
88
- this.clear = new EventEmitter();
89
- /**
90
- * Fires when all active uploads are completed either successfully or with errors.
91
- */
92
- this.complete = new EventEmitter();
93
- /**
94
- * Fires when an `upload` or `remove` operation has failed.
95
- */
96
- this.error = new EventEmitter();
97
- /**
98
- * Fires when the component is focused.
99
- */
100
- this.onFocus = new EventEmitter();
101
- /**
102
- * Fires when the upload of a file has been paused.
103
- */
104
- this.pause = new EventEmitter();
105
- /**
106
- * Fires when an uploaded file is about to be removed. If prevented, the files will remain in the list.
107
- */
108
- this.remove = new EventEmitter();
109
- /**
110
- * Fires when the upload of a file has been resumed.
111
- */
112
- this.resume = new EventEmitter();
113
- /**
114
- * Fires when files are selected. If prevented, the selected files will not be added to the list.
115
- */
116
- this.select = new EventEmitter();
117
- /**
118
- * Fires when an `upload` or `remove` operation is successfully completed.
119
- */
120
- this.success = new EventEmitter();
121
- /**
122
- * Fires when one or more files are about to be uploaded. If prevented, the files will neither be uploaded, nor added to the file list.
123
- */
124
- this.upload = new EventEmitter();
125
- /**
126
- * Fires when one or more files are being uploaded.
127
- */
128
- this.uploadProgress = new EventEmitter();
129
- /**
130
- * Fires when the value of the component has changed as a result of a successful `upload`, `remove` or `clear` operation.
131
- */
132
- this.valueChange = new EventEmitter();
133
- this.hostDefaultClasses = true;
134
- /**
135
- * @hidden
136
- */
137
- this._restrictions = {
138
- allowedExtensions: [],
139
- maxFileSize: 0,
140
- minFileSize: 0
141
- };
142
- this.onTouchedCallback = function (_) { };
143
- this.onChangeCallback = function (_) { };
144
- validatePackage(packageMetadata);
145
- this.fileList = this.uploadService.files;
146
- this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
147
- var rtl = _a.rtl;
148
- _this.direction = rtl ? 'rtl' : 'ltr';
149
- _this.navigation.computeKeys(_this.direction);
150
- });
151
- this.direction = localization.rtl ? 'rtl' : 'ltr';
152
- this.navigation.computeKeys(this.direction);
153
- this.wrapper = wrapper.nativeElement;
154
- this.subscribeBlur();
155
- this.subscribeFocus();
156
- this.attachEventHandlers();
157
- }
158
- UploadComponent_1 = UploadComponent;
159
- Object.defineProperty(UploadComponent.prototype, "autoUpload", {
160
- get: function () {
161
- return this.uploadService.async.autoUpload;
162
- },
163
- /**
164
- * By default, the selected files are immediately uploaded
165
- * ([see example]({% slug fileprocessing_upload %}#toc-automatic-upload-of-files)).
166
- * To change this behavior, set `autoUpload` to `false`.
167
- */
168
- set: function (autoUpload) {
169
- this.uploadService.async.autoUpload = autoUpload;
170
- },
171
- enumerable: true,
172
- configurable: true
173
- });
174
- Object.defineProperty(UploadComponent.prototype, "batch", {
175
- get: function () {
176
- return this.uploadService.async.batch;
177
- },
178
- /**
179
- * When enabled, all files in the selection are uploaded in one request
180
- * ([see example]({% slug fileprocessing_upload %}#toc-upload-of-batches-of-files)).
181
- * Any files that are selected one after the other are uploaded in separate requests.
182
- */
183
- set: function (batch) {
184
- this.uploadService.async.batch = batch;
185
- },
186
- enumerable: true,
187
- configurable: true
188
- });
189
- Object.defineProperty(UploadComponent.prototype, "withCredentials", {
190
- get: function () {
191
- return this.uploadService.async.withCredentials;
192
- },
193
- /**
194
- * Configures whether credentials (cookies, headers) will be sent for cross-site requests
195
- * ([see example]({% slug credentials_upload %}#toc-attaching-credentials-to-requests)).
196
- * The default values is `true`. Setting `withCredentials` has no effect on same-site requests.
197
- * To add credentials to the request, use the `saveHeaders` or `removeHeaders` property,
198
- * or the [`upload`]({% slug api_upload_uploadevent %}) event.
199
- */
200
- set: function (withCredentials) {
201
- this.uploadService.async.withCredentials = withCredentials;
202
- },
203
- enumerable: true,
204
- configurable: true
205
- });
206
- Object.defineProperty(UploadComponent.prototype, "saveField", {
207
- get: function () {
208
- return this.uploadService.async.saveField;
209
- },
210
- /**
211
- * Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which contains the files submitted to `saveUrl`.
212
- * The default value is `files`.
213
- */
214
- set: function (saveField) {
215
- this.uploadService.async.saveField = saveField;
216
- },
217
- enumerable: true,
218
- configurable: true
219
- });
220
- Object.defineProperty(UploadComponent.prototype, "saveHeaders", {
221
- get: function () {
222
- return this.uploadService.async.saveHeaders;
223
- },
224
- /**
225
- * Configures the [`HttpHeaders`](https://angular.io/api/common/http/HttpHeaders)
226
- * that are attached to each upload request.
227
- */
228
- set: function (saveHeaders) {
229
- this.uploadService.async.saveHeaders = saveHeaders;
230
- },
231
- enumerable: true,
232
- configurable: true
233
- });
234
- Object.defineProperty(UploadComponent.prototype, "saveMethod", {
235
- get: function () {
236
- return this.uploadService.async.saveMethod;
237
- },
238
- /**
239
- * Sets the [`RequestMethod`](https://angular.io/api/http/RequestMethod) of the upload request.
240
- * The default value is `POST`.
241
- */
242
- set: function (saveMethod) {
243
- this.uploadService.async.saveMethod = saveMethod;
244
- },
245
- enumerable: true,
246
- configurable: true
247
- });
248
- Object.defineProperty(UploadComponent.prototype, "saveUrl", {
249
- get: function () {
250
- return this.uploadService.async.saveUrl;
251
- },
252
- /**
253
- * Sets the URL of the endpoint for the upload request.
254
- * The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key is named after the `saveField` property.
255
- * It contains the list of files to be uploaded.
256
- */
257
- set: function (saveUrl) {
258
- this.uploadService.async.saveUrl = saveUrl;
259
- },
260
- enumerable: true,
261
- configurable: true
262
- });
263
- Object.defineProperty(UploadComponent.prototype, "responseType", {
264
- get: function () {
265
- return this.uploadService.async.responseType;
266
- },
267
- /**
268
- * Sets the expected [`response type`](https://angular.io/api/common/http/HttpRequest#responseType) of the server.
269
- * It is used to parse the response appropriately.
270
- * The default value is `json`.
271
- */
272
- set: function (responseType) {
273
- this.uploadService.async.responseType = responseType;
274
- },
275
- enumerable: true,
276
- configurable: true
277
- });
278
- Object.defineProperty(UploadComponent.prototype, "removeField", {
279
- get: function () { return this.uploadService.async.removeField; },
280
- /**
281
- * Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
282
- * which contains the list of file names that are submitted to `removeUrl`.
283
- * The default value is `fileNames`.
284
- */
285
- set: function (removeField) { this.uploadService.async.removeField = removeField; },
286
- enumerable: true,
287
- configurable: true
288
- });
289
- Object.defineProperty(UploadComponent.prototype, "removeHeaders", {
290
- get: function () {
291
- return this.uploadService.async.removeHeaders;
292
- },
293
- /**
294
- * Configures the [`HttpHeaders`](https://angular.io/api/common/http/HttpHeaders)
295
- * that are attached to each `remove` request.
296
- */
297
- set: function (removeHeaders) {
298
- this.uploadService.async.removeHeaders = removeHeaders;
299
- },
300
- enumerable: true,
301
- configurable: true
302
- });
303
- Object.defineProperty(UploadComponent.prototype, "removeMethod", {
304
- get: function () {
305
- return this.uploadService.async.removeMethod;
306
- },
307
- /**
308
- * Sets the [`RequestMethod`](https://angular.io/api/http/RequestMethod) of the `remove` request.
309
- * The default value is `POST`.
310
- */
311
- set: function (removeMethod) {
312
- this.uploadService.async.removeMethod = removeMethod;
313
- },
314
- enumerable: true,
315
- configurable: true
316
- });
317
- Object.defineProperty(UploadComponent.prototype, "removeUrl", {
318
- get: function () {
319
- return this.uploadService.async.removeUrl;
320
- },
321
- /**
322
- * Sets the URL of the endpoint for the `remove` request.
323
- * The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key is named after the `removeField` property.
324
- * It contains the list of file names which will be removed.
325
- */
326
- set: function (removeUrl) {
327
- this.uploadService.async.removeUrl = removeUrl;
328
- },
329
- enumerable: true,
330
- configurable: true
331
- });
332
- Object.defineProperty(UploadComponent.prototype, "concurrent", {
333
- get: function () {
334
- return this.uploadService.async.concurrent;
335
- },
336
- /**
337
- * Specifies if the selected files are uploaded simultaneously or one by one.
338
- *
339
- * The default value is `true`.
340
- */
341
- set: function (concurrent) {
342
- this.uploadService.async.concurrent = concurrent;
343
- },
344
- enumerable: true,
345
- configurable: true
346
- });
347
- Object.defineProperty(UploadComponent.prototype, "tabIndex", {
348
- get: function () {
349
- return this.tabindex;
350
- },
351
- /**
352
- * @hidden
353
- */
354
- set: function (tabIndex) {
355
- this.tabindex = tabIndex;
356
- },
357
- enumerable: true,
358
- configurable: true
359
- });
360
- Object.defineProperty(UploadComponent.prototype, "restrictions", {
361
- get: function () {
362
- return this._restrictions;
363
- },
364
- /**
365
- * Sets the restrictions for selected files ([see example]({% slug api_upload_filerestrictions %})).
366
- */
367
- set: function (restrictions) {
368
- var parsedRestrictions = Object.assign({}, this._restrictions, restrictions);
369
- this._restrictions = parsedRestrictions;
370
- },
371
- enumerable: true,
372
- configurable: true
373
- });
374
- Object.defineProperty(UploadComponent.prototype, "hostDisabledClass", {
375
- get: function () {
376
- return this.disabled;
377
- },
378
- enumerable: true,
379
- configurable: true
380
- });
381
- Object.defineProperty(UploadComponent.prototype, "dir", {
382
- get: function () {
383
- return this.direction;
384
- },
385
- enumerable: true,
386
- configurable: true
387
- });
388
- UploadComponent.prototype.ngOnInit = function () {
389
- this.verifySettings();
390
- this.renderer.removeAttribute(this.wrapper, "tabindex");
391
- this.uploadService.setChunkSettings(this.chunkable);
392
- if (this.zoneId) {
393
- this.dropZoneService.addComponent(this, this.zoneId);
394
- }
395
- };
396
- UploadComponent.prototype.ngOnChanges = function (changes) {
397
- if (isChanged("chunkable", changes)) {
398
- var newChunkable = changes.chunkable.currentValue;
399
- if (typeof newChunkable === 'boolean') {
400
- this.uploadService.async.chunk = newChunkable;
401
- }
402
- if (typeof newChunkable === "object" && newChunkable !== null) {
403
- this.uploadService.async.chunk = true;
404
- this.uploadService.chunk = Object.assign({}, this.uploadService.chunk, newChunkable);
405
- }
406
- }
407
- };
408
- UploadComponent.prototype.ngOnDestroy = function () {
409
- this.fileList.clear();
410
- if (this.blurSubscription) {
411
- this.blurSubscription.unsubscribe();
412
- }
413
- if (this.wrapperFocusSubscription) {
414
- this.wrapperFocusSubscription.unsubscribe();
415
- }
416
- if (this.selectButtonFocusSubscription) {
417
- this.selectButtonFocusSubscription.unsubscribe();
418
- }
419
- if (this.localizationChangeSubscription) {
420
- this.localizationChangeSubscription.unsubscribe();
421
- }
422
- if (this.subs) {
423
- this.subs.unsubscribe();
424
- }
425
- };
426
- /**
427
- * @hidden
428
- */
429
- UploadComponent.prototype.handleKeydown = function (event) {
430
- if (this.disabled) {
431
- return;
432
- }
433
- if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space) &&
434
- event.target === this.fileSelectButton.nativeElement) {
435
- event.preventDefault();
436
- this.fileSelect.nativeElement.click();
437
- return;
438
- }
439
- if (hasClasses(event.target, UPLOAD_CLASSES) ||
440
- (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
441
- this.navigation.process(event);
442
- }
443
- };
444
- /**
445
- * @hidden
446
- */
447
- UploadComponent.prototype.writeValue = function (newValue) {
448
- var isValid = true;
449
- if (newValue instanceof Array) {
450
- newValue.forEach(function (file) {
451
- if (!validateInitialFileInfo(file)) {
452
- isValid = false;
453
- }
454
- });
455
- if (isValid) {
456
- this.uploadService.addInitialFiles(newValue);
457
- }
458
- }
459
- if (newValue === null) {
460
- this.fileList.clear();
461
- }
462
- this.cdr.markForCheck();
463
- };
464
- /**
465
- * @hidden
466
- */
467
- UploadComponent.prototype.registerOnChange = function (fn) {
468
- this.onChangeCallback = fn;
469
- };
470
- /**
471
- * @hidden
472
- */
473
- UploadComponent.prototype.registerOnTouched = function (fn) {
474
- this.onTouchedCallback = fn;
475
- };
476
- /**
477
- * @hidden
478
- */
479
- UploadComponent.prototype.setDisabledState = function (isDisabled) {
480
- this.disabled = isDisabled;
481
- };
482
- Object.defineProperty(UploadComponent.prototype, "selectButtonTabIndex", {
483
- /**
484
- * @hidden
485
- */
486
- get: function () {
487
- return this.disabled ? undefined : this.tabIndex;
488
- },
489
- enumerable: true,
490
- configurable: true
491
- });
492
- /**
493
- * @hidden
494
- */
495
- UploadComponent.prototype.onFileSelectButtonFocus = function (_event) {
496
- this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
497
- if (!this.navigation.focused) {
498
- this.navigation.focusedIndex = -1;
499
- }
500
- };
501
- /**
502
- * @hidden
503
- */
504
- UploadComponent.prototype.onFileSelectButtonBlur = function (_event) {
505
- this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
506
- };
507
- Object.defineProperty(UploadComponent.prototype, "showActionButtons", {
508
- /**
509
- * @hidden
510
- */
511
- get: function () {
512
- var areVisible = false;
513
- if (!this.autoUpload) {
514
- var hasFilesToUpload = this.fileList.filesToUpload.length > 0;
515
- var uploadingFiles = this.fileList.hasFileWithState([FileState.Uploading]);
516
- if (this.concurrent && hasFilesToUpload) {
517
- areVisible = true;
518
- }
519
- if (!this.concurrent && hasFilesToUpload && !uploadingFiles) {
520
- areVisible = true;
521
- }
522
- }
523
- this.navigation.actionButtonsVisible = areVisible;
524
- return areVisible;
525
- },
526
- enumerable: true,
527
- configurable: true
528
- });
529
- Object.defineProperty(UploadComponent.prototype, "showTotalStatus", {
530
- /**
531
- * @hidden
532
- */
533
- get: function () {
534
- var states = [
535
- FileState.Uploaded,
536
- FileState.Uploading,
537
- FileState.Failed,
538
- FileState.Paused
539
- ];
540
- if (this.fileList.hasFileWithState(states)) {
541
- return true;
542
- }
543
- return false;
544
- },
545
- enumerable: true,
546
- configurable: true
547
- });
548
- /**
549
- * @hidden
550
- */
551
- UploadComponent.prototype.textFor = function (key) {
552
- return this.localization.get(key);
553
- };
554
- /**
555
- * Focuses the underlying input element.
556
- */
557
- UploadComponent.prototype.focus = function () {
558
- var _this = this;
559
- setTimeout(function () {
560
- _this.fileSelectButton.nativeElement.focus();
561
- });
562
- };
563
- /**
564
- * @hidden
565
- * @deprecated
566
- */
567
- UploadComponent.prototype.focusComponent = function () {
568
- this.focus();
569
- };
570
- /**
571
- * Blurs the Upload if it was previously focused.
572
- */
573
- UploadComponent.prototype.blur = function () {
574
- if (this.navigation.focused) {
575
- this.navigation.focused = false;
576
- document.activeElement.blur();
577
- this.onBlur.emit();
578
- }
579
- };
580
- /**
581
- * @hidden
582
- * @deprecated
583
- */
584
- UploadComponent.prototype.blurComponent = function () {
585
- this.blur();
586
- };
587
- /**
588
- * Pauses the upload process of a file that is currently uploading.
589
- * The `pauseFileByUid` method requires the `chunkable` option of the Upload to be enabled.
590
- *
591
- * @param uid - The `uid` of the file that will be paused.
592
- */
593
- UploadComponent.prototype.pauseFileByUid = function (uid) {
594
- this.uploadService.pauseFile(uid);
595
- };
596
- /**
597
- * Resumes the upload process for a file that has been previously paused.
598
- * The `resumeFileByUid` method requires the `chunkable` option of the Upload to be enabled.
599
- *
600
- * @param uid - The `uid` of the file that will be resumed.
601
- */
602
- UploadComponent.prototype.resumeFileByUid = function (uid) {
603
- this.uploadService.resumeFile(uid);
604
- };
605
- /**
606
- * Triggers the removal of a file or a batch of files.
607
- * @param uid - The `uid` of the file or a batch of files that will be removed.
608
- */
609
- UploadComponent.prototype.removeFilesByUid = function (uid) {
610
- this.uploadService.removeFiles(uid);
611
- };
612
- /**
613
- * Triggers another upload attempt of an unsuccessfully uploaded file or a batch of files.
614
- * @param uid - The `uid` of the file or a batch of files to be retried.
615
- */
616
- UploadComponent.prototype.retryUploadByUid = function (uid) {
617
- this.uploadService.retryFiles(uid);
618
- };
619
- /**
620
- * Cancels the upload of a file or a batch of files.
621
- * @param uid - The `uid` of the file or a batch of files that will be canceled.
622
- */
623
- UploadComponent.prototype.cancelUploadByUid = function (uid) {
624
- this.uploadService.cancelFiles(uid);
625
- };
626
- /**
627
- * Uploads the currently selected files which pass the set restrictions.
628
- */
629
- UploadComponent.prototype.uploadFiles = function () {
630
- if (this.fileList.filesToUpload.length) {
631
- this.uploadService.uploadFiles();
632
- }
633
- };
634
- /**
635
- * Visually clears all files from the UI without issuing requests to the remove handler.
636
- */
637
- UploadComponent.prototype.clearFiles = function () {
638
- this.uploadService.clearFiles();
639
- };
640
- /**
641
- * @hidden
642
- * Used by the external dropzone to add files to the Upload
643
- */
644
- UploadComponent.prototype.addFiles = function (files) {
645
- this.uploadService.addFiles(files);
646
- };
647
- /**
648
- * @hidden
649
- * Used to determine if the component is empty.
650
- */
651
- UploadComponent.prototype.isEmpty = function () {
652
- return false;
653
- };
654
- UploadComponent.prototype.verifySettings = function () {
655
- if (isDevMode()) {
656
- if (this.batch && this.chunkable !== false) {
657
- throw new Error('The file chunking functionality requires the batch setting to be disabled.');
658
- }
659
- }
660
- };
661
- UploadComponent.prototype.subscribeBlur = function () {
662
- var _this = this;
663
- if (!isDocumentAvailable()) {
664
- return;
665
- }
666
- this._ngZone.runOutsideAngular(function () {
667
- _this.documentClick = fromEvent(document, 'click').pipe(filter(function (event) {
668
- return !(_this.wrapper !== event.target && _this.wrapper.contains(event.target));
669
- }));
670
- _this.blurSubscription = merge(_this.documentClick, _this.navigation.onTab).subscribe(function () {
671
- if (_this.navigation.focused) {
672
- _this._ngZone.run(function () {
673
- _this.navigation.focused = false;
674
- _this.onTouchedCallback();
675
- _this.onBlur.emit();
676
- });
677
- }
678
- });
679
- });
680
- };
681
- UploadComponent.prototype.subscribeFocus = function () {
682
- var _this = this;
683
- this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(function () {
684
- _this.onFocus.emit();
685
- });
686
- this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(function () {
687
- _this.fileSelectButton.nativeElement.focus();
688
- });
689
- };
690
- UploadComponent.prototype.attachEventHandlers = function () {
691
- var _this = this;
692
- this.subs = this.uploadService.cancelEvent.subscribe(function (args) {
693
- _this.cancel.emit(args);
694
- });
695
- this.subs.add(this.uploadService.changeEvent.subscribe(function (files) {
696
- _this.onChangeCallback(files);
697
- _this.valueChange.emit(files);
698
- }));
699
- this.subs.add(this.uploadService.clearEvent.subscribe(function (args) {
700
- _this.clear.emit(args);
701
- }));
702
- this.subs.add(this.uploadService.completeEvent.subscribe(function () {
703
- _this.complete.emit();
704
- }));
705
- this.subs.add(this.uploadService.errorEvent.subscribe(function (args) {
706
- _this.error.emit(args);
707
- }));
708
- this.subs.add(this.uploadService.pauseEvent.subscribe(function (args) {
709
- _this.pause.emit(args);
710
- }));
711
- this.subs.add(this.uploadService.removeEvent.subscribe(function (args) {
712
- _this.remove.emit(args);
713
- }));
714
- this.subs.add(this.uploadService.resumeEvent.subscribe(function (args) {
715
- _this.resume.emit(args);
716
- }));
717
- this.subs.add(this.uploadService.selectEvent.subscribe(function (args) {
718
- _this.select.emit(args);
719
- }));
720
- this.subs.add(this.uploadService.successEvent.subscribe(function (args) {
721
- _this.success.emit(args);
722
- }));
723
- this.subs.add(this.uploadService.uploadEvent.subscribe(function (args) {
724
- _this.upload.emit(args);
725
- }));
726
- this.subs.add(this.uploadService.uploadProgressEvent.subscribe(function (args) {
727
- _this.uploadProgress.emit(args);
728
- }));
729
- };
730
- var UploadComponent_1;
731
- tslib_1.__decorate([
732
- Input(),
733
- tslib_1.__metadata("design:type", Boolean),
734
- tslib_1.__metadata("design:paramtypes", [Boolean])
735
- ], UploadComponent.prototype, "autoUpload", null);
736
- tslib_1.__decorate([
737
- Input(),
738
- tslib_1.__metadata("design:type", Boolean),
739
- tslib_1.__metadata("design:paramtypes", [Boolean])
740
- ], UploadComponent.prototype, "batch", null);
741
- tslib_1.__decorate([
742
- Input(),
743
- tslib_1.__metadata("design:type", Boolean),
744
- tslib_1.__metadata("design:paramtypes", [Boolean])
745
- ], UploadComponent.prototype, "withCredentials", null);
746
- tslib_1.__decorate([
747
- Input(),
748
- tslib_1.__metadata("design:type", String),
749
- tslib_1.__metadata("design:paramtypes", [String])
750
- ], UploadComponent.prototype, "saveField", null);
751
- tslib_1.__decorate([
752
- Input(),
753
- tslib_1.__metadata("design:type", HttpHeaders),
754
- tslib_1.__metadata("design:paramtypes", [HttpHeaders])
755
- ], UploadComponent.prototype, "saveHeaders", null);
756
- tslib_1.__decorate([
757
- Input(),
758
- tslib_1.__metadata("design:type", String),
759
- tslib_1.__metadata("design:paramtypes", [String])
760
- ], UploadComponent.prototype, "saveMethod", null);
761
- tslib_1.__decorate([
762
- Input(),
763
- tslib_1.__metadata("design:type", String),
764
- tslib_1.__metadata("design:paramtypes", [String])
765
- ], UploadComponent.prototype, "saveUrl", null);
766
- tslib_1.__decorate([
767
- Input(),
768
- tslib_1.__metadata("design:type", String),
769
- tslib_1.__metadata("design:paramtypes", [String])
770
- ], UploadComponent.prototype, "responseType", null);
771
- tslib_1.__decorate([
772
- Input(),
773
- tslib_1.__metadata("design:type", String),
774
- tslib_1.__metadata("design:paramtypes", [String])
775
- ], UploadComponent.prototype, "removeField", null);
776
- tslib_1.__decorate([
777
- Input(),
778
- tslib_1.__metadata("design:type", HttpHeaders),
779
- tslib_1.__metadata("design:paramtypes", [HttpHeaders])
780
- ], UploadComponent.prototype, "removeHeaders", null);
781
- tslib_1.__decorate([
782
- Input(),
783
- tslib_1.__metadata("design:type", String),
784
- tslib_1.__metadata("design:paramtypes", [String])
785
- ], UploadComponent.prototype, "removeMethod", null);
786
- tslib_1.__decorate([
787
- Input(),
788
- tslib_1.__metadata("design:type", String),
789
- tslib_1.__metadata("design:paramtypes", [String])
790
- ], UploadComponent.prototype, "removeUrl", null);
791
- tslib_1.__decorate([
792
- Input(),
793
- tslib_1.__metadata("design:type", Object)
794
- ], UploadComponent.prototype, "chunkable", void 0);
795
- tslib_1.__decorate([
796
- Input(),
797
- tslib_1.__metadata("design:type", Boolean),
798
- tslib_1.__metadata("design:paramtypes", [Boolean])
799
- ], UploadComponent.prototype, "concurrent", null);
800
- tslib_1.__decorate([
801
- Input(),
802
- tslib_1.__metadata("design:type", Boolean)
803
- ], UploadComponent.prototype, "multiple", void 0);
804
- tslib_1.__decorate([
805
- Input(),
806
- tslib_1.__metadata("design:type", Boolean)
807
- ], UploadComponent.prototype, "disabled", void 0);
808
- tslib_1.__decorate([
809
- Input(),
810
- tslib_1.__metadata("design:type", Boolean)
811
- ], UploadComponent.prototype, "showFileList", void 0);
812
- tslib_1.__decorate([
813
- Input(),
814
- tslib_1.__metadata("design:type", Number)
815
- ], UploadComponent.prototype, "tabindex", void 0);
816
- tslib_1.__decorate([
817
- Input(),
818
- tslib_1.__metadata("design:type", String)
819
- ], UploadComponent.prototype, "zoneId", void 0);
820
- tslib_1.__decorate([
821
- Input('tabIndex'),
822
- tslib_1.__metadata("design:type", Number),
823
- tslib_1.__metadata("design:paramtypes", [Number])
824
- ], UploadComponent.prototype, "tabIndex", null);
825
- tslib_1.__decorate([
826
- Input(),
827
- tslib_1.__metadata("design:type", String)
828
- ], UploadComponent.prototype, "accept", void 0);
829
- tslib_1.__decorate([
830
- Input(),
831
- tslib_1.__metadata("design:type", Object),
832
- tslib_1.__metadata("design:paramtypes", [Object])
833
- ], UploadComponent.prototype, "restrictions", null);
834
- tslib_1.__decorate([
835
- Input(),
836
- tslib_1.__metadata("design:type", String)
837
- ], UploadComponent.prototype, "focusableId", void 0);
838
- tslib_1.__decorate([
839
- Input(),
840
- tslib_1.__metadata("design:type", String)
841
- ], UploadComponent.prototype, "actionsLayout", void 0);
842
- tslib_1.__decorate([
843
- ContentChild(FileTemplateDirective, { static: false }),
844
- tslib_1.__metadata("design:type", FileTemplateDirective)
845
- ], UploadComponent.prototype, "fileTemplate", void 0);
846
- tslib_1.__decorate([
847
- ContentChild(FileInfoTemplateDirective, { static: false }),
848
- tslib_1.__metadata("design:type", FileInfoTemplateDirective)
849
- ], UploadComponent.prototype, "fileInfoTemplate", void 0);
850
- tslib_1.__decorate([
851
- ViewChild('fileSelect', { static: true }),
852
- tslib_1.__metadata("design:type", ElementRef)
853
- ], UploadComponent.prototype, "fileSelect", void 0);
854
- tslib_1.__decorate([
855
- ViewChild('fileSelectButton', { static: true }),
856
- tslib_1.__metadata("design:type", ElementRef)
857
- ], UploadComponent.prototype, "fileSelectButton", void 0);
858
- tslib_1.__decorate([
859
- Output('blur'),
860
- tslib_1.__metadata("design:type", EventEmitter)
861
- ], UploadComponent.prototype, "onBlur", void 0);
862
- tslib_1.__decorate([
863
- Output(),
864
- tslib_1.__metadata("design:type", EventEmitter)
865
- ], UploadComponent.prototype, "cancel", void 0);
866
- tslib_1.__decorate([
867
- Output(),
868
- tslib_1.__metadata("design:type", EventEmitter)
869
- ], UploadComponent.prototype, "clear", void 0);
870
- tslib_1.__decorate([
871
- Output(),
872
- tslib_1.__metadata("design:type", EventEmitter)
873
- ], UploadComponent.prototype, "complete", void 0);
874
- tslib_1.__decorate([
875
- Output(),
876
- tslib_1.__metadata("design:type", EventEmitter)
877
- ], UploadComponent.prototype, "error", void 0);
878
- tslib_1.__decorate([
879
- Output('focus'),
880
- tslib_1.__metadata("design:type", EventEmitter)
881
- ], UploadComponent.prototype, "onFocus", void 0);
882
- tslib_1.__decorate([
883
- Output(),
884
- tslib_1.__metadata("design:type", EventEmitter)
885
- ], UploadComponent.prototype, "pause", void 0);
886
- tslib_1.__decorate([
887
- Output(),
888
- tslib_1.__metadata("design:type", EventEmitter)
889
- ], UploadComponent.prototype, "remove", void 0);
890
- tslib_1.__decorate([
891
- Output(),
892
- tslib_1.__metadata("design:type", EventEmitter)
893
- ], UploadComponent.prototype, "resume", void 0);
894
- tslib_1.__decorate([
895
- Output(),
896
- tslib_1.__metadata("design:type", EventEmitter)
897
- ], UploadComponent.prototype, "select", void 0);
898
- tslib_1.__decorate([
899
- Output(),
900
- tslib_1.__metadata("design:type", EventEmitter)
901
- ], UploadComponent.prototype, "success", void 0);
902
- tslib_1.__decorate([
903
- Output(),
904
- tslib_1.__metadata("design:type", EventEmitter)
905
- ], UploadComponent.prototype, "upload", void 0);
906
- tslib_1.__decorate([
907
- Output(),
908
- tslib_1.__metadata("design:type", EventEmitter)
909
- ], UploadComponent.prototype, "uploadProgress", void 0);
910
- tslib_1.__decorate([
911
- Output(),
912
- tslib_1.__metadata("design:type", EventEmitter)
913
- ], UploadComponent.prototype, "valueChange", void 0);
914
- tslib_1.__decorate([
915
- HostBinding('class.k-widget'),
916
- HostBinding('class.k-upload'),
917
- tslib_1.__metadata("design:type", Boolean)
918
- ], UploadComponent.prototype, "hostDefaultClasses", void 0);
919
- tslib_1.__decorate([
920
- HostBinding('class.k-disabled'),
921
- tslib_1.__metadata("design:type", Boolean),
922
- tslib_1.__metadata("design:paramtypes", [])
923
- ], UploadComponent.prototype, "hostDisabledClass", null);
924
- tslib_1.__decorate([
925
- HostBinding('attr.dir'),
926
- tslib_1.__metadata("design:type", String),
927
- tslib_1.__metadata("design:paramtypes", [])
928
- ], UploadComponent.prototype, "dir", null);
929
- tslib_1.__decorate([
930
- HostListener('keydown', ['$event']),
931
- tslib_1.__metadata("design:type", Function),
932
- tslib_1.__metadata("design:paramtypes", [Object]),
933
- tslib_1.__metadata("design:returntype", void 0)
934
- ], UploadComponent.prototype, "handleKeydown", null);
935
- UploadComponent = UploadComponent_1 = tslib_1.__decorate([
936
- Component({
937
- exportAs: 'kendoUpload',
938
- providers: [
939
- LocalizationService,
940
- NavigationService,
941
- UploadService,
942
- DropZoneService,
943
- UPLOAD_VALUE_ACCESSOR,
944
- {
945
- provide: L10N_PREFIX,
946
- useValue: 'kendo.upload'
947
- },
948
- {
949
- provide: KendoInput,
950
- useExisting: forwardRef(function () { return UploadComponent_1; })
951
- }
952
- ],
953
- selector: 'kendo-upload',
954
- template: "\n <ng-container kendoUploadLocalizedMessages\n i18n-cancel=\"kendo.upload.cancel|The text for the Cancel button\"\n cancel=\"Cancel\"\n\n i18n-clearSelectedFiles=\"kendo.upload.clearSelectedFiles|The text for the Clear button\"\n clearSelectedFiles=\"Clear\"\n\n i18n-dropFilesHere=\"kendo.upload.dropFilesHere|The drop zone hint\"\n dropFilesHere=\"Drop files here to upload\"\n\n i18n-filesBatchStatus=\"kendo.upload.filesBatchStatus|The status message for a batch of files\"\n filesBatchStatus=\"files\"\n\n i18n-filesBatchStatusFailed=\"kendo.upload.filesBatchStatusFailed|The status message for a batch of files after failed upload\"\n filesBatchStatusFailed=\"files failed to upload.\"\n\n i18n-filesBatchStatusUploaded=\"kendo.upload.filesBatchStatusUploaded|The status message for a batch of files after successful upload\"\n filesBatchStatusUploaded=\"files successfully uploaded.\"\n\n i18n-fileStatusFailed=\"kendo.upload.fileStatusFailed|The file status message after failed upload\"\n fileStatusFailed=\"File failed to upload.\"\n\n i18n-fileStatusUploaded=\"kendo.upload.fileStatusUploaded|The file status message after successful upload\"\n fileStatusUploaded=\"File successfully uploaded.\"\n\n i18n-headerStatusPaused=\"kendo.upload.headerStatusPaused|The header status message when the file upload is paused\"\n headerStatusPaused=\"Paused\"\n\n i18n-headerStatusUploaded=\"kendo.upload.headerStatusUploaded|The header status message after file upload completion\"\n headerStatusUploaded=\"Done\"\n\n i18n-headerStatusUploading=\"kendo.upload.headerStatusUploading|The header status message during file upload\"\n headerStatusUploading=\"Uploading...\"\n\n i18n-invalidFileExtension=\"kendo.upload.invalidFileExtension|The text for the invalid allowed extensions restriction message\"\n invalidFileExtension=\"File type not allowed.\"\n\n i18n-invalidMaxFileSize=\"kendo.upload.invalidMaxFileSize|The text for the invalid max file size restriction message\"\n invalidMaxFileSize=\"File size too large.\"\n\n i18n-invalidMinFileSize=\"kendo.upload.invalidMinFileSize|The text for the invalid min file size restriction message\"\n invalidMinFileSize=\"File size too small.\"\n\n i18n-pause=\"kendo.upload.pause|The text for the Pause button\"\n pause=\"Pause\"\n\n i18n-remove=\"kendo.upload.remove|The text for the Remove button\"\n remove=\"Remove\"\n\n i18n-resume=\"kendo.upload.resume|The text for the Resume button\"\n resume=\"Resume\"\n\n i18n-retry=\"kendo.upload.retry|The text for the Retry button\"\n retry=\"Retry\"\n\n i18n-select=\"kendo.upload.select|The text for the Select button\"\n select=\"Select files...\"\n\n i18n-uploadSelectedFiles=\"kendo.upload.uploadSelectedFiles|The text for the Upload files button\"\n uploadSelectedFiles=\"Upload\"\n >\n </ng-container>\n <div kendoUploadInternalDropZone\n [restrictions]=\"restrictions\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\">\n <div role=\"button\" #fileSelectButton\n [id]=\"focusableId\"\n [attr.aria-label]=\"textFor('select')\"\n [attr.tabindex]=\"selectButtonTabIndex\"\n (focus)=\"onFileSelectButtonFocus($event)\"\n (blur)=\"onFileSelectButtonBlur($event)\"\n class=\"k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-upload-button\">\n <input #fileSelect kendoFileSelect\n [attr.accept]=\"accept ? accept : null\"\n [attr.aria-hidden]=\"true\"\n [dir]=\"direction\"\n [restrictions]=\"restrictions\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\" />\n <span>{{textFor('select')}}</span>\n </div>\n <kendo-upload-status-total *ngIf=\"showTotalStatus\"\n class=\"k-upload-status k-upload-status-total\"\n [fileList]=\"fileList\">\n </kendo-upload-status-total>\n <div class=\"k-dropzone-hint\">{{textFor('dropFilesHere')}}</div>\n </div>\n <ul kendo-upload-file-list *ngIf=\"showFileList && fileList.count > 0\"\n class=\"k-upload-files k-reset\"\n [disabled]=\"disabled\"\n [fileList]=\"fileList.files\"\n [fileTemplate]=\"fileTemplate\"\n [fileInfoTemplate]=\"fileInfoTemplate\">\n </ul>\n <kendo-upload-action-buttons\n *ngIf=\"showActionButtons\"\n [disabled]=\"disabled\"\n [actionsLayout]=\"actionsLayout\">\n </kendo-upload-action-buttons>\n "
955
- }),
956
- tslib_1.__metadata("design:paramtypes", [UploadService,
957
- LocalizationService,
958
- NavigationService,
959
- DropZoneService,
960
- NgZone,
961
- Renderer2,
962
- ChangeDetectorRef,
963
- ElementRef])
964
- ], UploadComponent);
965
- return UploadComponent;
966
- }());
967
- export { UploadComponent };