'use strict';

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

const index$1 = require('./index-578e90b1.js');

const BceElementForm = class {
    constructor(hostRef) {
        index$1.registerInstance(this, hostRef);
    }
    async validate(silent = false) {
        const root = this.el.shadowRoot;
        const query = root.querySelectorAll('bce-input');
        const inputs = Array.from(query);
        const errors = await Promise.all(inputs.map(el => el.validate(silent)));
        return [].concat(...errors);
    }
    render() {
        return this.template.input.map(input => (index$1.h("bce-input", { id: input.id, key: input.id, label: input.label, type: input.type, validation: input.required ? 'required' : undefined })));
    }
    get el() { return index$1.getElement(this); }
    static get style() { return ":host{position:relative;display:block}"; }
};

exports.bce_element_form = BceElementForm;
