@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
|
@@ -55,30 +55,30 @@ var l;const a=null!=(null===(l=window.HTMLSlotElement)||void 0===l?void 0:l.prot
|
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2019 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const d=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),u=new
|
|
58
|
+
*/const d=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),u=new WeakMap;class b{constructor(t,e,i){if(this._$cssResult$=!0,i!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(d&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=u.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&u.set(e,t))}return t}toString(){return this.cssText}}const v=t=>new b("string"==typeof t?t:t+"",void 0,f),g=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new b(i,t,f)},x=(t,e)=>{d?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=window.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))},y=d?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return v(e)})(t):t
|
|
59
59
|
/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2017 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/;var m;const $=window.trustedTypes,w=$?$.emptyScript:"",k=window.reactiveElementPolyfillSupport,S={toAttribute(t,e){switch(e){case Boolean:t=t?w:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},O=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:O};class
|
|
63
|
+
*/;var m;const $=window.trustedTypes,w=$?$.emptyScript:"",k=window.reactiveElementPolyfillSupport,S={toAttribute(t,e){switch(e){case Boolean:t=t?w:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},O=(t,e)=>e!==t&&(e==e||t==t),C={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:O};class E extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const s=this[t];this[e]=o,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||C}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(y(t))}else void 0!==t&&e.push(y(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return x(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=C){var o,s;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const r=(null!==(s=null===(o=i.converter)||void 0===o?void 0:o.toAttribute)&&void 0!==s?s:S.toAttribute)(e,i.type);this._$El=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$El=null}}_$AK(t,e){var i,o;const s=this.constructor,n=s._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=s.getPropertyOptions(n),r=t.converter,l=null!==(o=null!==(i=null==r?void 0:r.fromAttribute)&&void 0!==i?i:"function"==typeof r?r:null)&&void 0!==o?o:S.fromAttribute;this._$El=n,this[n]=l(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||O)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
64
64
|
/**
|
|
65
65
|
* @license
|
|
66
66
|
* Copyright 2017 Google LLC
|
|
67
67
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
68
|
*/
|
|
69
|
-
var E
|
|
69
|
+
var z;E.finalized=!0,E.elementProperties=new Map,E.elementStyles=[],E.shadowRootOptions={mode:"open"},null==k||k({ReactiveElement:E}),(null!==(m=globalThis.reactiveElementVersions)&&void 0!==m?m:globalThis.reactiveElementVersions=[]).push("1.3.4");const B=globalThis.trustedTypes,M=B?B.createPolicy("lit-html",{createHTML:t=>t}):void 0,F=`lit$${(Math.random()+"").slice(9)}$`,N="?"+F,R=`<${N}>`,L=document,D=(t="")=>L.createComment(t),j=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,P=t=>I(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,T=/>/g,_=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),H=/'/g,Z=/"/g,K=/^(?:script|style|textarea|title)$/i,W=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),V=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),J=new WeakMap,X=L.createTreeWalker(L,129,null,!1),Y=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=U;for(let e=0;e<i;e++){const i=t[e];let l,a,c=-1,h=0;for(;h<i.length&&(r.lastIndex=h,a=r.exec(i),null!==a);)h=r.lastIndex,r===U?"!--"===a[1]?r=A:void 0!==a[1]?r=T:void 0!==a[2]?(K.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=_):void 0!==a[3]&&(r=_):r===_?">"===a[0]?(r=null!=s?s:U,c=-1):void 0===a[1]?c=-2:(c=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?_:'"'===a[3]?Z:H):r===Z||r===H?r=_:r===A||r===T?r=U:(r=_,s=void 0);const p=r===_&&t[e+1].startsWith("/>")?" ":"";n+=r===U?i+R:c>=0?(o.push(l),i.slice(0,c)+"$lit$"+i.slice(c)+F+p):i+F+(-2===c?(o.push(void 0),e):p)}const l=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==M?M.createHTML(l):l,o]};class Q{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[a,c]=Y(t,e);if(this.el=Q.createElement(a,i),X.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=X.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(F)){const i=c[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(F),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?ot:"?"===e[1]?nt:"@"===e[1]?rt:it})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(K.test(o.tagName)){const t=o.textContent.split(F),e=t.length-1;if(e>0){o.textContent=B?B.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],D()),X.nextNode(),l.push({type:2,index:++s});o.append(t[e],D())}}}else if(8===o.nodeType)if(o.data===N)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(F,t+1));)l.push({type:7,index:s}),t+=F.length-1}s++}}static createElement(t,e){const i=L.createElement("template");return i.innerHTML=t,i}}function G(t,e,i=t,o){var s,n,r,l;if(e===V)return e;let a=void 0!==o?null===(s=i._$Cl)||void 0===s?void 0:s[o]:i._$Cu;const c=j(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==c&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===c?a=void 0:(a=new c(t),a._$AT(t,i,o)),void 0!==o?(null!==(r=(l=i)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=a:i._$Cu=a),void 0!==a&&(e=G(t,a._$AS(t,e.values),a,o)),e}class tt{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:L).importNode(i,!0);X.currentNode=s;let n=X.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new et(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new lt(n,this,t)),this.v.push(e),a=o[++l]}r!==(null==a?void 0:a.index)&&(n=X.nextNode(),r++)}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 et{constructor(t,e,i,o){var s;this.type=2,this._$AH=q,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=G(this,t,e),j(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==V&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):P(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!==q&&j(this._$AH)?this._$AA.nextSibling.data=t:this.k(L.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=Q.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 tt(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=J.get(t.strings);return void 0===e&&J.set(t.strings,e=new Q(t)),e}S(t){I(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 et(this.j(D()),this.j(D()),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 it{constructor(t,e,i,o,s){this.type=1,this._$AH=q,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=q}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=G(this,t,e,0),n=!j(t)||t!==this._$AH&&t!==V,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=G(this,o[i+r],e,r),l===V&&(l=this._$AH[r]),n||(n=!j(l)||l!==this._$AH[r]),l===q?t=q:t!==q&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ot extends it{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===q?void 0:t}}const st=B?B.emptyScript:"";class nt extends it{constructor(){super(...arguments),this.type=4}P(t){t&&t!==q?this.element.setAttribute(this.name,st):this.element.removeAttribute(this.name)}}class rt extends it{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=G(this,t,e,0))&&void 0!==i?i:q)===V)return;const o=this._$AH,s=t===q&&o!==q||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==q&&(o===q||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class lt{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){G(this,t)}}const at={A:"$lit$",C:F,M:N,L:1,R:Y,V:tt,D:P,I:G,H:et,N:it,U:nt,B:rt,F:ot,W:lt},ct=window.litHtmlPolyfillSupport;
|
|
70
70
|
/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2017 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
74
|
*/
|
|
75
|
-
var ht,pt;null==ct||ct(Q,et),(null!==(
|
|
75
|
+
var ht,pt;null==ct||ct(Q,et),(null!==(z=globalThis.litHtmlVersions)&&void 0!==z?z:globalThis.litHtmlVersions=[]).push("2.2.7");class dt extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var o,s;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let r=n._$litPart$;if(void 0===r){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;n._$litPart$=r=new et(e.insertBefore(D(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return V}}dt.finalized=!0,dt._$litElement$=!0,null===(ht=globalThis.litElementHydrateSupport)||void 0===ht||ht.call(globalThis,{LitElement:dt});const ft=globalThis.litElementPolyfillSupport;null==ft||ft({LitElement:dt}),(null!==(pt=globalThis.litElementVersions)&&void 0!==pt?pt:globalThis.litElementVersions=[]).push("3.2.2");class ut{static create(t,e,i){let o=t=>v(null!=t?t:i),s=g`var(${v(t)}, ${o(i)})`;return s.name=t,s.category=e,s.defaultValue=i,s.defaultCssValue=o,s.get=e=>g`var(${v(t)}, ${o(e)})`,s.breadcrumb=()=>[],s.lastResortDefaultValue=()=>i,s}static extend(t,e,i){let o=t=>e.get(null!=t?t:i),s=g`var(${v(t)}, ${o(i)})`;return s.name=t,s.category=e.category,s.fallbackVariable=e,s.defaultValue=i,s.defaultCssValue=o,s.get=e=>g`var(${v(t)}, ${o(e)})`,s.breadcrumb=()=>[e.name,...e.breadcrumb()],s.lastResortDefaultValue=()=>i,s}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):v(null!=e?e:t.defaultValue),o=g`var(${v(t.name)}, ${i(t.defaultValue)})`;return o.name=t.name,o.category=t.category,o.fallbackVariable=t.fallbackVariable,o.defaultValue=t.defaultValue,o.context=e,o.defaultCssValue=i,o.get=e=>g`var(${v(t.name)}, ${i(e)})`,o.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],o.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},o}}function bt(t,e){return v(`${t.name}: ${e}`)}const vt={colorPrimary:ut.create("--ft-color-primary","COLOR","#2196F3"),colorPrimaryVariant:ut.create("--ft-color-primary-variant","COLOR","#1976D2"),colorSecondary:ut.create("--ft-color-secondary","COLOR","#FFCC80"),colorSecondaryVariant:ut.create("--ft-color-secondary-variant","COLOR","#F57C00"),colorSurface:ut.create("--ft-color-surface","COLOR","#FFFFFF"),colorContent:ut.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),colorError:ut.create("--ft-color-error","COLOR","#B00020"),colorOutline:ut.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),colorOpacityHigh:ut.create("--ft-color-opacity-high","NUMBER","1"),colorOpacityMedium:ut.create("--ft-color-opacity-medium","NUMBER","0.74"),colorOpacityDisabled:ut.create("--ft-color-opacity-disabled","NUMBER","0.38"),colorOnPrimary:ut.create("--ft-color-on-primary","COLOR","#FFFFFF"),colorOnPrimaryHigh:ut.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),colorOnPrimaryMedium:ut.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnPrimaryDisabled:ut.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSecondary:ut.create("--ft-color-on-secondary","COLOR","#FFFFFF"),colorOnSecondaryHigh:ut.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),colorOnSecondaryMedium:ut.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnSecondaryDisabled:ut.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSurface:ut.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceHigh:ut.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceMedium:ut.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),colorOnSurfaceDisabled:ut.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),opacityContentOnSurfaceDisabled:ut.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),opacityContentOnSurfaceEnable:ut.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),opacityContentOnSurfaceHover:ut.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),opacityContentOnSurfaceFocused:ut.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),opacityContentOnSurfacePressed:ut.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),opacityContentOnSurfaceSelected:ut.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),opacityContentOnSurfaceDragged:ut.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),opacityPrimaryOnSurfaceDisabled:ut.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),opacityPrimaryOnSurfaceEnable:ut.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),opacityPrimaryOnSurfaceHover:ut.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),opacityPrimaryOnSurfaceFocused:ut.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),opacityPrimaryOnSurfacePressed:ut.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),opacityPrimaryOnSurfaceSelected:ut.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),opacityPrimaryOnSurfaceDragged:ut.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),opacitySurfaceOnPrimaryDisabled:ut.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),opacitySurfaceOnPrimaryEnable:ut.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),opacitySurfaceOnPrimaryHover:ut.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),opacitySurfaceOnPrimaryFocused:ut.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),opacitySurfaceOnPrimaryPressed:ut.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),opacitySurfaceOnPrimarySelected:ut.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),opacitySurfaceOnPrimaryDragged:ut.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),elevation00:ut.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),elevation01:ut.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation02:ut.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation03:ut.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),elevation04:ut.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),elevation06:ut.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),elevation08:ut.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),elevation12:ut.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),elevation16:ut.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),elevation24:ut.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),borderRadiusS:ut.create("--ft-border-radius-S","SIZE","4px"),borderRadiusM:ut.create("--ft-border-radius-M","SIZE","8px"),borderRadiusL:ut.create("--ft-border-radius-L","SIZE","12px"),borderRadiusXL:ut.create("--ft-border-radius-XL","SIZE","16px"),titleFont:ut.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),contentFont:ut.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),transitionDuration:ut.create("--ft-transition-duration","UNKNOWN","250ms"),transitionTimingFunction:ut.create("--ft-transition-timing-function","UNKNOWN","ease-in-out")};
|
|
76
76
|
/**
|
|
77
77
|
* @license
|
|
78
78
|
* Copyright 2021 Google LLC
|
|
79
79
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
80
|
-
*/var gt=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class xt extends(function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:i,shadowRootOptions:o}=t;i&&!e&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach((([e,i])=>t.registry.define(e,i))));const s=this.renderOptions.creationScope=this.attachShadow({...o,customElements:t.registry});return x(s,this.constructor.elementStyles),s}}}(dt)){getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),
|
|
81
|
-
${t.map((t=>
|
|
80
|
+
*/var gt=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class xt extends(function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:i,shadowRootOptions:o}=t;i&&!e&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach((([e,i])=>t.registry.define(e,i))));const s=this.renderOptions.creationScope=this.attachShadow({...o,customElements:t.registry});return x(s,this.constructor.elementStyles),s}}}(dt)){getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),W`
|
|
81
|
+
${t.map((t=>W`
|
|
82
82
|
<style>${t}</style>
|
|
83
83
|
`))}
|
|
84
84
|
${this.getTemplate()}
|
|
@@ -91,26 +91,26 @@ var ht,pt;null==ct||ct(Q,et),(null!==(E=globalThis.litHtmlVersions)&&void 0!==E?
|
|
|
91
91
|
-ms-user-select: none;
|
|
92
92
|
user-select: none;
|
|
93
93
|
}
|
|
94
|
-
`;class mt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,o;let s=null!==(o=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==o?o:"";return e.forEach(((t,e)=>s=s.replace(new RegExp(`\\{${e}\\}`,"g"),t))),s}}var $t,wt,kt;const St=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(kt=null===(wt=null===($t=window.safari)||void 0===$t?void 0:$t.pushNotification)||void 0===wt?void 0:wt.toString())&&void 0!==kt?kt:""),Ot=1,Ct=2,
|
|
94
|
+
`;class mt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,o;let s=null!==(o=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==o?o:"";return e.forEach(((t,e)=>s=s.replace(new RegExp(`\\{${e}\\}`,"g"),t))),s}}var $t,wt,kt;const St=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(kt=null===(wt=null===($t=window.safari)||void 0===$t?void 0:$t.pushNotification)||void 0===wt?void 0:wt.toString())&&void 0!==kt?kt:""),Ot=1,Ct=2,Et=t=>(...e)=>({_$litDirective$:t,values:e});
|
|
95
95
|
/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2017 Google LLC
|
|
98
98
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
-
*/class
|
|
99
|
+
*/class zt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
100
100
|
/**
|
|
101
101
|
* @license
|
|
102
102
|
* Copyright 2020 Google LLC
|
|
103
103
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
|
-
*/const{H:Bt}=at,Mt=()=>document.createComment(""),
|
|
104
|
+
*/const{H:Bt}=at,Mt=()=>document.createComment(""),Ft=(t,e,i)=>{var o;const s=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(Mt(),n),o=s.insertBefore(Mt(),n);i=new Bt(e,o,t,t.options)}else{const e=i._$AB.nextSibling,r=i._$AM,l=r!==t;if(l){let e;null===(o=i._$AQ)||void 0===o||o.call(i,t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==r._$AU&&i._$AP(e)}if(e!==n||l){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,n),t=e}}}return i},Nt=(t,e,i=t)=>(t._$AI(e,i),t),Rt={},Lt=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let i=t._$AA;const o=t._$AB.nextSibling;for(;i!==o;){const t=i.nextSibling;i.remove(),i=t}},Dt=(t,e,i)=>{const o=new Map;for(let s=e;s<=i;s++)o.set(t[s],s);return o},jt=Et(class extends zt{constructor(t){if(super(t),t.type!==Ct)throw Error("repeat() can only be used in text expressions")}ht(t,e,i){let o;void 0===i?i=e:void 0!==e&&(o=e);const s=[],n=[];let r=0;for(const e of t)s[r]=o?o(e,r):r,n[r]=i(e,r),r++;return{values:n,keys:s}}render(t,e,i){return this.ht(t,e,i).values}update(t,[e,i,o]){var s;const n=(t=>t._$AH)(t),{values:r,keys:l}=this.ht(e,i,o);if(!Array.isArray(n))return this.ut=l,r;const a=null!==(s=this.ut)&&void 0!==s?s:this.ut=[],c=[];let h,p,d=0,f=n.length-1,u=0,b=r.length-1;for(;d<=f&&u<=b;)if(null===n[d])d++;else if(null===n[f])f--;else if(a[d]===l[u])c[u]=Nt(n[d],r[u]),d++,u++;else if(a[f]===l[b])c[b]=Nt(n[f],r[b]),f--,b--;else if(a[d]===l[b])c[b]=Nt(n[d],r[b]),Ft(t,c[b+1],n[d]),d++,b--;else if(a[f]===l[u])c[u]=Nt(n[f],r[u]),Ft(t,n[d],n[f]),f--,u++;else if(void 0===h&&(h=Dt(l,u,b),p=Dt(a,d,f)),h.has(a[d]))if(h.has(a[f])){const e=p.get(l[u]),i=void 0!==e?n[e]:null;if(null===i){const e=Ft(t,n[d]);Nt(e,r[u]),c[u]=e}else c[u]=Nt(i,r[u]),Ft(t,n[d],i),n[e]=null;u++}else Lt(n[f]),f--;else Lt(n[d]),d++;for(;u<=b;){const e=Ft(t,c[b+1]);Nt(e,r[u]),c[u++]=e}for(;d<=f;){const t=n[d++];null!==t&&Lt(t)}return this.ut=l,((t,e=Rt)=>{t._$AH=e})(t,c),V}});
|
|
105
105
|
/**
|
|
106
106
|
* @license
|
|
107
107
|
* Copyright 2017 Google LLC
|
|
108
108
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
109
|
-
*/var Pt
|
|
109
|
+
*/var It,Pt=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.S="S",t.M="M",t.L="L",t.XL="XL",t.XXL="XXL"}(It||(It={}));class Ut extends CustomEvent{constructor(t,e){super("change",{detail:{size:t,category:e}})}}class At extends xt{constructor(){super(...arguments),this.debounceTimeout=100,this.local=!1,this.size=0,this.category=It.S,this.resizeObserver=new ResizeObserver((()=>this.updateSize())),this.debouncer=new e}render(){return W`
|
|
110
110
|
<div class="ft-size-watcher--pixel ${this.local?"ft-size-watcher--local":""}">
|
|
111
111
|
<div class="ft-size-watcher--watcher"></div>
|
|
112
112
|
</div>
|
|
113
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.watcher&&this.resizeObserver.observe(this.watcher),this.updateSize()}updateSize(){this.debouncer.run((()=>{this.watcher&&this.size!==this.watcher.clientWidth&&(this.size=this.watcher.clientWidth,this.size<768?this.category=
|
|
113
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.watcher&&this.resizeObserver.observe(this.watcher),this.updateSize()}updateSize(){this.debouncer.run((()=>{this.watcher&&this.size!==this.watcher.clientWidth&&(this.size=this.watcher.clientWidth,this.size<768?this.category=It.S:this.size<976?this.category=It.M:this.size<1024?this.category=It.L:this.size<1440?this.category=It.XL:this.category=It.XXL,this.dispatchEvent(new Ut(this.size,this.category)))}),this.debounceTimeout)}}At.elementDefinitions={},At.styles=g`
|
|
114
114
|
.ft-size-watcher--pixel {
|
|
115
115
|
width: 0;
|
|
116
116
|
height: 0;
|
|
@@ -129,51 +129,60 @@ var ht,pt;null==ct||ct(Q,et),(null!==(E=globalThis.litHtmlVersions)&&void 0!==E?
|
|
|
129
129
|
.ft-size-watcher--local .ft-size-watcher--watcher {
|
|
130
130
|
width: 100%;
|
|
131
131
|
}
|
|
132
|
-
`,
|
|
132
|
+
`,Pt([o({type:Number})],At.prototype,"debounceTimeout",void 0),Pt([o({type:Boolean})],At.prototype,"local",void 0),Pt([o({type:Number,reflect:!0})],At.prototype,"size",void 0),Pt([o({type:String,reflect:!0})],At.prototype,"category",void 0),Pt([r(".ft-size-watcher--watcher")],At.prototype,"watcher",void 0),h("ft-size-watcher")(At);
|
|
133
133
|
/**
|
|
134
134
|
* @license
|
|
135
135
|
* Copyright 2020 Google LLC
|
|
136
136
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
137
137
|
*/
|
|
138
|
-
const
|
|
138
|
+
const Tt=Symbol.for(""),_t=t=>{if((null==t?void 0:t.r)===Tt)return null==t?void 0:t._$litStatic$},Ht=t=>({_$litStatic$:t,r:Tt}),Zt=new Map,Kt=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],l=[];let a,c=0,h=!1;for(;c<o;){for(a=e[c];c<o&&void 0!==(n=i[c],s=_t(n));)a+=s+e[++c],h=!0;l.push(n),r.push(a),c++}if(c===o&&r.push(e[o]),h){const t=r.join("$$lit$$");void 0===(e=Zt.get(t))&&(r.raw=r,Zt.set(t,e=r)),i=l}return t(e,...i)})(W);var Wt,Vt=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!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"}(Wt||(Wt={}));const qt=ut.extend("--ft-typography-font-family",vt.titleFont),Jt=ut.extend("--ft-typography-font-family",vt.contentFont),Xt={fontFamily:Jt,fontSize:ut.create("--ft-typography-font-size","SIZE","16px"),fontWeight:ut.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:ut.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:ut.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:ut.create("--ft-typography-text-transform","UNKNOWN","inherit")},Yt=ut.extend("--ft-typography-title-font-family",qt),Qt=ut.extend("--ft-typography-title-font-size",Xt.fontSize,"20px"),Gt=ut.extend("--ft-typography-title-font-weight",Xt.fontWeight,"normal"),te=ut.extend("--ft-typography-title-letter-spacing",Xt.letterSpacing,"0.15px"),ee=ut.extend("--ft-typography-title-line-height",Xt.lineHeight,"1.2"),ie=ut.extend("--ft-typography-title-text-transform",Xt.textTransform,"inherit"),oe=ut.extend("--ft-typography-title-dense-font-family",qt),se=ut.extend("--ft-typography-title-dense-font-size",Xt.fontSize,"14px"),ne=ut.extend("--ft-typography-title-dense-font-weight",Xt.fontWeight,"normal"),re=ut.extend("--ft-typography-title-dense-letter-spacing",Xt.letterSpacing,"0.105px"),le=ut.extend("--ft-typography-title-dense-line-height",Xt.lineHeight,"1.7"),ae=ut.extend("--ft-typography-title-dense-text-transform",Xt.textTransform,"inherit"),ce=ut.extend("--ft-typography-subtitle1-font-family",Jt),he=ut.extend("--ft-typography-subtitle1-font-size",Xt.fontSize,"16px"),pe=ut.extend("--ft-typography-subtitle1-font-weight",Xt.fontWeight,"600"),de=ut.extend("--ft-typography-subtitle1-letter-spacing",Xt.letterSpacing,"0.144px"),fe=ut.extend("--ft-typography-subtitle1-line-height",Xt.lineHeight,"1.5"),ue=ut.extend("--ft-typography-subtitle1-text-transform",Xt.textTransform,"inherit"),be=ut.extend("--ft-typography-subtitle2-font-family",Jt),ve=ut.extend("--ft-typography-subtitle2-font-size",Xt.fontSize,"14px"),ge=ut.extend("--ft-typography-subtitle2-font-weight",Xt.fontWeight,"normal"),xe=ut.extend("--ft-typography-subtitle2-letter-spacing",Xt.letterSpacing,"0.098px"),ye=ut.extend("--ft-typography-subtitle2-line-height",Xt.lineHeight,"1.7"),me=ut.extend("--ft-typography-subtitle2-text-transform",Xt.textTransform,"inherit"),$e={fontFamily:ut.extend("--ft-typography-body1-font-family",Jt),fontSize:ut.extend("--ft-typography-body1-font-size",Xt.fontSize,"16px"),fontWeight:ut.extend("--ft-typography-body1-font-weight",Xt.fontWeight,"normal"),letterSpacing:ut.extend("--ft-typography-body1-letter-spacing",Xt.letterSpacing,"0.496px"),lineHeight:ut.extend("--ft-typography-body1-line-height",Xt.lineHeight,"1.5"),textTransform:ut.extend("--ft-typography-body1-text-transform",Xt.textTransform,"inherit")},we={fontFamily:ut.extend("--ft-typography-body2-font-family",Jt),fontSize:ut.extend("--ft-typography-body2-font-size",Xt.fontSize,"14px"),fontWeight:ut.extend("--ft-typography-body2-font-weight",Xt.fontWeight,"normal"),letterSpacing:ut.extend("--ft-typography-body2-letter-spacing",Xt.letterSpacing,"0.252px"),lineHeight:ut.extend("--ft-typography-body2-line-height",Xt.lineHeight,"1.4"),textTransform:ut.extend("--ft-typography-body2-text-transform",Xt.textTransform,"inherit")},ke={fontFamily:ut.extend("--ft-typography-caption-font-family",Jt),fontSize:ut.extend("--ft-typography-caption-font-size",Xt.fontSize,"12px"),fontWeight:ut.extend("--ft-typography-caption-font-weight",Xt.fontWeight,"normal"),letterSpacing:ut.extend("--ft-typography-caption-letter-spacing",Xt.letterSpacing,"0.396px"),lineHeight:ut.extend("--ft-typography-caption-line-height",Xt.lineHeight,"1.33"),textTransform:ut.extend("--ft-typography-caption-text-transform",Xt.textTransform,"inherit")},Se=ut.extend("--ft-typography-breadcrumb-font-family",Jt),Oe=ut.extend("--ft-typography-breadcrumb-font-size",Xt.fontSize,"10px"),Ce=ut.extend("--ft-typography-breadcrumb-font-weight",Xt.fontWeight,"normal"),Ee=ut.extend("--ft-typography-breadcrumb-letter-spacing",Xt.letterSpacing,"0.33px"),ze=ut.extend("--ft-typography-breadcrumb-line-height",Xt.lineHeight,"1.6"),Be=ut.extend("--ft-typography-breadcrumb-text-transform",Xt.textTransform,"inherit"),Me=ut.extend("--ft-typography-overline-font-family",Jt),Fe=ut.extend("--ft-typography-overline-font-size",Xt.fontSize,"10px"),Ne=ut.extend("--ft-typography-overline-font-weight",Xt.fontWeight,"normal"),Re=ut.extend("--ft-typography-overline-letter-spacing",Xt.letterSpacing,"1.5px"),Le=ut.extend("--ft-typography-overline-line-height",Xt.lineHeight,"1.6"),De=ut.extend("--ft-typography-overline-text-transform",Xt.textTransform,"uppercase"),je={fontFamily:ut.extend("--ft-typography-button-font-family",Jt),fontSize:ut.extend("--ft-typography-button-font-size",Xt.fontSize,"14px"),fontWeight:ut.extend("--ft-typography-button-font-weight",Xt.fontWeight,"600"),letterSpacing:ut.extend("--ft-typography-button-letter-spacing",Xt.letterSpacing,"1.246px"),lineHeight:ut.extend("--ft-typography-button-line-height",Xt.lineHeight,"1.15"),textTransform:ut.extend("--ft-typography-button-text-transform",Xt.textTransform,"uppercase")},Ie=g`
|
|
139
139
|
.ft-typography--title {
|
|
140
|
-
font-family: ${
|
|
141
|
-
font-size: ${
|
|
142
|
-
font-weight: ${
|
|
143
|
-
letter-spacing: ${
|
|
144
|
-
line-height: ${
|
|
145
|
-
text-transform: ${
|
|
146
|
-
}
|
|
147
|
-
`,
|
|
140
|
+
font-family: ${Yt};
|
|
141
|
+
font-size: ${Qt};
|
|
142
|
+
font-weight: ${Gt};
|
|
143
|
+
letter-spacing: ${te};
|
|
144
|
+
line-height: ${ee};
|
|
145
|
+
text-transform: ${ie};
|
|
146
|
+
}
|
|
147
|
+
`,Pe=g`
|
|
148
148
|
.ft-typography--title-dense {
|
|
149
|
-
font-family: ${
|
|
150
|
-
font-size: ${
|
|
151
|
-
font-weight: ${
|
|
152
|
-
letter-spacing: ${
|
|
153
|
-
line-height: ${
|
|
154
|
-
text-transform: ${
|
|
149
|
+
font-family: ${oe};
|
|
150
|
+
font-size: ${se};
|
|
151
|
+
font-weight: ${ne};
|
|
152
|
+
letter-spacing: ${re};
|
|
153
|
+
line-height: ${le};
|
|
154
|
+
text-transform: ${ae};
|
|
155
155
|
}
|
|
156
|
-
`,
|
|
156
|
+
`,Ue=g`
|
|
157
157
|
.ft-typography--subtitle1 {
|
|
158
|
-
font-family: ${
|
|
159
|
-
font-size: ${
|
|
160
|
-
font-weight: ${
|
|
161
|
-
letter-spacing: ${
|
|
162
|
-
line-height: ${
|
|
163
|
-
text-transform: ${
|
|
158
|
+
font-family: ${ce};
|
|
159
|
+
font-size: ${he};
|
|
160
|
+
font-weight: ${pe};
|
|
161
|
+
letter-spacing: ${de};
|
|
162
|
+
line-height: ${fe};
|
|
163
|
+
text-transform: ${ue};
|
|
164
164
|
}
|
|
165
|
-
`,
|
|
165
|
+
`,Ae=g`
|
|
166
166
|
.ft-typography--subtitle2 {
|
|
167
|
-
font-family: ${
|
|
168
|
-
font-size: ${
|
|
169
|
-
font-weight: ${
|
|
170
|
-
letter-spacing: ${
|
|
171
|
-
line-height: ${
|
|
172
|
-
text-transform: ${
|
|
167
|
+
font-family: ${be};
|
|
168
|
+
font-size: ${ve};
|
|
169
|
+
font-weight: ${ge};
|
|
170
|
+
letter-spacing: ${xe};
|
|
171
|
+
line-height: ${ye};
|
|
172
|
+
text-transform: ${me};
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
`,
|
|
175
|
+
`,Te=g`
|
|
176
176
|
.ft-typography--body1 {
|
|
177
|
+
font-family: ${$e.fontFamily};
|
|
178
|
+
font-size: ${$e.fontSize};
|
|
179
|
+
font-weight: ${$e.fontWeight};
|
|
180
|
+
letter-spacing: ${$e.letterSpacing};
|
|
181
|
+
line-height: ${$e.lineHeight};
|
|
182
|
+
text-transform: ${$e.textTransform};
|
|
183
|
+
}
|
|
184
|
+
`,_e=g`
|
|
185
|
+
.ft-typography--body2 {
|
|
177
186
|
font-family: ${we.fontFamily};
|
|
178
187
|
font-size: ${we.fontSize};
|
|
179
188
|
font-weight: ${we.fontWeight};
|
|
@@ -182,7 +191,7 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
182
191
|
text-transform: ${we.textTransform};
|
|
183
192
|
}
|
|
184
193
|
`,He=g`
|
|
185
|
-
.ft-typography--
|
|
194
|
+
.ft-typography--caption {
|
|
186
195
|
font-family: ${ke.fontFamily};
|
|
187
196
|
font-size: ${ke.fontSize};
|
|
188
197
|
font-weight: ${ke.fontWeight};
|
|
@@ -191,31 +200,22 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
191
200
|
text-transform: ${ke.textTransform};
|
|
192
201
|
}
|
|
193
202
|
`,Ze=g`
|
|
194
|
-
.ft-typography--caption {
|
|
195
|
-
font-family: ${Se.fontFamily};
|
|
196
|
-
font-size: ${Se.fontSize};
|
|
197
|
-
font-weight: ${Se.fontWeight};
|
|
198
|
-
letter-spacing: ${Se.letterSpacing};
|
|
199
|
-
line-height: ${Se.lineHeight};
|
|
200
|
-
text-transform: ${Se.textTransform};
|
|
201
|
-
}
|
|
202
|
-
`,Ke=g`
|
|
203
203
|
.ft-typography--breadcrumb {
|
|
204
|
-
font-family: ${
|
|
205
|
-
font-size: ${
|
|
206
|
-
font-weight: ${
|
|
204
|
+
font-family: ${Se};
|
|
205
|
+
font-size: ${Oe};
|
|
206
|
+
font-weight: ${Ce};
|
|
207
207
|
letter-spacing: ${Ee};
|
|
208
|
-
line-height: ${
|
|
209
|
-
text-transform: ${
|
|
208
|
+
line-height: ${ze};
|
|
209
|
+
text-transform: ${Be};
|
|
210
210
|
}
|
|
211
|
-
`,
|
|
211
|
+
`,Ke=g`
|
|
212
212
|
.ft-typography--overline {
|
|
213
|
-
font-family: ${
|
|
214
|
-
font-size: ${
|
|
215
|
-
font-weight: ${
|
|
216
|
-
letter-spacing: ${
|
|
217
|
-
line-height: ${
|
|
218
|
-
text-transform: ${
|
|
213
|
+
font-family: ${Me};
|
|
214
|
+
font-size: ${Fe};
|
|
215
|
+
font-weight: ${Ne};
|
|
216
|
+
letter-spacing: ${Re};
|
|
217
|
+
line-height: ${Le};
|
|
218
|
+
text-transform: ${De};
|
|
219
219
|
}
|
|
220
220
|
`,We=g`
|
|
221
221
|
.ft-typography--button {
|
|
@@ -226,18 +226,24 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
226
226
|
line-height: ${je.lineHeight};
|
|
227
227
|
text-transform: ${je.textTransform};
|
|
228
228
|
}
|
|
229
|
-
`;class
|
|
230
|
-
<${
|
|
229
|
+
`;class Ve extends xt{constructor(){super(...arguments),this.variant=Wt.body1}render(){return this.element?Kt`
|
|
230
|
+
<${Ht(this.element)}
|
|
231
231
|
class="ft-typography ft-typography--${this.variant}">
|
|
232
232
|
<slot></slot>
|
|
233
|
-
</${
|
|
234
|
-
`:
|
|
233
|
+
</${Ht(this.element)}>
|
|
234
|
+
`:Kt`
|
|
235
235
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
236
|
-
`}}function
|
|
236
|
+
`}}function qe(t,e){return t.flatMap((t=>[t,...qe(e(t),e)]))}function Je(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function Xe(t,e){return{label:t.label,selected:!e&&t.selected,subOptions:t.childNodes.map((e=>Xe(e,t.selected))),value:t.value}}function Ye(t){return{id:t.key,label:t.label,multivalued:t.multiSelectionable,options:t.rootNodes.map((t=>Xe(t,!1)))}}Ve.styles=[Ie,Pe,Ue,Ae,Te,_e,He,Ze,Ke,We,g`
|
|
237
237
|
.ft-typography {
|
|
238
238
|
vertical-align: inherit;
|
|
239
239
|
}
|
|
240
|
-
`],
|
|
240
|
+
`],Vt([o()],Ve.prototype,"element",void 0),Vt([o()],Ve.prototype,"variant",void 0),h("ft-typography")(Ve);
|
|
241
|
+
/**
|
|
242
|
+
* @license
|
|
243
|
+
* Copyright 2018 Google LLC
|
|
244
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
245
|
+
*/
|
|
246
|
+
const Qe=Et(class extends zt{constructor(t){var e;if(super(t),t.type!==Ot||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,o;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const s=t.element.classList;this.nt.forEach((t=>{t in e||(s.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(s.add(t),this.nt.add(t)):(s.remove(t),this.nt.delete(t)))}return V}});var Ge=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const ti=ut.extend("--ft-ripple-color",vt.colorContent),ei={color:ti,backgroundColor:ut.extend("--ft-ripple-background-color",ti),opacityContentOnSurfacePressed:ut.external(vt.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:ut.external(vt.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:ut.external(vt.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:ut.external(vt.opacityContentOnSurfaceSelected,"Design system")},ii=ut.extend("--ft-ripple-color",vt.colorPrimary),oi=ii,si=ut.extend("--ft-ripple-background-color",ii),ni=ut.extend("--ft-ripple-color",vt.colorSecondary),ri=ni,li=ut.extend("--ft-ripple-background-color",ni);class ai extends xt{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(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),n=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.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 W`
|
|
241
247
|
<style>
|
|
242
248
|
.ft-ripple .ft-ripple--effect,
|
|
243
249
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -250,7 +256,7 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
250
256
|
top: ${this.originY}px;
|
|
251
257
|
}
|
|
252
258
|
</style>
|
|
253
|
-
<div class="${
|
|
259
|
+
<div class="${Qe(t)}">
|
|
254
260
|
<div class="ft-ripple--background"></div>
|
|
255
261
|
<div class="ft-ripple--effect"></div>
|
|
256
262
|
</div>
|
|
@@ -343,7 +349,7 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
343
349
|
opacity: ${ei.opacityContentOnSurfacePressed};
|
|
344
350
|
transform: translate(-50%, -50%) scale(1);
|
|
345
351
|
}
|
|
346
|
-
`,Ge([o({type:Boolean})],ai.prototype,"primary",void 0),Ge([o({type:Boolean})],ai.prototype,"secondary",void 0),Ge([o({type:Boolean})],ai.prototype,"unbounded",void 0),Ge([o({type:Boolean})],ai.prototype,"activated",void 0),Ge([o({type:Boolean})],ai.prototype,"selected",void 0),Ge([o({type:Boolean})],ai.prototype,"disabled",void 0),Ge([s()],ai.prototype,"hovered",void 0),Ge([s()],ai.prototype,"focused",void 0),Ge([s()],ai.prototype,"pressed",void 0),Ge([s()],ai.prototype,"rippling",void 0),Ge([s()],ai.prototype,"rippleSize",void 0),Ge([s()],ai.prototype,"originX",void 0),Ge([s()],ai.prototype,"originY",void 0),Ge([r(".ft-ripple")],ai.prototype,"ripple",void 0),Ge([r(".ft-ripple--effect")],ai.prototype,"rippleEffect",void 0),h("ft-ripple")(ai);var ci=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const hi={distance:ut.create("--ft-tooltip-distance","SIZE","4px"),color:ut.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:ut.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:ut.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system")};class pi extends xt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new e,this.revealDebouncer=new e}render(){return
|
|
352
|
+
`,Ge([o({type:Boolean})],ai.prototype,"primary",void 0),Ge([o({type:Boolean})],ai.prototype,"secondary",void 0),Ge([o({type:Boolean})],ai.prototype,"unbounded",void 0),Ge([o({type:Boolean})],ai.prototype,"activated",void 0),Ge([o({type:Boolean})],ai.prototype,"selected",void 0),Ge([o({type:Boolean})],ai.prototype,"disabled",void 0),Ge([s()],ai.prototype,"hovered",void 0),Ge([s()],ai.prototype,"focused",void 0),Ge([s()],ai.prototype,"pressed",void 0),Ge([s()],ai.prototype,"rippling",void 0),Ge([s()],ai.prototype,"rippleSize",void 0),Ge([s()],ai.prototype,"originX",void 0),Ge([s()],ai.prototype,"originY",void 0),Ge([r(".ft-ripple")],ai.prototype,"ripple",void 0),Ge([r(".ft-ripple--effect")],ai.prototype,"rippleEffect",void 0),h("ft-ripple")(ai);var ci=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const hi={distance:ut.create("--ft-tooltip-distance","SIZE","4px"),color:ut.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:ut.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:ut.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system")};class pi extends xt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new e,this.revealDebouncer=new e}render(){return W`
|
|
347
353
|
<div part="container"
|
|
348
354
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
349
355
|
@mouseenter=${this.onHover}
|
|
@@ -358,7 +364,7 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
358
364
|
</div>
|
|
359
365
|
<slot></slot>
|
|
360
366
|
</div>
|
|
361
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.width-this.tooltip.clientWidth)/2,s=this.tooltip.style;switch(this.position){case"top":s.top=-this.tooltip.clientHeight+"px",s.left=o+"px";break;case"bottom":s.top=e.height+"px",s.left=o+"px";break;case"left":s.top=i+"px",s.left=-this.tooltip.clientWidth+"px";break;case"right":s.top=i+"px",s.left=e.width+"px"}s.maxWidth=Math.max(e.width,150)+"px"}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}pi.elementDefinitions={"ft-typography":
|
|
367
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.width-this.tooltip.clientWidth)/2,s=this.tooltip.style;switch(this.position){case"top":s.top=-this.tooltip.clientHeight+"px",s.left=o+"px";break;case"bottom":s.top=e.height+"px",s.left=o+"px";break;case"left":s.top=i+"px",s.left=-this.tooltip.clientWidth+"px";break;case"right":s.top=i+"px",s.left=e.width+"px"}s.maxWidth=Math.max(e.width,150)+"px"}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}pi.elementDefinitions={"ft-typography":Ve},pi.styles=g`
|
|
362
368
|
.ft-tooltip--container {
|
|
363
369
|
display: block;
|
|
364
370
|
position: relative;
|
|
@@ -459,7 +465,7 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
459
465
|
transform: translate(calc(0.35 * ${di.size}), 0);
|
|
460
466
|
}
|
|
461
467
|
}
|
|
462
|
-
`}render(){return
|
|
468
|
+
`}render(){return W`
|
|
463
469
|
<div class="ft-loader">
|
|
464
470
|
<div></div>
|
|
465
471
|
<div></div>
|
|
@@ -472,47 +478,48 @@ const _t=Symbol.for(""),Ht=t=>{var e,i;if((null===(e=t)||void 0===e?void 0:e.r)=
|
|
|
472
478
|
* Copyright 2017 Google LLC
|
|
473
479
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
474
480
|
*/
|
|
475
|
-
class ui extends
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
</i>
|
|
480
|
-
`}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 i=this.textContent;return this.variant===mi.file_format?null!==(t=gi[i.toUpperCase()])&&void 0!==t?t:i:this.variant===mi.fluid_topics?null!==(e=vi[i.toUpperCase()])&&void 0!==e?e:i:q}}ki.elementDefinitions={},ki.styles=g`
|
|
481
|
-
:host {
|
|
482
|
-
display: inline-block;
|
|
483
|
-
}
|
|
484
|
-
:host, i.ft-icon {
|
|
485
|
-
width: ${wi.size};
|
|
486
|
-
height: ${wi.size};
|
|
487
|
-
text-align: center;
|
|
488
|
-
}
|
|
481
|
+
class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===q||null==t)return this._t=void 0,this.it=t;if(t===V)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ui.directiveName="unsafeHTML",ui.resultType=1;const bi=Et(ui);var vi,gi;!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=""}(vi||(vi={})),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=""}(gi||(gi={}));const xi=new Map([...["abw"].map((t=>[t,gi.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,gi.AUDIO])),...["avi"].map((t=>[t,gi.AVI])),...["chm","xhs"].map((t=>[t,gi.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,gi.CODE])),...["csv"].map((t=>[t,gi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,gi.DITA])),...["epub"].map((t=>[t,gi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,gi.EXCEL])),...["flac"].map((t=>[t,gi.FLAC])),...["gif"].map((t=>[t,gi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,gi.GZIP])),...["html","htm","xhtml"].map((t=>[t,gi.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,gi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,gi.JPEG])),...["json"].map((t=>[t,gi.JSON])),...["m4a","m4p"].map((t=>[t,gi.M4A])),...["mov","qt"].map((t=>[t,gi.MOV])),...["mp3"].map((t=>[t,gi.MP3])),...["mp4","m4v"].map((t=>[t,gi.MP4])),...["ogg","oga"].map((t=>[t,gi.OGG])),...["pdf","ps"].map((t=>[t,gi.PDF])),...["png"].map((t=>[t,gi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,gi.POWERPOINT])),...["rar"].map((t=>[t,gi.RAR])),...["stp"].map((t=>[t,gi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,gi.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,gi.VIDEO])),...["wav"].map((t=>[t,gi.WAV])),...["wma"].map((t=>[t,gi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,gi.WORD])),...["xml","xsl","rdf"].map((t=>[t,gi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,gi.YAML])),...["zip"].map((t=>[t,gi.ZIP]))]),yi=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 mi,$i=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(mi||(mi={}));const wi={size:ut.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:ut.extend("--ft-icon-fluid-topics-font-family",ut.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:ut.extend("--ft-icon-file-format-font-family",ut.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:ut.extend("--ft-icon-material-font-family",ut.create("--ft-icon-font-family","UNKNOWN","Material Icons"))};class ki extends xt{constructor(){super(...arguments),this.variant=mi.fluid_topics}getStyles(){return g`
|
|
482
|
+
:host {
|
|
483
|
+
display: inline-block;
|
|
484
|
+
}
|
|
489
485
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
font-style: normal;
|
|
496
|
-
font-variant: normal;
|
|
497
|
-
speak: none;
|
|
498
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
499
|
-
text-rendering: auto;
|
|
500
|
-
-webkit-font-smoothing: antialiased;
|
|
501
|
-
-moz-osx-font-smoothing: grayscale;
|
|
502
|
-
}
|
|
486
|
+
:host, i.ft-icon {
|
|
487
|
+
width: ${wi.size};
|
|
488
|
+
height: ${wi.size};
|
|
489
|
+
text-align: center;
|
|
490
|
+
}
|
|
503
491
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
492
|
+
i.ft-icon {
|
|
493
|
+
font-size: ${wi.size};
|
|
494
|
+
line-height: 1;
|
|
495
|
+
font-weight: normal;
|
|
496
|
+
text-transform: none;
|
|
497
|
+
font-style: normal;
|
|
498
|
+
font-variant: normal;
|
|
499
|
+
speak: none;
|
|
500
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
501
|
+
text-rendering: auto;
|
|
502
|
+
-webkit-font-smoothing: antialiased;
|
|
503
|
+
-moz-osx-font-smoothing: grayscale;
|
|
504
|
+
}
|
|
507
505
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
506
|
+
.ft-icon--fluid-topics {
|
|
507
|
+
font-family: ${wi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
508
|
+
}
|
|
511
509
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
510
|
+
.ft-icon--file-format {
|
|
511
|
+
font-family: ${wi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.ft-icon--material {
|
|
515
|
+
font-family: ${wi.materialFontFamily}, "Material Icons", sans-serif;
|
|
516
|
+
}
|
|
517
|
+
`}getTemplate(){return W`
|
|
518
|
+
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
519
|
+
${bi(this.getIcon())}
|
|
520
|
+
<slot @slotchange=${()=>this.requestUpdate()} ?hidden=${"material"!==this.variant}></slot>
|
|
521
|
+
</i>
|
|
522
|
+
`}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 i=this.textContent;return this.variant===mi.file_format?null!==(t=gi[i.toUpperCase()])&&void 0!==t?t:i:this.variant===mi.fluid_topics?null!==(e=vi[i.toUpperCase()])&&void 0!==e?e:i:q}}ki.elementDefinitions={},$i([o()],ki.prototype,"variant",void 0),$i([r("slot")],ki.prototype,"slottedContent",void 0),h("ft-icon")(ki);var Si=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Oi=ut.extend("--ft-button-color",vt.colorPrimary),Ci={backgroundColor:ut.extend("--ft-button-background-color",vt.colorSurface),borderRadius:ut.extend("--ft-button-border-radius",vt.borderRadiusL),color:Oi,fontSize:ut.extend("--ft-button-font-size",je.fontSize),iconSize:ut.create("--ft-button-icon-size","SIZE","24px"),rippleColor:ut.extend("--ft-button-ripple-color",Oi),opacityDisabled:ut.external(vt.colorOpacityDisabled,"Design system")},Ei=ut.extend("--ft-button-primary-color",ut.extend("--ft-button-color",vt.colorOnPrimary)),zi={backgroundColor:ut.extend("--ft-button-primary-background-color",ut.extend("--ft-button-background-color",vt.colorPrimary)),color:Ei,rippleColor:ut.extend("--ft-button-primary-ripple-color",Ei)},Bi=ut.extend("--ft-button-dense-border-radius",ut.extend("--ft-button-border-radius",vt.borderRadiusM));class Mi extends xt{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[yt,g`
|
|
516
523
|
:host {
|
|
517
524
|
display: inline-block;
|
|
518
525
|
max-width: 100%;
|
|
@@ -588,9 +595,9 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
588
595
|
}
|
|
589
596
|
|
|
590
597
|
.ft-button.ft-button--primary {
|
|
591
|
-
background-color: ${
|
|
592
|
-
--ft-button-internal-color: ${
|
|
593
|
-
${bt(ei.color,
|
|
598
|
+
background-color: ${zi.backgroundColor};
|
|
599
|
+
--ft-button-internal-color: ${zi.color};
|
|
600
|
+
${bt(ei.color,zi.rippleColor)};
|
|
594
601
|
}
|
|
595
602
|
|
|
596
603
|
.ft-button.ft-button--outlined {
|
|
@@ -646,9 +653,9 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
646
653
|
${bt(di.size,Ci.iconSize)};
|
|
647
654
|
${bt(di.color,"var(--ft-button-internal-color)")};
|
|
648
655
|
}
|
|
649
|
-
`]}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":St,"ft-no-text-select":!0};return this.addTooltip(
|
|
656
|
+
`]}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":St,"ft-no-text-select":!0};return this.addTooltip(W`
|
|
650
657
|
<button part="button"
|
|
651
|
-
class="${
|
|
658
|
+
class="${Qe(t)}"
|
|
652
659
|
aria-label="${this.getLabel()}"
|
|
653
660
|
?disabled=${this.isDisabled()}>
|
|
654
661
|
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
@@ -660,16 +667,16 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
660
667
|
</ft-typography>
|
|
661
668
|
${this.resolveIcon()}
|
|
662
669
|
</button>
|
|
663
|
-
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:
|
|
670
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:W`
|
|
664
671
|
<ft-tooltip part="tooltip"
|
|
665
672
|
text="${this.getLabel()}"
|
|
666
673
|
position="${this.tooltipPosition}">
|
|
667
674
|
${t}
|
|
668
675
|
</ft-tooltip>
|
|
669
|
-
`}resolveIcon(){return this.loading?
|
|
670
|
-
<ft-loader></ft-loader> `:this.icon?
|
|
671
|
-
<ft-icon variant="material">${this.icon}</ft-icon> `:q}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}}Mi.elementDefinitions={"ft-ripple":ai,"ft-tooltip":pi,"ft-typography":
|
|
672
|
-
<label class="${
|
|
676
|
+
`}resolveIcon(){return this.loading?W`
|
|
677
|
+
<ft-loader></ft-loader> `:this.icon?W`
|
|
678
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `:q}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}}Mi.elementDefinitions={"ft-ripple":ai,"ft-tooltip":pi,"ft-typography":Ve,"ft-icon":ki,"ft-loader":fi},Si([o({type:Boolean})],Mi.prototype,"primary",void 0),Si([o({type:Boolean})],Mi.prototype,"outlined",void 0),Si([o({type:Boolean})],Mi.prototype,"disabled",void 0),Si([o({type:Boolean})],Mi.prototype,"dense",void 0),Si([o({type:Boolean})],Mi.prototype,"round",void 0),Si([o({type:String})],Mi.prototype,"label",void 0),Si([o({type:String})],Mi.prototype,"icon",void 0),Si([o({type:Boolean})],Mi.prototype,"trailingIcon",void 0),Si([o({type:Boolean})],Mi.prototype,"loading",void 0),Si([o({type:String})],Mi.prototype,"tooltipPosition",void 0),Si([r(".ft-button")],Mi.prototype,"button",void 0),Si([r(".ft-button--label slot")],Mi.prototype,"slottedContent",void 0),h("ft-button")(Mi);var Fi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ni=ut.extend("--ft-checkbox-text-color",vt.colorOnSurfaceHigh),Ri=ut.external(vt.colorPrimary,"Design system"),Li=ut.external(vt.colorOnPrimary,"Design system"),Di=ut.extend("--ft-checkbox-border-color",vt.colorOnSurfaceMedium),ji=ut.external(vt.colorOnSurfaceDisabled,"Design system");class Ii extends xt{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 W`
|
|
679
|
+
<label class="${Qe(t)}" for="checkbox-input">
|
|
673
680
|
<div class="ft-checkbox--box-container">
|
|
674
681
|
<ft-ripple
|
|
675
682
|
?disabled=${this.disabled}
|
|
@@ -694,14 +701,14 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
694
701
|
<slot></slot>
|
|
695
702
|
</ft-typography>
|
|
696
703
|
</label>
|
|
697
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}
|
|
704
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}Ii.elementDefinitions={"ft-ripple":ai,"ft-typography":Ve},Ii.styles=g`
|
|
698
705
|
* {
|
|
699
706
|
box-sizing: border-box;
|
|
700
707
|
}
|
|
701
708
|
|
|
702
709
|
.ft-checkbox {
|
|
703
710
|
box-sizing: border-box;
|
|
704
|
-
color: ${
|
|
711
|
+
color: ${Ni};
|
|
705
712
|
|
|
706
713
|
display: inline-flex;
|
|
707
714
|
align-items: center;
|
|
@@ -709,7 +716,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
709
716
|
}
|
|
710
717
|
|
|
711
718
|
.ft-checkbox--disabled {
|
|
712
|
-
color: ${
|
|
719
|
+
color: ${ji};
|
|
713
720
|
}
|
|
714
721
|
|
|
715
722
|
input {
|
|
@@ -745,14 +752,14 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
745
752
|
|
|
746
753
|
.ft-checkbox--checked .ft-checkbox--box,
|
|
747
754
|
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
748
|
-
border-color: ${
|
|
749
|
-
background-color: ${
|
|
755
|
+
border-color: ${Ri};
|
|
756
|
+
background-color: ${Ri};
|
|
750
757
|
}
|
|
751
758
|
|
|
752
759
|
.ft-checkbox--disabled .ft-checkbox--box {
|
|
753
|
-
border-color: ${
|
|
760
|
+
border-color: ${ji};
|
|
754
761
|
background-color: transparent;
|
|
755
|
-
color: ${
|
|
762
|
+
color: ${ji};
|
|
756
763
|
}
|
|
757
764
|
|
|
758
765
|
.ft-checkbox--checkmark {
|
|
@@ -771,8 +778,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
771
778
|
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
772
779
|
opacity: 1;
|
|
773
780
|
}
|
|
774
|
-
`,
|
|
775
|
-
<div class="${
|
|
781
|
+
`,Fi([o()],Ii.prototype,"name",void 0),Fi([o({type:Boolean,reflect:!0})],Ii.prototype,"checked",void 0),Fi([o({type:Boolean})],Ii.prototype,"indeterminate",void 0),Fi([o({type:Boolean})],Ii.prototype,"disabled",void 0),Fi([r(".ft-checkbox")],Ii.prototype,"container",void 0),Fi([r("ft-ripple")],Ii.prototype,"ripple",void 0),h("ft-checkbox")(Ii);var Pi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ui=ut.extend("--ft-radio-text-color",vt.colorOnSurfaceHigh),Ai=ut.external(vt.colorPrimary,"Design system"),Ti=(ut.external(vt.colorOnPrimary,"Design system"),ut.extend("--ft-radio-border-color",vt.colorOnSurfaceMedium)),_i=ut.external(vt.colorOnSurfaceDisabled,"Design system");class Hi extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class Zi extends xt{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 W`
|
|
782
|
+
<div class="${Qe(t)}">
|
|
776
783
|
<div class="ft-radio--box-container">
|
|
777
784
|
<ft-ripple
|
|
778
785
|
?disabled=${this.disabled}
|
|
@@ -796,7 +803,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
796
803
|
</ft-typography>
|
|
797
804
|
</label>
|
|
798
805
|
</div>
|
|
799
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new Hi(this.value,this.checked))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}select(){this.checked=!0,this.dispatchEvent(new Hi(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}Zi.elementDefinitions={"ft-ripple":ai,"ft-typography":
|
|
806
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new Hi(this.value,this.checked))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}select(){this.checked=!0,this.dispatchEvent(new Hi(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}Zi.elementDefinitions={"ft-ripple":ai,"ft-typography":Ve},Zi.styles=g`
|
|
800
807
|
* {
|
|
801
808
|
box-sizing: border-box;
|
|
802
809
|
}
|
|
@@ -875,19 +882,19 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
875
882
|
.ft-radio--disabled .ft-radio--box:after {
|
|
876
883
|
background-color: ${_i};
|
|
877
884
|
}
|
|
878
|
-
`,Pi([o()],Zi.prototype,"value",void 0),Pi([o()],Zi.prototype,"name",void 0),Pi([o({type:Boolean,reflect:!0})],Zi.prototype,"checked",void 0),Pi([o({type:Boolean})],Zi.prototype,"disabled",void 0),Pi([r(".ft-radio")],Zi.prototype,"container",void 0),Pi([r("ft-ripple")],Zi.prototype,"ripple",void 0),Pi([r("input")],Zi.prototype,"input",void 0);var Ki=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class
|
|
885
|
+
`,Pi([o()],Zi.prototype,"value",void 0),Pi([o()],Zi.prototype,"name",void 0),Pi([o({type:Boolean,reflect:!0})],Zi.prototype,"checked",void 0),Pi([o({type:Boolean})],Zi.prototype,"disabled",void 0),Pi([r(".ft-radio")],Zi.prototype,"container",void 0),Pi([r("ft-ripple")],Zi.prototype,"ripple",void 0),Pi([r("input")],Zi.prototype,"input",void 0);var Ki=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Wi extends xt{constructor(){super(...arguments),this.name=""}render(){return W`
|
|
879
886
|
<slot @slotchange=${this.onSlotChange}
|
|
880
887
|
@change=${this.onChange}
|
|
881
888
|
@keydown=${this.onKeyDown}
|
|
882
889
|
@focusin=${this.focusCurrentValue}
|
|
883
890
|
></slot>
|
|
884
|
-
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),i=this.radioButtons.indexOf(e)-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}
|
|
891
|
+
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),i=this.radioButtons.indexOf(e)-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}Wi.elementDefinitions={},Wi.styles=g`
|
|
885
892
|
:host {
|
|
886
893
|
display: contents;
|
|
887
894
|
}
|
|
888
|
-
`,Ki([o()],
|
|
895
|
+
`,Ki([o()],Wi.prototype,"name",void 0),Ki([c()],Wi.prototype,"radioButtons",void 0),h("ft-radio")(Zi),h("ft-radio-group")(Wi);var Vi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const qi={borderRadiusM:ut.external(vt.borderRadiusM,"Design system"),colorOutline:ut.external(vt.colorOutline,"Design system"),colorOnSurface:ut.external(vt.colorOnSurface,"Design system"),colorOnSurfaceMedium:ut.external(vt.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:ut.external(vt.colorOnSurfaceDisabled,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),colorOnPrimary:ut.external(vt.colorOnPrimary,"Design system"),fontFamily:ut.external(we.fontFamily,"Body2 typography"),fontSize:ut.external(we.fontSize,"Body2 typography"),fontWeight:ut.external(we.fontWeight,"Body2 typography"),letterSpacing:ut.external(we.letterSpacing,"Body2 typography"),lineHeight:ut.external(we.lineHeight,"Body2 typography"),textTransform:ut.external(we.textTransform,"Body2 typography")};class Ji extends xt{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 W`
|
|
889
896
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
890
|
-
${null==this.parent?null:
|
|
897
|
+
${null==this.parent?null:W`
|
|
891
898
|
<div tabindex="0"
|
|
892
899
|
part="controls go-back"
|
|
893
900
|
class="ft-filter-level--go-back"
|
|
@@ -899,15 +906,15 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
899
906
|
<ft-typography variant="body2">${this.parent.label}</ft-typography>
|
|
900
907
|
</div>
|
|
901
908
|
`}
|
|
902
|
-
${0===this.options.length&&this.noValuesLabel?
|
|
909
|
+
${0===this.options.length&&this.noValuesLabel?W`
|
|
903
910
|
<ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
|
|
904
911
|
${this.noValuesLabel}
|
|
905
912
|
</ft-typography>
|
|
906
913
|
`:q}
|
|
907
|
-
${
|
|
914
|
+
${jt(e,(t=>t.value),(t=>{var e;return W`
|
|
908
915
|
<div class="ft-filter-level--option" part="options">
|
|
909
916
|
${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
|
|
910
|
-
${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?q:
|
|
917
|
+
${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?q:W`
|
|
911
918
|
<ft-button icon="chevron_right"
|
|
912
919
|
part="controls navigate-hierarchy"
|
|
913
920
|
label="${t.label}"
|
|
@@ -917,7 +924,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
917
924
|
`}
|
|
918
925
|
</div>
|
|
919
926
|
`}))}
|
|
920
|
-
${e.length<t.length?
|
|
927
|
+
${e.length<t.length?W`
|
|
921
928
|
<ft-button
|
|
922
929
|
class="ft-filter-level--display-more"
|
|
923
930
|
icon="expand_more"
|
|
@@ -928,17 +935,17 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
928
935
|
</ft-button>
|
|
929
936
|
`:q}
|
|
930
937
|
</div>
|
|
931
|
-
`}goBackOnKeyPress(t){"Enter"!==t.key&&" "!==t.key||this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}goBackOnClick(t){t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}displayMore(){this.displayedPages++}buildMultiValuedOption(t){var e;return
|
|
938
|
+
`}goBackOnKeyPress(t){"Enter"!==t.key&&" "!==t.key||this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}goBackOnClick(t){t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}displayMore(){this.displayedPages++}buildMultiValuedOption(t){var e;return W`
|
|
932
939
|
<ft-checkbox name="${this.id}"
|
|
933
940
|
part="multivalued-option"
|
|
934
941
|
data-value="${t.value}"
|
|
935
942
|
.checked=${t.selected}
|
|
936
943
|
.disabled=${this.disabled}
|
|
937
|
-
.indeterminate=${
|
|
944
|
+
.indeterminate=${qe(null!==(e=t.subOptions)&&void 0!==e?e:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
|
|
938
945
|
@change=${e=>this.optionsChanged(e,t)}>
|
|
939
946
|
${t.label}
|
|
940
947
|
</ft-checkbox>
|
|
941
|
-
`}buildMonoValuedOption(t){return
|
|
948
|
+
`}buildMonoValuedOption(t){return W`
|
|
942
949
|
<ft-radio name="${this.id+Math.round(1e6*Math.random())}"
|
|
943
950
|
part="monovalued-option"
|
|
944
951
|
data-value="${t.value}"
|
|
@@ -949,7 +956,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
949
956
|
@change=${t=>t.stopPropagation()}>
|
|
950
957
|
${t.label}
|
|
951
958
|
</ft-radio>
|
|
952
|
-
`}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}))}}Ji.elementDefinitions={"ft-button":Mi,"ft-ripple":ai,"ft-typography":
|
|
959
|
+
`}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}))}}Ji.elementDefinitions={"ft-button":Mi,"ft-ripple":ai,"ft-typography":Ve,"ft-checkbox":Ii,"ft-icon":ki,"ft-radio":Zi},Ji.styles=[g`
|
|
953
960
|
.ft-filter-level--container {
|
|
954
961
|
display: flex;
|
|
955
962
|
flex-direction: column;
|
|
@@ -1015,7 +1022,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1015
1022
|
margin: 10px 0;
|
|
1016
1023
|
color: ${qi.colorOnSurfaceMedium};
|
|
1017
1024
|
}
|
|
1018
|
-
`],
|
|
1025
|
+
`],Vi([o({type:String})],Ji.prototype,"id",void 0),Vi([o({type:Object})],Ji.prototype,"parent",void 0),Vi([o({type:Array})],Ji.prototype,"options",void 0),Vi([o({type:Boolean})],Ji.prototype,"multivalued",void 0),Vi([o({type:Boolean})],Ji.prototype,"disabled",void 0),Vi([o({type:Boolean})],Ji.prototype,"hideSelectedOptions",void 0),Vi([o({type:Boolean})],Ji.prototype,"preventNavigation",void 0),Vi([o({type:String})],Ji.prototype,"filter",void 0),Vi([o({type:String})],Ji.prototype,"moreValuesButtonLabel",void 0),Vi([o({type:String})],Ji.prototype,"noValuesLabel",void 0),Vi([o({type:Number})],Ji.prototype,"displayedValuesLimit",void 0),Vi([r(".ft-filter-level--container")],Ji.prototype,"container",void 0),Vi([s()],Ji.prototype,"displayedPages",void 0);var Xi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Yi={buttonsColor:ut.extend("--ft-snap-scroll-buttons-color",vt.colorPrimary),buttonsZIndex:ut.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:ut.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:ut.external(vt.colorSurface,"Design system")};class Qi extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class Gi extends xt{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(200),this.updateScrollDebouncer=new e(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=Qe({"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":St}),e=this.controls&&this.withScroll;return W`
|
|
1019
1026
|
<div part="container" class="${t}">
|
|
1020
1027
|
<ft-button
|
|
1021
1028
|
class="ft-snap-scroll--previous"
|
|
@@ -1164,14 +1171,14 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1164
1171
|
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1165
1172
|
background-color: ${Yi.colorSurface};
|
|
1166
1173
|
}
|
|
1167
|
-
`,Xi([o({type:Boolean})],Gi.prototype,"horizontal",void 0),Xi([o({type:Boolean})],Gi.prototype,"hideScrollbar",void 0),Xi([o({type:Boolean})],Gi.prototype,"controls",void 0),Xi([o({type:Boolean})],Gi.prototype,"limitSize",void 0),Xi([s()],Gi.prototype,"elements",void 0),Xi([s()],Gi.prototype,"currentElement",void 0),Xi([s()],Gi.prototype,"withScroll",void 0),Xi([s()],Gi.prototype,"startReached",void 0),Xi([s()],Gi.prototype,"endReached",void 0),Xi([r(".ft-snap-scroll--content")],Gi.prototype,"contentSlot",void 0),h("ft-snap-scroll")(Gi);var to=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const eo=ut.external(vt.colorOutline,"Design system"),io=ut.external(vt.colorOnSurface,"Design system"),oo=ut.external(vt.colorOnSurfaceMedium,"Design system"),so=ut.external(vt.colorPrimary,"Design system"),no=ut.external(vt.colorSurface,"Design system"),ro=ut.external(vt.transitionDuration,"Design system"),lo=ut.external(vt.transitionTimingFunction,"Design system");class ao extends CustomEvent{constructor(t){super("change",{detail:t})}}class co extends xt{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(300),this.changeDebouncer=new e(10)}get flatOptions(){return
|
|
1174
|
+
`,Xi([o({type:Boolean})],Gi.prototype,"horizontal",void 0),Xi([o({type:Boolean})],Gi.prototype,"hideScrollbar",void 0),Xi([o({type:Boolean})],Gi.prototype,"controls",void 0),Xi([o({type:Boolean})],Gi.prototype,"limitSize",void 0),Xi([s()],Gi.prototype,"elements",void 0),Xi([s()],Gi.prototype,"currentElement",void 0),Xi([s()],Gi.prototype,"withScroll",void 0),Xi([s()],Gi.prototype,"startReached",void 0),Xi([s()],Gi.prototype,"endReached",void 0),Xi([r(".ft-snap-scroll--content")],Gi.prototype,"contentSlot",void 0),h("ft-snap-scroll")(Gi);var to=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const eo=ut.external(vt.colorOutline,"Design system"),io=ut.external(vt.colorOnSurface,"Design system"),oo=ut.external(vt.colorOnSurfaceMedium,"Design system"),so=ut.external(vt.colorPrimary,"Design system"),no=ut.external(vt.colorSurface,"Design system"),ro=ut.external(vt.transitionDuration,"Design system"),lo=ut.external(vt.transitionTimingFunction,"Design system");class ao extends CustomEvent{constructor(t){super("change",{detail:t})}}class co extends xt{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(300),this.changeDebouncer=new e(10)}get flatOptions(){return qe(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}render(){var t,e;const i=this.flatOptions.some((t=>t.selected));let o=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e;return W`
|
|
1168
1175
|
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1169
1176
|
part="container">
|
|
1170
|
-
${this.label||i?
|
|
1177
|
+
${this.label||i?W`
|
|
1171
1178
|
<div class="ft-filter--header" part="header">
|
|
1172
1179
|
<ft-typography class="ft-filter--label" variant="overline" part="label">${this.label}
|
|
1173
1180
|
</ft-typography>
|
|
1174
|
-
${i?
|
|
1181
|
+
${i?W`
|
|
1175
1182
|
<ft-button icon="close" dense @click=${this.clear} part="clear-button">
|
|
1176
1183
|
${this.clearButtonLabel}
|
|
1177
1184
|
</ft-button>
|
|
@@ -1194,8 +1201,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1194
1201
|
@slotchange=${this.updateOptionsFromSlot}
|
|
1195
1202
|
@option-change=${this.optionsChanged}></slot>
|
|
1196
1203
|
</div>
|
|
1197
|
-
`}update(t){if(super.update(t),t.has("options")){const t=new Set(this.flatOptions.map((t=>t.value)));this.displayedLevels=this.displayedLevels.filter((e=>t.has(e)))}}contentAvailableCallback(t){var e,i;super.contentAvailableCallback(t),this.valuesContainer&&this.scrollResizeObserver.observe(this.valuesContainer),this.container&&this.scrollResizeObserver.observe(this.container),t.has("options")&&(this.updateScroll(),null===(e=this.levelsContainer)||void 0===e||e.scrollToIndex(this.displayedLevels.length)),t.has("slideIn")&&this.slideIn&&setTimeout((()=>{var t;null===(t=this.levelsContainer)||void 0===t||t.next(),this.slideIn=void 0}),0),t.has("slideOut")&&this.slideOut&&(null===(i=this.levelsContainer)||void 0===i||i.previous(),setTimeout((()=>{this.displayedLevels.pop(),this.slideOut=void 0}),300))}renderLevels(){const t=this.flatOptions,e=t.filter((t=>t.selected)),i=this.slideIn||this.slideOut?this.displayedLevels.length-2:this.displayedLevels.length-1,o=i<0?"ft-filter--level-center":"ft-filter--level-left";return
|
|
1198
|
-
${this.raiseSelectedOptions&&e.length>0?
|
|
1204
|
+
`}update(t){if(super.update(t),t.has("options")){const t=new Set(this.flatOptions.map((t=>t.value)));this.displayedLevels=this.displayedLevels.filter((e=>t.has(e)))}}contentAvailableCallback(t){var e,i;super.contentAvailableCallback(t),this.valuesContainer&&this.scrollResizeObserver.observe(this.valuesContainer),this.container&&this.scrollResizeObserver.observe(this.container),t.has("options")&&(this.updateScroll(),null===(e=this.levelsContainer)||void 0===e||e.scrollToIndex(this.displayedLevels.length)),t.has("slideIn")&&this.slideIn&&setTimeout((()=>{var t;null===(t=this.levelsContainer)||void 0===t||t.next(),this.slideIn=void 0}),0),t.has("slideOut")&&this.slideOut&&(null===(i=this.levelsContainer)||void 0===i||i.previous(),setTimeout((()=>{this.displayedLevels.pop(),this.slideOut=void 0}),300))}renderLevels(){const t=this.flatOptions,e=t.filter((t=>t.selected)),i=this.slideIn||this.slideOut?this.displayedLevels.length-2:this.displayedLevels.length-1,o=i<0?"ft-filter--level-center":"ft-filter--level-left";return W`
|
|
1205
|
+
${this.raiseSelectedOptions&&e.length>0?W`
|
|
1199
1206
|
<ft-filter-level
|
|
1200
1207
|
id="${this.id}"
|
|
1201
1208
|
?multivalued=${this.multivalued}
|
|
@@ -1214,7 +1221,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1214
1221
|
${this.renderLevel(o,this.options)}
|
|
1215
1222
|
${this.displayedLevels.map((e=>t.find((t=>t.value===e)))).map(((t,e)=>{var o;const s=(null==t?void 0:t.value)===this.slideIn||(null==t?void 0:t.value)===this.slideOut?"ft-filter--level-right":e===i?"ft-filter--level-center":"ft-filter--level-left";return this.renderLevel(s,null!==(o=null==t?void 0:t.subOptions)&&void 0!==o?o:[],t)}))}
|
|
1216
1223
|
</ft-snap-scroll>
|
|
1217
|
-
`}renderLevel(t,e,i){return
|
|
1224
|
+
`}renderLevel(t,e,i){return W`
|
|
1218
1225
|
<ft-filter-level
|
|
1219
1226
|
class="${t}"
|
|
1220
1227
|
id="${this.id}"
|
|
@@ -1233,7 +1240,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1233
1240
|
.exportpartsPrefixes=${["values","available-values"]}
|
|
1234
1241
|
noValuesLabel="${this.noValuesLabel}"
|
|
1235
1242
|
></ft-filter-level>
|
|
1236
|
-
`}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 ao(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)}}co.elementDefinitions={"ft-button":Mi,"ft-filter-level":Ji,"ft-snap-scroll":Gi,"ft-typography":
|
|
1243
|
+
`}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 ao(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)}}co.elementDefinitions={"ft-button":Mi,"ft-filter-level":Ji,"ft-snap-scroll":Gi,"ft-typography":Ve},co.styles=[He,g`
|
|
1237
1244
|
:host {
|
|
1238
1245
|
display: flex;
|
|
1239
1246
|
max-height: 100%;
|
|
@@ -1256,7 +1263,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1256
1263
|
flex-shrink: 0;
|
|
1257
1264
|
padding: 0 10px;
|
|
1258
1265
|
margin-bottom: 8px;
|
|
1259
|
-
${bt(
|
|
1266
|
+
${bt(Xt.fontSize,"14px")};
|
|
1260
1267
|
}
|
|
1261
1268
|
|
|
1262
1269
|
.ft-filter--header ft-button {
|
|
@@ -1270,8 +1277,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1270
1277
|
flex-shrink: 1;
|
|
1271
1278
|
flex-grow: 1;
|
|
1272
1279
|
word-break: break-word;
|
|
1273
|
-
${bt(
|
|
1274
|
-
${bt(
|
|
1280
|
+
${bt(Xt.lineHeight,"22px")};
|
|
1281
|
+
${bt(Xt.fontWeight,"bold")};
|
|
1275
1282
|
}
|
|
1276
1283
|
|
|
1277
1284
|
.ft-filter--filter {
|
|
@@ -1341,9 +1348,9 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1341
1348
|
slot {
|
|
1342
1349
|
display: none;
|
|
1343
1350
|
}
|
|
1344
|
-
`],to([o({type:String})],co.prototype,"id",void 0),to([o({type:String})],co.prototype,"label",void 0),to([o({type:String})],co.prototype,"filterPlaceHolder",void 0),to([o({type:String})],co.prototype,"clearButtonLabel",void 0),to([o({type:String})],co.prototype,"moreValuesButtonLabel",void 0),to([o({type:String})],co.prototype,"noValuesLabel",void 0),to([p([])],co.prototype,"options",void 0),to([o({type:Boolean})],co.prototype,"multivalued",void 0),to([o({type:Boolean})],co.prototype,"disabled",void 0),to([o({type:Boolean})],co.prototype,"raiseSelectedOptions",void 0),to([o({type:Number})],co.prototype,"displayedValuesLimit",void 0),to([r(".ft-filter--slot")],co.prototype,"slotElement",void 0),to([r(".ft-filter--container")],co.prototype,"container",void 0),to([r(".ft-filter--values")],co.prototype,"valuesContainer",void 0),to([r(".ft-filter--levels")],co.prototype,"levelsContainer",void 0),to([r(".ft-filter--levels ft-filter-level:last-child")],co.prototype,"lastLevel",void 0),to([r(".ft-filter--filter input")],co.prototype,"filterInput",void 0),to([function(t){return n({descriptor:e=>({get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}(".ft-filter--levels ft-filter-level")],co.prototype,"levels",void 0),to([s()],co.prototype,"withScroll",void 0),to([s()],co.prototype,"filter",void 0),to([s()],co.prototype,"slideIn",void 0),to([s()],co.prototype,"slideOut",void 0);var ho=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class po extends xt{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return
|
|
1351
|
+
`],to([o({type:String})],co.prototype,"id",void 0),to([o({type:String})],co.prototype,"label",void 0),to([o({type:String})],co.prototype,"filterPlaceHolder",void 0),to([o({type:String})],co.prototype,"clearButtonLabel",void 0),to([o({type:String})],co.prototype,"moreValuesButtonLabel",void 0),to([o({type:String})],co.prototype,"noValuesLabel",void 0),to([p([])],co.prototype,"options",void 0),to([o({type:Boolean})],co.prototype,"multivalued",void 0),to([o({type:Boolean})],co.prototype,"disabled",void 0),to([o({type:Boolean})],co.prototype,"raiseSelectedOptions",void 0),to([o({type:Number})],co.prototype,"displayedValuesLimit",void 0),to([r(".ft-filter--slot")],co.prototype,"slotElement",void 0),to([r(".ft-filter--container")],co.prototype,"container",void 0),to([r(".ft-filter--values")],co.prototype,"valuesContainer",void 0),to([r(".ft-filter--levels")],co.prototype,"levelsContainer",void 0),to([r(".ft-filter--levels ft-filter-level:last-child")],co.prototype,"lastLevel",void 0),to([r(".ft-filter--filter input")],co.prototype,"filterInput",void 0),to([function(t){return n({descriptor:e=>({get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}(".ft-filter--levels ft-filter-level")],co.prototype,"levels",void 0),to([s()],co.prototype,"withScroll",void 0),to([s()],co.prototype,"filter",void 0),to([s()],co.prototype,"slideIn",void 0),to([s()],co.prototype,"slideOut",void 0);var ho=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class po extends xt{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return W`
|
|
1345
1352
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1346
|
-
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}po.elementDefinitions={},ho([o({type:String})],po.prototype,"label",void 0),ho([o({type:Object,converter:t=>t})],po.prototype,"value",void 0),ho([o({type:Boolean,reflect:!0})],po.prototype,"selected",void 0),ho([o({type:Object})],po.prototype,"subOptions",void 0),ho([r(".ft-filter-option--slot")],po.prototype,"slotElement",void 0),h("ft-filter")(co),h("ft-filter-option")(po);var fo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class uo extends xt{constructor(){super(...arguments),this.multi=!1}render(){return
|
|
1353
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}po.elementDefinitions={},ho([o({type:String})],po.prototype,"label",void 0),ho([o({type:Object,converter:t=>t})],po.prototype,"value",void 0),ho([o({type:Boolean,reflect:!0})],po.prototype,"selected",void 0),ho([o({type:Object})],po.prototype,"subOptions",void 0),ho([r(".ft-filter-option--slot")],po.prototype,"slotElement",void 0),h("ft-filter")(co),h("ft-filter-option")(po);var fo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class uo extends xt{constructor(){super(...arguments),this.multi=!1}render(){return W`
|
|
1347
1354
|
<div class="ft-accordion">
|
|
1348
1355
|
<slot @activated=${this.onChange}></slot>
|
|
1349
1356
|
</div>
|
|
@@ -1351,7 +1358,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1351
1358
|
.ft-accordion {
|
|
1352
1359
|
box-sizing: border-box;
|
|
1353
1360
|
}
|
|
1354
|
-
`,fo([o({type:Boolean})],uo.prototype,"multi",void 0),fo([r("slot")],uo.prototype,"content",void 0);var bo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const vo=ut.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),go=ut.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),xo=ut.external(vt.colorOutline,"Design system");class yo extends xt{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return
|
|
1361
|
+
`,fo([o({type:Boolean})],uo.prototype,"multi",void 0),fo([r("slot")],uo.prototype,"content",void 0);var bo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const vo=ut.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),go=ut.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),xo=ut.external(vt.colorOutline,"Design system");class yo extends xt{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return W`
|
|
1355
1362
|
<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}">
|
|
1356
1363
|
<div class="ft-accordion-item--toggle"
|
|
1357
1364
|
part="toggle"
|
|
@@ -1359,13 +1366,13 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1359
1366
|
@keydown=${this.onToggleKeyDown}
|
|
1360
1367
|
tabindex="0">
|
|
1361
1368
|
<ft-ripple part="toggle-ripple"></ft-ripple>
|
|
1362
|
-
${this.icon?
|
|
1369
|
+
${this.icon?W`
|
|
1363
1370
|
<ft-icon variant="material">${this.icon}</ft-icon>
|
|
1364
1371
|
`:null}
|
|
1365
|
-
${this.label?
|
|
1372
|
+
${this.label?W`
|
|
1366
1373
|
<ft-typography class="ft-accordion-item--label" variant="body1" part="label">${this.label}
|
|
1367
1374
|
</ft-typography>
|
|
1368
|
-
`:
|
|
1375
|
+
`:W`
|
|
1369
1376
|
<slot class="ft-accordion-item--label" name="toggle" part="label"></slot>
|
|
1370
1377
|
`}
|
|
1371
1378
|
<ft-icon variant="material">${this.active?"expand_less":"expand_more"}</ft-icon>
|
|
@@ -1375,7 +1382,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1375
1382
|
</div>
|
|
1376
1383
|
<div class="ft-accordion-item--separator" part="separator"></div>
|
|
1377
1384
|
</div>
|
|
1378
|
-
`}update(t){super.update(t),t.has("active")&&this.active&&this.dispatchEvent(new Event("activated",{composed:!0,bubbles:!0}))}onToggleKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.active=!this.active)}}yo.elementDefinitions={"ft-ripple":ai,"ft-typography":
|
|
1385
|
+
`}update(t){super.update(t),t.has("active")&&this.active&&this.dispatchEvent(new Event("activated",{composed:!0,bubbles:!0}))}onToggleKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.active=!this.active)}}yo.elementDefinitions={"ft-ripple":ai,"ft-typography":Ve,"ft-icon":ki},yo.styles=g`
|
|
1379
1386
|
.ft-accordion-item {
|
|
1380
1387
|
display: flex;
|
|
1381
1388
|
flex-direction: column;
|
|
@@ -1420,7 +1427,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1420
1427
|
.ft-accordion-item--separator {
|
|
1421
1428
|
border-bottom: 1px solid ${xo};
|
|
1422
1429
|
}
|
|
1423
|
-
`,bo([o({type:String})],yo.prototype,"icon",void 0),bo([o({type:String})],yo.prototype,"label",void 0),bo([o({type:Boolean,reflect:!0})],yo.prototype,"active",void 0),h("ft-accordion")(uo),h("ft-accordion-item")(yo);var mo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const $o=ut.extend("--ft-chip-color",vt.colorOnSurface),wo={backgroundColor:ut.extend("--ft-chip-background-color",vt.colorSurface),color:$o,fontSize:ut.extend("--ft-chip-font-size",
|
|
1430
|
+
`,bo([o({type:String})],yo.prototype,"icon",void 0),bo([o({type:String})],yo.prototype,"label",void 0),bo([o({type:Boolean,reflect:!0})],yo.prototype,"active",void 0),h("ft-accordion")(uo),h("ft-accordion-item")(yo);var mo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const $o=ut.extend("--ft-chip-color",vt.colorOnSurface),wo={backgroundColor:ut.extend("--ft-chip-background-color",vt.colorSurface),color:$o,fontSize:ut.extend("--ft-chip-font-size",we.fontSize),iconSize:ut.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:ut.extend("--ft-chip-ripple-color",$o),horizontalPadding:ut.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:ut.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:ut.external(vt.colorOutline,"Design system"),opacityDisabled:ut.external(vt.colorOpacityDisabled,"Design system")},ko=ut.extend("--ft-chip-highlighted-color",ut.extend("--ft-chip-color",vt.colorOnPrimary)),So={backgroundColor:ut.extend("--ft-chip-highlighted-background-color",ut.extend("--ft-chip-background-color",vt.colorPrimary)),color:ko,rippleColor:ut.extend("--ft-chip-highlighted-ripple-color",ko)},Oo=ut.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),Co=ut.create("--ft-chip-dense-vertical-padding","SIZE","4px");class Eo extends CustomEvent{constructor(){super("icon-click")}}class zo extends xt{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[yt,g`
|
|
1424
1431
|
:host {
|
|
1425
1432
|
display: inline-block;
|
|
1426
1433
|
max-width: 100%;
|
|
@@ -1514,8 +1521,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1514
1521
|
vertical-align: bottom;
|
|
1515
1522
|
display: block;
|
|
1516
1523
|
margin: 0 var(--ft-chip-internal-horizontal-padding);
|
|
1517
|
-
${bt(
|
|
1518
|
-
${bt(
|
|
1524
|
+
${bt(we.fontSize,"var(--ft-chip-internal-font-size)")};
|
|
1525
|
+
${bt(we.lineHeight,"var(--ft-chip-internal-content-height)")};
|
|
1519
1526
|
}
|
|
1520
1527
|
|
|
1521
1528
|
.ft-chip--safari-fix .ft-chip--label {
|
|
@@ -1550,8 +1557,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1550
1557
|
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container {
|
|
1551
1558
|
order: -1;
|
|
1552
1559
|
}
|
|
1553
|
-
`]}render(){const t={"ft-chip":!0,"ft-chip--highlighted":this.highlighted,"ft-chip--disabled":this.disabled,"ft-chip--clickable":this.interactionsOnChip,"ft-chip--trailing-icon":this.trailingIcon||this.removable,"ft-chip--no-content":!this.hasTextContent(),"ft-chip--dense":this.dense,"ft-chip--multi-line":this.multiLine,"ft-chip--safari-fix":St};return
|
|
1554
|
-
<div class="${
|
|
1560
|
+
`]}render(){const t={"ft-chip":!0,"ft-chip--highlighted":this.highlighted,"ft-chip--disabled":this.disabled,"ft-chip--clickable":this.interactionsOnChip,"ft-chip--trailing-icon":this.trailingIcon||this.removable,"ft-chip--no-content":!this.hasTextContent(),"ft-chip--dense":this.dense,"ft-chip--multi-line":this.multiLine,"ft-chip--safari-fix":St};return W`
|
|
1561
|
+
<div class="${Qe(t)}"
|
|
1555
1562
|
aria-label="${this.getLabel()}"
|
|
1556
1563
|
tabindex="${this.interactionsOnChip?0:-1}"
|
|
1557
1564
|
@keyup=${this.onKeyUp}>
|
|
@@ -1561,7 +1568,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1561
1568
|
</ft-typography>
|
|
1562
1569
|
${this.internalIcon?this.renderIcon():null}
|
|
1563
1570
|
</div>
|
|
1564
|
-
`}get interactionsOnChip(){return this.clickable&&!this.disabled}get interactionsOnIcon(){return(this.iconClickable||this.removable)&&!this.disabled}renderIcon(){return
|
|
1571
|
+
`}get interactionsOnChip(){return this.clickable&&!this.disabled}get interactionsOnIcon(){return(this.iconClickable||this.removable)&&!this.disabled}renderIcon(){return W`
|
|
1565
1572
|
<div class="ft-chip--icon-container ft-no-text-select ${this.interactionsOnIcon?"ft-chip--clickable":""}"
|
|
1566
1573
|
tabindex="${this.interactionsOnIcon?0:-1}"
|
|
1567
1574
|
@click=${this.onIconClick}
|
|
@@ -1569,16 +1576,16 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1569
1576
|
<ft-ripple ?disabled=${!this.interactionsOnIcon}></ft-ripple>
|
|
1570
1577
|
<ft-icon variant="material">${this.internalIcon}</ft-icon>
|
|
1571
1578
|
</div>
|
|
1572
|
-
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new
|
|
1573
|
-
<div class="${
|
|
1574
|
-
${this.text?
|
|
1579
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new Eo))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new Eo))}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)}}zo.elementDefinitions={"ft-ripple":ai,"ft-typography":Ve,"ft-icon":ki},mo([o({type:Boolean})],zo.prototype,"highlighted",void 0),mo([o({type:Boolean})],zo.prototype,"removable",void 0),mo([o({type:Boolean})],zo.prototype,"disabled",void 0),mo([o({type:Boolean})],zo.prototype,"clickable",void 0),mo([o({type:Boolean})],zo.prototype,"iconClickable",void 0),mo([o({type:Boolean})],zo.prototype,"dense",void 0),mo([o({type:Boolean})],zo.prototype,"multiLine",void 0),mo([o({type:String})],zo.prototype,"label",void 0),mo([o({type:String})],zo.prototype,"icon",void 0),mo([o({type:Boolean})],zo.prototype,"trailingIcon",void 0),mo([r("ft-typography slot")],zo.prototype,"slottedContent",void 0),h("ft-chip")(zo);var Bo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Mo={fontSize:ut.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:ut.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:ut.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:ut.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:ut.create("--ft-input-label-horizontal-spacing","SIZE","12px"),borderColor:ut.extend("--ft-input-label-border-color",vt.colorOutline),textColor:ut.extend("--ft-input-label-text-color",vt.colorOnSurfaceMedium),disabledTextColor:ut.extend("--ft-input-label-disabled-text-color",vt.colorOnSurfaceDisabled),colorSurface:ut.external(vt.colorSurface,"Design system"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system"),colorError:ut.external(vt.colorError,"Design system")};class Fo extends xt{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 W`
|
|
1580
|
+
<div class="${Qe(t)}">
|
|
1581
|
+
${this.text?W`
|
|
1575
1582
|
<div class="ft-input-label--text ft-typography--caption">
|
|
1576
1583
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
1577
1584
|
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
1578
1585
|
</div>
|
|
1579
1586
|
`:null}
|
|
1580
1587
|
</div>
|
|
1581
|
-
`}}
|
|
1588
|
+
`}}Fo.elementDefinitions={},Fo.styles=[He,g`
|
|
1582
1589
|
.ft-input-label {
|
|
1583
1590
|
position: absolute;
|
|
1584
1591
|
inset: 0;
|
|
@@ -1627,8 +1634,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1627
1634
|
border-color: inherit;
|
|
1628
1635
|
color: ${Mo.textColor};
|
|
1629
1636
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1630
|
-
${bt(
|
|
1631
|
-
${bt(
|
|
1637
|
+
${bt(ke.fontSize,Mo.fontSize)};
|
|
1638
|
+
${bt(ke.lineHeight,Mo.fontSize)};
|
|
1632
1639
|
}
|
|
1633
1640
|
|
|
1634
1641
|
.ft-input-label--in-error .ft-input-label--text {
|
|
@@ -1656,8 +1663,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1656
1663
|
}
|
|
1657
1664
|
|
|
1658
1665
|
.ft-input-label--raised .ft-input-label--text {
|
|
1659
|
-
${bt(
|
|
1660
|
-
${bt(
|
|
1666
|
+
${bt(ke.fontSize,Mo.raisedFontSize)};
|
|
1667
|
+
${bt(ke.lineHeight,Mo.raisedFontSize)};
|
|
1661
1668
|
}
|
|
1662
1669
|
|
|
1663
1670
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
@@ -1694,8 +1701,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1694
1701
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
1695
1702
|
border-top: none;
|
|
1696
1703
|
}
|
|
1697
|
-
`],Bo([o({type:String})],
|
|
1698
|
-
<div class="${
|
|
1704
|
+
`],Bo([o({type:String})],Fo.prototype,"text",void 0),Bo([o({type:Boolean})],Fo.prototype,"raised",void 0),Bo([o({type:Boolean})],Fo.prototype,"outlined",void 0),Bo([o({type:Boolean})],Fo.prototype,"disabled",void 0),Bo([o({type:Boolean})],Fo.prototype,"error",void 0),h("ft-input-label")(Fo);var No=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ro extends xt{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}render(){return W``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Ro.elementDefinitions={},No([o({type:String})],Ro.prototype,"label",void 0),No([o({type:Object,converter:t=>t})],Ro.prototype,"value",void 0),No([o({type:Boolean,reflect:!0})],Ro.prototype,"selected",void 0);const Lo={labelSize:ut.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:ut.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:ut.create("--ft-select-vertical-spacing","SIZE","4px"),optionsHeight:ut.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:ut.extend("--ft-select-selected-option-color",vt.colorOnSurface),helperColor:ut.extend("--ft-select-helper-color",vt.colorOnSurfaceMedium),optionsColor:ut.extend("--ft-select-options-color",vt.colorOnSurface),optionsZIndex:ut.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:ut.external(vt.colorSurface,"Design system"),colorOnSurfaceDisabled:ut.external(vt.colorOnSurfaceDisabled,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system"),elevation02:ut.external(vt.elevation02,"Design system"),colorError:ut.external(vt.colorError,"Design system")};class Do extends xt{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,i,o,s;let n=this.hasOptionsMenuOpen,r=this.disabled||!this.hasOptions;const l=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(i=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==i?i:"").length>0,a={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":r,"ft-select--options-displayed":n,"ft-select--has-option-selected":l,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return W`
|
|
1705
|
+
<div class="${Qe(a)}" part="container">
|
|
1699
1706
|
<div class="ft-select--main-panel" part="main-panel">
|
|
1700
1707
|
<ft-input-label text="${this.label}"
|
|
1701
1708
|
part="label"
|
|
@@ -1722,18 +1729,18 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1722
1729
|
part="options"
|
|
1723
1730
|
@keydown=${this.onOptionsKeyDown}
|
|
1724
1731
|
innerrole="listbox">
|
|
1725
|
-
${
|
|
1732
|
+
${jt(this.options,(t=>t.value),(t=>this.renderOption(t)))}
|
|
1726
1733
|
</div>
|
|
1727
1734
|
</div>
|
|
1728
|
-
${this.helper?
|
|
1735
|
+
${this.helper?W`
|
|
1729
1736
|
<ft-typography class="ft-select--helper-text" variant="caption">${this.helper}
|
|
1730
1737
|
</ft-typography>`:void 0}
|
|
1731
1738
|
</div>
|
|
1732
1739
|
<slot @slotchange=${this.updateOptionsFromSlot}
|
|
1733
1740
|
@option-change=${this.updateOptionsFromSlot}
|
|
1734
1741
|
></slot>
|
|
1735
|
-
`}renderOption(t){let e=this.selectedOption===t;return
|
|
1736
|
-
<div class="${
|
|
1742
|
+
`}renderOption(t){let e=this.selectedOption===t;return W`
|
|
1743
|
+
<div class="${Qe({"ft-select--option":!0,"ft-select--option-selected":e,"ft-typography--body2":!0})}"
|
|
1737
1744
|
part="option"
|
|
1738
1745
|
tabindex="0"
|
|
1739
1746
|
data-value="${t.value}"
|
|
@@ -1742,7 +1749,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1742
1749
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
1743
1750
|
${t.label}
|
|
1744
1751
|
</div>
|
|
1745
|
-
`}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,n;let r;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(),r=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(),r=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==r||r.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)}}Do.elementDefinitions={"ft-input-label":
|
|
1752
|
+
`}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,n;let r;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(),r=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(),r=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==r||r.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)}}Do.elementDefinitions={"ft-input-label":Fo,"ft-typography":Ve,"ft-ripple":ai,"ft-icon":ki},Do.styles=[_e,He,g`
|
|
1746
1753
|
*:focus {
|
|
1747
1754
|
outline: none;
|
|
1748
1755
|
}
|
|
@@ -1815,8 +1822,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1815
1822
|
overflow: hidden;
|
|
1816
1823
|
white-space: nowrap;
|
|
1817
1824
|
text-overflow: ellipsis;
|
|
1818
|
-
${bt(
|
|
1819
|
-
${bt(
|
|
1825
|
+
${bt($e.fontSize,Lo.selectedOptionSize)};
|
|
1826
|
+
${bt($e.lineHeight,Lo.selectedOptionSize)};
|
|
1820
1827
|
}
|
|
1821
1828
|
|
|
1822
1829
|
.ft-select--in-error .ft-select--selected-option {
|
|
@@ -1884,35 +1891,35 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1884
1891
|
.ft-select--in-error .ft-select--helper-text {
|
|
1885
1892
|
color: ${Lo.colorError};
|
|
1886
1893
|
}
|
|
1887
|
-
`],
|
|
1888
|
-
`}}
|
|
1894
|
+
`],No([o({type:String})],Do.prototype,"label",void 0),No([o({type:String})],Do.prototype,"helper",void 0),No([o({type:Boolean})],Do.prototype,"outlined",void 0),No([o({type:Boolean})],Do.prototype,"disabled",void 0),No([o({type:Boolean})],Do.prototype,"error",void 0),No([o({type:Boolean})],Do.prototype,"fixedMenuPosition",void 0),No([o({type:Array})],Do.prototype,"options",void 0),No([s()],Do.prototype,"selectedOption",void 0),No([s()],Do.prototype,"optionsDisplayed",void 0),No([s()],Do.prototype,"focusOptions",void 0),No([r(".ft-select")],Do.prototype,"container",void 0),No([r(".ft-select--options")],Do.prototype,"optionsMenu",void 0),No([r(".ft-select--input-panel")],Do.prototype,"mainPanel",void 0),No([r(".ft-select--option:first-child")],Do.prototype,"firstOption",void 0),No([r(".ft-select--option:focus")],Do.prototype,"focusedOption",void 0),No([r(".ft-select--option.ft-select--option-selected")],Do.prototype,"selectedOptionElement",void 0),No([r(".ft-select--option:last-child")],Do.prototype,"lastOption",void 0),No([r("slot")],Do.prototype,"optionsSlot",void 0),h("ft-select")(Do),h("ft-select-option")(Ro);const jo={display:ut.create("--ft-skeleton--display","DISPLAY","block"),width:ut.create("--ft-skeleton--width","SIZE","100%"),height:ut.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:ut.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:ut.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:ut.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:ut.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:ut.external(vt.borderRadiusM,"Design system")};class Io extends xt{render(){return W`
|
|
1895
|
+
`}}Io.elementDefinitions={},Io.styles=g`
|
|
1889
1896
|
:host {
|
|
1890
|
-
width: ${
|
|
1891
|
-
height: ${
|
|
1892
|
-
display: ${
|
|
1897
|
+
width: ${jo.width};
|
|
1898
|
+
height: ${jo.height};
|
|
1899
|
+
display: ${jo.display};
|
|
1893
1900
|
overflow: hidden;
|
|
1894
|
-
border-radius: ${
|
|
1901
|
+
border-radius: ${jo.borderRadiusM};
|
|
1895
1902
|
background: linear-gradient(
|
|
1896
1903
|
90deg,
|
|
1897
1904
|
transparent,
|
|
1898
|
-
${
|
|
1899
|
-
${
|
|
1900
|
-
transparent ${
|
|
1901
|
-
), ${
|
|
1905
|
+
${jo.glareColor} calc(0.45 * ${jo.glareWidth}),
|
|
1906
|
+
${jo.glareColor} calc(0.55 * ${jo.glareWidth}),
|
|
1907
|
+
transparent ${jo.glareWidth}
|
|
1908
|
+
), ${jo.backgroundColor};
|
|
1902
1909
|
background-repeat: repeat-y;
|
|
1903
1910
|
background-size: 100vw 100vh;
|
|
1904
1911
|
background-attachment: fixed;
|
|
1905
|
-
background-position: calc(${
|
|
1906
|
-
animation: shine ${
|
|
1912
|
+
background-position: calc(${jo.glareWidth} * -1) 0;
|
|
1913
|
+
animation: shine ${jo.animationDuration} infinite;
|
|
1907
1914
|
animation-timing-function: linear;
|
|
1908
1915
|
}
|
|
1909
1916
|
|
|
1910
1917
|
@keyframes shine {
|
|
1911
1918
|
to {
|
|
1912
|
-
background-position: calc(100vw + ${
|
|
1919
|
+
background-position: calc(100vw + ${jo.glareWidth}) 0, calc(${jo.glareWidth} * -1) 0;
|
|
1913
1920
|
}
|
|
1914
1921
|
}
|
|
1915
|
-
`,h("ft-skeleton")(
|
|
1922
|
+
`,h("ft-skeleton")(Io);const Po={height:ut.create("--ft-search-bar-height","SIZE","38px"),borderRadius:ut.extend("--ft-search-bar-border-radius",vt.borderRadiusS),mobileOpenPosition:ut.create("--ft-search-bar-mobile-open-position","POSITION","fixed"),mobileOpenTop:ut.create("--ft-search-bar-mobile-open-top","SIZE","0"),mobileOpenBottom:ut.create("--ft-search-bar-mobile-open-bottom","SIZE","0"),mobileOpenLeft:ut.create("--ft-search-bar-mobile-open-left","SIZE","0"),mobileOpenRight:ut.create("--ft-search-bar-mobile-open-right","SIZE","0"),desktopFiltersHeight:ut.create("--ft-search-bar-desktop-filters-height","SIZE","350px"),floatingZIndex:ut.create("--ft-search-bar-floating-components-z-index","NUMBER","3"),colorSurface:ut.external(vt.colorSurface,"Design system"),colorOnSurface:ut.external(vt.colorOnSurface,"Design system"),colorOnSurfaceMedium:ut.external(vt.colorOnSurfaceMedium,"Design system"),colorOutline:ut.external(vt.colorOutline,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),elevation02:ut.external(vt.elevation02,"Design system"),buttonColor:ut.external(Ci.color,"Button"),buttonRippleColor:ut.external(Ci.rippleColor,"Button")},Uo=g`
|
|
1916
1923
|
* {
|
|
1917
1924
|
box-sizing: border-box;
|
|
1918
1925
|
}
|
|
@@ -1960,8 +1967,8 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1960
1967
|
}
|
|
1961
1968
|
|
|
1962
1969
|
.ft-search-bar--skeleton {
|
|
1963
|
-
${bt(
|
|
1964
|
-
${bt(
|
|
1970
|
+
${bt(jo.height,Po.height)};
|
|
1971
|
+
${bt(jo.borderRadiusM,Po.borderRadius)};
|
|
1965
1972
|
}
|
|
1966
1973
|
|
|
1967
1974
|
.ft-search-bar--floating-panel-open .ft-search-bar {
|
|
@@ -2200,172 +2207,324 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2200
2207
|
.ft-search-bar--desktop-menu .ft-search-bar--launch-search {
|
|
2201
2208
|
margin: 0;
|
|
2202
2209
|
}
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2210
|
+
`;class To{constructor(t,i=300){this.searchBar=t,this.updateDebouncer=new e(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 W`
|
|
2211
|
+
<div class="ft-search-bar--suggestions ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2212
|
+
part="suggestions-container"
|
|
2213
|
+
@keydown=${t=>this.onSuggestKeyDown(t)}>
|
|
2214
|
+
${jt(t.slice(0,5),(t=>t),(t=>W`
|
|
2215
|
+
<a href="${this.searchBar.searchRequestSerializer({...this.searchBar.request,query:t})}"
|
|
2216
|
+
part="suggestions"
|
|
2217
|
+
class="ft-search-bar--suggestion ft-search-bar--recent-search"
|
|
2218
|
+
@keyup=${e=>this.onSuggestKeyUp(e,t)}
|
|
2219
|
+
@click=${e=>this.onSuggestClick(e,t)}>
|
|
2220
|
+
<ft-ripple></ft-ripple>
|
|
2221
|
+
<ft-icon variant="material" part="suggestion-icon">history</ft-icon>
|
|
2222
|
+
<ft-typography variant="body1">${t}</ft-typography>
|
|
2223
|
+
<ft-button icon="close"
|
|
2224
|
+
round
|
|
2225
|
+
part="remove-suggestion"
|
|
2226
|
+
?dense=${!this.searchBar.isMobile}
|
|
2227
|
+
label="${this.searchBar.labelResolver.resolve("removeRecentSearch")}"
|
|
2228
|
+
tooltipPosition="left"
|
|
2229
|
+
@click=${e=>this.removeRecentSearch(e,t)}></ft-button>
|
|
2230
|
+
</a>
|
|
2231
|
+
`))}
|
|
2232
|
+
${jt(this.searchBar.suggestions,(t=>t.value),(t=>W`
|
|
2233
|
+
<a href="${this.searchBar.searchRequestSerializer({...this.searchBar.request,query:t.value})}"
|
|
2234
|
+
part="suggestions"
|
|
2235
|
+
class="ft-search-bar--suggestion"
|
|
2236
|
+
@keyup=${e=>this.onSuggestKeyUp(e,t.value)}
|
|
2237
|
+
@click=${e=>this.onSuggestClick(e,t.value)}>
|
|
2238
|
+
<ft-ripple></ft-ripple>
|
|
2239
|
+
${this.getIcon(t)}
|
|
2240
|
+
<ft-typography variant="body1">${t.value}</ft-typography>
|
|
2241
|
+
</a>
|
|
2242
|
+
`))}
|
|
2243
|
+
</div>
|
|
2244
|
+
`}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,n,r;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===(r=null!==(n=null===(s=this.getFocusedSuggestionElement())||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.getFirstSuggestionElement())||void 0===r||r.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 n=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==n||n.focus(),this.searchBar.recentSearches=this.searchBar.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.searchBar.saveRecentSearches()}getIcon(t){const e="DOCUMENT"===t.type?mi.file_format:mi.fluid_topics;let i;switch(t.type){case"MAP":i="BOOK"===t.editorialType?vi.BOOK:vi.ARTICLE;break;case"DOCUMENT":i=function(t,e){var i,o,s,n;t=(null!=t?t:"").toLowerCase(),e=(null!=e?e:"").toLowerCase();const[r,l]=((null!==(i=yi.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(n=null!==(s=null!==(o=xi.get(l))&&void 0!==o?o:xi.get(e))&&void 0!==s?s:xi.get(r))&&void 0!==n?n:gi.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":i=vi.TOPICS}return W`
|
|
2245
|
+
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2246
|
+
${i}
|
|
2247
|
+
</ft-icon>
|
|
2248
|
+
`}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()}}To.styles=g`
|
|
2249
|
+
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2250
|
+
flex-grow: 1;
|
|
2251
|
+
flex-shrink: 1;
|
|
2252
|
+
overflow-y: auto;
|
|
2253
|
+
height: 0;
|
|
2254
|
+
}
|
|
2211
2255
|
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
}
|
|
2256
|
+
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2257
|
+
border-top: 1px solid ${Po.colorOutline};
|
|
2258
|
+
}
|
|
2216
2259
|
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2260
|
+
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2261
|
+
height: initial;
|
|
2262
|
+
}
|
|
2220
2263
|
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2264
|
+
.ft-search-bar--floating-panel,
|
|
2265
|
+
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2266
|
+
position: absolute;
|
|
2267
|
+
z-index: ${Po.floatingZIndex};
|
|
2268
|
+
top: 100%;
|
|
2269
|
+
left: -1px;
|
|
2270
|
+
right: -1px;
|
|
2271
|
+
display: none;
|
|
2272
|
+
background: ${Po.colorSurface};
|
|
2273
|
+
border: 1px solid ${Po.colorOutline};
|
|
2274
|
+
border-radius: 0 0 ${Po.borderRadius} ${Po.borderRadius};
|
|
2275
|
+
box-shadow: ${Po.elevation02};
|
|
2276
|
+
outline: none;
|
|
2277
|
+
}
|
|
2225
2278
|
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2279
|
+
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2280
|
+
top: calc(100% + 2px);
|
|
2281
|
+
}
|
|
2229
2282
|
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
`,_o=g`
|
|
2234
|
-
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2235
|
-
flex-grow: 1;
|
|
2236
|
-
flex-shrink: 1;
|
|
2237
|
-
overflow-y: auto;
|
|
2238
|
-
height: 0;
|
|
2239
|
-
}
|
|
2283
|
+
.ft-search-bar--input-container:focus-within .ft-search-bar--suggestions-not-empty {
|
|
2284
|
+
display: block;
|
|
2285
|
+
}
|
|
2240
2286
|
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2287
|
+
.ft-search-bar--suggestion {
|
|
2288
|
+
text-decoration: none;
|
|
2289
|
+
position: relative;
|
|
2290
|
+
display: flex;
|
|
2291
|
+
align-items: center;
|
|
2292
|
+
padding: 8px;
|
|
2293
|
+
gap: 8px;
|
|
2294
|
+
cursor: pointer;
|
|
2295
|
+
color: ${Po.colorOnSurface};
|
|
2296
|
+
min-height: 52px;
|
|
2297
|
+
}
|
|
2244
2298
|
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2299
|
+
.ft-search-bar--suggestion > *:not(ft-ripple) {
|
|
2300
|
+
position: relative;
|
|
2301
|
+
}
|
|
2248
2302
|
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
z-index: ${Po.floatingZIndex};
|
|
2253
|
-
top: 100%;
|
|
2254
|
-
left: -1px;
|
|
2255
|
-
right: -1px;
|
|
2256
|
-
display: none;
|
|
2257
|
-
background: ${Po.colorSurface};
|
|
2258
|
-
border: 1px solid ${Po.colorOutline};
|
|
2259
|
-
border-radius: 0 0 ${Po.borderRadius} ${Po.borderRadius};
|
|
2260
|
-
box-shadow: ${Po.elevation02};
|
|
2261
|
-
outline: none;
|
|
2262
|
-
}
|
|
2303
|
+
.ft-search-bar--desktop .ft-search-bar--suggestion {
|
|
2304
|
+
min-height: 44px;
|
|
2305
|
+
}
|
|
2263
2306
|
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2307
|
+
.ft-search-bar--suggestion:focus {
|
|
2308
|
+
outline: none;
|
|
2309
|
+
}
|
|
2267
2310
|
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2311
|
+
.ft-search-bar--recent-search + .ft-search-bar--suggestion:not(.ft-search-bar--recent-search) {
|
|
2312
|
+
border-top: 1px solid ${Po.colorOutline};
|
|
2313
|
+
}
|
|
2271
2314
|
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2315
|
+
.ft-search-bar--suggestion ft-typography {
|
|
2316
|
+
display: block;
|
|
2317
|
+
flex-grow: 1;
|
|
2318
|
+
flex-shrink: 1;
|
|
2319
|
+
}
|
|
2320
|
+
`;class _o{constructor(t){this.searchBar=t}render(){if(!this.searchBar.hasLocaleSelector()&&!this.searchBar.hasFacets())return W``;const t=this.searchBar.isMobile(),e=!t&&this.searchBar.dense||t&&this.searchBar.isMobileMenuOpen(),i=W`
|
|
2321
|
+
${this.searchBar.hasLocaleSelector()&&(this.searchBar.hasFacets()||t)?W`
|
|
2322
|
+
<ft-chip part="selected-filters selected-filter-ft-locale"
|
|
2323
|
+
?dense=${this.searchBar.dense&&!t}
|
|
2324
|
+
?clickable=${t}
|
|
2325
|
+
@click=${()=>this.openMobileFilters("ft:locale")}
|
|
2326
|
+
data-key="ft:locale"
|
|
2327
|
+
data-value="${this.searchBar.contentLocale}">
|
|
2328
|
+
${this.getLocaleLabel(this.searchBar.contentLocale)}
|
|
2329
|
+
</ft-chip>
|
|
2330
|
+
`:null}
|
|
2331
|
+
${jt(this.searchBar.facets,(t=>t.key),(i=>{const o=function(t){return qe(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(i);return jt(o,(s=>{let n=i.label+": "+function(t){return Je(t).split("|").join(" > ")}(s);const r=i.key.replace(":","-"),l=W`
|
|
2332
|
+
<ft-chip
|
|
2333
|
+
part="selected-filters selected-filter-${r}"
|
|
2334
|
+
?dense=${this.searchBar.dense&&!t}
|
|
2335
|
+
?clickable=${t}
|
|
2336
|
+
?removable=${!t}
|
|
2337
|
+
icon=${t?q:"close"}
|
|
2338
|
+
label="${n}"
|
|
2339
|
+
title=${e?n:q}
|
|
2340
|
+
@click=${()=>this.openMobileFilters(i.key)}
|
|
2341
|
+
@icon-click=${()=>this.searchBar.setFilter(i.key,o.filter((t=>t!==s)))}
|
|
2342
|
+
data-key="${i.key}"
|
|
2343
|
+
data-value="${s}">
|
|
2344
|
+
${function(t){return Je(t).split("|").pop()}(s)}
|
|
2345
|
+
</ft-chip>
|
|
2346
|
+
`;return e?l:W`
|
|
2347
|
+
<ft-tooltip inline text="${n}">
|
|
2348
|
+
${l}
|
|
2349
|
+
</ft-tooltip>
|
|
2350
|
+
`}))}))}
|
|
2351
|
+
${t?W`
|
|
2352
|
+
<ft-chip part="selected-filters mobile-filters-opener"
|
|
2353
|
+
icon="add"
|
|
2354
|
+
clickable
|
|
2355
|
+
@click=${()=>{this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0}}>
|
|
2356
|
+
${this.searchBar.labelResolver.resolve("filtersButton")}
|
|
2357
|
+
</ft-chip>
|
|
2358
|
+
`:q}
|
|
2359
|
+
`;return e?W`
|
|
2360
|
+
<ft-snap-scroll horizontal controls hideScrollbar limitSize
|
|
2361
|
+
class="ft-search-bar--selected-filters"
|
|
2362
|
+
part="selected-filters-container"
|
|
2363
|
+
exportpartsPrefix="selected-filters-container">
|
|
2364
|
+
${i}
|
|
2365
|
+
</ft-snap-scroll>
|
|
2366
|
+
`:W`
|
|
2367
|
+
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2368
|
+
${i}
|
|
2369
|
+
</div>
|
|
2370
|
+
`}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}}_o.styles=g`
|
|
2371
|
+
.ft-search-bar--selected-filters:not(ft-snap-scroll) {
|
|
2372
|
+
flex-shrink: 0;
|
|
2373
|
+
display: flex;
|
|
2374
|
+
flex-direction: row;
|
|
2375
|
+
flex-wrap: wrap;
|
|
2376
|
+
gap: 8px;
|
|
2377
|
+
}
|
|
2283
2378
|
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2379
|
+
ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2380
|
+
overflow: hidden;
|
|
2381
|
+
${bt(Yi.gap,"4px")};
|
|
2382
|
+
}
|
|
2287
2383
|
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2384
|
+
ft-snap-scroll.ft-search-bar--selected-filters::part(content) {
|
|
2385
|
+
align-items: center;
|
|
2386
|
+
}
|
|
2291
2387
|
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2388
|
+
.ft-search-bar--desktop ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2389
|
+
${bt(wo.iconSize,"17px")};
|
|
2390
|
+
${bt(wo.fontSize,"12px")};
|
|
2391
|
+
}
|
|
2295
2392
|
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2393
|
+
.ft-search-bar--selected-filters * {
|
|
2394
|
+
max-width: 100%;
|
|
2395
|
+
}
|
|
2299
2396
|
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
<div class="ft-search-bar">
|
|
2317
|
-
<div class="ft-search-bar--input-container" part="input-container">
|
|
2318
|
-
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2319
|
-
<input class="ft-search-bar--input ft-typography--body2"
|
|
2320
|
-
part="input"
|
|
2321
|
-
type="text"
|
|
2322
|
-
placeholder="${this.labelResolver.resolve("inputPlaceHolder")}"
|
|
2323
|
-
value="${this.query}"
|
|
2324
|
-
@keyup=${this.onSearchBarKeyUp}
|
|
2325
|
-
@focus=${()=>{this.mobileMenuOpen=!0,this.displayFacets=!1}}>
|
|
2397
|
+
.ft-search-bar--selected-filters ft-chip {
|
|
2398
|
+
flex-grow: 0;
|
|
2399
|
+
}
|
|
2400
|
+
`;class Ho{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new _o(t),this.suggestManager=null!=i?i:new To(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 W`
|
|
2401
|
+
<div class="${Qe(t)}" part="container" tabindex="-1">
|
|
2402
|
+
<div class="ft-search-bar">
|
|
2403
|
+
<div class="ft-search-bar--input-container" part="input-container">
|
|
2404
|
+
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2405
|
+
<input class="ft-search-bar--input ft-typography--body2"
|
|
2406
|
+
part="input"
|
|
2407
|
+
type="text"
|
|
2408
|
+
placeholder="${this.searchBar.labelResolver.resolve("inputPlaceHolder")}"
|
|
2409
|
+
value="${this.searchBar.query}"
|
|
2410
|
+
@keyup=${t=>this.onSearchBarKeyUp(t)}
|
|
2411
|
+
@focus=${()=>{this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!1}}>
|
|
2412
|
+
</div>
|
|
2326
2413
|
</div>
|
|
2414
|
+
${this.renderMobileSearchBarButtons()}
|
|
2327
2415
|
</div>
|
|
2328
|
-
${this.
|
|
2416
|
+
${this.searchBar.displayFacets?this.searchBar.renderFacetsActions():this.selectedFacetsManager.render()}
|
|
2417
|
+
${this.searchBar.displayFacets?this.searchBar.renderMobileFacets():this.suggestManager.render()}
|
|
2418
|
+
${this.searchBar.isMobileMenuOpen()||this.searchBar.displayFacets?W`
|
|
2419
|
+
<ft-button class="ft-search-bar--launch-search"
|
|
2420
|
+
part="launch-search-in-panel"
|
|
2421
|
+
icon="search"
|
|
2422
|
+
@click=${this.searchBar.launchSearch}>
|
|
2423
|
+
${this.searchBar.labelResolver.resolve("searchButton")}
|
|
2424
|
+
</ft-button>
|
|
2425
|
+
`:q}
|
|
2329
2426
|
</div>
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
<ft-button class="ft-search-bar--launch-search"
|
|
2334
|
-
part="launch-search-in-panel"
|
|
2335
|
-
icon="search"
|
|
2336
|
-
@click=${this.launchSearch}>
|
|
2337
|
-
${this.labelResolver.resolve("searchButton")}
|
|
2338
|
-
</ft-button>
|
|
2339
|
-
`:q}
|
|
2340
|
-
`}renderMobileSearchBarButtons(){const t=this.query||this.isMobileMenuOpen&&!this.forceMobileMenuOpen;return V`
|
|
2341
|
-
${t?V`
|
|
2342
|
-
<div class="ft-search-bar--actions"
|
|
2343
|
-
part="search-bar-actions">
|
|
2427
|
+
`}renderMobileSearchBarButtons(){const t=this.searchBar.query||this.searchBar.isMobileMenuOpen()&&!this.searchBar.forceMobileMenuOpen;return W`
|
|
2428
|
+
<div class="ft-search-bar--actions" part="search-bar-actions">
|
|
2429
|
+
${t?W`
|
|
2344
2430
|
<ft-button class="ft-search-bar--clear-query"
|
|
2345
2431
|
part="clear-query"
|
|
2346
2432
|
icon="close"
|
|
2347
2433
|
round
|
|
2348
|
-
label="${this.labelResolver.resolve("clearInputButton")}"
|
|
2434
|
+
label="${this.searchBar.labelResolver.resolve("clearInputButton")}"
|
|
2349
2435
|
tooltipPosition="left"
|
|
2350
|
-
@click=${()=>{this.setQuery(""),this.mobileMenuOpen=!1,this.displayFacets=!1}}
|
|
2436
|
+
@click=${()=>{this.searchBar.setQuery(""),this.searchBar.mobileMenuOpen=!1,this.searchBar.displayFacets=!1}}
|
|
2351
2437
|
></ft-button>
|
|
2438
|
+
<div class="ft-search-bar--separator"></div>
|
|
2439
|
+
`:q}
|
|
2440
|
+
<ft-button class="ft-search-bar--launch-search"
|
|
2441
|
+
part="launch-search-in-bar"
|
|
2442
|
+
icon="search"
|
|
2443
|
+
round
|
|
2444
|
+
label="${this.searchBar.labelResolver.resolve("searchButton")}"
|
|
2445
|
+
tooltipPosition="left"
|
|
2446
|
+
@click=${()=>{var t;return this.searchBar.isMobileMenuOpen()?this.searchBar.launchSearch():null===(t=this.searchBar.input)||void 0===t?void 0:t.focus()}}
|
|
2447
|
+
></ft-button>
|
|
2448
|
+
</div>
|
|
2449
|
+
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}Ho.styles=g`
|
|
2450
|
+
|
|
2451
|
+
`;class Zo{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new _o(t),this.suggestManager=null!=i?i:new To(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 W`
|
|
2452
|
+
<div class="${Qe(t)}" part="container" tabindex="-1">
|
|
2453
|
+
<div class="ft-search-bar" part="search-bar">
|
|
2454
|
+
${this.renderSearchBarLeftAction()}
|
|
2455
|
+
<div class="ft-search-bar--input-container" part="input-container" tabindex="-1">
|
|
2456
|
+
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2457
|
+
${this.searchBar.dense?this.selectedFacetsManager.render():q}
|
|
2458
|
+
<input class="ft-search-bar--input ft-typography--body2"
|
|
2459
|
+
part="input"
|
|
2460
|
+
type="text"
|
|
2461
|
+
placeholder="${this.searchBar.labelResolver.resolve("inputPlaceHolder")}"
|
|
2462
|
+
value="${this.searchBar.query}"
|
|
2463
|
+
@keydown=${t=>this.onSearchBarKeyDown(t)}
|
|
2464
|
+
@keyup=${t=>this.onSearchBarKeyUp(t)}>
|
|
2465
|
+
</div>
|
|
2466
|
+
${this.suggestManager.render()}
|
|
2467
|
+
</div>
|
|
2468
|
+
${this.renderDesktopSearchBarButtons()}
|
|
2469
|
+
${this.searchBar.renderDesktopFloatingMenu()}
|
|
2352
2470
|
</div>
|
|
2353
|
-
|
|
2471
|
+
${this.searchBar.dense?q:this.searchBar.forceMenuOpen?this.searchBar.renderDesktopMenu():this.selectedFacetsManager.render()}
|
|
2472
|
+
</div>
|
|
2473
|
+
`}renderSearchBarLeftAction(){return this.searchBar.hasFacets()?this.searchBar.forceMenuOpen?q:W`
|
|
2474
|
+
<ft-button class="ft-search-bar--filters-opener ft-search-bar--left-action"
|
|
2475
|
+
part="filters-opener"
|
|
2476
|
+
trailingIcon
|
|
2477
|
+
icon="${this.searchBar.displayFacets?"expand_less":"expand_more"}"
|
|
2478
|
+
@click=${t=>{t.stopPropagation(),this.searchBar.displayFacets=!this.searchBar.displayFacets}}
|
|
2479
|
+
@focusin=${t=>t.stopPropagation()}>
|
|
2480
|
+
${this.searchBar.labelResolver.resolve("filtersButton")}
|
|
2481
|
+
</ft-button>
|
|
2482
|
+
`:this.searchBar.hasLocaleSelector()?W`
|
|
2483
|
+
<ft-select outlined
|
|
2484
|
+
class="ft-search-bar--content-locale ft-search-bar--left-action"
|
|
2485
|
+
part="content-locale select-ft-locale"
|
|
2486
|
+
.exportpartsPrefixes=${["content-locale","select-ft-locale"]}
|
|
2487
|
+
@change=${t=>this.searchBar.contentLocale=null==t.detail?void 0:t.detail}>
|
|
2488
|
+
${jt(this.searchBar.availableContentLocales,(t=>t.lang),(t=>W`
|
|
2489
|
+
<ft-select-option .value=${t.lang}
|
|
2490
|
+
label="${t.label}"
|
|
2491
|
+
?selected=${t.lang===this.searchBar.contentLocale}>
|
|
2492
|
+
</ft-select-option>
|
|
2493
|
+
`))}
|
|
2494
|
+
</ft-select>
|
|
2495
|
+
`:q}renderDesktopSearchBarButtons(){return W`
|
|
2354
2496
|
<div class="ft-search-bar--actions"
|
|
2355
2497
|
part="search-bar-actions">
|
|
2498
|
+
${this.searchBar.query?W`
|
|
2499
|
+
<ft-button class="ft-search-bar--clear-query"
|
|
2500
|
+
part="clear-query"
|
|
2501
|
+
icon="close"
|
|
2502
|
+
round dense
|
|
2503
|
+
label="${this.searchBar.labelResolver.resolve("clearInputButton")}"
|
|
2504
|
+
@click=${()=>this.searchBar.setQuery("")}
|
|
2505
|
+
></ft-button>
|
|
2506
|
+
<div class="ft-search-bar--separator"></div>
|
|
2507
|
+
`:null}
|
|
2356
2508
|
<ft-button class="ft-search-bar--launch-search"
|
|
2357
2509
|
part="launch-search-in-bar"
|
|
2358
2510
|
icon="search"
|
|
2359
|
-
round
|
|
2360
|
-
label="${this.labelResolver.resolve("searchButton")}"
|
|
2361
|
-
|
|
2362
|
-
@click=${()=>{var t;return this.isMobileMenuOpen?this.launchSearch():null===(t=this.input)||void 0===t?void 0:t.focus()}}
|
|
2511
|
+
round dense
|
|
2512
|
+
label="${this.searchBar.labelResolver.resolve("searchButton")}"
|
|
2513
|
+
@click=${()=>this.searchBar.launchSearch()}
|
|
2363
2514
|
></ft-button>
|
|
2364
2515
|
</div>
|
|
2365
|
-
`}
|
|
2516
|
+
`}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()}}Zo.styles=g`
|
|
2517
|
+
|
|
2518
|
+
`;var Ko=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};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 Wo={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 Vo extends CustomEvent{constructor(t){super("launch-search",{detail:t,bubbles:!0,composed:!0})}}class qo extends CustomEvent{constructor(t){super("change",{detail:t})}}const Jo=()=>{};class Xo extends xt{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 mt(Wo,{}),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=It.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(500),this.suggestManager=new To(this),this.selectedFacetsManager=new _o(this),this.desktopSearchBarManager=new Zo(this),this.mobileSearchBarManager=new Ho(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===It.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 W`
|
|
2519
|
+
<ft-size-watcher @change=${this.updateSize}></ft-size-watcher>
|
|
2520
|
+
${this.renderSearchBar()}
|
|
2521
|
+
`}renderSearchBar(){return this.facetsInitialized&&this.availableContentLocalesInitialized?this.isMobile()?this.mobileSearchBarManager.render():this.desktopSearchBarManager.render():W`
|
|
2522
|
+
<ft-skeleton class="ft-search-bar--container ft-search-bar--skeleton" part="loader"
|
|
2523
|
+
tabindex="-1"></ft-skeleton>
|
|
2524
|
+
`}renderMobileFacets(){var t;const e=this.availableContentLocales.filter((t=>t.lang===this.contentLocale)).pop();return W`
|
|
2366
2525
|
<ft-accordion class="ft-search-bar--filters-container">
|
|
2367
|
-
${this.hasLocaleSelector?
|
|
2368
|
-
<ft-accordion-item data-facet-key="ft:
|
|
2526
|
+
${this.hasLocaleSelector()?W`
|
|
2527
|
+
<ft-accordion-item data-facet-key="ft:locale">
|
|
2369
2528
|
<div class="ft-search-bar--filter-label" slot="toggle">
|
|
2370
2529
|
<ft-typography variant="button">${this.labelResolver.resolve("contentLocaleSelector")}
|
|
2371
2530
|
</ft-typography>
|
|
@@ -2384,12 +2543,12 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2384
2543
|
></ft-filter>
|
|
2385
2544
|
</ft-accordion-item>
|
|
2386
2545
|
`:null}
|
|
2387
|
-
${
|
|
2546
|
+
${jt(this.facets,(t=>t.key),(t=>{const e=Ye(t),i=t.key.replace(":","-");return t.rootNodes.length>0?W`
|
|
2388
2547
|
<ft-accordion-item data-facet-key="${t.key}">
|
|
2389
2548
|
<div class="ft-search-bar--filter-label" slot="toggle">
|
|
2390
2549
|
<ft-typography variant="button">${t.label}</ft-typography>
|
|
2391
2550
|
<ft-typography variant="body2">
|
|
2392
|
-
${function(t){return
|
|
2551
|
+
${function(t){return qe(t.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).filter((t=>t.selected)).map((t=>t.label))}(e).join(", ")}
|
|
2393
2552
|
</ft-typography>
|
|
2394
2553
|
</div>
|
|
2395
2554
|
<ft-filter
|
|
@@ -2409,32 +2568,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2409
2568
|
</ft-accordion-item>
|
|
2410
2569
|
`:q}))}
|
|
2411
2570
|
</ft-accordion>
|
|
2412
|
-
`}contentLocalesAsFilterOptions(){return this.availableContentLocales.map((t=>({value:t.lang,label:t.label,selected:t.lang==this.contentLocale})))}
|
|
2413
|
-
<div class="ft-search-bar" part="search-bar">
|
|
2414
|
-
${this.renderSearchBarLeftAction()}
|
|
2415
|
-
<div class="ft-search-bar--input-container" part="input-container" tabindex="-1">
|
|
2416
|
-
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
2417
|
-
${this.dense?this.renderSelectedFacets():q}
|
|
2418
|
-
<input class="ft-search-bar--input ft-typography--body2"
|
|
2419
|
-
part="input"
|
|
2420
|
-
type="text"
|
|
2421
|
-
placeholder="${this.labelResolver.resolve("inputPlaceHolder")}"
|
|
2422
|
-
value="${this.query}"
|
|
2423
|
-
@keydown=${this.onSearchBarKeyDown}
|
|
2424
|
-
@keyup=${this.onSearchBarKeyUp}>
|
|
2425
|
-
</div>
|
|
2426
|
-
${this.renderSuggestions()}
|
|
2427
|
-
</div>
|
|
2428
|
-
${this.renderDesktopSearchBarButtons()}
|
|
2429
|
-
${this.forceMenuOpen?q:V`
|
|
2430
|
-
<div class="ft-search-bar--floating-panel" @keyup=${this.onFloatingContainerKeyUp}
|
|
2431
|
-
part="floating-panel"
|
|
2432
|
-
tabindex="-1">
|
|
2433
|
-
${this.renderDesktopMenu()}
|
|
2434
|
-
</div>`}
|
|
2435
|
-
</div>
|
|
2436
|
-
${this.dense||this.forceMenuOpen?this.forceMenuOpen?this.renderDesktopMenu():q:this.renderSelectedFacets()}
|
|
2437
|
-
`}renderDesktopMenu(){return this.hasFacets?V`
|
|
2571
|
+
`}contentLocalesAsFilterOptions(){return this.availableContentLocales.map((t=>({value:t.lang,label:t.label,selected:t.lang==this.contentLocale})))}renderDesktopMenu(){return this.hasFacets()?W`
|
|
2438
2572
|
<div class="ft-search-bar--desktop-menu">
|
|
2439
2573
|
${this.renderFacetsActions()}
|
|
2440
2574
|
${this.renderDesktopFacets()}
|
|
@@ -2448,59 +2582,16 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2448
2582
|
</ft-button>
|
|
2449
2583
|
</div>
|
|
2450
2584
|
</div>
|
|
2451
|
-
`:q}
|
|
2452
|
-
<ft-button class="ft-search-bar--filters-opener ft-search-bar--left-action"
|
|
2453
|
-
part="filters-opener"
|
|
2454
|
-
trailingIcon
|
|
2455
|
-
icon="${this.displayFacets?"expand_less":"expand_more"}"
|
|
2456
|
-
@click=${t=>{t.stopPropagation(),this.displayFacets=!this.displayFacets}}
|
|
2457
|
-
@focusin=${t=>t.stopPropagation()}>
|
|
2458
|
-
${this.labelResolver.resolve("filtersButton")}
|
|
2459
|
-
</ft-button>
|
|
2460
|
-
`:this.hasLocaleSelector?V`
|
|
2461
|
-
<ft-select outlined
|
|
2462
|
-
class="ft-search-bar--content-locale ft-search-bar--left-action"
|
|
2463
|
-
part="content-locale select-ft-locale"
|
|
2464
|
-
.exportpartsPrefixes=${["content-locale","select-ft-locale"]}
|
|
2465
|
-
@change=${t=>this.contentLocale=null==t.detail?void 0:t.detail}>
|
|
2466
|
-
${It(this.availableContentLocales,(t=>t.lang),(t=>V`
|
|
2467
|
-
<ft-select-option .value=${t.lang}
|
|
2468
|
-
label="${t.label}"
|
|
2469
|
-
?selected=${t.lang===this.contentLocale}>
|
|
2470
|
-
</ft-select-option>
|
|
2471
|
-
`))}
|
|
2472
|
-
</ft-select>
|
|
2473
|
-
`:q}renderDesktopSearchBarButtons(){return V`
|
|
2474
|
-
<div class="ft-search-bar--actions"
|
|
2475
|
-
part="search-bar-actions">
|
|
2476
|
-
${this.query?V`
|
|
2477
|
-
<ft-button class="ft-search-bar--clear-query"
|
|
2478
|
-
part="clear-query"
|
|
2479
|
-
icon="close"
|
|
2480
|
-
round dense
|
|
2481
|
-
label="${this.labelResolver.resolve("clearInputButton")}"
|
|
2482
|
-
@click=${()=>this.setQuery("")}
|
|
2483
|
-
></ft-button>
|
|
2484
|
-
<div class="ft-search-bar--separator"></div>
|
|
2485
|
-
`:null}
|
|
2486
|
-
<ft-button class="ft-search-bar--launch-search"
|
|
2487
|
-
part="launch-search-in-bar"
|
|
2488
|
-
icon="search"
|
|
2489
|
-
round dense
|
|
2490
|
-
label="${this.labelResolver.resolve("searchButton")}"
|
|
2491
|
-
@click=${this.launchSearch}
|
|
2492
|
-
></ft-button>
|
|
2493
|
-
</div>
|
|
2494
|
-
`}renderFacetsActions(){var t;return V`
|
|
2585
|
+
`:q}renderFacetsActions(){var t;return W`
|
|
2495
2586
|
<div class="ft-search-bar--facets-actions">
|
|
2496
|
-
${this.hasPresets?
|
|
2587
|
+
${this.hasPresets?W`
|
|
2497
2588
|
<ft-select
|
|
2498
2589
|
class="ft-search-bar--presets"
|
|
2499
2590
|
part="presets"
|
|
2500
2591
|
label="${this.labelResolver.resolve("presetsSelector")}"
|
|
2501
2592
|
outlined
|
|
2502
2593
|
@change=${t=>this.selectedPreset=t.detail}>
|
|
2503
|
-
${
|
|
2594
|
+
${jt(null!==(t=this.presets)&&void 0!==t?t:[],(t=>t.name),(t=>W`
|
|
2504
2595
|
<ft-select-option value="${t.name}"
|
|
2505
2596
|
label="${t.name}"
|
|
2506
2597
|
?selected=${t.name===this.selectedPreset}>
|
|
@@ -2509,19 +2600,19 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2509
2600
|
</ft-select>
|
|
2510
2601
|
`:q}
|
|
2511
2602
|
<slot name="facets-actions"></slot>
|
|
2512
|
-
${this.forceMenuOpen&&!this.isMobile?q:this.renderDesktopClearFilters()}
|
|
2603
|
+
${this.forceMenuOpen&&!this.isMobile()?q:this.renderDesktopClearFilters()}
|
|
2513
2604
|
</div>
|
|
2514
|
-
`}renderDesktopClearFilters(){return this.searchFilters.length>0?
|
|
2605
|
+
`}renderDesktopClearFilters(){return this.searchFilters.length>0?W`
|
|
2515
2606
|
<ft-button part="facets-actions"
|
|
2516
2607
|
@click=${this.clearFilters}>
|
|
2517
2608
|
${this.labelResolver.resolve("clearFilters")}
|
|
2518
2609
|
</ft-button>
|
|
2519
|
-
`:q}renderDesktopFacets(){return this.hasFacets?
|
|
2610
|
+
`:q}renderDesktopFacets(){return this.hasFacets()?W`
|
|
2520
2611
|
<ft-snap-scroll horizontal limitSize controls
|
|
2521
2612
|
class="ft-search-bar--filters-container"
|
|
2522
2613
|
part="filters-container"
|
|
2523
2614
|
exportpartsPrefix="filters-container">
|
|
2524
|
-
${this.hasLocaleSelector?
|
|
2615
|
+
${this.hasLocaleSelector()?W`
|
|
2525
2616
|
<ft-filter
|
|
2526
2617
|
id="ft:locale"
|
|
2527
2618
|
class="ft-search-bar--content-locale"
|
|
@@ -2533,7 +2624,7 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2533
2624
|
@change=${t=>this.contentLocale=t.detail[0]}
|
|
2534
2625
|
></ft-filter>
|
|
2535
2626
|
`:q}
|
|
2536
|
-
${
|
|
2627
|
+
${jt(this.facets,(t=>t.key),(t=>{const e=Ye(t),i=e.options.some((t=>{var e,i;return(null!==(i=null===(e=t.subOptions)||void 0===e?void 0:e.length)&&void 0!==i?i:0)>0})),o=t.key.replace(":","-");return W`
|
|
2537
2628
|
<ft-filter
|
|
2538
2629
|
class="${i?"ft-search-bar--hierarchical-filter":""}"
|
|
2539
2630
|
part="filters filter filter-${o}"
|
|
@@ -2552,92 +2643,10 @@ class ui extends Et{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2552
2643
|
></ft-filter>
|
|
2553
2644
|
`}))}
|
|
2554
2645
|
</ft-snap-scroll>
|
|
2555
|
-
`:q}
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
data-value="${this.contentLocale}">
|
|
2563
|
-
${this.getLocaleLabel(this.contentLocale)}
|
|
2564
|
-
</ft-chip>
|
|
2565
|
-
`:null}
|
|
2566
|
-
${It(this.facets,(t=>t.key),(e=>{const i=function(t){return Je(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(e);return It(i,(o=>{let s=e.label+": "+function(t){return Xe(t).split("|").join(" > ")}(o);const n=e.key.replace(":","-"),r=V`
|
|
2567
|
-
<ft-chip
|
|
2568
|
-
part="selected-filters selected-filter-${n}"
|
|
2569
|
-
?dense=${this.dense&&!this.isMobile}
|
|
2570
|
-
?clickable=${this.isMobile}
|
|
2571
|
-
?removable=${!this.isMobile}
|
|
2572
|
-
icon=${this.isMobile?q:"close"}
|
|
2573
|
-
label="${s}"
|
|
2574
|
-
title=${t?s:q}
|
|
2575
|
-
@click=${()=>this.openMobileFilters(e.key)}
|
|
2576
|
-
@icon-click=${()=>this.setFilter(e.key,i.filter((t=>t!==o)))}
|
|
2577
|
-
data-key="${e.key}"
|
|
2578
|
-
data-value="${o}">
|
|
2579
|
-
${function(t){return Xe(t).split("|").pop()}(o)}
|
|
2580
|
-
</ft-chip>
|
|
2581
|
-
`;return t?r:V`
|
|
2582
|
-
<ft-tooltip inline text="${s}">
|
|
2583
|
-
${r}
|
|
2584
|
-
</ft-tooltip>
|
|
2585
|
-
`}))}))}
|
|
2586
|
-
${this.isMobile?V`
|
|
2587
|
-
<ft-chip part="selected-filters mobile-filters-opener"
|
|
2588
|
-
icon="add"
|
|
2589
|
-
clickable
|
|
2590
|
-
@click=${()=>{this.mobileMenuOpen=!0,this.displayFacets=!0}}>
|
|
2591
|
-
${this.labelResolver.resolve("filtersButton")}
|
|
2592
|
-
</ft-chip>
|
|
2593
|
-
`:q}
|
|
2594
|
-
`;return t?V`
|
|
2595
|
-
<ft-snap-scroll horizontal controls hideScrollbar limitSize
|
|
2596
|
-
class="ft-search-bar--selected-filters"
|
|
2597
|
-
part="selected-filters-container"
|
|
2598
|
-
exportpartsPrefix="selected-filters-container">
|
|
2599
|
-
${e}
|
|
2600
|
-
</ft-snap-scroll>
|
|
2601
|
-
`:V`
|
|
2602
|
-
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2603
|
-
${e}
|
|
2604
|
-
</div>
|
|
2605
|
-
`}renderSuggestions(){const t=this.recentSearches.filter((t=>t.toLowerCase().includes(this.query.toLowerCase()))),e=this.suggestions.length>0||t.length>0;return V`
|
|
2606
|
-
<div class="ft-search-bar--suggestions ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2607
|
-
part="suggestions-container"
|
|
2608
|
-
@keydown=${this.onSuggestKeyDown}>
|
|
2609
|
-
${It(t.slice(0,5),(t=>t),(t=>V`
|
|
2610
|
-
<a href="${this.searchRequestSerializer({...this.request,query:t})}"
|
|
2611
|
-
part="suggestions"
|
|
2612
|
-
class="ft-search-bar--suggestion ft-search-bar--recent-search"
|
|
2613
|
-
@keyup=${e=>this.onSuggestKeyUp(e,t)}
|
|
2614
|
-
@click=${e=>this.onSuggestClick(e,t)}>
|
|
2615
|
-
<ft-ripple></ft-ripple>
|
|
2616
|
-
<ft-icon variant="material" part="suggestion-icon">history</ft-icon>
|
|
2617
|
-
<ft-typography variant="body1">${t}</ft-typography>
|
|
2618
|
-
<ft-button icon="close"
|
|
2619
|
-
round
|
|
2620
|
-
part="remove-suggestion"
|
|
2621
|
-
?dense=${!this.isMobile}
|
|
2622
|
-
label="${this.labelResolver.resolve("removeRecentSearch")}"
|
|
2623
|
-
tooltipPosition="left"
|
|
2624
|
-
@click=${e=>this.removeRecentSearch(e,t)}></ft-button>
|
|
2625
|
-
</a>
|
|
2626
|
-
`))}
|
|
2627
|
-
${It(this.suggestions,(t=>t.value),(t=>V`
|
|
2628
|
-
<a href="${this.searchRequestSerializer({...this.request,query:t.value})}"
|
|
2629
|
-
part="suggestions"
|
|
2630
|
-
class="ft-search-bar--suggestion"
|
|
2631
|
-
@keyup=${e=>this.onSuggestKeyUp(e,t.value)}
|
|
2632
|
-
@click=${e=>this.onSuggestClick(e,t.value)}>
|
|
2633
|
-
<ft-ripple></ft-ripple>
|
|
2634
|
-
${this.getIcon(t)}
|
|
2635
|
-
<ft-typography variant="body1">${t.value}</ft-typography>
|
|
2636
|
-
</a>
|
|
2637
|
-
`))}
|
|
2638
|
-
</div>
|
|
2639
|
-
`}getIcon(t){const e="DOCUMENT"===t.type?mi.file_format:mi.fluid_topics;let i;switch(t.type){case"MAP":i="BOOK"===t.editorialType?vi.BOOK:vi.ARTICLE;break;case"DOCUMENT":i=function(t,e){var i,o,s,n;t=(null!=t?t:"").toLowerCase(),e=(null!=e?e:"").toLowerCase();const[r,l]=((null!==(i=yi.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(n=null!==(s=null!==(o=xi.get(l))&&void 0!==o?o:xi.get(e))&&void 0!==s?s:xi.get(r))&&void 0!==n?n:gi.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":i=vi.TOPICS}return V`
|
|
2640
|
-
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2641
|
-
${i}
|
|
2642
|
-
</ft-icon>
|
|
2643
|
-
`}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 e,i,o,s,n;if(t.has("labels")&&(this.labelResolver=new mt(Zo,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 i=t=>this.availableContentLocales.some((e=>e.lang===t));i(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&i(t.get("contentLocale"))?t.get("contentLocale"):null===(e=this.availableContentLocales[0])||void 0===e?void 0:e.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(i=this.presets)&&void 0!==i?i:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>Xe(t))))))),t.has("selectedPreset")){const t=(null!==(o=this.presets)&&void 0!==o?o:[]).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!==(s=this.presets)&&void 0!==s?s:[]).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 Vo(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(Wo)),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 Ko(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&&Je(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=>Je(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,n;t.preventDefault(),t.stopPropagation();const r=null!==(n=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!==n?n:this.input;null==r||r.focus(),this.recentSearches=this.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.saveRecentSearches()}onSuggestKeyDown(t){var e,i,o,s,n,r;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===(r=null!==(n=null===(s=this.focusedSuggestion)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstSuggestion)||void 0===r||r.focus(),t.preventDefault(),t.stopPropagation()}}}qo.elementDefinitions={"ft-accordion":uo,"ft-accordion-item":yo,"ft-button":Mi,"ft-chip":Eo,"ft-filter":co,"ft-filter-option":po,"ft-icon":ki,"ft-ripple":ai,"ft-select":Do,"ft-select-option":Fo,"ft-size-watcher":Tt,"ft-skeleton":jo,"ft-snap-scroll":Gi,"ft-tooltip":pi,"ft-typography":qe},qo.styles=[He,Uo,Ao,To,_o],Ho([o({type:Boolean})],qo.prototype,"dense",void 0),Ho([o()],qo.prototype,"mode",void 0),Ho([o({type:Boolean})],qo.prototype,"forceMobileMenuOpen",void 0),Ho([o({type:Boolean})],qo.prototype,"forceMenuOpen",void 0),Ho([o()],qo.prototype,"baseUrl",void 0),Ho([o()],qo.prototype,"apiIntegrationIdentifier",void 0),Ho([o()],qo.prototype,"contentLocale",void 0),Ho([s()],qo.prototype,"availableContentLocales",void 0),Ho([s()],qo.prototype,"availableContentLocalesInitialized",void 0),Ho([o()],qo.prototype,"uiLocale",void 0),Ho([p({})],qo.prototype,"labels",void 0),Ho([p([])],qo.prototype,"displayedFilters",void 0),Ho([p([])],qo.prototype,"presets",void 0),Ho([o({type:String,reflect:!0})],qo.prototype,"selectedPreset",void 0),Ho([p([])],qo.prototype,"priors",void 0),Ho([o()],qo.prototype,"searchRequestSerializer",void 0),Ho([s()],qo.prototype,"searchFilters",void 0),Ho([s()],qo.prototype,"sizeCategory",void 0),Ho([s()],qo.prototype,"displayFacets",void 0),Ho([s()],qo.prototype,"mobileMenuOpen",void 0),Ho([s()],qo.prototype,"facets",void 0),Ho([s()],qo.prototype,"facetsInitialized",void 0),Ho([r(".ft-search-bar--container")],qo.prototype,"container",void 0),Ho([r(".ft-search-bar--filters-opener")],qo.prototype,"filtersOpener",void 0),Ho([r(".ft-search-bar--floating-panel")],qo.prototype,"floatingContainer",void 0),Ho([r("ft-snap-scroll.ft-search-bar--filters-container")],qo.prototype,"scrollingFiltersContainer",void 0),Ho([r(".ft-search-bar--input")],qo.prototype,"input",void 0),Ho([s()],qo.prototype,"query",void 0),Ho([s()],qo.prototype,"suggestions",void 0),Ho([s()],qo.prototype,"suggestionsLoaded",void 0),Ho([s()],qo.prototype,"recentSearches",void 0),Ho([s()],qo.prototype,"scrollToFacet",void 0),Ho([r(".ft-search-bar--suggestion:first-child")],qo.prototype,"firstSuggestion",void 0),Ho([r(".ft-search-bar--suggestion:focus-within")],qo.prototype,"focusedSuggestion",void 0),Ho([r(".ft-search-bar--suggestion:last-child")],qo.prototype,"lastSuggestion",void 0),Ho([s()],qo.prototype,"api",void 0),h("ft-search-bar")(qo),t.DEFAULT_LABELS=Zo,t.FtSearchBar=qo,t.FtSearchBarCssVariables=Po,t.LaunchSearchEvent=Ko,t.SearchStateChangeEvent=Vo,Object.defineProperty(t,"t",{value:!0})}({});
|
|
2646
|
+
`:q}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var e,i,o,s,n;if(t.has("labels")&&(this.labelResolver=new mt(Wo,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 i=t=>this.availableContentLocales.some((e=>e.lang===t));i(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&i(t.get("contentLocale"))?t.get("contentLocale"):null===(e=this.availableContentLocales[0])||void 0===e?void 0:e.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(i=this.presets)&&void 0!==i?i:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>Je(t))))))),t.has("selectedPreset")){const t=(null!==(o=this.presets)&&void 0!==o?o:[]).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!==(s=this.presets)&&void 0!==s?s:[]).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 qo(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(Jo)),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 Vo(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&&qe(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=>qe(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?q:W`
|
|
2647
|
+
<div class="ft-search-bar--floating-panel"
|
|
2648
|
+
@keyup=${this.onFloatingContainerKeyUp}
|
|
2649
|
+
part="floating-panel"
|
|
2650
|
+
tabindex="-1">
|
|
2651
|
+
${this.renderDesktopMenu()}
|
|
2652
|
+
</div>`}}Xo.elementDefinitions={"ft-accordion":uo,"ft-accordion-item":yo,"ft-button":Mi,"ft-chip":zo,"ft-filter":co,"ft-filter-option":po,"ft-icon":ki,"ft-ripple":ai,"ft-select":Do,"ft-select-option":Ro,"ft-size-watcher":At,"ft-skeleton":Io,"ft-snap-scroll":Gi,"ft-tooltip":pi,"ft-typography":Ve},Xo.styles=[_e,Uo,Ao,_o.styles,To.styles],Ko([o({type:Boolean})],Xo.prototype,"dense",void 0),Ko([o()],Xo.prototype,"mode",void 0),Ko([o({type:Boolean})],Xo.prototype,"forceMobileMenuOpen",void 0),Ko([o({type:Boolean})],Xo.prototype,"forceMenuOpen",void 0),Ko([o()],Xo.prototype,"baseUrl",void 0),Ko([o()],Xo.prototype,"apiIntegrationIdentifier",void 0),Ko([o()],Xo.prototype,"contentLocale",void 0),Ko([s()],Xo.prototype,"availableContentLocales",void 0),Ko([s()],Xo.prototype,"availableContentLocalesInitialized",void 0),Ko([o()],Xo.prototype,"uiLocale",void 0),Ko([p({})],Xo.prototype,"labels",void 0),Ko([p([])],Xo.prototype,"displayedFilters",void 0),Ko([p([])],Xo.prototype,"presets",void 0),Ko([o({type:String,reflect:!0})],Xo.prototype,"selectedPreset",void 0),Ko([p([])],Xo.prototype,"priors",void 0),Ko([o()],Xo.prototype,"searchRequestSerializer",void 0),Ko([s()],Xo.prototype,"searchFilters",void 0),Ko([s()],Xo.prototype,"sizeCategory",void 0),Ko([s()],Xo.prototype,"displayFacets",void 0),Ko([s()],Xo.prototype,"mobileMenuOpen",void 0),Ko([s()],Xo.prototype,"facets",void 0),Ko([s()],Xo.prototype,"facetsInitialized",void 0),Ko([r(".ft-search-bar--container")],Xo.prototype,"container",void 0),Ko([r(".ft-search-bar--filters-opener")],Xo.prototype,"filtersOpener",void 0),Ko([r(".ft-search-bar--floating-panel")],Xo.prototype,"floatingContainer",void 0),Ko([r("ft-snap-scroll.ft-search-bar--filters-container")],Xo.prototype,"scrollingFiltersContainer",void 0),Ko([r(".ft-search-bar--input")],Xo.prototype,"input",void 0),Ko([s()],Xo.prototype,"query",void 0),Ko([s()],Xo.prototype,"suggestions",void 0),Ko([s()],Xo.prototype,"recentSearches",void 0),Ko([s()],Xo.prototype,"scrollToFacet",void 0),Ko([s()],Xo.prototype,"api",void 0),h("ft-search-bar")(Xo),t.DEFAULT_LABELS=Wo,t.FtSearchBar=Xo,t.FtSearchBarCssVariables=Po,t.LaunchSearchEvent=Vo,t.SearchStateChangeEvent=qo,Object.defineProperty(t,"i",{value:!0})}({});
|