vue-qrcode
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.2.3](https://github.com/rx-ts/vue/compare/vue-qrcode@0.2.2...vue-qrcode@0.2.3) (2020-01-17) | ||
### Bug Fixes | ||
* dataUrl initialize value should be empty string ([846220d](https://github.com/rx-ts/vue/commit/846220ddf5bc47416e144e02ff559f35edc17789)) | ||
## [0.2.2](https://github.com/rx-ts/vue/compare/vue-qrcode@0.2.1...vue-qrcode@0.2.2) (2019-09-23) | ||
@@ -8,0 +19,0 @@ |
@@ -120,3 +120,3 @@ 'use strict'; | ||
return { | ||
dataUrl: null, | ||
dataUrl: '', | ||
}; | ||
@@ -123,0 +123,0 @@ }, |
@@ -1,1 +0,15 @@ | ||
"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var QRCode=_interopDefault(require("qrcode")),__assign=function(){return(__assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function __rest(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}var LEVELS=["low","medium","quartile","high","L","M","Q","H"],MASK_PATTERNS=[0,1,2,3,4,5,6,7],MODES=["alphanumeric","numeric","kanji","byte"],TYPES=["image/png","image/jpeg","image/webp"],MAX_QR_VERSION=40,index={props:{version:{type:Number,validator:function(t){return t===parseInt(String(t),10)&&t>=1&&t<=MAX_QR_VERSION}},errorCorrectionLevel:{type:String,validator:function(t){return LEVELS.includes(t)}},maskPattern:{type:Number,validator:function(t){return MASK_PATTERNS.includes(t)}},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:function(t){return["dark","light"].every((function(e){return["string","undefined"].includes(typeof t[e])}))}},type:{type:String,validator:function(t){return TYPES.includes(t)}},quality:{type:Number,validator:function(t){return t===parseFloat(String(t))&&t>=0&&t<=1}},value:{type:[String,Array],required:!0,validator:function(t){return"string"==typeof t||t.every((function(t){var e=t.data,r=t.mode;return"string"==typeof e&&(null==r||MODES.includes(r))}))}}},data:function(){return{dataUrl:null}},watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL:function(){var t=this,e=this.$props,r=e.quality,n=__rest(e,["quality"]);return QRCode.toDataURL(this.value,Object.assign(n,null==r||{renderOptions:{quality:r}})).then((function(e){return t.dataUrl=e}))}},render:function(){return this.$createElement("img",{domProps:__assign(__assign({},this.$attrs),{src:this.dataUrl})})}};exports.LEVELS=LEVELS,exports.MASK_PATTERNS=MASK_PATTERNS,exports.MODES=MODES,exports.TYPES=TYPES,exports.default=index; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=(t=require("qrcode"))&&"object"==typeof t&&"default"in t?t.default:t,r=function(){return(r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)}; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */var n=["low","medium","quartile","high","L","M","Q","H"],i=[0,1,2,3,4,5,6,7],a=["alphanumeric","numeric","kanji","byte"],o=["image/png","image/jpeg","image/webp"],u={props:{version:{type:Number,validator:function(t){return t===parseInt(String(t),10)&&t>=1&&t<=40}},errorCorrectionLevel:{type:String,validator:function(t){return n.includes(t)}},maskPattern:{type:Number,validator:function(t){return i.includes(t)}},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:function(t){return["dark","light"].every((function(e){return["string","undefined"].includes(typeof t[e])}))}},type:{type:String,validator:function(t){return o.includes(t)}},quality:{type:Number,validator:function(t){return t===parseFloat(String(t))&&t>=0&&t<=1}},value:{type:[String,Array],required:!0,validator:function(t){return"string"==typeof t||t.every((function(t){var e=t.data,r=t.mode;return"string"==typeof e&&(null==r||a.includes(r))}))}}},data:function(){return{dataUrl:""}},watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL:function(){var t=this,r=this.$props,n=r.quality,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(r,["quality"]);return e.toDataURL(this.value,Object.assign(i,null==n||{renderOptions:{quality:n}})).then((function(e){return t.dataUrl=e}))}},render:function(){return this.$createElement("img",{domProps:r(r({},this.$attrs),{src:this.dataUrl})})}};exports.LEVELS=n,exports.MASK_PATTERNS=i,exports.MODES=a,exports.TYPES=o,exports.default=u; |
@@ -90,3 +90,3 @@ import QRCode from 'qrcode'; | ||
return { | ||
dataUrl: null, | ||
dataUrl: '', | ||
}; | ||
@@ -93,0 +93,0 @@ }, |
@@ -1,1 +0,15 @@ | ||
import t from"qrcode";const e=["low","medium","quartile","high","L","M","Q","H"],r=[0,1,2,3,4,5,6,7],a=["alphanumeric","numeric","kanji","byte"],i=["image/png","image/jpeg","image/webp"];var n={props:{version:{type:Number,validator:t=>t===parseInt(String(t),10)&&t>=1&&t<=40},errorCorrectionLevel:{type:String,validator:t=>e.includes(t)},maskPattern:{type:Number,validator:t=>r.includes(t)},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:t=>["dark","light"].every(e=>["string","undefined"].includes(typeof t[e]))},type:{type:String,validator:t=>i.includes(t)},quality:{type:Number,validator:t=>t===parseFloat(String(t))&&t>=0&&t<=1},value:{type:[String,Array],required:!0,validator:t=>"string"==typeof t||t.every(({data:t,mode:e})=>"string"==typeof t&&(null==e||a.includes(e)))}},data:()=>({dataUrl:null}),watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL(){const e=this.$props,{quality:r}=e,a=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(r[a[i]]=t[a[i]])}return r}(e,["quality"]);return t.toDataURL(this.value,Object.assign(a,null==r||{renderOptions:{quality:r}})).then(t=>this.dataUrl=t)}},render(){return this.$createElement("img",{domProps:Object.assign(Object.assign({},this.$attrs),{src:this.dataUrl})})}};export default n;export{e as LEVELS,r as MASK_PATTERNS,a as MODES,i as TYPES}; | ||
import t from"qrcode"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */const e=["low","medium","quartile","high","L","M","Q","H"],r=[0,1,2,3,4,5,6,7],a=["alphanumeric","numeric","kanji","byte"],i=["image/png","image/jpeg","image/webp"];var n={props:{version:{type:Number,validator:t=>t===parseInt(String(t),10)&&t>=1&&t<=40},errorCorrectionLevel:{type:String,validator:t=>e.includes(t)},maskPattern:{type:Number,validator:t=>r.includes(t)},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:t=>["dark","light"].every(e=>["string","undefined"].includes(typeof t[e]))},type:{type:String,validator:t=>i.includes(t)},quality:{type:Number,validator:t=>t===parseFloat(String(t))&&t>=0&&t<=1},value:{type:[String,Array],required:!0,validator:t=>"string"==typeof t||t.every(({data:t,mode:e})=>"string"==typeof t&&(null==e||a.includes(e)))}},data:()=>({dataUrl:""}),watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL(){const e=this.$props,{quality:r}=e,a=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(r[a[i]]=t[a[i]])}return r}(e,["quality"]);return t.toDataURL(this.value,Object.assign(a,null==r||{renderOptions:{quality:r}})).then(t=>this.dataUrl=t)}},render(){return this.$createElement("img",{domProps:Object.assign(Object.assign({},this.$attrs),{src:this.dataUrl})})}};export default n;export{e as LEVELS,r as MASK_PATTERNS,a as MODES,i as TYPES}; |
@@ -114,3 +114,3 @@ import QRCode from 'qrcode'; | ||
return { | ||
dataUrl: null, | ||
dataUrl: '', | ||
}; | ||
@@ -117,0 +117,0 @@ }, |
@@ -1,1 +0,15 @@ | ||
import t from"qrcode";var r=function(){return(r=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var i in r=arguments[e])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t}).apply(this,arguments)};var e=["low","medium","quartile","high","L","M","Q","H"],n=[0,1,2,3,4,5,6,7],i=["alphanumeric","numeric","kanji","byte"],a=["image/png","image/jpeg","image/webp"],o={props:{version:{type:Number,validator:function(t){return t===parseInt(String(t),10)&&t>=1&&t<=40}},errorCorrectionLevel:{type:String,validator:function(t){return e.includes(t)}},maskPattern:{type:Number,validator:function(t){return n.includes(t)}},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:function(t){return["dark","light"].every((function(r){return["string","undefined"].includes(typeof t[r])}))}},type:{type:String,validator:function(t){return a.includes(t)}},quality:{type:Number,validator:function(t){return t===parseFloat(String(t))&&t>=0&&t<=1}},value:{type:[String,Array],required:!0,validator:function(t){return"string"==typeof t||t.every((function(t){var r=t.data,e=t.mode;return"string"==typeof r&&(null==e||i.includes(e))}))}}},data:function(){return{dataUrl:null}},watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL:function(){var r=this,e=this.$props,n=e.quality,i=function(t,r){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)r.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(e[n[i]]=t[n[i]])}return e}(e,["quality"]);return t.toDataURL(this.value,Object.assign(i,null==n||{renderOptions:{quality:n}})).then((function(t){return r.dataUrl=t}))}},render:function(){return this.$createElement("img",{domProps:r(r({},this.$attrs),{src:this.dataUrl})})}};export default o;export{e as LEVELS,n as MASK_PATTERNS,i as MODES,a as TYPES}; | ||
import t from"qrcode"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */var r=function(){return(r=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var i in r=arguments[e])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t}).apply(this,arguments)};var e=["low","medium","quartile","high","L","M","Q","H"],n=[0,1,2,3,4,5,6,7],i=["alphanumeric","numeric","kanji","byte"],a=["image/png","image/jpeg","image/webp"],o={props:{version:{type:Number,validator:function(t){return t===parseInt(String(t),10)&&t>=1&&t<=40}},errorCorrectionLevel:{type:String,validator:function(t){return e.includes(t)}},maskPattern:{type:Number,validator:function(t){return n.includes(t)}},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:function(t){return["dark","light"].every((function(r){return["string","undefined"].includes(typeof t[r])}))}},type:{type:String,validator:function(t){return a.includes(t)}},quality:{type:Number,validator:function(t){return t===parseFloat(String(t))&&t>=0&&t<=1}},value:{type:[String,Array],required:!0,validator:function(t){return"string"==typeof t||t.every((function(t){var r=t.data,e=t.mode;return"string"==typeof r&&(null==e||i.includes(e))}))}}},data:function(){return{dataUrl:""}},watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL:function(){var r=this,e=this.$props,n=e.quality,i=function(t,r){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)r.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(e[n[i]]=t[n[i]])}return e}(e,["quality"]);return t.toDataURL(this.value,Object.assign(i,null==n||{renderOptions:{quality:n}})).then((function(t){return r.dataUrl=t}))}},render:function(){return this.$createElement("img",{domProps:r(r({},this.$attrs),{src:this.dataUrl})})}};export default o;export{e as LEVELS,n as MASK_PATTERNS,i as MODES,a as TYPES}; |
@@ -5,3 +5,3 @@ import { QRCodeSegment as _QRCodeSegment, QRCodeToDataURLOptions } from 'qrcode'; | ||
export declare const MASK_PATTERNS: readonly [0, 1, 2, 3, 4, 5, 6, 7]; | ||
export declare type MaskPattern = (typeof MASK_PATTERNS)[number]; | ||
export declare type MaskPattern = typeof MASK_PATTERNS[number]; | ||
export declare const MODES: readonly ["alphanumeric", "numeric", "kanji", "byte"]; | ||
@@ -21,2 +21,1 @@ export declare type QRCodeMode = _QRCodeSegment['mode']; | ||
export default _default; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -76,3 +76,3 @@ import { __assign, __rest } from "tslib"; | ||
return { | ||
dataUrl: null, | ||
dataUrl: '', | ||
}; | ||
@@ -79,0 +79,0 @@ }, |
@@ -5,3 +5,3 @@ (function (global, factory) { | ||
(global = global || self, factory(global.VueQrcode = {}, global.QRCode)); | ||
}(this, function (exports, QRCode) { 'use strict'; | ||
}(this, (function (exports, QRCode) { 'use strict'; | ||
@@ -121,3 +121,3 @@ QRCode = QRCode && QRCode.hasOwnProperty('default') ? QRCode['default'] : QRCode; | ||
return { | ||
dataUrl: null, | ||
dataUrl: '', | ||
}; | ||
@@ -158,2 +158,2 @@ }, | ||
})); | ||
}))); |
@@ -1,1 +0,16 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("qrcode")):"function"==typeof define&&define.amd?define(["exports","qrcode"],t):t((e=e||self).VueQrcode={},e.QRCode)}(this,(function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};var n=["low","medium","quartile","high","L","M","Q","H"],i=[0,1,2,3,4,5,6,7],o=["alphanumeric","numeric","kanji","byte"],a=["image/png","image/jpeg","image/webp"],u={props:{version:{type:Number,validator:function(e){return e===parseInt(String(e),10)&&e>=1&&e<=40}},errorCorrectionLevel:{type:String,validator:function(e){return n.includes(e)}},maskPattern:{type:Number,validator:function(e){return i.includes(e)}},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:function(e){return["dark","light"].every((function(t){return["string","undefined"].includes(typeof e[t])}))}},type:{type:String,validator:function(e){return a.includes(e)}},quality:{type:Number,validator:function(e){return e===parseFloat(String(e))&&e>=0&&e<=1}},value:{type:[String,Array],required:!0,validator:function(e){return"string"==typeof e||e.every((function(e){var t=e.data,r=e.mode;return"string"==typeof t&&(null==r||o.includes(r))}))}}},data:function(){return{dataUrl:null}},watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL:function(){var e=this,r=this.$props,n=r.quality,i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(r,["quality"]);return t.toDataURL(this.value,Object.assign(i,null==n||{renderOptions:{quality:n}})).then((function(t){return e.dataUrl=t}))}},render:function(){return this.$createElement("img",{domProps:r(r({},this.$attrs),{src:this.dataUrl})})}};e.LEVELS=n,e.MASK_PATTERNS=i,e.MODES=o,e.TYPES=a,e.default=u,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("qrcode")):"function"==typeof define&&define.amd?define(["exports","qrcode"],t):t((e=e||self).VueQrcode={},e.QRCode)}(this,(function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
var r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};var n=["low","medium","quartile","high","L","M","Q","H"],i=[0,1,2,3,4,5,6,7],o=["alphanumeric","numeric","kanji","byte"],a=["image/png","image/jpeg","image/webp"],u={props:{version:{type:Number,validator:function(e){return e===parseInt(String(e),10)&&e>=1&&e<=40}},errorCorrectionLevel:{type:String,validator:function(e){return n.includes(e)}},maskPattern:{type:Number,validator:function(e){return i.includes(e)}},toSJISFunc:Function,margin:Number,scale:Number,width:Number,color:{type:Object,validator:function(e){return["dark","light"].every((function(t){return["string","undefined"].includes(typeof e[t])}))}},type:{type:String,validator:function(e){return a.includes(e)}},quality:{type:Number,validator:function(e){return e===parseFloat(String(e))&&e>=0&&e<=1}},value:{type:[String,Array],required:!0,validator:function(e){return"string"==typeof e||e.every((function(e){var t=e.data,r=e.mode;return"string"==typeof t&&(null==r||o.includes(r))}))}}},data:function(){return{dataUrl:""}},watch:{$props:{deep:!0,immediate:!0,handler:"toDataURL"}},methods:{toDataURL:function(){var e=this,r=this.$props,n=r.quality,i=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(r,["quality"]);return t.toDataURL(this.value,Object.assign(i,null==n||{renderOptions:{quality:n}})).then((function(t){return e.dataUrl=t}))}},render:function(){return this.$createElement("img",{domProps:r(r({},this.$attrs),{src:this.dataUrl})})}};e.LEVELS=n,e.MASK_PATTERNS=i,e.MODES=o,e.TYPES=a,e.default=u,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "vue-qrcode", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "🤳 A Vue component for QR code generation with `qrcode`", | ||
@@ -30,4 +30,3 @@ "repository": "git@github.com:rx-ts/vue.git", | ||
}, | ||
"sideEffects": false, | ||
"gitHead": "ec6462b435ed6b6f6393256f7bb33dc32afe41cf" | ||
"sideEffects": false | ||
} |
@@ -23,3 +23,3 @@ import QRCode, { | ||
// eslint-disable-next-line @typescript-eslint/no-type-alias | ||
export type MaskPattern = (typeof MASK_PATTERNS)[number] | ||
export type MaskPattern = typeof MASK_PATTERNS[number] | ||
@@ -101,3 +101,3 @@ export const MODES = ['alphanumeric', 'numeric', 'kanji', 'byte'] as const | ||
return { | ||
dataUrl: null, | ||
dataUrl: '', | ||
} | ||
@@ -104,0 +104,0 @@ }, |
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
45917
863
15