@progress/kendo-vue-upload 8.4.0-develop.1 → 8.4.0-develop.3
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/Upload.d.ts +6 -6
- package/Upload.js +1 -1
- package/Upload.mjs +151 -118
- package/UploadAddButton.js +1 -1
- package/UploadAddButton.mjs +0 -2
- package/UploadDropZone.js +1 -1
- package/UploadDropZone.mjs +18 -17
- package/UploadInput.js +1 -1
- package/UploadInput.mjs +20 -20
- package/UploadUI.js +1 -1
- package/UploadUI.mjs +24 -22
- package/dist/cdn/js/kendo-vue-upload.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +6 -7
- package/utils/connectionUtils.d.ts +8 -2
- package/utils/connectionUtils.js +1 -1
- package/utils/connectionUtils.mjs +41 -35
package/Upload.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { GroupedFiles } from './interfaces/FileGroup';
|
|
9
9
|
import { UploadFileInfo } from './interfaces/UploadFileInfo';
|
|
10
10
|
import { UploadFileStatus } from './interfaces/UploadFileStatus';
|
|
11
|
-
import {
|
|
11
|
+
import { XHRResponseData } from './utils/connectionUtils';
|
|
12
12
|
import { PropType } from 'vue';
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
@@ -150,12 +150,12 @@ declare const Upload: import('vue').DefineComponent<import('vue').ExtractPropTyp
|
|
|
150
150
|
removeFiles(filesForRemove: GroupedFiles): void;
|
|
151
151
|
onUpload(): void;
|
|
152
152
|
onAdd(files: FileList): void;
|
|
153
|
-
onUploadProgress(uid: string, event: ProgressEvent
|
|
154
|
-
onUploadSuccess(uid: string, event?:
|
|
155
|
-
onUploadError(uid: string, event?:
|
|
153
|
+
onUploadProgress(uid: string, event: ProgressEvent): void;
|
|
154
|
+
onUploadSuccess(uid: string, event?: XHRResponseData): void;
|
|
155
|
+
onUploadError(uid: string, event?: XHRResponseData): void;
|
|
156
156
|
onRemove(uid: string): void;
|
|
157
|
-
onRemoveSuccess(uid: string, event?:
|
|
158
|
-
onRemoveError(uid: string, event?:
|
|
157
|
+
onRemoveSuccess(uid: string, event?: XHRResponseData): void;
|
|
158
|
+
onRemoveError(uid: string, event?: XHRResponseData): void;
|
|
159
159
|
onRetry(uid: string): void;
|
|
160
160
|
onCancel(uid: string): void;
|
|
161
161
|
onClear(): void;
|
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 S=require("vue"),v=require("@progress/kendo-vue-common"),h=require("./interfaces/UploadFileStatus.js"),q=require("./UploadNavigation.js"),y=require("./utils/utils.js"),u=require("./utils/stateUtils.js"),p=require("./utils/connectionUtils.js"),D=require("./utils/validationUtils.js"),x=require("./package-metadata.js"),A=S.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={},v.validatePackage(x.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:d,saveMethod:f,saveUrl:a,withCredentials:r}=this.$props;return{autoUpload:s,batch:e,removeField:t,removeHeaders:i,removeMethod:n,removeUrl:o,responseType:l,saveField:c,saveHeaders:d,saveMethod:f,saveUrl:a,withCredentials:r}},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)=>{var f;const n=p.cloneRequestHeaders(e.saveHeaders||{}),l={target:this,files:t,headers:n,additionalData:{}};this.$emit("beforeupload",l);const c=p.populateRequestOptions(l.headers,this.computedAsync),d=p.populateUploadFormData(t,e.saveField,l.additionalData);if(this.isCustomSave)this.$props.saveUrl(t,{formData:d,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=(f=c.withCredentials)!=null?f:!0,a.responseType=c.responseType||"json",Object.entries(c.headers||{}).forEach(([r,m])=>{a.setRequestHeader(r,m)}),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(d)}})},removeFiles(s){const e=this.computedAsync;u.groupForEach(s,(t,i)=>{var a;const n=p.cloneRequestHeaders(e.removeHeaders||{}),l={target:this,files:t,headers:n,additionalData:{}};this.$emit("beforeremove",l);const c=t.map(r=>r.name),d=p.populateRequestOptions(l.headers,this.computedAsync),f=p.populateRemoveFormData(c,e.removeField,l.additionalData);if(this.isCustomRemove)this.$props.removeUrl(t,{formData:f,requestOptions:d}).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=(a=d.withCredentials)!=null?a:!0,r.responseType=d.responseType||"json",Object.entries(d.headers||{}).forEach(([m,g])=>{r.setRequestHeader(m,g)}),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(f)}})},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=y.getAllFileInfo(s),t;if(e=y.assignGuidToFiles(e,this.computedAsync.batch),D.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?p.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?p.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?p.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?p.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:d,saveHeaders:f,saveMethod:a,saveUrl:r,responseType:m,removeField:g,removeHeaders:O,removeMethod:M,removeUrl:N,multiple:U,accept:C,restrictions:R,files:b,defaultFiles:E}=this.$props,$=v.templateRendering.call(this,this.$props.list,v.getListeners.call(this)),F=u.groupFilesByUid(this.computedFiles),w=u.filesForUpload(F);return S.createVNode(q.UploadNavigation,{groupedFiles:F,className:this.$props.className,showFileList:s&&!!Object.keys(F).length,showActionButtons:t&&!e&&!!Object.keys(w).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:T=>{this.uploadNavigationRef=T},multiple:U,accept:C,list:$,restrictions:R,files:b,defaultFiles:E,async:this.computedAsync},null)}});exports.Upload=A;
|
package/Upload.mjs
CHANGED
|
@@ -5,17 +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
|
|
10
|
-
import { UploadFileStatus as
|
|
11
|
-
import { UploadNavigation as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import r from "./utils/stateUtils.mjs";
|
|
8
|
+
import { defineComponent as w, createVNode as T } from "vue";
|
|
9
|
+
import { templateRendering as D, getListeners as x, getTabIndex as A, validatePackage as q } from "@progress/kendo-vue-common";
|
|
10
|
+
import { UploadFileStatus as h } from "./interfaces/UploadFileStatus.mjs";
|
|
11
|
+
import { UploadNavigation as O } from "./UploadNavigation.mjs";
|
|
12
|
+
import g from "./utils/utils.mjs";
|
|
13
|
+
import u from "./utils/stateUtils.mjs";
|
|
15
14
|
import d from "./utils/connectionUtils.mjs";
|
|
16
|
-
import
|
|
17
|
-
import { packageMetadata as
|
|
18
|
-
const
|
|
15
|
+
import _ from "./utils/validationUtils.mjs";
|
|
16
|
+
import { packageMetadata as B } from "./package-metadata.mjs";
|
|
17
|
+
const X = /* @__PURE__ */ w({
|
|
19
18
|
name: "KendoVueUpload",
|
|
20
19
|
props: {
|
|
21
20
|
autoUpload: {
|
|
@@ -133,7 +132,7 @@ const Q = /* @__PURE__ */ E({
|
|
|
133
132
|
remove: null
|
|
134
133
|
},
|
|
135
134
|
created() {
|
|
136
|
-
this._httpSubscriptions = {}, B
|
|
135
|
+
this._httpSubscriptions = {}, q(B), this.$props.defaultFiles && (this.currentFiles = this.$props.defaultFiles);
|
|
137
136
|
},
|
|
138
137
|
data() {
|
|
139
138
|
return {
|
|
@@ -149,12 +148,12 @@ const Q = /* @__PURE__ */ E({
|
|
|
149
148
|
removeHeaders: i,
|
|
150
149
|
removeMethod: n,
|
|
151
150
|
removeUrl: o,
|
|
152
|
-
responseType:
|
|
153
|
-
saveField:
|
|
154
|
-
saveHeaders:
|
|
155
|
-
saveMethod:
|
|
156
|
-
saveUrl:
|
|
157
|
-
withCredentials:
|
|
151
|
+
responseType: l,
|
|
152
|
+
saveField: c,
|
|
153
|
+
saveHeaders: p,
|
|
154
|
+
saveMethod: f,
|
|
155
|
+
saveUrl: a,
|
|
156
|
+
withCredentials: r
|
|
158
157
|
} = this.$props;
|
|
159
158
|
return {
|
|
160
159
|
autoUpload: s,
|
|
@@ -163,12 +162,12 @@ const Q = /* @__PURE__ */ E({
|
|
|
163
162
|
removeHeaders: i,
|
|
164
163
|
removeMethod: n,
|
|
165
164
|
removeUrl: o,
|
|
166
|
-
responseType:
|
|
167
|
-
saveField:
|
|
168
|
-
saveHeaders:
|
|
169
|
-
saveMethod:
|
|
170
|
-
saveUrl:
|
|
171
|
-
withCredentials:
|
|
165
|
+
responseType: l,
|
|
166
|
+
saveField: c,
|
|
167
|
+
saveHeaders: p,
|
|
168
|
+
saveMethod: f,
|
|
169
|
+
saveUrl: a,
|
|
170
|
+
withCredentials: r
|
|
172
171
|
};
|
|
173
172
|
},
|
|
174
173
|
computedFiles() {
|
|
@@ -184,7 +183,7 @@ const Q = /* @__PURE__ */ E({
|
|
|
184
183
|
return this.$props.removeUrl && typeof this.$props.removeUrl == "function";
|
|
185
184
|
},
|
|
186
185
|
fileStateCopy() {
|
|
187
|
-
return
|
|
186
|
+
return u.copyState(this.computedFiles);
|
|
188
187
|
},
|
|
189
188
|
actionElement() {
|
|
190
189
|
if (this._uploadNavigation)
|
|
@@ -200,73 +199,107 @@ const Q = /* @__PURE__ */ E({
|
|
|
200
199
|
},
|
|
201
200
|
uploadFiles(s) {
|
|
202
201
|
const e = this.computedAsync;
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
u.setFilesStatus(s, h.Uploading), u.groupForEach(s, (t, i) => {
|
|
203
|
+
var f;
|
|
204
|
+
const n = d.cloneRequestHeaders(e.saveHeaders || {}), l = {
|
|
205
205
|
target: this,
|
|
206
206
|
files: t,
|
|
207
207
|
headers: n,
|
|
208
208
|
additionalData: {}
|
|
209
209
|
};
|
|
210
|
-
this.$emit("beforeupload",
|
|
211
|
-
const
|
|
210
|
+
this.$emit("beforeupload", l);
|
|
211
|
+
const c = d.populateRequestOptions(l.headers, this.computedAsync), p = d.populateUploadFormData(t, e.saveField, l.additionalData);
|
|
212
212
|
if (this.isCustomSave)
|
|
213
213
|
this.$props.saveUrl(t, {
|
|
214
|
-
formData:
|
|
215
|
-
requestOptions:
|
|
216
|
-
}, this.onUploadProgress).then((
|
|
214
|
+
formData: p,
|
|
215
|
+
requestOptions: c
|
|
216
|
+
}, this.onUploadProgress).then((a) => this.onUploadSuccess(a.uid)).catch((a) => this.onUploadError(a.uid));
|
|
217
217
|
else {
|
|
218
|
-
const
|
|
219
|
-
this._httpSubscriptions[i] = c,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
218
|
+
const a = new XMLHttpRequest();
|
|
219
|
+
this._httpSubscriptions[i] = () => a.abort(), a.open(e.saveMethod, e.saveUrl, !0), a.withCredentials = (f = c.withCredentials) != null ? f : !0, a.responseType = c.responseType || "json", Object.entries(c.headers || {}).forEach(([r, m]) => {
|
|
220
|
+
a.setRequestHeader(r, m);
|
|
221
|
+
}), a.upload.onprogress = (r) => this.onUploadProgress(i, r), a.onload = () => {
|
|
222
|
+
a.status >= 200 && a.status < 300 ? this.onUploadSuccess(i, {
|
|
223
|
+
response: a.response,
|
|
224
|
+
status: a.status,
|
|
225
|
+
statusText: a.statusText,
|
|
226
|
+
request: a
|
|
227
|
+
}) : this.onUploadError(i, {
|
|
228
|
+
response: a.response,
|
|
229
|
+
status: a.status,
|
|
230
|
+
statusText: a.statusText,
|
|
231
|
+
request: a
|
|
232
|
+
});
|
|
233
|
+
}, a.onerror = () => this.onUploadError(i, {
|
|
234
|
+
response: a.response,
|
|
235
|
+
status: a.status,
|
|
236
|
+
statusText: a.statusText,
|
|
237
|
+
request: a
|
|
238
|
+
}), a.onabort = () => {
|
|
239
|
+
}, a.send(p);
|
|
227
240
|
}
|
|
228
241
|
});
|
|
229
242
|
},
|
|
230
243
|
removeFiles(s) {
|
|
231
244
|
const e = this.computedAsync;
|
|
232
|
-
|
|
233
|
-
|
|
245
|
+
u.groupForEach(s, (t, i) => {
|
|
246
|
+
var a;
|
|
247
|
+
const n = d.cloneRequestHeaders(e.removeHeaders || {}), l = {
|
|
234
248
|
target: this,
|
|
235
249
|
files: t,
|
|
236
250
|
headers: n,
|
|
237
251
|
additionalData: {}
|
|
238
252
|
};
|
|
239
|
-
this.$emit("beforeremove",
|
|
240
|
-
const
|
|
241
|
-
this.isCustomRemove
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
253
|
+
this.$emit("beforeremove", l);
|
|
254
|
+
const c = t.map((r) => r.name), p = d.populateRequestOptions(l.headers, this.computedAsync), f = d.populateRemoveFormData(c, e.removeField, l.additionalData);
|
|
255
|
+
if (this.isCustomRemove)
|
|
256
|
+
this.$props.removeUrl(t, {
|
|
257
|
+
formData: f,
|
|
258
|
+
requestOptions: p
|
|
259
|
+
}).then((r) => this.onRemoveSuccess(r.uid)).catch((r) => this.onRemoveError(r.uid));
|
|
260
|
+
else {
|
|
261
|
+
const r = new XMLHttpRequest();
|
|
262
|
+
r.open(e.removeMethod, e.removeUrl, !0), r.withCredentials = (a = p.withCredentials) != null ? a : !0, r.responseType = p.responseType || "json", Object.entries(p.headers || {}).forEach(([m, F]) => {
|
|
263
|
+
r.setRequestHeader(m, F);
|
|
264
|
+
}), r.onload = () => {
|
|
265
|
+
r.status >= 200 && r.status < 300 ? this.onRemoveSuccess(i, {
|
|
266
|
+
response: r.response,
|
|
267
|
+
status: r.status,
|
|
268
|
+
statusText: r.statusText,
|
|
269
|
+
request: r
|
|
270
|
+
}) : this.onRemoveError(i, {
|
|
271
|
+
response: r.response,
|
|
272
|
+
status: r.status,
|
|
273
|
+
statusText: r.statusText,
|
|
274
|
+
request: r
|
|
275
|
+
});
|
|
276
|
+
}, r.onerror = () => this.onRemoveError(i, {
|
|
277
|
+
response: r.response,
|
|
278
|
+
status: r.status,
|
|
279
|
+
statusText: r.statusText,
|
|
280
|
+
request: r
|
|
281
|
+
}), r.send(f);
|
|
282
|
+
}
|
|
250
283
|
});
|
|
251
284
|
},
|
|
252
285
|
onUpload() {
|
|
253
|
-
const s = this.fileStateCopy, e =
|
|
286
|
+
const s = this.fileStateCopy, e = u.groupFilesByUid(s), t = u.filesForUpload(e);
|
|
254
287
|
this.uploadFiles(t);
|
|
255
288
|
const i = () => {
|
|
256
289
|
const n = {
|
|
257
290
|
target: this,
|
|
258
291
|
newState: s,
|
|
259
|
-
affectedFiles:
|
|
292
|
+
affectedFiles: u.flatFileGroup(t)
|
|
260
293
|
};
|
|
261
294
|
this.$emit("statuschange", n);
|
|
262
295
|
};
|
|
263
296
|
this.isControlled || (this.currentFiles = s), i();
|
|
264
297
|
},
|
|
265
298
|
onAdd(s) {
|
|
266
|
-
let e =
|
|
267
|
-
if (e =
|
|
268
|
-
const n =
|
|
269
|
-
this.uploadFiles(
|
|
299
|
+
let e = g.getAllFileInfo(s), t;
|
|
300
|
+
if (e = g.assignGuidToFiles(e, this.computedAsync.batch), _.validateFiles(e, this.$props.restrictions, this.validateFile), this.$props.multiple ? t = this.fileStateCopy : t = [], u.addMany(e, t), this.computedAsync.autoUpload) {
|
|
301
|
+
const n = u.groupFilesByUid(t);
|
|
302
|
+
this.uploadFiles(u.filesForUpload(n));
|
|
270
303
|
}
|
|
271
304
|
const i = () => {
|
|
272
305
|
const n = {
|
|
@@ -279,33 +312,33 @@ const Q = /* @__PURE__ */ E({
|
|
|
279
312
|
this.isControlled || (this.currentFiles = t), i();
|
|
280
313
|
},
|
|
281
314
|
onUploadProgress(s, e) {
|
|
282
|
-
const t = e.total ? Math.round(100 * e.loaded / e.total) : 0, i = this.fileStateCopy, n = i.filter((
|
|
315
|
+
const t = e.total ? Math.round(100 * e.loaded / e.total) : 0, i = this.fileStateCopy, n = i.filter((l) => l.uid === s);
|
|
283
316
|
if (!n.length)
|
|
284
317
|
return;
|
|
285
|
-
n.forEach((
|
|
286
|
-
|
|
318
|
+
n.forEach((l) => {
|
|
319
|
+
l.progress = t;
|
|
287
320
|
});
|
|
288
321
|
const o = () => {
|
|
289
|
-
const
|
|
322
|
+
const l = {
|
|
290
323
|
target: this,
|
|
291
324
|
newState: i,
|
|
292
325
|
affectedFiles: n
|
|
293
326
|
};
|
|
294
|
-
this.$emit("progress",
|
|
327
|
+
this.$emit("progress", l);
|
|
295
328
|
};
|
|
296
329
|
this.isControlled || (this.currentFiles = i), o();
|
|
297
330
|
},
|
|
298
331
|
onUploadSuccess(s, e) {
|
|
299
332
|
const t = this.fileStateCopy, i = t.filter((o) => o.uid === s);
|
|
300
333
|
i.forEach((o) => {
|
|
301
|
-
o.status =
|
|
334
|
+
o.status = h.Uploaded, o.progress = 100;
|
|
302
335
|
}), delete this._httpSubscriptions[s];
|
|
303
336
|
const n = () => {
|
|
304
337
|
const o = {
|
|
305
338
|
target: this,
|
|
306
339
|
newState: t,
|
|
307
340
|
affectedFiles: i,
|
|
308
|
-
response: e ? d.
|
|
341
|
+
response: e ? d.convertResponse(e) : void 0
|
|
309
342
|
};
|
|
310
343
|
this.$emit("statuschange", o);
|
|
311
344
|
};
|
|
@@ -314,7 +347,7 @@ const Q = /* @__PURE__ */ E({
|
|
|
314
347
|
onUploadError(s, e) {
|
|
315
348
|
const t = this.fileStateCopy, i = t.filter((o) => o.uid === s);
|
|
316
349
|
if (i.forEach((o) => {
|
|
317
|
-
o.status =
|
|
350
|
+
o.status = h.UploadFailed;
|
|
318
351
|
}), delete this._httpSubscriptions[s], !i.length)
|
|
319
352
|
return;
|
|
320
353
|
const n = () => {
|
|
@@ -322,96 +355,96 @@ const Q = /* @__PURE__ */ E({
|
|
|
322
355
|
target: this,
|
|
323
356
|
newState: t,
|
|
324
357
|
affectedFiles: i,
|
|
325
|
-
response: e ? d.
|
|
358
|
+
response: e ? d.convertResponse(e) : void 0
|
|
326
359
|
};
|
|
327
360
|
this.$emit("statuschange", o);
|
|
328
361
|
};
|
|
329
362
|
this.isControlled || (this.currentFiles = t), n();
|
|
330
363
|
},
|
|
331
364
|
onRemove(s) {
|
|
332
|
-
const e = this.fileStateCopy, t = e.filter((o) => o.uid === s), i = e.filter((o) => o.uid !== s), n = [
|
|
365
|
+
const e = this.fileStateCopy, t = e.filter((o) => o.uid === s), i = e.filter((o) => o.uid !== s), n = [h.Uploaded, h.Initial, h.RemoveFailed];
|
|
333
366
|
if (t[0] && n.indexOf(t[0].status) > -1) {
|
|
334
367
|
const o = {
|
|
335
368
|
[s]: t
|
|
336
369
|
};
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
const
|
|
370
|
+
u.setFilesStatus(o, h.Removing), this.removeFiles(o);
|
|
371
|
+
const l = () => {
|
|
372
|
+
const c = {
|
|
340
373
|
target: this,
|
|
341
374
|
newState: e,
|
|
342
375
|
affectedFiles: t
|
|
343
376
|
};
|
|
344
|
-
this.$emit("statuschange",
|
|
377
|
+
this.$emit("statuschange", c);
|
|
345
378
|
};
|
|
346
|
-
this.isControlled || (this.currentFiles = e),
|
|
379
|
+
this.isControlled || (this.currentFiles = e), l();
|
|
347
380
|
} else {
|
|
348
381
|
const o = () => {
|
|
349
|
-
const
|
|
382
|
+
const l = {
|
|
350
383
|
target: this,
|
|
351
384
|
newState: i,
|
|
352
385
|
affectedFiles: t
|
|
353
386
|
};
|
|
354
|
-
this.$emit("remove",
|
|
387
|
+
this.$emit("remove", l);
|
|
355
388
|
};
|
|
356
389
|
this.isControlled || (this.currentFiles = i), o();
|
|
357
390
|
}
|
|
358
391
|
},
|
|
359
392
|
onRemoveSuccess(s, e) {
|
|
360
|
-
const t = this.fileStateCopy, i = t.filter((
|
|
361
|
-
const
|
|
393
|
+
const t = this.fileStateCopy, i = t.filter((l) => l.uid === s), n = t.filter((l) => l.uid !== s), o = () => {
|
|
394
|
+
const l = {
|
|
362
395
|
target: this,
|
|
363
396
|
newState: n,
|
|
364
397
|
affectedFiles: i,
|
|
365
|
-
response: e ? d.
|
|
398
|
+
response: e ? d.convertResponse(e) : void 0
|
|
366
399
|
};
|
|
367
|
-
this.$emit("remove",
|
|
400
|
+
this.$emit("remove", l);
|
|
368
401
|
};
|
|
369
402
|
this.isControlled || (this.currentFiles = n), o();
|
|
370
403
|
},
|
|
371
404
|
onRemoveError(s, e) {
|
|
372
405
|
const t = this.fileStateCopy, i = t.filter((o) => o.uid === s);
|
|
373
406
|
i.forEach((o) => {
|
|
374
|
-
o.status =
|
|
407
|
+
o.status = h.RemoveFailed;
|
|
375
408
|
});
|
|
376
409
|
const n = () => {
|
|
377
410
|
const o = {
|
|
378
411
|
target: this,
|
|
379
412
|
newState: t,
|
|
380
413
|
affectedFiles: i,
|
|
381
|
-
response: e ? d.
|
|
414
|
+
response: e ? d.convertResponse(e) : void 0
|
|
382
415
|
};
|
|
383
416
|
this.$emit("statuschange", o);
|
|
384
417
|
};
|
|
385
418
|
this.isControlled || (this.currentFiles = t), n();
|
|
386
419
|
},
|
|
387
420
|
onRetry(s) {
|
|
388
|
-
const e = this.fileStateCopy, t =
|
|
389
|
-
|
|
421
|
+
const e = this.fileStateCopy, t = u.groupFilesByUid(e.filter((n) => n.uid === s));
|
|
422
|
+
u.setFilesStatus(t, h.Uploading), this.uploadFiles(t);
|
|
390
423
|
const i = () => {
|
|
391
424
|
const n = {
|
|
392
425
|
target: this,
|
|
393
426
|
newState: e,
|
|
394
|
-
affectedFiles:
|
|
427
|
+
affectedFiles: u.flatFileGroup(t)
|
|
395
428
|
};
|
|
396
429
|
this.$emit("statuschange", n);
|
|
397
430
|
};
|
|
398
431
|
this.isControlled || (this.currentFiles = e), i();
|
|
399
432
|
},
|
|
400
433
|
onCancel(s) {
|
|
401
|
-
const e = this.fileStateCopy, t = e.filter((
|
|
402
|
-
this._httpSubscriptions[s] && (this._httpSubscriptions[s]
|
|
434
|
+
const e = this.fileStateCopy, t = e.filter((l) => l.uid !== s), i = e.filter((l) => l.uid === s);
|
|
435
|
+
this._httpSubscriptions[s] && (this._httpSubscriptions[s](), delete this._httpSubscriptions[s]);
|
|
403
436
|
const n = {
|
|
404
437
|
target: this,
|
|
405
438
|
uid: s
|
|
406
439
|
};
|
|
407
440
|
this.$emit("cancel", n);
|
|
408
441
|
const o = () => {
|
|
409
|
-
const
|
|
442
|
+
const l = {
|
|
410
443
|
target: this,
|
|
411
444
|
newState: t,
|
|
412
445
|
affectedFiles: i
|
|
413
446
|
};
|
|
414
|
-
this.$emit("remove",
|
|
447
|
+
this.$emit("remove", l);
|
|
415
448
|
};
|
|
416
449
|
this.isControlled || (this.currentFiles = e), o();
|
|
417
450
|
},
|
|
@@ -419,7 +452,7 @@ const Q = /* @__PURE__ */ E({
|
|
|
419
452
|
if (!this.computedFiles.length)
|
|
420
453
|
return;
|
|
421
454
|
Object.keys(this._httpSubscriptions).forEach((e) => {
|
|
422
|
-
this._httpSubscriptions[e]
|
|
455
|
+
this._httpSubscriptions[e]();
|
|
423
456
|
}), this._httpSubscriptions = {};
|
|
424
457
|
const s = () => {
|
|
425
458
|
const e = {
|
|
@@ -440,28 +473,28 @@ const Q = /* @__PURE__ */ E({
|
|
|
440
473
|
actionsLayout: i,
|
|
441
474
|
tabIndex: n,
|
|
442
475
|
disabled: o,
|
|
443
|
-
batch:
|
|
444
|
-
withCredentials:
|
|
445
|
-
saveField:
|
|
446
|
-
saveHeaders:
|
|
447
|
-
saveMethod:
|
|
448
|
-
saveUrl:
|
|
449
|
-
responseType:
|
|
450
|
-
removeField:
|
|
476
|
+
batch: l,
|
|
477
|
+
withCredentials: c,
|
|
478
|
+
saveField: p,
|
|
479
|
+
saveHeaders: f,
|
|
480
|
+
saveMethod: a,
|
|
481
|
+
saveUrl: r,
|
|
482
|
+
responseType: m,
|
|
483
|
+
removeField: F,
|
|
451
484
|
removeHeaders: H,
|
|
452
|
-
removeMethod:
|
|
453
|
-
removeUrl:
|
|
454
|
-
multiple:
|
|
455
|
-
accept:
|
|
456
|
-
restrictions:
|
|
457
|
-
files:
|
|
458
|
-
defaultFiles:
|
|
459
|
-
} = this.$props,
|
|
460
|
-
return
|
|
461
|
-
groupedFiles:
|
|
485
|
+
removeMethod: N,
|
|
486
|
+
removeUrl: M,
|
|
487
|
+
multiple: S,
|
|
488
|
+
accept: y,
|
|
489
|
+
restrictions: U,
|
|
490
|
+
files: C,
|
|
491
|
+
defaultFiles: R
|
|
492
|
+
} = this.$props, b = D.call(this, this.$props.list, x.call(this)), v = u.groupFilesByUid(this.computedFiles), E = u.filesForUpload(v);
|
|
493
|
+
return T(O, {
|
|
494
|
+
groupedFiles: v,
|
|
462
495
|
className: this.$props.className,
|
|
463
|
-
showFileList: s && !!Object.keys(
|
|
464
|
-
showActionButtons: t && !e && !!Object.keys(
|
|
496
|
+
showFileList: s && !!Object.keys(v).length,
|
|
497
|
+
showActionButtons: t && !e && !!Object.keys(E).length,
|
|
465
498
|
actionsLayout: i,
|
|
466
499
|
disabled: o,
|
|
467
500
|
onAdd: this.onAdd,
|
|
@@ -470,20 +503,20 @@ const Q = /* @__PURE__ */ E({
|
|
|
470
503
|
onUpload: this.onUpload,
|
|
471
504
|
onRetry: this.onRetry,
|
|
472
505
|
onCancel: this.onCancel,
|
|
473
|
-
tabIndex:
|
|
506
|
+
tabIndex: A(n, o),
|
|
474
507
|
ref: ($) => {
|
|
475
508
|
this.uploadNavigationRef = $;
|
|
476
509
|
},
|
|
477
|
-
multiple:
|
|
478
|
-
accept:
|
|
479
|
-
list:
|
|
480
|
-
restrictions:
|
|
481
|
-
files:
|
|
482
|
-
defaultFiles:
|
|
510
|
+
multiple: S,
|
|
511
|
+
accept: y,
|
|
512
|
+
list: b,
|
|
513
|
+
restrictions: U,
|
|
514
|
+
files: C,
|
|
515
|
+
defaultFiles: R,
|
|
483
516
|
async: this.computedAsync
|
|
484
517
|
}, null);
|
|
485
518
|
}
|
|
486
519
|
});
|
|
487
520
|
export {
|
|
488
|
-
|
|
521
|
+
X as Upload
|
|
489
522
|
};
|
package/UploadAddButton.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 t=require("vue"),d=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-intl"),o=require("./messages/main.js"),g=require("./UploadInput.js"),v=require("@progress/kendo-vue-buttons");function x(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const S=t.defineComponent({name:"KendoVueUploadAddButton",props:{addButtonIndex:Number,navigationIndex:Number,notFocusedIndex:Number,tabIndex:Number,async:Object,multiple:Boolean,disabled:Boolean,accept:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String},inject:{kendoLocalizationService:{default:null}},emits:{add:null,click:null},setup(){const e=t.ref(null),n=t.ref(null),i=t.inject("kendoLocalizationService",{});return{elementRef:e,uploadInputRef:n,kendoLocalizationService:i}},created(){this.uploadInputId=d.guid()},mounted(){this.element=this.elementRef,this.uploadInput=this.uploadInputRef},watch:{navigationIndex:function(e,n){this._prevNavigationIndex=n}},updated(){const{navigationIndex:e,addButtonIndex:n,notFocusedIndex:i}=this.$props;e!==this._prevNavigationIndex&&this._prevNavigationIndex!==i&&e===n&&this.element&&this.element.focus()},methods:{focus(){this.element&&this.element.focus()},onClick(){this.actionElement()&&this.actionElement().click(),this.$emit("click",this.$props.addButtonIndex)},onAdd(e){this.$emit("add",e)},onInputMouseDown(e){this.element&&(e.preventDefault(),this.element.focus())},actionElement(){if(this.uploadInput)return this.uploadInput.actionElement()}},render(){const{navigationIndex:e,addButtonIndex:n,tabIndex:i,id:c,async:r,multiple:s,disabled:l,accept:p,ariaLabelledBy:m,ariaDescribedBy:h}=this.$props,u=f.provideLocalizationService(this),a=s?u.toLanguageString(o.select,o.messages[o.select]):u.toLanguageString(o.selectSingle,o.messages[o.selectSingle]),I=d.classNames("k-upload-button",e===n?"k-focus":"");return t.createVNode("div",{class:"k-upload-button-wrap"},[t.createVNode(v.Button,{id:c,ref:d.setRef(this,"element"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),d=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-intl"),o=require("./messages/main.js"),g=require("./UploadInput.js"),v=require("@progress/kendo-vue-buttons");function x(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const S=t.defineComponent({name:"KendoVueUploadAddButton",props:{addButtonIndex:Number,navigationIndex:Number,notFocusedIndex:Number,tabIndex:Number,async:Object,multiple:Boolean,disabled:Boolean,accept:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String},inject:{kendoLocalizationService:{default:null}},emits:{add:null,click:null},setup(){const e=t.ref(null),n=t.ref(null),i=t.inject("kendoLocalizationService",{});return{elementRef:e,uploadInputRef:n,kendoLocalizationService:i}},created(){this.uploadInputId=d.guid()},mounted(){this.element=this.elementRef,this.uploadInput=this.uploadInputRef},watch:{navigationIndex:function(e,n){this._prevNavigationIndex=n}},updated(){const{navigationIndex:e,addButtonIndex:n,notFocusedIndex:i}=this.$props;e!==this._prevNavigationIndex&&this._prevNavigationIndex!==i&&e===n&&this.element&&this.element.focus()},methods:{focus(){this.element&&this.element.focus()},onClick(){this.actionElement()&&this.actionElement().click(),this.$emit("click",this.$props.addButtonIndex)},onAdd(e){this.$emit("add",e)},onInputMouseDown(e){this.element&&(e.preventDefault(),this.element.focus())},actionElement(){if(this.uploadInput)return this.uploadInput.actionElement()}},render(){const{navigationIndex:e,addButtonIndex:n,tabIndex:i,id:c,async:r,multiple:s,disabled:l,accept:p,ariaLabelledBy:m,ariaDescribedBy:h}=this.$props,u=f.provideLocalizationService(this),a=s?u.toLanguageString(o.select,o.messages[o.select]):u.toLanguageString(o.selectSingle,o.messages[o.selectSingle]),I=d.classNames("k-upload-button",e===n?"k-focus":"");return t.createVNode("div",{class:"k-upload-button-wrap"},[t.createVNode(v.Button,{id:c,ref:d.setRef(this,"element"),type:"button",disabled:l,class:I,tabIndex:i,"aria-labelledby":m,"aria-describedby":h,onClick:this.onClick},x(a)?a:{default:()=>[a]}),t.createVNode(g.UploadInput,{id:this.uploadInputId,async:r,multiple:s,disabled:l,accept:p,onMousedown:this.onInputMouseDown,onAdd:this.onAdd,ref:b=>{this.uploadInputRef=b}},null)])}});exports.UploadAddButton=S;
|
package/UploadAddButton.mjs
CHANGED
package/UploadDropZone.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 t=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),b=require("@progress/kendo-vue-common"),O=require("./UploadAddButton.js"),S=require("@progress/kendo-vue-intl"),o=require("./messages/main.js"),k=require("./utils/utils.js"),y=require("./UploadStatus.js"),r=100,F=t.defineComponent({name:"KendoVueUploadDropZone",props:{addButtonIndex:Number,async:Object,multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},showFileList:Boolean,showActionButtons:Boolean,actionsLayout:{type:String,default:function(){return"end"}},tabIndex:Number,accept:String,groupedFiles:{type:Object,default:function(){return{}}},navigationIndex:Number,notFocusedIndex:Number,list:[String,Function,Object],id:String,ariaLabelledBy:String,ariaDescribedBy:String,fileGroup:Object},emits:{add:null,click:null},inject:{kendoLocalizationService:{default:null}},data(){return{currentDocumentActive:!1,currentElementActive:!1}},created(){this.currentElementActive=!1},mounted(){this.uploadAddButton=this.uploadAddButtonRef,document.addEventListener("dragenter",this.onDocumentDragEnter),document.addEventListener("dragover",this.onDocumentDragOver)},unmounted(){document.removeEventListener("dragenter",this.onDocumentDragEnter),document.removeEventListener("dragover",this.onDocumentDragOver)},setup(){const e=t.ref(null),n=t.inject("kendoLocalizationService",{});return{uploadAddButtonRef:e,kendoLocalizationService:n}},computed:{dropZoneClasses(){return{"k-dropzone":!0,"k-upload-dropzone":!0,"k-active":this.currentDocumentActive,"k-hover":this.currentElementActive}}},methods:{actionElement(){if(this.uploadAddButton)return this.uploadAddButton.uploadInput},focus(){if(this.uploadAddButton)return this.uploadAddButton.focus()},onDocumentDragEnter(){if(!this.currentDocumentActive){this.currentDocumentActive=!0;const e=()=>{this.isDragOver(this._lastDocumentDragOver)&&(this.currentDocumentActive=!1,clearInterval(this._documentInterval),this._documentInterval=null,this._lastDocumentDragOver=null)};this._documentInterval=setInterval(e,r)}},onDocumentDragOver(){this._lastDocumentDragOver=new Date},onElementDragEnter(){if(!this.currentElementActive){this.currentElementActive=!0;const e=()=>{this.isDragOver(this._lastElementDragOver)&&(this.currentElementActive=!1,clearInterval(this._elementInterval),this._elementInterval=null,this._lastElementDragOver=null)};this._elementInterval=setInterval(e,r)}},onElementDragOver(e){e.preventDefault(),this._lastElementDragOver=new Date},onDrop(e){e.preventDefault();let n=e.dataTransfer.files;n.length>0&&!this.$props.disabled&&this.$emit("add",n)},isDragOver(e){return new Date().getTime()-(e||new Date).getTime()>r},onClick(e){this.$emit("click",e)},onAdd(e){this.$emit("add",e)}},render(){const{multiple:e,disabled:n,tabIndex:l,fileGroup:u,accept:c,navigationIndex:p,notFocusedIndex:m,id:v,ariaLabelledBy:h,ariaDescribedBy:g}=this.$props,a=S.provideLocalizationService(this),D=e?a.toLanguageString(o.dropFilesHere,o.messages[o.dropFilesHere]):a.toLanguageString(o.dropFileHere,o.messages[o.dropFileHere]),[i,s,d,f]=k.getFileStatus(u),A=b.classNames("k-dropzone-hint",{"k-hidden":!this.currentElementActive}),I=i||s||d||f,E=function(){return t.createVNode(O.UploadAddButton,{id:v,ariaLabelledBy:h,ariaDescribedBy:g,ref:B=>{this.uploadAddButtonRef=B},accept:c,async:this.async,addButtonIndex:this.addButtonIndex,navigationIndex:p,notFocusedIndex:m,tabIndex:l,multiple:e,disabled:n,onClick:this.onClick,onAdd:this.onAdd},null)};return t.createVNode("div",{class:this.dropZoneClasses,onDrop:this.onDrop,onDragenter:this.onElementDragEnter,onDragover:this.onElementDragOver},[E.call(this),t.createVNode("div",{class:A},[D]),I?t.createVNode(y.UploadStatus,{isUploading:i,isUploaded:s,isUploadFailed:d},null):t.createVNode("span",{class:"k-upload-status"},null)])}});exports.UploadDropZone=F;
|