@fluid-topics/ft-filterable-table 0.1.5 → 0.1.8
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.
|
@@ -0,0 +1,1113 @@
|
|
|
1
|
+
!function(t,e,i,r,o,a,n,s){
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
var l;const p=globalThis.trustedTypes,c=p?p.createPolicy("lit-html",{createHTML:t=>t}):void 0,d=`lit$${(Math.random()+"").slice(9)}$`,f="?"+d,u=`<${f}>`,h=document,m=(t="")=>h.createComment(t),y=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,b=/-->/g,x=/>/g,$=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,w=/'/g,k=/"/g,S=/^(?:script|style|textarea|title)$/i,z=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),O=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,T=h.createTreeWalker(h,129,null,!1),E=(t,e)=>{const i=t.length-1,r=[];let o,a=2===e?"<svg>":"",n=g;for(let e=0;e<i;e++){const i=t[e];let s,l,p=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===g?"!--"===l[1]?n=b:void 0!==l[1]?n=x:void 0!==l[2]?(S.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=$):void 0!==l[3]&&(n=$):n===$?">"===l[0]?(n=null!=o?o:g,p=-1):void 0===l[1]?p=-2:(p=n.lastIndex-l[2].length,s=l[1],n=void 0===l[3]?$:'"'===l[3]?k:w):n===k||n===w?n=$:n===b||n===x?n=g:(n=$,o=void 0);const f=n===$&&t[e+1].startsWith("/>")?" ":"";a+=n===g?i+u:p>=0?(r.push(s),i.slice(0,p)+"$lit$"+i.slice(p)+d+f):i+d+(-2===p?(r.push(void 0),e):f)}const s=a+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==c?c.createHTML(s):s,r]};class D{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,a=0;const n=t.length-1,s=this.parts,[l,c]=E(t,e);if(this.el=D.createElement(l,i),T.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=T.nextNode())&&s.length<n;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(d)){const i=c[a++];if(t.push(e),void 0!==i){const t=r.getAttribute(i.toLowerCase()+"$lit$").split(d),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?j:"?"===e[1]?N:"@"===e[1]?H:B})}else s.push({type:6,index:o})}for(const e of t)r.removeAttribute(e)}if(S.test(r.tagName)){const t=r.textContent.split(d),e=t.length-1;if(e>0){r.textContent=p?p.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],m()),T.nextNode(),s.push({type:2,index:++o});r.append(t[e],m())}}}else if(8===r.nodeType)if(r.data===f)s.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(d,t+1));)s.push({type:7,index:o}),t+=d.length-1}o++}}static createElement(t,e){const i=h.createElement("template");return i.innerHTML=t,i}}function I(t,e,i=t,r){var o,a,n,s;if(e===O)return e;let l=void 0!==r?null===(o=i._$Cl)||void 0===o?void 0:o[r]:i._$Cu;const p=y(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==p&&(null===(a=null==l?void 0:l._$AO)||void 0===a||a.call(l,!1),void 0===p?l=void 0:(l=new p(t),l._$AT(t,i,r)),void 0!==r?(null!==(n=(s=i)._$Cl)&&void 0!==n?n:s._$Cl=[])[r]=l:i._$Cu=l),void 0!==l&&(e=I(t,l._$AS(t,e.values),l,r)),e}class F{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:r}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:h).importNode(i,!0);T.currentNode=o;let a=T.nextNode(),n=0,s=0,l=r[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new _(a,a.nextSibling,this,t):1===l.type?e=new l.ctor(a,l.name,l.strings,this,t):6===l.type&&(e=new M(a,this,t)),this.v.push(e),l=r[++s]}n!==(null==l?void 0:l.index)&&(a=T.nextNode(),n++)}return o}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class _{constructor(t,e,i,r){var o;this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cg=null===(o=null==r?void 0:r.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=I(this,t,e),y(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==O&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return v(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==A&&y(this._$AH)?this._$AA.nextSibling.data=t:this.S(h.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:r}=t,o="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=D.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new F(o,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=C.get(t.strings);return void 0===e&&C.set(t.strings,e=new D(t)),e}A(t){v(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const o of t)r===e.length?e.push(i=new _(this.M(m()),this.M(m()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class B{constructor(t,e,i,r,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=A}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const o=this.strings;let a=!1;if(void 0===o)t=I(this,t,e,0),a=!y(t)||t!==this._$AH&&t!==O,a&&(this._$AH=t);else{const r=t;let n,s;for(t=o[0],n=0;n<o.length-1;n++)s=I(this,r[i+n],e,n),s===O&&(s=this._$AH[n]),a||(a=!y(s)||s!==this._$AH[n]),s===A?t=A:t!==A&&(t+=(null!=s?s:"")+o[n+1]),this._$AH[n]=s}a&&!r&&this.k(t)}k(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class j extends B{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===A?void 0:t}}const R=p?p.emptyScript:"";class N extends B{constructor(){super(...arguments),this.type=4}k(t){t&&t!==A?this.element.setAttribute(this.name,R):this.element.removeAttribute(this.name)}}class H extends B{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=I(this,t,e,0))&&void 0!==i?i:A)===O)return;const r=this._$AH,o=t===A&&r!==A||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,a=t!==A&&(r===A||o);o&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class M{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){I(this,t)}}const Z=window.litHtmlPolyfillSupport;null==Z||Z(D,_),(null!==(l=globalThis.litHtmlVersions)&&void 0!==l?l:globalThis.litHtmlVersions=[]).push("2.1.3");
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2020 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/
|
|
13
|
+
const U=t=>({_$litStatic$:t}),P=new Map,V=(t=>(e,...i)=>{var r;const o=i.length;let a,n;const s=[],l=[];let p,c=0,d=!1;for(;c<o;){for(p=e[c];c<o&&void 0!==(n=i[c],a=null===(r=n)||void 0===r?void 0:r._$litStatic$);)p+=a+e[++c],d=!0;l.push(n),s.push(p),c++}if(c===o&&s.push(e[o]),d){const t=s.join("$$lit$$");void 0===(e=P.get(t))&&(s.raw=s,P.set(t,e=s)),i=l}return t(e,...i)})(z);var L,G=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};!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"}(L||(L={}));const W=a.FtCssVariable.extend("--ft-typography-font-family",a.designSystemVariables.titleFont),q=a.FtCssVariable.extend("--ft-typography-font-family",a.designSystemVariables.contentFont),K={fontFamily:q,fontSize:a.FtCssVariable.create("--ft-typography-font-size","SIZE","16px"),fontWeight:a.FtCssVariable.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:a.FtCssVariable.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:a.FtCssVariable.create("--ft-typography-line-height","SIZE","24px"),textTransform:a.FtCssVariable.create("--ft-typography-text-transform","UNKNOWN","inherit")},X=a.FtCssVariable.extend("--ft-typography-title-font-family",W),Y=a.FtCssVariable.extend("--ft-typography-title-font-size",K.fontSize,"20px"),J=a.FtCssVariable.extend("--ft-typography-title-font-weight",K.fontWeight,"normal"),Q=a.FtCssVariable.extend("--ft-typography-title-letter-spacing",K.letterSpacing,"0.15px"),tt=a.FtCssVariable.extend("--ft-typography-title-line-height",K.lineHeight,"24px"),et=a.FtCssVariable.extend("--ft-typography-title-text-transform",K.textTransform,"inherit"),it=a.FtCssVariable.extend("--ft-typography-title-dense-font-family",W),rt=a.FtCssVariable.extend("--ft-typography-title-dense-font-size",K.fontSize,"14px"),ot=a.FtCssVariable.extend("--ft-typography-title-dense-font-weight",K.fontWeight,"normal"),at=a.FtCssVariable.extend("--ft-typography-title-dense-letter-spacing",K.letterSpacing,"0.105px"),nt=a.FtCssVariable.extend("--ft-typography-title-dense-line-height",K.lineHeight,"24px"),st=a.FtCssVariable.extend("--ft-typography-title-dense-text-transform",K.textTransform,"inherit"),lt=a.FtCssVariable.extend("--ft-typography-subtitle1-font-family",q),pt=a.FtCssVariable.extend("--ft-typography-subtitle1-font-size",K.fontSize,"16px"),ct=a.FtCssVariable.extend("--ft-typography-subtitle1-font-weight",K.fontWeight,"600"),dt=a.FtCssVariable.extend("--ft-typography-subtitle1-letter-spacing",K.letterSpacing,"0.144px"),ft=a.FtCssVariable.extend("--ft-typography-subtitle1-line-height",K.lineHeight,"24px"),ut=a.FtCssVariable.extend("--ft-typography-subtitle1-text-transform",K.textTransform,"inherit"),ht=a.FtCssVariable.extend("--ft-typography-subtitle2-font-family",q),mt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-size",K.fontSize,"14px"),yt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-weight",K.fontWeight,"normal"),vt=a.FtCssVariable.extend("--ft-typography-subtitle2-letter-spacing",K.letterSpacing,"0.098px"),gt=a.FtCssVariable.extend("--ft-typography-subtitle2-line-height",K.lineHeight,"24px"),bt=a.FtCssVariable.extend("--ft-typography-subtitle2-text-transform",K.textTransform,"inherit"),xt={fontFamily:a.FtCssVariable.extend("--ft-typography-body1-font-family",q),fontSize:a.FtCssVariable.extend("--ft-typography-body1-font-size",K.fontSize,"16px"),fontWeight:a.FtCssVariable.extend("--ft-typography-body1-font-weight",K.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-body1-letter-spacing",K.letterSpacing,"0.496px"),lineHeight:a.FtCssVariable.extend("--ft-typography-body1-line-height",K.lineHeight,"24px"),textTransform:a.FtCssVariable.extend("--ft-typography-body1-text-transform",K.textTransform,"inherit")},$t=a.FtCssVariable.extend("--ft-typography-body2-font-family",q),wt=a.FtCssVariable.extend("--ft-typography-body2-font-size",K.fontSize,"14px"),kt=a.FtCssVariable.extend("--ft-typography-body2-font-weight",K.fontWeight,"normal"),St=a.FtCssVariable.extend("--ft-typography-body2-letter-spacing",K.letterSpacing,"0.252px"),zt=a.FtCssVariable.extend("--ft-typography-body2-line-height",K.lineHeight,"20px"),Ot=a.FtCssVariable.extend("--ft-typography-body2-text-transform",K.textTransform,"inherit"),At={fontFamily:a.FtCssVariable.extend("--ft-typography-caption-font-family",q),fontSize:a.FtCssVariable.extend("--ft-typography-caption-font-size",K.fontSize,"12px"),fontWeight:a.FtCssVariable.extend("--ft-typography-caption-font-weight",K.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-caption-letter-spacing",K.letterSpacing,"0.396px"),lineHeight:a.FtCssVariable.extend("--ft-typography-caption-line-height",K.lineHeight,"16px"),textTransform:a.FtCssVariable.extend("--ft-typography-caption-text-transform",K.textTransform,"inherit")},Ct=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-family",q),Tt=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-size",K.fontSize,"10px"),Et=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-weight",K.fontWeight,"normal"),Dt=a.FtCssVariable.extend("--ft-typography-breadcrumb-letter-spacing",K.letterSpacing,"0.33px"),It=a.FtCssVariable.extend("--ft-typography-breadcrumb-line-height",K.lineHeight,"16px"),Ft=a.FtCssVariable.extend("--ft-typography-breadcrumb-text-transform",K.textTransform,"inherit"),_t=a.FtCssVariable.extend("--ft-typography-overline-font-family",q),Bt=a.FtCssVariable.extend("--ft-typography-overline-font-size",K.fontSize,"10px"),jt=a.FtCssVariable.extend("--ft-typography-overline-font-weight",K.fontWeight,"normal"),Rt=a.FtCssVariable.extend("--ft-typography-overline-letter-spacing",K.letterSpacing,"1.5px"),Nt=a.FtCssVariable.extend("--ft-typography-overline-line-height",K.lineHeight,"16px"),Ht=a.FtCssVariable.extend("--ft-typography-overline-text-transform",K.textTransform,"uppercase"),Mt={fontFamily:a.FtCssVariable.extend("--ft-typography-button-font-family",q),fontSize:a.FtCssVariable.extend("--ft-typography-button-font-size",K.fontSize,"14px"),fontWeight:a.FtCssVariable.extend("--ft-typography-button-font-weight",K.fontWeight,"600"),letterSpacing:a.FtCssVariable.extend("--ft-typography-button-letter-spacing",K.letterSpacing,"1.246px"),lineHeight:a.FtCssVariable.extend("--ft-typography-button-line-height",K.lineHeight,"16px"),textTransform:a.FtCssVariable.extend("--ft-typography-button-text-transform",K.textTransform,"uppercase")},Zt=e.css`
|
|
14
|
+
.ft-typography--title {
|
|
15
|
+
font-family: ${X};
|
|
16
|
+
font-size: ${Y};
|
|
17
|
+
font-weight: ${J};
|
|
18
|
+
letter-spacing: ${Q};
|
|
19
|
+
line-height: ${tt};
|
|
20
|
+
text-transform: ${et};
|
|
21
|
+
}
|
|
22
|
+
`,Ut=e.css`
|
|
23
|
+
.ft-typography--title-dense {
|
|
24
|
+
font-family: ${it};
|
|
25
|
+
font-size: ${rt};
|
|
26
|
+
font-weight: ${ot};
|
|
27
|
+
letter-spacing: ${at};
|
|
28
|
+
line-height: ${nt};
|
|
29
|
+
text-transform: ${st};
|
|
30
|
+
}
|
|
31
|
+
`,Pt=e.css`
|
|
32
|
+
.ft-typography--subtitle1 {
|
|
33
|
+
font-family: ${lt};
|
|
34
|
+
font-size: ${pt};
|
|
35
|
+
font-weight: ${ct};
|
|
36
|
+
letter-spacing: ${dt};
|
|
37
|
+
line-height: ${ft};
|
|
38
|
+
text-transform: ${ut};
|
|
39
|
+
}
|
|
40
|
+
`,Vt=e.css`
|
|
41
|
+
.ft-typography--subtitle2 {
|
|
42
|
+
font-family: ${ht};
|
|
43
|
+
font-size: ${mt};
|
|
44
|
+
font-weight: ${yt};
|
|
45
|
+
letter-spacing: ${vt};
|
|
46
|
+
line-height: ${gt};
|
|
47
|
+
text-transform: ${bt};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
`,Lt=e.css`
|
|
51
|
+
.ft-typography--body1 {
|
|
52
|
+
font-family: ${xt.fontFamily};
|
|
53
|
+
font-size: ${xt.fontSize};
|
|
54
|
+
font-weight: ${xt.fontWeight};
|
|
55
|
+
letter-spacing: ${xt.letterSpacing};
|
|
56
|
+
line-height: ${xt.lineHeight};
|
|
57
|
+
text-transform: ${xt.textTransform};
|
|
58
|
+
}
|
|
59
|
+
`,Gt=e.css`
|
|
60
|
+
.ft-typography--body2 {
|
|
61
|
+
font-family: ${$t};
|
|
62
|
+
font-size: ${wt};
|
|
63
|
+
font-weight: ${kt};
|
|
64
|
+
letter-spacing: ${St};
|
|
65
|
+
line-height: ${zt};
|
|
66
|
+
text-transform: ${Ot};
|
|
67
|
+
}
|
|
68
|
+
`,Wt=e.css`
|
|
69
|
+
.ft-typography--caption {
|
|
70
|
+
font-family: ${At.fontFamily};
|
|
71
|
+
font-size: ${At.fontSize};
|
|
72
|
+
font-weight: ${At.fontWeight};
|
|
73
|
+
letter-spacing: ${At.letterSpacing};
|
|
74
|
+
line-height: ${At.lineHeight};
|
|
75
|
+
text-transform: ${At.textTransform};
|
|
76
|
+
}
|
|
77
|
+
`,qt=e.css`
|
|
78
|
+
.ft-typography--breadcrumb {
|
|
79
|
+
font-family: ${Ct};
|
|
80
|
+
font-size: ${Tt};
|
|
81
|
+
font-weight: ${Et};
|
|
82
|
+
letter-spacing: ${Dt};
|
|
83
|
+
line-height: ${It};
|
|
84
|
+
text-transform: ${Ft};
|
|
85
|
+
}
|
|
86
|
+
`,Kt=e.css`
|
|
87
|
+
.ft-typography--overline {
|
|
88
|
+
font-family: ${_t};
|
|
89
|
+
font-size: ${Bt};
|
|
90
|
+
font-weight: ${jt};
|
|
91
|
+
letter-spacing: ${Rt};
|
|
92
|
+
line-height: ${Nt};
|
|
93
|
+
text-transform: ${Ht};
|
|
94
|
+
}
|
|
95
|
+
`,Xt=e.css`
|
|
96
|
+
.ft-typography--button {
|
|
97
|
+
font-family: ${Mt.fontFamily};
|
|
98
|
+
font-size: ${Mt.fontSize};
|
|
99
|
+
font-weight: ${Mt.fontWeight};
|
|
100
|
+
letter-spacing: ${Mt.letterSpacing};
|
|
101
|
+
line-height: ${Mt.lineHeight};
|
|
102
|
+
text-transform: ${Mt.textTransform};
|
|
103
|
+
}
|
|
104
|
+
`;let Yt=class extends a.FtLitElement{constructor(){super(...arguments),this.variant=L.body1}getStyles(){return[Zt,Ut,Pt,Vt,Lt,Gt,Wt,qt,Kt,Xt]}getTemplate(){return this.element?V`
|
|
105
|
+
<${U(this.element)}
|
|
106
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
107
|
+
<slot></slot>
|
|
108
|
+
</${U(this.element)}>
|
|
109
|
+
`:V`
|
|
110
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
111
|
+
`}};G([i.property()],Yt.prototype,"element",void 0),G([i.property()],Yt.prototype,"variant",void 0),Yt=G([a.customElement("ft-typography")],Yt);var Jt=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Qt={fontSize:a.FtCssVariable.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:a.FtCssVariable.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:a.FtCssVariable.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:a.FtCssVariable.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:a.FtCssVariable.create("--ft-input-label-horizontal-spacing","SIZE","12px"),borderColor:a.FtCssVariable.extend("--ft-input-label-border-color",a.designSystemVariables.colorOutline),textColor:a.FtCssVariable.extend("--ft-input-label-text-color",a.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:a.FtCssVariable.extend("--ft-input-label-disabled-text-color",a.designSystemVariables.colorOnSurfaceDisabled),colorSurface:a.FtCssVariable.external(a.designSystemVariables.colorSurface,"Design system"),borderRadiusS:a.FtCssVariable.external(a.designSystemVariables.borderRadiusS,"Design system")};let te=class extends a.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1}getStyles(){return[Wt,e.css`
|
|
112
|
+
.ft-input-label {
|
|
113
|
+
position: absolute;
|
|
114
|
+
inset: 0;
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ft-input-label {
|
|
119
|
+
border-color: ${Qt.borderColor};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ft-input-label:before,
|
|
123
|
+
.ft-input-label:after {
|
|
124
|
+
content: "";
|
|
125
|
+
display: flex;
|
|
126
|
+
border-bottom-width: 1px;
|
|
127
|
+
border-bottom-style: solid;
|
|
128
|
+
border-color: inherit;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ft-input-label:before {
|
|
132
|
+
width: ${Qt.horizontalSpacing};
|
|
133
|
+
flex-shrink: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ft-input-label:after {
|
|
137
|
+
flex-grow: 1;
|
|
138
|
+
flex-shrink: 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ft-input-label--text {
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-shrink: 1;
|
|
144
|
+
position: relative;
|
|
145
|
+
border-bottom-width: 1px;
|
|
146
|
+
border-bottom-style: solid;
|
|
147
|
+
border-color: inherit;
|
|
148
|
+
color: ${Qt.textColor};
|
|
149
|
+
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
150
|
+
${a.setVariable(At.fontSize,Qt.fontSize)};
|
|
151
|
+
${a.setVariable(At.lineHeight,Qt.fontSize)};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.ft-input-label--disabled .ft-input-label--text {
|
|
155
|
+
color: ${Qt.disabledTextColor};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ft-input-label--hidden-text {
|
|
159
|
+
padding: 0 4px;
|
|
160
|
+
opacity: 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ft-input-label--floating-text {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: calc(50% - var(--ft-typography-caption-line-height) / 2);
|
|
166
|
+
transition: top 250ms;
|
|
167
|
+
width: calc(100% - 8px);
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
text-overflow: ellipsis;
|
|
171
|
+
padding: ${Qt.verticalSpacing} 4px;
|
|
172
|
+
margin: calc(${Qt.verticalSpacing} * -1) 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ft-input-label--raised .ft-input-label--text {
|
|
176
|
+
${a.setVariable(At.fontSize,Qt.raisedFontSize)};
|
|
177
|
+
${a.setVariable(At.lineHeight,Qt.raisedFontSize)};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.ft-input-label--raised .ft-input-label--floating-text {
|
|
181
|
+
top: ${Qt.verticalSpacing};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.ft-input-label--outlined .ft-input-label--text,
|
|
185
|
+
.ft-input-label--outlined:before,
|
|
186
|
+
.ft-input-label--outlined:after {
|
|
187
|
+
border-top-width: 1px;
|
|
188
|
+
border-top-style: solid;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.ft-input-label--outlined:before {
|
|
192
|
+
border-left-width: 1px;
|
|
193
|
+
border-left-style: solid;
|
|
194
|
+
border-radius: ${Qt.borderRadiusS} 0 0 ${Qt.borderRadiusS};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ft-input-label--outlined:after {
|
|
198
|
+
border-right-width: 1px;
|
|
199
|
+
border-right-style: solid;
|
|
200
|
+
border-radius: 0 ${Qt.borderRadiusS} ${Qt.borderRadiusS} 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
204
|
+
padding: 4px;
|
|
205
|
+
z-index: ${Qt.raisedZIndex};
|
|
206
|
+
background-color: ${Qt.colorSurface};
|
|
207
|
+
border-radius: ${Qt.borderRadiusS};
|
|
208
|
+
top: calc(var(--ft-typography-caption-line-height) / -2);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
212
|
+
border-top: none;
|
|
213
|
+
}
|
|
214
|
+
`]}getTemplate(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled};return e.html`
|
|
215
|
+
<div class="${n.classMap(t)}">
|
|
216
|
+
${this.text?e.html`
|
|
217
|
+
<div class="ft-input-label--text ft-typography--caption">
|
|
218
|
+
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
219
|
+
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
220
|
+
</div>
|
|
221
|
+
`:null}
|
|
222
|
+
</div>
|
|
223
|
+
`}};te.elementDefinitions={},Jt([i.property({type:String})],te.prototype,"text",void 0),Jt([i.property({type:Boolean})],te.prototype,"raised",void 0),Jt([i.property({type:Boolean})],te.prototype,"outlined",void 0),Jt([i.property({type:Boolean})],te.prototype,"disabled",void 0),te=Jt([a.customElement("ft-input-label")],te);
|
|
224
|
+
/*! *****************************************************************************
|
|
225
|
+
Copyright (c) Microsoft Corporation.
|
|
226
|
+
|
|
227
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
228
|
+
purpose with or without fee is hereby granted.
|
|
229
|
+
|
|
230
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
231
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
232
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
233
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
234
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
235
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
236
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
237
|
+
***************************************************************************** */
|
|
238
|
+
var ee=function(t,e){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},ee(t,e)};var ie=function(){return ie=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ie.apply(this,arguments)};function re(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}function oe(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
|
|
239
|
+
/**
|
|
240
|
+
* @license
|
|
241
|
+
* Copyright 2018 Google Inc.
|
|
242
|
+
*
|
|
243
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
244
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
245
|
+
* in the Software without restriction, including without limitation the rights
|
|
246
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
247
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
248
|
+
* furnished to do so, subject to the following conditions:
|
|
249
|
+
*
|
|
250
|
+
* The above copyright notice and this permission notice shall be included in
|
|
251
|
+
* all copies or substantial portions of the Software.
|
|
252
|
+
*
|
|
253
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
254
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
255
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
256
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
257
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
258
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
259
|
+
* THE SOFTWARE.
|
|
260
|
+
*/
|
|
261
|
+
/**
|
|
262
|
+
* @license
|
|
263
|
+
* Copyright 2018 Google LLC
|
|
264
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
265
|
+
*/
|
|
266
|
+
const ae=()=>{},ne={get passive(){return!1}};document.addEventListener("x",ae,ne),document.removeEventListener("x",ae);
|
|
267
|
+
/**
|
|
268
|
+
* @license
|
|
269
|
+
* Copyright 2018 Google LLC
|
|
270
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
271
|
+
*/
|
|
272
|
+
class se extends e.LitElement{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}
|
|
273
|
+
/**
|
|
274
|
+
* @license
|
|
275
|
+
* Copyright 2016 Google Inc.
|
|
276
|
+
*
|
|
277
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
278
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
279
|
+
* in the Software without restriction, including without limitation the rights
|
|
280
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
281
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
282
|
+
* furnished to do so, subject to the following conditions:
|
|
283
|
+
*
|
|
284
|
+
* The above copyright notice and this permission notice shall be included in
|
|
285
|
+
* all copies or substantial portions of the Software.
|
|
286
|
+
*
|
|
287
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
288
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
289
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
290
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
291
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
292
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
293
|
+
* THE SOFTWARE.
|
|
294
|
+
*/var le=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),pe={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},ce={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},de={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};
|
|
295
|
+
/**
|
|
296
|
+
* @license
|
|
297
|
+
* Copyright 2016 Google Inc.
|
|
298
|
+
*
|
|
299
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
300
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
301
|
+
* in the Software without restriction, including without limitation the rights
|
|
302
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
303
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
304
|
+
* furnished to do so, subject to the following conditions:
|
|
305
|
+
*
|
|
306
|
+
* The above copyright notice and this permission notice shall be included in
|
|
307
|
+
* all copies or substantial portions of the Software.
|
|
308
|
+
*
|
|
309
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
310
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
311
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
312
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
313
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
314
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
315
|
+
* THE SOFTWARE.
|
|
316
|
+
*/
|
|
317
|
+
/**
|
|
318
|
+
* @license
|
|
319
|
+
* Copyright 2016 Google Inc.
|
|
320
|
+
*
|
|
321
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
322
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
323
|
+
* in the Software without restriction, including without limitation the rights
|
|
324
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
325
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
326
|
+
* furnished to do so, subject to the following conditions:
|
|
327
|
+
*
|
|
328
|
+
* The above copyright notice and this permission notice shall be included in
|
|
329
|
+
* all copies or substantial portions of the Software.
|
|
330
|
+
*
|
|
331
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
332
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
333
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
334
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
335
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
336
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
337
|
+
* THE SOFTWARE.
|
|
338
|
+
*/
|
|
339
|
+
var fe=["touchstart","pointerdown","mousedown","keydown"],ue=["touchend","pointerup","mouseup","contextmenu"],he=[],me=function(t){function e(i){var r=t.call(this,ie(ie({},e.defaultAdapter),i))||this;return r.activationAnimationHasEnded=!1,r.activationTimer=0,r.fgDeactivationRemovalTimer=0,r.fgScale="0",r.frame={width:0,height:0},r.initialSize=0,r.layoutFrame=0,r.maxRadius=0,r.unboundedCoords={left:0,top:0},r.activationState=r.defaultActivationState(),r.activationTimerCallback=function(){r.activationAnimationHasEnded=!0,r.runDeactivationUXLogicIfReady()},r.activateHandler=function(t){r.activateImpl(t)},r.deactivateHandler=function(){r.deactivateImpl()},r.focusHandler=function(){r.handleFocus()},r.blurHandler=function(){r.handleBlur()},r.resizeHandler=function(){r.layout()},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}ee(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return pe},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return ce},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return de},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple();if(this.registerRootHandlers(i),i){var r=e.cssClasses,o=r.ROOT,a=r.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(r),t.adapter.removeClass(o),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(t){this.activateImpl(t)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(t){var e,i;if(t){try{for(var r=oe(fe),o=r.next();!o.done;o=r.next()){var a=o.value;this.adapter.registerInteractionHandler(a,this.activateHandler)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(t){var e,i;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var r=oe(ue),o=r.next();!o.done;o=r.next()){var a=o.value;this.adapter.registerDocumentInteractionHandler(a,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}},e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var i=oe(fe),r=i.next();!r.done;r=i.next()){var o=r.value;this.adapter.deregisterInteractionHandler(o,this.activateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=oe(ue),r=i.next();!r.done;r=i.next()){var o=r.value;this.adapter.deregisterDocumentInteractionHandler(o,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},e.prototype.removeCssVars=function(){var t=this,i=e.strings;Object.keys(i).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)}))},e.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var r=this.previousActivationEvent;if(!(r&&void 0!==t&&r.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&he.length>0&&he.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(he.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){he=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive(t),i.wasElementMadeActive&&e.animateActivation()),i.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},e.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation=function(){var t=this,i=e.strings,r=i.VAR_FG_TRANSLATE_START,o=i.VAR_FG_TRANSLATE_END,a=e.cssClasses,n=a.FG_DEACTIVATION,s=a.FG_ACTIVATION,l=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var p="",c="";if(!this.adapter.isUnbounded()){var d=this.getFgTranslationCoordinates(),f=d.startPoint,u=d.endPoint;p=f.x+"px, "+f.y+"px",c=u.x+"px, "+u.y+"px"}this.adapter.updateCssVariable(r,p),this.adapter.updateCssVariable(o,c),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(n),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),l)},e.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var r,o,a=e.x,n=e.y,s=a+i.left,l=n+i.top;if("touchstart"===t.type){var p=t;r=p.changedTouches[0].pageX-s,o=p.changedTouches[0].pageY-l}else{var c=t;r=c.pageX-s,o=c.pageY-l}return{x:r,y:o}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},e.prototype.runDeactivationUXLogicIfReady=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,r=this.activationState,o=r.hasDeactivationUXRun,a=r.isActivated;(o||!a)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(i)}),de.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var i=ie({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(i)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(i),t.resetActivationState()})))}},e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var i=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?i:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+e.numbers.PADDING;var r=Math.floor(i*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&r%2!=0?this.initialSize=r-1:this.initialSize=r,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var t=e.strings,i=t.VAR_FG_SIZE,r=t.VAR_LEFT,o=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize+"px"),this.adapter.updateCssVariable(a,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(r,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},e}(le),ye=me;
|
|
340
|
+
/**
|
|
341
|
+
* @license
|
|
342
|
+
* Copyright 2018 Google LLC
|
|
343
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
344
|
+
*/
|
|
345
|
+
class ve extends se{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=ye}get isActive(){return t=this.parentElement||this,e=":active",(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e);var t,e}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation((()=>{this.mdcFoundation.activate(t)}))}endPress(){this.waitForFoundation((()=>{this.mdcFoundation.deactivate()}))}startFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleFocus()}))}endFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleBlur()}))}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}update(t){t.has("disabled")&&this.disabled&&this.endHover(),super.update(t)}render(){const t=this.activated&&(this.primary||!this.accent),i=this.selected&&(this.primary||!this.accent),r={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":t,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":i,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return e.html`
|
|
346
|
+
<div class="mdc-ripple-surface mdc-ripple-upgraded ${n.classMap(r)}"
|
|
347
|
+
style="${s.styleMap({"--mdc-ripple-fg-scale":this.fgScale,"--mdc-ripple-fg-size":this.fgSize,"--mdc-ripple-fg-translate-end":this.translateEnd,"--mdc-ripple-fg-translate-start":this.translateStart,"--mdc-ripple-left":this.leftPos,"--mdc-ripple-top":this.topPos})}"></div>`}}re([i.query(".mdc-ripple-surface")],ve.prototype,"mdcRoot",void 0),re([i.property({type:Boolean})],ve.prototype,"primary",void 0),re([i.property({type:Boolean})],ve.prototype,"accent",void 0),re([i.property({type:Boolean})],ve.prototype,"unbounded",void 0),re([i.property({type:Boolean})],ve.prototype,"disabled",void 0),re([i.property({type:Boolean})],ve.prototype,"activated",void 0),re([i.property({type:Boolean})],ve.prototype,"selected",void 0),re([i.property({type:Boolean})],ve.prototype,"internalUseStateLayerCustomProperties",void 0),re([i.state()],ve.prototype,"hovering",void 0),re([i.state()],ve.prototype,"bgFocused",void 0),re([i.state()],ve.prototype,"fgActivation",void 0),re([i.state()],ve.prototype,"fgDeactivation",void 0),re([i.state()],ve.prototype,"fgScale",void 0),re([i.state()],ve.prototype,"fgSize",void 0),re([i.state()],ve.prototype,"translateStart",void 0),re([i.state()],ve.prototype,"translateEnd",void 0),re([i.state()],ve.prototype,"leftPos",void 0),re([i.state()],ve.prototype,"topPos",void 0);
|
|
348
|
+
/**
|
|
349
|
+
* @license
|
|
350
|
+
* Copyright 2021 Google LLC
|
|
351
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
|
352
|
+
*/
|
|
353
|
+
const ge=e.css`.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}`
|
|
354
|
+
/**
|
|
355
|
+
* @license
|
|
356
|
+
* Copyright 2018 Google LLC
|
|
357
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
358
|
+
*/;let be=class extends ve{};be.styles=[ge],be=re([i.customElement("mwc-ripple")],be);
|
|
359
|
+
/**
|
|
360
|
+
* @license
|
|
361
|
+
* Copyright 2020 Google LLC
|
|
362
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
363
|
+
*/
|
|
364
|
+
class xe{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}var $e=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const we={color:a.FtCssVariable.extend("--ft-ripple-color",a.designSystemVariables.colorContent),primaryColor:a.FtCssVariable.extend("--ft-ripple-primary-color",a.FtCssVariable.extend("--ft-ripple-color",a.designSystemVariables.colorPrimary)),secondaryColor:a.FtCssVariable.extend("--ft-ripple-secondary-color",a.FtCssVariable.extend("--ft-ripple-color",a.designSystemVariables.colorSecondary)),opacityContentOnSurfacePressed:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),opacityContentOnSurfaceDragged:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceDragged,"Design system")};let ke=class extends a.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1}getStyles(){return e.css`
|
|
365
|
+
:host {
|
|
366
|
+
display: contents;
|
|
367
|
+
|
|
368
|
+
--mdc-ripple-color: ${we.color};
|
|
369
|
+
--mdc-ripple-press-opacity: ${we.opacityContentOnSurfacePressed};
|
|
370
|
+
--mdc-ripple-hover-opacity: ${we.opacityContentOnSurfaceHover};
|
|
371
|
+
--mdc-ripple-focus-opacity: ${we.opacityContentOnSurfaceFocused};
|
|
372
|
+
--mdc-ripple-selected-opacity: ${we.opacityContentOnSurfaceSelected};
|
|
373
|
+
--mdc-ripple-activated-opacity: ${we.opacityContentOnSurfaceDragged};
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
mwc-ripple.ft-ripple--secondary {
|
|
377
|
+
--mdc-ripple-color: ${we.secondaryColor};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
mwc-ripple.ft-ripple--primary {
|
|
381
|
+
--mdc-ripple-color: ${we.primaryColor};
|
|
382
|
+
}
|
|
383
|
+
`}getTemplate(){return e.html`
|
|
384
|
+
<mwc-ripple
|
|
385
|
+
class="${this.primary?"ft-ripple--primary":this.secondary?"ft-ripple--secondary":""}"
|
|
386
|
+
?unbounded=${this.unbounded}
|
|
387
|
+
?activated=${this.activated}
|
|
388
|
+
?selected=${this.selected}
|
|
389
|
+
?disabled=${this.disabled}
|
|
390
|
+
></mwc-ripple>
|
|
391
|
+
`}updated(t){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple()}endRipple(){var t,e,i;null===(t=this.rippleHandlers)||void 0===t||t.endHover(),null===(e=this.rippleHandlers)||void 0===e||e.endFocus(),null===(i=this.rippleHandlers)||void 0===i||i.endPress()}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentNode;if(e){const t=new xe((async()=>this.mwcRipple)),i=(...e)=>i=>{e.forEach((e=>window.addEventListener(e,t.endPress,{once:!0}))),t.startPress(i)},r=i("mouseup"),o=i("touchend","touchcancel"),a=t=>{["Enter"," "].includes(t.key)&&i("keyup")()};e.addEventListener("mouseenter",t.startHover),e.addEventListener("mouseleave",t.endHover),e.addEventListener("mousedown",r),e.addEventListener("touchstart",o),e.addEventListener("keydown",a),e.addEventListener("focus",t.startFocus),e.addEventListener("blur",t.endFocus),this.onDisconnect=()=>{e.removeEventListener("mouseenter",t.startHover),e.removeEventListener("mouseleave",t.endHover),e.removeEventListener("mousedown",r),e.removeEventListener("touchstart",o),e.removeEventListener("keydown",a),e.removeEventListener("focus",t.startFocus),e.removeEventListener("blur",t.endFocus)},this.rippleHandlers=t}}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};ke.elementDefinitions={"mwc-ripple":be},$e([i.property({type:Boolean})],ke.prototype,"primary",void 0),$e([i.property({type:Boolean})],ke.prototype,"secondary",void 0),$e([i.property({type:Boolean})],ke.prototype,"unbounded",void 0),$e([i.property({type:Boolean})],ke.prototype,"activated",void 0),$e([i.property({type:Boolean})],ke.prototype,"selected",void 0),$e([i.property({type:Boolean})],ke.prototype,"disabled",void 0),$e([i.query("mwc-ripple")],ke.prototype,"mwcRipple",void 0),ke=$e([a.customElement("ft-ripple")],ke);
|
|
392
|
+
/**
|
|
393
|
+
* @license
|
|
394
|
+
* Copyright 2021 Google LLC
|
|
395
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
|
396
|
+
*/
|
|
397
|
+
const Se=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`
|
|
398
|
+
/**
|
|
399
|
+
* @license
|
|
400
|
+
* Copyright 2018 Google LLC
|
|
401
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
402
|
+
*/;let ze=class extends e.LitElement{render(){return e.html`<span><slot></slot></span>`}};ze.styles=[Se],ze=re([i.customElement("mwc-icon")],ze);var Oe=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};let Ae=class extends a.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}getTemplate(){return e.html``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}};Ae.elementDefinitions={},Oe([i.property({type:String})],Ae.prototype,"label",void 0),Oe([i.property({type:Object,converter:t=>t})],Ae.prototype,"value",void 0),Oe([i.property({type:Boolean,reflect:!0})],Ae.prototype,"selected",void 0),Ae=Oe([a.customElement("ft-select-option")],Ae);const Ce={labelSize:a.FtCssVariable.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:a.FtCssVariable.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:a.FtCssVariable.create("--ft-select-vertical-spacing","SIZE","4px"),selectedOptionColor:a.FtCssVariable.extend("--ft-select-selected-option-color",a.designSystemVariables.colorOnSurface),helperColor:a.FtCssVariable.extend("--ft-select-helper-color",a.designSystemVariables.colorOnSurfaceMedium),optionsColor:a.FtCssVariable.extend("--ft-select-options-color",a.designSystemVariables.colorOnSurface),optionsZIndex:a.FtCssVariable.create("--ft-select-options-z-index","NUMBER","2"),colorSurface:a.FtCssVariable.external(a.designSystemVariables.colorSurface,"Design system"),colorOnSurfaceDisabled:a.FtCssVariable.external(a.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:a.FtCssVariable.external(a.designSystemVariables.colorPrimary,"Design system"),borderRadiusS:a.FtCssVariable.external(a.designSystemVariables.borderRadiusS,"Design system"),elevation02:a.FtCssVariable.external(a.designSystemVariables.elevation02,"Design system")};let Te=class extends a.FtLitElement{constructor(){super(...arguments),this.label="",this.helper="",this.outlined=!1,this.disabled=!1,this.options=[],this.optionsDisplayed=!1,this.focusOptions=!1,this.hideOptions=t=>this.optionsDisplayed=this.optionsDisplayed&&t.composedPath().includes(this.container)}getStyles(){return[Gt,Wt,e.css`
|
|
403
|
+
*:focus {
|
|
404
|
+
outline: none;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.ft-select {
|
|
408
|
+
display: flex;
|
|
409
|
+
flex-direction: column;
|
|
410
|
+
align-items: stretch;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.ft-select--main-panel {
|
|
414
|
+
position: relative;
|
|
415
|
+
display: flex;
|
|
416
|
+
height: calc(4 * ${Ce.verticalSpacing} + ${Ce.labelSize} + ${Ce.selectedOptionSize});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.ft-select--input-panel {
|
|
420
|
+
flex-grow: 1;
|
|
421
|
+
position: relative;
|
|
422
|
+
display: flex;
|
|
423
|
+
align-items: center;
|
|
424
|
+
overflow: hidden;
|
|
425
|
+
padding-left: 16px;
|
|
426
|
+
padding-right: 8px;
|
|
427
|
+
gap: 8px;
|
|
428
|
+
color: ${Ce.selectedOptionColor};
|
|
429
|
+
${a.setVariable(we.color,Ce.selectedOptionColor)};
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.ft-select--input-panel,
|
|
433
|
+
.ft-select--option {
|
|
434
|
+
${a.setVariable(we.opacityContentOnSurfaceHover,"0.08")};
|
|
435
|
+
${a.setVariable(we.opacityContentOnSurfaceDragged,"0.04")};
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.ft-select--disabled .ft-select--input-panel,
|
|
439
|
+
.ft-select--disabled .ft-select--option {
|
|
440
|
+
color: ${Ce.colorOnSurfaceDisabled};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.ft-select:not(.ft-select--disabled) .ft-select--input-panel,
|
|
444
|
+
.ft-select:not(.ft-select--disabled) .ft-select--option {
|
|
445
|
+
cursor: pointer;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
ft-input-label {
|
|
449
|
+
${a.setVariable(Qt.fontSize,Ce.selectedOptionSize)};
|
|
450
|
+
${a.setVariable(Qt.raisedFontSize,Ce.labelSize)};
|
|
451
|
+
${a.setVariable(Qt.verticalSpacing,Ce.verticalSpacing)};
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.ft-select:not(.ft-select--disabled):focus-within mwc-icon {
|
|
455
|
+
color: ${Ce.colorPrimary};
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.ft-select:not(.ft-select--disabled):focus-within ft-input-label {
|
|
459
|
+
${a.setVariable(Qt.borderColor,Ce.colorPrimary)};
|
|
460
|
+
${a.setVariable(Qt.textColor,Ce.colorPrimary)};
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.ft-select--selected-option {
|
|
464
|
+
display: block;
|
|
465
|
+
flex-grow: 1;
|
|
466
|
+
flex-shrink: 1;
|
|
467
|
+
overflow: hidden;
|
|
468
|
+
white-space: nowrap;
|
|
469
|
+
text-overflow: ellipsis;
|
|
470
|
+
${a.setVariable(xt.fontSize,Ce.selectedOptionSize)};
|
|
471
|
+
${a.setVariable(xt.lineHeight,Ce.selectedOptionSize)};
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
mwc-icon {
|
|
475
|
+
flex-shrink: 0;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
slot {
|
|
479
|
+
display: none;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.ft-select--filled .ft-select--input-panel {
|
|
483
|
+
border-radius: ${Ce.borderRadiusS} ${Ce.borderRadiusS} 0 0;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.ft-select--filled:not(.ft-select--no-label) .ft-select--selected-option {
|
|
487
|
+
align-self: stretch;
|
|
488
|
+
padding-top: calc(${Ce.labelSize} + 2 * ${Ce.verticalSpacing});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.ft-select--outlined .ft-select--input-panel {
|
|
492
|
+
border-radius: ${Ce.borderRadiusS};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.ft-select--options {
|
|
496
|
+
display: none;
|
|
497
|
+
position: absolute;
|
|
498
|
+
top: 100%;
|
|
499
|
+
left: 0;
|
|
500
|
+
right: 0;
|
|
501
|
+
color: ${Ce.optionsColor};
|
|
502
|
+
background: ${Ce.colorSurface};
|
|
503
|
+
z-index: ${Ce.optionsZIndex};
|
|
504
|
+
box-shadow: ${Ce.elevation02};
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.ft-select--options-displayed .ft-select--options {
|
|
508
|
+
display: block;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.ft-select--option {
|
|
512
|
+
position: relative;
|
|
513
|
+
padding: 4px 16px;
|
|
514
|
+
min-height: 32px;
|
|
515
|
+
display: flex;
|
|
516
|
+
align-items: center;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.ft-select--helper-text {
|
|
520
|
+
padding: 0 12px 0 16px;
|
|
521
|
+
color: ${Ce.helperColor};
|
|
522
|
+
}
|
|
523
|
+
`]}getTemplate(){var t,i,o,a,s;let l=!this.disabled&&this.optionsDisplayed&&this.hasOptions,p=this.disabled||!this.hasOptions;const c={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":p,"ft-select--options-displayed":l,"ft-select--has-value":null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value),"ft-select--no-label":!this.label};return e.html`
|
|
524
|
+
<div class="${n.classMap(c)}" part="container">
|
|
525
|
+
<div class="ft-select--main-panel" part="main-panel">
|
|
526
|
+
<ft-input-label text="${this.label}"
|
|
527
|
+
part="label"
|
|
528
|
+
?disabled=${p}
|
|
529
|
+
?outlined=${this.outlined}
|
|
530
|
+
?raised=${null!=(null===(i=this.selectedOption)||void 0===i?void 0:i.value)||l}
|
|
531
|
+
></ft-input-label>
|
|
532
|
+
<div class="ft-select--input-panel"
|
|
533
|
+
part="selected-value"
|
|
534
|
+
tabindex="${p?"-1":"0"}"
|
|
535
|
+
@click=${()=>{this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=this.optionsDisplayed}}
|
|
536
|
+
@keydown=${this.onMainPanelKeyDown}
|
|
537
|
+
aria-label="${this.label}"
|
|
538
|
+
aria-haspopup="listbox"
|
|
539
|
+
aria-expanded="${l}">
|
|
540
|
+
<ft-ripple ?disabled=${p} ?activated=${!this.outlined}></ft-ripple>
|
|
541
|
+
<ft-typography variant="body1" class="ft-select--selected-option">
|
|
542
|
+
${null!=(null===(o=this.selectedOption)||void 0===o?void 0:o.value)&&null!==(s=null===(a=this.selectedOption)||void 0===a?void 0:a.label)&&void 0!==s?s:""}
|
|
543
|
+
</ft-typography>
|
|
544
|
+
<mwc-icon>${l?"expand_less":"expand_more"}</mwc-icon>
|
|
545
|
+
</div>
|
|
546
|
+
<div class="ft-select--options"
|
|
547
|
+
part="options"
|
|
548
|
+
@keydown=${this.onOptionsKeyDown}
|
|
549
|
+
innerrole="listbox">
|
|
550
|
+
${r.repeat(this.options,(t=>t.value),(t=>this.renderOption(t)))}
|
|
551
|
+
</div>
|
|
552
|
+
</div>
|
|
553
|
+
${this.helper?e.html`
|
|
554
|
+
<ft-typography class="ft-select--helper-text" variant="caption">${this.helper}
|
|
555
|
+
</ft-typography>`:void 0}
|
|
556
|
+
</div>
|
|
557
|
+
<slot @slotchange=${this.updateOptionsFromSlot}
|
|
558
|
+
@option-change=${this.updateOptionsFromSlot}
|
|
559
|
+
></slot>
|
|
560
|
+
`}renderOption(t){let i=this.selectedOption===t;const r={"ft-select--option":!0,"ft-select--option-selected":i,"ft-typography--body2":!0};return e.html`
|
|
561
|
+
<div class="${n.classMap(r)}"
|
|
562
|
+
part="option"
|
|
563
|
+
tabindex="0"
|
|
564
|
+
@keydown=${e=>this.onOptionKeyDown(e,t)}
|
|
565
|
+
@click=${()=>this.selectOption(t)}>
|
|
566
|
+
<ft-ripple ?primary=${i} ?activated=${i}></ft-ripple>
|
|
567
|
+
${t.label}
|
|
568
|
+
</div>
|
|
569
|
+
`}updated(t){var e;super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1,this.dispatchEvent(new CustomEvent("change",{detail:null===(e=this.selectedOption)||void 0===e?void 0:e.value})))}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,r,o,a;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==r?r:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(a=null===(o=this.focusedOption)||void 0===o?void 0:o.nextElementSibling)&&void 0!==a?a:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};Te.elementDefinitions={"ft-input-label":te,"ft-typography":Yt,"ft-ripple":ke,"mwc-icon":ze},Oe([i.property({type:String})],Te.prototype,"label",void 0),Oe([i.property({type:String})],Te.prototype,"helper",void 0),Oe([i.property({type:Boolean})],Te.prototype,"outlined",void 0),Oe([i.property({type:Boolean})],Te.prototype,"disabled",void 0),Oe([i.property({type:Array})],Te.prototype,"options",void 0),Oe([i.state()],Te.prototype,"selectedOption",void 0),Oe([i.state()],Te.prototype,"optionsDisplayed",void 0),Oe([i.state()],Te.prototype,"focusOptions",void 0),Oe([i.query(".ft-select")],Te.prototype,"container",void 0),Oe([i.query(".ft-select--input-panel")],Te.prototype,"mainPanel",void 0),Oe([i.query(".ft-select--option:first-child")],Te.prototype,"firstOption",void 0),Oe([i.query(".ft-select--option:focus")],Te.prototype,"focusedOption",void 0),Oe([i.query(".ft-select--option.ft-select--option-selected")],Te.prototype,"selectedOptionElement",void 0),Oe([i.query(".ft-select--option:last-child")],Te.prototype,"lastOption",void 0),Oe([i.query("slot")],Te.prototype,"optionsSlot",void 0),Te=Oe([a.customElement("ft-select")],Te);var Ee=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const De={fontSize:a.FtCssVariable.create("--ft-text-field-font-size","SIZE","14px"),labelSize:a.FtCssVariable.create("--ft-text-field-label-size","SIZE","11px"),verticalSpacing:a.FtCssVariable.create("--ft-text-field-vertical-spacing","SIZE","4px"),horizontalSpacing:a.FtCssVariable.create("--ft-text-field-horizontal-spacing","SIZE","16px"),helperColor:a.FtCssVariable.extend("--ft-text-field-helper-color",a.designSystemVariables.colorOnSurfaceMedium),colorPrimary:a.FtCssVariable.external(a.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:a.FtCssVariable.external(a.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:a.FtCssVariable.external(a.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:a.FtCssVariable.external(a.designSystemVariables.borderRadiusS,"Design system")};let Ie=class extends a.FtLitElement{constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.dataList=[],this.focused=!1}getStyles(){return[Lt,e.css`
|
|
570
|
+
*:focus {
|
|
571
|
+
outline: none;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.ft-text-field {
|
|
575
|
+
display: flex;
|
|
576
|
+
flex-direction: column;
|
|
577
|
+
align-items: stretch;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
ft-input-label {
|
|
581
|
+
${a.setVariable(Qt.fontSize,De.fontSize)};
|
|
582
|
+
${a.setVariable(Qt.raisedFontSize,De.labelSize)};
|
|
583
|
+
${a.setVariable(Qt.verticalSpacing,De.verticalSpacing)};
|
|
584
|
+
${a.setVariable(Qt.horizontalSpacing,e.css`calc(${De.horizontalSpacing} - 4px)`)};
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.ft-text-field--main-panel {
|
|
588
|
+
position: relative;
|
|
589
|
+
display: flex;
|
|
590
|
+
height: calc(4 * ${De.verticalSpacing} + ${De.labelSize} + ${De.fontSize});
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.ft-text-field--input-panel {
|
|
594
|
+
flex-grow: 1;
|
|
595
|
+
position: relative;
|
|
596
|
+
display: flex;
|
|
597
|
+
align-items: center;
|
|
598
|
+
overflow: hidden;
|
|
599
|
+
gap: 8px;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.ft-text-field--input-panel ft-ripple {
|
|
603
|
+
${a.setVariable(we.opacityContentOnSurfaceHover,"0.08")};
|
|
604
|
+
${a.setVariable(we.opacityContentOnSurfaceDragged,"0.04")};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.ft-text-field--input {
|
|
608
|
+
display: block;
|
|
609
|
+
flex-grow: 1;
|
|
610
|
+
flex-shrink: 1;
|
|
611
|
+
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
612
|
+
|
|
613
|
+
${a.setVariable(xt.fontSize,De.fontSize)};
|
|
614
|
+
${a.setVariable(xt.lineHeight,De.fontSize)};
|
|
615
|
+
color: ${De.colorOnSurface};
|
|
616
|
+
|
|
617
|
+
padding: 0 ${De.horizontalSpacing};
|
|
618
|
+
|
|
619
|
+
border: none;
|
|
620
|
+
background: none;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.ft-text-field--input::-webkit-calendar-picker-indicator,
|
|
624
|
+
.ft-text-field--input::-webkit-list-button {
|
|
625
|
+
display: none !important;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.ft-text-field--disabled .ft-text-field--input {
|
|
629
|
+
color: ${De.colorOnSurfaceDisabled};
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.ft-text-field:not(.ft-text-field--disabled) .ft-text-field--input-panel {
|
|
633
|
+
cursor: pointer;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
637
|
+
${a.setVariable(Qt.borderColor,De.colorPrimary)};
|
|
638
|
+
${a.setVariable(Qt.textColor,De.colorPrimary)};
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.ft-text-field--filled .ft-text-field--input-panel {
|
|
642
|
+
border-radius: ${De.borderRadiusS} ${De.borderRadiusS} 0 0;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.ft-text-field--filled:not(.ft-text-field--no-label) .ft-text-field--input {
|
|
646
|
+
align-self: stretch;
|
|
647
|
+
padding-bottom: ${De.verticalSpacing};
|
|
648
|
+
padding-top: calc(${De.labelSize} + 2 * ${De.verticalSpacing});
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.ft-text-field--outlined .ft-text-field--input-panel {
|
|
652
|
+
border-radius: ${De.borderRadiusS};
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.ft-text-field--helper-text {
|
|
656
|
+
padding: 0 12px 0 ${De.horizontalSpacing};
|
|
657
|
+
color: ${De.helperColor};
|
|
658
|
+
}
|
|
659
|
+
`]}getTemplate(){const t={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--no-label":!this.label};return e.html`
|
|
660
|
+
<div class="${n.classMap(t)}">
|
|
661
|
+
<div class="ft-text-field--main-panel">
|
|
662
|
+
<ft-input-label text="${this.label}"
|
|
663
|
+
?disabled=${this.disabled}
|
|
664
|
+
?outlined=${this.outlined}
|
|
665
|
+
?raised=${this.focused||""!=this.value}
|
|
666
|
+
></ft-input-label>
|
|
667
|
+
<div class="ft-text-field--input-panel"
|
|
668
|
+
aria-label="${this.label}">
|
|
669
|
+
${this.outlined?null:e.html`
|
|
670
|
+
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
671
|
+
`}
|
|
672
|
+
<input type="text"
|
|
673
|
+
class="ft-typography--body1 ft-text-field--input"
|
|
674
|
+
?disabled=${this.disabled}
|
|
675
|
+
.value=${this.value}
|
|
676
|
+
@change=${this.updateValueFromInputField}
|
|
677
|
+
@keyup=${this.liveUpdateValueFromInputField}
|
|
678
|
+
@focus=${()=>this.focused=!0}
|
|
679
|
+
@focusout=${()=>this.focused=!1}
|
|
680
|
+
list="datalist"
|
|
681
|
+
/>
|
|
682
|
+
|
|
683
|
+
<datalist id="datalist">
|
|
684
|
+
${this.dataList.map((t=>e.html`
|
|
685
|
+
<option value="${t}"></option>`))}
|
|
686
|
+
</datalist>
|
|
687
|
+
|
|
688
|
+
</div>
|
|
689
|
+
</div>
|
|
690
|
+
${this.helper?e.html`
|
|
691
|
+
<ft-typography class="ft-text-field--helper-text" variant="caption">${this.helper}
|
|
692
|
+
</ft-typography>`:void 0}
|
|
693
|
+
</div>
|
|
694
|
+
`}updated(t){super.updated(t),t.has("value")&&this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}updateValueFromInputField(){var t;this.value=(null===(t=this.input)||void 0===t?void 0:t.value)||"",this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.input)||void 0===t?void 0:t.value)||""}};Ie.elementDefinitions={"ft-input-label":te,"ft-ripple":ke,"ft-typography":Yt},Ee([i.property({type:String})],Ie.prototype,"label",void 0),Ee([i.property({reflect:!0})],Ie.prototype,"value",void 0),Ee([i.property({type:String})],Ie.prototype,"helper",void 0),Ee([i.property({type:Boolean})],Ie.prototype,"outlined",void 0),Ee([i.property({type:Boolean})],Ie.prototype,"disabled",void 0),Ee([i.query(".ft-text-field--input")],Ie.prototype,"input",void 0),Ee([i.property({attribute:!1})],Ie.prototype,"dataList",void 0),Ee([i.state()],Ie.prototype,"focused",void 0),Ie=Ee([a.customElement("ft-text-field")],Ie);var Fe=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const _e=a.FtCssVariable.create("--ft-tooltip-distance","SIZE","4px"),Be=a.FtCssVariable.create("--ft-tooltip-color","COLOR","#FFFFFF"),je=a.FtCssVariable.create("--ft-tooltip-background-color","COLOR","#666666"),Re=a.FtCssVariable.create("--ft-tooltip-z-index","NUMBER","1"),Ne=a.FtCssVariable.external(a.designSystemVariables.borderRadiusS,"Design system");let He=class extends a.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new a.Debouncer,this.revealDebouncer=new a.Debouncer}getStyles(){return e.css`
|
|
695
|
+
.ft-tooltip--container {
|
|
696
|
+
display: block;
|
|
697
|
+
position: relative;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.ft-tooltip--inline {
|
|
701
|
+
display: inline-block;
|
|
702
|
+
max-width: 100%;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.ft-tooltip {
|
|
706
|
+
position: absolute;
|
|
707
|
+
box-sizing: border-box;
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
width: max-content;
|
|
710
|
+
max-width: 150px;
|
|
711
|
+
text-align: center;
|
|
712
|
+
padding: ${_e};
|
|
713
|
+
z-index: ${Re};
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.ft-tooltip--content {
|
|
717
|
+
padding: 4px 8px;
|
|
718
|
+
border-radius: ${Ne};
|
|
719
|
+
background-color: ${je};
|
|
720
|
+
color: ${Be};
|
|
721
|
+
top: -500px;
|
|
722
|
+
left: -500px;
|
|
723
|
+
position: relative;
|
|
724
|
+
word-break: break-word;
|
|
725
|
+
}
|
|
726
|
+
`}getTemplate(){return e.html`
|
|
727
|
+
<div part="container"
|
|
728
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
729
|
+
@mouseenter=${this.onHover}
|
|
730
|
+
@mouseleave=${this.onOut}
|
|
731
|
+
@focusin=${this.onHover}
|
|
732
|
+
@focusout=${this.onOut}
|
|
733
|
+
@touchstart=${this.onTouch}>
|
|
734
|
+
<div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
|
|
735
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
736
|
+
<ft-typography variant="caption">${this.text}</ft-typography>
|
|
737
|
+
</div>
|
|
738
|
+
</div>
|
|
739
|
+
<slot></slot>
|
|
740
|
+
</div>
|
|
741
|
+
`}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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,r=(e.width-this.tooltip.clientWidth)/2,o=this.tooltip.style;switch(this.position){case"top":o.top=-this.tooltip.clientHeight+"px",o.left=r+"px";break;case"bottom":o.top=e.height+"px",o.left=r+"px";break;case"left":o.top=i+"px",o.left=-this.tooltip.clientWidth+"px";break;case"right":o.top=i+"px",o.left=e.width+"px"}o.maxWidth=Math.max(e.width,150)+"px"}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}};He.elementDefinitions={"ft-typography":Yt},Fe([i.property()],He.prototype,"text",void 0),Fe([i.property({type:Boolean})],He.prototype,"manual",void 0),Fe([i.property({type:Boolean})],He.prototype,"inline",void 0),Fe([i.property({type:Number})],He.prototype,"delay",void 0),Fe([i.property()],He.prototype,"position",void 0),Fe([i.queryAssignedNodes("",!0)],He.prototype,"slotNodes",void 0),Fe([i.query(".ft-tooltip--container")],He.prototype,"container",void 0),Fe([i.query("slot")],He.prototype,"target",void 0),Fe([i.query(".ft-tooltip")],He.prototype,"tooltip",void 0),Fe([i.query(".ft-tooltip--content")],He.prototype,"tooltipContent",void 0),Fe([i.state()],He.prototype,"visible",void 0),He=Fe([a.customElement("ft-tooltip")],He);var Me=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ze={color:a.FtCssVariable.extend("--ft-loader-color",a.designSystemVariables.colorPrimary),size:a.FtCssVariable.create("--ft-loader-size","SIZE","80px")};let Ue=class extends a.FtLitElement{getStyles(){return e.css`
|
|
742
|
+
:host {
|
|
743
|
+
line-height: 0;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.ft-loader {
|
|
747
|
+
display: inline-block;
|
|
748
|
+
position: relative;
|
|
749
|
+
|
|
750
|
+
width: ${Ze.size};
|
|
751
|
+
height: ${Ze.size};
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.ft-loader div {
|
|
755
|
+
position: absolute;
|
|
756
|
+
top: 37.5%;
|
|
757
|
+
width: 25%;
|
|
758
|
+
height: 25%;
|
|
759
|
+
border-radius: 50%;
|
|
760
|
+
background: ${Ze.color};
|
|
761
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.ft-loader div:nth-child(1) {
|
|
765
|
+
left: 2.5%;
|
|
766
|
+
animation: appear 0.6s infinite;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.ft-loader div:nth-child(2) {
|
|
770
|
+
left: 2.5%;
|
|
771
|
+
animation: move 0.6s infinite;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.ft-loader div:nth-child(3) {
|
|
775
|
+
left: 37.5%;
|
|
776
|
+
animation: move 0.6s infinite;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.ft-loader div:nth-child(4) {
|
|
780
|
+
left: 72.5%;
|
|
781
|
+
animation: disappear 0.6s infinite;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
@keyframes appear {
|
|
785
|
+
0% {
|
|
786
|
+
transform: scale(0);
|
|
787
|
+
}
|
|
788
|
+
100% {
|
|
789
|
+
transform: scale(1);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
@keyframes disappear {
|
|
794
|
+
0% {
|
|
795
|
+
transform: scale(1);
|
|
796
|
+
}
|
|
797
|
+
100% {
|
|
798
|
+
transform: scale(0);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
@keyframes move {
|
|
803
|
+
0% {
|
|
804
|
+
transform: translate(0, 0);
|
|
805
|
+
}
|
|
806
|
+
100% {
|
|
807
|
+
transform: translate(calc(0.35 * ${Ze.size}), 0);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
`}getTemplate(){return e.html`
|
|
811
|
+
<div class="ft-loader">
|
|
812
|
+
<div></div>
|
|
813
|
+
<div></div>
|
|
814
|
+
<div></div>
|
|
815
|
+
<div></div>
|
|
816
|
+
</div>
|
|
817
|
+
`}};Ue=Me([a.customElement("ft-loader")],Ue);var Pe=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ve=a.FtCssVariable.extend("--ft-button-color",a.designSystemVariables.colorPrimary),Le={backgroundColor:a.FtCssVariable.extend("--ft-button-background-color",a.designSystemVariables.colorSurface),borderRadius:a.FtCssVariable.extend("--ft-button-border-radius",a.designSystemVariables.borderRadiusL),color:Ve,fontSize:a.FtCssVariable.extend("--ft-button-font-size",Mt.fontSize),iconSize:a.FtCssVariable.create("--ft-button-icon-size","SIZE","24px"),rippleColor:a.FtCssVariable.extend("--ft-button-ripple-color",Ve),opacityDisabled:a.FtCssVariable.external(a.designSystemVariables.colorOpacityDisabled,"Design system")},Ge=a.FtCssVariable.extend("--ft-button-primary-color",a.FtCssVariable.extend("--ft-button-color",a.designSystemVariables.colorOnPrimary)),We=a.FtCssVariable.extend("--ft-button-primary-background-color",a.FtCssVariable.extend("--ft-button-background-color",a.designSystemVariables.colorPrimary)),qe=Ge,Ke=(a.FtCssVariable.extend("--ft-button-primary-ripple-color",Ge),a.FtCssVariable.extend("--ft-button-dense-border-radius",a.FtCssVariable.extend("--ft-button-border-radius",a.designSystemVariables.borderRadiusM)));let Xe=class extends a.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}getStyles(){return[a.noTextSelect,e.css`
|
|
818
|
+
:host {
|
|
819
|
+
display: inline-block;
|
|
820
|
+
max-width: 100%;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
button {
|
|
824
|
+
box-shadow: 0px 0px 0px transparent;
|
|
825
|
+
border: 0px solid transparent;
|
|
826
|
+
text-shadow: 0px 0px 0px transparent;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
button:hover {
|
|
830
|
+
box-shadow: 0px 0px 0px transparent;
|
|
831
|
+
border: 0px solid transparent;
|
|
832
|
+
text-shadow: 0px 0px 0px transparent;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
button:active {
|
|
836
|
+
outline: none;
|
|
837
|
+
border: none;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
button:focus {
|
|
841
|
+
outline: 0;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.ft-button {
|
|
845
|
+
position: relative;
|
|
846
|
+
display: flex;
|
|
847
|
+
justify-content: center;
|
|
848
|
+
align-items: center;
|
|
849
|
+
width: 100%;
|
|
850
|
+
overflow: hidden;
|
|
851
|
+
box-sizing: border-box;
|
|
852
|
+
border: none;
|
|
853
|
+
|
|
854
|
+
--ft-button-internal-font-size: ${Le.fontSize};
|
|
855
|
+
--ft-button-internal-line-height: calc(var(--ft-button-internal-font-size) + 2px);
|
|
856
|
+
--ft-button-internal-color: ${Le.color};
|
|
857
|
+
--mdc-icon-size: ${Le.iconSize};
|
|
858
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
859
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
860
|
+
${a.setVariable(we.color,Le.rippleColor)};
|
|
861
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), var(--mdc-icon-size));
|
|
862
|
+
|
|
863
|
+
border-radius: ${Le.borderRadius};
|
|
864
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
865
|
+
background-color: ${Le.backgroundColor};
|
|
866
|
+
color: var(--ft-button-internal-color);
|
|
867
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
.ft-button:not([disabled]):hover {
|
|
871
|
+
cursor: pointer;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
.ft-button--dense {
|
|
875
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
876
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
877
|
+
border-radius: ${Ke};
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.ft-button--round {
|
|
881
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.ft-button[disabled] {
|
|
885
|
+
filter: grayscale(1);
|
|
886
|
+
opacity: ${Le.opacityDisabled};
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.ft-button.ft-button--primary {
|
|
890
|
+
background-color: ${We};
|
|
891
|
+
--ft-button-internal-color: ${qe};
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.ft-button.ft-button--outlined {
|
|
895
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
896
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.ft-button:focus {
|
|
900
|
+
outline: none;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.ft-button--label {
|
|
904
|
+
overflow: hidden;
|
|
905
|
+
white-space: nowrap;
|
|
906
|
+
text-overflow: ellipsis;
|
|
907
|
+
display: block;
|
|
908
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
909
|
+
${a.setVariable(Mt.fontSize,"var(--ft-button-internal-font-size)")};
|
|
910
|
+
${a.setVariable(Mt.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.ft-button--safari-fix .ft-button--label {
|
|
914
|
+
margin-right: 0;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.ft-button--safari-fix .ft-button--label:after {
|
|
918
|
+
content: "\\0000a0";
|
|
919
|
+
display: inline-block;
|
|
920
|
+
width: 0;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
.ft-button--label[hidden] {
|
|
924
|
+
display: none;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
mwc-icon {
|
|
928
|
+
flex-shrink: 0;
|
|
929
|
+
width: var(--mdc-icon-size);
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
.ft-button--label[hidden] + mwc-icon {
|
|
933
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
934
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.ft-button:not(.ft-button--trailing-icon) mwc-icon,
|
|
938
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
939
|
+
order: -1;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
ft-loader {
|
|
943
|
+
${a.setVariable(Ze.size,Le.iconSize)};
|
|
944
|
+
${a.setVariable(Ze.color,"var(--ft-button-internal-color)")};
|
|
945
|
+
}
|
|
946
|
+
`]}getTemplate(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-button--safari-fix":a.isSafari,"ft-no-text-select":!0};return this.addTooltip(e.html`
|
|
947
|
+
<button part="button"
|
|
948
|
+
class="${n.classMap(t)}"
|
|
949
|
+
aria-label="${this.getLabel()}"
|
|
950
|
+
?disabled=${this.isDisabled()}>
|
|
951
|
+
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
952
|
+
<ft-typography part="label"
|
|
953
|
+
variant="button"
|
|
954
|
+
class="ft-button--label"
|
|
955
|
+
?hidden=${!this.hasTextContent()}>
|
|
956
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
957
|
+
</ft-typography>
|
|
958
|
+
${this.resolveIcon()}
|
|
959
|
+
</button>
|
|
960
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:e.html`
|
|
961
|
+
<ft-tooltip part="tooltip"
|
|
962
|
+
text="${this.getLabel()}"
|
|
963
|
+
position="${this.tooltipPosition}">
|
|
964
|
+
${t}
|
|
965
|
+
</ft-tooltip>
|
|
966
|
+
`}resolveIcon(){return this.loading?e.html`
|
|
967
|
+
<ft-loader></ft-loader> `:this.icon?e.html`
|
|
968
|
+
<mwc-icon>${this.icon}</mwc-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}};Xe.elementDefinitions={"ft-ripple":ke,"ft-tooltip":He,"ft-typography":Yt,"mwc-icon":ze,"ft-loader":Ue},Pe([i.property({type:Boolean})],Xe.prototype,"primary",void 0),Pe([i.property({type:Boolean})],Xe.prototype,"outlined",void 0),Pe([i.property({type:Boolean})],Xe.prototype,"disabled",void 0),Pe([i.property({type:Boolean})],Xe.prototype,"dense",void 0),Pe([i.property({type:Boolean})],Xe.prototype,"round",void 0),Pe([i.property({type:String})],Xe.prototype,"label",void 0),Pe([i.property({type:String})],Xe.prototype,"icon",void 0),Pe([i.property({type:Boolean})],Xe.prototype,"trailingIcon",void 0),Pe([i.property({type:Boolean})],Xe.prototype,"loading",void 0),Pe([i.property({type:String})],Xe.prototype,"tooltipPosition",void 0),Pe([i.query(".ft-button")],Xe.prototype,"button",void 0),Pe([i.query(".ft-button--label slot")],Xe.prototype,"slottedContent",void 0),Xe=Pe([a.customElement("ft-button")],Xe);var Ye=function(t,e,i,r){for(var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};class Je extends CustomEvent{constructor(t){super("row-click",{detail:t})}}const Qe={headerBackground:a.FtCssVariable.create("--ft-filterable-table-header-background","COLOR","whitesmoke"),oddRowBackground:a.FtCssVariable.create("--ft-filterable-table-odd-row-background","COLOR","#FFFFFF"),evenRowBackground:a.FtCssVariable.create("--ft-filterable-table-even-row-background","COLOR","#fdfdfd"),rowHoverBackground:a.FtCssVariable.create("--ft-filterable-table-row-hover-background","COLOR","#fafafa"),colorOnSurfaceHigh:a.FtCssVariable.external(a.designSystemVariables.colorOnSurfaceHigh,"Design system"),titleFont:a.FtCssVariable.external(a.designSystemVariables.titleFont,"Design system"),contentFont:a.FtCssVariable.external(a.designSystemVariables.contentFont,"Design system")},ti=t=>e.html`${t}`,ei=(t,e)=>t-e;t.FtFilterableTable=class extends a.FtLitElement{constructor(){super(...arguments),this.data=[],this.columns=[],this.filters=[],this.selectData=[]}getStyles(){return e.css`
|
|
969
|
+
:host {
|
|
970
|
+
display: block;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.table {
|
|
974
|
+
display: grid;
|
|
975
|
+
grid-template-columns: repeat(${this.columns.length}, minmax(min-content, auto));
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.header, .row {
|
|
979
|
+
display: contents;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.header-cell {
|
|
983
|
+
display: flex;
|
|
984
|
+
flex-direction: column;
|
|
985
|
+
background: ${Qe.headerBackground};
|
|
986
|
+
color: ${Qe.colorOnSurfaceHigh};
|
|
987
|
+
padding: .5rem 1rem;
|
|
988
|
+
font-family: ${Qe.titleFont};
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.header-cell:first-of-type {
|
|
992
|
+
border-radius: .5rem 0 0 0;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.header-cell:last-of-type {
|
|
996
|
+
border-radius: 0 .5rem 0 0;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.column-title-container {
|
|
1000
|
+
display: flex;
|
|
1001
|
+
align-items: center;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.column-title-container ft-button {
|
|
1005
|
+
${a.setVariable(Le.backgroundColor,Qe.headerBackground)};
|
|
1006
|
+
${a.setVariable(Le.color,Qe.colorOnSurfaceHigh)};
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.column-title {
|
|
1010
|
+
white-space: nowrap;
|
|
1011
|
+
text-transform: uppercase;
|
|
1012
|
+
margin-right: .5rem;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.column-filter {
|
|
1016
|
+
flex-grow: 1;
|
|
1017
|
+
flex-shrink: 0;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.column-filter:not(:empty) {
|
|
1021
|
+
padding-top: .5rem;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.column-filter ft-text-field,
|
|
1025
|
+
.column-filter ft-select {
|
|
1026
|
+
width: 150px;
|
|
1027
|
+
min-width: 100%;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
.cell {
|
|
1031
|
+
padding: 1rem;
|
|
1032
|
+
border-left: 1px solid ${Qe.headerBackground};
|
|
1033
|
+
border-bottom: 1px solid ${Qe.headerBackground};
|
|
1034
|
+
overflow-x: auto;
|
|
1035
|
+
display: flex;
|
|
1036
|
+
align-items: center;
|
|
1037
|
+
font-family: ${Qe.contentFont};
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/* Even is 2n+1 and odd is 2n because of the header */
|
|
1041
|
+
.row:nth-child(2n) > .cell {
|
|
1042
|
+
background: ${Qe.oddRowBackground};
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.row:nth-child(2n + 1) > .cell {
|
|
1046
|
+
background: ${Qe.evenRowBackground};
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.row:hover > .cell {
|
|
1050
|
+
background: ${Qe.rowHoverBackground};
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
.cell:last-of-type {
|
|
1054
|
+
border-right: 1px solid ${Qe.headerBackground};
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
.row:last-of-type .cell:first-of-type {
|
|
1058
|
+
border-radius: 0 0 0 .5rem;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.row:last-of-type .cell:last-of-type {
|
|
1062
|
+
border-radius: 0 0 .5rem 0;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.hidden {
|
|
1066
|
+
visibility: hidden;
|
|
1067
|
+
}
|
|
1068
|
+
`}init(t,e,i){this.data=t,this.columns=e,this.sort=i}getTemplate(){let t=this.sortData(this.filterData());return e.html`
|
|
1069
|
+
<div class="table">
|
|
1070
|
+
<div class="header">
|
|
1071
|
+
${r.repeat(this.columns,((t,e)=>"header-cell-"+e),((t,e)=>this.renderHeader(t,e)))}
|
|
1072
|
+
</div>
|
|
1073
|
+
${r.repeat(t,((t,e)=>"row-"+e),((t,i)=>e.html`
|
|
1074
|
+
<div class="row"
|
|
1075
|
+
@click=${()=>this.dispatchEvent(new Je(t))}>
|
|
1076
|
+
${r.repeat(this.columns,((t,e)=>"cell-"+i+" "+e),(e=>this.renderCell(e,t,i)))}
|
|
1077
|
+
</div>
|
|
1078
|
+
`))}
|
|
1079
|
+
</div>
|
|
1080
|
+
`}filterData(){let t=[...this.data];return this.filters.forEach(((e,i)=>{var r;const o=this.columns[i];if(e)switch(null!==(r=o.filter)&&void 0!==r?r:"text"){case"text":e.value&&(t=t.filter((t=>this.getValueAsString(o,t,i).toLowerCase().includes(e.value.toLowerCase()))));break;case"select":e.value&&(t=t.filter((t=>this.getValueAsString(o,t,i)===e.value)))}})),t}sortData(t){var e;if(this.currentSort){const i=this.columns[this.currentSort.column],r=null!==(e=i.comparator)&&void 0!==e?e:ei,o="asc"===this.currentSort.order?r:(t,e)=>-r(t,e);return t.sort(((t,e)=>o(this.getValue(i,t),this.getValue(i,e))))}return t}update(t){super.update(t),t.has("sort")&&(this.currentSort=this.sort),(t.has("data")||t.has("columns"))&&this.updateSelectData()}updateSelectData(){this.selectData=[];const t=this.data,e=this.columns;for(let i in e){const r=e[i];"select"===r.filter&&(this.selectData[i]=[...new Set(t.map(((t,e)=>this.getValueAsString(r,t,e))))].sort(((t,e)=>t.localeCompare(e))))}this.requestUpdate()}renderHeader(t,i){return e.html`
|
|
1081
|
+
<div class="header-cell">
|
|
1082
|
+
<div class="column-title-container">
|
|
1083
|
+
<span class="column-title">${t.title}</span>
|
|
1084
|
+
${this.renderColumnSort(t,i)}
|
|
1085
|
+
</div>
|
|
1086
|
+
<div class="column-filter">
|
|
1087
|
+
${this.renderColumnFilter(t,i)}
|
|
1088
|
+
</div>
|
|
1089
|
+
</div>
|
|
1090
|
+
`}renderColumnSort(t,i){var r;const o=this.currentSort&&this.currentSort.column===i,a=o?"asc"===this.currentSort.order?"expand_more":"expand_less":"unfold_more";return e.html`
|
|
1091
|
+
<ft-button
|
|
1092
|
+
round
|
|
1093
|
+
dense
|
|
1094
|
+
class="${null===(r=t.sortable)||void 0===r||r?"":"hidden"}"
|
|
1095
|
+
icon="${a}"
|
|
1096
|
+
label="Sort ${t.title}"
|
|
1097
|
+
@click=${()=>{var t;o?"asc"===(null===(t=this.currentSort)||void 0===t?void 0:t.order)?this.currentSort={column:i,order:"desc"}:this.currentSort=void 0:this.currentSort={column:i,order:"asc"}}}
|
|
1098
|
+
></ft-button>
|
|
1099
|
+
`}renderColumnFilter(t,i){var r,o;const a=t=>{this.filters[i]={value:t.detail},this.requestUpdate()};switch(null!==(r=t.filter)&&void 0!==r?r:"text"){case"text":return e.html`
|
|
1100
|
+
<ft-text-field
|
|
1101
|
+
label="Search ${t.title}"
|
|
1102
|
+
@live-change="${a}"
|
|
1103
|
+
></ft-text-field>
|
|
1104
|
+
`;case"select":const r=null!==(o=this.selectData[i])&&void 0!==o?o:[];return r.length?e.html`
|
|
1105
|
+
<ft-select label="Filter ${t.title}" @change=${a}>
|
|
1106
|
+
<ft-select-option></ft-select-option>
|
|
1107
|
+
${r.map((t=>e.html`
|
|
1108
|
+
<ft-select-option value="${t}" label="${t}"></ft-select-option>
|
|
1109
|
+
`))}
|
|
1110
|
+
</ft-select>
|
|
1111
|
+
`:null}return null}renderCell(t,i,r){var a;const n=null!==(a=t.render)&&void 0!==a?a:ti;return e.html`
|
|
1112
|
+
<div class="cell">${(t=>{const e=n(t,r);return"string"==typeof e?o.unsafeHTML(e):e})(this.getValue(t,i))}</div>
|
|
1113
|
+
`}getValue(t,e){return"string"==typeof t.getter?e[t.getter]:t.getter(e)}getValueAsString(t,e,i){const r=this.getValue(t,e);return"function"==typeof t.stringify?t.stringify(r,i):(t=>""+t)(r)}},Ye([i.property({attribute:!1})],t.FtFilterableTable.prototype,"data",void 0),Ye([i.property({attribute:!1})],t.FtFilterableTable.prototype,"columns",void 0),Ye([i.property({attribute:!1})],t.FtFilterableTable.prototype,"sort",void 0),Ye([i.state()],t.FtFilterableTable.prototype,"currentSort",void 0),t.FtFilterableTable=Ye([a.customElement("ft-filterable-table")],t.FtFilterableTable),t.FtFilterableTableCssVariables=Qe,t.RowClickEvent=Je,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML,ftGlobals.wcUtils,ftGlobals.litClassMap,ftGlobals.litStyleMap);
|