@fluid-topics/ft-tooltip 2.0.3 → 2.0.4
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/build/ft-tooltip.js
CHANGED
|
@@ -83,7 +83,7 @@ class FtTooltip extends FtLitElementWithI18n {
|
|
|
83
83
|
if (this.eventsTarget !== eventsTarget) {
|
|
84
84
|
this.removeHandlers();
|
|
85
85
|
this.eventsTarget = eventsTarget;
|
|
86
|
-
this.eventsTarget.addEventListener("
|
|
86
|
+
this.eventsTarget.addEventListener("mouseover", this.onHover, { passive: true });
|
|
87
87
|
this.eventsTarget.addEventListener("mouseleave", this.onOut, { passive: true });
|
|
88
88
|
this.eventsTarget.addEventListener("focusin", this.onFocusIn, { passive: true });
|
|
89
89
|
this.eventsTarget.addEventListener("focusout", this.onOut, { passive: true });
|
|
@@ -93,7 +93,7 @@ class FtTooltip extends FtLitElementWithI18n {
|
|
|
93
93
|
}
|
|
94
94
|
removeHandlers() {
|
|
95
95
|
if (this.eventsTarget) {
|
|
96
|
-
this.eventsTarget.removeEventListener("
|
|
96
|
+
this.eventsTarget.removeEventListener("mouseover", this.onHover);
|
|
97
97
|
this.eventsTarget.removeEventListener("mouseleave", this.onOut);
|
|
98
98
|
this.eventsTarget.removeEventListener("focusin", this.onFocusIn);
|
|
99
99
|
this.eventsTarget.removeEventListener("focusout", this.onOut);
|
|
@@ -177,7 +177,7 @@ Also for action icons.`,i.colorGray200),contentGlobalSubtle:e.extend("--ftds-con
|
|
|
177
177
|
</div>
|
|
178
178
|
</div>
|
|
179
179
|
</div>
|
|
180
|
-
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("
|
|
180
|
+
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("mouseover",this.onHover,{passive:!0}),this.eventsTarget.addEventListener("mouseleave",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("focusin",this.onFocusIn,{passive:!0}),this.eventsTarget.addEventListener("focusout",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("touchstart",this.onTouch,{passive:!0}),this.eventsTarget.addEventListener("click",this.onClick,{passive:!0}))}removeHandlers(){this.eventsTarget&&(this.eventsTarget.removeEventListener("mouseover",this.onHover),this.eventsTarget.removeEventListener("mouseleave",this.onOut),this.eventsTarget.removeEventListener("focusin",this.onFocusIn),this.eventsTarget.removeEventListener("focusout",this.onOut),this.eventsTarget.removeEventListener("touchstart",this.onTouch),this.eventsTarget.removeEventListener("click",this.onClick),this.eventsTarget=void 0)}defaultSetup(){this.container&&this.setupFor(this.container)}updated(t){var o,n;t.has("visible")&&(this.visible?(this.resetTooltipContent(),(o=this.tooltip)===null||o===void 0||o.showPopover()):(n=this.tooltip)===null||n===void 0||n.hidePopover()),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some(o=>t.has(o))&&this.visible&&this.positionTooltip()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.eventsTarget==null&&this.defaultSetup()})}disconnectedCallback(){super.disconnectedCallback(),this.removeHandlers()}async show(t){this.visible=!0,t!=null&&await this.hideDebounce.run(()=>{this.hide()},t)}async showTemporaryText(t,o){let n=this.manual;this.manual=!0;let a=this.text;this.text={message:t},await this.show(o),this.text=a,this.manual=n}hide(){this.visible=!1}toggle(){this.visible=!this.visible}isVisible(){return this.visible}get slottedElement(){var t;return((t=this.slotNodes)!==null&&t!==void 0?t:[]).filter(o=>o.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&Ra(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${t}px,${o}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${ne.designSystemVariables.transitionDuration}, left ${ne.designSystemVariables.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}isIgnored(t){return this.manual||(0,ne.eventPathContainsMatchingElement)(t,this.ignoreMatchingElements,this.eventsTarget)}};j.elementDefinitions={"ft-typography":ve};j.styles=Jn;fe([vs()],j.prototype,"text",void 0);fe([(0,ae.property)({type:Boolean})],j.prototype,"manual",void 0);fe([(0,ae.property)({type:Boolean})],j.prototype,"inline",void 0);fe([(0,ne.numberProperty)()],j.prototype,"delay",void 0);fe([(0,ae.property)()],j.prototype,"position",void 0);fe([(0,ne.jsonProperty)([])],j.prototype,"ignoreMatchingElements",void 0);fe([(0,ae.queryAssignedNodes)()],j.prototype,"slotNodes",void 0);fe([(0,ae.query)(".ft-tooltip--container")],j.prototype,"container",void 0);fe([(0,ae.query)(".ft-tooltip")],j.prototype,"tooltip",void 0);fe([(0,ae.query)(".ft-tooltip--content")],j.prototype,"tooltipContent",void 0);fe([(0,ae.state)()],j.prototype,"visible",void 0);(0,As.customElement)("ft-tooltip")(j);})();
|
|
181
181
|
/*! Bundled license information:
|
|
182
182
|
|
|
183
183
|
lit-html/lit-html.js:
|
package/build/ft-tooltip.min.js
CHANGED
|
@@ -257,7 +257,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
257
257
|
</div>
|
|
258
258
|
</div>
|
|
259
259
|
</div>
|
|
260
|
-
`}setupFor(e){this.eventsTarget!==e&&(this.removeHandlers(),this.eventsTarget=e,this.eventsTarget.addEventListener("
|
|
260
|
+
`}setupFor(e){this.eventsTarget!==e&&(this.removeHandlers(),this.eventsTarget=e,this.eventsTarget.addEventListener("mouseover",this.onHover,{passive:!0}),this.eventsTarget.addEventListener("mouseleave",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("focusin",this.onFocusIn,{passive:!0}),this.eventsTarget.addEventListener("focusout",this.onOut,{passive:!0}),this.eventsTarget.addEventListener("touchstart",this.onTouch,{passive:!0}),this.eventsTarget.addEventListener("click",this.onClick,{passive:!0}))}removeHandlers(){this.eventsTarget&&(this.eventsTarget.removeEventListener("mouseover",this.onHover),this.eventsTarget.removeEventListener("mouseleave",this.onOut),this.eventsTarget.removeEventListener("focusin",this.onFocusIn),this.eventsTarget.removeEventListener("focusout",this.onOut),this.eventsTarget.removeEventListener("touchstart",this.onTouch),this.eventsTarget.removeEventListener("click",this.onClick),this.eventsTarget=void 0)}defaultSetup(){this.container&&this.setupFor(this.container)}updated(e){var r,n;e.has("visible")&&(this.visible?(this.resetTooltipContent(),(r=this.tooltip)===null||r===void 0||r.showPopover()):(n=this.tooltip)===null||n===void 0||n.hidePopover()),super.updated(e)}contentAvailableCallback(e){super.contentAvailableCallback(e),["visible","text"].some(r=>e.has(r))&&this.visible&&this.positionTooltip()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.eventsTarget==null&&this.defaultSetup()})}disconnectedCallback(){super.disconnectedCallback(),this.removeHandlers()}async show(e){this.visible=!0,e!=null&&await this.hideDebounce.run(()=>{this.hide()},e)}async showTemporaryText(e,r){let n=this.manual;this.manual=!0;let i=this.text;this.text={message:e},await this.show(r),this.text=i,this.manual=n}hide(){this.visible=!1}toggle(){this.visible=!this.visible}isVisible(){return this.visible}get slottedElement(){var e;return((e=this.slotNodes)!==null&&e!==void 0?e:[]).filter(r=>r.nodeType==Node.ELEMENT_NODE)[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){let e=this.tooltipContent.style;switch(e.transition="none",this.validPosition){case"top":e.top=this.tooltip.clientHeight+"px",e.left="0";break;case"bottom":e.top=-this.tooltip.clientHeight+"px",e.left="0";break;case"left":e.top="0",e.left=this.tooltip.clientWidth+"px";break;case"right":e.top="0",e.left=-this.tooltip.clientWidth+"px";break}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&qn(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:e,y:r})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${e}px,${r}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${ke.transitionDuration}, left ${ke.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}isIgnored(e){return this.manual||rn(e,this.ignoreMatchingElements,this.eventsTarget)}};J.elementDefinitions={"ft-typography":Me};J.styles=cl;xe([xl()],J.prototype,"text",void 0);xe([I({type:Boolean})],J.prototype,"manual",void 0);xe([I({type:Boolean})],J.prototype,"inline",void 0);xe([eo()],J.prototype,"delay",void 0);xe([I()],J.prototype,"position",void 0);xe([le([])],J.prototype,"ignoreMatchingElements",void 0);xe([Zo()],J.prototype,"slotNodes",void 0);xe([hr(".ft-tooltip--container")],J.prototype,"container",void 0);xe([hr(".ft-tooltip")],J.prototype,"tooltip",void 0);xe([hr(".ft-tooltip--content")],J.prototype,"tooltipContent",void 0);xe([ee()],J.prototype,"visible",void 0);Ee("ft-tooltip")(J);})();
|
|
261
261
|
/*! Bundled license information:
|
|
262
262
|
|
|
263
263
|
@webcomponents/scoped-custom-element-registry/src/scoped-custom-element-registry.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-tooltip",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "A simple tooltip component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-i18n": "2.0.
|
|
23
|
-
"@fluid-topics/ft-typography": "2.0.
|
|
24
|
-
"@fluid-topics/ft-wc-utils": "2.0.
|
|
22
|
+
"@fluid-topics/ft-i18n": "2.0.4",
|
|
23
|
+
"@fluid-topics/ft-typography": "2.0.4",
|
|
24
|
+
"@fluid-topics/ft-wc-utils": "2.0.4",
|
|
25
25
|
"lit": "3.1.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "bc275bc44bc77b2e5802f2da9e92a0aca4479155"
|
|
28
28
|
}
|