@fluid-topics/ft-ripple 2.0.27 → 2.0.29
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/define.js +3 -3
- package/build/definitions.d.ts +5 -0
- package/build/definitions.js +4 -0
- package/build/ft-ripple.light.js +2 -2
- package/build/ft-ripple.min.js +31 -133
- package/package.json +3 -3
package/build/define.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { customElements } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import definitions from "./definitions";
|
|
3
|
+
customElements(definitions);
|
package/build/ft-ripple.light.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var T=Object.create;var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var v=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var G=(l,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of M(e))!Y.call(l,r)&&r!==t&&y(l,r,{get:()=>e[r],enumerable:!(o=I(e,r))||o.enumerable});return l};var f=(l,e,t)=>(t=l!=null?T(X(l)):{},G(e||!l||!l.__esModule?y(t,"default",{value:l,enumerable:!0}):t,l));var m=v((N,g)=>{g.exports=ftGlobals.wcUtils});var b=v((U,E)=>{E.exports=ftGlobals.lit});var k=v((q,C)=>{C.exports=ftGlobals.litDecorators});var F=v((Z,x)=>{x.exports=ftGlobals.litClassMap});var V=f(m());var P=f(b()),a=f(k()),$=f(F()),h=f(m());var O=f(b()),s=f(m()),L=s.FtCssVariableFactory.extend("--ft-ripple-color","",s.designSystemVariables.colorContent),u={color:L,backgroundColor:s.FtCssVariableFactory.extend("--ft-ripple-background-color","",L),opacityContentOnSurfacePressed:s.FtCssVariableFactory.external(s.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:s.FtCssVariableFactory.external(s.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:s.FtCssVariableFactory.external(s.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:s.FtCssVariableFactory.external(s.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:s.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},S=s.FtCssVariableFactory.extend("--ft-ripple-color","",s.designSystemVariables.colorPrimary),w={color:S,backgroundColor:s.FtCssVariableFactory.extend("--ft-ripple-background-color","",S)},R=s.FtCssVariableFactory.extend("--ft-ripple-color","",s.designSystemVariables.colorSecondary),D={color:R,backgroundColor:s.FtCssVariableFactory.extend("--ft-ripple-background-color","",R)},H=O.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -121,4 +121,4 @@
|
|
|
121
121
|
<div class="ft-ripple--background"></div>
|
|
122
122
|
<div class="ft-ripple--effect"></div>
|
|
123
123
|
</div>
|
|
124
|
-
`}contentAvailableCallback(e){super.contentAvailableCallback(e),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(e){var t,o;super.update(e),e.has("disabled")&&(this.disabled?(this.endRipple(),(t=this.target)===null||t===void 0||t.removeAttribute("data-is-ft-ripple-target")):(o=this.target)===null||o===void 0||o.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 e,t;let o=(e=this.shadowRoot)===null||e===void 0?void 0:e.host.parentElement;o&&this.setupFor((t=this.target)!==null&&t!==void 0?t:o)}forceFocusUpdate(){var e;!((e=this.target)===null||e===void 0)&&e.matches(":focus-within")?this.startFocus():this.endFocus()}setupFor(e){if(this.setupDebouncer.cancel(),this.target===e)return;this.onDisconnect&&this.onDisconnect(),this.target=e,e.setAttribute("data-is-ft-ripple-target","true");let t=(...c)=>
|
|
124
|
+
`}contentAvailableCallback(e){super.contentAvailableCallback(e),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(e){var t,o;super.update(e),e.has("disabled")&&(this.disabled?(this.endRipple(),(t=this.target)===null||t===void 0||t.removeAttribute("data-is-ft-ripple-target")):(o=this.target)===null||o===void 0||o.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 e,t;let o=(e=this.shadowRoot)===null||e===void 0?void 0:e.host.parentElement;o&&this.setupFor((t=this.target)!==null&&t!==void 0?t:o)}forceFocusUpdate(){var e;!((e=this.target)===null||e===void 0)&&e.matches(":focus-within")?this.startFocus():this.endFocus()}setupFor(e){if(this.setupDebouncer.cancel(),this.target===e)return;this.onDisconnect&&this.onDisconnect(),this.target=e,e.setAttribute("data-is-ft-ripple-target","true");let t=(...c)=>A=>{c.forEach(B=>window.addEventListener(B,this.endPress,{once:!0})),this.startPress(A)},o=t("mouseup","contextmenu"),r=t("touchend","touchcancel"),p=c=>{["Enter"," "].includes(c.key)&&t("keyup")(c)},i={passive:!0};e.addEventListener("mouseover",this.startHover,i),e.addEventListener("mousemove",this.moveRipple,i),e.addEventListener("mouseleave",this.endHover,i),e.addEventListener("mousedown",o,i),e.addEventListener("touchstart",r,i),e.addEventListener("touchmove",this.moveRipple,i),e.addEventListener("keydown",p,i),e.addEventListener("focus",this.startFocus,i),e.addEventListener("blur",this.endFocus,i),e.addEventListener("focusin",this.startFocus,i),e.addEventListener("focusout",this.endFocus,i),this.onDisconnect=()=>{e.removeAttribute("data-is-ft-ripple-target"),e.removeEventListener("mouseover",this.startHover,i),e.removeEventListener("mousemove",this.moveRipple,i),e.removeEventListener("mouseleave",this.endHover,i),e.removeEventListener("mousedown",o,i),e.removeEventListener("touchstart",r,i),e.removeEventListener("touchmove",this.moveRipple,i),e.removeEventListener("keydown",p,i),e.removeEventListener("focus",this.startFocus,i),e.removeEventListener("blur",this.endFocus,i),e.removeEventListener("focusin",this.startFocus,i),e.removeEventListener("focusout",this.endFocus,i),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(e){let t=e,o=e,r,p;return t.x!=null?{x:r,y:p}=t:o.touches!=null&&(r=o.touches[0].clientX,p=o.touches[0].clientY),{x:r,y:p}}isFocusVisible(e){return e instanceof HTMLElement?e.matches(":focus-visible"):!0}isIgnored(e){if(this.disabled)return!0;if(e!=null)for(let t of e.composedPath()){if(t===this.target)break;if("hasAttribute"in t&&t.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};n.elementDefinitions={};n.styles=H;d([(0,a.property)({type:Boolean})],n.prototype,"primary",void 0);d([(0,a.property)({type:Boolean})],n.prototype,"secondary",void 0);d([(0,a.property)({type:Boolean})],n.prototype,"unbounded",void 0);d([(0,a.property)({type:Boolean})],n.prototype,"activated",void 0);d([(0,a.property)({type:Boolean})],n.prototype,"selected",void 0);d([(0,a.property)({type:Boolean})],n.prototype,"disabled",void 0);d([(0,a.state)()],n.prototype,"hovered",void 0);d([(0,a.state)()],n.prototype,"focused",void 0);d([(0,a.state)()],n.prototype,"pressed",void 0);d([(0,a.state)()],n.prototype,"rippling",void 0);d([(0,a.state)()],n.prototype,"originX",void 0);d([(0,a.state)()],n.prototype,"originY",void 0);d([(0,a.query)(".ft-ripple")],n.prototype,"ripple",void 0);d([(0,a.query)(".ft-ripple--effect")],n.prototype,"rippleEffect",void 0);var _={"ft-ripple":n};(0,V.customElements)(_);})();
|