@tarojs/components
Version:
Taro 组件库。
1 lines • 1.66 kB
JavaScript
System.register(["./p-b2d01686.system.js","./p-5f4d0d5b.system.js"],(function(t){"use strict";var e,o,i,s,n,r;return{setters:[function(t){e=t.r;o=t.c;i=t.h;s=t.H;n=t.g},function(t){r=t.c}],execute:function(){var h="body,html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-view-core{display:block}";var a=t("taro_view_core",function(){function t(t){e(this,t);this.onLongPress=o(this,"longpress",7);this.hoverStartTime=50;this.hoverStayTime=400;this.hover=false;this.touch=false;this.startTime=0}t.prototype.onTouchStart=function(){var t=this;if(this.hoverClass){this.touch=true;setTimeout((function(){if(t.touch){t.hover=true}}),this.hoverStartTime)}this.timeoutEvent=setTimeout((function(){t.onLongPress.emit()}),350);this.startTime=Date.now()};t.prototype.onTouchMove=function(){clearTimeout(this.timeoutEvent)};t.prototype.onTouchEnd=function(){var t=this;var e=Date.now()-this.startTime;if(e<350){clearTimeout(this.timeoutEvent)}if(this.hoverClass){this.touch=false;setTimeout((function(){if(!t.touch){t.hover=false}}),this.hoverStayTime)}};t.prototype.componentDidRender=function(){var t=this.el;t.childNodes.forEach((function(t){if(t.nodeType===document.COMMENT_NODE&&t["s-cn"])t["s-cn"]=false}))};t.prototype.render=function(){var t;var e=r((t={},t[""+this.hoverClass]=this.hover,t));var o={};if(!!this.animation){o["animation"]=this.animation;o["data-animation"]=this.animation}return i(s,Object.assign({class:e},o),i("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());a.style=h}}}));