vue-filepond
Advanced tools
Comparing version 5.0.0 to 5.1.0
# Changelog | ||
## 5.1.0 | ||
- Add v-model support | ||
## 5.0.0 | ||
@@ -4,0 +9,0 @@ |
/*! | ||
* vue-filepond v5.0.0 | ||
* vue-filepond v5.1.0 | ||
* A handy FilePond adapter component for Vue | ||
@@ -137,2 +137,3 @@ * | ||
obj[value] = (...args) => { | ||
this.$emit('input', this._pond.getFiles()); | ||
this.$emit(value.substr(2), ...args); | ||
@@ -139,0 +140,0 @@ }; |
/*! | ||
* vue-filepond v5.0.0 | ||
* vue-filepond v5.1.0 | ||
* A handy FilePond adapter component for Vue | ||
@@ -152,2 +152,3 @@ * | ||
_this.$emit('input', _this._pond.getFiles()); | ||
_this.$emit.apply(_this, [value.substr(2)].concat(args)); | ||
@@ -154,0 +155,0 @@ }; |
/*! | ||
* vue-filepond v5.0.0 | ||
* vue-filepond v5.1.0 | ||
* A handy FilePond adapter component for Vue | ||
@@ -10,2 +10,2 @@ * | ||
*/ | ||
!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.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)}}})}}); | ||
!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)}}})}}); |
@@ -127,2 +127,3 @@ import Vue from 'vue'; | ||
obj[value] = (...args) => { | ||
this.$emit('input', this._pond.getFiles()); | ||
this.$emit(value.substr(2), ...args); | ||
@@ -129,0 +130,0 @@ }; |
{ | ||
"name": "vue-filepond", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "A handy FilePond adapter component for Vue", | ||
@@ -5,0 +5,0 @@ "homepage": "https://pqina.nl/filepond", |
@@ -75,3 +75,12 @@ # Vue FilePond | ||
When using FilePond with an SSR configuration like Nuxt.js it's best to wrap it in `<no-ssr>` tags. | ||
```vue | ||
<template> | ||
<no-ssr> | ||
<file-pond/> | ||
</no-ssr> | ||
</template> | ||
``` | ||
Usage in the browser: | ||
@@ -115,1 +124,3 @@ | ||
[Read the docs for more information](https://pqina.nl/filepond/docs/patterns/frameworks/vue/) | ||
[Live Demo with Code Sandbox](https://codesandbox.io/s/p3v8zoprp7) |
171539
495
125