UNPKG

1.31 kBJavaScriptView Raw
1import{r as t,c as s,h as e,H as i,g as o}from"./p-059912fd.js";import{c as h}from"./p-76724e58.js";let r=class{constructor(e){t(this,e),this.onLongPress=s(this,"longpress",7),this.hoverStartTime=50,this.hoverStayTime=400,this.hover=!1,this.touch=!1,this.startTime=0}onTouchStart(){this.hoverClass&&(this.touch=!0,setTimeout((()=>{this.touch&&(this.hover=!0)}),this.hoverStartTime)),this.timeoutEvent=setTimeout((()=>{this.onLongPress.emit()}),350),this.startTime=Date.now()}onTouchMove(){clearTimeout(this.timeoutEvent)}onTouchEnd(){Date.now()-this.startTime<350&&clearTimeout(this.timeoutEvent),this.hoverClass&&(this.touch=!1,setTimeout((()=>{this.touch||(this.hover=!1)}),this.hoverStayTime))}componentDidRender(){this.el.childNodes.forEach((t=>{t.nodeType===document.COMMENT_NODE&&t["s-cn"]&&(t["s-cn"]=!1),t.nodeType!==document.COMMENT_NODE&&t["s-sr"]&&(t["s-sr"]=!1)}))}render(){const t=h({[`${this.hoverClass}`]:this.hover});let s={};return this.animation&&(s.animation=this.animation,s["data-animation"]=this.animation),e(i,Object.assign({class:t},s),e("slot",null))}get el(){return o(this)}};r.style="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}";export{r as taro_view_core}
\No newline at end of file