Skip to content

Commit

Permalink
update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodeago committed Nov 30, 2019
1 parent 2093252 commit e30e22c
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 23 deletions.
38 changes: 31 additions & 7 deletions dist/vue-aspect-ratio.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-aspect-ratio v0.1.0
* vue-aspect-ratio v0.1.1
* (c) 2019 [email protected]
* Released under the MIT License.
*/
Expand Down Expand Up @@ -60,6 +60,12 @@ function _nonIterableRest() {
var script = {
name: "VueAspectRatio",
props: {
/**
* Aspect Ratio.
* String with the following pattern
* <aspect_ratio_width>:<aspect_ratio_height>
* Default is "1:1" meaning that the component will be a square
*/
ar: {
type: String,
default: "1:1",
Expand All @@ -73,7 +79,13 @@ var script = {

return !Number.isNaN(w) && !Number.isNaN(h);
}
}
},

/**
* Width to set to the component.
* Optional, if not set the width will be 100% like a normal "div" element
*/
width: String
},
data: function data() {
return {
Expand All @@ -84,15 +96,27 @@ var script = {
};
},
computed: {
/**
* Style for the outer div element, this can just set the width of the component itself
*/
componentStyle: function componentStyle() {
return this.width ? {
width: this.width
} : {};
},

/**
* Style for the inner div element, this will define the aspect ratio
*/
innerStyle: function innerStyle() {
// set the padding, this is actually what gives the aspect ratio
// set the padding top, this is actually what gives the aspect ratio
return {
paddingTop: this.h / this.w * 100 + "%"
};
}
},
created: function created() {
// set w and h data
// set w and h data parsing the ar prop
var _this$ar$split$map = this.ar.split(":").map(function (v) {
return parseInt(v);
}),
Expand Down Expand Up @@ -246,17 +270,17 @@ var browser = createInjector;
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vue-aspect-ratio"},[_c('div',{staticClass:"vue-aspect-ratio__inner",style:(_vm.innerStyle)},[_c('div',{staticClass:"vue-aspect-ratio__content"},[_vm._t("default")],2)])])};
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vue-aspect-ratio",style:(_vm.componentStyle)},[_c('div',{staticClass:"vue-aspect-ratio__inner",style:(_vm.innerStyle)},[_c('div',{staticClass:"vue-aspect-ratio__content"},[_vm._t("default")],2)])])};
var __vue_staticRenderFns__ = [];

/* style */
const __vue_inject_styles__ = function (inject) {
if (!inject) return
inject("data-v-69342252_0", { source: ".vue-aspect-ratio__inner[data-v-69342252]{position:relative}.vue-aspect-ratio__content[data-v-69342252]{position:absolute;top:0;left:0;width:100%;height:100%}", map: undefined, media: undefined });
inject("data-v-f0460d78_0", { source: ".vue-aspect-ratio__inner[data-v-f0460d78]{position:relative}.vue-aspect-ratio__content[data-v-f0460d78]{position:absolute;top:0;left:0;width:100%;height:100%}", map: undefined, media: undefined });

};
/* scoped */
const __vue_scope_id__ = "data-v-69342252";
const __vue_scope_id__ = "data-v-f0460d78";
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
Expand Down
38 changes: 31 additions & 7 deletions dist/vue-aspect-ratio.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-aspect-ratio v0.1.0
* vue-aspect-ratio v0.1.1
* (c) 2019 [email protected]
* Released under the MIT License.
*/
Expand Down Expand Up @@ -58,6 +58,12 @@ function _nonIterableRest() {
var script = {
name: "VueAspectRatio",
props: {
/**
* Aspect Ratio.
* String with the following pattern
* <aspect_ratio_width>:<aspect_ratio_height>
* Default is "1:1" meaning that the component will be a square
*/
ar: {
type: String,
default: "1:1",
Expand All @@ -71,7 +77,13 @@ var script = {

return !Number.isNaN(w) && !Number.isNaN(h);
}
}
},

/**
* Width to set to the component.
* Optional, if not set the width will be 100% like a normal "div" element
*/
width: String
},
data: function data() {
return {
Expand All @@ -82,15 +94,27 @@ var script = {
};
},
computed: {
/**
* Style for the outer div element, this can just set the width of the component itself
*/
componentStyle: function componentStyle() {
return this.width ? {
width: this.width
} : {};
},

/**
* Style for the inner div element, this will define the aspect ratio
*/
innerStyle: function innerStyle() {
// set the padding, this is actually what gives the aspect ratio
// set the padding top, this is actually what gives the aspect ratio
return {
paddingTop: this.h / this.w * 100 + "%"
};
}
},
created: function created() {
// set w and h data
// set w and h data parsing the ar prop
var _this$ar$split$map = this.ar.split(":").map(function (v) {
return parseInt(v);
}),
Expand Down Expand Up @@ -244,17 +268,17 @@ var browser = createInjector;
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vue-aspect-ratio"},[_c('div',{staticClass:"vue-aspect-ratio__inner",style:(_vm.innerStyle)},[_c('div',{staticClass:"vue-aspect-ratio__content"},[_vm._t("default")],2)])])};
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vue-aspect-ratio",style:(_vm.componentStyle)},[_c('div',{staticClass:"vue-aspect-ratio__inner",style:(_vm.innerStyle)},[_c('div',{staticClass:"vue-aspect-ratio__content"},[_vm._t("default")],2)])])};
var __vue_staticRenderFns__ = [];

/* style */
const __vue_inject_styles__ = function (inject) {
if (!inject) return
inject("data-v-69342252_0", { source: ".vue-aspect-ratio__inner[data-v-69342252]{position:relative}.vue-aspect-ratio__content[data-v-69342252]{position:absolute;top:0;left:0;width:100%;height:100%}", map: undefined, media: undefined });
inject("data-v-f0460d78_0", { source: ".vue-aspect-ratio__inner[data-v-f0460d78]{position:relative}.vue-aspect-ratio__content[data-v-f0460d78]{position:absolute;top:0;left:0;width:100%;height:100%}", map: undefined, media: undefined });

};
/* scoped */
const __vue_scope_id__ = "data-v-69342252";
const __vue_scope_id__ = "data-v-f0460d78";
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
Expand Down
38 changes: 31 additions & 7 deletions dist/vue-aspect-ratio.umd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-aspect-ratio v0.1.0
* vue-aspect-ratio v0.1.1
* (c) 2019 [email protected]
* Released under the MIT License.
*/
Expand Down Expand Up @@ -64,6 +64,12 @@
var script = {
name: "VueAspectRatio",
props: {
/**
* Aspect Ratio.
* String with the following pattern
* <aspect_ratio_width>:<aspect_ratio_height>
* Default is "1:1" meaning that the component will be a square
*/
ar: {
type: String,
default: "1:1",
Expand All @@ -77,7 +83,13 @@

return !Number.isNaN(w) && !Number.isNaN(h);
}
}
},

/**
* Width to set to the component.
* Optional, if not set the width will be 100% like a normal "div" element
*/
width: String
},
data: function data() {
return {
Expand All @@ -88,15 +100,27 @@
};
},
computed: {
/**
* Style for the outer div element, this can just set the width of the component itself
*/
componentStyle: function componentStyle() {
return this.width ? {
width: this.width
} : {};
},

/**
* Style for the inner div element, this will define the aspect ratio
*/
innerStyle: function innerStyle() {
// set the padding, this is actually what gives the aspect ratio
// set the padding top, this is actually what gives the aspect ratio
return {
paddingTop: this.h / this.w * 100 + "%"
};
}
},
created: function created() {
// set w and h data
// set w and h data parsing the ar prop
var _this$ar$split$map = this.ar.split(":").map(function (v) {
return parseInt(v);
}),
Expand Down Expand Up @@ -250,17 +274,17 @@
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vue-aspect-ratio"},[_c('div',{staticClass:"vue-aspect-ratio__inner",style:(_vm.innerStyle)},[_c('div',{staticClass:"vue-aspect-ratio__content"},[_vm._t("default")],2)])])};
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vue-aspect-ratio",style:(_vm.componentStyle)},[_c('div',{staticClass:"vue-aspect-ratio__inner",style:(_vm.innerStyle)},[_c('div',{staticClass:"vue-aspect-ratio__content"},[_vm._t("default")],2)])])};
var __vue_staticRenderFns__ = [];

/* style */
const __vue_inject_styles__ = function (inject) {
if (!inject) return
inject("data-v-69342252_0", { source: ".vue-aspect-ratio__inner[data-v-69342252]{position:relative}.vue-aspect-ratio__content[data-v-69342252]{position:absolute;top:0;left:0;width:100%;height:100%}", map: undefined, media: undefined });
inject("data-v-f0460d78_0", { source: ".vue-aspect-ratio__inner[data-v-f0460d78]{position:relative}.vue-aspect-ratio__content[data-v-f0460d78]{position:absolute;top:0;left:0;width:100%;height:100%}", map: undefined, media: undefined });

};
/* scoped */
const __vue_scope_id__ = "data-v-69342252";
const __vue_scope_id__ = "data-v-f0460d78";
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-aspect-ratio.umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e30e22c

Please sign in to comment.