@progress/kendo-vue-upload 8.4.0-develop.1 → 8.4.0-develop.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 O, createVNode as n, ref as L, inject as S } from "vue";
8
+ import { defineComponent as S, createVNode as n, ref as k, inject as L } from "vue";
9
9
  import { classNames as _ } from "@progress/kendo-vue-common";
10
10
  import { UploadAddButton as y } from "./UploadAddButton.mjs";
11
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({
12
+ import { dropFilesHere as s, messages as d, dropFileHere as u } from "./messages/main.mjs";
13
+ import x from "./utils/utils.mjs";
14
+ import { UploadStatus as U } from "./UploadStatus.mjs";
15
+ const o = 100, $ = /* @__PURE__ */ S({
16
16
  name: "KendoVueUploadDropZone",
17
17
  props: {
18
18
  addButtonIndex: Number,
@@ -74,7 +74,7 @@ const o = 100, Z = /* @__PURE__ */ O({
74
74
  document.removeEventListener("dragenter", this.onDocumentDragEnter), document.removeEventListener("dragover", this.onDocumentDragOver);
75
75
  },
76
76
  setup() {
77
- const e = L(null), t = S("kendoLocalizationService", {});
77
+ const e = k(null), t = L("kendoLocalizationService", {});
78
78
  return {
79
79
  uploadAddButtonRef: e,
80
80
  kendoLocalizationService: t
@@ -150,16 +150,15 @@ const o = 100, Z = /* @__PURE__ */ O({
150
150
  id: D,
151
151
  ariaLabelledBy: g,
152
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
- // Unsure about that, since it hides the "Drop Files Message" when we remove all uploaded components.
155
- // 'k-hidden': this.isDragged && !this.elementActive
156
- }), B = function() {
153
+ } = this.$props, r = F(this), A = e ? r.toLanguageString(s, d[s]) : r.toLanguageString(u, d[u]), [i, a, l, E] = x.getFileStatus(m), I = _("k-dropzone-hint", {
154
+ "k-hidden": !this.currentElementActive
155
+ }), B = i || a || l || E, b = function() {
157
156
  return n(y, {
158
157
  id: D,
159
158
  ariaLabelledBy: g,
160
159
  ariaDescribedBy: f,
161
- ref: (b) => {
162
- this.uploadAddButtonRef = b;
160
+ ref: (O) => {
161
+ this.uploadAddButtonRef = O;
163
162
  },
164
163
  accept: p,
165
164
  async: this.async,
@@ -178,15 +177,17 @@ const o = 100, Z = /* @__PURE__ */ O({
178
177
  onDrop: this.onDrop,
179
178
  onDragenter: this.onElementDragEnter,
180
179
  onDragover: this.onElementDragOver
181
- }, [B.call(this), i || a || l || A ? n(x, {
180
+ }, [b.call(this), n("div", {
181
+ class: I
182
+ }, [A]), B ? n(U, {
182
183
  isUploading: i,
183
184
  isUploaded: a,
184
185
  isUploadFailed: l
185
- }, null) : n("div", {
186
- class: E
187
- }, [I])]);
186
+ }, null) : n("span", {
187
+ class: "k-upload-status"
188
+ }, null)]);
188
189
  }
189
190
  });
190
191
  export {
191
- Z as UploadDropZone
192
+ $ as UploadDropZone
192
193
  };
package/UploadInput.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 i=require("vue"),f=require("@progress/kendo-vue-common"),m=require("@progress/kendo-vue-intl"),n=require("./messages/main.js"),h=/(chrome)[ \/]([\w.]+)/i,g=/(webkit)[ \/]([\w.]+)/i,y=i.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(h)&&e.match(g)||(t.type="",t.type="file"))},actionElement(){return this._input}},setup(){return{inputRef:i.ref(null)}},render(){const{multiple:e,async:t,disabled:l,accept:d,hasFiles:u,ariaLabelledBy:a,ariaDescribedBy:c}=this.$props,s=m.provideLocalizationService(this),o=u?n.selectTitle:n.selectNoFilesTitle,r=s.toLanguageString(o,n.messages[o]),p=s.toLanguageString(n.select,n.messages[n.select]);return i.createVNode("input",{ref:f.setRef(this,"input"),id:this.id,class:"k-hidden",autocomplete:"off",name:t.saveField,accept:d,type:"file",tabindex:-1,multiple:e,disabled:l,onChange:this.onAdd,onMousedown:this.onMouseDown,title:r,"aria-label":a!==void 0?void 0:p,"aria-labelledby":a,"aria-describedby":c},null)}});exports.UploadInput=y;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),p=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-intl"),i=require("./messages/main.js"),m=/(chrome)[ \/]([\w.]+)/i,h=/(webkit)[ \/]([\w.]+)/i,g=n.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(m)&&e.match(h)||(t.type="",t.type="file"))},actionElement(){return this._input}},setup(){return{inputRef:n.ref(null)}},render(){const{multiple:e,async:t,disabled:o,accept:l,hasFiles:d,ariaLabelledBy:u,ariaDescribedBy:r}=this.$props,a=f.provideLocalizationService(this),s=d?i.selectTitle:i.selectNoFilesTitle,c=a.toLanguageString(s,i.messages[s]);return a.toLanguageString(i.select,i.messages[i.select]),n.createVNode("input",{ref:p.setRef(this,"input"),id:this.id,class:"k-hidden",autocomplete:"off",name:t.saveField,accept:l,type:"file",tabindex:-1,multiple:e,disabled:o,onChange:this.onAdd,onMousedown:this.onMouseDown,title:c,"aria-hidden":!0,"aria-labelledby":u,"aria-describedby":r},null)}});exports.UploadInput=g;
package/UploadInput.mjs CHANGED
@@ -5,11 +5,11 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as f, createVNode as m, ref as h } from "vue";
9
- import { setRef as y } from "@progress/kendo-vue-common";
10
- import { provideLocalizationService as b } from "@progress/kendo-vue-intl";
11
- import { selectTitle as g, selectNoFilesTitle as S, messages as o, select as s } from "./messages/main.mjs";
12
- const w = /(chrome)[ \/]([\w.]+)/i, R = /(webkit)[ \/]([\w.]+)/i, A = /* @__PURE__ */ f({
8
+ import { defineComponent as c, createVNode as f, ref as m } from "vue";
9
+ import { setRef as h } from "@progress/kendo-vue-common";
10
+ import { provideLocalizationService as y } from "@progress/kendo-vue-intl";
11
+ import { selectTitle as g, selectNoFilesTitle as b, messages as a, select as o } from "./messages/main.mjs";
12
+ const S = /(chrome)[ \/]([\w.]+)/i, w = /(webkit)[ \/]([\w.]+)/i, L = /* @__PURE__ */ c({
13
13
  name: "KendoVueUploadInput",
14
14
  props: {
15
15
  async: Object,
@@ -57,7 +57,7 @@ const w = /(chrome)[ \/]([\w.]+)/i, R = /(webkit)[ \/]([\w.]+)/i, A = /* @__PURE
57
57
  },
58
58
  onAdd() {
59
59
  const e = navigator.userAgent, t = this._input;
60
- t && (t.files && this.$emit("add", t.files), !e.match(w) && e.match(R) || (t.type = "", t.type = "file"));
60
+ t && (t.files && this.$emit("add", t.files), !e.match(S) && e.match(w) || (t.type = "", t.type = "file"));
61
61
  },
62
62
  actionElement() {
63
63
  return this._input;
@@ -65,39 +65,39 @@ const w = /(chrome)[ \/]([\w.]+)/i, R = /(webkit)[ \/]([\w.]+)/i, A = /* @__PURE
65
65
  },
66
66
  setup() {
67
67
  return {
68
- inputRef: h(null)
68
+ inputRef: m(null)
69
69
  };
70
70
  },
71
71
  render() {
72
72
  const {
73
73
  multiple: e,
74
74
  async: t,
75
- disabled: l,
76
- accept: d,
77
- hasFiles: u,
78
- ariaLabelledBy: i,
75
+ disabled: s,
76
+ accept: l,
77
+ hasFiles: d,
78
+ ariaLabelledBy: u,
79
79
  ariaDescribedBy: r
80
- } = this.$props, n = b(this), a = u ? g : S, c = n.toLanguageString(a, o[a]), p = n.toLanguageString(s, o[s]);
81
- return m("input", {
82
- ref: y(this, "input"),
80
+ } = this.$props, i = y(this), n = d ? g : b, p = i.toLanguageString(n, a[n]);
81
+ return i.toLanguageString(o, a[o]), f("input", {
82
+ ref: h(this, "input"),
83
83
  id: this.id,
84
84
  class: "k-hidden",
85
85
  autocomplete: "off",
86
86
  name: t.saveField,
87
- accept: d,
87
+ accept: l,
88
88
  type: "file",
89
89
  tabindex: -1,
90
90
  multiple: e,
91
- disabled: l,
91
+ disabled: s,
92
92
  onChange: this.onAdd,
93
93
  onMousedown: this.onMouseDown,
94
- title: c,
95
- "aria-label": i !== void 0 ? void 0 : p,
96
- "aria-labelledby": i,
94
+ title: p,
95
+ "aria-hidden": !0,
96
+ "aria-labelledby": u,
97
97
  "aria-describedby": r
98
98
  }, null);
99
99
  }
100
100
  });
101
101
  export {
102
- A as UploadInput
102
+ L as UploadInput
103
103
  };
package/UploadUI.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 n=require("vue"),s=require("@progress/kendo-vue-common"),b=require("./UploadList.js"),x=require("./UploadActionButtons.js"),g=require("./UploadDropZone.js"),C=-1,D=n.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(){return C},clearButtonIndex(){return this.lastGroupIndex+1},uploadButtonIndex(){return this.lastGroupIndex+2},isRtl(){return this._container&&getComputedStyle(this._container).direction==="rtl"||!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(){const e=n.ref(null),t=n.ref(null);return{containerRef:e,uploadDropZoneRef:t}},render(){const{multiple:e,disabled:t,tabIndex:a,accept:d,showFileList:r,groupedFiles:i,navigationIndex:o,showActionButtons:u,actionsLayout:c,notFocusedIndex:p,list:h,id:m,ariaLabelledBy:y,ariaDescribedBy:f,async:l}=this.$props,B=s.classNames("k-upload","k-upload-async",this.$props.className,t?"k-disabled":"");return n.createVNode("div",{ref:s.setRef(this,"container"),class:B,onKeydown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur},[n.createVNode(g.UploadDropZone,{id:m,ariaLabelledBy:y,ariaDescribedBy:f,ref:I=>{this.uploadDropZoneRef=I},accept:d,async:l,addButtonIndex:this.addButtonIndex,navigationIndex:o,notFocusedIndex:p,tabIndex:a,multiple:e,onClick:this.onClick,onAdd:this.onAdd,fileGroup:i,disabled:t},null),r?n.createVNode(b.UploadList,{groupedFiles:i,disabled:t,async:l,navigationIndex:o,list:h,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry,onClick:this.onClick},null):void 0,u?n.createVNode(x.UploadActionButtons,{disabled:t,navigationIndex:o,clearButtonIndex:this.clearButtonIndex,uploadButtonIndex:this.uploadButtonIndex,actionsLayout:c,onUpload:this.onUpload,onClear:this.onClear,onClick:this.onClick},null):void 0])}});exports.UploadUI=D;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("@progress/kendo-vue-common"),I=require("./UploadList.js"),g=require("./UploadActionButtons.js"),x=require("./UploadDropZone.js"),k=-1,C=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(){return k},clearButtonIndex(){return this.lastGroupIndex+1},uploadButtonIndex(){return this.lastGroupIndex+2},isRtl(){return this._container&&getComputedStyle(this._container).direction==="rtl"||!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(){const e=t.ref(null),n=t.ref(null);return{containerRef:e,uploadDropZoneRef:n}},render(){const{multiple:e,disabled:n,tabIndex:a,accept:d,showFileList:r,groupedFiles:o,navigationIndex:i,showActionButtons:u,actionsLayout:c,notFocusedIndex:p,list:h,id:m,ariaLabelledBy:y,ariaDescribedBy:f,async:l}=this.$props,b=s.classNames("k-upload","k-upload-async",{"k-upload-empty":Object.keys(o).length===0},this.$props.className,n?"k-disabled":"");return t.createVNode("div",{ref:s.setRef(this,"container"),class:b,onKeydown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur},[t.createVNode(x.UploadDropZone,{id:m,ariaLabelledBy:y,ariaDescribedBy:f,ref:B=>{this.uploadDropZoneRef=B},accept:d,async:l,addButtonIndex:this.addButtonIndex,navigationIndex:i,notFocusedIndex:p,tabIndex:a,multiple:e,onClick:this.onClick,onAdd:this.onAdd,fileGroup:o,disabled:n},null),r?t.createVNode(I.UploadList,{groupedFiles:o,disabled:n,async:l,navigationIndex:i,list:h,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry,onClick:this.onClick},null):void 0,u?t.createVNode(g.UploadActionButtons,{disabled:n,navigationIndex:i,clearButtonIndex:this.clearButtonIndex,uploadButtonIndex:this.uploadButtonIndex,actionsLayout:c,onUpload:this.onUpload,onClear:this.onClear,onClick:this.onClick},null):void 0])}});exports.UploadUI=C;
package/UploadUI.mjs CHANGED
@@ -5,11 +5,11 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as b, createVNode as t, ref as s } from "vue";
8
+ import { defineComponent as b, createVNode as n, ref as s } from "vue";
9
9
  import { classNames as x, setRef as g } from "@progress/kendo-vue-common";
10
- import { UploadList as C } from "./UploadList.mjs";
11
- import { UploadActionButtons as D } from "./UploadActionButtons.mjs";
12
- import { UploadDropZone as k } from "./UploadDropZone.mjs";
10
+ import { UploadList as k } from "./UploadList.mjs";
11
+ import { UploadActionButtons as C } from "./UploadActionButtons.mjs";
12
+ import { UploadDropZone as D } from "./UploadDropZone.mjs";
13
13
  const R = -1, w = /* @__PURE__ */ b({
14
14
  name: "KendoVueUploadUI",
15
15
  props: {
@@ -122,21 +122,21 @@ const R = -1, w = /* @__PURE__ */ b({
122
122
  this._container = this.containerRef, this.uploadDropZone = this.uploadDropZoneRef;
123
123
  },
124
124
  setup() {
125
- const e = s(null), n = s(null);
125
+ const e = s(null), t = s(null);
126
126
  return {
127
127
  containerRef: e,
128
- uploadDropZoneRef: n
128
+ uploadDropZoneRef: t
129
129
  };
130
130
  },
131
131
  render() {
132
132
  const {
133
133
  multiple: e,
134
- disabled: n,
134
+ disabled: t,
135
135
  tabIndex: a,
136
136
  accept: r,
137
137
  showFileList: d,
138
- groupedFiles: i,
139
- navigationIndex: o,
138
+ groupedFiles: o,
139
+ navigationIndex: i,
140
140
  showActionButtons: u,
141
141
  actionsLayout: c,
142
142
  notFocusedIndex: p,
@@ -145,14 +145,16 @@ const R = -1, w = /* @__PURE__ */ b({
145
145
  ariaLabelledBy: f,
146
146
  ariaDescribedBy: y,
147
147
  async: l
148
- } = this.$props, B = x("k-upload", "k-upload-async", this.$props.className, n ? "k-disabled" : "");
149
- return t("div", {
148
+ } = this.$props, B = x("k-upload", "k-upload-async", {
149
+ "k-upload-empty": Object.keys(o).length === 0
150
+ }, this.$props.className, t ? "k-disabled" : "");
151
+ return n("div", {
150
152
  ref: g(this, "container"),
151
153
  class: B,
152
154
  onKeydown: this.onKeyDown,
153
155
  onFocus: this.onFocus,
154
156
  onBlur: this.onBlur
155
- }, [t(k, {
157
+ }, [n(D, {
156
158
  id: m,
157
159
  ariaLabelledBy: f,
158
160
  ariaDescribedBy: y,
@@ -162,27 +164,27 @@ const R = -1, w = /* @__PURE__ */ b({
162
164
  accept: r,
163
165
  async: l,
164
166
  addButtonIndex: this.addButtonIndex,
165
- navigationIndex: o,
167
+ navigationIndex: i,
166
168
  notFocusedIndex: p,
167
169
  tabIndex: a,
168
170
  multiple: e,
169
171
  onClick: this.onClick,
170
172
  onAdd: this.onAdd,
171
- fileGroup: i,
172
- disabled: n
173
- }, null), d ? t(C, {
174
- groupedFiles: i,
175
- disabled: n,
173
+ fileGroup: o,
174
+ disabled: t
175
+ }, null), d ? n(k, {
176
+ groupedFiles: o,
177
+ disabled: t,
176
178
  async: l,
177
- navigationIndex: o,
179
+ navigationIndex: i,
178
180
  list: h,
179
181
  onCancel: this.onCancel,
180
182
  onRemove: this.onRemove,
181
183
  onRetry: this.onRetry,
182
184
  onClick: this.onClick
183
- }, null) : void 0, u ? t(D, {
184
- disabled: n,
185
- navigationIndex: o,
185
+ }, null) : void 0, u ? n(C, {
186
+ disabled: t,
187
+ navigationIndex: i,
186
188
  clearButtonIndex: this.clearButtonIndex,
187
189
  uploadButtonIndex: this.uploadButtonIndex,
188
190
  actionsLayout: c,
@@ -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.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.arrowRotateCwSmallIcon,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:e===r.Uploading?"cancel":"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:"8.4.0-develop.1",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});
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")):"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"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueUpload={},e.Vue,e.KendoVueCommon,e.KendoVueIntl,e.KendoVueProgressbars,e.KendoVueButtons,e.KendoSVGIcons)}(this,function(e,t,n,i,o,s,a){"use strict";var l=(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))(l||{});const r="upload.cancel",d="upload.clearSelectedFiles",c="upload.dropFileHere",u="upload.dropFilesHere",p="upload.headerStatusUploaded",h="upload.headerStatusUploading",m="upload.invalidFileExtension",f="upload.invalidFiles",g="upload.invalidMaxFileSize",v="upload.invalidMinFileSize",y="upload.remove",b="upload.retry",F="upload.select",x="upload.selectSingle",S="upload.selectTitle",k="upload.selectNoFilesTitle",I="upload.uploadSelectedFiles",C="upload.total",N="upload.files",B="upload.statusUploaded",E="upload.statusUploadFailed",D="upload.dropZoneHint",$="upload.dropZoneNote",R={[r]:"Cancel",[d]:"Clear",[c]:"Drop a file here to upload",[u]:"Drop files here to upload",[p]:"Done",[h]:"Uploading...",[m]:"File type not allowed.",[f]:"Invalid file(s). Please check file upload requirements.",[g]:"File size too large.",[v]:"File size too small.",[y]:"Remove",[b]:"Retry",[F]:"Select files...",[x]:"Select file...",[S]:"Press to select more files",[k]:"No files selected",[I]:"Upload",[C]:"Total",[N]:"files",[B]:"File(s) successfully uploaded.",[E]:"File(s) failed to upload.",[D]:"Drag and drop files here to upload.",[$]:"Only JPEG and PNG files are allowed."},U=/&/g,L=/</g,w=/"/g,V=/'/g,O=/>/g,A=e=>(""+e).replace(U,"&amp;").replace(L,"&lt;").replace(O,"&gt;").replace(w,"&quot;").replace(V,"&#39;"),j=e=>{const t=e.match(/\.([^\.]+)$/);return t?t[0]:""},z=e=>{const t=e.name,n=e.size;return{extension:j(t),name:A(t),getRawFile:()=>e,size:n,status:l.Selected,progress:0,uid:""}},T=e=>!!(e.validationErrors&&e.validationErrors.length>0),_={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(z(e[n]));return t},getFileInfo:z,getFileExtension:j,htmlEncode:A,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===l.Uploading&&(t=!0),e.status===l.Uploaded&&(n=!0),e.status===l.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===l.Uploading?t.toLanguageString(r,R[r]):t.toLanguageString(y,R[y]),retryButtonTitle:e=>e.toLanguageString(b,R[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===l.Removing||(e===l.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===l.UploadFailed,r=e===l.Uploading,d=(e===l.Uploaded||e===l.Initial)&&!this.$props.async.removeUrl,c=i.provideLocalizationService(this);return t.createVNode("div",{class:"k-upload-actions"},[r?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.arrowRotateCwSmallIcon,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:e===l.Uploading?"cancel":"x",svgIcon:r?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(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]=_.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(B,R[B]);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(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)])}}),Z=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]=_.getFileStatus(e),p=i.provideLocalizationService(this),h=p.toLanguageString(C,R[C]),m=p.toLanguageString(N,R[N]),f=p.toLanguageString(E,R[E]),g=p.toLanguageString(B,R[B]),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]),_.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!==v?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} ${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)])}}),q=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,r=e[0],d=r.status===l.Uploaded||r.status===l.Initial,c=_.filesHaveValidationErrors(e),u=r.status===l.UploadFailed||r.status===l.RemoveFailed,p=n.classNames("k-file",{"k-file-invalid":c,"k-file-error":u||c,"k-file-progress":r.status===l.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(Z,{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":r.uid,tabindex:-1,onClick:this.onClick},[h])}}),H=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(q,{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 P(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:c,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===c?"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},P(e=p.toLanguageString(d,R[d]))?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},P(o=p.toLanguageString(I,R[I]))?o:{default:()=>[o]})])}}),X=/(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(X)&&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?S:k,p=c.toLanguageString(u,R[u]);return c.toLanguageString(F,R[F]),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-hidden":!0,"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 Y=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(F,R[F]):m.toLanguageString(x,R[x]),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"),type:"button",disabled:c,class:g,tabIndex:a,"aria-labelledby":p,"aria-describedby":h,onClick:this.onClick},W(f)?f:{default:()=>[f]}),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)])}}),ee=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,R[h]):(o||s)&&(l=r.toLanguageString(p,R[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])}}),te=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:p,ariaLabelledBy:h,ariaDescribedBy:m}=this.$props,f=i.provideLocalizationService(this),g=e?f.toLanguageString(u,R[u]):f.toLanguageString(c,R[c]),[v,y,b,F]=_.getFileStatus(a),x=n.classNames("k-dropzone-hint",{"k-hidden":!this.currentElementActive}),S=v||y||b||F;return t.createVNode("div",{class:this.dropZoneClasses,onDrop:this.onDrop,onDragenter:this.onElementDragEnter,onDragover:this.onElementDragOver},[function(){return t.createVNode(Y,{id:p,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),t.createVNode("div",{class:x},[g]),S?t.createVNode(ee,{isUploading:v,isUploaded:y,isUploadFailed:b},null):t.createVNode("span",{class:"k-upload-status"},null)])}}),ne=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",{"k-upload-empty":0===Object.keys(l).length},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(te,{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(H,{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(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])}}),ie=-2,oe=-1,se=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:ie}),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===ie?oe: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===oe||o===ie)&&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===oe||o===ie)&&this.actionElement()&&this.actionElement().$el.click();break;case n.Keys.tab:u=ie;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(oe),this.$emit("clear")},onUpload(){this.navIndex(oe),this.$emit("upload")},onRetry(e){this.$emit("retry",e)},onRemove(e){this.navIndex(this.navIndex()>oe?this.navIndex()-1:oe),this.$emit("remove",e)},onAdd(e){this.navIndex(oe),this.$emit("add",e)},onClick(e){this.navIndex(e)},onFocus(){this._blurTimeout&&(clearTimeout(this._blurTimeout),this._blurTimeout=void 0)},onBlurTimeout(){this.navIndex(ie),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(ne,{ref:e=>{this.uploadUIRef=e},class:this.$props.className,onKeydown:this.onKeyDown,navigationIndex:this.currentNavIndex,notFocusedIndex:ie,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)}}),ae=(e,t)=>{t.push(e)},le=(e,t)=>{Object.keys(e).forEach(n=>{t(e[n],n)})},re={copyState:e=>(e||[]).map(e=>({...e})),addMany:(e,t)=>{e.forEach(e=>ae(e,t))},add:ae,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 le(e,(e,n)=>{let i=!0;e.forEach(e=>{(e.status!==l.Selected||e.validationErrors&&e.validationErrors.length>0)&&(i=!1)}),i&&(t[n]=e)}),t},setFilesStatus:(e,t)=>{le(e,e=>{e.forEach(e=>{e.status=t})})},flatFileGroup:e=>{const t=[];return le(e,e=>{t.push.apply(t,e)}),t},groupForEach:le},de=(e,t)=>{Object.keys(t).forEach(n=>{e.append(n,t[n])})},ce=e=>{const t=e.getAllResponseHeaders(),n={};return t&&t.trim().split(/[\r\n]+/).forEach(e=>{const t=e.indexOf(":");t>0&&(n[e.substring(0,t).trim().toLowerCase()]=e.substring(t+1).trim())}),n},ue=(e,t,n)=>{const i=new FormData;return de(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 de(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=>({response:e.response,status:e.status,statusText:e.statusText,headers:e.request?ce(e.request):e.headers||{},request:e.request}),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))},xe=(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])},Se={name:"@progress/kendo-vue-upload",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1619764257,version:"8.4.0-develop.3",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(Se),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 re.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;re.setFilesStatus(e,l.Uploading),re.groupForEach(e,(e,n)=>{var i;const o={target:this,files:e,headers:me(t.saveHeaders||{}),additionalData:{}};this.$emit("beforeupload",o);const s=he(o.headers,this.computedAsync),a=ue(e,t.saveField,o.additionalData);if(this.isCustomSave)this.$props.saveUrl(e,{formData:a,requestOptions:s},this.onUploadProgress).then(e=>this.onUploadSuccess(e.uid)).catch(e=>this.onUploadError(e.uid));else{const e=new XMLHttpRequest;this._httpSubscriptions[n]=()=>e.abort(),e.open(t.saveMethod,t.saveUrl,!0),e.withCredentials=null==(i=s.withCredentials)||i,e.responseType=s.responseType||"json",Object.entries(s.headers||{}).forEach(([t,n])=>{e.setRequestHeader(t,n)}),e.upload.onprogress=e=>this.onUploadProgress(n,e),e.onload=()=>{e.status>=200&&e.status<300?this.onUploadSuccess(n,{response:e.response,status:e.status,statusText:e.statusText,request:e}):this.onUploadError(n,{response:e.response,status:e.status,statusText:e.statusText,request:e})},e.onerror=()=>this.onUploadError(n,{response:e.response,status:e.status,statusText:e.statusText,request:e}),e.onabort=()=>{},e.send(a)}})},removeFiles(e){const t=this.computedAsync;re.groupForEach(e,(e,n)=>{var i;const o={target:this,files:e,headers:me(t.removeHeaders||{}),additionalData:{}};this.$emit("beforeremove",o);const s=e.map(e=>e.name),a=he(o.headers,this.computedAsync),l=pe(s,t.removeField,o.additionalData);if(this.isCustomRemove)this.$props.removeUrl(e,{formData:l,requestOptions:a}).then(e=>this.onRemoveSuccess(e.uid)).catch(e=>this.onRemoveError(e.uid));else{const e=new XMLHttpRequest;e.open(t.removeMethod,t.removeUrl,!0),e.withCredentials=null==(i=a.withCredentials)||i,e.responseType=a.responseType||"json",Object.entries(a.headers||{}).forEach(([t,n])=>{e.setRequestHeader(t,n)}),e.onload=()=>{e.status>=200&&e.status<300?this.onRemoveSuccess(n,{response:e.response,status:e.status,statusText:e.statusText,request:e}):this.onRemoveError(n,{response:e.response,status:e.status,statusText:e.statusText,request:e})},e.onerror=()=>this.onRemoveError(n,{response:e.response,status:e.status,statusText:e.statusText,request:e}),e.send(l)}})},onUpload(){const e=this.fileStateCopy,t=re.groupFilesByUid(e),n=re.filesForUpload(t);this.uploadFiles(n);this.isControlled||(this.currentFiles=e),(()=>{const t={target:this,newState:e,affectedFiles:re.flatFileGroup(n)};this.$emit("statuschange",t)})()},onAdd(e){let t,n=_.getAllFileInfo(e);if(n=_.assignGuidToFiles(n,this.computedAsync.batch),xe(n,this.$props.restrictions,this.validateFile),t=this.$props.multiple?this.fileStateCopy:[],re.addMany(n,t),this.computedAsync.autoUpload){const e=re.groupFilesByUid(t);this.uploadFiles(re.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=l.Uploaded,e.progress=100}),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=l.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=[l.Uploaded,l.Initial,l.RemoveFailed];if(n[0]&&o.indexOf(n[0].status)>-1){const i={[e]:n};re.setFilesStatus(i,l.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=l.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=re.groupFilesByUid(t.filter(t=>t.uid===e));re.setFilesStatus(n,l.Uploading),this.uploadFiles(n);this.isControlled||(this.currentFiles=t),(()=>{const e={target:this,newState:t,affectedFiles:re.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](),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]()}),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:x,files:S,defaultFiles:k}=this.$props,I=n.templateRendering.call(this,this.$props.list,n.getListeners.call(this)),C=re.groupFilesByUid(this.computedFiles),N=re.filesForUpload(C);return t.createVNode(se,{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:I,restrictions:x,files:S,defaultFiles:k,async:this.computedAsync},null)}}),Ie=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(Se),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(D,R[D]),r=s.toLanguageString($,R[$]),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=Ie,e.Upload=ke,e.UploadFileStatus=l,e.UploadListActionButton=M,e.UploadListMultiItem=Z,e.UploadListSingleItem=K,e.UploadUI=ne,e.messages=R,e.utils=_});
@@ -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: 1778509303,version:"8.4.0-develop.1",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: 1779097545,version:"8.4.0-develop.3",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: 1778509303,
14
- version: "8.4.0-develop.1",
13
+ publishDate: 1779097545,
14
+ version: "8.4.0-develop.3",
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": "8.4.0-develop.1",
3
+ "version": "8.4.0-develop.3",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -25,12 +25,11 @@
25
25
  "sideEffects": false,
26
26
  "peerDependencies": {
27
27
  "@progress/kendo-licensing": "^1.7.2",
28
- "@progress/kendo-vue-buttons": "8.4.0-develop.1",
29
- "@progress/kendo-vue-common": "8.4.0-develop.1",
30
- "@progress/kendo-vue-intl": "8.4.0-develop.1",
31
- "@progress/kendo-vue-progressbars": "8.4.0-develop.1",
28
+ "@progress/kendo-vue-buttons": "8.4.0-develop.3",
29
+ "@progress/kendo-vue-common": "8.4.0-develop.3",
30
+ "@progress/kendo-vue-intl": "8.4.0-develop.3",
31
+ "@progress/kendo-vue-progressbars": "8.4.0-develop.3",
32
32
  "@progress/kendo-svg-icons": "^4.4.0",
33
- "axios": "^1.16.0",
34
33
  "vue": "^3.0.2"
35
34
  },
36
35
  "dependencies": {},
@@ -50,7 +49,7 @@
50
49
  "package": {
51
50
  "productName": "Kendo UI for Vue",
52
51
  "productCode": "KENDOUIVUE",
53
- "publishDate": 1778509303,
52
+ "publishDate": 1779097545,
54
53
  "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"
55
54
  }
56
55
  },
@@ -8,8 +8,14 @@
8
8
  import { UploadFileInfo } from '../interfaces/UploadFileInfo';
9
9
  import { UploadAsyncProps } from '../interfaces/UploadAsyncProps';
10
10
  import { UploadHttpHeaders } from '../interfaces/UploadHttpHeaders';
11
- import { AxiosResponse } from 'axios';
12
11
  import { UploadResponse } from '../interfaces/UploadResponse';
12
+ export interface XHRResponseData {
13
+ response: any;
14
+ status: number;
15
+ statusText: string;
16
+ headers?: any;
17
+ request?: XMLHttpRequest;
18
+ }
13
19
  /**
14
20
  * @hidden
15
21
  */
@@ -19,6 +25,6 @@ declare const _default: {
19
25
  populateRemoveFormData: (fileNames: string[], removeField: string, clientData: Object) => FormData;
20
26
  populateRequestOptions: (headers: UploadHttpHeaders, async: UploadAsyncProps) => any;
21
27
  cloneRequestHeaders: (headers: UploadHttpHeaders) => UploadHttpHeaders;
22
- convertAxiosResponse: (event: AxiosResponse<any, any, {}>) => UploadResponse;
28
+ convertResponse: (event: XHRResponseData) => UploadResponse;
23
29
  };
24
30
  export default _default;
@@ -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";const r=(t,e)=>{Object.keys(e).forEach(o=>{t.append(o,e[o])})},p=(t,e,o)=>{const n=new FormData;return r(n,o),t.forEach(s=>{const a=s.getRawFile?s.getRawFile():"";a?n.append(e,a,s.name):n.append(e,a)}),n},c=(t,e,o)=>{const n=new FormData;return r(n,o),t.forEach(s=>{n.append(e,s)}),n},u=(t,e)=>({headers:t,responseType:e.responseType,withCredentials:e.withCredentials}),i=t=>{const e={};return Object.keys(t).forEach(o=>{e[o]=t[o]}),e},l=t=>{const{data:e,config:o,...n}=t;return{response:e,...n}},d={populateClientFormData:r,populateUploadFormData:p,populateRemoveFormData:c,populateRequestOptions:u,cloneRequestHeaders:i,convertAxiosResponse:l};module.exports=d;
8
+ "use strict";const n=(t,e)=>{Object.keys(e).forEach(s=>{t.append(s,e[s])})},p=(t,e,s)=>{const r=new FormData;return n(r,s),t.forEach(o=>{const a=o.getRawFile?o.getRawFile():"";a?r.append(e,a,o.name):r.append(e,a)}),r},c=(t,e,s)=>{const r=new FormData;return n(r,s),t.forEach(o=>{r.append(e,o)}),r},u=(t,e)=>({headers:t,responseType:e.responseType,withCredentials:e.withCredentials}),i=t=>{const e={};return Object.keys(t).forEach(s=>{e[s]=t[s]}),e},d=t=>{const e=t.getAllResponseHeaders(),s={};return e&&e.trim().split(/[\r\n]+/).forEach(r=>{const o=r.indexOf(":");o>0&&(s[r.substring(0,o).trim().toLowerCase()]=r.substring(o+1).trim())}),s},l=t=>({response:t.response,status:t.status,statusText:t.statusText,headers:t.request?d(t.request):t.headers||{},request:t.request}),m={populateClientFormData:n,populateUploadFormData:p,populateRemoveFormData:c,populateRequestOptions:u,cloneRequestHeaders:i,convertResponse:l};module.exports=m;