@fluid-topics/ft-search-bar 0.3.11 → 0.3.13
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.js +5 -5
- package/build/ft-search-bar.d.ts +2 -31
- package/build/ft-search-bar.light.js +1282 -1282
- package/build/ft-search-bar.min.js +1339 -1339
- package/build/ft-search-bar.properties.d.ts +33 -0
- package/build/ft-search-bar.properties.js +2 -0
- package/build/index.d.ts +2 -1
- package/build/index.js +2 -1
- package/package.json +14 -14
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
!function(t,e,i,o,s,r,n){var l
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
width: 0;
|
|
8
|
-
height: 0;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
1
|
+
!function(t,e,i,o,s,r,n){var l;!function(t){t.S="S",t.M="M",t.L="L",t.XL="XL",t.XXL="XXL"}(l||(l={}));const a=i.css`
|
|
2
|
+
.ft-size-watcher--pixel {
|
|
3
|
+
width: 0;
|
|
4
|
+
height: 0;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
.ft-size-watcher--pixel.ft-size-watcher--local {
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
.ft-size-watcher--watcher {
|
|
13
|
+
height: 1px;
|
|
14
|
+
width: 100vw;
|
|
15
|
+
}
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
.ft-size-watcher--local .ft-size-watcher--watcher {
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
`;var c,h=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class p extends CustomEvent{constructor(t,e){super("change",{detail:{size:t,category:e}})}}class f extends e.FtLitElement{constructor(){super(...arguments),this.debounceTimeout=100,this.local=!1,this.size=0,this.category=l.S,this.resizeObserver=new ResizeObserver((()=>this.updateSize())),this.debouncer=new e.Debouncer}render(){return i.html`
|
|
21
|
+
<div class="ft-size-watcher--pixel ${this.local?"ft-size-watcher--local":""}">
|
|
22
|
+
<div class="ft-size-watcher--watcher"></div>
|
|
23
|
+
</div>
|
|
24
|
+
`}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=l.S:this.size<976?this.category=l.M:this.size<1024?this.category=l.L:this.size<1440?this.category=l.XL:this.category=l.XXL,this.dispatchEvent(new p(this.size,this.category)))}),this.debounceTimeout)}}f.elementDefinitions={},f.styles=a,h([o.property({type:Number})],f.prototype,"debounceTimeout",void 0),h([o.property({type:Boolean})],f.prototype,"local",void 0),h([o.property({type:Number,reflect:!0})],f.prototype,"size",void 0),h([o.property({type:String,reflect:!0})],f.prototype,"category",void 0),h([o.query(".ft-size-watcher--watcher")],f.prototype,"watcher",void 0),e.customElement("ft-size-watcher")(f);const d=globalThis.trustedTypes,u=d?d.createPolicy("lit-html",{createHTML:t=>t}):void 0,b=`lit$${(Math.random()+"").slice(9)}$`,v="?"+b,g=`<${v}>`,x=document,y=(t="")=>x.createComment(t),m=t=>null===t||"object"!=typeof t&&"function"!=typeof t,$=Array.isArray,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k=/-->/g,S=/>/g,z=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),O=/'/g,B=/"/g,C=/^(?:script|style|textarea|title)$/i,E=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),I=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),F=new WeakMap,L=x.createTreeWalker(x,129,null,!1),j=(t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"<svg>":"",n=w;for(let e=0;e<i;e++){const i=t[e];let l,a,c=-1,h=0;for(;h<i.length&&(n.lastIndex=h,a=n.exec(i),null!==a);)h=n.lastIndex,n===w?"!--"===a[1]?n=k:void 0!==a[1]?n=S:void 0!==a[2]?(C.test(a[2])&&(s=RegExp("</"+a[2],"g")),n=z):void 0!==a[3]&&(n=z):n===z?">"===a[0]?(n=null!=s?s:w,c=-1):void 0===a[1]?c=-2:(c=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?z:'"'===a[3]?B:O):n===B||n===O?n=z:n===k||n===S?n=w:(n=z,s=void 0);const p=n===z&&t[e+1].startsWith("/>")?" ":"";r+=n===w?i+g:c>=0?(o.push(l),i.slice(0,c)+"$lit$"+i.slice(c)+b+p):i+b+(-2===c?(o.push(void 0),e):p)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==u?u.createHTML(l):l,o]};class M{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,l=this.parts,[a,c]=j(t,e);if(this.el=M.createElement(a,i),L.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=L.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(b)){const i=c[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(b),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?R:"?"===e[1]?Z:"@"===e[1]?_:T})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(C.test(o.tagName)){const t=o.textContent.split(b),e=t.length-1;if(e>0){o.textContent=d?d.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],y()),L.nextNode(),l.push({type:2,index:++s});o.append(t[e],y())}}}else if(8===o.nodeType)if(o.data===v)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(b,t+1));)l.push({type:7,index:s}),t+=b.length-1}s++}}static createElement(t,e){const i=x.createElement("template");return i.innerHTML=t,i}}function P(t,e,i=t,o){var s,r,n,l;if(e===I)return e;let a=void 0!==o?null===(s=i._$Cl)||void 0===s?void 0:s[o]:i._$Cu;const c=m(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==c&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===c?a=void 0:(a=new c(t),a._$AT(t,i,o)),void 0!==o?(null!==(n=(l=i)._$Cl)&&void 0!==n?n:l._$Cl=[])[o]=a:i._$Cu=a),void 0!==a&&(e=P(t,a._$AS(t,e.values),a,o)),e}class A{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:x).importNode(i,!0);L.currentNode=s;let r=L.nextNode(),n=0,l=0,a=o[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new N(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new H(r,this,t)),this.v.push(e),a=o[++l]}n!==(null==a?void 0:a.index)&&(r=L.nextNode(),n++)}return s}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class N{constructor(t,e,i,o){var s;this.type=2,this._$AH=D,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=P(this,t,e),m(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==I&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>$(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==D&&m(this._$AH)?this._$AA.nextSibling.data=t:this.k(x.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=M.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 A(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new M(t)),e}S(t){$(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 N(this.j(y()),this.j(y()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class T{constructor(t,e,i,o,s){this.type=1,this._$AH=D,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=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=P(this,t,e,0),r=!m(t)||t!==this._$AH&&t!==I,r&&(this._$AH=t);else{const o=t;let n,l;for(t=s[0],n=0;n<s.length-1;n++)l=P(this,o[i+n],e,n),l===I&&(l=this._$AH[n]),r||(r=!m(l)||l!==this._$AH[n]),l===D?t=D:t!==D&&(t+=(null!=l?l:"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.P(t)}P(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class R extends T{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===D?void 0:t}}const U=d?d.emptyScript:"";class Z extends T{constructor(){super(...arguments),this.type=4}P(t){t&&t!==D?this.element.setAttribute(this.name,U):this.element.removeAttribute(this.name)}}class _ extends T{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=P(this,t,e,0))&&void 0!==i?i:D)===I)return;const o=this._$AH,s=t===D&&o!==D||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==D&&(o===D||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class H{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){P(this,t)}}const V=window.litHtmlPolyfillSupport;null==V||V(M,N),(null!==(c=globalThis.litHtmlVersions)&&void 0!==c?c:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
25
25
|
/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2020 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
29
|
*/
|
|
30
|
-
const
|
|
30
|
+
const K=Symbol.for(""),q=t=>{if((null==t?void 0:t.r)===K)return null==t?void 0:t._$litStatic$},W=t=>({_$litStatic$:t,r:K}),G=new Map,X=(t=>(e,...i)=>{const o=i.length;let s,r;const n=[],l=[];let a,c=0,h=!1;for(;c<o;){for(a=e[c];c<o&&void 0!==(r=i[c],s=q(r));)a+=s+e[++c],h=!0;l.push(r),n.push(a),c++}if(c===o&&n.push(e[o]),h){const t=n.join("$$lit$$");void 0===(e=G.get(t))&&(n.raw=n,G.set(t,e=n)),i=l}return t(e,...i)})(E);var Y;!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"}(Y||(Y={}));const J=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),Q=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),tt={fontFamily:Q,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},et=e.FtCssVariableFactory.extend("--ft-typography-title-font-family",J),it=e.FtCssVariableFactory.extend("--ft-typography-title-font-size",tt.fontSize,"20px"),ot=e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",tt.fontWeight,"normal"),st=e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",tt.letterSpacing,"0.15px"),rt=e.FtCssVariableFactory.extend("--ft-typography-title-line-height",tt.lineHeight,"1.2"),nt=e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",tt.textTransform,"inherit"),lt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",J),at=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",tt.fontSize,"14px"),ct=e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",tt.fontWeight,"normal"),ht=e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",tt.letterSpacing,"0.105px"),pt=e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",tt.lineHeight,"1.7"),ft=e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",tt.textTransform,"inherit"),dt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",Q),ut=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",tt.fontSize,"16px"),bt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",tt.fontWeight,"600"),vt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",tt.letterSpacing,"0.144px"),gt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",tt.lineHeight,"1.5"),xt=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",tt.textTransform,"inherit"),yt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",Q),mt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",tt.fontSize,"14px"),$t=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",tt.fontWeight,"normal"),wt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",tt.letterSpacing,"0.098px"),kt=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",tt.lineHeight,"1.7"),St=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",tt.textTransform,"inherit"),zt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",tt.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",tt.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",tt.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",tt.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",tt.textTransform,"inherit")},Ot={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",tt.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",tt.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",tt.letterSpacing,"0.252px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",tt.lineHeight,"1.4"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",tt.textTransform,"inherit")},Bt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",tt.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",tt.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",tt.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",tt.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",tt.textTransform,"inherit")},Ct=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",Q),Et=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",tt.fontSize,"10px"),It=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",tt.fontWeight,"normal"),Dt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",tt.letterSpacing,"0.33px"),Ft=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",tt.lineHeight,"1.6"),Lt=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",tt.textTransform,"inherit"),jt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",Q),Mt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",tt.fontSize,"10px"),Pt=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",tt.fontWeight,"normal"),At=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",tt.letterSpacing,"1.5px"),Nt=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",tt.lineHeight,"1.6"),Tt=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",tt.textTransform,"uppercase"),Rt={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",Q),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",tt.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",tt.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",tt.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",tt.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",tt.textTransform,"uppercase")},Ut=i.css`
|
|
31
31
|
.ft-typography--title {
|
|
32
32
|
font-family: ${et};
|
|
33
33
|
font-size: ${it};
|
|
@@ -118,124 +118,156 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
118
118
|
line-height: ${Rt.lineHeight};
|
|
119
119
|
text-transform: ${Rt.textTransform};
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
`,Yt=i.css`
|
|
122
|
+
.ft-typography {
|
|
123
|
+
vertical-align: inherit;
|
|
124
|
+
}
|
|
125
|
+
`;var Jt=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Qt extends e.FtLitElement{constructor(){super(...arguments),this.variant=Y.body1}render(){return this.element?X`
|
|
126
|
+
<${W(this.element)}
|
|
123
127
|
class="ft-typography ft-typography--${this.variant}">
|
|
124
128
|
<slot></slot>
|
|
125
|
-
</${
|
|
126
|
-
`:
|
|
129
|
+
</${W(this.element)}>
|
|
130
|
+
`:X`
|
|
127
131
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
128
|
-
`}}function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
`],Y([o.property()],Yt.prototype,"element",void 0),Y([o.property()],Yt.prototype,"variant",void 0),e.customElement("ft-typography")(Yt);var ie=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const oe=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),se={color:oe,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",oe),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},re=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),ne=re,le=e.FtCssVariableFactory.extend("--ft-ripple-background-color",re),ae=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),ce=ae,he=e.FtCssVariableFactory.extend("--ft-ripple-background-color",ae);class pe extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),r=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-r.x:r.width/2),this.originY=Math.round(null!=s?s-r.y:r.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return i.html`
|
|
133
|
-
<style>
|
|
134
|
-
.ft-ripple .ft-ripple--effect,
|
|
135
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
136
|
-
width: ${this.rippleSize}px;
|
|
137
|
-
height: ${this.rippleSize}px;
|
|
138
|
-
}
|
|
132
|
+
`}}function te(t,e){return t.flatMap((t=>[t,...te(e(t),e)]))}function ee(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function ie(t,e){return{label:t.label,selected:!e&&t.selected,subOptions:t.childNodes.map((e=>ie(e,t.selected))),value:t.value}}function oe(t){return{id:t.key,label:t.label,multivalued:t.multiSelectionable,options:t.rootNodes.map((t=>ie(t,!1)))}}Qt.styles=[Ut,Zt,_t,Ht,Vt,Kt,qt,Wt,Gt,Xt,Yt],Jt([o.property()],Qt.prototype,"element",void 0),Jt([o.property()],Qt.prototype,"variant",void 0),e.customElement("ft-typography")(Qt);const se=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),re={color:se,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",se),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},ne=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),le=ne,ae=e.FtCssVariableFactory.extend("--ft-ripple-background-color",ne),ce=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),he=ce,pe=e.FtCssVariableFactory.extend("--ft-ripple-background-color",ce),fe=i.css`
|
|
133
|
+
:host {
|
|
134
|
+
display: contents;
|
|
135
|
+
}
|
|
139
136
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<div class="${r.classMap(t)}">
|
|
146
|
-
<div class="ft-ripple--background"></div>
|
|
147
|
-
<div class="ft-ripple--effect"></div>
|
|
148
|
-
</div>
|
|
149
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}pe.elementDefinitions={},pe.styles=i.css`
|
|
150
|
-
:host {
|
|
151
|
-
display: contents;
|
|
152
|
-
}
|
|
137
|
+
.ft-ripple {
|
|
138
|
+
position: absolute;
|
|
139
|
+
inset: 0;
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
}
|
|
153
142
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
pointer-events: none;
|
|
158
|
-
}
|
|
143
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
}
|
|
159
146
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
147
|
+
.ft-ripple .ft-ripple--background,
|
|
148
|
+
.ft-ripple .ft-ripple--effect {
|
|
149
|
+
position: absolute;
|
|
150
|
+
opacity: 0;
|
|
151
|
+
}
|
|
163
152
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
opacity: 0;
|
|
168
|
-
}
|
|
153
|
+
.ft-ripple .ft-ripple--background {
|
|
154
|
+
background-color: ${re.backgroundColor};
|
|
155
|
+
}
|
|
169
156
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
157
|
+
.ft-ripple .ft-ripple--effect {
|
|
158
|
+
background-color: ${re.color};
|
|
159
|
+
}
|
|
173
160
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
161
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
162
|
+
background-color: ${pe};
|
|
163
|
+
}
|
|
177
164
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
165
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
166
|
+
background-color: ${he};
|
|
167
|
+
}
|
|
181
168
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
169
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
170
|
+
background-color: ${ae};
|
|
171
|
+
}
|
|
185
172
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
173
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
174
|
+
background-color: ${le};
|
|
175
|
+
}
|
|
189
176
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
177
|
+
.ft-ripple .ft-ripple--background {
|
|
178
|
+
top: 0;
|
|
179
|
+
left: 0;
|
|
180
|
+
height: 100%;
|
|
181
|
+
width: 100%;
|
|
182
|
+
transition: opacity 75ms linear;
|
|
183
|
+
}
|
|
193
184
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
width: 100%;
|
|
199
|
-
transition: opacity 75ms linear;
|
|
200
|
-
}
|
|
185
|
+
.ft-ripple .ft-ripple--effect,
|
|
186
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
187
|
+
border-radius: 50%;
|
|
188
|
+
}
|
|
201
189
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
190
|
+
.ft-ripple .ft-ripple--effect {
|
|
191
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
192
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
193
|
+
}
|
|
206
194
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
195
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
196
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
197
|
+
left: 50%;
|
|
198
|
+
top: 50%;
|
|
199
|
+
}
|
|
211
200
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
top: 50%;
|
|
216
|
-
}
|
|
201
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
202
|
+
transform: translate(-50%, -50%);
|
|
203
|
+
}
|
|
217
204
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
205
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
206
|
+
opacity: ${re.opacityContentOnSurfaceHover};
|
|
207
|
+
}
|
|
221
208
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
209
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
210
|
+
opacity: ${re.opacityContentOnSurfaceSelected};
|
|
211
|
+
}
|
|
225
212
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
213
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
214
|
+
opacity: ${re.opacityContentOnSurfaceFocused};
|
|
215
|
+
}
|
|
229
216
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
217
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
218
|
+
opacity: ${re.opacityContentOnSurfacePressed};
|
|
219
|
+
transform: translate(-50%, -50%) scale(1);
|
|
220
|
+
}
|
|
221
|
+
`;var de=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class ue extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),r=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-r.x:r.width/2),this.originY=Math.round(null!=s?s-r.y:r.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return i.html`
|
|
222
|
+
<style>
|
|
223
|
+
.ft-ripple .ft-ripple--effect,
|
|
224
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
225
|
+
width: ${this.rippleSize}px;
|
|
226
|
+
height: ${this.rippleSize}px;
|
|
227
|
+
}
|
|
233
228
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
229
|
+
.ft-ripple .ft-ripple--effect {
|
|
230
|
+
left: ${this.originX}px;
|
|
231
|
+
top: ${this.originY}px;
|
|
232
|
+
}
|
|
233
|
+
</style>
|
|
234
|
+
<div class="${r.classMap(t)}">
|
|
235
|
+
<div class="ft-ripple--background"></div>
|
|
236
|
+
<div class="ft-ripple--effect"></div>
|
|
237
|
+
</div>
|
|
238
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}ue.elementDefinitions={},ue.styles=fe,de([o.property({type:Boolean})],ue.prototype,"primary",void 0),de([o.property({type:Boolean})],ue.prototype,"secondary",void 0),de([o.property({type:Boolean})],ue.prototype,"unbounded",void 0),de([o.property({type:Boolean})],ue.prototype,"activated",void 0),de([o.property({type:Boolean})],ue.prototype,"selected",void 0),de([o.property({type:Boolean})],ue.prototype,"disabled",void 0),de([o.state()],ue.prototype,"hovered",void 0),de([o.state()],ue.prototype,"focused",void 0),de([o.state()],ue.prototype,"pressed",void 0),de([o.state()],ue.prototype,"rippling",void 0),de([o.state()],ue.prototype,"rippleSize",void 0),de([o.state()],ue.prototype,"originX",void 0),de([o.state()],ue.prototype,"originY",void 0),de([o.query(".ft-ripple")],ue.prototype,"ripple",void 0),de([o.query(".ft-ripple--effect")],ue.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(ue);const be={distance:e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),color:e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),maxWidth:e.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px")},ve=i.css`
|
|
239
|
+
.ft-tooltip--container {
|
|
240
|
+
display: block;
|
|
241
|
+
position: relative;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.ft-tooltip--inline {
|
|
245
|
+
display: inline-block;
|
|
246
|
+
max-width: 100%;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.ft-tooltip {
|
|
250
|
+
position: absolute;
|
|
251
|
+
box-sizing: border-box;
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
width: max-content;
|
|
254
|
+
max-width: ${be.maxWidth};
|
|
255
|
+
text-align: center;
|
|
256
|
+
padding: ${be.distance};
|
|
257
|
+
z-index: ${be.zIndex};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.ft-tooltip--content {
|
|
261
|
+
padding: 4px 8px;
|
|
262
|
+
border-radius: ${be.borderRadiusS};
|
|
263
|
+
background-color: ${be.backgroundColor};
|
|
264
|
+
color: ${be.color};
|
|
265
|
+
top: -500px;
|
|
266
|
+
left: -500px;
|
|
267
|
+
position: relative;
|
|
268
|
+
word-break: break-word;
|
|
269
|
+
}
|
|
270
|
+
`;var ge=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class xe extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new e.Debouncer,this.revealDebouncer=new e.Debouncer}render(){return i.html`
|
|
239
271
|
<div part="container"
|
|
240
272
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
241
273
|
@mouseenter=${this.onHover}
|
|
@@ -251,290 +283,258 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
251
283
|
</div>
|
|
252
284
|
<slot></slot>
|
|
253
285
|
</div>
|
|
254
|
-
`}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;let s=0,r=0;switch(this.position){case"top":r=-this.tooltip.clientHeight,s=o;break;case"bottom":r=e.height,s=o;break;case"left":r=i,s=-this.tooltip.clientWidth;break;case"right":r=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const n=this.tooltip.style;n.left=s+"px",n.top=r+"px",n.maxWidth=`max(${e.width}px, ${
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.ft-tooltip--inline {
|
|
261
|
-
display: inline-block;
|
|
262
|
-
max-width: 100%;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.ft-tooltip {
|
|
266
|
-
position: absolute;
|
|
267
|
-
box-sizing: border-box;
|
|
268
|
-
overflow: hidden;
|
|
269
|
-
width: max-content;
|
|
270
|
-
max-width: ${de.maxWidth};
|
|
271
|
-
text-align: center;
|
|
272
|
-
padding: ${de.distance};
|
|
273
|
-
z-index: ${de.zIndex};
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.ft-tooltip--content {
|
|
277
|
-
padding: 4px 8px;
|
|
278
|
-
border-radius: ${de.borderRadiusS};
|
|
279
|
-
background-color: ${de.backgroundColor};
|
|
280
|
-
color: ${de.color};
|
|
281
|
-
top: -500px;
|
|
282
|
-
left: -500px;
|
|
283
|
-
position: relative;
|
|
284
|
-
word-break: break-word;
|
|
285
|
-
}
|
|
286
|
-
`,fe([o.property()],ue.prototype,"text",void 0),fe([o.property({type:Boolean})],ue.prototype,"manual",void 0),fe([o.property({type:Boolean})],ue.prototype,"inline",void 0),fe([o.property({type:Number})],ue.prototype,"delay",void 0),fe([o.property()],ue.prototype,"position",void 0),fe([o.queryAssignedNodes("",!0)],ue.prototype,"slotNodes",void 0),fe([o.query(".ft-tooltip--container")],ue.prototype,"container",void 0),fe([o.query("slot")],ue.prototype,"target",void 0),fe([o.query(".ft-tooltip")],ue.prototype,"tooltip",void 0),fe([o.query(".ft-tooltip--content")],ue.prototype,"tooltipContent",void 0),fe([o.state()],ue.prototype,"visible",void 0),e.customElement("ft-tooltip")(ue);const be={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")};class ve extends e.FtLitElement{static get styles(){return i.css`
|
|
287
|
-
:host {
|
|
288
|
-
line-height: 0;
|
|
289
|
-
}
|
|
286
|
+
`}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;let s=0,r=0;switch(this.position){case"top":r=-this.tooltip.clientHeight,s=o;break;case"bottom":r=e.height,s=o;break;case"left":r=i,s=-this.tooltip.clientWidth;break;case"right":r=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const n=this.tooltip.style;n.left=s+"px",n.top=r+"px",n.maxWidth=`max(${e.width}px, ${be.maxWidth})`}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())}}xe.elementDefinitions={"ft-typography":Qt},xe.styles=ve,ge([o.property()],xe.prototype,"text",void 0),ge([o.property({type:Boolean})],xe.prototype,"manual",void 0),ge([o.property({type:Boolean})],xe.prototype,"inline",void 0),ge([o.property({type:Number})],xe.prototype,"delay",void 0),ge([o.property()],xe.prototype,"position",void 0),ge([o.queryAssignedNodes("",!0)],xe.prototype,"slotNodes",void 0),ge([o.query(".ft-tooltip--container")],xe.prototype,"container",void 0),ge([o.query("slot")],xe.prototype,"target",void 0),ge([o.query(".ft-tooltip")],xe.prototype,"tooltip",void 0),ge([o.query(".ft-tooltip--content")],xe.prototype,"tooltipContent",void 0),ge([o.state()],xe.prototype,"visible",void 0),e.customElement("ft-tooltip")(xe);const ye={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},me=i.css`
|
|
287
|
+
:host {
|
|
288
|
+
line-height: 0;
|
|
289
|
+
}
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
.ft-loader {
|
|
292
|
+
display: inline-block;
|
|
293
|
+
position: relative;
|
|
294
294
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
width: ${ye.size};
|
|
296
|
+
height: ${ye.size};
|
|
297
|
+
}
|
|
298
298
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
299
|
+
.ft-loader div {
|
|
300
|
+
position: absolute;
|
|
301
|
+
top: 37.5%;
|
|
302
|
+
width: 25%;
|
|
303
|
+
height: 25%;
|
|
304
|
+
border-radius: 50%;
|
|
305
|
+
background: ${ye.color};
|
|
306
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
307
|
+
}
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
.ft-loader div:nth-child(1) {
|
|
310
|
+
left: 2.5%;
|
|
311
|
+
animation: appear 0.6s infinite;
|
|
312
|
+
}
|
|
313
313
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
314
|
+
.ft-loader div:nth-child(2) {
|
|
315
|
+
left: 2.5%;
|
|
316
|
+
animation: move 0.6s infinite;
|
|
317
|
+
}
|
|
318
318
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
319
|
+
.ft-loader div:nth-child(3) {
|
|
320
|
+
left: 37.5%;
|
|
321
|
+
animation: move 0.6s infinite;
|
|
322
|
+
}
|
|
323
323
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
.ft-loader div:nth-child(4) {
|
|
325
|
+
left: 72.5%;
|
|
326
|
+
animation: disappear 0.6s infinite;
|
|
327
|
+
}
|
|
328
328
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
329
|
+
@keyframes appear {
|
|
330
|
+
0% {
|
|
331
|
+
transform: scale(0);
|
|
332
|
+
}
|
|
333
|
+
100% {
|
|
334
|
+
transform: scale(1);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
337
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
338
|
+
@keyframes disappear {
|
|
339
|
+
0% {
|
|
340
|
+
transform: scale(1);
|
|
341
|
+
}
|
|
342
|
+
100% {
|
|
343
|
+
transform: scale(0);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
346
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
347
|
+
@keyframes move {
|
|
348
|
+
0% {
|
|
349
|
+
transform: translate(0, 0);
|
|
350
|
+
}
|
|
351
|
+
100% {
|
|
352
|
+
transform: translate(calc(0.35 * ${ye.size}), 0);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
`;class $e extends e.FtLitElement{render(){return i.html`
|
|
356
356
|
<div class="ft-loader">
|
|
357
357
|
<div></div>
|
|
358
358
|
<div></div>
|
|
359
359
|
<div></div>
|
|
360
360
|
<div></div>
|
|
361
361
|
</div>
|
|
362
|
-
`}}var
|
|
362
|
+
`}}var we,ke;$e.styles=me,e.customElement("ft-loader")($e),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=""}(we||(we={})),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=""}(ke||(ke={}));const Se=new Map([...["abw"].map((t=>[t,ke.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,ke.AUDIO])),...["avi"].map((t=>[t,ke.AVI])),...["chm","xhs"].map((t=>[t,ke.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,ke.CODE])),...["csv"].map((t=>[t,ke.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,ke.DITA])),...["epub"].map((t=>[t,ke.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,ke.EXCEL])),...["flac"].map((t=>[t,ke.FLAC])),...["gif"].map((t=>[t,ke.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,ke.GZIP])),...["html","htm","xhtml"].map((t=>[t,ke.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,ke.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,ke.JPEG])),...["json"].map((t=>[t,ke.JSON])),...["m4a","m4p"].map((t=>[t,ke.M4A])),...["mov","qt"].map((t=>[t,ke.MOV])),...["mp3"].map((t=>[t,ke.MP3])),...["mp4","m4v"].map((t=>[t,ke.MP4])),...["ogg","oga"].map((t=>[t,ke.OGG])),...["pdf","ps"].map((t=>[t,ke.PDF])),...["png"].map((t=>[t,ke.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,ke.POWERPOINT])),...["rar"].map((t=>[t,ke.RAR])),...["stp"].map((t=>[t,ke.STP])),...["txt","rtf","md","mdown"].map((t=>[t,ke.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,ke.VIDEO])),...["wav"].map((t=>[t,ke.WAV])),...["wma"].map((t=>[t,ke.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,ke.WORD])),...["xml","xsl","rdf"].map((t=>[t,ke.XML])),...["yaml","yml","x-yaml"].map((t=>[t,ke.YAML])),...["zip"].map((t=>[t,ke.ZIP]))]),ze=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"]]);const Oe={size:e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Be=i.css`
|
|
363
|
+
:host {
|
|
364
|
+
display: inline-block;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
:host, i.ft-icon {
|
|
368
|
+
width: ${Oe.size};
|
|
369
|
+
height: ${Oe.size};
|
|
370
|
+
text-align: center;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
i.ft-icon {
|
|
374
|
+
font-size: ${Oe.size};
|
|
375
|
+
line-height: 1;
|
|
376
|
+
font-weight: normal;
|
|
377
|
+
text-transform: none;
|
|
378
|
+
font-style: normal;
|
|
379
|
+
font-variant: normal;
|
|
380
|
+
speak: none;
|
|
381
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
382
|
+
text-rendering: auto;
|
|
383
|
+
-webkit-font-smoothing: antialiased;
|
|
384
|
+
-moz-osx-font-smoothing: grayscale;
|
|
385
|
+
vertical-align: ${Oe.verticalAlign};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.ft-icon--fluid-topics {
|
|
389
|
+
font-family: ${Oe.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.ft-icon--file-format {
|
|
393
|
+
font-family: ${Oe.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.ft-icon--material {
|
|
397
|
+
font-family: ${Oe.materialFontFamily}, "Material Icons", sans-serif;
|
|
398
|
+
}
|
|
399
|
+
`;var Ce;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ce||(Ce={}));var Ee=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ie extends e.FtLitElement{constructor(){super(...arguments),this.variant=Ce.fluid_topics,this.resolvedIcon=i.nothing}render(){const t="material"!==this.variant||this.value;return i.html`
|
|
363
400
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
364
401
|
${n.unsafeHTML(this.resolvedIcon)}
|
|
365
|
-
<slot ?hidden=${
|
|
402
|
+
<slot ?hidden=${t}></slot>
|
|
366
403
|
</i>
|
|
367
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case
|
|
404
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case Ce.file_format:this.resolvedIcon=null!==(t=ke[o.toUpperCase()])&&void 0!==t?t:o;break;case Ce.fluid_topics:this.resolvedIcon=null!==(e=we[o.toUpperCase()])&&void 0!==e?e:o;break;default:this.resolvedIcon=this.value||i.nothing}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}Ie.elementDefinitions={},Ie.styles=Be,Ee([o.property()],Ie.prototype,"variant",void 0),Ee([o.property()],Ie.prototype,"value",void 0),Ee([o.state()],Ie.prototype,"resolvedIcon",void 0),Ee([o.query("slot")],Ie.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Ie);const De=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),Fe={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:De,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",Rt.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",De),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},Le=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),je={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:Le,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",Le)},Me=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),Pe=[e.noTextSelect,i.css`
|
|
368
405
|
:host {
|
|
369
406
|
display: inline-block;
|
|
407
|
+
max-width: 100%;
|
|
408
|
+
pointer-events: none;
|
|
370
409
|
}
|
|
371
410
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
text-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
i.ft-icon {
|
|
379
|
-
font-size: ${ke.size};
|
|
380
|
-
line-height: 1;
|
|
381
|
-
font-weight: normal;
|
|
382
|
-
text-transform: none;
|
|
383
|
-
font-style: normal;
|
|
384
|
-
font-variant: normal;
|
|
385
|
-
speak: none;
|
|
386
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
387
|
-
text-rendering: auto;
|
|
388
|
-
-webkit-font-smoothing: antialiased;
|
|
389
|
-
-moz-osx-font-smoothing: grayscale;
|
|
390
|
-
vertical-align: ${ke.verticalAlign};
|
|
411
|
+
button {
|
|
412
|
+
box-shadow: 0px 0px 0px transparent;
|
|
413
|
+
border: 0px solid transparent;
|
|
414
|
+
text-shadow: 0px 0px 0px transparent;
|
|
415
|
+
font-size: ${Fe.fontSize};
|
|
391
416
|
}
|
|
392
417
|
|
|
393
|
-
|
|
394
|
-
|
|
418
|
+
button:hover {
|
|
419
|
+
box-shadow: 0px 0px 0px transparent;
|
|
420
|
+
border: 0px solid transparent;
|
|
421
|
+
text-shadow: 0px 0px 0px transparent;
|
|
395
422
|
}
|
|
396
423
|
|
|
397
|
-
|
|
398
|
-
|
|
424
|
+
button:active {
|
|
425
|
+
outline: none;
|
|
426
|
+
border: none;
|
|
399
427
|
}
|
|
400
428
|
|
|
401
|
-
|
|
402
|
-
|
|
429
|
+
button:focus {
|
|
430
|
+
outline: 0;
|
|
403
431
|
}
|
|
404
|
-
`,we([o.property()],Se.prototype,"variant",void 0),we([o.property()],Se.prototype,"value",void 0),we([o.state()],Se.prototype,"resolvedIcon",void 0),we([o.query("slot")],Se.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Se);var ze=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Oe=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),Be={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:Oe,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",Rt.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",Oe),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},Ce=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),Ee={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:Ce,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",Ce)},Ie=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM));class De extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=$e.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}static get styles(){return[e.noTextSelect,i.css`
|
|
405
|
-
:host {
|
|
406
|
-
display: inline-block;
|
|
407
|
-
max-width: 100%;
|
|
408
|
-
pointer-events: none;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
button {
|
|
412
|
-
box-shadow: 0px 0px 0px transparent;
|
|
413
|
-
border: 0px solid transparent;
|
|
414
|
-
text-shadow: 0px 0px 0px transparent;
|
|
415
|
-
font-size: ${Be.fontSize};
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
button:hover {
|
|
419
|
-
box-shadow: 0px 0px 0px transparent;
|
|
420
|
-
border: 0px solid transparent;
|
|
421
|
-
text-shadow: 0px 0px 0px transparent;
|
|
422
|
-
}
|
|
423
432
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
433
|
+
.ft-button {
|
|
434
|
+
position: relative;
|
|
435
|
+
display: flex;
|
|
436
|
+
justify-content: center;
|
|
437
|
+
align-items: center;
|
|
438
|
+
width: 100%;
|
|
439
|
+
overflow: hidden;
|
|
440
|
+
box-sizing: border-box;
|
|
441
|
+
border: none;
|
|
442
|
+
pointer-events: auto;
|
|
428
443
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
444
|
+
--ft-button-internal-line-height: calc(${Fe.fontSize} + 2px);
|
|
445
|
+
--ft-button-internal-color: ${Fe.color};
|
|
446
|
+
${e.setVariable(Oe.size,Fe.iconSize)};
|
|
447
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
448
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
449
|
+
${e.setVariable(re.color,Fe.rippleColor)};
|
|
450
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Fe.iconSize});
|
|
432
451
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
overflow: hidden;
|
|
440
|
-
box-sizing: border-box;
|
|
441
|
-
border: none;
|
|
442
|
-
pointer-events: auto;
|
|
443
|
-
|
|
444
|
-
--ft-button-internal-line-height: calc(${Be.fontSize} + 2px);
|
|
445
|
-
--ft-button-internal-color: ${Be.color};
|
|
446
|
-
${e.setVariable(ke.size,Be.iconSize)};
|
|
447
|
-
--ft-button-internal-vertical-padding: 6px;
|
|
448
|
-
--ft-button-internal-horizontal-padding: 8px;
|
|
449
|
-
${e.setVariable(se.color,Be.rippleColor)};
|
|
450
|
-
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Be.iconSize});
|
|
451
|
-
|
|
452
|
-
border-radius: ${Be.borderRadius};
|
|
453
|
-
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
454
|
-
background-color: ${Be.backgroundColor};
|
|
455
|
-
color: var(--ft-button-internal-color);
|
|
456
|
-
-webkit-mask-image: radial-gradient(white, black);
|
|
457
|
-
}
|
|
452
|
+
border-radius: ${Fe.borderRadius};
|
|
453
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
454
|
+
background-color: ${Fe.backgroundColor};
|
|
455
|
+
color: var(--ft-button-internal-color);
|
|
456
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
457
|
+
}
|
|
458
458
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
459
|
+
.ft-button:not([disabled]):hover {
|
|
460
|
+
cursor: pointer;
|
|
461
|
+
}
|
|
462
462
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
463
|
+
.ft-button--dense {
|
|
464
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
465
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
466
|
+
border-radius: ${Me};
|
|
467
|
+
}
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
469
|
+
.ft-button--round {
|
|
470
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
471
|
+
}
|
|
472
472
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
473
|
+
.ft-button[disabled] {
|
|
474
|
+
filter: grayscale(1);
|
|
475
|
+
opacity: ${Fe.opacityDisabled};
|
|
476
|
+
}
|
|
477
477
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
.ft-button.ft-button--primary {
|
|
479
|
+
background-color: ${je.backgroundColor};
|
|
480
|
+
--ft-button-internal-color: ${je.color};
|
|
481
|
+
${e.setVariable(re.color,je.rippleColor)};
|
|
482
|
+
}
|
|
483
483
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
484
|
+
.ft-button.ft-button--outlined {
|
|
485
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
486
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
487
|
+
}
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
.ft-button:focus {
|
|
490
|
+
outline: none;
|
|
491
|
+
}
|
|
492
492
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
493
|
+
.ft-button--label {
|
|
494
|
+
position: relative;
|
|
495
|
+
overflow: hidden;
|
|
496
|
+
white-space: nowrap;
|
|
497
|
+
text-overflow: ellipsis;
|
|
498
|
+
display: block;
|
|
499
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
500
|
+
${e.setVariable(Rt.fontSize,"1em")};
|
|
501
|
+
${e.setVariable(Rt.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
502
|
+
}
|
|
503
503
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
.ft-button--safari-fix .ft-button--label {
|
|
505
|
+
margin-right: 0;
|
|
506
|
+
}
|
|
507
507
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
508
|
+
.ft-button--safari-fix .ft-button--label:after {
|
|
509
|
+
content: "\\0000a0";
|
|
510
|
+
display: inline-block;
|
|
511
|
+
width: 0;
|
|
512
|
+
}
|
|
513
513
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
.ft-button--label[hidden] {
|
|
515
|
+
display: none;
|
|
516
|
+
}
|
|
517
517
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
518
|
+
ft-icon {
|
|
519
|
+
flex-shrink: 0;
|
|
520
|
+
position: relative;
|
|
521
|
+
}
|
|
522
522
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
.ft-button--label[hidden] + ft-icon {
|
|
524
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
525
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
526
|
+
}
|
|
527
527
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
528
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
529
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
530
|
+
order: -1;
|
|
531
|
+
}
|
|
532
532
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
533
|
+
ft-loader {
|
|
534
|
+
${e.setVariable(ye.size,Fe.iconSize)};
|
|
535
|
+
${e.setVariable(ye.color,"var(--ft-button-internal-color)")};
|
|
536
|
+
}
|
|
537
|
+
`];var Ae=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ne extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ce.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-button--safari-fix":e.isSafari,"ft-no-text-select":!0};return this.addTooltipIfNeeded(i.html`
|
|
538
538
|
<button part="button"
|
|
539
539
|
class="${r.classMap(t)}"
|
|
540
540
|
aria-label="${this.getLabel()}"
|
|
@@ -556,25 +556,102 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
556
556
|
</ft-tooltip>
|
|
557
557
|
`}resolveIcon(){return this.loading?i.html`
|
|
558
558
|
<ft-loader></ft-loader> `:this.icon?i.html`
|
|
559
|
-
<ft-icon
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
559
|
+
<ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Ne.elementDefinitions={"ft-ripple":ue,"ft-tooltip":xe,"ft-typography":Qt,"ft-icon":Ie,"ft-loader":$e},Ne.styles=Pe,Ae([o.property({type:Boolean})],Ne.prototype,"primary",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"outlined",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"disabled",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"dense",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"round",void 0),Ae([o.property({type:String})],Ne.prototype,"label",void 0),Ae([o.property({type:String})],Ne.prototype,"icon",void 0),Ae([o.property({type:String})],Ne.prototype,"iconVariant",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"trailingIcon",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"loading",void 0),Ae([o.property({type:String})],Ne.prototype,"tooltipPosition",void 0),Ae([o.property({type:Boolean})],Ne.prototype,"hideTooltip",void 0),Ae([o.query(".ft-button")],Ne.prototype,"button",void 0),Ae([o.query(".ft-button--label slot")],Ne.prototype,"slottedContent",void 0),e.customElement("ft-button")(Ne);const Te=e.FtCssVariableFactory.extend("--ft-checkbox-text-color",e.designSystemVariables.colorOnSurfaceHigh),Re=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Ue=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),Ze=e.FtCssVariableFactory.extend("--ft-checkbox-border-color",e.designSystemVariables.colorOnSurfaceMedium),_e=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),He=i.css`
|
|
560
|
+
* {
|
|
561
|
+
box-sizing: border-box;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.ft-checkbox {
|
|
565
|
+
box-sizing: border-box;
|
|
566
|
+
color: ${Te};
|
|
567
|
+
|
|
568
|
+
display: inline-flex;
|
|
569
|
+
align-items: center;
|
|
570
|
+
gap: 4px;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.ft-checkbox--disabled {
|
|
574
|
+
color: ${_e};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
input {
|
|
578
|
+
opacity: 0;
|
|
579
|
+
position: absolute;
|
|
580
|
+
width: 40px;
|
|
581
|
+
height: 40px;
|
|
582
|
+
margin: 0;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.ft-checkbox--box-container {
|
|
586
|
+
position: relative;
|
|
587
|
+
width: 40px;
|
|
588
|
+
height: 40px;
|
|
589
|
+
|
|
590
|
+
display: flex;
|
|
591
|
+
justify-content: center;
|
|
592
|
+
align-items: center;
|
|
593
|
+
flex-shrink: 0;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.ft-checkbox--box {
|
|
597
|
+
display: flex;
|
|
598
|
+
border: 2px solid ${Ze};
|
|
599
|
+
border-radius: 2px;
|
|
600
|
+
|
|
601
|
+
width: 18px;
|
|
602
|
+
height: 18px;
|
|
603
|
+
|
|
604
|
+
color: ${Ue};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
609
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
610
|
+
border-color: ${Re};
|
|
611
|
+
background-color: ${Re};
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
615
|
+
border-color: ${_e};
|
|
616
|
+
background-color: transparent;
|
|
617
|
+
color: ${_e};
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.ft-checkbox--checkmark {
|
|
621
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
622
|
+
opacity: 0;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.ft-checkbox--checkmark-path {
|
|
626
|
+
stroke-dashoffset: 0;
|
|
627
|
+
stroke: currentcolor;
|
|
628
|
+
stroke-width: 3px;
|
|
629
|
+
stroke-dasharray: 30;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
633
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
634
|
+
opacity: 1;
|
|
635
|
+
}
|
|
636
|
+
`;var Ve=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ke extends e.FtLitElement{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return i.html`
|
|
637
|
+
<label class="${r.classMap(t)}" for="checkbox-input">
|
|
638
|
+
<div class="ft-checkbox--box-container">
|
|
639
|
+
<ft-ripple
|
|
640
|
+
?disabled=${this.disabled}
|
|
641
|
+
?primary=${this.checked||this.indeterminate}
|
|
642
|
+
unbounded>
|
|
643
|
+
</ft-ripple>
|
|
644
|
+
<div class="ft-checkbox--box">
|
|
645
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24">
|
|
646
|
+
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
647
|
+
d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
648
|
+
</svg>
|
|
649
|
+
</div>
|
|
650
|
+
<input type="checkbox"
|
|
651
|
+
id="checkbox-input"
|
|
652
|
+
name="${this.name}"
|
|
653
|
+
.checked=${this.checked}
|
|
654
|
+
.disabled=${this.disabled}
|
|
578
655
|
@change=${this.onChange}
|
|
579
656
|
>
|
|
580
657
|
</div>
|
|
@@ -582,84 +659,86 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
582
659
|
<slot></slot>
|
|
583
660
|
</ft-typography>
|
|
584
661
|
</label>
|
|
585
|
-
`}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)}}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
662
|
+
`}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)}}Ke.elementDefinitions={"ft-ripple":ue,"ft-typography":Qt},Ke.styles=He,Ve([o.property()],Ke.prototype,"name",void 0),Ve([o.property({type:Boolean,reflect:!0})],Ke.prototype,"checked",void 0),Ve([o.property({type:Boolean})],Ke.prototype,"indeterminate",void 0),Ve([o.property({type:Boolean})],Ke.prototype,"disabled",void 0),Ve([o.query(".ft-checkbox")],Ke.prototype,"container",void 0),Ve([o.query("ft-ripple")],Ke.prototype,"ripple",void 0),e.customElement("ft-checkbox")(Ke);const qe=e.FtCssVariableFactory.extend("--ft-radio-text-color",e.designSystemVariables.colorOnSurfaceHigh),We=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Ge=(e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),e.FtCssVariableFactory.extend("--ft-radio-border-color",e.designSystemVariables.colorOnSurfaceMedium)),Xe=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),Ye=i.css`
|
|
663
|
+
* {
|
|
664
|
+
box-sizing: border-box;
|
|
665
|
+
}
|
|
589
666
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
667
|
+
.ft-radio {
|
|
668
|
+
box-sizing: border-box;
|
|
669
|
+
color: ${qe};
|
|
593
670
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
671
|
+
display: inline-flex;
|
|
672
|
+
align-items: center;
|
|
673
|
+
gap: 4px;
|
|
674
|
+
}
|
|
598
675
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
676
|
+
.ft-radio--disabled {
|
|
677
|
+
color: ${Xe};
|
|
678
|
+
}
|
|
602
679
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
680
|
+
input {
|
|
681
|
+
opacity: 0;
|
|
682
|
+
position: absolute;
|
|
683
|
+
width: 40px;
|
|
684
|
+
height: 40px;
|
|
685
|
+
margin: 0;
|
|
686
|
+
}
|
|
610
687
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
688
|
+
.ft-radio--box-container {
|
|
689
|
+
position: relative;
|
|
690
|
+
width: 40px;
|
|
691
|
+
height: 40px;
|
|
615
692
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
693
|
+
display: flex;
|
|
694
|
+
justify-content: center;
|
|
695
|
+
align-items: center;
|
|
696
|
+
flex-shrink: 0;
|
|
697
|
+
}
|
|
621
698
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
border-radius: 2px;
|
|
699
|
+
.ft-radio--box {
|
|
700
|
+
border: 2px solid ${Ge};
|
|
701
|
+
border-radius: 50%;
|
|
626
702
|
|
|
627
|
-
|
|
628
|
-
|
|
703
|
+
display: flex;
|
|
704
|
+
justify-content: center;
|
|
705
|
+
align-items: center;
|
|
629
706
|
|
|
630
|
-
|
|
631
|
-
|
|
707
|
+
width: 20px;
|
|
708
|
+
height: 20px;
|
|
709
|
+
}
|
|
632
710
|
|
|
711
|
+
.ft-radio--box:after {
|
|
712
|
+
content: " ";
|
|
713
|
+
background-color: ${We};
|
|
633
714
|
|
|
634
|
-
|
|
635
|
-
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
636
|
-
border-color: ${je};
|
|
637
|
-
background-color: ${je};
|
|
638
|
-
}
|
|
715
|
+
border-radius: 50%;
|
|
639
716
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
background-color: transparent;
|
|
643
|
-
color: ${Ae};
|
|
644
|
-
}
|
|
717
|
+
width: 12px;
|
|
718
|
+
height: 12px;
|
|
645
719
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
}
|
|
720
|
+
transform: scale(0);
|
|
721
|
+
transition: transform 100ms ease;
|
|
722
|
+
}
|
|
650
723
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
stroke-width: 3px;
|
|
655
|
-
stroke-dasharray: 30;
|
|
656
|
-
}
|
|
724
|
+
.ft-radio--checked .ft-radio--box {
|
|
725
|
+
border-color: ${We};
|
|
726
|
+
}
|
|
657
727
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
728
|
+
|
|
729
|
+
.ft-radio--checked .ft-radio--box:after {
|
|
730
|
+
transform: scale(1);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.ft-radio--disabled .ft-radio--box {
|
|
734
|
+
border-color: ${Xe};
|
|
735
|
+
background-color: transparent;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.ft-radio--disabled .ft-radio--box:after {
|
|
739
|
+
background-color: ${Xe};
|
|
740
|
+
}
|
|
741
|
+
`;var Je=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Qe extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class ti extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.name="",this.checked=!1,this.disabled=!1}render(){const t={"ft-radio":!0,"ft-radio--checked":this.checked,"ft-radio--disabled":this.disabled};return i.html`
|
|
663
742
|
<div class="${r.classMap(t)}">
|
|
664
743
|
<div class="ft-radio--box-container">
|
|
665
744
|
<ft-ripple
|
|
@@ -684,96 +763,83 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
684
763
|
</ft-typography>
|
|
685
764
|
</label>
|
|
686
765
|
</div>
|
|
687
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
color: ${_e};
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
input {
|
|
706
|
-
opacity: 0;
|
|
707
|
-
position: absolute;
|
|
708
|
-
width: 40px;
|
|
709
|
-
height: 40px;
|
|
710
|
-
margin: 0;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
.ft-radio--box-container {
|
|
714
|
-
position: relative;
|
|
715
|
-
width: 40px;
|
|
716
|
-
height: 40px;
|
|
717
|
-
|
|
718
|
-
display: flex;
|
|
719
|
-
justify-content: center;
|
|
720
|
-
align-items: center;
|
|
721
|
-
flex-shrink: 0;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
.ft-radio--box {
|
|
725
|
-
border: 2px solid ${Ze};
|
|
726
|
-
border-radius: 50%;
|
|
727
|
-
|
|
728
|
-
display: flex;
|
|
729
|
-
justify-content: center;
|
|
730
|
-
align-items: center;
|
|
766
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new Qe(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 Qe(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}ti.elementDefinitions={"ft-ripple":ue,"ft-typography":Qt},ti.styles=Ye,Je([o.property()],ti.prototype,"value",void 0),Je([o.property()],ti.prototype,"name",void 0),Je([o.property({type:Boolean,reflect:!0})],ti.prototype,"checked",void 0),Je([o.property({type:Boolean})],ti.prototype,"disabled",void 0),Je([o.query(".ft-radio")],ti.prototype,"container",void 0),Je([o.query("ft-ripple")],ti.prototype,"ripple",void 0),Je([o.query("input")],ti.prototype,"input",void 0);const ei=i.css`
|
|
767
|
+
:host {
|
|
768
|
+
display: contents;
|
|
769
|
+
}
|
|
770
|
+
`;var ii=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class oi extends e.FtLitElement{constructor(){super(...arguments),this.name=""}render(){return i.html`
|
|
771
|
+
<slot @slotchange=${this.onSlotChange}
|
|
772
|
+
@change=${this.onChange}
|
|
773
|
+
@keydown=${this.onKeyDown}
|
|
774
|
+
@focusin=${this.focusCurrentValue}
|
|
775
|
+
></slot>
|
|
776
|
+
`}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)}}oi.elementDefinitions={},oi.styles=ei,ii([o.property()],oi.prototype,"name",void 0),ii([o.queryAssignedElements()],oi.prototype,"radioButtons",void 0),e.customElement("ft-radio")(ti),e.customElement("ft-radio-group")(oi);const si={borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:e.FtCssVariableFactory.external(Ot.fontFamily,"Body2 typography"),fontSize:e.FtCssVariableFactory.external(Ot.fontSize,"Body2 typography"),fontWeight:e.FtCssVariableFactory.external(Ot.fontWeight,"Body2 typography"),letterSpacing:e.FtCssVariableFactory.external(Ot.letterSpacing,"Body2 typography"),lineHeight:e.FtCssVariableFactory.external(Ot.lineHeight,"Body2 typography"),textTransform:e.FtCssVariableFactory.external(Ot.textTransform,"Body2 typography")},ri=i.css`
|
|
777
|
+
.ft-filter-level--container {
|
|
778
|
+
display: flex;
|
|
779
|
+
flex-direction: column;
|
|
780
|
+
}
|
|
731
781
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
782
|
+
.ft-filter-level--container > * {
|
|
783
|
+
padding: 0 10px;
|
|
784
|
+
}
|
|
735
785
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
786
|
+
.ft-filter-level--go-back {
|
|
787
|
+
flex-shrink: 0;
|
|
788
|
+
text-decoration: none;
|
|
789
|
+
position: relative;
|
|
790
|
+
border-radius: ${si.borderRadiusM};
|
|
791
|
+
overflow: hidden;
|
|
792
|
+
display: flex;
|
|
793
|
+
align-items: center;
|
|
794
|
+
padding: 4px 4px;
|
|
795
|
+
gap: 4px;
|
|
796
|
+
cursor: pointer;
|
|
797
|
+
color: ${si.colorOnSurface};
|
|
798
|
+
}
|
|
739
799
|
|
|
740
|
-
|
|
800
|
+
.ft-filter-level--go-back:focus {
|
|
801
|
+
outline: none;
|
|
802
|
+
}
|
|
741
803
|
|
|
742
|
-
|
|
743
|
-
|
|
804
|
+
.ft-filter-level--go-back ft-icon {
|
|
805
|
+
flex-shrink: 0;
|
|
806
|
+
}
|
|
744
807
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
808
|
+
.ft-filter-level--go-back ft-typography {
|
|
809
|
+
display: block;
|
|
810
|
+
flex-grow: 1;
|
|
811
|
+
flex-shrink: 0;
|
|
812
|
+
}
|
|
748
813
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
814
|
+
.ft-filter-level--option {
|
|
815
|
+
display: flex;
|
|
816
|
+
align-items: center;
|
|
817
|
+
max-width: 100%;
|
|
818
|
+
}
|
|
752
819
|
|
|
820
|
+
.ft-filter-level--option ft-button {
|
|
821
|
+
margin-right: -10px;
|
|
822
|
+
flex-shrink: 0;
|
|
823
|
+
}
|
|
753
824
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
825
|
+
ft-button {
|
|
826
|
+
${e.setVariable(Fe.color,si.colorOnSurface)};
|
|
827
|
+
}
|
|
757
828
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
829
|
+
ft-radio, ft-checkbox {
|
|
830
|
+
flex-shrink: 1;
|
|
831
|
+
flex-grow: 1;
|
|
832
|
+
display: flex;
|
|
833
|
+
max-width: calc(100% + 10px);
|
|
834
|
+
margin-left: -10px;
|
|
835
|
+
word-break: break-word;
|
|
836
|
+
}
|
|
762
837
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
@change=${this.onChange}
|
|
769
|
-
@keydown=${this.onKeyDown}
|
|
770
|
-
@focusin=${this.focusCurrentValue}
|
|
771
|
-
></slot>
|
|
772
|
-
`}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)}}qe.elementDefinitions={},qe.styles=i.css`
|
|
773
|
-
:host {
|
|
774
|
-
display: contents;
|
|
775
|
-
}
|
|
776
|
-
`,Ke([o.property()],qe.prototype,"name",void 0),Ke([o.queryAssignedElements()],qe.prototype,"radioButtons",void 0),e.customElement("ft-radio")(Ve),e.customElement("ft-radio-group")(qe);var We=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Ge={borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:e.FtCssVariableFactory.external(Ot.fontFamily,"Body2 typography"),fontSize:e.FtCssVariableFactory.external(Ot.fontSize,"Body2 typography"),fontWeight:e.FtCssVariableFactory.external(Ot.fontWeight,"Body2 typography"),letterSpacing:e.FtCssVariableFactory.external(Ot.letterSpacing,"Body2 typography"),lineHeight:e.FtCssVariableFactory.external(Ot.lineHeight,"Body2 typography"),textTransform:e.FtCssVariableFactory.external(Ot.textTransform,"Body2 typography")};class Xe extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=this.options;this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return i.html`
|
|
838
|
+
.ft-filter-level--no-values {
|
|
839
|
+
margin: 10px 0;
|
|
840
|
+
color: ${si.colorOnSurfaceMedium};
|
|
841
|
+
}
|
|
842
|
+
`;var ni=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class li extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=this.options;this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return i.html`
|
|
777
843
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
778
844
|
${null==this.parent?null:i.html`
|
|
779
845
|
<div tabindex="0"
|
|
@@ -822,7 +888,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
822
888
|
data-value="${t.value}"
|
|
823
889
|
.checked=${t.selected}
|
|
824
890
|
.disabled=${this.disabled}
|
|
825
|
-
.indeterminate=${
|
|
891
|
+
.indeterminate=${te(null!==(e=t.subOptions)&&void 0!==e?e:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
|
|
826
892
|
@change=${e=>this.optionsChanged(e,t)}>
|
|
827
893
|
${t.label}
|
|
828
894
|
</ft-checkbox>
|
|
@@ -837,291 +903,156 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
837
903
|
@change=${t=>t.stopPropagation()}>
|
|
838
904
|
${t.label}
|
|
839
905
|
</ft-radio>
|
|
840
|
-
`}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}))}}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
906
|
+
`}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}))}}li.elementDefinitions={"ft-button":Ne,"ft-ripple":ue,"ft-typography":Qt,"ft-checkbox":Ke,"ft-icon":Ie,"ft-radio":ti},li.styles=ri,ni([o.property({type:String})],li.prototype,"id",void 0),ni([o.property({type:Object})],li.prototype,"parent",void 0),ni([o.property({type:Array})],li.prototype,"options",void 0),ni([o.property({type:Boolean})],li.prototype,"multivalued",void 0),ni([o.property({type:Boolean})],li.prototype,"disabled",void 0),ni([o.property({type:Boolean})],li.prototype,"hideSelectedOptions",void 0),ni([o.property({type:Boolean})],li.prototype,"preventNavigation",void 0),ni([o.property({type:String})],li.prototype,"filter",void 0),ni([o.property({type:String})],li.prototype,"moreValuesButtonLabel",void 0),ni([o.property({type:String})],li.prototype,"noValuesLabel",void 0),ni([o.property({type:Number})],li.prototype,"displayedValuesLimit",void 0),ni([o.query(".ft-filter-level--container")],li.prototype,"container",void 0),ni([o.state()],li.prototype,"displayedPages",void 0);const ai={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")},ci=i.css`
|
|
907
|
+
.ft-snap-scroll {
|
|
908
|
+
box-sizing: border-box;
|
|
909
|
+
position: relative;
|
|
910
|
+
display: flex;
|
|
845
911
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}
|
|
912
|
+
--ft-snap-scroll-transparent-color: transparent;
|
|
913
|
+
}
|
|
849
914
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
overflow: hidden;
|
|
856
|
-
display: flex;
|
|
857
|
-
align-items: center;
|
|
858
|
-
padding: 4px 4px;
|
|
859
|
-
gap: 4px;
|
|
860
|
-
cursor: pointer;
|
|
861
|
-
color: ${Ge.colorOnSurface};
|
|
862
|
-
}
|
|
915
|
+
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
916
|
+
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
917
|
+
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
918
|
+
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
919
|
+
}
|
|
863
920
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
921
|
+
.ft-snap-scroll,
|
|
922
|
+
.ft-snap-scroll--content {
|
|
923
|
+
overflow: hidden;
|
|
924
|
+
}
|
|
867
925
|
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
926
|
+
.ft-snap-scroll--limit-size,
|
|
927
|
+
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
928
|
+
width: 100%;
|
|
929
|
+
height: 100%;
|
|
930
|
+
}
|
|
871
931
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
932
|
+
.ft-snap-scroll--content {
|
|
933
|
+
flex-grow: 1;
|
|
934
|
+
flex-shrink: 1;
|
|
935
|
+
box-sizing: border-box;
|
|
936
|
+
scroll-snap-align: start;
|
|
937
|
+
display: flex;
|
|
938
|
+
flex-wrap: nowrap;
|
|
939
|
+
align-items: flex-start;
|
|
940
|
+
justify-content: flex-start;
|
|
941
|
+
gap: ${ai.gap};
|
|
942
|
+
}
|
|
877
943
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
max-width: 100%;
|
|
882
|
-
}
|
|
944
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
945
|
+
display: none;
|
|
946
|
+
}
|
|
883
947
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
948
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
949
|
+
-ms-overflow-style: none;
|
|
950
|
+
scrollbar-width: none;
|
|
951
|
+
}
|
|
888
952
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
953
|
+
.ft-snap-scroll--content::slotted(*) {
|
|
954
|
+
flex-shrink: 0;
|
|
955
|
+
flex-grow: 1;
|
|
956
|
+
max-height: 100%;
|
|
957
|
+
max-width: 100%;
|
|
958
|
+
}
|
|
892
959
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
max-width: calc(100% + 10px);
|
|
898
|
-
margin-left: -10px;
|
|
899
|
-
word-break: break-word;
|
|
900
|
-
}
|
|
960
|
+
.ft-snap-scroll--horizontal,
|
|
961
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
962
|
+
width: 100%;
|
|
963
|
+
}
|
|
901
964
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
`],We([o.property({type:String})],Xe.prototype,"id",void 0),We([o.property({type:Object})],Xe.prototype,"parent",void 0),We([o.property({type:Array})],Xe.prototype,"options",void 0),We([o.property({type:Boolean})],Xe.prototype,"multivalued",void 0),We([o.property({type:Boolean})],Xe.prototype,"disabled",void 0),We([o.property({type:Boolean})],Xe.prototype,"hideSelectedOptions",void 0),We([o.property({type:Boolean})],Xe.prototype,"preventNavigation",void 0),We([o.property({type:String})],Xe.prototype,"filter",void 0),We([o.property({type:String})],Xe.prototype,"moreValuesButtonLabel",void 0),We([o.property({type:String})],Xe.prototype,"noValuesLabel",void 0),We([o.property({type:Number})],Xe.prototype,"displayedValuesLimit",void 0),We([o.query(".ft-filter-level--container")],Xe.prototype,"container",void 0),We([o.state()],Xe.prototype,"displayedPages",void 0);var Ye=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const Je={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")};class Qe extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class ti extends e.FtLitElement{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new e.Debouncer(200),this.updateScrollDebouncer=new e.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,i=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<i||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=r.classMap({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":e.isSafari}),o=this.controls&&this.withScroll;return i.html`
|
|
907
|
-
<div part="container" class="${t}">
|
|
908
|
-
<ft-button
|
|
909
|
-
class="ft-snap-scroll--previous"
|
|
910
|
-
part="controls"
|
|
911
|
-
primary
|
|
912
|
-
icon="${this.horizontal?"arrow_back_ios_new":"expand_less"}"
|
|
913
|
-
?hidden=${!o||this.startReached}
|
|
914
|
-
?disabled=${!o||this.startReached}
|
|
915
|
-
@click=${this.previous}
|
|
916
|
-
></ft-button>
|
|
917
|
-
<slot class="ft-snap-scroll--content"
|
|
918
|
-
part="content"
|
|
919
|
-
@slotchange=${this.onSlotChange}></slot>
|
|
920
|
-
<ft-button
|
|
921
|
-
class="ft-snap-scroll--next"
|
|
922
|
-
part="controls"
|
|
923
|
-
primary
|
|
924
|
-
icon="${this.horizontal?"arrow_forward_ios":"expand_more"}"
|
|
925
|
-
?hidden=${!o||this.endReached}
|
|
926
|
-
?disabled=${!o||this.endReached}
|
|
927
|
-
@click=${this.next}
|
|
928
|
-
></ft-button>
|
|
929
|
-
</div>
|
|
930
|
-
`}updated(t){var e;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new Qe(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}ti.elementDefinitions={"ft-button":De},ti.styles=i.css`
|
|
931
|
-
.ft-snap-scroll {
|
|
932
|
-
box-sizing: border-box;
|
|
933
|
-
position: relative;
|
|
934
|
-
display: flex;
|
|
935
|
-
|
|
936
|
-
--ft-snap-scroll-transparent-color: transparent;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
940
|
-
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
941
|
-
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
942
|
-
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
.ft-snap-scroll,
|
|
946
|
-
.ft-snap-scroll--content {
|
|
947
|
-
overflow: hidden;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
.ft-snap-scroll--limit-size,
|
|
951
|
-
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
952
|
-
width: 100%;
|
|
953
|
-
height: 100%;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
.ft-snap-scroll--content {
|
|
957
|
-
flex-grow: 1;
|
|
958
|
-
flex-shrink: 1;
|
|
959
|
-
box-sizing: border-box;
|
|
960
|
-
scroll-snap-align: start;
|
|
961
|
-
display: flex;
|
|
962
|
-
flex-wrap: nowrap;
|
|
963
|
-
align-items: flex-start;
|
|
964
|
-
justify-content: flex-start;
|
|
965
|
-
gap: ${Je.gap};
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
969
|
-
display: none;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
973
|
-
-ms-overflow-style: none;
|
|
974
|
-
scrollbar-width: none;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
.ft-snap-scroll--content::slotted(*) {
|
|
978
|
-
flex-shrink: 0;
|
|
979
|
-
flex-grow: 1;
|
|
980
|
-
max-height: 100%;
|
|
981
|
-
max-width: 100%;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
.ft-snap-scroll--horizontal,
|
|
985
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
986
|
-
width: 100%;
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
.ft-snap-scroll--vertical,
|
|
990
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
991
|
-
height: 100%;
|
|
992
|
-
}
|
|
965
|
+
.ft-snap-scroll--vertical,
|
|
966
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
967
|
+
height: 100%;
|
|
968
|
+
}
|
|
993
969
|
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
970
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
971
|
+
flex-direction: row;
|
|
972
|
+
overflow-x: auto;
|
|
973
|
+
}
|
|
998
974
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
975
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
976
|
+
flex-direction: column;
|
|
977
|
+
overflow-y: auto;
|
|
978
|
+
}
|
|
1003
979
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
980
|
+
.ft-snap-scroll--previous,
|
|
981
|
+
.ft-snap-scroll--next {
|
|
982
|
+
position: absolute;
|
|
983
|
+
display: flex;
|
|
984
|
+
z-index: ${ai.buttonsZIndex};
|
|
985
|
+
opacity: 1;
|
|
986
|
+
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
987
|
+
${e.setVariable(Fe.backgroundColor,"transparent")};
|
|
988
|
+
${e.setVariable(Fe.color,ai.buttonsColor)};
|
|
989
|
+
}
|
|
1014
990
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
991
|
+
.ft-snap-scroll--previous[hidden],
|
|
992
|
+
.ft-snap-scroll--next[hidden] {
|
|
993
|
+
z-index: -1;
|
|
994
|
+
opacity: 0;
|
|
995
|
+
}
|
|
1020
996
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
997
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous {
|
|
998
|
+
top: 0;
|
|
999
|
+
left: -1px;
|
|
1000
|
+
bottom: 0;
|
|
1001
|
+
background: linear-gradient(to right, ${ai.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1002
|
+
}
|
|
1027
1003
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1004
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
1005
|
+
top: -1px;
|
|
1006
|
+
left: 0;
|
|
1007
|
+
right: 0;
|
|
1008
|
+
background: linear-gradient(to bottom, ${ai.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1009
|
+
}
|
|
1034
1010
|
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1011
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
1012
|
+
top: 0;
|
|
1013
|
+
right: -1px;
|
|
1014
|
+
bottom: 0;
|
|
1015
|
+
background: linear-gradient(to left, ${ai.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1016
|
+
}
|
|
1041
1017
|
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1018
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1019
|
+
left: 0;
|
|
1020
|
+
right: 0;
|
|
1021
|
+
bottom: -1px;
|
|
1022
|
+
background: linear-gradient(to top, ${ai.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1023
|
+
}
|
|
1048
1024
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
<div
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
<
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
<div class="ft-filter--values">
|
|
1079
|
-
${this.renderLevels()}
|
|
1080
|
-
</div>
|
|
1081
|
-
<slot class="ft-filter--slot"
|
|
1082
|
-
@slotchange=${this.updateOptionsFromSlot}
|
|
1083
|
-
@option-change=${this.optionsChanged}></slot>
|
|
1025
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1026
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1027
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1028
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1029
|
+
background-color: ${ai.colorSurface};
|
|
1030
|
+
}
|
|
1031
|
+
`;var hi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class pi extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class fi extends e.FtLitElement{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new e.Debouncer(200),this.updateScrollDebouncer=new e.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,i=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<i||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=r.classMap({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":e.isSafari}),o=this.controls&&this.withScroll;return i.html`
|
|
1032
|
+
<div part="container" class="${t}">
|
|
1033
|
+
<ft-button
|
|
1034
|
+
class="ft-snap-scroll--previous"
|
|
1035
|
+
part="controls"
|
|
1036
|
+
primary
|
|
1037
|
+
icon="${this.horizontal?"arrow_back_ios_new":"expand_less"}"
|
|
1038
|
+
?hidden=${!o||this.startReached}
|
|
1039
|
+
?disabled=${!o||this.startReached}
|
|
1040
|
+
@click=${this.previous}
|
|
1041
|
+
></ft-button>
|
|
1042
|
+
<slot class="ft-snap-scroll--content"
|
|
1043
|
+
part="content"
|
|
1044
|
+
@slotchange=${this.onSlotChange}></slot>
|
|
1045
|
+
<ft-button
|
|
1046
|
+
class="ft-snap-scroll--next"
|
|
1047
|
+
part="controls"
|
|
1048
|
+
primary
|
|
1049
|
+
icon="${this.horizontal?"arrow_forward_ios":"expand_more"}"
|
|
1050
|
+
?hidden=${!o||this.endReached}
|
|
1051
|
+
?disabled=${!o||this.endReached}
|
|
1052
|
+
@click=${this.next}
|
|
1053
|
+
></ft-button>
|
|
1084
1054
|
</div>
|
|
1085
|
-
`}
|
|
1086
|
-
${this.raiseSelectedOptions&&e.length>0?i.html`
|
|
1087
|
-
<ft-filter-level
|
|
1088
|
-
id="${this.id}"
|
|
1089
|
-
?multivalued=${this.multivalued}
|
|
1090
|
-
?disabled=${this.disabled}
|
|
1091
|
-
preventNavigation
|
|
1092
|
-
.options=${e}
|
|
1093
|
-
@change=${this.onChange}
|
|
1094
|
-
part="values selected-values"
|
|
1095
|
-
.exportpartsPrefixes=${["values","selected-values"]}
|
|
1096
|
-
></ft-filter-level>
|
|
1097
|
-
<div class="ft-filter--separator">
|
|
1098
|
-
`:null}
|
|
1099
|
-
<ft-snap-scroll horizontal hideScrollbar
|
|
1100
|
-
class="ft-filter--levels"
|
|
1101
|
-
@current-element-change=${t=>this.levelsScrollDebouncer.run((()=>{for(;t.detail.index<this.displayedLevels.length;)this.displayedLevels.pop();this.requestUpdate()}))}>
|
|
1102
|
-
${this.renderLevel(s,this.options)}
|
|
1103
|
-
${this.displayedLevels.map((e=>t.find((t=>t.value===e)))).map(((t,e)=>{var i;const s=(null==t?void 0:t.value)===this.slideIn||(null==t?void 0:t.value)===this.slideOut?"ft-filter--level-right":e===o?"ft-filter--level-center":"ft-filter--level-left";return this.renderLevel(s,null!==(i=null==t?void 0:t.subOptions)&&void 0!==i?i:[],t)}))}
|
|
1104
|
-
</ft-snap-scroll>
|
|
1105
|
-
`}renderLevel(t,e,o){return i.html`
|
|
1106
|
-
<ft-filter-level
|
|
1107
|
-
class="${t}"
|
|
1108
|
-
id="${this.id}"
|
|
1109
|
-
filter="${this.filter}"
|
|
1110
|
-
moreValuesButtonLabel="${this.moreValuesButtonLabel}"
|
|
1111
|
-
?multivalued=${this.multivalued}
|
|
1112
|
-
?disabled=${this.disabled||"ft-filter--level-center"!==t}
|
|
1113
|
-
?hideSelectedOptions=${this.raiseSelectedOptions}
|
|
1114
|
-
.parent=${o}
|
|
1115
|
-
.options=${e}
|
|
1116
|
-
.displayedValuesLimit=${this.displayedValuesLimit}
|
|
1117
|
-
@change=${this.onChange}
|
|
1118
|
-
@go-back=${this.goBack}
|
|
1119
|
-
@display-level=${this.onDisplayLevel}
|
|
1120
|
-
part="values available-values"
|
|
1121
|
-
.exportpartsPrefixes=${["values","available-values"]}
|
|
1122
|
-
noValuesLabel="${this.noValuesLabel}"
|
|
1123
|
-
></ft-filter-level>
|
|
1124
|
-
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new ci(e)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}hi.elementDefinitions={"ft-button":De,"ft-filter-level":Xe,"ft-snap-scroll":ti,"ft-typography":Yt},hi.styles=[qt,i.css`
|
|
1055
|
+
`}updated(t){var e;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new pi(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}fi.elementDefinitions={"ft-button":Ne},fi.styles=ci,hi([o.property({type:Boolean})],fi.prototype,"horizontal",void 0),hi([o.property({type:Boolean})],fi.prototype,"hideScrollbar",void 0),hi([o.property({type:Boolean})],fi.prototype,"controls",void 0),hi([o.property({type:Boolean})],fi.prototype,"limitSize",void 0),hi([o.state()],fi.prototype,"elements",void 0),hi([o.state()],fi.prototype,"currentElement",void 0),hi([o.state()],fi.prototype,"withScroll",void 0),hi([o.state()],fi.prototype,"startReached",void 0),hi([o.state()],fi.prototype,"endReached",void 0),hi([o.query(".ft-snap-scroll--content")],fi.prototype,"contentSlot",void 0),e.customElement("ft-snap-scroll")(fi);const di=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),ui=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),bi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),vi=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),gi=e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),xi=e.FtCssVariableFactory.external(e.designSystemVariables.transitionDuration,"Design system"),yi=e.FtCssVariableFactory.external(e.designSystemVariables.transitionTimingFunction,"Design system"),mi=[qt,i.css`
|
|
1125
1056
|
:host {
|
|
1126
1057
|
display: flex;
|
|
1127
1058
|
max-height: 100%;
|
|
@@ -1134,7 +1065,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1134
1065
|
flex-direction: column;
|
|
1135
1066
|
max-height: 100%;
|
|
1136
1067
|
max-width: 100%;
|
|
1137
|
-
color: ${
|
|
1068
|
+
color: ${ui};
|
|
1138
1069
|
}
|
|
1139
1070
|
|
|
1140
1071
|
.ft-filter--header {
|
|
@@ -1150,7 +1081,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1150
1081
|
.ft-filter--header ft-button {
|
|
1151
1082
|
flex-shrink: 0;
|
|
1152
1083
|
margin-left: auto;
|
|
1153
|
-
${e.setVariable(
|
|
1084
|
+
${e.setVariable(Fe.iconSize,"18px")};
|
|
1154
1085
|
}
|
|
1155
1086
|
|
|
1156
1087
|
.ft-filter--label {
|
|
@@ -1170,8 +1101,8 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1170
1101
|
padding: 0 10px;
|
|
1171
1102
|
overflow: hidden;
|
|
1172
1103
|
height: 32px;
|
|
1173
|
-
transition: height ${
|
|
1174
|
-
margin ${
|
|
1104
|
+
transition: height ${xi} ${yi},
|
|
1105
|
+
margin ${xi} ${yi};
|
|
1175
1106
|
transition-delay: 500ms;
|
|
1176
1107
|
}
|
|
1177
1108
|
|
|
@@ -1184,15 +1115,15 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1184
1115
|
display: block;
|
|
1185
1116
|
width: 100%;
|
|
1186
1117
|
border-radius: 4px;
|
|
1187
|
-
border: 1px solid ${
|
|
1118
|
+
border: 1px solid ${di};
|
|
1188
1119
|
padding: 4px;
|
|
1189
|
-
background-color: ${
|
|
1190
|
-
color: ${
|
|
1191
|
-
outline-color: ${
|
|
1120
|
+
background-color: ${gi};
|
|
1121
|
+
color: ${ui};
|
|
1122
|
+
outline-color: ${vi};
|
|
1192
1123
|
}
|
|
1193
1124
|
|
|
1194
1125
|
input::placeholder {
|
|
1195
|
-
color: ${
|
|
1126
|
+
color: ${bi};
|
|
1196
1127
|
}
|
|
1197
1128
|
|
|
1198
1129
|
.ft-filter--values {
|
|
@@ -1204,7 +1135,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1204
1135
|
}
|
|
1205
1136
|
|
|
1206
1137
|
.ft-filter--separator {
|
|
1207
|
-
border-top: 1px solid ${
|
|
1138
|
+
border-top: 1px solid ${di};
|
|
1208
1139
|
margin: 4px 10px;
|
|
1209
1140
|
}
|
|
1210
1141
|
|
|
@@ -1229,17 +1160,131 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1229
1160
|
slot {
|
|
1230
1161
|
display: none;
|
|
1231
1162
|
}
|
|
1232
|
-
`]
|
|
1163
|
+
`];var $i=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class wi extends CustomEvent{constructor(t){super("change",{detail:t})}}class ki extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e.Debouncer(300),this.changeDebouncer=new e.Debouncer(10)}get flatOptions(){return te(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}render(){var t,e;const o=this.flatOptions.some((t=>t.selected));let s=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e;return i.html`
|
|
1164
|
+
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1165
|
+
part="container">
|
|
1166
|
+
${this.label||o?i.html`
|
|
1167
|
+
<div class="ft-filter--header" part="header">
|
|
1168
|
+
<ft-typography class="ft-filter--label" variant="overline" part="label">${this.label}
|
|
1169
|
+
</ft-typography>
|
|
1170
|
+
${o?i.html`
|
|
1171
|
+
<ft-button icon="close" dense @click=${this.clear} part="clear-button">
|
|
1172
|
+
${this.clearButtonLabel}
|
|
1173
|
+
</ft-button>
|
|
1174
|
+
`:null}
|
|
1175
|
+
</div>
|
|
1176
|
+
`:null}
|
|
1177
|
+
<div class="ft-filter--filter" ?hidden=${!s}>
|
|
1178
|
+
<input type="search"
|
|
1179
|
+
part="input"
|
|
1180
|
+
class="ft-typography--caption"
|
|
1181
|
+
?disabled=${!s}
|
|
1182
|
+
placeholder="${this.filterPlaceHolder.replace("{0}",this.label)}"
|
|
1183
|
+
@search=${this.onFilterChange}
|
|
1184
|
+
@keyup=${this.onFilterChange}>
|
|
1185
|
+
</div>
|
|
1186
|
+
<div class="ft-filter--values">
|
|
1187
|
+
${this.renderLevels()}
|
|
1188
|
+
</div>
|
|
1189
|
+
<slot class="ft-filter--slot"
|
|
1190
|
+
@slotchange=${this.updateOptionsFromSlot}
|
|
1191
|
+
@option-change=${this.optionsChanged}></slot>
|
|
1192
|
+
</div>
|
|
1193
|
+
`}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)),o=this.slideIn||this.slideOut?this.displayedLevels.length-2:this.displayedLevels.length-1,s=o<0?"ft-filter--level-center":"ft-filter--level-left";return i.html`
|
|
1194
|
+
${this.raiseSelectedOptions&&e.length>0?i.html`
|
|
1195
|
+
<ft-filter-level
|
|
1196
|
+
id="${this.id}"
|
|
1197
|
+
?multivalued=${this.multivalued}
|
|
1198
|
+
?disabled=${this.disabled}
|
|
1199
|
+
preventNavigation
|
|
1200
|
+
.options=${e}
|
|
1201
|
+
@change=${this.onChange}
|
|
1202
|
+
part="values selected-values"
|
|
1203
|
+
.exportpartsPrefixes=${["values","selected-values"]}
|
|
1204
|
+
></ft-filter-level>
|
|
1205
|
+
<div class="ft-filter--separator">
|
|
1206
|
+
`:null}
|
|
1207
|
+
<ft-snap-scroll horizontal hideScrollbar
|
|
1208
|
+
class="ft-filter--levels"
|
|
1209
|
+
@current-element-change=${t=>this.levelsScrollDebouncer.run((()=>{for(;t.detail.index<this.displayedLevels.length;)this.displayedLevels.pop();this.requestUpdate()}))}>
|
|
1210
|
+
${this.renderLevel(s,this.options)}
|
|
1211
|
+
${this.displayedLevels.map((e=>t.find((t=>t.value===e)))).map(((t,e)=>{var i;const s=(null==t?void 0:t.value)===this.slideIn||(null==t?void 0:t.value)===this.slideOut?"ft-filter--level-right":e===o?"ft-filter--level-center":"ft-filter--level-left";return this.renderLevel(s,null!==(i=null==t?void 0:t.subOptions)&&void 0!==i?i:[],t)}))}
|
|
1212
|
+
</ft-snap-scroll>
|
|
1213
|
+
`}renderLevel(t,e,o){return i.html`
|
|
1214
|
+
<ft-filter-level
|
|
1215
|
+
class="${t}"
|
|
1216
|
+
id="${this.id}"
|
|
1217
|
+
filter="${this.filter}"
|
|
1218
|
+
moreValuesButtonLabel="${this.moreValuesButtonLabel}"
|
|
1219
|
+
?multivalued=${this.multivalued}
|
|
1220
|
+
?disabled=${this.disabled||"ft-filter--level-center"!==t}
|
|
1221
|
+
?hideSelectedOptions=${this.raiseSelectedOptions}
|
|
1222
|
+
.parent=${o}
|
|
1223
|
+
.options=${e}
|
|
1224
|
+
.displayedValuesLimit=${this.displayedValuesLimit}
|
|
1225
|
+
@change=${this.onChange}
|
|
1226
|
+
@go-back=${this.goBack}
|
|
1227
|
+
@display-level=${this.onDisplayLevel}
|
|
1228
|
+
part="values available-values"
|
|
1229
|
+
.exportpartsPrefixes=${["values","available-values"]}
|
|
1230
|
+
noValuesLabel="${this.noValuesLabel}"
|
|
1231
|
+
></ft-filter-level>
|
|
1232
|
+
`}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 wi(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)}}ki.elementDefinitions={"ft-button":Ne,"ft-filter-level":li,"ft-snap-scroll":fi,"ft-typography":Qt},ki.styles=mi,$i([o.property({type:String})],ki.prototype,"id",void 0),$i([o.property({type:String})],ki.prototype,"label",void 0),$i([o.property({type:String})],ki.prototype,"filterPlaceHolder",void 0),$i([o.property({type:String})],ki.prototype,"clearButtonLabel",void 0),$i([o.property({type:String})],ki.prototype,"moreValuesButtonLabel",void 0),$i([o.property({type:String})],ki.prototype,"noValuesLabel",void 0),$i([e.jsonProperty([])],ki.prototype,"options",void 0),$i([o.property({type:Boolean})],ki.prototype,"multivalued",void 0),$i([o.property({type:Boolean})],ki.prototype,"disabled",void 0),$i([o.property({type:Boolean})],ki.prototype,"raiseSelectedOptions",void 0),$i([o.property({type:Number})],ki.prototype,"displayedValuesLimit",void 0),$i([o.query(".ft-filter--slot")],ki.prototype,"slotElement",void 0),$i([o.query(".ft-filter--container")],ki.prototype,"container",void 0),$i([o.query(".ft-filter--values")],ki.prototype,"valuesContainer",void 0),$i([o.query(".ft-filter--levels")],ki.prototype,"levelsContainer",void 0),$i([o.query(".ft-filter--levels ft-filter-level:last-child")],ki.prototype,"lastLevel",void 0),$i([o.query(".ft-filter--filter input")],ki.prototype,"filterInput",void 0),$i([o.queryAll(".ft-filter--levels ft-filter-level")],ki.prototype,"levels",void 0),$i([o.state()],ki.prototype,"withScroll",void 0),$i([o.state()],ki.prototype,"filter",void 0),$i([o.state()],ki.prototype,"slideIn",void 0),$i([o.state()],ki.prototype,"slideOut",void 0);var Si=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class zi extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return i.html`
|
|
1233
1233
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1234
|
-
`}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}))}}
|
|
1234
|
+
`}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}))}}zi.elementDefinitions={},Si([o.property({type:String})],zi.prototype,"label",void 0),Si([o.property({type:Object,converter:t=>t})],zi.prototype,"value",void 0),Si([o.property({type:Boolean,reflect:!0})],zi.prototype,"selected",void 0),Si([o.property({type:Object})],zi.prototype,"subOptions",void 0),Si([o.query(".ft-filter-option--slot")],zi.prototype,"slotElement",void 0),e.customElement("ft-filter")(ki),e.customElement("ft-filter-option")(zi);const Oi=i.css`
|
|
1235
|
+
.ft-accordion {
|
|
1236
|
+
box-sizing: border-box;
|
|
1237
|
+
}
|
|
1238
|
+
`;var Bi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ci extends e.FtLitElement{constructor(){super(...arguments),this.multi=!1}render(){return i.html`
|
|
1235
1239
|
<div class="ft-accordion">
|
|
1236
1240
|
<slot @activated=${this.onChange}></slot>
|
|
1237
1241
|
</div>
|
|
1238
|
-
`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}}
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1242
|
+
`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}}Ci.elementDefinitions={},Ci.styles=Oi,Bi([o.property({type:Boolean})],Ci.prototype,"multi",void 0),Bi([o.query("slot")],Ci.prototype,"content",void 0);const Ei=e.FtCssVariableFactory.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),Ii=e.FtCssVariableFactory.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),Di=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),Fi=i.css`
|
|
1243
|
+
.ft-accordion-item {
|
|
1244
|
+
display: flex;
|
|
1245
|
+
flex-direction: column;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
.ft-accordion-item--toggle {
|
|
1249
|
+
flex-shrink: 0;
|
|
1250
|
+
flex-grow: 0;
|
|
1251
|
+
position: relative;
|
|
1252
|
+
display: flex;
|
|
1253
|
+
align-items: center;
|
|
1254
|
+
cursor: pointer;
|
|
1255
|
+
padding: ${Ii} ${Ei};
|
|
1256
|
+
gap: calc(${Ei} / 2);
|
|
1257
|
+
outline: none;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
.ft-accordion-item--toggle > *:not(ft-ripple) {
|
|
1261
|
+
position: relative;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
.ft-accordion-item--label {
|
|
1265
|
+
flex-grow: 1;
|
|
1266
|
+
flex-shrink: 1;
|
|
1267
|
+
display: block;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
.ft-accordion-item--content {
|
|
1271
|
+
box-sizing: border-box;
|
|
1272
|
+
flex-shrink: 1;
|
|
1273
|
+
flex-grow: 1;
|
|
1274
|
+
overflow: hidden;
|
|
1275
|
+
height: 0;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.ft-accordion-item--active .ft-accordion-item--content {
|
|
1279
|
+
height: initial;
|
|
1280
|
+
overflow: visible;
|
|
1281
|
+
padding: ${Ii} ${Ei};
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
.ft-accordion-item--separator {
|
|
1285
|
+
border-bottom: 1px solid ${Di};
|
|
1286
|
+
}
|
|
1287
|
+
`;var Li=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class ji extends e.FtLitElement{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return i.html`
|
|
1243
1288
|
<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}">
|
|
1244
1289
|
<div class="ft-accordion-item--toggle"
|
|
1245
1290
|
part="toggle"
|
|
@@ -1263,182 +1308,137 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1263
1308
|
</div>
|
|
1264
1309
|
<div class="ft-accordion-item--separator" part="separator"></div>
|
|
1265
1310
|
</div>
|
|
1266
|
-
`}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)}}
|
|
1267
|
-
|
|
1268
|
-
display:
|
|
1269
|
-
|
|
1311
|
+
`}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)}}ji.elementDefinitions={"ft-ripple":ue,"ft-typography":Qt,"ft-icon":Ie},ji.styles=Fi,Li([o.property({type:String})],ji.prototype,"icon",void 0),Li([o.property({type:String})],ji.prototype,"label",void 0),Li([o.property({type:Boolean,reflect:!0})],ji.prototype,"active",void 0),e.customElement("ft-accordion")(Ci),e.customElement("ft-accordion-item")(ji);const Mi=e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnSurface),Pi={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorSurface),color:Mi,fontSize:e.FtCssVariableFactory.extend("--ft-chip-font-size",Ot.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:e.FtCssVariableFactory.extend("--ft-chip-ripple-color",Mi),horizontalPadding:e.FtCssVariableFactory.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:e.FtCssVariableFactory.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},Ai=e.FtCssVariableFactory.extend("--ft-chip-highlighted-color",e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnPrimary)),Ni={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-background-color",e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorPrimary)),color:Ai,rippleColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-ripple-color",Ai)},Ti=e.FtCssVariableFactory.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),Ri=e.FtCssVariableFactory.create("--ft-chip-dense-vertical-padding","SIZE","4px"),Ui=[e.noTextSelect,i.css`
|
|
1312
|
+
:host {
|
|
1313
|
+
display: inline-block;
|
|
1314
|
+
max-width: 100%;
|
|
1315
|
+
pointer-events: none;
|
|
1270
1316
|
}
|
|
1271
1317
|
|
|
1272
|
-
.ft-
|
|
1273
|
-
flex-shrink: 0;
|
|
1274
|
-
flex-grow: 0;
|
|
1318
|
+
.ft-chip {
|
|
1275
1319
|
position: relative;
|
|
1276
1320
|
display: flex;
|
|
1321
|
+
justify-content: center;
|
|
1277
1322
|
align-items: center;
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1323
|
+
width: 100%;
|
|
1324
|
+
overflow: hidden;
|
|
1325
|
+
box-sizing: border-box;
|
|
1326
|
+
pointer-events: auto;
|
|
1327
|
+
|
|
1328
|
+
--ft-chip-internal-font-size: ${Pi.fontSize};
|
|
1329
|
+
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1330
|
+
${e.setVariable(Oe.size,Pi.iconSize)};
|
|
1331
|
+
--ft-chip-internal-vertical-padding: ${Pi.verticalPadding};
|
|
1332
|
+
--ft-chip-internal-horizontal-padding: ${Pi.horizontalPadding};
|
|
1333
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
1334
|
+
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${Pi.iconSize});
|
|
1335
|
+
|
|
1336
|
+
border: 1px solid ${Pi.colorOutline};
|
|
1337
|
+
color: ${Pi.color};
|
|
1338
|
+
${e.setVariable(re.color,Pi.rippleColor)};
|
|
1339
|
+
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
1340
|
+
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
1341
|
+
background-color: ${Pi.backgroundColor};
|
|
1342
|
+
line-height: var(--ft-chip-internal-content-height);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.ft-chip > *:not(ft-ripple) {
|
|
1285
1346
|
position: relative;
|
|
1286
1347
|
}
|
|
1287
1348
|
|
|
1288
|
-
.ft-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1349
|
+
.ft-chip--dense {
|
|
1350
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
1351
|
+
--ft-chip-internal-vertical-padding: ${Ri};
|
|
1352
|
+
--ft-chip-internal-horizontal-padding: ${Ti};
|
|
1353
|
+
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1292
1354
|
}
|
|
1293
1355
|
|
|
1294
|
-
.ft-
|
|
1295
|
-
|
|
1296
|
-
flex-shrink: 1;
|
|
1297
|
-
flex-grow: 1;
|
|
1298
|
-
overflow: hidden;
|
|
1299
|
-
height: 0;
|
|
1356
|
+
.ft-chip--no-content {
|
|
1357
|
+
--ft-chip-internal-horizontal-padding: var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding));
|
|
1300
1358
|
}
|
|
1301
1359
|
|
|
1302
|
-
.ft-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1360
|
+
.ft-chip--disabled {
|
|
1361
|
+
cursor: default;
|
|
1362
|
+
pointer-events: none;
|
|
1363
|
+
filter: grayscale(1);
|
|
1364
|
+
opacity: ${Pi.opacityDisabled};
|
|
1306
1365
|
}
|
|
1307
1366
|
|
|
1308
|
-
.ft-
|
|
1309
|
-
border
|
|
1367
|
+
.ft-chip--highlighted {
|
|
1368
|
+
border: none;
|
|
1369
|
+
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
1370
|
+
background-color: ${Ni.backgroundColor};
|
|
1371
|
+
${e.setVariable(re.color,Ni.rippleColor)};
|
|
1372
|
+
color: ${Ni.color};
|
|
1310
1373
|
}
|
|
1311
|
-
`,bi([o.property({type:String})],yi.prototype,"icon",void 0),bi([o.property({type:String})],yi.prototype,"label",void 0),bi([o.property({type:Boolean,reflect:!0})],yi.prototype,"active",void 0),e.customElement("ft-accordion")(ui),e.customElement("ft-accordion-item")(yi);var mi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};const $i=e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnSurface),wi={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorSurface),color:$i,fontSize:e.FtCssVariableFactory.extend("--ft-chip-font-size",Ot.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:e.FtCssVariableFactory.extend("--ft-chip-ripple-color",$i),horizontalPadding:e.FtCssVariableFactory.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:e.FtCssVariableFactory.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},ki=e.FtCssVariableFactory.extend("--ft-chip-highlighted-color",e.FtCssVariableFactory.extend("--ft-chip-color",e.designSystemVariables.colorOnPrimary)),Si={backgroundColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-background-color",e.FtCssVariableFactory.extend("--ft-chip-background-color",e.designSystemVariables.colorPrimary)),color:ki,rippleColor:e.FtCssVariableFactory.extend("--ft-chip-highlighted-ripple-color",ki)},zi=e.FtCssVariableFactory.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),Oi=e.FtCssVariableFactory.create("--ft-chip-dense-vertical-padding","SIZE","4px");class Bi extends CustomEvent{constructor(){super("icon-click")}}class Ci extends e.FtLitElement{constructor(){super(...arguments),this.highlighted=!1,this.removable=!1,this.disabled=!1,this.clickable=!1,this.iconClickable=!1,this.dense=!1,this.multiLine=!1,this.label="",this.icon=void 0,this.trailingIcon=!1}static get styles(){return[e.noTextSelect,i.css`
|
|
1312
|
-
:host {
|
|
1313
|
-
display: inline-block;
|
|
1314
|
-
max-width: 100%;
|
|
1315
|
-
pointer-events: none;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
.ft-chip {
|
|
1319
|
-
position: relative;
|
|
1320
|
-
display: flex;
|
|
1321
|
-
justify-content: center;
|
|
1322
|
-
align-items: center;
|
|
1323
|
-
width: 100%;
|
|
1324
|
-
overflow: hidden;
|
|
1325
|
-
box-sizing: border-box;
|
|
1326
|
-
pointer-events: auto;
|
|
1327
|
-
|
|
1328
|
-
--ft-chip-internal-font-size: ${wi.fontSize};
|
|
1329
|
-
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1330
|
-
${e.setVariable(ke.size,wi.iconSize)};
|
|
1331
|
-
--ft-chip-internal-vertical-padding: ${wi.verticalPadding};
|
|
1332
|
-
--ft-chip-internal-horizontal-padding: ${wi.horizontalPadding};
|
|
1333
|
-
--ft-chip-internal-icon-padding: 3px;
|
|
1334
|
-
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${wi.iconSize});
|
|
1335
|
-
|
|
1336
|
-
border: 1px solid ${wi.colorOutline};
|
|
1337
|
-
color: ${wi.color};
|
|
1338
|
-
${e.setVariable(se.color,wi.rippleColor)};
|
|
1339
|
-
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
1340
|
-
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
1341
|
-
background-color: ${wi.backgroundColor};
|
|
1342
|
-
line-height: var(--ft-chip-internal-content-height);
|
|
1343
|
-
}
|
|
1344
1374
|
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
.ft-chip--dense {
|
|
1350
|
-
--ft-chip-internal-icon-padding: 3px;
|
|
1351
|
-
--ft-chip-internal-vertical-padding: ${Oi};
|
|
1352
|
-
--ft-chip-internal-horizontal-padding: ${zi};
|
|
1353
|
-
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
.ft-chip--no-content {
|
|
1357
|
-
--ft-chip-internal-horizontal-padding: var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding));
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
.ft-chip--disabled {
|
|
1361
|
-
cursor: default;
|
|
1362
|
-
pointer-events: none;
|
|
1363
|
-
filter: grayscale(1);
|
|
1364
|
-
opacity: ${wi.opacityDisabled};
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
.ft-chip--highlighted {
|
|
1368
|
-
border: none;
|
|
1369
|
-
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
1370
|
-
background-color: ${Si.backgroundColor};
|
|
1371
|
-
${e.setVariable(se.color,Si.rippleColor)};
|
|
1372
|
-
color: ${Si.color};
|
|
1373
|
-
}
|
|
1375
|
+
.ft-chip--clickable {
|
|
1376
|
+
cursor: pointer;
|
|
1377
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
1378
|
+
}
|
|
1374
1379
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
}
|
|
1380
|
+
.ft-chip:focus {
|
|
1381
|
+
outline: none;
|
|
1382
|
+
}
|
|
1379
1383
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1384
|
+
.ft-chip--icon-container {
|
|
1385
|
+
display: inline-flex;
|
|
1386
|
+
position: relative;
|
|
1387
|
+
overflow: hidden;
|
|
1388
|
+
border-radius: 100%;
|
|
1389
|
+
justify-content: center;
|
|
1390
|
+
align-items: center;
|
|
1391
|
+
flex-shrink: 0;
|
|
1383
1392
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
overflow: hidden;
|
|
1388
|
-
border-radius: 100%;
|
|
1389
|
-
justify-content: center;
|
|
1390
|
-
align-items: center;
|
|
1391
|
-
flex-shrink: 0;
|
|
1392
|
-
|
|
1393
|
-
padding: var(--ft-chip-internal-icon-padding);
|
|
1394
|
-
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
1395
|
-
}
|
|
1393
|
+
padding: var(--ft-chip-internal-icon-padding);
|
|
1394
|
+
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
1395
|
+
}
|
|
1396
1396
|
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1397
|
+
.ft-chip--icon-container > *:not(ft-ripple) {
|
|
1398
|
+
position: relative;
|
|
1399
|
+
}
|
|
1400
1400
|
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1401
|
+
.ft-chip--label {
|
|
1402
|
+
vertical-align: bottom;
|
|
1403
|
+
display: block;
|
|
1404
|
+
margin: 0 var(--ft-chip-internal-horizontal-padding);
|
|
1405
|
+
${e.setVariable(Ot.fontSize,"var(--ft-chip-internal-font-size)")};
|
|
1406
|
+
${e.setVariable(Ot.lineHeight,"var(--ft-chip-internal-content-height)")};
|
|
1407
|
+
}
|
|
1408
1408
|
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1409
|
+
.ft-chip--safari-fix .ft-chip--label {
|
|
1410
|
+
margin-right: 0;
|
|
1411
|
+
}
|
|
1412
1412
|
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1413
|
+
.ft-chip:not(.ft-chip--multi-line) .ft-chip--label {
|
|
1414
|
+
overflow: hidden;
|
|
1415
|
+
white-space: nowrap;
|
|
1416
|
+
text-overflow: ellipsis;
|
|
1417
|
+
}
|
|
1418
1418
|
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1419
|
+
.ft-chip--safari-fix:not(.ft-chip--multi-line) .ft-chip--label:after {
|
|
1420
|
+
content: "\\0000a0";
|
|
1421
|
+
display: inline-block;
|
|
1422
|
+
width: 0;
|
|
1423
|
+
}
|
|
1424
1424
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1425
|
+
.ft-chip--no-content .ft-chip--label {
|
|
1426
|
+
display: none;
|
|
1427
|
+
}
|
|
1428
1428
|
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1429
|
+
.ft-chip--no-content .ft-chip--label + .ft-chip--icon-container {
|
|
1430
|
+
width: var(--ft-chip-internal-content-height);
|
|
1431
|
+
height: var(--ft-chip-internal-content-height);
|
|
1432
|
+
}
|
|
1433
1433
|
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1434
|
+
.ft-chip--icon-container:focus {
|
|
1435
|
+
outline: none;
|
|
1436
|
+
}
|
|
1437
1437
|
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1438
|
+
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container {
|
|
1439
|
+
order: -1;
|
|
1440
|
+
}
|
|
1441
|
+
`];var Zi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class _i extends CustomEvent{constructor(){super("icon-click")}}class Hi extends e.FtLitElement{constructor(){super(...arguments),this.highlighted=!1,this.removable=!1,this.disabled=!1,this.clickable=!1,this.iconClickable=!1,this.dense=!1,this.multiLine=!1,this.label="",this.icon=void 0,this.trailingIcon=!1}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":e.isSafari};return i.html`
|
|
1442
1442
|
<div class="${r.classMap(t)}"
|
|
1443
1443
|
aria-label="${this.getLabel()}"
|
|
1444
1444
|
tabindex="${this.interactionsOnChip?0:-1}"
|
|
@@ -1457,7 +1457,123 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1457
1457
|
<ft-ripple ?disabled=${!this.interactionsOnIcon}></ft-ripple>
|
|
1458
1458
|
<ft-icon variant="material">${this.internalIcon}</ft-icon>
|
|
1459
1459
|
</div>
|
|
1460
|
-
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new
|
|
1460
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new _i))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new _i))}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)}}Hi.elementDefinitions={"ft-ripple":ue,"ft-typography":Qt,"ft-icon":Ie},Hi.styles=Ui,Zi([o.property({type:Boolean})],Hi.prototype,"highlighted",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"removable",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"disabled",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"clickable",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"iconClickable",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"dense",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"multiLine",void 0),Zi([o.property({type:String})],Hi.prototype,"label",void 0),Zi([o.property({type:String})],Hi.prototype,"icon",void 0),Zi([o.property({type:Boolean})],Hi.prototype,"trailingIcon",void 0),Zi([o.query("ft-typography slot")],Hi.prototype,"slottedContent",void 0),e.customElement("ft-chip")(Hi);const Vi={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Ki=i.css`
|
|
1461
|
+
.ft-input-label {
|
|
1462
|
+
position: absolute;
|
|
1463
|
+
inset: 0;
|
|
1464
|
+
display: flex;
|
|
1465
|
+
background-color: ${Vi.colorSurface};
|
|
1466
|
+
border-radius: ${Vi.borderRadiusS} ${Vi.borderRadiusS} 0 0;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
.ft-input-label--outlined {
|
|
1470
|
+
border-radius: ${Vi.borderRadiusS};
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
.ft-input-label {
|
|
1474
|
+
border-color: ${Vi.borderColor};
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
.ft-input-label.ft-input-label--in-error {
|
|
1478
|
+
border-color: ${Vi.colorError}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.ft-input-label:before,
|
|
1482
|
+
.ft-input-label:after {
|
|
1483
|
+
content: "";
|
|
1484
|
+
display: flex;
|
|
1485
|
+
border-bottom-width: 1px;
|
|
1486
|
+
border-bottom-style: solid;
|
|
1487
|
+
border-color: inherit;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.ft-input-label:before {
|
|
1491
|
+
width: ${Vi.horizontalSpacing};
|
|
1492
|
+
flex-shrink: 0;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
.ft-input-label:after {
|
|
1496
|
+
flex-grow: 1;
|
|
1497
|
+
flex-shrink: 1;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
.ft-input-label--text {
|
|
1501
|
+
display: flex;
|
|
1502
|
+
flex-shrink: 1;
|
|
1503
|
+
position: relative;
|
|
1504
|
+
border-bottom-width: 1px;
|
|
1505
|
+
border-bottom-style: solid;
|
|
1506
|
+
border-color: inherit;
|
|
1507
|
+
color: ${Vi.textColor};
|
|
1508
|
+
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1509
|
+
${e.setVariable(Bt.fontSize,Vi.fontSize)};
|
|
1510
|
+
${e.setVariable(Bt.lineHeight,Vi.fontSize)};
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
.ft-input-label--in-error .ft-input-label--text {
|
|
1514
|
+
color: ${Vi.colorError}
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.ft-input-label--disabled .ft-input-label--text {
|
|
1518
|
+
color: ${Vi.disabledTextColor};
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
.ft-input-label--hidden-text {
|
|
1522
|
+
padding: 0 4px;
|
|
1523
|
+
opacity: 0;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
.ft-input-label--floating-text {
|
|
1527
|
+
position: absolute;
|
|
1528
|
+
top: calc(50% - var(--ft-typography-caption-line-height) / 2);
|
|
1529
|
+
transition: top 250ms;
|
|
1530
|
+
overflow: hidden;
|
|
1531
|
+
white-space: nowrap;
|
|
1532
|
+
text-overflow: ellipsis;
|
|
1533
|
+
padding: ${Vi.verticalSpacing} 4px;
|
|
1534
|
+
margin: calc(${Vi.verticalSpacing} * -1) 0;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.ft-input-label--raised .ft-input-label--text {
|
|
1538
|
+
${e.setVariable(Bt.fontSize,Vi.raisedFontSize)};
|
|
1539
|
+
${e.setVariable(Bt.lineHeight,Vi.raisedFontSize)};
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
.ft-input-label--raised .ft-input-label--floating-text {
|
|
1543
|
+
top: ${Vi.verticalSpacing};
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.ft-input-label--outlined .ft-input-label--text,
|
|
1547
|
+
.ft-input-label--outlined:before,
|
|
1548
|
+
.ft-input-label--outlined:after {
|
|
1549
|
+
border-top-width: 1px;
|
|
1550
|
+
border-top-style: solid;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
.ft-input-label--outlined:before {
|
|
1554
|
+
border-left-width: 1px;
|
|
1555
|
+
border-left-style: solid;
|
|
1556
|
+
border-radius: ${Vi.borderRadiusS} 0 0 ${Vi.borderRadiusS};
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
.ft-input-label--outlined:after {
|
|
1560
|
+
border-right-width: 1px;
|
|
1561
|
+
border-right-style: solid;
|
|
1562
|
+
border-radius: 0 ${Vi.borderRadiusS} ${Vi.borderRadiusS} 0;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
1566
|
+
padding: 2px 4px;
|
|
1567
|
+
z-index: ${Vi.raisedZIndex};
|
|
1568
|
+
background-color: ${Vi.colorSurface};
|
|
1569
|
+
border-radius: ${Vi.borderRadiusS};
|
|
1570
|
+
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
1574
|
+
border-top: none;
|
|
1575
|
+
}
|
|
1576
|
+
`;var qi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Wi extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return i.html`
|
|
1461
1577
|
<div class="${r.classMap(t)}">
|
|
1462
1578
|
${this.text?i.html`
|
|
1463
1579
|
<div class="ft-input-label--text ft-typography--caption">
|
|
@@ -1466,123 +1582,154 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1466
1582
|
</div>
|
|
1467
1583
|
`:null}
|
|
1468
1584
|
</div>
|
|
1469
|
-
`}}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
display: flex;
|
|
1474
|
-
background-color: ${Ii.colorSurface};
|
|
1475
|
-
border-radius: ${Ii.borderRadiusS} ${Ii.borderRadiusS} 0 0;
|
|
1476
|
-
}
|
|
1585
|
+
`}}Wi.elementDefinitions={},Wi.styles=[qt,Ki],qi([o.property({type:String})],Wi.prototype,"text",void 0),qi([o.property({type:Boolean})],Wi.prototype,"raised",void 0),qi([o.property({type:Boolean})],Wi.prototype,"outlined",void 0),qi([o.property({type:Boolean})],Wi.prototype,"disabled",void 0),qi([o.property({type:Boolean})],Wi.prototype,"error",void 0),e.customElement("ft-input-label")(Wi);const Gi={labelSize:e.FtCssVariableFactory.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:e.FtCssVariableFactory.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-select-vertical-spacing","SIZE","4px"),optionsHeight:e.FtCssVariableFactory.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:e.FtCssVariableFactory.extend("--ft-select-selected-option-color",e.designSystemVariables.colorOnSurface),helperColor:e.FtCssVariableFactory.extend("--ft-select-helper-color",e.designSystemVariables.colorOnSurfaceMedium),optionsColor:e.FtCssVariableFactory.extend("--ft-select-options-color",e.designSystemVariables.colorOnSurface),optionsZIndex:e.FtCssVariableFactory.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},Xi=i.css`
|
|
1586
|
+
*:focus {
|
|
1587
|
+
outline: none;
|
|
1588
|
+
}
|
|
1477
1589
|
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1590
|
+
.ft-select {
|
|
1591
|
+
display: flex;
|
|
1592
|
+
flex-direction: column;
|
|
1593
|
+
align-items: stretch;
|
|
1594
|
+
}
|
|
1481
1595
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1596
|
+
.ft-select--main-panel {
|
|
1597
|
+
position: relative;
|
|
1598
|
+
display: flex;
|
|
1599
|
+
height: calc(4 * ${Gi.verticalSpacing} + ${Gi.labelSize} + ${Gi.selectedOptionSize});
|
|
1600
|
+
}
|
|
1485
1601
|
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1602
|
+
.ft-select--input-panel {
|
|
1603
|
+
flex-grow: 1;
|
|
1604
|
+
position: relative;
|
|
1605
|
+
display: flex;
|
|
1606
|
+
align-items: center;
|
|
1607
|
+
overflow: hidden;
|
|
1608
|
+
padding-left: 16px;
|
|
1609
|
+
padding-right: 8px;
|
|
1610
|
+
gap: 8px;
|
|
1611
|
+
color: ${Gi.selectedOptionColor};
|
|
1612
|
+
${e.setVariable(re.color,Gi.selectedOptionColor)};
|
|
1613
|
+
}
|
|
1489
1614
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
border-bottom-style: solid;
|
|
1496
|
-
border-color: inherit;
|
|
1497
|
-
}
|
|
1615
|
+
.ft-select--input-panel,
|
|
1616
|
+
.ft-select--option {
|
|
1617
|
+
${e.setVariable(re.opacityContentOnSurfaceHover,"0.08")};
|
|
1618
|
+
${e.setVariable(re.opacityContentOnSurfacePressed,"0.04")};
|
|
1619
|
+
}
|
|
1498
1620
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1621
|
+
.ft-select--input-panel > *:not(ft-ripple),
|
|
1622
|
+
.ft-select--option > *:not(ft-ripple) {
|
|
1623
|
+
position: relative;
|
|
1624
|
+
}
|
|
1503
1625
|
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1626
|
+
.ft-select--disabled .ft-select--input-panel,
|
|
1627
|
+
.ft-select--disabled .ft-select--option {
|
|
1628
|
+
color: ${Gi.colorOnSurfaceDisabled};
|
|
1629
|
+
}
|
|
1508
1630
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
border-bottom-width: 1px;
|
|
1514
|
-
border-bottom-style: solid;
|
|
1515
|
-
border-color: inherit;
|
|
1516
|
-
color: ${Ii.textColor};
|
|
1517
|
-
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1518
|
-
${e.setVariable(Bt.fontSize,Ii.fontSize)};
|
|
1519
|
-
${e.setVariable(Bt.lineHeight,Ii.fontSize)};
|
|
1520
|
-
}
|
|
1631
|
+
.ft-select:not(.ft-select--disabled) .ft-select--input-panel,
|
|
1632
|
+
.ft-select:not(.ft-select--disabled) .ft-select--option {
|
|
1633
|
+
cursor: pointer;
|
|
1634
|
+
}
|
|
1521
1635
|
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1636
|
+
ft-input-label {
|
|
1637
|
+
${e.setVariable(Vi.fontSize,Gi.selectedOptionSize)};
|
|
1638
|
+
${e.setVariable(Vi.raisedFontSize,Gi.labelSize)};
|
|
1639
|
+
${e.setVariable(Vi.verticalSpacing,Gi.verticalSpacing)};
|
|
1640
|
+
}
|
|
1525
1641
|
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1642
|
+
.ft-select:not(.ft-select--disabled):focus-within ft-icon {
|
|
1643
|
+
color: ${Gi.colorPrimary};
|
|
1644
|
+
}
|
|
1529
1645
|
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1646
|
+
.ft-select:not(.ft-select--disabled):focus-within ft-input-label {
|
|
1647
|
+
${e.setVariable(Vi.borderColor,Gi.colorPrimary)};
|
|
1648
|
+
${e.setVariable(Vi.textColor,Gi.colorPrimary)};
|
|
1649
|
+
}
|
|
1534
1650
|
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1651
|
+
.ft-select--selected-option {
|
|
1652
|
+
display: block;
|
|
1653
|
+
flex-grow: 1;
|
|
1654
|
+
flex-shrink: 1;
|
|
1655
|
+
overflow: hidden;
|
|
1656
|
+
white-space: nowrap;
|
|
1657
|
+
text-overflow: ellipsis;
|
|
1658
|
+
${e.setVariable(zt.fontSize,Gi.selectedOptionSize)};
|
|
1659
|
+
${e.setVariable(zt.lineHeight,Gi.selectedOptionSize)};
|
|
1660
|
+
}
|
|
1545
1661
|
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
}
|
|
1662
|
+
.ft-select--in-error .ft-select--selected-option {
|
|
1663
|
+
color: ${Gi.colorError};
|
|
1664
|
+
}
|
|
1550
1665
|
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1666
|
+
ft-icon {
|
|
1667
|
+
flex-shrink: 0;
|
|
1668
|
+
}
|
|
1554
1669
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
border-top-width: 1px;
|
|
1559
|
-
border-top-style: solid;
|
|
1560
|
-
}
|
|
1670
|
+
slot {
|
|
1671
|
+
display: none;
|
|
1672
|
+
}
|
|
1561
1673
|
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
border-radius: ${Ii.borderRadiusS} 0 0 ${Ii.borderRadiusS};
|
|
1566
|
-
}
|
|
1674
|
+
.ft-select--filled .ft-select--input-panel {
|
|
1675
|
+
border-radius: ${Gi.borderRadiusS} ${Gi.borderRadiusS} 0 0;
|
|
1676
|
+
}
|
|
1567
1677
|
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
}
|
|
1678
|
+
.ft-select--filled:not(.ft-select--no-label) .ft-select--selected-option {
|
|
1679
|
+
align-self: stretch;
|
|
1680
|
+
padding-top: calc(${Gi.labelSize} + 2 * ${Gi.verticalSpacing});
|
|
1681
|
+
}
|
|
1573
1682
|
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
background-color: ${Ii.colorSurface};
|
|
1578
|
-
border-radius: ${Ii.borderRadiusS};
|
|
1579
|
-
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
1580
|
-
}
|
|
1683
|
+
.ft-select--outlined .ft-select--input-panel {
|
|
1684
|
+
border-radius: ${Gi.borderRadiusS};
|
|
1685
|
+
}
|
|
1581
1686
|
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1687
|
+
.ft-select--options {
|
|
1688
|
+
display: none;
|
|
1689
|
+
position: absolute;
|
|
1690
|
+
top: 100%;
|
|
1691
|
+
left: 0;
|
|
1692
|
+
right: 0;
|
|
1693
|
+
color: ${Gi.optionsColor};
|
|
1694
|
+
background: ${Gi.colorSurface};
|
|
1695
|
+
z-index: ${Gi.optionsZIndex};
|
|
1696
|
+
box-shadow: ${Gi.elevation02};
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
.ft-select--fixed .ft-select--options {
|
|
1700
|
+
position: fixed;
|
|
1701
|
+
right: unset;
|
|
1702
|
+
/* left and top are set dynamically */
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
.ft-select--options-displayed .ft-select--options {
|
|
1706
|
+
display: block;
|
|
1707
|
+
max-height: ${Gi.optionsHeight};
|
|
1708
|
+
overflow-y: auto;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
.ft-select--option {
|
|
1712
|
+
position: relative;
|
|
1713
|
+
padding: 4px 16px;
|
|
1714
|
+
min-height: 32px;
|
|
1715
|
+
display: flex;
|
|
1716
|
+
align-items: center;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
.ft-select--option span {
|
|
1720
|
+
text-overflow: ellipsis;
|
|
1721
|
+
overflow: hidden;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
.ft-select--helper-text {
|
|
1725
|
+
padding: 0 12px 0 16px;
|
|
1726
|
+
color: ${Gi.helperColor};
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
.ft-select--in-error .ft-select--helper-text {
|
|
1730
|
+
color: ${Gi.colorError};
|
|
1731
|
+
}
|
|
1732
|
+
`;var Yi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Ji extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}render(){return i.html``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Ji.elementDefinitions={},Yi([o.property({type:String})],Ji.prototype,"label",void 0),Yi([o.property({type:Object,converter:t=>t})],Ji.prototype,"value",void 0),Yi([o.property({type:Boolean,reflect:!0})],Ji.prototype,"selected",void 0);class Qi extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.options=[],this.optionsDisplayed=!1,this.focusOptions=!1,this.hideOptions=t=>this.optionsDisplayed=this.optionsDisplayed&&t.composedPath().includes(this.container)}render(){var t,e,o,n,l;let a=this.hasOptionsMenuOpen,c=this.disabled||!this.hasOptions;const h=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(o=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==o?o:"").length>0,p={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":c,"ft-select--options-displayed":a,"ft-select--has-option-selected":h,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return i.html`
|
|
1586
1733
|
<div class="${r.classMap(p)}" part="container">
|
|
1587
1734
|
<div class="ft-select--main-panel" part="main-panel">
|
|
1588
1735
|
<ft-input-label text="${this.label}"
|
|
@@ -1630,182 +1777,34 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1630
1777
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
1631
1778
|
<span>${t.label}</span>
|
|
1632
1779
|
</div>
|
|
1633
|
-
`}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.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,r;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
align-items: center;
|
|
1655
|
-
overflow: hidden;
|
|
1656
|
-
padding-left: 16px;
|
|
1657
|
-
padding-right: 8px;
|
|
1658
|
-
gap: 8px;
|
|
1659
|
-
color: ${ji.selectedOptionColor};
|
|
1660
|
-
${e.setVariable(se.color,ji.selectedOptionColor)};
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
.ft-select--input-panel,
|
|
1664
|
-
.ft-select--option {
|
|
1665
|
-
${e.setVariable(se.opacityContentOnSurfaceHover,"0.08")};
|
|
1666
|
-
${e.setVariable(se.opacityContentOnSurfacePressed,"0.04")};
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
.ft-select--input-panel > *:not(ft-ripple),
|
|
1670
|
-
.ft-select--option > *:not(ft-ripple) {
|
|
1671
|
-
position: relative;
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
.ft-select--disabled .ft-select--input-panel,
|
|
1675
|
-
.ft-select--disabled .ft-select--option {
|
|
1676
|
-
color: ${ji.colorOnSurfaceDisabled};
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
.ft-select:not(.ft-select--disabled) .ft-select--input-panel,
|
|
1680
|
-
.ft-select:not(.ft-select--disabled) .ft-select--option {
|
|
1681
|
-
cursor: pointer;
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
ft-input-label {
|
|
1685
|
-
${e.setVariable(Ii.fontSize,ji.selectedOptionSize)};
|
|
1686
|
-
${e.setVariable(Ii.raisedFontSize,ji.labelSize)};
|
|
1687
|
-
${e.setVariable(Ii.verticalSpacing,ji.verticalSpacing)};
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
.ft-select:not(.ft-select--disabled):focus-within ft-icon {
|
|
1691
|
-
color: ${ji.colorPrimary};
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
.ft-select:not(.ft-select--disabled):focus-within ft-input-label {
|
|
1695
|
-
${e.setVariable(Ii.borderColor,ji.colorPrimary)};
|
|
1696
|
-
${e.setVariable(Ii.textColor,ji.colorPrimary)};
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
.ft-select--selected-option {
|
|
1700
|
-
display: block;
|
|
1701
|
-
flex-grow: 1;
|
|
1702
|
-
flex-shrink: 1;
|
|
1703
|
-
overflow: hidden;
|
|
1704
|
-
white-space: nowrap;
|
|
1705
|
-
text-overflow: ellipsis;
|
|
1706
|
-
${e.setVariable(zt.fontSize,ji.selectedOptionSize)};
|
|
1707
|
-
${e.setVariable(zt.lineHeight,ji.selectedOptionSize)};
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
.ft-select--in-error .ft-select--selected-option {
|
|
1711
|
-
color: ${ji.colorError};
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
ft-icon {
|
|
1715
|
-
flex-shrink: 0;
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
slot {
|
|
1719
|
-
display: none;
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
.ft-select--filled .ft-select--input-panel {
|
|
1723
|
-
border-radius: ${ji.borderRadiusS} ${ji.borderRadiusS} 0 0;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
.ft-select--filled:not(.ft-select--no-label) .ft-select--selected-option {
|
|
1727
|
-
align-self: stretch;
|
|
1728
|
-
padding-top: calc(${ji.labelSize} + 2 * ${ji.verticalSpacing});
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
.ft-select--outlined .ft-select--input-panel {
|
|
1732
|
-
border-radius: ${ji.borderRadiusS};
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
.ft-select--options {
|
|
1736
|
-
display: none;
|
|
1737
|
-
position: absolute;
|
|
1738
|
-
top: 100%;
|
|
1739
|
-
left: 0;
|
|
1740
|
-
right: 0;
|
|
1741
|
-
color: ${ji.optionsColor};
|
|
1742
|
-
background: ${ji.colorSurface};
|
|
1743
|
-
z-index: ${ji.optionsZIndex};
|
|
1744
|
-
box-shadow: ${ji.elevation02};
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
.ft-select--fixed .ft-select--options {
|
|
1748
|
-
position: fixed;
|
|
1749
|
-
right: unset;
|
|
1750
|
-
/* left and top are set dynamically */
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
.ft-select--options-displayed .ft-select--options {
|
|
1754
|
-
display: block;
|
|
1755
|
-
max-height: ${ji.optionsHeight};
|
|
1756
|
-
overflow-y: auto;
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
.ft-select--option {
|
|
1760
|
-
position: relative;
|
|
1761
|
-
padding: 4px 16px;
|
|
1762
|
-
min-height: 32px;
|
|
1763
|
-
display: flex;
|
|
1764
|
-
align-items: center;
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
.ft-select--option span {
|
|
1768
|
-
text-overflow: ellipsis;
|
|
1769
|
-
overflow: hidden;
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
.ft-select--helper-text {
|
|
1773
|
-
padding: 0 12px 0 16px;
|
|
1774
|
-
color: ${ji.helperColor};
|
|
1775
|
-
}
|
|
1780
|
+
`}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.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,r;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Qi.elementDefinitions={"ft-input-label":Wi,"ft-typography":Qt,"ft-ripple":ue,"ft-icon":Ie},Qi.styles=[Kt,qt,Xi],Yi([o.property({type:String})],Qi.prototype,"label",void 0),Yi([o.property({type:String})],Qi.prototype,"helper",void 0),Yi([o.property({type:Boolean})],Qi.prototype,"outlined",void 0),Yi([o.property({type:Boolean})],Qi.prototype,"disabled",void 0),Yi([o.property({type:Boolean})],Qi.prototype,"error",void 0),Yi([o.property({type:Boolean})],Qi.prototype,"fixedMenuPosition",void 0),Yi([o.property({type:Array})],Qi.prototype,"options",void 0),Yi([o.state()],Qi.prototype,"selectedOption",void 0),Yi([o.state()],Qi.prototype,"optionsDisplayed",void 0),Yi([o.state()],Qi.prototype,"focusOptions",void 0),Yi([o.query(".ft-select")],Qi.prototype,"container",void 0),Yi([o.query(".ft-select--options")],Qi.prototype,"optionsMenu",void 0),Yi([o.query(".ft-select--input-panel")],Qi.prototype,"mainPanel",void 0),Yi([o.query(".ft-select--option:first-child")],Qi.prototype,"firstOption",void 0),Yi([o.query(".ft-select--option:focus")],Qi.prototype,"focusedOption",void 0),Yi([o.query(".ft-select--option.ft-select--option-selected")],Qi.prototype,"selectedOptionElement",void 0),Yi([o.query(".ft-select--option:last-child")],Qi.prototype,"lastOption",void 0),Yi([o.query("slot")],Qi.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Qi),e.customElement("ft-select-option")(Ji);const to={display:e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),width:e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),height:e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system")},eo=i.css`
|
|
1781
|
+
:host {
|
|
1782
|
+
width: ${to.width};
|
|
1783
|
+
height: ${to.height};
|
|
1784
|
+
display: ${to.display};
|
|
1785
|
+
overflow: hidden;
|
|
1786
|
+
border-radius: ${to.borderRadiusM};
|
|
1787
|
+
background: linear-gradient(
|
|
1788
|
+
90deg,
|
|
1789
|
+
transparent,
|
|
1790
|
+
${to.glareColor} calc(0.45 * ${to.glareWidth}),
|
|
1791
|
+
${to.glareColor} calc(0.55 * ${to.glareWidth}),
|
|
1792
|
+
transparent ${to.glareWidth}
|
|
1793
|
+
), ${to.backgroundColor};
|
|
1794
|
+
background-repeat: repeat-y;
|
|
1795
|
+
background-size: 100vw 100vh;
|
|
1796
|
+
background-attachment: fixed;
|
|
1797
|
+
background-position: calc(${to.glareWidth} * -1) 0;
|
|
1798
|
+
animation: shine ${to.animationDuration} infinite;
|
|
1799
|
+
animation-timing-function: linear;
|
|
1800
|
+
}
|
|
1776
1801
|
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
}
|
|
1780
|
-
`],Fi([o.property({type:String})],Mi.prototype,"label",void 0),Fi([o.property({type:String})],Mi.prototype,"helper",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"outlined",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"disabled",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"error",void 0),Fi([o.property({type:Boolean})],Mi.prototype,"fixedMenuPosition",void 0),Fi([o.property({type:Array})],Mi.prototype,"options",void 0),Fi([o.state()],Mi.prototype,"selectedOption",void 0),Fi([o.state()],Mi.prototype,"optionsDisplayed",void 0),Fi([o.state()],Mi.prototype,"focusOptions",void 0),Fi([o.query(".ft-select")],Mi.prototype,"container",void 0),Fi([o.query(".ft-select--options")],Mi.prototype,"optionsMenu",void 0),Fi([o.query(".ft-select--input-panel")],Mi.prototype,"mainPanel",void 0),Fi([o.query(".ft-select--option:first-child")],Mi.prototype,"firstOption",void 0),Fi([o.query(".ft-select--option:focus")],Mi.prototype,"focusedOption",void 0),Fi([o.query(".ft-select--option.ft-select--option-selected")],Mi.prototype,"selectedOptionElement",void 0),Fi([o.query(".ft-select--option:last-child")],Mi.prototype,"lastOption",void 0),Fi([o.query("slot")],Mi.prototype,"optionsSlot",void 0),e.customElement("ft-select")(Mi),e.customElement("ft-select-option")(Li);const Pi={display:e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),width:e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),height:e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system")};class Ai extends e.FtLitElement{render(){return i.html`
|
|
1781
|
-
`}}Ai.elementDefinitions={},Ai.styles=i.css`
|
|
1782
|
-
:host {
|
|
1783
|
-
width: ${Pi.width};
|
|
1784
|
-
height: ${Pi.height};
|
|
1785
|
-
display: ${Pi.display};
|
|
1786
|
-
overflow: hidden;
|
|
1787
|
-
border-radius: ${Pi.borderRadiusM};
|
|
1788
|
-
background: linear-gradient(
|
|
1789
|
-
90deg,
|
|
1790
|
-
transparent,
|
|
1791
|
-
${Pi.glareColor} calc(0.45 * ${Pi.glareWidth}),
|
|
1792
|
-
${Pi.glareColor} calc(0.55 * ${Pi.glareWidth}),
|
|
1793
|
-
transparent ${Pi.glareWidth}
|
|
1794
|
-
), ${Pi.backgroundColor};
|
|
1795
|
-
background-repeat: repeat-y;
|
|
1796
|
-
background-size: 100vw 100vh;
|
|
1797
|
-
background-attachment: fixed;
|
|
1798
|
-
background-position: calc(${Pi.glareWidth} * -1) 0;
|
|
1799
|
-
animation: shine ${Pi.animationDuration} infinite;
|
|
1800
|
-
animation-timing-function: linear;
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
|
-
@keyframes shine {
|
|
1804
|
-
to {
|
|
1805
|
-
background-position: calc(100vw + ${Pi.glareWidth}) 0, calc(${Pi.glareWidth} * -1) 0;
|
|
1806
|
-
}
|
|
1802
|
+
@keyframes shine {
|
|
1803
|
+
to {
|
|
1804
|
+
background-position: calc(100vw + ${to.glareWidth}) 0, calc(${to.glareWidth} * -1) 0;
|
|
1807
1805
|
}
|
|
1808
|
-
|
|
1806
|
+
}
|
|
1807
|
+
`,io={height:e.FtCssVariableFactory.create("--ft-search-bar-height","SIZE","38px"),borderRadius:e.FtCssVariableFactory.extend("--ft-search-bar-border-radius",e.designSystemVariables.borderRadiusS),mobileOpenPosition:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-position","POSITION","fixed"),mobileOpenTop:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-top","SIZE","0"),mobileOpenBottom:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-bottom","SIZE","0"),mobileOpenLeft:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-left","SIZE","0"),mobileOpenRight:e.FtCssVariableFactory.create("--ft-search-bar-mobile-open-right","SIZE","0"),desktopFiltersHeight:e.FtCssVariableFactory.create("--ft-search-bar-desktop-filters-height","SIZE","350px"),floatingZIndex:e.FtCssVariableFactory.create("--ft-search-bar-floating-components-z-index","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),buttonColor:e.FtCssVariableFactory.external(Fe.color,"Button"),buttonRippleColor:e.FtCssVariableFactory.external(Fe.rippleColor,"Button")},oo=i.css`
|
|
1809
1808
|
* {
|
|
1810
1809
|
box-sizing: border-box;
|
|
1811
1810
|
}
|
|
@@ -1814,7 +1813,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1814
1813
|
display: flex;
|
|
1815
1814
|
flex-direction: column;
|
|
1816
1815
|
gap: 8px;
|
|
1817
|
-
color: ${
|
|
1816
|
+
color: ${io.colorOnSurface};
|
|
1818
1817
|
outline: none;
|
|
1819
1818
|
}
|
|
1820
1819
|
|
|
@@ -1823,21 +1822,21 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1823
1822
|
}
|
|
1824
1823
|
|
|
1825
1824
|
.ft-search-bar--mobile-menu-open {
|
|
1826
|
-
position: ${
|
|
1827
|
-
top: ${
|
|
1828
|
-
bottom: ${
|
|
1829
|
-
left: ${
|
|
1830
|
-
right: ${
|
|
1831
|
-
z-index: ${
|
|
1825
|
+
position: ${io.mobileOpenPosition};
|
|
1826
|
+
top: ${io.mobileOpenTop};
|
|
1827
|
+
bottom: ${io.mobileOpenBottom};
|
|
1828
|
+
left: ${io.mobileOpenLeft};
|
|
1829
|
+
right: ${io.mobileOpenRight};
|
|
1830
|
+
z-index: ${io.floatingZIndex};
|
|
1832
1831
|
padding: 16px;
|
|
1833
1832
|
}
|
|
1834
1833
|
|
|
1835
1834
|
.ft-search-bar--mobile-menu-open:not(.ft-search-bar--forced-open) {
|
|
1836
|
-
background: ${
|
|
1835
|
+
background: ${io.colorSurface};
|
|
1837
1836
|
}
|
|
1838
1837
|
|
|
1839
1838
|
.ft-search-bar--mobile-menu-open.ft-search-bar--forced-open {
|
|
1840
|
-
position: ${
|
|
1839
|
+
position: ${io.mobileOpenPosition.get("static")};
|
|
1841
1840
|
}
|
|
1842
1841
|
|
|
1843
1842
|
.ft-search-bar {
|
|
@@ -1845,20 +1844,20 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1845
1844
|
display: flex;
|
|
1846
1845
|
flex-direction: row;
|
|
1847
1846
|
align-items: center;
|
|
1848
|
-
height: ${
|
|
1847
|
+
height: ${io.height};
|
|
1849
1848
|
|
|
1850
|
-
background: ${
|
|
1851
|
-
border: 1px solid ${
|
|
1852
|
-
border-radius: ${
|
|
1849
|
+
background: ${io.colorSurface};
|
|
1850
|
+
border: 1px solid ${io.colorOutline};
|
|
1851
|
+
border-radius: ${io.borderRadius};
|
|
1853
1852
|
}
|
|
1854
1853
|
|
|
1855
1854
|
.ft-search-bar--skeleton {
|
|
1856
|
-
${e.setVariable(
|
|
1857
|
-
${e.setVariable(
|
|
1855
|
+
${e.setVariable(to.height,io.height)};
|
|
1856
|
+
${e.setVariable(to.borderRadiusM,io.borderRadius)};
|
|
1858
1857
|
}
|
|
1859
1858
|
|
|
1860
1859
|
.ft-search-bar--floating-panel-open .ft-search-bar {
|
|
1861
|
-
border-radius: ${
|
|
1860
|
+
border-radius: ${io.borderRadius} ${io.borderRadius} 0 0;
|
|
1862
1861
|
}
|
|
1863
1862
|
|
|
1864
1863
|
.ft-search-bar--input-container {
|
|
@@ -1876,7 +1875,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1876
1875
|
align-self: stretch;
|
|
1877
1876
|
display: grid;
|
|
1878
1877
|
padding: 0 8px;
|
|
1879
|
-
border-radius: ${
|
|
1878
|
+
border-radius: ${io.borderRadius};
|
|
1880
1879
|
}
|
|
1881
1880
|
|
|
1882
1881
|
.ft-search-bar--dense .ft-search-bar--input-outline {
|
|
@@ -1885,7 +1884,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1885
1884
|
}
|
|
1886
1885
|
|
|
1887
1886
|
.ft-search-bar--input-container:focus-within .ft-search-bar--input-outline {
|
|
1888
|
-
outline: 2px solid ${
|
|
1887
|
+
outline: 2px solid ${io.colorPrimary};
|
|
1889
1888
|
}
|
|
1890
1889
|
|
|
1891
1890
|
.ft-search-bar--input {
|
|
@@ -1893,12 +1892,12 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1893
1892
|
flex-grow: 1;
|
|
1894
1893
|
border: none;
|
|
1895
1894
|
background-color: transparent;
|
|
1896
|
-
color: ${
|
|
1895
|
+
color: ${io.colorOnSurface};
|
|
1897
1896
|
outline: none;
|
|
1898
1897
|
}
|
|
1899
1898
|
|
|
1900
1899
|
.ft-search-bar--input::placeholder {
|
|
1901
|
-
color: ${
|
|
1900
|
+
color: ${io.colorOnSurfaceMedium};
|
|
1902
1901
|
}
|
|
1903
1902
|
|
|
1904
1903
|
.ft-search-bar--actions {
|
|
@@ -1908,7 +1907,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1908
1907
|
align-items: center;
|
|
1909
1908
|
height: 100%;
|
|
1910
1909
|
|
|
1911
|
-
${e.setVariable(
|
|
1910
|
+
${e.setVariable(be.zIndex,`calc(${io.floatingZIndex} + 1)`)};
|
|
1912
1911
|
}
|
|
1913
1912
|
|
|
1914
1913
|
.ft-search-bar > ft-button,
|
|
@@ -1917,8 +1916,8 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1917
1916
|
}
|
|
1918
1917
|
|
|
1919
1918
|
.ft-search-bar--left-action {
|
|
1920
|
-
${e.setVariable(
|
|
1921
|
-
border-right: 1px solid ${
|
|
1919
|
+
${e.setVariable(Fe.borderRadius,i.css`calc(${io.borderRadius} - 1px) 0 0 calc(${io.borderRadius} - 1px)`)};
|
|
1920
|
+
border-right: 1px solid ${io.colorOutline};
|
|
1922
1921
|
height: 100%;
|
|
1923
1922
|
}
|
|
1924
1923
|
|
|
@@ -1927,7 +1926,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1927
1926
|
}
|
|
1928
1927
|
|
|
1929
1928
|
.ft-search-bar--floating-panel-open .ft-search-bar--left-action {
|
|
1930
|
-
${e.setVariable(
|
|
1929
|
+
${e.setVariable(Fe.borderRadius,i.css`calc(${io.borderRadius} - 1px) 0 0 0`)};
|
|
1931
1930
|
}
|
|
1932
1931
|
|
|
1933
1932
|
.ft-search-bar .ft-search-bar--launch-search,
|
|
@@ -1937,13 +1936,13 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1937
1936
|
|
|
1938
1937
|
.ft-search-bar--separator {
|
|
1939
1938
|
height: 20px;
|
|
1940
|
-
border-right: 1px solid ${
|
|
1939
|
+
border-right: 1px solid ${io.colorOutline};
|
|
1941
1940
|
}
|
|
1942
1941
|
|
|
1943
1942
|
.ft-search-bar--left-action.ft-search-bar--content-locale {
|
|
1944
|
-
${e.setVariable(
|
|
1945
|
-
${e.setVariable(
|
|
1946
|
-
${e.setVariable(
|
|
1943
|
+
${e.setVariable(Vi.borderColor,"transparent")};
|
|
1944
|
+
${e.setVariable(Vi.borderRadiusS,i.css`calc(${io.borderRadius} - 1px)`)};
|
|
1945
|
+
${e.setVariable(Gi.selectedOptionColor,io.buttonColor)};
|
|
1947
1946
|
}
|
|
1948
1947
|
|
|
1949
1948
|
.ft-search-bar--left-action.ft-search-bar--content-locale,
|
|
@@ -1960,17 +1959,17 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
1960
1959
|
}
|
|
1961
1960
|
|
|
1962
1961
|
.ft-search-bar--left-action.ft-search-bar--content-locale::part(selected-value) {
|
|
1963
|
-
border-radius: calc(${
|
|
1962
|
+
border-radius: calc(${io.borderRadius} - 1px) 0 0 calc(${io.borderRadius} - 1px);
|
|
1964
1963
|
}
|
|
1965
1964
|
|
|
1966
|
-
`,
|
|
1965
|
+
`,so=i.css`
|
|
1967
1966
|
.ft-search-bar--desktop-menu .ft-search-bar--presets {
|
|
1968
1967
|
margin-right: auto;
|
|
1969
1968
|
}
|
|
1970
1969
|
|
|
1971
1970
|
.ft-search-bar--desktop-menu .ft-search-bar--presets {
|
|
1972
1971
|
min-width: 250px;
|
|
1973
|
-
${e.setVariable(
|
|
1972
|
+
${e.setVariable(Gi.optionsZIndex,"2")};
|
|
1974
1973
|
}
|
|
1975
1974
|
|
|
1976
1975
|
.ft-search-bar--desktop-menu {
|
|
@@ -2022,7 +2021,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2022
2021
|
|
|
2023
2022
|
.ft-search-bar--desktop-menu .ft-search-bar--filters-container {
|
|
2024
2023
|
display: block;
|
|
2025
|
-
height: ${
|
|
2024
|
+
height: ${io.desktopFiltersHeight};
|
|
2026
2025
|
--ft-snap-scroll-gap: 16px;
|
|
2027
2026
|
}
|
|
2028
2027
|
|
|
@@ -2073,7 +2072,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2073
2072
|
|
|
2074
2073
|
.ft-search-bar--filter-label > :last-child {
|
|
2075
2074
|
flex-shrink: 1;
|
|
2076
|
-
color: ${
|
|
2075
|
+
color: ${io.colorOnSurfaceMedium};
|
|
2077
2076
|
}
|
|
2078
2077
|
|
|
2079
2078
|
ft-accordion-item::part(toggle) {
|
|
@@ -2093,7 +2092,8 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2093
2092
|
.ft-search-bar--desktop-menu .ft-search-bar--launch-search {
|
|
2094
2093
|
margin: 0;
|
|
2095
2094
|
}
|
|
2096
|
-
`;class
|
|
2095
|
+
`;class ro extends e.FtLitElement{render(){return i.html`
|
|
2096
|
+
`}}ro.elementDefinitions={},ro.styles=eo,e.customElement("ft-skeleton")(ro);class no{constructor(t,i=300){this.searchBar=t,this.updateDebouncer=new e.Debouncer(i)}render(){const t=this.searchBar.recentSearches.filter((t=>t.toLowerCase().includes(this.searchBar.query.toLowerCase()))),e=this.searchBar.suggestions.length>0||t.length>0;return i.html`
|
|
2097
2097
|
<div class="ft-search-bar--suggestions ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2098
2098
|
part="suggestions-container"
|
|
2099
2099
|
@keydown=${t=>this.onSuggestKeyDown(t)}>
|
|
@@ -2127,11 +2127,11 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2127
2127
|
</a>
|
|
2128
2128
|
`))}
|
|
2129
2129
|
</div>
|
|
2130
|
-
`}update(){return new Promise(((t,e)=>{this.updateDebouncer.run((async()=>{this.searchBar.suggestions=this.searchBar.api&&this.searchBar.query.length>2?await this.searchBar.api.getSuggestions(this.searchBar.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],t()}))}))}onSuggestKeyDown(t){var e,i,o,s,r,n;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.getFocusedSuggestionElement())||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.getLastSuggestionElement())||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(n=null!==(r=null===(s=this.getFocusedSuggestionElement())||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.getFirstSuggestionElement())||void 0===n||n.focus(),t.preventDefault(),t.stopPropagation()}}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.searchBar.setQuery(e),this.searchBar.launchSearch()}removeRecentSearch(t,e){var i,o;t.preventDefault(),t.stopPropagation();let s=t.target.closest(".ft-search-bar--suggestion");const r=null!==(o=null!==(i=null==s?void 0:s.previousElementSibling)&&void 0!==i?i:null==s?void 0:s.nextElementSibling)&&void 0!==o?o:this.searchBar.input;null==r||r.focus(),this.searchBar.recentSearches=this.searchBar.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.searchBar.saveRecentSearches()}getIcon(t){const e="DOCUMENT"===t.type
|
|
2130
|
+
`}update(){return new Promise(((t,e)=>{this.updateDebouncer.run((async()=>{this.searchBar.suggestions=this.searchBar.api&&this.searchBar.query.length>2?await this.searchBar.api.getSuggestions(this.searchBar.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],t()}))}))}onSuggestKeyDown(t){var e,i,o,s,r,n;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.getFocusedSuggestionElement())||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.getLastSuggestionElement())||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(n=null!==(r=null===(s=this.getFocusedSuggestionElement())||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.getFirstSuggestionElement())||void 0===n||n.focus(),t.preventDefault(),t.stopPropagation()}}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.searchBar.setQuery(e),this.searchBar.launchSearch()}removeRecentSearch(t,e){var i,o;t.preventDefault(),t.stopPropagation();let s=t.target.closest(".ft-search-bar--suggestion");const r=null!==(o=null!==(i=null==s?void 0:s.previousElementSibling)&&void 0!==i?i:null==s?void 0:s.nextElementSibling)&&void 0!==o?o:this.searchBar.input;null==r||r.focus(),this.searchBar.recentSearches=this.searchBar.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.searchBar.saveRecentSearches()}getIcon(t){const e="DOCUMENT"===t.type?Ce.file_format:Ce.fluid_topics;let o;switch(t.type){case"MAP":o="BOOK"===t.editorialType?we.BOOK:we.ARTICLE;break;case"DOCUMENT":o=function(t,e){var i,o,s,r;t=(null!=t?t:"").toLowerCase(),e=(null!=e?e:"").toLowerCase();const[n,l]=((null!==(i=ze.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(r=null!==(s=null!==(o=Se.get(l))&&void 0!==o?o:Se.get(e))&&void 0!==s?s:Se.get(n))&&void 0!==r?r:ke.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":o=we.TOPICS}return i.html`
|
|
2131
2131
|
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2132
2132
|
${o}
|
|
2133
2133
|
</ft-icon>
|
|
2134
|
-
`}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()}}
|
|
2134
|
+
`}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()}}no.styles=i.css`
|
|
2135
2135
|
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2136
2136
|
flex-grow: 1;
|
|
2137
2137
|
flex-shrink: 1;
|
|
@@ -2140,7 +2140,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2140
2140
|
}
|
|
2141
2141
|
|
|
2142
2142
|
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2143
|
-
border-top: 1px solid ${
|
|
2143
|
+
border-top: 1px solid ${io.colorOutline};
|
|
2144
2144
|
}
|
|
2145
2145
|
|
|
2146
2146
|
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
@@ -2150,15 +2150,15 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2150
2150
|
.ft-search-bar--floating-panel,
|
|
2151
2151
|
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2152
2152
|
position: absolute;
|
|
2153
|
-
z-index: ${
|
|
2153
|
+
z-index: ${io.floatingZIndex};
|
|
2154
2154
|
top: 100%;
|
|
2155
2155
|
left: -1px;
|
|
2156
2156
|
right: -1px;
|
|
2157
2157
|
display: none;
|
|
2158
|
-
background: ${
|
|
2159
|
-
border: 1px solid ${
|
|
2160
|
-
border-radius: 0 0 ${
|
|
2161
|
-
box-shadow: ${
|
|
2158
|
+
background: ${io.colorSurface};
|
|
2159
|
+
border: 1px solid ${io.colorOutline};
|
|
2160
|
+
border-radius: 0 0 ${io.borderRadius} ${io.borderRadius};
|
|
2161
|
+
box-shadow: ${io.elevation02};
|
|
2162
2162
|
outline: none;
|
|
2163
2163
|
}
|
|
2164
2164
|
|
|
@@ -2178,7 +2178,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2178
2178
|
padding: 8px;
|
|
2179
2179
|
gap: 8px;
|
|
2180
2180
|
cursor: pointer;
|
|
2181
|
-
color: ${
|
|
2181
|
+
color: ${io.colorOnSurface};
|
|
2182
2182
|
min-height: 52px;
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
@@ -2195,7 +2195,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2195
2195
|
}
|
|
2196
2196
|
|
|
2197
2197
|
.ft-search-bar--recent-search + .ft-search-bar--suggestion:not(.ft-search-bar--recent-search) {
|
|
2198
|
-
border-top: 1px solid ${
|
|
2198
|
+
border-top: 1px solid ${io.colorOutline};
|
|
2199
2199
|
}
|
|
2200
2200
|
|
|
2201
2201
|
.ft-search-bar--suggestion ft-typography {
|
|
@@ -2203,7 +2203,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2203
2203
|
flex-grow: 1;
|
|
2204
2204
|
flex-shrink: 1;
|
|
2205
2205
|
}
|
|
2206
|
-
`;class
|
|
2206
|
+
`;class lo{constructor(t){this.searchBar=t}render(){if(!this.searchBar.hasLocaleSelector()&&!this.searchBar.hasFacets())return i.html``;const t=this.searchBar.isMobile(),e=!t&&this.searchBar.dense||t&&this.searchBar.isMobileMenuOpen(),o=i.html`
|
|
2207
2207
|
${this.searchBar.hasLocaleSelector()&&(this.searchBar.hasFacets()||t)?i.html`
|
|
2208
2208
|
<ft-chip part="selected-filters selected-filter-ft-locale"
|
|
2209
2209
|
?dense=${this.searchBar.dense&&!t}
|
|
@@ -2214,7 +2214,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2214
2214
|
${this.getLocaleLabel(this.searchBar.contentLocale)}
|
|
2215
2215
|
</ft-chip>
|
|
2216
2216
|
`:null}
|
|
2217
|
-
${s.repeat(this.searchBar.facets,(t=>t.key),(o=>{const r=function(t){return
|
|
2217
|
+
${s.repeat(this.searchBar.facets,(t=>t.key),(o=>{const r=function(t){return te(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(o);return s.repeat(r,(s=>{let n=o.label+": "+function(t){return ee(t).split("|").join(" > ")}(s);const l=o.key.replace(":","-"),a=i.html`
|
|
2218
2218
|
<ft-chip
|
|
2219
2219
|
part="selected-filters selected-filter-${l}"
|
|
2220
2220
|
?dense=${this.searchBar.dense&&!t}
|
|
@@ -2227,7 +2227,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2227
2227
|
@icon-click=${()=>this.searchBar.setFilter(o.key,r.filter((t=>t!==s)))}
|
|
2228
2228
|
data-key="${o.key}"
|
|
2229
2229
|
data-value="${s}">
|
|
2230
|
-
${function(t){return
|
|
2230
|
+
${function(t){return ee(t).split("|").pop()}(s)}
|
|
2231
2231
|
</ft-chip>
|
|
2232
2232
|
`;return e?a:i.html`
|
|
2233
2233
|
<ft-tooltip inline text="${n}">
|
|
@@ -2253,7 +2253,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2253
2253
|
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2254
2254
|
${o}
|
|
2255
2255
|
</div>
|
|
2256
|
-
`}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}}
|
|
2256
|
+
`}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}}lo.styles=i.css`
|
|
2257
2257
|
.ft-search-bar--selected-filters:not(ft-snap-scroll) {
|
|
2258
2258
|
flex-shrink: 0;
|
|
2259
2259
|
display: flex;
|
|
@@ -2264,7 +2264,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2264
2264
|
|
|
2265
2265
|
ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2266
2266
|
overflow: hidden;
|
|
2267
|
-
${e.setVariable(
|
|
2267
|
+
${e.setVariable(ai.gap,"4px")};
|
|
2268
2268
|
}
|
|
2269
2269
|
|
|
2270
2270
|
ft-snap-scroll.ft-search-bar--selected-filters::part(content) {
|
|
@@ -2272,8 +2272,8 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2272
2272
|
}
|
|
2273
2273
|
|
|
2274
2274
|
.ft-search-bar--desktop ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2275
|
-
${e.setVariable(
|
|
2276
|
-
${e.setVariable(
|
|
2275
|
+
${e.setVariable(Pi.iconSize,"17px")};
|
|
2276
|
+
${e.setVariable(Pi.fontSize,"12px")};
|
|
2277
2277
|
}
|
|
2278
2278
|
|
|
2279
2279
|
.ft-search-bar--selected-filters * {
|
|
@@ -2283,7 +2283,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2283
2283
|
.ft-search-bar--selected-filters ft-chip {
|
|
2284
2284
|
flex-grow: 0;
|
|
2285
2285
|
}
|
|
2286
|
-
`;class
|
|
2286
|
+
`;class ao{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new lo(t),this.suggestManager=null!=i?i:new no(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--mobile":!0,"ft-search-bar--mobile-menu-open":this.searchBar.isMobileMenuOpen(),"ft-search-bar--forced-open":this.searchBar.forceMobileMenuOpen};return i.html`
|
|
2287
2287
|
<div class="${r.classMap(t)}" part="container" tabindex="-1">
|
|
2288
2288
|
<div class="ft-search-bar">
|
|
2289
2289
|
<div class="ft-search-bar--input-container" part="input-container">
|
|
@@ -2332,9 +2332,9 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2332
2332
|
@click=${()=>{var t;return this.searchBar.isMobileMenuOpen()?this.searchBar.launchSearch():null===(t=this.searchBar.input)||void 0===t?void 0:t.focus()}}
|
|
2333
2333
|
></ft-button>
|
|
2334
2334
|
</div>
|
|
2335
|
-
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}
|
|
2335
|
+
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}ao.styles=i.css`
|
|
2336
2336
|
|
|
2337
|
-
`;class
|
|
2337
|
+
`;class co{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new lo(t),this.suggestManager=null!=i?i:new no(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--dense":this.searchBar.dense,"ft-search-bar--desktop":!0,"ft-search-bar--floating-panel-open":this.searchBar.displayFacets&&!this.searchBar.forceMenuOpen,"ft-search-bar--forced-open":this.searchBar.forceMenuOpen};return i.html`
|
|
2338
2338
|
<div class="${r.classMap(t)}" part="container" tabindex="-1">
|
|
2339
2339
|
<div class="ft-search-bar" part="search-bar">
|
|
2340
2340
|
${this.renderSearchBarLeftAction()}
|
|
@@ -2399,9 +2399,9 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2399
2399
|
@click=${()=>this.searchBar.launchSearch()}
|
|
2400
2400
|
></ft-button>
|
|
2401
2401
|
</div>
|
|
2402
|
-
`}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()}}
|
|
2402
|
+
`}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()}}co.styles=i.css`
|
|
2403
2403
|
|
|
2404
|
-
`;var
|
|
2404
|
+
`;var ho=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};null==window.fluidtopics&&console.warn("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api");const po={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 fo extends CustomEvent{constructor(t){super("launch-search",{detail:t,bubbles:!0,composed:!0})}}class uo extends CustomEvent{constructor(t){super("change",{detail:t})}}const bo=()=>{};class vo extends e.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.mode="auto",this.forceMobileMenuOpen=!1,this.forceMenuOpen=!1,this.baseUrl="",this.apiIntegrationIdentifier="ft-search-bar",this.availableContentLocales=[],this.availableContentLocalesInitialized=!1,this.labels={},this.labelResolver=new e.ParametrizedLabelResolver(po,{}),this.displayedFilters=[],this.presets=[],this.priors=[],this.searchRequestSerializer=t=>function(t,e){var i;const o=new URLSearchParams({"content-lang":null!==(i=e.contentLocale)&&void 0!==i?i:"all",query:e.query});if(e.filters.length>0){const t=e.filters.map((t=>{const e=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${e}`})).join("*");o.append("filters",t)}return new URL(`${t}/search/all?${o.toString()}`).href}(this.baseUrl,t),this.searchFilters=[],this.sizeCategory=l.M,this.displayFacets=!1,this.mobileMenuOpen=!1,this.facets=[],this.facetsInitialized=!1,this.knownFacetLabels=new Map,this.query="",this.suggestions=[],this.recentSearches=[],this.updateFacetsDebouncer=new e.Debouncer(500),this.suggestManager=new no(this),this.selectedFacetsManager=new lo(this),this.desktopSearchBarManager=new co(this),this.mobileSearchBarManager=new ao(this),this.initDataDebouncer=new e.Debouncer(10),this.facetsLoaded=!1,this.closeFloatingContainer=t=>{this.isMobile()||(this.displayFacets=this.displayFacets&&t.composedPath().some((t=>t===this.floatingContainer)))},this.compareFilters=(t,e)=>t.key===e.key&&t.negative==e.negative&&t.values.length===e.values.length&&t.values.every((t=>e.values.includes(t))),this.compareRequests=(t,e)=>(null==t.contentLocale||null==e.contentLocale||t.contentLocale===e.contentLocale)&&t.filters.length===e.filters.length&&t.filters.every((t=>e.filters.some((e=>this.compareFilters(t,e)))))}isMobileMenuOpen(){return this.isMobile()&&(this.forceMobileMenuOpen||this.forceMenuOpen||this.mobileMenuOpen)}get request(){return{uiLocale:this.uiLocale,contentLocale:this.contentLocale,query:this.query,facets:this.facetsRequest,priors:this.hasPriors?this.priors:void 0,filters:this.searchFilters,paging:{perPage:0,page:1},sort:[]}}get facetsRequest(){const t=this.searchFilters.filter((t=>t.values.length>0&&!this.displayedFilters.includes(t.key))).map((t=>({id:t.key})));return[...this.displayedFilters.map((t=>({id:t}))),...t]}get suggestRequest(){return{contentLocale:this.contentLocale,input:this.query,filters:this.searchFilters,sort:[]}}isMobile(){switch(this.mode){case"mobile":return!0;case"desktop":return!1;default:return this.sizeCategory===l.S}}hasFacets(){return this.facetsRequest.length>0}get hasPresets(){return null!=this.presets&&this.presets.length>0}get hasPriors(){return null!=this.priors&&this.priors.length>0}hasLocaleSelector(){return this.availableContentLocales.length>1}focus(){var t;null===(t=this.container)||void 0===t||t.focus()}focusInput(){this.input?this.input.focus():setTimeout((()=>this.focusInput()),50)}clear(){this.query="",this.searchFilters=[],this.input&&(this.input.value=""),this.mobileMenuOpen=!1,this.displayFacets=!1}render(){return i.html`
|
|
2405
2405
|
<ft-size-watcher @change=${this.updateSize}></ft-size-watcher>
|
|
2406
2406
|
${this.renderSearchBar()}
|
|
2407
2407
|
`}renderSearchBar(){return this.facetsInitialized&&this.availableContentLocalesInitialized?this.isMobile()?this.mobileSearchBarManager.render():this.desktopSearchBarManager.render():i.html`
|
|
@@ -2429,12 +2429,12 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2429
2429
|
></ft-filter>
|
|
2430
2430
|
</ft-accordion-item>
|
|
2431
2431
|
`:null}
|
|
2432
|
-
${s.repeat(this.facets,(t=>t.key),(t=>{const e=
|
|
2432
|
+
${s.repeat(this.facets,(t=>t.key),(t=>{const e=oe(t),o=t.key.replace(":","-");return t.rootNodes.length>0?i.html`
|
|
2433
2433
|
<ft-accordion-item data-facet-key="${t.key}">
|
|
2434
2434
|
<div class="ft-search-bar--filter-label" slot="toggle">
|
|
2435
2435
|
<ft-typography variant="button">${t.label}</ft-typography>
|
|
2436
2436
|
<ft-typography variant="body2">
|
|
2437
|
-
${function(t){return
|
|
2437
|
+
${function(t){return te(t.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).filter((t=>t.selected)).map((t=>t.label))}(e).join(", ")}
|
|
2438
2438
|
</ft-typography>
|
|
2439
2439
|
</div>
|
|
2440
2440
|
<ft-filter
|
|
@@ -2510,7 +2510,7 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2510
2510
|
@change=${t=>this.contentLocale=t.detail[0]}
|
|
2511
2511
|
></ft-filter>
|
|
2512
2512
|
`:i.nothing}
|
|
2513
|
-
${s.repeat(this.facets,(t=>t.key),(t=>{const e=
|
|
2513
|
+
${s.repeat(this.facets,(t=>t.key),(t=>{const e=oe(t),o=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})),s=t.key.replace(":","-");return i.html`
|
|
2514
2514
|
<ft-filter
|
|
2515
2515
|
class="${o?"ft-search-bar--hierarchical-filter":""}"
|
|
2516
2516
|
part="filters filter filter-${s}"
|
|
@@ -2529,10 +2529,10 @@ const V=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===V)return null==t?void 0:t
|
|
|
2529
2529
|
></ft-filter>
|
|
2530
2530
|
`}))}
|
|
2531
2531
|
</ft-snap-scroll>
|
|
2532
|
-
`:i.nothing}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var i,o,s,r,n;if(t.has("labels")&&(this.labelResolver=new e.ParametrizedLabelResolver(
|
|
2532
|
+
`:i.nothing}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var i,o,s,r,n;if(t.has("labels")&&(this.labelResolver=new e.ParametrizedLabelResolver(po,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile()),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const e=t=>this.availableContentLocales.some((e=>e.lang===t));e(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&e(t.get("contentLocale"))?t.get("contentLocale"):null===(i=this.availableContentLocales[0])||void 0===i?void 0:i.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(o=this.presets)&&void 0!==o?o:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>ee(t))))))),t.has("selectedPreset")){const t=(null!==(s=this.presets)&&void 0!==s?s:[]).find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}t.has("contentLocale")&&null!=this.contentLocale&&(this.knownFacetLabels=new Map),["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(n=(null!==(r=this.presets)&&void 0!==r?r:[]).find((t=>this.compareRequests(t,this.request))))||void 0===n?void 0:n.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&(this.api=void 0,this.initApi()),t.has("api")&&this.api&&this.initSearchData(),["uiLocale","contentLocale","searchFilters","displayedFilters"].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 uo(this.request))}initSearchData(){this.availableContentLocalesInitialized=!1,this.facetsInitialized=!1,this.initDataDebouncer.run((()=>{var t;null===(t=this.api)||void 0===t||t.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[])).then((t=>{this.availableContentLocales=t,this.availableContentLocalesInitialized=!0})),this.retrieveFacetsFromSearch().then((()=>this.facetsInitialized=!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()),10))}updateFacets(){this.api&&this.facetsInitialized&&(this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{await this.retrieveFacetsFromSearch(),this.facetsLoaded=!0}))):this.facets=[])}async retrieveFacetsFromSearch(){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(bo)),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})}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 fo(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&&te(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=>te(t.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=!1)))),this.searchFilters=[];const t=this.facets[0];this.scrollToFacet=null==t?void 0:t.key}querySelector(t){return this.shadowRoot.querySelector(t)}querySelectorAll(t){return this.shadowRoot.querySelectorAll(t)}renderDesktopFloatingMenu(){return this.forceMenuOpen?i.nothing:i.html`
|
|
2533
2533
|
<div class="ft-search-bar--floating-panel"
|
|
2534
2534
|
@keyup=${this.onFloatingContainerKeyUp}
|
|
2535
2535
|
part="floating-panel"
|
|
2536
2536
|
tabindex="-1">
|
|
2537
2537
|
${this.renderDesktopMenu()}
|
|
2538
|
-
</div>`}}
|
|
2538
|
+
</div>`}}vo.elementDefinitions={"ft-accordion":Ci,"ft-accordion-item":ji,"ft-button":Ne,"ft-chip":Hi,"ft-filter":ki,"ft-filter-option":zi,"ft-icon":Ie,"ft-ripple":ue,"ft-select":Qi,"ft-select-option":Ji,"ft-size-watcher":f,"ft-skeleton":ro,"ft-snap-scroll":fi,"ft-tooltip":xe,"ft-typography":Qt},vo.styles=[Kt,oo,so,lo.styles,no.styles],ho([o.property({type:Boolean})],vo.prototype,"dense",void 0),ho([o.property()],vo.prototype,"mode",void 0),ho([o.property({type:Boolean})],vo.prototype,"forceMobileMenuOpen",void 0),ho([o.property({type:Boolean})],vo.prototype,"forceMenuOpen",void 0),ho([o.property()],vo.prototype,"baseUrl",void 0),ho([o.property()],vo.prototype,"apiIntegrationIdentifier",void 0),ho([o.property()],vo.prototype,"contentLocale",void 0),ho([o.state()],vo.prototype,"availableContentLocales",void 0),ho([o.state()],vo.prototype,"availableContentLocalesInitialized",void 0),ho([o.property()],vo.prototype,"uiLocale",void 0),ho([e.jsonProperty({})],vo.prototype,"labels",void 0),ho([e.jsonProperty([])],vo.prototype,"displayedFilters",void 0),ho([e.jsonProperty([])],vo.prototype,"presets",void 0),ho([o.property({type:String,reflect:!0})],vo.prototype,"selectedPreset",void 0),ho([e.jsonProperty([])],vo.prototype,"priors",void 0),ho([o.property()],vo.prototype,"searchRequestSerializer",void 0),ho([o.state()],vo.prototype,"searchFilters",void 0),ho([o.state()],vo.prototype,"sizeCategory",void 0),ho([o.state()],vo.prototype,"displayFacets",void 0),ho([o.state()],vo.prototype,"mobileMenuOpen",void 0),ho([o.state()],vo.prototype,"facets",void 0),ho([o.state()],vo.prototype,"facetsInitialized",void 0),ho([o.query(".ft-search-bar--container")],vo.prototype,"container",void 0),ho([o.query(".ft-search-bar--filters-opener")],vo.prototype,"filtersOpener",void 0),ho([o.query(".ft-search-bar--floating-panel")],vo.prototype,"floatingContainer",void 0),ho([o.query("ft-snap-scroll.ft-search-bar--filters-container")],vo.prototype,"scrollingFiltersContainer",void 0),ho([o.query(".ft-search-bar--input")],vo.prototype,"input",void 0),ho([o.state()],vo.prototype,"query",void 0),ho([o.state()],vo.prototype,"suggestions",void 0),ho([o.state()],vo.prototype,"recentSearches",void 0),ho([o.state()],vo.prototype,"scrollToFacet",void 0),ho([o.state()],vo.prototype,"api",void 0),e.customElement("ft-search-bar")(vo),t.DEFAULT_LABELS=po,t.FtSearchBar=vo,t.FtSearchBarCssVariables=io,t.LaunchSearchEvent=fo,t.SearchStateChangeEvent=uo,t.facetsCss=so,t.searchBarCss=oo,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|