@progress/kendo-vue-upload 5.3.0-dev.202410141143 → 5.3.0-develop.2

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 (293) hide show
  1. package/ExternalDropZone.js +8 -0
  2. package/ExternalDropZone.mjs +119 -0
  3. package/README.md +24 -32
  4. package/Upload.js +8 -0
  5. package/Upload.mjs +489 -0
  6. package/UploadActionButtons.js +8 -0
  7. package/UploadActionButtons.mjs +114 -0
  8. package/UploadAddButton.js +8 -0
  9. package/UploadAddButton.mjs +131 -0
  10. package/UploadDropZone.js +8 -0
  11. package/UploadDropZone.mjs +192 -0
  12. package/UploadInput.js +8 -0
  13. package/UploadInput.mjs +103 -0
  14. package/UploadList.js +8 -0
  15. package/UploadList.mjs +73 -0
  16. package/UploadListActionButton.js +8 -0
  17. package/UploadListActionButton.mjs +125 -0
  18. package/UploadListGroup.js +8 -0
  19. package/UploadListGroup.mjs +110 -0
  20. package/UploadListMultiItem.js +8 -0
  21. package/UploadListMultiItem.mjs +123 -0
  22. package/UploadListSingleItem.js +8 -0
  23. package/UploadListSingleItem.mjs +212 -0
  24. package/UploadNavigation.js +8 -0
  25. package/UploadNavigation.mjs +203 -0
  26. package/UploadStatus.js +8 -0
  27. package/UploadStatus.mjs +47 -0
  28. package/UploadUI.js +8 -0
  29. package/UploadUI.mjs +197 -0
  30. package/dist/cdn/js/kendo-vue-upload.js +8 -1
  31. package/index.d.mts +1092 -0
  32. package/index.d.ts +1092 -0
  33. package/index.js +8 -0
  34. package/index.mjs +27 -0
  35. package/interfaces/UploadFileStatus.js +8 -0
  36. package/interfaces/UploadFileStatus.mjs +11 -0
  37. package/messages/main.js +8 -0
  38. package/messages/main.mjs +54 -0
  39. package/package-metadata.js +8 -0
  40. package/package-metadata.mjs +18 -0
  41. package/package.json +27 -39
  42. package/utils/connectionUtils.js +8 -0
  43. package/utils/connectionUtils.mjs +48 -0
  44. package/utils/stateUtils.js +8 -0
  45. package/utils/stateUtils.mjs +55 -0
  46. package/utils/utils.js +8 -0
  47. package/utils/utils.mjs +69 -0
  48. package/utils/validationUtils.js +8 -0
  49. package/utils/validationUtils.mjs +22 -0
  50. package/dist/es/ExternalDropZone.d.ts +0 -121
  51. package/dist/es/ExternalDropZone.js +0 -171
  52. package/dist/es/Upload.d.ts +0 -50
  53. package/dist/es/Upload.js +0 -715
  54. package/dist/es/UploadActionButtons.d.ts +0 -59
  55. package/dist/es/UploadActionButtons.js +0 -160
  56. package/dist/es/UploadAddButton.d.ts +0 -65
  57. package/dist/es/UploadAddButton.js +0 -173
  58. package/dist/es/UploadDropZone.d.ts +0 -61
  59. package/dist/es/UploadDropZone.js +0 -272
  60. package/dist/es/UploadInput.d.ts +0 -60
  61. package/dist/es/UploadInput.js +0 -149
  62. package/dist/es/UploadList.d.ts +0 -58
  63. package/dist/es/UploadList.js +0 -102
  64. package/dist/es/UploadListActionButton.d.ts +0 -57
  65. package/dist/es/UploadListActionButton.js +0 -185
  66. package/dist/es/UploadListGroup.d.ts +0 -56
  67. package/dist/es/UploadListGroup.js +0 -157
  68. package/dist/es/UploadListMultiItem.d.ts +0 -44
  69. package/dist/es/UploadListMultiItem.js +0 -171
  70. package/dist/es/UploadListSingleItem.d.ts +0 -44
  71. package/dist/es/UploadListSingleItem.js +0 -261
  72. package/dist/es/UploadNavigation.d.ts +0 -46
  73. package/dist/es/UploadNavigation.js +0 -321
  74. package/dist/es/UploadStatus.d.ts +0 -53
  75. package/dist/es/UploadStatus.js +0 -63
  76. package/dist/es/UploadUI.d.ts +0 -81
  77. package/dist/es/UploadUI.js +0 -265
  78. package/dist/es/additionalTypes.ts +0 -21
  79. package/dist/es/interfaces/BaseUploadEvent.d.ts +0 -9
  80. package/dist/es/interfaces/BaseUploadEvent.js +0 -1
  81. package/dist/es/interfaces/FileGroup.d.ts +0 -7
  82. package/dist/es/interfaces/FileGroup.js +0 -1
  83. package/dist/es/interfaces/UploadActionsLayout.d.ts +0 -4
  84. package/dist/es/interfaces/UploadActionsLayout.js +0 -1
  85. package/dist/es/interfaces/UploadAdditionalData.d.ts +0 -6
  86. package/dist/es/interfaces/UploadAdditionalData.js +0 -1
  87. package/dist/es/interfaces/UploadAsyncProps.d.ts +0 -82
  88. package/dist/es/interfaces/UploadAsyncProps.js +0 -1
  89. package/dist/es/interfaces/UploadFileInfo.d.ts +0 -41
  90. package/dist/es/interfaces/UploadFileInfo.js +0 -1
  91. package/dist/es/interfaces/UploadFileRestrictions.d.ts +0 -19
  92. package/dist/es/interfaces/UploadFileRestrictions.js +0 -1
  93. package/dist/es/interfaces/UploadFileStatus.d.ts +0 -33
  94. package/dist/es/interfaces/UploadFileStatus.js +0 -34
  95. package/dist/es/interfaces/UploadHttpHeaders.d.ts +0 -6
  96. package/dist/es/interfaces/UploadHttpHeaders.js +0 -1
  97. package/dist/es/interfaces/UploadListItemProps.d.ts +0 -19
  98. package/dist/es/interfaces/UploadListItemProps.js +0 -1
  99. package/dist/es/interfaces/UploadOnAddEvent.d.ts +0 -15
  100. package/dist/es/interfaces/UploadOnAddEvent.js +0 -1
  101. package/dist/es/interfaces/UploadOnBeforeRemoveEvent.d.ts +0 -21
  102. package/dist/es/interfaces/UploadOnBeforeRemoveEvent.js +0 -1
  103. package/dist/es/interfaces/UploadOnBeforeUploadEvent.d.ts +0 -21
  104. package/dist/es/interfaces/UploadOnBeforeUploadEvent.js +0 -1
  105. package/dist/es/interfaces/UploadOnCancelEvent.d.ts +0 -10
  106. package/dist/es/interfaces/UploadOnCancelEvent.js +0 -1
  107. package/dist/es/interfaces/UploadOnProgressEvent.d.ts +0 -15
  108. package/dist/es/interfaces/UploadOnProgressEvent.js +0 -1
  109. package/dist/es/interfaces/UploadOnRemoveEvent.d.ts +0 -20
  110. package/dist/es/interfaces/UploadOnRemoveEvent.js +0 -1
  111. package/dist/es/interfaces/UploadOnStatusChangeEvent.d.ts +0 -20
  112. package/dist/es/interfaces/UploadOnStatusChangeEvent.js +0 -1
  113. package/dist/es/interfaces/UploadProps.d.ts +0 -118
  114. package/dist/es/interfaces/UploadProps.js +0 -1
  115. package/dist/es/interfaces/UploadResponse.d.ts +0 -25
  116. package/dist/es/interfaces/UploadResponse.js +0 -1
  117. package/dist/es/main.d.ts +0 -26
  118. package/dist/es/main.js +0 -10
  119. package/dist/es/messages/main.d.ts +0 -110
  120. package/dist/es/messages/main.js +0 -111
  121. package/dist/es/package-metadata.d.ts +0 -5
  122. package/dist/es/package-metadata.js +0 -11
  123. package/dist/es/utils/connectionUtils.d.ts +0 -17
  124. package/dist/es/utils/connectionUtils.js +0 -78
  125. package/dist/es/utils/stateUtils.d.ts +0 -26
  126. package/dist/es/utils/stateUtils.js +0 -83
  127. package/dist/es/utils/utils.d.ts +0 -17
  128. package/dist/es/utils/utils.js +0 -128
  129. package/dist/es/utils/validationUtils.d.ts +0 -7
  130. package/dist/es/utils/validationUtils.js +0 -53
  131. package/dist/esm/ExternalDropZone.d.ts +0 -121
  132. package/dist/esm/ExternalDropZone.js +0 -171
  133. package/dist/esm/Upload.d.ts +0 -50
  134. package/dist/esm/Upload.js +0 -715
  135. package/dist/esm/UploadActionButtons.d.ts +0 -59
  136. package/dist/esm/UploadActionButtons.js +0 -160
  137. package/dist/esm/UploadAddButton.d.ts +0 -65
  138. package/dist/esm/UploadAddButton.js +0 -173
  139. package/dist/esm/UploadDropZone.d.ts +0 -61
  140. package/dist/esm/UploadDropZone.js +0 -272
  141. package/dist/esm/UploadInput.d.ts +0 -60
  142. package/dist/esm/UploadInput.js +0 -149
  143. package/dist/esm/UploadList.d.ts +0 -58
  144. package/dist/esm/UploadList.js +0 -102
  145. package/dist/esm/UploadListActionButton.d.ts +0 -57
  146. package/dist/esm/UploadListActionButton.js +0 -185
  147. package/dist/esm/UploadListGroup.d.ts +0 -56
  148. package/dist/esm/UploadListGroup.js +0 -157
  149. package/dist/esm/UploadListMultiItem.d.ts +0 -44
  150. package/dist/esm/UploadListMultiItem.js +0 -171
  151. package/dist/esm/UploadListSingleItem.d.ts +0 -44
  152. package/dist/esm/UploadListSingleItem.js +0 -261
  153. package/dist/esm/UploadNavigation.d.ts +0 -46
  154. package/dist/esm/UploadNavigation.js +0 -321
  155. package/dist/esm/UploadStatus.d.ts +0 -53
  156. package/dist/esm/UploadStatus.js +0 -63
  157. package/dist/esm/UploadUI.d.ts +0 -81
  158. package/dist/esm/UploadUI.js +0 -265
  159. package/dist/esm/additionalTypes.ts +0 -21
  160. package/dist/esm/interfaces/BaseUploadEvent.d.ts +0 -9
  161. package/dist/esm/interfaces/BaseUploadEvent.js +0 -1
  162. package/dist/esm/interfaces/FileGroup.d.ts +0 -7
  163. package/dist/esm/interfaces/FileGroup.js +0 -1
  164. package/dist/esm/interfaces/UploadActionsLayout.d.ts +0 -4
  165. package/dist/esm/interfaces/UploadActionsLayout.js +0 -1
  166. package/dist/esm/interfaces/UploadAdditionalData.d.ts +0 -6
  167. package/dist/esm/interfaces/UploadAdditionalData.js +0 -1
  168. package/dist/esm/interfaces/UploadAsyncProps.d.ts +0 -82
  169. package/dist/esm/interfaces/UploadAsyncProps.js +0 -1
  170. package/dist/esm/interfaces/UploadFileInfo.d.ts +0 -41
  171. package/dist/esm/interfaces/UploadFileInfo.js +0 -1
  172. package/dist/esm/interfaces/UploadFileRestrictions.d.ts +0 -19
  173. package/dist/esm/interfaces/UploadFileRestrictions.js +0 -1
  174. package/dist/esm/interfaces/UploadFileStatus.d.ts +0 -33
  175. package/dist/esm/interfaces/UploadFileStatus.js +0 -34
  176. package/dist/esm/interfaces/UploadHttpHeaders.d.ts +0 -6
  177. package/dist/esm/interfaces/UploadHttpHeaders.js +0 -1
  178. package/dist/esm/interfaces/UploadListItemProps.d.ts +0 -19
  179. package/dist/esm/interfaces/UploadListItemProps.js +0 -1
  180. package/dist/esm/interfaces/UploadOnAddEvent.d.ts +0 -15
  181. package/dist/esm/interfaces/UploadOnAddEvent.js +0 -1
  182. package/dist/esm/interfaces/UploadOnBeforeRemoveEvent.d.ts +0 -21
  183. package/dist/esm/interfaces/UploadOnBeforeRemoveEvent.js +0 -1
  184. package/dist/esm/interfaces/UploadOnBeforeUploadEvent.d.ts +0 -21
  185. package/dist/esm/interfaces/UploadOnBeforeUploadEvent.js +0 -1
  186. package/dist/esm/interfaces/UploadOnCancelEvent.d.ts +0 -10
  187. package/dist/esm/interfaces/UploadOnCancelEvent.js +0 -1
  188. package/dist/esm/interfaces/UploadOnProgressEvent.d.ts +0 -15
  189. package/dist/esm/interfaces/UploadOnProgressEvent.js +0 -1
  190. package/dist/esm/interfaces/UploadOnRemoveEvent.d.ts +0 -20
  191. package/dist/esm/interfaces/UploadOnRemoveEvent.js +0 -1
  192. package/dist/esm/interfaces/UploadOnStatusChangeEvent.d.ts +0 -20
  193. package/dist/esm/interfaces/UploadOnStatusChangeEvent.js +0 -1
  194. package/dist/esm/interfaces/UploadProps.d.ts +0 -118
  195. package/dist/esm/interfaces/UploadProps.js +0 -1
  196. package/dist/esm/interfaces/UploadResponse.d.ts +0 -25
  197. package/dist/esm/interfaces/UploadResponse.js +0 -1
  198. package/dist/esm/main.d.ts +0 -26
  199. package/dist/esm/main.js +0 -10
  200. package/dist/esm/messages/main.d.ts +0 -110
  201. package/dist/esm/messages/main.js +0 -111
  202. package/dist/esm/package-metadata.d.ts +0 -5
  203. package/dist/esm/package-metadata.js +0 -11
  204. package/dist/esm/package.json +0 -3
  205. package/dist/esm/utils/connectionUtils.d.ts +0 -17
  206. package/dist/esm/utils/connectionUtils.js +0 -78
  207. package/dist/esm/utils/stateUtils.d.ts +0 -26
  208. package/dist/esm/utils/stateUtils.js +0 -83
  209. package/dist/esm/utils/utils.d.ts +0 -17
  210. package/dist/esm/utils/utils.js +0 -128
  211. package/dist/esm/utils/validationUtils.d.ts +0 -7
  212. package/dist/esm/utils/validationUtils.js +0 -53
  213. package/dist/npm/ExternalDropZone.d.ts +0 -121
  214. package/dist/npm/ExternalDropZone.js +0 -178
  215. package/dist/npm/Upload.d.ts +0 -50
  216. package/dist/npm/Upload.js +0 -722
  217. package/dist/npm/UploadActionButtons.d.ts +0 -59
  218. package/dist/npm/UploadActionButtons.js +0 -167
  219. package/dist/npm/UploadAddButton.d.ts +0 -65
  220. package/dist/npm/UploadAddButton.js +0 -180
  221. package/dist/npm/UploadDropZone.d.ts +0 -61
  222. package/dist/npm/UploadDropZone.js +0 -279
  223. package/dist/npm/UploadInput.d.ts +0 -60
  224. package/dist/npm/UploadInput.js +0 -156
  225. package/dist/npm/UploadList.d.ts +0 -58
  226. package/dist/npm/UploadList.js +0 -109
  227. package/dist/npm/UploadListActionButton.d.ts +0 -57
  228. package/dist/npm/UploadListActionButton.js +0 -192
  229. package/dist/npm/UploadListGroup.d.ts +0 -56
  230. package/dist/npm/UploadListGroup.js +0 -164
  231. package/dist/npm/UploadListMultiItem.d.ts +0 -44
  232. package/dist/npm/UploadListMultiItem.js +0 -178
  233. package/dist/npm/UploadListSingleItem.d.ts +0 -44
  234. package/dist/npm/UploadListSingleItem.js +0 -268
  235. package/dist/npm/UploadNavigation.d.ts +0 -46
  236. package/dist/npm/UploadNavigation.js +0 -328
  237. package/dist/npm/UploadStatus.d.ts +0 -53
  238. package/dist/npm/UploadStatus.js +0 -70
  239. package/dist/npm/UploadUI.d.ts +0 -81
  240. package/dist/npm/UploadUI.js +0 -272
  241. package/dist/npm/additionalTypes.ts +0 -21
  242. package/dist/npm/interfaces/BaseUploadEvent.d.ts +0 -9
  243. package/dist/npm/interfaces/BaseUploadEvent.js +0 -2
  244. package/dist/npm/interfaces/FileGroup.d.ts +0 -7
  245. package/dist/npm/interfaces/FileGroup.js +0 -2
  246. package/dist/npm/interfaces/UploadActionsLayout.d.ts +0 -4
  247. package/dist/npm/interfaces/UploadActionsLayout.js +0 -2
  248. package/dist/npm/interfaces/UploadAdditionalData.d.ts +0 -6
  249. package/dist/npm/interfaces/UploadAdditionalData.js +0 -2
  250. package/dist/npm/interfaces/UploadAsyncProps.d.ts +0 -82
  251. package/dist/npm/interfaces/UploadAsyncProps.js +0 -2
  252. package/dist/npm/interfaces/UploadFileInfo.d.ts +0 -41
  253. package/dist/npm/interfaces/UploadFileInfo.js +0 -2
  254. package/dist/npm/interfaces/UploadFileRestrictions.d.ts +0 -19
  255. package/dist/npm/interfaces/UploadFileRestrictions.js +0 -2
  256. package/dist/npm/interfaces/UploadFileStatus.d.ts +0 -33
  257. package/dist/npm/interfaces/UploadFileStatus.js +0 -37
  258. package/dist/npm/interfaces/UploadHttpHeaders.d.ts +0 -6
  259. package/dist/npm/interfaces/UploadHttpHeaders.js +0 -2
  260. package/dist/npm/interfaces/UploadListItemProps.d.ts +0 -19
  261. package/dist/npm/interfaces/UploadListItemProps.js +0 -2
  262. package/dist/npm/interfaces/UploadOnAddEvent.d.ts +0 -15
  263. package/dist/npm/interfaces/UploadOnAddEvent.js +0 -2
  264. package/dist/npm/interfaces/UploadOnBeforeRemoveEvent.d.ts +0 -21
  265. package/dist/npm/interfaces/UploadOnBeforeRemoveEvent.js +0 -2
  266. package/dist/npm/interfaces/UploadOnBeforeUploadEvent.d.ts +0 -21
  267. package/dist/npm/interfaces/UploadOnBeforeUploadEvent.js +0 -2
  268. package/dist/npm/interfaces/UploadOnCancelEvent.d.ts +0 -10
  269. package/dist/npm/interfaces/UploadOnCancelEvent.js +0 -2
  270. package/dist/npm/interfaces/UploadOnProgressEvent.d.ts +0 -15
  271. package/dist/npm/interfaces/UploadOnProgressEvent.js +0 -2
  272. package/dist/npm/interfaces/UploadOnRemoveEvent.d.ts +0 -20
  273. package/dist/npm/interfaces/UploadOnRemoveEvent.js +0 -2
  274. package/dist/npm/interfaces/UploadOnStatusChangeEvent.d.ts +0 -20
  275. package/dist/npm/interfaces/UploadOnStatusChangeEvent.js +0 -2
  276. package/dist/npm/interfaces/UploadProps.d.ts +0 -118
  277. package/dist/npm/interfaces/UploadProps.js +0 -2
  278. package/dist/npm/interfaces/UploadResponse.d.ts +0 -25
  279. package/dist/npm/interfaces/UploadResponse.js +0 -2
  280. package/dist/npm/main.d.ts +0 -26
  281. package/dist/npm/main.js +0 -27
  282. package/dist/npm/messages/main.d.ts +0 -110
  283. package/dist/npm/messages/main.js +0 -114
  284. package/dist/npm/package-metadata.d.ts +0 -5
  285. package/dist/npm/package-metadata.js +0 -14
  286. package/dist/npm/utils/connectionUtils.d.ts +0 -17
  287. package/dist/npm/utils/connectionUtils.js +0 -80
  288. package/dist/npm/utils/stateUtils.d.ts +0 -26
  289. package/dist/npm/utils/stateUtils.js +0 -85
  290. package/dist/npm/utils/utils.d.ts +0 -17
  291. package/dist/npm/utils/utils.js +0 -130
  292. package/dist/npm/utils/validationUtils.d.ts +0 -7
  293. package/dist/npm/utils/validationUtils.js +0 -55
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("@progress/kendo-vue-common"),a=require("./messages/main.js"),g=require("@progress/kendo-svg-icons"),v=require("./package-metadata.js"),D=require("@progress/kendo-vue-intl"),i=100,f=t.defineComponent({name:"KendoVueExternalDropZone",props:{id:String,tabIndex:Number,innerStyle:Object,uploadRef:[String,Function,Object],disabled:Boolean,customHint:[String,Function,Object],customNote:[String,Function,Object]},inject:{kendoLocalizationService:{default:null}},created(){n.validatePackage(v.packageMetadata),this.elementInterval=null,this.elementActive=!1,this.lastElementDragOverRef=null},data(){return{overDropZone:!1}},mounted(){this.externalDropZone=this.externalDropZoneRef},methods:{focus(){this.externalDropZone&&this.externalDropZone.focus&&this.externalDropZone.focus()},isDragOver(e){return new Date().getTime()-(e||new Date).getTime()>i},handleOnDrop(e){e.preventDefault();let o=e.dataTransfer.files,r=this.$parent.$refs[this.$props.uploadRef];o.length>0&&!this.$props.disabled&&r&&r.onAdd&&(e.preventDefault(),r.onAdd(o))},handleOnElementDragEnter(){this.elementActive=!0;const e=()=>{this.isDragOver(this.lastElementDragOver)&&(this.overDropZone=!1,this.elementActive=!1,clearInterval(this.elementInterval),this.elementInterval=null,this.lastElementDragOver=null)};this.elementInterval=setInterval(e,i)},handleOnElementDragOver(e){e.preventDefault(),this.lastElementDragOver=new Date,this.overDropZone=!0}},setup(){const e=t.ref(null),o=t.inject("kendoLocalizationService",{});return{externalDropZoneRef:e,kendoLocalizationService:o}},render(){const{customNote:e,customHint:o}=this.$props,r=D.provideLocalizationService(this),d=r.toLanguageString(a.dropZoneHint,a.messages[a.dropZoneHint]),c=r.toLanguageString(a.dropZoneNote,a.messages[a.dropZoneNote]),p=n.templateRendering.call(this,o,n.getListeners.call(this)),h=n.templateRendering.call(this,e,n.getListeners.call(this));let l;const u=t.createVNode("span",null,[d]);l=n.getTemplate.call(this,{h:t.h,template:p,defaultRendering:u});let s;const m=t.createVNode("span",null,[c]);return s=n.getTemplate.call(this,{h:t.h,template:h,defaultRendering:m}),t.createVNode("div",{ref:n.setRef(this,"externalDropZone"),id:this.$props.id,class:n.classNames("k-external-dropzone",{"k-external-dropzone-hover":this.overDropZone,"k-disabled":this.$props.disabled},this.$props.className),tabindex:n.getTabIndex(this.$props.tabIndex,this.$props.disabled,void 0),onDrop:this.handleOnDrop,onDragenter:this.handleOnElementDragEnter,onDragover:this.handleOnElementDragOver},[t.createVNode("div",{style:this.$props.innerStyle,class:"k-dropzone-inner"},[t.createVNode(n.Icon,{name:"upload",icon:g.uploadIcon,class:"k-dropzone-icon",size:"xxxlarge"},null),t.createVNode("span",{class:"k-dropzone-hint"},[l]),t.createVNode("span",{class:"k-dropzone-note"},[s])]),t.createVNode("div",{class:"k-upload"},null)])}});exports.ExternalDropZone=f;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { defineComponent as E, ref as O, inject as Z, createVNode as t, h as a } from "vue";
9
+ import { validatePackage as b, templateRendering as i, getListeners as s, getTemplate as p, setRef as z, classNames as k, getTabIndex as I, Icon as S } from "@progress/kendo-vue-common";
10
+ import { dropZoneHint as d, messages as c, dropZoneNote as h } from "./messages/main.mjs";
11
+ import { uploadIcon as R } from "@progress/kendo-svg-icons";
12
+ import { packageMetadata as $ } from "./package-metadata.mjs";
13
+ import { provideLocalizationService as T } from "@progress/kendo-vue-intl";
14
+ const m = 100, w = /* @__PURE__ */ E({
15
+ name: "KendoVueExternalDropZone",
16
+ props: {
17
+ id: String,
18
+ tabIndex: Number,
19
+ innerStyle: Object,
20
+ uploadRef: [String, Function, Object],
21
+ disabled: Boolean,
22
+ customHint: [String, Function, Object],
23
+ customNote: [String, Function, Object]
24
+ },
25
+ inject: {
26
+ kendoLocalizationService: {
27
+ default: null
28
+ }
29
+ },
30
+ created() {
31
+ b($), this.elementInterval = null, this.elementActive = !1, this.lastElementDragOverRef = null;
32
+ },
33
+ data() {
34
+ return {
35
+ overDropZone: !1
36
+ };
37
+ },
38
+ mounted() {
39
+ this.externalDropZone = this.externalDropZoneRef;
40
+ },
41
+ methods: {
42
+ focus() {
43
+ this.externalDropZone && this.externalDropZone.focus && this.externalDropZone.focus();
44
+ },
45
+ isDragOver(e) {
46
+ return (/* @__PURE__ */ new Date()).getTime() - (e || /* @__PURE__ */ new Date()).getTime() > m;
47
+ },
48
+ handleOnDrop(e) {
49
+ e.preventDefault();
50
+ let n = e.dataTransfer.files, o = this.$parent.$refs[this.$props.uploadRef];
51
+ n.length > 0 && !this.$props.disabled && o && o.onAdd && (e.preventDefault(), o.onAdd(n));
52
+ },
53
+ handleOnElementDragEnter() {
54
+ this.elementActive = !0;
55
+ const e = () => {
56
+ this.isDragOver(this.lastElementDragOver) && (this.overDropZone = !1, this.elementActive = !1, clearInterval(this.elementInterval), this.elementInterval = null, this.lastElementDragOver = null);
57
+ };
58
+ this.elementInterval = setInterval(e, m);
59
+ },
60
+ handleOnElementDragOver(e) {
61
+ e.preventDefault(), this.lastElementDragOver = /* @__PURE__ */ new Date(), this.overDropZone = !0;
62
+ }
63
+ },
64
+ setup() {
65
+ const e = O(null), n = Z("kendoLocalizationService", {});
66
+ return {
67
+ externalDropZoneRef: e,
68
+ kendoLocalizationService: n
69
+ };
70
+ },
71
+ render() {
72
+ const {
73
+ customNote: e,
74
+ customHint: n
75
+ } = this.$props, o = T(this), u = o.toLanguageString(d, c[d]), f = o.toLanguageString(h, c[h]), g = i.call(this, n, s.call(this)), D = i.call(this, e, s.call(this));
76
+ let r;
77
+ const v = t("span", null, [u]);
78
+ r = p.call(this, {
79
+ h: a,
80
+ template: g,
81
+ defaultRendering: v
82
+ });
83
+ let l;
84
+ const x = t("span", null, [f]);
85
+ return l = p.call(this, {
86
+ h: a,
87
+ template: D,
88
+ defaultRendering: x
89
+ }), t("div", {
90
+ ref: z(this, "externalDropZone"),
91
+ id: this.$props.id,
92
+ class: k("k-external-dropzone", {
93
+ "k-external-dropzone-hover": this.overDropZone,
94
+ "k-disabled": this.$props.disabled
95
+ }, this.$props.className),
96
+ tabindex: I(this.$props.tabIndex, this.$props.disabled, void 0),
97
+ onDrop: this.handleOnDrop,
98
+ onDragenter: this.handleOnElementDragEnter,
99
+ onDragover: this.handleOnElementDragOver
100
+ }, [t("div", {
101
+ style: this.$props.innerStyle,
102
+ class: "k-dropzone-inner"
103
+ }, [t(S, {
104
+ name: "upload",
105
+ icon: R,
106
+ class: "k-dropzone-icon",
107
+ size: "xxxlarge"
108
+ }, null), t("span", {
109
+ class: "k-dropzone-hint"
110
+ }, [r]), t("span", {
111
+ class: "k-dropzone-note"
112
+ }, [l])]), t("div", {
113
+ class: "k-upload"
114
+ }, null)]);
115
+ }
116
+ });
117
+ export {
118
+ w as ExternalDropZone
119
+ };
package/README.md CHANGED
@@ -1,54 +1,46 @@
1
- <a href="https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload&utm_content=banner" target="_blank">
1
+ <a href="https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-utils&utm_content=banner" target="_blank">
2
2
  <img src="https://www.telerik.com/kendo-vue-ui/npm-banner.svg" alt="Kendo UI for Vue NPM Banner">
3
3
  </a>
4
4
 
5
- ## Kendo UI for Vue Upload Component for Vue
5
+ ## Kendo UI for Vue Upload Package for Vue
6
6
 
7
7
  > **Important**
8
- > * This package is а part of [Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;a commercial UI library.
9
- > * You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Vue My License page](https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload).
10
- > * To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload). Doing so indicates that you [accept the Kendo UI for Vue License Agreement](https://www.telerik.com/purchase/license-agreement/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload).
11
- > * The 30-day free trial gives you access to all the Kendo UI for Vue components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Vue dev team!
12
8
  >
13
- > [Start using Kendo UI for Vue](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload) and speed up your development process!
14
-
15
- The Kendo UI for Vue Upload component helps users transfer files from their file systems to dedicated server handlers.
9
+ > - This package is а part of [Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)&mdash;a commercial UI library.
10
+ > - You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Vue My License page](https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload).
11
+ > - To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload). Doing so indicates that you [accept the Kendo UI for Vue License Agreement](https://www.telerik.com/kendo-vue-ui-develop/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload).
12
+ > - The 30-day free trial gives you access to all the Kendo UI for Vue components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Vue dev team!
13
+ >
14
+ > [Start using Kendo UI for Vue](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload) and speed up your development process!
16
15
 
17
16
  ## Vue Upload
18
17
 
19
18
  > Historically, all Kendo UI for Vue Native components support both **Vue 2** and **Vue 3**, however, Vue 2 is currently in its end-of-support phase till Nov 2024. After our last major release for 2024, Vue 2 will no longer be supported in the new versions of the Kendo UI for Vue components. Please check our [Vue 2 End of Support article](https://www.telerik.com/kendo-vue-ui/components/vue2-deprecation/) for more details.
20
19
 
21
- Among the features which the Kendo UI for Vue Upload component delivers are:
20
+ Among the many features which the Kendo UI for Vue Upload deliver are:
22
21
 
23
- * [Disabled Upload](https://www.telerik.com/kendo-vue-ui/components/upload/disabled-state/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;Completely disable the upload functionality in certain conditions.
24
- * [Modes of operation](https://www.telerik.com/kendo-vue-ui/components/upload/modes/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;Control which file types can be uploaded or execute follow-up logic based on certain scenario.
25
- * [Credentials and additional data](https://www.telerik.com/kendo-vue-ui/components/upload/credentials/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;Send cookies and/or headers for cross-site requests or additional data.
26
- * [File processing](https://www.telerik.com/kendo-vue-ui/components/upload/file-processing/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;Provides different configuration options for controlling the way files are processed during upload. For example, automatic upload, single or multiple files upload, or upload of batches of files.
27
- * [File restrictions](https://www.telerik.com/kendo-vue-ui/components/upload/restrictions/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;Restrict certain file uploads, based on their file size or extension.
28
- * [Dragging and dropping](https://www.telerik.com/kendo-vue-ui/components/upload/drag-and-drop/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;For easy use and delightful experiences, the component has built-in drag and drop functionality.
29
- * [Custom renderer](https://www.telerik.com/kendo-vue-ui/components/upload/custom-rendering/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;You can apply your own look and feel to the uploaded files list.
30
- * [Globalization](https://www.telerik.com/kendo-vue-ui/components/upload/globalization/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;By using the available globalization options in Kendo UI for Vue, you can translate the Upload messages by adapting them to specific culture locales.
31
- * [Keyboard navigation](https://www.telerik.com/kendo-vue-ui/components/upload/keyboard-navigation/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;Built-in keyboard shortcuts for usability and navigation in the component.
32
- * [Theme support](https://www.telerik.com/kendo-vue-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)&mdash;The Kendo UI for Vue Upload, as well as all 100+ components in the Kendo UI for Vue suite, are styled in four polished themes (Bootstrap, Material, Default and Fluent) and can be further customized to match your specific design guidelines.
22
+ - TODO 1
23
+ - TODO 2
24
+ - TODO 3
33
25
 
34
26
  ## Support Options
35
27
 
36
28
  For any issues you might encounter while working with the Kendo UI for Vue Upload, use any of the available support channels:
37
29
 
38
- * Industry-leading technical support&mdash;Kendo UI for Vue paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated Kendo UI for Vue support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload).
39
- * Product forums&mdash;The [Kendo UI for Vue forums](https://www.telerik.com/forums/kendo-ui-vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload) are part of the free support you can get from the community and from the Kendo UI for Vue team.
40
- * Feedback portal&mdash;The [Kendo UI for Vue feedback portal](https://feedback.telerik.com/kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload) is where you can request and vote for new features to be added.
30
+ - Industry-leading technical support&mdash;Kendo UI for Vue paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated Kendo UI for Vue support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload).
31
+ - Product forums&mdash;The [Kendo UI for Vue forums](https://www.telerik.com/forums/kendo-ui-vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload) are part of the free support you can get from the community and from the Kendo UI for Vue team.
32
+ - Feedback portal&mdash;The [Kendo UI for Vue feedback portal](https://feedback.telerik.com/kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload) is where you can request and vote for new features to be added.
41
33
 
42
34
  ## Resources
43
35
 
44
- * [Getting Started with Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
45
- * [Get Started with the Kendo UI for Vue Upload](https://www.telerik.com/kendo-vue-ui/components/upload/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
46
- * [API Reference of the Kendo UI for Vue Upload](https://www.telerik.com/kendo-vue-ui/components/upload/api/UploadProps/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
47
- * [Kendo UI for Vue Roadmap](https://www.telerik.com/kendo-vue-ui/roadmap/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
48
- * [Blogs](https://www.telerik.com/blogs/tag/vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
49
- * [Demos, documentation, and component reference](https://www.telerik.com/kendo-vue-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
50
- * [Kendo UI for Vue pricing and licensing](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-upload)
36
+ - [Getting Started with Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
37
+ - [Getting Started with the Kendo UI for Vue Upload](https://www.telerik.com/kendo-vue-ui/components/upload/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
38
+ - [API Reference of the Kendo UI for Vue Upload](https://www.telerik.com/kendo-vue-ui/components/upload/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
39
+ - [Kendo UI for Vue Roadmap](https://www.telerik.com/kendo-vue-ui/roadmap/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
40
+ - [Blogs](https://www.telerik.com/blogs/tag/vue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
41
+ - [Demos, documentation, and component reference](https://www.telerik.com/kendo-vue-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
42
+ - [Kendo UI for Vue pricing and licensing](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npmupload)
51
43
 
52
- *Copyright © 2023 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
44
+ _Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved._
53
45
 
54
- *Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
46
+ _Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries._
package/Upload.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vue"),f=require("@progress/kendo-vue-common"),p=require("./interfaces/UploadFileStatus.js"),w=require("./UploadNavigation.js"),v=require("axios"),S=require("./utils/utils.js"),r=require("./utils/stateUtils.js"),d=require("./utils/connectionUtils.js"),A=require("./utils/validationUtils.js"),q=require("./package-metadata.js"),N=g.defineComponent({name:"KendoVueUpload",props:{autoUpload:{type:Boolean,default:!0},batch:{type:Boolean,default:!1},withCredentials:{type:Boolean,default:!0},saveField:{type:String,default:function(){return"files"}},saveHeaders:{type:[String,Function,Object],default:function(){return{}}},saveMethod:{type:String,default:function(){return"POST"}},saveUrl:{type:[String,Function],default:function(){return""}},responseType:{type:String,default:function(){return"json"}},removeField:{type:String,default:function(){return"fileNames"}},removeHeaders:{type:[String,Function,Object],default:function(){return{}}},removeMethod:{type:String,default:function(){return"POST"}},removeUrl:{type:[String,Function],default:function(){return""}},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},showActionButtons:{type:Boolean,default:!0},actionsLayout:{type:String,default:function(){return"end"}},tabIndex:Number,accept:String,list:[String,Function,Object],restrictions:{type:Object,default:function(){return{allowedExtensions:[],maxFileSize:0,minFileSize:0}}},validateFile:Function,files:Array,defaultFiles:Array},emits:{add:null,beforeremove:null,beforeupload:null,cancel:null,statuschange:null,progress:null,remove:null},created(){this._httpSubscriptions={},f.validatePackage(q.packageMetadata),this.$props.defaultFiles&&(this.currentFiles=this.$props.defaultFiles)},data(){return{currentFiles:[]}},computed:{computedAsync(){const{autoUpload:s,batch:e,removeField:t,removeHeaders:i,removeMethod:n,removeUrl:o,responseType:a,saveField:u,saveHeaders:h,saveMethod:c,saveUrl:l,withCredentials:F}=this.$props;return{autoUpload:s,batch:e,removeField:t,removeHeaders:i,removeMethod:n,removeUrl:o,responseType:a,saveField:u,saveHeaders:h,saveMethod:c,saveUrl:l,withCredentials:F}},computedFiles(){return(this.isControlled?this.$props.files:this.currentFiles)||[]},isControlled(){return!this.$props.defaultFiles},isCustomSave(){return this.$props.saveUrl&&typeof this.$props.saveUrl=="function"},isCustomRemove(){return this.$props.removeUrl&&typeof this.$props.removeUrl=="function"},fileStateCopy(){return r.copyState(this.computedFiles)},actionElement(){if(this._uploadNavigation)return this._uploadNavigation.actionElement}},mounted(){this._uploadNavigation=this.uploadNavigationRef},methods:{focus(){this._uploadNavigation&&this._uploadNavigation.focus()},uploadFiles(s){const e=this.computedAsync;r.setFilesStatus(s,p.UploadFileStatus.Uploading),r.groupForEach(s,(t,i)=>{const n=d.cloneRequestHeaders(e.saveHeaders||{}),a={target:this,files:t,headers:n,additionalData:{}};this.$emit("beforeupload",a);const u=d.populateRequestOptions(a.headers,this.computedAsync),h=d.populateUploadFormData(t,e.saveField,a.additionalData);if(this.isCustomSave)this.$props.saveUrl(t,{formData:h,requestOptions:u},this.onUploadProgress).then(c=>this.onUploadSuccess(c.uid)).catch(c=>this.onUploadError(c.uid));else{const c=v.CancelToken.source();this._httpSubscriptions[i]=c,v({method:e.saveMethod,url:e.saveUrl,data:h,cancelToken:c.token,...u,onUploadProgress:l=>this.onUploadProgress(i,l)}).then(l=>this.onUploadSuccess(i,l)).catch(l=>this.onUploadError(i,l))}})},removeFiles(s){const e=this.computedAsync;r.groupForEach(s,(t,i)=>{const n=d.cloneRequestHeaders(e.removeHeaders||{}),a={target:this,files:t,headers:n,additionalData:{}};this.$emit("beforeremove",a);const u=t.map(l=>l.name),h=d.populateRequestOptions(a.headers,this.computedAsync),c=d.populateRemoveFormData(u,e.removeField,a.additionalData);this.isCustomRemove?this.$props.removeUrl(t,{formData:c,requestOptions:h}).then(l=>this.onRemoveSuccess(l.uid)).catch(l=>this.onRemoveError(l.uid)):v({method:e.removeMethod,url:e.removeUrl,data:c,...h}).then(l=>this.onRemoveSuccess(i,l)).catch(l=>this.onRemoveError(i,l))})},onUpload(){const s=this.fileStateCopy,e=r.groupFilesByUid(s),t=r.filesForUpload(e);this.uploadFiles(t);const i=()=>{const n={target:this,newState:s,affectedFiles:r.flatFileGroup(t)};this.$emit("statuschange",n)};this.isControlled||(this.currentFiles=s),i()},onAdd(s){let e=S.getAllFileInfo(s),t;if(e=S.assignGuidToFiles(e,this.computedAsync.batch),A.validateFiles(e,this.$props.restrictions,this.validateFile),this.$props.multiple?t=this.fileStateCopy:t=[],r.addMany(e,t),this.computedAsync.autoUpload){const n=r.groupFilesByUid(t);this.uploadFiles(r.filesForUpload(n))}const i=()=>{const n={target:this,newState:t,affectedFiles:e};this.$emit("add",n)};this.isControlled||(this.currentFiles=t),i()},onUploadProgress(s,e){const t=e.total?Math.round(100*e.loaded/e.total):0,i=this.fileStateCopy,n=i.filter(a=>a.uid===s);if(!n.length)return;n.forEach(a=>{a.progress=t});const o=()=>{const a={target:this,newState:i,affectedFiles:n};this.$emit("progress",a)};this.isControlled||(this.currentFiles=i),o()},onUploadSuccess(s,e){const t=this.fileStateCopy,i=t.filter(o=>o.uid===s);i.forEach(o=>{o.status=p.UploadFileStatus.Uploaded}),delete this._httpSubscriptions[s];const n=()=>{const o={target:this,newState:t,affectedFiles:i,response:e?d.convertAxiosResponse(e):void 0};this.$emit("statuschange",o)};this.isControlled||(this.currentFiles=t),n()},onUploadError(s,e){const t=this.fileStateCopy,i=t.filter(o=>o.uid===s);if(i.forEach(o=>{o.status=p.UploadFileStatus.UploadFailed}),delete this._httpSubscriptions[s],!i.length)return;const n=()=>{const o={target:this,newState:t,affectedFiles:i,response:e?d.convertAxiosResponse(e):void 0};this.$emit("statuschange",o)};this.isControlled||(this.currentFiles=t),n()},onRemove(s){const e=this.fileStateCopy,t=e.filter(o=>o.uid===s),i=e.filter(o=>o.uid!==s),n=[p.UploadFileStatus.Uploaded,p.UploadFileStatus.Initial,p.UploadFileStatus.RemoveFailed];if(t[0]&&n.indexOf(t[0].status)>-1){const o={[s]:t};r.setFilesStatus(o,p.UploadFileStatus.Removing),this.removeFiles(o);const a=()=>{const u={target:this,newState:e,affectedFiles:t};this.$emit("statuschange",u)};this.isControlled||(this.currentFiles=e),a()}else{const o=()=>{const a={target:this,newState:i,affectedFiles:t};this.$emit("remove",a)};this.isControlled||(this.currentFiles=i),o()}},onRemoveSuccess(s,e){const t=this.fileStateCopy,i=t.filter(a=>a.uid===s),n=t.filter(a=>a.uid!==s),o=()=>{const a={target:this,newState:n,affectedFiles:i,response:e?d.convertAxiosResponse(e):void 0};this.$emit("remove",a)};this.isControlled||(this.currentFiles=n),o()},onRemoveError(s,e){const t=this.fileStateCopy,i=t.filter(o=>o.uid===s);i.forEach(o=>{o.status=p.UploadFileStatus.RemoveFailed});const n=()=>{const o={target:this,newState:t,affectedFiles:i,response:e?d.convertAxiosResponse(e):void 0};this.$emit("statuschange",o)};this.isControlled||(this.currentFiles=t),n()},onRetry(s){const e=this.fileStateCopy,t=r.groupFilesByUid(e.filter(n=>n.uid===s));r.setFilesStatus(t,p.UploadFileStatus.Uploading),this.uploadFiles(t);const i=()=>{const n={target:this,newState:e,affectedFiles:r.flatFileGroup(t)};this.$emit("statuschange",n)};this.isControlled||(this.currentFiles=e),i()},onCancel(s){const e=this.fileStateCopy,t=e.filter(a=>a.uid!==s),i=e.filter(a=>a.uid===s);this._httpSubscriptions[s]&&(this._httpSubscriptions[s].cancel(),delete this._httpSubscriptions[s]);const n={target:this,uid:s};this.$emit("cancel",n);const o=()=>{const a={target:this,newState:t,affectedFiles:i};this.$emit("remove",a)};this.isControlled||(this.currentFiles=e),o()},onClear(){if(!this.computedFiles.length)return;Object.keys(this._httpSubscriptions).forEach(e=>{this._httpSubscriptions[e].cancel()}),this._httpSubscriptions={};const s=()=>{const e={target:this,newState:[],affectedFiles:this.fileStateCopy};this.$emit("remove",e)};this.isControlled||(this.currentFiles=[]),s()}},render(){const{showFileList:s,autoUpload:e,showActionButtons:t,actionsLayout:i,tabIndex:n,disabled:o,batch:a,withCredentials:u,saveField:h,saveHeaders:c,saveMethod:l,saveUrl:F,responseType:O,removeField:_,removeHeaders:B,removeMethod:T,removeUrl:M,multiple:y,accept:U,restrictions:C,files:R,defaultFiles:b}=this.$props,$=f.templateRendering.call(this,this.$props.list,f.getListeners.call(this)),m=r.groupFilesByUid(this.computedFiles),E=r.filesForUpload(m);return g.createVNode(w.UploadNavigation,{groupedFiles:m,className:this.$props.className,showFileList:s&&!!Object.keys(m).length,showActionButtons:t&&!e&&!!Object.keys(E).length,actionsLayout:i,disabled:o,onAdd:this.onAdd,onRemove:this.onRemove,onClear:this.onClear,onUpload:this.onUpload,onRetry:this.onRetry,onCancel:this.onCancel,tabIndex:f.getTabIndex(n,o),ref:D=>{this.uploadNavigationRef=D},multiple:y,accept:U,list:$,restrictions:C,files:R,defaultFiles:b,async:this.computedAsync},null)}});exports.Upload=N;