import {HTMLTemplateResult, LitElement, html, unsafeCSS} from 'lit'; import {customElement, property} from 'lit/decorators.js'; import compentStyle from './automation-tank.css?inline'; import {LineMedium} from '..'; import '../../icons/icon-chevron-double-up-google'; import '../../icons/icon-chevron-up-google'; import '../../icons/icon-chevron-double-down-google'; import '../../icons/icon-chevron-down-google'; import '../../icons/icon-off'; import {classMap} from 'lit/directives/class-map.js'; export enum TankTrend { fastRising = 'fast-rising', rising = 'rising', stable = 'stable', falling = 'falling', fastFalling = 'fast-falling', } export enum TankVariant { vertical = 'vertical', compact = 'compact', } /** * * * @ignition-base-height: 173px * @ignition-base-width: 168px * @ignition-center */ @customElement('obc-automation-tank') export class ObcAutomationTank extends LitElement { @property({type: String}) medium: LineMedium = LineMedium.water; @property({type: Number}) value: number = 0; @property({type: Number}) max: number = 100; @property({type: String}) trend: TankTrend = TankTrend.stable; @property({type: String}) variant: TankVariant = TankVariant.vertical; @property({type: String}) tag: string = ''; trendIcon(): HTMLTemplateResult { if (this.trend === TankTrend.fastRising) { return html``; } else if (this.trend === TankTrend.rising) { return html``; } else if (this.trend === TankTrend.fastFalling) { return html``; } else if (this.trend === TankTrend.falling) { return html``; } else { return html``; } } override render() { const percent = (this.value / this.max) * 100; return html`
${this.tag}
`; } static override styles = unsafeCSS(compentStyle); } declare global { interface HTMLElementTagNameMap { 'obc-automation-tank': ObcAutomationTank; } }