@rocketspark/domain-checker
Version:
Embeddable Domain Checker for Rocketspark
13 lines • 2.65 kB
JavaScript
/*!
*
* @rocketspark/domain-checker v1.0.12
* git+https://github.com/rocketspark/domain-checker.git
*
* Copyright (c) Lee Reichardt and project contributors.
*
* This source code is licensed under the no license license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";(self.webpackChunkDomainChecker=self.webpackChunkDomainChecker||[]).push([[810],{3810:function(o,e,t){t.r(e),t.d(e,{rs_switch:function(){return g}});var l=t(6919);const g=class{constructor(o){(0,l.r)(this,o),this.toggled=(0,l.c)(this,"toggled",7),this.theme="light",this.on=!1,this.disabled=!1,this.size="default",this.toggle=()=>{this.disabled||(this.on=!this.on,this.toggleColor=this.color?`var(--rs-color-${this.color})`:this.on?"var(--rs-color-positive)":null,this.toggled.emit({on:this.on}))}}componentWillRender(){this.toggleColor=this.color?`var(--rs-color-${this.color})`:this.on?"var(--rs-color-positive)":null}render(){return(0,l.h)(l.H,{key:"dbcce89cdb7326f2411450aa52041aa154bfb40a"},(0,l.h)("span",{key:"18e5a09e64427b29300c2ebf5482e097aebad6bc",class:`toggle ${this.getToggleSize()} ${this.getToggledClass()} ${this.getToggleTheme()}`,style:{"--toggle-color":this.toggleColor},onClick:this.toggle},(0,l.h)("span",{key:"4f9a99a4f8e12bea1ccf1a6402369acca6019e3c",class:"toggle__switch"}," ")))}getToggleTheme(){return`toggle--${this.theme}`}getToggleSize(){return"small"===this.size?`toggle--${this.size}`:""}getToggledClass(){return this.disabled?"toggle--disabled":this.on?"toggle--on":"toggle--off"}};g.style=":host{display:block}.toggle{--toggle-color:var(--rs-color-grey-light);position:relative;display:inline-flex;align-items:center;width:36px;height:22px;border-radius:50px;cursor:pointer;transition:background-color 0.15s ease-out, opacity 0.15s ease-out;user-select:none;box-sizing:border-box;padding:2px;background-color:var(--toggle-color)}.toggle--small{width:23px;height:14px}.toggle--disabled{background-color:var(--rs-color-grey-light);opacity:0.5;cursor:not-allowed}.toggle__switch{position:relative;display:block;width:18px;height:18px;border-radius:20px;background-clip:padding-box;transition:all 0.15s ease-out;transition-property:left;user-select:none;box-shadow:0 1px 3px rgb(0 0 0 / 0.25)}.toggle--small .toggle__switch{width:11px;height:11px}.toggle--light .toggle__switch{background-color:#fff}.toggle--dark .toggle__switch{background-color:#111618}.toggle--off .toggle__switch,.toggle--disabled .toggle__switch{left:0}.toggle--on .toggle__switch{left:calc(100% - 18px)}.toggle--small.toggle--on .toggle__switch{left:calc(100% - 11px)}"}}]);
//# sourceMappingURL=810.index.js.map