@fluid-topics/ft-tabs 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-tabs.light.js +1 -1
- package/build/ft-tabs.min.js +1 -1
- package/package.json +7 -7
package/build/ft-tabs.light.js
CHANGED
|
@@ -933,7 +933,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
933
933
|
</div>
|
|
934
934
|
</div>
|
|
935
935
|
</div>
|
|
936
|
-
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("
|
|
936
|
+
`}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&&F1(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 ${Ae.designSystemVariables.transitionDuration}, left ${Ae.designSystemVariables.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}isIgnored(t){return this.manual||(0,Ae.eventPathContainsMatchingElement)(t,this.ignoreMatchingElements,this.eventsTarget)}};X.elementDefinitions={"ft-typography":we};X.styles=h1;Pe([I0()],X.prototype,"text",void 0);Pe([(0,Le.property)({type:Boolean})],X.prototype,"manual",void 0);Pe([(0,Le.property)({type:Boolean})],X.prototype,"inline",void 0);Pe([(0,Ae.numberProperty)()],X.prototype,"delay",void 0);Pe([(0,Le.property)()],X.prototype,"position",void 0);Pe([(0,Ae.jsonProperty)([])],X.prototype,"ignoreMatchingElements",void 0);Pe([(0,Le.queryAssignedNodes)()],X.prototype,"slotNodes",void 0);Pe([(0,Le.query)(".ft-tooltip--container")],X.prototype,"container",void 0);Pe([(0,Le.query)(".ft-tooltip")],X.prototype,"tooltip",void 0);Pe([(0,Le.query)(".ft-tooltip--content")],X.prototype,"tooltipContent",void 0);Pe([(0,Le.state)()],X.prototype,"visible",void 0);var H0=A(D());(0,H0.customElement)("ft-tooltip")(X);var Ht=function(e,t,o,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,o,i):s(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},Ei;(function(e){e.left="left",e.right="right",e.start="start",e.end="end",e.justify="justify"})(Ei||(Ei={}));var Ai=class extends CustomEvent{constructor(t){super("index-change",{detail:t})}},ce=class extends Fe.FtLitElement{constructor(){super(...arguments),this.alignTabs=Ei.justify,this.ftTabs=[],this.horizontal=!1,this.activeIndex=0,this.updateDebouncer=new Fe.Debouncer(2),this.onTabUpdated=()=>this.updateDebouncer.run(()=>{this.requestUpdate(),this.dispatchEvent(new Fe.PostResizeEvent)}),this.resizeObserver=new ResizeObserver(()=>this.placeIndicator())}get typographyVariant(){return""}render(){var t,o;let n=(o=this.ftTabs[(t=this.activeIndex)!==null&&t!==void 0?t:0])===null||o===void 0?void 0:o.color;return Si.html`
|
|
937
937
|
<div class="${(0,Ci.classMap)(this.tabsClasses)}" part="container">
|
|
938
938
|
<div role="tablist" part="tablist">
|
|
939
939
|
${(0,W0.repeat)(this.ftTabs,(a,i)=>this.addTooltipIfNecessary(a,Si.html`
|
package/build/ft-tabs.min.js
CHANGED
|
@@ -1013,7 +1013,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
|
1013
1013
|
</div>
|
|
1014
1014
|
</div>
|
|
1015
1015
|
</div>
|
|
1016
|
-
`}setupFor(t){this.eventsTarget!==t&&(this.removeHandlers(),this.eventsTarget=t,this.eventsTarget.addEventListener("
|
|
1016
|
+
`}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 r,o;t.has("visible")&&(this.visible?(this.resetTooltipContent(),(r=this.tooltip)===null||r===void 0||r.showPopover()):(o=this.tooltip)===null||o===void 0||o.hidePopover()),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some(r=>t.has(r))&&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,r){let o=this.manual;this.manual=!0;let a=this.text;this.text={message:t},await this.show(r),this.text=a,this.manual=o}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(r=>r.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&&fi(this.slottedElement,this.tooltip,{placement:this.position,strategy:"fixed"}).then(({x:t,y:r})=>{this.tooltip&&(this.tooltip.style.transform=`translate(${t}px,${r}px)`)}),this.revealDebouncer.run(()=>{this.tooltipContent&&(this.tooltipContent.style.transition=`top ${te.transitionDuration}, left ${te.transitionDuration}`,this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")},this.manual?0:this.delay)}isIgnored(t){return this.manual||va(t,this.ignoreMatchingElements,this.eventsTarget)}};ie.elementDefinitions={"ft-typography":De};ie.styles=jd;Be([r4()],ie.prototype,"text",void 0);Be([R({type:Boolean})],ie.prototype,"manual",void 0);Be([R({type:Boolean})],ie.prototype,"inline",void 0);Be([ur()],ie.prototype,"delay",void 0);Be([R()],ie.prototype,"position",void 0);Be([Re([])],ie.prototype,"ignoreMatchingElements",void 0);Be([ua()],ie.prototype,"slotNodes",void 0);Be([ge(".ft-tooltip--container")],ie.prototype,"container",void 0);Be([ge(".ft-tooltip")],ie.prototype,"tooltip",void 0);Be([ge(".ft-tooltip--content")],ie.prototype,"tooltipContent",void 0);Be([X()],ie.prototype,"visible",void 0);oe("ft-tooltip")(ie);var nr=function(e,t,r,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(i=(a<3?s(i):a>3?s(t,r,i):s(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},vc;(function(e){e.left="left",e.right="right",e.start="start",e.end="end",e.justify="justify"})(vc||(vc={}));var Sc=class extends CustomEvent{constructor(t){super("index-change",{detail:t})}},he=class extends V{constructor(){super(...arguments),this.alignTabs=vc.justify,this.ftTabs=[],this.horizontal=!1,this.activeIndex=0,this.updateDebouncer=new me(2),this.onTabUpdated=()=>this.updateDebouncer.run(()=>{this.requestUpdate(),this.dispatchEvent(new co)}),this.resizeObserver=new ResizeObserver(()=>this.placeIndicator())}get typographyVariant(){return""}render(){var t,r;let o=(r=this.ftTabs[(t=this.activeIndex)!==null&&t!==void 0?t:0])===null||r===void 0?void 0:r.color;return Y`
|
|
1017
1017
|
<div class="${pt(this.tabsClasses)}" part="container">
|
|
1018
1018
|
<div role="tablist" part="tablist">
|
|
1019
1019
|
${dr(this.ftTabs,(a,i)=>this.addTooltipIfNecessary(a,Y`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-tabs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Generic tabs component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-icon": "2.0.
|
|
23
|
-
"@fluid-topics/ft-ripple": "2.0.
|
|
24
|
-
"@fluid-topics/ft-tooltip": "2.0.
|
|
25
|
-
"@fluid-topics/ft-typography": "2.0.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "2.0.
|
|
22
|
+
"@fluid-topics/ft-icon": "2.0.4",
|
|
23
|
+
"@fluid-topics/ft-ripple": "2.0.4",
|
|
24
|
+
"@fluid-topics/ft-tooltip": "2.0.4",
|
|
25
|
+
"@fluid-topics/ft-typography": "2.0.4",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "2.0.4",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "bc275bc44bc77b2e5802f2da9e92a0aca4479155"
|
|
30
30
|
}
|