@fluid-topics/ft-search-bar 0.1.10 → 0.1.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/converters.d.ts +1 -0
- package/build/converters.js +5 -0
- package/build/ft-search-bar.js +12 -12
- package/build/ft-search-bar.light.js +39 -37
- package/build/ft-search-bar.min.js +65 -63
- package/package.json +14 -14
package/build/converters.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export declare function getLabelFromValue(value: string): string | undefined;
|
|
|
7
7
|
export declare function getBreadcrumbFromValue(value: string): string;
|
|
8
8
|
export declare function selectedValues(facet: FtFilterProperties): Array<string>;
|
|
9
9
|
export declare function facetToFilter(facet: FtSearchFacet): FtFilterProperties;
|
|
10
|
+
export declare function getSelectedValues(facet: FtSearchFacet): Array<string>;
|
|
10
11
|
//# sourceMappingURL=converters.d.ts.map
|
package/build/converters.js
CHANGED
|
@@ -54,4 +54,9 @@ export function facetToFilter(facet) {
|
|
|
54
54
|
options: facet.rootNodes.map(n => facetEntryToOption(n, false))
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
export function getSelectedValues(facet) {
|
|
58
|
+
return flatDeep(facet.rootNodes, n => n.selected ? [] : n.childNodes)
|
|
59
|
+
.filter(n => n.selected)
|
|
60
|
+
.map(n => n.value);
|
|
61
|
+
}
|
|
57
62
|
//# sourceMappingURL=converters.js.map
|
package/build/ft-search-bar.js
CHANGED
|
@@ -11,7 +11,7 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
11
11
|
import { customElement, Debouncer, FtLitElement, jsonProperty, ParametrizedLabelResolver } from "@fluid-topics/ft-wc-utils";
|
|
12
12
|
import { FtSizeCategory, FtSizeWatcher } from "@fluid-topics/ft-size-watcher";
|
|
13
13
|
import { FtTypography, FtTypographyBody2 } from "@fluid-topics/ft-typography";
|
|
14
|
-
import { facetToFilter, getBreadcrumbFromValue, getLabelFromValue, selectedValues, serializeRequest } from "./converters";
|
|
14
|
+
import { facetToFilter, getBreadcrumbFromValue, getLabelFromValue, getSelectedValues, selectedValues, serializeRequest } from "./converters";
|
|
15
15
|
import { FtFilter, FtFilterOption } from "@fluid-topics/ft-filter";
|
|
16
16
|
import { FtIcon, FtIcons, FtIconVariants, resolveFileFormatIcon, } from "@fluid-topics/ft-icon";
|
|
17
17
|
import { FtAccordion, FtAccordionItem } from "@fluid-topics/ft-accordion";
|
|
@@ -267,7 +267,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
267
267
|
raiseSelectedOptions
|
|
268
268
|
.options=${filter.options}
|
|
269
269
|
.displayedValuesLimit=${10}
|
|
270
|
-
@change=${(e) => this.setFilter(filter.id,
|
|
270
|
+
@change=${(e) => this.setFilter(filter.id, e.detail)}
|
|
271
271
|
></ft-filter>
|
|
272
272
|
</ft-accordion-item>
|
|
273
273
|
`;
|
|
@@ -431,7 +431,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
431
431
|
raiseSelectedOptions
|
|
432
432
|
.options=${filter.options}
|
|
433
433
|
.displayedValuesLimit=${10}
|
|
434
|
-
@change=${(e) => this.setFilter(filter.id,
|
|
434
|
+
@change=${(e) => this.setFilter(filter.id, e.detail)}
|
|
435
435
|
></ft-filter>
|
|
436
436
|
`;
|
|
437
437
|
})}
|
|
@@ -439,7 +439,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
439
439
|
`;
|
|
440
440
|
}
|
|
441
441
|
renderSelectedFacets() {
|
|
442
|
-
if (!this.hasLocaleSelector && this.
|
|
442
|
+
if (!this.hasLocaleSelector && !this.hasFacets) {
|
|
443
443
|
return null;
|
|
444
444
|
}
|
|
445
445
|
const useSnapScroll = (!this.isMobile && this.dense) || (this.isMobile && this.mobileMenuOpen);
|
|
@@ -452,9 +452,10 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
452
452
|
${(this.getLocaleLabel(this.contentLocale))}
|
|
453
453
|
</ft-chip>
|
|
454
454
|
` : null}
|
|
455
|
-
${repeat(this.
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
${repeat(this.facets, facet => facet.key, facet => {
|
|
456
|
+
const values = getSelectedValues(facet);
|
|
457
|
+
return repeat(values, value => {
|
|
458
|
+
let label = facet.label + ": " + getBreadcrumbFromValue(value);
|
|
458
459
|
const chip = html `
|
|
459
460
|
<ft-chip
|
|
460
461
|
part="selected-filters"
|
|
@@ -464,8 +465,8 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
464
465
|
icon=${this.isMobile ? nothing : "close"}
|
|
465
466
|
label="${label}"
|
|
466
467
|
title=${useSnapScroll ? label : nothing}
|
|
467
|
-
@click=${() => this.openMobileFilters(
|
|
468
|
-
@icon-click=${() => this.setFilter(
|
|
468
|
+
@click=${() => this.openMobileFilters(facet.key)}
|
|
469
|
+
@icon-click=${() => this.setFilter(facet.key, values.filter(v => v !== value))}>
|
|
469
470
|
${getLabelFromValue(value)}
|
|
470
471
|
</ft-chip>
|
|
471
472
|
`;
|
|
@@ -752,7 +753,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
752
753
|
.map(l => l.label)
|
|
753
754
|
.pop()) !== null && _a !== void 0 ? _a : locale;
|
|
754
755
|
}
|
|
755
|
-
setFilter(key,
|
|
756
|
+
setFilter(key, selectedValues) {
|
|
756
757
|
let newFilters = this.searchFilters.filter(f => f.key !== key);
|
|
757
758
|
this.facets.forEach(facet => {
|
|
758
759
|
if (facet.key === key) {
|
|
@@ -762,7 +763,6 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
762
763
|
if (selectedValues.length) {
|
|
763
764
|
newFilters.push({
|
|
764
765
|
key: key,
|
|
765
|
-
label: label,
|
|
766
766
|
negative: false,
|
|
767
767
|
values: selectedValues
|
|
768
768
|
});
|
|
@@ -775,7 +775,7 @@ let FtSearchBar = class FtSearchBar extends FtLitElement {
|
|
|
775
775
|
if (request.contentLocale != null) {
|
|
776
776
|
this.contentLocale = request.contentLocale;
|
|
777
777
|
}
|
|
778
|
-
this.searchFilters = request.filters
|
|
778
|
+
this.searchFilters = request.filters;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
clearFilters() {
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
29
|
*/
|
|
30
|
-
var h;p.elementDefinitions={},l([i.property({type:Number})],p.prototype,"debounceTimeout",void 0),l([i.property({type:Boolean})],p.prototype,"local",void 0),l([i.property({type:Number,reflect:!0})],p.prototype,"size",void 0),l([i.property({type:String,reflect:!0})],p.prototype,"category",void 0),l([i.query(".ft-size-watcher--watcher")],p.prototype,"watcher",void 0),p=l([a.customElement("ft-size-watcher")],p);const f=globalThis.trustedTypes,u=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,b="?"+m,g=`<${b}>`,v=document,x=(t="")=>v.createComment(t),y=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,w=/>/g,z=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,S=/'/g,O=/"/g,C=/^(?:script|style|textarea|title)$/i,B=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),
|
|
30
|
+
var h;p.elementDefinitions={},l([i.property({type:Number})],p.prototype,"debounceTimeout",void 0),l([i.property({type:Boolean})],p.prototype,"local",void 0),l([i.property({type:Number,reflect:!0})],p.prototype,"size",void 0),l([i.property({type:String,reflect:!0})],p.prototype,"category",void 0),l([i.query(".ft-size-watcher--watcher")],p.prototype,"watcher",void 0),p=l([a.customElement("ft-size-watcher")],p);const f=globalThis.trustedTypes,u=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,b="?"+m,g=`<${b}>`,v=document,x=(t="")=>v.createComment(t),y=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,w=/>/g,z=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,S=/'/g,O=/"/g,C=/^(?:script|style|textarea|title)$/i,B=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),E=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,F=v.createTreeWalker(v,129,null,!1),I=(t,e)=>{const i=t.length-1,o=[];let r,a=2===e?"<svg>":"",c=$;for(let e=0;e<i;e++){const i=t[e];let n,s,l=-1,d=0;for(;d<i.length&&(c.lastIndex=d,s=c.exec(i),null!==s);)d=c.lastIndex,c===$?"!--"===s[1]?c=_:void 0!==s[1]?c=w:void 0!==s[2]?(C.test(s[2])&&(r=RegExp("</"+s[2],"g")),c=z):void 0!==s[3]&&(c=z):c===z?">"===s[0]?(c=null!=r?r:$,l=-1):void 0===s[1]?l=-2:(l=c.lastIndex-s[2].length,n=s[1],c=void 0===s[3]?z:'"'===s[3]?O:S):c===O||c===S?c=z:c===_||c===w?c=$:(c=z,r=void 0);const p=c===z&&t[e+1].startsWith("/>")?" ":"";a+=c===$?i+g:l>=0?(o.push(n),i.slice(0,l)+"$lit$"+i.slice(l)+m+p):i+m+(-2===l?(o.push(void 0),e):p)}const n=a+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==u?u.createHTML(n):n,o]};class R{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,a=0;const c=t.length-1,n=this.parts,[s,l]=I(t,e);if(this.el=R.createElement(s,i),F.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=F.nextNode())&&n.length<c;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(m)){const i=l[a++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(m),e=/([.?@])?(.*)/.exec(i);n.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?P:"?"===e[1]?H:"@"===e[1]?U:M})}else n.push({type:6,index:r})}for(const e of t)o.removeAttribute(e)}if(C.test(o.tagName)){const t=o.textContent.split(m),e=t.length-1;if(e>0){o.textContent=f?f.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],x()),F.nextNode(),n.push({type:2,index:++r});o.append(t[e],x())}}}else if(8===o.nodeType)if(o.data===b)n.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(m,t+1));)n.push({type:7,index:r}),t+=m.length-1}r++}}static createElement(t,e){const i=v.createElement("template");return i.innerHTML=t,i}}function D(t,e,i=t,o){var r,a,c,n;if(e===E)return e;let s=void 0!==o?null===(r=i._$Cl)||void 0===r?void 0:r[o]:i._$Cu;const l=y(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==l&&(null===(a=null==s?void 0:s._$AO)||void 0===a||a.call(s,!1),void 0===l?s=void 0:(s=new l(t),s._$AT(t,i,o)),void 0!==o?(null!==(c=(n=i)._$Cl)&&void 0!==c?c:n._$Cl=[])[o]=s:i._$Cu=s),void 0!==s&&(e=D(t,s._$AS(t,e.values),s,o)),e}class L{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,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:v).importNode(i,!0);F.currentNode=r;let a=F.nextNode(),c=0,n=0,s=o[0];for(;void 0!==s;){if(c===s.index){let e;2===s.type?e=new j(a,a.nextSibling,this,t):1===s.type?e=new s.ctor(a,s.name,s.strings,this,t):6===s.type&&(e=new V(a,this,t)),this.v.push(e),s=o[++n]}c!==(null==s?void 0:s.index)&&(a=F.nextNode(),c++)}return r}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 j{constructor(t,e,i,o){var r;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cg=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}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=D(this,t,e),y(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==E&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return k(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==T&&y(this._$AH)?this._$AA.nextSibling.data=t:this.S(v.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=R.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.m(i);else{const t=new L(r,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=A.get(t.strings);return void 0===e&&A.set(t.strings,e=new R(t)),e}A(t){k(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new j(this.M(x()),this.M(x()),this,this.options)):i=e[o],i._$AI(r),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._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class M{constructor(t,e,i,o,r){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=T}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const r=this.strings;let a=!1;if(void 0===r)t=D(this,t,e,0),a=!y(t)||t!==this._$AH&&t!==E,a&&(this._$AH=t);else{const o=t;let c,n;for(t=r[0],c=0;c<r.length-1;c++)n=D(this,o[i+c],e,c),n===E&&(n=this._$AH[c]),a||(a=!y(n)||n!==this._$AH[c]),n===T?t=T:t!==T&&(t+=(null!=n?n:"")+r[c+1]),this._$AH[c]=n}a&&!o&&this.k(t)}k(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class P extends M{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===T?void 0:t}}const N=f?f.emptyScript:"";class H extends M{constructor(){super(...arguments),this.type=4}k(t){t&&t!==T?this.element.setAttribute(this.name,N):this.element.removeAttribute(this.name)}}class U extends M{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=D(this,t,e,0))&&void 0!==i?i:T)===E)return;const o=this._$AH,r=t===T&&o!==T||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,a=t!==T&&(o===T||r);r&&this.element.removeEventListener(this.name,this,o),a&&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 V{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){D(this,t)}}const Z=window.litHtmlPolyfillSupport;null==Z||Z(R,j),(null!==(h=globalThis.litHtmlVersions)&&void 0!==h?h:globalThis.litHtmlVersions=[]).push("2.1.3");
|
|
31
31
|
/**
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright 2020 Google LLC
|
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
35
|
*/
|
|
36
|
-
const q=t=>({_$litStatic$:t}),G=new Map,K=(t=>(e,...i)=>{var o;const r=i.length;let a,c;const n=[],s=[];let l,d=0,p=!1;for(;d<r;){for(l=e[d];d<r&&void 0!==(c=i[d],a=null===(o=c)||void 0===o?void 0:o._$litStatic$);)l+=a+e[++d],p=!0;s.push(c),n.push(l),d++}if(d===r&&n.push(e[r]),p){const t=n.join("$$lit$$");void 0===(e=G.get(t))&&(n.raw=n,G.set(t,e=n)),i=s}return t(e,...i)})(B);var W,X=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};!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"}(W||(W={}));const J=a.FtCssVariable.extend("--ft-typography-font-family",a.designSystemVariables.titleFont),Y=a.FtCssVariable.extend("--ft-typography-font-family",a.designSystemVariables.contentFont),Q={fontFamily:Y,fontSize:a.FtCssVariable.create("--ft-typography-font-size","SIZE","16px"),fontWeight:a.FtCssVariable.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:a.FtCssVariable.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:a.FtCssVariable.create("--ft-typography-line-height","SIZE","24px"),textTransform:a.FtCssVariable.create("--ft-typography-text-transform","UNKNOWN","inherit")},tt=a.FtCssVariable.extend("--ft-typography-title-font-family",J),et=a.FtCssVariable.extend("--ft-typography-title-font-size",Q.fontSize,"20px"),it=a.FtCssVariable.extend("--ft-typography-title-font-weight",Q.fontWeight,"normal"),ot=a.FtCssVariable.extend("--ft-typography-title-letter-spacing",Q.letterSpacing,"0.15px"),rt=a.FtCssVariable.extend("--ft-typography-title-line-height",Q.lineHeight,"24px"),at=a.FtCssVariable.extend("--ft-typography-title-text-transform",Q.textTransform,"inherit"),ct=a.FtCssVariable.extend("--ft-typography-title-dense-font-family",J),nt=a.FtCssVariable.extend("--ft-typography-title-dense-font-size",Q.fontSize,"14px"),st=a.FtCssVariable.extend("--ft-typography-title-dense-font-weight",Q.fontWeight,"normal"),lt=a.FtCssVariable.extend("--ft-typography-title-dense-letter-spacing",Q.letterSpacing,"0.105px"),dt=a.FtCssVariable.extend("--ft-typography-title-dense-line-height",Q.lineHeight,"24px"),pt=a.FtCssVariable.extend("--ft-typography-title-dense-text-transform",Q.textTransform,"inherit"),ht=a.FtCssVariable.extend("--ft-typography-subtitle1-font-family",Y),ft=a.FtCssVariable.extend("--ft-typography-subtitle1-font-size",Q.fontSize,"16px"),ut=a.FtCssVariable.extend("--ft-typography-subtitle1-font-weight",Q.fontWeight,"600"),mt=a.FtCssVariable.extend("--ft-typography-subtitle1-letter-spacing",Q.letterSpacing,"0.144px"),bt=a.FtCssVariable.extend("--ft-typography-subtitle1-line-height",Q.lineHeight,"24px"),gt=a.FtCssVariable.extend("--ft-typography-subtitle1-text-transform",Q.textTransform,"inherit"),vt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-family",Y),xt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-size",Q.fontSize,"14px"),yt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-weight",Q.fontWeight,"normal"),kt=a.FtCssVariable.extend("--ft-typography-subtitle2-letter-spacing",Q.letterSpacing,"0.098px"),$t=a.FtCssVariable.extend("--ft-typography-subtitle2-line-height",Q.lineHeight,"24px"),_t=a.FtCssVariable.extend("--ft-typography-subtitle2-text-transform",Q.textTransform,"inherit"),wt={fontFamily:a.FtCssVariable.extend("--ft-typography-body1-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-body1-font-size",Q.fontSize,"16px"),fontWeight:a.FtCssVariable.extend("--ft-typography-body1-font-weight",Q.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-body1-letter-spacing",Q.letterSpacing,"0.496px"),lineHeight:a.FtCssVariable.extend("--ft-typography-body1-line-height",Q.lineHeight,"24px"),textTransform:a.FtCssVariable.extend("--ft-typography-body1-text-transform",Q.textTransform,"inherit")},zt={fontFamily:a.FtCssVariable.extend("--ft-typography-body2-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-body2-font-size",Q.fontSize,"14px"),fontWeight:a.FtCssVariable.extend("--ft-typography-body2-font-weight",Q.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-body2-letter-spacing",Q.letterSpacing,"0.252px"),lineHeight:a.FtCssVariable.extend("--ft-typography-body2-line-height",Q.lineHeight,"20px"),textTransform:a.FtCssVariable.extend("--ft-typography-body2-text-transform",Q.textTransform,"inherit")},St={fontFamily:a.FtCssVariable.extend("--ft-typography-caption-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-caption-font-size",Q.fontSize,"12px"),fontWeight:a.FtCssVariable.extend("--ft-typography-caption-font-weight",Q.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-caption-letter-spacing",Q.letterSpacing,"0.396px"),lineHeight:a.FtCssVariable.extend("--ft-typography-caption-line-height",Q.lineHeight,"16px"),textTransform:a.FtCssVariable.extend("--ft-typography-caption-text-transform",Q.textTransform,"inherit")},Ot=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-family",Y),Ct=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-size",Q.fontSize,"10px"),Bt=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-weight",Q.fontWeight,"normal"),
|
|
36
|
+
const q=t=>({_$litStatic$:t}),G=new Map,K=(t=>(e,...i)=>{var o;const r=i.length;let a,c;const n=[],s=[];let l,d=0,p=!1;for(;d<r;){for(l=e[d];d<r&&void 0!==(c=i[d],a=null===(o=c)||void 0===o?void 0:o._$litStatic$);)l+=a+e[++d],p=!0;s.push(c),n.push(l),d++}if(d===r&&n.push(e[r]),p){const t=n.join("$$lit$$");void 0===(e=G.get(t))&&(n.raw=n,G.set(t,e=n)),i=s}return t(e,...i)})(B);var W,X=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};!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"}(W||(W={}));const J=a.FtCssVariable.extend("--ft-typography-font-family",a.designSystemVariables.titleFont),Y=a.FtCssVariable.extend("--ft-typography-font-family",a.designSystemVariables.contentFont),Q={fontFamily:Y,fontSize:a.FtCssVariable.create("--ft-typography-font-size","SIZE","16px"),fontWeight:a.FtCssVariable.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:a.FtCssVariable.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:a.FtCssVariable.create("--ft-typography-line-height","SIZE","24px"),textTransform:a.FtCssVariable.create("--ft-typography-text-transform","UNKNOWN","inherit")},tt=a.FtCssVariable.extend("--ft-typography-title-font-family",J),et=a.FtCssVariable.extend("--ft-typography-title-font-size",Q.fontSize,"20px"),it=a.FtCssVariable.extend("--ft-typography-title-font-weight",Q.fontWeight,"normal"),ot=a.FtCssVariable.extend("--ft-typography-title-letter-spacing",Q.letterSpacing,"0.15px"),rt=a.FtCssVariable.extend("--ft-typography-title-line-height",Q.lineHeight,"24px"),at=a.FtCssVariable.extend("--ft-typography-title-text-transform",Q.textTransform,"inherit"),ct=a.FtCssVariable.extend("--ft-typography-title-dense-font-family",J),nt=a.FtCssVariable.extend("--ft-typography-title-dense-font-size",Q.fontSize,"14px"),st=a.FtCssVariable.extend("--ft-typography-title-dense-font-weight",Q.fontWeight,"normal"),lt=a.FtCssVariable.extend("--ft-typography-title-dense-letter-spacing",Q.letterSpacing,"0.105px"),dt=a.FtCssVariable.extend("--ft-typography-title-dense-line-height",Q.lineHeight,"24px"),pt=a.FtCssVariable.extend("--ft-typography-title-dense-text-transform",Q.textTransform,"inherit"),ht=a.FtCssVariable.extend("--ft-typography-subtitle1-font-family",Y),ft=a.FtCssVariable.extend("--ft-typography-subtitle1-font-size",Q.fontSize,"16px"),ut=a.FtCssVariable.extend("--ft-typography-subtitle1-font-weight",Q.fontWeight,"600"),mt=a.FtCssVariable.extend("--ft-typography-subtitle1-letter-spacing",Q.letterSpacing,"0.144px"),bt=a.FtCssVariable.extend("--ft-typography-subtitle1-line-height",Q.lineHeight,"24px"),gt=a.FtCssVariable.extend("--ft-typography-subtitle1-text-transform",Q.textTransform,"inherit"),vt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-family",Y),xt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-size",Q.fontSize,"14px"),yt=a.FtCssVariable.extend("--ft-typography-subtitle2-font-weight",Q.fontWeight,"normal"),kt=a.FtCssVariable.extend("--ft-typography-subtitle2-letter-spacing",Q.letterSpacing,"0.098px"),$t=a.FtCssVariable.extend("--ft-typography-subtitle2-line-height",Q.lineHeight,"24px"),_t=a.FtCssVariable.extend("--ft-typography-subtitle2-text-transform",Q.textTransform,"inherit"),wt={fontFamily:a.FtCssVariable.extend("--ft-typography-body1-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-body1-font-size",Q.fontSize,"16px"),fontWeight:a.FtCssVariable.extend("--ft-typography-body1-font-weight",Q.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-body1-letter-spacing",Q.letterSpacing,"0.496px"),lineHeight:a.FtCssVariable.extend("--ft-typography-body1-line-height",Q.lineHeight,"24px"),textTransform:a.FtCssVariable.extend("--ft-typography-body1-text-transform",Q.textTransform,"inherit")},zt={fontFamily:a.FtCssVariable.extend("--ft-typography-body2-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-body2-font-size",Q.fontSize,"14px"),fontWeight:a.FtCssVariable.extend("--ft-typography-body2-font-weight",Q.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-body2-letter-spacing",Q.letterSpacing,"0.252px"),lineHeight:a.FtCssVariable.extend("--ft-typography-body2-line-height",Q.lineHeight,"20px"),textTransform:a.FtCssVariable.extend("--ft-typography-body2-text-transform",Q.textTransform,"inherit")},St={fontFamily:a.FtCssVariable.extend("--ft-typography-caption-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-caption-font-size",Q.fontSize,"12px"),fontWeight:a.FtCssVariable.extend("--ft-typography-caption-font-weight",Q.fontWeight,"normal"),letterSpacing:a.FtCssVariable.extend("--ft-typography-caption-letter-spacing",Q.letterSpacing,"0.396px"),lineHeight:a.FtCssVariable.extend("--ft-typography-caption-line-height",Q.lineHeight,"16px"),textTransform:a.FtCssVariable.extend("--ft-typography-caption-text-transform",Q.textTransform,"inherit")},Ot=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-family",Y),Ct=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-size",Q.fontSize,"10px"),Bt=a.FtCssVariable.extend("--ft-typography-breadcrumb-font-weight",Q.fontWeight,"normal"),Et=a.FtCssVariable.extend("--ft-typography-breadcrumb-letter-spacing",Q.letterSpacing,"0.33px"),Tt=a.FtCssVariable.extend("--ft-typography-breadcrumb-line-height",Q.lineHeight,"16px"),At=a.FtCssVariable.extend("--ft-typography-breadcrumb-text-transform",Q.textTransform,"inherit"),Ft=a.FtCssVariable.extend("--ft-typography-overline-font-family",Y),It=a.FtCssVariable.extend("--ft-typography-overline-font-size",Q.fontSize,"10px"),Rt=a.FtCssVariable.extend("--ft-typography-overline-font-weight",Q.fontWeight,"normal"),Dt=a.FtCssVariable.extend("--ft-typography-overline-letter-spacing",Q.letterSpacing,"1.5px"),Lt=a.FtCssVariable.extend("--ft-typography-overline-line-height",Q.lineHeight,"16px"),jt=a.FtCssVariable.extend("--ft-typography-overline-text-transform",Q.textTransform,"uppercase"),Mt={fontFamily:a.FtCssVariable.extend("--ft-typography-button-font-family",Y),fontSize:a.FtCssVariable.extend("--ft-typography-button-font-size",Q.fontSize,"14px"),fontWeight:a.FtCssVariable.extend("--ft-typography-button-font-weight",Q.fontWeight,"600"),letterSpacing:a.FtCssVariable.extend("--ft-typography-button-letter-spacing",Q.letterSpacing,"1.246px"),lineHeight:a.FtCssVariable.extend("--ft-typography-button-line-height",Q.lineHeight,"16px"),textTransform:a.FtCssVariable.extend("--ft-typography-button-text-transform",Q.textTransform,"uppercase")},Pt=e.css`
|
|
37
37
|
.ft-typography--title {
|
|
38
38
|
font-family: ${tt};
|
|
39
39
|
font-size: ${et};
|
|
@@ -102,8 +102,8 @@ const q=t=>({_$litStatic$:t}),G=new Map,K=(t=>(e,...i)=>{var o;const r=i.length;
|
|
|
102
102
|
font-family: ${Ot};
|
|
103
103
|
font-size: ${Ct};
|
|
104
104
|
font-weight: ${Bt};
|
|
105
|
-
letter-spacing: ${
|
|
106
|
-
line-height: ${
|
|
105
|
+
letter-spacing: ${Et};
|
|
106
|
+
line-height: ${Tt};
|
|
107
107
|
text-transform: ${At};
|
|
108
108
|
}
|
|
109
109
|
`,Kt=e.css`
|
|
@@ -135,7 +135,7 @@ const q=t=>({_$litStatic$:t}),G=new Map,K=(t=>(e,...i)=>{var o;const r=i.length;
|
|
|
135
135
|
</${q(this.element)}>
|
|
136
136
|
`:K`
|
|
137
137
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
138
|
-
`}};function Jt(t,e){return t.flatMap((t=>[t,...Jt(e(t),e)]))}function Yt(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function Qt(t,e){return{label:t.label,selected:!e&&t.selected,subOptions:t.childNodes.map((e=>Qt(e,t.selected))),value:t.value}}function te(t){return{id:t.key,label:t.label,multivalued:t.multiSelectionable,options:t.rootNodes.map((t=>Qt(t,!1)))}}
|
|
138
|
+
`}};function Jt(t,e){return t.flatMap((t=>[t,...Jt(e(t),e)]))}function Yt(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function Qt(t,e){return{label:t.label,selected:!e&&t.selected,subOptions:t.childNodes.map((e=>Qt(e,t.selected))),value:t.value}}function te(t){return{id:t.key,label:t.label,multivalued:t.multiSelectionable,options:t.rootNodes.map((t=>Qt(t,!1)))}}X([i.property()],Xt.prototype,"element",void 0),X([i.property()],Xt.prototype,"variant",void 0),Xt=X([a.customElement("ft-typography")],Xt);
|
|
139
139
|
/*! *****************************************************************************
|
|
140
140
|
Copyright (c) Microsoft Corporation.
|
|
141
141
|
|
|
@@ -149,7 +149,8 @@ const q=t=>({_$litStatic$:t}),G=new Map,K=(t=>(e,...i)=>{var o;const r=i.length;
|
|
|
149
149
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
150
150
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
151
151
|
PERFORMANCE OF THIS SOFTWARE.
|
|
152
|
-
***************************************************************************** */
|
|
152
|
+
***************************************************************************** */
|
|
153
|
+
var ee=function(t,e){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},ee(t,e)};function ie(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}ee(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var oe=function(){return oe=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},oe.apply(this,arguments)};function re(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c}function ae(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],o=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
|
|
153
154
|
/**
|
|
154
155
|
* @license
|
|
155
156
|
* Copyright 2018 Google Inc.
|
|
@@ -290,7 +291,7 @@ class Se{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))}
|
|
|
290
291
|
* @license
|
|
291
292
|
* Copyright 2018 Google LLC
|
|
292
293
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
293
|
-
*/const Oe=t=>null!=t?t:
|
|
294
|
+
*/const Oe=t=>null!=t?t:T
|
|
294
295
|
/**
|
|
295
296
|
* @license
|
|
296
297
|
* Copyright 2019 Google LLC
|
|
@@ -342,7 +343,7 @@ const Be=e.css`.mdc-checkbox{padding:calc((40px - 18px) / 2);padding:calc((var(-
|
|
|
342
343
|
* @license
|
|
343
344
|
* Copyright 2018 Google LLC
|
|
344
345
|
* SPDX-License-Identifier: Apache-2.0
|
|
345
|
-
*/;let
|
|
346
|
+
*/;let Ee=class extends Ce{};Ee.styles=[Be],Ee=re([i.customElement("mwc-checkbox")],Ee);var Te=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};const Ae={color:a.FtCssVariable.extend("--ft-ripple-color",a.designSystemVariables.colorContent),primaryColor:a.FtCssVariable.extend("--ft-ripple-primary-color",a.FtCssVariable.extend("--ft-ripple-color",a.designSystemVariables.colorPrimary)),secondaryColor:a.FtCssVariable.extend("--ft-ripple-secondary-color",a.FtCssVariable.extend("--ft-ripple-color",a.designSystemVariables.colorSecondary)),opacityContentOnSurfacePressed:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),opacityContentOnSurfaceDragged:a.FtCssVariable.external(a.designSystemVariables.opacityContentOnSurfaceDragged,"Design system")};let Fe=class extends a.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1}getStyles(){return e.css`
|
|
346
347
|
:host {
|
|
347
348
|
display: contents;
|
|
348
349
|
|
|
@@ -369,7 +370,7 @@ const Be=e.css`.mdc-checkbox{padding:calc((40px - 18px) / 2);padding:calc((var(-
|
|
|
369
370
|
?selected=${this.selected}
|
|
370
371
|
?disabled=${this.disabled}
|
|
371
372
|
></mwc-ripple>
|
|
372
|
-
`}updated(t){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple()}endRipple(){var t,e,i;null===(t=this.rippleHandlers)||void 0===t||t.endHover(),null===(e=this.rippleHandlers)||void 0===e||e.endFocus(),null===(i=this.rippleHandlers)||void 0===i||i.endPress()}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentNode;if(e){const t=new Se((async()=>this.mwcRipple)),i=(...e)=>i=>{e.forEach((e=>window.addEventListener(e,t.endPress,{once:!0}))),t.startPress(i)},o=i("mouseup"),r=i("touchend","touchcancel"),a=t=>{["Enter"," "].includes(t.key)&&i("keyup")()};e.addEventListener("mouseenter",t.startHover),e.addEventListener("mouseleave",t.endHover),e.addEventListener("mousedown",o),e.addEventListener("touchstart",r),e.addEventListener("keydown",a),e.addEventListener("focus",t.startFocus),e.addEventListener("blur",t.endFocus),this.onDisconnect=()=>{e.removeEventListener("mouseenter",t.startHover),e.removeEventListener("mouseleave",t.endHover),e.removeEventListener("mousedown",o),e.removeEventListener("touchstart",r),e.removeEventListener("keydown",a),e.removeEventListener("focus",t.startFocus),e.removeEventListener("blur",t.endFocus)},this.rippleHandlers=t}}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};Fe.elementDefinitions={"mwc-ripple":ye},
|
|
373
|
+
`}updated(t){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple()}endRipple(){var t,e,i;null===(t=this.rippleHandlers)||void 0===t||t.endHover(),null===(e=this.rippleHandlers)||void 0===e||e.endFocus(),null===(i=this.rippleHandlers)||void 0===i||i.endPress()}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentNode;if(e){const t=new Se((async()=>this.mwcRipple)),i=(...e)=>i=>{e.forEach((e=>window.addEventListener(e,t.endPress,{once:!0}))),t.startPress(i)},o=i("mouseup"),r=i("touchend","touchcancel"),a=t=>{["Enter"," "].includes(t.key)&&i("keyup")()};e.addEventListener("mouseenter",t.startHover),e.addEventListener("mouseleave",t.endHover),e.addEventListener("mousedown",o),e.addEventListener("touchstart",r),e.addEventListener("keydown",a),e.addEventListener("focus",t.startFocus),e.addEventListener("blur",t.endFocus),this.onDisconnect=()=>{e.removeEventListener("mouseenter",t.startHover),e.removeEventListener("mouseleave",t.endHover),e.removeEventListener("mousedown",o),e.removeEventListener("touchstart",r),e.removeEventListener("keydown",a),e.removeEventListener("focus",t.startFocus),e.removeEventListener("blur",t.endFocus)},this.rippleHandlers=t}}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};Fe.elementDefinitions={"mwc-ripple":ye},Te([i.property({type:Boolean})],Fe.prototype,"primary",void 0),Te([i.property({type:Boolean})],Fe.prototype,"secondary",void 0),Te([i.property({type:Boolean})],Fe.prototype,"unbounded",void 0),Te([i.property({type:Boolean})],Fe.prototype,"activated",void 0),Te([i.property({type:Boolean})],Fe.prototype,"selected",void 0),Te([i.property({type:Boolean})],Fe.prototype,"disabled",void 0),Te([i.query("mwc-ripple")],Fe.prototype,"mwcRipple",void 0),Fe=Te([a.customElement("ft-ripple")],Fe);
|
|
373
374
|
/**
|
|
374
375
|
* @license
|
|
375
376
|
* Copyright 2021 Google LLC
|
|
@@ -901,23 +902,23 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
901
902
|
<mwc-formfield label="${t.label}">
|
|
902
903
|
<mwc-checkbox
|
|
903
904
|
reducedTouchTarget
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
@change=${e=>this.
|
|
905
|
+
.checked=${t.selected}
|
|
906
|
+
.disabled=${this.disabled}
|
|
907
|
+
.indeterminate=${Jt(null!==(i=t.subOptions)&&void 0!==i?i:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
|
|
908
|
+
@change=${e=>this.optionsChanged(e,t)}
|
|
908
909
|
></mwc-checkbox>
|
|
909
910
|
</mwc-formfield>
|
|
910
|
-
`}
|
|
911
|
+
`}buildMonoValuedOption(t){return e.html`
|
|
911
912
|
<mwc-formfield label="${t.label}">
|
|
912
913
|
<mwc-radio
|
|
913
914
|
reducedTouchTarget
|
|
914
915
|
name="${this.id}"
|
|
915
916
|
?checked=${t.selected}
|
|
916
917
|
?disabled=${this.disabled}
|
|
917
|
-
@click=${e=>this.
|
|
918
|
+
@click=${e=>this.optionsChanged(e,t)}
|
|
918
919
|
></mwc-radio>
|
|
919
920
|
</mwc-formfield>
|
|
920
|
-
`}
|
|
921
|
+
`}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}};vi.elementDefinitions={"ft-button":Qe,"ft-ripple":Fe,"ft-typography":Xt,"mwc-checkbox":Ee,"mwc-formfield":ci,"mwc-icon":Re,"mwc-radio":mi},bi([i.property({type:String})],vi.prototype,"id",void 0),bi([i.property({type:Object})],vi.prototype,"parent",void 0),bi([i.property({type:Array})],vi.prototype,"options",void 0),bi([i.property({type:Boolean})],vi.prototype,"multivalued",void 0),bi([i.property({type:Boolean})],vi.prototype,"disabled",void 0),bi([i.property({type:Boolean})],vi.prototype,"hideSelectedOptions",void 0),bi([i.property({type:Boolean})],vi.prototype,"preventNavigation",void 0),bi([i.property({type:String})],vi.prototype,"filter",void 0),bi([i.property({type:String})],vi.prototype,"moreValuesButtonLabel",void 0),bi([i.property({type:Number})],vi.prototype,"displayedValuesLimit",void 0),bi([i.query(".ft-filter-level--container")],vi.prototype,"container",void 0),bi([i.state()],vi.prototype,"displayedPages",void 0),vi=bi([a.customElement("ft-filter-level")],vi);var xi=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};const yi={buttonsColor:a.FtCssVariable.extend("--ft-snap-scroll-buttons-color",a.designSystemVariables.colorPrimary),buttonsZIndex:a.FtCssVariable.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:a.FtCssVariable.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:a.FtCssVariable.external(a.designSystemVariables.colorSurface,"Design system")};class ki extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}let $i=class extends a.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 a.Debouncer(200),this.updateScrollDebouncer=new a.Debouncer(100)}getStyles(){return e.css`
|
|
921
922
|
.ft-snap-scroll {
|
|
922
923
|
box-sizing: border-box;
|
|
923
924
|
position: relative;
|
|
@@ -1067,8 +1068,8 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
1067
1068
|
></ft-button>
|
|
1068
1069
|
</div>
|
|
1069
1070
|
`}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 ki(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)}};$i.elementDefinitions={"ft-button":Qe},xi([i.property({type:Boolean})],$i.prototype,"horizontal",void 0),xi([i.property({type:Boolean})],$i.prototype,"hideScrollbar",void 0),xi([i.property({type:Boolean})],$i.prototype,"controls",void 0),xi([i.property({type:Boolean})],$i.prototype,"limitSize",void 0),xi([i.state()],$i.prototype,"elements",void 0),xi([i.state()],$i.prototype,"currentElement",void 0),xi([i.state()],$i.prototype,"withScroll",void 0),xi([i.state()],$i.prototype,"startReached",void 0),xi([i.state()],$i.prototype,"endReached",void 0),xi([i.query(".ft-snap-scroll--content")],$i.prototype,"contentSlot",void 0),$i=xi([a.customElement("ft-snap-scroll")],$i);var _i=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};let wi=class extends a.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}getTemplate(){return e.html`
|
|
1070
|
-
<slot @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1071
|
-
`}updateSubOptionsFromSlot(t){
|
|
1071
|
+
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1072
|
+
`}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}))}};wi.elementDefinitions={},_i([i.property({type:String})],wi.prototype,"label",void 0),_i([i.property({type:Object,converter:t=>t})],wi.prototype,"value",void 0),_i([i.property({type:Boolean,reflect:!0})],wi.prototype,"selected",void 0),_i([i.property({type:Object})],wi.prototype,"subOptions",void 0),_i([i.query(".ft-filter-option--slot")],wi.prototype,"slotElement",void 0),wi=_i([a.customElement("ft-filter-option")],wi);var zi=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};const Si=a.FtCssVariable.external(a.designSystemVariables.colorOutline,"Design system"),Oi=a.FtCssVariable.external(a.designSystemVariables.colorOnSurface,"Design system"),Ci=a.FtCssVariable.external(a.designSystemVariables.colorOnSurfaceMedium,"Design system"),Bi=a.FtCssVariable.external(a.designSystemVariables.colorPrimary,"Design system"),Ei=a.FtCssVariable.external(a.designSystemVariables.colorSurface,"Design system"),Ti=a.FtCssVariable.external(a.designSystemVariables.transitionDuration,"Design system"),Ai=a.FtCssVariable.external(a.designSystemVariables.transitionTimingFunction,"Design system");class Fi extends CustomEvent{constructor(t){super("change",{detail:t})}}let Ii=class extends a.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",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 a.Debouncer(300),this.changeDebouncer=new a.Debouncer(10)}getStyles(){return[qt,e.css`
|
|
1072
1073
|
:host {
|
|
1073
1074
|
display: flex;
|
|
1074
1075
|
max-height: 100%;
|
|
@@ -1082,7 +1083,7 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
1082
1083
|
max-height: 100%;
|
|
1083
1084
|
max-width: 100%;
|
|
1084
1085
|
color: ${Oi};
|
|
1085
|
-
background: ${
|
|
1086
|
+
background: ${Ei};
|
|
1086
1087
|
}
|
|
1087
1088
|
|
|
1088
1089
|
.ft-filter--header {
|
|
@@ -1118,8 +1119,8 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
1118
1119
|
padding: 0 10px;
|
|
1119
1120
|
overflow: hidden;
|
|
1120
1121
|
height: 32px;
|
|
1121
|
-
transition: height ${
|
|
1122
|
-
margin ${
|
|
1122
|
+
transition: height ${Ti} ${Ai},
|
|
1123
|
+
margin ${Ti} ${Ai};
|
|
1123
1124
|
transition-delay: 500ms;
|
|
1124
1125
|
}
|
|
1125
1126
|
|
|
@@ -1134,7 +1135,7 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
1134
1135
|
border-radius: 4px;
|
|
1135
1136
|
border: 1px solid ${Si};
|
|
1136
1137
|
padding: 4px;
|
|
1137
|
-
background-color: ${
|
|
1138
|
+
background-color: ${Ei};
|
|
1138
1139
|
color: ${Ci};
|
|
1139
1140
|
outline-color: ${Bi};
|
|
1140
1141
|
}
|
|
@@ -1198,8 +1199,9 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
1198
1199
|
<div class="ft-filter--values">
|
|
1199
1200
|
${this.renderLevels()}
|
|
1200
1201
|
</div>
|
|
1201
|
-
<slot
|
|
1202
|
-
@
|
|
1202
|
+
<slot class="ft-filter--slot"
|
|
1203
|
+
@slotchange=${this.updateOptionsFromSlot}
|
|
1204
|
+
@option-change=${this.optionsChanged}></slot>
|
|
1203
1205
|
</div>
|
|
1204
1206
|
`}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,i=t.filter((t=>t.selected)),o=this.slideIn||this.slideOut?this.displayedLevels.length-2:this.displayedLevels.length-1,r=o<0?"ft-filter--level-center":"ft-filter--level-left";return e.html`
|
|
1205
1207
|
${this.raiseSelectedOptions&&i.length>0?e.html`
|
|
@@ -1237,7 +1239,7 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
1237
1239
|
@display-level=${this.onDisplayLevel}
|
|
1238
1240
|
part="values"
|
|
1239
1241
|
></ft-filter-level>
|
|
1240
|
-
`}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){if(t.stopPropagation(),!this.multivalued){const e=i=>{var o;i.value!==t.detail.value&&(i.selected=!1),null===(o=i.subOptions)||void 0===o||o.forEach(e)};this.options.forEach(e)}this.optionsChanged()}optionsChanged(){var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new Fi(e)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}updateOptionsFromSlot(t){const e=t.composedPath()[0];this.options=e.assignedElements().map((t=>t))}onFilterChange(t){const e=t.composedPath()[0];this.filter=e.value}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}};var Ri,Di;Ii.elementDefinitions={"ft-button":Qe,"ft-filter-level":vi,"ft-snap-scroll":$i,"ft-typography":Xt},zi([i.property({type:String})],Ii.prototype,"id",void 0),zi([i.property({type:String})],Ii.prototype,"label",void 0),zi([i.property({type:String})],Ii.prototype,"filterPlaceHolder",void 0),zi([i.property({type:String})],Ii.prototype,"clearButtonLabel",void 0),zi([i.property({type:String})],Ii.prototype,"moreValuesButtonLabel",void 0),zi([i.property({type:Array})],Ii.prototype,"options",void 0),zi([i.property({type:Boolean})],Ii.prototype,"multivalued",void 0),zi([i.property({type:Boolean})],Ii.prototype,"disabled",void 0),zi([i.property({type:Boolean})],Ii.prototype,"raiseSelectedOptions",void 0),zi([i.property({type:Number})],Ii.prototype,"displayedValuesLimit",void 0),zi([i.query(".ft-filter--container")],Ii.prototype,"container",void 0),zi([i.query(".ft-filter--values")],Ii.prototype,"valuesContainer",void 0),zi([i.query(".ft-filter--levels")],Ii.prototype,"levelsContainer",void 0),zi([i.query(".ft-filter--levels ft-filter-level:last-child")],Ii.prototype,"lastLevel",void 0),zi([i.queryAll(".ft-filter--levels ft-filter-level")],Ii.prototype,"levels",void 0),zi([i.state()],Ii.prototype,"withScroll",void 0),zi([i.state()],Ii.prototype,"filter",void 0),zi([i.state()],Ii.prototype,"slideIn",void 0),zi([i.state()],Ii.prototype,"slideOut",void 0),Ii=zi([a.customElement("ft-filter")],Ii),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=""}(Ri||(Ri={})),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=""}(Di||(Di={}));const Li=new Map([...["abw"].map((t=>[t,Di.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,Di.AUDIO])),...["avi"].map((t=>[t,Di.AVI])),...["chm","xhs"].map((t=>[t,Di.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,Di.CODE])),...["csv"].map((t=>[t,Di.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Di.DITA])),...["epub"].map((t=>[t,Di.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Di.EXCEL])),...["flac"].map((t=>[t,Di.FLAC])),...["gif"].map((t=>[t,Di.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Di.GZIP])),...["html","htm","xhtml"].map((t=>[t,Di.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,Di.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Di.JPEG])),...["json"].map((t=>[t,Di.JSON])),...["m4a","m4p"].map((t=>[t,Di.M4A])),...["mov","qt"].map((t=>[t,Di.MOV])),...["mp3"].map((t=>[t,Di.MP3])),...["mp4","m4v"].map((t=>[t,Di.MP4])),...["ogg","oga"].map((t=>[t,Di.OGG])),...["pdf","ps"].map((t=>[t,Di.PDF])),...["png"].map((t=>[t,Di.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Di.POWERPOINT])),...["rar"].map((t=>[t,Di.RAR])),...["stp"].map((t=>[t,Di.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Di.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,Di.VIDEO])),...["wav"].map((t=>[t,Di.WAV])),...["wma"].map((t=>[t,Di.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Di.WORD])),...["xml","xsl","rdf"].map((t=>[t,Di.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Di.YAML])),...["zip"].map((t=>[t,Di.ZIP]))]),ji=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var Mi,Pi=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format"}(Mi||(Mi={}));const Ni=a.FtCssVariable.create("--ft-icon-font-size","SIZE","24px"),Hi=a.FtCssVariable.extend("--ft-icon-fluid-topics-font-family",a.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","ft-icons")),Ui=a.FtCssVariable.extend("--ft-icon-file-format-font-family",a.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","ft-mime")),Vi=e.css`
|
|
1242
|
+
`}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 Fi(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(t){const e=t.composedPath()[0];this.filter=e.value}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}};var Ri,Di;Ii.elementDefinitions={"ft-button":Qe,"ft-filter-level":vi,"ft-snap-scroll":$i,"ft-typography":Xt},zi([i.property({type:String})],Ii.prototype,"id",void 0),zi([i.property({type:String})],Ii.prototype,"label",void 0),zi([i.property({type:String})],Ii.prototype,"filterPlaceHolder",void 0),zi([i.property({type:String})],Ii.prototype,"clearButtonLabel",void 0),zi([i.property({type:String})],Ii.prototype,"moreValuesButtonLabel",void 0),zi([a.jsonProperty([])],Ii.prototype,"options",void 0),zi([i.property({type:Boolean})],Ii.prototype,"multivalued",void 0),zi([i.property({type:Boolean})],Ii.prototype,"disabled",void 0),zi([i.property({type:Boolean})],Ii.prototype,"raiseSelectedOptions",void 0),zi([i.property({type:Number})],Ii.prototype,"displayedValuesLimit",void 0),zi([i.query(".ft-filter--slot")],Ii.prototype,"slotElement",void 0),zi([i.query(".ft-filter--container")],Ii.prototype,"container",void 0),zi([i.query(".ft-filter--values")],Ii.prototype,"valuesContainer",void 0),zi([i.query(".ft-filter--levels")],Ii.prototype,"levelsContainer",void 0),zi([i.query(".ft-filter--levels ft-filter-level:last-child")],Ii.prototype,"lastLevel",void 0),zi([i.queryAll(".ft-filter--levels ft-filter-level")],Ii.prototype,"levels",void 0),zi([i.state()],Ii.prototype,"withScroll",void 0),zi([i.state()],Ii.prototype,"filter",void 0),zi([i.state()],Ii.prototype,"slideIn",void 0),zi([i.state()],Ii.prototype,"slideOut",void 0),Ii=zi([a.customElement("ft-filter")],Ii),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=""}(Ri||(Ri={})),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=""}(Di||(Di={}));const Li=new Map([...["abw"].map((t=>[t,Di.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,Di.AUDIO])),...["avi"].map((t=>[t,Di.AVI])),...["chm","xhs"].map((t=>[t,Di.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,Di.CODE])),...["csv"].map((t=>[t,Di.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Di.DITA])),...["epub"].map((t=>[t,Di.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Di.EXCEL])),...["flac"].map((t=>[t,Di.FLAC])),...["gif"].map((t=>[t,Di.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Di.GZIP])),...["html","htm","xhtml"].map((t=>[t,Di.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,Di.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Di.JPEG])),...["json"].map((t=>[t,Di.JSON])),...["m4a","m4p"].map((t=>[t,Di.M4A])),...["mov","qt"].map((t=>[t,Di.MOV])),...["mp3"].map((t=>[t,Di.MP3])),...["mp4","m4v"].map((t=>[t,Di.MP4])),...["ogg","oga"].map((t=>[t,Di.OGG])),...["pdf","ps"].map((t=>[t,Di.PDF])),...["png"].map((t=>[t,Di.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Di.POWERPOINT])),...["rar"].map((t=>[t,Di.RAR])),...["stp"].map((t=>[t,Di.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Di.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,Di.VIDEO])),...["wav"].map((t=>[t,Di.WAV])),...["wma"].map((t=>[t,Di.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Di.WORD])),...["xml","xsl","rdf"].map((t=>[t,Di.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Di.YAML])),...["zip"].map((t=>[t,Di.ZIP]))]),ji=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);var Mi,Pi=function(t,e,i,o){for(var r,a=arguments.length,c=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,n=t.length-1;n>=0;n--)(r=t[n])&&(c=(a<3?r(c):a>3?r(e,i,c):r(e,i))||c);return a>3&&c&&Object.defineProperty(e,i,c),c};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format"}(Mi||(Mi={}));const Ni=a.FtCssVariable.create("--ft-icon-font-size","SIZE","24px"),Hi=a.FtCssVariable.extend("--ft-icon-fluid-topics-font-family",a.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","ft-icons")),Ui=a.FtCssVariable.extend("--ft-icon-file-format-font-family",a.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","ft-mime")),Vi=e.css`
|
|
1241
1243
|
.ft-icon--fluid-topics {
|
|
1242
1244
|
font-family: ${Hi}, ft-icons, fticons, sans-serif;
|
|
1243
1245
|
font-size: ${Ni};
|
|
@@ -2210,7 +2212,7 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
2210
2212
|
raiseSelectedOptions
|
|
2211
2213
|
.options=${i.options}
|
|
2212
2214
|
.displayedValuesLimit=${10}
|
|
2213
|
-
@change=${t=>this.setFilter(i.id,
|
|
2215
|
+
@change=${t=>this.setFilter(i.id,t.detail)}
|
|
2214
2216
|
></ft-filter>
|
|
2215
2217
|
</ft-accordion-item>
|
|
2216
2218
|
`}))}
|
|
@@ -2336,11 +2338,11 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
2336
2338
|
raiseSelectedOptions
|
|
2337
2339
|
.options=${i.options}
|
|
2338
2340
|
.displayedValuesLimit=${10}
|
|
2339
|
-
@change=${t=>this.setFilter(i.id,
|
|
2341
|
+
@change=${t=>this.setFilter(i.id,t.detail)}
|
|
2340
2342
|
></ft-filter>
|
|
2341
2343
|
`}))}
|
|
2342
2344
|
</ft-snap-scroll>
|
|
2343
|
-
`:e.nothing}renderSelectedFacets(){if(!this.hasLocaleSelector
|
|
2345
|
+
`:e.nothing}renderSelectedFacets(){if(!this.hasLocaleSelector&&!this.hasFacets)return null;const t=!this.isMobile&&this.dense||this.isMobile&&this.mobileMenuOpen,i=e.html`
|
|
2344
2346
|
${this.hasLocaleSelector&&(this.hasFacets||this.isMobile)?e.html`
|
|
2345
2347
|
<ft-chip part="selected-filters"
|
|
2346
2348
|
?dense=${this.dense&&!this.isMobile}
|
|
@@ -2349,24 +2351,24 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
2349
2351
|
${this.getLocaleLabel(this.contentLocale)}
|
|
2350
2352
|
</ft-chip>
|
|
2351
2353
|
`:null}
|
|
2352
|
-
${o.repeat(this.
|
|
2354
|
+
${o.repeat(this.facets,(t=>t.key),(i=>{const r=function(t){return Jt(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(i);return o.repeat(r,(o=>{let a=i.label+": "+function(t){return Yt(t).split("|").join(" > ")}(o);const c=e.html`
|
|
2353
2355
|
<ft-chip
|
|
2354
2356
|
part="selected-filters"
|
|
2355
2357
|
?dense=${this.dense&&!this.isMobile}
|
|
2356
2358
|
?clickable=${this.isMobile}
|
|
2357
2359
|
?removable=${!this.isMobile}
|
|
2358
2360
|
icon=${this.isMobile?e.nothing:"close"}
|
|
2359
|
-
label="${
|
|
2360
|
-
title=${t?
|
|
2361
|
+
label="${a}"
|
|
2362
|
+
title=${t?a:e.nothing}
|
|
2361
2363
|
@click=${()=>this.openMobileFilters(i.key)}
|
|
2362
|
-
@icon-click=${()=>this.setFilter(i.key,
|
|
2364
|
+
@icon-click=${()=>this.setFilter(i.key,r.filter((t=>t!==o)))}>
|
|
2363
2365
|
${function(t){return Yt(t).split("|").pop()}(o)}
|
|
2364
2366
|
</ft-chip>
|
|
2365
|
-
`;return t?
|
|
2366
|
-
<ft-tooltip inline text="${
|
|
2367
|
-
${
|
|
2367
|
+
`;return t?c:e.html`
|
|
2368
|
+
<ft-tooltip inline text="${a}">
|
|
2369
|
+
${c}
|
|
2368
2370
|
</ft-tooltip>
|
|
2369
|
-
`}))))}
|
|
2371
|
+
`}))}))}
|
|
2370
2372
|
${this.isMobile?e.html`
|
|
2371
2373
|
<ft-chip part="selected-filters"
|
|
2372
2374
|
icon="add"
|
|
@@ -2427,4 +2429,4 @@ const ui=e.css`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc(
|
|
|
2427
2429
|
<ft-icon variant="${i}" part="suggestion-icon">
|
|
2428
2430
|
${o}
|
|
2429
2431
|
</ft-icon>
|
|
2430
|
-
`}openMobileFilters(t){this.isMobile&&(this.mobileMenuOpen=!0,this.displayFacets=!0,this.scrollToFacet=t)}async firstUpdated(t){var e,i;super.firstUpdated(t),this.initApi(),this.availableContentLocales=null!==(i=await(null===(e=this.api)||void 0===e?void 0:e.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[]))))&&void 0!==i?i:[]}update(t){var e,i,o;if(t.has("labels")&&(this.labelResolver=new a.ParametrizedLabelResolver(_o,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const i=t=>this.availableContentLocales.some((e=>e.lang===t));i(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&i(t.get("contentLocale"))?t.get("contentLocale"):null===(e=this.availableContentLocales[0])||void 0===e?void 0:e.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.recentSearches=JSON.parse(null!==(i=window.localStorage.getItem(this.recentSearchesStorageKey))&&void 0!==i?i:"[]")),t.has("selectedPreset")){const t=this.presets.find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(o=this.presets.find((t=>this.compareRequests(t,this.request))))||void 0===o?void 0:o.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&this.setApi(),["uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateFacets(),["query","uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateSuggestions(),["query","uiLocale","contentLocale","searchFilters"].some((e=>t.has(e)))&&this.dispatchEvent(new zo(this.request))}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.setApi(),setTimeout((()=>this.initApi()),100))}setApi(){this.api=window.fluidtopics?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier):void 0}updateFacets(){this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{var t,e;this.facets=null!==(e=await(null===(t=this.api)||void 0===t?void 0:t.search({...this.request,query:""}).then((t=>t.facets)).catch((()=>[]))))&&void 0!==e?e:[],this.facets.forEach((t=>this.knownFacetLabels[t.key]=t.label)),this.facetsLoaded=!0}))):this.facets=[]}updateSuggestions(){this.suggestionsLoaded=!1,this.suggestDebouncer.run((async()=>{this.suggestions=this.api&&this.query.length>2?await this.api.getSuggestions(this.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],this.suggestionsLoaded=!0}))}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.query=e.value,"Enter"===t.key&&this.launchSearch()}onSearchBarKeyDown(t){var e,i;switch(t.key){case"Escape":this.mobileMenuOpen=!1,null===(e=this.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),null===(i=this.firstSuggestion)||void 0===i||i.focus()}}onFloatingContainerKeyUp(t){var e;"Escape"===t.key&&(this.displayFacets=!1,null===(e=this.filtersOpener)||void 0===e||e.focus())}setQuery(t){this.input&&(this.input.value=t),this.query=t}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.setQuery(e),this.launchSearch()}launchSearch(){if(this.query){let t=this.recentSearches.filter((t=>t.toLowerCase()!==this.query.toLowerCase())).filter(((t,e)=>e<20));this.recentSearches=[this.query,...t],this.saveRecentSearches()}this.dispatchEvent(new wo(this.request)),this.mobileMenuOpen=!1,this.displayFacets=!1,this.focus()}saveRecentSearches(){window.localStorage.setItem(this.recentSearchesStorageKey,JSON.stringify(this.recentSearches))}connectedCallback(){super.connectedCallback(),document.addEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}updateSize(t){this.sizeCategory=t.detail.category}getLocaleLabel(t){var e;return null!==(e=this.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}setFilter(t,e
|
|
2432
|
+
`}openMobileFilters(t){this.isMobile&&(this.mobileMenuOpen=!0,this.displayFacets=!0,this.scrollToFacet=t)}async firstUpdated(t){var e,i;super.firstUpdated(t),this.initApi(),this.availableContentLocales=null!==(i=await(null===(e=this.api)||void 0===e?void 0:e.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[]))))&&void 0!==i?i:[]}update(t){var e,i,o;if(t.has("labels")&&(this.labelResolver=new a.ParametrizedLabelResolver(_o,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const i=t=>this.availableContentLocales.some((e=>e.lang===t));i(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&i(t.get("contentLocale"))?t.get("contentLocale"):null===(e=this.availableContentLocales[0])||void 0===e?void 0:e.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.recentSearches=JSON.parse(null!==(i=window.localStorage.getItem(this.recentSearchesStorageKey))&&void 0!==i?i:"[]")),t.has("selectedPreset")){const t=this.presets.find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(o=this.presets.find((t=>this.compareRequests(t,this.request))))||void 0===o?void 0:o.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&this.setApi(),["uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateFacets(),["query","uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.updateSuggestions(),["query","uiLocale","contentLocale","searchFilters"].some((e=>t.has(e)))&&this.dispatchEvent(new zo(this.request))}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.setApi(),setTimeout((()=>this.initApi()),100))}setApi(){this.api=window.fluidtopics?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier):void 0}updateFacets(){this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{var t,e;this.facets=null!==(e=await(null===(t=this.api)||void 0===t?void 0:t.search({...this.request,query:""}).then((t=>t.facets)).catch((()=>[]))))&&void 0!==e?e:[],this.facets.forEach((t=>this.knownFacetLabels[t.key]=t.label)),this.facetsLoaded=!0}))):this.facets=[]}updateSuggestions(){this.suggestionsLoaded=!1,this.suggestDebouncer.run((async()=>{this.suggestions=this.api&&this.query.length>2?await this.api.getSuggestions(this.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],this.suggestionsLoaded=!0}))}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.query=e.value,"Enter"===t.key&&this.launchSearch()}onSearchBarKeyDown(t){var e,i;switch(t.key){case"Escape":this.mobileMenuOpen=!1,null===(e=this.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),null===(i=this.firstSuggestion)||void 0===i||i.focus()}}onFloatingContainerKeyUp(t){var e;"Escape"===t.key&&(this.displayFacets=!1,null===(e=this.filtersOpener)||void 0===e||e.focus())}setQuery(t){this.input&&(this.input.value=t),this.query=t}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.setQuery(e),this.launchSearch()}launchSearch(){if(this.query){let t=this.recentSearches.filter((t=>t.toLowerCase()!==this.query.toLowerCase())).filter(((t,e)=>e<20));this.recentSearches=[this.query,...t],this.saveRecentSearches()}this.dispatchEvent(new wo(this.request)),this.mobileMenuOpen=!1,this.displayFacets=!1,this.focus()}saveRecentSearches(){window.localStorage.setItem(this.recentSearchesStorageKey,JSON.stringify(this.recentSearches))}connectedCallback(){super.connectedCallback(),document.addEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}updateSize(t){this.sizeCategory=t.detail.category}getLocaleLabel(t){var e;return null!==(e=this.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}setFilter(t,e){let i=this.searchFilters.filter((e=>e.key!==t));this.facets.forEach((i=>{i.key===t&&Jt(i.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=e.includes(t.value)))})),e.length&&i.push({key:t,negative:!1,values:e}),this.searchFilters=i,this.scrollToFacet=t}setFiltersFromPreset(t){null!=t&&(null!=t.contentLocale&&(this.contentLocale=t.contentLocale),this.searchFilters=t.filters)}clearFilters(){this.facets.forEach((t=>Jt(t.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=!1)))),this.searchFilters=[];const t=this.facets[0];this.scrollToFacet=null==t?void 0:t.key}removeRecentSearch(t,e){var i,o,r,a;t.preventDefault(),t.stopPropagation();const c=null!==(a=null!==(o=null===(i=this.focusedSuggestion)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:null===(r=this.focusedSuggestion)||void 0===r?void 0:r.nextElementSibling)&&void 0!==a?a:this.input;null==c||c.focus(),this.recentSearches=this.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.saveRecentSearches()}onSuggestKeyDown(t){var e,i,o,r,a,c;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.focusedSuggestion)||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.lastSuggestion)||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(c=null!==(a=null===(r=this.focusedSuggestion)||void 0===r?void 0:r.nextElementSibling)&&void 0!==a?a:this.firstSuggestion)||void 0===c||c.focus(),t.preventDefault(),t.stopPropagation()}}},t.FtSearchBar.elementDefinitions={"ft-accordion":Qi,"ft-accordion-item":Ji,"ft-button":Qe,"ft-chip":so,"ft-filter":Ii,"ft-filter-option":wi,"ft-icon":qi,"ft-ripple":Fe,"ft-select":bo,"ft-select-option":uo,"ft-size-watcher":p,"ft-snap-scroll":$i,"ft-tooltip":He,"ft-typography":Xt,"mwc-icon":Re},$o([i.property({type:Boolean})],t.FtSearchBar.prototype,"dense",void 0),$o([i.property({type:String})],t.FtSearchBar.prototype,"baseUrl",void 0),$o([i.property({type:String})],t.FtSearchBar.prototype,"apiIntegrationIdentifier",void 0),$o([i.property({type:String})],t.FtSearchBar.prototype,"contentLocale",void 0),$o([i.state()],t.FtSearchBar.prototype,"availableContentLocales",void 0),$o([i.property({type:String})],t.FtSearchBar.prototype,"uiLocale",void 0),$o([a.jsonProperty({})],t.FtSearchBar.prototype,"labels",void 0),$o([a.jsonProperty([])],t.FtSearchBar.prototype,"displayedFilters",void 0),$o([a.jsonProperty([])],t.FtSearchBar.prototype,"presets",void 0),$o([i.property({type:String,reflect:!0})],t.FtSearchBar.prototype,"selectedPreset",void 0),$o([i.property()],t.FtSearchBar.prototype,"searchRequestSerializer",void 0),$o([i.state()],t.FtSearchBar.prototype,"searchFilters",void 0),$o([i.state()],t.FtSearchBar.prototype,"sizeCategory",void 0),$o([i.state()],t.FtSearchBar.prototype,"displayFacets",void 0),$o([i.state()],t.FtSearchBar.prototype,"mobileMenuOpen",void 0),$o([i.state()],t.FtSearchBar.prototype,"facets",void 0),$o([i.query(".ft-search-bar--container")],t.FtSearchBar.prototype,"container",void 0),$o([i.query(".ft-search-bar--filters-opener")],t.FtSearchBar.prototype,"filtersOpener",void 0),$o([i.query(".ft-search-bar--floating-panel")],t.FtSearchBar.prototype,"floatingContainer",void 0),$o([i.query("ft-snap-scroll.ft-search-bar--filters-container")],t.FtSearchBar.prototype,"scrollingFiltersContainer",void 0),$o([i.query(".ft-search-bar--input")],t.FtSearchBar.prototype,"input",void 0),$o([i.state()],t.FtSearchBar.prototype,"query",void 0),$o([i.state()],t.FtSearchBar.prototype,"suggestions",void 0),$o([i.state()],t.FtSearchBar.prototype,"suggestionsLoaded",void 0),$o([i.state()],t.FtSearchBar.prototype,"recentSearches",void 0),$o([i.state()],t.FtSearchBar.prototype,"scrollToFacet",void 0),$o([i.query(".ft-search-bar--suggestion:first-child")],t.FtSearchBar.prototype,"firstSuggestion",void 0),$o([i.query(".ft-search-bar--suggestion:focus-within")],t.FtSearchBar.prototype,"focusedSuggestion",void 0),$o([i.query(".ft-search-bar--suggestion:last-child")],t.FtSearchBar.prototype,"lastSuggestion",void 0),$o([i.state()],t.FtSearchBar.prototype,"api",void 0),t.FtSearchBar=$o([a.customElement("ft-search-bar")],t.FtSearchBar),t.DEFAULT_LABELS=_o,t.FtSearchBarCssVariables=go,t.LaunchSearchEvent=wo,t.SearchStateChangeEvent=zo,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.wcUtils,ftGlobals.litStyleMap,ftGlobals.litUnsafeHTML);
|