/*! * vue-filepond v5.1.0 * a handy filepond adapter component for vue * * copyright (c) 2019 pqina * https://pqina.nl/filepond * * licensed under the mit license. */ !function(global,factory){if("function"==typeof define&&define.amd)define("vuefilepond",["exports","vue","filepond"],factory);else if("undefined"!=typeof exports)factory(exports,require("vue"),require("filepond"));else{var mod_exports={};factory(mod_exports,global.vue,global.filepond),global.vuefilepond=mod_exports}}(this,function(exports,_vue,_filepond){"use strict";object.defineproperty(exports,"__esmodule",{value:!0}),exports.setoptions=void 0;var obj,_vue2=(obj=_vue)&&obj.__esmodule?obj:{default:obj};var filteredcomponentmethods=["setoptions","on","off","ononce","appendto","insertafter","insertbefore","isattachedto","replaceelement","restoreelement","destroy"],issupported=(0,_filepond.supported)(),props={},events=[],watch={},instances=[],globaloptions={};exports.setoptions=function(options){globaloptions=object.assign(globaloptions,options),instances.foreach(function(instance){instance.setoptions(globaloptions)})};exports.default=function(){_filepond.registerplugin.apply(void 0,arguments),events.length=0;var _loop=function(prop){if(/^on/.test(prop))return events.push(prop),"continue";var type;props[prop]=[string,(type=_filepond.optiontypes[prop],{string:string,boolean:boolean,array:array,function:function,int:number,serverapi:object,object:object}[type])],watch[prop]=function(value){this._pond[prop]=value}};for(var prop in _filepond.optiontypes)_loop(prop);return _vue2.default.component("filepond",{name:"filepond",props:props,watch:watch,render:function(h){return h("div",{class:{"filepond--wrapper":!0}},[h("input",{attrs:{id:this.id,name:this.name,type:"file",class:this.classname,required:this.required,multiple:this.allowmultiple,accept:this.acceptedfiletypes,capture:this.capturemethod}})])},mounted:function(){var _this=this;if(issupported){this._element=this.$el.queryselector("input");var options=events.reduce(function(obj,value){return obj[value]=function(){for(var _len=arguments.length,args=array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];_this.$emit("input",_this._pond.getfiles()),_this.$emit.apply(_this,[value.substr(2)].concat(args))},obj},{}),attrs=object.assign({},this.$attrs);this._pond=(0,_filepond.create)(this._element,object.assign({},globaloptions,options,attrs,this.$options.propsdata)),object.keys(this._pond).filter(function(key){return!filteredcomponentmethods.includes(key)}).foreach(function(key){_this[key]=_this._pond[key]}),instances.push(this._pond)}},beforedestroy:function(){if(this._pond){this._pond.destroy();var index=instances.indexof(this._pond);0<=index&&instances.splice(index,1)}}})}});