import { h } from '../edel-elements.core.js';

class EdelFormComponent {
    constructor() {
        this.grid = false;
        this.spaced = false;
    }
    render() {
        return (h("form", { class: this.getClasses(), onSubmit: event => this.handleEvent(event) },
            h("slot", null)));
    }
    hostData() {
        return {
            class: 'form'
        };
    }
    getClasses() {
        return {
            'form--grid': this.grid,
            'form--spaced': this.spaced
        };
    }
    handleEvent(event) {
        if (event)
            event.preventDefault();
        this.emit.emit(event);
    }
    static get is() { return "edel-form"; }
    static get properties() { return {
        "grid": {
            "type": Boolean,
            "attr": "grid"
        },
        "hostElement": {
            "elementRef": true
        },
        "spaced": {
            "type": Boolean,
            "attr": "spaced"
        }
    }; }
    static get events() { return [{
            "name": "emit",
            "method": "emit",
            "bubbles": true,
            "cancelable": true,
            "composed": true
        }]; }
}

export { EdelFormComponent as EdelForm };
