@fluid-topics/ft-search-facet 0.3.62
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/README.md +21 -0
- package/build/SearchFacetMessages.d.ts +10 -0
- package/build/SearchFacetMessages.js +3 -0
- package/build/converter.d.ts +4 -0
- package/build/converter.js +12 -0
- package/build/ft-search-facet.css.d.ts +3 -0
- package/build/ft-search-facet.css.js +6 -0
- package/build/ft-search-facet.d.ts +20 -0
- package/build/ft-search-facet.js +93 -0
- package/build/ft-search-facet.light.js +1249 -0
- package/build/ft-search-facet.min.js +1380 -0
- package/build/ft-search-facet.properties.d.ts +5 -0
- package/build/ft-search-facet.properties.js +2 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +7 -0
- package/package.json +36 -0
|
@@ -0,0 +1,1249 @@
|
|
|
1
|
+
!function(t,i,e,o,s,n,r){const l=e.css`
|
|
2
|
+
`
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2017 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/;var a;const h=window,p=h.trustedTypes,c=p?p.createPolicy("lit-html",{createHTML:t=>t}):void 0,f=`lit$${(Math.random()+"").slice(9)}$`,d="?"+f,u=`<${d}>`,v=document,b=(t="")=>v.createComment(t),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,$=/>/g,w=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),k=/'/g,S=/"/g,z=/^(?:script|style|textarea|title)$/i,O=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),C=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),B=new WeakMap,I=v.createTreeWalker(v,129,null,!1),M=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=y;for(let i=0;i<e;i++){const e=t[i];let l,a,h=-1,p=0;for(;p<e.length&&(r.lastIndex=p,a=r.exec(e),null!==a);)p=r.lastIndex,r===y?"!--"===a[1]?r=m:void 0!==a[1]?r=$:void 0!==a[2]?(z.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=w):void 0!==a[3]&&(r=w):r===w?">"===a[0]?(r=null!=s?s:y,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?w:'"'===a[3]?S:k):r===S||r===k?r=w:r===m||r===$?r=y:(r=w,s=void 0);const c=r===w&&t[i+1].startsWith("/>")?" ":"";n+=r===y?e+u:h>=0?(o.push(l),e.slice(0,h)+"$lit$"+e.slice(h)+f+c):e+f+(-2===h?(o.push(void 0),i):c)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==c?c.createHTML(l):l,o]};class E{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[a,h]=M(t,i);if(this.el=E.createElement(a,e),I.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=I.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(f)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(f),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?D:"?"===i[1]?F:"@"===i[1]?_:T})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(z.test(o.tagName)){const t=o.textContent.split(f),i=t.length-1;if(i>0){o.textContent=p?p.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],b()),I.nextNode(),l.push({type:2,index:++s});o.append(t[i],b())}}}else if(8===o.nodeType)if(o.data===d)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(f,t+1));)l.push({type:7,index:s}),t+=f.length-1}s++}}static createElement(t,i){const e=v.createElement("template");return e.innerHTML=t,e}}function L(t,i,e=t,o){var s,n,r,l;if(i===C)return i;let a=void 0!==o?null===(s=e._$Co)||void 0===s?void 0:s[o]:e._$Cl;const h=g(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Co)&&void 0!==r?r:l._$Co=[])[o]=a:e._$Cl=a),void 0!==a&&(i=L(t,a._$AS(t,i.values),a,o)),i}class N{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:v).importNode(e,!0);I.currentNode=s;let n=I.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let i;2===a.type?i=new A(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new R(n,this,t)),this.u.push(i),a=o[++l]}r!==(null==a?void 0:a.index)&&(n=I.nextNode(),r++)}return s}p(t){let i=0;for(const e of this.u)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class A{constructor(t,i,e,o){var s;this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cm=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=L(this,t,i),g(t)?t===j||null==t||""===t?(this._$AH!==j&&this._$AR(),this._$AH=j):t!==this._$AH&&t!==C&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>x(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==j&&g(this._$AH)?this._$AA.nextSibling.data=t:this.T(v.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=E.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.p(e);else{const t=new N(s,this),i=t.v(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let i=B.get(t.strings);return void 0===i&&B.set(t.strings,i=new E(t)),i}k(t){x(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new A(this.O(b()),this.O(b()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class T{constructor(t,i,e,o,s){this.type=1,this._$AH=j,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=j}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=L(this,t,i,0),n=!g(t)||t!==this._$AH&&t!==C,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=L(this,o[e+r],i,r),l===C&&(l=this._$AH[r]),n||(n=!g(l)||l!==this._$AH[r]),l===j?t=j:t!==j&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.j(t)}j(t){t===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class D extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===j?void 0:t}}const U=p?p.emptyScript:"";class F extends T{constructor(){super(...arguments),this.type=4}j(t){t&&t!==j?this.element.setAttribute(this.name,U):this.element.removeAttribute(this.name)}}class _ extends T{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=L(this,t,i,0))&&void 0!==e?e:j)===C)return;const o=this._$AH,s=t===j&&o!==j||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==j&&(o===j||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class R{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){L(this,t)}}const P=h.litHtmlPolyfillSupport;null==P||P(E,A),(null!==(a=h.litHtmlVersions)&&void 0!==a?a:h.litHtmlVersions=[]).push("2.4.0");
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2020 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/
|
|
13
|
+
const V=Symbol.for(""),H=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t._$litStatic$},W=t=>({_$litStatic$:t,r:V}),Z=new Map,K=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let a,h=0,p=!1;for(;h<o;){for(a=i[h];h<o&&void 0!==(n=e[h],s=H(n));)a+=s+i[++h],p=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(i[o]),p){const t=r.join("$$lit$$");void 0===(i=Z.get(t))&&(r.raw=r,Z.set(t,i=r)),e=l}return t(i,...e)})(O);var G;!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"}(G||(G={}));const q=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),X=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),Y={fontFamily:X,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},J=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",q),Q=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",Y.fontSize,"20px"),tt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",Y.fontWeight,"normal"),it=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",Y.letterSpacing,"0.15px"),et=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",Y.lineHeight,"1.2"),ot=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",Y.textTransform,"inherit"),st=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",q),nt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",Y.fontSize,"14px"),rt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",Y.fontWeight,"normal"),lt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",Y.letterSpacing,"0.105px"),at=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",Y.lineHeight,"1.7"),ht=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",Y.textTransform,"inherit"),pt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",X),ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",Y.fontSize,"16px"),ft=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",Y.fontWeight,"600"),dt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",Y.letterSpacing,"0.144px"),ut=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",Y.lineHeight,"1.5"),vt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",Y.textTransform,"inherit"),bt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",X),gt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",Y.fontSize,"14px"),xt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",Y.fontWeight,"normal"),yt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",Y.letterSpacing,"0.098px"),mt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",Y.lineHeight,"1.7"),$t=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",Y.textTransform,"inherit"),wt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",X),kt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",Y.fontSize,"16px"),St=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",Y.fontWeight,"normal"),zt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",Y.letterSpacing,"0.496px"),Ot=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",Y.lineHeight,"1.5"),Ct=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",Y.textTransform,"inherit"),jt={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",X),fontSize:i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",Y.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",Y.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",Y.letterSpacing,"0.252px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",Y.lineHeight,"1.4"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",Y.textTransform,"inherit")},Bt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",X),It=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",Y.fontSize,"12px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",Y.fontWeight,"normal"),Et=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",Y.letterSpacing,"0.396px"),Lt=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",Y.lineHeight,"1.33"),Nt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",Y.textTransform,"inherit"),At=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",X),Tt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",Y.fontSize,"10px"),Dt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",Y.fontWeight,"normal"),Ut=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",Y.letterSpacing,"0.33px"),Ft=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",Y.lineHeight,"1.6"),_t=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",Y.textTransform,"inherit"),Rt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",X),Pt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",Y.fontSize,"10px"),Vt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",Y.fontWeight,"normal"),Ht=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",Y.letterSpacing,"1.5px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",Y.lineHeight,"1.6"),Zt=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",Y.textTransform,"uppercase"),Kt={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",X),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",Y.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",Y.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",Y.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",Y.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",Y.textTransform,"uppercase")},Gt=e.css`
|
|
14
|
+
.ft-typography--title {
|
|
15
|
+
font-family: ${J};
|
|
16
|
+
font-size: ${Q};
|
|
17
|
+
font-weight: ${tt};
|
|
18
|
+
letter-spacing: ${it};
|
|
19
|
+
line-height: ${et};
|
|
20
|
+
text-transform: ${ot};
|
|
21
|
+
}
|
|
22
|
+
`,qt=e.css`
|
|
23
|
+
.ft-typography--title-dense {
|
|
24
|
+
font-family: ${st};
|
|
25
|
+
font-size: ${nt};
|
|
26
|
+
font-weight: ${rt};
|
|
27
|
+
letter-spacing: ${lt};
|
|
28
|
+
line-height: ${at};
|
|
29
|
+
text-transform: ${ht};
|
|
30
|
+
}
|
|
31
|
+
`,Xt=e.css`
|
|
32
|
+
.ft-typography--subtitle1 {
|
|
33
|
+
font-family: ${pt};
|
|
34
|
+
font-size: ${ct};
|
|
35
|
+
font-weight: ${ft};
|
|
36
|
+
letter-spacing: ${dt};
|
|
37
|
+
line-height: ${ut};
|
|
38
|
+
text-transform: ${vt};
|
|
39
|
+
}
|
|
40
|
+
`,Yt=e.css`
|
|
41
|
+
.ft-typography--subtitle2 {
|
|
42
|
+
font-family: ${bt};
|
|
43
|
+
font-size: ${gt};
|
|
44
|
+
font-weight: ${xt};
|
|
45
|
+
letter-spacing: ${yt};
|
|
46
|
+
line-height: ${mt};
|
|
47
|
+
text-transform: ${$t};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
`,Jt=e.css`
|
|
51
|
+
.ft-typography--body1 {
|
|
52
|
+
font-family: ${wt};
|
|
53
|
+
font-size: ${kt};
|
|
54
|
+
font-weight: ${St};
|
|
55
|
+
letter-spacing: ${zt};
|
|
56
|
+
line-height: ${Ot};
|
|
57
|
+
text-transform: ${Ct};
|
|
58
|
+
}
|
|
59
|
+
`,Qt=e.css`
|
|
60
|
+
.ft-typography--body2 {
|
|
61
|
+
font-family: ${jt.fontFamily};
|
|
62
|
+
font-size: ${jt.fontSize};
|
|
63
|
+
font-weight: ${jt.fontWeight};
|
|
64
|
+
letter-spacing: ${jt.letterSpacing};
|
|
65
|
+
line-height: ${jt.lineHeight};
|
|
66
|
+
text-transform: ${jt.textTransform};
|
|
67
|
+
}
|
|
68
|
+
`,ti=e.css`
|
|
69
|
+
.ft-typography--caption {
|
|
70
|
+
font-family: ${Bt};
|
|
71
|
+
font-size: ${It};
|
|
72
|
+
font-weight: ${Mt};
|
|
73
|
+
letter-spacing: ${Et};
|
|
74
|
+
line-height: ${Lt};
|
|
75
|
+
text-transform: ${Nt};
|
|
76
|
+
}
|
|
77
|
+
`,ii=e.css`
|
|
78
|
+
.ft-typography--breadcrumb {
|
|
79
|
+
font-family: ${At};
|
|
80
|
+
font-size: ${Tt};
|
|
81
|
+
font-weight: ${Dt};
|
|
82
|
+
letter-spacing: ${Ut};
|
|
83
|
+
line-height: ${Ft};
|
|
84
|
+
text-transform: ${_t};
|
|
85
|
+
}
|
|
86
|
+
`,ei=e.css`
|
|
87
|
+
.ft-typography--overline {
|
|
88
|
+
font-family: ${Rt};
|
|
89
|
+
font-size: ${Pt};
|
|
90
|
+
font-weight: ${Vt};
|
|
91
|
+
letter-spacing: ${Ht};
|
|
92
|
+
line-height: ${Wt};
|
|
93
|
+
text-transform: ${Zt};
|
|
94
|
+
}
|
|
95
|
+
`,oi=e.css`
|
|
96
|
+
.ft-typography--button {
|
|
97
|
+
font-family: ${Kt.fontFamily};
|
|
98
|
+
font-size: ${Kt.fontSize};
|
|
99
|
+
font-weight: ${Kt.fontWeight};
|
|
100
|
+
letter-spacing: ${Kt.letterSpacing};
|
|
101
|
+
line-height: ${Kt.lineHeight};
|
|
102
|
+
text-transform: ${Kt.textTransform};
|
|
103
|
+
}
|
|
104
|
+
`,si=e.css`
|
|
105
|
+
.ft-typography {
|
|
106
|
+
vertical-align: inherit;
|
|
107
|
+
}
|
|
108
|
+
`;var ni=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ri extends i.FtLitElement{constructor(){super(...arguments),this.variant=G.body1}render(){return this.element?K`
|
|
109
|
+
<${W(this.element)}
|
|
110
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
111
|
+
<slot></slot>
|
|
112
|
+
</${W(this.element)}>
|
|
113
|
+
`:K`
|
|
114
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
115
|
+
`}}function li(t,i){return t.flatMap((t=>[t,...li(i(t),i)]))}ri.styles=[Gt,qt,Xt,Yt,Jt,Qt,ti,ii,ei,oi,si],ni([o.property()],ri.prototype,"element",void 0),ni([o.property()],ri.prototype,"variant",void 0),i.customElement("ft-typography")(ri);const ai=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),hi={color:ai,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",ai),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},pi=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),ci=pi,fi=i.FtCssVariableFactory.extend("--ft-ripple-background-color",pi),di=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),ui=di,vi=i.FtCssVariableFactory.extend("--ft-ripple-background-color",di),bi=e.css`
|
|
116
|
+
:host {
|
|
117
|
+
display: contents;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ft-ripple {
|
|
121
|
+
position: absolute;
|
|
122
|
+
inset: 0;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ft-ripple .ft-ripple--background,
|
|
131
|
+
.ft-ripple .ft-ripple--effect {
|
|
132
|
+
position: absolute;
|
|
133
|
+
opacity: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ft-ripple .ft-ripple--background {
|
|
137
|
+
background-color: ${hi.backgroundColor};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ft-ripple .ft-ripple--effect {
|
|
141
|
+
background-color: ${hi.color};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
145
|
+
background-color: ${vi};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
149
|
+
background-color: ${ui};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
153
|
+
background-color: ${fi};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
157
|
+
background-color: ${ci};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ft-ripple .ft-ripple--background {
|
|
161
|
+
top: 0;
|
|
162
|
+
left: 0;
|
|
163
|
+
height: 100%;
|
|
164
|
+
width: 100%;
|
|
165
|
+
transition: opacity 75ms linear;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ft-ripple .ft-ripple--effect,
|
|
169
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
170
|
+
border-radius: 50%;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.ft-ripple .ft-ripple--effect {
|
|
174
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
175
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
179
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
180
|
+
left: 50%;
|
|
181
|
+
top: 50%;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
185
|
+
transform: translate(-50%, -50%);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
189
|
+
opacity: ${hi.opacityContentOnSurfaceHover};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
193
|
+
opacity: ${hi.opacityContentOnSurfaceSelected};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
197
|
+
opacity: ${hi.opacityContentOnSurfaceFocused};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
201
|
+
opacity: ${hi.opacityContentOnSurfacePressed};
|
|
202
|
+
transform: translate(-50%, -50%) scale(1);
|
|
203
|
+
}
|
|
204
|
+
`;var gi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class xi extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new i.Debouncer(10),this.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),n=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
205
|
+
<style>
|
|
206
|
+
.ft-ripple .ft-ripple--effect,
|
|
207
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
208
|
+
width: ${this.rippleSize}px;
|
|
209
|
+
height: ${this.rippleSize}px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.ft-ripple .ft-ripple--effect {
|
|
213
|
+
left: ${this.originX}px;
|
|
214
|
+
top: ${this.originY}px;
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
217
|
+
<div class="${n.classMap(t)}">
|
|
218
|
+
<div class="ft-ripple--background"></div>
|
|
219
|
+
<div class="ft-ripple--effect"></div>
|
|
220
|
+
</div>
|
|
221
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}))}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}xi.elementDefinitions={},xi.styles=bi,gi([o.property({type:Boolean})],xi.prototype,"primary",void 0),gi([o.property({type:Boolean})],xi.prototype,"secondary",void 0),gi([o.property({type:Boolean})],xi.prototype,"unbounded",void 0),gi([o.property({type:Boolean})],xi.prototype,"activated",void 0),gi([o.property({type:Boolean})],xi.prototype,"selected",void 0),gi([o.property({type:Boolean})],xi.prototype,"disabled",void 0),gi([o.state()],xi.prototype,"hovered",void 0),gi([o.state()],xi.prototype,"focused",void 0),gi([o.state()],xi.prototype,"pressed",void 0),gi([o.state()],xi.prototype,"rippling",void 0),gi([o.state()],xi.prototype,"rippleSize",void 0),gi([o.state()],xi.prototype,"originX",void 0),gi([o.state()],xi.prototype,"originY",void 0),gi([o.query(".ft-ripple")],xi.prototype,"ripple",void 0),gi([o.query(".ft-ripple--effect")],xi.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(xi);const yi=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),mi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),$i=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),wi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),ki=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),Si=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),zi=e.css`
|
|
222
|
+
.ft-tooltip--container {
|
|
223
|
+
display: block;
|
|
224
|
+
position: relative;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.ft-tooltip--inline {
|
|
228
|
+
display: inline-block;
|
|
229
|
+
max-width: 100%;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ft-tooltip {
|
|
233
|
+
position: absolute;
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
width: max-content;
|
|
237
|
+
max-width: ${Si};
|
|
238
|
+
text-align: center;
|
|
239
|
+
padding: ${yi};
|
|
240
|
+
z-index: ${wi};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.ft-tooltip--content {
|
|
244
|
+
padding: 4px 8px;
|
|
245
|
+
border-radius: ${ki};
|
|
246
|
+
background-color: ${$i};
|
|
247
|
+
color: ${mi};
|
|
248
|
+
top: -500px;
|
|
249
|
+
left: -500px;
|
|
250
|
+
position: relative;
|
|
251
|
+
word-break: break-word;
|
|
252
|
+
}
|
|
253
|
+
`;var Oi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ci extends i.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 i.Debouncer,this.revealDebouncer=new i.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
254
|
+
<div part="container"
|
|
255
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
256
|
+
@mouseenter=${this.onHover}
|
|
257
|
+
@mouseleave=${this.onOut}
|
|
258
|
+
@focusin=${this.onHover}
|
|
259
|
+
@focusout=${this.onOut}
|
|
260
|
+
@touchstart=${this.onTouch}>
|
|
261
|
+
<slot></slot>
|
|
262
|
+
<div part="tooltip" role="tooltip" inert
|
|
263
|
+
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
264
|
+
?hidden=${!this.visible}>
|
|
265
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
266
|
+
<slot name="text"></slot>
|
|
267
|
+
<ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&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 i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${Si})`}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())}}Ci.elementDefinitions={"ft-typography":ri},Ci.styles=zi,Oi([o.property()],Ci.prototype,"text",void 0),Oi([o.property({type:Boolean})],Ci.prototype,"manual",void 0),Oi([o.property({type:Boolean})],Ci.prototype,"inline",void 0),Oi([o.property({type:Number})],Ci.prototype,"delay",void 0),Oi([o.property()],Ci.prototype,"position",void 0),Oi([o.queryAssignedNodes("",!0)],Ci.prototype,"slotNodes",void 0),Oi([o.query(".ft-tooltip--container")],Ci.prototype,"container",void 0),Oi([o.query("slot")],Ci.prototype,"target",void 0),Oi([o.query(".ft-tooltip")],Ci.prototype,"tooltip",void 0),Oi([o.query(".ft-tooltip--content")],Ci.prototype,"tooltipContent",void 0),Oi([o.state()],Ci.prototype,"visible",void 0),i.customElement("ft-tooltip")(Ci);const ji={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},Bi=e.css`
|
|
272
|
+
:host {
|
|
273
|
+
line-height: 0;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ft-loader {
|
|
277
|
+
display: inline-block;
|
|
278
|
+
position: relative;
|
|
279
|
+
|
|
280
|
+
width: ${ji.size};
|
|
281
|
+
height: ${ji.size};
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.ft-loader div {
|
|
285
|
+
position: absolute;
|
|
286
|
+
top: 37.5%;
|
|
287
|
+
width: 25%;
|
|
288
|
+
height: 25%;
|
|
289
|
+
border-radius: 50%;
|
|
290
|
+
background: ${ji.color};
|
|
291
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.ft-loader div:nth-child(1) {
|
|
295
|
+
left: 2.5%;
|
|
296
|
+
animation: appear 0.6s infinite;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.ft-loader div:nth-child(2) {
|
|
300
|
+
left: 2.5%;
|
|
301
|
+
animation: move 0.6s infinite;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.ft-loader div:nth-child(3) {
|
|
305
|
+
left: 37.5%;
|
|
306
|
+
animation: move 0.6s infinite;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.ft-loader div:nth-child(4) {
|
|
310
|
+
left: 72.5%;
|
|
311
|
+
animation: disappear 0.6s infinite;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@keyframes appear {
|
|
315
|
+
0% {
|
|
316
|
+
transform: scale(0);
|
|
317
|
+
}
|
|
318
|
+
100% {
|
|
319
|
+
transform: scale(1);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
@keyframes disappear {
|
|
324
|
+
0% {
|
|
325
|
+
transform: scale(1);
|
|
326
|
+
}
|
|
327
|
+
100% {
|
|
328
|
+
transform: scale(0);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@keyframes move {
|
|
333
|
+
0% {
|
|
334
|
+
transform: translate(0, 0);
|
|
335
|
+
}
|
|
336
|
+
100% {
|
|
337
|
+
transform: translate(calc(0.35 * ${ji.size}), 0);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
`;class Ii extends i.FtLitElement{render(){return e.html`
|
|
341
|
+
<div class="ft-loader">
|
|
342
|
+
<div></div>
|
|
343
|
+
<div></div>
|
|
344
|
+
<div></div>
|
|
345
|
+
<div></div>
|
|
346
|
+
</div>
|
|
347
|
+
`}}var Mi,Ei;Ii.styles=Bi,i.customElement("ft-loader")(Ii),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(Mi||(Mi={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Ei||(Ei={})),new Map([...["abw"].map((t=>[t,Ei.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Ei.AUDIO])),...["avi"].map((t=>[t,Ei.AVI])),...["chm","xhs"].map((t=>[t,Ei.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Ei.CODE])),...["csv"].map((t=>[t,Ei.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ei.DITA])),...["epub"].map((t=>[t,Ei.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ei.EXCEL])),...["flac"].map((t=>[t,Ei.FLAC])),...["gif"].map((t=>[t,Ei.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ei.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ei.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Ei.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ei.JPEG])),...["json"].map((t=>[t,Ei.JSON])),...["m4a","m4p"].map((t=>[t,Ei.M4A])),...["mov","qt"].map((t=>[t,Ei.MOV])),...["mp3"].map((t=>[t,Ei.MP3])),...["mp4","m4v"].map((t=>[t,Ei.MP4])),...["ogg","oga"].map((t=>[t,Ei.OGG])),...["pdf","ps"].map((t=>[t,Ei.PDF])),...["png"].map((t=>[t,Ei.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ei.POWERPOINT])),...["rar"].map((t=>[t,Ei.RAR])),...["stp"].map((t=>[t,Ei.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ei.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Ei.VIDEO])),...["wav"].map((t=>[t,Ei.WAV])),...["wma"].map((t=>[t,Ei.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ei.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ei.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ei.YAML])),...["zip"].map((t=>[t,Ei.ZIP]))]);const Li={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Ni=e.css`
|
|
348
|
+
:host, i.ft-icon {
|
|
349
|
+
display: inline-flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
flex-shrink: 0;
|
|
352
|
+
flex-grow: 0;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
:host {
|
|
356
|
+
width: ${Li.size};
|
|
357
|
+
height: ${Li.size};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
i.ft-icon {
|
|
361
|
+
width: 100%;
|
|
362
|
+
height: 100%;
|
|
363
|
+
font-size: ${Li.size};
|
|
364
|
+
line-height: 1;
|
|
365
|
+
font-weight: normal;
|
|
366
|
+
text-transform: none;
|
|
367
|
+
font-style: normal;
|
|
368
|
+
font-variant: normal;
|
|
369
|
+
speak: none;
|
|
370
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
371
|
+
text-rendering: auto;
|
|
372
|
+
-webkit-font-smoothing: antialiased;
|
|
373
|
+
-moz-osx-font-smoothing: grayscale;
|
|
374
|
+
vertical-align: ${Li.verticalAlign};
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
i.ft-icon.ft-icon--fluid-topics {
|
|
378
|
+
font-family: ${Li.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
379
|
+
|
|
380
|
+
/* Ugly fix because font is broken */
|
|
381
|
+
font-size: calc(0.9 * ${Li.size});
|
|
382
|
+
position: relative;
|
|
383
|
+
top: -5%;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.ft-icon--file-format {
|
|
388
|
+
font-family: ${Li.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.ft-icon--material {
|
|
392
|
+
font-family: ${Li.materialFontFamily}, "Material Icons", sans-serif;
|
|
393
|
+
}
|
|
394
|
+
`;var Ai;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ai||(Ai={}));var Ti=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Di extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){var t;const i=null!==(t=this.variant)&&void 0!==t?t:Ai.fluid_topics,o="material"!==i||this.value;return e.html`
|
|
395
|
+
<i class="ft-icon ${"ft-icon--"+i}">
|
|
396
|
+
${r.unsafeHTML(this.resolvedIcon)}
|
|
397
|
+
<slot ?hidden=${o}></slot>
|
|
398
|
+
</i>
|
|
399
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case Ai.file_format:this.resolvedIcon=null!==(t=Ei[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Ai.material:this.resolvedIcon=this.value||e.nothing;break;default:this.resolvedIcon=null!==(i=Mi[o.replace("-","_").toUpperCase()])&&void 0!==i?i:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Di.elementDefinitions={},Di.styles=Ni,Ti([o.property()],Di.prototype,"variant",void 0),Ti([o.property()],Di.prototype,"value",void 0),Ti([o.state()],Di.prototype,"resolvedIcon",void 0),Ti([o.query("slot")],Di.prototype,"slottedContent",void 0),i.customElement("ft-icon")(Di);const Ui=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),Fi={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:Ui,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",Kt.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",Ui),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},_i=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),Ri={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:_i,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",_i)},Pi=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),Vi=[i.noTextSelect,e.css`
|
|
400
|
+
:host {
|
|
401
|
+
display: inline-block;
|
|
402
|
+
max-width: 100%;
|
|
403
|
+
pointer-events: none;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
button {
|
|
407
|
+
box-shadow: 0px 0px 0px transparent;
|
|
408
|
+
border: 0px solid transparent;
|
|
409
|
+
text-shadow: 0px 0px 0px transparent;
|
|
410
|
+
font-size: ${Fi.fontSize};
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
button:hover {
|
|
414
|
+
box-shadow: 0px 0px 0px transparent;
|
|
415
|
+
border: 0px solid transparent;
|
|
416
|
+
text-shadow: 0px 0px 0px transparent;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
button:active {
|
|
420
|
+
outline: none;
|
|
421
|
+
border: none;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
button:focus {
|
|
425
|
+
outline: 0;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.ft-button {
|
|
429
|
+
position: relative;
|
|
430
|
+
display: flex;
|
|
431
|
+
justify-content: center;
|
|
432
|
+
align-items: center;
|
|
433
|
+
width: 100%;
|
|
434
|
+
overflow: hidden;
|
|
435
|
+
box-sizing: border-box;
|
|
436
|
+
border: none;
|
|
437
|
+
pointer-events: auto;
|
|
438
|
+
|
|
439
|
+
--ft-button-internal-line-height: calc(${Fi.fontSize} + 2px);
|
|
440
|
+
--ft-button-internal-color: ${Fi.color};
|
|
441
|
+
${i.setVariable(Li.size,Fi.iconSize)};
|
|
442
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
443
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
444
|
+
${i.setVariable(hi.color,Fi.rippleColor)};
|
|
445
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Fi.iconSize});
|
|
446
|
+
|
|
447
|
+
border-radius: ${Fi.borderRadius};
|
|
448
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
449
|
+
background-color: ${Fi.backgroundColor};
|
|
450
|
+
color: var(--ft-button-internal-color);
|
|
451
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.ft-button:not([disabled]):hover {
|
|
455
|
+
cursor: pointer;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.ft-button--dense {
|
|
459
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
460
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
461
|
+
border-radius: ${Pi};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.ft-button--round {
|
|
465
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.ft-button[disabled] {
|
|
469
|
+
filter: grayscale(1);
|
|
470
|
+
opacity: ${Fi.opacityDisabled};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.ft-button.ft-button--primary {
|
|
474
|
+
background-color: ${Ri.backgroundColor};
|
|
475
|
+
--ft-button-internal-color: ${Ri.color};
|
|
476
|
+
${i.setVariable(hi.color,Ri.rippleColor)};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.ft-button.ft-button--outlined {
|
|
480
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
481
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.ft-button:focus {
|
|
485
|
+
outline: none;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.ft-button--label {
|
|
489
|
+
position: relative;
|
|
490
|
+
overflow: hidden;
|
|
491
|
+
white-space: nowrap;
|
|
492
|
+
text-overflow: ellipsis;
|
|
493
|
+
display: block;
|
|
494
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
495
|
+
${i.setVariable(Kt.fontSize,"1em")};
|
|
496
|
+
${i.setVariable(Kt.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.ft-button--label[hidden] {
|
|
500
|
+
display: none;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
ft-icon {
|
|
504
|
+
flex-shrink: 0;
|
|
505
|
+
position: relative;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.ft-button--label[hidden] + ft-icon {
|
|
509
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
510
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
514
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
515
|
+
order: -1;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
ft-loader {
|
|
519
|
+
${i.setVariable(ji.size,Fi.iconSize)};
|
|
520
|
+
${i.setVariable(ji.color,"var(--ft-button-internal-color)")};
|
|
521
|
+
}
|
|
522
|
+
`];var Hi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Wi extends i.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=Ai.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(e.html`
|
|
523
|
+
<button part="button"
|
|
524
|
+
class="${n.classMap(t)}"
|
|
525
|
+
aria-label="${this.getLabel()}"
|
|
526
|
+
?disabled=${this.isDisabled()}>
|
|
527
|
+
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
528
|
+
<ft-typography part="label"
|
|
529
|
+
variant="button"
|
|
530
|
+
element="span"
|
|
531
|
+
class="ft-button--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
532
|
+
?hidden=${!this.hasTextContent()}>
|
|
533
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
534
|
+
</ft-typography>
|
|
535
|
+
${this.resolveIcon()}
|
|
536
|
+
</button>
|
|
537
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
538
|
+
<ft-tooltip part="tooltip"
|
|
539
|
+
text="${this.getLabel()}"
|
|
540
|
+
position="${this.tooltipPosition}">
|
|
541
|
+
${t}
|
|
542
|
+
</ft-tooltip>
|
|
543
|
+
`:t}resolveIcon(){return this.loading?e.html`
|
|
544
|
+
<ft-loader></ft-loader> `:this.icon?e.html`
|
|
545
|
+
<ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:e.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}}Wi.elementDefinitions={"ft-ripple":xi,"ft-tooltip":Ci,"ft-typography":ri,"ft-icon":Di,"ft-loader":Ii},Wi.styles=[i.safariEllipsisFix,Vi],Hi([o.property({type:String,reflect:!0})],Wi.prototype,"role",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"primary",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"outlined",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"disabled",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"dense",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"round",void 0),Hi([o.property({type:String})],Wi.prototype,"label",void 0),Hi([o.property({type:String})],Wi.prototype,"icon",void 0),Hi([o.property({type:String})],Wi.prototype,"iconVariant",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"trailingIcon",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"loading",void 0),Hi([o.property({type:String})],Wi.prototype,"tooltipPosition",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"hideTooltip",void 0),Hi([o.property({type:Boolean})],Wi.prototype,"forceTooltip",void 0),Hi([o.query(".ft-button")],Wi.prototype,"button",void 0),Hi([o.query(".ft-button--label slot")],Wi.prototype,"slottedContent",void 0),i.customElement("ft-button")(Wi);const Zi=i.FtCssVariableFactory.extend("--ft-checkbox-text-color",i.designSystemVariables.colorOnSurfaceHigh),Ki=i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),Gi=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnPrimary,"Design system"),qi=i.FtCssVariableFactory.extend("--ft-checkbox-border-color",i.designSystemVariables.colorOnSurfaceMedium),Xi=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),Yi=e.css`
|
|
546
|
+
* {
|
|
547
|
+
box-sizing: border-box;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.ft-checkbox {
|
|
551
|
+
box-sizing: border-box;
|
|
552
|
+
color: ${Zi};
|
|
553
|
+
|
|
554
|
+
display: inline-flex;
|
|
555
|
+
align-items: center;
|
|
556
|
+
gap: 4px;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.ft-checkbox--disabled {
|
|
560
|
+
color: ${Xi};
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
input {
|
|
564
|
+
opacity: 0;
|
|
565
|
+
position: absolute;
|
|
566
|
+
width: 40px;
|
|
567
|
+
height: 40px;
|
|
568
|
+
margin: 0;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.ft-checkbox--box-container {
|
|
572
|
+
position: relative;
|
|
573
|
+
width: 40px;
|
|
574
|
+
height: 40px;
|
|
575
|
+
|
|
576
|
+
display: flex;
|
|
577
|
+
justify-content: center;
|
|
578
|
+
align-items: center;
|
|
579
|
+
flex-shrink: 0;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.ft-checkbox--box {
|
|
583
|
+
display: flex;
|
|
584
|
+
border: 2px solid ${qi};
|
|
585
|
+
border-radius: 2px;
|
|
586
|
+
|
|
587
|
+
width: 18px;
|
|
588
|
+
height: 18px;
|
|
589
|
+
|
|
590
|
+
color: ${Gi};
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
595
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
596
|
+
border-color: ${Ki};
|
|
597
|
+
background-color: ${Ki};
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
601
|
+
border-color: ${Xi};
|
|
602
|
+
background-color: transparent;
|
|
603
|
+
color: ${Xi};
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.ft-checkbox--checkmark {
|
|
607
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
608
|
+
opacity: 0;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.ft-checkbox--checkmark-path {
|
|
612
|
+
stroke-dashoffset: 0;
|
|
613
|
+
stroke: currentcolor;
|
|
614
|
+
stroke-width: 3px;
|
|
615
|
+
stroke-dasharray: 30;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
619
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
620
|
+
opacity: 1;
|
|
621
|
+
}
|
|
622
|
+
`;var Ji=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Qi extends i.FtLitElement{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return e.html`
|
|
623
|
+
<label class="${n.classMap(t)}" for="checkbox-input">
|
|
624
|
+
<div class="ft-checkbox--box-container">
|
|
625
|
+
<ft-ripple
|
|
626
|
+
?disabled=${this.disabled}
|
|
627
|
+
?primary=${this.checked||this.indeterminate}
|
|
628
|
+
unbounded>
|
|
629
|
+
</ft-ripple>
|
|
630
|
+
<div class="ft-checkbox--box">
|
|
631
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24">
|
|
632
|
+
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
633
|
+
d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
634
|
+
</svg>
|
|
635
|
+
</div>
|
|
636
|
+
<input type="checkbox"
|
|
637
|
+
id="checkbox-input"
|
|
638
|
+
name="${this.name}"
|
|
639
|
+
.checked=${this.checked}
|
|
640
|
+
.disabled=${this.disabled}
|
|
641
|
+
@change=${this.onChange}
|
|
642
|
+
>
|
|
643
|
+
</div>
|
|
644
|
+
<ft-typography variant="body2">
|
|
645
|
+
<slot></slot>
|
|
646
|
+
</ft-typography>
|
|
647
|
+
</label>
|
|
648
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var i;super.contentAvailableCallback(t),null===(i=this.ripple)||void 0===i||i.setupFor(this.container)}}Qi.elementDefinitions={"ft-ripple":xi,"ft-typography":ri},Qi.styles=Yi,Ji([o.property()],Qi.prototype,"name",void 0),Ji([o.property({type:Boolean,reflect:!0})],Qi.prototype,"checked",void 0),Ji([o.property({type:Boolean})],Qi.prototype,"indeterminate",void 0),Ji([o.property({type:Boolean})],Qi.prototype,"disabled",void 0),Ji([o.query(".ft-checkbox")],Qi.prototype,"container",void 0),Ji([o.query("ft-ripple")],Qi.prototype,"ripple",void 0),i.customElement("ft-checkbox")(Qi);const te=i.FtCssVariableFactory.extend("--ft-radio-text-color",i.designSystemVariables.colorOnSurfaceHigh),ie=i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),ee=(i.FtCssVariableFactory.external(i.designSystemVariables.colorOnPrimary,"Design system"),i.FtCssVariableFactory.extend("--ft-radio-border-color",i.designSystemVariables.colorOnSurfaceMedium)),oe=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),se=e.css`
|
|
649
|
+
* {
|
|
650
|
+
box-sizing: border-box;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.ft-radio {
|
|
654
|
+
box-sizing: border-box;
|
|
655
|
+
color: ${te};
|
|
656
|
+
|
|
657
|
+
display: inline-flex;
|
|
658
|
+
align-items: center;
|
|
659
|
+
gap: 4px;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.ft-radio--disabled {
|
|
663
|
+
color: ${oe};
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
input {
|
|
667
|
+
opacity: 0;
|
|
668
|
+
position: absolute;
|
|
669
|
+
width: 40px;
|
|
670
|
+
height: 40px;
|
|
671
|
+
margin: 0;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.ft-radio--box-container {
|
|
675
|
+
position: relative;
|
|
676
|
+
width: 40px;
|
|
677
|
+
height: 40px;
|
|
678
|
+
|
|
679
|
+
display: flex;
|
|
680
|
+
justify-content: center;
|
|
681
|
+
align-items: center;
|
|
682
|
+
flex-shrink: 0;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.ft-radio--box {
|
|
686
|
+
border: 2px solid ${ee};
|
|
687
|
+
border-radius: 50%;
|
|
688
|
+
|
|
689
|
+
display: flex;
|
|
690
|
+
justify-content: center;
|
|
691
|
+
align-items: center;
|
|
692
|
+
|
|
693
|
+
width: 20px;
|
|
694
|
+
height: 20px;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.ft-radio--box:after {
|
|
698
|
+
content: " ";
|
|
699
|
+
background-color: ${ie};
|
|
700
|
+
|
|
701
|
+
border-radius: 50%;
|
|
702
|
+
|
|
703
|
+
width: 12px;
|
|
704
|
+
height: 12px;
|
|
705
|
+
|
|
706
|
+
transform: scale(0);
|
|
707
|
+
transition: transform 100ms ease;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.ft-radio--checked .ft-radio--box {
|
|
711
|
+
border-color: ${ie};
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
.ft-radio--checked .ft-radio--box:after {
|
|
716
|
+
transform: scale(1);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.ft-radio--disabled .ft-radio--box {
|
|
720
|
+
border-color: ${oe};
|
|
721
|
+
background-color: transparent;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.ft-radio--disabled .ft-radio--box:after {
|
|
725
|
+
background-color: ${oe};
|
|
726
|
+
}
|
|
727
|
+
`;var ne=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class re extends CustomEvent{constructor(t,i){super("change",{detail:{value:t,checked:i},bubbles:!0,composed:!0})}}class le extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.name="",this.checked=!1,this.disabled=!1}render(){const t={"ft-radio":!0,"ft-radio--checked":this.checked,"ft-radio--disabled":this.disabled};return e.html`
|
|
728
|
+
<div class="${n.classMap(t)}">
|
|
729
|
+
<div class="ft-radio--box-container">
|
|
730
|
+
<ft-ripple
|
|
731
|
+
?disabled=${this.disabled}
|
|
732
|
+
?primary=${this.checked}
|
|
733
|
+
unbounded>
|
|
734
|
+
</ft-ripple>
|
|
735
|
+
<div class="ft-radio--box">
|
|
736
|
+
</div>
|
|
737
|
+
<input id="radio-button"
|
|
738
|
+
type="radio"
|
|
739
|
+
name="${this.name}"
|
|
740
|
+
value="${this.value}"
|
|
741
|
+
.checked=${this.checked}
|
|
742
|
+
.disabled=${this.disabled}
|
|
743
|
+
@change=${this.onChange}
|
|
744
|
+
>
|
|
745
|
+
</div>
|
|
746
|
+
<label for="radio-button" @click=${t=>t.stopPropagation()}>
|
|
747
|
+
<ft-typography variant="body2">
|
|
748
|
+
<slot></slot>
|
|
749
|
+
</ft-typography>
|
|
750
|
+
</label>
|
|
751
|
+
</div>
|
|
752
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new re(this.value,this.checked))}contentAvailableCallback(t){var i;super.contentAvailableCallback(t),null===(i=this.ripple)||void 0===i||i.setupFor(this.container)}select(){this.checked=!0,this.dispatchEvent(new re(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}le.elementDefinitions={"ft-ripple":xi,"ft-typography":ri},le.styles=se,ne([o.property()],le.prototype,"value",void 0),ne([o.property()],le.prototype,"name",void 0),ne([o.property({type:Boolean,reflect:!0})],le.prototype,"checked",void 0),ne([o.property({type:Boolean})],le.prototype,"disabled",void 0),ne([o.query(".ft-radio")],le.prototype,"container",void 0),ne([o.query("ft-ripple")],le.prototype,"ripple",void 0),ne([o.query("input")],le.prototype,"input",void 0);const ae=e.css`
|
|
753
|
+
:host {
|
|
754
|
+
display: contents;
|
|
755
|
+
}
|
|
756
|
+
`;var he=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class pe extends i.FtLitElement{constructor(){super(...arguments),this.name=""}render(){return e.html`
|
|
757
|
+
<slot @slotchange=${this.onSlotChange}
|
|
758
|
+
@change=${this.onChange}
|
|
759
|
+
@keydown=${this.onKeyDown}
|
|
760
|
+
@focusin=${this.focusCurrentValue}
|
|
761
|
+
></slot>
|
|
762
|
+
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((i=>i.checked=t.detail.value===i.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let i=this.findFtRadio(t),e=this.radioButtons.indexOf(i)-1;this.radioButtons[e<0?this.radioButtons.length-1:e].select();break}case"ArrowDown":case"ArrowRight":{let i=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[i>this.radioButtons.length-1?0:i].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}pe.elementDefinitions={},pe.styles=ae,he([o.property()],pe.prototype,"name",void 0),he([o.queryAssignedElements()],pe.prototype,"radioButtons",void 0),i.customElement("ft-radio")(le),i.customElement("ft-radio-group")(pe);const ce={borderRadiusM:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusM,"Design system"),colorOutline:i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),colorOnSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:i.FtCssVariableFactory.external(jt.fontFamily,"Body2 typography"),fontSize:i.FtCssVariableFactory.external(jt.fontSize,"Body2 typography"),fontWeight:i.FtCssVariableFactory.external(jt.fontWeight,"Body2 typography"),letterSpacing:i.FtCssVariableFactory.external(jt.letterSpacing,"Body2 typography"),lineHeight:i.FtCssVariableFactory.external(jt.lineHeight,"Body2 typography"),textTransform:i.FtCssVariableFactory.external(jt.textTransform,"Body2 typography")},fe=e.css`
|
|
763
|
+
.ft-filter-level--container {
|
|
764
|
+
display: flex;
|
|
765
|
+
flex-direction: column;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.ft-filter-level--container > * {
|
|
769
|
+
padding: 0 10px;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.ft-filter-level--go-back {
|
|
773
|
+
flex-shrink: 0;
|
|
774
|
+
text-decoration: none;
|
|
775
|
+
position: relative;
|
|
776
|
+
border-radius: ${ce.borderRadiusM};
|
|
777
|
+
overflow: hidden;
|
|
778
|
+
display: flex;
|
|
779
|
+
align-items: center;
|
|
780
|
+
padding: 4px 4px;
|
|
781
|
+
gap: 4px;
|
|
782
|
+
cursor: pointer;
|
|
783
|
+
color: ${ce.colorOnSurface};
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.ft-filter-level--go-back:focus {
|
|
787
|
+
outline: none;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.ft-filter-level--go-back ft-icon {
|
|
791
|
+
flex-shrink: 0;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
.ft-filter-level--go-back ft-typography {
|
|
795
|
+
display: block;
|
|
796
|
+
flex-grow: 1;
|
|
797
|
+
flex-shrink: 0;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.ft-filter-level--option {
|
|
801
|
+
display: flex;
|
|
802
|
+
align-items: center;
|
|
803
|
+
max-width: 100%;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.ft-filter-level--option ft-button {
|
|
807
|
+
margin-right: -10px;
|
|
808
|
+
flex-shrink: 0;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
ft-button {
|
|
812
|
+
${i.setVariable(Fi.color,ce.colorOnSurface)};
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
ft-radio, ft-checkbox {
|
|
816
|
+
flex-shrink: 1;
|
|
817
|
+
flex-grow: 1;
|
|
818
|
+
display: flex;
|
|
819
|
+
max-width: calc(100% + 10px);
|
|
820
|
+
margin-left: -10px;
|
|
821
|
+
word-break: break-word;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.ft-filter-level--no-values {
|
|
825
|
+
margin: 10px 0;
|
|
826
|
+
color: ${ce.colorOnSurfaceMedium};
|
|
827
|
+
}
|
|
828
|
+
`;var de=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ue extends i.FtLitElement{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,i;return null!==(i=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==i?i:0}render(){let t=[...this.options];this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const i=t.slice(0,this.limit);return e.html`
|
|
829
|
+
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
830
|
+
${null==this.parent?null:e.html`
|
|
831
|
+
<div tabindex="0"
|
|
832
|
+
part="controls go-back"
|
|
833
|
+
class="ft-filter-level--go-back"
|
|
834
|
+
?disabled=${this.disabled}
|
|
835
|
+
@keyup=${this.goBackOnKeyPress}
|
|
836
|
+
@click=${this.goBackOnClick}>
|
|
837
|
+
<ft-ripple></ft-ripple>
|
|
838
|
+
<ft-icon variant="material">chevron_left</ft-icon>
|
|
839
|
+
<ft-typography variant="body2">${this.parent.label}</ft-typography>
|
|
840
|
+
</div>
|
|
841
|
+
`}
|
|
842
|
+
${0===this.options.length&&this.noValuesLabel?e.html`
|
|
843
|
+
<ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
|
|
844
|
+
${this.noValuesLabel}
|
|
845
|
+
</ft-typography>
|
|
846
|
+
`:e.nothing}
|
|
847
|
+
${s.repeat(i,(t=>t.value),(t=>{var i;return e.html`
|
|
848
|
+
<div class="ft-filter-level--option" part="options">
|
|
849
|
+
${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
|
|
850
|
+
${this.preventNavigation||t.selected||0===(null!==(i=t.subOptions)&&void 0!==i?i:[]).length?e.nothing:e.html`
|
|
851
|
+
<ft-button icon="chevron_right"
|
|
852
|
+
part="controls navigate-hierarchy"
|
|
853
|
+
label="${t.label}"
|
|
854
|
+
?disabled=${this.disabled}
|
|
855
|
+
tooltipPosition="left"
|
|
856
|
+
@click=${()=>this.displayLevel(t)}></ft-button>
|
|
857
|
+
`}
|
|
858
|
+
</div>
|
|
859
|
+
`}))}
|
|
860
|
+
${i.length<t.length?e.html`
|
|
861
|
+
<ft-button
|
|
862
|
+
class="ft-filter-level--display-more"
|
|
863
|
+
icon="expand_more"
|
|
864
|
+
dense trailingIcon
|
|
865
|
+
part="controls display-more"
|
|
866
|
+
@click=${this.displayMore}>
|
|
867
|
+
${this.moreValuesButtonLabel}
|
|
868
|
+
</ft-button>
|
|
869
|
+
`:e.nothing}
|
|
870
|
+
</div>
|
|
871
|
+
`}goBackOnKeyPress(t){"Enter"!==t.key&&" "!==t.key||this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}goBackOnClick(t){t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}displayMore(){this.displayedPages++}buildMultiValuedOption(t){var i;return e.html`
|
|
872
|
+
<ft-checkbox name="${this.id}"
|
|
873
|
+
part="multivalued-option"
|
|
874
|
+
data-value="${t.value}"
|
|
875
|
+
.checked=${t.selected}
|
|
876
|
+
.disabled=${this.disabled}
|
|
877
|
+
.indeterminate=${li(null!==(i=t.subOptions)&&void 0!==i?i:[],(t=>{var i;return null!==(i=t.subOptions)&&void 0!==i?i:[]})).some((t=>t.selected))}
|
|
878
|
+
@change=${i=>this.optionsChanged(i,t)}>
|
|
879
|
+
${t.renderOption?t.renderOption:t.label}
|
|
880
|
+
</ft-checkbox>
|
|
881
|
+
`}buildMonoValuedOption(t){return e.html`
|
|
882
|
+
<ft-radio name="${this.id+Math.round(1e6*Math.random())}"
|
|
883
|
+
part="monovalued-option"
|
|
884
|
+
data-value="${t.value}"
|
|
885
|
+
.checked=${t.selected}
|
|
886
|
+
.disabled=${this.disabled}
|
|
887
|
+
@click=${i=>this.optionsChanged(i,t)}
|
|
888
|
+
@keyup=${i=>this.onRadioKeyUp(i,t)}
|
|
889
|
+
@change=${t=>t.stopPropagation()}>
|
|
890
|
+
${t.renderOption?t.renderOption:t.label}
|
|
891
|
+
</ft-radio>
|
|
892
|
+
`}onRadioKeyUp(t,i){i.selected&&" "===t.key&&this.optionsChanged(t,i)}optionsChanged(t,i){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:i}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}ue.elementDefinitions={"ft-button":Wi,"ft-ripple":xi,"ft-typography":ri,"ft-checkbox":Qi,"ft-icon":Di,"ft-radio":le},ue.styles=fe,de([o.property({type:String})],ue.prototype,"id",void 0),de([o.property({type:Object})],ue.prototype,"parent",void 0),de([o.property({type:Array})],ue.prototype,"options",void 0),de([o.property({type:Boolean})],ue.prototype,"multivalued",void 0),de([o.property({type:Boolean})],ue.prototype,"disabled",void 0),de([o.property({type:Boolean})],ue.prototype,"hideSelectedOptions",void 0),de([o.property({type:Boolean})],ue.prototype,"preventNavigation",void 0),de([o.property({type:String})],ue.prototype,"filter",void 0),de([o.property({type:String})],ue.prototype,"moreValuesButtonLabel",void 0),de([o.property({type:String})],ue.prototype,"noValuesLabel",void 0),de([o.property({type:Number})],ue.prototype,"displayedValuesLimit",void 0),de([o.query(".ft-filter-level--container")],ue.prototype,"container",void 0),de([o.state()],ue.prototype,"displayedPages",void 0);const ve={buttonsColor:i.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",i.designSystemVariables.colorPrimary),buttonsZIndex:i.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:i.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system")},be=e.css`
|
|
893
|
+
.ft-snap-scroll {
|
|
894
|
+
box-sizing: border-box;
|
|
895
|
+
position: relative;
|
|
896
|
+
display: flex;
|
|
897
|
+
|
|
898
|
+
--ft-snap-scroll-transparent-color: transparent;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
902
|
+
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
903
|
+
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
904
|
+
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.ft-snap-scroll,
|
|
908
|
+
.ft-snap-scroll--content {
|
|
909
|
+
overflow: hidden;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.ft-snap-scroll--limit-size,
|
|
913
|
+
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
914
|
+
width: 100%;
|
|
915
|
+
height: 100%;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.ft-snap-scroll--content {
|
|
919
|
+
flex-grow: 1;
|
|
920
|
+
flex-shrink: 1;
|
|
921
|
+
box-sizing: border-box;
|
|
922
|
+
scroll-snap-align: start;
|
|
923
|
+
display: flex;
|
|
924
|
+
flex-wrap: nowrap;
|
|
925
|
+
align-items: flex-start;
|
|
926
|
+
justify-content: flex-start;
|
|
927
|
+
gap: ${ve.gap};
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
931
|
+
display: none;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
935
|
+
-ms-overflow-style: none;
|
|
936
|
+
scrollbar-width: none;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.ft-snap-scroll--content::slotted(*) {
|
|
940
|
+
flex-shrink: 0;
|
|
941
|
+
flex-grow: 1;
|
|
942
|
+
max-height: 100%;
|
|
943
|
+
max-width: 100%;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.ft-snap-scroll--horizontal,
|
|
947
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
948
|
+
width: 100%;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.ft-snap-scroll--vertical,
|
|
952
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
953
|
+
height: 100%;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
957
|
+
flex-direction: row;
|
|
958
|
+
overflow-x: auto;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
962
|
+
flex-direction: column;
|
|
963
|
+
overflow-y: auto;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.ft-snap-scroll--previous,
|
|
967
|
+
.ft-snap-scroll--next {
|
|
968
|
+
position: absolute;
|
|
969
|
+
display: flex;
|
|
970
|
+
z-index: ${ve.buttonsZIndex};
|
|
971
|
+
opacity: 1;
|
|
972
|
+
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
973
|
+
${i.setVariable(Fi.backgroundColor,"transparent")};
|
|
974
|
+
${i.setVariable(Fi.color,ve.buttonsColor)};
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.ft-snap-scroll--previous[hidden],
|
|
978
|
+
.ft-snap-scroll--next[hidden] {
|
|
979
|
+
z-index: -1;
|
|
980
|
+
opacity: 0;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous {
|
|
984
|
+
top: 0;
|
|
985
|
+
left: -1px;
|
|
986
|
+
bottom: 0;
|
|
987
|
+
background: linear-gradient(to right, ${ve.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
991
|
+
top: -1px;
|
|
992
|
+
left: 0;
|
|
993
|
+
right: 0;
|
|
994
|
+
background: linear-gradient(to bottom, ${ve.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
998
|
+
top: 0;
|
|
999
|
+
right: -1px;
|
|
1000
|
+
bottom: 0;
|
|
1001
|
+
background: linear-gradient(to left, ${ve.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1005
|
+
left: 0;
|
|
1006
|
+
right: 0;
|
|
1007
|
+
bottom: -1px;
|
|
1008
|
+
background: linear-gradient(to top, ${ve.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1012
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1013
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1014
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1015
|
+
background-color: ${ve.colorSurface};
|
|
1016
|
+
}
|
|
1017
|
+
`;var ge=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class xe extends CustomEvent{constructor(t,i){super("current-element-change",{detail:{index:t,element:i}})}}class ye extends i.FtLitElement{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new i.Debouncer(200),this.updateScrollDebouncer=new i.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let i=this.elements[t];if(i){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,e=this.contentSlot[this.scrollAttribute]+this.prevSize;(i[this.offsetAttribute]<e||i[this.offsetAttribute]+i[this.sizeAttribute]>t)&&this.scrollToElement(i)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=n.classMap({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":i.isSafari}),o=this.controls&&this.withScroll;return e.html`
|
|
1018
|
+
<div part="container" class="${t}">
|
|
1019
|
+
<ft-button
|
|
1020
|
+
class="ft-snap-scroll--previous"
|
|
1021
|
+
part="controls"
|
|
1022
|
+
primary
|
|
1023
|
+
icon="${this.horizontal?"arrow_back_ios_new":"expand_less"}"
|
|
1024
|
+
?hidden=${!o||this.startReached}
|
|
1025
|
+
?disabled=${!o||this.startReached}
|
|
1026
|
+
@click=${this.previous}
|
|
1027
|
+
></ft-button>
|
|
1028
|
+
<slot class="ft-snap-scroll--content"
|
|
1029
|
+
part="content"
|
|
1030
|
+
@slotchange=${this.onSlotChange}></slot>
|
|
1031
|
+
<ft-button
|
|
1032
|
+
class="ft-snap-scroll--next"
|
|
1033
|
+
part="controls"
|
|
1034
|
+
primary
|
|
1035
|
+
icon="${this.horizontal?"arrow_forward_ios":"expand_more"}"
|
|
1036
|
+
?hidden=${!o||this.endReached}
|
|
1037
|
+
?disabled=${!o||this.endReached}
|
|
1038
|
+
@click=${this.next}
|
|
1039
|
+
></ft-button>
|
|
1040
|
+
</div>
|
|
1041
|
+
`}updated(t){var i;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(i=this.listenedContainer)||void 0===i||i.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new xe(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const i=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<i&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var i,e;t&&(this.horizontal?null===(i=this.contentSlot)||void 0===i||i.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(e=this.contentSlot)||void 0===e||e.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,i;this.elements=null!==(i=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==i?i:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let i=0;i<this.elements.length;i++)(t<0||this.getDistanceFromStart(this.elements[i])<this.getDistanceFromStart(this.elements[t]))&&(t=i);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const i=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-i)}}ye.elementDefinitions={"ft-button":Wi},ye.styles=be,ge([o.property({type:Boolean})],ye.prototype,"horizontal",void 0),ge([o.property({type:Boolean})],ye.prototype,"hideScrollbar",void 0),ge([o.property({type:Boolean})],ye.prototype,"controls",void 0),ge([o.property({type:Boolean})],ye.prototype,"limitSize",void 0),ge([o.state()],ye.prototype,"elements",void 0),ge([o.state()],ye.prototype,"currentElement",void 0),ge([o.state()],ye.prototype,"withScroll",void 0),ge([o.state()],ye.prototype,"startReached",void 0),ge([o.state()],ye.prototype,"endReached",void 0),ge([o.query(".ft-snap-scroll--content")],ye.prototype,"contentSlot",void 0),i.customElement("ft-snap-scroll")(ye);const me=i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),$e=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),we=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),ke=i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),Se=i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),ze=i.FtCssVariableFactory.external(i.designSystemVariables.transitionDuration,"Design system"),Oe=i.FtCssVariableFactory.external(i.designSystemVariables.transitionTimingFunction,"Design system"),Ce=[ti,e.css`
|
|
1042
|
+
:host {
|
|
1043
|
+
display: flex;
|
|
1044
|
+
max-height: 100%;
|
|
1045
|
+
max-width: 100%;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.ft-filter--container {
|
|
1049
|
+
flex-grow: 1;
|
|
1050
|
+
display: flex;
|
|
1051
|
+
flex-direction: column;
|
|
1052
|
+
max-height: 100%;
|
|
1053
|
+
max-width: 100%;
|
|
1054
|
+
color: ${$e};
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
.ft-filter--header {
|
|
1058
|
+
display: flex;
|
|
1059
|
+
flex-wrap: wrap;
|
|
1060
|
+
gap: 4px;
|
|
1061
|
+
flex-shrink: 0;
|
|
1062
|
+
padding: 0 10px;
|
|
1063
|
+
margin-bottom: 8px;
|
|
1064
|
+
${i.setVariable(Y.fontSize,"14px")};
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
.ft-filter--header ft-button {
|
|
1068
|
+
flex-shrink: 0;
|
|
1069
|
+
margin-left: auto;
|
|
1070
|
+
${i.setVariable(Fi.iconSize,"18px")};
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
.ft-filter--label {
|
|
1074
|
+
display: block;
|
|
1075
|
+
flex-shrink: 1;
|
|
1076
|
+
flex-grow: 1;
|
|
1077
|
+
word-break: break-word;
|
|
1078
|
+
${i.setVariable(Y.lineHeight,"22px")};
|
|
1079
|
+
${i.setVariable(Y.fontWeight,"bold")};
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
.ft-filter--filter {
|
|
1083
|
+
flex-shrink: 0;
|
|
1084
|
+
display: flex;
|
|
1085
|
+
margin: 0;
|
|
1086
|
+
margin-bottom: 8px;
|
|
1087
|
+
padding: 0 10px;
|
|
1088
|
+
overflow: hidden;
|
|
1089
|
+
height: 32px;
|
|
1090
|
+
transition: height ${ze} ${Oe},
|
|
1091
|
+
margin ${ze} ${Oe};
|
|
1092
|
+
transition-delay: 500ms;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.ft-filter--filter[hidden] {
|
|
1096
|
+
height: 0;
|
|
1097
|
+
margin-bottom: 0;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
input {
|
|
1101
|
+
display: block;
|
|
1102
|
+
width: 100%;
|
|
1103
|
+
border-radius: 4px;
|
|
1104
|
+
border: 1px solid ${me};
|
|
1105
|
+
padding: 4px;
|
|
1106
|
+
background-color: ${Se};
|
|
1107
|
+
color: ${$e};
|
|
1108
|
+
outline-color: ${ke};
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
input::placeholder {
|
|
1112
|
+
color: ${we};
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
input:placeholder-shown {
|
|
1116
|
+
text-overflow: ellipsis;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
.ft-filter--values {
|
|
1120
|
+
flex-grow: 1;
|
|
1121
|
+
flex-shrink: 1;
|
|
1122
|
+
max-width: 100%;
|
|
1123
|
+
overflow-x: hidden;
|
|
1124
|
+
overflow-y: auto;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
.ft-filter--separator {
|
|
1128
|
+
border-top: 1px solid ${me};
|
|
1129
|
+
margin: 4px 10px;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.ft-filter--levels-container {
|
|
1133
|
+
position: relative;
|
|
1134
|
+
overflow: hidden;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
.ft-filter--levels {
|
|
1138
|
+
position: relative;
|
|
1139
|
+
overflow: hidden;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
ft-filter-level {
|
|
1143
|
+
width: 100%;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
.ft-filter--level-left {
|
|
1147
|
+
height: 0;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
slot {
|
|
1151
|
+
display: none;
|
|
1152
|
+
}
|
|
1153
|
+
`];var je=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Be extends CustomEvent{constructor(t){super("change",{detail:t})}}class Ie extends i.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new i.Debouncer(300),this.changeDebouncer=new i.Debouncer(10)}get flatOptions(){return li(this.options,(t=>{var i;return null!==(i=t.subOptions)&&void 0!==i?i:[]}))}get selectedValues(){return this.flatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){var t,i;const o=this.flatOptions.some((t=>t.selected)),s=this.withScroll||this.filter||null!==(i=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==i&&i,n=this.filterPlaceHolder.replace("{0}",this.label);return e.html`
|
|
1154
|
+
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1155
|
+
part="container">
|
|
1156
|
+
${this.label||o?e.html`
|
|
1157
|
+
<div class="ft-filter--header" part="header">
|
|
1158
|
+
<ft-typography class="ft-filter--label" variant="overline" part="label">${this.label}
|
|
1159
|
+
</ft-typography>
|
|
1160
|
+
${o&&!this.hideClearButton?e.html`
|
|
1161
|
+
<ft-button icon="close" dense @click=${this.clear} part="clear-button">
|
|
1162
|
+
${this.clearButtonLabel}
|
|
1163
|
+
</ft-button>
|
|
1164
|
+
`:null}
|
|
1165
|
+
</div>
|
|
1166
|
+
`:null}
|
|
1167
|
+
<div class="ft-filter--filter" ?hidden=${!s}>
|
|
1168
|
+
<input type="search"
|
|
1169
|
+
part="input"
|
|
1170
|
+
class="ft-typography--caption"
|
|
1171
|
+
?disabled=${!s}
|
|
1172
|
+
placeholder="${n}"
|
|
1173
|
+
size="${s?n.length:0}"
|
|
1174
|
+
@search=${this.onFilterChange}
|
|
1175
|
+
@keyup=${this.onFilterChange}>
|
|
1176
|
+
</div>
|
|
1177
|
+
<div class="ft-filter--values">
|
|
1178
|
+
${this.renderLevels()}
|
|
1179
|
+
</div>
|
|
1180
|
+
<slot class="ft-filter--slot"
|
|
1181
|
+
@slotchange=${this.updateOptionsFromSlot}
|
|
1182
|
+
@option-change=${this.optionsChanged}></slot>
|
|
1183
|
+
</div>
|
|
1184
|
+
`}update(t){if(super.update(t),t.has("options")){const t=new Set(this.flatOptions.map((t=>t.value)));this.displayedLevels=this.displayedLevels.filter((i=>t.has(i)))}}contentAvailableCallback(t){var i,e;super.contentAvailableCallback(t),this.valuesContainer&&this.scrollResizeObserver.observe(this.valuesContainer),this.container&&this.scrollResizeObserver.observe(this.container),t.has("options")&&(this.updateScroll(),null===(i=this.levelsContainer)||void 0===i||i.scrollToIndex(this.displayedLevels.length)),t.has("slideIn")&&this.slideIn&&setTimeout((()=>{var t;null===(t=this.levelsContainer)||void 0===t||t.next(),this.slideIn=void 0}),0),t.has("slideOut")&&this.slideOut&&(null===(e=this.levelsContainer)||void 0===e||e.previous(),setTimeout((()=>{this.displayedLevels.pop(),this.slideOut=void 0}),300))}renderLevels(){const t=this.flatOptions,i=t.filter((t=>t.selected)),o=this.slideIn||this.slideOut?this.displayedLevels.length-2:this.displayedLevels.length-1,s=o<0?"ft-filter--level-center":"ft-filter--level-left";return e.html`
|
|
1185
|
+
${this.raiseSelectedOptions&&i.length>0?e.html`
|
|
1186
|
+
<ft-filter-level
|
|
1187
|
+
id="${this.id}"
|
|
1188
|
+
?multivalued=${this.multivalued}
|
|
1189
|
+
?disabled=${this.disabled}
|
|
1190
|
+
preventNavigation
|
|
1191
|
+
.options=${i}
|
|
1192
|
+
@change=${this.onChange}
|
|
1193
|
+
part="values selected-values"
|
|
1194
|
+
.exportpartsPrefixes=${["values","selected-values"]}
|
|
1195
|
+
></ft-filter-level>
|
|
1196
|
+
<div class="ft-filter--separator">
|
|
1197
|
+
`:null}
|
|
1198
|
+
<ft-snap-scroll horizontal hideScrollbar
|
|
1199
|
+
class="ft-filter--levels"
|
|
1200
|
+
@current-element-change=${t=>this.levelsScrollDebouncer.run((()=>{for(;t.detail.index<this.displayedLevels.length;)this.displayedLevels.pop();this.requestUpdate()}))}>
|
|
1201
|
+
${this.renderLevel(s,this.options)}
|
|
1202
|
+
${this.displayedLevels.map((i=>t.find((t=>t.value===i)))).map(((t,i)=>{var e;const s=(null==t?void 0:t.value)===this.slideIn||(null==t?void 0:t.value)===this.slideOut?"ft-filter--level-right":i===o?"ft-filter--level-center":"ft-filter--level-left";return this.renderLevel(s,null!==(e=null==t?void 0:t.subOptions)&&void 0!==e?e:[],t)}))}
|
|
1203
|
+
</ft-snap-scroll>
|
|
1204
|
+
`}renderLevel(t,i,o){return e.html`
|
|
1205
|
+
<ft-filter-level
|
|
1206
|
+
class="${t}"
|
|
1207
|
+
id="${this.id}"
|
|
1208
|
+
.filter="${this.filter}"
|
|
1209
|
+
moreValuesButtonLabel="${this.moreValuesButtonLabel}"
|
|
1210
|
+
?multivalued=${this.multivalued}
|
|
1211
|
+
?disabled=${this.disabled||"ft-filter--level-center"!==t}
|
|
1212
|
+
?hideSelectedOptions=${this.raiseSelectedOptions}
|
|
1213
|
+
.parent=${o}
|
|
1214
|
+
.options=${i}
|
|
1215
|
+
.displayedValuesLimit=${this.displayedValuesLimit}
|
|
1216
|
+
@change=${this.onChange}
|
|
1217
|
+
@go-back=${this.goBack}
|
|
1218
|
+
@display-level=${this.onDisplayLevel}
|
|
1219
|
+
part="values available-values"
|
|
1220
|
+
.exportpartsPrefixes=${["values","available-values"]}
|
|
1221
|
+
noValuesLabel="${this.noValuesLabel}"
|
|
1222
|
+
></ft-filter-level>
|
|
1223
|
+
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var i;t.stopPropagation();const e=this.flatOptions.find((i=>i.value===t.detail.value));e.selected=!e.selected;const o=t=>{var i;t!==e&&(t.selected=!1),null===(i=t.subOptions)||void 0===i||i.forEach(o)};this.multivalued?null===(i=e.subOptions)||void 0===i||i.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.dispatchEvent(new Be(this.selectedValues)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,i;this.filter=null!==(i=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==i?i:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}Ie.elementDefinitions={"ft-button":Wi,"ft-filter-level":ue,"ft-snap-scroll":ye,"ft-typography":ri},Ie.styles=Ce,je([o.property({type:String})],Ie.prototype,"id",void 0),je([o.property({type:String})],Ie.prototype,"label",void 0),je([o.property({type:String})],Ie.prototype,"filterPlaceHolder",void 0),je([o.property({type:String})],Ie.prototype,"clearButtonLabel",void 0),je([o.property({type:String})],Ie.prototype,"moreValuesButtonLabel",void 0),je([o.property({type:String})],Ie.prototype,"noValuesLabel",void 0),je([i.jsonProperty([])],Ie.prototype,"options",void 0),je([o.property({type:Boolean})],Ie.prototype,"multivalued",void 0),je([o.property({type:Boolean})],Ie.prototype,"disabled",void 0),je([o.property({type:Boolean})],Ie.prototype,"raiseSelectedOptions",void 0),je([o.property({type:Number})],Ie.prototype,"displayedValuesLimit",void 0),je([o.property({type:Boolean})],Ie.prototype,"hideClearButton",void 0),je([o.query(".ft-filter--slot")],Ie.prototype,"slotElement",void 0),je([o.query(".ft-filter--container")],Ie.prototype,"container",void 0),je([o.query(".ft-filter--values")],Ie.prototype,"valuesContainer",void 0),je([o.query(".ft-filter--levels")],Ie.prototype,"levelsContainer",void 0),je([o.query(".ft-filter--levels ft-filter-level:last-child")],Ie.prototype,"lastLevel",void 0),je([o.query(".ft-filter--filter input")],Ie.prototype,"filterInput",void 0),je([o.queryAll(".ft-filter--levels ft-filter-level")],Ie.prototype,"levels",void 0),je([o.state()],Ie.prototype,"withScroll",void 0),je([o.state()],Ie.prototype,"filter",void 0),je([o.state()],Ie.prototype,"slideIn",void 0),je([o.state()],Ie.prototype,"slideOut",void 0);var Me=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ee extends i.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return e.html`
|
|
1224
|
+
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1225
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Ee.elementDefinitions={},Me([o.property({type:String})],Ee.prototype,"label",void 0),Me([o.property({type:Object,converter:t=>t})],Ee.prototype,"value",void 0),Me([o.property({type:Boolean,reflect:!0})],Ee.prototype,"selected",void 0),Me([o.property({type:Object})],Ee.prototype,"subOptions",void 0),Me([i.jsonProperty({})],Ee.prototype,"renderOption",void 0),Me([o.query(".ft-filter-option--slot")],Ee.prototype,"slotElement",void 0),i.customElement("ft-filter")(Ie),i.customElement("ft-filter-option")(Ee);var Le=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ne extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Ae=Symbol("registerInterval");class Te extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[Ae]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Ae]):this.dispatchEvent(new Ne)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=Ae,Le([o.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}function De(t){return t.rootNodes.map((t=>Ue(t)))}function Ue(t){return{label:t.label,value:t.value,selected:t.selected,subOptions:t.childNodes.map((t=>Ue(t)))}}const Fe=e.css`
|
|
1226
|
+
`,_e=e.css`
|
|
1227
|
+
`,Re=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Pe{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=Re.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?Pe.build(t):null!==(i=Pe.API)&&void 0!==i?i:Pe.API=Pe.build()}static await(t){return new Promise((i=>{let e=Pe.get(t);if(e)i(e);else{const o=Re.subscribe((()=>{e=Pe.get(t),e&&(o(),i(e))}))}}))}}var Ve;const He=Symbol("clearAfterUnitTest");class We{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ve]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=Re.getState().uiLocale,Re.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Re.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var s,n,r;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(n=null===(s=this.cache.getNow(t))||void 0===s?void 0:s.messages)&&void 0!==n?n:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},l).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var i;return await(null===(i=this.apiProvider())||void 0===i?void 0:i.getFluidTopicsMessageContext(this.currentUiLocale,t))})),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}Ve=He,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new We(Pe.get));const Ze=window.FluidTopicsI18nService;var Ke=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ge extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Pe.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
1228
|
+
<slot></slot>
|
|
1229
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&Re.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Re.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Re.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Re.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Re.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Re.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Re.actions.setSession(this.session),t.has("availableUiLocales")&&Re.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ze.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Ge.elementDefinitions={},Ge.styles=_e,Ke([o.property()],Ge.prototype,"baseUrl",void 0),Ke([o.property()],Ge.prototype,"apiIntegrationIdentifier",void 0),Ke([o.property()],Ge.prototype,"uiLocale",void 0),Ke([i.jsonProperty([])],Ge.prototype,"availableUiLocales",void 0),Ke([o.property({type:Boolean})],Ge.prototype,"editorMode",void 0),Ke([o.property({type:Boolean})],Ge.prototype,"noCustom",void 0),Ke([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ge.prototype,"noCustomComponent",void 0),Ke([o.property({type:Boolean})],Ge.prototype,"withManualResources",void 0),Ke([i.jsonProperty([])],Ge.prototype,"messageContexts",void 0),Ke([i.jsonProperty(void 0)],Ge.prototype,"session",void 0),Ke([o.property({type:Object})],Ge.prototype,"apiProvider",void 0),i.customElement("ft-app-context")(Ge);const qe=Symbol("i18nProperties"),Xe=Symbol("i18nUnsubs");function Ye(t){var i;return i=Xe,class extends t{constructor(){super(...arguments),this[i]=new Map}i18n(t,i,...e){var o;if("string"==typeof t)return Ze.resolveMessage(t,i,...e);const s=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return Ze.resolveMessage(t.context,t.key,...s)}onI18nUpdate(t){var i;null===(i=this[qe])||void 0===i||i.forEach(((i,e)=>{i.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(i))})),setTimeout((()=>this.requestUpdate()),0)}updated(t){var i;super.updated(t),null===(i=this[qe])||void 0===i||i.forEach(((t,i)=>{null!=t.argsProvider&&(this[i]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[qe]&&new Set([...this[qe].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,i){t=t.toLowerCase(),this[Xe].has(t)||this[Xe].set(t,Ze.subscribe(t,(()=>this.onI18nUpdate(t)))),Ze.prepareContext(t,null!=i?i:{})}addI18nContext(t,i){this.addI18nMessages(t.name,i)}disconnectedCallback(){super.disconnectedCallback(),this[Xe].forEach((t=>t())),this[Xe].clear()}}}class Je extends(Ye(i.FtLitElement)){}class Qe extends(Ye(i.FtLitElementRedux)){}var to=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class io extends Je{render(){return this.key&&this.context?e.html`
|
|
1230
|
+
<span class="ft-i18n">${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}</span>
|
|
1231
|
+
`:e.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}io.elementDefinitions={},io.styles=Fe,to([o.property()],io.prototype,"context",void 0),to([o.property()],io.prototype,"key",void 0),to([i.jsonProperty([])],io.prototype,"args",void 0),to([o.property()],io.prototype,"defaultMessage",void 0);class eo{constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,i)=>{const e=i;return t=>({context:this.name,key:e,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,i)=>(...t)=>Ze.resolveMessage(this.name,i,...t)})}static build(t){return new eo(t)}static fromGwt(t){return new eo(t)}}i.customElement("ft-i18n")(io);const oo=eo.build("designedSearchFacet");var so=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class no extends(Ye(Te)){constructor(){super(...arguments),this.facetId="",this.maxValues=7,this.facets=[]}setSearchStateManager(t){super.setSearchStateManager(t),this.facetId&&t.addFacet(this.facetId),this.addI18nContext(oo),this.addStore(Re)}render(){let t=this.facets.find((t=>t.key==this.facetId));return t?e.html`
|
|
1232
|
+
<div class="ft-search-facet--label">
|
|
1233
|
+
<ft-typography variant="button">${t.label}</ft-typography>
|
|
1234
|
+
</div>
|
|
1235
|
+
<ft-filter
|
|
1236
|
+
part="filter"
|
|
1237
|
+
.exportpartsPrefixes=${["filter"]}
|
|
1238
|
+
id="${this.facetId}"
|
|
1239
|
+
?multivalued=${t.multiSelectionable}
|
|
1240
|
+
raiseSelectedOptions
|
|
1241
|
+
.options=${De(t)}
|
|
1242
|
+
.displayedValuesLimit=${this.maxValues}
|
|
1243
|
+
filterPlaceHolder="${oo.messages.filterInputPlaceHolder(t.label)}"
|
|
1244
|
+
clearButtonLabel="${oo.messages.clearFilterButton()}"
|
|
1245
|
+
moreValuesButtonLabel="${oo.messages.displayMoreFilterValuesButton()}"
|
|
1246
|
+
noValuesLabel="${oo.messages.noFilterValuesAvailable()}"
|
|
1247
|
+
@change=${this.onFacetValueSelected}
|
|
1248
|
+
></ft-filter>
|
|
1249
|
+
`:!this.facetId&&this.editorMode?e.html`${oo.messages.noMetadataSelected()}`:e.nothing}updated(t){var i;super.updated(t),t.has("facetId")&&(null===(i=this.stateManager)||void 0===i||i.replaceFacet(t.get("facetId"),this.facetId))}onFacetValueSelected(t){var i;null===(i=this.stateManager)||void 0===i||i.setFilter(this.facetId,t.detail)}}no.elementDefinitions={"ft-filter":Ie,"ft-typography":ri},no.styles=l,so([o.property()],no.prototype,"facetId",void 0),so([o.property({type:Number})],no.prototype,"maxValues",void 0),so([i.redux({store:"search"})],no.prototype,"request",void 0),so([i.redux({store:"search"})],no.prototype,"facets",void 0),so([i.redux({store:Re.name})],no.prototype,"editorMode",void 0),i.customElement("ft-search-facet")(no),t.FtSearchFacet=no,t.FtSearchFacetCssVariables={},t.styles=l,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|