@progress/kendo-angular-upload 8.0.0-dev.202201111351 → 9.0.0-next.202202241540

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