@m3e/tooltip 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/src/TooltipElementBase.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.min.js
CHANGED
|
@@ -47,7 +47,7 @@ const G=globalThis,K=G.trustedTypes,J=K?K.createPolicy("lit-html",{createHTML:t=
|
|
|
47
47
|
* Copyright 2018 Google LLC
|
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
49
|
*/
|
|
50
|
-
const kt=t=>t??ut;var Ct,Tt,Mt,Ut,Ot,Ht,Nt,Rt,Wt,Dt;class zt extends(e(h)){constructor(){super(...arguments),Ct.add(this),Mt.set(this,null),Ut.set(this,void 0),Ot.set(this,!1),Ht.set(this,()=>v(this,Ct,"m",Wt).call(this)),Nt.set(this,new i(this,{target:null,endDelay:200,callback:(t,e)=>{if(!this._isInteractive)if(t){if(e===this._base)return void $(this,Ot,!0,"f");this.show()}else v(this,Ot,"f")&&e!==this._base||($(this,Ot,!1,"f"),this.hide())}})),Rt.set(this,new s(this,{target:null,callback:t=>{this._isInteractive||(t?this.show():this.hide())}})),this.disabled=!1,this.touchGestures="auto"}get showDelay(){return v(this,Nt,"f").startDelay}set showDelay(t){v(this,Nt,"f").startDelay=t}get hideDelay(){return v(this,Nt,"f").endDelay}set hideDelay(t){v(this,Nt,"f").endDelay=t}get isOpen(){return Tt.__openTooltips.includes(this)}get _isInteractive(){return!1}attach(t){super.attach(t),m.iOS||m.Android?(v(this,Rt,"f").observe(t),v(this,Ct,"m",Dt).call(this)):v(this,Nt,"f").observe(t),t.addEventListener("click",v(this,Ht,"f"))}detach(){this.control&&(v(this,Nt,"f").unobserve(this.control),v(this,Rt,"f").observe(this.control),this.control.removeEventListener("click",v(this,Ht,"f")),this.hide()),super.detach()}update(t){super.update(t),t.has("disabled")&&this.disabled&&this.hide()}firstUpdated(t){super.firstUpdated(t),this._base&&v(this,Nt,"f").observe(this._base)}async show(){!this.control||this.disabled||o(this.control)&&this.control.disabled||(Tt.__openTooltips.filter(t=>t!==this).forEach(t=>t.hide())
|
|
50
|
+
const kt=t=>t??ut;var Ct,Tt,Mt,Ut,Ot,Ht,Nt,Rt,Wt,Dt;class zt extends(e(h)){constructor(){super(...arguments),Ct.add(this),Mt.set(this,null),Ut.set(this,void 0),Ot.set(this,!1),Ht.set(this,()=>v(this,Ct,"m",Wt).call(this)),Nt.set(this,new i(this,{target:null,endDelay:200,callback:(t,e)=>{if(!this._isInteractive)if(t){if(e===this._base)return void $(this,Ot,!0,"f");this.show()}else v(this,Ot,"f")&&e!==this._base||($(this,Ot,!1,"f"),this.hide())}})),Rt.set(this,new s(this,{target:null,callback:t=>{this._isInteractive||(t?this.show():this.hide())}})),this.disabled=!1,this.touchGestures="auto"}get showDelay(){return v(this,Nt,"f").startDelay}set showDelay(t){v(this,Nt,"f").startDelay=t}get hideDelay(){return v(this,Nt,"f").endDelay}set hideDelay(t){v(this,Nt,"f").endDelay=t}get isOpen(){return Tt.__openTooltips.includes(this)}get _isInteractive(){return!1}attach(t){super.attach(t),m.iOS||m.Android?(v(this,Rt,"f").observe(t),v(this,Ct,"m",Dt).call(this)):v(this,Nt,"f").observe(t),t.addEventListener("click",v(this,Ht,"f"))}detach(){this.control&&(v(this,Nt,"f").unobserve(this.control),v(this,Rt,"f").observe(this.control),this.control.removeEventListener("click",v(this,Ht,"f")),this.hide()),super.detach()}update(t){super.update(t),t.has("disabled")&&this.disabled&&this.hide()}firstUpdated(t){super.firstUpdated(t),this._base&&v(this,Nt,"f").observe(this._base)}async show(){!this.control||this.disabled||o(this.control)&&this.control.disabled||(Tt.__openTooltips.filter(t=>t!==this).forEach(t=>t.hide()),$(this,Ut,await g(this._base,this.control,{position:this._anchorPosition,inline:!0,flip:!0,shift:!0,offset:4},(t,e)=>this._updatePosition(this._base,t,e)),"f"),this._base.showPopover(),Tt.__openTooltips.includes(this)||Tt.__openTooltips.push(this))}hide(){this._base.hidePopover(),v(this,Ut,"f")?.call(this),$(this,Ut,void 0,"f"),v(this,Nt,"f").clearDelays(),Tt.__openTooltips.includes(this)&&(Tt.__openTooltips=Tt.__openTooltips.filter(t=>t!==this))}}var jt,It,Lt,qt,Bt,Vt,Ft,Gt,Kt,Jt,Zt,Xt,Qt,Yt,te,ee;Tt=zt,Mt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Ht=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,Ct=new WeakSet,Wt=function(){this._isInteractive?Tt.__openTooltips.includes(this)?this.hide():this.show():this.hide()},Dt=function(){if("off"!==this.touchGestures&&v(this,Mt,"f")){const t=v(this,Mt,"f").style;("on"===this.touchGestures||"INPUT"!==v(this,Mt,"f").nodeName&&"TEXTAREA"!==v(this,Mt,"f").nodeName)&&(t.userSelect=t.msUserSelect=t.webkitUserSelect=t.MozUserSelect="none"),"on"!==this.touchGestures&&v(this,Mt,"f").draggable||(t.webkitUserDrag="none"),t.touchAction="none",t.webkitTapHighlightColor="transparent"}},zt.__openTooltips=new Array,b([
|
|
51
51
|
/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2017 Google LLC
|