2020-08-21 06:36:31 +02:00
|
|
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["angular-file-upload"]=t():e["angular-file-upload"]=t()}(this,function(){return r={},o.m=n=[function(e,t,o){"use strict";var n=y(o(1)),r=y(o(2)),i=y(o(3)),s=y(o(4)),a=y(o(5)),l=y(o(6)),u=y(o(7)),p=y(o(8)),c=y(o(9)),f=y(o(10)),d=y(o(11)),h=y(o(12)),v=y(o(13));function y(e){return e&&e.__esModule?e:{default:e}}angular.module(n.default.name,[]).value("fileUploaderOptions",r.default).factory("FileUploader",i.default).factory("FileLikeObject",s.default).factory("FileItem",a.default).factory("FileDirective",l.default).factory("FileSelect",u.default).factory("FileDrop",c.default).factory("FileOver",f.default).factory("Pipeline",p.default).directive("nvFileSelect",d.default).directive("nvFileDrop",h.default).directive("nvFileOver",v.default).run(["FileUploader","FileLikeObject","FileItem","FileDirective","FileSelect","FileDrop","FileOver","Pipeline",function(e,t,o,n,r,i,s,a){e.FileLikeObject=t,e.FileItem=o,e.FileDirective=n,e.FileSelect=r,e.FileDrop=i,e.FileOver=s,e.Pipeline=a}])},function(e,t){e.exports={name:"angularFileUpload"}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={url:"/",alias:"file",headers:{},queue:[],progress:0,autoUpload:!1,removeAfterUpload:!1,method:"POST",filters:[],formData:[],queueLimit:Number.MAX_VALUE,withCredentials:!1,disableMultipart:!1}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var o=[],n=!0,r=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(o.push(s.value),!t||o.length!==t);n=!0);}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return o}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};t.default=s;var n,r=o(1);(n=r)&&n.__esModule;var i=angular,u=i.bind,p=i.copy,v=i.extend,y=i.forEach,m=i.isObject,_=i.isNumber,g=i.isDefined,b=i.isArray,F=i.isUndefined,O=i.element;function s(o,e,n,t,s,c,f,d){var r=t.File,a=t.FormData,i=(l.prototype.addToQueue=function(e,r,t){var s=this,a=this.isArrayLikeObject(e)?Array.prototype.slice.call(e):[e],l=this._getFilters(t),o=this.queue.length,u=[],p=function(){s.queue.length!==o&&(s._onAfterAddingAll(u),s.progress=s._getTotalProgress()),s._render(),s.autoUpload&&s.uploadAll()};!function i(){var e=a.shift();if(F(e))return p();var t=s.isFile(e)?e:new c(e),o=s._convertFiltersToPipes(l),n=new d(o);n.onThrown=function(e){var t=e.pipe.originalFilter,o=h(e.args,2),n=o[0],r=o[1];s._onWhenAddingFileFailed(n,t,r),i()},n.onSuccessful=function(e,t){var o=new f(s,e,t);u.push(o),s.queue.push(o),s._onAfterAddingFile(o),i()},n.exec(t,r)}()},l.prototype.removeFromQueue=function(e){var t=this.getIndexOfItem(e),o=this.queue[t];o.isUploading&&o.cancel(),this.queue.splice(t,1),o._destroy(),this.progress=this._getTotalProgress()},l.prototype.clearQueue=function(){for(;this.queue.length;)this.queue[0].remove();this.progress=0},l.prototype.uploadItem=function(e){var t=this.getIndexOfItem(e),o=this.queue[t],n=this.isHTML5?"_xhrTransport":"_iframeTransport";o._prepareToUploading(),this.isUploading||(this._onBeforeUploadItem(o),o.isCancel||(o.isUploading=!0,this.isUploading=!0,this[n](o),this._render()))},l.prototype.cancelItem=function(e){var t=this,o=this.getIndexOfItem(e),n=this.queue[o],r=this.isHTML5?"_xhr":"_form";if(n)if(n.isCancel=!0,n.isUploading)n[r].abort();else{var i=[void 0,0,{}];s(function(){t._onCancelItem.apply(t,[n].concat(i)),t._onCompleteItem.apply(t,[n].concat(i))})}},l.prototype.uploadAll=function(){var e=this.getNotUploadedItems().filter(function(e){return!e.isUploading});e.length&&(y(e,function(e){return e._prepareToUploading()}),e[0].upload())},l.prototype.cancelAll=function(){var e=this.getNotUploadedItems();y(e,function(e){return e.cancel()})},l.prototype.isFile=function(e){return this.constructor.isFile(e)},l.prototype.isFileLikeObject=function(
|