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;
};
// Lit
import { LitElement, html, css } from 'lit';
import { property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
// Default values
import { DEFAULT_POPUP_STYLE } from '../../constants/defaultValues.js';
// Components
import { inputStyle } from '../../styles/knobs/input.js';
export class AnnotativeKnobNumberDateTime extends LitElement {
    constructor() {
        super(...arguments);
        this.type = 'number';
        this.config = { max: null, min: null };
        this.popupStyle = DEFAULT_POPUP_STYLE;
        this.value = 0;
        this.onChange = () => { };
    }
    render() {
        const isRange = this.type === 'range';
        return html `
      ${isRange && this.config.min !== 0 && this.config.min
            ? html `<div class="min-max-label">${this.config.min}</div>`
            : ''}
      <input
        class="number"
        type=${this.type}
        style=${styleMap({
            color: this.popupStyle.textColor,
            border: `1px solid ${this.popupStyle.inputBorderColor}`,
        })}
        min=${this.config.min}
        max=${this.config.max}
        .value=${this.value}
        @change=${this.onChange}
      />
      ${isRange && this.config.max !== 0 && this.config.max
            ? html `<div class="min-max-label">${this.config.max}</div>`
            : ''}
    `;
    }
}
AnnotativeKnobNumberDateTime.styles = [
    inputStyle,
    css `
      .min-max-label {
        display: inline-block;
        vertical-align: top;
        transform: translateY(8px);
      }
    `,
];
__decorate([
    property({ attribute: 'type' })
], AnnotativeKnobNumberDateTime.prototype, "type", void 0);
__decorate([
    property({ attribute: 'config' })
], AnnotativeKnobNumberDateTime.prototype, "config", void 0);
__decorate([
    property({ attribute: 'popupStyle' })
], AnnotativeKnobNumberDateTime.prototype, "popupStyle", void 0);
__decorate([
    property({ attribute: 'value' })
], AnnotativeKnobNumberDateTime.prototype, "value", void 0);
__decorate([
    property({ attribute: 'onChange' })
], AnnotativeKnobNumberDateTime.prototype, "onChange", void 0);
customElements.get('annotative-code-knob-number-date-time') ||
    customElements.define('annotative-code-knob-number-date-time', AnnotativeKnobNumberDateTime);
//# sourceMappingURL=number-date-time.js.map