UNPKG

@rocketspark/domain-checker

Version:
13 lines 2.59 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([[66],{66:function(s,e,t){t.r(e),t.d(e,{rs_progress_circle:function(){return i}});var r=t(7915);const i=class{constructor(s){(0,r.r)(this,s),this.dimensions={small:28,default:43,large:111},this.strokeWidth={small:2,default:4,large:4},this.activeStrokeWidth={small:4,default:6,large:8},this.progress=0,this.size="default"}getProgressValue(){return this.progress>100?100:this.progress<0?0:this.progress}progressValueClass(){return{"progress-value--0":this.progress<=30,"progress-value--30":this.progress>30&&this.progress<80,"progress-value--80":this.progress>=80,"progress-circle":!0}}getSize(){return this.dimensions[this.size]}getActiveStrokeWidth(){return this.activeStrokeWidth[this.size]}getStrokeWidth(){return this.strokeWidth[this.size]}getRadius(){return this.getSize()/2-this.getActiveStrokeWidth()/2}getStrokeDashArray(){return Math.PI*(2*this.getRadius())}getStrokeDashOffset(){return(100-this.getProgressValue())/100*this.getStrokeDashArray()}render(){return(0,r.h)(r.H,{class:`size--${this.size}`,style:{width:`${this.getSize()}px`,height:`${this.getSize()}px`}},(0,r.h)("svg",{width:this.getSize(),height:this.getSize(),viewBox:`0 0 ${this.getSize()} ${this.getSize()}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{class:"progress-bar",opacity:"0.5",cx:"50%",cy:"50%",r:this.getRadius(),style:{"stroke-width":`${this.getStrokeWidth()}`}}),(0,r.h)("circle",{class:Object.assign({},this.progressValueClass()),cx:"50%",cy:"50%",r:this.getRadius(),style:{opacity:""+(this.getProgressValue()<1?"0":"1"),"stroke-dasharray":`${this.getStrokeDashArray()}`,"stroke-width":`${this.getActiveStrokeWidth()}px`,"stroke-dashoffset":`${this.getStrokeDashOffset()}`,"stroke-linecap":"round","transform-origin":`${this.getSize()/2}px ${this.getSize()/2}px`,transform:"rotate(-90deg)"}})))}};i.style=":host{display:block}.progress-bar{stroke:var(--rs-color-grey-light)}.progress-value--0{stroke:var(--rs-color-negative)}.progress-value--30{stroke:var(--rs-color-neutral)}.progress-value--80{stroke:var(--rs-color-positive)}.progress-circle{transition:stroke-dasharray 0.15s ease-out, stroke 0.15s ease-out, opacity 0.15s ease-out}"}}]); //# sourceMappingURL=66.index.js.map