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

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 +32 -102
  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,143 +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 core_1 = require("@angular/core");
9
- var navigation_service_1 = require("./navigation.service");
10
- var upload_service_1 = require("./upload.service");
11
- var util_1 = require("./common/util");
12
- var validation_util_1 = require("./common/validation-util");
13
- /**
14
- * @hidden
15
- */
16
- var FileSelectDirective = /** @class */ (function () {
17
- function FileSelectDirective(uploadService, navigation, el) {
18
- this.uploadService = uploadService;
19
- this.navigation = navigation;
20
- this.type = "file";
21
- this.autocomplete = "off";
22
- this.tabIndex = -1;
23
- this.element = el;
24
- }
25
- Object.defineProperty(FileSelectDirective.prototype, "nameAttribute", {
26
- get: function () {
27
- return this.uploadService.async.saveField;
28
- },
29
- enumerable: true,
30
- configurable: true
31
- });
32
- Object.defineProperty(FileSelectDirective.prototype, "multipleAttribute", {
33
- get: function () {
34
- return this.multiple ? "multiple" : null;
35
- },
36
- enumerable: true,
37
- configurable: true
38
- });
39
- Object.defineProperty(FileSelectDirective.prototype, "dirAttribute", {
40
- get: function () {
41
- return this.dir;
42
- },
43
- enumerable: true,
44
- configurable: true
45
- });
46
- Object.defineProperty(FileSelectDirective.prototype, "disabledAttribute", {
47
- get: function () {
48
- return this.disabled ? "true" : null;
49
- },
50
- enumerable: true,
51
- configurable: true
52
- });
53
- FileSelectDirective.prototype.onInputChange = function (event) {
54
- var _this = this;
55
- var ua = navigator.userAgent;
56
- var webkit = /(webkit)[ \/]([\w.]+)/i;
57
- var ie = /(windows)[ \/]([\w.]+)/i;
58
- var selectedFiles = util_1.inputFiles(event.target);
59
- selectedFiles = util_1.assignGuidToFiles(selectedFiles, !this.uploadService.async.batch);
60
- validation_util_1.validateFiles(selectedFiles, this.restrictions);
61
- if (!this.multiple) {
62
- this.uploadService.clearFiles();
63
- }
64
- this.uploadService.addFiles(selectedFiles);
65
- /*
66
- Chrome, IE, Edge and Safari do not trigger a `change` event
67
- when a file with the same name is selected a number of consecutive times.
68
- As a workaround, clear the input value after handling the file.
69
- */
70
- var native = this.element.nativeElement;
71
- if (ua.match(webkit) || ua.match(ie)) {
72
- native.type = "";
73
- native.type = "file";
74
- }
75
- setTimeout(function () {
76
- _this.navigation.focusedIndex = -1;
77
- });
78
- };
79
- tslib_1.__decorate([
80
- core_1.Input(),
81
- tslib_1.__metadata("design:type", String)
82
- ], FileSelectDirective.prototype, "dir", void 0);
83
- tslib_1.__decorate([
84
- core_1.Input(),
85
- tslib_1.__metadata("design:type", Boolean)
86
- ], FileSelectDirective.prototype, "disabled", void 0);
87
- tslib_1.__decorate([
88
- core_1.Input(),
89
- tslib_1.__metadata("design:type", Boolean)
90
- ], FileSelectDirective.prototype, "multiple", void 0);
91
- tslib_1.__decorate([
92
- core_1.Input(),
93
- tslib_1.__metadata("design:type", Object)
94
- ], FileSelectDirective.prototype, "restrictions", void 0);
95
- tslib_1.__decorate([
96
- core_1.HostBinding("attr.type"),
97
- tslib_1.__metadata("design:type", String)
98
- ], FileSelectDirective.prototype, "type", void 0);
99
- tslib_1.__decorate([
100
- core_1.HostBinding("attr.autocomplete"),
101
- tslib_1.__metadata("design:type", String)
102
- ], FileSelectDirective.prototype, "autocomplete", void 0);
103
- tslib_1.__decorate([
104
- core_1.HostBinding("attr.tabindex"),
105
- tslib_1.__metadata("design:type", Number)
106
- ], FileSelectDirective.prototype, "tabIndex", void 0);
107
- tslib_1.__decorate([
108
- core_1.HostBinding("attr.name"),
109
- tslib_1.__metadata("design:type", String),
110
- tslib_1.__metadata("design:paramtypes", [])
111
- ], FileSelectDirective.prototype, "nameAttribute", null);
112
- tslib_1.__decorate([
113
- core_1.HostBinding("attr.multiple"),
114
- tslib_1.__metadata("design:type", String),
115
- tslib_1.__metadata("design:paramtypes", [])
116
- ], FileSelectDirective.prototype, "multipleAttribute", null);
117
- tslib_1.__decorate([
118
- core_1.HostBinding("attr.dir"),
119
- tslib_1.__metadata("design:type", String),
120
- tslib_1.__metadata("design:paramtypes", [])
121
- ], FileSelectDirective.prototype, "dirAttribute", null);
122
- tslib_1.__decorate([
123
- core_1.HostBinding("attr.disabled"),
124
- tslib_1.__metadata("design:type", String),
125
- tslib_1.__metadata("design:paramtypes", [])
126
- ], FileSelectDirective.prototype, "disabledAttribute", null);
127
- tslib_1.__decorate([
128
- core_1.HostListener("change", ["$event"]),
129
- tslib_1.__metadata("design:type", Function),
130
- tslib_1.__metadata("design:paramtypes", [Object]),
131
- tslib_1.__metadata("design:returntype", void 0)
132
- ], FileSelectDirective.prototype, "onInputChange", null);
133
- FileSelectDirective = tslib_1.__decorate([
134
- core_1.Directive({
135
- selector: '[kendoFileSelect]'
136
- }),
137
- tslib_1.__metadata("design:paramtypes", [upload_service_1.UploadService,
138
- navigation_service_1.NavigationService,
139
- core_1.ElementRef])
140
- ], FileSelectDirective);
141
- return FileSelectDirective;
142
- }());
143
- exports.FileSelectDirective = FileSelectDirective;
@@ -1,486 +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 core_1 = require("@angular/core");
9
- var forms_1 = require("@angular/forms");
10
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
11
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
12
- var rxjs_1 = require("rxjs");
13
- var operators_1 = require("rxjs/operators");
14
- var kendo_licensing_1 = require("@progress/kendo-licensing");
15
- var package_metadata_1 = require("./package-metadata");
16
- var upload_service_1 = require("./upload.service");
17
- var navigation_service_1 = require("./navigation.service");
18
- var util_1 = require("./common/util");
19
- var file_template_directive_1 = require("./templates/file-template.directive");
20
- var file_state_1 = require("./types/file-state");
21
- var dropzone_service_1 = require("./dropzone.service");
22
- var file_info_template_directive_1 = require("./templates/file-info-template.directive");
23
- /**
24
- * @hidden
25
- */
26
- exports.FILESELECT_VALUE_ACCESSOR = {
27
- multi: true,
28
- provide: forms_1.NG_VALUE_ACCESSOR,
29
- useExisting: core_1.forwardRef(function () { return FileSelectComponent; }) // tslint:disable-line:no-forward-ref
30
- };
31
- var FileSelectComponent = /** @class */ (function () {
32
- function FileSelectComponent(uploadService, localization, navigation, dropZoneService, ngZone, renderer, cdr, wrapper) {
33
- var _this = this;
34
- this.uploadService = uploadService;
35
- this.localization = localization;
36
- this.navigation = navigation;
37
- this.dropZoneService = dropZoneService;
38
- this.ngZone = ngZone;
39
- this.renderer = renderer;
40
- this.cdr = cdr;
41
- /**
42
- * Disables the FileSelect.
43
- * The default value is `false`.
44
- */
45
- this.disabled = false;
46
- /**
47
- * Enables the selection of multiple files
48
- * ([see example]({% slug fileprocessing_upload %}#toc-upload-of-sinlge-or-multiple-files)).
49
- * If set to `false`, only one file can be selected at a time.
50
- */
51
- this.multiple = true;
52
- /**
53
- * Toggles the visibility of the file list.
54
- */
55
- this.showFileList = true;
56
- /**
57
- * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the FileSelect.
58
- */
59
- this.tabindex = 0;
60
- /**
61
- * @hidden
62
- */
63
- this.focusableId = "k-" + kendo_angular_common_1.guid();
64
- /**
65
- * Fires when the user navigates outside the component.
66
- */
67
- this.onBlur = new core_1.EventEmitter();
68
- /**
69
- * Fires when the component is focused.
70
- */
71
- this.onFocus = new core_1.EventEmitter();
72
- /**
73
- * Fires when files are selected. If prevented, the selected files will not be added to the list.
74
- */
75
- this.select = new core_1.EventEmitter();
76
- /**
77
- * Fires when a file is about to be removed. If prevented, the file will remain in the list.
78
- */
79
- this.remove = new core_1.EventEmitter();
80
- /**
81
- * Fires when the value of the component has changed as a result of a successful `select` or `remove` operation.
82
- */
83
- this.valueChange = new core_1.EventEmitter();
84
- this.hostDefaultClasses = true;
85
- /**
86
- * @hidden
87
- */
88
- this._restrictions = {
89
- allowedExtensions: [],
90
- maxFileSize: 0,
91
- minFileSize: 0
92
- };
93
- this.onTouchedCallback = function (_) { };
94
- this.onChangeCallback = function (_) { };
95
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
96
- this.wrapper = wrapper.nativeElement;
97
- this.direction = localization.rtl ? 'rtl' : 'ltr';
98
- this.navigation.computeKeys(this.direction);
99
- this.fileList = this.uploadService.files;
100
- this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
101
- var rtl = _a.rtl;
102
- _this.direction = rtl ? 'rtl' : 'ltr';
103
- _this.navigation.computeKeys(_this.direction);
104
- });
105
- this.subscribeBlur();
106
- this.subscribeFocus();
107
- this.attachEventHandlers();
108
- this.setDefaultSettings();
109
- }
110
- FileSelectComponent_1 = FileSelectComponent;
111
- Object.defineProperty(FileSelectComponent.prototype, "name", {
112
- get: function () {
113
- return this.uploadService.async.saveField;
114
- },
115
- /**
116
- * Sets the `name` attribute of the `input` element of the FileSelect.
117
- */
118
- set: function (name) {
119
- this.uploadService.async.saveField = name;
120
- },
121
- enumerable: true,
122
- configurable: true
123
- });
124
- Object.defineProperty(FileSelectComponent.prototype, "restrictions", {
125
- get: function () {
126
- return this._restrictions;
127
- },
128
- /**
129
- * Sets the restrictions for selected files.
130
- */
131
- set: function (restrictions) {
132
- var parsedRestrictions = Object.assign({}, this._restrictions, restrictions);
133
- this._restrictions = parsedRestrictions;
134
- },
135
- enumerable: true,
136
- configurable: true
137
- });
138
- Object.defineProperty(FileSelectComponent.prototype, "hostDisabledClass", {
139
- get: function () {
140
- return this.disabled;
141
- },
142
- enumerable: true,
143
- configurable: true
144
- });
145
- Object.defineProperty(FileSelectComponent.prototype, "dir", {
146
- get: function () {
147
- return this.direction;
148
- },
149
- enumerable: true,
150
- configurable: true
151
- });
152
- FileSelectComponent.prototype.ngOnInit = function () {
153
- this.renderer.removeAttribute(this.wrapper, "tabindex");
154
- if (this.zoneId) {
155
- this.dropZoneService.addComponent(this, this.zoneId);
156
- }
157
- };
158
- /**
159
- * @hidden
160
- */
161
- FileSelectComponent.prototype.textFor = function (key) {
162
- return this.localization.get(key);
163
- };
164
- /**
165
- * Focuses the underlying input element.
166
- */
167
- FileSelectComponent.prototype.focus = function () {
168
- var _this = this;
169
- setTimeout(function () {
170
- _this.fileSelectButton.nativeElement.focus();
171
- });
172
- };
173
- FileSelectComponent.prototype.ngOnDestroy = function () {
174
- this.fileList.clear();
175
- if (this.blurSubscription) {
176
- this.blurSubscription.unsubscribe();
177
- }
178
- if (this.wrapperFocusSubscription) {
179
- this.wrapperFocusSubscription.unsubscribe();
180
- }
181
- if (this.selectButtonFocusSubscription) {
182
- this.selectButtonFocusSubscription.unsubscribe();
183
- }
184
- if (this.localizationChangeSubscription) {
185
- this.localizationChangeSubscription.unsubscribe();
186
- }
187
- if (this.subs) {
188
- this.subs.unsubscribe();
189
- }
190
- };
191
- /**
192
- * @hidden
193
- */
194
- FileSelectComponent.prototype.handleKeydown = function (event) {
195
- if (this.disabled) {
196
- return;
197
- }
198
- if ((event.keyCode === kendo_angular_common_1.Keys.Enter || event.keyCode === kendo_angular_common_1.Keys.Space) &&
199
- event.target === this.fileSelectButton.nativeElement) {
200
- event.preventDefault();
201
- this.fileSelect.nativeElement.click();
202
- return;
203
- }
204
- if (util_1.hasClasses(event.target, util_1.UPLOAD_CLASSES) ||
205
- (!util_1.isFocusable(event.target) && !util_1.hasClasses(event.target, util_1.IGNORE_TARGET_CLASSES))) {
206
- this.navigation.process(event);
207
- }
208
- };
209
- /**
210
- * @hidden
211
- */
212
- FileSelectComponent.prototype.writeValue = function (newValue) {
213
- var isValid = true;
214
- if (newValue instanceof Array) {
215
- newValue.forEach(function (file) {
216
- if (!util_1.validateInitialFileSelectFile(file)) {
217
- isValid = false;
218
- }
219
- });
220
- if (isValid) {
221
- this.uploadService.addInitialFileSelectFiles(newValue);
222
- }
223
- }
224
- if (newValue === null) {
225
- this.fileList.clear();
226
- }
227
- this.cdr.markForCheck();
228
- };
229
- /**
230
- * @hidden
231
- */
232
- FileSelectComponent.prototype.registerOnChange = function (fn) {
233
- this.onChangeCallback = fn;
234
- };
235
- /**
236
- * @hidden
237
- */
238
- FileSelectComponent.prototype.registerOnTouched = function (fn) {
239
- this.onTouchedCallback = fn;
240
- };
241
- /**
242
- * @hidden
243
- */
244
- FileSelectComponent.prototype.setDisabledState = function (isDisabled) {
245
- this.disabled = isDisabled;
246
- };
247
- /**
248
- * Removes specific file from the file list.
249
- */
250
- FileSelectComponent.prototype.removeFileByUid = function (uid) {
251
- this.uploadService.removeFiles(uid);
252
- };
253
- /**
254
- * Visually clears all files from the UI.
255
- */
256
- FileSelectComponent.prototype.clearFiles = function () {
257
- this.uploadService.clearFiles();
258
- };
259
- /**
260
- * @hidden
261
- * Used to determine if the component is empty.
262
- */
263
- FileSelectComponent.prototype.isEmpty = function () {
264
- return false;
265
- };
266
- /**
267
- * @hidden
268
- * Used by the external dropzone to add files to the FileSelect
269
- */
270
- FileSelectComponent.prototype.addFiles = function (files) {
271
- this.uploadService.addFiles(files);
272
- };
273
- Object.defineProperty(FileSelectComponent.prototype, "selectButtonTabIndex", {
274
- /**
275
- * @hidden
276
- */
277
- get: function () {
278
- return this.disabled ? undefined : this.tabindex;
279
- },
280
- enumerable: true,
281
- configurable: true
282
- });
283
- /**
284
- * @hidden
285
- */
286
- FileSelectComponent.prototype.onFileSelectButtonFocus = function (_event) {
287
- this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
288
- if (!this.navigation.focused) {
289
- this.navigation.focusedIndex = -1;
290
- }
291
- };
292
- /**
293
- * @hidden
294
- */
295
- FileSelectComponent.prototype.onFileSelectButtonBlur = function (_event) {
296
- this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
297
- };
298
- FileSelectComponent.prototype.subscribeBlur = function () {
299
- var _this = this;
300
- if (!kendo_angular_common_1.isDocumentAvailable()) {
301
- return;
302
- }
303
- this.ngZone.runOutsideAngular(function () {
304
- _this.documentClick = rxjs_1.fromEvent(document, 'click').pipe(operators_1.filter(function (event) {
305
- return !(_this.wrapper !== event.target && _this.wrapper.contains(event.target));
306
- }));
307
- _this.blurSubscription = rxjs_1.merge(_this.documentClick, _this.navigation.onTab).subscribe(function () {
308
- if (_this.navigation.focused) {
309
- _this.ngZone.run(function () {
310
- _this.navigation.focused = false;
311
- _this.onTouchedCallback();
312
- _this.onBlur.emit();
313
- });
314
- }
315
- });
316
- });
317
- };
318
- FileSelectComponent.prototype.subscribeFocus = function () {
319
- var _this = this;
320
- this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(function () {
321
- _this.onFocus.emit();
322
- });
323
- this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(function () {
324
- _this.fileSelectButton.nativeElement.focus();
325
- });
326
- };
327
- FileSelectComponent.prototype.attachEventHandlers = function () {
328
- var _this = this;
329
- this.subs = this.uploadService.changeEvent.subscribe(function (files) {
330
- var model = [];
331
- if (files !== null) {
332
- files.forEach(function (file) {
333
- if (file.state === file_state_1.FileState.Initial) {
334
- model.push(file);
335
- }
336
- if (file.state === file_state_1.FileState.Selected && file.rawFile && !file.validationErrors) {
337
- model.push(file.rawFile);
338
- }
339
- });
340
- }
341
- if (model.length === 0) {
342
- model = null;
343
- }
344
- _this.onChangeCallback(model);
345
- _this.valueChange.emit(model);
346
- });
347
- this.subs.add(this.uploadService.removeEvent.subscribe(function (args) {
348
- _this.remove.emit(args);
349
- }));
350
- this.subs.add(this.uploadService.selectEvent.subscribe(function (args) {
351
- _this.select.emit(args);
352
- }));
353
- };
354
- FileSelectComponent.prototype.setDefaultSettings = function () {
355
- this.uploadService.async.autoUpload = false;
356
- this.uploadService.component = 'FileSelect';
357
- };
358
- var FileSelectComponent_1;
359
- tslib_1.__decorate([
360
- core_1.Input(),
361
- tslib_1.__metadata("design:type", String)
362
- ], FileSelectComponent.prototype, "accept", void 0);
363
- tslib_1.__decorate([
364
- core_1.Input(),
365
- tslib_1.__metadata("design:type", Boolean)
366
- ], FileSelectComponent.prototype, "disabled", void 0);
367
- tslib_1.__decorate([
368
- core_1.Input(),
369
- tslib_1.__metadata("design:type", Boolean)
370
- ], FileSelectComponent.prototype, "multiple", void 0);
371
- tslib_1.__decorate([
372
- core_1.Input(),
373
- tslib_1.__metadata("design:type", String),
374
- tslib_1.__metadata("design:paramtypes", [String])
375
- ], FileSelectComponent.prototype, "name", null);
376
- tslib_1.__decorate([
377
- core_1.Input(),
378
- tslib_1.__metadata("design:type", Boolean)
379
- ], FileSelectComponent.prototype, "showFileList", void 0);
380
- tslib_1.__decorate([
381
- core_1.Input(),
382
- tslib_1.__metadata("design:type", Number)
383
- ], FileSelectComponent.prototype, "tabindex", void 0);
384
- tslib_1.__decorate([
385
- core_1.Input(),
386
- tslib_1.__metadata("design:type", Object),
387
- tslib_1.__metadata("design:paramtypes", [Object])
388
- ], FileSelectComponent.prototype, "restrictions", null);
389
- tslib_1.__decorate([
390
- core_1.Input(),
391
- tslib_1.__metadata("design:type", String)
392
- ], FileSelectComponent.prototype, "zoneId", void 0);
393
- tslib_1.__decorate([
394
- core_1.Input(),
395
- tslib_1.__metadata("design:type", String)
396
- ], FileSelectComponent.prototype, "focusableId", void 0);
397
- tslib_1.__decorate([
398
- core_1.ContentChild(file_template_directive_1.FileTemplateDirective, { static: false }),
399
- tslib_1.__metadata("design:type", file_template_directive_1.FileTemplateDirective)
400
- ], FileSelectComponent.prototype, "fileTemplate", void 0);
401
- tslib_1.__decorate([
402
- core_1.ContentChild(file_info_template_directive_1.FileInfoTemplateDirective, { static: false }),
403
- tslib_1.__metadata("design:type", file_info_template_directive_1.FileInfoTemplateDirective)
404
- ], FileSelectComponent.prototype, "fileInfoTemplate", void 0);
405
- tslib_1.__decorate([
406
- core_1.ViewChild('fileSelect', { static: true }),
407
- tslib_1.__metadata("design:type", core_1.ElementRef)
408
- ], FileSelectComponent.prototype, "fileSelect", void 0);
409
- tslib_1.__decorate([
410
- core_1.ViewChild('fileSelectButton', { static: true }),
411
- tslib_1.__metadata("design:type", core_1.ElementRef)
412
- ], FileSelectComponent.prototype, "fileSelectButton", void 0);
413
- tslib_1.__decorate([
414
- core_1.Output('blur'),
415
- tslib_1.__metadata("design:type", core_1.EventEmitter)
416
- ], FileSelectComponent.prototype, "onBlur", void 0);
417
- tslib_1.__decorate([
418
- core_1.Output('focus'),
419
- tslib_1.__metadata("design:type", core_1.EventEmitter)
420
- ], FileSelectComponent.prototype, "onFocus", void 0);
421
- tslib_1.__decorate([
422
- core_1.Output(),
423
- tslib_1.__metadata("design:type", core_1.EventEmitter)
424
- ], FileSelectComponent.prototype, "select", void 0);
425
- tslib_1.__decorate([
426
- core_1.Output(),
427
- tslib_1.__metadata("design:type", core_1.EventEmitter)
428
- ], FileSelectComponent.prototype, "remove", void 0);
429
- tslib_1.__decorate([
430
- core_1.Output(),
431
- tslib_1.__metadata("design:type", core_1.EventEmitter)
432
- ], FileSelectComponent.prototype, "valueChange", void 0);
433
- tslib_1.__decorate([
434
- core_1.HostBinding('class.k-widget'),
435
- core_1.HostBinding('class.k-upload'),
436
- tslib_1.__metadata("design:type", Boolean)
437
- ], FileSelectComponent.prototype, "hostDefaultClasses", void 0);
438
- tslib_1.__decorate([
439
- core_1.HostBinding('class.k-disabled'),
440
- tslib_1.__metadata("design:type", Boolean),
441
- tslib_1.__metadata("design:paramtypes", [])
442
- ], FileSelectComponent.prototype, "hostDisabledClass", null);
443
- tslib_1.__decorate([
444
- core_1.HostBinding('attr.dir'),
445
- tslib_1.__metadata("design:type", String),
446
- tslib_1.__metadata("design:paramtypes", [])
447
- ], FileSelectComponent.prototype, "dir", null);
448
- tslib_1.__decorate([
449
- core_1.HostListener('keydown', ['$event']),
450
- tslib_1.__metadata("design:type", Function),
451
- tslib_1.__metadata("design:paramtypes", [Object]),
452
- tslib_1.__metadata("design:returntype", void 0)
453
- ], FileSelectComponent.prototype, "handleKeydown", null);
454
- FileSelectComponent = FileSelectComponent_1 = tslib_1.__decorate([
455
- core_1.Component({
456
- exportAs: 'kendoFileSelect',
457
- providers: [
458
- kendo_angular_l10n_1.LocalizationService,
459
- navigation_service_1.NavigationService,
460
- upload_service_1.UploadService,
461
- dropzone_service_1.DropZoneService,
462
- exports.FILESELECT_VALUE_ACCESSOR,
463
- {
464
- provide: kendo_angular_l10n_1.L10N_PREFIX,
465
- useValue: 'kendo.fileselect'
466
- },
467
- {
468
- provide: kendo_angular_common_1.KendoInput,
469
- useExisting: core_1.forwardRef(function () { return FileSelectComponent_1; })
470
- }
471
- ],
472
- selector: 'kendo-fileselect',
473
- template: "\n <ng-container kendoFileSelectLocalizedMessages\n i18n-dropFilesHere=\"kendo.fileselect.dropFilesHere|The drop zone hint\"\n dropFilesHere=\"Drop files here to select\"\n\n i18n-invalidFileExtension=\"kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message\"\n invalidFileExtension=\"File type not allowed.\"\n\n i18n-invalidMaxFileSize=\"kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message\"\n invalidMaxFileSize=\"File size too large.\"\n\n i18n-invalidMinFileSize=\"kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message\"\n invalidMinFileSize=\"File size too small.\"\n\n i18n-remove=\"kendo.fileselect.remove|The text for the Remove button\"\n remove=\"Remove\"\n\n i18n-select=\"kendo.fileselect.select|The text for the Select button\"\n select=\"Select files...\"\n >\n </ng-container>\n <div kendoFileSelectInternalDropZone\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 [dir]=\"direction\"\n [restrictions]=\"restrictions\"\n [multiple]=\"multiple\"\n [disabled]=\"disabled\" />\n <span>{{textFor('select')}}</span>\n </div>\n <div class=\"k-dropzone-hint\">{{textFor('dropFilesHere')}}</div>\n </div>\n <ul kendo-upload-file-list\n class=\"k-upload-files k-reset\"\n *ngIf=\"showFileList && fileList.count > 0\"\n [disabled]=\"disabled\"\n [fileList]=\"fileList.files\"\n [fileTemplate]=\"fileTemplate\"\n [fileInfoTemplate]=\"fileInfoTemplate\">\n </ul>\n "
474
- }),
475
- tslib_1.__metadata("design:paramtypes", [upload_service_1.UploadService,
476
- kendo_angular_l10n_1.LocalizationService,
477
- navigation_service_1.NavigationService,
478
- dropzone_service_1.DropZoneService,
479
- core_1.NgZone,
480
- core_1.Renderer2,
481
- core_1.ChangeDetectorRef,
482
- core_1.ElementRef])
483
- ], FileSelectComponent);
484
- return FileSelectComponent;
485
- }());
486
- exports.FileSelectComponent = FileSelectComponent;
@@ -1,32 +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 core_1 = require("@angular/core");
9
- var fileselect_component_1 = require("./fileselect.component");
10
- var shared_module_1 = require("./shared.module");
11
- var FILESELECT_DECLARATIONS = [
12
- fileselect_component_1.FileSelectComponent
13
- ];
14
- /**
15
- * Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the FileSelect component.
16
- */
17
- var FileSelectModule = /** @class */ (function () {
18
- function FileSelectModule() {
19
- }
20
- FileSelectModule = tslib_1.__decorate([
21
- core_1.NgModule({
22
- declarations: [FILESELECT_DECLARATIONS],
23
- exports: [
24
- shared_module_1.PUBLIC_DIRECTIVES,
25
- FILESELECT_DECLARATIONS
26
- ],
27
- imports: [shared_module_1.SharedModule]
28
- })
29
- ], FileSelectModule);
30
- return FileSelectModule;
31
- }());
32
- exports.FileSelectModule = FileSelectModule;