import { css, CSSResult, customElement, html, LitElement, property, TemplateResult, } from 'lit-element'; import { ClassInfo, classMap } from 'lit-html/directives/class-map'; import { Layout, Period } from '../types'; /** * Renders a Time Period selector with an input for a value and two arrows for step-chaning * the value up and down. */ @customElement('time-period') export class TimePeriodComponent extends LitElement { static readonly EVENT_TOGGLE = 'toggle'; @property() private period!: Period; @property() private mode!: Layout.HourMode; private get amClass(): ClassInfo { return { 'time-period': true, active: this.period === Period.AM }; } private get pmClass(): ClassInfo { return { 'time-period': true, active: this.period === Period.PM }; } render(): TemplateResult { return html`