@progress/kendo-react-upload
Advanced tools
Comparing version 2.6.1 to 2.7.0-dev.201901311056
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@progress/kendo-react-intl"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","@progress/kendo-react-intl","prop-types"],t):"object"==typeof exports?exports.KendoReactUpload=t(require("react"),require("@progress/kendo-react-intl"),require("prop-types")):e.KendoReactUpload=t(e.React,e.KendoReactIntl,e.PropTypes)}(window,function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var o=n(11),r=n(30),i=Object.prototype.toString;function a(e){return"[object Array]"===i.call(e)}function s(e){return null!==e&&"object"==typeof e}function l(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:r,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function n(n,o){"object"==typeof t[o]&&"object"==typeof n?t[o]=e(t[o],n):t[o]=n}for(var o=0,r=arguments.length;o<r;o++)u(arguments[o],n);return t},extend:function(e,t,n){return u(t,function(t,r){e[r]=n&&"function"==typeof t?o(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";n.r(t);var o,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!0!==e&&!!e}).map(function(e){return Array.isArray(e)?r.apply(void 0,e):"object"==typeof e?Object.keys(e).map(function(t,n){return e[n]||e[t]&&t||null}).filter(function(e){return null!==e}).join(" "):e}).filter(function(e){return!!e}).join(" ")},i=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},a={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},s=function(){},l=function(){return function(){}}(),u=n(0),c=n(6),p=(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={focused:!1},t.handleFocus=function(e){t.setState({focused:!0})},t.handleBlur=function(e){t.setState({focused:!1})},t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.label,n=e.id,o=e.className,i=e.value,a=e.placeholder,s=e.valid,l=e.style,c=r({"k-textbox-container":!0,"k-state-focused":this.state.focused,"k-state-empty":!(i||a),"k-state-invalid":!s&&void 0!==s},o);return u.createElement("span",{className:c,onFocus:this.handleFocus,onBlur:this.handleBlur,style:l},this.props.children,t?n?u.createElement("label",{htmlFor:n,className:"k-label"},t):u.createElement("span",{className:"k-label"},t):null)},t.propTypes={label:c.string,id:c.string,value:c.string,placeholder:c.string,valid:c.bool},t}(u.Component);function f(e,t,n,o){if(e){var r={syntheticEvent:t,nativeEvent:t.nativeEvent,target:n};e.call(void 0,Object.assign(r,o))}}var v=function(){return"undefined"==typeof window};n.d(t,"classNames",function(){return r}),n.d(t,"guid",function(){return i}),n.d(t,"Keys",function(){return a}),n.d(t,"noop",function(){return s}),n.d(t,"FloatingLabel",function(){return d}),n.d(t,"FormComponent",function(){return l}),n.d(t,"dispatchEvent",function(){return f}),n.d(t,"isServerRendering",function(){return v})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(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"}(t.UploadFileStatus||(t.UploadFileStatus={}))},function(e,n){e.exports=t},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.cancel="upload.cancel",t.clearSelectedFiles="upload.clearSelectedFiles",t.dropFilesHere="upload.dropFilesHere",t.headerStatusUploaded="upload.headerStatusUploaded",t.headerStatusUploading="upload.headerStatusUploading",t.invalidFileExtension="upload.invalidFileExtension",t.invalidFiles="upload.invalidFiles",t.invalidMaxFileSize="upload.invalidMaxFileSize",t.invalidMinFileSize="upload.invalidMinFileSize",t.remove="upload.remove",t.retry="upload.retry",t.select="upload.select",t.uploadSelectedFiles="upload.uploadSelectedFiles",t.total="upload.total",t.files="upload.files",t.messages=((o={})[t.cancel]="Cancel",o[t.clearSelectedFiles]="Clear",o[t.dropFilesHere]="Drop files here to upload",o[t.headerStatusUploaded]="Done",o[t.headerStatusUploading]="Uploading...",o[t.invalidFileExtension]="File type not allowed.",o[t.invalidFiles]="Invalid file(s). Please check file upload requirements.",o[t.invalidMaxFileSize]="File size too large.",o[t.invalidMinFileSize]="File size too small.",o[t.remove]="Remove",o[t.retry]="Retry",o[t.select]="Select files...",o[t.uploadSelectedFiles]="Upload",o[t.total]="Total",o[t.files]="files",o)},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),r=n(2),i=/&/g,a=/</g,s=/"/g,l=/'/g,u=/>/g,c=function(e){return(""+e).replace(i,"&").replace(a,"<").replace(u,">").replace(s,""").replace(l,"'")},p=function(e){var t=e.match(/\.([^\.]+)$/);return t?t[0]:""},d=function(e){var t=e.name,n=e.size;return{extension:p(t),name:c(t),getRawFile:function(){return e},size:n,status:o.UploadFileStatus.Selected,progress:0,uid:""}},f=function(e){return!!(e.validationErrors&&e.validationErrors.length>0)};t.default={fileHasValidationErrors:f,filesHaveValidationErrors:function(e){for(var t=0,n=e;t<n.length;t++){var o=n[t];if(f(o))return!0}return!1},getTotalFilesSizeMessage:function(e){var 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)<1024?n.toFixed(2)+" KB":(n/1024).toFixed(2)+" MB"},getAllFileInfo:function(e){var t,n=new Array;for(t=0;t<e.length;t++)n.push(d(e[t]));return n},getFileInfo:d,getFileExtension:p,htmlEncode:c,assignGuidToFiles:function(e,t){var n=r.guid();return e.map(function(e){return e.uid=t?n:r.guid(),e})}}},function(e,t,n){"use strict";(function(t){var o=n(1),r=n(33),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,l={adapter:("undefined"!=typeof XMLHttpRequest?s=n(12):void 0!==t&&(s=n(12)),s),transformRequest:[function(e,t){return r(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){l.headers[e]={}}),o.forEach(["post","put","patch"],function(e){l.headers[e]=o.merge(i)}),e.exports=l}).call(this,n(32))},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(17),l=n(21),u=n(23),c=n(24),p=n(25),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onAdd=function(e){t.props.onAdd&&t.props.onAdd.call(void 0,e)},t.onRetry=function(e){t.props.onRetry&&t.props.onRetry.call(void 0,e)},t.onCancel=function(e){t.props.onCancel&&t.props.onCancel.call(void 0,e)},t.onClear=function(){t.props.onClear&&t.props.onClear.call(void 0)},t.onUpload=function(){t.props.onUpload&&t.props.onUpload.call(void 0)},t.onRemove=function(e){t.props.onRemove&&t.props.onRemove.call(void 0,e)},t.onKeyDown=function(e){t.props.onKeyDown&&t.props.onKeyDown.call(void 0,e,t.isRtl)},t.onClick=function(e){t.props.onClick&&t.props.onClick.call(void 0,e)},t}return r(t,e),Object.defineProperty(t.prototype,"async",{get:function(){var e=this.props;return{autoUpload:e.autoUpload,batch:e.batch,withCredentials:e.withCredentials,saveField:e.saveField,saveHeaders:e.saveHeaders,saveMethod:e.saveMethod,saveUrl:e.saveUrl,responseType:e.responseType,removeField:e.removeField,removeHeaders:e.removeHeaders,removeMethod:e.removeMethod,removeUrl:e.removeUrl}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groupsCount",{get:function(){return Object.keys(this.props.groupedFiles).length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastGroupIndex",{get:function(){return this.groupsCount-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"addButtonIndex",{get:function(){return-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clearButtonIndex",{get:function(){return this.lastGroupIndex+1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uploadButtonIndex",{get:function(){return this.lastGroupIndex+2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRtl",{get:function(){return this._container&&"rtl"===getComputedStyle(this._container).direction||!1},enumerable:!0,configurable:!0}),t.prototype.inputRef=function(){if(this._uploadAddButton)return this._uploadAddButton.inputRef()},t.prototype.render=function(){var e=this,t=this.props,n=t.multiple,o=t.disabled,r=t.tabindex,d=t.accept,f=t.showFileList,v=t.groupedFiles,h=t.navigationIndex,m=t.showActionButtons,y=t.notFocusedIndex,g=a.classNames("k-widget","k-upload","k-header",o?"k-state-disabled":""),b=i.createElement(c.UploadStatus,{fileGroup:v}),_=i.createElement(l.UploadAddButton,{ref:function(t){return e._uploadAddButton=t},accept:d,async:this.async,addButtonIndex:this.addButtonIndex,navigationIndex:h,notFocusedIndex:y,tabindex:r,multiple:n,disabled:o,onAdd:this.onAdd,onClick:this.onClick});return i.createElement("div",{ref:function(t){return e._container=t},className:g,onKeyDown:this.onKeyDown},i.createElement(p.UploadDropZone,{addButtonComponent:_,statusComponent:b,disabled:o,onAdd:this.onAdd}),f?i.createElement(s.UploadList,{groupedFiles:v,disabled:o,async:this.async,navigationIndex:h,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry,onClick:this.onClick}):void 0,m?i.createElement(u.UploadActionButtons,{disabled:o,navigationIndex:h,clearButtonIndex:this.clearButtonIndex,uploadButtonIndex:this.uploadButtonIndex,onUpload:this.onUpload,onClear:this.onClear,onClick:this.onClick}):void 0)},t.defaultProps={disabled:!1,groupedFiles:{},multiple:!0},t}(i.Component);t.UploadUI=d},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(3),l=n(4),u=n(5),c=function(e){function t(t){var n=e.call(this,t)||this;return n.buttonClassNames=function(e){var t=n.state,o=t.actionFocused,r=t.retryFocused;return a.classNames("k-button k-upload-action",n.props.disabled?"k-state-disabled":"",o&&"action"===e||r&&"retry"===e?"k-state-focused":"")},n.onRetryFocus=function(){n.setState({retryFocused:!0})},n.onRetryBlur=function(){n.setState({retryFocused:!1})},n.onActionFocus=function(){n.setState({actionFocused:!0})},n.onActionBlur=function(){n.setState({actionFocused:!1})},n.onActionClick=function(){var e=n.props,t=e.status,o=e.uid,r=e.disabled,i=e.onCancel,a=e.onRemove;r||t===s.UploadFileStatus.Removing||(t===s.UploadFileStatus.Uploading?i.call(void 0,o):a.call(void 0,o))},n.onRetryClick=function(){var e=n.props,t=e.uid,o=e.disabled,r=e.onRetry;o||r.call(void 0,t)},n.state={retryFocused:!1,actionFocused:!1},n}return r(t,e),t.prototype.actionButtonTitle=function(e,t){return e===s.UploadFileStatus.Uploading?t.toLanguageString(u.cancel,u.messages[u.cancel]):t.toLanguageString(u.remove,u.messages[u.remove])},t.prototype.retryButtonTitle=function(e){return e.toLanguageString(u.retry,u.messages[u.retry])},t.prototype.render=function(){var e=this.props,t=e.status,n=e.progress,o=a.classNames("k-icon",t===s.UploadFileStatus.Uploading?"k-cancel k-i-deny":"",t!==s.UploadFileStatus.Uploading?"k-delete k-i-x":""),r=t===s.UploadFileStatus.UploadFailed,u=t===s.UploadFileStatus.Uploading,c=(t===s.UploadFileStatus.Uploaded||t===s.UploadFileStatus.Initial)&&!this.props.async.removeUrl,p=l.provideLocalizationService(this);return i.createElement("strong",{className:"k-upload-status"},u?i.createElement("span",{className:"k-upload-pct"},n,"%"):void 0,r?i.createElement("button",{type:"button",tabIndex:-1,className:this.buttonClassNames("retry"),onFocus:this.onRetryFocus,onBlur:this.onRetryBlur,onClick:this.onRetryClick},i.createElement("span",{"aria-label":this.retryButtonTitle(p),title:this.retryButtonTitle(p),className:"k-icon k-retry k-i-refresh-sm"})):void 0,c?void 0:i.createElement("button",{type:"button",tabIndex:-1,className:this.buttonClassNames("action"),onFocus:this.onActionFocus,onBlur:this.onActionBlur,onClick:this.onActionClick},i.createElement("span",{"aria-label":this.actionButtonTitle(t,p),title:this.actionButtonTitle(t,p),className:o})))},t}(i.Component);t.UploadListActionButton=c,l.registerForLocalization(c)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];return e.apply(t,n)}}},function(e,t,n){"use strict";var o=n(1),r=n(34),i=n(36),a=n(37),s=n(38),l=n(13),u="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(39);e.exports=function(e){return new Promise(function(t,c){var p=e.data,d=e.headers;o.isFormData(p)&&delete d["Content-Type"];var f=new XMLHttpRequest,v="onreadystatechange",h=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in f||s(e.url)||(f=new window.XDomainRequest,v="onload",h=!0,f.onprogress=function(){},f.ontimeout=function(){}),e.auth){var m=e.auth.username||"",y=e.auth.password||"";d.Authorization="Basic "+u(m+":"+y)}if(f.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f[v]=function(){if(f&&(4===f.readyState||h)&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in f?a(f.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:1223===f.status?204:f.status,statusText:1223===f.status?"No Content":f.statusText,headers:n,config:e,request:f};r(t,c,o),f=null}},f.onerror=function(){c(l("Network Error",e,null,f)),f=null},f.ontimeout=function(){c(l("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",f)),f=null},o.isStandardBrowserEnv()){var g=n(40),b=(e.withCredentials||s(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}if("setRequestHeader"in f&&o.forEach(d,function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete d[t]:f.setRequestHeader(t,e)}),e.withCredentials&&(f.withCredentials=!0),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){f&&(f.abort(),c(e),f=null)}),void 0===p&&(p=null),f.send(p)})}},function(e,t,n){"use strict";var o=n(35);e.exports=function(e,t,n,r,i){var a=new Error(e);return o(a,t,n,r,i)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function o(e){this.message=e}o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(9);t.UploadUI=o.UploadUI;var r=n(26);t.Upload=r.Upload;var i=n(3);t.UploadFileStatus=i.UploadFileStatus},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(18),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.mapListGroups=function(){var e=this.props,t=e.groupedFiles,n=e.navigationIndex,o=a(e,["groupedFiles","navigationIndex"]);return Object.keys(t).map(function(e,r){var a=t[e];return s.createElement(u.UploadListGroup,i({key:e,files:a,index:r,navigationIndex:n},o))})},t.prototype.render=function(){var e=l.classNames("k-upload-files","k-reset");return s.createElement("ul",{className:e},this.mapListGroups())},t}(s.Component);t.UploadList=c},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(2),l=n(3),u=n(19),c=n(20),p=n(7),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClick=function(){t.props.onClick.call(void 0,t.props.index)},t}return r(t,e),t.prototype.componentDidUpdate=function(){var e=this.props;e.navigationIndex===e.index&&this._element&&document.activeElement!==this._element&&this._element.focus()},t.prototype.render=function(){var e=this,t=this.props,n=t.files,o=t.async,r=t.disabled,d=t.navigationIndex,f=t.index,v=t.onCancel,h=t.onRemove,m=t.onRetry,y=n[0],g=y.status===l.UploadFileStatus.Uploaded||n[0].status===l.UploadFileStatus.Initial,b=s.classNames("k-file",p.default.filesHaveValidationErrors(n)?"k-file-invalid":"",y.status===l.UploadFileStatus.UploadFailed||y.status===l.UploadFileStatus.RemoveFailed?"k-file-error":"",y.status===l.UploadFileStatus.Uploading?"k-file-progress":"",g?"k-file-success":"",d===f?"k-state-focused":""),_={async:o,disabled:r,onCancel:v,onRemove:h,onRetry:m};return a.createElement("li",{ref:function(t){return e._element=t},className:b,"data-uid":y.uid,tabIndex:-1,onClick:this.onClick},1===n.length?a.createElement(u.UploadListSingleItem,i({file:y},_)):a.createElement(c.UploadListMultiItem,i({files:n},_)))},t}(a.Component);t.UploadListGroup=d},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(3),c=n(4),p=n(5),d=n(7),f=n(10),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getFileExtension=function(e){return e.extension?e.extension.substring(1):""},t.prototype.getFileValidationMessage=function(e){var t="";if(e.validationErrors&&e.validationErrors.length>0){var n=c.provideLocalizationService(this),o="upload."+e.validationErrors[0];t=n.toLanguageString(o,p.messages[o])}return t},t.prototype.renderValidationError=function(e){return[s.createElement("span",{className:"k-file-invalid-extension-wrapper",key:"1"},s.createElement("span",{className:"k-file-invalid-icon"},"!"),s.createElement("span",{className:"k-file-state"})),s.createElement("span",{className:"k-file-name-size-wrapper",key:"2"},s.createElement("span",{className:"k-file-name k-file-name-invalid",title:e.name},e.name),s.createElement("span",{className:"k-file-validation-message"},this.getFileValidationMessage(e)))]},t.prototype.renderFileDetails=function(e){return[s.createElement("span",{className:"k-file-extension-wrapper",key:"1"},s.createElement("span",{className:"k-file-extension"},this.getFileExtension(e)),s.createElement("span",{className:"k-file-state"})),s.createElement("span",{className:"k-file-name-size-wrapper",key:"2"},s.createElement("span",{className:"k-file-name",title:e.name},e.name),s.createElement("span",{className:"k-file-size"},d.default.getTotalFilesSizeMessage([e])))]},t.prototype.isProgressActive=function(){return this.props.file.status===u.UploadFileStatus.Uploading},t.prototype.render=function(){var e=this.props,t=e.file,n=a(e,["file"]),o=l.classNames("k-file-single");return s.createElement("div",{className:o},s.createElement("span",{className:"k-progress",style:{width:(t.progress||0)+"%",opacity:this.isProgressActive()?1:0,transition:"opacity .5s ease-in-out"}}),t.validationErrors&&t.validationErrors.length>0?this.renderValidationError(t):void 0,t.validationErrors&&0!==t.validationErrors.length?void 0:this.renderFileDetails(t),s.createElement(f.UploadListActionButton,i({uid:t.uid,status:t.status,progress:t.progress},n)))},t}(s.Component);t.UploadListSingleItem=v,c.registerForLocalization(v)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(3),c=n(7),p=n(4),d=n(5),f=n(10),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.mapFiles=function(){var e=this;return this.props.files.map(function(t){return s.createElement("span",{key:t.name,className:e.fileNameClasses(t),title:t.name},t.name)})},t.prototype.fileNameClasses=function(e){return l.classNames("k-file-name",c.default.fileHasValidationErrors(e)?"k-file-name-invalid":"")},t.prototype.isProgressActive=function(){return this.props.files[0].status===u.UploadFileStatus.Uploading},t.prototype.progress=function(){var e=this.props.files,t=0;return e.forEach(function(e){t+=e.progress||0}),t/e.length},t.prototype.render=function(){var e=this.props,t=e.files,n=a(e,["files"]),o=l.classNames("k-file-multiple"),r=c.default.filesHaveValidationErrors(t),u=p.provideLocalizationService(this),v=u.toLanguageString(d.total,d.messages[d.total]),h=u.toLanguageString(d.files,d.messages[d.files]),m=u.toLanguageString(d.invalidFiles,d.messages[d.invalidFiles]),y=this.progress();return s.createElement("div",{className:o},s.createElement("span",{className:"k-progress",style:{width:y+"%",opacity:this.isProgressActive()?1:0,transition:"opacity .5s ease-in-out"}}),r?s.createElement("span",{className:"k-multiple-files-invalid-extension-wrapper"},s.createElement("span",{className:"k-file-invalid-icon"},"!"),s.createElement("span",{className:"k-file-state"})):s.createElement("span",{className:"k-multiple-files-extension-wrapper"},s.createElement("span",{className:"k-file-state"})),s.createElement("span",{className:"k-file-name-size-wrapper"},this.mapFiles(),r?s.createElement("span",{className:"k-file-validation-message"},m):s.createElement("span",{className:"k-file-information"},v,": ",t.length," ",h,", ",c.default.getTotalFilesSizeMessage(t))),s.createElement(f.UploadListActionButton,i({uid:t[0].uid,status:t[0].status,progress:y},n)))},t}(s.Component);t.UploadListMultiItem=v,p.registerForLocalization(v)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(4),c=n(5),p=n(22),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClick=function(){t.props.onClick.call(void 0,t.props.addButtonIndex)},t}return r(t,e),t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.navigationIndex,o=t.addButtonIndex,r=t.notFocusedIndex;n!==e.navigationIndex&&e.navigationIndex!==r&&n===o&&this._element&&this._element.focus()},t.prototype.inputRef=function(){if(this._uploadInput)return this._uploadInput.inputRef()},t.prototype.render=function(){var e=this,t=this.props,n=t.navigationIndex,o=t.addButtonIndex,r=t.tabindex,d=a(t,["navigationIndex","addButtonIndex","tabindex"]),f=u.provideLocalizationService(this).toLanguageString(c.select,c.messages[c.select]),v=l.classNames("k-button","k-upload-button",n===o?"k-state-focused":"");return s.createElement("div",{ref:function(t){return e._element=t},role:"button",className:v,"aria-label":f,tabIndex:r,onClick:this.onClick},s.createElement(p.UploadInput,i({},d,{ref:function(t){return e._uploadInput=t}})),s.createElement("span",null,f))},t}(s.Component);t.UploadAddButton=d,u.registerForLocalization(d)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=/(chrome)[ \/]([\w.]+)/i,s=/(webkit)[ \/]([\w.]+)/i,l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputRef=function(){return t._input},t.onAdd=function(){var e=navigator.userAgent,n=t._input;n&&(t.props.onAdd&&n.files&&t.props.onAdd.call(void 0,n.files),!e.match(a)&&e.match(s)||(n.type="",n.type="file"))},t}return r(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.multiple,o=t.async,r=t.disabled,a=t.accept;return i.createElement("input",{ref:function(t){return e._input=t},autoComplete:"off",name:o.saveField,accept:a,type:"file",tabIndex:-1,multiple:n,disabled:r,onChange:this.onAdd})},t}(i.Component);t.UploadInput=l},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(4),l=n(5),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClearClick=function(){t.props.disabled||t.props.onClear&&t.props.onClear.call(void 0)},t.onUploadClick=function(){t.props.disabled||(t.props.onClick.call(void 0,t.props.uploadButtonIndex),t.props.onUpload&&t.props.onUpload.call(void 0))},t}return r(t,e),t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.navigationIndex,o=t.clearButtonIndex,r=t.uploadButtonIndex;n!==e.navigationIndex&&(n===o&&this._clearElement&&this._clearElement.focus(),n===r&&this._uploadElement&&this._uploadElement.focus())},t.prototype.render=function(){var e=this,t=this.props,n=t.disabled,o=t.navigationIndex,r=t.clearButtonIndex,u=t.uploadButtonIndex,c=s.provideLocalizationService(this),p=a.classNames("k-action-buttons"),d=a.classNames("k-button","k-clear-selected",n?"k-state-disabled":"",o===r?"k-state-focused":""),f=a.classNames("k-button","k-primary","k-upload-selected",n?"k-state-disabled":"",o===u?"k-state-focused":"");return i.createElement("div",{className:p},i.createElement("button",{ref:function(t){return e._clearElement=t},type:"button",className:d,tabIndex:-1,onClick:this.onClearClick},c.toLanguageString(l.clearSelectedFiles,l.messages[l.clearSelectedFiles])),i.createElement("button",{ref:function(t){return e._uploadElement=t},type:"button",className:f,tabIndex:-1,onClick:this.onUploadClick},c.toLanguageString(l.uploadSelectedFiles,l.messages[l.uploadSelectedFiles])))},t}(i.Component);t.UploadActionButtons=u,s.registerForLocalization(u)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(3),l=n(4),u=n(5),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(){var e,t,n,o=this.props.fileGroup;Object.keys(o).forEach(function(r){o[r].forEach(function(o){o.status===s.UploadFileStatus.Uploading&&(e=!0),o.status===s.UploadFileStatus.Uploaded&&(t=!0),o.status===s.UploadFileStatus.UploadFailed&&(n=!0)})});var r=a.classNames("k-upload-status","k-upload-status-total"),c=a.classNames(e||n||!t?"":"k-i-checkmark",!e&&n?"k-i-exception":"",e?"k-i-loading":"","k-icon"),p="",d=l.provideLocalizationService(this);return e?p=d.toLanguageString(u.headerStatusUploading,u.messages[u.headerStatusUploading]):(t||n)&&(p=d.toLanguageString(u.headerStatusUploaded,u.messages[u.headerStatusUploaded])),i.createElement("div",{className:r},i.createElement("span",{className:c}),p)},t}(i.Component);t.UploadStatus=c,l.registerForLocalization(c)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(4),l=n(5),u=100,c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._documentActive=!1,t._elementActive=!1,t.onDocumentDragEnter=function(){if(!t.documentActive){t.documentActive=!0;t._documentInterval=setInterval(function(){t.isDragOver(t._lastDocumentDragOver)&&(t.documentActive=!1,clearInterval(t._documentInterval),t._documentInterval=null,t._lastDocumentDragOver=null)},u)}},t.onDocumentDragOver=function(){t._lastDocumentDragOver=new Date},t.onElementDragEnter=function(){if(!t.elementActive){t.elementActive=!0;t._elementInterval=setInterval(function(){t.isDragOver(t._lastElementDragOver)&&(t.elementActive=!1,clearInterval(t._elementInterval),t._elementInterval=null,t._lastElementDragOver=null)},u)}},t.onElementDragOver=function(e){e.preventDefault(),t._lastElementDragOver=new Date},t.onDrop=function(e){e.preventDefault();var n=e.dataTransfer.files;n.length>0&&!t.props.disabled&&t.props.onAdd&&t.props.onAdd.call(void 0,n)},t.isDragOver=function(e){return(new Date).getTime()-(e||new Date).getTime()>u},t}return r(t,e),Object.defineProperty(t.prototype,"documentActive",{get:function(){return this._documentActive},set:function(e){var t=this.documentActive;this._documentActive=e,e!==t&&this.forceUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elementActive",{get:function(){return this._elementActive},set:function(e){var t=this._elementActive;this._elementActive=e,e!==t&&this.setState({})},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){document.addEventListener("dragenter",this.onDocumentDragEnter),document.addEventListener("dragover",this.onDocumentDragOver)},t.prototype.componentWillUnmount=function(){document.removeEventListener("dragenter",this.onDocumentDragEnter),document.removeEventListener("dragover",this.onDocumentDragOver)},t.prototype.render=function(){var e=this.props,t=e.addButtonComponent,n=e.statusComponent,o=s.provideLocalizationService(this).toLanguageString(l.dropFilesHere,l.messages[l.dropFilesHere]),r=a.classNames("k-dropzone",this.documentActive?"k-dropzone-active":"",this.elementActive?"k-dropzone-hovered":"");return i.createElement("div",{className:r,onDrop:this.onDrop,onDragEnter:this.onElementDragEnter,onDragOver:this.onElementDragOver},t,i.createElement("div",{className:"k-dropzone-hint"},o),n)},t}(i.Component);t.UploadDropZone=c,s.registerForLocalization(c)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(6),u=n(3),c=n(27),p=n(28),d=n(7),f=n(48),v=n(49),h=n(50),m=function(e){function t(t){var n=e.call(this,t)||this;return n._httpSubscriptions={},n.uploadFiles=function(e){var t=n.async;f.default.setFilesStatus(e,u.UploadFileStatus.Uploading),f.default.groupForEach(e,function(e,o){var r=v.default.cloneRequestHeaders(t.saveHeaders||{}),a={target:n,files:e,headers:r,additionalData:{}};n.props.onBeforeUpload&&n.props.onBeforeUpload.call(void 0,a);var s=v.default.populateUploadFormData(e,t.saveField,a.additionalData),l=v.default.populateRequestOptions(a.headers,n.async),u=p.default.CancelToken.source();n._httpSubscriptions[o]=u,p.default(i({method:t.saveMethod,url:t.saveUrl,data:s,cancelToken:u.token},l,{onUploadProgress:function(e){return n.onUploadProgress(e,o)}})).then(function(e){return n.onUploadSuccess(e,o)}).catch(function(e){return n.onUploadError(e,o)})})},n.removeFiles=function(e){var t=n.async;f.default.groupForEach(e,function(e,o){var r=v.default.cloneRequestHeaders(t.removeHeaders||{}),a={target:n,files:e,headers:r,additionalData:{}};n.props.onBeforeRemove&&n.props.onBeforeRemove.call(void 0,a);var s=e.map(function(e){return e.name}),l=v.default.populateRemoveFormData(s,t.removeField,a.additionalData),u=v.default.populateRequestOptions(a.headers,n.async);p.default(i({method:t.removeMethod,url:t.removeUrl,data:l},u)).then(function(e){return n.onRemoveSuccess(e,o)}).catch(function(e){return n.onRemoveError(e,o)})})},n.onUpload=function(){var e=n.stateCopy,t=f.default.filesForUpload(e);if(n.uploadFiles(t),n.isControlled){if(n.props.onStatusChange){var o={target:n,newState:e,affectedFiles:f.default.flatFileGroup(t)};n.props.onStatusChange.call(void 0,o)}}else n.setState({files:e})},n.onAdd=function(e){var t,o=d.default.getAllFileInfo(e);if(o=d.default.assignGuidToFiles(o,n.async.batch),h.default.validateFiles(o,n.props.restrictions),t=n.props.multiple?n.stateCopy:[],f.default.addMany(o,t),n.async.autoUpload&&n.uploadFiles(f.default.filesForUpload(t)),n.isControlled){if(n.props.onAdd){var r={target:n,newState:t,affectedFiles:o};n.props.onAdd.call(void 0,r)}}else n.setState({files:t})},n.onUploadProgress=function(e,t){var o=Math.round(100*e.loaded/e.total)||0,r=n.stateCopy,i=r.filter(function(e){return e.uid===t});if(i.forEach(function(e){e.progress=o}),n.isControlled){if(n.props.onProgress){var a={target:n,newState:r,affectedFiles:i};n.props.onProgress.call(void 0,a)}}else n.setState({files:r})},n.onUploadSuccess=function(e,t){var o=n.stateCopy,r=o.filter(function(e){return e.uid===t});if(r.forEach(function(e){e.status=u.UploadFileStatus.Uploaded}),delete n._httpSubscriptions[t],n.isControlled){if(n.props.onStatusChange){var i={target:n,newState:o,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onStatusChange.call(void 0,i)}}else n.setState({files:o})},n.onUploadError=function(e,t){var o=n.stateCopy,r=o.filter(function(e){return e.uid===t});if(r.forEach(function(e){e.status=u.UploadFileStatus.UploadFailed}),delete n._httpSubscriptions[t],n.isControlled){if(n.props.onStatusChange){var i={target:n,newState:o,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onStatusChange.call(void 0,i)}}else n.setState({files:o})},n.onRemove=function(e){var t,o=n.stateCopy,r=o.filter(function(t){return t.uid===e}),i=o.filter(function(t){return t.uid!==e});if([u.UploadFileStatus.Uploaded,u.UploadFileStatus.Initial,u.UploadFileStatus.RemoveFailed].indexOf(r[0].status)>-1){var a=((t={})[e]=r,t);if(f.default.setFilesStatus(a,u.UploadFileStatus.Removing),n.removeFiles(a),n.isControlled){if(n.props.onStatusChange){var s={target:n,newState:o,affectedFiles:r};n.props.onStatusChange.call(void 0,s)}}else n.setState({files:o})}else if(n.isControlled){if(n.props.onRemove){s={target:n,newState:i,affectedFiles:r};n.props.onRemove.call(void 0,s)}}else n.setState({files:i})},n.onRemoveSuccess=function(e,t){var o=n.stateCopy,r=o.filter(function(e){return e.uid===t}),i=o.filter(function(e){return e.uid!==t});if(n.isControlled){if(n.props.onRemove){var a={target:n,newState:i,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onRemove.call(void 0,a)}}else n.setState({files:i})},n.onRemoveError=function(e,t){var o=n.stateCopy,r=o.filter(function(e){return e.uid===t});if(r.forEach(function(e){e.status=u.UploadFileStatus.RemoveFailed}),n.isControlled){if(n.props.onStatusChange){var i={target:n,newState:o,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onStatusChange.call(void 0,i)}}else n.setState({files:o})},n.onRetry=function(e){var t=n.stateCopy,o=f.default.groupFilesByUid(t.filter(function(t){return t.uid===e}));if(f.default.setFilesStatus(o,u.UploadFileStatus.Uploading),n.uploadFiles(o),n.isControlled){if(n.props.onStatusChange){var r={target:n,newState:t,affectedFiles:f.default.flatFileGroup(o)};n.props.onStatusChange.call(void 0,r)}}else n.setState({files:t})},n.onCancel=function(e){var t=n.stateCopy,o=t.filter(function(t){return t.uid!==e}),r=t.filter(function(t){return t.uid===e});if(n._httpSubscriptions[e]&&(n._httpSubscriptions[e].cancel(),delete n._httpSubscriptions[e]),n.isControlled){if(n.props.onRemove){var i={target:n,newState:o,affectedFiles:r};n.props.onRemove.call(void 0,i)}}else n.setState({files:o})},n.onClear=function(){if(n.files.length)if(Object.keys(n._httpSubscriptions).forEach(function(e){n._httpSubscriptions[e].cancel()}),n._httpSubscriptions={},n.isControlled){if(n.props.onRemove){var e={target:n,newState:[],affectedFiles:n.stateCopy};n.props.onRemove.call(void 0,e)}}else n.setState({files:[]})},n.state={files:t.defaultFiles||[]},n}return r(t,e),Object.defineProperty(t.prototype,"async",{get:function(){var e=this.props;return{autoUpload:e.autoUpload,batch:e.batch,removeField:e.removeField,removeHeaders:e.removeHeaders,removeMethod:e.removeMethod,removeUrl:e.removeUrl,responseType:e.responseType,saveField:e.saveField,saveHeaders:e.saveHeaders,saveMethod:e.saveMethod,saveUrl:e.saveUrl,withCredentials:e.withCredentials}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"files",{get:function(){return(this.isControlled?this.props.files:this.state.files)||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isControlled",{get:function(){return!this.props.defaultFiles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stateCopy",{get:function(){return this.isControlled?f.default.copyState(this.props.files):f.default.copyState(this.state.files)},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.showFileList,n=(e.onAdd,e.onRemove,e.autoUpload),o=a(e,["showFileList","onAdd","onRemove","autoUpload"]),r=f.default.groupFilesByUid(this.files),l=Object.keys(r).length;return s.createElement(c.UploadNavigation,i({groupedFiles:r,showFileList:!!l&&t,showActionButtons:!!l&&!n,autoUpload:n,onAdd:this.onAdd,onRemove:this.onRemove,onClear:this.onClear,onUpload:this.onUpload,onRetry:this.onRetry,onCancel:this.onCancel},o))},t.defaultProps={autoUpload:!0,batch:!1,removeField:"fileNames",removeHeaders:{},removeMethod:"POST",removeUrl:"",responseType:"json",saveField:"files",saveHeaders:{},saveMethod:"POST",saveUrl:"",withCredentials:!0,restrictions:{allowedExtensions:[],maxFileSize:0,minFileSize:0},multiple:!0,showFileList:!0,disabled:!1,tabindex:0},t.propTypes={autoUpload:l.bool,batch:l.bool,withCredentials:l.bool,saveField:l.string,saveHeaders:l.object,saveMethod:l.string,saveUrl:l.string,responseType:l.oneOf(["arraybuffer","blob","json","text"]),removeField:l.string,removeHeaders:l.object,removeMethod:l.string,removeUrl:l.string,multiple:l.bool,disabled:l.bool,showFileList:l.bool,tabindex:l.number,accept:l.string,restrictions:l.shape({allowedExtensions:l.arrayOf(l.string),maxFileSize:l.number,minFileSize:l.number}),files:l.arrayOf(l.shape({uid:l.string,name:l.string,extension:l.string,size:l.number,validationErrors:l.arrayOf(l.string),status:l.oneOf([u.UploadFileStatus.Initial,u.UploadFileStatus.RemoveFailed,u.UploadFileStatus.Removing,u.UploadFileStatus.Selected,u.UploadFileStatus.UploadFailed,u.UploadFileStatus.Uploaded,u.UploadFileStatus.Uploading]),progress:l.number,getRawFile:l.func})),defaultFiles:l.arrayOf(l.shape({uid:l.string,name:l.string,extension:l.string,size:l.number,validationErrors:l.arrayOf(l.string),status:l.oneOf([u.UploadFileStatus.Initial,u.UploadFileStatus.RemoveFailed,u.UploadFileStatus.Removing,u.UploadFileStatus.Selected,u.UploadFileStatus.UploadFailed,u.UploadFileStatus.Uploaded,u.UploadFileStatus.Uploading]),progress:l.number,getRawFile:l.func}))},t}(s.Component);t.Upload=m},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s,l=n(0),u=n(9);!function(e){e[e.esc=27]="esc",e[e.tab=9]="tab",e[e.enter=13]="enter",e[e.space=32]="space",e[e.shift=16]="shift",e[e.delete=46]="delete",e[e.left=37]="left",e[e.up=38]="up",e[e.right=39]="right",e[e.down=40]="down"}(s=t.Keys||(t.Keys={}));var c=-2,p=-1,d=function(e){function t(t){var n=e.call(this,t)||this;return n.onKeyDown=function(e,t){var o=s[e.keyCode],r=n.navIndex,i=Object.keys(n.props.groupedFiles),a=i.length-1,l=n.props.autoUpload||0===i.length?a:a+1,u=a+1,d=u+1,f=r===c?p:r,v=r;switch(o){case"up":r>-1&&(v=f-1);break;case"down":r<l&&(v=f+1);break;case"left":t?r===u&&(v=f+1):r===d&&(v=f-1);break;case"right":t?r===d&&(v=f-1):r===u&&(v=f+1);break;case"enter":if(r===p||r===c)if(n._uploadUI)(h=n._uploadUI.inputRef())&&h.click();r>=0&&r<=a&&n.onRetry(i[r]);break;case"space":var h;if(r===p||r===c)if(n._uploadUI)(h=n._uploadUI.inputRef())&&h.click();break;case"tab":v=c;break;case"delete":r>=0&&r<=a&&(v=f-1,n.onRemove(i[r]));break;case"esc":r>=0&&r<=a&&(v=f-1,n.onCancel(i[r]))}n.navIndex=v},n.onCancel=function(e){n.props.onCancel&&n.props.onCancel.call(void 0,e)},n.onClear=function(){n.navIndex=p,n.props.onClear&&n.props.onClear.call(void 0)},n.onRetry=function(e){n.props.onRetry&&n.props.onRetry.call(void 0,e)},n.onRemove=function(e){n.navIndex=n.navIndex>p?n.navIndex-1:p,n.props.onRemove&&n.props.onRemove.call(void 0,e)},n.onAdd=function(e){n.navIndex=p,n.props.onAdd&&n.props.onAdd.call(void 0,e)},n.onClick=function(e){n.navIndex=e},n._navIndex=c,n}return r(t,e),Object.defineProperty(t.prototype,"navIndex",{get:function(){return this._navIndex},set:function(e){var t=this.navIndex;this._navIndex=e,e!==t&&this.forceUpdate()},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(e){var t=Object.keys(e.groupedFiles).length,n=Object.keys(this.props.groupedFiles).length;t>n&&this.navIndex>p&&(this.navIndex=this.navIndex-(t-n))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onClear,t.onRemove,t.onRetry,t.onCancel,t.onAdd,a(t,["onClear","onRemove","onRetry","onCancel","onAdd"]));return l.createElement(u.UploadUI,i({ref:function(t){return e._uploadUI=t},onKeyDown:this.onKeyDown,navigationIndex:this.navIndex,notFocusedIndex:c,onAdd:this.onAdd,onClear:this.onClear,onRemove:this.onRemove,onRetry:this.onRetry,onCancel:this.onCancel,onClick:this.onClick},n))},t}(l.Component);t.UploadNavigation=d},function(e,t,n){e.exports=n(29)},function(e,t,n){"use strict";var o=n(1),r=n(11),i=n(31),a=n(8);function s(e){var t=new i(e),n=r(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var l=s(a);l.Axios=i,l.create=function(e){return s(o.merge(a,e))},l.Cancel=n(15),l.CancelToken=n(46),l.isCancel=n(14),l.all=function(e){return Promise.all(e)},l.spread=n(47),e.exports=l,e.exports.default=l},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@progress/kendo-react-intl"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","@progress/kendo-react-intl","prop-types"],t):"object"==typeof exports?exports.KendoReactUpload=t(require("react"),require("@progress/kendo-react-intl"),require("prop-types")):e.KendoReactUpload=t(e.React,e.KendoReactIntl,e.PropTypes)}(window,function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var o=n(11),r=n(30),i=Object.prototype.toString;function a(e){return"[object Array]"===i.call(e)}function s(e){return null!==e&&"object"==typeof e}function l(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:r,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function n(n,o){"object"==typeof t[o]&&"object"==typeof n?t[o]=e(t[o],n):t[o]=n}for(var o=0,r=arguments.length;o<r;o++)u(arguments[o],n);return t},extend:function(e,t,n){return u(t,function(t,r){e[r]=n&&"function"==typeof t?o(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";n.r(t);var o,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!0!==e&&!!e}).map(function(e){return Array.isArray(e)?r.apply(void 0,e):"object"==typeof e?Object.keys(e).map(function(t,n){return e[n]||e[t]&&t||null}).filter(function(e){return null!==e}).join(" "):e}).filter(function(e){return!!e}).join(" ")},i=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},a={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},s=function(){},l=function(){return function(){}}(),u=n(0),c=n(6),p=(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={focused:!1},t.handleFocus=function(e){t.setState({focused:!0})},t.handleBlur=function(e){t.setState({focused:!1})},t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.label,n=e.id,o=e.className,i=e.value,a=e.placeholder,s=e.valid,l=e.style,c=r({"k-textbox-container":!0,"k-state-focused":this.state.focused,"k-state-empty":!(i||a),"k-state-invalid":!s&&void 0!==s},o);return u.createElement("span",{className:c,onFocus:this.handleFocus,onBlur:this.handleBlur,style:l},this.props.children,t?n?u.createElement("label",{htmlFor:n,className:"k-label"},t):u.createElement("span",{className:"k-label"},t):null)},t.propTypes={label:c.string,id:c.string,value:c.string,placeholder:c.string,valid:c.bool},t}(u.Component);function f(e,t,n,o){if(e){var r={syntheticEvent:t,nativeEvent:t.nativeEvent,target:n};e.call(void 0,Object.assign(r,o))}}var v=function(){return"undefined"==typeof window};n.d(t,"classNames",function(){return r}),n.d(t,"guid",function(){return i}),n.d(t,"Keys",function(){return a}),n.d(t,"noop",function(){return s}),n.d(t,"FloatingLabel",function(){return d}),n.d(t,"FormComponent",function(){return l}),n.d(t,"dispatchEvent",function(){return f}),n.d(t,"isServerRendering",function(){return v})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(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"}(t.UploadFileStatus||(t.UploadFileStatus={}))},function(e,n){e.exports=t},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.cancel="upload.cancel",t.clearSelectedFiles="upload.clearSelectedFiles",t.dropFilesHere="upload.dropFilesHere",t.headerStatusUploaded="upload.headerStatusUploaded",t.headerStatusUploading="upload.headerStatusUploading",t.invalidFileExtension="upload.invalidFileExtension",t.invalidFiles="upload.invalidFiles",t.invalidMaxFileSize="upload.invalidMaxFileSize",t.invalidMinFileSize="upload.invalidMinFileSize",t.remove="upload.remove",t.retry="upload.retry",t.select="upload.select",t.uploadSelectedFiles="upload.uploadSelectedFiles",t.total="upload.total",t.files="upload.files",t.messages=((o={})[t.cancel]="Cancel",o[t.clearSelectedFiles]="Clear",o[t.dropFilesHere]="Drop files here to upload",o[t.headerStatusUploaded]="Done",o[t.headerStatusUploading]="Uploading...",o[t.invalidFileExtension]="File type not allowed.",o[t.invalidFiles]="Invalid file(s). Please check file upload requirements.",o[t.invalidMaxFileSize]="File size too large.",o[t.invalidMinFileSize]="File size too small.",o[t.remove]="Remove",o[t.retry]="Retry",o[t.select]="Select files...",o[t.uploadSelectedFiles]="Upload",o[t.total]="Total",o[t.files]="files",o)},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),r=n(2),i=/&/g,a=/</g,s=/"/g,l=/'/g,u=/>/g,c=function(e){return(""+e).replace(i,"&").replace(a,"<").replace(u,">").replace(s,""").replace(l,"'")},p=function(e){var t=e.match(/\.([^\.]+)$/);return t?t[0]:""},d=function(e){var t=e.name,n=e.size;return{extension:p(t),name:c(t),getRawFile:function(){return e},size:n,status:o.UploadFileStatus.Selected,progress:0,uid:""}},f=function(e){return!!(e.validationErrors&&e.validationErrors.length>0)};t.default={fileHasValidationErrors:f,filesHaveValidationErrors:function(e){for(var t=0,n=e;t<n.length;t++){var o=n[t];if(f(o))return!0}return!1},getTotalFilesSizeMessage:function(e){var 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)<1024?n.toFixed(2)+" KB":(n/1024).toFixed(2)+" MB"},getAllFileInfo:function(e){var t,n=new Array;for(t=0;t<e.length;t++)n.push(d(e[t]));return n},getFileInfo:d,getFileExtension:p,htmlEncode:c,assignGuidToFiles:function(e,t){var n=r.guid();return e.map(function(e){return e.uid=t?n:r.guid(),e})}}},function(e,t,n){"use strict";(function(t){var o=n(1),r=n(33),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,l={adapter:("undefined"!=typeof XMLHttpRequest?s=n(12):void 0!==t&&(s=n(12)),s),transformRequest:[function(e,t){return r(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){l.headers[e]={}}),o.forEach(["post","put","patch"],function(e){l.headers[e]=o.merge(i)}),e.exports=l}).call(this,n(32))},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(17),l=n(21),u=n(23),c=n(24),p=n(25),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onAdd=function(e){t.props.onAdd&&t.props.onAdd.call(void 0,e)},t.onRetry=function(e){t.props.onRetry&&t.props.onRetry.call(void 0,e)},t.onCancel=function(e){t.props.onCancel&&t.props.onCancel.call(void 0,e)},t.onClear=function(){t.props.onClear&&t.props.onClear.call(void 0)},t.onUpload=function(){t.props.onUpload&&t.props.onUpload.call(void 0)},t.onRemove=function(e){t.props.onRemove&&t.props.onRemove.call(void 0,e)},t.onKeyDown=function(e){t.props.onKeyDown&&t.props.onKeyDown.call(void 0,e,t.isRtl)},t.onClick=function(e){t.props.onClick&&t.props.onClick.call(void 0,e)},t}return r(t,e),Object.defineProperty(t.prototype,"async",{get:function(){var e=this.props;return{autoUpload:e.autoUpload,batch:e.batch,withCredentials:e.withCredentials,saveField:e.saveField,saveHeaders:e.saveHeaders,saveMethod:e.saveMethod,saveUrl:e.saveUrl,responseType:e.responseType,removeField:e.removeField,removeHeaders:e.removeHeaders,removeMethod:e.removeMethod,removeUrl:e.removeUrl}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"groupsCount",{get:function(){return Object.keys(this.props.groupedFiles).length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastGroupIndex",{get:function(){return this.groupsCount-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"addButtonIndex",{get:function(){return-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clearButtonIndex",{get:function(){return this.lastGroupIndex+1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uploadButtonIndex",{get:function(){return this.lastGroupIndex+2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRtl",{get:function(){return this._container&&"rtl"===getComputedStyle(this._container).direction||!1},enumerable:!0,configurable:!0}),t.prototype.inputRef=function(){if(this._uploadAddButton)return this._uploadAddButton.inputRef()},t.prototype.render=function(){var e=this,t=this.props,n=t.multiple,o=t.disabled,r=t.tabindex,d=t.accept,f=t.showFileList,v=t.groupedFiles,h=t.navigationIndex,m=t.showActionButtons,y=t.notFocusedIndex,g=t.listItemUI,b=a.classNames("k-widget","k-upload","k-header",o?"k-state-disabled":""),_=i.createElement(c.UploadStatus,{fileGroup:v}),F=i.createElement(l.UploadAddButton,{ref:function(t){return e._uploadAddButton=t},accept:d,async:this.async,addButtonIndex:this.addButtonIndex,navigationIndex:h,notFocusedIndex:y,tabindex:r,multiple:n,disabled:o,onAdd:this.onAdd,onClick:this.onClick});return i.createElement("div",{ref:function(t){return e._container=t},className:b,onKeyDown:this.onKeyDown},i.createElement(p.UploadDropZone,{addButtonComponent:F,statusComponent:_,disabled:o,onAdd:this.onAdd}),f?i.createElement(s.UploadList,{groupedFiles:v,disabled:o,async:this.async,navigationIndex:h,listItemUI:g,onCancel:this.onCancel,onRemove:this.onRemove,onRetry:this.onRetry,onClick:this.onClick}):void 0,m?i.createElement(u.UploadActionButtons,{disabled:o,navigationIndex:h,clearButtonIndex:this.clearButtonIndex,uploadButtonIndex:this.uploadButtonIndex,onUpload:this.onUpload,onClear:this.onClear,onClick:this.onClick}):void 0)},t.defaultProps={disabled:!1,groupedFiles:{},multiple:!0},t}(i.Component);t.UploadUI=d},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(3),l=n(4),u=n(5),c=function(e){function t(t){var n=e.call(this,t)||this;return n.buttonClassNames=function(e){var t=n.state,o=t.actionFocused,r=t.retryFocused;return a.classNames("k-button k-upload-action",n.props.disabled?"k-state-disabled":"",o&&"action"===e||r&&"retry"===e?"k-state-focused":"")},n.onRetryFocus=function(){n.setState({retryFocused:!0})},n.onRetryBlur=function(){n.setState({retryFocused:!1})},n.onActionFocus=function(){n.setState({actionFocused:!0})},n.onActionBlur=function(){n.setState({actionFocused:!1})},n.onActionClick=function(){var e=n.props,t=e.status,o=e.uid,r=e.disabled,i=e.onCancel,a=e.onRemove;r||t===s.UploadFileStatus.Removing||(t===s.UploadFileStatus.Uploading?i.call(void 0,o):a.call(void 0,o))},n.onRetryClick=function(){var e=n.props,t=e.uid,o=e.disabled,r=e.onRetry;o||r.call(void 0,t)},n.state={retryFocused:!1,actionFocused:!1},n}return r(t,e),t.prototype.actionButtonTitle=function(e,t){return e===s.UploadFileStatus.Uploading?t.toLanguageString(u.cancel,u.messages[u.cancel]):t.toLanguageString(u.remove,u.messages[u.remove])},t.prototype.retryButtonTitle=function(e){return e.toLanguageString(u.retry,u.messages[u.retry])},t.prototype.render=function(){var e=this.props,t=e.status,n=e.progress,o=a.classNames("k-icon",t===s.UploadFileStatus.Uploading?"k-cancel k-i-deny":"",t!==s.UploadFileStatus.Uploading?"k-delete k-i-x":""),r=t===s.UploadFileStatus.UploadFailed,u=t===s.UploadFileStatus.Uploading,c=(t===s.UploadFileStatus.Uploaded||t===s.UploadFileStatus.Initial)&&!this.props.async.removeUrl,p=l.provideLocalizationService(this);return i.createElement("strong",{className:"k-upload-status"},u?i.createElement("span",{className:"k-upload-pct"},n,"%"):void 0,r?i.createElement("button",{type:"button",tabIndex:-1,className:this.buttonClassNames("retry"),onFocus:this.onRetryFocus,onBlur:this.onRetryBlur,onClick:this.onRetryClick},i.createElement("span",{"aria-label":this.retryButtonTitle(p),title:this.retryButtonTitle(p),className:"k-icon k-retry k-i-refresh-sm"})):void 0,c?void 0:i.createElement("button",{type:"button",tabIndex:-1,className:this.buttonClassNames("action"),onFocus:this.onActionFocus,onBlur:this.onActionBlur,onClick:this.onActionClick},i.createElement("span",{"aria-label":this.actionButtonTitle(t,p),title:this.actionButtonTitle(t,p),className:o})))},t}(i.Component);t.UploadListActionButton=c,l.registerForLocalization(c)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];return e.apply(t,n)}}},function(e,t,n){"use strict";var o=n(1),r=n(34),i=n(36),a=n(37),s=n(38),l=n(13),u="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(39);e.exports=function(e){return new Promise(function(t,c){var p=e.data,d=e.headers;o.isFormData(p)&&delete d["Content-Type"];var f=new XMLHttpRequest,v="onreadystatechange",h=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in f||s(e.url)||(f=new window.XDomainRequest,v="onload",h=!0,f.onprogress=function(){},f.ontimeout=function(){}),e.auth){var m=e.auth.username||"",y=e.auth.password||"";d.Authorization="Basic "+u(m+":"+y)}if(f.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f[v]=function(){if(f&&(4===f.readyState||h)&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in f?a(f.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:1223===f.status?204:f.status,statusText:1223===f.status?"No Content":f.statusText,headers:n,config:e,request:f};r(t,c,o),f=null}},f.onerror=function(){c(l("Network Error",e,null,f)),f=null},f.ontimeout=function(){c(l("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",f)),f=null},o.isStandardBrowserEnv()){var g=n(40),b=(e.withCredentials||s(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}if("setRequestHeader"in f&&o.forEach(d,function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete d[t]:f.setRequestHeader(t,e)}),e.withCredentials&&(f.withCredentials=!0),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){f&&(f.abort(),c(e),f=null)}),void 0===p&&(p=null),f.send(p)})}},function(e,t,n){"use strict";var o=n(35);e.exports=function(e,t,n,r,i){var a=new Error(e);return o(a,t,n,r,i)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function o(e){this.message=e}o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(9);t.UploadUI=o.UploadUI;var r=n(26);t.Upload=r.Upload;var i=n(3);t.UploadFileStatus=i.UploadFileStatus},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(18),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.mapListGroups=function(){var e=this.props,t=e.groupedFiles,n=e.navigationIndex,o=a(e,["groupedFiles","navigationIndex"]);return Object.keys(t).map(function(e,r){var a=t[e];return s.createElement(u.UploadListGroup,i({key:e,files:a,index:r,navigationIndex:n},o))})},t.prototype.render=function(){var e=l.classNames("k-upload-files","k-reset");return s.createElement("ul",{className:e},this.mapListGroups())},t}(s.Component);t.UploadList=c},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(2),l=n(3),u=n(19),c=n(20),p=n(7),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClick=function(){t.props.onClick.call(void 0,t.props.index)},t}return r(t,e),t.prototype.componentDidUpdate=function(){var e=this.props;e.navigationIndex===e.index&&this._element&&document.activeElement!==this._element&&this._element.focus()},t.prototype.render=function(){var e=this,t=this.props,n=t.files,o=t.async,r=t.disabled,d=t.navigationIndex,f=t.index,v=t.listItemUI,h=t.onCancel,m=t.onRemove,y=t.onRetry,g=n[0],b=g.status===l.UploadFileStatus.Uploaded||g.status===l.UploadFileStatus.Initial,_=s.classNames("k-file",p.default.filesHaveValidationErrors(n)?"k-file-invalid":"",g.status===l.UploadFileStatus.UploadFailed||g.status===l.UploadFileStatus.RemoveFailed?"k-file-error":"",g.status===l.UploadFileStatus.Uploading?"k-file-progress":"",b?"k-file-success":"",d===f?"k-state-focused":""),F={async:o,disabled:r,onCancel:h,onRemove:m,onRetry:y},S=v||(1===n.length?u.UploadListSingleItem:c.UploadListMultiItem);return a.createElement("li",{ref:function(t){return e._element=t},className:_,"data-uid":g.uid,tabIndex:-1,onClick:this.onClick},a.createElement(S,i({files:n},F)))},t}(a.Component);t.UploadListGroup=d},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(3),c=n(4),p=n(5),d=n(7),f=n(10),v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isProgressActive=function(){return t.props.files[0].status===u.UploadFileStatus.Uploading},t}return r(t,e),t.prototype.getFileExtension=function(e){return e.extension?e.extension.substring(1):""},t.prototype.getFileValidationMessage=function(e){var t="";if(e.validationErrors&&e.validationErrors.length>0){var n=c.provideLocalizationService(this),o="upload."+e.validationErrors[0];t=n.toLanguageString(o,p.messages[o])}return t},t.prototype.renderValidationError=function(e){return[s.createElement("span",{className:"k-file-invalid-extension-wrapper",key:"1"},s.createElement("span",{className:"k-file-invalid-icon"},"!"),s.createElement("span",{className:"k-file-state"})),s.createElement("span",{className:"k-file-name-size-wrapper",key:"2"},s.createElement("span",{className:"k-file-name k-file-name-invalid",title:e.name},e.name),s.createElement("span",{className:"k-file-validation-message"},this.getFileValidationMessage(e)))]},t.prototype.renderFileDetails=function(e){return[s.createElement("span",{className:"k-file-extension-wrapper",key:"1"},s.createElement("span",{className:"k-file-extension"},this.getFileExtension(e)),s.createElement("span",{className:"k-file-state"})),s.createElement("span",{className:"k-file-name-size-wrapper",key:"2"},s.createElement("span",{className:"k-file-name",title:e.name},e.name),s.createElement("span",{className:"k-file-size"},d.default.getTotalFilesSizeMessage([e])))]},t.prototype.render=function(){var e=this.props,t=e.files,n=a(e,["files"]),o=t[0],r=l.classNames("k-file-single");return s.createElement("div",{className:r},s.createElement("span",{className:"k-progress",style:{width:(o.progress||0)+"%",opacity:this.isProgressActive()?1:0,transition:"opacity .5s ease-in-out"}}),o.validationErrors&&o.validationErrors.length>0?this.renderValidationError(o):void 0,o.validationErrors&&0!==o.validationErrors.length?void 0:this.renderFileDetails(o),s.createElement(f.UploadListActionButton,i({uid:o.uid,status:o.status,progress:o.progress},n)))},t}(s.Component);t.UploadListSingleItem=v,c.registerForLocalization(v)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(3),c=n(7),p=n(4),d=n(5),f=n(10),v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mapFiles=function(){return t.props.files.map(function(e){return s.createElement("span",{key:e.name,className:t.fileNameClasses(e),title:e.name},e.name)})},t.fileNameClasses=function(e){return l.classNames("k-file-name",c.default.fileHasValidationErrors(e)?"k-file-name-invalid":"")},t.isProgressActive=function(){return t.props.files[0].status===u.UploadFileStatus.Uploading},t.progress=function(){var e=t.props.files,n=0;return e.forEach(function(e){n+=e.progress||0}),n/e.length},t}return r(t,e),t.prototype.render=function(){var e=this.props,t=e.files,n=a(e,["files"]),o=l.classNames("k-file-multiple"),r=c.default.filesHaveValidationErrors(t),u=p.provideLocalizationService(this),v=u.toLanguageString(d.total,d.messages[d.total]),h=u.toLanguageString(d.files,d.messages[d.files]),m=u.toLanguageString(d.invalidFiles,d.messages[d.invalidFiles]),y=this.progress();return s.createElement("div",{className:o},s.createElement("span",{className:"k-progress",style:{width:y+"%",opacity:this.isProgressActive()?1:0,transition:"opacity .5s ease-in-out"}}),r?s.createElement("span",{className:"k-multiple-files-invalid-extension-wrapper"},s.createElement("span",{className:"k-file-invalid-icon"},"!"),s.createElement("span",{className:"k-file-state"})):s.createElement("span",{className:"k-multiple-files-extension-wrapper"},s.createElement("span",{className:"k-file-state"})),s.createElement("span",{className:"k-file-name-size-wrapper"},this.mapFiles(),r?s.createElement("span",{className:"k-file-validation-message"},m):s.createElement("span",{className:"k-file-information"},v,": ",t.length," ",h,", ",c.default.getTotalFilesSizeMessage(t))),s.createElement(f.UploadListActionButton,i({uid:t[0].uid,status:t[0].status,progress:y},n)))},t}(s.Component);t.UploadListMultiItem=v,p.registerForLocalization(v)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(2),u=n(4),c=n(5),p=n(22),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClick=function(){t.props.onClick.call(void 0,t.props.addButtonIndex)},t}return r(t,e),t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.navigationIndex,o=t.addButtonIndex,r=t.notFocusedIndex;n!==e.navigationIndex&&e.navigationIndex!==r&&n===o&&this._element&&this._element.focus()},t.prototype.inputRef=function(){if(this._uploadInput)return this._uploadInput.inputRef()},t.prototype.render=function(){var e=this,t=this.props,n=t.navigationIndex,o=t.addButtonIndex,r=t.tabindex,d=a(t,["navigationIndex","addButtonIndex","tabindex"]),f=u.provideLocalizationService(this).toLanguageString(c.select,c.messages[c.select]),v=l.classNames("k-button","k-upload-button",n===o?"k-state-focused":"");return s.createElement("div",{ref:function(t){return e._element=t},role:"button",className:v,"aria-label":f,tabIndex:r,onClick:this.onClick},s.createElement(p.UploadInput,i({},d,{ref:function(t){return e._uploadInput=t}})),s.createElement("span",null,f))},t}(s.Component);t.UploadAddButton=d,u.registerForLocalization(d)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=/(chrome)[ \/]([\w.]+)/i,s=/(webkit)[ \/]([\w.]+)/i,l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputRef=function(){return t._input},t.onAdd=function(){var e=navigator.userAgent,n=t._input;n&&(t.props.onAdd&&n.files&&t.props.onAdd.call(void 0,n.files),!e.match(a)&&e.match(s)||(n.type="",n.type="file"))},t}return r(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.multiple,o=t.async,r=t.disabled,a=t.accept;return i.createElement("input",{ref:function(t){return e._input=t},autoComplete:"off",name:o.saveField,accept:a,type:"file",tabIndex:-1,multiple:n,disabled:r,onChange:this.onAdd})},t}(i.Component);t.UploadInput=l},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(4),l=n(5),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onClearClick=function(){t.props.disabled||t.props.onClear&&t.props.onClear.call(void 0)},t.onUploadClick=function(){t.props.disabled||(t.props.onClick.call(void 0,t.props.uploadButtonIndex),t.props.onUpload&&t.props.onUpload.call(void 0))},t}return r(t,e),t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.navigationIndex,o=t.clearButtonIndex,r=t.uploadButtonIndex;n!==e.navigationIndex&&(n===o&&this._clearElement&&this._clearElement.focus(),n===r&&this._uploadElement&&this._uploadElement.focus())},t.prototype.render=function(){var e=this,t=this.props,n=t.disabled,o=t.navigationIndex,r=t.clearButtonIndex,u=t.uploadButtonIndex,c=s.provideLocalizationService(this),p=a.classNames("k-action-buttons"),d=a.classNames("k-button","k-clear-selected",n?"k-state-disabled":"",o===r?"k-state-focused":""),f=a.classNames("k-button","k-primary","k-upload-selected",n?"k-state-disabled":"",o===u?"k-state-focused":"");return i.createElement("div",{className:p},i.createElement("button",{ref:function(t){return e._clearElement=t},type:"button",className:d,tabIndex:-1,onClick:this.onClearClick},c.toLanguageString(l.clearSelectedFiles,l.messages[l.clearSelectedFiles])),i.createElement("button",{ref:function(t){return e._uploadElement=t},type:"button",className:f,tabIndex:-1,onClick:this.onUploadClick},c.toLanguageString(l.uploadSelectedFiles,l.messages[l.uploadSelectedFiles])))},t}(i.Component);t.UploadActionButtons=u,s.registerForLocalization(u)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(3),l=n(4),u=n(5),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.render=function(){var e,t,n,o=this.props.fileGroup;Object.keys(o).forEach(function(r){o[r].forEach(function(o){o.status===s.UploadFileStatus.Uploading&&(e=!0),o.status===s.UploadFileStatus.Uploaded&&(t=!0),o.status===s.UploadFileStatus.UploadFailed&&(n=!0)})});var r=a.classNames("k-upload-status","k-upload-status-total"),c=a.classNames(e||n||!t?"":"k-i-checkmark",!e&&n?"k-i-exception":"",e?"k-i-loading":"","k-icon"),p="",d=l.provideLocalizationService(this);return e?p=d.toLanguageString(u.headerStatusUploading,u.messages[u.headerStatusUploading]):(t||n)&&(p=d.toLanguageString(u.headerStatusUploaded,u.messages[u.headerStatusUploaded])),i.createElement("div",{className:r},i.createElement("span",{className:c}),p)},t}(i.Component);t.UploadStatus=c,l.registerForLocalization(c)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(2),s=n(4),l=n(5),u=100,c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._documentActive=!1,t._elementActive=!1,t.onDocumentDragEnter=function(){if(!t.documentActive){t.documentActive=!0;t._documentInterval=setInterval(function(){t.isDragOver(t._lastDocumentDragOver)&&(t.documentActive=!1,clearInterval(t._documentInterval),t._documentInterval=null,t._lastDocumentDragOver=null)},u)}},t.onDocumentDragOver=function(){t._lastDocumentDragOver=new Date},t.onElementDragEnter=function(){if(!t.elementActive){t.elementActive=!0;t._elementInterval=setInterval(function(){t.isDragOver(t._lastElementDragOver)&&(t.elementActive=!1,clearInterval(t._elementInterval),t._elementInterval=null,t._lastElementDragOver=null)},u)}},t.onElementDragOver=function(e){e.preventDefault(),t._lastElementDragOver=new Date},t.onDrop=function(e){e.preventDefault();var n=e.dataTransfer.files;n.length>0&&!t.props.disabled&&t.props.onAdd&&t.props.onAdd.call(void 0,n)},t.isDragOver=function(e){return(new Date).getTime()-(e||new Date).getTime()>u},t}return r(t,e),Object.defineProperty(t.prototype,"documentActive",{get:function(){return this._documentActive},set:function(e){var t=this.documentActive;this._documentActive=e,e!==t&&this.forceUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elementActive",{get:function(){return this._elementActive},set:function(e){var t=this._elementActive;this._elementActive=e,e!==t&&this.setState({})},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){document.addEventListener("dragenter",this.onDocumentDragEnter),document.addEventListener("dragover",this.onDocumentDragOver)},t.prototype.componentWillUnmount=function(){document.removeEventListener("dragenter",this.onDocumentDragEnter),document.removeEventListener("dragover",this.onDocumentDragOver)},t.prototype.render=function(){var e=this.props,t=e.addButtonComponent,n=e.statusComponent,o=s.provideLocalizationService(this).toLanguageString(l.dropFilesHere,l.messages[l.dropFilesHere]),r=a.classNames("k-dropzone",this.documentActive?"k-dropzone-active":"",this.elementActive?"k-dropzone-hovered":"");return i.createElement("div",{className:r,onDrop:this.onDrop,onDragEnter:this.onElementDragEnter,onDragOver:this.onElementDragOver},t,i.createElement("div",{className:"k-dropzone-hint"},o),n)},t}(i.Component);t.UploadDropZone=c,s.registerForLocalization(c)},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),l=n(6),u=n(3),c=n(27),p=n(28),d=n(7),f=n(48),v=n(49),h=n(50),m=function(e){function t(t){var n=e.call(this,t)||this;return n._httpSubscriptions={},n.uploadFiles=function(e){var t=n.async;f.default.setFilesStatus(e,u.UploadFileStatus.Uploading),f.default.groupForEach(e,function(e,o){var r=v.default.cloneRequestHeaders(t.saveHeaders||{}),a={target:n,files:e,headers:r,additionalData:{}};n.props.onBeforeUpload&&n.props.onBeforeUpload.call(void 0,a);var s=v.default.populateUploadFormData(e,t.saveField,a.additionalData),l=v.default.populateRequestOptions(a.headers,n.async),u=p.default.CancelToken.source();n._httpSubscriptions[o]=u,p.default(i({method:t.saveMethod,url:t.saveUrl,data:s,cancelToken:u.token},l,{onUploadProgress:function(e){return n.onUploadProgress(e,o)}})).then(function(e){return n.onUploadSuccess(e,o)}).catch(function(e){return n.onUploadError(e,o)})})},n.removeFiles=function(e){var t=n.async;f.default.groupForEach(e,function(e,o){var r=v.default.cloneRequestHeaders(t.removeHeaders||{}),a={target:n,files:e,headers:r,additionalData:{}};n.props.onBeforeRemove&&n.props.onBeforeRemove.call(void 0,a);var s=e.map(function(e){return e.name}),l=v.default.populateRemoveFormData(s,t.removeField,a.additionalData),u=v.default.populateRequestOptions(a.headers,n.async);p.default(i({method:t.removeMethod,url:t.removeUrl,data:l},u)).then(function(e){return n.onRemoveSuccess(e,o)}).catch(function(e){return n.onRemoveError(e,o)})})},n.onUpload=function(){var e=n.fileStateCopy,t=f.default.groupFilesByUid(e),o=f.default.filesForUpload(t);if(n.uploadFiles(o),n.isControlled){if(n.props.onStatusChange){var r={target:n,newState:e,affectedFiles:f.default.flatFileGroup(o)};n.props.onStatusChange.call(void 0,r)}}else n.setState({files:e})},n.onAdd=function(e){var t,o=d.default.getAllFileInfo(e);if(o=d.default.assignGuidToFiles(o,n.async.batch),h.default.validateFiles(o,n.props.restrictions),t=n.props.multiple?n.fileStateCopy:[],f.default.addMany(o,t),n.async.autoUpload){var r=f.default.groupFilesByUid(t);n.uploadFiles(f.default.filesForUpload(r))}if(n.isControlled){if(n.props.onAdd){var i={target:n,newState:t,affectedFiles:o};n.props.onAdd.call(void 0,i)}}else n.setState({files:t})},n.onUploadProgress=function(e,t){var o=Math.round(100*e.loaded/e.total)||0,r=n.fileStateCopy,i=r.filter(function(e){return e.uid===t});if(i.length)if(i.forEach(function(e){e.progress=o}),n.isControlled){if(n.props.onProgress){var a={target:n,newState:r,affectedFiles:i};n.props.onProgress.call(void 0,a)}}else n.setState({files:r})},n.onUploadSuccess=function(e,t){var o=n.fileStateCopy,r=o.filter(function(e){return e.uid===t});if(r.forEach(function(e){e.status=u.UploadFileStatus.Uploaded}),delete n._httpSubscriptions[t],n.isControlled){if(n.props.onStatusChange){var i={target:n,newState:o,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onStatusChange.call(void 0,i)}}else n.setState({files:o})},n.onUploadError=function(e,t){var o=n.fileStateCopy,r=o.filter(function(e){return e.uid===t});if(r.forEach(function(e){e.status=u.UploadFileStatus.UploadFailed}),delete n._httpSubscriptions[t],r.length)if(n.isControlled){if(n.props.onStatusChange){var i={target:n,newState:o,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onStatusChange.call(void 0,i)}}else n.setState({files:o})},n.onRemove=function(e){var t,o=n.fileStateCopy,r=o.filter(function(t){return t.uid===e}),i=o.filter(function(t){return t.uid!==e});if([u.UploadFileStatus.Uploaded,u.UploadFileStatus.Initial,u.UploadFileStatus.RemoveFailed].indexOf(r[0].status)>-1){var a=((t={})[e]=r,t);if(f.default.setFilesStatus(a,u.UploadFileStatus.Removing),n.removeFiles(a),n.isControlled){if(n.props.onStatusChange){var s={target:n,newState:o,affectedFiles:r};n.props.onStatusChange.call(void 0,s)}}else n.setState({files:o})}else if(n.isControlled){if(n.props.onRemove){s={target:n,newState:i,affectedFiles:r};n.props.onRemove.call(void 0,s)}}else n.setState({files:i})},n.onRemoveSuccess=function(e,t){var o=n.fileStateCopy,r=o.filter(function(e){return e.uid===t}),i=o.filter(function(e){return e.uid!==t});if(n.isControlled){if(n.props.onRemove){var a={target:n,newState:i,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onRemove.call(void 0,a)}}else n.setState({files:i})},n.onRemoveError=function(e,t){var o=n.fileStateCopy,r=o.filter(function(e){return e.uid===t});if(r.forEach(function(e){e.status=u.UploadFileStatus.RemoveFailed}),n.isControlled){if(n.props.onStatusChange){var i={target:n,newState:o,affectedFiles:r,response:v.default.convertAxiosResponse(e)};n.props.onStatusChange.call(void 0,i)}}else n.setState({files:o})},n.onRetry=function(e){var t=n.fileStateCopy,o=f.default.groupFilesByUid(t.filter(function(t){return t.uid===e}));if(f.default.setFilesStatus(o,u.UploadFileStatus.Uploading),n.uploadFiles(o),n.isControlled){if(n.props.onStatusChange){var r={target:n,newState:t,affectedFiles:f.default.flatFileGroup(o)};n.props.onStatusChange.call(void 0,r)}}else n.setState({files:t})},n.onCancel=function(e){var t=n.fileStateCopy,o=t.filter(function(t){return t.uid!==e}),r=t.filter(function(t){return t.uid===e});if(n._httpSubscriptions[e]&&(n._httpSubscriptions[e].cancel(),delete n._httpSubscriptions[e]),n.isControlled){if(n.props.onRemove){var i={target:n,newState:o,affectedFiles:r};n.props.onRemove.call(void 0,i)}}else n.setState({files:o})},n.onClear=function(){if(n.files.length)if(Object.keys(n._httpSubscriptions).forEach(function(e){n._httpSubscriptions[e].cancel()}),n._httpSubscriptions={},n.isControlled){if(n.props.onRemove){var e={target:n,newState:[],affectedFiles:n.fileStateCopy};n.props.onRemove.call(void 0,e)}}else n.setState({files:[]})},n.state={files:t.defaultFiles||[]},n}return r(t,e),Object.defineProperty(t.prototype,"async",{get:function(){var e=this.props;return{autoUpload:e.autoUpload,batch:e.batch,removeField:e.removeField,removeHeaders:e.removeHeaders,removeMethod:e.removeMethod,removeUrl:e.removeUrl,responseType:e.responseType,saveField:e.saveField,saveHeaders:e.saveHeaders,saveMethod:e.saveMethod,saveUrl:e.saveUrl,withCredentials:e.withCredentials}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"files",{get:function(){return(this.isControlled?this.props.files:this.state.files)||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isControlled",{get:function(){return!this.props.defaultFiles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fileStateCopy",{get:function(){return this.isControlled?f.default.copyState(this.props.files):f.default.copyState(this.state.files)},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.showFileList,n=(e.onAdd,e.onRemove,e.autoUpload),o=a(e,["showFileList","onAdd","onRemove","autoUpload"]),r=f.default.groupFilesByUid(this.files),l=f.default.filesForUpload(r);return s.createElement(c.UploadNavigation,i({groupedFiles:r,showFileList:t&&!!Object.keys(r).length,showActionButtons:!n&&!!Object.keys(l).length,autoUpload:n,onAdd:this.onAdd,onRemove:this.onRemove,onClear:this.onClear,onUpload:this.onUpload,onRetry:this.onRetry,onCancel:this.onCancel},o))},t.defaultProps={autoUpload:!0,batch:!1,removeField:"fileNames",removeHeaders:{},removeMethod:"POST",removeUrl:"",responseType:"json",saveField:"files",saveHeaders:{},saveMethod:"POST",saveUrl:"",withCredentials:!0,restrictions:{allowedExtensions:[],maxFileSize:0,minFileSize:0},multiple:!0,showFileList:!0,disabled:!1,tabindex:0},t.propTypes={autoUpload:l.bool,batch:l.bool,withCredentials:l.bool,saveField:l.string,saveHeaders:l.object,saveMethod:l.string,saveUrl:l.string,responseType:l.oneOf(["arraybuffer","blob","json","text"]),removeField:l.string,removeHeaders:l.object,removeMethod:l.string,removeUrl:l.string,multiple:l.bool,disabled:l.bool,showFileList:l.bool,tabindex:l.number,accept:l.string,listItemUI:l.oneOfType([l.func,l.string,l.shape({render:l.func.isRequired})]),restrictions:l.shape({allowedExtensions:l.arrayOf(l.string),maxFileSize:l.number,minFileSize:l.number}),files:l.arrayOf(l.shape({uid:l.string,name:l.string,extension:l.string,size:l.number,validationErrors:l.arrayOf(l.string),status:l.oneOf([u.UploadFileStatus.Initial,u.UploadFileStatus.RemoveFailed,u.UploadFileStatus.Removing,u.UploadFileStatus.Selected,u.UploadFileStatus.UploadFailed,u.UploadFileStatus.Uploaded,u.UploadFileStatus.Uploading]),progress:l.number,getRawFile:l.func})),defaultFiles:l.arrayOf(l.shape({uid:l.string,name:l.string,extension:l.string,size:l.number,validationErrors:l.arrayOf(l.string),status:l.oneOf([u.UploadFileStatus.Initial,u.UploadFileStatus.RemoveFailed,u.UploadFileStatus.Removing,u.UploadFileStatus.Selected,u.UploadFileStatus.UploadFailed,u.UploadFileStatus.Uploaded,u.UploadFileStatus.Uploading]),progress:l.number,getRawFile:l.func}))},t}(s.Component);t.Upload=m},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s,l=n(0),u=n(9);!function(e){e[e.esc=27]="esc",e[e.tab=9]="tab",e[e.enter=13]="enter",e[e.space=32]="space",e[e.shift=16]="shift",e[e.delete=46]="delete",e[e.left=37]="left",e[e.up=38]="up",e[e.right=39]="right",e[e.down=40]="down"}(s=t.Keys||(t.Keys={}));var c=-2,p=-1,d=function(e){function t(t){var n=e.call(this,t)||this;return n.onKeyDown=function(e,t){var o=s[e.keyCode],r=n.navIndex,i=Object.keys(n.props.groupedFiles),a=i.length-1,l=n.props.autoUpload||0===i.length?a:a+1,u=a+1,d=u+1,f=r===c?p:r,v=r;switch(o){case"up":r>-1&&(v=f-1);break;case"down":r<l&&(v=f+1);break;case"left":t?r===u&&(v=f+1):r===d&&(v=f-1);break;case"right":t?r===d&&(v=f-1):r===u&&(v=f+1);break;case"enter":if(r===p||r===c)if(n._uploadUI)(h=n._uploadUI.inputRef())&&h.click();r>=0&&r<=a&&n.onRetry(i[r]);break;case"space":var h;if(r===p||r===c)if(n._uploadUI)(h=n._uploadUI.inputRef())&&h.click();break;case"tab":v=c;break;case"delete":r>=0&&r<=a&&(v=f-1,n.onRemove(i[r]));break;case"esc":r>=0&&r<=a&&(v=f-1,n.onCancel(i[r]))}n.navIndex=v},n.onCancel=function(e){n.props.onCancel&&n.props.onCancel.call(void 0,e)},n.onClear=function(){n.navIndex=p,n.props.onClear&&n.props.onClear.call(void 0)},n.onUpload=function(){n.navIndex=p,n.props.onUpload&&n.props.onUpload.call(void 0)},n.onRetry=function(e){n.props.onRetry&&n.props.onRetry.call(void 0,e)},n.onRemove=function(e){n.navIndex=n.navIndex>p?n.navIndex-1:p,n.props.onRemove&&n.props.onRemove.call(void 0,e)},n.onAdd=function(e){n.navIndex=p,n.props.onAdd&&n.props.onAdd.call(void 0,e)},n.onClick=function(e){n.navIndex=e},n._navIndex=c,n}return r(t,e),Object.defineProperty(t.prototype,"navIndex",{get:function(){return this._navIndex},set:function(e){var t=this.navIndex;this._navIndex=e,e!==t&&this.forceUpdate()},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(e){var t=Object.keys(e.groupedFiles).length,n=Object.keys(this.props.groupedFiles).length;t>n&&this.navIndex>p&&(this.navIndex=this.navIndex-(t-n))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onClear,t.onRemove,t.onRetry,t.onCancel,t.onUpload,t.onAdd,a(t,["onClear","onRemove","onRetry","onCancel","onUpload","onAdd"]));return l.createElement(u.UploadUI,i({ref:function(t){return e._uploadUI=t},onKeyDown:this.onKeyDown,navigationIndex:this.navIndex,notFocusedIndex:c,onAdd:this.onAdd,onClear:this.onClear,onUpload:this.onUpload,onRemove:this.onRemove,onRetry:this.onRetry,onCancel:this.onCancel,onClick:this.onClick},n))},t}(l.Component);t.UploadNavigation=d},function(e,t,n){e.exports=n(29)},function(e,t,n){"use strict";var o=n(1),r=n(11),i=n(31),a=n(8);function s(e){var t=new i(e),n=r(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var l=s(a);l.Axios=i,l.create=function(e){return s(o.merge(a,e))},l.Cancel=n(15),l.CancelToken=n(46),l.isCancel=n(14),l.all=function(e){return Promise.all(e)},l.spread=n(47),e.exports=l,e.exports.default=l},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} | ||
/*! | ||
@@ -8,2 +8,2 @@ * Determine if an object is a Buffer | ||
*/ | ||
e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,n){"use strict";var o=n(8),r=n(1),i=n(41),a=n(42);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e&&(e=r.merge({url:arguments[0]},arguments[1])),(e=r.merge(o,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},r.forEach(["delete","get","head","options"],function(e){s.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}}),r.forEach(["post","put","patch"],function(e){s.prototype[e]=function(t,n,o){return this.request(r.merge(o||{},{method:e,url:t,data:n}))}}),e.exports=s},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var l,u=[],c=!1,p=-1;function d(){c&&l&&(c=!1,l.length?u=l.concat(u):p=-1,u.length&&f())}function f(){if(!c){var e=s(d);c=!0;for(var t=u.length;t;){for(l=u,u=[];++p<t;)l&&l[p].run();p=-1,t=u.length}l=null,c=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new v(e,t)),1!==u.length||c||s(f)},v.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){"use strict";var o=n(1);e.exports=function(e,t){o.forEach(e,function(n,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[o])})}},function(e,t,n){"use strict";var o=n(13);e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(o("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,o,r){return e.config=t,n&&(e.code=n),e.request=o,e.response=r,e}},function(e,t,n){"use strict";var o=n(1);function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var a=[];o.forEach(t,function(e,t){null!=e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))}))}),i=a.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,n){"use strict";var o=n(1),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(o.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=o.trim(e.substr(0,i)).toLowerCase(),n=o.trim(e.substr(i+1)),t){if(a[t]&&r.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},function(e,t,n){"use strict";var o=n(1);e.exports=o.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var o=e;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=o.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(){this.message="String contains an invalid character"}r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,n,i=String(e),a="",s=0,l=o;i.charAt(0|s)||(l="=",s%1);a+=l.charAt(63&t>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new r;t=t<<8|n}return a}},function(e,t,n){"use strict";var o=n(1);e.exports=o.isStandardBrowserEnv()?{write:function(e,t,n,r,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),o.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),o.isString(r)&&s.push("path="+r),o.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var o=n(1);function r(){this.handlers=[]}r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";var o=n(1),r=n(43),i=n(14),a=n(8),s=n(44),l=n(45);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.baseURL&&!s(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=r(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return u(e),t.data=r(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=r(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var o=n(1);e.exports=function(e,t,n){return o.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var o=n(15);function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r(function(t){e=t}),cancel:e}},e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=function(e,t){t.push(e)},a=function(e){var t={};return e.forEach(function(e){t[e.uid]?t[e.uid].push(e):t[e.uid]=[e]}),t},s=function(e,t){Object.keys(e).forEach(function(n){t(e[n],n)})};t.default={copyState:function(e){return(e||[]).map(function(e){return o({},e)})},addMany:function(e,t){e.forEach(function(e){return i(e,t)})},add:i,groupFilesByUid:a,filesForUpload:function(e){var t={};return s(a(e),function(e,n){var o=!0;e.forEach(function(e){(e.status!==r.UploadFileStatus.Selected||e.validationErrors&&e.validationErrors.length>0)&&(o=!1)}),o&&(t[n]=e)}),t},setFilesStatus:function(e,t){s(e,function(e){e.forEach(function(e){e.status=t})})},flatFileGroup:function(e){var t=[];return s(e,function(e){t.push.apply(t,e)}),t},groupForEach:s}},function(e,t,n){"use strict";var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){Object.keys(t).forEach(function(n){e.append(n,t[n])})};t.default={populateClientFormData:i,populateUploadFormData:function(e,t,n){var o=new FormData;return i(o,n),e.forEach(function(e){o.append(t,e.getRawFile?e.getRawFile():"")}),o},populateRemoveFormData:function(e,t,n){var o=new FormData;return i(o,n),e.forEach(function(e){o.append(t,e)}),o},populateRequestOptions:function(e,t){return{headers:e,responseType:t.responseType,withCredentials:t.withCredentials}},cloneRequestHeaders:function(e){var t={};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t},convertAxiosResponse:function(e){var t=e.data,n=(e.config,r(e,["data","config"]));return o({response:t},n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){t.length>0&&t.indexOf((e.extension||"").toLowerCase())<0&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf("invalidFileExtension")<0&&e.validationErrors.push("invalidFileExtension"))},r=function(e,t,n){0!==t&&(e.size||0)<t&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf("invalidMinFileSize")<0&&e.validationErrors.push("invalidMinFileSize")),0!==n&&(e.size||0)>n&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf("invalidMaxFileSize")<0&&e.validationErrors.push("invalidMaxFileSize"))};t.default={validateFiles:function(e,t){var n,i=(t.allowedExtensions||[]).map(function(e){return("."===e.substring(0,1)?e:"."+e).toLowerCase()}),a=t.maxFileSize||0,s=t.minFileSize||0;for(n=0;n<e.length;n++)o(e[n],i),r(e[n],s,a)}}}])}); | ||
e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,n){"use strict";var o=n(8),r=n(1),i=n(41),a=n(42);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e&&(e=r.merge({url:arguments[0]},arguments[1])),(e=r.merge(o,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},r.forEach(["delete","get","head","options"],function(e){s.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}}),r.forEach(["post","put","patch"],function(e){s.prototype[e]=function(t,n,o){return this.request(r.merge(o||{},{method:e,url:t,data:n}))}}),e.exports=s},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var l,u=[],c=!1,p=-1;function d(){c&&l&&(c=!1,l.length?u=l.concat(u):p=-1,u.length&&f())}function f(){if(!c){var e=s(d);c=!0;for(var t=u.length;t;){for(l=u,u=[];++p<t;)l&&l[p].run();p=-1,t=u.length}l=null,c=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new v(e,t)),1!==u.length||c||s(f)},v.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t,n){"use strict";var o=n(1);e.exports=function(e,t){o.forEach(e,function(n,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[o])})}},function(e,t,n){"use strict";var o=n(13);e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(o("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,o,r){return e.config=t,n&&(e.code=n),e.request=o,e.response=r,e}},function(e,t,n){"use strict";var o=n(1);function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var a=[];o.forEach(t,function(e,t){null!=e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))}))}),i=a.join("&")}return i&&(e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,n){"use strict";var o=n(1),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(o.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=o.trim(e.substr(0,i)).toLowerCase(),n=o.trim(e.substr(i+1)),t){if(a[t]&&r.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},function(e,t,n){"use strict";var o=n(1);e.exports=o.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var o=e;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=o.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(){this.message="String contains an invalid character"}r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,n,i=String(e),a="",s=0,l=o;i.charAt(0|s)||(l="=",s%1);a+=l.charAt(63&t>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new r;t=t<<8|n}return a}},function(e,t,n){"use strict";var o=n(1);e.exports=o.isStandardBrowserEnv()?{write:function(e,t,n,r,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),o.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),o.isString(r)&&s.push("path="+r),o.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var o=n(1);function r(){this.handlers=[]}r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";var o=n(1),r=n(43),i=n(14),a=n(8),s=n(44),l=n(45);function u(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return u(e),e.baseURL&&!s(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=r(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return u(e),t.data=r(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=r(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var o=n(1);e.exports=function(e,t,n){return o.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var o=n(15);function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r(function(t){e=t}),cancel:e}},e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=function(e,t){t.push(e)},a=function(e,t){Object.keys(e).forEach(function(n){t(e[n],n)})};t.default={copyState:function(e){return(e||[]).map(function(e){return o({},e)})},addMany:function(e,t){e.forEach(function(e){return i(e,t)})},add:i,groupFilesByUid:function(e){var t={};return e.forEach(function(e){t[e.uid]?t[e.uid].push(e):t[e.uid]=[e]}),t},filesForUpload:function(e){var t={};return a(e,function(e,n){var o=!0;e.forEach(function(e){(e.status!==r.UploadFileStatus.Selected||e.validationErrors&&e.validationErrors.length>0)&&(o=!1)}),o&&(t[n]=e)}),t},setFilesStatus:function(e,t){a(e,function(e){e.forEach(function(e){e.status=t})})},flatFileGroup:function(e){var t=[];return a(e,function(e){t.push.apply(t,e)}),t},groupForEach:a}},function(e,t,n){"use strict";var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){Object.keys(t).forEach(function(n){e.append(n,t[n])})};t.default={populateClientFormData:i,populateUploadFormData:function(e,t,n){var o=new FormData;return i(o,n),e.forEach(function(e){o.append(t,e.getRawFile?e.getRawFile():"")}),o},populateRemoveFormData:function(e,t,n){var o=new FormData;return i(o,n),e.forEach(function(e){o.append(t,e)}),o},populateRequestOptions:function(e,t){return{headers:e,responseType:t.responseType,withCredentials:t.withCredentials}},cloneRequestHeaders:function(e){var t={};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t},convertAxiosResponse:function(e){var t=e.data,n=(e.config,r(e,["data","config"]));return o({response:t},n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){t.length>0&&t.indexOf((e.extension||"").toLowerCase())<0&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf("invalidFileExtension")<0&&e.validationErrors.push("invalidFileExtension"))},r=function(e,t,n){0!==t&&(e.size||0)<t&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf("invalidMinFileSize")<0&&e.validationErrors.push("invalidMinFileSize")),0!==n&&(e.size||0)>n&&(e.validationErrors=e.validationErrors||[],e.validationErrors.indexOf("invalidMaxFileSize")<0&&e.validationErrors.push("invalidMaxFileSize"))};t.default={validateFiles:function(e,t){var n,i=(t.allowedExtensions||[]).map(function(e){return("."===e.substring(0,1)?e:"."+e).toLowerCase()}),a=t.maxFileSize||0,s=t.minFileSize||0;for(n=0;n<e.length;n++)o(e[n],i),r(e[n],s,a)}}}])}); |
/** | ||
* Represents the Additional data send as key value pair. | ||
* Represents the additional data that is sent as key-value pair. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface UploadAdditionalData { |
import { UploadHttpHeaders } from './UploadHttpHeaders'; | ||
/** | ||
* Represents the Async properties of the Upload component. | ||
* Represents the async properties of the Upload component. | ||
*/ | ||
@@ -24,3 +24,3 @@ export interface UploadAsyncProps { | ||
* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which | ||
* contains the files submitted to `saveUrl`. The default value is `files`. | ||
* contains the files submitted to `saveUrl`. Defaults to `files`. | ||
*/ | ||
@@ -34,3 +34,3 @@ saveField?: string; | ||
* Sets the [`request method`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the upload request. | ||
* The default value is `POST`. | ||
* Defaults to `POST`. | ||
*/ | ||
@@ -42,3 +42,3 @@ saveMethod?: string; | ||
* the `saveField` property. | ||
* It contains the list of files to be uploaded. | ||
* It contains the list of files that will be uploaded. | ||
*/ | ||
@@ -49,4 +49,4 @@ saveUrl?: string; | ||
* of the server. | ||
* It is used to parse the response appropriately. | ||
* The default value is `json`. | ||
* Used to parse the response appropriately. | ||
* Defaults to `json`. | ||
*/ | ||
@@ -57,3 +57,3 @@ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; | ||
* which contains the list of file names that are submitted to `removeUrl`. | ||
* The default value is `fileNames`. | ||
* Defaults to `fileNames`. | ||
*/ | ||
@@ -67,3 +67,3 @@ removeField?: string; | ||
* Sets the [`request method`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the `remove` request. | ||
* The default value is `POST`. | ||
* Defaults to `POST`. | ||
*/ | ||
@@ -70,0 +70,0 @@ removeMethod?: string; |
/** | ||
* Represents the HttpHeaders as key value pair. | ||
* Represents the HttpHeaders as a key-value pair. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface UploadHttpHeaders { |
/** | ||
* Represents the Upload component reponse type. | ||
* Represents the response type of the Upload. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface UploadResponse { |
@@ -10,2 +10,3 @@ import { UploadUI, UploadUIProps } from './UploadUI'; | ||
import { UploadResponse } from './interfaces/UploadResponse'; | ||
export { UploadUI, UploadUIProps, UploadFileRestrictions, Upload, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders }; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
export { UploadUI, UploadUIProps, UploadFileRestrictions, Upload, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps }; |
@@ -11,2 +11,3 @@ import * as React from 'react'; | ||
import { AxiosResponse } from 'axios'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -22,15 +23,15 @@ * @hidden | ||
/** | ||
* The onBeforeUpload event. | ||
* The `onBeforeUpload` event. | ||
*/ | ||
export interface UploadOnBeforeUploadEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* Files to be sent with the request. | ||
* The files that will be sent with the request. | ||
*/ | ||
files: Array<UploadFileInfo>; | ||
/** | ||
* Headers to be sent with the request. Can be modified. | ||
* The headers that will be sent with the request. Can be modified. | ||
*/ | ||
headers: UploadHttpHeaders; | ||
/** | ||
* Additional data to be sent with the request. Can be modified. | ||
* The additional data that will be sent with the request. Can be modified. | ||
*/ | ||
@@ -40,15 +41,15 @@ additionalData: UploadAdditionalData; | ||
/** | ||
* The onBeforeRemove event. | ||
* The `onBeforeRemove` event. | ||
*/ | ||
export interface UploadOnBeforeRemoveEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* Files to be sent with the request. | ||
* The files that will be sent with the request. | ||
*/ | ||
files: Array<UploadFileInfo>; | ||
/** | ||
* Headers to be sent with the request. Can be modified. | ||
* The headers that will be sent with the request. Can be modified. | ||
*/ | ||
headers: UploadHttpHeaders; | ||
/** | ||
* Additional data to be sent with the request. Can be modified. | ||
* The additional data that will be sent with the request. Can be modified. | ||
*/ | ||
@@ -58,11 +59,11 @@ additionalData: UploadAdditionalData; | ||
/** | ||
* The onProgress event. | ||
* The `onProgress` event. | ||
*/ | ||
export interface UploadOnProgressEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The The list of affected files. | ||
*/ | ||
@@ -72,15 +73,15 @@ affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* The onRemove event. | ||
* The `onRemove` event. | ||
*/ | ||
export interface UploadOnRemoveEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The The list of affected files. | ||
*/ | ||
affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* Server response, if available. | ||
* The The server response, if available. | ||
*/ | ||
@@ -90,11 +91,11 @@ response?: UploadResponse; | ||
/** | ||
* The onAdd event. | ||
* The `onAdd` event. | ||
*/ | ||
export interface UploadOnAddEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The list of affected files. | ||
*/ | ||
@@ -104,15 +105,15 @@ affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* The onStatusChange event. | ||
* The `onStatusChange` event. | ||
*/ | ||
export interface UploadOnStatusChangeEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The list of affected files. | ||
*/ | ||
affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* Server response, if available. | ||
* The server response, if available. | ||
*/ | ||
@@ -122,7 +123,8 @@ response?: UploadResponse; | ||
/** | ||
* Represents the props of the KendoReact Upload component. | ||
* Represents the props of the [KendoReact Upload component]({% slug overview_upload %}). | ||
*/ | ||
export interface UploadProps extends UploadAsyncProps { | ||
/** | ||
* Enables the selection of multiple files. | ||
* Enables the selection of multiple files | ||
* ([see example]({% slug fileprocessing_upload %}#toc-upload-of-single-or-multiple-files)). | ||
* If set to `false`, only one file can be selected at a time. | ||
@@ -132,3 +134,3 @@ */ | ||
/** | ||
* Disables the Upload. The default value is `false`. | ||
* Disables the Upload ([see example]({% slug disabledstate_upload %})). Defaults to `false`. | ||
*/ | ||
@@ -150,35 +152,39 @@ disabled?: boolean; | ||
/** | ||
* Sets the restrictions for selected files. | ||
* Sets the restrictions for selected files ([see example]({% slug filerestrictions_upload %})). | ||
*/ | ||
restrictions?: UploadFileRestrictions; | ||
/** | ||
* The list of files showed in component used in controlled mode. | ||
* The list of files which are displayed when the Upload is in controlled mode ([see example]({% slug controleduncontroled_upload %})). | ||
*/ | ||
files?: Array<UploadFileInfo>; | ||
/** | ||
* The initial list of files when component is used in uncontrolled mode. | ||
* The initial list of files which are displayed when the Upload is in uncontrolled mode ([see example]({% slug controleduncontroled_upload %})). | ||
*/ | ||
defaultFiles?: Array<UploadFileInfo>; | ||
/** | ||
* Fires when new filed are selected for upload. | ||
* The component that will be rendered as a list item inside the Upload component. | ||
*/ | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
/** | ||
* Fires when new files are selected for upload. | ||
*/ | ||
onAdd?: (event: UploadOnAddEvent) => void; | ||
/** | ||
* Fires when files are beeng removed. Optionally can contain server response in case request is made. | ||
* Fires when files are removed. Optionally, if a request is made, can contain a server response. | ||
*/ | ||
onRemove?: (event: UploadOnRemoveEvent) => void; | ||
/** | ||
* Fires file status is changed. Optionally can contain server response in case request is made. | ||
* Fires when the status of the files is changed. Optionally, if a request is made, can contain server response. | ||
*/ | ||
onStatusChange?: (event: UploadOnStatusChangeEvent) => void; | ||
/** | ||
* Fires file upload progress is changed. | ||
* Fires when the progress of the file upload is changed. | ||
*/ | ||
onProgress?: (event: UploadOnProgressEvent) => void; | ||
/** | ||
* Fires before file upload request is made. Can be used to add additional data to the request. | ||
* Fires before a request for file upload is made. Can be used to add extra data to the request. | ||
*/ | ||
onBeforeUpload?: (event: UploadOnBeforeUploadEvent) => void; | ||
/** | ||
* Fires before file remove request is made. Can be used to add additional data to the request. | ||
* Fires before a request for file removal is made. Can be used to add extra data to the request. | ||
*/ | ||
@@ -219,2 +225,3 @@ onBeforeRemove?: (event: UploadOnBeforeRemoveEvent) => void; | ||
accept: PropTypes.Requireable<any>; | ||
listItemUI: PropTypes.Requireable<any>; | ||
restrictions: PropTypes.Requireable<any>; | ||
@@ -228,3 +235,3 @@ files: PropTypes.Requireable<any>; | ||
private readonly isControlled; | ||
private readonly stateCopy; | ||
private readonly fileStateCopy; | ||
constructor(props: UploadProps); | ||
@@ -231,0 +238,0 @@ /** |
@@ -98,4 +98,5 @@ var __extends = (this && this.__extends) || (function () { | ||
_this.onUpload = function () { | ||
var newState = _this.stateCopy; | ||
var filesForUpload = stateUtils.filesForUpload(newState); | ||
var newState = _this.fileStateCopy; | ||
var groupedFiles = stateUtils.groupFilesByUid(newState); | ||
var filesForUpload = stateUtils.filesForUpload(groupedFiles); | ||
_this.uploadFiles(filesForUpload); | ||
@@ -122,4 +123,4 @@ if (_this.isControlled) { | ||
_this.onAdd = function (files) { | ||
// Problem with removing rawFile is that there is no reliable way of preserving it internally | ||
// for example uid+filname - filename can be changed at any moment. | ||
// The problem when removing rawFile is that there is no reliable way of preserving it internally. | ||
// For example, uid + filename - the filename can be changed at any moment. | ||
var selectedFiles = utils.getAllFileInfo(files); | ||
@@ -133,7 +134,8 @@ var newState; | ||
else { | ||
newState = _this.stateCopy; | ||
newState = _this.fileStateCopy; | ||
} | ||
stateUtils.addMany(selectedFiles, newState); | ||
if (_this.async.autoUpload) { | ||
_this.uploadFiles(stateUtils.filesForUpload(newState)); | ||
var groupedFiles = stateUtils.groupFilesByUid(newState); | ||
_this.uploadFiles(stateUtils.filesForUpload(groupedFiles)); | ||
} | ||
@@ -161,4 +163,7 @@ if (_this.isControlled) { | ||
var percentComplete = Math.round(100 * event.loaded / event.total) || 0; | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesWithProgress = newState.filter(function (file) { return file.uid === uid; }); | ||
if (!filesWithProgress.length) { | ||
return; | ||
} | ||
filesWithProgress.forEach(function (file) { | ||
@@ -187,3 +192,3 @@ file.progress = percentComplete; | ||
_this.onUploadSuccess = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var successFiles = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -215,3 +220,3 @@ successFiles.forEach(function (file) { | ||
_this.onUploadError = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var failedFiles = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -222,2 +227,5 @@ failedFiles.forEach(function (file) { | ||
delete _this._httpSubscriptions[uid]; | ||
if (!failedFiles.length) { | ||
return; | ||
} | ||
if (_this.isControlled) { | ||
@@ -245,3 +253,3 @@ if (_this.props.onStatusChange) { | ||
var _a; | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesForRemove = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -298,3 +306,3 @@ var filesToKeep = newState.filter(function (file) { return file.uid !== uid; }); | ||
_this.onRemoveSuccess = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesForRemove = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -323,3 +331,3 @@ var filesToKeep = newState.filter(function (file) { return file.uid !== uid; }); | ||
_this.onRemoveError = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var failedFiles = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -350,3 +358,3 @@ failedFiles.forEach(function (file) { | ||
_this.onRetry = function (uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesForRetry = stateUtils.groupFilesByUid(newState.filter(function (file) { return file.uid === uid; })); | ||
@@ -375,3 +383,3 @@ stateUtils.setFilesStatus(filesForRetry, UploadFileStatus.Uploading); | ||
_this.onCancel = function (uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesToKeep = newState.filter(function (file) { return file.uid !== uid; }); | ||
@@ -415,3 +423,3 @@ var filesForRemove = newState.filter(function (file) { return file.uid === uid; }); | ||
newState: [], | ||
affectedFiles: _this.stateCopy | ||
affectedFiles: _this.fileStateCopy | ||
}; | ||
@@ -468,3 +476,3 @@ _this.props.onRemove.call(undefined, eventData); | ||
}); | ||
Object.defineProperty(Upload.prototype, "stateCopy", { | ||
Object.defineProperty(Upload.prototype, "fileStateCopy", { | ||
get: function () { | ||
@@ -487,4 +495,4 @@ if (this.isControlled) { | ||
var groupedFiles = stateUtils.groupFilesByUid(this.files); | ||
var groupsCount = Object.keys(groupedFiles).length; | ||
return (React.createElement(UploadNavigation, __assign({ groupedFiles: groupedFiles, showFileList: !!groupsCount && showFileList, showActionButtons: !!groupsCount && !autoUpload, autoUpload: autoUpload, onAdd: this.onAdd, onRemove: this.onRemove, onClear: this.onClear, onUpload: this.onUpload, onRetry: this.onRetry, onCancel: this.onCancel }, others))); | ||
var filesForUpload = stateUtils.filesForUpload(groupedFiles); | ||
return (React.createElement(UploadNavigation, __assign({ groupedFiles: groupedFiles, showFileList: showFileList && !!Object.keys(groupedFiles).length, showActionButtons: !autoUpload && !!Object.keys(filesForUpload).length, autoUpload: autoUpload, onAdd: this.onAdd, onRemove: this.onRemove, onClear: this.onClear, onUpload: this.onUpload, onRetry: this.onRetry, onCancel: this.onCancel }, others))); | ||
}; | ||
@@ -538,2 +546,7 @@ /** | ||
accept: PropTypes.string, | ||
listItemUI: PropTypes.oneOfType([ | ||
PropTypes.func, | ||
PropTypes.string, | ||
PropTypes.shape({ render: PropTypes.func.isRequired }) | ||
]), | ||
restrictions: PropTypes.shape({ | ||
@@ -540,0 +553,0 @@ allowedExtensions: PropTypes.arrayOf(PropTypes.string), |
import * as React from 'react'; | ||
import { GroupedFiles } from './interfaces/FileGroup'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -12,2 +13,3 @@ * @hidden | ||
navigationIndex?: number; | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
onCancel: (uid: string) => void; | ||
@@ -14,0 +16,0 @@ onRemove: (uid: string) => void; |
import * as React from 'react'; | ||
import { UploadFileInfo } from './interfaces/UploadFileInfo'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -12,2 +13,3 @@ * @hidden | ||
navigationIndex: number | undefined; | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
index: number; | ||
@@ -14,0 +16,0 @@ onCancel: (uid: string) => void; |
@@ -47,6 +47,6 @@ var __extends = (this && this.__extends) || (function () { | ||
var _this = this; | ||
var _a = this.props, files = _a.files, async = _a.async, disabled = _a.disabled, navigationIndex = _a.navigationIndex, index = _a.index, onCancel = _a.onCancel, onRemove = _a.onRemove, onRetry = _a.onRetry; | ||
var _a = this.props, files = _a.files, async = _a.async, disabled = _a.disabled, navigationIndex = _a.navigationIndex, index = _a.index, listItemUI = _a.listItemUI, onCancel = _a.onCancel, onRemove = _a.onRemove, onRetry = _a.onRetry; | ||
var firstFile = files[0]; | ||
var isFileSuccess = firstFile.status === UploadFileStatus.Uploaded || | ||
files[0].status === UploadFileStatus.Initial; | ||
firstFile.status === UploadFileStatus.Initial; | ||
var liClassName = classNames('k-file', utils.filesHaveValidationErrors(files) ? 'k-file-invalid' : '', firstFile.status === UploadFileStatus.UploadFailed || firstFile.status === UploadFileStatus.RemoveFailed ? | ||
@@ -61,5 +61,5 @@ 'k-file-error' : '', firstFile.status === UploadFileStatus.Uploading ? 'k-file-progress' : '', isFileSuccess ? 'k-file-success' : '', navigationIndex === index ? 'k-state-focused' : ''); | ||
}; | ||
return (React.createElement("li", { ref: function (ref) { return _this._element = ref; }, className: liClassName, "data-uid": firstFile.uid, tabIndex: -1, onClick: this.onClick }, files.length === 1 ? | ||
React.createElement(UploadListSingleItem, __assign({ file: firstFile }, itemOptions)) : | ||
React.createElement(UploadListMultiItem, __assign({ files: files }, itemOptions)))); | ||
var ItemComponent = listItemUI || (files.length === 1 ? UploadListSingleItem : UploadListMultiItem); | ||
return (React.createElement("li", { ref: function (ref) { return _this._element = ref; }, className: liClassName, "data-uid": firstFile.uid, tabIndex: -1, onClick: this.onClick }, | ||
React.createElement(ItemComponent, __assign({ files: files }, itemOptions)))); | ||
}; | ||
@@ -66,0 +66,0 @@ return UploadListGroup; |
import * as React from 'react'; | ||
import { UploadFileInfo } from './interfaces/UploadFileInfo'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
* @hidden | ||
*/ | ||
export interface UploadListMultiItemProps { | ||
files: Array<UploadFileInfo>; | ||
disabled: boolean; | ||
async: UploadAsyncProps; | ||
onCancel: (uid: string) => void; | ||
onRemove: (uid: string) => void; | ||
onRetry: (uid: string) => void; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class UploadListMultiItem extends React.Component<UploadListMultiItemProps, {}> { | ||
mapFiles(): JSX.Element[]; | ||
fileNameClasses(file: UploadFileInfo): string; | ||
isProgressActive(): boolean; | ||
progress(): number; | ||
export declare class UploadListMultiItem extends React.Component<UploadListItemProps, {}> { | ||
/** | ||
* @hidden | ||
*/ | ||
mapFiles: () => JSX.Element[]; | ||
/** | ||
* @hidden | ||
*/ | ||
fileNameClasses: (file: UploadFileInfo) => string; | ||
/** | ||
* @hidden | ||
*/ | ||
isProgressActive: () => boolean; | ||
/** | ||
* @hidden | ||
*/ | ||
progress: () => number; | ||
render(): JSX.Element; | ||
} |
@@ -41,25 +41,37 @@ var __extends = (this && this.__extends) || (function () { | ||
function UploadListMultiItem() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.mapFiles = function () { | ||
var files = _this.props.files; | ||
return files.map(function (file) { | ||
return React.createElement("span", { key: file.name, className: _this.fileNameClasses(file), title: file.name }, file.name); | ||
}); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.fileNameClasses = function (file) { | ||
return classNames('k-file-name', utils.fileHasValidationErrors(file) ? 'k-file-name-invalid' : ''); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.isProgressActive = function () { | ||
return (_this.props.files[0].status === UploadFileStatus.Uploading); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.progress = function () { | ||
var files = _this.props.files; | ||
var sum = 0; | ||
files.forEach(function (file) { | ||
sum += file.progress || 0; | ||
}); | ||
return sum / files.length; | ||
}; | ||
return _this; | ||
} | ||
UploadListMultiItem.prototype.mapFiles = function () { | ||
var _this = this; | ||
var files = this.props.files; | ||
return files.map(function (file) { | ||
return React.createElement("span", { key: file.name, className: _this.fileNameClasses(file), title: file.name }, file.name); | ||
}); | ||
}; | ||
UploadListMultiItem.prototype.fileNameClasses = function (file) { | ||
return classNames('k-file-name', utils.fileHasValidationErrors(file) ? 'k-file-name-invalid' : ''); | ||
}; | ||
UploadListMultiItem.prototype.isProgressActive = function () { | ||
return (this.props.files[0].status === UploadFileStatus.Uploading); | ||
}; | ||
UploadListMultiItem.prototype.progress = function () { | ||
var files = this.props.files; | ||
var sum = 0; | ||
files.forEach(function (file) { | ||
sum += file.progress || 0; | ||
}); | ||
return sum / files.length; | ||
}; | ||
UploadListMultiItem.prototype.render = function () { | ||
@@ -66,0 +78,0 @@ var _a = this.props, files = _a.files, others = __rest(_a, ["files"]); |
import * as React from 'react'; | ||
import { UploadFileInfo } from './interfaces/UploadFileInfo'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
* @hidden | ||
*/ | ||
export interface UploadListSingleItemProps { | ||
file: UploadFileInfo; | ||
disabled: boolean; | ||
async: UploadAsyncProps; | ||
onCancel: (uid: string) => void; | ||
onRemove: (uid: string) => void; | ||
onRetry: (uid: string) => void; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class UploadListSingleItem extends React.Component<UploadListSingleItemProps, {}> { | ||
export declare class UploadListSingleItem extends React.Component<UploadListItemProps, {}> { | ||
/** | ||
@@ -38,3 +27,3 @@ * @hidden | ||
*/ | ||
isProgressActive(): boolean; | ||
isProgressActive: () => boolean; | ||
/** | ||
@@ -41,0 +30,0 @@ * @hidden |
@@ -41,3 +41,10 @@ var __extends = (this && this.__extends) || (function () { | ||
function UploadListSingleItem() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.isProgressActive = function () { | ||
return (_this.props.files[0].status === UploadFileStatus.Uploading); | ||
}; | ||
return _this; | ||
} | ||
@@ -91,10 +98,5 @@ /** | ||
*/ | ||
UploadListSingleItem.prototype.isProgressActive = function () { | ||
return (this.props.file.status === UploadFileStatus.Uploading); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
UploadListSingleItem.prototype.render = function () { | ||
var _a = this.props, file = _a.file, others = __rest(_a, ["file"]); | ||
var _a = this.props, files = _a.files, others = __rest(_a, ["files"]); | ||
var file = files[0]; | ||
var itemClassName = classNames('k-file-single'); | ||
@@ -101,0 +103,0 @@ return (React.createElement("div", { className: itemClassName }, |
@@ -30,2 +30,3 @@ import * as React from 'react'; | ||
onClear: () => void; | ||
onUpload: () => void; | ||
onRetry: (uid: string) => void; | ||
@@ -32,0 +33,0 @@ onRemove: (uid: string) => void; |
@@ -159,2 +159,8 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
_this.onUpload = function () { | ||
_this.navIndex = DEFAULT_INDEX; | ||
if (_this.props.onUpload) { | ||
_this.props.onUpload.call(undefined); | ||
} | ||
}; | ||
_this.onRetry = function (uid) { | ||
@@ -206,4 +212,4 @@ if (_this.props.onRetry) { | ||
var _this = this; | ||
var _a = this.props, onClear = _a.onClear, onRemove = _a.onRemove, onRetry = _a.onRetry, onCancel = _a.onCancel, onAdd = _a.onAdd, others = __rest(_a, ["onClear", "onRemove", "onRetry", "onCancel", "onAdd"]); | ||
return (React.createElement(UploadUI, __assign({ ref: function (ref) { return _this._uploadUI = ref; }, onKeyDown: this.onKeyDown, navigationIndex: this.navIndex, notFocusedIndex: NOT_FOCUSED_INDEX, onAdd: this.onAdd, onClear: this.onClear, onRemove: this.onRemove, onRetry: this.onRetry, onCancel: this.onCancel, onClick: this.onClick }, others))); | ||
var _a = this.props, onClear = _a.onClear, onRemove = _a.onRemove, onRetry = _a.onRetry, onCancel = _a.onCancel, onUpload = _a.onUpload, onAdd = _a.onAdd, others = __rest(_a, ["onClear", "onRemove", "onRetry", "onCancel", "onUpload", "onAdd"]); | ||
return (React.createElement(UploadUI, __assign({ ref: function (ref) { return _this._uploadUI = ref; }, onKeyDown: this.onKeyDown, navigationIndex: this.navIndex, notFocusedIndex: NOT_FOCUSED_INDEX, onAdd: this.onAdd, onClear: this.onClear, onUpload: this.onUpload, onRemove: this.onRemove, onRetry: this.onRetry, onCancel: this.onCancel, onClick: this.onClick }, others))); | ||
}; | ||
@@ -210,0 +216,0 @@ return UploadNavigation; |
import * as React from 'react'; | ||
import { GroupedFiles } from './interfaces/FileGroup'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -17,2 +18,3 @@ * @hidden | ||
notFocusedIndex?: number; | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
onAdd?: (files: FileList) => void; | ||
@@ -19,0 +21,0 @@ onCancel?: (uid: string) => void; |
@@ -160,3 +160,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var _this = this; | ||
var _a = this.props, multiple = _a.multiple, disabled = _a.disabled, tabindex = _a.tabindex, accept = _a.accept, showFileList = _a.showFileList, groupedFiles = _a.groupedFiles, navigationIndex = _a.navigationIndex, showActionButtons = _a.showActionButtons, notFocusedIndex = _a.notFocusedIndex; | ||
var _a = this.props, multiple = _a.multiple, disabled = _a.disabled, tabindex = _a.tabindex, accept = _a.accept, showFileList = _a.showFileList, groupedFiles = _a.groupedFiles, navigationIndex = _a.navigationIndex, showActionButtons = _a.showActionButtons, notFocusedIndex = _a.notFocusedIndex, listItemUI = _a.listItemUI; | ||
var className = classNames('k-widget', 'k-upload', 'k-header', disabled ? 'k-state-disabled' : ''); | ||
@@ -168,3 +168,3 @@ var statusComponent = React.createElement(UploadStatus, { fileGroup: groupedFiles }); | ||
showFileList ? | ||
React.createElement(UploadList, { groupedFiles: groupedFiles, disabled: disabled, async: this.async, navigationIndex: navigationIndex, onCancel: this.onCancel, onRemove: this.onRemove, onRetry: this.onRetry, onClick: this.onClick }) : undefined, | ||
React.createElement(UploadList, { groupedFiles: groupedFiles, disabled: disabled, async: this.async, navigationIndex: navigationIndex, listItemUI: listItemUI, onCancel: this.onCancel, onRemove: this.onRemove, onRetry: this.onRetry, onClick: this.onClick }) : undefined, | ||
showActionButtons ? | ||
@@ -171,0 +171,0 @@ React.createElement(UploadActionButtons, { disabled: disabled, navigationIndex: navigationIndex, clearButtonIndex: this.clearButtonIndex, uploadButtonIndex: this.uploadButtonIndex, onUpload: this.onUpload, onClear: this.onClear, onClick: this.onClick }) : undefined)); |
@@ -18,3 +18,3 @@ import { UploadFileInfo } from '../interfaces/UploadFileInfo'; | ||
groupFilesByUid: (files: UploadFileInfo[]) => GroupedFiles; | ||
filesForUpload: (files: UploadFileInfo[]) => GroupedFiles; | ||
filesForUpload: (files: GroupedFiles) => GroupedFiles; | ||
setFilesStatus: (filesGroup: GroupedFiles, status: UploadFileStatus) => void; | ||
@@ -21,0 +21,0 @@ flatFileGroup: (fileGroup: GroupedFiles) => UploadFileInfo[]; |
@@ -35,3 +35,3 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
var notUploadedGroups = {}; | ||
groupForEach(groupFilesByUid(files), function (currentFiles, uid) { | ||
groupForEach(files, function (currentFiles, uid) { | ||
var currentFilesValid = true; | ||
@@ -38,0 +38,0 @@ currentFiles.forEach(function (file) { |
/** | ||
* Represents the Additional data send as key value pair. | ||
* Represents the additional data that is sent as key-value pair. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface UploadAdditionalData { |
import { UploadHttpHeaders } from './UploadHttpHeaders'; | ||
/** | ||
* Represents the Async properties of the Upload component. | ||
* Represents the async properties of the Upload component. | ||
*/ | ||
@@ -24,3 +24,3 @@ export interface UploadAsyncProps { | ||
* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key which | ||
* contains the files submitted to `saveUrl`. The default value is `files`. | ||
* contains the files submitted to `saveUrl`. Defaults to `files`. | ||
*/ | ||
@@ -34,3 +34,3 @@ saveField?: string; | ||
* Sets the [`request method`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the upload request. | ||
* The default value is `POST`. | ||
* Defaults to `POST`. | ||
*/ | ||
@@ -42,3 +42,3 @@ saveMethod?: string; | ||
* the `saveField` property. | ||
* It contains the list of files to be uploaded. | ||
* It contains the list of files that will be uploaded. | ||
*/ | ||
@@ -49,4 +49,4 @@ saveUrl?: string; | ||
* of the server. | ||
* It is used to parse the response appropriately. | ||
* The default value is `json`. | ||
* Used to parse the response appropriately. | ||
* Defaults to `json`. | ||
*/ | ||
@@ -57,3 +57,3 @@ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; | ||
* which contains the list of file names that are submitted to `removeUrl`. | ||
* The default value is `fileNames`. | ||
* Defaults to `fileNames`. | ||
*/ | ||
@@ -67,3 +67,3 @@ removeField?: string; | ||
* Sets the [`request method`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) of the `remove` request. | ||
* The default value is `POST`. | ||
* Defaults to `POST`. | ||
*/ | ||
@@ -70,0 +70,0 @@ removeMethod?: string; |
/** | ||
* Represents the HttpHeaders as key value pair. | ||
* Represents the HttpHeaders as a key-value pair. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface UploadHttpHeaders { |
/** | ||
* Represents the Upload component reponse type. | ||
* Represents the response type of the Upload. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface UploadResponse { |
@@ -10,2 +10,3 @@ import { UploadUI, UploadUIProps } from './UploadUI'; | ||
import { UploadResponse } from './interfaces/UploadResponse'; | ||
export { UploadUI, UploadUIProps, UploadFileRestrictions, Upload, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders }; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
export { UploadUI, UploadUIProps, UploadFileRestrictions, Upload, UploadProps, UploadOnAddEvent, UploadOnBeforeRemoveEvent, UploadOnBeforeUploadEvent, UploadOnProgressEvent, UploadOnRemoveEvent, UploadOnStatusChangeEvent, UploadResponse, UploadFileStatus, UploadAdditionalData, UploadAsyncProps, UploadFileInfo, UploadHttpHeaders, UploadListItemProps }; |
@@ -11,2 +11,3 @@ import * as React from 'react'; | ||
import { AxiosResponse } from 'axios'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -22,15 +23,15 @@ * @hidden | ||
/** | ||
* The onBeforeUpload event. | ||
* The `onBeforeUpload` event. | ||
*/ | ||
export interface UploadOnBeforeUploadEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* Files to be sent with the request. | ||
* The files that will be sent with the request. | ||
*/ | ||
files: Array<UploadFileInfo>; | ||
/** | ||
* Headers to be sent with the request. Can be modified. | ||
* The headers that will be sent with the request. Can be modified. | ||
*/ | ||
headers: UploadHttpHeaders; | ||
/** | ||
* Additional data to be sent with the request. Can be modified. | ||
* The additional data that will be sent with the request. Can be modified. | ||
*/ | ||
@@ -40,15 +41,15 @@ additionalData: UploadAdditionalData; | ||
/** | ||
* The onBeforeRemove event. | ||
* The `onBeforeRemove` event. | ||
*/ | ||
export interface UploadOnBeforeRemoveEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* Files to be sent with the request. | ||
* The files that will be sent with the request. | ||
*/ | ||
files: Array<UploadFileInfo>; | ||
/** | ||
* Headers to be sent with the request. Can be modified. | ||
* The headers that will be sent with the request. Can be modified. | ||
*/ | ||
headers: UploadHttpHeaders; | ||
/** | ||
* Additional data to be sent with the request. Can be modified. | ||
* The additional data that will be sent with the request. Can be modified. | ||
*/ | ||
@@ -58,11 +59,11 @@ additionalData: UploadAdditionalData; | ||
/** | ||
* The onProgress event. | ||
* The `onProgress` event. | ||
*/ | ||
export interface UploadOnProgressEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The The list of affected files. | ||
*/ | ||
@@ -72,15 +73,15 @@ affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* The onRemove event. | ||
* The `onRemove` event. | ||
*/ | ||
export interface UploadOnRemoveEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The The list of affected files. | ||
*/ | ||
affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* Server response, if available. | ||
* The The server response, if available. | ||
*/ | ||
@@ -90,11 +91,11 @@ response?: UploadResponse; | ||
/** | ||
* The onAdd event. | ||
* The `onAdd` event. | ||
*/ | ||
export interface UploadOnAddEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The list of affected files. | ||
*/ | ||
@@ -104,15 +105,15 @@ affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* The onStatusChange event. | ||
* The `onStatusChange` event. | ||
*/ | ||
export interface UploadOnStatusChangeEvent extends BaseUploadEvent<Upload> { | ||
/** | ||
* New updated state candidate. | ||
* The new updated state candidate. | ||
*/ | ||
newState: Array<UploadFileInfo>; | ||
/** | ||
* List of affected files. | ||
* The list of affected files. | ||
*/ | ||
affectedFiles: Array<UploadFileInfo>; | ||
/** | ||
* Server response, if available. | ||
* The server response, if available. | ||
*/ | ||
@@ -122,7 +123,8 @@ response?: UploadResponse; | ||
/** | ||
* Represents the props of the KendoReact Upload component. | ||
* Represents the props of the [KendoReact Upload component]({% slug overview_upload %}). | ||
*/ | ||
export interface UploadProps extends UploadAsyncProps { | ||
/** | ||
* Enables the selection of multiple files. | ||
* Enables the selection of multiple files | ||
* ([see example]({% slug fileprocessing_upload %}#toc-upload-of-single-or-multiple-files)). | ||
* If set to `false`, only one file can be selected at a time. | ||
@@ -132,3 +134,3 @@ */ | ||
/** | ||
* Disables the Upload. The default value is `false`. | ||
* Disables the Upload ([see example]({% slug disabledstate_upload %})). Defaults to `false`. | ||
*/ | ||
@@ -150,35 +152,39 @@ disabled?: boolean; | ||
/** | ||
* Sets the restrictions for selected files. | ||
* Sets the restrictions for selected files ([see example]({% slug filerestrictions_upload %})). | ||
*/ | ||
restrictions?: UploadFileRestrictions; | ||
/** | ||
* The list of files showed in component used in controlled mode. | ||
* The list of files which are displayed when the Upload is in controlled mode ([see example]({% slug controleduncontroled_upload %})). | ||
*/ | ||
files?: Array<UploadFileInfo>; | ||
/** | ||
* The initial list of files when component is used in uncontrolled mode. | ||
* The initial list of files which are displayed when the Upload is in uncontrolled mode ([see example]({% slug controleduncontroled_upload %})). | ||
*/ | ||
defaultFiles?: Array<UploadFileInfo>; | ||
/** | ||
* Fires when new filed are selected for upload. | ||
* The component that will be rendered as a list item inside the Upload component. | ||
*/ | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
/** | ||
* Fires when new files are selected for upload. | ||
*/ | ||
onAdd?: (event: UploadOnAddEvent) => void; | ||
/** | ||
* Fires when files are beeng removed. Optionally can contain server response in case request is made. | ||
* Fires when files are removed. Optionally, if a request is made, can contain a server response. | ||
*/ | ||
onRemove?: (event: UploadOnRemoveEvent) => void; | ||
/** | ||
* Fires file status is changed. Optionally can contain server response in case request is made. | ||
* Fires when the status of the files is changed. Optionally, if a request is made, can contain server response. | ||
*/ | ||
onStatusChange?: (event: UploadOnStatusChangeEvent) => void; | ||
/** | ||
* Fires file upload progress is changed. | ||
* Fires when the progress of the file upload is changed. | ||
*/ | ||
onProgress?: (event: UploadOnProgressEvent) => void; | ||
/** | ||
* Fires before file upload request is made. Can be used to add additional data to the request. | ||
* Fires before a request for file upload is made. Can be used to add extra data to the request. | ||
*/ | ||
onBeforeUpload?: (event: UploadOnBeforeUploadEvent) => void; | ||
/** | ||
* Fires before file remove request is made. Can be used to add additional data to the request. | ||
* Fires before a request for file removal is made. Can be used to add extra data to the request. | ||
*/ | ||
@@ -219,2 +225,3 @@ onBeforeRemove?: (event: UploadOnBeforeRemoveEvent) => void; | ||
accept: PropTypes.Requireable<any>; | ||
listItemUI: PropTypes.Requireable<any>; | ||
restrictions: PropTypes.Requireable<any>; | ||
@@ -228,3 +235,3 @@ files: PropTypes.Requireable<any>; | ||
private readonly isControlled; | ||
private readonly stateCopy; | ||
private readonly fileStateCopy; | ||
constructor(props: UploadProps); | ||
@@ -231,0 +238,0 @@ /** |
@@ -100,4 +100,5 @@ "use strict"; | ||
_this.onUpload = function () { | ||
var newState = _this.stateCopy; | ||
var filesForUpload = stateUtils_1.default.filesForUpload(newState); | ||
var newState = _this.fileStateCopy; | ||
var groupedFiles = stateUtils_1.default.groupFilesByUid(newState); | ||
var filesForUpload = stateUtils_1.default.filesForUpload(groupedFiles); | ||
_this.uploadFiles(filesForUpload); | ||
@@ -124,4 +125,4 @@ if (_this.isControlled) { | ||
_this.onAdd = function (files) { | ||
// Problem with removing rawFile is that there is no reliable way of preserving it internally | ||
// for example uid+filname - filename can be changed at any moment. | ||
// The problem when removing rawFile is that there is no reliable way of preserving it internally. | ||
// For example, uid + filename - the filename can be changed at any moment. | ||
var selectedFiles = utils_1.default.getAllFileInfo(files); | ||
@@ -135,7 +136,8 @@ var newState; | ||
else { | ||
newState = _this.stateCopy; | ||
newState = _this.fileStateCopy; | ||
} | ||
stateUtils_1.default.addMany(selectedFiles, newState); | ||
if (_this.async.autoUpload) { | ||
_this.uploadFiles(stateUtils_1.default.filesForUpload(newState)); | ||
var groupedFiles = stateUtils_1.default.groupFilesByUid(newState); | ||
_this.uploadFiles(stateUtils_1.default.filesForUpload(groupedFiles)); | ||
} | ||
@@ -163,4 +165,7 @@ if (_this.isControlled) { | ||
var percentComplete = Math.round(100 * event.loaded / event.total) || 0; | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesWithProgress = newState.filter(function (file) { return file.uid === uid; }); | ||
if (!filesWithProgress.length) { | ||
return; | ||
} | ||
filesWithProgress.forEach(function (file) { | ||
@@ -189,3 +194,3 @@ file.progress = percentComplete; | ||
_this.onUploadSuccess = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var successFiles = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -217,3 +222,3 @@ successFiles.forEach(function (file) { | ||
_this.onUploadError = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var failedFiles = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -224,2 +229,5 @@ failedFiles.forEach(function (file) { | ||
delete _this._httpSubscriptions[uid]; | ||
if (!failedFiles.length) { | ||
return; | ||
} | ||
if (_this.isControlled) { | ||
@@ -247,3 +255,3 @@ if (_this.props.onStatusChange) { | ||
var _a; | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesForRemove = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -300,3 +308,3 @@ var filesToKeep = newState.filter(function (file) { return file.uid !== uid; }); | ||
_this.onRemoveSuccess = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesForRemove = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -325,3 +333,3 @@ var filesToKeep = newState.filter(function (file) { return file.uid !== uid; }); | ||
_this.onRemoveError = function (event, uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var failedFiles = newState.filter(function (file) { return file.uid === uid; }); | ||
@@ -352,3 +360,3 @@ failedFiles.forEach(function (file) { | ||
_this.onRetry = function (uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesForRetry = stateUtils_1.default.groupFilesByUid(newState.filter(function (file) { return file.uid === uid; })); | ||
@@ -377,3 +385,3 @@ stateUtils_1.default.setFilesStatus(filesForRetry, UploadFileStatus_1.UploadFileStatus.Uploading); | ||
_this.onCancel = function (uid) { | ||
var newState = _this.stateCopy; | ||
var newState = _this.fileStateCopy; | ||
var filesToKeep = newState.filter(function (file) { return file.uid !== uid; }); | ||
@@ -417,3 +425,3 @@ var filesForRemove = newState.filter(function (file) { return file.uid === uid; }); | ||
newState: [], | ||
affectedFiles: _this.stateCopy | ||
affectedFiles: _this.fileStateCopy | ||
}; | ||
@@ -470,3 +478,3 @@ _this.props.onRemove.call(undefined, eventData); | ||
}); | ||
Object.defineProperty(Upload.prototype, "stateCopy", { | ||
Object.defineProperty(Upload.prototype, "fileStateCopy", { | ||
get: function () { | ||
@@ -489,4 +497,4 @@ if (this.isControlled) { | ||
var groupedFiles = stateUtils_1.default.groupFilesByUid(this.files); | ||
var groupsCount = Object.keys(groupedFiles).length; | ||
return (React.createElement(UploadNavigation_1.UploadNavigation, __assign({ groupedFiles: groupedFiles, showFileList: !!groupsCount && showFileList, showActionButtons: !!groupsCount && !autoUpload, autoUpload: autoUpload, onAdd: this.onAdd, onRemove: this.onRemove, onClear: this.onClear, onUpload: this.onUpload, onRetry: this.onRetry, onCancel: this.onCancel }, others))); | ||
var filesForUpload = stateUtils_1.default.filesForUpload(groupedFiles); | ||
return (React.createElement(UploadNavigation_1.UploadNavigation, __assign({ groupedFiles: groupedFiles, showFileList: showFileList && !!Object.keys(groupedFiles).length, showActionButtons: !autoUpload && !!Object.keys(filesForUpload).length, autoUpload: autoUpload, onAdd: this.onAdd, onRemove: this.onRemove, onClear: this.onClear, onUpload: this.onUpload, onRetry: this.onRetry, onCancel: this.onCancel }, others))); | ||
}; | ||
@@ -540,2 +548,7 @@ /** | ||
accept: PropTypes.string, | ||
listItemUI: PropTypes.oneOfType([ | ||
PropTypes.func, | ||
PropTypes.string, | ||
PropTypes.shape({ render: PropTypes.func.isRequired }) | ||
]), | ||
restrictions: PropTypes.shape({ | ||
@@ -542,0 +555,0 @@ allowedExtensions: PropTypes.arrayOf(PropTypes.string), |
import * as React from 'react'; | ||
import { GroupedFiles } from './interfaces/FileGroup'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -12,2 +13,3 @@ * @hidden | ||
navigationIndex?: number; | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
onCancel: (uid: string) => void; | ||
@@ -14,0 +16,0 @@ onRemove: (uid: string) => void; |
import * as React from 'react'; | ||
import { UploadFileInfo } from './interfaces/UploadFileInfo'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -12,2 +13,3 @@ * @hidden | ||
navigationIndex: number | undefined; | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
index: number; | ||
@@ -14,0 +16,0 @@ onCancel: (uid: string) => void; |
@@ -49,6 +49,6 @@ "use strict"; | ||
var _this = this; | ||
var _a = this.props, files = _a.files, async = _a.async, disabled = _a.disabled, navigationIndex = _a.navigationIndex, index = _a.index, onCancel = _a.onCancel, onRemove = _a.onRemove, onRetry = _a.onRetry; | ||
var _a = this.props, files = _a.files, async = _a.async, disabled = _a.disabled, navigationIndex = _a.navigationIndex, index = _a.index, listItemUI = _a.listItemUI, onCancel = _a.onCancel, onRemove = _a.onRemove, onRetry = _a.onRetry; | ||
var firstFile = files[0]; | ||
var isFileSuccess = firstFile.status === UploadFileStatus_1.UploadFileStatus.Uploaded || | ||
files[0].status === UploadFileStatus_1.UploadFileStatus.Initial; | ||
firstFile.status === UploadFileStatus_1.UploadFileStatus.Initial; | ||
var liClassName = kendo_react_common_1.classNames('k-file', utils_1.default.filesHaveValidationErrors(files) ? 'k-file-invalid' : '', firstFile.status === UploadFileStatus_1.UploadFileStatus.UploadFailed || firstFile.status === UploadFileStatus_1.UploadFileStatus.RemoveFailed ? | ||
@@ -63,5 +63,5 @@ 'k-file-error' : '', firstFile.status === UploadFileStatus_1.UploadFileStatus.Uploading ? 'k-file-progress' : '', isFileSuccess ? 'k-file-success' : '', navigationIndex === index ? 'k-state-focused' : ''); | ||
}; | ||
return (React.createElement("li", { ref: function (ref) { return _this._element = ref; }, className: liClassName, "data-uid": firstFile.uid, tabIndex: -1, onClick: this.onClick }, files.length === 1 ? | ||
React.createElement(UploadListSingleItem_1.UploadListSingleItem, __assign({ file: firstFile }, itemOptions)) : | ||
React.createElement(UploadListMultiItem_1.UploadListMultiItem, __assign({ files: files }, itemOptions)))); | ||
var ItemComponent = listItemUI || (files.length === 1 ? UploadListSingleItem_1.UploadListSingleItem : UploadListMultiItem_1.UploadListMultiItem); | ||
return (React.createElement("li", { ref: function (ref) { return _this._element = ref; }, className: liClassName, "data-uid": firstFile.uid, tabIndex: -1, onClick: this.onClick }, | ||
React.createElement(ItemComponent, __assign({ files: files }, itemOptions)))); | ||
}; | ||
@@ -68,0 +68,0 @@ return UploadListGroup; |
import * as React from 'react'; | ||
import { UploadFileInfo } from './interfaces/UploadFileInfo'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
* @hidden | ||
*/ | ||
export interface UploadListMultiItemProps { | ||
files: Array<UploadFileInfo>; | ||
disabled: boolean; | ||
async: UploadAsyncProps; | ||
onCancel: (uid: string) => void; | ||
onRemove: (uid: string) => void; | ||
onRetry: (uid: string) => void; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class UploadListMultiItem extends React.Component<UploadListMultiItemProps, {}> { | ||
mapFiles(): JSX.Element[]; | ||
fileNameClasses(file: UploadFileInfo): string; | ||
isProgressActive(): boolean; | ||
progress(): number; | ||
export declare class UploadListMultiItem extends React.Component<UploadListItemProps, {}> { | ||
/** | ||
* @hidden | ||
*/ | ||
mapFiles: () => JSX.Element[]; | ||
/** | ||
* @hidden | ||
*/ | ||
fileNameClasses: (file: UploadFileInfo) => string; | ||
/** | ||
* @hidden | ||
*/ | ||
isProgressActive: () => boolean; | ||
/** | ||
* @hidden | ||
*/ | ||
progress: () => number; | ||
render(): JSX.Element; | ||
} |
@@ -43,25 +43,37 @@ "use strict"; | ||
function UploadListMultiItem() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.mapFiles = function () { | ||
var files = _this.props.files; | ||
return files.map(function (file) { | ||
return React.createElement("span", { key: file.name, className: _this.fileNameClasses(file), title: file.name }, file.name); | ||
}); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.fileNameClasses = function (file) { | ||
return kendo_react_common_1.classNames('k-file-name', utils_1.default.fileHasValidationErrors(file) ? 'k-file-name-invalid' : ''); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.isProgressActive = function () { | ||
return (_this.props.files[0].status === UploadFileStatus_1.UploadFileStatus.Uploading); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.progress = function () { | ||
var files = _this.props.files; | ||
var sum = 0; | ||
files.forEach(function (file) { | ||
sum += file.progress || 0; | ||
}); | ||
return sum / files.length; | ||
}; | ||
return _this; | ||
} | ||
UploadListMultiItem.prototype.mapFiles = function () { | ||
var _this = this; | ||
var files = this.props.files; | ||
return files.map(function (file) { | ||
return React.createElement("span", { key: file.name, className: _this.fileNameClasses(file), title: file.name }, file.name); | ||
}); | ||
}; | ||
UploadListMultiItem.prototype.fileNameClasses = function (file) { | ||
return kendo_react_common_1.classNames('k-file-name', utils_1.default.fileHasValidationErrors(file) ? 'k-file-name-invalid' : ''); | ||
}; | ||
UploadListMultiItem.prototype.isProgressActive = function () { | ||
return (this.props.files[0].status === UploadFileStatus_1.UploadFileStatus.Uploading); | ||
}; | ||
UploadListMultiItem.prototype.progress = function () { | ||
var files = this.props.files; | ||
var sum = 0; | ||
files.forEach(function (file) { | ||
sum += file.progress || 0; | ||
}); | ||
return sum / files.length; | ||
}; | ||
UploadListMultiItem.prototype.render = function () { | ||
@@ -68,0 +80,0 @@ var _a = this.props, files = _a.files, others = __rest(_a, ["files"]); |
import * as React from 'react'; | ||
import { UploadFileInfo } from './interfaces/UploadFileInfo'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
* @hidden | ||
*/ | ||
export interface UploadListSingleItemProps { | ||
file: UploadFileInfo; | ||
disabled: boolean; | ||
async: UploadAsyncProps; | ||
onCancel: (uid: string) => void; | ||
onRemove: (uid: string) => void; | ||
onRetry: (uid: string) => void; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class UploadListSingleItem extends React.Component<UploadListSingleItemProps, {}> { | ||
export declare class UploadListSingleItem extends React.Component<UploadListItemProps, {}> { | ||
/** | ||
@@ -38,3 +27,3 @@ * @hidden | ||
*/ | ||
isProgressActive(): boolean; | ||
isProgressActive: () => boolean; | ||
/** | ||
@@ -41,0 +30,0 @@ * @hidden |
@@ -43,3 +43,10 @@ "use strict"; | ||
function UploadListSingleItem() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
/** | ||
* @hidden | ||
*/ | ||
_this.isProgressActive = function () { | ||
return (_this.props.files[0].status === UploadFileStatus_1.UploadFileStatus.Uploading); | ||
}; | ||
return _this; | ||
} | ||
@@ -93,10 +100,5 @@ /** | ||
*/ | ||
UploadListSingleItem.prototype.isProgressActive = function () { | ||
return (this.props.file.status === UploadFileStatus_1.UploadFileStatus.Uploading); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
UploadListSingleItem.prototype.render = function () { | ||
var _a = this.props, file = _a.file, others = __rest(_a, ["file"]); | ||
var _a = this.props, files = _a.files, others = __rest(_a, ["files"]); | ||
var file = files[0]; | ||
var itemClassName = kendo_react_common_1.classNames('k-file-single'); | ||
@@ -103,0 +105,0 @@ return (React.createElement("div", { className: itemClassName }, |
@@ -30,2 +30,3 @@ import * as React from 'react'; | ||
onClear: () => void; | ||
onUpload: () => void; | ||
onRetry: (uid: string) => void; | ||
@@ -32,0 +33,0 @@ onRemove: (uid: string) => void; |
@@ -161,2 +161,8 @@ "use strict"; | ||
}; | ||
_this.onUpload = function () { | ||
_this.navIndex = DEFAULT_INDEX; | ||
if (_this.props.onUpload) { | ||
_this.props.onUpload.call(undefined); | ||
} | ||
}; | ||
_this.onRetry = function (uid) { | ||
@@ -208,4 +214,4 @@ if (_this.props.onRetry) { | ||
var _this = this; | ||
var _a = this.props, onClear = _a.onClear, onRemove = _a.onRemove, onRetry = _a.onRetry, onCancel = _a.onCancel, onAdd = _a.onAdd, others = __rest(_a, ["onClear", "onRemove", "onRetry", "onCancel", "onAdd"]); | ||
return (React.createElement(UploadUI_1.UploadUI, __assign({ ref: function (ref) { return _this._uploadUI = ref; }, onKeyDown: this.onKeyDown, navigationIndex: this.navIndex, notFocusedIndex: NOT_FOCUSED_INDEX, onAdd: this.onAdd, onClear: this.onClear, onRemove: this.onRemove, onRetry: this.onRetry, onCancel: this.onCancel, onClick: this.onClick }, others))); | ||
var _a = this.props, onClear = _a.onClear, onRemove = _a.onRemove, onRetry = _a.onRetry, onCancel = _a.onCancel, onUpload = _a.onUpload, onAdd = _a.onAdd, others = __rest(_a, ["onClear", "onRemove", "onRetry", "onCancel", "onUpload", "onAdd"]); | ||
return (React.createElement(UploadUI_1.UploadUI, __assign({ ref: function (ref) { return _this._uploadUI = ref; }, onKeyDown: this.onKeyDown, navigationIndex: this.navIndex, notFocusedIndex: NOT_FOCUSED_INDEX, onAdd: this.onAdd, onClear: this.onClear, onUpload: this.onUpload, onRemove: this.onRemove, onRetry: this.onRetry, onCancel: this.onCancel, onClick: this.onClick }, others))); | ||
}; | ||
@@ -212,0 +218,0 @@ return UploadNavigation; |
import * as React from 'react'; | ||
import { GroupedFiles } from './interfaces/FileGroup'; | ||
import { UploadAsyncProps } from './interfaces/UploadAsyncProps'; | ||
import { UploadListItemProps } from './interfaces/UploadListItemProps'; | ||
/** | ||
@@ -17,2 +18,3 @@ * @hidden | ||
notFocusedIndex?: number; | ||
listItemUI?: React.ComponentType<UploadListItemProps>; | ||
onAdd?: (files: FileList) => void; | ||
@@ -19,0 +21,0 @@ onCancel?: (uid: string) => void; |
@@ -162,3 +162,3 @@ "use strict"; | ||
var _this = this; | ||
var _a = this.props, multiple = _a.multiple, disabled = _a.disabled, tabindex = _a.tabindex, accept = _a.accept, showFileList = _a.showFileList, groupedFiles = _a.groupedFiles, navigationIndex = _a.navigationIndex, showActionButtons = _a.showActionButtons, notFocusedIndex = _a.notFocusedIndex; | ||
var _a = this.props, multiple = _a.multiple, disabled = _a.disabled, tabindex = _a.tabindex, accept = _a.accept, showFileList = _a.showFileList, groupedFiles = _a.groupedFiles, navigationIndex = _a.navigationIndex, showActionButtons = _a.showActionButtons, notFocusedIndex = _a.notFocusedIndex, listItemUI = _a.listItemUI; | ||
var className = kendo_react_common_1.classNames('k-widget', 'k-upload', 'k-header', disabled ? 'k-state-disabled' : ''); | ||
@@ -170,3 +170,3 @@ var statusComponent = React.createElement(UploadStatus_1.UploadStatus, { fileGroup: groupedFiles }); | ||
showFileList ? | ||
React.createElement(UploadList_1.UploadList, { groupedFiles: groupedFiles, disabled: disabled, async: this.async, navigationIndex: navigationIndex, onCancel: this.onCancel, onRemove: this.onRemove, onRetry: this.onRetry, onClick: this.onClick }) : undefined, | ||
React.createElement(UploadList_1.UploadList, { groupedFiles: groupedFiles, disabled: disabled, async: this.async, navigationIndex: navigationIndex, listItemUI: listItemUI, onCancel: this.onCancel, onRemove: this.onRemove, onRetry: this.onRetry, onClick: this.onClick }) : undefined, | ||
showActionButtons ? | ||
@@ -173,0 +173,0 @@ React.createElement(UploadActionButtons_1.UploadActionButtons, { disabled: disabled, navigationIndex: navigationIndex, clearButtonIndex: this.clearButtonIndex, uploadButtonIndex: this.uploadButtonIndex, onUpload: this.onUpload, onClear: this.onClear, onClick: this.onClick }) : undefined)); |
@@ -18,3 +18,3 @@ import { UploadFileInfo } from '../interfaces/UploadFileInfo'; | ||
groupFilesByUid: (files: UploadFileInfo[]) => GroupedFiles; | ||
filesForUpload: (files: UploadFileInfo[]) => GroupedFiles; | ||
filesForUpload: (files: GroupedFiles) => GroupedFiles; | ||
setFilesStatus: (filesGroup: GroupedFiles, status: UploadFileStatus) => void; | ||
@@ -21,0 +21,0 @@ flatFileGroup: (fileGroup: GroupedFiles) => UploadFileInfo[]; |
@@ -37,3 +37,3 @@ "use strict"; | ||
var notUploadedGroups = {}; | ||
groupForEach(groupFilesByUid(files), function (currentFiles, uid) { | ||
groupForEach(files, function (currentFiles, uid) { | ||
var currentFilesValid = true; | ||
@@ -40,0 +40,0 @@ currentFiles.forEach(function (file) { |
{ | ||
"name": "@progress/kendo-react-upload", | ||
"version": "2.6.1", | ||
"version": "2.7.0-dev.201901311056", | ||
"description": "KendoReact Upload package", | ||
@@ -30,3 +30,3 @@ "repository": { | ||
"dependencies": { | ||
"@progress/kendo-react-common": "2.6.1", | ||
"@progress/kendo-react-common": "2.7.0-dev.201901311056", | ||
"axios": "^0.18.0", | ||
@@ -33,0 +33,0 @@ "prop-types": "^15.6.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
518600
46455
174
6806
10
38
2
3
+ Added@progress/kendo-react-common@2.7.0-dev.201901311056(transitive)
- Removed@progress/kendo-react-common@2.6.1(transitive)