@fluid-topics/ft-snap-scroll 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-snap-scroll.css.d.ts +8 -0
- package/build/ft-snap-scroll.css.js +137 -0
- package/build/ft-snap-scroll.d.ts +1 -12
- package/build/ft-snap-scroll.js +5 -136
- package/build/ft-snap-scroll.light.js +471 -477
- package/build/ft-snap-scroll.min.js +479 -479
- package/build/ft-snap-scroll.properties.d.ts +7 -0
- package/build/ft-snap-scroll.properties.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +4 -4
|
@@ -1,122 +1,116 @@
|
|
|
1
|
-
!function(t,i,e,o,s,n){
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
width: ${this.rippleSize}px;
|
|
6
|
-
height: ${this.rippleSize}px;
|
|
7
|
-
}
|
|
1
|
+
!function(t,i,e,o,s,n){const r=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),l={color:r,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",r),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")},a=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),h=a,p=i.FtCssVariableFactory.extend("--ft-ripple-background-color",a),f=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),c=f,d=i.FtCssVariableFactory.extend("--ft-ripple-background-color",f),u=e.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<div class="${s.classMap(t)}">
|
|
15
|
-
<div class="ft-ripple--background"></div>
|
|
16
|
-
<div class="ft-ripple--effect"></div>
|
|
17
|
-
</div>
|
|
18
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}
|
|
19
|
-
/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2017 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/
|
|
24
|
-
var x;g.elementDefinitions={},g.styles=e.css`
|
|
25
|
-
:host {
|
|
26
|
-
display: contents;
|
|
27
|
-
}
|
|
6
|
+
.ft-ripple {
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset: 0;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
28
11
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
}
|
|
12
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
34
15
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
.ft-ripple .ft-ripple--background,
|
|
17
|
+
.ft-ripple .ft-ripple--effect {
|
|
18
|
+
position: absolute;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
38
21
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
opacity: 0;
|
|
43
|
-
}
|
|
22
|
+
.ft-ripple .ft-ripple--background {
|
|
23
|
+
background-color: ${l.backgroundColor};
|
|
24
|
+
}
|
|
44
25
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
.ft-ripple .ft-ripple--effect {
|
|
27
|
+
background-color: ${l.color};
|
|
28
|
+
}
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
31
|
+
background-color: ${d};
|
|
32
|
+
}
|
|
52
33
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
35
|
+
background-color: ${c};
|
|
36
|
+
}
|
|
56
37
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
39
|
+
background-color: ${p};
|
|
40
|
+
}
|
|
60
41
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
43
|
+
background-color: ${h};
|
|
44
|
+
}
|
|
64
45
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
46
|
+
.ft-ripple .ft-ripple--background {
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
height: 100%;
|
|
50
|
+
width: 100%;
|
|
51
|
+
transition: opacity 75ms linear;
|
|
52
|
+
}
|
|
68
53
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
width: 100%;
|
|
74
|
-
transition: opacity 75ms linear;
|
|
75
|
-
}
|
|
54
|
+
.ft-ripple .ft-ripple--effect,
|
|
55
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
}
|
|
76
58
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
59
|
+
.ft-ripple .ft-ripple--effect {
|
|
60
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
61
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
62
|
+
}
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
65
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
66
|
+
left: 50%;
|
|
67
|
+
top: 50%;
|
|
68
|
+
}
|
|
86
69
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
top: 50%;
|
|
91
|
-
}
|
|
70
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
71
|
+
transform: translate(-50%, -50%);
|
|
72
|
+
}
|
|
92
73
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
75
|
+
opacity: ${l.opacityContentOnSurfaceHover};
|
|
76
|
+
}
|
|
96
77
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
78
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
79
|
+
opacity: ${l.opacityContentOnSurfaceSelected};
|
|
80
|
+
}
|
|
100
81
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
83
|
+
opacity: ${l.opacityContentOnSurfaceFocused};
|
|
84
|
+
}
|
|
104
85
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
86
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
87
|
+
opacity: ${l.opacityContentOnSurfacePressed};
|
|
88
|
+
transform: translate(-50%, -50%) scale(1);
|
|
89
|
+
}
|
|
90
|
+
`;var x,g=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class v extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),n=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
91
|
+
<style>
|
|
92
|
+
.ft-ripple .ft-ripple--effect,
|
|
93
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
94
|
+
width: ${this.rippleSize}px;
|
|
95
|
+
height: ${this.rippleSize}px;
|
|
96
|
+
}
|
|
108
97
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
.ft-ripple .ft-ripple--effect {
|
|
99
|
+
left: ${this.originX}px;
|
|
100
|
+
top: ${this.originY}px;
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
103
|
+
<div class="${s.classMap(t)}">
|
|
104
|
+
<div class="ft-ripple--background"></div>
|
|
105
|
+
<div class="ft-ripple--effect"></div>
|
|
106
|
+
</div>
|
|
107
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}v.elementDefinitions={},v.styles=u,g([o.property({type:Boolean})],v.prototype,"primary",void 0),g([o.property({type:Boolean})],v.prototype,"secondary",void 0),g([o.property({type:Boolean})],v.prototype,"unbounded",void 0),g([o.property({type:Boolean})],v.prototype,"activated",void 0),g([o.property({type:Boolean})],v.prototype,"selected",void 0),g([o.property({type:Boolean})],v.prototype,"disabled",void 0),g([o.state()],v.prototype,"hovered",void 0),g([o.state()],v.prototype,"focused",void 0),g([o.state()],v.prototype,"pressed",void 0),g([o.state()],v.prototype,"rippling",void 0),g([o.state()],v.prototype,"rippleSize",void 0),g([o.state()],v.prototype,"originX",void 0),g([o.state()],v.prototype,"originY",void 0),g([o.query(".ft-ripple")],v.prototype,"ripple",void 0),g([o.query(".ft-ripple--effect")],v.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(v);const b=globalThis.trustedTypes,y=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,$="?"+m,w=`<${$}>`,k=document,z=(t="")=>k.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,j=/>/g,T=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),E=/'/g,I=/"/g,_=/^(?:script|style|textarea|title)$/i,B=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),F=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),M=new WeakMap,R=k.createTreeWalker(k,129,null,!1),U=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=C;for(let i=0;i<e;i++){const e=t[i];let l,a,h=-1,p=0;for(;p<e.length&&(r.lastIndex=p,a=r.exec(e),null!==a);)p=r.lastIndex,r===C?"!--"===a[1]?r=N:void 0!==a[1]?r=j:void 0!==a[2]?(_.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=T):void 0!==a[3]&&(r=T):r===T?">"===a[0]?(r=null!=s?s:C,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?T:'"'===a[3]?I:E):r===I||r===E?r=T:r===N||r===j?r=C:(r=T,s=void 0);const f=r===T&&t[i+1].startsWith("/>")?" ":"";n+=r===C?e+w:h>=0?(o.push(l),e.slice(0,h)+"$lit$"+e.slice(h)+m+f):e+m+(-2===h?(o.push(void 0),i):f)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==y?y.createHTML(l):l,o]};class W{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[a,h]=U(t,i);if(this.el=W.createElement(a,e),R.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=R.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(m)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(m),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?K:"?"===i[1]?P:"@"===i[1]?q:L})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(_.test(o.tagName)){const t=o.textContent.split(m),i=t.length-1;if(i>0){o.textContent=b?b.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],z()),R.nextNode(),l.push({type:2,index:++s});o.append(t[i],z())}}}else if(8===o.nodeType)if(o.data===$)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(m,t+1));)l.push({type:7,index:s}),t+=m.length-1}s++}}static createElement(t,i){const e=k.createElement("template");return e.innerHTML=t,e}}function Z(t,i,e=t,o){var s,n,r,l;if(i===F)return i;let a=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const h=S(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=a:e._$Cu=a),void 0!==a&&(i=Z(t,a._$AS(t,i.values),a,o)),i}class D{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:k).importNode(e,!0);R.currentNode=s;let n=R.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let i;2===a.type?i=new H(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new V(n,this,t)),this.v.push(i),a=o[++l]}r!==(null==a?void 0:a.index)&&(n=R.nextNode(),r++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class H{constructor(t,i,e,o){var s;this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Z(this,t,i),S(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==F&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==A&&S(this._$AH)?this._$AA.nextSibling.data=t:this.k(k.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=W.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new D(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=M.get(t.strings);return void 0===i&&M.set(t.strings,i=new W(t)),i}S(t){O(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new H(this.j(z()),this.j(z()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class L{constructor(t,i,e,o,s){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=A}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=Z(this,t,i,0),n=!S(t)||t!==this._$AH&&t!==F,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=Z(this,o[e+r],i,r),l===F&&(l=this._$AH[r]),n||(n=!S(l)||l!==this._$AH[r]),l===A?t=A:t!==A&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class K extends L{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===A?void 0:t}}const G=b?b.emptyScript:"";class P extends L{constructor(){super(...arguments),this.type=4}P(t){t&&t!==A?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class q extends L{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=Z(this,t,i,0))&&void 0!==e?e:A)===F)return;const o=this._$AH,s=t===A&&o!==A||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==A&&(o===A||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class V{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const X=window.litHtmlPolyfillSupport;null==X||X(W,H),(null!==(x=globalThis.litHtmlVersions)&&void 0!==x?x:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
114
108
|
/**
|
|
115
109
|
* @license
|
|
116
110
|
* Copyright 2020 Google LLC
|
|
117
111
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
118
112
|
*/
|
|
119
|
-
const
|
|
113
|
+
const Y=Symbol.for(""),J=t=>{if((null==t?void 0:t.r)===Y)return null==t?void 0:t._$litStatic$},Q=t=>({_$litStatic$:t,r:Y}),tt=new Map,it=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let a,h=0,p=!1;for(;h<o;){for(a=i[h];h<o&&void 0!==(n=e[h],s=J(n));)a+=s+i[++h],p=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(i[o]),p){const t=r.join("$$lit$$");void 0===(i=tt.get(t))&&(r.raw=r,tt.set(t,i=r)),e=l}return t(i,...e)})(B);var et;!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"}(et||(et={}));const ot=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),st=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),nt={fontFamily:st,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},rt=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",ot),lt=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",nt.fontSize,"20px"),at=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",nt.fontWeight,"normal"),ht=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",nt.letterSpacing,"0.15px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",nt.lineHeight,"1.2"),ft=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",nt.textTransform,"inherit"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",ot),dt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",nt.fontSize,"14px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",nt.fontWeight,"normal"),xt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",nt.letterSpacing,"0.105px"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",nt.lineHeight,"1.7"),vt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",nt.textTransform,"inherit"),bt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",st),yt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",nt.fontSize,"16px"),mt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",nt.fontWeight,"600"),$t=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",nt.letterSpacing,"0.144px"),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",nt.lineHeight,"1.5"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",nt.textTransform,"inherit"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",st),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",nt.fontSize,"14px"),Ot=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",nt.fontWeight,"normal"),Ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",nt.letterSpacing,"0.098px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",nt.lineHeight,"1.7"),jt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",nt.textTransform,"inherit"),Tt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",st),Et=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",nt.fontSize,"16px"),It=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",nt.fontWeight,"normal"),_t=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",nt.letterSpacing,"0.496px"),Bt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",nt.lineHeight,"1.5"),Ft=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",nt.textTransform,"inherit"),At=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",st),Mt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",nt.fontSize,"14px"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",nt.fontWeight,"normal"),Ut=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",nt.letterSpacing,"0.252px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",nt.lineHeight,"1.4"),Zt=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",nt.textTransform,"inherit"),Dt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",st),Ht=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",nt.fontSize,"12px"),Lt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",nt.fontWeight,"normal"),Kt=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",nt.letterSpacing,"0.396px"),Gt=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",nt.lineHeight,"1.33"),Pt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",nt.textTransform,"inherit"),qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",st),Vt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",nt.fontSize,"10px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",nt.fontWeight,"normal"),Yt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",nt.letterSpacing,"0.33px"),Jt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",nt.lineHeight,"1.6"),Qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",nt.textTransform,"inherit"),ti=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",st),ii=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",nt.fontSize,"10px"),ei=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",nt.fontWeight,"normal"),oi=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",nt.letterSpacing,"1.5px"),si=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",nt.lineHeight,"1.6"),ni=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",nt.textTransform,"uppercase"),ri={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",st),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",nt.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",nt.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",nt.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",nt.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",nt.textTransform,"uppercase")},li=e.css`
|
|
120
114
|
.ft-typography--title {
|
|
121
115
|
font-family: ${rt};
|
|
122
116
|
font-size: ${lt};
|
|
@@ -130,14 +124,14 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
130
124
|
font-family: ${ct};
|
|
131
125
|
font-size: ${dt};
|
|
132
126
|
font-weight: ${ut};
|
|
133
|
-
letter-spacing: ${
|
|
134
|
-
line-height: ${
|
|
127
|
+
letter-spacing: ${xt};
|
|
128
|
+
line-height: ${gt};
|
|
135
129
|
text-transform: ${vt};
|
|
136
130
|
}
|
|
137
131
|
`,hi=e.css`
|
|
138
132
|
.ft-typography--subtitle1 {
|
|
139
|
-
font-family: ${
|
|
140
|
-
font-size: ${
|
|
133
|
+
font-family: ${bt};
|
|
134
|
+
font-size: ${yt};
|
|
141
135
|
font-weight: ${mt};
|
|
142
136
|
letter-spacing: ${$t};
|
|
143
137
|
line-height: ${wt};
|
|
@@ -189,7 +183,7 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
189
183
|
line-height: ${Jt};
|
|
190
184
|
text-transform: ${Qt};
|
|
191
185
|
}
|
|
192
|
-
`,
|
|
186
|
+
`,xi=e.css`
|
|
193
187
|
.ft-typography--overline {
|
|
194
188
|
font-family: ${ti};
|
|
195
189
|
font-size: ${ii};
|
|
@@ -198,7 +192,7 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
198
192
|
line-height: ${si};
|
|
199
193
|
text-transform: ${ni};
|
|
200
194
|
}
|
|
201
|
-
`,
|
|
195
|
+
`,gi=e.css`
|
|
202
196
|
.ft-typography--button {
|
|
203
197
|
font-family: ${ri.fontFamily};
|
|
204
198
|
font-size: ${ri.fontSize};
|
|
@@ -207,18 +201,50 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
207
201
|
line-height: ${ri.lineHeight};
|
|
208
202
|
text-transform: ${ri.textTransform};
|
|
209
203
|
}
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
`,vi=e.css`
|
|
205
|
+
.ft-typography {
|
|
206
|
+
vertical-align: inherit;
|
|
207
|
+
}
|
|
208
|
+
`;var bi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class yi extends i.FtLitElement{constructor(){super(...arguments),this.variant=et.body1}render(){return this.element?it`
|
|
209
|
+
<${Q(this.element)}
|
|
212
210
|
class="ft-typography ft-typography--${this.variant}">
|
|
213
211
|
<slot></slot>
|
|
214
|
-
</${
|
|
215
|
-
`:
|
|
212
|
+
</${Q(this.element)}>
|
|
213
|
+
`:it`
|
|
216
214
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
217
|
-
`}}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
`}}yi.styles=[li,ai,hi,pi,fi,ci,di,ui,xi,gi,vi],bi([o.property()],yi.prototype,"element",void 0),bi([o.property()],yi.prototype,"variant",void 0),i.customElement("ft-typography")(yi);const mi=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),$i=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),wi=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),ki=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),zi=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),Si=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Oi=e.css`
|
|
216
|
+
.ft-tooltip--container {
|
|
217
|
+
display: block;
|
|
218
|
+
position: relative;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.ft-tooltip--inline {
|
|
222
|
+
display: inline-block;
|
|
223
|
+
max-width: 100%;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.ft-tooltip {
|
|
227
|
+
position: absolute;
|
|
228
|
+
box-sizing: border-box;
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
width: max-content;
|
|
231
|
+
max-width: ${Si};
|
|
232
|
+
text-align: center;
|
|
233
|
+
padding: ${mi};
|
|
234
|
+
z-index: ${ki};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ft-tooltip--content {
|
|
238
|
+
padding: 4px 8px;
|
|
239
|
+
border-radius: ${zi};
|
|
240
|
+
background-color: ${wi};
|
|
241
|
+
color: ${$i};
|
|
242
|
+
top: -500px;
|
|
243
|
+
left: -500px;
|
|
244
|
+
position: relative;
|
|
245
|
+
word-break: break-word;
|
|
246
|
+
}
|
|
247
|
+
`;var Ci=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ni extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}render(){return e.html`
|
|
222
248
|
<div part="container"
|
|
223
249
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
224
250
|
@mouseenter=${this.onHover}
|
|
@@ -234,290 +260,258 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
234
260
|
</div>
|
|
235
261
|
<slot></slot>
|
|
236
262
|
</div>
|
|
237
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
263
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${Si})`}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())}}Ni.elementDefinitions={"ft-typography":yi},Ni.styles=Oi,Ci([o.property()],Ni.prototype,"text",void 0),Ci([o.property({type:Boolean})],Ni.prototype,"manual",void 0),Ci([o.property({type:Boolean})],Ni.prototype,"inline",void 0),Ci([o.property({type:Number})],Ni.prototype,"delay",void 0),Ci([o.property()],Ni.prototype,"position",void 0),Ci([o.queryAssignedNodes("",!0)],Ni.prototype,"slotNodes",void 0),Ci([o.query(".ft-tooltip--container")],Ni.prototype,"container",void 0),Ci([o.query("slot")],Ni.prototype,"target",void 0),Ci([o.query(".ft-tooltip")],Ni.prototype,"tooltip",void 0),Ci([o.query(".ft-tooltip--content")],Ni.prototype,"tooltipContent",void 0),Ci([o.state()],Ni.prototype,"visible",void 0),i.customElement("ft-tooltip")(Ni);const ji={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},Ti=e.css`
|
|
264
|
+
:host {
|
|
265
|
+
line-height: 0;
|
|
266
|
+
}
|
|
242
267
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
268
|
+
.ft-loader {
|
|
269
|
+
display: inline-block;
|
|
270
|
+
position: relative;
|
|
247
271
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
overflow: hidden;
|
|
252
|
-
width: max-content;
|
|
253
|
-
max-width: ${zi};
|
|
254
|
-
text-align: center;
|
|
255
|
-
padding: ${bi};
|
|
256
|
-
z-index: ${wi};
|
|
257
|
-
}
|
|
272
|
+
width: ${ji.size};
|
|
273
|
+
height: ${ji.size};
|
|
274
|
+
}
|
|
258
275
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
276
|
+
.ft-loader div {
|
|
277
|
+
position: absolute;
|
|
278
|
+
top: 37.5%;
|
|
279
|
+
width: 25%;
|
|
280
|
+
height: 25%;
|
|
281
|
+
border-radius: 50%;
|
|
282
|
+
background: ${ji.color};
|
|
283
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.ft-loader div:nth-child(1) {
|
|
287
|
+
left: 2.5%;
|
|
288
|
+
animation: appear 0.6s infinite;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.ft-loader div:nth-child(2) {
|
|
292
|
+
left: 2.5%;
|
|
293
|
+
animation: move 0.6s infinite;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.ft-loader div:nth-child(3) {
|
|
297
|
+
left: 37.5%;
|
|
298
|
+
animation: move 0.6s infinite;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.ft-loader div:nth-child(4) {
|
|
302
|
+
left: 72.5%;
|
|
303
|
+
animation: disappear 0.6s infinite;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@keyframes appear {
|
|
307
|
+
0% {
|
|
308
|
+
transform: scale(0);
|
|
268
309
|
}
|
|
269
|
-
|
|
270
|
-
:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
.ft-loader {
|
|
275
|
-
display: inline-block;
|
|
276
|
-
position: relative;
|
|
277
|
-
|
|
278
|
-
width: ${Oi.size};
|
|
279
|
-
height: ${Oi.size};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.ft-loader div {
|
|
283
|
-
position: absolute;
|
|
284
|
-
top: 37.5%;
|
|
285
|
-
width: 25%;
|
|
286
|
-
height: 25%;
|
|
287
|
-
border-radius: 50%;
|
|
288
|
-
background: ${Oi.color};
|
|
289
|
-
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.ft-loader div:nth-child(1) {
|
|
293
|
-
left: 2.5%;
|
|
294
|
-
animation: appear 0.6s infinite;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.ft-loader div:nth-child(2) {
|
|
298
|
-
left: 2.5%;
|
|
299
|
-
animation: move 0.6s infinite;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.ft-loader div:nth-child(3) {
|
|
303
|
-
left: 37.5%;
|
|
304
|
-
animation: move 0.6s infinite;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.ft-loader div:nth-child(4) {
|
|
308
|
-
left: 72.5%;
|
|
309
|
-
animation: disappear 0.6s infinite;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
@keyframes appear {
|
|
313
|
-
0% {
|
|
314
|
-
transform: scale(0);
|
|
315
|
-
}
|
|
316
|
-
100% {
|
|
317
|
-
transform: scale(1);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
310
|
+
100% {
|
|
311
|
+
transform: scale(1);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
320
314
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
315
|
+
@keyframes disappear {
|
|
316
|
+
0% {
|
|
317
|
+
transform: scale(1);
|
|
318
|
+
}
|
|
319
|
+
100% {
|
|
320
|
+
transform: scale(0);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
329
323
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
324
|
+
@keyframes move {
|
|
325
|
+
0% {
|
|
326
|
+
transform: translate(0, 0);
|
|
327
|
+
}
|
|
328
|
+
100% {
|
|
329
|
+
transform: translate(calc(0.35 * ${ji.size}), 0);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
`;class Ei extends i.FtLitElement{render(){return e.html`
|
|
339
333
|
<div class="ft-loader">
|
|
340
334
|
<div></div>
|
|
341
335
|
<div></div>
|
|
342
336
|
<div></div>
|
|
343
337
|
<div></div>
|
|
344
338
|
</div>
|
|
345
|
-
`}}var
|
|
339
|
+
`}}var Ii,_i;Ei.styles=Ti,i.customElement("ft-loader")(Ei),function(t){t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="\f06e",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(Ii||(Ii={})),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=""}(_i||(_i={})),new Map([...["abw"].map((t=>[t,_i.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,_i.AUDIO])),...["avi"].map((t=>[t,_i.AVI])),...["chm","xhs"].map((t=>[t,_i.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,_i.CODE])),...["csv"].map((t=>[t,_i.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,_i.DITA])),...["epub"].map((t=>[t,_i.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,_i.EXCEL])),...["flac"].map((t=>[t,_i.FLAC])),...["gif"].map((t=>[t,_i.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,_i.GZIP])),...["html","htm","xhtml"].map((t=>[t,_i.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,_i.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,_i.JPEG])),...["json"].map((t=>[t,_i.JSON])),...["m4a","m4p"].map((t=>[t,_i.M4A])),...["mov","qt"].map((t=>[t,_i.MOV])),...["mp3"].map((t=>[t,_i.MP3])),...["mp4","m4v"].map((t=>[t,_i.MP4])),...["ogg","oga"].map((t=>[t,_i.OGG])),...["pdf","ps"].map((t=>[t,_i.PDF])),...["png"].map((t=>[t,_i.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,_i.POWERPOINT])),...["rar"].map((t=>[t,_i.RAR])),...["stp"].map((t=>[t,_i.STP])),...["txt","rtf","md","mdown"].map((t=>[t,_i.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,_i.VIDEO])),...["wav"].map((t=>[t,_i.WAV])),...["wma"].map((t=>[t,_i.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,_i.WORD])),...["xml","xsl","rdf"].map((t=>[t,_i.XML])),...["yaml","yml","x-yaml"].map((t=>[t,_i.YAML])),...["zip"].map((t=>[t,_i.ZIP]))]);const Bi={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Fi=e.css`
|
|
340
|
+
:host {
|
|
341
|
+
display: inline-block;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
:host, i.ft-icon {
|
|
345
|
+
width: ${Bi.size};
|
|
346
|
+
height: ${Bi.size};
|
|
347
|
+
text-align: center;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
i.ft-icon {
|
|
351
|
+
font-size: ${Bi.size};
|
|
352
|
+
line-height: 1;
|
|
353
|
+
font-weight: normal;
|
|
354
|
+
text-transform: none;
|
|
355
|
+
font-style: normal;
|
|
356
|
+
font-variant: normal;
|
|
357
|
+
speak: none;
|
|
358
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
359
|
+
text-rendering: auto;
|
|
360
|
+
-webkit-font-smoothing: antialiased;
|
|
361
|
+
-moz-osx-font-smoothing: grayscale;
|
|
362
|
+
vertical-align: ${Bi.verticalAlign};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.ft-icon--fluid-topics {
|
|
366
|
+
font-family: ${Bi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.ft-icon--file-format {
|
|
370
|
+
font-family: ${Bi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.ft-icon--material {
|
|
374
|
+
font-family: ${Bi.materialFontFamily}, "Material Icons", sans-serif;
|
|
375
|
+
}
|
|
376
|
+
`;var Ai;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ai||(Ai={}));var Mi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ri extends i.FtLitElement{constructor(){super(...arguments),this.variant=Ai.fluid_topics,this.resolvedIcon=e.nothing}render(){const t="material"!==this.variant||this.value;return e.html`
|
|
346
377
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
347
378
|
${n.unsafeHTML(this.resolvedIcon)}
|
|
348
|
-
<slot ?hidden=${
|
|
379
|
+
<slot ?hidden=${t}></slot>
|
|
349
380
|
</i>
|
|
350
|
-
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case
|
|
381
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case Ai.file_format:this.resolvedIcon=null!==(t=_i[o.toUpperCase()])&&void 0!==t?t:o;break;case Ai.fluid_topics:this.resolvedIcon=null!==(i=Ii[o.toUpperCase()])&&void 0!==i?i:o;break;default:this.resolvedIcon=this.value||e.nothing}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}Ri.elementDefinitions={},Ri.styles=Fi,Mi([o.property()],Ri.prototype,"variant",void 0),Mi([o.property()],Ri.prototype,"value",void 0),Mi([o.state()],Ri.prototype,"resolvedIcon",void 0),Mi([o.query("slot")],Ri.prototype,"slottedContent",void 0),i.customElement("ft-icon")(Ri);const Ui=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),Wi={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:Ui,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",ri.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",Ui),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},Zi=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),Di={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:Zi,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",Zi)},Hi=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),Li=[i.noTextSelect,e.css`
|
|
351
382
|
:host {
|
|
352
383
|
display: inline-block;
|
|
384
|
+
max-width: 100%;
|
|
385
|
+
pointer-events: none;
|
|
353
386
|
}
|
|
354
387
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
text-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
i.ft-icon {
|
|
362
|
-
font-size: ${Ii.size};
|
|
363
|
-
line-height: 1;
|
|
364
|
-
font-weight: normal;
|
|
365
|
-
text-transform: none;
|
|
366
|
-
font-style: normal;
|
|
367
|
-
font-variant: normal;
|
|
368
|
-
speak: none;
|
|
369
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
370
|
-
text-rendering: auto;
|
|
371
|
-
-webkit-font-smoothing: antialiased;
|
|
372
|
-
-moz-osx-font-smoothing: grayscale;
|
|
373
|
-
vertical-align: ${Ii.verticalAlign};
|
|
388
|
+
button {
|
|
389
|
+
box-shadow: 0px 0px 0px transparent;
|
|
390
|
+
border: 0px solid transparent;
|
|
391
|
+
text-shadow: 0px 0px 0px transparent;
|
|
392
|
+
font-size: ${Wi.fontSize};
|
|
374
393
|
}
|
|
375
394
|
|
|
376
|
-
|
|
377
|
-
|
|
395
|
+
button:hover {
|
|
396
|
+
box-shadow: 0px 0px 0px transparent;
|
|
397
|
+
border: 0px solid transparent;
|
|
398
|
+
text-shadow: 0px 0px 0px transparent;
|
|
378
399
|
}
|
|
379
400
|
|
|
380
|
-
|
|
381
|
-
|
|
401
|
+
button:active {
|
|
402
|
+
outline: none;
|
|
403
|
+
border: none;
|
|
382
404
|
}
|
|
383
405
|
|
|
384
|
-
|
|
385
|
-
|
|
406
|
+
button:focus {
|
|
407
|
+
outline: 0;
|
|
386
408
|
}
|
|
387
|
-
`,Ei([o.property()],_i.prototype,"variant",void 0),Ei([o.property()],_i.prototype,"value",void 0),Ei([o.state()],_i.prototype,"resolvedIcon",void 0),Ei([o.query("slot")],_i.prototype,"slottedContent",void 0),i.customElement("ft-icon")(_i);var Bi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const Fi=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),Ai={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:Fi,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",ri.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",Fi),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},Mi=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),Ri={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:Mi,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",Mi)},Ui=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM));class Wi extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ti.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}static get styles(){return[i.noTextSelect,e.css`
|
|
388
|
-
:host {
|
|
389
|
-
display: inline-block;
|
|
390
|
-
max-width: 100%;
|
|
391
|
-
pointer-events: none;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
button {
|
|
395
|
-
box-shadow: 0px 0px 0px transparent;
|
|
396
|
-
border: 0px solid transparent;
|
|
397
|
-
text-shadow: 0px 0px 0px transparent;
|
|
398
|
-
font-size: ${Ai.fontSize};
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
button:hover {
|
|
402
|
-
box-shadow: 0px 0px 0px transparent;
|
|
403
|
-
border: 0px solid transparent;
|
|
404
|
-
text-shadow: 0px 0px 0px transparent;
|
|
405
|
-
}
|
|
406
409
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
.ft-button {
|
|
411
|
+
position: relative;
|
|
412
|
+
display: flex;
|
|
413
|
+
justify-content: center;
|
|
414
|
+
align-items: center;
|
|
415
|
+
width: 100%;
|
|
416
|
+
overflow: hidden;
|
|
417
|
+
box-sizing: border-box;
|
|
418
|
+
border: none;
|
|
419
|
+
pointer-events: auto;
|
|
411
420
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
421
|
+
--ft-button-internal-line-height: calc(${Wi.fontSize} + 2px);
|
|
422
|
+
--ft-button-internal-color: ${Wi.color};
|
|
423
|
+
${i.setVariable(Bi.size,Wi.iconSize)};
|
|
424
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
425
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
426
|
+
${i.setVariable(l.color,Wi.rippleColor)};
|
|
427
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Wi.iconSize});
|
|
415
428
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
overflow: hidden;
|
|
423
|
-
box-sizing: border-box;
|
|
424
|
-
border: none;
|
|
425
|
-
pointer-events: auto;
|
|
426
|
-
|
|
427
|
-
--ft-button-internal-line-height: calc(${Ai.fontSize} + 2px);
|
|
428
|
-
--ft-button-internal-color: ${Ai.color};
|
|
429
|
-
${i.setVariable(Ii.size,Ai.iconSize)};
|
|
430
|
-
--ft-button-internal-vertical-padding: 6px;
|
|
431
|
-
--ft-button-internal-horizontal-padding: 8px;
|
|
432
|
-
${i.setVariable(a.color,Ai.rippleColor)};
|
|
433
|
-
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Ai.iconSize});
|
|
434
|
-
|
|
435
|
-
border-radius: ${Ai.borderRadius};
|
|
436
|
-
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
437
|
-
background-color: ${Ai.backgroundColor};
|
|
438
|
-
color: var(--ft-button-internal-color);
|
|
439
|
-
-webkit-mask-image: radial-gradient(white, black);
|
|
440
|
-
}
|
|
429
|
+
border-radius: ${Wi.borderRadius};
|
|
430
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
431
|
+
background-color: ${Wi.backgroundColor};
|
|
432
|
+
color: var(--ft-button-internal-color);
|
|
433
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
434
|
+
}
|
|
441
435
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
436
|
+
.ft-button:not([disabled]):hover {
|
|
437
|
+
cursor: pointer;
|
|
438
|
+
}
|
|
445
439
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
440
|
+
.ft-button--dense {
|
|
441
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
442
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
443
|
+
border-radius: ${Hi};
|
|
444
|
+
}
|
|
451
445
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
446
|
+
.ft-button--round {
|
|
447
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
448
|
+
}
|
|
455
449
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
450
|
+
.ft-button[disabled] {
|
|
451
|
+
filter: grayscale(1);
|
|
452
|
+
opacity: ${Wi.opacityDisabled};
|
|
453
|
+
}
|
|
460
454
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
455
|
+
.ft-button.ft-button--primary {
|
|
456
|
+
background-color: ${Di.backgroundColor};
|
|
457
|
+
--ft-button-internal-color: ${Di.color};
|
|
458
|
+
${i.setVariable(l.color,Di.rippleColor)};
|
|
459
|
+
}
|
|
466
460
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
461
|
+
.ft-button.ft-button--outlined {
|
|
462
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
463
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
464
|
+
}
|
|
471
465
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
466
|
+
.ft-button:focus {
|
|
467
|
+
outline: none;
|
|
468
|
+
}
|
|
475
469
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
470
|
+
.ft-button--label {
|
|
471
|
+
position: relative;
|
|
472
|
+
overflow: hidden;
|
|
473
|
+
white-space: nowrap;
|
|
474
|
+
text-overflow: ellipsis;
|
|
475
|
+
display: block;
|
|
476
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
477
|
+
${i.setVariable(ri.fontSize,"1em")};
|
|
478
|
+
${i.setVariable(ri.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
479
|
+
}
|
|
486
480
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
481
|
+
.ft-button--safari-fix .ft-button--label {
|
|
482
|
+
margin-right: 0;
|
|
483
|
+
}
|
|
490
484
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
485
|
+
.ft-button--safari-fix .ft-button--label:after {
|
|
486
|
+
content: "\\0000a0";
|
|
487
|
+
display: inline-block;
|
|
488
|
+
width: 0;
|
|
489
|
+
}
|
|
496
490
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
491
|
+
.ft-button--label[hidden] {
|
|
492
|
+
display: none;
|
|
493
|
+
}
|
|
500
494
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
495
|
+
ft-icon {
|
|
496
|
+
flex-shrink: 0;
|
|
497
|
+
position: relative;
|
|
498
|
+
}
|
|
505
499
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
500
|
+
.ft-button--label[hidden] + ft-icon {
|
|
501
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
502
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
503
|
+
}
|
|
510
504
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
505
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
506
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
507
|
+
order: -1;
|
|
508
|
+
}
|
|
515
509
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
510
|
+
ft-loader {
|
|
511
|
+
${i.setVariable(ji.size,Wi.iconSize)};
|
|
512
|
+
${i.setVariable(ji.color,"var(--ft-button-internal-color)")};
|
|
513
|
+
}
|
|
514
|
+
`];var Ki=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Gi extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ai.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-button--safari-fix":i.isSafari,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
521
515
|
<button part="button"
|
|
522
516
|
class="${s.classMap(t)}"
|
|
523
517
|
aria-label="${this.getLabel()}"
|
|
@@ -539,7 +533,132 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
539
533
|
</ft-tooltip>
|
|
540
534
|
`}resolveIcon(){return this.loading?e.html`
|
|
541
535
|
<ft-loader></ft-loader> `:this.icon?e.html`
|
|
542
|
-
<ft-icon
|
|
536
|
+
<ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Gi.elementDefinitions={"ft-ripple":v,"ft-tooltip":Ni,"ft-typography":yi,"ft-icon":Ri,"ft-loader":Ei},Gi.styles=Li,Ki([o.property({type:Boolean})],Gi.prototype,"primary",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"outlined",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"disabled",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"dense",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"round",void 0),Ki([o.property({type:String})],Gi.prototype,"label",void 0),Ki([o.property({type:String})],Gi.prototype,"icon",void 0),Ki([o.property({type:String})],Gi.prototype,"iconVariant",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"trailingIcon",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"loading",void 0),Ki([o.property({type:String})],Gi.prototype,"tooltipPosition",void 0),Ki([o.property({type:Boolean})],Gi.prototype,"hideTooltip",void 0),Ki([o.query(".ft-button")],Gi.prototype,"button",void 0),Ki([o.query(".ft-button--label slot")],Gi.prototype,"slottedContent",void 0),i.customElement("ft-button")(Gi);const Pi={buttonsColor:i.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",i.designSystemVariables.colorPrimary),buttonsZIndex:i.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:i.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system")},qi=e.css`
|
|
537
|
+
.ft-snap-scroll {
|
|
538
|
+
box-sizing: border-box;
|
|
539
|
+
position: relative;
|
|
540
|
+
display: flex;
|
|
541
|
+
|
|
542
|
+
--ft-snap-scroll-transparent-color: transparent;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
546
|
+
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
547
|
+
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
548
|
+
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.ft-snap-scroll,
|
|
552
|
+
.ft-snap-scroll--content {
|
|
553
|
+
overflow: hidden;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.ft-snap-scroll--limit-size,
|
|
557
|
+
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
558
|
+
width: 100%;
|
|
559
|
+
height: 100%;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.ft-snap-scroll--content {
|
|
563
|
+
flex-grow: 1;
|
|
564
|
+
flex-shrink: 1;
|
|
565
|
+
box-sizing: border-box;
|
|
566
|
+
scroll-snap-align: start;
|
|
567
|
+
display: flex;
|
|
568
|
+
flex-wrap: nowrap;
|
|
569
|
+
align-items: flex-start;
|
|
570
|
+
justify-content: flex-start;
|
|
571
|
+
gap: ${Pi.gap};
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
575
|
+
display: none;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
579
|
+
-ms-overflow-style: none;
|
|
580
|
+
scrollbar-width: none;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.ft-snap-scroll--content::slotted(*) {
|
|
584
|
+
flex-shrink: 0;
|
|
585
|
+
flex-grow: 1;
|
|
586
|
+
max-height: 100%;
|
|
587
|
+
max-width: 100%;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.ft-snap-scroll--horizontal,
|
|
591
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
592
|
+
width: 100%;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.ft-snap-scroll--vertical,
|
|
596
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
597
|
+
height: 100%;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
601
|
+
flex-direction: row;
|
|
602
|
+
overflow-x: auto;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
606
|
+
flex-direction: column;
|
|
607
|
+
overflow-y: auto;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.ft-snap-scroll--previous,
|
|
611
|
+
.ft-snap-scroll--next {
|
|
612
|
+
position: absolute;
|
|
613
|
+
display: flex;
|
|
614
|
+
z-index: ${Pi.buttonsZIndex};
|
|
615
|
+
opacity: 1;
|
|
616
|
+
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
617
|
+
${i.setVariable(Wi.backgroundColor,"transparent")};
|
|
618
|
+
${i.setVariable(Wi.color,Pi.buttonsColor)};
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.ft-snap-scroll--previous[hidden],
|
|
622
|
+
.ft-snap-scroll--next[hidden] {
|
|
623
|
+
z-index: -1;
|
|
624
|
+
opacity: 0;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous {
|
|
628
|
+
top: 0;
|
|
629
|
+
left: -1px;
|
|
630
|
+
bottom: 0;
|
|
631
|
+
background: linear-gradient(to right, ${Pi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
635
|
+
top: -1px;
|
|
636
|
+
left: 0;
|
|
637
|
+
right: 0;
|
|
638
|
+
background: linear-gradient(to bottom, ${Pi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
642
|
+
top: 0;
|
|
643
|
+
right: -1px;
|
|
644
|
+
bottom: 0;
|
|
645
|
+
background: linear-gradient(to left, ${Pi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
649
|
+
left: 0;
|
|
650
|
+
right: 0;
|
|
651
|
+
bottom: -1px;
|
|
652
|
+
background: linear-gradient(to top, ${Pi.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
656
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
657
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
658
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
659
|
+
background-color: ${Pi.colorSurface};
|
|
660
|
+
}
|
|
661
|
+
`;var Vi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Xi extends CustomEvent{constructor(t,i){super("current-element-change",{detail:{index:t,element:i}})}}class Yi extends i.FtLitElement{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new i.Debouncer(200),this.updateScrollDebouncer=new i.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let i=this.elements[t];if(i){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,e=this.contentSlot[this.scrollAttribute]+this.prevSize;(i[this.offsetAttribute]<e||i[this.offsetAttribute]+i[this.sizeAttribute]>t)&&this.scrollToElement(i)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=s.classMap({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":i.isSafari}),o=this.controls&&this.withScroll;return e.html`
|
|
543
662
|
<div part="container" class="${t}">
|
|
544
663
|
<ft-button
|
|
545
664
|
class="ft-snap-scroll--previous"
|
|
@@ -563,129 +682,4 @@ const X=Symbol.for(""),Y=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t
|
|
|
563
682
|
@click=${this.next}
|
|
564
683
|
></ft-button>
|
|
565
684
|
</div>
|
|
566
|
-
`}updated(t){var i;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(i=this.listenedContainer)||void 0===i||i.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new
|
|
567
|
-
.ft-snap-scroll {
|
|
568
|
-
box-sizing: border-box;
|
|
569
|
-
position: relative;
|
|
570
|
-
display: flex;
|
|
571
|
-
|
|
572
|
-
--ft-snap-scroll-transparent-color: transparent;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
576
|
-
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
577
|
-
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
578
|
-
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.ft-snap-scroll,
|
|
582
|
-
.ft-snap-scroll--content {
|
|
583
|
-
overflow: hidden;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.ft-snap-scroll--limit-size,
|
|
587
|
-
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
588
|
-
width: 100%;
|
|
589
|
-
height: 100%;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
.ft-snap-scroll--content {
|
|
593
|
-
flex-grow: 1;
|
|
594
|
-
flex-shrink: 1;
|
|
595
|
-
box-sizing: border-box;
|
|
596
|
-
scroll-snap-align: start;
|
|
597
|
-
display: flex;
|
|
598
|
-
flex-wrap: nowrap;
|
|
599
|
-
align-items: flex-start;
|
|
600
|
-
justify-content: flex-start;
|
|
601
|
-
gap: ${Di.gap};
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
605
|
-
display: none;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
609
|
-
-ms-overflow-style: none;
|
|
610
|
-
scrollbar-width: none;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
.ft-snap-scroll--content::slotted(*) {
|
|
614
|
-
flex-shrink: 0;
|
|
615
|
-
flex-grow: 1;
|
|
616
|
-
max-height: 100%;
|
|
617
|
-
max-width: 100%;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
.ft-snap-scroll--horizontal,
|
|
621
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
622
|
-
width: 100%;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
.ft-snap-scroll--vertical,
|
|
626
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
627
|
-
height: 100%;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
631
|
-
flex-direction: row;
|
|
632
|
-
overflow-x: auto;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
636
|
-
flex-direction: column;
|
|
637
|
-
overflow-y: auto;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
.ft-snap-scroll--previous,
|
|
641
|
-
.ft-snap-scroll--next {
|
|
642
|
-
position: absolute;
|
|
643
|
-
display: flex;
|
|
644
|
-
z-index: ${Di.buttonsZIndex};
|
|
645
|
-
opacity: 1;
|
|
646
|
-
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
647
|
-
${i.setVariable(Ai.backgroundColor,"transparent")};
|
|
648
|
-
${i.setVariable(Ai.color,Di.buttonsColor)};
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
.ft-snap-scroll--previous[hidden],
|
|
652
|
-
.ft-snap-scroll--next[hidden] {
|
|
653
|
-
z-index: -1;
|
|
654
|
-
opacity: 0;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--previous {
|
|
658
|
-
top: 0;
|
|
659
|
-
left: -1px;
|
|
660
|
-
bottom: 0;
|
|
661
|
-
background: linear-gradient(to right, ${Di.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
665
|
-
top: -1px;
|
|
666
|
-
left: 0;
|
|
667
|
-
right: 0;
|
|
668
|
-
background: linear-gradient(to bottom, ${Di.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
672
|
-
top: 0;
|
|
673
|
-
right: -1px;
|
|
674
|
-
bottom: 0;
|
|
675
|
-
background: linear-gradient(to left, ${Di.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
679
|
-
left: 0;
|
|
680
|
-
right: 0;
|
|
681
|
-
bottom: -1px;
|
|
682
|
-
background: linear-gradient(to top, ${Di.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
686
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
687
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
688
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
689
|
-
background-color: ${Di.colorSurface};
|
|
690
|
-
}
|
|
691
|
-
`,Zi([o.property({type:Boolean})],Li.prototype,"horizontal",void 0),Zi([o.property({type:Boolean})],Li.prototype,"hideScrollbar",void 0),Zi([o.property({type:Boolean})],Li.prototype,"controls",void 0),Zi([o.property({type:Boolean})],Li.prototype,"limitSize",void 0),Zi([o.state()],Li.prototype,"elements",void 0),Zi([o.state()],Li.prototype,"currentElement",void 0),Zi([o.state()],Li.prototype,"withScroll",void 0),Zi([o.state()],Li.prototype,"startReached",void 0),Zi([o.state()],Li.prototype,"endReached",void 0),Zi([o.query(".ft-snap-scroll--content")],Li.prototype,"contentSlot",void 0),i.customElement("ft-snap-scroll")(Li),t.CurrentElementChange=Hi,t.FtSnapScroll=Li,t.FtSnapScrollCssVariables=Di,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|
|
685
|
+
`}updated(t){var i;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(i=this.listenedContainer)||void 0===i||i.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new Xi(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const i=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<i&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var i,e;t&&(this.horizontal?null===(i=this.contentSlot)||void 0===i||i.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(e=this.contentSlot)||void 0===e||e.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,i;this.elements=null!==(i=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==i?i:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let i=0;i<this.elements.length;i++)(t<0||this.getDistanceFromStart(this.elements[i])<this.getDistanceFromStart(this.elements[t]))&&(t=i);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const i=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-i)}}Yi.elementDefinitions={"ft-button":Gi},Yi.styles=qi,Vi([o.property({type:Boolean})],Yi.prototype,"horizontal",void 0),Vi([o.property({type:Boolean})],Yi.prototype,"hideScrollbar",void 0),Vi([o.property({type:Boolean})],Yi.prototype,"controls",void 0),Vi([o.property({type:Boolean})],Yi.prototype,"limitSize",void 0),Vi([o.state()],Yi.prototype,"elements",void 0),Vi([o.state()],Yi.prototype,"currentElement",void 0),Vi([o.state()],Yi.prototype,"withScroll",void 0),Vi([o.state()],Yi.prototype,"startReached",void 0),Vi([o.state()],Yi.prototype,"endReached",void 0),Vi([o.query(".ft-snap-scroll--content")],Yi.prototype,"contentSlot",void 0),i.customElement("ft-snap-scroll")(Yi),t.CurrentElementChange=Xi,t.FtSnapScroll=Yi,t.FtSnapScrollCssVariables=Pi,t.styles=qi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|