@fluid-topics/ft-filterable-table 1.0.51 → 1.0.53
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
!function(t,e,i,o,s,l
|
|
1
|
+
!function(t,e,i,o,s,n,l){
|
|
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,d=p?p.createPolicy("lit-html",{createHTML:t=>t}):void 0,f="$lit$",h=`lit$${(Math.random()+"").slice(9)}$`,c="?"+h,u=`<${c}>`,x=document,b=()=>x.createComment(""),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,y="[ \t\n\f\r]",$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,w=/>/g,k=RegExp(`>|${y}(?:([^\\s"'>=/]+)(${y}*=${y}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),S=/'/g,z=/"/g,O=/^(?:script|style|textarea|title)$/i,E=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),C=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),B=new WeakMap,D=x.createTreeWalker(x,129,null,!1),j=(t,e)=>{const i=t.length-1,o=[];let s,
|
|
7
|
+
var r;const a=window,p=a.trustedTypes,d=p?p.createPolicy("lit-html",{createHTML:t=>t}):void 0,f="$lit$",h=`lit$${(Math.random()+"").slice(9)}$`,c="?"+h,u=`<${c}>`,x=document,b=()=>x.createComment(""),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,y="[ \t\n\f\r]",$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,w=/>/g,k=RegExp(`>|${y}(?:([^\\s"'>=/]+)(${y}*=${y}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),S=/'/g,z=/"/g,O=/^(?:script|style|textarea|title)$/i,E=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),C=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),B=new WeakMap,D=x.createTreeWalker(x,129,null,!1),j=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",l=$;for(let e=0;e<i;e++){const i=t[e];let r,a,p=-1,d=0;for(;d<i.length&&(l.lastIndex=d,a=l.exec(i),null!==a);)d=l.lastIndex,l===$?"!--"===a[1]?l=m:void 0!==a[1]?l=w:void 0!==a[2]?(O.test(a[2])&&(s=RegExp("</"+a[2],"g")),l=k):void 0!==a[3]&&(l=k):l===k?">"===a[0]?(l=null!=s?s:$,p=-1):void 0===a[1]?p=-2:(p=l.lastIndex-a[2].length,r=a[1],l=void 0===a[3]?k:'"'===a[3]?z:S):l===z||l===S?l=k:l===m||l===w?l=$:(l=k,s=void 0);const c=l===k&&t[e+1].startsWith("/>")?" ":"";n+=l===$?i+u:p>=0?(o.push(r),i.slice(0,p)+f+i.slice(p)+h+c):i+h+(-2===p?(o.push(void 0),e):c)}const r=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==d?d.createHTML(r):r,o]};class N{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const l=t.length-1,r=this.parts,[a,d]=j(t,e);if(this.el=N.createElement(a,i),D.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=D.nextNode())&&r.length<l;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith(f)||e.startsWith(h)){const i=d[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+f).split(h),e=/([.?@])?(.*)/.exec(i);r.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?R:"?"===e[1]?_:"@"===e[1]?U:M})}else r.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(O.test(o.tagName)){const t=o.textContent.split(h),e=t.length-1;if(e>0){o.textContent=p?p.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],b()),D.nextNode(),r.push({type:2,index:++s});o.append(t[e],b())}}}else if(8===o.nodeType)if(o.data===c)r.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(h,t+1));)r.push({type:7,index:s}),t+=h.length-1}s++}}static createElement(t,e){const i=x.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,o){var s,n,l,r;if(e===C)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===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===p?a=void 0:(a=new p(t),a._$AT(t,i,o)),void 0!==o?(null!==(l=(r=i)._$Co)&&void 0!==l?l:r._$Co=[])[o]=a:i._$Cl=a),void 0!==a&&(e=Z(t,a._$AS(t,e.values),a,o)),e}class F{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:x).importNode(i,!0);D.currentNode=s;let n=D.nextNode(),l=0,r=0,a=o[0];for(;void 0!==a;){if(l===a.index){let e;2===a.type?e=new A(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new P(n,this,t)),this._$AV.push(e),a=o[++r]}l!==(null==a?void 0:a.index)&&(n=D.nextNode(),l++)}return s}v(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class A{constructor(t,e,i,o){var s;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cp=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._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),g(t)?t===I||null==t||""===t?(this._$AH!==I&&this._$AR(),this._$AH=I):t!==this._$AH&&t!==C&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>v(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==I&&g(this._$AH)?this._$AA.nextSibling.data=t:this.$(x.createTextNode(t)),this._$AH=t}g(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=N.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.v(i);else{const t=new F(s,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new N(t)),e}T(t){v(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 A(this.k(b()),this.k(b()),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._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class M{constructor(t,e,i,o,s){this.type=1,this._$AH=I,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=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=Z(this,t,e,0),n=!g(t)||t!==this._$AH&&t!==C,n&&(this._$AH=t);else{const o=t;let l,r;for(t=s[0],l=0;l<s.length-1;l++)r=Z(this,o[i+l],e,l),r===C&&(r=this._$AH[l]),n||(n=!g(r)||r!==this._$AH[l]),r===I?t=I:t!==I&&(t+=(null!=r?r:"")+s[l+1]),this._$AH[l]=r}n&&!o&&this.j(t)}j(t){t===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class R extends M{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===I?void 0:t}}const T=p?p.emptyScript:"";class _ extends M{constructor(){super(...arguments),this.type=4}j(t){t&&t!==I?this.element.setAttribute(this.name,T):this.element.removeAttribute(this.name)}}class U extends M{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=Z(this,t,e,0))&&void 0!==i?i:I)===C)return;const o=this._$AH,s=t===I&&o!==I||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==I&&(o===I||s);s&&this.element.removeEventListener(this.name,this,o),n&&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 P{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){Z(this,t)}}const H=a.litHtmlPolyfillSupport;null==H||H(N,A),(null!==(r=a.litHtmlVersions)&&void 0!==r?r:a.litHtmlVersions=[]).push("2.7.3");
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2020 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t._$litStatic$},K=t=>({_$litStatic$:t,r:V}),L=new Map,G=(t=>(e,...i)=>{const o=i.length;let s,
|
|
13
|
+
const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t._$litStatic$},K=t=>({_$litStatic$:t,r:V}),L=new Map,G=(t=>(e,...i)=>{const o=i.length;let s,n;const l=[],r=[];let a,p=0,d=!1;for(;p<o;){for(a=e[p];p<o&&void 0!==(n=i[p],s=W(n));)a+=s+e[++p],d=!0;p!==o&&r.push(n),l.push(a),p++}if(p===o&&l.push(e[o]),d){const t=l.join("$$lit$$");void 0===(e=L.get(t))&&(l.raw=l,L.set(t,e=l)),i=r}return t(e,...i)})(E);var q;!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"}(q||(q={}));const X=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),Y=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),J={fontFamily:Y,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")},Q=e.FtCssVariableFactory.extend("--ft-typography-title-font-family",X),tt=e.FtCssVariableFactory.extend("--ft-typography-title-font-size",J.fontSize,"20px"),et=e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",J.fontWeight,"normal"),it=e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",J.letterSpacing,"0.15px"),ot=e.FtCssVariableFactory.extend("--ft-typography-title-line-height",J.lineHeight,"1.2"),st=e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",J.textTransform,"inherit"),nt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",X),lt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",J.fontSize,"14px"),rt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",J.fontWeight,"normal"),at=e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",J.letterSpacing,"0.105px"),pt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",J.lineHeight,"1.7"),dt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",J.textTransform,"inherit"),ft=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",Y),ht=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",J.fontSize,"16px"),ct=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",J.fontWeight,"600"),ut=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",J.letterSpacing,"0.144px"),xt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",J.lineHeight,"1.5"),bt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",J.textTransform,"inherit"),gt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",Y),vt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",J.fontSize,"14px"),yt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",J.fontWeight,"normal"),$t=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",J.letterSpacing,"0.098px"),mt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",J.lineHeight,"1.7"),wt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",J.textTransform,"inherit"),kt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",Y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",J.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",J.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",J.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",J.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",J.textTransform,"inherit")},St=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",Y),zt=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",J.fontSize,"14px"),Ot=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",J.fontWeight,"normal"),Et=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",J.letterSpacing,"0.252px"),Ct=e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",J.lineHeight,"1.4"),It=e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",J.textTransform,"inherit"),Bt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",Y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",J.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",J.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",J.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",J.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",J.textTransform,"inherit")},Dt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",Y),jt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",J.fontSize,"10px"),Nt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",J.fontWeight,"normal"),Zt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",J.letterSpacing,"0.33px"),Ft=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",J.lineHeight,"1.6"),At=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",J.textTransform,"inherit"),Mt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",Y),Rt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",J.fontSize,"10px"),Tt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",J.fontWeight,"normal"),_t=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",J.letterSpacing,"1.5px"),Ut=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",J.lineHeight,"1.6"),Pt=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",J.textTransform,"uppercase"),Ht={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",Y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",J.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",J.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",J.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",J.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",J.textTransform,"uppercase")},Vt=i.css`
|
|
14
14
|
.ft-typography--title {
|
|
15
15
|
font-family: ${Q};
|
|
16
16
|
font-size: ${tt};
|
|
@@ -21,8 +21,8 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
21
21
|
}
|
|
22
22
|
`,Wt=i.css`
|
|
23
23
|
.ft-typography--title-dense {
|
|
24
|
-
font-family: ${
|
|
25
|
-
font-size: ${
|
|
24
|
+
font-family: ${nt};
|
|
25
|
+
font-size: ${lt};
|
|
26
26
|
font-weight: ${rt};
|
|
27
27
|
letter-spacing: ${at};
|
|
28
28
|
line-height: ${pt};
|
|
@@ -85,9 +85,9 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
85
85
|
}
|
|
86
86
|
`,Jt=i.css`
|
|
87
87
|
.ft-typography--overline {
|
|
88
|
-
font-family: ${
|
|
89
|
-
font-size: ${
|
|
90
|
-
font-weight: ${
|
|
88
|
+
font-family: ${Mt};
|
|
89
|
+
font-size: ${Rt};
|
|
90
|
+
font-weight: ${Tt};
|
|
91
91
|
letter-spacing: ${_t};
|
|
92
92
|
line-height: ${Ut};
|
|
93
93
|
text-transform: ${Pt};
|
|
@@ -105,7 +105,7 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
105
105
|
.ft-typography {
|
|
106
106
|
vertical-align: inherit;
|
|
107
107
|
}
|
|
108
|
-
`;var ee=function(t,e,i,o){for(var s,
|
|
108
|
+
`;var ee=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class ie extends e.FtLitElement{constructor(){super(...arguments),this.variant=q.body1}render(){return this.element?G`
|
|
109
109
|
<${K(this.element)}
|
|
110
110
|
class="ft-typography ft-typography--${this.variant}">
|
|
111
111
|
<slot></slot>
|
|
@@ -234,8 +234,8 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)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
|
|
238
|
-
<div class="${
|
|
237
|
+
`;var ne=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class le 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="${l.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 V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
243
243
|
</div>
|
|
244
244
|
`:null}
|
|
245
245
|
</div>
|
|
246
|
-
`}}
|
|
246
|
+
`}}le.elementDefinitions={},le.styles=[Xt,se],ne([o.property({type:String})],le.prototype,"text",void 0),ne([o.property({type:Boolean})],le.prototype,"raised",void 0),ne([o.property({type:Boolean})],le.prototype,"outlined",void 0),ne([o.property({type:Boolean})],le.prototype,"disabled",void 0),ne([o.property({type:Boolean})],le.prototype,"error",void 0),e.customElement("ft-input-label")(le);const re=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),ae={color:re,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",re),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"),borderRadius:e.FtCssVariableFactory.create("--ft-ripple-border-radius","SIZE","0px")},pe=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),de=pe,fe=e.FtCssVariableFactory.extend("--ft-ripple-background-color",pe),he=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),ce=he,ue=e.FtCssVariableFactory.extend("--ft-ripple-background-color",he),xe=i.css`
|
|
247
247
|
:host {
|
|
248
248
|
display: contents;
|
|
249
249
|
}
|
|
@@ -333,7 +333,7 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
333
333
|
opacity: ${ae.opacityContentOnSurfacePressed};
|
|
334
334
|
transform: translate(-50%, -50%) scale(1);
|
|
335
335
|
}
|
|
336
|
-
`;var be,ge,ve=function(t,e,i,o){for(var s,
|
|
336
|
+
`;var be,ge,ve=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class ye 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),n=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-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=this.isFocusVisible(null==t?void 0:t.target)&&!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`
|
|
337
337
|
<style>
|
|
338
338
|
.ft-ripple .ft-ripple--effect,
|
|
339
339
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -346,7 +346,7 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
346
346
|
top: ${this.originY}px;
|
|
347
347
|
}
|
|
348
348
|
</style>
|
|
349
|
-
<div class="${
|
|
349
|
+
<div class="${l.classMap(t)}">
|
|
350
350
|
<div class="ft-ripple--background"></div>
|
|
351
351
|
<div class="ft-ripple--effect"></div>
|
|
352
352
|
</div>
|
|
@@ -398,9 +398,9 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
398
398
|
.ft-icon--material {
|
|
399
399
|
font-family: ${$e.materialFontFamily}, "Material Icons", sans-serif;
|
|
400
400
|
}
|
|
401
|
-
`;var we;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(we||(we={}));var ke=function(t,e,i,o){for(var s,
|
|
401
|
+
`;var we;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(we||(we={}));var ke=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class Se extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=i.nothing}render(){const t=this.variant&&Object.values(we).includes(this.variant)?this.variant:we.fluid_topics,e=t!==we.material||!!this.value;return i.html`
|
|
402
402
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
403
|
-
${
|
|
403
|
+
${n.unsafeHTML(this.resolvedIcon)}
|
|
404
404
|
<slot ?hidden=${e}></slot>
|
|
405
405
|
</i>
|
|
406
406
|
`}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 we.file_format:this.resolvedIcon=null!==(t=ge[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case we.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=be[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Se.elementDefinitions={},Se.styles=me,ke([o.property()],Se.prototype,"variant",void 0),ke([o.property()],Se.prototype,"value",void 0),ke([o.state()],Se.prototype,"resolvedIcon",void 0),ke([o.query("slot")],Se.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Se);const ze={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")},Oe=i.css`
|
|
@@ -552,8 +552,8 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
552
552
|
.ft-select--in-error .ft-select--helper-text {
|
|
553
553
|
color: ${ze.colorError};
|
|
554
554
|
}
|
|
555
|
-
`;var Ee=function(t,e,i,o){for(var s,
|
|
556
|
-
<div class="${
|
|
555
|
+
`;var Ee=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class Ce 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}))}}Ce.elementDefinitions={},Ee([o.property({type:String})],Ce.prototype,"label",void 0),Ee([o.property({type:Object,converter:t=>t})],Ce.prototype,"value",void 0),Ee([o.property({type:Boolean,reflect:!0})],Ce.prototype,"selected",void 0);class Ie 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,n,r;let a=this.hasOptionsMenuOpen,p=this.disabled||!this.hasOptions;const d=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,f={"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":d,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return i.html`
|
|
556
|
+
<div class="${l.classMap(f)}" part="container">
|
|
557
557
|
<div class="ft-select--main-panel" part="main-panel">
|
|
558
558
|
<ft-input-label text="${this.label}"
|
|
559
559
|
part="label"
|
|
@@ -572,7 +572,7 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
572
572
|
aria-expanded="${a}">
|
|
573
573
|
<ft-ripple ?disabled=${p} ?activated=${!this.outlined}></ft-ripple>
|
|
574
574
|
<ft-typography variant="body1" class="ft-select--selected-option">
|
|
575
|
-
${null!==(r=null===(
|
|
575
|
+
${null!==(r=null===(n=this.selectedOption)||void 0===n?void 0:n.label)&&void 0!==r?r:""}
|
|
576
576
|
</ft-typography>
|
|
577
577
|
<ft-icon>${a?"thin_arrow_up":"thin_arrow"}</ft-icon>
|
|
578
578
|
</div>
|
|
@@ -591,7 +591,7 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
591
591
|
@option-change=${this.updateOptionsFromSlot}
|
|
592
592
|
></slot>
|
|
593
593
|
`}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`
|
|
594
|
-
<div class="${
|
|
594
|
+
<div class="${l.classMap(o)}"
|
|
595
595
|
part="option"
|
|
596
596
|
tabindex="0"
|
|
597
597
|
data-value="${t.value}"
|
|
@@ -600,7 +600,7 @@ const V=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
600
600
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
601
601
|
<span>${t.label}</span>
|
|
602
602
|
</div>
|
|
603
|
-
`}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;super.contentAvailableCallback(t),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,
|
|
603
|
+
`}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;super.contentAvailableCallback(t),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,n;let l;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(),l=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(),l=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==l||l.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)}}Ie.elementDefinitions={"ft-input-label":le,"ft-typography":ie,"ft-ripple":ye,"ft-icon":Se},Ie.styles=[qt,Xt,Oe],Ee([o.property({type:String})],Ie.prototype,"label",void 0),Ee([o.property({type:String})],Ie.prototype,"helper",void 0),Ee([o.property({type:Boolean})],Ie.prototype,"outlined",void 0),Ee([o.property({type:Boolean})],Ie.prototype,"disabled",void 0),Ee([o.property({type:Boolean})],Ie.prototype,"error",void 0),Ee([o.property({type:Boolean})],Ie.prototype,"fixedMenuPosition",void 0),Ee([o.property({type:Array})],Ie.prototype,"options",void 0),Ee([o.state()],Ie.prototype,"selectedOption",void 0),Ee([o.state()],Ie.prototype,"optionsDisplayed",void 0),Ee([o.state()],Ie.prototype,"focusOptions",void 0),Ee([o.query(".ft-select")],Ie.prototype,"container",void 0),Ee([o.query(".ft-select--options")],Ie.prototype,"optionsMenu",void 0),Ee([o.query(".ft-select--input-panel")],Ie.prototype,"mainPanel",void 0),Ee([o.query(".ft-select--option:first-child")],Ie.prototype,"firstOption",void 0),Ee([o.query(".ft-select--option:focus")],Ie.prototype,"focusedOption",void 0),Ee([o.query(".ft-select--option.ft-select--option-selected")],Ie.prototype,"selectedOptionElement",void 0),Ee([o.query(".ft-select--option:last-child")],Ie.prototype,"lastOption",void 0),Ee([o.query("slot")],Ie.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Ie),e.customElement("ft-select-option")(Ce);
|
|
604
604
|
/**
|
|
605
605
|
* @license
|
|
606
606
|
* Copyright 2018 Google LLC
|
|
@@ -762,8 +762,8 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
762
762
|
.ft-text-field--with-password ft-icon:hover {
|
|
763
763
|
cursor: pointer;
|
|
764
764
|
}
|
|
765
|
-
`;var je=function(t,e,i,o){for(var s,
|
|
766
|
-
<div class="${
|
|
765
|
+
`;var je=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class Ne extends e.FtLitElement{constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=be.EYE_SLASH,this.passwordRevealedIcon=be.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){const e=this._value;this._value=t||"",this.requestUpdate("value",e)}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,"ft-text-field--with-password":this.password};return i.html`
|
|
766
|
+
<div class="${l.classMap(t)}">
|
|
767
767
|
<div class="ft-text-field--main-panel"
|
|
768
768
|
@keydown=${this.handleKeyboardNavigation}
|
|
769
769
|
@focusout=${this.onMainPanelBlur}>
|
|
@@ -813,7 +813,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
813
813
|
.variant=${this.iconVariant}
|
|
814
814
|
.value=${this.icon}
|
|
815
815
|
@click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
|
|
816
|
-
`:i.nothing}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}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),t.has("focused")&&!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)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}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,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}Ne.elementDefinitions={"ft-input-label":
|
|
816
|
+
`:i.nothing}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}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),t.has("focused")&&!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)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}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,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}Ne.elementDefinitions={"ft-input-label":le,"ft-ripple":ye,"ft-typography":ie,"ft-icon":Se},Ne.styles=[Gt,De],je([o.property()],Ne.prototype,"label",void 0),je([o.property({noAccessor:!0})],Ne.prototype,"value",null),je([o.state()],Ne.prototype,"dispatchedValue",void 0),je([o.property()],Ne.prototype,"helper",void 0),je([o.property({type:Boolean})],Ne.prototype,"outlined",void 0),je([o.property({type:Boolean})],Ne.prototype,"disabled",void 0),je([o.property({type:Boolean})],Ne.prototype,"error",void 0),je([o.property()],Ne.prototype,"prefix",void 0),je([o.property()],Ne.prototype,"icon",void 0),je([o.property()],Ne.prototype,"passwordHiddenIcon",void 0),je([o.property()],Ne.prototype,"passwordRevealedIcon",void 0),je([o.property()],Ne.prototype,"iconVariant",void 0),je([o.property({type:Boolean})],Ne.prototype,"filterSuggestions",void 0),je([o.property({type:Number})],Ne.prototype,"maxLength",void 0),je([o.property({type:Boolean})],Ne.prototype,"password",void 0),je([o.state()],Ne.prototype,"focused",void 0),je([o.state()],Ne.prototype,"hidePassword",void 0),je([o.state()],Ne.prototype,"suggestionsOnTop",void 0),je([o.state()],Ne.prototype,"hideSuggestions",void 0),je([o.state()],Ne.prototype,"visibleSuggestions",void 0),je([o.query(".ft-text-field--main-panel")],Ne.prototype,"mainPanel",void 0),je([o.query(".ft-text-field--input")],Ne.prototype,"input",void 0),je([o.query(".ft-text-field--suggestions")],Ne.prototype,"suggestionsContainer",void 0),je([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],Ne.prototype,"suggestions",void 0);const Ze=i.css`
|
|
817
817
|
.ft-text-field-suggestion {
|
|
818
818
|
position: relative;
|
|
819
819
|
padding: 8px 16px;
|
|
@@ -838,7 +838,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
838
838
|
slot {
|
|
839
839
|
pointer-events: none;
|
|
840
840
|
}
|
|
841
|
-
`;var Fe=function(t,e,i,o){for(var s,
|
|
841
|
+
`;var Fe=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class Ae extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class Me extends e.FtLitElement{render(){return i.html`
|
|
842
842
|
<div class="ft-text-field-suggestion"
|
|
843
843
|
tabindex="-1"
|
|
844
844
|
@keydown=${this.onKeyDown}
|
|
@@ -850,10 +850,9 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
850
850
|
<slot></slot>
|
|
851
851
|
</ft-typography>
|
|
852
852
|
</div>
|
|
853
|
-
`}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 Ae(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())}}
|
|
853
|
+
`}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 Ae(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())}}Me.elementDefinitions={"ft-ripple":ye,"ft-typography":ie,"ft-icon":Se},Me.styles=Ze,Fe([o.property()],Me.prototype,"value",void 0),Fe([o.query(".ft-text-field-suggestion")],Me.prototype,"container",void 0),Fe([o.queryAssignedNodes()],Me.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(Ne),e.customElement("ft-text-field-suggestion")(Me);const Re=e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Te=e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),_e=e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Ue=e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","100"),Pe=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),He=e.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Ve=i.css`
|
|
854
854
|
.ft-tooltip--container {
|
|
855
855
|
display: block;
|
|
856
|
-
position: relative;
|
|
857
856
|
}
|
|
858
857
|
|
|
859
858
|
.ft-tooltip--inline {
|
|
@@ -868,7 +867,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
868
867
|
width: max-content;
|
|
869
868
|
max-width: ${He};
|
|
870
869
|
text-align: center;
|
|
871
|
-
padding: ${
|
|
870
|
+
padding: ${Re};
|
|
872
871
|
z-index: ${Ue};
|
|
873
872
|
}
|
|
874
873
|
|
|
@@ -876,13 +875,11 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
876
875
|
padding: 4px 8px;
|
|
877
876
|
border-radius: ${Pe};
|
|
878
877
|
background-color: ${_e};
|
|
879
|
-
color: ${
|
|
880
|
-
top: -500px;
|
|
881
|
-
left: -500px;
|
|
878
|
+
color: ${Te};
|
|
882
879
|
position: relative;
|
|
883
880
|
word-break: break-word;
|
|
884
881
|
}
|
|
885
|
-
`;var We=function(t,e,i,o){for(var s,
|
|
882
|
+
`;var We=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class Ke 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`
|
|
886
883
|
<div part="container"
|
|
887
884
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
888
885
|
@mouseenter=${this.onHover}
|
|
@@ -900,7 +897,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
900
897
|
</div>
|
|
901
898
|
</div>
|
|
902
899
|
</div>
|
|
903
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.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=
|
|
900
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.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=this.tooltip.offsetWidth,i=this.tooltip.offsetHeight,o=(t.offsetHeight-i)/2,s=(t.offsetWidth-e)/2;let n=0,l=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":l=t.offsetTop-i-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"bottom":l=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"left":l=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft-e-this.tooltip.offsetLeft;break;case"right":l=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const r=this.tooltip.style;r.left=n+"px",r.top=l+"px";const a=this.tooltip.getBoundingClientRect();let p=-a.x,d=a.x+a.width-window.innerWidth;r.left=n+Math.round(this.correctOutOfWindowPixels(p,d))+"px";let f=-a.y,h=a.y+a.height-window.innerHeight;r.top=l+Math.round(this.correctOutOfWindowPixels(f,h))+"px",r.maxWidth=`max(${t.offsetWidth}px, ${He})`}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())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}Ke.elementDefinitions={"ft-typography":ie},Ke.styles=Ve,We([o.property()],Ke.prototype,"text",void 0),We([o.property({type:Boolean})],Ke.prototype,"manual",void 0),We([o.property({type:Boolean})],Ke.prototype,"inline",void 0),We([o.property({type:Number})],Ke.prototype,"delay",void 0),We([o.property()],Ke.prototype,"position",void 0),We([o.queryAssignedNodes("",!0)],Ke.prototype,"slotNodes",void 0),We([o.query(".ft-tooltip--container")],Ke.prototype,"container",void 0),We([o.query(".ft-tooltip")],Ke.prototype,"tooltip",void 0),We([o.query(".ft-tooltip--content")],Ke.prototype,"tooltipContent",void 0),We([o.state()],Ke.prototype,"visible",void 0),e.customElement("ft-tooltip")(Ke);const Le={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},Ge=i.css`
|
|
904
901
|
:host {
|
|
905
902
|
line-height: 0;
|
|
906
903
|
}
|
|
@@ -1113,9 +1110,9 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1113
1110
|
${e.setVariable(Le.size,Ye.iconSize)};
|
|
1114
1111
|
${e.setVariable(Le.color,"var(--ft-button-internal-color)")};
|
|
1115
1112
|
}
|
|
1116
|
-
`,e.noTextSelect];var
|
|
1113
|
+
`,e.noTextSelect];var ni=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};class li 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.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`
|
|
1117
1114
|
<button part="button"
|
|
1118
|
-
class="${
|
|
1115
|
+
class="${l.classMap(t)}"
|
|
1119
1116
|
aria-label="${this.getLabel()}"
|
|
1120
1117
|
?disabled=${this.isDisabled()}>
|
|
1121
1118
|
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
@@ -1136,7 +1133,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1136
1133
|
</ft-tooltip>
|
|
1137
1134
|
`:t}resolveIcon(){return this.loading?i.html`
|
|
1138
1135
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
1139
|
-
<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}}
|
|
1136
|
+
<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}}li.elementDefinitions={"ft-ripple":ye,"ft-tooltip":Ke,"ft-typography":ie,"ft-icon":Se,"ft-loader":qe},li.styles=[e.safariEllipsisFix,si],ni([o.property({type:String,reflect:!0})],li.prototype,"role",void 0),ni([o.property({type:Boolean})],li.prototype,"primary",void 0),ni([o.property({type:Boolean})],li.prototype,"outlined",void 0),ni([o.property({type:Boolean})],li.prototype,"disabled",void 0),ni([o.property({type:Boolean})],li.prototype,"dense",void 0),ni([o.property({type:Boolean})],li.prototype,"round",void 0),ni([o.property()],li.prototype,"label",void 0),ni([o.property()],li.prototype,"icon",void 0),ni([o.property()],li.prototype,"iconVariant",void 0),ni([o.property({type:Boolean})],li.prototype,"trailingIcon",void 0),ni([o.property({type:Boolean})],li.prototype,"loading",void 0),ni([o.property()],li.prototype,"tooltipPosition",void 0),ni([o.property({type:Boolean})],li.prototype,"hideTooltip",void 0),ni([o.property({type:Boolean})],li.prototype,"forceTooltip",void 0),ni([o.query(".ft-button")],li.prototype,"button",void 0),ni([o.query(".ft-button--label slot")],li.prototype,"slottedContent",void 0),e.customElement("ft-button")(li);class ri extends CustomEvent{constructor(t){super("row-click",{detail:t})}}const ai={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")},pi=i.css`
|
|
1140
1137
|
:host {
|
|
1141
1138
|
display: block;
|
|
1142
1139
|
}
|
|
@@ -1246,7 +1243,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1246
1243
|
.hidden {
|
|
1247
1244
|
visibility: hidden;
|
|
1248
1245
|
}
|
|
1249
|
-
`;var di=function(t,e,i,o){for(var s,
|
|
1246
|
+
`;var di=function(t,e,i,o){for(var s,n=arguments.length,l=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,r=t.length-1;r>=0;r--)(s=t[r])&&(l=(n<3?s(l):n>3?s(e,i,l):s(e,i))||l);return n>3&&l&&Object.defineProperty(e,i,l),l};const fi=t=>i.html`${t}`,hi=(t,e)=>t-e;class ci 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`
|
|
1250
1247
|
<style>
|
|
1251
1248
|
.table {
|
|
1252
1249
|
grid-template-columns: repeat(${this.columns.length}, minmax(min-content, auto));
|
|
@@ -1264,7 +1261,7 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1264
1261
|
`))}
|
|
1265
1262
|
</div>
|
|
1266
1263
|
`}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:hi,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`
|
|
1267
|
-
<div class="${
|
|
1264
|
+
<div class="${l.classMap(o)}"
|
|
1268
1265
|
part="${this.columnPart("header-cell",e)}">
|
|
1269
1266
|
<div class="column-title-container">
|
|
1270
1267
|
<span class="column-title"
|
|
@@ -1275,29 +1272,29 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1275
1272
|
</div>
|
|
1276
1273
|
${this.renderColumnFilter(t,e)}
|
|
1277
1274
|
</div>
|
|
1278
|
-
`}renderColumnSort(t,e){var o;const s=this.currentSort&&this.currentSort.column===e,
|
|
1275
|
+
`}renderColumnSort(t,e){var o;const s=this.currentSort&&this.currentSort.column===e,n=s?"asc"===this.currentSort.order?"expand_more":"expand_less":"unfold_more";return i.html`
|
|
1279
1276
|
<ft-button
|
|
1280
1277
|
round
|
|
1281
1278
|
dense
|
|
1282
1279
|
class="${null===(o=t.sortable)||void 0===o||o?"":"hidden"}"
|
|
1283
1280
|
iconVariant="material"
|
|
1284
|
-
icon="${
|
|
1281
|
+
icon="${n}"
|
|
1285
1282
|
label="Sort ${t.title}"
|
|
1286
1283
|
@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"}}}
|
|
1287
1284
|
part="${this.columnPart("sort-button",e)}"
|
|
1288
1285
|
></ft-button>
|
|
1289
|
-
`}renderColumnFilter(t,e){var o,s;const
|
|
1286
|
+
`}renderColumnFilter(t,e){var o,s;const n=t=>{this.filters[e]={value:t.detail},this.requestUpdate()};switch(null!==(o=t.filter)&&void 0!==o?o:"text"){case"text":return i.html`
|
|
1290
1287
|
<div class="column-filter" part="${this.columnPart("filter-container",e)}">
|
|
1291
1288
|
<ft-text-field
|
|
1292
1289
|
label="Search ${t.title}"
|
|
1293
|
-
@live-change="${
|
|
1290
|
+
@live-change="${n}"
|
|
1294
1291
|
part="${this.columnPart("filter",e)}"
|
|
1295
1292
|
></ft-text-field>
|
|
1296
1293
|
</div>
|
|
1297
1294
|
`;case"select":const o=null!==(s=this.selectData[e])&&void 0!==s?s:[];return o.length?i.html`
|
|
1298
1295
|
<div class="column-filter" part="${this.columnPart("filter-container",e)}">
|
|
1299
1296
|
<ft-select label="Filter ${t.title}"
|
|
1300
|
-
@change=${
|
|
1297
|
+
@change=${n}
|
|
1301
1298
|
part="${this.columnPart("filter",e)}">
|
|
1302
1299
|
<ft-select-option></ft-select-option>
|
|
1303
1300
|
${o.map((t=>i.html`
|
|
@@ -1305,9 +1302,9 @@ const Be={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","SI
|
|
|
1305
1302
|
`))}
|
|
1306
1303
|
</ft-select>
|
|
1307
1304
|
</div>
|
|
1308
|
-
`:i.nothing}return i.nothing}columnPart(t,e){return`${t} ${t}-column-${e}`}renderCell(t,e,o,s){var
|
|
1305
|
+
`:i.nothing}return i.nothing}columnPart(t,e){return`${t} ${t}-column-${e}`}renderCell(t,e,o,s){var l;const r=null!==(l=t.render)&&void 0!==l?l:fi;return i.html`
|
|
1309
1306
|
<div class="cell"
|
|
1310
1307
|
part="${this.columnPart("cell",e)} cell-row-${s} cell-column-${e}-row-${s}">
|
|
1311
|
-
${(t=>{const e=r(t,s);return"string"==typeof e?
|
|
1308
|
+
${(t=>{const e=r(t,s);return"string"==typeof e?n.unsafeHTML(e):e})(this.getValue(t,o))}
|
|
1312
1309
|
</div>
|
|
1313
1310
|
`}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)}}ci.styles=pi,di([o.property({attribute:!1})],ci.prototype,"data",void 0),di([o.property({attribute:!1})],ci.prototype,"columns",void 0),di([o.property({attribute:!1})],ci.prototype,"sort",void 0),di([o.property()],ci.prototype,"stickyHeaders",void 0),di([o.state()],ci.prototype,"currentSort",void 0),e.customElement("ft-filterable-table")(ci),t.FtFilterableTable=ci,t.FtFilterableTableCssVariables=ai,t.RowClickEvent=ri,t.styles=pi}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap);
|
|
@@ -965,10 +965,9 @@ const Ii={fontSize:mt.create("--ft-text-field-font-size","SIZE","14px"),labelSiz
|
|
|
965
965
|
<slot></slot>
|
|
966
966
|
</ft-typography>
|
|
967
967
|
</div>
|
|
968
|
-
`}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 Zi(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())}}Hi.elementDefinitions={"ft-ripple":Ei,"ft-typography":ci,"ft-icon":Mi},Hi.styles=Ti,_i([o()],Hi.prototype,"value",void 0),_i([r(".ft-text-field-suggestion")],Hi.prototype,"container",void 0),_i([d()],Hi.prototype,"assignedNodes",void 0),h("ft-text-field")(Li),h("ft-text-field-suggestion")(Hi);const Wi=mt.create("--ft-tooltip-distance","SIZE","4px"),Ki=mt.create("--ft-tooltip-color","COLOR","#FFFFFF"),Vi=mt.create("--ft-tooltip-background-color","COLOR","#666666"),Ji=mt.create("--ft-tooltip-z-index","NUMBER","
|
|
968
|
+
`}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 Zi(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())}}Hi.elementDefinitions={"ft-ripple":Ei,"ft-typography":ci,"ft-icon":Mi},Hi.styles=Ti,_i([o()],Hi.prototype,"value",void 0),_i([r(".ft-text-field-suggestion")],Hi.prototype,"container",void 0),_i([d()],Hi.prototype,"assignedNodes",void 0),h("ft-text-field")(Li),h("ft-text-field-suggestion")(Hi);const Wi=mt.create("--ft-tooltip-distance","SIZE","4px"),Ki=mt.create("--ft-tooltip-color","COLOR","#FFFFFF"),Vi=mt.create("--ft-tooltip-background-color","COLOR","#666666"),Ji=mt.create("--ft-tooltip-z-index","NUMBER","100"),qi=mt.external(wt.borderRadiusS,"Design system"),Xi=mt.create("--ft-tooltip-max-width","SIZE","150px"),Yi=y`
|
|
969
969
|
.ft-tooltip--container {
|
|
970
970
|
display: block;
|
|
971
|
-
position: relative;
|
|
972
971
|
}
|
|
973
972
|
|
|
974
973
|
.ft-tooltip--inline {
|
|
@@ -992,8 +991,6 @@ const Ii={fontSize:mt.create("--ft-text-field-font-size","SIZE","14px"),labelSiz
|
|
|
992
991
|
border-radius: ${qi};
|
|
993
992
|
background-color: ${Vi};
|
|
994
993
|
color: ${Ki};
|
|
995
|
-
top: -500px;
|
|
996
|
-
left: -500px;
|
|
997
994
|
position: relative;
|
|
998
995
|
word-break: break-word;
|
|
999
996
|
}
|
|
@@ -1015,7 +1012,7 @@ const Ii={fontSize:mt.create("--ft-text-field-font-size","SIZE","14px"),labelSiz
|
|
|
1015
1012
|
</div>
|
|
1016
1013
|
</div>
|
|
1017
1014
|
</div>
|
|
1018
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.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=
|
|
1015
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.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=this.tooltip.offsetWidth,i=this.tooltip.offsetHeight,o=(t.offsetHeight-i)/2,s=(t.offsetWidth-e)/2;let n=0,r=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":r=t.offsetTop-i-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"bottom":r=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"left":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft-e-this.tooltip.offsetLeft;break;case"right":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const l=this.tooltip.style;l.left=n+"px",l.top=r+"px";const a=this.tooltip.getBoundingClientRect();let c=-a.x,d=a.x+a.width-window.innerWidth;l.left=n+Math.round(this.correctOutOfWindowPixels(c,d))+"px";let p=-a.y,h=a.y+a.height-window.innerHeight;l.top=r+Math.round(this.correctOutOfWindowPixels(p,h))+"px",l.maxWidth=`max(${t.offsetWidth}px, ${Xi})`}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())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}Qi.elementDefinitions={"ft-typography":ci},Qi.styles=Yi,Gi([o()],Qi.prototype,"text",void 0),Gi([o({type:Boolean})],Qi.prototype,"manual",void 0),Gi([o({type:Boolean})],Qi.prototype,"inline",void 0),Gi([o({type:Number})],Qi.prototype,"delay",void 0),Gi([o()],Qi.prototype,"position",void 0),Gi([d("",!0)],Qi.prototype,"slotNodes",void 0),Gi([r(".ft-tooltip--container")],Qi.prototype,"container",void 0),Gi([r(".ft-tooltip")],Qi.prototype,"tooltip",void 0),Gi([r(".ft-tooltip--content")],Qi.prototype,"tooltipContent",void 0),Gi([s()],Qi.prototype,"visible",void 0),h("ft-tooltip")(Qi);const to={color:mt.extend("--ft-loader-color",wt.colorPrimary),size:mt.create("--ft-loader-size","SIZE","80px")},eo=y`
|
|
1019
1016
|
:host {
|
|
1020
1017
|
line-height: 0;
|
|
1021
1018
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-filterable-table",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"description": "A dynamic table with filters",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@fluid-topics/ft-button": "1.0.
|
|
26
|
-
"@fluid-topics/ft-select": "1.0.
|
|
27
|
-
"@fluid-topics/ft-text-field": "1.0.
|
|
28
|
-
"@fluid-topics/ft-wc-utils": "1.0.
|
|
25
|
+
"@fluid-topics/ft-button": "1.0.53",
|
|
26
|
+
"@fluid-topics/ft-select": "1.0.53",
|
|
27
|
+
"@fluid-topics/ft-text-field": "1.0.53",
|
|
28
|
+
"@fluid-topics/ft-wc-utils": "1.0.53",
|
|
29
29
|
"lit": "2.7.2"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "adfef35652b764d792d22aeef90c706676636803"
|
|
32
32
|
}
|