UNPKG

3.85 kBJavaScriptView Raw
1module.exports=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=297)}({0:function(t,e){t.exports=function(t,e,n,i,o,s){var r,a=t=t||{},d=typeof t.default;"object"!==d&&"function"!==d||(r=t,a=t.default);var h="function"==typeof a?a.options:a;e&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0),n&&(h.functional=!0),o&&(h._scopeId=o);var u;if(s?(u=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(s)},h._ssrRegister=u):i&&(u=i),u){var l=h.functional,$=l?h.render:h.beforeCreate;l?(h._injectStyles=u,h.render=function(t,e){return u.call(e),$(t,e)}):h.beforeCreate=$?[].concat($,u):[u]}return{esModule:r,exports:a,options:h}}},297:function(t,e,n){t.exports=n(40)},32:function(t,e,n){"use strict";e.a={name:"Ripple",componentName:"Ripple",props:{color:{type:String},position:{type:String}},mounted:function(){void 0===document.touchstart?(this.$el.addEventListener("mousedown",this.handleTouchStart,!1),this.$el.addEventListener("mouseup",this.handleTouchEnd,!1)):(this.$el.addEventListener("touchstart",this.handleTouchStart,!1),this.$el.addEventListener("touchend",this.handleTouchEnd,!1))},beforeDestroy:function(){this.$$destroyTimer&&clearTimeout(this.$$destroyTimer),this.$$timer&&clearTimeout(this.$$timer)},methods:{getOffset:function(t,e){var n=e.pageX,i=e.pageY;return"center"===this.position?{top:t.height/2,left:t.width/2,width:t.width,height:t.height}:{top:i-t.top,left:n-t.left,width:t.width,height:t.height}},handleTouchStart:function(t){var e=this,n=this.$el.querySelector(".vx-ripple--shadow");n&&n.parentNode.removeChild(n),this.$$offset=this.getOffset(this.$el.getBoundingClientRect(),t.changedTouches?t.changedTouches[0]:t),this.$$node=document.createElement("div"),this.$$node.classList.add("vx-ripple--shadow"),this.$$node.style.cssText="top:"+this.$$offset.top+"px;left:"+this.$$offset.left+"px;",this.color&&(this.$$node.style.backgroundColor=this.color),this.$el.appendChild(this.$$node),this.$$timer=setTimeout(function(){e.$$node.style.transition=e.$$node.style.webkitTransition="transform 0.25s ease-in-out 0s",e.$$node.style.transform=e.$$node.style.webkitTransform="scale(1.4)"}),t.preventDefault()},handleTouchEnd:function(t){this.$$timer&&clearTimeout(this.$$timer);var e=Math.max(this.$$offset.height,this.$$offset.width);this.$$duration=e/400,this.$$duration<.6?this.$$duration=.6:this.$$duration>2&&(this.$$duration=2),this.$$node.style.transition=this.$$node.style.webkitTransition="transform "+this.$$duration+"s ease-in-out 0s, opacity "+(this.$$duration-.3)+"s linear 0s",this.$$node.style.transform=this.$$node.style.webkitTransform="scale("+Math.max(this.$$offset.height,this.$$offset.width)/5+")",this.$$node.style.opacity="0",this.$$destroyTimer=setTimeout(function(t){t.parentNode&&t.parentNode.removeChild(t)}.bind(this,this.$$node),1e3*this.$$duration)}}}},40:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(32),o=n(58),s=n(0),r=s(i.a,o.a,!1,null,null,null);e.default=r.exports},58:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"vx-ripple",attrs:{onselectstart:"return false;"}},[t._t("default")],2)},o=[],s={render:i,staticRenderFns:o};e.a=s}});
\No newline at end of file