UNPKG

@rocketspark/domain-checker

Version:
13 lines 1.96 kB
/*! * * @rocketspark/domain-checker v0.0.34 * 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,t,e){e.r(t),e.d(t,{rs_switch:function(){return l}});var s=e(7915);const l=class{constructor(o){(0,s.r)(this,o),this.toggled=(0,s.c)(this,"toggled",7),this.toggle=()=>{this.disabled||(this.on=!this.on,this.toggled.emit({on:this.on}))},this.theme="light",this.on=!1,this.disabled=!1}getToggledClass(){return this.disabled?"toggle--disabled":this.on?"toggle--on":"toggle--off"}render(){return(0,s.h)(s.H,null,(0,s.h)("span",{class:`toggle ${this.getToggledClass()} toggle--${this.theme}`,onClick:this.toggle},(0,s.h)("span",{class:"toggle__switch"}," ")))}};l.style=":host{display:block}.toggle{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}.toggle--off{background-color:var(--rs-color-grey-light)}.toggle--on{background-color:var(--rs-color-positive)}.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 rgba(0, 0, 0, 0.25)}.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)}"}}]); //# sourceMappingURL=810.index.js.map