@fluid-topics/ft-search-saved-searches 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/build/ft-search-saved-search.d.ts +27 -0
- package/build/ft-search-saved-search.js +169 -0
- package/build/ft-search-saved-searches.css.d.ts +15 -0
- package/build/ft-search-saved-searches.css.js +27 -0
- package/build/ft-search-saved-searches.d.ts +30 -0
- package/build/ft-search-saved-searches.js +151 -0
- package/build/ft-search-saved-searches.light.js +899 -0
- package/build/ft-search-saved-searches.min.js +1026 -0
- package/build/ft-search-saved-searches.properties.d.ts +6 -0
- package/build/ft-search-saved-searches.properties.js +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +6 -0
- package/build/utils/SavedSearchesComponentMessages.d.ts +6 -0
- package/build/utils/SavedSearchesComponentMessages.js +17 -0
- package/package.json +33 -0
|
@@ -0,0 +1,899 @@
|
|
|
1
|
+
!function(t,i,e,o,n,s,r){const a=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),l={color:a,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",a),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:i.FtCssVariableFactory.create("--ft-ripple-border-radius","SIZE","0px")},h=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),c=h,p=i.FtCssVariableFactory.extend("--ft-ripple-background-color",h),d=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),f=d,u=i.FtCssVariableFactory.extend("--ft-ripple-background-color",d),v=e.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ft-ripple {
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset: 0;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
border-radius: ${l.borderRadius};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ft-ripple .ft-ripple--background,
|
|
18
|
+
.ft-ripple .ft-ripple--effect {
|
|
19
|
+
position: absolute;
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ft-ripple .ft-ripple--background {
|
|
24
|
+
background-color: ${l.backgroundColor};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ft-ripple .ft-ripple--effect {
|
|
28
|
+
background-color: ${l.color};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
32
|
+
background-color: ${u};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
36
|
+
background-color: ${f};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
40
|
+
background-color: ${p};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
44
|
+
background-color: ${c};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ft-ripple .ft-ripple--background {
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
height: 100%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
transition: opacity 75ms linear;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ft-ripple .ft-ripple--effect,
|
|
56
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ft-ripple .ft-ripple--effect {
|
|
61
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
62
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
66
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
67
|
+
left: 50%;
|
|
68
|
+
top: 50%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
72
|
+
transform: translate(-50%, -50%);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
76
|
+
opacity: ${l.opacityContentOnSurfaceHover};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
80
|
+
opacity: ${l.opacityContentOnSurfaceSelected};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
84
|
+
opacity: ${l.opacityContentOnSurfaceFocused};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
88
|
+
opacity: ${l.opacityContentOnSurfacePressed};
|
|
89
|
+
transform: translate(-50%, -50%) scale(1);
|
|
90
|
+
}
|
|
91
|
+
`;var g,y=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class b extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new i.Debouncer(10),this.moveRipple=t=>{var i,e;let{x:o,y:n}=this.getCoordinates(t),s=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-s.x:s.width/2),this.originY=Math.round(null!=n?n-s.y:s.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
92
|
+
<style>
|
|
93
|
+
.ft-ripple .ft-ripple--effect,
|
|
94
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
95
|
+
width: ${this.rippleSize}px;
|
|
96
|
+
height: ${this.rippleSize}px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ft-ripple .ft-ripple--effect {
|
|
100
|
+
left: ${this.originX}px;
|
|
101
|
+
top: ${this.originY}px;
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
104
|
+
<div class="${n.classMap(t)}">
|
|
105
|
+
<div class="ft-ripple--background"></div>
|
|
106
|
+
<div class="ft-ripple--effect"></div>
|
|
107
|
+
</div>
|
|
108
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(i=this.target)&&void 0!==i?i:e),this.setRippleSize()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),n=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",n),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",n),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const i=t,e=t;let o,n;return null!=i.x?({x:o,y:n}=i):null!=e.touches&&(o=e.touches[0].clientX,n=e.touches[0].clientY),{x:o,y:n}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}b.elementDefinitions={},b.styles=v,y([o.property({type:Boolean})],b.prototype,"primary",void 0),y([o.property({type:Boolean})],b.prototype,"secondary",void 0),y([o.property({type:Boolean})],b.prototype,"unbounded",void 0),y([o.property({type:Boolean})],b.prototype,"activated",void 0),y([o.property({type:Boolean})],b.prototype,"selected",void 0),y([o.property({type:Boolean})],b.prototype,"disabled",void 0),y([o.state()],b.prototype,"hovered",void 0),y([o.state()],b.prototype,"focused",void 0),y([o.state()],b.prototype,"pressed",void 0),y([o.state()],b.prototype,"rippling",void 0),y([o.state()],b.prototype,"rippleSize",void 0),y([o.state()],b.prototype,"originX",void 0),y([o.state()],b.prototype,"originY",void 0),y([o.query(".ft-ripple")],b.prototype,"ripple",void 0),y([o.query(".ft-ripple--effect")],b.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(b);const x=window,m=x.trustedTypes,$=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",S=`lit$${(Math.random()+"").slice(9)}$`,k="?"+S,E=`<${k}>`,O=document,C=()=>O.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,B="[ \t\n\f\r]",A=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,T=/>/g,R=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,_=/"/g,j=/^(?:script|style|textarea|title)$/i,M=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),L=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),P=new WeakMap,F=O.createTreeWalker(O,129,null,!1),Z=(t,i)=>{const e=t.length-1,o=[];let n,s=2===i?"<svg>":"",r=A;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,c=0;for(;c<e.length&&(r.lastIndex=c,l=r.exec(e),null!==l);)c=r.lastIndex,r===A?"!--"===l[1]?r=N:void 0!==l[1]?r=T:void 0!==l[2]?(j.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=R):void 0!==l[3]&&(r=R):r===R?">"===l[0]?(r=null!=n?n:A,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?R:'"'===l[3]?_:U):r===_||r===U?r=R:r===N||r===T?r=A:(r=R,n=void 0);const p=r===R&&t[i+1].startsWith("/>")?" ":"";s+=r===A?e+E:h>=0?(o.push(a),e.slice(0,h)+w+e.slice(h)+S+p):e+S+(-2===h?(o.push(void 0),i):p)}const a=s+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==$?$.createHTML(a):a,o]};class K{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let n=0,s=0;const r=t.length-1,a=this.parts,[l,h]=Z(t,i);if(this.el=K.createElement(l,e),F.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=F.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith(w)||i.startsWith(S)){const e=h[s++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+w).split(S),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?Y:"?"===i[1]?X:"@"===i[1]?J:q})}else a.push({type:6,index:n})}for(const i of t)o.removeAttribute(i)}if(j.test(o.tagName)){const t=o.textContent.split(S),i=t.length-1;if(i>0){o.textContent=m?m.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],C()),F.nextNode(),a.push({type:2,index:++n});o.append(t[i],C())}}}else if(8===o.nodeType)if(o.data===k)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(S,t+1));)a.push({type:7,index:n}),t+=S.length-1}n++}}static createElement(t,i){const e=O.createElement("template");return e.innerHTML=t,e}}function H(t,i,e=t,o){var n,s,r,a;if(i===L)return i;let l=void 0!==o?null===(n=e._$Co)||void 0===n?void 0:n[o]:e._$Cl;const h=z(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,o)),void 0!==o?(null!==(r=(a=e)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:e._$Cl=l),void 0!==l&&(i=H(t,l._$AS(t,i.values),l,o)),i}class W{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:o}=this._$AD,n=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:O).importNode(e,!0);F.currentNode=n;let s=F.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new G(s,s.nextSibling,this,t):1===l.type?i=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(i=new Q(s,this,t)),this._$AV.push(i),l=o[++a]}r!==(null==l?void 0:l.index)&&(s=F.nextNode(),r++)}return n}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class G{constructor(t,i,e,o){var n;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cp=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=H(this,t,i),z(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==L&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>I(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==D&&z(this._$AH)?this._$AA.nextSibling.data=t:this.$(O.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=K.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===n)this._$AH.v(e);else{const t=new W(n,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new K(t)),i}T(t){I(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const n of t)o===i.length?i.push(e=new G(this.k(C()),this.k(C()),this,this.options)):e=i[o],e._$AI(n),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class q{constructor(t,i,e,o,n){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=n,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=D}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const n=this.strings;let s=!1;if(void 0===n)t=H(this,t,i,0),s=!z(t)||t!==this._$AH&&t!==L,s&&(this._$AH=t);else{const o=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=H(this,o[e+r],i,r),a===L&&(a=this._$AH[r]),s||(s=!z(a)||a!==this._$AH[r]),a===D?t=D:t!==D&&(t+=(null!=a?a:"")+n[r+1]),this._$AH[r]=a}s&&!o&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Y extends q{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const V=m?m.emptyScript:"";class X extends q{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class J extends q{constructor(t,i,e,o,n){super(t,i,e,o,n),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=H(this,t,i,0))&&void 0!==e?e:D)===L)return;const o=this._$AH,n=t===D&&o!==D||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==D&&(o===D||n);n&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}}const tt=x.litHtmlPolyfillSupport;null==tt||tt(K,G),(null!==(g=x.litHtmlVersions)&&void 0!==g?g:x.litHtmlVersions=[]).push("2.7.3");
|
|
109
|
+
/**
|
|
110
|
+
* @license
|
|
111
|
+
* Copyright 2020 Google LLC
|
|
112
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
113
|
+
*/
|
|
114
|
+
const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void 0:t._$litStatic$},ot=t=>({_$litStatic$:t,r:it}),nt=new Map,st=(t=>(i,...e)=>{const o=e.length;let n,s;const r=[],a=[];let l,h=0,c=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(s=e[h],n=et(s));)l+=n+i[++h],c=!0;h!==o&&a.push(s),r.push(l),h++}if(h===o&&r.push(i[o]),c){const t=r.join("$$lit$$");void 0===(i=nt.get(t))&&(r.raw=r,nt.set(t,i=r)),e=a}return t(i,...e)})(M);var rt;!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"}(rt||(rt={}));const at=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),lt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),ht={fontFamily:lt,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},ct=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",at),pt=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",ht.fontSize,"20px"),dt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",ht.fontWeight,"normal"),ft=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",ht.letterSpacing,"0.15px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",ht.lineHeight,"1.2"),vt=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",ht.textTransform,"inherit"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",at),yt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",ht.fontSize,"14px"),bt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",ht.fontWeight,"normal"),xt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",ht.letterSpacing,"0.105px"),mt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",ht.lineHeight,"1.7"),$t=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",ht.textTransform,"inherit"),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",lt),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",ht.fontSize,"16px"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",ht.fontWeight,"600"),Et=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",ht.letterSpacing,"0.144px"),Ot=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",ht.lineHeight,"1.5"),Ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",ht.textTransform,"inherit"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",lt),It=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",ht.fontSize,"14px"),Bt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",ht.fontWeight,"normal"),At=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",ht.letterSpacing,"0.098px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",ht.lineHeight,"1.7"),Tt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",ht.textTransform,"inherit"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",lt),Ut=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",ht.fontSize,"16px"),_t=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",ht.fontWeight,"normal"),jt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",ht.letterSpacing,"0.496px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",ht.lineHeight,"1.5"),Lt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",ht.textTransform,"inherit"),Dt={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",lt),fontSize:i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",ht.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",ht.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",ht.letterSpacing,"0.252px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",ht.lineHeight,"1.4"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",ht.textTransform,"inherit")},Pt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",lt),Ft=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",ht.fontSize,"12px"),Zt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",ht.fontWeight,"normal"),Kt=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",ht.letterSpacing,"0.396px"),Ht=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",ht.lineHeight,"1.33"),Wt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",ht.textTransform,"inherit"),Gt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",lt),qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",ht.fontSize,"10px"),Yt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",ht.fontWeight,"normal"),Vt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",ht.letterSpacing,"0.33px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",ht.lineHeight,"1.6"),Jt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",ht.textTransform,"inherit"),Qt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",lt),ti=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",ht.fontSize,"10px"),ii=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",ht.fontWeight,"normal"),ei=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",ht.letterSpacing,"1.5px"),oi=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",ht.lineHeight,"1.6"),ni=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",ht.textTransform,"uppercase"),si={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",lt),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",ht.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",ht.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",ht.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",ht.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",ht.textTransform,"uppercase")},ri=e.css`
|
|
115
|
+
.ft-typography--title {
|
|
116
|
+
font-family: ${ct};
|
|
117
|
+
font-size: ${pt};
|
|
118
|
+
font-weight: ${dt};
|
|
119
|
+
letter-spacing: ${ft};
|
|
120
|
+
line-height: ${ut};
|
|
121
|
+
text-transform: ${vt};
|
|
122
|
+
}
|
|
123
|
+
`,ai=e.css`
|
|
124
|
+
.ft-typography--title-dense {
|
|
125
|
+
font-family: ${gt};
|
|
126
|
+
font-size: ${yt};
|
|
127
|
+
font-weight: ${bt};
|
|
128
|
+
letter-spacing: ${xt};
|
|
129
|
+
line-height: ${mt};
|
|
130
|
+
text-transform: ${$t};
|
|
131
|
+
}
|
|
132
|
+
`,li=e.css`
|
|
133
|
+
.ft-typography--subtitle1 {
|
|
134
|
+
font-family: ${wt};
|
|
135
|
+
font-size: ${St};
|
|
136
|
+
font-weight: ${kt};
|
|
137
|
+
letter-spacing: ${Et};
|
|
138
|
+
line-height: ${Ot};
|
|
139
|
+
text-transform: ${Ct};
|
|
140
|
+
}
|
|
141
|
+
`,hi=e.css`
|
|
142
|
+
.ft-typography--subtitle2 {
|
|
143
|
+
font-family: ${zt};
|
|
144
|
+
font-size: ${It};
|
|
145
|
+
font-weight: ${Bt};
|
|
146
|
+
letter-spacing: ${At};
|
|
147
|
+
line-height: ${Nt};
|
|
148
|
+
text-transform: ${Tt};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
`,ci=e.css`
|
|
152
|
+
.ft-typography--body1 {
|
|
153
|
+
font-family: ${Rt};
|
|
154
|
+
font-size: ${Ut};
|
|
155
|
+
font-weight: ${_t};
|
|
156
|
+
letter-spacing: ${jt};
|
|
157
|
+
line-height: ${Mt};
|
|
158
|
+
text-transform: ${Lt};
|
|
159
|
+
}
|
|
160
|
+
`,pi=e.css`
|
|
161
|
+
.ft-typography--body2 {
|
|
162
|
+
font-family: ${Dt.fontFamily};
|
|
163
|
+
font-size: ${Dt.fontSize};
|
|
164
|
+
font-weight: ${Dt.fontWeight};
|
|
165
|
+
letter-spacing: ${Dt.letterSpacing};
|
|
166
|
+
line-height: ${Dt.lineHeight};
|
|
167
|
+
text-transform: ${Dt.textTransform};
|
|
168
|
+
}
|
|
169
|
+
`,di=e.css`
|
|
170
|
+
.ft-typography--caption {
|
|
171
|
+
font-family: ${Pt};
|
|
172
|
+
font-size: ${Ft};
|
|
173
|
+
font-weight: ${Zt};
|
|
174
|
+
letter-spacing: ${Kt};
|
|
175
|
+
line-height: ${Ht};
|
|
176
|
+
text-transform: ${Wt};
|
|
177
|
+
}
|
|
178
|
+
`,fi=e.css`
|
|
179
|
+
.ft-typography--breadcrumb {
|
|
180
|
+
font-family: ${Gt};
|
|
181
|
+
font-size: ${qt};
|
|
182
|
+
font-weight: ${Yt};
|
|
183
|
+
letter-spacing: ${Vt};
|
|
184
|
+
line-height: ${Xt};
|
|
185
|
+
text-transform: ${Jt};
|
|
186
|
+
}
|
|
187
|
+
`,ui=e.css`
|
|
188
|
+
.ft-typography--overline {
|
|
189
|
+
font-family: ${Qt};
|
|
190
|
+
font-size: ${ti};
|
|
191
|
+
font-weight: ${ii};
|
|
192
|
+
letter-spacing: ${ei};
|
|
193
|
+
line-height: ${oi};
|
|
194
|
+
text-transform: ${ni};
|
|
195
|
+
}
|
|
196
|
+
`,vi=e.css`
|
|
197
|
+
.ft-typography--button {
|
|
198
|
+
font-family: ${si.fontFamily};
|
|
199
|
+
font-size: ${si.fontSize};
|
|
200
|
+
font-weight: ${si.fontWeight};
|
|
201
|
+
letter-spacing: ${si.letterSpacing};
|
|
202
|
+
line-height: ${si.lineHeight};
|
|
203
|
+
text-transform: ${si.textTransform};
|
|
204
|
+
}
|
|
205
|
+
`,gi=e.css`
|
|
206
|
+
.ft-typography {
|
|
207
|
+
vertical-align: inherit;
|
|
208
|
+
}
|
|
209
|
+
`;var yi=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class bi extends i.FtLitElement{constructor(){super(...arguments),this.variant=rt.body1}render(){return this.element?st`
|
|
210
|
+
<${ot(this.element)}
|
|
211
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
212
|
+
<slot></slot>
|
|
213
|
+
</${ot(this.element)}>
|
|
214
|
+
`:st`
|
|
215
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
216
|
+
`}}bi.styles=[ri,ai,li,hi,ci,pi,di,fi,ui,vi,gi],yi([o.property()],bi.prototype,"element",void 0),yi([o.property()],bi.prototype,"variant",void 0),i.customElement("ft-typography")(bi);const xi={padding:i.FtCssVariableFactory.create("--ft-card-padding","SIZE","12px"),outlineStyle:i.FtCssVariableFactory.create("--ft-card-outline-style","UNKNOWN","solid"),outlineWidth:i.FtCssVariableFactory.create("--ft-card-outline-width","SIZE","0"),outlineColor:i.FtCssVariableFactory.extend("--ft-card-outline-color",i.designSystemVariables.colorPrimary),borderRadius:i.FtCssVariableFactory.extend("--ft-card-border-radius",i.designSystemVariables.borderRadiusM),selectedOutlineStyle:i.FtCssVariableFactory.create("--ft-card-selected-outline-style","UNKNOWN","solid"),selectedOutlineWidth:i.FtCssVariableFactory.create("--ft-card-selected-outline-width","SIZE","2px"),selectedOutlineColor:i.FtCssVariableFactory.extend("--ft-card-selected-outline-color",i.designSystemVariables.colorPrimary),selectedBorderRadius:i.FtCssVariableFactory.extend("--ft-card-selected-border-radius",i.designSystemVariables.borderRadiusM),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),colorOnSurfaceMedium:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceHigh:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceHigh,"Design system"),elevation02:i.FtCssVariableFactory.external(i.designSystemVariables.elevation02,"Design system"),elevation04:i.FtCssVariableFactory.external(i.designSystemVariables.elevation04,"Design system")},mi=e.css`
|
|
217
|
+
:host {
|
|
218
|
+
display: block;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
#container {
|
|
222
|
+
padding: ${xi.padding};
|
|
223
|
+
outline-style: ${xi.outlineStyle};
|
|
224
|
+
outline-width: ${xi.outlineWidth};
|
|
225
|
+
outline-color: ${xi.outlineColor};
|
|
226
|
+
border-radius: ${xi.borderRadius};
|
|
227
|
+
${i.setVariable(l.borderRadius,xi.borderRadius)};
|
|
228
|
+
box-shadow: ${xi.elevation02};
|
|
229
|
+
position: relative;
|
|
230
|
+
width: 100%;
|
|
231
|
+
height: 100%;
|
|
232
|
+
display: grid;
|
|
233
|
+
grid-template:
|
|
234
|
+
"header actions"
|
|
235
|
+
"content content";
|
|
236
|
+
grid-template-columns: minmax(0, 1fr) max-content;
|
|
237
|
+
grid-template-rows: max-content minmax(0, 1fr);
|
|
238
|
+
grid-gap: 8px;
|
|
239
|
+
box-sizing: border-box;
|
|
240
|
+
background-color: ${xi.colorSurface};
|
|
241
|
+
transition: box-shadow 0.2s linear, color 0.2s linear;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
#container.no-header {
|
|
245
|
+
grid-template: "content";
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
#container.no-header #header, #container.no-header #action {
|
|
249
|
+
display: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
#container.selected {
|
|
253
|
+
outline-style: ${xi.selectedOutlineStyle};
|
|
254
|
+
outline-width: ${xi.selectedOutlineWidth};
|
|
255
|
+
outline-color: ${xi.selectedOutlineColor};
|
|
256
|
+
border-radius: ${xi.selectedBorderRadius};
|
|
257
|
+
${i.setVariable(l.borderRadius,xi.selectedBorderRadius)};
|
|
258
|
+
box-shadow: ${xi.elevation04};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
#container.clickable {
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
#container.clickable:hover {
|
|
266
|
+
box-shadow: ${xi.elevation04};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
#header {
|
|
270
|
+
grid-area: header;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.title {
|
|
274
|
+
text-overflow: ellipsis;
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
color: ${xi.colorOnSurfaceHigh};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
#content {
|
|
280
|
+
min-width: 0; /* like with flexbox, some items have a hard time shrinking when necessary */
|
|
281
|
+
grid-area: content;
|
|
282
|
+
color: ${xi.colorOnSurfaceMedium};
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
#action {
|
|
286
|
+
grid-area: actions;
|
|
287
|
+
}
|
|
288
|
+
`;var $i,wi,Si,ki,Ei=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Oi extends i.FtLitElement{constructor(){super(...arguments),this.title="",this.clickable=!1,this.selected=!1,this.noHeader=!1}render(){const t={selected:this.selected,clickable:this.clickable,"no-header":this.noHeader};return e.html`
|
|
289
|
+
<div id="container" part="container" class=${n.classMap(t)}>
|
|
290
|
+
${this.clickable?e.html`
|
|
291
|
+
<ft-ripple primary ?selected=${this.selected}></ft-ripple>
|
|
292
|
+
`:e.nothing}
|
|
293
|
+
<div id="header" part="header">
|
|
294
|
+
<ft-typography class="title" element="span" variant="title">${this.title}</ft-typography>
|
|
295
|
+
<slot name="header"></slot>
|
|
296
|
+
</div>
|
|
297
|
+
<div id="action" part="action">
|
|
298
|
+
<slot name="action"></slot>
|
|
299
|
+
</div>
|
|
300
|
+
<div id="content" part="content">
|
|
301
|
+
<ft-typography variant="body2"><slot></slot></ft-typography>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
`}}Oi.elementDefinitions={"ft-ripple":b,"ft-typography":bi},Oi.styles=mi,Ei([o.property()],Oi.prototype,"title",void 0),Ei([o.property({type:Boolean})],Oi.prototype,"clickable",void 0),Ei([o.property({type:Boolean})],Oi.prototype,"selected",void 0),Ei([o.property({type:Boolean})],Oi.prototype,"noHeader",void 0),i.customElement("ft-card")(Oi);const Ci={activeButtonTextColor:i.FtCssVariableFactory.extend("--ft-search-saved-searches-active-button-text-color",i.designSystemVariables.colorPrimary),activeSearchBackgroundColor:i.FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-background-color",i.designSystemVariables.colorContent),activeSearchBorderStyle:i.FtCssVariableFactory.create("--ft-search-saved-searches-active-search-border-style","UNKNOWN",null!==($i=xi.selectedOutlineStyle.lastResortDefaultValue())&&void 0!==$i?$i:"solid"),activeSearchBorderColor:i.FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-border-color",i.designSystemVariables.colorPrimary),activeSearchBorderWidth:i.FtCssVariableFactory.create("--ft-search-saved-searches-active-search-border-width","SIZE",null!==(wi=xi.selectedOutlineWidth.lastResortDefaultValue())&&void 0!==wi?wi:"2px"),activeSearchBorderRadius:i.FtCssVariableFactory.extend("--ft-search-saved-searches-active-search-border-radius",i.designSystemVariables.borderRadiusM),inactiveButtonTextColor:i.FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-button-text-color",i.designSystemVariables.colorPrimary),inactiveSearchBackgroundColor:i.FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-background-color",i.designSystemVariables.colorContent),inactiveSearchBorderStyle:i.FtCssVariableFactory.create("--ft-search-saved-searches-inactive-search-border-style","UNKNOWN",null!==(Si=xi.outlineStyle.lastResortDefaultValue())&&void 0!==Si?Si:"solid"),inactiveSearchBorderColor:i.FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-border-color",i.designSystemVariables.colorPrimary),inactiveSearchBorderWidth:i.FtCssVariableFactory.create("--ft-search-saved-searches-inactive-search-border-width","SIZE",null!==(ki=xi.outlineWidth.lastResortDefaultValue())&&void 0!==ki?ki:"0"),inactiveSearchBorderRadius:i.FtCssVariableFactory.extend("--ft-search-saved-searches-inactive-search-border-radius",i.designSystemVariables.borderRadiusM)},zi=e.css`
|
|
305
|
+
#container {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
gap: 24px;
|
|
309
|
+
margin: 3px;
|
|
310
|
+
}
|
|
311
|
+
`,Ii=e.css`
|
|
312
|
+
`,Bi=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Ai{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=Bi.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?Ai.build(t):null!==(i=Ai.API)&&void 0!==i?i:Ai.API=Ai.build()}static await(t){return new Promise((i=>{let e=Ai.get(t);if(e)i(e);else{const o=Bi.subscribe((()=>{e=Ai.get(t),e&&(o(),i(e))}))}}))}}var Ni;const Ti=Symbol("clearAfterUnitTest");class Ri{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ni]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=Bi.getState().uiLocale,Bi.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Bi.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const n={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var n,s,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(s=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==s?s:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}Ni=Ti,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Ri((async(t,i)=>(await Ai.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Ri((async(t,i)=>(await Ai.await()).getCustomMessageContext(t,i))));const Ui=window.FluidTopicsI18nService,_i=window.FluidTopicsCustomI18nService;var ji=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Mi extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Ai.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
313
|
+
<slot></slot>
|
|
314
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&Bi.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Bi.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Bi.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Bi.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Bi.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Bi.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Bi.actions.setSession(this.session),t.has("availableUiLocales")&&Bi.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ui.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Mi.elementDefinitions={},Mi.styles=Ii,ji([o.property()],Mi.prototype,"baseUrl",void 0),ji([o.property()],Mi.prototype,"apiIntegrationIdentifier",void 0),ji([o.property()],Mi.prototype,"uiLocale",void 0),ji([i.jsonProperty([])],Mi.prototype,"availableUiLocales",void 0),ji([o.property({type:Boolean})],Mi.prototype,"editorMode",void 0),ji([o.property({type:Boolean})],Mi.prototype,"noCustom",void 0),ji([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Mi.prototype,"noCustomComponent",void 0),ji([o.property({type:Boolean})],Mi.prototype,"withManualResources",void 0),ji([i.jsonProperty([])],Mi.prototype,"messageContexts",void 0),ji([i.jsonProperty(void 0)],Mi.prototype,"session",void 0),ji([o.property({type:Object})],Mi.prototype,"apiProvider",void 0),i.customElement("ft-app-context")(Mi);var Li=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Di extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Pi=Symbol("registerInterval");class Fi extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Pi]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Pi]):this.dispatchEvent(new Di)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=Pi,Li([o.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}var Zi,Ki;!function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_BAR_STACKED="",t.CHART_HEATMAP="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT=""}(Zi||(Zi={})),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=""}(Ki||(Ki={})),new Map([...["abw"].map((t=>[t,Ki.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,Ki.AUDIO])),...["avi"].map((t=>[t,Ki.AVI])),...["chm","xhs"].map((t=>[t,Ki.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,Ki.CODE])),...["csv"].map((t=>[t,Ki.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ki.DITA])),...["epub"].map((t=>[t,Ki.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ki.EXCEL])),...["flac"].map((t=>[t,Ki.FLAC])),...["gif"].map((t=>[t,Ki.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ki.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ki.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,Ki.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ki.JPEG])),...["json"].map((t=>[t,Ki.JSON])),...["m4a","m4p"].map((t=>[t,Ki.M4A])),...["mov","qt"].map((t=>[t,Ki.MOV])),...["mp3"].map((t=>[t,Ki.MP3])),...["mp4","m4v"].map((t=>[t,Ki.MP4])),...["ogg","oga"].map((t=>[t,Ki.OGG])),...["pdf","ps"].map((t=>[t,Ki.PDF])),...["png"].map((t=>[t,Ki.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ki.POWERPOINT])),...["rar"].map((t=>[t,Ki.RAR])),...["stp"].map((t=>[t,Ki.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ki.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,Ki.VIDEO])),...["wav"].map((t=>[t,Ki.WAV])),...["wma"].map((t=>[t,Ki.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ki.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ki.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ki.YAML])),...["zip"].map((t=>[t,Ki.ZIP]))]);const Hi={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Wi=e.css`
|
|
315
|
+
:host, i.ft-icon {
|
|
316
|
+
display: inline-flex;
|
|
317
|
+
align-items: center;
|
|
318
|
+
flex-shrink: 0;
|
|
319
|
+
flex-grow: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
:host {
|
|
323
|
+
width: ${Hi.size};
|
|
324
|
+
height: ${Hi.size};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
i.ft-icon {
|
|
328
|
+
width: 100%;
|
|
329
|
+
height: 100%;
|
|
330
|
+
font-size: ${Hi.size};
|
|
331
|
+
line-height: 1;
|
|
332
|
+
font-weight: normal;
|
|
333
|
+
text-transform: none;
|
|
334
|
+
font-style: normal;
|
|
335
|
+
font-variant: normal;
|
|
336
|
+
speak: none;
|
|
337
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
338
|
+
text-rendering: auto;
|
|
339
|
+
-webkit-font-smoothing: antialiased;
|
|
340
|
+
-moz-osx-font-smoothing: grayscale;
|
|
341
|
+
vertical-align: ${Hi.verticalAlign};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
i.ft-icon.ft-icon--fluid-topics {
|
|
345
|
+
font-family: ${Hi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
346
|
+
|
|
347
|
+
/* Ugly fix because font is broken */
|
|
348
|
+
font-size: calc(0.75 * ${Hi.size});
|
|
349
|
+
line-height: ${Hi.size};
|
|
350
|
+
position: relative;
|
|
351
|
+
top: -4%;
|
|
352
|
+
justify-content: center;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.ft-icon--file-format {
|
|
356
|
+
font-family: ${Hi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.ft-icon--material {
|
|
360
|
+
font-family: ${Hi.materialFontFamily}, "Material Icons", sans-serif;
|
|
361
|
+
}
|
|
362
|
+
`;var Gi;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Gi||(Gi={}));var qi=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Yi extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(Gi).includes(this.variant)?this.variant:Gi.fluid_topics,i=t!==Gi.material||!!this.value;return e.html`
|
|
363
|
+
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
364
|
+
${s.unsafeHTML(this.resolvedIcon)}
|
|
365
|
+
<slot ?hidden=${i}></slot>
|
|
366
|
+
</i>
|
|
367
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case Gi.file_format:this.resolvedIcon=null!==(t=Ki[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Gi.material:this.resolvedIcon=this.value||e.nothing;break;default:this.resolvedIcon=null!==(i=Zi[o.replace("-","_").toUpperCase()])&&void 0!==i?i:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Yi.elementDefinitions={},Yi.styles=Wi,qi([o.property()],Yi.prototype,"variant",void 0),qi([o.property()],Yi.prototype,"value",void 0),qi([o.state()],Yi.prototype,"resolvedIcon",void 0),qi([o.query("slot")],Yi.prototype,"slottedContent",void 0),i.customElement("ft-icon")(Yi);const Vi=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Xi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),Ji=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Qi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),te=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),ie=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),ee=e.css`
|
|
368
|
+
.ft-tooltip--container {
|
|
369
|
+
display: block;
|
|
370
|
+
position: relative;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.ft-tooltip--inline {
|
|
374
|
+
display: inline-block;
|
|
375
|
+
max-width: 100%;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.ft-tooltip {
|
|
379
|
+
position: absolute;
|
|
380
|
+
box-sizing: border-box;
|
|
381
|
+
overflow: hidden;
|
|
382
|
+
width: max-content;
|
|
383
|
+
max-width: ${ie};
|
|
384
|
+
text-align: center;
|
|
385
|
+
padding: ${Vi};
|
|
386
|
+
z-index: ${Qi};
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.ft-tooltip--content {
|
|
390
|
+
padding: 4px 8px;
|
|
391
|
+
border-radius: ${te};
|
|
392
|
+
background-color: ${Ji};
|
|
393
|
+
color: ${Xi};
|
|
394
|
+
top: -500px;
|
|
395
|
+
left: -500px;
|
|
396
|
+
position: relative;
|
|
397
|
+
word-break: break-word;
|
|
398
|
+
}
|
|
399
|
+
`;var oe=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class ne extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
400
|
+
<div part="container"
|
|
401
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
402
|
+
@mouseenter=${this.onHover}
|
|
403
|
+
@mouseleave=${this.onOut}
|
|
404
|
+
@focusin=${this.onHover}
|
|
405
|
+
@focusout=${this.onOut}
|
|
406
|
+
@touchstart=${this.onTouch}>
|
|
407
|
+
<slot></slot>
|
|
408
|
+
<div part="tooltip" role="tooltip" inert
|
|
409
|
+
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
410
|
+
?hidden=${!this.visible}>
|
|
411
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
412
|
+
<slot name="text"></slot>
|
|
413
|
+
<ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
</div>
|
|
417
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let n=0,s=0;switch(this.validPosition){case"top":s=-this.tooltip.clientHeight,n=o;break;case"bottom":s=i.height,n=o;break;case"left":s=e,n=-this.tooltip.clientWidth;break;case"right":s=e,n=i.width}i.left+n+this.tooltip.clientWidth>window.innerWidth&&(n=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+n<0&&(n=4-i.left);const r=this.tooltip.style;r.left=n+"px",r.top=s+"px",r.maxWidth=`max(${i.width}px, ${ie})`}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())}}ne.elementDefinitions={"ft-typography":bi},ne.styles=ee,oe([o.property()],ne.prototype,"text",void 0),oe([o.property({type:Boolean})],ne.prototype,"manual",void 0),oe([o.property({type:Boolean})],ne.prototype,"inline",void 0),oe([o.property({type:Number})],ne.prototype,"delay",void 0),oe([o.property()],ne.prototype,"position",void 0),oe([o.queryAssignedNodes("",!0)],ne.prototype,"slotNodes",void 0),oe([o.query(".ft-tooltip--container")],ne.prototype,"container",void 0),oe([o.query("slot")],ne.prototype,"target",void 0),oe([o.query(".ft-tooltip")],ne.prototype,"tooltip",void 0),oe([o.query(".ft-tooltip--content")],ne.prototype,"tooltipContent",void 0),oe([o.state()],ne.prototype,"visible",void 0),i.customElement("ft-tooltip")(ne);const se={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},re=e.css`
|
|
418
|
+
:host {
|
|
419
|
+
line-height: 0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.ft-loader {
|
|
423
|
+
display: inline-block;
|
|
424
|
+
position: relative;
|
|
425
|
+
|
|
426
|
+
width: ${se.size};
|
|
427
|
+
height: ${se.size};
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.ft-loader div {
|
|
431
|
+
position: absolute;
|
|
432
|
+
top: 37.5%;
|
|
433
|
+
width: 25%;
|
|
434
|
+
height: 25%;
|
|
435
|
+
border-radius: 50%;
|
|
436
|
+
background: ${se.color};
|
|
437
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.ft-loader div:nth-child(1) {
|
|
441
|
+
left: 2.5%;
|
|
442
|
+
animation: appear 0.6s infinite;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.ft-loader div:nth-child(2) {
|
|
446
|
+
left: 2.5%;
|
|
447
|
+
animation: move 0.6s infinite;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.ft-loader div:nth-child(3) {
|
|
451
|
+
left: 37.5%;
|
|
452
|
+
animation: move 0.6s infinite;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.ft-loader div:nth-child(4) {
|
|
456
|
+
left: 72.5%;
|
|
457
|
+
animation: disappear 0.6s infinite;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
@keyframes appear {
|
|
461
|
+
0% {
|
|
462
|
+
transform: scale(0);
|
|
463
|
+
}
|
|
464
|
+
100% {
|
|
465
|
+
transform: scale(1);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
@keyframes disappear {
|
|
470
|
+
0% {
|
|
471
|
+
transform: scale(1);
|
|
472
|
+
}
|
|
473
|
+
100% {
|
|
474
|
+
transform: scale(0);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@keyframes move {
|
|
479
|
+
0% {
|
|
480
|
+
transform: translate(0, 0);
|
|
481
|
+
}
|
|
482
|
+
100% {
|
|
483
|
+
transform: translate(calc(0.35 * ${se.size}), 0);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
`;class ae extends i.FtLitElement{render(){return e.html`
|
|
487
|
+
<div class="ft-loader">
|
|
488
|
+
<div></div>
|
|
489
|
+
<div></div>
|
|
490
|
+
<div></div>
|
|
491
|
+
<div></div>
|
|
492
|
+
</div>
|
|
493
|
+
`}}ae.styles=re,i.customElement("ft-loader")(ae);const le=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),he={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:le,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",si.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",le),verticalPadding:i.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:i.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:i.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},ce=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),pe={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:ce,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",ce)},de=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),fe=i.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),ue=i.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),ve=i.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),ge=[e.css`
|
|
494
|
+
:host {
|
|
495
|
+
display: inline-block;
|
|
496
|
+
max-width: 100%;
|
|
497
|
+
pointer-events: none;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
button {
|
|
501
|
+
box-shadow: 0px 0px 0px transparent;
|
|
502
|
+
border: 0px solid transparent;
|
|
503
|
+
text-shadow: 0px 0px 0px transparent;
|
|
504
|
+
font-size: ${he.fontSize};
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
button:hover {
|
|
508
|
+
box-shadow: 0px 0px 0px transparent;
|
|
509
|
+
border: 0px solid transparent;
|
|
510
|
+
text-shadow: 0px 0px 0px transparent;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
button:active {
|
|
514
|
+
outline: none;
|
|
515
|
+
border: none;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
button:focus {
|
|
519
|
+
outline: 0;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.ft-button {
|
|
523
|
+
position: relative;
|
|
524
|
+
display: flex;
|
|
525
|
+
justify-content: center;
|
|
526
|
+
align-items: center;
|
|
527
|
+
width: 100%;
|
|
528
|
+
overflow: hidden;
|
|
529
|
+
box-sizing: border-box;
|
|
530
|
+
border: none;
|
|
531
|
+
pointer-events: auto;
|
|
532
|
+
|
|
533
|
+
--ft-button-internal-line-height: max(calc(${he.fontSize} + 2px), ${he.iconSize});
|
|
534
|
+
--ft-button-internal-color: ${he.color};
|
|
535
|
+
${i.setVariable(Hi.size,he.iconSize)};
|
|
536
|
+
${i.setVariable(l.color,he.rippleColor)};
|
|
537
|
+
|
|
538
|
+
border-radius: ${he.borderRadius};
|
|
539
|
+
padding: ${he.verticalPadding} ${he.horizontalPadding};
|
|
540
|
+
background-color: ${he.backgroundColor};
|
|
541
|
+
color: var(--ft-button-internal-color);
|
|
542
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.ft-button.ft-button--outlined {
|
|
546
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
547
|
+
padding: calc(${he.verticalPadding} - 1px) calc(${he.horizontalPadding} - 1px);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.ft-button.ft-button--dense {
|
|
551
|
+
padding: ${fe} ${ue};
|
|
552
|
+
border-radius: ${de};
|
|
553
|
+
gap: ${ve};
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.ft-button.ft-button--dense.ft-button--outlined {
|
|
557
|
+
padding: calc(${fe} - 1px) calc(${ue} - 1px);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.ft-button:not([disabled]):hover {
|
|
561
|
+
cursor: pointer;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.ft-button--round {
|
|
565
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${he.verticalPadding});
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.ft-button--round.ft-button--dense {
|
|
569
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${fe});
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.ft-button[disabled] {
|
|
573
|
+
filter: grayscale(1);
|
|
574
|
+
opacity: ${he.opacityDisabled};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.ft-button.ft-button--primary {
|
|
578
|
+
background-color: ${pe.backgroundColor};
|
|
579
|
+
--ft-button-internal-color: ${pe.color};
|
|
580
|
+
${i.setVariable(l.color,pe.rippleColor)};
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.ft-button:focus {
|
|
584
|
+
outline: none;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.ft-button--label {
|
|
588
|
+
position: relative;
|
|
589
|
+
overflow: hidden;
|
|
590
|
+
white-space: nowrap;
|
|
591
|
+
text-overflow: ellipsis;
|
|
592
|
+
display: block;
|
|
593
|
+
margin: 0 ${he.iconPadding};
|
|
594
|
+
${i.setVariable(si.fontSize,"1em")};
|
|
595
|
+
${i.setVariable(si.lineHeight,"var(--ft-button-internal-line-height)")};
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.ft-button--dense .ft-button--label {
|
|
599
|
+
margin: 0 ${ve};
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.ft-button--label[hidden] {
|
|
603
|
+
display: none;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
ft-icon {
|
|
607
|
+
flex-shrink: 0;
|
|
608
|
+
position: relative;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.ft-button--label[hidden] + ft-icon {
|
|
612
|
+
margin: 0 calc(${he.horizontalPadding} * -1);
|
|
613
|
+
padding: 0 ${he.verticalPadding};
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.ft-button--dense .ft-button--label[hidden] + ft-icon {
|
|
617
|
+
margin: 0 calc(${ue} * -1);
|
|
618
|
+
padding: 0 ${fe};
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
622
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
623
|
+
order: -1;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
ft-loader {
|
|
627
|
+
${i.setVariable(se.size,he.iconSize)};
|
|
628
|
+
${i.setVariable(se.color,"var(--ft-button-internal-color)")};
|
|
629
|
+
}
|
|
630
|
+
`,i.noTextSelect];var ye=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class be extends i.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
631
|
+
<button part="button"
|
|
632
|
+
class="${n.classMap(t)}"
|
|
633
|
+
aria-label="${this.getLabel()}"
|
|
634
|
+
?disabled=${this.isDisabled()}>
|
|
635
|
+
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
636
|
+
<ft-typography part="label"
|
|
637
|
+
variant="button"
|
|
638
|
+
element="span"
|
|
639
|
+
class="ft-button--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
640
|
+
?hidden=${!this.hasTextContent()}>
|
|
641
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
642
|
+
</ft-typography>
|
|
643
|
+
${this.resolveIcon()}
|
|
644
|
+
</button>
|
|
645
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
646
|
+
<ft-tooltip part="tooltip"
|
|
647
|
+
text="${this.getLabel()}"
|
|
648
|
+
position="${this.tooltipPosition}">
|
|
649
|
+
${t}
|
|
650
|
+
</ft-tooltip>
|
|
651
|
+
`:t}resolveIcon(){return this.loading?e.html`
|
|
652
|
+
<ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
|
|
653
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}be.elementDefinitions={"ft-ripple":b,"ft-tooltip":ne,"ft-typography":bi,"ft-icon":Yi,"ft-loader":ae},be.styles=[i.safariEllipsisFix,ge],ye([o.property({type:String,reflect:!0})],be.prototype,"role",void 0),ye([o.property({type:Boolean})],be.prototype,"primary",void 0),ye([o.property({type:Boolean})],be.prototype,"outlined",void 0),ye([o.property({type:Boolean})],be.prototype,"disabled",void 0),ye([o.property({type:Boolean})],be.prototype,"dense",void 0),ye([o.property({type:Boolean})],be.prototype,"round",void 0),ye([o.property()],be.prototype,"label",void 0),ye([o.property()],be.prototype,"icon",void 0),ye([o.property()],be.prototype,"iconVariant",void 0),ye([o.property({type:Boolean})],be.prototype,"trailingIcon",void 0),ye([o.property({type:Boolean})],be.prototype,"loading",void 0),ye([o.property()],be.prototype,"tooltipPosition",void 0),ye([o.property({type:Boolean})],be.prototype,"hideTooltip",void 0),ye([o.property({type:Boolean})],be.prototype,"forceTooltip",void 0),ye([o.query(".ft-button")],be.prototype,"button",void 0),ye([o.query(".ft-button--label slot")],be.prototype,"slottedContent",void 0),i.customElement("ft-button")(be);const xe=e.css`
|
|
654
|
+
`;var me=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};const $e=Symbol("i18nProperties"),we=Symbol("i18nUnsubs");function Se(t){var i;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[i]=new Map}get i18nService(){return this.useCustomMessageContexts?_i:Ui}i18n(t,i,...e){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,i,...e);const n=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...n)}onI18nUpdate(t){var i;null===(i=this[$e])||void 0===i||i.forEach(((i,e)=>{i.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(i))})),setTimeout((()=>this.requestUpdate()),0)}updated(t){var i;super.updated(t),null===(i=this[$e])||void 0===i||i.forEach(((t,i)=>{null!=t.argsProvider&&(this[i]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[$e]&&new Set([...this[$e].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,i){t=t.toLowerCase(),this[we].has(t)||this[we].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=i?i:{})}addI18nContext(t,i){this.addI18nMessages(t.name,i)}disconnectedCallback(){super.disconnectedCallback(),this[we].forEach((t=>t())),this[we].clear()}}return i=we,me([o.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class ke extends(Se(i.FtLitElement)){}class Ee extends(Se(i.FtLitElementRedux)){}var Oe=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Ce extends Ee{constructor(){super(),this.editorMode=!1,this.addStore(Bi)}render(){return this.key&&this.context?e.html`
|
|
655
|
+
<span class="ft-i18n">${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}</span>
|
|
656
|
+
`:this.editorMode?"Select a context and a label key.":e.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}Ce.elementDefinitions={},Ce.styles=xe,Oe([i.redux()],Ce.prototype,"editorMode",void 0),Oe([o.property()],Ce.prototype,"context",void 0),Oe([o.property()],Ce.prototype,"key",void 0),Oe([i.jsonProperty([])],Ce.prototype,"args",void 0),Oe([o.property()],Ce.prototype,"defaultMessage",void 0);class ze{static build(t){return new ze(t)}static fromGwt(t){return new ze(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,i)=>{const e=i;return t=>({context:this.name,key:e,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,i)=>(...t)=>Ui.resolveMessage(this.name,i,...t)})}}i.customElement("ft-i18n")(Ce);const Ie=ze.build("savedSearchesComponent"),Be={displaySavedSearchesHere:"Display saved searches here.",missingRole:"Saved search unavailable: missing role {0}.",keywords:"Keywords",language:"Language",sort:"Sort",period:"Period",relevance:"Relevance",lastUpdate:"Last update",lastWeek:"Less than one week",lastMonth:"Less than one month",lastYear:"Less than one year",customPeriod:"Custom period",search:"Search"},Ae=i.FtCssVariableFactory.extend("--ft-chip-color",i.designSystemVariables.colorOnSurface),Ne={backgroundColor:i.FtCssVariableFactory.extend("--ft-chip-background-color",i.designSystemVariables.colorSurface),color:Ae,fontSize:i.FtCssVariableFactory.extend("--ft-chip-font-size",Dt.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:i.FtCssVariableFactory.extend("--ft-chip-ripple-color",Ae),horizontalPadding:i.FtCssVariableFactory.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:i.FtCssVariableFactory.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},Te=i.FtCssVariableFactory.extend("--ft-chip-highlighted-color",i.FtCssVariableFactory.extend("--ft-chip-color",i.designSystemVariables.colorOnPrimary)),Re={backgroundColor:i.FtCssVariableFactory.extend("--ft-chip-highlighted-background-color",i.FtCssVariableFactory.extend("--ft-chip-background-color",i.designSystemVariables.colorPrimary)),color:Te,rippleColor:i.FtCssVariableFactory.extend("--ft-chip-highlighted-ripple-color",Te)},Ue=i.FtCssVariableFactory.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),_e=i.FtCssVariableFactory.create("--ft-chip-dense-vertical-padding","SIZE","4px"),je=[i.noTextSelect,e.css`
|
|
657
|
+
:host {
|
|
658
|
+
display: inline-block;
|
|
659
|
+
max-width: 100%;
|
|
660
|
+
pointer-events: none;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.ft-chip {
|
|
664
|
+
position: relative;
|
|
665
|
+
display: flex;
|
|
666
|
+
justify-content: center;
|
|
667
|
+
align-items: center;
|
|
668
|
+
width: 100%;
|
|
669
|
+
box-sizing: border-box;
|
|
670
|
+
pointer-events: auto;
|
|
671
|
+
|
|
672
|
+
--ft-chip-internal-font-size: ${Ne.fontSize};
|
|
673
|
+
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
674
|
+
${i.setVariable(Hi.size,Ne.iconSize)};
|
|
675
|
+
--ft-chip-internal-vertical-padding: ${Ne.verticalPadding};
|
|
676
|
+
--ft-chip-internal-horizontal-padding: ${Ne.horizontalPadding};
|
|
677
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
678
|
+
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${Ne.iconSize});
|
|
679
|
+
|
|
680
|
+
border: 1px solid ${Ne.colorOutline};
|
|
681
|
+
color: ${Ne.color};
|
|
682
|
+
${i.setVariable(l.color,Ne.rippleColor)};
|
|
683
|
+
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
684
|
+
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
685
|
+
background-color: ${Ne.backgroundColor};
|
|
686
|
+
line-height: var(--ft-chip-internal-content-height);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.ft-chip > *:not(ft-ripple) {
|
|
690
|
+
position: relative;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.ft-chip--dense {
|
|
694
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
695
|
+
--ft-chip-internal-vertical-padding: ${_e};
|
|
696
|
+
--ft-chip-internal-horizontal-padding: ${Ue};
|
|
697
|
+
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.ft-chip--no-content {
|
|
701
|
+
--ft-chip-internal-horizontal-padding: var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding));
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.ft-chip--disabled {
|
|
705
|
+
cursor: default;
|
|
706
|
+
pointer-events: none;
|
|
707
|
+
filter: grayscale(1);
|
|
708
|
+
opacity: ${Ne.opacityDisabled};
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.ft-chip--highlighted {
|
|
712
|
+
border: none;
|
|
713
|
+
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
714
|
+
background-color: ${Re.backgroundColor};
|
|
715
|
+
${i.setVariable(l.color,Re.rippleColor)};
|
|
716
|
+
color: ${Re.color};
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.ft-chip--clickable {
|
|
720
|
+
cursor: pointer;
|
|
721
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.ft-chip:focus {
|
|
725
|
+
outline: none;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.ft-chip--icon-container {
|
|
729
|
+
display: inline-flex;
|
|
730
|
+
position: relative;
|
|
731
|
+
overflow: hidden;
|
|
732
|
+
border-radius: 100%;
|
|
733
|
+
justify-content: center;
|
|
734
|
+
align-items: center;
|
|
735
|
+
flex-shrink: 0;
|
|
736
|
+
|
|
737
|
+
padding: var(--ft-chip-internal-icon-padding);
|
|
738
|
+
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.ft-chip--icon-container > *:not(ft-ripple) {
|
|
742
|
+
position: relative;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.ft-chip--icon-button {
|
|
746
|
+
${i.setVariable(he.iconSize,Ne.iconSize)};
|
|
747
|
+
${i.setVariable(he.horizontalPadding,"var(--ft-chip-internal-icon-padding)")};
|
|
748
|
+
${i.setVariable(he.verticalPadding,"var(--ft-chip-internal-icon-padding)")};
|
|
749
|
+
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.ft-chip--label {
|
|
753
|
+
vertical-align: bottom;
|
|
754
|
+
display: block;
|
|
755
|
+
margin: 0 var(--ft-chip-internal-horizontal-padding);
|
|
756
|
+
${i.setVariable(Dt.fontSize,"var(--ft-chip-internal-font-size)")};
|
|
757
|
+
${i.setVariable(Dt.lineHeight,"var(--ft-chip-internal-content-height)")};
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.ft-chip--safari-fix .ft-chip--label {
|
|
761
|
+
margin-right: 0;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.ft-chip:not(.ft-chip--multi-line) .ft-chip--label {
|
|
765
|
+
overflow: hidden;
|
|
766
|
+
white-space: nowrap;
|
|
767
|
+
text-overflow: ellipsis;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.ft-chip--safari-fix:not(.ft-chip--multi-line) .ft-chip--label:after {
|
|
771
|
+
content: "\\0000a0";
|
|
772
|
+
display: inline-block;
|
|
773
|
+
width: 0;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.ft-chip--no-content .ft-chip--label {
|
|
777
|
+
display: none;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.ft-chip--no-content .ft-chip--label + .ft-chip--icon-container {
|
|
781
|
+
width: var(--ft-chip-internal-content-height);
|
|
782
|
+
height: var(--ft-chip-internal-content-height);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.ft-chip--icon-container:focus {
|
|
786
|
+
outline: none;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container,
|
|
790
|
+
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-button {
|
|
791
|
+
order: -1;
|
|
792
|
+
}
|
|
793
|
+
`];var Me=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Le extends CustomEvent{constructor(){super("icon-click")}}class De extends i.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.iconLabel="",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":i.isSafari};return e.html`
|
|
794
|
+
<div class="${n.classMap(t)}"
|
|
795
|
+
aria-label="${this.getLabel()}"
|
|
796
|
+
tabindex="${this.interactionsOnChip?0:-1}"
|
|
797
|
+
@keyup=${this.onKeyUp}>
|
|
798
|
+
<ft-ripple ?disabled=${!this.interactionsOnChip}></ft-ripple>
|
|
799
|
+
<ft-typography variant="body2" element="span" class="ft-chip--label">
|
|
800
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
801
|
+
</ft-typography>
|
|
802
|
+
${this.internalIcon?this.renderIcon():null}
|
|
803
|
+
</div>
|
|
804
|
+
`}get interactionsOnChip(){return this.clickable&&!this.disabled}get interactionsOnIcon(){return(this.iconClickable||this.removable)&&!this.disabled}renderIcon(){return this.interactionsOnIcon?e.html`
|
|
805
|
+
<ft-button round
|
|
806
|
+
class="ft-chip--icon-button"
|
|
807
|
+
@click=${this.onIconClick}
|
|
808
|
+
.iconVariant=${this.iconVariant}
|
|
809
|
+
icon="${this.internalIcon}"
|
|
810
|
+
label="${this.iconLabel}"
|
|
811
|
+
></ft-button>
|
|
812
|
+
`:e.html`
|
|
813
|
+
<div class="ft-chip--icon-container ft-no-text-select">
|
|
814
|
+
<ft-icon .variant=${this.iconVariant} .value="${this.internalIcon}"></ft-icon>
|
|
815
|
+
</div>
|
|
816
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new Le))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new Le))}getLabel(){return this.label||this.textContent}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}get internalIcon(){return this.icon||(this.removable?"close":void 0)}}De.elementDefinitions={"ft-ripple":b,"ft-typography":bi,"ft-icon":Yi,"ft-button":be},De.styles=je,Me([o.property({type:Boolean})],De.prototype,"highlighted",void 0),Me([o.property({type:Boolean})],De.prototype,"removable",void 0),Me([o.property({type:Boolean})],De.prototype,"disabled",void 0),Me([o.property({type:Boolean})],De.prototype,"clickable",void 0),Me([o.property({type:Boolean})],De.prototype,"iconClickable",void 0),Me([o.property({type:Boolean})],De.prototype,"dense",void 0),Me([o.property({type:Boolean})],De.prototype,"multiLine",void 0),Me([o.property()],De.prototype,"label",void 0),Me([o.property()],De.prototype,"iconLabel",void 0),Me([o.property()],De.prototype,"icon",void 0),Me([o.property()],De.prototype,"iconVariant",void 0),Me([o.property({type:Boolean})],De.prototype,"trailingIcon",void 0),Me([o.query("ft-typography slot")],De.prototype,"slottedContent",void 0),i.customElement("ft-chip")(De);var Pe=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Fe extends(Se(Fi)){constructor(){super(),this.showDescription=!1,this.showSearchFilters=!1,this.showSearchButton=!1,this.showAlertStatus=!1,this.selected=!1,this.addI18nContext(Ie,Be)}render(){var t;return e.html`
|
|
817
|
+
<ft-card title="${null===(t=this.search)||void 0===t?void 0:t.title}" clickable ?selected="${this.selected}">
|
|
818
|
+
${this.renderAlertStatus()}
|
|
819
|
+
<div id="container">
|
|
820
|
+
${this.renderDescription()}
|
|
821
|
+
${this.renderSearchFilters()}
|
|
822
|
+
${this.renderSearchButton()}
|
|
823
|
+
</div>
|
|
824
|
+
</ft-card>
|
|
825
|
+
`}renderDescription(){var t;return this.showDescription?e.html`<div id="description" class="content">${null===(t=this.search)||void 0===t?void 0:t.description}</div>`:e.nothing}renderSearchButton(){return this.showSearchButton?e.html`<div id="searchButton" class="content"><ft-button id="search" icon="search">${Ie.messages.search()}</ft-button></div>`:e.nothing}renderAlertStatus(){var t;return this.showAlertStatus&&(null===(t=this.search)||void 0===t?void 0:t.alert)?e.html`<ft-icon id="alertStatus" slot="header">alert</ft-icon>`:e.nothing}renderSearchFilters(){var t,i,o,n,s,r,a,l,h,c,p,d,f,u;return this.showSearchFilters?e.html`<div id="searchFilters" class="content">
|
|
826
|
+
${null!==(i=null===(t=this.search)||void 0===t?void 0:t.searchRequest.query.length)&&void 0!==i&&i?this.renderMetadata(Ie.messages.keywords(),null===(o=this.search)||void 0===o?void 0:o.searchRequest.query,!0):e.nothing}
|
|
827
|
+
${null===(n=this.search)||void 0===n?void 0:n.searchRequest.filters.map((t=>this.renderMetadata(t.label,t.values)))}
|
|
828
|
+
${null!==(a=null===(r=null===(s=this.search)||void 0===s?void 0:s.searchRequest.contentLocale)||void 0===r?void 0:r.length)&&void 0!==a&&a?this.renderMetadata(Ie.messages.language(),null===(l=this.search)||void 0===l?void 0:l.searchRequest.contentLocale,!0):e.nothing}
|
|
829
|
+
${null!==(p=null===(c=null===(h=this.search)||void 0===h?void 0:h.searchRequest.sort[0])||void 0===c?void 0:c.key.length)&&void 0!==p&&p?this.renderMetadata(Ie.messages.sort(),this.mapSortKey(null===(d=this.search)||void 0===d?void 0:d.searchRequest.sort[0].key),!0):e.nothing}
|
|
830
|
+
${(null===(f=this.search)||void 0===f?void 0:f.searchRequest.periodFilter)?this.renderMetadata(Ie.messages.period(),this.mapPeriodFilter(null===(u=this.search)||void 0===u?void 0:u.searchRequest.periodFilter),!0):e.nothing}
|
|
831
|
+
</div>`:e.nothing}renderMetadata(t,i,o=!1){return e.html`<ft-chip dense ?highlighted=${o}><span class="metadata-label">${t}</span><span class="metadata-values">${Array.isArray(i)?i.join(", "):i}</span></ft-chip>`}mapSortKey(t){switch(t){case"afs:relevance":return Ie.messages.relevance();case"ft:lastEdition":return Ie.messages.lastUpdate();default:return t}}mapPeriodFilter(t){switch(t.periodType){case"LAST_WEEK":return Ie.messages.lastWeek();case"LAST_MONTH":return Ie.messages.lastMonth();case"LAST_YEAR":return Ie.messages.lastYear();case"CUSTOM":return Ie.messages.customPeriod();default:return"--"}}}Fe.elementDefinitions={"ft-icon":Yi,"ft-card":Oi,"ft-chip":De,"ft-button":be},Fe.styles=e.css`
|
|
832
|
+
ft-card {
|
|
833
|
+
${i.setVariable(xi.outlineStyle,Ci.inactiveSearchBorderStyle)};
|
|
834
|
+
${i.setVariable(xi.outlineWidth,Ci.inactiveSearchBorderWidth)};
|
|
835
|
+
${i.setVariable(xi.outlineColor,Ci.inactiveSearchBorderColor)};
|
|
836
|
+
${i.setVariable(xi.borderRadius,Ci.inactiveSearchBorderRadius)};
|
|
837
|
+
${i.setVariable(xi.selectedOutlineStyle,Ci.activeSearchBorderStyle)};
|
|
838
|
+
${i.setVariable(xi.selectedOutlineWidth,Ci.activeSearchBorderWidth)};
|
|
839
|
+
${i.setVariable(xi.selectedOutlineColor,Ci.activeSearchBorderColor)};
|
|
840
|
+
${i.setVariable(xi.selectedBorderRadius,Ci.activeSearchBorderRadius)};
|
|
841
|
+
${i.setVariable(l.backgroundColor,Ci.inactiveSearchBackgroundColor)};
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
ft-card[selected] {
|
|
845
|
+
${i.setVariable(l.backgroundColor,Ci.activeSearchBackgroundColor)};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
#search {
|
|
849
|
+
${i.setVariable(he.color,Ci.inactiveButtonTextColor)};
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
ft-card[selected] #search {
|
|
853
|
+
${i.setVariable(he.color,Ci.activeButtonTextColor)};
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
#searchFilters {
|
|
857
|
+
display: flex;
|
|
858
|
+
gap: 4px;
|
|
859
|
+
flex-wrap: wrap;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.content {
|
|
863
|
+
margin-bottom: 8px;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.content:last-child {
|
|
867
|
+
margin-bottom: 0;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
ft-card::part(header) {
|
|
871
|
+
display: flex;
|
|
872
|
+
justify-content: space-between;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
.metadata-label:after {
|
|
876
|
+
content: ":";
|
|
877
|
+
margin-right: 0.4em;
|
|
878
|
+
margin-left: 0.2em;
|
|
879
|
+
}
|
|
880
|
+
`,Pe([o.property()],Fe.prototype,"search",void 0),Pe([o.property({type:Boolean})],Fe.prototype,"showDescription",void 0),Pe([o.property({type:Boolean})],Fe.prototype,"showSearchFilters",void 0),Pe([o.property({type:Boolean})],Fe.prototype,"showSearchButton",void 0),Pe([o.property({type:Boolean})],Fe.prototype,"showAlertStatus",void 0),Pe([o.property({type:Boolean})],Fe.prototype,"selected",void 0);const Ze=require("./node-ponyfill"),Ke=Ze.fetch.bind({});var He,We,Ge,qe,Ye,Ve,Xe,Je,Qe;Ke.polyfill=!0,global.fetch||(global.fetch=Ke,global.Response=Ze.Response,global.Headers=Ze.Headers,global.Request=Ze.Request),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(He||(He={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(We||(We={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(Ge||(Ge={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(qe||(qe={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Ye||(Ye={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Ve||(Ve={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Xe||(Xe={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Je||(Je={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Qe||(Qe={}));class to{async listMySearches(){var t;return(null===(t=Bi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Ai.await()).listMySearches(Bi.getState().session.profile.userId):[]}}const io=i.FtReduxStore.get({name:"ft-user-assets",reducers:{setSavedSearches:(t,i)=>{t.savedSearches=i.payload}},initialState:{savedSearches:void 0}});const eo=new class{clear(){this.clearMySearches()}clearMySearches(){io.actions.setSavedSearches(void 0)}async reloadMySearches(){const t=new to,i=await t.listMySearches();io.actions.setSavedSearches(i)}};var oo=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class no extends(Se(Fi)){constructor(){super(),this.showDescription=!1,this.showSearchFilters=!1,this.showSearchButton=!1,this.showAlertStatus=!1,this.editorMode=!1,this.requiredRole=Qe.SAVED_SEARCH_USER,this.addStore(Bi),this.addStore(io),this.addI18nContext(Ie,Be)}render(){var t;return this.editorMode&&!this.userHasRights?e.html`<ft-typography>${Ie.messages.missingRole(this.requiredRole)}</ft-typography>`:this.editorMode&&this.isEmpty?e.html`<ft-typography>${Ie.messages.displaySavedSearchesHere()}</ft-typography>`:this.userHasRights&&!this.isEmpty?e.html`
|
|
881
|
+
<div id="container">
|
|
882
|
+
${r.repeat(null!==(t=this.savedSearches)&&void 0!==t?t:[],(t=>t.id),(t=>e.html`
|
|
883
|
+
<ft-search-saved-search
|
|
884
|
+
.search=${t}
|
|
885
|
+
?showDescription=${this.showDescription}
|
|
886
|
+
?showSearchFilters=${this.showSearchFilters}
|
|
887
|
+
?showSearchButton=${this.showSearchButton}
|
|
888
|
+
?showAlertStatus=${this.showAlertStatus}
|
|
889
|
+
?selected=${this.isSelected(t.searchRequest)}
|
|
890
|
+
@click=${i=>this.setSearch(t.searchRequest)}
|
|
891
|
+
></ft-search-saved-search>`))}
|
|
892
|
+
</div>
|
|
893
|
+
`:e.html`
|
|
894
|
+
<style>
|
|
895
|
+
:host {
|
|
896
|
+
display: none !important;
|
|
897
|
+
}
|
|
898
|
+
</style>
|
|
899
|
+
`}get userHasRights(){var t;return!!(null===(t=this.user)||void 0===t?void 0:t.roles.includes(this.requiredRole))}get isEmpty(){var t;return 0==(null!==(t=this.savedSearches)&&void 0!==t?t:[]).length}isSelected(t){var e;const o=null===(e=this.stateManager)||void 0===e?void 0:e.store.getState().request;return null!=o&&i.deepEqual(o.query,t.query)&&i.deepEqual([...o.filters],[...t.filters])&&i.deepEqual([...o.sort].map(this.mapFtSearchSortCriterion),[...t.sort].map(this.mapFtSearchSortCriterion))&&i.deepEqual(o.contentLocale,t.contentLocale)&&i.deepEqual(o.periodFilter,t.periodFilter)}mapFtSearchSortCriterion(t){return{...t}}toFtSearchRequest(t){return null==this.stateManager?void 0:{...this.stateManager.store.getState().request,periodFilter:t.periodFilter,query:t.query,filters:t.filters.map(this.mapSearchFilter),sort:t.sort,contentLocale:t.contentLocale}}mapSearchFilter(t){return{key:t.key,values:t.values,negative:t.negative}}connectedCallback(){super.connectedCallback(),eo.reloadMySearches()}setSearch(t){var i;const e=this.toFtSearchRequest(t);null!=e&&(null===(i=this.stateManager)||void 0===i||i.setRequest(e))}update(t){super.update(t),(t.has("user")||t.has("savedSearches"))&&null==this.savedSearches&&eo.reloadMySearches()}}no.styles=zi,no.elementDefinitions={"ft-search-saved-search":Fe,"ft-typography":bi},oo([o.property({type:Boolean})],no.prototype,"showDescription",void 0),oo([o.property({type:Boolean})],no.prototype,"showSearchFilters",void 0),oo([o.property({type:Boolean})],no.prototype,"showSearchButton",void 0),oo([o.property({type:Boolean})],no.prototype,"showAlertStatus",void 0),oo([i.redux({store:io.name})],no.prototype,"savedSearches",void 0),oo([i.redux({store:Bi.name,selector:t=>{var i;return null===(i=t.session)||void 0===i?void 0:i.profile}})],no.prototype,"user",void 0),oo([i.redux({store:"search"})],no.prototype,"request",void 0),oo([i.redux({store:Bi.name})],no.prototype,"editorMode",void 0),i.customElement("ft-search-saved-searches")(no),t.FtSearchSavedSearches=no,t.FtSearchSavedSearchesCssVariables=Ci,t.styles=zi}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);
|