@progress/kendo-vue-upload 6.3.0 → 6.4.0-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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"),a=require("@progress/kendo-vue-common"),b=require("@progress/kendo-vue-intl"),d=require("./messages/main.js"),f=require("./UploadInput.js"),v=require("@progress/kendo-vue-buttons");function g(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!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(){const e=t.ref(null),n=t.ref(null),o=t.inject("kendoLocalizationService",{});return{elementRef:e,uploadInputRef:n,kendoLocalizationService:o}},created(){this.uploadInputId=a.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:o}=this.$props;e!==this._prevNavigationIndex&&this._prevNavigationIndex!==o&&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:o,id:s,async:u,multiple:c,disabled:l,accept:r,ariaLabelledBy:p,ariaDescribedBy:m}=this.$props,i=b.provideLocalizationService(this).toLanguageString(d.select,d.messages[d.select]),h=a.classNames("k-upload-button",e===n?"k-focus":"");return t.createVNode("div",{class:"k-upload-button-wrap"},[t.createVNode(v.Button,{id:s,ref:a.setRef(this,"element"),role:"button",type:"button",disabled:l,ariaLabel:i,class:h,tabIndex:o,"aria-labelledby":p,"aria-describedby":m,onClick:this.onClick},g(i)?i:{default:()=>[i]}),t.createVNode(f.UploadInput,{id:this.uploadInputId,async:u,multiple:c,disabled:l,accept:r,onMousedown:this.onInputMouseDown,onAdd:this.onAdd,ref:I=>{this.uploadInputRef=I}},null)])}});exports.UploadAddButton=x;
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"),role:"button",type:"button",disabled:l,ariaLabel:a,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;
@@ -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 I, ref as d, inject as b, createVNode as o, isVNode as v } from "vue";
9
- import { guid as g, classNames as x, setRef as B } from "@progress/kendo-vue-common";
10
- import { provideLocalizationService as S } from "@progress/kendo-vue-intl";
11
- import { select as l, messages as k } from "./messages/main.mjs";
12
- import { UploadInput as y } from "./UploadInput.mjs";
13
- import { Button as N } from "@progress/kendo-vue-buttons";
14
- function L(e) {
15
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !v(e);
8
+ import { defineComponent as v, ref as s, inject as x, createVNode as o, isVNode as S } from "vue";
9
+ import { guid as B, classNames as k, setRef as y } from "@progress/kendo-vue-common";
10
+ import { provideLocalizationService as N } from "@progress/kendo-vue-intl";
11
+ import { select as u, messages as c, selectSingle as r } from "./messages/main.mjs";
12
+ import { UploadInput as L } from "./UploadInput.mjs";
13
+ import { Button as j } from "@progress/kendo-vue-buttons";
14
+ function w(e) {
15
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !S(e);
16
16
  }
17
- const _ = /* @__PURE__ */ I({
17
+ const $ = /* @__PURE__ */ v({
18
18
  name: "KendoVueUploadAddButton",
19
19
  props: {
20
20
  addButtonIndex: Number,
@@ -39,7 +39,7 @@ const _ = /* @__PURE__ */ I({
39
39
  click: null
40
40
  },
41
41
  setup() {
42
- const e = d(null), t = d(null), n = b("kendoLocalizationService", {});
42
+ const e = s(null), t = s(null), n = x("kendoLocalizationService", {});
43
43
  return {
44
44
  elementRef: e,
45
45
  uploadInputRef: t,
@@ -47,7 +47,7 @@ const _ = /* @__PURE__ */ I({
47
47
  };
48
48
  },
49
49
  created() {
50
- this.uploadInputId = g();
50
+ this.uploadInputId = B();
51
51
  },
52
52
  mounted() {
53
53
  this.element = this.elementRef, this.uploadInput = this.uploadInputRef;
@@ -88,44 +88,44 @@ const _ = /* @__PURE__ */ I({
88
88
  navigationIndex: e,
89
89
  addButtonIndex: t,
90
90
  tabIndex: n,
91
- id: s,
92
- async: u,
93
- multiple: c,
94
- disabled: a,
95
- accept: r,
96
- ariaLabelledBy: p,
97
- ariaDescribedBy: m
98
- } = this.$props, i = S(this).toLanguageString(l, k[l]), f = x("k-upload-button", e === t ? "k-focus" : "");
91
+ id: p,
92
+ async: m,
93
+ multiple: a,
94
+ disabled: d,
95
+ accept: f,
96
+ ariaLabelledBy: h,
97
+ ariaDescribedBy: I
98
+ } = this.$props, l = N(this), i = a ? l.toLanguageString(u, c[u]) : l.toLanguageString(r, c[r]), b = k("k-upload-button", e === t ? "k-focus" : "");
99
99
  return o("div", {
100
100
  class: "k-upload-button-wrap"
101
- }, [o(N, {
102
- id: s,
103
- ref: B(this, "element"),
101
+ }, [o(j, {
102
+ id: p,
103
+ ref: y(this, "element"),
104
104
  role: "button",
105
105
  type: "button",
106
- disabled: a,
106
+ disabled: d,
107
107
  ariaLabel: i,
108
- class: f,
108
+ class: b,
109
109
  tabIndex: n,
110
- "aria-labelledby": p,
111
- "aria-describedby": m,
110
+ "aria-labelledby": h,
111
+ "aria-describedby": I,
112
112
  onClick: this.onClick
113
- }, L(i) ? i : {
113
+ }, w(i) ? i : {
114
114
  default: () => [i]
115
- }), o(y, {
115
+ }), o(L, {
116
116
  id: this.uploadInputId,
117
- async: u,
118
- multiple: c,
119
- disabled: a,
120
- accept: r,
117
+ async: m,
118
+ multiple: a,
119
+ disabled: d,
120
+ accept: f,
121
121
  onMousedown: this.onInputMouseDown,
122
122
  onAdd: this.onAdd,
123
- ref: (h) => {
124
- this.uploadInputRef = h;
123
+ ref: (g) => {
124
+ this.uploadInputRef = g;
125
125
  }
126
126
  }, null)]);
127
127
  }
128
128
  });
129
129
  export {
130
- _ as UploadAddButton
130
+ $ as UploadAddButton
131
131
  };
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"),B=require("@progress/kendo-vue-common"),E=require("./UploadAddButton.js"),b=require("@progress/kendo-vue-intl"),o=require("./messages/main.js"),O=require("./utils/utils.js"),S=require("./UploadStatus.js"),r=100,y=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:s,accept:u,navigationIndex:c,notFocusedIndex:m,id:p,ariaLabelledBy:v,ariaDescribedBy:h}=this.$props,D=b.provideLocalizationService(this).toLanguageString(o.dropFilesHere,o.messages[o.dropFilesHere]),[i,a,d,g]=O.getFileStatus(s),f=B.classNames("k-dropzone-hint",{}),I=function(){return t.createVNode(E.UploadAddButton,{id:p,ariaLabelledBy:v,ariaDescribedBy:h,ref:A=>{this.uploadAddButtonRef=A},accept:u,async:this.async,addButtonIndex:this.addButtonIndex,navigationIndex:c,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},[I.call(this),i||a||d||g?t.createVNode(S.UploadStatus,{isUploading:i,isUploaded:a,isUploadFailed:d},null):t.createVNode("div",{class:f},[D])])}});exports.UploadDropZone=y;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),E=require("@progress/kendo-vue-common"),b=require("./UploadAddButton.js"),O=require("@progress/kendo-vue-intl"),o=require("./messages/main.js"),S=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,i=O.provideLocalizationService(this),D=e?i.toLanguageString(o.dropFilesHere,o.messages[o.dropFilesHere]):i.toLanguageString(o.dropFileHere,o.messages[o.dropFileHere]),[a,d,s,f]=S.getFileStatus(u),I=E.classNames("k-dropzone-hint",{}),A=function(){return t.createVNode(b.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},[A.call(this),a||d||s||f?t.createVNode(y.UploadStatus,{isUploading:a,isUploaded:d,isUploadFailed:s},null):t.createVNode("div",{class:I},[D])])}});exports.UploadDropZone=F;
@@ -5,14 +5,14 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as E, ref as B, inject as b, createVNode as n } from "vue";
9
- import { classNames as O } from "@progress/kendo-vue-common";
10
- import { UploadAddButton as S } from "./UploadAddButton.mjs";
11
- import { provideLocalizationService as _ } from "@progress/kendo-vue-intl";
12
- import { dropFilesHere as l, messages as y } from "./messages/main.mjs";
13
- import L from "./utils/utils.mjs";
14
- import { UploadStatus as k } from "./UploadStatus.mjs";
15
- const o = 100, T = /* @__PURE__ */ E({
8
+ import { defineComponent as O, ref as L, inject as S, createVNode as n } from "vue";
9
+ import { classNames as _ } from "@progress/kendo-vue-common";
10
+ import { UploadAddButton as y } from "./UploadAddButton.mjs";
11
+ import { provideLocalizationService as F } from "@progress/kendo-vue-intl";
12
+ import { dropFilesHere as d, messages as s, dropFileHere as u } from "./messages/main.mjs";
13
+ import k from "./utils/utils.mjs";
14
+ import { UploadStatus as x } from "./UploadStatus.mjs";
15
+ const o = 100, Z = /* @__PURE__ */ O({
16
16
  name: "KendoVueUploadDropZone",
17
17
  props: {
18
18
  addButtonIndex: Number,
@@ -74,7 +74,7 @@ const o = 100, T = /* @__PURE__ */ E({
74
74
  document.removeEventListener("dragenter", this.onDocumentDragEnter), document.removeEventListener("dragover", this.onDocumentDragOver);
75
75
  },
76
76
  setup() {
77
- const e = B(null), t = b("kendoLocalizationService", {});
77
+ const e = L(null), t = S("kendoLocalizationService", {});
78
78
  return {
79
79
  uploadAddButtonRef: e,
80
80
  kendoLocalizationService: t
@@ -142,31 +142,31 @@ const o = 100, T = /* @__PURE__ */ E({
142
142
  const {
143
143
  multiple: e,
144
144
  disabled: t,
145
- tabIndex: d,
146
- fileGroup: s,
147
- accept: u,
148
- navigationIndex: c,
149
- notFocusedIndex: m,
150
- id: p,
151
- ariaLabelledBy: v,
152
- ariaDescribedBy: h
153
- } = this.$props, D = _(this).toLanguageString(l, y[l]), [r, i, a, g] = L.getFileStatus(s), f = O("k-dropzone-hint", {
145
+ tabIndex: c,
146
+ fileGroup: m,
147
+ accept: p,
148
+ navigationIndex: v,
149
+ notFocusedIndex: h,
150
+ id: D,
151
+ ariaLabelledBy: g,
152
+ ariaDescribedBy: f
153
+ } = this.$props, r = F(this), I = e ? r.toLanguageString(d, s[d]) : r.toLanguageString(u, s[u]), [i, a, l, A] = k.getFileStatus(m), E = _("k-dropzone-hint", {
154
154
  // Unsure about that, since it hides the "Drop Files Message" when we remove all uploaded components.
155
155
  // 'k-hidden': this.isDragged && !this.elementActive
156
- }), I = function() {
157
- return n(S, {
158
- id: p,
159
- ariaLabelledBy: v,
160
- ariaDescribedBy: h,
161
- ref: (A) => {
162
- this.uploadAddButtonRef = A;
156
+ }), B = function() {
157
+ return n(y, {
158
+ id: D,
159
+ ariaLabelledBy: g,
160
+ ariaDescribedBy: f,
161
+ ref: (b) => {
162
+ this.uploadAddButtonRef = b;
163
163
  },
164
- accept: u,
164
+ accept: p,
165
165
  async: this.async,
166
166
  addButtonIndex: this.addButtonIndex,
167
- navigationIndex: c,
168
- notFocusedIndex: m,
169
- tabIndex: d,
167
+ navigationIndex: v,
168
+ notFocusedIndex: h,
169
+ tabIndex: c,
170
170
  multiple: e,
171
171
  disabled: t,
172
172
  onClick: this.onClick,
@@ -178,15 +178,15 @@ const o = 100, T = /* @__PURE__ */ E({
178
178
  onDrop: this.onDrop,
179
179
  onDragenter: this.onElementDragEnter,
180
180
  onDragover: this.onElementDragOver
181
- }, [I.call(this), r || i || a || g ? n(k, {
182
- isUploading: r,
183
- isUploaded: i,
184
- isUploadFailed: a
181
+ }, [B.call(this), i || a || l || A ? n(x, {
182
+ isUploading: i,
183
+ isUploaded: a,
184
+ isUploadFailed: l
185
185
  }, null) : n("div", {
186
- class: f
187
- }, [D])]);
186
+ class: E
187
+ }, [I])]);
188
188
  }
189
189
  });
190
190
  export {
191
- T as UploadDropZone
191
+ Z as UploadDropZone
192
192
  };
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !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,"&amp;").replace(R,"&lt;").replace(w,"&gt;").replace(L,"&quot;").replace(V,"&#39;"),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=_}));
15
+ !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.dropFileHere",p="upload.dropFilesHere",h="upload.headerStatusUploaded",m="upload.headerStatusUploading",f="upload.invalidFileExtension",g="upload.invalidFiles",v="upload.invalidMaxFileSize",y="upload.invalidMinFileSize",b="upload.remove",F="upload.retry",S="upload.select",k="upload.selectSingle",I="upload.selectTitle",x="upload.selectNoFilesTitle",C="upload.uploadSelectedFiles",N="upload.total",B="upload.files",D="upload.statusUploaded",E="upload.statusUploadFailed",$="upload.dropZoneHint",U="upload.dropZoneNote",R={[d]:"Cancel",[c]:"Clear",[u]:"Drop a file here to upload",[p]:"Drop files here to upload",[h]:"Done",[m]:"Uploading...",[f]:"File type not allowed.",[g]:"Invalid file(s). Please check file upload requirements.",[v]:"File size too large.",[y]:"File size too small.",[b]:"Remove",[F]:"Retry",[S]:"Select files...",[k]:"Select file...",[I]:"Press to select more files",[x]:"No files selected",[C]:"Upload",[N]:"Total",[B]:"files",[D]:"File(s) successfully uploaded.",[E]:"File(s) failed to upload.",[$]:"Drag and drop files here to upload.",[U]:"Only JPEG and PNG files are allowed."},L=/&/g,V=/</g,w=/"/g,O=/'/g,A=/>/g,z=e=>(""+e).replace(L,"&amp;").replace(V,"&lt;").replace(A,"&gt;").replace(w,"&quot;").replace(O,"&#39;"),j=e=>{const t=e.match(/\.([^\.]+)$/);return t?t[0]:""},_=e=>{const t=e.name,n=e.size;return{extension:j(t),name:z(t),getRawFile:()=>e,size:n,status:r.Selected,progress:0,uid:""}},T=e=>!!(e.validationErrors&&e.validationErrors.length>0),K={fileHasValidationErrors:T,filesHaveValidationErrors:e=>{for(const t of e)if(T(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(_(e[n]));return t},getFileInfo:_,getFileExtension:j,htmlEncode:z,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),T(e)&&(o=!0)}))};return Array.isArray(e)?s(e):Object.keys(e).forEach((t=>{s(e[t])})),[t,n,i,o]}},M=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,R[d]):t.toLanguageString(b,R[b]),retryButtonTitle:e=>e.toLanguageString(F,R[F]),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)])}}),Z=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(E,R[E]);else if(e.validationErrors&&e.validationErrors.length>0){const t=`upload.${e.validationErrors[0]}`;o=n.toLanguageString(t,R[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]=K.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(D,R[D]);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"},[K.getTotalFilesSizeMessage([e])]):t.createVNode("span",{class:"k-file-validation-message"},[n])])}.call(this,l),t.createVNode(M,{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)])}}),H=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,R[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]=K.getFileStatus(e),p=i.provideLocalizationService(this),h=p.toLanguageString(N,R[N]),m=p.toLanguageString(B,R[B]),f=p.toLanguageString(E,R[E]),g=p.toLanguageString(D,R[D]),v=this.progress(),y=!u&&!d&&!c;return t.createVNode("div",{class:r},[y&&t.createVNode(o.ProgressBar,{value:v||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]),K.fileHasValidationErrors(e)?t.createVNode("span",{class:"k-file-validation-message"},[this.getFileValidationMessage(e)]):t.createVNode("span",{key:`${e.name}-size`,class:"k-file-size"},[K.getTotalFilesSizeMessage([e])])])}),this)}.call(this),c?t.createVNode("span",{class:"k-file-validation-message"},[`${e.length} ${f}`]):100!==v?t.createVNode("span",{class:"k-file-summary"},[`${h}: ${e.length} ${m}, ${K.getTotalFilesSizeMessage(e)}`]):t.createVNode("span",{class:"k-file-summary k-text-success"},[`${e.length} ${g}`])]),t.createVNode(M,{uid:e[0].uid,status:e[0].status,progress:v,files:e,disabled:s,async:l,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry},null)])}}),P=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=K.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(Z,{files:e,async:i,disabled:o,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry},null):t.createVNode(H,{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])}}),G=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(P,{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 q(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const J=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},q(e=p.toLanguageString(c,R[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},q(o=p.toLanguageString(C,R[C]))?o:{default:()=>[o]})])}}),Q=/(chrome)[ \/]([\w.]+)/i,W=/(webkit)[ \/]([\w.]+)/i,X=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(W)||(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?I:x,p=c.toLanguageString(u,R[u]),h=c.toLanguageString(S,R[S]);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 Y(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const ee=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),f=d?m.toLanguageString(S,R[S]):m.toLanguageString(k,R[k]),g=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:f,class:g,tabIndex:a,"aria-labelledby":p,"aria-describedby":h,onClick:this.onClick},Y(f)?f:{default:()=>[f]}),t.createVNode(X,{id:this.uploadInputId,async:r,multiple:d,disabled:c,accept:u,onMousedown:this.onInputMouseDown,onAdd:this.onAdd,ref:e=>{this.uploadInputRef=e}},null)])}}),te=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(m,R[m]):(o||s)&&(l=r.toLanguageString(h,R[h])),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])}}),ne=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:h,ariaDescribedBy:m}=this.$props,f=i.provideLocalizationService(this),g=e?f.toLanguageString(p,R[p]):f.toLanguageString(u,R[u]),[v,y,b,F]=K.getFileStatus(a),S=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(ee,{id:c,ariaLabelledBy:h,ariaDescribedBy:m,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),v||y||b||F?t.createVNode(te,{isUploading:v,isUploaded:y,isUploadFailed:b},null):t.createVNode("div",{class:S},[g])])}}),ie=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:g}=this.$props,v=n.classNames("k-upload","k-upload-async",this.$props.className,i?"k-disabled":"");return t.createVNode("div",{ref:n.setRef(this,"container"),class:v,onKeydown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur},[t.createVNode(ne,{id:h,ariaLabelledBy:m,ariaDescribedBy:f,ref:e=>{this.uploadDropZoneRef=e},accept:s,async:g,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(G,{groupedFiles:l,disabled:i,async:g,navigationIndex:r,list:p,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry,onClick:this.onClick},null):void 0,d?t.createVNode(J,{disabled:i,navigationIndex:r,clearButtonIndex:this.clearButtonIndex,uploadButtonIndex:this.uploadButtonIndex,actionsLayout:c,onUpload:this.onUpload,onClear:this.onClear,onClick:this.onClick},null):void 0])}}),oe=-2,se=-1,ae=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:oe}),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===oe?se: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===se||o===oe)&&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===se||o===oe)&&this.actionElement()&&this.actionElement().$el.click();break;case n.Keys.tab:u=oe;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(se),this.$emit("clear")},onUpload(){this.navIndex(se),this.$emit("upload")},onRetry(e){this.$emit("retry",e)},onRemove(e){this.navIndex(this.navIndex()>se?this.navIndex()-1:se),this.$emit("remove",e)},onAdd(e){this.navIndex(se),this.$emit("add",e)},onClick(e){this.navIndex(e)},onFocus(){this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=void 0)},onBlurTimeout(){this.navIndex(oe),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(ie,{ref:e=>{this.uploadUIRef=e},class:this.$props.className,onKeydown:this.onKeyDown,navigationIndex:this.currentNavIndex,notFocusedIndex:oe,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)}}),le=(e,t)=>{t.push(e)},re=(e,t)=>{Object.keys(e).forEach((n=>{t(e[n],n)}))},de={copyState:e=>(e||[]).map((e=>({...e}))),addMany:(e,t)=>{e.forEach((e=>le(e,t)))},add:le,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 re(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)=>{re(e,(e=>{e.forEach((e=>{e.status=t}))}))},flatFileGroup:e=>{const t=[];return re(e,(e=>{t.push.apply(t,e)})),t},groupForEach:re},ce=(e,t)=>{Object.keys(t).forEach((n=>{e.append(n,t[n])}))},ue=(e,t,n)=>{const i=new FormData;return ce(i,n),e.forEach((e=>{const n=e.getRawFile?e.getRawFile():"";n?i.append(t,n,e.name):i.append(t,n)})),i},pe=(e,t,n)=>{const i=new FormData;return ce(i,n),e.forEach((e=>{i.append(t,e)})),i},he=(e,t)=>({headers:e,responseType:t.responseType,withCredentials:t.withCredentials}),me=e=>{const t={};return Object.keys(e).forEach((n=>{t[n]=e[n]})),t},fe=e=>{const{data:t,config:n,...i}=e;return{response:t,...i}},ge="invalidMaxFileSize",ve="invalidMinFileSize",ye="invalidFileExtension",be=(e,t)=>{t.length>0&&t.indexOf((e.extension||"").toLowerCase())<0&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf(ye)<0&&e.validationErrors.push(ye))},Fe=(e,t,n)=>{0!==t&&(e.size||0)<t&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf(ve)<0&&e.validationErrors.push(ve)),0!==n&&(e.size||0)>n&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf(ge)<0&&e.validationErrors.push(ge))},Se=(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++)be(e[a],i),Fe(e[a],s,o),n&&n(e[a])},ke={name:"@progress/kendo-vue-upload",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1619764257,version:"6.4.0-develop.2",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"},Ie=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(ke),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 de.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;de.setFilesStatus(e,r.Uploading),de.groupForEach(e,((e,n)=>{const i={target:this,files:e,headers:me(t.saveHeaders||{}),additionalData:{}};this.$emit("beforeupload",i);const o=he(i.headers,this.computedAsync),s=ue(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;de.groupForEach(e,((e,n)=>{const i={target:this,files:e,headers:me(t.removeHeaders||{}),additionalData:{}};this.$emit("beforeremove",i);const o=e.map((e=>e.name)),s=he(i.headers,this.computedAsync),a=pe(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=de.groupFilesByUid(e),n=de.filesForUpload(t);this.uploadFiles(n);this.isControlled||(this.currentFiles=e),(()=>{const t={target:this,newState:e,affectedFiles:de.flatFileGroup(n)};this.$emit("statuschange",t)})()},onAdd(e){let t,n=K.getAllFileInfo(e);if(n=K.assignGuidToFiles(n,this.computedAsync.batch),Se(n,this.$props.restrictions,this.validateFile),t=this.$props.multiple?this.fileStateCopy:[],de.addMany(n,t),this.computedAsync.autoUpload){const e=de.groupFilesByUid(t);this.uploadFiles(de.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?fe(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?fe(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};de.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?fe(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?fe(t):void 0};this.$emit("statuschange",e)})()},onRetry(e){const t=this.fileStateCopy,n=de.groupFilesByUid(t.filter((t=>t.uid===e)));de.setFilesStatus(n,r.Uploading),this.uploadFiles(n);this.isControlled||(this.currentFiles=t),(()=>{const e={target:this,newState:t,affectedFiles:de.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:g,removeMethod:v,removeUrl:y,multiple:b,accept:F,restrictions:S,files:k,defaultFiles:I}=this.$props,x=n.templateRendering.call(this,this.$props.list,n.getListeners.call(this)),C=de.groupFilesByUid(this.computedFiles),N=de.filesForUpload(C);return t.createVNode(ae,{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:S,files:k,defaultFiles:I,async:this.computedAsync},null)}}),xe=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(ke),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($,R[$]),r=s.toLanguageString(U,R[U]),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=xe,e.Upload=Ie,e.UploadFileStatus=r,e.UploadListActionButton=M,e.UploadListMultiItem=H,e.UploadListSingleItem=Z,e.UploadUI=ie,e.messages=R,e.utils=K}));
package/index.d.mts CHANGED
@@ -76,6 +76,7 @@ declare interface GroupedFiles {
76
76
  export declare const messages: {
77
77
  "upload.cancel": string;
78
78
  "upload.clearSelectedFiles": string;
79
+ "upload.dropFileHere": string;
79
80
  "upload.dropFilesHere": string;
80
81
  "upload.headerStatusUploaded": string;
81
82
  "upload.headerStatusUploading": string;
@@ -86,6 +87,7 @@ export declare const messages: {
86
87
  "upload.remove": string;
87
88
  "upload.retry": string;
88
89
  "upload.select": string;
90
+ "upload.selectSingle": string;
89
91
  "upload.selectTitle": string;
90
92
  "upload.selectNoFilesTitle": string;
91
93
  "upload.uploadSelectedFiles": string;
package/index.d.ts CHANGED
@@ -76,6 +76,7 @@ declare interface GroupedFiles {
76
76
  export declare const messages: {
77
77
  "upload.cancel": string;
78
78
  "upload.clearSelectedFiles": string;
79
+ "upload.dropFileHere": string;
79
80
  "upload.dropFilesHere": string;
80
81
  "upload.headerStatusUploaded": string;
81
82
  "upload.headerStatusUploading": string;
@@ -86,6 +87,7 @@ export declare const messages: {
86
87
  "upload.remove": string;
87
88
  "upload.retry": string;
88
89
  "upload.select": string;
90
+ "upload.selectSingle": string;
89
91
  "upload.selectTitle": string;
90
92
  "upload.selectNoFilesTitle": string;
91
93
  "upload.uploadSelectedFiles": string;
package/messages/main.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 e="upload.cancel",l="upload.clearSelectedFiles",o="upload.dropFilesHere",a="upload.headerStatusUploaded",t="upload.headerStatusUploading",i="upload.invalidFileExtension",s="upload.invalidFiles",d="upload.invalidMaxFileSize",n="upload.invalidMinFileSize",c="upload.remove",p="upload.retry",r="upload.select",u="upload.selectTitle",F="upload.selectNoFilesTitle",S="upload.uploadSelectedFiles",v="upload.total",f="upload.files",U="upload.statusUploaded",g="upload.statusUploadFailed",m="upload.dropZoneHint",h="upload.dropZoneNote",y={[e]:"Cancel",[l]:"Clear",[o]:"Drop files here to upload",[a]:"Done",[t]:"Uploading...",[i]:"File type not allowed.",[s]:"Invalid file(s). Please check file upload requirements.",[d]:"File size too large.",[n]:"File size too small.",[c]:"Remove",[p]:"Retry",[r]:"Select files...",[u]:"Press to select more files",[F]:"No files selected",[S]:"Upload",[v]:"Total",[f]:"files",[U]:"File(s) successfully uploaded.",[g]:"File(s) failed to upload.",[m]:"Drag and drop files here to upload.",[h]:"Only JPEG and PNG files are allowed."};exports.cancel=e;exports.clearSelectedFiles=l;exports.dropFilesHere=o;exports.dropZoneHint=m;exports.dropZoneNote=h;exports.files=f;exports.headerStatusUploaded=a;exports.headerStatusUploading=t;exports.invalidFileExtension=i;exports.invalidFiles=s;exports.invalidMaxFileSize=d;exports.invalidMinFileSize=n;exports.messages=y;exports.remove=c;exports.retry=p;exports.select=r;exports.selectNoFilesTitle=F;exports.selectTitle=u;exports.statusUploadFailed=g;exports.statusUploaded=U;exports.total=v;exports.uploadSelectedFiles=S;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="upload.cancel",l="upload.clearSelectedFiles",o="upload.dropFileHere",t="upload.dropFilesHere",a="upload.headerStatusUploaded",i="upload.headerStatusUploading",s="upload.invalidFileExtension",d="upload.invalidFiles",n="upload.invalidMaxFileSize",p="upload.invalidMinFileSize",c="upload.remove",r="upload.retry",u="upload.select",F="upload.selectSingle",S="upload.selectTitle",v="upload.selectNoFilesTitle",f="upload.uploadSelectedFiles",U="upload.total",g="upload.files",h="upload.statusUploaded",m="upload.statusUploadFailed",y="upload.dropZoneHint",H="upload.dropZoneNote",z={[e]:"Cancel",[l]:"Clear",[o]:"Drop a file here to upload",[t]:"Drop files here to upload",[a]:"Done",[i]:"Uploading...",[s]:"File type not allowed.",[d]:"Invalid file(s). Please check file upload requirements.",[n]:"File size too large.",[p]:"File size too small.",[c]:"Remove",[r]:"Retry",[u]:"Select files...",[F]:"Select file...",[S]:"Press to select more files",[v]:"No files selected",[f]:"Upload",[U]:"Total",[g]:"files",[h]:"File(s) successfully uploaded.",[m]:"File(s) failed to upload.",[y]:"Drag and drop files here to upload.",[H]:"Only JPEG and PNG files are allowed."};exports.cancel=e;exports.clearSelectedFiles=l;exports.dropFileHere=o;exports.dropFilesHere=t;exports.dropZoneHint=y;exports.dropZoneNote=H;exports.files=g;exports.headerStatusUploaded=a;exports.headerStatusUploading=i;exports.invalidFileExtension=s;exports.invalidFiles=d;exports.invalidMaxFileSize=n;exports.invalidMinFileSize=p;exports.messages=z;exports.remove=c;exports.retry=r;exports.select=u;exports.selectNoFilesTitle=v;exports.selectSingle=F;exports.selectTitle=S;exports.statusUploadFailed=m;exports.statusUploaded=h;exports.total=U;exports.uploadSelectedFiles=f;
package/messages/main.mjs CHANGED
@@ -5,50 +5,54 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- const e = "upload.cancel", l = "upload.clearSelectedFiles", o = "upload.dropFilesHere", a = "upload.headerStatusUploaded", s = "upload.headerStatusUploading", t = "upload.invalidFileExtension", d = "upload.invalidFiles", i = "upload.invalidMaxFileSize", n = "upload.invalidMinFileSize", p = "upload.remove", c = "upload.retry", u = "upload.select", r = "upload.selectTitle", F = "upload.selectNoFilesTitle", f = "upload.uploadSelectedFiles", S = "upload.total", v = "upload.files", U = "upload.statusUploaded", h = "upload.statusUploadFailed", m = "upload.dropZoneHint", g = "upload.dropZoneNote", y = {
8
+ const e = "upload.cancel", l = "upload.clearSelectedFiles", o = "upload.dropFileHere", a = "upload.dropFilesHere", t = "upload.headerStatusUploaded", s = "upload.headerStatusUploading", d = "upload.invalidFileExtension", i = "upload.invalidFiles", n = "upload.invalidMaxFileSize", p = "upload.invalidMinFileSize", c = "upload.remove", u = "upload.retry", r = "upload.select", F = "upload.selectSingle", S = "upload.selectTitle", f = "upload.selectNoFilesTitle", v = "upload.uploadSelectedFiles", U = "upload.total", g = "upload.files", h = "upload.statusUploaded", m = "upload.statusUploadFailed", y = "upload.dropZoneHint", z = "upload.dropZoneNote", H = {
9
9
  [e]: "Cancel",
10
10
  [l]: "Clear",
11
- [o]: "Drop files here to upload",
12
- [a]: "Done",
11
+ [o]: "Drop a file here to upload",
12
+ [a]: "Drop files here to upload",
13
+ [t]: "Done",
13
14
  [s]: "Uploading...",
14
- [t]: "File type not allowed.",
15
- [d]: "Invalid file(s). Please check file upload requirements.",
16
- [i]: "File size too large.",
17
- [n]: "File size too small.",
18
- [p]: "Remove",
19
- [c]: "Retry",
20
- [u]: "Select files...",
21
- [r]: "Press to select more files",
22
- [F]: "No files selected",
23
- [f]: "Upload",
24
- [S]: "Total",
25
- [v]: "files",
26
- [U]: "File(s) successfully uploaded.",
27
- [h]: "File(s) failed to upload.",
28
- [m]: "Drag and drop files here to upload.",
29
- [g]: "Only JPEG and PNG files are allowed."
15
+ [d]: "File type not allowed.",
16
+ [i]: "Invalid file(s). Please check file upload requirements.",
17
+ [n]: "File size too large.",
18
+ [p]: "File size too small.",
19
+ [c]: "Remove",
20
+ [u]: "Retry",
21
+ [r]: "Select files...",
22
+ [F]: "Select file...",
23
+ [S]: "Press to select more files",
24
+ [f]: "No files selected",
25
+ [v]: "Upload",
26
+ [U]: "Total",
27
+ [g]: "files",
28
+ [h]: "File(s) successfully uploaded.",
29
+ [m]: "File(s) failed to upload.",
30
+ [y]: "Drag and drop files here to upload.",
31
+ [z]: "Only JPEG and PNG files are allowed."
30
32
  };
31
33
  export {
32
34
  e as cancel,
33
35
  l as clearSelectedFiles,
34
- o as dropFilesHere,
35
- m as dropZoneHint,
36
- g as dropZoneNote,
37
- v as files,
38
- a as headerStatusUploaded,
36
+ o as dropFileHere,
37
+ a as dropFilesHere,
38
+ y as dropZoneHint,
39
+ z as dropZoneNote,
40
+ g as files,
41
+ t as headerStatusUploaded,
39
42
  s as headerStatusUploading,
40
- t as invalidFileExtension,
41
- d as invalidFiles,
42
- i as invalidMaxFileSize,
43
- n as invalidMinFileSize,
44
- y as messages,
45
- p as remove,
46
- c as retry,
47
- u as select,
48
- F as selectNoFilesTitle,
49
- r as selectTitle,
50
- h as statusUploadFailed,
51
- U as statusUploaded,
52
- S as total,
53
- f as uploadSelectedFiles
43
+ d as invalidFileExtension,
44
+ i as invalidFiles,
45
+ n as invalidMaxFileSize,
46
+ p as invalidMinFileSize,
47
+ H as messages,
48
+ c as remove,
49
+ u as retry,
50
+ r as select,
51
+ f as selectNoFilesTitle,
52
+ F as selectSingle,
53
+ S as selectTitle,
54
+ m as statusUploadFailed,
55
+ h as statusUploaded,
56
+ U as total,
57
+ v as uploadSelectedFiles
54
58
  };
@@ -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 e={name:"@progress/kendo-vue-upload",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1743151575,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"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-upload",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1744204437,version:"6.4.0-develop.2",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"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "Kendo UI for Vue",
11
11
  productCode: "KENDOUIVUE",
12
12
  productCodes: ["KENDOUIVUE"],
13
- publishDate: 1743151575,
14
- version: "6.3.0",
13
+ publishDate: 1744204437,
14
+ version: "6.4.0-develop.2",
15
15
  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"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-upload",
3
- "version": "6.3.0",
3
+ "version": "6.4.0-develop.2",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -19,10 +19,10 @@
19
19
  "sideEffects": false,
20
20
  "peerDependencies": {
21
21
  "@progress/kendo-licensing": "^1.4.0",
22
- "@progress/kendo-vue-buttons": "6.3.0",
23
- "@progress/kendo-vue-common": "6.3.0",
24
- "@progress/kendo-vue-intl": "6.3.0",
25
- "@progress/kendo-vue-progressbars": "6.3.0",
22
+ "@progress/kendo-vue-buttons": "6.4.0-develop.2",
23
+ "@progress/kendo-vue-common": "6.4.0-develop.2",
24
+ "@progress/kendo-vue-intl": "6.4.0-develop.2",
25
+ "@progress/kendo-vue-progressbars": "6.4.0-develop.2",
26
26
  "@progress/kendo-svg-icons": "^4.0.0",
27
27
  "axios": "^1.7.4",
28
28
  "vue": "^3.0.2"
@@ -44,7 +44,7 @@
44
44
  "package": {
45
45
  "productName": "Kendo UI for Vue",
46
46
  "productCode": "KENDOUIVUE",
47
- "publishDate": 1743151575,
47
+ "publishDate": 1744204437,
48
48
  "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"
49
49
  }
50
50
  },