/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { LitElement, css, html, customElement, property } from 'lit-element/lit-element.js';
let KCClockDisplay = class KCClockDisplay extends LitElement {
    constructor() {
        super(...arguments);
        this.h = '00';
        this.m = '00';
        this.s = '00';
    }
    static get styles() {
        return css `
            :host {
                display: flex;
                flex-direction: row;
                justify-content: flex-end;
                color: #fff;
                margin-right: 8px;
                font-size: 12px;
            }
            .data {
                width: 18px;
                display: flex;
                flex-direction: row;
                justify-content: center;
            }
            span {
                width: 10px;
                font-size: 11px;
                text-align: center;
            }
        `;
    }
    render() {
        return html `
            <div class="data">${this.h}</div>
            <span>&nbsp;:&nbsp;</span>
            <div class="data">${this.m}</div>
            <span>&nbsp;:&nbsp;</span>
            <div class="data">${this.s}</div>
        `;
    }
    _leftPadTime(n) {
        return n < 10 ? '0' + n : n.toString();
    }
    setTime(date) {
        this.h = this._leftPadTime(date.getHours()),
            this.m = this._leftPadTime(date.getMinutes()),
            this.s = this._leftPadTime(date.getSeconds());
    }
};
__decorate([
    property({ type: String })
], KCClockDisplay.prototype, "h", void 0);
__decorate([
    property({ type: String })
], KCClockDisplay.prototype, "m", void 0);
__decorate([
    property({ type: String })
], KCClockDisplay.prototype, "s", void 0);
KCClockDisplay = __decorate([
    customElement('kc-clock-display')
], KCClockDisplay);
export { KCClockDisplay };
//# sourceMappingURL=kc-clock-display.js.map