@fluid-topics/ft-switch 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/build/ft-switch-option.d.ts +47 -0
- package/build/ft-switch-option.js +231 -0
- package/build/ft-switch.d.ts +38 -0
- package/build/ft-switch.js +142 -0
- package/build/ft-switch.light.js +479 -0
- package/build/ft-switch.min.js +569 -0
- package/package.json +34 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
!function(t,e,i,r,o,s){var a,p=new Uint8Array(16);function n(){if(!a&&!(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(p)}var c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function l(t){return"string"==typeof t&&c.test(t)}for(var d=[],h=0;h<256;++h)d.push((h+256).toString(16).substr(1));function f(t,e,i){var r=(t=t||{}).random||(t.rng||n)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){i=i||0;for(var o=0;o<16;++o)e[i+o]=r[o];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(d[t[e+0]]+d[t[e+1]]+d[t[e+2]]+d[t[e+3]]+"-"+d[t[e+4]]+d[t[e+5]]+"-"+d[t[e+6]]+d[t[e+7]]+"-"+d[t[e+8]]+d[t[e+9]]+"-"+d[t[e+10]]+d[t[e+11]]+d[t[e+12]]+d[t[e+13]]+d[t[e+14]]+d[t[e+15]]).toLowerCase();if(!l(i))throw TypeError("Stringified UUID is invalid");return i}(r)}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
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
|
+
***************************************************************************** */var u=function(t,e){return u=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])},u(t,e)};var m=function(){return m=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},m.apply(this,arguments)};function y(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 g(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.")}
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2018 Google Inc.
|
|
19
|
+
*
|
|
20
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
22
|
+
* in the Software without restriction, including without limitation the rights
|
|
23
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
24
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
25
|
+
* furnished to do so, subject to the following conditions:
|
|
26
|
+
*
|
|
27
|
+
* The above copyright notice and this permission notice shall be included in
|
|
28
|
+
* all copies or substantial portions of the Software.
|
|
29
|
+
*
|
|
30
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
31
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
32
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
33
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
34
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
35
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
36
|
+
* THE SOFTWARE.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* @license
|
|
40
|
+
* Copyright 2018 Google LLC
|
|
41
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
42
|
+
*/
|
|
43
|
+
const v=()=>{},b={get passive(){return!1}};document.addEventListener("x",v,b),document.removeEventListener("x",v);
|
|
44
|
+
/**
|
|
45
|
+
* @license
|
|
46
|
+
* Copyright 2018 Google LLC
|
|
47
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
48
|
+
*/
|
|
49
|
+
class w 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()}}
|
|
50
|
+
/**
|
|
51
|
+
* @license
|
|
52
|
+
* Copyright 2016 Google Inc.
|
|
53
|
+
*
|
|
54
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
55
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
56
|
+
* in the Software without restriction, including without limitation the rights
|
|
57
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
58
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
59
|
+
* furnished to do so, subject to the following conditions:
|
|
60
|
+
*
|
|
61
|
+
* The above copyright notice and this permission notice shall be included in
|
|
62
|
+
* all copies or substantial portions of the Software.
|
|
63
|
+
*
|
|
64
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
65
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
66
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
67
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
68
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
69
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
70
|
+
* THE SOFTWARE.
|
|
71
|
+
*/var $=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}(),x={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"},k={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"},A={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};
|
|
72
|
+
/**
|
|
73
|
+
* @license
|
|
74
|
+
* Copyright 2016 Google Inc.
|
|
75
|
+
*
|
|
76
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
77
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
78
|
+
* in the Software without restriction, including without limitation the rights
|
|
79
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
80
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
81
|
+
* furnished to do so, subject to the following conditions:
|
|
82
|
+
*
|
|
83
|
+
* The above copyright notice and this permission notice shall be included in
|
|
84
|
+
* all copies or substantial portions of the Software.
|
|
85
|
+
*
|
|
86
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
87
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
88
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
89
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
90
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
91
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
92
|
+
* THE SOFTWARE.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright 2016 Google Inc.
|
|
97
|
+
*
|
|
98
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
99
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
100
|
+
* in the Software without restriction, including without limitation the rights
|
|
101
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
102
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
103
|
+
* furnished to do so, subject to the following conditions:
|
|
104
|
+
*
|
|
105
|
+
* The above copyright notice and this permission notice shall be included in
|
|
106
|
+
* all copies or substantial portions of the Software.
|
|
107
|
+
*
|
|
108
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
109
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
110
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
111
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
112
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
113
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
114
|
+
* THE SOFTWARE.
|
|
115
|
+
*/
|
|
116
|
+
var z=["touchstart","pointerdown","mousedown","keydown"],S=["touchend","pointerup","mouseup","contextmenu"],O=[],T=function(t){function e(i){var r=t.call(this,m(m({},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}u(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return x},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return k},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return A},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=g(z),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=g(S),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=g(z),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=g(S),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&&O.length>0&&O.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(O.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){O=[],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)}),A.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=m({},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}($),C=T;
|
|
117
|
+
/**
|
|
118
|
+
* @license
|
|
119
|
+
* Copyright 2018 Google LLC
|
|
120
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
121
|
+
*/
|
|
122
|
+
class _ extends w{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=C}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`
|
|
123
|
+
<div class="mdc-ripple-surface mdc-ripple-upgraded ${o.classMap(r)}"
|
|
124
|
+
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>`}}y([i.query(".mdc-ripple-surface")],_.prototype,"mdcRoot",void 0),y([i.property({type:Boolean})],_.prototype,"primary",void 0),y([i.property({type:Boolean})],_.prototype,"accent",void 0),y([i.property({type:Boolean})],_.prototype,"unbounded",void 0),y([i.property({type:Boolean})],_.prototype,"disabled",void 0),y([i.property({type:Boolean})],_.prototype,"activated",void 0),y([i.property({type:Boolean})],_.prototype,"selected",void 0),y([i.property({type:Boolean})],_.prototype,"internalUseStateLayerCustomProperties",void 0),y([i.state()],_.prototype,"hovering",void 0),y([i.state()],_.prototype,"bgFocused",void 0),y([i.state()],_.prototype,"fgActivation",void 0),y([i.state()],_.prototype,"fgDeactivation",void 0),y([i.state()],_.prototype,"fgScale",void 0),y([i.state()],_.prototype,"fgSize",void 0),y([i.state()],_.prototype,"translateStart",void 0),y([i.state()],_.prototype,"translateEnd",void 0),y([i.state()],_.prototype,"leftPos",void 0),y([i.state()],_.prototype,"topPos",void 0);
|
|
125
|
+
/**
|
|
126
|
+
* @license
|
|
127
|
+
* Copyright 2021 Google LLC
|
|
128
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
|
129
|
+
*/
|
|
130
|
+
const E=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)}`
|
|
131
|
+
/**
|
|
132
|
+
* @license
|
|
133
|
+
* Copyright 2018 Google LLC
|
|
134
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
135
|
+
*/;let I=class extends _{};I.styles=[E],I=y([i.customElement("mwc-ripple")],I);
|
|
136
|
+
/**
|
|
137
|
+
* @license
|
|
138
|
+
* Copyright 2020 Google LLC
|
|
139
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
140
|
+
*/
|
|
141
|
+
class F{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 R=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 j={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 D=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`
|
|
142
|
+
:host {
|
|
143
|
+
display: contents;
|
|
144
|
+
|
|
145
|
+
--mdc-ripple-color: ${j.color};
|
|
146
|
+
--mdc-ripple-press-opacity: ${j.opacityContentOnSurfacePressed};
|
|
147
|
+
--mdc-ripple-hover-opacity: ${j.opacityContentOnSurfaceHover};
|
|
148
|
+
--mdc-ripple-focus-opacity: ${j.opacityContentOnSurfaceFocused};
|
|
149
|
+
--mdc-ripple-selected-opacity: ${j.opacityContentOnSurfaceSelected};
|
|
150
|
+
--mdc-ripple-activated-opacity: ${j.opacityContentOnSurfaceDragged};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
mwc-ripple.ft-ripple--secondary {
|
|
154
|
+
--mdc-ripple-color: ${j.secondaryColor};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
mwc-ripple.ft-ripple--primary {
|
|
158
|
+
--mdc-ripple-color: ${j.primaryColor};
|
|
159
|
+
}
|
|
160
|
+
`}getTemplate(){return e.html`
|
|
161
|
+
<mwc-ripple
|
|
162
|
+
class="${this.primary?"ft-ripple--primary":this.secondary?"ft-ripple--secondary":""}"
|
|
163
|
+
?unbounded=${this.unbounded}
|
|
164
|
+
?activated=${this.activated}
|
|
165
|
+
?selected=${this.selected}
|
|
166
|
+
?disabled=${this.disabled}
|
|
167
|
+
></mwc-ripple>
|
|
168
|
+
`}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 F((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()}};
|
|
169
|
+
/**
|
|
170
|
+
* @license
|
|
171
|
+
* Copyright 2017 Google LLC
|
|
172
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
173
|
+
*/
|
|
174
|
+
var N;D.elementDefinitions={"mwc-ripple":I},R([i.property({type:Boolean})],D.prototype,"primary",void 0),R([i.property({type:Boolean})],D.prototype,"secondary",void 0),R([i.property({type:Boolean})],D.prototype,"unbounded",void 0),R([i.property({type:Boolean})],D.prototype,"activated",void 0),R([i.property({type:Boolean})],D.prototype,"selected",void 0),R([i.property({type:Boolean})],D.prototype,"disabled",void 0),R([i.query("mwc-ripple")],D.prototype,"mwcRipple",void 0),D=R([r.customElement("ft-ripple")],D);const B=globalThis.trustedTypes,M=B?B.createPolicy("lit-html",{createHTML:t=>t}):void 0,U=`lit$${(Math.random()+"").slice(9)}$`,H="?"+U,V=`<${H}>`,L=document,P=(t="")=>L.createComment(t),G=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Z=Array.isArray,W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,K=/>/g,X=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,Y=/'/g,J=/"/g,Q=/^(?:script|style|textarea|title)$/i,tt=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),et=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),rt=new WeakMap,ot=L.createTreeWalker(L,129,null,!1),st=(t,e)=>{const i=t.length-1,r=[];let o,s=2===e?"<svg>":"",a=W;for(let e=0;e<i;e++){const i=t[e];let p,n,c=-1,l=0;for(;l<i.length&&(a.lastIndex=l,n=a.exec(i),null!==n);)l=a.lastIndex,a===W?"!--"===n[1]?a=q:void 0!==n[1]?a=K:void 0!==n[2]?(Q.test(n[2])&&(o=RegExp("</"+n[2],"g")),a=X):void 0!==n[3]&&(a=X):a===X?">"===n[0]?(a=null!=o?o:W,c=-1):void 0===n[1]?c=-2:(c=a.lastIndex-n[2].length,p=n[1],a=void 0===n[3]?X:'"'===n[3]?J:Y):a===J||a===Y?a=X:a===q||a===K?a=W:(a=X,o=void 0);const d=a===X&&t[e+1].startsWith("/>")?" ":"";s+=a===W?i+V:c>=0?(r.push(p),i.slice(0,c)+"$lit$"+i.slice(c)+U+d):i+U+(-2===c?(r.push(void 0),e):d)}const p=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==M?M.createHTML(p):p,r]};class at{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,s=0;const a=t.length-1,p=this.parts,[n,c]=st(t,e);if(this.el=at.createElement(n,i),ot.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=ot.nextNode())&&p.length<a;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(U)){const i=c[s++];if(t.push(e),void 0!==i){const t=r.getAttribute(i.toLowerCase()+"$lit$").split(U),e=/([.?@])?(.*)/.exec(i);p.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?dt:"?"===e[1]?ft:"@"===e[1]?ut:lt})}else p.push({type:6,index:o})}for(const e of t)r.removeAttribute(e)}if(Q.test(r.tagName)){const t=r.textContent.split(U),e=t.length-1;if(e>0){r.textContent=B?B.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],P()),ot.nextNode(),p.push({type:2,index:++o});r.append(t[e],P())}}}else if(8===r.nodeType)if(r.data===H)p.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(U,t+1));)p.push({type:7,index:o}),t+=U.length-1}o++}}static createElement(t,e){const i=L.createElement("template");return i.innerHTML=t,i}}function pt(t,e,i=t,r){var o,s,a,p;if(e===et)return e;let n=void 0!==r?null===(o=i._$Cl)||void 0===o?void 0:o[r]:i._$Cu;const c=G(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==c&&(null===(s=null==n?void 0:n._$AO)||void 0===s||s.call(n,!1),void 0===c?n=void 0:(n=new c(t),n._$AT(t,i,r)),void 0!==r?(null!==(a=(p=i)._$Cl)&&void 0!==a?a:p._$Cl=[])[r]=n:i._$Cu=n),void 0!==n&&(e=pt(t,n._$AS(t,e.values),n,r)),e}class nt{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:r}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:L).importNode(i,!0);ot.currentNode=o;let s=ot.nextNode(),a=0,p=0,n=r[0];for(;void 0!==n;){if(a===n.index){let e;2===n.type?e=new ct(s,s.nextSibling,this,t):1===n.type?e=new n.ctor(s,n.name,n.strings,this,t):6===n.type&&(e=new mt(s,this,t)),this.v.push(e),n=r[++p]}a!==(null==n?void 0:n.index)&&(s=ot.nextNode(),a++)}return o}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class ct{constructor(t,e,i,r){var o;this.type=2,this._$AH=it,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cg=null===(o=null==r?void 0:r.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=pt(this,t,e),G(t)?t===it||null==t||""===t?(this._$AH!==it&&this._$AR(),this._$AH=it):t!==this._$AH&&t!==et&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return Z(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==it&&G(this._$AH)?this._$AA.nextSibling.data=t:this.S(L.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:r}=t,o="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=at.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new nt(o,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=rt.get(t.strings);return void 0===e&&rt.set(t.strings,e=new at(t)),e}A(t){Z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const o of t)r===e.length?e.push(i=new ct(this.M(P()),this.M(P()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class lt{constructor(t,e,i,r,o){this.type=1,this._$AH=it,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=it}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const o=this.strings;let s=!1;if(void 0===o)t=pt(this,t,e,0),s=!G(t)||t!==this._$AH&&t!==et,s&&(this._$AH=t);else{const r=t;let a,p;for(t=o[0],a=0;a<o.length-1;a++)p=pt(this,r[i+a],e,a),p===et&&(p=this._$AH[a]),s||(s=!G(p)||p!==this._$AH[a]),p===it?t=it:t!==it&&(t+=(null!=p?p:"")+o[a+1]),this._$AH[a]=p}s&&!r&&this.k(t)}k(t){t===it?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class dt extends lt{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===it?void 0:t}}const ht=B?B.emptyScript:"";class ft extends lt{constructor(){super(...arguments),this.type=4}k(t){t&&t!==it?this.element.setAttribute(this.name,ht):this.element.removeAttribute(this.name)}}class ut extends lt{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=pt(this,t,e,0))&&void 0!==i?i:it)===et)return;const r=this._$AH,o=t===it&&r!==it||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==it&&(r===it||o);o&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class mt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){pt(this,t)}}const yt=window.litHtmlPolyfillSupport;null==yt||yt(at,ct),(null!==(N=globalThis.litHtmlVersions)&&void 0!==N?N:globalThis.litHtmlVersions=[]).push("2.1.3");
|
|
175
|
+
/**
|
|
176
|
+
* @license
|
|
177
|
+
* Copyright 2020 Google LLC
|
|
178
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
179
|
+
*/
|
|
180
|
+
const gt=t=>({_$litStatic$:t}),vt=new Map,bt=(t=>(e,...i)=>{var r;const o=i.length;let s,a;const p=[],n=[];let c,l=0,d=!1;for(;l<o;){for(c=e[l];l<o&&void 0!==(a=i[l],s=null===(r=a)||void 0===r?void 0:r._$litStatic$);)c+=s+e[++l],d=!0;n.push(a),p.push(c),l++}if(l===o&&p.push(e[o]),d){const t=p.join("$$lit$$");void 0===(e=vt.get(t))&&(p.raw=p,vt.set(t,e=p)),i=n}return t(e,...i)})(tt);var wt,$t=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};!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"}(wt||(wt={}));const xt=r.FtCssVariable.extend("--ft-typography-font-family",r.designSystemVariables.titleFont),kt=r.FtCssVariable.extend("--ft-typography-font-family",r.designSystemVariables.contentFont),At={fontFamily:kt,fontSize:r.FtCssVariable.create("--ft-typography-font-size","SIZE","16px"),fontWeight:r.FtCssVariable.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:r.FtCssVariable.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:r.FtCssVariable.create("--ft-typography-line-height","SIZE","24px"),textTransform:r.FtCssVariable.create("--ft-typography-text-transform","UNKNOWN","inherit")},zt=r.FtCssVariable.extend("--ft-typography-title-font-family",xt),St=r.FtCssVariable.extend("--ft-typography-title-font-size",At.fontSize,"20px"),Ot=r.FtCssVariable.extend("--ft-typography-title-font-weight",At.fontWeight,"normal"),Tt=r.FtCssVariable.extend("--ft-typography-title-letter-spacing",At.letterSpacing,"0.15px"),Ct=r.FtCssVariable.extend("--ft-typography-title-line-height",At.lineHeight,"24px"),_t=r.FtCssVariable.extend("--ft-typography-title-text-transform",At.textTransform,"inherit"),Et=r.FtCssVariable.extend("--ft-typography-title-dense-font-family",xt),It=r.FtCssVariable.extend("--ft-typography-title-dense-font-size",At.fontSize,"14px"),Ft=r.FtCssVariable.extend("--ft-typography-title-dense-font-weight",At.fontWeight,"normal"),Rt=r.FtCssVariable.extend("--ft-typography-title-dense-letter-spacing",At.letterSpacing,"0.105px"),jt=r.FtCssVariable.extend("--ft-typography-title-dense-line-height",At.lineHeight,"24px"),Dt=r.FtCssVariable.extend("--ft-typography-title-dense-text-transform",At.textTransform,"inherit"),Nt=r.FtCssVariable.extend("--ft-typography-subtitle1-font-family",kt),Bt=r.FtCssVariable.extend("--ft-typography-subtitle1-font-size",At.fontSize,"16px"),Mt=r.FtCssVariable.extend("--ft-typography-subtitle1-font-weight",At.fontWeight,"600"),Ut=r.FtCssVariable.extend("--ft-typography-subtitle1-letter-spacing",At.letterSpacing,"0.144px"),Ht=r.FtCssVariable.extend("--ft-typography-subtitle1-line-height",At.lineHeight,"24px"),Vt=r.FtCssVariable.extend("--ft-typography-subtitle1-text-transform",At.textTransform,"inherit"),Lt=r.FtCssVariable.extend("--ft-typography-subtitle2-font-family",kt),Pt=r.FtCssVariable.extend("--ft-typography-subtitle2-font-size",At.fontSize,"14px"),Gt=r.FtCssVariable.extend("--ft-typography-subtitle2-font-weight",At.fontWeight,"normal"),Zt=r.FtCssVariable.extend("--ft-typography-subtitle2-letter-spacing",At.letterSpacing,"0.098px"),Wt=r.FtCssVariable.extend("--ft-typography-subtitle2-line-height",At.lineHeight,"24px"),qt=r.FtCssVariable.extend("--ft-typography-subtitle2-text-transform",At.textTransform,"inherit"),Kt=r.FtCssVariable.extend("--ft-typography-body1-font-family",kt),Xt=r.FtCssVariable.extend("--ft-typography-body1-font-size",At.fontSize,"16px"),Yt=r.FtCssVariable.extend("--ft-typography-body1-font-weight",At.fontWeight,"normal"),Jt=r.FtCssVariable.extend("--ft-typography-body1-letter-spacing",At.letterSpacing,"0.496px"),Qt=r.FtCssVariable.extend("--ft-typography-body1-line-height",At.lineHeight,"24px"),te=r.FtCssVariable.extend("--ft-typography-body1-text-transform",At.textTransform,"inherit"),ee=r.FtCssVariable.extend("--ft-typography-body2-font-family",kt),ie=r.FtCssVariable.extend("--ft-typography-body2-font-size",At.fontSize,"14px"),re=r.FtCssVariable.extend("--ft-typography-body2-font-weight",At.fontWeight,"normal"),oe=r.FtCssVariable.extend("--ft-typography-body2-letter-spacing",At.letterSpacing,"0.252px"),se=r.FtCssVariable.extend("--ft-typography-body2-line-height",At.lineHeight,"20px"),ae=r.FtCssVariable.extend("--ft-typography-body2-text-transform",At.textTransform,"inherit"),pe=r.FtCssVariable.extend("--ft-typography-caption-font-family",kt),ne=r.FtCssVariable.extend("--ft-typography-caption-font-size",At.fontSize,"12px"),ce=r.FtCssVariable.extend("--ft-typography-caption-font-weight",At.fontWeight,"normal"),le=r.FtCssVariable.extend("--ft-typography-caption-letter-spacing",At.letterSpacing,"0.396px"),de=r.FtCssVariable.extend("--ft-typography-caption-line-height",At.lineHeight,"16px"),he=r.FtCssVariable.extend("--ft-typography-caption-text-transform",At.textTransform,"inherit"),fe=r.FtCssVariable.extend("--ft-typography-breadcrumb-font-family",kt),ue=r.FtCssVariable.extend("--ft-typography-breadcrumb-font-size",At.fontSize,"10px"),me=r.FtCssVariable.extend("--ft-typography-breadcrumb-font-weight",At.fontWeight,"normal"),ye=r.FtCssVariable.extend("--ft-typography-breadcrumb-letter-spacing",At.letterSpacing,"0.33px"),ge=r.FtCssVariable.extend("--ft-typography-breadcrumb-line-height",At.lineHeight,"16px"),ve=r.FtCssVariable.extend("--ft-typography-breadcrumb-text-transform",At.textTransform,"inherit"),be=r.FtCssVariable.extend("--ft-typography-overline-font-family",kt),we=r.FtCssVariable.extend("--ft-typography-overline-font-size",At.fontSize,"10px"),$e=r.FtCssVariable.extend("--ft-typography-overline-font-weight",At.fontWeight,"normal"),xe=r.FtCssVariable.extend("--ft-typography-overline-letter-spacing",At.letterSpacing,"1.5px"),ke=r.FtCssVariable.extend("--ft-typography-overline-line-height",At.lineHeight,"16px"),Ae=r.FtCssVariable.extend("--ft-typography-overline-text-transform",At.textTransform,"uppercase"),ze={fontFamily:r.FtCssVariable.extend("--ft-typography-button-font-family",kt),fontSize:r.FtCssVariable.extend("--ft-typography-button-font-size",At.fontSize,"14px"),fontWeight:r.FtCssVariable.extend("--ft-typography-button-font-weight",At.fontWeight,"600"),letterSpacing:r.FtCssVariable.extend("--ft-typography-button-letter-spacing",At.letterSpacing,"1.246px"),lineHeight:r.FtCssVariable.extend("--ft-typography-button-line-height",At.lineHeight,"16px"),textTransform:r.FtCssVariable.extend("--ft-typography-button-text-transform",At.textTransform,"uppercase")},Se=e.css`
|
|
181
|
+
.ft-typography--title {
|
|
182
|
+
font-family: ${zt};
|
|
183
|
+
font-size: ${St};
|
|
184
|
+
font-weight: ${Ot};
|
|
185
|
+
letter-spacing: ${Tt};
|
|
186
|
+
line-height: ${Ct};
|
|
187
|
+
text-transform: ${_t};
|
|
188
|
+
}
|
|
189
|
+
`,Oe=e.css`
|
|
190
|
+
.ft-typography--title-dense {
|
|
191
|
+
font-family: ${Et};
|
|
192
|
+
font-size: ${It};
|
|
193
|
+
font-weight: ${Ft};
|
|
194
|
+
letter-spacing: ${Rt};
|
|
195
|
+
line-height: ${jt};
|
|
196
|
+
text-transform: ${Dt};
|
|
197
|
+
}
|
|
198
|
+
`,Te=e.css`
|
|
199
|
+
.ft-typography--subtitle1 {
|
|
200
|
+
font-family: ${Nt};
|
|
201
|
+
font-size: ${Bt};
|
|
202
|
+
font-weight: ${Mt};
|
|
203
|
+
letter-spacing: ${Ut};
|
|
204
|
+
line-height: ${Ht};
|
|
205
|
+
text-transform: ${Vt};
|
|
206
|
+
}
|
|
207
|
+
`,Ce=e.css`
|
|
208
|
+
.ft-typography--subtitle2 {
|
|
209
|
+
font-family: ${Lt};
|
|
210
|
+
font-size: ${Pt};
|
|
211
|
+
font-weight: ${Gt};
|
|
212
|
+
letter-spacing: ${Zt};
|
|
213
|
+
line-height: ${Wt};
|
|
214
|
+
text-transform: ${qt};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
`,_e=e.css`
|
|
218
|
+
.ft-typography--body1 {
|
|
219
|
+
font-family: ${Kt};
|
|
220
|
+
font-size: ${Xt};
|
|
221
|
+
font-weight: ${Yt};
|
|
222
|
+
letter-spacing: ${Jt};
|
|
223
|
+
line-height: ${Qt};
|
|
224
|
+
text-transform: ${te};
|
|
225
|
+
}
|
|
226
|
+
`,Ee=e.css`
|
|
227
|
+
.ft-typography--body2 {
|
|
228
|
+
font-family: ${ee};
|
|
229
|
+
font-size: ${ie};
|
|
230
|
+
font-weight: ${re};
|
|
231
|
+
letter-spacing: ${oe};
|
|
232
|
+
line-height: ${se};
|
|
233
|
+
text-transform: ${ae};
|
|
234
|
+
}
|
|
235
|
+
`,Ie=e.css`
|
|
236
|
+
.ft-typography--caption {
|
|
237
|
+
font-family: ${pe};
|
|
238
|
+
font-size: ${ne};
|
|
239
|
+
font-weight: ${ce};
|
|
240
|
+
letter-spacing: ${le};
|
|
241
|
+
line-height: ${de};
|
|
242
|
+
text-transform: ${he};
|
|
243
|
+
}
|
|
244
|
+
`,Fe=e.css`
|
|
245
|
+
.ft-typography--breadcrumb {
|
|
246
|
+
font-family: ${fe};
|
|
247
|
+
font-size: ${ue};
|
|
248
|
+
font-weight: ${me};
|
|
249
|
+
letter-spacing: ${ye};
|
|
250
|
+
line-height: ${ge};
|
|
251
|
+
text-transform: ${ve};
|
|
252
|
+
}
|
|
253
|
+
`,Re=e.css`
|
|
254
|
+
.ft-typography--overline {
|
|
255
|
+
font-family: ${be};
|
|
256
|
+
font-size: ${we};
|
|
257
|
+
font-weight: ${$e};
|
|
258
|
+
letter-spacing: ${xe};
|
|
259
|
+
line-height: ${ke};
|
|
260
|
+
text-transform: ${Ae};
|
|
261
|
+
}
|
|
262
|
+
`,je=e.css`
|
|
263
|
+
.ft-typography--button {
|
|
264
|
+
font-family: ${ze.fontFamily};
|
|
265
|
+
font-size: ${ze.fontSize};
|
|
266
|
+
font-weight: ${ze.fontWeight};
|
|
267
|
+
letter-spacing: ${ze.letterSpacing};
|
|
268
|
+
line-height: ${ze.lineHeight};
|
|
269
|
+
text-transform: ${ze.textTransform};
|
|
270
|
+
}
|
|
271
|
+
`;let De=class extends r.FtLitElement{constructor(){super(...arguments),this.variant=wt.body1}getStyles(){return[Se,Oe,Te,Ce,_e,Ee,Ie,Fe,Re,je]}getTemplate(){return this.element?bt`
|
|
272
|
+
<${gt(this.element)}
|
|
273
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
274
|
+
<slot></slot>
|
|
275
|
+
</${gt(this.element)}>
|
|
276
|
+
`:bt`
|
|
277
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
278
|
+
`}};$t([i.property()],De.prototype,"element",void 0),$t([i.property()],De.prototype,"variant",void 0),De=$t([r.customElement("ft-typography")],De);
|
|
279
|
+
/**
|
|
280
|
+
* @license
|
|
281
|
+
* Copyright 2021 Google LLC
|
|
282
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
|
283
|
+
*/
|
|
284
|
+
const Ne=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"}`
|
|
285
|
+
/**
|
|
286
|
+
* @license
|
|
287
|
+
* Copyright 2018 Google LLC
|
|
288
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
289
|
+
*/;let Be=class extends e.LitElement{render(){return e.html`<span><slot></slot></span>`}};Be.styles=[Ne],Be=y([i.customElement("mwc-icon")],Be);var Me=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 Ue=r.FtCssVariable.create("--ft-tooltip-distance","SIZE","4px"),He=r.FtCssVariable.create("--ft-tooltip-color","COLOR","#FFFFFF"),Ve=r.FtCssVariable.create("--ft-tooltip-background-color","COLOR","#666666"),Le=r.FtCssVariable.create("--ft-tooltip-z-index","NUMBER","1"),Pe=r.FtCssVariable.external(r.designSystemVariables.borderRadiusS,"Design system");let Ge=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`
|
|
290
|
+
.ft-tooltip--container {
|
|
291
|
+
display: block;
|
|
292
|
+
position: relative;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.ft-tooltip--inline {
|
|
296
|
+
display: inline-block;
|
|
297
|
+
max-width: 100%;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.ft-tooltip {
|
|
301
|
+
position: absolute;
|
|
302
|
+
box-sizing: border-box;
|
|
303
|
+
overflow: hidden;
|
|
304
|
+
width: max-content;
|
|
305
|
+
max-width: 150px;
|
|
306
|
+
text-align: center;
|
|
307
|
+
padding: ${Ue};
|
|
308
|
+
z-index: ${Le};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.ft-tooltip--content {
|
|
312
|
+
padding: 4px 8px;
|
|
313
|
+
border-radius: ${Pe};
|
|
314
|
+
background-color: ${Ve};
|
|
315
|
+
color: ${He};
|
|
316
|
+
top: -500px;
|
|
317
|
+
left: -500px;
|
|
318
|
+
position: relative;
|
|
319
|
+
word-break: break-word;
|
|
320
|
+
}
|
|
321
|
+
`}getTemplate(){return e.html`
|
|
322
|
+
<div part="container"
|
|
323
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
324
|
+
@mouseenter=${this.onHover}
|
|
325
|
+
@mouseleave=${this.onOut}
|
|
326
|
+
@focusin=${this.onHover}
|
|
327
|
+
@focusout=${this.onOut}
|
|
328
|
+
@touchstart=${this.onTouch}>
|
|
329
|
+
<div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
|
|
330
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
331
|
+
<ft-typography variant="caption">${this.text}</ft-typography>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<slot></slot>
|
|
335
|
+
</div>
|
|
336
|
+
`}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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,r=(e.width-this.tooltip.clientWidth)/2,o=this.tooltip.style;switch(this.position){case"top":o.top=-this.tooltip.clientHeight+"px",o.left=r+"px";break;case"bottom":o.top=e.height+"px",o.left=r+"px";break;case"left":o.top=i+"px",o.left=-this.tooltip.clientWidth+"px";break;case"right":o.top=i+"px",o.left=e.width+"px"}o.maxWidth=Math.max(e.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())}};Ge.elementDefinitions={"ft-typography":De},Me([i.property()],Ge.prototype,"text",void 0),Me([i.property({type:Boolean})],Ge.prototype,"manual",void 0),Me([i.property({type:Boolean})],Ge.prototype,"inline",void 0),Me([i.property({type:Number})],Ge.prototype,"delay",void 0),Me([i.property()],Ge.prototype,"position",void 0),Me([i.queryAssignedNodes("",!0)],Ge.prototype,"slotNodes",void 0),Me([i.query(".ft-tooltip--container")],Ge.prototype,"container",void 0),Me([i.query("slot")],Ge.prototype,"target",void 0),Me([i.query(".ft-tooltip")],Ge.prototype,"tooltip",void 0),Me([i.query(".ft-tooltip--content")],Ge.prototype,"tooltipContent",void 0),Me([i.state()],Ge.prototype,"visible",void 0),Ge=Me([r.customElement("ft-tooltip")],Ge);var Ze=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 We={borderRadiusLeft:r.FtCssVariable.extend("--ft-switch-option-border-radius-left",r.designSystemVariables.borderRadiusL),borderRadiusRight:r.FtCssVariable.extend("--ft-switch-option-border-radius-right",r.designSystemVariables.borderRadiusL),borderWidthLeft:r.FtCssVariable.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:r.FtCssVariable.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:r.FtCssVariable.create("--ft-switch-option-border-width-vertical","SIZE","1px")};class qe extends CustomEvent{constructor(){super("selected")}}t.FtSwitchOption=class extends r.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.name=""}getStyles(){return e.css`
|
|
337
|
+
.ft-switch-option {
|
|
338
|
+
position: relative;
|
|
339
|
+
display: inline-block;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.ft-switch-option--input {
|
|
343
|
+
position: absolute;
|
|
344
|
+
opacity: 0;
|
|
345
|
+
width: 0;
|
|
346
|
+
height: 0;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.ft-switch-option--content {
|
|
350
|
+
--ft-switch-option-internal-line-height: calc(${Xe.fontSize} + 2px);
|
|
351
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${Xe.iconSize});
|
|
352
|
+
|
|
353
|
+
border-style: solid;
|
|
354
|
+
border-color: ${Xe.borderColor};
|
|
355
|
+
border-width: ${We.borderWidthVertical} ${We.borderWidthRight} ${We.borderWidthVertical} ${We.borderWidthLeft};
|
|
356
|
+
border-radius: ${We.borderRadiusLeft} ${We.borderRadiusRight} ${We.borderRadiusRight} ${We.borderRadiusLeft};
|
|
357
|
+
display: flex;
|
|
358
|
+
align-items: center;
|
|
359
|
+
justify-content: center;
|
|
360
|
+
overflow: hidden;
|
|
361
|
+
|
|
362
|
+
--mdc-icon-size: ${Xe.iconSize};
|
|
363
|
+
padding: 6px 8px;
|
|
364
|
+
background-color: ${Xe.backgroundColor};
|
|
365
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
369
|
+
background-color: ${Xe.selectedBackgroundColor};
|
|
370
|
+
border-radius: ${We.borderRadiusLeft} ${We.borderRadiusRight} ${We.borderRadiusRight} ${We.borderRadiusLeft};
|
|
371
|
+
position: absolute;
|
|
372
|
+
inset: 0;
|
|
373
|
+
content: "";
|
|
374
|
+
z-index: 1;
|
|
375
|
+
opacity: ${r.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.ft-switch-option--input:focus + .ft-switch-option--content:before {
|
|
379
|
+
background-color: ${Xe.selectedBackgroundColor};
|
|
380
|
+
border-radius: ${We.borderRadiusLeft} ${We.borderRadiusRight} ${We.borderRadiusRight} ${We.borderRadiusLeft};
|
|
381
|
+
position: absolute;
|
|
382
|
+
inset: 0;
|
|
383
|
+
content: "";
|
|
384
|
+
z-index: 1;
|
|
385
|
+
opacity: ${r.designSystemVariables.opacityPrimaryOnSurfaceFocused};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.ft-switch-option--label {
|
|
389
|
+
color: ${Xe.textColor};
|
|
390
|
+
overflow: hidden;
|
|
391
|
+
white-space: nowrap;
|
|
392
|
+
text-overflow: ellipsis;
|
|
393
|
+
display: block;
|
|
394
|
+
margin: 0 8px;
|
|
395
|
+
${r.setVariable(ze.fontSize,Xe.fontSize)};
|
|
396
|
+
${r.setVariable(ze.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
400
|
+
color: ${Xe.selectedTextColor};
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.ft-switch-option--label[hidden] {
|
|
404
|
+
display: none;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.ft-switch-option--ripple {
|
|
408
|
+
${r.setVariable(j.color,Xe.rippleColor)};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
mwc-icon, ft-ripple, ft-typography {
|
|
412
|
+
z-index: 2;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.ft-switch-option:not(.ft-switch-option--trailing-icon) mwc-icon {
|
|
416
|
+
order: -1;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
mwc-icon {
|
|
420
|
+
flex-shrink: 0;
|
|
421
|
+
width: var(--mdc-icon-size);
|
|
422
|
+
color: ${Xe.iconColor};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.ft-switch-option--input:checked + .ft-switch-option--content mwc-icon {
|
|
426
|
+
color: ${Xe.selectedTextColor};
|
|
427
|
+
}
|
|
428
|
+
`}focus(){this.input.focus()}getTemplate(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(e.html`
|
|
429
|
+
<label for="input" class=${o.classMap(t)}>
|
|
430
|
+
<input id="input" type="radio" class="ft-switch-option--input"
|
|
431
|
+
.checked=${this.selected}
|
|
432
|
+
.value=${this.value}
|
|
433
|
+
.name=${this.name}
|
|
434
|
+
@change=${this.onChange}>
|
|
435
|
+
<div class="ft-switch-option--content">
|
|
436
|
+
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
437
|
+
<ft-typography variant="button" ?hidden=${!this.hasTextContent()}
|
|
438
|
+
class="ft-switch-option--label">
|
|
439
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
440
|
+
</ft-typography>
|
|
441
|
+
${this.resolveIcon()}
|
|
442
|
+
</div>
|
|
443
|
+
</label>
|
|
444
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:e.html`
|
|
445
|
+
<ft-tooltip part="tooltip"
|
|
446
|
+
text="${this.getLabel()}"
|
|
447
|
+
position="${this.tooltipPosition}">
|
|
448
|
+
${t}
|
|
449
|
+
</ft-tooltip>
|
|
450
|
+
`}onChange(){this.selected=!0,this.dispatchEvent(new qe)}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
451
|
+
<mwc-icon>${this.icon}</mwc-icon> `:e.nothing}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}},t.FtSwitchOption.elementDefinitions={"ft-ripple":D,"ft-typography":De,"ft-tooltip":Ge,"mwc-icon":Be},t.FtSwitchOption.shadowRootOptions={...e.LitElement.shadowRootOptions,delegatesFocus:!0},Ze([i.property({type:String})],t.FtSwitchOption.prototype,"value",void 0),Ze([i.property({type:String})],t.FtSwitchOption.prototype,"icon",void 0),Ze([i.property({type:String})],t.FtSwitchOption.prototype,"label",void 0),Ze([i.property({type:String})],t.FtSwitchOption.prototype,"tooltipPosition",void 0),Ze([i.property({type:Boolean,reflect:!0})],t.FtSwitchOption.prototype,"selected",void 0),Ze([i.property({type:Boolean})],t.FtSwitchOption.prototype,"trailingIcon",void 0),Ze([i.property({attribute:!1})],t.FtSwitchOption.prototype,"name",void 0),Ze([i.query(".ft-switch-option--content slot")],t.FtSwitchOption.prototype,"slottedContent",void 0),Ze([i.query(".ft-switch-option--input")],t.FtSwitchOption.prototype,"input",void 0),t.FtSwitchOption=Ze([r.customElement("ft-switch-option")],t.FtSwitchOption);var Ke=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 Xe={textColor:r.FtCssVariable.extend("--ft-switch-text-color",r.designSystemVariables.colorOnSurfaceHigh),backgroundColor:r.FtCssVariable.extend("--ft-switch-background-color",r.designSystemVariables.colorSurface),selectedTextColor:r.FtCssVariable.extend("--ft-switch-selected-text-color",r.designSystemVariables.colorPrimary),selectedBackgroundColor:r.FtCssVariable.extend("--ft-switch-selected-background-color",r.designSystemVariables.colorPrimary),borderColor:r.FtCssVariable.extend("--ft-switch-border-color",r.designSystemVariables.colorOutline),borderRadius:r.FtCssVariable.extend("--ft-switch-border-radius",r.designSystemVariables.borderRadiusL),fontSize:r.FtCssVariable.extend("--ft-switch-font-size",ze.fontSize),iconSize:r.FtCssVariable.create("--ft-switch-icon-size","SIZE","24px"),iconColor:r.FtCssVariable.extend("--ft-switch-text-color",r.designSystemVariables.colorOnSurfaceMedium),rippleColor:r.FtCssVariable.extend("--ft-switch-ripple-color",r.designSystemVariables.colorPrimary)};class Ye extends CustomEvent{constructor(t){super("change",{detail:t})}}t.FtSwitch=class extends r.FtLitElement{constructor(){super(),this.options=[],this.groupName=f(),this.addEventListener("keydown",(t=>this.onKeyDown(t)))}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}getStyles(){return e.css`
|
|
452
|
+
:host {
|
|
453
|
+
display: inline-block;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.ft-switch slot {
|
|
457
|
+
display: flex;
|
|
458
|
+
align-items: center;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.ft-switch slot::slotted(ft-switch-option) {
|
|
462
|
+
${r.setVariable(We.borderRadiusLeft,"0")};
|
|
463
|
+
${r.setVariable(We.borderRadiusRight,"0")};
|
|
464
|
+
${r.setVariable(We.borderWidthLeft,"0")};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
468
|
+
${r.setVariable(We.borderRadiusLeft,Xe.borderRadius)};
|
|
469
|
+
${r.setVariable(We.borderWidthLeft,"1px")};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
473
|
+
${r.setVariable(We.borderRadiusRight,Xe.borderRadius)};
|
|
474
|
+
}
|
|
475
|
+
`}getTemplate(){return e.html`
|
|
476
|
+
<div class="ft-switch">
|
|
477
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
478
|
+
</div>
|
|
479
|
+
`}onKeyDown(t){let e=this.options.find((t=>t.ownerDocument.activeElement==t));if(e){if("ArrowDown"==t.key||"ArrowRight"==t.key){let i=this.options.indexOf(e);i<this.options.length-1&&i++,t.preventDefault(),this.selectOption(this.options[i])}if("ArrowUp"==t.key||"ArrowLeft"==t.key){let i=this.options.indexOf(e);i>0&&i--,t.preventDefault(),this.selectOption(this.options[i])}}}onFocus(t){this.selectedOption&&this.selectedOption!=t&&this.selectedOption.focus()}onSlotchange(){var e;return this.options=[],null===(e=this.slottedContent)||void 0===e?void 0:e.assignedElements().forEach((e=>{e instanceof t.FtSwitchOption&&this.registerOption(e),this.updateOptions()}))}registerOption(t){t.name=this.groupName,t.addEventListener("selected",(()=>this.selectOption(t))),t.addEventListener("focus",(()=>this.onFocus(t))),t.selected&&(this.selectedOption=t),this.options.push(t)}selectOption(t){this.selectedOption=t,t.focus(),this.dispatchEvent(new Ye(this.selectedOption.value)),this.updateOptions()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}},t.FtSwitch.elementDefinitions={},Ke([i.query(".ft-switch slot")],t.FtSwitch.prototype,"slottedContent",void 0),t.FtSwitch=Ke([r.customElement("ft-switch")],t.FtSwitch),t.FtSwitchChange=Ye,t.FtSwitchCssVariables=Xe,t.FtSwitchOptionCssVariables=We,t.SwitchOptionSelected=qe,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.wcUtils,ftGlobals.litClassMap,ftGlobals.litStyleMap);
|