@fluid-topics/ft-reader-feedback 0.3.67 → 0.3.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-reader-feedback.light.js +175 -164
- package/build/ft-reader-feedback.min.js +170 -159
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e,i,o,s,n,r){var a=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class h extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),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 l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return a([o.state()],e.prototype,"stateManager",void 0),e}(e.FtLitElementRedux)){}const d=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),p={color:d,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",d),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},c=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),f=c,u=e.FtCssVariableFactory.extend("--ft-ripple-background-color",c),
|
|
1
|
+
!function(t,e,i,o,s,n,r){var a=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class h extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),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 l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return a([o.state()],e.prototype,"stateManager",void 0),e}(e.FtLitElementRedux)){}const d=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorContent),p={color:d,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color",d),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},c=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorPrimary),f=c,u=e.FtCssVariableFactory.extend("--ft-ripple-background-color",c),b=e.FtCssVariableFactory.extend("--ft-ripple-color",e.designSystemVariables.colorSecondary),v=b,g=e.FtCssVariableFactory.extend("--ft-ripple-background-color",b),x=i.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
35
|
-
background-color: ${
|
|
35
|
+
background-color: ${v};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
opacity: ${p.opacityContentOnSurfacePressed};
|
|
88
88
|
transform: translate(-50%, -50%) scale(1);
|
|
89
89
|
}
|
|
90
|
-
`,y=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),m=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),$={fontFamily:m,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},w={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-font-family",y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-font-size",$.fontSize,"20px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",$.letterSpacing,"0.15px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-line-height",$.lineHeight,"1.2"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",$.textTransform,"inherit")},k={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",$.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",$.letterSpacing,"0.105px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",$.lineHeight,"1.7"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",$.textTransform,"inherit")},_=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",m),S=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",$.fontSize,"16px"),I=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",$.fontWeight,"600"),z=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",$.letterSpacing,"0.144px"),C=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",$.lineHeight,"1.5"),T=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",$.textTransform,"inherit"),O=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",m),R=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",$.fontSize,"14px"),N=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",$.fontWeight,"normal"),D=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",$.letterSpacing,"0.098px"),
|
|
90
|
+
`,y=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.titleFont),m=e.FtCssVariableFactory.extend("--ft-typography-font-family",e.designSystemVariables.contentFont),$={fontFamily:m,fontSize:e.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:e.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:e.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:e.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:e.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},w={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-font-family",y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-font-size",$.fontSize,"20px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",$.letterSpacing,"0.15px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-line-height",$.lineHeight,"1.2"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-text-transform",$.textTransform,"inherit")},k={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",y),fontSize:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",$.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",$.letterSpacing,"0.105px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",$.lineHeight,"1.7"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",$.textTransform,"inherit")},_=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",m),S=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",$.fontSize,"16px"),I=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",$.fontWeight,"600"),z=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",$.letterSpacing,"0.144px"),C=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",$.lineHeight,"1.5"),T=e.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",$.textTransform,"inherit"),O=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",m),R=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",$.fontSize,"14px"),N=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",$.fontWeight,"normal"),D=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",$.letterSpacing,"0.098px"),E=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",$.lineHeight,"1.7"),A=e.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",$.textTransform,"inherit"),B={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-body1-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-body1-font-size",$.fontSize,"16px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",$.letterSpacing,"0.496px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-body1-line-height",$.lineHeight,"1.5"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",$.textTransform,"inherit")},j=e.FtCssVariableFactory.extend("--ft-typography-body2-font-family",m),M=e.FtCssVariableFactory.extend("--ft-typography-body2-font-size",$.fontSize,"14px"),U=e.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",$.fontWeight,"normal"),F=e.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",$.letterSpacing,"0.252px"),L=e.FtCssVariableFactory.extend("--ft-typography-body2-line-height",$.lineHeight,"1.4"),P=e.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",$.textTransform,"inherit"),H={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-caption-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-caption-font-size",$.fontSize,"12px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",$.fontWeight,"normal"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",$.letterSpacing,"0.396px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-caption-line-height",$.lineHeight,"1.33"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",$.textTransform,"inherit")},Z=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",m),W=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",$.fontSize,"10px"),V=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",$.fontWeight,"normal"),G=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",$.letterSpacing,"0.33px"),K=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",$.lineHeight,"1.6"),Y=e.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",$.textTransform,"inherit"),q=e.FtCssVariableFactory.extend("--ft-typography-overline-font-family",m),X=e.FtCssVariableFactory.extend("--ft-typography-overline-font-size",$.fontSize,"10px"),J=e.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",$.fontWeight,"normal"),Q=e.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",$.letterSpacing,"1.5px"),tt=e.FtCssVariableFactory.extend("--ft-typography-overline-line-height",$.lineHeight,"1.6"),et=e.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",$.textTransform,"uppercase"),it={fontFamily:e.FtCssVariableFactory.extend("--ft-typography-button-font-family",m),fontSize:e.FtCssVariableFactory.extend("--ft-typography-button-font-size",$.fontSize,"14px"),fontWeight:e.FtCssVariableFactory.extend("--ft-typography-button-font-weight",$.fontWeight,"600"),letterSpacing:e.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",$.letterSpacing,"1.246px"),lineHeight:e.FtCssVariableFactory.extend("--ft-typography-button-line-height",$.lineHeight,"1.15"),textTransform:e.FtCssVariableFactory.extend("--ft-typography-button-text-transform",$.textTransform,"uppercase")},ot=i.css`
|
|
91
91
|
.ft-typography--title {
|
|
92
92
|
font-family: ${w.fontFamily};
|
|
93
93
|
font-size: ${w.fontSize};
|
|
@@ -120,22 +120,22 @@
|
|
|
120
120
|
font-size: ${R};
|
|
121
121
|
font-weight: ${N};
|
|
122
122
|
letter-spacing: ${D};
|
|
123
|
-
line-height: ${
|
|
124
|
-
text-transform: ${
|
|
123
|
+
line-height: ${E};
|
|
124
|
+
text-transform: ${A};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
`,at=i.css`
|
|
128
128
|
.ft-typography--body1 {
|
|
129
|
-
font-family: ${
|
|
130
|
-
font-size: ${
|
|
131
|
-
font-weight: ${
|
|
132
|
-
letter-spacing: ${
|
|
133
|
-
line-height: ${
|
|
134
|
-
text-transform: ${
|
|
129
|
+
font-family: ${B.fontFamily};
|
|
130
|
+
font-size: ${B.fontSize};
|
|
131
|
+
font-weight: ${B.fontWeight};
|
|
132
|
+
letter-spacing: ${B.letterSpacing};
|
|
133
|
+
line-height: ${B.lineHeight};
|
|
134
|
+
text-transform: ${B.textTransform};
|
|
135
135
|
}
|
|
136
136
|
`,lt=i.css`
|
|
137
137
|
.ft-typography--body2 {
|
|
138
|
-
font-family: ${
|
|
138
|
+
font-family: ${j};
|
|
139
139
|
font-size: ${M};
|
|
140
140
|
font-weight: ${U};
|
|
141
141
|
letter-spacing: ${F};
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
}
|
|
154
154
|
`,dt=i.css`
|
|
155
155
|
.ft-typography--breadcrumb {
|
|
156
|
-
font-family: ${
|
|
157
|
-
font-size: ${
|
|
156
|
+
font-family: ${Z};
|
|
157
|
+
font-size: ${W};
|
|
158
158
|
font-weight: ${V};
|
|
159
159
|
letter-spacing: ${G};
|
|
160
160
|
line-height: ${K};
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
.ft-typography {
|
|
183
183
|
vertical-align: inherit;
|
|
184
184
|
}
|
|
185
|
-
`,ut={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},
|
|
185
|
+
`,ut={color:e.FtCssVariableFactory.extend("--ft-loader-color",e.designSystemVariables.colorPrimary),size:e.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},bt=i.css`
|
|
186
186
|
:host {
|
|
187
187
|
line-height: 0;
|
|
188
188
|
}
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
transform: translate(calc(0.35 * ${ut.size}), 0);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
`,
|
|
254
|
+
`,vt={size:e.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:e.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:e.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:e.FtCssVariableFactory.extend("--ft-icon-material-font-family",e.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:e.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},gt=i.css`
|
|
255
255
|
:host, i.ft-icon {
|
|
256
256
|
display: inline-flex;
|
|
257
257
|
align-items: center;
|
|
@@ -260,14 +260,14 @@
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
:host {
|
|
263
|
-
width: ${
|
|
264
|
-
height: ${
|
|
263
|
+
width: ${vt.size};
|
|
264
|
+
height: ${vt.size};
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
i.ft-icon {
|
|
268
268
|
width: 100%;
|
|
269
269
|
height: 100%;
|
|
270
|
-
font-size: ${
|
|
270
|
+
font-size: ${vt.size};
|
|
271
271
|
line-height: 1;
|
|
272
272
|
font-weight: normal;
|
|
273
273
|
text-transform: none;
|
|
@@ -278,27 +278,27 @@
|
|
|
278
278
|
text-rendering: auto;
|
|
279
279
|
-webkit-font-smoothing: antialiased;
|
|
280
280
|
-moz-osx-font-smoothing: grayscale;
|
|
281
|
-
vertical-align: ${
|
|
281
|
+
vertical-align: ${vt.verticalAlign};
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
i.ft-icon.ft-icon--fluid-topics {
|
|
285
|
-
font-family: ${
|
|
285
|
+
font-family: ${vt.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
286
286
|
|
|
287
287
|
/* Ugly fix because font is broken */
|
|
288
|
-
font-size: calc(0.9 * ${
|
|
288
|
+
font-size: calc(0.9 * ${vt.size});
|
|
289
289
|
position: relative;
|
|
290
290
|
top: -5%;
|
|
291
291
|
justify-content: center;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
.ft-icon--file-format {
|
|
295
|
-
font-family: ${
|
|
295
|
+
font-family: ${vt.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
.ft-icon--material {
|
|
299
|
-
font-family: ${
|
|
299
|
+
font-family: ${vt.materialFontFamily}, "Material Icons", sans-serif;
|
|
300
300
|
}
|
|
301
|
-
`,xt=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),yt={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:xt,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",it.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",xt),verticalPadding:e.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:e.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},mt=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),$t={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:mt,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",mt)},wt=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),kt=[e.noTextSelect,i.css`
|
|
301
|
+
`,xt=e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorPrimary),yt={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorSurface),borderRadius:e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusL),color:xt,fontSize:e.FtCssVariableFactory.extend("--ft-button-font-size",it.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:e.FtCssVariableFactory.extend("--ft-button-ripple-color",xt),verticalPadding:e.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:e.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:e.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOpacityDisabled,"Design system")},mt=e.FtCssVariableFactory.extend("--ft-button-primary-color",e.FtCssVariableFactory.extend("--ft-button-color",e.designSystemVariables.colorOnPrimary)),$t={backgroundColor:e.FtCssVariableFactory.extend("--ft-button-primary-background-color",e.FtCssVariableFactory.extend("--ft-button-background-color",e.designSystemVariables.colorPrimary)),color:mt,rippleColor:e.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",mt)},wt=e.FtCssVariableFactory.extend("--ft-button-dense-border-radius",e.FtCssVariableFactory.extend("--ft-button-border-radius",e.designSystemVariables.borderRadiusM)),kt=e.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),_t=e.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),St=e.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),It=[e.noTextSelect,i.css`
|
|
302
302
|
:host {
|
|
303
303
|
display: inline-block;
|
|
304
304
|
max-width: 100%;
|
|
@@ -337,12 +337,11 @@
|
|
|
337
337
|
box-sizing: border-box;
|
|
338
338
|
border: none;
|
|
339
339
|
pointer-events: auto;
|
|
340
|
+
gap: ${yt.iconPadding};
|
|
340
341
|
|
|
341
342
|
--ft-button-internal-line-height: calc(${yt.fontSize} + 2px);
|
|
342
343
|
--ft-button-internal-color: ${yt.color};
|
|
343
|
-
${e.setVariable(
|
|
344
|
-
--ft-button-internal-vertical-padding: 6px;
|
|
345
|
-
--ft-button-internal-horizontal-padding: 8px;
|
|
344
|
+
${e.setVariable(vt.size,yt.iconSize)};
|
|
346
345
|
${e.setVariable(p.color,yt.rippleColor)};
|
|
347
346
|
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${yt.iconSize});
|
|
348
347
|
|
|
@@ -353,18 +352,31 @@
|
|
|
353
352
|
-webkit-mask-image: radial-gradient(white, black);
|
|
354
353
|
}
|
|
355
354
|
|
|
355
|
+
.ft-button.ft-button--outlined {
|
|
356
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
357
|
+
padding: calc(${yt.verticalPadding} - 1px) calc(${yt.horizontalPadding} - 1px);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.ft-button.ft-button--dense {
|
|
361
|
+
padding: ${kt} ${_t};
|
|
362
|
+
border-radius: ${wt};
|
|
363
|
+
gap: ${St};
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.ft-button.ft-button--dense.ft-button--outlined {
|
|
367
|
+
padding: calc(${kt} - 1px) calc(${_t} - 1px);
|
|
368
|
+
}
|
|
369
|
+
|
|
356
370
|
.ft-button:not([disabled]):hover {
|
|
357
371
|
cursor: pointer;
|
|
358
372
|
}
|
|
359
373
|
|
|
360
|
-
.ft-button--
|
|
361
|
-
--ft-button-internal-
|
|
362
|
-
--ft-button-internal-horizontal-padding: 4px;
|
|
363
|
-
border-radius: ${wt};
|
|
374
|
+
.ft-button--round {
|
|
375
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + ${yt.verticalPadding});
|
|
364
376
|
}
|
|
365
377
|
|
|
366
|
-
.ft-button--round {
|
|
367
|
-
border-radius: calc(var(--ft-button-internal-content-height) / 2 +
|
|
378
|
+
.ft-button--round.ft-button--dense {
|
|
379
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + ${kt});
|
|
368
380
|
}
|
|
369
381
|
|
|
370
382
|
.ft-button[disabled] {
|
|
@@ -378,11 +390,6 @@
|
|
|
378
390
|
${e.setVariable(p.color,$t.rippleColor)};
|
|
379
391
|
}
|
|
380
392
|
|
|
381
|
-
.ft-button.ft-button--outlined {
|
|
382
|
-
border: 1px solid var(--ft-button-internal-color);
|
|
383
|
-
padding: calc(${yt.verticalPadding} - 1px) calc(${yt.horizontalPadding} - 1px);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
393
|
.ft-button:focus {
|
|
387
394
|
outline: none;
|
|
388
395
|
}
|
|
@@ -393,7 +400,6 @@
|
|
|
393
400
|
white-space: nowrap;
|
|
394
401
|
text-overflow: ellipsis;
|
|
395
402
|
display: block;
|
|
396
|
-
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
397
403
|
${e.setVariable(it.fontSize,"1em")};
|
|
398
404
|
${e.setVariable(it.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
399
405
|
}
|
|
@@ -408,8 +414,13 @@
|
|
|
408
414
|
}
|
|
409
415
|
|
|
410
416
|
.ft-button--label[hidden] + ft-icon {
|
|
411
|
-
margin: 0 calc(
|
|
412
|
-
padding: 0
|
|
417
|
+
margin: 0 calc(${yt.horizontalPadding} * -1);
|
|
418
|
+
padding: 0 ${yt.verticalPadding};
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.ft-button--dense .ft-button--label[hidden] + ft-icon {
|
|
422
|
+
margin: 0 calc(${_t} * -1);
|
|
423
|
+
padding: 0 ${kt};
|
|
413
424
|
}
|
|
414
425
|
|
|
415
426
|
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
@@ -421,7 +432,7 @@
|
|
|
421
432
|
${e.setVariable(ut.size,yt.iconSize)};
|
|
422
433
|
${e.setVariable(ut.color,"var(--ft-button-internal-color)")};
|
|
423
434
|
}
|
|
424
|
-
`],
|
|
435
|
+
`],zt={textColor:e.FtCssVariableFactory.extend("--ft-switch-text-color",e.designSystemVariables.colorOnSurfaceHigh),backgroundColor:e.FtCssVariableFactory.extend("--ft-switch-background-color",e.designSystemVariables.colorSurface),selectedTextColor:e.FtCssVariableFactory.extend("--ft-switch-selected-text-color",e.designSystemVariables.colorPrimary),selectedBackgroundColor:e.FtCssVariableFactory.extend("--ft-switch-selected-background-color",e.designSystemVariables.colorPrimary),borderColor:e.FtCssVariableFactory.extend("--ft-switch-border-color",e.designSystemVariables.colorOutline),borderRadius:e.FtCssVariableFactory.extend("--ft-switch-border-radius",e.designSystemVariables.borderRadiusL),fontSize:e.FtCssVariableFactory.extend("--ft-switch-font-size",it.fontSize),iconSize:e.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:e.FtCssVariableFactory.extend("--ft-switch-text-color",e.designSystemVariables.colorOnSurfaceMedium),rippleColor:e.FtCssVariableFactory.extend("--ft-switch-ripple-color",e.designSystemVariables.colorPrimary),outlineColor:e.FtCssVariableFactory.extend("--ft-switch-outline-color",e.designSystemVariables.colorPrimary)},Ct={feedbackInputMinWidth:e.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","SIZE","300px"),ratedDateColor:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),sendFeedbackColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-color",e.designSystemVariables.colorOnPrimary),sendFeedbackBackgroundColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-background-color",e.designSystemVariables.colorPrimary),filledRatingColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-filled-rating-color",e.designSystemVariables.colorPrimary),emptyRatingColor:e.FtCssVariableFactory.extend("--ft-reader-feedback-empty-rating-color",e.designSystemVariables.colorOnSurfaceMedium),mainTitleFontSize:e.FtCssVariableFactory.external(w.fontSize,"Typography"),sectionTitleFontSize:e.FtCssVariableFactory.external(k.fontSize,"Typography")},Tt=i.css`
|
|
425
436
|
.ft-reader-feedback {
|
|
426
437
|
box-sizing: border-box;
|
|
427
438
|
display: flex;
|
|
@@ -467,14 +478,14 @@
|
|
|
467
478
|
}
|
|
468
479
|
|
|
469
480
|
.ft-reader-feedback--rating {
|
|
470
|
-
${e.setVariable(yt.color,
|
|
471
|
-
${e.setVariable(yt.rippleColor,
|
|
472
|
-
${e.setVariable(
|
|
473
|
-
${e.setVariable(
|
|
481
|
+
${e.setVariable(yt.color,Ct.emptyRatingColor)};
|
|
482
|
+
${e.setVariable(yt.rippleColor,Ct.filledRatingColor)};
|
|
483
|
+
${e.setVariable(zt.textColor,Ct.emptyRatingColor)};
|
|
484
|
+
${e.setVariable(zt.selectedTextColor,Ct.filledRatingColor)};
|
|
474
485
|
}
|
|
475
486
|
|
|
476
487
|
.ft-reader-feedback--rating .ft-reader-feedback--active {
|
|
477
|
-
${e.setVariable(yt.color,
|
|
488
|
+
${e.setVariable(yt.color,Ct.filledRatingColor)};
|
|
478
489
|
}
|
|
479
490
|
|
|
480
491
|
.ft-reader-feedback--feedback {
|
|
@@ -482,42 +493,42 @@
|
|
|
482
493
|
}
|
|
483
494
|
|
|
484
495
|
.ft-reader-feedback--rating-date {
|
|
485
|
-
color: ${
|
|
496
|
+
color: ${Ct.ratedDateColor};
|
|
486
497
|
}
|
|
487
498
|
|
|
488
499
|
.ft-reader-feedback--feedback ft-text-area {
|
|
489
|
-
min-width: ${
|
|
500
|
+
min-width: ${Ct.feedbackInputMinWidth};
|
|
490
501
|
}
|
|
491
502
|
|
|
492
503
|
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
493
504
|
align-self: flex-end;
|
|
494
|
-
${e.setVariable(yt.color,
|
|
495
|
-
${e.setVariable(yt.backgroundColor,
|
|
505
|
+
${e.setVariable(yt.color,Ct.sendFeedbackColor)};
|
|
506
|
+
${e.setVariable(yt.backgroundColor,Ct.sendFeedbackBackgroundColor)};
|
|
496
507
|
}
|
|
497
508
|
`
|
|
498
509
|
/**
|
|
499
510
|
* @license
|
|
500
511
|
* Copyright 2017 Google LLC
|
|
501
512
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
502
|
-
*/;var
|
|
513
|
+
*/;var Ot;const Rt=window,Nt=Rt.trustedTypes,Dt=Nt?Nt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Et=`lit$${(Math.random()+"").slice(9)}$`,At="?"+Et,Bt=`<${At}>`,jt=document,Mt=(t="")=>jt.createComment(t),Ut=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Ft=Array.isArray,Lt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Ht=/>/g,Zt=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),Wt=/'/g,Vt=/"/g,Gt=/^(?:script|style|textarea|title)$/i,Kt=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),Yt=Symbol.for("lit-noChange"),qt=Symbol.for("lit-nothing"),Xt=new WeakMap,Jt=jt.createTreeWalker(jt,129,null,!1),Qt=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=Lt;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)d=r.lastIndex,r===Lt?"!--"===l[1]?r=Pt:void 0!==l[1]?r=Ht:void 0!==l[2]?(Gt.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=Zt):void 0!==l[3]&&(r=Zt):r===Zt?">"===l[0]?(r=null!=s?s:Lt,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?Zt:'"'===l[3]?Vt:Wt):r===Vt||r===Wt?r=Zt:r===Pt||r===Ht?r=Lt:(r=Zt,s=void 0);const p=r===Zt&&t[e+1].startsWith("/>")?" ":"";n+=r===Lt?i+Bt:h>=0?(o.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+Et+p):i+Et+(-2===h?(o.push(void 0),e):p)}const a=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Dt?Dt.createHTML(a):a,o]};class te{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const r=t.length-1,a=this.parts,[l,h]=Qt(t,e);if(this.el=te.createElement(l,i),Jt.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=Jt.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(Et)){const i=h[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(Et),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?ne:"?"===e[1]?ae:"@"===e[1]?le:se})}else a.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(Gt.test(o.tagName)){const t=o.textContent.split(Et),e=t.length-1;if(e>0){o.textContent=Nt?Nt.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],Mt()),Jt.nextNode(),a.push({type:2,index:++s});o.append(t[e],Mt())}}}else if(8===o.nodeType)if(o.data===At)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(Et,t+1));)a.push({type:7,index:s}),t+=Et.length-1}s++}}static createElement(t,e){const i=jt.createElement("template");return i.innerHTML=t,i}}function ee(t,e,i=t,o){var s,n,r,a;if(e===Yt)return e;let l=void 0!==o?null===(s=i._$Co)||void 0===s?void 0:s[o]:i._$Cl;const h=Ut(e)?void 0:e._$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,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(e=ee(t,l._$AS(t,e.values),l,o)),e}class ie{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:jt).importNode(i,!0);Jt.currentNode=s;let n=Jt.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new oe(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new he(n,this,t)),this.u.push(e),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=Jt.nextNode(),r++)}return s}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class oe{constructor(t,e,i,o){var s;this.type=2,this._$AH=qt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cm=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ee(this,t,e),Ut(t)?t===qt||null==t||""===t?(this._$AH!==qt&&this._$AR(),this._$AH=qt):t!==this._$AH&&t!==Yt&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Ft(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==qt&&Ut(this._$AH)?this._$AA.nextSibling.data=t:this.T(jt.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=te.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.p(i);else{const t=new ie(s,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=Xt.get(t.strings);return void 0===e&&Xt.set(t.strings,e=new te(t)),e}k(t){Ft(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new oe(this.O(Mt()),this.O(Mt()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class se{constructor(t,e,i,o,s){this.type=1,this._$AH=qt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=qt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=ee(this,t,e,0),n=!Ut(t)||t!==this._$AH&&t!==Yt,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=ee(this,o[i+r],e,r),a===Yt&&(a=this._$AH[r]),n||(n=!Ut(a)||a!==this._$AH[r]),a===qt?t=qt:t!==qt&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===qt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ne extends se{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===qt?void 0:t}}const re=Nt?Nt.emptyScript:"";class ae extends se{constructor(){super(...arguments),this.type=4}j(t){t&&t!==qt?this.element.setAttribute(this.name,re):this.element.removeAttribute(this.name)}}class le extends se{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=ee(this,t,e,0))&&void 0!==i?i:qt)===Yt)return;const o=this._$AH,s=t===qt&&o!==qt||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==qt&&(o===qt||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class he{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ee(this,t)}}const de=Rt.litHtmlPolyfillSupport;null==de||de(te,oe),(null!==(Ot=Rt.litHtmlVersions)&&void 0!==Ot?Ot:Rt.litHtmlVersions=[]).push("2.4.0");
|
|
503
514
|
/**
|
|
504
515
|
* @license
|
|
505
516
|
* Copyright 2020 Google LLC
|
|
506
517
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
507
518
|
*/
|
|
508
|
-
const
|
|
509
|
-
<${
|
|
519
|
+
const pe=Symbol.for(""),ce=t=>{if((null==t?void 0:t.r)===pe)return null==t?void 0:t._$litStatic$},fe=t=>({_$litStatic$:t,r:pe}),ue=new Map,be=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],a=[];let l,h=0,d=!1;for(;h<o;){for(l=e[h];h<o&&void 0!==(n=i[h],s=ce(n));)l+=s+e[++h],d=!0;a.push(n),r.push(l),h++}if(h===o&&r.push(e[o]),d){const t=r.join("$$lit$$");void 0===(e=ue.get(t))&&(r.raw=r,ue.set(t,e=r)),i=a}return t(e,...i)})(Kt);var ve;!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"}(ve||(ve={}));var ge,xe,ye,me=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class $e extends e.FtLitElement{constructor(){super(...arguments),this.variant=ve.body1}render(){return this.element?be`
|
|
520
|
+
<${fe(this.element)}
|
|
510
521
|
class="ft-typography ft-typography--${this.variant}">
|
|
511
522
|
<slot></slot>
|
|
512
|
-
</${
|
|
513
|
-
`:
|
|
523
|
+
</${fe(this.element)}>
|
|
524
|
+
`:be`
|
|
514
525
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
515
|
-
`}}
|
|
526
|
+
`}}$e.styles=[ot,st,nt,rt,at,lt,ht,dt,pt,ct,ft],me([o.property()],$e.prototype,"element",void 0),me([o.property()],$e.prototype,"variant",void 0),e.customElement("ft-typography")($e),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=""}(ge||(ge={})),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=""}(xe||(xe={})),new Map([...["abw"].map((t=>[t,xe.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,xe.AUDIO])),...["avi"].map((t=>[t,xe.AVI])),...["chm","xhs"].map((t=>[t,xe.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,xe.CODE])),...["csv"].map((t=>[t,xe.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,xe.DITA])),...["epub"].map((t=>[t,xe.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,xe.EXCEL])),...["flac"].map((t=>[t,xe.FLAC])),...["gif"].map((t=>[t,xe.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,xe.GZIP])),...["html","htm","xhtml"].map((t=>[t,xe.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,xe.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,xe.JPEG])),...["json"].map((t=>[t,xe.JSON])),...["m4a","m4p"].map((t=>[t,xe.M4A])),...["mov","qt"].map((t=>[t,xe.MOV])),...["mp3"].map((t=>[t,xe.MP3])),...["mp4","m4v"].map((t=>[t,xe.MP4])),...["ogg","oga"].map((t=>[t,xe.OGG])),...["pdf","ps"].map((t=>[t,xe.PDF])),...["png"].map((t=>[t,xe.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,xe.POWERPOINT])),...["rar"].map((t=>[t,xe.RAR])),...["stp"].map((t=>[t,xe.STP])),...["txt","rtf","md","mdown"].map((t=>[t,xe.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,xe.VIDEO])),...["wav"].map((t=>[t,xe.WAV])),...["wma"].map((t=>[t,xe.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,xe.WORD])),...["xml","xsl","rdf"].map((t=>[t,xe.XML])),...["yaml","yml","x-yaml"].map((t=>[t,xe.YAML])),...["zip"].map((t=>[t,xe.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(ye||(ye={}));var we=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ke extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=i.nothing}render(){var t;const e=null!==(t=this.variant)&&void 0!==t?t:ye.fluid_topics,o="material"!==e||this.value;return i.html`
|
|
516
527
|
<i class="ft-icon ${"ft-icon--"+e}">
|
|
517
528
|
${s.unsafeHTML(this.resolvedIcon)}
|
|
518
529
|
<slot ?hidden=${o}></slot>
|
|
519
530
|
</i>
|
|
520
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case
|
|
531
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let o=this.value||this.textContent;switch(this.variant){case ye.file_format:this.resolvedIcon=null!==(t=xe[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case ye.material:this.resolvedIcon=this.value||i.nothing;break;default:this.resolvedIcon=null!==(e=ge[o.replace("-","_").toUpperCase()])&&void 0!==e?e:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}ke.elementDefinitions={},ke.styles=gt,we([o.property()],ke.prototype,"variant",void 0),we([o.property()],ke.prototype,"value",void 0),we([o.state()],ke.prototype,"resolvedIcon",void 0),we([o.query("slot")],ke.prototype,"slottedContent",void 0),e.customElement("ft-icon")(ke);const _e=e.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Se=e.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),Ie=e.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),ze=e.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),Ce=e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),Te=e.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Oe=i.css`
|
|
521
532
|
.ft-tooltip--container {
|
|
522
533
|
display: block;
|
|
523
534
|
position: relative;
|
|
@@ -533,23 +544,23 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
533
544
|
box-sizing: border-box;
|
|
534
545
|
overflow: hidden;
|
|
535
546
|
width: max-content;
|
|
536
|
-
max-width: ${
|
|
547
|
+
max-width: ${Te};
|
|
537
548
|
text-align: center;
|
|
538
|
-
padding: ${
|
|
539
|
-
z-index: ${
|
|
549
|
+
padding: ${_e};
|
|
550
|
+
z-index: ${ze};
|
|
540
551
|
}
|
|
541
552
|
|
|
542
553
|
.ft-tooltip--content {
|
|
543
554
|
padding: 4px 8px;
|
|
544
|
-
border-radius: ${
|
|
545
|
-
background-color: ${
|
|
546
|
-
color: ${
|
|
555
|
+
border-radius: ${Ce};
|
|
556
|
+
background-color: ${Ie};
|
|
557
|
+
color: ${Se};
|
|
547
558
|
top: -500px;
|
|
548
559
|
left: -500px;
|
|
549
560
|
position: relative;
|
|
550
561
|
word-break: break-word;
|
|
551
562
|
}
|
|
552
|
-
`;var
|
|
563
|
+
`;var Re=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ne extends e.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 e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return i.html`
|
|
553
564
|
<div part="container"
|
|
554
565
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
555
566
|
@mouseenter=${this.onHover}
|
|
@@ -567,7 +578,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
567
578
|
</div>
|
|
568
579
|
</div>
|
|
569
580
|
</div>
|
|
570
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((e=>t.has(e)))&&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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.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=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${
|
|
581
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((e=>t.has(e)))&&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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.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=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${Te})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}Ne.elementDefinitions={"ft-typography":$e},Ne.styles=Oe,Re([o.property()],Ne.prototype,"text",void 0),Re([o.property({type:Boolean})],Ne.prototype,"manual",void 0),Re([o.property({type:Boolean})],Ne.prototype,"inline",void 0),Re([o.property({type:Number})],Ne.prototype,"delay",void 0),Re([o.property()],Ne.prototype,"position",void 0),Re([o.queryAssignedNodes("",!0)],Ne.prototype,"slotNodes",void 0),Re([o.query(".ft-tooltip--container")],Ne.prototype,"container",void 0),Re([o.query("slot")],Ne.prototype,"target",void 0),Re([o.query(".ft-tooltip")],Ne.prototype,"tooltip",void 0),Re([o.query(".ft-tooltip--content")],Ne.prototype,"tooltipContent",void 0),Re([o.state()],Ne.prototype,"visible",void 0),e.customElement("ft-tooltip")(Ne);var De=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ee extends e.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new e.Debouncer(10),this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),n=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return i.html`
|
|
571
582
|
<style>
|
|
572
583
|
.ft-ripple .ft-ripple--effect,
|
|
573
584
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -584,7 +595,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
584
595
|
<div class="ft-ripple--background"></div>
|
|
585
596
|
<div class="ft-ripple--effect"></div>
|
|
586
597
|
</div>
|
|
587
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}))}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}
|
|
598
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>{var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}))}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}Ee.elementDefinitions={},Ee.styles=x,De([o.property({type:Boolean})],Ee.prototype,"primary",void 0),De([o.property({type:Boolean})],Ee.prototype,"secondary",void 0),De([o.property({type:Boolean})],Ee.prototype,"unbounded",void 0),De([o.property({type:Boolean})],Ee.prototype,"activated",void 0),De([o.property({type:Boolean})],Ee.prototype,"selected",void 0),De([o.property({type:Boolean})],Ee.prototype,"disabled",void 0),De([o.state()],Ee.prototype,"hovered",void 0),De([o.state()],Ee.prototype,"focused",void 0),De([o.state()],Ee.prototype,"pressed",void 0),De([o.state()],Ee.prototype,"rippling",void 0),De([o.state()],Ee.prototype,"rippleSize",void 0),De([o.state()],Ee.prototype,"originX",void 0),De([o.state()],Ee.prototype,"originY",void 0),De([o.query(".ft-ripple")],Ee.prototype,"ripple",void 0),De([o.query(".ft-ripple--effect")],Ee.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(Ee);const Ae={borderRadiusLeft:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left",e.designSystemVariables.borderRadiusL),borderRadiusRight:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right",e.designSystemVariables.borderRadiusL),borderWidthLeft:e.FtCssVariableFactory.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:e.FtCssVariableFactory.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:e.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","SIZE","1px")},Be=i.css`
|
|
588
599
|
.ft-switch-option {
|
|
589
600
|
position: relative;
|
|
590
601
|
display: inline-block;
|
|
@@ -598,20 +609,20 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
598
609
|
}
|
|
599
610
|
|
|
600
611
|
.ft-switch-option--content {
|
|
601
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
602
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
612
|
+
--ft-switch-option-internal-line-height: calc(${zt.fontSize} + 2px);
|
|
613
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${zt.iconSize});
|
|
603
614
|
|
|
604
615
|
border-style: solid;
|
|
605
|
-
border-color: ${
|
|
606
|
-
border-width: ${
|
|
607
|
-
border-radius: ${
|
|
616
|
+
border-color: ${zt.borderColor};
|
|
617
|
+
border-width: ${Ae.borderWidthVertical} ${Ae.borderWidthRight} ${Ae.borderWidthVertical} ${Ae.borderWidthLeft};
|
|
618
|
+
border-radius: ${Ae.borderRadiusLeft} ${Ae.borderRadiusRight} ${Ae.borderRadiusRight} ${Ae.borderRadiusLeft};
|
|
608
619
|
display: flex;
|
|
609
620
|
align-items: center;
|
|
610
621
|
justify-content: center;
|
|
611
622
|
overflow: hidden;
|
|
612
|
-
${e.setVariable(
|
|
623
|
+
${e.setVariable(vt.size,zt.iconSize)};
|
|
613
624
|
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
614
|
-
background-color: ${
|
|
625
|
+
background-color: ${zt.backgroundColor};
|
|
615
626
|
-webkit-mask-image: radial-gradient(white, black);
|
|
616
627
|
}
|
|
617
628
|
|
|
@@ -620,8 +631,8 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
620
631
|
}
|
|
621
632
|
|
|
622
633
|
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
623
|
-
background-color: ${
|
|
624
|
-
border-radius: ${
|
|
634
|
+
background-color: ${zt.selectedBackgroundColor};
|
|
635
|
+
border-radius: ${Ae.borderRadiusLeft} ${Ae.borderRadiusRight} ${Ae.borderRadiusRight} ${Ae.borderRadiusLeft};
|
|
625
636
|
position: absolute;
|
|
626
637
|
inset: 0;
|
|
627
638
|
content: "";
|
|
@@ -630,18 +641,18 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
630
641
|
}
|
|
631
642
|
|
|
632
643
|
.ft-switch-option--label {
|
|
633
|
-
color: ${
|
|
644
|
+
color: ${zt.textColor};
|
|
634
645
|
overflow: hidden;
|
|
635
646
|
white-space: nowrap;
|
|
636
647
|
text-overflow: ellipsis;
|
|
637
648
|
display: block;
|
|
638
649
|
margin: 0 8px;
|
|
639
|
-
${e.setVariable(it.fontSize,
|
|
650
|
+
${e.setVariable(it.fontSize,zt.fontSize)};
|
|
640
651
|
${e.setVariable(it.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
641
652
|
}
|
|
642
653
|
|
|
643
654
|
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
644
|
-
color: ${
|
|
655
|
+
color: ${zt.selectedTextColor};
|
|
645
656
|
}
|
|
646
657
|
|
|
647
658
|
.ft-switch-option--label[hidden] {
|
|
@@ -649,7 +660,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
649
660
|
}
|
|
650
661
|
|
|
651
662
|
.ft-switch-option--ripple {
|
|
652
|
-
${e.setVariable(p.color,
|
|
663
|
+
${e.setVariable(p.color,zt.rippleColor)};
|
|
653
664
|
}
|
|
654
665
|
|
|
655
666
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -662,13 +673,13 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
662
673
|
|
|
663
674
|
ft-icon {
|
|
664
675
|
flex-shrink: 0;
|
|
665
|
-
color: ${
|
|
676
|
+
color: ${zt.iconColor};
|
|
666
677
|
}
|
|
667
678
|
|
|
668
679
|
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
669
|
-
color: ${
|
|
680
|
+
color: ${zt.selectedTextColor};
|
|
670
681
|
}
|
|
671
|
-
`;var
|
|
682
|
+
`;var je=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Me extends CustomEvent{constructor(){super("option-change",{bubbles:!0,composed:!0})}}class Ue extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.iconVariant=ye.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 Me)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(i.html`
|
|
672
683
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
673
684
|
@click=${this.onChange}>
|
|
674
685
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
@@ -692,19 +703,19 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
692
703
|
</ft-tooltip>
|
|
693
704
|
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?i.html`
|
|
694
705
|
<ft-icon part="icon" .variant=${this.iconVariant} value=${this.icon}></ft-icon>
|
|
695
|
-
`:i.nothing}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}
|
|
706
|
+
`:i.nothing}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}Ue.elementDefinitions={"ft-ripple":Ee,"ft-typography":$e,"ft-tooltip":Ne,"ft-icon":ke},Ue.styles=[e.safariEllipsisFix,Be],je([o.property()],Ue.prototype,"value",void 0),je([o.property()],Ue.prototype,"icon",void 0),je([o.property()],Ue.prototype,"iconVariant",void 0),je([o.property()],Ue.prototype,"label",void 0),je([o.property()],Ue.prototype,"tooltipPosition",void 0),je([o.property({type:Boolean,reflect:!0})],Ue.prototype,"selected",void 0),je([o.property({type:Boolean})],Ue.prototype,"trailingIcon",void 0),je([o.property({type:Boolean})],Ue.prototype,"unselectable",void 0),je([o.query(".ft-switch-option--content slot")],Ue.prototype,"slottedContent",void 0),je([o.query(".ft-switch-option--input")],Ue.prototype,"input",void 0);var Fe=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Le extends CustomEvent{constructor(t){super("change",{detail:t})}}class Pe extends e.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 e;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new Le(null===(e=this.selectedOption)||void 0===e?void 0:e.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return i.html`
|
|
696
707
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
697
708
|
<slot @slotchange=${this.onSlotchange}
|
|
698
709
|
@option-change=${this.onOptionChange}></slot>
|
|
699
710
|
</div>
|
|
700
|
-
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].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
|
|
711
|
+
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].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 Ue&&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){t.stopPropagation();let e=t.target;e.selected?this.selectedOption=e:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Pe.elementDefinitions={},Pe.styles=i.css`
|
|
701
712
|
:host {
|
|
702
713
|
display: inline-block;
|
|
703
714
|
}
|
|
704
715
|
|
|
705
716
|
.ft-switch {
|
|
706
|
-
border-radius: ${
|
|
707
|
-
outline-color: ${
|
|
717
|
+
border-radius: ${zt.borderRadius};
|
|
718
|
+
outline-color: ${zt.outlineColor};
|
|
708
719
|
}
|
|
709
720
|
|
|
710
721
|
.ft-switch slot {
|
|
@@ -713,25 +724,25 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
713
724
|
}
|
|
714
725
|
|
|
715
726
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
716
|
-
${e.setVariable(
|
|
717
|
-
${e.setVariable(
|
|
718
|
-
${e.setVariable(
|
|
727
|
+
${e.setVariable(Ae.borderRadiusLeft,"0")};
|
|
728
|
+
${e.setVariable(Ae.borderRadiusRight,"0")};
|
|
729
|
+
${e.setVariable(Ae.borderWidthLeft,"0")};
|
|
719
730
|
}
|
|
720
731
|
|
|
721
732
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
722
|
-
${e.setVariable(
|
|
723
|
-
${e.setVariable(
|
|
733
|
+
${e.setVariable(Ae.borderRadiusLeft,zt.borderRadius)};
|
|
734
|
+
${e.setVariable(Ae.borderWidthLeft,"1px")};
|
|
724
735
|
}
|
|
725
736
|
|
|
726
737
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
727
|
-
${e.setVariable(
|
|
738
|
+
${e.setVariable(Ae.borderRadiusRight,zt.borderRadius)};
|
|
728
739
|
}
|
|
729
740
|
|
|
730
741
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
731
742
|
--ft-switch-internal-vertical-padding: 2px;
|
|
732
743
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
733
744
|
}
|
|
734
|
-
`,
|
|
745
|
+
`,Fe([o.property({type:Boolean})],Pe.prototype,"dense",void 0),Fe([o.property({type:Boolean})],Pe.prototype,"unselectable",void 0),Fe([o.query(".ft-switch slot")],Pe.prototype,"slottedContent",void 0),Fe([o.state()],Pe.prototype,"selectedOption",void 0),Fe([o.query(".ft-switch")],Pe.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(Pe),e.customElement("ft-switch-option")(Ue);const He=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),Ze=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),We=i.css`
|
|
735
746
|
:host {
|
|
736
747
|
display: block;
|
|
737
748
|
}
|
|
@@ -742,14 +753,14 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
742
753
|
|
|
743
754
|
ft-icon {
|
|
744
755
|
transform: rotate(-45deg);
|
|
745
|
-
color: ${
|
|
756
|
+
color: ${He};
|
|
746
757
|
}
|
|
747
758
|
|
|
748
759
|
.ft-resizer--dragging ft-icon,
|
|
749
760
|
.ft-resizer:hover ft-icon {
|
|
750
|
-
color: ${
|
|
761
|
+
color: ${Ze};
|
|
751
762
|
}
|
|
752
|
-
`;var
|
|
763
|
+
`;var Ve=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ge extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class Ke extends e.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 i.html`
|
|
753
764
|
<style>
|
|
754
765
|
.ft-resizer {
|
|
755
766
|
cursor: ${i.unsafeCSS(this.cursor)}
|
|
@@ -760,25 +771,25 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
760
771
|
@touchstart=${this.initDragFromTouch}>
|
|
761
772
|
<ft-icon variant="material">${this.icon}</ft-icon>
|
|
762
773
|
</div>
|
|
763
|
-
`}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,e){this.dragging=!0,this.startX=t,this.startY=e,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,e){let i=this.fixedWidth+t-this.startX,o=this.fixedHeight+e-this.startY;this.dispatchEvent(new
|
|
774
|
+
`}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,e){this.dragging=!0,this.startX=t,this.startY=e,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,e){let i=this.fixedWidth+t-this.startX,o=this.fixedHeight+e-this.startY;this.dispatchEvent(new Ge(i,o))}}Ke.elementDefinitions={"ft-icon":ke},Ke.styles=[e.noTextSelect,We],Ve([o.property({type:Number})],Ke.prototype,"initialWidth",void 0),Ve([o.property({type:Number})],Ke.prototype,"initialHeight",void 0),Ve([o.property()],Ke.prototype,"icon",void 0),Ve([o.property()],Ke.prototype,"cursor",void 0),Ve([o.state()],Ke.prototype,"dragging",void 0),e.customElement("ft-resizer")(Ke);const Ye={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},qe=i.css`
|
|
764
775
|
.ft-input-label {
|
|
765
776
|
position: absolute;
|
|
766
777
|
inset: 0;
|
|
767
778
|
display: flex;
|
|
768
|
-
background-color: ${
|
|
769
|
-
border-radius: ${
|
|
779
|
+
background-color: ${Ye.colorSurface};
|
|
780
|
+
border-radius: ${Ye.borderRadiusS} ${Ye.borderRadiusS} 0 0;
|
|
770
781
|
}
|
|
771
782
|
|
|
772
783
|
.ft-input-label--outlined {
|
|
773
|
-
border-radius: ${
|
|
784
|
+
border-radius: ${Ye.borderRadiusS};
|
|
774
785
|
}
|
|
775
786
|
|
|
776
787
|
.ft-input-label {
|
|
777
|
-
border-color: ${
|
|
788
|
+
border-color: ${Ye.borderColor};
|
|
778
789
|
}
|
|
779
790
|
|
|
780
791
|
.ft-input-label.ft-input-label--in-error {
|
|
781
|
-
border-color: ${
|
|
792
|
+
border-color: ${Ye.colorError}
|
|
782
793
|
}
|
|
783
794
|
|
|
784
795
|
.ft-input-label:before,
|
|
@@ -791,7 +802,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
791
802
|
}
|
|
792
803
|
|
|
793
804
|
.ft-input-label:before {
|
|
794
|
-
width: calc(${
|
|
805
|
+
width: calc(${Ye.horizontalSpacing} - 4px);
|
|
795
806
|
flex-shrink: 0;
|
|
796
807
|
}
|
|
797
808
|
|
|
@@ -807,20 +818,20 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
807
818
|
border-bottom-width: 1px;
|
|
808
819
|
border-bottom-style: solid;
|
|
809
820
|
border-color: inherit;
|
|
810
|
-
color: ${
|
|
821
|
+
color: ${Ye.textColor};
|
|
811
822
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
812
|
-
max-width: calc(${
|
|
823
|
+
max-width: calc(${Ye.labelMaxWidth} - 2 * (${Ye.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
813
824
|
text-overflow: ellipsis;
|
|
814
|
-
${e.setVariable(H.fontSize,
|
|
815
|
-
${e.setVariable(H.lineHeight,
|
|
825
|
+
${e.setVariable(H.fontSize,Ye.fontSize)};
|
|
826
|
+
${e.setVariable(H.lineHeight,Ye.fontSize)};
|
|
816
827
|
}
|
|
817
828
|
|
|
818
829
|
.ft-input-label--in-error .ft-input-label--text {
|
|
819
|
-
color: ${
|
|
830
|
+
color: ${Ye.colorError}
|
|
820
831
|
}
|
|
821
832
|
|
|
822
833
|
.ft-input-label--disabled .ft-input-label--text {
|
|
823
|
-
color: ${
|
|
834
|
+
color: ${Ye.disabledTextColor};
|
|
824
835
|
}
|
|
825
836
|
|
|
826
837
|
.ft-input-label--hidden-text {
|
|
@@ -837,19 +848,19 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
837
848
|
overflow: hidden;
|
|
838
849
|
white-space: nowrap;
|
|
839
850
|
text-overflow: ellipsis;
|
|
840
|
-
padding: ${
|
|
841
|
-
margin: calc(${
|
|
851
|
+
padding: ${Ye.verticalSpacing} 4px;
|
|
852
|
+
margin: calc(${Ye.verticalSpacing} * -1) 0;
|
|
842
853
|
max-width: 100%;
|
|
843
854
|
box-sizing: border-box;
|
|
844
855
|
}
|
|
845
856
|
|
|
846
857
|
.ft-input-label--raised .ft-input-label--text {
|
|
847
|
-
${e.setVariable(H.fontSize,
|
|
848
|
-
${e.setVariable(H.lineHeight,
|
|
858
|
+
${e.setVariable(H.fontSize,Ye.raisedFontSize)};
|
|
859
|
+
${e.setVariable(H.lineHeight,Ye.raisedFontSize)};
|
|
849
860
|
}
|
|
850
861
|
|
|
851
862
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
852
|
-
top: ${
|
|
863
|
+
top: ${Ye.verticalSpacing};
|
|
853
864
|
}
|
|
854
865
|
|
|
855
866
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -862,27 +873,27 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
862
873
|
.ft-input-label--outlined:before {
|
|
863
874
|
border-left-width: 1px;
|
|
864
875
|
border-left-style: solid;
|
|
865
|
-
border-radius: ${
|
|
876
|
+
border-radius: ${Ye.borderRadiusS} 0 0 ${Ye.borderRadiusS};
|
|
866
877
|
}
|
|
867
878
|
|
|
868
879
|
.ft-input-label--outlined:after {
|
|
869
880
|
border-right-width: 1px;
|
|
870
881
|
border-right-style: solid;
|
|
871
|
-
border-radius: 0 ${
|
|
882
|
+
border-radius: 0 ${Ye.borderRadiusS} ${Ye.borderRadiusS} 0;
|
|
872
883
|
}
|
|
873
884
|
|
|
874
885
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
875
886
|
padding: 2px 4px;
|
|
876
|
-
z-index: ${
|
|
877
|
-
background-color: ${
|
|
878
|
-
border-radius: ${
|
|
887
|
+
z-index: ${Ye.raisedZIndex};
|
|
888
|
+
background-color: ${Ye.colorSurface};
|
|
889
|
+
border-radius: ${Ye.borderRadiusS};
|
|
879
890
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
880
891
|
}
|
|
881
892
|
|
|
882
893
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
883
894
|
border-top: none;
|
|
884
895
|
}
|
|
885
|
-
`;var
|
|
896
|
+
`;var Xe=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Je extends e.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return i.html`
|
|
886
897
|
<div class="${n.classMap(t)}">
|
|
887
898
|
${this.text?i.html`
|
|
888
899
|
<div class="ft-input-label--text ft-typography--caption">
|
|
@@ -891,7 +902,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
891
902
|
</div>
|
|
892
903
|
`:null}
|
|
893
904
|
</div>
|
|
894
|
-
`}}
|
|
905
|
+
`}}Je.elementDefinitions={},Je.styles=[ht,qe],Xe([o.property({type:String})],Je.prototype,"text",void 0),Xe([o.property({type:Boolean})],Je.prototype,"raised",void 0),Xe([o.property({type:Boolean})],Je.prototype,"outlined",void 0),Xe([o.property({type:Boolean})],Je.prototype,"disabled",void 0),Xe([o.property({type:Boolean})],Je.prototype,"error",void 0),e.customElement("ft-input-label")(Je);const Qe={fontSize:e.FtCssVariableFactory.create("--ft-text-area-font-size","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-area-label-size","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-area-helper-color",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},ti=i.css`
|
|
895
906
|
*:focus {
|
|
896
907
|
outline: none;
|
|
897
908
|
}
|
|
@@ -903,10 +914,10 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
903
914
|
}
|
|
904
915
|
|
|
905
916
|
ft-input-label {
|
|
906
|
-
${e.setVariable(
|
|
907
|
-
${e.setVariable(
|
|
908
|
-
${e.setVariable(
|
|
909
|
-
${e.setVariable(
|
|
917
|
+
${e.setVariable(Ye.fontSize,Qe.fontSize)};
|
|
918
|
+
${e.setVariable(Ye.raisedFontSize,Qe.labelSize)};
|
|
919
|
+
${e.setVariable(Ye.verticalSpacing,Qe.verticalSpacing)};
|
|
920
|
+
${e.setVariable(Ye.horizontalSpacing,Qe.horizontalSpacing)};
|
|
910
921
|
}
|
|
911
922
|
|
|
912
923
|
.ft-text-area--main-panel {
|
|
@@ -937,12 +948,12 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
937
948
|
align-self: stretch;
|
|
938
949
|
resize: none;
|
|
939
950
|
|
|
940
|
-
${e.setVariable(
|
|
941
|
-
${e.setVariable(
|
|
942
|
-
color: ${
|
|
951
|
+
${e.setVariable(B.fontSize,Qe.fontSize)};
|
|
952
|
+
${e.setVariable(B.lineHeight,Qe.fontSize)};
|
|
953
|
+
color: ${Qe.colorOnSurface};
|
|
943
954
|
|
|
944
|
-
padding: 0 ${
|
|
945
|
-
margin: calc(${
|
|
955
|
+
padding: 0 ${Qe.horizontalSpacing};
|
|
956
|
+
margin: calc(${Qe.verticalSpacing} + ${Qe.labelSize} / 2) 0 ${Qe.verticalSpacing} 0;
|
|
946
957
|
|
|
947
958
|
border: none;
|
|
948
959
|
background: none;
|
|
@@ -951,7 +962,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
951
962
|
}
|
|
952
963
|
|
|
953
964
|
.ft-text-area--disabled .ft-text-area--input {
|
|
954
|
-
color: ${
|
|
965
|
+
color: ${Qe.colorOnSurfaceDisabled};
|
|
955
966
|
}
|
|
956
967
|
|
|
957
968
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -959,32 +970,32 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
959
970
|
}
|
|
960
971
|
|
|
961
972
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
962
|
-
${e.setVariable(
|
|
963
|
-
${e.setVariable(
|
|
973
|
+
${e.setVariable(Ye.borderColor,Qe.colorPrimary)};
|
|
974
|
+
${e.setVariable(Ye.textColor,Qe.colorPrimary)};
|
|
964
975
|
}
|
|
965
976
|
|
|
966
977
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
967
|
-
border-radius: ${
|
|
978
|
+
border-radius: ${Qe.borderRadiusS} ${Qe.borderRadiusS} 0 0;
|
|
968
979
|
}
|
|
969
980
|
|
|
970
981
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
971
982
|
align-self: stretch;
|
|
972
|
-
margin-bottom: ${
|
|
973
|
-
margin-top: calc(${
|
|
983
|
+
margin-bottom: ${Qe.verticalSpacing};
|
|
984
|
+
margin-top: calc(${Qe.labelSize} + 2 * ${Qe.verticalSpacing});
|
|
974
985
|
}
|
|
975
986
|
|
|
976
987
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
977
|
-
border-radius: ${
|
|
988
|
+
border-radius: ${Qe.borderRadiusS};
|
|
978
989
|
}
|
|
979
990
|
|
|
980
991
|
.ft-text-area--helper-text {
|
|
981
|
-
padding: 0 12px 0 ${
|
|
982
|
-
color: ${
|
|
992
|
+
padding: 0 12px 0 ${Qe.horizontalSpacing};
|
|
993
|
+
color: ${Qe.helperColor};
|
|
983
994
|
}
|
|
984
995
|
|
|
985
996
|
.ft-text-area--in-error .ft-text-area--input,
|
|
986
997
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
987
|
-
color: ${
|
|
998
|
+
color: ${Qe.colorError};
|
|
988
999
|
}
|
|
989
1000
|
|
|
990
1001
|
ft-resizer {
|
|
@@ -992,10 +1003,10 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
992
1003
|
right: 0;
|
|
993
1004
|
bottom: 0;
|
|
994
1005
|
}
|
|
995
|
-
`;var
|
|
1006
|
+
`;var ei=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ii extends e.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 i.html`
|
|
996
1007
|
<style>
|
|
997
1008
|
.ft-text-area--main-panel {
|
|
998
|
-
height: calc(4 * ${
|
|
1009
|
+
height: calc(4 * ${Qe.verticalSpacing} + ${Qe.labelSize} + ${Qe.fontSize} + ${this.height}px);
|
|
999
1010
|
}
|
|
1000
1011
|
</style>
|
|
1001
1012
|
<div class="${n.classMap(t)}">
|
|
@@ -1030,14 +1041,14 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1030
1041
|
${this.helper}
|
|
1031
1042
|
</ft-typography>`:void 0}
|
|
1032
1043
|
</div>
|
|
1033
|
-
`}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)}}
|
|
1044
|
+
`}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)}}ii.elementDefinitions={"ft-input-label":Je,"ft-resizer":Ke,"ft-ripple":Ee,"ft-typography":$e},ii.styles=[at,ti],ei([o.property({type:String})],ii.prototype,"label",void 0),ei([o.property({reflect:!0})],ii.prototype,"value",void 0),ei([o.property({type:String})],ii.prototype,"helper",void 0),ei([o.property({type:Boolean})],ii.prototype,"outlined",void 0),ei([o.property({type:Boolean})],ii.prototype,"disabled",void 0),ei([o.property({type:Boolean})],ii.prototype,"error",void 0),ei([o.property({type:Number,reflect:!0})],ii.prototype,"height",void 0),ei([o.query("textarea")],ii.prototype,"textarea",void 0),ei([o.state()],ii.prototype,"focused",void 0),e.customElement("ft-text-area")(ii);class oi extends e.FtLitElement{render(){return i.html`
|
|
1034
1045
|
<div class="ft-loader">
|
|
1035
1046
|
<div></div>
|
|
1036
1047
|
<div></div>
|
|
1037
1048
|
<div></div>
|
|
1038
1049
|
<div></div>
|
|
1039
1050
|
</div>
|
|
1040
|
-
`}}
|
|
1051
|
+
`}}oi.styles=bt,e.customElement("ft-loader")(oi);var si=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ni extends e.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=ye.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(i.html`
|
|
1041
1052
|
<button part="button"
|
|
1042
1053
|
class="${n.classMap(t)}"
|
|
1043
1054
|
aria-label="${this.getLabel()}"
|
|
@@ -1060,13 +1071,13 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1060
1071
|
</ft-tooltip>
|
|
1061
1072
|
`:t}resolveIcon(){return this.loading?i.html`
|
|
1062
1073
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?i.html`
|
|
1063
|
-
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
1064
|
-
`,
|
|
1065
|
-
`,
|
|
1074
|
+
<ft-icon part="icon" variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:i.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ni.elementDefinitions={"ft-ripple":Ee,"ft-tooltip":Ne,"ft-typography":$e,"ft-icon":ke,"ft-loader":oi},ni.styles=[e.safariEllipsisFix,It],si([o.property({type:String,reflect:!0})],ni.prototype,"role",void 0),si([o.property({type:Boolean})],ni.prototype,"primary",void 0),si([o.property({type:Boolean})],ni.prototype,"outlined",void 0),si([o.property({type:Boolean})],ni.prototype,"disabled",void 0),si([o.property({type:Boolean})],ni.prototype,"dense",void 0),si([o.property({type:Boolean})],ni.prototype,"round",void 0),si([o.property({type:String})],ni.prototype,"label",void 0),si([o.property({type:String})],ni.prototype,"icon",void 0),si([o.property({type:String})],ni.prototype,"iconVariant",void 0),si([o.property({type:Boolean})],ni.prototype,"trailingIcon",void 0),si([o.property({type:Boolean})],ni.prototype,"loading",void 0),si([o.property({type:String})],ni.prototype,"tooltipPosition",void 0),si([o.property({type:Boolean})],ni.prototype,"hideTooltip",void 0),si([o.property({type:Boolean})],ni.prototype,"forceTooltip",void 0),si([o.query(".ft-button")],ni.prototype,"button",void 0),si([o.query(".ft-button--label slot")],ni.prototype,"slottedContent",void 0),e.customElement("ft-button")(ni);const ri=i.css`
|
|
1075
|
+
`,ai=i.css`
|
|
1076
|
+
`,li=e.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class hi{static build(t){const{baseUrl:e,apiIntegrationIdentifier:i}=li.getState(),o=null!=t?t:i;if(e&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,o,!0)}static get(t){var e;return null!=t?hi.build(t):null!==(e=hi.API)&&void 0!==e?e:hi.API=hi.build()}static await(t){return new Promise((e=>{let i=hi.get(t);if(i)e(i);else{const o=li.subscribe((()=>{i=hi.get(t),i&&(o(),e(i))}))}}))}}var di;const pi=Symbol("clearAfterUnitTest");class ci{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[di]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=li.getState().uiLocale,li.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=li.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,i){var o;if(t=t.toLowerCase(),Object.keys(i).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...i};e.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,i,...o){var s,n,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(s=this.cache.getNow(t))||void 0===s?void 0:s.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(i,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var i;return t=t.toLowerCase(),this.listeners[t]=null!==(i=this.listeners[t])&&void 0!==i?i:new Set,this.listeners[t].add(e),()=>{var i;return null===(i=this.listeners[t])||void 0===i?void 0:i.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>e.delay(0).then((()=>t())).catch((()=>null)))))}}di=pi,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new ci((async(t,e)=>(await hi.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new ci((async(t,e)=>(await hi.await()).getCustomMessageContext(t,e))));const fi=window.FluidTopicsI18nService,ui=window.FluidTopicsCustomI18nService;var bi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class vi extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>hi.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return i.html`
|
|
1066
1077
|
<slot></slot>
|
|
1067
|
-
`}updated(t){super.updated(t),t.has("baseUrl")&&
|
|
1078
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&li.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&li.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&li.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&li.actions.setNoCustom(this.noCustom),t.has("editorMode")&&li.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&li.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&li.actions.setSession(this.session),t.has("availableUiLocales")&&li.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>fi.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}vi.elementDefinitions={},vi.styles=ai,bi([o.property()],vi.prototype,"baseUrl",void 0),bi([o.property()],vi.prototype,"apiIntegrationIdentifier",void 0),bi([o.property()],vi.prototype,"uiLocale",void 0),bi([e.jsonProperty([])],vi.prototype,"availableUiLocales",void 0),bi([o.property({type:Boolean})],vi.prototype,"editorMode",void 0),bi([o.property({type:Boolean})],vi.prototype,"noCustom",void 0),bi([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],vi.prototype,"noCustomComponent",void 0),bi([o.property({type:Boolean})],vi.prototype,"withManualResources",void 0),bi([e.jsonProperty([])],vi.prototype,"messageContexts",void 0),bi([e.jsonProperty(void 0)],vi.prototype,"session",void 0),bi([o.property({type:Object})],vi.prototype,"apiProvider",void 0),e.customElement("ft-app-context")(vi);var gi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const xi=Symbol("i18nProperties"),yi=Symbol("i18nUnsubs");function mi(t){var e;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?ui:fi}i18n(t,e,...i){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...i);const s=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...s)}onI18nUpdate(t){var e;null===(e=this[xi])||void 0===e||e.forEach(((e,i)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[i]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updated(t){var e;super.updated(t),null===(e=this[xi])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[xi]&&new Set([...this[xi].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[yi].has(t)||this[yi].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[yi].forEach((t=>t())),this[yi].clear()}}return e=yi,gi([o.property({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}class $i extends(mi(e.FtLitElement)){}class wi extends(mi(e.FtLitElementRedux)){}var ki=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class _i extends wi{constructor(){super(),this.editorMode=!1,this.addStore(li)}render(){return this.key&&this.context?i.html`
|
|
1068
1079
|
<span class="ft-i18n">${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}</span>
|
|
1069
|
-
`:this.editorMode?"Select a context and a label key.":i.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}
|
|
1080
|
+
`:this.editorMode?"Select a context and a label key.":i.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}_i.elementDefinitions={},_i.styles=ri,ki([e.redux()],_i.prototype,"editorMode",void 0),ki([o.property()],_i.prototype,"context",void 0),ki([o.property()],_i.prototype,"key",void 0),ki([e.jsonProperty([])],_i.prototype,"args",void 0),ki([o.property()],_i.prototype,"defaultMessage",void 0);class Si{constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const i=e;return t=>({context:this.name,key:i,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>fi.resolveMessage(this.name,e,...t)})}static build(t){return new Si(t)}static fromGwt(t){return new Si(t)}}const Ii=t=>(e,i)=>{var o,s;e.constructor.createProperty(i,{attribute:!1,type:String});const n={...t,key:null!==(o=t.key)&&void 0!==o?o:i};e[xi]=null!==(s=e[xi])&&void 0!==s?s:new Map,e[xi].set(i,n)};e.customElement("ft-i18n")(_i);const zi=Si.build("integratedFeedbackComponent"),Ci={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.",mapFeedbackMainTitle:"Send feedback",mapRatingSectionTitle:"Rate this document",mapDichotomousRatingSectionTitle:"Did it solve your problem?",mapFeedbackSectionTitle:"Write your review",topicFeedbackMainTitle:"Send feedback",topicRatingSectionTitle:"Rate this content",topicDichotomousRatingSectionTitle:"Did this content solve your problem?",topicFeedbackSectionTitle:"Write your review"},Ti=Si.build("inDesignerFeedbackComponent"),Oi={ratingNotConfigured:"Rating unavailable: no rating configured for this content.",missingRatingRole:"Rating unavailable: missing role RATING_USER.",missingFeedbackRole:"Feedback unavailable: missing role FEEDBACK_USER.",inDesignerOnlyNotice:"This notice will not appear outside this designer.",feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."};var Ri=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ni extends $i{constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.feedbackMessage="",this.iconVariant=ye.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.addI18nContext(zi,Ci),this.addI18nContext(Ti,Oi)}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,e;return null!==(e=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==e?e:"NO_RATING"}get ratingType(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==i?i:"NO_RATING"}get ratingValue(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==i?i:-1}get ratingDate(){var t,i;const o=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.date;return"string"==typeof o?e.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?i.html`
|
|
1070
1081
|
<div class="ft-reader-feedback">
|
|
1071
1082
|
${this.hideTitle?i.nothing:i.html`
|
|
1072
1083
|
<ft-typography variant="title" part="main-title">
|
|
@@ -1086,11 +1097,11 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1086
1097
|
${this.renderRatingDate()}
|
|
1087
1098
|
</ft-typography>
|
|
1088
1099
|
</div>
|
|
1089
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1100
|
+
`:this.placeholderInEditor(this.userHasRatingRole?Ti.messages.ratingNotConfigured():Ti.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return zi.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return zi.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?zi.messages.ratedToday():zi.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return i.html`
|
|
1090
1101
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1091
1102
|
${r.repeat(new Array(5),((t,e)=>e),((t,e)=>{let o="STARS"===this.ratingType&&this.ratingValue>e;const s=e+1;return i.html`
|
|
1092
1103
|
<ft-button round part="rating-stars-${s}"
|
|
1093
|
-
label="${
|
|
1104
|
+
label="${zi.messages.starsRating(s)}"
|
|
1094
1105
|
tooltipPosition="top"
|
|
1095
1106
|
.iconVariant=${this.iconVariant}
|
|
1096
1107
|
icon="${o?this.filledStarIcon:this.emptyStarIcon}"
|
|
@@ -1105,13 +1116,13 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1105
1116
|
?selected=${e}
|
|
1106
1117
|
.iconVariant=${this.iconVariant}
|
|
1107
1118
|
icon="${e?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1108
|
-
${
|
|
1119
|
+
${zi.messages.like()}
|
|
1109
1120
|
</ft-switch-option>
|
|
1110
1121
|
<ft-switch-option .value=${0}
|
|
1111
1122
|
?selected=${t}
|
|
1112
1123
|
.iconVariant=${this.iconVariant}
|
|
1113
1124
|
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1114
|
-
${
|
|
1125
|
+
${zi.messages.dislike()}
|
|
1115
1126
|
</ft-switch-option>
|
|
1116
1127
|
</ft-switch>
|
|
1117
1128
|
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return i.html`
|
|
@@ -1119,11 +1130,11 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1119
1130
|
part="rating rating-dichotomous">
|
|
1120
1131
|
<ft-switch-option .value=${1}
|
|
1121
1132
|
?selected=${s}>
|
|
1122
|
-
${
|
|
1133
|
+
${zi.messages.dichotomousYes()}
|
|
1123
1134
|
</ft-switch-option>
|
|
1124
1135
|
<ft-switch-option .value=${0}
|
|
1125
1136
|
?selected=${o}>
|
|
1126
|
-
${
|
|
1137
|
+
${zi.messages.dichotomousNo()}
|
|
1127
1138
|
</ft-switch-option>
|
|
1128
1139
|
</ft-switch>
|
|
1129
1140
|
`}return i.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){if(this.canAccessFeedback){const t=this.feedbackMailLinkBuilder(this.feedbackMessage);let e=i.html`
|
|
@@ -1132,7 +1143,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1132
1143
|
?disabled=${!this.feedbackMessage}
|
|
1133
1144
|
@click=${()=>t?this.clearFeedbackInput():this.sendFeedback()}
|
|
1134
1145
|
part="send-feedback">
|
|
1135
|
-
${
|
|
1146
|
+
${zi.messages.okButton()}
|
|
1136
1147
|
</ft-button>
|
|
1137
1148
|
`;return t&&(e=i.html`
|
|
1138
1149
|
<a class="ft-reader-feedback--feedback-link" href="${t}">
|
|
@@ -1145,20 +1156,20 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1145
1156
|
</ft-typography>
|
|
1146
1157
|
<ft-text-area outlined
|
|
1147
1158
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1148
|
-
label="${
|
|
1159
|
+
label="${zi.messages.feedbackInputLabel()}"
|
|
1149
1160
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1150
1161
|
></ft-text-area>
|
|
1151
1162
|
${e}
|
|
1152
1163
|
</div>
|
|
1153
|
-
`}return this.placeholderInEditor(
|
|
1164
|
+
`}return this.placeholderInEditor(Ti.messages.missingFeedbackRole())}sendFeedback(){this.dispatchEvent(new CustomEvent("send-feedback",{detail:this.feedbackInput.value}))}placeholderInEditor(t){return this.editorMode?i.html`
|
|
1154
1165
|
<div class="ft-reader-feedback--placeholder">
|
|
1155
1166
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1156
1167
|
<ft-tooltip position="left"
|
|
1157
|
-
text="${
|
|
1168
|
+
text="${Ti.messages.inDesignerOnlyNotice()}">
|
|
1158
1169
|
<ft-icon>INFO</ft-icon>
|
|
1159
1170
|
</ft-tooltip>
|
|
1160
1171
|
</div>
|
|
1161
|
-
`:i.nothing}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}
|
|
1172
|
+
`:i.nothing}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Ni.elementDefinitions={"ft-button":ni,"ft-typography":$e,"ft-icon":ke,"ft-tooltip":Ne,"ft-switch":Pe,"ft-switch-option":Ue,"ft-text-area":ii},Ni.styles=Tt,Ri([o.property({type:Boolean})],Ni.prototype,"editorMode",void 0),Ri([o.property({type:Boolean})],Ni.prototype,"hideTitle",void 0),Ri([o.property({type:Boolean})],Ni.prototype,"ratingAllowed",void 0),Ri([o.property({attribute:!1})],Ni.prototype,"i18nProperties",void 0),Ri([o.property({attribute:!1})],Ni.prototype,"ratingSummary",void 0),Ri([o.property({attribute:!1})],Ni.prototype,"user",void 0),Ri([o.query(".ft-reader-feedback--feedback-input")],Ni.prototype,"feedbackInput",void 0),Ri([o.state()],Ni.prototype,"feedbackMessage",void 0),Ri([o.property()],Ni.prototype,"iconVariant",void 0),Ri([o.property()],Ni.prototype,"emptyStarIcon",void 0),Ri([o.property()],Ni.prototype,"filledStarIcon",void 0),Ri([o.property()],Ni.prototype,"emptyLikeIcon",void 0),Ri([o.property()],Ni.prototype,"filledLikeIcon",void 0),Ri([o.property()],Ni.prototype,"emptyDislikeIcon",void 0),Ri([o.property()],Ni.prototype,"filledDislikeIcon",void 0),Ri([o.property()],Ni.prototype,"feedbackMailLinkBuilder",void 0);const Di=Si.fromGwt("server");class Ei{constructor(){this.subject="",this.url="",this.allMetadata="",this.subjectMetadata="",this.isAuthenticated=!1}update(t,e,i,o,s){this.subject=t,this.url=e,this.configuration=o,this.isAuthenticated=s,this.subjectMetadata=o.subjectMetadataIds.map((t=>i.find((e=>e.key===t)))).filter((t=>null!=t)).map((t=>"["+t.values.join(", ")+"]")).join(""),this.allMetadata=i.filter((t=>!t.key.startsWith("ft:"))).map((t=>"["+t.values.join(", ")+"]")).join(" ")}build(t){var e,i;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopics)))return;const o=encodeURIComponent(this.subject+" "+this.subjectMetadata),s=encodeURIComponent(`\n${this.allMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${Di.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(i=this.configuration)||void 0===i?void 0:i.recipients.join(",")}?subject=${o}&body=${s}`}}var Ai=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Bi extends(mi(h)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=ye.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 Ei,this.i18nProperties={feedbackMainTitle:zi.properties.mapFeedbackMainTitle(),ratingSectionTitle:zi.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:zi.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:zi.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(li)}render(){return null==this.map?i.nothing:i.html`
|
|
1162
1173
|
<ft-reader-feedback
|
|
1163
1174
|
ratingAllowed
|
|
1164
1175
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1177,7 +1188,7 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1177
1188
|
@rate=${this.rate}
|
|
1178
1189
|
@send-feedback=${this.sendFeedback}
|
|
1179
1190
|
></ft-reader-feedback>
|
|
1180
|
-
`}updated(t){var e,i,o;super.updated(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.map&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var i,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateMap()):await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:
|
|
1191
|
+
`}updated(t){var e,i,o;super.updated(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.map&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var i,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateMap()):await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:zi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ti.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ti.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(i=this.service)||void 0===i?void 0:i.sendMapFeedback(t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:zi.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:zi.messages.feedbackFailure()}))}}}Bi.elementDefinitions={"ft-reader-feedback":Ni},Ai([e.redux({store:li.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],Bi.prototype,"user",void 0),Ai([e.redux({store:"reader"})],Bi.prototype,"map",void 0),Ai([e.redux({store:li.name})],Bi.prototype,"editorMode",void 0),Ai([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Bi.prototype,"configuration",void 0),Ai([o.state()],Bi.prototype,"ratingSummary",void 0),Ai([o.property({type:Boolean})],Bi.prototype,"hideTitle",void 0),Ai([o.property()],Bi.prototype,"iconVariant",void 0),Ai([o.property()],Bi.prototype,"emptyStarIcon",void 0),Ai([o.property()],Bi.prototype,"filledStarIcon",void 0),Ai([o.property()],Bi.prototype,"emptyLikeIcon",void 0),Ai([o.property()],Bi.prototype,"filledLikeIcon",void 0),Ai([o.property()],Bi.prototype,"emptyDislikeIcon",void 0),Ai([o.property()],Bi.prototype,"filledDislikeIcon",void 0),Ai([o.query("ft-reader-feedback")],Bi.prototype,"readerFeedback",void 0),Ai([Ii(Di.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],Bi.prototype,"mailSubject",void 0);var ji=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Mi extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}class Ui extends(function(t){class e 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 Mi)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return ji([o.state()],e.prototype,"tocNode",void 0),ji([o.state()],e.prototype,"disableContextInteractions",void 0),e}(h)){}var Fi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Li extends(mi(Ui)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=ye.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 Ei,this.i18nProperties={feedbackMainTitle:zi.properties.topicFeedbackMainTitle(),ratingSectionTitle:zi.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:zi.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:zi.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(li)}render(){return null==this.map||null==this.tocNode?i.nothing:i.html`
|
|
1181
1192
|
<ft-reader-feedback
|
|
1182
1193
|
.i18nProperties=${this.i18nProperties}
|
|
1183
1194
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1196,4 +1207,4 @@ const le=Symbol.for(""),he=t=>{if((null==t?void 0:t.r)===le)return null==t?void
|
|
|
1196
1207
|
@rate=${this.rate}
|
|
1197
1208
|
@send-feedback=${this.sendFeedback}
|
|
1198
1209
|
></ft-reader-feedback>
|
|
1199
|
-
`}updated(t){var e,i,o;super.updated(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.tocNode&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var i,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateTopic(this.tocNode.tocId)):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))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:
|
|
1210
|
+
`}updated(t){var e,i,o;super.updated(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;this.tocNode&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(e=this.service)||void 0===e?void 0:e.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var i,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(i=this.service)||void 0===i?void 0:i.unrateTopic(this.tocNode.tocId)):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))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:zi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ti.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var i;try{!this.editorMode&&this.tocNode?(await(null===(i=this.service)||void 0===i?void 0:i.sendTopicFeedback(this.tocNode.tocId,t.detail)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:zi.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Ti.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:zi.messages.feedbackFailure()}))}}}Li.elementDefinitions={"ft-reader-feedback":Ni},Fi([e.redux({store:li.name,selector:t=>{var e;return null===(e=t.session)||void 0===e?void 0:e.profile}})],Li.prototype,"user",void 0),Fi([e.redux({store:"reader"})],Li.prototype,"map",void 0),Fi([e.redux({store:li.name})],Li.prototype,"editorMode",void 0),Fi([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Li.prototype,"configuration",void 0),Fi([o.state()],Li.prototype,"ratingSummary",void 0),Fi([o.property({type:Boolean})],Li.prototype,"hideTitle",void 0),Fi([o.property()],Li.prototype,"iconVariant",void 0),Fi([o.property()],Li.prototype,"emptyStarIcon",void 0),Fi([o.property()],Li.prototype,"filledStarIcon",void 0),Fi([o.property()],Li.prototype,"emptyLikeIcon",void 0),Fi([o.property()],Li.prototype,"filledLikeIcon",void 0),Fi([o.property()],Li.prototype,"emptyDislikeIcon",void 0),Fi([o.property()],Li.prototype,"filledDislikeIcon",void 0),Fi([o.query("ft-reader-feedback")],Li.prototype,"readerFeedback",void 0),Fi([Ii(Di.properties["mail.feedback.subject"]((t=>{var e,i;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(i=t.map)||void 0===i?void 0:i.title]})))],Li.prototype,"mailSubject",void 0),e.customElement("ft-reader-map-feedback")(Bi),e.customElement("ft-reader-topic-feedback")(Li),t.FtReaderFeedbackCssVariables=Ct,t.FtReaderMapFeedback=Bi,t.FtReaderTopicFeedback=Li,t.styles=Tt,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|