esp-web-tools
Version:
Web tools for ESP devices
44 lines (38 loc) • 1.05 kB
text/typescript
import { LitElement, html, css, TemplateResult } from "lit";
import { property } from "lit/decorators.js";
import "../components/ew-circular-progress";
class EwtPageProgress extends LitElement {
() label!: string | TemplateResult;
() progress: number | undefined;
render() {
return html`
<div>
<ew-circular-progress
active
?indeterminate=${this.progress === undefined}
.value=${this.progress !== undefined
? this.progress / 100
: undefined}
></ew-circular-progress>
${this.progress !== undefined ? html`<div>${this.progress}%</div>` : ""}
</div>
${this.label}
`;
}
static styles = css`
:host {
display: flex;
flex-direction: column;
text-align: center;
}
ew-circular-progress {
margin-bottom: 16px;
}
`;
}
customElements.define("ewt-page-progress", EwtPageProgress);
declare global {
interface HTMLElementTagNameMap {
"ewt-page-progress": EwtPageProgress;
}
}