UNPKG

finpro

Version:
8 lines (7 loc) 1.91 kB
import{a as p}from"./chunk-JA3VZI2D.js";import{a as i,b as l,g as o,h as a,i as s,j as u}from"./chunk-GBPY57YZ.js";import{a as r}from"./chunk-NZ3RGSR6.js";var v=i`.progress-indicator{--max:100;--value:0;--value-color:var(--fp-color-success);--height:var(--fp-size-2xs);--radius:var(--fp-size-3xs);position:relative;background-color:var(--fp-color-secondary-background);height:var(--height);border-radius:var(--radius);width:100%}.progress-indicator::before{content:'';position:absolute;height:100%;width:calc(100% / var(--max) * var(--value));background-color:var(--value-color);border-radius:var(--radius)}:host([size='small']) .progress-indicator{--height:var(--fp-size-3xs);--radius:var(--fp-size-4xs)}:host([size='large']) .progress-indicator{--height:var(--fp-size-xs);--radius:6px}:host([failed]) .progress-indicator{--value-color:var(--fp-color-danger)}`,m=v;var e=class extends p{constructor(){super(...arguments);this.size="medium";this.failed=!1;this._max=100;this._value=0}static get styles(){return m}get max(){return this._max}set max(t){this._max=t,this.updateCssVariable()}get value(){return this._value}set value(t){this._value=t,this.updateCssVariable()}async updateCssVariable(){await this.updateComplete,this.wrapper.style.setProperty("--value",`${this.value}`),this.wrapper.style.setProperty("--max",`${this.max}`)}render(){return l`<div class="progress-indicator" role="progressbar" aria-valuemax="${this._max}" aria-valuenow="${this._value}" ></div>`}};r([u(".progress-indicator")],e.prototype,"wrapper",2),r([a({type:String,reflect:!0})],e.prototype,"size",2),r([a({type:Boolean,reflect:!0})],e.prototype,"failed",2),r([a({type:Number})],e.prototype,"max",1),r([a({type:Number})],e.prototype,"value",1),r([s()],e.prototype,"_max",2),r([s()],e.prototype,"_value",2),e=r([o("fp-progress-indicator")],e);export{e as a}; //# sourceMappingURL=chunk-XXNKQTSJ.js.map