@progress/kendo-vue-upload 10.2.0-develop.9 → 11.0.0
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.
- package/NOTICE.txt +17 -17
- package/README.md +1 -1
- package/Upload.d.ts +2 -2
- package/Upload.js +1 -1
- package/Upload.mjs +63 -65
- package/dist/cdn/js/kendo-vue-upload.js +1 -1
- package/interfaces/UploadAsyncProps.d.ts +4 -3
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +7 -7
- package/utils/connectionUtils.d.ts +1 -0
- package/utils/connectionUtils.js +1 -1
- package/utils/connectionUtils.mjs +46 -33
- package/EULA.pdf +0 -0
- package/EULA.rtf +0 -2730
package/NOTICE.txt
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
Progress Kendo UI for Vue 2026
|
|
2
|
+
Progress Kendo UI for Vue 2026 Updated November 2026
|
|
3
3
|
|
|
4
4
|
----------------------------------------------------------------------------------------------------------------------------
|
|
5
5
|
NOTICES REPORT
|
|
6
6
|
----------------------------------------------------------------------------------------------------------------------------
|
|
7
7
|
|
|
8
8
|
Portions of the Products include certain open source and commercial third-party components listed below ("Third-Party
|
|
9
|
-
Components"). The authors of the Third-Party Components require Progress Software Corporation ("PSC") to include
|
|
10
|
-
following notices and additional licensing terms as a condition of PSC's use of such Third-Party Components. You
|
|
11
|
-
acknowledge that the authors of the Third-Party Components have no obligation to provide support to you for the Third-
|
|
12
|
-
Components or the Product. You hereby undertake to comply with all licenses related to the applicable Third-Party
|
|
9
|
+
Components"). The authors of the Third-Party Components require Progress Software Corporation ("PSC") to include
|
|
10
|
+
the following notices and additional licensing terms as a condition of PSC's use of such Third-Party Components. You
|
|
11
|
+
acknowledge that the authors of the Third-Party Components have no obligation to provide support to you for the Third-
|
|
12
|
+
Party Components or the Product. You hereby undertake to comply with all licenses related to the applicable Third-Party
|
|
13
13
|
Components. Notwithstanding anything to the contrary, to the extent that any of the terms and conditions of the Progress
|
|
14
|
-
Agreement conflict, vary, or are in addition to the terms and conditions of the aforementioned third-party licenses for
|
|
15
|
-
technologies, such terms and conditions are offered by PSC alone and not by any other party.
|
|
14
|
+
Agreement conflict, vary, or are in addition to the terms and conditions of the aforementioned third-party licenses for
|
|
15
|
+
these technologies, such terms and conditions are offered by PSC alone and not by any other party.
|
|
16
16
|
|
|
17
17
|
----------------------------------------------------------------------------------------------------------------------------
|
|
18
18
|
Report Content
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
GENERATIVE ARTIFICIAL INTELLIGENCE INTEGRATION
|
|
29
29
|
If the Software documentation specifies integration with some form of generative artificial intelligence (AI), then the
|
|
30
30
|
Software will include a configuration to connect to AI. You acknowledge that a separate license or subscription access
|
|
31
|
-
to AI governed by the terms and conditions of a license agreement from AI licensor will be required for use and access
|
|
32
|
-
AI capabilities integrated with the Software. You will be responsible to comply with the terms of such license agreement
|
|
31
|
+
to AI governed by the terms and conditions of a license agreement from AI licensor will be required for use and access
|
|
32
|
+
of AI capabilities integrated with the Software. You will be responsible to comply with the terms of such license agreement
|
|
33
33
|
for a valid use of AI. You acknowledge and accept that Progress is not a party to the license agreement between You
|
|
34
34
|
and AI licensor for AI use, and as a result Progress does not have any control over AI and its availability, and Progress
|
|
35
35
|
disclaims any and all liabilities for any output, error, damages, loss, etc., or any other result of Your use of AI
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
----------------------------------------------------------------------------------------------------------------------------
|
|
39
39
|
|
|
40
|
-
NOTICE FROM PROGRESS SOFTWARE CORPORATION: Additional notices may be included in the release notes or
|
|
41
|
-
documentation that accompanies updates received in connection with support of the Product.
|
|
40
|
+
NOTICE FROM PROGRESS SOFTWARE CORPORATION: Additional notices may be included in the release notes or
|
|
41
|
+
other documentation that accompanies updates received in connection with support of the Product.
|
|
42
42
|
|
|
43
43
|
----------------------------------------------------------------------------------------------------------------------------
|
|
44
44
|
|
|
@@ -52,9 +52,9 @@ Components:
|
|
|
52
52
|
| | readme | |
|
|
53
53
|
| @progress/pako-esm 1.0.1 | https://github.com/telerik/pako-esm#r | MIT License |
|
|
54
54
|
| | eadme | |
|
|
55
|
-
| prosemirror-commands 1.7.
|
|
55
|
+
| prosemirror-commands 1.7.2 | https://github.com/prosemirror/prosem | MIT License |
|
|
56
56
|
| | irror-commands#readme | |
|
|
57
|
-
| prosemirror-dropcursor 1.8.
|
|
57
|
+
| prosemirror-dropcursor 1.8.3 | https://github.com/prosemirror/prosem | MIT License |
|
|
58
58
|
| | irror-dropcursor#readme | |
|
|
59
59
|
| prosemirror-gapcursor 1.4.1 | https://github.com/prosemirror/prosem | MIT License |
|
|
60
60
|
| | irror-gapcursor#readme | |
|
|
@@ -64,7 +64,7 @@ Components:
|
|
|
64
64
|
| | irror-inputrules#readme | |
|
|
65
65
|
| prosemirror-keymap 1.2.3 | https://github.com/prosemirror/prosem | MIT License |
|
|
66
66
|
| | irror-keymap#readme | |
|
|
67
|
-
| prosemirror-model 1.25.
|
|
67
|
+
| prosemirror-model 1.25.12 | https://github.com/prosemirror/prosem | MIT License |
|
|
68
68
|
| | irror-model#readme | |
|
|
69
69
|
| prosemirror-schema-list 1.5.1 | https://github.com/prosemirror/prosem | MIT License |
|
|
70
70
|
| | irror-schema-list#readme | |
|
|
@@ -72,9 +72,9 @@ Components:
|
|
|
72
72
|
| | irror-state#readme | |
|
|
73
73
|
| prosemirror-tables 1.8.5 | https://github.com/prosemirror/prosem | MIT License |
|
|
74
74
|
| | irror-tables#readme | |
|
|
75
|
-
| prosemirror-transform 1.
|
|
75
|
+
| prosemirror-transform 1.12.1 | https://github.com/prosemirror/prosem | MIT License |
|
|
76
76
|
| | irror-transform#readme | |
|
|
77
|
-
| prosemirror-view 1.
|
|
77
|
+
| prosemirror-view 1.42.5 | https://github.com/prosemirror/prosem | MIT License |
|
|
78
78
|
| | irror-view#readme | |
|
|
79
79
|
| -------------------------------------- | ------------------------------------- | ---------------------------------------- |
|
|
80
80
|
|
|
@@ -269,7 +269,7 @@ third-party archives.
|
|
|
269
269
|
---
|
|
270
270
|
|
|
271
271
|
MIT License
|
|
272
|
-
(@progress/jszip-esm 1.0.4, @progress/pako-esm 1.0.1, prosemirror-commands 1.7.
|
|
272
|
+
(@progress/jszip-esm 1.0.4, @progress/pako-esm 1.0.1, prosemirror-commands 1.7.2, prosemirror-dropcursor 1.8.3, prosemirror-gapcursor 1.4.1, prosemirror-history 1.5.0, prosemirror-inputrules 1.5.1, prosemirror-keymap 1.2.3, prosemirror-model 1.25.12, prosemirror-schema-list 1.5.1, prosemirror-state 1.4.4, prosemirror-tables 1.8.5, prosemirror-transform 1.12.1, prosemirror-view 1.42.5)
|
|
273
273
|
|
|
274
274
|
The MIT License
|
|
275
275
|
===============
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Among the many features which the Kendo UI for Vue Upload component delivers are
|
|
|
23
23
|
|
|
24
24
|
* [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)—Completely disable the upload functionality in certain conditions.
|
|
25
25
|
* [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)—Control which file types can be uploaded or execute follow-up logic based on certain scenario.
|
|
26
|
-
* [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)—
|
|
26
|
+
* [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)—Configure credentials for cross-origin requests, custom headers, or additional data.
|
|
27
27
|
* [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)—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.
|
|
28
28
|
* [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)—Restrict certain file uploads, based on their file size or extension.
|
|
29
29
|
* [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)—For easy use and delightful experiences, the component has built-in drag and drop functionality.
|
package/Upload.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ declare const Upload: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
30
30
|
};
|
|
31
31
|
withCredentials: {
|
|
32
32
|
type: PropType<boolean>;
|
|
33
|
-
default:
|
|
33
|
+
default: any;
|
|
34
34
|
};
|
|
35
35
|
saveField: {
|
|
36
36
|
type: PropType<string>;
|
|
@@ -178,7 +178,7 @@ declare const Upload: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
178
178
|
};
|
|
179
179
|
withCredentials: {
|
|
180
180
|
type: PropType<boolean>;
|
|
181
|
-
default:
|
|
181
|
+
default: any;
|
|
182
182
|
};
|
|
183
183
|
saveField: {
|
|
184
184
|
type: PropType<string>;
|
package/Upload.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vue"),v=require("@progress/kendo-vue-common"),h=require("./interfaces/UploadFileStatus.js"),T=require("./UploadNavigation.js"),S=require("./utils/utils.js"),u=require("./utils/stateUtils.js"),d=require("./utils/connectionUtils.js"),q=require("./utils/validationUtils.js"),D=require("./package-metadata.js"),x=g.defineComponent({name:"KendoVueUpload",props:{autoUpload:{type:Boolean,default:!0},batch:{type:Boolean,default:!1},withCredentials:{type:Boolean,default:void 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={},v.validatePackage(D.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:l,saveField:c,saveHeaders:p,saveMethod:a,saveUrl:r,withCredentials:f}=this.$props;return{autoUpload:s,batch:e,removeField:t,removeHeaders:i,removeMethod:n,removeUrl:o,responseType:l,saveField:c,saveHeaders:p,saveMethod:a,saveUrl:r,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 u.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;u.setFilesStatus(s,h.UploadFileStatus.Uploading),u.groupForEach(s,(t,i)=>{const n=d.cloneRequestHeaders(e.saveHeaders||{}),l={target:this,files:t,headers:n,additionalData:{}};this.$emit("beforeupload",l);const c=d.populateRequestOptions(l.headers,this.computedAsync),p=d.populateUploadFormData(t,e.saveField,l.additionalData);if(this.isCustomSave)this.$props.saveUrl(t,{formData:p,requestOptions:c},this.onUploadProgress).then(a=>this.onUploadSuccess(a.uid)).catch(a=>this.onUploadError(a.uid));else{const a=new XMLHttpRequest;this._httpSubscriptions[i]=()=>a.abort(),a.open(e.saveMethod,e.saveUrl,!0),a.withCredentials=d.resolveWithCredentials(c.withCredentials,e.saveUrl),a.responseType=c.responseType||"json",Object.entries(c.headers||{}).forEach(([r,f])=>{a.setRequestHeader(r,f)}),a.upload.onprogress=r=>this.onUploadProgress(i,r),a.onload=()=>{a.status>=200&&a.status<300?this.onUploadSuccess(i,{response:a.response,status:a.status,statusText:a.statusText,request:a}):this.onUploadError(i,{response:a.response,status:a.status,statusText:a.statusText,request:a})},a.onerror=()=>this.onUploadError(i,{response:a.response,status:a.status,statusText:a.statusText,request:a}),a.onabort=()=>{},a.send(p)}})},removeFiles(s){const e=this.computedAsync;u.groupForEach(s,(t,i)=>{const n=d.cloneRequestHeaders(e.removeHeaders||{}),l={target:this,files:t,headers:n,additionalData:{}};this.$emit("beforeremove",l);const c=t.map(r=>r.name),p=d.populateRequestOptions(l.headers,this.computedAsync),a=d.populateRemoveFormData(c,e.removeField,l.additionalData);if(this.isCustomRemove)this.$props.removeUrl(t,{formData:a,requestOptions:p}).then(r=>this.onRemoveSuccess(r.uid)).catch(r=>this.onRemoveError(r.uid));else{const r=new XMLHttpRequest;r.open(e.removeMethod,e.removeUrl,!0),r.withCredentials=d.resolveWithCredentials(p.withCredentials,e.removeUrl),r.responseType=p.responseType||"json",Object.entries(p.headers||{}).forEach(([f,F])=>{r.setRequestHeader(f,F)}),r.onload=()=>{r.status>=200&&r.status<300?this.onRemoveSuccess(i,{response:r.response,status:r.status,statusText:r.statusText,request:r}):this.onRemoveError(i,{response:r.response,status:r.status,statusText:r.statusText,request:r})},r.onerror=()=>this.onRemoveError(i,{response:r.response,status:r.status,statusText:r.statusText,request:r}),r.send(a)}})},onUpload(){const s=this.fileStateCopy,e=u.groupFilesByUid(s),t=u.filesForUpload(e);this.uploadFiles(t);const i=()=>{const n={target:this,newState:s,affectedFiles:u.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),q.validateFiles(e,this.$props.restrictions,this.validateFile),this.$props.multiple?t=this.fileStateCopy:t=[],u.addMany(e,t),this.computedAsync.autoUpload){const n=u.groupFilesByUid(t);this.uploadFiles(u.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(l=>l.uid===s);if(!n.length)return;n.forEach(l=>{l.progress=t});const o=()=>{const l={target:this,newState:i,affectedFiles:n};this.$emit("progress",l)};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=h.UploadFileStatus.Uploaded,o.progress=100}),delete this._httpSubscriptions[s];const n=()=>{const o={target:this,newState:t,affectedFiles:i,response:e?d.convertResponse(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=h.UploadFileStatus.UploadFailed}),delete this._httpSubscriptions[s],!i.length)return;const n=()=>{const o={target:this,newState:t,affectedFiles:i,response:e?d.convertResponse(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=[h.UploadFileStatus.Uploaded,h.UploadFileStatus.Initial,h.UploadFileStatus.RemoveFailed];if(t[0]&&n.indexOf(t[0].status)>-1){const o={[s]:t};u.setFilesStatus(o,h.UploadFileStatus.Removing),this.removeFiles(o);const l=()=>{const c={target:this,newState:e,affectedFiles:t};this.$emit("statuschange",c)};this.isControlled||(this.currentFiles=e),l()}else{const o=()=>{const l={target:this,newState:i,affectedFiles:t};this.$emit("remove",l)};this.isControlled||(this.currentFiles=i),o()}},onRemoveSuccess(s,e){const t=this.fileStateCopy,i=t.filter(l=>l.uid===s),n=t.filter(l=>l.uid!==s),o=()=>{const l={target:this,newState:n,affectedFiles:i,response:e?d.convertResponse(e):void 0};this.$emit("remove",l)};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=h.UploadFileStatus.RemoveFailed});const n=()=>{const o={target:this,newState:t,affectedFiles:i,response:e?d.convertResponse(e):void 0};this.$emit("statuschange",o)};this.isControlled||(this.currentFiles=t),n()},onRetry(s){const e=this.fileStateCopy,t=u.groupFilesByUid(e.filter(n=>n.uid===s));u.setFilesStatus(t,h.UploadFileStatus.Uploading),this.uploadFiles(t);const i=()=>{const n={target:this,newState:e,affectedFiles:u.flatFileGroup(t)};this.$emit("statuschange",n)};this.isControlled||(this.currentFiles=e),i()},onCancel(s){const e=this.fileStateCopy,t=e.filter(l=>l.uid!==s),i=e.filter(l=>l.uid===s);this._httpSubscriptions[s]&&(this._httpSubscriptions[s](),delete this._httpSubscriptions[s]);const n={target:this,uid:s};this.$emit("cancel",n);const o=()=>{const l={target:this,newState:t,affectedFiles:i};this.$emit("remove",l)};this.isControlled||(this.currentFiles=e),o()},onClear(){if(!this.computedFiles.length)return;Object.keys(this._httpSubscriptions).forEach(e=>{this._httpSubscriptions[e]()}),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:l,withCredentials:c,saveField:p,saveHeaders:a,saveMethod:r,saveUrl:f,responseType:F,removeField:A,removeHeaders:O,removeMethod:M,removeUrl:N,multiple:y,accept:U,restrictions:C,files:R,defaultFiles:b}=this.$props,E=v.templateRendering.call(this,this.$props.list,v.getListeners.call(this)),m=u.groupFilesByUid(this.computedFiles),$=u.filesForUpload(m);return g.createVNode(T.UploadNavigation,{groupedFiles:m,className:this.$props.className,showFileList:s&&!!Object.keys(m).length,showActionButtons:t&&!e&&!!Object.keys($).length,actionsLayout:i,disabled:o,onAdd:this.onAdd,onRemove:this.onRemove,onClear:this.onClear,onUpload:this.onUpload,onRetry:this.onRetry,onCancel:this.onCancel,tabIndex:v.getTabIndex(n,o),ref:w=>{this.uploadNavigationRef=w},multiple:y,accept:U,list:E,restrictions:C,files:R,defaultFiles:b,async:this.computedAsync},null)}});exports.Upload=x;
|
package/Upload.mjs
CHANGED
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { templateRendering as
|
|
8
|
+
import { defineComponent as $, createVNode as w } from "vue";
|
|
9
|
+
import { templateRendering as T, getListeners as D, getTabIndex as x, validatePackage as A } from "@progress/kendo-vue-common";
|
|
10
10
|
import { UploadFileStatus as h } from "./interfaces/UploadFileStatus.mjs";
|
|
11
|
-
import { UploadNavigation as
|
|
12
|
-
import
|
|
11
|
+
import { UploadNavigation as q } from "./UploadNavigation.mjs";
|
|
12
|
+
import F from "./utils/utils.mjs";
|
|
13
13
|
import u from "./utils/stateUtils.mjs";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { packageMetadata as
|
|
17
|
-
const
|
|
14
|
+
import c from "./utils/connectionUtils.mjs";
|
|
15
|
+
import O from "./utils/validationUtils.mjs";
|
|
16
|
+
import { packageMetadata as _ } from "./package-metadata.mjs";
|
|
17
|
+
const V = /* @__PURE__ */ $({
|
|
18
18
|
name: "KendoVueUpload",
|
|
19
19
|
props: {
|
|
20
20
|
autoUpload: {
|
|
@@ -27,7 +27,7 @@ const X = /* @__PURE__ */ w({
|
|
|
27
27
|
},
|
|
28
28
|
withCredentials: {
|
|
29
29
|
type: Boolean,
|
|
30
|
-
default:
|
|
30
|
+
default: void 0
|
|
31
31
|
},
|
|
32
32
|
saveField: {
|
|
33
33
|
type: String,
|
|
@@ -132,7 +132,7 @@ const X = /* @__PURE__ */ w({
|
|
|
132
132
|
remove: null
|
|
133
133
|
},
|
|
134
134
|
created() {
|
|
135
|
-
this._httpSubscriptions = {},
|
|
135
|
+
this._httpSubscriptions = {}, A(_), this.$props.defaultFiles && (this.currentFiles = this.$props.defaultFiles);
|
|
136
136
|
},
|
|
137
137
|
data() {
|
|
138
138
|
return {
|
|
@@ -149,11 +149,11 @@ const X = /* @__PURE__ */ w({
|
|
|
149
149
|
removeMethod: n,
|
|
150
150
|
removeUrl: o,
|
|
151
151
|
responseType: l,
|
|
152
|
-
saveField:
|
|
152
|
+
saveField: d,
|
|
153
153
|
saveHeaders: p,
|
|
154
|
-
saveMethod:
|
|
155
|
-
saveUrl:
|
|
156
|
-
withCredentials:
|
|
154
|
+
saveMethod: a,
|
|
155
|
+
saveUrl: r,
|
|
156
|
+
withCredentials: f
|
|
157
157
|
} = this.$props;
|
|
158
158
|
return {
|
|
159
159
|
autoUpload: s,
|
|
@@ -163,11 +163,11 @@ const X = /* @__PURE__ */ w({
|
|
|
163
163
|
removeMethod: n,
|
|
164
164
|
removeUrl: o,
|
|
165
165
|
responseType: l,
|
|
166
|
-
saveField:
|
|
166
|
+
saveField: d,
|
|
167
167
|
saveHeaders: p,
|
|
168
|
-
saveMethod:
|
|
169
|
-
saveUrl:
|
|
170
|
-
withCredentials:
|
|
168
|
+
saveMethod: a,
|
|
169
|
+
saveUrl: r,
|
|
170
|
+
withCredentials: f
|
|
171
171
|
};
|
|
172
172
|
},
|
|
173
173
|
computedFiles() {
|
|
@@ -200,24 +200,23 @@ const X = /* @__PURE__ */ w({
|
|
|
200
200
|
uploadFiles(s) {
|
|
201
201
|
const e = this.computedAsync;
|
|
202
202
|
u.setFilesStatus(s, h.Uploading), u.groupForEach(s, (t, i) => {
|
|
203
|
-
|
|
204
|
-
const n = d.cloneRequestHeaders(e.saveHeaders || {}), l = {
|
|
203
|
+
const n = c.cloneRequestHeaders(e.saveHeaders || {}), l = {
|
|
205
204
|
target: this,
|
|
206
205
|
files: t,
|
|
207
206
|
headers: n,
|
|
208
207
|
additionalData: {}
|
|
209
208
|
};
|
|
210
209
|
this.$emit("beforeupload", l);
|
|
211
|
-
const
|
|
210
|
+
const d = c.populateRequestOptions(l.headers, this.computedAsync), p = c.populateUploadFormData(t, e.saveField, l.additionalData);
|
|
212
211
|
if (this.isCustomSave)
|
|
213
212
|
this.$props.saveUrl(t, {
|
|
214
213
|
formData: p,
|
|
215
|
-
requestOptions:
|
|
214
|
+
requestOptions: d
|
|
216
215
|
}, this.onUploadProgress).then((a) => this.onUploadSuccess(a.uid)).catch((a) => this.onUploadError(a.uid));
|
|
217
216
|
else {
|
|
218
217
|
const a = new XMLHttpRequest();
|
|
219
|
-
this._httpSubscriptions[i] = () => a.abort(), a.open(e.saveMethod, e.saveUrl, !0), a.withCredentials = (
|
|
220
|
-
a.setRequestHeader(r,
|
|
218
|
+
this._httpSubscriptions[i] = () => a.abort(), a.open(e.saveMethod, e.saveUrl, !0), a.withCredentials = c.resolveWithCredentials(d.withCredentials, e.saveUrl), a.responseType = d.responseType || "json", Object.entries(d.headers || {}).forEach(([r, f]) => {
|
|
219
|
+
a.setRequestHeader(r, f);
|
|
221
220
|
}), a.upload.onprogress = (r) => this.onUploadProgress(i, r), a.onload = () => {
|
|
222
221
|
a.status >= 200 && a.status < 300 ? this.onUploadSuccess(i, {
|
|
223
222
|
response: a.response,
|
|
@@ -243,24 +242,23 @@ const X = /* @__PURE__ */ w({
|
|
|
243
242
|
removeFiles(s) {
|
|
244
243
|
const e = this.computedAsync;
|
|
245
244
|
u.groupForEach(s, (t, i) => {
|
|
246
|
-
|
|
247
|
-
const n = d.cloneRequestHeaders(e.removeHeaders || {}), l = {
|
|
245
|
+
const n = c.cloneRequestHeaders(e.removeHeaders || {}), l = {
|
|
248
246
|
target: this,
|
|
249
247
|
files: t,
|
|
250
248
|
headers: n,
|
|
251
249
|
additionalData: {}
|
|
252
250
|
};
|
|
253
251
|
this.$emit("beforeremove", l);
|
|
254
|
-
const
|
|
252
|
+
const d = t.map((r) => r.name), p = c.populateRequestOptions(l.headers, this.computedAsync), a = c.populateRemoveFormData(d, e.removeField, l.additionalData);
|
|
255
253
|
if (this.isCustomRemove)
|
|
256
254
|
this.$props.removeUrl(t, {
|
|
257
|
-
formData:
|
|
255
|
+
formData: a,
|
|
258
256
|
requestOptions: p
|
|
259
257
|
}).then((r) => this.onRemoveSuccess(r.uid)).catch((r) => this.onRemoveError(r.uid));
|
|
260
258
|
else {
|
|
261
259
|
const r = new XMLHttpRequest();
|
|
262
|
-
r.open(e.removeMethod, e.removeUrl, !0), r.withCredentials = (
|
|
263
|
-
r.setRequestHeader(
|
|
260
|
+
r.open(e.removeMethod, e.removeUrl, !0), r.withCredentials = c.resolveWithCredentials(p.withCredentials, e.removeUrl), r.responseType = p.responseType || "json", Object.entries(p.headers || {}).forEach(([f, v]) => {
|
|
261
|
+
r.setRequestHeader(f, v);
|
|
264
262
|
}), r.onload = () => {
|
|
265
263
|
r.status >= 200 && r.status < 300 ? this.onRemoveSuccess(i, {
|
|
266
264
|
response: r.response,
|
|
@@ -278,7 +276,7 @@ const X = /* @__PURE__ */ w({
|
|
|
278
276
|
status: r.status,
|
|
279
277
|
statusText: r.statusText,
|
|
280
278
|
request: r
|
|
281
|
-
}), r.send(
|
|
279
|
+
}), r.send(a);
|
|
282
280
|
}
|
|
283
281
|
});
|
|
284
282
|
},
|
|
@@ -296,8 +294,8 @@ const X = /* @__PURE__ */ w({
|
|
|
296
294
|
this.isControlled || (this.currentFiles = s), i();
|
|
297
295
|
},
|
|
298
296
|
onAdd(s) {
|
|
299
|
-
let e =
|
|
300
|
-
if (e =
|
|
297
|
+
let e = F.getAllFileInfo(s), t;
|
|
298
|
+
if (e = F.assignGuidToFiles(e, this.computedAsync.batch), O.validateFiles(e, this.$props.restrictions, this.validateFile), this.$props.multiple ? t = this.fileStateCopy : t = [], u.addMany(e, t), this.computedAsync.autoUpload) {
|
|
301
299
|
const n = u.groupFilesByUid(t);
|
|
302
300
|
this.uploadFiles(u.filesForUpload(n));
|
|
303
301
|
}
|
|
@@ -338,7 +336,7 @@ const X = /* @__PURE__ */ w({
|
|
|
338
336
|
target: this,
|
|
339
337
|
newState: t,
|
|
340
338
|
affectedFiles: i,
|
|
341
|
-
response: e ?
|
|
339
|
+
response: e ? c.convertResponse(e) : void 0
|
|
342
340
|
};
|
|
343
341
|
this.$emit("statuschange", o);
|
|
344
342
|
};
|
|
@@ -355,7 +353,7 @@ const X = /* @__PURE__ */ w({
|
|
|
355
353
|
target: this,
|
|
356
354
|
newState: t,
|
|
357
355
|
affectedFiles: i,
|
|
358
|
-
response: e ?
|
|
356
|
+
response: e ? c.convertResponse(e) : void 0
|
|
359
357
|
};
|
|
360
358
|
this.$emit("statuschange", o);
|
|
361
359
|
};
|
|
@@ -369,12 +367,12 @@ const X = /* @__PURE__ */ w({
|
|
|
369
367
|
};
|
|
370
368
|
u.setFilesStatus(o, h.Removing), this.removeFiles(o);
|
|
371
369
|
const l = () => {
|
|
372
|
-
const
|
|
370
|
+
const d = {
|
|
373
371
|
target: this,
|
|
374
372
|
newState: e,
|
|
375
373
|
affectedFiles: t
|
|
376
374
|
};
|
|
377
|
-
this.$emit("statuschange",
|
|
375
|
+
this.$emit("statuschange", d);
|
|
378
376
|
};
|
|
379
377
|
this.isControlled || (this.currentFiles = e), l();
|
|
380
378
|
} else {
|
|
@@ -395,7 +393,7 @@ const X = /* @__PURE__ */ w({
|
|
|
395
393
|
target: this,
|
|
396
394
|
newState: n,
|
|
397
395
|
affectedFiles: i,
|
|
398
|
-
response: e ?
|
|
396
|
+
response: e ? c.convertResponse(e) : void 0
|
|
399
397
|
};
|
|
400
398
|
this.$emit("remove", l);
|
|
401
399
|
};
|
|
@@ -411,7 +409,7 @@ const X = /* @__PURE__ */ w({
|
|
|
411
409
|
target: this,
|
|
412
410
|
newState: t,
|
|
413
411
|
affectedFiles: i,
|
|
414
|
-
response: e ?
|
|
412
|
+
response: e ? c.convertResponse(e) : void 0
|
|
415
413
|
};
|
|
416
414
|
this.$emit("statuschange", o);
|
|
417
415
|
};
|
|
@@ -474,27 +472,27 @@ const X = /* @__PURE__ */ w({
|
|
|
474
472
|
tabIndex: n,
|
|
475
473
|
disabled: o,
|
|
476
474
|
batch: l,
|
|
477
|
-
withCredentials:
|
|
475
|
+
withCredentials: d,
|
|
478
476
|
saveField: p,
|
|
479
|
-
saveHeaders:
|
|
480
|
-
saveMethod:
|
|
481
|
-
saveUrl:
|
|
482
|
-
responseType:
|
|
483
|
-
removeField:
|
|
477
|
+
saveHeaders: a,
|
|
478
|
+
saveMethod: r,
|
|
479
|
+
saveUrl: f,
|
|
480
|
+
responseType: v,
|
|
481
|
+
removeField: B,
|
|
484
482
|
removeHeaders: H,
|
|
485
483
|
removeMethod: N,
|
|
486
484
|
removeUrl: M,
|
|
487
|
-
multiple:
|
|
488
|
-
accept:
|
|
489
|
-
restrictions:
|
|
490
|
-
files:
|
|
491
|
-
defaultFiles:
|
|
492
|
-
} = this.$props,
|
|
493
|
-
return
|
|
494
|
-
groupedFiles:
|
|
485
|
+
multiple: g,
|
|
486
|
+
accept: S,
|
|
487
|
+
restrictions: y,
|
|
488
|
+
files: U,
|
|
489
|
+
defaultFiles: C
|
|
490
|
+
} = this.$props, R = T.call(this, this.$props.list, D.call(this)), m = u.groupFilesByUid(this.computedFiles), b = u.filesForUpload(m);
|
|
491
|
+
return w(q, {
|
|
492
|
+
groupedFiles: m,
|
|
495
493
|
className: this.$props.className,
|
|
496
|
-
showFileList: s && !!Object.keys(
|
|
497
|
-
showActionButtons: t && !e && !!Object.keys(
|
|
494
|
+
showFileList: s && !!Object.keys(m).length,
|
|
495
|
+
showActionButtons: t && !e && !!Object.keys(b).length,
|
|
498
496
|
actionsLayout: i,
|
|
499
497
|
disabled: o,
|
|
500
498
|
onAdd: this.onAdd,
|
|
@@ -503,20 +501,20 @@ const X = /* @__PURE__ */ w({
|
|
|
503
501
|
onUpload: this.onUpload,
|
|
504
502
|
onRetry: this.onRetry,
|
|
505
503
|
onCancel: this.onCancel,
|
|
506
|
-
tabIndex:
|
|
507
|
-
ref: (
|
|
508
|
-
this.uploadNavigationRef =
|
|
504
|
+
tabIndex: x(n, o),
|
|
505
|
+
ref: (E) => {
|
|
506
|
+
this.uploadNavigationRef = E;
|
|
509
507
|
},
|
|
510
|
-
multiple:
|
|
511
|
-
accept:
|
|
512
|
-
list:
|
|
513
|
-
restrictions:
|
|
514
|
-
files:
|
|
515
|
-
defaultFiles:
|
|
508
|
+
multiple: g,
|
|
509
|
+
accept: S,
|
|
510
|
+
list: R,
|
|
511
|
+
restrictions: y,
|
|
512
|
+
files: U,
|
|
513
|
+
defaultFiles: C,
|
|
516
514
|
async: this.computedAsync
|
|
517
515
|
}, null);
|
|
518
516
|
}
|
|
519
517
|
});
|
|
520
518
|
export {
|
|
521
|
-
|
|
519
|
+
V as Upload
|
|
522
520
|
};
|