@fluid-topics/ft-reader-feedback 0.3.55
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 +32 -0
- package/build/ft-reader-feedback.css.d.ts +6 -0
- package/build/ft-reader-feedback.css.js +69 -0
- package/build/ft-reader-feedback.d.ts +45 -0
- package/build/ft-reader-feedback.js +280 -0
- package/build/ft-reader-feedback.light.js +1178 -0
- package/build/ft-reader-feedback.min.js +1311 -0
- package/build/ft-reader-feedback.properties.d.ts +14 -0
- package/build/ft-reader-feedback.properties.js +2 -0
- package/build/ft-reader-map-feedback.d.ts +32 -0
- package/build/ft-reader-map-feedback.js +163 -0
- package/build/ft-reader-topic-feedback.d.ts +34 -0
- package/build/ft-reader-topic-feedback.js +165 -0
- package/build/index.d.ts +5 -0
- package/build/index.js +10 -0
- package/build/utils/labels.d.ts +29 -0
- package/build/utils/labels.js +39 -0
- package/build/utils/mail.d.ts +14 -0
- package/build/utils/mail.js +42 -0
- package/package.json +26 -0
|
@@ -0,0 +1,1178 @@
|
|
|
1
|
+
!function(t,i,e,o,s,n,r,a){var l=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class h extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class d extends(function(t){class i extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store)}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this.registerIntervalReader=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this.registerIntervalReader):this.dispatchEvent(new h)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return l([o.state()],i.prototype,"stateManager",void 0),i}(i.FtLitElementRedux)){}const p={feedbackInputMinWidth:i.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","SIZE","300px"),ratedDateColor:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system")},c=e.css`
|
|
2
|
+
.ft-reader-feedback {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ft-reader-feedback--placeholder {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
padding: 8px;
|
|
14
|
+
border: 1px dashed #e1e1e1;
|
|
15
|
+
color: #444444;
|
|
16
|
+
background: #f1f1f1;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ft-reader-feedback--placeholder ft-typography {
|
|
22
|
+
flex-grow: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ft-reader-feedback--placeholder ft-tooltip {
|
|
26
|
+
flex-grow: 0;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ft-reader-feedback--stars {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
.ft-reader-feedback--rating, .ft-reader-feedback--feedback {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ft-reader-feedback--rating .ft-reader-feedback--section-title {
|
|
43
|
+
margin-bottom: 8px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ft-reader-feedback--feedback {
|
|
47
|
+
gap: 8px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ft-reader-feedback--rating-date {
|
|
51
|
+
color: ${p.ratedDateColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ft-reader-feedback--feedback ft-text-area {
|
|
55
|
+
min-width: ${p.feedbackInputMinWidth};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
59
|
+
align-self: flex-end;
|
|
60
|
+
}
|
|
61
|
+
`
|
|
62
|
+
/**
|
|
63
|
+
* @license
|
|
64
|
+
* Copyright 2017 Google LLC
|
|
65
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
+
*/;var f;const u=window,b=u.trustedTypes,v=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,x="?"+g,y=`<${x}>`,m=document,$=(t="")=>m.createComment(t),w=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S=/-->/g,z=/>/g,I=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),T=/'/g,O=/"/g,C=/^(?:script|style|textarea|title)$/i,R=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),N=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),E=new WeakMap,B=m.createTreeWalker(m,129,null,!1),A=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=_;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(r.lastIndex=d,l=r.exec(e),null!==l);)d=r.lastIndex,r===_?"!--"===l[1]?r=S:void 0!==l[1]?r=z:void 0!==l[2]?(C.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=I):void 0!==l[3]&&(r=I):r===I?">"===l[0]?(r=null!=s?s:_,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?I:'"'===l[3]?O:T):r===O||r===T?r=I:r===S||r===z?r=_:(r=I,s=void 0);const p=r===I&&t[i+1].startsWith("/>")?" ":"";n+=r===_?e+y:h>=0?(o.push(a),e.slice(0,h)+"$lit$"+e.slice(h)+g+p):e+g+(-2===h?(o.push(void 0),i):p)}const a=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==v?v.createHTML(a):a,o]};class j{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,a=this.parts,[l,h]=A(t,i);if(this.el=j.createElement(l,e),B.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=B.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(g)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(g),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?H:"?"===i[1]?Z:"@"===i[1]?P:L})}else a.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(C.test(o.tagName)){const t=o.textContent.split(g),i=t.length-1;if(i>0){o.textContent=b?b.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],$()),B.nextNode(),a.push({type:2,index:++s});o.append(t[i],$())}}}else if(8===o.nodeType)if(o.data===x)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(g,t+1));)a.push({type:7,index:s}),t+=g.length-1}s++}}static createElement(t,i){const e=m.createElement("template");return e.innerHTML=t,e}}function F(t,i,e=t,o){var s,n,r,a;if(i===N)return i;let l=void 0!==o?null===(s=e._$Co)||void 0===s?void 0:s[o]:e._$Cl;const h=w(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.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=F(t,l._$AS(t,i.values),l,o)),i}class M{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:m).importNode(e,!0);B.currentNode=s;let n=B.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new U(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new V(n,this,t)),this.u.push(i),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=B.nextNode(),r++)}return s}p(t){let i=0;for(const e of this.u)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class U{constructor(t,i,e,o){var s;this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cm=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=F(this,t,i),w(t)?t===D||null==t||""===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>k(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==D&&w(this._$AH)?this._$AA.nextSibling.data=t:this.T(m.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=j.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.p(e);else{const t=new M(s,this),i=t.v(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let i=E.get(t.strings);return void 0===i&&E.set(t.strings,i=new j(t)),i}k(t){k(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new U(this.O($()),this.O($()),this,this.options)):e=i[o],e._$AI(s),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._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class L{constructor(t,i,e,o,s){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,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 s=this.strings;let n=!1;if(void 0===s)t=F(this,t,i,0),n=!w(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=F(this,o[e+r],i,r),a===N&&(a=this._$AH[r]),n||(n=!w(a)||a!==this._$AH[r]),a===D?t=D:t!==D&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class H extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}const W=b?b.emptyScript:"";class Z extends L{constructor(){super(...arguments),this.type=4}j(t){t&&t!==D?this.element.setAttribute(this.name,W):this.element.removeAttribute(this.name)}}class P extends L{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=F(this,t,i,0))&&void 0!==e?e:D)===N)return;const o=this._$AH,s=t===D&&o!==D||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==D&&(o===D||s);s&&this.element.removeEventListener(this.name,this,o),n&&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 V{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){F(this,t)}}const K=u.litHtmlPolyfillSupport;null==K||K(j,U),(null!==(f=u.litHtmlVersions)&&void 0!==f?f:u.litHtmlVersions=[]).push("2.4.0");
|
|
67
|
+
/**
|
|
68
|
+
* @license
|
|
69
|
+
* Copyright 2020 Google LLC
|
|
70
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
+
*/
|
|
72
|
+
const G=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===G)return null==t?void 0:t._$litStatic$},q=t=>({_$litStatic$:t,r:G}),X=new Map,J=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],a=[];let l,h=0,d=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(n=e[h],s=Y(n));)l+=s+i[++h],d=!0;a.push(n),r.push(l),h++}if(h===o&&r.push(i[o]),d){const t=r.join("$$lit$$");void 0===(i=X.get(t))&&(r.raw=r,X.set(t,i=r)),e=a}return t(i,...e)})(R);var Q;!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"}(Q||(Q={}));const tt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),it=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),et={fontFamily:it,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")},ot=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",tt),st=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",et.fontSize,"20px"),nt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",et.fontWeight,"normal"),rt=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",et.letterSpacing,"0.15px"),at=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",et.lineHeight,"1.2"),lt=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",et.textTransform,"inherit"),ht=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",tt),dt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",et.fontSize,"14px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",et.fontWeight,"normal"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",et.letterSpacing,"0.105px"),ft=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",et.lineHeight,"1.7"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",et.textTransform,"inherit"),bt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",it),vt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",et.fontSize,"16px"),gt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",et.fontWeight,"600"),xt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",et.letterSpacing,"0.144px"),yt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",et.lineHeight,"1.5"),mt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",et.textTransform,"inherit"),$t=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",it),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",et.fontSize,"14px"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",et.fontWeight,"normal"),_t=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",et.letterSpacing,"0.098px"),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",et.lineHeight,"1.7"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",et.textTransform,"inherit"),It={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",it),fontSize:i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",et.fontSize,"16px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",et.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",et.letterSpacing,"0.496px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",et.lineHeight,"1.5"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",et.textTransform,"inherit")},Tt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",it),Ot=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",et.fontSize,"14px"),Ct=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",et.fontWeight,"normal"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",et.letterSpacing,"0.252px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",et.lineHeight,"1.4"),Dt=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",et.textTransform,"inherit"),Et={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",it),fontSize:i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",et.fontSize,"12px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",et.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",et.letterSpacing,"0.396px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",et.lineHeight,"1.33"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",et.textTransform,"inherit")},Bt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",it),At=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",et.fontSize,"10px"),jt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",et.fontWeight,"normal"),Ft=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",et.letterSpacing,"0.33px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",et.lineHeight,"1.6"),Ut=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",et.textTransform,"inherit"),Lt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",it),Ht=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",et.fontSize,"10px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",et.fontWeight,"normal"),Zt=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",et.letterSpacing,"1.5px"),Pt=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",et.lineHeight,"1.6"),Vt=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",et.textTransform,"uppercase"),Kt={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",it),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",et.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",et.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",et.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",et.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",et.textTransform,"uppercase")},Gt=e.css`
|
|
73
|
+
.ft-typography--title {
|
|
74
|
+
font-family: ${ot};
|
|
75
|
+
font-size: ${st};
|
|
76
|
+
font-weight: ${nt};
|
|
77
|
+
letter-spacing: ${rt};
|
|
78
|
+
line-height: ${at};
|
|
79
|
+
text-transform: ${lt};
|
|
80
|
+
}
|
|
81
|
+
`,Yt=e.css`
|
|
82
|
+
.ft-typography--title-dense {
|
|
83
|
+
font-family: ${ht};
|
|
84
|
+
font-size: ${dt};
|
|
85
|
+
font-weight: ${pt};
|
|
86
|
+
letter-spacing: ${ct};
|
|
87
|
+
line-height: ${ft};
|
|
88
|
+
text-transform: ${ut};
|
|
89
|
+
}
|
|
90
|
+
`,qt=e.css`
|
|
91
|
+
.ft-typography--subtitle1 {
|
|
92
|
+
font-family: ${bt};
|
|
93
|
+
font-size: ${vt};
|
|
94
|
+
font-weight: ${gt};
|
|
95
|
+
letter-spacing: ${xt};
|
|
96
|
+
line-height: ${yt};
|
|
97
|
+
text-transform: ${mt};
|
|
98
|
+
}
|
|
99
|
+
`,Xt=e.css`
|
|
100
|
+
.ft-typography--subtitle2 {
|
|
101
|
+
font-family: ${$t};
|
|
102
|
+
font-size: ${wt};
|
|
103
|
+
font-weight: ${kt};
|
|
104
|
+
letter-spacing: ${_t};
|
|
105
|
+
line-height: ${St};
|
|
106
|
+
text-transform: ${zt};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
`,Jt=e.css`
|
|
110
|
+
.ft-typography--body1 {
|
|
111
|
+
font-family: ${It.fontFamily};
|
|
112
|
+
font-size: ${It.fontSize};
|
|
113
|
+
font-weight: ${It.fontWeight};
|
|
114
|
+
letter-spacing: ${It.letterSpacing};
|
|
115
|
+
line-height: ${It.lineHeight};
|
|
116
|
+
text-transform: ${It.textTransform};
|
|
117
|
+
}
|
|
118
|
+
`,Qt=e.css`
|
|
119
|
+
.ft-typography--body2 {
|
|
120
|
+
font-family: ${Tt};
|
|
121
|
+
font-size: ${Ot};
|
|
122
|
+
font-weight: ${Ct};
|
|
123
|
+
letter-spacing: ${Rt};
|
|
124
|
+
line-height: ${Nt};
|
|
125
|
+
text-transform: ${Dt};
|
|
126
|
+
}
|
|
127
|
+
`,ti=e.css`
|
|
128
|
+
.ft-typography--caption {
|
|
129
|
+
font-family: ${Et.fontFamily};
|
|
130
|
+
font-size: ${Et.fontSize};
|
|
131
|
+
font-weight: ${Et.fontWeight};
|
|
132
|
+
letter-spacing: ${Et.letterSpacing};
|
|
133
|
+
line-height: ${Et.lineHeight};
|
|
134
|
+
text-transform: ${Et.textTransform};
|
|
135
|
+
}
|
|
136
|
+
`,ii=e.css`
|
|
137
|
+
.ft-typography--breadcrumb {
|
|
138
|
+
font-family: ${Bt};
|
|
139
|
+
font-size: ${At};
|
|
140
|
+
font-weight: ${jt};
|
|
141
|
+
letter-spacing: ${Ft};
|
|
142
|
+
line-height: ${Mt};
|
|
143
|
+
text-transform: ${Ut};
|
|
144
|
+
}
|
|
145
|
+
`,ei=e.css`
|
|
146
|
+
.ft-typography--overline {
|
|
147
|
+
font-family: ${Lt};
|
|
148
|
+
font-size: ${Ht};
|
|
149
|
+
font-weight: ${Wt};
|
|
150
|
+
letter-spacing: ${Zt};
|
|
151
|
+
line-height: ${Pt};
|
|
152
|
+
text-transform: ${Vt};
|
|
153
|
+
}
|
|
154
|
+
`,oi=e.css`
|
|
155
|
+
.ft-typography--button {
|
|
156
|
+
font-family: ${Kt.fontFamily};
|
|
157
|
+
font-size: ${Kt.fontSize};
|
|
158
|
+
font-weight: ${Kt.fontWeight};
|
|
159
|
+
letter-spacing: ${Kt.letterSpacing};
|
|
160
|
+
line-height: ${Kt.lineHeight};
|
|
161
|
+
text-transform: ${Kt.textTransform};
|
|
162
|
+
}
|
|
163
|
+
`,si=e.css`
|
|
164
|
+
.ft-typography {
|
|
165
|
+
vertical-align: inherit;
|
|
166
|
+
}
|
|
167
|
+
`;var ni,ri,ai=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class li extends i.FtLitElement{constructor(){super(...arguments),this.variant=Q.body1}render(){return this.element?J`
|
|
168
|
+
<${q(this.element)}
|
|
169
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
170
|
+
<slot></slot>
|
|
171
|
+
</${q(this.element)}>
|
|
172
|
+
`:J`
|
|
173
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
174
|
+
`}}li.styles=[Gt,Yt,qt,Xt,Jt,Qt,ti,ii,ei,oi,si],ai([o.property()],li.prototype,"element",void 0),ai([o.property()],li.prototype,"variant",void 0),i.customElement("ft-typography")(li),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.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=""}(ni||(ni={})),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=""}(ri||(ri={})),new Map([...["abw"].map((t=>[t,ri.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,ri.AUDIO])),...["avi"].map((t=>[t,ri.AVI])),...["chm","xhs"].map((t=>[t,ri.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,ri.CODE])),...["csv"].map((t=>[t,ri.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,ri.DITA])),...["epub"].map((t=>[t,ri.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,ri.EXCEL])),...["flac"].map((t=>[t,ri.FLAC])),...["gif"].map((t=>[t,ri.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,ri.GZIP])),...["html","htm","xhtml"].map((t=>[t,ri.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,ri.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,ri.JPEG])),...["json"].map((t=>[t,ri.JSON])),...["m4a","m4p"].map((t=>[t,ri.M4A])),...["mov","qt"].map((t=>[t,ri.MOV])),...["mp3"].map((t=>[t,ri.MP3])),...["mp4","m4v"].map((t=>[t,ri.MP4])),...["ogg","oga"].map((t=>[t,ri.OGG])),...["pdf","ps"].map((t=>[t,ri.PDF])),...["png"].map((t=>[t,ri.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,ri.POWERPOINT])),...["rar"].map((t=>[t,ri.RAR])),...["stp"].map((t=>[t,ri.STP])),...["txt","rtf","md","mdown"].map((t=>[t,ri.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,ri.VIDEO])),...["wav"].map((t=>[t,ri.WAV])),...["wma"].map((t=>[t,ri.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,ri.WORD])),...["xml","xsl","rdf"].map((t=>[t,ri.XML])),...["yaml","yml","x-yaml"].map((t=>[t,ri.YAML])),...["zip"].map((t=>[t,ri.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")},di=e.css`
|
|
175
|
+
:host, i.ft-icon {
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
flex-shrink: 0;
|
|
179
|
+
flex-grow: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host {
|
|
183
|
+
width: ${hi.size};
|
|
184
|
+
height: ${hi.size};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
i.ft-icon {
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 100%;
|
|
190
|
+
font-size: ${hi.size};
|
|
191
|
+
line-height: 1;
|
|
192
|
+
font-weight: normal;
|
|
193
|
+
text-transform: none;
|
|
194
|
+
font-style: normal;
|
|
195
|
+
font-variant: normal;
|
|
196
|
+
speak: none;
|
|
197
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
198
|
+
text-rendering: auto;
|
|
199
|
+
-webkit-font-smoothing: antialiased;
|
|
200
|
+
-moz-osx-font-smoothing: grayscale;
|
|
201
|
+
vertical-align: ${hi.verticalAlign};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
i.ft-icon.ft-icon--fluid-topics {
|
|
205
|
+
font-family: ${hi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
206
|
+
|
|
207
|
+
/* Ugly fix because font is broken */
|
|
208
|
+
font-size: calc(0.9 * ${hi.size});
|
|
209
|
+
position: relative;
|
|
210
|
+
top: -5%;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ft-icon--file-format {
|
|
215
|
+
font-family: ${hi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ft-icon--material {
|
|
219
|
+
font-family: ${hi.materialFontFamily}, "Material Icons", sans-serif;
|
|
220
|
+
}
|
|
221
|
+
`;var pi;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(pi||(pi={}));var ci=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class fi extends i.FtLitElement{constructor(){super(...arguments),this.variant=pi.fluid_topics,this.resolvedIcon=e.nothing}render(){const t="material"!==this.variant||this.value;return e.html`
|
|
222
|
+
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
223
|
+
${s.unsafeHTML(this.resolvedIcon)}
|
|
224
|
+
<slot ?hidden=${t}></slot>
|
|
225
|
+
</i>
|
|
226
|
+
`}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 pi.file_format:this.resolvedIcon=null!==(t=ri[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case pi.fluid_topics:this.resolvedIcon=null!==(i=ni[o.replace("-","_").toUpperCase()])&&void 0!==i?i:o;break;default:this.resolvedIcon=this.value||e.nothing}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}fi.elementDefinitions={},fi.styles=di,ci([o.property()],fi.prototype,"variant",void 0),ci([o.property()],fi.prototype,"value",void 0),ci([o.state()],fi.prototype,"resolvedIcon",void 0),ci([o.query("slot")],fi.prototype,"slottedContent",void 0),i.customElement("ft-icon")(fi);const ui=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),bi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),vi=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),gi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),xi=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),yi=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),mi=e.css`
|
|
227
|
+
.ft-tooltip--container {
|
|
228
|
+
display: block;
|
|
229
|
+
position: relative;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ft-tooltip--inline {
|
|
233
|
+
display: inline-block;
|
|
234
|
+
max-width: 100%;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ft-tooltip {
|
|
238
|
+
position: absolute;
|
|
239
|
+
box-sizing: border-box;
|
|
240
|
+
overflow: hidden;
|
|
241
|
+
width: max-content;
|
|
242
|
+
max-width: ${yi};
|
|
243
|
+
text-align: center;
|
|
244
|
+
padding: ${ui};
|
|
245
|
+
z-index: ${gi};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.ft-tooltip--content {
|
|
249
|
+
padding: 4px 8px;
|
|
250
|
+
border-radius: ${xi};
|
|
251
|
+
background-color: ${vi};
|
|
252
|
+
color: ${bi};
|
|
253
|
+
top: -500px;
|
|
254
|
+
left: -500px;
|
|
255
|
+
position: relative;
|
|
256
|
+
word-break: break-word;
|
|
257
|
+
}
|
|
258
|
+
`;var $i=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class wi 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`
|
|
259
|
+
<div part="container"
|
|
260
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
261
|
+
@mouseenter=${this.onHover}
|
|
262
|
+
@mouseleave=${this.onOut}
|
|
263
|
+
@focusin=${this.onHover}
|
|
264
|
+
@focusout=${this.onOut}
|
|
265
|
+
@touchstart=${this.onTouch}>
|
|
266
|
+
<slot></slot>
|
|
267
|
+
<div part="tooltip" role="tooltip" inert
|
|
268
|
+
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
269
|
+
?hidden=${!this.visible}>
|
|
270
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
271
|
+
<slot name="text"></slot>
|
|
272
|
+
<ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}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 s=0,n=0;switch(this.validPosition){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${yi})`}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())}}wi.elementDefinitions={"ft-typography":li},wi.styles=mi,$i([o.property()],wi.prototype,"text",void 0),$i([o.property({type:Boolean})],wi.prototype,"manual",void 0),$i([o.property({type:Boolean})],wi.prototype,"inline",void 0),$i([o.property({type:Number})],wi.prototype,"delay",void 0),$i([o.property()],wi.prototype,"position",void 0),$i([o.queryAssignedNodes("",!0)],wi.prototype,"slotNodes",void 0),$i([o.query(".ft-tooltip--container")],wi.prototype,"container",void 0),$i([o.query("slot")],wi.prototype,"target",void 0),$i([o.query(".ft-tooltip")],wi.prototype,"tooltip",void 0),$i([o.query(".ft-tooltip--content")],wi.prototype,"tooltipContent",void 0),$i([o.state()],wi.prototype,"visible",void 0),i.customElement("ft-tooltip")(wi);const ki=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),_i={color:ki,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",ki),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")},Si=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),zi=Si,Ii=i.FtCssVariableFactory.extend("--ft-ripple-background-color",Si),Ti=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),Oi=Ti,Ci=i.FtCssVariableFactory.extend("--ft-ripple-background-color",Ti),Ri=e.css`
|
|
277
|
+
:host {
|
|
278
|
+
display: contents;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.ft-ripple {
|
|
282
|
+
position: absolute;
|
|
283
|
+
inset: 0;
|
|
284
|
+
pointer-events: none;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.ft-ripple .ft-ripple--background,
|
|
292
|
+
.ft-ripple .ft-ripple--effect {
|
|
293
|
+
position: absolute;
|
|
294
|
+
opacity: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.ft-ripple .ft-ripple--background {
|
|
298
|
+
background-color: ${_i.backgroundColor};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.ft-ripple .ft-ripple--effect {
|
|
302
|
+
background-color: ${_i.color};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
306
|
+
background-color: ${Ci};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
310
|
+
background-color: ${Oi};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
314
|
+
background-color: ${Ii};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
318
|
+
background-color: ${zi};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.ft-ripple .ft-ripple--background {
|
|
322
|
+
top: 0;
|
|
323
|
+
left: 0;
|
|
324
|
+
height: 100%;
|
|
325
|
+
width: 100%;
|
|
326
|
+
transition: opacity 75ms linear;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.ft-ripple .ft-ripple--effect,
|
|
330
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
331
|
+
border-radius: 50%;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.ft-ripple .ft-ripple--effect {
|
|
335
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
336
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
340
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
341
|
+
left: 50%;
|
|
342
|
+
top: 50%;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
346
|
+
transform: translate(-50%, -50%);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
350
|
+
opacity: ${_i.opacityContentOnSurfaceHover};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
354
|
+
opacity: ${_i.opacityContentOnSurfaceSelected};
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
358
|
+
opacity: ${_i.opacityContentOnSurfaceFocused};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
362
|
+
opacity: ${_i.opacityContentOnSurfacePressed};
|
|
363
|
+
transform: translate(-50%, -50%) scale(1);
|
|
364
|
+
}
|
|
365
|
+
`;var Ni=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Di 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.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),n=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-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
366
|
+
<style>
|
|
367
|
+
.ft-ripple .ft-ripple--effect,
|
|
368
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
369
|
+
width: ${this.rippleSize}px;
|
|
370
|
+
height: ${this.rippleSize}px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.ft-ripple .ft-ripple--effect {
|
|
374
|
+
left: ${this.originX}px;
|
|
375
|
+
top: ${this.originY}px;
|
|
376
|
+
}
|
|
377
|
+
</style>
|
|
378
|
+
<div class="${n.classMap(t)}">
|
|
379
|
+
<div class="ft-ripple--background"></div>
|
|
380
|
+
<div class="ft-ripple--effect"></div>
|
|
381
|
+
</div>
|
|
382
|
+
`}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(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=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",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}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()}}Di.elementDefinitions={},Di.styles=Ri,Ni([o.property({type:Boolean})],Di.prototype,"primary",void 0),Ni([o.property({type:Boolean})],Di.prototype,"secondary",void 0),Ni([o.property({type:Boolean})],Di.prototype,"unbounded",void 0),Ni([o.property({type:Boolean})],Di.prototype,"activated",void 0),Ni([o.property({type:Boolean})],Di.prototype,"selected",void 0),Ni([o.property({type:Boolean})],Di.prototype,"disabled",void 0),Ni([o.state()],Di.prototype,"hovered",void 0),Ni([o.state()],Di.prototype,"focused",void 0),Ni([o.state()],Di.prototype,"pressed",void 0),Ni([o.state()],Di.prototype,"rippling",void 0),Ni([o.state()],Di.prototype,"rippleSize",void 0),Ni([o.state()],Di.prototype,"originX",void 0),Ni([o.state()],Di.prototype,"originY",void 0),Ni([o.query(".ft-ripple")],Di.prototype,"ripple",void 0),Ni([o.query(".ft-ripple--effect")],Di.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(Di);const Ei={textColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceHigh),backgroundColor:i.FtCssVariableFactory.extend("--ft-switch-background-color",i.designSystemVariables.colorSurface),selectedTextColor:i.FtCssVariableFactory.extend("--ft-switch-selected-text-color",i.designSystemVariables.colorPrimary),selectedBackgroundColor:i.FtCssVariableFactory.extend("--ft-switch-selected-background-color",i.designSystemVariables.colorPrimary),borderColor:i.FtCssVariableFactory.extend("--ft-switch-border-color",i.designSystemVariables.colorOutline),borderRadius:i.FtCssVariableFactory.extend("--ft-switch-border-radius",i.designSystemVariables.borderRadiusL),fontSize:i.FtCssVariableFactory.extend("--ft-switch-font-size",Kt.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceMedium),rippleColor:i.FtCssVariableFactory.extend("--ft-switch-ripple-color",i.designSystemVariables.colorPrimary),outlineColor:i.FtCssVariableFactory.extend("--ft-switch-outline-color",i.designSystemVariables.colorPrimary)},Bi={borderRadiusLeft:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left",i.designSystemVariables.borderRadiusL),borderRadiusRight:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right",i.designSystemVariables.borderRadiusL),borderWidthLeft:i.FtCssVariableFactory.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:i.FtCssVariableFactory.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:i.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","SIZE","1px")},Ai=e.css`
|
|
383
|
+
.ft-switch-option {
|
|
384
|
+
position: relative;
|
|
385
|
+
display: inline-block;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.ft-switch-option--input {
|
|
389
|
+
position: absolute;
|
|
390
|
+
opacity: 0;
|
|
391
|
+
width: 0;
|
|
392
|
+
height: 0;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.ft-switch-option--content {
|
|
396
|
+
--ft-switch-option-internal-line-height: calc(${Ei.fontSize} + 2px);
|
|
397
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${Ei.iconSize});
|
|
398
|
+
|
|
399
|
+
border-style: solid;
|
|
400
|
+
border-color: ${Ei.borderColor};
|
|
401
|
+
border-width: ${Bi.borderWidthVertical} ${Bi.borderWidthRight} ${Bi.borderWidthVertical} ${Bi.borderWidthLeft};
|
|
402
|
+
border-radius: ${Bi.borderRadiusLeft} ${Bi.borderRadiusRight} ${Bi.borderRadiusRight} ${Bi.borderRadiusLeft};
|
|
403
|
+
display: flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
justify-content: center;
|
|
406
|
+
overflow: hidden;
|
|
407
|
+
${i.setVariable(hi.size,Ei.iconSize)};
|
|
408
|
+
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
409
|
+
background-color: ${Ei.backgroundColor};
|
|
410
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.ft-switch-option--content > *:not(ft-ripple) {
|
|
414
|
+
position: relative;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
418
|
+
background-color: ${Ei.selectedBackgroundColor};
|
|
419
|
+
border-radius: ${Bi.borderRadiusLeft} ${Bi.borderRadiusRight} ${Bi.borderRadiusRight} ${Bi.borderRadiusLeft};
|
|
420
|
+
position: absolute;
|
|
421
|
+
inset: 0;
|
|
422
|
+
content: "";
|
|
423
|
+
z-index: 1;
|
|
424
|
+
opacity: ${i.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.ft-switch-option--label {
|
|
428
|
+
color: ${Ei.textColor};
|
|
429
|
+
overflow: hidden;
|
|
430
|
+
white-space: nowrap;
|
|
431
|
+
text-overflow: ellipsis;
|
|
432
|
+
display: block;
|
|
433
|
+
margin: 0 8px;
|
|
434
|
+
${i.setVariable(Kt.fontSize,Ei.fontSize)};
|
|
435
|
+
${i.setVariable(Kt.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
439
|
+
color: ${Ei.selectedTextColor};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.ft-switch-option--label[hidden] {
|
|
443
|
+
display: none;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.ft-switch-option--ripple {
|
|
447
|
+
${i.setVariable(_i.color,Ei.rippleColor)};
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
ft-icon, ft-ripple, ft-typography {
|
|
451
|
+
z-index: 2;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.ft-switch-option:not(.ft-switch-option--trailing-icon) ft-icon {
|
|
455
|
+
order: -1;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
ft-icon {
|
|
459
|
+
flex-shrink: 0;
|
|
460
|
+
color: ${Ei.iconColor};
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
464
|
+
color: ${Ei.selectedTextColor};
|
|
465
|
+
}
|
|
466
|
+
`;var ji=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Fi extends CustomEvent{constructor(){super("option-change",{bubbles:!0})}}class Mi extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.iconVariant=pi.material,this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Fi)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(e.html`
|
|
467
|
+
<label part="label" for="input" class=${n.classMap(t)}>
|
|
468
|
+
<input id="input" type="radio" class="ft-switch-option--input"
|
|
469
|
+
.checked=${this.selected}
|
|
470
|
+
@click=${this.onChange}>
|
|
471
|
+
<div class="ft-switch-option--content">
|
|
472
|
+
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
473
|
+
<ft-typography part="text"
|
|
474
|
+
variant="button"
|
|
475
|
+
class="ft-switch-option--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
476
|
+
?hidden=${!this.hasTextContent()}>
|
|
477
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
478
|
+
</ft-typography>
|
|
479
|
+
${this.resolveIcon()}
|
|
480
|
+
</div>
|
|
481
|
+
</label>
|
|
482
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:e.html`
|
|
483
|
+
<ft-tooltip part="tooltip"
|
|
484
|
+
text="${this.getLabel()}"
|
|
485
|
+
position="${this.tooltipPosition}">
|
|
486
|
+
${t}
|
|
487
|
+
</ft-tooltip>
|
|
488
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
489
|
+
<ft-icon part="icon" .variant=${this.iconVariant} value=${this.icon}></ft-icon>
|
|
490
|
+
`:e.nothing}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()}}Mi.elementDefinitions={"ft-ripple":Di,"ft-typography":li,"ft-tooltip":wi,"ft-icon":fi},Mi.styles=[i.safariEllipsisFix,Ai],ji([o.property()],Mi.prototype,"value",void 0),ji([o.property()],Mi.prototype,"icon",void 0),ji([o.property()],Mi.prototype,"iconVariant",void 0),ji([o.property()],Mi.prototype,"label",void 0),ji([o.property()],Mi.prototype,"tooltipPosition",void 0),ji([o.property({type:Boolean,reflect:!0})],Mi.prototype,"selected",void 0),ji([o.property({type:Boolean})],Mi.prototype,"trailingIcon",void 0),ji([o.property({type:Boolean})],Mi.prototype,"unselectable",void 0),ji([o.query(".ft-switch-option--content slot")],Mi.prototype,"slottedContent",void 0),ji([o.query(".ft-switch-option--input")],Mi.prototype,"input",void 0);var Ui=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Li extends CustomEvent{constructor(t){super("change",{detail:t})}}class Hi extends i.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}updated(t){var i;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new Li(null===(i=this.selectedOption)||void 0===i?void 0:i.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return e.html`
|
|
491
|
+
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
492
|
+
<slot @slotchange=${this.onSlotchange}
|
|
493
|
+
@option-change=${this.onOptionChange}></slot>
|
|
494
|
+
</div>
|
|
495
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Mi&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChange(t){let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Hi.elementDefinitions={},Hi.styles=e.css`
|
|
496
|
+
:host {
|
|
497
|
+
display: inline-block;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.ft-switch {
|
|
501
|
+
border-radius: ${Ei.borderRadius};
|
|
502
|
+
outline-color: ${Ei.outlineColor};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.ft-switch slot {
|
|
506
|
+
display: flex;
|
|
507
|
+
align-items: stretch;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.ft-switch slot::slotted(ft-switch-option) {
|
|
511
|
+
${i.setVariable(Bi.borderRadiusLeft,"0")};
|
|
512
|
+
${i.setVariable(Bi.borderRadiusRight,"0")};
|
|
513
|
+
${i.setVariable(Bi.borderWidthLeft,"0")};
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
517
|
+
${i.setVariable(Bi.borderRadiusLeft,Ei.borderRadius)};
|
|
518
|
+
${i.setVariable(Bi.borderWidthLeft,"1px")};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
522
|
+
${i.setVariable(Bi.borderRadiusRight,Ei.borderRadius)};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
526
|
+
--ft-switch-internal-vertical-padding: 2px;
|
|
527
|
+
--ft-switch-internal-horizontal-padding: 4px;
|
|
528
|
+
}
|
|
529
|
+
`,Ui([o.property({type:Boolean})],Hi.prototype,"dense",void 0),Ui([o.property({type:Boolean})],Hi.prototype,"unselectable",void 0),Ui([o.query(".ft-switch slot")],Hi.prototype,"slottedContent",void 0),Ui([o.state()],Hi.prototype,"selectedOption",void 0),Ui([o.query(".ft-switch")],Hi.prototype,"ftSwitchDiv",void 0),i.customElement("ft-switch")(Hi),i.customElement("ft-switch-option")(Mi);const Wi=i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),Zi=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),Pi=e.css`
|
|
530
|
+
:host {
|
|
531
|
+
display: block;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.ft-resizer {
|
|
535
|
+
display: flex;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
ft-icon {
|
|
539
|
+
transform: rotate(-45deg);
|
|
540
|
+
color: ${Wi};
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.ft-resizer--dragging ft-icon,
|
|
544
|
+
.ft-resizer:hover ft-icon {
|
|
545
|
+
color: ${Zi};
|
|
546
|
+
}
|
|
547
|
+
`;var Vi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ki extends CustomEvent{constructor(t,i){super("resize",{detail:{width:t,height:i}})}}class Gi extends i.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.cursor="nwse-resize",this.dragging=!1,this.fixedWidth=0,this.fixedHeight=0,this.startX=0,this.startY=0,this.doDragFromMouse=t=>this.doDrag(t.clientX,t.clientY),this.doDragFromTouch=t=>this.doDrag(t.touches[0].clientX,t.touches[0].clientY),this.stopDrag=()=>{this.dragging=!1,document.removeEventListener("mousemove",this.doDragFromMouse,!1),document.removeEventListener("mouseup",this.stopDrag,!1),document.removeEventListener("touchmove",this.doDragFromTouch,!1),document.removeEventListener("touchend",this.stopDrag,!1),document.removeEventListener("touchcancel",this.stopDrag,!1)}}render(){return e.html`
|
|
548
|
+
<style>
|
|
549
|
+
.ft-resizer {
|
|
550
|
+
cursor: ${e.unsafeCSS(this.cursor)}
|
|
551
|
+
}
|
|
552
|
+
</style>
|
|
553
|
+
<div class="ft-resizer ft-no-text-select ${this.dragging?"ft-resizer--dragging":""}"
|
|
554
|
+
@mousedown=${this.initDragFromMouse}
|
|
555
|
+
@touchstart=${this.initDragFromTouch}>
|
|
556
|
+
<ft-icon variant="material">${this.icon}</ft-icon>
|
|
557
|
+
</div>
|
|
558
|
+
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,i){this.dragging=!0,this.startX=t,this.startY=i,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,i){let e=this.fixedWidth+t-this.startX,o=this.fixedHeight+i-this.startY;this.dispatchEvent(new Ki(e,o))}}Gi.elementDefinitions={"ft-icon":fi},Gi.styles=[i.noTextSelect,Pi],Vi([o.property({type:Number})],Gi.prototype,"initialWidth",void 0),Vi([o.property({type:Number})],Gi.prototype,"initialHeight",void 0),Vi([o.property()],Gi.prototype,"icon",void 0),Vi([o.property()],Gi.prototype,"cursor",void 0),Vi([o.state()],Gi.prototype,"dragging",void 0),i.customElement("ft-resizer")(Gi);const Yi={fontSize:i.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:i.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:i.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:i.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:i.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:i.FtCssVariableFactory.extend("--ft-input-label-border-color",i.designSystemVariables.colorOutline),textColor:i.FtCssVariableFactory.extend("--ft-input-label-text-color",i.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:i.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",i.designSystemVariables.colorOnSurfaceDisabled),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system")},qi=e.css`
|
|
559
|
+
.ft-input-label {
|
|
560
|
+
position: absolute;
|
|
561
|
+
inset: 0;
|
|
562
|
+
display: flex;
|
|
563
|
+
background-color: ${Yi.colorSurface};
|
|
564
|
+
border-radius: ${Yi.borderRadiusS} ${Yi.borderRadiusS} 0 0;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.ft-input-label--outlined {
|
|
568
|
+
border-radius: ${Yi.borderRadiusS};
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.ft-input-label {
|
|
572
|
+
border-color: ${Yi.borderColor};
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.ft-input-label.ft-input-label--in-error {
|
|
576
|
+
border-color: ${Yi.colorError}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.ft-input-label:before,
|
|
580
|
+
.ft-input-label:after {
|
|
581
|
+
content: "";
|
|
582
|
+
display: flex;
|
|
583
|
+
border-bottom-width: 1px;
|
|
584
|
+
border-bottom-style: solid;
|
|
585
|
+
border-color: inherit;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.ft-input-label:before {
|
|
589
|
+
width: calc(${Yi.horizontalSpacing} - 4px);
|
|
590
|
+
flex-shrink: 0;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.ft-input-label:after {
|
|
594
|
+
flex-grow: 1;
|
|
595
|
+
flex-shrink: 1;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.ft-input-label--text {
|
|
599
|
+
display: flex;
|
|
600
|
+
flex-shrink: 1;
|
|
601
|
+
position: relative;
|
|
602
|
+
border-bottom-width: 1px;
|
|
603
|
+
border-bottom-style: solid;
|
|
604
|
+
border-color: inherit;
|
|
605
|
+
color: ${Yi.textColor};
|
|
606
|
+
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
607
|
+
max-width: calc(${Yi.labelMaxWidth} - 2 * (${Yi.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
608
|
+
text-overflow: ellipsis;
|
|
609
|
+
${i.setVariable(Et.fontSize,Yi.fontSize)};
|
|
610
|
+
${i.setVariable(Et.lineHeight,Yi.fontSize)};
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.ft-input-label--in-error .ft-input-label--text {
|
|
614
|
+
color: ${Yi.colorError}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.ft-input-label--disabled .ft-input-label--text {
|
|
618
|
+
color: ${Yi.disabledTextColor};
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.ft-input-label--hidden-text {
|
|
622
|
+
padding: 0 4px;
|
|
623
|
+
opacity: 0;
|
|
624
|
+
max-width: 100%;
|
|
625
|
+
box-sizing: border-box;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.ft-input-label--floating-text {
|
|
629
|
+
position: absolute;
|
|
630
|
+
top: calc(50% - var(--ft-typography-caption-line-height) / 2);
|
|
631
|
+
transition: top 250ms;
|
|
632
|
+
overflow: hidden;
|
|
633
|
+
white-space: nowrap;
|
|
634
|
+
text-overflow: ellipsis;
|
|
635
|
+
padding: ${Yi.verticalSpacing} 4px;
|
|
636
|
+
margin: calc(${Yi.verticalSpacing} * -1) 0;
|
|
637
|
+
max-width: 100%;
|
|
638
|
+
box-sizing: border-box;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.ft-input-label--raised .ft-input-label--text {
|
|
642
|
+
${i.setVariable(Et.fontSize,Yi.raisedFontSize)};
|
|
643
|
+
${i.setVariable(Et.lineHeight,Yi.raisedFontSize)};
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.ft-input-label--raised .ft-input-label--floating-text {
|
|
647
|
+
top: ${Yi.verticalSpacing};
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.ft-input-label--outlined .ft-input-label--text,
|
|
651
|
+
.ft-input-label--outlined:before,
|
|
652
|
+
.ft-input-label--outlined:after {
|
|
653
|
+
border-top-width: 1px;
|
|
654
|
+
border-top-style: solid;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.ft-input-label--outlined:before {
|
|
658
|
+
border-left-width: 1px;
|
|
659
|
+
border-left-style: solid;
|
|
660
|
+
border-radius: ${Yi.borderRadiusS} 0 0 ${Yi.borderRadiusS};
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.ft-input-label--outlined:after {
|
|
664
|
+
border-right-width: 1px;
|
|
665
|
+
border-right-style: solid;
|
|
666
|
+
border-radius: 0 ${Yi.borderRadiusS} ${Yi.borderRadiusS} 0;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
670
|
+
padding: 2px 4px;
|
|
671
|
+
z-index: ${Yi.raisedZIndex};
|
|
672
|
+
background-color: ${Yi.colorSurface};
|
|
673
|
+
border-radius: ${Yi.borderRadiusS};
|
|
674
|
+
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
678
|
+
border-top: none;
|
|
679
|
+
}
|
|
680
|
+
`;var Xi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ji extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return e.html`
|
|
681
|
+
<div class="${n.classMap(t)}">
|
|
682
|
+
${this.text?e.html`
|
|
683
|
+
<div class="ft-input-label--text ft-typography--caption">
|
|
684
|
+
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
685
|
+
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
686
|
+
</div>
|
|
687
|
+
`:null}
|
|
688
|
+
</div>
|
|
689
|
+
`}}Ji.elementDefinitions={},Ji.styles=[ti,qi],Xi([o.property({type:String})],Ji.prototype,"text",void 0),Xi([o.property({type:Boolean})],Ji.prototype,"raised",void 0),Xi([o.property({type:Boolean})],Ji.prototype,"outlined",void 0),Xi([o.property({type:Boolean})],Ji.prototype,"disabled",void 0),Xi([o.property({type:Boolean})],Ji.prototype,"error",void 0),i.customElement("ft-input-label")(Ji);const Qi={fontSize:i.FtCssVariableFactory.create("--ft-text-area-font-size","SIZE","14px"),labelSize:i.FtCssVariableFactory.create("--ft-text-area-label-size","SIZE","11px"),verticalSpacing:i.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","SIZE","16px"),helperColor:i.FtCssVariableFactory.extend("--ft-text-area-helper-color",i.designSystemVariables.colorOnSurfaceMedium),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system")},te=e.css`
|
|
690
|
+
*:focus {
|
|
691
|
+
outline: none;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.ft-text-area {
|
|
695
|
+
display: flex;
|
|
696
|
+
flex-direction: column;
|
|
697
|
+
align-items: stretch;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
ft-input-label {
|
|
701
|
+
${i.setVariable(Yi.fontSize,Qi.fontSize)};
|
|
702
|
+
${i.setVariable(Yi.raisedFontSize,Qi.labelSize)};
|
|
703
|
+
${i.setVariable(Yi.verticalSpacing,Qi.verticalSpacing)};
|
|
704
|
+
${i.setVariable(Yi.horizontalSpacing,Qi.horizontalSpacing)};
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.ft-text-area--main-panel {
|
|
708
|
+
position: relative;
|
|
709
|
+
display: flex;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.ft-text-area--input-panel {
|
|
713
|
+
flex-grow: 1;
|
|
714
|
+
position: relative;
|
|
715
|
+
display: flex;
|
|
716
|
+
align-items: center;
|
|
717
|
+
overflow: hidden;
|
|
718
|
+
gap: 8px;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.ft-text-area--input-panel ft-ripple {
|
|
722
|
+
${i.setVariable(_i.opacityContentOnSurfaceHover,"0.08")};
|
|
723
|
+
${i.setVariable(_i.opacityContentOnSurfacePressed,"0.04")};
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.ft-text-area--input {
|
|
727
|
+
display: block;
|
|
728
|
+
position: relative;
|
|
729
|
+
flex-grow: 1;
|
|
730
|
+
flex-shrink: 1;
|
|
731
|
+
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
732
|
+
align-self: stretch;
|
|
733
|
+
resize: none;
|
|
734
|
+
|
|
735
|
+
${i.setVariable(It.fontSize,Qi.fontSize)};
|
|
736
|
+
${i.setVariable(It.lineHeight,Qi.fontSize)};
|
|
737
|
+
color: ${Qi.colorOnSurface};
|
|
738
|
+
|
|
739
|
+
padding: 0 ${Qi.horizontalSpacing};
|
|
740
|
+
margin: calc(${Qi.verticalSpacing} + ${Qi.labelSize} / 2) 0 ${Qi.verticalSpacing} 0;
|
|
741
|
+
|
|
742
|
+
border: none;
|
|
743
|
+
background: none;
|
|
744
|
+
|
|
745
|
+
line-height: 1.4;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.ft-text-area--disabled .ft-text-area--input {
|
|
749
|
+
color: ${Qi.colorOnSurfaceDisabled};
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
753
|
+
cursor: pointer;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
757
|
+
${i.setVariable(Yi.borderColor,Qi.colorPrimary)};
|
|
758
|
+
${i.setVariable(Yi.textColor,Qi.colorPrimary)};
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.ft-text-area--filled .ft-text-area--input-panel {
|
|
762
|
+
border-radius: ${Qi.borderRadiusS} ${Qi.borderRadiusS} 0 0;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
766
|
+
align-self: stretch;
|
|
767
|
+
margin-bottom: ${Qi.verticalSpacing};
|
|
768
|
+
margin-top: calc(${Qi.labelSize} + 2 * ${Qi.verticalSpacing});
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
772
|
+
border-radius: ${Qi.borderRadiusS};
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.ft-text-area--helper-text {
|
|
776
|
+
padding: 0 12px 0 ${Qi.horizontalSpacing};
|
|
777
|
+
color: ${Qi.helperColor};
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.ft-text-area--in-error .ft-text-area--input,
|
|
781
|
+
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
782
|
+
color: ${Qi.colorError};
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
ft-resizer {
|
|
786
|
+
position: absolute;
|
|
787
|
+
right: 0;
|
|
788
|
+
bottom: 0;
|
|
789
|
+
}
|
|
790
|
+
`;var ie=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ee extends i.FtLitElement{constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.height=50,this.focused=!1}render(){const t={"ft-text-area":!0,"ft-text-area--filled":!this.outlined,"ft-text-area--outlined":this.outlined,"ft-text-area--disabled":this.disabled,"ft-text-area--has-value":!!this.value,"ft-text-area--no-label":!this.label,"ft-text-area--in-error":this.error};return e.html`
|
|
791
|
+
<style>
|
|
792
|
+
.ft-text-area--main-panel {
|
|
793
|
+
height: calc(4 * ${Qi.verticalSpacing} + ${Qi.labelSize} + ${Qi.fontSize} + ${this.height}px);
|
|
794
|
+
}
|
|
795
|
+
</style>
|
|
796
|
+
<div class="${n.classMap(t)}">
|
|
797
|
+
<div class="ft-text-area--main-panel">
|
|
798
|
+
<ft-input-label text="${this.label}"
|
|
799
|
+
?disabled=${this.disabled}
|
|
800
|
+
?outlined=${this.outlined}
|
|
801
|
+
?raised=${this.focused||""!=this.value}
|
|
802
|
+
?error=${this.error}
|
|
803
|
+
></ft-input-label>
|
|
804
|
+
<div class="ft-text-area--input-panel"
|
|
805
|
+
aria-label="${this.label}">
|
|
806
|
+
${this.outlined?null:e.html`
|
|
807
|
+
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
808
|
+
`}
|
|
809
|
+
<textarea class="ft-typography--body1 ft-text-area--input"
|
|
810
|
+
?disabled=${this.disabled}
|
|
811
|
+
.value=${this.value}
|
|
812
|
+
@change=${this.updateValueFromInputField}
|
|
813
|
+
@keydown=${this.onKeyDown}
|
|
814
|
+
@keyup=${this.liveUpdateValueFromInputField}
|
|
815
|
+
@focus=${()=>this.focused=!0}
|
|
816
|
+
@focusout=${()=>this.focused=!1}>
|
|
817
|
+
</textarea>
|
|
818
|
+
</div>
|
|
819
|
+
<ft-resizer @resize=${this.onResize}
|
|
820
|
+
initialHeight="${this.height}"
|
|
821
|
+
cursor="ns-resize"></ft-resizer>
|
|
822
|
+
</div>
|
|
823
|
+
${this.helper?e.html`
|
|
824
|
+
<ft-typography class="ft-text-area--helper-text" variant="caption">
|
|
825
|
+
${this.helper}
|
|
826
|
+
</ft-typography>`:void 0}
|
|
827
|
+
</div>
|
|
828
|
+
`}updated(t){super.updated(t),t.has("value")&&this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||""}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}ee.elementDefinitions={"ft-input-label":Ji,"ft-resizer":Gi,"ft-ripple":Di,"ft-typography":li},ee.styles=[Jt,te],ie([o.property({type:String})],ee.prototype,"label",void 0),ie([o.property({reflect:!0})],ee.prototype,"value",void 0),ie([o.property({type:String})],ee.prototype,"helper",void 0),ie([o.property({type:Boolean})],ee.prototype,"outlined",void 0),ie([o.property({type:Boolean})],ee.prototype,"disabled",void 0),ie([o.property({type:Boolean})],ee.prototype,"error",void 0),ie([o.property({type:Number,reflect:!0})],ee.prototype,"height",void 0),ie([o.query("textarea")],ee.prototype,"textarea",void 0),ie([o.state()],ee.prototype,"focused",void 0),i.customElement("ft-text-area")(ee);const oe={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},se=e.css`
|
|
829
|
+
:host {
|
|
830
|
+
line-height: 0;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.ft-loader {
|
|
834
|
+
display: inline-block;
|
|
835
|
+
position: relative;
|
|
836
|
+
|
|
837
|
+
width: ${oe.size};
|
|
838
|
+
height: ${oe.size};
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.ft-loader div {
|
|
842
|
+
position: absolute;
|
|
843
|
+
top: 37.5%;
|
|
844
|
+
width: 25%;
|
|
845
|
+
height: 25%;
|
|
846
|
+
border-radius: 50%;
|
|
847
|
+
background: ${oe.color};
|
|
848
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.ft-loader div:nth-child(1) {
|
|
852
|
+
left: 2.5%;
|
|
853
|
+
animation: appear 0.6s infinite;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.ft-loader div:nth-child(2) {
|
|
857
|
+
left: 2.5%;
|
|
858
|
+
animation: move 0.6s infinite;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
.ft-loader div:nth-child(3) {
|
|
862
|
+
left: 37.5%;
|
|
863
|
+
animation: move 0.6s infinite;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.ft-loader div:nth-child(4) {
|
|
867
|
+
left: 72.5%;
|
|
868
|
+
animation: disappear 0.6s infinite;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
@keyframes appear {
|
|
872
|
+
0% {
|
|
873
|
+
transform: scale(0);
|
|
874
|
+
}
|
|
875
|
+
100% {
|
|
876
|
+
transform: scale(1);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
@keyframes disappear {
|
|
881
|
+
0% {
|
|
882
|
+
transform: scale(1);
|
|
883
|
+
}
|
|
884
|
+
100% {
|
|
885
|
+
transform: scale(0);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
@keyframes move {
|
|
890
|
+
0% {
|
|
891
|
+
transform: translate(0, 0);
|
|
892
|
+
}
|
|
893
|
+
100% {
|
|
894
|
+
transform: translate(calc(0.35 * ${oe.size}), 0);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
`;class ne extends i.FtLitElement{render(){return e.html`
|
|
898
|
+
<div class="ft-loader">
|
|
899
|
+
<div></div>
|
|
900
|
+
<div></div>
|
|
901
|
+
<div></div>
|
|
902
|
+
<div></div>
|
|
903
|
+
</div>
|
|
904
|
+
`}}ne.styles=se,i.customElement("ft-loader")(ne);const re=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),ae={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:re,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",Kt.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",re),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},le=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),he={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:le,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",le)},de=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),pe=[i.noTextSelect,e.css`
|
|
905
|
+
:host {
|
|
906
|
+
display: inline-block;
|
|
907
|
+
max-width: 100%;
|
|
908
|
+
pointer-events: none;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
button {
|
|
912
|
+
box-shadow: 0px 0px 0px transparent;
|
|
913
|
+
border: 0px solid transparent;
|
|
914
|
+
text-shadow: 0px 0px 0px transparent;
|
|
915
|
+
font-size: ${ae.fontSize};
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
button:hover {
|
|
919
|
+
box-shadow: 0px 0px 0px transparent;
|
|
920
|
+
border: 0px solid transparent;
|
|
921
|
+
text-shadow: 0px 0px 0px transparent;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
button:active {
|
|
925
|
+
outline: none;
|
|
926
|
+
border: none;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
button:focus {
|
|
930
|
+
outline: 0;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.ft-button {
|
|
934
|
+
position: relative;
|
|
935
|
+
display: flex;
|
|
936
|
+
justify-content: center;
|
|
937
|
+
align-items: center;
|
|
938
|
+
width: 100%;
|
|
939
|
+
overflow: hidden;
|
|
940
|
+
box-sizing: border-box;
|
|
941
|
+
border: none;
|
|
942
|
+
pointer-events: auto;
|
|
943
|
+
|
|
944
|
+
--ft-button-internal-line-height: calc(${ae.fontSize} + 2px);
|
|
945
|
+
--ft-button-internal-color: ${ae.color};
|
|
946
|
+
${i.setVariable(hi.size,ae.iconSize)};
|
|
947
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
948
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
949
|
+
${i.setVariable(_i.color,ae.rippleColor)};
|
|
950
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${ae.iconSize});
|
|
951
|
+
|
|
952
|
+
border-radius: ${ae.borderRadius};
|
|
953
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
954
|
+
background-color: ${ae.backgroundColor};
|
|
955
|
+
color: var(--ft-button-internal-color);
|
|
956
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
.ft-button:not([disabled]):hover {
|
|
960
|
+
cursor: pointer;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.ft-button--dense {
|
|
964
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
965
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
966
|
+
border-radius: ${de};
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.ft-button--round {
|
|
970
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.ft-button[disabled] {
|
|
974
|
+
filter: grayscale(1);
|
|
975
|
+
opacity: ${ae.opacityDisabled};
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.ft-button.ft-button--primary {
|
|
979
|
+
background-color: ${he.backgroundColor};
|
|
980
|
+
--ft-button-internal-color: ${he.color};
|
|
981
|
+
${i.setVariable(_i.color,he.rippleColor)};
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.ft-button.ft-button--outlined {
|
|
985
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
986
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.ft-button:focus {
|
|
990
|
+
outline: none;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.ft-button--label {
|
|
994
|
+
position: relative;
|
|
995
|
+
overflow: hidden;
|
|
996
|
+
white-space: nowrap;
|
|
997
|
+
text-overflow: ellipsis;
|
|
998
|
+
display: block;
|
|
999
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
1000
|
+
${i.setVariable(Kt.fontSize,"1em")};
|
|
1001
|
+
${i.setVariable(Kt.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.ft-button--label[hidden] {
|
|
1005
|
+
display: none;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
ft-icon {
|
|
1009
|
+
flex-shrink: 0;
|
|
1010
|
+
position: relative;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.ft-button--label[hidden] + ft-icon {
|
|
1014
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
1015
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
1019
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
1020
|
+
order: -1;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
ft-loader {
|
|
1024
|
+
${i.setVariable(oe.size,ae.iconSize)};
|
|
1025
|
+
${i.setVariable(oe.color,"var(--ft-button-internal-color)")};
|
|
1026
|
+
}
|
|
1027
|
+
`];var ce=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class fe extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=pi.material,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`
|
|
1028
|
+
<button part="button"
|
|
1029
|
+
class="${n.classMap(t)}"
|
|
1030
|
+
aria-label="${this.getLabel()}"
|
|
1031
|
+
?disabled=${this.isDisabled()}>
|
|
1032
|
+
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
1033
|
+
<ft-typography part="label"
|
|
1034
|
+
variant="button"
|
|
1035
|
+
element="span"
|
|
1036
|
+
class="ft-button--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
1037
|
+
?hidden=${!this.hasTextContent()}>
|
|
1038
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
1039
|
+
</ft-typography>
|
|
1040
|
+
${this.resolveIcon()}
|
|
1041
|
+
</button>
|
|
1042
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
1043
|
+
<ft-tooltip part="tooltip"
|
|
1044
|
+
text="${this.getLabel()}"
|
|
1045
|
+
position="${this.tooltipPosition}">
|
|
1046
|
+
${t}
|
|
1047
|
+
</ft-tooltip>
|
|
1048
|
+
`:t}resolveIcon(){return this.loading?e.html`
|
|
1049
|
+
<ft-loader></ft-loader> `:this.icon?e.html`
|
|
1050
|
+
<ft-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}}fe.elementDefinitions={"ft-ripple":Di,"ft-tooltip":wi,"ft-typography":li,"ft-icon":fi,"ft-loader":ne},fe.styles=[i.safariEllipsisFix,pe],ce([o.property({type:Boolean})],fe.prototype,"primary",void 0),ce([o.property({type:Boolean})],fe.prototype,"outlined",void 0),ce([o.property({type:Boolean})],fe.prototype,"disabled",void 0),ce([o.property({type:Boolean})],fe.prototype,"dense",void 0),ce([o.property({type:Boolean})],fe.prototype,"round",void 0),ce([o.property({type:String})],fe.prototype,"label",void 0),ce([o.property({type:String})],fe.prototype,"icon",void 0),ce([o.property({type:String})],fe.prototype,"iconVariant",void 0),ce([o.property({type:Boolean})],fe.prototype,"trailingIcon",void 0),ce([o.property({type:Boolean})],fe.prototype,"loading",void 0),ce([o.property({type:String})],fe.prototype,"tooltipPosition",void 0),ce([o.property({type:Boolean})],fe.prototype,"hideTooltip",void 0),ce([o.property({type:Boolean})],fe.prototype,"forceTooltip",void 0),ce([o.query(".ft-button")],fe.prototype,"button",void 0),ce([o.query(".ft-button--label slot")],fe.prototype,"slottedContent",void 0),i.customElement("ft-button")(fe);var ue=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class be extends i.FtLitElement{constructor(){super(...arguments),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.feedbackMessage="",this.iconVariant=pi.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN"}get canAccessFeedback(){return this.user&&this.user.roles.includes("FEEDBACK_USER")}get canAccessRating(){return this.userHasRatingRole&&"NO_RATING"!==this.configuredRatingType}get userHasRatingRole(){return this.user&&this.user.roles.includes("RATING_USER")}get configuredRatingType(){var t,i;return null!==(i=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==i?i:"NO_RATING"}get ratingType(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.type)&&void 0!==e?e:"NO_RATING"}get ratingValue(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.value)&&void 0!==e?e:-1}get ratingDate(){var t,e;const o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.date;return"string"==typeof o?i.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?e.html`
|
|
1051
|
+
<div class="ft-reader-feedback">
|
|
1052
|
+
${this.hideTitle?e.nothing:e.html`
|
|
1053
|
+
<ft-typography variant="title" part="main-title">
|
|
1054
|
+
${this.labelResolver.resolve("feedbackMainTitle")}
|
|
1055
|
+
</ft-typography>
|
|
1056
|
+
`}
|
|
1057
|
+
${this.renderRatingSection()}
|
|
1058
|
+
${this.renderFeedbackSection()}
|
|
1059
|
+
</div>
|
|
1060
|
+
`:e.nothing}renderRatingSection(){return this.canAccessRating?e.html`
|
|
1061
|
+
<div class="ft-reader-feedback--rating" part="rating-container">
|
|
1062
|
+
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1063
|
+
${"DICHOTOMOUS"===this.ratingSummary.type?this.labelResolver.resolve("dichotomousRatingSectionTitle"):this.labelResolver.resolve("ratingSectionTitle")}
|
|
1064
|
+
</ft-typography>
|
|
1065
|
+
${this.renderRating()}
|
|
1066
|
+
<ft-typography variant="caption" class="ft-reader-feedback--rating-date" part="rating-date">
|
|
1067
|
+
${this.renderRatingDate()}
|
|
1068
|
+
</ft-typography>
|
|
1069
|
+
</div>
|
|
1070
|
+
`:this.placeholderInEditor("Rating unavailable: "+(this.userHasRatingRole?"no rating configured for this content":"missing role RATING_USER"))}renderRatingDate(){const t=this.ratingDate;if(null==t)return this.labelResolver.resolve("notRated");if(t.getTime()>(new Date).getTime()-6e4)return this.labelResolver.resolve("ratedNow");return(new Date).toLocaleDateString()===t.toLocaleDateString()?this.labelResolver.resolve("ratedToday"):this.labelResolver.resolve("ratedOn",t)}renderRating(){switch(this.configuredRatingType){case"STARS":return e.html`
|
|
1071
|
+
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1072
|
+
${r.repeat(new Array(5),((t,i)=>i),((t,i)=>{let o="STARS"===this.ratingType&&this.ratingValue>i;const s=i+1;return e.html`
|
|
1073
|
+
<ft-button round part="rating-stars-${s}"
|
|
1074
|
+
label="${this.labelResolver.resolve("starsRating",s)}"
|
|
1075
|
+
tooltipPosition="top"
|
|
1076
|
+
.iconVariant=${this.iconVariant}
|
|
1077
|
+
icon="${o?this.filledStarIcon:this.emptyStarIcon}"
|
|
1078
|
+
class="ft-reader-feedback--${o?"active":"inactive"}"
|
|
1079
|
+
@click=${()=>this.rate(this.ratingValue===s?void 0:s)}
|
|
1080
|
+
></ft-button>
|
|
1081
|
+
`}))}
|
|
1082
|
+
</div>
|
|
1083
|
+
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,i="LIKE"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1084
|
+
<ft-switch @change=${t=>this.rate(t.detail)} part="rating rating-like">
|
|
1085
|
+
<ft-switch-option .value=${0}
|
|
1086
|
+
?selected=${t}
|
|
1087
|
+
.iconVariant=${this.iconVariant}
|
|
1088
|
+
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1089
|
+
${this.labelResolver.resolve("dislike")}
|
|
1090
|
+
</ft-switch-option>
|
|
1091
|
+
<ft-switch-option .value=${1}
|
|
1092
|
+
?selected=${i}
|
|
1093
|
+
.iconVariant=${this.iconVariant}
|
|
1094
|
+
icon="${i?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1095
|
+
${this.labelResolver.resolve("like")}
|
|
1096
|
+
</ft-switch-option>
|
|
1097
|
+
</ft-switch>
|
|
1098
|
+
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1099
|
+
<ft-switch @change=${t=>this.rate(t.detail)}
|
|
1100
|
+
part="rating rating-dichotomous">
|
|
1101
|
+
<ft-switch-option .value=${0}
|
|
1102
|
+
?selected=${o}>
|
|
1103
|
+
${this.labelResolver.resolve("dichotomousNo")}
|
|
1104
|
+
</ft-switch-option>
|
|
1105
|
+
<ft-switch-option .value=${1}
|
|
1106
|
+
?selected=${s}>
|
|
1107
|
+
${this.labelResolver.resolve("dichotomousYes")}
|
|
1108
|
+
</ft-switch-option>
|
|
1109
|
+
</ft-switch>
|
|
1110
|
+
`}return e.nothing}rate(t){this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){if(this.canAccessFeedback){const t=this.feedbackMailLinkBuilder(this.feedbackMessage);let i=e.html`
|
|
1111
|
+
<ft-button primary
|
|
1112
|
+
class="ft-reader-feedback--send-feedback"
|
|
1113
|
+
?disabled=${!this.feedbackMessage}
|
|
1114
|
+
@click=${()=>t?this.clearFeedbackInput():this.sendFeedback()}
|
|
1115
|
+
part="send-feedback">
|
|
1116
|
+
${this.labelResolver.resolve("okButton")}
|
|
1117
|
+
</ft-button>
|
|
1118
|
+
`;return t&&(i=e.html`
|
|
1119
|
+
<a class="ft-reader-feedback--feedback-link" href="${t}">
|
|
1120
|
+
${i}
|
|
1121
|
+
</a>
|
|
1122
|
+
`),e.html`
|
|
1123
|
+
<div class="ft-reader-feedback--feedback" part="feedback-container">
|
|
1124
|
+
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1125
|
+
${this.labelResolver.resolve("feedbackSectionTitle")}
|
|
1126
|
+
</ft-typography>
|
|
1127
|
+
<ft-text-area outlined
|
|
1128
|
+
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1129
|
+
label="${this.labelResolver.resolve("feedbackInputLabel")}"
|
|
1130
|
+
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1131
|
+
></ft-text-area>
|
|
1132
|
+
${i}
|
|
1133
|
+
</div>
|
|
1134
|
+
`}return this.placeholderInEditor("Feedback unavailable: missing role FEEDBACK_USER")}sendFeedback(){this.dispatchEvent(new CustomEvent("send-feedback",{detail:this.feedbackInput.value}))}placeholderInEditor(t){return this.editorMode?e.html`
|
|
1135
|
+
<div class="ft-reader-feedback--placeholder">
|
|
1136
|
+
<ft-typography variant="caption">${t}</ft-typography>
|
|
1137
|
+
<ft-tooltip position="left"
|
|
1138
|
+
text="This is a placeholder, it will not appear outside this designer.">
|
|
1139
|
+
<ft-icon>INFO</ft-icon>
|
|
1140
|
+
</ft-tooltip>
|
|
1141
|
+
</div>
|
|
1142
|
+
`:e.nothing}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}be.elementDefinitions={"ft-button":fe,"ft-typography":li,"ft-icon":fi,"ft-tooltip":wi,"ft-switch":Hi,"ft-switch-option":Mi,"ft-text-area":ee},be.styles=c,ue([o.property({attribute:!0})],be.prototype,"editorMode",void 0),ue([o.property({type:Boolean})],be.prototype,"hideTitle",void 0),ue([o.property({type:Boolean})],be.prototype,"ratingAllowed",void 0),ue([o.property({attribute:!1})],be.prototype,"labelResolver",void 0),ue([o.property({attribute:!1})],be.prototype,"ratingSummary",void 0),ue([o.property({attribute:!1})],be.prototype,"user",void 0),ue([o.query(".ft-reader-feedback--feedback-input")],be.prototype,"feedbackInput",void 0),ue([o.state()],be.prototype,"feedbackMessage",void 0),ue([o.property()],be.prototype,"iconVariant",void 0),ue([o.property()],be.prototype,"emptyStarIcon",void 0),ue([o.property()],be.prototype,"filledStarIcon",void 0),ue([o.property()],be.prototype,"emptyLikeIcon",void 0),ue([o.property()],be.prototype,"filledLikeIcon",void 0),ue([o.property()],be.prototype,"emptyDislikeIcon",void 0),ue([o.property()],be.prototype,"filledDislikeIcon",void 0),ue([o.property()],be.prototype,"feedbackMailLinkBuilder",void 0);const ve={starsRating:"{0} stars","starsRating[\\=1]":"1 star",like:"Like",dislike:"Dislike",dichotomousYes:"Yes",dichotomousNo:"No",notRated:"Not rated",ratedNow:"Rated now",ratedToday:"Rated today",ratedOn:"Rated on {0, date}",feedbackInputLabel:"How can we improve it?",okButton:"Send feedback",cancelButton:"Cancel",feedbackSuccess:"Feedback successfully sent. Thank you!",feedbackFailure:"Failed to send feedback. Please try again later.",ratingSuccess:"Rating successfully sent. Thank you!",ratingFailure:"Failed to send rating. Please try again later."},ge={...ve,feedbackMainTitle:"Send feedback",ratingSectionTitle:"Rate this document",dichotomousRatingSectionTitle:"Did it solve your problem?",feedbackSectionTitle:"Write your review",mailSubject:"Feedback about “{0}”"},xe={...ve,feedbackMainTitle:"Send feedback",ratingSectionTitle:"Rate this content",dichotomousRatingSectionTitle:"Did this content solve your problem?",feedbackSectionTitle:"Write your review",mailSubject:"Feedback about “{0}” in “{1}”"},ye=new i.ParametrizedLabelResolver(xe,{}),me=new i.ParametrizedLabelResolver(ge,{});class $e{constructor(t){this.disclaimer=t,this.subject="",this.url="",this.allMetadata="",this.subjectMetadata="",this.isAuthenticated=!1}update(t,i,e,o,s){this.subject=t,this.url=i,this.configuration=o,this.isAuthenticated=s,this.subjectMetadata=o.subjectMetadataIds.map((t=>e.find((i=>i.key===t)))).filter((t=>null!=t)).map((t=>"["+t.values.join(", ")+"]")).join(""),this.allMetadata=e.filter((t=>!t.key.startsWith("ft:"))).map((t=>"["+t.values.join(", ")+"]")).join(" ")}build(t){var i,e;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopics)))return;const o=encodeURIComponent(this.subject+" "+this.subjectMetadata),s=encodeURIComponent(`\n${this.allMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${this.disclaimer}`);return`mailto:${null===(e=this.configuration)||void 0===e?void 0:e.recipients.join(",")}?subject=${o}&body=${s}`}}var we=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ke extends d{constructor(){super(...arguments),this.editorMode=!1,this.iconVariant=pi.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new $e(me.resolve("mailDisclaimer"))}render(){return null==this.map?e.nothing:e.html`
|
|
1143
|
+
<ft-reader-feedback
|
|
1144
|
+
ratingAllowed
|
|
1145
|
+
.editorMode=${!0}
|
|
1146
|
+
.labelResolver=${me}
|
|
1147
|
+
.ratingSummary=${this.ratingSummary}
|
|
1148
|
+
.user=${this.user}
|
|
1149
|
+
.iconVariant=${this.iconVariant}
|
|
1150
|
+
.emptyStarIcon=${this.emptyStarIcon}
|
|
1151
|
+
.filledStarIcon=${this.filledStarIcon}
|
|
1152
|
+
.emptyLikeIcon=${this.emptyLikeIcon}
|
|
1153
|
+
.filledLikeIcon=${this.filledLikeIcon}
|
|
1154
|
+
.emptyDislikeIcon=${this.emptyDislikeIcon}
|
|
1155
|
+
.filledDislikeIcon=${this.filledDislikeIcon}
|
|
1156
|
+
.feedbackMailLinkBuilder=${t=>this.feedbackLinkBuilder.build(t)}
|
|
1157
|
+
@rate=${this.rate}
|
|
1158
|
+
@send-feedback=${this.sendFeedback}
|
|
1159
|
+
></ft-reader-feedback>
|
|
1160
|
+
`}updated(t){var i,e,o;super.updated(t),t.has("map")&&this.updateData(),["map","configuration","user"].some((i=>t.has(i)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(me.resolve("mailSubject",this.map.title),null!==(e=null===(i=this.service)||void 0===i?void 0:i.getLink())&&void 0!==e?e:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}async updateData(){var t,i;this.user=await(null===(t=this.service)||void 0===t?void 0:t.getSession().then((t=>t.profile))),this.map&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getMapRating()))}async rate(t){var e,o,s;if(this.ratingSummary)try{null==t.detail?(this.ratingSummary={...this.ratingSummary,rating:void 0},await(null===(e=this.service)||void 0===e?void 0:e.unrateMap())):(this.ratingSummary={...this.ratingSummary,rating:{type:this.ratingSummary.type,value:t.detail,date:new Date}},await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t.detail)))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:me.resolve("ratingFailure")}))}this.updateData()}async sendFeedback(t){var e;try{await(null===(e=this.service)||void 0===e?void 0:e.sendMapFeedback(t.detail)),this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:me.resolve("feedbackSuccess")})),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:me.resolve("feedbackFailure")}))}}}ke.elementDefinitions={"ft-reader-feedback":be},we([i.redux()],ke.prototype,"map",void 0),we([o.property({attribute:!1})],ke.prototype,"editorMode",void 0),we([i.redux((t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}))],ke.prototype,"configuration",void 0),we([a.state()],ke.prototype,"ratingSummary",void 0),we([a.state()],ke.prototype,"user",void 0),we([o.property({type:String})],ke.prototype,"iconVariant",void 0),we([o.property({type:String})],ke.prototype,"emptyStarIcon",void 0),we([o.property({type:String})],ke.prototype,"filledStarIcon",void 0),we([o.property({type:String})],ke.prototype,"emptyLikeIcon",void 0),we([o.property({type:String})],ke.prototype,"filledLikeIcon",void 0),we([o.property({type:String})],ke.prototype,"emptyDislikeIcon",void 0),we([o.property({type:String})],ke.prototype,"filledDislikeIcon",void 0),we([o.query("ft-reader-feedback")],ke.prototype,"readerFeedback",void 0);var _e=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Se extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}class ze extends(function(t){class i extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registerIntervalTopic=0}connectedCallback(){super.connectedCallback(),this.registerIntervalTopic=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this.registerIntervalTopic):this.dispatchEvent(new Se)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return _e([o.state()],i.prototype,"tocNode",void 0),_e([o.state()],i.prototype,"disableContextInteractions",void 0),i}(d)){}var Ie=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Te extends ze{constructor(){super(...arguments),this.editorMode=!1,this.iconVariant=pi.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new $e(ye.resolve("mailDisclaimer"))}render(){return null==this.map||null==this.tocNode?e.nothing:e.html`
|
|
1161
|
+
<ft-reader-feedback
|
|
1162
|
+
?ratingAllowed=${this.tocNode.hasRating}
|
|
1163
|
+
.editorMode=${this.editorMode}
|
|
1164
|
+
.labelResolver=${ye}
|
|
1165
|
+
.ratingSummary=${this.ratingSummary}
|
|
1166
|
+
.user=${this.user}
|
|
1167
|
+
.iconVariant=${this.iconVariant}
|
|
1168
|
+
.emptyStarIcon=${this.emptyStarIcon}
|
|
1169
|
+
.filledStarIcon=${this.filledStarIcon}
|
|
1170
|
+
.emptyLikeIcon=${this.emptyLikeIcon}
|
|
1171
|
+
.filledLikeIcon=${this.filledLikeIcon}
|
|
1172
|
+
.emptyDislikeIcon=${this.emptyDislikeIcon}
|
|
1173
|
+
.filledDislikeIcon=${this.filledDislikeIcon}
|
|
1174
|
+
.feedbackMailLinkBuilder=${t=>this.feedbackLinkBuilder.build(t)}
|
|
1175
|
+
@rate=${this.rate}
|
|
1176
|
+
@send-feedback=${this.sendFeedback}
|
|
1177
|
+
></ft-reader-feedback>
|
|
1178
|
+
`}updated(t){var i,e,o;super.updated(t),t.has("tocNode")&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user"].some((i=>t.has(i)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(ye.resolve("mailSubject",this.tocNode.title,this.map.title),null!==(e=null===(i=this.service)||void 0===i?void 0:i.getLink(this.tocNode.tocId))&&void 0!==e?e:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}async updateData(){var t,i;this.user=await(null===(t=this.service)||void 0===t?void 0:t.getSession().then((t=>t.profile))),this.tocNode&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getTopicRating(this.tocNode.tocId)))}async rate(t){var e,o,s;if(this.ratingSummary&&this.tocNode)try{null==t.detail?(this.ratingSummary={...this.ratingSummary,rating:void 0},await(null===(e=this.service)||void 0===e?void 0:e.unrateTopic(this.tocNode.tocId))):(this.ratingSummary={...this.ratingSummary,rating:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},await(null===(o=this.service)||void 0===o?void 0:o.rateTopic(this.tocNode.tocId,null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t.detail)))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:ye.resolve("ratingFailure")}))}this.updateData()}async sendFeedback(t){var e;try{this.tocNode&&(await(null===(e=this.service)||void 0===e?void 0:e.sendTopicFeedback(this.tocNode.tocId,t.detail)),this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:ye.resolve("feedbackSuccess")})),this.readerFeedback.clearFeedbackInput())}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:ye.resolve("feedbackFailure")}))}}}Te.elementDefinitions={"ft-reader-feedback":be},Ie([i.redux()],Te.prototype,"map",void 0),Ie([o.property({attribute:!1})],Te.prototype,"editorMode",void 0),Ie([i.redux((t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}))],Te.prototype,"configuration",void 0),Ie([o.state()],Te.prototype,"ratingSummary",void 0),Ie([o.state()],Te.prototype,"user",void 0),Ie([o.property()],Te.prototype,"iconVariant",void 0),Ie([o.property()],Te.prototype,"emptyStarIcon",void 0),Ie([o.property()],Te.prototype,"filledStarIcon",void 0),Ie([o.property()],Te.prototype,"emptyLikeIcon",void 0),Ie([o.property()],Te.prototype,"filledLikeIcon",void 0),Ie([o.property()],Te.prototype,"emptyDislikeIcon",void 0),Ie([o.property()],Te.prototype,"filledDislikeIcon",void 0),Ie([o.query("ft-reader-feedback")],Te.prototype,"readerFeedback",void 0),i.customElement("ft-reader-map-feedback")(ke),i.customElement("ft-reader-topic-feedback")(Te),t.FtReaderFeedbackCssVariables=p,t.FtReaderMapFeedback=ke,t.FtReaderTopicFeedback=Te,t.styles=c,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat,decorators);
|