@fluid-topics/ft-filterable-table 0.3.65 → 0.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-filterable-table.light.js +122 -123
- package/build/ft-filterable-table.min.js +51 -52
- package/package.json +6 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
!function(t,e,i,o,s,n
|
|
1
|
+
!function(t,e,i,o,s,l,n){
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
var r;const a=window,p=a.trustedTypes,f=p?p.createPolicy("lit-html",{createHTML:t=>t}):void 0,d=`lit$${(Math.random()+"").slice(9)}$`,h="?"+d,c=`<${h}>`,u=document,x=(t="")=>u.createComment(t),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,b=Array.isArray,v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,m=/>/g,$=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\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"),
|
|
7
|
+
var r;const a=window,p=a.trustedTypes,f=p?p.createPolicy("lit-html",{createHTML:t=>t}):void 0,d=`lit$${(Math.random()+"").slice(9)}$`,h="?"+d,c=`<${h}>`,u=document,x=(t="")=>u.createComment(t),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,b=Array.isArray,v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,m=/>/g,$=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\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"),E=Symbol.for("lit-nothing"),C=new WeakMap,I=u.createTreeWalker(u,129,null,!1),D=(t,e)=>{const i=t.length-1,o=[];let s,l=2===e?"<svg>":"",n=v;for(let e=0;e<i;e++){const i=t[e];let r,a,p=-1,f=0;for(;f<i.length&&(n.lastIndex=f,a=n.exec(i),null!==a);)f=n.lastIndex,n===v?"!--"===a[1]?n=y:void 0!==a[1]?n=m:void 0!==a[2]?(S.test(a[2])&&(s=RegExp("</"+a[2],"g")),n=$):void 0!==a[3]&&(n=$):n===$?">"===a[0]?(n=null!=s?s:v,p=-1):void 0===a[1]?p=-2:(p=n.lastIndex-a[2].length,r=a[1],n=void 0===a[3]?$:'"'===a[3]?k:w):n===k||n===w?n=$:n===y||n===m?n=v:(n=$,s=void 0);const h=n===$&&t[e+1].startsWith("/>")?" ":"";l+=n===v?i+c:p>=0?(o.push(r),i.slice(0,p)+"$lit$"+i.slice(p)+d+h):i+d+(-2===p?(o.push(void 0),e):h)}const r=l+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==f?f.createHTML(r):r,o]};class B{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,l=0;const n=t.length-1,r=this.parts,[a,f]=D(t,e);if(this.el=B.createElement(a,i),I.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=I.nextNode())&&r.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(d)){const i=f[l++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(d),e=/([.?@])?(.*)/.exec(i);r.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?A:"?"===e[1]?T:"@"===e[1]?R:Z})}else r.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(S.test(o.tagName)){const t=o.textContent.split(d),e=t.length-1;if(e>0){o.textContent=p?p.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],x()),I.nextNode(),r.push({type:2,index:++s});o.append(t[e],x())}}}else if(8===o.nodeType)if(o.data===h)r.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(d,t+1));)r.push({type:7,index:s}),t+=d.length-1}s++}}static createElement(t,e){const i=u.createElement("template");return i.innerHTML=t,i}}function j(t,e,i=t,o){var s,l,n,r;if(e===O)return e;let a=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const p=g(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==p&&(null===(l=null==a?void 0:a._$AO)||void 0===l||l.call(a,!1),void 0===p?a=void 0:(a=new p(t),a._$AT(t,i,o)),void 0!==o?(null!==(n=(r=i)._$Co)&&void 0!==n?n:r._$Co=[])[o]=a:i._$Cl=a),void 0!==a&&(e=j(t,a._$AS(t,e.values),a,o)),e}class N{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:u).importNode(i,!0);I.currentNode=s;let l=I.nextNode(),n=0,r=0,a=o[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new F(l,l.nextSibling,this,t):1===a.type?e=new a.ctor(l,a.name,a.strings,this,t):6===a.type&&(e=new _(l,this,t)),this.u.push(e),a=o[++r]}n!==(null==a?void 0:a.index)&&(l=I.nextNode(),n++)}return s}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class F{constructor(t,e,i,o){var s;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cm=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}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=j(this,t,e),g(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==O&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>b(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==E&&g(this._$AH)?this._$AA.nextSibling.data=t:this.T(u.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=B.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.p(i);else{const t=new N(s,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=C.get(t.strings);return void 0===e&&C.set(t.strings,e=new B(t)),e}k(t){b(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new F(this.O(x()),this.O(x()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$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._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Z{constructor(t,e,i,o,s){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let l=!1;if(void 0===s)t=j(this,t,e,0),l=!g(t)||t!==this._$AH&&t!==O,l&&(this._$AH=t);else{const o=t;let n,r;for(t=s[0],n=0;n<s.length-1;n++)r=j(this,o[i+n],e,n),r===O&&(r=this._$AH[n]),l||(l=!g(r)||r!==this._$AH[n]),r===E?t=E:t!==E&&(t+=(null!=r?r:"")+s[n+1]),this._$AH[n]=r}l&&!o&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class A extends Z{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}const M=p?p.emptyScript:"";class T extends Z{constructor(){super(...arguments),this.type=4}j(t){t&&t!==E?this.element.setAttribute(this.name,M):this.element.removeAttribute(this.name)}}class R extends Z{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=j(this,t,e,0))&&void 0!==i?i:E)===O)return;const o=this._$AH,s=t===E&&o!==E||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,l=t!==E&&(o===E||s);s&&this.element.removeEventListener(this.name,this,o),l&&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 _{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){j(this,t)}}const U=a.litHtmlPolyfillSupport;null==U||U(B,F),(null!==(r=a.litHtmlVersions)&&void 0!==r?r:a.litHtmlVersions=[]).push("2.4.0");
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2020 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const H=Symbol.for(""),
|
|
13
|
+
const H=Symbol.for(""),P=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t._$litStatic$},W=t=>({_$litStatic$:t,r:H}),K=new Map,L=(t=>(e,...i)=>{const o=i.length;let s,l;const n=[],r=[];let a,p=0,f=!1;for(;p<o;){for(a=e[p];p<o&&void 0!==(l=i[p],s=P(l));)a+=s+e[++p],f=!0;r.push(l),n.push(a),p++}if(p===o&&n.push(e[o]),f){const t=n.join("$$lit$$");void 0===(e=K.get(t))&&(n.raw=n,K.set(t,e=n)),i=r}return t(e,...i)})(z);var V;!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"}(V||(V={}));const G=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),q=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),X={fontFamily:q,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},Y=e.FtCssVariableFactory.extend("--ft-typography-title-font-family",G),J=e.FtCssVariableFactory.extend("--ft-typography-title-font-size",X.fontSize,"20px"),Q=e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",X.fontWeight,"normal"),tt=e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",X.letterSpacing,"0.15px"),et=e.FtCssVariableFactory.extend("--ft-typography-title-line-height",X.lineHeight,"1.2"),it=e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",X.textTransform,"inherit"),ot=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",G),st=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",X.fontSize,"14px"),lt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",X.fontWeight,"normal"),nt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",X.letterSpacing,"0.105px"),rt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",X.lineHeight,"1.7"),at=e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",X.textTransform,"inherit"),pt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",q),ft=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",X.fontSize,"16px"),dt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",X.fontWeight,"600"),ht=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",X.letterSpacing,"0.144px"),ct=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",X.lineHeight,"1.5"),ut=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",X.textTransform,"inherit"),xt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",q),gt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",X.fontSize,"14px"),bt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",X.fontWeight,"normal"),vt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",X.letterSpacing,"0.098px"),yt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",X.lineHeight,"1.7"),mt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",X.textTransform,"inherit"),$t={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",X.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",X.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",X.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",X.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",X.textTransform,"inherit")},wt=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",q),kt=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",X.fontSize,"14px"),St=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",X.fontWeight,"normal"),zt=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",X.letterSpacing,"0.252px"),Ot=e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",X.lineHeight,"1.4"),Et=e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",X.textTransform,"inherit"),Ct={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",X.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",X.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",X.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",X.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",X.textTransform,"inherit")},It=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",q),Dt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",X.fontSize,"10px"),Bt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",X.fontWeight,"normal"),jt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",X.letterSpacing,"0.33px"),Nt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",X.lineHeight,"1.6"),Ft=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",X.textTransform,"inherit"),Zt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",q),At=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",X.fontSize,"10px"),Mt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",X.fontWeight,"normal"),Tt=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",X.letterSpacing,"1.5px"),Rt=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",X.lineHeight,"1.6"),_t=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",X.textTransform,"uppercase"),Ut={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",X.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",X.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",X.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",X.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",X.textTransform,"uppercase")},Ht=i.css`
|
|
14
14
|
.ft-typography--title {
|
|
15
15
|
font-family: ${Y};
|
|
16
16
|
font-size: ${J};
|
|
@@ -19,16 +19,16 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
19
19
|
line-height: ${et};
|
|
20
20
|
text-transform: ${it};
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,Pt=i.css`
|
|
23
23
|
.ft-typography--title-dense {
|
|
24
24
|
font-family: ${ot};
|
|
25
25
|
font-size: ${st};
|
|
26
|
-
font-weight: ${
|
|
27
|
-
letter-spacing: ${
|
|
26
|
+
font-weight: ${lt};
|
|
27
|
+
letter-spacing: ${nt};
|
|
28
28
|
line-height: ${rt};
|
|
29
29
|
text-transform: ${at};
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,Wt=i.css`
|
|
32
32
|
.ft-typography--subtitle1 {
|
|
33
33
|
font-family: ${pt};
|
|
34
34
|
font-size: ${ft};
|
|
@@ -37,7 +37,7 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
37
37
|
line-height: ${ct};
|
|
38
38
|
text-transform: ${ut};
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`,Kt=i.css`
|
|
41
41
|
.ft-typography--subtitle2 {
|
|
42
42
|
font-family: ${xt};
|
|
43
43
|
font-size: ${gt};
|
|
@@ -47,7 +47,7 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
47
47
|
text-transform: ${mt};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
`,
|
|
50
|
+
`,Lt=i.css`
|
|
51
51
|
.ft-typography--body1 {
|
|
52
52
|
font-family: ${$t.fontFamily};
|
|
53
53
|
font-size: ${$t.fontSize};
|
|
@@ -63,21 +63,21 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
63
63
|
font-weight: ${St};
|
|
64
64
|
letter-spacing: ${zt};
|
|
65
65
|
line-height: ${Ot};
|
|
66
|
-
text-transform: ${
|
|
66
|
+
text-transform: ${Et};
|
|
67
67
|
}
|
|
68
68
|
`,Gt=i.css`
|
|
69
69
|
.ft-typography--caption {
|
|
70
|
-
font-family: ${
|
|
71
|
-
font-size: ${
|
|
72
|
-
font-weight: ${
|
|
73
|
-
letter-spacing: ${
|
|
74
|
-
line-height: ${
|
|
75
|
-
text-transform: ${
|
|
70
|
+
font-family: ${Ct.fontFamily};
|
|
71
|
+
font-size: ${Ct.fontSize};
|
|
72
|
+
font-weight: ${Ct.fontWeight};
|
|
73
|
+
letter-spacing: ${Ct.letterSpacing};
|
|
74
|
+
line-height: ${Ct.lineHeight};
|
|
75
|
+
text-transform: ${Ct.textTransform};
|
|
76
76
|
}
|
|
77
77
|
`,qt=i.css`
|
|
78
78
|
.ft-typography--breadcrumb {
|
|
79
|
-
font-family: ${
|
|
80
|
-
font-size: ${
|
|
79
|
+
font-family: ${It};
|
|
80
|
+
font-size: ${Dt};
|
|
81
81
|
font-weight: ${Bt};
|
|
82
82
|
letter-spacing: ${jt};
|
|
83
83
|
line-height: ${Nt};
|
|
@@ -85,10 +85,10 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
85
85
|
}
|
|
86
86
|
`,Xt=i.css`
|
|
87
87
|
.ft-typography--overline {
|
|
88
|
-
font-family: ${
|
|
89
|
-
font-size: ${
|
|
90
|
-
font-weight: ${
|
|
91
|
-
letter-spacing: ${
|
|
88
|
+
font-family: ${Zt};
|
|
89
|
+
font-size: ${At};
|
|
90
|
+
font-weight: ${Mt};
|
|
91
|
+
letter-spacing: ${Tt};
|
|
92
92
|
line-height: ${Rt};
|
|
93
93
|
text-transform: ${_t};
|
|
94
94
|
}
|
|
@@ -105,14 +105,14 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
105
105
|
.ft-typography {
|
|
106
106
|
vertical-align: inherit;
|
|
107
107
|
}
|
|
108
|
-
`;var Qt=function(t,e,i,o){for(var s,
|
|
109
|
-
<${
|
|
108
|
+
`;var Qt=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class te extends e.FtLitElement{constructor(){super(...arguments),this.variant=V.body1}render(){return this.element?L`
|
|
109
|
+
<${W(this.element)}
|
|
110
110
|
class="ft-typography ft-typography--${this.variant}">
|
|
111
111
|
<slot></slot>
|
|
112
|
-
</${
|
|
113
|
-
`:
|
|
112
|
+
</${W(this.element)}>
|
|
113
|
+
`:L`
|
|
114
114
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
115
|
-
`}}te.styles=[Ht,Wt,Kt,Lt,
|
|
115
|
+
`}}te.styles=[Ht,Pt,Wt,Kt,Lt,Vt,Gt,qt,Xt,Yt,Jt],Qt([o.property()],te.prototype,"element",void 0),Qt([o.property()],te.prototype,"variant",void 0),e.customElement("ft-typography")(te);const ee={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},ie=i.css`
|
|
116
116
|
.ft-input-label {
|
|
117
117
|
position: absolute;
|
|
118
118
|
inset: 0;
|
|
@@ -163,8 +163,8 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
163
163
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
164
164
|
max-width: calc(${ee.labelMaxWidth} - 2 * (${ee.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
165
165
|
text-overflow: ellipsis;
|
|
166
|
-
${e.setVariable(
|
|
167
|
-
${e.setVariable(
|
|
166
|
+
${e.setVariable(Ct.fontSize,ee.fontSize)};
|
|
167
|
+
${e.setVariable(Ct.lineHeight,ee.fontSize)};
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.ft-input-label--in-error .ft-input-label--text {
|
|
@@ -196,8 +196,8 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
.ft-input-label--raised .ft-input-label--text {
|
|
199
|
-
${e.setVariable(
|
|
200
|
-
${e.setVariable(
|
|
199
|
+
${e.setVariable(Ct.fontSize,ee.raisedFontSize)};
|
|
200
|
+
${e.setVariable(Ct.lineHeight,ee.raisedFontSize)};
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
@@ -234,8 +234,8 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
234
234
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
235
235
|
border-top: none;
|
|
236
236
|
}
|
|
237
|
-
`;var oe=function(t,e,i,o){for(var s,
|
|
238
|
-
<div class="${
|
|
237
|
+
`;var oe=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class se extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return i.html`
|
|
238
|
+
<div class="${n.classMap(t)}">
|
|
239
239
|
${this.text?i.html`
|
|
240
240
|
<div class="ft-input-label--text ft-typography--caption">
|
|
241
241
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
@@ -243,7 +243,7 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
243
243
|
</div>
|
|
244
244
|
`:null}
|
|
245
245
|
</div>
|
|
246
|
-
`}}se.elementDefinitions={},se.styles=[Gt,ie],oe([o.property({type:String})],se.prototype,"text",void 0),oe([o.property({type:Boolean})],se.prototype,"raised",void 0),oe([o.property({type:Boolean})],se.prototype,"outlined",void 0),oe([o.property({type:Boolean})],se.prototype,"disabled",void 0),oe([o.property({type:Boolean})],se.prototype,"error",void 0),e.customElement("ft-input-label")(se);const
|
|
246
|
+
`}}se.elementDefinitions={},se.styles=[Gt,ie],oe([o.property({type:String})],se.prototype,"text",void 0),oe([o.property({type:Boolean})],se.prototype,"raised",void 0),oe([o.property({type:Boolean})],se.prototype,"outlined",void 0),oe([o.property({type:Boolean})],se.prototype,"disabled",void 0),oe([o.property({type:Boolean})],se.prototype,"error",void 0),e.customElement("ft-input-label")(se);const le=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),ne={color:le,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",le),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},re=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),ae=re,pe=e.FtCssVariableFactory.extend("--ft-ripple-background-color",re),fe=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),de=fe,he=e.FtCssVariableFactory.extend("--ft-ripple-background-color",fe),ce=i.css`
|
|
247
247
|
:host {
|
|
248
248
|
display: contents;
|
|
249
249
|
}
|
|
@@ -265,11 +265,11 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
.ft-ripple .ft-ripple--background {
|
|
268
|
-
background-color: ${
|
|
268
|
+
background-color: ${ne.backgroundColor};
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
.ft-ripple .ft-ripple--effect {
|
|
272
|
-
background-color: ${
|
|
272
|
+
background-color: ${ne.color};
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
@@ -317,22 +317,22 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
320
|
-
opacity: ${
|
|
320
|
+
opacity: ${ne.opacityContentOnSurfaceHover};
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
324
|
-
opacity: ${
|
|
324
|
+
opacity: ${ne.opacityContentOnSurfaceSelected};
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
328
|
-
opacity: ${
|
|
328
|
+
opacity: ${ne.opacityContentOnSurfaceFocused};
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
332
|
-
opacity: ${
|
|
332
|
+
opacity: ${ne.opacityContentOnSurfacePressed};
|
|
333
333
|
transform: translate(-50%, -50%) scale(1);
|
|
334
334
|
}
|
|
335
|
-
`;var ue,xe,ge=function(t,e,i,o){for(var s,
|
|
335
|
+
`;var ue,xe,ge=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class be extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new e.Debouncer(10),this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),l=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-l.x:l.width/2),this.originY=Math.round(null!=s?s-l.y:l.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return i.html`
|
|
336
336
|
<style>
|
|
337
337
|
.ft-ripple .ft-ripple--effect,
|
|
338
338
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -345,7 +345,7 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
345
345
|
top: ${this.originY}px;
|
|
346
346
|
}
|
|
347
347
|
</style>
|
|
348
|
-
<div class="${
|
|
348
|
+
<div class="${n.classMap(t)}">
|
|
349
349
|
<div class="ft-ripple--background"></div>
|
|
350
350
|
<div class="ft-ripple--effect"></div>
|
|
351
351
|
</div>
|
|
@@ -396,9 +396,9 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
396
396
|
.ft-icon--material {
|
|
397
397
|
font-family: ${ve.materialFontFamily}, "Material Icons", sans-serif;
|
|
398
398
|
}
|
|
399
|
-
`;var me;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(me||(me={}));var $e=function(t,e,i,o){for(var s,
|
|
399
|
+
`;var me;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(me||(me={}));var $e=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class we extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=i.nothing}render(){var t;const e=null!==(t=this.variant)&&void 0!==t?t:me.fluid_topics,o="material"!==e||this.value;return i.html`
|
|
400
400
|
<i class="ft-icon ${"ft-icon--"+e}">
|
|
401
|
-
${
|
|
401
|
+
${l.unsafeHTML(this.resolvedIcon)}
|
|
402
402
|
<slot ?hidden=${o}></slot>
|
|
403
403
|
</i>
|
|
404
404
|
`}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:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case me.file_format:this.resolvedIcon=null!==(t=xe[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case me.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=ue[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}we.elementDefinitions={},we.styles=ye,$e([o.property()],we.prototype,"variant",void 0),$e([o.property()],we.prototype,"value",void 0),$e([o.state()],we.prototype,"resolvedIcon",void 0),$e([o.query("slot")],we.prototype,"slottedContent",void 0),e.customElement("ft-icon")(we);const ke={labelSize:e.FtCssVariableFactory.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:e.FtCssVariableFactory.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-select-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-select-horizontal-spacing","SIZE","16px"),optionsHeight:e.FtCssVariableFactory.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:e.FtCssVariableFactory.extend("--ft-select-selected-option-color",e.designSystemVariables.colorOnSurface),helperColor:e.FtCssVariableFactory.extend("--ft-select-helper-color",e.designSystemVariables.colorOnSurfaceMedium),optionsColor:e.FtCssVariableFactory.extend("--ft-select-options-color",e.designSystemVariables.colorOnSurface),optionsZIndex:e.FtCssVariableFactory.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Se=i.css`
|
|
@@ -428,13 +428,13 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
428
428
|
padding-right: ${ke.horizontalSpacing};
|
|
429
429
|
gap: 8px;
|
|
430
430
|
color: ${ke.selectedOptionColor};
|
|
431
|
-
${e.setVariable(
|
|
431
|
+
${e.setVariable(ne.color,ke.selectedOptionColor)};
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
.ft-select--input-panel,
|
|
435
435
|
.ft-select--option {
|
|
436
|
-
${e.setVariable(
|
|
437
|
-
${e.setVariable(
|
|
436
|
+
${e.setVariable(ne.opacityContentOnSurfaceHover,"0.08")};
|
|
437
|
+
${e.setVariable(ne.opacityContentOnSurfacePressed,"0.04")};
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
.ft-select--input-panel > *:not(ft-ripple),
|
|
@@ -550,8 +550,8 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
550
550
|
.ft-select--in-error .ft-select--helper-text {
|
|
551
551
|
color: ${ke.colorError};
|
|
552
552
|
}
|
|
553
|
-
`;var ze=function(t,e,i,o){for(var s,
|
|
554
|
-
<div class="${
|
|
553
|
+
`;var ze=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class Oe extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}render(){return i.html``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Oe.elementDefinitions={},ze([o.property({type:String})],Oe.prototype,"label",void 0),ze([o.property({type:Object,converter:t=>t})],Oe.prototype,"value",void 0),ze([o.property({type:Boolean,reflect:!0})],Oe.prototype,"selected",void 0);class Ee extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.options=[],this.optionsDisplayed=!1,this.focusOptions=!1,this.hideOptions=t=>this.optionsDisplayed=this.optionsDisplayed&&t.composedPath().includes(this.container)}render(){var t,e,o,l,r;let a=this.hasOptionsMenuOpen,p=this.disabled||!this.hasOptions;const f=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(o=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==o?o:"").length>0,d={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":p,"ft-select--options-displayed":a,"ft-select--has-option-selected":f,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return i.html`
|
|
554
|
+
<div class="${n.classMap(d)}" part="container">
|
|
555
555
|
<div class="ft-select--main-panel" part="main-panel">
|
|
556
556
|
<ft-input-label text="${this.label}"
|
|
557
557
|
part="label"
|
|
@@ -570,7 +570,7 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
570
570
|
aria-expanded="${a}">
|
|
571
571
|
<ft-ripple ?disabled=${p} ?activated=${!this.outlined}></ft-ripple>
|
|
572
572
|
<ft-typography variant="body1" class="ft-select--selected-option">
|
|
573
|
-
${null!==(r=null===(
|
|
573
|
+
${null!==(r=null===(l=this.selectedOption)||void 0===l?void 0:l.label)&&void 0!==r?r:""}
|
|
574
574
|
</ft-typography>
|
|
575
575
|
<ft-icon variant="material">${a?"expand_less":"expand_more"}</ft-icon>
|
|
576
576
|
</div>
|
|
@@ -589,7 +589,7 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
589
589
|
@option-change=${this.updateOptionsFromSlot}
|
|
590
590
|
></slot>
|
|
591
591
|
`}renderOption(t){let e=this.selectedOption===t;const o={"ft-select--option":!0,"ft-select--option-selected":e,"ft-typography--body2":!0};return i.html`
|
|
592
|
-
<div class="${
|
|
592
|
+
<div class="${n.classMap(o)}"
|
|
593
593
|
part="option"
|
|
594
594
|
tabindex="0"
|
|
595
595
|
data-value="${t.value}"
|
|
@@ -598,13 +598,13 @@ const H=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===H)return null==t?void 0:t
|
|
|
598
598
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
599
599
|
<span>${t.label}</span>
|
|
600
600
|
</div>
|
|
601
|
-
`}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}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 hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}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,o,s,
|
|
601
|
+
`}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}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 hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}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,o,s,l;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!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(l=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==l?l: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){var i,o;if(!e.deepEqual(null===(i=this.selectedOption)||void 0===i?void 0:i.value,t.value)){this.selectedOption=t;for(let e of this.options)e.selected=e===t;this.dispatchEvent(new CustomEvent("change",{detail:null===(o=this.selectedOption)||void 0===o?void 0:o.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Ee.elementDefinitions={"ft-input-label":se,"ft-typography":te,"ft-ripple":be,"ft-icon":we},Ee.styles=[Vt,Gt,Se],ze([o.property({type:String})],Ee.prototype,"label",void 0),ze([o.property({type:String})],Ee.prototype,"helper",void 0),ze([o.property({type:Boolean})],Ee.prototype,"outlined",void 0),ze([o.property({type:Boolean})],Ee.prototype,"disabled",void 0),ze([o.property({type:Boolean})],Ee.prototype,"error",void 0),ze([o.property({type:Boolean})],Ee.prototype,"fixedMenuPosition",void 0),ze([o.property({type:Array})],Ee.prototype,"options",void 0),ze([o.state()],Ee.prototype,"selectedOption",void 0),ze([o.state()],Ee.prototype,"optionsDisplayed",void 0),ze([o.state()],Ee.prototype,"focusOptions",void 0),ze([o.query(".ft-select")],Ee.prototype,"container",void 0),ze([o.query(".ft-select--options")],Ee.prototype,"optionsMenu",void 0),ze([o.query(".ft-select--input-panel")],Ee.prototype,"mainPanel",void 0),ze([o.query(".ft-select--option:first-child")],Ee.prototype,"firstOption",void 0),ze([o.query(".ft-select--option:focus")],Ee.prototype,"focusedOption",void 0),ze([o.query(".ft-select--option.ft-select--option-selected")],Ee.prototype,"selectedOptionElement",void 0),ze([o.query(".ft-select--option:last-child")],Ee.prototype,"lastOption",void 0),ze([o.query("slot")],Ee.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Ee),e.customElement("ft-select-option")(Oe);
|
|
602
602
|
/**
|
|
603
603
|
* @license
|
|
604
604
|
* Copyright 2018 Google LLC
|
|
605
605
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
606
606
|
*/
|
|
607
|
-
const
|
|
607
|
+
const Ce={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-field-label-size","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-field-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-field-horizontal-spacing","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-field-helper-color",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system"),prefixColor:e.FtCssVariableFactory.extend("--ft-text-field-prefix-color",e.designSystemVariables.colorOnSurfaceMedium),iconColor:e.FtCssVariableFactory.extend("--ft-text-field-icon-color",e.designSystemVariables.colorOnSurfaceMedium),floatingZIndex:e.FtCssVariableFactory.create("--ft-text-field-floating-components-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),suggestSize:e.FtCssVariableFactory.create("--ft-text-field-suggest-size","SIZE","300px")},Ie=i.css`
|
|
608
608
|
*:focus {
|
|
609
609
|
outline: none;
|
|
610
610
|
}
|
|
@@ -617,16 +617,16 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
ft-input-label {
|
|
620
|
-
${e.setVariable(ee.fontSize,
|
|
621
|
-
${e.setVariable(ee.raisedFontSize,
|
|
622
|
-
${e.setVariable(ee.verticalSpacing,
|
|
623
|
-
${e.setVariable(ee.horizontalSpacing,
|
|
620
|
+
${e.setVariable(ee.fontSize,Ce.fontSize)};
|
|
621
|
+
${e.setVariable(ee.raisedFontSize,Ce.labelSize)};
|
|
622
|
+
${e.setVariable(ee.verticalSpacing,Ce.verticalSpacing)};
|
|
623
|
+
${e.setVariable(ee.horizontalSpacing,Ce.horizontalSpacing)};
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
.ft-text-field--main-panel {
|
|
627
627
|
position: relative;
|
|
628
628
|
display: flex;
|
|
629
|
-
height: calc(4 * ${
|
|
629
|
+
height: calc(4 * ${Ce.verticalSpacing} + ${Ce.labelSize} + ${Ce.fontSize});
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
.ft-text-field--input-panel {
|
|
@@ -635,24 +635,24 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
635
635
|
display: flex;
|
|
636
636
|
align-items: center;
|
|
637
637
|
overflow: hidden;
|
|
638
|
-
padding: 0 ${
|
|
638
|
+
padding: 0 ${Ce.horizontalSpacing};
|
|
639
639
|
|
|
640
|
-
${e.setVariable($t.fontSize,
|
|
641
|
-
${e.setVariable($t.lineHeight,
|
|
640
|
+
${e.setVariable($t.fontSize,Ce.fontSize)};
|
|
641
|
+
${e.setVariable($t.lineHeight,Ce.fontSize)};
|
|
642
642
|
}
|
|
643
643
|
|
|
644
644
|
.ft-text-field--input-panel ft-ripple {
|
|
645
|
-
${e.setVariable(
|
|
646
|
-
${e.setVariable(
|
|
645
|
+
${e.setVariable(ne.opacityContentOnSurfaceHover,"0.08")};
|
|
646
|
+
${e.setVariable(ne.opacityContentOnSurfacePressed,"0.04")};
|
|
647
647
|
}
|
|
648
648
|
|
|
649
649
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
|
|
650
650
|
align-items: flex-end;
|
|
651
|
-
padding: 0 ${
|
|
651
|
+
padding: 0 ${Ce.horizontalSpacing} ${Ce.verticalSpacing} ${Ce.horizontalSpacing};
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
.ft-text-field--prefix {
|
|
655
|
-
color: ${
|
|
655
|
+
color: ${Ce.prefixColor};
|
|
656
656
|
margin-right: 2px;
|
|
657
657
|
flex-shrink: 1;
|
|
658
658
|
overflow: hidden;
|
|
@@ -671,15 +671,15 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
671
671
|
flex-shrink: 1;
|
|
672
672
|
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
673
673
|
|
|
674
|
-
color: ${
|
|
675
|
-
padding: calc(2 * ${
|
|
674
|
+
color: ${Ce.colorOnSurface};
|
|
675
|
+
padding: calc(2 * ${Ce.verticalSpacing}) 0;
|
|
676
676
|
border: none;
|
|
677
677
|
background: none;
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input {
|
|
681
681
|
padding-bottom: 0;
|
|
682
|
-
padding-top: calc(${
|
|
682
|
+
padding-top: calc(${Ce.labelSize} + 2 * ${Ce.verticalSpacing});
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
.ft-text-field--input::-webkit-calendar-picker-indicator,
|
|
@@ -688,37 +688,37 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
688
688
|
}
|
|
689
689
|
|
|
690
690
|
.ft-text-field--disabled .ft-text-field--input {
|
|
691
|
-
color: ${
|
|
691
|
+
color: ${Ce.colorOnSurfaceDisabled};
|
|
692
692
|
}
|
|
693
693
|
|
|
694
694
|
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
695
|
-
${e.setVariable(ee.borderColor,
|
|
696
|
-
${e.setVariable(ee.textColor,
|
|
695
|
+
${e.setVariable(ee.borderColor,Ce.colorPrimary)};
|
|
696
|
+
${e.setVariable(ee.textColor,Ce.colorPrimary)};
|
|
697
697
|
}
|
|
698
698
|
|
|
699
699
|
.ft-text-field--filled .ft-text-field--input-panel {
|
|
700
|
-
border-radius: ${
|
|
700
|
+
border-radius: ${Ce.borderRadiusS} ${Ce.borderRadiusS} 0 0;
|
|
701
701
|
}
|
|
702
702
|
|
|
703
703
|
.ft-text-field--outlined .ft-text-field--input-panel {
|
|
704
|
-
border-radius: ${
|
|
704
|
+
border-radius: ${Ce.borderRadiusS};
|
|
705
705
|
}
|
|
706
706
|
|
|
707
707
|
.ft-text-field--helper-text {
|
|
708
|
-
padding: 0 12px 0 ${
|
|
709
|
-
color: ${
|
|
708
|
+
padding: 0 12px 0 ${Ce.horizontalSpacing};
|
|
709
|
+
color: ${Ce.helperColor};
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
.ft-text-field--in-error .ft-text-field--input,
|
|
713
713
|
.ft-text-field--in-error .ft-text-field--helper-text,
|
|
714
714
|
.ft-text-field--in-error .ft-text-field--prefix {
|
|
715
|
-
color: ${
|
|
715
|
+
color: ${Ce.colorError};
|
|
716
716
|
}
|
|
717
717
|
|
|
718
718
|
.ft-text-field--icon {
|
|
719
719
|
align-self: center;
|
|
720
720
|
margin-left: 8px;
|
|
721
|
-
color: ${
|
|
721
|
+
color: ${Ce.iconColor};
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
.ft-text-field--container {
|
|
@@ -731,13 +731,13 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
731
731
|
position: absolute;
|
|
732
732
|
left: 0;
|
|
733
733
|
right: 0;
|
|
734
|
-
z-index: ${
|
|
735
|
-
background: ${
|
|
736
|
-
border: 1px solid ${
|
|
737
|
-
border-radius: 0 0 ${
|
|
738
|
-
box-shadow: ${
|
|
734
|
+
z-index: ${Ce.floatingZIndex};
|
|
735
|
+
background: ${Ce.colorSurface};
|
|
736
|
+
border: 1px solid ${Ce.colorOutline};
|
|
737
|
+
border-radius: 0 0 ${Ce.borderRadiusS} ${Ce.borderRadiusS};
|
|
738
|
+
box-shadow: ${Ce.elevation02};
|
|
739
739
|
outline: none;
|
|
740
|
-
max-height: ${
|
|
740
|
+
max-height: ${Ce.suggestSize};
|
|
741
741
|
overflow-y: auto;
|
|
742
742
|
}
|
|
743
743
|
|
|
@@ -756,10 +756,11 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
756
756
|
.ft-text-field--with-icon {
|
|
757
757
|
${e.setVariable(ee.labelMaxWidth,`calc(100% - ${ve.size} - ${ee.horizontalSpacing})`)};
|
|
758
758
|
}
|
|
759
|
-
`;var
|
|
760
|
-
<div class="${
|
|
759
|
+
`;var De=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class Be extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.filterSuggestions=!1,this.focused=!1,this.lastFiredValue="",this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}render(){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--with-label":!!this.label,"ft-text-field--in-error":this.error,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":0===this.visibleSuggestions.length||this.hideSuggestions,"ft-text-field--raised-label":this.focused||""!=this.value,"ft-text-field--with-icon":!!this.icon};return i.html`
|
|
760
|
+
<div class="${n.classMap(t)}">
|
|
761
761
|
<div class="ft-text-field--main-panel"
|
|
762
|
-
@keydown=${this.handleKeyboardNavigation}
|
|
762
|
+
@keydown=${this.handleKeyboardNavigation}
|
|
763
|
+
@focusout=${this.onMainPanelBlur}>
|
|
763
764
|
<ft-input-label text="${this.label}"
|
|
764
765
|
?disabled=${this.disabled}
|
|
765
766
|
?outlined=${this.outlined}
|
|
@@ -775,16 +776,14 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
775
776
|
</ft-typography>
|
|
776
777
|
`:i.nothing}
|
|
777
778
|
<input type="text"
|
|
778
|
-
maxlength=${(t=>null!=t?t:
|
|
779
|
+
maxlength=${(t=>null!=t?t:E)(this.maxLength||void 0)}
|
|
779
780
|
aria-label="${this.label}"
|
|
780
781
|
class="ft-typography--body1 ft-text-field--input"
|
|
781
782
|
?disabled=${this.disabled}
|
|
782
783
|
.value=${this.value}
|
|
783
784
|
@click=${this.handleClick}
|
|
784
|
-
@change=${this.updateValueFromInputField}
|
|
785
785
|
@keyup=${this.handleInput}
|
|
786
|
-
@focus=${this.onFocus}
|
|
787
|
-
@blur=${this.onInputBlur}/>
|
|
786
|
+
@focus=${this.onFocus}/>
|
|
788
787
|
${this.icon?i.html`
|
|
789
788
|
<ft-icon class="ft-text-field--icon"
|
|
790
789
|
.variant=${this.iconVariant}
|
|
@@ -803,7 +802,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
803
802
|
</ft-typography>
|
|
804
803
|
`:i.nothing}
|
|
805
804
|
</div>
|
|
806
|
-
`}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}updateValueFromInputField(){var t;this.setValue((null===(t=this.input)||void 0===t?void 0:t.value)||"",!0)}handleInput(){var
|
|
805
|
+
`}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}updateValueFromInputField(){var t;this.setValue((null===(t=this.input)||void 0===t?void 0:t.value)||"",!0)}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.value!==i&&(this.hideSuggestions=!1,this.value=i,this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))),"Escape"!=t.key&&"Enter"!=t.key||this.updateValueFromInputField()}handleClick(){this.hideSuggestions=!1}setValue(t,e){e&&this.value!==t&&this.dispatchEvent(new CustomEvent("live-change",{detail:t})),this.value=t,e&&this.lastFiredValue!==this.value&&this.dispatchEvent(new CustomEvent("change",{detail:this.value})),this.lastFiredValue=this.value}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.updateValueFromInputField())}}Be.elementDefinitions={"ft-input-label":se,"ft-ripple":be,"ft-typography":te,"ft-icon":we},Be.styles=[Lt,Ie],De([o.property()],Be.prototype,"label",void 0),De([o.property()],Be.prototype,"value",void 0),De([o.property()],Be.prototype,"helper",void 0),De([o.property({type:Boolean})],Be.prototype,"outlined",void 0),De([o.property({type:Boolean})],Be.prototype,"disabled",void 0),De([o.property({type:Boolean})],Be.prototype,"error",void 0),De([o.property()],Be.prototype,"prefix",void 0),De([o.property()],Be.prototype,"icon",void 0),De([o.property()],Be.prototype,"iconVariant",void 0),De([o.property({type:Boolean})],Be.prototype,"filterSuggestions",void 0),De([o.property({type:Number})],Be.prototype,"maxLength",void 0),De([o.state()],Be.prototype,"focused",void 0),De([o.state()],Be.prototype,"lastFiredValue",void 0),De([o.state()],Be.prototype,"suggestionsOnTop",void 0),De([o.state()],Be.prototype,"hideSuggestions",void 0),De([o.state()],Be.prototype,"visibleSuggestions",void 0),De([o.query(".ft-text-field--main-panel")],Be.prototype,"mainPanel",void 0),De([o.query(".ft-text-field--input")],Be.prototype,"input",void 0),De([o.query(".ft-text-field--suggestions")],Be.prototype,"suggestionsContainer",void 0),De([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],Be.prototype,"suggestions",void 0);const je=i.css`
|
|
807
806
|
.ft-text-field-suggestion {
|
|
808
807
|
position: relative;
|
|
809
808
|
padding: 8px 16px;
|
|
@@ -828,7 +827,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
828
827
|
slot {
|
|
829
828
|
pointer-events: none;
|
|
830
829
|
}
|
|
831
|
-
`;var Ne=function(t,e,i,o){for(var s,
|
|
830
|
+
`;var Ne=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class Fe extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class Ze extends e.FtLitElement{render(){return i.html`
|
|
832
831
|
<div class="ft-text-field-suggestion"
|
|
833
832
|
tabindex="-1"
|
|
834
833
|
@keydown=${this.onKeyDown}
|
|
@@ -840,7 +839,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
840
839
|
<slot></slot>
|
|
841
840
|
</ft-typography>
|
|
842
841
|
</div>
|
|
843
|
-
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new Fe(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}
|
|
842
|
+
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new Fe(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}Ze.elementDefinitions={"ft-ripple":be,"ft-typography":te,"ft-icon":we},Ze.styles=je,Ne([o.property()],Ze.prototype,"value",void 0),Ne([o.query(".ft-text-field-suggestion")],Ze.prototype,"container",void 0),Ne([o.queryAssignedNodes()],Ze.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(Be),e.customElement("ft-text-field-suggestion")(Ze);const Ae=e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Me=e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),Te=e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Re=e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),_e=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),Ue=e.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),He=i.css`
|
|
844
843
|
.ft-tooltip--container {
|
|
845
844
|
display: block;
|
|
846
845
|
position: relative;
|
|
@@ -858,21 +857,21 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
858
857
|
width: max-content;
|
|
859
858
|
max-width: ${Ue};
|
|
860
859
|
text-align: center;
|
|
861
|
-
padding: ${
|
|
860
|
+
padding: ${Ae};
|
|
862
861
|
z-index: ${Re};
|
|
863
862
|
}
|
|
864
863
|
|
|
865
864
|
.ft-tooltip--content {
|
|
866
865
|
padding: 4px 8px;
|
|
867
866
|
border-radius: ${_e};
|
|
868
|
-
background-color: ${
|
|
869
|
-
color: ${
|
|
867
|
+
background-color: ${Te};
|
|
868
|
+
color: ${Me};
|
|
870
869
|
top: -500px;
|
|
871
870
|
left: -500px;
|
|
872
871
|
position: relative;
|
|
873
872
|
word-break: break-word;
|
|
874
873
|
}
|
|
875
|
-
`;var
|
|
874
|
+
`;var Pe=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class We extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return i.html`
|
|
876
875
|
<div part="container"
|
|
877
876
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
878
877
|
@mouseenter=${this.onHover}
|
|
@@ -890,7 +889,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
890
889
|
</div>
|
|
891
890
|
</div>
|
|
892
891
|
</div>
|
|
893
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((e=>t.has(e)))&&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.validPosition){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,o=(e.width-this.tooltip.clientWidth)/2;let s=0,
|
|
892
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((e=>t.has(e)))&&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.validPosition){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,o=(e.width-this.tooltip.clientWidth)/2;let s=0,l=0;switch(this.validPosition){case"top":l=-this.tooltip.clientHeight,s=o;break;case"bottom":l=e.height,s=o;break;case"left":l=i,s=-this.tooltip.clientWidth;break;case"right":l=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const n=this.tooltip.style;n.left=s+"px",n.top=l+"px",n.maxWidth=`max(${e.width}px, ${Ue})`}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())}}We.elementDefinitions={"ft-typography":te},We.styles=He,Pe([o.property()],We.prototype,"text",void 0),Pe([o.property({type:Boolean})],We.prototype,"manual",void 0),Pe([o.property({type:Boolean})],We.prototype,"inline",void 0),Pe([o.property({type:Number})],We.prototype,"delay",void 0),Pe([o.property()],We.prototype,"position",void 0),Pe([o.queryAssignedNodes("",!0)],We.prototype,"slotNodes",void 0),Pe([o.query(".ft-tooltip--container")],We.prototype,"container",void 0),Pe([o.query("slot")],We.prototype,"target",void 0),Pe([o.query(".ft-tooltip")],We.prototype,"tooltip",void 0),Pe([o.query(".ft-tooltip--content")],We.prototype,"tooltipContent",void 0),Pe([o.state()],We.prototype,"visible",void 0),e.customElement("ft-tooltip")(We);const Ke={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},Le=i.css`
|
|
894
893
|
:host {
|
|
895
894
|
line-height: 0;
|
|
896
895
|
}
|
|
@@ -899,8 +898,8 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
899
898
|
display: inline-block;
|
|
900
899
|
position: relative;
|
|
901
900
|
|
|
902
|
-
width: ${
|
|
903
|
-
height: ${
|
|
901
|
+
width: ${Ke.size};
|
|
902
|
+
height: ${Ke.size};
|
|
904
903
|
}
|
|
905
904
|
|
|
906
905
|
.ft-loader div {
|
|
@@ -909,7 +908,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
909
908
|
width: 25%;
|
|
910
909
|
height: 25%;
|
|
911
910
|
border-radius: 50%;
|
|
912
|
-
background: ${
|
|
911
|
+
background: ${Ke.color};
|
|
913
912
|
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
914
913
|
}
|
|
915
914
|
|
|
@@ -956,7 +955,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
956
955
|
transform: translate(0, 0);
|
|
957
956
|
}
|
|
958
957
|
100% {
|
|
959
|
-
transform: translate(calc(0.35 * ${
|
|
958
|
+
transform: translate(calc(0.35 * ${Ke.size}), 0);
|
|
960
959
|
}
|
|
961
960
|
}
|
|
962
961
|
`;class Ve extends e.FtLitElement{render(){return i.html`
|
|
@@ -966,7 +965,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
966
965
|
<div></div>
|
|
967
966
|
<div></div>
|
|
968
967
|
</div>
|
|
969
|
-
`}}Ve.styles=
|
|
968
|
+
`}}Ve.styles=Le,e.customElement("ft-loader")(Ve);const Ge=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),qe={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:Ge,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",Ut.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",Ge),verticalPadding:e.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:e.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},Xe=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),Ye={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:Xe,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",Xe)},Je=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),Qe=[e.noTextSelect,i.css`
|
|
970
969
|
:host {
|
|
971
970
|
display: inline-block;
|
|
972
971
|
max-width: 100%;
|
|
@@ -1011,11 +1010,11 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1011
1010
|
${e.setVariable(ve.size,qe.iconSize)};
|
|
1012
1011
|
--ft-button-internal-vertical-padding: 6px;
|
|
1013
1012
|
--ft-button-internal-horizontal-padding: 8px;
|
|
1014
|
-
${e.setVariable(
|
|
1013
|
+
${e.setVariable(ne.color,qe.rippleColor)};
|
|
1015
1014
|
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${qe.iconSize});
|
|
1016
1015
|
|
|
1017
1016
|
border-radius: ${qe.borderRadius};
|
|
1018
|
-
padding:
|
|
1017
|
+
padding: ${qe.verticalPadding} ${qe.horizontalPadding};
|
|
1019
1018
|
background-color: ${qe.backgroundColor};
|
|
1020
1019
|
color: var(--ft-button-internal-color);
|
|
1021
1020
|
-webkit-mask-image: radial-gradient(white, black);
|
|
@@ -1043,12 +1042,12 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1043
1042
|
.ft-button.ft-button--primary {
|
|
1044
1043
|
background-color: ${Ye.backgroundColor};
|
|
1045
1044
|
--ft-button-internal-color: ${Ye.color};
|
|
1046
|
-
${e.setVariable(
|
|
1045
|
+
${e.setVariable(ne.color,Ye.rippleColor)};
|
|
1047
1046
|
}
|
|
1048
1047
|
|
|
1049
1048
|
.ft-button.ft-button--outlined {
|
|
1050
1049
|
border: 1px solid var(--ft-button-internal-color);
|
|
1051
|
-
padding: calc(
|
|
1050
|
+
padding: calc(${qe.verticalPadding} - 1px) calc(${qe.horizontalPadding} - 1px);
|
|
1052
1051
|
}
|
|
1053
1052
|
|
|
1054
1053
|
.ft-button:focus {
|
|
@@ -1065,7 +1064,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1065
1064
|
${e.setVariable(Ut.fontSize,"1em")};
|
|
1066
1065
|
${e.setVariable(Ut.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
1067
1066
|
}
|
|
1068
|
-
|
|
1067
|
+
|
|
1069
1068
|
.ft-button--label[hidden] {
|
|
1070
1069
|
display: none;
|
|
1071
1070
|
}
|
|
@@ -1086,12 +1085,12 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1086
1085
|
}
|
|
1087
1086
|
|
|
1088
1087
|
ft-loader {
|
|
1089
|
-
${e.setVariable(
|
|
1090
|
-
${e.setVariable(
|
|
1088
|
+
${e.setVariable(Ke.size,qe.iconSize)};
|
|
1089
|
+
${e.setVariable(Ke.color,"var(--ft-button-internal-color)")};
|
|
1091
1090
|
}
|
|
1092
|
-
`];var ti=function(t,e,i,o){for(var s,
|
|
1091
|
+
`];var ti=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};class ei extends e.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=me.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){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-no-text-select":!0};return this.addTooltipIfNeeded(i.html`
|
|
1093
1092
|
<button part="button"
|
|
1094
|
-
class="${
|
|
1093
|
+
class="${n.classMap(t)}"
|
|
1095
1094
|
aria-label="${this.getLabel()}"
|
|
1096
1095
|
?disabled=${this.isDisabled()}>
|
|
1097
1096
|
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
@@ -1112,7 +1111,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1112
1111
|
</ft-tooltip>
|
|
1113
1112
|
`:t}resolveIcon(){return this.loading?i.html`
|
|
1114
1113
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
1115
|
-
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ei.elementDefinitions={"ft-ripple":be,"ft-tooltip":
|
|
1114
|
+
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ei.elementDefinitions={"ft-ripple":be,"ft-tooltip":We,"ft-typography":te,"ft-icon":we,"ft-loader":Ve},ei.styles=[e.safariEllipsisFix,Qe],ti([o.property({type:String,reflect:!0})],ei.prototype,"role",void 0),ti([o.property({type:Boolean})],ei.prototype,"primary",void 0),ti([o.property({type:Boolean})],ei.prototype,"outlined",void 0),ti([o.property({type:Boolean})],ei.prototype,"disabled",void 0),ti([o.property({type:Boolean})],ei.prototype,"dense",void 0),ti([o.property({type:Boolean})],ei.prototype,"round",void 0),ti([o.property({type:String})],ei.prototype,"label",void 0),ti([o.property({type:String})],ei.prototype,"icon",void 0),ti([o.property({type:String})],ei.prototype,"iconVariant",void 0),ti([o.property({type:Boolean})],ei.prototype,"trailingIcon",void 0),ti([o.property({type:Boolean})],ei.prototype,"loading",void 0),ti([o.property({type:String})],ei.prototype,"tooltipPosition",void 0),ti([o.property({type:Boolean})],ei.prototype,"hideTooltip",void 0),ti([o.property({type:Boolean})],ei.prototype,"forceTooltip",void 0),ti([o.query(".ft-button")],ei.prototype,"button",void 0),ti([o.query(".ft-button--label slot")],ei.prototype,"slottedContent",void 0),e.customElement("ft-button")(ei);class ii extends CustomEvent{constructor(t){super("row-click",{detail:t})}}const oi={headerBackground:e.FtCssVariableFactory.create("--ft-filterable-table-header-background","COLOR","whitesmoke"),oddRowBackground:e.FtCssVariableFactory.create("--ft-filterable-table-odd-row-background","COLOR","#FFFFFF"),evenRowBackground:e.FtCssVariableFactory.create("--ft-filterable-table-even-row-background","COLOR","#fdfdfd"),rowHoverBackground:e.FtCssVariableFactory.create("--ft-filterable-table-row-hover-background","COLOR","#fafafa"),stickyHeaderZIndex:e.FtCssVariableFactory.create("--ft-filterable-table-sticky-header-zindex","NUMBER","100"),cellVerticalBorderWidth:e.FtCssVariableFactory.create("--ft-filterable-table-cell-vertical-border-width","SIZE","1px"),colorOnSurfaceHigh:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceHigh,"Design system"),titleFont:e.FtCssVariableFactory.external(e.designSystemVariables.titleFont,"Design system"),contentFont:e.FtCssVariableFactory.external(e.designSystemVariables.contentFont,"Design system")},si=i.css`
|
|
1116
1115
|
:host {
|
|
1117
1116
|
display: block;
|
|
1118
1117
|
}
|
|
@@ -1222,7 +1221,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1222
1221
|
.hidden {
|
|
1223
1222
|
visibility: hidden;
|
|
1224
1223
|
}
|
|
1225
|
-
`;var
|
|
1224
|
+
`;var li=function(t,e,i,o){for(var s,l=arguments.length,n=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(l<3?s(n):l>3?s(e,i,n):s(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n};const ni=t=>i.html`${t}`,ri=(t,e)=>t-e;class ai extends e.FtLitElement{constructor(){super(...arguments),this.data=[],this.columns=[],this.stickyHeaders=!1,this.filters=[],this.selectData=[]}init(t,e,i){this.data=t,this.columns=e,this.sort=i}render(){let t=this.sortData(this.filterData());return i.html`
|
|
1226
1225
|
<style>
|
|
1227
1226
|
.table {
|
|
1228
1227
|
grid-template-columns: repeat(${this.columns.length}, minmax(min-content, auto));
|
|
@@ -1240,7 +1239,7 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1240
1239
|
`))}
|
|
1241
1240
|
</div>
|
|
1242
1241
|
`}filterData(){return this.filters.reduce(((t,e,i)=>{var o;const s=this.columns[i];if(e&&e.value)switch(null!==(o=s.filter)&&void 0!==o?o:"text"){case"text":return t.filter((t=>this.getValueAsString(s,t,i).toLowerCase().includes(e.value.toLowerCase())));case"select":return t.filter((t=>this.getValueAsString(s,t,i)===e.value))}return t}),this.data)}sortData(t){var e;if(this.currentSort){const i=this.columns[this.currentSort.column],o=null!==(e=i.comparator)&&void 0!==e?e:ri,s="asc"===this.currentSort.order?o:(t,e)=>-o(t,e);return[...t].sort(((t,e)=>s(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 o=e[i];"select"===o.filter&&(this.selectData[i]=[...new Set(t.map(((t,e)=>this.getValueAsString(o,t,e))))].sort(((t,e)=>t.localeCompare(e))))}this.requestUpdate()}renderHeader(t,e){const o={"header-cell":!0,"header-cell--sticky":this.stickyHeaders};return i.html`
|
|
1243
|
-
<div class="${
|
|
1242
|
+
<div class="${n.classMap(o)}"
|
|
1244
1243
|
part="${this.columnPart("header-cell",e)}">
|
|
1245
1244
|
<div class="column-title-container">
|
|
1246
1245
|
<span class="column-title"
|
|
@@ -1251,28 +1250,28 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1251
1250
|
</div>
|
|
1252
1251
|
${this.renderColumnFilter(t,e)}
|
|
1253
1252
|
</div>
|
|
1254
|
-
`}renderColumnSort(t,e){var o;const s=this.currentSort&&this.currentSort.column===e,
|
|
1253
|
+
`}renderColumnSort(t,e){var o;const s=this.currentSort&&this.currentSort.column===e,l=s?"asc"===this.currentSort.order?"expand_more":"expand_less":"unfold_more";return i.html`
|
|
1255
1254
|
<ft-button
|
|
1256
1255
|
round
|
|
1257
1256
|
dense
|
|
1258
1257
|
class="${null===(o=t.sortable)||void 0===o||o?"":"hidden"}"
|
|
1259
|
-
icon="${
|
|
1258
|
+
icon="${l}"
|
|
1260
1259
|
label="Sort ${t.title}"
|
|
1261
1260
|
@click=${()=>{var t;s?"asc"===(null===(t=this.currentSort)||void 0===t?void 0:t.order)?this.currentSort={column:e,order:"desc"}:this.currentSort=void 0:this.currentSort={column:e,order:"asc"}}}
|
|
1262
1261
|
part="${this.columnPart("sort-button",e)}"
|
|
1263
1262
|
></ft-button>
|
|
1264
|
-
`}renderColumnFilter(t,e){var o,s;const
|
|
1263
|
+
`}renderColumnFilter(t,e){var o,s;const l=t=>{this.filters[e]={value:t.detail},this.requestUpdate()};switch(null!==(o=t.filter)&&void 0!==o?o:"text"){case"text":return i.html`
|
|
1265
1264
|
<div class="column-filter" part="${this.columnPart("filter-container",e)}">
|
|
1266
1265
|
<ft-text-field
|
|
1267
1266
|
label="Search ${t.title}"
|
|
1268
|
-
@live-change="${
|
|
1267
|
+
@live-change="${l}"
|
|
1269
1268
|
part="${this.columnPart("filter",e)}"
|
|
1270
1269
|
></ft-text-field>
|
|
1271
1270
|
</div>
|
|
1272
1271
|
`;case"select":const o=null!==(s=this.selectData[e])&&void 0!==s?s:[];return o.length?i.html`
|
|
1273
1272
|
<div class="column-filter" part="${this.columnPart("filter-container",e)}">
|
|
1274
1273
|
<ft-select label="Filter ${t.title}"
|
|
1275
|
-
@change=${
|
|
1274
|
+
@change=${l}
|
|
1276
1275
|
part="${this.columnPart("filter",e)}">
|
|
1277
1276
|
<ft-select-option></ft-select-option>
|
|
1278
1277
|
${o.map((t=>i.html`
|
|
@@ -1280,9 +1279,9 @@ const Ee={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1280
1279
|
`))}
|
|
1281
1280
|
</ft-select>
|
|
1282
1281
|
</div>
|
|
1283
|
-
`:i.nothing}return i.nothing}columnPart(t,e){return`${t} ${t}-column-${e}`}renderCell(t,e,o,s){var
|
|
1282
|
+
`:i.nothing}return i.nothing}columnPart(t,e){return`${t} ${t}-column-${e}`}renderCell(t,e,o,s){var n;const r=null!==(n=t.render)&&void 0!==n?n:ni;return i.html`
|
|
1284
1283
|
<div class="cell"
|
|
1285
1284
|
part="${this.columnPart("cell",e)} cell-row-${s} cell-column-${e}-row-${s}">
|
|
1286
|
-
${(t=>{const e=r(t,s);return"string"==typeof e?
|
|
1285
|
+
${(t=>{const e=r(t,s);return"string"==typeof e?l.unsafeHTML(e):e})(this.getValue(t,o))}
|
|
1287
1286
|
</div>
|
|
1288
|
-
`}getValue(t,e){return"string"==typeof t.getter?e[t.getter]:t.getter(e)}getValueAsString(t,e,i){const o=this.getValue(t,e);return"function"==typeof t.stringify?t.stringify(o,i):(t=>""+t)(o)}}ai.styles=si,
|
|
1287
|
+
`}getValue(t,e){return"string"==typeof t.getter?e[t.getter]:t.getter(e)}getValueAsString(t,e,i){const o=this.getValue(t,e);return"function"==typeof t.stringify?t.stringify(o,i):(t=>""+t)(o)}}ai.styles=si,li([o.property({attribute:!1})],ai.prototype,"data",void 0),li([o.property({attribute:!1})],ai.prototype,"columns",void 0),li([o.property({attribute:!1})],ai.prototype,"sort",void 0),li([o.property()],ai.prototype,"stickyHeaders",void 0),li([o.state()],ai.prototype,"currentSort",void 0),e.customElement("ft-filterable-table")(ai),t.FtFilterableTable=ai,t.FtFilterableTableCssVariables=oi,t.RowClickEvent=ii,t.styles=si,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap);
|