@fluid-topics/ft-switch 1.0.3 → 1.0.5

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.
@@ -105,7 +105,7 @@
105
105
  <div class="ft-ripple--background"></div>
106
106
  <div class="ft-ripple--effect"></div>
107
107
  </div>
108
- `}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(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;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"),o=i("touchend","touchcancel"),s=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",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),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",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),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 i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}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()}}y.elementDefinitions={},y.styles=u,g([o.property({type:Boolean})],y.prototype,"primary",void 0),g([o.property({type:Boolean})],y.prototype,"secondary",void 0),g([o.property({type:Boolean})],y.prototype,"unbounded",void 0),g([o.property({type:Boolean})],y.prototype,"activated",void 0),g([o.property({type:Boolean})],y.prototype,"selected",void 0),g([o.property({type:Boolean})],y.prototype,"disabled",void 0),g([o.state()],y.prototype,"hovered",void 0),g([o.state()],y.prototype,"focused",void 0),g([o.state()],y.prototype,"pressed",void 0),g([o.state()],y.prototype,"rippling",void 0),g([o.state()],y.prototype,"rippleSize",void 0),g([o.state()],y.prototype,"originX",void 0),g([o.state()],y.prototype,"originY",void 0),g([o.query(".ft-ripple")],y.prototype,"ripple",void 0),g([o.query(".ft-ripple--effect")],y.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(y);const v=window,b=v.trustedTypes,m=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",w=`lit$${(Math.random()+"").slice(9)}$`,k="?"+w,z=`<${k}>`,C=document,O=()=>C.createComment(""),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",A=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,I=/>/g,F=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,_=/"/g,B=/^(?:script|style|textarea|title)$/i,T=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),U=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),W=new WeakMap,Z=C.createTreeWalker(C,129,null,!1),D=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=A;for(let i=0;i<e;i++){const e=t[i];let l,p,h=-1,a=0;for(;a<e.length&&(r.lastIndex=a,p=r.exec(e),null!==p);)a=r.lastIndex,r===A?"!--"===p[1]?r=E:void 0!==p[1]?r=I:void 0!==p[2]?(B.test(p[2])&&(s=RegExp("</"+p[2],"g")),r=F):void 0!==p[3]&&(r=F):r===F?">"===p[0]?(r=null!=s?s:A,h=-1):void 0===p[1]?h=-2:(h=r.lastIndex-p[2].length,l=p[1],r=void 0===p[3]?F:'"'===p[3]?_:R):r===_||r===R?r=F:r===E||r===I?r=A:(r=F,s=void 0);const f=r===F&&t[i+1].startsWith("/>")?" ":"";n+=r===A?e+z:h>=0?(o.push(l),e.slice(0,h)+$+e.slice(h)+w+f):e+w+(-2===h?(o.push(void 0),i):f)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(l):l,o]};class K{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[p,h]=D(t,i);if(this.el=K.createElement(p,e),Z.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=Z.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith($)||i.startsWith(w)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+$).split(w),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?q:"?"===i[1]?X:"@"===i[1]?Y:P})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(B.test(o.tagName)){const t=o.textContent.split(w),i=t.length-1;if(i>0){o.textContent=b?b.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],O()),Z.nextNode(),l.push({type:2,index:++s});o.append(t[i],O())}}}else if(8===o.nodeType)if(o.data===k)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)l.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,i){const e=C.createElement("template");return e.innerHTML=t,e}}function L(t,i,e=t,o){var s,n,r,l;if(i===U)return i;let p=void 0!==o?null===(s=e._$Co)||void 0===s?void 0:s[o]:e._$Cl;const h=S(i)?void 0:i._$litDirective$;return(null==p?void 0:p.constructor)!==h&&(null===(n=null==p?void 0:p._$AO)||void 0===n||n.call(p,!1),void 0===h?p=void 0:(p=new h(t),p._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Co)&&void 0!==r?r:l._$Co=[])[o]=p:e._$Cl=p),void 0!==p&&(i=L(t,p._$AS(t,i.values),p,o)),i}class G{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:C).importNode(e,!0);Z.currentNode=s;let n=Z.nextNode(),r=0,l=0,p=o[0];for(;void 0!==p;){if(r===p.index){let i;2===p.type?i=new H(n,n.nextSibling,this,t):1===p.type?i=new p.ctor(n,p.name,p.strings,this,t):6===p.type&&(i=new J(n,this,t)),this._$AV.push(i),p=o[++l]}r!==(null==p?void 0:p.index)&&(n=Z.nextNode(),r++)}return s}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class H{constructor(t,i,e,o){var s;this.type=2,this._$AH=M,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=L(this,t,i),S(t)?t===M||null==t||""===t?(this._$AH!==M&&this._$AR(),this._$AH=M):t!==this._$AH&&t!==U&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==M&&S(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=K.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.v(e);else{const t=new G(s,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=W.get(t.strings);return void 0===i&&W.set(t.strings,i=new K(t)),i}T(t){j(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new H(this.k(O()),this.k(O()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class P{constructor(t,i,e,o,s){this.type=1,this._$AH=M,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=M}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=L(this,t,i,0),n=!S(t)||t!==this._$AH&&t!==U,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=L(this,o[e+r],i,r),l===U&&(l=this._$AH[r]),n||(n=!S(l)||l!==this._$AH[r]),l===M?t=M:t!==M&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.j(t)}j(t){t===M?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class q extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===M?void 0:t}}const V=b?b.emptyScript:"";class X extends P{constructor(){super(...arguments),this.type=4}j(t){t&&t!==M?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class Y extends P{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=L(this,t,i,0))&&void 0!==e?e:M)===U)return;const o=this._$AH,s=t===M&&o!==M||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==M&&(o===M||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){L(this,t)}}const Q=v.litHtmlPolyfillSupport;null==Q||Q(K,H),(null!==(x=v.litHtmlVersions)&&void 0!==x?x:v.litHtmlVersions=[]).push("2.7.3");
108
+ `}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(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(i=this.target)&&void 0!==i?i:e),this.setRippleSize()}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 i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=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",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),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",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),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 i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}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()}}y.elementDefinitions={},y.styles=u,g([o.property({type:Boolean})],y.prototype,"primary",void 0),g([o.property({type:Boolean})],y.prototype,"secondary",void 0),g([o.property({type:Boolean})],y.prototype,"unbounded",void 0),g([o.property({type:Boolean})],y.prototype,"activated",void 0),g([o.property({type:Boolean})],y.prototype,"selected",void 0),g([o.property({type:Boolean})],y.prototype,"disabled",void 0),g([o.state()],y.prototype,"hovered",void 0),g([o.state()],y.prototype,"focused",void 0),g([o.state()],y.prototype,"pressed",void 0),g([o.state()],y.prototype,"rippling",void 0),g([o.state()],y.prototype,"rippleSize",void 0),g([o.state()],y.prototype,"originX",void 0),g([o.state()],y.prototype,"originY",void 0),g([o.query(".ft-ripple")],y.prototype,"ripple",void 0),g([o.query(".ft-ripple--effect")],y.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(y);const v=window,b=v.trustedTypes,m=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",w=`lit$${(Math.random()+"").slice(9)}$`,k="?"+w,z=`<${k}>`,C=document,O=()=>C.createComment(""),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,N="[ \t\n\f\r]",A=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,I=/>/g,F=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,_=/"/g,B=/^(?:script|style|textarea|title)$/i,T=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),U=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),W=new WeakMap,Z=C.createTreeWalker(C,129,null,!1),D=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=A;for(let i=0;i<e;i++){const e=t[i];let l,p,h=-1,a=0;for(;a<e.length&&(r.lastIndex=a,p=r.exec(e),null!==p);)a=r.lastIndex,r===A?"!--"===p[1]?r=E:void 0!==p[1]?r=I:void 0!==p[2]?(B.test(p[2])&&(s=RegExp("</"+p[2],"g")),r=F):void 0!==p[3]&&(r=F):r===F?">"===p[0]?(r=null!=s?s:A,h=-1):void 0===p[1]?h=-2:(h=r.lastIndex-p[2].length,l=p[1],r=void 0===p[3]?F:'"'===p[3]?_:R):r===_||r===R?r=F:r===E||r===I?r=A:(r=F,s=void 0);const f=r===F&&t[i+1].startsWith("/>")?" ":"";n+=r===A?e+z:h>=0?(o.push(l),e.slice(0,h)+$+e.slice(h)+w+f):e+w+(-2===h?(o.push(void 0),i):f)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(l):l,o]};class K{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[p,h]=D(t,i);if(this.el=K.createElement(p,e),Z.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=Z.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith($)||i.startsWith(w)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+$).split(w),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?q:"?"===i[1]?X:"@"===i[1]?Y:P})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(B.test(o.tagName)){const t=o.textContent.split(w),i=t.length-1;if(i>0){o.textContent=b?b.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],O()),Z.nextNode(),l.push({type:2,index:++s});o.append(t[i],O())}}}else if(8===o.nodeType)if(o.data===k)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)l.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,i){const e=C.createElement("template");return e.innerHTML=t,e}}function L(t,i,e=t,o){var s,n,r,l;if(i===U)return i;let p=void 0!==o?null===(s=e._$Co)||void 0===s?void 0:s[o]:e._$Cl;const h=S(i)?void 0:i._$litDirective$;return(null==p?void 0:p.constructor)!==h&&(null===(n=null==p?void 0:p._$AO)||void 0===n||n.call(p,!1),void 0===h?p=void 0:(p=new h(t),p._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Co)&&void 0!==r?r:l._$Co=[])[o]=p:e._$Cl=p),void 0!==p&&(i=L(t,p._$AS(t,i.values),p,o)),i}class G{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:C).importNode(e,!0);Z.currentNode=s;let n=Z.nextNode(),r=0,l=0,p=o[0];for(;void 0!==p;){if(r===p.index){let i;2===p.type?i=new H(n,n.nextSibling,this,t):1===p.type?i=new p.ctor(n,p.name,p.strings,this,t):6===p.type&&(i=new J(n,this,t)),this._$AV.push(i),p=o[++l]}r!==(null==p?void 0:p.index)&&(n=Z.nextNode(),r++)}return s}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class H{constructor(t,i,e,o){var s;this.type=2,this._$AH=M,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=L(this,t,i),S(t)?t===M||null==t||""===t?(this._$AH!==M&&this._$AR(),this._$AH=M):t!==this._$AH&&t!==U&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==M&&S(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=K.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.v(e);else{const t=new G(s,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=W.get(t.strings);return void 0===i&&W.set(t.strings,i=new K(t)),i}T(t){j(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new H(this.k(O()),this.k(O()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class P{constructor(t,i,e,o,s){this.type=1,this._$AH=M,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=M}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=L(this,t,i,0),n=!S(t)||t!==this._$AH&&t!==U,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=L(this,o[e+r],i,r),l===U&&(l=this._$AH[r]),n||(n=!S(l)||l!==this._$AH[r]),l===M?t=M:t!==M&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.j(t)}j(t){t===M?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class q extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===M?void 0:t}}const V=b?b.emptyScript:"";class X extends P{constructor(){super(...arguments),this.type=4}j(t){t&&t!==M?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class Y extends P{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=L(this,t,i,0))&&void 0!==e?e:M)===U)return;const o=this._$AH,s=t===M&&o!==M||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==M&&(o===M||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){L(this,t)}}const Q=v.litHtmlPolyfillSupport;null==Q||Q(K,H),(null!==(x=v.litHtmlVersions)&&void 0!==x?x:v.litHtmlVersions=[]).push("2.7.3");
109
109
  /**
110
110
  * @license
111
111
  * Copyright 2020 Google LLC
@@ -211,7 +211,7 @@ var ft,dt;let ut=class extends E{constructor(){super(...arguments),this.renderOp
211
211
  <div class="ft-ripple--background"></div>
212
212
  <div class="ft-ripple--effect"></div>
213
213
  </div>
214
- `}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(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;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"),o=i("touchend","touchcancel"),s=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",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),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",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),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 i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}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()}}Zt.elementDefinitions={},Zt.styles=Ht,Kt([o({type:Boolean})],Zt.prototype,"primary",void 0),Kt([o({type:Boolean})],Zt.prototype,"secondary",void 0),Kt([o({type:Boolean})],Zt.prototype,"unbounded",void 0),Kt([o({type:Boolean})],Zt.prototype,"activated",void 0),Kt([o({type:Boolean})],Zt.prototype,"selected",void 0),Kt([o({type:Boolean})],Zt.prototype,"disabled",void 0),Kt([s()],Zt.prototype,"hovered",void 0),Kt([s()],Zt.prototype,"focused",void 0),Kt([s()],Zt.prototype,"pressed",void 0),Kt([s()],Zt.prototype,"rippling",void 0),Kt([s()],Zt.prototype,"rippleSize",void 0),Kt([s()],Zt.prototype,"originX",void 0),Kt([s()],Zt.prototype,"originY",void 0),Kt([r(".ft-ripple")],Zt.prototype,"ripple",void 0),Kt([r(".ft-ripple--effect")],Zt.prototype,"rippleEffect",void 0),c("ft-ripple")(Zt);
214
+ `}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(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(i=this.target)&&void 0!==i?i:e),this.setRippleSize()}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 i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=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",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),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",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),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 i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}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()}}Zt.elementDefinitions={},Zt.styles=Ht,Kt([o({type:Boolean})],Zt.prototype,"primary",void 0),Kt([o({type:Boolean})],Zt.prototype,"secondary",void 0),Kt([o({type:Boolean})],Zt.prototype,"unbounded",void 0),Kt([o({type:Boolean})],Zt.prototype,"activated",void 0),Kt([o({type:Boolean})],Zt.prototype,"selected",void 0),Kt([o({type:Boolean})],Zt.prototype,"disabled",void 0),Kt([s()],Zt.prototype,"hovered",void 0),Kt([s()],Zt.prototype,"focused",void 0),Kt([s()],Zt.prototype,"pressed",void 0),Kt([s()],Zt.prototype,"rippling",void 0),Kt([s()],Zt.prototype,"rippleSize",void 0),Kt([s()],Zt.prototype,"originX",void 0),Kt([s()],Zt.prototype,"originY",void 0),Kt([r(".ft-ripple")],Zt.prototype,"ripple",void 0),Kt([r(".ft-ripple--effect")],Zt.prototype,"rippleEffect",void 0),c("ft-ripple")(Zt);
215
215
  /**
216
216
  * @license
217
217
  * Copyright 2020 Google LLC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-switch",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "two-state",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-icon": "1.0.3",
23
- "@fluid-topics/ft-ripple": "1.0.3",
24
- "@fluid-topics/ft-tooltip": "1.0.3",
25
- "@fluid-topics/ft-typography": "1.0.3",
26
- "@fluid-topics/ft-wc-utils": "1.0.3",
22
+ "@fluid-topics/ft-icon": "1.0.5",
23
+ "@fluid-topics/ft-ripple": "1.0.5",
24
+ "@fluid-topics/ft-tooltip": "1.0.5",
25
+ "@fluid-topics/ft-typography": "1.0.5",
26
+ "@fluid-topics/ft-wc-utils": "1.0.5",
27
27
  "lit": "2.7.2"
28
28
  },
29
- "gitHead": "8c7b95fa60f5ac8dd10301abb40dd62ff4f9b335"
29
+ "gitHead": "a4987091424b3c8b5e36193a8b854eddfe44d439"
30
30
  }