@fluid-topics/ft-chip 1.1.4 → 1.1.6
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-chip.light.js +2 -2
- package/build/ft-chip.min.js +265 -260
- package/package.json +6 -6
package/build/ft-chip.light.js
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
<div class="ft-ripple--background"></div>
|
|
122
122
|
<div class="ft-ripple--effect"></div>
|
|
123
123
|
</div>
|
|
124
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var o,e;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(o=this.target)||void 0===o||o.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,o;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(o=this.target)&&void 0!==o?o:e)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const o=(...t)=>o=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(o)},e=o("mouseup","contextmenu"),r=o("touchend","touchcancel"),i=t=>{["Enter"," "].includes(t.key)&&o("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",r),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",i),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",i),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const o=t,e=t;let r,i;return null!=o.x?({x:r,y:i}=o):null!=e.touches&&(r=e.touches[0].clientX,i=e.touches[0].clientY),{x:r,y:i}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let o of t.composedPath()){if(o===this.target)break;if("hasAttribute"in o&&o.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}u.elementDefinitions={},u.styles=g,y([r.property({type:Boolean})],u.prototype,"primary",void 0),y([r.property({type:Boolean})],u.prototype,"secondary",void 0),y([r.property({type:Boolean})],u.prototype,"unbounded",void 0),y([r.property({type:Boolean})],u.prototype,"activated",void 0),y([r.property({type:Boolean})],u.prototype,"selected",void 0),y([r.property({type:Boolean})],u.prototype,"disabled",void 0),y([r.state()],u.prototype,"hovered",void 0),y([r.state()],u.prototype,"focused",void 0),y([r.state()],u.prototype,"pressed",void 0),y([r.state()],u.prototype,"rippling",void 0),y([r.state()],u.prototype,"originX",void 0),y([r.state()],u.prototype,"originY",void 0),y([r.query(".ft-ripple")],u.prototype,"ripple",void 0),y([r.query(".ft-ripple--effect")],u.prototype,"rippleEffect",void 0),o.customElement("ft-ripple")(u);
|
|
124
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var o,e;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(o=this.target)||void 0===o||o.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,o;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(o=this.target)&&void 0!==o?o:e)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const o=(...t)=>o=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(o)},e=o("mouseup","contextmenu"),r=o("touchend","touchcancel"),i=t=>{["Enter"," "].includes(t.key)&&o("keyup")(t)},n={passive:!0};t.addEventListener("mouseover",this.startHover,n),t.addEventListener("mousemove",this.moveRipple,n),t.addEventListener("mouseleave",this.endHover,n),t.addEventListener("mousedown",e,n),t.addEventListener("touchstart",r,n),t.addEventListener("touchmove",this.moveRipple,n),t.addEventListener("keydown",i,n),t.addEventListener("focus",this.startFocus,n),t.addEventListener("blur",this.endFocus,n),t.addEventListener("focusin",this.startFocus,n),t.addEventListener("focusout",this.endFocus,n),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,n),t.removeEventListener("mousemove",this.moveRipple,n),t.removeEventListener("mouseleave",this.endHover,n),t.removeEventListener("mousedown",e,n),t.removeEventListener("touchstart",r,n),t.removeEventListener("touchmove",this.moveRipple,n),t.removeEventListener("keydown",i,n),t.removeEventListener("focus",this.startFocus,n),t.removeEventListener("blur",this.endFocus,n),t.removeEventListener("focusin",this.startFocus,n),t.removeEventListener("focusout",this.endFocus,n),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const o=t,e=t;let r,i;return null!=o.x?({x:r,y:i}=o):null!=e.touches&&(r=e.touches[0].clientX,i=e.touches[0].clientY),{x:r,y:i}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let o of t.composedPath()){if(o===this.target)break;if("hasAttribute"in o&&o.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}u.elementDefinitions={},u.styles=g,y([r.property({type:Boolean})],u.prototype,"primary",void 0),y([r.property({type:Boolean})],u.prototype,"secondary",void 0),y([r.property({type:Boolean})],u.prototype,"unbounded",void 0),y([r.property({type:Boolean})],u.prototype,"activated",void 0),y([r.property({type:Boolean})],u.prototype,"selected",void 0),y([r.property({type:Boolean})],u.prototype,"disabled",void 0),y([r.state()],u.prototype,"hovered",void 0),y([r.state()],u.prototype,"focused",void 0),y([r.state()],u.prototype,"pressed",void 0),y([r.state()],u.prototype,"rippling",void 0),y([r.state()],u.prototype,"originX",void 0),y([r.state()],u.prototype,"originY",void 0),y([r.query(".ft-ripple")],u.prototype,"ripple",void 0),y([r.query(".ft-ripple--effect")],u.prototype,"rippleEffect",void 0),o.customElement("ft-ripple")(u);
|
|
125
125
|
/**
|
|
126
126
|
* @license
|
|
127
127
|
* Copyright 2017 Google LLC
|
|
@@ -550,7 +550,7 @@ const Q=Symbol.for(""),tt=t=>{if(t?.r===Q)return t?._$litStatic$},ot=t=>({_$litS
|
|
|
550
550
|
</div>
|
|
551
551
|
</div>
|
|
552
552
|
</div>
|
|
553
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const 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"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Ye(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:r,placement:i}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=ne(t,o),p={x:e,y:r},f=await ye(o,c),s=fe(ae(i)),d=ce(s);let h=p[d],g=p[s];if(n){const t="y"===d?"bottom":"right";h=ie(h+f["y"===d?"top":"left"],h,h-f[t])}if(a){const t="y"===s?"bottom":"right";g=ie(g+f["y"===s?"top":"left"],g,g-f[t])}const y=l.fn({...o,[d]:h,[s]:g});return{...y,data:{x:y.x-e,y:y.y-r}}}}),be({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}Xe.elementDefinitions={"ft-typography":wo},Xe.styles=Vo,Ve([r.property()],Xe.prototype,"text",void 0),Ve([r.property({type:Boolean})],Xe.prototype,"manual",void 0),Ve([r.property({type:Boolean})],Xe.prototype,"inline",void 0),Ve([r.property({type:Number})],Xe.prototype,"delay",void 0),Ve([r.property()],Xe.prototype,"position",void 0),Ve([r.queryAssignedNodes()],Xe.prototype,"slotNodes",void 0),Ve([r.query(".ft-tooltip--container")],Xe.prototype,"container",void 0),Ve([r.query(".ft-tooltip")],Xe.prototype,"tooltip",void 0),Ve([r.query(".ft-tooltip--content")],Xe.prototype,"tooltipContent",void 0),Ve([r.state()],Xe.prototype,"visible",void 0),o.customElement("ft-tooltip")(Xe);class qe extends o.FtLitElement{render(){return e.html`
|
|
553
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((o=>t.has(o)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const 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"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Ye(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(o){const{x:e,y:r,placement:i}=o,{mainAxis:n=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:o,y:e}=t;return{x:o,y:e}}},...c}=ne(t,o),p={x:e,y:r},f=await ye(o,c),s=fe(ae(i)),d=ce(s);let h=p[d],g=p[s];if(n){const t="y"===d?"bottom":"right";h=ie(h+f["y"===d?"top":"left"],h,h-f[t])}if(a){const t="y"===s?"bottom":"right";g=ie(g+f["y"===s?"top":"left"],g,g-f[t])}const y=l.fn({...o,[d]:h,[s]:g});return{...y,data:{x:y.x-e,y:y.y-r}}}}),be({allowedPlacements:[this.position]})]}).then((({x:t,y:o})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${o}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,o){return Math.max(t,Math.min(0,-o))}}Xe.elementDefinitions={"ft-typography":wo},Xe.styles=Vo,Ve([r.property()],Xe.prototype,"text",void 0),Ve([r.property({type:Boolean})],Xe.prototype,"manual",void 0),Ve([r.property({type:Boolean})],Xe.prototype,"inline",void 0),Ve([r.property({type:Number})],Xe.prototype,"delay",void 0),Ve([r.property()],Xe.prototype,"position",void 0),Ve([r.queryAssignedNodes()],Xe.prototype,"slotNodes",void 0),Ve([r.query(".ft-tooltip--container")],Xe.prototype,"container",void 0),Ve([r.query(".ft-tooltip")],Xe.prototype,"tooltip",void 0),Ve([r.query(".ft-tooltip--content")],Xe.prototype,"tooltipContent",void 0),Ve([r.state()],Xe.prototype,"visible",void 0),Ve([r.eventOptions({passive:!0})],Xe.prototype,"onTouch",null),Ve([r.eventOptions({passive:!0})],Xe.prototype,"onHover",null),Ve([r.eventOptions({passive:!0})],Xe.prototype,"onOut",null),o.customElement("ft-tooltip")(Xe);class qe extends o.FtLitElement{render(){return e.html`
|
|
554
554
|
<div class="ft-loader">
|
|
555
555
|
<div></div>
|
|
556
556
|
<div></div>
|