@progress/kendo-vue-upload
Version:
16 lines (15 loc) • 42 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-intl"),require("@progress/kendo-vue-progressbars"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("axios")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-intl","@progress/kendo-vue-progressbars","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","axios"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueUpload={},e.Vue,e.KendoVueCommon,e.KendoVueIntl,e.KendoVueProgressbars,e.KendoVueButtons,e.KendoSVGIcons,e.axios)}(this,(function(e,t,n,i,o,s,a,l){"use strict";var r=(e=>(e[e.UploadFailed=0]="UploadFailed",e[e.Initial=1]="Initial",e[e.Selected=2]="Selected",e[e.Uploading=3]="Uploading",e[e.Uploaded=4]="Uploaded",e[e.RemoveFailed=5]="RemoveFailed",e[e.Removing=6]="Removing",e))(r||{});const d="upload.cancel",c="upload.clearSelectedFiles",u="upload.dropFilesHere",p="upload.headerStatusUploaded",h="upload.headerStatusUploading",m="upload.invalidFileExtension",f="upload.invalidFiles",v="upload.invalidMaxFileSize",g="upload.invalidMinFileSize",y="upload.remove",b="upload.retry",F="upload.select",k="upload.selectTitle",S="upload.selectNoFilesTitle",I="upload.uploadSelectedFiles",x="upload.total",C="upload.files",N="upload.statusUploaded",B="upload.statusUploadFailed",E="upload.dropZoneHint",$="upload.dropZoneNote",D={[d]:"Cancel",[c]:"Clear",[u]:"Drop files here to upload",[p]:"Done",[h]:"Uploading...",[m]:"File type not allowed.",[f]:"Invalid file(s). Please check file upload requirements.",[v]:"File size too large.",[g]:"File size too small.",[y]:"Remove",[b]:"Retry",[F]:"Select files...",[k]:"Press to select more files",[S]:"No files selected",[I]:"Upload",[x]:"Total",[C]:"files",[N]:"File(s) successfully uploaded.",[B]:"File(s) failed to upload.",[E]:"Drag and drop files here to upload.",[$]:"Only JPEG and PNG files are allowed."},U=/&/g,R=/</g,L=/"/g,V=/'/g,w=/>/g,O=e=>(""+e).replace(U,"&").replace(R,"<").replace(w,">").replace(L,""").replace(V,"'"),A=e=>{const t=e.match(/\.([^\.]+)$/);return t?t[0]:""},z=e=>{const t=e.name,n=e.size;return{extension:A(t),name:O(t),getRawFile:()=>e,size:n,status:r.Selected,progress:0,uid:""}},j=e=>!!(e.validationErrors&&e.validationErrors.length>0),_={fileHasValidationErrors:j,filesHaveValidationErrors:e=>{for(const t of e)if(j(t))return!0;return!1},getTotalFilesSizeMessage:e=>{let t,n=0;if("number"!=typeof e[0].size)return"";for(t=0;t<e.length;t++)e[t].size&&(n+=e[t].size||0);return n/=1024,n<1024?n.toFixed(2)+" KB":(n/1024).toFixed(2)+" MB"},getAllFileInfo:e=>{const t=new Array;let n;for(n=0;n<e.length;n++)t.push(z(e[n]));return t},getFileInfo:z,getFileExtension:A,htmlEncode:O,assignGuidToFiles:(e,t)=>{const i=n.guid();return e.map((e=>(e.uid=t?i:n.guid(),e)))},getFileStatus:e=>{let t=!1,n=!1,i=!1,o=!1;const s=e=>{e.forEach((e=>{e.status===r.Uploading&&(t=!0),e.status===r.Uploaded&&(n=!0),e.status===r.UploadFailed&&(i=!0),j(e)&&(o=!0)}))};return Array.isArray(e)?s(e):Object.keys(e).forEach((t=>{s(e[t])})),[t,n,i,o]}},T=t.defineComponent({name:"KendoVueUploadListActionButton",props:{progress:Number,uid:String,status:Number,async:Object,disabled:Boolean,files:Array},emits:{cancel:null,retry:null,remove:null},inject:{kendoLocalizationService:{default:null}},data:()=>({retryFocused:!1,actionFocused:!1}),methods:{actionButtonTitle:(e,t)=>e===r.Uploading?t.toLanguageString(d,D[d]):t.toLanguageString(y,D[y]),retryButtonTitle:e=>e.toLanguageString(b,D[b]),buttonClassNames(e){return n.classNames(this.actionFocused&&"action"===e||this.retryFocused&&"retry"===e?"k-focus":"")},onRetryFocus(){this.retryFocused=!0},onRetryBlur(){this.retryFocused=!1},onActionFocus(){this.actionFocused=!0},onActionBlur(){this.actionFocused=!1},onActionClick(){const{status:e,uid:t,disabled:n}=this.$props;n||e===r.Removing||(e===r.Uploading?this.$emit("cancel",t):this.$emit("remove",t))},onRetryClick(){const{uid:e,disabled:t}=this.$props;t||this.$emit("retry",e)}},setup:()=>({kendoLocalizationService:t.inject("kendoLocalizationService",{})}),render(){const{status:e,progress:n}=this.$props,o=e===r.UploadFailed,l=e===r.Uploading,d=(e===r.Uploaded||e===r.Initial)&&!this.$props.async.removeUrl,c=i.provideLocalizationService(this);return t.createVNode("div",{class:"k-upload-actions"},[l?t.createVNode("span",{class:"k-upload-pct"},[n,"%"]):void 0,o?t.createVNode(s.Button,{type:"button",fillMode:"flat",tabIndex:-1,disabled:this.disabled,class:this.buttonClassNames("retry"),icon:"arrow-rotate-cw-small",svgIcon:a.arrowRotateCwIcon,iconClass:"k-retry",ariaLabel:this.retryButtonTitle(c),title:this.retryButtonTitle(c),onFocus:this.onRetryFocus,onBlur:this.onRetryBlur,onClick:this.onRetryClick},null):void 0,d?void 0:t.createVNode(s.Button,{type:"button",fillMode:"flat",tabIndex:-1,disabled:this.disabled,class:this.buttonClassNames("action"),onFocus:this.onActionFocus,onBlur:this.onActionBlur,onClick:this.onActionClick,icon:l?"deny":"x",svgIcon:l?a.cancelIcon:a.xIcon,ariaLabel:this.actionButtonTitle(e,c),title:this.actionButtonTitle(e,c)},null)])}}),K=t.defineComponent({name:"KendoVueUploadListSingleItem",props:{files:Array,disabled:Boolean,async:Object},emits:{cancel:null,retry:null,remove:null},inject:{kendoLocalizationService:{default:null}},methods:{onRetry(e){this.$emit("retry",e)},onRemove(e){this.$emit("remove",e)},onCancel(e){this.$emit("cancel",e)},getFileExtension:e=>e.extension?e.extension.substring(1):"",getFileValidationMessage(e,t){const n=i.provideLocalizationService(this);let o="";if(t)o=n.toLanguageString(B,D[B]);else if(e.validationErrors&&e.validationErrors.length>0){const t=`upload.${e.validationErrors[0]}`;o=n.toLanguageString(t,D[t])}return o},getFileExtensionName(e){switch(e.extension){case".png":case".jpg":case".jpeg":case".tiff":case".bmp":case".gif":return"file-image";case".mp3":case".mp4":case".wav":return"file-audio";case".mkv":case".webm":case".flv":case".gifv":case".avi":case".wmv":return"file-video";case".txt":return"file-txt";case".pdf":return"file-pdf";case".ppt":case".pptx":return"file-presentation";case".csv":case".xls":case".xlsx":return"file-data";case".html":case".css":case".js":case".ts":return"file-programming";case".exe":return"file-config";case".zip":case".rar":return"file-zip";default:return"file"}},getFileExtensionSVG(e){switch(e.extension){case".png":case".jpg":case".jpeg":case".tiff":case".bmp":case".gif":return a.fileImageIcon;case".mp3":case".mp4":case".wav":return a.fileAudioIcon;case".mkv":case".webm":case".flv":case".gifv":case".avi":case".wmv":return a.fileVideoIcon;case".txt":return a.fileTxtIcon;case".pdf":return a.filePdfIcon;case".ppt":case".pptx":return a.filePresentationIcon;case".csv":case".xls":case".xlsx":return a.fileDataIcon;case".html":case".css":case".js":case".ts":return a.fileProgrammingIcon;case".exe":return a.fileConfigIcon;case".zip":case".rar":return a.fileZipIcon;default:return a.fileIcon}}},setup:()=>({kendoLocalizationService:t.inject("kendoLocalizationService",{})}),render(){const{files:e,disabled:s,async:a}=this.$props,l=e[0],r=n.classNames("k-file-single"),[,d,c,u]=_.getFileStatus([l]),p=!u&&!d&&!c;return t.createVNode("div",{class:r},[p&&t.createVNode(o.ProgressBar,{value:l.progress||0,labelVisible:!1},null),t.createVNode("span",{class:"k-file-icon-wrapper",key:"1"},[t.createVNode(n.Icon,{name:this.getFileExtensionName(l),icon:this.getFileExtensionSVG(l),size:"xxxlarge",class:"k-file-icon"},null),t.createVNode("span",{class:"k-file-state"},null)]),u||c?function(e,n){return t.createVNode("span",{class:"k-file-info",key:"2"},[t.createVNode("span",{class:"k-file-name",title:e.name},[e.name]),t.createVNode("span",{class:"k-file-validation-message"},[this.getFileValidationMessage(e,n)])])}.call(this,l,c):function(e){const n=i.provideLocalizationService(this).toLanguageString(N,D[N]);return t.createVNode("span",{class:"k-file-info",key:"2"},[t.createVNode("span",{class:"k-file-name",title:e.name},[e.name]),100!==e.progress?t.createVNode("span",{class:"k-file-size"},[_.getTotalFilesSizeMessage([e])]):t.createVNode("span",{class:"k-file-validation-message"},[n])])}.call(this,l),t.createVNode(T,{uid:l.uid,status:l.status,progress:l.progress,files:e,disabled:s,async:a,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry},null)])}}),M=t.defineComponent({name:"KendoVueUploadListMultiItem",props:{files:Array,disabled:Boolean,async:Object},emits:{cancel:null,retry:null,remove:null},inject:{kendoLocalizationService:{default:null}},methods:{onRetry(e){this.$emit("retry",e)},onRemove(e){this.$emit("remove",e)},onCancel(e){this.$emit("cancel",e)},getFileValidationMessage(e){const t=i.provideLocalizationService(this);let n="";if(e.validationErrors&&e.validationErrors.length>0){const i=`upload.${e.validationErrors[0]}`;n=t.toLanguageString(i,D[i])}return n},progress(){const{files:e}=this.$props;let t=0;return e.forEach((e=>{t+=e.progress||0})),t/e.length}},setup:()=>({kendoLocalizationService:t.inject("kendoLocalizationService",{})}),render(){const{files:e,disabled:s,async:l}=this.$props,r=n.classNames("k-file-multiple"),[,d,c,u]=_.getFileStatus(e),p=i.provideLocalizationService(this),h=p.toLanguageString(x,D[x]),m=p.toLanguageString(C,D[C]),f=p.toLanguageString(B,D[B]),v=p.toLanguageString(N,D[N]),g=this.progress(),y=!u&&!d&&!c;return t.createVNode("div",{class:r},[y&&t.createVNode(o.ProgressBar,{value:g||0,labelVisible:!1},null),t.createVNode("span",{class:"k-file-icon-wrapper"},[t.createVNode(n.Icon,{name:"copy",icon:a.copyIcon,size:"xxxlarge",class:"k-file-icon"},null)]),t.createVNode("span",{class:"k-multiple-files-wrapper"},[function(){return e.map((function(e){return t.createVNode("span",{key:e.name,class:"k-file-info"},[t.createVNode("span",{class:"k-file-name",title:e.name},[e.name]),_.fileHasValidationErrors(e)?t.createVNode("span",{class:"k-file-validation-message"},[this.getFileValidationMessage(e)]):t.createVNode("span",{key:`${e.name}-size`,class:"k-file-size"},[_.getTotalFilesSizeMessage([e])])])}),this)}.call(this),c?t.createVNode("span",{class:"k-file-validation-message"},[`${e.length} ${f}`]):100!==g?t.createVNode("span",{class:"k-file-summary"},[`${h}: ${e.length} ${m}, ${_.getTotalFilesSizeMessage(e)}`]):t.createVNode("span",{class:"k-file-summary k-text-success"},[`${e.length} ${v}`])]),t.createVNode(T,{uid:e[0].uid,status:e[0].status,progress:g,files:e,disabled:s,async:l,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry},null)])}}),Z=t.defineComponent({name:"KendoVueUploadListGroup",props:{files:Array,async:Object,disabled:Boolean,navigationIndex:Number,list:[String,Function,Object],index:Number},emits:{cancel:null,click:null,retry:null,remove:null},mounted(){this._element=this.elementRef},updated(){const{navigationIndex:e,index:t}=this.$props;e===t&&this._element&&n.canUseDOM&&document.activeElement!==this._element&&this._element.focus()},methods:{onClick(){this.$emit("click",this.$props.index)},onRetry(e){this.$emit("retry",e)},onRemove(e){this.$emit("remove",e)},onCancel(e){this.$emit("cancel",e)}},setup:()=>({elementRef:t.ref(null)}),render(){const{files:e,async:i,disabled:o,navigationIndex:s,index:a}=this.$props,l=e[0],d=l.status===r.Uploaded||l.status===r.Initial,c=_.filesHaveValidationErrors(e),u=l.status===r.UploadFailed||l.status===r.RemoveFailed,p=n.classNames("k-file",{"k-file-invalid":c,"k-file-error":u||c,"k-file-progress":l.status===r.Uploading,"k-file-success":d,"k-focus":s===a});let h;const m=1===e.length?t.createVNode(K,{files:e,async:i,disabled:o,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry},null):t.createVNode(M,{files:e,async:i,disabled:o,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry},null);return h=n.getTemplate.call(this,{h:t.h,template:this.$props.list,defaultRendering:m,additionalProps:this.$props,additionalListeners:{retry:this.onRetry,remove:this.onRemove,cancel:this.onCancel}}),t.createVNode("li",{ref:n.setRef(this,"element"),class:p,"data-uid":l.uid,tabindex:-1,onClick:this.onClick},[h])}}),P=t.defineComponent({name:"KendoVueUploadList",props:{groupedFiles:Object,async:Object,disabled:Boolean,navigationIndex:{type:Number,default:void 0},list:[String,Function,Object]},emits:{cancel:null,click:null,retry:null,remove:null},methods:{onClick(e){this.$emit("click",e)},onRetry(e){this.$emit("retry",e)},onRemove(e){this.$emit("remove",e)},onCancel(e){this.$emit("cancel",e)}},render(){const{groupedFiles:e,navigationIndex:i,async:o,disabled:s,list:a}=this.$props,l=n.classNames("k-upload-files","k-reset");return t.createVNode("ul",{class:l},[Object.keys(e).map((function(n,l){const r=e[n];return t.createVNode(Z,{key:n,files:r,index:l,navigationIndex:i,async:o,disabled:s,list:a,onCancel:this.onCancel,onClick:this.onClick,onRemove:this.onRemove,onRetry:this.onRetry},null)}),this)])}});function H(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const G=t.defineComponent({name:"KendoVueUploadActionButtons",props:{disabled:Boolean,navigationIndex:Number,clearButtonIndex:Number,uploadButtonIndex:Number,actionsLayout:String},inject:{kendoLocalizationService:{default:null}},emits:{clear:null,click:null,upload:null},created(){this._prevNavigationIndex=void 0},setup:()=>({uploadElementRef:t.ref(null),clearElementRef:t.ref(null),kendoLocalizationService:t.inject("kendoLocalizationService",{})}),mounted(){this._clearElement=this.clearElementRef,this._uploadElement=this.uploadElementRef},watch:{navigationIndex:function(e,t){this._prevNavigationIndex=t}},updated(){const{navigationIndex:e,clearButtonIndex:t,uploadButtonIndex:n}=this.$props;e!==this._prevNavigationIndex&&(e===t&&this._clearElement&&this._clearElement.focus(),e===n&&this._uploadElement&&this._uploadElement.focus())},methods:{onClearClick(){this.$props.disabled||this.$emit("clear")},onUploadClick(){this.$props.disabled||(this.$emit("click",this.$props.uploadButtonIndex),this.$emit("upload"))}},render(){let e,o;const{disabled:a,navigationIndex:l,clearButtonIndex:r,uploadButtonIndex:d,actionsLayout:u}=this.$props,p=i.provideLocalizationService(this),h=n.classNames("k-actions",{"k-actions-start":"start"===u,"k-actions-center":"center"===u,"k-actions-end":"end"===u,"k-actions-stretched":"stretched"===u}),m=n.classNames("k-clear-selected",l===r?"k-focus":""),f=n.classNames("k-upload-selected",l===d?"k-focus":"");return t.createVNode("div",{class:h},[t.createVNode(s.Button,{type:"button",ref:e=>{this.clearElementRef=e},disabled:a,class:m,tabIndex:-1,onClick:this.onClearClick},H(e=p.toLanguageString(c,D[c]))?e:{default:()=>[e]}),t.createVNode(s.Button,{type:"button",ref:e=>{this.uploadElementRef=e},disabled:a,themeColor:"primary",class:f,tabIndex:-1,onClick:this.onUploadClick},H(o=p.toLanguageString(I,D[I]))?o:{default:()=>[o]})])}}),q=/(chrome)[ \/]([\w.]+)/i,J=/(webkit)[ \/]([\w.]+)/i,Q=t.defineComponent({name:"KendoVueUploadInput",props:{async:Object,id:String,multiple:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},accept:{type:String,default:void 0},hasFiles:{type:Boolean,default:!1},ariaLabelledBy:{type:String,default:void 0},ariaDescribedBy:{type:String,default:void 0}},emits:{mousedown:null,add:null},inject:{kendoLocalizationService:{default:null}},mounted(){this._input=this.inputRef},methods:{onMouseDown(e){this.$emit("mousedown",e)},onAdd(){const e=navigator.userAgent,t=this._input;t&&(t.files&&this.$emit("add",t.files),!e.match(q)&&e.match(J)||(t.type="",t.type="file"))},actionElement(){return this._input}},setup:()=>({inputRef:t.ref(null)}),render(){const{multiple:e,async:o,disabled:s,accept:a,hasFiles:l,ariaLabelledBy:r,ariaDescribedBy:d}=this.$props,c=i.provideLocalizationService(this),u=l?k:S,p=c.toLanguageString(u,D[u]),h=c.toLanguageString(F,D[F]);return t.createVNode("input",{ref:n.setRef(this,"input"),id:this.id,class:"k-hidden",autocomplete:"off",name:o.saveField,accept:a,type:"file",tabindex:-1,multiple:e,disabled:s,onChange:this.onAdd,onMousedown:this.onMouseDown,title:p,"aria-label":void 0!==r?void 0:h,"aria-labelledby":r,"aria-describedby":d},null)}});function W(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const X=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:()=>({elementRef:t.ref(null),uploadInputRef:t.ref(null),kendoLocalizationService:t.inject("kendoLocalizationService",{})}),created(){this.uploadInputId=n.guid()},mounted(){this.element=this.elementRef,this.uploadInput=this.uploadInputRef},watch:{navigationIndex:function(e,t){this._prevNavigationIndex=t}},updated(){const{navigationIndex:e,addButtonIndex:t,notFocusedIndex:n}=this.$props;e!==this._prevNavigationIndex&&this._prevNavigationIndex!==n&&e===t&&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:o,tabIndex:a,id:l,async:r,multiple:d,disabled:c,accept:u,ariaLabelledBy:p,ariaDescribedBy:h}=this.$props,m=i.provideLocalizationService(this).toLanguageString(F,D[F]),f=n.classNames("k-upload-button",e===o?"k-focus":"");return t.createVNode("div",{class:"k-upload-button-wrap"},[t.createVNode(s.Button,{id:l,ref:n.setRef(this,"element"),role:"button",type:"button",disabled:c,ariaLabel:m,class:f,tabIndex:a,"aria-labelledby":p,"aria-describedby":h,onClick:this.onClick},W(m)?m:{default:()=>[m]}),t.createVNode(Q,{id:this.uploadInputId,async:r,multiple:d,disabled:c,accept:u,onMousedown:this.onInputMouseDown,onAdd:this.onAdd,ref:e=>{this.uploadInputRef=e}},null)])}}),Y=t.defineComponent({props:{isUploading:Boolean,isUploaded:Boolean,isUploadFailed:Boolean},inject:{kendoLocalizationService:{default:null}},setup:()=>({kendoLocalizationService:t.inject("kendoLocalizationService",{})}),render(){const{isUploading:e,isUploaded:o,isUploadFailed:s}=this.$props;let l="";const r=i.provideLocalizationService(this);return e?l=r.toLanguageString(h,D[h]):(o||s)&&(l=r.toLanguageString(p,D[p])),t.createVNode("div",{class:n.classNames("k-upload-status")},[t.createVNode(n.Icon,{name:e||s||!o?!e&&s?"exclamation-circle":e?"upload":"":"check",icon:e||s||!o?!e&&s?a.exclamationCircleIcon:e?a.uploadIcon:{}:a.checkIcon},null),l])}}),ee=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:()=>({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:()=>({uploadAddButtonRef:t.ref(null),kendoLocalizationService:t.inject("kendoLocalizationService",{})}),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,100)}},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,100)}},onElementDragOver(e){e.preventDefault(),this._lastElementDragOver=new Date},onDrop(e){e.preventDefault();let t=e.dataTransfer.files;t.length>0&&!this.$props.disabled&&this.$emit("add",t)},isDragOver:e=>(new Date).getTime()-(e||new Date).getTime()>100,onClick(e){this.$emit("click",e)},onAdd(e){this.$emit("add",e)}},render(){const{multiple:e,disabled:o,tabIndex:s,fileGroup:a,accept:l,navigationIndex:r,notFocusedIndex:d,id:c,ariaLabelledBy:p,ariaDescribedBy:h}=this.$props,m=i.provideLocalizationService(this).toLanguageString(u,D[u]),[f,v,g,y]=_.getFileStatus(a),b=n.classNames("k-dropzone-hint",{});return t.createVNode("div",{class:this.dropZoneClasses,onDrop:this.onDrop,onDragenter:this.onElementDragEnter,onDragover:this.onElementDragOver},[function(){return t.createVNode(X,{id:c,ariaLabelledBy:p,ariaDescribedBy:h,ref:e=>{this.uploadAddButtonRef=e},accept:l,async:this.async,addButtonIndex:this.addButtonIndex,navigationIndex:r,notFocusedIndex:d,tabIndex:s,multiple:e,disabled:o,onClick:this.onClick,onAdd:this.onAdd},null)}.call(this),f||v||g||y?t.createVNode(Y,{isUploading:f,isUploaded:v,isUploadFailed:g},null):t.createVNode("div",{class:b},[m])])}}),te=t.defineComponent({name:"KendoVueUploadUI",props:{async:Object,className:String,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},computed:{groupsCount(){return Object.keys(this.$props.groupedFiles).length},lastGroupIndex(){return this.groupsCount-1},addButtonIndex:()=>-1,clearButtonIndex(){return this.lastGroupIndex+1},uploadButtonIndex(){return this.lastGroupIndex+2},isRtl(){return this._container&&"rtl"===getComputedStyle(this._container).direction||!1}},methods:{actionElement(){if(this.uploadDropZone)return this.uploadDropZone.actionElement()},focus(){if(this.uploadDropZone)return this.uploadDropZone.focus()},onAdd(e){this.$emit("add",e)},onRetry(e){this.$emit("retry",e)},onCancel(e){this.$emit("cancel",e)},onClear(){this.$emit("clear")},onUpload(){this.$emit("upload")},onRemove(e){this.$emit("remove",e)},onKeyDown(e){this.$emit("keydown",e,this.isRtl)},onFocus(e){this.$emit("focus",e)},onBlur(e){this.$emit("blur",e)},onClick(e){this.$emit("click",e)}},emits:{add:null,retry:null,cancel:null,clear:null,upload:null,remove:null,keydown:null,click:null,focus:null,blur:null},mounted(){this._container=this.containerRef,this.uploadDropZone=this.uploadDropZoneRef},setup:()=>({containerRef:t.ref(null),uploadDropZoneRef:t.ref(null)}),render(){const{multiple:e,disabled:i,tabIndex:o,accept:s,showFileList:a,groupedFiles:l,navigationIndex:r,showActionButtons:d,actionsLayout:c,notFocusedIndex:u,list:p,id:h,ariaLabelledBy:m,ariaDescribedBy:f,async:v}=this.$props,g=n.classNames("k-upload","k-upload-async",this.$props.className,i?"k-disabled":"");return t.createVNode("div",{ref:n.setRef(this,"container"),class:g,onKeydown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur},[t.createVNode(ee,{id:h,ariaLabelledBy:m,ariaDescribedBy:f,ref:e=>{this.uploadDropZoneRef=e},accept:s,async:v,addButtonIndex:this.addButtonIndex,navigationIndex:r,notFocusedIndex:u,tabIndex:o,multiple:e,onClick:this.onClick,onAdd:this.onAdd,fileGroup:l,disabled:i},null),a?t.createVNode(P,{groupedFiles:l,disabled:i,async:v,navigationIndex:r,list:p,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry,onClick:this.onClick},null):void 0,d?t.createVNode(G,{disabled:i,navigationIndex:r,clearButtonIndex:this.clearButtonIndex,uploadButtonIndex:this.uploadButtonIndex,actionsLayout:c,onUpload:this.onUpload,onClear:this.onClear,onClick:this.onClick},null):void 0])}}),ne=-2,ie=-1,oe=t.defineComponent({name:"KendoVueUploadNavigation",props:{async:Object,className:String,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{}}},notFocusedIndex:Number,list:[String,Function,Object],id:String,ariaLabelledBy:String,ariaDescribedBy:String,restrictions:Object,files:Array,defaultFiles:Array},emits:{add:null,cancel:null,clear:null,upload:null,retry:null,remove:null},data:()=>({currentNavIndex:ne}),updated(){},methods:{actionElement(){if(this._uploadUI)return this._uploadUI.actionElement()},navIndex(e){if(void 0===e)return this.currentNavIndex;const t=this.navIndex;this.currentNavIndex=e,e!==t&&this.$forceUpdate()},focus(){this._uploadUI&&this._uploadUI.focus()},onKeyDown(e,t){var i;const o=this.navIndex(),s=Object.keys(this.$props.groupedFiles),a=s.length-1,l=this.$props.autoUpload||0===s.length?a:a+1,r=a+1,d=r+1,c=o===ne?ie:o;let u=o;switch(e.keyCode){case n.Keys.up:e.preventDefault(),o>-1&&(u=c-1);break;case n.Keys.down:e.preventDefault(),o<l&&(u=c+1);break;case n.Keys.left:e.preventDefault(),t?o===r&&(u=c+1):o===d&&(u=c-1);break;case n.Keys.right:e.preventDefault(),t?o===d&&(u=c-1):o===r&&(u=c+1);break;case n.Keys.enter:(o===ie||o===ne)&&this.actionElement()&&n.canUseDOM&&-1===(null==(i=document.activeElement)?void 0:i.className.indexOf("k-upload-button"))&&this.actionElement().$el.click(),o>=0&&o<=a&&this.onRetry(s[o]);break;case n.Keys.space:e.preventDefault(),(o===ie||o===ne)&&this.actionElement()&&this.actionElement().$el.click();break;case n.Keys.tab:u=ne;break;case n.Keys.delete:o>=0&&o<=a&&(u=c-1,this.onRemove(s[o]));break;case n.Keys.esc:o>=0&&o<=a&&(u=c-1,this.onCancel(s[o]))}this.navIndex(u)},onCancel(e){this.$emit("cancel",e)},onClear(){this.navIndex(ie),this.$emit("clear")},onUpload(){this.navIndex(ie),this.$emit("upload")},onRetry(e){this.$emit("retry",e)},onRemove(e){this.navIndex(this.navIndex()>ie?this.navIndex()-1:ie),this.$emit("remove",e)},onAdd(e){this.navIndex(ie),this.$emit("add",e)},onClick(e){this.navIndex(e)},onFocus(){this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=void 0)},onBlurTimeout(){this.navIndex(ne),this._blurTimeout=void 0},onBlur(){clearTimeout(this._blurTimeout),this._blurTimeout=window.setTimeout(this.onBlurTimeout)}},mounted(){this._uploadUI=this.uploadUIRef},setup:()=>({uploadUIRef:t.ref(null)}),render(){const{multiple:e,disabled:n,showFileList:i,showActionButtons:o,actionsLayout:s,tabIndex:a,accept:l,groupedFiles:r,list:d,id:c,ariaLabelledBy:u,ariaDescribedBy:p,async:h}=this.$props;return t.createVNode(te,{ref:e=>{this.uploadUIRef=e},class:this.$props.className,onKeydown:this.onKeyDown,navigationIndex:this.currentNavIndex,notFocusedIndex:ne,onAdd:this.onAdd,onClear:this.onClear,onUpload:this.onUpload,onRemove:this.onRemove,onRetry:this.onRetry,onCancel:this.onCancel,onClick:this.onClick,onFocus:this.onFocus,onBlur:this.onBlur,multiple:e,disabled:n,showFileList:i,showActionButtons:o,actionsLayout:s,tabIndex:a,accept:l,groupedFiles:r,list:d,id:c,ariaLabelledBy:u,ariaDescribedBy:p,async:h},null)}}),se=(e,t)=>{t.push(e)},ae=(e,t)=>{Object.keys(e).forEach((n=>{t(e[n],n)}))},le={copyState:e=>(e||[]).map((e=>({...e}))),addMany:(e,t)=>{e.forEach((e=>se(e,t)))},add:se,groupFilesByUid:e=>{const t={};return e.forEach((e=>{t[e.uid]?t[e.uid].push(e):t[e.uid]=[e]})),t},filesForUpload:e=>{const t={};return ae(e,((e,n)=>{let i=!0;e.forEach((e=>{(e.status!==r.Selected||e.validationErrors&&e.validationErrors.length>0)&&(i=!1)})),i&&(t[n]=e)})),t},setFilesStatus:(e,t)=>{ae(e,(e=>{e.forEach((e=>{e.status=t}))}))},flatFileGroup:e=>{const t=[];return ae(e,(e=>{t.push.apply(t,e)})),t},groupForEach:ae},re=(e,t)=>{Object.keys(t).forEach((n=>{e.append(n,t[n])}))},de=(e,t,n)=>{const i=new FormData;return re(i,n),e.forEach((e=>{const n=e.getRawFile?e.getRawFile():"";n?i.append(t,n,e.name):i.append(t,n)})),i},ce=(e,t,n)=>{const i=new FormData;return re(i,n),e.forEach((e=>{i.append(t,e)})),i},ue=(e,t)=>({headers:e,responseType:t.responseType,withCredentials:t.withCredentials}),pe=e=>{const t={};return Object.keys(e).forEach((n=>{t[n]=e[n]})),t},he=e=>{const{data:t,config:n,...i}=e;return{response:t,...i}},me="invalidMaxFileSize",fe="invalidMinFileSize",ve="invalidFileExtension",ge=(e,t)=>{t.length>0&&t.indexOf((e.extension||"").toLowerCase())<0&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf(ve)<0&&e.validationErrors.push(ve))},ye=(e,t,n)=>{0!==t&&(e.size||0)<t&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf(fe)<0&&e.validationErrors.push(fe)),0!==n&&(e.size||0)>n&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf(me)<0&&e.validationErrors.push(me))},be=(e,t,n)=>{const i=(e=>e.map((e=>("."===e.substring(0,1)?e:"."+e).toLowerCase())))(t.allowedExtensions||[]),o=t.maxFileSize||0,s=t.minFileSize||0;let a;for(a=0;a<e.length;a++)ge(e[a],i),ye(e[a],s,o),n&&n(e[a])},Fe={name:"@progress/kendo-vue-upload",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1619764257,version:"6.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"},ke=t.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={},n.validatePackage(Fe),this.$props.defaultFiles&&(this.currentFiles=this.$props.defaultFiles)},data:()=>({currentFiles:[]}),computed:{computedAsync(){const{autoUpload:e,batch:t,removeField:n,removeHeaders:i,removeMethod:o,removeUrl:s,responseType:a,saveField:l,saveHeaders:r,saveMethod:d,saveUrl:c,withCredentials:u}=this.$props;return{autoUpload:e,batch:t,removeField:n,removeHeaders:i,removeMethod:o,removeUrl:s,responseType:a,saveField:l,saveHeaders:r,saveMethod:d,saveUrl:c,withCredentials:u}},computedFiles(){return(this.isControlled?this.$props.files:this.currentFiles)||[]},isControlled(){return!this.$props.defaultFiles},isCustomSave(){return this.$props.saveUrl&&"function"==typeof this.$props.saveUrl},isCustomRemove(){return this.$props.removeUrl&&"function"==typeof this.$props.removeUrl},fileStateCopy(){return le.copyState(this.computedFiles)},actionElement(){if(this._uploadNavigation)return this._uploadNavigation.actionElement}},mounted(){this._uploadNavigation=this.uploadNavigationRef},methods:{focus(){this._uploadNavigation&&this._uploadNavigation.focus()},uploadFiles(e){const t=this.computedAsync;le.setFilesStatus(e,r.Uploading),le.groupForEach(e,((e,n)=>{const i={target:this,files:e,headers:pe(t.saveHeaders||{}),additionalData:{}};this.$emit("beforeupload",i);const o=ue(i.headers,this.computedAsync),s=de(e,t.saveField,i.additionalData);if(this.isCustomSave)this.$props.saveUrl(e,{formData:s,requestOptions:o},this.onUploadProgress).then((e=>this.onUploadSuccess(e.uid))).catch((e=>this.onUploadError(e.uid)));else{const e=l.CancelToken.source();this._httpSubscriptions[n]=e,l({method:t.saveMethod,url:t.saveUrl,data:s,cancelToken:e.token,...o,onUploadProgress:e=>this.onUploadProgress(n,e)}).then((e=>this.onUploadSuccess(n,e))).catch((e=>this.onUploadError(n,e)))}}))},removeFiles(e){const t=this.computedAsync;le.groupForEach(e,((e,n)=>{const i={target:this,files:e,headers:pe(t.removeHeaders||{}),additionalData:{}};this.$emit("beforeremove",i);const o=e.map((e=>e.name)),s=ue(i.headers,this.computedAsync),a=ce(o,t.removeField,i.additionalData);this.isCustomRemove?this.$props.removeUrl(e,{formData:a,requestOptions:s}).then((e=>this.onRemoveSuccess(e.uid))).catch((e=>this.onRemoveError(e.uid))):l({method:t.removeMethod,url:t.removeUrl,data:a,...s}).then((e=>this.onRemoveSuccess(n,e))).catch((e=>this.onRemoveError(n,e)))}))},onUpload(){const e=this.fileStateCopy,t=le.groupFilesByUid(e),n=le.filesForUpload(t);this.uploadFiles(n);this.isControlled||(this.currentFiles=e),(()=>{const t={target:this,newState:e,affectedFiles:le.flatFileGroup(n)};this.$emit("statuschange",t)})()},onAdd(e){let t,n=_.getAllFileInfo(e);if(n=_.assignGuidToFiles(n,this.computedAsync.batch),be(n,this.$props.restrictions,this.validateFile),t=this.$props.multiple?this.fileStateCopy:[],le.addMany(n,t),this.computedAsync.autoUpload){const e=le.groupFilesByUid(t);this.uploadFiles(le.filesForUpload(e))}this.isControlled||(this.currentFiles=t),(()=>{const e={target:this,newState:t,affectedFiles:n};this.$emit("add",e)})()},onUploadProgress(e,t){const n=t.total?Math.round(100*t.loaded/t.total):0,i=this.fileStateCopy,o=i.filter((t=>t.uid===e));if(!o.length)return;o.forEach((e=>{e.progress=n}));this.isControlled||(this.currentFiles=i),(()=>{const e={target:this,newState:i,affectedFiles:o};this.$emit("progress",e)})()},onUploadSuccess(e,t){const n=this.fileStateCopy,i=n.filter((t=>t.uid===e));i.forEach((e=>{e.status=r.Uploaded})),delete this._httpSubscriptions[e];this.isControlled||(this.currentFiles=n),(()=>{const e={target:this,newState:n,affectedFiles:i,response:t?he(t):void 0};this.$emit("statuschange",e)})()},onUploadError(e,t){const n=this.fileStateCopy,i=n.filter((t=>t.uid===e));if(i.forEach((e=>{e.status=r.UploadFailed})),delete this._httpSubscriptions[e],!i.length)return;this.isControlled||(this.currentFiles=n),(()=>{const e={target:this,newState:n,affectedFiles:i,response:t?he(t):void 0};this.$emit("statuschange",e)})()},onRemove(e){const t=this.fileStateCopy,n=t.filter((t=>t.uid===e)),i=t.filter((t=>t.uid!==e)),o=[r.Uploaded,r.Initial,r.RemoveFailed];if(n[0]&&o.indexOf(n[0].status)>-1){const i={[e]:n};le.setFilesStatus(i,r.Removing),this.removeFiles(i);const o=()=>{const e={target:this,newState:t,affectedFiles:n};this.$emit("statuschange",e)};this.isControlled||(this.currentFiles=t),o()}else{const e=()=>{const e={target:this,newState:i,affectedFiles:n};this.$emit("remove",e)};this.isControlled||(this.currentFiles=i),e()}},onRemoveSuccess(e,t){const n=this.fileStateCopy,i=n.filter((t=>t.uid===e)),o=n.filter((t=>t.uid!==e));this.isControlled||(this.currentFiles=o),(()=>{const e={target:this,newState:o,affectedFiles:i,response:t?he(t):void 0};this.$emit("remove",e)})()},onRemoveError(e,t){const n=this.fileStateCopy,i=n.filter((t=>t.uid===e));i.forEach((e=>{e.status=r.RemoveFailed}));this.isControlled||(this.currentFiles=n),(()=>{const e={target:this,newState:n,affectedFiles:i,response:t?he(t):void 0};this.$emit("statuschange",e)})()},onRetry(e){const t=this.fileStateCopy,n=le.groupFilesByUid(t.filter((t=>t.uid===e)));le.setFilesStatus(n,r.Uploading),this.uploadFiles(n);this.isControlled||(this.currentFiles=t),(()=>{const e={target:this,newState:t,affectedFiles:le.flatFileGroup(n)};this.$emit("statuschange",e)})()},onCancel(e){const t=this.fileStateCopy,n=t.filter((t=>t.uid!==e)),i=t.filter((t=>t.uid===e));this._httpSubscriptions[e]&&(this._httpSubscriptions[e].cancel(),delete this._httpSubscriptions[e]);const o={target:this,uid:e};this.$emit("cancel",o);this.isControlled||(this.currentFiles=t),(()=>{const e={target:this,newState:n,affectedFiles:i};this.$emit("remove",e)})()},onClear(){if(!this.computedFiles.length)return;Object.keys(this._httpSubscriptions).forEach((e=>{this._httpSubscriptions[e].cancel()})),this._httpSubscriptions={};this.isControlled||(this.currentFiles=[]),(()=>{const e={target:this,newState:[],affectedFiles:this.fileStateCopy};this.$emit("remove",e)})()}},render(){const{showFileList:e,autoUpload:i,showActionButtons:o,actionsLayout:s,tabIndex:a,disabled:l,batch:r,withCredentials:d,saveField:c,saveHeaders:u,saveMethod:p,saveUrl:h,responseType:m,removeField:f,removeHeaders:v,removeMethod:g,removeUrl:y,multiple:b,accept:F,restrictions:k,files:S,defaultFiles:I}=this.$props,x=n.templateRendering.call(this,this.$props.list,n.getListeners.call(this)),C=le.groupFilesByUid(this.computedFiles),N=le.filesForUpload(C);return t.createVNode(oe,{groupedFiles:C,className:this.$props.className,showFileList:e&&!!Object.keys(C).length,showActionButtons:o&&!i&&!!Object.keys(N).length,actionsLayout:s,disabled:l,onAdd:this.onAdd,onRemove:this.onRemove,onClear:this.onClear,onUpload:this.onUpload,onRetry:this.onRetry,onCancel:this.onCancel,tabIndex:n.getTabIndex(a,l),ref:e=>{this.uploadNavigationRef=e},multiple:b,accept:F,list:x,restrictions:k,files:S,defaultFiles:I,async:this.computedAsync},null)}}),Se=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(Fe),this.elementInterval=null,this.elementActive=!1,this.lastElementDragOverRef=null},data:()=>({overDropZone:!1}),mounted(){this.externalDropZone=this.externalDropZoneRef},methods:{focus(){this.externalDropZone&&this.externalDropZone.focus&&this.externalDropZone.focus()},isDragOver:e=>(new Date).getTime()-(e||new Date).getTime()>100,handleOnDrop(e){e.preventDefault();let t=e.dataTransfer.files,n=this.$parent.$refs[this.$props.uploadRef];t.length>0&&!this.$props.disabled&&n&&n.onAdd&&(e.preventDefault(),n.onAdd(t))},handleOnElementDragEnter(){this.elementActive=!0;this.elementInterval=setInterval((()=>{this.isDragOver(this.lastElementDragOver)&&(this.overDropZone=!1,this.elementActive=!1,clearInterval(this.elementInterval),this.elementInterval=null,this.lastElementDragOver=null)}),100)},handleOnElementDragOver(e){e.preventDefault(),this.lastElementDragOver=new Date,this.overDropZone=!0}},setup:()=>({externalDropZoneRef:t.ref(null),kendoLocalizationService:t.inject("kendoLocalizationService",{})}),render(){const{customNote:e,customHint:o}=this.$props,s=i.provideLocalizationService(this),l=s.toLanguageString(E,D[E]),r=s.toLanguageString($,D[$]),d=n.templateRendering.call(this,o,n.getListeners.call(this)),c=n.templateRendering.call(this,e,n.getListeners.call(this));let u;const p=t.createVNode("span",null,[l]);let h;u=n.getTemplate.call(this,{h:t.h,template:d,defaultRendering:p});const m=t.createVNode("span",null,[r]);return h=n.getTemplate.call(this,{h:t.h,template:c,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:a.uploadIcon,class:"k-dropzone-icon",size:"xxxlarge"},null),t.createVNode("span",{class:"k-dropzone-hint"},[u]),t.createVNode("span",{class:"k-dropzone-note"},[h])]),t.createVNode("div",{class:"k-upload"},null)])}});e.ExternalDropZone=Se,e.Upload=ke,e.UploadFileStatus=r,e.UploadListActionButton=T,e.UploadListMultiItem=M,e.UploadListSingleItem=K,e.UploadUI=te,e.messages=D,e.utils=_}));