@fluid-topics/ft-switch 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-switch.light.js +59 -57
- package/build/ft-switch.min.js +55 -53
- package/package.json +7 -7
package/build/ft-switch.light.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,i,e,o,s,n){var r=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const l=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),p={color:l,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",l),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")},h=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),a=h,f=i.FtCssVariableFactory.extend("--ft-ripple-background-color",h),c=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),d=c,u=i.FtCssVariableFactory.extend("--ft-ripple-background-color",c);class
|
|
1
|
+
!function(t,i,e,o,s,n){var r=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const l=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),p={color:l,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",l),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")},h=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),a=h,f=i.FtCssVariableFactory.extend("--ft-ripple-background-color",h),c=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),d=c,u=i.FtCssVariableFactory.extend("--ft-ripple-background-color",c);class g 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:o,y:s}=this.getCoordinates(t),n=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!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.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`
|
|
2
2
|
<style>
|
|
3
3
|
.ft-ripple .ft-ripple--effect,
|
|
4
4
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
23
|
*/
|
|
24
|
-
var g
|
|
24
|
+
var y;g.elementDefinitions={},g.styles=e.css`
|
|
25
25
|
:host {
|
|
26
26
|
display: contents;
|
|
27
27
|
}
|
|
@@ -110,13 +110,13 @@ var g;y.elementDefinitions={},y.styles=e.css`
|
|
|
110
110
|
opacity: ${p.opacityContentOnSurfacePressed};
|
|
111
111
|
transform: translate(-50%, -50%) scale(1);
|
|
112
112
|
}
|
|
113
|
-
`,r([o.property({type:Boolean})],
|
|
113
|
+
`,r([o.property({type:Boolean})],g.prototype,"primary",void 0),r([o.property({type:Boolean})],g.prototype,"secondary",void 0),r([o.property({type:Boolean})],g.prototype,"unbounded",void 0),r([o.property({type:Boolean})],g.prototype,"activated",void 0),r([o.property({type:Boolean})],g.prototype,"selected",void 0),r([o.property({type:Boolean})],g.prototype,"disabled",void 0),r([o.state()],g.prototype,"hovered",void 0),r([o.state()],g.prototype,"focused",void 0),r([o.state()],g.prototype,"pressed",void 0),r([o.state()],g.prototype,"rippling",void 0),r([o.state()],g.prototype,"rippleSize",void 0),r([o.state()],g.prototype,"originX",void 0),r([o.state()],g.prototype,"originY",void 0),r([o.query(".ft-ripple")],g.prototype,"ripple",void 0),r([o.query(".ft-ripple--effect")],g.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(g);const x=globalThis.trustedTypes,v=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,b="?"+m,$=`<${b}>`,w=document,k=(t="")=>w.createComment(t),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,N=/>/g,j=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),A=/'/g,E=/"/g,I=/^(?:script|style|textarea|title)$/i,T=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),F=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),_=new WeakMap,B=w.createTreeWalker(w,129,null,!1),M=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=C;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===C?"!--"===p[1]?r=O:void 0!==p[1]?r=N:void 0!==p[2]?(I.test(p[2])&&(s=RegExp("</"+p[2],"g")),r=j):void 0!==p[3]&&(r=j):r===j?">"===p[0]?(r=null!=s?s:C,h=-1):void 0===p[1]?h=-2:(h=r.lastIndex-p[2].length,l=p[1],r=void 0===p[3]?j:'"'===p[3]?E:A):r===E||r===A?r=j:r===O||r===N?r=C:(r=j,s=void 0);const f=r===j&&t[i+1].startsWith("/>")?" ":"";n+=r===C?e+$:h>=0?(o.push(l),e.slice(0,h)+"$lit$"+e.slice(h)+m+f):e+m+(-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!==v?v.createHTML(l):l,o]};class U{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]=M(t,i);if(this.el=U.createElement(p,e),B.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=B.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(m)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(m),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?L:"?"===i[1]?H:"@"===i[1]?P:K})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(I.test(o.tagName)){const t=o.textContent.split(m),i=t.length-1;if(i>0){o.textContent=x?x.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],k()),B.nextNode(),l.push({type:2,index:++s});o.append(t[i],k())}}}else if(8===o.nodeType)if(o.data===b)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(m,t+1));)l.push({type:7,index:s}),t+=m.length-1}s++}}static createElement(t,i){const e=w.createElement("template");return e.innerHTML=t,e}}function W(t,i,e=t,o){var s,n,r,l;if(i===F)return i;let p=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const h=z(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)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=p:e._$Cu=p),void 0!==p&&(i=W(t,p._$AS(t,i.values),p,o)),i}class Z{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:w).importNode(e,!0);B.currentNode=s;let n=B.nextNode(),r=0,l=0,p=o[0];for(;void 0!==p;){if(r===p.index){let i;2===p.type?i=new D(n,n.nextSibling,this,t):1===p.type?i=new p.ctor(n,p.name,p.strings,this,t):6===p.type&&(i=new q(n,this,t)),this.v.push(i),p=o[++l]}r!==(null==p?void 0:p.index)&&(n=B.nextNode(),r++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class D{constructor(t,i,e,o){var s;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=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._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=W(this,t,i),z(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==F&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>S(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==R&&z(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=U.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new Z(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=_.get(t.strings);return void 0===i&&_.set(t.strings,i=new U(t)),i}S(t){S(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 D(this.j(k()),this.j(k()),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._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class K{constructor(t,i,e,o,s){this.type=1,this._$AH=R,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=R}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=W(this,t,i,0),n=!z(t)||t!==this._$AH&&t!==F,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=W(this,o[e+r],i,r),l===F&&(l=this._$AH[r]),n||(n=!z(l)||l!==this._$AH[r]),l===R?t=R:t!==R&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class L extends K{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===R?void 0:t}}const G=x?x.emptyScript:"";class H extends K{constructor(){super(...arguments),this.type=4}P(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class P extends K{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=W(this,t,i,0))&&void 0!==e?e:R)===F)return;const o=this._$AH,s=t===R&&o!==R||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==R&&(o===R||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 q{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){W(this,t)}}const V=window.litHtmlPolyfillSupport;null==V||V(U,D),(null!==(y=globalThis.litHtmlVersions)&&void 0!==y?y:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
114
114
|
/**
|
|
115
115
|
* @license
|
|
116
116
|
* Copyright 2020 Google LLC
|
|
117
117
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
118
118
|
*/
|
|
119
|
-
const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t._$litStatic$},J=t=>({_$litStatic$:t,r:X}),Q=new Map,tt=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let p,h=0,a=!1;for(;h<o;){for(p=i[h];h<o&&void 0!==(n=e[h],s=Y(n));)p+=s+i[++h],a=!0;l.push(n),r.push(p),h++}if(h===o&&r.push(i[o]),a){const t=r.join("$$lit$$");void 0===(i=Q.get(t))&&(r.raw=r,Q.set(t,i=r)),e=l}return t(i,...e)})(T);var it,et=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(it||(it={}));const ot=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),st=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),nt={fontFamily:st,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},rt=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",ot),lt=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",nt.fontSize,"20px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",nt.fontWeight,"normal"),ht=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",nt.letterSpacing,"0.15px"),at=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",nt.lineHeight,"1.2"),ft=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",nt.textTransform,"inherit"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",ot),dt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",nt.fontSize,"14px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",nt.fontWeight,"normal"),
|
|
119
|
+
const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t._$litStatic$},J=t=>({_$litStatic$:t,r:X}),Q=new Map,tt=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let p,h=0,a=!1;for(;h<o;){for(p=i[h];h<o&&void 0!==(n=e[h],s=Y(n));)p+=s+i[++h],a=!0;l.push(n),r.push(p),h++}if(h===o&&r.push(i[o]),a){const t=r.join("$$lit$$");void 0===(i=Q.get(t))&&(r.raw=r,Q.set(t,i=r)),e=l}return t(i,...e)})(T);var it,et=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(it||(it={}));const ot=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),st=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),nt={fontFamily:st,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},rt=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",ot),lt=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",nt.fontSize,"20px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",nt.fontWeight,"normal"),ht=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",nt.letterSpacing,"0.15px"),at=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",nt.lineHeight,"1.2"),ft=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",nt.textTransform,"inherit"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",ot),dt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",nt.fontSize,"14px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",nt.fontWeight,"normal"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",nt.letterSpacing,"0.105px"),yt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",nt.lineHeight,"1.7"),xt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",nt.textTransform,"inherit"),vt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",st),mt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",nt.fontSize,"16px"),bt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",nt.fontWeight,"600"),$t=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",nt.letterSpacing,"0.144px"),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",nt.lineHeight,"1.5"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",nt.textTransform,"inherit"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",st),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",nt.fontSize,"14px"),Ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",nt.fontWeight,"normal"),Ot=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",nt.letterSpacing,"0.098px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",nt.lineHeight,"1.7"),jt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",nt.textTransform,"inherit"),At=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",st),Et=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",nt.fontSize,"16px"),It=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",nt.fontWeight,"normal"),Tt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",nt.letterSpacing,"0.496px"),Ft=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",nt.lineHeight,"1.5"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",nt.textTransform,"inherit"),_t=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",st),Bt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",nt.fontSize,"14px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",nt.fontWeight,"normal"),Ut=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",nt.letterSpacing,"0.252px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",nt.lineHeight,"1.4"),Zt=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",nt.textTransform,"inherit"),Dt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",st),Kt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",nt.fontSize,"12px"),Lt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",nt.fontWeight,"normal"),Gt=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",nt.letterSpacing,"0.396px"),Ht=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",nt.lineHeight,"1.33"),Pt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",nt.textTransform,"inherit"),qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",st),Vt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",nt.fontSize,"10px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",nt.fontWeight,"normal"),Yt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",nt.letterSpacing,"0.33px"),Jt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",nt.lineHeight,"1.6"),Qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",nt.textTransform,"inherit"),ti=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",st),ii=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",nt.fontSize,"10px"),ei=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",nt.fontWeight,"normal"),oi=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",nt.letterSpacing,"1.5px"),si=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",nt.lineHeight,"1.6"),ni=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",nt.textTransform,"uppercase"),ri={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",st),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",nt.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",nt.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",nt.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",nt.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",nt.textTransform,"uppercase")},li=e.css`
|
|
120
120
|
.ft-typography--title {
|
|
121
121
|
font-family: ${rt};
|
|
122
122
|
font-size: ${lt};
|
|
@@ -130,15 +130,15 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
130
130
|
font-family: ${ct};
|
|
131
131
|
font-size: ${dt};
|
|
132
132
|
font-weight: ${ut};
|
|
133
|
-
letter-spacing: ${
|
|
134
|
-
line-height: ${
|
|
133
|
+
letter-spacing: ${gt};
|
|
134
|
+
line-height: ${yt};
|
|
135
135
|
text-transform: ${xt};
|
|
136
136
|
}
|
|
137
137
|
`,hi=e.css`
|
|
138
138
|
.ft-typography--subtitle1 {
|
|
139
139
|
font-family: ${vt};
|
|
140
|
-
font-size: ${
|
|
141
|
-
font-weight: ${
|
|
140
|
+
font-size: ${mt};
|
|
141
|
+
font-weight: ${bt};
|
|
142
142
|
letter-spacing: ${$t};
|
|
143
143
|
line-height: ${wt};
|
|
144
144
|
text-transform: ${kt};
|
|
@@ -149,8 +149,8 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
149
149
|
font-size: ${St};
|
|
150
150
|
font-weight: ${Ct};
|
|
151
151
|
letter-spacing: ${Ot};
|
|
152
|
-
line-height: ${
|
|
153
|
-
text-transform: ${
|
|
152
|
+
line-height: ${Nt};
|
|
153
|
+
text-transform: ${jt};
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
`,fi=e.css`
|
|
@@ -165,8 +165,8 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
165
165
|
`,ci=e.css`
|
|
166
166
|
.ft-typography--body2 {
|
|
167
167
|
font-family: ${_t};
|
|
168
|
-
font-size: ${
|
|
169
|
-
font-weight: ${
|
|
168
|
+
font-size: ${Bt};
|
|
169
|
+
font-weight: ${Mt};
|
|
170
170
|
letter-spacing: ${Ut};
|
|
171
171
|
line-height: ${Wt};
|
|
172
172
|
text-transform: ${Zt};
|
|
@@ -174,8 +174,8 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
174
174
|
`,di=e.css`
|
|
175
175
|
.ft-typography--caption {
|
|
176
176
|
font-family: ${Dt};
|
|
177
|
-
font-size: ${
|
|
178
|
-
font-weight: ${
|
|
177
|
+
font-size: ${Kt};
|
|
178
|
+
font-weight: ${Lt};
|
|
179
179
|
letter-spacing: ${Gt};
|
|
180
180
|
line-height: ${Ht};
|
|
181
181
|
text-transform: ${Pt};
|
|
@@ -189,7 +189,7 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
189
189
|
line-height: ${Jt};
|
|
190
190
|
text-transform: ${Qt};
|
|
191
191
|
}
|
|
192
|
-
`,
|
|
192
|
+
`,gi=e.css`
|
|
193
193
|
.ft-typography--overline {
|
|
194
194
|
font-family: ${ti};
|
|
195
195
|
font-size: ${ii};
|
|
@@ -198,7 +198,7 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
198
198
|
line-height: ${si};
|
|
199
199
|
text-transform: ${ni};
|
|
200
200
|
}
|
|
201
|
-
`,
|
|
201
|
+
`,yi=e.css`
|
|
202
202
|
.ft-typography--button {
|
|
203
203
|
font-family: ${ri.fontFamily};
|
|
204
204
|
font-size: ${ri.fontSize};
|
|
@@ -214,11 +214,11 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
214
214
|
</${J(this.element)}>
|
|
215
215
|
`:tt`
|
|
216
216
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
217
|
-
`}}xi.styles=[li,pi,hi,ai,fi,ci,di,ui,yi,
|
|
217
|
+
`}}xi.styles=[li,pi,hi,ai,fi,ci,di,ui,gi,yi,e.css`
|
|
218
218
|
.ft-typography {
|
|
219
219
|
vertical-align: inherit;
|
|
220
220
|
}
|
|
221
|
-
`],et([o.property()],xi.prototype,"element",void 0),et([o.property()],xi.prototype,"variant",void 0),i.customElement("ft-typography")(xi);var vi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const
|
|
221
|
+
`],et([o.property()],xi.prototype,"element",void 0),et([o.property()],xi.prototype,"variant",void 0),i.customElement("ft-typography")(xi);var vi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const mi=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),bi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),$i=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),wi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),ki=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),zi=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px");class Si extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}render(){return e.html`
|
|
222
222
|
<div part="container"
|
|
223
223
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
224
224
|
@mouseenter=${this.onHover}
|
|
@@ -228,12 +228,13 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
228
228
|
@touchstart=${this.onTouch}>
|
|
229
229
|
<div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
|
|
230
230
|
<div part="tooltip-content" class="ft-tooltip--content">
|
|
231
|
-
<
|
|
231
|
+
<slot name="text"></slot>
|
|
232
|
+
<ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
|
|
232
233
|
</div>
|
|
233
234
|
</div>
|
|
234
235
|
<slot></slot>
|
|
235
236
|
</div>
|
|
236
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth
|
|
237
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${zi})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}var Ci,Oi;Si.elementDefinitions={"ft-typography":xi},Si.styles=e.css`
|
|
237
238
|
.ft-tooltip--container {
|
|
238
239
|
display: block;
|
|
239
240
|
position: relative;
|
|
@@ -249,9 +250,9 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
249
250
|
box-sizing: border-box;
|
|
250
251
|
overflow: hidden;
|
|
251
252
|
width: max-content;
|
|
252
|
-
max-width:
|
|
253
|
+
max-width: ${zi};
|
|
253
254
|
text-align: center;
|
|
254
|
-
padding: ${
|
|
255
|
+
padding: ${mi};
|
|
255
256
|
z-index: ${wi};
|
|
256
257
|
}
|
|
257
258
|
|
|
@@ -259,25 +260,25 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
259
260
|
padding: 4px 8px;
|
|
260
261
|
border-radius: ${ki};
|
|
261
262
|
background-color: ${$i};
|
|
262
|
-
color: ${
|
|
263
|
+
color: ${bi};
|
|
263
264
|
top: -500px;
|
|
264
265
|
left: -500px;
|
|
265
266
|
position: relative;
|
|
266
267
|
word-break: break-word;
|
|
267
268
|
}
|
|
268
|
-
`,vi([o.property()],
|
|
269
|
+
`,vi([o.property()],Si.prototype,"text",void 0),vi([o.property({type:Boolean})],Si.prototype,"manual",void 0),vi([o.property({type:Boolean})],Si.prototype,"inline",void 0),vi([o.property({type:Number})],Si.prototype,"delay",void 0),vi([o.property()],Si.prototype,"position",void 0),vi([o.queryAssignedNodes("",!0)],Si.prototype,"slotNodes",void 0),vi([o.query(".ft-tooltip--container")],Si.prototype,"container",void 0),vi([o.query("slot")],Si.prototype,"target",void 0),vi([o.query(".ft-tooltip")],Si.prototype,"tooltip",void 0),vi([o.query(".ft-tooltip--content")],Si.prototype,"tooltipContent",void 0),vi([o.state()],Si.prototype,"visible",void 0),i.customElement("ft-tooltip")(Si),function(t){t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="\f06e",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(Ci||(Ci={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Oi||(Oi={})),new Map([...["abw"].map((t=>[t,Oi.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Oi.AUDIO])),...["avi"].map((t=>[t,Oi.AVI])),...["chm","xhs"].map((t=>[t,Oi.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Oi.CODE])),...["csv"].map((t=>[t,Oi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Oi.DITA])),...["epub"].map((t=>[t,Oi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Oi.EXCEL])),...["flac"].map((t=>[t,Oi.FLAC])),...["gif"].map((t=>[t,Oi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Oi.GZIP])),...["html","htm","xhtml"].map((t=>[t,Oi.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Oi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Oi.JPEG])),...["json"].map((t=>[t,Oi.JSON])),...["m4a","m4p"].map((t=>[t,Oi.M4A])),...["mov","qt"].map((t=>[t,Oi.MOV])),...["mp3"].map((t=>[t,Oi.MP3])),...["mp4","m4v"].map((t=>[t,Oi.MP4])),...["ogg","oga"].map((t=>[t,Oi.OGG])),...["pdf","ps"].map((t=>[t,Oi.PDF])),...["png"].map((t=>[t,Oi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Oi.POWERPOINT])),...["rar"].map((t=>[t,Oi.RAR])),...["stp"].map((t=>[t,Oi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Oi.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Oi.VIDEO])),...["wav"].map((t=>[t,Oi.WAV])),...["wma"].map((t=>[t,Oi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Oi.WORD])),...["xml","xsl","rdf"].map((t=>[t,Oi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Oi.YAML])),...["zip"].map((t=>[t,Oi.ZIP]))]);var Ni,ji=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ni||(Ni={}));const Ai={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")};class Ei extends i.FtLitElement{constructor(){super(...arguments),this.variant=Ni.fluid_topics}getStyles(){return e.css`
|
|
269
270
|
:host {
|
|
270
271
|
display: inline-block;
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
:host, i.ft-icon {
|
|
274
|
-
width: ${
|
|
275
|
-
height: ${
|
|
275
|
+
width: ${Ai.size};
|
|
276
|
+
height: ${Ai.size};
|
|
276
277
|
text-align: center;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
i.ft-icon {
|
|
280
|
-
font-size: ${
|
|
281
|
+
font-size: ${Ai.size};
|
|
281
282
|
line-height: 1;
|
|
282
283
|
font-weight: normal;
|
|
283
284
|
text-transform: none;
|
|
@@ -288,25 +289,26 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
288
289
|
text-rendering: auto;
|
|
289
290
|
-webkit-font-smoothing: antialiased;
|
|
290
291
|
-moz-osx-font-smoothing: grayscale;
|
|
292
|
+
vertical-align: ${Ai.verticalAlign};
|
|
291
293
|
}
|
|
292
294
|
|
|
293
295
|
.ft-icon--fluid-topics {
|
|
294
|
-
font-family: ${
|
|
296
|
+
font-family: ${Ai.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
295
297
|
}
|
|
296
298
|
|
|
297
299
|
.ft-icon--file-format {
|
|
298
|
-
font-family: ${
|
|
300
|
+
font-family: ${Ai.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
299
301
|
}
|
|
300
302
|
|
|
301
303
|
.ft-icon--material {
|
|
302
|
-
font-family: ${
|
|
304
|
+
font-family: ${Ai.materialFontFamily}, "Material Icons", sans-serif;
|
|
303
305
|
}
|
|
304
306
|
`}getTemplate(){return e.html`
|
|
305
307
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
306
308
|
${n.unsafeHTML(this.getIcon())}
|
|
307
309
|
<slot @slotchange=${()=>this.requestUpdate()} ?hidden=${"material"!==this.variant}></slot>
|
|
308
310
|
</i>
|
|
309
|
-
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}getIcon(){var t,i;let o=this.textContent;return this.variant===
|
|
311
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}getIcon(){var t,i;let o=this.textContent;return this.variant===Ni.file_format?null!==(t=Oi[o.toUpperCase()])&&void 0!==t?t:o:this.variant===Ni.fluid_topics?null!==(i=Ci[o.toUpperCase()])&&void 0!==i?i:o:e.nothing}}Ei.elementDefinitions={},ji([o.property()],Ei.prototype,"variant",void 0),ji([o.query("slot")],Ei.prototype,"slottedContent",void 0),i.customElement("ft-icon")(Ei);const Ii={textColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceHigh),backgroundColor:i.FtCssVariableFactory.extend("--ft-switch-background-color",i.designSystemVariables.colorSurface),selectedTextColor:i.FtCssVariableFactory.extend("--ft-switch-selected-text-color",i.designSystemVariables.colorPrimary),selectedBackgroundColor:i.FtCssVariableFactory.extend("--ft-switch-selected-background-color",i.designSystemVariables.colorPrimary),borderColor:i.FtCssVariableFactory.extend("--ft-switch-border-color",i.designSystemVariables.colorOutline),borderRadius:i.FtCssVariableFactory.extend("--ft-switch-border-radius",i.designSystemVariables.borderRadiusL),fontSize:i.FtCssVariableFactory.extend("--ft-switch-font-size",ri.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceMedium),rippleColor:i.FtCssVariableFactory.extend("--ft-switch-ripple-color",i.designSystemVariables.colorPrimary),outlineColor:i.FtCssVariableFactory.extend("--ft-switch-outline-color",i.designSystemVariables.colorPrimary)},Ti={borderRadiusLeft:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left",i.designSystemVariables.borderRadiusL),borderRadiusRight:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right",i.designSystemVariables.borderRadiusL),borderWidthLeft:i.FtCssVariableFactory.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:i.FtCssVariableFactory.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:i.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","SIZE","1px")};var Fi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ri extends CustomEvent{constructor(){super("option-change",{bubbles:!0})}}class _i extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1}static get styles(){return e.css`
|
|
310
312
|
.ft-switch-option {
|
|
311
313
|
position: relative;
|
|
312
314
|
display: inline-block;
|
|
@@ -320,21 +322,21 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
.ft-switch-option--content {
|
|
323
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
324
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
325
|
+
--ft-switch-option-internal-line-height: calc(${Ii.fontSize} + 2px);
|
|
326
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${Ii.iconSize});
|
|
325
327
|
|
|
326
328
|
border-style: solid;
|
|
327
|
-
border-color: ${
|
|
328
|
-
border-width: ${
|
|
329
|
-
border-radius: ${
|
|
329
|
+
border-color: ${Ii.borderColor};
|
|
330
|
+
border-width: ${Ti.borderWidthVertical} ${Ti.borderWidthRight} ${Ti.borderWidthVertical} ${Ti.borderWidthLeft};
|
|
331
|
+
border-radius: ${Ti.borderRadiusLeft} ${Ti.borderRadiusRight} ${Ti.borderRadiusRight} ${Ti.borderRadiusLeft};
|
|
330
332
|
display: flex;
|
|
331
333
|
align-items: center;
|
|
332
334
|
justify-content: center;
|
|
333
335
|
overflow: hidden;
|
|
334
336
|
|
|
335
|
-
${i.setVariable(
|
|
337
|
+
${i.setVariable(Ai.size,Ii.iconSize)};
|
|
336
338
|
padding: 6px 8px;
|
|
337
|
-
background-color: ${
|
|
339
|
+
background-color: ${Ii.backgroundColor};
|
|
338
340
|
-webkit-mask-image: radial-gradient(white, black);
|
|
339
341
|
}
|
|
340
342
|
|
|
@@ -343,8 +345,8 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
343
345
|
}
|
|
344
346
|
|
|
345
347
|
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
346
|
-
background-color: ${
|
|
347
|
-
border-radius: ${
|
|
348
|
+
background-color: ${Ii.selectedBackgroundColor};
|
|
349
|
+
border-radius: ${Ti.borderRadiusLeft} ${Ti.borderRadiusRight} ${Ti.borderRadiusRight} ${Ti.borderRadiusLeft};
|
|
348
350
|
position: absolute;
|
|
349
351
|
inset: 0;
|
|
350
352
|
content: "";
|
|
@@ -353,18 +355,18 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
353
355
|
}
|
|
354
356
|
|
|
355
357
|
.ft-switch-option--label {
|
|
356
|
-
color: ${
|
|
358
|
+
color: ${Ii.textColor};
|
|
357
359
|
overflow: hidden;
|
|
358
360
|
white-space: nowrap;
|
|
359
361
|
text-overflow: ellipsis;
|
|
360
362
|
display: block;
|
|
361
363
|
margin: 0 8px;
|
|
362
|
-
${i.setVariable(ri.fontSize,
|
|
364
|
+
${i.setVariable(ri.fontSize,Ii.fontSize)};
|
|
363
365
|
${i.setVariable(ri.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
364
366
|
}
|
|
365
367
|
|
|
366
368
|
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
367
|
-
color: ${
|
|
369
|
+
color: ${Ii.selectedTextColor};
|
|
368
370
|
}
|
|
369
371
|
|
|
370
372
|
.ft-switch-option--label[hidden] {
|
|
@@ -372,7 +374,7 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
372
374
|
}
|
|
373
375
|
|
|
374
376
|
.ft-switch-option--ripple {
|
|
375
|
-
${i.setVariable(p.color,
|
|
377
|
+
${i.setVariable(p.color,Ii.rippleColor)};
|
|
376
378
|
}
|
|
377
379
|
|
|
378
380
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -385,13 +387,13 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
385
387
|
|
|
386
388
|
ft-icon {
|
|
387
389
|
flex-shrink: 0;
|
|
388
|
-
color: ${
|
|
390
|
+
color: ${Ii.iconColor};
|
|
389
391
|
}
|
|
390
392
|
|
|
391
393
|
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
392
|
-
color: ${
|
|
394
|
+
color: ${Ii.selectedTextColor};
|
|
393
395
|
}
|
|
394
|
-
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new
|
|
396
|
+
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Ri)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(e.html`
|
|
395
397
|
<label for="input" class=${s.classMap(t)}>
|
|
396
398
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
397
399
|
.checked=${this.selected}
|
|
@@ -412,14 +414,14 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
412
414
|
${t}
|
|
413
415
|
</ft-tooltip>
|
|
414
416
|
`}onChange(){this.selected=!0}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
415
|
-
<ft-icon variant="material">${this.icon}</ft-icon> `:e.nothing}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}
|
|
417
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `:e.nothing}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}_i.elementDefinitions={"ft-ripple":g,"ft-typography":xi,"ft-tooltip":Si,"ft-icon":Ei},Fi([o.property({type:String})],_i.prototype,"value",void 0),Fi([o.property({type:String})],_i.prototype,"icon",void 0),Fi([o.property({type:String})],_i.prototype,"label",void 0),Fi([o.property({type:String})],_i.prototype,"tooltipPosition",void 0),Fi([o.property({type:Boolean,reflect:!0})],_i.prototype,"selected",void 0),Fi([o.property({type:Boolean})],_i.prototype,"trailingIcon",void 0),Fi([o.query(".ft-switch-option--content slot")],_i.prototype,"slottedContent",void 0),Fi([o.query(".ft-switch-option--input")],_i.prototype,"input",void 0);var Bi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Mi extends CustomEvent{constructor(t){super("change",{detail:t})}}class Ui extends i.FtLitElement{constructor(){super(...arguments),this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}updated(t){var i;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new Mi(null===(i=this.selectedOption)||void 0===i?void 0:i.value)))}static get styles(){return e.css`
|
|
416
418
|
:host {
|
|
417
419
|
display: inline-block;
|
|
418
420
|
}
|
|
419
421
|
|
|
420
422
|
.ft-switch {
|
|
421
|
-
border-radius: ${
|
|
422
|
-
outline-color: ${
|
|
423
|
+
border-radius: ${Ii.borderRadius};
|
|
424
|
+
outline-color: ${Ii.outlineColor};
|
|
423
425
|
}
|
|
424
426
|
|
|
425
427
|
.ft-switch slot {
|
|
@@ -428,22 +430,22 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
428
430
|
}
|
|
429
431
|
|
|
430
432
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
431
|
-
${i.setVariable(
|
|
432
|
-
${i.setVariable(
|
|
433
|
-
${i.setVariable(
|
|
433
|
+
${i.setVariable(Ti.borderRadiusLeft,"0")};
|
|
434
|
+
${i.setVariable(Ti.borderRadiusRight,"0")};
|
|
435
|
+
${i.setVariable(Ti.borderWidthLeft,"0")};
|
|
434
436
|
}
|
|
435
437
|
|
|
436
438
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
437
|
-
${i.setVariable(
|
|
438
|
-
${i.setVariable(
|
|
439
|
+
${i.setVariable(Ti.borderRadiusLeft,Ii.borderRadius)};
|
|
440
|
+
${i.setVariable(Ti.borderWidthLeft,"1px")};
|
|
439
441
|
}
|
|
440
442
|
|
|
441
443
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
442
|
-
${i.setVariable(
|
|
444
|
+
${i.setVariable(Ti.borderRadiusRight,Ii.borderRadius)};
|
|
443
445
|
}
|
|
444
446
|
`}render(){return e.html`
|
|
445
447
|
<div class="ft-switch" @keydown=${this.onKeyDown} tabindex="0">
|
|
446
448
|
<slot @slotchange=${this.onSlotchange}
|
|
447
449
|
@option-change=${this.onOptionChange}></slot>
|
|
448
450
|
</div>
|
|
449
|
-
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof
|
|
451
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof _i&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),this.options.push(t)}onOptionChange(t){let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Ui.elementDefinitions={},Bi([o.query(".ft-switch slot")],Ui.prototype,"slottedContent",void 0),Bi([o.state()],Ui.prototype,"selectedOption",void 0),Bi([o.query(".ft-switch")],Ui.prototype,"ftSwitchDiv",void 0),i.customElement("ft-switch")(Ui),i.customElement("ft-switch-option")(_i),t.FtSwitch=Ui,t.FtSwitchChange=Mi,t.FtSwitchCssVariables=Ii,t.FtSwitchOption=_i,t.SwitchOptionChange=Ri,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|
package/build/ft-switch.min.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
16
|
*/
|
|
17
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,o=window.customElements,s=new WeakMap,n=new WeakMap,r=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,s){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(s))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=s.prototype.attributeChangedCallback,a=new Set(s.observedAttributes||[]);f(s,a,l);const h={elementClass:s,connectedCallback:s.prototype.connectedCallback,disconnectedCallback:s.prototype.disconnectedCallback,adoptedCallback:s.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:s.formAssociated,formAssociatedCallback:s.prototype.formAssociatedCallback,formDisabledCallback:s.prototype.formDisabledCallback,formResetCallback:s.prototype.formResetCallback,formStateRestoreCallback:s.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(s,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(s,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)n.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(s),this._whenDefinedPromises.delete(t)),s}upgrade(){x.push(this),o.upgrade.apply(o,arguments),x.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 o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=r.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),s.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=x[x.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(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 o=c(e)||window.customElements,s=o._getDefinition(i);return s?u(e,s):n.set(e,o),e}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){s.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=s.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=s.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=s.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=s.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(i.has(n)){const t=this.getAttribute(n);o.call(this,n,s),e.call(this,n,t,s)}else o.call(this,n,s)});const s=t.prototype.removeAttribute;s&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);s.call(this,o),e.call(this,o,t,null)}else s.call(this,o)})},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)},u=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),s.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)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let x=[document];const v=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){x.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),x.pop(),t}};v(ShadowRoot,"createElement",document),v(ShadowRoot,"importNode",document),v(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){x.push(this),e.set.call(this,t),x.pop()}})};if(g(Element,"innerHTML"),g(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 o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==s.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),s=i.get(o)||[];this[+e]=t,s.push(t),i.set(o,s)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=s.get(e);t&&!0!==t.formAssociated||i.push(e)}return new n(i)}})}}try{window.customElements.define("custom-element",null)}catch(
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,o=window.customElements,s=new WeakMap,n=new WeakMap,r=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,s){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(s))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=s.prototype.attributeChangedCallback,a=new Set(s.observedAttributes||[]);f(s,a,l);const h={elementClass:s,connectedCallback:s.prototype.connectedCallback,disconnectedCallback:s.prototype.disconnectedCallback,adoptedCallback:s.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:s.formAssociated,formAssociatedCallback:s.prototype.formAssociatedCallback,formDisabledCallback:s.prototype.formDisabledCallback,formResetCallback:s.prototype.formResetCallback,formStateRestoreCallback:s.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(s,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(s,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)n.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(s),this._whenDefinedPromises.delete(t)),s}upgrade(){x.push(this),o.upgrade.apply(o,arguments),x.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 o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=r.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),s.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=x[x.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(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 o=c(e)||window.customElements,s=o._getDefinition(i);return s?u(e,s):n.set(e,o),e}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){s.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=s.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=s.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=s.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=s.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(i.has(n)){const t=this.getAttribute(n);o.call(this,n,s),e.call(this,n,t,s)}else o.call(this,n,s)});const s=t.prototype.removeAttribute;s&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);s.call(this,o),e.call(this,o,t,null)}else s.call(this,o)})},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)},u=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),s.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)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let x=[document];const v=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){x.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),x.pop(),t}};v(ShadowRoot,"createElement",document),v(ShadowRoot,"importNode",document),v(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){x.push(this),e.set.call(this,t),x.pop()}})};if(g(Element,"innerHTML"),g(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 o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==s.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),s=i.get(o)||[];this[+e]=t,s.push(t),i.set(o,s)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=s.get(e);t&&!0!==t.formAssociated||i.push(e)}return new n(i)}})}}try{window.customElements.define("custom-element",null)}catch(ae){const t=window.customElements.define;window.customElements.define=(i,e,o)=>{try{t.bind(window.customElements)(i,e,o)}catch(t){console.warn(i,e,o,t)}}}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=[]}}
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -56,7 +56,7 @@ const c=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
|
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
58
|
*/
|
|
59
|
-
var C;k.finalized=!0,k.elementProperties=new Map,k.elementStyles=[],k.shadowRootOptions={mode:"open"},null==w||w({ReactiveElement:k}),(null!==(g=globalThis.reactiveElementVersions)&&void 0!==g?g:globalThis.reactiveElementVersions=[]).push("1.3.4");const N=globalThis.trustedTypes,E=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,R=`lit$${(Math.random()+"").slice(9)}$`,M="?"+R,F=`<${M}>`,U=document,z=(t="")=>U.createComment(t),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,B=/>/g,P=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),_=/'/g,
|
|
59
|
+
var C;k.finalized=!0,k.elementProperties=new Map,k.elementStyles=[],k.shadowRootOptions={mode:"open"},null==w||w({ReactiveElement:k}),(null!==(g=globalThis.reactiveElementVersions)&&void 0!==g?g:globalThis.reactiveElementVersions=[]).push("1.3.4");const N=globalThis.trustedTypes,E=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,R=`lit$${(Math.random()+"").slice(9)}$`,M="?"+R,F=`<${M}>`,U=document,z=(t="")=>U.createComment(t),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,B=/>/g,P=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),_=/'/g,W=/"/g,D=/^(?:script|style|textarea|title)$/i,I=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),H=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),Z=new WeakMap,V=U.createTreeWalker(U,129,null,!1),J=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=L;for(let i=0;i<e;i++){const e=t[i];let l,a,h=-1,c=0;for(;c<e.length&&(r.lastIndex=c,a=r.exec(e),null!==a);)c=r.lastIndex,r===L?"!--"===a[1]?r=T:void 0!==a[1]?r=B:void 0!==a[2]?(D.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=P):void 0!==a[3]&&(r=P):r===P?">"===a[0]?(r=null!=s?s:L,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?P:'"'===a[3]?W:_):r===W||r===_?r=P:r===T||r===B?r=L:(r=P,s=void 0);const p=r===P&&t[i+1].startsWith("/>")?" ":"";n+=r===L?e+F:h>=0?(o.push(l),e.slice(0,h)+"$lit$"+e.slice(h)+R+p):e+R+(-2===h?(o.push(void 0),i):p)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==E?E.createHTML(l):l,o]};class q{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[a,h]=J(t,i);if(this.el=q.createElement(a,e),V.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=V.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(R)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(R),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?tt:"?"===i[1]?et:"@"===i[1]?ot:Q})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(D.test(o.tagName)){const t=o.textContent.split(R),i=t.length-1;if(i>0){o.textContent=N?N.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],z()),V.nextNode(),l.push({type:2,index:++s});o.append(t[i],z())}}}else if(8===o.nodeType)if(o.data===M)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(R,t+1));)l.push({type:7,index:s}),t+=R.length-1}s++}}static createElement(t,i){const e=U.createElement("template");return e.innerHTML=t,e}}function X(t,i,e=t,o){var s,n,r,l;if(i===H)return i;let a=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const h=j(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=a:e._$Cu=a),void 0!==a&&(i=X(t,a._$AS(t,i.values),a,o)),i}class Y{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:U).importNode(e,!0);V.currentNode=s;let n=V.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let i;2===a.type?i=new G(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new st(n,this,t)),this.v.push(i),a=o[++l]}r!==(null==a?void 0:a.index)&&(n=V.nextNode(),r++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class G{constructor(t,i,e,o){var s;this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=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._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=X(this,t,i),j(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==H&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>A(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==K&&j(this._$AH)?this._$AA.nextSibling.data=t:this.k(U.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=q.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new Y(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=Z.get(t.strings);return void 0===i&&Z.set(t.strings,i=new q(t)),i}S(t){A(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 G(this.j(z()),this.j(z()),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._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Q{constructor(t,i,e,o,s){this.type=1,this._$AH=K,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=K}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=X(this,t,i,0),n=!j(t)||t!==this._$AH&&t!==H,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=X(this,o[e+r],i,r),l===H&&(l=this._$AH[r]),n||(n=!j(l)||l!==this._$AH[r]),l===K?t=K:t!==K&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class tt extends Q{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===K?void 0:t}}const it=N?N.emptyScript:"";class et extends Q{constructor(){super(...arguments),this.type=4}P(t){t&&t!==K?this.element.setAttribute(this.name,it):this.element.removeAttribute(this.name)}}class ot extends Q{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=X(this,t,i,0))&&void 0!==e?e:K)===H)return;const o=this._$AH,s=t===K&&o!==K||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==K&&(o===K||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 st{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){X(this,t)}}const nt=window.litHtmlPolyfillSupport;
|
|
60
60
|
/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2017 Google LLC
|
|
@@ -204,9 +204,9 @@ const vt=1,gt=2,bt=t=>(...i)=>({_$litDirective$:t,values:i});class mt{constructo
|
|
|
204
204
|
* Copyright 2020 Google LLC
|
|
205
205
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
206
206
|
*/
|
|
207
|
-
const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void 0:t._$litStatic$},jt=t=>({_$litStatic$:t,r:Ut}),At=new Map,Lt=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let a,h=0,c=!1;for(;h<o;){for(a=i[h];h<o&&void 0!==(n=e[h],s=zt(n));)a+=s+i[++h],c=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(i[o]),c){const t=r.join("$$lit$$");void 0===(i=At.get(t))&&(r.raw=r,At.set(t,i=r)),e=l}return t(i,...e)})(I);var Tt,Bt=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Tt||(Tt={}));const Pt=ct.extend("--ft-typography-font-family",ft.titleFont),_t=ct.extend("--ft-typography-font-family",ft.contentFont),
|
|
207
|
+
const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void 0:t._$litStatic$},jt=t=>({_$litStatic$:t,r:Ut}),At=new Map,Lt=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let a,h=0,c=!1;for(;h<o;){for(a=i[h];h<o&&void 0!==(n=e[h],s=zt(n));)a+=s+i[++h],c=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(i[o]),c){const t=r.join("$$lit$$");void 0===(i=At.get(t))&&(r.raw=r,At.set(t,i=r)),e=l}return t(i,...e)})(I);var Tt,Bt=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Tt||(Tt={}));const Pt=ct.extend("--ft-typography-font-family",ft.titleFont),_t=ct.extend("--ft-typography-font-family",ft.contentFont),Wt={fontFamily:_t,fontSize:ct.create("--ft-typography-font-size","SIZE","16px"),fontWeight:ct.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:ct.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:ct.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:ct.create("--ft-typography-text-transform","UNKNOWN","inherit")},Dt=ct.extend("--ft-typography-title-font-family",Pt),It=ct.extend("--ft-typography-title-font-size",Wt.fontSize,"20px"),Ht=ct.extend("--ft-typography-title-font-weight",Wt.fontWeight,"normal"),Kt=ct.extend("--ft-typography-title-letter-spacing",Wt.letterSpacing,"0.15px"),Zt=ct.extend("--ft-typography-title-line-height",Wt.lineHeight,"1.2"),Vt=ct.extend("--ft-typography-title-text-transform",Wt.textTransform,"inherit"),Jt=ct.extend("--ft-typography-title-dense-font-family",Pt),qt=ct.extend("--ft-typography-title-dense-font-size",Wt.fontSize,"14px"),Xt=ct.extend("--ft-typography-title-dense-font-weight",Wt.fontWeight,"normal"),Yt=ct.extend("--ft-typography-title-dense-letter-spacing",Wt.letterSpacing,"0.105px"),Gt=ct.extend("--ft-typography-title-dense-line-height",Wt.lineHeight,"1.7"),Qt=ct.extend("--ft-typography-title-dense-text-transform",Wt.textTransform,"inherit"),ti=ct.extend("--ft-typography-subtitle1-font-family",_t),ii=ct.extend("--ft-typography-subtitle1-font-size",Wt.fontSize,"16px"),ei=ct.extend("--ft-typography-subtitle1-font-weight",Wt.fontWeight,"600"),oi=ct.extend("--ft-typography-subtitle1-letter-spacing",Wt.letterSpacing,"0.144px"),si=ct.extend("--ft-typography-subtitle1-line-height",Wt.lineHeight,"1.5"),ni=ct.extend("--ft-typography-subtitle1-text-transform",Wt.textTransform,"inherit"),ri=ct.extend("--ft-typography-subtitle2-font-family",_t),li=ct.extend("--ft-typography-subtitle2-font-size",Wt.fontSize,"14px"),ai=ct.extend("--ft-typography-subtitle2-font-weight",Wt.fontWeight,"normal"),hi=ct.extend("--ft-typography-subtitle2-letter-spacing",Wt.letterSpacing,"0.098px"),ci=ct.extend("--ft-typography-subtitle2-line-height",Wt.lineHeight,"1.7"),pi=ct.extend("--ft-typography-subtitle2-text-transform",Wt.textTransform,"inherit"),fi=ct.extend("--ft-typography-body1-font-family",_t),di=ct.extend("--ft-typography-body1-font-size",Wt.fontSize,"16px"),ui=ct.extend("--ft-typography-body1-font-weight",Wt.fontWeight,"normal"),yi=ct.extend("--ft-typography-body1-letter-spacing",Wt.letterSpacing,"0.496px"),xi=ct.extend("--ft-typography-body1-line-height",Wt.lineHeight,"1.5"),vi=ct.extend("--ft-typography-body1-text-transform",Wt.textTransform,"inherit"),gi=ct.extend("--ft-typography-body2-font-family",_t),bi=ct.extend("--ft-typography-body2-font-size",Wt.fontSize,"14px"),mi=ct.extend("--ft-typography-body2-font-weight",Wt.fontWeight,"normal"),wi=ct.extend("--ft-typography-body2-letter-spacing",Wt.letterSpacing,"0.252px"),$i=ct.extend("--ft-typography-body2-line-height",Wt.lineHeight,"1.4"),Oi=ct.extend("--ft-typography-body2-text-transform",Wt.textTransform,"inherit"),Si=ct.extend("--ft-typography-caption-font-family",_t),ki=ct.extend("--ft-typography-caption-font-size",Wt.fontSize,"12px"),Ci=ct.extend("--ft-typography-caption-font-weight",Wt.fontWeight,"normal"),Ni=ct.extend("--ft-typography-caption-letter-spacing",Wt.letterSpacing,"0.396px"),Ei=ct.extend("--ft-typography-caption-line-height",Wt.lineHeight,"1.33"),Ri=ct.extend("--ft-typography-caption-text-transform",Wt.textTransform,"inherit"),Mi=ct.extend("--ft-typography-breadcrumb-font-family",_t),Fi=ct.extend("--ft-typography-breadcrumb-font-size",Wt.fontSize,"10px"),Ui=ct.extend("--ft-typography-breadcrumb-font-weight",Wt.fontWeight,"normal"),zi=ct.extend("--ft-typography-breadcrumb-letter-spacing",Wt.letterSpacing,"0.33px"),ji=ct.extend("--ft-typography-breadcrumb-line-height",Wt.lineHeight,"1.6"),Ai=ct.extend("--ft-typography-breadcrumb-text-transform",Wt.textTransform,"inherit"),Li=ct.extend("--ft-typography-overline-font-family",_t),Ti=ct.extend("--ft-typography-overline-font-size",Wt.fontSize,"10px"),Bi=ct.extend("--ft-typography-overline-font-weight",Wt.fontWeight,"normal"),Pi=ct.extend("--ft-typography-overline-letter-spacing",Wt.letterSpacing,"1.5px"),_i=ct.extend("--ft-typography-overline-line-height",Wt.lineHeight,"1.6"),Wi=ct.extend("--ft-typography-overline-text-transform",Wt.textTransform,"uppercase"),Di={fontFamily:ct.extend("--ft-typography-button-font-family",_t),fontSize:ct.extend("--ft-typography-button-font-size",Wt.fontSize,"14px"),fontWeight:ct.extend("--ft-typography-button-font-weight",Wt.fontWeight,"600"),letterSpacing:ct.extend("--ft-typography-button-letter-spacing",Wt.letterSpacing,"1.246px"),lineHeight:ct.extend("--ft-typography-button-line-height",Wt.lineHeight,"1.15"),textTransform:ct.extend("--ft-typography-button-text-transform",Wt.textTransform,"uppercase")},Ii=y`
|
|
208
208
|
.ft-typography--title {
|
|
209
|
-
font-family: ${
|
|
209
|
+
font-family: ${Dt};
|
|
210
210
|
font-size: ${It};
|
|
211
211
|
font-weight: ${Ht};
|
|
212
212
|
letter-spacing: ${Kt};
|
|
@@ -284,16 +284,16 @@ const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
284
284
|
font-weight: ${Bi};
|
|
285
285
|
letter-spacing: ${Pi};
|
|
286
286
|
line-height: ${_i};
|
|
287
|
-
text-transform: ${
|
|
287
|
+
text-transform: ${Wi};
|
|
288
288
|
}
|
|
289
289
|
`,Gi=y`
|
|
290
290
|
.ft-typography--button {
|
|
291
|
-
font-family: ${
|
|
292
|
-
font-size: ${
|
|
293
|
-
font-weight: ${
|
|
294
|
-
letter-spacing: ${
|
|
295
|
-
line-height: ${
|
|
296
|
-
text-transform: ${
|
|
291
|
+
font-family: ${Di.fontFamily};
|
|
292
|
+
font-size: ${Di.fontSize};
|
|
293
|
+
font-weight: ${Di.fontWeight};
|
|
294
|
+
letter-spacing: ${Di.letterSpacing};
|
|
295
|
+
line-height: ${Di.lineHeight};
|
|
296
|
+
text-transform: ${Di.textTransform};
|
|
297
297
|
}
|
|
298
298
|
`;class Qi extends xt{constructor(){super(...arguments),this.variant=Tt.body1}render(){return this.element?Lt`
|
|
299
299
|
<${jt(this.element)}
|
|
@@ -306,7 +306,7 @@ const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
306
306
|
.ft-typography {
|
|
307
307
|
vertical-align: inherit;
|
|
308
308
|
}
|
|
309
|
-
`],Bt([o()],Qi.prototype,"element",void 0),Bt([o()],Qi.prototype,"variant",void 0),h("ft-typography")(Qi);var te=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const ie=ct.create("--ft-tooltip-distance","SIZE","4px"),ee=ct.create("--ft-tooltip-color","COLOR","#FFFFFF"),oe=ct.create("--ft-tooltip-background-color","COLOR","#666666"),se=ct.create("--ft-tooltip-z-index","NUMBER","1"),ne=ct.external(ft.borderRadiusS,"Design system");class
|
|
309
|
+
`],Bt([o()],Qi.prototype,"element",void 0),Bt([o()],Qi.prototype,"variant",void 0),h("ft-typography")(Qi);var te=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const ie=ct.create("--ft-tooltip-distance","SIZE","4px"),ee=ct.create("--ft-tooltip-color","COLOR","#FFFFFF"),oe=ct.create("--ft-tooltip-background-color","COLOR","#666666"),se=ct.create("--ft-tooltip-z-index","NUMBER","1"),ne=ct.external(ft.borderRadiusS,"Design system"),re=ct.create("--ft-tooltip-max-width","SIZE","150px");class le extends xt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i,this.revealDebouncer=new i}render(){return I`
|
|
310
310
|
<div part="container"
|
|
311
311
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
312
312
|
@mouseenter=${this.onHover}
|
|
@@ -316,12 +316,13 @@ const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
316
316
|
@touchstart=${this.onTouch}>
|
|
317
317
|
<div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
|
|
318
318
|
<div part="tooltip-content" class="ft-tooltip--content">
|
|
319
|
-
<
|
|
319
|
+
<slot name="text"></slot>
|
|
320
|
+
<ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
|
|
320
321
|
</div>
|
|
321
322
|
</div>
|
|
322
323
|
<slot></slot>
|
|
323
324
|
</div>
|
|
324
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth
|
|
325
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${re})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}le.elementDefinitions={"ft-typography":Qi},le.styles=y`
|
|
325
326
|
.ft-tooltip--container {
|
|
326
327
|
display: block;
|
|
327
328
|
position: relative;
|
|
@@ -337,7 +338,7 @@ const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
337
338
|
box-sizing: border-box;
|
|
338
339
|
overflow: hidden;
|
|
339
340
|
width: max-content;
|
|
340
|
-
max-width:
|
|
341
|
+
max-width: ${re};
|
|
341
342
|
text-align: center;
|
|
342
343
|
padding: ${ie};
|
|
343
344
|
z-index: ${se};
|
|
@@ -353,31 +354,31 @@ const Ut=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
353
354
|
position: relative;
|
|
354
355
|
word-break: break-word;
|
|
355
356
|
}
|
|
356
|
-
`,te([o()],
|
|
357
|
+
`,te([o()],le.prototype,"text",void 0),te([o({type:Boolean})],le.prototype,"manual",void 0),te([o({type:Boolean})],le.prototype,"inline",void 0),te([o({type:Number})],le.prototype,"delay",void 0),te([o()],le.prototype,"position",void 0),te([
|
|
357
358
|
/**
|
|
358
359
|
* @license
|
|
359
360
|
* Copyright 2017 Google LLC
|
|
360
361
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
361
362
|
*/
|
|
362
|
-
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const s="slot"+(i?`[name=${i}]`:":not([name])"),n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(s),r=null!=n?a(n,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],
|
|
363
|
+
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const s="slot"+(i?`[name=${i}]`:":not([name])"),n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(s),r=null!=n?a(n,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],le.prototype,"slotNodes",void 0),te([r(".ft-tooltip--container")],le.prototype,"container",void 0),te([r("slot")],le.prototype,"target",void 0),te([r(".ft-tooltip")],le.prototype,"tooltip",void 0),te([r(".ft-tooltip--content")],le.prototype,"tooltipContent",void 0),te([s()],le.prototype,"visible",void 0),h("ft-tooltip")(le);
|
|
363
364
|
/**
|
|
364
365
|
* @license
|
|
365
366
|
* Copyright 2017 Google LLC
|
|
366
367
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
367
368
|
*/
|
|
368
|
-
class
|
|
369
|
+
class ae extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===K||null==t)return this._t=void 0,this.it=t;if(t===H)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}}ae.directiveName="unsafeHTML",ae.resultType=1;const he=bt(ae);var ce,pe;!function(t){t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="\f06e",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(ce||(ce={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(pe||(pe={})),new Map([...["abw"].map((t=>[t,pe.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,pe.AUDIO])),...["avi"].map((t=>[t,pe.AVI])),...["chm","xhs"].map((t=>[t,pe.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,pe.CODE])),...["csv"].map((t=>[t,pe.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,pe.DITA])),...["epub"].map((t=>[t,pe.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,pe.EXCEL])),...["flac"].map((t=>[t,pe.FLAC])),...["gif"].map((t=>[t,pe.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,pe.GZIP])),...["html","htm","xhtml"].map((t=>[t,pe.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,pe.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,pe.JPEG])),...["json"].map((t=>[t,pe.JSON])),...["m4a","m4p"].map((t=>[t,pe.M4A])),...["mov","qt"].map((t=>[t,pe.MOV])),...["mp3"].map((t=>[t,pe.MP3])),...["mp4","m4v"].map((t=>[t,pe.MP4])),...["ogg","oga"].map((t=>[t,pe.OGG])),...["pdf","ps"].map((t=>[t,pe.PDF])),...["png"].map((t=>[t,pe.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,pe.POWERPOINT])),...["rar"].map((t=>[t,pe.RAR])),...["stp"].map((t=>[t,pe.STP])),...["txt","rtf","md","mdown"].map((t=>[t,pe.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,pe.VIDEO])),...["wav"].map((t=>[t,pe.WAV])),...["wma"].map((t=>[t,pe.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,pe.WORD])),...["xml","xsl","rdf"].map((t=>[t,pe.XML])),...["yaml","yml","x-yaml"].map((t=>[t,pe.YAML])),...["zip"].map((t=>[t,pe.ZIP]))]);var fe,de=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(fe||(fe={}));const ue={size:ct.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:ct.extend("--ft-icon-fluid-topics-font-family",ct.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:ct.extend("--ft-icon-file-format-font-family",ct.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:ct.extend("--ft-icon-material-font-family",ct.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:ct.create("--ft-icon-vertical-align","UNKNOWN","unset")};class ye extends xt{constructor(){super(...arguments),this.variant=fe.fluid_topics}getStyles(){return y`
|
|
369
370
|
:host {
|
|
370
371
|
display: inline-block;
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
:host, i.ft-icon {
|
|
374
|
-
width: ${
|
|
375
|
-
height: ${
|
|
375
|
+
width: ${ue.size};
|
|
376
|
+
height: ${ue.size};
|
|
376
377
|
text-align: center;
|
|
377
378
|
}
|
|
378
379
|
|
|
379
380
|
i.ft-icon {
|
|
380
|
-
font-size: ${
|
|
381
|
+
font-size: ${ue.size};
|
|
381
382
|
line-height: 1;
|
|
382
383
|
font-weight: normal;
|
|
383
384
|
text-transform: none;
|
|
@@ -388,25 +389,26 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
388
389
|
text-rendering: auto;
|
|
389
390
|
-webkit-font-smoothing: antialiased;
|
|
390
391
|
-moz-osx-font-smoothing: grayscale;
|
|
392
|
+
vertical-align: ${ue.verticalAlign};
|
|
391
393
|
}
|
|
392
394
|
|
|
393
395
|
.ft-icon--fluid-topics {
|
|
394
|
-
font-family: ${
|
|
396
|
+
font-family: ${ue.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
395
397
|
}
|
|
396
398
|
|
|
397
399
|
.ft-icon--file-format {
|
|
398
|
-
font-family: ${
|
|
400
|
+
font-family: ${ue.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
399
401
|
}
|
|
400
402
|
|
|
401
403
|
.ft-icon--material {
|
|
402
|
-
font-family: ${
|
|
404
|
+
font-family: ${ue.materialFontFamily}, "Material Icons", sans-serif;
|
|
403
405
|
}
|
|
404
406
|
`}getTemplate(){return I`
|
|
405
407
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
406
|
-
${
|
|
408
|
+
${he(this.getIcon())}
|
|
407
409
|
<slot @slotchange=${()=>this.requestUpdate()} ?hidden=${"material"!==this.variant}></slot>
|
|
408
410
|
</i>
|
|
409
|
-
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}getIcon(){var t,i;let e=this.textContent;return this.variant===
|
|
411
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}getIcon(){var t,i;let e=this.textContent;return this.variant===fe.file_format?null!==(t=pe[e.toUpperCase()])&&void 0!==t?t:e:this.variant===fe.fluid_topics?null!==(i=ce[e.toUpperCase()])&&void 0!==i?i:e:K}}ye.elementDefinitions={},de([o()],ye.prototype,"variant",void 0),de([r("slot")],ye.prototype,"slottedContent",void 0),h("ft-icon")(ye);const xe={textColor:ct.extend("--ft-switch-text-color",ft.colorOnSurfaceHigh),backgroundColor:ct.extend("--ft-switch-background-color",ft.colorSurface),selectedTextColor:ct.extend("--ft-switch-selected-text-color",ft.colorPrimary),selectedBackgroundColor:ct.extend("--ft-switch-selected-background-color",ft.colorPrimary),borderColor:ct.extend("--ft-switch-border-color",ft.colorOutline),borderRadius:ct.extend("--ft-switch-border-radius",ft.borderRadiusL),fontSize:ct.extend("--ft-switch-font-size",Di.fontSize),iconSize:ct.create("--ft-switch-icon-size","SIZE","24px"),iconColor:ct.extend("--ft-switch-text-color",ft.colorOnSurfaceMedium),rippleColor:ct.extend("--ft-switch-ripple-color",ft.colorPrimary),outlineColor:ct.extend("--ft-switch-outline-color",ft.colorPrimary)},ve={borderRadiusLeft:ct.extend("--ft-switch-option-border-radius-left",ft.borderRadiusL),borderRadiusRight:ct.extend("--ft-switch-option-border-radius-right",ft.borderRadiusL),borderWidthLeft:ct.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:ct.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:ct.create("--ft-switch-option-border-width-vertical","SIZE","1px")};var ge=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class be extends CustomEvent{constructor(){super("option-change",{bubbles:!0})}}class me extends xt{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1}static get styles(){return y`
|
|
410
412
|
.ft-switch-option {
|
|
411
413
|
position: relative;
|
|
412
414
|
display: inline-block;
|
|
@@ -420,21 +422,21 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
420
422
|
}
|
|
421
423
|
|
|
422
424
|
.ft-switch-option--content {
|
|
423
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
424
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
425
|
+
--ft-switch-option-internal-line-height: calc(${xe.fontSize} + 2px);
|
|
426
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${xe.iconSize});
|
|
425
427
|
|
|
426
428
|
border-style: solid;
|
|
427
|
-
border-color: ${
|
|
428
|
-
border-width: ${
|
|
429
|
-
border-radius: ${
|
|
429
|
+
border-color: ${xe.borderColor};
|
|
430
|
+
border-width: ${ve.borderWidthVertical} ${ve.borderWidthRight} ${ve.borderWidthVertical} ${ve.borderWidthLeft};
|
|
431
|
+
border-radius: ${ve.borderRadiusLeft} ${ve.borderRadiusRight} ${ve.borderRadiusRight} ${ve.borderRadiusLeft};
|
|
430
432
|
display: flex;
|
|
431
433
|
align-items: center;
|
|
432
434
|
justify-content: center;
|
|
433
435
|
overflow: hidden;
|
|
434
436
|
|
|
435
|
-
${pt(
|
|
437
|
+
${pt(ue.size,xe.iconSize)};
|
|
436
438
|
padding: 6px 8px;
|
|
437
|
-
background-color: ${
|
|
439
|
+
background-color: ${xe.backgroundColor};
|
|
438
440
|
-webkit-mask-image: radial-gradient(white, black);
|
|
439
441
|
}
|
|
440
442
|
|
|
@@ -443,8 +445,8 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
443
445
|
}
|
|
444
446
|
|
|
445
447
|
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
446
|
-
background-color: ${
|
|
447
|
-
border-radius: ${
|
|
448
|
+
background-color: ${xe.selectedBackgroundColor};
|
|
449
|
+
border-radius: ${ve.borderRadiusLeft} ${ve.borderRadiusRight} ${ve.borderRadiusRight} ${ve.borderRadiusLeft};
|
|
448
450
|
position: absolute;
|
|
449
451
|
inset: 0;
|
|
450
452
|
content: "";
|
|
@@ -453,18 +455,18 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
453
455
|
}
|
|
454
456
|
|
|
455
457
|
.ft-switch-option--label {
|
|
456
|
-
color: ${
|
|
458
|
+
color: ${xe.textColor};
|
|
457
459
|
overflow: hidden;
|
|
458
460
|
white-space: nowrap;
|
|
459
461
|
text-overflow: ellipsis;
|
|
460
462
|
display: block;
|
|
461
463
|
margin: 0 8px;
|
|
462
|
-
${pt(
|
|
463
|
-
${pt(
|
|
464
|
+
${pt(Di.fontSize,xe.fontSize)};
|
|
465
|
+
${pt(Di.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
467
|
-
color: ${
|
|
469
|
+
color: ${xe.selectedTextColor};
|
|
468
470
|
}
|
|
469
471
|
|
|
470
472
|
.ft-switch-option--label[hidden] {
|
|
@@ -472,7 +474,7 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
472
474
|
}
|
|
473
475
|
|
|
474
476
|
.ft-switch-option--ripple {
|
|
475
|
-
${pt(St.color,
|
|
477
|
+
${pt(St.color,xe.rippleColor)};
|
|
476
478
|
}
|
|
477
479
|
|
|
478
480
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -485,13 +487,13 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
485
487
|
|
|
486
488
|
ft-icon {
|
|
487
489
|
flex-shrink: 0;
|
|
488
|
-
color: ${
|
|
490
|
+
color: ${xe.iconColor};
|
|
489
491
|
}
|
|
490
492
|
|
|
491
493
|
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
492
|
-
color: ${
|
|
494
|
+
color: ${xe.selectedTextColor};
|
|
493
495
|
}
|
|
494
|
-
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new
|
|
496
|
+
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new be)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(I`
|
|
495
497
|
<label for="input" class=${wt(t)}>
|
|
496
498
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
497
499
|
.checked=${this.selected}
|
|
@@ -512,14 +514,14 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
512
514
|
${t}
|
|
513
515
|
</ft-tooltip>
|
|
514
516
|
`}onChange(){this.selected=!0}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?I`
|
|
515
|
-
<ft-icon variant="material">${this.icon}</ft-icon> `:K}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}
|
|
517
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `:K}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}me.elementDefinitions={"ft-ripple":Ft,"ft-typography":Qi,"ft-tooltip":le,"ft-icon":ye},ge([o({type:String})],me.prototype,"value",void 0),ge([o({type:String})],me.prototype,"icon",void 0),ge([o({type:String})],me.prototype,"label",void 0),ge([o({type:String})],me.prototype,"tooltipPosition",void 0),ge([o({type:Boolean,reflect:!0})],me.prototype,"selected",void 0),ge([o({type:Boolean})],me.prototype,"trailingIcon",void 0),ge([r(".ft-switch-option--content slot")],me.prototype,"slottedContent",void 0),ge([r(".ft-switch-option--input")],me.prototype,"input",void 0);var we=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class $e extends CustomEvent{constructor(t){super("change",{detail:t})}}class Oe extends xt{constructor(){super(...arguments),this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}updated(t){var i;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new $e(null===(i=this.selectedOption)||void 0===i?void 0:i.value)))}static get styles(){return y`
|
|
516
518
|
:host {
|
|
517
519
|
display: inline-block;
|
|
518
520
|
}
|
|
519
521
|
|
|
520
522
|
.ft-switch {
|
|
521
|
-
border-radius: ${
|
|
522
|
-
outline-color: ${
|
|
523
|
+
border-radius: ${xe.borderRadius};
|
|
524
|
+
outline-color: ${xe.outlineColor};
|
|
523
525
|
}
|
|
524
526
|
|
|
525
527
|
.ft-switch slot {
|
|
@@ -528,22 +530,22 @@ class le extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
528
530
|
}
|
|
529
531
|
|
|
530
532
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
531
|
-
${pt(
|
|
532
|
-
${pt(
|
|
533
|
-
${pt(
|
|
533
|
+
${pt(ve.borderRadiusLeft,"0")};
|
|
534
|
+
${pt(ve.borderRadiusRight,"0")};
|
|
535
|
+
${pt(ve.borderWidthLeft,"0")};
|
|
534
536
|
}
|
|
535
537
|
|
|
536
538
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
537
|
-
${pt(
|
|
538
|
-
${pt(
|
|
539
|
+
${pt(ve.borderRadiusLeft,xe.borderRadius)};
|
|
540
|
+
${pt(ve.borderWidthLeft,"1px")};
|
|
539
541
|
}
|
|
540
542
|
|
|
541
543
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
542
|
-
${pt(
|
|
544
|
+
${pt(ve.borderRadiusRight,xe.borderRadius)};
|
|
543
545
|
}
|
|
544
546
|
`}render(){return I`
|
|
545
547
|
<div class="ft-switch" @keydown=${this.onKeyDown} tabindex="0">
|
|
546
548
|
<slot @slotchange=${this.onSlotchange}
|
|
547
549
|
@option-change=${this.onOptionChange}></slot>
|
|
548
550
|
</div>
|
|
549
|
-
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof
|
|
551
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof me&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),this.options.push(t)}onOptionChange(t){let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Oe.elementDefinitions={},we([r(".ft-switch slot")],Oe.prototype,"slottedContent",void 0),we([s()],Oe.prototype,"selectedOption",void 0),we([r(".ft-switch")],Oe.prototype,"ftSwitchDiv",void 0),h("ft-switch")(Oe),h("ft-switch-option")(me),t.FtSwitch=Oe,t.FtSwitchChange=$e,t.FtSwitchCssVariables=xe,t.FtSwitchOption=me,t.SwitchOptionChange=be,Object.defineProperty(t,"i",{value:!0})}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-switch",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
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": "0.3.
|
|
23
|
-
"@fluid-topics/ft-ripple": "0.3.
|
|
24
|
-
"@fluid-topics/ft-tooltip": "0.3.
|
|
25
|
-
"@fluid-topics/ft-typography": "0.3.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-icon": "0.3.6",
|
|
23
|
+
"@fluid-topics/ft-ripple": "0.3.6",
|
|
24
|
+
"@fluid-topics/ft-tooltip": "0.3.6",
|
|
25
|
+
"@fluid-topics/ft-typography": "0.3.6",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "0.3.6",
|
|
27
27
|
"lit": "2.2.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "174dee2cde0a01bd51aba1031d4c5128f6fe81f1"
|
|
30
30
|
}
|