import { h, Host } from "@stencil/core";
import { FormGroupClass, FormGroupOrientation, FormGroupSizes } from "./constants";
import { govHost } from "../../../helpers/Dom/template";
import { validateProp } from "../../../helpers/Validate/props";
export class GovFormGroup {
    constructor() {
        /**
         * Gap's size.
         */
        this.gap = undefined;
        /**
         * Elements orientation
         */
        this.orientation = 'vertical';
        this.h = govHost(this.host);
    }
    validateGap(newValue) {
        if (newValue) {
            validateProp(FormGroupSizes, newValue, FormGroupClass.root);
        }
    }
    validateOrientation(newValue) {
        if (newValue) {
            validateProp(FormGroupOrientation, newValue, FormGroupClass.root);
        }
    }
    componentWillLoad() {
        this.validateGap(this.gap);
        this.validateOrientation(this.orientation);
    }
    render() {
        return (h(Host, { key: '54934f365448807adf7408b7feb96fff4244491c', gap: this.gap, class: this.h.classes(FormGroupClass.root) }, h("slot", { key: '184ae9ea447967ebce23c4dd40e2e14667f74960' })));
    }
    static get is() { return "gov-form-group"; }
    static get properties() {
        return {
            "gap": {
                "type": "string",
                "attribute": "gap",
                "mutable": false,
                "complexType": {
                    "original": "FormGroupSizesType",
                    "resolved": "\"2xl\" | \"l\" | \"m\" | \"s\" | \"xs\"",
                    "references": {
                        "FormGroupSizesType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-form/group/constants.ts::FormGroupSizesType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Gap's size."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "undefined"
            },
            "orientation": {
                "type": "string",
                "attribute": "orientation",
                "mutable": false,
                "complexType": {
                    "original": "FormGroupOrientationType",
                    "resolved": "\"horizontal\" | \"vertical\"",
                    "references": {
                        "FormGroupOrientationType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-form/group/constants.ts::FormGroupOrientationType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Elements orientation"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'vertical'"
            }
        };
    }
    static get elementRef() { return "host"; }
    static get watchers() {
        return [{
                "propName": "gap",
                "methodName": "validateGap"
            }, {
                "propName": "orientation",
                "methodName": "validateOrientation"
            }];
    }
}
//# sourceMappingURL=gov-form-group.js.map
