'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-0f211bec.js');

const BceElementInput = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.handleInput = (event) => {
            event.cancelBubble = true;
            const target = event.target;
            this.value = target.value;
            this.el.dispatchEvent(new Event('input', { bubbles: true }));
        };
    }
    render() {
        if (!this.template)
            return null;
        const type = this.template.multiline ? 'textarea' : 'text';
        return [
            core.h("p", null, this.template.question),
            core.h("bce-input", { value: this.value, onInput: this.handleInput, validation: this.template.required ? 'required' : '', type: type })
        ];
    }
    get el() { return core.getElement(this); }
    static get style() { return "bce-element-input p{font-weight:500;text-align:center}\@media screen and (min-width:1024px){bce-element-input p{text-align:left}}"; }
};

exports.bce_element_input = BceElementInput;
