From f7ac6c274fdf6e7536959c990d8ff0cc73c7341f Mon Sep 17 00:00:00 2001 From: Daniel Diekmeier Date: Fri, 15 Mar 2019 11:31:22 +0100 Subject: [PATCH] Ugh --- dist/vue-slide-up-down.js | 2 +- dist/vue-slide-up-down.js.map | 2 +- dist/vue-slide-up-down.m.js | 2 +- dist/vue-slide-up-down.m.js.map | 2 +- dist/vue-slide-up-down.umd.js | 2 +- dist/vue-slide-up-down.umd.js.map | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/vue-slide-up-down.js b/dist/vue-slide-up-down.js index 3633011..cc9e242 100644 --- a/dist/vue-slide-up-down.js +++ b/dist/vue-slide-up-down.js @@ -1,2 +1,2 @@ -var t={name:"SlideUpDown",props:{active:Boolean,duration:{type:Number,default:500},tag:{type:String,default:"div"}},data:function(){return{style:{},initial:!1}},watch:{active:function(){this.layout()}},render:function(t){return t(this.tag,{style:this.style,ref:"container"},this.$slots.default)},mounted:function(){var t=this;this.el.addEventListener("transitionend",function(){t.style=t.active?{}:{height:"0",overflow:"hidden"}}),this.layout(),this.initial=!0},computed:{el:function(){return this.$refs.container}},methods:{layout:function(){var t=this;this.active?this.initial&&this.setHeight("0px",function(){return t.el.scrollHeight+"px"}):this.setHeight(this.el.scrollHeight+"px",function(){return"0px"})},asap:function(t){this.initial?this.$nextTick(t):t()},setHeight:function(t,i){var e=this;this.style={height:t},this.asap(function(){e.__=e.el.scrollHeight,e.style={height:i(),overflow:"hidden","transition-property":"height","transition-duration":e.duration+"ms"}})}}};module.exports=t; +var t={name:"SlideUpDown",props:{active:Boolean,duration:{type:Number,default:500},tag:{type:String,default:"div"}},data:function(){return{style:{},initial:!1,hidden:!(void 0).active}},watch:{active:function(){this.layout()}},render:function(t){return t(this.tag,{style:this.style,ref:"container",attrs:{hidden:this.hidden},on:{transitionend:this.onTransitionEnd}},this.$slots.default)},mounted:function(){this.layout(),this.initial=!0},computed:{el:function(){return this.$refs.container}},methods:{layout:function(){var t=this;this.active?(this.hidden=!1,this.$emit("open-start"),this.initial&&this.setHeight("0px",function(){return t.el.scrollHeight+"px"})):(this.$emit("close-start"),this.setHeight(this.el.scrollHeight+"px",function(){return"0px"}))},asap:function(t){this.initial?this.$nextTick(t):t()},setHeight:function(t,i){var e=this;this.style={height:t},this.asap(function(){e.__=e.el.scrollHeight,e.style={height:i(),overflow:"hidden","transition-property":"height","transition-duration":e.duration+"ms"}})},onTransitionEnd:function(){this.active?(this.style={},this.$emit("open-end")):(this.style={height:"0",overflow:"hidden"},this.hidden=!0,this.$emit("close-end"))}}};module.exports=t; //# sourceMappingURL=vue-slide-up-down.js.map diff --git a/dist/vue-slide-up-down.js.map b/dist/vue-slide-up-down.js.map index 23f9a51..d150e45 100644 --- a/dist/vue-slide-up-down.js.map +++ b/dist/vue-slide-up-down.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-slide-up-down.js","sources":["../src/slide-up-down.js"],"sourcesContent":["export default {\n name: 'SlideUpDown',\n\n props: {\n active: Boolean,\n duration: {\n type: Number,\n default: 500\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n\n data: () => ({\n style: {},\n initial: false\n }),\n\n watch: {\n active () {\n this.layout()\n }\n },\n\n render (h) {\n return h(\n this.tag,\n {\n style: this.style,\n ref: 'container'\n },\n this.$slots.default\n )\n },\n\n mounted () {\n this.el.addEventListener('transitionend', () => {\n if (this.active) {\n this.style = {}\n } else {\n this.style = {\n height: '0',\n overflow: 'hidden'\n }\n }\n })\n this.layout()\n this.initial = true\n },\n\n computed: {\n el () {\n return this.$refs.container\n }\n },\n\n methods: {\n layout () {\n if (this.active) {\n if (this.initial) {\n this.setHeight('0px', () => this.el.scrollHeight + 'px')\n }\n } else {\n this.setHeight(this.el.scrollHeight + 'px', () => '0px')\n }\n },\n\n asap (callback) {\n if (!this.initial) {\n callback()\n } else {\n this.$nextTick(callback)\n }\n },\n\n setHeight (temp, afterRelayout) {\n this.style = { height: temp }\n\n this.asap(() => {\n // force relayout so the animation will run\n this.__ = this.el.scrollHeight\n\n this.style = {\n height: afterRelayout(),\n overflow: 'hidden',\n 'transition-property': 'height',\n 'transition-duration': this.duration + 'ms'\n }\n })\n }\n }\n}\n"],"names":["name","props","active","Boolean","duration","type","Number","default","tag","String","data","style","initial","watch","layout","render","h","this","ref","$slots","mounted","el","addEventListener","height","overflow","computed","$refs","container","methods","setHeight","scrollHeight","asap","callback","$nextTick","temp","afterRelayout","__"],"mappings":"AAAA,MAAe,CACbA,KAAM,cAENC,MAAO,CACLC,OAAQC,QACRC,SAAU,CACRC,KAAMC,OACNC,QAAS,KAEXC,IAAK,CACHH,KAAMI,OACNF,QAAS,QAIbG,uBACEC,MAAO,GACPC,SAAS,IAGXC,MAAO,CACLX,uBACOY,WAITC,gBAAQC,UACCA,EACLC,KAAKT,IACL,CACEG,MAAOM,KAAKN,MACZO,IAAK,aAEPD,KAAKE,OAAOZ,UAIhBa,mCACOC,GAAGC,iBAAiB,6BAEhBX,MADHM,EAAKf,OACM,GAEA,CACXqB,OAAQ,IACRC,SAAU,iBAIXV,cACAF,SAAU,GAGjBa,SAAU,CACRJ,qBACSJ,KAAKS,MAAMC,YAItBC,QAAS,CACPd,6BACMG,KAAKf,OACHe,KAAKL,cACFiB,UAAU,wBAAaZ,EAAKI,GAAGS,aAAe,YAGhDD,UAAUZ,KAAKI,GAAGS,aAAe,sBAAY,SAItDC,cAAMC,GACCf,KAAKL,aAGHqB,UAAUD,GAFfA,KAMJH,mBAAWK,EAAMC,mBACVxB,MAAQ,CAAEY,OAAQW,QAElBH,kBAEEK,GAAKnB,EAAKI,GAAGS,eAEbnB,MAAQ,CACXY,OAAQY,IACRX,SAAU,+BACa,+BACAP,EAAKb,SAAW"} \ No newline at end of file +{"version":3,"file":"vue-slide-up-down.js","sources":["../src/slide-up-down.js"],"sourcesContent":["export default {\n name: 'SlideUpDown',\n\n props: {\n active: Boolean,\n duration: {\n type: Number,\n default: 500\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n\n data: () => ({\n style: {},\n initial: false,\n hidden: !this.active\n }),\n\n watch: {\n active () {\n this.layout()\n }\n },\n\n render (h) {\n return h(\n this.tag,\n {\n style: this.style,\n ref: 'container',\n attrs: { hidden: this.hidden },\n on: { transitionend: this.onTransitionEnd }\n },\n this.$slots.default\n )\n },\n\n mounted () {\n this.layout()\n this.initial = true\n },\n\n computed: {\n el () {\n return this.$refs.container\n }\n },\n\n methods: {\n layout () {\n if (this.active) {\n this.hidden = false\n this.$emit('open-start')\n if (this.initial) {\n this.setHeight('0px', () => this.el.scrollHeight + 'px')\n }\n } else {\n this.$emit('close-start')\n this.setHeight(this.el.scrollHeight + 'px', () => '0px')\n }\n },\n\n asap (callback) {\n if (!this.initial) {\n callback()\n } else {\n this.$nextTick(callback)\n }\n },\n\n setHeight (temp, afterRelayout) {\n this.style = { height: temp }\n\n this.asap(() => {\n // force relayout so the animation will run\n this.__ = this.el.scrollHeight\n\n this.style = {\n height: afterRelayout(),\n overflow: 'hidden',\n 'transition-property': 'height',\n 'transition-duration': this.duration + 'ms'\n }\n })\n },\n\n onTransitionEnd () {\n if (this.active) {\n this.style = {}\n this.$emit('open-end')\n } else {\n this.style = {\n height: '0',\n overflow: 'hidden'\n }\n this.hidden = true\n this.$emit('close-end')\n }\n }\n }\n}\n"],"names":["name","props","active","Boolean","duration","type","Number","default","tag","String","data","style","initial","hidden","watch","layout","render","h","this","ref","attrs","on","transitionend","onTransitionEnd","$slots","mounted","computed","el","$refs","container","methods","$emit","setHeight","scrollHeight","asap","callback","$nextTick","temp","afterRelayout","height","__","overflow"],"mappings":"MAAe,CACbA,KAAM,cAENC,MAAO,CACLC,OAAQC,QACRC,SAAU,CACRC,KAAMC,OACNC,QAAS,KAEXC,IAAK,CACHH,KAAMI,OACNF,QAAS,QAIbG,uBACEC,MAAO,GACPC,SAAS,EACTC,iBAAcX,SAGhBY,MAAO,CACLZ,uBACOa,WAITC,gBAAQC,UACCA,EACLC,KAAKV,IACL,CACEG,MAAOO,KAAKP,MACZQ,IAAK,YACLC,MAAO,CAAEP,OAAQK,KAAKL,QACtBQ,GAAI,CAAEC,cAAeJ,KAAKK,kBAE5BL,KAAKM,OAAOjB,UAIhBkB,wBACOV,cACAH,SAAU,GAGjBc,SAAU,CACRC,qBACST,KAAKU,MAAMC,YAItBC,QAAS,CACPf,6BACMG,KAAKhB,aACFW,QAAS,OACTkB,MAAM,cACPb,KAAKN,cACFoB,UAAU,wBAAad,EAAKS,GAAGM,aAAe,cAGhDF,MAAM,oBACNC,UAAUd,KAAKS,GAAGM,aAAe,sBAAY,UAItDC,cAAMC,GACCjB,KAAKN,aAGHwB,UAAUD,GAFfA,KAMJH,mBAAWK,EAAMC,mBACV3B,MAAQ,CAAE4B,OAAQF,QAElBH,kBAEEM,GAAKtB,EAAKS,GAAGM,eAEbtB,MAAQ,CACX4B,OAAQD,IACRG,SAAU,+BACa,+BACAvB,EAAKd,SAAW,SAK7CmB,2BACML,KAAKhB,aACFS,MAAQ,QACRoB,MAAM,mBAENpB,MAAQ,CACX4B,OAAQ,IACRE,SAAU,eAEP5B,QAAS,OACTkB,MAAM"} \ No newline at end of file diff --git a/dist/vue-slide-up-down.m.js b/dist/vue-slide-up-down.m.js index a719a28..d8c3a85 100644 --- a/dist/vue-slide-up-down.m.js +++ b/dist/vue-slide-up-down.m.js @@ -1,2 +1,2 @@ -export default{name:"SlideUpDown",props:{active:Boolean,duration:{type:Number,default:500},tag:{type:String,default:"div"}},data:function(){return{style:{},initial:!1}},watch:{active:function(){this.layout()}},render:function(t){return t(this.tag,{style:this.style,ref:"container"},this.$slots.default)},mounted:function(){var t=this;this.el.addEventListener("transitionend",function(){t.style=t.active?{}:{height:"0",overflow:"hidden"}}),this.layout(),this.initial=!0},computed:{el:function(){return this.$refs.container}},methods:{layout:function(){var t=this;this.active?this.initial&&this.setHeight("0px",function(){return t.el.scrollHeight+"px"}):this.setHeight(this.el.scrollHeight+"px",function(){return"0px"})},asap:function(t){this.initial?this.$nextTick(t):t()},setHeight:function(t,i){var e=this;this.style={height:t},this.asap(function(){e.__=e.el.scrollHeight,e.style={height:i(),overflow:"hidden","transition-property":"height","transition-duration":e.duration+"ms"}})}}}; +export default{name:"SlideUpDown",props:{active:Boolean,duration:{type:Number,default:500},tag:{type:String,default:"div"}},data:function(){return{style:{},initial:!1,hidden:!(void 0).active}},watch:{active:function(){this.layout()}},render:function(t){return t(this.tag,{style:this.style,ref:"container",attrs:{hidden:this.hidden},on:{transitionend:this.onTransitionEnd}},this.$slots.default)},mounted:function(){this.layout(),this.initial=!0},computed:{el:function(){return this.$refs.container}},methods:{layout:function(){var t=this;this.active?(this.hidden=!1,this.$emit("open-start"),this.initial&&this.setHeight("0px",function(){return t.el.scrollHeight+"px"})):(this.$emit("close-start"),this.setHeight(this.el.scrollHeight+"px",function(){return"0px"}))},asap:function(t){this.initial?this.$nextTick(t):t()},setHeight:function(t,i){var e=this;this.style={height:t},this.asap(function(){e.__=e.el.scrollHeight,e.style={height:i(),overflow:"hidden","transition-property":"height","transition-duration":e.duration+"ms"}})},onTransitionEnd:function(){this.active?(this.style={},this.$emit("open-end")):(this.style={height:"0",overflow:"hidden"},this.hidden=!0,this.$emit("close-end"))}}}; //# sourceMappingURL=vue-slide-up-down.m.js.map diff --git a/dist/vue-slide-up-down.m.js.map b/dist/vue-slide-up-down.m.js.map index 75deb96..ee64401 100644 --- a/dist/vue-slide-up-down.m.js.map +++ b/dist/vue-slide-up-down.m.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-slide-up-down.m.js","sources":["../src/slide-up-down.js"],"sourcesContent":["export default {\n name: 'SlideUpDown',\n\n props: {\n active: Boolean,\n duration: {\n type: Number,\n default: 500\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n\n data: () => ({\n style: {},\n initial: false\n }),\n\n watch: {\n active () {\n this.layout()\n }\n },\n\n render (h) {\n return h(\n this.tag,\n {\n style: this.style,\n ref: 'container'\n },\n this.$slots.default\n )\n },\n\n mounted () {\n this.el.addEventListener('transitionend', () => {\n if (this.active) {\n this.style = {}\n } else {\n this.style = {\n height: '0',\n overflow: 'hidden'\n }\n }\n })\n this.layout()\n this.initial = true\n },\n\n computed: {\n el () {\n return this.$refs.container\n }\n },\n\n methods: {\n layout () {\n if (this.active) {\n if (this.initial) {\n this.setHeight('0px', () => this.el.scrollHeight + 'px')\n }\n } else {\n this.setHeight(this.el.scrollHeight + 'px', () => '0px')\n }\n },\n\n asap (callback) {\n if (!this.initial) {\n callback()\n } else {\n this.$nextTick(callback)\n }\n },\n\n setHeight (temp, afterRelayout) {\n this.style = { height: temp }\n\n this.asap(() => {\n // force relayout so the animation will run\n this.__ = this.el.scrollHeight\n\n this.style = {\n height: afterRelayout(),\n overflow: 'hidden',\n 'transition-property': 'height',\n 'transition-duration': this.duration + 'ms'\n }\n })\n }\n }\n}\n"],"names":["name","props","active","Boolean","duration","type","Number","default","tag","String","data","style","initial","watch","layout","render","h","this","ref","$slots","mounted","el","addEventListener","height","overflow","computed","$refs","container","methods","setHeight","scrollHeight","asap","callback","$nextTick","temp","afterRelayout","__"],"mappings":"cAAe,CACbA,KAAM,cAENC,MAAO,CACLC,OAAQC,QACRC,SAAU,CACRC,KAAMC,OACNC,QAAS,KAEXC,IAAK,CACHH,KAAMI,OACNF,QAAS,QAIbG,uBACEC,MAAO,GACPC,SAAS,IAGXC,MAAO,CACLX,uBACOY,WAITC,gBAAQC,UACCA,EACLC,KAAKT,IACL,CACEG,MAAOM,KAAKN,MACZO,IAAK,aAEPD,KAAKE,OAAOZ,UAIhBa,mCACOC,GAAGC,iBAAiB,6BAEhBX,MADHM,EAAKf,OACM,GAEA,CACXqB,OAAQ,IACRC,SAAU,iBAIXV,cACAF,SAAU,GAGjBa,SAAU,CACRJ,qBACSJ,KAAKS,MAAMC,YAItBC,QAAS,CACPd,6BACMG,KAAKf,OACHe,KAAKL,cACFiB,UAAU,wBAAaZ,EAAKI,GAAGS,aAAe,YAGhDD,UAAUZ,KAAKI,GAAGS,aAAe,sBAAY,SAItDC,cAAMC,GACCf,KAAKL,aAGHqB,UAAUD,GAFfA,KAMJH,mBAAWK,EAAMC,mBACVxB,MAAQ,CAAEY,OAAQW,QAElBH,kBAEEK,GAAKnB,EAAKI,GAAGS,eAEbnB,MAAQ,CACXY,OAAQY,IACRX,SAAU,+BACa,+BACAP,EAAKb,SAAW"} \ No newline at end of file +{"version":3,"file":"vue-slide-up-down.m.js","sources":["../src/slide-up-down.js"],"sourcesContent":["export default {\n name: 'SlideUpDown',\n\n props: {\n active: Boolean,\n duration: {\n type: Number,\n default: 500\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n\n data: () => ({\n style: {},\n initial: false,\n hidden: !this.active\n }),\n\n watch: {\n active () {\n this.layout()\n }\n },\n\n render (h) {\n return h(\n this.tag,\n {\n style: this.style,\n ref: 'container',\n attrs: { hidden: this.hidden },\n on: { transitionend: this.onTransitionEnd }\n },\n this.$slots.default\n )\n },\n\n mounted () {\n this.layout()\n this.initial = true\n },\n\n computed: {\n el () {\n return this.$refs.container\n }\n },\n\n methods: {\n layout () {\n if (this.active) {\n this.hidden = false\n this.$emit('open-start')\n if (this.initial) {\n this.setHeight('0px', () => this.el.scrollHeight + 'px')\n }\n } else {\n this.$emit('close-start')\n this.setHeight(this.el.scrollHeight + 'px', () => '0px')\n }\n },\n\n asap (callback) {\n if (!this.initial) {\n callback()\n } else {\n this.$nextTick(callback)\n }\n },\n\n setHeight (temp, afterRelayout) {\n this.style = { height: temp }\n\n this.asap(() => {\n // force relayout so the animation will run\n this.__ = this.el.scrollHeight\n\n this.style = {\n height: afterRelayout(),\n overflow: 'hidden',\n 'transition-property': 'height',\n 'transition-duration': this.duration + 'ms'\n }\n })\n },\n\n onTransitionEnd () {\n if (this.active) {\n this.style = {}\n this.$emit('open-end')\n } else {\n this.style = {\n height: '0',\n overflow: 'hidden'\n }\n this.hidden = true\n this.$emit('close-end')\n }\n }\n }\n}\n"],"names":["name","props","active","Boolean","duration","type","Number","default","tag","String","data","style","initial","hidden","watch","layout","render","h","this","ref","attrs","on","transitionend","onTransitionEnd","$slots","mounted","computed","el","$refs","container","methods","$emit","setHeight","scrollHeight","asap","callback","$nextTick","temp","afterRelayout","height","__","overflow"],"mappings":"cAAe,CACbA,KAAM,cAENC,MAAO,CACLC,OAAQC,QACRC,SAAU,CACRC,KAAMC,OACNC,QAAS,KAEXC,IAAK,CACHH,KAAMI,OACNF,QAAS,QAIbG,uBACEC,MAAO,GACPC,SAAS,EACTC,iBAAcX,SAGhBY,MAAO,CACLZ,uBACOa,WAITC,gBAAQC,UACCA,EACLC,KAAKV,IACL,CACEG,MAAOO,KAAKP,MACZQ,IAAK,YACLC,MAAO,CAAEP,OAAQK,KAAKL,QACtBQ,GAAI,CAAEC,cAAeJ,KAAKK,kBAE5BL,KAAKM,OAAOjB,UAIhBkB,wBACOV,cACAH,SAAU,GAGjBc,SAAU,CACRC,qBACST,KAAKU,MAAMC,YAItBC,QAAS,CACPf,6BACMG,KAAKhB,aACFW,QAAS,OACTkB,MAAM,cACPb,KAAKN,cACFoB,UAAU,wBAAad,EAAKS,GAAGM,aAAe,cAGhDF,MAAM,oBACNC,UAAUd,KAAKS,GAAGM,aAAe,sBAAY,UAItDC,cAAMC,GACCjB,KAAKN,aAGHwB,UAAUD,GAFfA,KAMJH,mBAAWK,EAAMC,mBACV3B,MAAQ,CAAE4B,OAAQF,QAElBH,kBAEEM,GAAKtB,EAAKS,GAAGM,eAEbtB,MAAQ,CACX4B,OAAQD,IACRG,SAAU,+BACa,+BACAvB,EAAKd,SAAW,SAK7CmB,2BACML,KAAKhB,aACFS,MAAQ,QACRoB,MAAM,mBAENpB,MAAQ,CACX4B,OAAQ,IACRE,SAAU,eAEP5B,QAAS,OACTkB,MAAM"} \ No newline at end of file diff --git a/dist/vue-slide-up-down.umd.js b/dist/vue-slide-up-down.umd.js index 0de0753..d19518c 100644 --- a/dist/vue-slide-up-down.umd.js +++ b/dist/vue-slide-up-down.umd.js @@ -1,2 +1,2 @@ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.VueSlideUpDown=i()}(this,function(){return{name:"SlideUpDown",props:{active:Boolean,duration:{type:Number,default:500},tag:{type:String,default:"div"}},data:function(){return{style:{},initial:!1}},watch:{active:function(){this.layout()}},render:function(t){return t(this.tag,{style:this.style,ref:"container"},this.$slots.default)},mounted:function(){var t=this;this.el.addEventListener("transitionend",function(){t.style=t.active?{}:{height:"0",overflow:"hidden"}}),this.layout(),this.initial=!0},computed:{el:function(){return this.$refs.container}},methods:{layout:function(){var t=this;this.active?this.initial&&this.setHeight("0px",function(){return t.el.scrollHeight+"px"}):this.setHeight(this.el.scrollHeight+"px",function(){return"0px"})},asap:function(t){this.initial?this.$nextTick(t):t()},setHeight:function(t,i){var e=this;this.style={height:t},this.asap(function(){e.__=e.el.scrollHeight,e.style={height:i(),overflow:"hidden","transition-property":"height","transition-duration":e.duration+"ms"}})}}}}); +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.VueSlideUpDown=i()}(this,function(){return{name:"SlideUpDown",props:{active:Boolean,duration:{type:Number,default:500},tag:{type:String,default:"div"}},data:function(){return{style:{},initial:!1,hidden:!(void 0).active}},watch:{active:function(){this.layout()}},render:function(t){return t(this.tag,{style:this.style,ref:"container",attrs:{hidden:this.hidden},on:{transitionend:this.onTransitionEnd}},this.$slots.default)},mounted:function(){this.layout(),this.initial=!0},computed:{el:function(){return this.$refs.container}},methods:{layout:function(){var t=this;this.active?(this.hidden=!1,this.$emit("open-start"),this.initial&&this.setHeight("0px",function(){return t.el.scrollHeight+"px"})):(this.$emit("close-start"),this.setHeight(this.el.scrollHeight+"px",function(){return"0px"}))},asap:function(t){this.initial?this.$nextTick(t):t()},setHeight:function(t,i){var e=this;this.style={height:t},this.asap(function(){e.__=e.el.scrollHeight,e.style={height:i(),overflow:"hidden","transition-property":"height","transition-duration":e.duration+"ms"}})},onTransitionEnd:function(){this.active?(this.style={},this.$emit("open-end")):(this.style={height:"0",overflow:"hidden"},this.hidden=!0,this.$emit("close-end"))}}}}); //# sourceMappingURL=vue-slide-up-down.umd.js.map diff --git a/dist/vue-slide-up-down.umd.js.map b/dist/vue-slide-up-down.umd.js.map index 4b0d80a..35113eb 100644 --- a/dist/vue-slide-up-down.umd.js.map +++ b/dist/vue-slide-up-down.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-slide-up-down.umd.js","sources":["../src/slide-up-down.js"],"sourcesContent":["export default {\n name: 'SlideUpDown',\n\n props: {\n active: Boolean,\n duration: {\n type: Number,\n default: 500\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n\n data: () => ({\n style: {},\n initial: false\n }),\n\n watch: {\n active () {\n this.layout()\n }\n },\n\n render (h) {\n return h(\n this.tag,\n {\n style: this.style,\n ref: 'container'\n },\n this.$slots.default\n )\n },\n\n mounted () {\n this.el.addEventListener('transitionend', () => {\n if (this.active) {\n this.style = {}\n } else {\n this.style = {\n height: '0',\n overflow: 'hidden'\n }\n }\n })\n this.layout()\n this.initial = true\n },\n\n computed: {\n el () {\n return this.$refs.container\n }\n },\n\n methods: {\n layout () {\n if (this.active) {\n if (this.initial) {\n this.setHeight('0px', () => this.el.scrollHeight + 'px')\n }\n } else {\n this.setHeight(this.el.scrollHeight + 'px', () => '0px')\n }\n },\n\n asap (callback) {\n if (!this.initial) {\n callback()\n } else {\n this.$nextTick(callback)\n }\n },\n\n setHeight (temp, afterRelayout) {\n this.style = { height: temp }\n\n this.asap(() => {\n // force relayout so the animation will run\n this.__ = this.el.scrollHeight\n\n this.style = {\n height: afterRelayout(),\n overflow: 'hidden',\n 'transition-property': 'height',\n 'transition-duration': this.duration + 'ms'\n }\n })\n }\n }\n}\n"],"names":["name","props","active","Boolean","duration","type","Number","default","tag","String","data","style","initial","watch","layout","render","h","this","ref","$slots","mounted","el","addEventListener","height","overflow","computed","$refs","container","methods","setHeight","scrollHeight","asap","callback","$nextTick","temp","afterRelayout","__"],"mappings":"mLAAe,CACbA,KAAM,cAENC,MAAO,CACLC,OAAQC,QACRC,SAAU,CACRC,KAAMC,OACNC,QAAS,KAEXC,IAAK,CACHH,KAAMI,OACNF,QAAS,QAIbG,uBACEC,MAAO,GACPC,SAAS,IAGXC,MAAO,CACLX,uBACOY,WAITC,gBAAQC,UACCA,EACLC,KAAKT,IACL,CACEG,MAAOM,KAAKN,MACZO,IAAK,aAEPD,KAAKE,OAAOZ,UAIhBa,mCACOC,GAAGC,iBAAiB,6BAEhBX,MADHM,EAAKf,OACM,GAEA,CACXqB,OAAQ,IACRC,SAAU,iBAIXV,cACAF,SAAU,GAGjBa,SAAU,CACRJ,qBACSJ,KAAKS,MAAMC,YAItBC,QAAS,CACPd,6BACMG,KAAKf,OACHe,KAAKL,cACFiB,UAAU,wBAAaZ,EAAKI,GAAGS,aAAe,YAGhDD,UAAUZ,KAAKI,GAAGS,aAAe,sBAAY,SAItDC,cAAMC,GACCf,KAAKL,aAGHqB,UAAUD,GAFfA,KAMJH,mBAAWK,EAAMC,mBACVxB,MAAQ,CAAEY,OAAQW,QAElBH,kBAEEK,GAAKnB,EAAKI,GAAGS,eAEbnB,MAAQ,CACXY,OAAQY,IACRX,SAAU,+BACa,+BACAP,EAAKb,SAAW"} \ No newline at end of file +{"version":3,"file":"vue-slide-up-down.umd.js","sources":["../src/slide-up-down.js"],"sourcesContent":["export default {\n name: 'SlideUpDown',\n\n props: {\n active: Boolean,\n duration: {\n type: Number,\n default: 500\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n\n data: () => ({\n style: {},\n initial: false,\n hidden: !this.active\n }),\n\n watch: {\n active () {\n this.layout()\n }\n },\n\n render (h) {\n return h(\n this.tag,\n {\n style: this.style,\n ref: 'container',\n attrs: { hidden: this.hidden },\n on: { transitionend: this.onTransitionEnd }\n },\n this.$slots.default\n )\n },\n\n mounted () {\n this.layout()\n this.initial = true\n },\n\n computed: {\n el () {\n return this.$refs.container\n }\n },\n\n methods: {\n layout () {\n if (this.active) {\n this.hidden = false\n this.$emit('open-start')\n if (this.initial) {\n this.setHeight('0px', () => this.el.scrollHeight + 'px')\n }\n } else {\n this.$emit('close-start')\n this.setHeight(this.el.scrollHeight + 'px', () => '0px')\n }\n },\n\n asap (callback) {\n if (!this.initial) {\n callback()\n } else {\n this.$nextTick(callback)\n }\n },\n\n setHeight (temp, afterRelayout) {\n this.style = { height: temp }\n\n this.asap(() => {\n // force relayout so the animation will run\n this.__ = this.el.scrollHeight\n\n this.style = {\n height: afterRelayout(),\n overflow: 'hidden',\n 'transition-property': 'height',\n 'transition-duration': this.duration + 'ms'\n }\n })\n },\n\n onTransitionEnd () {\n if (this.active) {\n this.style = {}\n this.$emit('open-end')\n } else {\n this.style = {\n height: '0',\n overflow: 'hidden'\n }\n this.hidden = true\n this.$emit('close-end')\n }\n }\n }\n}\n"],"names":["name","props","active","Boolean","duration","type","Number","default","tag","String","data","style","initial","hidden","watch","layout","render","h","this","ref","attrs","on","transitionend","onTransitionEnd","$slots","mounted","computed","el","$refs","container","methods","$emit","setHeight","scrollHeight","asap","callback","$nextTick","temp","afterRelayout","height","__","overflow"],"mappings":"mLAAe,CACbA,KAAM,cAENC,MAAO,CACLC,OAAQC,QACRC,SAAU,CACRC,KAAMC,OACNC,QAAS,KAEXC,IAAK,CACHH,KAAMI,OACNF,QAAS,QAIbG,uBACEC,MAAO,GACPC,SAAS,EACTC,iBAAcX,SAGhBY,MAAO,CACLZ,uBACOa,WAITC,gBAAQC,UACCA,EACLC,KAAKV,IACL,CACEG,MAAOO,KAAKP,MACZQ,IAAK,YACLC,MAAO,CAAEP,OAAQK,KAAKL,QACtBQ,GAAI,CAAEC,cAAeJ,KAAKK,kBAE5BL,KAAKM,OAAOjB,UAIhBkB,wBACOV,cACAH,SAAU,GAGjBc,SAAU,CACRC,qBACST,KAAKU,MAAMC,YAItBC,QAAS,CACPf,6BACMG,KAAKhB,aACFW,QAAS,OACTkB,MAAM,cACPb,KAAKN,cACFoB,UAAU,wBAAad,EAAKS,GAAGM,aAAe,cAGhDF,MAAM,oBACNC,UAAUd,KAAKS,GAAGM,aAAe,sBAAY,UAItDC,cAAMC,GACCjB,KAAKN,aAGHwB,UAAUD,GAFfA,KAMJH,mBAAWK,EAAMC,mBACV3B,MAAQ,CAAE4B,OAAQF,QAElBH,kBAEEM,GAAKtB,EAAKS,GAAGM,eAEbtB,MAAQ,CACX4B,OAAQD,IACRG,SAAU,+BACa,+BACAvB,EAAKd,SAAW,SAK7CmB,2BACML,KAAKhB,aACFS,MAAQ,QACRoB,MAAM,mBAENpB,MAAQ,CACX4B,OAAQ,IACRE,SAAU,eAEP5B,QAAS,OACTkB,MAAM"} \ No newline at end of file