@fluid-topics/ft-switch 0.1.16 → 0.2.0
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/css-variables.d.ts +22 -0
- package/build/css-variables.js +23 -0
- package/build/ft-switch-option.d.ts +4 -11
- package/build/ft-switch-option.js +14 -26
- package/build/ft-switch.d.ts +3 -17
- package/build/ft-switch.inline-styles.js +532 -0
- package/build/ft-switch.js +7 -25
- package/build/ft-switch.light.js +276 -326
- package/build/ft-switch.min.js +315 -355
- package/build/index.d.ts +4 -0
- package/build/index.js +9 -0
- package/build/inline-styles.d.ts +2 -0
- package/build/inline-styles.js +6 -0
- package/package.json +9 -9
package/build/ft-switch.light.js
CHANGED
|
@@ -1,329 +1,210 @@
|
|
|
1
|
-
!function(t,e,i,r,o,s){
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},a(t,e)};var p=function(){return p=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p.apply(this,arguments)};function n(t,e,i,r){for(var o,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,p=t.length-1;p>=0;p--)(o=t[p])&&(a=(s<3?o(a):s>3?o(e,i,a):o(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
|
|
17
|
-
/**
|
|
18
|
-
* @license
|
|
19
|
-
* Copyright 2018 Google Inc.
|
|
20
|
-
*
|
|
21
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
23
|
-
* in the Software without restriction, including without limitation the rights
|
|
24
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
26
|
-
* furnished to do so, subject to the following conditions:
|
|
27
|
-
*
|
|
28
|
-
* The above copyright notice and this permission notice shall be included in
|
|
29
|
-
* all copies or substantial portions of the Software.
|
|
30
|
-
*
|
|
31
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
37
|
-
* THE SOFTWARE.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* @license
|
|
41
|
-
* Copyright 2018 Google LLC
|
|
42
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/
|
|
44
|
-
const l=()=>{},d={get passive(){return!1}};document.addEventListener("x",l,d),document.removeEventListener("x",l);
|
|
45
|
-
/**
|
|
46
|
-
* @license
|
|
47
|
-
* Copyright 2018 Google LLC
|
|
48
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
49
|
-
*/
|
|
50
|
-
class h extends e.LitElement{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}
|
|
51
|
-
/**
|
|
52
|
-
* @license
|
|
53
|
-
* Copyright 2016 Google Inc.
|
|
54
|
-
*
|
|
55
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
56
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
57
|
-
* in the Software without restriction, including without limitation the rights
|
|
58
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
59
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
60
|
-
* furnished to do so, subject to the following conditions:
|
|
61
|
-
*
|
|
62
|
-
* The above copyright notice and this permission notice shall be included in
|
|
63
|
-
* all copies or substantial portions of the Software.
|
|
64
|
-
*
|
|
65
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
66
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
67
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
68
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
69
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
70
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
71
|
-
* THE SOFTWARE.
|
|
72
|
-
*/var f=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),u={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},m={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},y={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};
|
|
73
|
-
/**
|
|
74
|
-
* @license
|
|
75
|
-
* Copyright 2016 Google Inc.
|
|
76
|
-
*
|
|
77
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
78
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
79
|
-
* in the Software without restriction, including without limitation the rights
|
|
80
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
81
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
82
|
-
* furnished to do so, subject to the following conditions:
|
|
83
|
-
*
|
|
84
|
-
* The above copyright notice and this permission notice shall be included in
|
|
85
|
-
* all copies or substantial portions of the Software.
|
|
86
|
-
*
|
|
87
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
88
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
89
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
90
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
91
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
92
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
93
|
-
* THE SOFTWARE.
|
|
94
|
-
*/
|
|
95
|
-
/**
|
|
96
|
-
* @license
|
|
97
|
-
* Copyright 2016 Google Inc.
|
|
98
|
-
*
|
|
99
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
100
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
101
|
-
* in the Software without restriction, including without limitation the rights
|
|
102
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
103
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
104
|
-
* furnished to do so, subject to the following conditions:
|
|
105
|
-
*
|
|
106
|
-
* The above copyright notice and this permission notice shall be included in
|
|
107
|
-
* all copies or substantial portions of the Software.
|
|
108
|
-
*
|
|
109
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
110
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
111
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
112
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
113
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
114
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
115
|
-
* THE SOFTWARE.
|
|
116
|
-
*/
|
|
117
|
-
var g=["touchstart","pointerdown","mousedown","keydown"],v=["touchend","pointerup","mouseup","contextmenu"],b=[],w=function(t){function e(i){var r=t.call(this,p(p({},e.defaultAdapter),i))||this;return r.activationAnimationHasEnded=!1,r.activationTimer=0,r.fgDeactivationRemovalTimer=0,r.fgScale="0",r.frame={width:0,height:0},r.initialSize=0,r.layoutFrame=0,r.maxRadius=0,r.unboundedCoords={left:0,top:0},r.activationState=r.defaultActivationState(),r.activationTimerCallback=function(){r.activationAnimationHasEnded=!0,r.runDeactivationUXLogicIfReady()},r.activateHandler=function(t){r.activateImpl(t)},r.deactivateHandler=function(){r.deactivateImpl()},r.focusHandler=function(){r.handleFocus()},r.blurHandler=function(){r.handleBlur()},r.resizeHandler=function(){r.layout()},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return u},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return y},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple();if(this.registerRootHandlers(i),i){var r=e.cssClasses,o=r.ROOT,s=r.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(s),t.layoutInternal())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(r),t.adapter.removeClass(o),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(t){this.activateImpl(t)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(t){var e,i;if(t){try{for(var r=c(g),o=r.next();!o.done;o=r.next()){var s=o.value;this.adapter.registerInteractionHandler(s,this.activateHandler)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(t){var e,i;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var r=c(v),o=r.next();!o.done;o=r.next()){var s=o.value;this.adapter.registerDocumentInteractionHandler(s,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}},e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var i=c(g),r=i.next();!r.done;r=i.next()){var o=r.value;this.adapter.deregisterInteractionHandler(o,this.activateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=c(v),r=i.next();!r.done;r=i.next()){var o=r.value;this.adapter.deregisterDocumentInteractionHandler(o,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},e.prototype.removeCssVars=function(){var t=this,i=e.strings;Object.keys(i).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)}))},e.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var r=this.previousActivationEvent;if(!(r&&void 0!==t&&r.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&b.length>0&&b.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(b.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){b=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive(t),i.wasElementMadeActive&&e.animateActivation()),i.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},e.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation=function(){var t=this,i=e.strings,r=i.VAR_FG_TRANSLATE_START,o=i.VAR_FG_TRANSLATE_END,s=e.cssClasses,a=s.FG_DEACTIVATION,p=s.FG_ACTIVATION,n=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var c="",l="";if(!this.adapter.isUnbounded()){var d=this.getFgTranslationCoordinates(),h=d.startPoint,f=d.endPoint;c=h.x+"px, "+h.y+"px",l=f.x+"px, "+f.y+"px"}this.adapter.updateCssVariable(r,c),this.adapter.updateCssVariable(o,l),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(p),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),n)},e.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var r,o,s=e.x,a=e.y,p=s+i.left,n=a+i.top;if("touchstart"===t.type){var c=t;r=c.changedTouches[0].pageX-p,o=c.changedTouches[0].pageY-n}else{var l=t;r=l.pageX-p,o=l.pageY-n}return{x:r,y:o}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},e.prototype.runDeactivationUXLogicIfReady=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,r=this.activationState,o=r.hasDeactivationUXRun,s=r.isActivated;(o||!s)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(i)}),y.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var i=p({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(i)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(i),t.resetActivationState()})))}},e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var i=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?i:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+e.numbers.PADDING;var r=Math.floor(i*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&r%2!=0?this.initialSize=r-1:this.initialSize=r,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var t=e.strings,i=t.VAR_FG_SIZE,r=t.VAR_LEFT,o=t.VAR_TOP,s=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize+"px"),this.adapter.updateCssVariable(s,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(r,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},e}(f),$=w;
|
|
118
|
-
/**
|
|
119
|
-
* @license
|
|
120
|
-
* Copyright 2018 Google LLC
|
|
121
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
122
|
-
*/
|
|
123
|
-
class x extends h{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=$}get isActive(){return t=this.parentElement||this,e=":active",(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e);var t,e}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation((()=>{this.mdcFoundation.activate(t)}))}endPress(){this.waitForFoundation((()=>{this.mdcFoundation.deactivate()}))}startFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleFocus()}))}endFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleBlur()}))}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}update(t){t.has("disabled")&&this.disabled&&this.endHover(),super.update(t)}render(){const t=this.activated&&(this.primary||!this.accent),i=this.selected&&(this.primary||!this.accent),r={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":t,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":i,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return e.html`
|
|
124
|
-
<div class="mdc-ripple-surface mdc-ripple-upgraded ${o.classMap(r)}"
|
|
125
|
-
style="${s.styleMap({"--mdc-ripple-fg-scale":this.fgScale,"--mdc-ripple-fg-size":this.fgSize,"--mdc-ripple-fg-translate-end":this.translateEnd,"--mdc-ripple-fg-translate-start":this.translateStart,"--mdc-ripple-left":this.leftPos,"--mdc-ripple-top":this.topPos})}"></div>`}}n([i.query(".mdc-ripple-surface")],x.prototype,"mdcRoot",void 0),n([i.property({type:Boolean})],x.prototype,"primary",void 0),n([i.property({type:Boolean})],x.prototype,"accent",void 0),n([i.property({type:Boolean})],x.prototype,"unbounded",void 0),n([i.property({type:Boolean})],x.prototype,"disabled",void 0),n([i.property({type:Boolean})],x.prototype,"activated",void 0),n([i.property({type:Boolean})],x.prototype,"selected",void 0),n([i.property({type:Boolean})],x.prototype,"internalUseStateLayerCustomProperties",void 0),n([i.state()],x.prototype,"hovering",void 0),n([i.state()],x.prototype,"bgFocused",void 0),n([i.state()],x.prototype,"fgActivation",void 0),n([i.state()],x.prototype,"fgDeactivation",void 0),n([i.state()],x.prototype,"fgScale",void 0),n([i.state()],x.prototype,"fgSize",void 0),n([i.state()],x.prototype,"translateStart",void 0),n([i.state()],x.prototype,"translateEnd",void 0),n([i.state()],x.prototype,"leftPos",void 0),n([i.state()],x.prototype,"topPos",void 0);
|
|
126
|
-
/**
|
|
127
|
-
* @license
|
|
128
|
-
* Copyright 2021 Google LLC
|
|
129
|
-
* SPDX-LIcense-Identifier: Apache-2.0
|
|
130
|
-
*/
|
|
131
|
-
const k=e.css`.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}`
|
|
132
|
-
/**
|
|
133
|
-
* @license
|
|
134
|
-
* Copyright 2018 Google LLC
|
|
135
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
136
|
-
*/;let A=class extends x{};A.styles=[k],A=n([i.customElement("mwc-ripple")],A);
|
|
137
|
-
/**
|
|
138
|
-
* @license
|
|
139
|
-
* Copyright 2020 Google LLC
|
|
140
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
141
|
-
*/
|
|
142
|
-
class z{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}var S=function(t,e,i,r){for(var o,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,p=t.length-1;p>=0;p--)(o=t[p])&&(a=(s<3?o(a):s>3?o(e,i,a):o(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const O={color:r.FtCssVariable.extend("--ft-ripple-color",r.designSystemVariables.colorContent),primaryColor:r.FtCssVariable.extend("--ft-ripple-primary-color",r.FtCssVariable.extend("--ft-ripple-color",r.designSystemVariables.colorPrimary)),secondaryColor:r.FtCssVariable.extend("--ft-ripple-secondary-color",r.FtCssVariable.extend("--ft-ripple-color",r.designSystemVariables.colorSecondary)),opacityContentOnSurfacePressed:r.FtCssVariable.external(r.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:r.FtCssVariable.external(r.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:r.FtCssVariable.external(r.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:r.FtCssVariable.external(r.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),opacityContentOnSurfaceDragged:r.FtCssVariable.external(r.designSystemVariables.opacityContentOnSurfaceDragged,"Design system")};let T=class extends r.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1}getStyles(){return e.css`
|
|
143
|
-
:host {
|
|
144
|
-
display: contents;
|
|
145
|
-
|
|
146
|
-
--mdc-ripple-color: ${O.color};
|
|
147
|
-
--mdc-ripple-press-opacity: ${O.opacityContentOnSurfacePressed};
|
|
148
|
-
--mdc-ripple-hover-opacity: ${O.opacityContentOnSurfaceHover};
|
|
149
|
-
--mdc-ripple-focus-opacity: ${O.opacityContentOnSurfaceFocused};
|
|
150
|
-
--mdc-ripple-selected-opacity: ${O.opacityContentOnSurfaceSelected};
|
|
151
|
-
--mdc-ripple-activated-opacity: ${O.opacityContentOnSurfaceDragged};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
mwc-ripple.ft-ripple--secondary {
|
|
155
|
-
--mdc-ripple-color: ${O.secondaryColor};
|
|
156
|
-
}
|
|
1
|
+
!function(t,i,e,o,s,n){var r=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,p=t.length-1;p>=0;p--)(s=t[p])&&(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 p={color:i.FtCssVariable.extend("--ft-ripple-color",i.designSystemVariables.colorContent),primaryColor:i.FtCssVariable.extend("--ft-ripple-primary-color",i.FtCssVariable.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary)),secondaryColor:i.FtCssVariable.extend("--ft-ripple-secondary-color",i.FtCssVariable.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary)),opacityContentOnSurfacePressed:i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system")};class l 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.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed)},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`
|
|
2
|
+
<style>
|
|
3
|
+
.ft-ripple .ft-ripple--effect,
|
|
4
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
5
|
+
width: ${this.rippleSize}px;
|
|
6
|
+
height: ${this.rippleSize}px;
|
|
7
|
+
}
|
|
157
8
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
></mwc-ripple>
|
|
169
|
-
`}updated(t){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple()}endRipple(){var t,e,i;null===(t=this.rippleHandlers)||void 0===t||t.endHover(),null===(e=this.rippleHandlers)||void 0===e||e.endFocus(),null===(i=this.rippleHandlers)||void 0===i||i.endPress()}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentNode;if(e){const t=new z((async()=>this.mwcRipple)),i=(...e)=>i=>{e.forEach((e=>window.addEventListener(e,t.endPress,{once:!0}))),t.startPress(i)},r=i("mouseup"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")()};e.addEventListener("mouseenter",t.startHover),e.addEventListener("mouseleave",t.endHover),e.addEventListener("mousedown",r),e.addEventListener("touchstart",o),e.addEventListener("keydown",s),e.addEventListener("focus",t.startFocus),e.addEventListener("blur",t.endFocus),this.onDisconnect=()=>{e.removeEventListener("mouseenter",t.startHover),e.removeEventListener("mouseleave",t.endHover),e.removeEventListener("mousedown",r),e.removeEventListener("touchstart",o),e.removeEventListener("keydown",s),e.removeEventListener("focus",t.startFocus),e.removeEventListener("blur",t.endFocus)},this.rippleHandlers=t}}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};
|
|
9
|
+
.ft-ripple .ft-ripple--effect {
|
|
10
|
+
left: ${this.originX}px;
|
|
11
|
+
top: ${this.originY}px;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
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){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple(),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()}}
|
|
170
19
|
/**
|
|
171
20
|
* @license
|
|
172
21
|
* Copyright 2017 Google LLC
|
|
173
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
174
23
|
*/
|
|
175
|
-
var
|
|
24
|
+
var h;l.elementDefinitions={},l.styles=e.css`
|
|
25
|
+
:host {
|
|
26
|
+
display: contents;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ft-ripple {
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ft-ripple .ft-ripple--background,
|
|
40
|
+
.ft-ripple .ft-ripple--effect {
|
|
41
|
+
position: absolute;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
background-color: ${p.color};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background,
|
|
47
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
48
|
+
background-color: ${p.secondaryColor};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background,
|
|
52
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
53
|
+
background-color: ${p.primaryColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ft-ripple .ft-ripple--background {
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
height: 100%;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ft-ripple .ft-ripple--effect,
|
|
64
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
65
|
+
border-radius: 50%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ft-ripple .ft-ripple--effect {
|
|
69
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
70
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
74
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
75
|
+
left: 50%;
|
|
76
|
+
top: 50%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
80
|
+
transform: translate(-50%, -50%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
84
|
+
opacity: ${p.opacityContentOnSurfaceHover};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
88
|
+
opacity: ${p.opacityContentOnSurfaceSelected};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
92
|
+
opacity: ${p.opacityContentOnSurfaceFocused};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
96
|
+
opacity: ${p.opacityContentOnSurfacePressed};
|
|
97
|
+
transform: translate(-50%, -50%) scale(1);
|
|
98
|
+
}
|
|
99
|
+
`,r([o.property({type:Boolean})],l.prototype,"primary",void 0),r([o.property({type:Boolean})],l.prototype,"secondary",void 0),r([o.property({type:Boolean})],l.prototype,"unbounded",void 0),r([o.property({type:Boolean})],l.prototype,"activated",void 0),r([o.property({type:Boolean})],l.prototype,"selected",void 0),r([o.property({type:Boolean})],l.prototype,"disabled",void 0),r([o.state()],l.prototype,"hovered",void 0),r([o.state()],l.prototype,"focused",void 0),r([o.state()],l.prototype,"pressed",void 0),r([o.state()],l.prototype,"rippling",void 0),r([o.state()],l.prototype,"rippleSize",void 0),r([o.state()],l.prototype,"originX",void 0),r([o.state()],l.prototype,"originY",void 0),r([o.query(".ft-ripple")],l.prototype,"ripple",void 0),r([o.query(".ft-ripple--effect")],l.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(l);const a=globalThis.trustedTypes,f=a?a.createPolicy("lit-html",{createHTML:t=>t}):void 0,c=`lit$${(Math.random()+"").slice(9)}$`,d="?"+c,u=`<${d}>`,x=document,y=(t="")=>x.createComment(t),g=t=>null===t||"object"!=typeof t&&"function"!=typeof t,v=Array.isArray,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,b=/-->/g,$=/>/g,w=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,k=/'/g,z=/"/g,C=/^(?:script|style|textarea|title)$/i,S=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),O=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),N=new WeakMap,A=x.createTreeWalker(x,129,null,!1),I=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=m;for(let i=0;i<e;i++){const e=t[i];let p,l,h=-1,a=0;for(;a<e.length&&(r.lastIndex=a,l=r.exec(e),null!==l);)a=r.lastIndex,r===m?"!--"===l[1]?r=b:void 0!==l[1]?r=$:void 0!==l[2]?(C.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=w):void 0!==l[3]&&(r=w):r===w?">"===l[0]?(r=null!=s?s:m,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,p=l[1],r=void 0===l[3]?w:'"'===l[3]?z:k):r===z||r===k?r=w:r===b||r===$?r=m:(r=w,s=void 0);const f=r===w&&t[i+1].startsWith("/>")?" ":"";n+=r===m?e+u:h>=0?(o.push(p),e.slice(0,h)+"$lit$"+e.slice(h)+c+f):e+c+(-2===h?(o.push(void 0),i):f)}const p=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==f?f.createHTML(p):p,o]};class E{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,p=this.parts,[l,h]=I(t,i);if(this.el=E.createElement(l,e),A.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=A.nextNode())&&p.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(c)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(c),i=/([.?@])?(.*)/.exec(e);p.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?R:"?"===i[1]?U:"@"===i[1]?W:M})}else p.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(C.test(o.tagName)){const t=o.textContent.split(c),i=t.length-1;if(i>0){o.textContent=a?a.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],y()),A.nextNode(),p.push({type:2,index:++s});o.append(t[i],y())}}}else if(8===o.nodeType)if(o.data===d)p.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(c,t+1));)p.push({type:7,index:s}),t+=c.length-1}s++}}static createElement(t,i){const e=x.createElement("template");return e.innerHTML=t,e}}function T(t,i,e=t,o){var s,n,r,p;if(i===O)return i;let l=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const h=g(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,o)),void 0!==o?(null!==(r=(p=e)._$Cl)&&void 0!==r?r:p._$Cl=[])[o]=l:e._$Cu=l),void 0!==l&&(i=T(t,l._$AS(t,i.values),l,o)),i}class F{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:x).importNode(e,!0);A.currentNode=s;let n=A.nextNode(),r=0,p=0,l=o[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new _(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new Z(n,this,t)),this.v.push(i),l=o[++p]}r!==(null==l?void 0:l.index)&&(n=A.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 _{constructor(t,i,e,o){var s;this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cg=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._$Cg}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=T(this,t,i),g(t)?t===j||null==t||""===t?(this._$AH!==j&&this._$AR(),this._$AH=j):t!==this._$AH&&t!==O&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return v(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==j&&g(this._$AH)?this._$AA.nextSibling.data=t:this.S(x.createTextNode(t)),this._$AH=t}T(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=E.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 F(s,this),i=t.p(this.options);t.m(e),this.S(i),this._$AH=t}}_$AC(t){let i=N.get(t.strings);return void 0===i&&N.set(t.strings,i=new E(t)),i}A(t){v(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 _(this.M(y()),this.M(y()),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._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class M{constructor(t,i,e,o,s){this.type=1,this._$AH=j,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=j}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=T(this,t,i,0),n=!g(t)||t!==this._$AH&&t!==O,n&&(this._$AH=t);else{const o=t;let r,p;for(t=s[0],r=0;r<s.length-1;r++)p=T(this,o[e+r],i,r),p===O&&(p=this._$AH[r]),n||(n=!g(p)||p!==this._$AH[r]),p===j?t=j:t!==j&&(t+=(null!=p?p:"")+s[r+1]),this._$AH[r]=p}n&&!o&&this.k(t)}k(t){t===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class R extends M{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===j?void 0:t}}const B=a?a.emptyScript:"";class U extends M{constructor(){super(...arguments),this.type=4}k(t){t&&t!==j?this.element.setAttribute(this.name,B):this.element.removeAttribute(this.name)}}class W extends M{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=T(this,t,i,0))&&void 0!==e?e:j)===O)return;const o=this._$AH,s=t===j&&o!==j||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==j&&(o===j||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 Z{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){T(this,t)}}const D=window.litHtmlPolyfillSupport;null==D||D(E,_),(null!==(h=globalThis.litHtmlVersions)&&void 0!==h?h:globalThis.litHtmlVersions=[]).push("2.1.3");
|
|
176
100
|
/**
|
|
177
101
|
* @license
|
|
178
102
|
* Copyright 2020 Google LLC
|
|
179
103
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
180
104
|
*/
|
|
181
|
-
const
|
|
105
|
+
const L=t=>({_$litStatic$:t}),K=new Map,G=(t=>(i,...e)=>{var o;const s=e.length;let n,r;const p=[],l=[];let h,a=0,f=!1;for(;a<s;){for(h=i[a];a<s&&void 0!==(r=e[a],n=null===(o=r)||void 0===o?void 0:o._$litStatic$);)h+=n+i[++a],f=!0;l.push(r),p.push(h),a++}if(a===s&&p.push(i[s]),f){const t=p.join("$$lit$$");void 0===(i=K.get(t))&&(p.raw=p,K.set(t,i=p)),e=l}return t(i,...e)})(S);var H,q=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,p=t.length-1;p>=0;p--)(s=t[p])&&(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};!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"}(H||(H={}));const P=i.FtCssVariable.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),V=i.FtCssVariable.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),X={fontFamily:V,fontSize:i.FtCssVariable.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariable.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariable.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariable.create("--ft-typography-line-height","SIZE","24px"),textTransform:i.FtCssVariable.create("--ft-typography-text-transform","UNKNOWN","inherit")},Y=i.FtCssVariable.extend("--ft-typography-title-font-family",P),J=i.FtCssVariable.extend("--ft-typography-title-font-size",X.fontSize,"20px"),Q=i.FtCssVariable.extend("--ft-typography-title-font-weight",X.fontWeight,"normal"),tt=i.FtCssVariable.extend("--ft-typography-title-letter-spacing",X.letterSpacing,"0.15px"),it=i.FtCssVariable.extend("--ft-typography-title-line-height",X.lineHeight,"24px"),et=i.FtCssVariable.extend("--ft-typography-title-text-transform",X.textTransform,"inherit"),ot=i.FtCssVariable.extend("--ft-typography-title-dense-font-family",P),st=i.FtCssVariable.extend("--ft-typography-title-dense-font-size",X.fontSize,"14px"),nt=i.FtCssVariable.extend("--ft-typography-title-dense-font-weight",X.fontWeight,"normal"),rt=i.FtCssVariable.extend("--ft-typography-title-dense-letter-spacing",X.letterSpacing,"0.105px"),pt=i.FtCssVariable.extend("--ft-typography-title-dense-line-height",X.lineHeight,"24px"),lt=i.FtCssVariable.extend("--ft-typography-title-dense-text-transform",X.textTransform,"inherit"),ht=i.FtCssVariable.extend("--ft-typography-subtitle1-font-family",V),at=i.FtCssVariable.extend("--ft-typography-subtitle1-font-size",X.fontSize,"16px"),ft=i.FtCssVariable.extend("--ft-typography-subtitle1-font-weight",X.fontWeight,"600"),ct=i.FtCssVariable.extend("--ft-typography-subtitle1-letter-spacing",X.letterSpacing,"0.144px"),dt=i.FtCssVariable.extend("--ft-typography-subtitle1-line-height",X.lineHeight,"24px"),ut=i.FtCssVariable.extend("--ft-typography-subtitle1-text-transform",X.textTransform,"inherit"),xt=i.FtCssVariable.extend("--ft-typography-subtitle2-font-family",V),yt=i.FtCssVariable.extend("--ft-typography-subtitle2-font-size",X.fontSize,"14px"),gt=i.FtCssVariable.extend("--ft-typography-subtitle2-font-weight",X.fontWeight,"normal"),vt=i.FtCssVariable.extend("--ft-typography-subtitle2-letter-spacing",X.letterSpacing,"0.098px"),mt=i.FtCssVariable.extend("--ft-typography-subtitle2-line-height",X.lineHeight,"24px"),bt=i.FtCssVariable.extend("--ft-typography-subtitle2-text-transform",X.textTransform,"inherit"),$t=i.FtCssVariable.extend("--ft-typography-body1-font-family",V),wt=i.FtCssVariable.extend("--ft-typography-body1-font-size",X.fontSize,"16px"),kt=i.FtCssVariable.extend("--ft-typography-body1-font-weight",X.fontWeight,"normal"),zt=i.FtCssVariable.extend("--ft-typography-body1-letter-spacing",X.letterSpacing,"0.496px"),Ct=i.FtCssVariable.extend("--ft-typography-body1-line-height",X.lineHeight,"24px"),St=i.FtCssVariable.extend("--ft-typography-body1-text-transform",X.textTransform,"inherit"),Ot=i.FtCssVariable.extend("--ft-typography-body2-font-family",V),jt=i.FtCssVariable.extend("--ft-typography-body2-font-size",X.fontSize,"14px"),Nt=i.FtCssVariable.extend("--ft-typography-body2-font-weight",X.fontWeight,"normal"),At=i.FtCssVariable.extend("--ft-typography-body2-letter-spacing",X.letterSpacing,"0.252px"),It=i.FtCssVariable.extend("--ft-typography-body2-line-height",X.lineHeight,"20px"),Et=i.FtCssVariable.extend("--ft-typography-body2-text-transform",X.textTransform,"inherit"),Tt=i.FtCssVariable.extend("--ft-typography-caption-font-family",V),Ft=i.FtCssVariable.extend("--ft-typography-caption-font-size",X.fontSize,"12px"),_t=i.FtCssVariable.extend("--ft-typography-caption-font-weight",X.fontWeight,"normal"),Mt=i.FtCssVariable.extend("--ft-typography-caption-letter-spacing",X.letterSpacing,"0.396px"),Rt=i.FtCssVariable.extend("--ft-typography-caption-line-height",X.lineHeight,"16px"),Bt=i.FtCssVariable.extend("--ft-typography-caption-text-transform",X.textTransform,"inherit"),Ut=i.FtCssVariable.extend("--ft-typography-breadcrumb-font-family",V),Wt=i.FtCssVariable.extend("--ft-typography-breadcrumb-font-size",X.fontSize,"10px"),Zt=i.FtCssVariable.extend("--ft-typography-breadcrumb-font-weight",X.fontWeight,"normal"),Dt=i.FtCssVariable.extend("--ft-typography-breadcrumb-letter-spacing",X.letterSpacing,"0.33px"),Lt=i.FtCssVariable.extend("--ft-typography-breadcrumb-line-height",X.lineHeight,"16px"),Kt=i.FtCssVariable.extend("--ft-typography-breadcrumb-text-transform",X.textTransform,"inherit"),Gt=i.FtCssVariable.extend("--ft-typography-overline-font-family",V),Ht=i.FtCssVariable.extend("--ft-typography-overline-font-size",X.fontSize,"10px"),qt=i.FtCssVariable.extend("--ft-typography-overline-font-weight",X.fontWeight,"normal"),Pt=i.FtCssVariable.extend("--ft-typography-overline-letter-spacing",X.letterSpacing,"1.5px"),Vt=i.FtCssVariable.extend("--ft-typography-overline-line-height",X.lineHeight,"16px"),Xt=i.FtCssVariable.extend("--ft-typography-overline-text-transform",X.textTransform,"uppercase"),Yt={fontFamily:i.FtCssVariable.extend("--ft-typography-button-font-family",V),fontSize:i.FtCssVariable.extend("--ft-typography-button-font-size",X.fontSize,"14px"),fontWeight:i.FtCssVariable.extend("--ft-typography-button-font-weight",X.fontWeight,"600"),letterSpacing:i.FtCssVariable.extend("--ft-typography-button-letter-spacing",X.letterSpacing,"1.246px"),lineHeight:i.FtCssVariable.extend("--ft-typography-button-line-height",X.lineHeight,"16px"),textTransform:i.FtCssVariable.extend("--ft-typography-button-text-transform",X.textTransform,"uppercase")},Jt=e.css`
|
|
182
106
|
.ft-typography--title {
|
|
183
|
-
font-family: ${
|
|
184
|
-
font-size: ${
|
|
185
|
-
font-weight: ${
|
|
186
|
-
letter-spacing: ${
|
|
187
|
-
line-height: ${
|
|
188
|
-
text-transform: ${
|
|
107
|
+
font-family: ${Y};
|
|
108
|
+
font-size: ${J};
|
|
109
|
+
font-weight: ${Q};
|
|
110
|
+
letter-spacing: ${tt};
|
|
111
|
+
line-height: ${it};
|
|
112
|
+
text-transform: ${et};
|
|
189
113
|
}
|
|
190
|
-
`,
|
|
114
|
+
`,Qt=e.css`
|
|
191
115
|
.ft-typography--title-dense {
|
|
192
|
-
font-family: ${
|
|
193
|
-
font-size: ${
|
|
194
|
-
font-weight: ${
|
|
195
|
-
letter-spacing: ${
|
|
196
|
-
line-height: ${
|
|
197
|
-
text-transform: ${
|
|
116
|
+
font-family: ${ot};
|
|
117
|
+
font-size: ${st};
|
|
118
|
+
font-weight: ${nt};
|
|
119
|
+
letter-spacing: ${rt};
|
|
120
|
+
line-height: ${pt};
|
|
121
|
+
text-transform: ${lt};
|
|
198
122
|
}
|
|
199
|
-
`,
|
|
123
|
+
`,ti=e.css`
|
|
200
124
|
.ft-typography--subtitle1 {
|
|
201
|
-
font-family: ${
|
|
202
|
-
font-size: ${
|
|
203
|
-
font-weight: ${
|
|
204
|
-
letter-spacing: ${
|
|
205
|
-
line-height: ${
|
|
206
|
-
text-transform: ${
|
|
125
|
+
font-family: ${ht};
|
|
126
|
+
font-size: ${at};
|
|
127
|
+
font-weight: ${ft};
|
|
128
|
+
letter-spacing: ${ct};
|
|
129
|
+
line-height: ${dt};
|
|
130
|
+
text-transform: ${ut};
|
|
207
131
|
}
|
|
208
|
-
|
|
132
|
+
`,ii=e.css`
|
|
209
133
|
.ft-typography--subtitle2 {
|
|
210
|
-
font-family: ${
|
|
211
|
-
font-size: ${
|
|
212
|
-
font-weight: ${
|
|
213
|
-
letter-spacing: ${
|
|
214
|
-
line-height: ${
|
|
215
|
-
text-transform: ${
|
|
134
|
+
font-family: ${xt};
|
|
135
|
+
font-size: ${yt};
|
|
136
|
+
font-weight: ${gt};
|
|
137
|
+
letter-spacing: ${vt};
|
|
138
|
+
line-height: ${mt};
|
|
139
|
+
text-transform: ${bt};
|
|
216
140
|
}
|
|
217
141
|
|
|
218
|
-
`,
|
|
142
|
+
`,ei=e.css`
|
|
219
143
|
.ft-typography--body1 {
|
|
220
|
-
font-family: ${
|
|
221
|
-
font-size: ${
|
|
222
|
-
font-weight: ${
|
|
223
|
-
letter-spacing: ${
|
|
224
|
-
line-height: ${
|
|
225
|
-
text-transform: ${
|
|
144
|
+
font-family: ${$t};
|
|
145
|
+
font-size: ${wt};
|
|
146
|
+
font-weight: ${kt};
|
|
147
|
+
letter-spacing: ${zt};
|
|
148
|
+
line-height: ${Ct};
|
|
149
|
+
text-transform: ${St};
|
|
226
150
|
}
|
|
227
|
-
`,
|
|
151
|
+
`,oi=e.css`
|
|
228
152
|
.ft-typography--body2 {
|
|
229
|
-
font-family: ${
|
|
230
|
-
font-size: ${
|
|
231
|
-
font-weight: ${
|
|
232
|
-
letter-spacing: ${
|
|
233
|
-
line-height: ${
|
|
234
|
-
text-transform: ${
|
|
153
|
+
font-family: ${Ot};
|
|
154
|
+
font-size: ${jt};
|
|
155
|
+
font-weight: ${Nt};
|
|
156
|
+
letter-spacing: ${At};
|
|
157
|
+
line-height: ${It};
|
|
158
|
+
text-transform: ${Et};
|
|
235
159
|
}
|
|
236
|
-
`,
|
|
160
|
+
`,si=e.css`
|
|
237
161
|
.ft-typography--caption {
|
|
238
|
-
font-family: ${
|
|
239
|
-
font-size: ${
|
|
240
|
-
font-weight: ${
|
|
241
|
-
letter-spacing: ${
|
|
242
|
-
line-height: ${
|
|
243
|
-
text-transform: ${
|
|
162
|
+
font-family: ${Tt};
|
|
163
|
+
font-size: ${Ft};
|
|
164
|
+
font-weight: ${_t};
|
|
165
|
+
letter-spacing: ${Mt};
|
|
166
|
+
line-height: ${Rt};
|
|
167
|
+
text-transform: ${Bt};
|
|
244
168
|
}
|
|
245
|
-
`,
|
|
169
|
+
`,ni=e.css`
|
|
246
170
|
.ft-typography--breadcrumb {
|
|
247
|
-
font-family: ${
|
|
248
|
-
font-size: ${
|
|
249
|
-
font-weight: ${
|
|
250
|
-
letter-spacing: ${
|
|
251
|
-
line-height: ${
|
|
252
|
-
text-transform: ${
|
|
171
|
+
font-family: ${Ut};
|
|
172
|
+
font-size: ${Wt};
|
|
173
|
+
font-weight: ${Zt};
|
|
174
|
+
letter-spacing: ${Dt};
|
|
175
|
+
line-height: ${Lt};
|
|
176
|
+
text-transform: ${Kt};
|
|
253
177
|
}
|
|
254
|
-
`,
|
|
178
|
+
`,ri=e.css`
|
|
255
179
|
.ft-typography--overline {
|
|
256
|
-
font-family: ${
|
|
257
|
-
font-size: ${
|
|
258
|
-
font-weight: ${
|
|
259
|
-
letter-spacing: ${
|
|
260
|
-
line-height: ${
|
|
261
|
-
text-transform: ${
|
|
180
|
+
font-family: ${Gt};
|
|
181
|
+
font-size: ${Ht};
|
|
182
|
+
font-weight: ${qt};
|
|
183
|
+
letter-spacing: ${Pt};
|
|
184
|
+
line-height: ${Vt};
|
|
185
|
+
text-transform: ${Xt};
|
|
262
186
|
}
|
|
263
|
-
`,
|
|
187
|
+
`,pi=e.css`
|
|
264
188
|
.ft-typography--button {
|
|
265
|
-
font-family: ${
|
|
266
|
-
font-size: ${
|
|
267
|
-
font-weight: ${
|
|
268
|
-
letter-spacing: ${
|
|
269
|
-
line-height: ${
|
|
270
|
-
text-transform: ${
|
|
189
|
+
font-family: ${Yt.fontFamily};
|
|
190
|
+
font-size: ${Yt.fontSize};
|
|
191
|
+
font-weight: ${Yt.fontWeight};
|
|
192
|
+
letter-spacing: ${Yt.letterSpacing};
|
|
193
|
+
line-height: ${Yt.lineHeight};
|
|
194
|
+
text-transform: ${Yt.textTransform};
|
|
271
195
|
}
|
|
272
|
-
`;
|
|
273
|
-
.
|
|
274
|
-
vertical-align: inherit;
|
|
275
|
-
}
|
|
276
|
-
`]}getTemplate(){return this.element?dt`
|
|
277
|
-
<${ct(this.element)}
|
|
196
|
+
`;class li extends i.FtLitElement{constructor(){super(...arguments),this.variant=H.body1}render(){return this.element?G`
|
|
197
|
+
<${L(this.element)}
|
|
278
198
|
class="ft-typography ft-typography--${this.variant}">
|
|
279
199
|
<slot></slot>
|
|
280
|
-
</${
|
|
281
|
-
`:
|
|
200
|
+
</${L(this.element)}>
|
|
201
|
+
`:G`
|
|
282
202
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
283
|
-
`}}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* Copyright 2021 Google LLC
|
|
287
|
-
* SPDX-LIcense-Identifier: Apache-2.0
|
|
288
|
-
*/
|
|
289
|
-
const Ce=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`
|
|
290
|
-
/**
|
|
291
|
-
* @license
|
|
292
|
-
* Copyright 2018 Google LLC
|
|
293
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
294
|
-
*/;let _e=class extends e.LitElement{render(){return e.html`<span><slot></slot></span>`}};_e.styles=[Ce],_e=n([i.customElement("mwc-icon")],_e);var Ie=function(t,e,i,r){for(var o,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,p=t.length-1;p>=0;p--)(o=t[p])&&(a=(s<3?o(a):s>3?o(e,i,a):o(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const Ee=r.FtCssVariable.create("--ft-tooltip-distance","SIZE","4px"),Fe=r.FtCssVariable.create("--ft-tooltip-color","COLOR","#FFFFFF"),Re=r.FtCssVariable.create("--ft-tooltip-background-color","COLOR","#666666"),je=r.FtCssVariable.create("--ft-tooltip-z-index","NUMBER","1"),De=r.FtCssVariable.external(r.designSystemVariables.borderRadiusS,"Design system");let Ne=class extends r.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new r.Debouncer,this.revealDebouncer=new r.Debouncer}getStyles(){return e.css`
|
|
295
|
-
.ft-tooltip--container {
|
|
296
|
-
display: block;
|
|
297
|
-
position: relative;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.ft-tooltip--inline {
|
|
301
|
-
display: inline-block;
|
|
302
|
-
max-width: 100%;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.ft-tooltip {
|
|
306
|
-
position: absolute;
|
|
307
|
-
box-sizing: border-box;
|
|
308
|
-
overflow: hidden;
|
|
309
|
-
width: max-content;
|
|
310
|
-
max-width: 150px;
|
|
311
|
-
text-align: center;
|
|
312
|
-
padding: ${Ee};
|
|
313
|
-
z-index: ${je};
|
|
203
|
+
`}}li.styles=[Jt,Qt,ti,ii,ei,oi,si,ni,ri,pi,e.css`
|
|
204
|
+
.ft-typography {
|
|
205
|
+
vertical-align: inherit;
|
|
314
206
|
}
|
|
315
|
-
|
|
316
|
-
.ft-tooltip--content {
|
|
317
|
-
padding: 4px 8px;
|
|
318
|
-
border-radius: ${De};
|
|
319
|
-
background-color: ${Re};
|
|
320
|
-
color: ${Fe};
|
|
321
|
-
top: -500px;
|
|
322
|
-
left: -500px;
|
|
323
|
-
position: relative;
|
|
324
|
-
word-break: break-word;
|
|
325
|
-
}
|
|
326
|
-
`}getTemplate(){return e.html`
|
|
207
|
+
`],q([o.property()],li.prototype,"element",void 0),q([o.property()],li.prototype,"variant",void 0),i.customElement("ft-typography")(li);var hi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,p=t.length-1;p>=0;p--)(s=t[p])&&(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 ai=i.FtCssVariable.create("--ft-tooltip-distance","SIZE","4px"),fi=i.FtCssVariable.create("--ft-tooltip-color","COLOR","#FFFFFF"),ci=i.FtCssVariable.create("--ft-tooltip-background-color","COLOR","#666666"),di=i.FtCssVariable.create("--ft-tooltip-z-index","NUMBER","1"),ui=i.FtCssVariable.external(i.designSystemVariables.borderRadiusS,"Design system");class xi 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`
|
|
327
208
|
<div part="container"
|
|
328
209
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
329
210
|
@mouseenter=${this.onHover}
|
|
@@ -338,7 +219,77 @@ const Ce=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
|
|
|
338
219
|
</div>
|
|
339
220
|
<slot></slot>
|
|
340
221
|
</div>
|
|
341
|
-
`}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
|
|
222
|
+
`}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,s=this.tooltip.style;switch(this.position){case"top":s.top=-this.tooltip.clientHeight+"px",s.left=o+"px";break;case"bottom":s.top=i.height+"px",s.left=o+"px";break;case"left":s.top=e+"px",s.left=-this.tooltip.clientWidth+"px";break;case"right":s.top=e+"px",s.left=i.width+"px"}s.maxWidth=Math.max(i.width,150)+"px"}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())}}var yi,gi;xi.elementDefinitions={"ft-typography":li},xi.styles=e.css`
|
|
223
|
+
.ft-tooltip--container {
|
|
224
|
+
display: block;
|
|
225
|
+
position: relative;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.ft-tooltip--inline {
|
|
229
|
+
display: inline-block;
|
|
230
|
+
max-width: 100%;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.ft-tooltip {
|
|
234
|
+
position: absolute;
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
width: max-content;
|
|
238
|
+
max-width: 150px;
|
|
239
|
+
text-align: center;
|
|
240
|
+
padding: ${ai};
|
|
241
|
+
z-index: ${di};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.ft-tooltip--content {
|
|
245
|
+
padding: 4px 8px;
|
|
246
|
+
border-radius: ${ui};
|
|
247
|
+
background-color: ${ci};
|
|
248
|
+
color: ${fi};
|
|
249
|
+
top: -500px;
|
|
250
|
+
left: -500px;
|
|
251
|
+
position: relative;
|
|
252
|
+
word-break: break-word;
|
|
253
|
+
}
|
|
254
|
+
`,hi([o.property()],xi.prototype,"text",void 0),hi([o.property({type:Boolean})],xi.prototype,"manual",void 0),hi([o.property({type:Boolean})],xi.prototype,"inline",void 0),hi([o.property({type:Number})],xi.prototype,"delay",void 0),hi([o.property()],xi.prototype,"position",void 0),hi([o.queryAssignedNodes("",!0)],xi.prototype,"slotNodes",void 0),hi([o.query(".ft-tooltip--container")],xi.prototype,"container",void 0),hi([o.query("slot")],xi.prototype,"target",void 0),hi([o.query(".ft-tooltip")],xi.prototype,"tooltip",void 0),hi([o.query(".ft-tooltip--content")],xi.prototype,"tooltipContent",void 0),hi([o.state()],xi.prototype,"visible",void 0),i.customElement("ft-tooltip")(xi),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=""}(yi||(yi={})),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=""}(gi||(gi={})),new Map([...["abw"].map((t=>[t,gi.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,gi.AUDIO])),...["avi"].map((t=>[t,gi.AVI])),...["chm","xhs"].map((t=>[t,gi.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,gi.CODE])),...["csv"].map((t=>[t,gi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,gi.DITA])),...["epub"].map((t=>[t,gi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,gi.EXCEL])),...["flac"].map((t=>[t,gi.FLAC])),...["gif"].map((t=>[t,gi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,gi.GZIP])),...["html","htm","xhtml"].map((t=>[t,gi.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,gi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,gi.JPEG])),...["json"].map((t=>[t,gi.JSON])),...["m4a","m4p"].map((t=>[t,gi.M4A])),...["mov","qt"].map((t=>[t,gi.MOV])),...["mp3"].map((t=>[t,gi.MP3])),...["mp4","m4v"].map((t=>[t,gi.MP4])),...["ogg","oga"].map((t=>[t,gi.OGG])),...["pdf","ps"].map((t=>[t,gi.PDF])),...["png"].map((t=>[t,gi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,gi.POWERPOINT])),...["rar"].map((t=>[t,gi.RAR])),...["stp"].map((t=>[t,gi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,gi.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,gi.VIDEO])),...["wav"].map((t=>[t,gi.WAV])),...["wma"].map((t=>[t,gi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,gi.WORD])),...["xml","xsl","rdf"].map((t=>[t,gi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,gi.YAML])),...["zip"].map((t=>[t,gi.ZIP]))]);var vi,mi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,p=t.length-1;p>=0;p--)(s=t[p])&&(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};!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(vi||(vi={}));const bi={size:i.FtCssVariable.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariable.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariable.extend("--ft-icon-file-format-font-family",i.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariable.extend("--ft-icon-material-font-family",i.FtCssVariable.create("--ft-icon-font-family","UNKNOWN","Material Icons"))};class $i extends i.FtLitElement{constructor(){super(...arguments),this.variant=vi.fluid_topics}render(){return e.html`
|
|
255
|
+
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
256
|
+
${n.unsafeHTML(this.getIcon())}
|
|
257
|
+
<slot @slotchange=${()=>this.requestUpdate()} ?hidden=${"material"!==this.variant}></slot>
|
|
258
|
+
</i>
|
|
259
|
+
`}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:""}getIcon(){var t,i;let o=this.textContent;return this.variant===vi.file_format?null!==(t=gi[o.toUpperCase()])&&void 0!==t?t:o:this.variant===vi.fluid_topics?null!==(i=yi[o.toUpperCase()])&&void 0!==i?i:o:e.nothing}}$i.elementDefinitions={},$i.styles=e.css`
|
|
260
|
+
:host, i.ft-icon {
|
|
261
|
+
display: inline-block;
|
|
262
|
+
width: ${bi.size};
|
|
263
|
+
height: ${bi.size};
|
|
264
|
+
text-align: center;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
i.ft-icon {
|
|
268
|
+
font-size: ${bi.size};
|
|
269
|
+
line-height: 1;
|
|
270
|
+
font-weight: normal;
|
|
271
|
+
text-transform: none;
|
|
272
|
+
font-style: normal;
|
|
273
|
+
font-variant: normal;
|
|
274
|
+
speak: none;
|
|
275
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
276
|
+
text-rendering: auto;
|
|
277
|
+
-webkit-font-smoothing: antialiased;
|
|
278
|
+
-moz-osx-font-smoothing: grayscale;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.ft-icon--fluid-topics {
|
|
282
|
+
font-family: ${bi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.ft-icon--file-format {
|
|
286
|
+
font-family: ${bi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.ft-icon--material {
|
|
290
|
+
font-family: ${bi.materialFontFamily}, "Material Icons", sans-serif;
|
|
291
|
+
}
|
|
292
|
+
`,mi([o.property()],$i.prototype,"variant",void 0),mi([o.query("slot")],$i.prototype,"slottedContent",void 0),i.customElement("ft-icon")($i);const wi={textColor:i.FtCssVariable.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceHigh),backgroundColor:i.FtCssVariable.extend("--ft-switch-background-color",i.designSystemVariables.colorSurface),selectedTextColor:i.FtCssVariable.extend("--ft-switch-selected-text-color",i.designSystemVariables.colorPrimary),selectedBackgroundColor:i.FtCssVariable.extend("--ft-switch-selected-background-color",i.designSystemVariables.colorPrimary),borderColor:i.FtCssVariable.extend("--ft-switch-border-color",i.designSystemVariables.colorOutline),borderRadius:i.FtCssVariable.extend("--ft-switch-border-radius",i.designSystemVariables.borderRadiusL),fontSize:i.FtCssVariable.extend("--ft-switch-font-size",Yt.fontSize),iconSize:i.FtCssVariable.create("--ft-switch-icon-size","SIZE","24px"),iconColor:i.FtCssVariable.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceMedium),rippleColor:i.FtCssVariable.extend("--ft-switch-ripple-color",i.designSystemVariables.colorPrimary),outlineColor:i.FtCssVariable.extend("--ft-switch-outline-color",i.designSystemVariables.colorPrimary)},ki={borderRadiusLeft:i.FtCssVariable.extend("--ft-switch-option-border-radius-left",i.designSystemVariables.borderRadiusL),borderRadiusRight:i.FtCssVariable.extend("--ft-switch-option-border-radius-right",i.designSystemVariables.borderRadiusL),borderWidthLeft:i.FtCssVariable.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:i.FtCssVariable.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:i.FtCssVariable.create("--ft-switch-option-border-width-vertical","SIZE","1px")};var zi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,p=t.length-1;p>=0;p--)(s=t[p])&&(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 Ci extends CustomEvent{constructor(){super("option-change",{bubbles:!0})}}class Si extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1}static get styles(){return e.css`
|
|
342
293
|
.ft-switch-option {
|
|
343
294
|
position: relative;
|
|
344
295
|
display: inline-block;
|
|
@@ -352,47 +303,47 @@ const Ce=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
|
|
|
352
303
|
}
|
|
353
304
|
|
|
354
305
|
.ft-switch-option--content {
|
|
355
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
356
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
306
|
+
--ft-switch-option-internal-line-height: calc(${wi.fontSize} + 2px);
|
|
307
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${wi.iconSize});
|
|
357
308
|
|
|
358
309
|
border-style: solid;
|
|
359
|
-
border-color: ${
|
|
360
|
-
border-width: ${
|
|
361
|
-
border-radius: ${
|
|
310
|
+
border-color: ${wi.borderColor};
|
|
311
|
+
border-width: ${ki.borderWidthVertical} ${ki.borderWidthRight} ${ki.borderWidthVertical} ${ki.borderWidthLeft};
|
|
312
|
+
border-radius: ${ki.borderRadiusLeft} ${ki.borderRadiusRight} ${ki.borderRadiusRight} ${ki.borderRadiusLeft};
|
|
362
313
|
display: flex;
|
|
363
314
|
align-items: center;
|
|
364
315
|
justify-content: center;
|
|
365
316
|
overflow: hidden;
|
|
366
317
|
|
|
367
|
-
|
|
318
|
+
${i.setVariable(bi.size,wi.iconSize)};
|
|
368
319
|
padding: 6px 8px;
|
|
369
|
-
background-color: ${
|
|
320
|
+
background-color: ${wi.backgroundColor};
|
|
370
321
|
-webkit-mask-image: radial-gradient(white, black);
|
|
371
322
|
}
|
|
372
323
|
|
|
373
324
|
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
374
|
-
background-color: ${
|
|
375
|
-
border-radius: ${
|
|
325
|
+
background-color: ${wi.selectedBackgroundColor};
|
|
326
|
+
border-radius: ${ki.borderRadiusLeft} ${ki.borderRadiusRight} ${ki.borderRadiusRight} ${ki.borderRadiusLeft};
|
|
376
327
|
position: absolute;
|
|
377
328
|
inset: 0;
|
|
378
329
|
content: "";
|
|
379
330
|
z-index: 1;
|
|
380
|
-
opacity: ${
|
|
331
|
+
opacity: ${i.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
381
332
|
}
|
|
382
333
|
|
|
383
334
|
.ft-switch-option--label {
|
|
384
|
-
color: ${
|
|
335
|
+
color: ${wi.textColor};
|
|
385
336
|
overflow: hidden;
|
|
386
337
|
white-space: nowrap;
|
|
387
338
|
text-overflow: ellipsis;
|
|
388
339
|
display: block;
|
|
389
340
|
margin: 0 8px;
|
|
390
|
-
${
|
|
391
|
-
${
|
|
341
|
+
${i.setVariable(Yt.fontSize,wi.fontSize)};
|
|
342
|
+
${i.setVariable(Yt.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
392
343
|
}
|
|
393
344
|
|
|
394
345
|
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
395
|
-
color: ${
|
|
346
|
+
color: ${wi.selectedTextColor};
|
|
396
347
|
}
|
|
397
348
|
|
|
398
349
|
.ft-switch-option--label[hidden] {
|
|
@@ -400,28 +351,27 @@ const Ce=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
|
|
|
400
351
|
}
|
|
401
352
|
|
|
402
353
|
.ft-switch-option--ripple {
|
|
403
|
-
${
|
|
354
|
+
${i.setVariable(p.color,wi.rippleColor)};
|
|
404
355
|
}
|
|
405
356
|
|
|
406
|
-
|
|
357
|
+
ft-icon, ft-ripple, ft-typography {
|
|
407
358
|
z-index: 2;
|
|
408
359
|
}
|
|
409
360
|
|
|
410
|
-
.ft-switch-option:not(.ft-switch-option--trailing-icon)
|
|
361
|
+
.ft-switch-option:not(.ft-switch-option--trailing-icon) ft-icon {
|
|
411
362
|
order: -1;
|
|
412
363
|
}
|
|
413
364
|
|
|
414
|
-
|
|
365
|
+
ft-icon {
|
|
415
366
|
flex-shrink: 0;
|
|
416
|
-
|
|
417
|
-
color: ${Le.iconColor};
|
|
367
|
+
color: ${wi.iconColor};
|
|
418
368
|
}
|
|
419
369
|
|
|
420
|
-
.ft-switch-option--input:checked + .ft-switch-option--content
|
|
421
|
-
color: ${
|
|
370
|
+
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
371
|
+
color: ${wi.selectedTextColor};
|
|
422
372
|
}
|
|
423
|
-
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new
|
|
424
|
-
<label for="input" class=${
|
|
373
|
+
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Ci)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(e.html`
|
|
374
|
+
<label for="input" class=${s.classMap(t)}>
|
|
425
375
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
426
376
|
.checked=${this.selected}
|
|
427
377
|
@change=${this.onChange}>
|
|
@@ -441,14 +391,14 @@ const Ce=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
|
|
|
441
391
|
${t}
|
|
442
392
|
</ft-tooltip>
|
|
443
393
|
`}onChange(){this.selected=!0}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
444
|
-
<
|
|
394
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `:e.nothing}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}Si.elementDefinitions={"ft-ripple":l,"ft-typography":li,"ft-tooltip":xi,"ft-icon":$i},zi([o.property({type:String})],Si.prototype,"value",void 0),zi([o.property({type:String})],Si.prototype,"icon",void 0),zi([o.property({type:String})],Si.prototype,"label",void 0),zi([o.property({type:String})],Si.prototype,"tooltipPosition",void 0),zi([o.property({type:Boolean,reflect:!0})],Si.prototype,"selected",void 0),zi([o.property({type:Boolean})],Si.prototype,"trailingIcon",void 0),zi([o.query(".ft-switch-option--content slot")],Si.prototype,"slottedContent",void 0),zi([o.query(".ft-switch-option--input")],Si.prototype,"input",void 0);var Oi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,p=t.length-1;p>=0;p--)(s=t[p])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ji extends CustomEvent{constructor(t){super("change",{detail:t})}}class Ni extends i.FtLitElement{constructor(){super(...arguments),this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}updated(t){var i;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new ji(null===(i=this.selectedOption)||void 0===i?void 0:i.value)))}static get styles(){return e.css`
|
|
445
395
|
:host {
|
|
446
396
|
display: inline-block;
|
|
447
397
|
}
|
|
448
398
|
|
|
449
399
|
.ft-switch {
|
|
450
|
-
border-radius: ${
|
|
451
|
-
outline-color: ${
|
|
400
|
+
border-radius: ${wi.borderRadius};
|
|
401
|
+
outline-color: ${wi.outlineColor};
|
|
452
402
|
}
|
|
453
403
|
|
|
454
404
|
.ft-switch slot {
|
|
@@ -457,22 +407,22 @@ const Ce=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
|
|
|
457
407
|
}
|
|
458
408
|
|
|
459
409
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
460
|
-
${
|
|
461
|
-
${
|
|
462
|
-
${
|
|
410
|
+
${i.setVariable(ki.borderRadiusLeft,"0")};
|
|
411
|
+
${i.setVariable(ki.borderRadiusRight,"0")};
|
|
412
|
+
${i.setVariable(ki.borderWidthLeft,"0")};
|
|
463
413
|
}
|
|
464
414
|
|
|
465
415
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
466
|
-
${
|
|
467
|
-
${
|
|
416
|
+
${i.setVariable(ki.borderRadiusLeft,wi.borderRadius)};
|
|
417
|
+
${i.setVariable(ki.borderWidthLeft,"1px")};
|
|
468
418
|
}
|
|
469
419
|
|
|
470
420
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
471
|
-
${
|
|
421
|
+
${i.setVariable(ki.borderRadiusRight,wi.borderRadius)};
|
|
472
422
|
}
|
|
473
|
-
`}
|
|
423
|
+
`}render(){return e.html`
|
|
474
424
|
<div class="ft-switch" @keydown=${this.onKeyDown} tabindex="0">
|
|
475
425
|
<slot @slotchange=${this.onSlotchange}
|
|
476
426
|
@option-change=${this.onOptionChange}></slot>
|
|
477
427
|
</div>
|
|
478
|
-
`}onKeyDown(t){let
|
|
428
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Si&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),this.options.push(t)}onOptionChange(t){let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Ni.elementDefinitions={},Oi([o.query(".ft-switch slot")],Ni.prototype,"slottedContent",void 0),Oi([o.state()],Ni.prototype,"selectedOption",void 0),i.customElement("ft-switch")(Ni),i.customElement("ft-switch-option")(Si),t.FtSwitch=Ni,t.FtSwitchChange=ji,t.FtSwitchCssVariables=wi,t.FtSwitchOption=Si,t.SwitchOptionChange=Ci,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|