vue-filepond
Advanced tools
Comparing version 7.0.0 to 7.0.1
/*! | ||
* vue-filepond v7.0.0 | ||
* vue-filepond v7.0.1 | ||
* A handy FilePond adapter component for Vue | ||
@@ -77,4 +77,11 @@ * | ||
// get property type ( can be either a String or the type defined within FilePond ) | ||
let valid_types = [String, getNativeConstructorFromType(OptionTypes[prop])]; | ||
// labelFileProcessingError can also be Function | ||
if (prop == 'labelFileProcessingError') { | ||
valid_types.push(Function); | ||
} | ||
props[prop] = { | ||
type: [String, getNativeConstructorFromType(OptionTypes[prop])], | ||
type: valid_types, | ||
@@ -81,0 +88,0 @@ // set this default value so we know which props have been explicitely set by user on component |
/*! | ||
* vue-filepond v7.0.0 | ||
* vue-filepond v7.0.1 | ||
* A handy FilePond adapter component for Vue | ||
@@ -80,4 +80,10 @@ * | ||
var valid_types = [String, getNativeConstructorFromType(_filepond.OptionTypes[prop])]; // labelFileProcessingError can also be Function | ||
if (prop == 'labelFileProcessingError') { | ||
valid_types.push(Function); | ||
} | ||
props[prop] = { | ||
type: [String, getNativeConstructorFromType(_filepond.OptionTypes[prop])], | ||
type: valid_types, | ||
// set this default value so we know which props have been explicitely set by user on component | ||
@@ -84,0 +90,0 @@ default: "__unset__" |
/*! | ||
* vue-filepond v7.0.0 | ||
* vue-filepond v7.0.1 | ||
* 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}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(_exports,_vue,_filepond){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=_exports.setOptions=void 0;var filteredComponentMethods=["setOptions","on","off","onOnce","appendTo","insertAfter","insertBefore","isAttachedTo","replaceElement","restoreElement","destroy"],isSupported=(0,_filepond.supported)(),props={},events=[],instances=[],globalOptions={};_exports.setOptions=function(options){globalOptions=Object.assign(globalOptions,options),instances.forEach(function(instance){instance.setOptions(globalOptions)})};_exports.default=function(){for(var prop in _filepond.registerPlugin.apply(void 0,arguments),events.length=0,_filepond.OptionTypes)/^on/.test(prop)?events.push(prop):props[prop]={type:[String,(type=_filepond.OptionTypes[prop],{string:String,boolean:Boolean,array:Array,function:Function,int:Number,serverapi:Object,object:Object}[type])],default:"__unset__"};var type;return{name:"FilePond",props:props,render:function(){return(0,_vue.h)("div",{class:{"filepond--wrapper":!0}},[(0,_vue.h)("input",{id:this.id,name:this.name,type:"file",class:this.className,required:this.required,multiple:this.allowMultiple,accept:this.acceptedFileTypes,capture:this.captureMethod})])},created:function(){var _this=this;this.watchers=Object.keys(props).map(function(key){return _this.$watch(key,function(next){_this._pond[key]=next})})},mounted:function(){var _this2=this;if(isSupported){this._element=this.$el.querySelector("input");var options=events.reduce(function(obj,value){return obj[value]=function(){_this2.$emit("input",_this2._pond?_this2._pond.getFiles():[]);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];_this2.$emit.apply(_this2,[value.substr(2)].concat(args))},obj},{}),passedProps={};Object.keys(props).forEach(function(key){"__unset__"!==_this2[key]&&(passedProps[key]=_this2[key])}),this._pond=(0,_filepond.create)(this._element,Object.assign({},globalOptions,options,passedProps)),Object.keys(this._pond).filter(function(key){return!filteredComponentMethods.includes(key)}).forEach(function(key){_this2[key]=_this2._pond[key]}),instances.push(this._pond)}},beforeUnmount:function(){var _this3=this,detached=this.$options.detached;if(this.$el.offsetParent){new MutationObserver(function(mutations,observer){var removedNode=((mutations[0]||{}).removedNodes||[])[0];removedNode&&removedNode.contains(_this3.$el)&&(observer.disconnect(),detached.call(_this3))}).observe(document.documentElement,{childList:!0,subtree:!0})}else detached.call(this)},detached:function(){if(this.watchers.forEach(function(unwatch){return unwatch()}),this._pond){this._pond.destroy();var index=instances.indexOf(this._pond);0<=index&&instances.splice(index,1),this._pond=null}}}}}); | ||
!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}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(_exports,_vue,_filepond){"use strict";Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=_exports.setOptions=void 0;var filteredComponentMethods=["setOptions","on","off","onOnce","appendTo","insertAfter","insertBefore","isAttachedTo","replaceElement","restoreElement","destroy"],isSupported=(0,_filepond.supported)(),props={},events=[],instances=[],globalOptions={};_exports.setOptions=function(options){globalOptions=Object.assign(globalOptions,options),instances.forEach(function(instance){instance.setOptions(globalOptions)})};_exports.default=function(){for(var prop in _filepond.registerPlugin.apply(void 0,arguments),events.length=0,_filepond.OptionTypes)if(/^on/.test(prop))events.push(prop);else{var valid_types=[String,(type=_filepond.OptionTypes[prop],{string:String,boolean:Boolean,array:Array,function:Function,int:Number,serverapi:Object,object:Object}[type])];"labelFileProcessingError"==prop&&valid_types.push(Function),props[prop]={type:valid_types,default:"__unset__"}}var type;return{name:"FilePond",props:props,render:function(){return(0,_vue.h)("div",{class:{"filepond--wrapper":!0}},[(0,_vue.h)("input",{id:this.id,name:this.name,type:"file",class:this.className,required:this.required,multiple:this.allowMultiple,accept:this.acceptedFileTypes,capture:this.captureMethod})])},created:function(){var _this=this;this.watchers=Object.keys(props).map(function(key){return _this.$watch(key,function(next){_this._pond[key]=next})})},mounted:function(){var _this2=this;if(isSupported){this._element=this.$el.querySelector("input");var options=events.reduce(function(obj,value){return obj[value]=function(){_this2.$emit("input",_this2._pond?_this2._pond.getFiles():[]);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];_this2.$emit.apply(_this2,[value.substr(2)].concat(args))},obj},{}),passedProps={};Object.keys(props).forEach(function(key){"__unset__"!==_this2[key]&&(passedProps[key]=_this2[key])}),this._pond=(0,_filepond.create)(this._element,Object.assign({},globalOptions,options,passedProps)),Object.keys(this._pond).filter(function(key){return!filteredComponentMethods.includes(key)}).forEach(function(key){_this2[key]=_this2._pond[key]}),instances.push(this._pond)}},beforeUnmount:function(){var _this3=this,detached=this.$options.detached;if(this.$el.offsetParent){new MutationObserver(function(mutations,observer){var removedNode=((mutations[0]||{}).removedNodes||[])[0];removedNode&&removedNode.contains(_this3.$el)&&(observer.disconnect(),detached.call(_this3))}).observe(document.documentElement,{childList:!0,subtree:!0})}else detached.call(this)},detached:function(){if(this.watchers.forEach(function(unwatch){return unwatch()}),this._pond){this._pond.destroy();var index=instances.indexOf(this._pond);0<=index&&instances.splice(index,1),this._pond=null}}}}}); |
{ | ||
"name": "vue-filepond", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "A handy FilePond adapter component for Vue", | ||
@@ -5,0 +5,0 @@ "homepage": "https://pqina.nl/filepond", |
@@ -5,7 +5,17 @@ # Vue FilePond | ||
**If you want to use Vue FilePond with Vue 2, please use v6 of this plugin.** | ||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/pqina/vue-filepond/blob/master/LICENSE) | ||
[![npm version](https://badge.fury.io/js/vue-filepond.svg)](https://www.npmjs.com/package/vue-filepond) | ||
![npm](https://img.shields.io/npm/dt/vue-filepond) | ||
<img src="https://github.com/pqina/filepond-github-assets/blob/master/filepond-animation-01.gif?raw=true" width="370" alt=""/> | ||
--- | ||
[<img src="https://github.com/pqina/filepond-github-assets/blob/master/header.svg" alt="FilePond"/>](https://www.buymeacoffee.com/rikschennink/) | ||
[Buy me a Coffee](https://www.buymeacoffee.com/rikschennink/) / [Use FilePond with Pintura](https://pqina.nl/pintura/?ref=github-filepond) / [Dev updates on Twitter](https://twitter.com/rikschennink/) | ||
--- | ||
### Core Features | ||
@@ -22,2 +32,4 @@ | ||
<img src="https://github.com/pqina/filepond-github-assets/blob/master/filepond-animation-01.gif?raw=true" width="370" alt=""/> | ||
--- | ||
@@ -27,7 +39,7 @@ | ||
**Doka.js** might be just what you're looking for. It's a Modern JavaScript Image Editor, Doka supports setting **crop aspect ratios**, **resizing**, **rotating**, **cropping**, and **flipping** images. Above all, it integrates beautifully with FilePond. | ||
**Pintura the modern JavaScript Image Editor** is what you're looking for. Pintura supports setting **crop aspect ratios**, **resizing**, **rotating**, **cropping**, and **flipping** images. Above all, it integrates beautifully with FilePond. | ||
[Learn more about Doka](https://pqina.nl/doka/?ref=github-vue-filepond) | ||
[Learn more about Pintura](https://pqina.nl/pintura/?ref=github-vue-filepond) | ||
<img src="https://github.com/pqina/filepond-github-assets/blob/master/doka.gif?raw=true" width="478" alt=""/> | ||
<img src="https://github.com/pqina/filepond-github-assets/blob/master/filepond_pintura.gif?raw=true" width="600" alt=""/> | ||
@@ -38,2 +50,4 @@ --- | ||
**If you're using Vue 2 please run `npm install vue-filepond@^6.0.0`** | ||
```bash | ||
@@ -43,4 +57,2 @@ npm install vue-filepond filepond | ||
If you're using Vue 2 please run `npm install vue-filepond@^6.0.0` | ||
Usage: | ||
@@ -141,3 +153,3 @@ | ||
<script src="https://unpkg.com/vue"></script> | ||
<script src="https://unpkg.com/vue-filepond"></script> | ||
<script src="https://unpkg.com/vue-filepond@6"></script> | ||
@@ -144,0 +156,0 @@ <script> |
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
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
24360
385
165
7