@fluid-topics/ft-ripple
Advanced tools
Comparing version 0.3.12 to 0.3.13
import { PropertyValues } from "lit"; | ||
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils"; | ||
export interface FtRippleProperties { | ||
primary: boolean; | ||
secondary: boolean; | ||
unbounded: boolean; | ||
selected: boolean; | ||
disabled: boolean; | ||
} | ||
export declare const FtRippleCssVariables: { | ||
color: import("@fluid-topics/ft-wc-utils").FtCssVariable; | ||
backgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable; | ||
opacityContentOnSurfacePressed: import("@fluid-topics/ft-wc-utils").FtCssVariable; | ||
opacityContentOnSurfaceHover: import("@fluid-topics/ft-wc-utils").FtCssVariable; | ||
opacityContentOnSurfaceFocused: import("@fluid-topics/ft-wc-utils").FtCssVariable; | ||
opacityContentOnSurfaceSelected: import("@fluid-topics/ft-wc-utils").FtCssVariable; | ||
}; | ||
import { FtRippleProperties } from "./ft-ripple.properties"; | ||
export declare class FtRipple extends FtLitElement implements FtRippleProperties { | ||
@@ -19,0 +5,0 @@ static elementDefinitions: ElementDefinitionsMap; |
@@ -7,25 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { css, html, } from "lit"; | ||
import { html, } from "lit"; | ||
import { property, query, state } from "lit/decorators.js"; | ||
import { classMap } from "lit/directives/class-map.js"; | ||
import { Debouncer, designSystemVariables, FtCssVariableFactory, FtLitElement } from "@fluid-topics/ft-wc-utils"; | ||
const colorCssVar = FtCssVariableFactory.extend("--ft-ripple-color", designSystemVariables.colorContent); | ||
export const FtRippleCssVariables = { | ||
color: colorCssVar, | ||
backgroundColor: FtCssVariableFactory.extend("--ft-ripple-background-color", colorCssVar), | ||
opacityContentOnSurfacePressed: FtCssVariableFactory.external(designSystemVariables.opacityContentOnSurfacePressed, "Design system"), | ||
opacityContentOnSurfaceHover: FtCssVariableFactory.external(designSystemVariables.opacityContentOnSurfaceHover, "Design system"), | ||
opacityContentOnSurfaceFocused: FtCssVariableFactory.external(designSystemVariables.opacityContentOnSurfaceFocused, "Design system"), | ||
opacityContentOnSurfaceSelected: FtCssVariableFactory.external(designSystemVariables.opacityContentOnSurfaceSelected, "Design system"), | ||
}; | ||
const primaryColorCssVar = FtCssVariableFactory.extend("--ft-ripple-color", designSystemVariables.colorPrimary); | ||
const FtRipplePrimaryCssVariables = { | ||
color: primaryColorCssVar, | ||
backgroundColor: FtCssVariableFactory.extend("--ft-ripple-background-color", primaryColorCssVar), | ||
}; | ||
const secondaryColorCssVar = FtCssVariableFactory.extend("--ft-ripple-color", designSystemVariables.colorSecondary); | ||
const FtRippleSecondaryCssVariables = { | ||
color: secondaryColorCssVar, | ||
backgroundColor: FtCssVariableFactory.extend("--ft-ripple-background-color", secondaryColorCssVar), | ||
}; | ||
import { Debouncer, FtLitElement } from "@fluid-topics/ft-wc-utils"; | ||
import { styles } from "./ft-ripple.css"; | ||
export class FtRipple extends FtLitElement { | ||
@@ -249,93 +231,3 @@ constructor() { | ||
FtRipple.elementDefinitions = {}; | ||
//language=css | ||
FtRipple.styles = css ` | ||
:host { | ||
display: contents; | ||
} | ||
.ft-ripple { | ||
position: absolute; | ||
inset: 0; | ||
pointer-events: none; | ||
} | ||
.ft-ripple:not(.ft-ripple--unbounded) { | ||
overflow: hidden; | ||
} | ||
.ft-ripple .ft-ripple--background, | ||
.ft-ripple .ft-ripple--effect { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
background-color: ${FtRippleCssVariables.backgroundColor}; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
background-color: ${FtRippleCssVariables.color}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--background { | ||
background-color: ${FtRippleSecondaryCssVariables.backgroundColor}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--effect { | ||
background-color: ${FtRippleSecondaryCssVariables.color}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--background { | ||
background-color: ${FtRipplePrimaryCssVariables.backgroundColor}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--effect { | ||
background-color: ${FtRipplePrimaryCssVariables.color}; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
transition: opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
border-radius: 50%; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
transform: translate(-50%, -50%) scale(0.15); | ||
transition: transform 300ms ease, opacity 75ms linear; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
left: 50%; | ||
top: 50%; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
transform: translate(-50%, -50%); | ||
} | ||
.ft-ripple.ft-ripple--hovered .ft-ripple--background { | ||
opacity: ${FtRippleCssVariables.opacityContentOnSurfaceHover}; | ||
} | ||
.ft-ripple.ft-ripple--selected .ft-ripple--background { | ||
opacity: ${FtRippleCssVariables.opacityContentOnSurfaceSelected}; | ||
} | ||
.ft-ripple.ft-ripple--focused .ft-ripple--background { | ||
opacity: ${FtRippleCssVariables.opacityContentOnSurfaceFocused}; | ||
} | ||
.ft-ripple.ft-ripple--pressed .ft-ripple--effect { | ||
opacity: ${FtRippleCssVariables.opacityContentOnSurfacePressed}; | ||
transform: translate(-50%, -50%) scale(1); | ||
} | ||
`; | ||
FtRipple.styles = styles; | ||
__decorate([ | ||
@@ -342,0 +234,0 @@ property({ type: Boolean }) |
@@ -1,107 +0,107 @@ | ||
!function(t,i,e,s,r){var p=function(t,i,e,s){for(var r,p=arguments.length,o=p<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(p<3?r(o):p>3?r(i,e,o):r(i,e))||o);return p>3&&o&&Object.defineProperty(i,e,o),o};const o=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),l={color:o,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",o),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},n=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),f=n,h=i.FtCssVariableFactory.extend("--ft-ripple-background-color",n),a=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),d=a,c=i.FtCssVariableFactory.extend("--ft-ripple-background-color",a);class u extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:s,y:r}=this.getCoordinates(t),p=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=s?s-p.x:p.width/2),this.originY=Math.round(null!=r?r-p.y:p.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html` | ||
<style> | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
width: ${this.rippleSize}px; | ||
height: ${this.rippleSize}px; | ||
} | ||
!function(t,i,e,s,r){const p=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),o={color:p,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",p),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},l=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),n={color:l,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",l)},f=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),h={color:f,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",f)},a=e.css` | ||
:host { | ||
display: contents; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
left: ${this.originX}px; | ||
top: ${this.originY}px; | ||
} | ||
</style> | ||
<div class="${r.classMap(t)}"> | ||
<div class="ft-ripple--background"></div> | ||
<div class="ft-ripple--effect"></div> | ||
</div> | ||
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),s=i("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",s),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",r),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",s),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",r),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let s,r;return null!=i.x?({x:s,y:r}=i):null!=e.touches&&(s=e.touches[0].clientX,r=e.touches[0].clientY),{x:s,y:r}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}u.elementDefinitions={},u.styles=e.css` | ||
:host { | ||
display: contents; | ||
} | ||
.ft-ripple { | ||
position: absolute; | ||
inset: 0; | ||
pointer-events: none; | ||
} | ||
.ft-ripple { | ||
position: absolute; | ||
inset: 0; | ||
pointer-events: none; | ||
} | ||
.ft-ripple:not(.ft-ripple--unbounded) { | ||
overflow: hidden; | ||
} | ||
.ft-ripple:not(.ft-ripple--unbounded) { | ||
overflow: hidden; | ||
} | ||
.ft-ripple .ft-ripple--background, | ||
.ft-ripple .ft-ripple--effect { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
.ft-ripple .ft-ripple--background, | ||
.ft-ripple .ft-ripple--effect { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
background-color: ${o.backgroundColor}; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
background-color: ${l.backgroundColor}; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
background-color: ${o.color}; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
background-color: ${l.color}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--background { | ||
background-color: ${h.backgroundColor}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--background { | ||
background-color: ${c}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--effect { | ||
background-color: ${h.color}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--effect { | ||
background-color: ${d}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--background { | ||
background-color: ${n.backgroundColor}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--background { | ||
background-color: ${h}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--effect { | ||
background-color: ${n.color}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--effect { | ||
background-color: ${f}; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
transition: opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
transition: opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
border-radius: 50%; | ||
} | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
border-radius: 50%; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
transform: translate(-50%, -50%) scale(0.15); | ||
transition: transform 300ms ease, opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
transform: translate(-50%, -50%) scale(0.15); | ||
transition: transform 300ms ease, opacity 75ms linear; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
left: 50%; | ||
top: 50%; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
left: 50%; | ||
top: 50%; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
transform: translate(-50%, -50%); | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
transform: translate(-50%, -50%); | ||
} | ||
.ft-ripple.ft-ripple--hovered .ft-ripple--background { | ||
opacity: ${o.opacityContentOnSurfaceHover}; | ||
} | ||
.ft-ripple.ft-ripple--hovered .ft-ripple--background { | ||
opacity: ${l.opacityContentOnSurfaceHover}; | ||
} | ||
.ft-ripple.ft-ripple--selected .ft-ripple--background { | ||
opacity: ${o.opacityContentOnSurfaceSelected}; | ||
} | ||
.ft-ripple.ft-ripple--selected .ft-ripple--background { | ||
opacity: ${l.opacityContentOnSurfaceSelected}; | ||
} | ||
.ft-ripple.ft-ripple--focused .ft-ripple--background { | ||
opacity: ${o.opacityContentOnSurfaceFocused}; | ||
} | ||
.ft-ripple.ft-ripple--focused .ft-ripple--background { | ||
opacity: ${l.opacityContentOnSurfaceFocused}; | ||
} | ||
.ft-ripple.ft-ripple--pressed .ft-ripple--effect { | ||
opacity: ${o.opacityContentOnSurfacePressed}; | ||
transform: translate(-50%, -50%) scale(1); | ||
} | ||
`;var d=function(t,i,e,s){for(var r,p=arguments.length,o=p<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(p<3?r(o):p>3?r(i,e,o):r(i,e))||o);return p>3&&o&&Object.defineProperty(i,e,o),o};class c extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:s,y:r}=this.getCoordinates(t),p=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=s?s-p.x:p.width/2),this.originY=Math.round(null!=r?r-p.y:p.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html` | ||
<style> | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
width: ${this.rippleSize}px; | ||
height: ${this.rippleSize}px; | ||
} | ||
.ft-ripple.ft-ripple--pressed .ft-ripple--effect { | ||
opacity: ${l.opacityContentOnSurfacePressed}; | ||
transform: translate(-50%, -50%) scale(1); | ||
} | ||
`,p([s.property({type:Boolean})],u.prototype,"primary",void 0),p([s.property({type:Boolean})],u.prototype,"secondary",void 0),p([s.property({type:Boolean})],u.prototype,"unbounded",void 0),p([s.property({type:Boolean})],u.prototype,"activated",void 0),p([s.property({type:Boolean})],u.prototype,"selected",void 0),p([s.property({type:Boolean})],u.prototype,"disabled",void 0),p([s.state()],u.prototype,"hovered",void 0),p([s.state()],u.prototype,"focused",void 0),p([s.state()],u.prototype,"pressed",void 0),p([s.state()],u.prototype,"rippling",void 0),p([s.state()],u.prototype,"rippleSize",void 0),p([s.state()],u.prototype,"originX",void 0),p([s.state()],u.prototype,"originY",void 0),p([s.query(".ft-ripple")],u.prototype,"ripple",void 0),p([s.query(".ft-ripple--effect")],u.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(u),t.FtRipple=u,t.FtRippleCssVariables=l,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap); | ||
.ft-ripple .ft-ripple--effect { | ||
left: ${this.originX}px; | ||
top: ${this.originY}px; | ||
} | ||
</style> | ||
<div class="${r.classMap(t)}"> | ||
<div class="ft-ripple--background"></div> | ||
<div class="ft-ripple--effect"></div> | ||
</div> | ||
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),s=i("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",s),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",r),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",s),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",r),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let s,r;return null!=i.x?({x:s,y:r}=i):null!=e.touches&&(s=e.touches[0].clientX,r=e.touches[0].clientY),{x:s,y:r}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}c.elementDefinitions={},c.styles=a,d([s.property({type:Boolean})],c.prototype,"primary",void 0),d([s.property({type:Boolean})],c.prototype,"secondary",void 0),d([s.property({type:Boolean})],c.prototype,"unbounded",void 0),d([s.property({type:Boolean})],c.prototype,"activated",void 0),d([s.property({type:Boolean})],c.prototype,"selected",void 0),d([s.property({type:Boolean})],c.prototype,"disabled",void 0),d([s.state()],c.prototype,"hovered",void 0),d([s.state()],c.prototype,"focused",void 0),d([s.state()],c.prototype,"pressed",void 0),d([s.state()],c.prototype,"rippling",void 0),d([s.state()],c.prototype,"rippleSize",void 0),d([s.state()],c.prototype,"originX",void 0),d([s.state()],c.prototype,"originY",void 0),d([s.query(".ft-ripple")],c.prototype,"ripple",void 0),d([s.query(".ft-ripple--effect")],c.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(c),t.FtRipple=c,t.FtRippleCssVariables=o,t.FtRipplePrimaryCssVariables=n,t.FtRippleSecondaryCssVariables=h,t.styles=a,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap); |
@@ -17,3 +17,3 @@ !function(t){ | ||
*/ | ||
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,s=window.customElements,o=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,o){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(o))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=o.prototype.attributeChangedCallback,a=new Set(o.observedAttributes||[]);u(o,a,l);const c={elementClass:o,connectedCallback:o.prototype.connectedCallback,disconnectedCallback:o.prototype.disconnectedCallback,adoptedCallback:o.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:o.formAssociated,formAssociatedCallback:o.prototype.formAssociatedCallback,formDisabledCallback:o.prototype.formDisabledCallback,formResetCallback:o.prototype.formResetCallback,formStateRestoreCallback:o.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,c),this._definitionsByClass.set(o,c);let h=e.call(s,t);h||(h=p(t),i.call(s,t,h)),this===window.customElements&&(n.set(o,c),c.standInClass=h);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)r.delete(t),f(t,c,!0)}const v=this._whenDefinedPromises.get(t);return void 0!==v&&(v.resolve(o),this._whenDefinedPromises.delete(t)),o}upgrade(){y.push(this),s.upgrade.apply(s,arguments),y.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let s=this._awaitingUpgrade.get(i);s||this._awaitingUpgrade.set(i,s=new Set),e?s.add(t):s.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=n.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),o.set(i,e),i},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,h=t=>{let i=t.getRootNode();if(!c(i)){const t=y[y.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),c(i)||(i=l.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const s=h(e)||window.customElements,o=s._getDefinition(i);return o?f(e,o):r.set(e,s),e}connectedCallback(){const t=o.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=o.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){o.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=o.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=o.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=o.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=o.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},u=(t,i,e)=>{if(0===i.size||void 0===e)return;const s=t.prototype.setAttribute;s&&(t.prototype.setAttribute=function(t,o){const r=t.toLowerCase();if(i.has(r)){const t=this.getAttribute(r);s.call(this,r,o),e.call(this,r,t,o)}else s.call(this,r,o)});const o=t.prototype.removeAttribute;o&&(t.prototype.removeAttribute=function(t){const s=t.toLowerCase();if(i.has(s)){const t=this.getAttribute(s);o.call(this,s),e.call(this,s,t,null)}else o.call(this,s)})},d=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):d(e)},f=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),o.set(t,i),a=t;try{new i.elementClass}catch(t){d(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=v.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let y=[document];const b=(t,i,e)=>{const s=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){y.push(this);const t=s.apply(e||this,arguments);return void 0!==t&&l.set(t,this),y.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const m=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){y.push(this),e.set.call(this,t),y.pop()}})};if(m(Element,"innerHTML"),m(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const s=i.call(this,...e);return t.set(s,this),s},e.forEach((i=>{const e=window.ElementInternals.prototype,s=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==o.get(e).formAssociated)throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`);s?.call(this,...i)}}));class s extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class r{constructor(t){const i=new Map;t.forEach(((t,e)=>{const s=t.getAttribute("name"),o=i.get(s)||[];this[+e]=t,o.push(t),i.set(s,o)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new s(t))}))}namedItem(t){return this[t]}}const n=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=n.get.call(this,[]),i=[];for(const e of t){const t=o.get(e);t&&!0!==t.formAssociated||i.push(e)}return new r(i)}})}}try{window.customElements.define("custom-element",null)}catch(t){const i=window.customElements.define;window.customElements.define=(t,e,s)=>{try{i.bind(window.customElements)(t,e,s)}catch(i){console.warn(t,e,s,i)}}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){this.callbacks=[t],this.debounce(i)}queue(t,i){this.callbacks.push(t),this.debounce(i)}cancel(){null!=this._debounce&&window.clearTimeout(this._debounce)}debounce(t){this.cancel(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout)}runCallbacks(){for(let t of this.callbacks)t();this.callbacks=[]}} | ||
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,s=window.customElements,o=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,o){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(o))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=o.prototype.attributeChangedCallback,a=new Set(o.observedAttributes||[]);u(o,a,l);const c={elementClass:o,connectedCallback:o.prototype.connectedCallback,disconnectedCallback:o.prototype.disconnectedCallback,adoptedCallback:o.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:o.formAssociated,formAssociatedCallback:o.prototype.formAssociatedCallback,formDisabledCallback:o.prototype.formDisabledCallback,formResetCallback:o.prototype.formResetCallback,formStateRestoreCallback:o.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,c),this._definitionsByClass.set(o,c);let h=e.call(s,t);h||(h=p(t),i.call(s,t,h)),this===window.customElements&&(n.set(o,c),c.standInClass=h);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)r.delete(t),f(t,c,!0)}const v=this._whenDefinedPromises.get(t);return void 0!==v&&(v.resolve(o),this._whenDefinedPromises.delete(t)),o}upgrade(){b.push(this),s.upgrade.apply(s,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let s=this._awaitingUpgrade.get(i);s||this._awaitingUpgrade.set(i,s=new Set),e?s.add(t):s.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=n.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),o.set(i,e),i},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,h=t=>{let i=t.getRootNode();if(!c(i)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),c(i)||(i=l.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const s=h(e)||window.customElements,o=s._getDefinition(i);return o?f(e,o):r.set(e,s),e}connectedCallback(){const t=o.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=o.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){o.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=o.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=o.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=o.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=o.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},u=(t,i,e)=>{if(0===i.size||void 0===e)return;const s=t.prototype.setAttribute;s&&(t.prototype.setAttribute=function(t,o){const r=t.toLowerCase();if(i.has(r)){const t=this.getAttribute(r);s.call(this,r,o),e.call(this,r,t,o)}else s.call(this,r,o)});const o=t.prototype.removeAttribute;o&&(t.prototype.removeAttribute=function(t){const s=t.toLowerCase();if(i.has(s)){const t=this.getAttribute(s);o.call(this,s),e.call(this,s,t,null)}else o.call(this,s)})},d=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):d(e)},f=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),o.set(t,i),a=t;try{new i.elementClass}catch(t){d(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=v.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let b=[document];const y=(t,i,e)=>{const s=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){b.push(this);const t=s.apply(e||this,arguments);return void 0!==t&&l.set(t,this),b.pop(),t}};y(ShadowRoot,"createElement",document),y(ShadowRoot,"importNode",document),y(Element,"insertAdjacentHTML");const m=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){b.push(this),e.set.call(this,t),b.pop()}})};if(m(Element,"innerHTML"),m(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const s=i.call(this,...e);return t.set(s,this),s},e.forEach((i=>{const e=window.ElementInternals.prototype,s=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==o.get(e).formAssociated)throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`);s?.call(this,...i)}}));class s extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class r{constructor(t){const i=new Map;t.forEach(((t,e)=>{const s=t.getAttribute("name"),o=i.get(s)||[];this[+e]=t,o.push(t),i.set(s,o)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new s(t))}))}namedItem(t){return this[t]}}const n=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=n.get.call(this,[]),i=[];for(const e of t){const t=o.get(e);t&&!0!==t.formAssociated||i.push(e)}return new r(i)}})}}try{window.customElements.define("custom-element",null)}catch(t){const i=window.customElements.define;window.customElements.define=(t,e,s)=>{try{i.bind(window.customElements)(t,e,s)}catch(i){console.warn(t,e,s,i)}}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){this.callbacks=[t],this.debounce(i)}queue(t,i){this.callbacks.push(t),this.debounce(i)}cancel(){null!=this._debounce&&window.clearTimeout(this._debounce)}debounce(t){this.cancel(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout)}runCallbacks(){for(let t of this.callbacks)t();this.callbacks=[]}} | ||
/** | ||
@@ -55,3 +55,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/;var v;const y=window.trustedTypes,b=y?y.emptyScript:"",m=window.reactiveElementPolyfillSupport,g={toAttribute(t,i){switch(i){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},x=(t,i)=>i!==t&&(i==i||t==t),w={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:x};class O extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var i;null!==(i=this.h)&&void 0!==i||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,e)=>{const s=this._$Ep(e,i);void 0!==s&&(this._$Ev.set(s,e),t.push(s))})),t}static createProperty(t,i=w){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,e,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(s){const o=this[t];this[i]=s,this.requestUpdate(t,o,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||w}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(f(t))}else void 0!==t&&i.push(f(t));return i}static _$Ep(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,e;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return d(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,e){this._$AK(t,e)}_$EO(t,i,e=w){var s,o;const r=this.constructor._$Ep(t,e);if(void 0!==r&&!0===e.reflect){const n=(null!==(o=null===(s=e.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==o?o:g.toAttribute)(i,e.type);this._$El=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(t,i){var e,s;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),n=t.converter,l=null!==(s=null!==(e=null==n?void 0:n.fromAttribute)&&void 0!==e?e:"function"==typeof n?n:null)&&void 0!==s?s:g.fromAttribute;this._$El=r,this[r]=l(i,t.type),this._$El=null}}requestUpdate(t,i,e){let s=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||x)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,e))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(e)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(e)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} | ||
*/;var v;const b=window.trustedTypes,y=b?b.emptyScript:"",m=window.reactiveElementPolyfillSupport,g={toAttribute(t,i){switch(i){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},x=(t,i)=>i!==t&&(i==i||t==t),w={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:x};class O extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var i;null!==(i=this.h)&&void 0!==i||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,e)=>{const s=this._$Ep(e,i);void 0!==s&&(this._$Ev.set(s,e),t.push(s))})),t}static createProperty(t,i=w){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,e,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(s){const o=this[t];this[i]=s,this.requestUpdate(t,o,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||w}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(f(t))}else void 0!==t&&i.push(f(t));return i}static _$Ep(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,e;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return d(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,e){this._$AK(t,e)}_$EO(t,i,e=w){var s,o;const r=this.constructor._$Ep(t,e);if(void 0!==r&&!0===e.reflect){const n=(null!==(o=null===(s=e.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==o?o:g.toAttribute)(i,e.type);this._$El=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(t,i){var e,s;const o=this.constructor,r=o._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=o.getPropertyOptions(r),n=t.converter,l=null!==(s=null!==(e=null==n?void 0:n.fromAttribute)&&void 0!==e?e:"function"==typeof n?n:null)&&void 0!==s?s:g.fromAttribute;this._$El=r,this[r]=l(i,t.type),this._$El=null}}requestUpdate(t,i,e){let s=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||x)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,e))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(e)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(e)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}} | ||
/** | ||
@@ -99,108 +99,108 @@ * @license | ||
*/ | ||
const ft=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==dt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var e,s;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(e=this.st)||void 0===e?void 0:e.has(t))&&this.nt.add(t);return this.render(i)}const o=t.element.classList;this.nt.forEach((t=>{t in i||(o.remove(t),this.nt.delete(t))}));for(const t in i){const e=!!i[t];e===this.nt.has(t)||(null===(s=this.st)||void 0===s?void 0:s.has(t))||(e?(o.add(t),this.nt.add(t)):(o.remove(t),this.nt.delete(t)))}return W}});var vt=function(t,i,e,s){for(var o,r=arguments.length,n=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(i,e,n):o(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};const yt=lt.extend("--ft-ripple-color",at.colorContent),bt={color:yt,backgroundColor:lt.extend("--ft-ripple-background-color",yt),opacityContentOnSurfacePressed:lt.external(at.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:lt.external(at.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:lt.external(at.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:lt.external(at.opacityContentOnSurfaceSelected,"Design system")},mt=lt.extend("--ft-ripple-color",at.colorPrimary),gt=mt,xt=lt.extend("--ft-ripple-background-color",mt),wt=lt.extend("--ft-ripple-color",at.colorSecondary),Ot=wt,St=lt.extend("--ft-ripple-background-color",wt);class Ct extends ut{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:s,y:o}=this.getCoordinates(t),r=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=s?s-r.x:r.width/2),this.originY=Math.round(null!=o?o-r.y:r.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return D` | ||
<style> | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
width: ${this.rippleSize}px; | ||
height: ${this.rippleSize}px; | ||
} | ||
const ft=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==dt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var e,s;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(e=this.st)||void 0===e?void 0:e.has(t))&&this.nt.add(t);return this.render(i)}const o=t.element.classList;this.nt.forEach((t=>{t in i||(o.remove(t),this.nt.delete(t))}));for(const t in i){const e=!!i[t];e===this.nt.has(t)||(null===(s=this.st)||void 0===s?void 0:s.has(t))||(e?(o.add(t),this.nt.add(t)):(o.remove(t),this.nt.delete(t)))}return W}}),vt=lt.extend("--ft-ripple-color",at.colorContent),bt={color:vt,backgroundColor:lt.extend("--ft-ripple-background-color",vt),opacityContentOnSurfacePressed:lt.external(at.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:lt.external(at.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:lt.external(at.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:lt.external(at.opacityContentOnSurfaceSelected,"Design system")},yt=lt.extend("--ft-ripple-color",at.colorPrimary),mt={color:yt,backgroundColor:lt.extend("--ft-ripple-background-color",yt)},gt=lt.extend("--ft-ripple-color",at.colorSecondary),xt={color:gt,backgroundColor:lt.extend("--ft-ripple-background-color",gt)},wt=u` | ||
:host { | ||
display: contents; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
left: ${this.originX}px; | ||
top: ${this.originY}px; | ||
} | ||
</style> | ||
<div class="${ft(t)}"> | ||
<div class="ft-ripple--background"></div> | ||
<div class="ft-ripple--effect"></div> | ||
</div> | ||
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),s=i("touchend","touchcancel"),o=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",s),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",o),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",s),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",o),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let s,o;return null!=i.x?({x:s,y:o}=i):null!=e.touches&&(s=e.touches[0].clientX,o=e.touches[0].clientY),{x:s,y:o}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}var Nt;Ct.elementDefinitions={},Ct.styles=u` | ||
:host { | ||
display: contents; | ||
} | ||
.ft-ripple { | ||
position: absolute; | ||
inset: 0; | ||
pointer-events: none; | ||
} | ||
.ft-ripple { | ||
position: absolute; | ||
inset: 0; | ||
pointer-events: none; | ||
} | ||
.ft-ripple:not(.ft-ripple--unbounded) { | ||
overflow: hidden; | ||
} | ||
.ft-ripple:not(.ft-ripple--unbounded) { | ||
overflow: hidden; | ||
} | ||
.ft-ripple .ft-ripple--background, | ||
.ft-ripple .ft-ripple--effect { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
.ft-ripple .ft-ripple--background, | ||
.ft-ripple .ft-ripple--effect { | ||
position: absolute; | ||
opacity: 0; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
background-color: ${bt.backgroundColor}; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
background-color: ${bt.backgroundColor}; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
background-color: ${bt.color}; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
background-color: ${bt.color}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--background { | ||
background-color: ${xt.backgroundColor}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--background { | ||
background-color: ${St}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--effect { | ||
background-color: ${xt.color}; | ||
} | ||
.ft-ripple.ft-ripple--secondary .ft-ripple--effect { | ||
background-color: ${Ot}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--background { | ||
background-color: ${mt.backgroundColor}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--background { | ||
background-color: ${xt}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--effect { | ||
background-color: ${mt.color}; | ||
} | ||
.ft-ripple.ft-ripple--primary .ft-ripple--effect { | ||
background-color: ${gt}; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
transition: opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--background { | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
transition: opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
border-radius: 50%; | ||
} | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
border-radius: 50%; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
transform: translate(-50%, -50%) scale(0.15); | ||
transition: transform 300ms ease, opacity 75ms linear; | ||
} | ||
.ft-ripple .ft-ripple--effect { | ||
transform: translate(-50%, -50%) scale(0.15); | ||
transition: transform 300ms ease, opacity 75ms linear; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
left: 50%; | ||
top: 50%; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
left: 50%; | ||
top: 50%; | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
transform: translate(-50%, -50%); | ||
} | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
transform: translate(-50%, -50%); | ||
} | ||
.ft-ripple.ft-ripple--hovered .ft-ripple--background { | ||
opacity: ${bt.opacityContentOnSurfaceHover}; | ||
} | ||
.ft-ripple.ft-ripple--hovered .ft-ripple--background { | ||
opacity: ${bt.opacityContentOnSurfaceHover}; | ||
} | ||
.ft-ripple.ft-ripple--selected .ft-ripple--background { | ||
opacity: ${bt.opacityContentOnSurfaceSelected}; | ||
} | ||
.ft-ripple.ft-ripple--selected .ft-ripple--background { | ||
opacity: ${bt.opacityContentOnSurfaceSelected}; | ||
} | ||
.ft-ripple.ft-ripple--focused .ft-ripple--background { | ||
opacity: ${bt.opacityContentOnSurfaceFocused}; | ||
} | ||
.ft-ripple.ft-ripple--focused .ft-ripple--background { | ||
opacity: ${bt.opacityContentOnSurfaceFocused}; | ||
} | ||
.ft-ripple.ft-ripple--pressed .ft-ripple--effect { | ||
opacity: ${bt.opacityContentOnSurfacePressed}; | ||
transform: translate(-50%, -50%) scale(1); | ||
} | ||
`;var Ot,St=function(t,i,e,s){for(var o,r=arguments.length,n=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(i,e,n):o(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};class Ct extends ut{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:s,y:o}=this.getCoordinates(t),r=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=s?s-r.x:r.width/2),this.originY=Math.round(null!=o?o-r.y:r.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return D` | ||
<style> | ||
.ft-ripple .ft-ripple--effect, | ||
.ft-ripple.ft-ripple--unbounded .ft-ripple--background { | ||
width: ${this.rippleSize}px; | ||
height: ${this.rippleSize}px; | ||
} | ||
.ft-ripple.ft-ripple--pressed .ft-ripple--effect { | ||
opacity: ${bt.opacityContentOnSurfacePressed}; | ||
transform: translate(-50%, -50%) scale(1); | ||
} | ||
`,vt([s({type:Boolean})],Ct.prototype,"primary",void 0),vt([s({type:Boolean})],Ct.prototype,"secondary",void 0),vt([s({type:Boolean})],Ct.prototype,"unbounded",void 0),vt([s({type:Boolean})],Ct.prototype,"activated",void 0),vt([s({type:Boolean})],Ct.prototype,"selected",void 0),vt([s({type:Boolean})],Ct.prototype,"disabled",void 0),vt([o()],Ct.prototype,"hovered",void 0),vt([o()],Ct.prototype,"focused",void 0),vt([o()],Ct.prototype,"pressed",void 0),vt([o()],Ct.prototype,"rippling",void 0),vt([o()],Ct.prototype,"rippleSize",void 0),vt([o()],Ct.prototype,"originX",void 0),vt([o()],Ct.prototype,"originY",void 0),vt([r(".ft-ripple")],Ct.prototype,"ripple",void 0),vt([r(".ft-ripple--effect")],Ct.prototype,"rippleEffect",void 0),(Nt="ft-ripple",t=>{window.customElements.get(Nt)||window.customElements.define(Nt,t)})(Ct),t.FtRipple=Ct,t.FtRippleCssVariables=bt,Object.defineProperty(t,"i",{value:!0})}({}); | ||
.ft-ripple .ft-ripple--effect { | ||
left: ${this.originX}px; | ||
top: ${this.originY}px; | ||
} | ||
</style> | ||
<div class="${ft(t)}"> | ||
<div class="ft-ripple--background"></div> | ||
<div class="ft-ripple--effect"></div> | ||
</div> | ||
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),s=i("touchend","touchcancel"),o=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",s),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",o),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",s),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",o),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let s,o;return null!=i.x?({x:s,y:o}=i):null!=e.touches&&(s=e.touches[0].clientX,o=e.touches[0].clientY),{x:s,y:o}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}Ct.elementDefinitions={},Ct.styles=wt,St([s({type:Boolean})],Ct.prototype,"primary",void 0),St([s({type:Boolean})],Ct.prototype,"secondary",void 0),St([s({type:Boolean})],Ct.prototype,"unbounded",void 0),St([s({type:Boolean})],Ct.prototype,"activated",void 0),St([s({type:Boolean})],Ct.prototype,"selected",void 0),St([s({type:Boolean})],Ct.prototype,"disabled",void 0),St([o()],Ct.prototype,"hovered",void 0),St([o()],Ct.prototype,"focused",void 0),St([o()],Ct.prototype,"pressed",void 0),St([o()],Ct.prototype,"rippling",void 0),St([o()],Ct.prototype,"rippleSize",void 0),St([o()],Ct.prototype,"originX",void 0),St([o()],Ct.prototype,"originY",void 0),St([r(".ft-ripple")],Ct.prototype,"ripple",void 0),St([r(".ft-ripple--effect")],Ct.prototype,"rippleEffect",void 0),(Ot="ft-ripple",t=>{window.customElements.get(Ot)||window.customElements.define(Ot,t)})(Ct),t.FtRipple=Ct,t.FtRippleCssVariables=bt,t.FtRipplePrimaryCssVariables=mt,t.FtRippleSecondaryCssVariables=xt,t.styles=wt,Object.defineProperty(t,"i",{value:!0})}({}); |
export * from "./ft-ripple"; | ||
export * from "./ft-ripple.css"; | ||
export * from "./ft-ripple.properties"; | ||
//# sourceMappingURL=index.d.ts.map |
import { customElement } from "@fluid-topics/ft-wc-utils"; | ||
import { FtRipple } from "./ft-ripple"; | ||
export * from "./ft-ripple"; | ||
export * from "./ft-ripple.css"; | ||
export * from "./ft-ripple.properties"; | ||
customElement("ft-ripple")(FtRipple); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@fluid-topics/ft-ripple", | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"description": "A custom Fluid Topics ripple component", | ||
@@ -22,6 +22,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@fluid-topics/ft-wc-utils": "0.3.12", | ||
"@fluid-topics/ft-wc-utils": "0.3.13", | ||
"lit": "2.2.8" | ||
}, | ||
"gitHead": "126fc60c5ec4b89c3897901d1a92ee9b17286686" | ||
"gitHead": "84b5fc920bc5d2bdb646b5da8815ad51caaf228e" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75559
12
895
+ Added@fluid-topics/ft-wc-utils@0.3.13(transitive)
- Removed@fluid-topics/ft-wc-utils@0.3.12(transitive)