@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,45 +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 { PreventableEvent } from './preventable-event';
7
- /**
8
- * Arguments for the `select` event. The `select` event fires when the user
9
- * selects a file or multiple files for upload. If you cancel the event, the selection is prevented.
10
- *
11
- * ```ts-no-run
12
- * @Component({
13
- * selector: 'my-upload',
14
- * template: `
15
- * <kendo-upload
16
- * [saveUrl]="uploadSaveUrl"
17
- * [removeUrl]="uploadRemoveUrl"
18
- * (select)="selectEventHandler($event)">
19
- * </kendo-upload>
20
- * `
21
- * })
22
- * export class UploadComponent {
23
- * uploadSaveUrl = 'saveUrl'; // should represent an actual API endpoint
24
- * uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
25
- *
26
- * selectEventHandler(e: SelectEvent) {
27
- * console.log('File selected');
28
- * }
29
- * }
30
- * ```
31
- */
32
- var SelectEvent = /** @class */ (function (_super) {
33
- tslib_1.__extends(SelectEvent, _super);
34
- /**
35
- * Constructs the event arguments for the `select` event.
36
- * @param files - The list of the selected files.
37
- */
38
- function SelectEvent(files) {
39
- var _this = _super.call(this) || this;
40
- _this.files = files;
41
- return _this;
42
- }
43
- return SelectEvent;
44
- }(PreventableEvent));
45
- export { SelectEvent };
@@ -1,49 +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 { PreventableEvent } from './preventable-event';
7
- /**
8
- * Arguments for the `success` event. The `success` event fires when
9
- * the selected files are successfully uploaded or removed.
10
- *
11
- * ```ts-no-run
12
- * @Component({
13
- * selector: 'my-upload',
14
- * template: `
15
- * <kendo-upload
16
- * [saveUrl]="uploadSaveUrl"
17
- * [removeUrl]="uploadRemoveUrl"
18
- * (success)="successEventHandler($event)">
19
- * </kendo-upload>
20
- * `
21
- * })
22
- * export class UploadComponent {
23
- * uploadSaveUrl = 'saveUrl'; // should represent an actual API endpoint
24
- * uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
25
- *
26
- * successEventHandler(e: SuccessEvent) {
27
- * console.log('The ' + e.operation + ' was successful!');
28
- * }
29
- * }
30
- * ```
31
- */
32
- var SuccessEvent = /** @class */ (function (_super) {
33
- tslib_1.__extends(SuccessEvent, _super);
34
- /**
35
- * Constructs the event arguments for the `success` event.
36
- * @param files - The list of the files that were uploaded or removed.
37
- * @param operation - The operation type (`upload` or `remove`).
38
- * @param response - The response object returned by the server.
39
- */
40
- function SuccessEvent(files, operation, response) {
41
- var _this = _super.call(this) || this;
42
- _this.files = files;
43
- _this.operation = operation;
44
- _this.response = response;
45
- return _this;
46
- }
47
- return SuccessEvent;
48
- }(PreventableEvent));
49
- export { SuccessEvent };
@@ -1,47 +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 { PreventableEvent } from './preventable-event';
7
- /**
8
- * Arguments for the `upload` event. The `upload` event fires when one or more files are about
9
- * to be uploaded. If you cancel the event, the upload is prevented. You can add headers to the request.
10
- *
11
- * ```ts-no-run
12
- * @Component({
13
- * selector: 'my-upload',
14
- * template: `
15
- * <kendo-upload
16
- * [saveUrl]="uploadSaveUrl"
17
- * [removeUrl]="uploadRemoveUrl"
18
- * (upload)="uploadEventHandler($event)">
19
- * </kendo-upload>
20
- * `
21
- * })
22
- * export class UploadComponent {
23
- * uploadSaveUrl = 'saveUrl'; // should represent an actual API endpoint
24
- * uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
25
- *
26
- * uploadEventHandler(e: UploadEvent) {
27
- * e.headers = e.headers.append('X-Foo', 'Bar');
28
- * }
29
- * }
30
- * ```
31
- */
32
- var UploadEvent = /** @class */ (function (_super) {
33
- tslib_1.__extends(UploadEvent, _super);
34
- /**
35
- * Constructs the event arguments for the `upload` event.
36
- * @param files - The list of the files that will be uploaded.
37
- * @param headers - The headers of the request.
38
- */
39
- function UploadEvent(files, headers) {
40
- var _this = _super.call(this) || this;
41
- _this.files = files;
42
- _this.headers = headers;
43
- return _this;
44
- }
45
- return UploadEvent;
46
- }(PreventableEvent));
47
- export { UploadEvent };
@@ -1,42 +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
- /**
6
- * Arguments for the `uploadprogress` event. The `uploadprogress` event
7
- * fires when the files are in the process of uploading.
8
- *
9
- * ```ts-no-run
10
- * @Component({
11
- * selector: 'my-upload',
12
- * template: `
13
- * <kendo-upload
14
- * [saveUrl]="uploadSaveUrl"
15
- * [removeUrl]="uploadRemoveUrl"
16
- * (uploadProgress)="uploadProgressEventHandler($event)">
17
- * </kendo-upload>
18
- * `
19
- * })
20
- * export class UploadComponent {
21
- * uploadSaveUrl = 'saveUrl'; // should represent an actual API endpoint
22
- * uploadRemoveUrl = 'removeUrl'; // should represent an actual API endpoint
23
- *
24
- * uploadProgressEventHandler(e: UploadProgressEvent) {
25
- * console.log(e.files[0].name + ' is ' + e.percentComplete + ' uploaded');
26
- * }
27
- * }
28
- * ```
29
- */
30
- var UploadProgressEvent = /** @class */ (function () {
31
- /**
32
- * Constructs the event arguments for the `uploadprogress` event.
33
- * @param files - The list of files that are being uploaded.
34
- * @param percentComplete - The portion that has been uploaded.
35
- */
36
- function UploadProgressEvent(files, percentComplete) {
37
- this.files = files;
38
- this.percentComplete = percentComplete;
39
- }
40
- return UploadProgressEvent;
41
- }());
42
- export { UploadProgressEvent };
@@ -1,141 +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 { Directive, ElementRef, HostBinding, HostListener, Input } from '@angular/core';
7
- import { NavigationService } from './navigation.service';
8
- import { UploadService } from './upload.service';
9
- import { assignGuidToFiles, inputFiles } from './common/util';
10
- import { validateFiles } from './common/validation-util';
11
- /**
12
- * @hidden
13
- */
14
- var FileSelectDirective = /** @class */ (function () {
15
- function FileSelectDirective(uploadService, navigation, el) {
16
- this.uploadService = uploadService;
17
- this.navigation = navigation;
18
- this.type = "file";
19
- this.autocomplete = "off";
20
- this.tabIndex = -1;
21
- this.element = el;
22
- }
23
- Object.defineProperty(FileSelectDirective.prototype, "nameAttribute", {
24
- get: function () {
25
- return this.uploadService.async.saveField;
26
- },
27
- enumerable: true,
28
- configurable: true
29
- });
30
- Object.defineProperty(FileSelectDirective.prototype, "multipleAttribute", {
31
- get: function () {
32
- return this.multiple ? "multiple" : null;
33
- },
34
- enumerable: true,
35
- configurable: true
36
- });
37
- Object.defineProperty(FileSelectDirective.prototype, "dirAttribute", {
38
- get: function () {
39
- return this.dir;
40
- },
41
- enumerable: true,
42
- configurable: true
43
- });
44
- Object.defineProperty(FileSelectDirective.prototype, "disabledAttribute", {
45
- get: function () {
46
- return this.disabled ? "true" : null;
47
- },
48
- enumerable: true,
49
- configurable: true
50
- });
51
- FileSelectDirective.prototype.onInputChange = function (event) {
52
- var _this = this;
53
- var ua = navigator.userAgent;
54
- var webkit = /(webkit)[ \/]([\w.]+)/i;
55
- var ie = /(windows)[ \/]([\w.]+)/i;
56
- var selectedFiles = inputFiles(event.target);
57
- selectedFiles = assignGuidToFiles(selectedFiles, !this.uploadService.async.batch);
58
- validateFiles(selectedFiles, this.restrictions);
59
- if (!this.multiple) {
60
- this.uploadService.clearFiles();
61
- }
62
- this.uploadService.addFiles(selectedFiles);
63
- /*
64
- Chrome, IE, Edge and Safari do not trigger a `change` event
65
- when a file with the same name is selected a number of consecutive times.
66
- As a workaround, clear the input value after handling the file.
67
- */
68
- var native = this.element.nativeElement;
69
- if (ua.match(webkit) || ua.match(ie)) {
70
- native.type = "";
71
- native.type = "file";
72
- }
73
- setTimeout(function () {
74
- _this.navigation.focusedIndex = -1;
75
- });
76
- };
77
- tslib_1.__decorate([
78
- Input(),
79
- tslib_1.__metadata("design:type", String)
80
- ], FileSelectDirective.prototype, "dir", void 0);
81
- tslib_1.__decorate([
82
- Input(),
83
- tslib_1.__metadata("design:type", Boolean)
84
- ], FileSelectDirective.prototype, "disabled", void 0);
85
- tslib_1.__decorate([
86
- Input(),
87
- tslib_1.__metadata("design:type", Boolean)
88
- ], FileSelectDirective.prototype, "multiple", void 0);
89
- tslib_1.__decorate([
90
- Input(),
91
- tslib_1.__metadata("design:type", Object)
92
- ], FileSelectDirective.prototype, "restrictions", void 0);
93
- tslib_1.__decorate([
94
- HostBinding("attr.type"),
95
- tslib_1.__metadata("design:type", String)
96
- ], FileSelectDirective.prototype, "type", void 0);
97
- tslib_1.__decorate([
98
- HostBinding("attr.autocomplete"),
99
- tslib_1.__metadata("design:type", String)
100
- ], FileSelectDirective.prototype, "autocomplete", void 0);
101
- tslib_1.__decorate([
102
- HostBinding("attr.tabindex"),
103
- tslib_1.__metadata("design:type", Number)
104
- ], FileSelectDirective.prototype, "tabIndex", void 0);
105
- tslib_1.__decorate([
106
- HostBinding("attr.name"),
107
- tslib_1.__metadata("design:type", String),
108
- tslib_1.__metadata("design:paramtypes", [])
109
- ], FileSelectDirective.prototype, "nameAttribute", null);
110
- tslib_1.__decorate([
111
- HostBinding("attr.multiple"),
112
- tslib_1.__metadata("design:type", String),
113
- tslib_1.__metadata("design:paramtypes", [])
114
- ], FileSelectDirective.prototype, "multipleAttribute", null);
115
- tslib_1.__decorate([
116
- HostBinding("attr.dir"),
117
- tslib_1.__metadata("design:type", String),
118
- tslib_1.__metadata("design:paramtypes", [])
119
- ], FileSelectDirective.prototype, "dirAttribute", null);
120
- tslib_1.__decorate([
121
- HostBinding("attr.disabled"),
122
- tslib_1.__metadata("design:type", String),
123
- tslib_1.__metadata("design:paramtypes", [])
124
- ], FileSelectDirective.prototype, "disabledAttribute", null);
125
- tslib_1.__decorate([
126
- HostListener("change", ["$event"]),
127
- tslib_1.__metadata("design:type", Function),
128
- tslib_1.__metadata("design:paramtypes", [Object]),
129
- tslib_1.__metadata("design:returntype", void 0)
130
- ], FileSelectDirective.prototype, "onInputChange", null);
131
- FileSelectDirective = tslib_1.__decorate([
132
- Directive({
133
- selector: '[kendoFileSelect]'
134
- }),
135
- tslib_1.__metadata("design:paramtypes", [UploadService,
136
- NavigationService,
137
- ElementRef])
138
- ], FileSelectDirective);
139
- return FileSelectDirective;
140
- }());
141
- export { FileSelectDirective };