@fluid-topics/ft-search-bar 0.2.21 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-search-bar.css.d.ts +17 -20
- package/build/ft-search-bar.css.js +18 -126
- package/build/ft-search-bar.d.ts +36 -49
- package/build/ft-search-bar.js +46 -410
- package/build/ft-search-bar.light.js +396 -393
- package/build/ft-search-bar.min.js +509 -500
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/managers/DesktopSearchBarManager.d.ts +16 -0
- package/build/managers/DesktopSearchBarManager.js +131 -0
- package/build/managers/FacetsChipsManager.d.ts +10 -0
- package/build/managers/FacetsChipsManager.js +129 -0
- package/build/managers/MobileSearchBarManager.d.ts +14 -0
- package/build/managers/MobileSearchBarManager.js +92 -0
- package/build/managers/SuggestManager.d.ts +20 -0
- package/build/managers/SuggestManager.js +215 -0
- package/package.json +17 -17
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
.ft-size-watcher--local .ft-size-watcher--watcher {
|
|
22
22
|
width: 100%;
|
|
23
23
|
}
|
|
24
|
-
`,c([o.property({type:Number})],p.prototype,"debounceTimeout",void 0),c([o.property({type:Boolean})],p.prototype,"local",void 0),c([o.property({type:Number,reflect:!0})],p.prototype,"size",void 0),c([o.property({type:String,reflect:!0})],p.prototype,"category",void 0),c([o.query(".ft-size-watcher--watcher")],p.prototype,"watcher",void 0),e.customElement("ft-size-watcher")(p);const f=globalThis.trustedTypes,d=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,u=`lit$${(Math.random()+"").slice(9)}$`,b="?"+u,v=`<${b}>`,g=document,x=(t="")=>g.createComment(t),y=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,w=/-->/g,k=/>/g,S
|
|
24
|
+
`,c([o.property({type:Number})],p.prototype,"debounceTimeout",void 0),c([o.property({type:Boolean})],p.prototype,"local",void 0),c([o.property({type:Number,reflect:!0})],p.prototype,"size",void 0),c([o.property({type:String,reflect:!0})],p.prototype,"category",void 0),c([o.query(".ft-size-watcher--watcher")],p.prototype,"watcher",void 0),e.customElement("ft-size-watcher")(p);const f=globalThis.trustedTypes,d=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,u=`lit$${(Math.random()+"").slice(9)}$`,b="?"+u,v=`<${b}>`,g=document,x=(t="")=>g.createComment(t),y=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,w=/-->/g,k=/>/g,S=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,O=/"/g,B=/^(?:script|style|textarea|title)$/i,C=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),E=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),D=new WeakMap,F=g.createTreeWalker(g,129,null,!1),L=(t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"<svg>":"",n=$;for(let e=0;e<i;e++){const i=t[e];let l,a,c=-1,h=0;for(;h<i.length&&(n.lastIndex=h,a=n.exec(i),null!==a);)h=n.lastIndex,n===$?"!--"===a[1]?n=w:void 0!==a[1]?n=k:void 0!==a[2]?(B.test(a[2])&&(s=RegExp("</"+a[2],"g")),n=S):void 0!==a[3]&&(n=S):n===S?">"===a[0]?(n=null!=s?s:$,c=-1):void 0===a[1]?c=-2:(c=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?S:'"'===a[3]?O:z):n===O||n===z?n=S:n===w||n===k?n=$:(n=S,s=void 0);const p=n===S&&t[e+1].startsWith("/>")?" ":"";r+=n===$?i+v:c>=0?(o.push(l),i.slice(0,c)+"$lit$"+i.slice(c)+u+p):i+u+(-2===c?(o.push(void 0),e):p)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==d?d.createHTML(l):l,o]};class j{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,l=this.parts,[a,c]=L(t,e);if(this.el=j.createElement(a,i),F.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=F.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(u)){const i=c[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(u),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?R:"?"===e[1]?Z:"@"===e[1]?U:T})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(B.test(o.tagName)){const t=o.textContent.split(u),e=t.length-1;if(e>0){o.textContent=f?f.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],x()),F.nextNode(),l.push({type:2,index:++s});o.append(t[e],x())}}}else if(8===o.nodeType)if(o.data===b)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(u,t+1));)l.push({type:7,index:s}),t+=u.length-1}s++}}static createElement(t,e){const i=g.createElement("template");return i.innerHTML=t,i}}function M(t,e,i=t,o){var s,r,n,l;if(e===E)return e;let a=void 0!==o?null===(s=i._$Cl)||void 0===s?void 0:s[o]:i._$Cu;const c=y(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==c&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===c?a=void 0:(a=new c(t),a._$AT(t,i,o)),void 0!==o?(null!==(n=(l=i)._$Cl)&&void 0!==n?n:l._$Cl=[])[o]=a:i._$Cu=a),void 0!==a&&(e=M(t,a._$AS(t,e.values),a,o)),e}class P{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:g).importNode(i,!0);F.currentNode=s;let r=F.nextNode(),n=0,l=0,a=o[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new A(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new _(r,this,t)),this.v.push(e),a=o[++l]}n!==(null==a?void 0:a.index)&&(r=F.nextNode(),n++)}return s}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class A{constructor(t,e,i,o){var s;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=M(this,t,e),y(t)?t===I||null==t||""===t?(this._$AH!==I&&this._$AR(),this._$AH=I):t!==this._$AH&&t!==E&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>m(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==I&&y(this._$AH)?this._$AA.nextSibling.data=t:this.k(g.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=j.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.m(i);else{const t=new P(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=D.get(t.strings);return void 0===e&&D.set(t.strings,e=new j(t)),e}S(t){m(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new A(this.j(x()),this.j(x()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class T{constructor(t,e,i,o,s){this.type=1,this._$AH=I,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=M(this,t,e,0),r=!y(t)||t!==this._$AH&&t!==E,r&&(this._$AH=t);else{const o=t;let n,l;for(t=s[0],n=0;n<s.length-1;n++)l=M(this,o[i+n],e,n),l===E&&(l=this._$AH[n]),r||(r=!y(l)||l!==this._$AH[n]),l===I?t=I:t!==I&&(t+=(null!=l?l:"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.P(t)}P(t){t===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class R extends T{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===I?void 0:t}}const N=f?f.emptyScript:"";class Z extends T{constructor(){super(...arguments),this.type=4}P(t){t&&t!==I?this.element.setAttribute(this.name,N):this.element.removeAttribute(this.name)}}class U extends T{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=M(this,t,e,0))&&void 0!==i?i:I)===E)return;const o=this._$AH,s=t===I&&o!==I||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==I&&(o===I||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class _{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const H=window.litHtmlPolyfillSupport;null==H||H(j,A),(null!==(a=globalThis.litHtmlVersions)&&void 0!==a?a:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
25
25
|
/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2020 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
29
|
*/
|
|
30
|
-
const V=Symbol.for(""),K=t=>{
|
|
30
|
+
const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t._$litStatic$},q=t=>({_$litStatic$:t,r:V}),W=new Map,G=(t=>(e,...i)=>{const o=i.length;let s,r;const n=[],l=[];let a,c=0,h=!1;for(;c<o;){for(a=e[c];c<o&&void 0!==(r=i[c],s=K(r));)a+=s+e[++c],h=!0;l.push(r),n.push(a),c++}if(c===o&&n.push(e[o]),h){const t=n.join("$$lit$$");void 0===(e=W.get(t))&&(n.raw=n,W.set(t,e=n)),i=l}return t(e,...i)})(C);var X,Y=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(X||(X={}));const J=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),Q=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),tt={fontFamily:Q,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},et=e.FtCssVariableFactory.extend("--ft-typography-title-font-family",J),it=e.FtCssVariableFactory.extend("--ft-typography-title-font-size",tt.fontSize,"20px"),ot=e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",tt.fontWeight,"normal"),st=e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",tt.letterSpacing,"0.15px"),rt=e.FtCssVariableFactory.extend("--ft-typography-title-line-height",tt.lineHeight,"1.2"),nt=e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",tt.textTransform,"inherit"),lt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",J),at=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",tt.fontSize,"14px"),ct=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",tt.fontWeight,"normal"),ht=e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",tt.letterSpacing,"0.105px"),pt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",tt.lineHeight,"1.7"),ft=e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",tt.textTransform,"inherit"),dt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",Q),ut=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",tt.fontSize,"16px"),bt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",tt.fontWeight,"600"),vt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",tt.letterSpacing,"0.144px"),gt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",tt.lineHeight,"1.5"),xt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",tt.textTransform,"inherit"),yt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",Q),mt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",tt.fontSize,"14px"),$t=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",tt.fontWeight,"normal"),wt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",tt.letterSpacing,"0.098px"),kt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",tt.lineHeight,"1.7"),St=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",tt.textTransform,"inherit"),zt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",tt.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",tt.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",tt.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",tt.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",tt.textTransform,"inherit")},Ot={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",tt.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",tt.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",tt.letterSpacing,"0.252px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",tt.lineHeight,"1.4"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",tt.textTransform,"inherit")},Bt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",tt.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",tt.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",tt.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",tt.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",tt.textTransform,"inherit")},Ct=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",Q),Et=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",tt.fontSize,"10px"),It=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",tt.fontWeight,"normal"),Dt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",tt.letterSpacing,"0.33px"),Ft=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",tt.lineHeight,"1.6"),Lt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",tt.textTransform,"inherit"),jt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",Q),Mt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",tt.fontSize,"10px"),Pt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",tt.fontWeight,"normal"),At=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",tt.letterSpacing,"1.5px"),Tt=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",tt.lineHeight,"1.6"),Rt=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",tt.textTransform,"uppercase"),Nt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",tt.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",tt.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",tt.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",tt.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",tt.textTransform,"uppercase")},Zt=i.css`
|
|
31
31
|
.ft-typography--title {
|
|
32
32
|
font-family: ${et};
|
|
33
33
|
font-size: ${it};
|
|
@@ -84,21 +84,21 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
84
84
|
}
|
|
85
85
|
`,qt=i.css`
|
|
86
86
|
.ft-typography--caption {
|
|
87
|
-
font-family: ${
|
|
88
|
-
font-size: ${
|
|
89
|
-
font-weight: ${
|
|
90
|
-
letter-spacing: ${
|
|
91
|
-
line-height: ${
|
|
92
|
-
text-transform: ${
|
|
87
|
+
font-family: ${Bt.fontFamily};
|
|
88
|
+
font-size: ${Bt.fontSize};
|
|
89
|
+
font-weight: ${Bt.fontWeight};
|
|
90
|
+
letter-spacing: ${Bt.letterSpacing};
|
|
91
|
+
line-height: ${Bt.lineHeight};
|
|
92
|
+
text-transform: ${Bt.textTransform};
|
|
93
93
|
}
|
|
94
94
|
`,Wt=i.css`
|
|
95
95
|
.ft-typography--breadcrumb {
|
|
96
|
-
font-family: ${
|
|
96
|
+
font-family: ${Ct};
|
|
97
97
|
font-size: ${Et};
|
|
98
98
|
font-weight: ${It};
|
|
99
|
-
letter-spacing: ${
|
|
100
|
-
line-height: ${
|
|
101
|
-
text-transform: ${
|
|
99
|
+
letter-spacing: ${Dt};
|
|
100
|
+
line-height: ${Ft};
|
|
101
|
+
text-transform: ${Lt};
|
|
102
102
|
}
|
|
103
103
|
`,Gt=i.css`
|
|
104
104
|
.ft-typography--overline {
|
|
@@ -107,16 +107,16 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
107
107
|
font-weight: ${Pt};
|
|
108
108
|
letter-spacing: ${At};
|
|
109
109
|
line-height: ${Tt};
|
|
110
|
-
text-transform: ${
|
|
110
|
+
text-transform: ${Rt};
|
|
111
111
|
}
|
|
112
112
|
`,Xt=i.css`
|
|
113
113
|
.ft-typography--button {
|
|
114
|
-
font-family: ${
|
|
115
|
-
font-size: ${
|
|
116
|
-
font-weight: ${
|
|
117
|
-
letter-spacing: ${
|
|
118
|
-
line-height: ${
|
|
119
|
-
text-transform: ${
|
|
114
|
+
font-family: ${Nt.fontFamily};
|
|
115
|
+
font-size: ${Nt.fontSize};
|
|
116
|
+
font-weight: ${Nt.fontWeight};
|
|
117
|
+
letter-spacing: ${Nt.letterSpacing};
|
|
118
|
+
line-height: ${Nt.lineHeight};
|
|
119
|
+
text-transform: ${Nt.textTransform};
|
|
120
120
|
}
|
|
121
121
|
`;class Yt extends e.FtLitElement{constructor(){super(...arguments),this.variant=X.body1}render(){return this.element?G`
|
|
122
122
|
<${q(this.element)}
|
|
@@ -129,7 +129,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
129
129
|
.ft-typography {
|
|
130
130
|
vertical-align: inherit;
|
|
131
131
|
}
|
|
132
|
-
`],Y([o.property()],Yt.prototype,"element",void 0),Y([o.property()],Yt.prototype,"variant",void 0),e.customElement("ft-typography")(Yt);var ie=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const oe=e.
|
|
132
|
+
`],Y([o.property()],Yt.prototype,"element",void 0),Y([o.property()],Yt.prototype,"variant",void 0),e.customElement("ft-typography")(Yt);var ie=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const oe=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),se={color:oe,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",oe),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},re=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),ne=re,le=e.FtCssVariableFactory.extend("--ft-ripple-background-color",re),ae=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),ce=ae,he=e.FtCssVariableFactory.extend("--ft-ripple-background-color",ae);class pe extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),r=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-r.x:r.width/2),this.originY=Math.round(null!=s?s-r.y:r.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return i.html`
|
|
133
133
|
<style>
|
|
134
134
|
.ft-ripple .ft-ripple--effect,
|
|
135
135
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -235,7 +235,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
235
235
|
opacity: ${se.opacityContentOnSurfacePressed};
|
|
236
236
|
transform: translate(-50%, -50%) scale(1);
|
|
237
237
|
}
|
|
238
|
-
`,ie([o.property({type:Boolean})],pe.prototype,"primary",void 0),ie([o.property({type:Boolean})],pe.prototype,"secondary",void 0),ie([o.property({type:Boolean})],pe.prototype,"unbounded",void 0),ie([o.property({type:Boolean})],pe.prototype,"activated",void 0),ie([o.property({type:Boolean})],pe.prototype,"selected",void 0),ie([o.property({type:Boolean})],pe.prototype,"disabled",void 0),ie([o.state()],pe.prototype,"hovered",void 0),ie([o.state()],pe.prototype,"focused",void 0),ie([o.state()],pe.prototype,"pressed",void 0),ie([o.state()],pe.prototype,"rippling",void 0),ie([o.state()],pe.prototype,"rippleSize",void 0),ie([o.state()],pe.prototype,"originX",void 0),ie([o.state()],pe.prototype,"originY",void 0),ie([o.query(".ft-ripple")],pe.prototype,"ripple",void 0),ie([o.query(".ft-ripple--effect")],pe.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(pe);var fe=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const de={distance:e.
|
|
238
|
+
`,ie([o.property({type:Boolean})],pe.prototype,"primary",void 0),ie([o.property({type:Boolean})],pe.prototype,"secondary",void 0),ie([o.property({type:Boolean})],pe.prototype,"unbounded",void 0),ie([o.property({type:Boolean})],pe.prototype,"activated",void 0),ie([o.property({type:Boolean})],pe.prototype,"selected",void 0),ie([o.property({type:Boolean})],pe.prototype,"disabled",void 0),ie([o.state()],pe.prototype,"hovered",void 0),ie([o.state()],pe.prototype,"focused",void 0),ie([o.state()],pe.prototype,"pressed",void 0),ie([o.state()],pe.prototype,"rippling",void 0),ie([o.state()],pe.prototype,"rippleSize",void 0),ie([o.state()],pe.prototype,"originX",void 0),ie([o.state()],pe.prototype,"originY",void 0),ie([o.query(".ft-ripple")],pe.prototype,"ripple",void 0),ie([o.query(".ft-ripple--effect")],pe.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(pe);var fe=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const de={distance:e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),color:e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system")};class ue extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new e.Debouncer,this.revealDebouncer=new e.Debouncer}render(){return i.html`
|
|
239
239
|
<div part="container"
|
|
240
240
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
241
241
|
@mouseenter=${this.onHover}
|
|
@@ -282,7 +282,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
282
282
|
position: relative;
|
|
283
283
|
word-break: break-word;
|
|
284
284
|
}
|
|
285
|
-
`,fe([o.property()],ue.prototype,"text",void 0),fe([o.property({type:Boolean})],ue.prototype,"manual",void 0),fe([o.property({type:Boolean})],ue.prototype,"inline",void 0),fe([o.property({type:Number})],ue.prototype,"delay",void 0),fe([o.property()],ue.prototype,"position",void 0),fe([o.queryAssignedNodes("",!0)],ue.prototype,"slotNodes",void 0),fe([o.query(".ft-tooltip--container")],ue.prototype,"container",void 0),fe([o.query("slot")],ue.prototype,"target",void 0),fe([o.query(".ft-tooltip")],ue.prototype,"tooltip",void 0),fe([o.query(".ft-tooltip--content")],ue.prototype,"tooltipContent",void 0),fe([o.state()],ue.prototype,"visible",void 0),e.customElement("ft-tooltip")(ue);const be={color:e.
|
|
285
|
+
`,fe([o.property()],ue.prototype,"text",void 0),fe([o.property({type:Boolean})],ue.prototype,"manual",void 0),fe([o.property({type:Boolean})],ue.prototype,"inline",void 0),fe([o.property({type:Number})],ue.prototype,"delay",void 0),fe([o.property()],ue.prototype,"position",void 0),fe([o.queryAssignedNodes("",!0)],ue.prototype,"slotNodes",void 0),fe([o.query(".ft-tooltip--container")],ue.prototype,"container",void 0),fe([o.query("slot")],ue.prototype,"target",void 0),fe([o.query(".ft-tooltip")],ue.prototype,"tooltip",void 0),fe([o.query(".ft-tooltip--content")],ue.prototype,"tooltipContent",void 0),fe([o.state()],ue.prototype,"visible",void 0),e.customElement("ft-tooltip")(ue);const be={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")};class ve extends e.FtLitElement{static get styles(){return i.css`
|
|
286
286
|
:host {
|
|
287
287
|
line-height: 0;
|
|
288
288
|
}
|
|
@@ -358,47 +358,48 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
358
358
|
<div></div>
|
|
359
359
|
<div></div>
|
|
360
360
|
</div>
|
|
361
|
-
`}}var ge,xe;e.customElement("ft-loader")(ve),function(t){t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="\f06e",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(ge||(ge={})),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=""}(xe||(xe={}));const ye=new Map([...["abw"].map((t=>[t,xe.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,xe.AUDIO])),...["avi"].map((t=>[t,xe.AVI])),...["chm","xhs"].map((t=>[t,xe.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,xe.CODE])),...["csv"].map((t=>[t,xe.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,xe.DITA])),...["epub"].map((t=>[t,xe.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,xe.EXCEL])),...["flac"].map((t=>[t,xe.FLAC])),...["gif"].map((t=>[t,xe.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,xe.GZIP])),...["html","htm","xhtml"].map((t=>[t,xe.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,xe.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,xe.JPEG])),...["json"].map((t=>[t,xe.JSON])),...["m4a","m4p"].map((t=>[t,xe.M4A])),...["mov","qt"].map((t=>[t,xe.MOV])),...["mp3"].map((t=>[t,xe.MP3])),...["mp4","m4v"].map((t=>[t,xe.MP4])),...["ogg","oga"].map((t=>[t,xe.OGG])),...["pdf","ps"].map((t=>[t,xe.PDF])),...["png"].map((t=>[t,xe.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,xe.POWERPOINT])),...["rar"].map((t=>[t,xe.RAR])),...["stp"].map((t=>[t,xe.STP])),...["txt","rtf","md","mdown"].map((t=>[t,xe.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,xe.VIDEO])),...["wav"].map((t=>[t,xe.WAV])),...["wma"].map((t=>[t,xe.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,xe.WORD])),...["xml","xsl","rdf"].map((t=>[t,xe.XML])),...["yaml","yml","x-yaml"].map((t=>[t,xe.YAML])),...["zip"].map((t=>[t,xe.ZIP]))]),me=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var $e,we=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}($e||($e={}));const ke={size:e.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
</i>
|
|
366
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}getIcon(){var t,e;let o=this.textContent;return this.variant===$e.file_format?null!==(t=xe[o.toUpperCase()])&&void 0!==t?t:o:this.variant===$e.fluid_topics?null!==(e=ge[o.toUpperCase()])&&void 0!==e?e:o:i.nothing}}Se.elementDefinitions={},Se.styles=i.css`
|
|
367
|
-
:host {
|
|
368
|
-
display: inline-block;
|
|
369
|
-
}
|
|
370
|
-
:host, i.ft-icon {
|
|
371
|
-
width: ${ke.size};
|
|
372
|
-
height: ${ke.size};
|
|
373
|
-
text-align: center;
|
|
374
|
-
}
|
|
361
|
+
`}}var ge,xe;e.customElement("ft-loader")(ve),function(t){t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="\f06e",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(ge||(ge={})),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=""}(xe||(xe={}));const ye=new Map([...["abw"].map((t=>[t,xe.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,xe.AUDIO])),...["avi"].map((t=>[t,xe.AVI])),...["chm","xhs"].map((t=>[t,xe.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,xe.CODE])),...["csv"].map((t=>[t,xe.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,xe.DITA])),...["epub"].map((t=>[t,xe.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,xe.EXCEL])),...["flac"].map((t=>[t,xe.FLAC])),...["gif"].map((t=>[t,xe.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,xe.GZIP])),...["html","htm","xhtml"].map((t=>[t,xe.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,xe.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,xe.JPEG])),...["json"].map((t=>[t,xe.JSON])),...["m4a","m4p"].map((t=>[t,xe.M4A])),...["mov","qt"].map((t=>[t,xe.MOV])),...["mp3"].map((t=>[t,xe.MP3])),...["mp4","m4v"].map((t=>[t,xe.MP4])),...["ogg","oga"].map((t=>[t,xe.OGG])),...["pdf","ps"].map((t=>[t,xe.PDF])),...["png"].map((t=>[t,xe.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,xe.POWERPOINT])),...["rar"].map((t=>[t,xe.RAR])),...["stp"].map((t=>[t,xe.STP])),...["txt","rtf","md","mdown"].map((t=>[t,xe.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,xe.VIDEO])),...["wav"].map((t=>[t,xe.WAV])),...["wma"].map((t=>[t,xe.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,xe.WORD])),...["xml","xsl","rdf"].map((t=>[t,xe.XML])),...["yaml","yml","x-yaml"].map((t=>[t,xe.YAML])),...["zip"].map((t=>[t,xe.ZIP]))]),me=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var $e,we=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}($e||($e={}));const ke={size:e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons"))};class Se extends e.FtLitElement{constructor(){super(...arguments),this.variant=$e.fluid_topics}getStyles(){return i.css`
|
|
362
|
+
:host {
|
|
363
|
+
display: inline-block;
|
|
364
|
+
}
|
|
375
365
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
font-style: normal;
|
|
382
|
-
font-variant: normal;
|
|
383
|
-
speak: none;
|
|
384
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
385
|
-
text-rendering: auto;
|
|
386
|
-
-webkit-font-smoothing: antialiased;
|
|
387
|
-
-moz-osx-font-smoothing: grayscale;
|
|
388
|
-
}
|
|
366
|
+
:host, i.ft-icon {
|
|
367
|
+
width: ${ke.size};
|
|
368
|
+
height: ${ke.size};
|
|
369
|
+
text-align: center;
|
|
370
|
+
}
|
|
389
371
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
372
|
+
i.ft-icon {
|
|
373
|
+
font-size: ${ke.size};
|
|
374
|
+
line-height: 1;
|
|
375
|
+
font-weight: normal;
|
|
376
|
+
text-transform: none;
|
|
377
|
+
font-style: normal;
|
|
378
|
+
font-variant: normal;
|
|
379
|
+
speak: none;
|
|
380
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
381
|
+
text-rendering: auto;
|
|
382
|
+
-webkit-font-smoothing: antialiased;
|
|
383
|
+
-moz-osx-font-smoothing: grayscale;
|
|
384
|
+
}
|
|
393
385
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
386
|
+
.ft-icon--fluid-topics {
|
|
387
|
+
font-family: ${ke.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
388
|
+
}
|
|
397
389
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
390
|
+
.ft-icon--file-format {
|
|
391
|
+
font-family: ${ke.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.ft-icon--material {
|
|
395
|
+
font-family: ${ke.materialFontFamily}, "Material Icons", sans-serif;
|
|
396
|
+
}
|
|
397
|
+
`}getTemplate(){return i.html`
|
|
398
|
+
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
399
|
+
${n.unsafeHTML(this.getIcon())}
|
|
400
|
+
<slot @slotchange=${()=>this.requestUpdate()} ?hidden=${"material"!==this.variant}></slot>
|
|
401
|
+
</i>
|
|
402
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}getIcon(){var t,e;let o=this.textContent;return this.variant===$e.file_format?null!==(t=xe[o.toUpperCase()])&&void 0!==t?t:o:this.variant===$e.fluid_topics?null!==(e=ge[o.toUpperCase()])&&void 0!==e?e:o:i.nothing}}Se.elementDefinitions={},we([o.property()],Se.prototype,"variant",void 0),we([o.query("slot")],Se.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Se);var ze=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Oe=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),Be={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:Oe,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",Nt.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",Oe),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},Ce=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),Ee={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:Ce,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",Ce)},Ie=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM));class De extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}static get styles(){return[e.noTextSelect,i.css`
|
|
402
403
|
:host {
|
|
403
404
|
display: inline-block;
|
|
404
405
|
max-width: 100%;
|
|
@@ -438,18 +439,18 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
438
439
|
border: none;
|
|
439
440
|
pointer-events: auto;
|
|
440
441
|
|
|
441
|
-
--ft-button-internal-font-size: ${
|
|
442
|
+
--ft-button-internal-font-size: ${Be.fontSize};
|
|
442
443
|
--ft-button-internal-line-height: calc(var(--ft-button-internal-font-size) + 2px);
|
|
443
|
-
--ft-button-internal-color: ${
|
|
444
|
-
${e.setVariable(ke.size,
|
|
444
|
+
--ft-button-internal-color: ${Be.color};
|
|
445
|
+
${e.setVariable(ke.size,Be.iconSize)};
|
|
445
446
|
--ft-button-internal-vertical-padding: 6px;
|
|
446
447
|
--ft-button-internal-horizontal-padding: 8px;
|
|
447
|
-
${e.setVariable(se.color,
|
|
448
|
-
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${
|
|
448
|
+
${e.setVariable(se.color,Be.rippleColor)};
|
|
449
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Be.iconSize});
|
|
449
450
|
|
|
450
|
-
border-radius: ${
|
|
451
|
+
border-radius: ${Be.borderRadius};
|
|
451
452
|
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
452
|
-
background-color: ${
|
|
453
|
+
background-color: ${Be.backgroundColor};
|
|
453
454
|
color: var(--ft-button-internal-color);
|
|
454
455
|
-webkit-mask-image: radial-gradient(white, black);
|
|
455
456
|
}
|
|
@@ -470,7 +471,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
470
471
|
|
|
471
472
|
.ft-button[disabled] {
|
|
472
473
|
filter: grayscale(1);
|
|
473
|
-
opacity: ${
|
|
474
|
+
opacity: ${Be.opacityDisabled};
|
|
474
475
|
}
|
|
475
476
|
|
|
476
477
|
.ft-button.ft-button--primary {
|
|
@@ -495,8 +496,8 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
495
496
|
text-overflow: ellipsis;
|
|
496
497
|
display: block;
|
|
497
498
|
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
498
|
-
${e.setVariable(
|
|
499
|
-
${e.setVariable(
|
|
499
|
+
${e.setVariable(Nt.fontSize,"var(--ft-button-internal-font-size)")};
|
|
500
|
+
${e.setVariable(Nt.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
500
501
|
}
|
|
501
502
|
|
|
502
503
|
.ft-button--safari-fix .ft-button--label {
|
|
@@ -529,7 +530,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
529
530
|
}
|
|
530
531
|
|
|
531
532
|
ft-loader {
|
|
532
|
-
${e.setVariable(be.size,
|
|
533
|
+
${e.setVariable(be.size,Be.iconSize)};
|
|
533
534
|
${e.setVariable(be.color,"var(--ft-button-internal-color)")};
|
|
534
535
|
}
|
|
535
536
|
`]}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-button--safari-fix":e.isSafari,"ft-no-text-select":!0};return this.addTooltip(i.html`
|
|
@@ -554,7 +555,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
554
555
|
</ft-tooltip>
|
|
555
556
|
`}resolveIcon(){return this.loading?i.html`
|
|
556
557
|
<ft-loader></ft-loader> `:this.icon?i.html`
|
|
557
|
-
<ft-icon variant="material">${this.icon}</ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
558
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}De.elementDefinitions={"ft-ripple":pe,"ft-tooltip":ue,"ft-typography":Yt,"ft-icon":Se,"ft-loader":ve},ze([o.property({type:Boolean})],De.prototype,"primary",void 0),ze([o.property({type:Boolean})],De.prototype,"outlined",void 0),ze([o.property({type:Boolean})],De.prototype,"disabled",void 0),ze([o.property({type:Boolean})],De.prototype,"dense",void 0),ze([o.property({type:Boolean})],De.prototype,"round",void 0),ze([o.property({type:String})],De.prototype,"label",void 0),ze([o.property({type:String})],De.prototype,"icon",void 0),ze([o.property({type:Boolean})],De.prototype,"trailingIcon",void 0),ze([o.property({type:Boolean})],De.prototype,"loading",void 0),ze([o.property({type:String})],De.prototype,"tooltipPosition",void 0),ze([o.query(".ft-button")],De.prototype,"button",void 0),ze([o.query(".ft-button--label slot")],De.prototype,"slottedContent",void 0),e.customElement("ft-button")(De);var Fe=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Le=e.FtCssVariableFactory.extend("--ft-checkbox-text-color",e.designSystemVariables.colorOnSurfaceHigh),je=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Me=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),Pe=e.FtCssVariableFactory.extend("--ft-checkbox-border-color",e.designSystemVariables.colorOnSurfaceMedium),Ae=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system");class Te extends e.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 i.html`
|
|
558
559
|
<label class="${r.classMap(t)}" for="checkbox-input">
|
|
559
560
|
<div class="ft-checkbox--box-container">
|
|
560
561
|
<ft-ripple
|
|
@@ -587,7 +588,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
587
588
|
|
|
588
589
|
.ft-checkbox {
|
|
589
590
|
box-sizing: border-box;
|
|
590
|
-
color: ${
|
|
591
|
+
color: ${Le};
|
|
591
592
|
|
|
592
593
|
display: inline-flex;
|
|
593
594
|
align-items: center;
|
|
@@ -657,7 +658,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
657
658
|
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
658
659
|
opacity: 1;
|
|
659
660
|
}
|
|
660
|
-
`,
|
|
661
|
+
`,Fe([o.property()],Te.prototype,"name",void 0),Fe([o.property({type:Boolean,reflect:!0})],Te.prototype,"checked",void 0),Fe([o.property({type:Boolean})],Te.prototype,"indeterminate",void 0),Fe([o.property({type:Boolean})],Te.prototype,"disabled",void 0),Fe([o.query(".ft-checkbox")],Te.prototype,"container",void 0),Fe([o.query("ft-ripple")],Te.prototype,"ripple",void 0),e.customElement("ft-checkbox")(Te);var Re=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Ne=e.FtCssVariableFactory.extend("--ft-radio-text-color",e.designSystemVariables.colorOnSurfaceHigh),Ze=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Ue=(e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),e.FtCssVariableFactory.extend("--ft-radio-border-color",e.designSystemVariables.colorOnSurfaceMedium)),_e=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system");class He extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class Ve extends e.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 i.html`
|
|
661
662
|
<div class="${r.classMap(t)}">
|
|
662
663
|
<div class="ft-radio--box-container">
|
|
663
664
|
<ft-ripple
|
|
@@ -689,7 +690,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
689
690
|
|
|
690
691
|
.ft-radio {
|
|
691
692
|
box-sizing: border-box;
|
|
692
|
-
color: ${
|
|
693
|
+
color: ${Ne};
|
|
693
694
|
|
|
694
695
|
display: inline-flex;
|
|
695
696
|
align-items: center;
|
|
@@ -761,7 +762,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
761
762
|
.ft-radio--disabled .ft-radio--box:after {
|
|
762
763
|
background-color: ${_e};
|
|
763
764
|
}
|
|
764
|
-
`,
|
|
765
|
+
`,Re([o.property()],Ve.prototype,"value",void 0),Re([o.property()],Ve.prototype,"name",void 0),Re([o.property({type:Boolean,reflect:!0})],Ve.prototype,"checked",void 0),Re([o.property({type:Boolean})],Ve.prototype,"disabled",void 0),Re([o.query(".ft-radio")],Ve.prototype,"container",void 0),Re([o.query("ft-ripple")],Ve.prototype,"ripple",void 0),Re([o.query("input")],Ve.prototype,"input",void 0);var Ke=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class qe extends e.FtLitElement{constructor(){super(...arguments),this.name=""}render(){return i.html`
|
|
765
766
|
<slot @slotchange=${this.onSlotChange}
|
|
766
767
|
@change=${this.onChange}
|
|
767
768
|
@keydown=${this.onKeyDown}
|
|
@@ -771,7 +772,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
771
772
|
:host {
|
|
772
773
|
display: contents;
|
|
773
774
|
}
|
|
774
|
-
`,Ke([o.property()],qe.prototype,"name",void 0),Ke([o.queryAssignedElements()],qe.prototype,"radioButtons",void 0),e.customElement("ft-radio")(Ve),e.customElement("ft-radio-group")(qe);var We=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Ge={borderRadiusM:e.
|
|
775
|
+
`,Ke([o.property()],qe.prototype,"name",void 0),Ke([o.queryAssignedElements()],qe.prototype,"radioButtons",void 0),e.customElement("ft-radio")(Ve),e.customElement("ft-radio-group")(qe);var We=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Ge={borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:e.FtCssVariableFactory.external(Ot.fontFamily,"Body2 typography"),fontSize:e.FtCssVariableFactory.external(Ot.fontSize,"Body2 typography"),fontWeight:e.FtCssVariableFactory.external(Ot.fontWeight,"Body2 typography"),letterSpacing:e.FtCssVariableFactory.external(Ot.letterSpacing,"Body2 typography"),lineHeight:e.FtCssVariableFactory.external(Ot.lineHeight,"Body2 typography"),textTransform:e.FtCssVariableFactory.external(Ot.textTransform,"Body2 typography")};class Xe extends e.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,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e: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 e=t.slice(0,this.limit);return i.html`
|
|
775
776
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
776
777
|
${null==this.parent?null:i.html`
|
|
777
778
|
<div tabindex="0"
|
|
@@ -835,7 +836,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
835
836
|
@change=${t=>t.stopPropagation()}>
|
|
836
837
|
${t.label}
|
|
837
838
|
</ft-radio>
|
|
838
|
-
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}Xe.elementDefinitions={"ft-button":
|
|
839
|
+
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}Xe.elementDefinitions={"ft-button":De,"ft-ripple":pe,"ft-typography":Yt,"ft-checkbox":Te,"ft-icon":Se,"ft-radio":Ve},Xe.styles=[i.css`
|
|
839
840
|
.ft-filter-level--container {
|
|
840
841
|
display: flex;
|
|
841
842
|
flex-direction: column;
|
|
@@ -885,7 +886,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
885
886
|
}
|
|
886
887
|
|
|
887
888
|
ft-button {
|
|
888
|
-
${e.setVariable(
|
|
889
|
+
${e.setVariable(Be.color,Ge.colorOnSurface)};
|
|
889
890
|
}
|
|
890
891
|
|
|
891
892
|
ft-radio, ft-checkbox {
|
|
@@ -901,7 +902,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
901
902
|
margin: 10px 0;
|
|
902
903
|
color: ${Ge.colorOnSurfaceMedium};
|
|
903
904
|
}
|
|
904
|
-
`],We([o.property({type:String})],Xe.prototype,"id",void 0),We([o.property({type:Object})],Xe.prototype,"parent",void 0),We([o.property({type:Array})],Xe.prototype,"options",void 0),We([o.property({type:Boolean})],Xe.prototype,"multivalued",void 0),We([o.property({type:Boolean})],Xe.prototype,"disabled",void 0),We([o.property({type:Boolean})],Xe.prototype,"hideSelectedOptions",void 0),We([o.property({type:Boolean})],Xe.prototype,"preventNavigation",void 0),We([o.property({type:String})],Xe.prototype,"filter",void 0),We([o.property({type:String})],Xe.prototype,"moreValuesButtonLabel",void 0),We([o.property({type:String})],Xe.prototype,"noValuesLabel",void 0),We([o.property({type:Number})],Xe.prototype,"displayedValuesLimit",void 0),We([o.query(".ft-filter-level--container")],Xe.prototype,"container",void 0),We([o.state()],Xe.prototype,"displayedPages",void 0);var Ye=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Je={buttonsColor:e.
|
|
905
|
+
`],We([o.property({type:String})],Xe.prototype,"id",void 0),We([o.property({type:Object})],Xe.prototype,"parent",void 0),We([o.property({type:Array})],Xe.prototype,"options",void 0),We([o.property({type:Boolean})],Xe.prototype,"multivalued",void 0),We([o.property({type:Boolean})],Xe.prototype,"disabled",void 0),We([o.property({type:Boolean})],Xe.prototype,"hideSelectedOptions",void 0),We([o.property({type:Boolean})],Xe.prototype,"preventNavigation",void 0),We([o.property({type:String})],Xe.prototype,"filter",void 0),We([o.property({type:String})],Xe.prototype,"moreValuesButtonLabel",void 0),We([o.property({type:String})],Xe.prototype,"noValuesLabel",void 0),We([o.property({type:Number})],Xe.prototype,"displayedValuesLimit",void 0),We([o.query(".ft-filter-level--container")],Xe.prototype,"container",void 0),We([o.state()],Xe.prototype,"displayedPages",void 0);var Ye=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Je={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")};class Qe extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class ti extends e.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 e.Debouncer(200),this.updateScrollDebouncer=new e.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,i=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<i||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}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=r.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":e.isSafari}),o=this.controls&&this.withScroll;return i.html`
|
|
905
906
|
<div part="container" class="${t}">
|
|
906
907
|
<ft-button
|
|
907
908
|
class="ft-snap-scroll--previous"
|
|
@@ -925,7 +926,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
925
926
|
@click=${this.next}
|
|
926
927
|
></ft-button>
|
|
927
928
|
</div>
|
|
928
|
-
`}updated(t){var e;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===(e=this.listenedContainer)||void 0===e||e.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 Qe(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);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 e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}ti.elementDefinitions={"ft-button":
|
|
929
|
+
`}updated(t){var e;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===(e=this.listenedContainer)||void 0===e||e.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 Qe(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);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 e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}ti.elementDefinitions={"ft-button":De},ti.styles=i.css`
|
|
929
930
|
.ft-snap-scroll {
|
|
930
931
|
box-sizing: border-box;
|
|
931
932
|
position: relative;
|
|
@@ -1006,8 +1007,8 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1006
1007
|
z-index: ${Je.buttonsZIndex};
|
|
1007
1008
|
opacity: 1;
|
|
1008
1009
|
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
1009
|
-
${e.setVariable(
|
|
1010
|
-
${e.setVariable(
|
|
1010
|
+
${e.setVariable(Be.backgroundColor,"transparent")};
|
|
1011
|
+
${e.setVariable(Be.color,Je.buttonsColor)};
|
|
1011
1012
|
}
|
|
1012
1013
|
|
|
1013
1014
|
.ft-snap-scroll--previous[hidden],
|
|
@@ -1050,7 +1051,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1050
1051
|
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1051
1052
|
background-color: ${Je.colorSurface};
|
|
1052
1053
|
}
|
|
1053
|
-
`,Ye([o.property({type:Boolean})],ti.prototype,"horizontal",void 0),Ye([o.property({type:Boolean})],ti.prototype,"hideScrollbar",void 0),Ye([o.property({type:Boolean})],ti.prototype,"controls",void 0),Ye([o.property({type:Boolean})],ti.prototype,"limitSize",void 0),Ye([o.state()],ti.prototype,"elements",void 0),Ye([o.state()],ti.prototype,"currentElement",void 0),Ye([o.state()],ti.prototype,"withScroll",void 0),Ye([o.state()],ti.prototype,"startReached",void 0),Ye([o.state()],ti.prototype,"endReached",void 0),Ye([o.query(".ft-snap-scroll--content")],ti.prototype,"contentSlot",void 0),e.customElement("ft-snap-scroll")(ti);var ei=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const ii=e.
|
|
1054
|
+
`,Ye([o.property({type:Boolean})],ti.prototype,"horizontal",void 0),Ye([o.property({type:Boolean})],ti.prototype,"hideScrollbar",void 0),Ye([o.property({type:Boolean})],ti.prototype,"controls",void 0),Ye([o.property({type:Boolean})],ti.prototype,"limitSize",void 0),Ye([o.state()],ti.prototype,"elements",void 0),Ye([o.state()],ti.prototype,"currentElement",void 0),Ye([o.state()],ti.prototype,"withScroll",void 0),Ye([o.state()],ti.prototype,"startReached",void 0),Ye([o.state()],ti.prototype,"endReached",void 0),Ye([o.query(".ft-snap-scroll--content")],ti.prototype,"contentSlot",void 0),e.customElement("ft-snap-scroll")(ti);var ei=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const ii=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),oi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),si=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),ri=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),ni=e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),li=e.FtCssVariableFactory.external(e.designSystemVariables.transitionDuration,"Design system"),ai=e.FtCssVariableFactory.external(e.designSystemVariables.transitionTimingFunction,"Design system");class ci extends CustomEvent{constructor(t){super("change",{detail:t})}}class hi extends e.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.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e.Debouncer(300),this.changeDebouncer=new e.Debouncer(10)}get flatOptions(){return Jt(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}render(){var t,e;const o=this.flatOptions.some((t=>t.selected));let s=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e;return i.html`
|
|
1054
1055
|
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1055
1056
|
part="container">
|
|
1056
1057
|
${this.label||o?i.html`
|
|
@@ -1119,7 +1120,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1119
1120
|
.exportpartsPrefixes=${["values","available-values"]}
|
|
1120
1121
|
noValuesLabel="${this.noValuesLabel}"
|
|
1121
1122
|
></ft-filter-level>
|
|
1122
|
-
`}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 e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new ci(e)),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,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}hi.elementDefinitions={"ft-button":
|
|
1123
|
+
`}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 e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new ci(e)),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,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}hi.elementDefinitions={"ft-button":De,"ft-filter-level":Xe,"ft-snap-scroll":ti,"ft-typography":Yt},hi.styles=[qt,i.css`
|
|
1123
1124
|
:host {
|
|
1124
1125
|
display: flex;
|
|
1125
1126
|
max-height: 100%;
|
|
@@ -1148,7 +1149,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1148
1149
|
.ft-filter--header ft-button {
|
|
1149
1150
|
flex-shrink: 0;
|
|
1150
1151
|
margin-left: auto;
|
|
1151
|
-
${e.setVariable(
|
|
1152
|
+
${e.setVariable(Be.iconSize,"18px")};
|
|
1152
1153
|
}
|
|
1153
1154
|
|
|
1154
1155
|
.ft-filter--label {
|
|
@@ -1237,7 +1238,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1237
1238
|
.ft-accordion {
|
|
1238
1239
|
box-sizing: border-box;
|
|
1239
1240
|
}
|
|
1240
|
-
`,di([o.property({type:Boolean})],ui.prototype,"multi",void 0),di([o.query("slot")],ui.prototype,"content",void 0);var bi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const vi=e.
|
|
1241
|
+
`,di([o.property({type:Boolean})],ui.prototype,"multi",void 0),di([o.query("slot")],ui.prototype,"content",void 0);var bi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const vi=e.FtCssVariableFactory.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),gi=e.FtCssVariableFactory.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),xi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system");class yi extends e.FtLitElement{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return i.html`
|
|
1241
1242
|
<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}">
|
|
1242
1243
|
<div class="ft-accordion-item--toggle"
|
|
1243
1244
|
part="toggle"
|
|
@@ -1306,7 +1307,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1306
1307
|
.ft-accordion-item--separator {
|
|
1307
1308
|
border-bottom: 1px solid ${xi};
|
|
1308
1309
|
}
|
|
1309
|
-
`,bi([o.property({type:String})],yi.prototype,"icon",void 0),bi([o.property({type:String})],yi.prototype,"label",void 0),bi([o.property({type:Boolean,reflect:!0})],yi.prototype,"active",void 0),e.customElement("ft-accordion")(ui),e.customElement("ft-accordion-item")(yi);var mi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const $i=e.
|
|
1310
|
+
`,bi([o.property({type:String})],yi.prototype,"icon",void 0),bi([o.property({type:String})],yi.prototype,"label",void 0),bi([o.property({type:Boolean,reflect:!0})],yi.prototype,"active",void 0),e.customElement("ft-accordion")(ui),e.customElement("ft-accordion-item")(yi);var mi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const $i=e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnSurface),wi={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorSurface),color:$i,fontSize:e.FtCssVariableFactory.extend("--ft-chip-font-size",Ot.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:e.FtCssVariableFactory.extend("--ft-chip-ripple-color",$i),horizontalPadding:e.FtCssVariableFactory.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:e.FtCssVariableFactory.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},ki=e.FtCssVariableFactory.extend("--ft-chip-highlighted-color",e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnPrimary)),Si={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-background-color",e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorPrimary)),color:ki,rippleColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-ripple-color",ki)},zi=e.FtCssVariableFactory.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),Oi=e.FtCssVariableFactory.create("--ft-chip-dense-vertical-padding","SIZE","4px");class Bi extends CustomEvent{constructor(){super("icon-click")}}class Ci extends e.FtLitElement{constructor(){super(...arguments),this.highlighted=!1,this.removable=!1,this.disabled=!1,this.clickable=!1,this.iconClickable=!1,this.dense=!1,this.multiLine=!1,this.label="",this.icon=void 0,this.trailingIcon=!1}static get styles(){return[e.noTextSelect,i.css`
|
|
1310
1311
|
:host {
|
|
1311
1312
|
display: inline-block;
|
|
1312
1313
|
max-width: 100%;
|
|
@@ -1455,7 +1456,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1455
1456
|
<ft-ripple ?disabled=${!this.interactionsOnIcon}></ft-ripple>
|
|
1456
1457
|
<ft-icon variant="material">${this.internalIcon}</ft-icon>
|
|
1457
1458
|
</div>
|
|
1458
|
-
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new
|
|
1459
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new Bi))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new Bi))}getLabel(){return this.label||this.textContent}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}get internalIcon(){return this.icon||(this.removable?"cancel":void 0)}}Ci.elementDefinitions={"ft-ripple":pe,"ft-typography":Yt,"ft-icon":Se},mi([o.property({type:Boolean})],Ci.prototype,"highlighted",void 0),mi([o.property({type:Boolean})],Ci.prototype,"removable",void 0),mi([o.property({type:Boolean})],Ci.prototype,"disabled",void 0),mi([o.property({type:Boolean})],Ci.prototype,"clickable",void 0),mi([o.property({type:Boolean})],Ci.prototype,"iconClickable",void 0),mi([o.property({type:Boolean})],Ci.prototype,"dense",void 0),mi([o.property({type:Boolean})],Ci.prototype,"multiLine",void 0),mi([o.property({type:String})],Ci.prototype,"label",void 0),mi([o.property({type:String})],Ci.prototype,"icon",void 0),mi([o.property({type:Boolean})],Ci.prototype,"trailingIcon",void 0),mi([o.query("ft-typography slot")],Ci.prototype,"slottedContent",void 0),e.customElement("ft-chip")(Ci);var Ei=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Ii={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")};class Di extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return i.html`
|
|
1459
1460
|
<div class="${r.classMap(t)}">
|
|
1460
1461
|
${this.text?i.html`
|
|
1461
1462
|
<div class="ft-input-label--text ft-typography--caption">
|
|
@@ -1464,7 +1465,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1464
1465
|
</div>
|
|
1465
1466
|
`:null}
|
|
1466
1467
|
</div>
|
|
1467
|
-
`}}
|
|
1468
|
+
`}}Di.elementDefinitions={},Di.styles=[qt,i.css`
|
|
1468
1469
|
.ft-input-label {
|
|
1469
1470
|
position: absolute;
|
|
1470
1471
|
inset: 0;
|
|
@@ -1513,8 +1514,8 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1513
1514
|
border-color: inherit;
|
|
1514
1515
|
color: ${Ii.textColor};
|
|
1515
1516
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1516
|
-
${e.setVariable(
|
|
1517
|
-
${e.setVariable(
|
|
1517
|
+
${e.setVariable(Bt.fontSize,Ii.fontSize)};
|
|
1518
|
+
${e.setVariable(Bt.lineHeight,Ii.fontSize)};
|
|
1518
1519
|
}
|
|
1519
1520
|
|
|
1520
1521
|
.ft-input-label--in-error .ft-input-label--text {
|
|
@@ -1542,8 +1543,8 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1542
1543
|
}
|
|
1543
1544
|
|
|
1544
1545
|
.ft-input-label--raised .ft-input-label--text {
|
|
1545
|
-
${e.setVariable(
|
|
1546
|
-
${e.setVariable(
|
|
1546
|
+
${e.setVariable(Bt.fontSize,Ii.raisedFontSize)};
|
|
1547
|
+
${e.setVariable(Bt.lineHeight,Ii.raisedFontSize)};
|
|
1547
1548
|
}
|
|
1548
1549
|
|
|
1549
1550
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
@@ -1580,7 +1581,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1580
1581
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
1581
1582
|
border-top: none;
|
|
1582
1583
|
}
|
|
1583
|
-
`],Ei([o.property({type:String})],
|
|
1584
|
+
`],Ei([o.property({type:String})],Di.prototype,"text",void 0),Ei([o.property({type:Boolean})],Di.prototype,"raised",void 0),Ei([o.property({type:Boolean})],Di.prototype,"outlined",void 0),Ei([o.property({type:Boolean})],Di.prototype,"disabled",void 0),Ei([o.property({type:Boolean})],Di.prototype,"error",void 0),e.customElement("ft-input-label")(Di);var Fi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Li extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}render(){return i.html``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Li.elementDefinitions={},Fi([o.property({type:String})],Li.prototype,"label",void 0),Fi([o.property({type:Object,converter:t=>t})],Li.prototype,"value",void 0),Fi([o.property({type:Boolean,reflect:!0})],Li.prototype,"selected",void 0);const ji={labelSize:e.FtCssVariableFactory.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:e.FtCssVariableFactory.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-select-vertical-spacing","SIZE","4px"),optionsHeight:e.FtCssVariableFactory.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:e.FtCssVariableFactory.extend("--ft-select-selected-option-color",e.designSystemVariables.colorOnSurface),helperColor:e.FtCssVariableFactory.extend("--ft-select-helper-color",e.designSystemVariables.colorOnSurfaceMedium),optionsColor:e.FtCssVariableFactory.extend("--ft-select-options-color",e.designSystemVariables.colorOnSurface),optionsZIndex:e.FtCssVariableFactory.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")};class Mi extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.options=[],this.optionsDisplayed=!1,this.focusOptions=!1,this.hideOptions=t=>this.optionsDisplayed=this.optionsDisplayed&&t.composedPath().includes(this.container)}render(){var t,e,o,n,l;let a=this.hasOptionsMenuOpen,c=this.disabled||!this.hasOptions;const h=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(o=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==o?o:"").length>0,p={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":c,"ft-select--options-displayed":a,"ft-select--has-option-selected":h,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return i.html`
|
|
1584
1585
|
<div class="${r.classMap(p)}" part="container">
|
|
1585
1586
|
<div class="ft-select--main-panel" part="main-panel">
|
|
1586
1587
|
<ft-input-label text="${this.label}"
|
|
@@ -1628,7 +1629,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1628
1629
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
1629
1630
|
${t.label}
|
|
1630
1631
|
</div>
|
|
1631
|
-
`}updated(t){var e;super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1,this.dispatchEvent(new CustomEvent("change",{detail:null===(e=this.selectedOption)||void 0===e?void 0:e.value}))),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.minWidth=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,r;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Mi.elementDefinitions={"ft-input-label":
|
|
1632
|
+
`}updated(t){var e;super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1,this.dispatchEvent(new CustomEvent("change",{detail:null===(e=this.selectedOption)||void 0===e?void 0:e.value}))),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.minWidth=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,r;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Mi.elementDefinitions={"ft-input-label":Di,"ft-typography":Yt,"ft-ripple":pe,"ft-icon":Se},Mi.styles=[Kt,qt,i.css`
|
|
1632
1633
|
*:focus {
|
|
1633
1634
|
outline: none;
|
|
1634
1635
|
}
|
|
@@ -1770,7 +1771,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1770
1771
|
.ft-select--in-error .ft-select--helper-text {
|
|
1771
1772
|
color: ${ji.colorError};
|
|
1772
1773
|
}
|
|
1773
|
-
`],
|
|
1774
|
+
`],Fi([o.property({type:String})],Mi.prototype,"label",void 0),Fi([o.property({type:String})],Mi.prototype,"helper",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"outlined",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"disabled",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"error",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"fixedMenuPosition",void 0),Fi([o.property({type:Array})],Mi.prototype,"options",void 0),Fi([o.state()],Mi.prototype,"selectedOption",void 0),Fi([o.state()],Mi.prototype,"optionsDisplayed",void 0),Fi([o.state()],Mi.prototype,"focusOptions",void 0),Fi([o.query(".ft-select")],Mi.prototype,"container",void 0),Fi([o.query(".ft-select--options")],Mi.prototype,"optionsMenu",void 0),Fi([o.query(".ft-select--input-panel")],Mi.prototype,"mainPanel",void 0),Fi([o.query(".ft-select--option:first-child")],Mi.prototype,"firstOption",void 0),Fi([o.query(".ft-select--option:focus")],Mi.prototype,"focusedOption",void 0),Fi([o.query(".ft-select--option.ft-select--option-selected")],Mi.prototype,"selectedOptionElement",void 0),Fi([o.query(".ft-select--option:last-child")],Mi.prototype,"lastOption",void 0),Fi([o.query("slot")],Mi.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Mi),e.customElement("ft-select-option")(Li);const Pi={display:e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),width:e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),height:e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system")};class Ai extends e.FtLitElement{render(){return i.html`
|
|
1774
1775
|
`}}Ai.elementDefinitions={},Ai.styles=i.css`
|
|
1775
1776
|
:host {
|
|
1776
1777
|
width: ${Pi.width};
|
|
@@ -1798,7 +1799,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1798
1799
|
background-position: calc(100vw + ${Pi.glareWidth}) 0, calc(${Pi.glareWidth} * -1) 0;
|
|
1799
1800
|
}
|
|
1800
1801
|
}
|
|
1801
|
-
`,e.customElement("ft-skeleton")(Ai);const Ti={height:e.
|
|
1802
|
+
`,e.customElement("ft-skeleton")(Ai);const Ti={height:e.FtCssVariableFactory.create("--ft-search-bar-height","SIZE","38px"),borderRadius:e.FtCssVariableFactory.extend("--ft-search-bar-border-radius",e.designSystemVariables.borderRadiusS),mobileOpenPosition:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-position","POSITION","fixed"),mobileOpenTop:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-top","SIZE","0"),mobileOpenBottom:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-bottom","SIZE","0"),mobileOpenLeft:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-left","SIZE","0"),mobileOpenRight:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-right","SIZE","0"),desktopFiltersHeight:e.FtCssVariableFactory.create("--ft-search-bar-desktop-filters-height","SIZE","350px"),floatingZIndex:e.FtCssVariableFactory.create("--ft-search-bar-floating-components-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),buttonColor:e.FtCssVariableFactory.external(Be.color,"Button"),buttonRippleColor:e.FtCssVariableFactory.external(Be.rippleColor,"Button")},Ri=i.css`
|
|
1802
1803
|
* {
|
|
1803
1804
|
box-sizing: border-box;
|
|
1804
1805
|
}
|
|
@@ -1910,7 +1911,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1910
1911
|
}
|
|
1911
1912
|
|
|
1912
1913
|
.ft-search-bar--left-action {
|
|
1913
|
-
${e.setVariable(
|
|
1914
|
+
${e.setVariable(Be.borderRadius,i.css`calc(${Ti.borderRadius} - 1px) 0 0 calc(${Ti.borderRadius} - 1px)`)};
|
|
1914
1915
|
border-right: 1px solid ${Ti.colorOutline};
|
|
1915
1916
|
height: 100%;
|
|
1916
1917
|
}
|
|
@@ -1920,7 +1921,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1920
1921
|
}
|
|
1921
1922
|
|
|
1922
1923
|
.ft-search-bar--floating-panel-open .ft-search-bar--left-action {
|
|
1923
|
-
${e.setVariable(
|
|
1924
|
+
${e.setVariable(Be.borderRadius,i.css`calc(${Ti.borderRadius} - 1px) 0 0 0`)};
|
|
1924
1925
|
}
|
|
1925
1926
|
|
|
1926
1927
|
.ft-search-bar .ft-search-bar--launch-search,
|
|
@@ -1956,7 +1957,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
1956
1957
|
border-radius: calc(${Ti.borderRadius} - 1px) 0 0 calc(${Ti.borderRadius} - 1px);
|
|
1957
1958
|
}
|
|
1958
1959
|
|
|
1959
|
-
`,
|
|
1960
|
+
`,Ni=i.css`
|
|
1960
1961
|
.ft-search-bar--desktop-menu .ft-search-bar--presets {
|
|
1961
1962
|
margin-right: auto;
|
|
1962
1963
|
}
|
|
@@ -2086,172 +2087,324 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
2086
2087
|
.ft-search-bar--desktop-menu .ft-search-bar--launch-search {
|
|
2087
2088
|
margin: 0;
|
|
2088
2089
|
}
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2090
|
+
`;class Zi{constructor(t,i=300){this.searchBar=t,this.updateDebouncer=new e.Debouncer(i)}render(){const t=this.searchBar.recentSearches.filter((t=>t.toLowerCase().includes(this.searchBar.query.toLowerCase()))),e=this.searchBar.suggestions.length>0||t.length>0;return i.html`
|
|
2091
|
+
<div class="ft-search-bar--suggestions ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2092
|
+
part="suggestions-container"
|
|
2093
|
+
@keydown=${t=>this.onSuggestKeyDown(t)}>
|
|
2094
|
+
${s.repeat(t.slice(0,5),(t=>t),(t=>i.html`
|
|
2095
|
+
<a href="${this.searchBar.searchRequestSerializer({...this.searchBar.request,query:t})}"
|
|
2096
|
+
part="suggestions"
|
|
2097
|
+
class="ft-search-bar--suggestion ft-search-bar--recent-search"
|
|
2098
|
+
@keyup=${e=>this.onSuggestKeyUp(e,t)}
|
|
2099
|
+
@click=${e=>this.onSuggestClick(e,t)}>
|
|
2100
|
+
<ft-ripple></ft-ripple>
|
|
2101
|
+
<ft-icon variant="material" part="suggestion-icon">history</ft-icon>
|
|
2102
|
+
<ft-typography variant="body1">${t}</ft-typography>
|
|
2103
|
+
<ft-button icon="close"
|
|
2104
|
+
round
|
|
2105
|
+
part="remove-suggestion"
|
|
2106
|
+
?dense=${!this.searchBar.isMobile}
|
|
2107
|
+
label="${this.searchBar.labelResolver.resolve("removeRecentSearch")}"
|
|
2108
|
+
tooltipPosition="left"
|
|
2109
|
+
@click=${e=>this.removeRecentSearch(e,t)}></ft-button>
|
|
2110
|
+
</a>
|
|
2111
|
+
`))}
|
|
2112
|
+
${s.repeat(this.searchBar.suggestions,(t=>t.value),(t=>i.html`
|
|
2113
|
+
<a href="${this.searchBar.searchRequestSerializer({...this.searchBar.request,query:t.value})}"
|
|
2114
|
+
part="suggestions"
|
|
2115
|
+
class="ft-search-bar--suggestion"
|
|
2116
|
+
@keyup=${e=>this.onSuggestKeyUp(e,t.value)}
|
|
2117
|
+
@click=${e=>this.onSuggestClick(e,t.value)}>
|
|
2118
|
+
<ft-ripple></ft-ripple>
|
|
2119
|
+
${this.getIcon(t)}
|
|
2120
|
+
<ft-typography variant="body1">${t.value}</ft-typography>
|
|
2121
|
+
</a>
|
|
2122
|
+
`))}
|
|
2123
|
+
</div>
|
|
2124
|
+
`}update(){return new Promise(((t,e)=>{this.updateDebouncer.run((async()=>{this.searchBar.suggestions=this.searchBar.api&&this.searchBar.query.length>2?await this.searchBar.api.getSuggestions(this.searchBar.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],t()}))}))}onSuggestKeyDown(t){var e,i,o,s,r,n;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.getFocusedSuggestionElement())||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.getLastSuggestionElement())||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(n=null!==(r=null===(s=this.getFocusedSuggestionElement())||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.getFirstSuggestionElement())||void 0===n||n.focus(),t.preventDefault(),t.stopPropagation()}}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.searchBar.setQuery(e),this.searchBar.launchSearch()}removeRecentSearch(t,e){var i,o;t.preventDefault(),t.stopPropagation();let s=t.target.closest(".ft-search-bar--suggestion");const r=null!==(o=null!==(i=null==s?void 0:s.previousElementSibling)&&void 0!==i?i:null==s?void 0:s.nextElementSibling)&&void 0!==o?o:this.searchBar.input;null==r||r.focus(),this.searchBar.recentSearches=this.searchBar.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.searchBar.saveRecentSearches()}getIcon(t){const e="DOCUMENT"===t.type?$e.file_format:$e.fluid_topics;let o;switch(t.type){case"MAP":o="BOOK"===t.editorialType?ge.BOOK:ge.ARTICLE;break;case"DOCUMENT":o=function(t,e){var i,o,s,r;t=(null!=t?t:"").toLowerCase(),e=(null!=e?e:"").toLowerCase();const[n,l]=((null!==(i=me.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(r=null!==(s=null!==(o=ye.get(l))&&void 0!==o?o:ye.get(e))&&void 0!==s?s:ye.get(n))&&void 0!==r?r:xe.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":o=ge.TOPICS}return i.html`
|
|
2125
|
+
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2126
|
+
${o}
|
|
2127
|
+
</ft-icon>
|
|
2128
|
+
`}getFocusedSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion:focus-within")}getLastSuggestionElement(){let t=this.searchBar.querySelectorAll(".ft-search-bar--suggestion");return t.length>0?t[t.length-1]:null}getFirstSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion")}focusFirstSuggestion(){var t;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}}Zi.styles=i.css`
|
|
2129
|
+
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2130
|
+
flex-grow: 1;
|
|
2131
|
+
flex-shrink: 1;
|
|
2132
|
+
overflow-y: auto;
|
|
2133
|
+
height: 0;
|
|
2134
|
+
}
|
|
2097
2135
|
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
}
|
|
2136
|
+
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2137
|
+
border-top: 1px solid ${Ti.colorOutline};
|
|
2138
|
+
}
|
|
2102
2139
|
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2140
|
+
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2141
|
+
height: initial;
|
|
2142
|
+
}
|
|
2106
2143
|
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2144
|
+
.ft-search-bar--floating-panel,
|
|
2145
|
+
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2146
|
+
position: absolute;
|
|
2147
|
+
z-index: ${Ti.floatingZIndex};
|
|
2148
|
+
top: 100%;
|
|
2149
|
+
left: -1px;
|
|
2150
|
+
right: -1px;
|
|
2151
|
+
display: none;
|
|
2152
|
+
background: ${Ti.colorSurface};
|
|
2153
|
+
border: 1px solid ${Ti.colorOutline};
|
|
2154
|
+
border-radius: 0 0 ${Ti.borderRadius} ${Ti.borderRadius};
|
|
2155
|
+
box-shadow: ${Ti.elevation02};
|
|
2156
|
+
outline: none;
|
|
2157
|
+
}
|
|
2111
2158
|
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2159
|
+
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2160
|
+
top: calc(100% + 2px);
|
|
2161
|
+
}
|
|
2115
2162
|
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
`,Ui=i.css`
|
|
2120
|
-
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2121
|
-
flex-grow: 1;
|
|
2122
|
-
flex-shrink: 1;
|
|
2123
|
-
overflow-y: auto;
|
|
2124
|
-
height: 0;
|
|
2125
|
-
}
|
|
2163
|
+
.ft-search-bar--input-container:focus-within .ft-search-bar--suggestions-not-empty {
|
|
2164
|
+
display: block;
|
|
2165
|
+
}
|
|
2126
2166
|
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2167
|
+
.ft-search-bar--suggestion {
|
|
2168
|
+
text-decoration: none;
|
|
2169
|
+
position: relative;
|
|
2170
|
+
display: flex;
|
|
2171
|
+
align-items: center;
|
|
2172
|
+
padding: 8px;
|
|
2173
|
+
gap: 8px;
|
|
2174
|
+
cursor: pointer;
|
|
2175
|
+
color: ${Ti.colorOnSurface};
|
|
2176
|
+
min-height: 52px;
|
|
2177
|
+
}
|
|
2130
2178
|
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2179
|
+
.ft-search-bar--suggestion > *:not(ft-ripple) {
|
|
2180
|
+
position: relative;
|
|
2181
|
+
}
|
|
2134
2182
|
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
z-index: ${Ti.floatingZIndex};
|
|
2139
|
-
top: 100%;
|
|
2140
|
-
left: -1px;
|
|
2141
|
-
right: -1px;
|
|
2142
|
-
display: none;
|
|
2143
|
-
background: ${Ti.colorSurface};
|
|
2144
|
-
border: 1px solid ${Ti.colorOutline};
|
|
2145
|
-
border-radius: 0 0 ${Ti.borderRadius} ${Ti.borderRadius};
|
|
2146
|
-
box-shadow: ${Ti.elevation02};
|
|
2147
|
-
outline: none;
|
|
2148
|
-
}
|
|
2183
|
+
.ft-search-bar--desktop .ft-search-bar--suggestion {
|
|
2184
|
+
min-height: 44px;
|
|
2185
|
+
}
|
|
2149
2186
|
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2187
|
+
.ft-search-bar--suggestion:focus {
|
|
2188
|
+
outline: none;
|
|
2189
|
+
}
|
|
2153
2190
|
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2191
|
+
.ft-search-bar--recent-search + .ft-search-bar--suggestion:not(.ft-search-bar--recent-search) {
|
|
2192
|
+
border-top: 1px solid ${Ti.colorOutline};
|
|
2193
|
+
}
|
|
2157
2194
|
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2195
|
+
.ft-search-bar--suggestion ft-typography {
|
|
2196
|
+
display: block;
|
|
2197
|
+
flex-grow: 1;
|
|
2198
|
+
flex-shrink: 1;
|
|
2199
|
+
}
|
|
2200
|
+
`;class Ui{constructor(t){this.searchBar=t}render(){if(!this.searchBar.hasLocaleSelector()&&!this.searchBar.hasFacets())return i.html``;const t=this.searchBar.isMobile(),e=!t&&this.searchBar.dense||t&&this.searchBar.isMobileMenuOpen(),o=i.html`
|
|
2201
|
+
${this.searchBar.hasLocaleSelector()&&(this.searchBar.hasFacets()||t)?i.html`
|
|
2202
|
+
<ft-chip part="selected-filters selected-filter-ft-locale"
|
|
2203
|
+
?dense=${this.searchBar.dense&&!t}
|
|
2204
|
+
?clickable=${t}
|
|
2205
|
+
@click=${()=>this.openMobileFilters("ft:locale")}
|
|
2206
|
+
data-key="ft:locale"
|
|
2207
|
+
data-value="${this.searchBar.contentLocale}">
|
|
2208
|
+
${this.getLocaleLabel(this.searchBar.contentLocale)}
|
|
2209
|
+
</ft-chip>
|
|
2210
|
+
`:null}
|
|
2211
|
+
${s.repeat(this.searchBar.facets,(t=>t.key),(o=>{const r=function(t){return Jt(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(o);return s.repeat(r,(s=>{let n=o.label+": "+function(t){return Qt(t).split("|").join(" > ")}(s);const l=o.key.replace(":","-"),a=i.html`
|
|
2212
|
+
<ft-chip
|
|
2213
|
+
part="selected-filters selected-filter-${l}"
|
|
2214
|
+
?dense=${this.searchBar.dense&&!t}
|
|
2215
|
+
?clickable=${t}
|
|
2216
|
+
?removable=${!t}
|
|
2217
|
+
icon=${t?i.nothing:"close"}
|
|
2218
|
+
label="${n}"
|
|
2219
|
+
title=${e?n:i.nothing}
|
|
2220
|
+
@click=${()=>this.openMobileFilters(o.key)}
|
|
2221
|
+
@icon-click=${()=>this.searchBar.setFilter(o.key,r.filter((t=>t!==s)))}
|
|
2222
|
+
data-key="${o.key}"
|
|
2223
|
+
data-value="${s}">
|
|
2224
|
+
${function(t){return Qt(t).split("|").pop()}(s)}
|
|
2225
|
+
</ft-chip>
|
|
2226
|
+
`;return e?a:i.html`
|
|
2227
|
+
<ft-tooltip inline text="${n}">
|
|
2228
|
+
${a}
|
|
2229
|
+
</ft-tooltip>
|
|
2230
|
+
`}))}))}
|
|
2231
|
+
${t?i.html`
|
|
2232
|
+
<ft-chip part="selected-filters mobile-filters-opener"
|
|
2233
|
+
icon="add"
|
|
2234
|
+
clickable
|
|
2235
|
+
@click=${()=>{this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0}}>
|
|
2236
|
+
${this.searchBar.labelResolver.resolve("filtersButton")}
|
|
2237
|
+
</ft-chip>
|
|
2238
|
+
`:i.nothing}
|
|
2239
|
+
`;return e?i.html`
|
|
2240
|
+
<ft-snap-scroll horizontal controls hideScrollbar limitSize
|
|
2241
|
+
class="ft-search-bar--selected-filters"
|
|
2242
|
+
part="selected-filters-container"
|
|
2243
|
+
exportpartsPrefix="selected-filters-container">
|
|
2244
|
+
${o}
|
|
2245
|
+
</ft-snap-scroll>
|
|
2246
|
+
`:i.html`
|
|
2247
|
+
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2248
|
+
${o}
|
|
2249
|
+
</div>
|
|
2250
|
+
`}openMobileFilters(t){this.searchBar.isMobile()&&(this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0,this.searchBar.scrollToFacet=t)}getLocaleLabel(t){var e;return null!==(e=this.searchBar.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}}Ui.styles=i.css`
|
|
2251
|
+
.ft-search-bar--selected-filters:not(ft-snap-scroll) {
|
|
2252
|
+
flex-shrink: 0;
|
|
2253
|
+
display: flex;
|
|
2254
|
+
flex-direction: row;
|
|
2255
|
+
flex-wrap: wrap;
|
|
2256
|
+
gap: 8px;
|
|
2257
|
+
}
|
|
2169
2258
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2259
|
+
ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2260
|
+
overflow: hidden;
|
|
2261
|
+
${e.setVariable(Je.gap,"4px")};
|
|
2262
|
+
}
|
|
2173
2263
|
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2264
|
+
ft-snap-scroll.ft-search-bar--selected-filters::part(content) {
|
|
2265
|
+
align-items: center;
|
|
2266
|
+
}
|
|
2177
2267
|
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2268
|
+
.ft-search-bar--desktop ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2269
|
+
${e.setVariable(wi.iconSize,"17px")};
|
|
2270
|
+
${e.setVariable(wi.fontSize,"12px")};
|
|
2271
|
+
}
|
|
2181
2272
|
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2273
|
+
.ft-search-bar--selected-filters * {
|
|
2274
|
+
max-width: 100%;
|
|
2275
|
+
}
|
|
2185
2276
|
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
}
|
|
2191
|
-
`;var _i=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};null==window.fluidtopics&&console.warn("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api");const Hi={filtersButton:"Filters",inputPlaceHolder:"Search",filterInputPlaceHolder:"Filter {0}",clearInputButton:"Clear",clearFilterButton:"Clear",displayMoreFilterValuesButton:"More",noFilterValuesAvailable:"No values available",searchButton:"Search",clearFilters:"Clear filters",contentLocaleSelector:"Lang",presetsSelector:"Preset",removeRecentSearch:"Remove",back:"Back"};class Vi extends CustomEvent{constructor(t){super("launch-search",{detail:t,bubbles:!0,composed:!0})}}class Ki extends CustomEvent{constructor(t){super("change",{detail:t})}}const qi=()=>{};class Wi extends e.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.mode="auto",this.forceMobileMenuOpen=!1,this.forceMenuOpen=!1,this.baseUrl="",this.apiIntegrationIdentifier="ft-search-bar",this.availableContentLocales=[],this.availableContentLocalesInitialized=!1,this.labels={},this.labelResolver=new e.ParametrizedLabelResolver(Hi,{}),this.displayedFilters=[],this.presets=[],this.priors=[],this.searchRequestSerializer=t=>function(t,e){var i;const o=new URLSearchParams({"content-lang":null!==(i=e.contentLocale)&&void 0!==i?i:"all",query:e.query});if(e.filters.length>0){const t=e.filters.map((t=>{const e=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${e}`})).join("*");o.append("filters",t)}return new URL(`${t}/search/all?${o.toString()}`).href}(this.baseUrl,t),this.searchFilters=[],this.sizeCategory=l.M,this.displayFacets=!1,this.mobileMenuOpen=!1,this.facets=[],this.facetsInitialized=!1,this.knownFacetLabels=new Map,this.query="",this.suggestions=[],this.suggestionsLoaded=!0,this.recentSearches=[],this.updateFacetsDebouncer=new e.Debouncer(500),this.suggestDebouncer=new e.Debouncer(300),this.facetsLoaded=!1,this.closeFloatingContainer=t=>{this.isMobile||(this.displayFacets=this.displayFacets&&t.composedPath().some((t=>t===this.floatingContainer)))},this.compareFilters=(t,e)=>t.key===e.key&&t.negative==e.negative&&t.values.length===e.values.length&&t.values.every((t=>e.values.includes(t))),this.compareRequests=(t,e)=>(null==t.contentLocale||null==e.contentLocale||t.contentLocale===e.contentLocale)&&t.filters.length===e.filters.length&&t.filters.every((t=>e.filters.some((e=>this.compareFilters(t,e)))))}get isMobileMenuOpen(){return this.isMobile&&(this.forceMobileMenuOpen||this.forceMenuOpen||this.mobileMenuOpen)}get request(){return{uiLocale:this.uiLocale,contentLocale:this.contentLocale,query:this.query,facets:this.facetsRequest,priors:this.hasPriors?this.priors:void 0,filters:this.searchFilters,paging:{perPage:0,page:1},sort:[]}}get facetsRequest(){const t=this.searchFilters.filter((t=>t.values.length>0&&!this.displayedFilters.includes(t.key))).map((t=>({id:t.key})));return[...this.displayedFilters.map((t=>({id:t}))),...t]}get suggestRequest(){return{contentLocale:this.contentLocale,input:this.query,filters:this.searchFilters,sort:[]}}get isMobile(){switch(this.mode){case"mobile":return!0;case"desktop":return!1;default:return this.sizeCategory===l.S}}get hasFacets(){return this.facetsRequest.length>0}get hasPresets(){return null!=this.presets&&this.presets.length>0}get hasPriors(){return null!=this.priors&&this.priors.length>0}get hasLocaleSelector(){return this.availableContentLocales.length>1}focus(){var t;null===(t=this.container)||void 0===t||t.focus()}focusInput(){this.input?this.input.focus():setTimeout((()=>this.focusInput()),50)}clear(){this.query="",this.searchFilters=[],this.input&&(this.input.value=""),this.mobileMenuOpen=!1,this.displayFacets=!1}render(){return i.html`
|
|
2192
|
-
<ft-size-watcher @change=${this.updateSize}></ft-size-watcher>
|
|
2193
|
-
${this.renderSearchBar()}
|
|
2194
|
-
`}renderSearchBar(){const t={"ft-search-bar--container":!0,"ft-search-bar--dense":!this.isMobile&&this.dense,"ft-search-bar--mobile":this.isMobile,"ft-search-bar--desktop":!this.isMobile,"ft-search-bar--floating-panel-open":!this.isMobile&&this.displayFacets&&!this.forceMenuOpen,"ft-search-bar--mobile-menu-open":this.isMobileMenuOpen,"ft-search-bar--forced-open":this.forceMenuOpen||this.forceMobileMenuOpen};return this.facetsInitialized&&this.availableContentLocalesInitialized?i.html`
|
|
2277
|
+
.ft-search-bar--selected-filters ft-chip {
|
|
2278
|
+
flex-grow: 0;
|
|
2279
|
+
}
|
|
2280
|
+
`;class _i{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new Ui(t),this.suggestManager=null!=i?i:new Zi(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--mobile":!0,"ft-search-bar--mobile-menu-open":this.searchBar.isMobileMenuOpen(),"ft-search-bar--forced-open":this.searchBar.forceMobileMenuOpen};return i.html`
|
|
2195
2281
|
<div class="${r.classMap(t)}" part="container" tabindex="-1">
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
type="text"
|
|
2208
|
-
placeholder="${this.labelResolver.resolve("inputPlaceHolder")}"
|
|
2209
|
-
value="${this.query}"
|
|
2210
|
-
@keyup=${this.onSearchBarKeyUp}
|
|
2211
|
-
@focus=${()=>{this.mobileMenuOpen=!0,this.displayFacets=!1}}>
|
|
2282
|
+
<div class="ft-search-bar">
|
|
2283
|
+
<div class="ft-search-bar--input-container" part="input-container">
|
|
2284
|
+
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2285
|
+
<input class="ft-search-bar--input ft-typography--body2"
|
|
2286
|
+
part="input"
|
|
2287
|
+
type="text"
|
|
2288
|
+
placeholder="${this.searchBar.labelResolver.resolve("inputPlaceHolder")}"
|
|
2289
|
+
value="${this.searchBar.query}"
|
|
2290
|
+
@keyup=${t=>this.onSearchBarKeyUp(t)}
|
|
2291
|
+
@focus=${()=>{this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!1}}>
|
|
2292
|
+
</div>
|
|
2212
2293
|
</div>
|
|
2294
|
+
${this.renderMobileSearchBarButtons()}
|
|
2213
2295
|
</div>
|
|
2214
|
-
${this.
|
|
2296
|
+
${this.searchBar.displayFacets?this.searchBar.renderFacetsActions():this.selectedFacetsManager.render()}
|
|
2297
|
+
${this.searchBar.displayFacets?this.searchBar.renderMobileFacets():this.suggestManager.render()}
|
|
2298
|
+
${this.searchBar.isMobileMenuOpen()||this.searchBar.displayFacets?i.html`
|
|
2299
|
+
<ft-button class="ft-search-bar--launch-search"
|
|
2300
|
+
part="launch-search-in-panel"
|
|
2301
|
+
icon="search"
|
|
2302
|
+
@click=${this.searchBar.launchSearch}>
|
|
2303
|
+
${this.searchBar.labelResolver.resolve("searchButton")}
|
|
2304
|
+
</ft-button>
|
|
2305
|
+
`:i.nothing}
|
|
2215
2306
|
</div>
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
<ft-button class="ft-search-bar--launch-search"
|
|
2220
|
-
part="launch-search-in-panel"
|
|
2221
|
-
icon="search"
|
|
2222
|
-
@click=${this.launchSearch}>
|
|
2223
|
-
${this.labelResolver.resolve("searchButton")}
|
|
2224
|
-
</ft-button>
|
|
2225
|
-
`:i.nothing}
|
|
2226
|
-
`}renderMobileSearchBarButtons(){const t=this.query||this.isMobileMenuOpen&&!this.forceMobileMenuOpen;return i.html`
|
|
2227
|
-
${t?i.html`
|
|
2228
|
-
<div class="ft-search-bar--actions"
|
|
2229
|
-
part="search-bar-actions">
|
|
2307
|
+
`}renderMobileSearchBarButtons(){const t=this.searchBar.query||this.searchBar.isMobileMenuOpen()&&!this.searchBar.forceMobileMenuOpen;return i.html`
|
|
2308
|
+
<div class="ft-search-bar--actions" part="search-bar-actions">
|
|
2309
|
+
${t?i.html`
|
|
2230
2310
|
<ft-button class="ft-search-bar--clear-query"
|
|
2231
2311
|
part="clear-query"
|
|
2232
2312
|
icon="close"
|
|
2233
2313
|
round
|
|
2234
|
-
label="${this.labelResolver.resolve("clearInputButton")}"
|
|
2314
|
+
label="${this.searchBar.labelResolver.resolve("clearInputButton")}"
|
|
2235
2315
|
tooltipPosition="left"
|
|
2236
|
-
@click=${()=>{this.setQuery(""),this.mobileMenuOpen=!1,this.displayFacets=!1}}
|
|
2316
|
+
@click=${()=>{this.searchBar.setQuery(""),this.searchBar.mobileMenuOpen=!1,this.searchBar.displayFacets=!1}}
|
|
2237
2317
|
></ft-button>
|
|
2318
|
+
<div class="ft-search-bar--separator"></div>
|
|
2319
|
+
`:i.nothing}
|
|
2320
|
+
<ft-button class="ft-search-bar--launch-search"
|
|
2321
|
+
part="launch-search-in-bar"
|
|
2322
|
+
icon="search"
|
|
2323
|
+
round
|
|
2324
|
+
label="${this.searchBar.labelResolver.resolve("searchButton")}"
|
|
2325
|
+
tooltipPosition="left"
|
|
2326
|
+
@click=${()=>{var t;return this.searchBar.isMobileMenuOpen()?this.searchBar.launchSearch():null===(t=this.searchBar.input)||void 0===t?void 0:t.focus()}}
|
|
2327
|
+
></ft-button>
|
|
2328
|
+
</div>
|
|
2329
|
+
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}_i.styles=i.css`
|
|
2330
|
+
|
|
2331
|
+
`;class Hi{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new Ui(t),this.suggestManager=null!=i?i:new Zi(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--dense":this.searchBar.dense,"ft-search-bar--desktop":!0,"ft-search-bar--floating-panel-open":this.searchBar.displayFacets&&!this.searchBar.forceMenuOpen,"ft-search-bar--forced-open":this.searchBar.forceMenuOpen};return i.html`
|
|
2332
|
+
<div class="${r.classMap(t)}" part="container" tabindex="-1">
|
|
2333
|
+
<div class="ft-search-bar" part="search-bar">
|
|
2334
|
+
${this.renderSearchBarLeftAction()}
|
|
2335
|
+
<div class="ft-search-bar--input-container" part="input-container" tabindex="-1">
|
|
2336
|
+
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2337
|
+
${this.searchBar.dense?this.selectedFacetsManager.render():i.nothing}
|
|
2338
|
+
<input class="ft-search-bar--input ft-typography--body2"
|
|
2339
|
+
part="input"
|
|
2340
|
+
type="text"
|
|
2341
|
+
placeholder="${this.searchBar.labelResolver.resolve("inputPlaceHolder")}"
|
|
2342
|
+
value="${this.searchBar.query}"
|
|
2343
|
+
@keydown=${t=>this.onSearchBarKeyDown(t)}
|
|
2344
|
+
@keyup=${t=>this.onSearchBarKeyUp(t)}>
|
|
2345
|
+
</div>
|
|
2346
|
+
${this.suggestManager.render()}
|
|
2347
|
+
</div>
|
|
2348
|
+
${this.renderDesktopSearchBarButtons()}
|
|
2349
|
+
${this.searchBar.renderDesktopFloatingMenu()}
|
|
2238
2350
|
</div>
|
|
2239
|
-
|
|
2351
|
+
${this.searchBar.dense?i.nothing:this.searchBar.forceMenuOpen?this.searchBar.renderDesktopMenu():this.selectedFacetsManager.render()}
|
|
2352
|
+
</div>
|
|
2353
|
+
`}renderSearchBarLeftAction(){return this.searchBar.hasFacets()?this.searchBar.forceMenuOpen?i.nothing:i.html`
|
|
2354
|
+
<ft-button class="ft-search-bar--filters-opener ft-search-bar--left-action"
|
|
2355
|
+
part="filters-opener"
|
|
2356
|
+
trailingIcon
|
|
2357
|
+
icon="${this.searchBar.displayFacets?"expand_less":"expand_more"}"
|
|
2358
|
+
@click=${t=>{t.stopPropagation(),this.searchBar.displayFacets=!this.searchBar.displayFacets}}
|
|
2359
|
+
@focusin=${t=>t.stopPropagation()}>
|
|
2360
|
+
${this.searchBar.labelResolver.resolve("filtersButton")}
|
|
2361
|
+
</ft-button>
|
|
2362
|
+
`:this.searchBar.hasLocaleSelector()?i.html`
|
|
2363
|
+
<ft-select outlined
|
|
2364
|
+
class="ft-search-bar--content-locale ft-search-bar--left-action"
|
|
2365
|
+
part="content-locale select-ft-locale"
|
|
2366
|
+
.exportpartsPrefixes=${["content-locale","select-ft-locale"]}
|
|
2367
|
+
@change=${t=>this.searchBar.contentLocale=null==t.detail?void 0:t.detail}>
|
|
2368
|
+
${s.repeat(this.searchBar.availableContentLocales,(t=>t.lang),(t=>i.html`
|
|
2369
|
+
<ft-select-option .value=${t.lang}
|
|
2370
|
+
label="${t.label}"
|
|
2371
|
+
?selected=${t.lang===this.searchBar.contentLocale}>
|
|
2372
|
+
</ft-select-option>
|
|
2373
|
+
`))}
|
|
2374
|
+
</ft-select>
|
|
2375
|
+
`:i.nothing}renderDesktopSearchBarButtons(){return i.html`
|
|
2240
2376
|
<div class="ft-search-bar--actions"
|
|
2241
2377
|
part="search-bar-actions">
|
|
2378
|
+
${this.searchBar.query?i.html`
|
|
2379
|
+
<ft-button class="ft-search-bar--clear-query"
|
|
2380
|
+
part="clear-query"
|
|
2381
|
+
icon="close"
|
|
2382
|
+
round dense
|
|
2383
|
+
label="${this.searchBar.labelResolver.resolve("clearInputButton")}"
|
|
2384
|
+
@click=${()=>this.searchBar.setQuery("")}
|
|
2385
|
+
></ft-button>
|
|
2386
|
+
<div class="ft-search-bar--separator"></div>
|
|
2387
|
+
`:null}
|
|
2242
2388
|
<ft-button class="ft-search-bar--launch-search"
|
|
2243
2389
|
part="launch-search-in-bar"
|
|
2244
2390
|
icon="search"
|
|
2245
|
-
round
|
|
2246
|
-
label="${this.labelResolver.resolve("searchButton")}"
|
|
2247
|
-
|
|
2248
|
-
@click=${()=>{var t;return this.isMobileMenuOpen?this.launchSearch():null===(t=this.input)||void 0===t?void 0:t.focus()}}
|
|
2391
|
+
round dense
|
|
2392
|
+
label="${this.searchBar.labelResolver.resolve("searchButton")}"
|
|
2393
|
+
@click=${()=>this.searchBar.launchSearch()}
|
|
2249
2394
|
></ft-button>
|
|
2250
2395
|
</div>
|
|
2251
|
-
`}
|
|
2396
|
+
`}onSearchBarKeyDown(t){var e;switch(t.key){case"Escape":this.searchBar.mobileMenuOpen=!1,null===(e=this.searchBar.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestManager.focusFirstSuggestion()}}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}Hi.styles=i.css`
|
|
2397
|
+
|
|
2398
|
+
`;var Vi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};null==window.fluidtopics&&console.warn("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api");const Ki={filtersButton:"Filters",inputPlaceHolder:"Search",filterInputPlaceHolder:"Filter {0}",clearInputButton:"Clear",clearFilterButton:"Clear",displayMoreFilterValuesButton:"More",noFilterValuesAvailable:"No values available",searchButton:"Search",clearFilters:"Clear filters",contentLocaleSelector:"Lang",presetsSelector:"Preset",removeRecentSearch:"Remove",back:"Back"};class qi extends CustomEvent{constructor(t){super("launch-search",{detail:t,bubbles:!0,composed:!0})}}class Wi extends CustomEvent{constructor(t){super("change",{detail:t})}}const Gi=()=>{};class Xi extends e.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.mode="auto",this.forceMobileMenuOpen=!1,this.forceMenuOpen=!1,this.baseUrl="",this.apiIntegrationIdentifier="ft-search-bar",this.availableContentLocales=[],this.availableContentLocalesInitialized=!1,this.labels={},this.labelResolver=new e.ParametrizedLabelResolver(Ki,{}),this.displayedFilters=[],this.presets=[],this.priors=[],this.searchRequestSerializer=t=>function(t,e){var i;const o=new URLSearchParams({"content-lang":null!==(i=e.contentLocale)&&void 0!==i?i:"all",query:e.query});if(e.filters.length>0){const t=e.filters.map((t=>{const e=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${e}`})).join("*");o.append("filters",t)}return new URL(`${t}/search/all?${o.toString()}`).href}(this.baseUrl,t),this.searchFilters=[],this.sizeCategory=l.M,this.displayFacets=!1,this.mobileMenuOpen=!1,this.facets=[],this.facetsInitialized=!1,this.knownFacetLabels=new Map,this.query="",this.suggestions=[],this.recentSearches=[],this.updateFacetsDebouncer=new e.Debouncer(500),this.suggestManager=new Zi(this),this.selectedFacetsManager=new Ui(this),this.desktopSearchBarManager=new Hi(this),this.mobileSearchBarManager=new _i(this),this.facetsLoaded=!1,this.closeFloatingContainer=t=>{this.isMobile()||(this.displayFacets=this.displayFacets&&t.composedPath().some((t=>t===this.floatingContainer)))},this.compareFilters=(t,e)=>t.key===e.key&&t.negative==e.negative&&t.values.length===e.values.length&&t.values.every((t=>e.values.includes(t))),this.compareRequests=(t,e)=>(null==t.contentLocale||null==e.contentLocale||t.contentLocale===e.contentLocale)&&t.filters.length===e.filters.length&&t.filters.every((t=>e.filters.some((e=>this.compareFilters(t,e)))))}isMobileMenuOpen(){return this.isMobile()&&(this.forceMobileMenuOpen||this.forceMenuOpen||this.mobileMenuOpen)}get request(){return{uiLocale:this.uiLocale,contentLocale:this.contentLocale,query:this.query,facets:this.facetsRequest,priors:this.hasPriors?this.priors:void 0,filters:this.searchFilters,paging:{perPage:0,page:1},sort:[]}}get facetsRequest(){const t=this.searchFilters.filter((t=>t.values.length>0&&!this.displayedFilters.includes(t.key))).map((t=>({id:t.key})));return[...this.displayedFilters.map((t=>({id:t}))),...t]}get suggestRequest(){return{contentLocale:this.contentLocale,input:this.query,filters:this.searchFilters,sort:[]}}isMobile(){switch(this.mode){case"mobile":return!0;case"desktop":return!1;default:return this.sizeCategory===l.S}}hasFacets(){return this.facetsRequest.length>0}get hasPresets(){return null!=this.presets&&this.presets.length>0}get hasPriors(){return null!=this.priors&&this.priors.length>0}hasLocaleSelector(){return this.availableContentLocales.length>1}focus(){var t;null===(t=this.container)||void 0===t||t.focus()}focusInput(){this.input?this.input.focus():setTimeout((()=>this.focusInput()),50)}clear(){this.query="",this.searchFilters=[],this.input&&(this.input.value=""),this.mobileMenuOpen=!1,this.displayFacets=!1}render(){return i.html`
|
|
2399
|
+
<ft-size-watcher @change=${this.updateSize}></ft-size-watcher>
|
|
2400
|
+
${this.renderSearchBar()}
|
|
2401
|
+
`}renderSearchBar(){return this.facetsInitialized&&this.availableContentLocalesInitialized?this.isMobile()?this.mobileSearchBarManager.render():this.desktopSearchBarManager.render():i.html`
|
|
2402
|
+
<ft-skeleton class="ft-search-bar--container ft-search-bar--skeleton" part="loader"
|
|
2403
|
+
tabindex="-1"></ft-skeleton>
|
|
2404
|
+
`}renderMobileFacets(){var t;const e=this.availableContentLocales.filter((t=>t.lang===this.contentLocale)).pop();return i.html`
|
|
2252
2405
|
<ft-accordion class="ft-search-bar--filters-container">
|
|
2253
|
-
${this.hasLocaleSelector?i.html`
|
|
2254
|
-
<ft-accordion-item data-facet-key="ft:
|
|
2406
|
+
${this.hasLocaleSelector()?i.html`
|
|
2407
|
+
<ft-accordion-item data-facet-key="ft:locale">
|
|
2255
2408
|
<div class="ft-search-bar--filter-label" slot="toggle">
|
|
2256
2409
|
<ft-typography variant="button">${this.labelResolver.resolve("contentLocaleSelector")}
|
|
2257
2410
|
</ft-typography>
|
|
@@ -2295,32 +2448,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
2295
2448
|
</ft-accordion-item>
|
|
2296
2449
|
`:i.nothing}))}
|
|
2297
2450
|
</ft-accordion>
|
|
2298
|
-
`}contentLocalesAsFilterOptions(){return this.availableContentLocales.map((t=>({value:t.lang,label:t.label,selected:t.lang==this.contentLocale})))}
|
|
2299
|
-
<div class="ft-search-bar" part="search-bar">
|
|
2300
|
-
${this.renderSearchBarLeftAction()}
|
|
2301
|
-
<div class="ft-search-bar--input-container" part="input-container" tabindex="-1">
|
|
2302
|
-
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2303
|
-
${this.dense?this.renderSelectedFacets():i.nothing}
|
|
2304
|
-
<input class="ft-search-bar--input ft-typography--body2"
|
|
2305
|
-
part="input"
|
|
2306
|
-
type="text"
|
|
2307
|
-
placeholder="${this.labelResolver.resolve("inputPlaceHolder")}"
|
|
2308
|
-
value="${this.query}"
|
|
2309
|
-
@keydown=${this.onSearchBarKeyDown}
|
|
2310
|
-
@keyup=${this.onSearchBarKeyUp}>
|
|
2311
|
-
</div>
|
|
2312
|
-
${this.renderSuggestions()}
|
|
2313
|
-
</div>
|
|
2314
|
-
${this.renderDesktopSearchBarButtons()}
|
|
2315
|
-
${this.forceMenuOpen?i.nothing:i.html`
|
|
2316
|
-
<div class="ft-search-bar--floating-panel" @keyup=${this.onFloatingContainerKeyUp}
|
|
2317
|
-
part="floating-panel"
|
|
2318
|
-
tabindex="-1">
|
|
2319
|
-
${this.renderDesktopMenu()}
|
|
2320
|
-
</div>`}
|
|
2321
|
-
</div>
|
|
2322
|
-
${this.dense||this.forceMenuOpen?this.forceMenuOpen?this.renderDesktopMenu():i.nothing:this.renderSelectedFacets()}
|
|
2323
|
-
`}renderDesktopMenu(){return this.hasFacets?i.html`
|
|
2451
|
+
`}contentLocalesAsFilterOptions(){return this.availableContentLocales.map((t=>({value:t.lang,label:t.label,selected:t.lang==this.contentLocale})))}renderDesktopMenu(){return this.hasFacets()?i.html`
|
|
2324
2452
|
<div class="ft-search-bar--desktop-menu">
|
|
2325
2453
|
${this.renderFacetsActions()}
|
|
2326
2454
|
${this.renderDesktopFacets()}
|
|
@@ -2334,50 +2462,7 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
2334
2462
|
</ft-button>
|
|
2335
2463
|
</div>
|
|
2336
2464
|
</div>
|
|
2337
|
-
`:i.nothing}
|
|
2338
|
-
<ft-button class="ft-search-bar--filters-opener ft-search-bar--left-action"
|
|
2339
|
-
part="filters-opener"
|
|
2340
|
-
trailingIcon
|
|
2341
|
-
icon="${this.displayFacets?"expand_less":"expand_more"}"
|
|
2342
|
-
@click=${t=>{t.stopPropagation(),this.displayFacets=!this.displayFacets}}
|
|
2343
|
-
@focusin=${t=>t.stopPropagation()}>
|
|
2344
|
-
${this.labelResolver.resolve("filtersButton")}
|
|
2345
|
-
</ft-button>
|
|
2346
|
-
`:this.hasLocaleSelector?i.html`
|
|
2347
|
-
<ft-select outlined
|
|
2348
|
-
class="ft-search-bar--content-locale ft-search-bar--left-action"
|
|
2349
|
-
part="content-locale select-ft-locale"
|
|
2350
|
-
.exportpartsPrefixes=${["content-locale","select-ft-locale"]}
|
|
2351
|
-
@change=${t=>this.contentLocale=null==t.detail?void 0:t.detail}>
|
|
2352
|
-
${s.repeat(this.availableContentLocales,(t=>t.lang),(t=>i.html`
|
|
2353
|
-
<ft-select-option .value=${t.lang}
|
|
2354
|
-
label="${t.label}"
|
|
2355
|
-
?selected=${t.lang===this.contentLocale}>
|
|
2356
|
-
</ft-select-option>
|
|
2357
|
-
`))}
|
|
2358
|
-
</ft-select>
|
|
2359
|
-
`:i.nothing}renderDesktopSearchBarButtons(){return i.html`
|
|
2360
|
-
<div class="ft-search-bar--actions"
|
|
2361
|
-
part="search-bar-actions">
|
|
2362
|
-
${this.query?i.html`
|
|
2363
|
-
<ft-button class="ft-search-bar--clear-query"
|
|
2364
|
-
part="clear-query"
|
|
2365
|
-
icon="close"
|
|
2366
|
-
round dense
|
|
2367
|
-
label="${this.labelResolver.resolve("clearInputButton")}"
|
|
2368
|
-
@click=${()=>this.setQuery("")}
|
|
2369
|
-
></ft-button>
|
|
2370
|
-
<div class="ft-search-bar--separator"></div>
|
|
2371
|
-
`:null}
|
|
2372
|
-
<ft-button class="ft-search-bar--launch-search"
|
|
2373
|
-
part="launch-search-in-bar"
|
|
2374
|
-
icon="search"
|
|
2375
|
-
round dense
|
|
2376
|
-
label="${this.labelResolver.resolve("searchButton")}"
|
|
2377
|
-
@click=${this.launchSearch}
|
|
2378
|
-
></ft-button>
|
|
2379
|
-
</div>
|
|
2380
|
-
`}renderFacetsActions(){var t;return i.html`
|
|
2465
|
+
`:i.nothing}renderFacetsActions(){var t;return i.html`
|
|
2381
2466
|
<div class="ft-search-bar--facets-actions">
|
|
2382
2467
|
${this.hasPresets?i.html`
|
|
2383
2468
|
<ft-select
|
|
@@ -2395,19 +2480,19 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
2395
2480
|
</ft-select>
|
|
2396
2481
|
`:i.nothing}
|
|
2397
2482
|
<slot name="facets-actions"></slot>
|
|
2398
|
-
${this.forceMenuOpen&&!this.isMobile?i.nothing:this.renderDesktopClearFilters()}
|
|
2483
|
+
${this.forceMenuOpen&&!this.isMobile()?i.nothing:this.renderDesktopClearFilters()}
|
|
2399
2484
|
</div>
|
|
2400
2485
|
`}renderDesktopClearFilters(){return this.searchFilters.length>0?i.html`
|
|
2401
2486
|
<ft-button part="facets-actions"
|
|
2402
2487
|
@click=${this.clearFilters}>
|
|
2403
2488
|
${this.labelResolver.resolve("clearFilters")}
|
|
2404
2489
|
</ft-button>
|
|
2405
|
-
`:i.nothing}renderDesktopFacets(){return this.hasFacets?i.html`
|
|
2490
|
+
`:i.nothing}renderDesktopFacets(){return this.hasFacets()?i.html`
|
|
2406
2491
|
<ft-snap-scroll horizontal limitSize controls
|
|
2407
2492
|
class="ft-search-bar--filters-container"
|
|
2408
2493
|
part="filters-container"
|
|
2409
2494
|
exportpartsPrefix="filters-container">
|
|
2410
|
-
${this.hasLocaleSelector?i.html`
|
|
2495
|
+
${this.hasLocaleSelector()?i.html`
|
|
2411
2496
|
<ft-filter
|
|
2412
2497
|
id="ft:locale"
|
|
2413
2498
|
class="ft-search-bar--content-locale"
|
|
@@ -2438,92 +2523,10 @@ const V=Symbol.for(""),K=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)===
|
|
|
2438
2523
|
></ft-filter>
|
|
2439
2524
|
`}))}
|
|
2440
2525
|
</ft-snap-scroll>
|
|
2441
|
-
`:i.nothing}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
data-value="${this.contentLocale}">
|
|
2449
|
-
${this.getLocaleLabel(this.contentLocale)}
|
|
2450
|
-
</ft-chip>
|
|
2451
|
-
`:null}
|
|
2452
|
-
${s.repeat(this.facets,(t=>t.key),(e=>{const o=function(t){return Jt(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(e);return s.repeat(o,(s=>{let r=e.label+": "+function(t){return Qt(t).split("|").join(" > ")}(s);const n=e.key.replace(":","-"),l=i.html`
|
|
2453
|
-
<ft-chip
|
|
2454
|
-
part="selected-filters selected-filter-${n}"
|
|
2455
|
-
?dense=${this.dense&&!this.isMobile}
|
|
2456
|
-
?clickable=${this.isMobile}
|
|
2457
|
-
?removable=${!this.isMobile}
|
|
2458
|
-
icon=${this.isMobile?i.nothing:"close"}
|
|
2459
|
-
label="${r}"
|
|
2460
|
-
title=${t?r:i.nothing}
|
|
2461
|
-
@click=${()=>this.openMobileFilters(e.key)}
|
|
2462
|
-
@icon-click=${()=>this.setFilter(e.key,o.filter((t=>t!==s)))}
|
|
2463
|
-
data-key="${e.key}"
|
|
2464
|
-
data-value="${s}">
|
|
2465
|
-
${function(t){return Qt(t).split("|").pop()}(s)}
|
|
2466
|
-
</ft-chip>
|
|
2467
|
-
`;return t?l:i.html`
|
|
2468
|
-
<ft-tooltip inline text="${r}">
|
|
2469
|
-
${l}
|
|
2470
|
-
</ft-tooltip>
|
|
2471
|
-
`}))}))}
|
|
2472
|
-
${this.isMobile?i.html`
|
|
2473
|
-
<ft-chip part="selected-filters mobile-filters-opener"
|
|
2474
|
-
icon="add"
|
|
2475
|
-
clickable
|
|
2476
|
-
@click=${()=>{this.mobileMenuOpen=!0,this.displayFacets=!0}}>
|
|
2477
|
-
${this.labelResolver.resolve("filtersButton")}
|
|
2478
|
-
</ft-chip>
|
|
2479
|
-
`:i.nothing}
|
|
2480
|
-
`;return t?i.html`
|
|
2481
|
-
<ft-snap-scroll horizontal controls hideScrollbar limitSize
|
|
2482
|
-
class="ft-search-bar--selected-filters"
|
|
2483
|
-
part="selected-filters-container"
|
|
2484
|
-
exportpartsPrefix="selected-filters-container">
|
|
2485
|
-
${e}
|
|
2486
|
-
</ft-snap-scroll>
|
|
2487
|
-
`:i.html`
|
|
2488
|
-
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2489
|
-
${e}
|
|
2490
|
-
</div>
|
|
2491
|
-
`}renderSuggestions(){const t=this.recentSearches.filter((t=>t.toLowerCase().includes(this.query.toLowerCase()))),e=this.suggestions.length>0||t.length>0;return i.html`
|
|
2492
|
-
<div class="ft-search-bar--suggestions ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2493
|
-
part="suggestions-container"
|
|
2494
|
-
@keydown=${this.onSuggestKeyDown}>
|
|
2495
|
-
${s.repeat(t.slice(0,5),(t=>t),(t=>i.html`
|
|
2496
|
-
<a href="${this.searchRequestSerializer({...this.request,query:t})}"
|
|
2497
|
-
part="suggestions"
|
|
2498
|
-
class="ft-search-bar--suggestion ft-search-bar--recent-search"
|
|
2499
|
-
@keyup=${e=>this.onSuggestKeyUp(e,t)}
|
|
2500
|
-
@click=${e=>this.onSuggestClick(e,t)}>
|
|
2501
|
-
<ft-ripple></ft-ripple>
|
|
2502
|
-
<ft-icon variant="material" part="suggestion-icon">history</ft-icon>
|
|
2503
|
-
<ft-typography variant="body1">${t}</ft-typography>
|
|
2504
|
-
<ft-button icon="close"
|
|
2505
|
-
round
|
|
2506
|
-
part="remove-suggestion"
|
|
2507
|
-
?dense=${!this.isMobile}
|
|
2508
|
-
label="${this.labelResolver.resolve("removeRecentSearch")}"
|
|
2509
|
-
tooltipPosition="left"
|
|
2510
|
-
@click=${e=>this.removeRecentSearch(e,t)}></ft-button>
|
|
2511
|
-
</a>
|
|
2512
|
-
`))}
|
|
2513
|
-
${s.repeat(this.suggestions,(t=>t.value),(t=>i.html`
|
|
2514
|
-
<a href="${this.searchRequestSerializer({...this.request,query:t.value})}"
|
|
2515
|
-
part="suggestions"
|
|
2516
|
-
class="ft-search-bar--suggestion"
|
|
2517
|
-
@keyup=${e=>this.onSuggestKeyUp(e,t.value)}
|
|
2518
|
-
@click=${e=>this.onSuggestClick(e,t.value)}>
|
|
2519
|
-
<ft-ripple></ft-ripple>
|
|
2520
|
-
${this.getIcon(t)}
|
|
2521
|
-
<ft-typography variant="body1">${t.value}</ft-typography>
|
|
2522
|
-
</a>
|
|
2523
|
-
`))}
|
|
2524
|
-
</div>
|
|
2525
|
-
`}getIcon(t){const e="DOCUMENT"===t.type?$e.file_format:$e.fluid_topics;let o;switch(t.type){case"MAP":o="BOOK"===t.editorialType?ge.BOOK:ge.ARTICLE;break;case"DOCUMENT":o=function(t,e){var i,o,s,r;t=(null!=t?t:"").toLowerCase(),e=(null!=e?e:"").toLowerCase();const[n,l]=((null!==(i=me.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(r=null!==(s=null!==(o=ye.get(l))&&void 0!==o?o:ye.get(e))&&void 0!==s?s:ye.get(n))&&void 0!==r?r:xe.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":o=ge.TOPICS}return i.html`
|
|
2526
|
-
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2527
|
-
${o}
|
|
2528
|
-
</ft-icon>
|
|
2529
|
-
`}openMobileFilters(t){this.isMobile&&(this.mobileMenuOpen=!0,this.displayFacets=!0,this.scrollToFacet=t)}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var i,o,s,r,n;if(t.has("labels")&&(this.labelResolver=new e.ParametrizedLabelResolver(Hi,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const e=t=>this.availableContentLocales.some((e=>e.lang===t));e(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&e(t.get("contentLocale"))?t.get("contentLocale"):null===(i=this.availableContentLocales[0])||void 0===i?void 0:i.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(o=this.presets)&&void 0!==o?o:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>Qt(t))))))),t.has("selectedPreset")){const t=(null!==(s=this.presets)&&void 0!==s?s:[]).find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}t.has("contentLocale")&&null!=this.contentLocale&&(this.knownFacetLabels=new Map),["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(n=(null!==(r=this.presets)&&void 0!==r?r:[]).find((t=>this.compareRequests(t,this.request))))||void 0===n?void 0:n.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&(this.api=void 0,this.initApi(),this.availableContentLocalesInitialized=!1,this.facetsInitialized=!1),t.has("api")&&this.updateAvailableContentLocales(),["uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateFacets(),["query","uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateSuggestions(),["query","uiLocale","contentLocale","searchFilters"].some((e=>t.has(e)))&&this.dispatchEvent(new Ki(this.request))}async updateAvailableContentLocales(){this.api&&(this.availableContentLocales=await this.api.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[])),this.availableContentLocalesInitialized=!0)}contentAvailableCallback(t){var e,i,o;if(super.contentAvailableCallback(t),t.has("displayFacets")&&this.displayFacets&&(null===(e=this.floatingContainer)||void 0===e||e.focus()),null!=this.scrollToFacet&&this.facetsLoaded){null===(i=this.scrollingFiltersContainer)||void 0===i||i.scrollIndexIntoView(this.facets.findIndex((t=>t.key===this.scrollToFacet)));const t=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`ft-accordion-item[data-facet-key="${this.scrollToFacet}"]`);t&&(t.active=!0),this.scrollToFacet=void 0}}initApi(){null==this.api&&(this.api=window.fluidtopics?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier,!0):void 0,setTimeout((()=>this.initApi()),100))}updateFacets(){this.api&&(this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{var t;const e=new Map;await(null===(t=this.api)||void 0===t?void 0:t.search({...this.request,query:""}).then((t=>t.facets.forEach((t=>{this.knownFacetLabels.set(t.key,t.label),e.set(t.key,t)})))).catch(qi)),this.facets=[];for(let t of this.facetsRequest)e.has(t.id)?this.facets.push(e.get(t.id)):this.knownFacetLabels.has(t.id)&&this.facets.push({key:t.id,label:this.knownFacetLabels.get(t.id),rootNodes:[],multiSelectionable:!0,hierarchical:!1});this.facetsLoaded=!0,this.facetsInitialized=!0}))):(this.facets=[],this.facetsInitialized=!0))}updateSuggestions(){this.suggestionsLoaded=!1,this.suggestDebouncer.run((async()=>{this.suggestions=this.api&&this.query.length>2?await this.api.getSuggestions(this.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],this.suggestionsLoaded=!0}))}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.query=e.value,"Enter"===t.key&&this.launchSearch()}onSearchBarKeyDown(t){var e,i;switch(t.key){case"Escape":this.mobileMenuOpen=!1,null===(e=this.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),null===(i=this.firstSuggestion)||void 0===i||i.focus()}}onFloatingContainerKeyUp(t){var e;"Escape"===t.key&&(this.displayFacets=!1,null===(e=this.filtersOpener)||void 0===e||e.focus())}setQuery(t){this.input&&(this.input.value=t),this.query=t}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.setQuery(e),this.launchSearch()}launchSearch(){if(this.query){let t=this.recentSearches.filter((t=>t.toLowerCase()!==this.query.toLowerCase())).filter(((t,e)=>e<20));this.recentSearches=[this.query,...t],this.saveRecentSearches()}this.dispatchEvent(new Vi(this.request)),this.mobileMenuOpen=!1,this.displayFacets=!1,this.focus()}get recentSearchesStorageKey(){return this.baseUrl+":ft:recent-search-queries"}initRecentSearches(){var t;this.recentSearches=JSON.parse(null!==(t=window.localStorage.getItem(this.recentSearchesStorageKey))&&void 0!==t?t:"[]")}saveRecentSearches(){const t=JSON.stringify(this.recentSearches);window.localStorage.setItem(this.recentSearchesStorageKey,t),window.dispatchEvent(new StorageEvent("storage",{key:this.recentSearchesStorageKey,newValue:t,storageArea:window.localStorage,url:window.location.href}))}connectedCallback(){super.connectedCallback(),document.addEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}updateSize(t){this.sizeCategory=t.detail.category}getLocaleLabel(t){var e;return null!==(e=this.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}setFilter(t,e){let i=this.searchFilters.filter((e=>e.key!==t));this.facets.forEach((i=>{i.key===t&&Jt(i.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=e.includes(t.value)))})),e.length&&i.push({key:t,negative:!1,values:e}),this.searchFilters=i,this.scrollToFacet=t}setFiltersFromPreset(t){null!=t&&(null!=t.contentLocale&&(this.contentLocale=t.contentLocale),this.searchFilters=t.filters)}clearFilters(){this.facets.forEach((t=>Jt(t.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=!1)))),this.searchFilters=[];const t=this.facets[0];this.scrollToFacet=null==t?void 0:t.key}removeRecentSearch(t,e){var i,o,s,r;t.preventDefault(),t.stopPropagation();const n=null!==(r=null!==(o=null===(i=this.focusedSuggestion)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:null===(s=this.focusedSuggestion)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.input;null==n||n.focus(),this.recentSearches=this.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.saveRecentSearches()}onSuggestKeyDown(t){var e,i,o,s,r,n;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.focusedSuggestion)||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.lastSuggestion)||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(n=null!==(r=null===(s=this.focusedSuggestion)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstSuggestion)||void 0===n||n.focus(),t.preventDefault(),t.stopPropagation()}}}Wi.elementDefinitions={"ft-accordion":ui,"ft-accordion-item":yi,"ft-button":Le,"ft-chip":Bi,"ft-filter":hi,"ft-filter-option":fi,"ft-icon":Se,"ft-ripple":pe,"ft-select":Mi,"ft-select-option":Fi,"ft-size-watcher":p,"ft-skeleton":Ai,"ft-snap-scroll":ti,"ft-tooltip":ue,"ft-typography":Yt},Wi.styles=[Kt,Ni,Ri,Zi,Ui],_i([o.property({type:Boolean})],Wi.prototype,"dense",void 0),_i([o.property()],Wi.prototype,"mode",void 0),_i([o.property({type:Boolean})],Wi.prototype,"forceMobileMenuOpen",void 0),_i([o.property({type:Boolean})],Wi.prototype,"forceMenuOpen",void 0),_i([o.property()],Wi.prototype,"baseUrl",void 0),_i([o.property()],Wi.prototype,"apiIntegrationIdentifier",void 0),_i([o.property()],Wi.prototype,"contentLocale",void 0),_i([o.state()],Wi.prototype,"availableContentLocales",void 0),_i([o.state()],Wi.prototype,"availableContentLocalesInitialized",void 0),_i([o.property()],Wi.prototype,"uiLocale",void 0),_i([e.jsonProperty({})],Wi.prototype,"labels",void 0),_i([e.jsonProperty([])],Wi.prototype,"displayedFilters",void 0),_i([e.jsonProperty([])],Wi.prototype,"presets",void 0),_i([o.property({type:String,reflect:!0})],Wi.prototype,"selectedPreset",void 0),_i([e.jsonProperty([])],Wi.prototype,"priors",void 0),_i([o.property()],Wi.prototype,"searchRequestSerializer",void 0),_i([o.state()],Wi.prototype,"searchFilters",void 0),_i([o.state()],Wi.prototype,"sizeCategory",void 0),_i([o.state()],Wi.prototype,"displayFacets",void 0),_i([o.state()],Wi.prototype,"mobileMenuOpen",void 0),_i([o.state()],Wi.prototype,"facets",void 0),_i([o.state()],Wi.prototype,"facetsInitialized",void 0),_i([o.query(".ft-search-bar--container")],Wi.prototype,"container",void 0),_i([o.query(".ft-search-bar--filters-opener")],Wi.prototype,"filtersOpener",void 0),_i([o.query(".ft-search-bar--floating-panel")],Wi.prototype,"floatingContainer",void 0),_i([o.query("ft-snap-scroll.ft-search-bar--filters-container")],Wi.prototype,"scrollingFiltersContainer",void 0),_i([o.query(".ft-search-bar--input")],Wi.prototype,"input",void 0),_i([o.state()],Wi.prototype,"query",void 0),_i([o.state()],Wi.prototype,"suggestions",void 0),_i([o.state()],Wi.prototype,"suggestionsLoaded",void 0),_i([o.state()],Wi.prototype,"recentSearches",void 0),_i([o.state()],Wi.prototype,"scrollToFacet",void 0),_i([o.query(".ft-search-bar--suggestion:first-child")],Wi.prototype,"firstSuggestion",void 0),_i([o.query(".ft-search-bar--suggestion:focus-within")],Wi.prototype,"focusedSuggestion",void 0),_i([o.query(".ft-search-bar--suggestion:last-child")],Wi.prototype,"lastSuggestion",void 0),_i([o.state()],Wi.prototype,"api",void 0),e.customElement("ft-search-bar")(Wi),t.DEFAULT_LABELS=Hi,t.FtSearchBar=Wi,t.FtSearchBarCssVariables=Ti,t.LaunchSearchEvent=Vi,t.SearchStateChangeEvent=Ki,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|
|
2526
|
+
`:i.nothing}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var i,o,s,r,n;if(t.has("labels")&&(this.labelResolver=new e.ParametrizedLabelResolver(Ki,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile()),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const e=t=>this.availableContentLocales.some((e=>e.lang===t));e(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&e(t.get("contentLocale"))?t.get("contentLocale"):null===(i=this.availableContentLocales[0])||void 0===i?void 0:i.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(o=this.presets)&&void 0!==o?o:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>Qt(t))))))),t.has("selectedPreset")){const t=(null!==(s=this.presets)&&void 0!==s?s:[]).find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}t.has("contentLocale")&&null!=this.contentLocale&&(this.knownFacetLabels=new Map),["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(n=(null!==(r=this.presets)&&void 0!==r?r:[]).find((t=>this.compareRequests(t,this.request))))||void 0===n?void 0:n.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&(this.api=void 0,this.initApi(),this.availableContentLocalesInitialized=!1,this.facetsInitialized=!1),t.has("api")&&this.updateAvailableContentLocales(),["uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateFacets(),["query","uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.suggestManager.update(),["query","uiLocale","contentLocale","searchFilters"].some((e=>t.has(e)))&&this.dispatchEvent(new Wi(this.request))}async updateAvailableContentLocales(){this.api&&(this.availableContentLocales=await this.api.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[])),this.availableContentLocalesInitialized=!0)}contentAvailableCallback(t){var e,i,o;if(super.contentAvailableCallback(t),t.has("displayFacets")&&this.displayFacets&&(null===(e=this.floatingContainer)||void 0===e||e.focus()),null!=this.scrollToFacet&&this.facetsLoaded){null===(i=this.scrollingFiltersContainer)||void 0===i||i.scrollIndexIntoView(this.facets.findIndex((t=>t.key===this.scrollToFacet)));const t=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`ft-accordion-item[data-facet-key="${this.scrollToFacet}"]`);t&&(t.active=!0),this.scrollToFacet=void 0}}initApi(){null==this.api&&(this.api=window.fluidtopics?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier,!0):void 0,setTimeout((()=>this.initApi()),100))}updateFacets(){this.api&&(this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{var t;const e=new Map;await(null===(t=this.api)||void 0===t?void 0:t.search({...this.request,query:""}).then((t=>t.facets.forEach((t=>{this.knownFacetLabels.set(t.key,t.label),e.set(t.key,t)})))).catch(Gi)),this.facets=[];for(let t of this.facetsRequest)e.has(t.id)?this.facets.push(e.get(t.id)):this.knownFacetLabels.has(t.id)&&this.facets.push({key:t.id,label:this.knownFacetLabels.get(t.id),rootNodes:[],multiSelectionable:!0,hierarchical:!1});this.facetsLoaded=!0,this.facetsInitialized=!0}))):(this.facets=[],this.facetsInitialized=!0))}onFloatingContainerKeyUp(t){var e;"Escape"===t.key&&(this.displayFacets=!1,null===(e=this.filtersOpener)||void 0===e||e.focus())}setQuery(t){this.input&&(this.input.value=t),this.query=t}launchSearch(){if(this.query){let t=this.recentSearches.filter((t=>t.toLowerCase()!==this.query.toLowerCase())).filter(((t,e)=>e<20));this.recentSearches=[this.query,...t],this.saveRecentSearches()}this.dispatchEvent(new qi(this.request)),this.mobileMenuOpen=!1,this.displayFacets=!1,this.focus()}get recentSearchesStorageKey(){return this.baseUrl+":ft:recent-search-queries"}initRecentSearches(){var t;this.recentSearches=JSON.parse(null!==(t=window.localStorage.getItem(this.recentSearchesStorageKey))&&void 0!==t?t:"[]")}saveRecentSearches(){const t=JSON.stringify(this.recentSearches);window.localStorage.setItem(this.recentSearchesStorageKey,t),window.dispatchEvent(new StorageEvent("storage",{key:this.recentSearchesStorageKey,newValue:t,storageArea:window.localStorage,url:window.location.href}))}connectedCallback(){super.connectedCallback(),document.addEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}updateSize(t){this.sizeCategory=t.detail.category}setFilter(t,e){let i=this.searchFilters.filter((e=>e.key!==t));this.facets.forEach((i=>{i.key===t&&Jt(i.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=e.includes(t.value)))})),e.length&&i.push({key:t,negative:!1,values:e}),this.searchFilters=i,this.scrollToFacet=t}setFiltersFromPreset(t){null!=t&&(null!=t.contentLocale&&(this.contentLocale=t.contentLocale),this.searchFilters=t.filters)}clearFilters(){this.facets.forEach((t=>Jt(t.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=!1)))),this.searchFilters=[];const t=this.facets[0];this.scrollToFacet=null==t?void 0:t.key}querySelector(t){return this.shadowRoot.querySelector(t)}querySelectorAll(t){return this.shadowRoot.querySelectorAll(t)}renderDesktopFloatingMenu(){return this.forceMenuOpen?i.nothing:i.html`
|
|
2527
|
+
<div class="ft-search-bar--floating-panel"
|
|
2528
|
+
@keyup=${this.onFloatingContainerKeyUp}
|
|
2529
|
+
part="floating-panel"
|
|
2530
|
+
tabindex="-1">
|
|
2531
|
+
${this.renderDesktopMenu()}
|
|
2532
|
+
</div>`}}Xi.elementDefinitions={"ft-accordion":ui,"ft-accordion-item":yi,"ft-button":De,"ft-chip":Ci,"ft-filter":hi,"ft-filter-option":fi,"ft-icon":Se,"ft-ripple":pe,"ft-select":Mi,"ft-select-option":Li,"ft-size-watcher":p,"ft-skeleton":Ai,"ft-snap-scroll":ti,"ft-tooltip":ue,"ft-typography":Yt},Xi.styles=[Kt,Ri,Ni,Ui.styles,Zi.styles],Vi([o.property({type:Boolean})],Xi.prototype,"dense",void 0),Vi([o.property()],Xi.prototype,"mode",void 0),Vi([o.property({type:Boolean})],Xi.prototype,"forceMobileMenuOpen",void 0),Vi([o.property({type:Boolean})],Xi.prototype,"forceMenuOpen",void 0),Vi([o.property()],Xi.prototype,"baseUrl",void 0),Vi([o.property()],Xi.prototype,"apiIntegrationIdentifier",void 0),Vi([o.property()],Xi.prototype,"contentLocale",void 0),Vi([o.state()],Xi.prototype,"availableContentLocales",void 0),Vi([o.state()],Xi.prototype,"availableContentLocalesInitialized",void 0),Vi([o.property()],Xi.prototype,"uiLocale",void 0),Vi([e.jsonProperty({})],Xi.prototype,"labels",void 0),Vi([e.jsonProperty([])],Xi.prototype,"displayedFilters",void 0),Vi([e.jsonProperty([])],Xi.prototype,"presets",void 0),Vi([o.property({type:String,reflect:!0})],Xi.prototype,"selectedPreset",void 0),Vi([e.jsonProperty([])],Xi.prototype,"priors",void 0),Vi([o.property()],Xi.prototype,"searchRequestSerializer",void 0),Vi([o.state()],Xi.prototype,"searchFilters",void 0),Vi([o.state()],Xi.prototype,"sizeCategory",void 0),Vi([o.state()],Xi.prototype,"displayFacets",void 0),Vi([o.state()],Xi.prototype,"mobileMenuOpen",void 0),Vi([o.state()],Xi.prototype,"facets",void 0),Vi([o.state()],Xi.prototype,"facetsInitialized",void 0),Vi([o.query(".ft-search-bar--container")],Xi.prototype,"container",void 0),Vi([o.query(".ft-search-bar--filters-opener")],Xi.prototype,"filtersOpener",void 0),Vi([o.query(".ft-search-bar--floating-panel")],Xi.prototype,"floatingContainer",void 0),Vi([o.query("ft-snap-scroll.ft-search-bar--filters-container")],Xi.prototype,"scrollingFiltersContainer",void 0),Vi([o.query(".ft-search-bar--input")],Xi.prototype,"input",void 0),Vi([o.state()],Xi.prototype,"query",void 0),Vi([o.state()],Xi.prototype,"suggestions",void 0),Vi([o.state()],Xi.prototype,"recentSearches",void 0),Vi([o.state()],Xi.prototype,"scrollToFacet",void 0),Vi([o.state()],Xi.prototype,"api",void 0),e.customElement("ft-search-bar")(Xi),t.DEFAULT_LABELS=Ki,t.FtSearchBar=Xi,t.FtSearchBarCssVariables=Ti,t.LaunchSearchEvent=qi,t.SearchStateChangeEvent=Wi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|