Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vuejs-image-placeholder

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuejs-image-placeholder - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

2

dist/build.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["vuejs-image-placeholder"]=e():t["vuejs-image-placeholder"]=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=3)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{width:{type:Number,default:200},height:{type:Number,default:150},backgroundColour:{type:String,default:"#ccc"},borderColour:{type:String,default:"#333"},borderWidth:{type:Number,default:1},showRatio:{type:Boolean,default:!1},fontFamily:{type:String,default:"monospace, sans-serif"},fontColour:{type:String,default:"#333"},fontSize:{type:Number,default:14}},computed:{imgStyle:function(){return{fill:this.backgroundColour,stroke:this.borderColour,strokeWidth:this.borderWidth}},displayText:function(){return!1===this.showRatio?this.size:this.ratio},size:function(){return this.width+"x"+this.height},ratio:function(){var t=this.getSimplifiedRatio(this.width/this.height);return t.x+":"+t.y},internalWidth:function(){return this.width-2*this.borderWidth},internalHeight:function(){return this.height-2*this.borderWidth}},methods:{getSimplifiedRatio:function(t){var e=this.isNegative(t);e&&(t*=-1);for(var r=[0,1],i=[1,0],n=this.getMaxNumerator(t),o=t,s=void 0,u=NaN,a=2;a<1e3;a++){var f=Math.floor(o);if(r[a]=f*r[a-1]+r[a-2],Math.abs(r[a])>n)break;if(i[a]=f*i[a-1]+i[a-2],(s=r[a]/i[a])===u)break;if(s===t)break;u=s,o=1/(o-f)}return e&&(r[a]*=-1),{x:r[a],y:i[a]}},getMaxNumerator:function(t){var e=this.getScientificRatio(t);e=this.getDigits(e);var r=void 0,i=this.getNumDigitsPastDecimal(t,e);for(r=i;r>0&&e%2==0;r--)e/=2;for(r=i;r>0&&e%5==0;r--)e/=5;return e},isNegative:function(t){return t<0},getScientificRatio:function(t){var e=t.toString().indexOf("E");return-1===e&&(e=t.toString().indexOf("e")),-1===e?t.toString():t.toString().substring(0,e)},getDigits:function(t){var e=t.toString().indexOf(".");return-1===e?t:0===e?t.substring(1,t.length):e<t.length?t.substring(0,e)+t.substring(e+1,t.length):null},getNumDigitsPastDecimal:function(t,e){var r=e.toString().length,i=t.toString().length;return 0===t&&(i=0),r-i}}}},function(t,e){t.exports=function(t,e,r,i,n){var o,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(o=t,s=t.default);var a="function"==typeof s?s.options:s;e&&(a.render=e.render,a.staticRenderFns=e.staticRenderFns),i&&(a._scopeId=i);var f;if(n?(f=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},a._ssrRegister=f):r&&(f=r),f){var d=a.functional,l=d?a.render:a.beforeCreate;d?a.render=function(t,e){return f.call(e),l(t,e)}:a.beforeCreate=l?[].concat(l,f):[f]}return{esModule:o,exports:s,options:a}}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height}},[r("rect",{style:t.imgStyle,attrs:{x:t.borderWidth,y:t.borderWidth,width:t.internalWidth,height:t.internalHeight}}),t._v(" "),r("text",{attrs:{x:"50%",y:"50%","font-size":t.fontSize,"font-family":t.fontFamily,fill:t.fontColour,"text-anchor":"middle","alignment-baseline":"middle"}},[t._t("default",[t._v(t._s(t.displayText))])],2)])},staticRenderFns:[]}},function(t,e,r){var i=r(1)(r(0),r(2),null,null,null);t.exports=i.exports}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["vuejs-image-placeholder"]=e():t["vuejs-image-placeholder"]=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=3)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{width:{type:Number,default:200},height:{type:Number,default:150},percentWidth:Boolean,percentHeight:Boolean,backgroundColour:{type:String,default:"#ccc"},borderColour:{type:String,default:"#333"},borderWidth:{type:Number,default:1},showRatio:{type:Boolean,default:!1},fontFamily:{type:String,default:"monospace, sans-serif"},fontColour:{type:String,default:"#333"},fontSize:{type:Number,default:14}},computed:{imgStyle:function(){return{fill:this.backgroundColour,outlineColor:this.borderColour,outlineStyle:"solid",outlineWidth:this.borderWidth+"px",outlineOffset:-1*this.borderWidth+"px"}},displayText:function(){return!1===this.showRatio?this.size:this.ratio},imgWidth:function(){return this.percentWidth?this.width+"%":this.width},imgHeight:function(){return this.percentHeight?this.height+"%":this.height},size:function(){return this.width+(this.percentWidth?"%":"")+"x"+this.height+(this.percentHeight?"%":"")},ratio:function(){var t=this.getSimplifiedRatio(this.width/this.height);return t.x+":"+t.y},internalWidth:function(){return this.percentWidth?this.width+"%":this.width-2*this.borderWidth},internalHeight:function(){return this.percentHeight?this.height+"%":this.height-2*this.borderWidth},textPosition:function(){return{x:this.percentWidth?this.width/2+"%":"50%",y:this.percentHeight?this.height/2+"%":"50%"}}},methods:{getSimplifiedRatio:function(t){var e=this.isNegative(t);e&&(t*=-1);for(var i=[0,1],n=[1,0],r=this.getMaxNumerator(t),o=t,s=void 0,u=NaN,h=2;h<1e3;h++){var a=Math.floor(o);if(i[h]=a*i[h-1]+i[h-2],Math.abs(i[h])>r)break;if(n[h]=a*n[h-1]+n[h-2],(s=i[h]/n[h])===u)break;if(s===t)break;u=s,o=1/(o-a)}return e&&(i[h]*=-1),{x:i[h],y:n[h]}},getMaxNumerator:function(t){var e=this.getScientificRatio(t);e=this.getDigits(e);var i=void 0,n=this.getNumDigitsPastDecimal(t,e);for(i=n;i>0&&e%2==0;i--)e/=2;for(i=n;i>0&&e%5==0;i--)e/=5;return e},isNegative:function(t){return t<0},getScientificRatio:function(t){var e=t.toString().indexOf("E");return-1===e&&(e=t.toString().indexOf("e")),-1===e?t.toString():t.toString().substring(0,e)},getDigits:function(t){var e=t.toString().indexOf(".");return-1===e?t:0===e?t.substring(1,t.length):e<t.length?t.substring(0,e)+t.substring(e+1,t.length):null},getNumDigitsPastDecimal:function(t,e){var i=e.toString().length,n=t.toString().length;return 0===t&&(n=0),i-n}}}},function(t,e){t.exports=function(t,e,i,n,r){var o,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(o=t,s=t.default);var h="function"==typeof s?s.options:s;e&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns),n&&(h._scopeId=n);var a;if(r?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},h._ssrRegister=a):i&&(a=i),a){var f=h.functional,d=f?h.render:h.beforeCreate;f?h.render=function(t,e){return a.call(e),d(t,e)}:h.beforeCreate=d?[].concat(d,a):[a]}return{esModule:o,exports:s,options:h}}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"}},[i("rect",{style:t.imgStyle,attrs:{width:t.imgWidth,height:t.imgHeight}}),t._v(" "),i("text",{attrs:{x:t.textPosition.x,y:t.textPosition.y,"font-size":t.fontSize,"font-family":t.fontFamily,fill:t.fontColour,"text-anchor":"middle","alignment-baseline":"middle"}},[t._t("default",[t._v(t._s(t.displayText))])],2)])},staticRenderFns:[]}},function(t,e,i){var n=i(1)(i(0),i(2),null,null,null);t.exports=n.exports}])});
//# sourceMappingURL=build.js.map
{
"name": "vuejs-image-placeholder",
"version": "0.1.1",
"version": "0.2.0",
"description": "Svg image placeholder",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc