vue-filepond
Advanced tools
Comparing version 7.0.2 to 7.0.3
/*! | ||
* vue-filepond v7.0.2 | ||
* vue-filepond v7.0.3 | ||
* A handy FilePond adapter component for Vue | ||
* | ||
* Copyright (c) 2021 PQINA | ||
* Copyright (c) 2022 PQINA | ||
* https://pqina.nl/filepond | ||
@@ -80,3 +80,3 @@ * | ||
// labelFileProcessingError can also be Function | ||
if (prop == 'labelFileProcessingError') { | ||
if (prop == "labelFileProcessingError") { | ||
valid_types.push(Function); | ||
@@ -89,3 +89,3 @@ } | ||
// set this default value so we know which props have been explicitely set by user on component | ||
default: "__unset__", | ||
default: undefined, | ||
}; | ||
@@ -100,2 +100,18 @@ } | ||
render() { | ||
// clean up undefined attributes | ||
const attributes = Object.entries({ | ||
id: this.id, | ||
name: this.name, | ||
type: "file", | ||
class: this.className, | ||
required: this.required, | ||
multiple: this.allowMultiple, | ||
accept: this.acceptedFileTypes, | ||
capture: this.captureMethod, | ||
}).reduce((attributes, [key, value]) => { | ||
if (value !== undefined) attributes[key] = value; | ||
return attributes; | ||
}, {}); | ||
// create base element | ||
return h( | ||
@@ -108,14 +124,3 @@ "div", | ||
}, | ||
[ | ||
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, | ||
}), | ||
] | ||
[h("input", attributes)] | ||
); | ||
@@ -151,3 +156,3 @@ }, | ||
Object.keys(props).forEach((key) => { | ||
if (this[key] === "__unset__") return; | ||
if (this[key] === undefined) return; | ||
passedProps[key] = this[key]; | ||
@@ -154,0 +159,0 @@ }); |
/*! | ||
* vue-filepond v7.0.2 | ||
* vue-filepond v7.0.3 | ||
* A handy FilePond adapter component for Vue | ||
* | ||
* Copyright (c) 2021 PQINA | ||
* Copyright (c) 2022 PQINA | ||
* https://pqina.nl/filepond | ||
@@ -30,2 +30,11 @@ * | ||
_exports.default = _exports.setOptions = void 0; | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
// Methods not made available to the component | ||
@@ -83,3 +92,3 @@ var filteredComponentMethods = ["setOptions", "on", "off", "onOnce", "appendTo", "insertAfter", "insertBefore", "isAttachedTo", "replaceElement", "restoreElement", "destroy"]; // Test if is supported on this client | ||
if (prop == 'labelFileProcessingError') { | ||
if (prop == "labelFileProcessingError") { | ||
valid_types.push(Function); | ||
@@ -91,3 +100,3 @@ } | ||
// set this default value so we know which props have been explicitely set by user on component | ||
default: "__unset__" | ||
default: undefined | ||
}; | ||
@@ -101,7 +110,4 @@ } // create | ||
render: function render() { | ||
return (0, _vue.h)("div", { | ||
class: { | ||
"filepond--wrapper": true | ||
} | ||
}, [(0, _vue.h)("input", { | ||
// clean up undefined attributes | ||
var attributes = Object.entries({ | ||
id: this.id, | ||
@@ -115,3 +121,16 @@ name: this.name, | ||
capture: this.captureMethod | ||
})]); | ||
}).reduce(function (attributes, _ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
key = _ref2[0], | ||
value = _ref2[1]; | ||
if (value !== undefined) attributes[key] = value; | ||
return attributes; | ||
}, {}); // create base element | ||
return (0, _vue.h)("div", { | ||
class: { | ||
"filepond--wrapper": true | ||
} | ||
}, [(0, _vue.h)("input", attributes)]); | ||
}, | ||
@@ -151,3 +170,3 @@ created: function created() { | ||
Object.keys(props).forEach(function (key) { | ||
if (_this2[key] === "__unset__") return; | ||
if (_this2[key] === undefined) return; | ||
passedProps[key] = _this2[key]; | ||
@@ -154,0 +173,0 @@ }); // Create our pond |
/*! | ||
* vue-filepond v7.0.2 | ||
* vue-filepond v7.0.3 | ||
* A handy FilePond adapter component for Vue | ||
* | ||
* Copyright (c) 2021 PQINA | ||
* Copyright (c) 2022 PQINA | ||
* https://pqina.nl/filepond | ||
@@ -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)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}}}}}); | ||
!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";function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){if(!(Symbol.iterator in Object(arr)||"[object Arguments]"===Object.prototype.toString.call(arr)))return;var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}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:void 0}}var type;return{name:"FilePond",props:props,render:function(){var attributes=Object.entries({id:this.id,name:this.name,type:"file",class:this.className,required:this.required,multiple:this.allowMultiple,accept:this.acceptedFileTypes,capture:this.captureMethod}).reduce(function(attributes,_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];return void 0!==value&&(attributes[key]=value),attributes},{});return(0,_vue.h)("div",{class:{"filepond--wrapper":!0}},[(0,_vue.h)("input",attributes)])},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){void 0!==_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.2", | ||
"version": "7.0.3", | ||
"description": "A handy FilePond adapter component for Vue", | ||
@@ -5,0 +5,0 @@ "homepage": "https://pqina.nl/filepond", |
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
26517
402